somora 2026.1001.2 → 2026.1001.4
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 +12 -5
- package/config.example.yaml +10 -0
- package/docs/api.md +13 -5
- package/docs/setup.md +60 -5
- package/package.json +2 -9
- package/src/cli/setup.ts +54 -1
- package/src/cli/somora.ts +69 -4
- package/src/cli/update-args.ts +1 -1
- package/src/config/reload.ts +1 -0
- package/src/config/types.ts +16 -0
- package/src/server/index.ts +20 -1
- package/src/server/update-check.ts +202 -0
- package/web/dist/assets/index-BA5mmiV0.css +32 -0
- package/web/dist/assets/{index-BaVv6pB2.js → index-CrkkIfd9.js} +42 -42
- package/web/dist/assets/index-CrkkIfd9.js.map +1 -0
- package/web/dist/index.html +2 -2
- package/npm-shrinkwrap.json +0 -5661
- package/web/dist/assets/index-BaVv6pB2.js.map +0 -1
- package/web/dist/assets/index-V3FV3Z25.css +0 -32
package/README.md
CHANGED
|
@@ -164,6 +164,12 @@ recall; **Tailscale** for HTTPS to the web and mobile clients
|
|
|
164
164
|
clipboard APIs); **ripgrep** for `file_search`; **Chromium or Chrome** for
|
|
165
165
|
the shared browser.
|
|
166
166
|
|
|
167
|
+
somora makes one request of its own: once a day it asks somora.ai
|
|
168
|
+
whether a newer version exists (version, OS, Node version and CPU in the
|
|
169
|
+
User-Agent, nothing else; somora.ai counts installations from its
|
|
170
|
+
server log). `DO_NOT_TRACK=1` or `updateCheck.enabled: false` switches it
|
|
171
|
+
off — [docs/setup.md → The daily update check](docs/setup.md#the-daily-update-check--what-somoraai-sees).
|
|
172
|
+
|
|
167
173
|
[docs/setup.md](docs/setup.md) is the full install walkthrough,
|
|
168
174
|
[docs/models.md](docs/models.md) lists the models known to run with somora
|
|
169
175
|
and their tested config blocks.
|
|
@@ -183,11 +189,12 @@ then starts the **setup assistant**:
|
|
|
183
189
|
```text
|
|
184
190
|
somora setup
|
|
185
191
|
1 Models connect a Claude or ChatGPT subscription, or your own model server
|
|
186
|
-
2
|
|
187
|
-
3
|
|
188
|
-
4
|
|
189
|
-
5
|
|
190
|
-
6
|
|
192
|
+
2 Web search a Brave Search API key, so agents can search the web
|
|
193
|
+
3 First agent name, language, model and a backup model
|
|
194
|
+
4 Memory REM, Deep and Lucid — and where the shared wiki lives
|
|
195
|
+
5 Team who is who, once there is more than one agent
|
|
196
|
+
6 Access HTTPS through Tailscale, so phone and laptop can reach it
|
|
197
|
+
7 Start + test starts the service and sends your agent a real message
|
|
191
198
|
```
|
|
192
199
|
|
|
193
200
|
Every step first looks at what is already there, so `somora setup` is safe
|
package/config.example.yaml
CHANGED
|
@@ -723,6 +723,16 @@ providers:
|
|
|
723
723
|
# # lifted for questions about a month / what changed / when
|
|
724
724
|
# pageSupport: 0.3 # a page matching in several sections gains support (0 = off)
|
|
725
725
|
|
|
726
|
+
# The daily update check — the one request somora makes on its own:
|
|
727
|
+
# once a day GET https://somora.ai/api/latest-version with the version,
|
|
728
|
+
# OS, Node version and CPU in the User-Agent, nothing else. somora.ai
|
|
729
|
+
# logs the request with its IP address and counts installations from
|
|
730
|
+
# that (docs/setup.md → "The daily update check"). DO_NOT_TRACK=1 or a
|
|
731
|
+
# CI variable in the environment switch it off as well.
|
|
732
|
+
# updateCheck:
|
|
733
|
+
# enabled: true
|
|
734
|
+
# endpoint: https://somora.ai/api/latest-version # a mirror of your own
|
|
735
|
+
|
|
726
736
|
# Obsidian vault + wiki layer (docs/wiki.md, docs/dream-phases.md).
|
|
727
737
|
# The vault is read as a recall source for every agent; the wiki is a
|
|
728
738
|
# subfolder of it that Deep writes (memory → wiki consolidation) and
|
package/docs/api.md
CHANGED
|
@@ -62,9 +62,9 @@ it on Tailscale or on `127.0.0.1` and tunnel.
|
|
|
62
62
|
|
|
63
63
|
## Versioning & stability
|
|
64
64
|
|
|
65
|
-
- The version returned by `GET /version` is
|
|
66
|
-
`2026.
|
|
67
|
-
|
|
65
|
+
- The version returned by `GET /version` is calendar-based and valid
|
|
66
|
+
semver: `2026.1001.2` is the second build of 1 October 2026. Several
|
|
67
|
+
builds a day are common during active work.
|
|
68
68
|
- Most endpoints listed here are stable — the TUI and web both use
|
|
69
69
|
them, and breaking them would break the shipped clients.
|
|
70
70
|
- Endpoints marked **⚠ experimental** may change shape in any bump.
|
|
@@ -78,13 +78,21 @@ it on Tailscale or on `127.0.0.1` and tunnel.
|
|
|
78
78
|
|
|
79
79
|
### `GET /version`
|
|
80
80
|
|
|
81
|
-
Returns the running somora version
|
|
81
|
+
Returns the running somora version and, once the daily update check has
|
|
82
|
+
answered, what somora.ai says is current ([setup.md → The daily update
|
|
83
|
+
check](setup.md#the-daily-update-check--what-somoraai-sees)).
|
|
82
84
|
|
|
83
85
|
```bash
|
|
84
86
|
curl https://<host>:18737/version
|
|
85
|
-
# { "version": "2026.
|
|
87
|
+
# { "version": "2026.1001.2", "update": null }
|
|
88
|
+
# { "version": "2026.1001.2",
|
|
89
|
+
# "update": { "latestVersion": "2026.1005.1", "available": true, "note": "update Node first" } }
|
|
86
90
|
```
|
|
87
91
|
|
|
92
|
+
`update` is `null` until the first check has run (or when it is switched
|
|
93
|
+
off); `available` is true when `latestVersion` is newer than `version`;
|
|
94
|
+
`note` is optional.
|
|
95
|
+
|
|
88
96
|
### `GET /healthz`
|
|
89
97
|
|
|
90
98
|
Liveness probe. Returns the plain-text `ok` with status 200. Use it
|
package/docs/setup.md
CHANGED
|
@@ -42,12 +42,13 @@ every GitHub release as `install.sh`.
|
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
44
|
somora setup # all steps
|
|
45
|
-
somora setup access # one step: models | agent | memory | team | access | start
|
|
45
|
+
somora setup access # one step: models | search | agent | memory | team | access | start
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
| Step | What it does |
|
|
49
49
|
|---|---|
|
|
50
50
|
| `models` | Claude subscription (installs Claude Code if missing, runs its login), ChatGPT subscription (the bundled Codex login, browser or device code), or your own OpenAI-compatible server (asks the address, lists its models, asks the context window). Writes the `providers:` block with the tested settings from [models.md](models.md). |
|
|
51
|
+
| `search` | Web search: asks for a Brave Search API key (free plan, 2,000 searches a month), checks it with one real search and stores it under `web.brave.apiKey` — that switches the agents' `web_search` tool on. |
|
|
51
52
|
| `agent` | Creates the first agent: name, how it addresses you, answer language, model, backup model. On an existing install it lists the agents and offers to repair one whose model no longer exists. |
|
|
52
53
|
| `memory` | Turns on REM per agent (with its own model), the duplicate check for new notes, and the shared wiki with Deep and Lucid — in a new folder or an existing Obsidian vault ([dream-phases.md](dream-phases.md), [wiki.md](wiki.md)). |
|
|
53
54
|
| `team` | With two or more agents: writes the first `team.yaml` ([team.md](team.md)). |
|
|
@@ -129,10 +130,16 @@ single-window-only; the TUI is unaffected.
|
|
|
129
130
|
npm install -g somora
|
|
130
131
|
```
|
|
131
132
|
|
|
132
|
-
The package carries the built web clients
|
|
133
|
-
(`
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
The package carries the built web clients. One native module
|
|
134
|
+
(`node-pty`) is compiled during the install on Linux — that is what the
|
|
135
|
+
compiler from §1 is for. The install is about 1.4 GB: somora itself is
|
|
136
|
+
20 MB, the rest are the bundled Codex and Claude engines (each a
|
|
137
|
+
complete program for your platform), the embedding runtime for the
|
|
138
|
+
memory search, the image library and the terminal module. The embedding
|
|
139
|
+
runtime would also download a 300 MB CUDA library on Linux that somora
|
|
140
|
+
never uses (embeddings run on the CPU); the installer and `somora
|
|
141
|
+
update` skip it with `ONNXRUNTIME_NODE_INSTALL=skip` — set the same
|
|
142
|
+
variable when you run `npm install -g somora` by hand.
|
|
136
143
|
|
|
137
144
|
If npm answers `EACCES`, its global folder belongs to root. Give npm a
|
|
138
145
|
folder of your own instead of reaching for `sudo`:
|
|
@@ -916,6 +923,54 @@ auto-cleanup entirely (manual `sentinel delete` only). Recurring
|
|
|
916
923
|
triggers don't auto-GC — they end up in `paused` or `error` and you
|
|
917
924
|
choose when to remove them.
|
|
918
925
|
|
|
926
|
+
## The daily update check — what somora.ai sees
|
|
927
|
+
|
|
928
|
+
somora runs on your machine and talks to the model providers you
|
|
929
|
+
configured. There is exactly one request it makes on its own: once a
|
|
930
|
+
day the server asks somora.ai whether a newer version exists, and the
|
|
931
|
+
answer shows up as an update notice in the web client's taskbar, in
|
|
932
|
+
`somora server status` and in the server log (`update.available`).
|
|
933
|
+
`somora update` itself keeps using npm.
|
|
934
|
+
|
|
935
|
+
```http
|
|
936
|
+
GET https://somora.ai/api/latest-version
|
|
937
|
+
User-Agent: somora/2026.1001.2 (linux; node/22.23.2; x64; server)
|
|
938
|
+
```
|
|
939
|
+
|
|
940
|
+
That is the whole request: no body, no install identifier, no machine
|
|
941
|
+
id, no random token — the version, operating system, Node.js version,
|
|
942
|
+
CPU and whether the server or the CLI asked. The answer is
|
|
943
|
+
`{"version": "…", "note": "…"}`; the note is an optional sentence from
|
|
944
|
+
us to everyone ("update Node first"), at most 500 characters.
|
|
945
|
+
|
|
946
|
+
**What we do with it.** Like any web server, somora.ai logs the request
|
|
947
|
+
together with its IP address and the approximate location Cloudflare
|
|
948
|
+
derives from it (country, region, city). From those logs we count how
|
|
949
|
+
many installations ask — per day, per version, per operating system —
|
|
950
|
+
to know whether the project is used and what to test on. The raw logs
|
|
951
|
+
are deleted after 90 days, daily totals are kept, nothing is published
|
|
952
|
+
and nothing is passed on. Counting by IP address is approximate by
|
|
953
|
+
nature: two instances behind one router look alike, and many home
|
|
954
|
+
connections change their address.
|
|
955
|
+
|
|
956
|
+
**Switching it off.** Any of these stops the request entirely:
|
|
957
|
+
|
|
958
|
+
- `DO_NOT_TRACK=1` in the service's environment (the common
|
|
959
|
+
convention), or
|
|
960
|
+
- `updateCheck.enabled: false` in `config.yaml`, or
|
|
961
|
+
- a `CI` variable in the environment — a test pipeline is not an
|
|
962
|
+
installation.
|
|
963
|
+
|
|
964
|
+
`somora telemetry show` prints the request as it would be sent, why the
|
|
965
|
+
check is on or off, and when it last ran. `updateCheck.endpoint` points
|
|
966
|
+
the check at a mirror of your own. The last answer lives in
|
|
967
|
+
`~/.somora/update-check.json`.
|
|
968
|
+
|
|
969
|
+
The first check runs one to six minutes after the server starts (a
|
|
970
|
+
random delay, so a fleet restarting together does not knock in unison);
|
|
971
|
+
after a success the next one is a day later, after a failure an hour
|
|
972
|
+
later. A failed check never affects anything else.
|
|
973
|
+
|
|
919
974
|
## HTTPS (Tailscale) — required for the web client at scale
|
|
920
975
|
|
|
921
976
|
The web client opens **one persistent SSE connection per chat window**.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "somora",
|
|
3
|
-
"version": "2026.1001.
|
|
3
|
+
"version": "2026.1001.4",
|
|
4
4
|
"description": "A self-hosted multi-agent harness: your agents, your models, one server — with memory, a shared wiki, a web desktop, a phone app and a terminal client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"web-mobile/dist",
|
|
44
44
|
"tsconfig.json",
|
|
45
45
|
"package.json",
|
|
46
|
-
"npm-shrinkwrap.json",
|
|
47
46
|
"README.md",
|
|
48
47
|
"LICENSE",
|
|
49
48
|
"!src/**/*.test.mts",
|
|
@@ -65,7 +64,7 @@
|
|
|
65
64
|
"@anthropic-ai/claude-agent-sdk": "^0.3.152",
|
|
66
65
|
"@anthropic-ai/sdk": "^0.99.0",
|
|
67
66
|
"@hono/node-server": "2.1.1",
|
|
68
|
-
"@huggingface/transformers": "^4.
|
|
67
|
+
"@huggingface/transformers": "^4.3.0",
|
|
69
68
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
70
69
|
"@mozilla/readability": "^0.6.0",
|
|
71
70
|
"@openai/codex": "0.153.4",
|
|
@@ -106,11 +105,5 @@
|
|
|
106
105
|
"@types/turndown": "^5.0.6",
|
|
107
106
|
"@types/ws": "^8.18.1",
|
|
108
107
|
"typescript": "^6.0.3"
|
|
109
|
-
},
|
|
110
|
-
"overrides": {
|
|
111
|
-
"sharp": "^0.35.4",
|
|
112
|
-
"onnxruntime-node": {
|
|
113
|
-
"adm-zip": "^0.6.0"
|
|
114
|
-
}
|
|
115
108
|
}
|
|
116
109
|
}
|
package/src/cli/setup.ts
CHANGED
|
@@ -38,11 +38,12 @@ const AGENTS_DIR = join(SOMORA_HOME, 'agents');
|
|
|
38
38
|
const UNIT_PATH = join(HOME, '.config', 'systemd', 'user', 'somora.service');
|
|
39
39
|
const BIN_PATH = process.env.SOMORA_BIN_PATH ?? '';
|
|
40
40
|
|
|
41
|
-
const STEPS = ['models', 'agent', 'memory', 'team', 'access', 'start'] as const;
|
|
41
|
+
const STEPS = ['models', 'search', 'agent', 'memory', 'team', 'access', 'start'] as const;
|
|
42
42
|
type Step = (typeof STEPS)[number];
|
|
43
43
|
|
|
44
44
|
const STEP_TITLES: Record<Step, string> = {
|
|
45
45
|
models: 'Models — which AI your agents use',
|
|
46
|
+
search: 'Web search',
|
|
46
47
|
agent: 'Your first agent',
|
|
47
48
|
memory: 'Memory and dreaming',
|
|
48
49
|
team: 'Team',
|
|
@@ -419,6 +420,57 @@ async function stepModels(ctx: Ctx): Promise<void> {
|
|
|
419
420
|
if (save(config, 'config', 'models saved')) ctx.needsRestart = true;
|
|
420
421
|
}
|
|
421
422
|
|
|
423
|
+
// ─── step: search ─────────────────────────────────────────────────────
|
|
424
|
+
|
|
425
|
+
/** One request to Brave with the key: is it accepted? */
|
|
426
|
+
async function braveKeyWorks(key: string): Promise<true | string> {
|
|
427
|
+
try {
|
|
428
|
+
const r = await fetch('https://api.search.brave.com/res/v1/web/search?q=somora&count=1', {
|
|
429
|
+
headers: { Accept: 'application/json', 'X-Subscription-Token': key },
|
|
430
|
+
signal: AbortSignal.timeout(10_000),
|
|
431
|
+
});
|
|
432
|
+
if (r.ok) return true;
|
|
433
|
+
if (r.status === 401 || r.status === 403 || r.status === 422) return `Brave rejected the key (HTTP ${r.status}) — copy it again from the dashboard`;
|
|
434
|
+
if (r.status === 429) return 'Brave answered "rate limited" (429) — the key works, but the monthly quota is used up';
|
|
435
|
+
return `Brave answered HTTP ${r.status}`;
|
|
436
|
+
} catch (err) {
|
|
437
|
+
return `could not reach Brave: ${(err as Error).message}`;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
async function stepSearch(ctx: Ctx): Promise<void> {
|
|
442
|
+
const { p } = ctx;
|
|
443
|
+
const config = openConfig();
|
|
444
|
+
const current = getIn(config, ['web', 'brave', 'apiKey']);
|
|
445
|
+
if (typeof current === 'string' && current) {
|
|
446
|
+
ok('web search is on (Brave Search API key present)');
|
|
447
|
+
if (!(await p.confirm('Replace the key?', false))) return;
|
|
448
|
+
} else {
|
|
449
|
+
explain(`Agents can search the web through the Brave Search API: they get the
|
|
450
|
+
\`web_search\` tool, and \`web_fetch\` reads the pages it finds. The free plan
|
|
451
|
+
allows 2,000 searches a month. Without a key the agents can still read a page
|
|
452
|
+
you give them, but not search.
|
|
453
|
+
1. create an account at https://api-dashboard.search.brave.com
|
|
454
|
+
2. choose the free "Data for Search" plan and create an API key
|
|
455
|
+
3. paste the key here (it is stored in config.yaml, which only you can read)`);
|
|
456
|
+
if (!(await p.confirm('Do you have a Brave Search API key?', false))) {
|
|
457
|
+
warn('skipped — add it later with `somora setup search`');
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
const key = await p.askValid('API key', undefined, (v) => (v.length < 10 ? 'that is too short for a key' : /\s/.test(v) ? 'a key has no spaces' : null));
|
|
462
|
+
say(` ${dim('checking the key with one search…')}`);
|
|
463
|
+
const result = await braveKeyWorks(key);
|
|
464
|
+
if (result !== true) {
|
|
465
|
+
warn(result);
|
|
466
|
+
if (!(await p.confirm('Store it anyway?', false))) return;
|
|
467
|
+
} else {
|
|
468
|
+
ok('Brave accepted the key');
|
|
469
|
+
}
|
|
470
|
+
setIn(config, ['web', 'brave', 'apiKey'], key);
|
|
471
|
+
if (save(config, 'config', 'web search saved')) ctx.needsRestart = true;
|
|
472
|
+
}
|
|
473
|
+
|
|
422
474
|
// ─── step: agent ──────────────────────────────────────────────────────
|
|
423
475
|
|
|
424
476
|
function personaFiles(name: string, userName: string, language: string): Record<string, string> {
|
|
@@ -833,6 +885,7 @@ async function stepStart(ctx: Ctx): Promise<void> {
|
|
|
833
885
|
|
|
834
886
|
const RUN: Record<Step, (ctx: Ctx) => Promise<void>> = {
|
|
835
887
|
models: stepModels,
|
|
888
|
+
search: stepSearch,
|
|
836
889
|
agent: stepAgent,
|
|
837
890
|
memory: stepMemory,
|
|
838
891
|
team: stepTeam,
|
package/src/cli/somora.ts
CHANGED
|
@@ -24,6 +24,8 @@ import { fileURLToPath } from 'node:url';
|
|
|
24
24
|
import { SOMORA_VERSION } from '../version.ts';
|
|
25
25
|
import { buildSystemdUnit, extractCustomEnvLines, nodePathLine } from './systemd-unit.ts';
|
|
26
26
|
import { allowScriptsArgs, compareVersions, parseUpdateArgs } from './update-args.ts';
|
|
27
|
+
import { load as parseYaml } from 'js-yaml';
|
|
28
|
+
import { DEFAULT_UPDATE_ENDPOINT, readState, statusFrom, type UpdateCheckStatus } from '../server/update-check.ts';
|
|
27
29
|
import {
|
|
28
30
|
LAUNCHD_LABEL, launchdAvailable, launchdLoaded, launchdPid, launchdPlistPath, launchdRestart, launchdStart,
|
|
29
31
|
launchdStop, nodeDirOnPath, writeLaunchdPlist,
|
|
@@ -80,6 +82,7 @@ Usage:
|
|
|
80
82
|
what is installed, install with npm into ~/.somora/lsp
|
|
81
83
|
somora wiki migrate [step] [id] move a grown wiki onto the folder template (docs/wiki.md):
|
|
82
84
|
guided, or plan|judge|status|approve|dry-run|run|undo
|
|
85
|
+
somora telemetry show what the daily update check sends to somora.ai, and when
|
|
83
86
|
somora update [<version>|--edge] install from npm + rebake systemd + restart
|
|
84
87
|
(run \`somora update --help\` for options)
|
|
85
88
|
somora --version show version
|
|
@@ -377,6 +380,17 @@ function cmdServerStatus(): number {
|
|
|
377
380
|
} else {
|
|
378
381
|
process.stdout.write(`lockfile: ${LOCKFILE_PATH} (none — no server running)\n`);
|
|
379
382
|
}
|
|
383
|
+
const update = updateStatus();
|
|
384
|
+
if (update.latestVersion) {
|
|
385
|
+
// somora.ai may still name the previous version for up to an hour
|
|
386
|
+
// after a release — then this install is the newer one, not behind.
|
|
387
|
+
const newer = compareVersions(SOMORA_VERSION, update.latestVersion) > 0;
|
|
388
|
+
process.stdout.write(update.updateAvailable
|
|
389
|
+
? ` update: ${update.latestVersion} is available — run \`somora update\`${update.note ? ` (${update.note})` : ''}\n`
|
|
390
|
+
: newer
|
|
391
|
+
? ` update: none — somora.ai reports ${update.latestVersion}, this install is newer\n`
|
|
392
|
+
: ` update: none — ${update.latestVersion} is the current version\n`);
|
|
393
|
+
}
|
|
380
394
|
if (launchdAvailable()) {
|
|
381
395
|
const installed = existsSync(launchdPlistPath());
|
|
382
396
|
const pid = installed ? launchdPid() : null;
|
|
@@ -525,13 +539,17 @@ async function cmdUpdate(args: string[]): Promise<number> {
|
|
|
525
539
|
return 1;
|
|
526
540
|
}
|
|
527
541
|
|
|
528
|
-
//
|
|
529
|
-
//
|
|
530
|
-
//
|
|
542
|
+
// somora never runs embeddings on CUDA (the embedder uses the CPU
|
|
543
|
+
// provider), so the 300 MB CUDA library onnxruntime-node would
|
|
544
|
+
// download on Linux is skipped — a fifth of the install.
|
|
531
545
|
const spec = `${SOMORA_NPM_NAME}@${target.version}`;
|
|
532
546
|
process.stdout.write(` npm install -g ${spec}\n`);
|
|
533
547
|
const allow = allowScriptsArgs(run('npm', ['config', 'get', 'allow-scripts']).stdout);
|
|
534
|
-
const ri = spawnSync('npm', ['install', '-g', '--no-audit', '--no-fund', ...allow, spec], {
|
|
548
|
+
const ri = spawnSync('npm', ['install', '-g', '--no-audit', '--no-fund', ...allow, spec], {
|
|
549
|
+
encoding: 'utf8',
|
|
550
|
+
stdio: ['inherit', 'inherit', 'pipe'],
|
|
551
|
+
env: { ...process.env, ONNXRUNTIME_NODE_INSTALL: 'skip' },
|
|
552
|
+
});
|
|
535
553
|
if (ri.stderr) process.stderr.write(ri.stderr);
|
|
536
554
|
if (ri.status !== 0) {
|
|
537
555
|
if (/EACCES/.test(ri.stderr ?? '')) {
|
|
@@ -578,6 +596,51 @@ async function cmdUpdate(args: string[]): Promise<number> {
|
|
|
578
596
|
return 0;
|
|
579
597
|
}
|
|
580
598
|
|
|
599
|
+
// ─── telemetry ──────────────────────────────────────────────────────
|
|
600
|
+
|
|
601
|
+
function updateStatus(): UpdateCheckStatus {
|
|
602
|
+
const file = join(SOMORA_HOME, 'config.yaml');
|
|
603
|
+
let enabled = true;
|
|
604
|
+
let endpoint = DEFAULT_UPDATE_ENDPOINT;
|
|
605
|
+
try {
|
|
606
|
+
const raw = parseYaml(readFileSync(file, 'utf8')) as { updateCheck?: { enabled?: unknown; endpoint?: unknown } } | null;
|
|
607
|
+
if (raw?.updateCheck?.enabled === false) enabled = false;
|
|
608
|
+
if (typeof raw?.updateCheck?.endpoint === 'string') endpoint = raw.updateCheck.endpoint;
|
|
609
|
+
} catch {
|
|
610
|
+
/* no config yet — defaults */
|
|
611
|
+
}
|
|
612
|
+
return statusFrom({ version: SOMORA_VERSION, configEnabled: enabled, endpoint, surface: 'cli', state: readState(join(SOMORA_HOME, 'update-check.json')) });
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/** `somora telemetry show [--json]` — the whole truth about the one
|
|
616
|
+
* request somora makes to somora.ai. */
|
|
617
|
+
async function cmdTelemetry(args: string[]): Promise<number> {
|
|
618
|
+
const sub = args[0];
|
|
619
|
+
if (sub !== 'show') {
|
|
620
|
+
process.stdout.write('Usage:\n somora telemetry show [--json] what the daily update check sends, where, and when it last ran\n');
|
|
621
|
+
return sub === undefined || sub === '--help' || sub === '-h' ? 0 : 2;
|
|
622
|
+
}
|
|
623
|
+
const s = updateStatus();
|
|
624
|
+
if (args.includes('--json')) {
|
|
625
|
+
process.stdout.write(`${JSON.stringify(s, null, 2)}\n`);
|
|
626
|
+
return 0;
|
|
627
|
+
}
|
|
628
|
+
const why: Record<UpdateCheckStatus['reason'], string> = {
|
|
629
|
+
enabled: 'enabled (updateCheck.enabled in config.yaml)',
|
|
630
|
+
'do-not-track': 'disabled by DO_NOT_TRACK',
|
|
631
|
+
'automated-environment': 'disabled in an automated environment (CI is set)',
|
|
632
|
+
'config-disabled': 'disabled in config.yaml (updateCheck.enabled: false)',
|
|
633
|
+
};
|
|
634
|
+
process.stdout.write(`daily update check: ${why[s.reason]}\n`);
|
|
635
|
+
process.stdout.write(` request: GET ${s.endpoint}\n`);
|
|
636
|
+
process.stdout.write(` header: User-Agent: ${s.userAgent}\n`);
|
|
637
|
+
process.stdout.write(' body: none — no identifier, no machine id, nothing else\n');
|
|
638
|
+
process.stdout.write(` last run: ${s.lastCheckedAt ? new Date(s.lastCheckedAt).toISOString() : 'never'}\n`);
|
|
639
|
+
process.stdout.write(` answer: ${s.latestVersion ? `latest ${s.latestVersion}${s.updateAvailable ? ' — newer than this install' : ' — this install is current'}` : '—'}${s.note ? `\n note: ${s.note}` : ''}\n`);
|
|
640
|
+
process.stdout.write(' somora.ai logs the request with its IP address and counts installations from that; details: docs/setup.md → "The daily update check".\n');
|
|
641
|
+
return 0;
|
|
642
|
+
}
|
|
643
|
+
|
|
581
644
|
// ─── main ────────────────────────────────────────────────────────────
|
|
582
645
|
|
|
583
646
|
async function main(): Promise<number> {
|
|
@@ -612,6 +675,8 @@ async function main(): Promise<number> {
|
|
|
612
675
|
}
|
|
613
676
|
case 'update':
|
|
614
677
|
return await cmdUpdate(rest);
|
|
678
|
+
case 'telemetry':
|
|
679
|
+
return await cmdTelemetry(rest);
|
|
615
680
|
case 'codex': {
|
|
616
681
|
const { runCodexCli } = await import('./codex.ts');
|
|
617
682
|
return await runCodexCli(rest);
|
package/src/cli/update-args.ts
CHANGED
|
@@ -58,7 +58,7 @@ export function compareVersions(a: string, b: string): number {
|
|
|
58
58
|
* 11.16 on wants them named on a global install (`--allow-scripts`);
|
|
59
59
|
* today it only warns, a stricter default would leave node-pty and
|
|
60
60
|
* better-sqlite3 unbuilt. update-args.test.mts holds this list against
|
|
61
|
-
*
|
|
61
|
+
* package-lock.json and install.sh. */
|
|
62
62
|
export const ALLOW_SCRIPTS = ['better-sqlite3', 'cpu-features', 'esbuild', 'fsevents', 'node-pty', 'onnxruntime-node', 'protobufjs', 'ssh2'];
|
|
63
63
|
|
|
64
64
|
/** Extra arguments for `npm install -g`, given what `npm config get
|
package/src/config/reload.ts
CHANGED
|
@@ -20,6 +20,7 @@ export const RESTART_REQUIRED_SECTIONS: readonly string[] = [
|
|
|
20
20
|
'stt', // voice backends are wired at boot
|
|
21
21
|
'tts',
|
|
22
22
|
'sentinel', // scheduler + retention read at boot
|
|
23
|
+
'updateCheck', // the daily check is scheduled at boot
|
|
23
24
|
'tmux', // attention watcher configured at boot
|
|
24
25
|
'web', // static mounts decided at boot
|
|
25
26
|
'mobile',
|
package/src/config/types.ts
CHANGED
|
@@ -1636,6 +1636,21 @@ export const SentinelConfigSchema = z
|
|
|
1636
1636
|
.default({ completedRetentionDays: 7 });
|
|
1637
1637
|
export type SentinelConfig = z.infer<typeof SentinelConfigSchema>;
|
|
1638
1638
|
|
|
1639
|
+
// The daily update check (src/server/update-check.ts): the one request
|
|
1640
|
+
// somora makes to somora.ai. No identifier, no body — version, OS, Node
|
|
1641
|
+
// version and CPU in the User-Agent. somora.ai logs the request like
|
|
1642
|
+
// any web server and counts installations from those logs
|
|
1643
|
+
// (docs/setup.md → "The daily update check"). DO_NOT_TRACK=1 and CI
|
|
1644
|
+
// override this section.
|
|
1645
|
+
export const UpdateCheckConfigSchema = z
|
|
1646
|
+
.object({
|
|
1647
|
+
enabled: z.boolean().default(true),
|
|
1648
|
+
/** Where to ask. A self-hosted mirror can point this elsewhere. */
|
|
1649
|
+
endpoint: z.string().url().default('https://somora.ai/api/latest-version'),
|
|
1650
|
+
})
|
|
1651
|
+
.default({ enabled: true, endpoint: 'https://somora.ai/api/latest-version' });
|
|
1652
|
+
export type UpdateCheckConfig = z.infer<typeof UpdateCheckConfigSchema>;
|
|
1653
|
+
|
|
1639
1654
|
// Skills budget. Mirrors OpenClaw's defaults — they've shipped 53 real
|
|
1640
1655
|
// skills against these limits for months, so we treat them as known-
|
|
1641
1656
|
// good rather than re-deriving. Configurable via config.yaml per
|
|
@@ -2212,6 +2227,7 @@ export const ConfigSchema = z.object({
|
|
|
2212
2227
|
browser: BrowserConfigSchema,
|
|
2213
2228
|
projects: ProjectsConfigSchema,
|
|
2214
2229
|
sentinel: SentinelConfigSchema,
|
|
2230
|
+
updateCheck: UpdateCheckConfigSchema,
|
|
2215
2231
|
obsidian: ObsidianConfigSchema,
|
|
2216
2232
|
wiki: WikiConfigSchema,
|
|
2217
2233
|
attachments: AttachmentsConfigSchema,
|
package/src/server/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
15
15
|
import { readFileSync } from 'node:fs';
|
|
16
16
|
import { createSecureServer as createHttp2SecureServer } from 'node:http2';
|
|
17
17
|
import { TlsKeeper, type SecureContextHolder } from './tls-keeper.ts';
|
|
18
|
+
import { UpdateChecker } from './update-check.ts';
|
|
18
19
|
import {
|
|
19
20
|
homedir,
|
|
20
21
|
cpus as osCpus,
|
|
@@ -1615,7 +1616,25 @@ app.get(
|
|
|
1615
1616
|
// reads package.json), so this is effectively a static snapshot for
|
|
1616
1617
|
// the lifetime of the process. JSON keeps room for future fields
|
|
1617
1618
|
// (build-time, git SHA, env name) without breaking the client.
|
|
1618
|
-
|
|
1619
|
+
// The daily update check (docs/setup.md → "The daily update check").
|
|
1620
|
+
const updateChecker = new UpdateChecker({
|
|
1621
|
+
version: SOMORA_VERSION,
|
|
1622
|
+
endpoint: config.updateCheck.endpoint,
|
|
1623
|
+
statePath: joinPath(SOMORA_HOME_DIR, 'update-check.json'),
|
|
1624
|
+
configEnabled: config.updateCheck.enabled,
|
|
1625
|
+
surface: 'server',
|
|
1626
|
+
log: logger,
|
|
1627
|
+
});
|
|
1628
|
+
updateChecker.start();
|
|
1629
|
+
|
|
1630
|
+
/** Version plus, when known, what somora.ai says is current. */
|
|
1631
|
+
app.get('/version', (c) => {
|
|
1632
|
+
const u = updateChecker.status();
|
|
1633
|
+
return c.json({
|
|
1634
|
+
version: SOMORA_VERSION,
|
|
1635
|
+
update: u.latestVersion ? { latestVersion: u.latestVersion, available: u.updateAvailable, ...(u.note ? { note: u.note } : {}) } : null,
|
|
1636
|
+
});
|
|
1637
|
+
});
|
|
1619
1638
|
|
|
1620
1639
|
// ─── Config reload + restart ─────────────────────────────────────────
|
|
1621
1640
|
// Web taskbar gear + TUI /reload, /restart. Reload re-reads config.yaml,
|