somora 2026.1004.4 → 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 (128) hide show
  1. package/README.md +46 -36
  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 +51 -9
  7. package/docs/agents.md +12 -8
  8. package/docs/api.md +92 -16
  9. package/docs/builder.md +1 -2
  10. package/docs/cache-strategy.md +26 -7
  11. package/docs/compaction.md +54 -8
  12. package/docs/decisions.md +198 -0
  13. package/docs/display.md +14 -6
  14. package/docs/dream-phases.md +13 -4
  15. package/docs/files.md +60 -12
  16. package/docs/image-handling.md +104 -0
  17. package/docs/imagegen.md +10 -1
  18. package/docs/index.md +3 -1
  19. package/docs/lsp.md +2 -2
  20. package/docs/mcp.md +12 -7
  21. package/docs/memory.md +28 -0
  22. package/docs/mobile.md +34 -4
  23. package/docs/models.md +95 -15
  24. package/docs/resources.md +22 -0
  25. package/docs/security.md +24 -13
  26. package/docs/setup.md +75 -17
  27. package/docs/skills.md +19 -3
  28. package/docs/thinking.md +42 -14
  29. package/docs/tools.md +60 -21
  30. package/docs/web.md +18 -6
  31. package/package.json +40 -28
  32. package/src/attachments/store.ts +19 -1
  33. package/src/browser/session.ts +2 -2
  34. package/src/cli/auth.ts +23 -1
  35. package/src/cli/claude-bin.ts +48 -0
  36. package/src/cli/config.ts +47 -0
  37. package/src/cli/grok.ts +53 -0
  38. package/src/cli/server-call.ts +1 -1
  39. package/src/cli/setup.ts +48 -9
  40. package/src/cli/somora.ts +31 -7
  41. package/src/cli/tui/api.ts +44 -2
  42. package/src/cli/tui/app.tsx +62 -8
  43. package/src/cli/tui/commands.ts +109 -12
  44. package/src/cli/tui/header.tsx +25 -16
  45. package/src/cli/tui/separator.tsx +2 -3
  46. package/src/cli/tui/stream.ts +2 -0
  47. package/src/cli/tui/types.ts +10 -1
  48. package/src/cli/update-args.ts +1 -1
  49. package/src/compaction/summarize.ts +22 -5
  50. package/src/compaction/template.ts +15 -0
  51. package/src/compaction/types.ts +3 -0
  52. package/src/config/loader.ts +76 -11
  53. package/src/config/types.ts +104 -16
  54. package/src/config/yaml.ts +21 -0
  55. package/src/decisions/client.ts +302 -0
  56. package/src/dream/deep-llm.ts +51 -14
  57. package/src/dream/deep-worker.ts +31 -1
  58. package/src/dream/lucid-worker.ts +52 -3
  59. package/src/dream/rem-extract.ts +3 -3
  60. package/src/dream/scheduler-state.ts +36 -1
  61. package/src/engine/a2a.ts +1 -1
  62. package/src/engine/claude-cli.ts +136 -4
  63. package/src/engine/codex-cli.ts +74 -0
  64. package/src/engine/codex-thread-config.ts +24 -0
  65. package/src/engine/engine-meta-labels.ts +2 -0
  66. package/src/engine/grok-bin.ts +105 -0
  67. package/src/engine/grok-cli.ts +678 -50
  68. package/src/engine/grok-home.ts +99 -0
  69. package/src/engine/openai-compatible.ts +151 -31
  70. package/src/engine/types.ts +17 -1
  71. package/src/imagegen/generate.ts +30 -5
  72. package/src/imagegen/types.ts +6 -0
  73. package/src/mcp/server.ts +6 -0
  74. package/src/media/capabilities.ts +8 -0
  75. package/src/memory/embeddings.ts +11 -6
  76. package/src/memory/inject.ts +66 -7
  77. package/src/multimodal/attachment-note.ts +83 -0
  78. package/src/multimodal/blocks.ts +14 -0
  79. package/src/multimodal/load.ts +21 -2
  80. package/src/multimodal/model-image.ts +127 -0
  81. package/src/multimodal/user-content.ts +1 -1
  82. package/src/persona/files.ts +20 -1
  83. package/src/persona/loader.ts +1 -1
  84. package/src/persona/skill-gating-store.ts +11 -5
  85. package/src/persona/tool-gating-store.ts +21 -4
  86. package/src/server/index.ts +235 -59
  87. package/src/server/loopback-fetch.ts +3 -0
  88. package/src/server/openai-client.ts +3 -0
  89. package/src/server/run-turn.ts +76 -17
  90. package/src/server/session-compact.ts +159 -0
  91. package/src/server/steer-inbox.ts +2 -2
  92. package/src/server/thinking-resolve.ts +30 -0
  93. package/src/setup/config-edit.ts +1 -1
  94. package/src/setup/presets.ts +10 -2
  95. package/src/skills/gating.ts +21 -9
  96. package/src/ssh/exec.ts +55 -22
  97. package/src/storage/sessions.ts +40 -15
  98. package/src/team/store.ts +1 -1
  99. package/src/team/write.ts +1 -1
  100. package/src/tools/decision/tools.ts +220 -0
  101. package/src/tools/exec/tools.ts +3 -0
  102. package/src/tools/file/analyze.ts +46 -7
  103. package/src/tools/file/remote.ts +31 -10
  104. package/src/tools/file/tools.ts +86 -19
  105. package/src/tools/gating-edit.ts +148 -0
  106. package/src/tools/gating.ts +92 -30
  107. package/src/tools/image/tools.ts +6 -0
  108. package/src/tools/index.ts +7 -0
  109. package/src/tools/registry.ts +15 -1
  110. package/src/tools/types.ts +11 -0
  111. package/src/types/events.ts +31 -2
  112. package/web/dist/assets/index-CQYoTOJB.js +68 -0
  113. package/web/dist/assets/index-CQYoTOJB.js.map +1 -0
  114. package/web/dist/assets/index-EeNggYDu.css +1 -0
  115. package/web/dist/index.html +2 -2
  116. package/web/package.json +8 -11
  117. package/web/tsconfig.json +1 -1
  118. package/web-mobile/dist/assets/index-3_sWEIih.js +47 -0
  119. package/web-mobile/dist/assets/index-3_sWEIih.js.map +1 -0
  120. package/web-mobile/dist/assets/index-Y6fhA0_3.css +1 -0
  121. package/web-mobile/dist/index.html +2 -2
  122. package/web-mobile/package.json +7 -7
  123. package/web/dist/assets/index-Cl1xtY5g.js +0 -636
  124. package/web/dist/assets/index-Cl1xtY5g.js.map +0 -1
  125. package/web/dist/assets/index-D0q6NZer.css +0 -32
  126. package/web-mobile/dist/assets/index-BpsX8_mX.js +0 -88
  127. package/web-mobile/dist/assets/index-BpsX8_mX.js.map +0 -1
  128. package/web-mobile/dist/assets/index-DZXivrMo.css +0 -1
