From e19b361e2c69d4c4b6fd4aebec134503058f2398 Mon Sep 17 00:00:00 2001 From: i2cjak Date: Tue, 24 Nov 2026 02:18:18 -0500 Subject: [PATCH] mobile & commerce: provider vector marks, Settings -> Ring polish, and lead_days/estimate_warnings --- docs/COMMERCE-AUDIT.md | 4 +- docs/PARITY.md | 6 +- docs/order.md | 2 +- i18n/en.msg | 2 + i18n/es.msg | 2 + i18n/ja.msg | 2 + .../java/dev/backplane/mobile/DataAccounts.kt | 8 +- .../java/dev/backplane/mobile/DataClient.kt | 32 +- .../java/dev/backplane/mobile/DataExtras.kt | 4 + .../java/dev/backplane/mobile/DataRing.kt | 22 +- .../java/dev/backplane/mobile/DataSections.kt | 14 +- .../java/dev/backplane/mobile/DataSwarm.kt | 9 +- .../java/dev/backplane/mobile/DataViews.kt | 15 +- .../src/main/java/dev/backplane/mobile/Msg.kt | 14 +- .../java/dev/backplane/mobile/ProviderMark.kt | 375 ++++++++++++++++++ .../java/dev/backplane/mobile/DataRingTest.kt | 39 ++ .../dev/backplane/mobile/OrderCardTest.kt | 36 ++ .../dev/backplane/mobile/ProviderMarkTest.kt | 66 +++ mobile/ios/Backplane/DataAccounts.swift | 6 +- mobile/ios/Backplane/DataExtras.swift | 5 +- mobile/ios/Backplane/DataModels.swift | 17 +- mobile/ios/Backplane/DataRing.swift | 35 +- mobile/ios/Backplane/DataSections.swift | 11 +- mobile/ios/Backplane/DataSettings.swift | 12 +- mobile/ios/Backplane/DataSwarm.swift | 9 +- mobile/ios/Backplane/DataViews.swift | 29 +- mobile/ios/Backplane/ProviderMark.swift | 325 +++++++++++++++ mobile/ios/Shared/TrCatalog.swift | 8 + mobile/ios/Tests/ProviderMarkTests.swift | 44 ++ mobile/ios/Tests/WireJSONTests.swift | 10 + native/gpui/src/screens/order.rs | 15 +- native/gpui/src/screens/projects.rs | 21 +- native/host/src/data/ext.rs | 22 +- native/host/src/data/tests.rs | 1 + native/host/src/present/ready.rs | 27 +- native/host/src/present/sections.rs | 5 +- native/host/src/settings/order.rs | 6 + native/host/src/settings/order_view.rs | 14 +- scripts/mobile/ios-unit-tests.sh | 1 + test/e2e/ios/UITests/JourneyTests.swift | 3 +- 40 files changed, 1214 insertions(+), 64 deletions(-) create mode 100644 mobile/android/app/src/main/java/dev/backplane/mobile/ProviderMark.kt create mode 100644 mobile/android/app/src/test/java/dev/backplane/mobile/DataRingTest.kt create mode 100644 mobile/android/app/src/test/java/dev/backplane/mobile/OrderCardTest.kt create mode 100644 mobile/android/app/src/test/java/dev/backplane/mobile/ProviderMarkTest.kt create mode 100644 mobile/ios/Backplane/ProviderMark.swift create mode 100644 mobile/ios/Tests/ProviderMarkTests.swift diff --git a/docs/COMMERCE-AUDIT.md b/docs/COMMERCE-AUDIT.md index e78b3fb389..c42a873392 100644 --- a/docs/COMMERCE-AUDIT.md +++ b/docs/COMMERCE-AUDIT.md @@ -12,7 +12,7 @@ The server in this tree is ahead of the 0.14 tags: `1f85acb19a` (US sales tax, t |---|---|---| | `GET /v1/health` `{ok, version, pricing}` | `fab.rs` `look_in`: only for a card with a KiCad board and no fab file | **Fixed**: `pricing: false` was read as healthy; the card now says "pricing is not available right now" (`health_got`) | | `GET /v1/catalog` `{kinds, fee, fee_cnc, min_assembled}` | never called; agents get a hand-written list (`ORDER_PROMPT_FAB`) | **Fixed by a test**: the list had drifted (sheet metal `countersinks`, HDI thicknesses 1.4 and 1.8). Prompt corrected, and `fab.rs` test `the_agents_fab_json_contract_names_everything_the_order_servers_catalog_has` fails on any kind, option, choice or feature the catalog has and the prompt lacks, and on the order minimums (5 boards, assembly from 2) | -| `POST /v1/estimate` `{currency, from, parts[{name,kind,qty,from,lead_days,warnings}], label, note}` | `fab.rs` sends `{parts:[{name,kind,qty,options,features}]}`, reads `label`, per-part `from`/`problems`/`name`/`kind` | `lead_days` and `warnings` were dropped. **Fixed**: `fab.look` carries `lead_days` and `estimate_warnings`. Not drawn by any client yet (open) | +| `POST /v1/estimate` `{currency, from, parts[{name,kind,qty,from,lead_days,warnings}], label, note}` | `fab.rs` sends `{parts:[{name,kind,qty,options,features}]}`, reads `label`, per-part `from`/`problems`/`name`/`kind` | `lead_days` and `warnings` were dropped. **Fixed**: `fab.look` carries `lead_days` and `estimate_warnings`, and GPUI, iOS, and Android render them on Order cards and project fab cards | | `POST /v1/quotes` (multipart `manifest` + `file`; 202 `{id,token,status,poll_after}`; 400, 413, 429 with `{error}`) | `order.rs` `upload`: `X-Backplane-Install`, manifest and files by relative path, 300 s; error text shown to the agent | matches. The hub ignores `poll_after` (polls at 3 s, then 30 s; the server's read budget is 1200 an hour per address and per install, so one quote is far inside it) | | `GET /v1/quotes/{id}` `{id,status,expires,country,pilot,quote,pay_path,order,error}` | `order.rs` `get`, `order_view.rs` `state`/`payable`/`pending`/`sum` | see the two bugs below; `pilot`, `shipping.ddp`, `pay_label`, `markdown`, `problems`, `warnings`, `order.{status,tracking}` all read as the server writes them | | `/q/{id}?t=` Buy now (redirect to Stripe; paused page when `FAB_PAUSED`) | `order.rs` `pay_of`, `pay_link` | matches. The hub cannot know the server is paused before the person opens the page (open, needs a server field) | @@ -41,7 +41,7 @@ The server in this tree is ahead of the 0.14 tags: `1f85acb19a` (US sales tax, t ## Open, and why -- **No client draws `lead_days` or `estimate_warnings`.** Adding a line to the Buy it tooltip or the card is a UI decision on three clients (GPUI, iOS, Android); left for the person to choose. +- **`lead_days` and `estimate_warnings` are rendered on GPUI, iOS, and Android** (on Order cards and project fab cards). - **The hub cannot see a paused server** until Buy now is opened. A `paused` flag on `GET /v1/quotes/{id}` (and `/v1/health`) would let the quote and the card say it. That is a server change (`order/fabsrv/app.py`), not a client one; not made here because it changes the deployed contract. - **`poll_after` is not honoured.** Harmless today; if the server ever slows it, the hub should follow it. - **No live run of the phones** for the changed paths (the changes are in the hub's data, which all clients draw unchanged). diff --git a/docs/PARITY.md b/docs/PARITY.md index ccc97c2096..0974c72ef6 100644 --- a/docs/PARITY.md +++ b/docs/PARITY.md @@ -38,7 +38,7 @@ Each lane updates its own rows in the commit that lands the work. | **Voice** | | | | Dictation from the mic, desktop: the GPUI `Dictate` chip starts a hub session (`bots.voice` start/stop/view/act), draws the strip, level and fix chips, applies the hub's edits (`screens/voice.rs`, `voice_mic.rs`); the Rust `backplane-voice` helper is built and shipped beside the hub; a whole session through the hub is not yet driven end to end | partial | voice | | Dictation from the phones: the hub serves `/voice/in` and pipes the phone's audio to the helper; the Rust `backplane-voice` helper is built and shipped beside the hub. iOS: the composer's mic (`voice.start`, 16 kHz s16le in ~200 ms POSTs, `voice.stop`), the strip (status and level, never the words), fix chips, the ask card with its field, `edit`/`draft` applied with the mark rule, `voice-clear` on Send, `voice.view` after a reconnect, Settings → Voice from `voice.page`; driven on a simulator against a hub and the mock OpenAI (a test tone for the microphone, `BACKPLANE_VOICE_FAKE=1`, debug builds only); not yet heard through a real microphone. Android: the same (`DataVoice.kt`, `DataVoiceViews.kt`, `VoiceRecorder.kt`; RECORD_AUDIO asked at the first press, a refusal says so plainly); driven on an emulator against a hub and the mock OpenAI (a 440 Hz test tone when `/data/local/tmp/voice-fake` exists, debug builds only); edit and shift logic (`VoiceText`) checked against `test/fixtures/voice-edits.json`; not yet heard through a real microphone | partial | voice | -| Whole recordings and Pebble ring notes (Nov 10: docs/ring.md): the ring's form is kept with its M4A under `/ring//`, de-duplicated by the app's `X-Index-Delivery` (a retry is a 2xx), heard one at a time by the engine Settings, Voice picks with the dictionary (local segments with times and confidence), given to the Pebble bot (`ring.setup`: Pebble, its webhook and token, #ring-requests) as the person's words, notes the hub stopped on taken up again after a restart; Settings → Ring lists, searches, plays, hears again (local or OpenAI) and links to where a note went. Hub tests drive token, signature, retry, test event, playback; the phones have no Ring page yet | partial | voice | +| Whole recordings and Pebble ring notes (Nov 10: docs/ring.md): the ring's form is kept with its M4A under `/ring//`, de-duplicated by the app's `X-Index-Delivery` (a retry is a 2xx), heard one at a time by the engine Settings, Voice picks with the dictionary (local segments with times and confidence), given to the Pebble bot (`ring.setup`: Pebble, its webhook and token, #ring-requests) as the person's words, notes the hub stopped on taken up again after a restart; Settings → Ring lists, searches, plays, hears again (local or OpenAI) and links to where a note went. Hub tests drive token, signature, retry, test event, playback; Android (`DataRing.kt`) and iOS (dedicated `Settings → Ring` page in `DataSettings.swift` / `DataRing.swift`) wire the same `ring.page` / `ring.page.act` list, search, clear, playback, re-transcribe, and thread jump | done | voice | | Voice ops of `bots.voice`: status, key, unkey, add, start, stop, view, act, page, page-act, install, remove, api-add, api-del (`voice/session.rs`) | done | voice | | Settings: Voice page (engine, model, mic, key, dictionary, learned fixes; `voice/page.rs`, in `PAGES`) | done | voice | | Personal dictionary, learned words, `voice_dictionary_add`: `voice.e.`/`voice.l.` settings, the correction pass and settle as pure Rust with 0.14's test vectors (`voice/vdict.rs`, `words.rs`), the bot tool writes a `voice.e.` entry | done | voice | @@ -50,7 +50,7 @@ Each lane updates its own rows in the commit that lands the work. | Local engine on macOS and Windows: `local-install` and real-audio decode (`native/voice/tests/local_e2e.rs`; sherpa-onnx's C API symbols there are unchecked) | needs a person or another machine | voice | | Android pairing through the pairing screen with dictation after it (the rig paired by writing the app's link preference with `run-as`) | needs a person or another machine | voice | | **Commerce** | | | -| Card and Ready to order data (`fab.look`, `fab.intent`): the answer matches 0.14's twelve keys and adds `lead_days`, `estimate_warnings` from the estimate; the bar itself is dropped (row below). Audit and fixes in `docs/COMMERCE-AUDIT.md`. Open: no client draws `lead_days`/`estimate_warnings` (a UI choice on three clients); the hub cannot see a paused server (needs a `paused` field from the order server); the deployed server's version and `DEFAULT_SERVER` need Bub | partial | commerce | +| Card and Ready to order data (`fab.look`, `fab.intent`): the answer matches 0.14's twelve keys and adds `lead_days`, `estimate_warnings` from the estimate; the bar itself is dropped (row below). Audit and fixes in `docs/COMMERCE-AUDIT.md`. GPUI, iOS, and Android render `lead_days` and `estimate_warnings` on Order cards and project fab cards. Open: the hub cannot see a paused server (needs a `paused` field from the order server); the deployed server's version and `DEFAULT_SERVER` need Bub | partial | commerce | | Buy it: `order.buy` starts a buy thread in the source's folder, "Buy: · 2" naming, the person's Buy it as its first message; only for fab files or a KiCad project's own board. Driven live in the window (test/order/live_e2e.sh): Buy it in the header, the window goes to the buy thread | done | commerce | | Buy threads: `order_ask` (its answer is the person's message), `order_quote` (the upload waits behind its approval card; nothing leaves before the person's Send, and a copy sends nothing), `order_status`, `order.wait`; order tokens only in `/orders/`. Tested on the hub with stand-ins, and once against the real `order/fabsrv` on loopback with a Stripe double (`test/order/local_server.py`), pilot and paid | done | commerce | | `order_review` check and record work for every agent (`settings/order.rs`; the design hash matches 0.14's, so a review it recorded stays current). The gate is in, tested through the agent's MCP path with stand-ins, but needs a buy thread to be reached: not driven on a client | partial | commerce | @@ -61,7 +61,7 @@ Each lane updates its own rows in the commit that lands the work. | Subagent drill-down: a subagent opens from its Agent row in a tool fold or its Subagents/Background work row into its own view (what it was asked, what it said, each tool call with its result, what it reported and how it ended), live while it works, with Back. Hub: the subagent's tool results and a foreground one's answer are logged to `@sub:` beside its steps (new `kind`s `result`, `reply`; `about` gains `description` for foreground calls), `present/panels.rs` `sub_view` (pure, tested), data/1 feature `subview` (`thread.sub`, `subscribe {topic:"sub"}`, `tool.sub` on Agent calls; `docs/PHONE-DATA.md`), the window's session `sub` gives the thread its `subView`. Foreground subagents now show in the panel while their turn runs. Stand-in: `subwork:MS` keeps background subagents working, `fgagent:MS` runs a foreground one. Driven in the GPUI window on Xvfb with real X clicks and Escape (temp home, stand-in claude): panel row → live view, steps arriving (`build/gpui/shots/subagent/s-sub-live-1.png`, `s-sub-live-2.png`), Escape back, the fold's Agent row → the ended view with its report (`s-fold-open.png`, `s-sub-ended.png`), a foreground subagent live and ended (`s-fg-live.png`, `s-fg-ended.png`). On the Pixel 9 with real touches (`build/mobile/shots/subagent/px-*.png`): Background work row → live view, Back, fold → Open → ended view. iOS in the Simulator by XCUITest (`scripts/mobile/ios-sub-journey.sh`, test_subagent). The 0.14 view opened steps inside the panel; this is a page of its own. Claude only: other providers report no subagent steps | done | threads-deep | | Your machines, one list over machines: one sidebar over every linked machine (one repository is one project), machine marks and away, the switcher (All, this machine, each linked one: `side-machine`), one order by recency over machines (projects and Active rows), New thread on a chosen machine (`newOn`: the + and the project menu), threads there opened, read, sent to, stopped, settled and archived, links `backplane://thread/~` from a message, the system and the command line (`link-open`, `mirror::thread_ref`). Desktop driven in the window on Xvfb against two linked temp hubs (`test/e2e/pairing/unified.py --hold`, machines `desk` and `lap`). The phones (data/1, `docs/PHONE-DATA.md` "Your machines on a phone"): the lists merge every machine's projects and threads (marks, away, `machine` filter and chips, recency, `newOn`), a far thread opens, reads, sends, interrupts, settles and archives, `backplane://thread/~` opens it; hub e2e `test/e2e/pairing/phone_machines.py` 39 checks, driven on Android (own emulator, the Pixel was not attached) and the iOS Simulator against two linked temp hubs | done | threads-deep | | Viewers for threads on another machine (`far.view`): Board, Schematic, 3D and Mech drawn there (`net/farview.rs`), Files listed there and a file shown from a copy (`files.dir`, `files.get`, `net/farfiles.rs`), Diff asked there with Commit and Revert acting there (`git.diff`, `git.act`, `git.revert`), the terminal a shell there in the thread's folder (`term.open/input/resize`, frames forwarded). Desktop driven in the window against two linked temp hubs; the phones through data/1 (`viewer.files/watch/info/probe`, `files.entries`, `viewer.diff`, `term.*` on a `~` thread): Board, 3D and Files drawn from the other machine on Android, Board on the iOS Simulator; Diff and the terminal in the protocol e2e only; Schematic and Mech not driven on the phones | partial | threads-deep | -| Real provider logos: the window draws the vendor marks for Claude and OpenCode as tinted vectors (`assets/providers/*.svg`, simple-icons CC0, `NOTICE.md`) in the model picker, the model chip and the account cards; the other providers keep the coloured square with an initial. Driven in the window on Xvfb (build/gpui/shots/provider-logos/s-picker.png, s-chip.png, s-acct.png). The phones still draw initials | partial | threads-small | +| Real provider logos: GPUI (`assets/providers/*.svg`), iOS (`ProviderMark.swift`), and Android (`ProviderMark.kt`) draw the 8 built-in agent vendor marks (Claude, Codex/OpenAI blossom, Grok, Muse, Antigravity, OpenCode, Pi, Oh My Pi) as tinted vectors across thread rows, composer model chips, the model picker, and accounts, with a coloured square fallback for unknown providers | done | threads-small | | Routine save errors on screen | done | threads-small | | Diff and Files toggle closed | done | threads-small | | **Bend-era cleanup** | | | diff --git a/docs/order.md b/docs/order.md index 09c15d5407..85d4b57ec9 100644 --- a/docs/order.md +++ b/docs/order.md @@ -28,7 +28,7 @@ The agents' instructions are built in `native/host/src/agents/prompt.rs` (`order - **The hub's job `fab`**: 1. reads the intent and the fab files in the thread's folder; 2. with Ordering and Price estimates on, asks the order server's `POST /v1/estimate` for the bare parts' price. Only kinds, options and features are sent; never files. -- **The answer** (`settings/fab.rs`) is `{thread, intent, goal, parts, boards, label, estimate_problems, error, estimates, board_files, board_default, order, lead_days, estimate_warnings}`: the first twelve as 0.14 gave them, key for key; `lead_days` (the longest of the estimate's per-part `lead_days`, 0 for none) and `estimate_warnings` (its per-part `warnings`, each once) come from the estimate and are empty without one. `fab.intent {thread, text}` writes `.backplane/intent.md` and answers the same card. It is kept as info keys `fab.line:`, `fab.intent:`, `fab.buy:`, `fab.ready:`, `fab.shown:`, `fab.boards:`, `fab.board:` and `fab.again:` (plus the thread; `present/ready.rs` `keep`). No client draws `lead_days` or `estimate_warnings` yet. +- **The answer** (`settings/fab.rs`) is `{thread, intent, goal, parts, boards, label, estimate_problems, error, estimates, board_files, board_default, order, lead_days, estimate_warnings}`: the first twelve as 0.14 gave them, key for key; `lead_days` (the longest of the estimate's per-part `lead_days`, 0 for none) and `estimate_warnings` (its per-part `warnings`, each once) come from the estimate and are empty without one. `fab.intent {thread, text}` writes `.backplane/intent.md` and answers the same card. It is kept as info keys `fab.line:`, `fab.intent:`, `fab.buy:`, `fab.ready:`, `fab.shown:`, `fab.boards:`, `fab.board:`, `fab.again:`, `fab.lead:` and `fab.warn:` (plus the thread; `present/ready.rs` `keep`). GPUI, iOS, and Android draw `lead_days` and `estimate_warnings` on Order cards and project fab cards. - **Boards:** the answer lists every KiCad board in the project (`board_files`, outside `extra/` and `mfg/`). With more than one, the viewer's Board, Schematic and 3D tabs offer each by its folder's name: chips in the window, the Sheet menu on phones (values `b:`). A pick shows that board, or the schematic beside it, and the other tabs stay on it (`Bd.keep`). Before any pick, the chip of the board the viewer opens by default is lit. - **What counts as something to order:** a `*.fab.json`, or a KiCad project's own board (a `.kicad_pro` beside it, outside folders of copies: `boards::own`). A repository that only holds board files, as test fixtures say, has nothing to order: no Buy it, and the order server is not asked. The viewer's picker still offers those boards. - **Two places:** diff --git a/i18n/en.msg b/i18n/en.msg index b61cb15afb..12e3ffe9a7 100644 --- a/i18n/en.msg +++ b/i18n/en.msg @@ -5073,3 +5073,5 @@ provider.notice.senderr = No AI provider connected yet. Open Settings → Accoun provider.notice.senderr.remote = No AI provider connected on {machine}. Open Settings → Accounts on {machine} to connect Claude, Codex, Antigravity, or another provider. web.settings.providers = AI providers web.settings.providers.browser = Connect a provider in the Backplane desktop or mobile app under Settings → Accounts. +order.lead.days = {days, plural, one {Est. lead time: 1 day} other {Est. lead time: {days} days}} +order.estimate.warnings = Warning: {warnings} diff --git a/i18n/es.msg b/i18n/es.msg index d097491ce2..3a27f829ae 100644 --- a/i18n/es.msg +++ b/i18n/es.msg @@ -5073,3 +5073,5 @@ provider.notice.senderr = Aún no hay ningún proveedor de IA conectado. Abre Co provider.notice.senderr.remote = No hay ningún proveedor de IA conectado en {machine}. Abre Configuración → Cuentas en {machine} para conectar Claude, Codex, Antigravity u otro proveedor. web.settings.providers = Proveedores de IA web.settings.providers.browser = Conecta un proveedor en la aplicación de escritorio o móvil de Backplane en Configuración → Cuentas. +order.lead.days = {days, plural, one {Plazo estimado: 1 día} other {Plazo estimado: {days} días}} +order.estimate.warnings = Aviso: {warnings} diff --git a/i18n/ja.msg b/i18n/ja.msg index ec196f6ac9..7097af92b0 100644 --- a/i18n/ja.msg +++ b/i18n/ja.msg @@ -5096,3 +5096,5 @@ provider.notice.senderr = AI プロバイダーがまだ接続されていませ provider.notice.senderr.remote = {machine} に AI プロバイダーが接続されていません。{machine} で設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。 web.settings.providers = AI プロバイダー web.settings.providers.browser = Backplane のデスクトップまたはモバイルアプリの設定 → アカウントからプロバイダーを接続してください。 +order.lead.days = {days, plural, one {目安納期: 1日} other {目安納期: {days}日}} +order.estimate.warnings = 警告: {warnings} diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/DataAccounts.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/DataAccounts.kt index d2b7d5986b..ebefc46613 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/DataAccounts.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/DataAccounts.kt @@ -71,7 +71,11 @@ internal fun AccountsScreen(back: () -> Unit, open: (String) -> Unit) { DMono(Tr.t(p.optString("note")), dcs.onSurfaceVariant, 11, lines = 3) } else { p.optJSONArray("providers").objects().forEach { pv -> - DMono(Tr.t(pv.optString("title")).uppercase(), dfaint) + val pid = pv.optString("provider") + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) { + if (ProviderMarks.spec(pid) != null) ProviderMark(pid, 13.dp) + DMono(Tr.t(pv.optString("title")).uppercase(), dfaint) + } val accounts = pv.optJSONArray("accounts").objects() if (accounts.isEmpty()) DMono(Msg.android_accounts_none, dfaint, 12) accounts.forEach { a -> AccountRow(a) { open(a.optString("id")) } } @@ -142,6 +146,8 @@ private fun PersonCard(e: JSONObject, open: (String) -> Unit) { Column(Modifier.fillMaxWidth().then(if (profile.isNotEmpty()) Modifier.clickable { open(profile) }.testTag("accounts.login.$profile") else Modifier), verticalArrangement = Arrangement.spacedBy(4.dp)) { Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) { + val pv = l.optString("provider") + if (ProviderMarks.spec(pv) != null) ProviderMark(pv, 13.dp) DMono(what, dcs.onSurfaceVariant, 11, modifier = Modifier.weight(1f, fill = false)) if (l.optBoolean("default")) DMono(Tr.t("Used for new threads"), dcs.onSurfaceVariant, 10, modifier = Modifier.background(dcs.surface).padding(horizontal = 5.dp, vertical = 1.dp)) Spacer(Modifier.weight(1f)) diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/DataClient.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/DataClient.kt index 1b91d006dc..af7b3188ea 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/DataClient.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/DataClient.kt @@ -988,25 +988,30 @@ object DataClient { return (0 until a.length()).mapNotNull { a.optJSONObject(it) }.map { Hit(it.optString("msg"), it.optString("role"), it.optString("text"), it.optLong("at").let { t -> if (t in 1 until 100_000_000_000) t * 1000 else t }) } // an older hub said seconds } // Buy it (feature buy): the desktop header's button for this thread (the hub's words), null when there is nothing to buy; a press makes the buy thread, which the app opens - data class Buy(val label: String, val tip: String, val thread: String = "") + data class Buy(val label: String, val tip: String, val thread: String = "", val leadDays: Int = 0, val estimateWarnings: String = "") /** Buy it on a project's page: the hub's button for the project, naming the thread it buys from (`thread.buy {project}`); null when there is nothing to buy. */ /** The top of a project's page (feature "projectcard"): its goal and its boards by name; null from a hub without it. */ - data class ProjectCard(val goal: String, val boards: List) + data class ProjectCard(val goal: String, val boards: List, val leadDays: Int = 0, val estimateWarnings: String = "") suspend fun projectCard(project: String): ProjectCard? { if (!has("projectcard")) return null val o = call("project.card", JSONObject().put("project", project)) - return ProjectCard(o.optString("goal"), o.optJSONArray("boards")?.let { a -> (0 until a.length()).map { a.optString(it) } }.orEmpty().filter { it.isNotEmpty() }) + return ProjectCard( + o.optString("goal"), + o.optJSONArray("boards")?.let { a -> (0 until a.length()).map { a.optString(it) } }.orEmpty().filter { it.isNotEmpty() }, + o.optInt("lead_days", 0).coerceAtLeast(0), + o.optString("estimate_warnings"), + ) } suspend fun buyOfProject(project: String): Buy? { if (!has("buy")) return null val o = call("thread.buy", JSONObject().put("project", project)).optJSONObject("buy") ?: return null val th = o.optString("thread"); if (th.isEmpty()) return null - return Buy(o.optString("label").ifEmpty { "Buy it" }, o.optString("tip"), th) + return Buy(o.optString("label").ifEmpty { "Buy it" }, o.optString("tip"), th, o.optInt("lead_days", 0).coerceAtLeast(0), o.optString("estimate_warnings")) } suspend fun buyOf(tid: String): Buy? { if (!has("buy")) return null val o = call("thread.buy", JSONObject().put("thread", tid)).optJSONObject("buy") ?: return null - return Buy(o.optString("label").ifEmpty { "Buy it" }, o.optString("tip")) + return Buy(o.optString("label").ifEmpty { "Buy it" }, o.optString("tip"), "", o.optInt("lead_days", 0).coerceAtLeast(0), o.optString("estimate_warnings")) } suspend fun buy(tid: String): String = call("order.buy", JSONObject().put("thread", tid)).optString("thread") // what waits for the agent (feature queue): the desktop's strip over the composer, rows and buttons as the hub has them; read again on the thread's pushes and after a send @@ -1027,11 +1032,22 @@ object DataClient { } // a buy thread's Order card (feature order): the hub's, drawn as it says; null for any other thread data class OrderStep(val label: String, val mark: String) - data class Order(val name: String, val steps: List, val line: String, val waiting: Boolean, val total: String, val customs: String, val pay: String, val label: String) + data class Order(val name: String, val steps: List, val line: String, val waiting: Boolean, val total: String, val customs: String, val pay: String, val label: String, val leadDays: Int = 0, val estimateWarnings: String = "") { + companion object { + fun of(o: JSONObject): Order { + val st = o.optJSONArray("steps")?.let { a -> (0 until a.length()).mapNotNull { a.optJSONObject(it) }.map { OrderStep(it.optString("label"), it.optString("mark")) } } ?: emptyList() + val warns = o.optString("estimate_warnings").ifEmpty { + o.optJSONArray("warnings")?.let { a -> + (0 until a.length()).mapNotNull { a.optString(it).trim().takeIf(String::isNotEmpty) }.distinct().joinToString("; ") + } ?: "" + } + return Order(o.optString("name"), st, o.optString("line"), o.optBoolean("waiting"), o.optString("total"), o.optString("customs"), o.optString("pay"), o.optString("label"), o.optInt("lead_days", 0).coerceAtLeast(0), warns) + } + } + } suspend fun order(tid: String): Order? { val o = call("thread.order", JSONObject().put("thread", tid)).optJSONObject("order") ?: return null - val st = o.optJSONArray("steps")?.let { a -> (0 until a.length()).mapNotNull { a.optJSONObject(it) }.map { OrderStep(it.optString("label"), it.optString("mark")) } } ?: emptyList() - return Order(o.optString("name"), st, o.optString("line"), o.optBoolean("waiting"), o.optString("total"), o.optString("customs"), o.optString("pay"), o.optString("label")) + return Order.of(o) } // the review bar (feature reviewmode, #1305): the hub's, drawn as it says; null while the thread is no review. The button is the same `thread.review` with `on` suspend fun review(tid: String): DReviewBar? = DReviewBar.of(call("thread.review", JSONObject().put("thread", tid)).optJSONObject("review")) diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/DataExtras.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/DataExtras.kt index 4f02940973..08778ff550 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/DataExtras.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/DataExtras.kt @@ -203,6 +203,9 @@ fun PickerSheet(thread: String?, choice: DNewThreadChoice, choose: (DNewThreadCh // one height from the first frame: a sheet that opens empty and grows when the list arrives stays where it opened; short of the whole screen, it clears the status bar Column(Modifier.fillMaxWidth().fillMaxHeight(.85f)) { Row(Modifier.fillMaxWidth().height(48.dp).padding(horizontal = 14.dp), verticalAlignment = Alignment.CenterVertically) { + val activePv = picker?.sections?.firstOrNull { it.action == "provider" }?.choices?.firstOrNull { it.on }?.value + ?: ProviderMarks.providerOfChip(picker?.chip ?: "") + if (activePv.isNotEmpty()) { ProviderMark(activePv, 14.dp); Spacer(Modifier.width(6.dp)) } DMono(picker?.chip?.let(Tr::t) ?: " ", dcs.onSurface, 12, Modifier.weight(1f).testTag("picker.chip")) DMono(Msg.android_done, dcs.primary, 13, Modifier.clickable(onClick = close).padding(8.dp).testTag("picker.done"), bold = true) } @@ -221,6 +224,7 @@ fun PickerSheet(thread: String?, choice: DNewThreadChoice, choose: (DNewThreadCh s.choices.forEach { c -> Row(Modifier.fillMaxWidth().background(if (c.on) dcs.surfaceContainerHigh else Color.Transparent).clickable(enabled = c.ok) { press(s, c) }.heightIn(min = 44.dp).padding(horizontal = 14.dp, vertical = 6.dp).testTag("pick.${s.action}.${c.value}"), verticalAlignment = Alignment.CenterVertically) { DMono(if (c.on) "✓" else "", dcs.primary, 13, Modifier.width(24.dp)) + if (s.action == "provider") { ProviderMark(c.value, 16.dp); Spacer(Modifier.width(8.dp)) } Column { Text(Tr.t(c.label), color = if (c.ok) dcs.onSurface else dfaint, fontFamily = BpMono, fontSize = 13.sp) if (!c.ok && c.why.isNotEmpty()) DMono(Tr.t(c.why), dfaint, 11) diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/DataRing.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/DataRing.kt index 70d7b380ad..e8c9cc0053 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/DataRing.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/DataRing.kt @@ -7,6 +7,16 @@ import org.json.JSONObject * webhook's URL and header to copy or share into the Pebble app on this phone, when the test event came, and the recordings with Play. A press the * phone does itself (copy, share-text, open-url) never leaves it; What happened (link-open) opens the thread here; the rest goes to ring.page.act * {action, value, fields}, whose answer is the page again. */ +object RingLogic { + fun clearedField(action: String, value: String): String? = + if (action == "ring-search" && value == "clear") "ringq" else null + + fun hasPendingWork(rows: List): Boolean = rows.any { r -> + val note = r.optString("note") + note.contains("being heard now") || note.contains("waiting to be heard") || note.contains("waiting to go to Pebble") + } +} + object DataRing { var rows by mutableStateOf>(emptyList()); private set var error by mutableStateOf(""); private set @@ -26,5 +36,15 @@ object DataRing { @Composable internal fun RingSettings() { LaunchedEffect(DataClient.conn) { if (DataClient.conn == DataClient.Conn.ONLINE) DataRing.load() } - PageRows(Msg.android_ring_head, "ring", DataRing.rows, DataRing.error) { action, value, sent -> DataRing.act(action, value, sent); null } + LaunchedEffect(DataClient.conn, DataRing.rows) { + if (DataClient.conn == DataClient.Conn.ONLINE && RingLogic.hasPendingWork(DataRing.rows)) { + kotlinx.coroutines.delay(2000) + DataRing.load() + } + } + PageRows(Msg.android_ring_head, "ring", DataRing.rows, DataRing.error) { action, value, sent -> + val clear = RingLogic.clearedField(action, value) + DataRing.act(action, value, sent) + clear + } } diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/DataSections.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/DataSections.kt index f6104a6b1e..ed4ea9d647 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/DataSections.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/DataSections.kt @@ -79,14 +79,16 @@ data class DSecRow(val id: String, val title: String, val word: String, val say: /** snooze duration choices (`row-snooze`), wake value (`|off` on snoozed rows), and one-swipe settle id */ val snooze: List = emptyList(), val wake: String = "", val settle: String = "", /** hardware indicators for Bench project rows (present/sections.rs `hasBoard`/`hasSchematic`) */ - val hasBoard: Boolean = false, val hasSchematic: Boolean = false) { + val hasBoard: Boolean = false, val hasSchematic: Boolean = false, + /** thread provider id (e.g. claude, codex, antigravity) */ + val provider: String = "") { companion object { fun of(o: JSONObject): DSecRow = DSecRow(o.optString("id"), o.optString("title"), o.optString("word"), o.optString("say"), o.optString("want"), o.optString("ago"), parseMark(o.optJSONObject("mark")), o.optString("project"), o.optBoolean("off"), o.optString("nav"), o.optBoolean("pinned"), o.optString("key"), o.optInt("running"), list(o.optJSONArray("threads")), o.optString("css"), (0 until (o.optJSONArray("dots")?.length() ?: 0)).map { i -> o.getJSONArray("dots").getJSONObject(i).let { it.optBoolean("here") to it.optBoolean("dim") } }, o.optString("kind"), o.optString("hide"), o.optString("icon"), DMenuItem.list(o.optJSONArray("menu")), o.optString("fold"), o.optBoolean("folded"), o.optInt("under"), o.optInt("needsCount"), o.optInt("rest"), DNeed.of(o.optJSONObject("need")), o.optString("label"), o.optString("tone"), DSnoozeOpt.list(o.optJSONArray("snooze")), o.optString("wake"), o.optString("settle"), - o.optBoolean("hasBoard"), o.optBoolean("hasSchematic")) + o.optBoolean("hasBoard"), o.optBoolean("hasSchematic"), o.optString("provider")) fun list(a: JSONArray?): List = (0 until (a?.length() ?: 0)).map { of(a!!.getJSONObject(it)) } } /** a chevron on the row: something is under it, or it is folded (an older hub sends no fold) */ @@ -342,6 +344,10 @@ fun SectionThread(r: DSecRow, indent: Int = 12, showProject: Boolean = false, op ) { Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(3.dp)) { Row(verticalAlignment = Alignment.CenterVertically) { + if (r.provider.isNotEmpty()) { + ProviderMark(r.provider, 12.dp) + Spacer(Modifier.width(6.dp)) + } Text( r.title, color = dcs.onSurface, @@ -689,10 +695,12 @@ fun ProjectPageScreen(p: DSecRow, open: (String) -> Unit, newThread: (String) -> var card by remember(pr.id) { mutableStateOf(null) } var whole by remember(pr.id) { mutableStateOf(false) } LaunchedEffect(pr.id, DataClient.conn) { if (DataClient.conn == DataClient.Conn.ONLINE) runCatching { DataClient.projectCard(pr.id) }.onSuccess { card = it } } - card?.takeIf { it.goal.isNotEmpty() || it.boards.isNotEmpty() }?.let { c -> + card?.takeIf { it.goal.isNotEmpty() || it.boards.isNotEmpty() || it.leadDays > 0 || it.estimateWarnings.isNotEmpty() }?.let { c -> Column(Modifier.fillMaxWidth().background(dcs.surface).clickable(enabled = c.goal.isNotEmpty()) { whole = !whole }.padding(horizontal = 12.dp, vertical = 8.dp).testTag("project.page.card")) { if (c.goal.isNotEmpty()) DMono(c.goal, dcs.onSurface, 12, lines = if (whole) 20 else 2) if (c.boards.isNotEmpty()) DMono(Msg.android_viewer_boards.uppercase() + " " + c.boards.joinToString(" · "), dcs.onSurfaceVariant, 10, Modifier.padding(top = if (c.goal.isNotEmpty()) 4.dp else 0.dp), lines = 2) + if (c.leadDays > 0) DMono(Msg.order_lead_days(c.leadDays), dcs.onSurfaceVariant, 11, Modifier.padding(top = 4.dp).testTag("project.page.lead")) + if (c.estimateWarnings.isNotEmpty()) DMono(Msg.order_estimate_warnings(c.estimateWarnings), dwarn, 11, Modifier.padding(top = 4.dp).testTag("project.page.warnings"), lines = 4) } DLine() } diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/DataSwarm.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/DataSwarm.kt index f03cae735c..09bfad7521 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/DataSwarm.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/DataSwarm.kt @@ -297,9 +297,14 @@ private fun MemberPickRow(n: Int, pick: DSwarmPick, models: List DropdownMenuItem({ Text(p, fontFamily = BpMono, color = if (l.isEmpty() || l.any { it.ok }) dcs.onSurface else dfaint) }, { prov = false; change(pick.copy(provider = p, model = "")) }, Modifier.testTag("swarm.pick.provider.$p")) } + models.forEach { (p, l) -> DropdownMenuItem({ + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) { + ProviderMark(p, 14.dp) + Text(p, fontFamily = BpMono, color = if (l.isEmpty() || l.any { it.ok }) dcs.onSurface else dfaint) + } + }, { prov = false; change(pick.copy(provider = p, model = "")) }, Modifier.testTag("swarm.pick.provider.$p")) } } } Box(Modifier.weight(1f)) { diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/DataViews.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/DataViews.kt index 370edc9ae2..cd7b552d2f 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/DataViews.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/DataViews.kt @@ -308,9 +308,13 @@ internal fun DBtn(label: String, primary: Boolean, enabled: Boolean = true, modi /** The composer's model chip: the hub's "claude / opus / high" in a line box; a tap opens the picker. */ @Composable -internal fun ModelChip(text: String, tag: String, modifier: Modifier = Modifier, onClick: () -> Unit) { +internal fun ModelChip(text: String, tag: String, modifier: Modifier = Modifier, provider: String = "", onClick: () -> Unit) { + val pv = remember(provider, text) { provider.ifEmpty { ProviderMarks.providerOfChip(text) } } Box(modifier.height(40.dp).background(dcs.surfaceVariant).border(BorderStroke(1.dp, dcs.outlineVariant)).clickable(onClick = onClick).padding(horizontal = 10.dp).testTag(tag), contentAlignment = Alignment.CenterStart) { - DMono(Tr.t(text), dcs.onSurface, 12) + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) { + if (pv.isNotEmpty()) ProviderMark(pv, 14.dp) + DMono(Tr.t(text), dcs.onSurface, 12) + } } } @@ -746,6 +750,7 @@ private fun ThreadRow(t: DThread, onClick: () -> Unit, depth: Int = 0, kids: Int Column(Modifier.weight(1f).padding(vertical = 8.dp)) { Row(verticalAlignment = Alignment.CenterVertically) { if (t.pinned) { Icon(Icons.Default.PushPin, Msg.tools_pinned, tint = dcs.primary, modifier = Modifier.size(11.dp)); Spacer(Modifier.width(5.dp)) } + if (t.provider.isNotEmpty()) { ProviderMark(t.provider, 12.dp); Spacer(Modifier.width(6.dp)) } Text(t.title.ifEmpty { Msg.thread_new }, color = dcs.onSurface, fontSize = 13.sp, fontFamily = BpMono, maxLines = 1, overflow = TextOverflow.Ellipsis) } if (t.preview.isNotEmpty()) Text(t.preview.replace("**", "").replace("`", ""), color = dfaint, fontSize = 11.sp, fontFamily = BpMono, maxLines = 1, overflow = TextOverflow.Ellipsis) @@ -1034,7 +1039,7 @@ private fun ThreadBody(id: String, viewer: () -> Unit, hub: () -> Unit, go: (Str DField(field, { DataClient.setField(id, it) }, Msg.android_composer_hint, Modifier.focusRequester(replyBox).testTag("thread.composer"), 6, if (planActive) planTint else dcs.primary) thread?.memory?.let { MemoryBar(it) } Row(Modifier.fillMaxWidth().height(IntrinsicSize.Min), horizontalArrangement = Arrangement.spacedBy(6.dp), verticalAlignment = Alignment.CenterVertically) { - if (thread != null && (DataClient.has("picker") || thread.chip.isNotEmpty())) ModelChip(thread.chip.ifEmpty { "${thread.provider} / ${thread.model.ifEmpty { Msg.common_default }}" }, "thread.model", Modifier.weight(1f)) { models = true } else Spacer(Modifier.weight(1f)) + if (thread != null && (DataClient.has("picker") || thread.chip.isNotEmpty())) ModelChip(thread.chip.ifEmpty { "${thread.provider} / ${thread.model.ifEmpty { Msg.common_default }}" }, "thread.model", Modifier.weight(1f), provider = thread.provider) { models = true } else Spacer(Modifier.weight(1f)) if (DataClient.has("plan") && planMode != null) { val pcol = if (planActive) planTint else dcs.onSurfaceVariant Box( @@ -1680,7 +1685,7 @@ private fun NewThreadScreen(project: String, back: () -> Unit, created: (String) DField(text, { text = it }, Msg.android_thread_new_hint, Modifier.heightIn(min = 120.dp).focusRequester(focus).testTag("new.text"), 8, dcs.primary) if (err.isNotEmpty()) Text(Tr.t(err), color = dcs.error, fontFamily = BpMono, fontSize = 12.sp) Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(6.dp), verticalAlignment = Alignment.CenterVertically) { - if (DataClient.has("picker")) ModelChip(chip.ifEmpty { " " }, "new.model", Modifier.weight(1f)) { picking = true } else Spacer(Modifier.weight(1f)) + if (DataClient.has("picker")) ModelChip(chip.ifEmpty { " " }, "new.model", Modifier.weight(1f), provider = choice.provider ?: "") { picking = true } else Spacer(Modifier.weight(1f)) DBtn(if (busy) Msg.state_starting else Msg.android_start, true, !busy, Modifier.testTag("new.start")) { busy = true; scope.launch { try { created(DataClient.createThread(target, text, choice).id) } catch (e: Exception) { err = e.message ?: ""; busy = false } } } @@ -1796,6 +1801,8 @@ private fun OrderCard(o: DataClient.Order) { DMono(Tr.t(o.line), if (o.waiting) dcs.onSurfaceVariant else dcs.onSurface, 12, lines = 4) // the card's words wrap, as on iOS and in the window if (o.total.isNotEmpty()) DMono(o.total, dcs.onSurface, 14, bold = true) if (o.customs.isNotEmpty()) DMono(Tr.t(o.customs), dcs.onSurfaceVariant, 11, Modifier.testTag("thread.order.customs"), lines = 4) + if (o.leadDays > 0) DMono(Msg.order_lead_days(o.leadDays), dcs.onSurfaceVariant, 11, Modifier.testTag("thread.order.lead")) + if (o.estimateWarnings.isNotEmpty()) DMono(Msg.order_estimate_warnings(o.estimateWarnings), dwarn, 11, Modifier.testTag("thread.order.warnings"), lines = 4) if (o.pay.startsWith("https://") || o.pay.startsWith("http://")) DBtn(Tr.t(o.label.ifEmpty { "Buy now" }), true, modifier = Modifier.testTag("thread.order.pay")) { runCatching { ctx.startActivity(android.content.Intent(android.content.Intent.ACTION_VIEW, android.net.Uri.parse(o.pay))) } } diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/Msg.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/Msg.kt index 45c58252ee..e3d26f0571 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/Msg.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/Msg.kt @@ -4972,6 +4972,8 @@ object Msg { "provider.notice.senderr.remote", "web.settings.providers", "web.settings.providers.browser", + "order.lead.days", + "order.estimate.warnings", ) internal val keys: Array by lazy { arrayOf(*keys0(), *keys1(), *keys2(), *keys3(), *keys4(), *keys5(), *keys6(), *keys7(), *keys8(), *keys9(), *keys10(), *keys11(), *keys12(), *keys13(), *keys14(), *keys15(), *keys16(), *keys17(), *keys18(), *keys19()) } private fun en0(): Array = arrayOf( @@ -9943,6 +9945,8 @@ object Msg { "No AI provider connected on {machine}. Open Settings → Accounts on {machine} to connect Claude, Codex, Antigravity, or another provider.", "AI providers", "Connect a provider in the Backplane desktop or mobile app under Settings → Accounts.", + "{days, plural, one {Est. lead time: 1 day} other {Est. lead time: {days} days}}", + "Warning: {warnings}", ) internal val en: Array by lazy { arrayOf(*en0(), *en1(), *en2(), *en3(), *en4(), *en5(), *en6(), *en7(), *en8(), *en9(), *en10(), *en11(), *en12(), *en13(), *en14(), *en15(), *en16(), *en17(), *en18(), *en19()) } private fun ja0(): Array = arrayOf( @@ -14914,6 +14918,8 @@ object Msg { "{machine} に AI プロバイダーが接続されていません。{machine} で設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。", "AI プロバイダー", "Backplane のデスクトップまたはモバイルアプリの設定 → アカウントからプロバイダーを接続してください。", + "{days, plural, one {目安納期: 1日} other {目安納期: {days}日}}", + "警告: {warnings}", ) internal val ja: Array by lazy { arrayOf(*ja0(), *ja1(), *ja2(), *ja3(), *ja4(), *ja5(), *ja6(), *ja7(), *ja8(), *ja9(), *ja10(), *ja11(), *ja12(), *ja13(), *ja14(), *ja15(), *ja16(), *ja17(), *ja18(), *ja19()) } private fun es0(): Array = arrayOf( @@ -19885,6 +19891,8 @@ object Msg { "No hay ningún proveedor de IA conectado en {machine}. Abre Configuración → Cuentas en {machine} para conectar Claude, Codex, Antigravity u otro proveedor.", "Proveedores de IA", "Conecta un proveedor en la aplicación de escritorio o móvil de Backplane en Configuración → Cuentas.", + "{days, plural, one {Plazo estimado: 1 día} other {Plazo estimado: {days} días}}", + "Aviso: {warnings}", ) internal val es: Array by lazy { arrayOf(*es0(), *es1(), *es2(), *es3(), *es4(), *es5(), *es6(), *es7(), *es8(), *es9(), *es10(), *es11(), *es12(), *es13(), *es14(), *es15(), *es16(), *es17(), *es18(), *es19()) } private fun exactText0(): Array = arrayOf( @@ -23306,8 +23314,8 @@ object Msg { ) internal val exactText: Array by lazy { arrayOf(*exactText0(), *exactText1(), *exactText2(), *exactText3(), *exactText4(), *exactText5(), *exactText6(), *exactText7(), *exactText8(), *exactText9(), *exactText10(), *exactText11(), *exactText12(), *exactText13()) } internal val exactKey: IntArray by lazy { intArrayOf(0, 1, 2, 3, 4, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3163, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 3731, 61, 62, 63, 64, 66, 68, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 84, 85, 3770, 87, 88, 98, 99, 3092, 3769, 102, 103, 105, 106, 107, 109, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 159, 161, 162, 163, 3212, 165, 166, 3214, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 3173, 183, 187, 189, 193, 194, 195, 197, 198, 199, 200, 201, 202, 206, 209, 213, 215, 216, 217, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 234, 235, 2979, 237, 238, 239, 240, 3730, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 260, 262, 263, 264, 265, 266, 267, 270, 271, 272, 273, 275, 279, 280, 281, 282, 286, 287, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 300, 301, 3184, 305, 306, 307, 308, 309, 310, 311, 313, 314, 315, 317, 319, 333, 3778, 336, 3777, 3780, 340, 3790, 342, 343, 344, 345, 354, 3161, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 2982, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 2974, 2975, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 453, 454, 455, 3191, 457, 458, 459, 460, 461, 2964, 463, 464, 465, 3094, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 556, 557, 558, 559, 560, 561, 562, 563, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 592, 628, 629, 630, 3199, 3200, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 651, 652, 3843, 654, 656, 657, 659, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 686, 687, 689, 690, 692, 693, 694, 695, 698, 704, 724, 728, 729, 730, 731, 732, 3775, 734, 735, 736, 737, 3198, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 3758, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 843, 844, 845, 847, 848, 3194, 850, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 3768, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 3845, 903, 904, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 3164, 964, 965, 966, 967, 968, 969, 3793, 971, 3019, 3076, 974, 975, 976, 978, 979, 987, 988, 989, 991, 992, 993, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 3796, 1020, 1021, 1022, 1025, 1029, 1030, 1031, 2971, 3045, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1045, 1046, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1082, 1083, 1086, 1087, 1088, 1090, 1091, 1092, 3810, 1094, 1095, 1098, 1099, 1100, 3193, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 3795, 1120, 1123, 1124, 1125, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1150, 1151, 1152, 1153, 1154, 1155, 1158, 1162, 1163, 1165, 1170, 1171, 1172, 1173, 1176, 1178, 1180, 1181, 1182, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1220, 1222, 1223, 2973, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1240, 1241, 1244, 1245, 1246, 1247, 1248, 1250, 1253, 1254, 1255, 1256, 1257, 1258, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1277, 1278, 1279, 1280, 1281, 1288, 1289, 1290, 1291, 1294, 1296, 1297, 1298, 1299, 1301, 1305, 1306, 1308, 1309, 1310, 1311, 1315, 1316, 1318, 1319, 1320, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1335, 1338, 1339, 1340, 1341, 1344, 1347, 1348, 1356, 1357, 3508, 1361, 1362, 1363, 1364, 1365, 1366, 3575, 1373, 1375, 1380, 1384, 1385, 3049, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 2976, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 3093, 3586, 1436, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 3588, 1473, 1474, 1475, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1493, 1494, 3733, 1496, 1497, 1498, 3745, 3751, 1501, 1502, 1503, 1504, 1505, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1523, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1573, 1574, 1575, 1576, 1578, 1579, 1580, 1581, 1582, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 3052, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 3462, 1670, 1671, 1672, 1673, 3463, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 2985, 1692, 1694, 1696, 1698, 1702, 1706, 1712, 1714, 1715, 1716, 1718, 1719, 1720, 1721, 1722, 1723, 1725, 1727, 1728, 1729, 1730, 1731, 1733, 1734, 3757, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1744, 1745, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1826, 1827, 3028, 1836, 1838, 1842, 3010, 1844, 1845, 3011, 1847, 1848, 1852, 3075, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1864, 1869, 1871, 1872, 1873, 1874, 1875, 1876, 3090, 1878, 1879, 1882, 1883, 1893, 1894, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1942, 1943, 1945, 1946, 1956, 1958, 1959, 1962, 1963, 1966, 1967, 1968, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1988, 1994, 1995, 1996, 1997, 2001, 3151, 2007, 2008, 2010, 2011, 2012, 2013, 3803, 3804, 2022, 2024, 2025, 2026, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2039, 2040, 2042, 2043, 2046, 2047, 3136, 3137, 3138, 2055, 3364, 2057, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2074, 2075, 2076, 2077, 2078, 2079, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2112, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2127, 2128, 2129, 3078, 2133, 2134, 2135, 2137, 2139, 2140, 2141, 2142, 3001, 3126, 3127, 3128, 3129, 3130, 2149, 2150, 2151, 2153, 3003, 3004, 2994, 2993, 2159, 2995, 2161, 2999, 2163, 3362, 2168, 2172, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 3029, 2188, 2189, 2190, 2191, 3062, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2204, 3375, 2206, 2207, 2208, 2209, 3044, 2211, 2212, 2213, 2214, 2992, 2216, 3107, 2219, 2223, 2224, 3652, 2226, 2227, 3739, 3740, 2231, 3189, 2234, 3728, 2237, 2238, 2239, 2240, 2241, 3788, 2243, 3159, 2245, 3158, 2247, 2249, 2251, 2252, 2253, 2257, 2260, 2262, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 2277, 2279, 2280, 2281, 3746, 2283, 2284, 2286, 3036, 3034, 3038, 2292, 2294, 2295, 2301, 2302, 2303, 2304, 3074, 2309, 2310, 2312, 2317, 2318, 3018, 3587, 2981, 2980, 2983, 3103, 3106, 2331, 2332, 2334, 2335, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 3807, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2368, 2370, 2371, 2372, 2376, 2377, 2380, 2381, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2402, 2403, 2404, 2405, 2406, 2407, 2429, 2430, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2449, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2463, 2464, 2465, 2466, 2468, 2469, 2470, 2472, 2475, 2476, 2477, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 2487, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2540, 2541, 2542, 2543, 3140, 2545, 2547, 2548, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2559, 2560, 2561, 2562, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2581, 2582, 2583, 2584, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2608, 2610, 2611, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2624, 2625, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 2637, 2639, 2641, 2644, 2646, 3736, 2651, 2652, 2653, 2654, 2655, 2656, 2657, 2661, 2662, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2672, 2673, 2674, 2679, 2680, 2681, 2683, 2684, 2685, 2686, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 3709, 2702, 2703, 2705, 3706, 2707, 2708, 3710, 3707, 2720, 2724, 3717, 3213, 3718, 2728, 3719, 2730, 2732, 3721, 2734, 3722, 2736, 2738, 3726, 3704, 3697, 3705, 2757, 2758, 2760, 2761, 2771, 2772, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2786, 2789, 2792, 2794, 2796, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 3384, 2816, 2817, 2818, 2819, 2820, 2822, 2824, 2825, 3416, 2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2844, 2845, 2846, 2847, 2850, 2851, 2853, 2854, 2855, 2856, 3008, 2858, 2860, 2861, 2863, 2864, 2865, 2866, 2867, 2869, 2870, 2874, 2877, 2878, 2879, 2881, 2882, 2883, 2885, 2886, 2887, 2888, 2890, 2891, 2894, 2897, 2898, 2899, 2900, 2901, 2903, 2905, 2906, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 2942, 2943, 2944, 2946, 2947, 2948, 2952, 2953, 2954, 2955, 2956, 2960, 2961, 2965, 2966, 2967, 2968, 2969, 2970, 2972, 2977, 2978, 2984, 2989, 2991, 2996, 2997, 2998, 3000, 3002, 3005, 3006, 3007, 3009, 3013, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 3027, 3030, 3031, 3032, 3033, 3037, 3039, 3040, 3041, 3042, 3046, 3047, 3051, 3053, 3054, 3055, 3057, 3058, 3059, 3060, 3061, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3079, 3080, 3081, 3082, 3087, 3088, 3089, 3091, 3095, 3096, 3097, 3098, 3099, 3102, 3104, 3105, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 3118, 3120, 3121, 3122, 3123, 3124, 3125, 3131, 3132, 3133, 3134, 3135, 3139, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3149, 3150, 3153, 3155, 3156, 3157, 3160, 3165, 3166, 3167, 3169, 3172, 3174, 3175, 3177, 3178, 3179, 3181, 3182, 3183, 3185, 3186, 3187, 3188, 3192, 3197, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3210, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 3227, 3230, 3231, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3257, 3258, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 3358, 3359, 3363, 3365, 3366, 3367, 3369, 3370, 3371, 3374, 3376, 3377, 3378, 3379, 3380, 3383, 3385, 3388, 3390, 3391, 3396, 3397, 3398, 3399, 3402, 3409, 3410, 3411, 3412, 3413, 3414, 3417, 3418, 3419, 3420, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3434, 3435, 3436, 3437, 3438, 3439, 3441, 3442, 3444, 3445, 3446, 3447, 3448, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3464, 3467, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3490, 3491, 3492, 3493, 3494, 3495, 3496, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3507, 3512, 3518, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3536, 3537, 3538, 3539, 3540, 3541, 3545, 3546, 3550, 3551, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 3565, 3567, 3568, 3569, 3570, 3573, 3574, 3576, 3577, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 3608, 3609, 3610, 3614, 3615, 3616, 3617, 3623, 3624, 3625, 3626, 3630, 3632, 3633, 3634, 3636, 3639, 3640, 3644, 3651, 3653, 3656, 3658, 3659, 3660, 3661, 3662, 3663, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 3714, 3729, 3732, 3734, 3735, 3737, 3741, 3743, 3747, 3756, 3759, 3760, 3761, 3762, 3763, 3764, 3766, 3772, 3773, 3776, 3779, 3781, 3782, 3783, 3784, 3785, 3786, 3789, 3792, 3794, 3798, 3799, 3800, 3801, 3802, 3805, 3806, 3808, 3809, 3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3836, 3837, 3840, 3842, 3844, 3853, 3854, 3856, 3857, 3866, 3872, 3878, 3887, 3889, 3890, 3891, 3892, 3895, 3896, 3898, 3904, 3908, 3912, 3917, 3918, 3920, 3921, 3922, 3924, 3925, 3926, 3931, 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3942, 3943, 3944, 3989, 3990, 3995, 3997, 3998, 4000, 4006, 4009, 4024, 4025, 4026, 4027, 4028, 4029, 4031, 4032, 4034, 4035, 4037, 4039, 4040, 4053, 4056, 4057, 4059, 4060, 4064, 4069, 4072, 4073, 4075, 4076, 4082, 4084, 4085, 4088, 4090, 4095, 4096, 4097, 4102, 4113, 4136, 4152, 4160, 4169, 4170, 4174, 4179, 4195, 4196, 4197, 4198, 4200, 4202, 4203, 4205, 4208, 4212, 4215, 4218, 4219, 4220, 4221, 4225, 4226, 4227, 4228, 4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4262, 4265, 4266, 4272, 4277, 4278, 4279, 4280, 4284, 4288, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 4297, 4299, 4300, 4301, 4302, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4320, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4340, 4341, 4345, 4346, 4348, 4349, 4350, 4351, 4355, 4356, 4357, 4358, 4359, 4360, 4362, 4363, 4364, 4370, 4371, 4372, 4373, 4374, 4375, 4379, 4383, 4384, 4386, 4387, 4388, 4389, 4390, 4392, 4402, 4404, 4409, 4410, 4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4437, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4462, 4463, 4464, 4466, 4467, 4468, 4469, 4472, 4473, 4474, 4476, 4477, 4478, 4480, 4481, 4482, 4483, 4484, 4485, 4487, 4489, 4492, 4493, 4494, 4495, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 4507, 4511, 4513, 4514, 4515, 4516, 4517, 4521, 4522, 4526, 4527, 4528, 4530, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4570, 4571, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4605, 4606, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4624, 4625, 4626, 4627, 4636, 4637, 4638, 4639, 4640, 4641, 4643, 4646, 4647, 4648, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4756, 4757, 4758, 4764, 4777, 4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 4798, 4799, 4800, 4801, 4802, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4813, 4814, 4816, 4817, 4818, 4821, 4822, 4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 4847, 4849, 4850, 4851, 4852, 4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4882, 4883, 4884, 4886, 4888, 4890, 4891, 4892, 4893, 4896, 4898, 4899, 4900, 4901, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4913, 4917, 4918, 4922, 4923, 4924, 4925, 4926, 4928, 4929) } - internal val templates: IntArray by lazy { intArrayOf(2369, 2848, 2660, 2659, 2658, 2880, 2902, 3382, 2623, 418, 2793, 2791, 2687, 2378, 2384, 2795, 2892, 2607, 2606, 285, 2336, 2797, 2904, 3232, 4184, 2546, 4927, 2596, 2050, 2374, 3716, 2115, 2723, 2379, 3233, 1336, 4204, 4224, 3715, 2564, 2721, 1867, 4199, 2126, 2167, 2173, 4566, 283, 2116, 4508, 3394, 3415, 2073, 2347, 3712, 452, 2755, 2787, 2788, 3395, 3711, 2756, 3643, 609, 1711, 3720, 1868, 2731, 3723, 2737, 3386, 616, 617, 2773, 3084, 3698, 1659, 2790, 3642, 303, 614, 69, 711, 621, 2346, 4222, 1121, 2488, 3465, 3838, 1242, 2202, 2575, 3387, 2165, 3727, 714, 1763, 1964, 2743, 2752, 2963, 4229, 3389, 3401, 136, 594, 596, 2563, 2718, 1865, 4217, 3035, 610, 2289, 2586, 3875, 1302, 4216, 3511, 3648, 3649, 158, 2080, 2082, 2117, 2843, 4365, 2171, 2373, 2516, 3637, 214, 284, 1276, 2014, 4797, 3506, 3515, 3516, 67, 83, 218, 619, 4602, 3535, 1360, 4311, 3360, 3725, 726, 1023, 1372, 2387, 2479, 2741, 4367, 89, 2386, 2401, 2916, 624, 1657, 1954, 2830, 4496, 3408, 1577, 2101, 2293, 2577, 4548, 3403, 3469, 3519, 650, 1888, 3930, 3168, 3510, 3556, 3620, 3839, 1317, 1866, 2045, 2425, 2712, 3858, 4567, 3422, 3468, 1841, 1863, 3357, 593, 1292, 1346, 1371, 1953, 3497, 3699, 221, 1701, 2744, 2941, 3086, 3154, 3443, 258, 591, 1026, 1379, 1965, 1989, 4137, 3440, 3566, 655, 1342, 1717, 2051, 3162, 3361, 3622, 3641, 710, 1283, 1370, 1382, 1658, 1732, 1895, 2375, 2478, 2576, 3945, 4223, 4433, 3421, 3489, 3635, 649, 699, 1044, 2612, 3180, 3299, 3702, 108, 184, 606, 721, 1081, 1969, 2049, 2111, 2169, 2411, 2492, 2748, 2784, 2828, 3950, 4479, 4820, 3381, 3452, 3613, 160, 623, 701, 1332, 1333, 1345, 1520, 1660, 2166, 2170, 2263, 2410, 2638, 4192, 4509, 3117, 3209, 3256, 3334, 3548, 3703, 3713, 703, 1183, 1572, 1897, 2258, 2261, 2491, 2749, 2769, 2770, 2938, 2939, 3960, 3980, 4213, 4470, 4803, 4819, 3621, 3638, 3744, 1378, 1492, 1584, 1703, 1955, 2431, 2443, 2768, 4156, 4214, 4510, 4601, 3083, 3085, 3100, 3618, 3631, 3797, 723, 1024, 1832, 2138, 2203, 2421, 2764, 2765, 3965, 4211, 4287, 4298, 3287, 3407, 91, 93, 595, 715, 1027, 1350, 1355, 2020, 2333, 2426, 2711, 2763, 2767, 3927, 4549, 4881, 3014, 3015, 3517, 3581, 3724, 94, 1251, 1259, 1353, 1377, 1519, 1583, 1880, 2186, 2218, 2471, 2489, 2739, 3867, 3868, 4210, 4376, 4439, 4885, 3333, 3372, 3373, 3451, 3607, 299, 599, 618, 700, 1109, 1117, 1175, 1367, 1518, 1626, 1948, 2130, 2136, 2154, 2221, 2441, 2446, 2448, 2671, 2704, 2762, 2940, 2957, 2958, 4181, 4207, 4324, 3016, 3170, 3547, 3580, 3749, 211, 585, 590, 605, 717, 720, 906, 990, 1084, 1159, 1334, 1470, 1524, 1705, 1886, 1906, 1926, 1961, 1991, 2072, 2316, 2424, 2490, 2945, 3894, 3946, 4164, 4550, 4568, 4569, 4768, 3077, 3433, 3628, 3629, 92, 96, 269, 603, 648, 712, 980, 1331, 1707, 1887, 1944, 2114, 2419, 2445, 2447, 2450, 2539, 2677, 2713, 2895, 2907, 4255, 4552, 4780, 2990, 3255, 3288, 3368, 3466, 3585, 3619, 208, 277, 316, 329, 330, 1287, 1352, 1376, 1521, 1522, 1949, 2019, 2044, 2113, 2220, 2248, 2299, 2413, 2428, 2440, 2714, 2717, 2798, 2799, 3865, 4565, 4763, 3012, 3400, 3404, 3453, 3509, 3664, 3701, 3754, 6, 244, 304, 600, 604, 1047, 1221, 1286, 1354, 1359, 1708, 1709, 1884, 1957, 1960, 2018, 2021, 2152, 2187, 2235, 2412, 2420, 2640, 2746, 2785, 2862, 3862, 3863, 3923, 4180, 4766, 4778, 4779, 3450, 3572, 3579, 3584, 3646, 3654, 268, 318, 322, 331, 583, 707, 722, 1076, 1160, 1164, 1284, 1285, 1312, 1517, 1710, 1828, 1889, 2009, 2222, 2228, 2383, 2409, 2415, 2442, 2574, 2675, 3928, 4153, 4206, 4269, 4368, 4438, 4649, 4767, 3063, 3148, 3513, 3514, 3612, 3645, 65, 210, 274, 587, 608, 613, 708, 713, 984, 1075, 1167, 1369, 1713, 1743, 1829, 1834, 1849, 1885, 2048, 2081, 2278, 2296, 2305, 2408, 2462, 2474, 2766, 4191, 3043, 3393, 3578, 3647, 3655, 3700, 90, 207, 288, 320, 323, 324, 349, 597, 607, 709, 855, 905, 1166, 1169, 1252, 1437, 1890, 2005, 2015, 2414, 2423, 2467, 2745, 2783, 2937, 2951, 3900, 4811, 4812, 4815, 4911, 3017, 3048, 3101, 3171, 3229, 3242, 3243, 3406, 3554, 3555, 3627, 3650, 3657, 3708, 110, 186, 190, 191, 212, 321, 327, 328, 352, 375, 580, 582, 589, 625, 727, 851, 977, 1077, 1118, 1147, 1243, 1304, 1314, 1746, 1830, 1831, 1839, 1950, 1951, 1952, 2041, 2254, 2256, 2285, 2297, 2298, 2320, 2382, 2416, 2417, 2473, 2579, 2580, 2663, 2678, 2710, 2715, 2716, 2753, 2800, 2801, 3846, 3864, 3910, 3964, 4209, 4303, 4321, 4339, 4366, 4436, 4471, 4523, 4547, 4608, 4848, 3050, 3152, 3176, 3190, 3211, 3392, 3405, 3549, 3553, 3583, 3611, 3742, 3752, 3753, 3765, 3767, 3774, 5, 8, 82, 185, 188, 192, 257, 276, 325, 326, 348, 351, 356, 598, 620, 658, 696, 705, 856, 985, 1048, 1122, 1148, 1149, 1168, 1179, 1239, 1383, 1491, 1649, 1693, 1704, 1850, 1881, 1947, 1993, 2006, 2027, 2250, 2255, 2308, 2314, 2315, 2322, 2427, 2613, 2649, 2823, 3911, 3919, 3949, 3966, 4133, 4168, 4182, 4230, 4270, 4322, 4361, 4524, 4551, 3073, 3119, 3195, 3196, 3201, 3259, 3543, 154, 259, 261, 347, 350, 353, 579, 602, 612, 702, 706, 982, 1078, 1381, 1593, 1833, 1925, 1987, 1990, 2306, 2319, 2385, 2432, 2578, 2626, 2868, 3869, 3916, 3982, 4149, 4520, 4607, 3449, 3542, 3544, 3552, 3571, 3582, 3750, 3771, 3791, 95, 196, 203, 204, 205, 242, 243, 346, 581, 586, 601, 615, 622, 626, 627, 691, 716, 725, 983, 986, 1085, 1089, 1161, 1174, 1204, 1349, 1471, 1506, 1688, 1689, 1691, 1726, 1851, 1891, 2233, 2311, 2321, 2422, 2444, 2452, 2959, 4135, 4165, 4166, 4256, 4281, 4319, 4434, 4490, 4531, 4887, 4912) } - internal val argNames: Map> by lazy { mapOf(5 to arrayOf("n"), 6 to arrayOf("n"), 7 to arrayOf("who"), 8 to arrayOf("title"), 65 to arrayOf("state"), 67 to arrayOf("listen"), 69 to arrayOf("listen"), 82 to arrayOf("version"), 83 to arrayOf("count", "plural"), 89 to arrayOf("size", "limit"), 90 to arrayOf("name"), 91 to arrayOf("dir"), 92 to arrayOf("dir"), 93 to arrayOf("name"), 94 to arrayOf("name"), 95 to arrayOf("path"), 96 to arrayOf("path"), 97 to arrayOf("name"), 108 to arrayOf("first"), 110 to arrayOf("n"), 136 to arrayOf("count", "plural"), 154 to arrayOf("tool"), 158 to arrayOf("n"), 160 to arrayOf("name"), 184 to arrayOf("pid", "cmd"), 185 to arrayOf("title", "ago"), 186 to arrayOf("name", "who", "n"), 188 to arrayOf("line"), 190 to arrayOf("n"), 191 to arrayOf("n"), 192 to arrayOf("n"), 196 to arrayOf("name"), 203 to arrayOf("when"), 204 to arrayOf("text", "when"), 205 to arrayOf("when"), 207 to arrayOf("count", "plural"), 208 to arrayOf("count", "plural"), 210 to arrayOf("took", "ago"), 211 to arrayOf("ago"), 212 to arrayOf("kind"), 214 to arrayOf("kind", "code", "why"), 218 to arrayOf("clock"), 221 to arrayOf("build"), 242 to arrayOf("step"), 243 to arrayOf("turn"), 244 to arrayOf("branch"), 257 to arrayOf("step", "total"), 258 to arrayOf("step", "total"), 259 to arrayOf("when"), 261 to arrayOf("tool"), 268 to arrayOf("count", "plural"), 269 to arrayOf("count", "total"), 274 to arrayOf("old", "new"), 276 to arrayOf("version"), 277 to arrayOf("count"), 278 to arrayOf("tag"), 283 to arrayOf("version"), 284 to arrayOf("old", "version"), 285 to arrayOf("version"), 288 to arrayOf("version"), 299 to arrayOf("project", "location"), 303 to arrayOf("account"), 304 to arrayOf("account"), 316 to arrayOf("n"), 318 to arrayOf("n"), 320 to arrayOf("minute"), 321 to arrayOf("time"), 322 to arrayOf("time"), 323 to arrayOf("clock"), 324 to arrayOf("clock", "took"), 325 to arrayOf("clock"), 326 to arrayOf("clock", "took"), 327 to arrayOf("clock"), 328 to arrayOf("clock", "took"), 329 to arrayOf("clock"), 330 to arrayOf("clock", "took"), 331 to arrayOf("clock"), 346 to arrayOf("target"), 347 to arrayOf("target"), 348 to arrayOf("target"), 349 to arrayOf("target"), 350 to arrayOf("target"), 351 to arrayOf("target"), 352 to arrayOf("target"), 353 to arrayOf("target"), 356 to arrayOf("name"), 375 to arrayOf("t"), 418 to arrayOf("minutes", "plural"), 452 to arrayOf("path"), 579 to arrayOf("count"), 580 to arrayOf("count"), 581 to arrayOf("title"), 582 to arrayOf("path"), 583 to arrayOf("path", "error"), 584 to arrayOf("first", "last", "count"), 585 to arrayOf("task", "step"), 586 to arrayOf("count"), 587 to arrayOf("path"), 588 to arrayOf("count", "plural"), 589 to arrayOf("label"), 590 to arrayOf("provider"), 591 to arrayOf("version"), 593 to arrayOf("key"), 594 to arrayOf("device"), 595 to arrayOf("kind", "device"), 596 to arrayOf("status"), 597 to arrayOf("kind", "title"), 598 to arrayOf("layer"), 599 to arrayOf("error"), 600 to arrayOf("page"), 601 to arrayOf("page", "kind", "total"), 602 to arrayOf("reason"), 603 to arrayOf("tag"), 604 to arrayOf("tag"), 605 to arrayOf("title"), 606 to arrayOf("title"), 607 to arrayOf("text", "time"), 608 to arrayOf("kind", "device"), 609 to arrayOf("device"), 610 to arrayOf("device"), 611 to arrayOf("word"), 612 to arrayOf("word", "kind", "count"), 613 to arrayOf("error"), 614 to arrayOf("count"), 615 to arrayOf("time", "relative", "rel", "zoned", "zone"), 616 to arrayOf("zone"), 617 to arrayOf("zone"), 618 to arrayOf("id", "state", "count", "age"), 619 to arrayOf("id"), 620 to arrayOf("name"), 621 to arrayOf("name"), 622 to arrayOf("clock", "count", "plural"), 623 to arrayOf("name"), 624 to arrayOf("name"), 625 to arrayOf("name"), 626 to arrayOf("count"), 627 to arrayOf("count"), 631 to arrayOf("name", "state"), 632 to arrayOf("author", "place", "state"), 633 to arrayOf("title", "state"), 648 to arrayOf("error"), 649 to arrayOf("error"), 650 to arrayOf("host"), 655 to arrayOf("email"), 658 to arrayOf("version"), 660 to arrayOf("first", "last", "count"), 661 to arrayOf("n"), 662 to arrayOf("n"), 691 to arrayOf("ref"), 696 to arrayOf("name"), 697 to arrayOf("name"), 699 to arrayOf("name"), 700 to arrayOf("name"), 701 to arrayOf("action"), 702 to arrayOf("label"), 703 to arrayOf("count", "plural"), 705 to arrayOf("path"), 706 to arrayOf("word", "kind", "count"), 707 to arrayOf("name"), 708 to arrayOf("name"), 709 to arrayOf("name"), 710 to arrayOf("name"), 711 to arrayOf("url"), 712 to arrayOf("count"), 713 to arrayOf("count"), 714 to arrayOf("device"), 715 to arrayOf("device"), 716 to arrayOf("count"), 717 to arrayOf("label"), 718 to arrayOf("label"), 719 to arrayOf("label"), 720 to arrayOf("title"), 721 to arrayOf("title"), 722 to arrayOf("state"), 723 to arrayOf("open", "kind"), 725 to arrayOf("count"), 726 to arrayOf("email"), 727 to arrayOf("email"), 851 to arrayOf("at", "count"), 855 to arrayOf("name"), 856 to arrayOf("name"), 905 to arrayOf("name"), 906 to arrayOf("name"), 977 to arrayOf("count"), 980 to arrayOf("name"), 981 to arrayOf("name", "count"), 982 to arrayOf("label", "n"), 983 to arrayOf("action"), 984 to arrayOf("count", "plural"), 985 to arrayOf("count"), 986 to arrayOf("waiting", "busy", "done"), 990 to arrayOf("count", "plural"), 1023 to arrayOf("name"), 1024 to arrayOf("name"), 1026 to arrayOf("seconds", "long"), 1027 to arrayOf("size", "triangles", "delayed", "waited", "built"), 1028 to arrayOf("size", "delayed", "waited"), 1044 to arrayOf("name"), 1047 to arrayOf("name"), 1048 to arrayOf("count"), 1075 to arrayOf("state"), 1076 to arrayOf("bytes"), 1077 to arrayOf("count"), 1078 to arrayOf("when"), 1079 to arrayOf("state", "name"), 1080 to arrayOf("name", "state"), 1081 to arrayOf("reason", "code"), 1084 to arrayOf("kind", "code"), 1085 to arrayOf("number"), 1089 to arrayOf("x", "y"), 1096 to arrayOf("state"), 1097 to arrayOf("label", "example"), 1109 to arrayOf("text"), 1117 to arrayOf("error"), 1118 to arrayOf("kind", "count"), 1121 to arrayOf("name"), 1122 to arrayOf("n"), 1147 to arrayOf("ago"), 1148 to arrayOf("name"), 1149 to arrayOf("kind", "place", "hub"), 1159 to arrayOf("label"), 1160 to arrayOf("word"), 1161 to arrayOf("count"), 1164 to arrayOf("hub"), 1166 to arrayOf("count"), 1167 to arrayOf("state"), 1168 to arrayOf("label"), 1169 to arrayOf("label"), 1174 to arrayOf("state", "text"), 1175 to arrayOf("text"), 1177 to arrayOf("question"), 1179 to arrayOf("label"), 1183 to arrayOf("title"), 1204 to arrayOf("count"), 1205 to arrayOf("name", "counts"), 1219 to arrayOf("n"), 1221 to arrayOf("mode"), 1238 to arrayOf("first", "last", "total"), 1239 to arrayOf("count"), 1242 to arrayOf("n"), 1243 to arrayOf("who", "name"), 1251 to arrayOf("name"), 1252 to arrayOf("when"), 1259 to arrayOf("why"), 1276 to arrayOf("name"), 1283 to arrayOf("kind"), 1284 to arrayOf("title"), 1285 to arrayOf("title"), 1286 to arrayOf("title"), 1287 to arrayOf("title"), 1292 to arrayOf("name"), 1302 to arrayOf("heard"), 1303 to arrayOf("out", "heard"), 1304 to arrayOf("heard"), 1312 to arrayOf("name", "mb"), 1314 to arrayOf("name"), 1317 to arrayOf("platform"), 1321 to arrayOf("heard", "out", "yes"), 1331 to arrayOf("name", "done", "total", "percent"), 1332 to arrayOf("name", "done"), 1333 to arrayOf("name"), 1334 to arrayOf("error"), 1336 to arrayOf("mb"), 1342 to arrayOf("mb"), 1345 to arrayOf("n"), 1346 to arrayOf("n"), 1349 to arrayOf("n"), 1350 to arrayOf("pct"), 1351 to arrayOf("px"), 1352 to arrayOf("version"), 1353 to arrayOf("tag"), 1354 to arrayOf("tag"), 1355 to arrayOf("hub"), 1359 to arrayOf("tag"), 1360 to arrayOf("tag"), 1367 to arrayOf("when"), 1369 to arrayOf("tag"), 1370 to arrayOf("tag", "when"), 1371 to arrayOf("tag"), 1372 to arrayOf("tag", "when"), 1376 to arrayOf("channel"), 1377 to arrayOf("tag"), 1378 to arrayOf("app", "hub"), 1379 to arrayOf("hub", "app"), 1381 to arrayOf("key"), 1382 to arrayOf("key"), 1383 to arrayOf("why"), 1437 to arrayOf("n"), 1470 to arrayOf("title"), 1471 to arrayOf("note"), 1491 to arrayOf("title"), 1492 to arrayOf("more"), 1506 to arrayOf("bots"), 1517 to arrayOf("name"), 1518 to arrayOf("name", "time"), 1519 to arrayOf("name", "n"), 1520 to arrayOf("name", "time", "n"), 1521 to arrayOf("to"), 1522 to arrayOf("to", "step"), 1524 to arrayOf("note"), 1572 to arrayOf("why"), 1577 to arrayOf("e"), 1583 to arrayOf("max"), 1584 to arrayOf("secs", "max", "mib"), 1593 to arrayOf("path"), 1626 to arrayOf("secs"), 1649 to arrayOf("pct", "scope"), 1657 to arrayOf("n"), 1658 to arrayOf("n"), 1659 to arrayOf("n"), 1660 to arrayOf("n"), 1688 to arrayOf("d", "h"), 1689 to arrayOf("h", "m"), 1690 to arrayOf("m"), 1691 to arrayOf("window", "pct"), 1693 to arrayOf("when"), 1695 to arrayOf("label", "e"), 1697 to arrayOf("from", "to", "total"), 1701 to arrayOf("messages", "lines", "left"), 1703 to arrayOf("pct", "view", "max"), 1704 to arrayOf("pct"), 1705 to arrayOf("done", "total"), 1707 to arrayOf("n"), 1708 to arrayOf("n"), 1709 to arrayOf("time"), 1710 to arrayOf("view", "max"), 1711 to arrayOf("view", "max"), 1713 to arrayOf("more"), 1717 to arrayOf("n"), 1726 to arrayOf("n"), 1732 to arrayOf("page"), 1743 to arrayOf("title"), 1746 to arrayOf("n"), 1763 to arrayOf("name"), 1828 to arrayOf("line"), 1829 to arrayOf("quote"), 1830 to arrayOf("n"), 1831 to arrayOf("n"), 1832 to arrayOf("n"), 1833 to arrayOf("n"), 1834 to arrayOf("n"), 1839 to arrayOf("held"), 1840 to arrayOf("machine"), 1841 to arrayOf("machine"), 1849 to arrayOf("count", "total"), 1850 to arrayOf("count"), 1851 to arrayOf("n"), 1863 to arrayOf("name"), 1865 to arrayOf("n", "c", "total"), 1866 to arrayOf("n", "c"), 1867 to arrayOf("n", "c", "total", "before"), 1868 to arrayOf("n", "c", "before"), 1880 to arrayOf("name"), 1881 to arrayOf("path"), 1884 to arrayOf("file"), 1885 to arrayOf("path", "n"), 1886 to arrayOf("why"), 1887 to arrayOf("n"), 1888 to arrayOf("name"), 1889 to arrayOf("name"), 1890 to arrayOf("name"), 1891 to arrayOf("n"), 1892 to arrayOf("shown", "n"), 1895 to arrayOf("path"), 1897 to arrayOf("n"), 1906 to arrayOf("status"), 1923 to arrayOf("name", "pct"), 1924 to arrayOf("name", "mb"), 1925 to arrayOf("name"), 1926 to arrayOf("name", "why"), 1944 to arrayOf("machine"), 1947 to arrayOf("n"), 1948 to arrayOf("ref"), 1949 to arrayOf("ref", "sheet"), 1950 to arrayOf("name"), 1951 to arrayOf("name"), 1952 to arrayOf("file", "folder"), 1953 to arrayOf("name", "error"), 1954 to arrayOf("name", "status"), 1955 to arrayOf("name", "error"), 1957 to arrayOf("name"), 1960 to arrayOf("code"), 1961 to arrayOf("error"), 1964 to arrayOf("error"), 1965 to arrayOf("error"), 1969 to arrayOf("error"), 1987 to arrayOf("done", "of"), 1989 to arrayOf("why"), 1990 to arrayOf("path"), 1991 to arrayOf("error"), 1992 to arrayOf("secs"), 1993 to arrayOf("secs"), 2005 to arrayOf("code"), 2006 to arrayOf("code"), 2009 to arrayOf("state"), 2014 to arrayOf("hide", "copy", "paste"), 2015 to arrayOf("n"), 2018 to arrayOf("name"), 2019 to arrayOf("name", "folder"), 2020 to arrayOf("name"), 2021 to arrayOf("name", "percent"), 2027 to arrayOf("folder"), 2037 to arrayOf("w", "h"), 2041 to arrayOf("path"), 2044 to arrayOf("why"), 2045 to arrayOf("mb"), 2048 to arrayOf("n"), 2049 to arrayOf("delete", "undo"), 2050 to arrayOf("delete", "undo"), 2051 to arrayOf("undo"), 2072 to arrayOf("what", "secs"), 2073 to arrayOf("file", "holder"), 2080 to arrayOf("what"), 2081 to arrayOf("what"), 2082 to arrayOf("editor", "why"), 2101 to arrayOf("files"), 2111 to arrayOf("why"), 2113 to arrayOf("title"), 2114 to arrayOf("title"), 2115 to arrayOf("version"), 2116 to arrayOf("version", "size", "folder"), 2117 to arrayOf("version", "size", "folder"), 2126 to arrayOf("title"), 2130 to arrayOf("dir", "files"), 2136 to arrayOf("why"), 2138 to arrayOf("code"), 2152 to arrayOf("origin"), 2154 to arrayOf("why"), 2165 to arrayOf("dir"), 2166 to arrayOf("path"), 2167 to arrayOf("home", "other"), 2169 to arrayOf("path"), 2170 to arrayOf("code", "log"), 2171 to arrayOf("log"), 2173 to arrayOf("addr"), 2186 to arrayOf("home"), 2187 to arrayOf("addr"), 2202 to arrayOf("dir", "why"), 2203 to arrayOf("dir"), 2218 to arrayOf("phase"), 2220 to arrayOf("why"), 2221 to arrayOf("what"), 2222 to arrayOf("code"), 2228 to arrayOf("label"), 2233 to arrayOf("kind"), 2235 to arrayOf("project"), 2248 to arrayOf("what"), 2250 to arrayOf("when"), 2254 to arrayOf("n"), 2255 to arrayOf("n"), 2256 to arrayOf("n"), 2258 to arrayOf("agent"), 2259 to arrayOf("effort"), 2261 to arrayOf("n"), 2263 to arrayOf("model"), 2278 to arrayOf("word"), 2285 to arrayOf("more", "step"), 2289 to arrayOf("name"), 2293 to arrayOf("max", "skipped"), 2296 to arrayOf("name"), 2297 to arrayOf("n"), 2298 to arrayOf("name"), 2299 to arrayOf("name"), 2305 to arrayOf("n"), 2306 to arrayOf("name"), 2308 to arrayOf("price"), 2311 to arrayOf("name"), 2313 to arrayOf("name"), 2314 to arrayOf("name"), 2315 to arrayOf("name"), 2316 to arrayOf("text"), 2319 to arrayOf("key"), 2320 to arrayOf("key"), 2321 to arrayOf("pct"), 2322 to arrayOf("when"), 2333 to arrayOf("n", "upstream"), 2336 to arrayOf("mb"), 2346 to arrayOf("path"), 2347 to arrayOf("path"), 2369 to arrayOf("id"), 2373 to arrayOf("model"), 2374 to arrayOf("platform"), 2375 to arrayOf("version"), 2378 to arrayOf("version", "from", "into"), 2379 to arrayOf("version", "from"), 2382 to arrayOf("version", "path"), 2383 to arrayOf("version", "path"), 2384 to arrayOf("version", "pin", "from"), 2385 to arrayOf("path"), 2386 to arrayOf("version", "path"), 2387 to arrayOf("version", "path", "set"), 2401 to arrayOf("turns", "input", "cread", "cwrite", "output", "cost"), 2408 to arrayOf("tool"), 2409 to arrayOf("tool"), 2410 to arrayOf("tool", "word"), 2411 to arrayOf("tool", "word"), 2412 to arrayOf("tool"), 2413 to arrayOf("tool"), 2414 to arrayOf("due"), 2415 to arrayOf("due"), 2416 to arrayOf("due"), 2417 to arrayOf("due"), 2418 to arrayOf("zone"), 2419 to arrayOf("zone"), 2420 to arrayOf("zone"), 2421 to arrayOf("zone"), 2422 to arrayOf("n"), 2423 to arrayOf("who"), 2424 to arrayOf("n", "who"), 2425 to arrayOf("harness"), 2426 to arrayOf("path"), 2427 to arrayOf("path"), 2428 to arrayOf("path"), 2431 to arrayOf("error", "line"), 2432 to arrayOf("label"), 2440 to arrayOf("who"), 2441 to arrayOf("who"), 2442 to arrayOf("label", "left", "when"), 2443 to arrayOf("left"), 2444 to arrayOf("name", "left"), 2445 to arrayOf("used"), 2446 to arrayOf("used", "limit"), 2447 to arrayOf("used", "reason"), 2448 to arrayOf("used", "limit", "reason"), 2450 to arrayOf("provider"), 2451 to arrayOf("used", "window", "pct"), 2452 to arrayOf("rate"), 2462 to arrayOf("n", "r"), 2467 to arrayOf("time", "n"), 2471 to arrayOf("n", "m"), 2473 to arrayOf("pct"), 2474 to arrayOf("cost", "n"), 2478 to arrayOf("in", "out", "cread", "cwrite"), 2479 to arrayOf("in", "out", "cread", "cwrite", "n"), 2488 to arrayOf("turns", "input", "cread", "cwrite", "output"), 2489 to arrayOf("left", "when"), 2490 to arrayOf("left", "when"), 2491 to arrayOf("left", "when"), 2492 to arrayOf("left", "when"), 2516 to arrayOf("n"), 2539 to arrayOf("when"), 2546 to arrayOf("phrase", "now"), 2557 to arrayOf("s"), 2563 to arrayOf("now"), 2564 to arrayOf("now", "nudge", "sent", "undone"), 2574 to arrayOf("e"), 2575 to arrayOf("a", "ams", "b", "bms"), 2576 to arrayOf("ms"), 2577 to arrayOf("e"), 2578 to arrayOf("t"), 2579 to arrayOf("t"), 2580 to arrayOf("t"), 2586 to arrayOf("why"), 2596 to arrayOf("apps"), 2606 to arrayOf("n"), 2607 to arrayOf("n", "k"), 2612 to arrayOf("stt", "conf"), 2613 to arrayOf("words"), 2623 to arrayOf("into"), 2626 to arrayOf("origin"), 2638 to arrayOf("url"), 2640 to arrayOf("url"), 2648 to arrayOf("i", "n"), 2649 to arrayOf("d", "n"), 2658 to arrayOf("version"), 2659 to arrayOf("version"), 2660 to arrayOf("version"), 2663 to arrayOf("path"), 2671 to arrayOf("addr"), 2675 to arrayOf("label"), 2677 to arrayOf("label"), 2678 to arrayOf("label"), 2682 to arrayOf("label"), 2687 to arrayOf("from"), 2704 to arrayOf("done", "of"), 2710 to arrayOf("n"), 2711 to arrayOf("t", "m"), 2712 to arrayOf("m"), 2713 to arrayOf("b", "m"), 2714 to arrayOf("r", "p"), 2715 to arrayOf("n"), 2716 to arrayOf("n"), 2717 to arrayOf("n"), 2718 to arrayOf("n"), 2721 to arrayOf("n"), 2723 to arrayOf("n"), 2731 to arrayOf("n"), 2737 to arrayOf("name", "gb", "path"), 2739 to arrayOf("path", "why"), 2741 to arrayOf("names"), 2743 to arrayOf("why"), 2744 to arrayOf("p", "pn", "t", "tn", "e", "en"), 2745 to arrayOf("done", "total"), 2746 to arrayOf("n"), 2747 to arrayOf("what"), 2748 to arrayOf("n"), 2749 to arrayOf("n"), 2752 to arrayOf("what"), 2753 to arrayOf("n"), 2755 to arrayOf("why", "from"), 2756 to arrayOf("why"), 2762 to arrayOf("path"), 2763 to arrayOf("path", "who"), 2764 to arrayOf("path"), 2765 to arrayOf("path", "cmd"), 2766 to arrayOf("version", "path"), 2767 to arrayOf("version", "path"), 2768 to arrayOf("version", "path", "who"), 2769 to arrayOf("version", "path"), 2770 to arrayOf("version", "path", "cmd"), 2773 to arrayOf("cmd"), 2783 to arrayOf("name", "version", "path"), 2784 to arrayOf("path", "why"), 2785 to arrayOf("name"), 2787 to arrayOf("version", "cli"), 2788 to arrayOf("cli"), 2790 to arrayOf("version"), 2791 to arrayOf("version"), 2793 to arrayOf("version"), 2795 to arrayOf("version"), 2797 to arrayOf("computer"), 2798 to arrayOf("version", "cli"), 2799 to arrayOf("cli"), 2800 to arrayOf("version", "cli"), 2801 to arrayOf("cli"), 2823 to arrayOf("n"), 2828 to arrayOf("code"), 2830 to arrayOf("e"), 2843 to arrayOf("n"), 2848 to arrayOf("channel"), 2862 to arrayOf("project"), 2868 to arrayOf("n"), 2880 to arrayOf("m"), 2892 to arrayOf("m"), 2895 to arrayOf("m"), 2902 to arrayOf("pages"), 2904 to arrayOf("name"), 2907 to arrayOf("name"), 2916 to arrayOf("d", "n"), 2937 to arrayOf("n", "tools"), 2938 to arrayOf("n", "tools", "d"), 2939 to arrayOf("n", "d"), 2940 to arrayOf("n", "what"), 2941 to arrayOf("n", "d", "what"), 2945 to arrayOf("head"), 2951 to arrayOf("name", "path"), 2957 to arrayOf("page", "net", "near"), 2958 to arrayOf("page", "what"), 2959 to arrayOf("ref"), 2963 to arrayOf("page"), 2986 to arrayOf("n"), 2987 to arrayOf("n"), 2988 to arrayOf("n"), 2990 to arrayOf("hub"), 3012 to arrayOf("project"), 3014 to arrayOf("n"), 3015 to arrayOf("n"), 3016 to arrayOf("word"), 3017 to arrayOf("n"), 3035 to arrayOf("name"), 3043 to arrayOf("answer"), 3048 to arrayOf("why"), 3050 to arrayOf("hub"), 3056 to arrayOf("from", "to"), 3063 to arrayOf("project"), 3073 to arrayOf("name"), 3077 to arrayOf("n"), 3083 to arrayOf("code"), 3084 to arrayOf("hub"), 3085 to arrayOf("hub"), 3086 to arrayOf("hub"), 3100 to arrayOf("n"), 3101 to arrayOf("n"), 3117 to arrayOf("status"), 3119 to arrayOf("status"), 3148 to arrayOf("project"), 3152 to arrayOf("code"), 3154 to arrayOf("why"), 3162 to arrayOf("title"), 3168 to arrayOf("title"), 3170 to arrayOf("q"), 3171 to arrayOf("title"), 3176 to arrayOf("room"), 3180 to arrayOf("q"), 3190 to arrayOf("title"), 3195 to arrayOf("n"), 3196 to arrayOf("n"), 3201 to arrayOf("at"), 3209 to arrayOf("size"), 3211 to arrayOf("n", "total"), 3228 to arrayOf("n"), 3229 to arrayOf("what"), 3232 to arrayOf("device"), 3233 to arrayOf("device"), 3242 to arrayOf("word", "count"), 3243 to arrayOf("heard"), 3255 to arrayOf("files"), 3256 to arrayOf("files"), 3259 to arrayOf("name"), 3287 to arrayOf("n"), 3288 to arrayOf("n"), 3299 to arrayOf("n"), 3333 to arrayOf("root"), 3334 to arrayOf("path"), 3357 to arrayOf("name"), 3360 to arrayOf("until"), 3361 to arrayOf("error"), 3368 to arrayOf("url"), 3372 to arrayOf("name"), 3373 to arrayOf("name"), 3381 to arrayOf("code", "hub", "until"), 3382 to arrayOf("url"), 3386 to arrayOf("kinds"), 3387 to arrayOf("address"), 3389 to arrayOf("address"), 3392 to arrayOf("url"), 3393 to arrayOf("url"), 3394 to arrayOf("url"), 3395 to arrayOf("url", "via"), 3400 to arrayOf("name"), 3401 to arrayOf("url", "check", "left"), 3403 to arrayOf("check"), 3404 to arrayOf("address"), 3405 to arrayOf("name"), 3406 to arrayOf("error"), 3407 to arrayOf("url"), 3408 to arrayOf("url"), 3415 to arrayOf("code", "address", "left"), 3421 to arrayOf("name"), 3422 to arrayOf("name"), 3433 to arrayOf("address"), 3440 to arrayOf("code", "body"), 3443 to arrayOf("code", "body"), 3449 to arrayOf("window", "used"), 3450 to arrayOf("window", "used", "when"), 3451 to arrayOf("window", "used"), 3452 to arrayOf("window", "used", "when"), 3453 to arrayOf("provider"), 3465 to arrayOf("label"), 3466 to arrayOf("when"), 3468 to arrayOf("provider"), 3469 to arrayOf("provider", "title", "why"), 3489 to arrayOf("reason"), 3497 to arrayOf("code"), 3506 to arrayOf("name"), 3509 to arrayOf("version"), 3510 to arrayOf("version"), 3511 to arrayOf("version"), 3513 to arrayOf("version"), 3514 to arrayOf("version"), 3515 to arrayOf("version"), 3516 to arrayOf("version", "why"), 3517 to arrayOf("version"), 3519 to arrayOf("code"), 3535 to arrayOf("name"), 3542 to arrayOf("count"), 3543 to arrayOf("title"), 3544 to arrayOf("name"), 3547 to arrayOf("n", "holder"), 3548 to arrayOf("n", "title"), 3549 to arrayOf("title"), 3552 to arrayOf("n"), 3553 to arrayOf("n"), 3554 to arrayOf("n"), 3555 to arrayOf("n"), 3556 to arrayOf("harness", "typed", "type", "remote", "host", "wt", "branch"), 3566 to arrayOf("pid"), 3571 to arrayOf("left"), 3572 to arrayOf("left"), 3578 to arrayOf("left"), 3579 to arrayOf("left"), 3580 to arrayOf("left"), 3581 to arrayOf("left"), 3582 to arrayOf("label", "left"), 3583 to arrayOf("when"), 3584 to arrayOf("used"), 3585 to arrayOf("used", "limit"), 3607 to arrayOf("tracking"), 3611 to arrayOf("total"), 3612 to arrayOf("price"), 3613 to arrayOf("price"), 3618 to arrayOf("n"), 3619 to arrayOf("parts"), 3620 to arrayOf("note"), 3621 to arrayOf("error"), 3622 to arrayOf("error", "parts"), 3627 to arrayOf("state"), 3628 to arrayOf("name", "path"), 3629 to arrayOf("name", "path", "why"), 3631 to arrayOf("code"), 3635 to arrayOf("detail"), 3637 to arrayOf("why"), 3638 to arrayOf("parts"), 3641 to arrayOf("build", "to"), 3642 to arrayOf("build"), 3643 to arrayOf("build", "skip"), 3645 to arrayOf("why"), 3646 to arrayOf("why"), 3647 to arrayOf("build"), 3648 to arrayOf("build", "why"), 3649 to arrayOf("build"), 3650 to arrayOf("build"), 3654 to arrayOf("build"), 3655 to arrayOf("build"), 3657 to arrayOf("build"), 3664 to arrayOf("build"), 3698 to arrayOf("step"), 3699 to arrayOf("p", "pt", "t", "tt", "e", "et"), 3700 to arrayOf("done", "total"), 3701 to arrayOf("n"), 3702 to arrayOf("n"), 3703 to arrayOf("n"), 3708 to arrayOf("n"), 3711 to arrayOf("why"), 3712 to arrayOf("why", "from"), 3713 to arrayOf("error"), 3715 to arrayOf("n"), 3716 to arrayOf("n"), 3720 to arrayOf("n"), 3723 to arrayOf("name", "gb", "path"), 3724 to arrayOf("path", "why"), 3725 to arrayOf("names"), 3727 to arrayOf("why"), 3738 to arrayOf("n", "total"), 3742 to arrayOf("title"), 3744 to arrayOf("n"), 3748 to arrayOf("name"), 3749 to arrayOf("title"), 3750 to arrayOf("note"), 3752 to arrayOf("machine"), 3753 to arrayOf("machines"), 3754 to arrayOf("machine"), 3765 to arrayOf("n"), 3767 to arrayOf("n"), 3771 to arrayOf("name"), 3774 to arrayOf("name"), 3791 to arrayOf("why"), 3797 to arrayOf("project"), 3838 to arrayOf("path"), 3839 to arrayOf("path"), 3841 to arrayOf("have", "total"), 3846 to arrayOf("n"), 3855 to arrayOf("hub"), 3858 to arrayOf("title"), 3862 to arrayOf("project"), 3863 to arrayOf("project"), 3864 to arrayOf("n"), 3865 to arrayOf("hub"), 3867 to arrayOf("n"), 3868 to arrayOf("n"), 3869 to arrayOf("model"), 3875 to arrayOf("name"), 3894 to arrayOf("word"), 3900 to arrayOf("answer"), 3910 to arrayOf("version", "build"), 3911 to arrayOf("hub"), 3916 to arrayOf("name"), 3919 to arrayOf("when", "who", "mark"), 3923 to arrayOf("who"), 3927 to arrayOf("time"), 3928 to arrayOf("address"), 3930 to arrayOf("kind", "name"), 3945 to arrayOf("title"), 3946 to arrayOf("query"), 3949 to arrayOf("room"), 3950 to arrayOf("query"), 3952 to arrayOf("n"), 3953 to arrayOf("n"), 3954 to arrayOf("n"), 3960 to arrayOf("size"), 3964 to arrayOf("n"), 3965 to arrayOf("n"), 3966 to arrayOf("n"), 3980 to arrayOf("status"), 3982 to arrayOf("status"), 4133 to arrayOf("code"), 4135 to arrayOf("n"), 4137 to arrayOf("why"), 4149 to arrayOf("done", "of"), 4153 to arrayOf("thread"), 4156 to arrayOf("n"), 4164 to arrayOf("title"), 4165 to arrayOf("note"), 4166 to arrayOf("label"), 4167 to arrayOf("machine"), 4168 to arrayOf("machine"), 4175 to arrayOf("at", "total"), 4176 to arrayOf("at", "total"), 4180 to arrayOf("machine"), 4181 to arrayOf("machine"), 4182 to arrayOf("machines"), 4184 to arrayOf("device"), 4191 to arrayOf("price"), 4192 to arrayOf("price"), 4199 to arrayOf("home"), 4204 to arrayOf("from"), 4206 to arrayOf("note"), 4207 to arrayOf("note"), 4209 to arrayOf("v"), 4210 to arrayOf("v"), 4211 to arrayOf("v", "who"), 4213 to arrayOf("who"), 4214 to arrayOf("v"), 4216 to arrayOf("v", "cmd"), 4217 to arrayOf("cmd"), 4222 to arrayOf("v", "path"), 4223 to arrayOf("v", "note"), 4224 to arrayOf("v"), 4229 to arrayOf("tool"), 4230 to arrayOf("tool"), 4255 to arrayOf("n", "w"), 4256 to arrayOf("why"), 4257 to arrayOf("state", "why"), 4269 to arrayOf("project"), 4270 to arrayOf("n"), 4281 to arrayOf("why"), 4287 to arrayOf("name"), 4298 to arrayOf("project"), 4303 to arrayOf("n"), 4311 to arrayOf("names"), 4319 to arrayOf("dest"), 4321 to arrayOf("repo"), 4322 to arrayOf("repo"), 4324 to arrayOf("url"), 4339 to arrayOf("time"), 4361 to arrayOf("group"), 4365 to arrayOf("project"), 4366 to arrayOf("n"), 4367 to arrayOf("n"), 4368 to arrayOf("n"), 4376 to arrayOf("n"), 4433 to arrayOf("n"), 4434 to arrayOf("n"), 4435 to arrayOf("a", "b"), 4436 to arrayOf("n"), 4438 to arrayOf("parts", "lines"), 4439 to arrayOf("n"), 4470 to arrayOf("what", "project", "fab"), 4471 to arrayOf("rev", "day"), 4479 to arrayOf("n"), 4490 to arrayOf("layer"), 4491 to arrayOf("n"), 4496 to arrayOf("board"), 4508 to arrayOf("others"), 4509 to arrayOf("must", "should", "notes"), 4510 to arrayOf("id", "w"), 4520 to arrayOf("what"), 4523 to arrayOf("why"), 4524 to arrayOf("why"), 4531 to arrayOf("n"), 4547 to arrayOf("price", "n"), 4548 to arrayOf("n", "need"), 4549 to arrayOf("n"), 4550 to arrayOf("n"), 4551 to arrayOf("cost"), 4552 to arrayOf("cost"), 4565 to arrayOf("day", "n"), 4566 to arrayOf("day"), 4567 to arrayOf("cost", "n", "lines"), 4568 to arrayOf("stock", "price"), 4569 to arrayOf("lines"), 4590 to arrayOf("host"), 4601 to arrayOf("n"), 4602 to arrayOf("a", "b"), 4603 to arrayOf("n"), 4604 to arrayOf("n"), 4607 to arrayOf("day"), 4608 to arrayOf("n"), 4649 to arrayOf("turn"), 4763 to arrayOf("text"), 4766 to arrayOf("repo", "dest"), 4767 to arrayOf("repo", "dest"), 4768 to arrayOf("repo"), 4773 to arrayOf("dir"), 4774 to arrayOf("dir"), 4778 to arrayOf("editor", "job", "secs"), 4779 to arrayOf("editor", "secs"), 4780 to arrayOf("editor"), 4797 to arrayOf("time"), 4803 to arrayOf("status"), 4811 to arrayOf("time"), 4812 to arrayOf("time", "dur"), 4815 to arrayOf("answer"), 4819 to arrayOf("type"), 4820 to arrayOf("max"), 4848 to arrayOf("bytes", "tokens"), 4881 to arrayOf("what"), 4885 to arrayOf("n"), 4887 to arrayOf("n"), 4911 to arrayOf("n"), 4912 to arrayOf("done", "total"), 4920 to arrayOf("v"), 4921 to arrayOf("x", "y"), 4927 to arrayOf("machine")) } + internal val templates: IntArray by lazy { intArrayOf(2369, 2848, 2660, 2659, 2658, 2880, 2902, 3382, 2623, 418, 2793, 2791, 2687, 2378, 2384, 2795, 2892, 2607, 2606, 285, 2336, 2797, 2904, 3232, 4184, 2546, 4927, 2596, 2050, 2374, 3716, 2115, 2723, 2379, 3233, 1336, 4204, 4224, 3715, 2564, 2721, 1867, 4199, 2126, 2167, 2173, 4566, 283, 2116, 4508, 3394, 3415, 2073, 2347, 3712, 452, 2755, 2787, 2788, 3395, 3711, 2756, 3643, 609, 1711, 3720, 1868, 2731, 3723, 2737, 3386, 616, 617, 2773, 3084, 3698, 1659, 2790, 3642, 303, 614, 69, 711, 621, 2346, 4222, 1121, 2488, 3465, 3838, 1242, 2202, 2575, 3387, 2165, 3727, 714, 1763, 1964, 2743, 2752, 2963, 4229, 3389, 3401, 136, 594, 596, 2563, 2718, 1865, 4217, 3035, 610, 2289, 2586, 3875, 1302, 4216, 3511, 3648, 3649, 158, 2080, 2082, 2117, 2843, 4365, 2171, 2373, 2516, 3637, 214, 284, 1276, 2014, 4797, 3506, 3515, 3516, 67, 83, 218, 619, 4602, 3535, 1360, 4311, 3360, 3725, 726, 1023, 1372, 2387, 2479, 2741, 4367, 89, 2386, 2401, 2916, 624, 1657, 1954, 2830, 4496, 3408, 1577, 2101, 2293, 2577, 4548, 3403, 3469, 3519, 650, 1888, 3930, 3168, 3510, 3556, 3620, 3839, 1317, 1866, 2045, 2425, 2712, 3858, 4567, 3422, 3468, 1841, 1863, 3357, 593, 1292, 1346, 1371, 1953, 3497, 3699, 221, 1701, 2744, 2941, 3086, 3154, 3443, 258, 591, 1026, 1379, 1965, 1989, 4137, 3440, 3566, 655, 1342, 1717, 2051, 3162, 3361, 3622, 3641, 710, 1283, 1370, 1382, 1658, 1732, 1895, 2375, 2478, 2576, 3945, 4223, 4433, 3421, 3489, 3635, 649, 699, 1044, 2612, 3180, 3299, 3702, 108, 184, 606, 721, 1081, 1969, 2049, 2111, 2169, 2411, 2492, 2748, 2784, 2828, 3950, 4479, 4820, 3381, 3452, 3613, 160, 623, 701, 1332, 1333, 1345, 1520, 1660, 2166, 2170, 2263, 2410, 2638, 4192, 4509, 3117, 3209, 3256, 3334, 3548, 3703, 3713, 703, 1183, 1572, 1897, 2258, 2261, 2491, 2749, 2769, 2770, 2938, 2939, 3960, 3980, 4213, 4470, 4803, 4819, 3621, 3638, 3744, 1378, 1492, 1584, 1703, 1955, 2431, 2443, 2768, 4156, 4214, 4510, 4601, 3083, 3085, 3100, 3618, 3631, 3797, 723, 1024, 1832, 2138, 2203, 2421, 2764, 2765, 3965, 4211, 4287, 4298, 3287, 3407, 91, 93, 595, 715, 1027, 1350, 1355, 2020, 2333, 2426, 2711, 2763, 2767, 3927, 4549, 4881, 3014, 3015, 3517, 3581, 3724, 94, 1251, 1259, 1353, 1377, 1519, 1583, 1880, 2186, 2218, 2471, 2489, 2739, 3867, 3868, 4210, 4376, 4439, 4885, 3333, 3372, 3373, 3451, 3607, 299, 599, 618, 700, 1109, 1117, 1175, 1367, 1518, 1626, 1948, 2130, 2136, 2154, 2221, 2441, 2446, 2448, 2671, 2704, 2762, 2940, 2957, 2958, 4181, 4207, 4324, 3016, 3170, 3547, 3580, 3749, 211, 585, 590, 605, 717, 720, 906, 990, 1084, 1159, 1334, 1470, 1524, 1705, 1886, 1906, 1926, 1961, 1991, 2072, 2316, 2424, 2490, 2945, 3894, 3946, 4164, 4550, 4568, 4569, 4768, 4930, 3077, 3433, 3628, 3629, 92, 96, 269, 603, 648, 712, 980, 1331, 1707, 1887, 1944, 2114, 2419, 2445, 2447, 2450, 2539, 2677, 2713, 2895, 2907, 4255, 4552, 4780, 2990, 3255, 3288, 3368, 3466, 3585, 3619, 208, 277, 316, 329, 330, 1287, 1352, 1376, 1521, 1522, 1949, 2019, 2044, 2113, 2220, 2248, 2299, 2413, 2428, 2440, 2714, 2717, 2798, 2799, 3865, 4565, 4763, 3012, 3400, 3404, 3453, 3509, 3664, 3701, 3754, 6, 244, 304, 600, 604, 1047, 1221, 1286, 1354, 1359, 1708, 1709, 1884, 1957, 1960, 2018, 2021, 2152, 2187, 2235, 2412, 2420, 2640, 2746, 2785, 2862, 3862, 3863, 3923, 4180, 4766, 4778, 4779, 3450, 3572, 3579, 3584, 3646, 3654, 268, 318, 322, 331, 583, 707, 722, 1076, 1160, 1164, 1284, 1285, 1312, 1517, 1710, 1828, 1889, 2009, 2222, 2228, 2383, 2409, 2415, 2442, 2574, 2675, 3928, 4153, 4206, 4269, 4368, 4438, 4649, 4767, 3063, 3148, 3513, 3514, 3612, 3645, 65, 210, 274, 587, 608, 613, 708, 713, 984, 1075, 1167, 1369, 1713, 1743, 1829, 1834, 1849, 1885, 2048, 2081, 2278, 2296, 2305, 2408, 2462, 2474, 2766, 4191, 3043, 3393, 3578, 3647, 3655, 3700, 90, 207, 288, 320, 323, 324, 349, 597, 607, 709, 855, 905, 1166, 1169, 1252, 1437, 1890, 2005, 2015, 2414, 2423, 2467, 2745, 2783, 2937, 2951, 3900, 4811, 4812, 4815, 4911, 3017, 3048, 3101, 3171, 3229, 3242, 3243, 3406, 3554, 3555, 3627, 3650, 3657, 3708, 110, 186, 190, 191, 212, 321, 327, 328, 352, 375, 580, 582, 589, 625, 727, 851, 977, 1077, 1118, 1147, 1243, 1304, 1314, 1746, 1830, 1831, 1839, 1950, 1951, 1952, 2041, 2254, 2256, 2285, 2297, 2298, 2320, 2382, 2416, 2417, 2473, 2579, 2580, 2663, 2678, 2710, 2715, 2716, 2753, 2800, 2801, 3846, 3864, 3910, 3964, 4209, 4303, 4321, 4339, 4366, 4436, 4471, 4523, 4547, 4608, 4848, 4931, 3050, 3152, 3176, 3190, 3211, 3392, 3405, 3549, 3553, 3583, 3611, 3742, 3752, 3753, 3765, 3767, 3774, 5, 8, 82, 185, 188, 192, 257, 276, 325, 326, 348, 351, 356, 598, 620, 658, 696, 705, 856, 985, 1048, 1122, 1148, 1149, 1168, 1179, 1239, 1383, 1491, 1649, 1693, 1704, 1850, 1881, 1947, 1993, 2006, 2027, 2250, 2255, 2308, 2314, 2315, 2322, 2427, 2613, 2649, 2823, 3911, 3919, 3949, 3966, 4133, 4168, 4182, 4230, 4270, 4322, 4361, 4524, 4551, 3073, 3119, 3195, 3196, 3201, 3259, 3543, 154, 259, 261, 347, 350, 353, 579, 602, 612, 702, 706, 982, 1078, 1381, 1593, 1833, 1925, 1987, 1990, 2306, 2319, 2385, 2432, 2578, 2626, 2868, 3869, 3916, 3982, 4149, 4520, 4607, 3449, 3542, 3544, 3552, 3571, 3582, 3750, 3771, 3791, 95, 196, 203, 204, 205, 242, 243, 346, 581, 586, 601, 615, 622, 626, 627, 691, 716, 725, 983, 986, 1085, 1089, 1161, 1174, 1204, 1349, 1471, 1506, 1688, 1689, 1691, 1726, 1851, 1891, 2233, 2311, 2321, 2422, 2444, 2452, 2959, 4135, 4165, 4166, 4256, 4281, 4319, 4434, 4490, 4531, 4887, 4912) } + internal val argNames: Map> by lazy { mapOf(5 to arrayOf("n"), 6 to arrayOf("n"), 7 to arrayOf("who"), 8 to arrayOf("title"), 65 to arrayOf("state"), 67 to arrayOf("listen"), 69 to arrayOf("listen"), 82 to arrayOf("version"), 83 to arrayOf("count", "plural"), 89 to arrayOf("size", "limit"), 90 to arrayOf("name"), 91 to arrayOf("dir"), 92 to arrayOf("dir"), 93 to arrayOf("name"), 94 to arrayOf("name"), 95 to arrayOf("path"), 96 to arrayOf("path"), 97 to arrayOf("name"), 108 to arrayOf("first"), 110 to arrayOf("n"), 136 to arrayOf("count", "plural"), 154 to arrayOf("tool"), 158 to arrayOf("n"), 160 to arrayOf("name"), 184 to arrayOf("pid", "cmd"), 185 to arrayOf("title", "ago"), 186 to arrayOf("name", "who", "n"), 188 to arrayOf("line"), 190 to arrayOf("n"), 191 to arrayOf("n"), 192 to arrayOf("n"), 196 to arrayOf("name"), 203 to arrayOf("when"), 204 to arrayOf("text", "when"), 205 to arrayOf("when"), 207 to arrayOf("count", "plural"), 208 to arrayOf("count", "plural"), 210 to arrayOf("took", "ago"), 211 to arrayOf("ago"), 212 to arrayOf("kind"), 214 to arrayOf("kind", "code", "why"), 218 to arrayOf("clock"), 221 to arrayOf("build"), 242 to arrayOf("step"), 243 to arrayOf("turn"), 244 to arrayOf("branch"), 257 to arrayOf("step", "total"), 258 to arrayOf("step", "total"), 259 to arrayOf("when"), 261 to arrayOf("tool"), 268 to arrayOf("count", "plural"), 269 to arrayOf("count", "total"), 274 to arrayOf("old", "new"), 276 to arrayOf("version"), 277 to arrayOf("count"), 278 to arrayOf("tag"), 283 to arrayOf("version"), 284 to arrayOf("old", "version"), 285 to arrayOf("version"), 288 to arrayOf("version"), 299 to arrayOf("project", "location"), 303 to arrayOf("account"), 304 to arrayOf("account"), 316 to arrayOf("n"), 318 to arrayOf("n"), 320 to arrayOf("minute"), 321 to arrayOf("time"), 322 to arrayOf("time"), 323 to arrayOf("clock"), 324 to arrayOf("clock", "took"), 325 to arrayOf("clock"), 326 to arrayOf("clock", "took"), 327 to arrayOf("clock"), 328 to arrayOf("clock", "took"), 329 to arrayOf("clock"), 330 to arrayOf("clock", "took"), 331 to arrayOf("clock"), 346 to arrayOf("target"), 347 to arrayOf("target"), 348 to arrayOf("target"), 349 to arrayOf("target"), 350 to arrayOf("target"), 351 to arrayOf("target"), 352 to arrayOf("target"), 353 to arrayOf("target"), 356 to arrayOf("name"), 375 to arrayOf("t"), 418 to arrayOf("minutes", "plural"), 452 to arrayOf("path"), 579 to arrayOf("count"), 580 to arrayOf("count"), 581 to arrayOf("title"), 582 to arrayOf("path"), 583 to arrayOf("path", "error"), 584 to arrayOf("first", "last", "count"), 585 to arrayOf("task", "step"), 586 to arrayOf("count"), 587 to arrayOf("path"), 588 to arrayOf("count", "plural"), 589 to arrayOf("label"), 590 to arrayOf("provider"), 591 to arrayOf("version"), 593 to arrayOf("key"), 594 to arrayOf("device"), 595 to arrayOf("kind", "device"), 596 to arrayOf("status"), 597 to arrayOf("kind", "title"), 598 to arrayOf("layer"), 599 to arrayOf("error"), 600 to arrayOf("page"), 601 to arrayOf("page", "kind", "total"), 602 to arrayOf("reason"), 603 to arrayOf("tag"), 604 to arrayOf("tag"), 605 to arrayOf("title"), 606 to arrayOf("title"), 607 to arrayOf("text", "time"), 608 to arrayOf("kind", "device"), 609 to arrayOf("device"), 610 to arrayOf("device"), 611 to arrayOf("word"), 612 to arrayOf("word", "kind", "count"), 613 to arrayOf("error"), 614 to arrayOf("count"), 615 to arrayOf("time", "relative", "rel", "zoned", "zone"), 616 to arrayOf("zone"), 617 to arrayOf("zone"), 618 to arrayOf("id", "state", "count", "age"), 619 to arrayOf("id"), 620 to arrayOf("name"), 621 to arrayOf("name"), 622 to arrayOf("clock", "count", "plural"), 623 to arrayOf("name"), 624 to arrayOf("name"), 625 to arrayOf("name"), 626 to arrayOf("count"), 627 to arrayOf("count"), 631 to arrayOf("name", "state"), 632 to arrayOf("author", "place", "state"), 633 to arrayOf("title", "state"), 648 to arrayOf("error"), 649 to arrayOf("error"), 650 to arrayOf("host"), 655 to arrayOf("email"), 658 to arrayOf("version"), 660 to arrayOf("first", "last", "count"), 661 to arrayOf("n"), 662 to arrayOf("n"), 691 to arrayOf("ref"), 696 to arrayOf("name"), 697 to arrayOf("name"), 699 to arrayOf("name"), 700 to arrayOf("name"), 701 to arrayOf("action"), 702 to arrayOf("label"), 703 to arrayOf("count", "plural"), 705 to arrayOf("path"), 706 to arrayOf("word", "kind", "count"), 707 to arrayOf("name"), 708 to arrayOf("name"), 709 to arrayOf("name"), 710 to arrayOf("name"), 711 to arrayOf("url"), 712 to arrayOf("count"), 713 to arrayOf("count"), 714 to arrayOf("device"), 715 to arrayOf("device"), 716 to arrayOf("count"), 717 to arrayOf("label"), 718 to arrayOf("label"), 719 to arrayOf("label"), 720 to arrayOf("title"), 721 to arrayOf("title"), 722 to arrayOf("state"), 723 to arrayOf("open", "kind"), 725 to arrayOf("count"), 726 to arrayOf("email"), 727 to arrayOf("email"), 851 to arrayOf("at", "count"), 855 to arrayOf("name"), 856 to arrayOf("name"), 905 to arrayOf("name"), 906 to arrayOf("name"), 977 to arrayOf("count"), 980 to arrayOf("name"), 981 to arrayOf("name", "count"), 982 to arrayOf("label", "n"), 983 to arrayOf("action"), 984 to arrayOf("count", "plural"), 985 to arrayOf("count"), 986 to arrayOf("waiting", "busy", "done"), 990 to arrayOf("count", "plural"), 1023 to arrayOf("name"), 1024 to arrayOf("name"), 1026 to arrayOf("seconds", "long"), 1027 to arrayOf("size", "triangles", "delayed", "waited", "built"), 1028 to arrayOf("size", "delayed", "waited"), 1044 to arrayOf("name"), 1047 to arrayOf("name"), 1048 to arrayOf("count"), 1075 to arrayOf("state"), 1076 to arrayOf("bytes"), 1077 to arrayOf("count"), 1078 to arrayOf("when"), 1079 to arrayOf("state", "name"), 1080 to arrayOf("name", "state"), 1081 to arrayOf("reason", "code"), 1084 to arrayOf("kind", "code"), 1085 to arrayOf("number"), 1089 to arrayOf("x", "y"), 1096 to arrayOf("state"), 1097 to arrayOf("label", "example"), 1109 to arrayOf("text"), 1117 to arrayOf("error"), 1118 to arrayOf("kind", "count"), 1121 to arrayOf("name"), 1122 to arrayOf("n"), 1147 to arrayOf("ago"), 1148 to arrayOf("name"), 1149 to arrayOf("kind", "place", "hub"), 1159 to arrayOf("label"), 1160 to arrayOf("word"), 1161 to arrayOf("count"), 1164 to arrayOf("hub"), 1166 to arrayOf("count"), 1167 to arrayOf("state"), 1168 to arrayOf("label"), 1169 to arrayOf("label"), 1174 to arrayOf("state", "text"), 1175 to arrayOf("text"), 1177 to arrayOf("question"), 1179 to arrayOf("label"), 1183 to arrayOf("title"), 1204 to arrayOf("count"), 1205 to arrayOf("name", "counts"), 1219 to arrayOf("n"), 1221 to arrayOf("mode"), 1238 to arrayOf("first", "last", "total"), 1239 to arrayOf("count"), 1242 to arrayOf("n"), 1243 to arrayOf("who", "name"), 1251 to arrayOf("name"), 1252 to arrayOf("when"), 1259 to arrayOf("why"), 1276 to arrayOf("name"), 1283 to arrayOf("kind"), 1284 to arrayOf("title"), 1285 to arrayOf("title"), 1286 to arrayOf("title"), 1287 to arrayOf("title"), 1292 to arrayOf("name"), 1302 to arrayOf("heard"), 1303 to arrayOf("out", "heard"), 1304 to arrayOf("heard"), 1312 to arrayOf("name", "mb"), 1314 to arrayOf("name"), 1317 to arrayOf("platform"), 1321 to arrayOf("heard", "out", "yes"), 1331 to arrayOf("name", "done", "total", "percent"), 1332 to arrayOf("name", "done"), 1333 to arrayOf("name"), 1334 to arrayOf("error"), 1336 to arrayOf("mb"), 1342 to arrayOf("mb"), 1345 to arrayOf("n"), 1346 to arrayOf("n"), 1349 to arrayOf("n"), 1350 to arrayOf("pct"), 1351 to arrayOf("px"), 1352 to arrayOf("version"), 1353 to arrayOf("tag"), 1354 to arrayOf("tag"), 1355 to arrayOf("hub"), 1359 to arrayOf("tag"), 1360 to arrayOf("tag"), 1367 to arrayOf("when"), 1369 to arrayOf("tag"), 1370 to arrayOf("tag", "when"), 1371 to arrayOf("tag"), 1372 to arrayOf("tag", "when"), 1376 to arrayOf("channel"), 1377 to arrayOf("tag"), 1378 to arrayOf("app", "hub"), 1379 to arrayOf("hub", "app"), 1381 to arrayOf("key"), 1382 to arrayOf("key"), 1383 to arrayOf("why"), 1437 to arrayOf("n"), 1470 to arrayOf("title"), 1471 to arrayOf("note"), 1491 to arrayOf("title"), 1492 to arrayOf("more"), 1506 to arrayOf("bots"), 1517 to arrayOf("name"), 1518 to arrayOf("name", "time"), 1519 to arrayOf("name", "n"), 1520 to arrayOf("name", "time", "n"), 1521 to arrayOf("to"), 1522 to arrayOf("to", "step"), 1524 to arrayOf("note"), 1572 to arrayOf("why"), 1577 to arrayOf("e"), 1583 to arrayOf("max"), 1584 to arrayOf("secs", "max", "mib"), 1593 to arrayOf("path"), 1626 to arrayOf("secs"), 1649 to arrayOf("pct", "scope"), 1657 to arrayOf("n"), 1658 to arrayOf("n"), 1659 to arrayOf("n"), 1660 to arrayOf("n"), 1688 to arrayOf("d", "h"), 1689 to arrayOf("h", "m"), 1690 to arrayOf("m"), 1691 to arrayOf("window", "pct"), 1693 to arrayOf("when"), 1695 to arrayOf("label", "e"), 1697 to arrayOf("from", "to", "total"), 1701 to arrayOf("messages", "lines", "left"), 1703 to arrayOf("pct", "view", "max"), 1704 to arrayOf("pct"), 1705 to arrayOf("done", "total"), 1707 to arrayOf("n"), 1708 to arrayOf("n"), 1709 to arrayOf("time"), 1710 to arrayOf("view", "max"), 1711 to arrayOf("view", "max"), 1713 to arrayOf("more"), 1717 to arrayOf("n"), 1726 to arrayOf("n"), 1732 to arrayOf("page"), 1743 to arrayOf("title"), 1746 to arrayOf("n"), 1763 to arrayOf("name"), 1828 to arrayOf("line"), 1829 to arrayOf("quote"), 1830 to arrayOf("n"), 1831 to arrayOf("n"), 1832 to arrayOf("n"), 1833 to arrayOf("n"), 1834 to arrayOf("n"), 1839 to arrayOf("held"), 1840 to arrayOf("machine"), 1841 to arrayOf("machine"), 1849 to arrayOf("count", "total"), 1850 to arrayOf("count"), 1851 to arrayOf("n"), 1863 to arrayOf("name"), 1865 to arrayOf("n", "c", "total"), 1866 to arrayOf("n", "c"), 1867 to arrayOf("n", "c", "total", "before"), 1868 to arrayOf("n", "c", "before"), 1880 to arrayOf("name"), 1881 to arrayOf("path"), 1884 to arrayOf("file"), 1885 to arrayOf("path", "n"), 1886 to arrayOf("why"), 1887 to arrayOf("n"), 1888 to arrayOf("name"), 1889 to arrayOf("name"), 1890 to arrayOf("name"), 1891 to arrayOf("n"), 1892 to arrayOf("shown", "n"), 1895 to arrayOf("path"), 1897 to arrayOf("n"), 1906 to arrayOf("status"), 1923 to arrayOf("name", "pct"), 1924 to arrayOf("name", "mb"), 1925 to arrayOf("name"), 1926 to arrayOf("name", "why"), 1944 to arrayOf("machine"), 1947 to arrayOf("n"), 1948 to arrayOf("ref"), 1949 to arrayOf("ref", "sheet"), 1950 to arrayOf("name"), 1951 to arrayOf("name"), 1952 to arrayOf("file", "folder"), 1953 to arrayOf("name", "error"), 1954 to arrayOf("name", "status"), 1955 to arrayOf("name", "error"), 1957 to arrayOf("name"), 1960 to arrayOf("code"), 1961 to arrayOf("error"), 1964 to arrayOf("error"), 1965 to arrayOf("error"), 1969 to arrayOf("error"), 1987 to arrayOf("done", "of"), 1989 to arrayOf("why"), 1990 to arrayOf("path"), 1991 to arrayOf("error"), 1992 to arrayOf("secs"), 1993 to arrayOf("secs"), 2005 to arrayOf("code"), 2006 to arrayOf("code"), 2009 to arrayOf("state"), 2014 to arrayOf("hide", "copy", "paste"), 2015 to arrayOf("n"), 2018 to arrayOf("name"), 2019 to arrayOf("name", "folder"), 2020 to arrayOf("name"), 2021 to arrayOf("name", "percent"), 2027 to arrayOf("folder"), 2037 to arrayOf("w", "h"), 2041 to arrayOf("path"), 2044 to arrayOf("why"), 2045 to arrayOf("mb"), 2048 to arrayOf("n"), 2049 to arrayOf("delete", "undo"), 2050 to arrayOf("delete", "undo"), 2051 to arrayOf("undo"), 2072 to arrayOf("what", "secs"), 2073 to arrayOf("file", "holder"), 2080 to arrayOf("what"), 2081 to arrayOf("what"), 2082 to arrayOf("editor", "why"), 2101 to arrayOf("files"), 2111 to arrayOf("why"), 2113 to arrayOf("title"), 2114 to arrayOf("title"), 2115 to arrayOf("version"), 2116 to arrayOf("version", "size", "folder"), 2117 to arrayOf("version", "size", "folder"), 2126 to arrayOf("title"), 2130 to arrayOf("dir", "files"), 2136 to arrayOf("why"), 2138 to arrayOf("code"), 2152 to arrayOf("origin"), 2154 to arrayOf("why"), 2165 to arrayOf("dir"), 2166 to arrayOf("path"), 2167 to arrayOf("home", "other"), 2169 to arrayOf("path"), 2170 to arrayOf("code", "log"), 2171 to arrayOf("log"), 2173 to arrayOf("addr"), 2186 to arrayOf("home"), 2187 to arrayOf("addr"), 2202 to arrayOf("dir", "why"), 2203 to arrayOf("dir"), 2218 to arrayOf("phase"), 2220 to arrayOf("why"), 2221 to arrayOf("what"), 2222 to arrayOf("code"), 2228 to arrayOf("label"), 2233 to arrayOf("kind"), 2235 to arrayOf("project"), 2248 to arrayOf("what"), 2250 to arrayOf("when"), 2254 to arrayOf("n"), 2255 to arrayOf("n"), 2256 to arrayOf("n"), 2258 to arrayOf("agent"), 2259 to arrayOf("effort"), 2261 to arrayOf("n"), 2263 to arrayOf("model"), 2278 to arrayOf("word"), 2285 to arrayOf("more", "step"), 2289 to arrayOf("name"), 2293 to arrayOf("max", "skipped"), 2296 to arrayOf("name"), 2297 to arrayOf("n"), 2298 to arrayOf("name"), 2299 to arrayOf("name"), 2305 to arrayOf("n"), 2306 to arrayOf("name"), 2308 to arrayOf("price"), 2311 to arrayOf("name"), 2313 to arrayOf("name"), 2314 to arrayOf("name"), 2315 to arrayOf("name"), 2316 to arrayOf("text"), 2319 to arrayOf("key"), 2320 to arrayOf("key"), 2321 to arrayOf("pct"), 2322 to arrayOf("when"), 2333 to arrayOf("n", "upstream"), 2336 to arrayOf("mb"), 2346 to arrayOf("path"), 2347 to arrayOf("path"), 2369 to arrayOf("id"), 2373 to arrayOf("model"), 2374 to arrayOf("platform"), 2375 to arrayOf("version"), 2378 to arrayOf("version", "from", "into"), 2379 to arrayOf("version", "from"), 2382 to arrayOf("version", "path"), 2383 to arrayOf("version", "path"), 2384 to arrayOf("version", "pin", "from"), 2385 to arrayOf("path"), 2386 to arrayOf("version", "path"), 2387 to arrayOf("version", "path", "set"), 2401 to arrayOf("turns", "input", "cread", "cwrite", "output", "cost"), 2408 to arrayOf("tool"), 2409 to arrayOf("tool"), 2410 to arrayOf("tool", "word"), 2411 to arrayOf("tool", "word"), 2412 to arrayOf("tool"), 2413 to arrayOf("tool"), 2414 to arrayOf("due"), 2415 to arrayOf("due"), 2416 to arrayOf("due"), 2417 to arrayOf("due"), 2418 to arrayOf("zone"), 2419 to arrayOf("zone"), 2420 to arrayOf("zone"), 2421 to arrayOf("zone"), 2422 to arrayOf("n"), 2423 to arrayOf("who"), 2424 to arrayOf("n", "who"), 2425 to arrayOf("harness"), 2426 to arrayOf("path"), 2427 to arrayOf("path"), 2428 to arrayOf("path"), 2431 to arrayOf("error", "line"), 2432 to arrayOf("label"), 2440 to arrayOf("who"), 2441 to arrayOf("who"), 2442 to arrayOf("label", "left", "when"), 2443 to arrayOf("left"), 2444 to arrayOf("name", "left"), 2445 to arrayOf("used"), 2446 to arrayOf("used", "limit"), 2447 to arrayOf("used", "reason"), 2448 to arrayOf("used", "limit", "reason"), 2450 to arrayOf("provider"), 2451 to arrayOf("used", "window", "pct"), 2452 to arrayOf("rate"), 2462 to arrayOf("n", "r"), 2467 to arrayOf("time", "n"), 2471 to arrayOf("n", "m"), 2473 to arrayOf("pct"), 2474 to arrayOf("cost", "n"), 2478 to arrayOf("in", "out", "cread", "cwrite"), 2479 to arrayOf("in", "out", "cread", "cwrite", "n"), 2488 to arrayOf("turns", "input", "cread", "cwrite", "output"), 2489 to arrayOf("left", "when"), 2490 to arrayOf("left", "when"), 2491 to arrayOf("left", "when"), 2492 to arrayOf("left", "when"), 2516 to arrayOf("n"), 2539 to arrayOf("when"), 2546 to arrayOf("phrase", "now"), 2557 to arrayOf("s"), 2563 to arrayOf("now"), 2564 to arrayOf("now", "nudge", "sent", "undone"), 2574 to arrayOf("e"), 2575 to arrayOf("a", "ams", "b", "bms"), 2576 to arrayOf("ms"), 2577 to arrayOf("e"), 2578 to arrayOf("t"), 2579 to arrayOf("t"), 2580 to arrayOf("t"), 2586 to arrayOf("why"), 2596 to arrayOf("apps"), 2606 to arrayOf("n"), 2607 to arrayOf("n", "k"), 2612 to arrayOf("stt", "conf"), 2613 to arrayOf("words"), 2623 to arrayOf("into"), 2626 to arrayOf("origin"), 2638 to arrayOf("url"), 2640 to arrayOf("url"), 2648 to arrayOf("i", "n"), 2649 to arrayOf("d", "n"), 2658 to arrayOf("version"), 2659 to arrayOf("version"), 2660 to arrayOf("version"), 2663 to arrayOf("path"), 2671 to arrayOf("addr"), 2675 to arrayOf("label"), 2677 to arrayOf("label"), 2678 to arrayOf("label"), 2682 to arrayOf("label"), 2687 to arrayOf("from"), 2704 to arrayOf("done", "of"), 2710 to arrayOf("n"), 2711 to arrayOf("t", "m"), 2712 to arrayOf("m"), 2713 to arrayOf("b", "m"), 2714 to arrayOf("r", "p"), 2715 to arrayOf("n"), 2716 to arrayOf("n"), 2717 to arrayOf("n"), 2718 to arrayOf("n"), 2721 to arrayOf("n"), 2723 to arrayOf("n"), 2731 to arrayOf("n"), 2737 to arrayOf("name", "gb", "path"), 2739 to arrayOf("path", "why"), 2741 to arrayOf("names"), 2743 to arrayOf("why"), 2744 to arrayOf("p", "pn", "t", "tn", "e", "en"), 2745 to arrayOf("done", "total"), 2746 to arrayOf("n"), 2747 to arrayOf("what"), 2748 to arrayOf("n"), 2749 to arrayOf("n"), 2752 to arrayOf("what"), 2753 to arrayOf("n"), 2755 to arrayOf("why", "from"), 2756 to arrayOf("why"), 2762 to arrayOf("path"), 2763 to arrayOf("path", "who"), 2764 to arrayOf("path"), 2765 to arrayOf("path", "cmd"), 2766 to arrayOf("version", "path"), 2767 to arrayOf("version", "path"), 2768 to arrayOf("version", "path", "who"), 2769 to arrayOf("version", "path"), 2770 to arrayOf("version", "path", "cmd"), 2773 to arrayOf("cmd"), 2783 to arrayOf("name", "version", "path"), 2784 to arrayOf("path", "why"), 2785 to arrayOf("name"), 2787 to arrayOf("version", "cli"), 2788 to arrayOf("cli"), 2790 to arrayOf("version"), 2791 to arrayOf("version"), 2793 to arrayOf("version"), 2795 to arrayOf("version"), 2797 to arrayOf("computer"), 2798 to arrayOf("version", "cli"), 2799 to arrayOf("cli"), 2800 to arrayOf("version", "cli"), 2801 to arrayOf("cli"), 2823 to arrayOf("n"), 2828 to arrayOf("code"), 2830 to arrayOf("e"), 2843 to arrayOf("n"), 2848 to arrayOf("channel"), 2862 to arrayOf("project"), 2868 to arrayOf("n"), 2880 to arrayOf("m"), 2892 to arrayOf("m"), 2895 to arrayOf("m"), 2902 to arrayOf("pages"), 2904 to arrayOf("name"), 2907 to arrayOf("name"), 2916 to arrayOf("d", "n"), 2937 to arrayOf("n", "tools"), 2938 to arrayOf("n", "tools", "d"), 2939 to arrayOf("n", "d"), 2940 to arrayOf("n", "what"), 2941 to arrayOf("n", "d", "what"), 2945 to arrayOf("head"), 2951 to arrayOf("name", "path"), 2957 to arrayOf("page", "net", "near"), 2958 to arrayOf("page", "what"), 2959 to arrayOf("ref"), 2963 to arrayOf("page"), 2986 to arrayOf("n"), 2987 to arrayOf("n"), 2988 to arrayOf("n"), 2990 to arrayOf("hub"), 3012 to arrayOf("project"), 3014 to arrayOf("n"), 3015 to arrayOf("n"), 3016 to arrayOf("word"), 3017 to arrayOf("n"), 3035 to arrayOf("name"), 3043 to arrayOf("answer"), 3048 to arrayOf("why"), 3050 to arrayOf("hub"), 3056 to arrayOf("from", "to"), 3063 to arrayOf("project"), 3073 to arrayOf("name"), 3077 to arrayOf("n"), 3083 to arrayOf("code"), 3084 to arrayOf("hub"), 3085 to arrayOf("hub"), 3086 to arrayOf("hub"), 3100 to arrayOf("n"), 3101 to arrayOf("n"), 3117 to arrayOf("status"), 3119 to arrayOf("status"), 3148 to arrayOf("project"), 3152 to arrayOf("code"), 3154 to arrayOf("why"), 3162 to arrayOf("title"), 3168 to arrayOf("title"), 3170 to arrayOf("q"), 3171 to arrayOf("title"), 3176 to arrayOf("room"), 3180 to arrayOf("q"), 3190 to arrayOf("title"), 3195 to arrayOf("n"), 3196 to arrayOf("n"), 3201 to arrayOf("at"), 3209 to arrayOf("size"), 3211 to arrayOf("n", "total"), 3228 to arrayOf("n"), 3229 to arrayOf("what"), 3232 to arrayOf("device"), 3233 to arrayOf("device"), 3242 to arrayOf("word", "count"), 3243 to arrayOf("heard"), 3255 to arrayOf("files"), 3256 to arrayOf("files"), 3259 to arrayOf("name"), 3287 to arrayOf("n"), 3288 to arrayOf("n"), 3299 to arrayOf("n"), 3333 to arrayOf("root"), 3334 to arrayOf("path"), 3357 to arrayOf("name"), 3360 to arrayOf("until"), 3361 to arrayOf("error"), 3368 to arrayOf("url"), 3372 to arrayOf("name"), 3373 to arrayOf("name"), 3381 to arrayOf("code", "hub", "until"), 3382 to arrayOf("url"), 3386 to arrayOf("kinds"), 3387 to arrayOf("address"), 3389 to arrayOf("address"), 3392 to arrayOf("url"), 3393 to arrayOf("url"), 3394 to arrayOf("url"), 3395 to arrayOf("url", "via"), 3400 to arrayOf("name"), 3401 to arrayOf("url", "check", "left"), 3403 to arrayOf("check"), 3404 to arrayOf("address"), 3405 to arrayOf("name"), 3406 to arrayOf("error"), 3407 to arrayOf("url"), 3408 to arrayOf("url"), 3415 to arrayOf("code", "address", "left"), 3421 to arrayOf("name"), 3422 to arrayOf("name"), 3433 to arrayOf("address"), 3440 to arrayOf("code", "body"), 3443 to arrayOf("code", "body"), 3449 to arrayOf("window", "used"), 3450 to arrayOf("window", "used", "when"), 3451 to arrayOf("window", "used"), 3452 to arrayOf("window", "used", "when"), 3453 to arrayOf("provider"), 3465 to arrayOf("label"), 3466 to arrayOf("when"), 3468 to arrayOf("provider"), 3469 to arrayOf("provider", "title", "why"), 3489 to arrayOf("reason"), 3497 to arrayOf("code"), 3506 to arrayOf("name"), 3509 to arrayOf("version"), 3510 to arrayOf("version"), 3511 to arrayOf("version"), 3513 to arrayOf("version"), 3514 to arrayOf("version"), 3515 to arrayOf("version"), 3516 to arrayOf("version", "why"), 3517 to arrayOf("version"), 3519 to arrayOf("code"), 3535 to arrayOf("name"), 3542 to arrayOf("count"), 3543 to arrayOf("title"), 3544 to arrayOf("name"), 3547 to arrayOf("n", "holder"), 3548 to arrayOf("n", "title"), 3549 to arrayOf("title"), 3552 to arrayOf("n"), 3553 to arrayOf("n"), 3554 to arrayOf("n"), 3555 to arrayOf("n"), 3556 to arrayOf("harness", "typed", "type", "remote", "host", "wt", "branch"), 3566 to arrayOf("pid"), 3571 to arrayOf("left"), 3572 to arrayOf("left"), 3578 to arrayOf("left"), 3579 to arrayOf("left"), 3580 to arrayOf("left"), 3581 to arrayOf("left"), 3582 to arrayOf("label", "left"), 3583 to arrayOf("when"), 3584 to arrayOf("used"), 3585 to arrayOf("used", "limit"), 3607 to arrayOf("tracking"), 3611 to arrayOf("total"), 3612 to arrayOf("price"), 3613 to arrayOf("price"), 3618 to arrayOf("n"), 3619 to arrayOf("parts"), 3620 to arrayOf("note"), 3621 to arrayOf("error"), 3622 to arrayOf("error", "parts"), 3627 to arrayOf("state"), 3628 to arrayOf("name", "path"), 3629 to arrayOf("name", "path", "why"), 3631 to arrayOf("code"), 3635 to arrayOf("detail"), 3637 to arrayOf("why"), 3638 to arrayOf("parts"), 3641 to arrayOf("build", "to"), 3642 to arrayOf("build"), 3643 to arrayOf("build", "skip"), 3645 to arrayOf("why"), 3646 to arrayOf("why"), 3647 to arrayOf("build"), 3648 to arrayOf("build", "why"), 3649 to arrayOf("build"), 3650 to arrayOf("build"), 3654 to arrayOf("build"), 3655 to arrayOf("build"), 3657 to arrayOf("build"), 3664 to arrayOf("build"), 3698 to arrayOf("step"), 3699 to arrayOf("p", "pt", "t", "tt", "e", "et"), 3700 to arrayOf("done", "total"), 3701 to arrayOf("n"), 3702 to arrayOf("n"), 3703 to arrayOf("n"), 3708 to arrayOf("n"), 3711 to arrayOf("why"), 3712 to arrayOf("why", "from"), 3713 to arrayOf("error"), 3715 to arrayOf("n"), 3716 to arrayOf("n"), 3720 to arrayOf("n"), 3723 to arrayOf("name", "gb", "path"), 3724 to arrayOf("path", "why"), 3725 to arrayOf("names"), 3727 to arrayOf("why"), 3738 to arrayOf("n", "total"), 3742 to arrayOf("title"), 3744 to arrayOf("n"), 3748 to arrayOf("name"), 3749 to arrayOf("title"), 3750 to arrayOf("note"), 3752 to arrayOf("machine"), 3753 to arrayOf("machines"), 3754 to arrayOf("machine"), 3765 to arrayOf("n"), 3767 to arrayOf("n"), 3771 to arrayOf("name"), 3774 to arrayOf("name"), 3791 to arrayOf("why"), 3797 to arrayOf("project"), 3838 to arrayOf("path"), 3839 to arrayOf("path"), 3841 to arrayOf("have", "total"), 3846 to arrayOf("n"), 3855 to arrayOf("hub"), 3858 to arrayOf("title"), 3862 to arrayOf("project"), 3863 to arrayOf("project"), 3864 to arrayOf("n"), 3865 to arrayOf("hub"), 3867 to arrayOf("n"), 3868 to arrayOf("n"), 3869 to arrayOf("model"), 3875 to arrayOf("name"), 3894 to arrayOf("word"), 3900 to arrayOf("answer"), 3910 to arrayOf("version", "build"), 3911 to arrayOf("hub"), 3916 to arrayOf("name"), 3919 to arrayOf("when", "who", "mark"), 3923 to arrayOf("who"), 3927 to arrayOf("time"), 3928 to arrayOf("address"), 3930 to arrayOf("kind", "name"), 3945 to arrayOf("title"), 3946 to arrayOf("query"), 3949 to arrayOf("room"), 3950 to arrayOf("query"), 3952 to arrayOf("n"), 3953 to arrayOf("n"), 3954 to arrayOf("n"), 3960 to arrayOf("size"), 3964 to arrayOf("n"), 3965 to arrayOf("n"), 3966 to arrayOf("n"), 3980 to arrayOf("status"), 3982 to arrayOf("status"), 4133 to arrayOf("code"), 4135 to arrayOf("n"), 4137 to arrayOf("why"), 4149 to arrayOf("done", "of"), 4153 to arrayOf("thread"), 4156 to arrayOf("n"), 4164 to arrayOf("title"), 4165 to arrayOf("note"), 4166 to arrayOf("label"), 4167 to arrayOf("machine"), 4168 to arrayOf("machine"), 4175 to arrayOf("at", "total"), 4176 to arrayOf("at", "total"), 4180 to arrayOf("machine"), 4181 to arrayOf("machine"), 4182 to arrayOf("machines"), 4184 to arrayOf("device"), 4191 to arrayOf("price"), 4192 to arrayOf("price"), 4199 to arrayOf("home"), 4204 to arrayOf("from"), 4206 to arrayOf("note"), 4207 to arrayOf("note"), 4209 to arrayOf("v"), 4210 to arrayOf("v"), 4211 to arrayOf("v", "who"), 4213 to arrayOf("who"), 4214 to arrayOf("v"), 4216 to arrayOf("v", "cmd"), 4217 to arrayOf("cmd"), 4222 to arrayOf("v", "path"), 4223 to arrayOf("v", "note"), 4224 to arrayOf("v"), 4229 to arrayOf("tool"), 4230 to arrayOf("tool"), 4255 to arrayOf("n", "w"), 4256 to arrayOf("why"), 4257 to arrayOf("state", "why"), 4269 to arrayOf("project"), 4270 to arrayOf("n"), 4281 to arrayOf("why"), 4287 to arrayOf("name"), 4298 to arrayOf("project"), 4303 to arrayOf("n"), 4311 to arrayOf("names"), 4319 to arrayOf("dest"), 4321 to arrayOf("repo"), 4322 to arrayOf("repo"), 4324 to arrayOf("url"), 4339 to arrayOf("time"), 4361 to arrayOf("group"), 4365 to arrayOf("project"), 4366 to arrayOf("n"), 4367 to arrayOf("n"), 4368 to arrayOf("n"), 4376 to arrayOf("n"), 4433 to arrayOf("n"), 4434 to arrayOf("n"), 4435 to arrayOf("a", "b"), 4436 to arrayOf("n"), 4438 to arrayOf("parts", "lines"), 4439 to arrayOf("n"), 4470 to arrayOf("what", "project", "fab"), 4471 to arrayOf("rev", "day"), 4479 to arrayOf("n"), 4490 to arrayOf("layer"), 4491 to arrayOf("n"), 4496 to arrayOf("board"), 4508 to arrayOf("others"), 4509 to arrayOf("must", "should", "notes"), 4510 to arrayOf("id", "w"), 4520 to arrayOf("what"), 4523 to arrayOf("why"), 4524 to arrayOf("why"), 4531 to arrayOf("n"), 4547 to arrayOf("price", "n"), 4548 to arrayOf("n", "need"), 4549 to arrayOf("n"), 4550 to arrayOf("n"), 4551 to arrayOf("cost"), 4552 to arrayOf("cost"), 4565 to arrayOf("day", "n"), 4566 to arrayOf("day"), 4567 to arrayOf("cost", "n", "lines"), 4568 to arrayOf("stock", "price"), 4569 to arrayOf("lines"), 4590 to arrayOf("host"), 4601 to arrayOf("n"), 4602 to arrayOf("a", "b"), 4603 to arrayOf("n"), 4604 to arrayOf("n"), 4607 to arrayOf("day"), 4608 to arrayOf("n"), 4649 to arrayOf("turn"), 4763 to arrayOf("text"), 4766 to arrayOf("repo", "dest"), 4767 to arrayOf("repo", "dest"), 4768 to arrayOf("repo"), 4773 to arrayOf("dir"), 4774 to arrayOf("dir"), 4778 to arrayOf("editor", "job", "secs"), 4779 to arrayOf("editor", "secs"), 4780 to arrayOf("editor"), 4797 to arrayOf("time"), 4803 to arrayOf("status"), 4811 to arrayOf("time"), 4812 to arrayOf("time", "dur"), 4815 to arrayOf("answer"), 4819 to arrayOf("type"), 4820 to arrayOf("max"), 4848 to arrayOf("bytes", "tokens"), 4881 to arrayOf("what"), 4885 to arrayOf("n"), 4887 to arrayOf("n"), 4911 to arrayOf("n"), 4912 to arrayOf("done", "total"), 4920 to arrayOf("v"), 4921 to arrayOf("x", "y"), 4927 to arrayOf("machine"), 4930 to arrayOf("days"), 4931 to arrayOf("warnings")) } val common_cancel: String get() = Tr.s(0) val common_delete: String get() = Tr.s(1) @@ -28239,4 +28247,6 @@ object Msg { fun provider_notice_senderr_remote(machine: Any): String = Tr.f(4927, arrayOf(machine)) val web_settings_providers: String get() = Tr.s(4928) val web_settings_providers_browser: String get() = Tr.s(4929) + fun order_lead_days(days: Number): String = Tr.f(4930, arrayOf(days)) + fun order_estimate_warnings(warnings: Any): String = Tr.f(4931, arrayOf(warnings)) } diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/ProviderMark.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/ProviderMark.kt new file mode 100644 index 0000000000..d7bd006ab5 --- /dev/null +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/ProviderMark.kt @@ -0,0 +1,375 @@ +package dev.backplane.mobile + +import androidx.compose.foundation.Canvas +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.size +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.Path +import androidx.compose.ui.graphics.PathFillType +import androidx.compose.ui.graphics.drawscope.withTransform +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import kotlin.math.PI +import kotlin.math.abs +import kotlin.math.acos +import kotlin.math.ceil +import kotlin.math.cos +import kotlin.math.max +import kotlin.math.min +import kotlin.math.sin +import kotlin.math.sqrt + +/** + * Vector marks for every built-in AI provider, matching the bundled provider SVGs and desktop GPUI (`art.rs` / `picker.rs`). + * Pure path parsing and canonicalization live in [ProviderMarks] so JVM unit tests can exercise them without Android UI. + */ +object ProviderMarks { + data class Spec(val id: String, val color: Long, val letter: String, val vbW: Float, val vbH: Float, val d: String) + + sealed class Seg { + data class Move(val x: Float, val y: Float) : Seg() + data class Line(val x: Float, val y: Float) : Seg() + data class Cubic(val x1: Float, val y1: Float, val x2: Float, val y2: Float, val x: Float, val y: Float) : Seg() + data class Quad(val x1: Float, val y1: Float, val x: Float, val y: Float) : Seg() + data object Close : Seg() + } + + private const val CLAUDE_D = "m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z" + private const val CODEX_D = "M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87l51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921l51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272l-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695l-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69l-1.535-.922l-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87l-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58L128.067 97.3l28.188 16.218v32.434l-28.086 16.218l-28.188-16.218l-.052-32.434Z" + private const val GROK_D = "M9.497 15.122 L16.811 9.491 C17.169 9.215 17.682 9.323 17.852 9.751 C18.752 12.013 18.35 14.73 16.561 16.596 C14.772 18.462 12.283 18.871 10.007 17.939 L7.522 19.139 C11.087 21.68 15.416 21.052 18.121 18.229 C20.267 15.991 20.931 12.941 20.31 10.19 L20.315 10.196 C19.414 6.155 20.537 4.54 22.837 1.237 C22.891 1.159 22.946 1.08 23 1 L19.974 4.156 L19.974 4.146 L9.495 15.124 M7.987 16.49 C5.429 13.941 5.87 9.996 8.053 7.721 C9.667 6.037 12.313 5.35 14.622 6.361 L17.102 5.166 C16.655 4.829 16.082 4.467 15.425 4.213 C12.455 2.938 8.9 3.573 6.485 6.088 C4.163 8.51 3.433 12.234 4.687 15.411 C5.624 17.786 4.088 19.466 2.541 21.162 C1.993 21.763 1.443 22.364 1 23 L7.985 16.492" + private const val MUSE_D = "M10.73.032c-1.333 0-2.032 1.016-2.032 2.285 0 2.223 2.127 4.953 4.318 4.953 1.301 0 2-.953 2-2.254 0-2.254-2.095-4.984-4.286-4.984m8.413 2.984c-1.968 0-3.397 2.73-3.397 4.825 0 1.556.794 3.016 2.254 3.016 2 0 3.365-2.762 3.365-4.794 0-1.523-.762-3.047-2.222-3.047M4.857 4.159c-1.968 0-3.778 1.016-3.778 2.54 0 1.65 2.16 2.793 4.254 2.793 1.873 0 3.778-.92 3.778-2.508 0-1.682-2.159-2.825-4.254-2.825m-.222 6.476C2.413 10.635 0 13.175 0 15.397c0 1.301.825 2.159 2.095 2.159 2.19 0 4.603-2.508 4.603-4.794 0-1.27-.761-2.127-2.063-2.127m16.667.698c-2.223 0-5.016 1.62-5.016 3.651 0 1.238 1.047 2.19 2.698 2.19 2.159 0 5.016-1.587 5.016-3.682 0-1.302-1.08-2.159-2.698-2.159M7.619 16c-1.524 0-2.38 1.746-2.38 3.429 0 2.063 1.269 4.54 3.047 4.54 1.524 0 2.38-1.81 2.38-3.461C10.667 18.57 9.46 16 7.62 16m6.571 1.016c-1.333 0-2.476.667-2.476 2.032 0 2.095 2.667 4.063 4.92 4.063 1.366 0 2.54-.73 2.54-2.063 0-2.032-2.698-4.032-4.984-4.032" + private const val ANTIGRAVITY_D = "M20.197 20.618 C21.318 21.459 23 20.898 21.459 19.357 C16.834 14.873 17.815 2.541 12.07 2.541 C6.325 2.541 7.306 14.873 2.682 19.357 C1 21.038 2.822 21.459 3.943 20.618 C8.287 17.675 8.006 12.49 12.07 12.49 C16.134 12.49 15.853 17.675 20.197 20.618 Z" + private const val OPENCODE_D = "M22 24H2V0h20zM17 4.8H7v14.4h10z" + private const val PI_D = "M0 0v24h6v-6h6v-6H6V6h6v6h6V0Zm18 12v12h6V12Z" + private const val OMP_D = "M1.44 3.86 L22.56 3.86 C23 3.86 23 3.86 23 4.3 L23 6.06 C23 6.5 23 6.5 22.56 6.5 L1.44 6.5 C1 6.5 1 6.5 1 6.06 L1 4.3 C1 3.86 1 3.86 1.44 3.86 Z M4.74 6.5 L6.5 6.5 C6.94 6.5 6.94 6.5 6.94 6.94 L6.94 19.7 C6.94 20.14 6.94 20.14 6.5 20.14 L4.74 20.14 C4.3 20.14 4.3 20.14 4.3 19.7 L4.3 6.94 C4.3 6.5 4.3 6.5 4.74 6.5 Z M15.74 6.5 L17.5 6.5 C17.94 6.5 17.94 6.5 17.94 6.94 L17.94 13.32 C17.94 13.76 17.94 13.76 17.5 13.76 L15.74 13.76 C15.3 13.76 15.3 13.76 15.3 13.32 L15.3 6.94 C15.3 6.5 15.3 6.5 15.74 6.5 Z M15.08 14.64 L18.16 14.64 C18.82 14.64 18.82 14.64 18.82 15.3 L18.82 17.5 C18.82 18.16 18.82 18.16 18.16 18.16 L15.08 18.16 C14.42 18.16 14.42 18.16 14.42 17.5 L14.42 15.3 C14.42 14.64 14.42 14.64 15.08 14.64 Z" + + val ALL: List = listOf( + Spec("claude", 0xD97757L, "A", 24f, 24f, CLAUDE_D), + Spec("codex", 0x10A37FL, "O", 256f, 260f, CODEX_D), + Spec("grok", 0x6B7280L, "X", 24f, 24f, GROK_D), + Spec("muse", 0x8B5CF6L, "M", 24f, 24f, MUSE_D), + Spec("antigravity", 0x4285F4L, "G", 24f, 24f, ANTIGRAVITY_D), + Spec("opencode", 0x2563EBL, "C", 24f, 24f, OPENCODE_D), + Spec("pi", 0xDB2777L, "π", 24f, 24f, PI_D), + Spec("omp", 0xC026D3L, "Ω", 24f, 24f, OMP_D), + ) + + private val byId = ALL.associateBy { it.id } + + fun canonical(raw: String): String { + val k = raw.trim().removePrefix("@").lowercase() + return when (k) { + "anthropic" -> "claude" + "openai" -> "codex" + "agy", "gemini" -> "antigravity" + else -> k + } + } + + fun spec(raw: String): Spec? = byId[canonical(raw)] + + fun color(raw: String): Long = spec(raw)?.color ?: 0x64748BL + + fun letter(raw: String): String = spec(raw)?.letter ?: "?" + + fun providerOfChip(chip: String): String { + val head = chip.substringBefore(" / ").substringBefore(" · ").trim() + return if (spec(head) != null) canonical(head) else "" + } + + private val parsedCache: Map> = ALL.associate { it.id to parsePath(it.d) } + + fun segments(raw: String): List? = spec(raw)?.let { parsedCache[it.id] } + + /** + * Parses SVG path `d` supporting M/m, L/l, H/h, V/v, C/c, S/s, Q/q, T/t, A/a, Z/z. + * Handles comma/whitespace delimiters, glued signs/decimals, and compact SVG arc flags. + */ + fun parsePath(d: String): List { + val n = d.length + var idx = 0 + + fun skipSep() { + while (idx < n && (d[idx].isWhitespace() || d[idx] == ',')) idx++ + } + + fun hasNumber(): Boolean { + skipSep() + if (idx >= n) return false + val c = d[idx] + return c == '-' || c == '+' || c == '.' || c in '0'..'9' + } + + fun nextNum(): Float { + skipSep() + val start = idx + if (idx < n && (d[idx] == '-' || d[idx] == '+')) idx++ + var sawDot = false + while (idx < n) { + val c = d[idx] + if (c in '0'..'9') { + idx++ + } else if (c == '.' && !sawDot) { + sawDot = true + idx++ + } else if ((c == 'e' || c == 'E') && idx > start) { + idx++ + if (idx < n && (d[idx] == '-' || d[idx] == '+')) idx++ + } else { + break + } + } + return d.substring(start, idx).toFloatOrNull() ?: 0f + } + + fun nextFlag(): Boolean { + skipSep() + if (idx >= n) return false + val c = d[idx] + idx++ + return c == '1' + } + + val out = ArrayList() + var cmd = 'M' + var x = 0f + var y = 0f + var sx = 0f + var sy = 0f + var lastC: Pair? = null + var lastQ: Pair? = null + + while (true) { + skipSep() + if (idx >= n) break + val before = idx + val ch = d[idx] + if (ch.isLetter()) { + cmd = ch + idx++ + if (cmd == 'Z' || cmd == 'z') { + out.add(Seg.Close) + x = sx + y = sy + lastC = null + lastQ = null + continue + } + } else if (!hasNumber()) { + idx++ + continue + } + + val rel = cmd.isLowerCase() + val ox = if (rel) x else 0f + val oy = if (rel) y else 0f + var nextC: Pair? = null + var nextQ: Pair? = null + + when (cmd.uppercaseChar()) { + 'M' -> { + x = ox + nextNum(); y = oy + nextNum() + sx = x; sy = y + out.add(Seg.Move(x, y)) + cmd = if (rel) 'l' else 'L' + } + 'L' -> { + x = ox + nextNum(); y = oy + nextNum() + out.add(Seg.Line(x, y)) + } + 'H' -> { + x = ox + nextNum() + out.add(Seg.Line(x, y)) + } + 'V' -> { + y = oy + nextNum() + out.add(Seg.Line(x, y)) + } + 'C' -> { + val x1 = ox + nextNum(); val y1 = oy + nextNum() + val x2 = ox + nextNum(); val y2 = oy + nextNum() + x = ox + nextNum(); y = oy + nextNum() + out.add(Seg.Cubic(x1, y1, x2, y2, x, y)) + nextC = x2 to y2 + } + 'S' -> { + val (x1, y1) = lastC?.let { (2f * x - it.first) to (2f * y - it.second) } ?: (x to y) + val x2 = ox + nextNum(); val y2 = oy + nextNum() + x = ox + nextNum(); y = oy + nextNum() + out.add(Seg.Cubic(x1, y1, x2, y2, x, y)) + nextC = x2 to y2 + } + 'Q' -> { + val qx = ox + nextNum(); val qy = oy + nextNum() + x = ox + nextNum(); y = oy + nextNum() + out.add(Seg.Quad(qx, qy, x, y)) + nextQ = qx to qy + } + 'T' -> { + val (qx, qy) = lastQ?.let { (2f * x - it.first) to (2f * y - it.second) } ?: (x to y) + x = ox + nextNum(); y = oy + nextNum() + out.add(Seg.Quad(qx, qy, x, y)) + nextQ = qx to qy + } + 'A' -> { + val rx = nextNum(); val ry = nextNum(); val rot = nextNum() + val large = nextFlag(); val sweep = nextFlag() + val ex = ox + nextNum(); val ey = oy + nextNum() + arcToCubics(x.toDouble(), y.toDouble(), rx.toDouble(), ry.toDouble(), rot.toDouble(), large, sweep, ex.toDouble(), ey.toDouble(), out) + x = ex; y = ey + } + else -> if (idx == before) idx++ + } + if (idx == before) idx++ + lastC = nextC + lastQ = nextQ + } + return out + } + + /** W3C SVG 1.1 Implementation Notes F.6.5 / F.6.6 elliptical arc to cubic Bezier conversion. */ + private fun arcToCubics( + x0: Double, y0: Double, + rxIn: Double, ryIn: Double, + xAxisRotationDeg: Double, + largeArc: Boolean, sweep: Boolean, + x: Double, y: Double, + out: MutableList, + ) { + if (x0 == x && y0 == y) return + var rx = abs(rxIn) + var ry = abs(ryIn) + if (rx == 0.0 || ry == 0.0) { + out.add(Seg.Line(x.toFloat(), y.toFloat())) + return + } + val phi = xAxisRotationDeg * PI / 180.0 + val cosPhi = cos(phi) + val sinPhi = sin(phi) + + val dx2 = (x0 - x) / 2.0 + val dy2 = (y0 - y) / 2.0 + val x1p = cosPhi * dx2 + sinPhi * dy2 + val y1p = -sinPhi * dx2 + cosPhi * dy2 + + val lambda = (x1p * x1p) / (rx * rx) + (y1p * y1p) / (ry * ry) + if (lambda > 1.0) { + val s = sqrt(lambda) + rx *= s + ry *= s + } + + val rx2 = rx * rx + val ry2 = ry * ry + val x1p2 = x1p * x1p + val y1p2 = y1p * y1p + + val num = max(0.0, rx2 * ry2 - rx2 * y1p2 - ry2 * x1p2) + val den = rx2 * y1p2 + ry2 * x1p2 + val factor = if (den == 0.0) 0.0 else sqrt(num / den) * if (largeArc == sweep) -1.0 else 1.0 + val cxp = factor * (rx * y1p / ry) + val cyp = factor * (-ry * x1p / rx) + + val cx = cosPhi * cxp - sinPhi * cyp + (x0 + x) / 2.0 + val cy = sinPhi * cxp + cosPhi * cyp + (y0 + y) / 2.0 + + fun vecAngle(ux: Double, uy: Double, vx: Double, vy: Double): Double { + val sign = if (ux * vy - uy * vx < 0.0) -1.0 else 1.0 + val mag = sqrt((ux * ux + uy * uy) * (vx * vx + vy * vy)) + if (mag == 0.0) return 0.0 + val dot = ((ux * vx + uy * vy) / mag).coerceIn(-1.0, 1.0) + return sign * acos(dot) + } + + val ux = (x1p - cxp) / rx + val uy = (y1p - cyp) / ry + val vx = (-x1p - cxp) / rx + val vy = (-y1p - cyp) / ry + + val theta1 = vecAngle(1.0, 0.0, ux, uy) + var dTheta = vecAngle(ux, uy, vx, vy) + if (!sweep && dTheta > 0.0) dTheta -= 2.0 * PI + else if (sweep && dTheta < 0.0) dTheta += 2.0 * PI + + val segs = max(1, ceil(abs(dTheta) / (PI / 2.0)).toInt()) + val delta = dTheta / segs + val t = (4.0 / 3.0) * kotlin.math.tan(delta / 4.0) + + for (i in 0 until segs) { + val t1 = theta1 + i * delta + val t2 = theta1 + (i + 1) * delta + val cos1 = cos(t1); val sin1 = sin(t1) + val cos2 = cos(t2); val sin2 = sin(t2) + + val p1x = cos1 - t * sin1 + val p1y = sin1 + t * cos1 + val p2x = cos2 + t * sin2 + val p2y = sin2 - t * cos2 + + fun mapX(px: Double, py: Double) = (cosPhi * rx * px - sinPhi * ry * py + cx).toFloat() + fun mapY(px: Double, py: Double) = (sinPhi * rx * px + cosPhi * ry * py + cy).toFloat() + + out.add( + Seg.Cubic( + mapX(p1x, p1y), mapY(p1x, p1y), + mapX(p2x, p2y), mapY(p2x, p2y), + if (i == segs - 1) x.toFloat() else mapX(cos2, sin2), + if (i == segs - 1) y.toFloat() else mapY(cos2, sin2), + ) + ) + } + } +} + +private val providerComposePaths: Map by lazy { + ProviderMarks.ALL.associate { spec -> + val p = Path().apply { fillType = PathFillType.NonZero } + for (s in ProviderMarks.segments(spec.id).orEmpty()) { + when (s) { + is ProviderMarks.Seg.Move -> p.moveTo(s.x, s.y) + is ProviderMarks.Seg.Line -> p.lineTo(s.x, s.y) + is ProviderMarks.Seg.Cubic -> p.cubicTo(s.x1, s.y1, s.x2, s.y2, s.x, s.y) + is ProviderMarks.Seg.Quad -> p.quadraticTo(s.x1, s.y1, s.x, s.y) + ProviderMarks.Seg.Close -> p.close() + } + } + spec.id to p + } +} + +/** + * Draws the provider's vector mark tinted in its brand color, or a colored square with "?" for unknown providers. + */ +@Composable +fun ProviderMark(provider: String, size: Dp = 14.dp, modifier: Modifier = Modifier) { + val spec = remember(provider) { ProviderMarks.spec(provider) } + if (spec != null) { + val path = remember(spec.id) { providerComposePaths[spec.id] } + val tint = remember(spec.color) { Color(0xFF000000L or spec.color) } + if (path != null) { + Canvas(modifier.size(size)) { + val s = min(this.size.width / spec.vbW, this.size.height / spec.vbH) + val ox = (this.size.width - spec.vbW * s) * 0.5f + val oy = (this.size.height - spec.vbH * s) * 0.5f + withTransform({ + translate(ox, oy) + scale(s, s, androidx.compose.ui.geometry.Offset.Zero) + }) { + drawPath(path, color = tint) + } + } + return + } + } + Box(modifier.size(size).background(Color(0xFF64748BL)), contentAlignment = Alignment.Center) { + Text("?", color = Color.White, fontFamily = BpMono, fontSize = (size.value * 0.62f).coerceAtLeast(8f).sp, fontWeight = FontWeight.Bold, lineHeight = (size.value * 0.7f).coerceAtLeast(9f).sp) + } +} diff --git a/mobile/android/app/src/test/java/dev/backplane/mobile/DataRingTest.kt b/mobile/android/app/src/test/java/dev/backplane/mobile/DataRingTest.kt new file mode 100644 index 0000000000..0dfb61e5a1 --- /dev/null +++ b/mobile/android/app/src/test/java/dev/backplane/mobile/DataRingTest.kt @@ -0,0 +1,39 @@ +package dev.backplane.mobile + +import org.json.JSONObject +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test + +class DataRingTest { + @Test + fun showAllClearsSearchField() { + assertEquals("ringq", RingLogic.clearedField("ring-search", "clear")) + assertNull(RingLogic.clearedField("ring-search", "")) + assertNull(RingLogic.clearedField("ring-search", "keep")) + assertNull(RingLogic.clearedField("ring-op", "setup")) + } + + @Test + fun detectsPendingRingTranscriptionOrDelivery() { + val idle = listOf(JSONObject().put("note", "Call Alex\nHeard by parakeet-v2, 91% sure · given to Pebble")) + assertFalse(RingLogic.hasPendingWork(idle)) + val hearing = listOf(JSONObject().put("note", "Call Alex\nNot heard · being heard now")) + assertTrue(RingLogic.hasPendingWork(hearing)) + val queued = listOf(JSONObject().put("note", "(no words)\nNot heard · waiting to be heard")) + assertTrue(RingLogic.hasPendingWork(queued)) + val sending = listOf(JSONObject().put("note", "Call Alex\nHeard by parakeet-v2 · waiting to go to Pebble")) + assertTrue(RingLogic.hasPendingWork(sending)) + } + + @Test + fun localActionsStayOnPhone() { + assertTrue(PageRow.local("copy")) + assertTrue(PageRow.local("share-text")) + assertTrue(PageRow.local("open-url")) + assertFalse(PageRow.local("ring-op")) + assertFalse(PageRow.local("link-open")) + } +} diff --git a/mobile/android/app/src/test/java/dev/backplane/mobile/OrderCardTest.kt b/mobile/android/app/src/test/java/dev/backplane/mobile/OrderCardTest.kt new file mode 100644 index 0000000000..c05772339f --- /dev/null +++ b/mobile/android/app/src/test/java/dev/backplane/mobile/OrderCardTest.kt @@ -0,0 +1,36 @@ +package dev.backplane.mobile + +import org.json.JSONArray +import org.json.JSONObject +import org.junit.Assert.assertEquals +import org.junit.Test + +class OrderCardTest { + @Test + fun orderCardParsesLeadDaysAndEstimateWarnings() { + val o = DataClient.Order.of( + JSONObject() + .put("name", "Main board") + .put("line", "Quoted. Buy now to place the order.") + .put("total", "$27.20") + .put("lead_days", 9) + .put("estimate_warnings", "thin board; fragile") + ) + assertEquals(9, o.leadDays) + assertEquals("thin board; fragile", o.estimateWarnings) + } + + @Test + fun orderCardFallsBackCleanlyWhenAbsentOrNegative() { + val plain = DataClient.Order.of(JSONObject().put("name", "b").put("lead_days", -3)) + assertEquals(0, plain.leadDays) + assertEquals("", plain.estimateWarnings) + + val fallback = DataClient.Order.of( + JSONObject() + .put("name", "b") + .put("warnings", JSONArray(listOf(" w1 ", "w1", "w2"))) + ) + assertEquals("w1; w2", fallback.estimateWarnings) + } +} diff --git a/mobile/android/app/src/test/java/dev/backplane/mobile/ProviderMarkTest.kt b/mobile/android/app/src/test/java/dev/backplane/mobile/ProviderMarkTest.kt new file mode 100644 index 0000000000..a987bdb1f8 --- /dev/null +++ b/mobile/android/app/src/test/java/dev/backplane/mobile/ProviderMarkTest.kt @@ -0,0 +1,66 @@ +package dev.backplane.mobile + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test + +class ProviderMarkTest { + @Test + fun allBuiltInProvidersParseWithinViewBox() { + val expected = listOf("claude", "codex", "grok", "muse", "antigravity", "opencode", "pi", "omp") + assertEquals(expected, ProviderMarks.ALL.map { it.id }) + for (spec in ProviderMarks.ALL) { + val segs = ProviderMarks.segments(spec.id) + assertNotNull("segments for ${spec.id}", segs) + assertTrue("${spec.id} has segments", segs!!.isNotEmpty()) + val endXs = mutableListOf() + val endYs = mutableListOf() + val ctrlXs = mutableListOf() + val ctrlYs = mutableListOf() + for (s in segs) { + when (s) { + is ProviderMarks.Seg.Move -> { endXs.add(s.x); endYs.add(s.y) } + is ProviderMarks.Seg.Line -> { endXs.add(s.x); endYs.add(s.y) } + is ProviderMarks.Seg.Cubic -> { + ctrlXs.addAll(listOf(s.x1, s.x2)) + ctrlYs.addAll(listOf(s.y1, s.y2)) + endXs.add(s.x); endYs.add(s.y) + } + is ProviderMarks.Seg.Quad -> { + ctrlXs.add(s.x1); ctrlYs.add(s.y1) + endXs.add(s.x); endYs.add(s.y) + } + ProviderMarks.Seg.Close -> {} + } + } + assertTrue("${spec.id} end minX=${endXs.min()}", endXs.min() >= -1f) + assertTrue("${spec.id} end maxX=${endXs.max()} <= ${spec.vbW + 1f}", endXs.max() <= spec.vbW + 1f) + assertTrue("${spec.id} end minY=${endYs.min()}", endYs.min() >= -1f) + assertTrue("${spec.id} end maxY=${endYs.max()} <= ${spec.vbH + 1f}", endYs.max() <= spec.vbH + 1f) + val pad = maxOf(2f, spec.vbW * 0.05f) + if (ctrlXs.isNotEmpty()) { + assertTrue("${spec.id} ctrl minX=${ctrlXs.min()}", ctrlXs.min() >= -pad) + assertTrue("${spec.id} ctrl maxX=${ctrlXs.max()}", ctrlXs.max() <= spec.vbW + pad) + assertTrue("${spec.id} ctrl minY=${ctrlYs.min()}", ctrlYs.min() >= -pad) + assertTrue("${spec.id} ctrl maxY=${ctrlYs.max()}", ctrlYs.max() <= spec.vbH + pad) + } + } + } + + @Test + fun aliasesAndFallbackResolveCleanly() { + assertEquals("antigravity", ProviderMarks.canonical("agy")) + assertEquals("antigravity", ProviderMarks.canonical("@Gemini")) + assertEquals("codex", ProviderMarks.canonical("openai")) + assertEquals("claude", ProviderMarks.canonical("anthropic")) + assertEquals("claude", ProviderMarks.providerOfChip("claude / opus / high")) + assertEquals("codex", ProviderMarks.providerOfChip("openai · gpt-5")) + assertEquals("", ProviderMarks.providerOfChip("unknown / m1")) + assertNull(ProviderMarks.spec("mystery")) + assertEquals("?", ProviderMarks.letter("mystery")) + assertEquals(0x64748BL, ProviderMarks.color("mystery")) + assertTrue(ProviderMarks.parsePath("M0 0 Z 1 2 ? 3").isNotEmpty()) + } +} diff --git a/mobile/ios/Backplane/DataAccounts.swift b/mobile/ios/Backplane/DataAccounts.swift index ef181b0c4c..ae11b22eed 100644 --- a/mobile/ios/Backplane/DataAccounts.swift +++ b/mobile/ios/Backplane/DataAccounts.swift @@ -70,7 +70,10 @@ struct DataAccountsView: View { DLine() } ForEach(p.providers) { pv in - DHeading(text: pv.title) + HStack(spacing: 6) { + if ProviderMarks.spec(pv.provider) != nil { ProviderMark(provider: pv.provider, size: 13) } + DHeading(text: pv.title) + } if pv.accounts.isEmpty { Text(Tr.t("No accounts")).dmono(12).foregroundStyle(BackplaneDesign.faint) } ForEach(pv.accounts) { a in if a.open == false { row(a, chevron: false).accessibilityIdentifier("accounts.row." + a.id) } @@ -131,6 +134,7 @@ struct DataAccountsView: View { let what = [Tr.t(l.title), l.plan, l.kind == "cli" ? Tr.t("CLI login") : "", l.label.caseInsensitiveCompare(e.title) == .orderedSame ? "" : l.label].filter { !$0.isEmpty }.joined(separator: " · ") return VStack(alignment: .leading, spacing: 4) { HStack(spacing: 6) { + if ProviderMarks.spec(l.provider) != nil { ProviderMark(provider: l.provider, size: 13) } Text(what).dmono(11).foregroundStyle(BackplaneDesign.dim).lineLimit(1) if l.default { Text(Tr.t("Used for new threads")).dmono(10).foregroundStyle(BackplaneDesign.dim).lineLimit(1).fixedSize().padding(.horizontal, 5).padding(.vertical, 1).background(BackplaneDesign.raised) } Spacer(minLength: 4) diff --git a/mobile/ios/Backplane/DataExtras.swift b/mobile/ios/Backplane/DataExtras.swift index 42663e06b9..4807645843 100644 --- a/mobile/ios/Backplane/DataExtras.swift +++ b/mobile/ios/Backplane/DataExtras.swift @@ -123,7 +123,9 @@ struct DataPickerSheet: View { } var body: some View { VStack(spacing: 0) { - HStack { + HStack(spacing: 6) { + let activePv = picker?.sections.first(where: { $0.action == "provider" })?.choices.first(where: { $0.on })?.value ?? ProviderMarks.providerOfChip(picker?.chip ?? "") + if !activePv.isEmpty { ProviderMark(provider: activePv, size: 14) } Text(picker?.chip ?? " ").dmono(12).foregroundStyle(BackplaneDesign.text).lineLimit(1).accessibilityIdentifier("data.picker.chip") Spacer() Button(Tr.t("Done")) { dismiss() }.dmono(13, bold: true).foregroundStyle(BackplaneDesign.accent).accessibilityIdentifier("data.picker.done") @@ -140,6 +142,7 @@ struct DataPickerSheet: View { Button { press(s, c) } label: { HStack(spacing: 8) { Text(c.on ? "✓" : "").dmono(13).foregroundStyle(BackplaneDesign.accent).frame(width: 16) + if s.action == "provider" { ProviderMark(provider: c.value, size: 16) } VStack(alignment: .leading, spacing: 1) { Text(Tr.t(c.label)).dmono(13).foregroundStyle(c.ok ? BackplaneDesign.text : BackplaneDesign.faint) if !c.ok, !c.why.isEmpty { Text(Tr.t(c.why)).dmono(11).foregroundStyle(BackplaneDesign.faint) } diff --git a/mobile/ios/Backplane/DataModels.swift b/mobile/ios/Backplane/DataModels.swift index ee0f35a428..b09a7ca0cc 100644 --- a/mobile/ios/Backplane/DataModels.swift +++ b/mobile/ios/Backplane/DataModels.swift @@ -425,12 +425,13 @@ struct DPickerReply: Decodable { var picker: DPicker } /// Buy it (feature buy, `thread.buy`): the desktop header's button for a thread, in the hub's words; `order.buy` answers the buy thread made. struct DBuy: Decodable, Equatable { var label = ""; var tip = "" var thread = "" // a project page's Buy it: the thread the hub buys from (`thread.buy {project}`) - enum K: String, CodingKey { case label, tip, thread } - init(from d: Decoder) throws { let c = try d.container(keyedBy: K.self); label = c.str(.label); tip = c.str(.tip); thread = c.str(.thread) } } + var leadDays = 0; var estimateWarnings = "" + enum K: String, CodingKey { case label, tip, thread, lead_days, estimate_warnings } + init(from d: Decoder) throws { let c = try d.container(keyedBy: K.self); label = c.str(.label); tip = c.str(.tip); thread = c.str(.thread); leadDays = max(0, c.int(.lead_days)); estimateWarnings = c.str(.estimate_warnings) } } /// The top of a project's page (feature projectcard, `project.card`): its goal and its boards by name. -struct DProjectCard: Decodable, Equatable { var goal = ""; var boards: [String] = [] - enum K: String, CodingKey { case goal, boards } - init(from d: Decoder) throws { let c = try d.container(keyedBy: K.self); goal = c.str(.goal); boards = ((try? c.decode([String].self, forKey: .boards)) ?? []).filter { !$0.isEmpty } } } +struct DProjectCard: Decodable, Equatable { var goal = ""; var boards: [String] = []; var leadDays = 0; var estimateWarnings = "" + enum K: String, CodingKey { case goal, boards, lead_days, estimate_warnings } + init(from d: Decoder) throws { let c = try d.container(keyedBy: K.self); goal = c.str(.goal); boards = ((try? c.decode([String].self, forKey: .boards)) ?? []).filter { !$0.isEmpty }; leadDays = max(0, c.int(.lead_days)); estimateWarnings = c.str(.estimate_warnings) } } struct DBuyReply: Decodable { var buy: DBuy? enum K: String, CodingKey { case buy } init(from d: Decoder) throws { let c = try d.container(keyedBy: K.self); buy = try? c.decode(DBuy.self, forKey: .buy) } } @@ -454,13 +455,15 @@ struct DOrderStep: Decodable, Equatable { var label = ""; var mark = "" init(from d: Decoder) throws { let c = try d.container(keyedBy: K.self); label = (try? c.decode(String.self, forKey: .label)) ?? ""; mark = (try? c.decode(String.self, forKey: .mark)) ?? "" } enum K: String, CodingKey { case label, mark } } struct DOrder: Decodable, Equatable { - var name = "", line = "", total = "", customs = "", pay = "", label = ""; var waiting = false; var steps: [DOrderStep] = [] + var name = "", line = "", total = "", customs = "", pay = "", label = "", estimateWarnings = ""; var waiting = false; var leadDays = 0; var steps: [DOrderStep] = [] init(from d: Decoder) throws { let c = try d.container(keyedBy: K.self); func s(_ k: K) -> String { (try? c.decode(String.self, forKey: k)) ?? "" } name = s(.name); line = s(.line); total = s(.total); customs = s(.customs); pay = s(.pay); label = s(.label) waiting = (try? c.decode(Bool.self, forKey: .waiting)) ?? false; steps = (try? c.decode([DOrderStep].self, forKey: .steps)) ?? [] + leadDays = max(0, (try? c.decode(Int.self, forKey: .lead_days)) ?? 0) + estimateWarnings = s(.estimate_warnings) } - enum K: String, CodingKey { case name, line, total, customs, pay, label, waiting, steps } + enum K: String, CodingKey { case name, line, total, customs, pay, label, waiting, steps, lead_days, estimate_warnings } /// Only an http(s) link opens. var payURL: URL? { (pay.hasPrefix("https://") || pay.hasPrefix("http://")) ? URL(string: pay) : nil } } diff --git a/mobile/ios/Backplane/DataRing.swift b/mobile/ios/Backplane/DataRing.swift index e124885377..c50db01849 100644 --- a/mobile/ios/Backplane/DataRing.swift +++ b/mobile/ios/Backplane/DataRing.swift @@ -3,15 +3,30 @@ import SwiftUI // Settings, Ring (feature `ring`, docs/ring.md): the hub's rows (ring.page), drawn by the rows view Voice and Notifications use: the Pebble Index ring's Set up, the // webhook's URL and header to copy or share into the Pebble app on this phone, when the test event came, and the recordings with Play. Copy, share and Play are the // phone's own (DPageLocal); What happened (link-open) opens the thread here; the rest goes to ring.page.act {action, value, fields}, whose answer is the page again. +enum RingLogic { + static func hasPendingWork(_ rows: [DVoiceRow]) -> Bool { + rows.contains { r in + r.note.contains("being heard now") || r.note.contains("waiting to be heard") || r.note.contains("waiting to go to Pebble") + } + } +} + @MainActor @Observable final class RingModel { private(set) var rows: [DVoiceRow] = [] + private(set) var error = "" @ObservationIgnored weak var client: DataClient? func load() async { - guard let client, let r: DVoicePage = try? await client.call("ring.page") else { return } - rows = DVoiceRow.parse(r.rows) + guard let client else { return } + do { + let r: DVoicePage = try await client.call("ring.page") + rows = DVoiceRow.parse(r.rows) + error = "" + } catch { + self.error = error.localizedDescription + } } /// A press on a row's button; returns the hub's error for the row, if any. func act(action: String, value: String, fields: [String: String]) async -> String { @@ -19,7 +34,7 @@ final class RingModel { if action == "link-open" { if let u = URL(string: value) { client.openLink(u, thread: "") }; return "" } do { let r: DVoicePage = try await client.call("ring.page.act", ["action": action, "value": value, "fields": fields]) - rows = DVoiceRow.parse(r.rows); return "" + rows = DVoiceRow.parse(r.rows); error = ""; return "" } catch { await load(); return error.localizedDescription } } } @@ -27,9 +42,19 @@ final class RingModel { struct DataRingSection: View { @Bindable var client: DataClient var body: some View { - DPageRows(title: Tr.t("Ring"), idPrefix: "ring", rows: client.ring.rows, empty: Tr.t("Not connected")) { _, b, fields in - await client.ring.act(action: b.action, value: b.value, fields: fields) + VStack(alignment: .leading, spacing: 10) { + if !client.ring.error.isEmpty { Text(Tr.t(client.ring.error)).dmono(12).foregroundStyle(BackplaneDesign.bad) } + DPageRows(title: Tr.t("Ring"), idPrefix: "ring", rows: client.ring.rows, empty: Tr.t("Not connected")) { _, b, fields in + await client.ring.act(action: b.action, value: b.value, fields: fields) + } } .task(id: client.conn) { if client.conn == .online { await client.ring.load() } } + .task(id: "\(client.conn.rawValue)|\(RingLogic.hasPendingWork(client.ring.rows))") { + while !Task.isCancelled, client.conn == .online, RingLogic.hasPendingWork(client.ring.rows) { + try? await Task.sleep(for: .seconds(2)) + guard !Task.isCancelled, client.conn == .online else { break } + await client.ring.load() + } + } } } diff --git a/mobile/ios/Backplane/DataSections.swift b/mobile/ios/Backplane/DataSections.swift index a66e505c5e..b791c3df29 100644 --- a/mobile/ios/Backplane/DataSections.swift +++ b/mobile/ios/Backplane/DataSections.swift @@ -25,7 +25,9 @@ struct DSecRow: Decodable, Identifiable, Equatable { var snooze: [DSnoozeOpt]; var settle: String; var wake: String /// a project with a board in its folder var hasBoard: Bool - enum CodingKeys: String, CodingKey { case id, title, word, say, want, ago, machine, mark, project, projectKey, off, nav, pinned, hide, kind, key, running, needsCount, threads, icon, css, dots, more, rest, menu, fold, folded, under, need, label, tone, snooze, settle, wake, hasBoard } + /// thread provider id (e.g. claude, codex, antigravity) + var provider: String + enum CodingKeys: String, CodingKey { case id, title, word, say, want, ago, machine, mark, project, projectKey, off, nav, pinned, hide, kind, key, running, needsCount, threads, icon, css, dots, more, rest, menu, fold, folded, under, need, label, tone, snooze, settle, wake, hasBoard, provider } init(from d: Decoder) throws { let c = try d.container(keyedBy: CodingKeys.self) id = c.str(.id); title = c.str(.title); word = c.str(.word); say = c.str(.say); want = c.str(.want); ago = c.str(.ago); machine = c.str(.machine) @@ -36,7 +38,7 @@ struct DSecRow: Decodable, Identifiable, Equatable { fold = c.str(.fold); folded = c.bool(.folded); under = c.int(.under) need = kind == "swarm" ? DSwarmNeed.of(c, .need) : nil label = c.str(.label); badgeTone = c.str(.tone); snooze = (try? c.decode([DSnoozeOpt].self, forKey: .snooze)) ?? []; settle = c.str(.settle); wake = c.str(.wake) - hasBoard = c.bool(.hasBoard) + hasBoard = c.bool(.hasBoard); provider = c.str(.provider) } var isProject: Bool { !key.isEmpty } /// a chevron on the row: something is under it, or it is folded (an older hub sends no fold) @@ -149,6 +151,7 @@ struct DataSectionThread: View { HStack(spacing: 10) { VStack(alignment: .leading, spacing: 3) { HStack(spacing: 6) { + if !r.provider.isEmpty { ProviderMark(provider: r.provider, size: 12) } Text(r.title).dmono(14).foregroundStyle(BackplaneDesign.text).lineLimit(1) if r.pinned { Image(systemName: "pin.fill").font(.system(size: 9)).foregroundStyle(BackplaneDesign.faint).accessibilityIdentifier("data.section.pinned." + r.id) } } @@ -278,11 +281,13 @@ struct DataProjectPageView: View { @State private var whole = false var body: some View { List { - if let c = card, !c.goal.isEmpty || !c.boards.isEmpty { + if let c = card, !c.goal.isEmpty || !c.boards.isEmpty || c.leadDays > 0 || !c.estimateWarnings.isEmpty { Button { whole.toggle() } label: { VStack(alignment: .leading, spacing: 4) { if !c.goal.isEmpty { Text(c.goal).dmono(12).foregroundStyle(BackplaneDesign.text).lineLimit(whole ? 20 : 2).multilineTextAlignment(.leading) } if !c.boards.isEmpty { Text(Tr.t("Boards").uppercased() + " " + c.boards.joined(separator: " · ")).dmono(10).foregroundStyle(BackplaneDesign.dim).lineLimit(2) } + if c.leadDays > 0 { Text(Tr.order_lead_days(days: c.leadDays)).dmono(11).foregroundStyle(BackplaneDesign.dim).accessibilityIdentifier("data.project.page.lead") } + if !c.estimateWarnings.isEmpty { Text(Tr.order_estimate_warnings(warnings: c.estimateWarnings)).dmono(11).foregroundStyle(BackplaneDesign.warn).fixedSize(horizontal: false, vertical: true).accessibilityIdentifier("data.project.page.warnings") } }.frame(maxWidth: .infinity, alignment: .leading).padding(.horizontal, 14).padding(.vertical, 8).contentShape(Rectangle()) }.buttonStyle(.plain).background(BackplaneDesign.panel).accessibilityIdentifier("data.project.page.card").dataRow() } diff --git a/mobile/ios/Backplane/DataSettings.swift b/mobile/ios/Backplane/DataSettings.swift index 0c76a31b7d..29133edb08 100644 --- a/mobile/ios/Backplane/DataSettings.swift +++ b/mobile/ios/Backplane/DataSettings.swift @@ -6,7 +6,7 @@ import SwiftUI /// A page under Settings (DPage name); Accounts & Usage and Improvements are pages of their own ("accounts", "improvements"). enum DSettingsPage: String, CaseIterable { - case hubs = "settings.hubs", agents = "settings.agents", machines = "settings.machines", notifications = "settings.notifications", + case hubs = "settings.hubs", agents = "settings.agents", ring = "settings.ring", machines = "settings.machines", notifications = "settings.notifications", appearance = "settings.appearance", updates = "settings.updates", browser = "settings.browser" } @@ -33,6 +33,7 @@ struct DataSettingsView: View { top.append(DSettingsGroup(id: "settings.hubs", icon: "server.rack", title: Tr.t("Hubs"), page: DPage(name: DSettingsPage.hubs.rawValue))) var work: [DSettingsGroup] = [] if client.has("mcpsettings") || client.has("voice") || client.has("cats") || client.bots.contains(where: { $0.delete }) { work.append(DSettingsGroup(id: "settings.agents", icon: "cpu", title: Tr.t("Agents"), page: DPage(name: DSettingsPage.agents.rawValue))) } + if client.has("ring") { work.append(DSettingsGroup(id: "settings.ring", icon: "waveform.circle", title: Tr.t("Ring"), page: DPage(name: DSettingsPage.ring.rawValue))) } if client.has("browserstart") { work.append(DSettingsGroup(id: "settings.browser", icon: "globe", title: Tr.t("Browser"), page: DPage(name: DSettingsPage.browser.rawValue))) } if client.has("machines") || client.has("devices") { work.append(DSettingsGroup(id: "settings.machines", icon: "desktopcomputer", title: Tr.t("Machines & devices"), page: DPage(name: DSettingsPage.machines.rawValue))) } let phone = [DSettingsGroup(id: "settings.notifications", icon: "bell", title: Tr.t("Notifications"), page: DPage(name: DSettingsPage.notifications.rawValue)), @@ -55,7 +56,10 @@ struct DataSettingsView: View { e(Tr.t("Updates"), updates), e(Tr.t("Improvements"), "improvements"), ] if client.has("notifysettings") { all.append(e(Tr.t("Notifications"), notify)) } - if client.has("ring") { all.append(e(Tr.t("Ring"), notify)) } + if client.has("ring") { + let ring = DSettingsPage.ring.rawValue + all += [e(Tr.t("Ring"), ring), e(Tr.t("Pebble Index ring"), ring), e(Tr.t("Recordings"), ring)] + } if client.has("cats") { all += [e(Tr.t("Your uberbot"), agents), e(Tr.t("Name"), agents), e(Tr.t("Colour"), agents), e(Tr.t("Cat"), agents)] } if client.bots.contains(where: { $0.delete }) { all += [e(Tr.k("bots.settings.head"), agents), e(Tr.t("Delete bot"), agents)] } if client.has("mcpsettings") { all.append(e(Tr.t("MCP servers"), agents)) } @@ -193,6 +197,7 @@ struct DataSettingsPageView: View { switch page { case .hubs: Tr.t("Hubs") case .agents: Tr.t("Agents") + case .ring: Tr.t("Ring") case .machines: Tr.t("Machines & devices") case .notifications: Tr.t("Notifications") case .appearance: Tr.t("Appearance") @@ -212,6 +217,7 @@ struct DataSettingsPageView: View { DataBotsSection(client: client) if client.has("mcpsettings") { NavigationLink(value: DPage(name: "mcp")) { Text(Tr.t("MCP servers")) }.buttonStyle(DButton()).accessibilityIdentifier("settings.mcp") } if client.has("voice") { if client.has("mcpsettings") { DLine() }; DataVoiceSection(client: client) } + case .ring: DataRingSection(client: client) case .machines: if let h = client.home { VStack(alignment: .leading, spacing: 6) { @@ -237,6 +243,7 @@ struct DataSettingsPageView: View { } .background(BackplaneDesign.background) .dataBar(title) + .refreshable { if page == .ring { await client.ring.load() } } .confirmationDialog(Tr.ios_hub_forget_ask(hub: forgetKey ?? Tr.t("this hub")), isPresented: Binding(get: { forgetKey != nil }, set: { if !$0 { forgetKey = nil } }), titleVisibility: .visible) { Button(Tr.t("Forget"), role: .destructive) { if let k = forgetKey { client.forgetHub(k) }; forgetKey = nil } } message: { Text(Tr.t("This phone's saved copy of its threads is removed. Pair again to come back.")) } @@ -261,7 +268,6 @@ struct DataSettingsPageView: View { // an older hub has no Notifications page: its quiet hours and urgent switch are drawn here if client.has("push") && !client.has("notifysettings") { DLine(); DataQuietSection(client: client) } if client.has("notifysettings") { DLine(); DataNotifySection(client: client) } - if client.has("ring") { DLine(); DataRingSection(client: client) } } @ViewBuilder private var hubs: some View { let keys = client.links.compactMap { Pairing.key($0) } diff --git a/mobile/ios/Backplane/DataSwarm.swift b/mobile/ios/Backplane/DataSwarm.swift index bc4e09a5e8..9728584283 100644 --- a/mobile/ios/Backplane/DataSwarm.swift +++ b/mobile/ios/Backplane/DataSwarm.swift @@ -218,7 +218,7 @@ private struct DataSwarmMemberRow: View { HStack(spacing: 6) { Menu { ForEach(Swarm.providers(models), id: \.self) { p in Button(p) { member.provider = p; member.model = "" } } - } label: { pick(member.provider.isEmpty ? Tr.t("Provider") : member.provider) }.accessibilityIdentifier("data.swarm.member.provider.\(index)") + } label: { pick(member.provider.isEmpty ? Tr.t("Provider") : member.provider, provider: member.provider) }.accessibilityIdentifier("data.swarm.member.provider.\(index)") Menu { Button(Tr.t("default")) { member.model = "" } ForEach(models[member.provider] ?? [], id: \.value) { m in Button(m.label) { member.model = m.value }.disabled(!m.ok) } @@ -232,8 +232,11 @@ private struct DataSwarmMemberRow: View { .accessibilityIdentifier("data.swarm.member.role.\(index)") } } - private func pick(_ s: String) -> some View { - HStack(spacing: 4) { Text(s).dmono(12).foregroundStyle(BackplaneDesign.text).lineLimit(1); Spacer(minLength: 0); Image(systemName: "chevron.down").font(.system(size: 9)).foregroundStyle(BackplaneDesign.dim) } + private func pick(_ s: String, provider: String = "") -> some View { + HStack(spacing: 4) { + if !provider.isEmpty { ProviderMark(provider: provider, size: 13) } + Text(s).dmono(12).foregroundStyle(BackplaneDesign.text).lineLimit(1); Spacer(minLength: 0); Image(systemName: "chevron.down").font(.system(size: 9)).foregroundStyle(BackplaneDesign.dim) + } .padding(.horizontal, 8).frame(maxWidth: .infinity, minHeight: 36).dbox(fill: BackplaneDesign.panel) } } diff --git a/mobile/ios/Backplane/DataViews.swift b/mobile/ios/Backplane/DataViews.swift index 5408e5c0a5..ab7c0a92f9 100644 --- a/mobile/ios/Backplane/DataViews.swift +++ b/mobile/ios/Backplane/DataViews.swift @@ -88,6 +88,7 @@ struct DataRoot: View { case .settings: path.append(DPage(name: "settings")) if t.id == "accounts" { path.append(DPage(name: "accounts")) } + else if t.id == "ring" { path.append(DPage(name: DSettingsPage.ring.rawValue)) } case .room: Task { if !client.rooms.contains(where: { $0.id == t.id }) { await client.loadBots() } @@ -104,7 +105,12 @@ struct DataRoot: View { if url.host == "thread" { client.openLink(url, thread: "") } else if url.host == "google" { return } // the end of a Google sign-in (GoogleLoop): not a pairing link else if url.host == "account" { if let id = url.pathComponents.dropFirst().first { client.pushAccount = id } } - else if url.host == "settings" { if url.pathComponents.dropFirst().first == "accounts" { client.openAccounts = true } else { client.openSettings = true } } + else if url.host == "settings" { + let sub = url.pathComponents.dropFirst().first + if sub == "accounts" { client.openAccounts = true } + else if sub == "ring" { client.linkTarget = DLinkTarget(kind: .settings, id: "ring") } + else { client.openSettings = true } + } else { client.opened(url) } } // a picture from another app (Open in / Share, Files): a copy in the app's Inbox, or a file it may read for a moment @@ -667,6 +673,7 @@ struct DataThreadRow: View { VStack(alignment: .leading, spacing: 2) { HStack(spacing: 6) { if thread.pinned { Image(systemName: "pin.fill").font(.system(size: 9)).foregroundStyle(BackplaneDesign.accent) } + if !thread.provider.isEmpty { ProviderMark(provider: thread.provider, size: 12) } Text(thread.title.isEmpty ? Tr.t("New thread") : thread.title).dmono(13).foregroundStyle(BackplaneDesign.text).lineLimit(1) } if !thread.preview.isEmpty { Text(thread.preview.replacingOccurrences(of: "**", with: "").replacingOccurrences(of: "`", with: "")).dmono(11).foregroundStyle(BackplaneDesign.faint).lineLimit(1) } @@ -795,7 +802,14 @@ struct DataNewThreadSheet: View { if !error.isEmpty { Text(Tr.t(error)).dmono(12).foregroundStyle(BackplaneDesign.bad) } HStack(spacing: 6) { if client.has("picker") { - Button { picking = true } label: { Text(chip.isEmpty ? " " : chip).dmono(12).foregroundStyle(BackplaneDesign.text).lineLimit(1).padding(.horizontal, 10).frame(maxWidth: .infinity, minHeight: 40, alignment: .leading).dbox(fill: BackplaneDesign.panel) } + let pv = choice.provider.flatMap { $0.isEmpty ? nil : $0 } ?? ProviderMarks.providerOfChip(chip) + Button { picking = true } label: { + HStack(spacing: 6) { + if !pv.isEmpty { ProviderMark(provider: pv, size: 14) } + Text(chip.isEmpty ? " " : chip).dmono(12).foregroundStyle(BackplaneDesign.text).lineLimit(1) + } + .padding(.horizontal, 10).frame(maxWidth: .infinity, minHeight: 40, alignment: .leading).dbox(fill: BackplaneDesign.panel) + } .buttonStyle(.plain).accessibilityLabel(Tr.ios_model_label(model: chip)).accessibilityIdentifier("data.thread.new.model") } else { Spacer() } Button(Tr.t(busy ? "Starting…" : "Start")) { Task { await start() } }.buttonStyle(DButton(primary: true)).disabled(busy).accessibilityIdentifier("data.thread.new.start") @@ -1257,7 +1271,14 @@ struct DataThreadView: View { if let m = thread?.memory { MemoryBar(m: m) } HStack(spacing: 6) { if client.has("picker") || thread?.chip.isEmpty == false { - Button { modelSheet = true } label: { Text(chip).dmono(12).foregroundStyle(BackplaneDesign.text).lineLimit(1).padding(.horizontal, 10).frame(maxWidth: .infinity, minHeight: 40, alignment: .leading).dbox(fill: BackplaneDesign.panel) } + let pv = (thread?.provider).flatMap { $0.isEmpty ? nil : $0 } ?? ProviderMarks.providerOfChip(chip) + Button { modelSheet = true } label: { + HStack(spacing: 6) { + if !pv.isEmpty { ProviderMark(provider: pv, size: 14) } + Text(chip).dmono(12).foregroundStyle(BackplaneDesign.text).lineLimit(1) + } + .padding(.horizontal, 10).frame(maxWidth: .infinity, minHeight: 40, alignment: .leading).dbox(fill: BackplaneDesign.panel) + } .buttonStyle(.plain).accessibilityLabel(Tr.ios_model_label(model: chip)).accessibilityIdentifier("data.thread.model") } else { Spacer(minLength: 0) } if client.has("plan"), let pm { @@ -2075,6 +2096,8 @@ struct DataOrderCard: View { Text(Tr.t(order.line)).dmono(12).foregroundStyle(order.waiting ? BackplaneDesign.dim : BackplaneDesign.text) if !order.total.isEmpty { Text(Tr.t(order.total)).dmono(14, bold: true).foregroundStyle(BackplaneDesign.text) } if !order.customs.isEmpty { Text(Tr.t(order.customs)).dmono(11).foregroundStyle(BackplaneDesign.dim) } + if order.leadDays > 0 { Text(Tr.order_lead_days(days: order.leadDays)).dmono(11).foregroundStyle(BackplaneDesign.dim).accessibilityIdentifier("thread.order.lead") } + if !order.estimateWarnings.isEmpty { Text(Tr.order_estimate_warnings(warnings: order.estimateWarnings)).dmono(11).foregroundStyle(BackplaneDesign.warn).fixedSize(horizontal: false, vertical: true).accessibilityIdentifier("thread.order.warnings") } if let u = order.payURL { Button(Tr.t(order.label.isEmpty ? "Buy now" : order.label)) { openURL(u) }.buttonStyle(DButton(primary: true)).accessibilityIdentifier("thread.order.pay") } } .padding(10).frame(maxWidth: .infinity, alignment: .leading).background(BackplaneDesign.panel).overlay(Rectangle().strokeBorder(BackplaneDesign.line, lineWidth: 1)) diff --git a/mobile/ios/Backplane/ProviderMark.swift b/mobile/ios/Backplane/ProviderMark.swift new file mode 100644 index 0000000000..8346974a7a --- /dev/null +++ b/mobile/ios/Backplane/ProviderMark.swift @@ -0,0 +1,325 @@ +import SwiftUI + +/// Vector marks for every built-in AI provider, matching assets/providers/*.svg and desktop GPUI (`art.rs` / `picker.rs`). +/// Pure path parsing and canonicalization live in `ProviderMarks` so standalone Swift unit tests can exercise them without UI. +enum ProviderMarks { + enum SVGSeg: Sendable, Equatable { + case move(CGFloat, CGFloat) + case line(CGFloat, CGFloat) + case cubic(CGFloat, CGFloat, CGFloat, CGFloat, CGFloat, CGFloat) + case quad(CGFloat, CGFloat, CGFloat, CGFloat) + case close + } + + struct Spec: Sendable { + let id: String + let color: Int + let letter: String + let vbW: CGFloat + let vbH: CGFloat + let d: String + let segs: [SVGSeg] + + init(id: String, color: Int, letter: String, vbW: CGFloat, vbH: CGFloat, d: String) { + self.id = id + self.color = color + self.letter = letter + self.vbW = vbW + self.vbH = vbH + self.d = d + self.segs = ProviderMarks.parseSegments(d) + } + } + + private static let claudeD = "m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z" + private static let codexD = "M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87l51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921l51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272l-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695l-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69l-1.535-.922l-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87l-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58L128.067 97.3l28.188 16.218v32.434l-28.086 16.218l-28.188-16.218l-.052-32.434Z" + private static let grokD = "M9.497 15.122 L16.811 9.491 C17.169 9.215 17.682 9.323 17.852 9.751 C18.752 12.013 18.35 14.73 16.561 16.596 C14.772 18.462 12.283 18.871 10.007 17.939 L7.522 19.139 C11.087 21.68 15.416 21.052 18.121 18.229 C20.267 15.991 20.931 12.941 20.31 10.19 L20.315 10.196 C19.414 6.155 20.537 4.54 22.837 1.237 C22.891 1.159 22.946 1.08 23 1 L19.974 4.156 L19.974 4.146 L9.495 15.124 M7.987 16.49 C5.429 13.941 5.87 9.996 8.053 7.721 C9.667 6.037 12.313 5.35 14.622 6.361 L17.102 5.166 C16.655 4.829 16.082 4.467 15.425 4.213 C12.455 2.938 8.9 3.573 6.485 6.088 C4.163 8.51 3.433 12.234 4.687 15.411 C5.624 17.786 4.088 19.466 2.541 21.162 C1.993 21.763 1.443 22.364 1 23 L7.985 16.492" + private static let museD = "M10.73.032c-1.333 0-2.032 1.016-2.032 2.285 0 2.223 2.127 4.953 4.318 4.953 1.301 0 2-.953 2-2.254 0-2.254-2.095-4.984-4.286-4.984m8.413 2.984c-1.968 0-3.397 2.73-3.397 4.825 0 1.556.794 3.016 2.254 3.016 2 0 3.365-2.762 3.365-4.794 0-1.523-.762-3.047-2.222-3.047M4.857 4.159c-1.968 0-3.778 1.016-3.778 2.54 0 1.65 2.16 2.793 4.254 2.793 1.873 0 3.778-.92 3.778-2.508 0-1.682-2.159-2.825-4.254-2.825m-.222 6.476C2.413 10.635 0 13.175 0 15.397c0 1.301.825 2.159 2.095 2.159 2.19 0 4.603-2.508 4.603-4.794 0-1.27-.761-2.127-2.063-2.127m16.667.698c-2.223 0-5.016 1.62-5.016 3.651 0 1.238 1.047 2.19 2.698 2.19 2.159 0 5.016-1.587 5.016-3.682 0-1.302-1.08-2.159-2.698-2.159M7.619 16c-1.524 0-2.38 1.746-2.38 3.429 0 2.063 1.269 4.54 3.047 4.54 1.524 0 2.38-1.81 2.38-3.461C10.667 18.57 9.46 16 7.62 16m6.571 1.016c-1.333 0-2.476.667-2.476 2.032 0 2.095 2.667 4.063 4.92 4.063 1.366 0 2.54-.73 2.54-2.063 0-2.032-2.698-4.032-4.984-4.032" + private static let antigravityD = "M20.197 20.618 C21.318 21.459 23 20.898 21.459 19.357 C16.834 14.873 17.815 2.541 12.07 2.541 C6.325 2.541 7.306 14.873 2.682 19.357 C1 21.038 2.822 21.459 3.943 20.618 C8.287 17.675 8.006 12.49 12.07 12.49 C16.134 12.49 15.853 17.675 20.197 20.618 Z" + private static let opencodeD = "M22 24H2V0h20zM17 4.8H7v14.4h10z" + private static let piD = "M0 0v24h6v-6h6v-6H6V6h6v6h6V0Zm18 12v12h6V12Z" + private static let ompD = "M1.44 3.86 L22.56 3.86 C23 3.86 23 3.86 23 4.3 L23 6.06 C23 6.5 23 6.5 22.56 6.5 L1.44 6.5 C1 6.5 1 6.5 1 6.06 L1 4.3 C1 3.86 1 3.86 1.44 3.86 Z M4.74 6.5 L6.5 6.5 C6.94 6.5 6.94 6.5 6.94 6.94 L6.94 19.7 C6.94 20.14 6.94 20.14 6.5 20.14 L4.74 20.14 C4.3 20.14 4.3 20.14 4.3 19.7 L4.3 6.94 C4.3 6.5 4.3 6.5 4.74 6.5 Z M15.74 6.5 L17.5 6.5 C17.94 6.5 17.94 6.5 17.94 6.94 L17.94 13.32 C17.94 13.76 17.94 13.76 17.5 13.76 L15.74 13.76 C15.3 13.76 15.3 13.76 15.3 13.32 L15.3 6.94 C15.3 6.5 15.3 6.5 15.74 6.5 Z M15.08 14.64 L18.16 14.64 C18.82 14.64 18.82 14.64 18.82 15.3 L18.82 17.5 C18.82 18.16 18.82 18.16 18.16 18.16 L15.08 18.16 C14.42 18.16 14.42 18.16 14.42 17.5 L14.42 15.3 C14.42 14.64 14.42 14.64 15.08 14.64 Z" + + static let all: [Spec] = [ + Spec(id: "claude", color: 0xD97757, letter: "A", vbW: 24, vbH: 24, d: claudeD), + Spec(id: "codex", color: 0x10A37F, letter: "O", vbW: 256, vbH: 260, d: codexD), + Spec(id: "grok", color: 0x6B7280, letter: "X", vbW: 24, vbH: 24, d: grokD), + Spec(id: "muse", color: 0x8B5CF6, letter: "M", vbW: 24, vbH: 24, d: museD), + Spec(id: "antigravity", color: 0x4285F4, letter: "G", vbW: 24, vbH: 24, d: antigravityD), + Spec(id: "opencode", color: 0x2563EB, letter: "C", vbW: 24, vbH: 24, d: opencodeD), + Spec(id: "pi", color: 0xDB2777, letter: "π", vbW: 24, vbH: 24, d: piD), + Spec(id: "omp", color: 0xC026D3, letter: "Ω", vbW: 24, vbH: 24, d: ompD), + ] + + private static let byId: [String: Spec] = Dictionary(uniqueKeysWithValues: all.map { ($0.id, $0) }) + + static func canonical(_ raw: String) -> String { + var k = raw.trimmingCharacters(in: .whitespacesAndNewlines).lowercased() + if k.hasPrefix("@") { k.removeFirst() } + switch k { + case "anthropic": return "claude" + case "openai": return "codex" + case "agy", "gemini": return "antigravity" + default: return k + } + } + + static func spec(_ raw: String) -> Spec? { byId[canonical(raw)] } + static func color(_ raw: String) -> Int { spec(raw)?.color ?? 0x64748B } + static func letter(_ raw: String) -> String { spec(raw)?.letter ?? "?" } + + static func providerOfChip(_ chip: String) -> String { + let head = chip.components(separatedBy: " / ").first?.components(separatedBy: " · ").first?.trimmingCharacters(in: .whitespaces) ?? "" + return spec(head) != nil ? canonical(head) : "" + } + + static func swiftColor(_ rgb: Int) -> Color { + Color(red: Double((rgb >> 16) & 255) / 255, green: Double((rgb >> 8) & 255) / 255, blue: Double(rgb & 255) / 255) + } + + static func path(for spec: Spec) -> Path { + var p = Path() + for s in spec.segs { + switch s { + case let .move(x, y): p.move(to: CGPoint(x: x, y: y)) + case let .line(x, y): p.addLine(to: CGPoint(x: x, y: y)) + case let .cubic(x1, y1, x2, y2, x, y): p.addCurve(to: CGPoint(x: x, y: y), control1: CGPoint(x: x1, y: y1), control2: CGPoint(x: x2, y: y2)) + case let .quad(x1, y1, x, y): p.addQuadCurve(to: CGPoint(x: x, y: y), control: CGPoint(x: x1, y: y1)) + case .close: p.closeSubpath() + } + } + return p + } + + static func parseSegments(_ d: String) -> [SVGSeg] { + let scalars = Array(d.unicodeScalars) + let n = scalars.count + var idx = 0 + + func isSep(_ u: UnicodeScalar) -> Bool { u == "," || CharacterSet.whitespacesAndNewlines.contains(u) } + func isDigit(_ u: UnicodeScalar) -> Bool { u.value >= 48 && u.value <= 57 } + func isLetter(_ u: UnicodeScalar) -> Bool { (u.value >= 65 && u.value <= 90) || (u.value >= 97 && u.value <= 122) } + + func skipSep() { + while idx < n && isSep(scalars[idx]) { idx += 1 } + } + func hasNumber() -> Bool { + skipSep() + guard idx < n else { return false } + let c = scalars[idx] + return c == "-" || c == "+" || c == "." || isDigit(c) + } + func nextNum() -> CGFloat { + skipSep() + let start = idx + if idx < n && (scalars[idx] == "-" || scalars[idx] == "+") { idx += 1 } + var sawDot = false + while idx < n { + let c = scalars[idx] + if isDigit(c) { + idx += 1 + } else if c == "." && !sawDot { + sawDot = true + idx += 1 + } else if (c == "e" || c == "E") && idx > start { + idx += 1 + if idx < n && (scalars[idx] == "-" || scalars[idx] == "+") { idx += 1 } + } else { + break + } + } + let str = String(String.UnicodeScalarView(scalars[start.. Bool { + skipSep() + guard idx < n else { return false } + let c = scalars[idx] + idx += 1 + return c == "1" + } + + var out: [SVGSeg] = [] + var cmd: Character = "M" + var x: CGFloat = 0, y: CGFloat = 0, sx: CGFloat = 0, sy: CGFloat = 0 + var lastC: (CGFloat, CGFloat)? + var lastQ: (CGFloat, CGFloat)? + + while true { + skipSep() + if idx >= n { break } + let before = idx + let ch = scalars[idx] + if isLetter(ch) { + cmd = Character(ch) + idx += 1 + if cmd == "Z" || cmd == "z" { + out.append(.close) + x = sx; y = sy + lastC = nil; lastQ = nil + continue + } + } else if !hasNumber() { + idx += 1 + continue + } + + let rel = cmd.isLowercase + let ox: CGFloat = rel ? x : 0 + let oy: CGFloat = rel ? y : 0 + var nextC: (CGFloat, CGFloat)? + var nextQ: (CGFloat, CGFloat)? + + switch cmd.uppercased() { + case "M": + x = ox + nextNum(); y = oy + nextNum() + sx = x; sy = y + out.append(.move(x, y)) + cmd = rel ? "l" : "L" + case "L": + x = ox + nextNum(); y = oy + nextNum() + out.append(.line(x, y)) + case "H": + x = ox + nextNum() + out.append(.line(x, y)) + case "V": + y = oy + nextNum() + out.append(.line(x, y)) + case "C": + let x1 = ox + nextNum(), y1 = oy + nextNum() + let x2 = ox + nextNum(), y2 = oy + nextNum() + x = ox + nextNum(); y = oy + nextNum() + out.append(.cubic(x1, y1, x2, y2, x, y)) + nextC = (x2, y2) + case "S": + let (x1, y1) = lastC.map { (2 * x - $0.0, 2 * y - $0.1) } ?? (x, y) + let x2 = ox + nextNum(), y2 = oy + nextNum() + x = ox + nextNum(); y = oy + nextNum() + out.append(.cubic(x1, y1, x2, y2, x, y)) + nextC = (x2, y2) + case "Q": + let qx = ox + nextNum(), qy = oy + nextNum() + x = ox + nextNum(); y = oy + nextNum() + out.append(.quad(qx, qy, x, y)) + nextQ = (qx, qy) + case "T": + let (qx, qy) = lastQ.map { (2 * x - $0.0, 2 * y - $0.1) } ?? (x, y) + x = ox + nextNum(); y = oy + nextNum() + out.append(.quad(qx, qy, x, y)) + nextQ = (qx, qy) + case "A": + let rx = nextNum(), ry = nextNum(), rot = nextNum() + let large = nextFlag(), sweep = nextFlag() + let ex = ox + nextNum(), ey = oy + nextNum() + arcToCubics(Double(x), Double(y), Double(rx), Double(ry), Double(rot), large, sweep, Double(ex), Double(ey), &out) + x = ex; y = ey + default: + if idx == before { idx += 1 } + } + if idx == before { idx += 1 } + lastC = nextC + lastQ = nextQ + } + return out + } + + private static func arcToCubics( + _ x0: Double, _ y0: Double, + _ rxIn: Double, _ ryIn: Double, + _ xAxisRotationDeg: Double, + _ largeArc: Bool, _ sweep: Bool, + _ x: Double, _ y: Double, + _ out: inout [SVGSeg] + ) { + if x0 == x && y0 == y { return } + var rx = abs(rxIn), ry = abs(ryIn) + if rx == 0 || ry == 0 { + out.append(.line(CGFloat(x), CGFloat(y))) + return + } + let phi = xAxisRotationDeg * .pi / 180.0 + let cosPhi = cos(phi), sinPhi = sin(phi) + let dx2 = (x0 - x) / 2.0, dy2 = (y0 - y) / 2.0 + let x1p = cosPhi * dx2 + sinPhi * dy2 + let y1p = -sinPhi * dx2 + cosPhi * dy2 + + let lambda = (x1p * x1p) / (rx * rx) + (y1p * y1p) / (ry * ry) + if lambda > 1.0 { + let s = sqrt(lambda) + rx *= s; ry *= s + } + let rx2 = rx * rx, ry2 = ry * ry, x1p2 = x1p * x1p, y1p2 = y1p * y1p + let num = max(0.0, rx2 * ry2 - rx2 * y1p2 - ry2 * x1p2) + let den = rx2 * y1p2 + ry2 * x1p2 + let factor = den == 0 ? 0.0 : sqrt(num / den) * (largeArc == sweep ? -1.0 : 1.0) + let cxp = factor * (rx * y1p / ry) + let cyp = factor * (-ry * x1p / rx) + let cx = cosPhi * cxp - sinPhi * cyp + (x0 + x) / 2.0 + let cy = sinPhi * cxp + cosPhi * cyp + (y0 + y) / 2.0 + + func vecAngle(_ ux: Double, _ uy: Double, _ vx: Double, _ vy: Double) -> Double { + let sign = (ux * vy - uy * vx) < 0 ? -1.0 : 1.0 + let mag = sqrt((ux * ux + uy * uy) * (vx * vx + vy * vy)) + if mag == 0 { return 0 } + let dot = min(1.0, max(-1.0, (ux * vx + uy * vy) / mag)) + return sign * acos(dot) + } + + let ux = (x1p - cxp) / rx, uy = (y1p - cyp) / ry + let vx = (-x1p - cxp) / rx, vy = (-y1p - cyp) / ry + let theta1 = vecAngle(1, 0, ux, uy) + var dTheta = vecAngle(ux, uy, vx, vy) + if !sweep && dTheta > 0 { dTheta -= 2.0 * .pi } + else if sweep && dTheta < 0 { dTheta += 2.0 * .pi } + + let segs = max(1, Int(ceil(abs(dTheta) / (.pi / 2.0)))) + let delta = dTheta / Double(segs) + let t = (4.0 / 3.0) * tan(delta / 4.0) + + for i in 0.. CGFloat { CGFloat(cosPhi * rx * px - sinPhi * ry * py + cx) } + func mapY(_ px: Double, _ py: Double) -> CGFloat { CGFloat(sinPhi * rx * px + cosPhi * ry * py + cy) } + out.append(.cubic( + mapX(p1x, p1y), mapY(p1x, p1y), + mapX(p2x, p2y), mapY(p2x, p2y), + i == segs - 1 ? CGFloat(x) : mapX(cos2, sin2), + i == segs - 1 ? CGFloat(y) : mapY(cos2, sin2) + )) + } + } +} + +/// Draws the provider's vector mark tinted in its brand color, or a colored square with "?" for unknown providers. +struct ProviderMark: View { + let provider: String + var size: CGFloat = 14 + + var body: some View { + if let spec = ProviderMarks.spec(provider) { + Canvas { ctx, sz in + let s = min(sz.width / spec.vbW, sz.height / spec.vbH) + let ox = (sz.width - spec.vbW * s) * 0.5 + let oy = (sz.height - spec.vbH * s) * 0.5 + var c = ctx + c.translateBy(x: ox, y: oy) + c.scaleBy(x: s, y: s) + c.fill(ProviderMarks.path(for: spec), with: .color(ProviderMarks.swiftColor(spec.color)), style: FillStyle(eoFill: false)) + } + .frame(width: size, height: size) + .accessibilityHidden(true) + } else { + Text("?") + .font(.system(size: max(8, size * 0.62), weight: .bold, design: .monospaced)) + .foregroundStyle(.white) + .frame(width: size, height: size) + .background(ProviderMarks.swiftColor(0x64748B)) + .accessibilityHidden(true) + } + } +} diff --git a/mobile/ios/Shared/TrCatalog.swift b/mobile/ios/Shared/TrCatalog.swift index 6b90aecebe..b0b6aafb40 100644 --- a/mobile/ios/Shared/TrCatalog.swift +++ b/mobile/ios/Shared/TrCatalog.swift @@ -4933,6 +4933,8 @@ provider.notice.senderr No AI provider connected yet. Open Settings → Accounts provider.notice.senderr.remote No AI provider connected on {machine}. Open Settings → Accounts on {machine} to connect Claude, Codex, Antigravity, or another provider. {machine} に AI プロバイダーが接続されていません。{machine} で設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。 No hay ningún proveedor de IA conectado en {machine}. Abre Configuración → Cuentas en {machine} para conectar Claude, Codex, Antigravity u otro proveedor. web.settings.providers AI providers AI プロバイダー Proveedores de IA web.settings.providers.browser Connect a provider in the Backplane desktop or mobile app under Settings → Accounts. Backplane のデスクトップまたはモバイルアプリの設定 → アカウントからプロバイダーを接続してください。 Conecta un proveedor en la aplicación de escritorio o móvil de Backplane en Configuración → Cuentas. +order.lead.days {days, plural, one {Est. lead time: 1 day} other {Est. lead time: {days} days}} {days, plural, one {目安納期: 1日} other {目安納期: {days}日}} {days, plural, one {Plazo estimado: 1 día} other {Plazo estimado: {days} días}} +order.estimate.warnings Warning: {warnings} 警告: {warnings} Aviso: {warnings} """# /// thread.count = {n, plural, one {# thread} other {# threads}} @@ -7916,4 +7918,10 @@ web.settings.providers.browser Connect a provider in the Backplane desktop or mo /// provider.notice.senderr.remote = No AI provider connected on {machine}. Open Settings → Accounts on {machine} to connect Claude, Codex, Antigravity, or another provider. static func provider_notice_senderr_remote(machine: String) -> String { f("provider.notice.senderr.remote", ["machine": machine]) } + + /// order.lead.days = {days, plural, one {Est. lead time: 1 day} other {Est. lead time: {days} days}} + static func order_lead_days(days: Int) -> String { f("order.lead.days", ["days": String(days)]) } + + /// order.estimate.warnings = Warning: {warnings} + static func order_estimate_warnings(warnings: String) -> String { f("order.estimate.warnings", ["warnings": warnings]) } } diff --git a/mobile/ios/Tests/ProviderMarkTests.swift b/mobile/ios/Tests/ProviderMarkTests.swift new file mode 100644 index 0000000000..36ca22eab2 --- /dev/null +++ b/mobile/ios/Tests/ProviderMarkTests.swift @@ -0,0 +1,44 @@ +// ProviderMarks parsing, bounding-box sanity (including Codex elliptical arcs), aliases and fallback. +// Compiled with Backplane/ProviderMark.swift on macOS. +import Foundation + +var failed = 0, passed = 0 +func check(_ ok: Bool, _ name: String, _ got: Any = "") { if ok { passed += 1 } else { failed += 1; print("FAIL \(name): got \(got)") } } + +let expected = ["claude", "codex", "grok", "muse", "antigravity", "opencode", "pi", "omp"] +check(ProviderMarks.all.map(\.id) == expected, "all 8 providers listed", ProviderMarks.all.map(\.id)) + +for spec in ProviderMarks.all { + check(!spec.segs.isEmpty, "\(spec.id) has segments", spec.segs.count) + var endXs: [CGFloat] = [], endYs: [CGFloat] = [], ctrlXs: [CGFloat] = [], ctrlYs: [CGFloat] = [] + for s in spec.segs { + switch s { + case let .move(x, y), let .line(x, y): endXs.append(x); endYs.append(y) + case let .cubic(x1, y1, x2, y2, x, y): ctrlXs += [x1, x2]; ctrlYs += [y1, y2]; endXs.append(x); endYs.append(y) + case let .quad(x1, y1, x, y): ctrlXs.append(x1); ctrlYs.append(y1); endXs.append(x); endYs.append(y) + case .close: break + } + } + let minX = endXs.min() ?? 0, maxX = endXs.max() ?? 0, minY = endYs.min() ?? 0, maxY = endYs.max() ?? 0 + check(minX >= -1 && maxX <= spec.vbW + 1, "\(spec.id) end X inside viewBox", "\(minX)...\(maxX)") + check(minY >= -1 && maxY <= spec.vbH + 1, "\(spec.id) end Y inside viewBox", "\(minY)...\(maxY)") + let pad = max(2, spec.vbW * 0.05) + if !ctrlXs.isEmpty { + check((ctrlXs.min() ?? 0) >= -pad && (ctrlXs.max() ?? 0) <= spec.vbW + pad, "\(spec.id) ctrl X", ctrlXs) + check((ctrlYs.min() ?? 0) >= -pad && (ctrlYs.max() ?? 0) <= spec.vbH + pad, "\(spec.id) ctrl Y", ctrlYs) + } +} + +check(ProviderMarks.canonical("agy") == "antigravity", "agy alias") +check(ProviderMarks.canonical("@Gemini") == "antigravity", "gemini alias") +check(ProviderMarks.canonical("openai") == "codex", "openai alias") +check(ProviderMarks.canonical("anthropic") == "claude", "anthropic alias") +check(ProviderMarks.providerOfChip("claude / opus / high") == "claude", "chip parse") +check(ProviderMarks.providerOfChip("openai · gpt-5") == "codex", "chip alias") +check(ProviderMarks.providerOfChip("unknown / m1") == "", "unknown chip") +check(ProviderMarks.spec("mystery") == nil, "unknown spec is nil") +check(ProviderMarks.letter("mystery") == "?", "unknown letter") +check(ProviderMarks.color("mystery") == 0x64748B, "unknown color") +check(!ProviderMarks.parseSegments("M0 0 Z 1 2 ? 3").isEmpty, "malformed path terminates") + +print("provider marks: \(passed) passed, \(failed) failed"); exit(failed == 0 ? 0 : 1) diff --git a/mobile/ios/Tests/WireJSONTests.swift b/mobile/ios/Tests/WireJSONTests.swift index 398ba35ee9..680f23245d 100644 --- a/mobile/ios/Tests/WireJSONTests.swift +++ b/mobile/ios/Tests/WireJSONTests.swift @@ -62,5 +62,15 @@ check(DPlanMode.effective(for: thOmitted)?.phase == "off", "Claude thread with o let askPlan = try! JSONDecoder().decode(DAsk.self, from: Data(#"{"id":"a1","state":"open","kind":"plan","head":"Proposed plan","question":"Do step 1","options":[],"revise":true}"#.utf8)) check(askPlan.head == "Proposed plan" && askPlan.revise && askPlan.kind == "plan", "DAsk decodes head & revise", "") +// Commerce lead_days + estimate_warnings across DOrder, DBuy, DProjectCard +let ord = try! JSONDecoder().decode(DOrder.self, from: Data(#"{"name":"Main","steps":[],"line":"Quoted","waiting":false,"total":"$27.20","customs":"","pay":"","label":"Buy now","lead_days":9,"estimate_warnings":"thin board"}"#.utf8)) +check(ord.leadDays == 9 && ord.estimateWarnings == "thin board", "DOrder decodes lead_days & estimate_warnings", ord) +let ordPlain = try! JSONDecoder().decode(DOrder.self, from: Data(#"{"name":"Main","steps":[],"line":"Reply","waiting":false,"lead_days":-2}"#.utf8)) +check(ordPlain.leadDays == 0 && ordPlain.estimateWarnings == "", "DOrder clamps negative/omitted fields", ordPlain) +let buy = try! JSONDecoder().decode(DBuy.self, from: Data(#"{"label":"Buy it","tip":"t","thread":"t1","lead_days":5,"estimate_warnings":"fragile"}"#.utf8)) +check(buy.leadDays == 5 && buy.estimateWarnings == "fragile", "DBuy decodes lead_days & estimate_warnings", buy) +let pcard = try! JSONDecoder().decode(DProjectCard.self, from: Data(#"{"goal":"Desk lamp","boards":["main"],"lead_days":7,"estimate_warnings":"warn1"}"#.utf8)) +check(pcard.leadDays == 7 && pcard.estimateWarnings == "warn1", "DProjectCard decodes lead_days & estimate_warnings", pcard) + print("wire-json: \(passed) passed, \(failed) failed") exit(failed == 0 ? 0 : 1) diff --git a/native/gpui/src/screens/order.rs b/native/gpui/src/screens/order.rs index a8e2cd3464..a3dab6cbca 100644 --- a/native/gpui/src/screens/order.rs +++ b/native/gpui/src/screens/order.rs @@ -6,7 +6,7 @@ use gpui::{prelude::*, *}; use serde_json::Value; #[derive(Debug, Clone, PartialEq)] -pub struct Card { pub name: String, pub steps: Vec<(String, String)>, pub line: String, pub waiting: bool, pub total: String, pub customs: String, pub pay: String, pub label: String, pub requote: bool } +pub struct Card { pub name: String, pub steps: Vec<(String, String)>, pub line: String, pub waiting: bool, pub total: String, pub customs: String, pub pay: String, pub label: String, pub requote: bool, pub lead_days: u64, pub estimate_warnings: String } pub fn parse(order: &Value) -> Option { if !order.is_object() { return None; } @@ -16,6 +16,8 @@ pub fn parse(order: &Value) -> Option { line: string(order, "line"), waiting: order["waiting"].as_bool().unwrap_or(false), total: string(order, "total"), customs: string(order, "customs"), pay: string(order, "pay"), label: string(order, "label"), requote: order["requote"].as_bool().unwrap_or(false), + lead_days: order["lead_days"].as_u64().unwrap_or(0), + estimate_warnings: string(order, "estimate_warnings"), }) } @@ -45,6 +47,13 @@ pub fn view(cx: &mut Context, light: bool, order: &Value) -> Option 0 { + col = col.child(div().text_size(crate::scale::tpx(11.)).text_color(c("dim")).child(tf("order.lead.days", &[("days", card.lead_days.into())]))); + } + if !card.estimate_warnings.is_empty() { + col = col.child(div().px_2().py_1().border_l_2().border_color(c("warn")).bg(c("raise")).text_size(crate::scale::tpx(11.)).text_color(c("warn")) + .child(tf("order.estimate.warnings", &[("warnings", card.estimate_warnings.as_str().into())]))); + } if payable(&card) { let link = card.pay.clone(); let label = if card.label.is_empty() { trs("Buy now") } else { trs(&card.label) }; @@ -76,6 +85,10 @@ mod tests { "line":"Quoted. Buy now to place the order.","waiting":false,"total":"$27.20","customs":"Includes import VAT and duties: nothing to pay on delivery.","pay":"http://127.0.0.1:3871/q/q_1?t=x","label":"Buy now · $27.20"}"#).unwrap(); let c = parse(&v).unwrap(); assert_eq!(c.steps[1], ("Quote".into(), "on".into())); assert_eq!(c.total, "$27.20"); assert!(payable(&c)); + assert_eq!(c.lead_days, 0); assert_eq!(c.estimate_warnings, ""); + let mut v_extra = v.clone(); v_extra["lead_days"] = serde_json::json!(9); v_extra["estimate_warnings"] = serde_json::json!("thin board"); + let c_extra = parse(&v_extra).unwrap(); + assert_eq!(c_extra.lead_days, 9); assert_eq!(c_extra.estimate_warnings, "thin board"); let mut v2 = v.clone(); v2["pay"] = "".into(); assert!(!payable(&parse(&v2).unwrap()), "no link, no button"); v2["pay"] = "javascript:alert(1)".into(); assert!(!payable(&parse(&v2).unwrap()), "only http(s) opens"); } diff --git a/native/gpui/src/screens/projects.rs b/native/gpui/src/screens/projects.rs index 236f23f13d..e87b6db257 100644 --- a/native/gpui/src/screens/projects.rs +++ b/native/gpui/src/screens/projects.rs @@ -618,6 +618,10 @@ pub fn buy_button(card: &Value) -> Option<(String, String, String)> { if b["action"] != "fab-buy" || label.is_empty() || thread.is_empty() { return None } Some((label, string(b, "tip"), thread)) } +/// Estimate lead time and warnings from `fab.look` (`lead_days`, `estimate_warnings`). +pub fn fab_estimate_meta(card: &Value) -> (u64, String) { + (card["lead_days"].as_u64().unwrap_or(0), string(card, "estimate_warnings")) +} /// The page's "N commits not pushed" from the hub's card (`unpushed`: the main checkout's commits its upstream lacks), None when there are none. pub fn unpushed(card: &Value) -> Option<(u64, String)> { let n = card["unpushed"]["count"].as_u64().unwrap_or(0); @@ -731,6 +735,19 @@ pub fn page(cx: &mut Context, reg: &super::timeline::Reg, light: bool .on_click(cx.listener(move |this, _, _, cx| { let _ = this.tx.try_send(Command::Rpc("project.push".into(), super::settings::Secret(serde_json::json!({"project": pid2.clone()})), "project-push")); cx.notify(); }))); } out.push(bar.into_any_element()); + if loaded && buy_button(&card).is_some() { + let (lead_days, warns) = fab_estimate_meta(&card); + if lead_days > 0 || !warns.is_empty() { + let mut meta = div().flex().flex_col().gap_1().pb_2(); + if lead_days > 0 { + meta = meta.child(div().text_size(crate::scale::tpx(11.)).text_color(c("dim")).child(crate::i18n::tf("order.lead.days", &[("days", lead_days.into())]))); + } + if !warns.is_empty() { + meta = meta.child(div().px_2().py_1().border_l_2().border_color(c("warn")).bg(c("raise")).text_size(crate::scale::tpx(11.)).text_color(c("warn")).child(crate::i18n::tf("order.estimate.warnings", &[("warnings", warns.as_str().into())]))); + } + out.push(meta.into_any_element()); + } + } // threads: the hub's lists for this project (running, needs you, recent, Done (n)), every machine's threads let lists = super::sections::page_lists(cx, light, data, pid, ctl); let listed = lists.is_some(); @@ -1016,8 +1033,10 @@ mod home_tests { assert_eq!(intent_lines("# Goal\n\nA lamp.\n\n# Parts\n\n- LED board\n* Shade\n## Notes"), vec![("h", "Goal".into()), ("p", "A lamp.".into()), ("h", "Parts".into()), ("li", "LED board".into()), ("li", "Shade".into()), ("h", "Notes".into())]); } #[test] fn the_pages_buy_it_is_the_hubs_button_and_names_the_thread_as_the_window_selects_it() { - let card: Value = serde_json::from_str(r#"{"buy":{"icon":"shopping-cart","label":"Buy it · from $5","tip":"Ready to order · A","action":"fab-buy","value":"t2"}}"#).unwrap(); + let card: Value = serde_json::from_str(r#"{"buy":{"icon":"shopping-cart","label":"Buy it · from $5","tip":"Ready to order · A","action":"fab-buy","value":"t2"},"lead_days":9,"estimate_warnings":"thin board"}"#).unwrap(); assert_eq!(buy_button(&card), Some(("Buy it · from $5".to_string(), "Ready to order · A".to_string(), "t2".to_string()))); + assert_eq!(fab_estimate_meta(&card), (9, "thin board".to_string())); + assert_eq!(fab_estimate_meta(&serde_json::json!({})), (0, String::new())); assert_eq!(buy_button(&serde_json::json!({})), None, "the hub offers none: no button"); assert_eq!(buy_button(&serde_json::json!({"buy":{"label":"Buy it","action":"fab-buy","value":""}})), None, "no thread to buy from"); let p = serde_json::json!({"id":"http://h:1|p1"}); let rows = [serde_json::json!({"id":"http://h:1|t2"})]; let rows: Vec<&Value> = rows.iter().collect(); diff --git a/native/host/src/data/ext.rs b/native/host/src/data/ext.rs index c425bdf6da..fb34aafd58 100644 --- a/native/host/src/data/ext.rs +++ b/native/host/src/data/ext.rs @@ -311,12 +311,24 @@ pub async fn call(hub: &Arc, c: &mut Conn, m: &str, p: &Value, is_browser: "thread.buy" if s(p, "thread").is_empty() && !s(p, "project").is_empty() => { let card = rpc(hub, c, "fab.look", json!({"project":s(p, "project")})).await.map(|r| r["result"].clone()).unwrap_or(Value::Null); let b = &card["buy"]; - Ok(json!({"buy": if b.is_object() { json!({"label":b["label"],"tip":b["tip"],"thread":b["value"]}) } else { Value::Null }})) } + Ok(json!({"buy": if b.is_object() { + let mut out = json!({"label":b["label"],"tip":b["tip"],"thread":b["value"]}); + let lead = b["lead_days"].as_u64().unwrap_or(0); + if lead > 0 { out["lead_days"] = json!(lead); } + if let Some(w) = b["estimate_warnings"].as_str().filter(|w| !w.is_empty()) { out["estimate_warnings"] = json!(w); } + out + } else { Value::Null }})) } "thread.buy" => { let th = s(p, "thread"); if th.is_empty() { return Some(Err(err("thread"))) } let card = rpc(hub, c, "fab.look", json!({"thread":th})).await.map(|r| r["result"].clone()).unwrap_or(Value::Null); let sess = crate::present::ready::keep(&card).unwrap_or(json!({})); let b = crate::statehost::policies().and_then(|q| q.with_state(|st| crate::present::ready::header(st, th, &sess))).flatten(); - Ok(json!({"buy": b.map_or(Value::Null, |b| json!({"label":b["label"],"tip":b["tip"]}))})) } + Ok(json!({"buy": b.map_or(Value::Null, |b| { + let mut out = json!({"label":b["label"],"tip":b["tip"]}); + let lead = b["lead_days"].as_u64().unwrap_or(0); + if lead > 0 { out["lead_days"] = json!(lead); } + if let Some(w) = b["estimate_warnings"].as_str().filter(|w| !w.is_empty()) { out["estimate_warnings"] = json!(w); } + out + })})) } "order.buy" => { let th = s(p, "thread"); if th.is_empty() { return Some(Err(err("thread"))) } rpc(hub, c, "order.buy", json!({"thread":th})).await.map(|r| json!({"thread":r["thread"]})) } // feature "fabprofile": the project's fab profile (fab/mod.rs Fab.view), the same the desktop and the agents' fab_profile read; `action` get, pick or seen @@ -506,7 +518,11 @@ pub fn notify_of(e: &Value) -> Value { json!({"kind":e["kind"],"thread":e["threa pub fn project_card(card: &Value) -> Value { let boards: Vec = card["board_files"].as_array().into_iter().flatten().filter_map(Value::as_str) .map(|f| f.rsplit('/').next().unwrap_or(f).trim_end_matches(".kicad_pcb").to_string()).filter(|n| !n.is_empty()).collect(); - json!({"goal": card["goal"].as_str().unwrap_or(""), "boards": boards}) + let mut out = json!({"goal": card["goal"].as_str().unwrap_or(""), "boards": boards}); + let lead = card["lead_days"].as_u64().unwrap_or(0); + if lead > 0 { out["lead_days"] = json!(lead); } + if let Some(w) = card["estimate_warnings"].as_str().filter(|w| !w.is_empty()) { out["estimate_warnings"] = json!(w); } + out } // ---- viewers, files, browser (each the hub's own request, for the folder of the thread) ---- pub(super) async fn root_of(hub: &Arc, thread: &str) -> Result { diff --git a/native/host/src/data/tests.rs b/native/host/src/data/tests.rs index 062baad19d..b2d33ac024 100644 --- a/native/host/src/data/tests.rs +++ b/native/host/src/data/tests.rs @@ -684,6 +684,7 @@ impl RpcHandler for FakeStar { let r = ask(&mut ws, 9, "project.card", json!({"project":"p1"})).await; assert_eq!((r["ok"].as_bool(), &r["result"]["boards"]), (Some(true), &json!([])), "{r}"); let r = ask(&mut ws, 10, "project.card", json!({})).await; assert_eq!(r["ok"], false, "{r}"); assert_eq!(super::ext::project_card(&json!({"goal":"A gimbal node","board_files":["Nodes/A/A.kicad_pcb","B.kicad_pcb"]})), json!({"goal":"A gimbal node","boards":["A","B"]})); + assert_eq!(super::ext::project_card(&json!({"goal":"A gimbal node","board_files":["B.kicad_pcb"],"lead_days":9,"estimate_warnings":"thin board"})), json!({"goal":"A gimbal node","boards":["B"],"lead_days":9,"estimate_warnings":"thin board"})); let r = ask(&mut ws, 7, "threads.list", json!({"project":"p1"})).await; assert!(r["result"]["threads"].as_array().unwrap().iter().all(|t| t["status"].is_string()), "every thread says its dot's word: {r}"); } diff --git a/native/host/src/present/ready.rs b/native/host/src/present/ready.rs index 562883f698..910d25729b 100644 --- a/native/host/src/present/ready.rs +++ b/native/host/src/present/ready.rs @@ -39,11 +39,14 @@ pub fn keep(res: &Value) -> Option { let th = s(res, "thread"); if th.is_empty() || res.get("goal").is_none() { return None } let shown = !s(res, "intent").trim().is_empty() || res["parts"].as_array().map_or(0, Vec::len) + res["boards"].as_u64().unwrap_or(0) as usize > 0; let goal = s(res, "goal"); + let lead = res["lead_days"].as_u64().unwrap_or(0); Some(json!({"info": { format!("fab.line:{th}"): if goal.is_empty() { "No goal yet. Edit to say what this project is for." } else { goal }, format!("fab.intent:{th}"): s(res, "intent"), format!("fab.buy:{th}"): buy_label(res), format!("fab.shown:{th}"): if shown { "1" } else { "" }, format!("fab.boards:{th}"): boards_text(&res["board_files"]), format!("fab.board:{th}"): s(res, "board_default"), - format!("fab.ready:{th}"): ready_line(res), format!("fab.again:{th}"): if ordered(s(res, "order")) { "1" } else { "" }}})) + format!("fab.ready:{th}"): ready_line(res), format!("fab.again:{th}"): if ordered(s(res, "order")) { "1" } else { "" }, + format!("fab.lead:{th}"): if lead > 0 { lead.to_string() } else { String::new() }, + format!("fab.warn:{th}"): s(res, "estimate_warnings")}})) } /// Buy it in the thread's header (Fab.mini.tools): what the card can buy, with Ordering on, outside a buy thread. There is no bar above the composer: the person asked for it gone @@ -55,7 +58,15 @@ pub fn header(st: &State, thread: &str, session: &Value) -> Option { let (buy, line) = (info("fab.buy"), info("fab.ready")); if buy.is_empty() || st.settings.get(&format!("buy.{thread}")).map_or(false, |v| !v.is_empty()) { return None } let label = if info("fab.again") == "1" { "Buy again".to_string() } else { buy }; - Some(json!({"icon": "shopping-cart", "label": label, "tip": if line.is_empty() { "Ready to order".to_string() } else { line }, "action": "fab-buy", "value": "", "on": false, "danger": false})) + let lead = info("fab.lead").parse::().unwrap_or(0); + let warn = info("fab.warn"); + let mut tip = if line.is_empty() { "Ready to order".to_string() } else { line }; + if lead > 0 { tip.push_str(&format!(" · Est. {} {}", lead, if lead == 1 { "day" } else { "days" })); } + if !warn.is_empty() { tip.push_str(&format!("\nWarning: {warn}")); } + let mut b = json!({"icon": "shopping-cart", "label": label, "tip": tip, "action": "fab-buy", "value": "", "on": false, "danger": false}); + if lead > 0 { b["lead_days"] = json!(lead); } + if !warn.is_empty() { b["estimate_warnings"] = json!(warn); } + Some(b) } /// The thread a project's page buys from: the project's latest thread that is not a buy thread (an archived one only when there is no other). @@ -115,4 +126,16 @@ mod tests { let mut c = card(&["A"], "from $5", ""); c["order"] = json!("shipped"); crate::session::patch::merge(&mut sess, &keep(&c).unwrap()); let b = header(&st, "t1", &sess).unwrap(); assert_eq!((b["label"].as_str(), b["tip"].as_str()), (Some("Buy again"), Some("Ordered · shipped"))); } + #[test] fn header_and_page_button_forward_lead_days_and_warnings() { + let mut st = State::default(); project(&mut st); let mut sess = json!({"info": {}}); + let mut c = card(&["A"], "from $5", ""); c["lead_days"] = json!(7); c["estimate_warnings"] = json!("thin board"); + crate::session::patch::merge(&mut sess, &keep(&c).unwrap()); + let b = header(&st, "t1", &sess).unwrap(); + assert_eq!(b["lead_days"], 7); + assert_eq!(b["estimate_warnings"], "thin board"); + assert_eq!(b["tip"], "Ready to order · A · Est. 7 days\nWarning: thin board"); + let pb = page_button(&st, "t1", &c).unwrap(); + assert_eq!(pb["lead_days"], 7); + assert_eq!(pb["estimate_warnings"], "thin board"); + } } diff --git a/native/host/src/present/sections.rs b/native/host/src/present/sections.rs index 9fb39d1db8..e006f66206 100644 --- a/native/host/src/present/sections.rs +++ b/native/host/src/present/sections.rs @@ -109,7 +109,8 @@ fn mark_of(p: &MergedProject, machine: &str) -> Value { fn qid(hub: &str, id: &str) -> String { if hub.is_empty() { id.to_string() } else { format!("{hub}|{id}") } } fn thread_row(hub: &str, now: u64, p: &MergedProject, f: &Th) -> Value { let t = f.t; let off = t.src.is_none(); - json!({"id":qid(hub,&t.id),"title":if t.title.is_empty() { "New thread" } else { t.title.as_str() },"word":f.word,"say":say(f.word),"want":want(t,f.word), + let provider = t.src.and_then(|s| s.threads.get(&t.id)).map_or("", |x| x.provider.as_str()); + json!({"id":qid(hub,&t.id),"title":if t.title.is_empty() { "New thread" } else { t.title.as_str() },"provider":provider,"word":f.word,"say":say(f.word),"want":want(t,f.word), "status":dot_word(f.word),"state":turn_word(f.word),"depth":0,"children":0,"expanded":false,"agents":"", "ago":crate::sidebar::ago(now,t.activity),"activity":t.activity,"pinned":t.pinned,"machine":t.machine,"mark":mark_of(p,&t.machine), "project":p.name,"projectKey":p.key,"off":off,"nav":if off { String::new() } else { qid(hub,&t.id) }, @@ -538,7 +539,7 @@ pub fn build(st: &State, rows: &[MergedProject], bub: &Value, c: &Ctx) -> Value let mt = MergedThread { machine: machine.clone(), id: id.clone(), title: t.title.clone(), activity: t.activity, pinned: t.pinned, archived: t.archived, src: Some(s), status: String::new() }; let w = want(&mt, "needs"); let mark = if machine.is_empty() { Value::Null } else { crate::mirror::mark_of(&machine, false) }; - needs.push((if w == "approval" { 0 } else { 1 }, t.activity, json!({"id":qid(c.hub,id),"title":t.title,"word":"needs","say":say("needs"),"want":w,"status":"blocked","state":"idle","depth":0,"children":0,"expanded":false,"agents":"", + needs.push((if w == "approval" { 0 } else { 1 }, t.activity, json!({"id":qid(c.hub,id),"title":t.title,"provider":t.provider,"word":"needs","say":say("needs"),"want":w,"status":"blocked","state":"idle","depth":0,"children":0,"expanded":false,"agents":"", "ago":crate::sidebar::ago(c.now,t.activity),"activity":t.activity,"pinned":t.pinned,"machine":machine,"mark":mark,"project":place,"projectKey":"","off":false,"nav":qid(c.hub,id)}))); } } } needs.sort_by(|a, b| a.0.cmp(&b.0).then(b.1.cmp(&a.1))); diff --git a/native/host/src/settings/order.rs b/native/host/src/settings/order.rs index b731c3c6d6..804a4c03a7 100644 --- a/native/host/src/settings/order.rs +++ b/native/host/src/settings/order.rs @@ -548,8 +548,14 @@ mod tests { let c = card("L", false, false, true, false, ""); assert_eq!(c["line"], "Getting your quote… usually 1-2 min"); assert_eq!(c["waiting"], true); let r = Rec { id: "q_card".into(), token: "tok".into(), thread: "t".into(), server: "http://s".into(), boards: false }; PAY.write().unwrap().insert(r.id.clone(), pay_of(&r.server, &r.id, &r.token)); let mut q = ready(false); q["id"] = json!("q_card"); let s = sum(&q); assert!(!s.contains("tok"), "the setting holds no token"); + let sv: Value = serde_json::from_str(&s).unwrap(); assert_eq!((sv["lead_days"].clone(), sv["estimate_warnings"].clone()), (json!(9), json!("w"))); let c = card("L", false, false, false, false, &s); assert_eq!(marks(&c), "done,done,done,on,,"); assert_eq!((c["total"].as_str(), c["pay"].as_str(), c["label"].as_str()), (Some("$112.40"), Some("http://s/q/q_card?t=tok"), Some("Buy now · $112.40"))); + assert_eq!((c["lead_days"].clone(), c["estimate_warnings"].clone()), (json!(9), json!("w"))); assert_eq!(c["customs"], "Includes import VAT and duties: nothing to pay on delivery."); + let mut plain_q = ready(false); plain_q["id"] = json!("q_card"); plain_q["quote"]["lead_days"] = json!(0); plain_q["quote"]["warnings"] = json!([]); + let cp = card("L", false, false, false, false, &sum(&plain_q)); + assert!(cp.get("lead_days").is_none() && cp.get("estimate_warnings").is_none()); + assert!(card("L", false, false, false, false, "").get("lead_days").is_none()); let mut bad = ready(false); bad["id"] = json!("q_card"); bad["quote"]["problems"] = json!(["No price for Mars"]); assert_eq!(card("L", false, false, false, false, &sum(&bad))["line"], "The quote has something to fix first: see it above.", "the posted quote is above the card, on every client"); q["order"] = json!({"status":"placed"}); let c = card("L", false, false, false, false, &sum(&q)); assert_eq!(marks(&c), "done,done,done,done,on,"); assert_eq!(c["pay"], "", "paid: no Buy now"); assert_eq!(c["line"], "Ordered: your order is in production."); diff --git a/native/host/src/settings/order_view.rs b/native/host/src/settings/order_view.rs index 4c0ef52030..475e4abb3f 100644 --- a/native/host/src/settings/order_view.rs +++ b/native/host/src/settings/order_view.rs @@ -104,10 +104,18 @@ pub fn total_of(label: &str, raw: &Value) -> String { if let Some(t) = label.strip_prefix("Buy now · ") { return t.to_string() } match raw { Value::Null => String::new(), Value::String(s) if s.is_empty() => String::new(), Value::String(s) => format!("${s}"), v => format!("${v}") } } +fn warnings_text(v: &Value) -> String { + let mut out: Vec = vec![]; + for w in v.as_array().into_iter().flatten().filter_map(Value::as_str).map(str::trim).filter(|w| !w.is_empty()) { + if !out.iter().any(|x| x == w) { out.push(w.to_string()) } + } + out.join("; ") +} /// Order.sum: what the hub keeps of a quote for the card (the setting `order.quote.`), without its link: `pay_link` finds that by the id. pub fn sum(q: &Value) -> String { let label = sv(&q["quote"], "pay_label"); - json!({"id":sv(q, "id"),"state":state(q),"total":total_of(label, &q["quote"]["total"]),"ddp":ddp(q),"payable":payable(q),"unavailable":unavailable(q),"label":if label.is_empty() { "Buy now" } else { label },"tracking":sv(&q["order"], "tracking")}).to_string() + json!({"id":sv(q, "id"),"state":state(q),"total":total_of(label, &q["quote"]["total"]),"ddp":ddp(q),"payable":payable(q),"unavailable":unavailable(q),"label":if label.is_empty() { "Buy now" } else { label },"tracking":sv(&q["order"], "tracking"), + "lead_days":q["quote"]["lead_days"].as_u64().unwrap_or(0),"estimate_warnings":warnings_text(&q["quote"]["warnings"])}).to_string() } /// Order.sum.keeps: a newer quote always takes the card; a quote's own progress only while it is the card's. pub fn sum_keeps(fresh: bool, cur: &str, id: &str) -> bool { fresh || cur.is_empty() || serde_json::from_str::(cur).map_or(false, |v| sv(&v, "id") == id) } @@ -133,9 +141,13 @@ pub fn card(name: &str, asked: bool, files: bool, waiting: bool, running: bool, let line = if asked { "Backplane needs your answer below.".to_string() } else { match i { 0 => if running { "Getting the order ready…".into() } else { "Reply below to go on.".into() }, 1 => "Check the files below and send them for a quote.".into(), 2 => "Getting your quote… usually 1-2 min".into(), _ => card_said(st, pay, tracking, q["unavailable"].as_bool().unwrap_or(false)) } }; let buys = i == 3 && pay && matches!(st, "ready" | "quoted"); let (shown, total) = (i >= 3, sv(&q, "total")); + let lead_days = q["lead_days"].as_u64().unwrap_or(0); + let warns = { let w = sv(&q, "estimate_warnings"); if w.is_empty() { warnings_text(&q["warnings"]) } else { w.to_string() } }; let mut o = json!({"name":name,"steps":STEPS.iter().enumerate().map(|(k, l)| json!({"label":l,"mark":if k < i { "done" } else if k == i { "on" } else { "" }})).collect::>(), "line":line,"waiting":i == 2,"total":if shown { total } else { "" },"customs":if shown && !total.is_empty() { customs(q["ddp"].as_bool().unwrap_or(false)) } else { "" }, "pay":if buys { pay_link(sv(&q, "id")).unwrap_or_default() } else { String::new() },"label":if buys { let l = sv(&q, "label"); if l.is_empty() { "Buy now" } else { l } } else { "" }}); + if shown && lead_days > 0 { o["lead_days"] = json!(lead_days); } + if shown && !warns.is_empty() { o["estimate_warnings"] = json!(warns); } if i == 3 && q["unavailable"].as_bool().unwrap_or(false) && matches!(st, "ready" | "quoted") { o["requote"] = json!(true) } o } diff --git a/scripts/mobile/ios-unit-tests.sh b/scripts/mobile/ios-unit-tests.sh index c6c4a570d0..91bd10c366 100755 --- a/scripts/mobile/ios-unit-tests.sh +++ b/scripts/mobile/ios-unit-tests.sh @@ -23,6 +23,7 @@ run() { # name, args for the test, then the app sources run hub-list HubListTests.swift "$ROOT/test/mobile/hubs_cases.json" HubList.swift run thread-groups ThreadGroupsTests.swift "" ThreadGroups.swift run badge-symbols BadgeSymbolsTests.swift "$ROOT/native/host/src/present/badge.rs" BadgeSymbols.swift +run provider-mark ProviderMarkTests.swift "" ProviderMark.swift run thread-find ThreadFindTests.swift "" ThreadFind.swift run voice-edit VoiceEditTests.swift "$ROOT/test/fixtures/voice-edits.json" VoiceEdit.swift run plot-parts PlotPartsTests.swift "" Plot.swift PlotParts.swift diff --git a/test/e2e/ios/UITests/JourneyTests.swift b/test/e2e/ios/UITests/JourneyTests.swift index 2e9b40eb77..ca297dd3ee 100644 --- a/test/e2e/ios/UITests/JourneyTests.swift +++ b/test/e2e/ios/UITests/JourneyTests.swift @@ -553,7 +553,8 @@ final class Journeys: XCTestCase { func test_ring() { d = Driver("ring"); defer { d.finish() } d.launch() - guard d.step("Settings", act: { d.tap(d.el("data.settings")) }, expect: { d.el("data.settings").exists == false || d.label("Ring").exists }) else { return } + guard d.step("Settings", act: { d.tap(d.el("data.settings")) }, expect: { d.el("settings.ring").exists }) else { return } + guard d.step("Ring settings", act: { d.tap(d.el("settings.ring")) }, expect: { d.label("Ring").exists }) else { return } func on(_ e: XCUIElement) { var n = 0; while n < 16 && !(e.exists && e.isHittable) { d.app.swipeUp(velocity: .slow); n += 1 } } func btn(_ action: String, _ label: String) -> XCUIElement { d.app.buttons.matching(NSPredicate(format: "identifier == %@ AND label == %@", "ring.page." + action, label)).firstMatch } let setUp = btn("ring-op", "Set up")