aegiscode 6.8.4 → 6.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -6
  3. package/src/agents.js +1 -1
  4. package/src/app.js +1 -1
  5. package/src/caps.js +1 -1
  6. package/src/chatflow.js +1 -1
  7. package/src/checkpoint.js +1 -1
  8. package/src/clipboard.js +1 -1
  9. package/src/commands.js +5 -5
  10. package/src/config.js +2 -2
  11. package/src/devrun.js +1 -1
  12. package/src/diff.js +1 -1
  13. package/src/events.js +2 -2
  14. package/src/export.js +1 -1
  15. package/src/fuzzy.js +1 -1
  16. package/src/history.js +3 -3
  17. package/src/init.js +1 -1
  18. package/src/input.js +1 -1
  19. package/src/keys.js +1 -1
  20. package/src/markdown.js +2 -2
  21. package/src/overlays.js +2 -2
  22. package/src/panels.js +6 -6
  23. package/src/permissions.js +2 -2
  24. package/src/render.js +2 -2
  25. package/src/screen.js +4 -4
  26. package/src/screens.js +1 -1
  27. package/src/summarize.js +1 -1
  28. package/src/system.js +2 -2
  29. package/src/theme.js +6 -6
  30. package/src/tokens.js +2 -2
  31. package/src/update.js +1 -1
  32. package/vendor/desktop/lib/local/agents.js +1 -1
  33. package/vendor/desktop/lib/local/autonomous.js +1 -1
  34. package/vendor/desktop/lib/local/engine.js +9 -9
  35. package/vendor/desktop/lib/local/git-scope.js +1 -1
  36. package/vendor/desktop/lib/local/prompt.js +3 -3
  37. package/vendor/desktop/lib/local/queue.js +2 -2
  38. package/vendor/desktop/lib/local/shell.js +1 -1
  39. package/vendor/desktop/lib/local/tools.js +2 -2
  40. package/vendor/desktop/lib/local/turn-guard.js +1 -1
  41. package/vendor/desktop/lib/local/worktree-lock.js +1 -1
  42. package/vendor/desktop/lib/settings.js +3 -3
  43. package/vendor/desktop/renderer/usage.js +6 -6
package/README.md CHANGED
@@ -58,12 +58,12 @@ product, so they are one name now:
58
58
  |---|---|
59
59
  | `aegiscode` | **this host**, v6.0.0. Installs a single binary, `aegiscode`. |
60
60
  | `aegis-terminal` | deprecated — the 0.1.x spelling of this package, folded into `aegiscode`. |
61
- | `aegiscode-cli` | 4.0.3, an earlier name of the full `aegisinfo/aegiscode` coding-assistant CLI. Untouched. |
61
+ | `aegiscode-cli` | 4.0.3, an earlier name of this CLI's predecessor line. Untouched. |
62
62
  | `aegis-cli` | 0.4.8 (unrelated). |
63
63
  | `aegis` (bin) | claimed **twice already** — by `aegiscode-cli` (→ `bin/cli.js`) and by `aegis-desktop` (→ `bin/aegis.js`). Pre-existing; whichever installs last wins. |
64
64
 
65
65
  Publishing this host as `aegiscode` moves the `latest` dist-tag for that name
66
- onto it. The previous line (`aegiscode@5.x`, the `aegisinfo/aegiscode` agent) is
66
+ onto it. The previous line (`aegiscode@5.x`, the earlier agent build) is
67
67
  still installable and immutable on the registry — pin `aegiscode@5` for it.
68
68
 
69
69
  ## Installation
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aegiscode",
3
3
  "productName": "AEGIS Code",
4
- "version": "6.8.4",
4
+ "version": "6.8.5",
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",
@@ -9,11 +9,6 @@
9
9
  },
10
10
  "license": "MIT",
11
11
  "homepage": "https://aegiscloud.org",
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://github.com/aegisinfo/aegiscode-plugin.git",
15
- "directory": "cli"
16
- },
17
12
  "bin": {
18
13
  "aegiscode": "bin/aegiscode.js"
19
14
  },
package/src/agents.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  /**
4
- * Sub-agent prompt presets — ported verbatim from aegiscodex-dev/src/agents.js
4
+ * Sub-agent prompt presets — ported verbatim from the upstream engine reference
5
5
  * (which in turn came from the reference's slash-commands builtinCommands.ts
6
6
  * buildMultiAgents() and the research-council member prompts). This build has
7
7
  * no parallel-agent runtime, so the presets are prompt composition:
package/src/app.js CHANGED
@@ -11,7 +11,7 @@
11
11
  * lives here.
12
12
  *
13
13
  * Commands come from `./commands.js`. Each entry is either handler-backed
14
- * (`cmd.handler(c, args)`, the reference aegiscodex-dev contract), tool-backed
14
+ * (`cmd.handler(c, args)`, the upstream engine contract), tool-backed
15
15
  * (`cmd.tool` + `cmd.build`), a generic escape hatch (`cmd.generic`, `/tool`),
16
16
  * or `unavailable` (a Claude Code auth-loop command this client cannot honour).
17
17
  * Handlers run against the FROZEN command context built below; the tool path
package/src/caps.js CHANGED
@@ -55,7 +55,7 @@
55
55
 
56
56
  // ── the cell-width core ──────────────────────────────────────────────────────
57
57
  // Real terminal cell width (wcwidth-style), copied verbatim from
58
- // aegiscodex-dev/src/screen.js. Combining marks and variation selectors occupy
58
+ // the upstream engine reference. Combining marks and variation selectors occupy
59
59
  // no cell; CJK fullwidth forms and emoji-presentation glyphs occupy two;
60
60
  // everything else one. A plain code-point count misaligns every width decision
61
61
  // the moment a line contains CJK, emoji or a terminal's wide fallback glyph.
package/src/chatflow.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * The chatflow — the full-screen session loop, and the row/render helpers it
5
5
  * runs on.
6
6
  *
7
- * This is the aegiscodex-dev session loop: an alternate-screen frame of
7
+ * This is the upstream engine session loop: an alternate-screen frame of
8
8
  *
9
9
  * ╭──── AEGIS Code v6.2.0 ────╮ header rule
10
10
  * …transcript viewport… user rows, assistant markdown, tool rows
package/src/checkpoint.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * (bounded to the last CHECKPOINT_LIMIT), and /rewind lists or restores them.
7
7
  * Checkpoint 0 is the session start (empty transcript).
8
8
  *
9
- * Ported from aegiscodex-dev/src/checkpoint.js (ESM → CommonJS). The data dir
9
+ * Ported from the upstream engine reference (ESM → CommonJS). The data dir
10
10
  * now comes from config.js's shared `aegisDir()` helper.
11
11
  */
