aegiscode 6.8.27 → 6.8.29

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.27",
4
+ "version": "6.8.29",
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)'],
@@ -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,
@@ -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
  });