somora 2026.1017.3 → 2026.1026.10

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 (105) hide show
  1. package/config.example.yaml +39 -16
  2. package/docs/acp.md +5 -2
  3. package/docs/agents.md +7 -5
  4. package/docs/api.md +88 -41
  5. package/docs/browser.md +3 -2
  6. package/docs/builder.md +12 -7
  7. package/docs/cache-strategy.md +8 -4
  8. package/docs/compaction.md +23 -3
  9. package/docs/display.md +9 -5
  10. package/docs/dream-phases.md +9 -8
  11. package/docs/files.md +5 -4
  12. package/docs/imagegen.md +2 -2
  13. package/docs/index.md +1 -1
  14. package/docs/mcp.md +37 -5
  15. package/docs/memory.md +11 -6
  16. package/docs/mobile.md +37 -5
  17. package/docs/models.md +17 -10
  18. package/docs/projects.md +1 -1
  19. package/docs/realtime-voice.md +4 -4
  20. package/docs/resources.md +4 -2
  21. package/docs/sampling.md +1 -1
  22. package/docs/security.md +9 -3
  23. package/docs/sentinel.md +120 -35
  24. package/docs/setup.md +1 -2
  25. package/docs/thinking.md +3 -3
  26. package/docs/tmux.md +6 -3
  27. package/docs/tools.md +94 -21
  28. package/docs/videogen.md +5 -5
  29. package/docs/web.md +30 -6
  30. package/docs/wiki.md +7 -6
  31. package/package.json +1 -1
  32. package/src/acp/somora-agent.ts +18 -1
  33. package/src/cli/tui/app.tsx +29 -11
  34. package/src/cli/tui/stream.ts +4 -1
  35. package/src/cli/tui/types.ts +7 -0
  36. package/src/config/loader.ts +3 -3
  37. package/src/config/types.ts +74 -8
  38. package/src/engine/claude-cli.ts +20 -1
  39. package/src/engine/codex-cli.ts +27 -16
  40. package/src/engine/codex-dynamic-tools.ts +4 -26
  41. package/src/engine/engine-meta-labels.ts +14 -5
  42. package/src/engine/grok-cli.ts +6 -1
  43. package/src/engine/grok-home.ts +49 -1
  44. package/src/engine/openai-compatible.ts +205 -35
  45. package/src/engine/openai-tool-catalog.ts +568 -0
  46. package/src/engine/types.ts +26 -0
  47. package/src/mcp/config.ts +10 -0
  48. package/src/mcp/hub/credentials.ts +88 -10
  49. package/src/mcp/hub/manager.ts +65 -3
  50. package/src/mcp/server.ts +99 -55
  51. package/src/mcp/tool-schema.ts +28 -15
  52. package/src/sentinel/check-create.ts +7 -2
  53. package/src/sentinel/check-dry-run.ts +54 -3
  54. package/src/sentinel/check-judge.ts +27 -0
  55. package/src/sentinel/check-logic.ts +180 -8
  56. package/src/sentinel/check-loop.ts +41 -8
  57. package/src/sentinel/check-store.ts +43 -8
  58. package/src/sentinel/dispatcher.ts +1 -1
  59. package/src/sentinel/schedule.ts +9 -2
  60. package/src/sentinel/store.ts +18 -1
  61. package/src/sentinel/types.ts +17 -4
  62. package/src/server/agent-order.ts +62 -0
  63. package/src/server/ask-attended.ts +16 -0
  64. package/src/server/async-questions.ts +223 -0
  65. package/src/server/builder-questions.ts +18 -0
  66. package/src/server/builder-session.ts +2 -2
  67. package/src/server/claude-credential-sync.ts +39 -10
  68. package/src/server/inbox-sources.ts +2 -2
  69. package/src/server/index.ts +18 -1
  70. package/src/server/prompt-assembly.ts +13 -1
  71. package/src/server/routes/agents.ts +39 -6
  72. package/src/server/routes/builder.ts +26 -1
  73. package/src/server/routes/chat.ts +4 -0
  74. package/src/server/routes/external.ts +31 -9
  75. package/src/server/routes/server.ts +17 -0
  76. package/src/server/run-turn.ts +45 -8
  77. package/src/server/start-turn.ts +6 -0
  78. package/src/server/turn-tool-catalog.ts +65 -0
  79. package/src/tools/agents/spawn.ts +1 -0
  80. package/src/tools/agents/status.ts +2 -2
  81. package/src/tools/browser/tools.ts +48 -28
  82. package/src/tools/builder/tools.ts +12 -8
  83. package/src/tools/catalog.ts +139 -0
  84. package/src/tools/exec/tools.ts +50 -37
  85. package/src/tools/file/tools.ts +10 -4
  86. package/src/tools/memory/tools.ts +3 -2
  87. package/src/tools/projects/tools.ts +7 -6
  88. package/src/tools/registry.ts +45 -1
  89. package/src/tools/sentinel/tools.ts +56 -50
  90. package/src/tools/tmux/tools.ts +109 -257
  91. package/src/types/events.ts +16 -2
  92. package/web/dist/assets/index-D0hm3iJz.js +68 -0
  93. package/web/dist/assets/index-D0hm3iJz.js.map +1 -0
  94. package/web/dist/assets/index-hdBR7ObT.css +1 -0
  95. package/web/dist/index.html +2 -2
  96. package/web-mobile/dist/assets/index-B8UJVJ7V.css +1 -0
  97. package/web-mobile/dist/assets/index-BFmhLylV.js +47 -0
  98. package/web-mobile/dist/assets/index-BFmhLylV.js.map +1 -0
  99. package/web-mobile/dist/index.html +2 -2
  100. package/web/dist/assets/index-C2J8Fvlt.css +0 -1
  101. package/web/dist/assets/index-C2UYh7Af.js +0 -68
  102. package/web/dist/assets/index-C2UYh7Af.js.map +0 -1
  103. package/web-mobile/dist/assets/index-BUnNxF-t.css +0 -1
  104. package/web-mobile/dist/assets/index-CqdlMkSS.js +0 -47
  105. package/web-mobile/dist/assets/index-CqdlMkSS.js.map +0 -1
@@ -63,8 +63,9 @@ server:
63
63
  # models with this capability. For models without it, the
64
64
  # setting is dormant and the TUI marks it accordingly.
65
65
  providers:
66
- # Anthropic via Claude Code subscription. Uses the local Claude Code
67
- # binary (~/.local/bin/claude) — no baseUrl / apiKey needed.
66
+ # Anthropic via Claude Code subscription. Uses the Claude Code bundled
67
+ # with somora (or your own, when installed); log in with
68
+ # `somora claude login`. No baseUrl / apiKey needed.
68
69
  anthropic:
69
70
  engine: claude-cli
70
71
  models:
@@ -681,9 +682,9 @@ providers:
681
682
  # # serial delivery order.
682
683
  # heartbeatMs: 20000 # server→client heartbeat on /chat/stream + /activity/stream
683
684
  # deadAfterMs: 60000 # a heartbeat write hanging longer → stream counts as dead, socket closed
684
- # h2PingIntervalMs: 30000 # HTTP/2 PING pro Client-Session (TLS-Listener) …
685
- # h2PingTimeoutMs: 30000 # … ohne ACK in dieser Zeit → Session zerstört (Tab weg, WLAN weg)
686
- # keepAliveDelayMs: 30000 # TCP-Keepalive auf jedem Socket (Kernel-Probes obendrauf)
685
+ # h2PingIntervalMs: 30000 # HTTP/2 PING per client session (TLS listener) …
686
+ # h2PingTimeoutMs: 30000 # … no ACK within this time → session destroyed (tab closed, Wi-Fi gone)
687
+ # keepAliveDelayMs: 30000 # TCP keepalive on every socket (kernel probes on top)
687
688
  # tmux attention watcher — somora watches its own tmux sessions that were
688
689
  # created with kind "claude-code" or "codex" and detects when the CLI in
689
690
  # the pane goes from running to ready (finished OR waiting for input).
@@ -750,26 +751,46 @@ providers:
750
751
  # # (PATH/HOME/USER/LANG only). Use only after
751
752
  # # auditing every skill — declared env_vars will
752
753
  # # silently appear missing inside shells.
753
- # directTools: # somora tools kept in Codex's DIRECT tool list
754
- # - memory_search # (schemas in context every turn). Everything
755
- # - memory_get # else is a deferred dynamic tool the model
756
- # - memory_write # reaches via Codex tool search / Code Mode
757
- # - memory_edit # discovery. Default = this everyday core;
758
- # - file_read # add tools an agent needs in nearly every
759
- # - file_write # turn, drop what it rarely uses.
760
- # - file_patch
754
+ # directTools: [...] # LEGACY — use toolCatalog below. When set it
755
+ # # replaces toolCatalog.alwaysVisible for codex-cli
756
+ # # only (the server logs that once).
757
+
758
+ # toolCatalog: # docs/tools.md "Always in the list, or found on demand"
759
+ # alwaysVisible: # kept in the model's list on claude-cli, codex-cli and openai-compatible
760
+ # - exec # instead of behind the tool search. Always cut to
761
+ # - process # the tools a turn offers: a tool switched off for
762
+ # - tmux # the agent never shows up. Default = this list.
763
+ # - file_read # A builder's whole (small) set is always in it;
764
+ # - file_write # during a dream review dream_list/get/apply/
765
+ # - file_patch # dismiss/review and wiki_edit join.
761
766
  # - file_list
762
767
  # - file_search
763
- # - exec
764
- # - tmux
765
768
  # - web_search
766
769
  # - web_fetch
770
+ # - memory_search
771
+ # - memory_get
772
+ # - memory_write
767
773
  # - time_now
768
774
  # - agent_ask
775
+ # - agent_ask_result
769
776
  # - spawn_subagent
770
777
  # - subagent_result
771
- # - somora_docs_list
772
778
  # - somora_docs_read
779
+ # - skill
780
+ # - ask_user # listed only when the turn offers it
781
+ # engines: # per engine: add / remove on top of the list
782
+ # codex-cli: { add: [sentinel] }
783
+ # openai-compatible: # mode: catalog (default) sends the list +
784
+ # mode: all # tool_search/tool_call and names the rest at the
785
+ # # end of the system prompt; all sends every schema
786
+ # models: # per model alias or <provider>/<modelId>
787
+ # some-small-model: { add: [sentinel, browser] }
788
+ # weak-local-model: { mode: all } # a model's mode wins over its engine's
789
+ # search: # catalog mode only
790
+ # listingMaxChars: 8000 # the list of the other tools; over it lines shrink,
791
+ # # then only names stay
792
+ # defaultResults: 5 # hits per tool_search query
793
+ # maxResults: 20 # most a model may ask for
773
794
 
774
795
  # memory:
775
796
  # embedding:
@@ -996,6 +1017,8 @@ providers:
996
1017
  # maxConcurrent: 4 # checks running at once, all triggers
997
1018
  # errorStreak: 3 # check errors in a row before it stops
998
1019
  # maxWakesPerDay: 24 # wakes per check trigger and UTC day
1020
+ # maxItemsPerCheck: 20 # perItem: items judged per check, more wait
1021
+ # parallelDecisions: 4 # perItem: questions to the decision model at once
999
1022
 
1000
1023
  # External MCP servers (docs/mcp.md). somora connects as MCP client,
1001
1024
  # imports the servers' tools and offers them to every engine next to the
package/docs/acp.md CHANGED
@@ -18,7 +18,7 @@ somora, see [External agents](external-agents.md).
18
18
  - **Your agent in the editor.** Text and thinking stream in, and every
19
19
  tool call shows with its result.
20
20
  - **Sessions.** A new conversation in the editor is a new somora
21
- session named `acp-<date>-<time>`. The editor can list the agent's
21
+ session named `acp-<date>-<time>-<tail>`. The editor can list the agent's
22
22
  sessions and open earlier ones, with their history replayed.
23
23
  - **A builder's plan.** When a builder agent updates its task list, the
24
24
  editor shows it as the plan.
@@ -29,6 +29,9 @@ somora, see [External agents](external-agents.md).
29
29
  taken out of the queue, and the other turn keeps running.
30
30
  - **Images.** Images you add in the editor reach the agent as
31
31
  attachments.
32
+ - **Questions.** A chat agent's question does not wait. It appears in
33
+ the reply as text with its options, and your next message answers
34
+ it.
32
35
  - **The context fill**, when the agent's model reports it.
33
36
 
34
37
  ## Try it
