@staff0rd/assist 0.1151.0 → 0.1152.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 (101) hide show
  1. package/dist/.build-files +93 -93
  2. package/dist/{addActivity-JEDMNTYW.js → addActivity-RCVI7MFJ.js} +2 -2
  3. package/dist/{addPhase-J34XKHLO.js → addPhase-G2Q3CN22.js} +4 -4
  4. package/dist/{advise-WN2C66UJ.js → advise-HYDI6MD2.js} +3 -3
  5. package/dist/{ask-GXMVORX7.js → ask-ZZRX33YD.js} +2 -2
  6. package/dist/{askCheck-76WHHHNM.js → askCheck-V6JBBUTK.js} +8 -8
  7. package/dist/{askDesign-ZNZD3VXM.js → askDesign-WQHY6WQU.js} +3 -3
  8. package/dist/{askQuestion-MRI2ATSI.js → askQuestion-A653WELI.js} +1 -1
  9. package/dist/{branch-K2DGKPDR.js → branch-GDJ66H7C.js} +3 -3
  10. package/dist/built-version +1 -1
  11. package/dist/{chunk-PGJVFI4M.js → chunk-37I3HCXS.js} +1 -1
  12. package/dist/{chunk-XYT5LCUW.js → chunk-3ETEYHXZ.js} +1 -1
  13. package/dist/{chunk-C3DOHRWO.js → chunk-3RGJVOHF.js} +1 -1
  14. package/dist/{chunk-TGVCPC2F.js → chunk-4GMKRFT6.js} +1 -1
  15. package/dist/{chunk-NFXJVC2Z.js → chunk-5UTFJBQW.js} +2 -2
  16. package/dist/{chunk-GKCAEW5J.js → chunk-6J7H4L5U.js} +49 -19
  17. package/dist/{chunk-3JVE3EEO.js → chunk-7QD3L7KA.js} +1 -1
  18. package/dist/{chunk-NU3L3SM2.js → chunk-A2GTJKBK.js} +1 -1
  19. package/dist/{chunk-GZEEGROK.js → chunk-B2URMB3I.js} +1 -1
  20. package/dist/{chunk-3J2AZSPZ.js → chunk-B3L73DOX.js} +6 -6
  21. package/dist/{chunk-S6TWGP2S.js → chunk-C56W3PEA.js} +1 -1
  22. package/dist/{chunk-AT33IHDZ.js → chunk-C67WW2XW.js} +1 -1
  23. package/dist/{chunk-ZH7FLZPU.js → chunk-CJUZTNRQ.js} +1 -1
  24. package/dist/{chunk-OWWGKT6F.js → chunk-CNDR5OUJ.js} +1 -1
  25. package/dist/{chunk-C4POAODE.js → chunk-D6XI63MC.js} +1 -1
  26. package/dist/{chunk-CJLBH3DN.js → chunk-DYGEMDS7.js} +1 -1
  27. package/dist/{chunk-H3UM6QRY.js → chunk-GOQK3KCL.js} +1 -1
  28. package/dist/{chunk-U2MFQ2H4.js → chunk-GSVPCLVG.js} +2 -2
  29. package/dist/{chunk-QOQ6LRUD.js → chunk-GT44SBVO.js} +1 -1
  30. package/dist/{chunk-SBRGQVWS.js → chunk-II6SR37X.js} +1 -1
  31. package/dist/{chunk-KSMPUXH5.js → chunk-INKR7DE3.js} +1 -1
  32. package/dist/{chunk-CHAUXPIP.js → chunk-JTUJI55D.js} +1 -1
  33. package/dist/{chunk-DIQAEGJ5.js → chunk-KI7RHWH5.js} +15 -2
  34. package/dist/{chunk-YVCSXCBB.js → chunk-M57ATSAM.js} +4 -4
  35. package/dist/{chunk-OA4EJYZY.js → chunk-OAPWC2T4.js} +286 -53
  36. package/dist/{chunk-V4W6R2LK.js → chunk-ONXZPFKE.js} +1 -1
  37. package/dist/{chunk-D2GLGK3G.js → chunk-PPWM3WBM.js} +3 -3
  38. package/dist/{chunk-SXYX65J7.js → chunk-PSQ24TON.js} +2 -2
  39. package/dist/{chunk-KA2V6HLD.js → chunk-QAS45635.js} +1 -1
  40. package/dist/{chunk-CD56HMTG.js → chunk-RML5ROGC.js} +1 -1
  41. package/dist/{chunk-VYFXF763.js → chunk-RV4NFZZ5.js} +1 -1
  42. package/dist/{chunk-LZY4INWM.js → chunk-SLKU7FHG.js} +1 -1
  43. package/dist/{chunk-YMYZBSS6.js → chunk-TECUUDTX.js} +1 -1
  44. package/dist/{chunk-OIEWOLWW.js → chunk-UKXNBLDW.js} +2 -2
  45. package/dist/{chunk-3RPWEZV4.js → chunk-VWO3F27D.js} +1 -1
  46. package/dist/{chunk-4NSAQ5E5.js → chunk-XX5PPG3E.js} +1 -1
  47. package/dist/{chunk-GZ5E7OHF.js → chunk-YDWT36XX.js} +1 -1
  48. package/dist/{chunk-MOBXP7IB.js → chunk-YJJJFSV6.js} +1 -1
  49. package/dist/{chunk-SYTHN2X3.js → chunk-YRVUUZLX.js} +1 -1
  50. package/dist/{chunk-ZQQEBC6Y.js → chunk-ZNPV7M2Z.js} +1 -1
  51. package/dist/{cliHook-NCHROJVU.js → cliHook-P6HTSFES.js} +5 -5
  52. package/dist/{cliHookCheck-2QH7HBCX.js → cliHookCheck-PQHNJXBZ.js} +2 -2
  53. package/dist/{codexHook-GQJFH7AF.js → codexHook-UABSPFWA.js} +7 -7
  54. package/dist/commands/extension/extension/content.js +1 -1
  55. package/dist/commands/extension/extension/docs.js +18 -18
  56. package/dist/commands/extension/extension/updates.json +2 -2
  57. package/dist/commands/sessions/web/bundle.js +425 -425
  58. package/dist/{comment-NXF5C634.js → comment-CADYMIUH.js} +3 -3
  59. package/dist/{commentIssue-SZAB7TJQ.js → commentIssue-2VMPDQ74.js} +2 -2
  60. package/dist/{commit-VT7VJNAT.js → commit-B4I4JBLS.js} +3 -3
  61. package/dist/{createIssue-FQQNJIWA.js → createIssue-J6QLUACO.js} +1 -1
  62. package/dist/{doctorNodes-A4WV4O2N.js → doctorNodes-MA4UZTAL.js} +3 -3
  63. package/dist/{done-3PMUFG5E.js → done-LI5N36L5.js} +4 -4
  64. package/dist/{edit-MRTB2VJQ.js → edit-XOU2IWSF.js} +1 -1
  65. package/dist/{editHook-4I4O24OG.js → editHook-7UT6UAJN.js} +5 -5
  66. package/dist/{editIssue-WICT2PNQ.js → editIssue-6I3BU4YO.js} +1 -1
  67. package/dist/{editIssueComment-OJZXFL5P.js → editIssueComment-OLT3MQDH.js} +2 -2
  68. package/dist/{fixConflict-KE72MGGP.js → fixConflict-MIFDKQ3T.js} +2 -2
  69. package/dist/index.js +60 -60
  70. package/dist/{launchMode-G5GQI6RH.js → launchMode-GKCBLWHJ.js} +13 -13
  71. package/dist/{list-SFYLZAWU.js → list-MI7LNQ7D.js} +5 -5
  72. package/dist/{next-6K6G7FPY.js → next-VHPVHFWC.js} +12 -12
  73. package/dist/{piHook-VW54NTXW.js → piHook-WFN7QKHJ.js} +5 -5
  74. package/dist/{postSlackMessage-EOGHWXM5.js → postSlackMessage-IPJ2HPKC.js} +2 -2
  75. package/dist/{propose-2QLI6LNH.js → propose-UFC5CRVG.js} +5 -5
  76. package/dist/{raise-UADRWTZE.js → raise-AWHJN5PS.js} +1 -1
  77. package/dist/{refine-2TN2MGBJ.js → refine-2HT7X4Q3.js} +14 -14
  78. package/dist/{reply-UTOBFFKP.js → reply-QXSMUPXO.js} +2 -2
  79. package/dist/{restartNode-7747LAX4.js → restartNode-2DCPTOOE.js} +5 -5
  80. package/dist/{review-YJZVECC6.js → review-M3EL4NJ7.js} +5 -5
  81. package/dist/{reviewPrComments-2K5ZASCB.js → reviewPrComments-FRL5QJOW.js} +2 -2
  82. package/dist/{rewindPhase-ESQ5E74W.js → rewindPhase-WK2SFUPK.js} +8 -8
  83. package/dist/{run-XK5D6Q5L.js → run-3UGWKORI.js} +10 -10
  84. package/dist/{run-NUMXNCH5.js → run-RWVOOLOQ.js} +10 -10
  85. package/dist/{runDaemon-ZQ7BPPBN.js → runDaemon-D7OMPX4F.js} +50 -24
  86. package/dist/{runExtract-CTLWMXRG.js → runExtract-HCHT2Z6A.js} +1 -1
  87. package/dist/{runRefine-IPBZEQAF.js → runRefine-JURYPIDG.js} +14 -14
  88. package/dist/{scan-QLPUZAJB.js → scan-RQPVCLF6.js} +2 -2
  89. package/dist/{schemaConfirm-FH6DHU5D.js → schemaConfirm-SSOJL34W.js} +2 -2
  90. package/dist/{schemaUnlock-RVWEQGBX.js → schemaUnlock-Y5I3NWZT.js} +2 -2
  91. package/dist/{search-6IJI74JX.js → search-Z3EALCQT.js} +5 -5
  92. package/dist/{show-N4PRGXZV.js → show-P7PK7BRV.js} +3 -3
  93. package/dist/{show-3BYF2XTK.js → show-WP2QQPMY.js} +3 -3
  94. package/dist/{signExtension-J4OEQ55N.js → signExtension-NVKKIUU6.js} +1 -1
  95. package/dist/{slack-HQPEBAAX.js → slack-4ZPQ5C5L.js} +2 -2
  96. package/dist/{updateNode-ECV2WNLI.js → updateNode-YPCZVJSA.js} +5 -5
  97. package/dist/{updatePlan-UYKO2LUV.js → updatePlan-U34WLBXQ.js} +5 -5
  98. package/dist/{web-LP6LWDBQ.js → web-5RR4WETV.js} +16 -16
  99. package/dist/{web-CBUMKQK3.js → web-UDO3S4E5.js} +16 -16
  100. package/dist/{wontfix-FIYGOSWH.js → wontfix-PHYW2KQ7.js} +2 -2
  101. package/package.json +1 -1
@@ -3410,7 +3410,8 @@ function sdkSessionHandle(label) {
3410
3410
  const handle = {
3411
3411
  onEvent: (listener) => listeners.push(listener),
3412
3412
  send: (text) => turn ? turn.send(text) : unbound("message"),
3413
- interrupt: () => turn ? turn.interrupt() : unbound("interrupt")
3413
+ interrupt: () => turn ? turn.interrupt() : unbound("interrupt"),
3414
+ stopTask: (taskId) => turn ? turn.stopTask(taskId) : Promise.reject(new Error("query not started"))
3414
3415
  };
3415
3416
  return {
3416
3417
  handle,
@@ -3528,12 +3529,275 @@ function createSdkMessageQueue(label, control, push) {
3528
3529
  };
3529
3530
  }
3530
3531
 
3532
+ // src/commands/sessions/daemon/sdk/procSampler/dedupeProcessEmit.ts
3533
+ function dedupeProcessEmit(emit) {
3534
+ let published;
3535
+ return (info) => {
3536
+ const key = info ? JSON.stringify(info) : void 0;
3537
+ if (key === published) return;
3538
+ published = key;
3539
+ emit(info);
3540
+ };
3541
+ }
3542
+
3543
+ // src/commands/sessions/daemon/sdk/procSampler/readUptimeTicks.ts
3544
+ import { readFile } from "fs/promises";
3545
+ import { join as join15 } from "path";
3546
+ var CLOCK_TICKS_PER_SECOND = 100;
3547
+ async function readUptimeTicks(procRoot) {
3548
+ try {
3549
+ const text = await readFile(join15(procRoot, "uptime"), "utf8");
3550
+ return Math.floor(Number.parseFloat(text) * CLOCK_TICKS_PER_SECOND);
3551
+ } catch {
3552
+ return void 0;
3553
+ }
3554
+ }
3555
+
3556
+ // src/commands/sessions/daemon/sdk/procSampler/sampleLeafProcess.ts
3557
+ import { readdir, readFile as readFile3 } from "fs/promises";
3558
+ import { join as join17 } from "path";
3559
+
3560
+ // src/commands/sessions/daemon/sdk/procSampler/findLeafProcess.ts
3561
+ function outranks(stat, depth, best) {
3562
+ if (depth !== best.depth) return depth > best.depth;
3563
+ if (stat.startTicks !== best.stat.startTicks)
3564
+ return stat.startTicks > best.stat.startTicks;
3565
+ return stat.pid < best.stat.pid;
3566
+ }
3567
+ function findLeafProcess(stats, rootPid, minStartTicks) {
3568
+ const children = /* @__PURE__ */ new Map();
3569
+ for (const stat of stats) {
3570
+ const siblings = children.get(stat.ppid) ?? [];
3571
+ siblings.push(stat);
3572
+ children.set(stat.ppid, siblings);
3573
+ }
3574
+ let best;
3575
+ const walk = (pid, depth) => {
3576
+ for (const child of children.get(pid) ?? []) {
3577
+ if (child.state === "Z") continue;
3578
+ if (child.startTicks >= minStartTicks && (!best || outranks(child, depth, best)))
3579
+ best = { stat: child, depth };
3580
+ walk(child.pid, depth + 1);
3581
+ }
3582
+ };
3583
+ walk(rootPid, 1);
3584
+ return best?.stat;
3585
+ }
3586
+
3587
+ // src/commands/sessions/daemon/sdk/procSampler/readProcStat.ts
3588
+ import { readFile as readFile2 } from "fs/promises";
3589
+ import { join as join16 } from "path";
3590
+ async function readProcStat(procRoot, pid) {
3591
+ try {
3592
+ const text = await readFile2(join16(procRoot, String(pid), "stat"), "utf8");
3593
+ const fields = text.slice(text.lastIndexOf(")") + 2).split(" ");
3594
+ return {
3595
+ pid,
3596
+ state: fields[0],
3597
+ ppid: Number(fields[1]),
3598
+ cpuTicks: Number(fields[11]) + Number(fields[12]),
3599
+ startTicks: Number(fields[19])
3600
+ };
3601
+ } catch {
3602
+ return void 0;
3603
+ }
3604
+ }
3605
+
3606
+ // src/commands/sessions/daemon/sdk/procSampler/trimProcessCommand.ts
3607
+ import { basename as basename5 } from "path";
3608
+ var MAX_LENGTH2 = 60;
3609
+ var INTERPRETERS = /* @__PURE__ */ new Set([
3610
+ "node",
3611
+ "python",
3612
+ "python3",
3613
+ "bash",
3614
+ "sh",
3615
+ "bun",
3616
+ "deno"
3617
+ ]);
3618
+ function trimProcessCommand(argv) {
3619
+ const args = argv.filter(Boolean);
3620
+ if (args.length === 0) return "";
3621
+ const [first, ...rest] = args;
3622
+ const program = basename5(first);
3623
+ const script = rest[0];
3624
+ const words = INTERPRETERS.has(program) && script?.includes("/") && !script.startsWith("-") ? [basename5(script), ...rest.slice(1)] : [program, ...rest];
3625
+ const text = words.join(" ");
3626
+ return text.length > MAX_LENGTH2 ? `${text.slice(0, MAX_LENGTH2 - 1)}\u2026` : text;
3627
+ }
3628
+
3629
+ // src/commands/sessions/daemon/sdk/procSampler/sampleLeafProcess.ts
3630
+ async function readText(path15) {
3631
+ try {
3632
+ return await readFile3(path15, "utf8");
3633
+ } catch {
3634
+ return void 0;
3635
+ }
3636
+ }
3637
+ function ioCounter(io, key) {
3638
+ const match = io?.match(new RegExp(`^${key}: (\\d+)$`, "m"));
3639
+ return match ? Number(match[1]) : void 0;
3640
+ }
3641
+ async function sampleLeafProcess(procRoot, rootPid, minStartTicks) {
3642
+ const entries = await readdir(procRoot).catch(() => []);
3643
+ const stats = await Promise.all(
3644
+ entries.filter((name) => /^\d+$/.test(name)).map((name) => readProcStat(procRoot, Number(name)))
3645
+ );
3646
+ const leaf = findLeafProcess(
3647
+ stats.filter((stat) => stat !== void 0),
3648
+ rootPid,
3649
+ minStartTicks
3650
+ );
3651
+ if (!leaf) return void 0;
3652
+ const dir = join17(procRoot, String(leaf.pid));
3653
+ const [cmdline, io] = await Promise.all([
3654
+ readText(join17(dir, "cmdline")),
3655
+ readText(join17(dir, "io"))
3656
+ ]);
3657
+ const command = trimProcessCommand(cmdline?.split("\0") ?? []);
3658
+ if (!command) return void 0;
3659
+ return {
3660
+ pid: leaf.pid,
3661
+ command,
3662
+ cpuTicks: leaf.cpuTicks,
3663
+ readBytes: ioCounter(io, "rchar"),
3664
+ writeBytes: ioCounter(io, "wchar")
3665
+ };
3666
+ }
3667
+
3668
+ // src/commands/sessions/daemon/sdk/procSampler/startSerialInterval.ts
3669
+ function startSerialInterval(run, intervalMs) {
3670
+ let busy = false;
3671
+ const fire = () => {
3672
+ if (busy) return;
3673
+ busy = true;
3674
+ void run().finally(() => {
3675
+ busy = false;
3676
+ });
3677
+ };
3678
+ const timer = setInterval(fire, intervalMs);
3679
+ fire();
3680
+ return () => clearInterval(timer);
3681
+ }
3682
+
3683
+ // src/commands/sessions/daemon/sdk/procSampler/ioBytesPerSecond.ts
3684
+ function delta(next, prev) {
3685
+ return next === void 0 || prev === void 0 ? void 0 : next - prev;
3686
+ }
3687
+ function ioBytesPerSecond(next, prev, seconds) {
3688
+ if (!prev || prev.pid !== next.pid || seconds <= 0) return void 0;
3689
+ const read = delta(next.readBytes, prev.readBytes);
3690
+ const write = delta(next.writeBytes, prev.writeBytes);
3691
+ if (read === void 0 && write === void 0) return void 0;
3692
+ return Math.round(Math.max(read ?? 0, write ?? 0) / seconds);
3693
+ }
3694
+
3695
+ // src/commands/sessions/daemon/sdk/procSampler/toSdkProcessInfo.ts
3696
+ function toSdkProcessInfo(next, previous) {
3697
+ const ioRate = ioBytesPerSecond(
3698
+ next.sample,
3699
+ previous?.sample,
3700
+ previous ? (next.at - previous.at) / 1e3 : 0
3701
+ );
3702
+ return {
3703
+ command: next.sample.command,
3704
+ ...ioRate === void 0 ? {} : { ioBytesPerSec: ioRate }
3705
+ };
3706
+ }
3707
+
3708
+ // src/commands/sessions/daemon/sdk/procSampler/createSdkProcessWatch.ts
3709
+ var SAMPLE_INTERVAL_MS = 2e3;
3710
+ var START_GRACE_TICKS = 2 * CLOCK_TICKS_PER_SECOND;
3711
+ function createSdkProcessWatch(getPid, emit, {
3712
+ procRoot = "/proc",
3713
+ platform = process.platform,
3714
+ now = Date.now
3715
+ } = {}) {
3716
+ let generation = 0;
3717
+ let stopTimer;
3718
+ let previous;
3719
+ const publish = dedupeProcessEmit(emit);
3720
+ const tick = async (run, pid, since) => {
3721
+ const sample = await sampleLeafProcess(procRoot, pid, since);
3722
+ if (run !== generation) return;
3723
+ const current = sample ? { sample, at: now() } : void 0;
3724
+ publish(current ? toSdkProcessInfo(current, previous) : null);
3725
+ previous = current;
3726
+ };
3727
+ const stop = () => {
3728
+ generation++;
3729
+ stopTimer?.();
3730
+ stopTimer = void 0;
3731
+ previous = void 0;
3732
+ publish(null);
3733
+ };
3734
+ const start = async () => {
3735
+ stop();
3736
+ const pid = getPid();
3737
+ if (platform !== "linux" || !pid) return;
3738
+ const run = generation;
3739
+ const uptime = await readUptimeTicks(procRoot);
3740
+ if (run !== generation || uptime === void 0) return;
3741
+ const since = uptime - START_GRACE_TICKS;
3742
+ stopTimer = startSerialInterval(
3743
+ () => tick(run, pid, since),
3744
+ SAMPLE_INTERVAL_MS
3745
+ );
3746
+ };
3747
+ return { start, stop };
3748
+ }
3749
+
3750
+ // src/commands/sessions/daemon/sdk/activityLine.ts
3751
+ var MAX_LINE = 80;
3752
+ function activityLine(text) {
3753
+ const line = text.trim().split("\n")[0].trim();
3754
+ return line.length > MAX_LINE ? `${line.slice(0, MAX_LINE - 1)}\u2026` : line;
3755
+ }
3756
+
3757
+ // src/commands/sessions/daemon/sdk/commandActivityLine.ts
3758
+ var LEADING_CD = /^cd\s+(?:"[^"]*"|'[^']*'|\S+)\s*(?:;|&&)\s*/;
3759
+ function commandActivityLine(command) {
3760
+ return activityLine(command.trim().replace(LEADING_CD, ""));
3761
+ }
3762
+
3763
+ // src/commands/sessions/daemon/sdk/sdkActivityText.ts
3764
+ var TARGET_KEYS = [
3765
+ "description",
3766
+ "command",
3767
+ "file_path",
3768
+ "notebook_path",
3769
+ "path",
3770
+ "pattern",
3771
+ "url",
3772
+ "query",
3773
+ "skill"
3774
+ ];
3775
+ function toolTarget2(input) {
3776
+ if (!input || typeof input !== "object") return "";
3777
+ const record3 = input;
3778
+ const key = TARGET_KEYS.find((k) => typeof record3[k] === "string");
3779
+ if (!key) return "";
3780
+ const value = record3[key];
3781
+ return key === "command" ? commandActivityLine(value) : activityLine(value);
3782
+ }
3783
+ var SDK_WORKING_ACTIVITY = "Working";
3784
+ function sdkActivityText(content) {
3785
+ const tool = [...content].reverse().find((block) => block.type === "tool_use");
3786
+ if (!tool?.name) return SDK_WORKING_ACTIVITY;
3787
+ const target = toolTarget2(tool.input);
3788
+ return `${SDK_WORKING_ACTIVITY} \xB7 ${tool.name}${target ? ` ${target}` : ""}`;
3789
+ }
3790
+
3531
3791
  // src/commands/sessions/daemon/sdk/createSdkTurnEmitter.ts
3532
3792
  var ELAPSED_RESYNC_SECONDS = 10;
3533
3793
  function createSdkTurnEmitter(label, control) {
3534
3794
  let status;
3535
3795
  let activity = null;
3536
3796
  let elapsed = null;
3797
+ const processWatch = createSdkProcessWatch(
3798
+ () => control.process.pid,
3799
+ (process2) => control.emit({ kind: "process", process: process2 })
3800
+ );
3537
3801
  const setElapsed = (next) => {
3538
3802
  elapsed = next;
3539
3803
  control.emit({ kind: "elapsed", seconds: next });
@@ -3544,7 +3808,10 @@ function createSdkTurnEmitter(label, control) {
3544
3808
  activity = next;
3545
3809
  control.emit({ kind: "activity", text: next });
3546
3810
  if (elapsed !== null) setElapsed(null);
3811
+ if (next === null || next === SDK_WORKING_ACTIVITY) processWatch.stop();
3812
+ else void processWatch.start();
3547
3813
  },
3814
+ stopProcessWatch: processWatch.stop,
3548
3815
  elapsed: (seconds) => {
3549
3816
  const next = Math.floor(seconds);
3550
3817
  if (elapsed !== null && next >= elapsed && next - elapsed < ELAPSED_RESYNC_SECONDS)
@@ -3582,6 +3849,7 @@ function createSdkTurnTracker(label, control, push) {
3582
3849
  return {
3583
3850
  setActivity: emit.activity,
3584
3851
  setElapsed: emit.elapsed,
3852
+ stopProcessWatch: emit.stopProcessWatch,
3585
3853
  setStatus,
3586
3854
  start: (prompt) => {
3587
3855
  busy = true;
@@ -3619,19 +3887,6 @@ function resolveClaudeExecutable() {
3619
3887
  return path15;
3620
3888
  }
3621
3889
 
3622
- // src/commands/sessions/daemon/sdk/activityLine.ts
3623
- var MAX_LINE = 80;
3624
- function activityLine(text) {
3625
- const line = text.trim().split("\n")[0].trim();
3626
- return line.length > MAX_LINE ? `${line.slice(0, MAX_LINE - 1)}\u2026` : line;
3627
- }
3628
-
3629
- // src/commands/sessions/daemon/sdk/commandActivityLine.ts
3630
- var LEADING_CD = /^cd\s+(?:"[^"]*"|'[^']*'|\S+)\s*(?:;|&&)\s*/;
3631
- function commandActivityLine(command) {
3632
- return activityLine(command.trim().replace(LEADING_CD, ""));
3633
- }
3634
-
3635
3890
  // src/commands/sessions/daemon/sdk/createSdkBackgroundTasks.ts
3636
3891
  function createSdkBackgroundTasks() {
3637
3892
  const described = /* @__PURE__ */ new Map();
@@ -3782,33 +4037,6 @@ function sdkTurnStatus(message2) {
3782
4037
  return void 0;
3783
4038
  }
3784
4039
 
3785
- // src/commands/sessions/daemon/sdk/sdkActivityText.ts
3786
- var TARGET_KEYS = [
3787
- "description",
3788
- "command",
3789
- "file_path",
3790
- "notebook_path",
3791
- "path",
3792
- "pattern",
3793
- "url",
3794
- "query",
3795
- "skill"
3796
- ];
3797
- function toolTarget2(input) {
3798
- if (!input || typeof input !== "object") return "";
3799
- const record3 = input;
3800
- const key = TARGET_KEYS.find((k) => typeof record3[k] === "string");
3801
- if (!key) return "";
3802
- const value = record3[key];
3803
- return key === "command" ? commandActivityLine(value) : activityLine(value);
3804
- }
3805
- function sdkActivityText(content) {
3806
- const tool = [...content].reverse().find((block) => block.type === "tool_use");
3807
- if (!tool?.name) return "Working";
3808
- const target = toolTarget2(tool.input);
3809
- return `Working \xB7 ${tool.name}${target ? ` ${target}` : ""}`;
3810
- }
3811
-
3812
4040
  // src/commands/sessions/daemon/sdk/trackSdkTurnProgress.ts
3813
4041
  function trackSdkTurnProgress(message2, turn) {
3814
4042
  if (message2.type === "assistant" && message2.parent_tool_use_id === null)
@@ -3847,6 +4075,8 @@ async function runSdkQuery(messages, sessionId, control, turn) {
3847
4075
  `${label} sdk query failed: ${error instanceof Error ? error.message : String(error)}`
3848
4076
  );
3849
4077
  control.exit(1);
4078
+ } finally {
4079
+ turn.stopProcessWatch();
3850
4080
  }
3851
4081
  }
3852
4082
 
@@ -3917,6 +4147,19 @@ function sdkQueryOptions(opts2, executable, abort, control) {
3917
4147
  };
3918
4148
  }
3919
4149
 
4150
+ // src/commands/sessions/daemon/sdk/awaitResume.ts
4151
+ function awaitResume(label, messages, control) {
4152
+ messages.initializationResult().then(
4153
+ () => {
4154
+ daemonLog(`${label} sdk resume complete`);
4155
+ control.emit({ kind: "resumed" });
4156
+ },
4157
+ (error) => daemonLog(
4158
+ `${label} sdk resume did not complete: ${error instanceof Error ? error.message : String(error)}`
4159
+ )
4160
+ );
4161
+ }
4162
+
3920
4163
  // src/commands/sessions/daemon/sdk/startSdkQuery.ts
3921
4164
  async function startSdkQuery(opts2, abort, control, turn, prompt) {
3922
4165
  const label = `session ${opts2.sessionId ?? "?"}`;
@@ -3934,7 +4177,8 @@ async function startSdkQuery(opts2, abort, control, turn, prompt) {
3934
4177
  send: turn.send,
3935
4178
  interrupt: () => turn.interrupt(async () => {
3936
4179
  await messages.interrupt();
3937
- })
4180
+ }),
4181
+ stopTask: (taskId) => messages.stopTask(taskId)
3938
4182
  });
3939
4183
  await runSdkQuery(messages, opts2.sessionId, control, turn);
3940
4184
  } catch (error) {
@@ -3944,17 +4188,6 @@ async function startSdkQuery(opts2, abort, control, turn, prompt) {
3944
4188
  control.exit(1);
3945
4189
  }
3946
4190
  }
3947
- function awaitResume(label, messages, control) {
3948
- messages.initializationResult().then(
3949
- () => {
3950
- daemonLog(`${label} sdk resume complete`);
3951
- control.emit({ kind: "resumed" });
3952
- },
3953
- (error) => daemonLog(
3954
- `${label} sdk resume did not complete: ${error instanceof Error ? error.message : String(error)}`
3955
- )
3956
- );
3957
- }
3958
4191
 
3959
4192
  // src/commands/sessions/daemon/spawnClaudeSdk.ts
3960
4193
  function spawnClaudeSdk(opts2) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  REVIEW_PHASE_NAME
3
- } from "./chunk-KSMPUXH5.js";
3
+ } from "./chunk-INKR7DE3.js";
4
4
 
5
5
  // src/commands/backlog/authoredPhases.ts
6
6
  function authoredPhases(plan) {
@@ -3,14 +3,14 @@ import {
3
3
  } from "./chunk-SB4BG7PH.js";
4
4
  import {
5
5
  run
6
- } from "./chunk-3J2AZSPZ.js";
6
+ } from "./chunk-B3L73DOX.js";
7
7
  import {
8
8
  isLockedByOther
9
- } from "./chunk-XYT5LCUW.js";
9
+ } from "./chunk-3ETEYHXZ.js";
10
10
  import {
11
11
  isBlocked,
12
12
  typeLabel
13
- } from "./chunk-3JVE3EEO.js";
13
+ } from "./chunk-7QD3L7KA.js";
14
14
  import {
15
15
  loadBacklog
16
16
  } from "./chunk-PYZUB3JT.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveReviewPhase
3
- } from "./chunk-OWWGKT6F.js";
3
+ } from "./chunk-CNDR5OUJ.js";
4
4
  import {
5
5
  resolvePlan
6
- } from "./chunk-KA2V6HLD.js";
6
+ } from "./chunk-QAS45635.js";
7
7
 
8
8
  // src/commands/backlog/resolveRewindPlan.ts
9
9
  function resolveRewindPlan(item) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  authoredPhases
3
- } from "./chunk-V4W6R2LK.js";
3
+ } from "./chunk-ONXZPFKE.js";
4
4
 
5
5
  // src/commands/backlog/resolvePlan.ts
6
6
  function resolvePlan(item) {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  harnessAdapter,
6
6
  parseRolloutEntry
7
- } from "./chunk-OA4EJYZY.js";
7
+ } from "./chunk-OAPWC2T4.js";
8
8
  import {
9
9
  harnesses
10
10
  } from "./chunk-XDIVXGPQ.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  currentExecutionIdentity,
6
6
  getSchemaSessionApprovalPath
7
- } from "./chunk-SYTHN2X3.js";
7
+ } from "./chunk-YRVUUZLX.js";
8
8
  import {
9
9
  resolveSessionItemId
10
10
  } from "./chunk-FPWL4VRC.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-P7FVAGFQ.js";
4
4
  import {
5
5
  previewAnswerWaitBlocker
6
- } from "./chunk-ZQQEBC6Y.js";
6
+ } from "./chunk-ZNPV7M2Z.js";
7
7
  import {
8
8
  askQuestionEnabled
9
9
  } from "./chunk-IBPSXDUB.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  awaitPreviewApproval
3
- } from "./chunk-DIQAEGJ5.js";
3
+ } from "./chunk-KI7RHWH5.js";
4
4
 
5
5
  // src/commands/prs/reviewProposedPrComment.ts
6
6
  import { randomUUID } from "crypto";
@@ -13,7 +13,7 @@ import {
13
13
  isApprovedRead,
14
14
  resolvePermission,
15
15
  splitCompound
16
- } from "./chunk-GZEEGROK.js";
16
+ } from "./chunk-B2URMB3I.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-VYFXF763.js";
26
+ } from "./chunk-RV4NFZZ5.js";
27
27
  import {
28
28
  isLiveDaemonSession
29
29
  } from "./chunk-C5U44UI7.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  awaitPreviewApproval
3
- } from "./chunk-DIQAEGJ5.js";
3
+ } from "./chunk-KI7RHWH5.js";
4
4
  import {
5
5
  loadConfig
6
6
  } from "./chunk-KGFZYUE2.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MODUPHYS.js";
4
4
  import {
5
5
  package_default
6
- } from "./chunk-C3DOHRWO.js";
6
+ } from "./chunk-3RGJVOHF.js";
7
7
  import {
8
8
  loadConfig
9
9
  } from "./chunk-KGFZYUE2.js";
@@ -19,7 +19,7 @@ import {
19
19
  emptyScanUsage,
20
20
  harnessAdapter,
21
21
  scanUsageTokens
22
- } from "./chunk-OA4EJYZY.js";
22
+ } from "./chunk-OAPWC2T4.js";
23
23
  import {
24
24
  inboxFeature
25
25
  } from "./chunk-PXQTFJ2N.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  OneShotUnavailableError,
3
3
  runOneShotPrompt
4
- } from "./chunk-S6TWGP2S.js";
4
+ } from "./chunk-C56W3PEA.js";
5
5
  import {
6
6
  withSpinner
7
7
  } from "./chunk-OZNYQOQK.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-FPWL4VRC.js";
7
7
  import {
8
8
  harnessAdapter
9
- } from "./chunk-OA4EJYZY.js";
9
+ } from "./chunk-OAPWC2T4.js";
10
10
  import {
11
11
  legacyDefaultHarness
12
12
  } from "./chunk-AWIOBY7Q.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-MELBVXKL.js";
5
5
  import {
6
6
  harnessAdapter
7
- } from "./chunk-OA4EJYZY.js";
7
+ } from "./chunk-OAPWC2T4.js";
8
8
  import {
9
9
  activeHarness
10
10
  } from "./chunk-BFQSGIN6.js";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  decideToolOperations,
3
3
  logPolicyDeny
4
- } from "./chunk-OIEWOLWW.js";
4
+ } from "./chunk-UKXNBLDW.js";
5
5
  import "./chunk-CDU6M5IX.js";
6
6
  import "./chunk-HKGCLAZ7.js";
7
- import "./chunk-GZEEGROK.js";
7
+ import "./chunk-B2URMB3I.js";
8
8
  import "./chunk-VDXS55BC.js";
9
- import "./chunk-VYFXF763.js";
9
+ import "./chunk-RV4NFZZ5.js";
10
10
  import "./chunk-SOLU75ED.js";
11
11
  import {
12
12
  currentExecutionIdentity
13
- } from "./chunk-SYTHN2X3.js";
13
+ } from "./chunk-YRVUUZLX.js";
14
14
  import "./chunk-ZMH7UZNP.js";
15
15
  import "./chunk-FPWL4VRC.js";
16
16
  import "./chunk-C5U44UI7.js";
@@ -26,7 +26,7 @@ import "./chunk-LMUTL44M.js";
26
26
  import "./chunk-6NDXAN45.js";
27
27
  import {
28
28
  claudeAdapter
29
- } from "./chunk-OA4EJYZY.js";
29
+ } from "./chunk-OAPWC2T4.js";
30
30
  import "./chunk-MRUIXQXS.js";
31
31
  import "./chunk-HO7RNI6V.js";
32
32
  import "./chunk-DIAC4XYA.js";
@@ -5,9 +5,9 @@ import {
5
5
  findTruncatedReadDenyRaw,
6
6
  isApprovedRead,
7
7
  splitCompound
8
- } from "./chunk-GZEEGROK.js";
8
+ } from "./chunk-B2URMB3I.js";
9
9
  import "./chunk-VDXS55BC.js";
10
- import "./chunk-OA4EJYZY.js";
10
+ import "./chunk-OAPWC2T4.js";
11
11
  import "./chunk-MRUIXQXS.js";
12
12
  import "./chunk-HO7RNI6V.js";
13
13
  import "./chunk-DIAC4XYA.js";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  decideToolOperations,
3
3
  logPolicyDeny
4
- } from "./chunk-OIEWOLWW.js";
4
+ } from "./chunk-UKXNBLDW.js";
5
5
  import "./chunk-CDU6M5IX.js";
6
6
  import "./chunk-HKGCLAZ7.js";
7
- import "./chunk-GZEEGROK.js";
7
+ import "./chunk-B2URMB3I.js";
8
8
  import "./chunk-VDXS55BC.js";
