somora 2026.1007.2 → 2026.1008.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 (95) hide show
  1. package/README.md +23 -17
  2. package/bin/node-version.d.mts +3 -0
  3. package/bin/node-version.mjs +42 -1
  4. package/bin/preinstall-check.mjs +55 -0
  5. package/bin/somora.mjs +7 -1
  6. package/config.example.yaml +24 -9
  7. package/docs/agents.md +12 -8
  8. package/docs/api.md +39 -11
  9. package/docs/builder.md +1 -2
  10. package/docs/cache-strategy.md +2 -2
  11. package/docs/compaction.md +10 -9
  12. package/docs/decisions.md +198 -0
  13. package/docs/dream-phases.md +13 -4
  14. package/docs/files.md +6 -0
  15. package/docs/image-handling.md +104 -0
  16. package/docs/index.md +3 -1
  17. package/docs/lsp.md +2 -2
  18. package/docs/mcp.md +12 -7
  19. package/docs/mobile.md +5 -3
  20. package/docs/models.md +51 -11
  21. package/docs/security.md +24 -13
  22. package/docs/setup.md +41 -15
  23. package/docs/skills.md +19 -3
  24. package/docs/thinking.md +5 -5
  25. package/docs/tools.md +60 -21
  26. package/docs/web.md +4 -1
  27. package/package.json +39 -28
  28. package/src/attachments/store.ts +4 -4
  29. package/src/cli/auth.ts +1 -1
  30. package/src/cli/grok.ts +53 -0
  31. package/src/cli/server-call.ts +1 -1
  32. package/src/cli/setup.ts +37 -2
  33. package/src/cli/somora.ts +25 -6
  34. package/src/cli/tui/header.tsx +5 -16
  35. package/src/cli/tui/separator.tsx +2 -3
  36. package/src/cli/update-args.ts +1 -1
  37. package/src/compaction/summarize.ts +18 -5
  38. package/src/config/loader.ts +1 -1
  39. package/src/config/types.ts +64 -9
  40. package/src/config/yaml.ts +21 -0
  41. package/src/decisions/client.ts +302 -0
  42. package/src/dream/deep-llm.ts +51 -14
  43. package/src/dream/deep-worker.ts +31 -1
  44. package/src/dream/lucid-worker.ts +52 -3
  45. package/src/dream/rem-extract.ts +3 -3
  46. package/src/dream/scheduler-state.ts +36 -1
  47. package/src/engine/codex-thread-config.ts +24 -0
  48. package/src/engine/grok-bin.ts +105 -0
  49. package/src/engine/grok-cli.ts +678 -50
  50. package/src/engine/grok-home.ts +99 -0
  51. package/src/engine/openai-compatible.ts +9 -2
  52. package/src/engine/types.ts +10 -1
  53. package/src/mcp/server.ts +6 -0
  54. package/src/memory/embeddings.ts +11 -6
  55. package/src/multimodal/attachment-note.ts +83 -0
  56. package/src/multimodal/user-content.ts +1 -1
  57. package/src/persona/files.ts +20 -1
  58. package/src/persona/loader.ts +1 -1
  59. package/src/persona/skill-gating-store.ts +11 -5
  60. package/src/persona/tool-gating-store.ts +21 -4
  61. package/src/server/index.ts +117 -20
  62. package/src/server/loopback-fetch.ts +3 -0
  63. package/src/server/openai-client.ts +3 -0
  64. package/src/server/run-turn.ts +11 -1
  65. package/src/server/session-compact.ts +22 -1
  66. package/src/server/steer-inbox.ts +2 -2
  67. package/src/setup/config-edit.ts +1 -1
  68. package/src/setup/presets.ts +10 -2
  69. package/src/skills/gating.ts +21 -9
  70. package/src/team/store.ts +1 -1
  71. package/src/team/write.ts +1 -1
  72. package/src/tools/decision/tools.ts +220 -0
  73. package/src/tools/gating-edit.ts +148 -0
  74. package/src/tools/gating.ts +92 -30
  75. package/src/tools/index.ts +7 -0
  76. package/src/tools/registry.ts +1 -1
  77. package/src/tools/types.ts +11 -0
  78. package/src/types/events.ts +8 -0
  79. package/web/dist/assets/index-CQYoTOJB.js +68 -0
  80. package/web/dist/assets/index-CQYoTOJB.js.map +1 -0
  81. package/web/dist/assets/index-EeNggYDu.css +1 -0
  82. package/web/dist/index.html +2 -2
  83. package/web/package.json +8 -11
  84. package/web/tsconfig.json +1 -1
  85. package/web-mobile/dist/assets/index-3_sWEIih.js +47 -0
  86. package/web-mobile/dist/assets/index-3_sWEIih.js.map +1 -0
  87. package/web-mobile/dist/assets/index-Y6fhA0_3.css +1 -0
  88. package/web-mobile/dist/index.html +2 -2
  89. package/web-mobile/package.json +7 -7
  90. package/web/dist/assets/index-40x__Izy.js +0 -636
  91. package/web/dist/assets/index-40x__Izy.js.map +0 -1
  92. package/web/dist/assets/index-CZFgQRsq.css +0 -32
  93. package/web-mobile/dist/assets/index-CxILeHfe.js +0 -88
  94. package/web-mobile/dist/assets/index-CxILeHfe.js.map +0 -1
  95. package/web-mobile/dist/assets/index-Cyr13VGR.css +0 -1
