somora 2026.1012.11 → 2026.1014.5

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 (116) hide show
  1. package/README.md +16 -13
  2. package/config.example.yaml +36 -23
  3. package/docs/agents.md +35 -1
  4. package/docs/api.md +105 -9
  5. package/docs/browser.md +1 -1
  6. package/docs/decisions.md +24 -1
  7. package/docs/dream-phases.md +1 -1
  8. package/docs/index.md +5 -3
  9. package/docs/models.md +1 -1
  10. package/docs/security.md +19 -0
  11. package/docs/sentinel.md +394 -17
  12. package/docs/setup.md +19 -13
  13. package/docs/skills.md +1 -1
  14. package/docs/tools.md +9 -4
  15. package/docs/web.md +4 -2
  16. package/docs/wiki.md +1 -1
  17. package/package.json +1 -1
  18. package/src/browser/snapshot.ts +0 -7
  19. package/src/cli/{auth.ts → claude.ts} +69 -17
  20. package/src/cli/codex.ts +18 -4
  21. package/src/cli/setup.ts +1 -1
  22. package/src/cli/somora.ts +10 -4
  23. package/src/compaction/summarize.ts +0 -18
  24. package/src/config/reload.ts +22 -4
  25. package/src/config/types.ts +66 -1
  26. package/src/decisions/input.ts +61 -0
  27. package/src/dream/deep-prompts.ts +0 -3
  28. package/src/dream/lucid-prompt.ts +0 -3
  29. package/src/engine/claude-cli.ts +2 -2
  30. package/src/engine/codex-home.ts +24 -1
  31. package/src/engine/model-availability.ts +0 -4
  32. package/src/mcp/server.ts +13 -3
  33. package/src/memory/storage.ts +0 -6
  34. package/src/multimodal/blocks.ts +0 -28
  35. package/src/projects/store.ts +0 -5
  36. package/src/sentinel/check-create.ts +169 -0
  37. package/src/sentinel/check-dry-run.ts +147 -0
  38. package/src/sentinel/check-judge.ts +92 -0
  39. package/src/sentinel/check-logic.ts +208 -0
  40. package/src/sentinel/check-loop.ts +260 -0
  41. package/src/sentinel/check-runner.ts +303 -0
  42. package/src/sentinel/check-store.ts +141 -0
  43. package/src/sentinel/check-view.ts +55 -0
  44. package/src/sentinel/dispatcher.ts +45 -2
  45. package/src/sentinel/redact.ts +29 -0
  46. package/src/sentinel/scheduler.ts +47 -32
  47. package/src/sentinel/store.ts +5 -1
  48. package/src/sentinel/types.ts +97 -4
  49. package/src/server/ask-wait-graph.ts +0 -11
  50. package/src/server/builder-session.ts +0 -10
  51. package/src/server/claude-config-dir.ts +1 -1
  52. package/src/server/claude-credential-sync.ts +3 -3
  53. package/src/server/inbox-sources.ts +41 -1
  54. package/src/server/inbox.ts +1 -1
  55. package/src/server/index.ts +238 -6434
  56. package/src/server/prompt-assembly.ts +1 -1
  57. package/src/server/routes/abilities.ts +268 -0
  58. package/src/server/routes/agents.ts +107 -0
  59. package/src/server/routes/attachments.ts +119 -0
  60. package/src/server/routes/auth.ts +109 -0
  61. package/src/server/routes/browser.ts +301 -0
  62. package/src/server/routes/builder.ts +353 -0
  63. package/src/server/routes/chat.ts +1099 -0
  64. package/src/server/routes/decisions.ts +90 -0
  65. package/src/server/routes/dream.ts +193 -0
  66. package/src/server/routes/files.ts +234 -0
  67. package/src/server/routes/health.ts +103 -0
  68. package/src/server/routes/images.ts +266 -0
  69. package/src/server/routes/inbox.ts +47 -0
  70. package/src/server/routes/logs.ts +45 -0
  71. package/src/server/routes/mcp.ts +66 -0
  72. package/src/server/routes/media.ts +128 -0
  73. package/src/server/routes/memory.ts +109 -0
  74. package/src/server/routes/models.ts +91 -0
  75. package/src/server/routes/projects.ts +359 -0
  76. package/src/server/routes/sentinel.ts +116 -0
  77. package/src/server/routes/server.ts +279 -0
  78. package/src/server/routes/sessions.ts +621 -0
  79. package/src/server/routes/spawn.ts +312 -0
  80. package/src/server/routes/team.ts +125 -0
  81. package/src/server/routes/terminals.ts +275 -0
  82. package/src/server/routes/video.ts +87 -0
  83. package/src/server/routes/voice.ts +587 -0
  84. package/src/server/routes/wiki.ts +344 -0
  85. package/src/server/run-turn.ts +6 -2
  86. package/src/server/server-state.ts +21 -0
  87. package/src/server/session-workdir.ts +0 -12
  88. package/src/server/start-turn.ts +0 -4
  89. package/src/skills/env-scope.ts +9 -6
  90. package/src/tmux/attention-watcher.ts +2 -9
  91. package/src/tools/browser/ops.ts +8 -0
  92. package/src/tools/browser/tools.ts +2 -2
  93. package/src/tools/decision/tools.ts +12 -43
  94. package/src/tools/exec/allowlist.ts +1 -3
  95. package/src/tools/exec/blacklist.ts +0 -9
  96. package/src/tools/exec/local.ts +1 -1
  97. package/src/tools/gating.ts +45 -0
  98. package/src/tools/registry.ts +11 -0
  99. package/src/tools/sentinel/tools.ts +338 -61
  100. package/src/tools/types.ts +4 -0
  101. package/src/videogen/generate.ts +1 -10
  102. package/src/videogen/jobs.ts +1 -25
  103. package/src/videogen/runner.ts +0 -11
  104. package/web/dist/assets/index-BP3n2Q5o.css +1 -0
  105. package/web/dist/assets/{index-B29CLSq3.js → index-n8ft7qOa.js} +12 -12
  106. package/web/dist/assets/index-n8ft7qOa.js.map +1 -0
  107. package/web/dist/index.html +2 -2
  108. package/web-mobile/dist/assets/index-CqYMdu9X.css +1 -0
  109. package/web-mobile/dist/assets/{index-CThedP51.js → index-qa6yxobf.js} +3 -3
  110. package/web-mobile/dist/assets/index-qa6yxobf.js.map +1 -0
  111. package/web-mobile/dist/index.html +2 -2
  112. package/src/cli/tui/dream-glyphs.ts +0 -22
  113. package/web/dist/assets/index-B29CLSq3.js.map +0 -1
  114. package/web/dist/assets/index-Ca4V4IrW.css +0 -1
  115. package/web-mobile/dist/assets/index-CThedP51.js.map +0 -1
  116. package/web-mobile/dist/assets/index-Cl_8jQ12.css +0 -1
package/README.md CHANGED
@@ -44,23 +44,22 @@ models, your first agent, memory and HTTPS — details under
44
44
 
45
45
  ## See it
46
46
 
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>
47
+ <a href="docs/images/somora-web-dark-2026-10-12.png"><img src="docs/images/somora-web-dark-2026-10-12.png" alt="somora web client, dark theme: browser desktop with agent windows, two tmux terminals, the agent's browser, a builder plan and the taskbar" /></a>
48
+
49
+ <a href="docs/images/somora-web-light-2026-10-12.png"><img src="docs/images/somora-web-light-2026-10-12.png" alt="somora web client, light theme: the same desktop" /></a>
51
50
 
52
51
  <table>
53
52
  <tr>
54
53
  <td width="66%" valign="top">
55
- <img src="docs/images/somora-tui-2026-10-12.png" alt="somora TUI: the terminal client with its status line" />
54
+ <a href="docs/images/somora-tui-2026-10-12.png"><img src="docs/images/somora-tui-2026-10-12.png" alt="somora TUI: the terminal client with its status line" /></a>
56
55
  </td>
57
56
  <td width="34%" valign="top">
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" />
57
+ <a href="docs/images/somora-mobile-2026-10-12.png"><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" /></a>
59
58
  </td>
60
59
  </tr>
61
60
  </table>
62
61
 
63
- Browser desktop (dark or light), terminal, and installable phone app — all talking to the
62
+ Browser desktop in dark and light, terminal, and installable phone app — all talking to the
64
63
  same local server, the same agents, the same memory.
65
64
 
66
65
  ## Why somora
@@ -141,8 +140,11 @@ On top of chat and memory, each optional and off until configured:
141
140
  dictation and spoken replies ([docs/voice.md](docs/voice.md)).
142
141
  - **Projects** — bind a session to a real-world thing via a manifest of
143
142
  pointers the agent sees in its prompt ([docs/projects.md](docs/projects.md)).
144
- - **Sentinel** — time-based triggers (`at` / `every` / `daily` / `cron`)
145
- that wake an agent on a schedule ([docs/sentinel.md](docs/sentinel.md)).
143
+ - **Sentinel** — triggers that wake an agent on a schedule (`at` /
144
+ `every` / `daily` / `weekly` / `cron`) or when a small check script sees
145
+ something happen; a decision model can judge what the script fetched,
146
+ such as "a new mail that needs an answer today"
147
+ ([docs/sentinel.md](docs/sentinel.md)).
146
148
  - **External MCP servers** — one config entry, all engines see the tools,
147
149
  gateable per agent ([docs/mcp.md](docs/mcp.md)).
148
150
  - **Language servers** — with one installed, every file a builder
