@staff0rd/assist 0.1218.0 → 0.1219.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.
Files changed (87) hide show
  1. package/dist/.build-files +81 -81
  2. package/dist/{addActivity-4AZB5FNU.js → addActivity-BB356JUC.js} +2 -2
  3. package/dist/{addPhase-LNPXIYPK.js → addPhase-7XECKHH4.js} +3 -3
  4. package/dist/{advise-MTBFUXTQ.js → advise-GSYVYRR7.js} +3 -3
  5. package/dist/{askCheck-SX5W2VA4.js → askCheck-RC7ZVCRL.js} +7 -7
  6. package/dist/{askDesign-SZ7K6CGJ.js → askDesign-QFCRD43M.js} +1 -1
  7. package/dist/{branch-VE22QM2F.js → branch-YQ3UUCKY.js} +3 -3
  8. package/dist/built-version +1 -1
  9. package/dist/{chunk-4RFTQWCL.js → chunk-3GINAMFT.js} +1 -1
  10. package/dist/{chunk-VOZOQ7ZU.js → chunk-3LQYJXPU.js} +6 -6
  11. package/dist/{chunk-2CRZID7T.js → chunk-3NOKJIMX.js} +10 -36
  12. package/dist/{chunk-ZKBD7ZIP.js → chunk-3Q2ILAJX.js} +1 -1
  13. package/dist/{chunk-PIPTIJL2.js → chunk-4XVWGIQZ.js} +1 -1
  14. package/dist/{chunk-T6WF6NZA.js → chunk-56Q4LYVU.js} +1 -1
  15. package/dist/{chunk-XE57ISQA.js → chunk-A37Z423F.js} +1 -1
  16. package/dist/{chunk-HOZ7ATOX.js → chunk-A6LWYAU3.js} +1 -1
  17. package/dist/{chunk-YBVGYTVF.js → chunk-BHVGF75Y.js} +1 -1
  18. package/dist/{chunk-HANSK4D3.js → chunk-C7RV262Q.js} +1 -1
  19. package/dist/{chunk-5PVYAAPY.js → chunk-EQ4PJNR3.js} +1 -1
  20. package/dist/{chunk-V23C35QR.js → chunk-EVNYRQFN.js} +2 -2
  21. package/dist/{chunk-NWCNDJBK.js → chunk-FAGKXS7M.js} +1 -1
  22. package/dist/{chunk-ORIIRECU.js → chunk-JK35TMPQ.js} +1 -1
  23. package/dist/{chunk-TLJTRWSR.js → chunk-KQJCHYLI.js} +1 -1
  24. package/dist/{chunk-JEWWWHLD.js → chunk-L6TIUQG7.js} +1 -1
  25. package/dist/{chunk-AEKCC6KD.js → chunk-LGCT5GWJ.js} +2 -2
  26. package/dist/{chunk-7Q7JIS5A.js → chunk-LJO2QGU2.js} +1 -1
  27. package/dist/{chunk-CUQ7A4YH.js → chunk-LW3XI5ST.js} +1 -1
  28. package/dist/{chunk-3ODUG247.js → chunk-MKKUAIO5.js} +1 -1
  29. package/dist/{chunk-6C255DOU.js → chunk-ODRXZQ3P.js} +175 -68
  30. package/dist/{chunk-SLTINDT7.js → chunk-OSZF5OIC.js} +3 -3
  31. package/dist/{chunk-NGG4N5VZ.js → chunk-PVMR7BDN.js} +1 -1
  32. package/dist/{chunk-2KN7ASRE.js → chunk-Q5FCUGEG.js} +1 -1
  33. package/dist/{chunk-TGCXWMNU.js → chunk-RORCGUAQ.js} +2 -2
  34. package/dist/{chunk-2VQGIVEV.js → chunk-RUU5Q4QJ.js} +2 -2
  35. package/dist/{chunk-ATKBOUCC.js → chunk-TMER6T2Y.js} +7 -7
  36. package/dist/{chunk-3FMGNYHM.js → chunk-TMXJY4YK.js} +1 -1
  37. package/dist/{chunk-EN57YHHK.js → chunk-TWQF3TMB.js} +1 -1
  38. package/dist/{chunk-G5IRYDTJ.js → chunk-UCRYRT7T.js} +5 -5
  39. package/dist/{chunk-24WESUC2.js → chunk-UNIWH4ZG.js} +1 -1
  40. package/dist/{chunk-R3BKXOWM.js → chunk-UVF7AAOM.js} +2 -2
  41. package/dist/{chunk-S4NSHQQ3.js → chunk-XVPHIREY.js} +1 -1
  42. package/dist/{chunk-7QTQJKJU.js → chunk-Y4RZPE5K.js} +1 -1
  43. package/dist/{chunk-3RPXIPH5.js → chunk-Z3FHSBJX.js} +1 -1
  44. package/dist/{chunk-MBSMCUTL.js → chunk-ZGNYGFEH.js} +1 -1
  45. package/dist/{chunk-RKNMJQF6.js → chunk-ZRI4LLEL.js} +3 -3
  46. package/dist/{chunk-KPVSCQHQ.js → chunk-ZYRQKPB5.js} +2 -2
  47. package/dist/{cliHook-66JBCEHG.js → cliHook-IHIYSUUT.js} +6 -6
  48. package/dist/{cliHookCheck-6VEZGNQI.js → cliHookCheck-37GDC6GC.js} +2 -2
  49. package/dist/{codexHook-5LK4N2AU.js → codexHook-QNPEZFMN.js} +8 -8
  50. package/dist/commands/extension/extension/updates.json +2 -2
  51. package/dist/commands/sessions/web/bundle.js +1 -1
  52. package/dist/{commit-YWSX4PND.js → commit-63G2R6X4.js} +4 -4
  53. package/dist/{doctorNodes-MR5C4FAF.js → doctorNodes-ZHT4VXJH.js} +3 -3
  54. package/dist/{done-6SQ4ZFU5.js → done-73ZFHC3V.js} +4 -4
  55. package/dist/{editHook-ZJBYDJ7A.js → editHook-UYFUDUBH.js} +6 -6
  56. package/dist/{fixConflict-CK6BZSOB.js → fixConflict-VDFA2YYB.js} +4 -4
  57. package/dist/index.js +50 -50
  58. package/dist/{launchMode-2AV2GQZV.js → launchMode-2Y6A3THN.js} +14 -14
  59. package/dist/{list-B53EGB5N.js → list-2I6MF33C.js} +5 -5
  60. package/dist/{migrate-EQEBYLSV.js → migrate-MMIFWW4D.js} +3 -3
  61. package/dist/{next-G5K5TM3V.js → next-ASEZ7YID.js} +13 -13
  62. package/dist/{phaseDone-X77US4BL.js → phaseDone-QUOCYSFL.js} +5 -5
  63. package/dist/{piHook-PHJVAO43.js → piHook-4UZFXOL2.js} +6 -6
  64. package/dist/{propose-V4APKP64.js → propose-TEAY3APD.js} +4 -4
  65. package/dist/{refine-U245OW2L.js → refine-OOKRHH6R.js} +15 -15
  66. package/dist/{restartNode-Y4IHGBFW.js → restartNode-SHSBTIPE.js} +5 -5
  67. package/dist/{review-RWWCSIRN.js → review-BI24OPV6.js} +4 -4
  68. package/dist/{reviewPrComments-MKPSQ6BR.js → reviewPrComments-BCPAUAY6.js} +4 -4
  69. package/dist/{rewindPhase-SZFVC6W5.js → rewindPhase-7AQG7BYT.js} +8 -8
  70. package/dist/{run-JXWKKDT5.js → run-L2KHLVUN.js} +11 -11
  71. package/dist/{run-FYD73JOG.js → run-R4W3PZCM.js} +11 -11
  72. package/dist/{runDaemon-5SPXM7TW.js → runDaemon-PANJUNOL.js} +31 -23
  73. package/dist/{runParallelPhase-VXN3OZXF.js → runParallelPhase-ER4T22WS.js} +7 -7
  74. package/dist/{runRefine-MDYWKJ3O.js → runRefine-2AOVNZGF.js} +15 -15
  75. package/dist/{scan-VAQU6SGK.js → scan-C7IJHRET.js} +2 -2
  76. package/dist/{schemaConfirm-6TEMFXGX.js → schemaConfirm-SCIGN5LJ.js} +2 -2
  77. package/dist/{schemaLock-WKR3Y542.js → schemaLock-TPOAQ3PF.js} +2 -2
  78. package/dist/{schemaUnlock-BYFQUMQ2.js → schemaUnlock-SLQ7Z6RV.js} +2 -2
  79. package/dist/{search-RGWI5N3E.js → search-3GQ2J6JG.js} +5 -5
  80. package/dist/{show-MPJ5KOKQ.js → show-4D35SSSY.js} +3 -3
  81. package/dist/{show-AF3AHY3O.js → show-HAR6XVMW.js} +3 -3
  82. package/dist/{signExtension-AHXRV5XT.js → signExtension-CNR43DHY.js} +1 -1
  83. package/dist/{updateNode-3EH44S2Z.js → updateNode-KOMLTDVK.js} +5 -5
  84. package/dist/{updatePlan-JPQNCN43.js → updatePlan-JYJMAJSP.js} +4 -4
  85. package/dist/{web-PPEZAIVF.js → web-HU52H4CS.js} +16 -16
  86. package/dist/{web-2RV7AVAP.js → web-NUVTYS3O.js} +16 -16
  87. package/package.json +1 -1