12
12
 
package/src/clipboard.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * clipboard availability. Set AEGISCODE_NO_CLIPBOARD=1 to force the file
8
8
  * fallback (used by tests and headless setups).
9
9
  *
10
- * Ported from aegiscodex-dev/src/clipboard.js (ESM → CommonJS). The data dir
10
+ * Ported from the upstream engine reference (ESM → CommonJS). The data dir
11
11
  * comes from the shared `aegisDir()` helper and the force-fallback env var was
12
12
  * renamed AEGISCODEX_NO_CLIPBOARD → AEGISCODE_NO_CLIPBOARD.
13
13
  */
package/src/commands.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * Slash commands — the CLI's full command vocabulary, ported from the sibling
5
- * `aegiscodex-dev` client (`src/registry.js`), on top of the AEGIS tool registry
5
+ * the upstream engine client (`src/registry.js`), on top of the AEGIS tool registry
6
6
  * (`mcp/tools.js`).
7
7
  *
8
8
  * Three kinds of entry live in one table:
@@ -10,7 +10,7 @@
10
10
  * (a) handler — a local `async (c, args) => bool` that runs against the
11
11
  * frozen command context `c` (see `cli/src/app.js`). It returns false to
12
12
  * end the session. This is the reference's own contract, so a handler
13
- * body reads the same here as it does in aegiscodex-dev — only the panels
13
+ * body reads the same here as it does in the upstream engine — only the panels
14
14
  * and support modules it calls are this client's.
15
15
  * (b) tool-backed — names a tool from `mcp/tools.js` and carries a
16
16
  * `build(arg) -> object` that turns the typed argument into the tool's
@@ -23,7 +23,7 @@
23
23
  * reason and a working `alt`; `parseLine` returns `{ kind: 'unavailable' }`
24
24
  * and `app.js` prints the reason rather than a fake success.
25
25
  *
26
- * The names, aliases, categories and descriptions come from aegiscodex-dev's
26
+ * The names, aliases, categories and descriptions come from the upstream engine's
27
27
  * `COMMANDS`/`CATEGORIES`. Where this client's capability genuinely differs from
28
28
  * the reference's the handler says so honestly (a note, an honest panel, or a
29
29
  * real command run through the ported support modules) rather than copying a
@@ -127,7 +127,7 @@ const shortCwd = () => process.cwd().split('/').filter(Boolean).pop() || '~';
127
127
  // paste-ready panel and never executed anything at all, so its `savePermissions
128
128
  // ({ defaultMode: 'allow' })` turned YOLO on and then did nothing with it.
129
129
  //
130
- // The reference (aegiscodex-dev) calls `multiData(task, { signal })`, which
130
+ // The upstream engine calls `multiData(task, { signal })`, which
131
131
  // shells out to aegis-cli (`aegis --print "/multi <task>"`) because the fan-out
132
132
  // lives in that binary. This host has no aegis-cli, and a shell-out that fails
133
133
  // on every machine without one is not a port — so the real multi-agent runtime
@@ -1531,7 +1531,7 @@ const COMMANDS = [
1531
1531
  },
1532
1532
  },
1533
1533
 
