somora 2026.1008.10 → 2026.1012.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +33 -18
  2. package/config.example.yaml +33 -0
  3. package/docs/api.md +139 -35
  4. package/docs/browser.md +2 -2
  5. package/docs/cache-strategy.md +1 -1
  6. package/docs/display.md +1 -0
  7. package/docs/dream-phases.md +10 -2
  8. package/docs/imagegen.md +90 -6
  9. package/docs/images/somora-mobile-2026-10-12.png +0 -0
  10. package/docs/images/somora-tui-2026-10-12.png +0 -0
  11. package/docs/images/somora-web-dark-2026-10-12.png +0 -0
  12. package/docs/images/somora-web-light-2026-10-12.png +0 -0
  13. package/docs/mcp.md +4 -4
  14. package/docs/memory.md +4 -4
  15. package/docs/mobile.md +46 -12
  16. package/docs/realtime-voice.md +1 -1
  17. package/docs/security.md +151 -22
  18. package/docs/setup.md +41 -14
  19. package/docs/tmux.md +4 -2
  20. package/docs/tools.md +4 -4
  21. package/docs/videogen.md +261 -33
  22. package/docs/web.md +69 -16
  23. package/docs/wiki.md +2 -0
  24. package/package.json +3 -1
  25. package/src/browser/policy.ts +62 -16
  26. package/src/cli/key.ts +162 -0
  27. package/src/cli/server-call.ts +2 -0
  28. package/src/cli/setup.ts +13 -0
  29. package/src/cli/somora.ts +24 -18
  30. package/src/cli/tui/app.tsx +2 -1
  31. package/src/cli/update-args.ts +33 -6
  32. package/src/cli/wiki.ts +2 -1
  33. package/src/config/types.ts +169 -3
  34. package/src/dream/deep-llm.ts +11 -1
  35. package/src/dream/deep-runner.ts +1 -1
  36. package/src/imagegen/generate.ts +327 -76
  37. package/src/imagegen/references.ts +2 -2
  38. package/src/imagegen/types.ts +51 -0
  39. package/src/media/capabilities.ts +153 -12
  40. package/src/server/auth-key.ts +211 -0
  41. package/src/server/browser-guard.ts +140 -0
  42. package/src/server/inbox-sources.ts +285 -0
  43. package/src/server/inbox.ts +260 -0
  44. package/src/server/index.ts +241 -42
  45. package/src/server/logger.ts +40 -3
  46. package/src/server/loopback-fetch.ts +17 -4
  47. package/src/tools/exec/internal-env.ts +4 -0
  48. package/src/tools/video/tools.ts +144 -32
  49. package/src/tools/web/fetch.ts +100 -65
  50. package/src/videogen/dialects.ts +1 -1
  51. package/src/videogen/frame.ts +71 -0
  52. package/src/videogen/generate.ts +116 -41
  53. package/src/videogen/media.ts +550 -0
  54. package/src/videogen/request.ts +95 -0
  55. package/src/videogen/runner.ts +4 -2
  56. package/web/dist/assets/{index-CQYoTOJB.js → index-B29CLSq3.js} +40 -40
  57. package/web/dist/assets/{index-CQYoTOJB.js.map → index-B29CLSq3.js.map} +1 -1
  58. package/web/dist/assets/index-Ca4V4IrW.css +1 -0
  59. package/web/dist/favicon-48.png +0 -0
  60. package/web/dist/favicon.ico +0 -0
  61. package/web/dist/index.html +2 -3
  62. package/web-mobile/dist/assets/{index-3_sWEIih.js → index-CThedP51.js} +20 -20
  63. package/web-mobile/dist/assets/{index-3_sWEIih.js.map → index-CThedP51.js.map} +1 -1
  64. package/web-mobile/dist/assets/{index-Y6fhA0_3.css → index-Cl_8jQ12.css} +1 -1
  65. package/web-mobile/dist/favicon-48.png +0 -0
  66. package/web-mobile/dist/favicon.ico +0 -0
  67. package/web-mobile/dist/index.html +2 -3
  68. package/web-mobile/dist/service-worker.js +1 -1
  69. package/docs/images/somora-mobile-2026-05-23.png +0 -0
  70. package/docs/images/somora-tui-2026-05-23.png +0 -0
  71. package/docs/images/somora-web-2026-05-23.png +0 -0
  72. package/web/dist/assets/index-EeNggYDu.css +0 -1
package/README.md CHANGED
@@ -39,25 +39,28 @@ models, your first agent, memory and HTTPS — details under
39
39
  | | |
40
40
  |---|---|
41
41
  | **One line** (recommended) | `curl -fsSL https://somora.ai/install.sh \| bash` |
42
- | **npm** — you already have Node ≥22.22.2 | `npm install -g somora && somora setup` |
43
- | **From source** — you want to work on somora itself | [docs/setup.md → Develop from a checkout](docs/setup.md#develop-from-a-checkout-contributors) |
42
+ | **npm** — you already have Node ≥22.22.2 | [docs/setup.md → Install by hand](docs/setup.md#install-by-hand) (npm 12 needs one extra flag) |
43
+ | **From source** — you want to work on somora itself | [docs/setup.md → Develop from a checkout](docs/setup.md#develop-from-a-checkout) |
44
44
 
45
45
  ## See it
46
46
 
47
- ![somora web screenshot — browser desktop with multi-window chat, agent dock, and tmux app](docs/images/somora-web-2026-05-23.png)
47
+ <picture>
48
+ <source media="(prefers-color-scheme: light)" srcset="docs/images/somora-web-light-2026-10-12.png" />
49
+ <img src="docs/images/somora-web-dark-2026-10-12.png" alt="somora web client: browser desktop with agent windows, two tmux terminals, the agent's browser, a builder plan and the taskbar" />
50
+ </picture>
48
51
 
49
52
  <table>
50
53
  <tr>
51
54
  <td width="66%" valign="top">
52
- <img src="docs/images/somora-tui-2026-05-23.png" alt="somora TUI screenshot — terminal multi-agent chat with memory injection and tool calls" />
55
+ <img src="docs/images/somora-tui-2026-10-12.png" alt="somora TUI: the terminal client with its status line" />
53
56
  </td>
54
57
  <td width="34%" valign="top">
55
- <img src="docs/images/somora-mobile-2026-05-23.png" alt="somora mobile PWA screenshot — avatar row at the top, A2A reply from one agent quoting two others, paperclip + camera + mic + send input bar at the bottom" />
58
+ <img src="docs/images/somora-mobile-2026-10-12.png" alt="somora mobile app: avatar row at the top, an agent's reply, attachment, microphone and send at the bottom" />
56
59
  </td>
57
60
  </tr>
58
61
  </table>
59
62
 
60
- Browser desktop, terminal, and installable phone app — all talking to the
63
+ Browser desktop (dark or light), terminal, and installable phone app — all talking to the
61
64
  same local server, the same agents, the same memory.
62
65
 
63
66
  ## Why somora
@@ -182,7 +185,7 @@ somora makes one request of its own: once a day it asks somora.ai
182
185
  whether a newer version exists (version, OS, Node version and CPU in the
183
186
  User-Agent, nothing else; somora.ai counts installations from its
184
187
  server log). `DO_NOT_TRACK=1` or `updateCheck.enabled: false` switches it
185
- off — [docs/setup.md → The daily update check](docs/setup.md#the-daily-update-check--what-somoraai-sees).
188
+ off — [docs/setup.md → The daily update check](docs/setup.md#the-daily-update-check).
186
189
 
187
190
  [docs/setup.md](docs/setup.md) is the full install walkthrough,
188
191
  [docs/models.md](docs/models.md) lists the models known to run with somora
@@ -216,7 +219,8 @@ to run again — as a whole or one step (`somora setup access`). Update
216
219
  later with `somora update`.
217
220
 
218
221
  Already have Node ≥22.22.2 and the tools from [Requirements](#requirements)?
219
- Then it is two commands: `npm install -g somora && somora setup`.
222
+ Then follow [Install by hand](docs/setup.md#install-by-hand): one npm
223
+ command, then `somora setup`.
220
224
 
221
225
  ### Already using a coding agent? Let it set up somora.
222
226
 
@@ -266,11 +270,12 @@ configuration options that the docs don't describe.
266
270
 
267
271
  ```bash
268
272
  # 1. Prereqs (see docs/setup.md for details per OS)
269
- sudo apt install tmux ripgrep build-essential # Debian/Ubuntu
270
- # brew install tmux ripgrep # macOS (plus Xcode command line tools)
273
+ sudo apt install tmux ripgrep git build-essential python3 # Debian/Ubuntu
274
+ # brew install tmux ripgrep git # macOS (plus Xcode command line tools)
271
275
 
272
- # 2. Install somora
273
- npm install -g somora
276
+ # 2. Install somora (npm older than 11.16: leave out the --allow-scripts line)
277
+ ONNXRUNTIME_NODE_INSTALL=skip npm install -g somora \
278
+ --allow-scripts=cpu-features,esbuild,fsevents,node-pty,onnxruntime-node,protobufjs,somora,ssh2
274
279
 
275
280
  # 3. Log in to at least one LLM backend (pick one or more)
276
281
  somora auth login # Claude subscription; Claude Code is bundled
@@ -281,8 +286,9 @@ somora grok login # SuperGrok or Premium subscription; t
281
286
 
282
287
  # 4. First-run setup + start
283
288
  somora init # creates ~/.somora/ and registers the background service
284
- somora server start # starts it (and from then on at boot / login)
285
- somora tui # the default agent is created on first run
289
+ somora server start # starts it (and from then on at boot / login); the default agent is created on first start
290
+ somora tui # chat in the terminal
291
+ somora key link # sign the web client in (link + QR code for the phone)
286
292
  ```
287
293
 
288
294
  Once you have more than one agent, `somora team init --principal "<your
@@ -290,7 +296,7 @@ name>"` writes `~/.somora/team.yaml` so every agent knows who is who — or
290
296
  arrange it in the **team** tile of the web client
291
297
  ([docs/team.md](docs/team.md)). The web client, providers and Tailscale
292
298
  HTTPS are in [docs/setup.md](docs/setup.md); hacking on somora itself in
293
- its [contributor section](docs/setup.md#develop-from-a-checkout-contributors).
299
+ its [contributor section](docs/setup.md#develop-from-a-checkout).
294
300
 
295
301
  ## Status
296
302
 
@@ -362,10 +368,11 @@ Three first-party clients, all hitting the same local server:
362
368
  | Client | Launch | What you get |
363
369
  |---|---|---|
364
370
  | **TUI** | `somora tui` | Terminal multi-agent chat with full keyboard control, the session's queue (`/queue`), memory and tool detail toggles. |
365
- | **Web** | `https://<host>.<tailnet>.ts.net:18737/web/` | A browser desktop: one window per agent, drag-and-drop attachments and screenshots, tmux app and shell terminal, Wiki Explorer with link graph, Media gallery, Sessions browser, the agent's Chromium window, server log, Abilities matrix (which tools and skills each agent may use), Team and Agent windows, a queue badge per session (what runs, what waits, what is arriving — take back or stop from there), dictation and spoken replies, and a voice window for a live call. HTTPS required; LAN-trust, no auth. [docs/web.md](docs/web.md) |
366
- | **Mobile (PWA)** | `…:18737/mobile/`, then "Add to Home Screen" | The phone app: avatar row to switch agent, a sheet in the header to switch session and model or restore an archived session, the same queue sheet, voice input and spoken replies, photo/PDF attachments via the native picker. [docs/mobile.md](docs/mobile.md) |
371
+ | **Web** | `https://<host>.<tailnet>.ts.net:18737/web/` | A browser desktop: one window per agent, drag-and-drop attachments and screenshots, tmux app and shell terminal, Wiki Explorer with link graph, Media gallery, Sessions browser, the agent's Chromium window, server log, an inbox for updates and things that need you, a light or dark theme, Abilities matrix (which tools and skills each agent may use), Team and Agent windows, a queue badge per session (what runs, what waits, what is arriving — take back or stop from there), dictation and spoken replies, and a voice window for a live call. HTTPS required; sign in once with the server's key (`somora key link`). [docs/web.md](docs/web.md) |
372
+ | **Mobile (PWA)** | `…:18737/mobile/`, then "Add to Home Screen" | The phone app: avatar row to switch agent, a sheet in the header to switch session and model or restore an archived session, the same queue sheet with steering, the thinking level per session, voice input and spoken replies, photo/PDF attachments via the native picker. Signs in once by scanning the QR code from `somora key link`. [docs/mobile.md](docs/mobile.md) |
367
373
 
368
- Anything else can talk to the server the same way the clients do:
374
+ Anything else can talk to the server the same way the clients do, with
375
+ the server's key in an `Authorization: Bearer` header:
369
376
  [docs/api.md](docs/api.md) is the HTTP + SSE + WebSocket reference.
370
377
 
371
378
  ## Documentation
@@ -380,6 +387,14 @@ and searchable: [docs.somora.ai](https://docs.somora.ai).
380
387
  - **Clients and API:** [web](docs/web.md) · [mobile](docs/mobile.md) · [TUI display](docs/display.md) · [voice](docs/voice.md) · [realtime voice](docs/realtime-voice.md) · [API](docs/api.md)
381
388
  - **Models in detail:** [thinking](docs/thinking.md) · [sampling](docs/sampling.md)
382
389
 
390
+ ## Contributing
391
+
392
+ Contributions are welcome. [CONTRIBUTING.md](CONTRIBUTING.md) says how to
393
+ report bugs, propose ideas and send pull requests. Security problems are
394
+ reported privately: [SECURITY.md](.github/SECURITY.md). What changed in
395
+ each version is in the
396
+ [release notes](https://github.com/thenaxon/somora_agent/releases).
397
+
383
398
  ## License
384
399
 
385
400
  [MIT](LICENSE).
@@ -35,6 +35,17 @@ server:
35
35
  # all — also every other turn the restart cut
36
36
  # off — nobody; cut turns are only marked
37
37
  # resumeAfterRestart: requested
38
+ # A browser request is only taken when it was sent to one of this
39
+ # machine's names (IP addresses, localhost, the host name, *.ts.net,
40
+ # tls.publicHost) — so a website you have open cannot use somora. Add
41
+ # a DNS name of your own you open somora under. Programs that are not
42
+ # browsers are never checked.
43
+ # allowedHosts: [somora.home.lan]
44
+ # The login key (~/.somora/server.key, made by `somora init` or the first start; `somora key`
45
+ # prints it). on: every request needs it — programs send
46
+ # "Authorization: Bearer <key>", a browser signs in once
47
+ # (`somora key link`). off: no key, the network alone decides.
48
+ # auth: on
38
49
  # HTTPS (HTTP/2). `somora setup access` writes this block for Tailscale;
39
50
  # by hand see docs/setup.md → HTTPS. `renew: tailscale` lets the server
40
51
  # renew the certificate itself and load it without a restart.
@@ -344,6 +355,7 @@ providers:
344
355
  # monthlyFolders: false # true → <outputDir>/2026-08/
345
356
  # maxImagesPerTurn: 5 # cost brake per turn
346
357
  # timeoutMs: 300000 # image models are slow; 5 min
358
+ # jobTimeoutMs: 900000 # one image JOB (lifecycle: jobs); 15 min
347
359
  # models:
348
360
  # - name: grok-imagine # handle used by tool + UI
349
361
  # provider: openrouter # ← references providers.openrouter
@@ -360,6 +372,11 @@ providers:
360
372
  # # # once per process: restart after
361
373
  # # # adding a model there.
362
374
  # # # null = no catalog (local server)
375
+ # # lifecycle: jobs # sync = one request; jobs = create →
376
+ # # jobs: # status → content, survives a proxy
377
+ # # create: /img/create # that closes long requests. Unset:
378
+ # # status: /img/status?id= # the catalog's `async` block decides,
379
+ # # content: /img/content?id= # else sync. {id} or appended.
363
380
  # defaults: # applied when the caller omits them
364
381
  # resolution: 1K
365
382
  # aspect_ratio: "16:9"
@@ -452,6 +469,18 @@ providers:
452
469
  # variants: [video, thumbnail] # thumbnail → gallery preview,
453
470
  # maxReferences: 1 # and analyze_file can read it
454
471
  #
472
+ # # Input files by meaning (docs/videogen.md, "Input files"). Without
473
+ # # a catalog that publishes accepted_media, name the provider's field
474
+ # # per type; this list is then the model's complete set of inputs.
475
+ # - name: animate
476
+ # provider: local-video
477
+ # model: wan-animate-replace
478
+ # wire: passthrough
479
+ # transport: json # files as data: URIs in JSON
480
+ # media:
481
+ # input_video: { field: video_url, min: 1, max: 1, maxSeconds: 30 }
482
+ # character_image: { field: image_url, min: 1, max: 1 }
483
+ #
455
484
  # # ⚠ NOT YET VERIFIED against a live endpoint — somora has had no
456
485
  # # Vertex access to test with. The dialect is written from Google's
457
486
  # # published shape (operation name instead of a job id, POST to poll,
@@ -805,6 +834,7 @@ providers:
805
834
  # intervalHours: 12
806
835
  # model: opus # worker model ref (alias or provider/model)
807
836
  # fallback: [gpt56] # backup(s) when `model` is unreachable — best on another provider
837
+ # callTimeoutMs: 300000 # one model call (one note); past it the note goes to the backup
808
838
  # lucid:
809
839
  # enabled: true
810
840
  # intervalDays: 7
@@ -864,6 +894,9 @@ providers:
864
894
  # web:
865
895
  # brave:
866
896
  # apiKey: "BSAxxx..."
897
+ # # Internal hosts web_fetch may read (host, *.suffix, IP or IPv4 CIDR);
898
+ # # everything private is refused otherwise.
899
+ # fetchAllowPrivate: [wiki.home.lan, 10.0.0.0/24]
867
900
 
868
901
  # Sentinel — proactive trigger runtime (time-based fires that wake
869
902
  # agents on a schedule, see docs/sentinel.md). Only knob today is how
package/docs/api.md CHANGED
@@ -15,8 +15,8 @@ every stream event, so you can write your own client from it.
15
15
  level, project, unread state.
16
16
  - **The machinery behind the agents**: memory search, wiki, dream
17
17
  phases, triggers, browser, media, voice.
18
- - **No login to implement.** Whoever reaches the port may use it. Read
19
- "Access model" before you open that port to anyone.
18
+ - **One key.** Send the server's key with every request. "Access
19
+ model" says how.
20
20
 
21
21
  ## First request
22
22
 
@@ -25,15 +25,16 @@ The reply arrives on the stream.
25
25
 
26
26
  ```bash
27
27
  BASE=https://<your-host>:18737
28
+ KEY=$(somora key) # on the server; elsewhere paste the key
28
29
 
29
30
  # 1. Who is there?
30
- curl $BASE/agents
31
+ curl -H "Authorization: Bearer $KEY" $BASE/agents
31
32
 
32
33
  # 2. Follow the session (keep this running)
33
- curl -N "$BASE/chat/stream?agent=<your-agent>&session=main" &
34
+ curl -H "Authorization: Bearer $KEY" -N "$BASE/chat/stream?agent=<your-agent>&session=main" &
34
35
 
35
36
  # 3. Send a message
36
- curl -X POST $BASE/chat/send \
37
+ curl -H "Authorization: Bearer $KEY" -X POST $BASE/chat/send \
37
38
  -H 'Content-Type: application/json' \
38
39
  -d '{"agent":"<your-agent>","session":"main","text":"What is on today?"}'
39
40
  # → 202 { "ok": true, "turnId": "…" }
@@ -91,18 +92,78 @@ streams where they cover what you need.
91
92
 
92
93
  ## Access model
93
94
 
94
- There is no API key, no login and no per-route permission. The server
95
- trusts every request that reaches it. Access is decided by the network:
96
- bind to `127.0.0.1`, or to a private network such as a tailnet whose
97
- rules say who may connect.
95
+ The server has one key, in `~/.somora/server.key`. Every request needs
96
+ it, also from the same machine and over Tailscale. There are no user
97
+ accounts and no per-route permissions: the key opens everything.
98
98
 
99
- > **Warning:** Never expose the port to the public internet. Anyone who
100
- > reaches it can read all memory and sessions and act as any agent.
99
+ | Client | How it sends the key |
100
+ |---|---|
101
+ | A program | `Authorization: Bearer <key>`, or `X-Somora-Key: <key>` where a tool cannot set `Authorization`. |
102
+ | A browser | A cookie from `POST /auth/login`. It rides along on every request, stream and WebSocket. |
103
+ | A script an agent writes | `-H "Authorization: Bearer $(somora key)"`. The key is not in the shell's environment, so `env` does not show it, unless the command was started with `inherit_agent_env: true`. |
104
+
105
+ `somora key` prints the key on the server. Never put it in a URL query:
106
+ it would end up in logs and histories.
107
+
108
+ Without the key, or with a wrong one, the server answers `401`:
109
+
110
+ ```json
111
+ { "error": "somora needs its key. Programs: send \"Authorization: Bearer <key>\"; on the server \"somora key\" prints it …", "kind": "auth" }
112
+ ```
113
+
114
+ Ten wrong keys from one address within five minutes block that address
115
+ for a minute (`429`). Requests from the server's own machine are not
116
+ blocked. A request without any key does not count.
117
+
118
+ Open without the key: `GET /healthz`, the `/auth/*` routes below, and
119
+ the files of the web and mobile clients under `/web/` and `/mobile/`,
120
+ which hold no data.
121
+
122
+ With `server.auth: off` in `config.yaml` the server asks for no key.
123
+ Then access is decided by the network alone.
124
+
125
+ A browser request that another website makes in the background is
126
+ refused with `403` and a plain-text body, not JSON:
127
+ `refused: <reason>. …`. A browser that reaches somora under a name of
128
+ its own needs that name in `server.allowedHosts`. Programs that are not
129
+ browsers are never checked. The security page explains the rule.
130
+
131
+ > **Warning:** Never expose the port to the public internet, with or
132
+ > without the key. The key protects a private network, it is not built
133
+ > to face the internet.
101
134
 
102
135
  The API can do what an agent can do: write memory, switch models, start
103
136
  dream runs, run tools. The security page describes the trust boundary
104
137
  and how to check your setup.
105
138
 
139
+ ### `GET /auth/status`
140
+
141
+ Open without the key. Says whether the key is switched on and whether
142
+ this request carries it.
143
+
144
+ ```json
145
+ { "auth": "on", "signedIn": false }
146
+ ```
147
+
148
+ With `server.auth: off`, `signedIn` is always `true`.
149
+
150
+ ### `POST /auth/login`
151
+
152
+ Open without the key. Signs a browser in. Body `{ "key": "somora_…" }`.
153
+
154
+ | Status | Body |
155
+ |---|---|
156
+ | `200` | `{ "ok": true }`, plus the cookie `somora_key` (`HttpOnly`, `SameSite=Strict`, `Secure` over HTTPS, one year). |
157
+ | `401` | `{ "error": "wrong key — …" }` |
158
+ | `429` | Too many wrong keys from this address. |
159
+
160
+ The cookie holds a value derived from the key, not the key. A new key
161
+ (`somora key rotate`) signs every browser out.
162
+
163
+ ### `POST /auth/logout`
164
+
165
+ Open without the key. Removes the cookie. Answers `{ "ok": true }`.
166
+
106
167
  ## Stability
107
168
 
108
169
  - The version from `GET /version` is calendar based and valid semver:
@@ -133,10 +194,43 @@ The running version and what the daily update check found.
133
194
  | `update.available` | `true` when `latestVersion` is newer than `version`. |
134
195
  | `update.note` | Optional hint that comes with the release. |
135
196
 
197
+ ### `GET /inbox`
198
+
199
+ What the web client's inbox shows: a newer version, somora.ai's note,
200
+ and conditions that need a person (a broken `config.yaml`, an expired
201
+ login, the certificate, failing dream runs, a tool server or model
202
+ gone for a day).
203
+
204
+ ```json
205
+ { "entries": [ { "key": "config", "kind": "config", "level": "important",
206
+ "title": "config.yaml has a mistake", "text": "…",
207
+ "firstSeen": 1791821926940, "lastSeen": 1791822226940, "count": 1 } ],
208
+ "unread": 1, "muted": [] }
209
+ ```
210
+
211
+ | Field | Meaning |
212
+ |---|---|
213
+ | `key` | Stable per thing, e.g. `update:<version>`, `news:<hash>`, `config`, `login:claude-cli`, `login:openai-compatible:<provider>`, `login:mcp:<server>`, `tls`, `rem:<agent>`, `deep:<agent>/<slug>`, `lucid`, `mcp:<server>`, `model:<provider/id>`. |
214
+ | `kind` | `update`, `news`, `config`, `login`, `tls`, `dream`, `mcp`, `model`. |
215
+ | `level` | `info`, `warning`, `important`. |
216
+ | `title`, `text`, `url?` | Plain text. `url` is `https://` only. |
217
+ | `firstSeen`, `lastSeen`, `count` | Epoch ms; `count` counts events, a checked state stays `1`. |
218
+ | `readAt?`, `resolvedAt?`, `muted?` | `muted` is `until-resolved` or `forever`. Resolved entries stay a day. |
219
+
220
+ ### `POST /inbox/read`
221
+
222
+ Body `{ "keys": [...] }`, or `{}` for all. Answers `{ ok, unread }`.
223
+
224
+ ### `POST /inbox/mute` · `POST /inbox/unmute`
225
+
226
+ Body `{ "key": "…", "mode": "until-resolved" | "forever" }` for mute,
227
+ `{ "key": "…" }` for unmute. `mode` defaults to `until-resolved`.
228
+ Both answer `{ ok, unread }`, or `404` for an unknown key.
229
+
136
230
  ### `GET /healthz`
137
231
 
138
232
  Liveness probe. Answers the plain text `ok` with status 200. Use it to
139
- wait for the server to come up.
233
+ wait for the server to come up. Open without the key.
140
234
 
141
235
  ### `GET /health`
142
236
 
@@ -322,7 +416,8 @@ running config stays in force.
322
416
  | `400` | `{ok: false, error}` with the schema problems. Nothing was changed. |
323
417
 
324
418
  A reload also forgets every "model unavailable" mark, like
325
- `POST /models/availability/reset`.
419
+ `POST /models/availability/reset`, and every cached provider catalog
420
+ of image and video models: the next request reads them fresh.
326
421
 
327
422
  ### `POST /server/restart`
328
423
 
@@ -341,7 +436,7 @@ An agent that restarts somora from its own turn would cut that turn
341
436
  off. The route therefore takes the requester in the body and waits.
342
437
 
343
438
  ```bash
344
- curl -X POST $BASE/server/restart \
439
+ curl -H "Authorization: Bearer $KEY" -X POST $BASE/server/restart \
345
440
  -H 'Content-Type: application/json' \
346
441
  -d '{"agent":"<your-agent>","session":"main","reason":"config change"}'
347
442
  # → { "ok": true, "deferred": true, "via": "systemd", "message": "…" }
@@ -537,7 +632,7 @@ Stops the turn that is running on a session, whatever started it.
537
632
  Agent and session go in the query string.
538
633
 
539
634
  ```bash
540
- curl -X POST "$BASE/chat/abort?agent=<your-agent>&session=main"
635
+ curl -H "Authorization: Bearer $KEY" -X POST "$BASE/chat/abort?agent=<your-agent>&session=main"
541
636
  ```
542
637
 
543
638
  | Query | Default | Meaning |
@@ -609,7 +704,10 @@ chat window opens.
609
704
  | `limit` | no | Return only the last N events (1 to 2000, default 200 once paging is used). |
610
705
  | `before` | no | Epoch ms. Return events older than this. Pass the `oldestTs` of the previous page. |
611
706
 
612
- Without `limit` and `before` the whole session is returned.
707
+ Without `limit` and `before` the whole session is returned, with
708
+ `hasMore: false`. Events with the same `ts` are never split across
709
+ pages, so a page can hold a few more than `limit`. `oldestTs` is left
710
+ out when the page is empty.
613
711
 
614
712
  ```json
615
713
  { "agent": "<your-agent>",
@@ -712,7 +810,7 @@ The live events of one session, as Server-Sent Events. Open one per
712
810
  chat window.
713
811
 
714
812
  ```bash
715
- curl -N "$BASE/chat/stream?agent=<your-agent>&session=main"
813
+ curl -H "Authorization: Bearer $KEY" -N "$BASE/chat/stream?agent=<your-agent>&session=main"
716
814
  ```
717
815
 
718
816
  | Query | Default | Meaning |
@@ -892,7 +990,7 @@ have something unread. It also reports sessions that no client has
892
990
  open. Open one per client.
893
991
 
894
992
  ```bash
895
- curl -N $BASE/activity/stream
993
+ curl -H "Authorization: Bearer $KEY" -N $BASE/activity/stream
896
994
  ```
897
995
 
898
996
  | Event | When | Data |
@@ -1080,8 +1178,8 @@ Downloads the session as a file.
1080
1178
  Both set `Content-Disposition: attachment`. `400` for another format.
1081
1179
 
1082
1180
  ```bash
1083
- curl "$BASE/agents/<your-agent>/sessions/main/export?format=markdown" -o main.md
1084
- curl "$BASE/agents/<your-agent>/sessions/main/export?format=json" -o main.jsonl
1181
+ curl -H "Authorization: Bearer $KEY" "$BASE/agents/<your-agent>/sessions/main/export?format=markdown" -o main.md
1182
+ curl -H "Authorization: Bearer $KEY" "$BASE/agents/<your-agent>/sessions/main/export?format=json" -o main.jsonl
1085
1183
  ```
1086
1184
 
1087
1185
  ## Models and thinking
@@ -1190,7 +1288,7 @@ Merges keys into the session's override. A key set to `null` is
1190
1288
  dropped.
1191
1289
 
1192
1290
  ```bash
1193
- curl -X PUT $BASE/agents/<your-agent>/sessions/main/sampling \
1291
+ curl -H "Authorization: Bearer $KEY" -X PUT $BASE/agents/<your-agent>/sessions/main/sampling \
1194
1292
  -H 'Content-Type: application/json' -d '{"temperature":0.7}'
1195
1293
  ```
1196
1294
 
@@ -1350,7 +1448,7 @@ Runs one tool as the agent, without a chat turn. The body is the
1350
1448
  tool's input, the response its result.
1351
1449
 
1352
1450
  ```bash
1353
- curl -X POST $BASE/agents/<your-agent>/tools/memory_search \
1451
+ curl -H "Authorization: Bearer $KEY" -X POST $BASE/agents/<your-agent>/tools/memory_search \
1354
1452
  -H 'Content-Type: application/json' \
1355
1453
  -d '{"query":"voice satellites","limit":3}'
1356
1454
  ```
@@ -1734,7 +1832,7 @@ keyword and by meaning. It is the search the `memory_search` tool uses.
1734
1832
  | `minScore` | 0 | 0 to 1. Hits below it are dropped. Recall during a turn uses `autoInject.minScore` instead. |
1735
1833
 
1736
1834
  ```bash
1737
- curl "$BASE/agents/<your-agent>/memory/search?q=voice+satellites&limit=5"
1835
+ curl -H "Authorization: Bearer $KEY" "$BASE/agents/<your-agent>/memory/search?q=voice+satellites&limit=5"
1738
1836
  ```
1739
1837
 
1740
1838
  Returns `{agent, query, limit, minScore, count, hits}`. Each hit:
@@ -2173,7 +2271,7 @@ Uploads one file as the raw request body. The file name goes into the
2173
2271
  `X-Somora-Filename` header, URL-encoded.
2174
2272
 
2175
2273
  ```bash
2176
- curl -X POST $BASE/attachments \
2274
+ curl -H "Authorization: Bearer $KEY" -X POST $BASE/attachments \
2177
2275
  --data-binary @./screenshot.png \
2178
2276
  -H "Content-Type: image/png" \
2179
2277
  -H "X-Somora-Filename: screenshot.png"
@@ -2339,13 +2437,15 @@ Generates images.
2339
2437
  | `model` | no | A configured model name. |
2340
2438
  | `resolution`, `aspect_ratio`, `size`, `quality`, `output_format`, `background`, `output_compression`, `seed`, `n`, `steps`, `cfg`, `guidance` | no | Specs. Which ones a model takes is in its capabilities. |
2341
2439
  | `reference_images` | no | Images as base64 strings. The `image_generate` tool takes file paths instead. |
2440
+ | `extra` | no | Provider fields somora has no name for, passed through as given, as the tool's `extra`. |
2342
2441
  | `session` | no | Recorded with the image. |
2343
2442
 
2344
2443
  Returns `{images: [record], costUsd, warnings?, fellBackFrom?}`.
2345
2444
  `warnings` lists what the endpoint did differently than asked, for
2346
- example a size it replaced. `fellBackFrom` names the models that were
2347
- unavailable when a backup model was used. A `save_to` field is ignored:
2348
- every image lands in the configured images folder.
2445
+ example a size it replaced, and every body field the route did not use
2446
+ (`ignored: <field>`). `fellBackFrom` names the models that were
2447
+ unavailable when a backup model was used. A `save_to` field is not
2448
+ used: every image lands in the configured images folder.
2349
2449
 
2350
2450
  | Status | Meaning |
2351
2451
  |---|---|
@@ -2399,7 +2499,8 @@ the file left the disk.
2399
2499
  ### `GET /media/:id/thumb`
2400
2500
 
2401
2501
  A video's still image, `image/webp` unless the record says otherwise.
2402
- Same behaviour as `/file`. `404` when there is none.
2502
+ Same behaviour as `/file`. A video without a still gets one cut on
2503
+ the first request. `404` only when that fails.
2403
2504
 
2404
2505
  ### `DELETE /media/:id`
2405
2506
 
@@ -2426,7 +2527,7 @@ Returns `{enabled: false, reason}` when it is off. Otherwise:
2426
2527
  | Field | Meaning |
2427
2528
  |---|---|
2428
2529
  | `active`, `limit` | Jobs running now and the most allowed at once (`videoGen.maxConcurrent`). |
2429
- | `models` | `[{name, label, model, provider, wire}]` |
2530
+ | `models` | `[{name, label, model, provider, wire, media, params}]`. `media` lists the input files the model takes, by type: `{kind, max?, min?, max_seconds?}`. `params` lists its parameters as the provider catalog or `allow.parameters` describes them: `{type?, values?, min?, max?, default?, note?}` per name. |
2430
2531
  | `jobs` | Each `{id, providerJobId, modelName, provider, prompt, specs, status, progress?, queuePosition?, error?, createdAt, updatedAt, mediaId?, path?, agent?, session?, references?}`. |
2431
2532
 
2432
2533
  A job's `status` is `queued`, `in_progress`, `completed` or `failed`.
@@ -2442,16 +2543,19 @@ Starts a job.
2442
2543
  | `prompt` | yes | What to show. |
2443
2544
  | `model` | no | A configured model name. |
2444
2545
  | `seconds`, `size`, `aspect_ratio`, `audio`, `quality`, `seed` | no | Specs. |
2445
- | `reference_images` | no | Images as base64 strings. |
2546
+ | `extra` | no | The model's own parameters, for example `{"subject": "right"}`. Checked against what the model takes, like the specs. |
2547
+ | `reference_images` | no | Images as base64 strings or `{data, filename}`: one is the opening frame, two are opening and closing frame. |
2548
+ | `media` | no | Input files by meaning: `[{type, data, filename?, seconds?, strength?}]`, `data` in base64 or as a `data:` URI. Types as in the video guide, "Input files". Not together with `reference_images`. |
2446
2549
  | `agent`, `session` | no | Who is woken when the job ends. |
2447
2550
 
2448
- Returns `{job}`. Follow it with `GET /video/status`.
2551
+ Returns `{job}`. Follow it with `GET /video/status`. A body field the
2552
+ route did not use is listed in `job.warnings` as `ignored: <field>`.
2449
2553
 
2450
2554
  | Status | Meaning |
2451
2555
  |---|---|
2452
- | `400` | A bad request. |
2556
+ | `400` | A bad request, or the provider refused it with a `4xx` other than `401`, `403` and `429`. The provider's message is passed on. |
2453
2557
  | `429` | All job slots are busy. |
2454
- | `502` | The provider failed. |
2558
+ | `502` | The provider failed, or refused for authentication or rate limits. |
2455
2559
  | `503` | Video is off, or the model is not available right now. |
2456
2560
 
2457
2561
  ## Voice
@@ -2643,7 +2747,7 @@ shell.
2643
2747
  The tmux sessions on the server.
2644
2748
 
2645
2749
  ```bash
2646
- curl $BASE/tmux/sessions
2750
+ curl -H "Authorization: Bearer $KEY" $BASE/tmux/sessions
2647
2751
  ```
2648
2752
 
2649
2753
  Returns `{sessions: [{name, windows, activeCommand, activeTitle, createdEpoch, lastActivityEpoch, origin?}]}`.
@@ -2912,7 +3016,7 @@ There is no route to create a trigger. Create it through the tool, so
2912
3016
  that the same limits apply as for an agent:
2913
3017
 
2914
3018
  ```bash
2915
- curl -X POST $BASE/agents/<your-agent>/tools/sentinel \
3019
+ curl -H "Authorization: Bearer $KEY" -X POST $BASE/agents/<your-agent>/tools/sentinel \
2916
3020
  -H 'Content-Type: application/json' \
2917
3021
  -d '{
2918
3022
  "action": "create",
package/docs/browser.md CHANGED
@@ -441,10 +441,10 @@ checks the agent's browser ability.
441
441
  Taking over and handing back from the command line:
442
442
 
443
443
  ```bash
444
- curl -sk -X POST https://localhost:18737/browser/agent:<your-agent>@<your-agent>/control \
444
+ curl -H "Authorization: Bearer $(somora key)" -sk -X POST https://localhost:18737/browser/agent:<your-agent>@<your-agent>/control \
445
445
  -H 'Content-Type: application/json' -d '{"mode":"human"}'
446
446
  # sign in, then:
447
- curl -sk -X POST https://localhost:18737/browser/agent:<your-agent>@<your-agent>/control \
447
+ curl -H "Authorization: Bearer $(somora key)" -sk -X POST https://localhost:18737/browser/agent:<your-agent>@<your-agent>/control \
448
448
  -H 'Content-Type: application/json' -d '{"mode":"agent","handoffId":"<id>"}'
449
449
  ```
450
450
 
@@ -28,7 +28,7 @@ To see the system prompt exactly as the next turn sends it, open the
28
28
  agent's window in the web client and choose **Full prompt**, or call:
29
29
 
30
30
  ```bash
31
- curl 'http://127.0.0.1:18737/agents/<your-agent>/prompt-preview?session=main'
31
+ curl -H "Authorization: Bearer $(somora key)" 'http://127.0.0.1:18737/agents/<your-agent>/prompt-preview?session=main'
32
32
  ```
33
33
 
34
34
  The preview never changes the session.
package/docs/display.md CHANGED
@@ -304,6 +304,7 @@ By default the client talks to `http://127.0.0.1:18737`. When
304
304
  | `SOMORA_HOST` | The host name. |
305
305
  | `SOMORA_PORT` | The port. Default `18737`. |
306
306
  | `SOMORA_TLS` | `1` forces HTTPS, `0` forces HTTP. |
307
+ | `SOMORA_KEY` | The server's key. On the server itself the client reads `~/.somora/server.key`; on another machine set this to what `somora key` prints there. |
307
308
 
308
309
  The agent you used last is remembered in `~/.somora/tui-state.json`.
309
310
  Without one, the client starts on the first agent in alphabetical
@@ -422,6 +422,12 @@ wiki:
422
422
  model that failed is skipped by all of them for
423
423
  `fallback.retryUnavailableMinutes` (default 60). A successful call
424
424
  clears the mark.
425
+ - A call that runs past its time limit goes to the next backup with
426
+ the same note. That model is slow on this input, not down, so it is
427
+ not marked and chat keeps using it. For Deep the limit is
428
+ `wiki.deep.callTimeoutMs` (default 5 minutes); a worker that thinks
429
+ over a long page can need that long. Lucid's limits are fixed: 10
430
+ minutes per batch.
425
431
  - A backup name that is not a configured model stops the server at
426
432
  start, with the list of known models.
427
433
 
@@ -600,6 +606,7 @@ wiki:
600
606
  minExistingBytes: 2000
601
607
  skipCacheDays: 30
602
608
  maxPageChars: 50000
609
+ callTimeoutMs: 300000
603
610
  lucid:
604
611
  enabled: true
605
612
  intervalDays: 7
@@ -630,6 +637,7 @@ fallback:
630
637
  | `wiki.deep.mergeShrinkGuard.minExistingBytes` | 2000 | Pages below this size are not guarded. |
631
638
  | `wiki.deep.skipCacheDays` | 30 | A skipped, unchanged note is looked at again after this many days. `0` means never. |
632
639
  | `wiki.deep.maxPageChars` | 50000 | A page above this takes no more content and gets sub-pages. |
640
+ | `wiki.deep.callTimeoutMs` | 300000 | Time limit of one model call (one note), in milliseconds, 30000 to 1800000. Past it the note goes to the next backup. |
633
641
  | `wiki.lucid.enabled` | true | Scheduled Lucid runs. |
634
642
  | `wiki.lucid.intervalDays` | 7 | Days between Lucid runs. |
635
643
  | `wiki.lucid.model` | none | The Lucid worker. Required. |
@@ -678,8 +686,8 @@ Lucid run although findings wait. For `rem` neither applies.
678
686
  `run-deep` and `run-lucid` answer 400 when `wiki.enabled` is false.
679
687
 
680
688
  ```bash
681
- curl -X POST http://127.0.0.1:18737/dream/run-deep -d '{"wait":true}'
682
- curl -X POST http://127.0.0.1:18737/dream/run-lucid -d '{"wait":true}'
689
+ curl -H "Authorization: Bearer $(somora key)" -X POST http://127.0.0.1:18737/dream/run-deep -d '{"wait":true}'
690
+ curl -H "Authorization: Bearer $(somora key)" -X POST http://127.0.0.1:18737/dream/run-lucid -d '{"wait":true}'
683
691
  ```
684
692
 
685
693
  ## Troubleshooting