Compare commits

..
15 Commits
Author SHA1 Message Date
HomerandClaude Opus 5.5 f3b78be5ab LLeMbas for Android 1.0.0-beta.2: pinned to LLeMbas 2.0.0-beta.5
Release / release (push) Canceled after 0s
CI / check (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 11:02:18 +00:00
HomerandClaude Opus 5.5 665ac44e5c Chats: the activity panel, the model's level control, team size, model pictures
CI / check (push) Canceled after 0s
The activity panel full screen (Context, Outputs, Background tasks with the
team's room, Plan), kept current from the events route, with a summary line
above the composer that opens it; an agent's conversation read-only and a
stop with confirmation. The effort control follows the model (none, a
Thinking switch, the picker); Agents fewest/most where a team is offered;
model pictures in the picker and the chat's title. gen-strings takes the
server's translation of a sentence with named placeholders (SERVER_ENGLISH);
all eight languages complete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:47:17 +00:00
HomerandClaude Opus 5.5 960e9e3c63 API: model levels and pictures, team size, the activity panel's routes
ModelInfo reads levels, the start level, the control, thinking_switch,
parallel and the picture (fetched with the token, only from the instance's
own /api/v2/models/images/). Chat reads agents {min, max} and
device_session_id. The activity, agent, team and stop routes, the events
route followed by StreamClient.watch, and ActivityLogic for the panel's
numbers. ActivityTest parses the new fixtures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:47:17 +00:00
HomerandClaude Opus 5.5 9c13d7766d Pin the server contract, tokens and strings to server dev 9a873e8
CI / check (push) Canceled after 0s
The beta.5 /api/v2: model levels, control, thinking switch, parallel and
picture; a chat's agents setting and device_session_id; activity, agent and
team fixtures. Strings unchanged at this ref.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:39:15 +00:00
HomerandClaude Opus 5.5 41dd3c893c Chats as a daily driver: agent chats, photos, copy, rename, offline and recovery
CI / check (push) Canceled after 0s
- New agent chat (Agents tab FAB, route new-agent): GET /devices for the devices linked now; a
  device chip, an optional folder (empty = the device's first root, the server's rule) and the
  mode (manual/edit/auto/plan) go into POST /chats as kind/device/directory/mode. No device
  linked: a sentence saying how. An open agent chat's mode is a chip too.
- Attach: Take a photo (TakePicture into a FileProvider cache file, deleted once uploaded; no
  CAMERA permission), Choose photos (PickMultipleVisualMedia), Choose files.
- Copy under every reply (its text steps) and user message; Rename chat in the menu.
- The new chat's effort is held until the first message and sent with it (EffortChip called
  PATCH, which needs a chat, so the choice was dropped).
- Follow the reply while it streams, decided when the person's own scroll comes to rest; the
  first scroll goes to the real last item (the "older" row shifted the index by one).
- ui/Errors.kt explain(): the server's sentence for a refusal, one "cannot be reached" sentence
  for UnknownHost/Connect/SocketTimeout/NoRouteToHost, used everywhere an error was shown raw.
- A failed send hands its text and attachments back to the composer. A replaced follow's
  CancellationException is no longer shown as an error. A refused stream re-reads the chat.
- The chat list reloads on resume (quietly if rows are shown) and offers Try again.
- Strings: 15 new; Rename chat, Copy message, Copied., Save, Try again, Device and Auto from the
  server's catalogue, the rest translated in strings_own.json. "Plan" was the price plan in
  de/fr/hu (Tarif/Forfait/Csomag) and "Manual" untranslated: own entries fix both.
- ClientTest: an agent chat's body, a plain chat's, and what counts as unreachable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:09:53 +00:00
HomerandClaude Opus 5.5 f4891ba402 CI: ktlint from Maven Central, hash-pinned
GitHub's release assets answered 504 twice in a row (run 42583067622, both attempts), and the
lint step failed before the build started. Maven Central's ktlint-cli-1.8.0-all.jar is the same
jar the signed GitHub binary wraps after its 776-byte shell header (sha256 369ad2b7... for
both, checked here), so CI now fetches that, with retries, and runs it with the JDK it already
set up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:09:24 +00:00
HomerandClaude Opus 5.5 a342f23ef9 CI: an installable test APK on every push; a beta tag is a pre-release
CI / check (push) Canceled after 0s
Debug builds are signed with a public test key committed as app/test-debug.keystore (standard
debug passwords, .debug application id only). A runner's own debug key is new each run, so
every test build used to need the one before it uninstalled -- and a sign-in with it. The
version name carries GITHUB_RUN_NUMBER (1.0.0-beta.1-debug.42), and the updater compares only
what is before "-debug".

ci.yml uploads llembas-android-debug-<run> with the full and fdroid debug APKs named by run and
commit, and their SHA256SUMS. release.yml passes --prerelease for a tag with a suffix: beta.1's
GitHub Release had to be marked by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:01:54 +00:00
HomerandClaude Opus 5.5 2fd692dd7b Pin the server contract, tokens and strings to LLeMbas v2.0.0-beta.4
The server's dev is the beta.4 tag (7969067). Its /api/v2 fixtures are byte-for-byte those of
beta.1 (only the lock's ref and commit move); tokens.css changes nothing but the header; the
catalogues moved, and the 107 strings regenerate unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:01:06 +00:00
HomerandClaude Opus 5.5 3afe01ce52 LLeMbas for Android 1.0.0-beta.1: pinned to LLeMbas 2.0.0-beta.1
CI / check (push) Canceled after 0s
Release / release (push) Canceled after 0s
versionCode is beta-aware: a beta sorts below its release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:13:01 +00:00
HomerandClaude Opus 5.5 9abff4f170 Files: the person's tree, read-only, opened in the file viewer
CI / check (push) Canceled after 0s
A Files screen (the folder button beside Settings) lists GET /api/v2/files: folders and mounts
open as the next listing, back goes up one directory before it leaves, and a refusal keeps the
directory already shown with the server's sentence above it. A file opens in the existing viewer
through GET /api/v2/files/content, under the viewer's rules: Markdown through Markwon, code and
text as numbered lines, HTML as its source. A withheld file (not text, over 1 MB) says why in
the server's words and offers the web UI's /files/view.

The viewer is now one private Viewer with two doors: FileViewer(chatId, show) for a show card,
TreeFileViewer(path) for the tree. A 415 from the show route is the server's "not a text file".

Four strings, all already in the server's catalogues, so translated in all eight languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:48:10 +00:00
HomerandClaude Opus 5.5 0c5aa4d45f Pin the server contract, tokens and strings to server dev a25db24; app API 2
The contract moves from f5b3dbb to the server's dev at a25db24971a0: version.json says
{"app_api": 2}, and the server now writes its own show cards (tool_show.json: one from the tree,
one from a device) and the files routes (files_listing.json, file_content.json,
file_content_withheld.json). Tokens from the same commit change only in the header; the strings
regenerate unchanged.

- APP_API is 2, and it is now the floor as well as the ceiling: a protocol-3 server that still
  says app API 1 is a 2.0 build from before the show route and the files, and is refused as too
  old, as 1.x is.
- The files routes are modelled (FileEntry, FileListing, FileContent, Withheld) and ApiClient
  reads them: files(path), fileContent(path), and webFile(path) for the web UI's /files/view.
- shownText is documented against the server's real route, GET /api/v2/chats/{chat}/show with
  ?node=&version= or ?shown=, plain text up to 1 MB, 413 / 415 / 404; ClientTest pins the paths.
- The hand-written show cards leave ShowAndServerTest; ContractTest reads the server's.

Nothing in the app reads /api/v2/devices for its own token (devices() has no caller), so apps no
longer being listed there changes nothing here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:48:03 +00:00
HomerandClaude Opus 5.5 ac0c1c58e0 network_security_config.xml: no '--' inside an XML comment
CI / check (push) Canceled after 0s
Every XML file under app/src now parses with a strict parser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:09:16 +00:00
HomerandClaude Opus 5.5 c6438f60db colors.xml: no '--' inside an XML comment (the first build failed on it)
CI / check (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:07:12 +00:00
HomerandClaude Opus 5.5 fd1af60dbb Android 1.0 for server 2.0: the file viewer, and older servers refused
CI / check (push) Canceled after 0s
The show card. A tool call may now carry `show` (event["show"], harness spec 3.0.0): a file's
name, path, kind, line and which copy -- node and version in the chat's tree, or the copy a linked
device sent (shown_id). The transcript draws it as a card with Open; the viewer is a full-screen,
read-only dialog that fetches the text and opens at the named line. Markdown goes through the same
Markwon setup as a reply (rule 4); code, text and Markdown over 200 000 characters are numbered
lines in a lazy list, the number column measured from the file's longest number. HTML is never
rendered: no WebView exists in the app, so it is shown as source, and "Open in the browser" opens
the web UI's viewer, which renders it in its sealed frame. Copy takes the whole file.

The text comes from GET /api/v2/chats/{chat}/show?node=&version= (or ?shown=), plain text, at most
1 MB. That route is the app's half of a contract the server does not have yet: /api/v2 neither
publishes `show` on a tool call nor serves the file to a token. Until it does, the card does not
appear, and a viewer that meets a missing route says so and offers the browser.

Older servers are refused: the discovery document's device-link protocol must be 3 (LLeMbas 2.0),
at sign-in and, for an instance signed in to before, when the chat list opens. The protocol and
not the version string, because the server's dev still says 1.7.x before its first beta.

Also: gen-strings.py takes a server ref like the other two generators, so the strings come from
the same commit as the contract and the tokens rather than from a shared working tree; the
Reports notification channel goes (2.0 has no reports) and is deleted on first start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 04:31:07 +00:00
HomerandClaude Opus 5.5 052d0a3894 Pin the server contract and tokens to LLeMbas 2.0 (server dev f5b3dbb)
The contract moves from v1.7.0 to the server's dev at f5b3dbb965823ade: event_canvas.json is
gone (2.0 has no canvas) and the chat detail no longer carries knowledge_bases. The app modelled
neither, so no model changes; ContractTest now says the canvas fixture is absent and that a
canvas frame from an older stream is ignored.

Tokens from the same commit: only --selection is new among the colours, and it is now in the
palette and used for selected text, as on the web UI. CI also runs on pushes to dev, where 2.0
is built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 04:30:38 +00:00
66 changed files with 4842 additions and 235 deletions

No files matched your search

+20 -8
View File
@@ -2,7 +2,7 @@ name: CI
on: on:
push: push:
branches: [main] branches: [main, dev]
pull_request: pull_request:
permissions: permissions:
@@ -29,12 +29,13 @@ jobs:
distribution: temurin distribution: temurin
java-version: 17 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: | run: |
curl -sSfL -o ktlint https://github.com/pinterest/ktlint/releases/download/1.8.0/ktlint 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 "a3fd620207d5c40da6ca789b95e7f823c54e854b7fade7f613e91096a3706d75 ktlint" | sha256sum -c echo "369ad2b789f95a011f807e1fcb690ccef80bd7cd014fd139e73ae82dcc0baeab ktlint.jar" | sha256sum -c
chmod +x ktlint java -jar ktlint.jar "app/src/**/*.kt" "*.kts" "app/*.kts"
./ktlint "app/src/**/*.kt" "*.kts" "app/*.kts"
- uses: gradle/actions/wrapper-validation@v4 - uses: gradle/actions/wrapper-validation@v4
@@ -47,10 +48,21 @@ jobs:
run: ./gradlew --no-daemon lintFullDebug run: ./gradlew --no-daemon lintFullDebug
continue-on-error: true 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 - uses: actions/upload-artifact@v4
with: with:
name: llembas-android-debug name: llembas-android-debug-${{ github.run_number }}
path: app/build/outputs/apk/*/debug/*.apk path: test-builds/
if-no-files-found: error if-no-files-found: error
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
+4 -1
View File
@@ -73,4 +73,7 @@ jobs:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
run: | run: |
git tag -l --format='%(contents)' "$TAG" | sed '/-----BEGIN SSH SIGNATURE-----/,$d' > notes.md 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/*
+2
View File
@@ -8,6 +8,8 @@ local.properties
# A release key never goes in the repository (CI writes it from secrets) # A release key never goes in the repository (CI writes it from secrets)
*.jks *.jks
*.keystore *.keystore
# ...except the public test key debug builds are signed with (see app/build.gradle.kts)
!/app/test-debug.keystore
# IDEs # IDEs
.idea/ .idea/
*.iml *.iml
+103
View File
@@ -5,6 +5,109 @@ is in alpha and releases come off `main`.
## [Unreleased] ## [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.
### Added
- **The file viewer.** When the model shows a file (the `show` tool, in a chat or from a linked
device), the reply carries a card with the file's name and path; Open shows it full screen,
read-only, at the line it named. Markdown is rendered with the same limits as a reply (no
images, no HTML, links open in the browser for http, https and mailto only); code and text are
numbered lines; a long Markdown file is shown as text. **HTML is never rendered in the app**:
it is shown as its source, and "Open in the browser" opens the web viewer, which draws it in
its sealed frame. Copy takes the whole file.
- **Files**: the person's own files, read-only, from the folder button beside Settings. Browse
the tree as the web UI's explorer shows it (folders first, back goes up one), and open a file
in the same viewer as a shown one, under the same rules. A file the server does not hand over
as text -- an image, a binary, anything over 1 MB -- says why, and offers the web UI's viewer.
- **A server older than 2.0 is refused** with a sentence, at sign-in and for an instance signed
in to before: the device-link protocol must be 3 or newer, and the app API 2.
### Changed
- **The server's contract is pinned to LLeMbas 2.0** (`dev`): no canvas, chats without knowledge
bases. Theme and strings are generated from the same commit; `gen-strings.py` takes a server
ref, as the other two scripts do. Selected text uses the web UI's `--selection` tint.
- **The app reads app API 2**, the server 2.0's: a server that still says 1 (a 2.0 build from
before the show route and the files) is refused as too old, one that says 3 as too new.
- **A shown file is fetched from the server's own route**, `GET /api/v2/chats/{chat}/show`
(`?node=&version=` for a file in the tree, `?shown=` for a device's copy), and a file that is
not text says so in the server's words. The contract now carries the server's `show` cards and
the files routes, and the tests read those instead of a hand-written card.
- CI also runs on pushes to `dev`.
### Removed
- **The Reports notification channel**: LLeMbas 2.0 has no reports. The channel is deleted on
first start.
## [0.1.0] — unreleased ## [0.1.0] — unreleased
The first version: a native client for a LLeMbas instance (server 1.7.0 or newer), and the The first version: a native client for a LLeMbas instance (server 1.7.0 or newer), and the
+12 -3
View File
@@ -17,7 +17,15 @@ digital assistant -- hold the power button and ask.
Download the APK from the [latest release](https://github.com/LLeMbas/LLeMbas-Android/releases/latest) Download the APK from the [latest release](https://github.com/LLeMbas/LLeMbas-Android/releases/latest)
and check it against `SHA256SUMS`. The `full` APK updates itself from llembas.eu; the `-fdroid` and check it against `SHA256SUMS`. The `full` APK updates itself from llembas.eu; the `-fdroid`
one does not. Android 10 or newer; the instance must run LLeMbas server 1.7.0 or newer. 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 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 phone first (Settings › Security › Encryption & credentials › Install a certificate › CA
@@ -40,13 +48,14 @@ preinstalled assistant; no app from outside can use it.
Builds run on GitHub Actions (`.github/workflows/ci.yml`); locally it is the usual Builds run on GitHub Actions (`.github/workflows/ci.yml`); locally it is the usual
`./gradlew assembleFullDebug` with JDK 17 and the Android SDK. `./gradlew assembleFullDebug` with JDK 17 and the Android SDK.
Three things are generated from the server and pinned, each with a lock file CI checks: Three things are generated from the server at one ref; the first two are pinned with a lock
file CI checks, and CI checks the strings against the code:
| What | Script | From the server | | What | Script | From the server |
|---|---|---| |---|---|---|
| `ui/theme/Tokens.kt` | `scripts/fetch-tokens.py <server-ref>` | `tokens.css` | | `ui/theme/Tokens.kt` | `scripts/fetch-tokens.py <server-ref>` | `tokens.css` |
| `contract/*.json` | `scripts/fetch-contract.py <server-ref>` | `tests/fixtures/api_v2/` | | `contract/*.json` | `scripts/fetch-contract.py <server-ref>` | `tests/fixtures/api_v2/` |
| `res/values*/strings.xml` | `scripts/gen-strings.py` | the translation catalogues | | `res/values*/strings.xml` | `scripts/gen-strings.py <server-ref>` | the translation catalogues |
The icons come from the server's pixel leaf (`scripts/gen-icons.py`). The icons come from the server's pixel leaf (`scripts/gen-icons.py`).
+21 -5
View File
@@ -28,14 +28,28 @@ android {
minSdk = 29 minSdk = 29
targetSdk = 36 targetSdk = 36
// The one source of the version. versionCode is derived from it, so the two cannot // The one source of the version. versionCode is derived from it, so the two cannot
// drift: 0.1.0 -> 100, 1.2.3 -> 10203. // drift, and a beta sorts below its release: 1.0.0-beta.1 -> 1000001,
versionName = "0.1.0" // 1.0.0-beta.2 -> 1000002, 1.0.0 -> 1000099, 1.2.3 -> 1020399.
versionCode = versionName!!.split(".").map { it.toInt() }.let { (a, b, c) -> versionName = "1.0.0-beta.2"
a * 10000 + b * 100 + c 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
((a * 10000 + b * 100 + c) * 100) + pre
} }
} }
signingConfigs { 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 -> releaseKey?.let { key ->
create("release") { create("release") {
storeFile = file(key.getProperty("file")) storeFile = file(key.getProperty("file"))
@@ -55,7 +69,9 @@ android {
} }
debug { debug {
applicationIdSuffix = ".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")
} }
} }
+11
View File
@@ -123,5 +123,16 @@
<receiver <receiver
android:name=".push.CardActionReceiver" android:name=".push.CardActionReceiver"
android:exported="false" /> 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> </application>
</manifest> </manifest>
@@ -18,15 +18,16 @@ class LembasApp : Application() {
listOf( listOf(
NotificationChannel(CHANNEL_REPLIES, getString(R.string.channel_replies), NotificationManager.IMPORTANCE_DEFAULT), NotificationChannel(CHANNEL_REPLIES, getString(R.string.channel_replies), NotificationManager.IMPORTANCE_DEFAULT),
NotificationChannel(CHANNEL_ASKS, getString(R.string.channel_asks), NotificationManager.IMPORTANCE_HIGH), NotificationChannel(CHANNEL_ASKS, getString(R.string.channel_asks), NotificationManager.IMPORTANCE_HIGH),
NotificationChannel(CHANNEL_REPORTS, getString(R.string.channel_reports), NotificationManager.IMPORTANCE_LOW),
), ),
) )
// LLeMbas 2.0 has no reports, so 0.1's channel for them goes rather than sit empty in
// the system's settings.
manager.deleteNotificationChannel("reports")
} }
companion object { companion object {
const val CHANNEL_REPLIES = "replies" const val CHANNEL_REPLIES = "replies"
const val CHANNEL_ASKS = "asks" const val CHANNEL_ASKS = "asks"
const val CHANNEL_REPORTS = "reports"
} }
} }
@@ -28,6 +28,7 @@ import eu.llembas.android.auth.Prefs
import eu.llembas.android.push.Notifications import eu.llembas.android.push.Notifications
import eu.llembas.android.ui.chat.ChatScreen import eu.llembas.android.ui.chat.ChatScreen
import eu.llembas.android.ui.chats.ChatsScreen import eu.llembas.android.ui.chats.ChatsScreen
import eu.llembas.android.ui.files.FilesScreen
import eu.llembas.android.ui.settings.SettingsScreen import eu.llembas.android.ui.settings.SettingsScreen
import eu.llembas.android.ui.signin.SignInScreen import eu.llembas.android.ui.signin.SignInScreen
import eu.llembas.android.ui.theme.LembasTheme import eu.llembas.android.ui.theme.LembasTheme
@@ -88,7 +89,9 @@ class MainActivity : ComponentActivity() {
ChatsScreen( ChatsScreen(
onOpen = { nav.navigate("chat/$it") }, onOpen = { nav.navigate("chat/$it") },
onNew = { nav.navigate("new") }, onNew = { nav.navigate("new") },
onNewAgent = { nav.navigate("new-agent") },
onSettings = { nav.navigate("settings") }, onSettings = { nav.navigate("settings") },
onFiles = { nav.navigate("files") },
) )
} }
composable("new") { composable("new") {
@@ -100,9 +103,20 @@ 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 -> composable("chat/{id}") { entry ->
ChatScreen(chatId = entry.arguments?.getString("id"), onBack = { nav.popBackStack() }) ChatScreen(chatId = entry.arguments?.getString("id"), onBack = { nav.popBackStack() })
} }
composable("files") { FilesScreen(onBack = { nav.popBackStack() }) }
composable("settings") { composable("settings") {
SettingsScreen(onBack = { nav.popBackStack() }, onAddInstance = { nav.navigate("add") }) SettingsScreen(onBack = { nav.popBackStack() }, onAddInstance = { nav.navigate("add") })
} }
@@ -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 java.util.concurrent.TimeUnit
import kotlin.coroutines.resumeWithException 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": "…"}`). */ /** A refusal from the server, in its own words (`{"detail": "…"}`). */
class ApiException(val status: Int, message: String) : IOException(message) 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 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 { internal fun detail(response: Response): String {
val text = runCatching { response.body?.string().orEmpty() }.getOrDefault("") val text = runCatching { response.body?.string().orEmpty() }.getOrDefault("")
val said = runCatching { val said = runCatching {
@@ -168,6 +176,8 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
temporary: Boolean = false, temporary: Boolean = false,
effort: String? = null, effort: String? = null,
mode: String? = null, mode: String? = null,
agent: AgentTarget? = null,
agents: AgentsSetting? = null,
): NewChat = send( ): NewChat = send(
"POST", "POST",
"/chats", "/chats",
@@ -177,7 +187,16 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
model?.let { put("model", it) } model?.let { put("model", it) }
effort?.let { put("effort", it) } effort?.let { put("effort", it) }
mode?.let { put("mode", it) } mode?.let { put("mode", it) }
agents?.let { put("agents", agentsJson(it)) }
put("temporary", temporary) 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 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 deleteChat(chatId: String) = empty(authed("$v2/chats/$chatId").delete().build())
suspend fun stop(chatId: String, messageId: String) = 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()) 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 ------------------------------------------------------------------------- // --- Attachments -------------------------------------------------------------------------
suspend fun upload(name: String, mime: String, bytes: ByteArray, chatId: String? = null): Attachment { suspend fun upload(name: String, mime: String, bytes: ByteArray, chatId: String? = null): Attachment {
val body = MultipartBody.Builder().setType(MultipartBody.FORM) val body = MultipartBody.Builder().setType(MultipartBody.FORM)
@@ -227,6 +289,62 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
} }
} }
// --- What a `show` card opens -------------------------------------------------------------
/**
* The text of a file a `show` card named, as the chat sees it now:
* `GET /api/v2/chats/{chat}/show?node=<node_id>&version=<version_id>` for a file in the tree,
* `?shown=<shown_id>` for the copy a linked device sent ([ShowCard.query]). The server rebuilds
* the chat's view and checks the path again, so a grant taken away since takes the file away
* too (404, in the server's words). `text/plain; charset=utf-8`, at most 1 MB: above it a 413,
* and a 415 for a file that is not text. Always plain text -- an HTML file is its source, and
* the app never asks for a page to render.
*/
suspend fun shownText(chatId: String, show: ShowCard): String = withContext(Dispatchers.IO) {
val url = "$v2/chats/$chatId/show".toHttpUrl().newBuilder()
.apply { show.query.forEach { (k, v) -> addQueryParameter(k, v) } }
.build()
http.newCall(authed(url.toString()).header("Accept", "text/plain").get().build()).await().use {
if (!it.isSuccessful) throw ApiException(it.code, detail(it))
val body = it.body!!
// The server shows at most 1 MB; anything much larger is not a file it meant.
if (body.contentLength() > SHOWN_MAX_BYTES) throw ApiException(413, "")
val bytes = body.source().use { source ->
source.request(SHOWN_MAX_BYTES + 1)
source.buffer.readByteArray(minOf(source.buffer.size, SHOWN_MAX_BYTES + 1))
}
if (bytes.size > SHOWN_MAX_BYTES) throw ApiException(413, "")
bytes.toString(Charsets.UTF_8)
}
}
// --- The person's files ------------------------------------------------------------------
/** A directory, as the person may see it (no chat's grants): `GET /api/v2/files?path=`. */
suspend fun files(path: String = "/"): FileListing {
val url = "$v2/files".toHttpUrl().newBuilder().addQueryParameter("path", path).build()
return call(authed(url.toString()).get().build(), FileListing.serializer())
}
/**
* A file's text: `GET /api/v2/files/content?path=`. A file the server will not hand over as
* text (not text, over 1 MB) is not an error: it comes back with `withheld` saying why.
*/
suspend fun fileContent(path: String): FileContent {
val url = "$v2/files/content".toHttpUrl().newBuilder().addQueryParameter("path", path).build()
return call(authed(url.toString()).get().build(), FileContent.serializer())
}
/** A file of the tree in the web UI's own viewer (`/files/view`), for what the app does not draw. */
fun webFile(path: String): String = "$base/files/view".toHttpUrl().newBuilder().addQueryParameter("path", path).build().toString()
/** The same file in the web UI's viewer, which renders HTML in its sealed frame. */
fun webViewer(chatId: String, show: ShowCard): String = "$base/chat/$chatId/show".toHttpUrl().newBuilder()
.apply { show.query.forEach { (k, v) -> addQueryParameter(k, v) } }
.apply { if (show.line > 0) addQueryParameter("line", show.line.toString()) }
.build()
.toString()
// --- Push -------------------------------------------------------------------------------- // --- Push --------------------------------------------------------------------------------
suspend fun pushKey(): PushKey = get("/push") suspend fun pushKey(): PushKey = get("/push")
@@ -265,6 +383,25 @@ class ApiClient(val base: String, private val token: String, val http: OkHttpCli
authed("$v2/chats/$chatId/messages/$messageId/stream").header("Accept", "text/event-stream").build() authed("$v2/chats/$chatId/messages/$messageId/stream").header("Accept", "text/event-stream").build()
companion object { companion object {
/** 1 MB, the server's own limit on a shown file, with room for a little more. */
const val SHOWN_MAX_BYTES = 1_100_000L
fun emptyBody(): RequestBody = ByteArray(0).toRequestBody(null) 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")
} }
} }
@@ -0,0 +1,31 @@
package eu.llembas.android.api
/**
* The app API this app reads: 2, the server's 2.0 (no canvas, no `knowledge_bases`, the `show`
* card and its route, and the person's files). A server with a newer one is told about, not
* guessed at; one with an older one is refused, because 1 has neither the show route nor the
* files this app opens -- a 2.0 `dev` server from before the files routes still said 1.
*/
const val APP_API = 2
/**
* The device-link protocol of LLeMbas 2.0. This app is built for 2.0 -- the file tree, the
* access levels, the `show` card -- and a 1.x server (protocol 1 or 2) is refused with a
* sentence rather than half-working. The protocol, not the version string, is the test: a
* server's `dev` branch says 1.7.x until its first beta, and the protocol is what 2.0 raised on
* purpose so that old clients can tell.
*/
const val MIN_PROTOCOL = 3
/** Whether this app can work with a server, from its discovery document. */
enum class ServerFit { FITS, NOT_LEMBAS, TOO_OLD, TOO_NEW }
fun fit(found: Discovery): ServerFit {
val protocol = maxOf(found.protocol, found.protocols.maxOrNull() ?: 0)
return when {
found.service != "lembas" -> ServerFit.NOT_LEMBAS
protocol < MIN_PROTOCOL || found.appApi < APP_API || "app" !in found.scopes -> ServerFit.TOO_OLD
found.appApi > APP_API -> ServerFit.TOO_NEW
else -> ServerFit.FITS
}
}
@@ -27,6 +27,9 @@ data class Discovery(
val version: String = "", val version: String = "",
val name: String = "", val name: String = "",
@SerialName("base_url") val baseUrl: String = "", @SerialName("base_url") val baseUrl: String = "",
/** The device link's protocol: 3 from LLeMbas 2.0 on, which is what this app needs. */
val protocol: Int = 0,
val protocols: List<Int> = emptyList(),
@SerialName("app_api") val appApi: Int = 0, @SerialName("app_api") val appApi: Int = 0,
val login: Login = Login(), val login: Login = Login(),
val scopes: List<String> = emptyList(), val scopes: List<String> = emptyList(),
@@ -78,9 +81,54 @@ data class ModelInfo(
val vision: Boolean = false, val vision: Boolean = false,
val tools: Boolean = false, val tools: Boolean = false,
val efforts: List<String> = emptyList(), 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, 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, 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 @Serializable
data class ModelList(val models: List<ModelInfo> = emptyList()) data class ModelList(val models: List<ModelInfo> = emptyList())
@@ -115,15 +163,28 @@ data class Chat(
val mode: String = "", val mode: String = "",
val effort: String? = null, val effort: String? = null,
val device: Device? = 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("parent_chat_id") val parentChatId: String? = null,
@SerialName("created_at") val createdAt: String? = null, @SerialName("created_at") val createdAt: String? = null,
@SerialName("updated_at") val updatedAt: String? = null, @SerialName("updated_at") val updatedAt: String? = null,
@SerialName("system_prompt") val systemPrompt: String? = null, @SerialName("system_prompt") val systemPrompt: String? = null,
val plan: JsonObject? = 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" 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 @Serializable
data class ChatPage(val chats: List<Chat> = emptyList(), val more: Boolean = false) data class ChatPage(val chats: List<Chat> = emptyList(), val more: Boolean = false)
@@ -191,9 +252,89 @@ data class ToolCall(
val truncated: Boolean = false, val truncated: Boolean = false,
val job: JsonElement? = null, val job: JsonElement? = null,
val children: List<ToolCall>? = null, val children: List<ToolCall>? = null,
/** The `show` tool's card: a file put in front of the person. Never its text. */
val show: ShowCard? = null,
val block: ToolBlock = ToolBlock(), val block: ToolBlock = ToolBlock(),
) )
/**
* What a `show` call put in front of the person (`event["show"]`, harness spec 3.0.0): the
* file's name and where it is, never its contents -- the viewer fetches those. A file from the
* chat's own tree names its node and version; a file a linked device sent names the copy the
* server kept (`shown_id`), with the tree's two ids empty.
*/
@Serializable
data class ShowCard(
val path: String = "",
val name: String = "",
/** `markdown`, `code`, `text` or `html`; anything else is read as `text`. */
val kind: String = "text",
val language: String = "",
val line: Int = 0,
@SerialName("node_id") val nodeId: String = "",
@SerialName("version_id") val versionId: String = "",
val sha: String = "",
val size: Long = 0,
val mime: String = "",
val source: String = "",
@SerialName("shown_id") val shownId: String = "",
) {
/** The kind the viewer draws: an unknown one is plain text, never something richer. */
val viewKind: String get() = if (kind in VIEW_KINDS) kind else "text"
/** Which file, as the server's viewer routes take it: the device's copy, or node and version. */
val query: List<Pair<String, String>>
get() = if (shownId.isNotEmpty()) listOf("shown" to shownId) else listOf("node" to nodeId, "version" to versionId)
companion object {
val VIEW_KINDS = setOf("markdown", "code", "text", "html")
}
}
// --- The person's files (`GET /files`, `GET /files/content`) ----------------------------------
/** One entry of a directory: `kind` is `file`, `dir` or `mount`. */
@Serializable
data class FileEntry(
val name: String = "",
val path: String = "",
val kind: String = "file",
val size: Long = 0,
val mime: String = "",
@SerialName("updated_at") val updatedAt: String? = null,
) {
/** A directory or a mount: something to open as a listing, not in the viewer. */
val isFolder: Boolean get() = kind == "dir" || kind == "mount"
}
/** A directory, through the person's own access. `parent` is null at `/`. */
@Serializable
data class FileListing(val path: String = "/", val parent: String? = null, val entries: List<FileEntry> = emptyList())
/** Why a file's text did not come: `reason` is `not_text` or `too_large`; `message` says it. */
@Serializable
data class Withheld(val reason: String = "", val message: String = "")
/**
* A file's text, as the explorer's viewer reads it. An HTML file is its source, never rendered;
* a file that is not text or is over 1 MB has an empty [text] and says why in [withheld].
*/
@Serializable
data class FileContent(
val path: String = "",
val name: String = "",
val size: Long = 0,
val mime: String = "",
val kind: String = "text",
val language: String = "",
val sha: String = "",
val text: String = "",
val withheld: Withheld? = null,
) {
/** The kind the viewer draws, by the `show` card's rule: anything unknown is plain text. */
val viewKind: String get() = if (kind in ShowCard.VIEW_KINDS) kind else "text"
}
@Serializable @Serializable
data class SteerNote(val id: String = "", val text: String = "") data class SteerNote(val id: String = "", val text: String = "")
@@ -346,3 +487,179 @@ data class PushPayload(
@SerialName("interaction_id") val interactionId: String? = null, @SerialName("interaction_id") val interactionId: String? = null,
val ask: 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.Flow
import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.flow
import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import okhttp3.sse.EventSource import okhttp3.sse.EventSource
import okhttp3.sse.EventSourceListener import okhttp3.sse.EventSourceListener
@@ -31,7 +32,7 @@ class StreamClient(private val api: ApiClient) {
while (true) { while (true) {
var closed = false var closed = false
var refused: ApiException? = null var refused: ApiException? = null
once(chatId, messageId).collect { result -> once(api.streamRequest(chatId, messageId)).collect { result ->
when (result) { when (result) {
is Outcome.Event -> { is Outcome.Event -> {
wait = 1_000L 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 { private sealed interface Outcome {
data class Event(val frame: Frame) : Outcome data class Event(val frame: Frame) : Outcome
data class Refused(val error: ApiException) : Outcome data class Refused(val error: ApiException) : Outcome
data object Dropped : 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( val source = EventSources.createFactory(http).newEventSource(
api.streamRequest(chatId, messageId), request,
object : EventSourceListener() { object : EventSourceListener() {
override fun onEvent(eventSource: EventSource, id: String?, type: String?, data: String) { override fun onEvent(eventSource: EventSource, id: String?, type: String?, data: String) {
trySend(Outcome.Event(Frame(type ?: "message", data))) 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.api.StreamClient
import eu.llembas.android.lembas import eu.llembas.android.lembas
import eu.llembas.android.push.Notifications import eu.llembas.android.push.Notifications
import eu.llembas.android.ui.explain
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
@@ -81,7 +82,7 @@ class AssistController(private val context: Context, private val scope: Coroutin
_state.update { it.copy(busy = false) } _state.update { it.copy(busy = false) }
if (text.isNotBlank()) ask(text, spoken = true) if (text.isNotBlank()) ask(text, spoken = true)
} catch (e: Exception) { } 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))) if (words.isNotBlank()) speaker.play(api.speech(plain(words)))
} }
} catch (e: Exception) { } catch (e: Exception) {
_state.update { it.copy(error = e.message ?: e.javaClass.simpleName) } _state.update { it.copy(error = context.explain(e)) }
} finally { } finally {
_state.update { it.copy(busy = false) } _state.update { it.copy(busy = false) }
} }
@@ -113,7 +113,6 @@ object Notifications {
) )
val channel = when (payload.kind) { val channel = when (payload.kind) {
"ask" -> LembasApp.CHANNEL_ASKS "ask" -> LembasApp.CHANNEL_ASKS
"report" -> LembasApp.CHANNEL_REPORTS
else -> LembasApp.CHANNEL_REPLIES else -> LembasApp.CHANNEL_REPLIES
} }
val builder = NotificationCompat.Builder(context, channel) val builder = NotificationCompat.Builder(context, channel)
@@ -26,6 +26,7 @@ import eu.llembas.android.MainActivity
import eu.llembas.android.R import eu.llembas.android.R
import eu.llembas.android.lembas import eu.llembas.android.lembas
import eu.llembas.android.push.Notifications import eu.llembas.android.push.Notifications
import eu.llembas.android.ui.explain
import eu.llembas.android.ui.theme.LembasTheme import eu.llembas.android.ui.theme.LembasTheme
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -103,7 +104,7 @@ class ShareActivity : ComponentActivity() {
) )
finish() finish()
} catch (e: Exception) { } 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,
)
}
}
}
}
}
}
}
}
}
@@ -28,9 +28,11 @@ import androidx.compose.material.icons.filled.Language
import androidx.compose.material.icons.filled.Psychology import androidx.compose.material.icons.filled.Psychology
import androidx.compose.material.icons.filled.Search import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.Terminal import androidx.compose.material.icons.filled.Terminal
import androidx.compose.material.icons.filled.Visibility
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
@@ -46,6 +48,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import eu.llembas.android.R import eu.llembas.android.R
import eu.llembas.android.api.Message import eu.llembas.android.api.Message
import eu.llembas.android.api.ShowCard
import eu.llembas.android.api.Step import eu.llembas.android.api.Step
import eu.llembas.android.api.ToolCall import eu.llembas.android.api.ToolCall
import eu.llembas.android.ui.MarkdownText import eu.llembas.android.ui.MarkdownText
@@ -79,15 +82,18 @@ fun UserBubble(message: Message, modifier: Modifier = Modifier) {
} }
} }
/** A reply's steps, in the order they happened: the same table of contents the web page draws. */ /**
* A reply's steps, in the order they happened: the same table of contents the web page draws.
* [onShow] opens a `show` card's file; without it (the assistant's sheet) the card only names it.
*/
@Composable @Composable
fun Steps(steps: List<Step>, modifier: Modifier = Modifier) { fun Steps(steps: List<Step>, modifier: Modifier = Modifier, onShow: ((ShowCard) -> Unit)? = null) {
Column(modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp)) { Column(modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp)) {
steps.forEach { step -> steps.forEach { step ->
when (step.kind) { when (step.kind) {
"thinking" -> Thinking(step) "thinking" -> Thinking(step)
"text" -> MarkdownText(step.markdown.orEmpty(), modifier = Modifier.fillMaxWidth()) "text" -> MarkdownText(step.markdown.orEmpty(), modifier = Modifier.fillMaxWidth())
"tools" -> step.calls.forEach { ToolCallBlock(it) } "tools" -> step.calls.forEach { ToolCallBlock(it, onShow = onShow) }
"steer" -> step.messages.forEach { Steered(it.text) } "steer" -> step.messages.forEach { Steered(it.text) }
} }
} }
@@ -140,10 +146,15 @@ private fun iconFor(kind: String): ImageVector = when (kind) {
* scroller, so a megabyte of output never becomes the page. * scroller, so a megabyte of output never becomes the page.
*/ */
@Composable @Composable
fun ToolCallBlock(call: ToolCall, depth: Int = 0) { fun ToolCallBlock(call: ToolCall, depth: Int = 0, onShow: ((ShowCard) -> Unit)? = null) {
val palette = LocalPalette.current val palette = LocalPalette.current
var open by rememberSaveable(call.id ?: call.block.title) { mutableStateOf(call.block.kind == "edit") } var open by rememberSaveable(call.id ?: call.block.title) { mutableStateOf(call.block.kind == "edit") }
val failed = call.status == "error" || !call.error.isNullOrEmpty() val failed = call.status == "error" || !call.error.isNullOrEmpty()
val shown = call.show
if (shown != null && !failed) {
ShowCardRow(shown, depth, onShow)
return
}
Column( Column(
Modifier Modifier
.fillMaxWidth() .fillMaxWidth()
@@ -192,7 +203,49 @@ fun ToolCallBlock(call: ToolCall, depth: Int = 0) {
if (call.truncated) { if (call.truncated) {
Text(stringResource(R.string.output_cut), style = MaterialTheme.typography.labelSmall, color = palette.inkFaint) Text(stringResource(R.string.output_cut), style = MaterialTheme.typography.labelSmall, color = palette.inkFaint)
} }
call.children?.forEach { ToolCallBlock(it, depth + 1) } call.children?.forEach { ToolCallBlock(it, depth + 1, onShow) }
}
}
}
}
/**
* A `show` card: the file's name and path, and Open. Nothing of its contents -- the words here
* are a path a model chose, drawn as text like everything else. The web page opens a card that
* arrives while it is open by itself, beside the conversation, when the screen is wide enough;
* a phone's screen is not, so here it waits for a tap.
*/
@Composable
private fun ShowCardRow(show: ShowCard, depth: Int, onShow: ((ShowCard) -> Unit)?) {
val palette = LocalPalette.current
Row(
Modifier
.fillMaxWidth()
.padding(start = (depth * 16).dp)
.background(palette.surfaceRaised, Rounded)
.border(1.dp, palette.border, Rounded)
.then(if (onShow != null) Modifier.clickable { onShow(show) } else Modifier)
.padding(start = 12.dp, end = 4.dp, top = 4.dp, bottom = 4.dp)
.heightIn(min = 48.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Icon(Icons.Filled.Visibility, contentDescription = stringResource(R.string.shown), modifier = Modifier.size(18.dp), tint = palette.leaf)
Spacer(Modifier.width(10.dp))
// The one part that gives: a long path shortens, the button keeps its size.
Column(Modifier.weight(1f)) {
Text(show.name.ifBlank { show.path }, style = MaterialTheme.typography.bodyMedium, maxLines = 1, overflow = TextOverflow.Ellipsis)
Text(
show.path + if (show.line > 0) ":${show.line}" else "",
fontFamily = FontFamily.Monospace,
style = MaterialTheme.typography.labelSmall,
color = palette.inkFaint,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}
if (onShow != null) {
TextButton(onClick = { onShow(show) }, modifier = Modifier.heightIn(min = 48.dp)) {
Text(stringResource(R.string.viewer_open))
} }
} }
} }
@@ -4,10 +4,16 @@ package eu.llembas.android.ui.chat
import android.Manifest import android.Manifest
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.ClipData
import android.content.ClipboardManager
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.PickVisualMediaRequest
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.scrollBy
import androidx.compose.foundation.horizontalScroll import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box 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.imePadding
import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.rememberScrollState 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.ArrowBack
import androidx.compose.material.icons.automirrored.filled.Send import androidx.compose.material.icons.automirrored.filled.Send
import androidx.compose.material.icons.filled.AttachFile 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.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.Mic
import androidx.compose.material.icons.filled.MoreVert 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.Stop
import androidx.compose.material.icons.filled.Terminal
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.AssistChip import androidx.compose.material3.AssistChip
import androidx.compose.material3.DropdownMenu import androidx.compose.material3.DropdownMenu
@@ -47,6 +61,7 @@ import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
import androidx.compose.material3.SheetValue import androidx.compose.material3.SheetValue
import androidx.compose.material3.Slider
import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text import androidx.compose.material3.Text
@@ -66,33 +81,64 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.repeatOnLifecycle
import androidx.lifecycle.viewmodel.compose.viewModel import androidx.lifecycle.viewmodel.compose.viewModel
import eu.llembas.android.R 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.Message
import eu.llembas.android.api.ModelInfo import eu.llembas.android.api.ModelInfo
import eu.llembas.android.api.ShowCard
import eu.llembas.android.assist.Recorder import eu.llembas.android.assist.Recorder
import eu.llembas.android.lembas import eu.llembas.android.lembas
import eu.llembas.android.ui.ModelAvatar
import eu.llembas.android.ui.theme.LocalPalette import eu.llembas.android.ui.theme.LocalPalette
import eu.llembas.android.ui.viewer.FileViewer
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@OptIn(ExperimentalMaterial3Api::class) @OptIn(ExperimentalMaterial3Api::class)
@Composable @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 state by model.state.collectAsStateWithLifecycle()
val palette = LocalPalette.current val palette = LocalPalette.current
val list = rememberLazyListState() val list = rememberLazyListState()
val snackbar = remember { SnackbarHostState() } val snackbar = remember { SnackbarHostState() }
var menu by remember { mutableStateOf(false) } var menu by remember { mutableStateOf(false) }
var editing by remember { mutableStateOf<Message?>(null) } 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 // 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. // rotation land on the chat rather than on an empty composer.
LaunchedEffect(state.chat?.id) { state.chat?.id?.let { if (it != chatId) onOpened(it) } } 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) { LaunchedEffect(state.error, state.notice) {
(state.error ?: state.notice)?.let { (state.error ?: state.notice)?.let {
snackbar.showSnackbar(it) snackbar.showSnackbar(it)
@@ -101,8 +147,20 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
} }
val live = state.live val live = state.live
val rows = state.messages val rows = state.messages
LaunchedEffect(rows.size, live?.shown?.size) { // To the end when the transcript grows, and while a reply is being written -- but only if
if (rows.isNotEmpty()) list.animateScrollToItem(rows.size - 1) // 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( Scaffold(
@@ -115,18 +173,30 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
} }
}, },
title = { title = {
Text( Row(verticalAlignment = Alignment.CenterVertically) {
state.chat?.title?.ifBlank { null } ?: stringResource(R.string.new_chat), state.chat?.model?.ifBlank { null }?.let { id ->
maxLines = 1, ModelAvatar(state.models.firstOrNull { it.id == id }, id, size = 28.dp, modifier = Modifier.padding(end = 10.dp))
overflow = TextOverflow.Ellipsis, }
) 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 = { actions = {
if (state.chat != null) { if (state.chat != null) {
IconButton(onClick = { activityOpen = true }) {
Icon(Icons.Filled.Bolt, contentDescription = stringResource(R.string.activity_open))
}
IconButton(onClick = { menu = true }) { IconButton(onClick = { menu = true }) {
Icon(Icons.Filled.MoreVert, contentDescription = stringResource(R.string.more)) Icon(Icons.Filled.MoreVert, contentDescription = stringResource(R.string.more))
} }
DropdownMenu(expanded = menu, onDismissRequest = { menu = false }) { 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 = { DropdownMenuItem(text = { Text(stringResource(R.string.continue_reply)) }, onClick = {
menu = false menu = false
model.continueChat() model.continueChat()
@@ -160,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)) { Row(Modifier.horizontalScroll(rememberScrollState()).padding(horizontal = 12.dp), horizontalArrangement = Arrangement.spacedBy(6.dp)) {
live.jobs.forEach { job -> live.jobs.forEach { job ->
AssistChip(onClick = {}, label = { Text("${job.id} · ${job.description.ifBlank { job.command }} · ${job.state}", maxLines = 1) }) AssistChip(onClick = {}, label = { Text("${job.id} · ${job.description.ifBlank { job.command }} · ${job.state}", maxLines = 1) })
@@ -170,7 +242,7 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
if (live != null && live.status.isNotBlank()) { if (live != null && live.status.isNotBlank()) {
Text(live.status, style = MaterialTheme.typography.labelSmall, color = palette.inkFaint, modifier = Modifier.padding(horizontal = 16.dp)) Text(live.status, style = MaterialTheme.typography.labelSmall, color = palette.inkFaint, modifier = Modifier.padding(horizontal = 16.dp))
} }
Composer(model, state) Composer(model, state, agent)
} }
}, },
) { padding -> ) { padding ->
@@ -194,24 +266,27 @@ fun ChatScreen(chatId: String?, onBack: () -> Unit, onOpened: (String) -> Unit =
when { when {
message.isUser -> Column { message.isUser -> Column {
UserBubble(message) UserBubble(message)
if (!message.machine && live == null) { Row(Modifier.align(Alignment.End), verticalAlignment = Alignment.CenterVertically) {
TextButton(onClick = { editing = message }, modifier = Modifier.align(Alignment.End)) { message.text?.takeIf { it.isNotBlank() }?.let { words -> CopyButton { copy(words) } }
Text(stringResource(R.string.edit)) if (!message.machine && live == null) {
TextButton(onClick = { editing = message }) { Text(stringResource(R.string.edit)) }
} }
} }
} }
live != null && live.messageId == message.id && live.finished == null -> Column { live != null && live.messageId == message.id && live.finished == null -> Column {
Steps(live.shown) Steps(live.shown, onShow = { showing = it })
if (live.shown.isEmpty()) Text(stringResource(R.string.loading_line), color = palette.inkFaint) if (live.shown.isEmpty()) Text(stringResource(R.string.loading_line), color = palette.inkFaint)
live.metrics?.let { m -> ReplyFoot(message.copy(metrics = m)) } live.metrics?.let { m -> ReplyFoot(message.copy(metrics = m)) }
} }
else -> Column { else -> Column {
Steps(message.steps) Steps(message.steps, onShow = { showing = it })
ReplyFoot(message) ReplyFoot(message)
if (live == null && message == rows.lastOrNull()) { val words = replyText(message)
Row { 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)) } TextButton(onClick = { model.regenerate(message) }) { Text(stringResource(R.string.regenerate)) }
} }
} }
@@ -236,6 +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 -> editing?.let { message ->
var text by remember(message.id) { mutableStateOf(message.text.orEmpty()) } var text by remember(message.id) { mutableStateOf(message.text.orEmpty()) }
AlertDialog( AlertDialog(
@@ -253,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") @SuppressLint("MissingPermission")
@Composable @Composable
private fun Composer(model: ChatViewModel, state: ChatState) { private fun Composer(model: ChatViewModel, state: ChatState, agent: Boolean) {
val context = LocalContext.current val context = LocalContext.current
val scope = rememberCoroutineScope() val scope = rememberCoroutineScope()
var text by rememberSaveable { mutableStateOf("") } var text by rememberSaveable { mutableStateOf("") }
var chosenModel by rememberSaveable { mutableStateOf<String?>(null) } 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 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 listening by remember { mutableStateOf(false) }
var photo by remember { mutableStateOf<Uri?>(null) }
val recorder = remember { Recorder(scope) } 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 -> val askMic = rememberLauncherForActivityResult(ActivityResultContracts.RequestPermission()) { granted ->
if (granted) { if (granted) {
recorder.start() recorder.start()
listening = true 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 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 val running = state.live != null && state.live.finished == null
Column(Modifier.fillMaxWidth().padding(8.dp)) { 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()) { if (state.pending.isNotEmpty()) {
Row(Modifier.horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(6.dp)) { Row(Modifier.horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(6.dp)) {
state.pending.forEach { a -> state.pending.forEach { a ->
@@ -288,28 +458,71 @@ private fun Composer(model: ChatViewModel, state: ChatState) {
} }
} }
Row(Modifier.horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(6.dp)) { 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 -> ModelChip(state.models, current) { id ->
if (chat == null) chosenModel = id else model.change("model", id) if (chat == null) chosenModel = id else model.change("model", id)
} }
val efforts = state.models.firstOrNull { it.id == current }?.efforts.orEmpty() val info = state.models.firstOrNull { it.id == current }
if (efforts.isNotEmpty()) { if (info != null) {
EffortChip(efforts, chat?.effort) { model.change("effort", it ?: "off") } // 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) { // The team's size, where a team is offered: the server's word for a chat that
FilterChip( // 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", selected = if (chat == null) planMode else chat.mode == "plan",
onClick = { onClick = {
if (chat == null) planMode = !planMode else model.change("mode", if (chat.mode == "plan") "" else "plan") if (chat == null) planMode = !planMode else model.change("mode", if (chat.mode == "plan") "" else "plan")
}, },
label = { Text(stringResource(R.string.mode_plan)) }, label = { Text(stringResource(R.string.mode_plan)) },
) )
} else {
AssistChip(onClick = {}, label = { Text(chat.mode.replaceFirstChar { it.uppercase() }) })
} }
} }
Row(verticalAlignment = Alignment.Bottom) { Row(verticalAlignment = Alignment.Bottom) {
IconButton(onClick = { pick.launch("*/*") }) { Box {
Icon(Icons.Filled.AttachFile, contentDescription = stringResource(R.string.attach)) 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( TextField(
value = text, value = text,
@@ -340,49 +553,219 @@ private fun Composer(model: ChatViewModel, state: ChatState) {
IconButton(onClick = model::stop) { Icon(Icons.Filled.Stop, contentDescription = stringResource(R.string.stop)) } IconButton(onClick = model::stop) { Icon(Icons.Filled.Stop, contentDescription = stringResource(R.string.stop)) }
} else { } else {
IconButton( IconButton(
enabled = text.isNotBlank() || state.pending.isNotEmpty(), enabled = (text.isNotBlank() || state.pending.isNotEmpty()) && !state.uploading && (!newAgent || target != null),
onClick = { 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 = "" text = ""
}, },
) { Icon(Icons.AutoMirrored.Filled.Send, contentDescription = stringResource(R.string.send)) } ) { 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 @Composable
private fun ModelChip(models: List<ModelInfo>, current: String?, onPick: (String) -> Unit) { private fun ModelChip(models: List<ModelInfo>, current: String?, onPick: (String) -> Unit) {
var open by remember { mutableStateOf(false) } var open by remember { mutableStateOf(false) }
Box { 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 }) { DropdownMenu(expanded = open, onDismissRequest = { open = false }) {
models.forEach { m -> models.forEach { m ->
DropdownMenuItem(text = { Text(m.name) }, onClick = { DropdownMenuItem(
open = false leadingIcon = { ModelAvatar(m, m.id, size = 28.dp) },
onPick(m.id) 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 @Composable
private fun EffortChip(efforts: List<String>, current: String?, onPick: (String?) -> Unit) { private fun levelName(level: String): String = when (level) {
var open by remember { mutableStateOf(false) } "off" -> stringResource(R.string.level_off)
Box { "default" -> stringResource(R.string.level_default)
AssistChip(onClick = { open = true }, label = { Text(current ?: stringResource(R.string.effort_off)) }) else -> level
DropdownMenu(expanded = open, onDismissRequest = { open = false }) { }
DropdownMenuItem(text = { Text(stringResource(R.string.effort_off)) }, onClick = {
open = false /**
onPick(null) * 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.
efforts.forEach { e -> */
DropdownMenuItem(text = { Text(e) }, onClick = { @Composable
open = false private fun LevelControl(model: ModelInfo, level: String, onPick: (String) -> Unit) {
onPick(e) 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.app.Application
import android.net.Uri import android.net.Uri
import android.os.SystemClock
import android.provider.OpenableColumns import android.provider.OpenableColumns
import androidx.core.content.FileProvider
import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.viewModelScope 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.ApiClient
import eu.llembas.android.api.ApiException import eu.llembas.android.api.ApiException
import eu.llembas.android.api.Attachment import eu.llembas.android.api.Attachment
import eu.llembas.android.api.Card import eu.llembas.android.api.Card
import eu.llembas.android.api.CardAnswer import eu.llembas.android.api.CardAnswer
import eu.llembas.android.api.Chat 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.LiveReply
import eu.llembas.android.api.Message import eu.llembas.android.api.Message
import eu.llembas.android.api.ModelInfo import eu.llembas.android.api.ModelInfo
import eu.llembas.android.api.StreamClient import eu.llembas.android.api.StreamClient
import eu.llembas.android.api.Turn import eu.llembas.android.api.Turn
import eu.llembas.android.lembas import eu.llembas.android.lembas
import eu.llembas.android.ui.explain
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
@@ -26,6 +38,7 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonPrimitive import kotlinx.serialization.json.JsonPrimitive
import java.io.File
data class ChatState( data class ChatState(
val chat: Chat? = null, val chat: Chat? = null,
@@ -33,12 +46,25 @@ data class ChatState(
val more: Boolean = false, val more: Boolean = false,
val live: LiveReply? = null, val live: LiveReply? = null,
val models: List<ModelInfo> = emptyList(), 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 pending: List<Attachment> = emptyList(),
val uploading: Boolean = false, val uploading: Boolean = false,
val loading: Boolean = false, val loading: Boolean = false,
val error: String? = null, 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. */ /** A card somebody answered elsewhere first: said once, then cleared. */
val notice: String? = null, 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.") ?: throw ApiException(401, "Not signed in.")
private fun fail(e: Throwable) { 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 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 { viewModelScope.launch {
try { try {
val client = api() 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()) val models = runCatching { client.models(chatId) }.getOrDefault(emptyList())
if (chatId == null) { 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 return@launch
} }
val detail = client.chat(chatId) 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) it.copy(chat = detail.chat, messages = detail.messages, more = detail.more, models = models, loading = false)
} }
detail.live?.let { follow(it) } 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) { } catch (e: Exception) {
fail(e) fail(e)
} }
@@ -101,8 +140,15 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
StreamClient(api()).follow(chat.id, messageId).collect { frame -> StreamClient(api()).follow(chat.id, messageId).collect { frame ->
_state.update { s -> s.copy(live = (s.live ?: LiveReply(messageId)).apply(frame.event, frame.data)) } _state.update { s -> s.copy(live = (s.live ?: LiveReply(messageId)).apply(frame.event, frame.data)) }
} }
} catch (e: CancellationException) {
throw e
} catch (e: Exception) { } catch (e: Exception) {
fail(e) 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 val ended = _state.value.live
_state.update { s -> _state.update { s ->
@@ -136,8 +182,17 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
turn.reply?.let { follow(it.id) } turn.reply?.let { follow(it.id) }
} }
fun send(text: String, model: String? = null, mode: String? = null, effort: String? = null, temporary: Boolean = false) { fun send(
val files = _state.value.pending.map { it.id } 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 if (text.isBlank() && files.isEmpty()) return
viewModelScope.launch { viewModelScope.launch {
try { try {
@@ -145,13 +200,24 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
val chat = _state.value.chat val chat = _state.value.chat
_state.update { it.copy(pending = emptyList()) } _state.update { it.copy(pending = emptyList()) }
if (chat == null) { 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)) } _state.update { it.copy(chat = made.chat, messages = listOfNotNull(made.message, made.reply)) }
made.reply?.let { follow(it.id) } made.reply?.let { follow(it.id) }
} else { } else {
took(client.sendMessage(chat.id, text, files)) took(client.sendMessage(chat.id, text, files))
} }
} catch (e: Exception) { } 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) fail(e)
} }
} }
@@ -198,6 +264,84 @@ class ChatViewModel(app: Application) : AndroidViewModel(app) {
fun change(key: String, value: String?) = control { api, chat -> fun change(key: String, value: String?) = control { api, chat ->
val updated = api.updateChat(chat.id, JsonObject(mapOf(key to JsonPrimitive(value)))) val updated = api.updateChat(chat.id, JsonObject(mapOf(key to JsonPrimitive(value))))
_state.update { it.copy(chat = updated) } _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 -> 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 mime = resolver.getType(uri) ?: "application/octet-stream"
val stored = api().upload(name, mime, bytes, _state.value.chat?.id) val stored = api().upload(name, mime, bytes, _state.value.chat?.id)
_state.update { it.copy(pending = it.pending + stored) } _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) { } catch (e: Exception) {
fail(e) 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) { fun unattach(attachment: Attachment) {
_state.update { s -> s.copy(pending = s.pending.filterNot { it.id == attachment.id }) } _state.update { s -> s.copy(pending = s.pending.filterNot { it.id == attachment.id }) }
} }
@@ -18,6 +18,7 @@ import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.Chat import androidx.compose.material.icons.automirrored.filled.Chat
import androidx.compose.material.icons.filled.Add import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.Folder
import androidx.compose.material.icons.filled.Settings import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.filled.Terminal import androidx.compose.material.icons.filled.Terminal
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
@@ -32,6 +33,7 @@ import androidx.compose.material3.Scaffold
import androidx.compose.material3.SwipeToDismissBox import androidx.compose.material3.SwipeToDismissBox
import androidx.compose.material3.Tab import androidx.compose.material3.Tab
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBar
import androidx.compose.material3.pulltorefresh.PullToRefreshBox import androidx.compose.material3.pulltorefresh.PullToRefreshBox
import androidx.compose.material3.rememberSwipeToDismissBoxState import androidx.compose.material3.rememberSwipeToDismissBoxState
@@ -39,6 +41,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf 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.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
@@ -48,12 +52,17 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.compose.LifecycleResumeEffect
import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import androidx.lifecycle.viewmodel.compose.viewModel import androidx.lifecycle.viewmodel.compose.viewModel
import eu.llembas.android.R import eu.llembas.android.R
import eu.llembas.android.api.Chat 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.lembas
import eu.llembas.android.ui.explain
import eu.llembas.android.ui.signin.refusal
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.update import kotlinx.coroutines.flow.update
@@ -68,16 +77,38 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
val state = _state.asStateFlow() val state = _state.asStateFlow()
private var kind = "chat" private var kind = "chat"
fun load(kind: String) { /** Why this instance is refused, once it was asked what it is; null while it fits. */
private var refused: Int? = null
private var checked = false
/**
* 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 this.kind = kind
viewModelScope.launch { 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 { try {
val api = getApplication<Application>().lembas.instances.client() ?: return@launch 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
// server, is refused here as at sign-in. Unreachable is not refused: the chat
// list's own error says that better.
if (!checked) {
runCatching { Doorstep().discover(api.base) }.onSuccess {
checked = true
refused = refusal(fit(it))
}
}
refused?.let { said ->
_state.value = ChatsState(error = getApplication<Application>().getString(said))
return@launch
}
val page = api.chats(kind = kind) val page = api.chats(kind = kind)
_state.value = ChatsState(chats = page.chats, more = page.more) _state.value = ChatsState(chats = page.chats, more = page.more)
} catch (e: Exception) { } catch (e: Exception) {
_state.update { it.copy(loading = false, error = e.message) } _state.update { it.copy(loading = false, error = getApplication<Application>().explain(e)) }
} }
} }
} }
@@ -90,7 +121,7 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
val page = api.chats(kind = kind, before = last.id) val page = api.chats(kind = kind, before = last.id)
_state.update { it.copy(chats = it.chats + page.chats, more = page.more) } _state.update { it.copy(chats = it.chats + page.chats, more = page.more) }
} catch (e: Exception) { } catch (e: Exception) {
_state.update { it.copy(error = e.message) } _state.update { it.copy(error = getApplication<Application>().explain(e)) }
} }
} }
} }
@@ -103,7 +134,7 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
getApplication<Application>().lembas.instances.client() getApplication<Application>().lembas.instances.client()
?.updateChat(chat.id, buildJsonObject { put("archived", true) }) ?.updateChat(chat.id, buildJsonObject { put("archived", true) })
}.onFailure { e -> }.onFailure { e ->
_state.update { it.copy(error = e.message) } _state.update { it.copy(error = getApplication<Application>().explain(e)) }
load(kind) load(kind)
} }
} }
@@ -112,17 +143,34 @@ class ChatsViewModel(app: Application) : AndroidViewModel(app) {
@OptIn(ExperimentalMaterial3Api::class) @OptIn(ExperimentalMaterial3Api::class)
@Composable @Composable
fun ChatsScreen(onOpen: (String) -> Unit, onNew: () -> Unit, onSettings: () -> 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() val state by model.state.collectAsStateWithLifecycle()
var tab by rememberSaveable { mutableIntStateOf(0) } var tab by rememberSaveable { mutableIntStateOf(0) }
val kind = if (tab == 0) "chat" else "agent" 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( Scaffold(
topBar = { topBar = {
TopAppBar( TopAppBar(
title = { Text(stringResource(R.string.app_name)) }, title = { Text(stringResource(R.string.app_name)) },
actions = { actions = {
IconButton(onClick = onFiles) {
Icon(Icons.Filled.Folder, contentDescription = stringResource(R.string.files))
}
IconButton(onClick = onSettings) { IconButton(onClick = onSettings) {
Icon(Icons.Filled.Settings, contentDescription = stringResource(R.string.settings)) Icon(Icons.Filled.Settings, contentDescription = stringResource(R.string.settings))
} }
@@ -130,13 +178,11 @@ fun ChatsScreen(onOpen: (String) -> Unit, onNew: () -> Unit, onSettings: () -> U
) )
}, },
floatingActionButton = { floatingActionButton = {
if (tab == 0) { ExtendedFloatingActionButton(
ExtendedFloatingActionButton( onClick = if (tab == 0) onNew else onNewAgent,
onClick = onNew, icon = { Icon(Icons.Filled.Add, contentDescription = null) },
icon = { Icon(Icons.Filled.Add, contentDescription = null) }, text = { Text(stringResource(if (tab == 0) R.string.new_chat else R.string.new_agent_chat)) },
text = { Text(stringResource(R.string.new_chat)) }, )
)
}
}, },
) { padding -> ) { padding ->
Column(Modifier.padding(padding).fillMaxSize()) { Column(Modifier.padding(padding).fillMaxSize()) {
@@ -145,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)) }) Tab(selected = tab == 1, onClick = { tab = 1 }, text = { Text(stringResource(R.string.tab_agents)) })
} }
state.error?.let { 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()) { 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) { Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
Text( Text(
stringResource(if (tab == 0) R.string.empty_chats else R.string.empty_agents), stringResource(if (tab == 0) R.string.empty_chats else R.string.empty_agents),
@@ -0,0 +1,196 @@
@file:OptIn(androidx.compose.material3.ExperimentalMaterial3Api::class)
package eu.llembas.android.ui.files
import android.app.Application
import android.text.format.Formatter
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Description
import androidx.compose.material.icons.filled.Folder
import androidx.compose.material.icons.filled.FolderShared
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.ListItem
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.pulltorefresh.PullToRefreshBox
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
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.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.viewModelScope
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
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
/** One directory of the person's tree, and whether it is on its way. */
data class FilesState(
val path: String = "/",
val parent: String? = null,
val entries: List<FileEntry> = emptyList(),
val loading: Boolean = false,
val error: String? = null,
)
/**
* The person's files, read-only: `GET /api/v2/files` as the explorer's listing. The tree is read
* as the person, with no chat -- their own access, the same the web UI's explorer draws by.
*/
class FilesViewModel(app: Application) : AndroidViewModel(app) {
private val _state = MutableStateFlow(FilesState(loading = true))
val state = _state.asStateFlow()
private var loading: Job? = null
/**
* Opens a directory. A refusal (a path no longer readable, the server unreachable) keeps the
* directory already shown and says why above it, so the way back is never lost.
*/
fun open(path: String) {
loading?.cancel()
loading = viewModelScope.launch {
_state.update { it.copy(loading = true, error = null) }
try {
val api = getApplication<Application>().lembas.instances.client()
if (api == null) {
_state.update { it.copy(loading = false) }
return@launch
}
val listing = api.files(path)
_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 = getApplication<Application>().explain(e)) }
}
}
}
fun reload() = open(_state.value.path)
fun up(): Boolean {
val parent = _state.value.parent ?: return false
open(parent)
return true
}
}
@Composable
fun FilesScreen(onBack: () -> Unit, model: FilesViewModel = viewModel()) {
val state by model.state.collectAsStateWithLifecycle()
val palette = LocalPalette.current
var viewing by rememberSaveable { mutableStateOf<String?>(null) }
LaunchedEffect(Unit) { if (state.entries.isEmpty() && state.error == null) model.open(state.path) }
// Back goes up one directory first, as a file manager's does; at the top it leaves.
BackHandler(enabled = state.parent != null) { model.up() }
Scaffold(
topBar = {
TopAppBar(
navigationIcon = {
IconButton(onClick = { if (!model.up()) onBack() }) {
Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(R.string.back))
}
},
title = {
Column {
Text(stringResource(R.string.files), maxLines = 1, overflow = TextOverflow.Ellipsis)
Text(
if (state.parent == null) stringResource(R.string.files_all) else state.path,
style = MaterialTheme.typography.labelSmall,
fontFamily = if (state.parent == null) null else FontFamily.Monospace,
color = palette.inkFaint,
maxLines = 1,
overflow = TextOverflow.StartEllipsis,
)
}
},
)
},
) { padding ->
Column(Modifier.padding(padding).fillMaxSize()) {
state.error?.let {
Text(it, color = MaterialTheme.colorScheme.error, modifier = Modifier.padding(16.dp))
}
PullToRefreshBox(isRefreshing = state.loading, onRefresh = { model.reload() }, modifier = Modifier.fillMaxSize()) {
if (state.entries.isEmpty() && !state.loading && state.error == null) {
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
Text(
stringResource(R.string.files_empty),
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(32.dp),
)
}
}
LazyColumn(Modifier.fillMaxSize()) {
items(state.entries, key = { it.path }) { entry ->
EntryRow(entry) { if (entry.isFolder) model.open(entry.path) else viewing = entry.path }
HorizontalDivider()
}
}
}
}
}
viewing?.let { path -> TreeFileViewer(path, onClose = { viewing = null }) }
}
@Composable
private fun EntryRow(entry: FileEntry, onOpen: () -> Unit) {
val context = LocalContext.current
ListItem(
modifier = Modifier.fillMaxWidth().clickable(onClick = onOpen),
leadingContent = {
Icon(
when (entry.kind) {
"mount" -> Icons.Filled.FolderShared
"dir" -> Icons.Filled.Folder
else -> Icons.Filled.Description
},
contentDescription = null,
tint = MaterialTheme.colorScheme.onSurfaceVariant,
)
},
headlineContent = { Text(entry.name.ifBlank { entry.path }, maxLines = 1, overflow = TextOverflow.Ellipsis) },
supportingContent = if (entry.isFolder) {
null
} else {
{
val line = listOfNotNull(Formatter.formatShortFileSize(context, entry.size), entry.mime.ifBlank { null }).joinToString(" · ")
Text(line, maxLines = 1, overflow = TextOverflow.Ellipsis)
}
},
)
}
@@ -43,8 +43,11 @@ import androidx.lifecycle.viewModelScope
import androidx.lifecycle.viewmodel.compose.viewModel import androidx.lifecycle.viewmodel.compose.viewModel
import eu.llembas.android.R import eu.llembas.android.R
import eu.llembas.android.api.Doorstep import eu.llembas.android.api.Doorstep
import eu.llembas.android.api.ServerFit
import eu.llembas.android.api.fit
import eu.llembas.android.api.normaliseBase import eu.llembas.android.api.normaliseBase
import eu.llembas.android.lembas import eu.llembas.android.lembas
import eu.llembas.android.ui.explain
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
@@ -60,8 +63,12 @@ sealed interface SignInState {
data object Done : SignInState data object Done : SignInState
} }
/** The newest API this app reads. A server with a newer one is told about, not guessed at. */ /** The sentence for a server this app will not work with, or null when it fits. */
const val APP_API = 1 fun refusal(fit: ServerFit): Int? = when (fit) {
ServerFit.FITS -> null
ServerFit.NOT_LEMBAS, ServerFit.TOO_OLD -> R.string.signin_too_old
ServerFit.TOO_NEW -> R.string.signin_too_new
}
class SignInViewModel(app: Application) : AndroidViewModel(app) { class SignInViewModel(app: Application) : AndroidViewModel(app) {
private val _state = MutableStateFlow<SignInState>(SignInState.Address) private val _state = MutableStateFlow<SignInState>(SignInState.Address)
@@ -76,12 +83,8 @@ class SignInViewModel(app: Application) : AndroidViewModel(app) {
try { try {
val base = normaliseBase(typed) val base = normaliseBase(typed)
val found = doorstep.discover(base) val found = doorstep.discover(base)
if (found.service != "lembas" || found.appApi < 1 || "app" !in found.scopes) { refusal(fit(found))?.let { said ->
_state.value = SignInState.Failed(getApplication<Application>().getString(R.string.signin_too_old)) _state.value = SignInState.Failed(getApplication<Application>().getString(said))
return@launch
}
if (found.appApi > APP_API) {
_state.value = SignInState.Failed(getApplication<Application>().getString(R.string.signin_too_new))
return@launch return@launch
} }
val device = getApplication<Application>().getString(R.string.device_name) val device = getApplication<Application>().getString(R.string.device_name)
@@ -122,7 +125,7 @@ class SignInViewModel(app: Application) : AndroidViewModel(app) {
} }
_state.value = SignInState.Failed(getApplication<Application>().getString(R.string.signin_expired)) _state.value = SignInState.Failed(getApplication<Application>().getString(R.string.signin_expired))
} catch (e: Exception) { } catch (e: Exception) {
_state.value = SignInState.Failed(e.message ?: e.javaClass.simpleName) _state.value = SignInState.Failed(getApplication<Application>().explain(e))
} }
} }
} }
@@ -1,6 +1,8 @@
package eu.llembas.android.ui.theme package eu.llembas.android.ui.theme
import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.text.selection.LocalTextSelectionColors
import androidx.compose.foundation.text.selection.TextSelectionColors
import androidx.compose.material3.ColorScheme import androidx.compose.material3.ColorScheme
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme import androidx.compose.material3.darkColorScheme
@@ -55,6 +57,10 @@ fun LembasTheme(choice: String = "", content: @Composable () -> Unit) {
} }
val palette = if (dark) Moria else Shire val palette = if (dark) Moria else Shire
CompositionLocalProvider(LocalPalette provides palette) { CompositionLocalProvider(LocalPalette provides palette) {
MaterialTheme(colorScheme = scheme(palette, dark), content = content) MaterialTheme(colorScheme = scheme(palette, dark)) {
// The web UI's `--selection`: selected text is a tint you can find, not Material's default.
val selection = TextSelectionColors(handleColor = palette.accent, backgroundColor = palette.selection)
CompositionLocalProvider(LocalTextSelectionColors provides selection, content = content)
}
} }
} }
@@ -1,4 +1,4 @@
// Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at v1.7.0. 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 package eu.llembas.android.ui.theme
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
@@ -20,6 +20,7 @@ data class Palette(
val accentHover: Color, val accentHover: Color,
val accentInk: Color, val accentInk: Color,
val accentSoft: Color, val accentSoft: Color,
val selection: Color,
val leaf: Color, val leaf: Color,
val danger: Color, val danger: Color,
val dangerSoft: Color, val dangerSoft: Color,
@@ -49,6 +50,7 @@ val Moria = Palette(
accentHover = Color(0xFFB4E6F1L), accentHover = Color(0xFFB4E6F1L),
accentInk = Color(0xFF061418L), accentInk = Color(0xFF061418L),
accentSoft = Color(0x1F8FD8E8L), accentSoft = Color(0x1F8FD8E8L),
selection = Color(0x528FD8E8L),
leaf = Color(0xFF7EE081L), leaf = Color(0xFF7EE081L),
danger = Color(0xFFF0735FL), danger = Color(0xFFF0735FL),
dangerSoft = Color(0x21F0735FL), dangerSoft = Color(0x21F0735FL),
@@ -78,6 +80,7 @@ val Shire = Palette(
accentHover = Color(0xFF1F4D30L), accentHover = Color(0xFF1F4D30L),
accentInk = Color(0xFFF8F3E5L), accentInk = Color(0xFFF8F3E5L),
accentSoft = Color(0x1A285F3CL), accentSoft = Color(0x1A285F3CL),
selection = Color(0x3D285F3CL),
leaf = Color(0xFF3D6B1CL), leaf = Color(0xFF3D6B1CL),
danger = Color(0xFFA3321FL), danger = Color(0xFFA3321FL),
dangerSoft = Color(0x1AA3321FL), dangerSoft = Color(0x1AA3321FL),
@@ -0,0 +1,304 @@
@file:OptIn(androidx.compose.material3.ExperimentalMaterial3Api::class)
package eu.llembas.android.ui.viewer
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.net.Uri
import androidx.browser.customtabs.CustomTabsIntent
import androidx.compose.foundation.background
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.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.OpenInNew
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.ContentCopy
import androidx.compose.material3.CircularProgressIndicator
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.Text
import androidx.compose.material3.TopAppBar
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.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.rememberTextMeasurer
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import eu.llembas.android.R
import eu.llembas.android.api.ApiClient
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
/**
* Markdown longer than this is shown as its lines instead. A TextView holding a whole megabyte
* of rendered Markdown stalls the phone; the same text as a lazy list of lines does not.
*/
private const val MARKDOWN_MAX_CHARS = 200_000
/** Where a file is on its way into the viewer. */
private sealed interface Loaded {
data object Loading : Loaded
/** [kind]: what the server said the file is, when it is only known once it came. */
data class Text(val text: String, val kind: String? = null) : Loaded
/** [unavailable]: this server has no door for the app to read the file through. */
data class Failed(val message: String, val unavailable: Boolean = false) : Loaded
}
/** What the viewer's title and body need to know before the text comes. */
private data class Viewed(val name: String, val path: String, val line: Int, val kind: String)
/**
* What a `show` card opens: the file, full screen, read-only, as the chat sees it now.
*
* Everything in it came from a model and is untrusted, as on the web page, so the rules are the
* same ones the transcript keeps: Markdown goes through [MarkdownText] (no images, no HTML, links
* outside for http, https and mailto only); code and text are drawn as lines, never interpreted.
* **HTML is shown as its source, never rendered** -- the app has no WebView, and a page a model
* wrote does not get one here. The web UI renders it in its sealed frame (an opaque origin with
* no network), and "Open in the browser" goes there.
*/
@Composable
fun FileViewer(chatId: String, show: ShowCard, onClose: () -> Unit) {
Viewer(
file = Viewed(show.name, show.path, show.line, show.viewKind),
key = chatId to show,
webUrl = { it.webViewer(chatId, show) },
load = { api, _ -> Loaded.Text(api.shownText(chatId, show)) },
onClose = onClose,
)
}
/**
* A file of the person's tree (the Files screen), in the same viewer and under the same rules:
* the person's own files are no more trusted than a model's, since a model may have written
* them. A file the server withholds (not text, over 1 MB) says why, and offers the web UI.
*/
@Composable
fun TreeFileViewer(path: String, onClose: () -> Unit) {
Viewer(
file = Viewed(path.substringAfterLast('/').ifBlank { path }, path, 0, "text"),
key = path,
webUrl = { it.webFile(path) },
load = { api, context ->
val file = api.fileContent(path)
val withheld = file.withheld
when {
withheld == null -> Loaded.Text(file.text, file.viewKind)
withheld.message.isNotBlank() -> Loaded.Failed(withheld.message)
withheld.reason == "too_large" -> Loaded.Failed(context.getString(R.string.viewer_too_large))
else -> Loaded.Failed(context.getString(R.string.viewer_not_text))
}
},
onClose = onClose,
)
}
@Composable
private fun Viewer(file: Viewed, key: Any, webUrl: (ApiClient) -> String?, load: suspend (ApiClient, Context) -> Loaded, onClose: () -> Unit) {
val context = LocalContext.current
val palette = LocalPalette.current
var loaded by remember(key) { mutableStateOf<Loaded>(Loaded.Loading) }
var web by remember(key) { mutableStateOf<String?>(null) }
LaunchedEffect(key) {
val api = context.lembas.instances.client()
if (api == null) {
loaded = Loaded.Failed(context.getString(R.string.assist_signed_out))
return@LaunchedEffect
}
web = webUrl(api)
loaded = try {
load(api, context)
} catch (e: ApiException) {
when {
e.status == 413 -> Loaded.Failed(context.getString(R.string.viewer_too_large))
e.status == 415 -> Loaded.Failed(e.message?.ifBlank { null } ?: context.getString(R.string.viewer_not_text))
// No such route at all (FastAPI's own "Not Found", or the wrong method): a
// server without the app's door to the file. Its own 404 has a sentence.
e.status == 405 || (e.status == 404 && e.message == "Not Found") ->
Loaded.Failed(context.getString(R.string.viewer_unavailable), unavailable = true)
else -> Loaded.Failed(e.message ?: context.getString(R.string.viewer_unavailable))
}
} catch (e: IOException) {
Loaded.Failed(context.explain(e))
}
}
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(file.name.ifBlank { file.path }, maxLines = 1, overflow = TextOverflow.Ellipsis)
Text(
file.path + if (file.line > 0) ":${file.line}" else "",
style = MaterialTheme.typography.labelSmall,
fontFamily = FontFamily.Monospace,
color = palette.inkFaint,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}
},
actions = {
(loaded as? Loaded.Text)?.let { done ->
IconButton(onClick = { copy(context, file.name, done.text) }) {
Icon(Icons.Filled.ContentCopy, contentDescription = stringResource(R.string.viewer_copy))
}
}
web?.let { url ->
IconButton(onClick = { openOutside(context, url) }) {
Icon(Icons.AutoMirrored.Filled.OpenInNew, contentDescription = stringResource(R.string.viewer_open_browser))
}
}
},
)
},
) { padding ->
Box(Modifier.padding(padding).fillMaxSize()) {
when (val now = loaded) {
Loaded.Loading -> CircularProgressIndicator(Modifier.align(Alignment.Center))
is Loaded.Failed -> Column(
Modifier.align(Alignment.Center).padding(32.dp),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(now.message, color = palette.inkMuted, textAlign = TextAlign.Center)
web?.let { url ->
OutlinedButton(onClick = { openOutside(context, url) }, modifier = Modifier.padding(top = 16.dp)) {
Text(stringResource(R.string.viewer_open_browser))
}
}
}
is Loaded.Text -> Body(now.kind ?: file.kind, file.line, now.text)
}
}
}
}
}
@Composable
private fun Body(kind: String, line: Int, text: String) {
val palette = LocalPalette.current
if (kind == "markdown" && text.length <= MARKDOWN_MAX_CHARS) {
Column(Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(16.dp)) {
MarkdownText(text, modifier = Modifier.fillMaxWidth())
}
return
}
val note = when (kind) {
"html" -> R.string.viewer_html_source
"markdown" -> R.string.viewer_long_markdown
else -> null
}
Column(Modifier.fillMaxSize()) {
note?.let {
Text(
stringResource(it),
style = MaterialTheme.typography.bodySmall,
color = palette.inkMuted,
modifier = Modifier.fillMaxWidth().background(palette.bgSunken).padding(horizontal = 16.dp, vertical = 10.dp),
)
}
Lines(text, line)
}
}
/**
* A file as numbered lines, opened at the line the card named. The number column's width is
* measured, not guessed: it is the width of the longest number in this file, so every line's
* text starts at the same x whatever its number, and a wrapped line continues under its own
* text rather than under the numbers.
*/
@Composable
private fun Lines(text: String, line: Int) {
val palette = LocalPalette.current
val rows = remember(text) {
val split = text.split('\n')
if (split.size > 1 && split.last().isEmpty()) split.dropLast(1) else split
}
val style = TextStyle(fontFamily = FontFamily.Monospace, fontSize = 13.sp, lineHeight = 18.sp, color = palette.ink)
val measurer = rememberTextMeasurer()
val density = LocalDensity.current
val gutter = remember(rows.size, density) {
with(density) { measurer.measure("9".repeat(rows.size.toString().length), style).size.width.toDp() }
}
val state = rememberLazyListState(initialFirstVisibleItemIndex = (line - 1).coerceIn(0, (rows.size - 1).coerceAtLeast(0)))
LazyColumn(
state = state,
modifier = Modifier.fillMaxSize().background(palette.codeBg),
contentPadding = PaddingValues(vertical = 8.dp),
) {
itemsIndexed(rows) { i, row ->
val here = line > 0 && i == line - 1
Row(
Modifier
.fillMaxWidth()
.then(if (here) Modifier.background(palette.accentSoft) else Modifier)
.padding(horizontal = 12.dp),
) {
Text((i + 1).toString(), style = style.copy(color = palette.inkFaint), textAlign = TextAlign.End, modifier = Modifier.width(gutter))
Spacer(Modifier.width(12.dp))
Text(row.ifEmpty { " " }, style = style, modifier = Modifier.weight(1f))
}
}
}
}
private fun copy(context: Context, label: String, text: String) {
context.getSystemService(ClipboardManager::class.java)?.setPrimaryClip(ClipData.newPlainText(label, text))
}
/** The web UI's viewer, in the browser (a Custom Tab), where the person's own session is. */
private fun openOutside(context: Context, url: String) {
val uri = Uri.parse(url)
if (uri.scheme?.lowercase() !in setOf("http", "https")) return
runCatching { CustomTabsIntent.Builder().build().launchUrl(context, uri) }
}
@@ -37,7 +37,7 @@ class Updater(private val context: Context) {
if (!it.isSuccessful) return@withContext context.getString(R.string.update_unreachable) if (!it.isSuccessful) return@withContext context.getString(R.string.update_unreachable)
LembasJson.decodeFromString(Latest.serializer(), it.body!!.string()) 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) return@withContext context.getString(R.string.update_none)
} }
if (!context.packageManager.canRequestPackageInstalls()) { if (!context.packageManager.canRequestPackageInstalls()) {
+84 -5
View File
@@ -11,13 +11,18 @@
<string name="signin_open_browser">Otevřít v prohlížeči</string> <string name="signin_open_browser">Otevřít v prohlížeči</string>
<string name="signin_denied">Přihlášení bylo odmítnuto.</string> <string name="signin_denied">Přihlášení bylo odmítnuto.</string>
<string name="signin_expired">Kód vypršel, než byl schválen. Zkuste to znovu.</string> <string name="signin_expired">Kód vypršel, než byl schválen. Zkuste to znovu.</string>
<string name="signin_too_old">Tato instance ještě nemá rozhraní API pro aplikace. Potřebuje LLeMbas 1.7.0 nebo novější.</string> <string name="signin_too_old">Tato instance používá starší LLeMbas. Tato aplikace potřebuje LLeMbas 2.0 nebo novější.</string>
<string name="signin_too_new">Tato instance používá novější rozhraní API pro aplikace než tato aplikace. Aktualizujte aplikaci.</string> <string name="signin_too_new">Tato instance používá novější rozhraní API pro aplikace než tato aplikace. Aktualizujte aplikaci.</string>
<string name="new_chat">Nová konverzace</string> <string name="new_chat">Nová konverzace</string>
<string name="tab_chats">Konverzace</string> <string name="tab_chats">Konverzace</string>
<string name="tab_agents">Agenti</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_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="empty_chat">O čem si promluvíme?</string>
<string name="loading_line">Pečou se lembasy…</string> <string name="loading_line">Pečou se lembasy…</string>
<string name="archive">Archivovat</string> <string name="archive">Archivovat</string>
@@ -35,16 +40,79 @@
<string name="send">Odeslat</string> <string name="send">Odeslat</string>
<string name="stop">Zastavit</string> <string name="stop">Zastavit</string>
<string name="attach">Přiložit soubor</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="dictate">Diktovat</string>
<string name="remove">Odebrat</string> <string name="remove">Odebrat</string>
<string name="more">Více</string> <string name="more">Více</string>
<string name="back">Zpět</string> <string name="back">Zpět</string>
<string name="cancel">Zrušit</string> <string name="cancel">Zrušit</string>
<string name="close">Zavřít</string> <string name="close">Zavřít</string>
<string name="effort_off">Úsilí: vypnuto</string>
<string name="mode_plan">Plán</string> <string name="mode_plan">Plán</string>
<string name="mode_edit">Upravit</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_approval">Povolit to?</string>
<string name="card_allow_once">Povolit jednou</string> <string name="card_allow_once">Povolit jednou</string>
<string name="card_allow_always">Toto vždy povolit</string> <string name="card_allow_always">Toto vždy povolit</string>
@@ -58,6 +126,18 @@
<string name="plan_revise">Přepracovat</string> <string name="plan_revise">Přepracovat</string>
<string name="plan_what_to_change">Co by se mělo změnit?</string> <string name="plan_what_to_change">Co by se mělo změnit?</string>
<string name="plan_carry_out">Provést plán</string> <string name="plan_carry_out">Provést plán</string>
<string name="shown">Zobrazeno</string>
<string name="viewer_open">Otevřít</string>
<string name="viewer_open_browser">Otevřít v prohlížeči</string>
<string name="viewer_copy">Kopírovat</string>
<string name="viewer_html_source">Toto je zdrojový kód stránky. Samotnou stránku uvidíte po otevření v prohlížeči.</string>
<string name="viewer_long_markdown">Dlouhý soubor, proto je zobrazen jako prostý text.</string>
<string name="viewer_unavailable">Tento server zatím aplikaci soubor předat neumí. Otevřete ho v prohlížeči.</string>
<string name="viewer_too_large">Tento soubor je příliš velký na zobrazení; zobrazit lze nejvýše 1 MB.</string>
<string name="viewer_not_text">Toto není textový soubor, proto se zde nezobrazuje.</string>
<string name="files">Soubory</string>
<string name="files_all">Všechny soubory</string>
<string name="files_empty">Zatím tu nic není. Ani hobití nora.</string>
<string name="settings">Nastavení</string> <string name="settings">Nastavení</string>
<string name="settings_instances">Instance</string> <string name="settings_instances">Instance</string>
<string name="sign_out">Odhlásit se</string> <string name="sign_out">Odhlásit se</string>
@@ -74,7 +154,6 @@
<string name="push_failed">Nebyl zvolen žádný distributor, takže upozornění jsou stále vypnutá.</string> <string name="push_failed">Nebyl zvolen žádný distributor, takže upozornění jsou stále vypnutá.</string>
<string name="channel_replies">Odpovědi</string> <string name="channel_replies">Odpovědi</string>
<string name="channel_asks">Otázky a schválení</string> <string name="channel_asks">Otázky a schválení</string>
<string name="channel_reports">Zprávy</string>
<string name="settings_assistant">Asistent</string> <string name="settings_assistant">Asistent</string>
<string name="assistant_explained">Nastavte LLeMbas jako digitálního asistenta telefonu: zvolte ho v Výchozí aplikace › Digitální asistent. Podržení tlačítka napájení, gesto asistenta nebo zkratka na zamykací obrazovce ho pak otevře přes to, co je právě na obrazovce.</string> <string name="assistant_explained">Nastavte LLeMbas jako digitálního asistenta telefonu: zvolte ho v Výchozí aplikace › Digitální asistent. Podržení tlačítka napájení, gesto asistenta nebo zkratka na zamykací obrazovce ho pak otevře přes to, co je právě na obrazovce.</string>
<string name="assistant_open_settings">Otevřít nastavení asistenta</string> <string name="assistant_open_settings">Otevřít nastavení asistenta</string>
+85 -6
View File
@@ -11,13 +11,18 @@
<string name="signin_open_browser">Im Browser öffnen</string> <string name="signin_open_browser">Im Browser öffnen</string>
<string name="signin_denied">Die Anmeldung wurde abgelehnt.</string> <string name="signin_denied">Die Anmeldung wurde abgelehnt.</string>
<string name="signin_expired">Der Code ist abgelaufen, bevor er bestätigt wurde. Versuchen Sie es erneut.</string> <string name="signin_expired">Der Code ist abgelaufen, bevor er bestätigt wurde. Versuchen Sie es erneut.</string>
<string name="signin_too_old">Diese Instanz hat noch keine App-API. Sie braucht LLeMbas 1.7.0 oder neuer.</string> <string name="signin_too_old">Auf dieser Instanz läuft ein älteres LLeMbas. Diese App braucht LLeMbas 2.0 oder neuer.</string>
<string name="signin_too_new">Diese Instanz spricht eine neuere App-API als diese App. Aktualisieren Sie die App.</string> <string name="signin_too_new">Diese Instanz spricht eine neuere App-API als diese App. Aktualisieren Sie die App.</string>
<string name="new_chat">Neuer Chat</string> <string name="new_chat">Neuer Chat</string>
<string name="tab_chats">Chats</string> <string name="tab_chats">Chats</string>
<string name="tab_agents">Agenten</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_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="empty_chat">Worüber sprechen wir?</string>
<string name="loading_line">Lembas wird gebacken…</string> <string name="loading_line">Lembas wird gebacken…</string>
<string name="archive">Archivieren</string> <string name="archive">Archivieren</string>
@@ -35,16 +40,79 @@
<string name="send">Senden</string> <string name="send">Senden</string>
<string name="stop">Stoppen</string> <string name="stop">Stoppen</string>
<string name="attach">Datei anhängen</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="dictate">Diktieren</string>
<string name="remove">Entfernen</string> <string name="remove">Entfernen</string>
<string name="more">Mehr</string> <string name="more">Mehr</string>
<string name="back">Zurück</string> <string name="back">Zurück</string>
<string name="cancel">Abbrechen</string> <string name="cancel">Abbrechen</string>
<string name="close">Schließen</string> <string name="close">Schließen</string>
<string name="effort_off">Aufwand: aus</string> <string name="mode_plan">Plan</string>
<string name="mode_plan">Tarif</string>
<string name="mode_edit">Bearbeiten</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_approval">Das erlauben?</string>
<string name="card_allow_once">Einmal erlauben</string> <string name="card_allow_once">Einmal erlauben</string>
<string name="card_allow_always">Dies immer erlauben</string> <string name="card_allow_always">Dies immer erlauben</string>
@@ -58,6 +126,18 @@
<string name="plan_revise">Überarbeiten</string> <string name="plan_revise">Überarbeiten</string>
<string name="plan_what_to_change">Was soll sich ändern?</string> <string name="plan_what_to_change">Was soll sich ändern?</string>
<string name="plan_carry_out">Plan ausführen</string> <string name="plan_carry_out">Plan ausführen</string>
<string name="shown">Angezeigt</string>
<string name="viewer_open">Öffnen</string>
<string name="viewer_open_browser">Im Browser öffnen</string>
<string name="viewer_copy">Kopieren</string>
<string name="viewer_html_source">Das ist der Quelltext der Seite. Die Seite selbst sehen Sie im Browser.</string>
<string name="viewer_long_markdown">Eine lange Datei, daher wird sie als reiner Text angezeigt.</string>
<string name="viewer_unavailable">Dieser Server kann die Datei der App noch nicht übergeben. Öffnen Sie sie stattdessen im Browser.</string>
<string name="viewer_too_large">Diese Datei ist zu groß zum Anzeigen; höchstens 1 MB kann angezeigt werden.</string>
<string name="viewer_not_text">Das ist keine Textdatei, deshalb wird sie hier nicht angezeigt.</string>
<string name="files">Dateien</string>
<string name="files_all">Alle Dateien</string>
<string name="files_empty">Hier ist noch nichts. Nicht einmal eine Hobbithöhle.</string>
<string name="settings">Einstellungen</string> <string name="settings">Einstellungen</string>
<string name="settings_instances">Instanzen</string> <string name="settings_instances">Instanzen</string>
<string name="sign_out">Abmelden</string> <string name="sign_out">Abmelden</string>
@@ -74,7 +154,6 @@
<string name="push_failed">Es wurde kein Distributor gewählt, daher sind die Benachrichtigungen noch ausgeschaltet.</string> <string name="push_failed">Es wurde kein Distributor gewählt, daher sind die Benachrichtigungen noch ausgeschaltet.</string>
<string name="channel_replies">Antworten</string> <string name="channel_replies">Antworten</string>
<string name="channel_asks">Fragen und Bestätigungen</string> <string name="channel_asks">Fragen und Bestätigungen</string>
<string name="channel_reports">Berichte</string>
<string name="settings_assistant">Assistent</string> <string name="settings_assistant">Assistent</string>
<string name="assistant_explained">Machen Sie LLeMbas zum digitalen Assistenten des Telefons: Wählen Sie ihn unter Standard-Apps › Digitaler Assistent. Das Halten der Einschalttaste, die Assistenzgeste oder die Verknüpfung auf dem Sperrbildschirm öffnet ihn dann über allem, was gerade angezeigt wird.</string> <string name="assistant_explained">Machen Sie LLeMbas zum digitalen Assistenten des Telefons: Wählen Sie ihn unter Standard-Apps › Digitaler Assistent. Das Halten der Einschalttaste, die Assistenzgeste oder die Verknüpfung auf dem Sperrbildschirm öffnet ihn dann über allem, was gerade angezeigt wird.</string>
<string name="assistant_open_settings">Assistenten-Einstellungen öffnen</string> <string name="assistant_open_settings">Assistenten-Einstellungen öffnen</string>
+83 -4
View File
@@ -11,13 +11,18 @@
<string name="signin_open_browser">Abrir en el navegador</string> <string name="signin_open_browser">Abrir en el navegador</string>
<string name="signin_denied">El inicio de sesión fue rechazado.</string> <string name="signin_denied">El inicio de sesión fue rechazado.</string>
<string name="signin_expired">El código caducó antes de ser aprobado. Inténtelo de nuevo.</string> <string name="signin_expired">El código caducó antes de ser aprobado. Inténtelo de nuevo.</string>
<string name="signin_too_old">Esta instancia aún no tiene API para aplicaciones. Necesita LLeMbas 1.7.0 o una versión posterior.</string> <string name="signin_too_old">Esta instancia usa una versión anterior de LLeMbas. Esta aplicación necesita LLeMbas 2.0 o posterior.</string>
<string name="signin_too_new">Esta instancia habla una API de aplicaciones más reciente que esta aplicación. Actualice la aplicación.</string> <string name="signin_too_new">Esta instancia habla una API de aplicaciones más reciente que esta aplicación. Actualice la aplicación.</string>
<string name="new_chat">Nuevo chat</string> <string name="new_chat">Nuevo chat</string>
<string name="tab_chats">Chats</string> <string name="tab_chats">Chats</string>
<string name="tab_agents">Agentes</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_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="empty_chat">¿De qué hablamos?</string>
<string name="loading_line">Horneando lembas…</string> <string name="loading_line">Horneando lembas…</string>
<string name="archive">Archivar</string> <string name="archive">Archivar</string>
@@ -35,16 +40,79 @@
<string name="send">Enviar</string> <string name="send">Enviar</string>
<string name="stop">Detener</string> <string name="stop">Detener</string>
<string name="attach">Adjuntar un archivo</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="dictate">Dictar</string>
<string name="remove">Quitar</string> <string name="remove">Quitar</string>
<string name="more">Más</string> <string name="more">Más</string>
<string name="back">Volver</string> <string name="back">Volver</string>
<string name="cancel">Cancelar</string> <string name="cancel">Cancelar</string>
<string name="close">Cerrar</string> <string name="close">Cerrar</string>
<string name="effort_off">Esfuerzo: desactivado</string>
<string name="mode_plan">Plan</string> <string name="mode_plan">Plan</string>
<string name="mode_edit">Editar</string> <string name="mode_edit">Editar</string>
<string name="mode_manual">Manual</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_approval">¿Permitir esto?</string>
<string name="card_allow_once">Permitir una vez</string> <string name="card_allow_once">Permitir una vez</string>
<string name="card_allow_always">Permitir siempre esto</string> <string name="card_allow_always">Permitir siempre esto</string>
@@ -58,6 +126,18 @@
<string name="plan_revise">Revisar</string> <string name="plan_revise">Revisar</string>
<string name="plan_what_to_change">¿Qué debería cambiar?</string> <string name="plan_what_to_change">¿Qué debería cambiar?</string>
<string name="plan_carry_out">Llevar a cabo el plan</string> <string name="plan_carry_out">Llevar a cabo el plan</string>
<string name="shown">Mostrado</string>
<string name="viewer_open">Abrir</string>
<string name="viewer_open_browser">Abrir en el navegador</string>
<string name="viewer_copy">Copiar</string>
<string name="viewer_html_source">Este es el código fuente de la página. Ábrala en el navegador para ver la página.</string>
<string name="viewer_long_markdown">Un archivo largo, por eso se muestra como texto sin formato.</string>
<string name="viewer_unavailable">Este servidor todavía no puede entregar el archivo a la aplicación. Ábralo en el navegador.</string>
<string name="viewer_too_large">Este archivo es demasiado grande para mostrarlo; se puede mostrar como máximo 1 MB.</string>
<string name="viewer_not_text">No es un archivo de texto, así que no se muestra aquí.</string>
<string name="files">Archivos</string>
<string name="files_all">Todos los archivos</string>
<string name="files_empty">Aquí aún no hay nada. Ni siquiera un agujero hobbit.</string>
<string name="settings">Ajustes</string> <string name="settings">Ajustes</string>
<string name="settings_instances">Instancias</string> <string name="settings_instances">Instancias</string>
<string name="sign_out">Cerrar sesión</string> <string name="sign_out">Cerrar sesión</string>
@@ -74,7 +154,6 @@
<string name="push_failed">No se eligió ningún distribuidor, así que las notificaciones siguen desactivadas.</string> <string name="push_failed">No se eligió ningún distribuidor, así que las notificaciones siguen desactivadas.</string>
<string name="channel_replies">Respuestas</string> <string name="channel_replies">Respuestas</string>
<string name="channel_asks">Preguntas y aprobaciones</string> <string name="channel_asks">Preguntas y aprobaciones</string>
<string name="channel_reports">Informes</string>
<string name="settings_assistant">Asistente</string> <string name="settings_assistant">Asistente</string>
<string name="assistant_explained">Convierta LLeMbas en el asistente digital del teléfono: elíjalo en Aplicaciones predeterminadas › App de asistencia digital. Mantener pulsado el botón de encendido, el gesto de asistencia o el acceso directo de la pantalla de bloqueo lo abrirá entonces sobre lo que haya en pantalla.</string> <string name="assistant_explained">Convierta LLeMbas en el asistente digital del teléfono: elíjalo en Aplicaciones predeterminadas › App de asistencia digital. Mantener pulsado el botón de encendido, el gesto de asistencia o el acceso directo de la pantalla de bloqueo lo abrirá entonces sobre lo que haya en pantalla.</string>
<string name="assistant_open_settings">Abrir los ajustes del asistente</string> <string name="assistant_open_settings">Abrir los ajustes del asistente</string>
+85 -6
View File
@@ -11,13 +11,18 @@
<string name="signin_open_browser">Ouvrir dans le navigateur</string> <string name="signin_open_browser">Ouvrir dans le navigateur</string>
<string name="signin_denied">La connexion a été refusée.</string> <string name="signin_denied">La connexion a été refusée.</string>
<string name="signin_expired">Le code a expiré avant d\'être approuvé. Réessayez.</string> <string name="signin_expired">Le code a expiré avant d\'être approuvé. Réessayez.</string>
<string name="signin_too_old">Cette instance n\'a pas encore d\'API pour l\'application. Elle nécessite LLeMbas 1.7.0 ou une version plus récente.</string> <string name="signin_too_old">Cette instance utilise une version plus ancienne de LLeMbas. Cette application nécessite LLeMbas 2.0 ou plus récent.</string>
<string name="signin_too_new">Cette instance utilise une API d\'application plus récente que cette application. Mettez à jour l\'application.</string> <string name="signin_too_new">Cette instance utilise une API d\'application plus récente que cette application. Mettez à jour l\'application.</string>
<string name="new_chat">Nouvelle conversation</string> <string name="new_chat">Nouvelle conversation</string>
<string name="tab_chats">Conversations</string> <string name="tab_chats">Conversations</string>
<string name="tab_agents">Agents</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_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="empty_chat">De quoi allons-nous parler ?</string>
<string name="loading_line">Cuisson des lembas…</string> <string name="loading_line">Cuisson des lembas…</string>
<string name="archive">Archiver</string> <string name="archive">Archiver</string>
@@ -35,16 +40,79 @@
<string name="send">Envoyer</string> <string name="send">Envoyer</string>
<string name="stop">Arrêter</string> <string name="stop">Arrêter</string>
<string name="attach">Joindre un fichier</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="dictate">Dicter</string>
<string name="remove">Retirer</string> <string name="remove">Retirer</string>
<string name="more">Plus</string> <string name="more">Plus</string>
<string name="back">Retour</string> <string name="back">Retour</string>
<string name="cancel">Annuler</string> <string name="cancel">Annuler</string>
<string name="close">Fermer</string> <string name="close">Fermer</string>
<string name="effort_off">Effort : désactivé</string> <string name="mode_plan">Plan</string>
<string name="mode_plan">Forfait</string>
<string name="mode_edit">Modifier</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_approval">Autoriser ceci ?</string>
<string name="card_allow_once">Autoriser une fois</string> <string name="card_allow_once">Autoriser une fois</string>
<string name="card_allow_always">Toujours autoriser ceci</string> <string name="card_allow_always">Toujours autoriser ceci</string>
@@ -58,6 +126,18 @@
<string name="plan_revise">Réviser</string> <string name="plan_revise">Réviser</string>
<string name="plan_what_to_change">Qu\'est-ce qui doit changer ?</string> <string name="plan_what_to_change">Qu\'est-ce qui doit changer ?</string>
<string name="plan_carry_out">Exécuter le plan</string> <string name="plan_carry_out">Exécuter le plan</string>
<string name="shown">Affiché</string>
<string name="viewer_open">Ouvrir</string>
<string name="viewer_open_browser">Ouvrir dans le navigateur</string>
<string name="viewer_copy">Copier</string>
<string name="viewer_html_source">Ceci est le code source de la page. Ouvrez-la dans le navigateur pour voir la page elle-même.</string>
<string name="viewer_long_markdown">Un fichier long, il est donc affiché en texte brut.</string>
<string name="viewer_unavailable">Ce serveur ne peut pas encore transmettre le fichier à l\'application. Ouvrez-le plutôt dans le navigateur.</string>
<string name="viewer_too_large">Ce fichier est trop volumineux pour être affiché ; 1 Mo au plus peut être affiché.</string>
<string name="viewer_not_text">Ce n\'est pas un fichier texte, il n\'est donc pas affiché ici.</string>
<string name="files">Fichiers</string>
<string name="files_all">Tous les fichiers</string>
<string name="files_empty">Rien ici pour l\'instant. Pas même un trou de hobbit.</string>
<string name="settings">Paramètres</string> <string name="settings">Paramètres</string>
<string name="settings_instances">Instances</string> <string name="settings_instances">Instances</string>
<string name="sign_out">Se déconnecter</string> <string name="sign_out">Se déconnecter</string>
@@ -74,7 +154,6 @@
<string name="push_failed">Aucun distributeur n\'a été choisi, les notifications sont donc toujours désactivées.</string> <string name="push_failed">Aucun distributeur n\'a été choisi, les notifications sont donc toujours désactivées.</string>
<string name="channel_replies">Réponses</string> <string name="channel_replies">Réponses</string>
<string name="channel_asks">Questions et approbations</string> <string name="channel_asks">Questions et approbations</string>
<string name="channel_reports">Rapports</string>
<string name="settings_assistant">Assistant</string> <string name="settings_assistant">Assistant</string>
<string name="assistant_explained">Faites de LLeMbas l\'assistant numérique du téléphone : choisissez-le dans Applications par défaut › Application d\'assistance numérique. Maintenir le bouton d\'alimentation, le geste d\'assistance ou le raccourci de l\'écran de verrouillage l\'ouvrira alors par-dessus ce qui est affiché.</string> <string name="assistant_explained">Faites de LLeMbas l\'assistant numérique du téléphone : choisissez-le dans Applications par défaut › Application d\'assistance numérique. Maintenir le bouton d\'alimentation, le geste d\'assistance ou le raccourci de l\'écran de verrouillage l\'ouvrira alors par-dessus ce qui est affiché.</string>
<string name="assistant_open_settings">Ouvrir les paramètres de l\'assistant</string> <string name="assistant_open_settings">Ouvrir les paramètres de l\'assistant</string>
+85 -6
View File
@@ -11,13 +11,18 @@
<string name="signin_open_browser">Megnyitás a böngészőben</string> <string name="signin_open_browser">Megnyitás a böngészőben</string>
<string name="signin_denied">A bejelentkezést elutasították.</string> <string name="signin_denied">A bejelentkezést elutasították.</string>
<string name="signin_expired">A kód lejárt, mielőtt jóváhagyták volna. Próbálja újra.</string> <string name="signin_expired">A kód lejárt, mielőtt jóváhagyták volna. Próbálja újra.</string>
<string name="signin_too_old">Ennek a példánynak még nincs alkalmazás-API-ja. LLeMbas 1.7.0 vagy újabb verzió szükséges hozzá.</string> <string name="signin_too_old">Ezen a példányon régebbi LLeMbas fut. Ehhez az alkalmazáshoz LLeMbas 2.0 vagy újabb kell.</string>
<string name="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.</string> <string name="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.</string>
<string name="new_chat">Új csevegés</string> <string name="new_chat">Új csevegés</string>
<string name="tab_chats">Csevegések</string> <string name="tab_chats">Csevegések</string>
<string name="tab_agents">Ügynökök</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_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="empty_chat">Miről beszéljünk?</string>
<string name="loading_line">Lembas sül…</string> <string name="loading_line">Lembas sül…</string>
<string name="archive">Archiválás</string> <string name="archive">Archiválás</string>
@@ -35,16 +40,79 @@
<string name="send">Küldés</string> <string name="send">Küldés</string>
<string name="stop">Leállítás</string> <string name="stop">Leállítás</string>
<string name="attach">Fájl csatolása</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="dictate">Diktálás</string>
<string name="remove">Eltávolítás</string> <string name="remove">Eltávolítás</string>
<string name="more">Továbbiak</string> <string name="more">Továbbiak</string>
<string name="back">Vissza</string> <string name="back">Vissza</string>
<string name="cancel">Mégse</string> <string name="cancel">Mégse</string>
<string name="close">Bezárás</string> <string name="close">Bezárás</string>
<string name="effort_off">Erőfeszítés: kikapcsolva</string> <string name="mode_plan">Terv</string>
<string name="mode_plan">Csomag</string>
<string name="mode_edit">Szerkesztés</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_approval">Engedélyezzük ezt?</string>
<string name="card_allow_once">Engedélyezés egyszer</string> <string name="card_allow_once">Engedélyezés egyszer</string>
<string name="card_allow_always">Ennek mindig engedélyezése</string> <string name="card_allow_always">Ennek mindig engedélyezése</string>
@@ -58,6 +126,18 @@
<string name="plan_revise">Átdolgozás</string> <string name="plan_revise">Átdolgozás</string>
<string name="plan_what_to_change">Mi változzon?</string> <string name="plan_what_to_change">Mi változzon?</string>
<string name="plan_carry_out">Terv végrehajtása</string> <string name="plan_carry_out">Terv végrehajtása</string>
<string name="shown">Megjelenítve</string>
<string name="viewer_open">Megnyitás</string>
<string name="viewer_open_browser">Megnyitás a böngészőben</string>
<string name="viewer_copy">Másolás</string>
<string name="viewer_html_source">Ez az oldal forráskódja. Magát az oldalt a böngészőben megnyitva láthatja.</string>
<string name="viewer_long_markdown">Hosszú fájl, ezért egyszerű szövegként jelenik meg.</string>
<string name="viewer_unavailable">Ez a szerver még nem tudja átadni a fájlt az alkalmazásnak. Nyissa meg inkább a böngészőben.</string>
<string name="viewer_too_large">Ez a fájl túl nagy a megjelenítéshez; legfeljebb 1 MB jeleníthető meg.</string>
<string name="viewer_not_text">Ez nem szövegfájl, ezért itt nem jelenik meg.</string>
<string name="files">Fájlok</string>
<string name="files_all">Minden fájl</string>
<string name="files_empty">Itt még nincs semmi. Még egy hobbitlyuk sem.</string>
<string name="settings">Beállítások</string> <string name="settings">Beállítások</string>
<string name="settings_instances">Példányok</string> <string name="settings_instances">Példányok</string>
<string name="sign_out">Kijelentkezés</string> <string name="sign_out">Kijelentkezés</string>
@@ -74,7 +154,6 @@
<string name="push_failed">Nem választottak elosztót, így az értesítések továbbra is ki vannak kapcsolva.</string> <string name="push_failed">Nem választottak elosztót, így az értesítések továbbra is ki vannak kapcsolva.</string>
<string name="channel_replies">Válaszok</string> <string name="channel_replies">Válaszok</string>
<string name="channel_asks">Kérdések és jóváhagyások</string> <string name="channel_asks">Kérdések és jóváhagyások</string>
<string name="channel_reports">Jelentések</string>
<string name="settings_assistant">Asszisztens</string> <string name="settings_assistant">Asszisztens</string>
<string name="assistant_explained">Tegye az LLeMbas-t a telefon digitális asszisztensévé: válassza ki az Alapértelmezett alkalmazások › Digitális asszisztens alkalmazás alatt. A bekapcsológomb lenyomva tartása, az asszisztens-gesztus vagy a lezárási képernyő parancsikonja ezután a képernyőn lévő tartalom felett nyitja meg.</string> <string name="assistant_explained">Tegye az LLeMbas-t a telefon digitális asszisztensévé: válassza ki az Alapértelmezett alkalmazások › Digitális asszisztens alkalmazás alatt. A bekapcsológomb lenyomva tartása, az asszisztens-gesztus vagy a lezárási képernyő parancsikonja ezután a képernyőn lévő tartalom felett nyitja meg.</string>
<string name="assistant_open_settings">Asszisztens beállításainak megnyitása</string> <string name="assistant_open_settings">Asszisztens beállításainak megnyitása</string>
+84 -5
View File
@@ -11,13 +11,18 @@
<string name="signin_open_browser">Apri nel browser</string> <string name="signin_open_browser">Apri nel browser</string>
<string name="signin_denied">L\'accesso è stato rifiutato.</string> <string name="signin_denied">L\'accesso è stato rifiutato.</string>
<string name="signin_expired">Il codice è scaduto prima di essere approvato. Riprova.</string> <string name="signin_expired">Il codice è scaduto prima di essere approvato. Riprova.</string>
<string name="signin_too_old">Questa istanza non ha ancora un\'API per l\'app. Richiede LLeMbas 1.7.0 o una versione più recente.</string> <string name="signin_too_old">Questa istanza usa una versione precedente di LLeMbas. Questa app richiede LLeMbas 2.0 o successivo.</string>
<string name="signin_too_new">Questa istanza usa un\'API per l\'app più recente di questa app. Aggiorna l\'app.</string> <string name="signin_too_new">Questa istanza usa un\'API per l\'app più recente di questa app. Aggiorna l\'app.</string>
<string name="new_chat">Nuova chat</string> <string name="new_chat">Nuova chat</string>
<string name="tab_chats">Chat</string> <string name="tab_chats">Chat</string>
<string name="tab_agents">Agenti</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_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="empty_chat">Di cosa parliamo?</string>
<string name="loading_line">I lembas stanno cuocendo…</string> <string name="loading_line">I lembas stanno cuocendo…</string>
<string name="archive">Archivia</string> <string name="archive">Archivia</string>
@@ -35,16 +40,79 @@
<string name="send">Invia</string> <string name="send">Invia</string>
<string name="stop">Ferma</string> <string name="stop">Ferma</string>
<string name="attach">Allega un file</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="dictate">Detta</string>
<string name="remove">Rimuovi</string> <string name="remove">Rimuovi</string>
<string name="more">Altro</string> <string name="more">Altro</string>
<string name="back">Indietro</string> <string name="back">Indietro</string>
<string name="cancel">Annulla</string> <string name="cancel">Annulla</string>
<string name="close">Chiudi</string> <string name="close">Chiudi</string>
<string name="effort_off">Impegno: disattivato</string>
<string name="mode_plan">Piano</string> <string name="mode_plan">Piano</string>
<string name="mode_edit">Modifica</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_approval">Consentire questo?</string>
<string name="card_allow_once">Consenti una volta</string> <string name="card_allow_once">Consenti una volta</string>
<string name="card_allow_always">Consenti sempre questo</string> <string name="card_allow_always">Consenti sempre questo</string>
@@ -58,6 +126,18 @@
<string name="plan_revise">Rivedi</string> <string name="plan_revise">Rivedi</string>
<string name="plan_what_to_change">Cosa dovrebbe cambiare?</string> <string name="plan_what_to_change">Cosa dovrebbe cambiare?</string>
<string name="plan_carry_out">Esegui il piano</string> <string name="plan_carry_out">Esegui il piano</string>
<string name="shown">Mostrato</string>
<string name="viewer_open">Apri</string>
<string name="viewer_open_browser">Apri nel browser</string>
<string name="viewer_copy">Copia</string>
<string name="viewer_html_source">Questo è il sorgente della pagina. Aprila nel browser per vedere la pagina.</string>
<string name="viewer_long_markdown">Un file lungo, quindi è mostrato come testo semplice.</string>
<string name="viewer_unavailable">Questo server non può ancora passare il file all\'app. Aprilo invece nel browser.</string>
<string name="viewer_too_large">Questo file è troppo grande da mostrare; si può mostrare al massimo 1 MB.</string>
<string name="viewer_not_text">Non è un file di testo, quindi non viene mostrato qui.</string>
<string name="files">File</string>
<string name="files_all">Tutti i file</string>
<string name="files_empty">Ancora niente qui. Nemmeno una caverna hobbit.</string>
<string name="settings">Impostazioni</string> <string name="settings">Impostazioni</string>
<string name="settings_instances">Istanze</string> <string name="settings_instances">Istanze</string>
<string name="sign_out">Esci</string> <string name="sign_out">Esci</string>
@@ -74,7 +154,6 @@
<string name="push_failed">Non è stato scelto nessun distributore, quindi le notifiche sono ancora disattivate.</string> <string name="push_failed">Non è stato scelto nessun distributore, quindi le notifiche sono ancora disattivate.</string>
<string name="channel_replies">Risposte</string> <string name="channel_replies">Risposte</string>
<string name="channel_asks">Domande e approvazioni</string> <string name="channel_asks">Domande e approvazioni</string>
<string name="channel_reports">Report</string>
<string name="settings_assistant">Assistente</string> <string name="settings_assistant">Assistente</string>
<string name="assistant_explained">Rendi LLeMbas l\'assistente digitale del telefono: selezionalo in App predefinite › App di assistenza digitale. Tenendo premuto il tasto di accensione, il gesto di assistenza o la scorciatoia della schermata di blocco lo apre quindi sopra qualsiasi cosa sia a schermo.</string> <string name="assistant_explained">Rendi LLeMbas l\'assistente digitale del telefono: selezionalo in App predefinite › App di assistenza digitale. Tenendo premuto il tasto di accensione, il gesto di assistenza o la scorciatoia della schermata di blocco lo apre quindi sopra qualsiasi cosa sia a schermo.</string>
<string name="assistant_open_settings">Apri le impostazioni dell\'assistente</string> <string name="assistant_open_settings">Apri le impostazioni dell\'assistente</string>
+84 -5
View File
@@ -11,13 +11,18 @@
<string name="signin_open_browser">Otwórz w przeglądarce</string> <string name="signin_open_browser">Otwórz w przeglądarce</string>
<string name="signin_denied">Logowanie zostało odrzucone.</string> <string name="signin_denied">Logowanie zostało odrzucone.</string>
<string name="signin_expired">Kod wygasł, zanim został zatwierdzony. Spróbuj ponownie.</string> <string name="signin_expired">Kod wygasł, zanim został zatwierdzony. Spróbuj ponownie.</string>
<string name="signin_too_old">Ta instancja nie ma jeszcze API aplikacji. Wymaga LLeMbas 1.7.0 lub nowszego.</string> <string name="signin_too_old">Ta instancja działa na starszym LLeMbas. Ta aplikacja wymaga LLeMbas 2.0 lub nowszego.</string>
<string name="signin_too_new">Ta instancja używa nowszego API aplikacji niż ta aplikacja. Zaktualizuj aplikację.</string> <string name="signin_too_new">Ta instancja używa nowszego API aplikacji niż ta aplikacja. Zaktualizuj aplikację.</string>
<string name="new_chat">Nowy czat</string> <string name="new_chat">Nowy czat</string>
<string name="tab_chats">Czaty</string> <string name="tab_chats">Czaty</string>
<string name="tab_agents">Agenci</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_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="empty_chat">O czym porozmawiamy?</string>
<string name="loading_line">Lembasy się pieczą…</string> <string name="loading_line">Lembasy się pieczą…</string>
<string name="archive">Archiwizuj</string> <string name="archive">Archiwizuj</string>
@@ -35,16 +40,79 @@
<string name="send">Wyślij</string> <string name="send">Wyślij</string>
<string name="stop">Zatrzymać</string> <string name="stop">Zatrzymać</string>
<string name="attach">Załącz plik</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="dictate">Dyktuj</string>
<string name="remove">Usuń</string> <string name="remove">Usuń</string>
<string name="more">Więcej</string> <string name="more">Więcej</string>
<string name="back">Wstecz</string> <string name="back">Wstecz</string>
<string name="cancel">Anuluj</string> <string name="cancel">Anuluj</string>
<string name="close">Zamknij</string> <string name="close">Zamknij</string>
<string name="effort_off">Wysiłek: wyłączony</string>
<string name="mode_plan">Plan</string> <string name="mode_plan">Plan</string>
<string name="mode_edit">Edytuj</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_approval">Zezwolić na to?</string>
<string name="card_allow_once">Zezwól raz</string> <string name="card_allow_once">Zezwól raz</string>
<string name="card_allow_always">Zawsze na to zezwalaj</string> <string name="card_allow_always">Zawsze na to zezwalaj</string>
@@ -58,6 +126,18 @@
<string name="plan_revise">Popraw</string> <string name="plan_revise">Popraw</string>
<string name="plan_what_to_change">Co powinno się zmienić?</string> <string name="plan_what_to_change">Co powinno się zmienić?</string>
<string name="plan_carry_out">Wykonaj plan</string> <string name="plan_carry_out">Wykonaj plan</string>
<string name="shown">Pokazano</string>
<string name="viewer_open">Otwórz</string>
<string name="viewer_open_browser">Otwórz w przeglądarce</string>
<string name="viewer_copy">Kopiuj</string>
<string name="viewer_html_source">To jest źródło strony. Otwórz ją w przeglądarce, aby zobaczyć samą stronę.</string>
<string name="viewer_long_markdown">Długi plik, dlatego jest pokazany jako zwykły tekst.</string>
<string name="viewer_unavailable">Ten serwer nie potrafi jeszcze przekazać pliku aplikacji. Otwórz go w przeglądarce.</string>
<string name="viewer_too_large">Ten plik jest za duży, by go pokazać; można pokazać najwyżej 1 MB.</string>
<string name="viewer_not_text">To nie jest plik tekstowy, więc nie jest tu pokazywany.</string>
<string name="files">Pliki</string>
<string name="files_all">Wszystkie pliki</string>
<string name="files_empty">Jeszcze nic tu nie ma. Nawet hobbiciej norki.</string>
<string name="settings">Ustawienia</string> <string name="settings">Ustawienia</string>
<string name="settings_instances">Instancje</string> <string name="settings_instances">Instancje</string>
<string name="sign_out">Wyloguj się</string> <string name="sign_out">Wyloguj się</string>
@@ -74,7 +154,6 @@
<string name="push_failed">Nie wybrano dystrybutora, więc powiadomienia są wciąż wyłączone.</string> <string name="push_failed">Nie wybrano dystrybutora, więc powiadomienia są wciąż wyłączone.</string>
<string name="channel_replies">Odpowiedzi</string> <string name="channel_replies">Odpowiedzi</string>
<string name="channel_asks">Pytania i zatwierdzenia</string> <string name="channel_asks">Pytania i zatwierdzenia</string>
<string name="channel_reports">Raporty</string>
<string name="settings_assistant">Asystent</string> <string name="settings_assistant">Asystent</string>
<string name="assistant_explained">Ustaw LLeMbas jako cyfrowego asystenta telefonu: wybierz go w Domyślne aplikacje › Aplikacja asystenta cyfrowego. Przytrzymanie przycisku zasilania, gest asystenta lub skrót z ekranu blokady otwiera go wtedy nad tym, co jest na ekranie.</string> <string name="assistant_explained">Ustaw LLeMbas jako cyfrowego asystenta telefonu: wybierz go w Domyślne aplikacje › Aplikacja asystenta cyfrowego. Przytrzymanie przycisku zasilania, gest asystenta lub skrót z ekranu blokady otwiera go wtedy nad tym, co jest na ekranie.</string>
<string name="assistant_open_settings">Otwórz ustawienia asystenta</string> <string name="assistant_open_settings">Otwórz ustawienia asystenta</string>
+84 -5
View File
@@ -11,13 +11,18 @@
<string name="signin_open_browser">Otvoriť v prehliadači</string> <string name="signin_open_browser">Otvoriť v prehliadači</string>
<string name="signin_denied">Prihlásenie bolo odmietnuté.</string> <string name="signin_denied">Prihlásenie bolo odmietnuté.</string>
<string name="signin_expired">Kód vypršal skôr, než bol schválený. Skúste to znova.</string> <string name="signin_expired">Kód vypršal skôr, než bol schválený. Skúste to znova.</string>
<string name="signin_too_old">Táto inštancia ešte nemá API pre aplikácie. Potrebuje LLeMbas 1.7.0 alebo novší.</string> <string name="signin_too_old">Táto inštancia beží na staršom LLeMbas. Táto aplikácia potrebuje LLeMbas 2.0 alebo novší.</string>
<string name="signin_too_new">Táto inštancia používa novšie API pre aplikácie než táto aplikácia. Aktualizujte aplikáciu.</string> <string name="signin_too_new">Táto inštancia používa novšie API pre aplikácie než táto aplikácia. Aktualizujte aplikáciu.</string>
<string name="new_chat">Nová konverzácia</string> <string name="new_chat">Nová konverzácia</string>
<string name="tab_chats">Konverzácie</string> <string name="tab_chats">Konverzácie</string>
<string name="tab_agents">Agenti</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_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="empty_chat">O čom sa pozhovárame?</string>
<string name="loading_line">Pečú sa lembasy…</string> <string name="loading_line">Pečú sa lembasy…</string>
<string name="archive">Archivovať</string> <string name="archive">Archivovať</string>
@@ -35,16 +40,79 @@
<string name="send">Poslať</string> <string name="send">Poslať</string>
<string name="stop">Zastaviť</string> <string name="stop">Zastaviť</string>
<string name="attach">Priložiť súbor</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="dictate">Diktovať</string>
<string name="remove">Odstrániť</string> <string name="remove">Odstrániť</string>
<string name="more">Viac</string> <string name="more">Viac</string>
<string name="back">Späť</string> <string name="back">Späť</string>
<string name="cancel">Zrušiť</string> <string name="cancel">Zrušiť</string>
<string name="close">Zavrieť</string> <string name="close">Zavrieť</string>
<string name="effort_off">Úsilie: vypnuté</string>
<string name="mode_plan">Plán</string> <string name="mode_plan">Plán</string>
<string name="mode_edit">Upraviť</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_approval">Povoliť to?</string>
<string name="card_allow_once">Povoliť raz</string> <string name="card_allow_once">Povoliť raz</string>
<string name="card_allow_always">Toto vždy povoliť</string> <string name="card_allow_always">Toto vždy povoliť</string>
@@ -58,6 +126,18 @@
<string name="plan_revise">Prepracovať</string> <string name="plan_revise">Prepracovať</string>
<string name="plan_what_to_change">Čo by sa malo zmeniť?</string> <string name="plan_what_to_change">Čo by sa malo zmeniť?</string>
<string name="plan_carry_out">Vykonať plán</string> <string name="plan_carry_out">Vykonať plán</string>
<string name="shown">Zobrazené</string>
<string name="viewer_open">Otvoriť</string>
<string name="viewer_open_browser">Otvoriť v prehliadači</string>
<string name="viewer_copy">Kopírovať</string>
<string name="viewer_html_source">Toto je zdrojový kód stránky. Samotnú stránku uvidíte po otvorení v prehliadači.</string>
<string name="viewer_long_markdown">Dlhý súbor, preto je zobrazený ako obyčajný text.</string>
<string name="viewer_unavailable">Tento server zatiaľ nevie aplikácii súbor odovzdať. Otvorte ho v prehliadači.</string>
<string name="viewer_too_large">Tento súbor je príliš veľký na zobrazenie; zobraziť možno najviac 1 MB.</string>
<string name="viewer_not_text">Toto nie je textový súbor, preto sa tu nezobrazuje.</string>
<string name="files">Súbory</string>
<string name="files_all">Všetky súbory</string>
<string name="files_empty">Zatiaľ tu nič nie je. Ani hobitia nora.</string>
<string name="settings">Nastavenia</string> <string name="settings">Nastavenia</string>
<string name="settings_instances">Inštancie</string> <string name="settings_instances">Inštancie</string>
<string name="sign_out">Odhlásiť sa</string> <string name="sign_out">Odhlásiť sa</string>
@@ -74,7 +154,6 @@
<string name="push_failed">Nebol zvolený žiadny distributor, takže upozornenia sú stále vypnuté.</string> <string name="push_failed">Nebol zvolený žiadny distributor, takže upozornenia sú stále vypnuté.</string>
<string name="channel_replies">Odpovede</string> <string name="channel_replies">Odpovede</string>
<string name="channel_asks">Otázky a schválenia</string> <string name="channel_asks">Otázky a schválenia</string>
<string name="channel_reports">Správy</string>
<string name="settings_assistant">Asistent</string> <string name="settings_assistant">Asistent</string>
<string name="assistant_explained">Nastavte LLeMbas ako digitálneho asistenta telefónu: zvoľte ho v Predvolené aplikácie › Digitálny asistent. Podržanie tlačidla napájania, gesto asistenta alebo skratka na uzamknutej obrazovke ho potom otvorí nad tým, čo je práve na obrazovke.</string> <string name="assistant_explained">Nastavte LLeMbas ako digitálneho asistenta telefónu: zvoľte ho v Predvolené aplikácie › Digitálny asistent. Podržanie tlačidla napájania, gesto asistenta alebo skratka na uzamknutej obrazovke ho potom otvorí nad tým, čo je práve na obrazovke.</string>
<string name="assistant_open_settings">Otvoriť nastavenia asistenta</string> <string name="assistant_open_settings">Otvoriť nastavenia asistenta</string>
+1 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Moria's --bg, the colour the launcher tile sits on. --> <!-- Moria's background (the bg token), the colour the launcher tile sits on. -->
<color name="launcher_background">#0B0D10</color> <color name="launcher_background">#0B0D10</color>
</resources> </resources>
+83 -4
View File
@@ -12,13 +12,18 @@
<string name="signin_open_browser">Open in the browser</string> <string name="signin_open_browser">Open in the browser</string>
<string name="signin_denied">The sign-in was refused.</string> <string name="signin_denied">The sign-in was refused.</string>
<string name="signin_expired">The code expired before it was approved. Try again.</string> <string name="signin_expired">The code expired before it was approved. Try again.</string>
<string name="signin_too_old">This instance has no app API yet. It needs LLeMbas 1.7.0 or newer.</string> <string name="signin_too_old">This instance runs an older LLeMbas. This app needs LLeMbas 2.0 or newer.</string>
<string name="signin_too_new">This instance speaks a newer app API than this app. Update the app.</string> <string name="signin_too_new">This instance speaks a newer app API than this app. Update the app.</string>
<string name="new_chat">New chat</string> <string name="new_chat">New chat</string>
<string name="tab_chats">Chats</string> <string name="tab_chats">Chats</string>
<string name="tab_agents">Agents</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_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="empty_chat">What shall we talk about?</string>
<string name="loading_line">Baking lembas…</string> <string name="loading_line">Baking lembas…</string>
<string name="archive">Archive</string> <string name="archive">Archive</string>
@@ -36,16 +41,79 @@
<string name="send">Send</string> <string name="send">Send</string>
<string name="stop">Stop</string> <string name="stop">Stop</string>
<string name="attach">Attach a file</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="dictate">Dictate</string>
<string name="remove">Remove</string> <string name="remove">Remove</string>
<string name="more">More</string> <string name="more">More</string>
<string name="back">Back</string> <string name="back">Back</string>
<string name="cancel">Cancel</string> <string name="cancel">Cancel</string>
<string name="close">Close</string> <string name="close">Close</string>
<string name="effort_off">Effort: off</string>
<string name="mode_plan">Plan</string> <string name="mode_plan">Plan</string>
<string name="mode_edit">Edit</string> <string name="mode_edit">Edit</string>
<string name="mode_manual">Manual</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_approval">Allow this?</string>
<string name="card_allow_once">Allow once</string> <string name="card_allow_once">Allow once</string>
<string name="card_allow_always">Always allow this</string> <string name="card_allow_always">Always allow this</string>
@@ -59,6 +127,18 @@
<string name="plan_revise">Revise</string> <string name="plan_revise">Revise</string>
<string name="plan_what_to_change">What should change?</string> <string name="plan_what_to_change">What should change?</string>
<string name="plan_carry_out">Carry out the plan</string> <string name="plan_carry_out">Carry out the plan</string>
<string name="shown">Shown</string>
<string name="viewer_open">Open</string>
<string name="viewer_open_browser">Open in the browser</string>
<string name="viewer_copy">Copy</string>
<string name="viewer_html_source">This is the page\'s source. Open it in the browser to see the page itself.</string>
<string name="viewer_long_markdown">A long file, so it is shown as plain text.</string>
<string name="viewer_unavailable">This server cannot hand the file to the app yet. Open it in the browser instead.</string>
<string name="viewer_too_large">This file is too large to show here; at most 1 MB can be shown.</string>
<string name="viewer_not_text">This is not a text file, so it is not shown here.</string>
<string name="files">Files</string>
<string name="files_all">All files</string>
<string name="files_empty">Nothing here yet. Not even a hobbit hole.</string>
<string name="settings">Settings</string> <string name="settings">Settings</string>
<string name="settings_instances">Instances</string> <string name="settings_instances">Instances</string>
<string name="sign_out">Sign out</string> <string name="sign_out">Sign out</string>
@@ -75,7 +155,6 @@
<string name="push_failed">No distributor was chosen, so notifications are still off.</string> <string name="push_failed">No distributor was chosen, so notifications are still off.</string>
<string name="channel_replies">Replies</string> <string name="channel_replies">Replies</string>
<string name="channel_asks">Questions and approvals</string> <string name="channel_asks">Questions and approvals</string>
<string name="channel_reports">Reports</string>
<string name="settings_assistant">Assistant</string> <string name="settings_assistant">Assistant</string>
<string name="assistant_explained">Make LLeMbas the phone\'s digital assistant: choose it under Default apps › Digital assistant app. Then holding the power button, the assist gesture or the lock screen\'s shortcut opens it over whatever is on screen.</string> <string name="assistant_explained">Make LLeMbas the phone\'s digital assistant: choose it under Default apps › Digital assistant app. Then holding the power button, the assist gesture or the lock screen\'s shortcut opens it over whatever is on screen.</string>
<string name="assistant_open_settings">Open the assistant settings</string> <string name="assistant_open_settings">Open the assistant settings</string>
+6
View File
@@ -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>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- A self-hosted instance often sits behind its owner's own certificate authority. Trusting <!-- A self-hosted instance often sits behind its owner's own certificate authority. Trusting
the CAs the person installed on this phone (Settings › Security › Install a certificate) the CAs the person installed on this phone (Settings › Security › Install a certificate)
is what lets the app reach it -- the same step the browser needs. No plain HTTP: a token is what lets the app reach it: the same step the browser needs. No plain HTTP: a token
goes with every request. --> goes with every request. -->
<network-security-config> <network-security-config>
<base-config cleartextTrafficPermitted="false"> <base-config cleartextTrafficPermitted="false">
@@ -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,18 +1,24 @@
package eu.llembas.android package eu.llembas.android
import eu.llembas.android.api.AgentTarget
import eu.llembas.android.api.ApiClient import eu.llembas.android.api.ApiClient
import eu.llembas.android.api.ApiException import eu.llembas.android.api.ApiException
import eu.llembas.android.api.CardAnswer import eu.llembas.android.api.CardAnswer
import eu.llembas.android.api.ShowCard
import eu.llembas.android.api.normaliseBase import eu.llembas.android.api.normaliseBase
import eu.llembas.android.ui.unreachable
import kotlinx.coroutines.test.runTest import kotlinx.coroutines.test.runTest
import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer import okhttp3.mockwebserver.MockWebServer
import org.junit.After import org.junit.After
import org.junit.Assert.assertEquals import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue import org.junit.Assert.assertTrue
import org.junit.Assert.fail import org.junit.Assert.fail
import org.junit.Before import org.junit.Before
import org.junit.Test import org.junit.Test
import java.net.ConnectException
import java.net.UnknownHostException
class ClientTest { class ClientTest {
private lateinit var server: MockWebServer private lateinit var server: MockWebServer
@@ -33,6 +39,35 @@ class ClientTest {
assertEquals("http://10.1.2.3:8080", normaliseBase("http://10.1.2.3:8080")) 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 @Test
fun everyCallCarriesTheToken() = runTest { fun everyCallCarriesTheToken() = runTest {
server.enqueue(MockResponse().setBody("""{"api":1,"account":{"name":"Frodo","email":"f@shire.test"}}""")) server.enqueue(MockResponse().setBody("""{"api":1,"account":{"name":"Frodo","email":"f@shire.test"}}"""))
@@ -61,4 +96,39 @@ class ClientTest {
val body = server.takeRequest().body.readUtf8() val body = server.takeRequest().body.readUtf8()
assertTrue(body, body.contains(""""choices":{"q0":["Tea"]}""")) assertTrue(body, body.contains(""""choices":{"q0":["Tea"]}"""))
} }
@Test
fun aShownFileIsTheShowRouteAsPlainText() = runTest {
server.enqueue(MockResponse().setHeader("Content-Type", "text/plain; charset=utf-8").setBody("# Lembas\n"))
server.enqueue(MockResponse().setBody("x"))
val api = client()
val tree = ShowCard(path = "/home/frodo/recipe.md", nodeId = "node1", versionId = "ver1")
assertEquals("# Lembas\n", api.shownText("chat1", tree))
assertEquals("/api/v2/chats/chat1/show?node=node1&version=ver1", server.takeRequest().path)
api.shownText("chat1", ShowCard(path = "src/oven.py", source = "device", shownId = "shown1"))
assertEquals("/api/v2/chats/chat1/show?shown=shown1", server.takeRequest().path)
}
@Test
fun aShownFileTheServerWillNotGiveIsItsStatus() = runTest {
server.enqueue(MockResponse().setResponseCode(415).setBody("""{"detail":"This is not a text file, so it is not shown here."}"""))
try {
client().shownText("chat1", ShowCard(nodeId = "n", versionId = "v"))
fail("a 415 must throw")
} catch (e: ApiException) {
assertEquals(415, e.status)
assertEquals("This is not a text file, so it is not shown here.", e.message)
}
}
@Test
fun theFilesRoutesTakeThePathAsAQuery() = runTest {
server.enqueue(MockResponse().setBody("""{"path":"/home/frodo","parent":"/home","entries":[]}"""))
server.enqueue(MockResponse().setBody("""{"path":"/home/frodo/a b.md","name":"a b.md","text":"hi"}"""))
val api = client()
assertEquals("/home", api.files("/home/frodo").parent)
assertEquals("/api/v2/files?path=%2Fhome%2Ffrodo", server.takeRequest().path)
assertEquals("hi", api.fileContent("/home/frodo/a b.md").text)
assertEquals("/api/v2/files/content?path=%2Fhome%2Ffrodo%2Fa%20b.md", server.takeRequest().path)
}
} }
@@ -1,8 +1,11 @@
package eu.llembas.android package eu.llembas.android
import eu.llembas.android.api.APP_API
import eu.llembas.android.api.AskFrame import eu.llembas.android.api.AskFrame
import eu.llembas.android.api.Chat import eu.llembas.android.api.Chat
import eu.llembas.android.api.DoneFrame import eu.llembas.android.api.DoneFrame
import eu.llembas.android.api.FileContent
import eu.llembas.android.api.FileListing
import eu.llembas.android.api.JobsFrame import eu.llembas.android.api.JobsFrame
import eu.llembas.android.api.LembasJson import eu.llembas.android.api.LembasJson
import eu.llembas.android.api.LiveReply import eu.llembas.android.api.LiveReply
@@ -13,8 +16,12 @@ import eu.llembas.android.api.StatusFrame
import eu.llembas.android.api.SteeredFrame import eu.llembas.android.api.SteeredFrame
import eu.llembas.android.api.StepsFrame import eu.llembas.android.api.StepsFrame
import eu.llembas.android.api.Tail import eu.llembas.android.api.Tail
import eu.llembas.android.api.ToolCall
import kotlinx.serialization.KSerializer import kotlinx.serialization.KSerializer
import kotlinx.serialization.builtins.ListSerializer
import kotlinx.serialization.json.jsonObject
import org.junit.Assert.assertEquals import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue import org.junit.Assert.assertTrue
@@ -32,7 +39,67 @@ class ContractTest {
@Test @Test
fun theVersionIsOneThisAppReads() { fun theVersionIsOneThisAppReads() {
val version = LembasJson.parseToJsonElement(text("version")).toString() val version = LembasJson.parseToJsonElement(text("version")).toString()
assertEquals("""{"app_api":1}""", version) assertEquals("""{"app_api":$APP_API}""", version)
}
@Test
fun aShowCardFromTheTreeAndOneFromADevice() {
// The server's own `show` cards (`tool_show.json`): what the app reads them by, and the
// query that fetches the text from `GET /api/v2/chats/{chat}/show`.
val calls = LembasJson.parseToJsonElement(text("tool_show")).jsonObject.getValue("calls")
val (tree, device) = LembasJson.decodeFromJsonElement(ListSerializer(ToolCall.serializer()), calls)
val show = tree.show!!
assertEquals("show", tree.name)
assertEquals("recipe.md", show.name)
assertEquals("/home/frodo/recipe.md", show.path)
assertEquals("markdown", show.viewKind)
assertEquals(3, show.line)
assertEquals(120L, show.size)
assertEquals(listOf("node" to "node1", "version" to "ver1"), show.query)
val kept = device.show!!
assertEquals("device", kept.source)
assertEquals("code", kept.viewKind)
assertEquals("python", kept.language)
// `line: null` reads as no line, and the tree's two ids are empty on a device's card.
assertEquals(0, kept.line)
assertEquals(listOf("shown" to "shown1"), kept.query)
}
@Test
fun aDirectoryOfThePersonsFiles() {
val listing = read("files_listing", FileListing.serializer())
assertEquals("/home/frodo", listing.path)
assertEquals("/home", listing.parent)
assertEquals(listOf("recipes", "lembas.md"), listing.entries.map { it.name })
assertTrue(listing.entries[0].isFolder)
val file = listing.entries[1]
assertFalse(file.isFolder)
assertEquals(27L, file.size)
assertEquals("text/markdown", file.mime)
}
@Test
fun aFileAndAWithheldOne() {
val file = read("file_content", FileContent.serializer())
assertNull(file.withheld)
assertEquals("markdown", file.viewKind)
assertTrue(file.text.startsWith("# Lembas"))
val image = read("file_content_withheld", FileContent.serializer())
assertEquals("", image.text)
assertEquals("not_text", image.withheld!!.reason)
assertTrue(image.withheld!!.message.isNotBlank())
// An image is no kind the viewer draws, so if its text ever came it would be plain text.
assertEquals("text", image.viewKind)
}
@Test
fun theTwoPointOhContractHasNoCanvas() {
// LLeMbas 2.0 removed the canvas: no `canvas` frame, so no fixture for one. A stream
// that still sends it (a 1.x server) is ignored frame by frame, as any unknown event is.
assertNull(javaClass.classLoader!!.getResource("event_canvas.json"))
assertEquals(LiveReply("m"), LiveReply("m").apply("canvas", """{"tabs": [], "active": ""}"""))
} }
@Test @Test
@@ -0,0 +1,45 @@
package eu.llembas.android
import eu.llembas.android.api.Discovery
import eu.llembas.android.api.LembasJson
import eu.llembas.android.api.ServerFit
import eu.llembas.android.api.ToolCall
import eu.llembas.android.api.fit
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
/**
* What the server's contract fixtures cannot say: how the app reads a `show` card the server
* never wrote (an unknown kind), and which servers it works with at all. The server's own `show`
* cards are in `contract/tool_show.json` and read by `ContractTest`.
*/
class ShowAndServerTest {
private fun call(json: String) = LembasJson.decodeFromString(ToolCall.serializer(), json)
@Test
fun anUnknownKindIsPlainText() {
val c = call("""{"name": "show", "show": {"path": "x.svg", "kind": "svg"}}""")
assertEquals("text", c.show!!.viewKind)
assertNull(call("""{"name": "bash"}""").show)
}
private fun discovery(json: String) = LembasJson.decodeFromString(Discovery.serializer(), json)
@Test
fun onlyAServerOnTheTwoPointOhProtocolAndAppApiTwoFits() {
val two = """{"service": "lembas", "version": "2.0.0-beta.1", "protocol": 3, "protocols": [3],
"app_api": 2, "scopes": ["app", "models"]}"""
assertEquals(ServerFit.FITS, fit(discovery(two)))
// A 2.0 `dev` server from before the show route and the files: protocol 3, app API 1.
assertEquals(ServerFit.TOO_OLD, fit(discovery(two.replace("\"app_api\": 2", "\"app_api\": 1"))))
// 1.7: protocol 2, the app API already there -- and still refused.
val old = """{"service": "lembas", "version": "1.7.3", "protocol": 2, "protocols": [1, 2],
"app_api": 1, "scopes": ["app", "models"]}"""
assertEquals(ServerFit.TOO_OLD, fit(discovery(old)))
// A server with no protocol at all is older still.
assertEquals(ServerFit.TOO_OLD, fit(discovery("""{"service": "lembas", "app_api": 2, "scopes": ["app"]}""")))
assertEquals(ServerFit.TOO_NEW, fit(discovery(two.replace("\"app_api\": 2", "\"app_api\": 3"))))
assertEquals(ServerFit.NOT_LEMBAS, fit(discovery("""{"service": "other", "protocol": 3}""")))
}
}
Binary file not shown.
+185
View File
@@ -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
}
}
+98
View File
@@ -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
}
]
}
+5
View File
@@ -12,7 +12,12 @@
"mode": "", "mode": "",
"effort": "low", "effort": "low",
"device": null, "device": null,
"device_session_id": null,
"parent_chat_id": null, "parent_chat_id": null,
"agents": {
"min": 1,
"max": 4
},
"created_at": "2026-01-02T03:04:05+00:00", "created_at": "2026-01-02T03:04:05+00:00",
"updated_at": "2026-01-02T03:04:05+00:00" "updated_at": "2026-01-02T03:04:05+00:00"
} }
+5
View File
@@ -15,7 +15,12 @@
"token_id": "token1", "token_id": "token1",
"directory": "/home/dev/project" "directory": "/home/dev/project"
}, },
"device_session_id": "ses_01waybread",
"parent_chat_id": null, "parent_chat_id": null,
"agents": {
"min": 1,
"max": 4
},
"created_at": "2026-01-02T03:04:05+00:00", "created_at": "2026-01-02T03:04:05+00:00",
"updated_at": "2026-01-02T03:04:05+00:00" "updated_at": "2026-01-02T03:04:05+00:00"
} }
+14
View File
@@ -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
}
}
-9
View File
@@ -1,9 +0,0 @@
{
"tabs": [
{
"path": "recipe.md",
"title": "recipe.md"
}
],
"active": "recipe.md"
}
+10
View File
@@ -0,0 +1,10 @@
{
"path": "/home/frodo/lembas.md",
"name": "lembas.md",
"size": 27,
"mime": "text/markdown",
"kind": "markdown",
"language": "markdown",
"sha": "abababababababababababababababababababababababababababababababab",
"text": "# Lembas\n\nWrap it in a leaf.\n"
}
+14
View File
@@ -0,0 +1,14 @@
{
"path": "/home/frodo/map.png",
"name": "map.png",
"size": 2048,
"mime": "image/png",
"kind": "image",
"language": "",
"sha": "abababababababababababababababababababababababababababababababab",
"text": "",
"withheld": {
"reason": "not_text",
"message": "This is not a text file, so it is not shown here."
}
}
+22
View File
@@ -0,0 +1,22 @@
{
"path": "/home/frodo",
"parent": "/home",
"entries": [
{
"name": "recipes",
"path": "/home/frodo/recipes",
"kind": "dir",
"size": 0,
"mime": "",
"updated_at": "2026-01-02T03:04:05+00:00"
},
{
"name": "lembas.md",
"path": "/home/frodo/lembas.md",
"kind": "file",
"size": 27,
"mime": "text/markdown",
"updated_at": "2026-01-02T03:04:05+00:00"
}
]
}
+3 -3
View File
@@ -1,5 +1,5 @@
{ {
"ref": "v1.7.0", "ref": "v2.0.0-beta.5",
"commit": "d9592e2d0f67f62d093149f0a1a0b15b8f4c91c6", "commit": "02d0c874434e3b726193bf94fb9741b4f8d0a22c",
"sha256": "7d0814e428195d1236e4ebaf5d5d8cf6d73900e62824cea143f517ed4cceba34" "sha256": "3dccc2ca7eb5789b71506edeaeffe93acc95e05c2cc4c31eabde164546c4dea3"
} }
+64
View File
@@ -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
}
]
}
+65
View File
@@ -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
}
}
+57
View File
@@ -0,0 +1,57 @@
{
"calls": [
{
"id": "call2",
"name": "show",
"status": "ok",
"query": "/home/frodo/recipe.md",
"path": "/home/frodo/recipe.md",
"show": {
"path": "/home/frodo/recipe.md",
"name": "recipe.md",
"kind": "markdown",
"language": "markdown",
"line": 3,
"node_id": "node1",
"version_id": "ver1",
"sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"size": 120,
"mime": "text/markdown"
},
"block": {
"kind": "tool",
"title": "/home/frodo/recipe.md",
"chips": [],
"added": 0,
"removed": 0
}
},
{
"id": "call3",
"name": "show",
"status": "ok",
"path": "src/oven.py",
"show": {
"path": "src/oven.py",
"name": "oven.py",
"kind": "code",
"language": "python",
"line": null,
"node_id": "",
"version_id": "",
"sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"size": 64,
"mime": "text/x-python",
"source": "device",
"shown_id": "shown1"
},
"block": {
"kind": "tool",
"title": "",
"chips": [],
"added": 0,
"removed": 0
}
}
]
}
+1 -1
View File
@@ -1 +1 @@
{"app_api": 1} {"app_api": 2}
+1 -1
View File
@@ -33,7 +33,7 @@ LOCK = ROOT / "tokens.lock.json"
NAMES = ( NAMES = (
"bg", "bg-sunken", "surface", "surface-raised", "surface-hover", "surface-active", "bg", "bg-sunken", "surface", "surface-raised", "surface-hover", "surface-active",
"border", "border-strong", "ink", "ink-muted", "ink-faint", "ink-inverse", "border", "border-strong", "ink", "ink-muted", "ink-faint", "ink-inverse",
"accent", "accent-hover", "accent-ink", "accent-soft", "leaf", "danger", "danger-soft", "accent", "accent-hover", "accent-ink", "accent-soft", "selection", "leaf", "danger", "danger-soft",
"success", "success-soft", "warning", "warning-soft", "bubble-user", "code-bg", "code-border", "success", "success-soft", "warning", "warning-soft", "bubble-user", "code-bg", "code-border",
) )
+58 -8
View File
@@ -2,8 +2,15 @@
"""Write the app's string resources: English from `strings.py`, the eight translations from """Write the app's string resources: English from `strings.py`, the eight translations from
the server's catalogues and `strings_own.json`. See `strings.py` for the rule. the server's catalogues and `strings_own.json`. See `strings.py` for the rule.
scripts/gen-strings.py (server at ../LLeMbas, or LEMBAS_SERVER) scripts/gen-strings.py <server-ref> the catalogues at that ref of the server's git checkout
scripts/gen-strings.py --check fail if a key the code uses has no English, or the other way round (../LLeMbas, or LEMBAS_SERVER) -- the same ref the
contract and the tokens are pinned to
scripts/gen-strings.py the server's working tree as it is
scripts/gen-strings.py --check fail if a key the code uses has no English, or the other
way round
A ref, not the working tree, is the way to regenerate: the server's checkout is shared, and
whatever is uncommitted in it is not what a released server says.
""" """
from __future__ import annotations from __future__ import annotations
@@ -12,6 +19,7 @@ import importlib.util
import json import json
import os import os
import re import re
import subprocess
import sys import sys
from pathlib import Path from pathlib import Path
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
@@ -23,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. -->" HEADER = "<!-- Generated by scripts/gen-strings.py. Edit scripts/strings.py or strings_own.json. -->"
sys.path.insert(0, str(Path(__file__).parent)) 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: def android(text: str) -> str:
@@ -31,8 +39,18 @@ def android(text: str) -> str:
return escape(text).replace("'", "\\'").replace('"', '\\"') return escape(text).replace("'", "\\'").replace('"', '\\"')
def server_catalogue(code: str) -> dict[str, str]: def server_catalogue(code: str, ref: str | None = None) -> dict[str, str]:
path = SERVER / "src/lembas/web/i18n" / f"{code}.py" path = SERVER / "src/lembas/web/i18n" / f"{code}.py"
if ref:
shown = subprocess.run(
["git", "-C", str(SERVER), "show", f"{ref}:src/lembas/web/i18n/{code}.py"],
capture_output=True, text=True,
)
if shown.returncode != 0:
return {}
scope: dict = {"__name__": f"catalogue_{code}"}
exec(compile(shown.stdout, f"{ref}:{code}.py", "exec"), scope) # the server's own file
return dict(scope.get("MESSAGES", {}))
if not path.exists(): if not path.exists():
return {} return {}
spec = importlib.util.spec_from_file_location(f"catalogue_{code}", path) spec = importlib.util.spec_from_file_location(f"catalogue_{code}", path)
@@ -42,6 +60,31 @@ def server_catalogue(code: str) -> dict[str, str]:
return dict(getattr(module, "MESSAGES", {})) 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]: def used_keys() -> set[str]:
keys: set[str] = set() keys: set[str] = set()
for path in (ROOT / "app/src").rglob("*"): for path in (ROOT / "app/src").rglob("*"):
@@ -71,20 +114,27 @@ def main() -> None:
if "--check" in sys.argv: if "--check" in sys.argv:
print(f"gen-strings: {len(STRINGS)} strings, all used") print(f"gen-strings: {len(STRINGS)} strings, all used")
return return
args = [a for a in sys.argv[1:] if not a.startswith("--")]
ref = None
if args:
ref = subprocess.run(
["git", "-C", str(SERVER), "rev-parse", "--verify", f"{args[0]}^{{commit}}"],
capture_output=True, text=True, check=True,
).stdout.strip()
own = json.loads((Path(__file__).parent / "strings_own.json").read_text(encoding="utf-8")) own = json.loads((Path(__file__).parent / "strings_own.json").read_text(encoding="utf-8"))
write(RES / "values", STRINGS) write(RES / "values", STRINGS)
for code in LANGS: for code in LANGS:
catalogue = server_catalogue(code) catalogue = server_catalogue(code, ref)
mine = own.get(code, {}) mine = own.get(code, {})
out = {} out = {}
for key, english in STRINGS.items(): for key, english in STRINGS.items():
if key == "app_name": if key == "app_name":
continue continue
text = mine.get(key) or catalogue.get(english) text = mine.get(key) or server_text(catalogue, key, english)
if text and text.count("%1$s") == english.count("%1$s"): if text and all(text.count(f"%{i}$s") == english.count(f"%{i}$s") for i in (1, 2, 3)):
out[key] = text out[key] = text
write(RES / f"values-{code}", out) write(RES / f"values-{code}", out)
print(f"gen-strings: {code}: {len(out)}/{len(STRINGS) - 1}") print(f"gen-strings: {code}: {len(out)}/{len(STRINGS) - 1}" + (f" (server {ref[:12]})" if ref else ""))
if __name__ == "__main__": if __name__ == "__main__":
+104 -4
View File
@@ -23,14 +23,19 @@ STRINGS: dict[str, str] = {
"signin_open_browser": "Open in the browser", "signin_open_browser": "Open in the browser",
"signin_denied": "The sign-in was refused.", "signin_denied": "The sign-in was refused.",
"signin_expired": "The code expired before it was approved. Try again.", "signin_expired": "The code expired before it was approved. Try again.",
"signin_too_old": "This instance has no app API yet. It needs LLeMbas 1.7.0 or newer.", "signin_too_old": "This instance runs an older LLeMbas. This app needs LLeMbas 2.0 or newer.",
"signin_too_new": "This instance speaks a newer app API than this app. Update the app.", "signin_too_new": "This instance speaks a newer app API than this app. Update the app.",
# Chats # Chats
"new_chat": "New chat", "new_chat": "New chat",
"tab_chats": "Chats", "tab_chats": "Chats",
"tab_agents": "Agents", "tab_agents": "Agents",
"empty_chats": "No chats yet. Not all those who wander are lost — start one.", "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?", "empty_chat": "What shall we talk about?",
"loading_line": "Baking lembas…", "loading_line": "Baking lembas…",
"archive": "Archive", "archive": "Archive",
@@ -48,16 +53,80 @@ STRINGS: dict[str, str] = {
"send": "Send", "send": "Send",
"stop": "Stop", "stop": "Stop",
"attach": "Attach a file", "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", "dictate": "Dictate",
"remove": "Remove", "remove": "Remove",
"more": "More", "more": "More",
"back": "Back", "back": "Back",
"cancel": "Cancel", "cancel": "Cancel",
"close": "Close", "close": "Close",
"effort_off": "Effort: off",
"mode_plan": "Plan", "mode_plan": "Plan",
"mode_edit": "Edit", "mode_edit": "Edit",
"mode_manual": "Manual", "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 # Cards
"card_approval": "Allow this?", "card_approval": "Allow this?",
"card_allow_once": "Allow once", "card_allow_once": "Allow once",
@@ -72,6 +141,20 @@ STRINGS: dict[str, str] = {
"plan_revise": "Revise", "plan_revise": "Revise",
"plan_what_to_change": "What should change?", "plan_what_to_change": "What should change?",
"plan_carry_out": "Carry out the plan", "plan_carry_out": "Carry out the plan",
# The file viewer (a `show` card)
"shown": "Shown",
"viewer_open": "Open",
"viewer_open_browser": "Open in the browser",
"viewer_copy": "Copy",
"viewer_html_source": "This is the page's source. Open it in the browser to see the page itself.",
"viewer_long_markdown": "A long file, so it is shown as plain text.",
"viewer_unavailable": "This server cannot hand the file to the app yet. Open it in the browser instead.",
"viewer_too_large": "This file is too large to show here; at most 1 MB can be shown.",
"viewer_not_text": "This is not a text file, so it is not shown here.",
# Files (the person's tree, read-only)
"files": "Files",
"files_all": "All files",
"files_empty": "Nothing here yet. Not even a hobbit hole.",
# Settings # Settings
"settings": "Settings", "settings": "Settings",
"settings_instances": "Instances", "settings_instances": "Instances",
@@ -89,7 +172,6 @@ STRINGS: dict[str, str] = {
"push_failed": "No distributor was chosen, so notifications are still off.", "push_failed": "No distributor was chosen, so notifications are still off.",
"channel_replies": "Replies", "channel_replies": "Replies",
"channel_asks": "Questions and approvals", "channel_asks": "Questions and approvals",
"channel_reports": "Reports",
"settings_assistant": "Assistant", "settings_assistant": "Assistant",
"assistant_explained": "Make LLeMbas the phone's digital assistant: choose it under Default apps › Digital assistant app. Then holding the power button, the assist gesture or the lock screen's shortcut opens it over whatever is on screen.", "assistant_explained": "Make LLeMbas the phone's digital assistant: choose it under Default apps › Digital assistant app. Then holding the power button, the assist gesture or the lock screen's shortcut opens it over whatever is on screen.",
"assistant_open_settings": "Open the assistant settings", "assistant_open_settings": "Open the assistant settings",
@@ -114,3 +196,21 @@ STRINGS: dict[str, str] = {
"share_sending": "Sending to LLeMbas…", "share_sending": "Sending to LLeMbas…",
"share_default_prompt": "Have a look at this.", "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",
}
+186 -39
View File
@@ -2,6 +2,12 @@
"cs": { "cs": {
"about_version": "LLeMbas pro Android %1$s", "about_version": "LLeMbas pro Android %1$s",
"add_instance": "Přidat instanci", "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", "archive": "Archivovat",
"assist_hint": "Zeptejte se na cokoli", "assist_hint": "Zeptejte se na cokoli",
"assist_include_screen": "Zahrnout obrazovku", "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_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é", "assistant_temporary": "Konverzace s asistentem jsou dočasné",
"attach": "Přiložit soubor", "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_allow_once": "Povolit jednou",
"card_answer": "Vaše odpověď", "card_answer": "Vaše odpověď",
"card_approval": "Povolit to?", "card_approval": "Povolit to?",
"card_reason": "Proč ne? (nepovinné)", "card_reason": "Proč ne? (nepovinné)",
"channel_asks": "Otázky a schválení", "channel_asks": "Otázky a schválení",
"device_name": "LLeMbas pro Android", "device_name": "LLeMbas pro Android",
"effort_off": "Úsilí: vypnuto", "effort_level": "Náročnost: %1$s",
"empty_agents": "Žádné konverzace s agentem. Spusťte jednu z webového rozhraní na propojeném zařízení.", "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_chat": "O čem si promluvíme?",
"empty_chats": "Zatím žádné konverzace. Ne všichni, kdo bloudí, jsou ztraceni — založte jednu.", "empty_chats": "Zatím žádné konverzace. Ne všichni, kdo bloudí, jsou ztraceni — založte jednu.",
"listening": "Naslouchám…", "listening": "Naslouchám…",
"loading_line": "Pečou se lembasy…", "loading_line": "Pečou se lembasy…",
"mode_manual": "Manual", "mode_manual": "Ručně",
"more": "Více", "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", "older": "Starší zprávy",
"output_cut": "Výstup je zde zkrácen. Celý ho najdete na webové stránce.", "output_cut": "Výstup je zde zkrácen. Celý ho najdete na webové stránce.",
"plan_approve": "Schválit plán", "plan_approve": "Schválit plán",
@@ -45,6 +56,7 @@
"share_default_prompt": "Podívejte se na tohle.", "share_default_prompt": "Podívejte se na tohle.",
"share_label": "Zeptat se LLeMbas", "share_label": "Zeptat se LLeMbas",
"share_sending": "Odesílá se do LLeMbas…", "share_sending": "Odesílá se do LLeMbas…",
"shown": "Zobrazeno",
"signin_address": "Adresa instance", "signin_address": "Adresa instance",
"signin_code_intro": "Otevřete instanci v prohlížeči, přihlaste se a schvalte tento kód:", "signin_code_intro": "Otevřete instanci v prohlížeči, přihlaste se a schvalte tento kód:",
"signin_denied": "Přihlášení bylo odmítnuto.", "signin_denied": "Přihlášení bylo odmítnuto.",
@@ -52,7 +64,8 @@
"signin_intro": "Přihlaste se k instanci LLeMbas. Tento telefon schválíte v prohlížeči, stejně jako u CLI.", "signin_intro": "Přihlaste se k instanci LLeMbas. Tento telefon schválíte v prohlížeči, stejně jako u CLI.",
"signin_open_browser": "Otevřít v prohlížeči", "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_new": "Tato instance používá novější rozhraní API pro aplikace než tato aplikace. Aktualizujte aplikaci.",
"signin_too_old": "Tato instance ještě nemá rozhraní API pro aplikace. Potřebuje LLeMbas 1.7.0 nebo novější.", "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_moria": "Moria (temná)",
"theme_shire": "Shire (světlý)", "theme_shire": "Shire (světlý)",
"theme_system": "Podle systému", "theme_system": "Podle systému",
@@ -62,11 +75,22 @@
"update_check": "Zkontrolovat aktualizaci", "update_check": "Zkontrolovat aktualizaci",
"update_installing": "Instaluje se %1$s…", "update_installing": "Instaluje se %1$s…",
"update_none": "Toto je nejnovější verze.", "update_none": "Toto je nejnovější verze.",
"update_unreachable": "Aktualizaci se nepodařilo stáhnout." "update_unreachable": "Aktualizaci se nepodařilo stáhnout.",
"viewer_html_source": "Toto je zdrojový kód stránky. Samotnou stránku uvidíte po otevření v prohlížeči.",
"viewer_long_markdown": "Dlouhý soubor, proto je zobrazen jako prostý text.",
"viewer_open_browser": "Otevřít v prohlížeči",
"viewer_too_large": "Tento soubor je příliš velký na zobrazení; zobrazit lze nejvýše 1 MB.",
"viewer_unavailable": "Tento server zatím aplikaci soubor předat neumí. Otevřete ho v prohlížeči."
}, },
"de": { "de": {
"about_version": "LLeMbas für Android %1$s", "about_version": "LLeMbas für Android %1$s",
"add_instance": "Instanz hinzufügen", "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", "archive": "Archivieren",
"assist_hint": "Fragen Sie irgendetwas", "assist_hint": "Fragen Sie irgendetwas",
"assist_include_screen": "Bildschirm einbeziehen", "assist_include_screen": "Bildschirm einbeziehen",
@@ -79,20 +103,26 @@
"assistant_samsung": "Auf Samsung-Telefonen: Einstellungen › Erweiterte Funktionen › Seitentaste › Gedrückt halten › Digitaler Assistent.", "assistant_samsung": "Auf Samsung-Telefonen: Einstellungen › Erweiterte Funktionen › Seitentaste › Gedrückt halten › Digitaler Assistent.",
"assistant_temporary": "Assistenten-Chats sind temporär", "assistant_temporary": "Assistenten-Chats sind temporär",
"attach": "Datei anhängen", "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_allow_once": "Einmal erlauben",
"card_answer": "Ihre Antwort", "card_answer": "Ihre Antwort",
"card_approval": "Das erlauben?", "card_approval": "Das erlauben?",
"card_reason": "Warum nicht? (optional)", "card_reason": "Warum nicht? (optional)",
"channel_asks": "Fragen und Bestätigungen", "channel_asks": "Fragen und Bestätigungen",
"device_name": "LLeMbas für Android", "device_name": "LLeMbas für Android",
"effort_off": "Aufwand: aus", "effort_level": "Denkaufwand: %1$s",
"empty_agents": "Keine Agent-Chats. Starten Sie einen über die Weboberfläche auf einem verknüpften Gerät.", "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_chat": "Worüber sprechen wir?",
"empty_chats": "Noch keine Chats. Nicht jeder, der wandert, ist verloren — fangen Sie einen an.", "empty_chats": "Noch keine Chats. Nicht jeder, der wandert, ist verloren — fangen Sie einen an.",
"listening": "Hört zu…", "listening": "Hört zu…",
"loading_line": "Lembas wird gebacken…", "loading_line": "Lembas wird gebacken…",
"mode_manual": "Manual", "mode_manual": "Manuell",
"mode_plan": "Plan",
"more": "Mehr", "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", "older": "Frühere Nachrichten",
"output_cut": "Die Ausgabe ist hier verkürzt. Vollständig finden Sie sie auf der Webseite.", "output_cut": "Die Ausgabe ist hier verkürzt. Vollständig finden Sie sie auf der Webseite.",
"plan_approve": "Plan bestätigen", "plan_approve": "Plan bestätigen",
@@ -110,6 +140,7 @@
"share_default_prompt": "Schauen Sie sich das an.", "share_default_prompt": "Schauen Sie sich das an.",
"share_label": "LLeMbas fragen", "share_label": "LLeMbas fragen",
"share_sending": "Wird an LLeMbas gesendet…", "share_sending": "Wird an LLeMbas gesendet…",
"shown": "Angezeigt",
"signin_address": "Adresse der Instanz", "signin_address": "Adresse der Instanz",
"signin_code_intro": "Öffnen Sie die Instanz im Browser, melden Sie sich an und bestätigen Sie diesen Code:", "signin_code_intro": "Öffnen Sie die Instanz im Browser, melden Sie sich an und bestätigen Sie diesen Code:",
"signin_denied": "Die Anmeldung wurde abgelehnt.", "signin_denied": "Die Anmeldung wurde abgelehnt.",
@@ -117,7 +148,8 @@
"signin_intro": "Melden Sie sich bei einer LLeMbas-Instanz an. Sie bestätigen dieses Telefon im Browser, genau wie bei der CLI.", "signin_intro": "Melden Sie sich bei einer LLeMbas-Instanz an. Sie bestätigen dieses Telefon im Browser, genau wie bei der CLI.",
"signin_open_browser": "Im Browser öffnen", "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_new": "Diese Instanz spricht eine neuere App-API als diese App. Aktualisieren Sie die App.",
"signin_too_old": "Diese Instanz hat noch keine App-API. Sie braucht LLeMbas 1.7.0 oder neuer.", "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_moria": "Moria (dunkel)",
"theme_shire": "Shire (hell)", "theme_shire": "Shire (hell)",
"theme_system": "Wie das System", "theme_system": "Wie das System",
@@ -127,11 +159,22 @@
"update_check": "Nach einem Update suchen", "update_check": "Nach einem Update suchen",
"update_installing": "%1$s wird installiert…", "update_installing": "%1$s wird installiert…",
"update_none": "Dies ist die neueste Version.", "update_none": "Dies ist die neueste Version.",
"update_unreachable": "Das Update konnte nicht abgerufen werden." "update_unreachable": "Das Update konnte nicht abgerufen werden.",
"viewer_html_source": "Das ist der Quelltext der Seite. Die Seite selbst sehen Sie im Browser.",
"viewer_long_markdown": "Eine lange Datei, daher wird sie als reiner Text angezeigt.",
"viewer_open_browser": "Im Browser öffnen",
"viewer_too_large": "Diese Datei ist zu groß zum Anzeigen; höchstens 1 MB kann angezeigt werden.",
"viewer_unavailable": "Dieser Server kann die Datei der App noch nicht übergeben. Öffnen Sie sie stattdessen im Browser."
}, },
"es": { "es": {
"about_version": "LLeMbas para Android %1$s", "about_version": "LLeMbas para Android %1$s",
"add_instance": "Añadir una instancia", "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", "archive": "Archivar",
"assist_hint": "Pregunte lo que quiera", "assist_hint": "Pregunte lo que quiera",
"assist_include_screen": "Incluir pantalla", "assist_include_screen": "Incluir pantalla",
@@ -144,20 +187,25 @@
"assistant_samsung": "En los teléfonos Samsung: Ajustes › Funciones avanzadas › Botón lateral › Mantener pulsado › Asistente digital.", "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", "assistant_temporary": "Los chats del asistente son temporales",
"attach": "Adjuntar un archivo", "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_allow_once": "Permitir una vez",
"card_answer": "Su respuesta", "card_answer": "Su respuesta",
"card_approval": "¿Permitir esto?", "card_approval": "¿Permitir esto?",
"card_reason": "¿Por qué no? (opcional)", "card_reason": "¿Por qué no? (opcional)",
"channel_asks": "Preguntas y aprobaciones", "channel_asks": "Preguntas y aprobaciones",
"device_name": "LLeMbas para Android", "device_name": "LLeMbas para Android",
"effort_off": "Esfuerzo: desactivado", "effort_level": "Esfuerzo: %1$s",
"empty_agents": "No hay chats de agente. Inicie uno desde la interfaz web en un dispositivo vinculado.", "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_chat": "¿De qué hablamos?",
"empty_chats": "Aún no hay chats. No todos los que vagan están perdidos — empiece uno.", "empty_chats": "Aún no hay chats. No todos los que vagan están perdidos — empiece uno.",
"listening": "Escuchando…", "listening": "Escuchando…",
"loading_line": "Horneando lembas…", "loading_line": "Horneando lembas…",
"mode_manual": "Manual", "mode_manual": "Manual",
"more": "Más", "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", "older": "Mensajes anteriores",
"output_cut": "La salida está acortada aquí. La tiene completa en la página web.", "output_cut": "La salida está acortada aquí. La tiene completa en la página web.",
"plan_approve": "Aprobar el plan", "plan_approve": "Aprobar el plan",
@@ -175,6 +223,7 @@
"share_default_prompt": "Échele un vistazo a esto.", "share_default_prompt": "Échele un vistazo a esto.",
"share_label": "Preguntar a LLeMbas", "share_label": "Preguntar a LLeMbas",
"share_sending": "Enviando a LLeMbas…", "share_sending": "Enviando a LLeMbas…",
"shown": "Mostrado",
"signin_address": "Dirección de la instancia", "signin_address": "Dirección de la instancia",
"signin_code_intro": "Abra la instancia en el navegador, inicie sesión y apruebe este código:", "signin_code_intro": "Abra la instancia en el navegador, inicie sesión y apruebe este código:",
"signin_denied": "El inicio de sesión fue rechazado.", "signin_denied": "El inicio de sesión fue rechazado.",
@@ -182,7 +231,8 @@
"signin_intro": "Inicie sesión en una instancia de LLeMbas. Aprobará este teléfono en el navegador, igual que haría con la CLI.", "signin_intro": "Inicie sesión en una instancia de LLeMbas. Aprobará este teléfono en el navegador, igual que haría con la CLI.",
"signin_open_browser": "Abrir en el navegador", "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_new": "Esta instancia habla una API de aplicaciones más reciente que esta aplicación. Actualice la aplicación.",
"signin_too_old": "Esta instancia aún no tiene API para aplicaciones. Necesita LLeMbas 1.7.0 o una versión posterior.", "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_moria": "Moria (oscuro)",
"theme_shire": "Shire (claro)", "theme_shire": "Shire (claro)",
"theme_system": "Como el sistema", "theme_system": "Como el sistema",
@@ -192,11 +242,22 @@
"update_check": "Buscar una actualización", "update_check": "Buscar una actualización",
"update_installing": "Instalando %1$s…", "update_installing": "Instalando %1$s…",
"update_none": "Esta es la versión más reciente.", "update_none": "Esta es la versión más reciente.",
"update_unreachable": "No se pudo obtener la actualización." "update_unreachable": "No se pudo obtener la actualización.",
"viewer_html_source": "Este es el código fuente de la página. Ábrala en el navegador para ver la página.",
"viewer_long_markdown": "Un archivo largo, por eso se muestra como texto sin formato.",
"viewer_open_browser": "Abrir en el navegador",
"viewer_too_large": "Este archivo es demasiado grande para mostrarlo; se puede mostrar como máximo 1 MB.",
"viewer_unavailable": "Este servidor todavía no puede entregar el archivo a la aplicación. Ábralo en el navegador."
}, },
"fr": { "fr": {
"about_version": "LLeMbas pour Android %1$s", "about_version": "LLeMbas pour Android %1$s",
"add_instance": "Ajouter une instance", "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", "archive": "Archiver",
"assist_hint": "Demandez n'importe quoi", "assist_hint": "Demandez n'importe quoi",
"assist_include_screen": "Inclure l'écran", "assist_include_screen": "Inclure l'écran",
@@ -209,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_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", "assistant_temporary": "Les conversations de l'assistant sont temporaires",
"attach": "Joindre un fichier", "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_allow_once": "Autoriser une fois",
"card_answer": "Votre réponse", "card_answer": "Votre réponse",
"card_approval": "Autoriser ceci ?", "card_approval": "Autoriser ceci ?",
"card_reason": "Pourquoi pas ? (facultatif)", "card_reason": "Pourquoi pas ? (facultatif)",
"channel_asks": "Questions et approbations", "channel_asks": "Questions et approbations",
"device_name": "LLeMbas pour Android", "device_name": "LLeMbas pour Android",
"effort_off": "Effort : désactivé", "effort_level": "Effort : %1$s",
"empty_agents": "Aucune conversation d'agent. Démarrez-en une depuis l'interface web sur un appareil associé.", "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_chat": "De quoi allons-nous parler ?",
"empty_chats": "Pas encore de conversation. Tous ceux qui errent ne sont pas perdus — commencez-en une.", "empty_chats": "Pas encore de conversation. Tous ceux qui errent ne sont pas perdus — commencez-en une.",
"listening": "Écoute…", "listening": "Écoute…",
"loading_line": "Cuisson des lembas…", "loading_line": "Cuisson des lembas…",
"mode_manual": "Manual", "mode_manual": "Manuel",
"mode_plan": "Plan",
"more": "Plus", "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", "older": "Messages précédents",
"output_cut": "La sortie est raccourcie ici. Vous la trouverez en entier sur la page web.", "output_cut": "La sortie est raccourcie ici. Vous la trouverez en entier sur la page web.",
"plan_approve": "Approuver le plan", "plan_approve": "Approuver le plan",
@@ -240,6 +307,7 @@
"share_default_prompt": "Jetez un œil à ceci.", "share_default_prompt": "Jetez un œil à ceci.",
"share_label": "Demander à LLeMbas", "share_label": "Demander à LLeMbas",
"share_sending": "Envoi à LLeMbas…", "share_sending": "Envoi à LLeMbas…",
"shown": "Affiché",
"signin_address": "Adresse de l'instance", "signin_address": "Adresse de l'instance",
"signin_code_intro": "Ouvrez l'instance dans le navigateur, connectez-vous et approuvez ce code :", "signin_code_intro": "Ouvrez l'instance dans le navigateur, connectez-vous et approuvez ce code :",
"signin_denied": "La connexion a été refusée.", "signin_denied": "La connexion a été refusée.",
@@ -247,7 +315,8 @@
"signin_intro": "Connectez-vous à une instance LLeMbas. Vous approuvez ce téléphone dans le navigateur, comme vous le feriez pour la CLI.", "signin_intro": "Connectez-vous à une instance LLeMbas. Vous approuvez ce téléphone dans le navigateur, comme vous le feriez pour la CLI.",
"signin_open_browser": "Ouvrir dans le navigateur", "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_new": "Cette instance utilise une API d'application plus récente que cette application. Mettez à jour l'application.",
"signin_too_old": "Cette instance n'a pas encore d'API pour l'application. Elle nécessite LLeMbas 1.7.0 ou une version plus récente.", "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_moria": "Moria (sombre)",
"theme_shire": "Shire (clair)", "theme_shire": "Shire (clair)",
"theme_system": "Comme le système", "theme_system": "Comme le système",
@@ -257,11 +326,22 @@
"update_check": "Rechercher une mise à jour", "update_check": "Rechercher une mise à jour",
"update_installing": "Installation de %1$s…", "update_installing": "Installation de %1$s…",
"update_none": "C'est la version la plus récente.", "update_none": "C'est la version la plus récente.",
"update_unreachable": "La mise à jour n'a pas pu être récupérée." "update_unreachable": "La mise à jour n'a pas pu être récupérée.",
"viewer_html_source": "Ceci est le code source de la page. Ouvrez-la dans le navigateur pour voir la page elle-même.",
"viewer_long_markdown": "Un fichier long, il est donc affiché en texte brut.",
"viewer_open_browser": "Ouvrir dans le navigateur",
"viewer_too_large": "Ce fichier est trop volumineux pour être affiché ; 1 Mo au plus peut être affiché.",
"viewer_unavailable": "Ce serveur ne peut pas encore transmettre le fichier à l'application. Ouvrez-le plutôt dans le navigateur."
}, },
"hu": { "hu": {
"about_version": "LLeMbas Androidra %1$s", "about_version": "LLeMbas Androidra %1$s",
"add_instance": "Példány hozzáadása", "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", "archive": "Archiválás",
"assist_hint": "Kérdezzen bármit", "assist_hint": "Kérdezzen bármit",
"assist_include_screen": "Képernyő hozzáadása", "assist_include_screen": "Képernyő hozzáadása",
@@ -274,20 +354,26 @@
"assistant_samsung": "Samsung telefonokon: Beállítások › Speciális funkciók › Oldalgomb › Nyomva tartás › Digitális asszisztens.", "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", "assistant_temporary": "Az asszisztenses csevegések ideiglenesek",
"attach": "Fájl csatolása", "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_allow_once": "Engedélyezés egyszer",
"card_answer": "Az Ön válasza", "card_answer": "Az Ön válasza",
"card_approval": "Engedélyezzük ezt?", "card_approval": "Engedélyezzük ezt?",
"card_reason": "Miért nem? (opcionális)", "card_reason": "Miért nem? (opcionális)",
"channel_asks": "Kérdések és jóváhagyások", "channel_asks": "Kérdések és jóváhagyások",
"device_name": "LLeMbas Androidra", "device_name": "LLeMbas Androidra",
"effort_off": "Erőfeszítés: kikapcsolva", "effort_level": "Erőfeszítés: %1$s",
"empty_agents": "Nincs ügynök-csevegés. Indítson el egyet a webes felületen egy összekapcsolt eszközön.", "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_chat": "Miről beszéljünk?",
"empty_chats": "Még nincs csevegés. Nem mindenki van elveszve, aki bolyong — kezdjen el egyet.", "empty_chats": "Még nincs csevegés. Nem mindenki van elveszve, aki bolyong — kezdjen el egyet.",
"listening": "Hallgatja…", "listening": "Hallgatja…",
"loading_line": "Lembas sül…", "loading_line": "Lembas sül…",
"mode_manual": "Manual", "mode_manual": "Kézi",
"mode_plan": "Terv",
"more": "Továbbiak", "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", "older": "Korábbi üzenetek",
"output_cut": "A kimenet itt lerövidítve jelenik meg. A teljes szöveg a weblapon található.", "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", "plan_approve": "Terv jóváhagyása",
@@ -305,6 +391,7 @@
"share_default_prompt": "Nézze meg ezt.", "share_default_prompt": "Nézze meg ezt.",
"share_label": "Kérdés az LLeMbas-tól", "share_label": "Kérdés az LLeMbas-tól",
"share_sending": "Küldés az LLeMbas-nak…", "share_sending": "Küldés az LLeMbas-nak…",
"shown": "Megjelenítve",
"signin_address": "A példány címe", "signin_address": "A példány címe",
"signin_code_intro": "Nyissa meg a példányt a böngészőben, jelentkezzen be, és hagyja jóvá ezt a kódot:", "signin_code_intro": "Nyissa meg a példányt a böngészőben, jelentkezzen be, és hagyja jóvá ezt a kódot:",
"signin_denied": "A bejelentkezést elutasították.", "signin_denied": "A bejelentkezést elutasították.",
@@ -312,7 +399,8 @@
"signin_intro": "Jelentkezzen be egy LLeMbas példányba. Ezt a telefont a böngészőben hagyja jóvá, ahogyan a CLI-t is tenné.", "signin_intro": "Jelentkezzen be egy LLeMbas példányba. Ezt a telefont a böngészőben hagyja jóvá, ahogyan a CLI-t is tenné.",
"signin_open_browser": "Megnyitás a böngészőben", "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_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": "Ennek a példánynak még nincs alkalmazás-API-ja. LLeMbas 1.7.0 vagy újabb verzió szükséges hozzá.", "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_moria": "Moria (sötét)",
"theme_shire": "Shire (világos)", "theme_shire": "Shire (világos)",
"theme_system": "A rendszer szerint", "theme_system": "A rendszer szerint",
@@ -322,11 +410,22 @@
"update_check": "Frissítés keresése", "update_check": "Frissítés keresése",
"update_installing": "%1$s telepítése…", "update_installing": "%1$s telepítése…",
"update_none": "Ez a legújabb verzió.", "update_none": "Ez a legújabb verzió.",
"update_unreachable": "A frissítést nem sikerült letölteni." "update_unreachable": "A frissítést nem sikerült letölteni.",
"viewer_html_source": "Ez az oldal forráskódja. Magát az oldalt a böngészőben megnyitva láthatja.",
"viewer_long_markdown": "Hosszú fájl, ezért egyszerű szövegként jelenik meg.",
"viewer_open_browser": "Megnyitás a böngészőben",
"viewer_too_large": "Ez a fájl túl nagy a megjelenítéshez; legfeljebb 1 MB jeleníthető meg.",
"viewer_unavailable": "Ez a szerver még nem tudja átadni a fájlt az alkalmazásnak. Nyissa meg inkább a böngészőben."
}, },
"it": { "it": {
"about_version": "LLeMbas per Android %1$s", "about_version": "LLeMbas per Android %1$s",
"add_instance": "Aggiungi un'istanza", "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", "archive": "Archivia",
"assist_hint": "Chiedi qualsiasi cosa", "assist_hint": "Chiedi qualsiasi cosa",
"assist_include_screen": "Includi lo schermo", "assist_include_screen": "Includi lo schermo",
@@ -339,20 +438,25 @@
"assistant_samsung": "Sui telefoni Samsung: Impostazioni › Funzioni avanzate › Tasto laterale › Pressione prolungata › Assistente digitale.", "assistant_samsung": "Sui telefoni Samsung: Impostazioni › Funzioni avanzate › Tasto laterale › Pressione prolungata › Assistente digitale.",
"assistant_temporary": "Le chat dell'assistente sono temporanee", "assistant_temporary": "Le chat dell'assistente sono temporanee",
"attach": "Allega un file", "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_allow_once": "Consenti una volta",
"card_answer": "La tua risposta", "card_answer": "La tua risposta",
"card_approval": "Consentire questo?", "card_approval": "Consentire questo?",
"card_reason": "Perché no? (facoltativo)", "card_reason": "Perché no? (facoltativo)",
"channel_asks": "Domande e approvazioni", "channel_asks": "Domande e approvazioni",
"device_name": "LLeMbas per Android", "device_name": "LLeMbas per Android",
"effort_off": "Impegno: disattivato", "effort_level": "Sforzo: %1$s",
"empty_agents": "Nessuna chat agente. Avviane una dall'interfaccia web su un dispositivo collegato.", "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_chat": "Di cosa parliamo?",
"empty_chats": "Ancora nessuna chat. Non tutti quelli che vagano sono perduti — iniziane una.", "empty_chats": "Ancora nessuna chat. Non tutti quelli che vagano sono perduti — iniziane una.",
"listening": "In ascolto…", "listening": "In ascolto…",
"loading_line": "I lembas stanno cuocendo…", "loading_line": "I lembas stanno cuocendo…",
"mode_manual": "Manual", "mode_manual": "Manuale",
"more": "Altro", "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", "older": "Messaggi precedenti",
"output_cut": "L'output qui è abbreviato. Lo trovi per intero sulla pagina web.", "output_cut": "L'output qui è abbreviato. Lo trovi per intero sulla pagina web.",
"plan_approve": "Approva il piano", "plan_approve": "Approva il piano",
@@ -370,6 +474,7 @@
"share_default_prompt": "Dai un'occhiata a questo.", "share_default_prompt": "Dai un'occhiata a questo.",
"share_label": "Chiedi a LLeMbas", "share_label": "Chiedi a LLeMbas",
"share_sending": "Invio a LLeMbas…", "share_sending": "Invio a LLeMbas…",
"shown": "Mostrato",
"signin_address": "Indirizzo dell'istanza", "signin_address": "Indirizzo dell'istanza",
"signin_code_intro": "Apri l'istanza nel browser, accedi e approva questo codice:", "signin_code_intro": "Apri l'istanza nel browser, accedi e approva questo codice:",
"signin_denied": "L'accesso è stato rifiutato.", "signin_denied": "L'accesso è stato rifiutato.",
@@ -377,7 +482,8 @@
"signin_intro": "Accedi a un'istanza LLeMbas. Approvi questo telefono nel browser, come faresti con la CLI.", "signin_intro": "Accedi a un'istanza LLeMbas. Approvi questo telefono nel browser, come faresti con la CLI.",
"signin_open_browser": "Apri nel browser", "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_new": "Questa istanza usa un'API per l'app più recente di questa app. Aggiorna l'app.",
"signin_too_old": "Questa istanza non ha ancora un'API per l'app. Richiede LLeMbas 1.7.0 o una versione più recente.", "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_moria": "Moria (scuro)",
"theme_shire": "Shire (chiaro)", "theme_shire": "Shire (chiaro)",
"theme_system": "Come il sistema", "theme_system": "Come il sistema",
@@ -387,11 +493,22 @@
"update_check": "Controlla aggiornamenti", "update_check": "Controlla aggiornamenti",
"update_installing": "Installazione di %1$s…", "update_installing": "Installazione di %1$s…",
"update_none": "Questa è la versione più recente.", "update_none": "Questa è la versione più recente.",
"update_unreachable": "Non è stato possibile scaricare l'aggiornamento." "update_unreachable": "Non è stato possibile scaricare l'aggiornamento.",
"viewer_html_source": "Questo è il sorgente della pagina. Aprila nel browser per vedere la pagina.",
"viewer_long_markdown": "Un file lungo, quindi è mostrato come testo semplice.",
"viewer_open_browser": "Apri nel browser",
"viewer_too_large": "Questo file è troppo grande da mostrare; si può mostrare al massimo 1 MB.",
"viewer_unavailable": "Questo server non può ancora passare il file all'app. Aprilo invece nel browser."
}, },
"pl": { "pl": {
"about_version": "LLeMbas na Androida %1$s", "about_version": "LLeMbas na Androida %1$s",
"add_instance": "Dodaj instancję", "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", "archive": "Archiwizuj",
"assist_hint": "Zapytaj o cokolwiek", "assist_hint": "Zapytaj o cokolwiek",
"assist_include_screen": "Dołącz ekran", "assist_include_screen": "Dołącz ekran",
@@ -404,20 +521,25 @@
"assistant_samsung": "W telefonach Samsung: Ustawienia › Funkcje zaawansowane › Przycisk boczny › Naciśnięcie i przytrzymanie › Asystent cyfrowy.", "assistant_samsung": "W telefonach Samsung: Ustawienia › Funkcje zaawansowane › Przycisk boczny › Naciśnięcie i przytrzymanie › Asystent cyfrowy.",
"assistant_temporary": "Czaty asystenta są tymczasowe", "assistant_temporary": "Czaty asystenta są tymczasowe",
"attach": "Załącz plik", "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_allow_once": "Zezwól raz",
"card_answer": "Twoja odpowiedź", "card_answer": "Twoja odpowiedź",
"card_approval": "Zezwolić na to?", "card_approval": "Zezwolić na to?",
"card_reason": "Czemu nie? (opcjonalnie)", "card_reason": "Czemu nie? (opcjonalnie)",
"channel_asks": "Pytania i zatwierdzenia", "channel_asks": "Pytania i zatwierdzenia",
"device_name": "LLeMbas na Androida", "device_name": "LLeMbas na Androida",
"effort_off": "Wysiłek: wyłączony", "effort_level": "Rozumowanie: %1$s",
"empty_agents": "Brak czatów agenta. Zacznij jeden z interfejsu webowego na połączonym urządzeniu.", "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_chat": "O czym porozmawiamy?",
"empty_chats": "Nie ma jeszcze czatów. Nie każdy, kto błądzi, jest zgubiony — zacznij jeden.", "empty_chats": "Nie ma jeszcze czatów. Nie każdy, kto błądzi, jest zgubiony — zacznij jeden.",
"listening": "Słucham…", "listening": "Słucham…",
"loading_line": "Lembasy się pieczą…", "loading_line": "Lembasy się pieczą…",
"mode_manual": "Manual", "mode_manual": "Ręcznie",
"more": "Więcej", "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", "older": "Wcześniejsze wiadomości",
"output_cut": "Wynik jest tu skrócony. Cały znajduje się na stronie internetowej.", "output_cut": "Wynik jest tu skrócony. Cały znajduje się na stronie internetowej.",
"plan_approve": "Zatwierdź plan", "plan_approve": "Zatwierdź plan",
@@ -435,6 +557,7 @@
"share_default_prompt": "Zobacz to.", "share_default_prompt": "Zobacz to.",
"share_label": "Zapytaj LLeMbas", "share_label": "Zapytaj LLeMbas",
"share_sending": "Wysyłanie do LLeMbas…", "share_sending": "Wysyłanie do LLeMbas…",
"shown": "Pokazano",
"signin_address": "Adres instancji", "signin_address": "Adres instancji",
"signin_code_intro": "Otwórz instancję w przeglądarce, zaloguj się i zatwierdź ten kod:", "signin_code_intro": "Otwórz instancję w przeglądarce, zaloguj się i zatwierdź ten kod:",
"signin_denied": "Logowanie zostało odrzucone.", "signin_denied": "Logowanie zostało odrzucone.",
@@ -442,7 +565,8 @@
"signin_intro": "Zaloguj się do instancji LLeMbas. Ten telefon zatwierdza się w przeglądarce, tak jak CLI.", "signin_intro": "Zaloguj się do instancji LLeMbas. Ten telefon zatwierdza się w przeglądarce, tak jak CLI.",
"signin_open_browser": "Otwórz w przeglądarce", "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_new": "Ta instancja używa nowszego API aplikacji niż ta aplikacja. Zaktualizuj aplikację.",
"signin_too_old": "Ta instancja nie ma jeszcze API aplikacji. Wymaga LLeMbas 1.7.0 lub nowszego.", "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_moria": "Moria (ciemny)",
"theme_shire": "Shire (jasny)", "theme_shire": "Shire (jasny)",
"theme_system": "Jak system", "theme_system": "Jak system",
@@ -452,11 +576,22 @@
"update_check": "Sprawdź aktualizację", "update_check": "Sprawdź aktualizację",
"update_installing": "Instalowanie %1$s…", "update_installing": "Instalowanie %1$s…",
"update_none": "To jest najnowsza wersja.", "update_none": "To jest najnowsza wersja.",
"update_unreachable": "Nie udało się pobrać aktualizacji." "update_unreachable": "Nie udało się pobrać aktualizacji.",
"viewer_html_source": "To jest źródło strony. Otwórz ją w przeglądarce, aby zobaczyć samą stronę.",
"viewer_long_markdown": "Długi plik, dlatego jest pokazany jako zwykły tekst.",
"viewer_open_browser": "Otwórz w przeglądarce",
"viewer_too_large": "Ten plik jest za duży, by go pokazać; można pokazać najwyżej 1 MB.",
"viewer_unavailable": "Ten serwer nie potrafi jeszcze przekazać pliku aplikacji. Otwórz go w przeglądarce."
}, },
"sk": { "sk": {
"about_version": "LLeMbas pre Android %1$s", "about_version": "LLeMbas pre Android %1$s",
"add_instance": "Pridať inštanciu", "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ť", "archive": "Archivovať",
"assist_hint": "Spýtajte sa na čokoľvek", "assist_hint": "Spýtajte sa na čokoľvek",
"assist_include_screen": "Zahrnúť obrazovku", "assist_include_screen": "Zahrnúť obrazovku",
@@ -469,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_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é", "assistant_temporary": "Konverzácie s asistentom sú dočasné",
"attach": "Priložiť súbor", "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_allow_once": "Povoliť raz",
"card_answer": "Vaša odpoveď", "card_answer": "Vaša odpoveď",
"card_approval": "Povoliť to?", "card_approval": "Povoliť to?",
"card_reason": "Prečo nie? (nepovinné)", "card_reason": "Prečo nie? (nepovinné)",
"channel_asks": "Otázky a schválenia", "channel_asks": "Otázky a schválenia",
"device_name": "LLeMbas pre Android", "device_name": "LLeMbas pre Android",
"effort_off": "Úsilie: vypnuté", "effort_level": "Náročnosť: %1$s",
"empty_agents": "Žiadne konverzácie s agentom. Spustite jednu z webového rozhrania na prepojenom zariadení.", "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_chat": "O čom sa pozhovárame?",
"empty_chats": "Zatiaľ žiadne konverzácie. Nie všetci, čo blúdia, sú stratení — začnite jednu.", "empty_chats": "Zatiaľ žiadne konverzácie. Nie všetci, čo blúdia, sú stratení — začnite jednu.",
"listening": "Počúvam…", "listening": "Počúvam…",
"loading_line": "Pečú sa lembasy…", "loading_line": "Pečú sa lembasy…",
"mode_manual": "Manual", "mode_manual": "Ručne",
"more": "Viac", "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", "older": "Staršie správy",
"output_cut": "Výstup je tu skrátený. Celý nájdete na webovej stránke.", "output_cut": "Výstup je tu skrátený. Celý nájdete na webovej stránke.",
"plan_approve": "Schváliť plán", "plan_approve": "Schváliť plán",
@@ -500,6 +640,7 @@
"share_default_prompt": "Pozrite sa na toto.", "share_default_prompt": "Pozrite sa na toto.",
"share_label": "Spýtať sa LLeMbas", "share_label": "Spýtať sa LLeMbas",
"share_sending": "Odosiela sa do LLeMbas…", "share_sending": "Odosiela sa do LLeMbas…",
"shown": "Zobrazené",
"signin_address": "Adresa inštancie", "signin_address": "Adresa inštancie",
"signin_code_intro": "Otvorte inštanciu v prehliadači, prihláste sa a schváľte tento kód:", "signin_code_intro": "Otvorte inštanciu v prehliadači, prihláste sa a schváľte tento kód:",
"signin_denied": "Prihlásenie bolo odmietnuté.", "signin_denied": "Prihlásenie bolo odmietnuté.",
@@ -507,7 +648,8 @@
"signin_intro": "Prihláste sa do inštancie LLeMbas. Tento telefón schválite v prehliadači, tak ako by ste schválili CLI.", "signin_intro": "Prihláste sa do inštancie LLeMbas. Tento telefón schválite v prehliadači, tak ako by ste schválili CLI.",
"signin_open_browser": "Otvoriť v prehliadači", "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_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 ešte nemá API pre aplikácie. Potrebuje LLeMbas 1.7.0 alebo novší.", "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_moria": "Moria (tmavá)",
"theme_shire": "Shire (svetlá)", "theme_shire": "Shire (svetlá)",
"theme_system": "Podľa systému", "theme_system": "Podľa systému",
@@ -517,6 +659,11 @@
"update_check": "Skontrolovať aktualizáciu", "update_check": "Skontrolovať aktualizáciu",
"update_installing": "Inštaluje sa %1$s…", "update_installing": "Inštaluje sa %1$s…",
"update_none": "Toto je najnovšia verzia.", "update_none": "Toto je najnovšia verzia.",
"update_unreachable": "Aktualizáciu sa nepodarilo stiahnuť." "update_unreachable": "Aktualizáciu sa nepodarilo stiahnuť.",
"viewer_html_source": "Toto je zdrojový kód stránky. Samotnú stránku uvidíte po otvorení v prehliadači.",
"viewer_long_markdown": "Dlhý súbor, preto je zobrazený ako obyčajný text.",
"viewer_open_browser": "Otvoriť v prehliadači",
"viewer_too_large": "Tento súbor je príliš veľký na zobrazenie; zobraziť možno najviac 1 MB.",
"viewer_unavailable": "Tento server zatiaľ nevie aplikácii súbor odovzdať. Otvorte ho v prehliadači."
} }
} }
+3 -3
View File
@@ -1,5 +1,5 @@
{ {
"tag": "v1.7.0", "tag": "v2.0.0-beta.5",
"commit": "d9592e2d0f67f62d093149f0a1a0b15b8f4c91c6", "commit": "02d0c874434e3b726193bf94fb9741b4f8d0a22c",
"sha256": "a64ee7533a8b78fae1a0465498d70475c149c2f48bf33487c5cb28cf1cf9c82e" "sha256": "e2ee615f5eb84219c6875e9e38f379394708e798d45f481d76ec8c7260f0ffb4"
} }