package/README.md CHANGED
@@ -11,11 +11,19 @@
11
11
  > turn what they learn into a shared long-term wiki while they sleep.
12
12
  > Run. Rest. Dream.
13
13
 
14
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
15
- [![Status: active dev](https://img.shields.io/badge/status-active%20dev-green.svg)](#status)
16
- [![Node ≥22](https://img.shields.io/badge/node-%E2%89%A522-brightgreen.svg)](#requirements)
14
+ <p align="center">
15
+ <a href="https://somora.ai"><img src="https://img.shields.io/badge/Website-2ea44f?style=for-the-badge&logo=googlechrome&logoColor=white" alt="Website: somora.ai" /></a>
16
+ <a href="https://docs.somora.ai"><img src="https://img.shields.io/badge/Docs-0a7ea4?style=for-the-badge&logo=readthedocs&logoColor=white" alt="Documentation: docs.somora.ai" /></a>
17
+ <a href="https://www.npmjs.com/package/somora"><img src="https://img.shields.io/npm/v/somora?style=for-the-badge&logo=npm&label=npm&color=cb3837" alt="npm: somora" /></a>
18
+ <a href="https://somora.ai/discord"><img src="https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord" /></a>
19
+ <a href="https://x.com/somora_ai"><img src="https://img.shields.io/badge/@somora__ai-000000?style=for-the-badge&logo=x&logoColor=white" alt="X: @somora_ai" /></a>
20
+ </p>
17
21
 
18
- **[Website](https://somora.ai) · [Documentation](https://docs.somora.ai) · [npm](https://www.npmjs.com/package/somora)**
22
+ <p align="center">
23
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /></a>
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.22-brightgreen.svg" alt="Node 22.22 or newer" /></a>
26
+ </p>
19
27
 
20
28
  ## Install
21
29
 
@@ -31,7 +39,7 @@ models, your first agent, memory and HTTPS — details under
31
39
  | | |
32
40
  |---|---|
33
41
  | **One line** (recommended) | `curl -fsSL https://somora.ai/install.sh \| bash` |
34
- | **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` |
35
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) |
36
44
 
37
45
  ## See it
@@ -81,8 +89,9 @@ A small server you run on your machine that hosts your agents. You chat
81
89
  with them from the terminal, the browser, or your phone; they remember
82
90
  things across sessions; they use the same typed tools — memory, files
83
91
  (numbered reads, tolerant patches, filtered search), web, shell, tmux,
84
- attachments, sub-agents — regardless of which LLM you point them at. Everything an agent is asked to do — a question from you, a
85
- question from another agent, a sub-agent, a scheduled trigger, a voice
92
+ attachments, sub-agents — regardless of which LLM you point them at.
93
+ Everything an agent is asked to do — a question from you, a question
94
+ from another agent, a sub-agent, a scheduled trigger, a voice
86
95
  call — goes through one queue per session that you can see and take back
87
96
  from in every client.
88
97
 
@@ -101,7 +110,7 @@ one you give a repository to.
101
110
  | **Memory** | Notices facts, dreams them into notes and the wiki | Reads memory, never writes it; does not dream |
102
111
  | **Works in** | Its workspace | The pinned project's folder, and only there |
103
112
  | **Window** | Chat | Chat plus a task panel: mode, plan → Go, tasks, questions, running time |
104
- | **Made how** | `somora agent create`, or an agent creates one | The same, with `kind: builder` — fixed for life |
113
+ | **Made how** | `somora setup agent`, or a folder with an `AGENTS.md` and an `agent.yaml` | A folder whose `agent.yaml` says `kind: builder` — fixed for life |
105
114
 
106
115
  You can talk to a builder directly — describe the project, let it plan,
107
116
  press Go — or let a chat agent hand it the order in one call and be
@@ -133,31 +142,34 @@ On top of chat and memory, each optional and off until configured:
133
142
  that wake an agent on a schedule ([docs/sentinel.md](docs/sentinel.md)).
134
143
  - **External MCP servers** — one config entry, all engines see the tools,
135
144
  gateable per agent ([docs/mcp.md](docs/mcp.md)).
136
- - **Builders** — agents of a second kind that are coding harnesses: a
137
- short coding tool set, harness rules instead of a persona, long turns,
138
- a task panel with the plan, the task list and the questions they ask
139
- you. Describe a project, let the builder plan, press Go — or let
140
- another agent hand over the order in one call and be woken with the
141
- report; one builder per folder at a time, and the hand-over procedure
142
- ships as a skill ([docs/builder.md](docs/builder.md)). With a
143
- language server installed, every write comes back with the compiler's
144
- errors for the file ([docs/lsp.md](docs/lsp.md)).
145
+ - **Language servers** — with one installed, every file a builder
146
+ writes comes back with the compiler's errors for that file, so it
147
+ fixes them in the same step ([docs/lsp.md](docs/lsp.md)).
145
148
  - **Steering** — type into a running turn instead of behind it: the
146
- model reads your message at its next step and changes course, on every
147
- engine ([docs/api.md → Steering](docs/api.md#steering)).
149
+ model reads your message at its next step and changes course. Works on
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)).
148
154
 
149
155
  ## Requirements
150
156
 
151
157
  Hard:
152
158
 
153
- - **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
154
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.
155
167
  - **tmux** — for the `tmux` tool (long-lived terminal sessions for agents)
156
168
  and the web tmux app.
157
- - **At least one LLM backend:** the Claude Code binary (Claude
158
- subscription, engine `claude-cli`); a ChatGPT subscription (engine
159
- `codex-cli` — Codex is bundled, `somora codex login`); the Grok Build CLI
160
- (SuperGrok/Premium, engine `grok-cli`); or any OpenAI-compatible HTTP
169
+ - **At least one LLM backend:** a Claude subscription (engine
170
+ `claude-cli` — Claude Code is bundled, `somora auth login`); a ChatGPT
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
161
173
  server (Ollama, LM Studio, vLLM, oMLX, OpenRouter, …).
162
174
 
163
175
  Optional: an **Obsidian vault** for the shared wiki and read-only vault
@@ -190,7 +202,7 @@ then starts the **setup assistant**:
190
202
 
191
203
  ```text
192
204
  somora setup
193
- 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
194
206
  2 Web search a Brave Search API key, so agents can search the web
195
207
  3 First agent name, language, model and a backup model
196
208
  4 Memory REM, Deep and Lucid — and where the shared wiki lives
@@ -203,7 +215,7 @@ Every step first looks at what is already there, so `somora setup` is safe
203
215
  to run again — as a whole or one step (`somora setup access`). Update
204
216
  later with `somora update`.
205
217
 
206
- Already have Node ≥22.13 and the tools from [Requirements](#requirements)?
218
+ Already have Node ≥22.22.2 and the tools from [Requirements](#requirements)?
207
219
  Then it is two commands: `npm install -g somora && somora setup`.
208
220
 
209
221
  ### Already using a coding agent? Let it set up somora.
@@ -261,8 +273,9 @@ sudo apt install tmux ripgrep build-essential # Debian/Ubuntu
261
273
  npm install -g somora
262
274
 
263
275
  # 3. Log in to at least one LLM backend (pick one or more)
264
- curl -fsSL https://claude.ai/install.sh | bash && claude auth login # Claude subscription
276
+ somora auth login # Claude subscription; Claude Code is bundled
265
277
  somora codex login # ChatGPT subscription; Codex is bundled
278
+ somora grok login # SuperGrok or Premium subscription; the Grok CLI is bundled
266
279
  # local models: run Ollama / LM Studio / oMLX and add the endpoint to
267
280
  # ~/.somora/config.yaml after step 4
268
281
 
@@ -291,18 +304,15 @@ daily:
291
304
  | Memory auto-injection | ✓ | ✓ | ✓ | ✓ |
292
305
  | Memory tools (read + write) | ✓ via MCP | ✓ dynamic tools | ✓ via MCP | ✓ in-process |
293
306
  | Wiki layer (shared) | ✓ | ✓ | ✓ | ✓ |
294
- | Three-phase dreams | ✓ | ✓ | as chat model only¹ | ✓ |
307
+ | Three-phase dreams | ✓ | ✓ | ✓ | ✓ |
295
308
  | Tool surface | ✓ via MCP | ✓ dynamic tools | ✓ via MCP | ✓ in-process |
296
309
  | Skills (markdown how-tos) | ✓ | ✓ | ✓ | ✓ |
297
- | Multimodal attachments (image, PDF) | ✓ native | ✓ image native, PDF rasterized | text only | ✓ image; PDF native or rasterized per provider |
298
- | 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 |
299
312
  | Sub-agents, agent-to-agent questions, follow-ups | ✓ | ✓ | ✓ | ✓ |
300
313
  | SSH-resource exec | ✓ | ✓ | ✓ | ✓ |
301
314
 
302
- ¹ grok-cli has no one-shot path, so it cannot serve as a dream or
303
- compaction *worker* — configure those on another engine.
304
-
305
- ² Off until an `imageGen` / `videoGen` block exists. Verified end-to-end
315
+ ¹ Off until an `imageGen` / `videoGen` block exists. Verified end-to-end
306
316
  against a self-hosted OpenAI-shaped endpoint; the hosted providers
307
317
  (OpenAI images/video, Google Veo) are implemented to their published
308
318
  shapes but **not yet tested against a live account**.
@@ -353,7 +363,7 @@ Three first-party clients, all hitting the same local server:
353
363
  |---|---|---|
354
364
  | **TUI** | `somora tui` | Terminal multi-agent chat with full keyboard control, the session's queue (`/queue`), memory and tool detail toggles. |
355
365
  | **Web** | `https://<host>.<tailnet>.ts.net:18737/web/` | A browser desktop: one window per agent, drag-and-drop attachments and screenshots, tmux app and shell terminal, Wiki Explorer with link graph, Media gallery, Sessions browser, the agent's Chromium window, server log, Abilities matrix (which tools and skills each agent may use), Team and Agent windows, a queue badge per session (what runs, what waits, what is arriving — take back or stop from there), dictation and spoken replies, and a voice window for a live call. HTTPS required; LAN-trust, no auth. [docs/web.md](docs/web.md) |
356
- | **Mobile (PWA)** | `…:18737/mobile/`, then "Add to Home Screen" | The phone app: avatar row to switch agent, one chat per agent, the same queue sheet, voice input and spoken replies, photo/PDF attachments via the native picker. [docs/mobile.md](docs/mobile.md) |
366
+ | **Mobile (PWA)** | `…:18737/mobile/`, then "Add to Home Screen" | The phone app: avatar row to switch agent, a sheet in the header to switch session and model or restore an archived session, the same queue sheet, voice input and spoken replies, photo/PDF attachments via the native picker. [docs/mobile.md](docs/mobile.md) |
357
367
 
358
368
  Anything else can talk to the server the same way the clients do:
359
369
  [docs/api.md](docs/api.md) is the HTTP + SSE + WebSocket reference.
@@ -366,7 +376,7 @@ and searchable: [docs.somora.ai](https://docs.somora.ai).
366
376
 
367
377
  - **Get running:** [setup](docs/setup.md) · [models](docs/models.md) · [agents](docs/agents.md) · [team](docs/team.md) · [security](docs/security.md)
368
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)
369
- - **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)
370
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)
371
381
  - **Models in detail:** [thinking](docs/thinking.md) · [sampling](docs/sampling.md)
372
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.
@@ -110,6 +110,11 @@ providers:
110
110
  engine: openai-compatible
111
111
  baseUrl: http://localhost:11434/v1
112
112
  apiKey: lm-studio
113
+ # After a pause this long, earlier memory blocks leave the replayed
114
+ # history (docs/memory.md — "Old blocks after a pause"). Default 60,
115
+ # about when a paid provider's cache has expired; a server of your
116
+ # own can use less.
117
+ # dropMemoryBlocksAfterIdleMinutes: 10
113
118
  models:
114
119
  - id: gemma-4-31b-it-8bit
115
120
  alias: gemma4big
@@ -119,6 +124,17 @@ providers:
119
124
  alias: gemma4small
120
125
  contextWindow: 131072
121
126
  capabilities: [text, image]
127
+ # A reasoning model: its words for the levels, and the level used
128
+ # when neither session nor agent sets one (docs/models.md —
129
+ # "When no level is set"). Without `default` nothing is sent and
130
+ # the model decides.
131
+ # - id: qwen3.8-flash-next
132
+ # alias: qwen
133
+ # contextWindow: 524288
134
+ # capabilities: [text, image, reasoning]
135
+ # reasoning:
136
+ # levels: { "off": low, high: xhigh }
137
+ # default: high
122
138
 
123
139
  # Same engine, different host — totally fine.
124
140
  # ollama:
@@ -140,6 +156,7 @@ providers:
140
156
  # engine: openai-compatible
141
157
  # baseUrl: https://openrouter.ai/api/v1
142
158
  # apiKey: <YOUR_OPENROUTER_KEY>
159
+ # dropMemoryBlocksAfterIdleMinutes: 60 # the default, shown for completeness
143
160
  # models:
144
161
  # - id: anthropic/claude-haiku-4.5
145
162
  # alias: orhaiku
@@ -154,6 +171,11 @@ providers:
154
171
  # contextWindow: 262144
155
172
  # capabilities: [text]
156
173
 
174
+ # Attachments and images sent to a model (docs/files.md).
175
+ # attachments:
176
+ # maxImageBytes: 5242880 # largest image sent, after scaling
177
+ # maxImageEdge: 2048 # longer side in pixels; larger images are scaled down first, 0 = off
178
+
157
179
  # Vision / multimodal worker (Phase Y). Optional. When set, the
158
180
  # `analyze_file` tool dispatches images and PDFs to the worker model
159
181
  # and returns its text analysis — useful when the active main model
@@ -172,6 +194,10 @@ providers:
172
194
  # when the local worker sits on a GPU box that runs one profile at a
173
195
  # time: without a chain, a profile switch takes analyze_file down for
174
196
  # every agent at once, and quietly.
197
+ #
198
+ # PDFs take the same chain: a worker with `pdf` gets the document, one
199
+ # with only `image` the first 20 pages as images. `pdfWorker` is only
200
+ # needed when PDFs should go to a model that reads the document itself.
175
201
  # vision:
176
202
  # worker: openrouter/anthropic/claude-haiku-4-5 # single model, still valid
177
203
  # pdfWorker: openrouter/anthropic/claude-sonnet-4-6 # optional override for PDFs
@@ -274,6 +300,21 @@ providers:
274
300
  # autoPlayVoiceReplies: false
275
301
  # allowUserOverride: true
276
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
+
277
318
  # Image generation — text-to-image via an OpenAI-shaped image endpoint
278
319
  # (OpenRouter's /api/v1/images, OpenAI's /v1/images/generations, or a
279
320
  # local server that speaks the same shape). Same standalone posture as
@@ -507,7 +548,7 @@ providers:
507
548
  # their own tool-call loop — currently openai-compatible — for the per-
508
549
  # tool-call race. The longTask* values ALSO inform CLI-engine tools
509
550
  # (subagent_result, agent_ask) which run inside MCP children, so all
510
- # three engines honor the same caller-friendly politik for slow models.
551
+ # engines honor the same caller-friendly policy for slow models.
511
552
  #
512
553
  # Three timeout knobs, each for a different tool class:
513
554
  # 1. toolCallTimeoutMs — fast tools (memory, web, file, time)
@@ -722,6 +763,7 @@ providers:
722
763
  # historyWeightEmpty: 0.8 # … when it has none ("you should know that, right?")
723
764
  # historyTurnChars: 800 # chars taken from each history turn
724
765
  # shortQueryBm25Weight: 0.5 # BM25 weight for 1–2-word messages (null = hybrid.bm25Weight)
766
+ # skipRepeats: true # a section the model still has in context is not injected again
725
767
  # hybrid:
726
768
  # vectorWeight: 0.7 # weight of vector similarity in fused score
727
769
  # bm25Weight: 0.3 # weight of BM25/FTS5 in fused score
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: