@staff0rd/assist 0.1192.0 → 0.1193.1

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-HJEAZ3KR.js";
12
+ } from "./chunk-6COH5ABO.js";
13
13
  import "./chunk-VABNWHSE.js";
14
14
  import "./chunk-DS2YJZZY.js";
15
- import "./chunk-EAU7KEML.js";
15
+ import "./chunk-PJ5OHMV7.js";
16
16
  import {
17
17
  loadLinkSpecs
18
18
  } from "./chunk-J2PPCMCR.js";
@@ -30,7 +30,7 @@ import {
30
30
  detectPlatform
31
31
  } from "./chunk-E36L7ASL.js";
32
32
  import "./chunk-GIHVMELY.js";
33
- import "./chunk-IQX2FYLR.js";
33
+ import "./chunk-GJQJNIU2.js";
34
34
  import "./chunk-5QM5VR3J.js";
35
35
  import "./chunk-UFSOFNXQ.js";
36
36
  import "./chunk-FLDRXYEM.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-IQX2FYLR.js";
20
+ } from "./chunk-GJQJNIU2.js";
21
21
  import {
22
22
  adviceConfigHelp,
23
23
  askQuestionConfigHelp,
@@ -92,7 +92,7 @@ import { Command } from "commander";
92
92
  // src/commands/registerRootAction.ts
93
93
  function registerRootAction(program) {
94
94
  program.option("--no-open", "Do not open a browser on startup").action(
95
- async (options) => (await import("./web-LKGEJHH6.js")).web({
95
+ async (options) => (await import("./web-W3LU6TR2.js")).web({
96
96
  port: "3100",
97
97
  open: options.open
98
98
  })
@@ -645,7 +645,7 @@ function registerShowCommands(cmd) {
645
645
 
646
646
  // src/commands/registerBacklog.ts
647
647
  function registerWebCommand(cmd) {
648
- 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-5IAHP22R.js"), "web"));
648
+ 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-7WLADTOI.js"), "web"));
649
649
  }
650
650
  var registrars = [
651
651
  registerItemCommands,
@@ -675,7 +675,7 @@ function registerBacklog(program) {
675
675
  const { setBacklogDir } = await import("./getBacklogDir-FJLWXTYN.js");
676
676
  setBacklogDir(thisCommand.opts().dir);
677
677
  }).action(
678
- async (options) => (await import("./web-5IAHP22R.js")).web({ port: "3100", open: options.open })
678
+ async (options) => (await import("./web-7WLADTOI.js")).web({ port: "3100", open: options.open })
679
679
  );
680
680
  for (const register of registrars) {
681
681
  register(cmd);
@@ -988,7 +988,7 @@ function registerExtension(program) {
988
988
  ).action(async (options) => {
989
989
  const { extension } = await import("./extension-YYRD5EM6.js");
990
990
  const { printExtensionUrl } = await import("./printExtensionUrl-IW2WTSNS.js");
991
- const { signExtension } = await import("./signExtension-NTY5YX7Q.js");
991
+ const { signExtension } = await import("./signExtension-L6WJJHKE.js");
992
992
  if (options.url) return printExtensionUrl();
993
993
  return options.sign ? signExtension() : extension();
994
994
  });
@@ -2678,7 +2678,7 @@ function registerDaemon(program) {
2678
2678
  const cmd = program.command("daemon").description("Long-lived daemon that owns web session PTYs");
2679
2679
  cmd.command("run").description(
2680
2680
  "Run the sessions daemon in the foreground (auto-spawned by assist sessions)"
2681
- ).action(lazyAction(() => import("./runDaemon-AFXAY65K.js"), "runDaemon"));
2681
+ ).action(lazyAction(() => import("./runDaemon-4UTNAAVN.js"), "runDaemon"));
2682
2682
  cmd.command("status").description(
2683
2683
  "Show sessions daemon status, live sessions, and any stray daemon processes"
2684
2684
  ).action(lazyAction(() => import("./daemonStatus-EAZHBC6O.js"), "daemonStatus"));
@@ -2702,7 +2702,7 @@ function registerDiagnoseCommands(nodes, calledBy5) {
2702
2702
  nodes.command("doctor [name]").description(
2703
2703
  "Probe each hop of every link (or one) in order and stop at the first failure with a remediation"
2704
2704
  ).option("--json", "Output as JSON").action(
2705
- async (name, _options, command) => (await import("./doctorNodes-YSRBKZ4Q.js")).doctorNodes(
2705
+ async (name, _options, command) => (await import("./doctorNodes-DWOZCSBP.js")).doctorNodes(
2706
2706
  name,
2707
2707
  command.optsWithGlobals()
2708
2708
  )
@@ -2732,14 +2732,14 @@ function registerPeerActionCommands(nodes, calledBy5) {
2732
2732
  internalCommand(
2733
2733
  nodes.command("restart <name>").description(
2734
2734
  "Restart a linked node's daemon and/or web server, wait for its link to reconnect and print its version"
2735
- ).option("--target <target>", "daemon, webserver or both", "both").action(lazyAction(() => import("./restartNode-JC4BXY3R.js"), "restartNode")),
2735
+ ).option("--target <target>", "daemon, webserver or both", "both").action(lazyAction(() => import("./restartNode-L4Q6QYLO.js"), "restartNode")),
2736
2736
  calledBy5
2737
2737
  );
2738
2738
  internalCommand(
2739
2739
  nodes.command("update <name>").description(
2740
2740
  "Run assist update on a linked node, restart it, wait for its link to reconnect and print its version"
2741
2741
  ).action(
2742
- async (name) => (await import("./updateNode-FNYOYCXO.js")).updateNode(name)
2742
+ async (name) => (await import("./updateNode-XZQDR7DQ.js")).updateNode(name)
2743
2743
  ),
2744
2744
  calledBy5
2745
2745
  );
@@ -2802,7 +2802,7 @@ function registerSetStatusCommand(cmd) {
2802
2802
  // src/commands/sessions/registerSessionsWeb.ts
2803
2803
  function registerSessionsWeb(cmd) {
2804
2804
  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(
2805
- async (options, command) => (await import("./web-LKGEJHH6.js")).web({
2805
+ async (options, command) => (await import("./web-W3LU6TR2.js")).web({
2806
2806
  ...options,
2807
2807
  open: command.optsWithGlobals().open
2808
2808
  })
@@ -2817,7 +2817,7 @@ function registerSessionsWeb(cmd) {
2817
2817
  // src/commands/sessions/registerSessions.ts
2818
2818
  function registerSessions(program) {
2819
2819
  const cmd = program.command("sessions").description("Web dashboard for coding agent sessions").option("--no-open", "Do not open a browser on startup").action(
2820
- async (_options, command) => (await import("./web-LKGEJHH6.js")).web({
2820
+ async (_options, command) => (await import("./web-W3LU6TR2.js")).web({
2821
2821
  port: "3100",
2822
2822
  open: command.optsWithGlobals().open
2823
2823
  })
@@ -2,20 +2,20 @@ import {
2
2
  linkStatus,
3
3
  postToPeer,
4
4
  startPeerAction
5
- } from "./chunk-YAKOUVUO.js";
6
- import "./chunk-YQBVMQZF.js";
7
- import "./chunk-HJEAZ3KR.js";
5
+ } from "./chunk-XETAE4DJ.js";
6
+ import "./chunk-JEVN7QFC.js";
7
+ import "./chunk-6COH5ABO.js";
8
8
  import "./chunk-VABNWHSE.js";
9
9
  import "./chunk-DS2YJZZY.js";
10
10
  import "./chunk-4HKB2TAG.js";
11
- import "./chunk-EAU7KEML.js";
11
+ import "./chunk-PJ5OHMV7.js";
12
12
  import "./chunk-J2PPCMCR.js";
13
13
  import "./chunk-5CNDLMYO.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-IQX2FYLR.js";
18
+ import "./chunk-GJQJNIU2.js";
19
19
  import "./chunk-UFSOFNXQ.js";
20
20
  import "./chunk-FLDRXYEM.js";
21
21
  import "./chunk-GRXFWFGP.js";
@@ -128,7 +128,7 @@ import {
128
128
  isHello,
129
129
  linkVersionCheck,
130
130
  negotiateProtocol
131
- } from "./chunk-EAU7KEML.js";
131
+ } from "./chunk-PJ5OHMV7.js";
132
132
  import {
133
133
  loadLinkSpecs
134
134
  } from "./chunk-J2PPCMCR.js";
@@ -267,7 +267,7 @@ import {
267
267
  import "./chunk-APZ6ZTDA.js";
268
268
  import "./chunk-ZRIBI33P.js";
269
269
  import "./chunk-D7UZLH36.js";
270
- import "./chunk-IQX2FYLR.js";
270
+ import "./chunk-GJQJNIU2.js";
271
271
  import "./chunk-EW2ZM2PC.js";
272
272
  import "./chunk-MYH4MQX2.js";
273
273
  import {
@@ -5556,13 +5556,13 @@ function refuse(client, id, message) {
5556
5556
  daemonLog(`session ${id} transfer refused: ${message}`);
5557
5557
  sendTo(client, { type: "error", message: `Transfer refused: ${message}` });
5558
5558
  }
5559
- async function transferSession(client, deps, { sessionId: id, target, cwd }) {
5559
+ async function transferSession(client, deps, { sessionId: id, target, cwd, phaseEnded }) {
5560
5560
  const s = deps.session(id);
5561
5561
  const refused = transferRefusal(s, target, deps.links);
5562
5562
  const args = s && backlogRunArgs(s);
5563
5563
  if (refused || !s || !args)
5564
5564
  return refuse(client, id, refused ?? "unknown session");
5565
- if (s.status === "running")
5565
+ if (s.status === "running" && !phaseEnded)
5566
5566
  return queueTransfer(client, deps.notify, s, target, cwd);
5567
5567
  const traceId = newTraceId();
5568
5568
  daemonLog(
@@ -5586,18 +5586,20 @@ async function transferSession(client, deps, { sessionId: id, target, cwd }) {
5586
5586
  }
5587
5587
 
5588
5588
  // src/commands/sessions/daemon/transfer/runQueuedTransfer.ts
5589
- function runQueuedTransfer(client, deps, s) {
5589
+ function runQueuedTransfer(client, deps, s, phaseEnded = false) {
5590
5590
  const queued = s.transfer?.queued;
5591
- if (!s.transfer || !queued || s.status === "running") return void 0;
5591
+ if (!s.transfer || !queued || s.status === "running" && !phaseEnded)
5592
+ return void 0;
5592
5593
  const { target } = s.transfer;
5593
5594
  daemonLog(
5594
- `session ${s.id} went ${s.status}; running queued transfer to ${target}`
5595
+ `session ${s.id} ${phaseEnded ? "workflow phase ended" : `went ${s.status}`}; running queued transfer to ${target}`
5595
5596
  );
5596
5597
  s.transfer = void 0;
5597
5598
  return transferSession(client, deps, {
5598
5599
  sessionId: s.id,
5599
5600
  target,
5600
- cwd: queued.cwd
5601
+ cwd: queued.cwd,
5602
+ phaseEnded
5601
5603
  });
5602
5604
  }
5603
5605
 
@@ -5619,7 +5621,7 @@ function queuedTransferTrigger(host) {
5619
5621
  for (const viewer of host.clients.viewers()) viewer.send(raw);
5620
5622
  }
5621
5623
  };
5622
- return (s) => void runQueuedTransfer(viewers, transferDepsFor(host), s);
5624
+ return (s, phaseEnded) => runQueuedTransfer(viewers, transferDepsFor(host), s, phaseEnded);
5623
5625
  }
5624
5626
 
5625
5627
  // src/commands/sessions/daemon/makeManagerStatusHandler.ts
@@ -5630,7 +5632,7 @@ function makeManagerStatusHandler(sessions, host) {
5630
5632
  notify: () => host.update(() => true),
5631
5633
  idle: (session) => {
5632
5634
  flushDeferredResults(session, host);
5633
- transfer(session);
5635
+ void transfer(session);
5634
5636
  }
5635
5637
  });
5636
5638
  }
@@ -8973,6 +8975,18 @@ var handleInterrupt = routedSdk("interrupt", (sdk, id) => {
8973
8975
  sdk.interrupt();
8974
8976
  });
8975
8977
 
8978
+ // src/commands/sessions/daemon/transfer/runPhaseBoundaryTransfer.ts
8979
+ var pendingTransfers = /* @__PURE__ */ new Map();
8980
+ function phaseLaunchHold(sessionId) {
8981
+ return pendingTransfers.get(sessionId);
8982
+ }
8983
+ function runPhaseBoundaryTransfer(host, s) {
8984
+ const run2 = queuedTransferTrigger(host)(s, true);
8985
+ if (!run2) return;
8986
+ const settled = run2.finally(() => pendingTransfers.delete(s.id));
8987
+ pendingTransfers.set(s.id, settled);
8988
+ }
8989
+
8976
8990
  // src/shared/harnessAdapters/drivenSessionFor.ts
8977
8991
  function drivenSessionFor(kind) {
8978
8992
  if (!harnessCapability(kind, "session.driven").supported) return void 0;
@@ -8990,13 +9004,14 @@ function drivenLaunchTarget(value) {
8990
9004
  }
8991
9005
 
8992
9006
  // src/commands/sessions/daemon/sdk/linkWorkflowQuery.ts
8993
- function linkWorkflowQuery(client, sessionId, query) {
9007
+ function linkWorkflowQuery(client, sessionId, query, onEnded) {
8994
9008
  let ended = false;
8995
9009
  query.onExit(({ exitCode }) => {
8996
9010
  ended = true;
8997
9011
  daemonLog(
8998
9012
  `session ${sessionId} sdk workflow query ended: exit ${exitCode}`
8999
9013
  );
9014
+ onEnded();
9000
9015
  sendTo(client, { type: "sdk-exit", sessionId, exitCode });
9001
9016
  });
9002
9017
  client.onClose?.(() => {
@@ -9038,10 +9053,9 @@ function sdkLaunchOpts(d, sessionId) {
9038
9053
  };
9039
9054
  }
9040
9055
 
9041
- // src/commands/sessions/daemon/sdk/handleSdkLaunch.ts
9042
- var handleSdkLaunch = (client, m, d) => {
9056
+ // src/commands/sessions/daemon/sdk/launchSdkPhase.ts
9057
+ function launchSdkPhase(client, m, d) {
9043
9058
  const sessionId = String(d.sessionId);
9044
- m.clients.delete(client);
9045
9059
  const { harness, label, drivenSession } = drivenLaunchTarget(d.harness);
9046
9060
  const refuse2 = (reason6) => refuseSdkLaunch(client, sessionId, label, reason6);
9047
9061
  if (!drivenSession)
@@ -9065,7 +9079,21 @@ var handleSdkLaunch = (client, m, d) => {
9065
9079
  return refuse2(error instanceof Error ? error.message : String(error));
9066
9080
  }
9067
9081
  attach(query, !opts.prompt);
9068
- linkWorkflowQuery(client, sessionId, query);
9082
+ linkWorkflowQuery(client, sessionId, query, () => {
9083
+ const s = m.session(sessionId);
9084
+ if (s) runPhaseBoundaryTransfer(m, s);
9085
+ });
9086
+ }
9087
+
9088
+ // src/commands/sessions/daemon/sdk/handleSdkLaunch.ts
9089
+ var handleSdkLaunch = (client, m, d) => {
9090
+ m.clients.delete(client);
9091
+ const hold = phaseLaunchHold(String(d.sessionId));
9092
+ if (!hold) return launchSdkPhase(client, m, d);
9093
+ daemonLog(
9094
+ `session ${String(d.sessionId)} sdk-launch held: transfer in progress`
9095
+ );
9096
+ void hold.then(() => launchSdkPhase(client, m, d));
9069
9097
  };
9070
9098
 
9071
9099
  // src/commands/sessions/daemon/shell/runSdkShell.ts
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-W7TRZLEM.js";
10
10
  import {
11
11
  package_default
12
- } from "./chunk-IQX2FYLR.js";
12
+ } from "./chunk-GJQJNIU2.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-YAKOUVUO.js";
6
- import "./chunk-YQBVMQZF.js";
7
- import "./chunk-HJEAZ3KR.js";
5
+ } from "./chunk-XETAE4DJ.js";
6
+ import "./chunk-JEVN7QFC.js";
7
+ import "./chunk-6COH5ABO.js";
8
8
  import "./chunk-VABNWHSE.js";
9
9
  import "./chunk-DS2YJZZY.js";
10
10
  import "./chunk-4HKB2TAG.js";
11
- import "./chunk-EAU7KEML.js";
11
+ import "./chunk-PJ5OHMV7.js";
12
12
  import "./chunk-J2PPCMCR.js";
13
13
  import "./chunk-5CNDLMYO.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-IQX2FYLR.js";
22
+ import "./chunk-GJQJNIU2.js";
23
23
  import "./chunk-UFSOFNXQ.js";
24
24
  import "./chunk-FLDRXYEM.js";
25
25
  import "./chunk-GRXFWFGP.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  web
3
- } from "./chunk-6YB4XBY3.js";
3
+ } from "./chunk-FTVEHGHR.js";
4
4
  import "./chunk-SURCYYQ6.js";
5
5
  import "./chunk-JNCFHWBK.js";
6
6
  import "./chunk-JM57BCD6.js";
7
- import "./chunk-YQBVMQZF.js";
8
- import "./chunk-HJEAZ3KR.js";
7
+ import "./chunk-JEVN7QFC.js";
8
+ import "./chunk-6COH5ABO.js";
9
9
  import "./chunk-VABNWHSE.js";
10
10
  import "./chunk-DS2YJZZY.js";
11
11
  import "./chunk-2RUGZQUD.js";
12
12
  import "./chunk-5QXAQCAJ.js";
13
13
  import "./chunk-4HKB2TAG.js";
14
- import "./chunk-EAU7KEML.js";
14
+ import "./chunk-PJ5OHMV7.js";
15
15
  import "./chunk-J2PPCMCR.js";
16
16
  import "./chunk-5CNDLMYO.js";
17
17
  import "./chunk-B7VOTF5Q.js";
@@ -138,7 +138,7 @@ import "./chunk-RW6YKTIM.js";
138
138
  import "./chunk-APZ6ZTDA.js";
139
139
  import "./chunk-ZRIBI33P.js";
140
140
  import "./chunk-D7UZLH36.js";
141
- import "./chunk-IQX2FYLR.js";
141
+ import "./chunk-GJQJNIU2.js";
142
142
  import "./chunk-YUV5QBHU.js";
143
143
  import "./chunk-YVL3NXEB.js";
144
144
  import "./chunk-UEWARAPX.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  web
3
- } from "./chunk-6YB4XBY3.js";
3
+ } from "./chunk-FTVEHGHR.js";
4
4
  import "./chunk-SURCYYQ6.js";
5
5
  import "./chunk-JNCFHWBK.js";
6
6
  import "./chunk-JM57BCD6.js";
7
- import "./chunk-YQBVMQZF.js";
8
- import "./chunk-HJEAZ3KR.js";
7
+ import "./chunk-JEVN7QFC.js";
8
+ import "./chunk-6COH5ABO.js";
9
9
  import "./chunk-VABNWHSE.js";
10
10
  import "./chunk-DS2YJZZY.js";
11
11
  import "./chunk-2RUGZQUD.js";
12
12
  import "./chunk-5QXAQCAJ.js";
13
13
  import "./chunk-4HKB2TAG.js";
14
- import "./chunk-EAU7KEML.js";
14
+ import "./chunk-PJ5OHMV7.js";
15
15
  import "./chunk-J2PPCMCR.js";
16
16
  import "./chunk-5CNDLMYO.js";
17
17
  import "./chunk-B7VOTF5Q.js";
@@ -138,7 +138,7 @@ import "./chunk-RW6YKTIM.js";
138
138
  import "./chunk-APZ6ZTDA.js";
139
139
  import "./chunk-ZRIBI33P.js";
140
140
  import "./chunk-D7UZLH36.js";
141
- import "./chunk-IQX2FYLR.js";
141
+ import "./chunk-GJQJNIU2.js";
142
142
  import "./chunk-YUV5QBHU.js";
143
143
  import "./chunk-YVL3NXEB.js";
144
144
  import "./chunk-UEWARAPX.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.1192.0",
3
+ "version": "0.1193.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {