aegiscode 6.8.37 → 7.0.1

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 (110) hide show
  1. package/README.md +39 -1
  2. package/bin/aegiscode.js +137 -0
  3. package/package.json +1 -1
  4. package/scripts/check.mjs +5 -0
  5. package/scripts/demo.mjs +5 -0
  6. package/scripts/predist.mjs +29 -2
  7. package/scripts/runtests.mjs +5 -0
  8. package/scripts/seal-gate.mjs +76 -0
  9. package/src/agents.js +5 -0
  10. package/src/app.js +59 -1
  11. package/src/art.js +5 -0
  12. package/src/autonomous.js +23 -0
  13. package/src/caps.js +5 -0
  14. package/src/chatflow.js +104 -31
  15. package/src/checkpoint.js +5 -0
  16. package/src/clipboard.js +5 -0
  17. package/src/cloudsync.js +5 -0
  18. package/src/commands.js +487 -4
  19. package/src/config.js +5 -0
  20. package/src/credentials.js +5 -0
  21. package/src/deps.js +5 -0
  22. package/src/devrun.js +5 -0
  23. package/src/diff.js +5 -0
  24. package/src/diffview.js +5 -0
  25. package/src/engine.js +5 -0
  26. package/src/entitlement.js +5 -0
  27. package/src/events.js +15 -0
  28. package/src/export.js +5 -0
  29. package/src/fingerprint.js +5 -0
  30. package/src/format.js +5 -0
  31. package/src/fuzzy.js +5 -0
  32. package/src/gate.js +12 -0
  33. package/src/history.js +5 -0
  34. package/src/init.js +5 -0
  35. package/src/input.js +5 -0
  36. package/src/keys.js +29 -2
  37. package/src/limits.js +192 -0
  38. package/src/markdown.js +5 -0
  39. package/src/mcp.js +13 -0
  40. package/src/models.js +5 -0
  41. package/src/naming.js +5 -0
  42. package/src/overlays.js +7 -2
  43. package/src/panels.js +5 -0
  44. package/src/permissions.js +56 -1
  45. package/src/ping.js +5 -0
  46. package/src/presence.js +5 -0
  47. package/src/provenance.js +238 -0
  48. package/src/provenance.lock.json +36 -0
  49. package/src/render.js +5 -0
  50. package/src/screen.js +5 -0
  51. package/src/screens.js +48 -37
  52. package/src/secret.js +5 -0
  53. package/src/securefs.js +5 -0
  54. package/src/settings.js +5 -0
  55. package/src/shared.js +5 -0
  56. package/src/sharedpaths.js +5 -0
  57. package/src/signup.js +5 -0
  58. package/src/summarize.js +5 -0
  59. package/src/sysdiag.js +582 -0
  60. package/src/system.js +5 -0
  61. package/src/theme.js +5 -0
  62. package/src/title.js +5 -0
  63. package/src/todos.js +5 -0
  64. package/src/tokens.js +5 -0
  65. package/src/topup.js +5 -0
  66. package/src/update.js +5 -0
  67. package/vendor/client/aegis.js +27 -0
  68. package/vendor/client/attest.js +5 -0
  69. package/vendor/client/authorship-key.js +5 -0
  70. package/vendor/client/auto-provision.js +5 -0
  71. package/vendor/client/brain-catalog.js +5 -0
  72. package/vendor/client/byok-catalog.js +48 -8
  73. package/vendor/client/credentials.js +5 -0
  74. package/vendor/client/device-fingerprint.js +5 -0
  75. package/vendor/client/env-file.js +5 -0
  76. package/vendor/client/fingerprint.js +5 -0
  77. package/vendor/client/foreign-memory.js +5 -0
  78. package/vendor/client/hooks.js +5 -0
  79. package/vendor/client/model-discovery.js +332 -0
  80. package/vendor/client/platform.js +5 -0
  81. package/vendor/client/prefs.js +5 -0
  82. package/vendor/client/presence-constants.js +5 -0
  83. package/vendor/client/presence.js +5 -0
  84. package/vendor/client/record-vault.js +5 -0
  85. package/vendor/client/session-store.js +5 -0
  86. package/vendor/client/topup.js +5 -0
  87. package/vendor/client/touch.js +5 -0
  88. package/vendor/client/update.js +5 -0
  89. package/vendor/client/user-models.js +383 -0
  90. package/vendor/desktop/lib/local/aegis-seal.mjs +5 -0
  91. package/vendor/desktop/lib/local/agents.js +5 -0
  92. package/vendor/desktop/lib/local/autonomous.js +86 -0
  93. package/vendor/desktop/lib/local/context.js +5 -0
  94. package/vendor/desktop/lib/local/covenant.js +5 -0
  95. package/vendor/desktop/lib/local/engine.js +463 -12
  96. package/vendor/desktop/lib/local/entitlement.js +5 -0
  97. package/vendor/desktop/lib/local/git-scope.js +5 -0
  98. package/vendor/desktop/lib/local/local.js +5 -0
  99. package/vendor/desktop/lib/local/prompt.js +5 -0
  100. package/vendor/desktop/lib/local/queue.js +5 -0
  101. package/vendor/desktop/lib/local/session-rounds.js +5 -0
  102. package/vendor/desktop/lib/local/shell.js +88 -9
  103. package/vendor/desktop/lib/local/tools.js +13 -6
  104. package/vendor/desktop/lib/local/turn-guard.js +5 -0
  105. package/vendor/desktop/lib/local/worktree-lock.js +5 -0
  106. package/vendor/desktop/lib/settings.js +5 -0
  107. package/vendor/desktop/renderer/usage.js +73 -1
  108. package/vendor/mcp/server.js +5 -0
  109. package/vendor/mcp/tools.js +5 -0
  110. package/vendor/tools/agent-gate.mjs +23 -0
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
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.
1
6
  'use strict';
2
7
 
3
8
  /**
@@ -280,10 +285,34 @@ const SHELL_CACHE = new Map();
280
285
  function resolveSessionShell(options = {}) {
281
286
  const o = shellSeams(options);
282
287
  if (o.platform === 'win32') {
283
- const spec = platform.shellSpec({ platform: 'win32', env: o.env });
288
+ const cmdSpec = platform.shellSpec({ platform: 'win32', env: o.env });
284
289
  const powershell =
285
290
  platform.resolveExecutable('powershell', { platform: 'win32', env: o.env, exists: o.exists }) ||
286
291
  'powershell.exe';
292
+ // ONE-SHOT NOW SPEAKS THE SESSION'S DIALECT TOO (2026-02-14 report, item 1).
293
+ //
294
+ // This used to be `oneShot: cmdSpec` — PowerShell for the session, cmd.exe
295
+ // for every one-shot — and that mismatch is what made `exec` silently wrong
296
+ // mid-turn. When the live session died (sentinel timeout, killed child, a
297
+ // rejected stdin write) the degrade paths below run one-shot, so from that
298
+ // moment on every remaining command in the turn was parsed by cmd.exe while
299
+ // the model kept emitting PowerShell quoting. cmd.exe answers
300
+ // `'"Write-Output \"' is not recognized as an internal or external command`
301
+ // — localized, so on sv-SE it reads `Felaktig syntax för filnamn, katalognamn
302
+ // eller volymetikett`, which looks like a filesystem fault and not a shell
303
+ // change — and nothing in the tool result said the shell had switched.
304
+ //
305
+ // `-Command` accepts exactly the quoting the session accepts, so a
306
+ // degradation is now a transport change and not a language change. cmd.exe
307
+ // is no longer reachable from this path at all: if PowerShell cannot be
308
+ // resolved the spawn fails loudly (oneShotShell reports `error: …`) instead
309
+ // of quietly running the command in a shell that cannot read it.
310
+ const oneShot = {
311
+ cmd: powershell,
312
+ arg: '-Command',
313
+ kind: 'powershell',
314
+ source: 'powershell.exe',
315
+ };
287
316
  return {
288
317
  ok: true,
289
318
  cmd: powershell,
@@ -294,11 +323,16 @@ function resolveSessionShell(options = {}) {
294
323
  unsupported: null,
295
324
  caveat: null,
296
325
  error: null,
297
- // One-shot commands on Windows stay cmd.exe: that is what the pre-session
298
- // `exec` always used, and PowerShell is only the session's dialect.
299
- oneShot: spec,
326
+ oneShot,
300
327
  executed: [],
301
- tried: [{ candidate: powershell, ok: true, reason: 'the Windows default (PowerShell session, cmd.exe one-shot)' }],
328
+ tried: [
329
+ { candidate: powershell, ok: true, reason: 'the Windows default (PowerShell session AND one-shot)' },
330
+ {
331
+ candidate: cmdSpec.cmd,
332
+ ok: false,
333
+ reason: 'cmd.exe is never used for one-shot: it cannot parse the PowerShell quoting the session teaches',
334
+ },
335
+ ],
302
336
  };
303
337
  }
304
338
 
@@ -363,8 +397,11 @@ function oneShotShellSpec(options = {}) {
363
397
  return { ok: false, cmd: null, arg: null, kind: null, error: spec.error, spec };
364
398
  }
365
399
  if (spec.kind === 'powershell') {
366
- const cmdSpec = platform.shellSpec({ platform: 'win32', env: shellSeams(options).env });
367
- return { ok: true, cmd: cmdSpec.cmd, arg: cmdSpec.arg, kind: 'cmd', error: null, spec };
400
+ // The session's own one-shot spec (PowerShell `-Command`), so the `exec`
401
+ // tool's no-session path and this module's fallback cannot disagree about
402
+ // the dialect — which is exactly how cmd.exe used to sneak back in.
403
+ const shot = spec.oneShot || platform.shellSpec({ platform: 'win32', env: shellSeams(options).env });
404
+ return { ok: true, cmd: shot.cmd, arg: shot.arg, kind: shot.kind || 'powershell', error: null, spec };
368
405
  }
369
406
  return { ok: true, cmd: spec.cmd, arg: spec.arg, kind: 'posix-sh', error: null, spec };
370
407
  }
@@ -412,6 +449,10 @@ class ShellSession {
412
449
  this.buf = '';
413
450
  this.alive = false;
414
451
  this._pending = null; // resolver-scan for the in-flight command
452
+ this.cwd = cwd || process.cwd();
453
+ this.disposed = false; // an explicit dispose() must NOT be self-healed
454
+ this._respawns = 0; // one self-heal attempt per session, never a loop
455
+ this._degradedNoted = false; // the degrade marker is emitted once per session
415
456
  this.shellOptions = shellOptions || {};
416
457
  // Resolved BEFORE anything is spawned or written: `shell.kind` is what the
417
458
  // command framing below branches on, so an unverified `$SHELL` can never
@@ -485,7 +526,21 @@ class ShellSession {
485
526
  if (!this.alive && this.shellError) {
486
527
  return Promise.resolve({ content: this.shellError, isError: true });
487
528
  }
488
- return oneShotShell({ command, timeout, working_directory, shellOptions: this.shellOptions });
529
+ // SELF-HEAL BEFORE DEGRADING. The old path latched: once the live session
530
+ // died (a timeout kill, a child exit, a spawn error) every remaining
531
+ // command in the turn ran one-shot, and on Windows that one-shot used to
532
+ // be cmd.exe — so the agent stayed silently wrong for the rest of the
533
+ // turn. Re-probe and re-spawn ONCE instead, and only then fall through.
534
+ if (!this.alive && !this.disposed && this._respawns < 1) {
535
+ this._respawns += 1;
536
+ this.buf = '';
537
+ this.shell = resolveSessionShell(this.shellOptions);
538
+ this.shellError = this.shell.ok ? null : this.shell.error;
539
+ this._start(this.cwd);
540
+ if (this.alive) return this.run(command, { timeout, working_directory });
541
+ }
542
+ return oneShotShell({ command, timeout, working_directory, shellOptions: this.shellOptions })
543
+ .then((result) => this._noteDegraded(result, !this.alive ? 'the persistent session is not running' : 'no usable session dialect'));
489
544
  }
490
545
  let cmd = String(command || '');
491
546
 
@@ -557,7 +612,8 @@ class ShellSession {
557
612
  this.child.stdin.write(script);
558
613
  } catch {
559
614
  this.alive = false;
560
- oneShotShell({ command, timeout, working_directory, shellOptions: this.shellOptions }).then(finish);
615
+ oneShotShell({ command, timeout, working_directory, shellOptions: this.shellOptions })
616
+ .then((r) => finish(this._noteDegraded(r, 'the session stdin rejected the command')));
561
617
  return;
562
618
  }
563
619
  // Data may already be buffered (fast commands) — scan once now.
@@ -565,7 +621,30 @@ class ShellSession {
565
621
  });
566
622
  }
567
623
 
624
+ /**
625
+ * Mark a result that came from the one-shot fallback rather than the live
626
+ * session, so the model is TOLD the shell changed and can stop trusting its
627
+ * quoting contract.
628
+ *
629
+ * The 2026-02-14 report's worst finding was precisely that this happened
630
+ * silently: "nothing in the result tells the agent the shell changed" while
631
+ * the agent "degrades to a one-shot cmd.exe — and stays there for the
632
+ * remainder of the turn", so it kept emitting PowerShell quoting, got
633
+ * localized cmd.exe syntax errors, and finally blamed the user's machine.
634
+ * Emitted ONCE per session so a degraded turn stays readable.
635
+ */
636
+ _noteDegraded(result, reason) {
637
+ const r = result && typeof result === 'object' ? result : { content: String(result == null ? '' : result), isError: true };
638
+ if (this._degradedNoted) return r;
639
+ this._degradedNoted = true;
640
+ const via = this.shell && this.shell.cmd ? this.shell.cmd : 'unknown shell';
641
+ const was = this.shell && this.shell.kind ? this.shell.kind : 'none';
642
+ const marker = `[shell_degraded] ran one-shot via ${via} (${reason}); session dialect was ${was} — quoting contracts may differ`;
643
+ return { ...r, content: `${marker}\n${r.content || ''}` };
644
+ }
645
+
568
646
  dispose() {
647
+ this.disposed = true;
569
648
  this.alive = false;
570
649
  if (this.child) {
571
650
  try { this.child.stdin.end(); } catch { /* already gone */ }
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
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.
1
6
  'use strict';
2
7
 
3
8
  /**
@@ -816,12 +821,14 @@ function execOneShot({ command, cwd, timeout, maxBuffer } = {}) {
816
821
  return new Promise((resolve) => {
817
822
  const limit = Math.min(Number(maxBuffer) || EXEC_MAX_BUFFER, EXEC_MAX_BUFFER);
818
823
  const ms = Math.min(Number(timeout) || EXEC_TIMEOUT_DEFAULT, EXEC_TIMEOUT_CAP);
819
- // Shell to run `exec` in: cmd.exe on Windows, a PROBED POSIX sh/bash
820
- // elsewhere. The choice, the platform seam that makes its win32 half
821
- // testable on Linux and the fish/csh/nu refusal all live in
822
- // client/platform.js + shell.js (Phase 30.1/30.3) — there is no second copy
823
- // of that decision here, and an unverifiable shell is REPORTED rather than
824
- // used.
824
+ // Shell to run `exec` in: PowerShell on Windows (both the persistent
825
+ // session AND the one-shot path — they must agree, or a session that dies
826
+ // mid-turn silently switches the quoting contract; see shell.js
827
+ // resolveSessionShell), a PROBED POSIX sh/bash elsewhere. The choice, the
828
+ // platform seam that makes its win32 half testable on Linux and the
829
+ // fish/csh/nu refusal all live in client/platform.js + shell.js (Phase
830
+ // 30.1/30.3) — there is no second copy of that decision here, and an
831
+ // unverifiable shell is REPORTED rather than used.
825
832
  const spec = shells.oneShotShellSpec();
826
833
  if (!spec.ok) {
827
834
  resolve(fail(spec.error));
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
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.
1
6
  'use strict';
2
7
 
3
8
  /**
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
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.
1
6
  'use strict';
2
7
 
3
8
  /**
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
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.
1
6
  'use strict';
2
7
 
3
8
  /**
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
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.
1
6
  'use strict';
2
7
 
3
8
  /**
@@ -139,9 +144,36 @@ function estimatedBuckets(prompt, reply, reasoning) {
139
144
  // Keys are matched by exact id first, then by prefix (ratesFor below), so a
140
145
  // family row covers every dated variant of it.
141
146
  const RATES = {
147
+ // Sonnet, Opus, Fable, Haiku — the four FAMILY rows, matched by prefix, and
148
+ // deliberately NOT re-pointed at any one generation's price.
149
+ //
150
+ // The tempting change is to price this row as Claude Sonnet 5's published
151
+ // $2.00/$10.00, on the theory that `sonnet` names Sonnet 5. It does not: this
152
+ // repo's own alias tables carry no such id. `cli/src/models.js` lists pooled
153
+ // seats by name and `cli/src/config.js` records that the platform "does not
154
+ // advertise" `sonnet` at all — a pin on it was a phantom that made the pool
155
+ // answer from its own default with no error. So a bare `sonnet` is a LABEL,
156
+ // not a route: `cli/src/tokens.js` uses it as the default stand-in when no
157
+ // model is named, and the family row here is what a non-`claude-`-prefixed
158
+ // spelling resolves to by prefix.
159
+ //
160
+ // $3.00/$15.00 is therefore the honest figure for it, and it is the SAME
161
+ // figure as `RATES.default` below — which is the point: an id that names no
162
+ // real vendored route prices exactly like an unpriced one, never like a
163
+ // current-generation model. Every id that DOES name a real model has an exact
164
+ // row in the Claude 5 block below, and an exact id out-ranks a prefix match,
165
+ // so correcting those is what fixes the money — re-pointing this family row
166
+ // only moves the number an admitted placeholder reports, and silently
167
+ // re-prices every dated spelling that resolves here by prefix
168
+ // (`sonnet-4-5-20250929` is pinned at $3.00 in test/turn-accounting.test.mjs
169
+ // for exactly that reason).
142
170
  sonnet: { input: 3.00, output: 15.00, cacheRead: 0.30, cacheWrite: 3.75 },
143
171
  default: { input: 3.00, output: 15.00, cacheRead: 0.30, cacheWrite: 3.75 },
144
- fable: { input: 5.00, output: 25.00, cacheRead: 0.50, cacheWrite: 6.25 },
172
+ // Fable — the alias for **claude-fable-5**, at Fable's published
173
+ // $10.00/$50.00. The $5.00/$25.00 this row used to carry is the Opus-class
174
+ // figure; Fable has never been priced there, and the error ran in the
175
+ // under-reporting direction on the most expensive model in the lineup.
176
+ fable: { input: 10.00, output: 50.00, cacheRead: 1.00, cacheWrite: 12.50 },
145
177
  opus: { input: 5.00, output: 25.00, cacheRead: 0.50, cacheWrite: 6.25 },
146
178
  // Haiku — the same class of hole as the DeepSeek row below, on the provider
147
179
  // whose prices we already thought we knew. The three rows above price Sonnet,
@@ -160,6 +192,46 @@ const RATES = {
160
192
  // match is EXACT and cannot be reordered away.
161
193
  'claude-haiku': { input: 1.00, output: 5.00, cacheRead: 0.10, cacheWrite: 1.25 },
162
194
 
195
+ // ── the Claude 5 line, one row per ID ────────────────────────────────────
196
+ //
197
+ // Every figure here is Anthropic's own published rate (docs.claude.com
198
+ // pricing table, fetched 2026-10-11), not a fraction derived from a sibling
199
+ // row. They are EXACT rows because the family fallback prices this
200
+ // generation wrong in both directions: `claude-sonnet-5-5` family-matched
201
+ // `sonnet` and `claude-fable-5-1` family-matched `fable`, so the very ids
202
+ // the picker offers and the BYOK relay forwards were billed at rates the
203
+ // vendor does not charge for them.
204
+ //
205
+ // cacheRead is NOT the 0.1x-input convention the 4.x rows above use.
206
+ // Anthropic changed the cache-hit multiplier on this generation and quotes
207
+ // it per model — 5% of input on Opus 5.5 and Sonnet 5.5 ($0.20 / $0.10),
208
+ // 2.5% on Fable 5.1 ($0.25), 10% on Fable 5 and Haiku 5.5 ($1.00 / $0.01)
209
+ // — so each row carries the published number rather than a multiplier this
210
+ // file computed. cacheWrite stays 1.25x input, which the same table
211
+ // confirms for all of them.
212
+ //
213
+ // Haiku 5.5 is priced by PROMPT LENGTH: the vendor charges 5x input and 5x
214
+ // output once a request's prompt passes 100k tokens ($0.50/$2.50). This
215
+ // schema has no prompt-size field — the only tiering it models is
216
+ // DeepSeek's time-of-day peak/offPeak — so the row carries the up-to-100k
217
+ // tier and a long-context Haiku turn UNDER-reports. Said out loud rather
218
+ // than left implicit: the alternative is 5x-ing every ordinary Haiku turn,
219
+ // which is the louder error.
220
+ 'claude-opus-5': { input: 5.00, output: 25.00, cacheRead: 0.50, cacheWrite: 6.25 },
221
+ 'claude-opus-5-5': { input: 4.00, output: 20.00, cacheRead: 0.20, cacheWrite: 5.00 },
222
+ 'claude-sonnet-5': { input: 2.00, output: 10.00, cacheRead: 0.20, cacheWrite: 2.50 },
223
+ 'claude-sonnet-5-5': { input: 2.00, output: 10.00, cacheRead: 0.10, cacheWrite: 2.50 },
224
+ 'claude-haiku-5-5': { input: 0.10, output: 0.50, cacheRead: 0.01, cacheWrite: 0.125 },
225
+ 'claude-fable-5': { input: 10.00, output: 50.00, cacheRead: 1.00, cacheWrite: 12.50 },
226
+ 'claude-fable-5-1': { input: 10.00, output: 50.00, cacheRead: 0.25, cacheWrite: 12.50 },
227
+ // The Sonnet 4.x spellings keep their own line items now that `sonnet`
228
+ // above carries the 5-line price: without these, a Claude Sonnet 4.x turn —
229
+ // the id a config saved before this change still holds, and the wire model
230
+ // the dated form names — would family-match the alias row and be billed
231
+ // $2.00/$10.00 against the vendor's $3.00/$15.00.
232
+ 'claude-sonnet-4-6': { input: 3.00, output: 15.00, cacheRead: 0.30, cacheWrite: 3.75 },
233
+ 'claude-sonnet-4-5': { input: 3.00, output: 15.00, cacheRead: 0.30, cacheWrite: 3.75 },
234
+
163
235
  // DeepSeek — read off the vendor's own pricing table
164
236
  // (api-docs.deepseek.com/quick_start/pricing), not from a secondary blog and
165
237
  // not from a mirror of our own catalog.
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ // SPDX-License-Identifier: AGPL-3.0-or-later
3
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
4
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
5
+ // Conveying a modified copy, or running one as a network service, owes the
6
+ // corresponding source under this licence (§5/§13) — see LICENSING.md.
2
7
  /**
3
8
  * AEGIS MCP server — exposes aegiscloud capabilities to any Claude Code user.
4
9
  *
@@ -1,3 +1,8 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
+ // AEGIS Code (aegiscode) — source: https://github.com/aegisinfo/aegiscode-plugin
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.
1
6
  'use strict';
2
7
 
3
8
  /**
@@ -306,6 +306,29 @@ const WRITEISH_BASH = [
306
306
  // `node --test` is deliberately NOT a hit.
307
307
  /\b(python[0-9.]*|perl)\s+-c\b/, /\b(python[0-9.]*|perl)\s+-e\b/,
308
308
  /\bnode\b[^|;]*\s(?:-e|--eval)\b/, /\b(sh|bash|zsh|dash)\s+-c\b/,
309
+
310
+ // Archive extraction overwrites arbitrary paths in bulk with none of the
311
+ // markers above: `tar -x`, `unzip`, `7z x/e` never mention `cp`/`mv`/a `>`.
312
+ // Found probing this list by hand on 2026-10-12 — none of these tripped it.
313
+ // Kept in step with aegiscodex-dev/src/repoguard.js, which carries the same list.
314
+ /\btar\b[^|;]*(?:-[A-Za-z]*x[A-Za-z]*\b|--extract\b)/,
315
+ /\bunzip\b/, /\b7z[ar]?\s+[xe]\b/,
316
+
317
+ // Download-straight-to-file: the write is the whole point, but the marker
318
+ // is a flag shared with nothing else (`-o`/`-O`/`--output`), not a bare tool
319
+ // name, so it is scoped to the specific tool that owns that flag.
320
+ /\bcurl\b[^|;]*\s-{1,2}(?:o|O|output|remote-name)\b/,
321
+ /\bwget\b[^|;]*\s-{1,2}(?:O|output-document)\b/,
322
+
323
+ // Bulk copy/sync — functionally `cp -r` under a different name.
324
+ /\brsync\b/,
325
+
326
+ // `-out`/`-o`/`--output` on the specific tools that use it to write a file,
327
+ // each scoped to its own tool name so an unrelated `-o` (e.g. `ls -o`) on
328
+ // some other command is not a false hit.
329
+ /\bopenssl\b[^|;]*\s-out\b/,
330
+ /\bgpg2?\b[^|;]*\s-{1,2}(?:o|output)\b/,
331
+ /\bbase64\b[^|;]*\s-{1,2}(?:o|output)\b/,
309
332
  ];
310
333
 
311
334
  /** Path-shaped tokens in a command line. Deliberately over-eager: see bashTargets. */