@staff0rd/assist 0.636.0 → 0.638.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.636.0",
9
+ version: "0.638.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -307,8 +307,8 @@ function getRemoteOriginUrl(cwd) {
307
307
  }
308
308
 
309
309
  // src/commands/backlog/getCurrentOrigin.ts
310
- function stripLeadingSlashes(path90) {
311
- return path90.replace(/^\/+/, "");
310
+ function stripLeadingSlashes(path91) {
311
+ return path91.replace(/^\/+/, "");
312
312
  }
313
313
  function normalizeOrigin(raw) {
314
314
  const trimmed = raw.trim().replace(/\.git$/i, "").replace(/\/+$/, "");
@@ -358,9 +358,9 @@ function findGitLink(dir) {
358
358
  }
359
359
  return null;
360
360
  }
361
- function isFile(path90) {
361
+ function isFile(path91) {
362
362
  try {
363
- return statSync(path90).isFile();
363
+ return statSync(path91).isFile();
364
364
  } catch {
365
365
  return false;
366
366
  }
@@ -379,9 +379,9 @@ function linkedGitDirParent(gitDir) {
379
379
  const match = /^(.*)[/\\]worktrees[/\\][^/\\]+[/\\]?$/.exec(gitDir);
380
380
  return match ? match[1] : null;
381
381
  }
382
- function readTrimmed(path90) {
382
+ function readTrimmed(path91) {
383
383
  try {
384
- const content = readFileSync2(path90, "utf8").trim();
384
+ const content = readFileSync2(path91, "utf8").trim();
385
385
  return content === "" ? null : content;
386
386
  } catch {
387
387
  return null;
@@ -394,10 +394,10 @@ function absolute(target, from) {
394
394
  // src/shared/loadRawYaml.ts
395
395
  import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
396
396
  import { parse as parseYaml } from "yaml";
397
- function loadRawYaml(path90) {
398
- if (!existsSync3(path90)) return {};
397
+ function loadRawYaml(path91) {
398
+ if (!existsSync3(path91)) return {};
399
399
  try {
400
- const content = readFileSync3(path90, "utf8");
400
+ const content = readFileSync3(path91, "utf8");
401
401
  return parseYaml(content) || {};
402
402
  } catch {
403
403
  return {};
@@ -469,8 +469,8 @@ function mergeRawConfigs(globalRaw, projectRaw) {
469
469
  // src/commands/backlog/originDisplayName.ts
470
470
  function originDisplayName(origin) {
471
471
  if (origin.startsWith("local:")) {
472
- const path90 = origin.slice("local:".length).replace(/\/+$/, "");
473
- const segments = path90.split("/").filter(Boolean);
472
+ const path91 = origin.slice("local:".length).replace(/\/+$/, "");
473
+ const segments = path91.split("/").filter(Boolean);
474
474
  return segments[segments.length - 1] ?? origin;
475
475
  }
476
476
  const firstSlash = origin.indexOf("/");
@@ -2867,11 +2867,11 @@ function enumValues(node) {
2867
2867
  function opaqueConfigNode(inner, base) {
2868
2868
  return { ...base, kind: "other", type: leafTypeOf(inner) };
2869
2869
  }
2870
- function build(node, path90) {
2870
+ function build(node, path91) {
2871
2871
  const { inner, defaultValue, optional } = unwrapSchemaNode(node);
2872
2872
  const secret = isSecretSchemaNode(node) || isSecretSchemaNode(inner);
2873
2873
  const base = {
2874
- path: path90,
2874
+ path: path91,
2875
2875
  ...optional ? { optional: true } : {},
2876
2876
  ...defaultValue === void 0 ? {} : { defaultValue },
2877
2877
  ...secret ? { secret: true } : {}
@@ -2890,9 +2890,9 @@ function segmentText(segment) {
2890
2890
  if (segment.kind === "index") return `[${segment.index}]`;
2891
2891
  return "[]";
2892
2892
  }
2893
- function formatConfigPath(path90) {
2893
+ function formatConfigPath(path91) {
2894
2894
  let text18 = "";
2895
- for (const segment of path90) {
2895
+ for (const segment of path91) {
2896
2896
  const dotted = segment.kind === "key" || segment.kind === "entry";
2897
2897
  const rendered = segmentText(segment);
2898
2898
  text18 += dotted && text18 ? `.${rendered}` : rendered;
@@ -3590,9 +3590,9 @@ import { existsSync as existsSync13, readFileSync as readFileSync10 } from "fs";
3590
3590
 
3591
3591
  // src/commands/verify/forbiddenStrings/findForbiddenStrings.ts
3592
3592
  import { minimatch as minimatch2 } from "minimatch";
3593
- function resolveStringsAtPath(data, path90) {
3593
+ function resolveStringsAtPath(data, path91) {
3594
3594
  let current = data;
3595
- for (const segment of path90.split(".")) {
3595
+ for (const segment of path91.split(".")) {
3596
3596
  if (current === null || typeof current !== "object") return [];
3597
3597
  current = current[segment];
3598
3598
  }
@@ -3605,10 +3605,10 @@ function resolveStringsAtPath(data, path90) {
3605
3605
  }
3606
3606
  function findRuleViolations(data, rule) {
3607
3607
  const violations = [];
3608
- for (const path90 of rule.paths) {
3609
- for (const value of resolveStringsAtPath(data, path90)) {
3608
+ for (const path91 of rule.paths) {
3609
+ for (const value of resolveStringsAtPath(data, path91)) {
3610
3610
  if (minimatch2(value, rule.disallowed))
3611
- violations.push({ file: rule.file, path: path90, value });
3611
+ violations.push({ file: rule.file, path: path91, value });
3612
3612
  }
3613
3613
  }
3614
3614
  return violations;
@@ -3647,8 +3647,8 @@ function forbiddenStrings() {
3647
3647
  process.exit(0);
3648
3648
  }
3649
3649
  console.log("Forbidden strings found:\n");
3650
- for (const { file, path: path90, value } of violations) {
3651
- console.log(` ${file} ${path90}: ${value}`);
3650
+ for (const { file, path: path91, value } of violations) {
3651
+ console.log(` ${file} ${path91}: ${value}`);
3652
3652
  }
3653
3653
  console.log(`
3654
3654
  Total: ${violations.length} forbidden string(s).`);
@@ -4251,15 +4251,15 @@ function readBaselineMigrations(repoRelativeDir, ref) {
4251
4251
  } catch {
4252
4252
  return baseline;
4253
4253
  }
4254
- const paths = listing.split("\n").map((line) => line.trim()).filter(Boolean).filter((path90) => MIGRATION_FILE3.test(basename2(path90)));
4255
- for (const path90 of paths) {
4254
+ const paths = listing.split("\n").map((line) => line.trim()).filter(Boolean).filter((path91) => MIGRATION_FILE3.test(basename2(path91)));
4255
+ for (const path91 of paths) {
4256
4256
  try {
4257
- const content = execSync6(`git show "${ref}:${path90}"`, {
4257
+ const content = execSync6(`git show "${ref}:${path91}"`, {
4258
4258
  encoding: "utf8",
4259
4259
  maxBuffer: 16 * 1024 * 1024,
4260
4260
  stdio: ["pipe", "pipe", "pipe"]
4261
4261
  });
4262
- baseline.set(basename2(path90), content);
4262
+ baseline.set(basename2(path91), content);
4263
4263
  } catch {
4264
4264
  }
4265
4265
  }
@@ -6307,10 +6307,10 @@ var hooksSettings = {
6307
6307
  }
6308
6308
  };
6309
6309
  function ensureHooksSettings() {
6310
- const path90 = daemonPaths.hooksSettings;
6311
- mkdirSync5(dirname13(path90), { recursive: true });
6312
- writeFileSync15(path90, JSON.stringify(hooksSettings, null, 2));
6313
- return path90;
6310
+ const path91 = daemonPaths.hooksSettings;
6311
+ mkdirSync5(dirname13(path91), { recursive: true });
6312
+ writeFileSync15(path91, JSON.stringify(hooksSettings, null, 2));
6313
+ return path91;
6314
6314
  }
6315
6315
 
6316
6316
  // src/shared/spawnInherit.ts
@@ -6488,8 +6488,8 @@ function getPreferredRemoteRepo(cwd) {
6488
6488
  function gitRefUrl(kind, ref, cwd) {
6489
6489
  const repo = getPreferredRemoteRepo(cwd);
6490
6490
  if (!repo) return void 0;
6491
- const path90 = kind === "branch" ? "tree" : "commit";
6492
- return `https://github.com/${repo.org}/${repo.repo}/${path90}/${ref}`;
6491
+ const path91 = kind === "branch" ? "tree" : "commit";
6492
+ return `https://github.com/${repo.org}/${repo.repo}/${path91}/${ref}`;
6493
6493
  }
6494
6494
 
6495
6495
  // src/commands/branch/buildBranchName.ts
@@ -6732,9 +6732,9 @@ var LOCAL_FILES = ["backlog.jsonl", "backlog.db"];
6732
6732
  function backupLocalBacklogFiles(dir) {
6733
6733
  const moved = [];
6734
6734
  for (const name of LOCAL_FILES) {
6735
- const path90 = join15(dir, ".assist", name);
6736
- if (existsSync19(path90)) {
6737
- renameSync(path90, `${path90}.bak`);
6735
+ const path91 = join15(dir, ".assist", name);
6736
+ if (existsSync19(path91)) {
6737
+ renameSync(path91, `${path91}.bak`);
6738
6738
  moved.push(`${name} \u2192 ${name}.bak`);
6739
6739
  }
6740
6740
  }
@@ -6972,12 +6972,15 @@ function attachGitRefs(item, rel, id) {
6972
6972
 
6973
6973
  // src/commands/backlog/attachSessions.ts
6974
6974
  function rowToSession(s) {
6975
- return {
6975
+ const session = {
6976
6976
  phaseIdx: s.phaseIdx,
6977
6977
  claudeSessionId: s.claudeSessionId,
6978
6978
  hostname: s.hostname,
6979
6979
  osUser: s.osUser
6980
6980
  };
6981
+ if (s.createdAt != null)
6982
+ session.createdAt = new Date(s.createdAt).toISOString();
6983
+ return session;
6981
6984
  }
6982
6985
  function attachSessions(item, rel, id) {
6983
6986
  const sessions = (rel.sessions.get(id) ?? []).map(rowToSession);
@@ -7147,7 +7150,8 @@ var phaseSessionSchema = z4.strictObject({
7147
7150
  phaseIdx: z4.number(),
7148
7151
  claudeSessionId: z4.string(),
7149
7152
  hostname: z4.string(),
7150
- osUser: z4.string()
7153
+ osUser: z4.string(),
7154
+ createdAt: z4.string().optional()
7151
7155
  });
7152
7156
  var phaseUsageTotalSchema = z4.strictObject({
7153
7157
  tokensUp: z4.number(),
@@ -7214,8 +7218,8 @@ var backlogItemSchema = z4.strictObject({
7214
7218
  var backlogFileSchema = z4.array(backlogItemSchema);
7215
7219
 
7216
7220
  // src/commands/backlog/parseBacklogJsonl.ts
7217
- function parseBacklogJsonl(path90) {
7218
- const content = readFileSync15(path90, "utf8").trim();
7221
+ function parseBacklogJsonl(path91) {
7222
+ const content = readFileSync15(path91, "utf8").trim();
7219
7223
  if (content.length === 0) return [];
7220
7224
  return content.split("\n").map((line) => line.trim()).filter(Boolean).map((line) => backlogItemSchema.parse(JSON.parse(line)));
7221
7225
  }
@@ -8026,24 +8030,24 @@ function getOwnerPath(itemId2) {
8026
8030
  function recordSignalOwner(itemId2) {
8027
8031
  const sessionId = process.env.ASSIST_SESSION_ID;
8028
8032
  if (!sessionId) return;
8029
- const path90 = getOwnerPath(itemId2);
8030
- mkdirSync7(dirname15(path90), { recursive: true });
8031
- writeFileSync17(path90, JSON.stringify({ sessionId }));
8033
+ const path91 = getOwnerPath(itemId2);
8034
+ mkdirSync7(dirname15(path91), { recursive: true });
8035
+ writeFileSync17(path91, JSON.stringify({ sessionId }));
8032
8036
  }
8033
8037
  function readSignalOwner(itemId2) {
8034
- const path90 = getOwnerPath(itemId2);
8035
- if (!existsSync23(path90)) return void 0;
8038
+ const path91 = getOwnerPath(itemId2);
8039
+ if (!existsSync23(path91)) return void 0;
8036
8040
  try {
8037
- const parsed = JSON.parse(readFileSync16(path90, "utf8"));
8041
+ const parsed = JSON.parse(readFileSync16(path91, "utf8"));
8038
8042
  return parsed.sessionId;
8039
8043
  } catch {
8040
8044
  return void 0;
8041
8045
  }
8042
8046
  }
8043
8047
  function clearSignalOwner(itemId2) {
8044
- const path90 = getOwnerPath(itemId2);
8048
+ const path91 = getOwnerPath(itemId2);
8045
8049
  try {
8046
- rmSync(path90);
8050
+ rmSync(path91);
8047
8051
  } catch {
8048
8052
  }
8049
8053
  }
@@ -8080,19 +8084,19 @@ function resolveSignalTarget(event, data) {
8080
8084
  function writeSignal(event, data) {
8081
8085
  const target = resolveSignalTarget(event, data);
8082
8086
  if (!target) return;
8083
- const path90 = getSignalPath(target);
8084
- if (!path90) return;
8087
+ const path91 = getSignalPath(target);
8088
+ if (!path91) return;
8085
8089
  const signal = { event, sessionId: target, ...data };
8086
- mkdirSync8(dirname16(path90), { recursive: true });
8087
- writeFileSync18(path90, JSON.stringify(signal));
8090
+ mkdirSync8(dirname16(path91), { recursive: true });
8091
+ writeFileSync18(path91, JSON.stringify(signal));
8088
8092
  }
8089
8093
 
8090
8094
  // src/commands/backlog/readSignal.ts
8091
8095
  function readSignal() {
8092
- const path90 = getSignalPath();
8093
- if (!path90 || !existsSync24(path90)) return void 0;
8096
+ const path91 = getSignalPath();
8097
+ if (!path91 || !existsSync24(path91)) return void 0;
8094
8098
  try {
8095
- return JSON.parse(readFileSync17(path90, "utf8"));
8099
+ return JSON.parse(readFileSync17(path91, "utf8"));
8096
8100
  } catch {
8097
8101
  return void 0;
8098
8102
  }
@@ -8290,13 +8294,13 @@ function activityPath(sessionId) {
8290
8294
  function emitActivity(activity2) {
8291
8295
  const sessionId = process.env.ASSIST_ACTIVITY_ID;
8292
8296
  if (!sessionId) return;
8293
- const path90 = activityPath(sessionId);
8294
- mkdirSync9(dirname17(path90), { recursive: true });
8295
- writeFileSync19(path90, JSON.stringify({ ...activity2, startedAt: Date.now() }));
8297
+ const path91 = activityPath(sessionId);
8298
+ mkdirSync9(dirname17(path91), { recursive: true });
8299
+ writeFileSync19(path91, JSON.stringify({ ...activity2, startedAt: Date.now() }));
8296
8300
  }
8297
- function readActivity(path90) {
8301
+ function readActivity(path91) {
8298
8302
  try {
8299
- return JSON.parse(readFileSync18(path90, "utf8"));
8303
+ return JSON.parse(readFileSync18(path91, "utf8"));
8300
8304
  } catch {
8301
8305
  return void 0;
8302
8306
  }
@@ -8306,9 +8310,9 @@ function reconcileActivity(sessionId, activity2) {
8306
8310
  removeActivity(sessionId);
8307
8311
  return;
8308
8312
  }
8309
- const path90 = activityPath(sessionId);
8310
- mkdirSync9(dirname17(path90), { recursive: true });
8311
- writeFileSync19(path90, JSON.stringify(activity2));
8313
+ const path91 = activityPath(sessionId);
8314
+ mkdirSync9(dirname17(path91), { recursive: true });
8315
+ writeFileSync19(path91, JSON.stringify(activity2));
8312
8316
  }
8313
8317
  function removeActivity(sessionId) {
8314
8318
  try {
@@ -9160,15 +9164,15 @@ import chalk52 from "chalk";
9160
9164
  // src/commands/backlog/groupActivityRefs.ts
9161
9165
  var ACTIVITY_COMMIT_LIMIT = 10;
9162
9166
  function groupActivityRefs(refs, commitLimit = ACTIVITY_COMMIT_LIMIT) {
9163
- const newestFirst = (kind) => refs.filter((r) => r.kind === kind).reverse();
9164
- const commits2 = newestFirst("commit");
9167
+ const newestFirst2 = (kind) => refs.filter((r) => r.kind === kind).reverse();
9168
+ const commits2 = newestFirst2("commit");
9165
9169
  return {
9166
- branches: newestFirst("branch"),
9170
+ branches: newestFirst2("branch"),
9167
9171
  commits: commits2.slice(0, commitLimit),
9168
9172
  overflowCommits: commits2.slice(commitLimit),
9169
- prs: newestFirst("pr"),
9170
- slacks: newestFirst("slack"),
9171
- sessions: newestFirst("session")
9173
+ prs: newestFirst2("pr"),
9174
+ slacks: newestFirst2("slack"),
9175
+ sessions: newestFirst2("session")
9172
9176
  };
9173
9177
  }
9174
9178
 
@@ -9761,10 +9765,10 @@ function getStorePath(filename) {
9761
9765
  return join26(getStoreDir(), filename);
9762
9766
  }
9763
9767
  function loadJson(filename) {
9764
- const path90 = getStorePath(filename);
9765
- if (existsSync29(path90)) {
9768
+ const path91 = getStorePath(filename);
9769
+ if (existsSync29(path91)) {
9766
9770
  try {
9767
- return JSON.parse(readFileSync19(path90, "utf8"));
9771
+ return JSON.parse(readFileSync19(path91, "utf8"));
9768
9772
  } catch {
9769
9773
  return {};
9770
9774
  }
@@ -9783,22 +9787,22 @@ function saveJson(filename, data) {
9783
9787
  var REGISTRY_FILE = "worktrees.json";
9784
9788
  function readWorktreeRegistry() {
9785
9789
  const data = loadJson(REGISTRY_FILE);
9786
- return Object.entries(data).filter(([, record]) => !record.reaped).map(([path90, record]) => ({ path: path90, ...record }));
9790
+ return Object.entries(data).filter(([, record]) => !record.reaped).map(([path91, record]) => ({ path: path91, ...record }));
9787
9791
  }
9788
- function worktreeAttributionIncludingReaped(path90) {
9789
- const record = loadJson(REGISTRY_FILE)[path90];
9792
+ function worktreeAttributionIncludingReaped(path91) {
9793
+ const record = loadJson(REGISTRY_FILE)[path91];
9790
9794
  return record ? { clone: record.clone, origin: record.origin } : void 0;
9791
9795
  }
9792
- function recordWorktree(path90, clone, origin) {
9796
+ function recordWorktree(path91, clone, origin) {
9793
9797
  const data = loadJson(REGISTRY_FILE);
9794
- data[path90] = { clone, origin };
9798
+ data[path91] = { clone, origin };
9795
9799
  saveJson(REGISTRY_FILE, data);
9796
9800
  }
9797
- function forgetWorktree(path90) {
9801
+ function forgetWorktree(path91) {
9798
9802
  const data = loadJson(REGISTRY_FILE);
9799
- const record = data[path90];
9803
+ const record = data[path91];
9800
9804
  if (!record || record.reaped) return;
9801
- data[path90] = { ...record, reaped: true };
9805
+ data[path91] = { ...record, reaped: true };
9802
9806
  saveJson(REGISTRY_FILE, data);
9803
9807
  }
9804
9808
 
@@ -10064,6 +10068,78 @@ async function updateStarred(orm, id, starred) {
10064
10068
  return row?.name;
10065
10069
  }
10066
10070
 
10071
+ // src/commands/sessions/shared/lookupSessionsById.ts
10072
+ import * as path30 from "path";
10073
+ var CODEX_ROLLOUT_ID_LENGTH = 36;
10074
+ async function lookupSessionsById(ids) {
10075
+ const wanted = new Set(ids);
10076
+ if (wanted.size === 0) return /* @__PURE__ */ new Map();
10077
+ const found = /* @__PURE__ */ new Map();
10078
+ const [claudePaths, codexPaths] = await Promise.all([
10079
+ discoverSessionJsonlPaths(),
10080
+ discoverCodexRolloutPaths()
10081
+ ]);
10082
+ await Promise.all([
10083
+ ...claudePaths.map(async ({ path: filePath, origin }) => {
10084
+ const id = path30.basename(filePath, ".jsonl");
10085
+ if (!wanted.has(id)) return;
10086
+ const session = await parseSessionFile(filePath, origin);
10087
+ if (session) found.set(id, session);
10088
+ }),
10089
+ ...codexPaths.map(async (filePath) => {
10090
+ const id = codexRolloutIdFromFilename(filePath);
10091
+ if (!id || !wanted.has(id)) return;
10092
+ const session = await parseCodexSessionFile(filePath);
10093
+ if (session) found.set(id, session);
10094
+ })
10095
+ ]);
10096
+ return found;
10097
+ }
10098
+ function codexRolloutIdFromFilename(filePath) {
10099
+ const name = path30.basename(filePath, ".jsonl");
10100
+ return name.length > CODEX_ROLLOUT_ID_LENGTH ? name.slice(-CODEX_ROLLOUT_ID_LENGTH) : void 0;
10101
+ }
10102
+
10103
+ // src/commands/backlog/web/itemConversations.ts
10104
+ async function itemConversations(item) {
10105
+ const byId = /* @__PURE__ */ new Map();
10106
+ for (const ref of item.gitRefs ?? []) {
10107
+ if (ref.kind !== "session" || byId.has(ref.ref)) continue;
10108
+ byId.set(ref.ref, {
10109
+ sessionId: ref.ref,
10110
+ ...ref.title && { title: ref.title },
10111
+ ...ref.createdAt && { createdAt: ref.createdAt }
10112
+ });
10113
+ }
10114
+ for (const session of item.phaseSessions ?? []) {
10115
+ const { claudeSessionId: sessionId, createdAt } = session;
10116
+ if (byId.has(sessionId)) continue;
10117
+ byId.set(sessionId, { sessionId, ...createdAt && { createdAt } });
10118
+ }
10119
+ if (byId.size === 0) return [];
10120
+ const transcripts = await lookupSessionsById([...byId.keys()]);
10121
+ return [...byId.values()].map(
10122
+ (conversation) => withTranscript(conversation, transcripts.get(conversation.sessionId))
10123
+ ).sort(newestFirst);
10124
+ }
10125
+ function withTranscript(conversation, transcript) {
10126
+ if (!transcript) return conversation;
10127
+ return {
10128
+ ...conversation,
10129
+ ...transcript.cwd && { cwd: transcript.cwd },
10130
+ ...transcript.harness && { harness: transcript.harness },
10131
+ title: conversation.title ?? transcript.name,
10132
+ createdAt: conversation.createdAt ?? transcript.timestamp
10133
+ };
10134
+ }
10135
+ function sortKey(conversation) {
10136
+ const parsed = Date.parse(conversation.createdAt ?? "");
10137
+ return Number.isNaN(parsed) ? 0 : parsed;
10138
+ }
10139
+ function newestFirst(a, b) {
10140
+ return sortKey(b) - sortKey(a);
10141
+ }
10142
+
10067
10143
  // src/commands/backlog/loadBacklogSummaries.ts
10068
10144
  async function loadBacklogSummaries(allRepos = false) {
10069
10145
  const { orm } = await getReady();
@@ -10148,7 +10224,11 @@ async function findItemOr404(res, id) {
10148
10224
  }
10149
10225
  async function getItemById(res, id) {
10150
10226
  const result = await findItemOr404(res, id);
10151
- if (result) respondJson(res, 200, withReviewPhase(result.item));
10227
+ if (!result) return;
10228
+ const item = withReviewPhase(result.item);
10229
+ const conversations = await itemConversations(item);
10230
+ if (conversations.length > 0) item.conversations = conversations;
10231
+ respondJson(res, 200, item);
10152
10232
  }
10153
10233
  async function deleteItem2(res, id) {
10154
10234
  const result = await findItemOr404(res, id);
@@ -10550,8 +10630,8 @@ async function loadCommittedPaths(cwd, sessionId) {
10550
10630
  for (const commit2 of commits2) {
10551
10631
  const resolved = await resolveCommit(cwd, commit2.sha);
10552
10632
  if (!resolved) continue;
10553
- for (const path90 of resolved.paths) {
10554
- if (!bases.has(path90)) bases.set(path90, resolved.base);
10633
+ for (const path91 of resolved.paths) {
10634
+ if (!bases.has(path91)) bases.set(path91, resolved.base);
10555
10635
  }
10556
10636
  }
10557
10637
  return { commits: commits2, bases };
@@ -10569,16 +10649,16 @@ async function itemChangeSet(cwd, sessionId) {
10569
10649
  }
10570
10650
  function groupByBase(bases) {
10571
10651
  const groups = /* @__PURE__ */ new Map();
10572
- for (const [path90, base] of bases) {
10652
+ for (const [path91, base] of bases) {
10573
10653
  const paths = groups.get(base);
10574
- if (paths) paths.push(path90);
10575
- else groups.set(base, [path90]);
10654
+ if (paths) paths.push(path91);
10655
+ else groups.set(base, [path91]);
10576
10656
  }
10577
10657
  return [...groups].map(([base, paths]) => ({ base, paths: paths.sort() }));
10578
10658
  }
10579
10659
  async function dirtyPaths(cwd, bases) {
10580
10660
  const output = await execGit(cwd, ["diff", "--name-only", "HEAD"]);
10581
- return output.split("\n").filter((path90) => path90 && !bases.has(path90)).sort();
10661
+ return output.split("\n").filter((path91) => path91 && !bases.has(path91)).sort();
10582
10662
  }
10583
10663
 
10584
10664
  // src/commands/sessions/web/scopedDiff.ts
@@ -10587,8 +10667,8 @@ async function scopedDiff(cwd, session, scope) {
10587
10667
  if (scope.kind === "commit") return commitDiff(cwd, scope.sha);
10588
10668
  return await trackedScopeDiff(cwd, session, scope) + await untrackedDiff(cwd);
10589
10669
  }
10590
- async function untrackedFileDiff(cwd, path90) {
10591
- return execGit(cwd, ["diff", "--no-index", "--", "/dev/null", path90], {
10670
+ async function untrackedFileDiff(cwd, path91) {
10671
+ return execGit(cwd, ["diff", "--no-index", "--", "/dev/null", path91], {
10592
10672
  maxBuffer: MAX_DIFF_BYTES,
10593
10673
  allowFailure: true
10594
10674
  });
@@ -10601,7 +10681,7 @@ async function untrackedDiff(cwd) {
10601
10681
  ]);
10602
10682
  const paths = list5.split("\n").filter(Boolean);
10603
10683
  const diffs = await Promise.all(
10604
- paths.map((path90) => untrackedFileDiff(cwd, path90))
10684
+ paths.map((path91) => untrackedFileDiff(cwd, path91))
10605
10685
  );
10606
10686
  return diffs.join("");
10607
10687
  }
@@ -10694,9 +10774,9 @@ import { isAbsolute as isAbsolute2, relative as relative2, resolve as resolve10
10694
10774
  function repoRoot(cwd) {
10695
10775
  return resolve10(toGitCwd(cwd));
10696
10776
  }
10697
- function resolveWithinCwd(cwd, path90) {
10777
+ function resolveWithinCwd(cwd, path91) {
10698
10778
  const root = repoRoot(cwd);
10699
- const target = resolve10(root, path90);
10779
+ const target = resolve10(root, path91);
10700
10780
  const rel = relative2(root, target);
10701
10781
  if (rel === "" || rel.startsWith("..") || isAbsolute2(rel)) return null;
10702
10782
  return target;
@@ -10706,14 +10786,14 @@ function resolveWithinCwd(cwd, path90) {
10706
10786
  function getFileTarget(req, res) {
10707
10787
  const cwd = getCwdParam(req, res);
10708
10788
  if (!cwd) return null;
10709
- const path90 = new URL(req.url ?? "/", "http://localhost").searchParams.get(
10789
+ const path91 = new URL(req.url ?? "/", "http://localhost").searchParams.get(
10710
10790
  "path"
10711
10791
  );
10712
- if (!path90) {
10792
+ if (!path91) {
10713
10793
  respondJson(res, 400, { error: "Missing path" });
10714
10794
  return null;
10715
10795
  }
10716
- const target = resolveWithinCwd(cwd, path90);
10796
+ const target = resolveWithinCwd(cwd, path91);
10717
10797
  if (!target) {
10718
10798
  respondJson(res, 400, { error: "Path outside cwd" });
10719
10799
  return null;
@@ -10788,11 +10868,11 @@ function globalConfigTargetFor(cwd) {
10788
10868
 
10789
10869
  // src/commands/config/globalConfigFileLabel.ts
10790
10870
  var WINDOWS_MOUNT_PREFIX = "/mnt/";
10791
- function globalConfigFileLabel(path90) {
10792
- if (path90 === getGlobalConfigPath()) return "~/.assist.yml";
10793
- if (path90.startsWith(WINDOWS_MOUNT_PREFIX))
10794
- return `${path90} on the Windows host`;
10795
- return path90;
10871
+ function globalConfigFileLabel(path91) {
10872
+ if (path91 === getGlobalConfigPath()) return "~/.assist.yml";
10873
+ if (path91.startsWith(WINDOWS_MOUNT_PREFIX))
10874
+ return `${path91} on the Windows host`;
10875
+ return path91;
10796
10876
  }
10797
10877
 
10798
10878
  // src/commands/config/readRawConfigLayers.ts
@@ -10849,35 +10929,35 @@ function isPlainRecord(value) {
10849
10929
  }
10850
10930
 
10851
10931
  // src/shared/mapConfigSecrets.ts
10852
- function mapChildren(value, path90, childNode, map) {
10932
+ function mapChildren(value, path91, childNode, map) {
10853
10933
  if (!isPlainRecord(value)) return value;
10854
10934
  return Object.fromEntries(
10855
10935
  Object.entries(value).map(([name, child]) => [
10856
10936
  name,
10857
- walk(child, [...path90, name], childNode(name), map)
10937
+ walk(child, [...path91, name], childNode(name), map)
10858
10938
  ])
10859
10939
  );
10860
10940
  }
10861
- function mapItems(value, path90, item, map) {
10941
+ function mapItems(value, path91, item, map) {
10862
10942
  if (!Array.isArray(value)) return value;
10863
- return value.map((entry, index3) => walk(entry, [...path90, index3], item, map));
10943
+ return value.map((entry, index3) => walk(entry, [...path91, index3], item, map));
10864
10944
  }
10865
- function walk(value, path90, node, map) {
10945
+ function walk(value, path91, node, map) {
10866
10946
  if (!node || value === void 0 || value === null) return value;
10867
- if (node.secret) return map(value, path90);
10947
+ if (node.secret) return map(value, path91);
10868
10948
  switch (node.kind) {
10869
10949
  case "object":
10870
10950
  case "unionOfObjects":
10871
10951
  return mapChildren(
10872
10952
  value,
10873
- path90,
10953
+ path91,
10874
10954
  (name) => configNodeField(node, name),
10875
10955
  map
10876
10956
  );
10877
10957
  case "objectList":
10878
- return mapItems(value, path90, node.item, map);
10958
+ return mapItems(value, path91, node.item, map);
10879
10959
  case "record":
10880
- return mapChildren(value, path90, () => node.value, map);
10960
+ return mapChildren(value, path91, () => node.value, map);
10881
10961
  default:
10882
10962
  return value;
10883
10963
  }
@@ -10902,9 +10982,9 @@ function isTraversable(value) {
10902
10982
  function stepInto(current, key) {
10903
10983
  return isTraversable(current) ? current[key] : void 0;
10904
10984
  }
10905
- function getNestedValue(obj, path90) {
10985
+ function getNestedValue(obj, path91) {
10906
10986
  let current = obj;
10907
- for (const key of path90.split(".")) current = stepInto(current, key);
10987
+ for (const key of path91.split(".")) current = stepInto(current, key);
10908
10988
  return current;
10909
10989
  }
10910
10990
 
@@ -10954,9 +11034,9 @@ function step(node, segment) {
10954
11034
  return void 0;
10955
11035
  }
10956
11036
  }
10957
- function findConfigNode(root, path90) {
11037
+ function findConfigNode(root, path91) {
10958
11038
  let current = root;
10959
- for (const segment of path90) {
11039
+ for (const segment of path91) {
10960
11040
  if (!current) return void 0;
10961
11041
  current = step(current, segment);
10962
11042
  }
@@ -10973,34 +11053,34 @@ function nameSegment(name) {
10973
11053
  return name === RECORD_ENTRY_TOKEN ? { kind: "entry" } : { kind: "key", name };
10974
11054
  }
10975
11055
  function parseConfigPath(text18) {
10976
- const path90 = [];
11056
+ const path91 = [];
10977
11057
  let at2 = 0;
10978
11058
  while (at2 < text18.length) {
10979
11059
  if (text18[at2] === "[") {
10980
11060
  const close = text18.indexOf("]", at2);
10981
11061
  const segment = close === -1 ? void 0 : bracketSegment(text18.slice(at2 + 1, close));
10982
11062
  if (!segment) return void 0;
10983
- path90.push(segment);
11063
+ path91.push(segment);
10984
11064
  at2 = close + 1;
10985
11065
  continue;
10986
11066
  }
10987
11067
  if (text18[at2] === ".") {
10988
- if (path90.length === 0) return void 0;
11068
+ if (path91.length === 0) return void 0;
10989
11069
  at2 += 1;
10990
11070
  }
10991
11071
  const start3 = at2;
10992
11072
  while (at2 < text18.length && text18[at2] !== "." && text18[at2] !== "[") at2 += 1;
10993
11073
  const name = text18.slice(start3, at2);
10994
11074
  if (!name) return void 0;
10995
- path90.push(nameSegment(name));
11075
+ path91.push(nameSegment(name));
10996
11076
  }
10997
- return path90;
11077
+ return path91;
10998
11078
  }
10999
11079
 
11000
11080
  // src/commands/config/configEntryNode.ts
11001
11081
  function configEntryNode(root, key) {
11002
- const path90 = parseConfigPath(key);
11003
- return path90 ? findConfigNode(root, path90) : void 0;
11082
+ const path91 = parseConfigPath(key);
11083
+ return path91 ? findConfigNode(root, path91) : void 0;
11004
11084
  }
11005
11085
 
11006
11086
  // src/commands/config/configHelpForKey.ts
@@ -11124,18 +11204,18 @@ function handleServerRuns(req, res) {
11124
11204
  import { execFile as execFile4 } from "child_process";
11125
11205
  import { readFileSync as readFileSync21 } from "fs";
11126
11206
  import { homedir as homedir13 } from "os";
11127
- import { basename as basename9, join as join30 } from "path";
11207
+ import { basename as basename10, join as join30 } from "path";
11128
11208
  import { promisify as promisify3 } from "util";
11129
11209
 
11130
11210
  // src/commands/sessions/web/findSynthesisForBranch.ts
11131
11211
  import { existsSync as existsSync32, readdirSync as readdirSync2, statSync as statSync4 } from "fs";
11132
- import { basename as basename8, dirname as dirname21, join as join29 } from "path";
11212
+ import { basename as basename9, dirname as dirname21, join as join29 } from "path";
11133
11213
  function findSynthesisForBranch(repoReviewsDir, branch2) {
11134
11214
  const branchKeyPath = join29(repoReviewsDir, `${branch2}-`);
11135
11215
  const parent = dirname21(branchKeyPath);
11136
- const branchPrefix = basename8(branchKeyPath);
11216
+ const branchPrefix = basename9(branchKeyPath);
11137
11217
  if (!existsSync32(parent)) return null;
11138
- const synthesisFiles = readdirSync2(parent).filter((name) => name.startsWith(branchPrefix)).map((name) => join29(parent, name, "synthesis.md")).filter((path90) => existsSync32(path90)).map((path90) => ({ path: path90, mtime: statSync4(path90).mtimeMs })).sort((a, b) => b.mtime - a.mtime);
11218
+ const synthesisFiles = readdirSync2(parent).filter((name) => name.startsWith(branchPrefix)).map((name) => join29(parent, name, "synthesis.md")).filter((path91) => existsSync32(path91)).map((path91) => ({ path: path91, mtime: statSync4(path91).mtimeMs })).sort((a, b) => b.mtime - a.mtime);
11139
11219
  return synthesisFiles[0]?.path ?? null;
11140
11220
  }
11141
11221
 
@@ -11157,7 +11237,7 @@ async function resolveSynthesisPath(cwd) {
11157
11237
  homedir13(),
11158
11238
  ".assist",
11159
11239
  "reviews",
11160
- basename9(repoRoot2)
11240
+ basename10(repoRoot2)
11161
11241
  );
11162
11242
  return findSynthesisForBranch(repoReviewsDir, branch2);
11163
11243
  }
@@ -11165,12 +11245,12 @@ async function getReviewSynthesis(req, res) {
11165
11245
  const cwd = getCwdParam(req, res);
11166
11246
  if (!cwd) return;
11167
11247
  try {
11168
- const path90 = await resolveSynthesisPath(cwd);
11169
- if (!path90) {
11248
+ const path91 = await resolveSynthesisPath(cwd);
11249
+ if (!path91) {
11170
11250
  respondJson(res, 404, { error: "No synthesis found" });
11171
11251
  return;
11172
11252
  }
11173
- respondJson(res, 200, { synthesis: readFileSync21(path90, "utf8") });
11253
+ respondJson(res, 200, { synthesis: readFileSync21(path91, "utf8") });
11174
11254
  } catch {
11175
11255
  respondJson(res, 404, { error: "No synthesis found" });
11176
11256
  }
@@ -11253,8 +11333,8 @@ function parseDiffNameStatus(output) {
11253
11333
  if (!status3 || fields.length < 2) continue;
11254
11334
  const category = categorize(status3[0]);
11255
11335
  if (!category) continue;
11256
- const path90 = fields[fields.length - 1];
11257
- if (path90) result[category].push(path90);
11336
+ const path91 = fields[fields.length - 1];
11337
+ if (path91) result[category].push(path91);
11258
11338
  }
11259
11339
  return result;
11260
11340
  }
@@ -11390,21 +11470,21 @@ function subsequenceScore(text18, query) {
11390
11470
  }
11391
11471
  return score - Math.min(text18.length, MAX_LENGTH_PENALTY);
11392
11472
  }
11393
- function scoreFilePath(path90, query) {
11473
+ function scoreFilePath(path91, query) {
11394
11474
  const needle = query.trim().toLowerCase();
11395
11475
  if (!needle) return 0;
11396
- const basename27 = path90.slice(path90.lastIndexOf("/") + 1);
11397
- const inBasename = subsequenceScore(basename27, needle);
11476
+ const basename28 = path91.slice(path91.lastIndexOf("/") + 1);
11477
+ const inBasename = subsequenceScore(basename28, needle);
11398
11478
  if (inBasename !== null) return BASENAME_WEIGHT + inBasename;
11399
- return subsequenceScore(path90, needle);
11479
+ return subsequenceScore(path91, needle);
11400
11480
  }
11401
11481
 
11402
11482
  // src/commands/sessions/web/rankFilePaths.ts
11403
11483
  function rankFilePaths(paths, query, limit) {
11404
11484
  const scored = [];
11405
- for (const path90 of paths) {
11406
- const score = scoreFilePath(path90, query);
11407
- if (score !== null) scored.push({ path: path90, score });
11485
+ for (const path91 of paths) {
11486
+ const score = scoreFilePath(path91, query);
11487
+ if (score !== null) scored.push({ path: path91, score });
11408
11488
  }
11409
11489
  scored.sort((a, b) => b.score - a.score || a.path.localeCompare(b.path));
11410
11490
  return scored.slice(0, limit).map((entry) => entry.path);
@@ -11563,11 +11643,11 @@ async function listNewsItems(_req, res) {
11563
11643
  }
11564
11644
 
11565
11645
  // src/commands/sessions/web/listScopedRules.ts
11566
- import path32 from "path";
11646
+ import path33 from "path";
11567
11647
 
11568
11648
  // src/commands/rules/readScopedRules.ts
11569
11649
  import { existsSync as existsSync34, readFileSync as readFileSync22 } from "fs";
11570
- import path31 from "path";
11650
+ import path32 from "path";
11571
11651
 
11572
11652
  // src/commands/rules/rulesSectionRange.ts
11573
11653
  var RULES_HEADING = /^##\s+rules\s*$/i;
@@ -11616,10 +11696,10 @@ function parseRulesSection(content) {
11616
11696
 
11617
11697
  // src/commands/rules/scopeDirectory.ts
11618
11698
  import { existsSync as existsSync33, statSync as statSync5 } from "fs";
11619
- import path30 from "path";
11699
+ import path31 from "path";
11620
11700
  function scopeDirectory(target) {
11621
- const resolved = path30.resolve(target);
11622
- return existsSync33(resolved) && statSync5(resolved).isDirectory() ? resolved : path30.dirname(resolved);
11701
+ const resolved = path31.resolve(target);
11702
+ return existsSync33(resolved) && statSync5(resolved).isDirectory() ? resolved : path31.dirname(resolved);
11623
11703
  }
11624
11704
 
11625
11705
  // src/commands/rules/readScopedRules.ts
@@ -11629,10 +11709,10 @@ function scopedClaudeFiles(target) {
11629
11709
  const files = [];
11630
11710
  let current = startDir;
11631
11711
  while (true) {
11632
- const candidate = path31.join(current, "CLAUDE.md");
11712
+ const candidate = path32.join(current, "CLAUDE.md");
11633
11713
  if (existsSync34(candidate)) files.push(candidate);
11634
- if (current === root || current === path31.dirname(current)) break;
11635
- current = path31.dirname(current);
11714
+ if (current === root || current === path32.dirname(current)) break;
11715
+ current = path32.dirname(current);
11636
11716
  }
11637
11717
  return files;
11638
11718
  }
@@ -11663,7 +11743,7 @@ function listScopedRules(req, res) {
11663
11743
  respondJson(res, 200, {
11664
11744
  rules: readScopedRules(target).map((rule) => ({
11665
11745
  ...rule,
11666
- source: path32.relative(root, rule.source) || rule.source
11746
+ source: path33.relative(root, rule.source) || rule.source
11667
11747
  }))
11668
11748
  });
11669
11749
  } catch {
@@ -12145,38 +12225,38 @@ async function restartWeb(req, res, deps2 = {}) {
12145
12225
  import { relative as relative3 } from "path";
12146
12226
 
12147
12227
  // src/commands/sessions/web/revertPathChanges.ts
12148
- async function isTracked(cwd, path90) {
12228
+ async function isTracked(cwd, path91) {
12149
12229
  try {
12150
- await execGit(cwd, ["ls-files", "--error-unmatch", "--", path90]);
12230
+ await execGit(cwd, ["ls-files", "--error-unmatch", "--", path91]);
12151
12231
  return true;
12152
12232
  } catch {
12153
12233
  return false;
12154
12234
  }
12155
12235
  }
12156
- async function isInHead(cwd, path90) {
12157
- const listing = await execGit(cwd, ["ls-tree", "HEAD", "--", path90]);
12236
+ async function isInHead(cwd, path91) {
12237
+ const listing = await execGit(cwd, ["ls-tree", "HEAD", "--", path91]);
12158
12238
  return listing.trim().length > 0;
12159
12239
  }
12160
- async function revertPathChanges(cwd, path90) {
12161
- if (!await isTracked(cwd, path90)) {
12162
- await execGit(cwd, ["clean", "-f", "--", path90]);
12240
+ async function revertPathChanges(cwd, path91) {
12241
+ if (!await isTracked(cwd, path91)) {
12242
+ await execGit(cwd, ["clean", "-f", "--", path91]);
12163
12243
  return;
12164
12244
  }
12165
- if (await isInHead(cwd, path90)) {
12166
- await execGit(cwd, ["checkout", "HEAD", "--", path90]);
12245
+ if (await isInHead(cwd, path91)) {
12246
+ await execGit(cwd, ["checkout", "HEAD", "--", path91]);
12167
12247
  return;
12168
12248
  }
12169
- await execGit(cwd, ["rm", "-f", "--", path90]);
12249
+ await execGit(cwd, ["rm", "-f", "--", path91]);
12170
12250
  }
12171
12251
 
12172
12252
  // src/commands/sessions/web/revertDiffFile.ts
12173
12253
  async function revertDiffFile(req, res) {
12174
12254
  const resolved = getFileTarget(req, res);
12175
12255
  if (!resolved) return;
12176
- const path90 = relative3(repoRoot(resolved.cwd), resolved.target);
12256
+ const path91 = relative3(repoRoot(resolved.cwd), resolved.target);
12177
12257
  try {
12178
- await revertPathChanges(resolved.cwd, path90);
12179
- respondJson(res, 200, { reverted: path90 });
12258
+ await revertPathChanges(resolved.cwd, path91);
12259
+ respondJson(res, 200, { reverted: path91 });
12180
12260
  } catch (error) {
12181
12261
  respondJson(res, 500, {
12182
12262
  error: error instanceof Error ? error.message : "Failed to revert file"
@@ -12198,7 +12278,7 @@ async function readJsonBody(req) {
12198
12278
  function requestedPaths(body) {
12199
12279
  const paths = body.paths;
12200
12280
  if (!Array.isArray(paths)) return null;
12201
- if (paths.some((path90) => typeof path90 !== "string")) return null;
12281
+ if (paths.some((path91) => typeof path91 !== "string")) return null;
12202
12282
  return paths;
12203
12283
  }
12204
12284
  async function revertDiffPaths(req, res) {
@@ -12218,10 +12298,10 @@ async function revertDiffPaths(req, res) {
12218
12298
  const root = repoRoot(cwd);
12219
12299
  const reverted = [];
12220
12300
  const failed2 = [];
12221
- for (const path90 of paths) {
12222
- const target = resolveWithinCwd(cwd, path90);
12301
+ for (const path91 of paths) {
12302
+ const target = resolveWithinCwd(cwd, path91);
12223
12303
  if (!target) {
12224
- failed2.push({ path: path90, error: "Path outside cwd" });
12304
+ failed2.push({ path: path91, error: "Path outside cwd" });
12225
12305
  continue;
12226
12306
  }
12227
12307
  const relativePath = relative4(root, target);
@@ -12311,11 +12391,11 @@ function coerceStructuredConfigValue(key, raw) {
12311
12391
  };
12312
12392
  }
12313
12393
  function formatIssue(key, issue) {
12314
- const path90 = formatConfigPath([
12394
+ const path91 = formatConfigPath([
12315
12395
  { kind: "key", name: key },
12316
12396
  ...issue.path.map(toSegment)
12317
12397
  ]);
12318
- return `${path90}: ${issue.message}`;
12398
+ return `${path91}: ${issue.message}`;
12319
12399
  }
12320
12400
  function toSegment(part) {
12321
12401
  return typeof part === "number" ? { kind: "index", index: part } : { kind: "key", name: String(part) };
@@ -12410,9 +12490,9 @@ function coerceUnion(key, raw, types) {
12410
12490
  }
12411
12491
 
12412
12492
  // src/shared/valueAtConfigPath.ts
12413
- function valueAtConfigPath(value, path90) {
12493
+ function valueAtConfigPath(value, path91) {
12414
12494
  let current = value;
12415
- for (const key of path90) {
12495
+ for (const key of path91) {
12416
12496
  if (typeof key === "number") {
12417
12497
  if (!Array.isArray(current)) return void 0;
12418
12498
  current = current[key];
@@ -12429,7 +12509,7 @@ function restoreConfigSecrets(value, stored, node) {
12429
12509
  return mapConfigSecrets(
12430
12510
  value,
12431
12511
  node,
12432
- (secret, path90) => isRedactedSecret(secret) ? valueAtConfigPath(stored, path90) : secret
12512
+ (secret, path91) => isRedactedSecret(secret) ? valueAtConfigPath(stored, path91) : secret
12433
12513
  );
12434
12514
  }
12435
12515
 
@@ -12478,8 +12558,8 @@ function stepIntoNested(container, key, nextKey) {
12478
12558
  }
12479
12559
  return ensureObject(container, resolved);
12480
12560
  }
12481
- function setNestedValue(obj, path90, value) {
12482
- const keys = path90.split(".");
12561
+ function setNestedValue(obj, path91, value) {
12562
+ const keys = path91.split(".");
12483
12563
  const result = { ...obj };
12484
12564
  let current = result;
12485
12565
  for (let i = 0; i < keys.length - 1; i++) {
@@ -12506,8 +12586,8 @@ function formatIssue2(issue, key) {
12506
12586
  return issue.keys.map(
12507
12587
  (unrecognized) => `${[...issue.path, unrecognized].join(".")}: Unrecognized key`
12508
12588
  );
12509
- const path90 = issue.path.length > 0 ? issue.path.join(".") : key;
12510
- return [`${path90}: ${issue.message}`];
12589
+ const path91 = issue.path.length > 0 ? issue.path.join(".") : key;
12590
+ return [`${path91}: ${issue.message}`];
12511
12591
  }
12512
12592
 
12513
12593
  // src/commands/config/applyConfigSet.ts
@@ -12764,8 +12844,8 @@ function removeAt(container, keys) {
12764
12844
  }
12765
12845
  return removeFromChild(container, key, rest);
12766
12846
  }
12767
- function unsetNestedValue(obj, path90) {
12768
- const { container, removed } = removeAt(obj, path90.split("."));
12847
+ function unsetNestedValue(obj, path91) {
12848
+ const { container, removed } = removeAt(obj, path91.split("."));
12769
12849
  return { config: container, removed };
12770
12850
  }
12771
12851
 
@@ -13549,7 +13629,7 @@ import chalk63 from "chalk";
13549
13629
 
13550
13630
  // src/commands/sessions/shared/resolveSessionTranscript.ts
13551
13631
  import * as fs22 from "fs";
13552
- import * as path34 from "path";
13632
+ import * as path35 from "path";
13553
13633
 
13554
13634
  // src/commands/sessions/summarise/readTranscriptHead.ts
13555
13635
  import * as fs21 from "fs";
@@ -13570,9 +13650,9 @@ function readTranscriptHead(filePath, maxBytes = 65536) {
13570
13650
 
13571
13651
  // src/commands/sessions/shared/claudeProjectsRoot.ts
13572
13652
  import * as os4 from "os";
13573
- import * as path33 from "path";
13653
+ import * as path34 from "path";
13574
13654
  function claudeProjectsRoot() {
13575
- return path33.join(os4.homedir(), ".claude", "projects");
13655
+ return path34.join(os4.homedir(), ".claude", "projects");
13576
13656
  }
13577
13657
  function projectSlug(cwd) {
13578
13658
  return cwd.replace(/[^a-zA-Z0-9]/g, "-");
@@ -13595,7 +13675,7 @@ function findTranscriptFile(sessionId, projectsRoot) {
13595
13675
  return void 0;
13596
13676
  }
13597
13677
  for (const dir of projectDirs) {
13598
- const candidate = path34.join(projectsRoot, dir, `${sessionId}.jsonl`);
13678
+ const candidate = path35.join(projectsRoot, dir, `${sessionId}.jsonl`);
13599
13679
  if (fs22.existsSync(candidate)) return candidate;
13600
13680
  }
13601
13681
  return void 0;
@@ -13647,12 +13727,12 @@ import chalk64 from "chalk";
13647
13727
 
13648
13728
  // src/commands/sessions/shared/resolveCurrentSessionId.ts
13649
13729
  import * as fs23 from "fs";
13650
- import * as path35 from "path";
13730
+ import * as path36 from "path";
13651
13731
  var SESSION_ID_ENV = "CLAUDE_CODE_SESSION_ID";
13652
13732
  function resolveCurrentSessionId(options2 = {}) {
13653
13733
  const fromEnv = (options2.env ?? process.env)[SESSION_ID_ENV];
13654
13734
  if (fromEnv) return fromEnv;
13655
- const dir = path35.join(
13735
+ const dir = path36.join(
13656
13736
  options2.projectsRoot ?? claudeProjectsRoot(),
13657
13737
  projectSlug(options2.cwd ?? process.cwd())
13658
13738
  );
@@ -13668,10 +13748,10 @@ function newestTranscriptId(dir) {
13668
13748
  let newest;
13669
13749
  for (const entry of entries) {
13670
13750
  if (!entry.endsWith(".jsonl")) continue;
13671
- const modifiedAt = modifiedAtOf(path35.join(dir, entry));
13751
+ const modifiedAt = modifiedAtOf(path36.join(dir, entry));
13672
13752
  if (modifiedAt === void 0) continue;
13673
13753
  if (!newest || modifiedAt > newest.modifiedAt)
13674
- newest = { id: path35.basename(entry, ".jsonl"), modifiedAt };
13754
+ newest = { id: path36.basename(entry, ".jsonl"), modifiedAt };
13675
13755
  }
13676
13756
  return newest?.id;
13677
13757
  }
@@ -13908,9 +13988,9 @@ function originToSshUrl(origin) {
13908
13988
  const firstSlash = origin.indexOf("/");
13909
13989
  if (firstSlash <= 0) return null;
13910
13990
  const host = origin.slice(0, firstSlash);
13911
- const path90 = origin.slice(firstSlash + 1);
13912
- if (!path90) return null;
13913
- return `git@${host}:${path90}.git`;
13991
+ const path91 = origin.slice(firstSlash + 1);
13992
+ if (!path91) return null;
13993
+ return `git@${host}:${path91}.git`;
13914
13994
  }
13915
13995
 
13916
13996
  // src/commands/backlog/cloneRepo.ts
@@ -16538,7 +16618,7 @@ function registerBranch(program2) {
16538
16618
  }
16539
16619
 
16540
16620
  // src/commands/cliHook/index.ts
16541
- import { basename as basename11 } from "path";
16621
+ import { basename as basename12 } from "path";
16542
16622
 
16543
16623
  // src/shared/splitCompound.ts
16544
16624
  import { parse } from "shell-quote";
@@ -16935,13 +17015,13 @@ function findBuiltinDenyRaw(rawCommand) {
16935
17015
 
16936
17016
  // src/commands/cliHook/findRestrictedPathDeny.ts
16937
17017
  var RESTRICTED_PATHS = [".assist/restricted"];
16938
- function restrictedPathRegex(path90) {
16939
- const pattern2 = path90.split("/").map((segment) => segment.replace(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`)).join(String.raw`[/\\]`);
17018
+ function restrictedPathRegex(path91) {
17019
+ const pattern2 = path91.split("/").map((segment) => segment.replace(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`)).join(String.raw`[/\\]`);
16940
17020
  return new RegExp(pattern2);
16941
17021
  }
16942
- var RESTRICTED_PATH_RULES = RESTRICTED_PATHS.map((path90) => ({
16943
- path: path90,
16944
- regex: restrictedPathRegex(path90)
17022
+ var RESTRICTED_PATH_RULES = RESTRICTED_PATHS.map((path91) => ({
17023
+ path: path91,
17024
+ regex: restrictedPathRegex(path91)
16945
17025
  }));
16946
17026
  function findRestrictedPathDenyRaw(rawCommand) {
16947
17027
  const rule = RESTRICTED_PATH_RULES.find(
@@ -17090,9 +17170,9 @@ var __dirname4 = dirname23(__filename3);
17090
17170
  function packageRoot() {
17091
17171
  return __dirname4;
17092
17172
  }
17093
- function readLines(path90) {
17094
- if (!existsSync38(path90)) return [];
17095
- return readFileSync26(path90, "utf8").split("\n").filter((line) => line.trim() !== "");
17173
+ function readLines(path91) {
17174
+ if (!existsSync38(path91)) return [];
17175
+ return readFileSync26(path91, "utf8").split("\n").filter((line) => line.trim() !== "");
17096
17176
  }
17097
17177
  var cachedReads;
17098
17178
  var cachedWrites;
@@ -17455,7 +17535,7 @@ async function cliHook() {
17455
17535
  logDeniedToolCall({
17456
17536
  tool: input.toolName,
17457
17537
  command: input.command,
17458
- repo: basename11(process.cwd()),
17538
+ repo: basename12(process.cwd()),
17459
17539
  sessionId: process.env.CLAUDE_SESSION_ID,
17460
17540
  denyReason: decision.permissionDecisionReason
17461
17541
  });
@@ -17616,14 +17696,14 @@ function showProgress(p, label2) {
17616
17696
  const pct = Math.round(p.done / p.total * 100);
17617
17697
  process.stderr.write(`\r\x1B[K[${pct}%] Scanning ${label2}...`);
17618
17698
  }
17619
- async function resolveCommand(cli, path90, description, depth, p) {
17620
- showProgress(p, path90.join(" "));
17621
- const subHelp = await runHelp([cli, ...path90]);
17699
+ async function resolveCommand(cli, path91, description, depth, p) {
17700
+ showProgress(p, path91.join(" "));
17701
+ const subHelp = await runHelp([cli, ...path91]);
17622
17702
  if (!subHelp || !hasSubcommands(subHelp)) {
17623
- return [{ path: path90, description }];
17703
+ return [{ path: path91, description }];
17624
17704
  }
17625
- const children = await discoverAt(cli, path90, depth + 1, p);
17626
- return children.length > 0 ? children : [{ path: path90, description }];
17705
+ const children = await discoverAt(cli, path91, depth + 1, p);
17706
+ return children.length > 0 ? children : [{ path: path91, description }];
17627
17707
  }
17628
17708
  async function discoverAt(cli, parentPath, depth, p) {
17629
17709
  if (depth > SAFETY_DEPTH) return [];
@@ -17771,9 +17851,9 @@ function logPath(cli) {
17771
17851
  return join39(homedir17(), ".assist", `cli-discover-${safeName}.log`);
17772
17852
  }
17773
17853
  function readCache(cli) {
17774
- const path90 = logPath(cli);
17775
- if (!existsSync40(path90)) return void 0;
17776
- return readFileSync28(path90, "utf8");
17854
+ const path91 = logPath(cli);
17855
+ if (!existsSync40(path91)) return void 0;
17856
+ return readFileSync28(path91, "utf8");
17777
17857
  }
17778
17858
  function writeCache(cli, output) {
17779
17859
  const dir = join39(homedir17(), ".assist");
@@ -17933,9 +18013,9 @@ function sweepRestrictedDir(dir = getRestrictedDir()) {
17933
18013
  }
17934
18014
  const cutoff = Date.now() - STALE_AFTER_MS;
17935
18015
  for (const entry of entries) {
17936
- const path90 = join41(dir, entry);
18016
+ const path91 = join41(dir, entry);
17937
18017
  try {
17938
- if (statSync7(path90).mtimeMs < cutoff) unlinkSync7(path90);
18018
+ if (statSync7(path91).mtimeMs < cutoff) unlinkSync7(path91);
17939
18019
  } catch {
17940
18020
  continue;
17941
18021
  }
@@ -17945,10 +18025,10 @@ function sweepRestrictedDir(dir = getRestrictedDir()) {
17945
18025
  // src/commands/codeComment/readPinState.ts
17946
18026
  import { existsSync as existsSync41, readFileSync as readFileSync29 } from "fs";
17947
18027
  function readPinState(pin) {
17948
- const path90 = getPinStatePath(pin);
17949
- if (!existsSync41(path90)) return void 0;
18028
+ const path91 = getPinStatePath(pin);
18029
+ if (!existsSync41(path91)) return void 0;
17950
18030
  try {
17951
- const state = JSON.parse(readFileSync29(path90, "utf8"));
18031
+ const state = JSON.parse(readFileSync29(path91, "utf8"));
17952
18032
  if (state.pin !== pin) return void 0;
17953
18033
  return state;
17954
18034
  } catch {
@@ -18280,8 +18360,8 @@ function findUnmergedPaths() {
18280
18360
  }
18281
18361
  const found = /* @__PURE__ */ new Set();
18282
18362
  for (const line of output.split("\n")) {
18283
- const path90 = line.split(" ")[1];
18284
- if (path90) found.add(path90.trim());
18363
+ const path91 = line.split(" ")[1];
18364
+ if (path91) found.add(path91.trim());
18285
18365
  }
18286
18366
  return [...found];
18287
18367
  }
@@ -18603,13 +18683,13 @@ import chalk125 from "chalk";
18603
18683
 
18604
18684
  // src/commands/complexity/shared/index.ts
18605
18685
  import fs25 from "fs";
18606
- import path37 from "path";
18686
+ import path38 from "path";
18607
18687
  import chalk124 from "chalk";
18608
18688
  import ts5 from "typescript";
18609
18689
 
18610
18690
  // src/commands/complexity/findSourceFiles.ts
18611
18691
  import fs24 from "fs";
18612
- import path36 from "path";
18692
+ import path37 from "path";
18613
18693
  import { minimatch as minimatch5 } from "minimatch";
18614
18694
  function applyIgnoreGlobs(files, extraIgnore = []) {
18615
18695
  const { complexity } = loadConfig();
@@ -18623,7 +18703,7 @@ function walk2(dir, results) {
18623
18703
  const extensions = [".ts", ".tsx"];
18624
18704
  const entries = fs24.readdirSync(dir, { withFileTypes: true });
18625
18705
  for (const entry of entries) {
18626
- const fullPath = path36.join(dir, entry.name);
18706
+ const fullPath = path37.join(dir, entry.name);
18627
18707
  if (entry.isDirectory()) {
18628
18708
  if (entry.name !== "node_modules" && entry.name !== ".git") {
18629
18709
  walk2(fullPath, results);
@@ -18845,7 +18925,7 @@ function countSloc(content) {
18845
18925
  function createSourceFromFile(filePath) {
18846
18926
  const content = fs25.readFileSync(filePath, "utf8");
18847
18927
  return ts5.createSourceFile(
18848
- path37.basename(filePath),
18928
+ path38.basename(filePath),
18849
18929
  content,
18850
18930
  ts5.ScriptTarget.Latest,
18851
18931
  true,
@@ -19007,12 +19087,12 @@ function formatResultLine(entry, failing) {
19007
19087
 
19008
19088
  // src/commands/complexity/maintainability/getMaintainabilityGitState.ts
19009
19089
  import { execSync as execSync36 } from "child_process";
19010
- import path38 from "path";
19090
+ import path39 from "path";
19011
19091
  function git3(command) {
19012
19092
  return execSync36(command, { encoding: "utf8" });
19013
19093
  }
19014
19094
  function toAbsolute(root, repoRelative) {
19015
- return path38.resolve(root, repoRelative);
19095
+ return path39.resolve(root, repoRelative);
19016
19096
  }
19017
19097
  function collectShrunkFiles(root) {
19018
19098
  const shrunk = /* @__PURE__ */ new Set();
@@ -19052,7 +19132,7 @@ function getMaintainabilityGitState() {
19052
19132
  }
19053
19133
 
19054
19134
  // src/commands/complexity/maintainability/printMaintainabilityFailure.ts
19055
- import path39 from "path";
19135
+ import path40 from "path";
19056
19136
  import chalk128 from "chalk";
19057
19137
  var extractTemplate = "assist refactor extract <file> <functionName> <destination> --apply";
19058
19138
  function remediationLine(entry) {
@@ -19061,7 +19141,7 @@ function remediationLine(entry) {
19061
19141
  ${chalk128.cyan(extractTemplate)}`;
19062
19142
  }
19063
19143
  function cheatLine(entry, gitState) {
19064
- const shrank = gitState.shrunkFiles.has(path39.resolve(entry.file));
19144
+ const shrank = gitState.shrunkFiles.has(path40.resolve(entry.file));
19065
19145
  if (!shrank || gitState.newFileCreated) return "";
19066
19146
  return `
19067
19147
  ${chalk128.red("\u2717 You shrank existing lines in this file without creating a new file. That cannot clear the gate \u2014 extract a responsibility to a new file.")}`;
@@ -19506,11 +19586,11 @@ async function loadPath(source) {
19506
19586
  }
19507
19587
  }
19508
19588
  async function criteriaExtension() {
19509
- const path90 = await loadPath(criteriaExtensionDir());
19589
+ const path91 = await loadPath(criteriaExtensionDir());
19510
19590
  console.log(
19511
19591
  chalk139.bold("acceptance criteria outliner \u2014 GitHub browser extension")
19512
19592
  );
19513
- console.log(chalk139.dim(`load the unpacked extension from ${path90}`));
19593
+ console.log(chalk139.dim(`load the unpacked extension from ${path91}`));
19514
19594
  }
19515
19595
 
19516
19596
  // src/commands/criteriaExtension/signCriteriaExtension.ts
@@ -19635,10 +19715,10 @@ async function signCriteriaExtension() {
19635
19715
  process.exitCode = 1;
19636
19716
  return;
19637
19717
  }
19638
- const path90 = await signedAddonInstallPath(
19718
+ const path91 = await signedAddonInstallPath(
19639
19719
  await copySignedXpi(xpi, ARTIFACTS_DIR)
19640
19720
  );
19641
- console.log(chalk141.dim(`install the signed add-on from ${path90}`));
19721
+ console.log(chalk141.dim(`install the signed add-on from ${path91}`));
19642
19722
  }
19643
19723
 
19644
19724
  // src/commands/registerCriteriaExtension.ts
@@ -19736,10 +19816,10 @@ function getMigrationApprovalPath(migrationId) {
19736
19816
  // src/commands/dbMigration/readMigrationPinState.ts
19737
19817
  import { existsSync as existsSync46, readFileSync as readFileSync31 } from "fs";
19738
19818
  function readMigrationPinState(pin) {
19739
- const path90 = getMigrationPinPath(pin);
19740
- if (!existsSync46(path90)) return void 0;
19819
+ const path91 = getMigrationPinPath(pin);
19820
+ if (!existsSync46(path91)) return void 0;
19741
19821
  try {
19742
- const state = JSON.parse(readFileSync31(path90, "utf8"));
19822
+ const state = JSON.parse(readFileSync31(path91, "utf8"));
19743
19823
  if (state.pin !== pin) return void 0;
19744
19824
  if (!Number.isInteger(state.migrationId)) return void 0;
19745
19825
  return state;
@@ -19864,7 +19944,7 @@ function registerDeploy(program2) {
19864
19944
 
19865
19945
  // src/commands/devlog/list/index.ts
19866
19946
  import { execFileSync as execFileSync3 } from "child_process";
19867
- import { basename as basename13 } from "path";
19947
+ import { basename as basename14 } from "path";
19868
19948
 
19869
19949
  // src/commands/devlog/loadBlogSkipDays.ts
19870
19950
  import { homedir as homedir20 } from "os";
@@ -19883,7 +19963,7 @@ import chalk146 from "chalk";
19883
19963
 
19884
19964
  // src/shared/getRepoName.ts
19885
19965
  import { existsSync as existsSync48, readFileSync as readFileSync33 } from "fs";
19886
- import { basename as basename12, join as join50 } from "path";
19966
+ import { basename as basename13, join as join50 } from "path";
19887
19967
  function getRepoName() {
19888
19968
  const config = loadConfig();
19889
19969
  if (config.devlog?.name) {
@@ -19900,7 +19980,7 @@ function getRepoName() {
19900
19980
  } catch {
19901
19981
  }
19902
19982
  }
19903
- return basename12(process.cwd());
19983
+ return basename13(process.cwd());
19904
19984
  }
19905
19985
 
19906
19986
  // src/commands/devlog/loadDevlogEntries.ts
@@ -20036,7 +20116,7 @@ function list3(options2) {
20036
20116
  const config = loadConfig();
20037
20117
  const days = options2.days ?? 30;
20038
20118
  const ignore3 = options2.ignore ?? config.devlog?.ignore ?? [];
20039
- const repoName = basename13(process.cwd());
20119
+ const repoName = basename14(process.cwd());
20040
20120
  const skipDays = loadBlogSkipDays(repoName);
20041
20121
  const devlogEntries = loadDevlogEntries(repoName);
20042
20122
  const args = ["log"];
@@ -20448,7 +20528,7 @@ async function checkBuildLocksCommand() {
20448
20528
 
20449
20529
  // src/commands/dotnet/buildTree.ts
20450
20530
  import { readFileSync as readFileSync35 } from "fs";
20451
- import path40 from "path";
20531
+ import path41 from "path";
20452
20532
  var PROJECT_REF_RE = /<ProjectReference\s+Include="([^"]+)"/g;
20453
20533
  function getProjectRefs(csprojPath) {
20454
20534
  const content = readFileSync35(csprojPath, "utf8");
@@ -20459,14 +20539,14 @@ function getProjectRefs(csprojPath) {
20459
20539
  return refs;
20460
20540
  }
20461
20541
  function buildTree(csprojPath, repoRoot2, visited = /* @__PURE__ */ new Set()) {
20462
- const abs = path40.resolve(csprojPath);
20463
- const rel = path40.relative(repoRoot2, abs);
20542
+ const abs = path41.resolve(csprojPath);
20543
+ const rel = path41.relative(repoRoot2, abs);
20464
20544
  const node = { path: abs, relativePath: rel, children: [] };
20465
20545
  if (visited.has(abs)) return node;
20466
20546
  visited.add(abs);
20467
- const dir = path40.dirname(abs);
20547
+ const dir = path41.dirname(abs);
20468
20548
  for (const ref of getProjectRefs(abs)) {
20469
- const childAbs = path40.resolve(dir, ref);
20549
+ const childAbs = path41.resolve(dir, ref);
20470
20550
  try {
20471
20551
  readFileSync35(childAbs);
20472
20552
  node.children.push(buildTree(childAbs, repoRoot2, visited));
@@ -20494,7 +20574,7 @@ function collectAllDeps(node) {
20494
20574
 
20495
20575
  // src/commands/dotnet/findContainingSolutions.ts
20496
20576
  import { readdirSync as readdirSync8, readFileSync as readFileSync36, statSync as statSync8 } from "fs";
20497
- import path41 from "path";
20577
+ import path42 from "path";
20498
20578
  function findSlnFiles(dir, maxDepth, depth = 0) {
20499
20579
  if (depth > maxDepth) return [];
20500
20580
  const results = [];
@@ -20507,7 +20587,7 @@ function findSlnFiles(dir, maxDepth, depth = 0) {
20507
20587
  for (const entry of entries) {
20508
20588
  if (entry.startsWith(".") || entry === "node_modules" || entry === "packages")
20509
20589
  continue;
20510
- const full = path41.join(dir, entry);
20590
+ const full = path42.join(dir, entry);
20511
20591
  try {
20512
20592
  const stat4 = statSync8(full);
20513
20593
  if (stat4.isFile() && entry.endsWith(".sln")) {
@@ -20521,8 +20601,8 @@ function findSlnFiles(dir, maxDepth, depth = 0) {
20521
20601
  return results;
20522
20602
  }
20523
20603
  function findContainingSolutions(csprojPath, repoRoot2) {
20524
- const csprojAbs = path41.resolve(csprojPath);
20525
- const csprojBasename = path41.basename(csprojAbs);
20604
+ const csprojAbs = path42.resolve(csprojPath);
20605
+ const csprojBasename = path42.basename(csprojAbs);
20526
20606
  const slnFiles = findSlnFiles(repoRoot2, 3);
20527
20607
  const matches = [];
20528
20608
  const pattern2 = new RegExp(`[\\\\"/]${escapeRegex(csprojBasename)}"`);
@@ -20530,7 +20610,7 @@ function findContainingSolutions(csprojPath, repoRoot2) {
20530
20610
  try {
20531
20611
  const content = readFileSync36(sln, "utf8");
20532
20612
  if (pattern2.test(content)) {
20533
- matches.push(path41.relative(repoRoot2, sln));
20613
+ matches.push(path42.relative(repoRoot2, sln));
20534
20614
  }
20535
20615
  } catch {
20536
20616
  }
@@ -20593,15 +20673,15 @@ function printJson(tree, totalCount, solutions) {
20593
20673
 
20594
20674
  // src/commands/dotnet/resolveCsproj.ts
20595
20675
  import { existsSync as existsSync49 } from "fs";
20596
- import path42 from "path";
20676
+ import path43 from "path";
20597
20677
  import chalk155 from "chalk";
20598
20678
  function resolveCsproj(csprojPath) {
20599
- const resolved = path42.resolve(csprojPath);
20679
+ const resolved = path43.resolve(csprojPath);
20600
20680
  if (!existsSync49(resolved)) {
20601
20681
  console.error(chalk155.red(`File not found: ${resolved}`));
20602
20682
  process.exit(1);
20603
20683
  }
20604
- const repoRoot2 = findRepoRoot(path42.dirname(resolved));
20684
+ const repoRoot2 = findRepoRoot(path43.dirname(resolved));
20605
20685
  if (!repoRoot2) {
20606
20686
  console.error(chalk155.red("Could not find git repository root"));
20607
20687
  process.exit(1);
@@ -20766,7 +20846,7 @@ function filterIssues(issues, all, cliOnly, cliSuppress) {
20766
20846
 
20767
20847
  // src/commands/dotnet/resolveSolution.ts
20768
20848
  import { existsSync as existsSync50 } from "fs";
20769
- import path43 from "path";
20849
+ import path44 from "path";
20770
20850
  import chalk159 from "chalk";
20771
20851
 
20772
20852
  // src/commands/dotnet/findSolution.ts
@@ -20805,7 +20885,7 @@ function findSolution() {
20805
20885
  // src/commands/dotnet/resolveSolution.ts
20806
20886
  function resolveSolution(sln) {
20807
20887
  if (sln) {
20808
- const resolved = path43.resolve(sln);
20888
+ const resolved = path44.resolve(sln);
20809
20889
  if (!existsSync50(resolved)) {
20810
20890
  console.error(chalk159.red(`Solution file not found: ${resolved}`));
20811
20891
  process.exit(1);
@@ -20848,7 +20928,7 @@ function parseInspectReport(json) {
20848
20928
  import { execSync as execSync41 } from "child_process";
20849
20929
  import { existsSync as existsSync51, readFileSync as readFileSync37, unlinkSync as unlinkSync10 } from "fs";
20850
20930
  import { tmpdir as tmpdir5 } from "os";
20851
- import path44 from "path";
20931
+ import path45 from "path";
20852
20932
  import chalk160 from "chalk";
20853
20933
  function assertJbInstalled() {
20854
20934
  try {
@@ -20862,7 +20942,7 @@ function assertJbInstalled() {
20862
20942
  }
20863
20943
  }
20864
20944
  function runInspectCode(slnPath, include, swea) {
20865
- const reportPath = path44.join(tmpdir5(), `inspect-${Date.now()}.xml`);
20945
+ const reportPath = path45.join(tmpdir5(), `inspect-${Date.now()}.xml`);
20866
20946
  const includeFlag = include ? ` --include="${include}"` : "";
20867
20947
  const sweaFlag = swea ? " --swea" : "";
20868
20948
  try {
@@ -21169,10 +21249,10 @@ function decideCommentGuard(input, existingContent) {
21169
21249
  import { existsSync as existsSync52, unlinkSync as unlinkSync11 } from "fs";
21170
21250
  function consumeMigrationApproval(migrationId) {
21171
21251
  sweepRestrictedDir();
21172
- const path90 = getMigrationApprovalPath(migrationId);
21173
- if (!existsSync52(path90)) return false;
21252
+ const path91 = getMigrationApprovalPath(migrationId);
21253
+ if (!existsSync52(path91)) return false;
21174
21254
  try {
21175
- unlinkSync11(path90);
21255
+ unlinkSync11(path91);
21176
21256
  return true;
21177
21257
  } catch {
21178
21258
  return false;
@@ -22984,7 +23064,7 @@ import {
22984
23064
  rmSync as rmSync3,
22985
23065
  statSync as statSync9
22986
23066
  } from "fs";
22987
- import { basename as basename14, join as join59 } from "path";
23067
+ import { basename as basename15, join as join59 } from "path";
22988
23068
 
22989
23069
  // src/commands/handover/getHandoverPath.ts
22990
23070
  import { join as join57 } from "path";
@@ -23055,7 +23135,7 @@ async function migrateFile(orm, origin, file, createdAt) {
23055
23135
  async function migrateDiskHandovers(orm, origin, cwd = process.cwd()) {
23056
23136
  let migrated = 0;
23057
23137
  for (const file of collectMarkdown(getHandoversDir(cwd))) {
23058
- const createdAt = parseArchiveTimestamp(basename14(file)) ?? statSync9(file).mtime;
23138
+ const createdAt = parseArchiveTimestamp(basename15(file)) ?? statSync9(file).mtime;
23059
23139
  await migrateFile(orm, origin, file, createdAt);
23060
23140
  migrated++;
23061
23141
  }
@@ -23408,25 +23488,25 @@ function recentDaemonLogLines() {
23408
23488
  // src/commands/sessions/daemon/worktree/canonicalTreePath.ts
23409
23489
  import { realpathSync as realpathSync2 } from "fs";
23410
23490
  import { resolve as resolve14 } from "path";
23411
- function canonicalTreePath(path90) {
23491
+ function canonicalTreePath(path91) {
23412
23492
  try {
23413
- return realpathSync2(path90);
23493
+ return realpathSync2(path91);
23414
23494
  } catch {
23415
- return resolve14(path90);
23495
+ return resolve14(path91);
23416
23496
  }
23417
23497
  }
23418
23498
 
23419
23499
  // src/commands/sessions/daemon/worktree/createWorktree.ts
23420
23500
  import { existsSync as existsSync55 } from "fs";
23421
- import { basename as basename16, dirname as dirname26 } from "path";
23501
+ import { basename as basename17, dirname as dirname26 } from "path";
23422
23502
 
23423
23503
  // src/commands/sessions/daemon/worktree/planAllocation.ts
23424
- import { basename as basename15, join as join60 } from "path";
23504
+ import { basename as basename16, join as join60 } from "path";
23425
23505
  function planAllocation(clone, boundTreeRoots2) {
23426
23506
  return boundTreeRoots2.has(clone) ? "spill" : "primary";
23427
23507
  }
23428
23508
  function nextWorktreePath(clone, base, isTaken) {
23429
- const name = basename15(clone);
23509
+ const name = basename16(clone);
23430
23510
  for (let n = 2; n < 1e3; n++) {
23431
23511
  const candidate = join60(base, `${name}-${n}`);
23432
23512
  if (!isTaken(candidate)) return candidate;
@@ -23464,23 +23544,23 @@ function createWorktree(clone, strategy, boundTreeRoots2, preferredPath) {
23464
23544
  const base = strategy.root ? expandTilde2(strategy.root) : dirname26(clone);
23465
23545
  const registered = new Set(listWorktreePaths(clone));
23466
23546
  const branches = new Set(listLocalBranches(clone));
23467
- const isTaken = (candidate) => registered.has(candidate) || existsSync55(candidate) || boundTreeRoots2.has(candidate) || branches.has(basename16(candidate));
23468
- const path90 = preferredPath && !isTaken(preferredPath) ? preferredPath : nextWorktreePath(clone, base, isTaken);
23547
+ const isTaken = (candidate) => registered.has(candidate) || existsSync55(candidate) || boundTreeRoots2.has(candidate) || branches.has(basename17(candidate));
23548
+ const path91 = preferredPath && !isTaken(preferredPath) ? preferredPath : nextWorktreePath(clone, base, isTaken);
23469
23549
  const start3 = worktreeStartPoint(clone, strategy.trunk);
23470
23550
  gitSync(clone, [
23471
23551
  "worktree",
23472
23552
  "add",
23473
23553
  start3.track ? "--track" : "--no-track",
23474
23554
  "-b",
23475
- basename16(path90),
23476
- path90,
23555
+ basename17(path91),
23556
+ path91,
23477
23557
  start3.ref
23478
23558
  ]);
23479
- recordWorktree(path90, clone, getCurrentOrigin(clone));
23559
+ recordWorktree(path91, clone, getCurrentOrigin(clone));
23480
23560
  daemonLog(
23481
- start3.track ? `worktree allocated ${path90} (branch ${basename16(path90)} tracking ${start3.ref}) for clone ${clone}` : `worktree allocated ${path90} (branch ${basename16(path90)} off ${start3.ref}, no mainline tracking) for clone ${clone}`
23561
+ start3.track ? `worktree allocated ${path91} (branch ${basename17(path91)} tracking ${start3.ref}) for clone ${clone}` : `worktree allocated ${path91} (branch ${basename17(path91)} off ${start3.ref}, no mainline tracking) for clone ${clone}`
23482
23562
  );
23483
- return path90;
23563
+ return path91;
23484
23564
  }
23485
23565
 
23486
23566
  // src/commands/sessions/daemon/worktree/keptInTree.ts
@@ -23621,13 +23701,13 @@ function allocateTree(requestedCwd, boundTreeRoots2, options2 = {}) {
23621
23701
  if (forcedSpill) daemonLog(forcedSpill);
23622
23702
  else if (reusesClone(clone, boundTreeRoots2, reuse))
23623
23703
  return { cwd: clone, kind: "primary", created: false, clone };
23624
- const path90 = createWorktree(
23704
+ const path91 = createWorktree(
23625
23705
  clone,
23626
23706
  { root: cfg.root, trunk: cfg.trunk },
23627
23707
  boundTreeRoots2,
23628
23708
  options2.replacesTree
23629
23709
  );
23630
- return { cwd: path90, kind: "worktree", created: true, clone };
23710
+ return { cwd: path91, kind: "worktree", created: true, clone };
23631
23711
  }
23632
23712
 
23633
23713
  // src/commands/sessions/daemon/describePersistedSession.ts
@@ -23960,13 +24040,13 @@ function worktreeHoldingBranch(cwd, branch2) {
23960
24040
  const listing = gitSyncOrNull(cwd, ["worktree", "list", "--porcelain"]);
23961
24041
  if (!listing) return null;
23962
24042
  const here = gitSyncOrNull(cwd, ["rev-parse", "--show-toplevel"]);
23963
- let path90 = null;
24043
+ let path91 = null;
23964
24044
  for (const line of listing.split("\n")) {
23965
24045
  const trimmed = line.trim();
23966
24046
  if (trimmed.startsWith("worktree "))
23967
- path90 = trimmed.slice("worktree ".length).trim();
24047
+ path91 = trimmed.slice("worktree ".length).trim();
23968
24048
  else if (trimmed === `branch refs/heads/${branch2}`)
23969
- return path90 && path90 !== here ? path90 : null;
24049
+ return path91 && path91 !== here ? path91 : null;
23970
24050
  }
23971
24051
  return null;
23972
24052
  }
@@ -24211,7 +24291,7 @@ import chalk175 from "chalk";
24211
24291
 
24212
24292
  // src/commands/mermaid/exportFile.ts
24213
24293
  import { readFileSync as readFileSync40, writeFileSync as writeFileSync32 } from "fs";
24214
- import { basename as basename17, extname as extname2, resolve as resolve15 } from "path";
24294
+ import { basename as basename18, extname as extname2, resolve as resolve15 } from "path";
24215
24295
  import chalk174 from "chalk";
24216
24296
 
24217
24297
  // src/commands/mermaid/renderBlock.ts
@@ -24238,7 +24318,7 @@ async function renderBlock(krokiUrl, source) {
24238
24318
  async function exportFile(file, outDir, krokiUrl, onlyIndex) {
24239
24319
  const content = readFileSync40(file, "utf8");
24240
24320
  const blocks = extractMermaidBlocks(content);
24241
- const stem = basename17(file, extname2(file));
24321
+ const stem = basename18(file, extname2(file));
24242
24322
  if (onlyIndex !== void 0) {
24243
24323
  if (onlyIndex < 1 || onlyIndex > blocks.length) {
24244
24324
  console.error(
@@ -25084,9 +25164,9 @@ function parseRscRows(flight) {
25084
25164
  }
25085
25165
  function makeRscResolver(rows) {
25086
25166
  return (ref) => {
25087
- const [id, ...path90] = ref.slice(1).replace(/^[L@]/, "").split(":");
25167
+ const [id, ...path91] = ref.slice(1).replace(/^[L@]/, "").split(":");
25088
25168
  let v = rows[id];
25089
- for (const key of path90) {
25169
+ for (const key of path91) {
25090
25170
  if (v == null || typeof v !== "object") return void 0;
25091
25171
  v = v[key];
25092
25172
  }
@@ -25706,16 +25786,16 @@ function validateLine(line) {
25706
25786
  process.exit(1);
25707
25787
  }
25708
25788
  }
25709
- async function comment2(path90, line, body, startLine) {
25789
+ async function comment2(path91, line, body, startLine) {
25710
25790
  validateBody(body);
25711
25791
  validateLine(line);
25712
25792
  if (startLine !== void 0) validateLine(startLine);
25713
25793
  const range = startLine !== void 0 ? `${startLine}-${line}` : `${line}`;
25714
- await reviewProposedPrComment(`Comment on ${path90}:${range}`, body, null);
25794
+ await reviewProposedPrComment(`Comment on ${path91}:${range}`, body, null);
25715
25795
  try {
25716
25796
  const prId = getCurrentPrNodeId();
25717
- postReviewComment({ prId, body, path: path90, line, startLine });
25718
- console.log(`Added review comment on ${path90}:${range}`);
25797
+ postReviewComment({ prId, body, path: path91, line, startLine });
25798
+ console.log(`Added review comment on ${path91}:${range}`);
25719
25799
  } catch (error) {
25720
25800
  if (isGhNotInstalled(error)) {
25721
25801
  console.error("Error: GitHub CLI (gh) is not installed.");
@@ -26924,9 +27004,9 @@ function registerPrsComments(prsCommand) {
26924
27004
  });
26925
27005
  prsCommand.command("comment <path> <line> <body>").description(
26926
27006
  "Add a line comment to the pending review (body of - reads it from stdin)"
26927
- ).action(async (path90, line, body) => {
27007
+ ).action(async (path91, line, body) => {
26928
27008
  await comment2(
26929
- path90,
27009
+ path91,
26930
27010
  Number.parseInt(line, 10),
26931
27011
  await readBodyArgument(body)
26932
27012
  );
@@ -27293,11 +27373,11 @@ async function loadBody(target) {
27293
27373
  if (target.kind === "file") return readDraftFile(target.path);
27294
27374
  return fetchPrBody(target.number, target.repo);
27295
27375
  }
27296
- function readDraftFile(path90) {
27376
+ function readDraftFile(path91) {
27297
27377
  try {
27298
- return readFileSync45(path90, "utf8");
27378
+ return readFileSync45(path91, "utf8");
27299
27379
  } catch {
27300
- console.error(`Error: Could not read \`${path90}\`.`);
27380
+ console.error(`Error: Could not read \`${path91}\`.`);
27301
27381
  console.error(
27302
27382
  "Pass a pull request number, a GitHub pull request URL, - for stdin, or a path to a file."
27303
27383
  );
@@ -27576,10 +27656,10 @@ function resolveOpSecret(reference) {
27576
27656
  }
27577
27657
 
27578
27658
  // src/commands/ravendb/ravenFetch.ts
27579
- async function ravenFetch(connection, path90) {
27659
+ async function ravenFetch(connection, path91) {
27580
27660
  const apiKey = resolveOpSecret(connection.apiKeyRef);
27581
27661
  let accessToken = await getAccessToken(apiKey);
27582
- const url = `${connection.url}${path90}`;
27662
+ const url = `${connection.url}${path91}`;
27583
27663
  const headers = {
27584
27664
  Authorization: `Bearer ${accessToken}`,
27585
27665
  "Content-Type": "application/json"
@@ -27669,16 +27749,16 @@ import chalk195 from "chalk";
27669
27749
  // src/commands/ravendb/buildQueryPath.ts
27670
27750
  function buildQueryPath(opts) {
27671
27751
  const db = encodeURIComponent(opts.db);
27672
- let path90;
27752
+ let path91;
27673
27753
  if (opts.collection) {
27674
- path90 = `/databases/${db}/indexes/dynamic/${encodeURIComponent(opts.collection)}?start=${opts.start}&pageSize=${opts.pageSize}&sort=${encodeURIComponent(opts.sort)}`;
27754
+ path91 = `/databases/${db}/indexes/dynamic/${encodeURIComponent(opts.collection)}?start=${opts.start}&pageSize=${opts.pageSize}&sort=${encodeURIComponent(opts.sort)}`;
27675
27755
  } else {
27676
- path90 = `/databases/${db}/queries?start=${opts.start}&pageSize=${opts.pageSize}`;
27756
+ path91 = `/databases/${db}/queries?start=${opts.start}&pageSize=${opts.pageSize}`;
27677
27757
  }
27678
27758
  if (opts.query) {
27679
- path90 += `&query=${encodeURIComponent(opts.query)}`;
27759
+ path91 += `&query=${encodeURIComponent(opts.query)}`;
27680
27760
  }
27681
- return path90;
27761
+ return path91;
27682
27762
  }
27683
27763
 
27684
27764
  // src/commands/ravendb/fetchAllPages.ts
@@ -27687,7 +27767,7 @@ async function fetchAllPages(connection, opts) {
27687
27767
  let start3 = 0;
27688
27768
  while (true) {
27689
27769
  const effectivePageSize = opts.limit !== void 0 ? Math.min(opts.pageSize, opts.limit - allResults.length) : opts.pageSize;
27690
- const path90 = buildQueryPath({
27770
+ const path91 = buildQueryPath({
27691
27771
  db: connection.database,
27692
27772
  collection: opts.collection,
27693
27773
  start: start3,
@@ -27695,7 +27775,7 @@ async function fetchAllPages(connection, opts) {
27695
27775
  sort: opts.sort,
27696
27776
  query: opts.query
27697
27777
  });
27698
- const data = await ravenFetch(connection, path90);
27778
+ const data = await ravenFetch(connection, path91);
27699
27779
  const results = data.Results ?? [];
27700
27780
  const totalResults = data.TotalResults ?? 0;
27701
27781
  if (results.length === 0) break;
@@ -27753,7 +27833,7 @@ function registerRavendb(program2) {
27753
27833
 
27754
27834
  // src/commands/refactor/check/index.ts
27755
27835
  import { spawn as spawn6 } from "child_process";
27756
- import * as path45 from "path";
27836
+ import * as path46 from "path";
27757
27837
 
27758
27838
  // src/commands/refactor/logViolations.ts
27759
27839
  import chalk197 from "chalk";
@@ -27930,7 +28010,7 @@ ${failed2.length} verify script(s) failed:`);
27930
28010
  async function runVerifyQuietly() {
27931
28011
  const result = findPackageJsonWithVerifyScripts(process.cwd());
27932
28012
  if (!result) return true;
27933
- const packageDir = path45.dirname(result.packageJsonPath);
28013
+ const packageDir = path46.dirname(result.packageJsonPath);
27934
28014
  const results = await Promise.all(
27935
28015
  result.verifyScripts.map((script) => runScript(script, packageDir))
27936
28016
  );
@@ -27956,7 +28036,7 @@ async function check(pattern2, options2) {
27956
28036
  }
27957
28037
 
27958
28038
  // src/commands/refactor/extract/index.ts
27959
- import path53 from "path";
28039
+ import path54 from "path";
27960
28040
  import chalk200 from "chalk";
27961
28041
 
27962
28042
  // src/commands/refactor/extract/applyExtraction.ts
@@ -28433,9 +28513,9 @@ function buildDestinationContent(functionTexts, imports, sourceRelativePath, sou
28433
28513
  }
28434
28514
 
28435
28515
  // src/commands/refactor/extract/getRelativeImportPath.ts
28436
- import path46 from "path";
28516
+ import path47 from "path";
28437
28517
  function getRelativeImportPath(from, to) {
28438
- let rel = path46.relative(path46.dirname(from), to).replace(/\.tsx?$/, "").replace(/\\/g, "/");
28518
+ let rel = path47.relative(path47.dirname(from), to).replace(/\.tsx?$/, "").replace(/\\/g, "/");
28439
28519
  if (!rel.startsWith(".")) rel = `./${rel}`;
28440
28520
  return rel;
28441
28521
  }
@@ -28459,9 +28539,9 @@ function findImporters(functionName, sourceFile, destPath, project) {
28459
28539
  }
28460
28540
 
28461
28541
  // src/commands/refactor/extract/resolveBarrel.ts
28462
- import path47 from "path";
28542
+ import path48 from "path";
28463
28543
  function resolveBarrel(functionName, sourcePath, destPath, project) {
28464
- const indexPath = path47.join(path47.dirname(destPath), "index.ts");
28544
+ const indexPath = path48.join(path48.dirname(destPath), "index.ts");
28465
28545
  const barrel = project.getSourceFile(indexPath);
28466
28546
  if (!barrel) return { barrel: void 0, barrelRelPath: "" };
28467
28547
  const sourceRelFromBarrel = getRelativeImportPath(indexPath, sourcePath);
@@ -28479,15 +28559,15 @@ function resolveBarrel(functionName, sourcePath, destPath, project) {
28479
28559
  }
28480
28560
 
28481
28561
  // src/commands/refactor/extract/rewriteImportPaths.ts
28482
- import path48 from "path";
28562
+ import path49 from "path";
28483
28563
  function rewriteImportPaths(imports, sourcePath, destPath) {
28484
- const sourceDir = path48.dirname(sourcePath);
28485
- const destDir = path48.dirname(destPath);
28564
+ const sourceDir = path49.dirname(sourcePath);
28565
+ const destDir = path49.dirname(destPath);
28486
28566
  return imports.map((imp) => {
28487
28567
  if (!imp.moduleSpecifier.startsWith(".")) return imp;
28488
- const absolute2 = path48.resolve(sourceDir, imp.moduleSpecifier);
28489
- let rel = path48.relative(destDir, absolute2).replace(/\\/g, "/");
28490
- if (rel === "") rel = `../${path48.basename(absolute2)}`;
28568
+ const absolute2 = path49.resolve(sourceDir, imp.moduleSpecifier);
28569
+ let rel = path49.relative(destDir, absolute2).replace(/\\/g, "/");
28570
+ if (rel === "") rel = `../${path49.basename(absolute2)}`;
28491
28571
  else if (!rel.startsWith(".")) rel = `./${rel}`;
28492
28572
  return { ...imp, moduleSpecifier: rel };
28493
28573
  });
@@ -28555,7 +28635,7 @@ function buildPlan2(functionName, sourceFile, sourcePath, destPath, project) {
28555
28635
  }
28556
28636
 
28557
28637
  // src/commands/refactor/extract/displayPlan.ts
28558
- import path49 from "path";
28638
+ import path50 from "path";
28559
28639
  import chalk198 from "chalk";
28560
28640
  function section2(title) {
28561
28641
  return `
@@ -28565,7 +28645,7 @@ function displayImporters(plan2, cwd) {
28565
28645
  if (plan2.importersToUpdate.length === 0) return;
28566
28646
  console.log(section2("Update importers:"));
28567
28647
  for (const imp of plan2.importersToUpdate) {
28568
- const rel = path49.relative(cwd, imp.file.getFilePath());
28648
+ const rel = path50.relative(cwd, imp.file.getFilePath());
28569
28649
  console.log(` ${chalk198.dim(rel)}: \u2192 import from "${imp.relPath}"`);
28570
28650
  }
28571
28651
  }
@@ -28605,17 +28685,17 @@ function displayPlan(functionName, relDest, plan2, cwd) {
28605
28685
  }
28606
28686
 
28607
28687
  // src/commands/refactor/extract/loadProjectFile.ts
28608
- import path52 from "path";
28688
+ import path53 from "path";
28609
28689
  import chalk199 from "chalk";
28610
28690
  import { Project as Project4 } from "ts-morph";
28611
28691
 
28612
28692
  // src/commands/refactor/extract/findTsConfig.ts
28613
28693
  import fs32 from "fs";
28614
- import path51 from "path";
28694
+ import path52 from "path";
28615
28695
 
28616
28696
  // src/commands/refactor/extract/findEnclosingTsConfig.ts
28617
28697
  import fs31 from "fs";
28618
- import path50 from "path";
28698
+ import path51 from "path";
28619
28699
 
28620
28700
  // src/commands/refactor/extract/projectIncludesFile.ts
28621
28701
  import { Project as Project3 } from "ts-morph";
@@ -28630,16 +28710,16 @@ function projectIncludesFile(configPath, sourcePath) {
28630
28710
 
28631
28711
  // src/commands/refactor/extract/findEnclosingTsConfig.ts
28632
28712
  function findEnclosingTsConfig(sourcePath, rootDir, tried) {
28633
- let dir = path50.dirname(sourcePath);
28634
- while (dir.startsWith(rootDir + path50.sep) && dir !== rootDir) {
28635
- const nested = path50.join(dir, "tsconfig.json");
28713
+ let dir = path51.dirname(sourcePath);
28714
+ while (dir.startsWith(rootDir + path51.sep) && dir !== rootDir) {
28715
+ const nested = path51.join(dir, "tsconfig.json");
28636
28716
  if (!tried.has(nested)) {
28637
28717
  tried.add(nested);
28638
28718
  if (fs31.existsSync(nested) && projectIncludesFile(nested, sourcePath)) {
28639
28719
  return nested;
28640
28720
  }
28641
28721
  }
28642
- const parent = path50.dirname(dir);
28722
+ const parent = path51.dirname(dir);
28643
28723
  if (parent === dir) break;
28644
28724
  dir = parent;
28645
28725
  }
@@ -28648,7 +28728,7 @@ function findEnclosingTsConfig(sourcePath, rootDir, tried) {
28648
28728
 
28649
28729
  // src/commands/refactor/extract/findTsConfig.ts
28650
28730
  function findTsConfig(sourcePath) {
28651
- const rootConfig = path51.resolve("tsconfig.json");
28731
+ const rootConfig = path52.resolve("tsconfig.json");
28652
28732
  if (!fs32.existsSync(rootConfig)) return rootConfig;
28653
28733
  const tried = /* @__PURE__ */ new Set();
28654
28734
  const candidates = [rootConfig, ...readReferences(rootConfig)];
@@ -28657,7 +28737,7 @@ function findTsConfig(sourcePath) {
28657
28737
  tried.add(candidate);
28658
28738
  if (projectIncludesFile(candidate, sourcePath)) return candidate;
28659
28739
  }
28660
- const siblings = fs32.readdirSync(path51.dirname(rootConfig)).filter((f) => /^tsconfig.*\.json$/.test(f)).map((f) => path51.resolve(path51.dirname(rootConfig), f));
28740
+ const siblings = fs32.readdirSync(path52.dirname(rootConfig)).filter((f) => /^tsconfig.*\.json$/.test(f)).map((f) => path52.resolve(path52.dirname(rootConfig), f));
28661
28741
  for (const sibling of siblings) {
28662
28742
  if (tried.has(sibling)) continue;
28663
28743
  tried.add(sibling);
@@ -28665,7 +28745,7 @@ function findTsConfig(sourcePath) {
28665
28745
  }
28666
28746
  const nested = findEnclosingTsConfig(
28667
28747
  sourcePath,
28668
- path51.dirname(rootConfig),
28748
+ path52.dirname(rootConfig),
28669
28749
  tried
28670
28750
  );
28671
28751
  if (nested) return nested;
@@ -28682,16 +28762,16 @@ function readReferences(configPath) {
28682
28762
  return [];
28683
28763
  }
28684
28764
  if (!parsed.references?.length) return [];
28685
- const cwd = path51.dirname(configPath);
28765
+ const cwd = path52.dirname(configPath);
28686
28766
  return parsed.references.map((ref) => {
28687
- const refPath = path51.resolve(cwd, ref.path);
28688
- return fs32.statSync(refPath, { throwIfNoEntry: false })?.isDirectory() ? path51.join(refPath, "tsconfig.json") : refPath;
28767
+ const refPath = path52.resolve(cwd, ref.path);
28768
+ return fs32.statSync(refPath, { throwIfNoEntry: false })?.isDirectory() ? path52.join(refPath, "tsconfig.json") : refPath;
28689
28769
  }).filter((p) => fs32.existsSync(p));
28690
28770
  }
28691
28771
 
28692
28772
  // src/commands/refactor/extract/loadProjectFile.ts
28693
28773
  function loadProjectFile(file) {
28694
- const sourcePath = path52.resolve(file);
28774
+ const sourcePath = path53.resolve(file);
28695
28775
  const tsConfigPath = findTsConfig(sourcePath);
28696
28776
  const project = new Project4({
28697
28777
  tsConfigFilePath: tsConfigPath
@@ -28706,10 +28786,10 @@ function loadProjectFile(file) {
28706
28786
 
28707
28787
  // src/commands/refactor/extract/index.ts
28708
28788
  async function extract(file, functionName, destination, options2 = {}) {
28709
- const sourcePath = path53.resolve(file);
28710
- const destPath = path53.resolve(destination);
28789
+ const sourcePath = path54.resolve(file);
28790
+ const destPath = path54.resolve(destination);
28711
28791
  const cwd = process.cwd();
28712
- const relDest = path53.relative(cwd, destPath);
28792
+ const relDest = path54.relative(cwd, destPath);
28713
28793
  const { project, sourceFile } = loadProjectFile(file);
28714
28794
  const plan2 = buildPlan2(
28715
28795
  functionName,
@@ -28757,16 +28837,16 @@ function ignore2(file) {
28757
28837
 
28758
28838
  // src/commands/refactor/rename/index.ts
28759
28839
  import fs36 from "fs";
28760
- import path58 from "path";
28840
+ import path59 from "path";
28761
28841
  import chalk204 from "chalk";
28762
28842
 
28763
28843
  // src/commands/refactor/rename/applyRename.ts
28764
28844
  import fs35 from "fs";
28765
- import path55 from "path";
28845
+ import path56 from "path";
28766
28846
  import chalk202 from "chalk";
28767
28847
 
28768
28848
  // src/commands/refactor/restructure/computeRewrites/index.ts
28769
- import path54 from "path";
28849
+ import path55 from "path";
28770
28850
 
28771
28851
  // src/commands/refactor/restructure/computeRewrites/applyRewrites.ts
28772
28852
  import fs34 from "fs";
@@ -28820,7 +28900,7 @@ function normalizeSpecifier(rel) {
28820
28900
  );
28821
28901
  }
28822
28902
  function computeSpecifier(fromFile, toFile) {
28823
- return normalizeSpecifier(path54.relative(path54.dirname(fromFile), toFile));
28903
+ return normalizeSpecifier(path55.relative(path55.dirname(fromFile), toFile));
28824
28904
  }
28825
28905
  function isAffected(edge, moveMap) {
28826
28906
  return moveMap.has(edge.target) || moveMap.has(edge.source);
@@ -28868,20 +28948,20 @@ function applyRename(rewrites, sourcePath, destPath, cwd) {
28868
28948
  const updatedContents = applyRewrites(rewrites);
28869
28949
  for (const [file, content] of updatedContents) {
28870
28950
  fs35.writeFileSync(file, content, "utf8");
28871
- console.log(chalk202.cyan(` Updated imports in ${path55.relative(cwd, file)}`));
28951
+ console.log(chalk202.cyan(` Updated imports in ${path56.relative(cwd, file)}`));
28872
28952
  }
28873
- const destDir = path55.dirname(destPath);
28953
+ const destDir = path56.dirname(destPath);
28874
28954
  if (!fs35.existsSync(destDir)) fs35.mkdirSync(destDir, { recursive: true });
28875
28955
  fs35.renameSync(sourcePath, destPath);
28876
28956
  console.log(
28877
28957
  chalk202.white(
28878
- ` Moved ${path55.relative(cwd, sourcePath)} \u2192 ${path55.relative(cwd, destPath)}`
28958
+ ` Moved ${path56.relative(cwd, sourcePath)} \u2192 ${path56.relative(cwd, destPath)}`
28879
28959
  )
28880
28960
  );
28881
28961
  }
28882
28962
 
28883
28963
  // src/commands/refactor/restructure/buildImportGraph/index.ts
28884
- import path56 from "path";
28964
+ import path57 from "path";
28885
28965
  import ts7 from "typescript";
28886
28966
 
28887
28967
  // src/commands/refactor/restructure/buildImportGraph/getImportSpecifiers.ts
@@ -28908,7 +28988,7 @@ function loadParsedConfig(tsConfigPath) {
28908
28988
  return ts7.parseJsonConfigFileContent(
28909
28989
  configFile.config,
28910
28990
  ts7.sys,
28911
- path56.dirname(tsConfigPath)
28991
+ path57.dirname(tsConfigPath)
28912
28992
  );
28913
28993
  }
28914
28994
  function addToSetMap(map, key, value) {
@@ -28924,7 +29004,7 @@ function resolveImport(specifier, filePath, options2) {
28924
29004
  const resolved = ts7.resolveModuleName(specifier, filePath, options2, ts7.sys);
28925
29005
  const resolvedPath = resolved.resolvedModule?.resolvedFileName;
28926
29006
  if (!resolvedPath || resolvedPath.includes("node_modules")) return null;
28927
- return path56.resolve(resolvedPath);
29007
+ return path57.resolve(resolvedPath);
28928
29008
  }
28929
29009
  function buildImportGraph(candidateFiles, tsConfigPath) {
28930
29010
  const parsed = loadParsedConfig(tsConfigPath);
@@ -28933,7 +29013,7 @@ function buildImportGraph(candidateFiles, tsConfigPath) {
28933
29013
  const importedBy = /* @__PURE__ */ new Map();
28934
29014
  const imports = /* @__PURE__ */ new Map();
28935
29015
  for (const sourceFile of program2.getSourceFiles()) {
28936
- const filePath = path56.resolve(sourceFile.fileName);
29016
+ const filePath = path57.resolve(sourceFile.fileName);
28937
29017
  if (filePath.includes("node_modules")) continue;
28938
29018
  for (const specifier of getImportSpecifiers(sourceFile)) {
28939
29019
  const absTarget = resolveImport(specifier, filePath, parsed.options);
@@ -28960,13 +29040,13 @@ function computeRenameRewrites(sourcePath, destPath) {
28960
29040
  }
28961
29041
 
28962
29042
  // src/commands/refactor/rename/printRenamePreview.ts
28963
- import path57 from "path";
29043
+ import path58 from "path";
28964
29044
  import chalk203 from "chalk";
28965
29045
  function printRenamePreview(rewrites, cwd) {
28966
29046
  for (const rewrite of rewrites) {
28967
29047
  console.log(
28968
29048
  chalk203.dim(
28969
- ` ${path57.relative(cwd, rewrite.file)}: ${rewrite.oldSpecifier} \u2192 ${rewrite.newSpecifier}`
29049
+ ` ${path58.relative(cwd, rewrite.file)}: ${rewrite.oldSpecifier} \u2192 ${rewrite.newSpecifier}`
28970
29050
  )
28971
29051
  );
28972
29052
  }
@@ -28975,11 +29055,11 @@ function printRenamePreview(rewrites, cwd) {
28975
29055
 
28976
29056
  // src/commands/refactor/rename/index.ts
28977
29057
  async function rename(source, destination, options2 = {}) {
28978
- const sourcePath = path58.resolve(source);
28979
- const destPath = path58.resolve(destination);
29058
+ const sourcePath = path59.resolve(source);
29059
+ const destPath = path59.resolve(destination);
28980
29060
  const cwd = process.cwd();
28981
- const relSource = path58.relative(cwd, sourcePath);
28982
- const relDest = path58.relative(cwd, destPath);
29061
+ const relSource = path59.relative(cwd, sourcePath);
29062
+ const relDest = path59.relative(cwd, destPath);
28983
29063
  if (!fs36.existsSync(sourcePath)) {
28984
29064
  console.log(chalk204.red(`File not found: ${source}`));
28985
29065
  process.exit(1);
@@ -29034,12 +29114,12 @@ function findSymbol(sourceFile, symbolName) {
29034
29114
  }
29035
29115
 
29036
29116
  // src/commands/refactor/renameSymbol/groupReferences.ts
29037
- import path59 from "path";
29117
+ import path60 from "path";
29038
29118
  function groupReferences(symbol, cwd) {
29039
29119
  const refs = symbol.findReferencesAsNodes();
29040
29120
  const grouped = /* @__PURE__ */ new Map();
29041
29121
  for (const ref of refs) {
29042
- const refFile = path59.relative(cwd, ref.getSourceFile().getFilePath());
29122
+ const refFile = path60.relative(cwd, ref.getSourceFile().getFilePath());
29043
29123
  const lines2 = grouped.get(refFile) ?? [];
29044
29124
  if (!grouped.has(refFile)) grouped.set(refFile, lines2);
29045
29125
  lines2.push(ref.getStartLineNumber());
@@ -29078,16 +29158,16 @@ Renamed ${oldName} \u2192 ${newName}`));
29078
29158
  }
29079
29159
 
29080
29160
  // src/commands/refactor/restructure/index.ts
29081
- import path66 from "path";
29161
+ import path67 from "path";
29082
29162
  import chalk208 from "chalk";
29083
29163
 
29084
29164
  // src/commands/refactor/restructure/clusterDirectories.ts
29085
- import path60 from "path";
29165
+ import path61 from "path";
29086
29166
  function clusterDirectories(graph) {
29087
29167
  const dirImportedBy = /* @__PURE__ */ new Map();
29088
29168
  for (const edge of graph.edges) {
29089
- const sourceDir = path60.dirname(edge.source);
29090
- const targetDir = path60.dirname(edge.target);
29169
+ const sourceDir = path61.dirname(edge.source);
29170
+ const targetDir = path61.dirname(edge.target);
29091
29171
  if (sourceDir === targetDir) continue;
29092
29172
  if (!graph.files.has(edge.target)) continue;
29093
29173
  const existing = dirImportedBy.get(targetDir) ?? /* @__PURE__ */ new Set();
@@ -29115,20 +29195,20 @@ function clusterDirectories(graph) {
29115
29195
  return clusters;
29116
29196
  }
29117
29197
  function isAncestor(ancestor, descendant) {
29118
- const rel = path60.relative(ancestor, descendant);
29198
+ const rel = path61.relative(ancestor, descendant);
29119
29199
  return !rel.startsWith("..") && rel !== "";
29120
29200
  }
29121
29201
 
29122
29202
  // src/commands/refactor/restructure/clusterFiles.ts
29123
- import path61 from "path";
29203
+ import path62 from "path";
29124
29204
  function findRootParent(file, importedBy, visited) {
29125
29205
  const importers = importedBy.get(file);
29126
29206
  if (!importers || importers.size !== 1) return file;
29127
29207
  const parent = [...importers][0];
29128
- const parentDir = path61.dirname(parent);
29129
- const fileDir = path61.dirname(file);
29208
+ const parentDir = path62.dirname(parent);
29209
+ const fileDir = path62.dirname(file);
29130
29210
  if (parentDir !== fileDir) return file;
29131
- if (path61.basename(parent, path61.extname(parent)) === "index") return file;
29211
+ if (path62.basename(parent, path62.extname(parent)) === "index") return file;
29132
29212
  if (visited.has(parent)) return file;
29133
29213
  visited.add(parent);
29134
29214
  return findRootParent(parent, importedBy, visited);
@@ -29136,16 +29216,16 @@ function findRootParent(file, importedBy, visited) {
29136
29216
  function clusterFiles(graph) {
29137
29217
  const clusters = /* @__PURE__ */ new Map();
29138
29218
  for (const file of graph.files) {
29139
- const basename27 = path61.basename(file, path61.extname(file));
29140
- if (basename27 === "index") continue;
29219
+ const basename28 = path62.basename(file, path62.extname(file));
29220
+ if (basename28 === "index") continue;
29141
29221
  const importers = graph.importedBy.get(file);
29142
29222
  if (!importers || importers.size !== 1) continue;
29143
29223
  const parent = [...importers][0];
29144
29224
  if (!graph.files.has(parent)) continue;
29145
- const parentDir = path61.dirname(parent);
29146
- const fileDir = path61.dirname(file);
29225
+ const parentDir = path62.dirname(parent);
29226
+ const fileDir = path62.dirname(file);
29147
29227
  if (parentDir !== fileDir) continue;
29148
- const parentBasename = path61.basename(parent, path61.extname(parent));
29228
+ const parentBasename = path62.basename(parent, path62.extname(parent));
29149
29229
  if (parentBasename === "index") continue;
29150
29230
  const root = findRootParent(parent, graph.importedBy, /* @__PURE__ */ new Set([file]));
29151
29231
  if (!root || root === file) continue;
@@ -29157,10 +29237,10 @@ function clusterFiles(graph) {
29157
29237
  }
29158
29238
 
29159
29239
  // src/commands/refactor/restructure/displayPlan.ts
29160
- import path62 from "path";
29240
+ import path63 from "path";
29161
29241
  import chalk206 from "chalk";
29162
29242
  function relPath(filePath) {
29163
- return path62.relative(process.cwd(), filePath);
29243
+ return path63.relative(process.cwd(), filePath);
29164
29244
  }
29165
29245
  function displayMoves(plan2) {
29166
29246
  if (plan2.moves.length === 0) return;
@@ -29210,33 +29290,33 @@ Summary: ${plan2.moves.length} file(s) moved, ${plan2.rewrites.length} imports r
29210
29290
 
29211
29291
  // src/commands/refactor/restructure/executePlan.ts
29212
29292
  import fs37 from "fs";
29213
- import path63 from "path";
29293
+ import path64 from "path";
29214
29294
  import chalk207 from "chalk";
29215
29295
  function executePlan(plan2) {
29216
29296
  const updatedContents = applyRewrites(plan2.rewrites);
29217
29297
  for (const [file, content] of updatedContents) {
29218
29298
  fs37.writeFileSync(file, content, "utf8");
29219
29299
  console.log(
29220
- chalk207.cyan(` Rewrote imports in ${path63.relative(process.cwd(), file)}`)
29300
+ chalk207.cyan(` Rewrote imports in ${path64.relative(process.cwd(), file)}`)
29221
29301
  );
29222
29302
  }
29223
29303
  for (const dir of plan2.newDirectories) {
29224
29304
  fs37.mkdirSync(dir, { recursive: true });
29225
- console.log(chalk207.green(` Created ${path63.relative(process.cwd(), dir)}/`));
29305
+ console.log(chalk207.green(` Created ${path64.relative(process.cwd(), dir)}/`));
29226
29306
  }
29227
29307
  for (const move2 of plan2.moves) {
29228
- const targetDir = path63.dirname(move2.to);
29308
+ const targetDir = path64.dirname(move2.to);
29229
29309
  if (!fs37.existsSync(targetDir)) {
29230
29310
  fs37.mkdirSync(targetDir, { recursive: true });
29231
29311
  }
29232
29312
  fs37.renameSync(move2.from, move2.to);
29233
29313
  console.log(
29234
29314
  chalk207.white(
29235
- ` Moved ${path63.relative(process.cwd(), move2.from)} \u2192 ${path63.relative(process.cwd(), move2.to)}`
29315
+ ` Moved ${path64.relative(process.cwd(), move2.from)} \u2192 ${path64.relative(process.cwd(), move2.to)}`
29236
29316
  )
29237
29317
  );
29238
29318
  }
29239
- removeEmptyDirectories(plan2.moves.map((m) => path63.dirname(m.from)));
29319
+ removeEmptyDirectories(plan2.moves.map((m) => path64.dirname(m.from)));
29240
29320
  }
29241
29321
  function removeEmptyDirectories(dirs) {
29242
29322
  const unique = [...new Set(dirs)];
@@ -29247,7 +29327,7 @@ function removeEmptyDirectories(dirs) {
29247
29327
  fs37.rmdirSync(dir);
29248
29328
  console.log(
29249
29329
  chalk207.dim(
29250
- ` Removed empty directory ${path63.relative(process.cwd(), dir)}`
29330
+ ` Removed empty directory ${path64.relative(process.cwd(), dir)}`
29251
29331
  )
29252
29332
  );
29253
29333
  }
@@ -29255,7 +29335,7 @@ function removeEmptyDirectories(dirs) {
29255
29335
  }
29256
29336
 
29257
29337
  // src/commands/refactor/restructure/planFileMoves/index.ts
29258
- import path65 from "path";
29338
+ import path66 from "path";
29259
29339
 
29260
29340
  // src/commands/refactor/restructure/planFileMoves/shared.ts
29261
29341
  import fs38 from "fs";
@@ -29270,9 +29350,9 @@ function checkDirConflict(result, label2, dir) {
29270
29350
 
29271
29351
  // src/commands/refactor/restructure/planFileMoves/planDirectoryMoves.ts
29272
29352
  import fs39 from "fs";
29273
- import path64 from "path";
29353
+ import path65 from "path";
29274
29354
  function collectEntry2(results, dir, entry) {
29275
- const full = path64.join(dir, entry.name);
29355
+ const full = path65.join(dir, entry.name);
29276
29356
  const items2 = entry.isDirectory() ? listFilesRecursive(full) : [full];
29277
29357
  results.push(...items2);
29278
29358
  }
@@ -29286,15 +29366,15 @@ function listFilesRecursive(dir) {
29286
29366
  }
29287
29367
  function addDirectoryFileMoves(moves, childDir, newLocation, reason4) {
29288
29368
  for (const file of listFilesRecursive(childDir)) {
29289
- const rel = path64.relative(childDir, file);
29290
- moves.push({ from: file, to: path64.join(newLocation, rel), reason: reason4 });
29369
+ const rel = path65.relative(childDir, file);
29370
+ moves.push({ from: file, to: path65.join(newLocation, rel), reason: reason4 });
29291
29371
  }
29292
29372
  }
29293
29373
  function resolveChildDest(parentDir, childDir) {
29294
- return path64.join(parentDir, path64.basename(childDir));
29374
+ return path65.join(parentDir, path65.basename(childDir));
29295
29375
  }
29296
29376
  function childMoveReason(parentDir) {
29297
- return `Directory only imported from ${path64.basename(parentDir)}/`;
29377
+ return `Directory only imported from ${path65.basename(parentDir)}/`;
29298
29378
  }
29299
29379
  function registerDirectoryMove(result, childDir, dest, parentDir) {
29300
29380
  result.directories.push(dest);
@@ -29319,7 +29399,7 @@ function planDirectoryMoves(clusters) {
29319
29399
 
29320
29400
  // src/commands/refactor/restructure/planFileMoves/index.ts
29321
29401
  function childMoveData(child, newDir, parentBase) {
29322
- const to = path65.join(newDir, path65.basename(child));
29402
+ const to = path66.join(newDir, path66.basename(child));
29323
29403
  return { from: child, to, reason: `Only imported by ${parentBase}` };
29324
29404
  }
29325
29405
  function addChildMoves(moves, children, newDir, parentBase) {
@@ -29327,15 +29407,15 @@ function addChildMoves(moves, children, newDir, parentBase) {
29327
29407
  moves.push(childMoveData(child, newDir, parentBase));
29328
29408
  }
29329
29409
  function getBaseName(filePath) {
29330
- return path65.basename(filePath, path65.extname(filePath));
29410
+ return path66.basename(filePath, path66.extname(filePath));
29331
29411
  }
29332
29412
  function resolveClusterDir(parent) {
29333
- return path65.join(path65.dirname(parent), getBaseName(parent));
29413
+ return path66.join(path66.dirname(parent), getBaseName(parent));
29334
29414
  }
29335
29415
  function createParentMove(parent, newDir) {
29336
29416
  return {
29337
29417
  from: parent,
29338
- to: path65.join(newDir, `index${path65.extname(parent)}`),
29418
+ to: path66.join(newDir, `index${path66.extname(parent)}`),
29339
29419
  reason: `Main module of new ${getBaseName(parent)}/ directory`
29340
29420
  };
29341
29421
  }
@@ -29359,7 +29439,7 @@ function planFileMoves(clusters) {
29359
29439
 
29360
29440
  // src/commands/refactor/restructure/index.ts
29361
29441
  function buildPlan3(candidateFiles, tsConfigPath) {
29362
- const candidates = new Set(candidateFiles.map((f) => path66.resolve(f)));
29442
+ const candidates = new Set(candidateFiles.map((f) => path67.resolve(f)));
29363
29443
  const graph = buildImportGraph(candidates, tsConfigPath);
29364
29444
  const allProjectFiles = /* @__PURE__ */ new Set([
29365
29445
  ...graph.importedBy.keys(),
@@ -29382,7 +29462,7 @@ async function restructure(pattern2, options2 = {}) {
29382
29462
  console.log(chalk208.yellow("No files found matching pattern"));
29383
29463
  return;
29384
29464
  }
29385
- const tsConfigPath = findTsConfig(path66.resolve(files[0]));
29465
+ const tsConfigPath = findTsConfig(path67.resolve(files[0]));
29386
29466
  const plan2 = buildPlan3(files, tsConfigPath);
29387
29467
  if (plan2.moves.length === 0) {
29388
29468
  console.log(chalk208.green("No restructuring needed"));
@@ -29561,13 +29641,13 @@ ${annotateDiffWithLineNumbers(context.diff.trimEnd())}
29561
29641
 
29562
29642
  // src/commands/review/buildReviewPaths.ts
29563
29643
  import { homedir as homedir23 } from "os";
29564
- import { basename as basename18, join as join72 } from "path";
29644
+ import { basename as basename19, join as join72 } from "path";
29565
29645
  function buildReviewPaths(repoRoot2, key) {
29566
29646
  const reviewDir = join72(
29567
29647
  homedir23(),
29568
29648
  ".assist",
29569
29649
  "reviews",
29570
- basename18(repoRoot2),
29650
+ basename19(repoRoot2),
29571
29651
  key
29572
29652
  );
29573
29653
  return {
@@ -30303,8 +30383,8 @@ async function handlePostSynthesis(synthesisPath, prInfo, options2) {
30303
30383
  // src/commands/review/prepareReviewDir.ts
30304
30384
  import { existsSync as existsSync61, mkdirSync as mkdirSync21, unlinkSync as unlinkSync17, writeFileSync as writeFileSync38 } from "fs";
30305
30385
  function clearReviewFiles(paths) {
30306
- for (const path90 of [paths.claudePath, paths.codexPath, paths.synthesisPath]) {
30307
- if (existsSync61(path90)) unlinkSync17(path90);
30386
+ for (const path91 of [paths.claudePath, paths.codexPath, paths.synthesisPath]) {
30387
+ if (existsSync61(path91)) unlinkSync17(path91);
30308
30388
  }
30309
30389
  }
30310
30390
  function prepareReviewDir(paths, requestBody, force) {
@@ -30475,6 +30555,11 @@ function skippedCodexResult(outputPath) {
30475
30555
  return { name: "codex", outputPath, exitCode: 0, stderr: "" };
30476
30556
  }
30477
30557
 
30558
+ // src/commands/review/reviewerLabel.ts
30559
+ function reviewerLabel(name, model) {
30560
+ return model ? `${name} (${model})` : name;
30561
+ }
30562
+
30478
30563
  // src/commands/review/formatReviewerFailure.ts
30479
30564
  var FAST_FAIL_MS = 1e3;
30480
30565
  var STDOUT_TAIL_LINES = 20;
@@ -30512,7 +30597,7 @@ function outputDetail(input) {
30512
30597
  function formatReviewerFailure(input) {
30513
30598
  const command = input.command ?? input.name;
30514
30599
  const seconds = Math.round((input.elapsedMs ?? 0) / 1e3);
30515
- const headerLine = `${command} CLI exited with code ${input.exitCode} after ${seconds}s`;
30600
+ const headerLine = `${reviewerLabel(command, input.model)} CLI exited with code ${input.exitCode} after ${seconds}s`;
30516
30601
  const detailLines = [];
30517
30602
  if (isFastFail(input)) detailLines.push(...fastFailHint(command));
30518
30603
  detailLines.push(...outputDetail(input));
@@ -30616,30 +30701,34 @@ function summariseStderr(stderr) {
30616
30701
  const trimmed = firstLine2.trim();
30617
30702
  return trimmed.length > SUMMARY_MAX_LEN ? `${trimmed.slice(0, SUMMARY_MAX_LEN - 1)}\u2026` : trimmed;
30618
30703
  }
30619
- function finaliseReviewerSpinner(spinner, name, exitCode, elapsedMs, stderr = "") {
30620
- const elapsed = Math.round(elapsedMs / 1e3);
30621
- if (exitCode === 0) {
30622
- spinner.succeed(`${name} \u2014 done in ${elapsed}s`);
30704
+ function finaliseReviewerSpinner(spinner, outcome) {
30705
+ const label2 = reviewerLabel(outcome.name, outcome.model);
30706
+ const elapsed = Math.round(outcome.elapsedMs / 1e3);
30707
+ if (outcome.exitCode === 0) {
30708
+ spinner.succeed(`${label2} \u2014 done in ${elapsed}s`);
30623
30709
  return;
30624
30710
  }
30625
- const summary = summariseStderr(stderr);
30711
+ const summary = summariseStderr(outcome.stderr ?? "");
30626
30712
  const suffix = summary ? `: ${summary}` : "";
30627
- spinner.fail(`${name} \u2014 failed in ${elapsed}s (exit ${exitCode})${suffix}`);
30713
+ spinner.fail(
30714
+ `${label2} \u2014 failed in ${elapsed}s (exit ${outcome.exitCode})${suffix}`
30715
+ );
30628
30716
  }
30629
30717
 
30630
30718
  // src/commands/review/finaliseReviewerRun.ts
30631
30719
  function finaliseReviewerRun(spec, spinner, result) {
30632
30720
  if (spinner)
30633
- finaliseReviewerSpinner(
30634
- spinner,
30635
- spec.name,
30636
- result.exitCode,
30637
- result.elapsedMs,
30638
- result.stderr
30639
- );
30721
+ finaliseReviewerSpinner(spinner, {
30722
+ name: spec.name,
30723
+ model: spec.model,
30724
+ exitCode: result.exitCode,
30725
+ elapsedMs: result.elapsedMs,
30726
+ stderr: result.stderr
30727
+ });
30640
30728
  return {
30641
30729
  name: spec.name,
30642
30730
  command: spec.command,
30731
+ model: spec.model,
30643
30732
  outputPath: spec.outputPath,
30644
30733
  exitCode: result.exitCode,
30645
30734
  stderr: result.stderr,
@@ -30791,6 +30880,7 @@ function logChildClose(args) {
30791
30880
  const diagnostic = formatReviewerFailure({
30792
30881
  name: args.name,
30793
30882
  command: args.command,
30883
+ model: args.model,
30794
30884
  exitCode: args.exitCode,
30795
30885
  stderr: args.stderr,
30796
30886
  stdout: args.stdout,
@@ -30808,6 +30898,7 @@ function handleChildClose(args) {
30808
30898
  logChildClose({
30809
30899
  name: args.name,
30810
30900
  command: args.command,
30901
+ model: args.model,
30811
30902
  exitCode,
30812
30903
  elapsedMs,
30813
30904
  stderr: args.stderr,
@@ -30857,6 +30948,7 @@ function onCloseResult(ctx, code) {
30857
30948
  startedAt: ctx.startedAt,
30858
30949
  name: ctx.name,
30859
30950
  command: ctx.command,
30951
+ model: ctx.model,
30860
30952
  stderr: ctx.stderr.value,
30861
30953
  stdout: ctx.stdout.value,
30862
30954
  quiet: ctx.quiet
@@ -30909,6 +31001,7 @@ function runStreamingChild(spec) {
30909
31001
  stdout,
30910
31002
  name: spec.name,
30911
31003
  command: spec.command,
31004
+ model: spec.model,
30912
31005
  startedAt,
30913
31006
  quiet: spec.quiet ?? false
30914
31007
  });
@@ -30960,9 +31053,6 @@ function resolveClaude(args) {
30960
31053
  });
30961
31054
  }
30962
31055
 
30963
- // src/commands/review/runCodexReviewer.ts
30964
- import { existsSync as existsSync62, unlinkSync as unlinkSync18 } from "fs";
30965
-
30966
31056
  // src/commands/review/buildCodexModelArgs.ts
30967
31057
  var API_KEY_ENV = "ASSIST_LITELLM_API_KEY";
30968
31058
  function buildCodexModelArgs() {
@@ -30983,10 +31073,14 @@ function buildCodexModelArgs() {
30983
31073
  "-m",
30984
31074
  model
30985
31075
  ],
30986
- env: { [API_KEY_ENV]: config.apiKey }
31076
+ env: { [API_KEY_ENV]: config.apiKey },
31077
+ model
30987
31078
  };
30988
31079
  }
30989
31080
 
31081
+ // src/commands/review/runCodexReviewer.ts
31082
+ import { existsSync as existsSync62, unlinkSync as unlinkSync18 } from "fs";
31083
+
30990
31084
  // src/commands/review/parseCodexEvent.ts
30991
31085
  function isItemStarted(value) {
30992
31086
  return typeof value === "object" && value !== null && value.type === "item.started";
@@ -31024,12 +31118,12 @@ function codexArgs(outputPath, modelArgs) {
31024
31118
  ];
31025
31119
  }
31026
31120
  async function runCodexReviewer(spec) {
31027
- const { spinner } = spec;
31121
+ const { spinner, override } = spec;
31028
31122
  const command = "codex";
31029
- const override = buildCodexModelArgs();
31030
31123
  const result = await runStreamingChild({
31031
31124
  name: spec.name,
31032
31125
  command,
31126
+ model: override.model,
31033
31127
  args: codexArgs(spec.outputPath, override.args),
31034
31128
  stdin: spec.stdin,
31035
31129
  quiet: Boolean(spinner),
@@ -31043,7 +31137,16 @@ async function runCodexReviewer(spec) {
31043
31137
  if (result.exitCode !== 0 && existsSync62(spec.outputPath)) {
31044
31138
  unlinkSync18(spec.outputPath);
31045
31139
  }
31046
- return finaliseReviewerRun({ ...spec, command }, spinner, result);
31140
+ return finaliseReviewerRun(
31141
+ {
31142
+ name: spec.name,
31143
+ command,
31144
+ model: override.model,
31145
+ outputPath: spec.outputPath
31146
+ },
31147
+ spinner,
31148
+ result
31149
+ );
31047
31150
  }
31048
31151
 
31049
31152
  // src/commands/review/resolveCodex.ts
@@ -31052,11 +31155,15 @@ function resolveCodex(args) {
31052
31155
  if (args.plan.kind === "skipped") {
31053
31156
  return Promise.resolve(skippedCodexResult(args.codexPath));
31054
31157
  }
31055
- const spinner = args.multi?.create("codex \u2014 starting");
31158
+ const override = buildCodexModelArgs();
31159
+ const spinner = args.multi?.create(
31160
+ `${reviewerLabel("codex", override.model)} \u2014 starting`
31161
+ );
31056
31162
  return runCodexReviewer({
31057
31163
  name: "codex",
31058
31164
  stdin: args.stdin,
31059
31165
  outputPath: args.codexPath,
31166
+ override,
31060
31167
  spinner
31061
31168
  });
31062
31169
  }
@@ -31387,7 +31494,7 @@ function registerReview(program2) {
31387
31494
 
31388
31495
  // src/commands/rules/addRule.ts
31389
31496
  import { existsSync as existsSync66, readFileSync as readFileSync51, writeFileSync as writeFileSync41 } from "fs";
31390
- import path71 from "path";
31497
+ import path72 from "path";
31391
31498
  import chalk211 from "chalk";
31392
31499
 
31393
31500
  // src/commands/rules/insertRuleBullet.ts
@@ -31415,7 +31522,7 @@ import { readFileSync as readFileSync48 } from "fs";
31415
31522
 
31416
31523
  // src/commands/rules/findClaudeFiles.ts
31417
31524
  import { readdirSync as readdirSync13 } from "fs";
31418
- import path67 from "path";
31525
+ import path68 from "path";
31419
31526
  var SKIP_DIRECTORIES = /* @__PURE__ */ new Set(["node_modules", "dist", "build", "coverage"]);
31420
31527
  function findClaudeFiles(dir) {
31421
31528
  const results = [];
@@ -31423,9 +31530,9 @@ function findClaudeFiles(dir) {
31423
31530
  if (entry.isDirectory()) {
31424
31531
  if (entry.name.startsWith(".") || SKIP_DIRECTORIES.has(entry.name))
31425
31532
  continue;
31426
- results.push(...findClaudeFiles(path67.join(dir, entry.name)));
31533
+ results.push(...findClaudeFiles(path68.join(dir, entry.name)));
31427
31534
  } else if (entry.name === "CLAUDE.md") {
31428
- results.push(path67.join(dir, entry.name));
31535
+ results.push(path68.join(dir, entry.name));
31429
31536
  }
31430
31537
  }
31431
31538
  return results;
@@ -31444,34 +31551,34 @@ function nextRuleCode(root) {
31444
31551
 
31445
31552
  // src/commands/rules/resolveRuleScope.ts
31446
31553
  import { existsSync as existsSync64 } from "fs";
31447
- import path68 from "path";
31554
+ import path69 from "path";
31448
31555
  function resolveRuleScope(target) {
31449
- const resolved = path68.resolve(target);
31450
- if (path68.basename(resolved) === "CLAUDE.md") return resolved;
31556
+ const resolved = path69.resolve(target);
31557
+ if (path69.basename(resolved) === "CLAUDE.md") return resolved;
31451
31558
  const startDir = scopeDirectory(resolved);
31452
31559
  const root = findRepoRoot(startDir) ?? startDir;
31453
31560
  let current = startDir;
31454
31561
  while (true) {
31455
- const candidate = path68.join(current, "CLAUDE.md");
31562
+ const candidate = path69.join(current, "CLAUDE.md");
31456
31563
  if (existsSync64(candidate)) return candidate;
31457
- if (current === root || current === path68.dirname(current)) break;
31458
- current = path68.dirname(current);
31564
+ if (current === root || current === path69.dirname(current)) break;
31565
+ current = path69.dirname(current);
31459
31566
  }
31460
- return path68.join(root, "CLAUDE.md");
31567
+ return path69.join(root, "CLAUDE.md");
31461
31568
  }
31462
31569
 
31463
31570
  // src/commands/rules/updateScopedRulesIndex.ts
31464
31571
  import { existsSync as existsSync65, readFileSync as readFileSync50, writeFileSync as writeFileSync40 } from "fs";
31465
- import path70 from "path";
31572
+ import path71 from "path";
31466
31573
 
31467
31574
  // src/commands/rules/scopedRuleDirectories.ts
31468
31575
  import { readFileSync as readFileSync49 } from "fs";
31469
- import path69 from "path";
31576
+ import path70 from "path";
31470
31577
  function scopedRuleDirectories(root) {
31471
31578
  return findClaudeFiles(root).filter(
31472
- (file) => path69.dirname(file) !== root && parseRulesSection(readFileSync49(file, "utf8")).length > 0
31579
+ (file) => path70.dirname(file) !== root && parseRulesSection(readFileSync49(file, "utf8")).length > 0
31473
31580
  ).map(
31474
- (file) => `${path69.relative(root, path69.dirname(file)).split(path69.sep).join("/")}/`
31581
+ (file) => `${path70.relative(root, path70.dirname(file)).split(path70.sep).join("/")}/`
31475
31582
  ).sort();
31476
31583
  }
31477
31584
 
@@ -31510,7 +31617,7 @@ function upsertScopedRulesPointer(content, directories) {
31510
31617
  // src/commands/rules/updateScopedRulesIndex.ts
31511
31618
  function updateScopedRulesIndex(root) {
31512
31619
  const directories = scopedRuleDirectories(root);
31513
- const rootFile = path70.join(root, "CLAUDE.md");
31620
+ const rootFile = path71.join(root, "CLAUDE.md");
31514
31621
  const before = existsSync65(rootFile) ? readFileSync50(rootFile, "utf8") : "";
31515
31622
  const after = upsertScopedRulesPointer(before, directories);
31516
31623
  if (after !== before) writeFileSync40(rootFile, after);
@@ -31529,7 +31636,7 @@ function addRule(text18, options2) {
31529
31636
  return;
31530
31637
  }
31531
31638
  const target = resolveRuleScope(options2.scope ?? process.cwd());
31532
- const targetDir = path71.dirname(target);
31639
+ const targetDir = path72.dirname(target);
31533
31640
  const root = findRepoRoot(targetDir) ?? targetDir;
31534
31641
  const code = nextRuleCode(root);
31535
31642
  writeFileSync41(
@@ -31542,18 +31649,18 @@ function addRule(text18, options2) {
31542
31649
  );
31543
31650
  updateScopedRulesIndex(root);
31544
31651
  console.log(
31545
- `Added ${chalk211.cyan(code)} to ${path71.relative(process.cwd(), target) || target}`
31652
+ `Added ${chalk211.cyan(code)} to ${path72.relative(process.cwd(), target) || target}`
31546
31653
  );
31547
31654
  }
31548
31655
 
31549
31656
  // src/commands/rules/indexRules.ts
31550
- import path72 from "path";
31657
+ import path73 from "path";
31551
31658
  import chalk212 from "chalk";
31552
31659
  function indexRules() {
31553
31660
  const startDir = scopeDirectory(process.cwd());
31554
31661
  const root = findRepoRoot(startDir) ?? startDir;
31555
31662
  const directories = updateScopedRulesIndex(root);
31556
- const rootFile = path72.relative(process.cwd(), path72.join(root, "CLAUDE.md"));
31663
+ const rootFile = path73.relative(process.cwd(), path73.join(root, "CLAUDE.md"));
31557
31664
  if (directories.length === 0) {
31558
31665
  console.log(
31559
31666
  chalk212.gray(`No directories carry their own \`## Rules\` under ${root}`)
@@ -31566,13 +31673,13 @@ function indexRules() {
31566
31673
  }
31567
31674
 
31568
31675
  // src/commands/rules/listRules.ts
31569
- import path73 from "path";
31676
+ import path74 from "path";
31570
31677
  import chalk213 from "chalk";
31571
31678
  function listRules(target, options2 = {}) {
31572
- const resolved = path73.resolve(target ?? process.cwd());
31679
+ const resolved = path74.resolve(target ?? process.cwd());
31573
31680
  const rules3 = readScopedRules(resolved);
31574
31681
  if (rules3.length === 0) {
31575
- const label2 = path73.relative(process.cwd(), resolved) || ".";
31682
+ const label2 = path74.relative(process.cwd(), resolved) || ".";
31576
31683
  console.log(chalk213.gray(`No rules in scope for ${label2}`));
31577
31684
  return;
31578
31685
  }
@@ -31583,7 +31690,7 @@ function listRules(target, options2 = {}) {
31583
31690
  if (rule.source !== shown) {
31584
31691
  shown = rule.source;
31585
31692
  console.log(
31586
- chalk213.dim(base ? path73.relative(base, rule.source) : rule.source)
31693
+ chalk213.dim(base ? path74.relative(base, rule.source) : rule.source)
31587
31694
  );
31588
31695
  }
31589
31696
  console.log(
@@ -31679,8 +31786,8 @@ import chalk219 from "chalk";
31679
31786
 
31680
31787
  // src/commands/seq/fetchSeq.ts
31681
31788
  import chalk216 from "chalk";
31682
- async function fetchSeq(conn, path90, params) {
31683
- const url = `${conn.url}${path90}?${params}`;
31789
+ async function fetchSeq(conn, path91, params) {
31790
+ const url = `${conn.url}${path91}?${params}`;
31684
31791
  const response = await fetch(url, {
31685
31792
  headers: {
31686
31793
  Accept: "application/json",
@@ -32332,15 +32439,15 @@ function registerSql(program2) {
32332
32439
  // src/commands/sync.ts
32333
32440
  import * as fs48 from "fs";
32334
32441
  import * as os5 from "os";
32335
- import * as path84 from "path";
32442
+ import * as path85 from "path";
32336
32443
  import { fileURLToPath as fileURLToPath8 } from "url";
32337
32444
 
32338
32445
  // src/commands/sync/pruneCommands.ts
32339
- import * as path75 from "path";
32446
+ import * as path76 from "path";
32340
32447
 
32341
32448
  // src/commands/sync/pruneTarget.ts
32342
32449
  import * as fs40 from "fs";
32343
- import * as path74 from "path";
32450
+ import * as path75 from "path";
32344
32451
  function pruneTarget(targetDir, keepNames, shape, options2) {
32345
32452
  const result = {
32346
32453
  orphans: [],
@@ -32358,7 +32465,7 @@ function pruneTarget(targetDir, keepNames, shape, options2) {
32358
32465
  }
32359
32466
  if (keep.has(name)) continue;
32360
32467
  result.orphans.push(entry.name);
32361
- const entryPath = path74.join(targetDir, entry.name);
32468
+ const entryPath = path75.join(targetDir, entry.name);
32362
32469
  const reason4 = shape.blockedBy?.(entryPath);
32363
32470
  if (reason4) {
32364
32471
  result.skipped.push({ name: entry.name, reason: reason4 });
@@ -32378,7 +32485,7 @@ function pruneCommands(targetDir, commandNames, options2) {
32378
32485
  targetDir,
32379
32486
  commandNames,
32380
32487
  {
32381
- nameOf: (entry) => entry.isFile() && entry.name.endsWith(".md") ? path75.basename(entry.name, ".md") : void 0
32488
+ nameOf: (entry) => entry.isFile() && entry.name.endsWith(".md") ? path76.basename(entry.name, ".md") : void 0
32382
32489
  },
32383
32490
  options2
32384
32491
  );
@@ -32413,11 +32520,11 @@ function reportPrune(label2, result, force) {
32413
32520
 
32414
32521
  // src/commands/sync/syncClaudeMd.ts
32415
32522
  import * as fs41 from "fs";
32416
- import * as path76 from "path";
32523
+ import * as path77 from "path";
32417
32524
  import chalk226 from "chalk";
32418
32525
  async function syncClaudeMd(claudeDir, targetBase, options2) {
32419
- const source = path76.join(claudeDir, "CLAUDE.md");
32420
- const target = path76.join(targetBase, "CLAUDE.md");
32526
+ const source = path77.join(claudeDir, "CLAUDE.md");
32527
+ const target = path77.join(targetBase, "CLAUDE.md");
32421
32528
  const sourceContent = fs41.readFileSync(source, "utf8");
32422
32529
  if (fs41.existsSync(target)) {
32423
32530
  const targetContent = fs41.readFileSync(target, "utf8");
@@ -32445,13 +32552,13 @@ async function syncClaudeMd(claudeDir, targetBase, options2) {
32445
32552
  }
32446
32553
 
32447
32554
  // src/commands/sync/syncCodex.ts
32448
- import * as path79 from "path";
32555
+ import * as path80 from "path";
32449
32556
 
32450
32557
  // src/commands/sync/installHarnessCommands.ts
32451
32558
  import * as fs42 from "fs";
32452
- import * as path77 from "path";
32559
+ import * as path78 from "path";
32453
32560
  function installHarnessCommands(claudeDir, harness, transform) {
32454
- const commandsSource = path77.join(claudeDir, "commands");
32561
+ const commandsSource = path78.join(claudeDir, "commands");
32455
32562
  const files = fs42.readdirSync(commandsSource);
32456
32563
  const names = [];
32457
32564
  let synced = 0;
@@ -32459,15 +32566,15 @@ function installHarnessCommands(claudeDir, harness, transform) {
32459
32566
  if (!file.endsWith(".md")) continue;
32460
32567
  const name = file.replace(/\.md$/, "");
32461
32568
  names.push(name);
32462
- const content = fs42.readFileSync(path77.join(commandsSource, file), "utf8");
32463
- const target = path77.join(harness.homeDir, harness.sync.commandDest(name));
32464
- fs42.mkdirSync(path77.dirname(target), { recursive: true });
32569
+ const content = fs42.readFileSync(path78.join(commandsSource, file), "utf8");
32570
+ const target = path78.join(harness.homeDir, harness.sync.commandDest(name));
32571
+ fs42.mkdirSync(path78.dirname(target), { recursive: true });
32465
32572
  fs42.writeFileSync(target, transform(name, content));
32466
32573
  synced++;
32467
32574
  }
32468
- const agentsTarget = path77.join(harness.homeDir, harness.sync.agentsFile);
32469
- fs42.mkdirSync(path77.dirname(agentsTarget), { recursive: true });
32470
- fs42.copyFileSync(path77.join(claudeDir, "CLAUDE.md"), agentsTarget);
32575
+ const agentsTarget = path78.join(harness.homeDir, harness.sync.agentsFile);
32576
+ fs42.mkdirSync(path78.dirname(agentsTarget), { recursive: true });
32577
+ fs42.copyFileSync(path78.join(claudeDir, "CLAUDE.md"), agentsTarget);
32471
32578
  return { total: files.length, synced, names };
32472
32579
  }
32473
32580
 
@@ -32493,7 +32600,7 @@ function unexpectedContent(skillDir) {
32493
32600
 
32494
32601
  // src/commands/sync/syncCodexHooks.ts
32495
32602
  import * as fs44 from "fs";
32496
- import * as path78 from "path";
32603
+ import * as path79 from "path";
32497
32604
  var BEGIN = "# >>> assist codex hooks (managed) \u2014 do not edit >>>";
32498
32605
  var END = "# <<< assist codex hooks (managed) <<<";
32499
32606
  function upsertManagedBlock(existing, body) {
@@ -32524,9 +32631,9 @@ ${rest}
32524
32631
  }
32525
32632
  function syncCodexHooks(sourcePath) {
32526
32633
  const body = fs44.readFileSync(sourcePath, "utf8");
32527
- const configPath = path78.join(harnesses.codex.homeDir, "config.toml");
32634
+ const configPath = path79.join(harnesses.codex.homeDir, "config.toml");
32528
32635
  const existing = fs44.existsSync(configPath) ? fs44.readFileSync(configPath, "utf8") : "";
32529
- fs44.mkdirSync(path78.dirname(configPath), { recursive: true });
32636
+ fs44.mkdirSync(path79.dirname(configPath), { recursive: true });
32530
32637
  fs44.writeFileSync(configPath, upsertManagedBlock(existing, body));
32531
32638
  console.log(
32532
32639
  "Registered assist codex-hook in ~/.codex/config.toml (UserPromptSubmit, PreToolUse, PostToolUse, PermissionRequest, Stop)"
@@ -32558,7 +32665,7 @@ function syncCodex(claudeDir, options2) {
32558
32665
  harnesses.codex,
32559
32666
  commandToSkill
32560
32667
  );
32561
- syncCodexHooks(path79.join(claudeDir, "..", "codex", "config.toml"));
32668
+ syncCodexHooks(path80.join(claudeDir, "..", "codex", "config.toml"));
32562
32669
  console.log(
32563
32670
  `Synced ${total} skill(s) to ~/.codex/skills and CLAUDE.md to ~/.codex/AGENTS.md`
32564
32671
  );
@@ -32566,42 +32673,42 @@ function syncCodex(claudeDir, options2) {
32566
32673
  const force = options2.force ?? false;
32567
32674
  reportPrune(
32568
32675
  "~/.codex/skills",
32569
- pruneSkills(path79.join(harnesses.codex.homeDir, "skills"), names, { force }),
32676
+ pruneSkills(path80.join(harnesses.codex.homeDir, "skills"), names, { force }),
32570
32677
  force
32571
32678
  );
32572
32679
  }
32573
32680
 
32574
32681
  // src/commands/sync/syncDesign.ts
32575
32682
  import * as fs45 from "fs";
32576
- import * as path80 from "path";
32683
+ import * as path81 from "path";
32577
32684
  function syncDesign(claudeDir, targetBase) {
32578
- const systemPromptSource = path80.join(claudeDir, "design-system-prompt.md");
32579
- const systemPromptTarget = path80.join(targetBase, "design-system-prompt.md");
32685
+ const systemPromptSource = path81.join(claudeDir, "design-system-prompt.md");
32686
+ const systemPromptTarget = path81.join(targetBase, "design-system-prompt.md");
32580
32687
  fs45.copyFileSync(systemPromptSource, systemPromptTarget);
32581
32688
  console.log(
32582
32689
  "Copied design-system-prompt.md to ~/.claude/design-system-prompt.md"
32583
32690
  );
32584
- const skillsSource = path80.join(claudeDir, "skills");
32585
- const skillsTarget = path80.join(targetBase, "skills");
32691
+ const skillsSource = path81.join(claudeDir, "skills");
32692
+ const skillsTarget = path81.join(targetBase, "skills");
32586
32693
  fs45.mkdirSync(skillsTarget, { recursive: true });
32587
32694
  const files = fs45.readdirSync(skillsSource);
32588
32695
  for (const file of files) {
32589
32696
  fs45.copyFileSync(
32590
- path80.join(skillsSource, file),
32591
- path80.join(skillsTarget, file)
32697
+ path81.join(skillsSource, file),
32698
+ path81.join(skillsTarget, file)
32592
32699
  );
32593
32700
  }
32594
32701
  console.log(`Synced ${files.length} design skill(s) to ~/.claude/skills`);
32595
32702
  }
32596
32703
 
32597
32704
  // src/commands/sync/syncPi.ts
32598
- import * as path82 from "path";
32705
+ import * as path83 from "path";
32599
32706
 
32600
32707
  // src/commands/sync/syncPiHooks.ts
32601
32708
  import * as fs46 from "fs";
32602
- import * as path81 from "path";
32709
+ import * as path82 from "path";
32603
32710
  function piExtensionsDir() {
32604
- return path81.join(harnesses.pi.homeDir, "extensions");
32711
+ return path82.join(harnesses.pi.homeDir, "extensions");
32605
32712
  }
32606
32713
  function syncPiHooks(sourceDir) {
32607
32714
  const target = piExtensionsDir();
@@ -32609,8 +32716,8 @@ function syncPiHooks(sourceDir) {
32609
32716
  const files = fs46.readdirSync(sourceDir).filter((f) => f.endsWith(".ts"));
32610
32717
  for (const file of files) {
32611
32718
  fs46.copyFileSync(
32612
- path81.join(sourceDir, file),
32613
- path81.join(target, `assist-${file}`)
32719
+ path82.join(sourceDir, file),
32720
+ path82.join(target, `assist-${file}`)
32614
32721
  );
32615
32722
  }
32616
32723
  console.log(
@@ -32647,7 +32754,7 @@ function syncPi(claudeDir, options2) {
32647
32754
  harnesses.pi,
32648
32755
  commandToPrompt
32649
32756
  );
32650
- syncPiHooks(path82.join(claudeDir, "..", "pi"));
32757
+ syncPiHooks(path83.join(claudeDir, "..", "pi"));
32651
32758
  console.log(
32652
32759
  `Synced ${synced} prompt(s) to ~/.pi/agent/prompts and CLAUDE.md to ~/.pi/agent/AGENTS.md`
32653
32760
  );
@@ -32655,18 +32762,18 @@ function syncPi(claudeDir, options2) {
32655
32762
  const force = options2.force ?? false;
32656
32763
  reportPrune(
32657
32764
  "~/.pi/agent/prompts",
32658
- pruneCommands(path82.join(harnesses.pi.homeDir, "prompts"), names, { force }),
32765
+ pruneCommands(path83.join(harnesses.pi.homeDir, "prompts"), names, { force }),
32659
32766
  force
32660
32767
  );
32661
32768
  }
32662
32769
 
32663
32770
  // src/commands/sync/syncSettings.ts
32664
32771
  import * as fs47 from "fs";
32665
- import * as path83 from "path";
32772
+ import * as path84 from "path";
32666
32773
  import chalk227 from "chalk";
32667
32774
  async function syncSettings(claudeDir, targetBase, options2) {
32668
- const source = path83.join(claudeDir, "settings.json");
32669
- const target = path83.join(targetBase, "settings.json");
32775
+ const source = path84.join(claudeDir, "settings.json");
32776
+ const target = path84.join(targetBase, "settings.json");
32670
32777
  const sourceContent = fs47.readFileSync(source, "utf8");
32671
32778
  const sourceSettings = JSON.parse(sourceContent);
32672
32779
  const targetExists = fs47.existsSync(target);
@@ -32706,13 +32813,13 @@ async function syncSettings(claudeDir, targetBase, options2) {
32706
32813
 
32707
32814
  // src/commands/sync.ts
32708
32815
  var __filename4 = fileURLToPath8(import.meta.url);
32709
- var __dirname5 = path84.dirname(__filename4);
32816
+ var __dirname5 = path85.dirname(__filename4);
32710
32817
  async function sync(options2) {
32711
32818
  const config = loadConfig();
32712
32819
  const yes = options2?.yes ?? config.sync.autoConfirm;
32713
32820
  const prune = { prune: options2?.prune, force: options2?.force };
32714
- const claudeDir = path84.join(__dirname5, "..", "claude");
32715
- const targetBase = path84.join(os5.homedir(), ".claude");
32821
+ const claudeDir = path85.join(__dirname5, "..", "claude");
32822
+ const targetBase = path85.join(os5.homedir(), ".claude");
32716
32823
  const commandFiles = syncCommands(claudeDir, targetBase);
32717
32824
  syncDesign(claudeDir, targetBase);
32718
32825
  await syncSettings(claudeDir, targetBase, { yes });
@@ -32720,21 +32827,21 @@ async function sync(options2) {
32720
32827
  syncCodex(claudeDir, prune);
32721
32828
  syncPi(claudeDir, prune);
32722
32829
  if (!options2?.prune) return;
32723
- const commandNames = commandFiles.filter((file) => file.endsWith(".md")).map((file) => path84.basename(file, ".md"));
32830
+ const commandNames = commandFiles.filter((file) => file.endsWith(".md")).map((file) => path85.basename(file, ".md"));
32724
32831
  const force = options2.force ?? false;
32725
32832
  reportPrune(
32726
32833
  "~/.claude/commands",
32727
- pruneCommands(path84.join(targetBase, "commands"), commandNames, { force }),
32834
+ pruneCommands(path85.join(targetBase, "commands"), commandNames, { force }),
32728
32835
  force
32729
32836
  );
32730
32837
  }
32731
32838
  function syncCommands(claudeDir, targetBase) {
32732
- const sourceDir = path84.join(claudeDir, "commands");
32733
- const targetDir = path84.join(targetBase, "commands");
32839
+ const sourceDir = path85.join(claudeDir, "commands");
32840
+ const targetDir = path85.join(targetBase, "commands");
32734
32841
  fs48.mkdirSync(targetDir, { recursive: true });
32735
32842
  const files = fs48.readdirSync(sourceDir);
32736
32843
  for (const file of files) {
32737
- fs48.copyFileSync(path84.join(sourceDir, file), path84.join(targetDir, file));
32844
+ fs48.copyFileSync(path85.join(sourceDir, file), path85.join(targetDir, file));
32738
32845
  console.log(`Copied ${file} to ${targetDir}`);
32739
32846
  }
32740
32847
  console.log(`Synced ${files.length} command(s) to ~/.claude/commands`);
@@ -33137,7 +33244,7 @@ function list4() {
33137
33244
 
33138
33245
  // src/commands/transcript/move.ts
33139
33246
  import { existsSync as existsSync73, mkdirSync as mkdirSync28, renameSync as renameSync2, writeFileSync as writeFileSync46 } from "fs";
33140
- import { basename as basename21, join as join85 } from "path";
33247
+ import { basename as basename22, join as join85 } from "path";
33141
33248
 
33142
33249
  // src/commands/transcript/convertVttToMarkdown.ts
33143
33250
  function convertVttToMarkdown(inputPath) {
@@ -33158,13 +33265,13 @@ function move(file, options2) {
33158
33265
  process.exit(1);
33159
33266
  }
33160
33267
  const { vttDir, transcriptsDir, summaryDir } = getTranscriptConfig();
33161
- const filename = basename21(file);
33268
+ const filename = basename22(file);
33162
33269
  const sourcePath = join85(vttDir, filename);
33163
33270
  if (!existsSync73(sourcePath)) {
33164
33271
  console.error(`Error: VTT file not found: ${sourcePath}`);
33165
33272
  process.exit(1);
33166
33273
  }
33167
- const base = basename21(filename, ".vtt").replace(/ Transcription$/, "");
33274
+ const base = basename22(filename, ".vtt").replace(/ Transcription$/, "");
33168
33275
  const outputName = `${date} ${base}.md`;
33169
33276
  const formattedDir = join85(transcriptsDir, client);
33170
33277
  mkdirSync28(formattedDir, { recursive: true });
@@ -33178,7 +33285,7 @@ function move(file, options2) {
33178
33285
 
33179
33286
  // src/commands/transcript/merge.ts
33180
33287
  import { existsSync as existsSync74, writeFileSync as writeFileSync47 } from "fs";
33181
- import { basename as basename22 } from "path";
33288
+ import { basename as basename23 } from "path";
33182
33289
 
33183
33290
  // src/commands/transcript/failTranscript.ts
33184
33291
  function failTranscript(message3) {
@@ -33324,7 +33431,7 @@ function readSource2(file) {
33324
33431
  if (!existsSync74(file)) failTranscript(`VTT file not found: ${file}`);
33325
33432
  const cues = readCleanedCues(file);
33326
33433
  if (cues.length === 0) failTranscript(`no cues found in: ${file}`);
33327
- return { path: file, name: basename22(file), cues };
33434
+ return { path: file, name: basename23(file), cues };
33328
33435
  }
33329
33436
  function wholePassages(sources) {
33330
33437
  return sources.map((source) => ({
@@ -33853,11 +33960,11 @@ var webUiPrefix = "src/commands/sessions/web/ui/";
33853
33960
  var sessionsPrefix = "src/commands/sessions/";
33854
33961
  var rules = [
33855
33962
  {
33856
- matches: (path90) => path90.startsWith(webUiPrefix),
33963
+ matches: (path91) => path91.startsWith(webUiPrefix),
33857
33964
  advice: "restart the web server, then hard-reload the browser tab"
33858
33965
  },
33859
33966
  {
33860
- matches: (path90) => path90.startsWith(sessionsPrefix) && !path90.startsWith(webUiPrefix),
33967
+ matches: (path91) => path91.startsWith(sessionsPrefix) && !path91.startsWith(webUiPrefix),
33861
33968
  advice: "restart the daemon"
33862
33969
  }
33863
33970
  ];
@@ -33868,31 +33975,31 @@ function restartAdvice(paths) {
33868
33975
  // src/commands/watch/syncAdvice.ts
33869
33976
  var rules2 = [
33870
33977
  {
33871
- matches: (path90) => path90.startsWith("claude/commands/"),
33978
+ matches: (path91) => path91.startsWith("claude/commands/"),
33872
33979
  reason: "claude/commands changed"
33873
33980
  },
33874
33981
  {
33875
- matches: (path90) => path90.startsWith("claude/skills/"),
33982
+ matches: (path91) => path91.startsWith("claude/skills/"),
33876
33983
  reason: "claude/skills changed"
33877
33984
  },
33878
33985
  {
33879
- matches: (path90) => path90 === "claude/settings.json",
33986
+ matches: (path91) => path91 === "claude/settings.json",
33880
33987
  reason: "claude/settings.json changed"
33881
33988
  },
33882
33989
  {
33883
- matches: (path90) => path90 === "claude/CLAUDE.md",
33990
+ matches: (path91) => path91 === "claude/CLAUDE.md",
33884
33991
  reason: "claude/CLAUDE.md changed"
33885
33992
  },
33886
33993
  {
33887
- matches: (path90) => path90 === "claude/design-system-prompt.md",
33994
+ matches: (path91) => path91 === "claude/design-system-prompt.md",
33888
33995
  reason: "claude/design-system-prompt.md changed"
33889
33996
  },
33890
33997
  {
33891
- matches: (path90) => path90.startsWith("codex/"),
33998
+ matches: (path91) => path91.startsWith("codex/"),
33892
33999
  reason: "codex sources changed"
33893
34000
  },
33894
34001
  {
33895
- matches: (path90) => path90.startsWith("pi/"),
34002
+ matches: (path91) => path91.startsWith("pi/"),
33896
34003
  reason: "pi sources changed"
33897
34004
  }
33898
34005
  ];
@@ -34600,9 +34707,9 @@ function findPortFile(roamDir) {
34600
34707
  return void 0;
34601
34708
  }
34602
34709
  const candidates = entries.filter((name) => /^roam-local-api(-[^.]+)?\.port$/.test(name)).map((name) => {
34603
- const path90 = join93(roamDir, name);
34710
+ const path91 = join93(roamDir, name);
34604
34711
  try {
34605
- return { path: path90, mtimeMs: statSync12(path90).mtimeMs };
34712
+ return { path: path91, mtimeMs: statSync12(path91).mtimeMs };
34606
34713
  } catch {
34607
34714
  return void 0;
34608
34715
  }
@@ -34846,11 +34953,11 @@ function findLinkIndex() {
34846
34953
  function parseLinkArgs() {
34847
34954
  const idx = findLinkIndex();
34848
34955
  if (idx === -1) return null;
34849
- const path90 = process.argv[idx + 1];
34956
+ const path91 = process.argv[idx + 1];
34850
34957
  const rest = process.argv.slice(idx + 2);
34851
34958
  const { value: prefix2 } = extractOption(rest, "--prefix");
34852
34959
  if (!prefix2) return null;
34853
- return { path: path90, prefix: prefix2 };
34960
+ return { path: path91, prefix: prefix2 };
34854
34961
  }
34855
34962
  function hasDuplicateLink(runList, linkPath) {
34856
34963
  return runList.some(
@@ -35592,14 +35699,14 @@ import * as pty from "node-pty";
35592
35699
  // src/commands/sessions/daemon/ensureSpawnHelperExecutable.ts
35593
35700
  import { chmodSync, existsSync as existsSync85, statSync as statSync13 } from "fs";
35594
35701
  import { createRequire as createRequire3 } from "module";
35595
- import path85 from "path";
35702
+ import path86 from "path";
35596
35703
  var require4 = createRequire3(import.meta.url);
35597
35704
  var ensured = false;
35598
35705
  function ensureSpawnHelperExecutable() {
35599
35706
  if (ensured || process.platform !== "darwin") return;
35600
35707
  ensured = true;
35601
- const ptyRoot = path85.join(path85.dirname(require4.resolve("node-pty")), "..");
35602
- const helper = path85.join(
35708
+ const ptyRoot = path86.join(path86.dirname(require4.resolve("node-pty")), "..");
35709
+ const helper = path86.join(
35603
35710
  ptyRoot,
35604
35711
  "prebuilds",
35605
35712
  `${process.platform}-${process.arch}`,
@@ -35720,12 +35827,12 @@ function serverRunMeta(runName, cwd) {
35720
35827
 
35721
35828
  // src/commands/sessions/daemon/readDesignSystemPrompt.ts
35722
35829
  import * as fs49 from "fs";
35723
- import * as path86 from "path";
35830
+ import * as path87 from "path";
35724
35831
  import { fileURLToPath as fileURLToPath10 } from "url";
35725
35832
  var __filename5 = fileURLToPath10(import.meta.url);
35726
- var __dirname7 = path86.dirname(__filename5);
35833
+ var __dirname7 = path87.dirname(__filename5);
35727
35834
  function readDesignSystemPrompt() {
35728
- const promptPath = path86.join(
35835
+ const promptPath = path87.join(
35729
35836
  __dirname7,
35730
35837
  "..",
35731
35838
  "claude",
@@ -35824,7 +35931,7 @@ function setStatus2(session, newStatus) {
35824
35931
 
35825
35932
  // src/commands/sessions/daemon/worktree/reapWorktree.ts
35826
35933
  import { existsSync as existsSync88 } from "fs";
35827
- import { basename as basename23 } from "path";
35934
+ import { basename as basename24 } from "path";
35828
35935
 
35829
35936
  // src/commands/sessions/daemon/worktree/deleteStrandedTree.ts
35830
35937
  import { existsSync as existsSync87 } from "fs";
@@ -35967,7 +36074,7 @@ async function reapWorktree(worktreePath, force = false) {
35967
36074
  const clone = owningClone(worktreePath);
35968
36075
  const removal = await removeTree(clone, worktreePath, force);
35969
36076
  if (!removal.removed) return removal;
35970
- await deleteWorktreeBranch(clone, basename23(worktreePath));
36077
+ await deleteWorktreeBranch(clone, basename24(worktreePath));
35971
36078
  forgetWorktree(worktreePath);
35972
36079
  daemonLog(`worktree ${worktreePath} reaped${force ? " (forced)" : ""}`);
35973
36080
  return removal;
@@ -36721,8 +36828,8 @@ async function seedRunningMsFromUsage(session, notify2) {
36721
36828
  var DEBOUNCE_MS2 = 50;
36722
36829
  function watchActivity(session, notify2, onClaudeSessionId) {
36723
36830
  if (session.commandType !== "assist" || !session.cwd) return;
36724
- const path90 = activityPath(session.id);
36725
- const dir = dirname39(path90);
36831
+ const path91 = activityPath(session.id);
36832
+ const dir = dirname39(path91);
36726
36833
  try {
36727
36834
  mkdirSync34(dir, { recursive: true });
36728
36835
  } catch {
@@ -36732,7 +36839,7 @@ function watchActivity(session, notify2, onClaudeSessionId) {
36732
36839
  let timer = null;
36733
36840
  const read3 = () => {
36734
36841
  timer = null;
36735
- const activity2 = readActivity(path90);
36842
+ const activity2 = readActivity(path91);
36736
36843
  if (!activity2) return;
36737
36844
  applyActivityToSession(session, activity2);
36738
36845
  if (activity2.claudeSessionId) onClaudeSessionId?.(session);
@@ -36741,11 +36848,11 @@ function watchActivity(session, notify2, onClaudeSessionId) {
36741
36848
  notify2();
36742
36849
  };
36743
36850
  session.activityWatcher = watch2(dir, (_event, filename) => {
36744
- if (filename && !path90.endsWith(filename)) return;
36851
+ if (filename && !path91.endsWith(filename)) return;
36745
36852
  if (timer) clearTimeout(timer);
36746
36853
  timer = setTimeout(read3, DEBOUNCE_MS2);
36747
36854
  });
36748
- if (existsSync91(path90)) read3();
36855
+ if (existsSync91(path91)) read3();
36749
36856
  }
36750
36857
  function refreshActivity(session) {
36751
36858
  if (session.commandType !== "assist" || !session.cwd) return;
@@ -36888,12 +36995,12 @@ import { watch as watch3 } from "fs";
36888
36995
 
36889
36996
  // src/commands/sessions/shared/findTranscriptPathSync.ts
36890
36997
  import * as fs51 from "fs";
36891
- import * as path87 from "path";
36998
+ import * as path88 from "path";
36892
36999
  function projectDirForCwd(cwd) {
36893
- return path87.join(claudeProjectsRoot(), projectSlug(cwd));
37000
+ return path88.join(claudeProjectsRoot(), projectSlug(cwd));
36894
37001
  }
36895
37002
  function transcriptPathFor(cwd, claudeSessionId) {
36896
- return path87.join(projectDirForCwd(cwd), `${claudeSessionId}.jsonl`);
37003
+ return path88.join(projectDirForCwd(cwd), `${claudeSessionId}.jsonl`);
36897
37004
  }
36898
37005
  function findTranscriptPathSync(cwd, claudeSessionId) {
36899
37006
  const direct = transcriptPathFor(cwd, claudeSessionId);
@@ -36907,8 +37014,8 @@ function findTranscriptPathSync(cwd, claudeSessionId) {
36907
37014
  }
36908
37015
  for (const file of files) {
36909
37016
  if (!file.endsWith(".jsonl")) continue;
36910
- if (headContainsSessionId(path87.join(dir, file), claudeSessionId))
36911
- return path87.join(dir, file);
37017
+ if (headContainsSessionId(path88.join(dir, file), claudeSessionId))
37018
+ return path88.join(dir, file);
36912
37019
  }
36913
37020
  return null;
36914
37021
  }
@@ -38082,9 +38189,9 @@ function tempRoots() {
38082
38189
  }
38083
38190
  return [...roots];
38084
38191
  }
38085
- function underTempRoot(path90) {
38192
+ function underTempRoot(path91) {
38086
38193
  return tempRoots().some(
38087
- (root) => path90.startsWith(root.endsWith(sep2) ? root : root + sep2)
38194
+ (root) => path91.startsWith(root.endsWith(sep2) ? root : root + sep2)
38088
38195
  );
38089
38196
  }
38090
38197
 
@@ -38469,7 +38576,7 @@ function rearmStoppedSessions(sessions, notify2) {
38469
38576
 
38470
38577
  // src/commands/sessions/daemon/worktree/reconcileWorktreesOnRestore.ts
38471
38578
  import { existsSync as existsSync94 } from "fs";
38472
- import { basename as basename25 } from "path";
38579
+ import { basename as basename26 } from "path";
38473
38580
 
38474
38581
  // src/commands/sessions/daemon/worktree/accountedTrees.ts
38475
38582
  function accountedTrees(sessions) {
@@ -38526,15 +38633,15 @@ function bindResumedWorktree(session, cwd, notify2) {
38526
38633
  import { existsSync as existsSync93 } from "fs";
38527
38634
  async function reclaimVanishedWorktrees(clone, paths) {
38528
38635
  if (!existsSync93(clone)) {
38529
- for (const { path: path90 } of paths) forgetWorktree(path90);
38636
+ for (const { path: path91 } of paths) forgetWorktree(path91);
38530
38637
  daemonLog(
38531
38638
  `clone ${clone} is gone; forgot ${paths.length} worktree record(s) it owned`
38532
38639
  );
38533
38640
  return;
38534
38641
  }
38535
38642
  await pruneBookkeeping2(clone);
38536
- for (const { path: path90, branch: branch2 } of paths)
38537
- if (await reclaimBranch(clone, branch2)) forgetWorktree(path90);
38643
+ for (const { path: path91, branch: branch2 } of paths)
38644
+ if (await reclaimBranch(clone, branch2)) forgetWorktree(path91);
38538
38645
  }
38539
38646
  async function pruneBookkeeping2(clone) {
38540
38647
  try {
@@ -38561,37 +38668,37 @@ async function reclaimBranch(clone, branch2) {
38561
38668
  }
38562
38669
 
38563
38670
  // src/commands/sessions/daemon/worktree/logVanishedTree.ts
38564
- function logVanishedTree(sessions, path90) {
38671
+ function logVanishedTree(sessions, path91) {
38565
38672
  const claimants = [...sessions.values()].filter(
38566
- (s) => s.cwd === path90 || s.worktree?.path === path90
38673
+ (s) => s.cwd === path91 || s.worktree?.path === path91
38567
38674
  );
38568
38675
  if (claimants.length === 0) {
38569
- daemonLog(`worktree ${path90} gone from disk and unclaimed; reclaiming it`);
38676
+ daemonLog(`worktree ${path91} gone from disk and unclaimed; reclaiming it`);
38570
38677
  return;
38571
38678
  }
38572
38679
  for (const s of claimants)
38573
38680
  daemonLog(
38574
- `session ${s.id} ("${s.name}") claims worktree ${path90}, which is gone from disk; reclaiming it`
38681
+ `session ${s.id} ("${s.name}") claims worktree ${path91}, which is gone from disk; reclaiming it`
38575
38682
  );
38576
38683
  }
38577
38684
 
38578
38685
  // src/commands/sessions/daemon/worktree/describeHeldWork.ts
38579
38686
  var MAX_ITEMS = 20;
38580
- async function describeHeldWork(path90, reason4) {
38581
- if (reason4.startsWith("uncommitted")) return await changedFiles(path90);
38582
- if (reason4.startsWith("unpushed")) return await unpushedCommits(path90, reason4);
38687
+ async function describeHeldWork(path91, reason4) {
38688
+ if (reason4.startsWith("uncommitted")) return await changedFiles(path91);
38689
+ if (reason4.startsWith("unpushed")) return await unpushedCommits(path91, reason4);
38583
38690
  return { summary: reason4, items: [] };
38584
38691
  }
38585
- async function changedFiles(path90) {
38586
- const status3 = await gitResult(path90, ["status", "--porcelain"]);
38692
+ async function changedFiles(path91) {
38693
+ const status3 = await gitResult(path91, ["status", "--porcelain"]);
38587
38694
  const lines2 = status3.ok ? nonEmptyLines(status3.out) : [];
38588
38695
  return {
38589
38696
  summary: `${lines2.length} uncommitted ${lines2.length === 1 ? "file" : "files"}`,
38590
38697
  items: capped(lines2)
38591
38698
  };
38592
38699
  }
38593
- async function unpushedCommits(path90, reason4) {
38594
- const log2 = await gitResult(path90, ["log", "--oneline", "@{upstream}..HEAD"]);
38700
+ async function unpushedCommits(path91, reason4) {
38701
+ const log2 = await gitResult(path91, ["log", "--oneline", "@{upstream}..HEAD"]);
38595
38702
  if (!log2.ok) return { summary: reason4, items: [] };
38596
38703
  const lines2 = nonEmptyLines(log2.out);
38597
38704
  return {
@@ -38611,7 +38718,7 @@ function capped(lines2) {
38611
38718
  }
38612
38719
 
38613
38720
  // src/commands/sessions/daemon/worktree/resurfaceOrphanedWorktree.ts
38614
- import { basename as basename24 } from "path";
38721
+ import { basename as basename25 } from "path";
38615
38722
  function resurfaceOrphanedWorktree(sessions, spawnWith, recovered, notify2) {
38616
38723
  const { orphan, reason: reason4, held } = recovered;
38617
38724
  let id;
@@ -38634,7 +38741,7 @@ function orphanedSession(id, recovered) {
38634
38741
  const { orphan, reason: reason4, held } = recovered;
38635
38742
  return {
38636
38743
  ...sessionBase(id, "stopped"),
38637
- name: `recovered ${basename24(orphan.path)}`,
38744
+ name: `recovered ${basename25(orphan.path)}`,
38638
38745
  subtitle: `${held.summary} in ${orphan.path}`,
38639
38746
  commandType: "claude",
38640
38747
  pty: null,
@@ -38683,24 +38790,24 @@ function reconcileWorktreesOnRestore(sessions, spawnWith, notify2) {
38683
38790
  async function recoverOrphanedWorktrees(sessions, spawnWith, notify2) {
38684
38791
  const accounted = accountedTrees(sessions);
38685
38792
  const vanished = /* @__PURE__ */ new Map();
38686
- for (const { path: path90, clone } of readWorktreeRegistry()) {
38687
- if (underTempRoot(path90)) {
38688
- forgetWorktree(path90);
38793
+ for (const { path: path91, clone } of readWorktreeRegistry()) {
38794
+ if (underTempRoot(path91)) {
38795
+ forgetWorktree(path91);
38689
38796
  daemonLog(
38690
- `worktree ${path90} lies outside any project root; pruned from the registry rather than recovered`
38797
+ `worktree ${path91} lies outside any project root; pruned from the registry rather than recovered`
38691
38798
  );
38692
38799
  continue;
38693
38800
  }
38694
- if (!existsSync94(path90)) {
38695
- logVanishedTree(sessions, path90);
38801
+ if (!existsSync94(path91)) {
38802
+ logVanishedTree(sessions, path91);
38696
38803
  vanished.set(clone, [
38697
38804
  ...vanished.get(clone) ?? [],
38698
- { path: path90, branch: basename25(path90) }
38805
+ { path: path91, branch: basename26(path91) }
38699
38806
  ]);
38700
38807
  continue;
38701
38808
  }
38702
- if (accounted.has(path90)) continue;
38703
- await recoverOrphan(sessions, spawnWith, { path: path90, clone }, notify2);
38809
+ if (accounted.has(path91)) continue;
38810
+ await recoverOrphan(sessions, spawnWith, { path: path91, clone }, notify2);
38704
38811
  }
38705
38812
  for (const [clone, paths] of vanished)
38706
38813
  await reclaimVanishedWorktrees(clone, paths);
@@ -40452,12 +40559,12 @@ function handleSetStatus(client, m, d) {
40452
40559
  import * as fs54 from "fs";
40453
40560
 
40454
40561
  // src/commands/sessions/shared/codex/findCodexRolloutPath.ts
40455
- import * as path88 from "path";
40562
+ import * as path89 from "path";
40456
40563
  async function findCodexRolloutPath(sessionId) {
40457
40564
  if (!sessionId) return null;
40458
40565
  const paths = await discoverCodexRolloutPaths();
40459
40566
  const suffix = `-${sessionId}.jsonl`;
40460
- return paths.find((file) => path88.basename(file).endsWith(suffix)) ?? null;
40567
+ return paths.find((file) => path89.basename(file).endsWith(suffix)) ?? null;
40461
40568
  }
40462
40569
 
40463
40570
  // src/commands/sessions/shared/codex/codexToolTarget.ts
@@ -41374,7 +41481,7 @@ async function statusLine() {
41374
41481
 
41375
41482
  // src/commands/update.ts
41376
41483
  import { execSync as execSync63 } from "child_process";
41377
- import * as path89 from "path";
41484
+ import * as path90 from "path";
41378
41485
 
41379
41486
  // src/commands/restartDaemonAfterUpdate.ts
41380
41487
  async function restartDaemonAfterUpdate() {
@@ -41393,12 +41500,12 @@ async function restartDaemonAfterUpdate() {
41393
41500
  // src/commands/update.ts
41394
41501
  function isGlobalNpmInstall(dir) {
41395
41502
  try {
41396
- const resolved = path89.resolve(dir);
41397
- if (resolved.split(path89.sep).includes("node_modules")) {
41503
+ const resolved = path90.resolve(dir);
41504
+ if (resolved.split(path90.sep).includes("node_modules")) {
41398
41505
  return true;
41399
41506
  }
41400
41507
  const globalPrefix = execSync63("npm prefix -g", { stdio: "pipe" }).toString().trim();
41401
- return resolved.toLowerCase().startsWith(path89.resolve(globalPrefix).toLowerCase());
41508
+ return resolved.toLowerCase().startsWith(path90.resolve(globalPrefix).toLowerCase());
41402
41509
  } catch {
41403
41510
  return false;
41404
41511
  }