@@ -153,7 +155,8 @@ On top of chat and memory, each optional and off until configured:
153
155
  every engine ([docs/api.md → Steering](docs/api.md#steering)).
154
156
  - **Decision models** — agents ask a System One decision model (such as
155
157
  a self-hosted Clef) typed yes/no, choice and score questions about text
156
- or images, and get probabilities back ([docs/decisions.md](docs/decisions.md)).
158
+ or images, and get probabilities back. Scripts and other programs ask
159
+ through `POST /decisions/evaluate` ([docs/decisions.md](docs/decisions.md)).
157
160
 
158
161
  ## Requirements
159
162
 
@@ -170,7 +173,7 @@ Hard:
170
173
  - **tmux** — for the `tmux` tool (long-lived terminal sessions for agents)
171
174
  and the web tmux app.
172
175
  - **At least one LLM backend:** a Claude subscription (engine
173
- `claude-cli` — Claude Code is bundled, `somora auth login`); a ChatGPT
176
+ `claude-cli` — Claude Code is bundled, `somora claude login`); a ChatGPT
174
177
  subscription (engine `codex-cli` — Codex is bundled, `somora codex login`); a SuperGrok or
175
178
  Premium subscription (engine `grok-cli` — the Grok CLI is bundled, `somora grok login`); or any OpenAI-compatible HTTP
176
179
  server (Ollama, LM Studio, vLLM, oMLX, OpenRouter, …).
@@ -278,7 +281,7 @@ ONNXRUNTIME_NODE_INSTALL=skip npm install -g somora \
278
281
  --allow-scripts=cpu-features,esbuild,fsevents,node-pty,onnxruntime-node,protobufjs,somora,ssh2
279
282
 
280
283
  # 3. Log in to at least one LLM backend (pick one or more)
281
- somora auth login # Claude subscription; Claude Code is bundled
284
+ somora claude login # Claude subscription; Claude Code is bundled
282
285
  somora codex login # ChatGPT subscription; Codex is bundled
283
286
  somora grok login # SuperGrok or Premium subscription; the Grok CLI is bundled
284
287
  # local models: run Ollama / LM Studio / oMLX and add the endpoint to
@@ -353,7 +356,7 @@ shapes but **not yet tested against a live account**.
353
356
  │
354
357
  ├─ Dream system REM session → memory · Deep memory → wiki · Lucid wiki review
355
358
  │
356
- ├─ Sentinel ~/.somora/sentinel/triggers.json — time-based fires as agent turns
359
+ ├─ Sentinel ~/.somora/sentinel/triggers.json — time and check-script fires as agent turns
357
360
  │
358
361
  ├─ Optional realtime voice call · Chromium per agent · image + video generation
359
362
  │
@@ -481,12 +481,9 @@ providers:
481
481
  # input_video: { field: video_url, min: 1, max: 1, maxSeconds: 30 }
482
482
  # character_image: { field: image_url, min: 1, max: 1 }
483
483
  #
484
- # # ⚠ NOT YET VERIFIED against a live endpoint — somora has had no
485
- # # Vertex access to test with. The dialect is written from Google's
486
- # # published shape (operation name instead of a job id, POST to poll,
487
- # # result inside the poll response) so that adding Veo is a config
488
- # # entry rather than a refactor. Do not assume it works until someone
489
- # # has run it once.
484
+ # # Written from Google's published shape (operation name instead of a
485
+ # # job id, POST to poll, result inside the poll response); not yet run
486
+ # # against a live Vertex endpoint.
490
487
  # - name: veo
491
488
  # provider: vertex
492
489
  # model: veo-3
@@ -522,7 +519,7 @@ providers:
522
519
  # - slug: firma2
523
520
  # label: Firma Zwei
524
521
 
525
- # Compaction tunables (DECISION #21). All optional — built-in defaults apply
522
+ # Compaction tunables. All optional — built-in defaults apply
526
523
  # when omitted. SOMORA_COMPACTION_* env vars override these for ops/CI.
527
524
  # compaction:
528
525
  # triggerRatio: 0.8 # compact at 80% of the input budget (window minus the answer)
@@ -570,10 +567,17 @@ providers:
570
567
  # Optional per agent: ~/.somora/agents/<name>/VOICE.md replaces the
571
568
  # character derived from the persona; the honesty rules always stay.
572
569
 
573
- # Memory-Layer tunables (DECISIONS #25–#27). All optional. Per-agent
574
- # overrides can live in agent.yaml later. (Phase 2-Stufe-B — not yet
575
- # wired into the runtime.)
576
- # Agent-loop tunables (DECISION #31 + #37). Apply to engines that run
570
+ # Sessions started as sub-agents (spawn_subagent) never get these tools,
571
+ # whatever persona and model: same forms as agent.yaml tools.deny (a name,
572
+ # toolset:<family>, prefix*), and they beat every allow. The default takes
573
+ # away agent_ask: a sub's answer reaches its parent on its own. With
574
+ # deny: [] a sub that also reports via agent_ask sends the parent's reply
575
+ # back to the parent as a follow-up (an echo). docs/agents.md.
576
+ # subagents:
577
+ # tools:
578
+ # deny: [agent_ask, agent_ask_result, agent_ask_cancel]
579
+
580
+ # Agent-loop tunables. Apply to engines that run
577
581
  # their own tool-call loop — currently openai-compatible — for the per-
578
582
  # tool-call race. The longTask* values ALSO inform CLI-engine tools
579
583
  # (subagent_result, agent_ask) which run inside MCP children, so all
@@ -588,7 +592,8 @@ providers:
588
592
  #
589
593
  # When a long-task hits its timeout, the tool returns state:"pending"
590
594
  # (NOT an error) — the sub keeps running, the caller can retry with a
591
- # higher timeout_ms or check status later. See DECISION #37.
595
+ # higher timeout_ms or check status later.
596
+ #
592
597
  # agentLoop:
593
598
  # maxRounds: 8 # max tool-call rounds per turn (1..100).
594
599
  # # Most conversations finish in 1-3;
@@ -725,7 +730,7 @@ providers:
725
730
  # # account — somora then never touches either
726
731
  # # credentials file. See docs/setup.md
727
732
  # # "Isolated Claude config dir". Inspect with
728
- # # `somora auth status`.
733
+ # # `somora claude status`.
729
734
 
730
735
  # codex-cli engine tunables. Same posture as claudeCli — surface codex-
731
736
  # internal limits so they're configurable here. Applied as thread config
@@ -898,22 +903,30 @@ providers:
898
903
  # # everything private is refused otherwise.
899
904
  # fetchAllowPrivate: [wiki.home.lan, 10.0.0.0/24]
900
905
 
901
- # Sentinel — proactive trigger runtime (time-based fires that wake
902
- # agents on a schedule, see docs/sentinel.md). Only knob today is how
903
- # long completed `at`-triggers (one-shot fires that have already run)
904
- # linger in the registry before they're garbage-collected.
906
+ # Sentinel — wakes agents on a schedule, or when a check script sees that
907
+ # something happened (docs/sentinel.md). All optional.
905
908
  #
906
- # completedRetentionDays:
907
- # Days a `completed` trigger and its history are kept after the
908
- # fire's lastFireAt timestamp. The scheduler sweeps at boot and on
909
- # each daily re-arm tick; older entries get auto-deleted. Set to 0
910
- # to disable GC entirely (manual cleanup only). Default 7.
909
+ # completedRetentionDays: days a fired one-shot (an `at` trigger or a
910
+ # `once` check) and its history are kept; 0 turns the cleanup off.
911
+ # Needs a restart.
912
+ # checks: limits for check triggers. A config reload is enough; they
913
+ # apply from the next check.
911
914
  # sentinel:
912
915
  # completedRetentionDays: 7
916
+ # checks:
917
+ # minIntervalOnceMs: 15000 # shortest interval of a once check
918
+ # minIntervalMs: 60000 # shortest interval of a watch check
919
+ # maxDeadlineMs: 86400000 # a once check's deadline, at most 24 h away
920
+ # timeoutMs: 30000 # how long one check may run
921
+ # maxTimeoutMs: 120000 # the most a trigger may set
922
+ # maxOutputBytes: 65536 # output kept; more is a check error
923
+ # maxConcurrent: 4 # checks running at once, all triggers
924
+ # errorStreak: 3 # check errors in a row before it stops
925
+ # maxWakesPerDay: 24 # wakes per check trigger and UTC day
913
926
 
914
927
  # External MCP servers (docs/mcp.md). somora connects as MCP client,
915
928
  # imports the servers' tools and offers them to every engine next to the
916
- # built-in tools, namespaced `mcp__<server>__<tool>`. Phase 1 supports
929
+ # built-in tools, namespaced `mcp__<server>__<tool>`. Supported:
917
930
  # remote HTTP servers (streamable-http, automatic SSE fallback) with
918
931
  # static header auth; header values expand `${VAR}` / `${VAR:-default}`
919
932
  # from the server process env at connect time.
package/docs/agents.md CHANGED
@@ -394,7 +394,8 @@ check.
394
394
  ## Sub-agents
395
395
 
396
396
  `spawn_subagent` delegates a sealed task. The sub runs in a fresh
397
- session of the target agent, with normal memory, tools and thinking,
397
+ session of the target agent, with normal memory, tools and thinking
398
+ (less what [subagents.tools.deny](#what-a-sub-does-not-get) takes away),
398
399
  and returns a final answer. The session is named
399
400
  `sub-<parent>-<timestamp>`, or `sub-self-…` for a clone of the caller,
400
401
  and stays visible in the session list with a "sub from" marker.
@@ -428,6 +429,38 @@ A `wait: true` that runs out is not a failure. The wait is just under
428
429
  returns `ok: false, wait: "sync", state: "pending"` with the `task_id`.
429
430
  The sub keeps running and the parent is woken when it finishes.
430
431
 
432
+ ### What a sub does not get
433
+
434
+ A session started as a sub-agent never gets the tools listed under
435
+ `subagents.tools.deny` in `config.yaml`, whatever persona and model it
436
+ runs with. By default these are `agent_ask`, `agent_ask_result` and
437
+ `agent_ask_cancel`. A sub's final answer reaches its parent on its own,
438
+ so it has nothing to send that way.
439
+
440
+ ```yaml
441
+ subagents:
442
+ tools:
443
+ deny: [agent_ask, agent_ask_result, agent_ask_cancel] # the default
444
+ ```
445
+
446
+ - The entries take the same forms as `tools.deny` in `agent.yaml`: a
447
+ tool name, `toolset:<family>`, or a prefix ending in `*`.
448
+ - They beat every rule of the agent, an `allow` included.
449
+ - They hold for the whole session, also for wake turns and for
450
+ messages a person types into it later.
451
+ - Starting further subs stays possible.
452
+ - A change applies to the next turn, without a restart.
453
+ - A model that calls a listed tool anyway gets "not available in a
454
+ sub-agent session".
455
+ - An entry that names no tool, most likely a typo, is reported in the
456
+ server log and in the web client's inbox. The rest of the list
457
+ applies.
458
+
459
+ > **Warning:** With `deny: []` a sub may use `agent_ask` again. A sub
460
+ > that also sends its report to its parent that way makes the parent's
461
+ > reply come back to the parent as a follow-up: an echo, one extra turn
462
+ > for nothing.
463
+
431
464
  ### Checking on a sub
432
465
 
433
466
  | Tool | What it returns |
@@ -703,6 +736,7 @@ an `openai-compatible` provider.
703
736
  | `agentLoop.longTaskMaxTimeoutMs` | `1800000` | Longest wait. |
704
737
  | `agentLoop.wakeGraceMs` | `3000` | Delay before a wake turn. 0 to 60000. |
705
738
  | `agentLoop.toolUsageReminder` | `true` | The tool reminder in the prompt. |
739
+ | `subagents.tools.deny` | `[agent_ask, agent_ask_result, agent_ask_cancel]` | Tools a sub-agent session never gets. See [What a sub does not get](#what-a-sub-does-not-get). |
706
740
  | `promptBudgets.personaFileChars` | `8000` | Budget for each of `AGENTS.md`, `SOUL.md`, `USER.md`. |
707
741
  | `promptBudgets.personaTotalChars` | `14000` | Budget for the three together. |
708
742
  | `promptBudgets.teamBlockChars` | `3000` | Budget for the team block. |
package/docs/api.md CHANGED
@@ -199,7 +199,8 @@ The running version and what the daily update check found.
199
199
  What the web client's inbox shows: a newer version, somora.ai's note,
200
200
  and conditions that need a person (a broken `config.yaml`, an expired
201
201
  login, the certificate, failing dream runs, a tool server or model
202
- gone for a day).
202
+ gone for a day, a Sentinel check that stopped or used up its wakes for
203
+ the day, a `subagents.tools.deny` entry that names no tool).
203
204
 
204
205
  ```json
205
206
  { "entries": [ { "key": "config", "kind": "config", "level": "important",
@@ -210,8 +211,8 @@ gone for a day).
210
211
 
211
212
  | Field | Meaning |
212
213
  |---|---|
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`. |
214
+ | `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>`, `sentinel:<triggerId>`, `config:subagents-deny`. |
215
+ | `kind` | `update`, `news`, `config`, `login`, `tls`, `dream`, `mcp`, `model`, `sentinel`. |
215
216
  | `level` | `info`, `warning`, `important`. |
216
217
  | `title`, `text`, `url?` | Plain text. `url` is `https://` only. |
217
218
  | `firstSeen`, `lastSeen`, `count` | Epoch ms; `count` counts events, a checked state stays `1`. |
@@ -296,7 +297,7 @@ Top-level blocks:
296
297
 
297
298
  | Block | Meaning |
298
299
  |---|---|
299
- | `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 auth status`. |
300
+ | `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`. |
300
301
  | `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. |
301
302
  | `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. |
302
303
 
@@ -1208,6 +1209,48 @@ Every model in `config.yaml`.
1208
1209
  Forgets every "unavailable" mark, so the first-choice models are tried
1209
1210
  again. Returns `{ok: true, cleared, retryUnavailableMinutes}`.
1210
1211
 
1212
+ ### `POST /decisions/evaluate`
1213
+
1214
+ Asks the configured decision model, the same one the `decision_evaluate`
1215
+ tool uses, for scripts, skills and other programs. It needs the login
1216
+ key like every route. The body is the tool's input, with images as
1217
+ base64 instead of file paths.
1218
+
1219
+ | Body field | Required | Meaning |
1220
+ |---|---|---|
1221
+ | `state` | yes | What the questions are about: text, a JSON object or array. Only this is evaluated. |
1222
+ | `questions` | yes | Question id → `{type: "boolean"\|"choice"\|"score", instructions?, criteria?}`, 1 to 256. Same rules as the tool. |
1223
+ | `images` | no | Up to 4 images as base64, with or without a `data:image/…;base64,` prefix. Only for a model with the `image` capability. |
1224
+
1225
+ ```bash
1226
+ curl -H "Authorization: Bearer $(somora key)" -X POST $BASE/decisions/evaluate \
1227
+ -H 'Content-Type: application/json' \
1228
+ -d '{"state":["Invoice overdue, pay by tonight","Newsletter"],
1229
+ "questions":{"urgent":{"type":"boolean","instructions":"Does any of these need an answer today?"}}}'
1230
+ ```
1231
+
1232
+ A success is a `200` with the result the decision models page
1233
+ describes (`status: "ok"`, `answers`, `usage`). When the decision
1234
+ model could not answer, the response keeps the tool's `reason` and
1235
+ `guidance` and adds `error`.
1236
+
1237
+ A request somora refuses before asking
1238
+ (a body that does not validate, bad base64, an unusable image, over
1239
+ 24 MB) gets only `error`.
1240
+
1241
+ Images are PNG, JPEG or WebP, at most 4 MB
1242
+ and 16 megapixels each after scaling and 8 MB together. The status
1243
+ code follows the reason:
1244
+
1245
+ | Status | Reasons |
1246
+ |---|---|
1247
+ | `400` | A body that does not validate, an image that cannot be used, `images-unsupported`, `unsupported-input`. |
1248
+ | `413` | `too-long`, `truncated`, or a body over 24 MB. |
1249
+ | `429` | `rate-limited`. |
1250
+ | `502` | `authentication`, `not-ready`, `transport`, `invalid-response`. |
1251
+ | `503` | `not-configured`. |
1252
+ | `504` | `deadline`. |
1253
+
1211
1254
  ### `GET /agents/:agent/sessions/:session/model`
1212
1255
 
1213
1256
  The model the session's next turn will use.
@@ -2835,7 +2878,8 @@ window.
2835
2878
  | `input` | yes | The tool's arguments, for example `{"op": "open", "url": "…"}` or `{"op": "snapshot", "tab": "…"}`. |
2836
2879
 
2837
2880
  Returns the tool's result object (`ok`, `error`, `hint`, `tab`,
2838
- `snapshot` and so on). A refusal by the tool is still a `200`. `400`
2881
+ `snapshot` and so on). A refusal by the tool is still a `200`, and so
2882
+ is an unknown `op`: `ok: false` with the valid ones in `hint`. `400`
2839
2883
  without an `input.op`, `404` for an unknown agent.
2840
2884
 
2841
2885
  ### `POST /browser/:id/restart`
@@ -2927,8 +2971,8 @@ older picture is refused.
2927
2971
 
2928
2972
  ## Sentinel
2929
2973
 
2930
- Sentinel wakes agents on a schedule. These routes list and manage the
2931
- triggers. The same operations are available to agents as the `sentinel`
2974
+ Sentinel wakes agents on a schedule, or when a check script sees that
2975
+ something happened. These routes list and manage the triggers. The same operations are available to agents as the `sentinel`
2932
2976
  tool.
2933
2977
 
2934
2978
  ### `GET /sentinel/triggers`
@@ -2954,6 +2998,37 @@ All triggers, newest first.
2954
2998
  "errorStreak": 0, "nextFireAt": "2026-05-18T08:00:00.000Z" } ] }
2955
2999
  ```
2956
3000
 
3001
+ A check trigger (docs/sentinel.md, Check triggers) has a `check` source
3002
+ and an evaluator of `ready`, or `decision` for a judged check:
3003
+
3004
+ ```json
3005
+ { "source": { "type": "check", "description": "the model server answers on glm",
3006
+ "interval": "15s", "mode": "once", "deadline": "2026-05-17T13:00:00.000Z",
3007
+ "script": { "file": "check.py", "lang": "python", "sha256": "…" } },
3008
+ "evaluator": { "type": "ready" } }
3009
+ ```
3010
+
3011
+ A check trigger has no `nextFireAt`. Instead the list and the single
3012
+ trigger carry `check`, read from its check state:
3013
+
3014
+ ```json
3015
+ "check": { "checks": 412, "wakes": 3, "errorsInARow": 0,
3016
+ "nextCheckAt": "2026-05-17T12:14:30.000Z",
3017
+ "last": { "at": "2026-05-17T12:14:15.000Z", "ms": 104, "ok": true,
3018
+ "ready": false, "summary": "profile is qwen, switching" },
3019
+ "lastDecision": { "at": "…", "question": "urgent", "value": 0.07,
3020
+ "detail": "probability of yes, wakes from 0.8" } }
3021
+ ```
3022
+
3023
+ | Field | Meaning |
3024
+ |---|---|
3025
+ | `checks`, `wakes` | Counted apart: most checks wake nobody. |
3026
+ | `errorsInARow` | Check errors since the last good check. |
3027
+ | `nextCheckAt` | Only while the trigger is active. |
3028
+ | `last` | The last check: `ok`, then `ready`, `summary`, `dataPreview`, `final`, `decision`, or `error` and `errorClass`. |
3029
+ | `lastDecision` | A judged check's last answer, kept when later checks bring no new data. |
3030
+ | `effectiveInterval` | Set when `config.yaml` raised the interval limit above the trigger's own interval. |
3031
+
2957
3032
  ### `GET /sentinel/triggers/:id`
2958
3033
 
2959
3034
  One trigger as `{trigger}`.
@@ -2977,11 +3052,27 @@ The fires of a trigger, newest first. `?limit=N`, default 50, at most
2977
3052
  | `success` | `taskId` |
2978
3053
  | `error` | `error`. `stopped by the user` when a person stopped the turn. |
2979
3054
  | `skipped` | `skipReason`. `removed from the queue by the user` when a person removed the waiting fire. |
3055
+ | `updated` | `note`: what changed and by whom. A check trigger's new script or settings, not a fire. |
3056
+
3057
+ A check trigger that stops records an `error` entry starting with
3058
+ `check paused:`.
2980
3059
 
2981
3060
  `catchUp: true` marks a fire made up for after a restart, `testMode:
2982
3061
  true` one started through the test route. `404` once the trigger is
2983
3062
  deleted.
2984
3063
 
3064
+ ### `GET /sentinel/triggers/:id/script`
3065
+
3066
+ A check trigger's script copy, read only.
3067
+
3068
+ ```json
3069
+ { "file": "check.py", "lang": "python", "sha256": "…", "text": "#!/usr/bin/env python3\n…", "matches": true }
3070
+ ```
3071
+
3072
+ `matches: false` means the copy was changed outside somora; the
3073
+ trigger stops at its next check. A missing copy answers without `text`
3074
+ and with `error`. `400` for a time trigger, `404` for an unknown id.
3075
+
2985
3076
  ### `POST /sentinel/triggers/:id/pause`
2986
3077
 
2987
3078
  Pauses a trigger until it is resumed. Returns `{ok: true}`.
@@ -2997,6 +3088,11 @@ computed.
2997
3088
  Fires a trigger now, ignoring cooldown and daily cap. The agent gets
2998
3089
  the same prompt as on a real fire. Returns `{ok: true, hint}`.
2999
3090
 
3091
+ For a check trigger it runs the script copy once instead (a dry run):
3092
+ nothing is saved, nobody is woken, the script's state folder is not
3093
+ touched. Returns `{ok, dryRun: {ok, art, ms, answer?, error?,
3094
+ errorClass?, stderr?, decision?, verdict}}`.
3095
+
3000
3096
  ### `DELETE /sentinel/triggers/:id`
3001
3097
 
3002
3098
  Removes a trigger and its history. Returns `{ok: true}`, or `404` when
@@ -3031,8 +3127,8 @@ curl -H "Authorization: Bearer $KEY" -X POST $BASE/agents/<your-agent>/tools/sen
3031
3127
  }'
3032
3128
  ```
3033
3129
 
3034
- The tool's actions are `create`, `list`, `get`, `pause`, `resume`,
3035
- `delete`, `test`, `history` and `purge_completed`.
3130
+ The tool's actions are `create`, `dry_run`, `update`, `list`, `get`,
3131
+ `pause`, `resume`, `delete`, `test`, `history` and `purge_completed`.
3036
3132
 
3037
3133
  ## External MCP servers
3038
3134
 
package/docs/browser.md CHANGED
@@ -431,7 +431,7 @@ that process.
431
431
  | `GET /browser/stream` | The same list as server-sent events. A `browsers` event at once and on every change. |
432
432
  | `POST /browser/:id/control` | Body `{"mode":"human"}` takes over. `{"mode":"agent"}` hands back. Optional `handoffId` and `by`. |
433
433
  | `POST /browser/:id/restart` | Starts a stopped browser again with a blank page. |
434
- | `POST /browser/op` | Runs a tool operation. Body `{agent, session, input}`. |
434
+ | `POST /browser/op` | Runs a tool operation. Body `{agent, session, input}`. An unknown `input.op` answers `ok: false` with the valid ops in `hint`. |
435
435
  | `GET /browser/attach` | WebSocket for the live picture and input. Query `view`, optional `tab` and `viewer`. |
