@staff0rd/assist 0.1185.1 → 0.1185.3

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 (91) hide show
  1. package/dist/.build-files +86 -86
  2. package/dist/{addActivity-VWFJOAEG.js → addActivity-IJ7GPTGZ.js} +3 -3
  3. package/dist/{addPhase-I6IY7FEJ.js → addPhase-ORSNDH7W.js} +4 -4
  4. package/dist/{advise-7I4S5K2M.js → advise-ZVSZMEXH.js} +4 -4
  5. package/dist/{askCheck-YRVKCMID.js → askCheck-A2XWWDWT.js} +8 -8
  6. package/dist/{askDesign-SJ3MNPFE.js → askDesign-WMNM7RLO.js} +2 -2
  7. package/dist/{branch-5QSVUNDX.js → branch-ALJBAHML.js} +4 -4
  8. package/dist/built-version +1 -1
  9. package/dist/{chunk-LD27GZVA.js → chunk-3FRYNM5V.js} +1 -1
  10. package/dist/{chunk-LXL7IJDI.js → chunk-4QF7YVZ5.js} +3 -3
  11. package/dist/{chunk-N45WGW2P.js → chunk-5MJTFJGT.js} +1 -1
  12. package/dist/{chunk-SORWZAHF.js → chunk-5QM5VR3J.js} +1 -0
  13. package/dist/{chunk-WBDH7XCZ.js → chunk-5UX4ZTFR.js} +6 -6
  14. package/dist/{chunk-PBA5AY4X.js → chunk-7TAUUXVY.js} +1 -1
  15. package/dist/{chunk-LJF44BOU.js → chunk-AFN4FULQ.js} +1 -1
  16. package/dist/{chunk-A5PV6HEK.js → chunk-DZBGDSCK.js} +1 -1
  17. package/dist/{chunk-KYB4QM5B.js → chunk-E2IZIDQ3.js} +2 -2
  18. package/dist/{chunk-I7WSEOJX.js → chunk-F42QFS5Z.js} +1 -1
  19. package/dist/{chunk-ZN6EQMYU.js → chunk-FZDQG67V.js} +2 -2
  20. package/dist/{chunk-TE2FHIWS.js → chunk-HCYTW3DN.js} +1 -1
  21. package/dist/{chunk-OXQ6C5S4.js → chunk-HKMRE22T.js} +1 -1
  22. package/dist/{chunk-3UQ3L5WR.js → chunk-HP7IPXZK.js} +1 -1
  23. package/dist/{chunk-6K75OLQN.js → chunk-HPV2ZVOX.js} +1 -1
  24. package/dist/{chunk-DJMOTMNX.js → chunk-IA7ZPXJ4.js} +8 -8
  25. package/dist/{chunk-DWXXA5BF.js → chunk-IKCS5JTK.js} +1 -1
  26. package/dist/{chunk-LBTJOD75.js → chunk-JH524KAM.js} +2 -2
  27. package/dist/{chunk-RNLMOKGH.js → chunk-KRIVSYJL.js} +1 -1
  28. package/dist/{chunk-GURN5643.js → chunk-KTUSVJW3.js} +2 -2
  29. package/dist/{chunk-Y6P4BRKB.js → chunk-L6SCN5J6.js} +1 -1
  30. package/dist/{chunk-WMMPGPFK.js → chunk-LKRWILE6.js} +7 -2
  31. package/dist/{chunk-QCKGNH44.js → chunk-N3QOIXVQ.js} +1 -1
  32. package/dist/{chunk-4QBROVCM.js → chunk-ND2FWXCR.js} +1 -1
  33. package/dist/{chunk-NULLVW23.js → chunk-PDXOHW2M.js} +2 -2
  34. package/dist/{chunk-D4K2EXMS.js → chunk-PNDUTAZR.js} +5 -5
  35. package/dist/{chunk-UETLXHQ4.js → chunk-QFY6KBY4.js} +1 -1
  36. package/dist/{chunk-43UV77PT.js → chunk-QQDELJQD.js} +3 -3
  37. package/dist/{chunk-7OWMI6MW.js → chunk-QQVNL74P.js} +1 -1
  38. package/dist/{chunk-I5WU4LMN.js → chunk-QYYVW7BX.js} +2 -2
  39. package/dist/{chunk-EVTO23NP.js → chunk-RSSSZURM.js} +222 -71
  40. package/dist/{chunk-2BXG4NQG.js → chunk-SN2GTNL4.js} +1 -1
  41. package/dist/{chunk-7YBIKUGH.js → chunk-SSOJWOYS.js} +1 -1
  42. package/dist/{chunk-QAU4ACLB.js → chunk-SY4PNEQP.js} +1 -1
  43. package/dist/{chunk-7LNVF7KF.js → chunk-SYP6FRXQ.js} +1 -1
  44. package/dist/{chunk-IMEG34TV.js → chunk-UGICWHVH.js} +1 -1
  45. package/dist/{chunk-YWAICNEQ.js → chunk-WGDN4CNI.js} +1 -1
  46. package/dist/{chunk-MKT6HLUK.js → chunk-XTQP2MUZ.js} +1 -1
  47. package/dist/{chunk-YV2YMBDC.js → chunk-XXUZRL3Q.js} +1 -1
  48. package/dist/{chunk-KBG335EU.js → chunk-YJL4PXQB.js} +2 -2
  49. package/dist/{chunk-HUWALF4X.js → chunk-ZDWZ2VI3.js} +1 -1
  50. package/dist/{cliHook-5QAWK55J.js → cliHook-2K2PQZOJ.js} +7 -7
  51. package/dist/{cliHookCheck-GUU4GSRL.js → cliHookCheck-AWYDTDE5.js} +3 -3
  52. package/dist/{codexHook-SJOJJDAN.js → codexHook-HLMVUPGF.js} +9 -9
  53. package/dist/commands/sessions/web/bundle.js +3 -3
  54. package/dist/{commit-ZF3ZK5MP.js → commit-CGRPMTKR.js} +5 -5
  55. package/dist/{doctorNodes-WKB45ZDS.js → doctorNodes-RWVQOYH3.js} +5 -5
  56. package/dist/{done-N5DKY66V.js → done-3VAD7V2R.js} +5 -5
  57. package/dist/{editHook-GO3EG666.js → editHook-S6MCRMW4.js} +7 -7
  58. package/dist/{fixConflict-IZHOVB5C.js → fixConflict-ORCRRXKK.js} +5 -5
  59. package/dist/index.js +52 -52
  60. package/dist/{launchMode-JABYPVKP.js → launchMode-V5JZGAQP.js} +15 -15
  61. package/dist/{list-UPXSS5BF.js → list-ZX7F2OVV.js} +6 -6
  62. package/dist/{migrate-PUUK4MPL.js → migrate-DLSTMFQW.js} +4 -4
  63. package/dist/{next-EQJJNYO6.js → next-MUFPBSR3.js} +14 -14
  64. package/dist/{phaseDone-T7C4KJRU.js → phaseDone-RP54LWOJ.js} +6 -6
  65. package/dist/{piHook-DB35QCNY.js → piHook-RPXIGRLL.js} +7 -7
  66. package/dist/{propose-OURQOJ3D.js → propose-AA5ND2CO.js} +5 -5
  67. package/dist/{refine-UW4PQIIQ.js → refine-B5J2AJSZ.js} +16 -16
  68. package/dist/{restartDaemon-UXFWI7FO.js → restartDaemon-Y7V2QF3N.js} +2 -2
  69. package/dist/{restartNode-ESMKKEZX.js → restartNode-QAGCSNHE.js} +5 -5
  70. package/dist/{review-65D47IRK.js → review-5635HCXL.js} +8 -8
  71. package/dist/{reviewPrComments-QXKVMFOK.js → reviewPrComments-E5Y5AQ7D.js} +5 -5
  72. package/dist/{rewindPhase-JF5EITNU.js → rewindPhase-S6NGWRFK.js} +9 -9
  73. package/dist/{run-LQNYRVK6.js → run-TSPTUSMX.js} +12 -12
  74. package/dist/{run-4776ITKB.js → run-ZRNTAO7O.js} +12 -12
  75. package/dist/{runDaemon-DCEFSJ7T.js → runDaemon-N2RQWY4T.js} +68 -38
  76. package/dist/{runParallelPhase-JDOXAC6I.js → runParallelPhase-V2LPUTA3.js} +8 -8
  77. package/dist/{runRefine-IQRQBG6Q.js → runRefine-DSGHXEKJ.js} +16 -16
  78. package/dist/{scan-GPTSBYX7.js → scan-A4DFCQZJ.js} +3 -3
  79. package/dist/{schemaConfirm-IYKPVP5S.js → schemaConfirm-UDCEVEA7.js} +3 -3
  80. package/dist/{schemaLock-Y35ITWOU.js → schemaLock-4VUXSRRD.js} +3 -3
  81. package/dist/{schemaUnlock-2QUPRWYP.js → schemaUnlock-QZRZFQJ4.js} +3 -3
  82. package/dist/{search-FAXDMX7R.js → search-XUG36ZL2.js} +6 -6
  83. package/dist/{show-CZRMUDLL.js → show-INQEZ755.js} +4 -4
  84. package/dist/{show-66M53CNS.js → show-WD57SDPL.js} +4 -4
  85. package/dist/{signExtension-ADFZWG6K.js → signExtension-TK724AIH.js} +1 -1
  86. package/dist/{update-ESCLMLUB.js → update-W7ANHGDR.js} +2 -2
  87. package/dist/{updateNode-PXT24Q4D.js → updateNode-LUMYF5B4.js} +5 -5
  88. package/dist/{updatePlan-U5UPDSAB.js → updatePlan-PYKAHGKE.js} +5 -5
  89. package/dist/{web-2Y5UGBTJ.js → web-KXHMIQMU.js} +18 -18
  90. package/dist/{web-L6NU62IK.js → web-XUOSXIXK.js} +18 -18
  91. package/package.json +1 -1
@@ -25,9 +25,17 @@ import {
25
25
  import {
26
26
  expandTilde
27
27
  } from "./chunk-LKDW2GWH.js";
28
+ import {
29
+ loginShellCommand
30
+ } from "./chunk-XXUZRL3Q.js";
28
31
  import {
29
32
  daemonLog
30
33
  } from "./chunk-MRUIXQXS.js";
34
+ import {
35
+ NODE_VERSION_KEY,
36
+ declaredNode,
37
+ resolveNodeSpec
38
+ } from "./chunk-5QM5VR3J.js";
31
39
  import {
32
40
  getCachedOrigin
33
41
  } from "./chunk-FLDRXYEM.js";
@@ -190,12 +198,20 @@ function allocateTree(requestedCwd, boundTreeRoots, options = {}) {
190
198
  return { cwd: path, kind: "worktree", created: true, clone, ready };
191
199
  }
192
200
 
201
+ // src/commands/sessions/daemon/worktree/installFailureMessage.ts
202
+ function installFailureMessage(worktreePath, { path, reason, output }) {
203
+ const where = path ? ` in ${path}` : "";
204
+ const tail = output ? `:
205
+ ${output}` : "";
206
+ return `worktree ${worktreePath} install${where} failed (${reason})${tail}`;
207
+ }
208
+
193
209
  // src/commands/sessions/daemon/worktree/seedWorktree.ts
194
- import { copyFileSync, existsSync as existsSync3, mkdirSync } from "fs";
195
- import { dirname as dirname2, join as join3 } from "path";
210
+ import { copyFileSync, existsSync as existsSync4, mkdirSync } from "fs";
211
+ import { dirname as dirname3, join as join4 } from "path";
196
212
 
197
213
  // src/commands/sessions/daemon/worktree/installPaths.ts
198
- import { resolve } from "path";
214
+ import { resolve as resolve2 } from "path";
199
215
 
200
216
  // src/commands/sessions/daemon/worktree/enclosingPaths.ts
201
217
  import { isAbsolute, relative } from "path";
@@ -238,10 +254,10 @@ function detectInstallCommand(dir) {
238
254
  import { spawn } from "child_process";
239
255
 
240
256
  // src/commands/sessions/daemon/worktree/installInvocation.ts
241
- function installInvocation(worktreePath, command) {
257
+ function installInvocation(worktreePath, command, binDir) {
242
258
  const windows = /^[A-Za-z]:[\\/]/.test(worktreePath);
243
259
  const shell = windows ? "cmd.exe" : process.env.SHELL ?? "bash";
244
- const args = windows ? ["/c", `cd /d ${quoteForCmd(worktreePath)} && ${command}`] : ["-l", "-c", `cd ${quoteForPosixShell(worktreePath)} && ${command}`];
260
+ const args = windows ? ["/c", windowsCommand(worktreePath, command, binDir)] : ["-l", "-c", posixCommand(worktreePath, command, binDir)];
245
261
  return [
246
262
  shell,
247
263
  args,
@@ -249,10 +265,18 @@ function installInvocation(worktreePath, command) {
249
265
  cwd: worktreePath,
250
266
  detached: true,
251
267
  windowsHide: true,
252
- stdio: ["ignore", "ignore", "pipe"]
268
+ stdio: ["ignore", "pipe", "pipe"]
253
269
  }
254
270
  ];
255
271
  }
272
+ function windowsCommand(worktreePath, command, binDir) {
273
+ const inner = `cd /d ${quoteForCmd(worktreePath)} && ${command}`;
274
+ return binDir ? `set "PATH=${binDir.replaceAll('"', "")};%PATH%" && ${inner}` : inner;
275
+ }
276
+ function posixCommand(worktreePath, command, binDir) {
277
+ const inner = `cd ${quoteForPosixShell(worktreePath)} && ${command}`;
278
+ return binDir ? loginShellCommand(inner, binDir) : inner;
279
+ }
256
280
  function quoteForCmd(value) {
257
281
  return `"${value.replaceAll('"', "")}"`;
258
282
  }
@@ -260,18 +284,67 @@ function quoteForPosixShell(value) {
260
284
  return `'${value.replaceAll("'", `'\\''`)}'`;
261
285
  }
262
286
 
263
- // src/commands/sessions/daemon/worktree/missingToolMessage.ts
264
- var COMMAND_NOT_FOUND_EXIT_CODES = /* @__PURE__ */ new Set([127, 9009]);
265
- var INSTALL_HINTS = {
266
- pnpm: "npm install -g pnpm (or: corepack enable pnpm)",
267
- yarn: "npm install -g yarn (or: corepack enable yarn)",
268
- bun: "npm install -g bun"
287
+ // src/commands/sessions/daemon/worktree/findNodePin.ts
288
+ import { existsSync as existsSync3, readFileSync } from "fs";
289
+ import { dirname as dirname2, join as join3, resolve } from "path";
290
+ var PIN_FILES = [".node-version", ".nvmrc"];
291
+ function readPin(file) {
292
+ if (!existsSync3(file)) return void 0;
293
+ try {
294
+ return readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).find((line) => line && !line.startsWith("#"));
295
+ } catch {
296
+ return void 0;
297
+ }
298
+ }
299
+ function findNodePin(dir, root) {
300
+ const top = resolve(root);
301
+ let current = resolve(dir);
302
+ for (; ; ) {
303
+ for (const name of PIN_FILES) {
304
+ const file = join3(current, name);
305
+ const spec = readPin(file);
306
+ if (spec) return { file, spec };
307
+ }
308
+ const parent = dirname2(current);
309
+ if (current === top || parent === current) return void 0;
310
+ current = parent;
311
+ }
312
+ }
313
+
314
+ // src/commands/sessions/daemon/worktree/resolveInstallNode.ts
315
+ var defaultDeps = {
316
+ resolve: (spec) => resolveNodeSpec(spec),
317
+ declared: declaredNode
269
318
  };
270
- function missingToolMessage(command, code) {
271
- if (code === null || !COMMAND_NOT_FOUND_EXIT_CODES.has(code)) return null;
272
- const tool = command.trim().split(/\s+/)[0];
273
- const hint = INSTALL_HINTS[tool];
274
- return hint ? `${tool} is not installed; install it with: ${hint}` : `${tool} is not installed`;
319
+ function resolveInstallNode(dir, root, deps = defaultDeps) {
320
+ const pin = findNodePin(dir, root);
321
+ if (!pin) return unpinnedNode(deps.declared());
322
+ const resolution = deps.resolve(pin.spec);
323
+ if (!resolution.ok)
324
+ return {
325
+ ok: false,
326
+ error: `${pin.file} pins node "${pin.spec}" but it could not be resolved: ${resolution.error}`
327
+ };
328
+ const { binDir, version } = resolution.node;
329
+ return {
330
+ ok: true,
331
+ binDir,
332
+ description: `node v${version} (${binDir}) pinned by ${pin.file}`
333
+ };
334
+ }
335
+ function unpinnedNode(declared) {
336
+ if (!declared?.ok)
337
+ return {
338
+ ok: true,
339
+ binDir: void 0,
340
+ description: `the login shell's default node (no .node-version or .nvmrc, and ${NODE_VERSION_KEY} ${declared ? "unresolved" : "unset"})`
341
+ };
342
+ const { binDir, version } = declared.node;
343
+ return {
344
+ ok: true,
345
+ binDir,
346
+ description: `the daemon's node v${version} (${binDir}) from ${NODE_VERSION_KEY}; no .node-version or .nvmrc`
347
+ };
275
348
  }
276
349
 
277
350
  // src/commands/sessions/daemon/killTree.ts
@@ -322,86 +395,155 @@ function stopInstall(worktreePath) {
322
395
  }
323
396
  }
324
397
 
325
- // src/commands/sessions/daemon/worktree/spawnInstall.ts
326
- var STDERR_TAIL = 2e3;
327
- function spawnInstall(worktreePath, cwd, command, where, onDone) {
328
- daemonLog(`worktree ${worktreePath} installing deps${where}: ${command}`);
329
- const child = spawn(...installInvocation(cwd, command));
330
- trackInstall(worktreePath, child);
331
- let stderr = "";
332
- child.stderr?.on("data", (chunk) => {
333
- stderr = (stderr + chunk.toString()).slice(-STDERR_TAIL);
334
- });
398
+ // src/commands/sessions/daemon/worktree/captureOutputTail.ts
399
+ var OUTPUT_TAIL = 2e3;
400
+ function captureOutputTail(child) {
401
+ let output = "";
402
+ const capture = (chunk) => {
403
+ output = (output + chunk.toString()).slice(-OUTPUT_TAIL);
404
+ };
405
+ child.stdout?.on("data", capture);
406
+ child.stderr?.on("data", capture);
407
+ return () => output.trim();
408
+ }
409
+
410
+ // src/commands/sessions/daemon/worktree/missingToolMessage.ts
411
+ var COMMAND_NOT_FOUND_EXIT_CODES = /* @__PURE__ */ new Set([127, 9009]);
412
+ var INSTALL_HINTS = {
413
+ pnpm: "npm install -g pnpm (or: corepack enable pnpm)",
414
+ yarn: "npm install -g yarn (or: corepack enable yarn)",
415
+ bun: "npm install -g bun"
416
+ };
417
+ function missingToolMessage(command, code) {
418
+ if (code === null || !COMMAND_NOT_FOUND_EXIT_CODES.has(code)) return null;
419
+ const tool = command.trim().split(/\s+/)[0];
420
+ const hint = INSTALL_HINTS[tool];
421
+ return hint ? `${tool} is not installed; install it with: ${hint}` : `${tool} is not installed`;
422
+ }
423
+
424
+ // src/commands/sessions/daemon/worktree/closeFailure.ts
425
+ function closeFailure(command, code, signal) {
426
+ if (signal) return `signal ${signal}`;
427
+ const missing = missingToolMessage(command, code);
428
+ return missing ? `exit ${code}: ${missing}` : `exit ${code}`;
429
+ }
430
+
431
+ // src/commands/sessions/daemon/worktree/watchInstall.ts
432
+ function watchInstall(worktreePath, child, command, where, onDone) {
433
+ const tail = captureOutputTail(child);
335
434
  let settled = false;
336
- const settle = (ok, outcome) => {
435
+ const settle = (failure) => {
337
436
  if (settled) return;
338
437
  settled = true;
339
438
  const stopped = !untrackInstall(worktreePath, child);
340
- daemonLog(`worktree ${worktreePath} install${where} ${outcome}`);
341
- onDone({ ok, stopped });
439
+ const reason = stopped ? "stopped at teardown" : failure;
440
+ if (reason === void 0) {
441
+ daemonLog(`worktree ${worktreePath} install${where} complete`);
442
+ onDone({ ok: true });
443
+ return;
444
+ }
445
+ const output = tail();
446
+ daemonLog(
447
+ `worktree ${worktreePath} install${where} failed (${reason}): ${output || "no output"}`
448
+ );
449
+ onDone({ ok: false, stopped, reason, output });
342
450
  };
343
- child.on(
344
- "error",
345
- (error) => settle(false, `failed to start: ${error.message}`)
346
- );
451
+ child.on("error", (error) => settle(`failed to start: ${error.message}`));
347
452
  child.on(
348
453
  "close",
349
- (code, signal) => settle(
350
- code === 0,
351
- code === 0 ? "complete" : `failed (${signal ? `signal ${signal}` : `exit ${code}`}): ${missingToolMessage(command, code) ?? (stderr.trim() || "no output")}`
352
- )
454
+ (code, signal) => settle(code === 0 ? void 0 : closeFailure(command, code, signal))
353
455
  );
354
456
  }
355
457
 
458
+ // src/commands/sessions/daemon/worktree/spawnInstall.ts
459
+ function spawnInstall(worktreePath, cwd, command, where, onDone) {
460
+ daemonLog(`worktree ${worktreePath} installing deps${where}: ${command}`);
461
+ const node = resolveInstallNode(cwd, worktreePath);
462
+ if (!node.ok) {
463
+ daemonLog(
464
+ `worktree ${worktreePath} install${where} not run: ${node.error}`
465
+ );
466
+ onDone({ ok: false, stopped: false, reason: node.error, output: "" });
467
+ return;
468
+ }
469
+ daemonLog(
470
+ `worktree ${worktreePath} install${where} runs on ${node.description}`
471
+ );
472
+ const child = spawn(...installInvocation(cwd, command, node.binDir));
473
+ trackInstall(worktreePath, child);
474
+ watchInstall(worktreePath, child, command, where, onDone);
475
+ }
476
+
356
477
  // src/commands/sessions/daemon/worktree/startPathInstall.ts
357
478
  function startPathInstall(worktreePath, rel, dir, onDone) {
358
479
  const command = detectInstallCommand(dir);
359
480
  if (!command) {
360
- daemonLog(
361
- `worktree ${worktreePath} install in ${rel} failed: no package.json at ${dir}`
362
- );
363
- return "failed";
481
+ const reason = `no package.json at ${dir}`;
482
+ daemonLog(`worktree ${worktreePath} install in ${rel} failed: ${reason}`);
483
+ onDone({ ok: false, stopped: false, reason, output: "" });
484
+ return;
364
485
  }
365
- spawnInstall(
366
- worktreePath,
367
- dir,
368
- command,
369
- ` in ${rel}`,
370
- (outcome) => onDone(outcome.ok && !outcome.stopped, outcome.stopped)
371
- );
372
- return "running";
486
+ spawnInstall(worktreePath, dir, command, ` in ${rel}`, onDone);
487
+ }
488
+
489
+ // src/commands/sessions/daemon/worktree/pathFailure.ts
490
+ function pathFailure(path, outcome) {
491
+ if (outcome.ok) return void 0;
492
+ return { path, reason: outcome.reason, output: outcome.output };
493
+ }
494
+
495
+ // src/commands/sessions/daemon/worktree/pathsOutcome.ts
496
+ function pathsOutcome(paths, states, failures) {
497
+ const failed = failures.find((failure) => failure !== void 0);
498
+ if (failed) return { ok: false, ...failed };
499
+ const skipped = states.indexOf("skipped");
500
+ if (skipped === -1) return { ok: true };
501
+ return { ok: false, path: paths[skipped], reason: "skipped", output: "" };
502
+ }
503
+
504
+ // src/commands/sessions/daemon/worktree/pathsProgress.ts
505
+ function pathsProgress(paths, states, failures, onInstalling) {
506
+ const running2 = paths.filter((_, i) => states[i] === "running");
507
+ if (running2.length > 0) {
508
+ onInstalling(running2.join(", "));
509
+ return void 0;
510
+ }
511
+ if (states.includes("pending")) return void 0;
512
+ return pathsOutcome(paths, states, failures);
373
513
  }
374
514
 
375
515
  // src/commands/sessions/daemon/worktree/installPaths.ts
376
516
  function installPaths(worktreePath, paths, onSeeded, onInstalling) {
377
- const dirs = paths.map((rel) => resolve(worktreePath, rel));
517
+ const dirs = paths.map((rel) => resolve2(worktreePath, rel));
378
518
  const enclosing = enclosingPaths(dirs);
379
519
  const states = paths.map(() => "pending");
520
+ const failures = paths.map(() => void 0);
380
521
  let stopped = false;
522
+ let seeded = false;
381
523
  const pump = () => {
382
524
  for (let i = 0; i < paths.length; i++) {
383
525
  if (states[i] !== "pending") continue;
384
526
  const action = pendingPathAction(enclosing[i], states, paths, stopped);
385
- if (action.kind === "start")
386
- states[i] = startPathInstall(
387
- worktreePath,
388
- paths[i],
389
- dirs[i],
390
- (ok, wasStopped) => {
391
- states[i] = ok ? "ok" : "failed";
392
- stopped ||= wasStopped;
393
- pump();
394
- }
395
- );
527
+ if (action.kind === "start") {
528
+ states[i] = "running";
529
+ startPathInstall(worktreePath, paths[i], dirs[i], (outcome2) => {
530
+ states[i] = outcome2.ok ? "ok" : "failed";
531
+ failures[i] = pathFailure(paths[i], outcome2);
532
+ stopped ||= !outcome2.ok && outcome2.stopped;
533
+ pump();
534
+ });
535
+ }
396
536
  if (action.kind !== "skip") continue;
397
537
  states[i] = "skipped";
398
538
  daemonLog(
399
539
  `worktree ${worktreePath} install skipping ${paths[i]}: ${action.reason}`
400
540
  );
401
541
  }
402
- const running2 = paths.filter((_, i) => states[i] === "running");
403
- if (running2.length > 0) onInstalling(running2.join(", "));
404
- else if (!states.includes("pending")) onSeeded();
542
+ const outcome = pathsProgress(paths, states, failures, onInstalling);
543
+ if (outcome && !seeded) {
544
+ seeded = true;
545
+ onSeeded(outcome);
546
+ }
405
547
  };
406
548
  pump();
407
549
  }
@@ -422,11 +564,19 @@ function runInstall(worktreePath, clone, install, onSeeded, onInstalling = () =>
422
564
  }
423
565
  const command = resolveInstallCommand(clone, install);
424
566
  if (!command) {
425
- onSeeded();
567
+ onSeeded({ ok: true });
426
568
  return;
427
569
  }
428
570
  onInstalling();
429
- spawnInstall(worktreePath, worktreePath, command, "", () => onSeeded());
571
+ spawnInstall(
572
+ worktreePath,
573
+ worktreePath,
574
+ command,
575
+ "",
576
+ (outcome) => onSeeded(
577
+ outcome.ok ? outcome : { ok: false, reason: outcome.reason, output: outcome.output }
578
+ )
579
+ );
430
580
  }
431
581
 
432
582
  // src/commands/sessions/daemon/worktree/seedWorktree.ts
@@ -438,11 +588,11 @@ function seedWorktree(worktreePath, clone, onSeeded = () => {
438
588
  }
439
589
  function copyConfigFiles(worktreePath, clone, copy) {
440
590
  for (const rel of copy) {
441
- const src = join3(clone, rel);
442
- if (!existsSync3(src)) continue;
443
- const dest = join3(worktreePath, rel);
591
+ const src = join4(clone, rel);
592
+ if (!existsSync4(src)) continue;
593
+ const dest = join4(worktreePath, rel);
444
594
  try {
445
- mkdirSync(dirname2(dest), { recursive: true });
595
+ mkdirSync(dirname3(dest), { recursive: true });
446
596
  copyFileSync(src, dest);
447
597
  daemonLog(`worktree ${worktreePath} seeded ${rel}`);
448
598
  } catch (error) {
@@ -470,6 +620,7 @@ function worktreeWithBranch(listing, branch) {
470
620
 
471
621
  export {
472
622
  allocateTree,
623
+ installFailureMessage,
473
624
  killTree,
474
625
  stopInstall,
475
626
  seedWorktree,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  REVIEW_PHASE_NAME
3
- } from "./chunk-6K75OLQN.js";
3
+ } from "./chunk-HPV2ZVOX.js";
4
4
  import {
5
5
  phaseSessions
6
6
  } from "./chunk-ZZVYRC77.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-F4XCHVD7.js";
10
10
  import {
11
11
  REVIEW_PHASE_NAME
12
- } from "./chunk-6K75OLQN.js";
12
+ } from "./chunk-HPV2ZVOX.js";
13
13
  import {
14
14
  serializeManualChecks
15
15
  } from "./chunk-QNVYNVAM.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-VDXS55BC.js";
5
5
  import {
6
6
  harnessAdapter
7
- } from "./chunk-YV2YMBDC.js";
7
+ } from "./chunk-XXUZRL3Q.js";
8
8
  import {
9
9
  activeHarness
10
10
  } from "./chunk-BFQSGIN6.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  firstBrokenHop
3
- } from "./chunk-OXQ6C5S4.js";
3
+ } from "./chunk-HKMRE22T.js";
4
4
  import {
5
5
  describePeerError
6
6
  } from "./chunk-VABNWHSE.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  REVIEW_PHASE_NAME
3
- } from "./chunk-6K75OLQN.js";
3
+ } from "./chunk-HPV2ZVOX.js";
4
4
 
5
5
  // src/commands/backlog/authoredPhases.ts
6
6
  function authoredPhases(plan) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  hasOpenPhaseUnlock
3
- } from "./chunk-HUWALF4X.js";
3
+ } from "./chunk-ZDWZ2VI3.js";
4
4
  import {
5
5
  resolveSessionItemId
6
6
  } from "./chunk-FPWL4VRC.js";
@@ -19,7 +19,7 @@ import {
19
19
  emptyScanUsage,
20
20
  harnessAdapter,
21
21
  scanUsageTokens
22
- } from "./chunk-YV2YMBDC.js";
22
+ } from "./chunk-XXUZRL3Q.js";
23
23
  import {
24
24
  inboxFeature
25
25
  } from "./chunk-LKZ7J5AK.js";
@@ -35,7 +35,7 @@ import {
35
35
  } from "./chunk-XDIVXGPQ.js";
36
36
  import {
37
37
  declaredNode
38
- } from "./chunk-SORWZAHF.js";
38
+ } from "./chunk-5QM5VR3J.js";
39
39
  import {
40
40
  loadConfig
41
41
  } from "./chunk-UFSOFNXQ.js";
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-P56S7RYB.js";
7
7
  import {
8
8
  resolveRewindPlan
9
- } from "./chunk-LBTJOD75.js";
9
+ } from "./chunk-JH524KAM.js";
10
10
  import {
11
11
  resolvePlan
12
- } from "./chunk-7OWMI6MW.js";
12
+ } from "./chunk-QQVNL74P.js";
13
13
  import {
14
14
  resetPhaseAndDependents,
15
15
  updateStatus
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  currentExecutionIdentity,
6
6
  getSchemaSessionApprovalPath
7
- } from "./chunk-I7WSEOJX.js";
7
+ } from "./chunk-F42QFS5Z.js";
8
8
  import {
9
9
  closeDb,
10
10
  getDb,
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  decideToolOperations,
3
3
  logPolicyDeny
4
- } from "./chunk-43UV77PT.js";
4
+ } from "./chunk-QQDELJQD.js";
5
5
  import "./chunk-CDU6M5IX.js";
6
- import "./chunk-YWAICNEQ.js";
7
- import "./chunk-HUWALF4X.js";
6
+ import "./chunk-WGDN4CNI.js";
7
+ import "./chunk-ZDWZ2VI3.js";
8
8
  import "./chunk-CUOHHT2F.js";
9
9
  import {
10
10
  currentExecutionIdentity
11
- } from "./chunk-I7WSEOJX.js";
11
+ } from "./chunk-F42QFS5Z.js";
12
12
  import "./chunk-ZMH7UZNP.js";
13
- import "./chunk-QAU4ACLB.js";
13
+ import "./chunk-SY4PNEQP.js";
14
14
  import "./chunk-VDXS55BC.js";
15
15
  import "./chunk-HKGCLAZ7.js";
16
16
  import "./chunk-FPWL4VRC.js";
@@ -28,7 +28,7 @@ import "./chunk-IBVCCKC3.js";
28
28
  import "./chunk-FAYB2ZL6.js";
29
29
  import {
30
30
  claudeAdapter
31
- } from "./chunk-YV2YMBDC.js";
31
+ } from "./chunk-XXUZRL3Q.js";
32
32
  import "./chunk-MRUIXQXS.js";
33
33
  import "./chunk-DIAC4XYA.js";
34
34
  import "./chunk-5SXNWSSH.js";
@@ -46,7 +46,7 @@ import "./chunk-EW2ZM2PC.js";
46
46
  import "./chunk-MYH4MQX2.js";
47
47
  import "./chunk-XDIVXGPQ.js";
48
48
  import "./chunk-ES5IPLDM.js";
49
- import "./chunk-SORWZAHF.js";
49
+ import "./chunk-5QM5VR3J.js";
50
50
  import "./chunk-UFSOFNXQ.js";
51
51
  import "./chunk-FLDRXYEM.js";
52
52
  import "./chunk-GRXFWFGP.js";
@@ -5,9 +5,9 @@ import {
5
5
  findTruncatedReadDenyRaw,
6
6
  isApprovedRead,
7
7
  splitCompound
8
- } from "./chunk-QAU4ACLB.js";
8
+ } from "./chunk-SY4PNEQP.js";
9
9
  import "./chunk-VDXS55BC.js";
10
- import "./chunk-YV2YMBDC.js";
10
+ import "./chunk-XXUZRL3Q.js";
11
11
  import "./chunk-MRUIXQXS.js";
12
12
  import "./chunk-DIAC4XYA.js";
13
13
  import "./chunk-5SXNWSSH.js";
@@ -19,7 +19,7 @@ import "./chunk-DUNO7WBT.js";
19
19
  import "./chunk-BFQSGIN6.js";
20
20
  import "./chunk-D7UZLH36.js";
21
21
  import "./chunk-XDIVXGPQ.js";
22
- import "./chunk-SORWZAHF.js";
22
+ import "./chunk-5QM5VR3J.js";
23
23
  import "./chunk-UFSOFNXQ.js";
24
24
  import "./chunk-FLDRXYEM.js";
25
25
  import "./chunk-GRXFWFGP.js";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  decideToolOperations,
3
3
  logPolicyDeny
4
- } from "./chunk-43UV77PT.js";
4
+ } from "./chunk-QQDELJQD.js";
5
5
  import "./chunk-CDU6M5IX.js";
6
- import "./chunk-YWAICNEQ.js";
7
- import "./chunk-HUWALF4X.js";
6
+ import "./chunk-WGDN4CNI.js";
7
+ import "./chunk-ZDWZ2VI3.js";
8
8
  import "./chunk-CUOHHT2F.js";
9
9
  import {
10
10
  currentExecutionIdentity
11
- } from "./chunk-I7WSEOJX.js";
11
+ } from "./chunk-F42QFS5Z.js";
12
12
  import "./chunk-ZMH7UZNP.js";
13
- import "./chunk-QAU4ACLB.js";
13
+ import "./chunk-SY4PNEQP.js";
14
14
  import "./chunk-VDXS55BC.js";
15
15
  import "./chunk-HKGCLAZ7.js";
16
16
  import {
@@ -20,7 +20,7 @@ import "./chunk-FPWL4VRC.js";
20
20
  import "./chunk-H63MI5HI.js";
21
21
  import {
22
22
  adviceHookPayload
23
- } from "./chunk-QCKGNH44.js";
23
+ } from "./chunk-N3QOIXVQ.js";
24
24
  import "./chunk-P7FVAGFQ.js";
25
25
  import "./chunk-XJTXAL22.js";
26
26
  import {
@@ -40,11 +40,11 @@ import "./chunk-ZZVYRC77.js";
40
40
  import "./chunk-J6ULAU7G.js";
41
41
  import "./chunk-IBVCCKC3.js";
42
42
  import "./chunk-FAYB2ZL6.js";
43
- import "./chunk-TE2FHIWS.js";
43
+ import "./chunk-HCYTW3DN.js";
44
44
  import "./chunk-EM5TGZYD.js";
45
45
  import {
46
46
  codexAdapter
47
- } from "./chunk-YV2YMBDC.js";
47
+ } from "./chunk-XXUZRL3Q.js";
48
48
  import "./chunk-MRUIXQXS.js";
49
49
  import "./chunk-DIAC4XYA.js";
50
50
  import "./chunk-5SXNWSSH.js";
@@ -67,7 +67,7 @@ import "./chunk-XA3VSUG6.js";
67
67
  import "./chunk-GVVK5XFZ.js";
68
68
  import "./chunk-XDIVXGPQ.js";
69
69
  import "./chunk-ES5IPLDM.js";
70
- import "./chunk-SORWZAHF.js";
70
+ import "./chunk-5QM5VR3J.js";
71
71
  import "./chunk-UFSOFNXQ.js";
72
72
  import "./chunk-FLDRXYEM.js";
73
73
  import "./chunk-GRXFWFGP.js";