aegiscode 6.8.37 → 7.0.0
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 +39 -1
- package/package.json +1 -1
- package/src/app.js +54 -1
- package/src/commands.js +172 -1
- package/vendor/client/aegis.js +22 -0
- package/vendor/client/byok-catalog.js +43 -8
- package/vendor/client/user-models.js +378 -0
- package/vendor/desktop/lib/local/autonomous.js +81 -0
- package/vendor/desktop/lib/local/engine.js +334 -12
- package/vendor/desktop/renderer/usage.js +68 -1
package/README.md
CHANGED
|
@@ -255,7 +255,7 @@ command for command — 87 entries across nine categories:
|
|
|
255
255
|
|---|---|
|
|
256
256
|
| Session & context | `/schedule` `/clear` `/compact` `/context` `/todos` `/config` `/exit` `/recap` `/resume` `/rewind` `/agents` `/status` `/teleport` `/version` `/new` `/skills` `/multiyolo` `/multi` `/research` `/debate` |
|
|
257
257
|
| Workspace | `/run` `/build` `/cd` `/init` `/clone` |
|
|
258
|
-
| Model & behavior | `/ping` `/effort` `/model` `/theme` `/terminal` `/vim` `/permissions` `/hooks` `/credentials` `/install-github-app` `/thinking` `/mcp` `/memory` `/memory-deep` `/confirm` `/automode` *(alias `/yolo`)* `/router` `/class`
|
|
258
|
+
| Model & behavior | `/ping` `/effort` `/model` `/models` `/model-add` `/model-rm` `/theme` `/terminal` `/vim` `/permissions` `/hooks` `/credentials` `/install-github-app` `/thinking` `/mcp` `/memory` `/memory-deep` `/confirm` `/automode` *(alias `/yolo`)* `/router` `/class` |
|
|
259
259
|
| Data | `/copy` `/cost` `/export` `/tokens` `/sync` |
|
|
260
260
|
| Auth | `/login` `/logout` `/key` `/byok` `/byok-set` `/byok-rm` `/byok-key` `/byok-rm-key` |
|
|
261
261
|
| Support | `/help` `/doctor` `/upgrade` `/troubleshooting` `/feedback` `/bug` `/issue` `/onboarding` `/shell-completion` `/terminal-setup` `/pr-comments` `/prs` `/review` `/benchmark` `/billing` `/topup` `/cloud` `/gmail` `/release-notes` |
|
|
@@ -338,6 +338,44 @@ Selecting it switches the class to `aegis` first (this is the one row that is
|
|
|
338
338
|
not a `provider:model` id); pinning it *without* switching is not offered,
|
|
339
339
|
because the relay would read `nexus-brain` as a provider name.
|
|
340
340
|
|
|
341
|
+
**3. Adding a model nobody has released yet.**
|
|
342
|
+
|
|
343
|
+
Vendors ship models faster than any client can be updated, and the BYOK relay is
|
|
344
|
+
a pass-through: your own vendor key authenticates upstream and AEGIS forwards the
|
|
345
|
+
model string it is handed. So an id your provider serves is callable the moment
|
|
346
|
+
your machine offers it as a row — which is what these do:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
/model-add deepseek deepseek-v4.2-preview # offer it on this machine
|
|
350
|
+
/model-rm deepseek deepseek-v4.2-preview # forget it
|
|
351
|
+
/model-add deepseek # prompt for the id instead
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
`/model-add` resolves the provider against the relay's catalogue first, so a
|
|
355
|
+
provider the relay takes no key for is **refused** rather than stored — a
|
|
356
|
+
declaration for a slug the relay does not accept would appear in no picker at
|
|
357
|
+
all, and the failure would land on your first turn. The id itself is shape
|
|
358
|
+
checked (no spaces, no colon — `provider:model` is the id a pin uses) but never
|
|
359
|
+
checked against a vendor list: reaching a model the catalogue has not caught up
|
|
360
|
+
with is the entire point.
|
|
361
|
+
|
|
362
|
+
The declaration lives in **`~/.aegiscode/models.json`** (`$AEGISCODE_HOME` if you
|
|
363
|
+
set it), which is also the file the desktop's Settings pane writes and reads. Add
|
|
364
|
+
a model in the terminal and it is in the window's picker on its next refresh,
|
|
365
|
+
with no restart; add one in the window and `/models` shows it immediately. The
|
|
366
|
+
file is plain JSON and 0600, so a bulk edit is an editor away:
|
|
367
|
+
|
|
368
|
+
```json
|
|
369
|
+
{
|
|
370
|
+
"deepseek": ["deepseek-v4.2-preview"],
|
|
371
|
+
"anthropic": ["claude-opus-9-1"]
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
Nothing here is validated against a vendor on read, so a hand-typed row that the
|
|
376
|
+
vendor does not serve will 404 on your first turn — that is the one cost of the
|
|
377
|
+
escape hatch, and it is why the commands validate what they store.
|
|
378
|
+
|
|
341
379
|
```bash
|
|
342
380
|
aegiscode -m nexus-brain -p "…" # pin at launch
|
|
343
381
|
aegiscode -m anthropic:claude-sonnet-4-5 -p "…" # a BYOK id at launch
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aegiscode",
|
|
3
3
|
"productName": "AEGIS Code",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.0",
|
|
5
5
|
"description": "aegiscode — the command-line version of AEGIS Desktop. The shared tool surface in your shell, over the same thin transport and tool registry as the MCP plugin and the desktop app. Ships transport + UI only; no brain.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "AEGIS Code",
|
package/src/app.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
const readline = require('node:readline');
|
|
22
22
|
const os = require('node:os');
|
|
23
23
|
const { randomUUID } = require('node:crypto');
|
|
24
|
-
const { createTools, createClient, usageTokens, usageBuckets, buildSystemPrompt, autoProvisionApiKey, hostEnv } = require('./deps.js');
|
|
24
|
+
const { createTools, createClient, usageTokens, usageBuckets, buildSystemPrompt, autoProvisionApiKey, hostEnv, autonomous } = require('./deps.js');
|
|
25
25
|
const { createEngine, HOST_CLASSES, DEFAULT_CLASS, byokNamespace, effortRung } = require('./engine.js');
|
|
26
26
|
const { GLYPH, VERBS, themeOf, RESET, THEME_TABLE, AUTO_THEME_INDEX, themeIsLight, reconcileThemeIndex } = require('./theme.js');
|
|
27
27
|
const { probeTerminalBackground } = require('./caps.js');
|
|
@@ -174,6 +174,32 @@ function createApp(options = {}) {
|
|
|
174
174
|
// `/automode` and `/confirm` write the store, so a captured flag made both
|
|
175
175
|
// commands cosmetic — the panel changed while the engine kept asking.
|
|
176
176
|
let confirmMode = options.confirmMode !== false;
|
|
177
|
+
// ── Auto mode's session start state ────────────────────────────────────────
|
|
178
|
+
// The upstream engine (aegiscodex-dev src/autonomous.js) starts an attended
|
|
179
|
+
// session in auto mode unless AEGIS_AUTO_ROUNDS=0 (false/off/no), and the
|
|
180
|
+
// `←`/`→` chord toggles it freely from there: the env var is a STARTING
|
|
181
|
+
// POINT, not a veto. Same contract here, held in a local rather than
|
|
182
|
+
// re-derived per call, because the two are not the same statement:
|
|
183
|
+
//
|
|
184
|
+
// · re-deriving the env var on every read (a `!autoRoundsDefault(env)`
|
|
185
|
+
// guard inside isYolo) makes the opt-out absolute — `/automode on`,
|
|
186
|
+
// the `→` chord and the window's switch all become no-ops that still
|
|
187
|
+
// write the shared posture OFF, so the CLI chip reads "manual mode on"
|
|
188
|
+
// while the desktop's approvals are off. That is the three-surfaces
|
|
189
|
+
// drift (command, store, engine) this file exists to prevent,
|
|
190
|
+
// reintroduced by an environment variable.
|
|
191
|
+
// · a session flag honours the operator's "start me in manual" without
|
|
192
|
+
// disarming the toggle.
|
|
193
|
+
//
|
|
194
|
+
// `/automode on|off` moves it (commands.js writes `setAutoRounds`), so the
|
|
195
|
+
// chord stays live in both directions and the posture keeps exactly one home.
|
|
196
|
+
let autoRoundsSession = (() => {
|
|
197
|
+
try {
|
|
198
|
+
return autonomous.autoRoundsDefault(process.env);
|
|
199
|
+
} catch {
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
})();
|
|
177
203
|
const engine =
|
|
178
204
|
options.engine ||
|
|
179
205
|
createEngine({
|
|
@@ -1390,6 +1416,16 @@ function createApp(options = {}) {
|
|
|
1390
1416
|
render: () => {},
|
|
1391
1417
|
openOverlay: (o) => openOverlay(o),
|
|
1392
1418
|
closeOverlay: () => {},
|
|
1419
|
+
// Auto mode's session switch, written by `/automode on|off` (commands.js)
|
|
1420
|
+
// and read by makeHost's isYolo. It lives on the context for the same
|
|
1421
|
+
// reason `switchClass` does: the command must move the fact the status
|
|
1422
|
+
// line, the round-budget allowance and the approval gate all read, or the
|
|
1423
|
+
// command is cosmetic. See the session flag's comment near createApp's
|
|
1424
|
+
// gate wiring for why AEGIS_AUTO_ROUNDS=0 is a starting point and not a
|
|
1425
|
+
// veto.
|
|
1426
|
+
setAutoRounds: (v) => {
|
|
1427
|
+
autoRoundsSession = Boolean(v);
|
|
1428
|
+
},
|
|
1393
1429
|
askInput: () => Promise.resolve(null),
|
|
1394
1430
|
withWorking: (fn) => withWorking(fn),
|
|
1395
1431
|
runPrompt: (text) => runPrompt(text),
|
|
@@ -1412,6 +1448,11 @@ function createApp(options = {}) {
|
|
|
1412
1448
|
// The class surface: /class switches, /models lists for whichever class
|
|
1413
1449
|
// is live (the frozen state carries the current one as c.ctx.modelClass).
|
|
1414
1450
|
listModelsFor: (cls) => listModelsFor(cls),
|
|
1451
|
+
// Re-read the byok rows NOW, past the 5-minute cache. `/model-add` writes
|
|
1452
|
+
// the user-model file and then asks for this, because a picker that
|
|
1453
|
+
// answers from a cache older than the file it just wrote would report the
|
|
1454
|
+
// model it was told to add as missing — for five minutes.
|
|
1455
|
+
refreshByokModels: () => loadByokModels({ force: true }),
|
|
1415
1456
|
switchClass: (cls) => switchClass(cls),
|
|
1416
1457
|
classLabel: (cls) => classLabelOf(cls),
|
|
1417
1458
|
classes: () => (typeof engine.listClasses === 'function' ? engine.listClasses() : []),
|
|
@@ -1953,6 +1994,12 @@ function createApp(options = {}) {
|
|
|
1953
1994
|
},
|
|
1954
1995
|
wantsExit: () => wantExit,
|
|
1955
1996
|
isYolo: () => {
|
|
1997
|
+
// Both halves, in the order the desktop host reads them
|
|
1998
|
+
// (main.js autoRoundsOn): "this session runs auto mode" AND "the
|
|
1999
|
+
// stored posture says don't ask". The first is the session flag above
|
|
2000
|
+
// — `AEGIS_AUTO_ROUNDS=0` starts manual, and `/automode on` (or the
|
|
2001
|
+
// `→` chord, which dispatches exactly that) turns it back on.
|
|
2002
|
+
if (!autoRoundsSession) return false;
|
|
1956
2003
|
try {
|
|
1957
2004
|
// The posture, not the rule file: since ON8 the window's switch is the
|
|
1958
2005
|
// same fact, so a switch turned off there lights this chip too.
|
|
@@ -1961,6 +2008,12 @@ function createApp(options = {}) {
|
|
|
1961
2008
|
return false;
|
|
1962
2009
|
}
|
|
1963
2010
|
},
|
|
2011
|
+
// `/automode on|off` moves the session flag the predicate above reads, so
|
|
2012
|
+
// the command and the chip can never disagree — and an env opt-out is
|
|
2013
|
+
// escapable at the prompt instead of for the life of the process.
|
|
2014
|
+
setAutoRounds: (v) => {
|
|
2015
|
+
autoRoundsSession = Boolean(v);
|
|
2016
|
+
},
|
|
1964
2017
|
};
|
|
1965
2018
|
}
|
|
1966
2019
|
|
package/src/commands.js
CHANGED
|
@@ -396,6 +396,22 @@ const cloudReady = () => credentials.hasApiKey();
|
|
|
396
396
|
*/
|
|
397
397
|
const { withByokAdditions } = require(resolveShared(path.join('client', 'byok-catalog.js')));
|
|
398
398
|
|
|
399
|
+
/**
|
|
400
|
+
* The models the USER declares (`client/user-models.js`) — the same file the
|
|
401
|
+
* desktop's Settings row writes, resolved by existence through the same
|
|
402
|
+
* `resolveShared` path and for the same reason: one store, three writers.
|
|
403
|
+
*
|
|
404
|
+
* `/byok` and `/models` read it here, and the CLI's own engine
|
|
405
|
+
* (`desktop/lib/local/engine.js` `listModels('byok')`, vendored into this
|
|
406
|
+
* package) applies it too, so the terminal's listing and the terminal's picker
|
|
407
|
+
* cannot disagree about which ids this machine offers.
|
|
408
|
+
*/
|
|
409
|
+
const {
|
|
410
|
+
withUserModels,
|
|
411
|
+
addUserModel,
|
|
412
|
+
removeUserModel,
|
|
413
|
+
} = require(resolveShared(path.join('client', 'user-models.js')));
|
|
414
|
+
|
|
399
415
|
/**
|
|
400
416
|
* The server's BYOK provider catalog, or null when it cannot be reached.
|
|
401
417
|
*
|
|
@@ -410,7 +426,13 @@ async function byokCatalog(client) {
|
|
|
410
426
|
if (!client || typeof client.byokProviders !== 'function') return null;
|
|
411
427
|
try {
|
|
412
428
|
const data = await client.byokProviders();
|
|
413
|
-
|
|
429
|
+
// Two layers, in this order and for the same reason both exist: the
|
|
430
|
+
// shipped additions this repo maintains (`withByokAdditions`) and then the
|
|
431
|
+
// USER's own declarations (`withUserModels`). The user's layer is applied
|
|
432
|
+
// last because it is the most specific opinion — and because a user who
|
|
433
|
+
// declares an id the shipped list also carries still gets ONE row (both
|
|
434
|
+
// functions append only what is missing).
|
|
435
|
+
const providers = withUserModels(withByokAdditions((data && data.providers) || []));
|
|
414
436
|
return providers.length ? providers : null;
|
|
415
437
|
} catch {
|
|
416
438
|
return null;
|
|
@@ -2159,6 +2181,17 @@ const COMMANDS = [
|
|
|
2159
2181
|
// through the one writer, so the window's switch shows it and the two
|
|
2160
2182
|
// faces cannot disagree.
|
|
2161
2183
|
setConfirmPosture(!want);
|
|
2184
|
+
// …and the SESSION's own half. The posture answers "does the window's
|
|
2185
|
+
// switch say don't ask"; the session flag answers "did this sitting start
|
|
2186
|
+
// in auto mode". They are two facts (the upstream engine keeps them apart:
|
|
2187
|
+
// AEGIS_AUTO_ROUNDS=0 starts manual without touching any stored posture),
|
|
2188
|
+
// and with an env opt-out standing, writing only the posture made this
|
|
2189
|
+
// command — and the `→` chord that dispatches it — a no-op that reported
|
|
2190
|
+
// success: the store said "off", the chip still read "manual mode on", and
|
|
2191
|
+
// the tool gate in app.js's isYolo kept asking. Moving both here is what
|
|
2192
|
+
// makes the opt-out escapable at the prompt instead of for the life of the
|
|
2193
|
+
// process. Guarded because an injected/older context may not carry it.
|
|
2194
|
+
if (typeof c.setAutoRounds === 'function') c.setAutoRounds(want);
|
|
2162
2195
|
if (want) panel(c, panels.buildAutomode(c.state(), c.ctx));
|
|
2163
2196
|
else note(c, 'automode off — confirmations restored.');
|
|
2164
2197
|
c.render();
|
|
@@ -2960,6 +2993,144 @@ const COMMANDS = [
|
|
|
2960
2993
|
return true;
|
|
2961
2994
|
},
|
|
2962
2995
|
},
|
|
2996
|
+
{
|
|
2997
|
+
// ── the user's own model declarations ──────────────────────────────────
|
|
2998
|
+
//
|
|
2999
|
+
// The ONE thing this repo could not do before: a provider ships a model on
|
|
3000
|
+
// Tuesday and the user can call it from a BYOK key that same day. The BYOK
|
|
3001
|
+
// relay is a stateless pass-through — the caller's own vendor key
|
|
3002
|
+
// authenticates upstream and AEGIS forwards whatever model string it was
|
|
3003
|
+
// given — so any id the vendor serves is callable the moment this machine
|
|
3004
|
+
// offers it as a row, and this command is how it becomes one without a
|
|
3005
|
+
// release.
|
|
3006
|
+
//
|
|
3007
|
+
// Written through `client/user-models.js`, which is also what the desktop's
|
|
3008
|
+
// Settings row writes and what the shared engine applies to
|
|
3009
|
+
// `listModels('byok')`, so `/models` and the alt+p picker show the row on
|
|
3010
|
+
// the next refresh and the window shows it on ITS next refresh. The file is
|
|
3011
|
+
// printed on success, because a hand-edit is the bulk path and a store the
|
|
3012
|
+
// user cannot find is a store they will not use.
|
|
3013
|
+
name: 'model-add', aliases: ['add-model'], args: ['provider'], hint: '<provider> <model-id>',
|
|
3014
|
+
category: 'model',
|
|
3015
|
+
desc: 'Offer a model id the AEGIS catalog does not name (your key, both faces)',
|
|
3016
|
+
handler: async (c, a) => {
|
|
3017
|
+
const args = a || {};
|
|
3018
|
+
const typed = String(args.provider || '').trim();
|
|
3019
|
+
if (!typed) {
|
|
3020
|
+
c.push({ role: 'error', text: 'Usage: /model-add <provider> <model-id> — /byok lists the providers.' });
|
|
3021
|
+
return true;
|
|
3022
|
+
}
|
|
3023
|
+
const rest = String(args._rest || '').trim();
|
|
3024
|
+
const sp = rest.indexOf(' ');
|
|
3025
|
+
let model = sp === -1 ? '' : rest.slice(sp + 1).trim();
|
|
3026
|
+
if (!model) {
|
|
3027
|
+
// Plain inline input, NOT readSecret: a model id is not a secret, and
|
|
3028
|
+
// hiding it would make a typo unreviewable before it is stored.
|
|
3029
|
+
model = String((await c.askInput(`model id for ${typed}: `)) || '').trim();
|
|
3030
|
+
}
|
|
3031
|
+
if (!model) {
|
|
3032
|
+
c.push({ role: 'note', text: 'nothing saved.' });
|
|
3033
|
+
return true;
|
|
3034
|
+
}
|
|
3035
|
+
// Resolve the provider against the relay's catalog first. A slug the
|
|
3036
|
+
// server does not list can never be attached to a key, so storing it
|
|
3037
|
+
// would produce a declaration that is invisible in every picker — the
|
|
3038
|
+
// silent no-op this whole path is meant to avoid. When the catalog is
|
|
3039
|
+
// unreachable the declaration is kept and SAID to be unverified, because
|
|
3040
|
+
// refusing to work offline is worse than a row that appears later.
|
|
3041
|
+
const providers = await byokCatalog(c.client);
|
|
3042
|
+
const match = providers ? findByokProvider(providers, typed) : null;
|
|
3043
|
+
if (match && match.ambiguous) {
|
|
3044
|
+
c.push({ role: 'error', text: `"${typed}" matches ${match.ambiguous.join(', ')} — retype the exact id.` });
|
|
3045
|
+
return true;
|
|
3046
|
+
}
|
|
3047
|
+
if (providers && !(match && match.provider)) {
|
|
3048
|
+
c.push({
|
|
3049
|
+
role: 'error',
|
|
3050
|
+
text: `no provider "${typed}" in the relay's catalog — /byok lists the ones it takes a key for.`,
|
|
3051
|
+
});
|
|
3052
|
+
return true;
|
|
3053
|
+
}
|
|
3054
|
+
const id = (match && match.provider && match.provider.id) || typed.toLowerCase();
|
|
3055
|
+
let res;
|
|
3056
|
+
try {
|
|
3057
|
+
res = addUserModel(id, model);
|
|
3058
|
+
} catch (err) {
|
|
3059
|
+
c.push({ role: 'error', text: (err && err.message) || String(err) });
|
|
3060
|
+
return true;
|
|
3061
|
+
}
|
|
3062
|
+
// The picker's cache (app.js `byokCache`, 5 minutes) is older than the
|
|
3063
|
+
// file the instant it is written, so refresh it here: a user who adds a
|
|
3064
|
+
// model and types `/models` must see it, not "already listed" five
|
|
3065
|
+
// minutes later.
|
|
3066
|
+
if (typeof c.refreshByokModels === 'function') {
|
|
3067
|
+
try {
|
|
3068
|
+
await c.refreshByokModels();
|
|
3069
|
+
} catch {
|
|
3070
|
+
/* the next refresh reads the file anyway */
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
const rows = (typeof c.listModelsFor === 'function' ? (await c.listModelsFor('byok')) : []) || [];
|
|
3074
|
+
const row = rows.find((m) => m && m.id === `${id}:${model}`);
|
|
3075
|
+
c.push({
|
|
3076
|
+
role: res.added ? 'done' : 'note',
|
|
3077
|
+
text: res.added
|
|
3078
|
+
? `added ${id}:${model} — offered on this machine now, in the CLI and the desktop.`
|
|
3079
|
+
: `${id}:${model} was already declared.`,
|
|
3080
|
+
});
|
|
3081
|
+
if (!providers) {
|
|
3082
|
+
c.push({
|
|
3083
|
+
role: 'note',
|
|
3084
|
+
text: `the relay's catalog could not be read, so "${id}" is unverified — if it does not appear in /models, /byok lists the provider ids it takes.`,
|
|
3085
|
+
});
|
|
3086
|
+
}
|
|
3087
|
+
if (res.added && !row) {
|
|
3088
|
+
c.push({
|
|
3089
|
+
role: 'note',
|
|
3090
|
+
text: `saved, but no row will be offered for "${id}" yet — the relay lists no provider of that id (or that provider lists no models).`,
|
|
3091
|
+
});
|
|
3092
|
+
}
|
|
3093
|
+
c.push({ role: 'note', text: `stored in ${res.file} — the desktop reads the same file.` });
|
|
3094
|
+
return true;
|
|
3095
|
+
},
|
|
3096
|
+
},
|
|
3097
|
+
{
|
|
3098
|
+
name: 'model-rm', aliases: ['rm-model'], args: ['provider'], hint: '<provider> <model-id>',
|
|
3099
|
+
category: 'model',
|
|
3100
|
+
desc: 'Forget a model id you added with /model-add',
|
|
3101
|
+
handler: async (c, a) => {
|
|
3102
|
+
const args = a || {};
|
|
3103
|
+
const typed = String(args.provider || '').trim();
|
|
3104
|
+
const rest = String(args._rest || '').trim();
|
|
3105
|
+
const sp = rest.indexOf(' ');
|
|
3106
|
+
const model = sp === -1 ? '' : rest.slice(sp + 1).trim();
|
|
3107
|
+
if (!typed || !model) {
|
|
3108
|
+
c.push({ role: 'error', text: 'Usage: /model-rm <provider> <model-id> — /model-add lists what you added.' });
|
|
3109
|
+
return true;
|
|
3110
|
+
}
|
|
3111
|
+
let res;
|
|
3112
|
+
try {
|
|
3113
|
+
res = removeUserModel(typed, model);
|
|
3114
|
+
} catch (err) {
|
|
3115
|
+
c.push({ role: 'error', text: (err && err.message) || String(err) });
|
|
3116
|
+
return true;
|
|
3117
|
+
}
|
|
3118
|
+
if (typeof c.refreshByokModels === 'function') {
|
|
3119
|
+
try {
|
|
3120
|
+
await c.refreshByokModels();
|
|
3121
|
+
} catch {
|
|
3122
|
+
/* the next refresh reads the file anyway */
|
|
3123
|
+
}
|
|
3124
|
+
}
|
|
3125
|
+
c.push({
|
|
3126
|
+
role: res.removed ? 'done' : 'note',
|
|
3127
|
+
text: res.removed
|
|
3128
|
+
? `removed ${res.provider}:${res.model} — the picker stops offering it on the next refresh.`
|
|
3129
|
+
: `${res.provider}:${res.model} was not declared on this machine.`,
|
|
3130
|
+
});
|
|
3131
|
+
return true;
|
|
3132
|
+
},
|
|
3133
|
+
},
|
|
2963
3134
|
{
|
|
2964
3135
|
name: 'tool', args: ['name', 'json'], hint: '<name> [json]', category: 'aegis',
|
|
2965
3136
|
desc: 'Call any registry tool directly (escape hatch for new tools)',
|
package/vendor/client/aegis.js
CHANGED
|
@@ -1440,7 +1440,29 @@ function createClient(opts = {}) {
|
|
|
1440
1440
|
.sort((a, b) => a[0] - b[0])
|
|
1441
1441
|
.map(([idx, c]) => ({ ...c, id: c.id || `call_${idx}` }));
|
|
1442
1442
|
|
|
1443
|
+
// The hidden chain-of-thought belongs on the RESULT, not only on the live
|
|
1444
|
+
// stream. `reasoningText` above is accumulated and forwarded to the caller's
|
|
1445
|
+
// `onReasoning`/`onStream` so the thinking can be shown while it happens —
|
|
1446
|
+
// but the resolved result carried only `content`, so every down-stream
|
|
1447
|
+
// diagnosis of "the model spent the whole budget thinking and never wrote a
|
|
1448
|
+
// word" read an empty reasoning channel on THIS lane and concluded there had
|
|
1449
|
+
// been no thinking at all.
|
|
1450
|
+
//
|
|
1451
|
+
// That is not a cosmetic loss. desktop/lib/local/engine.js decides its
|
|
1452
|
+
// reasoning-only recovery from exactly this field (`reasonedButSilent` →
|
|
1453
|
+
// `reasoningTextOf(res)`), so on byok the gate was dead code: DeepSeek
|
|
1454
|
+
// returns `finish_reason: 'stop'` with empty content and a full
|
|
1455
|
+
// `reasoning_content`, which matched neither `isTruncated` (the reason says
|
|
1456
|
+
// 'stop', not 'length') nor the reasoning retry (nothing to detect), and the
|
|
1457
|
+
// turn fell straight through to emptyTurnError — the "backend error: the
|
|
1458
|
+
// model returned no answer … max_tokens 16384" the user sees. Measured live
|
|
1459
|
+
// on byok/deepseek-v4-flash 2026-10-11.
|
|
1460
|
+
//
|
|
1461
|
+
// Kept out of `content` on purpose: deliberation is not an answer, and
|
|
1462
|
+
// folding it in would make a no-answer turn look answered to every caller's
|
|
1463
|
+
// empty-check (see the note at the `reasoningText` accumulation above).
|
|
1443
1464
|
const message = { content: cleanText };
|
|
1465
|
+
if (reasoningText) message.reasoning_content = reasoningText;
|
|
1444
1466
|
if (toolCalls.length) message.tool_calls = toolCalls;
|
|
1445
1467
|
const result = {
|
|
1446
1468
|
model: resultModel,
|
|
@@ -95,14 +95,49 @@ const BYOK_MODEL_ADDITIONS = Object.freeze({
|
|
|
95
95
|
// catalog.py) pins exactly one default_model, `claude-sonnet-5`, and
|
|
96
96
|
// `anthropic-haiku` pins `claude-haiku-4-5` as its own provider row — so
|
|
97
97
|
// between them an Anthropic BYOK key could pin Sonnet or Haiku but never
|
|
98
|
-
// Opus or Fable, the other two members of the
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
|
|
98
|
+
// Opus or Fable, the other two members of the Claude 5 lineup the vendor
|
|
99
|
+
// already serves. Listed under the `anthropic` provider id because that is
|
|
100
|
+
// the row the server advertises a configured Anthropic key against — the
|
|
101
|
+
// relay forwards whichever of these names the caller actually pins.
|
|
102
|
+
//
|
|
103
|
+
// Verified live 2026-10-11 against `GET https://api.anthropic.com/v1/models`
|
|
104
|
+
// (14 ids, `has_more: false`), which is where every id below is copied from
|
|
105
|
+
// rather than from memory:
|
|
106
|
+
//
|
|
107
|
+
// claude-haiku-5-5, claude-sonnet-5-5, claude-opus-5-5, claude-fable-5-1,
|
|
108
|
+
// claude-opus-5, claude-sonnet-5, claude-fable-5, claude-opus-4-8,
|
|
109
|
+
// claude-opus-4-7, claude-sonnet-4-6, claude-opus-4-6,
|
|
110
|
+
// claude-opus-4-5-20251101, claude-haiku-4-5-20251001,
|
|
111
|
+
// claude-sonnet-4-5-20250929
|
|
112
|
+
//
|
|
113
|
+
// The server's two defaults cover `claude-sonnet-5` and `claude-haiku-4-5`;
|
|
114
|
+
// the five below are the CURRENT members of the lineup it does not name —
|
|
115
|
+
// the 5.5 generation (Haiku, Sonnet, Opus) plus Fable 5.1, and the older
|
|
116
|
+
// Opus 5 / Fable 5 that were already listed. Every one has a priced rate row
|
|
117
|
+
// (desktop/renderer/usage.js, the Claude 5 block), so the picker was missing
|
|
118
|
+
// the ability to OFFER them, not a rate.
|
|
119
|
+
//
|
|
120
|
+
// What is deliberately NOT here, and why it matters more than what is:
|
|
121
|
+
// `claude-opus-4-1` (and its dated form `claude-opus-4-1-20250805`) is
|
|
122
|
+
// RETIRED upstream. Probed live 2026-10-11, `POST /v1/messages` with that
|
|
123
|
+
// model answers HTTP 404 `not_found_error` — the same probe answers
|
|
124
|
+
// `rate_limit_error` (i.e. the model resolved) for every id listed above,
|
|
125
|
+
// which is what makes 404 mean "no such model" rather than "no credit".
|
|
126
|
+
// The engine's own MODELS table still carries a legacy `claude-opus-4-1`
|
|
127
|
+
// row for saved configs, and that is fine — it is a local label that
|
|
128
|
+
// RESOLVES; a client-side catalog addition is a promise the picker will pin
|
|
129
|
+
// and the relay will forward, and this module's whole reason for existing is
|
|
130
|
+
// that a fabricated id "would pin, look accepted, and 404 on the first
|
|
131
|
+
// turn". So Opus 4.1 stays out of the offered list until Anthropic serves
|
|
132
|
+
// it again.
|
|
133
|
+
anthropic: Object.freeze([
|
|
134
|
+
'claude-opus-5',
|
|
135
|
+
'claude-fable-5',
|
|
136
|
+
'claude-opus-5-5',
|
|
137
|
+
'claude-sonnet-5-5',
|
|
138
|
+
'claude-haiku-5-5',
|
|
139
|
+
'claude-fable-5-1',
|
|
140
|
+
]),
|
|
106
141
|
// xAI's `grok` descriptor still pins `grok-4.5` as default_model — current
|
|
107
142
|
// when that descriptor was written, but xAI has since shipped grok-4.6 and
|
|
108
143
|
// grok-4.7 (flagship, Sept 2026) on the same `grok-4.5`-shaped id
|