@wrongstack/cli 1.0.26 → 1.0.27

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 (44) hide show
  1. package/dist/{acp-LI665LO2.js → acp-M4565YUW.js} +30 -17
  2. package/dist/boot/dispatch-singleshot.d.ts +8 -0
  3. package/dist/boot/dispatch-webui.d.ts +2 -0
  4. package/dist/boot/goal-tui-default.d.ts +10 -0
  5. package/dist/{chunk-OAVBM55Q.js → chunk-ENRYW73H.js} +525 -379
  6. package/dist/chunk-HDMFKTT3.js +157 -0
  7. package/dist/{chunk-WQV2NP57.js → chunk-HFZH2XJN.js} +2 -2
  8. package/dist/{chunk-BEHGRNOQ.js → chunk-N57IU5FG.js} +9 -9
  9. package/dist/{chunk-2EBVTYJR.js → chunk-NRXWOMK7.js} +17 -3
  10. package/dist/{chunk-5SEYGOCH.js → chunk-RDGGWMTI.js} +2 -2
  11. package/dist/{chunk-KJS5543T.js → chunk-RGFWGUAB.js} +26 -14
  12. package/dist/{chunk-S4FFHDJG.js → chunk-SDJCLEK6.js} +6 -2
  13. package/dist/{cli-context-UVGAN3NO.js → cli-context-C7RBSWHF.js} +33 -6
  14. package/dist/{cli-main-TN3KZ2P6.js → cli-main-TQTH73ZK.js} +304 -345
  15. package/dist/{execution-7QIP6GRY.js → execution-3STBD2U7.js} +87 -33
  16. package/dist/execution-chimera-review.d.ts +18 -1
  17. package/dist/{hq-GLZ7QESM.js → hq-44F4OQH2.js} +5 -4
  18. package/dist/hq-fleet-control.d.ts +36 -0
  19. package/dist/hq-live-status.d.ts +22 -0
  20. package/dist/hq-publisher.d.ts +18 -0
  21. package/dist/hq-server/routes/command-handlers.d.ts +12 -1
  22. package/dist/hq-server/routes/data-handlers.d.ts +1 -1
  23. package/dist/hq-server/socket-credentials.d.ts +63 -0
  24. package/dist/hq-server/upgrade-handler.d.ts +2 -0
  25. package/dist/hq-server/ws.d.ts +24 -0
  26. package/dist/{hq-server-YTKDVQPY.js → hq-server-UIB24LU6.js} +2 -2
  27. package/dist/{import-claude-code-32PCSIQI.js → import-claude-code-AYG24RG2.js} +36 -4
  28. package/dist/index.js +3 -3
  29. package/dist/live-settings-input.d.ts +1 -0
  30. package/dist/{mailbox-serve-NW5VZG7R.js → mailbox-serve-GNGXEQ2R.js} +2 -2
  31. package/dist/{modeldiag-36VODVIH.js → modeldiag-W7XAE625.js} +2 -2
  32. package/dist/{remote-O5WXHLWV.js → remote-GB5VXCCT.js} +38 -23
  33. package/dist/{sessions-config-SXTTLNXA.js → sessions-config-XHLXJ5C3.js} +75 -6
  34. package/dist/{short-circuit-flags-74Y5N6CF.js → short-circuit-flags-5TNTJPQR.js} +2 -2
  35. package/dist/slash-commands/theme.d.ts +15 -1
  36. package/dist/subcommands/handlers/import-claude-code.d.ts +10 -0
  37. package/dist/subcommands/handlers/sessions-fleet.d.ts +0 -12
  38. package/dist/{subcommands-Q6ORSB2E.js → subcommands-BHQYLDSD.js} +2 -2
  39. package/dist/{webui-server-YTHLRFD2.js → webui-server-GCXIO3JY.js} +37 -30
  40. package/dist/webui-server-options.d.ts +10 -0
  41. package/dist/wiring/command-host-state.d.ts +2 -0
  42. package/dist/wiring/hq-telemetry.d.ts +12 -0
  43. package/package.json +29 -28
  44. package/dist/chunk-OWNC7LMD.js +0 -78
