Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3b78be5ab
|
||
|
|
665ac44e5c
|
||
|
|
960e9e3c63
|
||
|
|
9c13d7766d
|
||
|
|
41dd3c893c
|
||
|
|
f4891ba402
|
||
|
|
a342f23ef9
|
||
|
|
2fd692dd7b
|
No files matched your search
@@ -29,12 +29,13 @@ jobs:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
|
||||
- name: ktlint (signature-checked)
|
||||
# ktlint 1.8.0 from Maven Central: the same jar the signed GitHub release wraps in a
|
||||
# shell header (checked byte for byte), from a host that does not 504 on release assets.
|
||||
- name: ktlint (hash-pinned)
|
||||
run: |
|
||||
curl -sSfL -o ktlint https://github.com/pinterest/ktlint/releases/download/1.8.0/ktlint
|
||||
echo "a3fd620207d5c40da6ca789b95e7f823c54e854b7fade7f613e91096a3706d75 ktlint" | sha256sum -c
|
||||
chmod +x ktlint
|
||||
./ktlint "app/src/**/*.kt" "*.kts" "app/*.kts"
|
||||
curl -sSfL --retry 5 --retry-all-errors -o ktlint.jar https://repo1.maven.org/maven2/com/pinterest/ktlint/ktlint-cli/1.8.0/ktlint-cli-1.8.0-all.jar
|
||||
echo "369ad2b789f95a011f807e1fcb690ccef80bd7cd014fd139e73ae82dcc0baeab ktlint.jar" | sha256sum -c
|
||||
java -jar ktlint.jar "app/src/**/*.kt" "*.kts" "app/*.kts"
|
||||
|
||||
- uses: gradle/actions/wrapper-validation@v4
|
||||
|
||||
@@ -47,10 +48,21 @@ jobs:
|
||||
run: ./gradlew --no-daemon lintFullDebug
|
||||
continue-on-error: true
|
||||
|
||||
# The test build a tester installs (Actions › this run › Artifacts): debug-signed with the
|
||||
# repository's public test key, so each one installs over the last. `full` is the one to
|
||||
# use; `fdroid` is the same app without the updater.
|
||||
- name: Name the test builds
|
||||
run: |
|
||||
mkdir test-builds
|
||||
short="${GITHUB_SHA::7}"
|
||||
cp app/build/outputs/apk/full/debug/app-full-debug.apk "test-builds/llembas-android-debug-$GITHUB_RUN_NUMBER-$short.apk"
|
||||
cp app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk "test-builds/llembas-android-debug-$GITHUB_RUN_NUMBER-$short-fdroid.apk"
|
||||
(cd test-builds && sha256sum *.apk > SHA256SUMS)
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: llembas-android-debug
|
||||
path: app/build/outputs/apk/*/debug/*.apk
|
||||
name: llembas-android-debug-${{ github.run_number }}
|
||||
path: test-builds/
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
|
||||
@@ -73,4 +73,7 @@ jobs:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
git tag -l --format='%(contents)' "$TAG" | sed '/-----BEGIN SSH SIGNATURE-----/,$d' > notes.md
|
||||
gh release create "$TAG" --verify-tag --title "LLeMbas for Android $VERSION" --notes-file notes.md dist/*
|
||||
# A `-beta.N` tag is a pre-release: never "Latest", never what /releases/latest hands out.
|
||||
pre=""
|
||||
case "$TAG" in *-*) pre="--prerelease" ;; esac
|
||||
gh release create "$TAG" --verify-tag $pre --title "LLeMbas for Android $VERSION" --notes-file notes.md dist/*
|
||||
@@ -8,6 +8,8 @@ local.properties
|
||||
# A release key never goes in the repository (CI writes it from secrets)
|
||||
*.jks
|
||||
*.keystore
|
||||
# ...except the public test key debug builds are signed with (see app/build.gradle.kts)
|
||||
!/app/test-debug.keystore
|
||||
# IDEs
|
||||
.idea/
|
||||
*.iml
|
||||
|
||||
@@ -5,6 +5,71 @@ is in alpha and releases come off `main`.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.0.0-beta.2] — 2026-11-09
|
||||
|
||||
For LLeMbas server 2.0 (2.0.0-beta.5 or later for the activity panel, the Thinking switch and team
|
||||
sizes).
|
||||
|
||||
### Added
|
||||
|
||||
- **New agent chat**, on the Agents tab: pick one of the devices linked right now (a computer
|
||||
running `lembas service`), optionally a folder on it, and the mode (Manual, Edit, Auto, Plan),
|
||||
and the first message starts the chat there. With no device linked, the screen says how to
|
||||
link one. An open agent chat's mode can be changed from the same chip.
|
||||
- **Photos**: the attach button offers Take a photo (the camera app, no camera permission for
|
||||
LLeMbas itself), Choose photos (Android's photo picker) and Choose files.
|
||||
- **Copy** a reply or one of your messages with the copy button under it.
|
||||
- **Rename chat** in the chat's menu.
|
||||
- **Try again** beside an error on the chat list.
|
||||
- **Test builds for every change**: each push to `dev` leaves an installable APK on the CI run,
|
||||
signed with a public test key so a newer test build installs over an older one. The version
|
||||
in Settings › About carries the run's number.
|
||||
- **The activity panel**: the lightning button in a chat, or the line above the message box
|
||||
("3 agents working · 1 queued"), opens a full-screen view of what the chat is doing --
|
||||
**Context** (how much of the model's window is used, a bar and the breakdown by category),
|
||||
**Outputs** (the files the chat and its agents wrote, with lines added and removed; tap one to
|
||||
read it), **Background tasks** (every helper, command and team member as a tree, with its
|
||||
state, how long it has run, its model, its latest step and what it is writing; open its whole
|
||||
conversation read-only, or stop it after a confirmation; finished ones folded under "N
|
||||
finished"), the team's **Room** and the **Plan**. It keeps itself current while it is open.
|
||||
- **Agents, fewest and most**, in the chat's chips where the model can run a team: how many
|
||||
agents the chat's team may have, its own included (1 to 4 to begin with). Set it before the
|
||||
first message or change it in an open chat.
|
||||
- **Model pictures**: the model picker and the chat's title show each model's picture from the
|
||||
instance, or its initial where it has none.
|
||||
|
||||
### Changed
|
||||
|
||||
- A beta (`vX.Y.Z-beta.N`) is published on GitHub as a pre-release by itself.
|
||||
- **The chat list is read again whenever you come back to it**, from a chat or another app, so a
|
||||
new chat, a new title or a finished reply shows without pulling to refresh.
|
||||
- **A reply being written stays in view**: the chat follows it to the end, unless you have
|
||||
scrolled up to read, and picks up again once you scroll back down.
|
||||
- **An instance that cannot be reached says so in one sentence** -- no network, an address that
|
||||
only resolves at home, a server that is down -- instead of a raw network error, everywhere:
|
||||
sign-in, the chats, a chat, Files, the viewer, the assistant and Share.
|
||||
- The effort chosen for a **new** chat is now sent with its first message (it was lost until the
|
||||
chat existed).
|
||||
- **The effort control is the model's own**: none for a model with one level, a **Think before
|
||||
answering** chip that switches thinking on and off for a model that offers exactly that, and
|
||||
the effort picker for more levels. "Off" is offered only by a model that can really switch
|
||||
thinking off. A chat started without a choice starts at the model's start level.
|
||||
- Requires the beta.5 `/api/v2` of LLeMbas 2.0 for the panel, the team size, the Thinking switch
|
||||
and the pictures; against an older 2.0 beta the app keeps the effort picker and the jobs chips.
|
||||
- The agent mode "Manual" is translated, and "Plan" no longer reads as a price plan in German,
|
||||
French and Hungarian.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **A message that could not be sent is not lost**: its words and attachments go back into the
|
||||
composer, with the reason.
|
||||
- Leaving a chat while a reply was streaming could show a "cancelled" error on the next one.
|
||||
- When the server refused the stream of a reply (the chat deleted elsewhere, the sign-in
|
||||
revoked), the half-drawn reply stayed on screen; the chat is now read again.
|
||||
|
||||
- **Pinned to LLeMbas server 2.0.0-beta.4**: the contract, the theme and the strings come from that
|
||||
release. Nothing a person sees changes; the server's API is the same as in beta.1.
|
||||
|
||||
## [1.0.0-beta.1] — 2026-11-03
|
||||
|
||||
For LLeMbas server 2.0, and only for it.
|
||||
|
||||
@@ -20,6 +20,13 @@ and check it against `SHA256SUMS`. The `full` APK updates itself from llembas.eu
|
||||
one does not. Android 10 or newer; the instance must run LLeMbas server 2.0 or newer (an older
|
||||
one is refused at sign-in, with a sentence saying so).
|
||||
|
||||
**Test builds.** Every push to `dev` builds a debug APK: open the newest green run under
|
||||
[Actions](https://github.com/LLeMbas/LLeMbas-Android/actions/workflows/ci.yml), download the
|
||||
`llembas-android-debug-N` artifact (GitHub asks you to be signed in), unzip it and install the APK that does
|
||||
not end in `-fdroid`. It is a separate app ("eu.llembas.android.debug") beside a released one,
|
||||
signed with a public test key kept in this repository, so each test build installs over the one
|
||||
before it -- and anyone could sign one, so take test builds only from this repository's runs.
|
||||
|
||||
If your instance uses a certificate from your own certificate authority, install that CA on the
|
||||
phone first (Settings › Security › Encryption & credentials › Install a certificate › CA
|
||||
certificate). The app trusts CAs you installed, as the browser does.
|
||||
|
||||
+15
-2
@@ -30,7 +30,7 @@ android {
|
||||
// The one source of the version. versionCode is derived from it, so the two cannot
|
||||
// drift, and a beta sorts below its release: 1.0.0-beta.1 -> 1000001,
|
||||
// 1.0.0-beta.2 -> 1000002, 1.0.0 -> 1000099, 1.2.3 -> 1020399.
|
||||
versionName = "1.0.0-beta.1"
|
||||
versionName = "1.0.0-beta.2"
|
||||
versionCode = versionName!!.split("-beta.").let { parts ->
|
||||
val (a, b, c) = parts[0].split(".").map { it.toInt() }
|
||||
val pre = if (parts.size == 2) parts[1].toInt() else 99
|
||||
@@ -39,6 +39,17 @@ android {
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
// Debug builds are signed with a *public* test key that lives in the repository, so the
|
||||
// APK every CI run uploads installs over the one before it (a runner's own debug key is
|
||||
// new each run, and Android refuses an update from a different signer). It signs only
|
||||
// the `.debug` application id, never a release, and it is no secret: anyone can sign
|
||||
// with it, so install a debug build only from this repository's CI.
|
||||
getByName("debug") {
|
||||
storeFile = file("test-debug.keystore")
|
||||
storePassword = "android"
|
||||
keyAlias = "androiddebugkey"
|
||||
keyPassword = "android"
|
||||
}
|
||||
releaseKey?.let { key ->
|
||||
create("release") {
|
||||
storeFile = file(key.getProperty("file"))
|
||||
@@ -58,7 +69,9 @@ android {
|
||||
}
|
||||
debug {
|
||||
applicationIdSuffix = ".debug"
|
||||
versionNameSuffix = "-debug"
|
||||
// CI's run number, so a tester can tell two test builds apart in Settings › About.
|
||||
versionNameSuffix = "-debug" + (System.getenv("GITHUB_RUN_NUMBER")?.let { ".$it" } ?: "")
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,5 +123,16 @@
|
||||
<receiver
|
||||
android:name=".push.CardActionReceiver"
|
||||
android:exported="false" />
|
||||
|
||||
<!-- A photo for the composer: the camera app writes into one file in the cache. -->
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.files"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -89,6 +89,7 @@ class MainActivity : ComponentActivity() {
|
||||
ChatsScreen(
|
||||
onOpen = { nav.navigate("chat/$it") },
|
||||
onNew = { nav.navigate("new") },
|
||||
onNewAgent = { nav.navigate("new-agent") },
|
||||
onSettings = { nav.navigate("settings") },
|
||||
onFiles = { nav.navigate("files") },
|
||||
)
|
||||
@@ -102,6 +103,16 @@ class MainActivity : ComponentActivity() {
|
||||
},
|
||||
)
|
||||
}
|
||||
composable("new-agent") {
|
||||
ChatScreen(
|
||||
chatId = null,
|
||||
agent = true,
|
||||
onBack = { nav.popBackStack() },
|
||||
onOpened = { id ->
|
||||
nav.navigate("chat/$id") { popUpTo("new-agent") { inclusive = true } }
|
||||
},
|
||||
)
|
||||
}
|
||||
composable("chat/{id}") { entry ->
|
||||
ChatScreen(chatId = entry.arguments?.getString("id"), onBack = { nav.popBackStack() })
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package eu.llembas.android.api
|
||||
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* The activity panel's arithmetic, apart from the screen so the tests can hold it: the numbers
|
||||
* are written as the server writes them (`compact_tokens`, `jobs.duration`), and the strip's
|
||||
* line counts what the web's strip counts.
|
||||
*/
|
||||
object ActivityLogic {
|
||||
/** A token count at a glance: 950, 14.2k, 180k, 1.54M (the server's `compact_tokens`). */
|
||||
fun compactTokens(value: Int): String {
|
||||
val n = value.coerceAtLeast(0)
|
||||
return when {
|
||||
n < 1000 -> n.toString()
|
||||
n < 100_000 -> trim(String.format(Locale.ROOT, "%.1f", n / 1000.0)) + "k"
|
||||
n < 1_000_000 -> "${Math.round(n / 1000.0)}k"
|
||||
else -> trim(String.format(Locale.ROOT, "%.2f", n / 1_000_000.0)) + "M"
|
||||
}
|
||||
}
|
||||
|
||||
private fun trim(number: String): String = if ('.' in number) number.trimEnd('0').trimEnd('.') else number
|
||||
|
||||
/** A duration as both the server and the CLI write it: `5s`, `1m 05s`, `2h 03m`. */
|
||||
fun duration(seconds: Long): String {
|
||||
val total = seconds.coerceAtLeast(0)
|
||||
if (total < 60) return "${total}s"
|
||||
val minutes = total / 60
|
||||
val rest = total % 60
|
||||
if (minutes < 60) return String.format(Locale.ROOT, "%dm %02ds", minutes, rest)
|
||||
return String.format(Locale.ROOT, "%dh %02dm", minutes / 60, minutes % 60)
|
||||
}
|
||||
|
||||
/**
|
||||
* How long an agent has run now: the server's count when it was read, plus the time since
|
||||
* for one that is still going. A queued one has not started, and an ended one has stopped
|
||||
* counting.
|
||||
*/
|
||||
fun elapsed(agent: ActivityAgent, readAtMillis: Long, nowMillis: Long): Long {
|
||||
val going = agent.state == "working" || agent.state == "waiting"
|
||||
val since = if (going) ((nowMillis - readAtMillis) / 1000).coerceAtLeast(0) else 0
|
||||
return agent.seconds + since
|
||||
}
|
||||
|
||||
/**
|
||||
* What the strip above the composer says, as counts in order: agents working, queued,
|
||||
* waiting. Empty when nothing is going -- then there is no strip.
|
||||
*/
|
||||
fun stripCounts(summary: ActivitySummary): List<Pair<String, Int>> =
|
||||
listOf("working" to summary.working, "queued" to summary.queued, "waiting" to summary.waiting).filter { it.second > 0 }
|
||||
|
||||
/** The top level split as the panel shows it: those still going, then the ended ones. */
|
||||
fun split(agents: List<ActivityAgent>): Pair<List<ActivityAgent>, List<ActivityAgent>> = agents.partition { it.isActive }
|
||||
|
||||
/** Every agent of a forest with its helpers under it, in tree order, for drawing as rows. */
|
||||
fun flatten(agents: List<ActivityAgent>): List<ActivityAgent> = agents.flatMap { listOf(it) + flatten(it.children) }
|
||||
|
||||
/**
|
||||
* The context's bar: one segment per category with tokens, `free` left out (it is the
|
||||
* empty end of the bar). Nothing at all when the window is unknown.
|
||||
*/
|
||||
fun barParts(context: ContextUse): List<ContextPart> {
|
||||
if (context.limit <= 0) return emptyList()
|
||||
return context.categories.filter { it.key != "free" && it.tokens > 0 }
|
||||
}
|
||||
|
||||
/** The plan the panel shows, read leniently: a plan that does not parse is no plan. */
|
||||
fun plan(json: JsonObject?): Plan? = json?.let { runCatching { LembasJson.decodeFromJsonElement(Plan.serializer(), it) }.getOrNull() }
|
||||
|
||||
/** A percentage as the server writes it: one decimal, none when it is whole. */
|
||||
fun percent(value: Double): String = trim(String.format(Locale.ROOT, "%.1f", value))
|
||||
}
|
||||
@@ -25,6 +25,9 @@ import java.io.IOException
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.coroutines.resumeWithException
|
||||
|
||||
/** Where a new agent chat runs: a linked device ([LinkedDevice.id]) and a folder on it. */
|
||||
data class AgentTarget(val device: String, val directory: String = "")
|
||||
|
||||
/** A refusal from the server, in its own words (`{"detail": "…"}`). */
|
||||
class ApiException(val status: Int, message: String) : IOException(message)
|
||||
|
||||
@@ -97,6 +100,11 @@ class Doorstep(private val http: OkHttpClient = SharedHttp) {
|
||||
private fun post(url: String, body: JsonObject) = Request.Builder().url(url).post(body.toString().toRequestBody(JSON)).build()
|
||||
}
|
||||
|
||||
private fun agentsJson(agents: AgentsSetting) = buildJsonObject {
|
||||
put("min", agents.min)
|
||||
put("max", agents.max)
|
||||
}
|
||||
|
||||
internal fun detail(response: Response): String {
|
||||
val text = runCatching { response.body?.string().orEmpty() }.getOrDefault("")
|
||||
val said = runCatching {
|
||||
@@ -168,6 +176,8 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
|
||||
temporary: Boolean = false,
|
||||
effort: String? = null,
|
||||
mode: String? = null,
|
||||
agent: AgentTarget? = null,
|
||||
agents: AgentsSetting? = null,
|
||||
): NewChat = send(
|
||||
"POST",
|
||||
"/chats",
|
||||
@@ -177,7 +187,16 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
|
||||
model?.let { put("model", it) }
|
||||
effort?.let { put("effort", it) }
|
||||
mode?.let { put("mode", it) }
|
||||
agents?.let { put("agents", agentsJson(it)) }
|
||||
put("temporary", temporary)
|
||||
// An agent chat runs on a linked device; an empty directory is the device's first
|
||||
// allowed one. A device that is no longer linked makes it an ordinary chat on the
|
||||
// server, rather than losing the message.
|
||||
agent?.let {
|
||||
put("kind", "agent")
|
||||
put("device", it.device)
|
||||
if (it.directory.isNotBlank()) put("directory", it.directory.trim())
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
@@ -192,6 +211,9 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
|
||||
|
||||
suspend fun updateChat(chatId: String, changes: JsonObject): Chat = send<ChatEnvelope>("PATCH", "/chats/$chatId", changes).chat
|
||||
|
||||
/** The team's size, both ends at once: the server checks the pair (422 outside its bounds). */
|
||||
suspend fun setAgents(chatId: String, agents: AgentsSetting): Chat = updateChat(chatId, buildJsonObject { put("agents", agentsJson(agents)) })
|
||||
|
||||
suspend fun deleteChat(chatId: String) = empty(authed("$v2/chats/$chatId").delete().build())
|
||||
|
||||
suspend fun stop(chatId: String, messageId: String) =
|
||||
@@ -211,6 +233,46 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
|
||||
empty(authed("$v2/chats/$chatId/interactions/$cardId").post(body).build())
|
||||
}
|
||||
|
||||
// --- The activity panel, background agents and the team -----------------------------------
|
||||
|
||||
/** Everything the panel shows; `context = false` leaves out the costly context count. */
|
||||
suspend fun activity(chatId: String, context: Boolean = true): Activity = get<ActivityEnvelope>("/chats/$chatId/activity?context=$context").activity
|
||||
|
||||
/** The events route: an `activity` frame whenever the panel's facts change. */
|
||||
fun activityEvents(chatId: String): Request = authed("$v2/chats/$chatId/activity/events").header("Accept", "text/event-stream").build()
|
||||
|
||||
/** One background agent and its whole conversation, read-only. `kind` is `member` or `job`. */
|
||||
suspend fun agent(chatId: String, kind: String, id: String): AgentDetail = get("/chats/$chatId/agents/${segment(kind)}/${segment(id)}")
|
||||
|
||||
/** Stop a background agent (a member leaves the team with those under it). */
|
||||
suspend fun stopAgent(chatId: String, kind: String, id: String): List<String> =
|
||||
send<Stopped>("POST", "/chats/$chatId/agents/${segment(kind)}/${segment(id)}/stop", null).stopped
|
||||
|
||||
suspend fun team(chatId: String, since: Int = 0): TeamView = get<TeamEnvelope>("/chats/$chatId/team?since=$since").team
|
||||
|
||||
suspend fun stopMember(chatId: String, name: String): List<String> = send<Stopped>("POST", "/chats/$chatId/team/${segment(name)}/stop", null).stopped
|
||||
|
||||
// --- Model pictures --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* A model's picture, with the token: only a path under the instance's own
|
||||
* `/api/v2/models/images/` is fetched -- a list that named anything else, another host
|
||||
* included, gets the initial instead. At most [IMAGE_MAX_BYTES]; null when there is none.
|
||||
*/
|
||||
suspend fun modelImage(path: String): ByteArray? = withContext(Dispatchers.IO) {
|
||||
val url = modelImageUrl(base, path) ?: return@withContext null
|
||||
http.newCall(authed(url).header("Accept", "image/*").get().build()).await().use {
|
||||
if (!it.isSuccessful) return@use null
|
||||
val body = it.body ?: return@use null
|
||||
if (body.contentLength() > IMAGE_MAX_BYTES) return@use null
|
||||
val bytes = body.source().use { source ->
|
||||
source.request(IMAGE_MAX_BYTES + 1)
|
||||
source.buffer.readByteArray(minOf(source.buffer.size, IMAGE_MAX_BYTES + 1))
|
||||
}
|
||||
bytes.takeIf { b -> b.size <= IMAGE_MAX_BYTES }
|
||||
}
|
||||
}
|
||||
|
||||
// --- Attachments -------------------------------------------------------------------------
|
||||
suspend fun upload(name: String, mime: String, bytes: ByteArray, chatId: String? = null): Attachment {
|
||||
val body = MultipartBody.Builder().setType(MultipartBody.FORM)
|
||||
@@ -325,5 +387,21 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
|
||||
const val SHOWN_MAX_BYTES = 1_100_000L
|
||||
|
||||
fun emptyBody(): RequestBody = ByteArray(0).toRequestBody(null)
|
||||
|
||||
/** A model's picture is small; anything larger is not one. */
|
||||
const val IMAGE_MAX_BYTES = 2_000_000L
|
||||
|
||||
private const val IMAGE_PATH = "/api/v2/models/images/"
|
||||
|
||||
/** The picture's URL on [base], or null for a path that is not one of the instance's pictures. */
|
||||
fun modelImageUrl(base: String, path: String?): String? {
|
||||
if (path.isNullOrBlank() || !path.startsWith(IMAGE_PATH)) return null
|
||||
val name = path.removePrefix(IMAGE_PATH)
|
||||
if (name.isEmpty() || !name.all { it.isLetterOrDigit() || it == '.' || it == '_' || it == '-' } || name.startsWith(".")) return null
|
||||
return "$base$IMAGE_PATH$name"
|
||||
}
|
||||
|
||||
/** One path segment, escaped: an agent's name or a job's id is a model's choice. */
|
||||
fun segment(value: String): String = java.net.URLEncoder.encode(value, "UTF-8").replace("+", "%20")
|
||||
}
|
||||
}
|
||||
@@ -81,9 +81,54 @@ data class ModelInfo(
|
||||
val vision: Boolean = false,
|
||||
val tools: Boolean = false,
|
||||
val efforts: List<String> = emptyList(),
|
||||
/** Whether the model's server stops thinking when asked: only then is `off` a level. */
|
||||
@SerialName("thinking_switch") val thinkingSwitch: Boolean = false,
|
||||
/** The levels a chat offers, in order (harness spec 3.2.0): `off` first when switchable. */
|
||||
val levels: List<String> = emptyList(),
|
||||
/** The level a chat starts at when none was chosen. */
|
||||
val effort: String = "",
|
||||
/** How the level is chosen: `none`, `switch` (Thinking on or off) or `slider`. */
|
||||
val control: String = "",
|
||||
/** How many requests the model's server answers at once; null for no stated limit. */
|
||||
val parallel: Int? = null,
|
||||
val context: Int = 0,
|
||||
/** The picture's path on the instance (`/api/v2/models/images/…`), read with the token. */
|
||||
val image: String? = null,
|
||||
val default: Boolean = false,
|
||||
)
|
||||
) {
|
||||
/**
|
||||
* The levels, for a server that says them; an older one said only `efforts`, offered after
|
||||
* an `off` that meant "the model's default" -- as the app showed it before.
|
||||
*/
|
||||
val offered: List<String> get() = levels.ifEmpty { if (efforts.isEmpty()) emptyList() else listOf("off") + efforts }
|
||||
|
||||
/** Which control the composer draws, by the server's word or, from an older one, by the count. */
|
||||
val levelControl: String
|
||||
get() = control.takeIf { it in CONTROLS } ?: when {
|
||||
offered.size <= 1 -> "none"
|
||||
offered.size == 2 && "off" in offered -> "switch"
|
||||
else -> "slider"
|
||||
}
|
||||
|
||||
/** The level in force: [chosen] when this model offers it, else its start level. */
|
||||
fun level(chosen: String?): String =
|
||||
chosen?.takeIf { it in offered } ?: effort.takeIf { it in offered } ?: offered.firstOrNull { it != "off" } ?: offered.firstOrNull().orEmpty()
|
||||
|
||||
/** For the Thinking switch: the level that is "on" (the one that is not `off`). */
|
||||
val onLevel: String get() = offered.firstOrNull { it != "off" } ?: effort
|
||||
|
||||
/**
|
||||
* Whether a new chat on this model may have a team, as far as the app can tell: the model
|
||||
* serves two requests at once (`parallel` ≥ 2, or no stated limit) and takes tools. The
|
||||
* server also needs subagents on, which only an existing chat's activity says
|
||||
* (`team_offered`); a setting it does not use is kept and does nothing.
|
||||
*/
|
||||
val mayHaveTeam: Boolean get() = tools && (parallel == null || parallel >= 2)
|
||||
|
||||
companion object {
|
||||
val CONTROLS = setOf("none", "switch", "slider")
|
||||
}
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class ModelList(val models: List<ModelInfo> = emptyList())
|
||||
@@ -118,15 +163,28 @@ data class Chat(
|
||||
val mode: String = "",
|
||||
val effort: String? = null,
|
||||
val device: Device? = null,
|
||||
/** An agent chat's session on its device (`lembas -s <id>` continues it); null until opened. */
|
||||
@SerialName("device_session_id") val deviceSessionId: String? = null,
|
||||
@SerialName("parent_chat_id") val parentChatId: String? = null,
|
||||
@SerialName("created_at") val createdAt: String? = null,
|
||||
@SerialName("updated_at") val updatedAt: String? = null,
|
||||
@SerialName("system_prompt") val systemPrompt: String? = null,
|
||||
val plan: JsonObject? = null,
|
||||
/** The team's size: how many agents, its own included, the chat may have. */
|
||||
val agents: AgentsSetting? = null,
|
||||
) {
|
||||
val isAgent: Boolean get() = kind == "agent"
|
||||
}
|
||||
|
||||
/** A chat's `agents {min, max}` (harness spec 3.2.0): `1 ≤ min ≤ max ≤` the instance's cap. */
|
||||
@Serializable
|
||||
data class AgentsSetting(val min: Int = 1, val max: Int = 4) {
|
||||
companion object {
|
||||
/** The spec's default cap; an instance may set it lower, and then refuses past it (422). */
|
||||
const val CAP = 32
|
||||
}
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class ChatPage(val chats: List<Chat> = emptyList(), val more: Boolean = false)
|
||||
|
||||
@@ -429,3 +487,179 @@ data class PushPayload(
|
||||
@SerialName("interaction_id") val interactionId: String? = null,
|
||||
val ask: String? = null,
|
||||
)
|
||||
|
||||
// --- The activity panel (`GET /chats/{chat}/activity`) -------------------------------------
|
||||
|
||||
/** How many background agents are in each state, and the three sums the strip shows. */
|
||||
@Serializable
|
||||
data class ActivitySummary(
|
||||
val queued: Int = 0,
|
||||
val working: Int = 0,
|
||||
val waiting: Int = 0,
|
||||
val done: Int = 0,
|
||||
val stopped: Int = 0,
|
||||
val error: Int = 0,
|
||||
val active: Int = 0,
|
||||
val finished: Int = 0,
|
||||
val total: Int = 0,
|
||||
)
|
||||
|
||||
/** An agent's latest step: the tool it called and on what. */
|
||||
@Serializable
|
||||
data class AgentStep(val tool: String = "", val label: String = "", val title: String = "", val error: Boolean = false, val running: Boolean = false)
|
||||
|
||||
/**
|
||||
* One background agent: a team's member (`kind` member, [id] its name) or a job (`kind` job;
|
||||
* [type] `subagent` or `command`), with its own helpers in [children]. [role], [brief] and
|
||||
* [text] are a model's words: shown as text, never as anything richer.
|
||||
*/
|
||||
@Serializable
|
||||
data class ActivityAgent(
|
||||
val kind: String = "",
|
||||
val id: String = "",
|
||||
val type: String = "",
|
||||
val name: String = "",
|
||||
val role: String = "",
|
||||
val brief: String = "",
|
||||
val state: String = "",
|
||||
val seconds: Int = 0,
|
||||
val started: String = "",
|
||||
val model: String = "",
|
||||
val agent: String = "",
|
||||
val manager: String? = null,
|
||||
val depth: Int = 0,
|
||||
val lead: Boolean = false,
|
||||
val step: AgentStep? = null,
|
||||
val text: String = "",
|
||||
val steps: Int = 0,
|
||||
val tools: Int = 0,
|
||||
val stoppable: Boolean = false,
|
||||
val transcript: Boolean = false,
|
||||
val children: List<ActivityAgent> = emptyList(),
|
||||
) {
|
||||
/** Still to come back: queued, working or waiting. */
|
||||
val isActive: Boolean get() = state in ACTIVE
|
||||
|
||||
companion object {
|
||||
val ACTIVE = setOf("queued", "working", "waiting")
|
||||
}
|
||||
}
|
||||
|
||||
/** One message in a team's room. [text] is a model's: rendered as untrusted markdown. */
|
||||
@Serializable
|
||||
data class RoomMessage(
|
||||
val n: Int = 0,
|
||||
val from: String = "",
|
||||
val to: List<String> = emptyList(),
|
||||
val text: String = "",
|
||||
val report: Boolean = false,
|
||||
val created: String = "",
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class ActivityTeam(
|
||||
val min: Int = 1,
|
||||
val max: Int = 1,
|
||||
val size: Int = 0,
|
||||
val goal: String = "",
|
||||
val room: List<RoomMessage> = emptyList(),
|
||||
val cursor: Int = 0,
|
||||
)
|
||||
|
||||
/** One category of the context: `messages`, `system`, `memory`, … and `free`. */
|
||||
@Serializable
|
||||
data class ContextPart(val key: String = "", val tokens: Int = 0, val percent: Double? = null)
|
||||
|
||||
@Serializable
|
||||
data class ContextUse(
|
||||
val used: Int = 0,
|
||||
val limit: Int = 0,
|
||||
val percent: Double? = null,
|
||||
val measured: Boolean = false,
|
||||
val threshold: Int = 0,
|
||||
@SerialName("tools_count") val toolsCount: Int = 0,
|
||||
@SerialName("mcp_count") val mcpCount: Int = 0,
|
||||
val categories: List<ContextPart> = emptyList(),
|
||||
)
|
||||
|
||||
/** A file the chat or its agents wrote: lines added and removed when known. */
|
||||
@Serializable
|
||||
data class Output(
|
||||
val path: String = "",
|
||||
val name: String = "",
|
||||
val writes: Int = 0,
|
||||
val created: Boolean = false,
|
||||
val added: Int? = null,
|
||||
val removed: Int? = null,
|
||||
val at: String = "",
|
||||
)
|
||||
|
||||
/** Everything the activity panel shows. [version] changes whenever any of it but the elapsed time does. */
|
||||
@Serializable
|
||||
data class Activity(
|
||||
val version: String = "",
|
||||
val summary: ActivitySummary = ActivitySummary(),
|
||||
val agents: List<ActivityAgent> = emptyList(),
|
||||
val team: ActivityTeam? = null,
|
||||
@SerialName("team_offered") val teamOffered: Boolean = false,
|
||||
val context: ContextUse? = null,
|
||||
val outputs: List<Output> = emptyList(),
|
||||
val plan: JsonObject? = null,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class ActivityEnvelope(val activity: Activity)
|
||||
|
||||
/** The events route's frame: what changed is fetched with `GET /activity`. */
|
||||
@Serializable
|
||||
data class ActivityFrame(val version: String = "", val summary: ActivitySummary = ActivitySummary())
|
||||
|
||||
/** A tool call in an agent's conversation: its name and what it was on. */
|
||||
@Serializable
|
||||
data class TurnTool(val name: String = "", val title: String = "", val isError: Boolean = false)
|
||||
|
||||
/** One turn of a background agent's conversation. `machine`: a message the system gave it. */
|
||||
@Serializable
|
||||
data class AgentTurn(
|
||||
val role: String = "",
|
||||
val text: String = "",
|
||||
val machine: Boolean = false,
|
||||
val tools: List<TurnTool> = emptyList(),
|
||||
val error: String = "",
|
||||
val running: Boolean = false,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class AgentDetail(val agent: ActivityAgent, val transcript: List<AgentTurn> = emptyList())
|
||||
|
||||
@Serializable
|
||||
data class Stopped(val stopped: List<String> = emptyList())
|
||||
|
||||
/** One agent of a team's tree (`GET /chats/{chat}/team`). */
|
||||
@Serializable
|
||||
data class TeamAgent(
|
||||
val name: String = "",
|
||||
val manager: String? = null,
|
||||
val role: String = "",
|
||||
val state: String = "",
|
||||
val model: String = "",
|
||||
val agent: String = "",
|
||||
val lead: Boolean = false,
|
||||
val depth: Int = 0,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class TeamView(
|
||||
val offered: Boolean = false,
|
||||
val min: Int = 1,
|
||||
val max: Int = 1,
|
||||
val size: Int = 0,
|
||||
val parallel: Int? = null,
|
||||
val goal: String = "",
|
||||
val agents: List<TeamAgent> = emptyList(),
|
||||
val room: List<RoomMessage> = emptyList(),
|
||||
val cursor: Int = 0,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class TeamEnvelope(val team: TeamView)
|
||||
@@ -5,6 +5,7 @@ import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.callbackFlow
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import okhttp3.sse.EventSource
|
||||
import okhttp3.sse.EventSourceListener
|
||||
@@ -31,7 +32,7 @@ class StreamClient(private val api: ApiClient) {
|
||||
while (true) {
|
||||
var closed = false
|
||||
var refused: ApiException? = null
|
||||
once(chatId, messageId).collect { result ->
|
||||
once(api.streamRequest(chatId, messageId)).collect { result ->
|
||||
when (result) {
|
||||
is Outcome.Event -> {
|
||||
wait = 1_000L
|
||||
@@ -51,15 +52,45 @@ class StreamClient(private val api: ApiClient) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Follow an events route that ends itself now and then (`close` after a while, as the
|
||||
* activity panel's does): opened again at once after a `close`, and after a pause that
|
||||
* grows to 30 seconds when the connection drops. It runs until its collector stops; a
|
||||
* refusal (4xx) ends it with the error.
|
||||
*/
|
||||
fun watch(request: () -> Request): Flow<Frame> = flow {
|
||||
var wait = 1_000L
|
||||
while (true) {
|
||||
var closed = false
|
||||
var refused: ApiException? = null
|
||||
once(request()).collect { result ->
|
||||
when (result) {
|
||||
is Outcome.Event -> {
|
||||
wait = 1_000L
|
||||
if (result.frame.event == "close") closed = true else emit(result.frame)
|
||||
}
|
||||
|
||||
is Outcome.Refused -> refused = result.error
|
||||
|
||||
is Outcome.Dropped -> Unit
|
||||
}
|
||||
}
|
||||
refused?.let { throw it }
|
||||
if (closed) continue
|
||||
delay(wait)
|
||||
wait = (wait * 2).coerceAtMost(30_000L)
|
||||
}
|
||||
}
|
||||
|
||||
private sealed interface Outcome {
|
||||
data class Event(val frame: Frame) : Outcome
|
||||
data class Refused(val error: ApiException) : Outcome
|
||||
data object Dropped : Outcome
|
||||
}
|
||||
|
||||
private fun once(chatId: String, messageId: String): Flow<Outcome> = callbackFlow {
|
||||
private fun once(request: Request): Flow<Outcome> = callbackFlow {
|
||||
val source = EventSources.createFactory(http).newEventSource(
|
||||
api.streamRequest(chatId, messageId),
|
||||
request,
|
||||
object : EventSourceListener() {
|
||||
override fun onEvent(eventSource: EventSource, id: String?, type: String?, data: String) {
|
||||
trySend(Outcome.Event(Frame(type ?: "message", data)))
|
||||
|
||||
@@ -8,6 +8,7 @@ import eu.llembas.android.api.LiveReply
|
||||
import eu.llembas.android.api.StreamClient
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.push.Notifications
|
||||
import eu.llembas.android.ui.explain
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
@@ -81,7 +82,7 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
_state.update { it.copy(busy = false) }
|
||||
if (text.isNotBlank()) ask(text, spoken = true)
|
||||
} catch (e: Exception) {
|
||||
_state.update { it.copy(busy = false, error = e.message) }
|
||||
_state.update { it.copy(busy = false, error = context.explain(e)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +116,7 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
if (words.isNotBlank()) speaker.play(api.speech(plain(words)))
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
_state.update { it.copy(error = e.message ?: e.javaClass.simpleName) }
|
||||
_state.update { it.copy(error = context.explain(e)) }
|
||||
} finally {
|
||||
_state.update { it.copy(busy = false) }
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import eu.llembas.android.MainActivity
|
||||
import eu.llembas.android.R
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.push.Notifications
|
||||
import eu.llembas.android.ui.explain
|
||||
import eu.llembas.android.ui.theme.LembasTheme
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
@@ -103,7 +104,7 @@ class ShareActivity : ComponentActivity() {
|
||||
)
|
||||
finish()
|
||||
} catch (e: Exception) {
|
||||
failure.value = e.message ?: e.javaClass.simpleName
|
||||
failure.value = explain(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package eu.llembas.android.ui
|
||||
|
||||
import android.content.Context
|
||||
import eu.llembas.android.R
|
||||
import eu.llembas.android.api.ApiException
|
||||
import java.net.ConnectException
|
||||
import java.net.NoRouteToHostException
|
||||
import java.net.SocketTimeoutException
|
||||
import java.net.UnknownHostException
|
||||
|
||||
/**
|
||||
* A failure in words a person can act on. The server's refusal is its own sentence; a phone
|
||||
* that cannot reach the instance at all -- no network, a name that does not resolve off the
|
||||
* home network, a server that is down -- is one sentence saying so, rather than
|
||||
* "Unable to resolve host" or "failed to connect to /…:443". A certificate the phone does not
|
||||
* trust keeps its own message: that one names what to fix.
|
||||
*/
|
||||
fun Context.explain(e: Throwable): String = when {
|
||||
e is ApiException -> e.message?.ifBlank { null } ?: getString(R.string.offline)
|
||||
unreachable(e) -> getString(R.string.offline)
|
||||
else -> e.message?.ifBlank { null } ?: e.javaClass.simpleName
|
||||
}
|
||||
|
||||
/** Whether a failure means "the instance cannot be reached" rather than "it said no". */
|
||||
fun unreachable(e: Throwable): Boolean = e is UnknownHostException || e is ConnectException || e is SocketTimeoutException || e is NoRouteToHostException
|
||||
@@ -0,0 +1,97 @@
|
||||
package eu.llembas.android.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import android.util.LruCache
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.ImageBitmap
|
||||
import androidx.compose.ui.graphics.asImageBitmap
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import eu.llembas.android.api.ModelInfo
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.ui.theme.LocalPalette
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
/**
|
||||
* Models' pictures, fetched once with the token and kept small in memory. A picture that
|
||||
* failed is not asked for again until the app starts anew; the initial stands in for it.
|
||||
*/
|
||||
private object ModelImages {
|
||||
private const val SIDE = 128
|
||||
private val cache = LruCache<String, ImageBitmap>(48)
|
||||
private val failed = mutableSetOf<String>()
|
||||
|
||||
fun cached(path: String): ImageBitmap? = cache.get(path)
|
||||
|
||||
suspend fun load(context: Context, path: String): ImageBitmap? {
|
||||
cache.get(path)?.let { return it }
|
||||
if (path in failed) return null
|
||||
val api = context.lembas.instances.client() ?: return null
|
||||
val bytes = runCatching { api.modelImage(path) }.getOrNull()
|
||||
val image = bytes?.let { decode(it) }
|
||||
if (image == null) failed += path else cache.put(path, image)
|
||||
return image
|
||||
}
|
||||
|
||||
/** Decoded at about [SIDE] pixels a side: an avatar, not the original. */
|
||||
private suspend fun decode(bytes: ByteArray): ImageBitmap? = withContext(Dispatchers.Default) {
|
||||
val bounds = BitmapFactory.Options().apply { inJustDecodeBounds = true }
|
||||
BitmapFactory.decodeByteArray(bytes, 0, bytes.size, bounds)
|
||||
if (bounds.outWidth <= 0 || bounds.outHeight <= 0) return@withContext null
|
||||
var sample = 1
|
||||
while (minOf(bounds.outWidth, bounds.outHeight) / (sample * 2) >= SIDE) sample *= 2
|
||||
val options = BitmapFactory.Options().apply { inSampleSize = sample }
|
||||
BitmapFactory.decodeByteArray(bytes, 0, bytes.size, options)?.asImageBitmap()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A model's picture in a circle, as the web UI shows it beside the model's name: the picture
|
||||
* the instance has for it, or its initial on the theme's soft accent when there is none (or
|
||||
* while it loads, or when it could not be read).
|
||||
*/
|
||||
@Composable
|
||||
fun ModelAvatar(model: ModelInfo?, fallbackName: String, size: Dp = 24.dp, modifier: Modifier = Modifier) {
|
||||
val context = LocalContext.current
|
||||
val palette = LocalPalette.current
|
||||
val path = model?.image
|
||||
var image by remember(path) { mutableStateOf(path?.let { ModelImages.cached(it) }) }
|
||||
LaunchedEffect(path) {
|
||||
if (path != null && image == null) image = ModelImages.load(context, path)
|
||||
}
|
||||
Box(modifier.size(size).clip(CircleShape).background(palette.accentSoft), contentAlignment = Alignment.Center) {
|
||||
val shown = image
|
||||
if (shown != null) {
|
||||
Image(shown, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.fillMaxSize())
|
||||
} else {
|
||||
val name = model?.name?.ifBlank { null } ?: fallbackName
|
||||
Text(
|
||||
name.trim().firstOrNull()?.uppercase() ?: "?",
|
||||
color = palette.ink,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = with(LocalDensity.current) { (size * 0.5f).toSp() },
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,661 @@
|
||||
@file:OptIn(androidx.compose.material3.ExperimentalMaterial3Api::class)
|
||||
|
||||
package eu.llembas.android.ui.chat
|
||||
|
||||
import android.os.SystemClock
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
|
||||
import androidx.compose.material.icons.automirrored.filled.NoteAdd
|
||||
import androidx.compose.material.icons.filled.Bolt
|
||||
import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material.icons.filled.Description
|
||||
import androidx.compose.material.icons.filled.ExpandLess
|
||||
import androidx.compose.material.icons.filled.ExpandMore
|
||||
import androidx.compose.material.icons.filled.Groups
|
||||
import androidx.compose.material.icons.filled.StopCircle
|
||||
import androidx.compose.material.icons.filled.Visibility
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableLongStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberUpdatedState
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import eu.llembas.android.R
|
||||
import eu.llembas.android.api.Activity
|
||||
import eu.llembas.android.api.ActivityAgent
|
||||
import eu.llembas.android.api.ActivityLogic
|
||||
import eu.llembas.android.api.ActivitySummary
|
||||
import eu.llembas.android.api.AgentDetail
|
||||
import eu.llembas.android.api.ContextUse
|
||||
import eu.llembas.android.api.Output
|
||||
import eu.llembas.android.api.RoomMessage
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.ui.MarkdownText
|
||||
import eu.llembas.android.ui.explain
|
||||
import eu.llembas.android.ui.theme.LocalPalette
|
||||
import eu.llembas.android.ui.theme.Palette
|
||||
import eu.llembas.android.ui.viewer.TreeFileViewer
|
||||
import kotlinx.coroutines.delay
|
||||
|
||||
// --- The strip above the composer ---------------------------------------------------------
|
||||
|
||||
/** What runs in the background, in one line ("3 agents working · 1 queued"), opening the panel. */
|
||||
@Composable
|
||||
fun ActivityStrip(summary: ActivitySummary, onOpen: () -> Unit) {
|
||||
val counts = ActivityLogic.stripCounts(summary)
|
||||
if (counts.isEmpty()) return
|
||||
val palette = LocalPalette.current
|
||||
val words = counts.map { (state, n) -> stateCount(state, n) }
|
||||
Surface(
|
||||
onClick = onOpen,
|
||||
color = palette.surfaceRaised,
|
||||
shape = RoundedCornerShape(8.dp),
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp, vertical = 4.dp).heightIn(min = 48.dp),
|
||||
) {
|
||||
Row(Modifier.padding(horizontal = 12.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
Icon(Icons.Filled.Bolt, contentDescription = null, tint = palette.accent, modifier = Modifier.size(18.dp))
|
||||
Text(
|
||||
words.joinToString(" · "),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.weight(1f).padding(horizontal = 8.dp),
|
||||
)
|
||||
Icon(Icons.AutoMirrored.Filled.KeyboardArrowRight, contentDescription = stringResource(R.string.activity_open), tint = palette.inkFaint)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun stateCount(state: String, n: Int): String = when (state) {
|
||||
"working" -> if (n == 1) stringResource(R.string.agents_one_working) else stringResource(R.string.agents_n_working, n.toString())
|
||||
"queued" -> stringResource(R.string.agents_n_queued, n.toString())
|
||||
"waiting" -> stringResource(R.string.agents_n_waiting, n.toString())
|
||||
else -> stringResource(R.string.agents_n_finished, n.toString())
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun stateWord(state: String): String = when (state) {
|
||||
"queued" -> stringResource(R.string.agent_state_queued)
|
||||
"working" -> stringResource(R.string.agent_state_working)
|
||||
"waiting" -> stringResource(R.string.agent_state_waiting)
|
||||
"done" -> stringResource(R.string.agent_state_done)
|
||||
"stopped" -> stringResource(R.string.agent_state_stopped)
|
||||
else -> stringResource(R.string.agent_state_error)
|
||||
}
|
||||
|
||||
/** The state's dot, in the web panel's colours: accent working, warning waiting, success done. */
|
||||
private fun stateColour(palette: Palette, state: String): Color = when (state) {
|
||||
"working" -> palette.accent
|
||||
"queued", "waiting" -> palette.warning
|
||||
"done" -> palette.success
|
||||
"error" -> palette.danger
|
||||
else -> palette.inkFaint
|
||||
}
|
||||
|
||||
/** A context category's colour, as the web's `activity-context__seg--*` maps them to tokens. */
|
||||
private fun categoryColour(palette: Palette, key: String): Color = when (key) {
|
||||
"messages" -> palette.accent
|
||||
"system" -> palette.inkMuted
|
||||
"memory" -> palette.warning
|
||||
"instructions" -> palette.success
|
||||
"tools" -> palette.ink
|
||||
"mcp_tools" -> palette.danger
|
||||
"since" -> palette.inkFaint
|
||||
"buffer" -> palette.borderStrong
|
||||
else -> palette.border
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun categoryName(key: String): String = when (key) {
|
||||
"messages" -> stringResource(R.string.ctx_messages)
|
||||
"system" -> stringResource(R.string.ctx_system)
|
||||
"memory" -> stringResource(R.string.ctx_memory)
|
||||
"instructions" -> stringResource(R.string.ctx_instructions)
|
||||
"tools" -> stringResource(R.string.ctx_tools)
|
||||
"mcp_tools" -> stringResource(R.string.ctx_mcp_tools)
|
||||
"since" -> stringResource(R.string.ctx_since)
|
||||
"buffer" -> stringResource(R.string.ctx_buffer)
|
||||
"free" -> stringResource(R.string.ctx_free)
|
||||
else -> key
|
||||
}
|
||||
|
||||
// --- The panel ------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* The chat's activity, full screen: Context, Outputs, Background tasks (with the team's room)
|
||||
* and Plan -- the web's activity panel, from `GET /chats/{chat}/activity`. Kept current by the
|
||||
* events route through the view model; without it, read again every few seconds while open.
|
||||
* Everything an agent wrote is a model's words: names, roles and briefs as plain text, the
|
||||
* room and replies through [MarkdownText]'s untrusted rules.
|
||||
*/
|
||||
@Composable
|
||||
fun ActivityPanel(chatId: String, state: ChatState, model: ChatViewModel, canOpenFiles: Boolean, onClose: () -> Unit) {
|
||||
val activity = state.activity
|
||||
val live by rememberUpdatedState(state.activityLive)
|
||||
var now by remember { mutableLongStateOf(SystemClock.elapsedRealtime()) }
|
||||
var stopping by remember { mutableStateOf<ActivityAgent?>(null) }
|
||||
var reading by remember { mutableStateOf<ActivityAgent?>(null) }
|
||||
var viewing by remember { mutableStateOf<String?>(null) }
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
model.panel(true)
|
||||
var ticks = 0
|
||||
while (true) {
|
||||
delay(1_000)
|
||||
now = SystemClock.elapsedRealtime()
|
||||
ticks++
|
||||
// Without the events route, the panel reads itself again: cheaply, every 5 s.
|
||||
if (!live && ticks % 5 == 0) model.loadActivity(context = false)
|
||||
}
|
||||
}
|
||||
|
||||
val close = {
|
||||
model.panel(false)
|
||||
onClose()
|
||||
}
|
||||
Dialog(onDismissRequest = close, properties = DialogProperties(usePlatformDefaultWidth = false)) {
|
||||
Scaffold(
|
||||
topBar = {
|
||||
TopAppBar(
|
||||
navigationIcon = {
|
||||
IconButton(onClick = close) { Icon(Icons.Filled.Close, contentDescription = stringResource(R.string.close)) }
|
||||
},
|
||||
title = { Text(stringResource(R.string.activity)) },
|
||||
)
|
||||
},
|
||||
) { padding ->
|
||||
if (activity == null) {
|
||||
Box(Modifier.padding(padding).fillMaxSize(), contentAlignment = Alignment.Center) { CircularProgressIndicator() }
|
||||
return@Scaffold
|
||||
}
|
||||
LazyColumn(
|
||||
Modifier.padding(padding).fillMaxSize(),
|
||||
contentPadding = PaddingValues(16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
item { Section(stringResource(R.string.activity_context)) { ContextSection(activity.context) } }
|
||||
item {
|
||||
Section(stringResource(R.string.activity_outputs), count = activity.outputs.size.takeIf { it > 0 }) {
|
||||
OutputsSection(activity.outputs, canOpenFiles) { viewing = it }
|
||||
}
|
||||
}
|
||||
item {
|
||||
Section(stringResource(R.string.activity_tasks)) {
|
||||
TasksSection(activity, state.activityAt, now, onStop = { stopping = it }, onRead = { reading = it })
|
||||
}
|
||||
}
|
||||
ActivityLogic.plan(activity.plan)?.let { plan ->
|
||||
item { Section(stringResource(R.string.mode_plan)) { PlanBody(plan) } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stopping?.let { agent ->
|
||||
AlertDialog(
|
||||
onDismissRequest = { stopping = null },
|
||||
title = { Text(stringResource(R.string.agent_stop, agent.name)) },
|
||||
text = {
|
||||
Text(
|
||||
if (agent.kind == "member") {
|
||||
stringResource(R.string.agent_stop_member_confirm, agent.name)
|
||||
} else {
|
||||
stringResource(R.string.agent_stop_confirm, agent.name)
|
||||
},
|
||||
)
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(onClick = {
|
||||
model.stopAgent(agent)
|
||||
stopping = null
|
||||
}) { Text(stringResource(R.string.stop)) }
|
||||
},
|
||||
dismissButton = { TextButton(onClick = { stopping = null }) { Text(stringResource(R.string.cancel)) } },
|
||||
)
|
||||
}
|
||||
reading?.let { agent -> AgentConversation(chatId, agent, onClose = { reading = null }) }
|
||||
viewing?.let { path -> TreeFileViewer(path, onClose = { viewing = null }) }
|
||||
}
|
||||
|
||||
/** A heading that folds its section away, open to begin with. */
|
||||
@Composable
|
||||
private fun Section(title: String, count: Int? = null, content: @Composable () -> Unit) {
|
||||
val palette = LocalPalette.current
|
||||
var open by rememberSaveable(title) { mutableStateOf(true) }
|
||||
Column(Modifier.fillMaxWidth()) {
|
||||
Row(
|
||||
Modifier.fillMaxWidth().heightIn(min = 48.dp).clickable { open = !open },
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Text(title, style = MaterialTheme.typography.titleSmall, modifier = Modifier.weight(1f))
|
||||
count?.let { Text(it.toString(), style = MaterialTheme.typography.labelMedium, color = palette.inkMuted, modifier = Modifier.padding(end = 8.dp)) }
|
||||
Icon(if (open) Icons.Filled.ExpandLess else Icons.Filled.ExpandMore, contentDescription = null, tint = palette.inkFaint)
|
||||
}
|
||||
if (open) content()
|
||||
HorizontalDivider(Modifier.padding(top = 8.dp), color = palette.border)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Empty(text: String) {
|
||||
Text(text, style = MaterialTheme.typography.bodySmall, color = LocalPalette.current.inkMuted)
|
||||
}
|
||||
|
||||
// --- Context --------------------------------------------------------------------------------
|
||||
|
||||
@Composable
|
||||
private fun ContextSection(context: ContextUse?) {
|
||||
val palette = LocalPalette.current
|
||||
if (context == null) {
|
||||
Empty(stringResource(R.string.activity_not_measured))
|
||||
return
|
||||
}
|
||||
Column(verticalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
val pct = context.percent
|
||||
Text(
|
||||
if (pct != null) stringResource(R.string.activity_used, ActivityLogic.percent(pct)) else ActivityLogic.compactTokens(context.used),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier.weight(1f),
|
||||
)
|
||||
Text(
|
||||
if (context.limit > 0) {
|
||||
"${ActivityLogic.compactTokens(context.used)} / ${ActivityLogic.compactTokens(context.limit)}"
|
||||
} else {
|
||||
stringResource(R.string.activity_window_unknown)
|
||||
},
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = palette.inkMuted,
|
||||
)
|
||||
}
|
||||
val parts = ActivityLogic.barParts(context)
|
||||
if (parts.isNotEmpty()) {
|
||||
// One segment per category, by its tokens; the rest of the window is the bar's own
|
||||
// background. Weights, so the segments always fill exactly the bar's width.
|
||||
Row(Modifier.fillMaxWidth().height(8.dp).clip(RoundedCornerShape(4.dp)).background(palette.surfaceRaised)) {
|
||||
parts.forEach { part -> Box(Modifier.weight(part.tokens.toFloat()).fillMaxHeight().background(categoryColour(palette, part.key))) }
|
||||
val rest = (context.limit - parts.sumOf { it.tokens }).coerceAtLeast(0)
|
||||
if (rest > 0) Spacer(Modifier.weight(rest.toFloat()))
|
||||
}
|
||||
}
|
||||
// Each row a fixed grid: swatch, the name that gives, two number columns of their own
|
||||
// width -- the numbers line up whatever the names say in which language.
|
||||
context.categories.forEach { part ->
|
||||
Row(Modifier.fillMaxWidth().heightIn(min = 24.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
Box(Modifier.size(10.dp).clip(RoundedCornerShape(2.dp)).background(categoryColour(palette, part.key)))
|
||||
Text(
|
||||
categoryName(part.key),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.weight(1f).padding(horizontal = 8.dp),
|
||||
)
|
||||
Text(
|
||||
ActivityLogic.compactTokens(part.tokens),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
textAlign = TextAlign.End,
|
||||
modifier = Modifier.width(56.dp),
|
||||
)
|
||||
Text(
|
||||
part.percent?.let { "${ActivityLogic.percent(it)}%" } ?: "—",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = palette.inkMuted,
|
||||
textAlign = TextAlign.End,
|
||||
modifier = Modifier.width(56.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
Text(
|
||||
stringResource(if (context.measured) R.string.activity_measured else R.string.activity_estimated) + " " +
|
||||
stringResource(R.string.activity_tools_offered, context.toolsCount.toString()),
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = palette.inkFaint,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// --- Outputs --------------------------------------------------------------------------------
|
||||
|
||||
@Composable
|
||||
private fun OutputsSection(outputs: List<Output>, canOpen: Boolean, onOpen: (String) -> Unit) {
|
||||
val palette = LocalPalette.current
|
||||
if (outputs.isEmpty()) {
|
||||
Empty(stringResource(R.string.outputs_empty))
|
||||
return
|
||||
}
|
||||
Column {
|
||||
outputs.forEach { out ->
|
||||
Row(
|
||||
Modifier.fillMaxWidth().heightIn(min = 48.dp).clickable(enabled = canOpen && out.path.isNotBlank()) { onOpen(out.path) },
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Icon(
|
||||
if (out.created) Icons.AutoMirrored.Filled.NoteAdd else Icons.Filled.Description,
|
||||
contentDescription = null,
|
||||
tint = palette.inkMuted,
|
||||
modifier = Modifier.size(18.dp),
|
||||
)
|
||||
Column(Modifier.weight(1f).padding(horizontal = 8.dp)) {
|
||||
Text(out.name.ifBlank { out.path }, style = MaterialTheme.typography.bodyMedium, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
Text(
|
||||
out.path,
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
color = palette.inkFaint,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
}
|
||||
if (out.added != null) {
|
||||
Text("+${out.added}", style = MaterialTheme.typography.labelMedium, color = palette.success)
|
||||
Text(" −${out.removed ?: 0}", style = MaterialTheme.typography.labelMedium, color = palette.danger)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- Background tasks -----------------------------------------------------------------------
|
||||
|
||||
@Composable
|
||||
private fun TasksSection(activity: Activity, readAt: Long, now: Long, onStop: (ActivityAgent) -> Unit, onRead: (ActivityAgent) -> Unit) {
|
||||
val palette = LocalPalette.current
|
||||
val team = activity.team
|
||||
if (activity.agents.isEmpty() && team == null) {
|
||||
Empty(stringResource(R.string.tasks_empty))
|
||||
return
|
||||
}
|
||||
val (live, ended) = ActivityLogic.split(activity.agents)
|
||||
var showEnded by rememberSaveable { mutableStateOf(false) }
|
||||
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||
val counts = ActivityLogic.stripCounts(activity.summary)
|
||||
Text(
|
||||
if (counts.isEmpty()) stringResource(R.string.tasks_none_running) else counts.map { (s, n) -> stateCount(s, n) }.joinToString(" · "),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = palette.inkMuted,
|
||||
)
|
||||
team?.let { t ->
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Icon(Icons.Filled.Groups, contentDescription = null, tint = palette.inkMuted, modifier = Modifier.size(18.dp))
|
||||
Text(
|
||||
stringResource(R.string.team_size, t.size.toString(), t.max.toString()),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
modifier = Modifier.padding(start = 6.dp),
|
||||
)
|
||||
}
|
||||
if (t.goal.isNotBlank()) Text(t.goal, style = MaterialTheme.typography.bodySmall, color = palette.inkMuted)
|
||||
}
|
||||
ActivityLogic.flatten(live).forEach { AgentRow(it, readAt, now, onStop, onRead) }
|
||||
if (ended.isNotEmpty()) {
|
||||
Row(
|
||||
Modifier.fillMaxWidth().heightIn(min = 48.dp).clickable { showEnded = !showEnded },
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Icon(if (showEnded) Icons.Filled.ExpandLess else Icons.Filled.ExpandMore, contentDescription = null, tint = palette.inkFaint)
|
||||
Text(
|
||||
stringResource(R.string.agents_n_finished, ended.size.toString()),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier.padding(start = 6.dp),
|
||||
)
|
||||
}
|
||||
if (showEnded) ActivityLogic.flatten(ended).forEach { AgentRow(it, readAt, now, onStop, onRead) }
|
||||
}
|
||||
team?.let { t ->
|
||||
Text(stringResource(R.string.team_room), style = MaterialTheme.typography.titleSmall, modifier = Modifier.padding(top = 12.dp))
|
||||
if (t.room.isEmpty()) Empty(stringResource(R.string.room_empty)) else t.room.forEach { RoomEntry(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* One agent: a fixed row (state dot, what it is -- the part that gives, cut not wrapped --,
|
||||
* elapsed time in a column of its own width, the stop button at its tap size), indented by
|
||||
* its depth in the tree; tapped, it opens to its brief, model, latest step and what it is
|
||||
* writing, and the way into its conversation.
|
||||
*/
|
||||
@Composable
|
||||
private fun AgentRow(agent: ActivityAgent, readAt: Long, now: Long, onStop: (ActivityAgent) -> Unit, onRead: (ActivityAgent) -> Unit) {
|
||||
val palette = LocalPalette.current
|
||||
var open by rememberSaveable(agent.kind, agent.id) { mutableStateOf(false) }
|
||||
Column(Modifier.fillMaxWidth().padding(start = (16 * agent.depth.coerceIn(0, 4)).dp)) {
|
||||
Row(
|
||||
Modifier.fillMaxWidth().heightIn(min = 48.dp).clickable { open = !open },
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Box(Modifier.size(8.dp).clip(CircleShape).background(stateColour(palette, agent.state)))
|
||||
Column(Modifier.weight(1f).padding(horizontal = 8.dp)) {
|
||||
Text(agent.name, style = MaterialTheme.typography.bodyMedium, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
if (agent.role.isNotBlank()) {
|
||||
Text(agent.role, style = MaterialTheme.typography.labelSmall, color = palette.inkMuted, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
}
|
||||
}
|
||||
Text(
|
||||
ActivityLogic.duration(ActivityLogic.elapsed(agent, readAt, now)),
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
color = palette.inkMuted,
|
||||
textAlign = TextAlign.End,
|
||||
modifier = Modifier.width(64.dp),
|
||||
)
|
||||
Box(Modifier.size(48.dp), contentAlignment = Alignment.Center) {
|
||||
if (agent.stoppable) {
|
||||
IconButton(onClick = { onStop(agent) }) {
|
||||
Icon(Icons.Filled.StopCircle, contentDescription = stringResource(R.string.agent_stop, agent.name), tint = palette.inkMuted)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (open) {
|
||||
Column(Modifier.padding(start = 16.dp, bottom = 8.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||
val facts = listOfNotNull(
|
||||
stateWord(agent.state),
|
||||
agent.agent.ifBlank { null },
|
||||
agent.model.ifBlank { null },
|
||||
if (agent.steps > 0) stringResource(R.string.agent_steps, agent.steps.toString(), agent.tools.toString()) else null,
|
||||
)
|
||||
Text(facts.joinToString(" · "), style = MaterialTheme.typography.labelSmall, color = palette.inkMuted)
|
||||
if (agent.brief.isNotBlank()) Text(agent.brief, style = MaterialTheme.typography.bodySmall)
|
||||
agent.step?.let { step ->
|
||||
Text(
|
||||
listOf(step.label.ifBlank { step.tool }, step.title).filter { it.isNotBlank() }.joinToString(" "),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
color = if (step.error) palette.danger else palette.inkMuted,
|
||||
maxLines = 2,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
}
|
||||
if (agent.text.isNotBlank()) {
|
||||
Text(agent.text, style = MaterialTheme.typography.bodySmall, color = palette.ink, maxLines = 6, overflow = TextOverflow.Ellipsis)
|
||||
}
|
||||
if (agent.transcript) {
|
||||
OutlinedButton(onClick = { onRead(agent) }) {
|
||||
Icon(Icons.Filled.Visibility, contentDescription = null, modifier = Modifier.size(18.dp))
|
||||
Text(stringResource(R.string.agent_open_conversation), modifier = Modifier.padding(start = 6.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun RoomEntry(entry: RoomMessage) {
|
||||
val palette = LocalPalette.current
|
||||
Row(Modifier.fillMaxWidth().padding(vertical = 4.dp)) {
|
||||
// A report is marked as on the web: a bar of the accent down its side.
|
||||
Box(Modifier.width(3.dp).heightIn(min = 24.dp).background(if (entry.report) palette.accent else Color.Transparent))
|
||||
Column(Modifier.weight(1f).padding(start = 8.dp)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
"#${entry.n} ${entry.from} → ${entry.to.joinToString(", ")}",
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = palette.inkMuted,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.weight(1f, fill = false),
|
||||
)
|
||||
if (entry.report) {
|
||||
Text(
|
||||
stringResource(R.string.room_report),
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = palette.accentInk,
|
||||
modifier = Modifier.padding(start = 6.dp).clip(RoundedCornerShape(4.dp)).background(palette.accent).padding(horizontal = 4.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
MarkdownText(entry.text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- One agent's conversation, read-only ------------------------------------------------------
|
||||
|
||||
/** What a background agent was told and said: `GET /chats/{chat}/agents/{kind}/{id}`, re-read while it works. */
|
||||
@Composable
|
||||
private fun AgentConversation(chatId: String, agent: ActivityAgent, onClose: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
val palette = LocalPalette.current
|
||||
var detail by remember { mutableStateOf<AgentDetail?>(null) }
|
||||
var error by remember { mutableStateOf<String?>(null) }
|
||||
LaunchedEffect(agent.kind, agent.id) {
|
||||
val api = context.lembas.instances.client() ?: return@LaunchedEffect
|
||||
while (true) {
|
||||
try {
|
||||
detail = api.agent(chatId, agent.kind, agent.id)
|
||||
error = null
|
||||
} catch (e: kotlinx.coroutines.CancellationException) {
|
||||
throw e
|
||||
} catch (e: Exception) {
|
||||
error = context.explain(e)
|
||||
}
|
||||
if (detail?.agent?.isActive != true) break
|
||||
delay(3_000)
|
||||
}
|
||||
}
|
||||
Dialog(onDismissRequest = onClose, properties = DialogProperties(usePlatformDefaultWidth = false)) {
|
||||
Scaffold(
|
||||
topBar = {
|
||||
TopAppBar(
|
||||
navigationIcon = { IconButton(onClick = onClose) { Icon(Icons.Filled.Close, contentDescription = stringResource(R.string.close)) } },
|
||||
title = {
|
||||
Column {
|
||||
Text(agent.name, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
val now = detail?.agent ?: agent
|
||||
Text(
|
||||
listOf(stateWord(now.state), now.model).filter { it.isNotBlank() }.joinToString(" · "),
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = palette.inkFaint,
|
||||
maxLines = 1,
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
},
|
||||
) { padding ->
|
||||
val turns = detail?.transcript
|
||||
when {
|
||||
turns == null && error != null -> Box(Modifier.padding(padding).fillMaxSize().padding(32.dp), contentAlignment = Alignment.Center) {
|
||||
Text(error.orEmpty(), color = palette.inkMuted, textAlign = TextAlign.Center)
|
||||
}
|
||||
|
||||
turns == null -> Box(Modifier.padding(padding).fillMaxSize(), contentAlignment = Alignment.Center) { CircularProgressIndicator() }
|
||||
|
||||
else -> LazyColumn(
|
||||
Modifier.padding(padding).fillMaxSize(),
|
||||
contentPadding = PaddingValues(16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||
) {
|
||||
if (turns.isEmpty()) item { Empty(stringResource(R.string.agent_nothing_yet)) }
|
||||
items(turns) { turn ->
|
||||
if (turn.role == "user") {
|
||||
Column(
|
||||
Modifier.fillMaxWidth().clip(
|
||||
RoundedCornerShape(8.dp),
|
||||
).background(if (turn.machine) palette.surfaceRaised else palette.bubbleUser).padding(12.dp),
|
||||
) {
|
||||
if (turn.machine) {
|
||||
Text(
|
||||
stringResource(R.string.agent_machine),
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = palette.inkFaint,
|
||||
)
|
||||
}
|
||||
Text(turn.text, style = MaterialTheme.typography.bodyMedium)
|
||||
}
|
||||
} else {
|
||||
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||
turn.tools.forEach { tool ->
|
||||
Text(
|
||||
listOf(tool.name, tool.title).filter { it.isNotBlank() }.joinToString(" "),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
color = if (tool.isError) palette.danger else palette.inkMuted,
|
||||
maxLines = 2,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
}
|
||||
if (turn.text.isNotBlank()) MarkdownText(turn.text)
|
||||
if (turn.error.isNotBlank()) Text(turn.error, style = MaterialTheme.typography.bodySmall, color = palette.danger)
|
||||
if (turn.running) {
|
||||
Text(
|
||||
stringResource(R.string.loading_line),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = palette.inkFaint,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,16 @@ package eu.llembas.android.ui.chat
|
||||
|
||||
import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
import androidx.activity.result.PickVisualMediaRequest
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.gestures.scrollBy
|
||||
import androidx.compose.foundation.horizontalScroll
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
@@ -20,7 +26,9 @@ import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.imePadding
|
||||
import androidx.compose.foundation.layout.navigationBarsPadding
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.LazyListState
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
@@ -28,10 +36,16 @@ import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material.icons.automirrored.filled.Send
|
||||
import androidx.compose.material.icons.filled.AttachFile
|
||||
import androidx.compose.material.icons.filled.Bolt
|
||||
import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material.icons.filled.ContentCopy
|
||||
import androidx.compose.material.icons.filled.Folder
|
||||
import androidx.compose.material.icons.filled.Groups
|
||||
import androidx.compose.material.icons.filled.Mic
|
||||
import androidx.compose.material.icons.filled.MoreVert
|
||||
import androidx.compose.material.icons.filled.Psychology
|
||||
import androidx.compose.material.icons.filled.Stop
|
||||
import androidx.compose.material.icons.filled.Terminal
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.AssistChip
|
||||
import androidx.compose.material3.DropdownMenu
|
||||
@@ -47,6 +61,7 @@ import androidx.compose.material3.ModalBottomSheet
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.SheetValue
|
||||
import androidx.compose.material3.Slider
|
||||
import androidx.compose.material3.SnackbarHost
|
||||
import androidx.compose.material3.SnackbarHostState
|
||||
import androidx.compose.material3.Text
|
||||
@@ -66,24 +81,38 @@ import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.compose.LocalLifecycleOwner
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
import eu.llembas.android.R
|
||||
import eu.llembas.android.api.AgentTarget
|
||||
import eu.llembas.android.api.AgentsSetting
|
||||
import eu.llembas.android.api.LinkedDevice
|
||||
import eu.llembas.android.api.Message
|
||||
import eu.llembas.android.api.ModelInfo
|
||||
import eu.llembas.android.api.ShowCard
|
||||
import eu.llembas.android.assist.Recorder
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.ui.ModelAvatar
|
||||
import eu.llembas.android.ui.theme.LocalPalette
|
||||
import eu.llembas.android.ui.viewer.FileViewer
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit = {}, model: ChatViewModel = viewModel(key = chatId ?: "new")) {
|
||||
fun ChatScreen(
|
||||
chatId: String?,
|
||||
onBack: () -> Unit,
|
||||
onOpened: (String) -> Unit = {},
|
||||
agent: Boolean = false,
|
||||
model: ChatViewModel = viewModel(key = chatId ?: if (agent) "new-agent" else "new"),
|
||||
) {
|
||||
val state by model.state.collectAsStateWithLifecycle()
|
||||
val palette = LocalPalette.current
|
||||
val list = rememberLazyListState()
|
||||
@@ -91,11 +120,25 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
||||
var menu by remember { mutableStateOf(false) }
|
||||
var editing by remember { mutableStateOf<Message?>(null) }
|
||||
var showing by remember { mutableStateOf<ShowCard?>(null) }
|
||||
var renaming by remember { mutableStateOf(false) }
|
||||
var activityOpen by rememberSaveable { mutableStateOf(false) }
|
||||
val context = LocalContext.current
|
||||
val lifecycle = LocalLifecycleOwner.current.lifecycle
|
||||
val scope = rememberCoroutineScope()
|
||||
val copy: (String) -> Unit = { text ->
|
||||
context.getSystemService(ClipboardManager::class.java)?.setPrimaryClip(ClipData.newPlainText("LLeMbas", text))
|
||||
// Android 13 and newer say "Copied" themselves.
|
||||
if (Build.VERSION.SDK_INT < 33) scope.launch { snackbar.showSnackbar(context.getString(R.string.copied)) }
|
||||
}
|
||||
|
||||
LaunchedEffect(chatId) { model.open(chatId) }
|
||||
LaunchedEffect(chatId) { model.open(chatId, agent = agent && chatId == null) }
|
||||
// A new chat gets its id from its first message; the route follows, so Back and a
|
||||
// rotation land on the chat rather than on an empty composer.
|
||||
LaunchedEffect(state.chat?.id) { state.chat?.id?.let { if (it != chatId) onOpened(it) } }
|
||||
// The chat's background agents, followed while the screen is in front and not otherwise.
|
||||
LaunchedEffect(state.chat?.id) {
|
||||
if (state.chat?.id != null) lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) { model.watchActivity() }
|
||||
}
|
||||
LaunchedEffect(state.error, state.notice) {
|
||||
(state.error ?: state.notice)?.let {
|
||||
snackbar.showSnackbar(it)
|
||||
@@ -104,8 +147,20 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
||||
}
|
||||
val live = state.live
|
||||
val rows = state.messages
|
||||
LaunchedEffect(rows.size, live?.shown?.size) {
|
||||
if (rows.isNotEmpty()) list.animateScrollToItem(rows.size - 1)
|
||||
// To the end when the transcript grows, and while a reply is being written -- but only if
|
||||
// the person is at the end already: reading back up is not interrupted by the next line.
|
||||
// Whether to follow is decided when the person's own scroll comes to rest, not when a
|
||||
// line arrives: by then the line has already made the list longer than the screen.
|
||||
var following by remember { mutableStateOf(true) }
|
||||
LaunchedEffect(list.isScrollInProgress) {
|
||||
if (!list.isScrollInProgress) following = !list.canScrollForward
|
||||
}
|
||||
LaunchedEffect(rows.size) {
|
||||
if (rows.isNotEmpty()) list.toEnd()
|
||||
}
|
||||
val growth = live?.let { it.shown.size * 100_000 + (it.tail.text.length + it.tail.thinking.length) } ?: 0
|
||||
LaunchedEffect(growth) {
|
||||
if (growth > 0 && following) list.toEnd()
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
@@ -118,18 +173,30 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
||||
}
|
||||
},
|
||||
title = {
|
||||
Text(
|
||||
state.chat?.title?.ifBlank { null } ?: stringResource(R.string.new_chat),
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
state.chat?.model?.ifBlank { null }?.let { id ->
|
||||
ModelAvatar(state.models.firstOrNull { it.id == id }, id, size = 28.dp, modifier = Modifier.padding(end = 10.dp))
|
||||
}
|
||||
Text(
|
||||
state.chat?.title?.ifBlank { null } ?: stringResource(if (agent) R.string.new_agent_chat else R.string.new_chat),
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
}
|
||||
},
|
||||
actions = {
|
||||
if (state.chat != null) {
|
||||
IconButton(onClick = { activityOpen = true }) {
|
||||
Icon(Icons.Filled.Bolt, contentDescription = stringResource(R.string.activity_open))
|
||||
}
|
||||
IconButton(onClick = { menu = true }) {
|
||||
Icon(Icons.Filled.MoreVert, contentDescription = stringResource(R.string.more))
|
||||
}
|
||||
DropdownMenu(expanded = menu, onDismissRequest = { menu = false }) {
|
||||
DropdownMenuItem(text = { Text(stringResource(R.string.rename_chat)) }, onClick = {
|
||||
menu = false
|
||||
renaming = true
|
||||
})
|
||||
DropdownMenuItem(text = { Text(stringResource(R.string.continue_reply)) }, onClick = {
|
||||
menu = false
|
||||
model.continueChat()
|
||||
@@ -163,7 +230,9 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
||||
}
|
||||
}
|
||||
}
|
||||
if (live != null && live.jobs.isNotEmpty()) {
|
||||
state.summary?.let { summary -> ActivityStrip(summary) { activityOpen = true } }
|
||||
// A server without the activity panel: its jobs frame, one chip each, as before.
|
||||
if (state.summary == null && live != null && live.jobs.isNotEmpty()) {
|
||||
Row(Modifier.horizontalScroll(rememberScrollState()).padding(horizontal = 12.dp), horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
live.jobs.forEach { job ->
|
||||
AssistChip(onClick = {}, label = { Text("${job.id} · ${job.description.ifBlank { job.command }} · ${job.state}", maxLines = 1) })
|
||||
@@ -173,7 +242,7 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
||||
if (live != null && live.status.isNotBlank()) {
|
||||
Text(live.status, style = MaterialTheme.typography.labelSmall, color = palette.inkFaint, modifier = Modifier.padding(horizontal = 16.dp))
|
||||
}
|
||||
Composer(model, state)
|
||||
Composer(model, state, agent)
|
||||
}
|
||||
},
|
||||
) { padding ->
|
||||
@@ -197,9 +266,10 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
||||
when {
|
||||
message.isUser -> Column {
|
||||
UserBubble(message)
|
||||
if (!message.machine && live == null) {
|
||||
TextButton(onClick = { editing = message }, modifier = Modifier.align(Alignment.End)) {
|
||||
Text(stringResource(R.string.edit))
|
||||
Row(Modifier.align(Alignment.End), verticalAlignment = Alignment.CenterVertically) {
|
||||
message.text?.takeIf { it.isNotBlank() }?.let { words -> CopyButton { copy(words) } }
|
||||
if (!message.machine && live == null) {
|
||||
TextButton(onClick = { editing = message }) { Text(stringResource(R.string.edit)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -213,8 +283,10 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
||||
else -> Column {
|
||||
Steps(message.steps, onShow = { showing = it })
|
||||
ReplyFoot(message)
|
||||
if (live == null && message == rows.lastOrNull()) {
|
||||
Row {
|
||||
val words = replyText(message)
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
if (words.isNotBlank()) CopyButton { copy(words) }
|
||||
if (live == null && message == rows.lastOrNull()) {
|
||||
TextButton(onClick = { model.regenerate(message) }) { Text(stringResource(R.string.regenerate)) }
|
||||
}
|
||||
}
|
||||
@@ -239,10 +311,33 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
||||
}
|
||||
}
|
||||
|
||||
if (activityOpen) {
|
||||
state.chat?.let { chat ->
|
||||
// A device's files are on the device: the panel lists them, the tree cannot open them.
|
||||
ActivityPanel(chat.id, state, model, canOpenFiles = !chat.isAgent, onClose = { activityOpen = false })
|
||||
}
|
||||
}
|
||||
|
||||
showing?.let { file ->
|
||||
state.chat?.id?.let { id -> FileViewer(id, file, onClose = { showing = null }) }
|
||||
}
|
||||
|
||||
if (renaming) {
|
||||
var title by remember { mutableStateOf(state.chat?.title.orEmpty()) }
|
||||
AlertDialog(
|
||||
onDismissRequest = { renaming = false },
|
||||
title = { Text(stringResource(R.string.rename_chat)) },
|
||||
text = { OutlinedTextField(value = title, onValueChange = { title = it }, singleLine = true, modifier = Modifier.fillMaxWidth()) },
|
||||
confirmButton = {
|
||||
TextButton(enabled = title.isNotBlank(), onClick = {
|
||||
model.rename(title)
|
||||
renaming = false
|
||||
}) { Text(stringResource(R.string.save)) }
|
||||
},
|
||||
dismissButton = { TextButton(onClick = { renaming = false }) { Text(stringResource(R.string.cancel)) } },
|
||||
)
|
||||
}
|
||||
|
||||
editing?.let { message ->
|
||||
var text by remember(message.id) { mutableStateOf(message.text.orEmpty()) }
|
||||
AlertDialog(
|
||||
@@ -260,28 +355,96 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
|
||||
}
|
||||
}
|
||||
|
||||
/** To the very end of the transcript: the last row, then down to its foot however tall it is. */
|
||||
private suspend fun LazyListState.toEnd() {
|
||||
val last = layoutInfo.totalItemsCount - 1
|
||||
if (last < 0) return
|
||||
scrollToItem(last)
|
||||
scrollBy(1_000_000f)
|
||||
}
|
||||
|
||||
/** A reply's own words, as the person would copy them: its text steps, in order. */
|
||||
private fun replyText(message: Message): String =
|
||||
message.steps.filter { it.kind == "text" }.mapNotNull { it.markdown }.joinToString("\n\n").ifBlank { message.text.orEmpty() }
|
||||
|
||||
@Composable
|
||||
private fun CopyButton(onClick: () -> Unit) {
|
||||
IconButton(onClick = onClick) {
|
||||
Icon(
|
||||
Icons.Filled.ContentCopy,
|
||||
contentDescription = stringResource(R.string.copy_message),
|
||||
tint = LocalPalette.current.inkFaint,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** The agent modes, as the web page offers them, in the order of how much the model may do. */
|
||||
private val AGENT_MODES = listOf("manual", "edit", "auto", "plan")
|
||||
|
||||
@Composable
|
||||
private fun modeName(mode: String): String = when (mode) {
|
||||
"manual" -> stringResource(R.string.mode_manual)
|
||||
"edit" -> stringResource(R.string.mode_edit)
|
||||
"auto" -> stringResource(R.string.mode_auto)
|
||||
"plan" -> stringResource(R.string.mode_plan)
|
||||
else -> mode.replaceFirstChar { it.uppercase() }
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
@Composable
|
||||
private fun Composer(model: ChatViewModel, state: ChatState) {
|
||||
private fun Composer(model: ChatViewModel, state: ChatState, agent: Boolean) {
|
||||
val context = LocalContext.current
|
||||
val scope = rememberCoroutineScope()
|
||||
var text by rememberSaveable { mutableStateOf("") }
|
||||
var chosenModel by rememberSaveable { mutableStateOf<String?>(null) }
|
||||
var chosenEffort by rememberSaveable { mutableStateOf<String?>(null) }
|
||||
var chosenMin by rememberSaveable { mutableStateOf<Int?>(null) }
|
||||
var chosenMax by rememberSaveable { mutableStateOf<Int?>(null) }
|
||||
var askAgents by remember { mutableStateOf(false) }
|
||||
var planMode by rememberSaveable { mutableStateOf(false) }
|
||||
var agentMode by rememberSaveable { mutableStateOf("edit") }
|
||||
var device by rememberSaveable { mutableStateOf<String?>(null) }
|
||||
var directory by rememberSaveable { mutableStateOf("") }
|
||||
var askDirectory by remember { mutableStateOf(false) }
|
||||
var attachMenu by remember { mutableStateOf(false) }
|
||||
var listening by remember { mutableStateOf(false) }
|
||||
var photo by remember { mutableStateOf<Uri?>(null) }
|
||||
val recorder = remember { Recorder(scope) }
|
||||
val pick = rememberLauncherForActivityResult(ActivityResultContracts.GetMultipleContents()) { model.attach(it) }
|
||||
val pickFiles = rememberLauncherForActivityResult(ActivityResultContracts.GetMultipleContents()) { model.attach(it) }
|
||||
val pickPhotos = rememberLauncherForActivityResult(ActivityResultContracts.PickMultipleVisualMedia()) { model.attach(it) }
|
||||
val takePhoto = rememberLauncherForActivityResult(ActivityResultContracts.TakePicture()) { taken ->
|
||||
photo?.let { if (taken) model.attach(listOf(it)) }
|
||||
photo = null
|
||||
}
|
||||
val askMic = rememberLauncherForActivityResult(ActivityResultContracts.RequestPermission()) { granted ->
|
||||
if (granted) {
|
||||
recorder.start()
|
||||
listening = true
|
||||
}
|
||||
}
|
||||
// A message the server did not take comes back here, so nothing typed is lost.
|
||||
LaunchedEffect(state.unsent) {
|
||||
state.unsent?.let {
|
||||
if (text.isBlank()) text = it
|
||||
model.clearUnsent()
|
||||
}
|
||||
}
|
||||
val chat = state.chat
|
||||
val current = chat?.model ?: chosenModel ?: state.models.firstOrNull { it.default }?.id
|
||||
val newAgent = agent && chat == null
|
||||
// The first linked device is the one a new agent chat runs on until another is chosen.
|
||||
val target: LinkedDevice? = state.devices.firstOrNull { it.id == device } ?: state.devices.firstOrNull()
|
||||
val current = chat?.model?.ifBlank { null } ?: chosenModel ?: state.models.firstOrNull { it.default }?.id
|
||||
val running = state.live != null && state.live.finished == null
|
||||
|
||||
Column(Modifier.fillMaxWidth().padding(8.dp)) {
|
||||
if (newAgent && state.devices.isEmpty() && !state.loading) {
|
||||
Text(
|
||||
stringResource(R.string.agent_no_device),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = LocalPalette.current.inkMuted,
|
||||
modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp),
|
||||
)
|
||||
}
|
||||
if (state.pending.isNotEmpty()) {
|
||||
Row(Modifier.horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
state.pending.forEach { a ->
|
||||
@@ -295,28 +458,71 @@ private fun Composer(model: ChatViewModel, state: ChatState) {
|
||||
}
|
||||
}
|
||||
Row(Modifier.horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
if (newAgent && state.devices.isNotEmpty()) {
|
||||
DeviceChip(state.devices, target) { device = it }
|
||||
AssistChip(
|
||||
onClick = { askDirectory = true },
|
||||
leadingIcon = { Icon(Icons.Filled.Folder, contentDescription = null) },
|
||||
label = { Text(directory.ifBlank { stringResource(R.string.agent_directory) }, maxLines = 1) },
|
||||
)
|
||||
}
|
||||
ModelChip(state.models, current) { id ->
|
||||
if (chat == null) chosenModel = id else model.change("model", id)
|
||||
}
|
||||
val efforts = state.models.firstOrNull { it.id == current }?.efforts.orEmpty()
|
||||
if (efforts.isNotEmpty()) {
|
||||
EffortChip(efforts, chat?.effort) { model.change("effort", it ?: "off") }
|
||||
val info = state.models.firstOrNull { it.id == current }
|
||||
if (info != null) {
|
||||
// A new chat keeps the choice until its first message makes it; an open one
|
||||
// changes at once, as the web page's control does. The control is the model's:
|
||||
// none for one level, a Thinking switch for off and one more, else the picker.
|
||||
val level = info.level(if (chat == null) chosenEffort else chat.effort?.ifBlank { null })
|
||||
LevelControl(info, level) { picked ->
|
||||
if (chat == null) chosenEffort = picked else model.change("effort", picked)
|
||||
}
|
||||
}
|
||||
if (chat == null || !chat.isAgent) {
|
||||
FilterChip(
|
||||
// The team's size, where a team is offered: the server's word for a chat that
|
||||
// exists, the model's facts for one about to be made.
|
||||
val teamOffered = if (chat != null) state.teamOffered else !newAgent && info?.mayHaveTeam == true
|
||||
if (teamOffered) {
|
||||
val setting = chat?.agents ?: AgentsSetting(chosenMin ?: 1, chosenMax ?: 4)
|
||||
AssistChip(
|
||||
onClick = { askAgents = true },
|
||||
leadingIcon = { Icon(Icons.Filled.Groups, contentDescription = null) },
|
||||
label = { Text(stringResource(R.string.team_chip, setting.min.toString(), setting.max.toString()), maxLines = 1) },
|
||||
)
|
||||
}
|
||||
when {
|
||||
newAgent -> ModeChip(agentMode) { agentMode = it }
|
||||
|
||||
chat != null && chat.isAgent -> ModeChip(chat.mode.ifBlank { "edit" }) { model.change("mode", it) }
|
||||
|
||||
else -> FilterChip(
|
||||
selected = if (chat == null) planMode else chat.mode == "plan",
|
||||
onClick = {
|
||||
if (chat == null) planMode = !planMode else model.change("mode", if (chat.mode == "plan") "" else "plan")
|
||||
},
|
||||
label = { Text(stringResource(R.string.mode_plan)) },
|
||||
)
|
||||
} else {
|
||||
AssistChip(onClick = {}, label = { Text(chat.mode.replaceFirstChar { it.uppercase() }) })
|
||||
}
|
||||
}
|
||||
Row(verticalAlignment = Alignment.Bottom) {
|
||||
IconButton(onClick = { pick.launch("*/*") }) {
|
||||
Icon(Icons.Filled.AttachFile, contentDescription = stringResource(R.string.attach))
|
||||
Box {
|
||||
IconButton(onClick = { attachMenu = true }) {
|
||||
Icon(Icons.Filled.AttachFile, contentDescription = stringResource(R.string.attach))
|
||||
}
|
||||
DropdownMenu(expanded = attachMenu, onDismissRequest = { attachMenu = false }) {
|
||||
DropdownMenuItem(text = { Text(stringResource(R.string.attach_take_photo)) }, onClick = {
|
||||
attachMenu = false
|
||||
model.photoTarget().also { photo = it }.let { takePhoto.launch(it) }
|
||||
})
|
||||
DropdownMenuItem(text = { Text(stringResource(R.string.attach_choose_photos)) }, onClick = {
|
||||
attachMenu = false
|
||||
pickPhotos.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly))
|
||||
})
|
||||
DropdownMenuItem(text = { Text(stringResource(R.string.attach_choose_files)) }, onClick = {
|
||||
attachMenu = false
|
||||
pickFiles.launch("*/*")
|
||||
})
|
||||
}
|
||||
}
|
||||
TextField(
|
||||
value = text,
|
||||
@@ -347,49 +553,219 @@ private fun Composer(model: ChatViewModel, state: ChatState) {
|
||||
IconButton(onClick = model::stop) { Icon(Icons.Filled.Stop, contentDescription = stringResource(R.string.stop)) }
|
||||
} else {
|
||||
IconButton(
|
||||
enabled = text.isNotBlank() || state.pending.isNotEmpty(),
|
||||
enabled = (text.isNotBlank() || state.pending.isNotEmpty()) && !state.uploading && (!newAgent || target != null),
|
||||
onClick = {
|
||||
model.send(text, model = chosenModel, mode = if (planMode) "plan" else null)
|
||||
model.send(
|
||||
text,
|
||||
model = chosenModel,
|
||||
mode = if (newAgent) {
|
||||
agentMode
|
||||
} else if (planMode) {
|
||||
"plan"
|
||||
} else {
|
||||
null
|
||||
},
|
||||
effort = chosenEffort?.takeIf { picked -> state.models.firstOrNull { it.id == current }?.offered?.contains(picked) == true },
|
||||
agent = if (newAgent) target?.let { AgentTarget(it.id, directory) } else null,
|
||||
agents = if (chosenMin != null || chosenMax != null) AgentsSetting(chosenMin ?: 1, chosenMax ?: 4) else null,
|
||||
)
|
||||
text = ""
|
||||
},
|
||||
) { Icon(Icons.AutoMirrored.Filled.Send, contentDescription = stringResource(R.string.send)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (askAgents) {
|
||||
val now = chat?.agents ?: AgentsSetting(chosenMin ?: 1, chosenMax ?: 4)
|
||||
AgentsDialog(now, onDismiss = { askAgents = false }) { picked ->
|
||||
askAgents = false
|
||||
if (chat == null) {
|
||||
chosenMin = picked.min
|
||||
chosenMax = picked.max
|
||||
} else {
|
||||
model.setAgents(picked)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (askDirectory) {
|
||||
var typed by remember { mutableStateOf(directory) }
|
||||
AlertDialog(
|
||||
onDismissRequest = { askDirectory = false },
|
||||
title = { Text(stringResource(R.string.agent_directory)) },
|
||||
text = {
|
||||
OutlinedTextField(
|
||||
value = typed,
|
||||
onValueChange = { typed = it },
|
||||
singleLine = true,
|
||||
placeholder = { Text(stringResource(R.string.agent_directory_hint)) },
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
)
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(onClick = {
|
||||
directory = typed.trim()
|
||||
askDirectory = false
|
||||
}) { Text(stringResource(R.string.save)) }
|
||||
},
|
||||
dismissButton = { TextButton(onClick = { askDirectory = false }) { Text(stringResource(R.string.cancel)) } },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun DeviceChip(devices: List<LinkedDevice>, current: LinkedDevice?, onPick: (String) -> Unit) {
|
||||
var open by remember { mutableStateOf(false) }
|
||||
Box {
|
||||
AssistChip(
|
||||
onClick = { open = true },
|
||||
leadingIcon = { Icon(Icons.Filled.Terminal, contentDescription = stringResource(R.string.agent_device)) },
|
||||
label = { Text(current?.let { it.name.ifBlank { it.host } } ?: "—", maxLines = 1) },
|
||||
)
|
||||
DropdownMenu(expanded = open, onDismissRequest = { open = false }) {
|
||||
devices.forEach { d ->
|
||||
DropdownMenuItem(
|
||||
text = { Text(listOf(d.name, d.host).filter { it.isNotBlank() }.distinct().joinToString(" · ")) },
|
||||
onClick = {
|
||||
open = false
|
||||
onPick(d.id)
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ModeChip(current: String, onPick: (String) -> Unit) {
|
||||
var open by remember { mutableStateOf(false) }
|
||||
Box {
|
||||
AssistChip(onClick = { open = true }, label = { Text(modeName(current)) })
|
||||
DropdownMenu(expanded = open, onDismissRequest = { open = false }) {
|
||||
AGENT_MODES.forEach { m ->
|
||||
DropdownMenuItem(text = { Text(modeName(m)) }, onClick = {
|
||||
open = false
|
||||
onPick(m)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ModelChip(models: List<ModelInfo>, current: String?, onPick: (String) -> Unit) {
|
||||
var open by remember { mutableStateOf(false) }
|
||||
Box {
|
||||
AssistChip(onClick = { open = true }, label = { Text(models.firstOrNull { it.id == current }?.name ?: current ?: "—", maxLines = 1) })
|
||||
val shown = models.firstOrNull { it.id == current }
|
||||
AssistChip(
|
||||
onClick = { open = true },
|
||||
leadingIcon = { ModelAvatar(shown, current ?: "?", size = 20.dp) },
|
||||
label = { Text(shown?.name ?: current ?: "—", maxLines = 1) },
|
||||
)
|
||||
DropdownMenu(expanded = open, onDismissRequest = { open = false }) {
|
||||
models.forEach { m ->
|
||||
DropdownMenuItem(text = { Text(m.name) }, onClick = {
|
||||
open = false
|
||||
onPick(m.id)
|
||||
})
|
||||
DropdownMenuItem(
|
||||
leadingIcon = { ModelAvatar(m, m.id, size = 28.dp) },
|
||||
text = { Text(m.name.ifBlank { m.id }) },
|
||||
onClick = {
|
||||
open = false
|
||||
onPick(m.id)
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** A level's name: `off` and `default` in words, an effort as the model calls it. */
|
||||
@Composable
|
||||
private fun EffortChip(efforts: List<String>, current: String?, onPick: (String?) -> Unit) {
|
||||
var open by remember { mutableStateOf(false) }
|
||||
Box {
|
||||
AssistChip(onClick = { open = true }, label = { Text(current ?: stringResource(R.string.effort_off)) })
|
||||
DropdownMenu(expanded = open, onDismissRequest = { open = false }) {
|
||||
DropdownMenuItem(text = { Text(stringResource(R.string.effort_off)) }, onClick = {
|
||||
open = false
|
||||
onPick(null)
|
||||
})
|
||||
efforts.forEach { e ->
|
||||
DropdownMenuItem(text = { Text(e) }, onClick = {
|
||||
open = false
|
||||
onPick(e)
|
||||
})
|
||||
private fun levelName(level: String): String = when (level) {
|
||||
"off" -> stringResource(R.string.level_off)
|
||||
"default" -> stringResource(R.string.level_default)
|
||||
else -> level
|
||||
}
|
||||
|
||||
/**
|
||||
* How hard the model thinks, by the model's `control`: nothing for one level; a Thinking chip
|
||||
* that is on or off for `off` and one effort; the picker for more.
|
||||
*/
|
||||
@Composable
|
||||
private fun LevelControl(model: ModelInfo, level: String, onPick: (String) -> Unit) {
|
||||
when (model.levelControl) {
|
||||
"switch" -> FilterChip(
|
||||
selected = level != "off",
|
||||
onClick = { onPick(if (level == "off") model.onLevel else "off") },
|
||||
leadingIcon = { Icon(Icons.Filled.Psychology, contentDescription = null) },
|
||||
label = { Text(stringResource(R.string.thinking_switch)) },
|
||||
)
|
||||
|
||||
"slider" -> {
|
||||
var open by remember { mutableStateOf(false) }
|
||||
Box {
|
||||
AssistChip(onClick = { open = true }, label = { Text(stringResource(R.string.effort_level, levelName(level)), maxLines = 1) })
|
||||
DropdownMenu(expanded = open, onDismissRequest = { open = false }) {
|
||||
model.offered.forEach { option ->
|
||||
DropdownMenuItem(
|
||||
text = { Text(levelName(option)) },
|
||||
trailingIcon = { if (option == level) Text("✓") },
|
||||
onClick = {
|
||||
open = false
|
||||
onPick(option)
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else -> Unit
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The team's size: the fewest and the most agents, its own included. Two sliders on one
|
||||
* column, each with its label and value on a row of its own, so the two line up whatever the
|
||||
* words. The most never goes under the fewest; the server checks the pair against its cap.
|
||||
*/
|
||||
@Composable
|
||||
private fun AgentsDialog(now: AgentsSetting, onDismiss: () -> Unit, onSave: (AgentsSetting) -> Unit) {
|
||||
var low by remember { mutableStateOf(now.min.coerceIn(1, AgentsSetting.CAP)) }
|
||||
var high by remember { mutableStateOf(now.max.coerceIn(1, AgentsSetting.CAP)) }
|
||||
val palette = LocalPalette.current
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismiss,
|
||||
title = { Text(stringResource(R.string.team_agents)) },
|
||||
text = {
|
||||
Column {
|
||||
Text(stringResource(R.string.team_hint), style = MaterialTheme.typography.bodySmall, color = palette.inkMuted)
|
||||
AgentsSlider(stringResource(R.string.team_fewest), low) {
|
||||
low = it
|
||||
if (high < it) high = it
|
||||
}
|
||||
AgentsSlider(stringResource(R.string.team_most), high) {
|
||||
high = it
|
||||
if (low > it) low = it
|
||||
}
|
||||
}
|
||||
},
|
||||
confirmButton = { TextButton(onClick = { onSave(AgentsSetting(low, high)) }) { Text(stringResource(R.string.save)) } },
|
||||
dismissButton = { TextButton(onClick = onDismiss) { Text(stringResource(R.string.cancel)) } },
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun AgentsSlider(label: String, value: Int, onChange: (Int) -> Unit) {
|
||||
Column(Modifier.padding(top = 12.dp)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(label, style = MaterialTheme.typography.bodyMedium, modifier = Modifier.weight(1f))
|
||||
Text(value.toString(), style = MaterialTheme.typography.titleMedium, modifier = Modifier.width(40.dp), textAlign = TextAlign.End)
|
||||
}
|
||||
Slider(
|
||||
value = value.toFloat(),
|
||||
onValueChange = { onChange(Math.round(it).coerceIn(1, AgentsSetting.CAP)) },
|
||||
valueRange = 1f..AgentsSetting.CAP.toFloat(),
|
||||
steps = AgentsSetting.CAP - 2,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -2,21 +2,33 @@ package eu.llembas.android.ui.chat
|
||||
|
||||
import android.app.Application
|
||||
import android.net.Uri
|
||||
import android.os.SystemClock
|
||||
import android.provider.OpenableColumns
|
||||
import androidx.core.content.FileProvider
|
||||
import androidx.lifecycle.AndroidViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import eu.llembas.android.api.Activity
|
||||
import eu.llembas.android.api.ActivityAgent
|
||||
import eu.llembas.android.api.ActivityFrame
|
||||
import eu.llembas.android.api.ActivitySummary
|
||||
import eu.llembas.android.api.AgentTarget
|
||||
import eu.llembas.android.api.AgentsSetting
|
||||
import eu.llembas.android.api.ApiClient
|
||||
import eu.llembas.android.api.ApiException
|
||||
import eu.llembas.android.api.Attachment
|
||||
import eu.llembas.android.api.Card
|
||||
import eu.llembas.android.api.CardAnswer
|
||||
import eu.llembas.android.api.Chat
|
||||
import eu.llembas.android.api.LembasJson
|
||||
import eu.llembas.android.api.LinkedDevice
|
||||
import eu.llembas.android.api.LiveReply
|
||||
import eu.llembas.android.api.Message
|
||||
import eu.llembas.android.api.ModelInfo
|
||||
import eu.llembas.android.api.StreamClient
|
||||
import eu.llembas.android.api.Turn
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.ui.explain
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
@@ -26,6 +38,7 @@ import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import kotlinx.serialization.json.JsonPrimitive
|
||||
import java.io.File
|
||||
|
||||
data class ChatState(
|
||||
val chat: Chat? = null,
|
||||
@@ -33,12 +46,25 @@ data class ChatState(
|
||||
val more: Boolean = false,
|
||||
val live: LiveReply? = null,
|
||||
val models: List<ModelInfo> = emptyList(),
|
||||
/** For a new agent chat: the devices linked right now, which it can run on. */
|
||||
val devices: List<LinkedDevice> = emptyList(),
|
||||
val pending: List<Attachment> = emptyList(),
|
||||
val uploading: Boolean = false,
|
||||
val loading: Boolean = false,
|
||||
val error: String? = null,
|
||||
/** A message that could not be sent, handed back to the composer once. */
|
||||
val unsent: String? = null,
|
||||
/** A card somebody answered elsewhere first: said once, then cleared. */
|
||||
val notice: String? = null,
|
||||
/** The activity panel's facts, once it has been opened; [activityAt] is when they were read. */
|
||||
val activity: Activity? = null,
|
||||
val activityAt: Long = 0,
|
||||
/** The strip's counts, from the events route (or the first read). */
|
||||
val summary: ActivitySummary? = null,
|
||||
/** Whether this chat may have a team: the server's word for a chat that exists. */
|
||||
val teamOffered: Boolean = false,
|
||||
/** Whether the events route is followed; without it an open panel polls. */
|
||||
val activityLive: Boolean = false,
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -55,19 +81,27 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
|
||||
?: throw ApiException(401, "Not signed in.")
|
||||
|
||||
private fun fail(e: Throwable) {
|
||||
_state.update { it.copy(error = e.message ?: e.javaClass.simpleName, loading = false, uploading = false) }
|
||||
// A follow that was replaced by a newer one is cancelled, not failed: nothing to say.
|
||||
if (e is CancellationException) return
|
||||
_state.update { it.copy(error = getApplication<Application>().explain(e), loading = false, uploading = false) }
|
||||
}
|
||||
|
||||
fun clearError() = _state.update { it.copy(error = null, notice = null) }
|
||||
|
||||
fun open(chatId: String?) {
|
||||
fun clearUnsent() = _state.update { it.copy(unsent = null) }
|
||||
|
||||
fun rename(title: String) = change("title", title.trim())
|
||||
|
||||
/** Open a chat, or (no id) get a new one ready: an agent chat also needs the linked devices. */
|
||||
fun open(chatId: String?, agent: Boolean = false) {
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val client = api()
|
||||
_state.update { it.copy(loading = chatId != null) }
|
||||
_state.update { it.copy(loading = chatId != null || agent, error = null) }
|
||||
val models = runCatching { client.models(chatId) }.getOrDefault(emptyList())
|
||||
if (chatId == null) {
|
||||
_state.update { it.copy(models = models, loading = false) }
|
||||
val devices = if (agent) client.devices() else emptyList()
|
||||
_state.update { it.copy(models = models, devices = devices, loading = false) }
|
||||
return@launch
|
||||
}
|
||||
val detail = client.chat(chatId)
|
||||
@@ -75,6 +109,11 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
|
||||
it.copy(chat = detail.chat, messages = detail.messages, more = detail.more, models = models, loading = false)
|
||||
}
|
||||
detail.live?.let { follow(it) }
|
||||
// Whether a team is offered and what runs in the background: the cheap read,
|
||||
// without the context count. A server without the panel has no answer.
|
||||
runCatching { client.activity(chatId, context = false) }.onSuccess { a ->
|
||||
_state.update { it.copy(teamOffered = a.teamOffered, summary = a.summary) }
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
fail(e)
|
||||
}
|
||||
@@ -101,8 +140,15 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
|
||||
StreamClient(api()).follow(chat.id, messageId).collect { frame ->
|
||||
_state.update { s -> s.copy(live = (s.live ?: LiveReply(messageId)).apply(frame.event, frame.data)) }
|
||||
}
|
||||
} catch (e: CancellationException) {
|
||||
throw e
|
||||
} catch (e: Exception) {
|
||||
fail(e)
|
||||
// The reply goes on on the server; what it has written so far is read back
|
||||
// rather than left half-drawn.
|
||||
_state.update { it.copy(live = null) }
|
||||
refresh()
|
||||
return@launch
|
||||
}
|
||||
val ended = _state.value.live
|
||||
_state.update { s ->
|
||||
@@ -136,8 +182,17 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
|
||||
turn.reply?.let { follow(it.id) }
|
||||
}
|
||||
|
||||
fun send(text: String, model: String? = null, mode: String? = null, effort: String? = null, temporary: Boolean = false) {
|
||||
val files = _state.value.pending.map { it.id }
|
||||
fun send(
|
||||
text: String,
|
||||
model: String? = null,
|
||||
mode: String? = null,
|
||||
effort: String? = null,
|
||||
temporary: Boolean = false,
|
||||
agent: AgentTarget? = null,
|
||||
agents: AgentsSetting? = null,
|
||||
) {
|
||||
val attached = _state.value.pending
|
||||
val files = attached.map { it.id }
|
||||
if (text.isBlank() && files.isEmpty()) return
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
@@ -145,13 +200,24 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
|
||||
val chat = _state.value.chat
|
||||
_state.update { it.copy(pending = emptyList()) }
|
||||
if (chat == null) {
|
||||
val made = client.createChat(text, files, model = model, temporary = temporary, effort = effort, mode = mode)
|
||||
val made = client.createChat(
|
||||
text,
|
||||
files,
|
||||
model = model,
|
||||
temporary = temporary,
|
||||
effort = effort,
|
||||
mode = mode,
|
||||
agent = agent,
|
||||
agents = agents,
|
||||
)
|
||||
_state.update { it.copy(chat = made.chat, messages = listOfNotNull(made.message, made.reply)) }
|
||||
made.reply?.let { follow(it.id) }
|
||||
} else {
|
||||
took(client.sendMessage(chat.id, text, files))
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
// Nothing was sent: the words and the attachments go back to the composer.
|
||||
_state.update { it.copy(pending = attached + it.pending, unsent = text) }
|
||||
fail(e)
|
||||
}
|
||||
}
|
||||
@@ -198,6 +264,84 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
|
||||
fun change(key: String, value: String?) = control { api, chat ->
|
||||
val updated = api.updateChat(chat.id, JsonObject(mapOf(key to JsonPrimitive(value))))
|
||||
_state.update { it.copy(chat = updated) }
|
||||
// Another model may serve one request at a time, or more: whether a team is offered
|
||||
// follows it.
|
||||
if (key == "model") {
|
||||
runCatching { api.activity(chat.id, context = false) }.onSuccess { r -> _state.update { it.copy(teamOffered = r.teamOffered) } }
|
||||
}
|
||||
}
|
||||
|
||||
/** The team's size, both ends; the server refuses a pair outside its bounds in its words. */
|
||||
fun setAgents(agents: AgentsSetting) = control { api, chat ->
|
||||
val updated = api.setAgents(chat.id, agents)
|
||||
_state.update { it.copy(chat = updated) }
|
||||
}
|
||||
|
||||
// --- The activity panel ------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Follow the chat's activity while the screen is in front: the events route says when
|
||||
* anything changed, with the strip's counts; an open panel then reads the whole of it
|
||||
* again. Runs until cancelled. A server without the route (or one that refuses it) leaves
|
||||
* the strip to the first read and an open panel to polling.
|
||||
*/
|
||||
suspend fun watchActivity() {
|
||||
val chat = _state.value.chat ?: return
|
||||
val client = runCatching { api() }.getOrNull() ?: return
|
||||
if (_state.value.summary == null) {
|
||||
// A chat its first message just made: whether a team is offered, read once.
|
||||
runCatching { client.activity(chat.id, context = false) }.onSuccess { a ->
|
||||
_state.update { it.copy(teamOffered = a.teamOffered, summary = a.summary) }
|
||||
}
|
||||
}
|
||||
try {
|
||||
StreamClient(client).watch { client.activityEvents(chat.id) }.collect { frame ->
|
||||
if (frame.event != "activity") return@collect
|
||||
val read = runCatching { LembasJson.decodeFromString(ActivityFrame.serializer(), frame.data) }.getOrNull() ?: return@collect
|
||||
val changed = read.version != _state.value.activity?.version
|
||||
_state.update { it.copy(summary = read.summary, activityLive = true) }
|
||||
if (changed && panelOpen) loadActivity()
|
||||
}
|
||||
} catch (e: CancellationException) {
|
||||
throw e
|
||||
} catch (_: Exception) {
|
||||
// Nothing to say: the strip and the panel do without the route.
|
||||
} finally {
|
||||
_state.update { it.copy(activityLive = false) }
|
||||
}
|
||||
}
|
||||
|
||||
private var panelOpen = false
|
||||
|
||||
fun panel(open: Boolean) {
|
||||
panelOpen = open
|
||||
if (open) loadActivity()
|
||||
}
|
||||
|
||||
/** Read the panel's facts; [context] false keeps the last count (the costly part). */
|
||||
fun loadActivity(context: Boolean = true) {
|
||||
val chat = _state.value.chat ?: return
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val read = api().activity(chat.id, context)
|
||||
_state.update { s ->
|
||||
s.copy(
|
||||
activity = if (context) read else read.copy(context = s.activity?.context),
|
||||
activityAt = SystemClock.elapsedRealtime(),
|
||||
summary = read.summary,
|
||||
teamOffered = read.teamOffered,
|
||||
)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
fail(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Stop a background agent (and, for a member, those under it), then read the panel again. */
|
||||
fun stopAgent(agent: ActivityAgent) = control { api, chat ->
|
||||
api.stopAgent(chat.id, agent.kind, agent.id)
|
||||
loadActivity(context = false)
|
||||
}
|
||||
|
||||
fun delete(then: () -> Unit) = control { api, chat ->
|
||||
@@ -221,6 +365,8 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
|
||||
val mime = resolver.getType(uri) ?: "application/octet-stream"
|
||||
val stored = api().upload(name, mime, bytes, _state.value.chat?.id)
|
||||
_state.update { it.copy(pending = it.pending + stored) }
|
||||
// A photo the camera took for this message is the server's now.
|
||||
if (uri.authority == photoAuthority) runCatching { resolver.delete(uri, null, null) }
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
fail(e)
|
||||
@@ -229,6 +375,19 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
|
||||
}
|
||||
}
|
||||
|
||||
private val photoAuthority get() = "${getApplication<Application>().packageName}.files"
|
||||
|
||||
/**
|
||||
* Where the camera writes a photo for the composer: a file in the app's cache, shared with
|
||||
* the camera app through the FileProvider for exactly this one capture.
|
||||
*/
|
||||
fun photoTarget(): Uri {
|
||||
val app = getApplication<Application>()
|
||||
val dir = File(app.cacheDir, "camera").apply { mkdirs() }
|
||||
val file = File(dir, "photo-${System.currentTimeMillis()}.jpg")
|
||||
return FileProvider.getUriForFile(app, photoAuthority, file)
|
||||
}
|
||||
|
||||
fun unattach(attachment: Attachment) {
|
||||
_state.update { s -> s.copy(pending = s.pending.filterNot { it.id == attachment.id }) }
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.SwipeToDismissBox
|
||||
import androidx.compose.material3.Tab
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.material3.pulltorefresh.PullToRefreshBox
|
||||
import androidx.compose.material3.rememberSwipeToDismissBoxState
|
||||
@@ -40,6 +41,8 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -49,6 +52,7 @@ import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.AndroidViewModel
|
||||
import androidx.lifecycle.compose.LifecycleResumeEffect
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
@@ -57,6 +61,7 @@ import eu.llembas.android.api.Chat
|
||||
import eu.llembas.android.api.Doorstep
|
||||
import eu.llembas.android.api.fit
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.ui.explain
|
||||
import eu.llembas.android.ui.signin.refusal
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
@@ -76,10 +81,15 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
|
||||
private var refused: Int? = null
|
||||
private var checked = false
|
||||
|
||||
fun load(kind: String) {
|
||||
/**
|
||||
* Read the list. [quiet] is the reload on coming back to the screen: the rows already shown
|
||||
* stay without a spinner, and only a change replaces them.
|
||||
*/
|
||||
fun load(kind: String, quiet: Boolean = false) {
|
||||
val switched = kind != this.kind
|
||||
this.kind = kind
|
||||
viewModelScope.launch {
|
||||
_state.update { it.copy(loading = true, error = null) }
|
||||
_state.update { it.copy(loading = !quiet || switched, error = null, chats = if (switched) emptyList() else it.chats) }
|
||||
try {
|
||||
val api = getApplication<Application>().lembas.instances.client() ?: return@launch
|
||||
// An instance signed in to before it was downgraded, or by 0.1 against a 1.x
|
||||
@@ -98,7 +108,7 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
|
||||
val page = api.chats(kind = kind)
|
||||
_state.value = ChatsState(chats = page.chats, more = page.more)
|
||||
} catch (e: Exception) {
|
||||
_state.update { it.copy(loading = false, error = e.message) }
|
||||
_state.update { it.copy(loading = false, error = getApplication<Application>().explain(e)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +121,7 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
|
||||
val page = api.chats(kind = kind, before = last.id)
|
||||
_state.update { it.copy(chats = it.chats + page.chats, more = page.more) }
|
||||
} catch (e: Exception) {
|
||||
_state.update { it.copy(error = e.message) }
|
||||
_state.update { it.copy(error = getApplication<Application>().explain(e)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,7 +134,7 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
|
||||
getApplication<Application>().lembas.instances.client()
|
||||
?.updateChat(chat.id, buildJsonObject { put("archived", true) })
|
||||
}.onFailure { e ->
|
||||
_state.update { it.copy(error = e.message) }
|
||||
_state.update { it.copy(error = getApplication<Application>().explain(e)) }
|
||||
load(kind)
|
||||
}
|
||||
}
|
||||
@@ -133,11 +143,25 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun ChatsScreen(onOpen: (String) -> Unit, onNew: () -> Unit, onSettings: () -> Unit, onFiles: () -> Unit, model: ChatsViewModel = viewModel()) {
|
||||
fun ChatsScreen(
|
||||
onOpen: (String) -> Unit,
|
||||
onNew: () -> Unit,
|
||||
onNewAgent: () -> Unit,
|
||||
onSettings: () -> Unit,
|
||||
onFiles: () -> Unit,
|
||||
model: ChatsViewModel = viewModel(),
|
||||
) {
|
||||
val state by model.state.collectAsStateWithLifecycle()
|
||||
var tab by rememberSaveable { mutableIntStateOf(0) }
|
||||
val kind = if (tab == 0) "chat" else "agent"
|
||||
LaunchedEffect(kind) { model.load(kind) }
|
||||
// Read again each time the list comes back into view -- from a chat, from another app --
|
||||
// so a new chat, a new title or a finished reply's dot is there without a pull.
|
||||
var shown by remember { mutableStateOf(false) }
|
||||
LifecycleResumeEffect(kind) {
|
||||
model.load(kind, quiet = shown)
|
||||
shown = true
|
||||
onPauseOrDispose { }
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
@@ -154,13 +178,11 @@ fun ChatsScreen(onOpen: (String) -> Unit, onNew: () -> Unit, onSettings: () -> U
|
||||
)
|
||||
},
|
||||
floatingActionButton = {
|
||||
if (tab == 0) {
|
||||
ExtendedFloatingActionButton(
|
||||
onClick = onNew,
|
||||
icon = { Icon(Icons.Filled.Add, contentDescription = null) },
|
||||
text = { Text(stringResource(R.string.new_chat)) },
|
||||
)
|
||||
}
|
||||
ExtendedFloatingActionButton(
|
||||
onClick = if (tab == 0) onNew else onNewAgent,
|
||||
icon = { Icon(Icons.Filled.Add, contentDescription = null) },
|
||||
text = { Text(stringResource(if (tab == 0) R.string.new_chat else R.string.new_agent_chat)) },
|
||||
)
|
||||
},
|
||||
) { padding ->
|
||||
Column(Modifier.padding(padding).fillMaxSize()) {
|
||||
@@ -169,10 +191,14 @@ fun ChatsScreen(onOpen: (String) -> Unit, onNew: () -> Unit, onSettings: () -> U
|
||||
Tab(selected = tab == 1, onClick = { tab = 1 }, text = { Text(stringResource(R.string.tab_agents)) })
|
||||
}
|
||||
state.error?.let {
|
||||
Text(it, color = MaterialTheme.colorScheme.error, modifier = Modifier.padding(16.dp))
|
||||
Row(Modifier.fillMaxWidth().padding(start = 16.dp, end = 8.dp, top = 8.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
// The sentence gives; the button keeps its size.
|
||||
Text(it, color = MaterialTheme.colorScheme.error, modifier = Modifier.weight(1f))
|
||||
TextButton(onClick = { model.load(kind) }) { Text(stringResource(R.string.retry)) }
|
||||
}
|
||||
}
|
||||
PullToRefreshBox(isRefreshing = state.loading, onRefresh = { model.load(kind) }, modifier = Modifier.fillMaxSize()) {
|
||||
if (state.chats.isEmpty() && !state.loading) {
|
||||
if (state.chats.isEmpty() && !state.loading && state.error == null) {
|
||||
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
||||
Text(
|
||||
stringResource(if (tab == 0) R.string.empty_chats else R.string.empty_agents),
|
||||
|
||||
@@ -47,6 +47,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
import eu.llembas.android.R
|
||||
import eu.llembas.android.api.FileEntry
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.ui.explain
|
||||
import eu.llembas.android.ui.theme.LocalPalette
|
||||
import eu.llembas.android.ui.viewer.TreeFileViewer
|
||||
import kotlinx.coroutines.Job
|
||||
@@ -91,7 +92,7 @@ class FilesViewModel(app: Application) : AndroidViewModel(app) {
|
||||
_state.value = FilesState(path = listing.path, parent = listing.parent, entries = listing.entries)
|
||||
} catch (e: Exception) {
|
||||
if (e is kotlinx.coroutines.CancellationException) throw e
|
||||
_state.update { it.copy(loading = false, error = e.message ?: e.javaClass.simpleName) }
|
||||
_state.update { it.copy(loading = false, error = getApplication<Application>().explain(e)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ import eu.llembas.android.api.ServerFit
|
||||
import eu.llembas.android.api.fit
|
||||
import eu.llembas.android.api.normaliseBase
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.ui.explain
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
@@ -124,7 +125,7 @@ class SignInViewModel(app: Application) : AndroidViewModel(app) {
|
||||
}
|
||||
_state.value = SignInState.Failed(getApplication<Application>().getString(R.string.signin_expired))
|
||||
} catch (e: Exception) {
|
||||
_state.value = SignInState.Failed(e.message ?: e.javaClass.simpleName)
|
||||
_state.value = SignInState.Failed(getApplication<Application>().explain(e))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at v2.0.0-beta.1. Do not edit.
|
||||
// Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at v2.0.0-beta.5. Do not edit.
|
||||
package eu.llembas.android.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
@@ -60,6 +60,7 @@ import eu.llembas.android.api.ApiException
|
||||
import eu.llembas.android.api.ShowCard
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.ui.MarkdownText
|
||||
import eu.llembas.android.ui.explain
|
||||
import eu.llembas.android.ui.theme.LocalPalette
|
||||
import java.io.IOException
|
||||
|
||||
@@ -159,7 +160,7 @@ private fun Viewer(file: Viewed, key: Any, webUrl: (ApiClient) -> String?, load:
|
||||
else -> Loaded.Failed(e.message ?: context.getString(R.string.viewer_unavailable))
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
Loaded.Failed(e.message ?: e.javaClass.simpleName)
|
||||
Loaded.Failed(context.explain(e))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class Updater(private val context: Context) {
|
||||
if (!it.isSuccessful) return@withContext context.getString(R.string.update_unreachable)
|
||||
LembasJson.decodeFromString(Latest.serializer(), it.body!!.string())
|
||||
}
|
||||
if (!newer(latest.version, BuildConfig.VERSION_NAME.removeSuffix("-debug"))) {
|
||||
if (!newer(latest.version, BuildConfig.VERSION_NAME.substringBefore("-debug"))) {
|
||||
return@withContext context.getString(R.string.update_none)
|
||||
}
|
||||
if (!context.packageManager.canRequestPackageInstalls()) {
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
<string name="tab_chats">Konverzace</string>
|
||||
<string name="tab_agents">Agenti</string>
|
||||
<string name="empty_chats">Zatím žádné konverzace. Ne všichni, kdo bloudí, jsou ztraceni — založte jednu.</string>
|
||||
<string name="empty_agents">Žádné konverzace s agentem. Spusťte jednu z webového rozhraní na propojeném zařízení.</string>
|
||||
<string name="empty_agents">Zatím žádné konverzace s agentem. Spusťte jednu tlačítkem Nová konverzace s agentem na zařízení propojeném s touto instancí.</string>
|
||||
<string name="new_agent_chat">Nová konverzace s agentem</string>
|
||||
<string name="agent_device">Zařízení</string>
|
||||
<string name="agent_no_device">Právě není propojené žádné zařízení. Spusťte `lembas service` na počítači přihlášeném k této instanci a vraťte se.</string>
|
||||
<string name="agent_directory">Složka na zařízení</string>
|
||||
<string name="agent_directory_hint">Prázdné: první složka zařízení</string>
|
||||
<string name="empty_chat">O čem si promluvíme?</string>
|
||||
<string name="loading_line">Pečou se lembasy…</string>
|
||||
<string name="archive">Archivovat</string>
|
||||
@@ -35,16 +40,79 @@
|
||||
<string name="send">Odeslat</string>
|
||||
<string name="stop">Zastavit</string>
|
||||
<string name="attach">Přiložit soubor</string>
|
||||
<string name="attach_take_photo">Vyfotit</string>
|
||||
<string name="attach_choose_photos">Vybrat fotky</string>
|
||||
<string name="attach_choose_files">Vybrat soubory</string>
|
||||
<string name="copy_message">Zkopírovat zprávu</string>
|
||||
<string name="copied">Zkopírováno.</string>
|
||||
<string name="rename_chat">Přejmenovat konverzaci</string>
|
||||
<string name="save">Uložit</string>
|
||||
<string name="retry">Zkusit znovu</string>
|
||||
<string name="offline">Instance není dostupná. Zkontrolujte připojení telefonu a to, zda se dostane na adresu instance.</string>
|
||||
<string name="dictate">Diktovat</string>
|
||||
<string name="remove">Odebrat</string>
|
||||
<string name="more">Více</string>
|
||||
<string name="back">Zpět</string>
|
||||
<string name="cancel">Zrušit</string>
|
||||
<string name="close">Zavřít</string>
|
||||
<string name="effort_off">Úsilí: vypnuto</string>
|
||||
<string name="mode_plan">Plán</string>
|
||||
<string name="mode_edit">Upravit</string>
|
||||
<string name="mode_manual">Manual</string>
|
||||
<string name="mode_manual">Ručně</string>
|
||||
<string name="mode_auto">Automaticky</string>
|
||||
<string name="activity">Aktivita</string>
|
||||
<string name="activity_open">Otevřít panel aktivity</string>
|
||||
<string name="activity_context">Kontext</string>
|
||||
<string name="activity_outputs">Výstupy</string>
|
||||
<string name="activity_tasks">Úlohy na pozadí</string>
|
||||
<string name="activity_used">Využito: %1$s %%</string>
|
||||
<string name="activity_window_unknown">okno neznámé</string>
|
||||
<string name="activity_not_measured">Neměřeno.</string>
|
||||
<string name="activity_measured">Spočítal model při poslední odpovědi; kategorie jsou odhadnuté.</string>
|
||||
<string name="activity_estimated">Odhad: žádná odpověď ještě nebyla spočítána.</string>
|
||||
<string name="activity_tools_offered">Nabízené nástroje: %1$s.</string>
|
||||
<string name="ctx_messages">Zprávy</string>
|
||||
<string name="ctx_system">Systémový pokyn</string>
|
||||
<string name="ctx_memory">Paměť a osobní</string>
|
||||
<string name="ctx_instructions">Soubory s pokyny</string>
|
||||
<string name="ctx_tools">Nástroje</string>
|
||||
<string name="ctx_mcp_tools">Nástroje MCP</string>
|
||||
<string name="ctx_since">Od poslední odpovědi</string>
|
||||
<string name="ctx_buffer">Rezerva na zhuštění</string>
|
||||
<string name="ctx_free">Volné místo</string>
|
||||
<string name="outputs_empty">V tomto chatu se zatím nezapsal žádný soubor.</string>
|
||||
<string name="tasks_empty">Na pozadí nic neběží. Pomocníci, příkazy a členové týmu se tu zobrazí, dokud pracují.</string>
|
||||
<string name="tasks_none_running">Nic neběží.</string>
|
||||
<string name="agents_one_working">1 agent pracuje</string>
|
||||
<string name="agents_n_working">Pracující agenti: %1$s</string>
|
||||
<string name="agents_n_queued">Ve frontě: %1$s</string>
|
||||
<string name="agents_n_waiting">Čeká: %1$s</string>
|
||||
<string name="agents_n_finished">Dokončeno: %1$s</string>
|
||||
<string name="agent_state_queued">ve frontě</string>
|
||||
<string name="agent_state_working">pracuje</string>
|
||||
<string name="agent_state_waiting">čeká</string>
|
||||
<string name="agent_state_done">hotovo</string>
|
||||
<string name="agent_state_stopped">zastaveno</string>
|
||||
<string name="agent_state_error">selhalo</string>
|
||||
<string name="agent_steps">Kroky: %1$s, nástroje: %2$s</string>
|
||||
<string name="agent_open_conversation">Otevřít jeho konverzaci</string>
|
||||
<string name="agent_stop">Zastavit %1$s</string>
|
||||
<string name="agent_stop_member_confirm">Zastavit %1$s a členy pod ním? Opustí tým.</string>
|
||||
<string name="agent_stop_confirm">Zastavit %1$s? Co dosud udělal, zůstane.</string>
|
||||
<string name="agent_nothing_yet">Zatím nic neřekl.</string>
|
||||
<string name="agent_machine">Od systému</string>
|
||||
<string name="team_size">Tým: %1$s z %2$s agentů</string>
|
||||
<string name="team_room">Místnost</string>
|
||||
<string name="room_empty">V místnosti zatím nikdo nic neřekl.</string>
|
||||
<string name="room_report">hlášení</string>
|
||||
<string name="team_agents">Agenti</string>
|
||||
<string name="team_fewest">Nejméně</string>
|
||||
<string name="team_most">Nejvíce</string>
|
||||
<string name="team_hint">Včetně vlastního agenta. Při více než jednom může přidat členy, kteří dělají práci, zatímco je vede.</string>
|
||||
<string name="team_chip">Agenti %1$s–%2$s</string>
|
||||
<string name="thinking_switch">Přemýšlet před odpovědí</string>
|
||||
<string name="effort_level">Náročnost: %1$s</string>
|
||||
<string name="level_off">vypnuto</string>
|
||||
<string name="level_default">výchozí</string>
|
||||
<string name="card_approval">Povolit to?</string>
|
||||
<string name="card_allow_once">Povolit jednou</string>
|
||||
<string name="card_allow_always">Toto vždy povolit</string>
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
<string name="tab_chats">Chats</string>
|
||||
<string name="tab_agents">Agenten</string>
|
||||
<string name="empty_chats">Noch keine Chats. Nicht jeder, der wandert, ist verloren — fangen Sie einen an.</string>
|
||||
<string name="empty_agents">Keine Agent-Chats. Starten Sie einen über die Weboberfläche auf einem verknüpften Gerät.</string>
|
||||
<string name="empty_agents">Noch keine Agent-Chats. Starten Sie einen mit „Neuer Agent-Chat“ auf einem Gerät, das mit dieser Instanz verknüpft ist.</string>
|
||||
<string name="new_agent_chat">Neuer Agent-Chat</string>
|
||||
<string name="agent_device">Gerät</string>
|
||||
<string name="agent_no_device">Gerade ist kein Gerät verknüpft. Starten Sie `lembas service` auf einem Computer, der bei dieser Instanz angemeldet ist, und kommen Sie dann zurück.</string>
|
||||
<string name="agent_directory">Ordner auf dem Gerät</string>
|
||||
<string name="agent_directory_hint">Leer: der erste Ordner des Geräts</string>
|
||||
<string name="empty_chat">Worüber sprechen wir?</string>
|
||||
<string name="loading_line">Lembas wird gebacken…</string>
|
||||
<string name="archive">Archivieren</string>
|
||||
@@ -35,16 +40,79 @@
|
||||
<string name="send">Senden</string>
|
||||
<string name="stop">Stoppen</string>
|
||||
<string name="attach">Datei anhängen</string>
|
||||
<string name="attach_take_photo">Foto aufnehmen</string>
|
||||
<string name="attach_choose_photos">Fotos auswählen</string>
|
||||
<string name="attach_choose_files">Dateien auswählen</string>
|
||||
<string name="copy_message">Nachricht kopieren</string>
|
||||
<string name="copied">Kopiert.</string>
|
||||
<string name="rename_chat">Chat umbenennen</string>
|
||||
<string name="save">Speichern</string>
|
||||
<string name="retry">Erneut versuchen</string>
|
||||
<string name="offline">Die Instanz ist nicht erreichbar. Prüfen Sie die Verbindung des Telefons und ob es die Adresse der Instanz erreicht.</string>
|
||||
<string name="dictate">Diktieren</string>
|
||||
<string name="remove">Entfernen</string>
|
||||
<string name="more">Mehr</string>
|
||||
<string name="back">Zurück</string>
|
||||
<string name="cancel">Abbrechen</string>
|
||||
<string name="close">Schließen</string>
|
||||
<string name="effort_off">Aufwand: aus</string>
|
||||
<string name="mode_plan">Tarif</string>
|
||||
<string name="mode_plan">Plan</string>
|
||||
<string name="mode_edit">Bearbeiten</string>
|
||||
<string name="mode_manual">Manual</string>
|
||||
<string name="mode_manual">Manuell</string>
|
||||
<string name="mode_auto">Automatisch</string>
|
||||
<string name="activity">Aktivität</string>
|
||||
<string name="activity_open">Aktivitätsbereich öffnen</string>
|
||||
<string name="activity_context">Kontext</string>
|
||||
<string name="activity_outputs">Ausgaben</string>
|
||||
<string name="activity_tasks">Hintergrundaufgaben</string>
|
||||
<string name="activity_used">%1$s %% belegt</string>
|
||||
<string name="activity_window_unknown">Fenster unbekannt</string>
|
||||
<string name="activity_not_measured">Nicht gemessen.</string>
|
||||
<string name="activity_measured">Vom Modell bei der letzten Antwort gezählt; die Kategorien sind geschätzt.</string>
|
||||
<string name="activity_estimated">Geschätzt: Noch keine Antwort wurde gezählt.</string>
|
||||
<string name="activity_tools_offered">%1$s Werkzeuge angeboten.</string>
|
||||
<string name="ctx_messages">Nachrichten</string>
|
||||
<string name="ctx_system">Systemprompt</string>
|
||||
<string name="ctx_memory">Gedächtnis und Persönliches</string>
|
||||
<string name="ctx_instructions">Anweisungsdateien</string>
|
||||
<string name="ctx_tools">Werkzeuge</string>
|
||||
<string name="ctx_mcp_tools">MCP-Werkzeuge</string>
|
||||
<string name="ctx_since">Seit der letzten Antwort</string>
|
||||
<string name="ctx_buffer">Puffer für die Verdichtung</string>
|
||||
<string name="ctx_free">Freier Platz</string>
|
||||
<string name="outputs_empty">In diesem Chat wurde noch keine Datei geschrieben.</string>
|
||||
<string name="tasks_empty">Im Hintergrund läuft nichts. Helfer, Befehle und die Mitglieder eines Teams erscheinen hier, solange sie arbeiten.</string>
|
||||
<string name="tasks_none_running">Nichts läuft.</string>
|
||||
<string name="agents_one_working">1 Agent arbeitet</string>
|
||||
<string name="agents_n_working">%1$s Agenten arbeiten</string>
|
||||
<string name="agents_n_queued">%1$s in der Warteschlange</string>
|
||||
<string name="agents_n_waiting">%1$s warten</string>
|
||||
<string name="agents_n_finished">%1$s beendet</string>
|
||||
<string name="agent_state_queued">in der Warteschlange</string>
|
||||
<string name="agent_state_working">arbeitet</string>
|
||||
<string name="agent_state_waiting">wartet</string>
|
||||
<string name="agent_state_done">fertig</string>
|
||||
<string name="agent_state_stopped">angehalten</string>
|
||||
<string name="agent_state_error">fehlgeschlagen</string>
|
||||
<string name="agent_steps">%1$s Schritte, %2$s Werkzeuge</string>
|
||||
<string name="agent_open_conversation">Seine Unterhaltung öffnen</string>
|
||||
<string name="agent_stop">%1$s stoppen</string>
|
||||
<string name="agent_stop_member_confirm">%1$s und die Mitglieder darunter stoppen? Sie verlassen das Team.</string>
|
||||
<string name="agent_stop_confirm">%1$s stoppen? Was bisher getan wurde, bleibt.</string>
|
||||
<string name="agent_nothing_yet">Noch nichts gesagt.</string>
|
||||
<string name="agent_machine">Vom System</string>
|
||||
<string name="team_size">Team: %1$s von %2$s Agenten</string>
|
||||
<string name="team_room">Raum</string>
|
||||
<string name="room_empty">Im Raum wurde noch nichts gesagt.</string>
|
||||
<string name="room_report">Bericht</string>
|
||||
<string name="team_agents">Agenten</string>
|
||||
<string name="team_fewest">Mindestens</string>
|
||||
<string name="team_most">Höchstens</string>
|
||||
<string name="team_hint">Der eigene Agent eingeschlossen. Bei mehr als einem kann er Mitglieder hinzufügen, die die Arbeit machen, während er sie leitet.</string>
|
||||
<string name="team_chip">Agenten %1$s–%2$s</string>
|
||||
<string name="thinking_switch">Vor der Antwort nachdenken</string>
|
||||
<string name="effort_level">Denkaufwand: %1$s</string>
|
||||
<string name="level_off">aus</string>
|
||||
<string name="level_default">Standard</string>
|
||||
<string name="card_approval">Das erlauben?</string>
|
||||
<string name="card_allow_once">Einmal erlauben</string>
|
||||
<string name="card_allow_always">Dies immer erlauben</string>
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
<string name="tab_chats">Chats</string>
|
||||
<string name="tab_agents">Agentes</string>
|
||||
<string name="empty_chats">Aún no hay chats. No todos los que vagan están perdidos — empiece uno.</string>
|
||||
<string name="empty_agents">No hay chats de agente. Inicie uno desde la interfaz web en un dispositivo vinculado.</string>
|
||||
<string name="empty_agents">Aún no hay chats de agente. Inicie uno con Nuevo chat de agente, en un dispositivo vinculado a esta instancia.</string>
|
||||
<string name="new_agent_chat">Nuevo chat de agente</string>
|
||||
<string name="agent_device">Dispositivo</string>
|
||||
<string name="agent_no_device">Ahora no hay ningún dispositivo vinculado. Inicie `lembas service` en un ordenador con sesión iniciada en esta instancia y vuelva.</string>
|
||||
<string name="agent_directory">Carpeta en el dispositivo</string>
|
||||
<string name="agent_directory_hint">Vacío: la primera carpeta del dispositivo</string>
|
||||
<string name="empty_chat">¿De qué hablamos?</string>
|
||||
<string name="loading_line">Horneando lembas…</string>
|
||||
<string name="archive">Archivar</string>
|
||||
@@ -35,16 +40,79 @@
|
||||
<string name="send">Enviar</string>
|
||||
<string name="stop">Detener</string>
|
||||
<string name="attach">Adjuntar un archivo</string>
|
||||
<string name="attach_take_photo">Hacer una foto</string>
|
||||
<string name="attach_choose_photos">Elegir fotos</string>
|
||||
<string name="attach_choose_files">Elegir archivos</string>
|
||||
<string name="copy_message">Copiar mensaje</string>
|
||||
<string name="copied">Copiado.</string>
|
||||
<string name="rename_chat">Renombrar chat</string>
|
||||
<string name="save">Guardar</string>
|
||||
<string name="retry">Reintentar</string>
|
||||
<string name="offline">No se puede acceder a la instancia. Compruebe la conexión del teléfono y que llegue a la dirección de la instancia.</string>
|
||||
<string name="dictate">Dictar</string>
|
||||
<string name="remove">Quitar</string>
|
||||
<string name="more">Más</string>
|
||||
<string name="back">Volver</string>
|
||||
<string name="cancel">Cancelar</string>
|
||||
<string name="close">Cerrar</string>
|
||||
<string name="effort_off">Esfuerzo: desactivado</string>
|
||||
<string name="mode_plan">Plan</string>
|
||||
<string name="mode_edit">Editar</string>
|
||||
<string name="mode_manual">Manual</string>
|
||||
<string name="mode_auto">Automático</string>
|
||||
<string name="activity">Actividad</string>
|
||||
<string name="activity_open">Abrir el panel de actividad</string>
|
||||
<string name="activity_context">Contexto</string>
|
||||
<string name="activity_outputs">Resultados</string>
|
||||
<string name="activity_tasks">Tareas en segundo plano</string>
|
||||
<string name="activity_used">%1$s %% usado</string>
|
||||
<string name="activity_window_unknown">ventana desconocida</string>
|
||||
<string name="activity_not_measured">Sin medir.</string>
|
||||
<string name="activity_measured">Contado por el modelo en la última respuesta; las categorías son estimaciones.</string>
|
||||
<string name="activity_estimated">Estimado: aún no se ha contado ninguna respuesta.</string>
|
||||
<string name="activity_tools_offered">%1$s herramientas ofrecidas.</string>
|
||||
<string name="ctx_messages">Mensajes</string>
|
||||
<string name="ctx_system">Prompt de sistema</string>
|
||||
<string name="ctx_memory">Memoria y datos personales</string>
|
||||
<string name="ctx_instructions">Archivos de instrucciones</string>
|
||||
<string name="ctx_tools">Herramientas</string>
|
||||
<string name="ctx_mcp_tools">Herramientas MCP</string>
|
||||
<string name="ctx_since">Desde la última respuesta</string>
|
||||
<string name="ctx_buffer">Reserva para la compactación</string>
|
||||
<string name="ctx_free">Espacio libre</string>
|
||||
<string name="outputs_empty">Todavía no se ha escrito ningún archivo en este chat.</string>
|
||||
<string name="tasks_empty">No hay nada en segundo plano. Los ayudantes, los comandos y los miembros de un equipo aparecen aquí mientras trabajan.</string>
|
||||
<string name="tasks_none_running">Nada en marcha.</string>
|
||||
<string name="agents_one_working">1 agente trabajando</string>
|
||||
<string name="agents_n_working">%1$s agentes trabajando</string>
|
||||
<string name="agents_n_queued">%1$s en cola</string>
|
||||
<string name="agents_n_waiting">%1$s esperando</string>
|
||||
<string name="agents_n_finished">%1$s terminados</string>
|
||||
<string name="agent_state_queued">en cola</string>
|
||||
<string name="agent_state_working">trabajando</string>
|
||||
<string name="agent_state_waiting">esperando</string>
|
||||
<string name="agent_state_done">terminado</string>
|
||||
<string name="agent_state_stopped">detenido</string>
|
||||
<string name="agent_state_error">falló</string>
|
||||
<string name="agent_steps">%1$s pasos, %2$s herramientas</string>
|
||||
<string name="agent_open_conversation">Abrir su conversación</string>
|
||||
<string name="agent_stop">Detener %1$s</string>
|
||||
<string name="agent_stop_member_confirm">¿Detener %1$s y a los miembros que dependen de él? Dejan el equipo.</string>
|
||||
<string name="agent_stop_confirm">¿Detener %1$s? Lo que ha hecho hasta ahora se queda.</string>
|
||||
<string name="agent_nothing_yet">Todavía no ha dicho nada.</string>
|
||||
<string name="agent_machine">Del sistema</string>
|
||||
<string name="team_size">Equipo: %1$s de %2$s agentes</string>
|
||||
<string name="team_room">Sala</string>
|
||||
<string name="room_empty">Todavía no se ha dicho nada en la sala.</string>
|
||||
<string name="room_report">informe</string>
|
||||
<string name="team_agents">Agentes</string>
|
||||
<string name="team_fewest">Mínimo</string>
|
||||
<string name="team_most">Máximo</string>
|
||||
<string name="team_hint">Su propio agente incluido. Con más de uno, puede añadir miembros que hagan el trabajo mientras los dirige.</string>
|
||||
<string name="team_chip">Agentes %1$s–%2$s</string>
|
||||
<string name="thinking_switch">Razonar antes de responder</string>
|
||||
<string name="effort_level">Esfuerzo: %1$s</string>
|
||||
<string name="level_off">desactivado</string>
|
||||
<string name="level_default">predeterminado</string>
|
||||
<string name="card_approval">¿Permitir esto?</string>
|
||||
<string name="card_allow_once">Permitir una vez</string>
|
||||
<string name="card_allow_always">Permitir siempre esto</string>
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
<string name="tab_chats">Conversations</string>
|
||||
<string name="tab_agents">Agents</string>
|
||||
<string name="empty_chats">Pas encore de conversation. Tous ceux qui errent ne sont pas perdus — commencez-en une.</string>
|
||||
<string name="empty_agents">Aucune conversation d\'agent. Démarrez-en une depuis l\'interface web sur un appareil associé.</string>
|
||||
<string name="empty_agents">Pas encore de conversation d\'agent. Démarrez-en une avec Nouvelle conversation d\'agent, sur un appareil associé à cette instance.</string>
|
||||
<string name="new_agent_chat">Nouvelle conversation d\'agent</string>
|
||||
<string name="agent_device">Appareil</string>
|
||||
<string name="agent_no_device">Aucun appareil n\'est associé pour l\'instant. Lancez `lembas service` sur un ordinateur connecté à cette instance, puis revenez.</string>
|
||||
<string name="agent_directory">Dossier sur l\'appareil</string>
|
||||
<string name="agent_directory_hint">Vide : le premier dossier de l\'appareil</string>
|
||||
<string name="empty_chat">De quoi allons-nous parler ?</string>
|
||||
<string name="loading_line">Cuisson des lembas…</string>
|
||||
<string name="archive">Archiver</string>
|
||||
@@ -35,16 +40,79 @@
|
||||
<string name="send">Envoyer</string>
|
||||
<string name="stop">Arrêter</string>
|
||||
<string name="attach">Joindre un fichier</string>
|
||||
<string name="attach_take_photo">Prendre une photo</string>
|
||||
<string name="attach_choose_photos">Choisir des photos</string>
|
||||
<string name="attach_choose_files">Choisir des fichiers</string>
|
||||
<string name="copy_message">Copier le message</string>
|
||||
<string name="copied">Copié.</string>
|
||||
<string name="rename_chat">Renommer la conversation</string>
|
||||
<string name="save">Enregistrer</string>
|
||||
<string name="retry">Réessayer</string>
|
||||
<string name="offline">L\'instance est injoignable. Vérifiez la connexion du téléphone et qu\'il atteint bien l\'adresse de l\'instance.</string>
|
||||
<string name="dictate">Dicter</string>
|
||||
<string name="remove">Retirer</string>
|
||||
<string name="more">Plus</string>
|
||||
<string name="back">Retour</string>
|
||||
<string name="cancel">Annuler</string>
|
||||
<string name="close">Fermer</string>
|
||||
<string name="effort_off">Effort : désactivé</string>
|
||||
<string name="mode_plan">Forfait</string>
|
||||
<string name="mode_plan">Plan</string>
|
||||
<string name="mode_edit">Modifier</string>
|
||||
<string name="mode_manual">Manual</string>
|
||||
<string name="mode_manual">Manuel</string>
|
||||
<string name="mode_auto">Automatique</string>
|
||||
<string name="activity">Activité</string>
|
||||
<string name="activity_open">Ouvrir le panneau d’activité</string>
|
||||
<string name="activity_context">Contexte</string>
|
||||
<string name="activity_outputs">Sorties</string>
|
||||
<string name="activity_tasks">Tâches en arrière-plan</string>
|
||||
<string name="activity_used">%1$s %% utilisés</string>
|
||||
<string name="activity_window_unknown">fenêtre inconnue</string>
|
||||
<string name="activity_not_measured">Non mesuré.</string>
|
||||
<string name="activity_measured">Compté par le modèle lors de la dernière réponse ; les catégories sont estimées.</string>
|
||||
<string name="activity_estimated">Estimation : aucune réponse n’a encore été comptée.</string>
|
||||
<string name="activity_tools_offered">%1$s outils proposés.</string>
|
||||
<string name="ctx_messages">Messages</string>
|
||||
<string name="ctx_system">Prompt système</string>
|
||||
<string name="ctx_memory">Mémoire et informations personnelles</string>
|
||||
<string name="ctx_instructions">Fichiers d’instructions</string>
|
||||
<string name="ctx_tools">Outils</string>
|
||||
<string name="ctx_mcp_tools">Outils MCP</string>
|
||||
<string name="ctx_since">Depuis la dernière réponse</string>
|
||||
<string name="ctx_buffer">Réserve de compactage</string>
|
||||
<string name="ctx_free">Espace libre</string>
|
||||
<string name="outputs_empty">Aucun fichier n’a encore été écrit dans cette conversation.</string>
|
||||
<string name="tasks_empty">Rien ne tourne en arrière-plan. Les assistants, les commandes et les membres d’une équipe s’affichent ici pendant qu’ils travaillent.</string>
|
||||
<string name="tasks_none_running">Rien en cours.</string>
|
||||
<string name="agents_one_working">1 agent au travail</string>
|
||||
<string name="agents_n_working">%1$s agents au travail</string>
|
||||
<string name="agents_n_queued">%1$s en file d’attente</string>
|
||||
<string name="agents_n_waiting">%1$s en attente</string>
|
||||
<string name="agents_n_finished">%1$s terminés</string>
|
||||
<string name="agent_state_queued">en file d’attente</string>
|
||||
<string name="agent_state_working">au travail</string>
|
||||
<string name="agent_state_waiting">en attente</string>
|
||||
<string name="agent_state_done">terminé</string>
|
||||
<string name="agent_state_stopped">arrêté</string>
|
||||
<string name="agent_state_error">échoué</string>
|
||||
<string name="agent_steps">%1$s étapes, %2$s outils</string>
|
||||
<string name="agent_open_conversation">Ouvrir sa conversation</string>
|
||||
<string name="agent_stop">Arrêter %1$s</string>
|
||||
<string name="agent_stop_member_confirm">Arrêter %1$s et les membres qui en dépendent ? Ils quittent l’équipe.</string>
|
||||
<string name="agent_stop_confirm">Arrêter %1$s ? Ce qu’il a déjà fait reste.</string>
|
||||
<string name="agent_nothing_yet">Rien de dit pour l’instant.</string>
|
||||
<string name="agent_machine">Du système</string>
|
||||
<string name="team_size">Équipe : %1$s agents sur %2$s</string>
|
||||
<string name="team_room">Salle</string>
|
||||
<string name="room_empty">Rien n’a encore été dit dans la salle.</string>
|
||||
<string name="room_report">rapport</string>
|
||||
<string name="team_agents">Agents</string>
|
||||
<string name="team_fewest">Au moins</string>
|
||||
<string name="team_most">Au plus</string>
|
||||
<string name="team_hint">Son propre agent compris. Au-delà d’un, il peut ajouter des membres qui font le travail pendant qu’il les dirige.</string>
|
||||
<string name="team_chip">Agents %1$s–%2$s</string>
|
||||
<string name="thinking_switch">Réfléchir avant de répondre</string>
|
||||
<string name="effort_level">Effort : %1$s</string>
|
||||
<string name="level_off">désactivé</string>
|
||||
<string name="level_default">par défaut</string>
|
||||
<string name="card_approval">Autoriser ceci ?</string>
|
||||
<string name="card_allow_once">Autoriser une fois</string>
|
||||
<string name="card_allow_always">Toujours autoriser ceci</string>
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
<string name="tab_chats">Csevegések</string>
|
||||
<string name="tab_agents">Ügynökök</string>
|
||||
<string name="empty_chats">Még nincs csevegés. Nem mindenki van elveszve, aki bolyong — kezdjen el egyet.</string>
|
||||
<string name="empty_agents">Nincs ügynök-csevegés. Indítson el egyet a webes felületen egy összekapcsolt eszközön.</string>
|
||||
<string name="empty_agents">Még nincs ügynök-csevegés. Indítson egyet az Új ügynök-csevegés gombbal, egy ehhez a példányhoz kapcsolt eszközön.</string>
|
||||
<string name="new_agent_chat">Új ügynök-csevegés</string>
|
||||
<string name="agent_device">Eszköz</string>
|
||||
<string name="agent_no_device">Jelenleg nincs összekapcsolt eszköz. Indítsa el a `lembas service` parancsot egy ebbe a példányba bejelentkezett számítógépen, majd térjen vissza.</string>
|
||||
<string name="agent_directory">Mappa az eszközön</string>
|
||||
<string name="agent_directory_hint">Üres: az eszköz első mappája</string>
|
||||
<string name="empty_chat">Miről beszéljünk?</string>
|
||||
<string name="loading_line">Lembas sül…</string>
|
||||
<string name="archive">Archiválás</string>
|
||||
@@ -35,16 +40,79 @@
|
||||
<string name="send">Küldés</string>
|
||||
<string name="stop">Leállítás</string>
|
||||
<string name="attach">Fájl csatolása</string>
|
||||
<string name="attach_take_photo">Fénykép készítése</string>
|
||||
<string name="attach_choose_photos">Fényképek kiválasztása</string>
|
||||
<string name="attach_choose_files">Fájlok kiválasztása</string>
|
||||
<string name="copy_message">Üzenet másolása</string>
|
||||
<string name="copied">Másolva.</string>
|
||||
<string name="rename_chat">Csevegés átnevezése</string>
|
||||
<string name="save">Mentés</string>
|
||||
<string name="retry">Újrapróbálás</string>
|
||||
<string name="offline">A példány nem érhető el. Ellenőrizze a telefon kapcsolatát, és hogy eléri-e a példány címét.</string>
|
||||
<string name="dictate">Diktálás</string>
|
||||
<string name="remove">Eltávolítás</string>
|
||||
<string name="more">Továbbiak</string>
|
||||
<string name="back">Vissza</string>
|
||||
<string name="cancel">Mégse</string>
|
||||
<string name="close">Bezárás</string>
|
||||
<string name="effort_off">Erőfeszítés: kikapcsolva</string>
|
||||
<string name="mode_plan">Csomag</string>
|
||||
<string name="mode_plan">Terv</string>
|
||||
<string name="mode_edit">Szerkesztés</string>
|
||||
<string name="mode_manual">Manual</string>
|
||||
<string name="mode_manual">Kézi</string>
|
||||
<string name="mode_auto">Automatikus</string>
|
||||
<string name="activity">Tevékenység</string>
|
||||
<string name="activity_open">A tevékenységpanel megnyitása</string>
|
||||
<string name="activity_context">Kontextus</string>
|
||||
<string name="activity_outputs">Kimenetek</string>
|
||||
<string name="activity_tasks">Háttérfeladatok</string>
|
||||
<string name="activity_used">%1$s%% foglalt</string>
|
||||
<string name="activity_window_unknown">az ablak ismeretlen</string>
|
||||
<string name="activity_not_measured">Nincs mérve.</string>
|
||||
<string name="activity_measured">A modell számolta az utolsó válasznál; a kategóriák becslések.</string>
|
||||
<string name="activity_estimated">Becslés: még egy válasz sem lett megszámolva.</string>
|
||||
<string name="activity_tools_offered">%1$s eszköz felkínálva.</string>
|
||||
<string name="ctx_messages">Üzenetek</string>
|
||||
<string name="ctx_system">Rendszerprompt</string>
|
||||
<string name="ctx_memory">Memória és személyes adatok</string>
|
||||
<string name="ctx_instructions">Utasításfájlok</string>
|
||||
<string name="ctx_tools">Eszközök</string>
|
||||
<string name="ctx_mcp_tools">MCP-eszközök</string>
|
||||
<string name="ctx_since">Az utolsó válasz óta</string>
|
||||
<string name="ctx_buffer">Tömörítési tartalék</string>
|
||||
<string name="ctx_free">Szabad hely</string>
|
||||
<string name="outputs_empty">Ebben a csevegésben még nem íródott fájl.</string>
|
||||
<string name="tasks_empty">A háttérben semmi sem fut. A segítők, a parancsok és egy csapat tagjai itt jelennek meg, amíg dolgoznak.</string>
|
||||
<string name="tasks_none_running">Semmi sem fut.</string>
|
||||
<string name="agents_one_working">1 ügynök dolgozik</string>
|
||||
<string name="agents_n_working">%1$s ügynök dolgozik</string>
|
||||
<string name="agents_n_queued">%1$s sorban áll</string>
|
||||
<string name="agents_n_waiting">%1$s várakozik</string>
|
||||
<string name="agents_n_finished">%1$s befejezve</string>
|
||||
<string name="agent_state_queued">sorban áll</string>
|
||||
<string name="agent_state_working">dolgozik</string>
|
||||
<string name="agent_state_waiting">várakozik</string>
|
||||
<string name="agent_state_done">kész</string>
|
||||
<string name="agent_state_stopped">leállítva</string>
|
||||
<string name="agent_state_error">sikertelen</string>
|
||||
<string name="agent_steps">%1$s lépés, %2$s eszköz</string>
|
||||
<string name="agent_open_conversation">A beszélgetésének megnyitása</string>
|
||||
<string name="agent_stop">%1$s leállítása</string>
|
||||
<string name="agent_stop_member_confirm">Leállítja %1$s tagot és az alatta lévőket? Kilépnek a csapatból.</string>
|
||||
<string name="agent_stop_confirm">Leállítja: %1$s? Amit eddig elvégzett, megmarad.</string>
|
||||
<string name="agent_nothing_yet">Még nem mondott semmit.</string>
|
||||
<string name="agent_machine">A rendszertől</string>
|
||||
<string name="team_size">Csapat: %1$s / %2$s ügynök</string>
|
||||
<string name="team_room">Szoba</string>
|
||||
<string name="room_empty">A szobában még senki nem mondott semmit.</string>
|
||||
<string name="room_report">jelentés</string>
|
||||
<string name="team_agents">Ügynökök</string>
|
||||
<string name="team_fewest">Legalább</string>
|
||||
<string name="team_most">Legfeljebb</string>
|
||||
<string name="team_hint">A saját ügynökét is beleértve. Egynél több esetén tagokat vehet fel, akik elvégzik a munkát, amíg ő vezeti őket.</string>
|
||||
<string name="team_chip">Ügynökök: %1$s–%2$s</string>
|
||||
<string name="thinking_switch">Gondolkodjon válasz előtt</string>
|
||||
<string name="effort_level">Erőfeszítés: %1$s</string>
|
||||
<string name="level_off">ki</string>
|
||||
<string name="level_default">alapértelmezett</string>
|
||||
<string name="card_approval">Engedélyezzük ezt?</string>
|
||||
<string name="card_allow_once">Engedélyezés egyszer</string>
|
||||
<string name="card_allow_always">Ennek mindig engedélyezése</string>
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
<string name="tab_chats">Chat</string>
|
||||
<string name="tab_agents">Agenti</string>
|
||||
<string name="empty_chats">Ancora nessuna chat. Non tutti quelli che vagano sono perduti — iniziane una.</string>
|
||||
<string name="empty_agents">Nessuna chat agente. Avviane una dall\'interfaccia web su un dispositivo collegato.</string>
|
||||
<string name="empty_agents">Ancora nessuna chat agente. Avviane una con Nuova chat agente, su un dispositivo collegato a questa istanza.</string>
|
||||
<string name="new_agent_chat">Nuova chat agente</string>
|
||||
<string name="agent_device">Dispositivo</string>
|
||||
<string name="agent_no_device">Nessun dispositivo è collegato ora. Avvia `lembas service` su un computer connesso a questa istanza, poi torna qui.</string>
|
||||
<string name="agent_directory">Cartella sul dispositivo</string>
|
||||
<string name="agent_directory_hint">Vuoto: la prima cartella del dispositivo</string>
|
||||
<string name="empty_chat">Di cosa parliamo?</string>
|
||||
<string name="loading_line">I lembas stanno cuocendo…</string>
|
||||
<string name="archive">Archivia</string>
|
||||
@@ -35,16 +40,79 @@
|
||||
<string name="send">Invia</string>
|
||||
<string name="stop">Ferma</string>
|
||||
<string name="attach">Allega un file</string>
|
||||
<string name="attach_take_photo">Scatta una foto</string>
|
||||
<string name="attach_choose_photos">Scegli foto</string>
|
||||
<string name="attach_choose_files">Scegli file</string>
|
||||
<string name="copy_message">Copia messaggio</string>
|
||||
<string name="copied">Copiato.</string>
|
||||
<string name="rename_chat">Rinomina chat</string>
|
||||
<string name="save">Salva</string>
|
||||
<string name="retry">Riprova</string>
|
||||
<string name="offline">L\'istanza non è raggiungibile. Controlla la connessione del telefono e che raggiunga l\'indirizzo dell\'istanza.</string>
|
||||
<string name="dictate">Detta</string>
|
||||
<string name="remove">Rimuovi</string>
|
||||
<string name="more">Altro</string>
|
||||
<string name="back">Indietro</string>
|
||||
<string name="cancel">Annulla</string>
|
||||
<string name="close">Chiudi</string>
|
||||
<string name="effort_off">Impegno: disattivato</string>
|
||||
<string name="mode_plan">Piano</string>
|
||||
<string name="mode_edit">Modifica</string>
|
||||
<string name="mode_manual">Manual</string>
|
||||
<string name="mode_manual">Manuale</string>
|
||||
<string name="mode_auto">Automatico</string>
|
||||
<string name="activity">Attività</string>
|
||||
<string name="activity_open">Apri il pannello attività</string>
|
||||
<string name="activity_context">Contesto</string>
|
||||
<string name="activity_outputs">Risultati</string>
|
||||
<string name="activity_tasks">Attività in background</string>
|
||||
<string name="activity_used">%1$s%% usato</string>
|
||||
<string name="activity_window_unknown">finestra sconosciuta</string>
|
||||
<string name="activity_not_measured">Non misurato.</string>
|
||||
<string name="activity_measured">Contato dal modello all’ultima risposta; le categorie sono stime.</string>
|
||||
<string name="activity_estimated">Stima: nessuna risposta è stata ancora contata.</string>
|
||||
<string name="activity_tools_offered">%1$s strumenti offerti.</string>
|
||||
<string name="ctx_messages">Messaggi</string>
|
||||
<string name="ctx_system">Prompt di sistema</string>
|
||||
<string name="ctx_memory">Memoria e dati personali</string>
|
||||
<string name="ctx_instructions">File di istruzioni</string>
|
||||
<string name="ctx_tools">Strumenti</string>
|
||||
<string name="ctx_mcp_tools">Strumenti MCP</string>
|
||||
<string name="ctx_since">Dall’ultima risposta</string>
|
||||
<string name="ctx_buffer">Riserva per la compattazione</string>
|
||||
<string name="ctx_free">Spazio libero</string>
|
||||
<string name="outputs_empty">In questa chat non è ancora stato scritto alcun file.</string>
|
||||
<string name="tasks_empty">Nulla è in esecuzione in background. Aiutanti, comandi e membri di una squadra compaiono qui mentre lavorano.</string>
|
||||
<string name="tasks_none_running">Nulla in esecuzione.</string>
|
||||
<string name="agents_one_working">1 agente al lavoro</string>
|
||||
<string name="agents_n_working">%1$s agenti al lavoro</string>
|
||||
<string name="agents_n_queued">%1$s in coda</string>
|
||||
<string name="agents_n_waiting">%1$s in attesa</string>
|
||||
<string name="agents_n_finished">%1$s terminati</string>
|
||||
<string name="agent_state_queued">in coda</string>
|
||||
<string name="agent_state_working">al lavoro</string>
|
||||
<string name="agent_state_waiting">in attesa</string>
|
||||
<string name="agent_state_done">finito</string>
|
||||
<string name="agent_state_stopped">interrotto</string>
|
||||
<string name="agent_state_error">fallito</string>
|
||||
<string name="agent_steps">%1$s passi, %2$s strumenti</string>
|
||||
<string name="agent_open_conversation">Apri la sua conversazione</string>
|
||||
<string name="agent_stop">Ferma %1$s</string>
|
||||
<string name="agent_stop_member_confirm">Fermare %1$s e i membri sotto di lui? Lasciano la squadra.</string>
|
||||
<string name="agent_stop_confirm">Fermare %1$s? Ciò che ha fatto finora resta.</string>
|
||||
<string name="agent_nothing_yet">Non ha ancora detto nulla.</string>
|
||||
<string name="agent_machine">Dal sistema</string>
|
||||
<string name="team_size">Squadra: %1$s di %2$s agenti</string>
|
||||
<string name="team_room">Stanza</string>
|
||||
<string name="room_empty">Nella stanza non è ancora stato detto nulla.</string>
|
||||
<string name="room_report">resoconto</string>
|
||||
<string name="team_agents">Agenti</string>
|
||||
<string name="team_fewest">Minimo</string>
|
||||
<string name="team_most">Massimo</string>
|
||||
<string name="team_hint">Il proprio agente compreso. Con più di uno, può aggiungere membri che fanno il lavoro mentre li guida.</string>
|
||||
<string name="team_chip">Agenti %1$s–%2$s</string>
|
||||
<string name="thinking_switch">Ragiona prima di rispondere</string>
|
||||
<string name="effort_level">Sforzo: %1$s</string>
|
||||
<string name="level_off">disattivato</string>
|
||||
<string name="level_default">predefinito</string>
|
||||
<string name="card_approval">Consentire questo?</string>
|
||||
<string name="card_allow_once">Consenti una volta</string>
|
||||
<string name="card_allow_always">Consenti sempre questo</string>
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
<string name="tab_chats">Czaty</string>
|
||||
<string name="tab_agents">Agenci</string>
|
||||
<string name="empty_chats">Nie ma jeszcze czatów. Nie każdy, kto błądzi, jest zgubiony — zacznij jeden.</string>
|
||||
<string name="empty_agents">Brak czatów agenta. Zacznij jeden z interfejsu webowego na połączonym urządzeniu.</string>
|
||||
<string name="empty_agents">Brak czatów agenta. Zacznij jeden przyciskiem Nowy czat agenta, na urządzeniu połączonym z tą instancją.</string>
|
||||
<string name="new_agent_chat">Nowy czat agenta</string>
|
||||
<string name="agent_device">Urządzenie</string>
|
||||
<string name="agent_no_device">Żadne urządzenie nie jest teraz połączone. Uruchom `lembas service` na komputerze zalogowanym do tej instancji i wróć.</string>
|
||||
<string name="agent_directory">Folder na urządzeniu</string>
|
||||
<string name="agent_directory_hint">Puste: pierwszy folder urządzenia</string>
|
||||
<string name="empty_chat">O czym porozmawiamy?</string>
|
||||
<string name="loading_line">Lembasy się pieczą…</string>
|
||||
<string name="archive">Archiwizuj</string>
|
||||
@@ -35,16 +40,79 @@
|
||||
<string name="send">Wyślij</string>
|
||||
<string name="stop">Zatrzymać</string>
|
||||
<string name="attach">Załącz plik</string>
|
||||
<string name="attach_take_photo">Zrób zdjęcie</string>
|
||||
<string name="attach_choose_photos">Wybierz zdjęcia</string>
|
||||
<string name="attach_choose_files">Wybierz pliki</string>
|
||||
<string name="copy_message">Kopiuj wiadomość</string>
|
||||
<string name="copied">Skopiowano.</string>
|
||||
<string name="rename_chat">Zmień nazwę czatu</string>
|
||||
<string name="save">Zapisz</string>
|
||||
<string name="retry">Spróbuj ponownie</string>
|
||||
<string name="offline">Instancja jest nieosiągalna. Sprawdź połączenie telefonu i czy dociera on do adresu instancji.</string>
|
||||
<string name="dictate">Dyktuj</string>
|
||||
<string name="remove">Usuń</string>
|
||||
<string name="more">Więcej</string>
|
||||
<string name="back">Wstecz</string>
|
||||
<string name="cancel">Anuluj</string>
|
||||
<string name="close">Zamknij</string>
|
||||
<string name="effort_off">Wysiłek: wyłączony</string>
|
||||
<string name="mode_plan">Plan</string>
|
||||
<string name="mode_edit">Edytuj</string>
|
||||
<string name="mode_manual">Manual</string>
|
||||
<string name="mode_manual">Ręcznie</string>
|
||||
<string name="mode_auto">Automatycznie</string>
|
||||
<string name="activity">Aktywność</string>
|
||||
<string name="activity_open">Otwórz panel aktywności</string>
|
||||
<string name="activity_context">Kontekst</string>
|
||||
<string name="activity_outputs">Wyniki</string>
|
||||
<string name="activity_tasks">Zadania w tle</string>
|
||||
<string name="activity_used">Użyto: %1$s%%</string>
|
||||
<string name="activity_window_unknown">okno nieznane</string>
|
||||
<string name="activity_not_measured">Nie zmierzono.</string>
|
||||
<string name="activity_measured">Policzone przez model przy ostatniej odpowiedzi; kategorie są szacunkowe.</string>
|
||||
<string name="activity_estimated">Szacunek: żadna odpowiedź nie została jeszcze policzona.</string>
|
||||
<string name="activity_tools_offered">Oferowane narzędzia: %1$s.</string>
|
||||
<string name="ctx_messages">Wiadomości</string>
|
||||
<string name="ctx_system">Prompt systemowy</string>
|
||||
<string name="ctx_memory">Pamięć i dane osobiste</string>
|
||||
<string name="ctx_instructions">Pliki z instrukcjami</string>
|
||||
<string name="ctx_tools">Narzędzia</string>
|
||||
<string name="ctx_mcp_tools">Narzędzia MCP</string>
|
||||
<string name="ctx_since">Od ostatniej odpowiedzi</string>
|
||||
<string name="ctx_buffer">Rezerwa na kompakcję</string>
|
||||
<string name="ctx_free">Wolne miejsce</string>
|
||||
<string name="outputs_empty">W tym czacie nie zapisano jeszcze żadnego pliku.</string>
|
||||
<string name="tasks_empty">W tle nic nie działa. Pomocnicy, polecenia i członkowie zespołu pojawiają się tu, gdy pracują.</string>
|
||||
<string name="tasks_none_running">Nic nie działa.</string>
|
||||
<string name="agents_one_working">1 agent pracuje</string>
|
||||
<string name="agents_n_working">Pracujący agenci: %1$s</string>
|
||||
<string name="agents_n_queued">W kolejce: %1$s</string>
|
||||
<string name="agents_n_waiting">Czeka: %1$s</string>
|
||||
<string name="agents_n_finished">Zakończone: %1$s</string>
|
||||
<string name="agent_state_queued">w kolejce</string>
|
||||
<string name="agent_state_working">pracuje</string>
|
||||
<string name="agent_state_waiting">czeka</string>
|
||||
<string name="agent_state_done">gotowe</string>
|
||||
<string name="agent_state_stopped">zatrzymane</string>
|
||||
<string name="agent_state_error">nie powiodło się</string>
|
||||
<string name="agent_steps">Kroki: %1$s, narzędzia: %2$s</string>
|
||||
<string name="agent_open_conversation">Otwórz jego rozmowę</string>
|
||||
<string name="agent_stop">Zatrzymaj %1$s</string>
|
||||
<string name="agent_stop_member_confirm">Zatrzymać %1$s i członków pod nim? Opuszczą zespół.</string>
|
||||
<string name="agent_stop_confirm">Zatrzymać %1$s? To, co już zrobił, zostaje.</string>
|
||||
<string name="agent_nothing_yet">Jeszcze nic nie powiedział.</string>
|
||||
<string name="agent_machine">Od systemu</string>
|
||||
<string name="team_size">Zespół: %1$s z %2$s agentów</string>
|
||||
<string name="team_room">Pokój</string>
|
||||
<string name="room_empty">W pokoju nikt jeszcze nic nie powiedział.</string>
|
||||
<string name="room_report">raport</string>
|
||||
<string name="team_agents">Agenci</string>
|
||||
<string name="team_fewest">Najmniej</string>
|
||||
<string name="team_most">Najwięcej</string>
|
||||
<string name="team_hint">Wliczając własnego agenta. Przy więcej niż jednym może dodać członków, którzy wykonują pracę, gdy on nimi kieruje.</string>
|
||||
<string name="team_chip">Agenci %1$s–%2$s</string>
|
||||
<string name="thinking_switch">Rozumuj przed odpowiedzią</string>
|
||||
<string name="effort_level">Rozumowanie: %1$s</string>
|
||||
<string name="level_off">wył.</string>
|
||||
<string name="level_default">domyślna</string>
|
||||
<string name="card_approval">Zezwolić na to?</string>
|
||||
<string name="card_allow_once">Zezwól raz</string>
|
||||
<string name="card_allow_always">Zawsze na to zezwalaj</string>
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
<string name="tab_chats">Konverzácie</string>
|
||||
<string name="tab_agents">Agenti</string>
|
||||
<string name="empty_chats">Zatiaľ žiadne konverzácie. Nie všetci, čo blúdia, sú stratení — začnite jednu.</string>
|
||||
<string name="empty_agents">Žiadne konverzácie s agentom. Spustite jednu z webového rozhrania na prepojenom zariadení.</string>
|
||||
<string name="empty_agents">Zatiaľ žiadne konverzácie s agentom. Spustite jednu tlačidlom Nová konverzácia s agentom na zariadení prepojenom s touto inštanciou.</string>
|
||||
<string name="new_agent_chat">Nová konverzácia s agentom</string>
|
||||
<string name="agent_device">Zariadenie</string>
|
||||
<string name="agent_no_device">Práve nie je prepojené žiadne zariadenie. Spustite `lembas service` na počítači prihlásenom do tejto inštancie a vráťte sa.</string>
|
||||
<string name="agent_directory">Zložka v zariadení</string>
|
||||
<string name="agent_directory_hint">Prázdne: prvá zložka zariadenia</string>
|
||||
<string name="empty_chat">O čom sa pozhovárame?</string>
|
||||
<string name="loading_line">Pečú sa lembasy…</string>
|
||||
<string name="archive">Archivovať</string>
|
||||
@@ -35,16 +40,79 @@
|
||||
<string name="send">Poslať</string>
|
||||
<string name="stop">Zastaviť</string>
|
||||
<string name="attach">Priložiť súbor</string>
|
||||
<string name="attach_take_photo">Odfotiť</string>
|
||||
<string name="attach_choose_photos">Vybrať fotky</string>
|
||||
<string name="attach_choose_files">Vybrať súbory</string>
|
||||
<string name="copy_message">Skopírovať správu</string>
|
||||
<string name="copied">Skopírované.</string>
|
||||
<string name="rename_chat">Premenovať konverzáciu</string>
|
||||
<string name="save">Uložiť</string>
|
||||
<string name="retry">Skúsiť znova</string>
|
||||
<string name="offline">Inštancia nie je dostupná. Skontrolujte pripojenie telefónu a či sa dostane na adresu inštancie.</string>
|
||||
<string name="dictate">Diktovať</string>
|
||||
<string name="remove">Odstrániť</string>
|
||||
<string name="more">Viac</string>
|
||||
<string name="back">Späť</string>
|
||||
<string name="cancel">Zrušiť</string>
|
||||
<string name="close">Zavrieť</string>
|
||||
<string name="effort_off">Úsilie: vypnuté</string>
|
||||
<string name="mode_plan">Plán</string>
|
||||
<string name="mode_edit">Upraviť</string>
|
||||
<string name="mode_manual">Manual</string>
|
||||
<string name="mode_manual">Ručne</string>
|
||||
<string name="mode_auto">Automaticky</string>
|
||||
<string name="activity">Aktivita</string>
|
||||
<string name="activity_open">Otvoriť panel aktivity</string>
|
||||
<string name="activity_context">Kontext</string>
|
||||
<string name="activity_outputs">Výstupy</string>
|
||||
<string name="activity_tasks">Úlohy na pozadí</string>
|
||||
<string name="activity_used">Využité: %1$s %%</string>
|
||||
<string name="activity_window_unknown">okno neznáme</string>
|
||||
<string name="activity_not_measured">Nezmerané.</string>
|
||||
<string name="activity_measured">Spočítal model pri poslednej odpovedi; kategórie sú odhadnuté.</string>
|
||||
<string name="activity_estimated">Odhad: žiadna odpoveď ešte nebola spočítaná.</string>
|
||||
<string name="activity_tools_offered">Ponúknuté nástroje: %1$s.</string>
|
||||
<string name="ctx_messages">Správy</string>
|
||||
<string name="ctx_system">Systémový pokyn</string>
|
||||
<string name="ctx_memory">Pamäť a osobné</string>
|
||||
<string name="ctx_instructions">Súbory s pokynmi</string>
|
||||
<string name="ctx_tools">Nástroje</string>
|
||||
<string name="ctx_mcp_tools">Nástroje MCP</string>
|
||||
<string name="ctx_since">Od poslednej odpovede</string>
|
||||
<string name="ctx_buffer">Rezerva na zhustenie</string>
|
||||
<string name="ctx_free">Voľné miesto</string>
|
||||
<string name="outputs_empty">V tomto chate sa zatiaľ nezapísal žiadny súbor.</string>
|
||||
<string name="tasks_empty">Na pozadí nič nebeží. Pomocníci, príkazy a členovia tímu sa tu zobrazia, kým pracujú.</string>
|
||||
<string name="tasks_none_running">Nič nebeží.</string>
|
||||
<string name="agents_one_working">1 agent pracuje</string>
|
||||
<string name="agents_n_working">Pracujúci agenti: %1$s</string>
|
||||
<string name="agents_n_queued">V rade: %1$s</string>
|
||||
<string name="agents_n_waiting">Čaká: %1$s</string>
|
||||
<string name="agents_n_finished">Dokončené: %1$s</string>
|
||||
<string name="agent_state_queued">v rade</string>
|
||||
<string name="agent_state_working">pracuje</string>
|
||||
<string name="agent_state_waiting">čaká</string>
|
||||
<string name="agent_state_done">hotovo</string>
|
||||
<string name="agent_state_stopped">zastavené</string>
|
||||
<string name="agent_state_error">zlyhalo</string>
|
||||
<string name="agent_steps">Kroky: %1$s, nástroje: %2$s</string>
|
||||
<string name="agent_open_conversation">Otvoriť jeho konverzáciu</string>
|
||||
<string name="agent_stop">Zastaviť %1$s</string>
|
||||
<string name="agent_stop_member_confirm">Zastaviť %1$s a členov pod ním? Opustia tím.</string>
|
||||
<string name="agent_stop_confirm">Zastaviť %1$s? Čo doteraz urobil, zostane.</string>
|
||||
<string name="agent_nothing_yet">Zatiaľ nič nepovedal.</string>
|
||||
<string name="agent_machine">Od systému</string>
|
||||
<string name="team_size">Tím: %1$s z %2$s agentov</string>
|
||||
<string name="team_room">Miestnosť</string>
|
||||
<string name="room_empty">V miestnosti zatiaľ nikto nič nepovedal.</string>
|
||||
<string name="room_report">hlásenie</string>
|
||||
<string name="team_agents">Agenti</string>
|
||||
<string name="team_fewest">Najmenej</string>
|
||||
<string name="team_most">Najviac</string>
|
||||
<string name="team_hint">Vrátane vlastného agenta. Pri viac ako jednom môže pridať členov, ktorí robia prácu, kým ich vedie.</string>
|
||||
<string name="team_chip">Agenti %1$s–%2$s</string>
|
||||
<string name="thinking_switch">Premýšľať pred odpoveďou</string>
|
||||
<string name="effort_level">Náročnosť: %1$s</string>
|
||||
<string name="level_off">vypnuté</string>
|
||||
<string name="level_default">predvolené</string>
|
||||
<string name="card_approval">Povoliť to?</string>
|
||||
<string name="card_allow_once">Povoliť raz</string>
|
||||
<string name="card_allow_always">Toto vždy povoliť</string>
|
||||
|
||||
@@ -18,7 +18,12 @@
|
||||
<string name="tab_chats">Chats</string>
|
||||
<string name="tab_agents">Agents</string>
|
||||
<string name="empty_chats">No chats yet. Not all those who wander are lost — start one.</string>
|
||||
<string name="empty_agents">No agent chats. Start one from the web interface on a linked device.</string>
|
||||
<string name="empty_agents">No agent chats yet. Start one with New agent chat, on a device linked to this instance.</string>
|
||||
<string name="new_agent_chat">New agent chat</string>
|
||||
<string name="agent_device">Device</string>
|
||||
<string name="agent_no_device">No device is linked right now. Start `lembas service` on a computer signed in to this instance, then come back.</string>
|
||||
<string name="agent_directory">Folder on the device</string>
|
||||
<string name="agent_directory_hint">Empty: the device\'s first folder</string>
|
||||
<string name="empty_chat">What shall we talk about?</string>
|
||||
<string name="loading_line">Baking lembas…</string>
|
||||
<string name="archive">Archive</string>
|
||||
@@ -36,16 +41,79 @@
|
||||
<string name="send">Send</string>
|
||||
<string name="stop">Stop</string>
|
||||
<string name="attach">Attach a file</string>
|
||||
<string name="attach_take_photo">Take a photo</string>
|
||||
<string name="attach_choose_photos">Choose photos</string>
|
||||
<string name="attach_choose_files">Choose files</string>
|
||||
<string name="copy_message">Copy message</string>
|
||||
<string name="copied">Copied.</string>
|
||||
<string name="rename_chat">Rename chat</string>
|
||||
<string name="save">Save</string>
|
||||
<string name="retry">Try again</string>
|
||||
<string name="offline">The instance cannot be reached. Check the phone\'s connection, and that it can reach the instance\'s address.</string>
|
||||
<string name="dictate">Dictate</string>
|
||||
<string name="remove">Remove</string>
|
||||
<string name="more">More</string>
|
||||
<string name="back">Back</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="close">Close</string>
|
||||
<string name="effort_off">Effort: off</string>
|
||||
<string name="mode_plan">Plan</string>
|
||||
<string name="mode_edit">Edit</string>
|
||||
<string name="mode_manual">Manual</string>
|
||||
<string name="mode_auto">Auto</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="activity_open">Open the activity panel</string>
|
||||
<string name="activity_context">Context</string>
|
||||
<string name="activity_outputs">Outputs</string>
|
||||
<string name="activity_tasks">Background tasks</string>
|
||||
<string name="activity_used">%1$s%% used</string>
|
||||
<string name="activity_window_unknown">window unknown</string>
|
||||
<string name="activity_not_measured">Not measured.</string>
|
||||
<string name="activity_measured">Counted by the model at the last reply; the categories are estimated.</string>
|
||||
<string name="activity_estimated">Estimated: no reply has been counted yet.</string>
|
||||
<string name="activity_tools_offered">%1$s tools offered.</string>
|
||||
<string name="ctx_messages">Messages</string>
|
||||
<string name="ctx_system">System prompt</string>
|
||||
<string name="ctx_memory">Memory and personal</string>
|
||||
<string name="ctx_instructions">Instruction files</string>
|
||||
<string name="ctx_tools">Tools</string>
|
||||
<string name="ctx_mcp_tools">MCP tools</string>
|
||||
<string name="ctx_since">Since the last reply</string>
|
||||
<string name="ctx_buffer">Compaction buffer</string>
|
||||
<string name="ctx_free">Free space</string>
|
||||
<string name="outputs_empty">No files written in this chat yet.</string>
|
||||
<string name="tasks_empty">Nothing runs in the background. Helpers, commands and a team\'s members show here while they work.</string>
|
||||
<string name="tasks_none_running">Nothing running.</string>
|
||||
<string name="agents_one_working">1 agent working</string>
|
||||
<string name="agents_n_working">%1$s agents working</string>
|
||||
<string name="agents_n_queued">%1$s queued</string>
|
||||
<string name="agents_n_waiting">%1$s waiting</string>
|
||||
<string name="agents_n_finished">%1$s finished</string>
|
||||
<string name="agent_state_queued">queued</string>
|
||||
<string name="agent_state_working">working</string>
|
||||
<string name="agent_state_waiting">waiting</string>
|
||||
<string name="agent_state_done">done</string>
|
||||
<string name="agent_state_stopped">stopped</string>
|
||||
<string name="agent_state_error">failed</string>
|
||||
<string name="agent_steps">%1$s steps, %2$s tools</string>
|
||||
<string name="agent_open_conversation">Open its conversation</string>
|
||||
<string name="agent_stop">Stop %1$s</string>
|
||||
<string name="agent_stop_member_confirm">Stop %1$s and the members under it? They leave the team.</string>
|
||||
<string name="agent_stop_confirm">Stop %1$s? What it has done so far stays.</string>
|
||||
<string name="agent_nothing_yet">Nothing said yet.</string>
|
||||
<string name="agent_machine">From the system</string>
|
||||
<string name="team_size">Team: %1$s of %2$s agents</string>
|
||||
<string name="team_room">Room</string>
|
||||
<string name="room_empty">Nothing has been said in the room yet.</string>
|
||||
<string name="room_report">report</string>
|
||||
<string name="team_agents">Agents</string>
|
||||
<string name="team_fewest">Fewest</string>
|
||||
<string name="team_most">Most</string>
|
||||
<string name="team_hint">Its own agent included. Above one, it can add members that do the work while it leads them.</string>
|
||||
<string name="team_chip">Agents %1$s–%2$s</string>
|
||||
<string name="thinking_switch">Think before answering</string>
|
||||
<string name="effort_level">Effort: %1$s</string>
|
||||
<string name="level_off">off</string>
|
||||
<string name="level_default">default</string>
|
||||
<string name="card_approval">Allow this?</string>
|
||||
<string name="card_allow_once">Allow once</string>
|
||||
<string name="card_allow_always">Always allow this</string>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- The one folder the app shares with another app: the cache folder a photo for the composer
|
||||
is taken into. The camera app may write the one file it was given, and nothing else. -->
|
||||
<paths>
|
||||
<cache-path name="camera" path="camera/" />
|
||||
</paths>
|
||||
@@ -0,0 +1,180 @@
|
||||
package eu.llembas.android
|
||||
|
||||
import eu.llembas.android.api.ActivityEnvelope
|
||||
import eu.llembas.android.api.ActivityFrame
|
||||
import eu.llembas.android.api.ActivityLogic
|
||||
import eu.llembas.android.api.ActivitySummary
|
||||
import eu.llembas.android.api.AgentDetail
|
||||
import eu.llembas.android.api.AgentsSetting
|
||||
import eu.llembas.android.api.ApiClient
|
||||
import eu.llembas.android.api.Chat
|
||||
import eu.llembas.android.api.ContextUse
|
||||
import eu.llembas.android.api.LembasJson
|
||||
import eu.llembas.android.api.ModelInfo
|
||||
import eu.llembas.android.api.ModelList
|
||||
import eu.llembas.android.api.TeamEnvelope
|
||||
import kotlinx.serialization.KSerializer
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* The beta.5 `/api/v2` (server dev, pinned in `contract/`): the models' levels and pictures, a
|
||||
* chat's team size, and the activity panel -- parsed with the app's models, then the panel's
|
||||
* arithmetic on what they said.
|
||||
*/
|
||||
class ActivityTest {
|
||||
private fun <T> read(name: String, serializer: KSerializer<T>): T {
|
||||
val text = requireNotNull(javaClass.classLoader!!.getResource("$name.json")) { "contract/$name.json is missing" }.readText()
|
||||
return LembasJson.decodeFromString(serializer, text)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theModelsSayTheirLevelsAndControl() {
|
||||
val (qwen, gptOss, vision) = read("models", ModelList.serializer()).models
|
||||
assertEquals(listOf("off", "medium"), qwen.offered)
|
||||
assertEquals("switch", qwen.levelControl)
|
||||
assertTrue(qwen.thinkingSwitch)
|
||||
assertEquals("medium", qwen.onLevel)
|
||||
assertEquals(2, qwen.parallel)
|
||||
assertEquals("/api/v2/models/images/0a1b2c3d4e5f.png", qwen.image)
|
||||
assertTrue(qwen.mayHaveTeam)
|
||||
|
||||
assertEquals("slider", gptOss.levelControl)
|
||||
assertEquals("high", gptOss.level(null))
|
||||
assertEquals("low", gptOss.level("low"))
|
||||
// A level the model does not offer (an `off` from before) reads as its start level.
|
||||
assertEquals("high", gptOss.level("off"))
|
||||
assertFalse(gptOss.mayHaveTeam)
|
||||
assertNull(gptOss.image)
|
||||
|
||||
assertEquals("none", vision.levelControl)
|
||||
assertEquals("default", vision.level(null))
|
||||
// No stated limit, but no tools: no team.
|
||||
assertNull(vision.parallel)
|
||||
assertFalse(vision.mayHaveTeam)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun anOlderServersModelStillGetsAControl() {
|
||||
// Before beta.5: `efforts` only. The app offered "off" before them, as it did then.
|
||||
val old = ModelInfo(id = "m", efforts = listOf("low", "high"))
|
||||
assertEquals(listOf("off", "low", "high"), old.offered)
|
||||
assertEquals("slider", old.levelControl)
|
||||
assertEquals("none", ModelInfo(id = "n").levelControl)
|
||||
assertEquals("switch", ModelInfo(id = "s", efforts = listOf("medium")).levelControl)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aPictureIsOnlyTheInstancesOwn() {
|
||||
val base = "https://example.org"
|
||||
assertEquals("https://example.org/api/v2/models/images/0a1b.png", ApiClient.modelImageUrl(base, "/api/v2/models/images/0a1b.png"))
|
||||
assertNull(ApiClient.modelImageUrl(base, null))
|
||||
assertNull(ApiClient.modelImageUrl(base, "https://elsewhere.example/x.png"))
|
||||
assertNull(ApiClient.modelImageUrl(base, "/api/v2/models/images/../../me"))
|
||||
assertNull(ApiClient.modelImageUrl(base, "/api/v2/models/images/a/b.png"))
|
||||
assertNull(ApiClient.modelImageUrl(base, "/api/v2/models/images/.hidden"))
|
||||
assertNull(ApiClient.modelImageUrl(base, "/uploads/models/x.png"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aChatSaysItsTeamSizeAndDeviceSession() {
|
||||
val chat = read("chat", Chat.serializer())
|
||||
assertEquals(AgentsSetting(1, 4), chat.agents)
|
||||
assertNull(chat.deviceSessionId)
|
||||
assertEquals("ses_01waybread", read("chat_agent", Chat.serializer()).deviceSessionId)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theActivityPanel() {
|
||||
val activity = read("activity", ActivityEnvelope.serializer()).activity
|
||||
assertEquals("0123456789abcdef", activity.version)
|
||||
assertEquals(3, activity.summary.active)
|
||||
assertTrue(activity.teamOffered)
|
||||
|
||||
val (baker, job) = activity.agents
|
||||
assertEquals("member", baker.kind)
|
||||
assertEquals("read", baker.step?.tool)
|
||||
assertTrue(baker.step!!.running)
|
||||
assertEquals(listOf("wrapper", "baker:job1"), baker.children.map { it.id })
|
||||
assertEquals("command", job.type)
|
||||
assertFalse(job.transcript)
|
||||
|
||||
// The tree, flattened in order for drawing; the split is by the top level's state.
|
||||
assertEquals(listOf("baker", "wrapper", "baker:job1", "job1"), ActivityLogic.flatten(activity.agents).map { it.id })
|
||||
val (live, ended) = ActivityLogic.split(activity.agents)
|
||||
assertEquals(2, live.size)
|
||||
assertTrue(ended.isEmpty())
|
||||
|
||||
val team = activity.team!!
|
||||
assertEquals(3, team.size)
|
||||
assertEquals(2, team.cursor)
|
||||
assertTrue(team.room[1].report)
|
||||
assertEquals(listOf("baker"), team.room[1].to)
|
||||
|
||||
val context = activity.context!!
|
||||
assertEquals(128000, context.limit)
|
||||
assertEquals(listOf("messages", "system"), ActivityLogic.barParts(context).map { it.key })
|
||||
assertEquals("/home/frodo/recipe.md", activity.outputs.single().path)
|
||||
assertEquals(42, activity.outputs.single().added)
|
||||
assertNull(ActivityLogic.plan(activity.plan))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun anAgentsConversationAndTheTeamAndTheEvent() {
|
||||
val detail = read("agent", AgentDetail.serializer())
|
||||
assertEquals("baker", detail.agent.name)
|
||||
assertEquals(listOf("user", "assistant"), detail.transcript.map { it.role })
|
||||
assertEquals("recipe.md", detail.transcript[1].tools.single().title)
|
||||
assertTrue(detail.transcript[1].running)
|
||||
|
||||
val team = read("team", TeamEnvelope.serializer()).team
|
||||
assertTrue(team.offered)
|
||||
assertEquals(listOf(0, 1, 2), team.agents.map { it.depth })
|
||||
assertNull(team.agents[0].manager)
|
||||
|
||||
val frame = read("event_activity", ActivityFrame.serializer())
|
||||
assertEquals("0123456789abcdef", frame.version)
|
||||
assertEquals(2, frame.summary.working)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theStripCountsWhatIsGoing() {
|
||||
val summary = ActivitySummary(queued = 1, working = 3, waiting = 0, done = 4, finished = 4, active = 4, total = 8)
|
||||
assertEquals(listOf("working" to 3, "queued" to 1), ActivityLogic.stripCounts(summary))
|
||||
assertTrue(ActivityLogic.stripCounts(ActivitySummary(done = 2, finished = 2)).isEmpty())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numbersAsTheServerWritesThem() {
|
||||
assertEquals("950", ActivityLogic.compactTokens(950))
|
||||
assertEquals("14.2k", ActivityLogic.compactTokens(14_200))
|
||||
assertEquals("41k", ActivityLogic.compactTokens(41_000))
|
||||
assertEquals("180k", ActivityLogic.compactTokens(180_400))
|
||||
assertEquals("1.54M", ActivityLogic.compactTokens(1_540_000))
|
||||
assertEquals("1M", ActivityLogic.compactTokens(1_000_000))
|
||||
assertEquals("5s", ActivityLogic.duration(5))
|
||||
assertEquals("1m 05s", ActivityLogic.duration(65))
|
||||
assertEquals("2h 03m", ActivityLogic.duration(7_380))
|
||||
assertEquals("32", ActivityLogic.percent(32.0))
|
||||
assertEquals("23.4", ActivityLogic.percent(23.4))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun elapsedTimeRunsOnOnlyForOneThatIsGoing() {
|
||||
val activity = read("activity", ActivityEnvelope.serializer()).activity
|
||||
val (baker, _) = activity.agents
|
||||
val wrapper = baker.children[0]
|
||||
val helper = baker.children[1]
|
||||
assertEquals(105L, ActivityLogic.elapsed(baker, readAtMillis = 1_000, nowMillis = 11_000))
|
||||
assertEquals(0L, ActivityLogic.elapsed(wrapper, readAtMillis = 1_000, nowMillis = 11_000))
|
||||
assertEquals(12L, ActivityLogic.elapsed(helper, readAtMillis = 1_000, nowMillis = 11_000))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun noWindowNoBar() {
|
||||
assertTrue(ActivityLogic.barParts(ContextUse(used = 10, limit = 0)).isEmpty())
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,24 @@
|
||||
package eu.llembas.android
|
||||
|
||||
import eu.llembas.android.api.AgentTarget
|
||||
import eu.llembas.android.api.ApiClient
|
||||
import eu.llembas.android.api.ApiException
|
||||
import eu.llembas.android.api.CardAnswer
|
||||
import eu.llembas.android.api.ShowCard
|
||||
import eu.llembas.android.api.normaliseBase
|
||||
import eu.llembas.android.ui.unreachable
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import okhttp3.mockwebserver.MockResponse
|
||||
import okhttp3.mockwebserver.MockWebServer
|
||||
import org.junit.After
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Assert.fail
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import java.net.ConnectException
|
||||
import java.net.UnknownHostException
|
||||
|
||||
class ClientTest {
|
||||
private lateinit var server: MockWebServer
|
||||
@@ -34,6 +39,35 @@ class ClientTest {
|
||||
assertEquals("http://10.1.2.3:8080", normaliseBase("http://10.1.2.3:8080"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun anAgentChatNamesItsDeviceAndFolder() = runTest {
|
||||
server.enqueue(MockResponse().setResponseCode(201).setBody("""{"chat":{"id":"c1","kind":"agent"}}"""))
|
||||
val made = client().createChat("Look around", mode = "edit", agent = AgentTarget("tok1", " ~/src/shire "))
|
||||
assertEquals("agent", made.chat.kind)
|
||||
val body = server.takeRequest().body.readUtf8()
|
||||
assertTrue(body, body.contains("\"kind\":\"agent\""))
|
||||
assertTrue(body, body.contains("\"device\":\"tok1\""))
|
||||
assertTrue(body, body.contains("\"directory\":\"~/src/shire\""))
|
||||
assertTrue(body, body.contains("\"mode\":\"edit\""))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aPlainChatSaysNothingOfDevices() = runTest {
|
||||
server.enqueue(MockResponse().setResponseCode(201).setBody("""{"chat":{"id":"c2"}}"""))
|
||||
client().createChat("Hello", effort = "low")
|
||||
val body = server.takeRequest().body.readUtf8()
|
||||
assertFalse(body, body.contains("device"))
|
||||
assertFalse(body, body.contains("kind"))
|
||||
assertTrue(body, body.contains("\"effort\":\"low\""))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun unreachableIsNotARefusal() {
|
||||
assertTrue(unreachable(UnknownHostException("llm.example.org")))
|
||||
assertTrue(unreachable(ConnectException("refused")))
|
||||
assertFalse(unreachable(ApiException(403, "No.")))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun everyCallCarriesTheToken() = runTest {
|
||||
server.enqueue(MockResponse().setBody("""{"api":1,"account":{"name":"Frodo","email":"f@shire.test"}}"""))
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,185 @@
|
||||
{
|
||||
"activity": {
|
||||
"version": "0123456789abcdef",
|
||||
"summary": {
|
||||
"queued": 1,
|
||||
"working": 2,
|
||||
"waiting": 0,
|
||||
"done": 1,
|
||||
"stopped": 0,
|
||||
"error": 0,
|
||||
"active": 3,
|
||||
"finished": 1,
|
||||
"total": 4
|
||||
},
|
||||
"agents": [
|
||||
{
|
||||
"kind": "member",
|
||||
"id": "baker",
|
||||
"type": "member",
|
||||
"name": "baker",
|
||||
"role": "owns the oven",
|
||||
"brief": "Bake the waybread.",
|
||||
"state": "working",
|
||||
"seconds": 95,
|
||||
"started": "2026-01-02T03:04:05+00:00",
|
||||
"model": "local/qwen",
|
||||
"agent": "general",
|
||||
"manager": "lead",
|
||||
"depth": 0,
|
||||
"lead": true,
|
||||
"step": {
|
||||
"tool": "read",
|
||||
"label": "Read",
|
||||
"title": "recipe.md",
|
||||
"error": false,
|
||||
"running": true
|
||||
},
|
||||
"text": "The dough needs…",
|
||||
"steps": 4,
|
||||
"tools": 3,
|
||||
"stoppable": true,
|
||||
"transcript": true,
|
||||
"children": [
|
||||
{
|
||||
"kind": "member",
|
||||
"id": "wrapper",
|
||||
"type": "member",
|
||||
"name": "wrapper",
|
||||
"role": "owns the leaves",
|
||||
"brief": "Wrap each cake.",
|
||||
"state": "queued",
|
||||
"seconds": 0,
|
||||
"started": "2026-01-02T03:04:05+00:00",
|
||||
"model": "local/qwen",
|
||||
"agent": "general",
|
||||
"manager": "baker",
|
||||
"depth": 1,
|
||||
"lead": false,
|
||||
"step": null,
|
||||
"text": "",
|
||||
"steps": 0,
|
||||
"tools": 0,
|
||||
"stoppable": true,
|
||||
"transcript": true,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"kind": "job",
|
||||
"id": "baker:job1",
|
||||
"type": "subagent",
|
||||
"name": "baker:job1",
|
||||
"role": "find mallorn leaves",
|
||||
"brief": "Where do mallorn grow?",
|
||||
"state": "done",
|
||||
"seconds": 12,
|
||||
"started": "2026-01-02T03:04:05+00:00",
|
||||
"model": "local/qwen",
|
||||
"agent": "explore",
|
||||
"manager": "baker",
|
||||
"depth": 1,
|
||||
"lead": false,
|
||||
"step": null,
|
||||
"text": "In Lothlórien.",
|
||||
"steps": 2,
|
||||
"tools": 1,
|
||||
"stoppable": false,
|
||||
"transcript": true,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "job",
|
||||
"id": "job1",
|
||||
"type": "command",
|
||||
"name": "job1",
|
||||
"role": "pytest",
|
||||
"brief": "pytest -q",
|
||||
"state": "working",
|
||||
"seconds": 30,
|
||||
"started": "2026-01-02T03:04:05+00:00",
|
||||
"model": "",
|
||||
"agent": "",
|
||||
"manager": "lead",
|
||||
"depth": 0,
|
||||
"lead": false,
|
||||
"step": null,
|
||||
"text": "",
|
||||
"steps": 0,
|
||||
"tools": 0,
|
||||
"stoppable": true,
|
||||
"transcript": false,
|
||||
"children": []
|
||||
}
|
||||
],
|
||||
"team": {
|
||||
"min": 1,
|
||||
"max": 4,
|
||||
"size": 3,
|
||||
"goal": "Bake for the journey",
|
||||
"room": [
|
||||
{
|
||||
"n": 1,
|
||||
"from": "baker",
|
||||
"to": [
|
||||
"wrapper"
|
||||
],
|
||||
"text": "Leaves by noon?",
|
||||
"report": false,
|
||||
"created": "2026-01-02T03:04:05+00:00"
|
||||
},
|
||||
{
|
||||
"n": 2,
|
||||
"from": "wrapper",
|
||||
"to": [
|
||||
"baker"
|
||||
],
|
||||
"text": "Done: *mallorn* leaves.",
|
||||
"report": true,
|
||||
"created": "2026-01-02T03:04:05+00:00"
|
||||
}
|
||||
],
|
||||
"cursor": 2
|
||||
},
|
||||
"team_offered": true,
|
||||
"context": {
|
||||
"used": 41000,
|
||||
"limit": 128000,
|
||||
"percent": 32.0,
|
||||
"measured": true,
|
||||
"threshold": 95,
|
||||
"tools_count": 24,
|
||||
"mcp_count": 2,
|
||||
"categories": [
|
||||
{
|
||||
"key": "messages",
|
||||
"tokens": 30000,
|
||||
"percent": 23.4
|
||||
},
|
||||
{
|
||||
"key": "system",
|
||||
"tokens": 4000,
|
||||
"percent": 3.1
|
||||
},
|
||||
{
|
||||
"key": "free",
|
||||
"tokens": 80600,
|
||||
"percent": 63.0
|
||||
}
|
||||
]
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"path": "/home/frodo/recipe.md",
|
||||
"name": "recipe.md",
|
||||
"writes": 2,
|
||||
"created": false,
|
||||
"added": 42,
|
||||
"removed": 6,
|
||||
"at": "2026-01-02T03:04:05+00:00"
|
||||
}
|
||||
],
|
||||
"plan": null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"agent": {
|
||||
"kind": "member",
|
||||
"id": "baker",
|
||||
"type": "member",
|
||||
"name": "baker",
|
||||
"role": "owns the oven",
|
||||
"brief": "Bake the waybread.",
|
||||
"state": "working",
|
||||
"seconds": 95,
|
||||
"started": "2026-01-02T03:04:05+00:00",
|
||||
"model": "local/qwen",
|
||||
"agent": "general",
|
||||
"manager": "lead",
|
||||
"depth": 0,
|
||||
"lead": true,
|
||||
"step": {
|
||||
"tool": "read",
|
||||
"label": "Read",
|
||||
"title": "recipe.md",
|
||||
"error": false,
|
||||
"running": true
|
||||
},
|
||||
"text": "The dough needs…",
|
||||
"steps": 4,
|
||||
"tools": 3,
|
||||
"stoppable": true,
|
||||
"transcript": true,
|
||||
"children": [
|
||||
{
|
||||
"kind": "member",
|
||||
"id": "wrapper",
|
||||
"type": "member",
|
||||
"name": "wrapper",
|
||||
"role": "owns the leaves",
|
||||
"brief": "Wrap each cake.",
|
||||
"state": "queued",
|
||||
"seconds": 0,
|
||||
"started": "2026-01-02T03:04:05+00:00",
|
||||
"model": "local/qwen",
|
||||
"agent": "general",
|
||||
"manager": "baker",
|
||||
"depth": 1,
|
||||
"lead": false,
|
||||
"step": null,
|
||||
"text": "",
|
||||
"steps": 0,
|
||||
"tools": 0,
|
||||
"stoppable": true,
|
||||
"transcript": true,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"kind": "job",
|
||||
"id": "baker:job1",
|
||||
"type": "subagent",
|
||||
"name": "baker:job1",
|
||||
"role": "find mallorn leaves",
|
||||
"brief": "Where do mallorn grow?",
|
||||
"state": "done",
|
||||
"seconds": 12,
|
||||
"started": "2026-01-02T03:04:05+00:00",
|
||||
"model": "local/qwen",
|
||||
"agent": "explore",
|
||||
"manager": "baker",
|
||||
"depth": 1,
|
||||
"lead": false,
|
||||
"step": null,
|
||||
"text": "In Lothlórien.",
|
||||
"steps": 2,
|
||||
"tools": 1,
|
||||
"stoppable": false,
|
||||
"transcript": true,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"transcript": [
|
||||
{
|
||||
"role": "user",
|
||||
"text": "Bake the waybread.",
|
||||
"machine": false
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"text": "Baking.",
|
||||
"tools": [
|
||||
{
|
||||
"name": "read",
|
||||
"title": "recipe.md",
|
||||
"isError": false
|
||||
}
|
||||
],
|
||||
"error": "",
|
||||
"running": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -12,7 +12,12 @@
|
||||
"mode": "",
|
||||
"effort": "low",
|
||||
"device": null,
|
||||
"device_session_id": null,
|
||||
"parent_chat_id": null,
|
||||
"agents": {
|
||||
"min": 1,
|
||||
"max": 4
|
||||
},
|
||||
"created_at": "2026-01-02T03:04:05+00:00",
|
||||
"updated_at": "2026-01-02T03:04:05+00:00"
|
||||
}
|
||||
@@ -15,7 +15,12 @@
|
||||
"token_id": "token1",
|
||||
"directory": "/home/dev/project"
|
||||
},
|
||||
"device_session_id": "ses_01waybread",
|
||||
"parent_chat_id": null,
|
||||
"agents": {
|
||||
"min": 1,
|
||||
"max": 4
|
||||
},
|
||||
"created_at": "2026-01-02T03:04:05+00:00",
|
||||
"updated_at": "2026-01-02T03:04:05+00:00"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"version": "0123456789abcdef",
|
||||
"summary": {
|
||||
"queued": 1,
|
||||
"working": 2,
|
||||
"waiting": 0,
|
||||
"done": 1,
|
||||
"stopped": 0,
|
||||
"error": 0,
|
||||
"active": 3,
|
||||
"finished": 1,
|
||||
"total": 4
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"ref": "v2.0.0-beta.1",
|
||||
"commit": "a3b0e660cc4de3d25d75e560afd8441d0fa37a00",
|
||||
"sha256": "56068e80b817badd0b2b80af497d8920237b7ee45c939c7f5fe72c50e865609b"
|
||||
"ref": "v2.0.0-beta.5",
|
||||
"commit": "02d0c874434e3b726193bf94fb9741b4f8d0a22c",
|
||||
"sha256": "3dccc2ca7eb5789b71506edeaeffe93acc95e05c2cc4c31eabde164546c4dea3"
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"models": [
|
||||
{
|
||||
"id": "qwen",
|
||||
"name": "Qwen",
|
||||
"vision": false,
|
||||
"tools": true,
|
||||
"efforts": [
|
||||
"medium"
|
||||
],
|
||||
"thinking_switch": true,
|
||||
"levels": [
|
||||
"off",
|
||||
"medium"
|
||||
],
|
||||
"effort": "medium",
|
||||
"control": "switch",
|
||||
"parallel": 2,
|
||||
"context": 131072,
|
||||
"image": "/api/v2/models/images/0a1b2c3d4e5f.png",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"id": "gpt-oss",
|
||||
"name": "gpt-oss",
|
||||
"vision": false,
|
||||
"tools": true,
|
||||
"efforts": [
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
],
|
||||
"thinking_switch": false,
|
||||
"levels": [
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
],
|
||||
"effort": "high",
|
||||
"control": "slider",
|
||||
"parallel": 1,
|
||||
"context": 0,
|
||||
"image": null,
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"id": "vision-small",
|
||||
"name": "Vision",
|
||||
"vision": true,
|
||||
"tools": false,
|
||||
"efforts": [],
|
||||
"thinking_switch": false,
|
||||
"levels": [
|
||||
"default"
|
||||
],
|
||||
"effort": "default",
|
||||
"control": "none",
|
||||
"parallel": null,
|
||||
"context": 8192,
|
||||
"image": null,
|
||||
"default": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"team": {
|
||||
"offered": true,
|
||||
"min": 1,
|
||||
"max": 4,
|
||||
"size": 3,
|
||||
"parallel": 2,
|
||||
"goal": "Bake for the journey",
|
||||
"agents": [
|
||||
{
|
||||
"name": "lead",
|
||||
"manager": null,
|
||||
"role": "",
|
||||
"state": "working",
|
||||
"model": "local/qwen",
|
||||
"agent": "",
|
||||
"lead": true,
|
||||
"depth": 0
|
||||
},
|
||||
{
|
||||
"name": "baker",
|
||||
"manager": "lead",
|
||||
"role": "owns the oven",
|
||||
"state": "working",
|
||||
"model": "local/qwen",
|
||||
"agent": "general",
|
||||
"lead": true,
|
||||
"depth": 1
|
||||
},
|
||||
{
|
||||
"name": "wrapper",
|
||||
"manager": "baker",
|
||||
"role": "owns the leaves",
|
||||
"state": "waiting",
|
||||
"model": "local/qwen",
|
||||
"agent": "general",
|
||||
"lead": false,
|
||||
"depth": 2
|
||||
}
|
||||
],
|
||||
"room": [
|
||||
{
|
||||
"n": 1,
|
||||
"from": "baker",
|
||||
"to": [
|
||||
"wrapper"
|
||||
],
|
||||
"text": "Leaves by noon?",
|
||||
"report": false,
|
||||
"created": "2026-01-02T03:04:05+00:00"
|
||||
},
|
||||
{
|
||||
"n": 2,
|
||||
"from": "wrapper",
|
||||
"to": [
|
||||
"baker"
|
||||
],
|
||||
"text": "Done: *mallorn* leaves.",
|
||||
"report": true,
|
||||
"created": "2026-01-02T03:04:05+00:00"
|
||||
}
|
||||
],
|
||||
"cursor": 2
|
||||
}
|
||||
}
|
||||
+28
-3
@@ -31,7 +31,7 @@ LANGS = ("cs", "de", "es", "fr", "hu", "it", "pl", "sk")
|
||||
HEADER = "<!-- Generated by scripts/gen-strings.py. Edit scripts/strings.py or strings_own.json. -->"
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
from strings import STRINGS # noqa: E402
|
||||
from strings import SERVER_ENGLISH, STRINGS # noqa: E402
|
||||
|
||||
|
||||
def android(text: str) -> str:
|
||||
@@ -60,6 +60,31 @@ def server_catalogue(code: str, ref: str | None = None) -> dict[str, str]:
|
||||
return dict(getattr(module, "MESSAGES", {}))
|
||||
|
||||
|
||||
def numbered(server_english: str, translation: str) -> str:
|
||||
"""A server translation with its named placeholders (`%(n)s`) numbered as Android's
|
||||
(`%1$s`), in the order the server's English names them. `%%` stays as it is: both write a
|
||||
percent sign that way."""
|
||||
names: list[str] = []
|
||||
for name in re.findall(r"%\((\w+)\)s", server_english):
|
||||
if name not in names:
|
||||
names.append(name)
|
||||
for i, name in enumerate(names, start=1):
|
||||
translation = translation.replace(f"%({name})s", f"%{i}$s")
|
||||
return translation
|
||||
|
||||
|
||||
def server_text(catalogue: dict[str, str], key: str, english: str) -> str | None:
|
||||
"""The server's translation of a sentence: by the app's English, or by the server's own
|
||||
English for it (`SERVER_ENGLISH`), placeholders numbered."""
|
||||
if english in catalogue:
|
||||
return catalogue[english]
|
||||
source = SERVER_ENGLISH.get(key)
|
||||
if source and source in catalogue:
|
||||
text = numbered(source, catalogue[source])
|
||||
return None if "%(" in text else text
|
||||
return None
|
||||
|
||||
|
||||
def used_keys() -> set[str]:
|
||||
keys: set[str] = set()
|
||||
for path in (ROOT / "app/src").rglob("*"):
|
||||
@@ -105,8 +130,8 @@ def main() -> None:
|
||||
for key, english in STRINGS.items():
|
||||
if key == "app_name":
|
||||
continue
|
||||
text = mine.get(key) or catalogue.get(english)
|
||||
if text and text.count("%1$s") == english.count("%1$s"):
|
||||
text = mine.get(key) or server_text(catalogue, key, english)
|
||||
if text and all(text.count(f"%{i}$s") == english.count(f"%{i}$s") for i in (1, 2, 3)):
|
||||
out[key] = text
|
||||
write(RES / f"values-{code}", out)
|
||||
print(f"gen-strings: {code}: {len(out)}/{len(STRINGS) - 1}" + (f" (server {ref[:12]})" if ref else ""))
|
||||
|
||||
+89
-2
@@ -30,7 +30,12 @@ STRINGS: dict[str, str] = {
|
||||
"tab_chats": "Chats",
|
||||
"tab_agents": "Agents",
|
||||
"empty_chats": "No chats yet. Not all those who wander are lost — start one.",
|
||||
"empty_agents": "No agent chats. Start one from the web interface on a linked device.",
|
||||
"empty_agents": "No agent chats yet. Start one with New agent chat, on a device linked to this instance.",
|
||||
"new_agent_chat": "New agent chat",
|
||||
"agent_device": "Device",
|
||||
"agent_no_device": "No device is linked right now. Start `lembas service` on a computer signed in to this instance, then come back.",
|
||||
"agent_directory": "Folder on the device",
|
||||
"agent_directory_hint": "Empty: the device's first folder",
|
||||
"empty_chat": "What shall we talk about?",
|
||||
"loading_line": "Baking lembas…",
|
||||
"archive": "Archive",
|
||||
@@ -48,16 +53,80 @@ STRINGS: dict[str, str] = {
|
||||
"send": "Send",
|
||||
"stop": "Stop",
|
||||
"attach": "Attach a file",
|
||||
"attach_take_photo": "Take a photo",
|
||||
"attach_choose_photos": "Choose photos",
|
||||
"attach_choose_files": "Choose files",
|
||||
"copy_message": "Copy message",
|
||||
"copied": "Copied.",
|
||||
"rename_chat": "Rename chat",
|
||||
"save": "Save",
|
||||
"retry": "Try again",
|
||||
"offline": "The instance cannot be reached. Check the phone's connection, and that it can reach the instance's address.",
|
||||
"dictate": "Dictate",
|
||||
"remove": "Remove",
|
||||
"more": "More",
|
||||
"back": "Back",
|
||||
"cancel": "Cancel",
|
||||
"close": "Close",
|
||||
"effort_off": "Effort: off",
|
||||
"mode_plan": "Plan",
|
||||
"mode_edit": "Edit",
|
||||
"mode_manual": "Manual",
|
||||
"mode_auto": "Auto",
|
||||
# The activity panel, the team and the level control (server 2.0 beta.5)
|
||||
"activity": "Activity",
|
||||
"activity_open": "Open the activity panel",
|
||||
"activity_context": "Context",
|
||||
"activity_outputs": "Outputs",
|
||||
"activity_tasks": "Background tasks",
|
||||
"activity_used": "%1$s%% used",
|
||||
"activity_window_unknown": "window unknown",
|
||||
"activity_not_measured": "Not measured.",
|
||||
"activity_measured": "Counted by the model at the last reply; the categories are estimated.",
|
||||
"activity_estimated": "Estimated: no reply has been counted yet.",
|
||||
"activity_tools_offered": "%1$s tools offered.",
|
||||
"ctx_messages": "Messages",
|
||||
"ctx_system": "System prompt",
|
||||
"ctx_memory": "Memory and personal",
|
||||
"ctx_instructions": "Instruction files",
|
||||
"ctx_tools": "Tools",
|
||||
"ctx_mcp_tools": "MCP tools",
|
||||
"ctx_since": "Since the last reply",
|
||||
"ctx_buffer": "Compaction buffer",
|
||||
"ctx_free": "Free space",
|
||||
"outputs_empty": "No files written in this chat yet.",
|
||||
"tasks_empty": "Nothing runs in the background. Helpers, commands and a team's members show here while they work.",
|
||||
"tasks_none_running": "Nothing running.",
|
||||
"agents_one_working": "1 agent working",
|
||||
"agents_n_working": "%1$s agents working",
|
||||
"agents_n_queued": "%1$s queued",
|
||||
"agents_n_waiting": "%1$s waiting",
|
||||
"agents_n_finished": "%1$s finished",
|
||||
"agent_state_queued": "queued",
|
||||
"agent_state_working": "working",
|
||||
"agent_state_waiting": "waiting",
|
||||
"agent_state_done": "done",
|
||||
"agent_state_stopped": "stopped",
|
||||
"agent_state_error": "failed",
|
||||
"agent_steps": "%1$s steps, %2$s tools",
|
||||
"agent_open_conversation": "Open its conversation",
|
||||
"agent_stop": "Stop %1$s",
|
||||
"agent_stop_member_confirm": "Stop %1$s and the members under it? They leave the team.",
|
||||
"agent_stop_confirm": "Stop %1$s? What it has done so far stays.",
|
||||
"agent_nothing_yet": "Nothing said yet.",
|
||||
"agent_machine": "From the system",
|
||||
"team_size": "Team: %1$s of %2$s agents",
|
||||
"team_room": "Room",
|
||||
"room_empty": "Nothing has been said in the room yet.",
|
||||
"room_report": "report",
|
||||
"team_agents": "Agents",
|
||||
"team_fewest": "Fewest",
|
||||
"team_most": "Most",
|
||||
"team_hint": "Its own agent included. Above one, it can add members that do the work while it leads them.",
|
||||
"team_chip": "Agents %1$s–%2$s",
|
||||
"thinking_switch": "Think before answering",
|
||||
"effort_level": "Effort: %1$s",
|
||||
"level_off": "off",
|
||||
"level_default": "default",
|
||||
# Cards
|
||||
"card_approval": "Allow this?",
|
||||
"card_allow_once": "Allow once",
|
||||
@@ -127,3 +196,21 @@ STRINGS: dict[str, str] = {
|
||||
"share_sending": "Sending to LLeMbas…",
|
||||
"share_default_prompt": "Have a look at this.",
|
||||
}
|
||||
|
||||
|
||||
# The server's own English for a sentence with placeholders, where it differs from the app's
|
||||
# only in how the placeholders are written (`%(n)s` there, `%1$s` here). Its translation is
|
||||
# taken from the server's catalogue and its named placeholders numbered in the order the
|
||||
# English names them -- so "%(steps)s steps, %(tools)s tools" becomes `%1$s`, `%2$s`.
|
||||
SERVER_ENGLISH: dict[str, str] = {
|
||||
"activity_used": "%(percent)s%% used",
|
||||
"activity_tools_offered": "%(n)s tools offered.",
|
||||
"agents_n_working": "%(n)s agents working",
|
||||
"agents_n_queued": "%(n)s queued",
|
||||
"agents_n_waiting": "%(n)s waiting",
|
||||
"agents_n_finished": "%(n)s finished",
|
||||
"agent_steps": "%(steps)s steps, %(tools)s tools",
|
||||
"agent_stop": "Stop %(name)s",
|
||||
"agent_stop_member_confirm": "Stop %(name)s and the members under it? They leave the team.",
|
||||
"team_size": "Team: %(size)s of %(max)s agents",
|
||||
}
|
||||
+122
-23
@@ -2,6 +2,12 @@
|
||||
"cs": {
|
||||
"about_version": "LLeMbas pro Android %1$s",
|
||||
"add_instance": "Přidat instanci",
|
||||
"agent_directory": "Složka na zařízení",
|
||||
"agent_directory_hint": "Prázdné: první složka zařízení",
|
||||
"agent_machine": "Od systému",
|
||||
"agent_no_device": "Právě není propojené žádné zařízení. Spusťte `lembas service` na počítači přihlášeném k této instanci a vraťte se.",
|
||||
"agent_nothing_yet": "Zatím nic neřekl.",
|
||||
"agent_stop_confirm": "Zastavit %1$s? Co dosud udělal, zůstane.",
|
||||
"archive": "Archivovat",
|
||||
"assist_hint": "Zeptejte se na cokoli",
|
||||
"assist_include_screen": "Zahrnout obrazovku",
|
||||
@@ -14,20 +20,25 @@
|
||||
"assistant_samsung": "Na telefonech Samsung: Nastavení › Pokročilé funkce › Boční tlačítko › Stisknutí a podržení › Digitální asistent.",
|
||||
"assistant_temporary": "Konverzace s asistentem jsou dočasné",
|
||||
"attach": "Přiložit soubor",
|
||||
"attach_choose_files": "Vybrat soubory",
|
||||
"attach_choose_photos": "Vybrat fotky",
|
||||
"attach_take_photo": "Vyfotit",
|
||||
"card_allow_once": "Povolit jednou",
|
||||
"card_answer": "Vaše odpověď",
|
||||
"card_approval": "Povolit to?",
|
||||
"card_reason": "Proč ne? (nepovinné)",
|
||||
"channel_asks": "Otázky a schválení",
|
||||
"device_name": "LLeMbas pro Android",
|
||||
"effort_off": "Úsilí: vypnuto",
|
||||
"empty_agents": "Žádné konverzace s agentem. Spusťte jednu z webového rozhraní na propojeném zařízení.",
|
||||
"effort_level": "Náročnost: %1$s",
|
||||
"empty_agents": "Zatím žádné konverzace s agentem. Spusťte jednu tlačítkem Nová konverzace s agentem na zařízení propojeném s touto instancí.",
|
||||
"empty_chat": "O čem si promluvíme?",
|
||||
"empty_chats": "Zatím žádné konverzace. Ne všichni, kdo bloudí, jsou ztraceni — založte jednu.",
|
||||
"listening": "Naslouchám…",
|
||||
"loading_line": "Pečou se lembasy…",
|
||||
"mode_manual": "Manual",
|
||||
"mode_manual": "Ručně",
|
||||
"more": "Více",
|
||||
"new_agent_chat": "Nová konverzace s agentem",
|
||||
"offline": "Instance není dostupná. Zkontrolujte připojení telefonu a to, zda se dostane na adresu instance.",
|
||||
"older": "Starší zprávy",
|
||||
"output_cut": "Výstup je zde zkrácen. Celý ho najdete na webové stránce.",
|
||||
"plan_approve": "Schválit plán",
|
||||
@@ -54,6 +65,7 @@
|
||||
"signin_open_browser": "Otevřít v prohlížeči",
|
||||
"signin_too_new": "Tato instance používá novější rozhraní API pro aplikace než tato aplikace. Aktualizujte aplikaci.",
|
||||
"signin_too_old": "Tato instance používá starší LLeMbas. Tato aplikace potřebuje LLeMbas 2.0 nebo novější.",
|
||||
"team_chip": "Agenti %1$s–%2$s",
|
||||
"theme_moria": "Moria (temná)",
|
||||
"theme_shire": "Shire (světlý)",
|
||||
"theme_system": "Podle systému",
|
||||
@@ -73,6 +85,12 @@
|
||||
"de": {
|
||||
"about_version": "LLeMbas für Android %1$s",
|
||||
"add_instance": "Instanz hinzufügen",
|
||||
"agent_directory": "Ordner auf dem Gerät",
|
||||
"agent_directory_hint": "Leer: der erste Ordner des Geräts",
|
||||
"agent_machine": "Vom System",
|
||||
"agent_no_device": "Gerade ist kein Gerät verknüpft. Starten Sie `lembas service` auf einem Computer, der bei dieser Instanz angemeldet ist, und kommen Sie dann zurück.",
|
||||
"agent_nothing_yet": "Noch nichts gesagt.",
|
||||
"agent_stop_confirm": "%1$s stoppen? Was bisher getan wurde, bleibt.",
|
||||
"archive": "Archivieren",
|
||||
"assist_hint": "Fragen Sie irgendetwas",
|
||||
"assist_include_screen": "Bildschirm einbeziehen",
|
||||
@@ -85,20 +103,26 @@
|
||||
"assistant_samsung": "Auf Samsung-Telefonen: Einstellungen › Erweiterte Funktionen › Seitentaste › Gedrückt halten › Digitaler Assistent.",
|
||||
"assistant_temporary": "Assistenten-Chats sind temporär",
|
||||
"attach": "Datei anhängen",
|
||||
"attach_choose_files": "Dateien auswählen",
|
||||
"attach_choose_photos": "Fotos auswählen",
|
||||
"attach_take_photo": "Foto aufnehmen",
|
||||
"card_allow_once": "Einmal erlauben",
|
||||
"card_answer": "Ihre Antwort",
|
||||
"card_approval": "Das erlauben?",
|
||||
"card_reason": "Warum nicht? (optional)",
|
||||
"channel_asks": "Fragen und Bestätigungen",
|
||||
"device_name": "LLeMbas für Android",
|
||||
"effort_off": "Aufwand: aus",
|
||||
"empty_agents": "Keine Agent-Chats. Starten Sie einen über die Weboberfläche auf einem verknüpften Gerät.",
|
||||
"effort_level": "Denkaufwand: %1$s",
|
||||
"empty_agents": "Noch keine Agent-Chats. Starten Sie einen mit „Neuer Agent-Chat“ auf einem Gerät, das mit dieser Instanz verknüpft ist.",
|
||||
"empty_chat": "Worüber sprechen wir?",
|
||||
"empty_chats": "Noch keine Chats. Nicht jeder, der wandert, ist verloren — fangen Sie einen an.",
|
||||
"listening": "Hört zu…",
|
||||
"loading_line": "Lembas wird gebacken…",
|
||||
"mode_manual": "Manual",
|
||||
"mode_manual": "Manuell",
|
||||
"mode_plan": "Plan",
|
||||
"more": "Mehr",
|
||||
"new_agent_chat": "Neuer Agent-Chat",
|
||||
"offline": "Die Instanz ist nicht erreichbar. Prüfen Sie die Verbindung des Telefons und ob es die Adresse der Instanz erreicht.",
|
||||
"older": "Frühere Nachrichten",
|
||||
"output_cut": "Die Ausgabe ist hier verkürzt. Vollständig finden Sie sie auf der Webseite.",
|
||||
"plan_approve": "Plan bestätigen",
|
||||
@@ -125,6 +149,7 @@
|
||||
"signin_open_browser": "Im Browser öffnen",
|
||||
"signin_too_new": "Diese Instanz spricht eine neuere App-API als diese App. Aktualisieren Sie die App.",
|
||||
"signin_too_old": "Auf dieser Instanz läuft ein älteres LLeMbas. Diese App braucht LLeMbas 2.0 oder neuer.",
|
||||
"team_chip": "Agenten %1$s–%2$s",
|
||||
"theme_moria": "Moria (dunkel)",
|
||||
"theme_shire": "Shire (hell)",
|
||||
"theme_system": "Wie das System",
|
||||
@@ -144,6 +169,12 @@
|
||||
"es": {
|
||||
"about_version": "LLeMbas para Android %1$s",
|
||||
"add_instance": "Añadir una instancia",
|
||||
"agent_directory": "Carpeta en el dispositivo",
|
||||
"agent_directory_hint": "Vacío: la primera carpeta del dispositivo",
|
||||
"agent_machine": "Del sistema",
|
||||
"agent_no_device": "Ahora no hay ningún dispositivo vinculado. Inicie `lembas service` en un ordenador con sesión iniciada en esta instancia y vuelva.",
|
||||
"agent_nothing_yet": "Todavía no ha dicho nada.",
|
||||
"agent_stop_confirm": "¿Detener %1$s? Lo que ha hecho hasta ahora se queda.",
|
||||
"archive": "Archivar",
|
||||
"assist_hint": "Pregunte lo que quiera",
|
||||
"assist_include_screen": "Incluir pantalla",
|
||||
@@ -156,20 +187,25 @@
|
||||
"assistant_samsung": "En los teléfonos Samsung: Ajustes › Funciones avanzadas › Botón lateral › Mantener pulsado › Asistente digital.",
|
||||
"assistant_temporary": "Los chats del asistente son temporales",
|
||||
"attach": "Adjuntar un archivo",
|
||||
"attach_choose_files": "Elegir archivos",
|
||||
"attach_choose_photos": "Elegir fotos",
|
||||
"attach_take_photo": "Hacer una foto",
|
||||
"card_allow_once": "Permitir una vez",
|
||||
"card_answer": "Su respuesta",
|
||||
"card_approval": "¿Permitir esto?",
|
||||
"card_reason": "¿Por qué no? (opcional)",
|
||||
"channel_asks": "Preguntas y aprobaciones",
|
||||
"device_name": "LLeMbas para Android",
|
||||
"effort_off": "Esfuerzo: desactivado",
|
||||
"empty_agents": "No hay chats de agente. Inicie uno desde la interfaz web en un dispositivo vinculado.",
|
||||
"effort_level": "Esfuerzo: %1$s",
|
||||
"empty_agents": "Aún no hay chats de agente. Inicie uno con Nuevo chat de agente, en un dispositivo vinculado a esta instancia.",
|
||||
"empty_chat": "¿De qué hablamos?",
|
||||
"empty_chats": "Aún no hay chats. No todos los que vagan están perdidos — empiece uno.",
|
||||
"listening": "Escuchando…",
|
||||
"loading_line": "Horneando lembas…",
|
||||
"mode_manual": "Manual",
|
||||
"more": "Más",
|
||||
"new_agent_chat": "Nuevo chat de agente",
|
||||
"offline": "No se puede acceder a la instancia. Compruebe la conexión del teléfono y que llegue a la dirección de la instancia.",
|
||||
"older": "Mensajes anteriores",
|
||||
"output_cut": "La salida está acortada aquí. La tiene completa en la página web.",
|
||||
"plan_approve": "Aprobar el plan",
|
||||
@@ -196,6 +232,7 @@
|
||||
"signin_open_browser": "Abrir en el navegador",
|
||||
"signin_too_new": "Esta instancia habla una API de aplicaciones más reciente que esta aplicación. Actualice la aplicación.",
|
||||
"signin_too_old": "Esta instancia usa una versión anterior de LLeMbas. Esta aplicación necesita LLeMbas 2.0 o posterior.",
|
||||
"team_chip": "Agentes %1$s–%2$s",
|
||||
"theme_moria": "Moria (oscuro)",
|
||||
"theme_shire": "Shire (claro)",
|
||||
"theme_system": "Como el sistema",
|
||||
@@ -215,6 +252,12 @@
|
||||
"fr": {
|
||||
"about_version": "LLeMbas pour Android %1$s",
|
||||
"add_instance": "Ajouter une instance",
|
||||
"agent_directory": "Dossier sur l'appareil",
|
||||
"agent_directory_hint": "Vide : le premier dossier de l'appareil",
|
||||
"agent_machine": "Du système",
|
||||
"agent_no_device": "Aucun appareil n'est associé pour l'instant. Lancez `lembas service` sur un ordinateur connecté à cette instance, puis revenez.",
|
||||
"agent_nothing_yet": "Rien de dit pour l’instant.",
|
||||
"agent_stop_confirm": "Arrêter %1$s ? Ce qu’il a déjà fait reste.",
|
||||
"archive": "Archiver",
|
||||
"assist_hint": "Demandez n'importe quoi",
|
||||
"assist_include_screen": "Inclure l'écran",
|
||||
@@ -227,20 +270,26 @@
|
||||
"assistant_samsung": "Sur les téléphones Samsung : Paramètres › Fonctions avancées › Bouton latéral › Maintenir enfoncé › Assistant numérique.",
|
||||
"assistant_temporary": "Les conversations de l'assistant sont temporaires",
|
||||
"attach": "Joindre un fichier",
|
||||
"attach_choose_files": "Choisir des fichiers",
|
||||
"attach_choose_photos": "Choisir des photos",
|
||||
"attach_take_photo": "Prendre une photo",
|
||||
"card_allow_once": "Autoriser une fois",
|
||||
"card_answer": "Votre réponse",
|
||||
"card_approval": "Autoriser ceci ?",
|
||||
"card_reason": "Pourquoi pas ? (facultatif)",
|
||||
"channel_asks": "Questions et approbations",
|
||||
"device_name": "LLeMbas pour Android",
|
||||
"effort_off": "Effort : désactivé",
|
||||
"empty_agents": "Aucune conversation d'agent. Démarrez-en une depuis l'interface web sur un appareil associé.",
|
||||
"effort_level": "Effort : %1$s",
|
||||
"empty_agents": "Pas encore de conversation d'agent. Démarrez-en une avec Nouvelle conversation d'agent, sur un appareil associé à cette instance.",
|
||||
"empty_chat": "De quoi allons-nous parler ?",
|
||||
"empty_chats": "Pas encore de conversation. Tous ceux qui errent ne sont pas perdus — commencez-en une.",
|
||||
"listening": "Écoute…",
|
||||
"loading_line": "Cuisson des lembas…",
|
||||
"mode_manual": "Manual",
|
||||
"mode_manual": "Manuel",
|
||||
"mode_plan": "Plan",
|
||||
"more": "Plus",
|
||||
"new_agent_chat": "Nouvelle conversation d'agent",
|
||||
"offline": "L'instance est injoignable. Vérifiez la connexion du téléphone et qu'il atteint bien l'adresse de l'instance.",
|
||||
"older": "Messages précédents",
|
||||
"output_cut": "La sortie est raccourcie ici. Vous la trouverez en entier sur la page web.",
|
||||
"plan_approve": "Approuver le plan",
|
||||
@@ -267,6 +316,7 @@
|
||||
"signin_open_browser": "Ouvrir dans le navigateur",
|
||||
"signin_too_new": "Cette instance utilise une API d'application plus récente que cette application. Mettez à jour l'application.",
|
||||
"signin_too_old": "Cette instance utilise une version plus ancienne de LLeMbas. Cette application nécessite LLeMbas 2.0 ou plus récent.",
|
||||
"team_chip": "Agents %1$s–%2$s",
|
||||
"theme_moria": "Moria (sombre)",
|
||||
"theme_shire": "Shire (clair)",
|
||||
"theme_system": "Comme le système",
|
||||
@@ -286,6 +336,12 @@
|
||||
"hu": {
|
||||
"about_version": "LLeMbas Androidra %1$s",
|
||||
"add_instance": "Példány hozzáadása",
|
||||
"agent_directory": "Mappa az eszközön",
|
||||
"agent_directory_hint": "Üres: az eszköz első mappája",
|
||||
"agent_machine": "A rendszertől",
|
||||
"agent_no_device": "Jelenleg nincs összekapcsolt eszköz. Indítsa el a `lembas service` parancsot egy ebbe a példányba bejelentkezett számítógépen, majd térjen vissza.",
|
||||
"agent_nothing_yet": "Még nem mondott semmit.",
|
||||
"agent_stop_confirm": "Leállítja: %1$s? Amit eddig elvégzett, megmarad.",
|
||||
"archive": "Archiválás",
|
||||
"assist_hint": "Kérdezzen bármit",
|
||||
"assist_include_screen": "Képernyő hozzáadása",
|
||||
@@ -298,20 +354,26 @@
|
||||
"assistant_samsung": "Samsung telefonokon: Beállítások › Speciális funkciók › Oldalgomb › Nyomva tartás › Digitális asszisztens.",
|
||||
"assistant_temporary": "Az asszisztenses csevegések ideiglenesek",
|
||||
"attach": "Fájl csatolása",
|
||||
"attach_choose_files": "Fájlok kiválasztása",
|
||||
"attach_choose_photos": "Fényképek kiválasztása",
|
||||
"attach_take_photo": "Fénykép készítése",
|
||||
"card_allow_once": "Engedélyezés egyszer",
|
||||
"card_answer": "Az Ön válasza",
|
||||
"card_approval": "Engedélyezzük ezt?",
|
||||
"card_reason": "Miért nem? (opcionális)",
|
||||
"channel_asks": "Kérdések és jóváhagyások",
|
||||
"device_name": "LLeMbas Androidra",
|
||||
"effort_off": "Erőfeszítés: kikapcsolva",
|
||||
"empty_agents": "Nincs ügynök-csevegés. Indítson el egyet a webes felületen egy összekapcsolt eszközön.",
|
||||
"effort_level": "Erőfeszítés: %1$s",
|
||||
"empty_agents": "Még nincs ügynök-csevegés. Indítson egyet az Új ügynök-csevegés gombbal, egy ehhez a példányhoz kapcsolt eszközön.",
|
||||
"empty_chat": "Miről beszéljünk?",
|
||||
"empty_chats": "Még nincs csevegés. Nem mindenki van elveszve, aki bolyong — kezdjen el egyet.",
|
||||
"listening": "Hallgatja…",
|
||||
"loading_line": "Lembas sül…",
|
||||
"mode_manual": "Manual",
|
||||
"mode_manual": "Kézi",
|
||||
"mode_plan": "Terv",
|
||||
"more": "Továbbiak",
|
||||
"new_agent_chat": "Új ügynök-csevegés",
|
||||
"offline": "A példány nem érhető el. Ellenőrizze a telefon kapcsolatát, és hogy eléri-e a példány címét.",
|
||||
"older": "Korábbi üzenetek",
|
||||
"output_cut": "A kimenet itt lerövidítve jelenik meg. A teljes szöveg a weblapon található.",
|
||||
"plan_approve": "Terv jóváhagyása",
|
||||
@@ -338,6 +400,7 @@
|
||||
"signin_open_browser": "Megnyitás a böngészőben",
|
||||
"signin_too_new": "Ez a példány újabb alkalmazás-API-t használ, mint ez az alkalmazás. Frissítse az alkalmazást.",
|
||||
"signin_too_old": "Ezen a példányon régebbi LLeMbas fut. Ehhez az alkalmazáshoz LLeMbas 2.0 vagy újabb kell.",
|
||||
"team_chip": "Ügynökök: %1$s–%2$s",
|
||||
"theme_moria": "Moria (sötét)",
|
||||
"theme_shire": "Shire (világos)",
|
||||
"theme_system": "A rendszer szerint",
|
||||
@@ -357,6 +420,12 @@
|
||||
"it": {
|
||||
"about_version": "LLeMbas per Android %1$s",
|
||||
"add_instance": "Aggiungi un'istanza",
|
||||
"agent_directory": "Cartella sul dispositivo",
|
||||
"agent_directory_hint": "Vuoto: la prima cartella del dispositivo",
|
||||
"agent_machine": "Dal sistema",
|
||||
"agent_no_device": "Nessun dispositivo è collegato ora. Avvia `lembas service` su un computer connesso a questa istanza, poi torna qui.",
|
||||
"agent_nothing_yet": "Non ha ancora detto nulla.",
|
||||
"agent_stop_confirm": "Fermare %1$s? Ciò che ha fatto finora resta.",
|
||||
"archive": "Archivia",
|
||||
"assist_hint": "Chiedi qualsiasi cosa",
|
||||
"assist_include_screen": "Includi lo schermo",
|
||||
@@ -369,20 +438,25 @@
|
||||
"assistant_samsung": "Sui telefoni Samsung: Impostazioni › Funzioni avanzate › Tasto laterale › Pressione prolungata › Assistente digitale.",
|
||||
"assistant_temporary": "Le chat dell'assistente sono temporanee",
|
||||
"attach": "Allega un file",
|
||||
"attach_choose_files": "Scegli file",
|
||||
"attach_choose_photos": "Scegli foto",
|
||||
"attach_take_photo": "Scatta una foto",
|
||||
"card_allow_once": "Consenti una volta",
|
||||
"card_answer": "La tua risposta",
|
||||
"card_approval": "Consentire questo?",
|
||||
"card_reason": "Perché no? (facoltativo)",
|
||||
"channel_asks": "Domande e approvazioni",
|
||||
"device_name": "LLeMbas per Android",
|
||||
"effort_off": "Impegno: disattivato",
|
||||
"empty_agents": "Nessuna chat agente. Avviane una dall'interfaccia web su un dispositivo collegato.",
|
||||
"effort_level": "Sforzo: %1$s",
|
||||
"empty_agents": "Ancora nessuna chat agente. Avviane una con Nuova chat agente, su un dispositivo collegato a questa istanza.",
|
||||
"empty_chat": "Di cosa parliamo?",
|
||||
"empty_chats": "Ancora nessuna chat. Non tutti quelli che vagano sono perduti — iniziane una.",
|
||||
"listening": "In ascolto…",
|
||||
"loading_line": "I lembas stanno cuocendo…",
|
||||
"mode_manual": "Manual",
|
||||
"mode_manual": "Manuale",
|
||||
"more": "Altro",
|
||||
"new_agent_chat": "Nuova chat agente",
|
||||
"offline": "L'istanza non è raggiungibile. Controlla la connessione del telefono e che raggiunga l'indirizzo dell'istanza.",
|
||||
"older": "Messaggi precedenti",
|
||||
"output_cut": "L'output qui è abbreviato. Lo trovi per intero sulla pagina web.",
|
||||
"plan_approve": "Approva il piano",
|
||||
@@ -409,6 +483,7 @@
|
||||
"signin_open_browser": "Apri nel browser",
|
||||
"signin_too_new": "Questa istanza usa un'API per l'app più recente di questa app. Aggiorna l'app.",
|
||||
"signin_too_old": "Questa istanza usa una versione precedente di LLeMbas. Questa app richiede LLeMbas 2.0 o successivo.",
|
||||
"team_chip": "Agenti %1$s–%2$s",
|
||||
"theme_moria": "Moria (scuro)",
|
||||
"theme_shire": "Shire (chiaro)",
|
||||
"theme_system": "Come il sistema",
|
||||
@@ -428,6 +503,12 @@
|
||||
"pl": {
|
||||
"about_version": "LLeMbas na Androida %1$s",
|
||||
"add_instance": "Dodaj instancję",
|
||||
"agent_directory": "Folder na urządzeniu",
|
||||
"agent_directory_hint": "Puste: pierwszy folder urządzenia",
|
||||
"agent_machine": "Od systemu",
|
||||
"agent_no_device": "Żadne urządzenie nie jest teraz połączone. Uruchom `lembas service` na komputerze zalogowanym do tej instancji i wróć.",
|
||||
"agent_nothing_yet": "Jeszcze nic nie powiedział.",
|
||||
"agent_stop_confirm": "Zatrzymać %1$s? To, co już zrobił, zostaje.",
|
||||
"archive": "Archiwizuj",
|
||||
"assist_hint": "Zapytaj o cokolwiek",
|
||||
"assist_include_screen": "Dołącz ekran",
|
||||
@@ -440,20 +521,25 @@
|
||||
"assistant_samsung": "W telefonach Samsung: Ustawienia › Funkcje zaawansowane › Przycisk boczny › Naciśnięcie i przytrzymanie › Asystent cyfrowy.",
|
||||
"assistant_temporary": "Czaty asystenta są tymczasowe",
|
||||
"attach": "Załącz plik",
|
||||
"attach_choose_files": "Wybierz pliki",
|
||||
"attach_choose_photos": "Wybierz zdjęcia",
|
||||
"attach_take_photo": "Zrób zdjęcie",
|
||||
"card_allow_once": "Zezwól raz",
|
||||
"card_answer": "Twoja odpowiedź",
|
||||
"card_approval": "Zezwolić na to?",
|
||||
"card_reason": "Czemu nie? (opcjonalnie)",
|
||||
"channel_asks": "Pytania i zatwierdzenia",
|
||||
"device_name": "LLeMbas na Androida",
|
||||
"effort_off": "Wysiłek: wyłączony",
|
||||
"empty_agents": "Brak czatów agenta. Zacznij jeden z interfejsu webowego na połączonym urządzeniu.",
|
||||
"effort_level": "Rozumowanie: %1$s",
|
||||
"empty_agents": "Brak czatów agenta. Zacznij jeden przyciskiem Nowy czat agenta, na urządzeniu połączonym z tą instancją.",
|
||||
"empty_chat": "O czym porozmawiamy?",
|
||||
"empty_chats": "Nie ma jeszcze czatów. Nie każdy, kto błądzi, jest zgubiony — zacznij jeden.",
|
||||
"listening": "Słucham…",
|
||||
"loading_line": "Lembasy się pieczą…",
|
||||
"mode_manual": "Manual",
|
||||
"mode_manual": "Ręcznie",
|
||||
"more": "Więcej",
|
||||
"new_agent_chat": "Nowy czat agenta",
|
||||
"offline": "Instancja jest nieosiągalna. Sprawdź połączenie telefonu i czy dociera on do adresu instancji.",
|
||||
"older": "Wcześniejsze wiadomości",
|
||||
"output_cut": "Wynik jest tu skrócony. Cały znajduje się na stronie internetowej.",
|
||||
"plan_approve": "Zatwierdź plan",
|
||||
@@ -480,6 +566,7 @@
|
||||
"signin_open_browser": "Otwórz w przeglądarce",
|
||||
"signin_too_new": "Ta instancja używa nowszego API aplikacji niż ta aplikacja. Zaktualizuj aplikację.",
|
||||
"signin_too_old": "Ta instancja działa na starszym LLeMbas. Ta aplikacja wymaga LLeMbas 2.0 lub nowszego.",
|
||||
"team_chip": "Agenci %1$s–%2$s",
|
||||
"theme_moria": "Moria (ciemny)",
|
||||
"theme_shire": "Shire (jasny)",
|
||||
"theme_system": "Jak system",
|
||||
@@ -499,6 +586,12 @@
|
||||
"sk": {
|
||||
"about_version": "LLeMbas pre Android %1$s",
|
||||
"add_instance": "Pridať inštanciu",
|
||||
"agent_directory": "Zložka v zariadení",
|
||||
"agent_directory_hint": "Prázdne: prvá zložka zariadenia",
|
||||
"agent_machine": "Od systému",
|
||||
"agent_no_device": "Práve nie je prepojené žiadne zariadenie. Spustite `lembas service` na počítači prihlásenom do tejto inštancie a vráťte sa.",
|
||||
"agent_nothing_yet": "Zatiaľ nič nepovedal.",
|
||||
"agent_stop_confirm": "Zastaviť %1$s? Čo doteraz urobil, zostane.",
|
||||
"archive": "Archivovať",
|
||||
"assist_hint": "Spýtajte sa na čokoľvek",
|
||||
"assist_include_screen": "Zahrnúť obrazovku",
|
||||
@@ -511,20 +604,25 @@
|
||||
"assistant_samsung": "Na telefónoch Samsung: Nastavenia › Rozšírené funkcie › Tlačidlo na boku › Stlačenie a podržanie › Digitálny asistent.",
|
||||
"assistant_temporary": "Konverzácie s asistentom sú dočasné",
|
||||
"attach": "Priložiť súbor",
|
||||
"attach_choose_files": "Vybrať súbory",
|
||||
"attach_choose_photos": "Vybrať fotky",
|
||||
"attach_take_photo": "Odfotiť",
|
||||
"card_allow_once": "Povoliť raz",
|
||||
"card_answer": "Vaša odpoveď",
|
||||
"card_approval": "Povoliť to?",
|
||||
"card_reason": "Prečo nie? (nepovinné)",
|
||||
"channel_asks": "Otázky a schválenia",
|
||||
"device_name": "LLeMbas pre Android",
|
||||
"effort_off": "Úsilie: vypnuté",
|
||||
"empty_agents": "Žiadne konverzácie s agentom. Spustite jednu z webového rozhrania na prepojenom zariadení.",
|
||||
"effort_level": "Náročnosť: %1$s",
|
||||
"empty_agents": "Zatiaľ žiadne konverzácie s agentom. Spustite jednu tlačidlom Nová konverzácia s agentom na zariadení prepojenom s touto inštanciou.",
|
||||
"empty_chat": "O čom sa pozhovárame?",
|
||||
"empty_chats": "Zatiaľ žiadne konverzácie. Nie všetci, čo blúdia, sú stratení — začnite jednu.",
|
||||
"listening": "Počúvam…",
|
||||
"loading_line": "Pečú sa lembasy…",
|
||||
"mode_manual": "Manual",
|
||||
"mode_manual": "Ručne",
|
||||
"more": "Viac",
|
||||
"new_agent_chat": "Nová konverzácia s agentom",
|
||||
"offline": "Inštancia nie je dostupná. Skontrolujte pripojenie telefónu a či sa dostane na adresu inštancie.",
|
||||
"older": "Staršie správy",
|
||||
"output_cut": "Výstup je tu skrátený. Celý nájdete na webovej stránke.",
|
||||
"plan_approve": "Schváliť plán",
|
||||
@@ -551,6 +649,7 @@
|
||||
"signin_open_browser": "Otvoriť v prehliadači",
|
||||
"signin_too_new": "Táto inštancia používa novšie API pre aplikácie než táto aplikácia. Aktualizujte aplikáciu.",
|
||||
"signin_too_old": "Táto inštancia beží na staršom LLeMbas. Táto aplikácia potrebuje LLeMbas 2.0 alebo novší.",
|
||||
"team_chip": "Agenti %1$s–%2$s",
|
||||
"theme_moria": "Moria (tmavá)",
|
||||
"theme_shire": "Shire (svetlá)",
|
||||
"theme_system": "Podľa systému",
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"tag": "v2.0.0-beta.1",
|
||||
"commit": "a3b0e660cc4de3d25d75e560afd8441d0fa37a00",
|
||||
"sha256": "8c0359a1b8e62b7170db3d5f9630c1289a1edc91b429fe8a2fa0e41e5588c9ed"
|
||||
"tag": "v2.0.0-beta.5",
|
||||
"commit": "02d0c874434e3b726193bf94fb9741b4f8d0a22c",
|
||||
"sha256": "e2ee615f5eb84219c6875e9e38f379394708e798d45f481d76ec8c7260f0ffb4"
|
||||
}
|
||||
Reference in new issue
Block a user