436
436
 
437
437
  With `browser.enabled` off, `GET /browser/status` answers
package/docs/decisions.md CHANGED
@@ -15,6 +15,9 @@ choices, or a position on a scale. somora gives agents a tool for it,
15
15
  reading each one.
16
16
  - **Images, when the model reads them.** An agent can ask "is there a red
17
17
  car in this photo?" about a picture it was sent or took itself.
18
+ - **Checks that judge for you.** A Sentinel check trigger can hand
19
+ what its script fetched to the decision model and wake the agent
20
+ only when the answer passes a threshold ([Sentinel](sentinel.md#judged-checks)).
18
21
  - **No silent cut-offs.** An input over the limit is refused with the
19
22
  token count, never evaluated in part.
20
23
 
@@ -38,6 +41,16 @@ Reload the config or restart the server. Every agent then has
38
41
  `decision_evaluate`, unless you switch it off for an agent in the
39
42
  Abilities window. Without a `decisions.model`, no agent sees the tool.
40
43
 
44
+ The tool's description tells agents when it beats their own judgement:
45
+ sorting or checking more than a handful of similar items, a check that
46
+ comes back and should answer the same way each time, or a probability
47
+ to compare against a threshold. For a single decision in a conversation
48
+ they decide themselves.
49
+
50
+ Agents seldom reach for it unprompted, so name it in a task or in the
51
+ persona of an agent with such a job, for example "sort new mail with
52
+ decision_evaluate".
53
+
41
54
  ## Which models work
42
55
 
43
56
  somora speaks the System One API: `POST <baseUrl>/v1/systemone`. The
@@ -167,11 +180,19 @@ A result is either `ok` or `unavailable`. An unavailable result names a
167
180
  There is no automatic fallback to another model. The agent carries on
168
181
  without the answer or tries again later.
169
182
 
183
+ ## From scripts and skills
184
+
185
+ A script or skill asks the same model with `POST /decisions/evaluate`:
186
+ the tool's input as JSON, images as base64, the login key in the
187
+ `Authorization` header (`$(somora key)` on the server). The answer is
188
+ the result above, with an HTTP status that follows the reason. The API
189
+ reference lists the details.
190
+
170
191
  ## Settings
171
192
 
172
193
  ```yaml
173
194
  decisions:
174
- model: "" # the entry in use; empty turns the tool off
195
+ model: "" # the entry in use; empty turns the tool and judged checks off
175
196
  models: []
176
197
  ```
177
198
 
@@ -194,5 +215,7 @@ and the questions are not logged.
194
215
 
195
216
  - [Image handling](image-handling.md): which image file an agent is shown and which it hands on
196
217
  - [Models](models.md): the models somora was run with, decision models included
218
+ - [API](api.md): `POST /decisions/evaluate`
219
+ - [Sentinel](sentinel.md#judged-checks): checks whose data the decision model judges
197
220
  - [Tools](tools.md): every tool, and how to switch tools off per agent
198
221
  - [Agents](agents.md): the Abilities window and per-agent settings
@@ -1,4 +1,4 @@
1
- # Dream Phases
1
+ # Dream phases
2
2
 
3
3
  While you are not chatting, somora tidies up what was said. Three
4
4
  background jobs, called REM, Deep and Lucid, turn conversations into
package/docs/index.md CHANGED
@@ -44,7 +44,8 @@ takes about ten minutes. [Setup](setup.md) explains each step.
44
44
  | give agents long-term memory | [Memory](memory.md), [Wiki](wiki.md) and [Dream phases](dream-phases.md) |
45
45
  | talk instead of type | [Voice](voice.md) and [Realtime voice](realtime-voice.md) |
46
46
  | have agents make images or video | [Image generation](imagegen.md) and [Video generation](videogen.md) |
47
- | have agents act on a schedule | [Sentinel](sentinel.md) |
47
+ | have agents act on a schedule or when something happens | [Sentinel](sentinel.md) |
48
+ | let a model judge items for scripts and checks | [Decision models](decisions.md) |
48
49
  | know what is exposed and to whom | [Security](security.md) |
49
50
  | build my own client | [HTTP API](api.md) |
50
51
 
@@ -63,7 +64,8 @@ takes about ten minutes. [Setup](setup.md) explains each step.
63
64
  | **resource** | Another machine reached over SSH. File, shell and tmux tools can target it. |
64
65
  | **skill** | A Markdown how-to the agent loads when the situation calls for it. |
65
66
  | **tool** | Something an agent can call: read a file, run a command, search the web, ask another agent. |
66
- | **sentinel** | A trigger that starts an agent turn on a schedule. |
67
+ | **sentinel** | A trigger that starts an agent turn on a schedule, or when a small check script sees that something happened. |
68
+ | **decision model** | A small model that answers typed questions (yes/no, choice, score) about some data. Agents, scripts and Sentinel checks ask it. |
67
69
 
68
70
  ## After the first chat
69
71
 
@@ -102,7 +104,7 @@ takes about ten minutes. [Setup](setup.md) explains each step.
102
104
  | [Team](team.md) | Org chart for agents | Telling every agent who is who and who to involve |
103
105
  | [Builder agents](builder.md) | The builder kind | An agent that builds software: plan, Go, build, with a task panel and questions |
104
106
  | [Projects](projects.md) | Concept and workflow | Pinning a working set to a session |
105
- | [Sentinel](sentinel.md) | Trigger runtime | Scheduling proactive agent work |
107
+ | [Sentinel](sentinel.md) | Trigger runtime | Waking agents on a schedule or when a check script sees a change |
106
108
 
107
109
  ### Memory
108
110
 
package/docs/models.md CHANGED
@@ -60,7 +60,7 @@ pull requests.
60
60
  ## Claude Code subscription
61
61
 
62
62
  Engine `claude-cli`. It runs through the Claude Agent SDK on your
63
- `claude login`. There is no API key and no sampling: the CLI does not
63
+ Claude login (`somora claude login`). There is no API key and no sampling: the CLI does not
64
64
  expose sampling parameters.
65
65
 
66
66
  ```yaml
package/docs/security.md CHANGED
@@ -191,6 +191,25 @@ The shell inherits the server's environment, including what
191
191
  unless the agent passes `inherit_agent_env: true`. A script that calls
192
192
  somora's API takes the key from `somora key`.
193
193
 
194
+ ### Sentinel check scripts
195
+
196
+ An agent with the `sentinel` tool can leave a script behind that the
197
+ server runs on its own, every few seconds to minutes, while nobody
198
+ watches. The script runs as the somora user in the agent's workspace,
199
+ with the skill secrets of the programs it names.
200
+
201
+ When the trigger is
202
+ created, a shell script is checked against the commands `exec` blocks,
203
+ and a script in any language that restarts, stops or updates somora is
204
+ refused; nothing is checked while it runs, and Python or JavaScript
205
+ scripts are not checked against the `exec` list at all. somora runs a
206
+ copy and checks its fingerprint, so a later edit of the file does not
207
+ change what runs.
208
+
209
+ Take the tool away with
210
+ `tools.deny: ['sentinel']` where an agent should not leave anything
211
+ running ([Sentinel](sentinel.md#check-triggers)).
212
+
194
213
  ### Files
195
214
 
196
215
  | Rule | Paths |