aegiscode 7.0.26 → 7.0.28
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/SOURCE-OFFER.txt +9 -0
- package/package.json +4 -7
- package/scripts/check.mjs +1 -52
- package/scripts/demo.mjs +1 -94
- package/scripts/predist.mjs +1 -75
- package/scripts/runtests.mjs +1 -56
- package/scripts/seal-gate.mjs +1 -74
- package/src/agents.js +1 -139
- package/src/app.js +1 -2957
- package/src/art.js +1 -289
- package/src/chatflow.js +1 -3023
- package/src/checkpoint.js +1 -90
- package/src/clipboard.js +1 -424
- package/src/cloudsync.js +1 -528
- package/src/commands.js +1 -4089
- package/src/config.js +1 -581
- package/src/connect.js +1 -349
- package/src/credentials.js +1 -33
- package/src/deps.js +1 -232
- package/src/devrun.js +1 -187
- package/src/diff.js +1 -333
- package/src/diffview.js +1 -296
- package/src/engine.js +1 -297
- package/src/entitlement.js +1 -355
- package/src/events.js +1 -707
- package/src/export.js +1 -67
- package/src/filepreview.js +1 -153
- package/src/fingerprint.js +1 -592
- package/src/format.js +1 -259
- package/src/fuzzy.js +1 -119
- package/src/history.js +1 -423
- package/src/init.js +1 -175
- package/src/input.js +1 -139
- package/src/keys.js +1 -183
- package/src/markdown.js +1 -306
- package/src/models.js +1 -507
- package/src/naming.js +1 -57
- package/src/overlays.js +1 -462
- package/src/panels.js +1 -1418
- package/src/ping.js +1 -226
- package/src/presence.js +1 -238
- package/src/render.js +1 -516
- package/src/screen.js +1 -518
- package/src/screens.js +1 -896
- package/src/secret.js +1 -59
- package/src/securefs.js +1 -359
- package/src/settings.js +1 -155
- package/src/shared.js +1 -52
- package/src/sharedpaths.js +1 -53
- package/src/signup.js +1 -156
- package/src/summarize.js +1 -95
- package/src/sysdiag.js +1 -585
- package/src/system.js +1 -40
- package/src/theme.js +1 -570
- package/src/title.js +1 -220
- package/src/todos.js +1 -115
- package/src/tokens.js +1 -263
- package/src/topup.js +1 -210
- package/src/update.js +1 -191
- package/vendor/client/aegis.js +1 -2441
- package/vendor/client/attest.js +1 -518
- package/vendor/client/authorship-key.js +1 -410
- package/vendor/client/auto-provision.js +1 -134
- package/vendor/client/brain-catalog.js +1 -268
- package/vendor/client/byok-catalog.js +1 -199
- package/vendor/client/catalog-client.js +1 -487
- package/vendor/client/conversation-export.js +1 -177
- package/vendor/client/credentials.js +1 -494
- package/vendor/client/device-fingerprint.js +1 -141
- package/vendor/client/drive-connect.js +1 -110
- package/vendor/client/drive-upload.js +1 -234
- package/vendor/client/env-file.js +1 -1273
- package/vendor/client/fingerprint.js +1 -1064
- package/vendor/client/foreign-memory.js +1 -669
- package/vendor/client/google-signin.js +1 -133
- package/vendor/client/hooks.js +1 -430
- package/vendor/client/model-discovery.js +1 -373
- package/vendor/client/naming.js +1 -283
- package/vendor/client/platform.js +1 -937
- package/vendor/client/prefs.js +1 -351
- package/vendor/client/presence-constants.js +1 -107
- package/vendor/client/presence.js +1 -438
- package/vendor/client/record-vault.js +3 -1055
- package/vendor/client/session-store.js +1 -575
- package/vendor/client/topup.js +1 -297
- package/vendor/client/touch.js +1 -458
- package/vendor/client/update.js +1 -763
- package/vendor/client/user-models.js +1 -381
- package/vendor/desktop/lib/local/agents.js +1 -105
- package/vendor/desktop/lib/local/attachments.js +1 -276
- package/vendor/desktop/lib/local/autonomous.js +1 -1045
- package/vendor/desktop/lib/local/claude-pro.js +1 -1028
- package/vendor/desktop/lib/local/context.js +1 -125
- package/vendor/desktop/lib/local/engine.js +1 -3666
- package/vendor/desktop/lib/local/entitlement.js +1 -660
- package/vendor/desktop/lib/local/exec-plan.js +1 -269
- package/vendor/desktop/lib/local/git-scope.js +1 -228
- package/vendor/desktop/lib/local/integrity.js +1 -163
- package/vendor/desktop/lib/local/local.js +1 -2145
- package/vendor/desktop/lib/local/prompt.js +1 -280
- package/vendor/desktop/lib/local/queue.js +1 -560
- package/vendor/desktop/lib/local/session-rounds.js +1 -238
- package/vendor/desktop/lib/local/shell.js +1 -712
- package/vendor/desktop/lib/local/spill.js +1 -75
- package/vendor/desktop/lib/local/tools.js +1 -1328
- package/vendor/desktop/lib/local/turn-guard.js +1 -300
- package/vendor/desktop/lib/local/worktree-lock.js +1 -235
- package/vendor/desktop/lib/settings.js +1 -890
- package/vendor/desktop/main.js +1 -4890
- package/vendor/desktop/renderer/usage.js +1 -1239
- package/vendor/hosts/install.js +1 -638
- package/vendor/hosts/openai-shim.js +1 -515
- package/vendor/hosts/spec.js +1 -164
- package/vendor/hosts/targets.js +1 -346
- package/vendor/mcp/server.js +1 -221
- package/vendor/mcp/tools.js +1 -408
- package/vendor/one/src/child.js +1 -285
- package/vendor/one/src/permissions.js +1 -383
package/src/models.js
CHANGED
|
@@ -1,509 +1,3 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
2
|
// Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
|
|
3
|
-
|
|
4
|
-
// Conveying a modified copy, or running one as a network service, owes the
|
|
5
|
-
// corresponding source under this licence (§5/§13) — see LICENSING.md.
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* AEGIS Cloud model catalog shaping — the one place `/model`, the alt+p picker
|
|
10
|
-
* and `/models` agree on what a pinnable model is.
|
|
11
|
-
*
|
|
12
|
-
* The ids a user may pin are the *server's*, never ours: the pool adds, renames
|
|
13
|
-
* and retires providers without a client release, so the catalog is fetched
|
|
14
|
-
* (`client.listModels()` → GET /api/v1/models on aegiscloud.org) and this module
|
|
15
|
-
* only normalises the payload. It deliberately invents no id, and has no
|
|
16
|
-
* fallback list: an offline client offers nothing rather than a model name that
|
|
17
|
-
* would silently route somewhere else.
|
|
18
|
-
*
|
|
19
|
-
* WHAT IS OFFERED on the AEGIS (pooled) class is the server's FULL catalog: the
|
|
20
|
-
* brain first, under its one name (Nexus), then every other model the account
|
|
21
|
-
* can pin.
|
|
22
|
-
*
|
|
23
|
-
* The single-Nexus-row collapse was shipped here and is now reverted, because
|
|
24
|
-
* the report it produced is exactly the defect that shape creates: "there are
|
|
25
|
-
* only 2 models left in models" — one version back the picker listed them all.
|
|
26
|
-
* Removing the choice was never the fix for the two hosts disagreeing about the
|
|
27
|
-
* brain's five spellings; `offerableCatalog` ends that disagreement by folding
|
|
28
|
-
* only the *aliases*, which is what this module now calls. A funded account can
|
|
29
|
-
* pin the deepseek or anthropic model it actually pays for instead of having
|
|
30
|
-
* one chosen for it, while `nexus-brain` still paints as one row and not five.
|
|
31
|
-
*
|
|
32
|
-
* The rule lives in `client/brain-catalog.js`, shared with the desktop through
|
|
33
|
-
* the same `resolveShared` path, so the two hosts cannot drift — that one-copy
|
|
34
|
-
* guarantee is the part of the earlier change that stays.
|
|
35
|
-
*
|
|
36
|
-
* A payload with no brain tier at all (the BYOK listing, which is per-provider
|
|
37
|
-
* models) never had a brain row to collapse, and stays offered in full: BYOK is
|
|
38
|
-
* unaffected by this — see `offerableCatalog`'s own doc for the alias-only case.
|
|
39
|
-
*
|
|
40
|
-
* Offering is still not the same as accepting: `/model deepseek` still
|
|
41
|
-
* validates against the full catalog through `findModel`/`catalogIds`, so a
|
|
42
|
-
* scripted pin is not refused — only the interactive picker is narrowed.
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
const path = require('node:path');
|
|
46
|
-
|
|
47
|
-
const { resolveShared } = require('./sharedpaths.js');
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* The shared selection rule — required at load time and by EXISTENCE, never
|
|
51
|
-
* with a fallback copy here: a silently divergent local implementation is the
|
|
52
|
-
* precise defect this file was changed to remove. A missing module is a loud
|
|
53
|
-
* error naming the file, which is what `resolveShared` throws.
|
|
54
|
-
*/
|
|
55
|
-
const { offerableCatalog } = require(resolveShared(path.join('client', 'brain-catalog.js')));
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* The shared env-file module, required through the same `resolveShared` path the
|
|
59
|
-
* desktop uses, for the same reason: the file the key is WRITTEN to must be the
|
|
60
|
-
* file both hosts READ from, and a second implementation of "where does a key
|
|
61
|
-
* go" is exactly how the CLI and the desktop ended up each holding a private
|
|
62
|
-
* copy of the same provider key.
|
|
63
|
-
*/
|
|
64
|
-
const envFile = require(resolveShared(path.join('client', 'env-file.js')));
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* The Claude Code Pro transport, required the same way — so the 'pro' class's
|
|
68
|
-
* OWN foreign-secret check (below) can ask the same question `engine.js`'s
|
|
69
|
-
* `listModels('pro')` already answers for the row's `configured` flag:
|
|
70
|
-
* `claudeProStatus().loggedIn`, not only "is a token set aside in
|
|
71
|
-
* secrets.env". Without this, a machine signed in through the ordinary
|
|
72
|
-
* `claude login` flow (credentials.json, no `claude setup-token` ever run)
|
|
73
|
-
* reads as unconfigured here while the picker paints the same row
|
|
74
|
-
* `configured: true` — the picker says "ready", `/model` prompts for a token
|
|
75
|
-
* anyway.
|
|
76
|
-
*/
|
|
77
|
-
const claudePro = require(resolveShared(path.join('desktop', 'lib', 'local', 'claude-pro.js')));
|
|
78
|
-
|
|
79
|
-
/** Whether this machine is already signed into Claude Code Pro/Max, any way
|
|
80
|
-
* `claudeProStatus` recognizes (credentials.json OAuth or API-key form, or
|
|
81
|
-
* `CLAUDE_CODE_OAUTH_TOKEN` already in the environment) — broader than the
|
|
82
|
-
* foreign-secret file alone, and the same check the picker's `configured`
|
|
83
|
-
* flag is built from. */
|
|
84
|
-
function claudeProLoggedIn() {
|
|
85
|
-
try {
|
|
86
|
-
return !!claudePro.claudeProStatus({ env: process.env }).loggedIn;
|
|
87
|
-
} catch {
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** A pinned id of `null` means "no pin — let the pool choose" (the server's own default). */
|
|
93
|
-
const NO_PIN = null;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Labels for catalog ids the platform advertises without capabilities or a
|
|
97
|
-
* label of their own — `openai-gpt4o-mini` reads like a typo next to `openai`,
|
|
98
|
-
* and the brain tier is the one id whose *cost shape* a user needs before
|
|
99
|
-
* pinning it: verified live 2026-09-14, `model: "nexus-brain"` streams
|
|
100
|
-
* `pool-brain: 3 workers · effort=high · tier=brain · passes=4`, i.e. four
|
|
101
|
-
* billed provider calls per turn, where a provider id is one. That count is
|
|
102
|
-
* not fixed — the endpoint sizes the fan-out from the ask and the /effort rung
|
|
103
|
-
* (aegis1 services/pool_brain.py estimate_workers + EFFORT_MAX_WORKERS), so the
|
|
104
|
-
* label states the shape (fan-out, sized by effort) rather than a number that
|
|
105
|
-
* only held for one prompt.
|
|
106
|
-
*/
|
|
107
|
-
const ID_NOTES = Object.freeze({
|
|
108
|
-
'openai-gpt4o-mini': 'OpenAI gpt-4o-mini, pooled',
|
|
109
|
-
'anthropic-haiku': 'Anthropic Haiku, pooled',
|
|
110
|
-
'nexus-brain': 'pooled brain · multi-call fan-out, sized by /effort',
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
/** One raw entry (string id or object) → a catalog entry, or null when unusable. */
|
|
114
|
-
function normalizeModel(entry) {
|
|
115
|
-
const m = typeof entry === 'string' ? { id: entry } : entry;
|
|
116
|
-
if (!m || typeof m !== 'object') return null;
|
|
117
|
-
const id = typeof m.id === 'string' ? m.id.trim() : '';
|
|
118
|
-
if (!id) return null;
|
|
119
|
-
const aliasOf =
|
|
120
|
-
typeof m.alias_of === 'string' && m.alias_of.trim() ? m.alias_of.trim() : null;
|
|
121
|
-
const capabilities = Array.isArray(m.capabilities)
|
|
122
|
-
? m.capabilities.filter((c) => typeof c === 'string' && c)
|
|
123
|
-
: [];
|
|
124
|
-
const label =
|
|
125
|
-
(typeof m.label === 'string' && m.label.trim()) ||
|
|
126
|
-
(typeof m.name === 'string' && m.name.trim()) ||
|
|
127
|
-
id;
|
|
128
|
-
// The picker's right-hand column: what this entry *is*. An alias says so —
|
|
129
|
-
// otherwise a user reads five brain tiers and assumes five different models.
|
|
130
|
-
//
|
|
131
|
-
// A CALLER's own note wins over the derived one, and that precedence is the
|
|
132
|
-
// fix for a real defect: `app.js` builds the BYOK rows with the note the
|
|
133
|
-
// renderers paint ('key on this machine' / 'no key — /byok-key openai') and
|
|
134
|
-
// then passes them through `pickerEntries` → here, which used to re-derive the
|
|
135
|
-
// note from `capabilities` — empty for a byok row — so every row's note became
|
|
136
|
-
// blank and the picker could not say which providers this machine is ready to
|
|
137
|
-
// call. A note someone deliberately set is information; the derived string is
|
|
138
|
-
// a default, and a default must never overwrite it.
|
|
139
|
-
const given = typeof m.note === 'string' && m.note.trim() ? m.note.trim() : '';
|
|
140
|
-
const note = given || (aliasOf ? `alias of ${aliasOf}` : ID_NOTES[id] || capabilities.join(', '));
|
|
141
|
-
const out = {
|
|
142
|
-
id,
|
|
143
|
-
label,
|
|
144
|
-
note,
|
|
145
|
-
hidden: m.hidden === true,
|
|
146
|
-
aliasOf,
|
|
147
|
-
capabilities,
|
|
148
|
-
};
|
|
149
|
-
// Pass-through fields this module does not own but must not eat. They are the
|
|
150
|
-
// byok half of the list's whole content:
|
|
151
|
-
// - `provider` — which provider's key the relay will ask for (`collectKeyFor`
|
|
152
|
-
// read it, and `/byok-key` addresses the row by it);
|
|
153
|
-
// - `configured` — whether that key is on this machine, which is what paints
|
|
154
|
-
// the `[key needed]` flag and what tells a user whether a pick will work;
|
|
155
|
-
// - `cls` — the class the row belongs to, which ENTER switches on.
|
|
156
|
-
// Dropping them (as this did) meant `m.configured` was `undefined` for every
|
|
157
|
-
// row, so the flag fired on rows that were fully configured and the list could
|
|
158
|
-
// not distinguish "ready" from "needs a key".
|
|
159
|
-
if (typeof m.provider === 'string' && m.provider.trim()) out.provider = m.provider.trim();
|
|
160
|
-
if (m.configured === true) out.configured = true;
|
|
161
|
-
if (typeof m.cls === 'string' && m.cls.trim()) out.cls = m.cls.trim();
|
|
162
|
-
return out;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/** Normalise a raw `/api/v1/models` payload (`{models: [...]}` or the array). */
|
|
166
|
-
function normalizeModelCatalog(raw) {
|
|
167
|
-
const list = Array.isArray(raw) ? raw : Array.isArray(raw && raw.models) ? raw.models : [];
|
|
168
|
-
const out = [];
|
|
169
|
-
const seen = new Set();
|
|
170
|
-
for (const entry of list) {
|
|
171
|
-
const m = normalizeModel(entry);
|
|
172
|
-
if (!m || seen.has(m.id)) continue;
|
|
173
|
-
seen.add(m.id);
|
|
174
|
-
out.push(m);
|
|
175
|
-
}
|
|
176
|
-
return out;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* The entries the picker and `/models` offer.
|
|
181
|
-
*
|
|
182
|
-
* The selection itself is not decided here — it is `offerableCatalog` in
|
|
183
|
-
* `client/brain-catalog.js`, which the desktop requires through the same
|
|
184
|
-
* `resolveShared` path (and its own staged `vendor/` copy). Two hosts, one
|
|
185
|
-
* function: that is the part that must not be re-implemented, and the reason
|
|
186
|
-
* this is a thin call rather than a second copy of the rule.
|
|
187
|
-
*
|
|
188
|
-
* `offerableCatalog` offers every id the payload advertises, with the brain's
|
|
189
|
-
* spellings folded into the one row labelled Nexus and listed first — so a
|
|
190
|
-
* catalog naming a brain tier no longer collapses to that row alone. The
|
|
191
|
-
* fallback below still covers a payload whose entries survive as bare strings
|
|
192
|
-
* or as aliases the shared rule dropped: an empty picker would tell the user
|
|
193
|
-
* there are no models when the server just named them, so a list of aliases is
|
|
194
|
-
* a better answer than nothing.
|
|
195
|
-
*
|
|
196
|
-
* Re-normalised afterwards so renderers keep the `label`/`note`/`id` columns
|
|
197
|
-
* they already expect, and so the brain's cost shape still reaches the picker's
|
|
198
|
-
* right-hand column.
|
|
199
|
-
*/
|
|
200
|
-
function pickerEntries(catalog) {
|
|
201
|
-
const all = Array.isArray(catalog) ? catalog.filter(Boolean) : [];
|
|
202
|
-
const offered = offerableCatalog(all).map(normalizeModel).filter(Boolean);
|
|
203
|
-
if (offered.length) return offered;
|
|
204
|
-
const distinct = all.filter((m) => !m.aliasOf);
|
|
205
|
-
return distinct.length ? distinct : all;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/** The catalog entry for `id`, or null — the "is this a real id?" question. */
|
|
209
|
-
function findModel(catalog, id) {
|
|
210
|
-
const want = typeof id === 'string' ? id.trim() : '';
|
|
211
|
-
if (!want) return null;
|
|
212
|
-
return (Array.isArray(catalog) ? catalog : []).find((m) => m && m.id === want) || null;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* The set of ids the server accepts, lower-cased: a catalog id and a pinned id
|
|
217
|
-
* are the same thing only when they match byte-for-byte, but `/model Nexus-Brain`
|
|
218
|
-
* is a typo a user will make and the server's routing is case-insensitive
|
|
219
|
-
* enough that warning about it would be noise.
|
|
220
|
-
*/
|
|
221
|
-
function catalogIds(catalog) {
|
|
222
|
-
return new Set((Array.isArray(catalog) ? catalog : []).map((m) => String((m && m.id) || '').toLowerCase()).filter(Boolean));
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* What key a catalog entry needs, and whether a DURABLE copy already exists —
|
|
227
|
-
* the question the model picker asks before it may send a turn on that id.
|
|
228
|
-
*
|
|
229
|
-
* Picking a model is the moment the answer matters: the turn goes out
|
|
230
|
-
* immediately, so a missing key has to be collected HERE, and stored where both
|
|
231
|
-
* hosts look (`~/.aegiscode/.env`), or the user types the same key twice — once
|
|
232
|
-
* in the terminal and once in the desktop — which is the defect this exists to
|
|
233
|
-
* end.
|
|
234
|
-
*
|
|
235
|
-
* `keyStatus().inFile` is the half that decides it, not `.present`. A key
|
|
236
|
-
* exported in the shell belongs to the process that launched this host: it is
|
|
237
|
-
* gone next session and invisible to the desktop, so "present" is not "stored".
|
|
238
|
-
*
|
|
239
|
-
* Two classes are exempt, and neither exemption is a heuristic:
|
|
240
|
-
*
|
|
241
|
-
* - the POOLED class, when the account is already signed in. Its credential is
|
|
242
|
-
* the AEGIS account key, which `aegiscode login` also keeps in
|
|
243
|
-
* credentials.json (client/credentials.js resolves that FIRST), a file both
|
|
244
|
-
* hosts share. Prompting for it on every pooled pick would be asking for a
|
|
245
|
-
* key the machine demonstrably has, so `accountConfigured` short-circuits.
|
|
246
|
-
* - a BYOK provider whose key is already in the provider store
|
|
247
|
-
* (`byok:<provider>`, engine.js byokNamespace — the rows the desktop's
|
|
248
|
-
* Provider settings write), passed in as `hasStored`.
|
|
249
|
-
*
|
|
250
|
-
* @param {object} entry a picker row ({id, cls})
|
|
251
|
-
* @param {object} [o]
|
|
252
|
-
* @param {boolean} [o.accountConfigured] the account key resolves somewhere
|
|
253
|
-
* @param {boolean} [o.hasStored] the provider key is already in the store
|
|
254
|
-
* @returns {{needed:boolean, env:string, provider:string, pooled:boolean,
|
|
255
|
-
* status:object|null, why:string}}
|
|
256
|
-
*/
|
|
257
|
-
function modelKeyPlan(entry, o = {}) {
|
|
258
|
-
const id = (entry && entry.id) || '';
|
|
259
|
-
const plan = envFile.keyForModelId(id, entry && entry.cls);
|
|
260
|
-
if (!plan.env) {
|
|
261
|
-
// No id, no key to ask for. Never prompt on a row we cannot name a variable
|
|
262
|
-
// for — an unanswerable prompt is worse than a turn that 400s with the id.
|
|
263
|
-
return { needed: false, env: '', provider: '', pooled: plan.pooled, status: null, why: 'this id has no key variable' };
|
|
264
|
-
}
|
|
265
|
-
if (plan.foreign) {
|
|
266
|
-
// Claude Code Pro: the credential lives in secrets.env (or an unmigrated
|
|
267
|
-
// .env line, or a real shell export), never in process.env at large — so
|
|
268
|
-
// `keyStatus` (which reads `.env`/process.env only) cannot answer this one;
|
|
269
|
-
// `resolveForeignSecret` is the function built to check every place it
|
|
270
|
-
// might actually be. See client/env-file.js keyForModelId.
|
|
271
|
-
//
|
|
272
|
-
// That alone is a narrower question than "is this machine signed in,
|
|
273
|
-
// though" — a plain `claude login` writes credentials.json and never
|
|
274
|
-
// touches secrets.env, so `claudeProLoggedIn()` is checked too; it is the
|
|
275
|
-
// same source `engine.js listModels('pro')` already paints the row's own
|
|
276
|
-
// `configured` flag from, so the two cannot disagree about one row.
|
|
277
|
-
const present = !!envFile.resolveForeignSecret(plan.env) || claudeProLoggedIn();
|
|
278
|
-
return {
|
|
279
|
-
needed: !present,
|
|
280
|
-
env: plan.env,
|
|
281
|
-
provider: '',
|
|
282
|
-
pooled: false,
|
|
283
|
-
status: { present, inFile: present, source: present ? 'file' : 'none' },
|
|
284
|
-
why: present
|
|
285
|
-
? `${plan.env} is already set aside for Claude Code Pro`
|
|
286
|
-
: `no ${plan.env} is set aside for Claude Code Pro`,
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
const status = envFile.keyStatus(plan.env);
|
|
290
|
-
if (plan.pooled) {
|
|
291
|
-
const needed = !status.present && !o.accountConfigured;
|
|
292
|
-
return {
|
|
293
|
-
needed,
|
|
294
|
-
env: plan.env,
|
|
295
|
-
provider: '',
|
|
296
|
-
pooled: true,
|
|
297
|
-
status,
|
|
298
|
-
why: needed
|
|
299
|
-
? `no ${plan.env} is set on this machine`
|
|
300
|
-
: `account key present (${o.accountConfigured && !status.present ? 'credentials.json' : status.source})`,
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
const needed = !status.inFile && !o.hasStored;
|
|
304
|
-
return {
|
|
305
|
-
needed,
|
|
306
|
-
env: plan.env,
|
|
307
|
-
provider: plan.provider,
|
|
308
|
-
pooled: false,
|
|
309
|
-
status,
|
|
310
|
-
why: needed
|
|
311
|
-
? `no ${plan.env} is stored for provider "${plan.provider}"`
|
|
312
|
-
: `${plan.env} is already stored (${!status.inFile ? 'provider store' : status.source})`,
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* EVERY key a just-picked model needs, in the order to ask for them.
|
|
318
|
-
*
|
|
319
|
-
* `modelKeyPlan` answers with the one credential the ROUTE needs and stops
|
|
320
|
-
* there. That is the wrong answer at the picker, and it is the defect the report
|
|
321
|
-
* "I picked deepseek and it still failed" names: a pooled row named after a
|
|
322
|
-
* vendor is billed to the AEGIS account, so the route's credential is
|
|
323
|
-
* `AEGIS_API_KEY` — but the pool calls `deepseek` with a provider key, and when
|
|
324
|
-
* this machine holds none, the turn fails at the pool with nothing the user can
|
|
325
|
-
* act on. One prompt was not enough, and the missing one was never offered.
|
|
326
|
-
*
|
|
327
|
-
* So the order is fixed and it is the order the two keys are actually needed in:
|
|
328
|
-
*
|
|
329
|
-
* 1. `AEGIS_API_KEY` — the account key. Nothing works without it: it is what
|
|
330
|
-
* authenticates the catalog read that listed the row at all, and it is the
|
|
331
|
-
* pooled route's identity. Asked first, and asked on every class, because
|
|
332
|
-
* a byok listing cannot be read without it either.
|
|
333
|
-
* 2. the VENDOR key for the row (`DEEPSEEK_API_KEY` for `deepseek` or
|
|
334
|
-
* `deepseek:…`) — what actually calls the model. Asked second, and only
|
|
335
|
-
* when the row names a vendor `client/env-file.js` knows a variable for:
|
|
336
|
-
* `nexus-brain` names none, so it produces no second step rather than an
|
|
337
|
-
* invented `NEXUS_API_KEY`.
|
|
338
|
-
*
|
|
339
|
-
* A step is emitted only when its key is genuinely MISSING on this machine —
|
|
340
|
-
* `keyStatus().inFile` for a durable copy, plus the caller's `accountConfigured`
|
|
341
|
-
* / `hasStoredFor` for the two stores that are not the env file
|
|
342
|
-
* (`credentials.json` for the account, `byok:<provider>` rows for a vendor, both
|
|
343
|
-
* written by the other host). An empty array means "nothing to ask for", which
|
|
344
|
-
* is the common case and must stay silent.
|
|
345
|
-
*
|
|
346
|
-
* @param {object} entry a picker row ({id, cls, provider?})
|
|
347
|
-
* @param {object} [o]
|
|
348
|
-
* @param {boolean} [o.accountConfigured] the account key resolves somewhere
|
|
349
|
-
* @param {(vendor:string)=>boolean} [o.hasStoredFor] that vendor's key is in
|
|
350
|
-
* the provider store
|
|
351
|
-
* @returns {Array<{env:string, provider:string, vendor:string, role:string,
|
|
352
|
-
* needed:boolean, status:object|null, why:string}>} in ask order
|
|
353
|
-
*/
|
|
354
|
-
function modelKeyQueue(entry, o = {}) {
|
|
355
|
-
const id = (entry && entry.id) || '';
|
|
356
|
-
// No id at all: there is no row to make callable, so there is nothing to ask
|
|
357
|
-
// for. Checked on the ID and not on `plan.env`, because an empty id still
|
|
358
|
-
// derives a perfectly nameable variable (the account key) — the pooled branch
|
|
359
|
-
// of `keyForModelId` ignores the id — and prompting for the account key off a
|
|
360
|
-
// row that names no model is exactly the unanswerable prompt this refuses.
|
|
361
|
-
if (!String(id).trim()) return [];
|
|
362
|
-
const plan = envFile.keyForModelId(id, entry && entry.cls);
|
|
363
|
-
// A non-empty id that yields no variable cannot be asked about either: an
|
|
364
|
-
// unanswerable prompt is worse than a turn that 400s with the id in it.
|
|
365
|
-
if (!plan.env) return [];
|
|
366
|
-
|
|
367
|
-
if (plan.foreign) {
|
|
368
|
-
// Claude Code Pro bills nobody through AEGIS and calls no vendor API, so
|
|
369
|
-
// neither the account key nor a vendor key belongs in this queue — the
|
|
370
|
-
// ONE credential this route needs is the subscription's own OAuth token.
|
|
371
|
-
// There is no dedicated command for it (no `/byok-key` equivalent): it is
|
|
372
|
-
// asked for here, the same place every other row's key is asked for.
|
|
373
|
-
//
|
|
374
|
-
// `claudeProLoggedIn()` catches the plain `claude login` case the bare
|
|
375
|
-
// secrets.env check misses — see the matching note in `modelKeyPlan`.
|
|
376
|
-
if (envFile.resolveForeignSecret(plan.env) || claudeProLoggedIn()) return [];
|
|
377
|
-
return [{
|
|
378
|
-
env: plan.env,
|
|
379
|
-
provider: '',
|
|
380
|
-
vendor: '',
|
|
381
|
-
role: 'claude-pro',
|
|
382
|
-
needed: true,
|
|
383
|
-
status: { present: false },
|
|
384
|
-
why: `no ${plan.env} is set aside for Claude Code Pro`,
|
|
385
|
-
}];
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
const steps = [];
|
|
389
|
-
const account = envFile.keyStatus(envFile.ACCOUNT_ENV_VAR);
|
|
390
|
-
if (!account.present && !o.accountConfigured) {
|
|
391
|
-
steps.push({
|
|
392
|
-
env: envFile.ACCOUNT_ENV_VAR,
|
|
393
|
-
provider: '',
|
|
394
|
-
vendor: '',
|
|
395
|
-
role: 'account',
|
|
396
|
-
needed: true,
|
|
397
|
-
status: account,
|
|
398
|
-
why: `no ${envFile.ACCOUNT_ENV_VAR} is set on this machine`,
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
// The vendor the row names. For byok that is the id's own `<provider>` half;
|
|
403
|
-
// for a pooled id it is the vendor spelled into the id (`deepseek`), and it is
|
|
404
|
-
// the same variable either way — one key, one file, whichever class reads it.
|
|
405
|
-
const vendor = plan.vendor || '';
|
|
406
|
-
const vendorEnv = vendor ? envFile.envVarFor(vendor) : '';
|
|
407
|
-
const stored = vendor && typeof o.hasStoredFor === 'function' ? !!o.hasStoredFor(vendor) : false;
|
|
408
|
-
if (vendorEnv) {
|
|
409
|
-
const status = envFile.keyStatus(vendorEnv);
|
|
410
|
-
// `inFile` rather than `present` for the same reason as modelKeyPlan: a
|
|
411
|
-
// shell export belongs to this process, and the desktop — the other host
|
|
412
|
-
// that has to make this call — cannot see it. The provider store counts as
|
|
413
|
-
// stored (`hasStoredFor`), because that is the row the desktop writes.
|
|
414
|
-
if (!status.inFile && !stored) {
|
|
415
|
-
steps.push({
|
|
416
|
-
env: vendorEnv,
|
|
417
|
-
provider: vendor,
|
|
418
|
-
vendor,
|
|
419
|
-
role: 'provider',
|
|
420
|
-
needed: true,
|
|
421
|
-
status,
|
|
422
|
-
why: status.present
|
|
423
|
-
? `${vendorEnv} is exported in this shell only — the desktop cannot see it`
|
|
424
|
-
: `no ${vendorEnv} is stored for provider "${vendor}"`,
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
return steps;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* Store a key collected at the picker, in the one file every host reads.
|
|
433
|
-
*
|
|
434
|
-
* Returns `setEnvValue`'s result plus the resolved variable name, so a caller
|
|
435
|
-
* can report WHERE the key went without re-deriving it (and re-deriving it is
|
|
436
|
-
* how the two hosts would end up disagreeing about the name).
|
|
437
|
-
*
|
|
438
|
-
* `o.env` overrides the derived variable, and it is how a QUEUE step is stored:
|
|
439
|
-
* a pooled row has two keys (the account's and the vendor's), so the row alone
|
|
440
|
-
* cannot say which one this value is for — the step can. Without it the
|
|
441
|
-
* derivation is `keyForModelId`, which is the right answer for a single-key
|
|
442
|
-
* caller and unchanged.
|
|
443
|
-
*
|
|
444
|
-
* @param {object} entry the row the key was collected for
|
|
445
|
-
* @param {string} key the secret
|
|
446
|
-
* @param {object} [o] `setEnvValue` options; `env` names the variable to write
|
|
447
|
-
* @returns {{ok:boolean, file:string, changed:boolean, error:string,
|
|
448
|
-
* env:string, provider:string, pooled:boolean}}
|
|
449
|
-
*/
|
|
450
|
-
function storeModelKey(entry, key, o = {}) {
|
|
451
|
-
const plan = envFile.keyForModelId(entry && entry.id, entry && entry.cls);
|
|
452
|
-
const env = String(o.env || '').trim() || plan.env;
|
|
453
|
-
if (!env) {
|
|
454
|
-
return { ok: false, file: '', changed: false, error: `cannot name a key variable for "${(entry && entry.id) || ''}"`, env: '', provider: '', pooled: plan.pooled };
|
|
455
|
-
}
|
|
456
|
-
const opts = { ...o };
|
|
457
|
-
delete opts.env;
|
|
458
|
-
// A foreign name (CLAUDE_CODE_OAUTH_TOKEN) goes to secrets.env, never .env —
|
|
459
|
-
// setEnvValue refuses it outright (client/env-file.js FOREIGN_SECRET_NAMES),
|
|
460
|
-
// and writing it there would be the exact ambient exposure the split ends.
|
|
461
|
-
const res = plan.foreign ? envFile.setForeignSecret(env, key, opts) : envFile.setEnvValue(env, key, opts);
|
|
462
|
-
// `pooled` describes the VARIABLE that was written, not the class of the row:
|
|
463
|
-
// the account key is the pooled route's credential wherever it is stored,
|
|
464
|
-
// while a vendor key written for a pooled row is still the user's own vendor
|
|
465
|
-
// key. Reading it off the row (as this once did) reported DEEPSEEK_API_KEY as
|
|
466
|
-
// pooled, which told the caller the pool held a key the user had just supplied.
|
|
467
|
-
const pooled = !plan.foreign && env === envFile.ACCOUNT_ENV_VAR;
|
|
468
|
-
return { ...res, env, provider: env === plan.env ? plan.provider : '', pooled, foreign: !!plan.foreign };
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
/** The env var name a key for `entry` belongs in ('' when there is none). */
|
|
472
|
-
function keyVarForModel(entry) {
|
|
473
|
-
return envFile.keyForModelId(entry && entry.id, entry && entry.cls).env;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* The PROVIDER a model id names, for a caller that has only the id.
|
|
478
|
-
*
|
|
479
|
-
* Two namespaces answer this question and they are not the same one: a `byok:`
|
|
480
|
-
* id carries its vendor as a prefix (`deepseek:deepseek-v4-flash`), while a
|
|
481
|
-
* pooled id names the vendor in its spelling (`deepseek-flash`). `keyForModelId`
|
|
482
|
-
* reports the first as `provider` and the second as `vendor`, so reading only
|
|
483
|
-
* one of them reported a provider for BYOK rows and '' for every pooled one —
|
|
484
|
-
* which is most rows. Falls back to the vendor derivation so the answer is "the
|
|
485
|
-
* provider this turn ran on" either way, and '' when the id names none (the
|
|
486
|
-
* pool's own `nexus-*` ids), because an invented provider is not evidence.
|
|
487
|
-
*/
|
|
488
|
-
function providerForModel(entry) {
|
|
489
|
-
const id = String((entry && entry.id) || '').trim();
|
|
490
|
-
if (!id) return '';
|
|
491
|
-
const plan = envFile.keyForModelId(id, entry && entry.cls);
|
|
492
|
-
return plan.provider || envFile.providerForModelId(id, entry && entry.cls) || '';
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
module.exports = {
|
|
496
|
-
NO_PIN,
|
|
497
|
-
ID_NOTES,
|
|
498
|
-
normalizeModel,
|
|
499
|
-
normalizeModelCatalog,
|
|
500
|
-
pickerEntries,
|
|
501
|
-
findModel,
|
|
502
|
-
catalogIds,
|
|
503
|
-
modelKeyPlan,
|
|
504
|
-
modelKeyQueue,
|
|
505
|
-
storeModelKey,
|
|
506
|
-
keyVarForModel,
|
|
507
|
-
providerForModel,
|
|
508
|
-
claudeProLoggedIn,
|
|
509
|
-
};
|
|
3
|
+
const e=require("node:path"),{resolveShared:r}=require("./sharedpaths.js"),{offerableCatalog:o}=require(r(e.join("client","brain-catalog.js"))),n=require(r(e.join("client","env-file.js"))),t=require(r(e.join("desktop","lib","local","claude-pro.js")));function i(){try{return!!t.claudeProStatus({env:process.env}).loggedIn}catch{return!1}}const s=Object.freeze({"openai-gpt4o-mini":"OpenAI gpt-4o-mini, pooled","anthropic-haiku":"Anthropic Haiku, pooled","nexus-brain":"pooled brain · multi-call fan-out, sized by /effort"});function d(e){const r="string"==typeof e?{id:e}:e;if(!r||"object"!=typeof r)return null;const o="string"==typeof r.id?r.id.trim():"";if(!o)return null;const n="string"==typeof r.alias_of&&r.alias_of.trim()?r.alias_of.trim():null,t=Array.isArray(r.capabilities)?r.capabilities.filter((e=>"string"==typeof e&&e)):[],i={id:o,label:"string"==typeof r.label&&r.label.trim()||"string"==typeof r.name&&r.name.trim()||o,note:("string"==typeof r.note&&r.note.trim()?r.note.trim():"")||(n?`alias of ${n}`:s[o]||t.join(", ")),hidden:!0===r.hidden,aliasOf:n,capabilities:t};return"string"==typeof r.provider&&r.provider.trim()&&(i.provider=r.provider.trim()),!0===r.configured&&(i.configured=!0),"string"==typeof r.cls&&r.cls.trim()&&(i.cls=r.cls.trim()),i}module.exports={NO_PIN:null,ID_NOTES:s,normalizeModel:d,normalizeModelCatalog:function(e){const r=Array.isArray(e)?e:Array.isArray(e&&e.models)?e.models:[],o=[],n=new Set;for(const e of r){const r=d(e);r&&!n.has(r.id)&&(n.add(r.id),o.push(r))}return o},pickerEntries:function(e){const r=Array.isArray(e)?e.filter(Boolean):[],n=o(r).map(d).filter(Boolean);if(n.length)return n;const t=r.filter((e=>!e.aliasOf));return t.length?t:r},findModel:function(e,r){const o="string"==typeof r?r.trim():"";return o&&(Array.isArray(e)?e:[]).find((e=>e&&e.id===o))||null},catalogIds:function(e){return new Set((Array.isArray(e)?e:[]).map((e=>String(e&&e.id||"").toLowerCase())).filter(Boolean))},modelKeyPlan:function(e,r={}){const o=e&&e.id||"",t=n.keyForModelId(o,e&&e.cls);if(!t.env)return{needed:!1,env:"",provider:"",pooled:t.pooled,status:null,why:"this id has no key variable"};if(t.foreign){const e=!!n.resolveForeignSecret(t.env)||i();return{needed:!e,env:t.env,provider:"",pooled:!1,status:{present:e,inFile:e,source:e?"file":"none"},why:e?`${t.env} is already set aside for Claude Code Pro`:`no ${t.env} is set aside for Claude Code Pro`}}const s=n.keyStatus(t.env);if(t.pooled){const e=!s.present&&!r.accountConfigured;return{needed:e,env:t.env,provider:"",pooled:!0,status:s,why:e?`no ${t.env} is set on this machine`:`account key present (${r.accountConfigured&&!s.present?"credentials.json":s.source})`}}const d=!s.inFile&&!r.hasStored;return{needed:d,env:t.env,provider:t.provider,pooled:!1,status:s,why:d?`no ${t.env} is stored for provider "${t.provider}"`:`${t.env} is already stored (${s.inFile?s.source:"provider store"})`}},modelKeyQueue:function(e,r={}){const o=e&&e.id||"";if(!String(o).trim())return[];const t=n.keyForModelId(o,e&&e.cls);if(!t.env)return[];if(t.foreign)return n.resolveForeignSecret(t.env)||i()?[]:[{env:t.env,provider:"",vendor:"",role:"claude-pro",needed:!0,status:{present:!1},why:`no ${t.env} is set aside for Claude Code Pro`}];const s=[],d=n.keyStatus(n.ACCOUNT_ENV_VAR);d.present||r.accountConfigured||s.push({env:n.ACCOUNT_ENV_VAR,provider:"",vendor:"",role:"account",needed:!0,status:d,why:`no ${n.ACCOUNT_ENV_VAR} is set on this machine`});const l=t.vendor||"",a=l?n.envVarFor(l):"",c=!(!l||"function"!=typeof r.hasStoredFor||!r.hasStoredFor(l));if(a){const e=n.keyStatus(a);e.inFile||c||s.push({env:a,provider:l,vendor:l,role:"provider",needed:!0,status:e,why:e.present?`${a} is exported in this shell only — the desktop cannot see it`:`no ${a} is stored for provider "${l}"`})}return s},storeModelKey:function(e,r,o={}){const t=n.keyForModelId(e&&e.id,e&&e.cls),i=String(o.env||"").trim()||t.env;if(!i)return{ok:!1,file:"",changed:!1,error:`cannot name a key variable for "${e&&e.id||""}"`,env:"",provider:"",pooled:t.pooled};const s={...o};delete s.env;const d=t.foreign?n.setForeignSecret(i,r,s):n.setEnvValue(i,r,s),l=!t.foreign&&i===n.ACCOUNT_ENV_VAR;return{...d,env:i,provider:i===t.env?t.provider:"",pooled:l,foreign:!!t.foreign}},keyVarForModel:function(e){return n.keyForModelId(e&&e.id,e&&e.cls).env},providerForModel:function(e){const r=String(e&&e.id||"").trim();return r&&(n.keyForModelId(r,e&&e.cls).provider||n.providerForModelId(r,e&&e.cls))||""},claudeProLoggedIn:i};
|
package/src/naming.js
CHANGED
|
@@ -1,59 +1,3 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
2
|
// Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
|
|
3
|
-
|
|
4
|
-
// Conveying a modified copy, or running one as a network service, owes the
|
|
5
|
-
// corresponding source under this licence (§5/§13) — see LICENSING.md.
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The naming ladder — now shared with the desktop face.
|
|
10
|
-
*
|
|
11
|
-
* This file carried the rules (GENERIC_TITLE, isTopicless, looksLikeEcho,
|
|
12
|
-
* deriveTitle, refineTitle) and the window had none of them: it named a thread
|
|
13
|
-
* `prompt.slice(0, 60)`, so the same conversation was "Fix the desktop
|
|
14
|
-
* binaries" in a terminal and "can you fix the binaries for aegis-desktop. why
|
|
15
|
-
* is old" in the sidebar.
|
|
16
|
-
*
|
|
17
|
-
* Rather than teach the window a second copy of these rules — which is how the
|
|
18
|
-
* two hosts drift apart again — the implementation moved to
|
|
19
|
-
* `client/naming.js`, the shared tree both faces already stage. This module
|
|
20
|
-
* stays as the CLI's name for it so `app.js`, `chatflow.js` and
|
|
21
|
-
* `test/cli-naming.test.mjs` keep their imports, and so there is exactly one
|
|
22
|
-
* place the ladder can be edited.
|
|
23
|
-
*
|
|
24
|
-
* Two layouts must work, exactly as `sharedpaths.js` documents:
|
|
25
|
-
*
|
|
26
|
-
* in-repo <repo>/cli/src/naming.js -> <repo>/client/naming.js
|
|
27
|
-
* npm <pkg>/src/naming.js -> <pkg>/vendor/client/naming.js
|
|
28
|
-
*
|
|
29
|
-
* Resolution is by existence, and a missing module is a loud error rather than
|
|
30
|
-
* a silent fallback to a second copy — the same rule every shared module here
|
|
31
|
-
* follows, because duplicate implementations are how the desktop and the
|
|
32
|
-
* terminal drift apart.
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
const fs = require('node:fs');
|
|
36
|
-
const path = require('node:path');
|
|
37
|
-
|
|
38
|
-
const CANDIDATES = [
|
|
39
|
-
path.join(__dirname, '..', '..', 'client', 'naming.js'), // in-repo layout
|
|
40
|
-
path.join(__dirname, '..', 'vendor', 'client', 'naming.js'), // npm layout (mirror)
|
|
41
|
-
path.join(__dirname, '..', 'vendor', 'naming.js'), // npm layout (flat)
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
let resolved = null;
|
|
45
|
-
for (const candidate of CANDIDATES) {
|
|
46
|
-
if (fs.existsSync(candidate)) {
|
|
47
|
-
resolved = candidate;
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (!resolved) {
|
|
52
|
-
throw new Error(
|
|
53
|
-
'aegiscode: cannot find client/naming.js. Expected it beside cli/ (in the repo) or ' +
|
|
54
|
-
'under cli/vendor/ (installed package). Reinstall the package, or run ' +
|
|
55
|
-
'`node scripts/predist.mjs` from cli/ if this is a source checkout.'
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
module.exports = require(resolved);
|
|
3
|
+
"use strict";const fs=require("node:fs"),path=require("node:path"),CANDIDATES=[path.join(__dirname,"..","..","client","naming.js"),path.join(__dirname,"..","vendor","client","naming.js"),path.join(__dirname,"..","vendor","naming.js")];let resolved=null;for(const e of CANDIDATES)if(fs.existsSync(e)){resolved=e;break}if(!resolved)throw new Error("aegiscode: cannot find client/naming.js. Expected it beside cli/ (in the repo) or under cli/vendor/ (installed package). Reinstall the package, or run `node scripts/predist.mjs` from cli/ if this is a source checkout.");module.exports=require(resolved);
|