@staff0rd/assist 0.1166.0 → 0.1168.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 +79 -79
  2. package/dist/{addActivity-WY6S5X4Y.js → addActivity-7BL2QCUP.js} +2 -2
  3. package/dist/{addPhase-26CJUFWT.js → addPhase-UYBZKSW4.js} +3 -3
  4. package/dist/{advise-GLQAAGK2.js → advise-46JSXUDW.js} +3 -3
  5. package/dist/{askCheck-TKUOAGON.js → askCheck-BCCZCYOI.js} +7 -7
  6. package/dist/{askDesign-AY4MBIGE.js → askDesign-C55JXS4W.js} +1 -1
  7. package/dist/{branch-24M6R4M4.js → branch-7L5HGHC3.js} +3 -3
  8. package/dist/built-version +1 -1
  9. package/dist/chunk-3HNTLFII.js +50 -0
  10. package/dist/{chunk-Q5AGOAE3.js → chunk-3PESUAUN.js} +2 -2
  11. package/dist/{chunk-ZAMEG3EN.js → chunk-425LLTMS.js} +24 -21
  12. package/dist/{chunk-N4TYIEKN.js → chunk-43MJXI4R.js} +137 -49
  13. package/dist/{chunk-5EBO34SB.js → chunk-6ULWRB6I.js} +1 -1
  14. package/dist/{chunk-LX6UHQG4.js → chunk-6W44RUSM.js} +1 -1
  15. package/dist/{chunk-V2RP2CVY.js → chunk-7MUNT7JI.js} +5 -1
  16. package/dist/{chunk-RV6ZY6BE.js → chunk-7QAFWJTK.js} +1 -1
  17. package/dist/{chunk-UDHMQBPS.js → chunk-B7VURMUV.js} +2 -2
  18. package/dist/{chunk-S65PHW2M.js → chunk-DTRDXHGW.js} +1 -1
  19. package/dist/{chunk-UK347DGD.js → chunk-E3WWV4JR.js} +475 -129
  20. package/dist/{chunk-I6S6WJGX.js → chunk-EAREJAOY.js} +1 -1
  21. package/dist/{chunk-ARVSII44.js → chunk-FAZEGCRS.js} +2 -2
  22. package/dist/{chunk-PRDNXBPX.js → chunk-FYSUHMKS.js} +1 -1
  23. package/dist/{chunk-BD5RV37B.js → chunk-H7SSIEZ2.js} +3 -3
  24. package/dist/{chunk-GSTZWNA7.js → chunk-HL26MMZX.js} +1 -1
  25. package/dist/{chunk-K3JNJGLB.js → chunk-I3TEQBTO.js} +25 -7
  26. package/dist/{chunk-WQ6JHTXL.js → chunk-I552VSJV.js} +1 -1
  27. package/dist/{chunk-LAFVAYYR.js → chunk-IL4DISAP.js} +6 -6
  28. package/dist/{chunk-AIMGLRR2.js → chunk-KH72TT53.js} +1 -1
  29. package/dist/{chunk-UDEJCU6V.js → chunk-MVSLFBWG.js} +1 -1
  30. package/dist/{chunk-LC3CKCQD.js → chunk-NQRZKLIK.js} +1 -1
  31. package/dist/{chunk-L3ITNM4T.js → chunk-QF5UR5N2.js} +1 -1
  32. package/dist/{chunk-PCZHLHZB.js → chunk-QTF6XFHS.js} +1 -1
  33. package/dist/{chunk-ZCDH4R26.js → chunk-RW2B5RU5.js} +1 -1
  34. package/dist/{chunk-7LDL3SBF.js → chunk-S4FTKZLS.js} +1 -1
  35. package/dist/{chunk-6QZ5K263.js → chunk-UCTFPC6X.js} +2 -2
  36. package/dist/{chunk-VYW6R64U.js → chunk-UY75YJI5.js} +1 -1
  37. package/dist/{chunk-KVZLXGX3.js → chunk-VEHHPXW6.js} +1 -1
  38. package/dist/{chunk-2LLX2WAX.js → chunk-WWWNWP3Z.js} +1 -1
  39. package/dist/{chunk-XSCOP5MH.js → chunk-X54VUNBQ.js} +1 -1
  40. package/dist/{chunk-KPNTG4KF.js → chunk-XERYO3NC.js} +1 -1
  41. package/dist/{chunk-KPNFDA4V.js → chunk-XRLD3NYP.js} +1 -1
  42. package/dist/{chunk-RGDUQV4P.js → chunk-XWSDOQSQ.js} +4 -4
  43. package/dist/{chunk-FSNGBFAH.js → chunk-YQJBSNEL.js} +1 -1
  44. package/dist/{chunk-HH5HZE63.js → chunk-ZAS2ZWEK.js} +1 -1
  45. package/dist/{chunk-IIVIXJ4L.js → chunk-ZKPXMOR6.js} +1 -1
  46. package/dist/{chunk-Z2Z5ESUS.js → chunk-ZRJFYESX.js} +2 -2
  47. package/dist/{cliHook-PWBPVU4N.js → cliHook-LXPHXYTG.js} +5 -5
  48. package/dist/{cliHookCheck-HKYLHFZG.js → cliHookCheck-X3OTARTS.js} +2 -2
  49. package/dist/{codexHook-WMVVGO5L.js → codexHook-JHA7XAJI.js} +7 -7
  50. package/dist/commands/extension/extension/content.js +1 -1
  51. package/dist/commands/extension/extension/docs.js +1 -1
  52. package/dist/commands/sessions/web/bundle.js +470 -470
  53. package/dist/{commit-PNFJAZXS.js → commit-S237TZOH.js} +3 -3
  54. package/dist/{doctorNodes-SWKP7B3Y.js → doctorNodes-ZGGPDVHQ.js} +3 -3
  55. package/dist/{done-ANSC3ABM.js → done-B5OPZGM4.js} +4 -4
  56. package/dist/{editHook-NF6RN3TV.js → editHook-TIPNG6CB.js} +5 -5
  57. package/dist/{fixConflict-FAHNBQLY.js → fixConflict-GLENPF7A.js} +4 -4
  58. package/dist/index.js +48 -48
  59. package/dist/{indexRules-4M2TAWOE.js → indexRules-65H3IE33.js} +1 -2
  60. package/dist/{launchMode-AF37LKHB.js → launchMode-OATTOTYW.js} +13 -13
  61. package/dist/{list-AG7O4BRS.js → list-TGEC6P3Q.js} +5 -5
  62. package/dist/{next-DJU4TRTO.js → next-P63EVBB6.js} +12 -12
  63. package/dist/{piHook-MGSND6VD.js → piHook-GCKOXN5A.js} +5 -5
  64. package/dist/{propose-EDHBG6QK.js → propose-D3F4C3EJ.js} +4 -4
  65. package/dist/{refine-7FKPNKVF.js → refine-W7HULKNY.js} +14 -14
  66. package/dist/{restartNode-4DOUVVVC.js → restartNode-AYPAGM32.js} +5 -5
  67. package/dist/{review-FCS7FS6H.js → review-LQGEHHIW.js} +4 -4
  68. package/dist/{reviewPrComments-HHWRUH3P.js → reviewPrComments-RXADKZLV.js} +4 -4
  69. package/dist/{rewindPhase-IIE2IPW6.js → rewindPhase-BPVRXMD5.js} +8 -8
  70. package/dist/{rulesAdd-T62MTCFM.js → rulesAdd-V4SWWQKL.js} +8 -44
  71. package/dist/{run-UCFL6W6N.js → run-TVFL4EWV.js} +10 -10
  72. package/dist/{run-2HGZBXNW.js → run-UH5KYOU7.js} +10 -10
  73. package/dist/{runDaemon-VSQEHBHH.js → runDaemon-YEDFUDNN.js} +263 -28
  74. package/dist/{runRefine-4Q4LFO3H.js → runRefine-FPTFYFMX.js} +14 -14
  75. package/dist/{scan-FHKMFKHA.js → scan-BO23G2MD.js} +2 -2
  76. package/dist/{schemaConfirm-6IJUZE2N.js → schemaConfirm-AB6SR5SC.js} +2 -2
  77. package/dist/{schemaUnlock-I24T52GB.js → schemaUnlock-AT5T43PB.js} +2 -2
  78. package/dist/{search-LXX6MHPH.js → search-5EA654VD.js} +5 -5
  79. package/dist/{show-NM54HUDH.js → show-OLER6JJU.js} +3 -3
  80. package/dist/{show-2TZP23GK.js → show-QHB5ZN54.js} +3 -3
  81. package/dist/{signExtension-SAD6374W.js → signExtension-Y5WU4OLB.js} +1 -1
  82. package/dist/{updateNode-MFML3KJN.js → updateNode-YBE4MBAO.js} +5 -5
  83. package/dist/{updatePlan-5AMQJFD5.js → updatePlan-FWJBNYWK.js} +4 -4
  84. package/dist/{web-VQMOA2GX.js → web-DL44YNRY.js} +18 -17
  85. package/dist/{web-HT2TD7RU.js → web-VAXMLL35.js} +18 -17
  86. package/package.json +1 -1
  87. package/dist/chunk-IZZJUZZY.js +0 -21
