aegiscode 6.8.28 → 6.8.30

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aegiscode",
3
3
  "productName": "AEGIS Code",
4
- "version": "6.8.28",
4
+ "version": "6.8.30",
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/chatflow.js CHANGED
@@ -50,7 +50,7 @@ const { renderMarkdown } = require('./markdown.js');
50
50
  const overlays = require('./overlays.js');
51
51
  const models = require('./models.js');
52
52
  const fuzzy = require('./fuzzy.js');
53
- const { fmtTokens, fmtEur, fmtElapsed } = require('./format.js');
53
+ const { fmtTokens, fmtEur, fmtElapsed, pathName } = require('./format.js');
54
54
  const { editPreview } = require('./diff.js');
55
55
  const { renderDiffBlock, defaultOpen } = require('./diffview.js');
56
56
  const { copyToClipboard, describeCopy, readClipboardText, readClipboardImage } = require('./clipboard.js');
@@ -175,7 +175,7 @@ function summarizeTurnTools(tools, { maxNames = 3 } = {}) {
175
175
  // First word only — the binary or builtin that ran, not its whole argv.
176
176
  // "node /a/b/c.mjs --flag" reports as "node", which is what a one-line
177
177
  // summary has room for.
178
- const head = cmd.trim().split(/\s+/)[0].split('/').pop();
178
+ const head = pathName(cmd.trim().split(/\s+/)[0]);
179
179
  if (head && !commands.includes(head)) commands.push(head);
180
180
  }
181
181
  }
@@ -183,7 +183,7 @@ function summarizeTurnTools(tools, { maxNames = 3 } = {}) {
183
183
  tools: (tools || []).length,
184
184
  failed,
185
185
  files,
186
- names: files.slice(0, maxNames).map((f) => f.split('/').pop()),
186
+ names: files.slice(0, maxNames).map((f) => pathName(f)),
187
187
  more: Math.max(0, files.length - maxNames),
188
188
  commands,
189
189
  };
