@staff0rd/assist 0.1163.0 → 0.1165.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 (82) hide show
  1. package/dist/.build-files +76 -76
  2. package/dist/{addActivity-FI4P6OTC.js → addActivity-WY6S5X4Y.js} +2 -2
  3. package/dist/{addPhase-TAU5TNIH.js → addPhase-26CJUFWT.js} +3 -3
  4. package/dist/{advise-P6UNZDSJ.js → advise-GLQAAGK2.js} +3 -3
  5. package/dist/{askCheck-Y5ZASXYZ.js → askCheck-TKUOAGON.js} +7 -7
  6. package/dist/{askDesign-TZKXMGMV.js → askDesign-AY4MBIGE.js} +1 -1
  7. package/dist/{branch-6T6R4B3N.js → branch-24M6R4M4.js} +3 -3
  8. package/dist/built-version +1 -1
  9. package/dist/{chunk-26N4PV7Z.js → chunk-2LLX2WAX.js} +1 -1
  10. package/dist/{chunk-RMGPNDEN.js → chunk-5U6ZO5DB.js} +45 -34
  11. package/dist/{chunk-BEZEB6OF.js → chunk-6QZ5K263.js} +2 -2
  12. package/dist/{chunk-G7GUYBT3.js → chunk-7CFY7YXX.js} +1 -1
  13. package/dist/{chunk-LPBBNHBJ.js → chunk-7LDL3SBF.js} +1 -1
  14. package/dist/{chunk-74UYKNXC.js → chunk-ARVSII44.js} +2 -2
  15. package/dist/{chunk-QEFHPIMP.js → chunk-BD5RV37B.js} +3 -3
  16. package/dist/{chunk-QAZQJ5PB.js → chunk-CXO3B53M.js} +1 -1
  17. package/dist/{chunk-CVSVONYT.js → chunk-FSNGBFAH.js} +1 -1
  18. package/dist/{chunk-2S5Q3U67.js → chunk-G3WCW5X6.js} +1 -1
  19. package/dist/{chunk-NY7FSQLK.js → chunk-GOMCTICU.js} +7 -7
  20. package/dist/{chunk-ASM6OJRK.js → chunk-GSTZWNA7.js} +1 -1
  21. package/dist/{chunk-7KTG4VNA.js → chunk-HH5HZE63.js} +1 -1
  22. package/dist/{chunk-NA5TFFHL.js → chunk-I6S6WJGX.js} +1 -1
  23. package/dist/{chunk-J265JKFW.js → chunk-KPNFDA4V.js} +1 -1
  24. package/dist/{chunk-CMQE2SXC.js → chunk-KVZLXGX3.js} +1 -1
  25. package/dist/{chunk-HEP6K2DT.js → chunk-L3ITNM4T.js} +1 -1
  26. package/dist/{chunk-7NRDYDQO.js → chunk-LAFVAYYR.js} +6 -6
  27. package/dist/{chunk-ILRYEIH3.js → chunk-LC3CKCQD.js} +1 -1
  28. package/dist/{chunk-I6B6W6WT.js → chunk-LX6UHQG4.js} +1 -1
  29. package/dist/{chunk-AFGBWFOC.js → chunk-N4TYIEKN.js} +2 -1
  30. package/dist/{chunk-WQ3ABZ4N.js → chunk-PRDNXBPX.js} +1 -1
  31. package/dist/{chunk-JZ2TTDJ5.js → chunk-Q5AGOAE3.js} +2 -2
  32. package/dist/{chunk-ZRVQDJVQ.js → chunk-QG6KFBUQ.js} +1 -1
  33. package/dist/{chunk-YZSTCQUE.js → chunk-RGDUQV4P.js} +4 -4
  34. package/dist/{chunk-7VK2KF6L.js → chunk-RV6ZY6BE.js} +1 -1
  35. package/dist/{chunk-EXGBNBBJ.js → chunk-S65PHW2M.js} +1 -1
  36. package/dist/{chunk-NC5X72HQ.js → chunk-T67PNCOV.js} +1 -1
  37. package/dist/{chunk-DJ5UUPZR.js → chunk-UDEJCU6V.js} +1 -1
  38. package/dist/{chunk-OX4K4FAY.js → chunk-UDHMQBPS.js} +2 -2
  39. package/dist/{chunk-XTD6227R.js → chunk-V2RP2CVY.js} +1 -1
  40. package/dist/{chunk-AGBHU2F2.js → chunk-VYW6R64U.js} +1 -1
  41. package/dist/{chunk-HN5RRUW2.js → chunk-WQ6JHTXL.js} +1 -1
  42. package/dist/{chunk-EIA6AM33.js → chunk-XSCOP5MH.js} +1 -1
  43. package/dist/{chunk-FJQSHCU3.js → chunk-Z2Z5ESUS.js} +2 -2
  44. package/dist/{chunk-BP6SFWR6.js → chunk-ZCDH4R26.js} +1 -1
  45. package/dist/{cliHook-E5HX4RV7.js → cliHook-PWBPVU4N.js} +5 -5
  46. package/dist/{cliHookCheck-KQDTKJBA.js → cliHookCheck-HKYLHFZG.js} +2 -2
  47. package/dist/{codexHook-EMML4X3I.js → codexHook-WMVVGO5L.js} +7 -7
  48. package/dist/commands/extension/extension/updates.json +2 -2
  49. package/dist/commands/sessions/web/bundle.js +428 -428
  50. package/dist/{commit-KOTH6G6L.js → commit-PNFJAZXS.js} +3 -3
  51. package/dist/{doctorNodes-VPG6KJ6T.js → doctorNodes-4EYU64M2.js} +3 -3
  52. package/dist/{done-G57I4IXY.js → done-ANSC3ABM.js} +4 -4
  53. package/dist/{drainDaemon-7V6RMDRT.js → drainDaemon-2UUTCBNC.js} +1 -1
  54. package/dist/{editHook-HDXB5IRZ.js → editHook-NF6RN3TV.js} +5 -5
  55. package/dist/{fixConflict-YPNQ3Z5O.js → fixConflict-FAHNBQLY.js} +4 -4
  56. package/dist/index.js +47 -47
  57. package/dist/{launchMode-3PLZA4EV.js → launchMode-AF37LKHB.js} +13 -13
  58. package/dist/{list-EXCFXUUV.js → list-AG7O4BRS.js} +5 -5
  59. package/dist/{next-MELQDUE4.js → next-DJU4TRTO.js} +12 -12
  60. package/dist/{piHook-SXJBRASG.js → piHook-MGSND6VD.js} +5 -5
  61. package/dist/{propose-37TNXC2B.js → propose-EDHBG6QK.js} +4 -4
  62. package/dist/{refine-VY42GT5E.js → refine-7FKPNKVF.js} +14 -14
  63. package/dist/{restartNode-HTMMB6LW.js → restartNode-JVPQCP32.js} +5 -5
  64. package/dist/{review-S5JIPTTJ.js → review-FCS7FS6H.js} +4 -4
  65. package/dist/{reviewPrComments-PLRIHXWC.js → reviewPrComments-HHWRUH3P.js} +4 -4
  66. package/dist/{rewindPhase-MKAAJZ3B.js → rewindPhase-IIE2IPW6.js} +8 -8
  67. package/dist/{run-IH2SPTOS.js → run-2HGZBXNW.js} +10 -10
  68. package/dist/{run-4VCFD6GC.js → run-UCFL6W6N.js} +10 -10
  69. package/dist/{runDaemon-5RRULUHB.js → runDaemon-KZIP4KKK.js} +149 -117
  70. package/dist/{runRefine-SM6EHRUB.js → runRefine-4Q4LFO3H.js} +14 -14
  71. package/dist/{scan-Q2LQ6C2H.js → scan-FHKMFKHA.js} +2 -2
  72. package/dist/{schemaConfirm-DVNHG5CE.js → schemaConfirm-6IJUZE2N.js} +2 -2
  73. package/dist/{schemaUnlock-AQAEVGUD.js → schemaUnlock-I24T52GB.js} +2 -2
  74. package/dist/{search-PFHCJUFA.js → search-LXX6MHPH.js} +5 -5
  75. package/dist/{show-EQCAKDSF.js → show-2TZP23GK.js} +3 -3
  76. package/dist/{show-NHSD46FE.js → show-NM54HUDH.js} +3 -3
  77. package/dist/{signExtension-JEF46IDR.js → signExtension-BUBGXODN.js} +1 -1
  78. package/dist/{updateNode-4MEOT6LH.js → updateNode-YIXJFDV3.js} +5 -5
  79. package/dist/{updatePlan-V57DKNB5.js → updatePlan-5AMQJFD5.js} +4 -4
  80. package/dist/{web-ZRZAYS5K.js → web-B7QVOACF.js} +16 -16
  81. package/dist/{web-OTIQYJWI.js → web-KJMLTKJP.js} +16 -16
  82. package/package.json +1 -1
@@ -25,13 +25,13 @@ import {
25
25
  describePersistedSession,
26
26
  loadPersistedSessions,
27
27
  persistLiveSessions
28
- } from "./chunk-RMGPNDEN.js";
28
+ } from "./chunk-5U6ZO5DB.js";
29
29
  import "./chunk-XT3AOF2P.js";
30
30
  import {
31
31
  formatScanUsage,
32
32
  inboxScanBlocker,
33
33
  runInboxScan
34
- } from "./chunk-7KTG4VNA.js";
34
+ } from "./chunk-HH5HZE63.js";
35
35
  import "./chunk-2JYMVJGZ.js";
36
36
  import {
37
37
  showNotification
@@ -48,7 +48,7 @@ import {
48
48
  recordPhaseSession,
49
49
  releaseLock,
50
50
  requestPause
51
- } from "./chunk-EIA6AM33.js";
51
+ } from "./chunk-XSCOP5MH.js";
52
52
  import {
53
53
  buildResumePrompt,
54
54
  wrapRestartNudge
@@ -69,12 +69,12 @@ import {
69
69
  import {
70
70
  OneShotUnavailableError,
71
71
  runOneShotPrompt
72
- } from "./chunk-AGBHU2F2.js";
72
+ } from "./chunk-VYW6R64U.js";
73
73
  import {
74
74
  locateConversation,
75
75
  readTranscriptHead,
76
76
  transcriptMessages
77
- } from "./chunk-XTD6227R.js";
77
+ } from "./chunk-V2RP2CVY.js";
78
78
  import {
79
79
  CHECK_NOTE_KEY
80
80
  } from "./chunk-OLE7XSNB.js";
@@ -106,7 +106,7 @@ import {
106
106
  toNodeSessionId,
107
107
  usageWindowKey,
108
108
  watcherLogPath
109
- } from "./chunk-WQ3ABZ4N.js";
109
+ } from "./chunk-PRDNXBPX.js";
110
110
  import {
111
111
  newTraceId
112
112
  } from "./chunk-4HKB2TAG.js";
@@ -118,7 +118,7 @@ import {
118
118
  isHello,
119
119
  linkVersionCheck,
120
120
  negotiateProtocol
121
- } from "./chunk-QAZQJ5PB.js";
121
+ } from "./chunk-CXO3B53M.js";
122
122
  import {
123
123
  loadLinkSpecs
124
124
  } from "./chunk-HHKS3UZB.js";
@@ -133,7 +133,7 @@ import "./chunk-XV2STPP6.js";
133
133
  import {
134
134
  conversationOf,
135
135
  lookupConversation
136
- } from "./chunk-26N4PV7Z.js";
136
+ } from "./chunk-2LLX2WAX.js";
137
137
  import {
138
138
  stripAnsi
139
139
  } from "./chunk-YJ72SXVD.js";
@@ -171,9 +171,9 @@ import {
171
171
  } from "./chunk-QAJUCN3A.js";
172
172
  import {
173
173
  resolvePlan
174
- } from "./chunk-HEP6K2DT.js";
175
- import "./chunk-LPBBNHBJ.js";
176
- import "./chunk-J265JKFW.js";
174
+ } from "./chunk-L3ITNM4T.js";
175
+ import "./chunk-7LDL3SBF.js";
176
+ import "./chunk-KPNFDA4V.js";
177
177
  import {
178
178
  loadItem
179
179
  } from "./chunk-U732RAGX.js";
@@ -199,7 +199,7 @@ import {
199
199
  runConfigBaseDirFrom
200
200
  } from "./chunk-QR7KY3Y6.js";
201
201
  import "./chunk-NZYSENRR.js";
202
- import "./chunk-DJ5UUPZR.js";
202
+ import "./chunk-UDEJCU6V.js";
203
203
  import "./chunk-MELBVXKL.js";