@@ -45,7 +48,7 @@ the protocol.
45
48
 
46
49
  | Option | Meaning |
47
50
  |---|---|
48
- | `--agent <name>` | The somora agent to talk to. Default: the first agent by name. |
51
+ | `--agent <name>` | The somora agent to talk to. Default: the first somora agent by name (external agents are skipped). |
49
52
  | `--session <name>` | Every new conversation in the editor opens this session (for example `main`) instead of a new one. |
50
53
 
51
54
  ## Zed
package/docs/agents.md CHANGED
@@ -148,7 +148,7 @@ The system prompt of a chat agent has these parts, in this order:
148
148
  | Self-pointer | The agent's name, the paths of its persona files and `agent.yaml`, its workspace, the path of `config.yaml`, the visible remote resources, and how to link local files and show images in a reply. |
149
149
  | Persona | `SOUL.md`, `AGENTS.md`, `USER.md`. |
150
150
  | Team block | Rendered from `team.yaml`. |
151
- | Tool reminder | A short constant text, when the agent has tools. |
151
+ | Tool reminder | A short constant text, when the agent has tools. In a turn a person started, one more line tells the agent to ask questions with clear choices through `ask_user`. |
152
152
  | Wiki overview | A map of the shared wiki, fixed when the session starts. |
153
153
  | Skills | The skills this agent may use. |
154
154
  | This session | The session's name. |
@@ -739,7 +739,8 @@ How the fallback chain works:
739
739
 
740
740
  Rules for `tools` and `skills`:
741
741
 
742
- - A name under `deny` beats everything. A name or pattern under
742
+ - A name under `deny` beats every other rule in this file. The dream
743
+ and wiki-writing tools follow the `dreams` switch instead. A name or pattern under
743
744
  `allow` beats a family rule under `deny`, which makes it an
744
745
  exception. No block means no restriction.
745
746
  - A tool pattern is an exact name (`web_search`), a toolset
@@ -856,7 +857,7 @@ agent is there on the next `GET /agents`.
856
857
  | `GET /agents/:agent/memory/notes` | Lists the agent's indexed notes. |
857
858
  | `GET /agents/:agent/memory/search?q=` | Searches memory, wiki and vault, for debugging. |
858
859
  | `POST /agents/:agent/dream/run-rem` | Starts REM for this agent now. |
859
- | `POST /dream/run-deep`, `POST /dream/run-lucid` | Start Deep or Lucid, for the whole install. Body `{wait?, force?}` and `{wait?}`. |
860
+ | `POST /dream/run-deep`, `POST /dream/run-lucid` | Start Deep or Lucid, for the whole install. Body `{wait?, force?}` for both. |
860
861
  | `GET /spawn-result` | The result of a sub-agent task, as `subagent_result` reads it. |
861
862
 
862
863
  Bodies and answers in full are on the [API](api.md) page.