package/src/commands.js CHANGED
@@ -66,7 +66,7 @@ const { transcriptToMarkdown, transcriptToJSON, writeExportFile, lastAssistantTe
66
66
  const { detectDevCommand, runDevServer } = require('./devrun.js');
67
67
  const credentials = require('./credentials.js');
68
68
  const cloudsync = require('./cloudsync.js');
69
- const { maskKey, fmtTokens } = require('./format.js');
69
+ const { maskKey, fmtTokens, shortCwd } = require('./format.js');
70
70
  const { pickerEntries } = require('./models.js');
71
71
  const { resolveShared } = require('./sharedpaths.js');
72
72
  const { createCliEntitlement, paymentView, probeFee } = require('./entitlement.js');
@@ -119,7 +119,6 @@ const EFFORT_LEVELS = overlays.EFFORT_VALUES;
119
119
  const note = (c, text) => c.push({ role: 'note', text });const panel = (c, lines) => c.push({ role: 'panel', lines });
120
120
  const tip = (c, text) => c.push({ role: 'tip', text });
121
121
  const done = (c, text) => c.push({ role: 'done', text });
122
- const shortCwd = () => process.cwd().split('/').filter(Boolean).pop() || '~';
123
122
 
124
123
  // ── The multi-agent fan-out (/multi run, /multiyolo, /aegis-multi run) ────────
125
124
  //
package/src/format.js CHANGED
@@ -51,4 +51,34 @@ function maskKey(key) {
51
51
  return `${s.slice(0, 6)}${'•'.repeat(4)}${s.slice(-4)}`;
52
52
  }
53
53
 
54
- module.exports = { fmtTokens, fmtEur, fmtEurSigned, fmtElapsed, maskKey };
54
+ // ── Paths, as the CLI labels them ───────────────────────────────────────────
55
+ //
56
+ // One home for "what do we call this directory", because the answer was
57
+ // `p.split('/').filter(Boolean).pop() || '~'` in five files — commands.js,
58
+ // history.js (twice), panels.js and init.js — and that is wrong on win32, where
59
+ // the separator is `\`: the status line, the session list and the resume picker
60
+ // each showed the WHOLE path where linux and darwin showed the leaf. Same class
61
+ // of bug as the tool layer's, so it is fixed the same way: the shared platform
62
+ // module owns the rule and the CLI calls it rather than spelling it again.
63
+
64
+ const sharedPlatform = require(require('./shared.js').resolveClientModule('platform.js'));
65
+
66
+ /**
67
+ * The name of a path — the leaf segment, whatever separator it arrived with.
68
+ * `''` when there is no leaf to name (empty, `/`, `C:\`).
69
+ */
70
+ function pathName(p) {
71
+ return sharedPlatform.baseName(p);
72
+ }
73
+
74
+ /** The leaf of a recorded cwd, or `~` when nothing was recorded. */
75
+ function cwdName(p) {
76
+ return pathName(p) || '~';
77
+ }
78
+
79
+ /** The leaf of THIS process's cwd — the status line's own label. */
80
+ function shortCwd() {
81
+ return cwdName(process.cwd());
82
+ }
83
+
84
+ module.exports = { fmtTokens, fmtEur, fmtEurSigned, fmtElapsed, maskKey, pathName, cwdName, shortCwd };
package/src/history.js CHANGED
@@ -26,6 +26,7 @@ const path = require('node:path');
26
26
  const { aegisDir } = require('./config.js');
27
27
  const { ensurePrivateDir, writePrivateFile } = require('./securefs.js');
28
28
  const { sessionStore } = require('./shared.js');
29
+ const { cwdName } = require('./format.js');
29
30
  const { estimateTokens } = require('./tokens.js');
30
31
 
31
32
  const HISTORY_LIMIT = 500;
@@ -183,7 +184,7 @@ function readOwnSessions(limit = 8) {
183
184
  .slice(0, limit)
184
185
  .map((e) => ({
185
186
  id: e.sessionId,
186
- cwd: (e.cwd || '').split('/').filter(Boolean).pop() || '~',
187
+ cwd: cwdName(e.cwd),
187
188
  // The conversation's own name when it has one (naming.js), else the old
188
189
  // raw-prompt fallback so a session recorded before naming existed is
189
190
  // still identifiable.
@@ -365,7 +366,7 @@ function readResumeList(limit = 8, ownLimit = 5, claudeLimit = 8) {
365
366
  const meta = j.extra && JSON.parse(j.extra);
366
367
  if (meta && meta.sessionId && !seen.has(meta.sessionId)) {
367
368
  seen.add(meta.sessionId);
368
- const c = (j.cwd || '').split('/').filter(Boolean).pop() || '~';
369
+ const c = cwdName(j.cwd);
369
370
  const t = (j.summary || '').slice(0, 60);
370
371
  claudeItems.push({ id: meta.sessionId, cwd: c, summary: t, time: j.timestamp, own: false });
371
372
  }
package/src/init.js CHANGED
@@ -15,6 +15,7 @@
15
15
  const fs = require('node:fs');
16
16
  const path = require('node:path');
17
17
  const { execSync } = require('node:child_process');
18
+ const { pathName } = require('./format.js');
18
19
 
19
20
  function readJson(p, cwd) {
20
21
  try { return JSON.parse(fs.readFileSync(path.join(cwd, p), 'utf8')); } catch { return null; }
@@ -27,11 +28,17 @@ function hasFile(cwd, ...names) {
27
28
  function gitName(cwd) {
28
29
  try {
29
30
  const remote = execSync('git config --get remote.origin.url', { encoding: 'utf8', cwd, stdio: ['ignore', 'pipe', 'ignore'] }).trim();
30
- const base = remote.split('/').pop().replace(/\.git$/, '');
31
+ // A remote is normally a posix URL, but a Windows checkout can record a
32
+ // drive path (`C:\src\foo`), and pathName reads both — it strips the same
33
+ // trailing `.git` either way.
34
+ const base = pathName(remote).replace(/\.git$/, '');
31
35
  if (base) return base;
32
36
  } catch {}
33
37
  try {
34
- const dir = cwd.split('/').filter(Boolean).pop();
38
+ // The project's own name is the leaf of its path — through the shared rule,
39
+ // so a Windows checkout (`C:\src\proj`) names "proj" like every other host
40
+ // instead of the whole path (see format.js).
41
+ const dir = pathName(cwd);
35
42
  return dir || 'this project';
36
43
  } catch { return 'this project'; }
37
44
  }
@@ -110,6 +117,9 @@ function sniffProject(cwd = process.cwd()) {
110
117
  if (fs.existsSync(path.join(cwd, d))) out.structure.push(d);
111
118
  }
112
119
  for (const f of ['eslint.config.js', '.eslintrc', '.prettierrc', 'biome.json', 'tsconfig.json', '.github/workflows']) {
120
+ // The FIRST segment of a repo-relative probe path. This one stays a literal
121
+ // split: `f` is written two lines up in repo-relative form, so its `/` is
122
+ // not a host separator. A path that arrived from the OS needs pathName().
113
123
  if (fs.existsSync(path.join(cwd, f))) out.toolchain.push(f.split('/')[0]);
114
124
  }
115
125
 
package/src/panels.js CHANGED
@@ -44,6 +44,9 @@ const { themeOf, BOLD, BOLD_OFF, GLYPH } = require('./theme.js');
44
44
  // Pure, like this module (signup.js requires nothing and does no I/O), so the
45
45
  // "everything here is assertable from a plain Node test" contract still holds.
46
46
  const { goUrl } = require('./signup.js');
47
+ // Path NAMES for the session overlay — the shared rule, not a second `split('/')`
48
+ // (which reported the whole path on win32). See format.js's path section.
49
+ const { cwdName, pathName } = require('./format.js');
47
50
 
48
51
  const VERSION = require('../package.json').version;
49
52
 
@@ -418,7 +421,7 @@ function renderSessionsOverlay(state, width, height, ctx = {}) {
418
421
  const W = Math.max(30, num(width) ? num(width) - 4 : 76);
419
422
  const ver = str(s.version);
420
423
  const model = str(s.model) || 'default model';
421
- const cwd = str(s.cwd).split('/').filter(Boolean).pop() || '~';
424
+ const cwd = cwdName(s.cwd);
422
425
  const sessions = Array.isArray(s.sessions) ? s.sessions.filter(Boolean) : [];
423
426
  const awaiting = sessions.filter((x) => x.awaiting || x.needsInput).length;
424
427
  const working = sessions.filter((x) => x.working).length;
@@ -698,7 +701,7 @@ function buildTerminalSetup(state, ctx = {}) {
698
701
  const s = obj(state);
699
702
  const env = typeof process !== 'undefined' && process.env ? process.env : {};
700
703
  const { cols, rows } = getSize();
701
- const shell = str(s.shell) || str(env.SHELL).split('/').pop();
704
+ const shell = str(s.shell) || pathName(str(env.SHELL));
702
705
  const table = [
703
706
  ['TERM', str(s.term) || str(env.TERM) || '(unset)'],
704
707
  ['LANG', str(s.lang) || str(env.LANG) || '(unset)'],
@@ -1002,6 +1002,8 @@ function createClient(opts = {}) {
1002
1002
  maxTokens,
1003
1003
  effort,
1004
1004
  reasoningEffort,
1005
+ tools,
1006
+ toolChoice,
1005
1007
  stream = false,
1006
1008
  onStream,
1007
1009
  signal,
@@ -1035,6 +1037,13 @@ function createClient(opts = {}) {
1035
1037
  // failed turn, not a harmless extra key.
1036
1038
  ...(effort ? { effort } : {}),
1037
1039
  ...(reasoningEffort ? { reasoning_effort: reasoningEffort } : {}),
1040
+ // Forwarded only when the caller actually supplied a schema — aegis1's
1041
+ // byok_chat_completions (app.py) reads `tools`/`tool_choice` off the body
1042
+ // and passes each to the provider only `if tools:`, so an empty array
1043
+ // here would still be a behavioural change for a provider that treats
1044
+ // `tools: []` differently from the field's plain absence.
1045
+ ...(Array.isArray(tools) && tools.length ? { tools } : {}),
1046
+ ...(toolChoice ? { tool_choice: toolChoice } : {}),
1038
1047
  };
1039
1048
  if (model) body.model = model;
1040
1049
  const headers = {
@@ -871,6 +871,42 @@ function resolvePath(input, options = {}) {
871
871
  return { ok: true, path: resolved, error: null, expandedHome };
872
872
  }
873
873
 
874
+ /**
875
+ * The last path segment of `input` — the NAME of a path, for display.
876
+ *
877
+ * This exists because `p.split('/').pop()` was the same expression in six CLI
878
+ * files, and it is wrong on half the hosts this product ships to: a real win32
879
+ * separator is `\`, so `C:\Users\you\proj` splits into ONE element and the
880
+ * "name" reported is the whole path. The status line, the session list, the
881
+ * resume picker and the `/export` file names all showed the full path there
882
+ * where linux and darwin showed `proj` — a cosmetic drift, but drifts are how
883
+ * the tool-layer bug shipped twice, and it is the same class of assumption
884
+ * (`/` is the separator) that `resolvePath` above exists to refuse.
885
+ *
886
+ * BOTH separators are accepted on every platform, unlike `resolvePath` which
887
+ * refuses a foreign path outright. That difference is deliberate: a name is not
888
+ * a security decision. The value can come from a git remote, a session recorded
889
+ * on another host, or a model's own output, and mis-slicing it produces a
890
+ * shorter label, never a write to the wrong file — so refusing it would trade a
891
+ * cosmetic bug for a worse one (an empty status line on a machine whose only
892
+ * oddity is a backslash).
893
+ *
894
+ * Returns `''` for an absent or empty path so each caller keeps its own
895
+ * fallback (`baseName(cwd) || '~'` is the CLI's "no cwd recorded" convention);
896
+ * a path that is nothing but separators ("/", "C:\") names no segment, so it is
897
+ * empty too rather than a stray "/" or a bare drive letter.
898
+ */
899
+ function baseName(input) {
900
+ if (typeof input !== 'string') return '';
901
+ const trimmed = input.trim().replace(/[/\\]+$/, '');
902
+ if (!trimmed) return '';
903
+ // "C:" is a drive, not a name: it is the Windows spelling of "/" (the root of
904
+ // the current drive) and names no segment any more than a slash does.
905
+ if (/^[A-Za-z]:$/.test(trimmed)) return '';
906
+ const cut = Math.max(trimmed.lastIndexOf('/'), trimmed.lastIndexOf('\\'));
907
+ return cut === -1 ? trimmed : trimmed.slice(cut + 1);
908
+ }
909
+
874
910
  const api = {
875
911
  IS_WIN32,
876
912
  resolveExecutable,
@@ -881,6 +917,7 @@ const api = {
881
917
  homeDir,
882
918
  desktopDir,
883
919
  resolvePath,
920
+ baseName,
884
921
  hasPosixModes,
885
922
  appLocale,
886
923
  languageName,
@@ -1392,6 +1392,17 @@ function createLocalEngine({
1392
1392
  system: opts.system,
1393
1393
  messages: opts.messages,
1394
1394
  maxTokens: opts.maxTokens,
1395
+ // aegis1's byok_chat_completions has read and forwarded `tools`/
1396
+ // `tool_choice` since 926069b (2026-09-10) — this call simply never
1397
+ // sent them, so every BYOK turn (DeepSeek, Anthropic, OpenAI alike)
1398
+ // ran with no write/exec/editFile schema at all. A model told in its
1399
+ // system prompt that it "writes and edits files" but never given the
1400
+ // JSON shape to do so improvises a DeepSeek-native DSML call from
1401
+ // prose alone when it's confident, and falls back to prose ADVICE
1402
+ // (a shell script to run by hand) when it isn't — which is exactly
1403
+ // the bug this line closes.
1404
+ tools: opts.tools,
1405
+ toolChoice: opts.toolChoice,
1395
1406
  // Native effort knob, field and level both from the dialect table.
1396
1407
  // `bareModel` is already provider-less, so it matches the dialect
1397
1408
  // regexes without further stripping. Only a dialect whose field is
@@ -1530,12 +1541,19 @@ function createLocalEngine({
1530
1541
  const signal = controller.signal;
1531
1542
 
1532
1543
  // A caller can opt out of the agent loop entirely (`tools: false`) and get
1533
- // the old single-shot turn back. byok is ALWAYS single-shot: the
1534
- // stateless relay (aegis.byokChatCompletion, /api/v1/byok/chat/completions)
1535
- // has no tools/tool_choice parameter at all, so sending schemas here would
1536
- // build a prompt promising tool access the transport silently drops —
1537
- // the model would reason about exec/readFile and never see a result.
1538
- const toolsEnabled = cls !== 'byok' && !(payload && payload.tools === false);
1544
+ // the old single-shot turn back. byok used to be forced into that same
1545
+ // single-shot shape unconditionally: aegis1's byok relay had no
1546
+ // tools/tool_choice parameter at all, so sending schemas would build a
1547
+ // prompt promising tool access the transport silently dropped — the model
1548
+ // would reason about exec/readFile and never see a result. That stopped
1549
+ // being true at aegis1 926069b (2026-09-10, byok_chat_completions reads
1550
+ // and forwards both), but this carve-out was never revisited, so every
1551
+ // BYOK turn since kept running with no tool schema at all regardless —
1552
+ // the model told in its own system prompt that it writes and edits files,
1553
+ // and never given the JSON shape to do so. Reported live: asked to save a
1554
+ // file to the Desktop, DeepSeek had no write tool to call and answered
1555
+ // with a PowerShell script for the user to run by hand instead.
1556
+ const toolsEnabled = !(payload && payload.tools === false);
1539
1557
  const toolSchemas = toolsEnabled ? T.toolsFor({ includeSubagent: depth < MAX_SUBAGENT_DEPTH }) : [];
1540
1558
  const toolChoice = (payload && payload.toolChoice) || null;
1541
1559
 
@@ -376,6 +376,15 @@ function normalizeArgs(name, args, ctx = {}) {
376
376
  const value = input[key];
377
377
  if (typeof value !== 'string' || !value.trim()) continue; // absent → the executor's default
378
378
  const res = platform.resolvePath(value, {
379
+ // The tool layer's platform seam, the same one `client/platform.js`
380
+ // takes on every function and `shell.js` already passes at its call
381
+ // site: `ctx.platform` names the host whose path rules apply. Absent
382
+ // (every existing caller), `resolvePath` falls back to
383
+ // `process.platform`, so this changes nothing at runtime — but it is
384
+ // what lets the win32 and darwin branches of THIS layer be exercised
385
+ // from a Linux CI, instead of being reachable only on a foreign host.
386
+ // See test/platform-parity.test.mjs.
387
+ platform: ctx && ctx.platform ? ctx.platform : undefined,
379
388
  cwd: ctx && ctx.cwd ? ctx.cwd : undefined,
380
389
  desktopdir: ctx && ctx.desktopdir ? ctx.desktopdir : undefined,
381
390
  });