@@ -13,7 +13,7 @@ import {
13
13
  isApprovedRead,
14
14
  resolvePermission,
15
15
  splitCompound
16
- } from "./chunk-ZCDH4R26.js";
16
+ } from "./chunk-RW2B5RU5.js";
17
17
  import {
18
18
  DOCS_LOCK_REASON,
19
19
  SCHEMA_LOCK_REASON,
@@ -23,7 +23,7 @@ import {
23
23
  isSchemaPath,
24
24
  isSchemaRelativePath,
25
25
  mentionsDocsPath
26
- } from "./chunk-KVZLXGX3.js";
26
+ } from "./chunk-VEHHPXW6.js";
27
27
  import {
28
28
  isLiveDaemonSession
29
29
  } from "./chunk-C5U44UI7.js";
@@ -268,8 +268,30 @@ function quoteForPosixShell(value) {
268
268
  return `'${value.replaceAll("'", `'\\''`)}'`;
269
269
  }
270
270
 
271
- // src/commands/sessions/daemon/worktree/stopInstall.ts
271
+ // src/commands/sessions/daemon/killTree.ts
272
272
  import { execFile } from "child_process";
273
+ function killTree(pid) {
274
+ if (process.platform === "win32") {
275
+ execFile(
276
+ "taskkill",
277
+ ["/T", "/F", "/PID", String(pid)],
278
+ { windowsHide: true },
279
+ () => {
280
+ }
281
+ );
282
+ return;
283
+ }
284
+ try {
285
+ process.kill(-pid, "SIGKILL");
286
+ } catch {
287
+ try {
288
+ process.kill(pid, "SIGKILL");
289
+ } catch {
290
+ }
291
+ }
292
+ }
293
+
294
+ // src/commands/sessions/daemon/worktree/stopInstall.ts
273
295
  var running = /* @__PURE__ */ new Map();
274
296
  function trackInstall(worktreePath, child) {
275
297
  const children = running.get(worktreePath) ?? /* @__PURE__ */ new Set();
@@ -293,26 +315,6 @@ function stopInstall(worktreePath) {
293
315
  killTree(child.pid);
294
316
  }
295
317
  }
296
- function killTree(pid) {
297
- if (process.platform === "win32") {
298
- execFile(
299
- "taskkill",
300
- ["/T", "/F", "/PID", String(pid)],
301
- { windowsHide: true },
302
- () => {
303
- }
304
- );
305
- return;
306
- }
307
- try {
308
- process.kill(-pid, "SIGKILL");
309
- } catch {
310
- try {
311
- process.kill(pid, "SIGKILL");
312
- } catch {
313
- }
314
- }
315
- }
316
318
 
317
319
  // src/commands/sessions/daemon/worktree/spawnInstall.ts
318
320
  var STDERR_TAIL = 2e3;
@@ -463,6 +465,7 @@ function worktreeWithBranch(listing, branch) {
463
465
  export {
464
466
  worktreeConfigFor,
465
467
  allocateTree,
468
+ killTree,
466
469
  stopInstall,
467
470
  seedWorktree,
468
471
  prCliCommands,
@@ -899,7 +899,8 @@ function renderPrompt(raw) {
899
899
  return args ? `${name} ${args}` : name;
900
900
  }
901
901
  const bashInput = marker(raw, "bash-input");
902
- if (bashInput) return `! ${bashInput}`;
902
+ if (bashInput)
903
+ return stripBlocks(raw.replace(/<bash-input>[\s\S]*?<\/bash-input>/g, "")) || `! ${bashInput}`;
903
904
  return stripBlocks(raw);
904
905
  }
905
906
  function marker(raw, tag) {
@@ -910,16 +911,14 @@ function stripBlocks(raw) {
910
911
  return raw.replace(/<system-reminder>[\s\S]*?<\/system-reminder>/g, "").replace(/<task-notification>[\s\S]*?<\/task-notification>/g, "").replace(/<command-[^>]*>[\s\S]*?<\/command-[^>]*>/g, "").replace(/<local-command-[^>]*>[\s\S]*?<\/local-command-[^>]*>/g, "").replace(/<bash-(stdout|stderr)>[\s\S]*?<\/bash-\1>/g, "").trim();
911
912
  }
912
913
 
913
- // src/commands/sessions/shared/renderUserPrompt.ts
914
- var MAX_LENGTH = 2048;
914
+ // src/commands/sessions/shared/userPromptRaw.ts
915
915
  var INTERRUPT_PREFIX2 = "[Request interrupted";
916
- function renderUserPrompt(entry, maxLength = MAX_LENGTH) {
917
- if (entry.isSidechain || entry.isMeta) return void 0;
918
- if (entry.type !== "user" || isTaskNotification(entry)) return void 0;
916
+ function userPromptRaw(entry) {
917
+ if (entry.isSidechain || entry.isMeta) return null;
918
+ if (entry.type !== "user" || isTaskNotification(entry)) return null;
919
919
  const raw = promptTextOrNull(entry);
920
- if (raw === null || parseRestartNudge(raw) !== null) return void 0;
921
- const message2 = renderPrompt(raw);
922
- return message2 ? cap(message2, maxLength) : void 0;
920
+ if (raw === null || parseRestartNudge(raw) !== null) return null;
921
+ return raw;
923
922
  }
924
923
  function isTaskNotification(entry) {
925
924
  return asRecord4(entry.origin)?.kind === "task-notification";
@@ -938,9 +937,6 @@ function promptTextOrNull(entry) {
938
937
  }
939
938
  return parts.length === 0 ? null : parts.join("\n");
940
939
  }
941
- function cap(message2, maxLength) {
942
- return message2.length <= maxLength ? message2 : `${message2.slice(0, maxLength).trimEnd()}\u2026`;
943
- }
944
940
  function isInterrupt(value) {
945
941
  return value.trimStart().startsWith(INTERRUPT_PREFIX2);
946
942
  }
@@ -948,6 +944,18 @@ function asRecord4(value) {
948
944
  return value && typeof value === "object" ? value : null;
949
945
  }
950
946
 
947
+ // src/commands/sessions/shared/renderUserPrompt.ts
948
+ var MAX_LENGTH = 2048;
949
+ function renderUserPrompt(entry, maxLength = MAX_LENGTH) {
950
+ const raw = userPromptRaw(entry);
951
+ if (raw === null) return void 0;
952
+ const message2 = renderPrompt(raw);
953
+ return message2 ? cap(message2, maxLength) : void 0;
954
+ }
955
+ function cap(message2, maxLength) {
956
+ return message2.length <= maxLength ? message2 : `${message2.slice(0, maxLength).trimEnd()}\u2026`;
957
+ }
958
+
951
959
  // src/commands/sessions/shared/toolTarget.ts
952
960
  function toolTarget(input) {
953
961
  if (!input || typeof input !== "object") return "";
@@ -1049,6 +1057,33 @@ function claudeAssistantEvents(content, at) {
1049
1057
  ];
1050
1058
  }
1051
1059
 
1060
+ // src/commands/sessions/shared/splitShellBlocks.ts
1061
+ var SHELL_BLOCK = /<bash-input>([\s\S]*?)<\/bash-input>\s*(?:<bash-stdout>([\s\S]*?)<\/bash-stdout>)?\s*(?:<bash-stderr>([\s\S]*?)<\/bash-stderr>)?/g;
1062
+ function splitShellBlocks(raw) {
1063
+ const shells = [];
1064
+ const text = raw.replace(SHELL_BLOCK, (match, command, stdout, stderr) => {
1065
+ if (stdout === void 0 && stderr === void 0) return match;
1066
+ shells.push({
1067
+ command: String(command).trim(),
1068
+ stdout: stdout ?? "",
1069
+ stderr: stderr ?? ""
1070
+ });
1071
+ return "";
1072
+ });
1073
+ return shells.length ? { shells, text: text.trim() } : null;
1074
+ }
1075
+
1076
+ // src/shared/harnessAdapters/claudeShellEvents.ts
1077
+ function claudeShellEvents(entry, at) {
1078
+ const raw = userPromptRaw(entry);
1079
+ const shell = raw === null ? null : splitShellBlocks(raw);
1080
+ if (!shell) return { events: [], textless: false };
1081
+ return {
1082
+ events: shell.shells.map((block) => ({ kind: "shell", ...block, at })),
1083
+ textless: !shell.text
1084
+ };
1085
+ }
1086
+
1052
1087
  // src/shared/harnessAdapters/claudeEntryEvents.ts
1053
1088
  function contentOf(entry) {
1054
1089
  return entry.message?.content;
@@ -1058,8 +1093,9 @@ function resultText(content) {
1058
1093
  return claudeContentBlocksOf(content).filter((block) => block.type === "text").map((block) => String(block.text ?? "")).join("\n");
1059
1094
  }
1060
1095
  function userEvents(entry, at) {
1061
- const events = [];
1062
- const text = renderUserPrompt(entry, Number.POSITIVE_INFINITY);
1096
+ const shell = claudeShellEvents(entry, at);
1097
+ const events = shell.events;
1098
+ const text = shell.textless ? void 0 : renderUserPrompt(entry, Number.POSITIVE_INFINITY);
1063
1099
  if (text) events.push({ kind: "message", role: "user", text, at });
1064
1100
  else {
1065
1101
  const normalized = normalizeUser(entry);
@@ -3444,6 +3480,7 @@ function createSdkExit(emit, child) {
3444
3480
  function sdkSessionHandle(label) {
3445
3481
  const listeners = [];
3446
3482
  let turn;
3483
+ let prefixer;
3447
3484
  const unbound = (action) => daemonLog(`${label} sdk ${action} dropped: query not started`);
3448
3485
  const handle = {
3449
3486
  onEvent: (listener) => listeners.push(listener),
@@ -3454,13 +3491,24 @@ function sdkSessionHandle(label) {
3454
3491
  unbound("dequeue");
3455
3492
  return false;
3456
3493
  },
3457
- stopTask: (taskId) => turn ? turn.stopTask(taskId) : Promise.reject(new Error("query not started"))
3494
+ stopTask: (taskId) => turn ? turn.stopTask(taskId) : Promise.reject(new Error("query not started")),
3495
+ setPrefix: (provider) => {
3496
+ prefixer = provider;
3497
+ }
3458
3498
  };
3459
3499
  return {
3460
3500
  handle,
3461
3501
  emit: (event) => {
3462
3502
  for (const listener of listeners) listener(event);
3463
3503
  },
3504
+ /* why: held shell results join a message only as it reaches Claude, so a
3505
+ * message queued mid-turn still picks up output that finished after it. */
3506
+ prefix: (text) => {
3507
+ const blocks = prefixer?.();
3508
+ return blocks ? `${blocks}
3509
+
3510
+ ${text}` : text;
3511
+ },
3464
3512
  bind: (controls) => {
3465
3513
  turn = controls;
3466
3514
  }
@@ -3496,7 +3544,8 @@ function createSdkSessionProcess(sessionId, abort) {
3496
3544
  child = spawned;
3497
3545
  },
3498
3546
  aborted: () => abort.signal.aborted,
3499
- bind: sdk.bind
3547
+ bind: sdk.bind,
3548
+ prefix: sdk.prefix
3500
3549
  };
3501
3550
  }
3502
3551
 
@@ -3568,7 +3617,7 @@ function createSdkMessageQueue(label, control, push) {
3568
3617
  flush: () => {
3569
3618
  if (!queued.length) return false;
3570
3619
  daemonLog(`${label} sdk sending ${queued.length} queued message(s)`);
3571
- const text = queued.join("\n\n");
3620
+ const text = control.prefix(queued.join("\n\n"));
3572
3621
  publish([], text);
3573
3622
  push(text);
3574
3623
  return true;
@@ -3576,6 +3625,69 @@ function createSdkMessageQueue(label, control, push) {
3576
3625
  };
3577
3626
  }
3578
3627
 
3628
+ // src/commands/sessions/daemon/sdk/procSampler/nextFlatSince.ts
3629
+ function isFlat(next, previous) {
3630
+ const a = next.sample;
3631
+ const b = previous.sample;
3632
+ return a.pid === b.pid && a.cpuTicks === b.cpuTicks && a.readBytes === b.readBytes && a.writeBytes === b.writeBytes;
3633
+ }
3634
+ function nextFlatSince(next, previous, flatSince) {
3635
+ if (!previous || flatSince === void 0 || !isFlat(next, previous))
3636
+ return next.at;
3637
+ return flatSince;
3638
+ }
3639
+
3640
+ // src/commands/sessions/daemon/sdk/procSampler/ioBytesPerSecond.ts
3641
+ function delta(next, prev) {
3642
+ return next === void 0 || prev === void 0 ? void 0 : next - prev;
3643
+ }
3644
+ function ioBytesPerSecond(next, prev, seconds) {
3645
+ if (!prev || prev.pid !== next.pid || seconds <= 0) return void 0;
3646
+ const read = delta(next.readBytes, prev.readBytes);
3647
+ const write = delta(next.writeBytes, prev.writeBytes);
3648
+ if (read === void 0 && write === void 0) return void 0;
3649
+ return Math.round(Math.max(read ?? 0, write ?? 0) / seconds);
3650
+ }
3651
+
3652
+ // src/commands/sessions/daemon/sdk/procSampler/toSdkProcessInfo.ts
3653
+ var IDLE_THRESHOLD_MS = 6e4;
3654
+ function idleMinutes(next, flatSince) {
3655
+ const flatFor = next.at - flatSince;
3656
+ return flatFor < IDLE_THRESHOLD_MS ? void 0 : Math.floor(flatFor / 6e4);
3657
+ }
3658
+ function toSdkProcessInfo(next, previous, flatSince = next.at) {
3659
+ const ioRate = ioBytesPerSecond(
3660
+ next.sample,
3661
+ previous?.sample,
3662
+ previous ? (next.at - previous.at) / 1e3 : 0
3663
+ );
3664
+ const idle = idleMinutes(next, flatSince);
3665
+ return {
3666
+ command: next.sample.command,
3667
+ ...ioRate === void 0 ? {} : { ioBytesPerSec: ioRate },
3668
+ ...idle === void 0 ? {} : { idleMinutes: idle }
3669
+ };
3670
+ }
3671
+
3672
+ // src/commands/sessions/daemon/sdk/procSampler/createLeafProcessTracker.ts
3673
+ function createLeafProcessTracker(now) {
3674
+ let previous;
3675
+ let flatSince;
3676
+ return {
3677
+ next(sample) {
3678
+ const current = sample ? { sample, at: now() } : void 0;
3679
+ flatSince = current ? nextFlatSince(current, previous, flatSince) : void 0;
3680
+ const info = current ? toSdkProcessInfo(current, previous, flatSince) : null;
3681
+ previous = current;
3682
+ return info;
3683
+ },
3684
+ reset() {
3685
+ previous = void 0;
3686
+ flatSince = void 0;
3687
+ }
3688
+ };
3689
+ }
3690
+
3579
3691
  // src/commands/sessions/daemon/sdk/procSampler/dedupeProcessEmit.ts
3580
3692
  function dedupeProcessEmit(emit) {
3581
3693
  let published;
@@ -3727,31 +3839,6 @@ function startSerialInterval(run, intervalMs) {
3727
3839
  return () => clearInterval(timer);
3728
3840
  }
3729
3841
 
3730
- // src/commands/sessions/daemon/sdk/procSampler/ioBytesPerSecond.ts
3731
- function delta(next, prev) {
3732
- return next === void 0 || prev === void 0 ? void 0 : next - prev;
3733
- }
3734
- function ioBytesPerSecond(next, prev, seconds) {
3735
- if (!prev || prev.pid !== next.pid || seconds <= 0) return void 0;
3736
- const read = delta(next.readBytes, prev.readBytes);
3737
- const write = delta(next.writeBytes, prev.writeBytes);
3738
- if (read === void 0 && write === void 0) return void 0;
3739
- return Math.round(Math.max(read ?? 0, write ?? 0) / seconds);
3740
- }
3741
-
3742
- // src/commands/sessions/daemon/sdk/procSampler/toSdkProcessInfo.ts
3743
- function toSdkProcessInfo(next, previous) {
3744
- const ioRate = ioBytesPerSecond(
3745
- next.sample,
3746
- previous?.sample,
3747
- previous ? (next.at - previous.at) / 1e3 : 0
3748
- );
3749
- return {
3750
- command: next.sample.command,
3751
- ...ioRate === void 0 ? {} : { ioBytesPerSec: ioRate }
3752
- };
3753
- }
3754
-
3755
3842
  // src/commands/sessions/daemon/sdk/procSampler/createSdkProcessWatch.ts
3756
3843
  var SAMPLE_INTERVAL_MS = 2e3;
3757
3844
  var START_GRACE_TICKS = 2 * CLOCK_TICKS_PER_SECOND;
@@ -3762,20 +3849,18 @@ function createSdkProcessWatch(getPid, emit, {
3762
3849
  } = {}) {
3763
3850
  let generation = 0;
3764
3851
  let stopTimer;
3765
- let previous;
3852
+ const tracker = createLeafProcessTracker(now);
3766
3853
  const publish = dedupeProcessEmit(emit);
3767
3854
  const tick = async (run, pid, since) => {
3768
3855
  const sample = await sampleLeafProcess(procRoot, pid, since);
3769
3856
  if (run !== generation) return;
3770
- const current = sample ? { sample, at: now() } : void 0;
3771
- publish(current ? toSdkProcessInfo(current, previous) : null);
3772
- previous = current;
3857
+ publish(tracker.next(sample));
3773
3858
  };
3774
3859
  const stop = () => {
3775
3860
  generation++;
3776
3861
  stopTimer?.();
3777
3862
  stopTimer = void 0;
3778
- previous = void 0;
3863
+ tracker.reset();
3779
3864
  publish(null);
3780
3865
  };
3781
3866
  const start = async () => {
@@ -3871,8 +3956,9 @@ function createSdkTurnTracker(label, control, push) {
3871
3956
  send: (text) => {
3872
3957
  if (busy) return queue.add(text);
3873
3958
  daemonLog(`${label} sdk message sent: ${quoteForLog(text)}`);
3874
- push(text);
3875
- control.emit({ kind: "pending", texts: [text] });
3959
+ const message2 = control.prefix(text);
3960
+ push(message2);
3961
+ control.emit({ kind: "pending", texts: [message2] });
3876
3962
  setStatus("running");
3877
3963
  },
3878
3964
  dequeue: queue.remove,
@@ -4363,6 +4449,7 @@ export {
4363
4449
  readTranscriptTail,
4364
4450
  readTranscriptTailSync,
4365
4451
  parseRestartNudge,
4452
+ splitShellBlocks,
4366
4453
  emptyScanUsage,
4367
4454
  scanUsageTokens,
4368
4455
  reviewerLabel,
@@ -4372,6 +4459,7 @@ export {
4372
4459
  killSdkChild,
4373
4460
  noopDisposable,
4374
4461
  sdkTerminalStub,
4462
+ quoteForLog,
4375
4463
  setSdkUsageSink,
4376
4464
  workflowQueryEnv,
4377
4465
  spawnClaudeSdk,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildDoctorProbes,
3
3
  diagnoseLink
4
- } from "./chunk-IIVIXJ4L.js";
4
+ } from "./chunk-ZKPXMOR6.js";
5
5
  import {
6
6
  queryNodes
7
7
  } from "./chunk-OD7CMDGZ.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BJDGVLYX.js";
4
4
  import {
5
5
  resolveRewindPlan
6
- } from "./chunk-UDHMQBPS.js";
6
+ } from "./chunk-B7VURMUV.js";
7
7
  import {
8
8
  updateCurrentPhase,
9
9
  updateStatus
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  harnessAdapter,
6
6
  parseRolloutEntry
7
- } from "./chunk-N4TYIEKN.js";
7
+ } from "./chunk-43MJXI4R.js";
8
8
  import {
9
9
  harnesses
10
10
  } from "./chunk-XDIVXGPQ.js";
@@ -52,6 +52,10 @@ function toMessages(event) {
52
52
  ...event.description && { description: event.description }
53
53
  }
54
54
  ];
55
+ if (event.kind === "shell") {
56
+ const { command, stdout, stderr } = event;
57
+ return [{ role: "shell", command, stdout, stderr }];
58
+ }
55
59
  if (event.kind === "interrupt") return [{ role: "interrupt" }];
56
60
  if (event.kind === "restart")
57
61
  return [{ role: "restart", killed: event.killed }];
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-TQ5KKZ6G.js";
7
7
  import {
8
8
  previewAnswerWaitBlocker
9
- } from "./chunk-UDEJCU6V.js";
9
+ } from "./chunk-MVSLFBWG.js";
10
10
  import {
11
11
  askQuestionEnabled
12
12
  } from "./chunk-IBPSXDUB.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveReviewPhase
3
- } from "./chunk-FSNGBFAH.js";
3
+ } from "./chunk-YQJBSNEL.js";
4
4
  import {
5
5
  resolvePlan
6
- } from "./chunk-L3ITNM4T.js";
6
+ } from "./chunk-QF5UR5N2.js";
7
7
 
8
8
  // src/commands/backlog/resolveRewindPlan.ts
9
9
  function resolveRewindPlan(item) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  OneShotUnavailableError,
3
3
  runOneShotPrompt
4
- } from "./chunk-VYW6R64U.js";
4
+ } from "./chunk-UY75YJI5.js";
5
5
  import {
6
6
  withSpinner
7
7
  } from "./chunk-OZNYQOQK.js";