1534
- // ── Phase 6 (part 2) families ─────────────────────────────────────────────
1534
+ // ── additional command families ─────────────────────────────────────────────
1535
1535
  {
1536
1536
  name: 'new', aliases: ['start'], hint: '', category: 'session',
1537
1537
  desc: 'Start a new session (clears the transcript, fresh session id)',
package/src/config.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * can redirect the data dir. Reads and writes are best-effort: a corrupt
7
7
  * config falls back to defaults, and write failures never crash the session.
8
8
  *
9
- * Ported from aegiscodex-dev/src/config.js (ESM → CommonJS). The data dir was
9
+ * Ported from the upstream engine reference (ESM → CommonJS). The data dir was
10
10
  * renamed ~/.aegiscodex → ~/.aegiscode and the override env var
11
11
  * AEGISCODEX_HOME → AEGISCODE_HOME; `aegisDir` is the one shared helper every
12
12
  * other module imports rather than recomputing the path.
@@ -68,7 +68,7 @@ const DEFAULT_CONFIG = {
68
68
  // back to. Defaulted to the pooled class, which is the only one an account
69
69
  // key alone can run.
70
70
  modelClass: 'aegis',
71
- // Phase 6: the full model table (seeded from src/models.js MODELS on first
71
+ // The full model table (seeded from src/models.js MODELS on first
72
72
  // read by pickerModels()). 'currentModelId' mirrors `model` under the
73
73
  // aegiscode- name so /model add/remove/switch stay compatible both ways.
74
74
  models: null,
package/src/devrun.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * sub-shell. Output streams to the transcript as it happens; the session loop
6
6
  * can stop the process (Esc) via the returned job handle.
7
7
  *
8
- * Ported from aegiscodex-dev/src/devrun.js (ESM → CommonJS).
8
+ * Ported from the upstream engine reference (ESM → CommonJS).
9
9
  */
10
10
 
11
11
  const { spawn } = require('node:child_process');
package/src/diff.js CHANGED
@@ -21,7 +21,7 @@
21
21
  * ANSI painting lives in diffview.js, exactly the split render.js already
22
22
  * keeps between structure and paint.
23
23
  *
24
- * Ported from `aegiscodex-dev/src/diff.js`; the engine's tool names are
24
+ * Ported from the upstream engine reference; the engine's tool names are
25
25
  * `Edit`/`Write`/`MultiEdit`, this host's are `editFile`/`writeFile`, so
26
26
  * `editPreview` accepts both spellings. `MultiEdit` has no counterpart here
27
27
  * and is kept only so a newer engine frame cannot silently render nothing.
package/src/events.js CHANGED
@@ -15,7 +15,7 @@
15
15
  * · SGR mouse wheel events (DECSET 1000+1006), decoded to `{name:'wheel'}`
16
16
  * instead of being mistaken for Escape (which would abort a working turn).
17
17
  *
18
- * Ported from `aegiscodex-dev/src/events.js`. It is a module-level singleton —
18
+ * Ported from the upstream engine reference. It is a module-level singleton —
19
19
  * one stdin, one queue — which is what lets the session loop, a command
20
20
  * handler's `askInput()`, and the mid-turn Esc drain all read keys through the
21
21
  * same nextKey() without fighting over the `data` listener.
@@ -209,7 +209,7 @@ function feed(c) {
209
209
  * one. Right/middle clicks and anything unrecognized return null, and the
210
210
  * caller then falls through to the ordinary CSI decoder, which ignores it — so
211
211
  * stray mouse bytes can't type into the editor or abort a turn.
212
- * Ported from aegiscodex-dev/src/events.js so both hosts mark identically.
212
+ * Ported from the upstream engine reference so both hosts mark identically.
213
213
  */
214
214
  function parseSgrMouse(seq) {
215
215
  const m = /^\x1b\[<(\d+);(\d+);(\d+)([Mm])$/.exec(seq);
package/src/export.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * extraction for /copy. Exports are written to the current directory (or the
6
6
  * clipboard) and the resulting path is reported in the transcript.
7
7
  *
8
- * Ported from aegiscodex-dev/src/export.js (ESM → CommonJS). Output strings
8
+ * Ported from the upstream engine reference (ESM → CommonJS). Output strings
9
9
  * (the # Aegiscodex session header, the ## Claude / ## User role headers, the
10
10
  * aegiscodex-export- filename) are kept as in the reference.
11
11
  */
package/src/fuzzy.js CHANGED
@@ -14,7 +14,7 @@
14
14
  // substring 700 − position (earlier substring wins)
15
15
  // scattered 50 + bonuses (consecutive runs, name-start hits)
16
16
  //
17
- // Ported verbatim from aegiscodex-dev/src/fuzzy.js (ESM → CommonJS). The tier
17
+ // Ported verbatim from the upstream engine reference (ESM → CommonJS). The tier
18
18
  // numbers are a contract: cli-fuzzy.test.mjs asserts the ordering they encode.
19
19
 
20
20
  function fuzzyScore(query, name) {
package/src/history.js CHANGED
@@ -16,7 +16,7 @@
16
16
  * and without a key. `readResumeList` merges both sources by id, so no session
17
17
  * is listed twice.
18
18
  *
19
- * Ported from aegiscodex-dev/src/history.js (ESM → CommonJS). The data dir now
19
+ * Ported from the upstream engine reference (ESM → CommonJS). The data dir now
20
20
  * comes from config.js's shared `aegisDir()` helper.
21
21
  */
22
22
 
@@ -41,7 +41,7 @@ function ensureHistoryDir() {
41
41
 
42
42
  /**
43
43
  * Record one exchange. `reply` is stored in full so /resume can restore the
44
- * transcript exactly. Token accounting (Phase 4):
44
+ * transcript exactly. Token accounting:
45
45
  * live — `usage` carries the real numbers from the provider stream-json
46
46
  * (input/output/cacheRead/cacheWrite + costUsd), stored verbatim;
47
47
  * demo — estimated from text length (~4 chars/token), labeled real:false.
@@ -211,7 +211,7 @@ function sessionHistoryEntries(sessionId) {
211
211
  }
212
212
 
213
213
  /**
214
- * Drop every history record for a session (Phase 10b, 2.1.228 port). /clear
214
+ * Drop every history record for a session. /clear
215
215
  * calls this so /cost stops summing old rows — the sessionId stays stable, so
216
216
  * rewind checkpoints and the transcript lineage are unaffected.
217
217
  */
package/src/init.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * and generate an AEGIS.md with real project instructions. Never overwrites an
6
6
  * existing file — the handler reports and leaves the file alone.
7
7
  *
8
- * Ported from aegiscodex-dev/src/init.js (ESM → CommonJS). The reference wrote
8
+ * Ported from the upstream engine reference (ESM → CommonJS). The reference wrote
9
9
  * a CLAUDE.md; this build writes AEGIS.md and the generated document is headed
10
10
  * "# AEGIS.md" and references "AEGIS Code". The `buildClaudeMd` export is kept
11
11
  * as an alias of `buildAegisMd` so callers ported from the reference still
package/src/input.js CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Line editor with history — the input line's buffer, cursor and recall.
5
5
  *
6
- * Ported from `aegiscodex-dev/src/input.js`. The one thing worth knowing before
6
+ * Ported from the upstream engine reference. The one thing worth knowing before
7
7
  * touching it: `cursor` is a **codepoint** index, not a UTF-16 index. Slicing
8
8
  * `buf` directly corrupts a surrogate pair the moment one has been inserted
9
9
  * (the next insert's slice lands mid-pair and leaves a lone surrogate, which
package/src/keys.js CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Raw key decoding for the terminal (raw-mode stdin).
5
5
  *
6
- * Ported from `aegiscodex-dev/src/keys.js` so the aegiscode CLI and the
6
+ * Ported from the upstream engine reference so the aegiscode CLI and the
7
7
  * reference client decode the same bytes into the same key names — the
8
8
  * chatflow's key handling (history recall, vim motions, Esc-to-interrupt) is
9
9
  * only correct if the decoder agrees with it.
package/src/markdown.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // Minimal markdown → styled span lines, in the spirit of Claude Code's
4
4
  // transcript rendering (monokai-flavored code, bold text, inline code).
5
5
  //
6
- // Ported from aegiscodex-dev/src/markdown.js (ESM → CommonJS). The one
6
+ // Ported from the upstream engine reference (ESM → CommonJS). The one
7
7
  // structural change: instead of importing `span`/`w` from screen.js — which a
8
8
  // concurrent workstream is rewriting — this module carries a local cell-width
9
9
  // function and a local `span()` that produce the *same* shape the rest of the
@@ -24,7 +24,7 @@ const {
24
24
  themeOf,
25
25
  } = require('./theme.js');
26
26
 
27
- // Real terminal cell width, mirroring aegiscodex-dev/src/screen.js's w():
27
+ // Real terminal cell width, mirroring the upstream engine's w():
28
28
  // combining marks / variation selectors are zero-width, CJK fullwidth forms and
29
29
  // emoji are two cells, everything else one. A plain codepoint count misaligns
30
30
  // every width decision the moment a line contains CJK or emoji.
package/src/overlays.js CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Overlay renderers — the "/" command palette, the alt+p model picker, the
5
5
  * /effort picker and the /resume session list. Ported from
6
- * `aegiscodex-dev/src/commands.js` (which mirrors live captures of Claude Code
6
+ * the upstream engine reference (which mirrors live captures of Claude Code
7
7
  * 2.1.228: a gray `─` rule, a lavender `❯` cursor, a blue selected row, a
8
8
  * `⎿ Usage: /x hint` hook under the focused command and a `·`-separated footer).
9
9
  *
@@ -58,7 +58,7 @@ function fit(lines, width) {
58
58
  /** A full-width blank row. */
59
59
  const blank = (width) => [span('', ' '.repeat(Math.max(0, width)))];
60
60
 
61
- // Phase 10b (2.1.228 port): split a command name into spans that bold the
61
+ // Split a command name into spans that bold the
62
62
  // characters which matched the query; the selected row reads blue.
63
63
  function boldMatched(query, name, colour) {
64
64
  const pos = fuzzy && typeof fuzzy.fuzzyMatchPositions === 'function'
package/src/panels.js CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Panel builders — the bodies that slash-commands print.
5
5
  *
6
- * Ported from `aegiscodex-dev/src/panels.js` (868 lines), keeping its layouts
6
+ * Ported from the upstream engine reference (868 lines), keeping its layouts
7
7
  * and copy wherever the capability exists in this client. Everything here is
8
8
  * PURE: a builder receives all of its data as arguments and returns an array of
9
9
  * span lines (each line an array of `{ t, s, w }`, see `screen.js`). No stdout
@@ -14,8 +14,8 @@
14
14
  * module-scoped palette. Money is euro: `fmtEur` renders 4dp below a cent (a
15
15
  * pooled call settles near €0.0007) and 2dp at or above it, so a real charge
16
16
  * never reads as "€0.00". The reference printed USD; every `$` became `€`.
17
- * Claude/Anthropic names became AEGIS (`aegiscode`, `aegiscloud.org`,
18
- * `github.com/aegisinfo/aegiscode-plugin`) and `~/.aegiscodex` became
17
+ * Claude/Anthropic names became AEGIS (`aegiscode`, `aegiscloud.org`)
18
+ * and `~/.aegiscodex` became
19
19
  * `~/.aegiscode`.
20
20
  *
21
21
  * Every builder is defensive: a missing field is omitted, never rendered as
@@ -34,7 +34,7 @@
34
34
  *
35
35
  * ── Honest stubs (capability absent in this client) ──────────────────────────
36
36
  * buildDoctor — needs the local environment diagnostic suite (runDoctor),
37
- * which belongs to aegiscodex-dev; /doctor is unavailable.
37
+ * which belongs to the upstream engine; /doctor is unavailable.
38
38
  * buildBuildPanel — needs a local multi-model agent build loop this client
39
39
  * does not host.
40
40
  */
@@ -611,7 +611,7 @@ function buildTroubleshooting(state, ctx = {}) {
611
611
  lines.push([span('', ' '), span(t.gray, fix)]);
612
612
  }
613
613
  lines.push([span('', '')]);
614
- lines.push([span(t.gray, 'Run /status for account state. Help: https://github.com/aegisinfo/aegiscode-plugin')]);
614
+ lines.push([span(t.gray, 'Run /status for account state. Help: https://aegiscloud.org')]);
615
615
  return lines;
616
616
  }
617
617
 
@@ -1253,7 +1253,7 @@ function buildReleaseNotes(state, ctx = {}) {
1253
1253
  out.push([span(t.gray, ` ${counts.n} commands across ${counts.cats} categories — /help lists them.`)]);
1254
1254
  }
1255
1255
  out.push([span(t.gray, ' The version above is read from the package; the prose is not.')]);
1256
- out.push([span(t.gray, ' Repo: github.com/aegisinfo/aegiscode-plugin')]);
1256
+ out.push([span(t.gray, ' Repo: https://aegiscloud.org')]);
1257
1257
  return out;
1258
1258
  }
1259
1259
 
@@ -6,7 +6,7 @@
6
6
  * approval UX from the real binary, so this only applies to
7
7
  * Bash/Read/Write/Edit/Glob/Grep run by a provider model.
8
8
  *
9
- * Scope decision (Phase 12): the multi-directory-change Bash heuristic,
9
+ * Scope decision: the multi-directory-change Bash heuristic,
10
10
  * explicit /permissions allow|deny|ask rules, and `defaultMode: 'ask'` when
11
11
  * the permissions file *explicitly* writes it (rules.explicitAsk) are
12
12
  * enforced here. The file-free default ('ask' in DEFAULT_PERMISSIONS) is
@@ -24,7 +24,7 @@
24
24
  * imported so this module has no import-cycle with tools.js (executeTool's
25
25
  * home, which calls into this one).
26
26
  *
27
- * Ported from aegiscodex-dev/src/permissions.js (ESM → CommonJS).
27
+ * Ported from the upstream engine reference (ESM → CommonJS).
28
28
  */
29
29
 
30
30
  const RULE_RE = /^(\w+)(?:\((.*)\))?$/;
package/src/render.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * The CLI's renderers — the start-up banner, transcript turns, the per-turn
5
5
  * accounting line, the status bar, the live working line and the transcript's
6
6
  * markdown body. The presentation layer is a fidelity port of
7
- * `aegiscodex-dev`: gold `━`/`─` rules, the one-ink ÆGIS wordmark (box runes,
7
+ * the upstream engine: gold `━`/`─` rules, the one-ink ÆGIS wordmark (box runes,
8
8
  * in gold), the coral-bold welcome title, the `❯` prompt, the
9
9
  * `⎿` hook rows, the `●` answer/stream cursor and the `✻` done glyph.
10
10
  *
@@ -397,7 +397,7 @@ function renderToolResult(ctx, name, text, width = 80) {
397
397
  /**
398
398
  * The tool-approval card: the mutating call the model wants to run (a diff
399
399
  * for writeFile/editFile, the command for exec) and the three answers. One
400
- * inline question, matching aegiscodex-dev's Bash/edit approval dialog.
400
+ * inline question, matching the upstream engine's Bash/edit approval dialog.
401
401
  */
402
402
  function renderApproval(ctx, info = {}, width = 80) {
403
403
  const t = themeOf(ctx);
package/src/screen.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * wrapping, and the ephemeral "live" region the CLI redraws while a call is in
6
6
  * flight.
7
7
  *
8
- * The render model is aegiscodex-dev's: a line is an array of spans
8
+ * The render model is the upstream engine's: a line is an array of spans
9
9
  * `{ t: text, s: style-prefix, w: cell-width }`, built with `span()`, measured
10
10
  * with `lineWidth()`, padded/truncated with `padLine()`, and painted with
11
11
  * `paint()`. Two width functions exist because they have different callers:
@@ -14,7 +14,7 @@
14
14
  * per-codepoint maths for a span line (the overlays use it).
15
15
  *
16
16
  * Design note — this CLI is a LINEAR transcript, not a full-screen alt-buffer
17
- * TUI (which is what Claude Code and aegiscodex-dev are). Finished turns are
17
+ * TUI (which is what Claude Code and the upstream engine are). Finished turns are
18
18
  * written once to scrollback, so output stays selectable, pipeable and
19
19
  * scrollback-searchable; only the one live status/spinner line is redrawn. The
20
20
  * main session loop deliberately does NOT enter the alternate screen — `--print`
@@ -249,7 +249,7 @@ const SELECT_OFF = '\x1b[27m';
249
249
  // `frameLines`). All of it is pure and cell-based: coordinates are grid row +
250
250
  // CELL column (0-based), never string indices, so wide glyphs and padded rows
251
251
  // can't shift the selection off the text the reader is pointing at.
252
- // Ported from aegiscodex-dev/src/screen.js so both hosts mark identically.
252
+ // Ported from the upstream engine reference so both hosts mark identically.
253
253
 
254
254
  /** Two drag endpoints → the same range in reading order (top-left first). */
255
255
  function selectionRange(a, b) {
@@ -444,7 +444,7 @@ module.exports = {
444
444
  stripAnsi,
445
445
  wrapLine,
446
446
  wrapBlock,
447
- // span/line render model (from aegiscodex-dev)
447
+ // span/line render model (from the upstream engine)
448
448
  span,
449
449
  lineWidth,
450
450
  padLine,
package/src/screens.js CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Onboarding screens — trust check, theme picker, welcome.
5
5
  *
6
- * A direct port of `aegiscodex-dev/src/screens.js`, which is where the
6
+ * A direct port of the upstream engine reference, which is where the
7
7
  * reference's session actually begins: a genuine first run is
8
8
  *
9
9
  * showTrustCheck(ctx) → showThemePicker(ctx) → updateConfig() → welcome
package/src/summarize.js CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Transcript summarization for /compact and /recap.
5
5
  *
6
- * Dependency-free port of aegiscodex-dev/src/summarize.js. The reference
6
+ * Dependency-free port of the upstream engine reference. The reference
7
7
  * spawns `claude -p "Summarize…"` (via platform.resolveExecutable); here the
8
8
  * backend is *injected* instead, so this module pulls in nothing but tokens.js:
9
9
  *
package/src/system.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Small system helpers: best-effort URL opening (never blocks or errors) and
5
5
  * a few constants shared by the support/easter-egg commands.
6
6
  *
7
- * Ported from aegiscodex-dev/src/system.js (ESM → CommonJS). The URLS table
7
+ * Ported from the upstream engine reference (ESM → CommonJS). The URLS table
8
8
  * pointed at Anthropic/Claude support endpoints; those are re-homed to the
9
9
  * AEGIS base (https://aegiscloud.org) and the project repo. Deep paths that
10
10
  * had no AEGIS equivalent collapse to the base rather than inventing a route.
@@ -29,7 +29,7 @@ function openUrl(url) {
29
29
  const URLS = {
30
30
  troubleshooting: 'https://aegiscloud.org',
31
31
  feedback: 'https://aegiscloud.org',
32
- issues: 'https://github.com/aegisinfo/aegiscode-plugin/issues/new',
32
+ issues: 'https://aegiscloud.org',
33
33
  docs: 'https://aegiscloud.org',
34
34
  radio: 'https://www.youtube.com/watch?v=cP8jB6YQWbQ',
35
35
  };
package/src/theme.js CHANGED
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
3
  /**
4
- * Design tokens — the aegiscodex-dev design system, adopted wholesale, and
4
+ * Design tokens — the upstream engine design system, adopted wholesale, and
5
5
  * resolved through the terminal's capabilities (`caps.js`) rather than the
6
6
  * platform the process happens to run on.
7
7
  *
8
- * Every colour value below is copied verbatim from `aegiscodex-dev/src/theme.js`,
8
+ * Every colour value below is copied verbatim from the upstream engine's theme,
9
9
  * which extracted them from the live ANSI stream of Claude Code: gold 255,193,7
10
10
  * · coral 215,119,87 · lavender 177,185,249 · blue 120,160,250 · green 78,186,101
11
11
  * · red 220,90,90 · gray 153,153,153 · dim 80,80,80. `test/cli-conformance.test.mjs`
12
- * pins them to aegiscodex-dev's source and reads them back out of a truecolor
12
+ * pins them to the upstream engine's source and reads them back out of a truecolor
13
13
  * SGR prefix, so the design cannot drift.
14
14
  *
15
15
  * What DOES change per terminal is how those triples reach the screen:
@@ -61,7 +61,7 @@ const BG = (r, g, b) => bg(r, g, b);
61
61
  // capability change keeps the key set identical (the conformance guard pins
62
62
  // `Object.keys(C)`) while the escapes follow the new depth.
63
63
 
64
- /** The dark palette. Role names match aegiscodex-dev exactly. */
64
+ /** The dark palette. Role names match the upstream engine exactly. */
65
65
  const C = {};
66
66
  /** Light-theme approximations, true to the dark palette's hue mapping. */
67
67
  const LIGHT = {};
@@ -148,7 +148,7 @@ function buildAnsiLight() {
148
148
  /**
149
149
  * Diff palette for edit blocks in the transcript — Monokai Extended, taken
150
150
  * verbatim from the theme picker's preview (also `renderDiffPreview` in
151
- * `aegiscodex-dev/src/markdown.js`) so the two can never drift apart: dim
151
+ * the upstream engine's markdown renderer) so the two can never drift apart: dim
152
152
  * red/green backgrounds per row, the bright variant for the token that
153
153
  * actually changed inside the row, and the monokai syntax colors for the code
154
154
  * itself.
@@ -217,7 +217,7 @@ const THEMES = { dark: C, light: LIGHT };
217
217
  * remapped anyway — the whole point being that the *terminal* decides, not us.
218
218
  */
219
219
  /**
220
- * The theme picker's table, copied from `aegiscodex-dev/src/screens.js` THEMES
220
+ * The theme picker's table, copied from the upstream engine's screens THEMES
221
221
  * (names and notes verbatim). `light` is the flag the reference sets on commit
222
222
  * (`ctx.light = sel === 2 || sel === 4 || sel === 6`); `palette` is what this
223
223
  * client resolves the row to, since it has no terminal-background probe and so
package/src/tokens.js CHANGED
@@ -144,7 +144,7 @@ function sessionAccounting(transcript, model = 'sonnet') {
144
144
  // the wall clock for peak/off-peak, so two evaluations straddling a peak
145
145
  // boundary would report a peak cost with an off-peak basis (or vice versa) —
146
146
  // two different claims about the same number, which is the thing this return
147
- // shape exists to prevent. aegiscodex-dev's sessionAccounting is written the
147
+ // shape exists to prevent. The upstream engine's sessionAccounting is written the
148
148
  // same way; if one host folds this into two calls again the two will disagree
149
149
  // about the same turn, which is how the rate table split in the first place.
150
150
  const breakdown = costBreakdown(usage, model);
@@ -166,7 +166,7 @@ function sessionAccounting(transcript, model = 'sonnet') {
166
166
  }
167
167
 
168
168
  /**
169
- * Phase 4: build the same accounting shape from summed history.jsonl token
169
+ * Build the same accounting shape from summed history.jsonl token
170
170
  * records (live usage numbers when `real`, estimated otherwise). Real usage
171
171
  * already includes system prompt + tools in cacheRead, so `used` counts
172
172
  * input + output + cache instead of re-adding the constants.
package/src/update.js CHANGED
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * On top of the shared checker this module carries the three pieces /upgrade
12
12
  * needs — `compareVersions`, `upgradeAdvice` and `latestPublishedVersion` —
13
- * ported from the reference (`aegiscodex-dev/src/session.js`). They belong
13
+ * ported from the upstream engine reference. They belong
14
14
  * here, next to `isNewer`/`updateLine`, so the CLI has ONE idea of "is there a
15
15
  * newer published version": the welcome-box notice and /upgrade now answer
16
16
  * from the same place and compare versions the same way. The shared module's
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * agents.js — subagent prompt presets for the desktop `task` tool, ported
5
- * from aegiscodex-dev's src/agents.js (same roles, same synthesis presets).
5
+ * from the upstream engine reference (same roles, same synthesis presets).
6
6
  * A preset is a system prompt: `task` runs it through the normal engine.chat
7
7
  * loop as a nested turn (its own tool rounds, same model class), not a
8
8
  * separate runtime, so the presets are pure prompt composition.
@@ -311,7 +311,7 @@ function resolveEffort({ effort, env, fanout } = {}) {
311
311
 
312
312
  /**
313
313
  * The operating directive injected as the autonomous turn's prompt preamble.
314
- * Ported verbatim in spirit from aegiscodex-dev/src/autonomous.js so both
314
+ * Ported verbatim in spirit from the upstream engine reference so both
315
315
  * clients behave the same; duplicated rather than vendored because the plugin
316
316
  * hosts no ESM build of that module.
317
317
  */
@@ -8,7 +8,7 @@
8
8
  * chosen class is the user's explicit selection.
9
9
  *
10
10
  * Since the tool-calling port it ALSO owns the agent loop (the client half of
11
- * aegiscodex-dev's src/backend.js runProvider): every turn carries a real
11
+ * the upstream engine's src/backend.js runProvider): every turn carries a real
12
12
  * system prompt (prompt.js) and the builtin tool schemas (tools.js), and when
13
13
  * a provider answers with tool calls the loop executes them in-process and
14
14
  * feeds the results back for as many rounds as the model keeps calling tools
@@ -27,7 +27,7 @@
27
27
  * executor never has to be exposed to the renderer.
28
28
  *
29
29
  * Two turn-scoped resources ride along with the loop, mirroring
30
- * aegiscodex-dev's runProvider exactly:
30
+ * the upstream engine's runProvider exactly:
31
31
  * - a lazily-started ShellSession (shell.js) that the `exec` tool shares,
32
32
  * so cd/export state persists across calls within one turn instead of
33
33
  * each call spawning a fresh process;
@@ -159,7 +159,7 @@ function providerKeyFromEnv(provider) {
159
159
  }
160
160
 
161
161
  /**
162
- * Mirrors aegiscodex-dev's src/backend.js DEEPSEEK_REASONING_MODEL_RE +
162
+ * Mirrors the upstream engine's src/backend.js DEEPSEEK_REASONING_MODEL_RE +
163
163
  * EFFORT_TOKEN_BUDGET verbatim. DeepSeek's reasoning models (deepseek-flash,
164
164
  * i.e. "Flash 4.1", deepseek-v4-pro, the deprecated deepseek-reasoner, and the
165
165
  * legacy v4-flash/v4.1-flash aliases some configs still carry) spend part of
@@ -170,7 +170,7 @@ function providerKeyFromEnv(provider) {
170
170
  * tool calls, just a turn that "completes" with nothing to show for it (the
171
171
  * empty-response bug). A user pointing the Custom OpenAI-compatible class
172
172
  * straight at DeepSeek's API hits exactly this, so the request is sized by the
173
- * same effort budget aegiscodex-dev uses for its own direct DeepSeek calls.
173
+ * same effort budget the upstream engine uses for its own direct DeepSeek calls.
174
174
  *
175
175
  * desktop/renderer/budget.js carries the renderer's copy of these two
176
176
  * constants plus budgetFor() below; test/budget.test.mjs requires both and
@@ -437,7 +437,7 @@ function createLocalEngine({
437
437
  settings,
438
438
  tools,
439
439
  promptBuilder,
440
- // Phase 20 — the level's recall breadth, injected by the host that owns the
440
+ // The level's recall breadth, injected by the host that owns the
441
441
  // avatar ledger (desktop/main.js builds one from lib/avatar/turn.js). It is a
442
442
  // SEAM rather than a call into lib/avatar/* because this engine is shared with
443
443
  // the CLI (cli/src/deps.js loads this file): the engine must not grow a
@@ -920,7 +920,7 @@ function createLocalEngine({
920
920
  // that used to claim a figure for the pooled class is gone — see
921
921
  // desktop/renderer/budget.js). Omitting the field is
922
922
  // what tells aegis1 "no cap stated — let effort decide", the same
923
- // contract aegiscodex-dev sends.
923
+ // contract the upstream engine sends.
924
924
  //
925
925
  // A cap the caller DID state is a different thing, and dropping it was
926
926
  // a bug: aegis1 reads a body max_tokens as a ceiling over its ladder,
@@ -960,7 +960,7 @@ function createLocalEngine({
960
960
  //
961
961
  // Writing is still available, explicitly: the aegis_memory_save tool
962
962
  // (mcp/tools.js; the CLI exposes it as /memory). Recall on every turn,
963
- // store only what the user asks for — which is what aegiscodex-dev's
963
+ // store only what the user asks for — which is what the upstream engine's
964
964
  // own cross-session memory does, and what this comment claimed to
965
965
  // match while sending both halves.
966
966
  //
@@ -1324,7 +1324,7 @@ function createLocalEngine({
1324
1324
  let truncationRetried = false;
1325
1325
  let synthesisDone = false;
1326
1326
 
1327
- // Round cap — the bound aegiscodex-dev has had all along and this engine
1327
+ // Round cap — a bound the upstream engine has had all along and this engine
1328
1328
  // did not. Removing the old fixed cap (12) was right in spirit and wrong
1329
1329
  // in effect: it left the turn with NO horizon, and on 2026-09-15 the
1330
1330
  // question "can you check the plan" ran ~70 rounds, grew the context
@@ -1333,7 +1333,7 @@ function createLocalEngine({
1333
1333
  // re-sends the whole conversation, so an unbounded loop gets more
1334
1334
  // expensive the longer it runs.
1335
1335
  //
1336
- // The numbers match aegiscodex-dev's (src/autonomous.js) so both clients
1336
+ // The numbers match the upstream engine's (src/autonomous.js) so both clients
1337
1337
  // behave the same: 24 rounds for a chat turn, 40 for an autonomous one.
1338
1338
  // Env-overridable for a deliberately long job.
1339
1339
  // A stated horizon (env) still wins outright — an explicit number is the
@@ -4,7 +4,7 @@
4
4
  * Minimal git worktree introspection: where the repo root is, and what is
5
5
  * dirty right now with a content hash per path.
6
6
  *
7
- * Ported from aegiscodex-dev/src/git-scope.js (ESM → CommonJS). `turn-guard.js`
7
+ * Ported from the upstream engine reference (ESM → CommonJS). `turn-guard.js`
8
8
  * uses `gitRoot` and `gitStatusSnapshot`; the queue now hosts the commit path
9
9
  * too, so `foreignChanges` and `scopedCommit` are carried over as well — they
10
10
  * were deliberately absent while nothing here queued work, because a copy of
@@ -2,9 +2,9 @@
2
2
 
3
3
  /**
4
4
  * prompt.js — the desktop client's system prompt (client half of
5
- * aegiscodex-dev's tool calling).
5
+ * the upstream engine's tool calling).
6
6
  *
7
- * aegiscodex-dev sends a real persona on every provider turn
7
+ * The upstream engine sends a real persona on every provider turn
8
8
  * (src/backend.js MAIN_CHAT_PROMPT plus a docs/operating-context.md block).
9
9
  * The desktop renderer used to send nothing at all, so every model answered a
10
10
  * bare user string with no identity, no work rules and no idea which machine
@@ -23,7 +23,7 @@
23
23
  * repo roots the host already knows (main.js), so the model stops asking.
24
24
  */
25
25
 
26
- /** Identity + work rules. Ported from aegiscodex-dev src/backend.js. */
26
+ /** Identity + work rules. Ported from the upstream engine reference. */
27
27
  const MAIN_CHAT_PROMPT =
28
28
  `You are Aegiscodex, a terminal coding assistant that works in the user's repository. ` +
29
29
  `Help with software engineering tasks: read and reason about code, write and edit files, ` +
@@ -443,8 +443,8 @@ function parsePlanStatus(text) {
443
443
  if (line.trim() === '' || /^\s+\S/.test(line)) continue;
444
444
  inStatus = false; // anything else (e.g. '---') ends the block
445
445
  }
446
- // Every PLAN.md in these repos writes `## Phase 7 ✅ — title` (✅ right after
447
- // the number). A trailing `## Phase 7 — title ✅` is accepted too, because
446
+ // Every PLAN.md in these repos writes `## Phase N ✅ — title` (✅ right after
447
+ // the number). A trailing `## Phase N — title ✅` is accepted too, because
448
448
  // reconcile reads plans other sessions and agents wrote, and a heading that
449
449
  // says it shipped means it shipped wherever the ✅ sits.
450
450
  const hm = line.match(/^##\s*Phase\s+(\d+)\b/);
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * shell.js — a persistent shell session for the `exec` tool, ported from
5
- * aegiscodex-dev's src/shell.js (client half of the same design).
5
+ * the upstream engine reference (client half of the same design).
6
6
  *
7
7
  * The desktop `exec` tool used to spawn ONE process per call: `cd /foo` in
8
8
  * one turn had no effect on the next call, so a model that wanted to work
@@ -2,9 +2,9 @@
2
2
 
3
3
  /**
4
4
  * tools.js — the local tool layer for the desktop agent loop (client half of
5
- * aegiscodex-dev's tool calling).
5
+ * the upstream engine's tool calling).
6
6
  *
7
- * Two jobs, mirroring aegiscodex-dev/src/tools.js:
7
+ * Two jobs, mirroring the upstream engine reference:
8
8
  * 1. Tool schemas in the wire format each API family expects — Anthropic's
9
9
  * `{name, description, input_schema}` vs OpenAI-compatible
10
10
  * `{type:'function', function:{name, description, parameters}}`.
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Turn-start foreign-write detection.
5
5
  *
6
- * Ported from aegiscodex-dev/src/turn-guard.js (ESM → CommonJS).
6
+ * Ported from the upstream engine reference (ESM → CommonJS).
7
7
  *
8
8
  * Bug this exists for: the commit-time scope check already knew how to tell
9
9
  * "my changes" from "somebody else's in-flight work" — but only *after* a
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Cross-process lock on a git working tree.
5
5
  *
6
- * Ported from aegiscodex-dev/src/worktree-lock.js (ESM → CommonJS).
6
+ * Ported from the upstream engine reference (ESM → CommonJS).
7
7
  *
8
8
  * Bug this exists for: nothing keyed on *the working tree*. A session-scoped
9
9
  * lock only stops two processes resuming the SAME transcript, so three
@@ -74,13 +74,13 @@ const CONFIRM_MODE_NAMESPACE = '__confirmMode';
74
74
  * what turns it off. Nothing secret lives here, so no encryption. */
75
75
  const MEMORY_PERSIST_NAMESPACE = '__memoryPersist';
76
76
 
77
- /** Reserved namespace for the avatar/companion preferences (Phase 21):
77
+ /** Reserved namespace for the avatar/companion preferences:
78
78
  * `{ enabled, showLevel, motion }` — app-level, not a provider, so it stays out
79
79
  * of the provider CRUD surface for the same reason the AEGIS key does. The
80
80
  * persona itself is deliberately NOT stored here: it is a document, not a
81
81
  * preference, and it lives at `<userData>/avatar/persona.json`, read and
82
82
  * written by main through lib/avatar/store.js so a hand-edited or imported
83
- * persona is validated on the way in (see docs/avatar-plan.md §3).
83
+ * persona is validated on the way in.
84
84
  * Defaults are the shipped behaviour: the avatar is ON, the level readout is
85
85
  * shown, and motion follows the OS `prefers-reduced-motion` setting. */
86
86
  const AVATAR_NAMESPACE = '__avatar';
@@ -374,7 +374,7 @@ function createSettingsStore({ dir, safeStorage } = {}) {
374
374
  return memoryPersistState();
375
375
  }
376
376
 
377
- // --- Avatar: reserved namespace, plain preferences (Phase 21) ------------
377
+ // --- Avatar: reserved namespace, plain preferences ------------
378
378
  // The companion's on/off switch, its level readout, and its motion mode.
379
379
  // Nothing secret lives here, so no encryption — same reasoning as the quick
380
380
  // launcher and memory-persist namespaces above.
@@ -68,11 +68,11 @@ function usageTokens(usage) {
68
68
 
69
69
  /**
70
70
  * Rough token count for text the wire never measured — a direct port of the
71
- * CLI's own estimator (`aegiscodex-dev/src/tokens.js estimateTokens`), and the
71
+ * CLI's own estimator (the upstream engine's estimateTokens), and the
72
72
  * reason its session total is MONOTONIC.
73
73
  *
74
74
  * This is the whole difference being fixed. The CLI's `appendHistory`
75
- * (aegiscodex-dev/src/history.js) writes a `tokens` object for EVERY finished
75
+ * (the upstream engine's history module) writes a `tokens` object for EVERY finished
76
76
  * exchange: `{input, output, cacheRead, cacheWrite, real: true}` when the wire
77
77
  * reported usage, and `{input: estimateTokens(prompt), output:
78
78
  * estimateTokens(reply), real: false}` when it did not. `real` is a FLAG, not a
@@ -477,7 +477,7 @@ function usageBuckets(usage) {
477
477
  * Cache hit rate for a usage record: the share of prompt tokens the provider
478
478
  * actually served from its cache rather than billing at miss price.
479
479
  *
480
- * Ported from `aegiscodex-dev/src/tokens.js`. It reads through `usageBuckets`
480
+ * Ported from the upstream engine reference. It reads through `usageBuckets`
481
481
  * rather than off the raw object, which is the one deliberate difference: the
482
482
  * engine's copy is handed an already-normalised record, while this module is
483
483
  * also handed WIRE usage (a provider's raw response body) and ledger rows. A
@@ -588,7 +588,7 @@ function turnAccounting(usage, model, opts = {}) {
588
588
  const tokens = usageTokens(usage);
589
589
  const u = usage && typeof usage === 'object' ? usage : {};
590
590
  // The settled charge can arrive either on the response or folded into the
591
- // usage object — aegiscodex-dev/src/main.js does the latter
591
+ // usage object — the upstream engine does the latter
592
592
  // (`{ ...result.usage, costUsd: result.costUsd }`), so both are accepted.
593
593
  const settled = typeof opts.costUsd === 'number'
594
594
  ? opts.costUsd
@@ -703,7 +703,7 @@ function rollTurn(roll, usage, opts = {}) {
703
703
  if (turn.tokens == null) {
704
704
  // No reported usage. The CLI does not let such a turn vanish from the
705
705
  // total: `appendHistory` estimates it from the text and marks it
706
- // `real: false` (aegiscodex-dev/src/history.js), and
706
+ // `real: false` (the upstream engine's history module), and
707
707
  // `aggregateSessionUsage` then adds it like any other row. Folding the same
708
708
  // estimate here is what makes the live roll and the rebuilt roll the same
709
709
  // number, and what stops the total standing still on exactly the turns the
@@ -772,7 +772,7 @@ function rollMessages(messages) {
772
772
  * The ledger row one finished dispatch must carry into the shared session
773
773
  * store, so the rolling total can be REBUILT when the thread is reopened —
774
774
  * the desktop's counterpart of the CLI's `appendHistory`
775
- * (aegiscodex-dev/src/history.js:36).
775
+ * (the upstream engine's history module).
776
776
  *
777
777
  * One authority for the row, on purpose. The CLI writes a `tokens` object for
778
778
  * EVERY exchange and skips none: