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.
- package/README.md +23 -17
- package/bin/node-version.d.mts +3 -0
- package/bin/node-version.mjs +42 -1
- package/bin/preinstall-check.mjs +55 -0
- package/bin/somora.mjs +7 -1
- package/config.example.yaml +24 -9
- package/docs/agents.md +12 -8
- package/docs/api.md +39 -11
- package/docs/builder.md +1 -2
- package/docs/cache-strategy.md +2 -2
- package/docs/compaction.md +10 -9
- package/docs/decisions.md +198 -0
- package/docs/dream-phases.md +13 -4
- package/docs/files.md +6 -0
- package/docs/image-handling.md +104 -0
- package/docs/index.md +3 -1
- package/docs/lsp.md +2 -2
- package/docs/mcp.md +12 -7
- package/docs/mobile.md +5 -3
- package/docs/models.md +51 -11
- package/docs/security.md +24 -13
- package/docs/setup.md +41 -15
- package/docs/skills.md +19 -3
- package/docs/thinking.md +5 -5
- package/docs/tools.md +60 -21
- package/docs/web.md +4 -1
- package/package.json +39 -28
- package/src/attachments/store.ts +4 -4
- package/src/cli/auth.ts +1 -1
- package/src/cli/grok.ts +53 -0
- package/src/cli/server-call.ts +1 -1
- package/src/cli/setup.ts +37 -2
- package/src/cli/somora.ts +25 -6
- package/src/cli/tui/header.tsx +5 -16
- package/src/cli/tui/separator.tsx +2 -3
- package/src/cli/update-args.ts +1 -1
- package/src/compaction/summarize.ts +18 -5
- package/src/config/loader.ts +1 -1
- package/src/config/types.ts +64 -9
- package/src/config/yaml.ts +21 -0
- package/src/decisions/client.ts +302 -0
- package/src/dream/deep-llm.ts +51 -14
- package/src/dream/deep-worker.ts +31 -1
- package/src/dream/lucid-worker.ts +52 -3
- package/src/dream/rem-extract.ts +3 -3
- package/src/dream/scheduler-state.ts +36 -1
- package/src/engine/codex-thread-config.ts +24 -0
- package/src/engine/grok-bin.ts +105 -0
- package/src/engine/grok-cli.ts +678 -50
- package/src/engine/grok-home.ts +99 -0
- package/src/engine/openai-compatible.ts +9 -2
- package/src/engine/types.ts +10 -1
- package/src/mcp/server.ts +6 -0
- package/src/memory/embeddings.ts +11 -6
- package/src/multimodal/attachment-note.ts +83 -0
- package/src/multimodal/user-content.ts +1 -1
- package/src/persona/files.ts +20 -1
- package/src/persona/loader.ts +1 -1
- package/src/persona/skill-gating-store.ts +11 -5
- package/src/persona/tool-gating-store.ts +21 -4
- package/src/server/index.ts +117 -20
- package/src/server/loopback-fetch.ts +3 -0
- package/src/server/openai-client.ts +3 -0
- package/src/server/run-turn.ts +11 -1
- package/src/server/session-compact.ts +22 -1
- package/src/server/steer-inbox.ts +2 -2
- package/src/setup/config-edit.ts +1 -1
- package/src/setup/presets.ts +10 -2
- package/src/skills/gating.ts +21 -9
- package/src/team/store.ts +1 -1
- package/src/team/write.ts +1 -1
- package/src/tools/decision/tools.ts +220 -0
- package/src/tools/gating-edit.ts +148 -0
- package/src/tools/gating.ts +92 -30
- package/src/tools/index.ts +7 -0
- package/src/tools/registry.ts +1 -1
- package/src/tools/types.ts +11 -0
- package/src/types/events.ts +8 -0
- package/web/dist/assets/index-CQYoTOJB.js +68 -0
- package/web/dist/assets/index-CQYoTOJB.js.map +1 -0
- package/web/dist/assets/index-EeNggYDu.css +1 -0
- package/web/dist/index.html +2 -2
- package/web/package.json +8 -11
- package/web/tsconfig.json +1 -1
- package/web-mobile/dist/assets/index-3_sWEIih.js +47 -0
- package/web-mobile/dist/assets/index-3_sWEIih.js.map +1 -0
- package/web-mobile/dist/assets/index-Y6fhA0_3.css +1 -0
- package/web-mobile/dist/index.html +2 -2
- package/web-mobile/package.json +7 -7
- package/web/dist/assets/index-40x__Izy.js +0 -636
- package/web/dist/assets/index-40x__Izy.js.map +0 -1
- package/web/dist/assets/index-CZFgQRsq.css +0 -32
- package/web-mobile/dist/assets/index-CxILeHfe.js +0 -88
- package/web-mobile/dist/assets/index-CxILeHfe.js.map +0 -1
- package/web-mobile/dist/assets/index-Cyr13VGR.css +0 -1
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Decision models
|
|
2
|
+
|
|
3
|
+
A decision model does not write text. It answers questions you define
|
|
4
|
+
about a state you supply, with probabilities: yes or no, one of several
|
|
5
|
+
choices, or a position on a scale. somora gives agents a tool for it,
|
|
6
|
+
`decision_evaluate`.
|
|
7
|
+
|
|
8
|
+
## What you get
|
|
9
|
+
|
|
10
|
+
- **Typed answers instead of prose.** A probability for yes, the chosen
|
|
11
|
+
label with the full distribution, or a fractional position on your
|
|
12
|
+
scale. An agent can compare them against a threshold.
|
|
13
|
+
- **Fast and cheap per question.** A short request takes a fraction of a
|
|
14
|
+
second, so an agent can sort many similar items without a chat model
|
|
15
|
+
reading each one.
|
|
16
|
+
- **Images, when the model reads them.** An agent can ask "is there a red
|
|
17
|
+
car in this photo?" about a picture it was sent or took itself.
|
|
18
|
+
- **No silent cut-offs.** An input over the limit is refused with the
|
|
19
|
+
token count, never evaluated in part.
|
|
20
|
+
|
|
21
|
+
## Set it up
|
|
22
|
+
|
|
23
|
+
Add a `decisions` block to `config.yaml`. `model` names the entry the
|
|
24
|
+
tool uses:
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
decisions:
|
|
28
|
+
model: clef
|
|
29
|
+
models:
|
|
30
|
+
- name: clef
|
|
31
|
+
baseUrl: https://<your-host>/clef # requests go to <baseUrl>/v1/systemone
|
|
32
|
+
apiKey: <key> # leave out for a server without authentication
|
|
33
|
+
model: clef
|
|
34
|
+
capabilities: [text, image]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Reload the config or restart the server. Every agent then has
|
|
38
|
+
`decision_evaluate`, unless you switch it off for an agent in the
|
|
39
|
+
Abilities window. Without a `decisions.model`, no agent sees the tool.
|
|
40
|
+
|
|
41
|
+
## Which models work
|
|
42
|
+
|
|
43
|
+
somora speaks the System One API: `POST <baseUrl>/v1/systemone`. The
|
|
44
|
+
models page lists the decision models somora was run with.
|
|
45
|
+
|
|
46
|
+
| Model | Where it runs | Images | Checked with somora |
|
|
47
|
+
|---|---|---|---|
|
|
48
|
+
| Clef | Self-hosted, Cloudflare's open decision model | yes | yes |
|
|
49
|
+
| Jev | TypeSafe AI, hosted | no, text only | no |
|
|
50
|
+
|
|
51
|
+
Jev was not tested with somora. By its public description it speaks the
|
|
52
|
+
same API, so the same block with Jev's address, key and model name
|
|
53
|
+
should work. Treat it as untested.
|
|
54
|
+
|
|
55
|
+
## How an agent uses it
|
|
56
|
+
|
|
57
|
+
The agent sends a `state` and a map of `questions`. The state is text, a
|
|
58
|
+
JSON object or array. Each question has a type:
|
|
59
|
+
|
|
60
|
+
| Type | The agent writes | The answer |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| `boolean` | `instructions`, or `criteria.true` and `criteria.false`, or both. One of them is required: the question id is not read. | `probabilityTrue` from 0 to 1 |
|
|
63
|
+
| `choice` | `criteria`: 2 to 255 labels with descriptions | `choice`, `confidence` and every label's probability |
|
|
64
|
+
| `score` | `criteria`: 2 to 10 ordered levels, lowest first | `score` from 0 to `max`, `confidence` and each level's probability |
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"state": "Checkout throws errors, orders do not go through.",
|
|
69
|
+
"questions": {
|
|
70
|
+
"outage": { "type": "boolean", "instructions": "Is a service down?" },
|
|
71
|
+
"team": { "type": "choice", "criteria": { "billing": "Payments and invoices", "technical": "Bugs and outages" } },
|
|
72
|
+
"urgency": { "type": "score", "criteria": ["can wait", "this week", "today"] }
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
A call takes 1 to 256 questions. They are independent and answered in
|
|
78
|
+
one pass. A question that
|
|
79
|
+
depends on another answer needs a second call. Question ids only label
|
|
80
|
+
the answers: the meaning goes into `instructions` and `criteria`.
|
|
81
|
+
|
|
82
|
+
A score is a position, not a percentage. With three levels, `max` is 2,
|
|
83
|
+
and a score of 1.87 sits close to the top level.
|
|
84
|
+
|
|
85
|
+
On the wire the yes/no type is called `noul`. Agents write `boolean`;
|
|
86
|
+
somora translates both ways.
|
|
87
|
+
|
|
88
|
+
## Images
|
|
89
|
+
|
|
90
|
+
With `image` in the model's `capabilities`, the tool takes up to four
|
|
91
|
+
image paths in `images`. The tool reads the files itself and scales each
|
|
92
|
+
one like any image shown to a model, to `attachments.maxImageEdge`
|
|
93
|
+
pixels on the longest side. PNG, JPEG and WebP are accepted. Without the
|
|
94
|
+
capability, agents do not see the `images` field.
|
|
95
|
+
|
|
96
|
+
For a picture sent in the chat, the agent uses the original path named
|
|
97
|
+
in the message. The image handling page explains which file is which.
|
|
98
|
+
|
|
99
|
+
Paths go in the top-level `images` field. Image paths put inside the
|
|
100
|
+
`state` would reach the model as text, so such a call is refused with
|
|
101
|
+
`unsupported-input` and nothing is sent. After scaling, each image may
|
|
102
|
+
be at most 4 MB and 16 megapixels, all images together at most 8 MB.
|
|
103
|
+
The files are read under the same rules as `file_read`.
|
|
104
|
+
|
|
105
|
+
Each image counts toward the input limit. One scaled image costs about
|
|
106
|
+
3 000 tokens.
|
|
107
|
+
|
|
108
|
+
## Limits and time
|
|
109
|
+
|
|
110
|
+
The input limit is the lower of two numbers: `maxInputTokens` from your
|
|
111
|
+
config, and what the server reports at `GET <baseUrl>/v1/models`. With
|
|
112
|
+
neither, the server decides. somora reads the server's value at most
|
|
113
|
+
every ten minutes, so a change there takes effect without a restart.
|
|
114
|
+
|
|
115
|
+
Before sending, somora estimates the size and refuses a clearly too long
|
|
116
|
+
input. A server that rejects an input as too long (HTTP 413) passes its
|
|
117
|
+
error message on, or the limit when it sends none. A server that cuts
|
|
118
|
+
the input off silently is caught too: when it reports exactly its limit
|
|
119
|
+
as the tokens read, the answers are discarded. When the server allows
|
|
120
|
+
more than your `maxInputTokens`, its exact count is checked against
|
|
121
|
+
yours after the call.
|
|
122
|
+
|
|
123
|
+
Long inputs and images take time. A short request answers in well under
|
|
124
|
+
a second; several images or tens of thousands of tokens take tens of
|
|
125
|
+
seconds, and long requests queue behind each other. `timeoutMs` defaults
|
|
126
|
+
to 90 seconds for that reason.
|
|
127
|
+
|
|
128
|
+
## What comes back
|
|
129
|
+
|
|
130
|
+
A successful call returns the answers by question id, with the tokens
|
|
131
|
+
read and the limit that applied:
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"status": "ok",
|
|
136
|
+
"model": "clef",
|
|
137
|
+
"answers": {
|
|
138
|
+
"outage": { "type": "boolean", "probabilityTrue": 0.93 },
|
|
139
|
+
"team": { "type": "choice", "choice": "technical", "confidence": 0.88, "probabilities": { "billing": 0.12, "technical": 0.88 } },
|
|
140
|
+
"urgency": { "type": "score", "score": 1.87, "max": 2, "confidence": 0.8, "probabilities": [0.02, 0.09, 0.89], "legend": ["can wait", "this week", "today"] }
|
|
141
|
+
},
|
|
142
|
+
"usage": { "inputTokens": 412, "outputTokens": 0 },
|
|
143
|
+
"inputLimit": 16000,
|
|
144
|
+
"ms": 240
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## When it does not answer
|
|
149
|
+
|
|
150
|
+
A result is either `ok` or `unavailable`. An unavailable result names a
|
|
151
|
+
`reason`, adds `guidance` (what to do) and often a `detail`. A failure never counts as a no.
|
|
152
|
+
|
|
153
|
+
| Reason | Meaning |
|
|
154
|
+
|---|---|
|
|
155
|
+
| `not-configured` | No `decisions.model` is set. |
|
|
156
|
+
| `images-unsupported` | Images were sent to a model without the `image` capability. |
|
|
157
|
+
| `authentication` | The server rejected the key. |
|
|
158
|
+
| `rate-limited` | The server asks to slow down. |
|
|
159
|
+
| `not-ready` | The server is up but the model is not, for example not loaded right now. |
|
|
160
|
+
| `transport` | The server could not be reached, or answered with an unexpected HTTP error. |
|
|
161
|
+
| `too-long` | The input exceeds the limit. Nothing was sent, or the server's answers were discarded because its exact count was above your `maxInputTokens`. |
|
|
162
|
+
| `truncated` | The server cut the input off. The answers were discarded. |
|
|
163
|
+
| `unsupported-input` | The request was rejected, or an image could not be used. |
|
|
164
|
+
| `invalid-response` | The answers did not match the questions. |
|
|
165
|
+
| `deadline` | No answer within `timeoutMs`. |
|
|
166
|
+
|
|
167
|
+
There is no automatic fallback to another model. The agent carries on
|
|
168
|
+
without the answer or tries again later.
|
|
169
|
+
|
|
170
|
+
## Settings
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
decisions:
|
|
174
|
+
model: "" # the entry in use; empty turns the tool off
|
|
175
|
+
models: []
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
| Setting | Default | Meaning |
|
|
179
|
+
|---|---|---|
|
|
180
|
+
| `decisions.model` | empty | Name of the entry `decision_evaluate` uses. Must match one of `models`. |
|
|
181
|
+
| `models[].name` | required | Short handle. Letters, digits, `-` and `_`. |
|
|
182
|
+
| `models[].baseUrl` | required | Server root. Requests go to `<baseUrl>/v1/systemone`. |
|
|
183
|
+
| `models[].apiKey` | unset | Sent as `Authorization: Bearer`. Leave out when the server needs none. |
|
|
184
|
+
| `models[].model` | required | Sent as the request's `model` field. |
|
|
185
|
+
| `models[].maxInputTokens` | unset | Your input limit. When the server reports a lower one, that applies. |
|
|
186
|
+
| `models[].capabilities` | `[text]` | Add `image` for a model that reads images. |
|
|
187
|
+
| `models[].timeoutMs` | `90000` | Longest wait for one evaluation, 5 000 to 600 000. |
|
|
188
|
+
|
|
189
|
+
Each call writes one `decision.evaluate` line to the server log: model,
|
|
190
|
+
number of questions and images, time, tokens and the result. The state
|
|
191
|
+
and the questions are not logged.
|
|
192
|
+
|
|
193
|
+
## See also
|
|
194
|
+
|
|
195
|
+
- [Image handling](image-handling.md): which image file an agent is shown and which it hands on
|
|
196
|
+
- [Models](models.md): the models somora was run with, decision models included
|
|
197
|
+
- [Tools](tools.md): every tool, and how to switch tools off per agent
|
|
198
|
+
- [Agents](agents.md): the Abilities window and per-agent settings
|
package/docs/dream-phases.md
CHANGED
|
@@ -68,9 +68,10 @@ disk, whoever wrote them.
|
|
|
68
68
|
### Which models can do the work
|
|
69
69
|
|
|
70
70
|
A worker model can sit on an `openai-compatible` provider, on
|
|
71
|
-
`claude-cli` or on `
|
|
72
|
-
therefore enough for all three phases. A
|
|
73
|
-
|
|
71
|
+
`claude-cli`, on `codex-cli` or on `grok-cli`. A Claude, ChatGPT or
|
|
72
|
+
Grok subscription is therefore enough for all three phases. A worker on
|
|
73
|
+
a subscription engine runs locked down like a chat turn: no shell, no
|
|
74
|
+
web search, no plugins or MCP servers of its own.
|
|
74
75
|
|
|
75
76
|
## REM
|
|
76
77
|
|
|
@@ -247,6 +248,11 @@ Every `wiki.deep.intervalHours` (default 12). The rhythm survives
|
|
|
247
248
|
restarts. On a fresh install the first run is one interval after the
|
|
248
249
|
first start.
|
|
249
250
|
|
|
251
|
+
A run that a restart, an update or a crash cut off is retried one hour
|
|
252
|
+
after it started, at most twice in a row. If both retries are cut off
|
|
253
|
+
too, the next run follows the regular rhythm. The log reads
|
|
254
|
+
`dream.deep.scheduled` with `reason: "interrupted"` and the attempt.
|
|
255
|
+
|
|
250
256
|
Run it now with `dream_run({phase: 'deep'})` or `POST /dream/run-deep`.
|
|
251
257
|
Only one Deep run is active at a time.
|
|
252
258
|
|
|
@@ -351,7 +357,9 @@ still readable in archived runs. No run produces them.
|
|
|
351
357
|
### When Lucid runs
|
|
352
358
|
|
|
353
359
|
Every `wiki.lucid.intervalDays` (default 7), with the same restart-safe
|
|
354
|
-
rhythm as Deep
|
|
360
|
+
rhythm as Deep, including the retry of a cut-off run an hour after it
|
|
361
|
+
started. The cut-off run's file is marked `failed` with
|
|
362
|
+
`error: "interrupted: …"` at the next start. Run it now with `dream_run({phase: 'lucid'})` or
|
|
355
363
|
`POST /dream/run-lucid`.
|
|
356
364
|
|
|
357
365
|
While a run still has findings waiting, no new run starts. The schedule
|
|
@@ -687,6 +695,7 @@ curl -X POST http://127.0.0.1:18737/dream/run-lucid -d '{"wait":true}'
|
|
|
687
695
|
| A note never reaches the wiki | It is remembered as skipped. Run Deep with `force: true`. `dream.deep.merge_shrink_blocked` means the shrink guard refused the merge. |
|
|
688
696
|
| Which model answered | `dream.worker_unavailable` and `dream.worker_switched` in the log, `answeredBy` on `dream.deep.done`, `answered_by` in the Lucid run file. |
|
|
689
697
|
| Lucid does not start | `dream.lucid.skip_pending`: an earlier run still has open findings. Review it or use `force: true`. |
|
|
698
|
+
| A run was cut off by a restart | `dream.lucid.run_interrupted`, then `dream.lucid.scheduled` or `dream.deep.scheduled` with `reason: "interrupted"`: the retry follows an hour after the run started. |
|
|
690
699
|
| Lucid found fewer findings than expected | `dream.lucid.run_capped` lists what `maxFindings` dropped. `batches_failed` in the run file shows calls that failed. |
|
|
691
700
|
|
|
692
701
|
## See also
|
package/docs/files.md
CHANGED
|
@@ -200,6 +200,11 @@ gets:
|
|
|
200
200
|
- the review image after `image_generate`
|
|
201
201
|
- images from external MCP tools
|
|
202
202
|
- attachments replayed from earlier turns
|
|
203
|
+
- images sent to a decision model with `decision_evaluate`
|
|
204
|
+
|
|
205
|
+
Tools that work on an image, such as `image_generate` with
|
|
206
|
+
`reference_images`, get the original instead. The image handling page
|
|
207
|
+
describes the whole rule.
|
|
203
208
|
|
|
204
209
|
Text in screenshots stays readable. A 4K or Retina screenshot is
|
|
205
210
|
scaled by about half, which brings its text to the size it has on an
|
|
@@ -561,3 +566,4 @@ extension get a delete followed by a rename.
|
|
|
561
566
|
- [Projects](projects.md): pinning a session to a project folder.
|
|
562
567
|
- [API](api.md): every route in detail, including the chat routes.
|
|
563
568
|
- [Tools](tools.md): the list of all tools.
|
|
569
|
+
- [Image handling](image-handling.md): which image file a model sees and which a tool gets.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Image handling
|
|
2
|
+
|
|
3
|
+
somora keeps every image in full resolution and shows models a scaled
|
|
4
|
+
copy. Looking at a picture uses the copy. Working on a picture, such as
|
|
5
|
+
editing it with an image model, uses the original.
|
|
6
|
+
|
|
7
|
+
## What you get
|
|
8
|
+
|
|
9
|
+
- **Small requests.** Every model is shown images at most
|
|
10
|
+
`attachments.maxImageEdge` pixels on the longest side, 2048 by default.
|
|
11
|
+
- **Full quality where it counts.** Tools that change an image get the
|
|
12
|
+
original file, not the copy a model looked at.
|
|
13
|
+
- **Pictures an agent can hand on.** A model is told where the original
|
|
14
|
+
of every image in the chat is, so it can pass it to a tool.
|
|
15
|
+
- **One behaviour everywhere.** The same rule holds on every engine and
|
|
16
|
+
in every client.
|
|
17
|
+
|
|
18
|
+
## How images arrive
|
|
19
|
+
|
|
20
|
+
| Way in | What is stored |
|
|
21
|
+
|---|---|
|
|
22
|
+
| Dragged or picked in the web client | The original, in `~/.somora/attachments/` |
|
|
23
|
+
| Picked or photographed in the mobile app | The original, in `~/.somora/attachments/` |
|
|
24
|
+
| The screenshot button in the web client | The full-resolution capture, stored like an upload |
|
|
25
|
+
| A file in the workspace | The file itself |
|
|
26
|
+
| A browser screenshot (`browser` with `op: "screenshot"`) | A PNG in the workspace; the result names its path |
|
|
27
|
+
| An image an agent generated | A file in the images folder; the result names its path |
|
|
28
|
+
|
|
29
|
+
Uploads are not scaled before they leave the browser. They are stored
|
|
30
|
+
under a name made from their content, such as `d8f1….jpg`, so the same
|
|
31
|
+
picture sent twice is kept once.
|
|
32
|
+
|
|
33
|
+
## Looking at an image
|
|
34
|
+
|
|
35
|
+
Whatever path an image takes to a model, the model gets the scaled copy:
|
|
36
|
+
|
|
37
|
+
| Path | What the model gets |
|
|
38
|
+
|---|---|
|
|
39
|
+
| An image in the chat, for a model that can see | The scaled copy, in the message |
|
|
40
|
+
| `file_read` on an image | The scaled copy |
|
|
41
|
+
| `analyze_file` | The scaled copy, described by a vision worker |
|
|
42
|
+
| `decision_evaluate` with `images` | The scaled copy, sent to the decision model |
|
|
43
|
+
| An image in the chat, for a model that cannot see | A vision worker's description of the scaled copy |
|
|
44
|
+
|
|
45
|
+
The scaled copy is made once and kept next to the original as
|
|
46
|
+
`<original>.model-<edge>-<key>.<ext>`. An image that already fits is
|
|
47
|
+
sent as it is.
|
|
48
|
+
|
|
49
|
+
## Working on an image
|
|
50
|
+
|
|
51
|
+
Tools that change or reuse a picture get the original file:
|
|
52
|
+
|
|
53
|
+
| Tool | What it gets |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `image_generate` with `reference_images` | The original |
|
|
56
|
+
| `video_generate` with `reference_images` | The original |
|
|
57
|
+
|
|
58
|
+
An agent names the file by its path. For a file in the workspace or a
|
|
59
|
+
generated image that path is known. For an image sent in the chat, the
|
|
60
|
+
model is told it.
|
|
61
|
+
|
|
62
|
+
## The original path in the message
|
|
63
|
+
|
|
64
|
+
For every image in the chat, the model gets one line with the original:
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
[Image attachment "car.png" (6000×4000) — original, full resolution: /home/you/.somora/attachments/d8f1….png — what you are shown may be a scaled-down copy. Pass this path to tools that need the image file (for example image_generate reference_images); never pass a ".model-" copy.]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The line names the original's size as it is shown, so an upright phone
|
|
71
|
+
photo reads as portrait, and its path. The size is left out when it
|
|
72
|
+
cannot be read.
|
|
73
|
+
|
|
74
|
+
The line is part of the message on every engine, and later turns still
|
|
75
|
+
see it, so the picture can be handed on. An attachment whose file is
|
|
76
|
+
gone loses the line. An agent passes this path to tools. It
|
|
77
|
+
never passes the path of a `.model-` copy: that is the small version.
|
|
78
|
+
|
|
79
|
+
## Models without vision
|
|
80
|
+
|
|
81
|
+
A model without the `image` capability is not sent images. A vision
|
|
82
|
+
worker describes each one, and its description goes into the message
|
|
83
|
+
with the original path line. The description stays in the history.
|
|
84
|
+
Without a vision worker, sending an image to such a model is refused.
|
|
85
|
+
|
|
86
|
+
## Limits
|
|
87
|
+
|
|
88
|
+
| Setting | Default | Meaning |
|
|
89
|
+
|---|---|---|
|
|
90
|
+
| `attachments.maxImageEdge` | `2048` | Longest side, in pixels, of the copy a model is shown. `0` sends images as they are. |
|
|
91
|
+
| `attachments.maxImageBytes` | 5 MB | Largest image a model is sent, after scaling. |
|
|
92
|
+
| `attachments.maxPerTurn` | `10` | Attachments per message. |
|
|
93
|
+
|
|
94
|
+
An upload may be larger than `maxImageBytes`: with scaling on, a source
|
|
95
|
+
image of up to 50 MB is accepted and scaled before it reaches a model.
|
|
96
|
+
Decision models have their own limits for images, listed on their page.
|
|
97
|
+
|
|
98
|
+
## See also
|
|
99
|
+
|
|
100
|
+
- [File tools](files.md): `file_read` and `analyze_file`, on this machine and on SSH resources
|
|
101
|
+
- [Decision models](decisions.md): asking typed questions about images and text
|
|
102
|
+
- [Image generation](imagegen.md): creating and editing images
|
|
103
|
+
- [Web client](web.md): uploads and the screenshot button
|
|
104
|
+
- [Mobile app](mobile.md): attachments from the phone
|
package/docs/index.md
CHANGED
|
@@ -10,7 +10,7 @@ each page is for.
|
|
|
10
10
|
- **Agents with memory.** Each agent has its own character, model and
|
|
11
11
|
notes. Background phases turn finished conversations into notes and
|
|
12
12
|
into a shared wiki.
|
|
13
|
-
- **Your models.** A Claude or
|
|
13
|
+
- **Your models.** A Claude, ChatGPT or Grok subscription, a local model
|
|
14
14
|
server or an API key. somora brings no model of its own.
|
|
15
15
|
- **Three clients.** A desktop in the browser, an app for the phone and
|
|
16
16
|
a terminal client. All talk to the same server.
|
|
@@ -119,6 +119,8 @@ takes about ten minutes. [Setup](setup.md) explains each step.
|
|
|
119
119
|
|---|---|---|
|
|
120
120
|
| [Tools](tools.md) | Tool catalog | Every tool an agent can have, and how to limit them per agent |
|
|
121
121
|
| [File tools](files.md) | File tools in depth | Working with `file_read`/`file_write`/`analyze_file` |
|
|
122
|
+
| [Image handling](image-handling.md) | How images travel | Which file a model sees and which one a tool gets |
|
|
123
|
+
| [Decision models](decisions.md) | Typed decisions | Asking a decision model yes/no, choice and score questions, with images |
|
|
122
124
|
| [Resources](resources.md) | SSH targets | Adding a remote machine |
|
|
123
125
|
| [tmux](tmux.md) | Multi-turn shell sessions | Driving long-running CLIs from agents |
|
|
124
126
|
| [Shared browser](browser.md) | Shared browser | A Chromium per agent profile that agents drive and you can take over for logins |
|
package/docs/lsp.md
CHANGED
|
@@ -78,8 +78,8 @@ model knows what to expect: `typescript ✓`, `pyright — off`, or
|
|
|
78
78
|
alone for ten minutes, then tried again.
|
|
79
79
|
|
|
80
80
|
The servers live in the main somora process. The file tools ask it over
|
|
81
|
-
loopback HTTP, so builders on the
|
|
82
|
-
the same verdicts.
|
|
81
|
+
loopback HTTP, so builders on the CLI engines (`claude-cli`,
|
|
82
|
+
`codex-cli`, `grok-cli`) get the same verdicts.
|
|
83
83
|
|
|
84
84
|
## The project root
|
|
85
85
|
|
package/docs/mcp.md
CHANGED
|
@@ -138,7 +138,9 @@ tools:
|
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
A pattern is an exact tool name, `toolset:<tag>` for a family, or a
|
|
141
|
-
name ending in `*`. `deny` beats
|
|
141
|
+
name ending in `*`. A name under `deny` beats everything; a match under
|
|
142
|
+
`allow` beats a family, server or `*` rule under `deny`, which makes it
|
|
143
|
+
an exception. An agent without a `tools:`
|
|
142
144
|
block sees everything. A change applies from the agent's next turn.
|
|
143
145
|
|
|
144
146
|
A hidden tool is absent from the model's tool list on all four engines,
|
|
@@ -177,10 +179,12 @@ Good to know:
|
|
|
177
179
|
`tools.deny`.
|
|
178
180
|
- A chat agent does not see the `builder` toolset.
|
|
179
181
|
|
|
180
|
-
A switch
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
A switch on one tool writes its name into the agent's `agent.yaml`.
|
|
183
|
+
The eye on a server switched off writes one rule, `mcp__<server>__*`,
|
|
184
|
+
so a tool the server adds later stays off too. One tool switched back
|
|
185
|
+
on inside it becomes an exception under `allow`. Comments and the rest
|
|
186
|
+
of the file stay as they are. The window is always editable; rules you
|
|
187
|
+
wrote by hand still apply and are listed as a note.
|
|
184
188
|
|
|
185
189
|
## Servers with an OAuth login
|
|
186
190
|
|
|
@@ -385,8 +389,9 @@ curl -sk https://localhost:18737/mcp/status | jq
|
|
|
385
389
|
curl -sk -X POST https://localhost:18737/mcp/servers/<name>/reconnect
|
|
386
390
|
```
|
|
387
391
|
|
|
388
|
-
The abilities window reads
|
|
389
|
-
`GET
|
|
392
|
+
The abilities window reads an agent's tool visibility with
|
|
393
|
+
`GET /agents/<name>/tools` and writes one click at a time with
|
|
394
|
+
`POST /agents/<name>/tools/toggle`. `PUT` replaces the whole block.
|
|
390
395
|
|
|
391
396
|
## Files
|
|
392
397
|
|
package/docs/mobile.md
CHANGED
|
@@ -21,10 +21,12 @@ Terminals, file windows and the multi-window desktop stay in the
|
|
|
21
21
|
|
|
22
22
|
## Install it
|
|
23
23
|
|
|
24
|
-
You need
|
|
24
|
+
You need three things first:
|
|
25
25
|
|
|
26
|
-
1.
|
|
27
|
-
|
|
26
|
+
1. iOS or iPadOS 16.4, or a current Chrome on Android (version 111 or
|
|
27
|
+
newer).
|
|
28
|
+
2. Tailscale installed and connected on the phone.
|
|
29
|
+
3. somora served over HTTPS. A home-screen app only installs from a
|
|
28
30
|
secure address. The setup guide covers this under
|
|
29
31
|
"HTTPS (Tailscale)".
|
|
30
32
|
|
package/docs/models.md
CHANGED
|
@@ -220,24 +220,35 @@ filesystem. `gpt-5.5` calls the same tools directly.
|
|
|
220
220
|
## Grok subscription
|
|
221
221
|
|
|
222
222
|
Engine `grok-cli`, for a SuperGrok or Premium subscription. somora
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
runs the bundled Grok CLI (xAI's `@xai-official/grok`, the exact
|
|
224
|
+
version is pinned in somora's `package.json`) over ACP for each turn.
|
|
225
|
+
A `grok` installed on the host is used only on a platform somora
|
|
226
|
+
ships no Grok build for, or when `SOMORA_GROK_BIN` names it.
|
|
227
|
+
`somora grok login` signs in
|
|
228
|
+
with the bundled one, and an existing `grok login` is picked up
|
|
229
|
+
automatically. `somora grok models` lists the models your
|
|
230
|
+
subscription offers.
|
|
226
231
|
|
|
227
232
|
```yaml
|
|
228
233
|
providers:
|
|
229
234
|
xai:
|
|
230
235
|
engine: grok-cli
|
|
231
236
|
models:
|
|
232
|
-
- id: grok-4.
|
|
237
|
+
- id: grok-4.7
|
|
233
238
|
alias: grok
|
|
234
|
-
contextWindow:
|
|
235
|
-
capabilities: [text, reasoning]
|
|
239
|
+
contextWindow: 256000 # what Grok reports for the model
|
|
240
|
+
capabilities: [text, image, reasoning]
|
|
236
241
|
```
|
|
237
242
|
|
|
238
243
|
| Model | contextWindow | Notes | Checked |
|
|
239
244
|
|---|---|---|---|
|
|
240
|
-
| `grok-4.
|
|
245
|
+
| `grok-4.7` | 256000 | Thinking levels are passed as `--reasoning-effort`. `off` is sent as `low`, because the model always reasons. `reasoning.levels` is applied. Images go to Grok as images, PDFs as page images. | yes: chat, tools, thinking text, images and PDFs, steering, stop, `/compact`, model switch and back |
|
|
246
|
+
|
|
247
|
+
Grok compacts its own conversation near the end of the window, and a
|
|
248
|
+
row in the chat says so. `/compact` asks Grok to compact now. A Grok
|
|
249
|
+
model can also be the worker for REM, Deep, Lucid and compaction: each
|
|
250
|
+
request runs in a fresh Grok session without tools, which is removed
|
|
251
|
+
afterwards.
|
|
241
252
|
|
|
242
253
|
## Self hosted models
|
|
243
254
|
|
|
@@ -449,9 +460,8 @@ come first. The [thinking guide](thinking.md) lists the order.
|
|
|
449
460
|
| Worker | Engines |
|
|
450
461
|
|---|---|
|
|
451
462
|
| Vision worker for `analyze_file` | `openai-compatible` only |
|
|
452
|
-
| REM, Deep, Lucid, compaction | `openai-compatible`, `claude-cli`, `codex-cli` |
|
|
463
|
+
| REM, Deep, Lucid, compaction | `openai-compatible`, `claude-cli`, `codex-cli`, `grok-cli` |
|
|
453
464
|
|
|
454
|
-
`grok-cli` cannot be a worker of any kind.
|
|
455
465
|
|
|
456
466
|
## Hosted models through OpenRouter
|
|
457
467
|
|
|
@@ -503,6 +513,34 @@ providers:
|
|
|
503
513
|
> model and the turn carries a fallback chip. Check the header, not
|
|
504
514
|
> just the reply.
|
|
505
515
|
|
|
516
|
+
## Decision models
|
|
517
|
+
|
|
518
|
+
Models that answer typed questions instead of writing text, used by the
|
|
519
|
+
`decision_evaluate` tool. They have their own `decisions` block in
|
|
520
|
+
`config.yaml`, separate from `providers`, and are never picked as a
|
|
521
|
+
chat model.
|
|
522
|
+
|
|
523
|
+
```yaml
|
|
524
|
+
decisions:
|
|
525
|
+
model: clef
|
|
526
|
+
models:
|
|
527
|
+
- name: clef
|
|
528
|
+
baseUrl: https://<your-host>/clef
|
|
529
|
+
apiKey: <key>
|
|
530
|
+
model: clef
|
|
531
|
+
capabilities: [text, image]
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
| Model | Where it runs | Images | Input limit | Checked |
|
|
535
|
+
|---|---|---|---|---|
|
|
536
|
+
| Clef | Self-hosted, Cloudflare's open decision model | yes, up to 4 per call | what the server reports at `/v1/models` | yes: all three question types, images, the limit, refusal of too long input |
|
|
537
|
+
| Jev | TypeSafe AI, hosted | no | per its documentation | no: not tested with somora |
|
|
538
|
+
|
|
539
|
+
Clef's answer time grows with the input: a short request takes well
|
|
540
|
+
under a second, four images or tens of thousands of tokens take tens of
|
|
541
|
+
seconds. Jev speaks the same API by its public description; somora was
|
|
542
|
+
checked against Clef only.
|
|
543
|
+
|
|
506
544
|
## Settings
|
|
507
545
|
|
|
508
546
|
A model entry with every field. Only `id` and `contextWindow` are
|
|
@@ -534,7 +572,7 @@ providers:
|
|
|
534
572
|
|
|
535
573
|
| Field | Default | openai-compatible | claude-cli | codex-cli | grok-cli |
|
|
536
574
|
|---|---|---|---|---|---|
|
|
537
|
-
| `contextWindow` | required | compaction trigger, worker choice, display. Use the server's limit. | worker choice, display. The native window is right. | worker choice, display. Use the Codex session window, 258400. |
|
|
575
|
+
| `contextWindow` | required | compaction trigger, worker choice, display. Use the server's limit. | worker choice, display. The native window is right. | worker choice, display. Use the Codex session window, 258400. | display. Grok reports the window itself, and that number is shown. |
|
|
538
576
|
| `capabilities` | `[text]` | `image` and `pdf` gate attachments, `reasoning` decides whether a thinking level is sent | same | same | same |
|
|
539
577
|
| `alias` | none | short name for `model:` in `agent.yaml`, letters, digits, `-` and `_` | same | same | same |
|
|
540
578
|
| `reasoning.default` | unset | the thinking level used when session and agent set none, in somora's words; sent explicitly and shown as the model's default | same | same | same |
|
|
@@ -587,7 +625,7 @@ not in `user`.
|
|
|
587
625
|
|
|
588
626
|
## Minimum versions
|
|
589
627
|
|
|
590
|
-
- Node.js 22.
|
|
628
|
+
- Node.js 22.22.2 or newer. Every `somora` command refuses an older Node.
|
|
591
629
|
- A current Claude Code for `claude-cli`.
|
|
592
630
|
- Codex needs no separate install. somora bundles the exact version
|
|
593
631
|
pinned in its `package.json`.
|
|
@@ -620,3 +658,5 @@ update.
|
|
|
620
658
|
- [Agents](agents.md): `model` and `fallback` in `agent.yaml`
|
|
621
659
|
- [Security](security.md): what a CLI engine can reach inside a somora
|
|
622
660
|
session
|
|
661
|
+
- [Decision models](decisions.md): the `decisions` block and the
|
|
662
|
+
`decision_evaluate` tool
|
package/docs/security.md
CHANGED
|
@@ -10,10 +10,10 @@ agents are trusted helpers with guard rails, not sandboxed programs.
|
|
|
10
10
|
|
|
11
11
|
- **Private by default.** The server listens on `127.0.0.1` only.
|
|
12
12
|
Opening it to your network is one explicit setting.
|
|
13
|
-
- **Only somora's tools.** The Claude and
|
|
14
|
-
own built-in tools and your personal CLI setup switched off.
|
|
15
|
-
- **Separate engine homes.** Your interactive Claude Code and
|
|
16
|
-
state never reaches an agent. Only the login is shared.
|
|
13
|
+
- **Only somora's tools.** The Claude, Codex and Grok engines run with
|
|
14
|
+
their own built-in tools and your personal CLI setup switched off.
|
|
15
|
+
- **Separate engine homes.** Your interactive Claude Code, Codex and
|
|
16
|
+
Grok state never reaches an agent. Only the login is shared.
|
|
17
17
|
- **Guard rails against accidents.** Destructive shell commands and
|
|
18
18
|
reads of private keys are refused.
|
|
19
19
|
- **One documented request home.** A daily version check with no
|
|
@@ -225,12 +225,23 @@ no MCP server is configured.
|
|
|
225
225
|
|
|
226
226
|
### Grok
|
|
227
227
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
228
|
+
somora starts `grok agent --no-leader --always-approve stdio` for
|
|
229
|
+
each turn and hands Grok an agent profile with the session:
|
|
230
|
+
|
|
231
|
+
- **Only somora's tools.** The profile allows two tools, `search_tool`
|
|
232
|
+
and `use_tool`, which reach somora's MCP server. Grok's built-in
|
|
233
|
+
terminal, file, web search, scheduler and subagent tools are off, so
|
|
234
|
+
everything an agent does passes through somora's gating and rules.
|
|
235
|
+
`--always-approve` therefore approves only somora's own tools.
|
|
236
|
+
- **somora's system prompt.** It replaces Grok's own prompt, and is
|
|
237
|
+
sent again on every resume.
|
|
238
|
+
- **No skills and no `AGENTS.md`** from the working folder.
|
|
239
|
+
|
|
240
|
+
Grok runs with its own home, `~/.somora/grok-home` (`GROK_HOME`), not
|
|
241
|
+
with your `~/.grok`. Your Grok sessions, plugins, MCP servers and
|
|
242
|
+
settings stay out of somora. Grok's own cross-session memory is off
|
|
243
|
+
(`GROK_MEMORY=0`), its self-update is off, and `--no-leader` keeps
|
|
244
|
+
each turn in a private process instead of a shared one.
|
|
234
245
|
|
|
235
246
|
### OpenAI compatible
|
|
236
247
|
|
|
@@ -264,7 +275,7 @@ no encrypted store.
|
|
|
264
275
|
|---|---|
|
|
265
276
|
| Claude login | `~/.somora/claude-home/.credentials.json`, kept identical to `~/.claude/.credentials.json` |
|
|
266
277
|
| Codex login | `~/.somora/codex-home/auth.json`, copied from `~/.codex/auth.json` when that one is newer |
|
|
267
|
-
| Grok login | `~/.grok/auth.json`,
|
|
278
|
+
| Grok login | `~/.somora/grok-home/auth.json`, kept in step with `~/.grok/auth.json`: the copy that expires later wins, in both directions |
|
|
268
279
|
| API keys of providers | `apiKey` under `providers` in `~/.somora/config.yaml` |
|
|
269
280
|
| Secrets for skills and tools | `~/.somora/somora.env`, loaded into the server's environment at start |
|
|
270
281
|
| SSH keys for resources | the file named by `resources.<name>.keyPath`. Pinned host keys are in `~/.somora/known_hosts.json`. |
|
|
@@ -381,8 +392,8 @@ Per agent, in `agent.yaml`:
|
|
|
381
392
|
|
|
382
393
|
| Setting | Default | Meaning |
|
|
383
394
|
|---|---|---|
|
|
384
|
-
| `tools.deny` | none | Tools the agent does not get. Exact name, `toolset:<tag>`, or a name ending in `*`.
|
|
385
|
-
| `tools.allow` | none |
|
|
395
|
+
| `tools.deny` | none | Tools the agent does not get. Exact name, `toolset:<tag>`, or a name ending in `*`. A name here beats `allow`; a family rule here does not. |
|
|
396
|
+
| `tools.allow` | none | Exceptions: tools switched on inside a family that `deny` switches off. Without such a family rule it keeps the older meaning, only these tools. |
|
|
386
397
|
|
|
387
398
|
## Commands and routes
|
|
388
399
|
|