@staff0rd/assist 0.1235.1 → 0.1236.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.
@@ -9,10 +9,10 @@ import {
9
9
  import {
10
10
  buildDoctorProbes,
11
11
  diagnoseLink
12
- } from "./chunk-TRHQNEQT.js";
12
+ } from "./chunk-KUZWX3IV.js";
13
13
  import "./chunk-VABNWHSE.js";
14
14
  import "./chunk-DS2YJZZY.js";
15
- import "./chunk-JBUY6R5D.js";
15
+ import "./chunk-DJTCSNPP.js";
16
16
  import {
17
17
  loadLinkSpecs
18
18
  } from "./chunk-P7QEHVJJ.js";
@@ -30,7 +30,7 @@ import {
30
30
  detectPlatform
31
31
  } from "./chunk-E36L7ASL.js";
32
32
  import "./chunk-GIHVMELY.js";
33
- import "./chunk-D3747GVA.js";
33
+ import "./chunk-Y7L2PJNJ.js";
34
34
  import "./chunk-KRE3QQUK.js";
35
35
  import "./chunk-XNIKOBRH.js";
36
36
  import "./chunk-LU67AKT5.js";
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-TJGF3Z72.js";
18
18
  import {
19
19
  package_default
20
- } from "./chunk-D3747GVA.js";
20
+ } from "./chunk-Y7L2PJNJ.js";
21
21
  import {
22
22
  adviceConfigHelp,
23
23
  askQuestionConfigHelp,
@@ -93,7 +93,7 @@ import { Command } from "commander";
93
93
  // src/commands/registerRootAction.ts
94
94
  function registerRootAction(program) {
95
95
  program.option("--no-open", "Do not open a browser on startup").action(
96
- async (options) => (await import("./web-EJGOFWJJ.js")).web({
96
+ async (options) => (await import("./web-CXI6554D.js")).web({
97
97
  port: "3100",
98
98
  open: options.open
99
99
  })
@@ -646,7 +646,7 @@ function registerShowCommands(cmd) {
646
646
 
647
647
  // src/commands/registerBacklog.ts
648
648
  function registerWebCommand(cmd) {
649
- cmd.command("web").description("Open the backlog tab in the web dashboard").option("-p, --port <number>", "Port to listen on", "3100").option("--no-open", "Do not open a browser on startup").action(lazyAction(() => import("./web-KOTWP7ZI.js"), "web"));
649
+ cmd.command("web").description("Open the backlog tab in the web dashboard").option("-p, --port <number>", "Port to listen on", "3100").option("--no-open", "Do not open a browser on startup").action(lazyAction(() => import("./web-OBG3ZOES.js"), "web"));
650
650
  }
651
651
  var registrars = [
652
652
  registerItemCommands,
@@ -676,7 +676,7 @@ function registerBacklog(program) {
676
676
  const { setBacklogDir } = await import("./getBacklogDir-JSH6CV34.js");
677
677
  setBacklogDir(thisCommand.opts().dir);
678
678
  }).action(
679
- async (options) => (await import("./web-KOTWP7ZI.js")).web({ port: "3100", open: options.open })
679
+ async (options) => (await import("./web-OBG3ZOES.js")).web({ port: "3100", open: options.open })
680
680
  );
681
681
  for (const register of registrars) {
682
682
  register(cmd);
@@ -989,7 +989,7 @@ function registerExtension(program) {
989
989
  ).action(async (options) => {
990
990
  const { extension } = await import("./extension-YYRD5EM6.js");
991
991
  const { printExtensionUrl } = await import("./printExtensionUrl-IW2WTSNS.js");
992
- const { signExtension } = await import("./signExtension-LOWAW5KG.js");
992
+ const { signExtension } = await import("./signExtension-5WN6RZR6.js");
993
993
  if (options.url) return printExtensionUrl();
994
994
  return options.sign ? signExtension() : extension();
995
995
  });
@@ -2702,7 +2702,7 @@ function registerDaemon(program) {
2702
2702
  const cmd = program.command("daemon").description("Long-lived daemon that owns web session PTYs");
2703
2703
  cmd.command("run").description(
2704
2704
  "Run the sessions daemon in the foreground (auto-spawned by assist sessions)"
2705
- ).action(lazyAction(() => import("./runDaemon-D6HPPD64.js"), "runDaemon"));
2705
+ ).action(lazyAction(() => import("./runDaemon-KTY6AOEM.js"), "runDaemon"));
2706
2706
  cmd.command("status").description(
2707
2707
  "Show sessions daemon status, live sessions, and any stray daemon processes"
2708
2708
  ).action(lazyAction(() => import("./daemonStatus-EAZHBC6O.js"), "daemonStatus"));
@@ -2726,7 +2726,7 @@ function registerDiagnoseCommands(nodes, calledBy5) {
2726
2726
  nodes.command("doctor [name]").description(
2727
2727
  "Probe each hop of every link (or one) in order and stop at the first failure with a remediation"
2728
2728
  ).option("--json", "Output as JSON").action(
2729
- async (name, _options, command) => (await import("./doctorNodes-UIR7PGOH.js")).doctorNodes(
2729
+ async (name, _options, command) => (await import("./doctorNodes-PZWQTZBI.js")).doctorNodes(
2730
2730
  name,
2731
2731
  command.optsWithGlobals()
2732
2732
  )
@@ -2756,14 +2756,14 @@ function registerPeerActionCommands(nodes, calledBy5) {
2756
2756
  internalCommand(
2757
2757
  nodes.command("restart <name>").description(
2758
2758
  "Restart a linked node's daemon and/or web server, wait for its link to reconnect and print its version"
2759
- ).option("--target <target>", "daemon, webserver or both", "both").action(lazyAction(() => import("./restartNode-SXTLTG2P.js"), "restartNode")),
2759
+ ).option("--target <target>", "daemon, webserver or both", "both").action(lazyAction(() => import("./restartNode-GFSVGKXL.js"), "restartNode")),
2760
2760
  calledBy5
2761
2761
  );
2762
2762
  internalCommand(
2763
2763
  nodes.command("update <name>").description(
2764
2764
  "Run assist update on a linked node, restart it, wait for its link to reconnect and print its version"
2765
2765
  ).action(
2766
- async (name) => (await import("./updateNode-BAYU4TP7.js")).updateNode(name)
2766
+ async (name) => (await import("./updateNode-XXIRP3EW.js")).updateNode(name)
2767
2767
  ),
2768
2768
  calledBy5
2769
2769
  );
@@ -2826,7 +2826,7 @@ function registerSetStatusCommand(cmd) {
2826
2826
  // src/commands/sessions/registerSessionsWeb.ts
2827
2827
  function registerSessionsWeb(cmd) {
2828
2828
  const webCmd = cmd.command("web").description("Start the sessions web dashboard").option("-p, --port <number>", "Port to listen on", "3100").option("--no-open", "Do not open a browser on startup").action(
2829
- async (options, command) => (await import("./web-EJGOFWJJ.js")).web({
2829
+ async (options, command) => (await import("./web-CXI6554D.js")).web({
2830
2830
  ...options,
2831
2831
  open: command.optsWithGlobals().open
2832
2832
  })
@@ -2841,7 +2841,7 @@ function registerSessionsWeb(cmd) {
2841
2841
  // src/commands/sessions/registerSessions.ts
2842
2842
  function registerSessions(program) {
2843
2843
  const cmd = program.command("sessions").description("Web dashboard for coding agent sessions").option("--no-open", "Do not open a browser on startup").action(
2844
- async (_options, command) => (await import("./web-EJGOFWJJ.js")).web({
2844
+ async (_options, command) => (await import("./web-CXI6554D.js")).web({
2845
2845
  port: "3100",
2846
2846
  open: command.optsWithGlobals().open
2847
2847
  })
@@ -2,20 +2,20 @@ import {
2
2
  linkStatus,
3
3
  postToPeer,
4
4
  startPeerAction
5
- } from "./chunk-OOW2LC5L.js";
6
- import "./chunk-AOQYWKME.js";
7
- import "./chunk-TRHQNEQT.js";
5
+ } from "./chunk-J7NFVIBA.js";
6
+ import "./chunk-TNWEEOHW.js";
7
+ import "./chunk-KUZWX3IV.js";
8
8
  import "./chunk-VABNWHSE.js";
9
9
  import "./chunk-DS2YJZZY.js";
10
10
  import "./chunk-4HKB2TAG.js";
11
- import "./chunk-JBUY6R5D.js";
11
+ import "./chunk-DJTCSNPP.js";
12
12
  import "./chunk-P7QEHVJJ.js";
13
13
  import "./chunk-MKBZCWWG.js";
14
14
  import "./chunk-B7VOTF5Q.js";
15
15
  import "./chunk-E36L7ASL.js";
16
16
  import "./chunk-5H7EHZ3J.js";
17
17
  import "./chunk-GIHVMELY.js";
18
- import "./chunk-D3747GVA.js";
18
+ import "./chunk-Y7L2PJNJ.js";
19
19
  import "./chunk-XNIKOBRH.js";
20
20
  import "./chunk-LU67AKT5.js";
21
21
  import "./chunk-GRXFWFGP.js";
@@ -131,7 +131,7 @@ import {
131
131
  isHello,
132
132
  linkVersionCheck,
133
133
  negotiateProtocol
134
- } from "./chunk-JBUY6R5D.js";
134
+ } from "./chunk-DJTCSNPP.js";
135
135
  import {
136
136
  loadLinkSpecs
137
137
  } from "./chunk-P7QEHVJJ.js";
@@ -274,7 +274,7 @@ import {
274
274
  import "./chunk-APZ6ZTDA.js";
275
275
  import "./chunk-K4DJEFDZ.js";
276
276
  import "./chunk-D7UZLH36.js";
277
- import "./chunk-D3747GVA.js";
277
+ import "./chunk-Y7L2PJNJ.js";
278
278
  import "./chunk-EW2ZM2PC.js";
279
279
  import "./chunk-OTSOBFW2.js";
280
280
  import {
@@ -1089,7 +1089,8 @@ function toSessionViewInfo({
1089
1089
  sdkBackgroundTasks,
1090
1090
  sdkPromptSuggestion,
1091
1091
  sdkInterrupting,
1092
- sdkResuming
1092
+ sdkResuming,
1093
+ sdkWorkflow
1093
1094
  }) {
1094
1095
  return {
1095
1096
  sdk: pty?.sdk || !pty && pendingStart && drivenStart ? true : void 0,
@@ -1103,6 +1104,7 @@ function toSessionViewInfo({
1103
1104
  sdkPromptSuggestion,
1104
1105
  sdkInterrupting,
1105
1106
  sdkResuming,
1107
+ sdkWorkflow,
1106
1108
  transfer,
1107
1109
  lastUserMessage,
1108
1110
  lastAssistantMessage,
@@ -1457,25 +1459,95 @@ function createSdkRelay(label, backgroundTasks) {
1457
1459
  if (idle) emit({ kind: "status", status: "waiting" });
1458
1460
  }
1459
1461
  };
1460
- return { handle, current: () => current };
1462
+ return { handle, emit, current: () => current };
1461
1463
  }
1462
1464
 
1463
1465
  // src/commands/sessions/daemon/sdk/pipeWorkflowOutput.ts
1464
1466
  var MAX_LOG_LINE = 300;
1465
1467
  function pipeWorkflowOutput(child, label, onData) {
1466
- for (const stream of [child.stdout, child.stderr]) {
1467
- stream?.setEncoding("utf8");
1468
- stream?.on("data", (chunk) => {
1468
+ for (const stream of ["stdout", "stderr"]) {
1469
+ child[stream]?.setEncoding("utf8");
1470
+ child[stream]?.on("data", (chunk) => {
1469
1471
  for (const line of chunk.split("\n")) {
1470
1472
  const trimmed = line.trim();
1471
1473
  if (trimmed)
1472
1474
  daemonLog(`${label} workflow: ${trimmed.slice(0, MAX_LOG_LINE)}`);
1473
1475
  }
1474
- onData(chunk.replaceAll("\n", "\r\n"));
1476
+ onData(chunk, stream);
1475
1477
  });
1476
1478
  }
1477
1479
  }
1478
1480
 
1481
+ // src/commands/sessions/daemon/shell/throttleNotify.ts
1482
+ var INTERVAL_MS = 150;
1483
+ function throttleNotify(notify) {
1484
+ let timer;
1485
+ const fire = () => {
1486
+ timer = void 0;
1487
+ notify();
1488
+ };
1489
+ const update2 = () => {
1490
+ timer ??= setTimeout(fire, INTERVAL_MS);
1491
+ };
1492
+ update2.cancel = () => {
1493
+ if (timer) clearTimeout(timer);
1494
+ timer = void 0;
1495
+ };
1496
+ return update2;
1497
+ }
1498
+
1499
+ // src/commands/sessions/daemon/sdk/createWorkflowOutputBuffer.ts
1500
+ var MAX_LINES = 300;
1501
+ function createWorkflowOutputBuffer(maxLines = MAX_LINES) {
1502
+ const lines = [];
1503
+ const open = {};
1504
+ const dropOldest = () => {
1505
+ const dropped = lines.shift();
1506
+ for (const stream of ["stdout", "stderr"])
1507
+ if (open[stream] === dropped) open[stream] = void 0;
1508
+ };
1509
+ return {
1510
+ append(stream, chunk) {
1511
+ const parts = stripAnsi(chunk).replaceAll("\r", "").split("\n");
1512
+ parts.forEach((part, i) => {
1513
+ const last = i === parts.length - 1;
1514
+ let line = i === 0 ? open[stream] : void 0;
1515
+ if (line) line.text += part;
1516
+ else if (!last || part) {
1517
+ line = { stream, text: part };
1518
+ lines.push(line);
1519
+ }
1520
+ open[stream] = last ? line : void 0;
1521
+ });
1522
+ while (lines.length > maxLines) dropOldest();
1523
+ },
1524
+ lines: () => lines.map((line) => ({ ...line }))
1525
+ };
1526
+ }
1527
+
1528
+ // src/commands/sessions/daemon/sdk/publishWorkflowOutput.ts
1529
+ function publishWorkflowOutput(command, emit) {
1530
+ const buffer = createWorkflowOutputBuffer();
1531
+ const startedAt = Date.now();
1532
+ const update2 = throttleNotify(
1533
+ () => emit({
1534
+ kind: "workflow",
1535
+ workflow: { command, startedAt, lines: buffer.lines() }
1536
+ })
1537
+ );
1538
+ update2();
1539
+ return {
1540
+ append: (stream, data) => {
1541
+ buffer.append(stream, data);
1542
+ update2();
1543
+ },
1544
+ end: () => {
1545
+ update2.cancel();
1546
+ emit({ kind: "workflow", workflow: null });
1547
+ }
1548
+ };
1549
+ }
1550
+
1479
1551
  // src/commands/sessions/daemon/sdk/startWorkflowChild.ts
1480
1552
  import { spawn } from "child_process";
1481
1553
  function startWorkflowChild(args, cwd, sessionId, extraEnv) {
@@ -1534,9 +1606,12 @@ function spawnSdkWorkflow(harness, args, cwd, sessionId, extraEnv) {
1534
1606
  label,
1535
1607
  harnessCapability(harness, "tasks.background").supported
1536
1608
  );
1609
+ const output = publishWorkflowOutput(args.join(" "), relay.emit);
1537
1610
  const dataListeners = [];
1538
- pipeWorkflowOutput(child, label, (data) => {
1539
- for (const listener of dataListeners) listener(data);
1611
+ pipeWorkflowOutput(child, label, (data, stream) => {
1612
+ output.append(stream, data);
1613
+ const terminal = data.replaceAll("\n", "\r\n");
1614
+ for (const listener of dataListeners) listener(terminal);
1540
1615
  });
1541
1616
  return {
1542
1617
  get pid() {
@@ -1547,7 +1622,10 @@ function spawnSdkWorkflow(harness, args, cwd, sessionId, extraEnv) {
1547
1622
  dataListeners.push(listener);
1548
1623
  return noopDisposable;
1549
1624
  },
1550
- onExit: trackWorkflowExit(child, label, () => relay.current()?.kill()),
1625
+ onExit: trackWorkflowExit(child, label, () => {
1626
+ output.end();
1627
+ relay.current()?.kill();
1628
+ }),
1551
1629
  kill: () => {
1552
1630
  daemonLog(
1553
1631
  `${label} sdk workflow ended by kill (pid ${child.pid ?? "none"})`
@@ -2037,6 +2115,8 @@ function applySdkViewEvent(session, event) {
2037
2115
  applySdkQueued(session, event);
2038
2116
  } else if (event.kind === "pending" || event.kind === "background") {
2039
2117
  applySdkTaskList(session, event);
2118
+ } else if (event.kind === "workflow") {
2119
+ session.sdkWorkflow = event.workflow ?? void 0;
2040
2120
  } else if (event.kind === "suggestion") {
2041
2121
  session.sdkPromptSuggestion = event.text ?? void 0;
2042
2122
  } else if (event.kind === "resumed") {
@@ -9536,24 +9616,6 @@ function finishShellRow(row, label, exitCode, reason6) {
9536
9616
  return true;
9537
9617
  }
9538
9618
 
9539
- // src/commands/sessions/daemon/shell/throttleNotify.ts
9540
- var INTERVAL_MS = 150;
9541
- function throttleNotify(notify) {
9542
- let timer;
9543
- const fire = () => {
9544
- timer = void 0;
9545
- notify();
9546
- };
9547
- const update2 = () => {
9548
- timer ??= setTimeout(fire, INTERVAL_MS);
9549
- };
9550
- update2.cancel = () => {
9551
- if (timer) clearTimeout(timer);
9552
- timer = void 0;
9553
- };
9554
- return update2;
9555
- }
9556
-
9557
9619
  // src/commands/sessions/daemon/shell/watchShellChild.ts
9558
9620
  function watchShellChild(child, row, label, notify) {
9559
9621
  const update2 = throttleNotify(notify);
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-W7TRZLEM.js";
10
10
  import {
11
11
  package_default
12
- } from "./chunk-D3747GVA.js";
12
+ } from "./chunk-Y7L2PJNJ.js";
13
13
 
14
14
  // src/commands/extension/signExtension.ts
15
15
  import { rm as rm2 } from "fs/promises";
@@ -2,13 +2,13 @@ import {
2
2
  linkStatus,
3
3
  postToPeer,
4
4
  startPeerAction
5
- } from "./chunk-OOW2LC5L.js";
6
- import "./chunk-AOQYWKME.js";
7
- import "./chunk-TRHQNEQT.js";
5
+ } from "./chunk-J7NFVIBA.js";
6
+ import "./chunk-TNWEEOHW.js";
7
+ import "./chunk-KUZWX3IV.js";
8
8
  import "./chunk-VABNWHSE.js";
9
9
  import "./chunk-DS2YJZZY.js";
10
10
  import "./chunk-4HKB2TAG.js";
11
- import "./chunk-JBUY6R5D.js";
11
+ import "./chunk-DJTCSNPP.js";
12
12
  import "./chunk-P7QEHVJJ.js";
13
13
  import "./chunk-MKBZCWWG.js";
14
14
  import "./chunk-B7VOTF5Q.js";
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-A7ONLVZD.js";
20
20
  import "./chunk-GIHVMELY.js";
21
21
  import "./chunk-2EW62DM5.js";
22
- import "./chunk-D3747GVA.js";
22
+ import "./chunk-Y7L2PJNJ.js";
23
23
  import "./chunk-XNIKOBRH.js";
24
24
  import "./chunk-LU67AKT5.js";
25
25
  import "./chunk-GRXFWFGP.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  web
3
- } from "./chunk-VSRIIV6H.js";
3
+ } from "./chunk-7RMOSAMH.js";
4
4
  import "./chunk-SURCYYQ6.js";
5
5
  import "./chunk-JNCFHWBK.js";
6
6
  import "./chunk-JM57BCD6.js";
7
- import "./chunk-AOQYWKME.js";
8
- import "./chunk-TRHQNEQT.js";
7
+ import "./chunk-TNWEEOHW.js";
8
+ import "./chunk-KUZWX3IV.js";
9
9
  import "./chunk-VABNWHSE.js";
10
10
  import "./chunk-DS2YJZZY.js";
11
11
  import "./chunk-6Y6FYABI.js";
12
12
  import "./chunk-3ZHTSOYH.js";
13
13
  import "./chunk-4HKB2TAG.js";
14
- import "./chunk-JBUY6R5D.js";
14
+ import "./chunk-DJTCSNPP.js";
15
15
  import "./chunk-P7QEHVJJ.js";
16
16
  import "./chunk-MKBZCWWG.js";
17
17
  import "./chunk-B7VOTF5Q.js";
@@ -140,7 +140,7 @@ import "./chunk-E577GGQS.js";
140
140
  import "./chunk-APZ6ZTDA.js";
141
141
  import "./chunk-K4DJEFDZ.js";
142
142
  import "./chunk-D7UZLH36.js";
143
- import "./chunk-D3747GVA.js";
143
+ import "./chunk-Y7L2PJNJ.js";
144
144
  import "./chunk-LPJWLKEX.js";
145
145
  import "./chunk-YVL3NXEB.js";
146
146
  import "./chunk-UEWARAPX.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  web
3
- } from "./chunk-VSRIIV6H.js";
3
+ } from "./chunk-7RMOSAMH.js";
4
4
  import "./chunk-SURCYYQ6.js";
5
5
  import "./chunk-JNCFHWBK.js";
6
6
  import "./chunk-JM57BCD6.js";
7
- import "./chunk-AOQYWKME.js";
8
- import "./chunk-TRHQNEQT.js";
7
+ import "./chunk-TNWEEOHW.js";
8
+ import "./chunk-KUZWX3IV.js";
9
9
  import "./chunk-VABNWHSE.js";
10
10
  import "./chunk-DS2YJZZY.js";
11
11
  import "./chunk-6Y6FYABI.js";
12
12
  import "./chunk-3ZHTSOYH.js";
13
13
  import "./chunk-4HKB2TAG.js";
14
- import "./chunk-JBUY6R5D.js";
14
+ import "./chunk-DJTCSNPP.js";
15
15
  import "./chunk-P7QEHVJJ.js";
16
16
  import "./chunk-MKBZCWWG.js";
17
17
  import "./chunk-B7VOTF5Q.js";
@@ -140,7 +140,7 @@ import "./chunk-E577GGQS.js";
140
140
  import "./chunk-APZ6ZTDA.js";
141
141
  import "./chunk-K4DJEFDZ.js";
142
142
  import "./chunk-D7UZLH36.js";
143
- import "./chunk-D3747GVA.js";
143
+ import "./chunk-Y7L2PJNJ.js";
144
144
  import "./chunk-LPJWLKEX.js";
145
145
  import "./chunk-YVL3NXEB.js";
146
146
  import "./chunk-UEWARAPX.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.1235.1",
3
+ "version": "0.1236.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {