diff options
Diffstat (limited to 'docs/superpowers/specs')
| -rw-r--r-- | docs/superpowers/specs/2026-11-10-assistant-design.md | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/docs/superpowers/specs/2026-11-10-assistant-design.md b/docs/superpowers/specs/2026-11-10-assistant-design.md index 2c26188..1e22ef3 100644 --- a/docs/superpowers/specs/2026-11-10-assistant-design.md +++ b/docs/superpowers/specs/2026-11-10-assistant-design.md @@ -27,13 +27,12 @@ for a finger: icon buttons, no text buttons. - **`assistant catalog` IPC call** (an `IpcHandler` function returning a string). One JSON object: - `presets`: the list in use, `Presets.list(Prefs.presets)`; - - `ops`: Ops.js's list (label, icon, op, kinds, min, max, format) and the - compress formats; + - `ops`: Ops.js's list (label, icon, op, kinds, min, max, format), with + the Compress submenu's formats as ops of their own, of kind `any`; - `kinds`: kind → file extensions, from Files.js; - `fileops`: the absolute path of `assistant/fileops`; - `outDir`, `mdPrompt`: what the canvas uses for Do ops and To .md; - - `preferred`: `Prefs.assistantModel`, "" for none; - - `routerRoot`: the router's root URL (AssistantModule's `routerRoot`). + - `preferred`: `Prefs.assistantModel`, "" for none. - **Preset prompts are sent as written.** `Presets.prompt` today appends "Answer in the language of the document."; that sentence moves into the default prompts' own text and `prompt()` returns `p.prompt` unchanged, so @@ -49,8 +48,9 @@ for a finger: icon buttons, no text buttons. - reconnects every 5s while the daemon is down, as the OBS module does; - reads the catalog with `qs -p <desktop> ipc call assistant catalog` at start and on each pick, so edits on keystone's presets page apply; - - reads `<routerRoot>/models` (urllib) when the model list is refreshed, - for each local model's `architecture.input_modalities`. + - each local model's audio support comes with the daemon's `models` + event: desktop-assistant reports `inputs` (the router's + `architecture.input_modalities`) per local model. - **`static/modules/assistant.js`**: the tab (`tab: "Assistant"`, wrapper class `.assistant`), polling every 0.5s; the state is in memory, so a poll costs the PC nothing. @@ -71,7 +71,7 @@ The client sends text, ids and labels; never a path or a command. | --- | --- | --- | | `ask` | `text` | daemon `ask`, with `model` when one is wanted | | `stop`, `new` | — | the daemon commands | -| `models` | — | daemon `models` plus the router's inputs | +| `models` | — | daemon `models`, local items with `inputs` | | `model` | `id` | the chat's pick; must be in the last model list | | `voice` | raw WAV (upload) | writes `$XDG_RUNTIME_DIR/deck-it/voice.wav`, then `ask` with `text: ""`, `audio` and `model` | | `pick` | `preset` or `op` label | qarma on the PC, then the preset or op | @@ -87,9 +87,9 @@ that provider. ### Voice -The tablet records with `getUserMedia` and an AudioWorklet, downsamples to -16 kHz mono and encodes a 16-bit WAV in JS (stdlib only, ~40 lines), up to -59 s. A recording under 0.5 s is dropped. The mic is greyed out when the +The tablet records with `MediaRecorder`, decodes the clip with +`decodeAudioData`, resamples it to 16 kHz mono with an +`OfflineAudioContext` and encodes a 16-bit WAV in JS, up to 59 s. A recording under 0.5 s is dropped. The mic is greyed out when the model that will hear it takes no audio: the chat's pick if it is local, else the loaded local model (a cloud chat's voice is still transcribed locally). Unknown inputs count as yes; the daemon's error covers the rest. @@ -98,8 +98,8 @@ locally). Unknown inputs count as yes; the daemon's error covers the rest. 1. The label must be in the current catalog, else 400. 2. `qarma --file-selection` opens on the PC with a `--file-filter` built - from the action's kinds, and `--multiple` for an op with `min >= 2` or a - `many` preset. It runs on a thread; state is `picking` until it returns. + from the action's kinds, and `--multiple` unless the op has `max: 1`; an + op's `min` is checked after the pick. It runs on a thread; state is `picking` until it returns. One picker at a time; a second `pick` is refused. 3. Cancel or a closed dialog: back to idle. 4. A preset sends `ask` with `files` and the preset's prompt; the reply @@ -122,7 +122,7 @@ glyphs the canvas uses. replaced by "Choose the file on the PC" and a cancel icon. - **Transcript:** questions and replies, Markdown rendered by `marked`; a status line for thinking and running tools. A code block gets a copy - icon once its fence closes. + icon once its turn is finished. - **Input bar:** text field, then mic (toggle, with a running timer while recording), then send, which becomes stop while a reply streams. - **Model panel** slides over the transcript and close on a |