@@ -34,7 +34,8 @@ import {
34
34
  isHarnessAvailable
35
35
  } from "./chunk-EOOPPGMZ.js";
36
36
  import {
37
- declaredNode
37
+ declaredNode,
38
+ resolveNodeSpec
38
39
  } from "./chunk-RV5U5FUG.js";
39
40
  import {
40
41
  loadConfig
@@ -178,7 +179,7 @@ function hasTranscriptOnDisk(session) {
178
179
  }
179
180
 
180
181
  // src/commands/sessions/daemon/spawnPty.ts
181
- import { existsSync as existsSync3 } from "fs";
182
+ import { existsSync as existsSync5 } from "fs";
182
183
  import * as pty from "node-pty";
183
184
 
184
185
  // src/shared/nodeRuntime/withHarnessPath.ts
@@ -192,14 +193,111 @@ function harnessBinDir() {
192
193
 
193
194
  // src/shared/nodeRuntime/withHarnessPath.ts
194
195
  function withHarnessPath(env, binDir = harnessBinDir()) {
195
- if (!binDir) return env;
196
+ const dirs = typeof binDir === "string" ? [binDir] : binDir ?? [];
197
+ if (dirs.length === 0) return env;
196
198
  const key = Object.keys(env).find((k) => k.toUpperCase() === "PATH") ?? "PATH";
197
199
  const rest = env[key] ? `${delimiter}${env[key]}` : "";
198
- return { ...env, [key]: `${binDir}${rest}` };
200
+ return { ...env, [key]: `${dirs.join(delimiter)}${rest}` };
201
+ }
202
+
203
+ // src/shared/nodeRuntime/findEnginesPin.ts
204
+ import { readFileSync } from "fs";
205
+ import { dirname as dirname2, join as join3, resolve } from "path";
206
+ function readEngines(file) {
207
+ try {
208
+ const pkg = JSON.parse(readFileSync(file, "utf8"));
209
+ const range = pkg?.engines?.node;
210
+ return typeof range === "string" && range.trim() ? range.trim() : void 0;
211
+ } catch {
212
+ return void 0;
213
+ }
214
+ }
215
+ function findEnginesPin(dir, root) {
216
+ const top = resolve(root);
217
+ let current = resolve(dir);
218
+ for (; ; ) {
219
+ const file = join3(current, "package.json");
220
+ const spec = readEngines(file);
221
+ if (spec) return { file, spec };
222
+ const parent = dirname2(current);
223
+ if (current === top || parent === current) return void 0;
224
+ current = parent;
225
+ }
226
+ }
227
+
228
+ // src/shared/nodeRuntime/findNodePin.ts
229
+ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
230
+ import { dirname as dirname3, join as join4, resolve as resolve2 } from "path";
231
+ var PIN_FILES = [".node-version", ".nvmrc"];
232
+ function readPin(file) {
233
+ if (!existsSync2(file)) return void 0;
234
+ try {
235
+ return readFileSync2(file, "utf8").split(/\r?\n/).map((line) => line.trim()).find((line) => line && !line.startsWith("#"));
236
+ } catch {
237
+ return void 0;
238
+ }
239
+ }
240
+ function findNodePin(dir, root) {
241
+ const top = resolve2(root);
242
+ let current = resolve2(dir);
243
+ for (; ; ) {
244
+ for (const name of PIN_FILES) {
245
+ const file = join4(current, name);
246
+ const spec = readPin(file);
247
+ if (spec) return { file, spec };
248
+ }
249
+ const parent = dirname3(current);
250
+ if (current === top || parent === current) return void 0;
251
+ current = parent;
252
+ }
253
+ }
254
+
255
+ // src/shared/nodeRuntime/findRepoRoot.ts
256
+ import { existsSync as existsSync3 } from "fs";
257
+ import { dirname as dirname4, join as join5, resolve as resolve3 } from "path";
258
+ function findRepoRoot(dir) {
259
+ let current = resolve3(dir);
260
+ for (; ; ) {
261
+ if (existsSync3(join5(current, ".git"))) return current;
262
+ const parent = dirname4(current);
263
+ if (parent === current) return void 0;
264
+ current = parent;
265
+ }
266
+ }
267
+
268
+ // src/shared/nodeRuntime/repoNode.ts
269
+ var resolved = /* @__PURE__ */ new Map();
270
+ function cachedResolve(spec) {
271
+ const hit = resolved.get(spec);
272
+ if (hit) return hit;
273
+ const resolution = resolveNodeSpec(spec);
274
+ if (resolution.ok) resolved.set(spec, resolution);
275
+ return resolution;
276
+ }
277
+ function repoNode(cwd, resolve4 = cachedResolve) {
278
+ const root = findRepoRoot(cwd) ?? cwd;
279
+ const pin = findNodePin(cwd, root) ?? findEnginesPin(cwd, root);
280
+ if (!pin) return void 0;
281
+ return { pin, ...resolve4(pin.spec) };
282
+ }
283
+
284
+ // src/commands/sessions/daemon/sessionBinDirs.ts
285
+ function sessionBinDirs(cwd, sessionId, deps = {
286
+ repo: repoNode,
287
+ harness: harnessBinDir
288
+ }) {
289
+ const harness = deps.harness();
290
+ const repo = cwd ? deps.repo(cwd) : void 0;
291
+ if (repo && !repo.ok)
292
+ daemonLog(
293
+ `${sessionId ? `session ${sessionId}` : "spawn"} in ${cwd}: ${repo.pin.file} wants node "${repo.pin.spec}" but ${repo.error}; starting on the daemon's node ${process.version}`
294
+ );
295
+ const dirs = [repo?.ok ? repo.node.binDir : void 0, harness];
296
+ return [...new Set(dirs.filter((dir) => !!dir))];
199
297
  }
200
298
 
201
299
  // src/commands/sessions/daemon/ensureSpawnHelperExecutable.ts
202
- import { chmodSync, existsSync as existsSync2, statSync } from "fs";
300
+ import { chmodSync, existsSync as existsSync4, statSync } from "fs";
203
301
  import { createRequire } from "module";
204
302
  import path3 from "path";
205
303
  var require2 = createRequire(import.meta.url);
@@ -214,7 +312,7 @@ function ensureSpawnHelperExecutable() {
214
312
  `${process.platform}-${process.arch}`,
215
313
  "spawn-helper"
216
314
  );
217
- if (!existsSync2(helper)) return;
315
+ if (!existsSync4(helper)) return;
218
316
  const mode = statSync(helper).mode;
219
317
  if ((mode & 73) === 0) chmodSync(helper, mode | 493);
220
318
  }
@@ -224,19 +322,20 @@ function shellEscape(s) {
224
322
  return `'${s.replace(/'/g, String.raw`'\''`)}'`;
225
323
  }
226
324
  function loginShellCommand(command, binDir = harnessBinDir()) {
227
- if (!binDir) return command;
228
- return `export PATH=${shellEscape(binDir)}:"$PATH"; ${command}`;
325
+ const dirs = typeof binDir === "string" ? [binDir] : binDir ?? [];
326
+ if (dirs.length === 0) return command;
327
+ return `export PATH=${shellEscape(dirs.join(":"))}:"$PATH"; ${command}`;
229
328
  }
230
329
 
231
330
  // src/commands/sessions/daemon/resolvePtyCommand.ts
232
- function resolvePtyCommand(args) {
331
+ function resolvePtyCommand(args, binDirs) {
233
332
  if (process.platform !== "win32")
234
333
  return {
235
334
  file: process.env.SHELL ?? "bash",
236
335
  args: [
237
336
  "-l",
238
337
  "-c",
239
- loginShellCommand(`exec ${args.map(shellEscape2).join(" ")}`)
338
+ loginShellCommand(`exec ${args.map(shellEscape2).join(" ")}`, binDirs)
240
339
  ]
241
340
  };
242
341
  if (args[0] === "assist" && process.argv[1])
@@ -269,7 +368,7 @@ function sessionChildEnv(base, sessionId, extraEnv) {
269
368
  }
270
369
 
271
370
  // src/commands/sessions/daemon/viewerSize.ts
272
- import { readFileSync, writeFileSync as writeFileSync2 } from "fs";
371
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
273
372
  var DEFAULT_SIZE = { cols: 120, rows: 30 };
274
373
  var remembered;
275
374
  function rememberViewerSize(cols, rows) {
@@ -291,7 +390,7 @@ function viewerSize() {
291
390
  function readSavedSize() {
292
391
  try {
293
392
  const { cols, rows } = JSON.parse(
294
- readFileSync(daemonPaths.viewerSize, "utf8")
393
+ readFileSync3(daemonPaths.viewerSize, "utf8")
295
394
  );
296
395
  if (typeof cols === "number" && typeof rows === "number" && cols > 0)
297
396
  return { cols, rows };
@@ -312,16 +411,21 @@ var MissingCwdError = class extends Error {
312
411
  function spawnPty(args, cwd, sessionId, extraEnv) {
313
412
  refuseMissingCwd(cwd, sessionId);
314
413
  ensureSpawnHelperExecutable();
315
- const command = resolvePtyCommand(args);
414
+ const dir = cwd ?? process.cwd();
415
+ const binDirs = sessionBinDirs(dir, sessionId);
416
+ const command = resolvePtyCommand(args, binDirs);
316
417
  return pty.spawn(command.file, command.args, {
317
418
  name: "xterm-256color",
318
419
  ...viewerSize(),
319
- cwd: cwd ?? process.cwd(),
320
- env: withHarnessPath(sessionChildEnv(process.env, sessionId, extraEnv))
420
+ cwd: dir,
421
+ env: withHarnessPath(
422
+ sessionChildEnv(process.env, sessionId, extraEnv),
423
+ binDirs
424
+ )
321
425
  });
322
426
  }
323
427
  function refuseMissingCwd(cwd, sessionId) {
324
- if (!cwd || existsSync3(cwd)) return;
428
+ if (!cwd || existsSync5(cwd)) return;
325
429
  daemonLog(
326
430
  `${sessionId ? `session ${sessionId}` : "pty"} not spawned: working directory ${cwd} no longer exists`
327
431
  );
@@ -569,8 +673,8 @@ function buildSlashCommand(slashCommand, description) {
569
673
  }
570
674
 
571
675
  // src/shared/harnessAdapters/carryTranscriptToTree.ts
572
- import { copyFileSync, existsSync as existsSync4, mkdirSync as mkdirSync2 } from "fs";
573
- import { join as join4 } from "path";
676
+ import { copyFileSync, existsSync as existsSync6, mkdirSync as mkdirSync2 } from "fs";
677
+ import { join as join7 } from "path";
574
678
  function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
575
679
  const dir = projectDirForCwd(toCwd);
576
680
  if (dir === projectDirForCwd(fromCwd)) {
@@ -579,8 +683,8 @@ function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
579
683
  );
580
684
  return;
581
685
  }
582
- const dest = join4(dir, `${claudeSessionId}.jsonl`);
583
- if (existsSync4(dest)) {
686
+ const dest = join7(dir, `${claudeSessionId}.jsonl`);
687
+ if (existsSync6(dest)) {
584
688
  daemonLog(`transcript ${claudeSessionId} already present in ${dir}`);
585
689
  return;
586
690
  }
@@ -605,14 +709,14 @@ function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
605
709
  }
606
710
 
607
711
  // src/shared/harnessAdapters/claudeConnectorProbe.ts
608
- import { readFileSync as readFileSync2 } from "fs";
712
+ import { readFileSync as readFileSync4 } from "fs";
609
713
  import { homedir as homedir3 } from "os";
610
- import { join as join5 } from "path";
714
+ import { join as join8 } from "path";
611
715
  function knownConnectedConnectors() {
612
716
  const dir = process.env.CLAUDE_CONFIG_DIR ?? homedir3();
613
717
  try {
614
718
  const state = JSON.parse(
615
- readFileSync2(join5(dir, ".claude.json"), "utf8")
719
+ readFileSync4(join8(dir, ".claude.json"), "utf8")
616
720
  );
617
721
  const list = state.claudeAiMcpEverConnected;
618
722
  return Array.isArray(list) ? list.filter((name) => typeof name === "string") : void 0;
@@ -779,9 +883,9 @@ var ASK_USER_QUESTION2 = "AskUserQuestion";
779
883
  function hasPendingAskUserQuestion(events, idx) {
780
884
  const ev = events[idx];
781
885
  if (ev?.kind !== "assistant") return false;
782
- const resolved = resolvedToolUseIds(events, idx);
886
+ const resolved2 = resolvedToolUseIds(events, idx);
783
887
  return ev.toolUses.some(
784
- (tool) => tool.name === ASK_USER_QUESTION2 && !resolved.has(tool.id)
888
+ (tool) => tool.name === ASK_USER_QUESTION2 && !resolved2.has(tool.id)
785
889
  );
786
890
  }
787
891
  function resolvedToolUseIds(events, afterIdx) {
@@ -1634,9 +1738,9 @@ async function claudeConnectorRun(run) {
1634
1738
  const stream = createClaudeConnectorStream(run.onEvent, run.tools);
1635
1739
  const flush = attachLineParser(child, stream.onLine);
1636
1740
  const stderr = attachStderrCollector(child);
1637
- const exit = await new Promise((resolve, reject) => {
1741
+ const exit = await new Promise((resolve4, reject) => {
1638
1742
  child.on("error", reject);
1639
- child.on("close", (code, signal) => resolve(describeExit(code, signal)));
1743
+ child.on("close", (code, signal) => resolve4(describeExit(code, signal)));
1640
1744
  });
1641
1745
  flush();
1642
1746
  const tail = stderr.value.trim().slice(-500);
@@ -1967,12 +2071,12 @@ function onCloseResult(ctx, code) {
1967
2071
  return { ...closed, stderr: ctx.stderr.value, stdout: ctx.stdout.value };
1968
2072
  }
1969
2073
  function waitForChildExit(ctx) {
1970
- return new Promise((resolve) => {
2074
+ return new Promise((resolve4) => {
1971
2075
  let settled = false;
1972
2076
  const settle = (result) => {
1973
2077
  if (settled) return;
1974
2078
  settled = true;
1975
- resolve(result);
2079
+ resolve4(result);
1976
2080
  };
1977
2081
  ctx.child.on("error", (err) => settle(onErrorResult(ctx, err)));
1978
2082
  ctx.child.on("close", (code) => settle(onCloseResult(ctx, code)));
@@ -2210,9 +2314,9 @@ function codexIsolatedHookArgs() {
2210
2314
  // src/shared/codexSandboxArgs.ts
2211
2315
  import { mkdirSync as mkdirSync3 } from "fs";
2212
2316
  import { homedir as homedir4 } from "os";
2213
- import { join as join6 } from "path";
2317
+ import { join as join9 } from "path";
2214
2318
  function codexSandboxArgs() {
2215
- const assistHome = join6(homedir4(), ".assist");
2319
+ const assistHome = join9(homedir4(), ".assist");
2216
2320
  mkdirSync3(assistHome, { recursive: true });
2217
2321
  return [
2218
2322
  "-c",
@@ -2369,13 +2473,13 @@ import * as fs8 from "fs";
2369
2473
  import * as path10 from "path";
2370
2474
 
2371
2475
  // src/commands/sessions/shared/codex/codexSessionsDir.ts
2372
- import { existsSync as existsSync6 } from "fs";
2476
+ import { existsSync as existsSync8 } from "fs";
2373
2477
  import * as path9 from "path";
2374
2478
  function codexSessionsDir() {
2375
2479
  return path9.join(harnesses.codex.homeDir, "sessions");
2376
2480
  }
2377
2481
  function hasCodexSessions() {
2378
- return existsSync6(codexSessionsDir());
2482
+ return existsSync8(codexSessionsDir());
2379
2483
  }
2380
2484
 
2381
2485
  // src/commands/sessions/shared/codex/discoverCodexRolloutPaths.ts
@@ -2561,7 +2665,7 @@ async function touchedSince(file, sinceMs) {
2561
2665
  }
2562
2666
 
2563
2667
  // src/shared/harnessAdapters/codexConversationReader.ts
2564
- import { basename as basename4, dirname as dirname4 } from "path";
2668
+ import { basename as basename4, dirname as dirname7 } from "path";
2565
2669
 
2566
2670
  // src/commands/sessions/shared/codex/deriveCodexRolloutStatus.ts
2567
2671
  var TURN_END_EVENTS = /* @__PURE__ */ new Set(["task_complete", "turn_aborted"]);
@@ -3427,7 +3531,7 @@ var codexConversationReader = {
3427
3531
  locate: ({ harnessSessionId }) => harnessSessionId ? findCodexRolloutPathSync(harnessSessionId) : null,
3428
3532
  watchTarget: (ref) => {
3429
3533
  const path15 = codexConversationReader.locate(ref);
3430
- return path15 ? { dir: dirname4(path15), file: basename4(path15) } : null;
3534
+ return path15 ? { dir: dirname7(path15), file: basename4(path15) } : null;
3431
3535
  },
3432
3536
  events: (entries) => entries.flatMap(entryEvents),
3433
3537
  lifecycle: (entries) => ({
@@ -3539,8 +3643,8 @@ function codexSandboxMode(allowEdits) {
3539
3643
  }
3540
3644
 
3541
3645
  // src/shared/readCodexRulePerms.ts
3542
- import { existsSync as existsSync7, readdirSync as readdirSync3, readFileSync as readFileSync7 } from "fs";
3543
- import { join as join13 } from "path";
3646
+ import { existsSync as existsSync9, readdirSync as readdirSync3, readFileSync as readFileSync9 } from "fs";
3647
+ import { join as join16 } from "path";
3544
3648
 
3545
3649
  // src/shared/readPatternList.ts
3546
3650
  function readString(text, start) {
@@ -3618,21 +3722,21 @@ function parseCodexRules(text) {
3618
3722
 
3619
3723
  // src/shared/readCodexRulePerms.ts
3620
3724
  function ruleFiles(dir) {
3621
- if (!existsSync7(dir)) return [];
3725
+ if (!existsSync9(dir)) return [];
3622
3726
  try {
3623
- return readdirSync3(dir).filter((name) => name.endsWith(".rules")).sort().map((name) => join13(dir, name));
3727
+ return readdirSync3(dir).filter((name) => name.endsWith(".rules")).sort().map((name) => join16(dir, name));
3624
3728
  } catch {
3625
3729
  return [];
3626
3730
  }
3627
3731
  }
3628
3732
  function readCodexRulePerms(key) {
3629
3733
  const dirs = [
3630
- join13(harnesses.codex.homeDir, "rules"),
3631
- join13(process.cwd(), ".codex", "rules")
3734
+ join16(harnesses.codex.homeDir, "rules"),
3735
+ join16(process.cwd(), ".codex", "rules")
3632
3736
  ];
3633
3737
  return dirs.flatMap(ruleFiles).flatMap((file) => {
3634
3738
  try {
3635
- return parseCodexRules(readFileSync7(file, "utf8"))[key];
3739
+ return parseCodexRules(readFileSync9(file, "utf8"))[key];
3636
3740
  } catch {
3637
3741
  return [];
3638
3742
  }
@@ -3730,7 +3834,7 @@ function codexRelocate(conversationId, fromCwd, toCwd) {
3730
3834
  }
3731
3835
 
3732
3836
  // src/commands/review/runCodexReviewer.ts
3733
- import { existsSync as existsSync8, unlinkSync } from "fs";
3837
+ import { existsSync as existsSync10, unlinkSync } from "fs";
3734
3838
 
3735
3839
  // src/commands/review/parseCodexUsage.ts
3736
3840
  function parseCodexUsage(usage) {
@@ -3819,7 +3923,7 @@ async function runCodexReviewer(spec) {
3819
3923
  ...override.args.length > 0 ? { env: override.env } : {},
3820
3924
  onLine
3821
3925
  });
3822
- if (result.exitCode !== 0 && existsSync8(spec.outputPath)) {
3926
+ if (result.exitCode !== 0 && existsSync10(spec.outputPath)) {
3823
3927
  unlinkSync(spec.outputPath);
3824
3928
  }
3825
3929
  const finalised = finaliseReviewerRun(
@@ -4077,8 +4181,8 @@ function createSdkInput() {
4077
4181
  continue;
4078
4182
  }
4079
4183
  if (closed) return;
4080
- await new Promise((resolve) => {
4081
- wake = resolve;
4184
+ await new Promise((resolve4) => {
4185
+ wake = resolve4;
4082
4186
  });
4083
4187
  }
4084
4188
  }
@@ -4383,11 +4487,11 @@ function dedupeProcessEmit(emit) {
4383
4487
 
4384
4488
  // src/commands/sessions/daemon/sdk/procSampler/readUptimeTicks.ts
4385
4489
  import { readFile } from "fs/promises";
4386
- import { join as join15 } from "path";
4490
+ import { join as join18 } from "path";
4387
4491
  var CLOCK_TICKS_PER_SECOND = 100;
4388
4492
  async function readUptimeTicks(procRoot) {
4389
4493
  try {
4390
- const text = await readFile(join15(procRoot, "uptime"), "utf8");
4494
+ const text = await readFile(join18(procRoot, "uptime"), "utf8");
4391
4495
  return Math.floor(Number.parseFloat(text) * CLOCK_TICKS_PER_SECOND);
4392
4496
  } catch {
4393
4497
  return void 0;
@@ -4396,7 +4500,7 @@ async function readUptimeTicks(procRoot) {
4396
4500
 
4397
4501
  // src/commands/sessions/daemon/sdk/procSampler/sampleLeafProcess.ts
4398
4502
  import { readdir, readFile as readFile3 } from "fs/promises";
4399
- import { join as join17 } from "path";
4503
+ import { join as join20 } from "path";
4400
4504
 
4401
4505
  // src/commands/sessions/daemon/sdk/procSampler/findLeafProcess.ts
4402
4506
  function outranks(stat, depth, best) {
@@ -4427,10 +4531,10 @@ function findLeafProcess(stats, rootPid, minStartTicks) {
4427
4531
 
4428
4532
  // src/commands/sessions/daemon/sdk/procSampler/readProcStat.ts
4429
4533
  import { readFile as readFile2 } from "fs/promises";
4430
- import { join as join16 } from "path";
4534
+ import { join as join19 } from "path";
4431
4535
  async function readProcStat(procRoot, pid) {
4432
4536
  try {
4433
- const text = await readFile2(join16(procRoot, String(pid), "stat"), "utf8");
4537
+ const text = await readFile2(join19(procRoot, String(pid), "stat"), "utf8");
4434
4538
  const fields = text.slice(text.lastIndexOf(")") + 2).split(" ");
4435
4539
  return {
4436
4540
  pid,
@@ -4490,10 +4594,10 @@ async function sampleLeafProcess(procRoot, rootPid, minStartTicks) {
4490
4594
  minStartTicks
4491
4595
  );
4492
4596
  if (!leaf) return void 0;
4493
- const dir = join17(procRoot, String(leaf.pid));
4597
+ const dir = join20(procRoot, String(leaf.pid));
4494
4598
  const [cmdline, io] = await Promise.all([
4495
- readText(join17(dir, "cmdline")),
4496
- readText(join17(dir, "io"))
4599
+ readText(join20(dir, "cmdline")),
4600
+ readText(join20(dir, "io"))
4497
4601
  ]);
4498
4602
  const command = trimProcessCommand(cmdline?.split("\0") ?? []);
4499
4603
  if (!command) return void 0;
@@ -4716,16 +4820,17 @@ function startDrivenQuery(driver, context, turn, backgroundTasks) {
4716
4820
  }
4717
4821
 
4718
4822
  // src/commands/sessions/daemon/sdk/workflowQueryEnv.ts
4719
- function workflowQueryEnv(base, sessionId, launcherEnv2) {
4823
+ function workflowQueryEnv(base, sessionId, launcherEnv2, cwd) {
4720
4824
  const env = {
4721
4825
  ...sessionChildEnv(base, sessionId),
4722
4826
  // why: claude turns the Artifact tool off for SDK-driven runs unless this opts back in
4723
4827
  CLAUDE_CODE_ARTIFACT: base.CLAUDE_CODE_ARTIFACT ?? "1",
4724
4828
  [sdkAgentEnv]: "1"
4725
4829
  };
4726
- if (!launcherEnv2) return env;
4830
+ const binDirs = sessionBinDirs(cwd, sessionId);
4831
+ if (!launcherEnv2) return withHarnessPath(env, binDirs);
4727
4832
  const { ASSIST_ACTIVITY_ID: _activityId, ...rest } = env;
4728
- return { ...rest, ...launcherEnv2 };
4833
+ return withHarnessPath({ ...rest, ...launcherEnv2 }, binDirs);
4729
4834
  }
4730
4835
 
4731
4836
  // src/commands/sessions/daemon/sdk/spawnDrivenSession.ts
@@ -4750,7 +4855,7 @@ function spawnDrivenSession(opts2, driver) {
4750
4855
  abort,
4751
4856
  control,
4752
4857
  input: input.messages,
4753
- childEnv: (base) => workflowQueryEnv(base, opts2.sessionId, opts2.launcherEnv)
4858
+ childEnv: (base) => workflowQueryEnv(base, opts2.sessionId, opts2.launcherEnv, opts2.cwd)
4754
4859
  };
4755
4860
  startDrivenQuery(driver, context, turn, backgroundTasks);
4756
4861
  return control.process;
@@ -4976,7 +5081,7 @@ async function* claudeUserMessages(texts) {
4976
5081
  }
4977
5082
 
4978
5083
  // src/commands/sessions/daemon/sdk/claude/sdkQueryOptions.ts
4979
- import { readFileSync as readFileSync8 } from "fs";
5084
+ import { readFileSync as readFileSync10 } from "fs";
4980
5085
 
4981
5086
  // src/commands/sessions/daemon/sdk/claude/spawnSdkChild.ts
4982
5087
  import { spawn as spawn4 } from "child_process";
@@ -5014,7 +5119,7 @@ function spawnSdkChild(options, { label, childEnv }, attach) {
5014
5119
  // src/commands/sessions/daemon/sdk/claude/sdkQueryOptions.ts
5015
5120
  function sdkQueryOptions(context, executable) {
5016
5121
  const { opts: opts2, abort, control } = context;
5017
- const append = opts2.appendSystemPromptFile ? readFileSync8(opts2.appendSystemPromptFile, "utf8") : void 0;
5122
+ const append = opts2.appendSystemPromptFile ? readFileSync10(opts2.appendSystemPromptFile, "utf8") : void 0;
5018
5123
  return {
5019
5124
  cwd: opts2.cwd,
5020
5125
  ...opts2.resumeId ? { resume: opts2.resumeId } : { sessionId: opts2.conversationId },
@@ -5079,7 +5184,7 @@ function launcherEnv(env = process.env) {
5079
5184
 
5080
5185
  // src/shared/harnessAdapters/awaitSdkExit.ts
5081
5186
  function awaitSdkExit(socket, launch, killed) {
5082
- return new Promise((resolve, reject) => {
5187
+ return new Promise((resolve4, reject) => {
5083
5188
  let exit;
5084
5189
  const lines = createInterface2({ input: socket });
5085
5190
  lines.on("error", () => {
@@ -5097,7 +5202,7 @@ function awaitSdkExit(socket, launch, killed) {
5097
5202
  });
5098
5203
  socket.on("close", () => {
5099
5204
  if (exit?.error) reject(new Error(exit.error));
5100
- else resolve(killed() ? 0 : exit?.exitCode ?? 1);
5205
+ else resolve4(killed() ? 0 : exit?.exitCode ?? 1);
5101
5206
  });
5102
5207
  socket.write(
5103
5208
  `${JSON.stringify({ type: "sdk-launch", ...launch, env: launcherEnv() })}
@@ -5229,12 +5334,12 @@ function codexSdkConfig(args) {
5229
5334
  // src/commands/sessions/daemon/sdk/codex/codexSdkExecutable.ts
5230
5335
  import { chmodSync as chmodSync2, mkdirSync as mkdirSync5, writeFileSync as writeFileSync5 } from "fs";
5231
5336
  import { homedir as homedir5 } from "os";
5232
- import { join as join18 } from "path";
5337
+ import { join as join21 } from "path";
5233
5338
  function codexSdkExecutable() {
5234
5339
  if (process.platform === "win32") return void 0;
5235
- const dir = join18(homedir5(), ".assist", "codex-sdk");
5340
+ const dir = join21(homedir5(), ".assist", "codex-sdk");
5236
5341
  mkdirSync5(dir, { recursive: true });
5237
- const shim = join18(dir, "codex");
5342
+ const shim = join21(dir, "codex");
5238
5343
  const args = [harnesses.codex.command, ...codexIsolatedHookArgs()].join(" ");
5239
5344
  writeFileSync5(shim, `#!/bin/sh
5240
5345
  exec ${args} "$@"
@@ -5541,14 +5646,16 @@ var adapters = {
5541
5646
  pi: piAdapter
5542
5647
  };
5543
5648
  function harnessAdapter(kind) {
5544
- const resolved = resolveHarness(kind);
5545
- if (resolved === "claude" && process.env.ASSIST_SDK_SESSION === "1")
5649
+ const resolved2 = resolveHarness(kind);
5650
+ if (resolved2 === "claude" && process.env.ASSIST_SDK_SESSION === "1")
5546
5651
  return claudeSdkAdapter;
5547
- return adapters[resolved];
5652
+ return adapters[resolved2];
5548
5653
  }
5549
5654
 
5550
5655
  export {
5551
5656
  withHarnessPath,
5657
+ findNodePin,
5658
+ sessionBinDirs,
5552
5659
  loginShellCommand,
5553
5660
  resolvePtyCommand,
5554
5661
  sessionChildEnv,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  backlogPhaseActivity,
3
3
  recordPhaseSession
4
- } from "./chunk-3FMGNYHM.js";
4
+ } from "./chunk-TMXJY4YK.js";
5
5
  import {
6
6
  resumeNudge
7
7
  } from "./chunk-7NZOH4LN.js";
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-ZT3S2DV2.js";
27
27
  import {
28
28
  buildPhasePrompt
29
- } from "./chunk-CUQ7A4YH.js";
29
+ } from "./chunk-LW3XI5ST.js";
30
30
  import {
31
31
  getReady
32
32
  } from "./chunk-YULBR2Q3.js";
@@ -38,7 +38,7 @@ import {
38
38
  } from "./chunk-XEHE4IC2.js";
39
39
  import {
40
40
  harnessAdapter
41
- } from "./chunk-6C255DOU.js";
41
+ } from "./chunk-ODRXZQ3P.js";
42
42
  import {
43
43
  getSignalPath
44
44
  } from "./chunk-P23ZWXGY.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  firstBrokenHop
3
- } from "./chunk-JEWWWHLD.js";
3
+ } from "./chunk-L6TIUQG7.js";
4
4
  import {
5
5
  describePeerError
6
6
  } from "./chunk-VABNWHSE.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-6MXYEGDK.js";
5
5
  import {
6
6
  harnessAdapter
7
- } from "./chunk-6C255DOU.js";
7
+ } from "./chunk-ODRXZQ3P.js";
8
8
  import {
9
9
  activeHarness
10
10
  } from "./chunk-K4DJEFDZ.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveReviewPhase
3
- } from "./chunk-S4NSHQQ3.js";
3
+ } from "./chunk-XVPHIREY.js";
4
4
  import {
5
5
  resolvePlan
6
- } from "./chunk-4RFTQWCL.js";
6
+ } from "./chunk-3GINAMFT.js";
7
7
 
8
8
  // src/commands/backlog/resolveRewindPlan.ts
9
9
  function resolveRewindPlan(item) {
@@ -3,14 +3,14 @@ import {
3
3
  } from "./chunk-3UMMZHZG.js";
4
4
  import {
5
5
  run
6
- } from "./chunk-VOZOQ7ZU.js";
6
+ } from "./chunk-3LQYJXPU.js";
7
7
  import {
8
8
  isLockedByOther
9
9
  } from "./chunk-BXGPF3TG.js";
10
10
  import {
11
11
  isBlocked,
12
12
  typeLabel
13
- } from "./chunk-HOZ7ATOX.js";
13
+ } from "./chunk-A6LWYAU3.js";
14
14
  import {
15
15
  loadBacklog
16
16
  } from "./chunk-YULBR2Q3.js";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-JM57BCD6.js";
11
11
  import {
12
12
  firstBrokenHop
13
- } from "./chunk-JEWWWHLD.js";
13
+ } from "./chunk-L6TIUQG7.js";
14
14
  import {
15
15
  describePeerError,
16
16
  fetchPeerJson
@@ -40,7 +40,7 @@ import {
40
40
  resolveLinkTarget,
41
41
  usageWindowKey,
42
42
  watcherLogPath
43
- } from "./chunk-3RPXIPH5.js";
43
+ } from "./chunk-Z3FHSBJX.js";
44
44
  import {
45
45
  TRACE_HEADER,
46
46
  newTraceId
@@ -48,7 +48,7 @@ import {
48
48
  import {
49
49
  ASSIST_VERSION,
50
50
  PROTOCOL_VERSION
51
- } from "./chunk-TLJTRWSR.js";
51
+ } from "./chunk-KQJCHYLI.js";
52
52
  import {
53
53
  findLinkSpec
54
54
  } from "./chunk-6KSMPTXN.js";
@@ -85,7 +85,7 @@ import {
85
85
  } from "./chunk-UJBW7FVI.js";
86
86
  import {
87
87
  targetConversationEvents
88
- } from "./chunk-V23C35QR.js";
88
+ } from "./chunk-EVNYRQFN.js";
89
89
  import {
90
90
  configEntryLayers,
91
91
  ghFailure,
@@ -253,7 +253,7 @@ import {
253
253
  } from "./chunk-KDYJRHCI.js";
254
254
  import {
255
255
  rewindItemToPhase
256
- } from "./chunk-R3BKXOWM.js";
256
+ } from "./chunk-UVF7AAOM.js";
257
257
  import {
258
258
  loadItemSummaries,
259
259
  phaseUsageTotals,
@@ -282,7 +282,7 @@ import {
282
282
  } from "./chunk-D2AUYB7K.js";
283
283
  import {
284
284
  resolveRewindPlan
285
- } from "./chunk-TGCXWMNU.js";
285
+ } from "./chunk-RORCGUAQ.js";
286
286
  import {
287
287
  deleteItem,
288
288
  getOrigin,
@@ -331,7 +331,7 @@ import {
331
331
  discoverSessionJsonlPaths,
332
332
  harnessAdapter,
333
333
  parseSessionFile
334
- } from "./chunk-6C255DOU.js";
334
+ } from "./chunk-ODRXZQ3P.js";
335
335
  import {
336
336
  harnessLabel
337
337
  } from "./chunk-XZSATLYY.js";