@@ -869,8 +870,9 @@ folder name must match the naming rule under [Set it up](#set-it-up).
869
870
  **The agent ignores its `agent.yaml`.** One invalid value makes somora
870
871
  ignore the whole file: the agent then has no model, no tool rules and
871
872
  no REM. The log line `persona.agent_yaml_parse_failed` names the key.
872
- Common causes: a `rem` block without `model`, an unknown key under
873
- `sampling`, a `thinking` value outside the four levels, or broken YAML.
873
+ Common causes: an unknown key under `sampling`, a `thinking` value
874
+ outside the four levels, a wrong type (e.g. `dreams: "yes"`), or broken
875
+ YAML.
874
876
  `persona.agent_yaml_not_object` means the file is not a key and value
875
877
  map.
876
878
 
package/docs/api.md CHANGED
@@ -64,7 +64,7 @@ the turn and returns the reply in the response.
64
64
  | Base URL | `https://<your-host>.<your-tailnet>.ts.net:18737` with HTTPS set up, else `http://127.0.0.1:18737`. The web client is under `/web/`, the mobile app under `/mobile/`. |
65
65
  | Bodies | JSON in, JSON out (`Content-Type: application/json`), unless a route says otherwise. Uploads are raw bytes or `multipart/form-data`, as noted per route. |
66
66
  | Errors | A non-2xx response carries `{ "error": "<message>" }`. The message is written for a person. Some routes add fields, noted per route. |
67
- | Unknown agent or session | `404` on every route that takes one, except `POST /chat/abort`. |
67
+ | Unknown agent or session | `404` on every route that takes one, except `POST /chat/abort` and `POST /server/restart`. |
68
68
  | Agent being renamed | `409` with `error: "agent '<name>' is being renamed — try again in a moment"` on every route under `/agents/:agent/` except reads (`GET`), and on `POST /chat/send` and `POST /chat/send-sync`, for the old and the new name. Retry in a moment. |
69
69
  | Times | Epoch milliseconds as numbers, or ISO 8601 strings. The examples show which. |
70
70
  | Streams | Server-Sent Events with named events. `data` is always JSON. |
@@ -116,9 +116,10 @@ Ten wrong keys from one address within five minutes block that address
116
116
  for a minute (`429`). Requests from the server's own machine are not
117
117
  blocked. A request without any key does not count.
118
118
 
119
- Open without the key: `GET /healthz`, the `/auth/*` routes below, and
120
- the files of the web and mobile clients under `/web/` and `/mobile/`,
121
- which hold no data.
119
+ Open without the key: `GET /healthz`, the `/auth/*` routes below, the
120
+ files of the web and mobile clients under `/web/` and `/mobile/`,
121
+ which hold no data, and the A2A paths (Agent Cards, `/a2a/files/<token>`,
122
+ `POST /a2a/agents/:agent`), which check peer tokens themselves.
122
123
 
123
124
  With `server.auth: off` in `config.yaml` the server asks for no key.
124
125
  Then access is decided by the network alone.
@@ -334,8 +335,8 @@ Top-level blocks:
334
335
  | Block | Meaning |
335
336
  |---|---|
336
337
  | `claudeAuth` | State of the login shared between `~/.claude` and somora's own Claude folder. Expiry times only, never tokens. `identical: false` with both sides present means they have drifted apart. If that stays, run `somora claude status`. |
337
- | `memoryEmbedder` | The embedding model behind memory search. `state` is `ok`, `loading` or `failed`. With `failed`, `error` says why and every search is keyword only until a retry succeeds. |
338
- | `sharedIndex` | The search index over vault and wiki that all agents share. `state` is `ready`, `building`, `disabled` (no vault configured) or `failed` with `error`. `built_by` is `seed:<agent>` or `sweep`. `null` until the server has opened it. |
338
+ | `memoryEmbedder` | The embedding model behind memory search. `state` is `idle`, `loading`, `ok` or `failed`. With `failed`, `error` says why and every search is keyword only until a retry succeeds. |
339
+ | `sharedIndex` | The search index over vault and wiki that all agents share. `state` is `opening`, `building`, `ready`, `disabled` (no vault configured) or `failed` with `error`. `built_by` is `seed:<agent>` or `sweep`. `null` until the server has opened it. |
339
340
 
340
341
  ### `GET /host-stats`
341
342
 
@@ -383,6 +384,18 @@ so that no client parses the file itself.
383
384
 
384
385
  A custom client may use either as its own defaults.
385
386
 
387
+ ### `GET /mobile-agent-order` · `PUT /mobile-agent-order`
388
+
389
+ The order of the agent tiles in the `/mobile` client, the same on every
390
+ device. Kept in `~/.somora/mobile/agent-order.json`.
391
+
392
+ | Route | Body | Returns |
393
+ |---|---|---|
394
+ | `GET /mobile-agent-order` | | `{order: ["agent", …]}`, an empty list when none was saved |
395
+ | `PUT /mobile-agent-order` | `{order: ["agent", …]}` | the saved `{order}`. `400` when `order` is not a list of agent names, names one twice or holds more than 500. |
396
+
397
+ Agents missing from the list come after it, by name.
398
+
386
399
  ### `GET /logs`
387
400
 
388
401
  The tail of the server log for one day.
@@ -527,7 +540,9 @@ a turn runs waits in that session's queue.
527
540
  ### `POST /chat/send`
528
541
 
529
542
  Sends a message and returns at once. The turn runs in the background
530
- and its events arrive on `GET /chat/stream`.
543
+ and its events arrive on `GET /chat/stream`. A message from the person
544
+ answers an open question that does not wait and removes it
545
+ (`question_answered` with `by: "message"`).
531
546
 
532
547
  | Field | Type | Required | Meaning |
533
548
  |---|---|---|---|
@@ -833,8 +848,8 @@ Every entry has the same fields:
833
848
 
834
849
  | Field | Meaning |
835
850
  |---|---|
836
- | `id` | The work id: a `turnId`, a `call_id`, a `task_id`, the consult id of a question from a call, or a video job id. |
837
- | `kind` | Where it came from: `human`, `agent`, `subagent`, `sentinel`, `tmux`, `browser`, `voice` or `wake`. A `wake` also has `about` (`a2a`, `subagent`, `job` or `system`). |
851
+ | `id` | The work id: a `turnId`, a `call_id`, a `task_id` (also an A2A task's), the consult id of a question from a call, or a video job id. |
852
+ | `kind` | Where it came from: `human`, `agent`, `subagent`, `sentinel`, `tmux`, `browser`, `voice`, `peer` or `wake`. A `wake` also has `about` (`a2a`, `subagent`, `job` or `system`). |
838
853
  | `state` | `queued`, `running`, `done`, `failed`, `cancelled` or `dequeued`. |
839
854
  | `preview` | The first 160 characters of the text, line breaks folded to spaces. |
840
855
  | `target` | The `{agent, session}` the turn runs on. |
@@ -872,7 +887,7 @@ All events:
872
887
  | `heartbeat` | Every `sse.heartbeatMs` (20 s) | The current time in ms |
873
888
  | `user_message` | A turn's message was stored: the turn has started. Also for a steered message. | See "The user_message event" |
874
889
  | `turn_queued` | A message has to wait behind another turn | `{turnId, ahead, workId?, kind?}` |
875
- | `turn_dequeued` | A waiting entry was removed with `DELETE /chat/queue/:id` | `{turnId, workId}` |
890
+ | `turn_dequeued` | A waiting entry was removed with `DELETE /chat/queue/:id` | `{turnId, workId?}` |
876
891
  | `steer_queued` | A steered message was accepted for the running turn | `{steerId, text, ts, turnId, origin}` |
877
892
  | `turn_started` | The engine opened the turn | `{turnId}` |
878
893
  | `agent` | The model call starts and ends | `{phase: "start"\|"end", usage?, contextWindow?, provider?, model?, thinking?, fallback?, external?}`. `external: {system}` marks an external agent's turn; `external.unprompted: true` a message it sent on its own, outside a turn. |
@@ -889,8 +904,8 @@ All events:
889
904
  | `project` | The session's project changed | `{from, to, via}` |
890
905
  | `builder_state` | A builder session's mode, phase or plan file changed | `{mode, phase, planPath}` |
891
906
  | `todo_updated` | A builder replaced its task list | `{todos: [{content, status, priority?}], by?}` |
892
- | `question_asked` | A builder or an external agent waits for the person | `{questionId, question, header?, options, multiple, expiresAt, kind?, from?}`. `kind: "permission"` and `from: "external"` mark an external agent asking to run something; each option's `description` is then its kind (`allow_once`, `reject_once`, …). |
893
- | `question_answered` | The open question was answered or ran out of time | `{questionId?, answered, choice?}` |
907
+ | `question_asked` | An agent asks the person | `{questionId, question, header?, options, multiple, expiresAt, kind?, from?, async?, parts?, source?}`. `kind: "permission"` and `from: "external"` mark an external agent asking to run something; each option's `description` is then its kind (`allow_once`, `reject_once`, …). `async: true` marks a question that does not wait (`expiresAt` is `0`); `parts` lists several questions asked at once, `source` is `ask_user`, or `codex` for Codex's own question tool. |
908
+ | `question_answered` | The open question was answered, replaced or ran out of time | `{questionId?, answered, choice?, by?}`. `by: "message"`: a question that does not wait, answered by writing something else. |
894
909
 
895
910
  Details where the table is not enough:
896
911
 
@@ -969,7 +984,7 @@ HTTPS the connection is also pinged (`sse.h2PingIntervalMs`,
969
984
  | `from_agent`, `from_session`, `agent_ask_call_id` | Older fields, derived from an `agent` origin. |
970
985
  | `attachments` | `{hash, name, mime, size}` of the files sent with the message. |
971
986
  | `attachment_descriptions` | Stored row only. The vision worker's description of each attachment the model could not see, one string per file. |
972
- | `from_system` | Older field, derived from the origin: `sentinel`, `tmux`, `browser`, `voice`, or for a wake its `about` (`a2a`, `subagent`, `job`, `system`). The shipped clients draw these as a divider, not as a bubble. |
987
+ | `from_system` | Older field, derived from the origin: `sentinel`, `tmux`, `browser`, `voice`, `peer`, or for a wake its `about` (`a2a`, `subagent`, `job`, `system`). The shipped clients draw these as a divider, not as a bubble. |
973
988
 
974
989
  `origin` is one of:
975
990
 
@@ -982,7 +997,8 @@ origin?:
982
997
  | { kind: 'tmux'; tmuxSession: string; tmuxKind?: string }
983
998
  | { kind: 'browser'; viewId: string; cause: 'handoff' | 'activity'; handoffId?: string }
984
999
  | { kind: 'voice'; callId?: string; consultId: string }
985
- | { kind: 'wake'; about: 'a2a' | 'subagent' | 'job' | 'system'; ref: string; depth?: number; cause?: string };
1000
+ | { kind: 'wake'; about: 'a2a' | 'subagent' | 'job' | 'system'; ref: string; depth?: number; cause?: string }
1001
+ | { kind: 'peer'; peer: string; contextId: string; taskId: string };
986
1002
  ```
987
1003
 
988
1004
  | `kind` | The turn was started by |
@@ -992,6 +1008,7 @@ origin?:
992
1008
  | `subagent` | A brief running in its own `sub-…` session. |
993
1009
  | `sentinel`, `tmux`, `browser`, `voice` | A trigger, a tmux session that became ready, a browser window handed back, a question from a voice call. |
994
1010
  | `wake` | Something the agent started earlier has finished: a late answer (`about: "a2a"`, `ref` is the call id), a sub-agent (`subagent`, task id) or a video (`job`, job id). |
1011
+ | `peer` | A task from another agent system over A2A ([A2A](a2a.md#taking-work-in)). |
995
1012
  | `wake` with `about: "system"` | somora itself speaks. `cause` names the occasion. Today that is `restart`, and the text begins `[system: restart]`. |
996
1013
 
997
1014
  Stored rows from old sessions may have no `origin`. Read the `from_*`
@@ -1016,7 +1033,7 @@ most notes have a readable `payload.text`.
1016
1033
  | `thread_recreated` | The Codex thread was gone. A new one was started with the history replayed. |
1017
1034
  | `tools_changed` | The agent's tool set changed, so a new Codex thread was started with the history replayed. |
1018
1035
  | `mcp_server_renamed` | The engine session was rebuilt (label `session restarted`). |
1019
- | `context_compacted` | The history was compacted after it outgrew the window. |
1036
+ | `context_compacted` | The history was compacted: by somora before a turn (`payload.reason: "auto"`, with `contextBefore`, `contextAfter` and `contextWindow` in tokens), during a turn, after the backend refused the prompt (`"context_overflow"`), or by the engine itself (`"engine_side"`). A compaction by hand has engine `somora`, see below. |
1020
1037
  | `context_trimmed` | The oldest tool results of the running turn were shortened to fit the window. The turn goes on. |
1021
1038
  | `attachments_unsupported` | The engine cannot pass attachments on. |
1022
1039
  | `session_model` | An agent switched this session's model (label `model switched`). |
@@ -1236,7 +1253,7 @@ Every model in `config.yaml`.
1236
1253
  ```json
1237
1254
  [ { "provider": "anthropic", "id": "claude-opus-4-20250514",
1238
1255
  "alias": "claude-opus-4-7", "engine": "claude-cli",
1239
- "contextWindow": 200000, "capabilities": ["vision", "reasoning"],
1256
+ "contextWindow": 200000, "capabilities": ["text", "image", "reasoning"],
1240
1257
  "ref": "claude-opus-4-7" } ]
1241
1258
  ```
1242
1259
 
@@ -1433,6 +1450,7 @@ and nothing is changed.
1433
1450
  |---|---|
1434
1451
  | `parts` | The pieces of `text` in prompt order: self-pointer, persona, team, tool reminder, wiki overview, skills, session, project. |
1435
1452
  | `tools` | The tools this agent would see on that session's model, and the size of their schemas. They travel beside the prompt, not in `text`. |
1453
+ | `tools.catalog` | `openai-compatible` only: what the request carries. `{mode: "catalog"|"all", direct, deferred, sentSchemaChars, listingChars}`, where `direct` and `deferred` are tool counts. In `catalog` mode the direct tools go with their schemas plus `tool_search` and `tool_call` (`sentSchemaChars`), and the deferred ones are named at the end of the system prompt (`listingChars`, not part of `text`); in `all` mode every tool goes direct. |
1436
1454
  | `budgets` | `promptBudgets` from the config. |
1437
1455
  | `notIncluded` | What a turn sends in addition. |
1438
1456
 
@@ -1714,7 +1732,7 @@ Starts a task and returns at once.
1714
1732
  |---|---|---|
1715
1733
  | `agent` | yes | The agent that does the work. |
1716
1734
  | `session` | yes | The session to run in. A slug that does not exist is created. An exact id that does not exist answers `404`. |
1717
- | `text` | yes | The brief. |
1735
+ | `text` | no | The brief. |
1718
1736
  | `parent_agent`, `parent_session` | no | Who is told when the task ends. Default: `from_agent`, else the agent itself. |
1719
1737
  | `from_agent` | no | Marks the turn as written by that agent. |
1720
1738
  | `subagent_depth` | no | Nesting depth. |
@@ -1791,10 +1809,13 @@ that had already ended are skipped. `404` for an unknown id.
1791
1809
  Agents of kind `builder` keep a mode, a phase, a plan file and a task
1792
1810
  list per session, and at most one open question to the person. The web
1793
1811
  client's task panel uses these routes, and so do the builder's own
1794
- tools `todo_write` and `plan_write`. `POST …/ask` (the `ask_user` tool)
1795
- serves every agent: a chat agent's question outside a turn a person
1796
- started returns `{answered: false}` at once, and waits 10 minutes by
1797
- default instead of 30.
1812
+ tools `todo_write` and `plan_write`.
1813
+
1814
+ `POST …/ask` (the `ask_user` tool) serves every agent. A builder waits,
1815
+ 30 minutes by default. For a chat agent: in a turn nobody watches it
1816
+ returns `{answered: false}` at once; in a turn a person started it
1817
+ returns at once and the question stays open; in a task from another
1818
+ system over A2A it waits, 10 minutes by default.
1798
1819
 
1799
1820
  ### `GET /agents/:agent/sessions/:session/builder`
1800
1821
 
@@ -1871,7 +1892,10 @@ that file. `400` when the write policy forbids the path.
1871
1892
  ### `POST /agents/:agent/sessions/:session/ask`
1872
1893
 
1873
1894
  Asks the person a question and **blocks** until they answer or the
1874
- wait runs out. Sends `question_asked`.
1895
+ wait runs out. Sends `question_asked`. A chat agent's question in a
1896
+ turn a person started does not block: it returns at once with
1897
+ `{asked: true, questionId, note}` and stays open on the session (see
1898
+ [the question routes](#get-agentsagentsessionssessionquestion)).
1875
1899
 
1876
1900
  | Body field | Required | Meaning |
1877
1901
  |---|---|---|
@@ -1879,7 +1903,7 @@ wait runs out. Sends `question_asked`.
1879
1903
  | `options` | yes | 2 to 6 of `{label, description?}`. |
1880
1904
  | `header` | no | A short title, at most 40 characters. |
1881
1905
  | `multiple` | no | `true` allows several answers. |
1882
- | `timeout_ms` | no | Default 30 minutes, at most 4 hours. |
1906
+ | `timeout_ms` | no | Default 30 minutes for a builder, 10 for a chat agent; at most 4 hours. |
1883
1907
 
1884
1908
  Returns `{answered, answers: string[], text?}`. A second question on
1885
1909
  the same session replaces the first, which returns unanswered.
@@ -2148,8 +2172,9 @@ Without `wait`: `{started: true, wait: false, message}`. With it:
2148
2172
 
2149
2173
  These routes move a grown wiki onto the folder template, in steps:
2150
2174
  plan, refine, approve, execute. Plan ids look like `20260929-104047`.
2151
- Each plan has a folder under `~/.somora/wiki-migration/<id>/`. All
2152
- write routes answer `400` when the wiki is off or the id is malformed.
2175
+ Each plan has a folder under `~/.somora/wiki-migration/<id>/`. The
2176
+ write routes answer `400` when the wiki is off (all but approve) or the
2177
+ id is malformed.
2153
2178
 
2154
2179
  ### `POST /wiki/migration/plan`
2155
2180
 
@@ -2502,7 +2527,8 @@ Whether image generation is on. Returns `{enabled: false}`, or
2502
2527
 
2503
2528
  ### `GET /images`
2504
2529
 
2505
- The generated images, newest first.
2530
+ Every generated media record, images and videos, newest first;
2531
+ `GET /media?kind=image` lists images only.
2506
2532
 
2507
2533
  | Query | Default | Meaning |
2508
2534
  |---|---|---|
@@ -2759,7 +2785,7 @@ session and on its stream like any other. The body is
2759
2785
  | Form field | Required | Meaning |
2760
2786
  |---|---|---|
2761
2787
  | `audio` | yes | The recording. |
2762
- | `agent` | yes | Agent name. When left out, the first agent is used. |
2788
+ | `agent` | no | Agent name. When left out, the alphabetically first agent is used. |
2763
2789
  | `session` | no | Default `main`. A slug that does not exist is created. An exact id that does not exist answers `404`. |
2764
2790
  | `voice`, `language` | no | For the spoken reply. Default: `tts.voice`, `tts.language`. |
2765
2791
 
@@ -2778,7 +2804,8 @@ A reply that is mostly code or tables is replaced by a short spoken
2778
2804
  note that points to the chat.
2779
2805
 
2780
2806
  `502` when transcription returned nothing, the agent gave no reply or
2781
- speech failed.
2807
+ speech failed. `404` for an unknown agent or an exact session id that
2808
+ does not exist.
2782
2809
 
2783
2810
  ### `assistant_audio` SSE event
2784
2811
 
@@ -3079,7 +3106,9 @@ All triggers, newest first.
3079
3106
  ```
3080
3107
 
3081
3108
  A check trigger (docs/sentinel.md, Check triggers) has a `check` source
3082
- and an evaluator of `ready`, or `decision` for a judged check:
3109
+ and an evaluator of `ready`, or `decision` for a judged check
3110
+ (`{type: "decision", questions, wake, perItem?}`; `perItem: true` judges
3111
+ each item of the data on its own):
3083
3112
 
3084
3113
  ```json
3085
3114
  { "source": { "type": "check", "description": "the model server answers on glm",
@@ -3105,7 +3134,7 @@ trigger carry `check`, read from its check state:
3105
3134
  | `checks`, `wakes` | Counted apart: most checks wake nobody. |
3106
3135
  | `errorsInARow` | Check errors since the last good check. |
3107
3136
  | `nextCheckAt` | Only while the trigger is active. |
3108
- | `last` | The last check: `ok`, then `ready`, `summary`, `dataPreview`, `final`, `decision`, or `error` and `errorClass`. |
3137
+ | `last` | The last check: `ok`, then `ready`, `summary`, `dataPreview`, `final`, `decision`, `warning`, or `error` and `errorClass`. With `perItem`, `decision.value` is the highest answer and `decision.detail` lists each item's. `warning`: a judged check without `perItem` got a list of several items. |
3109
3138
  | `lastDecision` | A judged check's last answer, kept when later checks bring no new data. |
3110
3139
  | `effectiveInterval` | Set when `config.yaml` raised the interval limit above the trigger's own interval. |
3111
3140
 
@@ -3133,6 +3162,7 @@ The fires of a trigger, newest first. `?limit=N`, default 50, at most
3133
3162
  | `error` | `error`. `stopped by the user` when a person stopped the turn. |
3134
3163
  | `skipped` | `skipReason`. `removed from the queue by the user` when a person removed the waiting fire. |
3135
3164
  | `updated` | `note`: what changed and by whom. A check trigger's new script or settings, not a fire. |
3165
+ | `judged` | `note`: what the decision model answered in a judged check, and whether it woke the agent. Only checks that asked the model, not a fire. |
3136
3166
 
3137
3167
  A check trigger that stops records an `error` entry starting with
3138
3168
  `check paused:`.
@@ -3171,7 +3201,9 @@ the same prompt as on a real fire. Returns `{ok: true, hint}`.
3171
3201
  For a check trigger it runs the script copy once instead (a dry run):
3172
3202
  nothing is saved, nobody is woken, the script's state folder is not
3173
3203
  touched. Returns `{ok, dryRun: {ok, art, ms, answer?, error?,
3174
- errorClass?, stderr?, decision?, verdict}}`.
3204
+ errorClass?, stderr?, decision?, items?, more?, warning?, verdict}}`.
3205
+ `items` (with `perItem`): `[{key, value, wake}]` or `[{key, error}]`
3206
+ per item; `more`: items over `sentinel.checks.maxItemsPerCheck`.
3175
3207
 
3176
3208
  ### `DELETE /sentinel/triggers/:id`
3177
3209
 
@@ -3213,10 +3245,11 @@ The tool's actions are `create`, `dry_run`, `update`, `list`, `get`,
3213
3245
  ## A2A endpoint
3214
3246
 
3215
3247
  somora's agents as A2A agents ([A2A](a2a.md#taking-work-in)). These
3216
- paths are the only ones the login key does not guard: the cards are
3217
- public, and the JSON-RPC endpoint checks the peer tokens of
3218
- `a2a.peers` (`Authorization: Bearer <token>`). Without peers, all of
3219
- them answer `404`.
3248
+ paths are the only data routes the login key does not guard: the
3249
+ cards are public, and the JSON-RPC endpoint checks the peer tokens of
3250
+ `a2a.peers` (`Authorization: Bearer <token>`). Without peers the cards
3251
+ and the endpoint answer `404`; `/a2a/files/<token>` links keep working
3252
+ until they expire.
3220
3253
 
3221
3254
  ### `GET /a2a/agents/:agent/.well-known/agent-card.json` · `GET /a2a/agents/:agent/.well-known/agent.json`
3222
3255
 
@@ -3371,13 +3404,17 @@ The configured systems, their agents and open connections.
3371
3404
  ### `GET /external/:system/badge`
3372
3405
 
3373
3406
  The badge image configured for a system (`badge:` with a png, svg or
3374
- webp path, at most 256 KB). `404` when the system has no badge image.
3407
+ webp path, at most 256 KB). `404` when the system has no badge image or
3408
+ the file is missing, `422` when it is larger than 256 KB or not a file.
3375
3409
 
3376
3410
  ### `GET /agents/:agent/sessions/:session/question`
3377
3411
 
3378
- The session's open question, or `{ "question": null }`. Used for
3379
- external agents' permission requests; a builder's `ask_user` question
3380
- shows here as well.
3412
+ The session's open question, or `{ "question": null }`: an external
3413
+ agent's permission request, a builder's `ask_user` question, or a
3414
+ question that does not wait. That last kind carries `async: true` and
3415
+ `expiresAt: 0`, and with several questions asked at once `parts`
3416
+ (`[{question, header?, options, multiple}]`, the first repeated at the
3417
+ top). It stays open between turns, after a reload and a restart.
3381
3418
 
3382
3419
  ```json
3383
3420
  { "question": { "id": "…", "question": "claw asks for permission: exec: rm -rf /tmp/x",
@@ -3394,6 +3431,14 @@ Returns `{ ok: true }`; every client of the session gets
3394
3431
  `question_answered`. `404` for an unknown session, or when no question
3395
3432
  with that id is open (answered already, or timed out).
3396
3433
 
3434
+ A question that does not wait takes the same body, or `parts` with one
3435
+ `{answers?, text?}` per question. The answer is sent as the person's
3436
+ next message, the way `POST /chat/send` sends a typed one: the chosen
3437
+ labels for one question, each question with its answer for several.
3438
+ Returns `{ ok: true, sent: true, turnId, text }`; `400` when nothing
3439
+ was chosen or typed. Any message the person sends to the session with
3440
+ `POST /chat/send` answers such a question too and removes it.
3441
+
3397
3442
  ## External MCP servers
3398
3443
 
3399
3444
  State and control of the external MCP servers from `mcp.servers` in
@@ -3405,12 +3450,14 @@ The state of each server.
3405
3450
 
3406
3451
  ```json
3407
3452
  { "enabled": true,
3408
- "servers": { "<name>": { "state": "connected", "toolCount": 12, "transport": "stdio",
3453
+ "servers": { "<name>": { "state": "connected", "toolCount": 12, "transport": "streamable-http",
3409
3454
  "lastConnectedAt": 1789299000000, "consecutiveFailures": 0 } } }
3410
3455
  ```
3411
3456
 
3412
3457
  `state` is `pending`, `connected`, `failed`, `needs-auth` or
3413
- `disabled`. `lastError` is added after a failure.
3458
+ `disabled`. `lastError` is added after a failure. With `needs-auth`,
3459
+ `loginHint` says how to log in again when the server's config knows
3460
+ it (the Claude Design preset does).
3414
3461
 
3415
3462
  ### `POST /mcp/servers/:name/reconnect`
3416
3463
 
package/docs/browser.md CHANGED
@@ -160,8 +160,9 @@ The wake reads:
160
160
  (navigation, clicks or typing) and handed it back to you.
161
161
  ```
162
162
 
163
- In the chat a wake shows as a centered divider, `browser · <agent> ·
164
- handed back` or `browser · <agent> · activity`. Messages carry
163
+ In the chat a wake shows as a centered divider, `browser · <window> ·
164
+ handed back` or `browser · <window> · activity`, with the window's id
165
+ without its `agent:` prefix. Messages carry
165
166
  `from_system: 'browser'`, like tmux and sentinel wakes.
166
167
 
167
168
  ## In the web client
package/docs/builder.md CHANGED
@@ -148,7 +148,7 @@ The caller returns at once. It is woken with the builder's report as an
148
148
  |---|---|
149
149
  | `task` | The complete order. Required. The builder sees nothing of the caller's conversation. |
150
150
  | `builder` | Name of the builder. May be left out when exactly one exists. With several, the caller picks by the role and description each one carries. |
151
- | `project` | Project to pin. Without one, name the repository in `task`. |
151
+ | `project` | Project to pin; its `workdir` becomes the working directory. Without it the builder does not build: unattended, it reports that the order needs a pinned project and stops; attended, it asks which project the work belongs to. |
152
152
  | `plan_path` | Absolute path of a plan the builder must read first. |
153
153
  | `done_criteria` | What "done" means, for example "tests green and the new column is printed". |
154
154
  | `report_path` | Absolute path the builder writes its report to, besides answering. |
@@ -196,10 +196,12 @@ one working copy would overwrite each other's files.
196
196
  A builder works where its session points: the `workdir` of the pinned
197
197
  project, else the agent's workspace.
198
198
 
199
- Without a pinned project folder, an attended builder is told to ask for
200
- the repository, or to create and pin the project itself with
199
+ A builder builds only in a pinned project. A folder named in the order
200
+ is not enough. Without a pin, an attended builder is told to ask which
201
+ project the work belongs to, or to create and pin it itself with
201
202
  `project_create` (with `workdir`) and `project_focus`. An unattended
202
- one is told to report that no project folder was given and to stop.
203
+ one writes nothing, reports that the order needs a pinned project and
204
+ stops.
203
205
 
204
206
  The pin holds while the builder works. Unpinning or switching the
205
207
  project during a running builder turn is refused. A first pin is
@@ -383,7 +385,7 @@ What a builder is offered by default. Everything else is off until
383
385
  `analyze_file` is offered only when a vision worker is configured and
384
386
  the builder's own model cannot see images.
385
387
 
386
- The three builder tools:
388
+ The builder's tools:
387
389
 
388
390
  | Tool | Parameters | What it does |
389
391
  |---|---|---|
@@ -391,7 +393,10 @@ The three builder tools:
391
393
  | `ask_user` | `question`, `options` (2 to 6, each `{label, description?}`), `header?`, `multiple?`, `timeout_ms?` | Asks in the task panel and waits. Returns `{answered, answers[], text?}`. |
392
394
  | `plan_write` | `content` | Writes the whole plan file. |
393
395
 
394
- A chat agent never gets these three, whatever its `agent.yaml` says.
396
+ A chat agent never gets `todo_write` and `plan_write`, whatever its
397
+ `agent.yaml` says. `ask_user` belongs to every agent ([Questions to
398
+ you](tools.md#questions-to-you)); for a builder it waits in the task
399
+ panel.
395
400
 
396
401
  ## Routes
397
402
 
@@ -405,7 +410,7 @@ is `GET /agents/:agent/sessions/:session/builder`.
405
410
  | `POST …/builder/go` | `{note?}` | 202 with `{state, turnId, callId?, wakes?}`. 409 `folder busy` when another builder turn holds the folder. |
406
411
  | `PUT …/todos` | `{todos: [{content, status, priority?}]}` | `{todos}`. Publishes `todo_updated`. Used by `todo_write`. |
407
412
  | `PUT …/plan` | `{content}` | `{path, bytes, archived?}`. Used by `plan_write`. |
408
- | `POST …/ask` | `{question, header?, options[], multiple?, timeout_ms?}` | Blocks, then `{answered, answers[], text?}`. Publishes `question_asked`. Used by `ask_user`. |
413
+ | `POST …/ask` | `{question, header?, options[], multiple?, timeout_ms?}` | A builder's question, or one in a task sent over A2A, blocks, then returns `{answered, answers[], text?}`. A chat agent's question in a turn a person started returns at once with `{asked: true, questionId, note}`. Publishes `question_asked`. Used by `ask_user`. |
409
414
  | `POST …/answer` | `{questionId, answers?, text?}` | `{ok}`. Publishes `question_answered`. |
410
415
  | `GET /builders` | | `{builders: [{name, role, description, busy[]}]}` |
411
416
  | `GET /builders/busy?workdir=…` | | `{workdir, busy}`, where `busy` is the claim or `null`. Without `workdir`: all claims. |
@@ -56,7 +56,7 @@ The system prompt is put together from eight parts, in this order:
56
56
  | 1 | Self-pointer: who the agent is, its paths and resources | resources or paths change in the config |
57
57
  | 2 | Persona: `SOUL.md`, `AGENTS.md`, `USER.md` | you edit one of the files |
58
58
  | 3 | Team block | `team.yaml` or the list of agents changes |
59
- | 4 | Tool reminder | never (constant text) |
59
+ | 4 | Tool reminder | constant, except the `ask_user` line, which is there only in a turn someone watches |
60
60
  | 5 | Wiki overview | never within a session |
61
61
  | 6 | Skills list | a skill is added, removed or its description edited |
62
62
  | 7 | This session | never within a session |
@@ -69,8 +69,11 @@ part most likely to change in the middle of a session.
69
69
  A sub-agent turn adds one note to part 1. Empty parts are left out: no
70
70
  team, no wiki, no pinned project.
71
71
 
72
- Tool definitions are not part of this text. They travel in the tool
73
- channel of the API and stay the same as long as the set of tools does.
72
+ Tool schemas travel in the API's tool channel. On `openai-compatible`
73
+ (catalog mode, the default) the tools not sent in full are listed by
74
+ name after part 8, and on `codex-cli` the developer instructions end
75
+ with the names of the deferred tools. Both change only when the set of
76
+ tools changes.
74
77
 
75
78
  ### The wiki overview is frozen
76
79
 
@@ -210,7 +213,8 @@ request, so the cache holds.
210
213
  | Changing `team.yaml`, adding or removing an agent | Once, from the team block on. |
211
214
  | Adding, removing or editing a skill | Once, from the skills list on. |
212
215
  | Switching or updating the session's project | Once, from the project block on. The parts before it stay cached. |
213
- | Changing the set of tools an agent sees | Once. Tool definitions sit in front of the conversation. |
216
+ | Changing the set of tools an agent sees | Once. Tool definitions, and the listing at the end of the system prompt, sit in front of the conversation. |
217
+ | A turn nobody watches (an agent's request, a Sentinel wake) after one a person started, or the reverse | From the tools on: `ask_user` and its line in the tool reminder are offered only when someone watches. |
214
218
  | A compaction on `openai-compatible` | Once. The summary joins the system message and the older messages are dropped. |
215
219
  | Switching the model or provider of a session | The new model starts with an empty cache. |
216
220
  | `memoryInjectMode: system` | Every turn. The system prompt changes with each recall. |