9
- import "./chunk-VYFXF763.js";
9
+ import "./chunk-RV4NFZZ5.js";
10
10
  import "./chunk-SOLU75ED.js";
11
11
  import {
12
12
  currentExecutionIdentity
13
- } from "./chunk-SYTHN2X3.js";
13
+ } from "./chunk-YRVUUZLX.js";
14
14
  import "./chunk-ZMH7UZNP.js";
15
15
  import {
16
16
  setSessionStatus
@@ -19,7 +19,7 @@ import "./chunk-FPWL4VRC.js";
19
19
  import "./chunk-C5U44UI7.js";
20
20
  import {
21
21
  adviceHookPayload
22
- } from "./chunk-LZY4INWM.js";
22
+ } from "./chunk-SLKU7FHG.js";
23
23
  import "./chunk-P7FVAGFQ.js";
24
24
  import {
25
25
  readStdin
@@ -38,12 +38,12 @@ import "./chunk-3QKE2ONF.js";
38
38
  import "./chunk-O5JIFWMQ.js";
39
39
  import "./chunk-LMUTL44M.js";
40
40
  import "./chunk-6NDXAN45.js";
41
- import "./chunk-ZQQEBC6Y.js";
41
+ import "./chunk-ZNPV7M2Z.js";
42
42
  import "./chunk-MELBVXKL.js";
43
43
  import "./chunk-OGJ6AZK4.js";
44
44
  import {
45
45
  codexAdapter
46
- } from "./chunk-OA4EJYZY.js";
46
+ } from "./chunk-OAPWC2T4.js";
47
47
  import "./chunk-MRUIXQXS.js";
48
48
  import "./chunk-HO7RNI6V.js";
49
49
  import "./chunk-DIAC4XYA.js";