@@ -4,14 +4,14 @@ import {
4
4
  loadCachedAcpRegistry,
5
5
  refreshAcpRegistry,
6
6
  setupProvider
7
- } from "./chunk-5SEYGOCH.js";
7
+ } from "./chunk-RDGGWMTI.js";
8
8
  import {
9
9
  createHqCommandDispatcher
10
- } from "./chunk-2EBVTYJR.js";
10
+ } from "./chunk-NRXWOMK7.js";
11
11
  import {
12
12
  startCliHqConnection
13
- } from "./chunk-KJS5543T.js";
14
- import "./chunk-S4FFHDJG.js";
13
+ } from "./chunk-RGFWGUAB.js";
14
+ import "./chunk-SDJCLEK6.js";
15
15
  import "./chunk-F5DCFAKI.js";
16
16
  import "./chunk-SIGUWXAA.js";
17
17
  import "./chunk-LUMETJFO.js";
@@ -19,7 +19,7 @@ import "./chunk-DAKVBMD4.js";
19
19
 
20
20
  // src/subcommands/handlers/acp.ts
21
21
  import { randomBytes } from "node:crypto";
22
- import * as path from "node:path";
22
+ import * as path2 from "node:path";
23
23
  import {
24
24
  defaultPermissionPolicy,
25
25
  EnsembleRegistry,
@@ -41,6 +41,7 @@ import { leaderDeliveryHub } from "@wrongstack/core/coordination";
41
41
  import { WebSocketServer } from "ws";
42
42
 
43
43
  // src/acp-hq-telemetry.ts
44
+ import * as path from "node:path";
44
45
  import { AgentStatusTracker } from "@wrongstack/core/coordination";
45
46
  import {
46
47
  createApprovalRegistry,
@@ -60,6 +61,15 @@ function startAcpHqTelemetry(options) {
60
61
  }
61
62
  return false;
62
63
  };
64
+ const resolveUserInput = (requestId, response, sessionId) => {
65
+ if (sessionId !== void 0) {
66
+ return entries.get(sessionId)?.approvals?.resolveUserInput?.(requestId, response, sessionId) ?? false;
67
+ }
68
+ for (const entry of entries.values()) {
69
+ if (entry.approvals?.resolveUserInput?.(requestId, response) === true) return true;
70
+ }
71
+ return false;
72
+ };
63
73
  const connection = startCliHqConnection({
64
74
  clientKind: "acp",
65
75
  projectRoot: options.projectRoot,
@@ -70,11 +80,11 @@ function startAcpHqTelemetry(options) {
70
80
  "mailbox.summary",
71
81
  "fleet.summary",
72
82
  "session.summary",
73
- // Approvals are the ONLY control this host accepts. `control.receive` is
74
- // the server's gate for any command at all, so it has to be declared;
75
- // everything except `approve` falls through the dispatcher and is
76
- // refused, because an ACP session has no mailbox to steer and no leader
77
- // to abort.
83
+ // Approvals and answers to ask_user are the ONLY control this host
84
+ // accepts. `control.receive` is the server's gate for any command at
85
+ // all, so it has to be declared; everything except `approve` and
86
+ // `answer-input` falls through the dispatcher and is refused, because
87
+ // an ACP session has no mailbox to steer and no leader to abort.
78
88
  "control.receive",
79
89
  "control.approve"
80
90
  ],
@@ -83,7 +93,8 @@ function startAcpHqTelemetry(options) {
83
93
  sessionTag: () => "acp",
84
94
  ownsSession: (sessionId) => entries.has(sessionId),
85
95
  allowRunCommand: () => false,
86
- resolveApproval
96
+ resolveApproval,
97
+ resolveUserInput
87
98
  })
88
99
  });
89
100
  const attach = (sessionId, agent, cwd) => {
@@ -103,7 +114,9 @@ function startAcpHqTelemetry(options) {
103
114
  // An ACP session works in the directory the client opened, which is
104
115
  // not necessarily where the server booted.
105
116
  projectRoot: cwd,
106
- projectName: options.projectName ?? options.projectRoot,
117
+ // A NAME, not a path: the full root is an absolute path (it carries
118
+ // the OS account name) and `projectName` is not a redacted key.
119
+ projectName: options.projectName ?? path.basename(cwd),
107
120
  initialAgents: tracker.getAgents(),
108
121
  startedAt: (/* @__PURE__ */ new Date()).toISOString()
109
122
  });
@@ -709,13 +722,13 @@ async function runACPWebSocketServer(deps, port) {
709
722
  }
710
723
  hqTelemetry = startAcpHqTelemetry({
711
724
  projectRoot: deps.cwd ?? process.cwd(),
712
- projectName: path.basename(deps.cwd ?? process.cwd()),
725
+ projectName: path2.basename(deps.cwd ?? process.cwd()),
713
726
  appConfig: deps.config
714
727
  });
715
728
  const tracked = hqTelemetry.wrapAgentFactory(agentFor);
716
729
  wsAgentFactory = agentFor;
717
730
  turnFactory = () => makeACPServerAgentTurn({ agentFor: tracked, pendingDeliveries: pendingLeaderDeliveries });
718
- store = deps.paths?.projectDir ? new ACPSessionStore({ dir: path.join(deps.paths.projectDir, "acp-sessions") }) : void 0;
731
+ store = deps.paths?.projectDir ? new ACPSessionStore({ dir: path2.join(deps.paths.projectDir, "acp-sessions") }) : void 0;
719
732
  }
720
733
  const acpToken = process.env["WRONGSTACK_ACP_TOKEN"]?.trim() || randomBytes(32).toString("hex");
721
734
  const gate = createAcpConnectionGate({ host, port, token: acpToken });
@@ -830,7 +843,7 @@ async function runACPServer(deps) {
830
843
  }
831
844
  stdioHqTelemetry = startAcpHqTelemetry({
832
845
  projectRoot: deps.cwd ?? process.cwd(),
833
- projectName: path.basename(deps.cwd ?? process.cwd()),
846
+ projectName: path2.basename(deps.cwd ?? process.cwd()),
834
847
  appConfig: deps.config
835
848
  });
836
849
  const stdioAgentFactory = agentFor;
@@ -838,7 +851,7 @@ async function runACPServer(deps) {
838
851
  agentFor: stdioHqTelemetry.wrapAgentFactory(agentFor),
839
852
  pendingDeliveries: pendingLeaderDeliveries
840
853
  });
841
- const store = deps.paths?.projectDir ? new ACPSessionStore({ dir: path.join(deps.paths.projectDir, "acp-sessions") }) : void 0;
854
+ const store = deps.paths?.projectDir ? new ACPSessionStore({ dir: path2.join(deps.paths.projectDir, "acp-sessions") }) : void 0;
842
855
  return {
843
856
  runTurn: turn,
844
857
  replayFor: turn.replay,
@@ -1179,4 +1192,4 @@ ${renderAcpBenchText(result)}
1179
1192
  export {
1180
1193
  acpCmd
1181
1194
  };
1182
- //# sourceMappingURL=acp-LI665LO2.js.map
1195
+ //# sourceMappingURL=acp-M4565YUW.js.map
@@ -28,6 +28,14 @@ interface SingleShotDispatchContext {
28
28
  renderer: TerminalRenderer;
29
29
  /** Host event bus; required for `--max-budget-usd` to see spend as it lands. */
30
30
  events?: Pick<EventBus, 'on'> | undefined;
31
+ /**
32
+ * The host's interrupt seam. HQ's "abort leader" and every other remote stop
33
+ * call `abortLeader()`; a one-shot turn has no TUI to rebind it, so this run
34
+ * binds it to its own controller for the duration of the turn.
35
+ */
36
+ interruptController?: {
37
+ abortLeader: () => boolean;
38
+ } | undefined;
31
39
  }
32
40
  /**
33
41
  * Run a single `agent.run()` turn and render the result.
@@ -110,6 +110,8 @@ export interface WebUIDispatchContext {
110
110
  /** Live fleet budget for WebUI concurrency/spawn gauges (issue #323). */
111
111
  getFleetBudget?: CliWebUIOptions['getFleetBudget'];
112
112
  stopSessionFleet?: CliWebUIOptions['stopSessionFleet'];
113
+ interruptController?: CliWebUIOptions['interruptController'];
114
+ hqFleetControl?: CliWebUIOptions['hqFleetControl'];
113
115
  onSessionRetired?: CliWebUIOptions['onSessionRetired'];
114
116
  /** The process's single background-delegation auto-wake controller. */
115
117
  leaderAutoWake?: CliWebUIOptions['leaderAutoWake'];
@@ -0,0 +1,10 @@
1
+ /**
2
+ * `--goal` / `--ask` without a prompt run in the TUI (`--no-tui` still wins).
3
+ *
4
+ * Decided in `boot`, before the composition root reads `flags.tui`: this used
5
+ * to happen in execution.ts, after cli-main had already derived screen
6
+ * ownership and the HQ client kind from it — a goal run painted the TUI but
7
+ * announced itself to HQ as `cli`, with non-TUI stderr behaviour.
8
+ */
9
+ export declare function applyGoalTuiDefault(flags: Record<string, string | boolean>, positional: readonly string[]): void;
10
+ //# sourceMappingURL=goal-tui-default.d.ts.map