package/README.md CHANGED
@@ -22,7 +22,7 @@
22
22
  <p align="center">
23
23
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /></a>
24
24
  <a href="#status"><img src="https://img.shields.io/badge/status-active%20dev-green.svg" alt="Status: active development" /></a>
25
- <a href="#requirements"><img src="https://img.shields.io/badge/node-%E2%89%A522.13-brightgreen.svg" alt="Node 22.13 or newer" /></a>
25
+ <a href="#requirements"><img src="https://img.shields.io/badge/node-%E2%89%A522.22-brightgreen.svg" alt="Node 22.22 or newer" /></a>
26
26
  </p>
27
27
 
28
28
  ## Install
@@ -39,7 +39,7 @@ 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.13 | `npm install -g somora && somora setup` |
42
+ | **npm** — you already have Node ≥22.22.2 | `npm install -g somora && somora setup` |
43
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) |
44
44
 
45
45
  ## See it
@@ -147,21 +147,29 @@ On top of chat and memory, each optional and off until configured:
147
147
  fixes them in the same step ([docs/lsp.md](docs/lsp.md)).
148
148
  - **Steering** — type into a running turn instead of behind it: the
149
149
  model reads your message at its next step and changes course. Works on
150
- the Claude, Codex and OpenAI-compatible engines; on Grok the message
151
- waits for the next turn ([docs/api.md → Steering](docs/api.md#steering)).
150
+ every engine ([docs/api.md → Steering](docs/api.md#steering)).
151
+ - **Decision models** — agents ask a System One decision model (such as
152
+ a self-hosted Clef) typed yes/no, choice and score questions about text
153
+ or images, and get probabilities back ([docs/decisions.md](docs/decisions.md)).
152
154
 
153
155
  ## Requirements
154
156
 
155
157
  Hard:
156
158
 
157
- - **Node ≥22.13** — uses native `node:sqlite` plus `better-sqlite3`. On an
159
+ - **Node ≥22.22.2** — uses native `node:sqlite` plus `better-sqlite3`. On an
158
160
  older Node every `somora` command stops with the upgrade steps.
161
+ - **macOS, or Linux with glibc ≥2.34** — Debian 12, Ubuntu 22.04, RHEL 9,
162
+ Fedora 35 or newer. The memory database ships prebuilt for these.
163
+ - **About 1.6 GB of disk** on Linux, 1.4 GB on macOS, mostly the
164
+ bundled Codex, Claude and Grok engines.
165
+ - **A current browser** for the web and mobile clients: Chrome or Edge
166
+ 111, Firefox 114, Safari 16.4 (iOS and iPadOS 16.4) or newer.
159
167
  - **tmux** — for the `tmux` tool (long-lived terminal sessions for agents)
160
168
  and the web tmux app.
161
169
  - **At least one LLM backend:** a Claude subscription (engine
162
170
  `claude-cli` — Claude Code is bundled, `somora auth login`); a ChatGPT
163
- subscription (engine `codex-cli` — Codex is bundled, `somora codex login`); the Grok Build CLI
164
- (SuperGrok/Premium, engine `grok-cli`); or any OpenAI-compatible HTTP
171
+ subscription (engine `codex-cli` — Codex is bundled, `somora codex login`); a SuperGrok or
172
+ Premium subscription (engine `grok-cli` — the Grok CLI is bundled, `somora grok login`); or any OpenAI-compatible HTTP
165
173
  server (Ollama, LM Studio, vLLM, oMLX, OpenRouter, …).
166
174
 
167
175
  Optional: an **Obsidian vault** for the shared wiki and read-only vault
@@ -194,7 +202,7 @@ then starts the **setup assistant**:
194
202
 
195
203
  ```text
196
204
  somora setup
197
- 1 Models connect a Claude or ChatGPT subscription, or your own model server
205
+ 1 Models connect a Claude, ChatGPT or Grok subscription, or your own model server
198
206
  2 Web search a Brave Search API key, so agents can search the web
199
207
  3 First agent name, language, model and a backup model
200
208
  4 Memory REM, Deep and Lucid — and where the shared wiki lives
@@ -207,7 +215,7 @@ Every step first looks at what is already there, so `somora setup` is safe
207
215
  to run again — as a whole or one step (`somora setup access`). Update
208
216
  later with `somora update`.
209
217
 
210
- Already have Node ≥22.13 and the tools from [Requirements](#requirements)?
218
+ Already have Node ≥22.22.2 and the tools from [Requirements](#requirements)?
211
219
  Then it is two commands: `npm install -g somora && somora setup`.
212
220
 
213
221
  ### Already using a coding agent? Let it set up somora.
@@ -267,6 +275,7 @@ npm install -g somora
267
275
  # 3. Log in to at least one LLM backend (pick one or more)
268
276
  somora auth login # Claude subscription; Claude Code is bundled
269
277
  somora codex login # ChatGPT subscription; Codex is bundled
278
+ somora grok login # SuperGrok or Premium subscription; the Grok CLI is bundled
270
279
  # local models: run Ollama / LM Studio / oMLX and add the endpoint to
271
280
  # ~/.somora/config.yaml after step 4
272
281
 
@@ -295,18 +304,15 @@ daily:
295
304
  | Memory auto-injection | ✓ | ✓ | ✓ | ✓ |
296
305
  | Memory tools (read + write) | ✓ via MCP | ✓ dynamic tools | ✓ via MCP | ✓ in-process |
297
306
  | Wiki layer (shared) | ✓ | ✓ | ✓ | ✓ |
298
- | Three-phase dreams | ✓ | ✓ | as chat model only¹ | ✓ |
307
+ | Three-phase dreams | ✓ | ✓ | ✓ | ✓ |
299
308
  | Tool surface | ✓ via MCP | ✓ dynamic tools | ✓ via MCP | ✓ in-process |
300
309
  | Skills (markdown how-tos) | ✓ | ✓ | ✓ | ✓ |
301
- | Multimodal attachments (image, PDF) | ✓ native | ✓ image native, PDF rasterized | text only | ✓ image; PDF native or rasterized per provider |
302
- | Image + video generation² | ✓ via MCP | ✓ dynamic tools | ✓ via MCP | ✓ in-process |
310
+ | Multimodal attachments (image, PDF) | ✓ native | ✓ image native, PDF rasterized | ✓ image native, PDF rasterized | ✓ image; PDF native or rasterized per provider |
311
+ | Image + video generation¹ | ✓ via MCP | ✓ dynamic tools | ✓ via MCP | ✓ in-process |
303
312
  | Sub-agents, agent-to-agent questions, follow-ups | ✓ | ✓ | ✓ | ✓ |
304
313
  | SSH-resource exec | ✓ | ✓ | ✓ | ✓ |
305
314
 
306
- ¹ grok-cli has no one-shot path, so it cannot serve as a dream or
307
- compaction *worker* — configure those on another engine.
308
-
309
- ² Off until an `imageGen` / `videoGen` block exists. Verified end-to-end
315
+ ¹ Off until an `imageGen` / `videoGen` block exists. Verified end-to-end
310
316
  against a self-hosted OpenAI-shaped endpoint; the hosted providers
311
317
  (OpenAI images/video, Google Veo) are implemented to their published
312
318
  shapes but **not yet tested against a live account**.
@@ -370,7 +376,7 @@ and searchable: [docs.somora.ai](https://docs.somora.ai).
370
376
 
371
377
  - **Get running:** [setup](docs/setup.md) · [models](docs/models.md) · [agents](docs/agents.md) · [team](docs/team.md) · [security](docs/security.md)
372
378
  - **Memory and knowledge:** [memory](docs/memory.md) · [wiki](docs/wiki.md) · [dream phases](docs/dream-phases.md) · [compaction](docs/compaction.md) · [cache strategy](docs/cache-strategy.md)
373
- - **What agents can do:** [tools](docs/tools.md) · [builders](docs/builder.md) · [language servers](docs/lsp.md) · [files](docs/files.md) · [tmux](docs/tmux.md) · [resources](docs/resources.md) · [skills](docs/skills.md) · [MCP servers](docs/mcp.md) · [projects](docs/projects.md) · [sentinel](docs/sentinel.md) · [browser](docs/browser.md) · [image generation](docs/imagegen.md) · [video generation](docs/videogen.md)
379
+ - **What agents can do:** [tools](docs/tools.md) · [builders](docs/builder.md) · [language servers](docs/lsp.md) · [files](docs/files.md) · [tmux](docs/tmux.md) · [resources](docs/resources.md) · [skills](docs/skills.md) · [MCP servers](docs/mcp.md) · [projects](docs/projects.md) · [sentinel](docs/sentinel.md) · [browser](docs/browser.md) · [image generation](docs/imagegen.md) · [video generation](docs/videogen.md) · [decision models](docs/decisions.md) · [image handling](docs/image-handling.md)
374
380
  - **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)
375
381
  - **Models in detail:** [thinking](docs/thinking.md) · [sampling](docs/sampling.md)
376
382
 
@@ -1,3 +1,6 @@
1
1
  export function minimumNodeVersion(range: string | null | undefined): [number, number, number] | null;
2
2
  export function satisfiesNode(range: string | null | undefined, current: string | null | undefined): boolean;
3
3
  export function nodeUpgradeHint(range: string, current: string, execPath: string): string;
4
+ export function glibcVersion(): string | null;
5
+ export function satisfiesGlibc(min: string | null | undefined, current: string | null | undefined): boolean;
6
+ export function glibcUpgradeHint(min: string, current: string, fallbackVersion?: string | null): string;
@@ -8,7 +8,7 @@
8
8
  // obscure failures deep inside a dependency (pdf-to-img 7, 2026-09-03).
9
9
  // Failing at the door with the exact fix is kinder.
10
10
 
11
- /** Parse the minimum version out of an engines range like ">=22.13.0". */
11
+ /** Parse the minimum version out of an engines range like ">=22.22.2". */
12
12
  export function minimumNodeVersion(range) {
13
13
  const m = /(\d+)(?:\.(\d+))?(?:\.(\d+))?/.exec(String(range ?? ''));
14
14
  if (!m) return null;
@@ -43,3 +43,44 @@ export function nodeUpgradeHint(range, current, execPath) {
43
43
  '',
44
44
  ].join('\n');
45
45
  }
46
+
47
+ // glibc gate. Native modules ship prebuilt for one glibc floor
48
+ // (better-sqlite3 13: glibc 2.34 — Debian 12, Ubuntu 22.04, RHEL 9) and
49
+ // have no compile fallback, so an older Linux would fail with a dlopen
50
+ // error deep inside the memory index. package.json `somora.glibc` is
51
+ // the floor; `somora.lastForOlderGlibc` the last release that still
52
+ // runs below it. musl and non-Linux report no glibc and pass.
53
+
54
+ /** Runtime glibc version on Linux ("2.36"), else null. */
55
+ export function glibcVersion() {
56
+ if (process.platform !== 'linux') return null;
57
+ try {
58
+ const v = process.report?.getReport?.()?.header?.glibcVersionRuntime;
59
+ return typeof v === 'string' ? v : null;
60
+ } catch {
61
+ return null;
62
+ }
63
+ }
64
+
65
+ /** true when `current` glibc is at least `min`; unknown either way → true. */
66
+ export function satisfiesGlibc(min, current) {
67
+ if (!min || !current) return true;
68
+ return satisfiesNode(String(min), String(current));
69
+ }
70
+
71
+ /** Human message with the way out, for stderr. */
72
+ export function glibcUpgradeHint(min, current, fallbackVersion) {
73
+ return [
74
+ `somora: this version needs Linux with glibc ${min} or newer (Debian 12, Ubuntu 22.04, RHEL 9 or later); this machine has glibc ${current}.`,
75
+ '',
76
+ ...(fallbackVersion
77
+ ? [
78
+ ' Go back to the last version that runs here, then restart:',
79
+ ` npm install -g somora@${fallbackVersion} && somora server restart`,
80
+ '',
81
+ ]
82
+ : []),
83
+ ' Or move to a newer Linux release; your ~/.somora folder carries over unchanged.',
84
+ '',
85
+ ].join('\n');
86
+ }
@@ -0,0 +1,55 @@
1
+ // npm `preinstall` gate: runs before npm puts this version in place, on
2
+ // the machine it is meant for. On a Linux whose glibc is older than the
3
+ // prebuilt native modules need, or on a Node.js below `engines.node`
4
+ // (npm only warns about that), it fails, and npm keeps the version that
5
+ // was installed before. Without it an older `somora update` (2026.1007.2
6
+ // and earlier check Node only) installed a release that cannot start and
7
+ // left the service broken until the user went back by hand.
8
+ //
9
+ // The floors live in package.json (`engines.node`, `somora.glibc`,
10
+ // `somora.lastForOlderGlibc`); raising one there is all this needs.
11
+ // src/platform-floors.test.mts trips when they change, as a reminder to
12
+ // update the texts that name systems and versions. Plain ESM, no deps:
13
+ // it must run on the old Node it may reject.
14
+
15
+ import { readFileSync } from 'node:fs';
16
+ import { pathToFileURL } from 'node:url';
17
+ import { glibcVersion, satisfiesGlibc, satisfiesNode } from './node-version.mjs';
18
+
19
+ /** Why this machine cannot take this version, or null when it can. */
20
+ export function preinstallProblem({ pkg, node, glibc }) {
21
+ const range = pkg?.engines?.node;
22
+ if (range && !satisfiesNode(range, node)) {
23
+ return [
24
+ `somora ${pkg.version} needs Node.js ${range}; this machine has v${node}.`,
25
+ 'Nothing was installed: the version you had stays in place.',
26
+ 'Update Node.js first (https://nodejs.org or your package manager), then install again.',
27
+ '',
28
+ ].join('\n');
29
+ }
30
+ const min = pkg?.somora?.glibc;
31
+ if (min && !satisfiesGlibc(min, glibc)) {
32
+ const last = pkg?.somora?.lastForOlderGlibc;
33
+ return [
34
+ `somora ${pkg.version} needs Linux with glibc ${min} or newer; this machine has glibc ${glibc}.`,
35
+ 'Nothing was installed: the version you had stays in place.',
36
+ ...(last ? [`The last version that runs here is ${last}: npm install -g somora@${last}`] : []),
37
+ 'Or move to a newer Linux release; your ~/.somora folder carries over unchanged.',
38
+ '',
39
+ ].join('\n');
40
+ }
41
+ return null;
42
+ }
43
+
44
+ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
45
+ try {
46
+ const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
47
+ const problem = preinstallProblem({ pkg, node: process.versions.node, glibc: glibcVersion() });
48
+ if (problem) {
49
+ process.stderr.write(problem);
50
+ process.exit(1);
51
+ }
52
+ } catch {
53
+ // An unreadable package.json is npm's problem to report, not ours.
54
+ }
55
+ }
package/bin/somora.mjs CHANGED
@@ -8,7 +8,7 @@ import { spawn } from 'node:child_process';
8
8
  import { existsSync, readFileSync } from 'node:fs';
9
9
  import { dirname, resolve } from 'node:path';
10
10
  import { fileURLToPath } from 'node:url';
11
- import { nodeUpgradeHint, satisfiesNode } from './node-version.mjs';
11
+ import { glibcUpgradeHint, glibcVersion, nodeUpgradeHint, satisfiesGlibc, satisfiesNode } from './node-version.mjs';
12
12
 
13
13
  const here = dirname(fileURLToPath(import.meta.url));
14
14
  const pkgRoot = resolve(here, '..');
@@ -24,6 +24,12 @@ try {
24
24
  process.stderr.write(nodeUpgradeHint(range, process.versions.node, process.execPath));
25
25
  process.exit(1);
26
26
  }
27
+ // Same for an older Linux than the prebuilt native modules need.
28
+ const glibc = glibcVersion();
29
+ if (pkg?.somora?.glibc && !satisfiesGlibc(pkg.somora.glibc, glibc)) {
30
+ process.stderr.write(glibcUpgradeHint(pkg.somora.glibc, glibc, pkg.somora.lastForOlderGlibc));
31
+ process.exit(1);
32
+ }
27
33
  } catch {
28
34
  // unreadable package.json — let the normal path report it
29
35
  }
@@ -2,7 +2,7 @@
2
2
  # (created with sane defaults on first server start).
3
3
  #
4
4
  # Secrets:
5
- # - Subscription engines (claude-cli, codex-cli) do not need any keys
5
+ # - Subscription engines (claude-cli, codex-cli, grok-cli) do not need any keys
6
6
  # here — they authenticate via their CLI's own `login` flow.
7
7
  # - OpenAI-compatible providers (custom endpoints, OpenRouter, oMLX,
8
8
  # Ollama, …) read `apiKey` directly from this file. The recommended
@@ -92,17 +92,17 @@ providers:
92
92
  contextWindow: 400000
93
93
  capabilities: [text, reasoning]
94
94
 
95
- # xAI via the Grok Build CLI (`grok`), driven over ACP — a SuperGrok /
96
- # Premium subscription authenticates the binary (`grok login`), no API
97
- # key. Text attachments only; no image/PDF input. Community-maintained
98
- # engine — see docs/setup.md#xai-via-grok-build-cli-subscription-no-api-key.
95
+ # xAI via the Grok CLI, bundled with somora. A SuperGrok or Premium
96
+ # subscription signs it in with `somora grok login`; no API key. Images
97
+ # go to Grok as images, PDFs as page images. See docs/models.md, section
98
+ # "Grok subscription".
99
99
  # xai:
100
100
  # engine: grok-cli
101
101
  # models:
102
- # - id: grok-4.5
102
+ # - id: grok-4.7
103
103
  # alias: grok
104
- # contextWindow: 500000
105
- # capabilities: [text, reasoning]
104
+ # contextWindow: 256000
105
+ # capabilities: [text, image, reasoning]
106
106
 
107
107
  # Local OpenAI-compatible server (Ollama, LM Studio, oMLX, vLLM, ...).
108
108
  # Multiple providers of the same engine are fine — just give each a unique key.
@@ -300,6 +300,21 @@ providers:
300
300
  # autoPlayVoiceReplies: false
301
301
  # allowUserOverride: true
302
302
 
303
+ # Decision models (docs/decisions.md): agents ask a System One decision
304
+ # model yes/no, choice and score questions with the `decision_evaluate`
305
+ # tool. Off until `model` names an entry; requests go to
306
+ # <baseUrl>/v1/systemone.
307
+ # decisions:
308
+ # model: clef
309
+ # models:
310
+ # - name: clef
311
+ # baseUrl: https://<your-host>/clef
312
+ # apiKey: <key> # leave out without authentication
313
+ # model: clef
314
+ # capabilities: [text, image] # image: the tool takes up to four images
315
+ # # maxInputTokens: 16000 # optional; the lower of this and the server's limit applies
316
+ # # timeoutMs: 90000 # default
317
+
303
318
  # Image generation — text-to-image via an OpenAI-shaped image endpoint
304
319
  # (OpenRouter's /api/v1/images, OpenAI's /v1/images/generations, or a
305
320
  # local server that speaks the same shape). Same standalone posture as
@@ -533,7 +548,7 @@ providers:
533
548
  # their own tool-call loop — currently openai-compatible — for the per-
534
549
  # tool-call race. The longTask* values ALSO inform CLI-engine tools
535
550
  # (subagent_result, agent_ask) which run inside MCP children, so all
536
- # three engines honor the same caller-friendly politik for slow models.
551
+ # engines honor the same caller-friendly policy for slow models.
537
552
  #
538
553
  # Three timeout knobs, each for a different tool class:
539
554
  # 1. toolCallTimeoutMs — fast tools (memory, web, file, time)
package/docs/agents.md CHANGED
@@ -210,7 +210,9 @@ In the web client (`/web`), right-click the agent tile and choose
210
210
  with a `voice` block.
211
211
 
212
212
  Tools and skills are switched per agent in the Abilities window. It
213
- writes exact-name entries into `tools.deny` and `skills.deny`.
213
+ writes `tools:` and `skills:` in `agent.yaml`: a name per switched
214
+ tool, and one rule for a whole family switched off. Every save keeps
215
+ the previous file as `agent.yaml.bak-<time>`; the newest five stay.
214
216
 
215
217
  ## Sessions
216
218
 
@@ -616,7 +618,7 @@ How the fallback chain works:
616
618
  | Key | Type | Default | Meaning |
617
619
  |---|---|---|---|
618
620
  | `kind` | `chat`, `builder` | `chat` | The kind of agent. Set once at creation. |
619
- | `steering` | boolean | `false` | Default for a message typed in the web client while a turn runs. `true` hands it into the running turn before its next step. `false` queues it as its own turn. The toggle next to Send flips it per message. Steering works on `openai-compatible`, `claude-cli` and `codex-cli`. Other engines always queue. |
621
+ | `steering` | boolean | `false` | Default for a message typed in the web client while a turn runs. `true` hands it into the running turn before its next step. `false` queues it as its own turn. The toggle next to Send flips it per message. Steering works on every engine: `openai-compatible`, `claude-cli`, `codex-cli` and `grok-cli`. |
620
622
  | `imageReview` | `never`, `always` | `never` | `always` feeds each generated image back to the agent so it can judge it, about 2k tokens per image. Not a lock: the agent can set `return_image` per call either way. |
621
623
  | `agentLoop.maxRounds` | integer | server value (8) | Rounds per turn on the `openai-compatible` engine. Builders default to 500. |
622
624
  | `agentLoop.maxToolCallsPerTurn` | integer | server value (30) | Tool calls per turn, across all rounds. Builders default to 2000. |
@@ -628,14 +630,16 @@ How the fallback chain works:
628
630
  |---|---|---|---|
629
631
  | `workspace.path` | string | `workspace.default` in `config.yaml` (`~/somoraworkspace`) | Default folder for the `file_*` tools. `~` expands. Created at server start. |
630
632
  | `tools.deny` | list | empty | Tools to hide. |
631
- | `tools.allow` | list | empty | When not empty, only these tools are offered. |
633
+ | `tools.allow` | list | empty | Exceptions inside a family that `deny` switches off. Without such a family rule it means only these tools. For a builder it adds to the builder list. |
632
634
  | `skills.deny` | list | empty | Skills to hide. |
633
635
  | `skills.allow` | list | empty | When not empty, only these skills are offered. A plain list (`skills: [a, b]`) means the same. |
634
636
  | `resources.deny` | list | empty | Remote resources to hide. There is no allow list. |
635
637
 
636
638
  Rules for `tools` and `skills`:
637
639
 
638
- - `deny` beats `allow`. No block means no restriction.
640
+ - A name under `deny` beats everything. A name or pattern under
641
+ `allow` beats a family rule under `deny`, which makes it an
642
+ exception. No block means no restriction.
639
643
  - A tool pattern is an exact name (`web_search`), a toolset
640
644
  (`toolset:exec`) or a name with a trailing `*` (`mcp__parallel__*`).
641
645
  The same patterns cover built-in tools and tools from MCP servers.
@@ -643,8 +647,8 @@ Rules for `tools` and `skills`:
643
647
  context on every turn.
644
648
  - Only tools whose configuration exists are offered at all. The
645
649
  Abilities window lists exactly those.
646
- - The Abilities window edits exact names only. When the file holds an
647
- `allow` list or patterns, the window shows them read-only.
650
+ - The Abilities window is always editable. Patterns it did not write
651
+ still apply and are listed as a note.
648
652
  - For a builder, `tools.allow` adds to the builder set and
649
653
  `skills.allow` is the complete list.
650
654
 
@@ -681,8 +685,8 @@ Lucid work for the whole install and are set under `wiki.deep` and
681
685
  | `rem.participate_in_wiki` | boolean | `true` | `false` keeps Deep away from this agent's notes. REM still runs. Useful for scratch agents. |
682
686
  | `rem.thinking` | `off`, `low`, `medium`, `high` | none | Reasoning depth for the worker, when its model has the `reasoning` capability. |
683
687
 
684
- The worker can be a model on `claude-cli`, `codex-cli` or an
685
- `openai-compatible` provider. A model on `grok-cli` cannot run REM.
688
+ The worker can be a model on `claude-cli`, `codex-cli`, `grok-cli` or
689
+ an `openai-compatible` provider.
686
690
 
687
691
  > **Note:** A `rem` block needs both `enabled` and `model`, also with
688
692
  > `enabled: false`. REM agents are registered when the server starts:
package/docs/api.md CHANGED
@@ -439,16 +439,20 @@ What a client sees, in order:
439
439
 
440
440
  | Case | Result |
441
441
  |---|---|
442
- | Engine `openai-compatible`, `claude-cli` or `codex-cli` | The message is steered. |
442
+ | Engine `openai-compatible`, `claude-cli`, `codex-cli` or `grok-cli` | The message is steered. |
443
443
  | Any other engine, or no turn running | It is queued as a turn of its own (`steered: false`). |
444
444
  | The turn is already finishing | It becomes an ordinary queued turn. Nothing is lost. |
445
445
  | The message carries `agent_ask_call_id` | Never steered: such a question needs a turn of its own. |
446
446
 
447
- On `claude-cli` a message steered while the model writes its final
448
- answer is answered in the same turn. The model finishes the answer,
447
+ On `claude-cli` and `grok-cli` a message steered while the model
448
+ writes its final answer is answered in the same turn. The model finishes the answer,
449
449
  then replies to the message in a new paragraph. The turn ends once
450
450
  every steered message has had its answer.
451
451
 
452
+ Grok does not say when it hands a message to the model. somora reads
453
+ that from Grok's own session record, so on `grok-cli` the `user_message`
454
+ event can arrive a second or two after the model read the text.
455
+
452
456
  Sub-agent and voice turns can be steered like any other. The web
453
457
  client offers a steer or queue switch next to Send. Its starting
454
458
  position is the agent's `steering:` setting in `agent.yaml`, reported
@@ -823,6 +827,8 @@ HTTPS the connection is also pinged (`sse.h2PingIntervalMs`,
823
827
  | `input` | `{modality?: "text"\|"voice", source?: "stt"\|"realtime"}` when the turn was not typed. `stt` is dictation, `realtime` a sentence from a call. |
824
828
  | `steer`, `steer_id` | `steer: true` marks a message that went into the running turn `turnId`. `steer_id` matches the `steer_queued` event. |
825
829
  | `from_agent`, `from_session`, `agent_ask_call_id` | Older fields, derived from an `agent` origin. |
830
+ | `attachments` | `{hash, name, mime, size}` of the files sent with the message. |
831
+ | `attachment_descriptions` | Stored row only. The vision worker's description of each attachment the model could not see, one string per file. |
826
832
  | `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. |
827
833
 
828
834
  `origin` is one of:
@@ -1036,9 +1042,9 @@ Compacts the session now, on the engine of its model. See
1036
1042
 
1037
1043
  | Status | Body |
1038
1044
  |---|---|
1039
- | `200` | `{agent, session, status: "compacted", engine, tokensBefore?, tokensAfter?, note?}`. `note` says when the engine ignored the instructions (`codex-cli`). |
1045
+ | `200` | `{agent, session, status: "compacted", engine, tokensBefore?, tokensAfter?, note?}`. `note` says when the engine ignored the instructions (`codex-cli`, `grok-cli`). |
1040
1046
  | `200` | `{agent, session, status: "nothing_to_compact", engine, note}`. The session is too short, or the engine has no conversation for it yet. |
1041
- | `400` | `{status: "unsupported", engine, note}`. The engine cannot compact by hand (`grok-cli`). |
1047
+ | `400` | `{status: "unsupported", engine, note}`. The engine cannot compact by hand. |
1042
1048
  | `409` | `{error, busy: true}`. A turn or another compaction is running. |
1043
1049
  | `502` | `{error}`. The engine failed while compacting. |
1044
1050
 
@@ -1294,13 +1300,33 @@ Which tools an agent may use.
1294
1300
  | `agent`, `kind` | The agent and its kind. |
1295
1301
  | `kindDefaults` | For a builder: the tool names its kind allows by default. Else `null`. |
1296
1302
  | `gating` | The agent's `tools:` section as `{deny, allow}`, or `null`. |
1297
- | `hasPatternRules` | `true` when the section has an allow list, a `toolset:` rule or a wildcard. The web client shows such a section read-only. |
1303
+ | `hasPatternRules` | Always `false`. Kept for older clients; the Abilities window is always editable. |
1304
+ | `handWrittenRules` | Patterns in the section that are not a family rule (`toolset:<tag>`), a server rule (`mcp__<server>__*`) or `*`. They apply; the window lists them as a note. |
1298
1305
  | `tools` | `[{name, toolset, mcpServer?, description, visible, availableNow}]`: every tool, built in or from an external MCP server. `visible` says whether the agent may use it. |
1299
1306
 
1300
1307
  `PUT` takes `{deny: string[], allow: string[]}` and rewrites only the
1301
1308
  `tools:` block of the agent's `agent.yaml`. Returns `{ok: true}`. `400`
1302
- for a wrong body or a failed write. It applies from the agent's next
1303
- turn.
1309
+ for a wrong body or a failed write, `404` for an unknown agent. It
1310
+ applies from the agent's next turn and keeps the previous file as a
1311
+ backup, like a click.
1312
+
1313
+ ### `POST /agents/:agent/tools/toggle` · `POST /agents/:agent/skills/toggle`
1314
+
1315
+ One click in the Abilities window. The server works out the rules, so
1316
+ every client edits the same way. Body:
1317
+
1318
+ | Field | Meaning |
1319
+ |---|---|
1320
+ | `names` | The tools or skills to switch, at least one. |
1321
+ | `visible` | `true` to switch them on, `false` to switch them off. |
1322
+ | `group` | `true` when the names are one whole family (a toolset, an MCP server, or all skills). Off then writes one rule for the family, so tools it gains later stay off. |
1323
+
1324
+ Returns `{ok: true, gating}` with the rules now in `agent.yaml`. Only
1325
+ the named entries change state. `400` for a wrong body, an unknown
1326
+ name, or a builder-only tool (`todo_write`, `ask_user`, `plan_write`)
1327
+ for a chat agent. `404` for an unknown agent. Clicks on one agent run
1328
+ one after another, and each write keeps the previous `agent.yaml` as a
1329
+ backup (the newest five stay).
1304
1330
 
1305
1331
  ### `GET /agents/:agent/skills` · `PUT /agents/:agent/skills`
1306
1332
 
@@ -1309,12 +1335,14 @@ Which skills an agent sees.
1309
1335
  `GET` returns `{agent, kind, gating, hasPatternRules, skills}`. Each
1310
1336
  skill is `{name, description, available, unavailableReason?, visible}`.
1311
1337
  `gating` is the agent's `skills:` section as `{deny, allow}` or `null`.
1312
- `hasPatternRules` is `true` when it has a hand-written allow list.
1338
+ `hasPatternRules` is always `false`, kept for older clients.
1313
1339
 
1314
1340
  `PUT` takes `{deny: string[], allow: string[]}` and rewrites only the
1315
1341
  `skills:` block of `agent.yaml`. Empty lists remove the block. Names
1316
- are skill names (`[a-z0-9-]`). Returns `{ok: true}`, `400` on a wrong
1317
- body. It applies from the next turn.
1342
+ are skill names (`[a-z0-9-]`), plus `*` under `deny` for every skill.
1343
+ Returns `{ok: true}`, `400` on a wrong body, `404` for an unknown
1344
+ agent. It applies from the next turn and keeps the previous file as a
1345
+ backup.
1318
1346
 
1319
1347
  ### `POST /agents/:agent/tools/:name`
1320
1348
 
package/docs/builder.md CHANGED
@@ -390,8 +390,7 @@ The three builder tools:
390
390
  | `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?}`. |
391
391
  | `plan_write` | `content` | Writes the whole plan file. |
392
392
 
393
- A chat agent gets none of these three unless its `tools.allow` names
394
- one.
393
+ A chat agent never gets these three, whatever its `agent.yaml` says.
395
394
 
396
395
  ## Routes
397
396
 
@@ -110,13 +110,13 @@ How that block reaches the model depends on the engine.
110
110
  |---|---|---|---|
111
111
  | `claude-cli` | the Claude session, resumed | every turn, unchanged | catch-up, per-turn block, your text |
112
112
  | `codex-cli` | the Codex thread, resumed | as developer instructions on every thread start and resume | attachment notes, per-turn block, project block on a resumed thread, catch-up, your text |
113
- | `grok-cli` | the Grok session, resumed | once, as the start of the first message | system prompt on a fresh session, per-turn block, project block on a resumed session, attachments, your text |
113
+ | `grok-cli` | the Grok session, resumed | in the session's agent profile, replaced on every resume | per-turn block, project block on a resumed session, attachments, your text |
114
114
  | `openai-compatible` | somora, rebuilt from the session file on every request | every request, as the one system message | per-turn block, your text |
115
115
 
116
116
  "Catch-up" is the summary of turns another engine answered, sent when
117
117
  you switch engines within a session.
118
118
 
119
- The first three engines keep the conversation themselves. somora only
119
+ `claude-cli`, `codex-cli` and `grok-cli` keep the conversation themselves. somora only
120
120
  sends the new turn, and the provider's cache covers the rest.
121
121
 
122
122
  On `codex-cli` and `grok-cli` a resumed conversation also gets the
@@ -42,7 +42,8 @@ Who compacts depends on the engine of the model that answers.
42
42
  | Engine | Who compacts | When | What you see |
43
43
  |---|---|---|---|
44
44
  | `openai-compatible` | somora | Before a turn, when the prompt reaches `triggerRatio` times the input budget | Usually nothing. A `context compacted` row when a compaction ran inside or in reaction to a turn |
45
- | `claude-cli`, `codex-cli`, `grok-cli` | The CLI itself, inside its own session | At the CLI's own threshold | Nothing from somora |
45
+ | `claude-cli` | Claude Code itself, inside its own session | At Claude Code's own threshold | Nothing from somora |
46
+ | `codex-cli`, `grok-cli` | The CLI itself, inside its own session | At the CLI's own threshold | A `context compacted` row, and the usage display drops |
46
47
 
47
48
  The session file `sessions/<id>.jsonl` is never shortened by either
48
49
  kind. REM reads it independently.
@@ -76,7 +77,7 @@ What happens depends on the engine of the session's model:
76
77
  | `openai-compatible` | somora, with the same summary as the automatic compaction. The last exchanges (`safetyCushionPairs`) stay as they are. | Goes into the summary prompt. |
77
78
  | `claude-cli` | Claude Code compacts its own session, as `/compact` does in Claude Code. | Passed to Claude as its instructions. |
78
79
  | `codex-cli` | Codex compacts its own thread. | Not used: Codex takes no instructions for it. The reply says so. |
79
- | `grok-cli` | Not available. | |
80
+ | `grok-cli` | Grok compacts its own conversation. | Not used: Grok takes no instructions for it. The reply says so. |
80
81
 
81
82
  Good to know:
82
83
 
@@ -152,7 +153,7 @@ The summary is saved in the session's meta data together with the time
152
153
  it covers. Later turns send the summary plus the exchanges after that
153
154
  time.
154
155
 
155
- `claude-cli` and `codex-cli` use the same record when they have to
156
+ `claude-cli`, `codex-cli` and `grok-cli` use the same record when they have to
156
157
  rebuild a session, for example after a Codex thread is gone. That replay
157
158
  is limited to the 40 most recent exchanges and 60,000 characters.
158
159
 
@@ -221,9 +222,9 @@ trimming when none delivers.
221
222
 
222
223
  ## Which model summarises
223
224
 
224
- A summary is a separate, single model call without tools. Three engines
225
- can do it: `openai-compatible`, `claude-cli` and `codex-cli`. A
226
- `grok-cli` model is never a summariser.
225
+ A summary is a separate, single model call without tools. All four
226
+ engines can do it: `openai-compatible`, `claude-cli`, `codex-cli` and
227
+ `grok-cli`.
227
228
 
228
229
  ### With a workers list
229
230
 
@@ -238,14 +239,14 @@ all, the compaction fails.
238
239
 
239
240
  ### Without a list
240
241
 
241
- somora picks from every configured model on the three engines above:
242
+ somora picks from every configured model on the four engines above:
242
243
  each model whose `contextWindow` is at least 1.3 times the estimated
243
244
  size of the summary request, smallest window first.
244
245
 
245
246
  Three things follow from this:
246
247
 
247
248
  - **A subscription model may be picked.** If the smallest fitting window
248
- belongs to a Claude or Codex model, the summary runs through that CLI
249
+ belongs to a Claude, Codex or Grok model, the summary runs through that CLI
249
250
  and counts against that subscription. Nothing in the UI says so. Set
250
251
  `workers` to keep summaries on local models.
251
252
  - **A wrong `contextWindow` misleads the pick.** Too high makes a model
@@ -299,7 +300,7 @@ The same per-model field does three jobs:
299
300
  | Job | `openai-compatible` | `claude-cli`, `codex-cli`, `grok-cli` |
300
301
  |---|---|---|
301
302
  | Compaction trigger and in-turn limit | yes | no, the CLI compacts on its own threshold |
302
- | Choice of summariser | yes | yes, except `grok-cli` |
303
+ | Choice of summariser | yes | yes |
303
304
  | Usage display in the header | yes | yes |
304
305
 
305
306
  On a CLI engine the value never prevents an overflow. It decides whether