@buildautomaton/cli 0.1.11 → 0.1.12

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.
package/dist/cli.js CHANGED
@@ -34593,13 +34593,6 @@ function attachFirehoseAfterIdentified(ctx, params) {
34593
34593
  if (myGen !== state.firehoseGeneration) return;
34594
34594
  state.firehoseHandle = null;
34595
34595
  if (state.closedByUser) return;
34596
- const main2 = state.currentWs;
34597
- if (!main2 || main2.readyState !== wrapper_default.OPEN) {
34598
- logFn(
34599
- `${PROXY_AND_LOG_SERVICE_LABEL} Not reconnecting preview and log stream: main bridge connection is not open.`
34600
- );
34601
- return;
34602
- }
34603
34596
  beginFirehoseDeferredDisconnect(firehoseCtx(), code, reason, logFn);
34604
34597
  clearFirehoseReconnectTimer();
34605
34598
  const delay2 = reconnectDelayMs(state.firehoseReconnectAttempt);
@@ -34614,15 +34607,6 @@ function attachFirehoseAfterIdentified(ctx, params) {
34614
34607
  state.firehoseReconnectTimeout = setTimeout(() => {
34615
34608
  state.firehoseReconnectTimeout = null;
34616
34609
  if (state.closedByUser) return;
34617
- const w = state.currentWs;
34618
- if (!w || w.readyState !== wrapper_default.OPEN) {
34619
- if (state.firehoseQuiet.verboseLogs) {
34620
- logFn(
34621
- `${PROXY_AND_LOG_SERVICE_LABEL} Reconnect skipped: main bridge connection closed before preview stream could reconnect.`
34622
- );
34623
- }
34624
- return;
34625
- }
34626
34610
  const p = state.lastFirehoseParams;
34627
34611
  if (!p) {
34628
34612
  if (state.firehoseQuiet.verboseLogs) {
@@ -35024,21 +35008,29 @@ var handlePromptMessage = (msg, deps) => {
35024
35008
  };
35025
35009
 
35026
35010
  // src/agents/acp/from-bridge/handle-bridge-cancel-run.ts
35027
- function handleBridgeCancelRun(msg, { log: log2, acpManager }) {
35011
+ async function handleBridgeCancelRun(msg, { log: log2, acpManager, getWs }) {
35028
35012
  const runId = msg.runId;
35029
35013
  if (!runId) return;
35030
- void acpManager.cancelRun(runId).then((sent) => {
35031
- if (!sent) {
35032
- log2(
35033
- `[Agent] Cancel ignored for run ${runId.slice(0, 8)}\u2026 (no active run or cancel not available).`
35034
- );
35035
- }
35014
+ const sessionId = typeof msg.sessionId === "string" ? msg.sessionId.trim() : "";
35015
+ const sent = await acpManager.cancelRun(runId);
35016
+ if (sent) return;
35017
+ log2(`[Agent] Cancel: no local run for ${runId.slice(0, 8)}\u2026 \u2014 reporting stopped to cloud.`);
35018
+ const ws = getWs();
35019
+ if (!ws || ws.readyState !== 1) return;
35020
+ sendWsMessage(ws, {
35021
+ type: "prompt_result",
35022
+ id: `cancel-nack-${runId}`,
35023
+ runId,
35024
+ ...sessionId ? { sessionId } : {},
35025
+ success: false,
35026
+ error: "Stopped by user",
35027
+ stopReason: "no_local_run"
35036
35028
  });
35037
35029
  }
35038
35030
 
35039
35031
  // src/bridge/routing/handlers/cancel-run.ts
35040
35032
  var handleCancelRunMessage = (msg, deps) => {
35041
- handleBridgeCancelRun(msg, deps);
35033
+ void handleBridgeCancelRun(msg, deps);
35042
35034
  };
35043
35035
 
35044
35036
  // src/agents/acp/from-bridge/handle-bridge-cursor-request-response.ts