204
204
  import {
205
205
  resolveCapability
@@ -227,8 +227,9 @@ import {
227
227
  setSdkUsageSink,
228
228
  spawnClaudeSdk,
229
229
  spawnPty,
230
- viewerSize
231
- } from "./chunk-AFGBWFOC.js";
230
+ viewerSize,
231
+ workflowQueryEnv
232
+ } from "./chunk-N4TYIEKN.js";
232
233
  import {
233
234
  daemonLog,
234
235
  recentDaemonLogLines,
@@ -254,7 +255,7 @@ import {
254
255
  import "./chunk-APZ6ZTDA.js";
255
256
  import "./chunk-BFQSGIN6.js";
256
257
  import "./chunk-D7UZLH36.js";
257
- import "./chunk-ZRVQDJVQ.js";
258
+ import "./chunk-QG6KFBUQ.js";
258
259
  import "./chunk-EW2ZM2PC.js";
259
260
  import "./chunk-QKHOYKUQ.js";
260
261
  import {
@@ -5768,6 +5769,108 @@ function awaitServerPort(session, port, deps) {
5768
5769
  setTimeout(tick, portWaitTiming.pollMs);
5769
5770
  }
5770
5771
 
5772
+ // src/commands/sessions/daemon/deferredCommandLabel.ts
5773
+ function deferredCommandLabel(argv) {
5774
+ const firstFlag = argv.findIndex((arg) => arg.startsWith("-"));
5775
+ return (firstFlag === -1 ? argv : argv.slice(0, firstFlag)).join(" ") || "?";
5776
+ }
5777
+
5778
+ // src/commands/sessions/daemon/formatDeferredResult.ts
5779
+ function formatDeferredResult(command, { output, exitCode }) {
5780
+ return `\`assist ${command}\` finished with exit code ${exitCode}:
5781
+
5782
+ ${output.trim()}`;
5783
+ }
5784
+
5785
+ // src/commands/sessions/daemon/trackDeferredCommand.ts
5786
+ function trackDeferredCommand(session, command) {
5787
+ session.deferredCommands = [...session.deferredCommands ?? [], command];
5788
+ }
5789
+ function untrackDeferredCommand(session, command) {
5790
+ const pending = session.deferredCommands ?? [];
5791
+ if (!pending.includes(command)) return;
5792
+ const rest = pending.filter((c) => c !== command);
5793
+ session.deferredCommands = rest.length > 0 ? rest : void 0;
5794
+ }
5795
+
5796
+ // src/commands/sessions/daemon/deliverDeferredResult.ts
5797
+ function deliverDeferredResult(m, id, command, result) {
5798
+ const name = deferredCommandLabel(command.argv);
5799
+ const label = `defer-command ${name}: session ${id} exit ${result.exitCode}`;
5800
+ const session = m.session(id);
5801
+ if (session && killedByDaemonRestart(session.interrupted)) {
5802
+ daemonLog(`${label} killed by the daemon restart; left pending`);
5803
+ return;
5804
+ }
5805
+ if (session) untrackDeferredCommand(session, command);
5806
+ if (result.exitCode === 0 && result.output.includes(supersededPreviewMessage)) {
5807
+ daemonLog(`${label} superseded; nothing delivered`);
5808
+ return;
5809
+ }
5810
+ const sdk = session?.pty?.sdk;
5811
+ if (!sdk) {
5812
+ daemonLog(`${label} dropped: session is gone`);
5813
+ return;
5814
+ }
5815
+ sdk.send(formatDeferredResult(name, result));
5816
+ daemonLog(`${label} delivered as the next message`);
5817
+ }
5818
+
5819
+ // src/commands/sessions/daemon/runDeferredCommand.ts
5820
+ import { spawn as spawn3 } from "child_process";
5821
+ function runDeferredCommand(command, onDone, spawnChild = spawn3) {
5822
+ const child = spawnChild(
5823
+ process.execPath,
5824
+ [process.argv[1], ...command.argv],
5825
+ {
5826
+ cwd: command.cwd,
5827
+ env: { ...command.env, [deferredRunEnv]: "1" },
5828
+ stdio: ["pipe", "pipe", "pipe"],
5829
+ windowsHide: true
5830
+ }
5831
+ );
5832
+ let output = "";
5833
+ const collect = (chunk) => {
5834
+ output += chunk.toString();
5835
+ };
5836
+ child.stdout?.on("data", collect);
5837
+ child.stderr?.on("data", collect);
5838
+ child.on("error", (error) => {
5839
+ output += `${error.message}
5840
+ `;
5841
+ });
5842
+ child.on("close", (code) => onDone({ output, exitCode: code ?? 1 }));
5843
+ child.stdin?.on("error", () => {
5844
+ });
5845
+ child.stdin?.end(command.stdin ?? "");
5846
+ return child.pid;
5847
+ }
5848
+
5849
+ // src/commands/sessions/daemon/reopenDeferredCommands.ts
5850
+ function reopenDeferredCommands(sessions, m) {
5851
+ for (const session of sessions) {
5852
+ const pending = session.deferredCommands ?? [];
5853
+ if (pending.length === 0) continue;
5854
+ if (!session.pty?.sdk) {
5855
+ session.deferredCommands = void 0;
5856
+ daemonLog(
5857
+ `defer-command ${pending.map((c) => deferredCommandLabel(c.argv)).join(", ")} dropped on restore: session ${session.id} is not a Claude (SDK) session`
5858
+ );
5859
+ continue;
5860
+ }
5861
+ for (const command of pending) reopen(session.id, command, m);
5862
+ }
5863
+ }
5864
+ function reopen(id, command, m) {
5865
+ const pid = runDeferredCommand(
5866
+ { ...command, env: workflowQueryEnv(process.env, id, void 0) },
5867
+ (result) => deliverDeferredResult(m, id, command, result)
5868
+ );
5869
+ daemonLog(
5870
+ `defer-command ${deferredCommandLabel(command.argv)} reopened after daemon restart: session ${id} pid ${pid ?? "none"}`
5871
+ );
5872
+ }
5873
+
5771
5874
  // src/commands/sessions/daemon/restoredAutoAdvance.ts
5772
5875
  function restoredAutoAdvance(id, persisted) {
5773
5876
  const itemId = persisted.activity?.itemId;
@@ -5779,6 +5882,20 @@ function restoredAutoAdvance(id, persisted) {
5779
5882
  return false;
5780
5883
  }
5781
5884
 
5885
+ // src/commands/sessions/daemon/restoredDeferredCommands.ts
5886
+ function restoredDeferredCommands(id, persisted) {
5887
+ const commands = (persisted.deferredCommands ?? []).filter(
5888
+ (command) => {
5889
+ if (typeof command !== "string") return true;
5890
+ daemonLog(
5891
+ `defer-command ${command} dropped on restore: session ${id} has only its legacy label, nothing to re-run`
5892
+ );
5893
+ return false;
5894
+ }
5895
+ );
5896
+ return commands.length > 0 ? commands : void 0;
5897
+ }
5898
+
5782
5899
  // src/commands/sessions/daemon/restoreBase.ts
5783
5900
  function restoreBase(id, persisted) {
5784
5901
  return {
@@ -5803,7 +5920,8 @@ function restoreBase(id, persisted) {
5803
5920
  autoApprove: persisted.autoApprove,
5804
5921
  reviewStarted: persisted.reviewStarted,
5805
5922
  launchedFrom: persisted.launchedFrom,
5806
- pendingPrompts: persisted.pendingPrompts
5923
+ pendingPrompts: persisted.pendingPrompts,
5924
+ deferredCommands: restoredDeferredCommands(id, persisted)
5807
5925
  };
5808
5926
  }
5809
5927
 
@@ -6008,21 +6126,12 @@ function createHeld(id, persisted) {
6008
6126
  }
6009
6127
 
6010
6128
  // src/commands/sessions/daemon/daemonRestartPrompt.ts
6011
- function lostPreviews(deferredCommands) {
6012
- if (deferredCommands.length === 0) return "";
6013
- const commands = deferredCommands.map((c) => `\`assist ${c}\``).join(", ");
6014
- return ` It also closed ${deferredCommands.length} preview(s) still waiting for the user's decision (${commands}); those decisions will never arrive. Run each of those commands again the same way, then end your turn and wait for the decision as before.`;
6015
- }
6016
- function daemonRestartPrompt(backgroundTaskIds, deferredCommands = []) {
6129
+ function daemonRestartPrompt(backgroundTaskIds) {
6017
6130
  const preamble = "The assist sessions daemon restarted and killed this session's processes. This was not a deliberate stop and nothing you were running was told to finish.";
6018
- const previews = lostPreviews(deferredCommands);
6019
6131
  if (backgroundTaskIds.length === 0)
6020
- return wrapRestartNudge(
6021
- `${preamble}${previews || " Continue from where you left off."}`,
6022
- 0
6023
- );
6132
+ return wrapRestartNudge(`${preamble} Continue from where you left off.`, 0);
6024
6133
  return wrapRestartNudge(
6025
- `${preamble} It killed ${backgroundTaskIds.length} background task(s) that were still running (${backgroundTaskIds.join(", ")}); their output files end where the kill landed, with no exit code. Treat them as killed by the restart, not as interrupted by the user, and restart any of them that should still be running.${previews}`,
6134
+ `${preamble} It killed ${backgroundTaskIds.length} background task(s) that were still running (${backgroundTaskIds.join(", ")}); their output files end where the kill landed, with no exit code. Treat them as killed by the restart, not as interrupted by the user, and restart any of them that should still be running.`,
6026
6135
  backgroundTaskIds.length
6027
6136
  );
6028
6137
  }
@@ -6054,9 +6163,6 @@ function pendingQuestionPrompt(backgroundTaskIds) {
6054
6163
  // src/commands/sessions/daemon/restoreResumePlan.ts
6055
6164
  function restoreResumePlan(persisted, status) {
6056
6165
  const tasks = interruptedBackgroundTasks(persisted);
6057
- const deferred = persisted.deferredCommands ?? [];
6058
- if (deferred.length > 0)
6059
- return { prompt: daemonRestartPrompt(tasks, deferred), idle: false };
6060
6166
  if (status === "asking")
6061
6167
  return { prompt: pendingQuestionPrompt(tasks), idle: false };
6062
6168
  if (tasks.length > 0)
@@ -6683,6 +6789,9 @@ function heldTrees(sessions) {
6683
6789
  function restoreAllSessions(spawner, deps) {
6684
6790
  const { sessions, notify } = deps;
6685
6791
  const names = restoreAll(spawner, sessions);
6792
+ reopenDeferredCommands(sessions.values(), {
6793
+ session: (id) => sessions.get(id)
6794
+ });
6686
6795
  reseedRestoredWorktrees(deps);
6687
6796
  reconcileWorktreesOnRestore(sessions, spawner.recoveryCard, notify);
6688
6797
  rearmStoppedSessions(sessions, notify);
@@ -8373,108 +8482,31 @@ var handleHelloRequest = (client, m, d) => {
8373
8482
  m.replayLocal(client);
8374
8483
  };
8375
8484
 
8376
- // src/commands/sessions/daemon/deferredCommandLabel.ts
8377
- function deferredCommandLabel(argv) {
8378
- const firstFlag = argv.findIndex((arg) => arg.startsWith("-"));
8379
- return (firstFlag === -1 ? argv : argv.slice(0, firstFlag)).join(" ") || "?";
8380
- }
8381
-
8382
- // src/commands/sessions/daemon/runDeferredCommand.ts
8383
- import { spawn as spawn3 } from "child_process";
8384
- function runDeferredCommand(command, onDone, spawnChild = spawn3) {
8385
- const child = spawnChild(
8386
- process.execPath,
8387
- [process.argv[1], ...command.argv],
8388
- {
8389
- cwd: command.cwd,
8390
- env: { ...command.env, [deferredRunEnv]: "1" },
8391
- stdio: ["pipe", "pipe", "pipe"],
8392
- windowsHide: true
8393
- }
8394
- );
8395
- let output = "";
8396
- const collect = (chunk) => {
8397
- output += chunk.toString();
8398
- };
8399
- child.stdout?.on("data", collect);
8400
- child.stderr?.on("data", collect);
8401
- child.on("error", (error) => {
8402
- output += `${error.message}
8403
- `;
8404
- });
8405
- child.on("close", (code) => onDone({ output, exitCode: code ?? 1 }));
8406
- child.stdin?.on("error", () => {
8407
- });
8408
- child.stdin?.end(command.stdin ?? "");
8409
- return child.pid;
8410
- }
8411
-
8412
- // src/commands/sessions/daemon/trackDeferredCommand.ts
8413
- function trackDeferredCommand(session, command) {
8414
- session.deferredCommands = [...session.deferredCommands ?? [], command];
8415
- }
8416
- function untrackDeferredCommand(session, command) {
8417
- const pending = session.deferredCommands ?? [];
8418
- const index = pending.indexOf(command);
8419
- if (index === -1) return;
8420
- const rest = pending.filter((_, i) => i !== index);
8421
- session.deferredCommands = rest.length > 0 ? rest : void 0;
8422
- }
8423
-
8424
- // src/commands/sessions/daemon/formatDeferredResult.ts
8425
- function formatDeferredResult(command, { output, exitCode }) {
8426
- return `\`assist ${command}\` finished with exit code ${exitCode}:
8427
-
8428
- ${output.trim()}`;
8429
- }
8430
-
8431
- // src/commands/sessions/daemon/deliverDeferredResult.ts
8432
- function deliverDeferredResult(m, id, command, result) {
8433
- const label = `defer-command ${command}: session ${id} exit ${result.exitCode}`;
8434
- const session = m.session(id);
8435
- if (session && killedByDaemonRestart(session.interrupted)) {
8436
- daemonLog(`${label} killed by the daemon restart; left pending`);
8437
- return;
8438
- }
8439
- if (session) untrackDeferredCommand(session, command);
8440
- if (result.exitCode === 0 && result.output.includes(supersededPreviewMessage)) {
8441
- daemonLog(`${label} superseded; nothing delivered`);
8442
- return;
8443
- }
8444
- const sdk = session?.pty?.sdk;
8445
- if (!sdk) {
8446
- daemonLog(`${label} dropped: session is gone`);
8447
- return;
8448
- }
8449
- sdk.send(formatDeferredResult(command, result));
8450
- daemonLog(`${label} delivered as the next message`);
8451
- }
8452
-
8453
8485
  // src/commands/sessions/daemon/handleDeferCommand.ts
8454
8486
  var handleDeferCommand = (client, m, d) => {
8455
8487
  const id = String(d.sessionId);
8456
8488
  const argv = Array.isArray(d.argv) ? d.argv.map(String) : [];
8457
- const command = deferredCommandLabel(argv);
8489
+ const label = deferredCommandLabel(argv);
8458
8490
  const session = m.session(id);
8459
8491
  if (!session?.pty?.sdk) {
8460
8492
  daemonLog(
8461
- `defer-command ${command} declined: session ${id} is not a live Claude (SDK) session`
8493
+ `defer-command ${label} declined: session ${id} is not a live Claude (SDK) session`
8462
8494
  );
8463
8495
  sendTo(client, { type: "defer-command-result", accepted: false });
8464
8496
  return;
8465
8497
  }
8498
+ const command = {
8499
+ argv,
8500
+ stdin: typeof d.stdin === "string" ? d.stdin : void 0,
8501
+ cwd: String(d.cwd)
8502
+ };
8466
8503
  trackDeferredCommand(session, command);
8467
8504
  const pid = runDeferredCommand(
8468
- {
8469
- argv,
8470
- stdin: typeof d.stdin === "string" ? d.stdin : void 0,
8471
- cwd: String(d.cwd),
8472
- env: d.env ?? {}
8473
- },
8505
+ { ...command, env: d.env ?? {} },
8474
8506
  (result) => deliverDeferredResult(m, id, command, result)
8475
8507
  );
8476
8508
  daemonLog(
8477
- `defer-command ${command} started: session ${id} pid ${pid ?? "none"}`
8509
+ `defer-command ${label} started: session ${id} pid ${pid ?? "none"}`
8478
8510
  );
8479
8511
  sendTo(client, { type: "defer-command-result", accepted: true });
8480
8512
  };
@@ -3,24 +3,24 @@ import {
3
3
  } from "./chunk-FDWIKBS3.js";
4
4
  import {
5
5
  refine
6
- } from "./chunk-74UYKNXC.js";
7
- import "./chunk-YZSTCQUE.js";
8
- import "./chunk-QEFHPIMP.js";
6
+ } from "./chunk-ARVSII44.js";
7
+ import "./chunk-RGDUQV4P.js";
8
+ import "./chunk-BD5RV37B.js";
9
9
  import "./chunk-SB4BG7PH.js";
10
10
  import "./chunk-B3JSQA5D.js";
11
- import "./chunk-7NRDYDQO.js";
12
- import "./chunk-EIA6AM33.js";
11
+ import "./chunk-LAFVAYYR.js";
12
+ import "./chunk-XSCOP5MH.js";
13
13
  import "./chunk-7NZOH4LN.js";
14
14
  import "./chunk-F7QYFJB2.js";
15
15
  import "./chunk-ZYK7V4PG.js";
16
16
  import "./chunk-PYACTCZ2.js";
17
17
  import "./chunk-4YAIQN3S.js";
18
18
  import "./chunk-NWNODYLQ.js";
19
- import "./chunk-EXGBNBBJ.js";
20
- import "./chunk-AGBHU2F2.js";
19
+ import "./chunk-S65PHW2M.js";
20
+ import "./chunk-VYW6R64U.js";
21
21
  import "./chunk-OZNYQOQK.js";
22
22
  import "./chunk-WTQRIUSK.js";
23
- import "./chunk-ILRYEIH3.js";
23
+ import "./chunk-LC3CKCQD.js";
24
24
  import "./chunk-ORSRBZ2X.js";
25
25
  import "./chunk-PCF66ALO.js";
26
26
  import "./chunk-UYD7R4HL.js";
@@ -33,10 +33,10 @@ import "./chunk-QAJUCN3A.js";
33
33
  import "./chunk-UVTZ4VFK.js";
34
34
  import "./chunk-DISNKALJ.js";
35
35
  import "./chunk-BJDGVLYX.js";
36
- import "./chunk-CVSVONYT.js";
37
- import "./chunk-HEP6K2DT.js";
38
- import "./chunk-LPBBNHBJ.js";
39
- import "./chunk-J265JKFW.js";
36
+ import "./chunk-FSNGBFAH.js";
37
+ import "./chunk-L3ITNM4T.js";
38
+ import "./chunk-7LDL3SBF.js";
39
+ import "./chunk-KPNFDA4V.js";
40
40
  import "./chunk-PYZUB3JT.js";
41
41
  import "./chunk-U732RAGX.js";
42
42
  import "./chunk-TCTX3UXU.js";
@@ -48,10 +48,10 @@ import "./chunk-3QKE2ONF.js";
48
48
  import "./chunk-O5JIFWMQ.js";
49
49
  import "./chunk-LMUTL44M.js";
50
50
  import "./chunk-6NDXAN45.js";
51
- import "./chunk-DJ5UUPZR.js";
51
+ import "./chunk-UDEJCU6V.js";
52
52
  import "./chunk-MELBVXKL.js";
53
53
  import "./chunk-OGJ6AZK4.js";
54
- import "./chunk-AFGBWFOC.js";
54
+ import "./chunk-N4TYIEKN.js";
55
55
  import "./chunk-MRUIXQXS.js";
56
56
  import "./chunk-HO7RNI6V.js";
57
57
  import "./chunk-DIAC4XYA.js";
@@ -2,7 +2,7 @@ import {
2
2
  formatScanUsage,
3
3
  inboxScanBlocker,
4
4
  runInboxScan
5
- } from "./chunk-7KTG4VNA.js";
5
+ } from "./chunk-HH5HZE63.js";
6
6
  import "./chunk-2JYMVJGZ.js";
7
7
  import "./chunk-NWNODYLQ.js";
8
8
  import {
@@ -20,7 +20,7 @@ import "./chunk-MELBVXKL.js";
20
20
  import "./chunk-OGJ6AZK4.js";
21
21
  import {
22
22
  harnessAdapter
23
- } from "./chunk-AFGBWFOC.js";
23
+ } from "./chunk-N4TYIEKN.js";
24
24
  import "./chunk-MRUIXQXS.js";
25
25
  import "./chunk-HO7RNI6V.js";
26
26
  import "./chunk-DIAC4XYA.js";
@@ -15,7 +15,7 @@ import {
15
15
  currentExecutionIdentity,
16
16
  getSchemaSessionApprovalDir,
17
17
  getSchemaSessionApprovalPath
18
- } from "./chunk-NA5TFFHL.js";
18
+ } from "./chunk-I6S6WJGX.js";
19
19
  import "./chunk-ZMH7UZNP.js";
20
20
  import {
21
21
  recordGitRef
@@ -31,7 +31,7 @@ import "./chunk-3QKE2ONF.js";
31
31
  import "./chunk-O5JIFWMQ.js";
32
32
  import "./chunk-LMUTL44M.js";
33
33
  import "./chunk-6NDXAN45.js";
34
- import "./chunk-AFGBWFOC.js";
34
+ import "./chunk-N4TYIEKN.js";
35
35
  import "./chunk-MRUIXQXS.js";
36
36
  import "./chunk-HO7RNI6V.js";
37
37
  import "./chunk-DIAC4XYA.js";
@@ -11,7 +11,7 @@ import "./chunk-JVG5AJA2.js";
11
11
  import {
12
12
  currentExecutionIdentity,
13
13
  getSchemaSessionApprovalPath
14
- } from "./chunk-NA5TFFHL.js";
14
+ } from "./chunk-I6S6WJGX.js";
15
15
  import "./chunk-ZMH7UZNP.js";
16
16
  import "./chunk-FPWL4VRC.js";
17
17
  import "./chunk-E36L7ASL.js";
@@ -30,7 +30,7 @@ import "./chunk-3QKE2ONF.js";
30
30
  import "./chunk-O5JIFWMQ.js";
31
31
  import "./chunk-LMUTL44M.js";
32
32
  import "./chunk-6NDXAN45.js";
33
- import "./chunk-AFGBWFOC.js";
33
+ import "./chunk-N4TYIEKN.js";
34
34
  import "./chunk-MRUIXQXS.js";
35
35
  import "./chunk-HO7RNI6V.js";
36
36
  import "./chunk-DIAC4XYA.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  statusIcon,
3
3
  typeLabel
4
- } from "./chunk-ILRYEIH3.js";
5
- import "./chunk-LPBBNHBJ.js";
6
- import "./chunk-J265JKFW.js";
4
+ } from "./chunk-LC3CKCQD.js";
5
+ import "./chunk-7LDL3SBF.js";
6
+ import "./chunk-KPNFDA4V.js";
7
7
  import {
8
8
  searchBacklog
9
9
  } from "./chunk-PYZUB3JT.js";
@@ -18,10 +18,10 @@ import "./chunk-3QKE2ONF.js";
18
18
  import "./chunk-O5JIFWMQ.js";
19
19
  import "./chunk-LMUTL44M.js";
20
20
  import "./chunk-6NDXAN45.js";
21
- import "./chunk-DJ5UUPZR.js";
21
+ import "./chunk-UDEJCU6V.js";
22
22
  import "./chunk-MELBVXKL.js";
23
23
  import "./chunk-OGJ6AZK4.js";
24
- import "./chunk-AFGBWFOC.js";
24
+ import "./chunk-N4TYIEKN.js";
25
25
  import "./chunk-MRUIXQXS.js";
26
26
  import "./chunk-HO7RNI6V.js";
27
27
  import "./chunk-DIAC4XYA.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-Y3JV5CEL.js";
10
10
  import {
11
11
  REVIEW_PHASE_NAME
12
- } from "./chunk-J265JKFW.js";
12
+ } from "./chunk-KPNFDA4V.js";
13
13
  import {
14
14
  findOneItem
15
15
  } from "./chunk-PYZUB3JT.js";
@@ -24,10 +24,10 @@ import "./chunk-3QKE2ONF.js";
24
24
  import "./chunk-O5JIFWMQ.js";
25
25
  import "./chunk-LMUTL44M.js";
26
26
  import "./chunk-6NDXAN45.js";
27
- import "./chunk-DJ5UUPZR.js";
27
+ import "./chunk-UDEJCU6V.js";
28
28
  import "./chunk-MELBVXKL.js";
29
29
  import "./chunk-OGJ6AZK4.js";
30
- import "./chunk-AFGBWFOC.js";
30
+ import "./chunk-N4TYIEKN.js";
31
31
  import "./chunk-MRUIXQXS.js";
32
32
  import "./chunk-HO7RNI6V.js";
33
33
  import "./chunk-DIAC4XYA.js";
@@ -5,15 +5,15 @@ import "./chunk-QRTB7PVR.js";
5
5
  import "./chunk-3VDV7VHX.js";
6
6
  import {
7
7
  targetConversationEvents
8
- } from "./chunk-BEZEB6OF.js";
9
- import "./chunk-26N4PV7Z.js";
8
+ } from "./chunk-6QZ5K263.js";
9
+ import "./chunk-2LLX2WAX.js";
10
10
  import {
11
11
  readSocketLines
12
12
  } from "./chunk-2EW62DM5.js";
13
13
  import "./chunk-OGJ6AZK4.js";
14
14
  import {
15
15
  harnessAdapter
16
- } from "./chunk-AFGBWFOC.js";
16
+ } from "./chunk-N4TYIEKN.js";
17
17
  import "./chunk-MRUIXQXS.js";
18
18
  import "./chunk-HO7RNI6V.js";
19
19
  import "./chunk-DIAC4XYA.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-W7TRZLEM.js";
10
10
  import {
11
11
  package_default
12
- } from "./chunk-ZRVQDJVQ.js";
12
+ } from "./chunk-QG6KFBUQ.js";
13
13
 
14
14
  // src/commands/extension/signExtension.ts
15
15
  import { rm as rm2 } from "fs/promises";
@@ -2,11 +2,11 @@ import {
2
2
  linkStatus,
3
3
  postToPeer,
4
4
  startPeerAction
5
- } from "./chunk-G7GUYBT3.js";
6
- import "./chunk-NC5X72HQ.js";
5
+ } from "./chunk-7CFY7YXX.js";
6
+ import "./chunk-T67PNCOV.js";
7
7
  import "./chunk-4HKB2TAG.js";
8
- import "./chunk-2S5Q3U67.js";
9
- import "./chunk-QAZQJ5PB.js";
8
+ import "./chunk-G3WCW5X6.js";
9
+ import "./chunk-CXO3B53M.js";
10
10
  import "./chunk-OD7CMDGZ.js";
11
11
  import "./chunk-VABNWHSE.js";
12
12
  import "./chunk-HHKS3UZB.js";
@@ -19,7 +19,7 @@ import {
19
19
  import "./chunk-6YRKJTHT.js";
20
20
  import "./chunk-OFLEIPAR.js";
21
21
  import "./chunk-2EW62DM5.js";
22
- import "./chunk-ZRVQDJVQ.js";
22
+ import "./chunk-QG6KFBUQ.js";
23
23
  import "./chunk-KGFZYUE2.js";
24
24
  import "./chunk-LBAPKP6M.js";
25
25
  import "./chunk-GRXFWFGP.js";
@@ -4,7 +4,7 @@ import {
4
4
  replacePlan,
5
5
  startProposedRun,
6
6
  toStartApproval
7
- } from "./chunk-HN5RRUW2.js";
7
+ } from "./chunk-WQ6JHTXL.js";
8
8
  import "./chunk-YS3HSXSJ.js";
9
9
  import {
10
10
  renderMarkdownTerminal
@@ -27,7 +27,7 @@ import {
27
27
  import "./chunk-JVHDLRNZ.js";
28
28
  import "./chunk-ANS4AQDI.js";
29
29
  import "./chunk-ZDSSSQZZ.js";
30
- import "./chunk-J265JKFW.js";
30
+ import "./chunk-KPNFDA4V.js";
31
31
  import {
32
32
  findOneItem,
33
33
  getOrigin
@@ -48,10 +48,10 @@ import "./chunk-6NDXAN45.js";
48
48
  import {
49
49
  expandTilde
50
50
  } from "./chunk-LKDW2GWH.js";
51
- import "./chunk-DJ5UUPZR.js";
51
+ import "./chunk-UDEJCU6V.js";
52
52
  import "./chunk-MELBVXKL.js";
53
53
  import "./chunk-OGJ6AZK4.js";
54
- import "./chunk-AFGBWFOC.js";
54
+ import "./chunk-N4TYIEKN.js";
55
55
  import "./chunk-MRUIXQXS.js";
56
56
  import "./chunk-HO7RNI6V.js";
57
57
  import "./chunk-DIAC4XYA.js";