@wrongstack/cli 1.0.26 → 1.0.28

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 (52) 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-BEHGRNOQ.js → chunk-3ZTLPNEQ.js} +10 -10
  6. package/dist/chunk-7IQWQCBH.js +160 -0
  7. package/dist/{chunk-OAVBM55Q.js → chunk-ENRYW73H.js} +525 -379
  8. package/dist/{chunk-WQV2NP57.js → chunk-L5TD7UIG.js} +2 -2
  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-O2SHBDFH.js} +33 -6
  14. package/dist/{cli-main-TN3KZ2P6.js → cli-main-BKG4ZVLN.js} +1079 -616
  15. package/dist/{execution-7QIP6GRY.js → execution-THXWTHYT.js} +87 -33
  16. package/dist/execution-chimera-review.d.ts +18 -1
  17. package/dist/fleet/host-memory-companion.d.ts +43 -0
  18. package/dist/fleet/host-subagent-factory.d.ts +1 -1
  19. package/dist/fleet/host.d.ts +1 -0
  20. package/dist/fleet/memory-companion-evidence.d.ts +12 -0
  21. package/dist/fleet/memory-companion-policy.d.ts +9 -0
  22. package/dist/goal-commands.d.ts +10 -0
  23. package/dist/{hq-GLZ7QESM.js → hq-44F4OQH2.js} +5 -4
  24. package/dist/hq-fleet-control.d.ts +36 -0
  25. package/dist/hq-live-status.d.ts +22 -0
  26. package/dist/hq-publisher.d.ts +18 -0
  27. package/dist/hq-server/routes/command-handlers.d.ts +12 -1
  28. package/dist/hq-server/routes/data-handlers.d.ts +1 -1
  29. package/dist/hq-server/socket-credentials.d.ts +63 -0
  30. package/dist/hq-server/upgrade-handler.d.ts +2 -0
  31. package/dist/hq-server/ws.d.ts +24 -0
  32. package/dist/{hq-server-YTKDVQPY.js → hq-server-UIB24LU6.js} +2 -2
  33. package/dist/{import-claude-code-32PCSIQI.js → import-claude-code-AYG24RG2.js} +36 -4
  34. package/dist/index.js +3 -3
  35. package/dist/live-settings-input.d.ts +1 -0
  36. package/dist/{mailbox-serve-NW5VZG7R.js → mailbox-serve-GNGXEQ2R.js} +2 -2
  37. package/dist/{modeldiag-36VODVIH.js → modeldiag-W7XAE625.js} +2 -2
  38. package/dist/{remote-O5WXHLWV.js → remote-GB5VXCCT.js} +38 -23
  39. package/dist/services/run-git.d.ts +3 -1
  40. package/dist/{sessions-config-SXTTLNXA.js → sessions-config-XHLXJ5C3.js} +75 -6
  41. package/dist/{short-circuit-flags-74Y5N6CF.js → short-circuit-flags-BSIPTAPD.js} +2 -2
  42. package/dist/slash-commands/theme.d.ts +15 -1
  43. package/dist/subcommands/handlers/import-claude-code.d.ts +10 -0
  44. package/dist/subcommands/handlers/sessions-fleet.d.ts +0 -12
  45. package/dist/{subcommands-Q6ORSB2E.js → subcommands-SRRB3RAS.js} +2 -2
  46. package/dist/{typesafe-U7YB2RRV.js → typesafe-WA5O3KVS.js} +10 -2
  47. package/dist/{webui-server-YTHLRFD2.js → webui-server-GCXIO3JY.js} +37 -30
  48. package/dist/webui-server-options.d.ts +10 -0
  49. package/dist/wiring/command-host-state.d.ts +2 -0
  50. package/dist/wiring/hq-telemetry.d.ts +12 -0
  51. package/package.json +29 -28
  52. package/dist/chunk-OWNC7LMD.js +0 -78
@@ -22,7 +22,7 @@ async function handleHelpVersionShortCircuit(argv) {
22
22
  }
23
23
  if (earlyFlags["help"] === true) {
24
24
  if (positional.length > 0) {
25
- const { subcommandNames } = await import("./subcommands-Q6ORSB2E.js");
25
+ const { subcommandNames } = await import("./subcommands-SRRB3RAS.js");
26
26
  if (subcommandNames.includes(positional[0])) {
27
27
  const first = positional[0];
28
28
  const deep = positional[1];
@@ -43,4 +43,4 @@ async function handleHelpVersionShortCircuit(argv) {
43
43
  export {
44
44
  handleHelpVersionShortCircuit
45
45
  };
46
- //# sourceMappingURL=chunk-WQV2NP57.js.map
46
+ //# sourceMappingURL=chunk-L5TD7UIG.js.map
@@ -172,14 +172,28 @@ async function dispatch(controller, commandId, type, payload) {
172
172
  };
173
173
  }
174
174
  if (target === "fleet") {
175
- const killed = await controller.killFleet?.(sessionId) ?? 0;
175
+ if (controller.killFleet === void 0) {
176
+ return {
177
+ commandId,
178
+ status: "rejected",
179
+ message: "this client does not manage a fleet"
180
+ };
181
+ }
182
+ const killed = await controller.killFleet(sessionId);
176
183
  return {
177
184
  commandId,
178
185
  status: "completed",
179
186
  message: `fleet stopped (${killed} agents)`
180
187
  };
181
188
  }
182
- const terminated = await controller.terminateAgent?.(target, sessionId) ?? false;
189
+ if (controller.terminateAgent === void 0) {
190
+ return {
191
+ commandId,
192
+ status: "rejected",
193
+ message: "this client does not manage subagents"
194
+ };
195
+ }
196
+ const terminated = await controller.terminateAgent(target, sessionId);
183
197
  return {
184
198
  commandId,
185
199
  status: terminated ? "completed" : "rejected",
@@ -320,4 +334,4 @@ export {
320
334
  createProjectKanbanAssignHandler,
321
335
  createHqCommandDispatcher
322
336
  };
323
- //# sourceMappingURL=chunk-2EBVTYJR.js.map
337
+ //# sourceMappingURL=chunk-NRXWOMK7.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveProviderCfgWithProxy
3
- } from "./chunk-S4FFHDJG.js";
3
+ } from "./chunk-SDJCLEK6.js";
4
4
  import {
5
5
  fallbackCodexProviderModels,
6
6
  filterCurrentCodexModelIds,
@@ -336,4 +336,4 @@ export {
336
336
  setupProvider,
337
337
  createGracefulShutdown
338
338
  };
339
- //# sourceMappingURL=chunk-5SEYGOCH.js.map
339
+ //# sourceMappingURL=chunk-RDGGWMTI.js.map
@@ -445,18 +445,15 @@ function hqExplicitlyDisabled(options) {
445
445
  return options.appConfig?.hq?.enabled === false;
446
446
  }
447
447
  function resolvedHqConnectionKey(options) {
448
- if (options.config !== void 0) {
449
- if (options.config.enabled === false) return void 0;
450
- return options.config.discover === true ? HQ_DISCOVERY_CONNECTION_KEY : `${options.config.url}
451
- ${options.config.token ?? ""}`;
452
- }
453
- const config = resolveHqConfig({ config: options.appConfig?.hq });
448
+ const config = options.config !== void 0 ? options.config.enabled === false ? void 0 : options.config : resolveHqConfig({ config: options.appConfig?.hq });
454
449
  if (config === void 0) return void 0;
455
- return config.discover === true ? HQ_DISCOVERY_CONNECTION_KEY : `${config.url}
450
+ const endpoint = config.discover === true ? HQ_DISCOVERY_CONNECTION_KEY : `${config.url}
456
451
  ${config.token ?? ""}`;
452
+ return `${endpoint}
453
+ raw=${String(config.rawContent)}`;
457
454
  }
458
455
  function startCliHqConnection(options) {
459
- const shouldOwnKanbanSync = options.onKanbanSnapshot === void 0;
456
+ const shouldOwnKanbanSync = options.ownKanbanSync !== false && options.onKanbanSnapshot === void 0;
460
457
  let kanbanSync;
461
458
  const publisherOptions = shouldOwnKanbanSync ? {
462
459
  ...options,
@@ -465,17 +462,32 @@ function startCliHqConnection(options) {
465
462
  let publisher;
466
463
  let publisherKey;
467
464
  let timer;
465
+ const liveOptions = () => options.getAppConfig === void 0 ? publisherOptions : { ...publisherOptions, appConfig: options.getAppConfig() };
466
+ const retire = () => {
467
+ if (publisher === void 0) return;
468
+ kanbanSync?.stop();
469
+ kanbanSync = void 0;
470
+ publisher.close();
471
+ publisher = void 0;
472
+ publisherKey = void 0;
473
+ options.onDisconnect?.();
474
+ };
468
475
  const tryConnect = () => {
469
- const nextKey = resolvedHqConnectionKey(options);
470
- if (nextKey === void 0) return;
476
+ const current = liveOptions();
477
+ const nextKey = resolvedHqConnectionKey(current);
478
+ if (nextKey === void 0) {
479
+ retire();
480
+ return;
481
+ }
471
482
  if (publisher !== void 0 && publisherKey === nextKey) {
472
- if (nextKey === HQ_DISCOVERY_CONNECTION_KEY) publisher.refreshEndpoint();
483
+ if (nextKey.startsWith(`${HQ_DISCOVERY_CONNECTION_KEY}
484
+ `)) publisher.refreshEndpoint();
473
485
  return;
474
486
  }
475
487
  publisher?.close();
476
488
  publisher = void 0;
477
489
  publisherKey = void 0;
478
- const next = createCliHqPublisher(publisherOptions);
490
+ const next = createCliHqPublisher(current);
479
491
  if (next === void 0) return;
480
492
  publisher = next;
481
493
  publisherKey = nextKey;
@@ -495,7 +507,7 @@ function startCliHqConnection(options) {
495
507
  options.onConnect?.(next);
496
508
  };
497
509
  tryConnect();
498
- if (!hqExplicitlyDisabled(options)) {
510
+ if (options.getAppConfig !== void 0 || !hqExplicitlyDisabled(options)) {
499
511
  timer = setInterval(tryConnect, options.retryIntervalMs ?? 2500);
500
512
  timer.unref?.();
501
513
  }
@@ -518,4 +530,4 @@ function startCliHqConnection(options) {
518
530
  export {
519
531
  startCliHqConnection
520
532
  };
521
- //# sourceMappingURL=chunk-KJS5543T.js.map
533
+ //# sourceMappingURL=chunk-RGFWGUAB.js.map
@@ -12,8 +12,12 @@ function resolveRawProviderConnection(config, providerId) {
12
12
  const savedCfg = config.providers?.[providerId];
13
13
  const isAccountAlias = savedCfg?.type !== void 0 && savedCfg.type !== providerId;
14
14
  const inheritsPrimary = !isAccountAlias && (config.provider === void 0 || config.provider === providerId);
15
+ const repointed = Array.isArray(savedCfg?.envVars) && savedCfg.envVars.length === 0;
15
16
  return {
16
- apiKey: savedCfg?.apiKey ?? (inheritsPrimary ? config.apiKey : void 0),
17
+ // A repointed entry (`envVars: []` sentinel) must not inherit the legacy
18
+ // top-level key: `leader_model_set` could otherwise make it primary and
19
+ // carry that key to the new base URL (WS-2026-09-26-01).
20
+ apiKey: savedCfg?.apiKey ?? (inheritsPrimary && !repointed ? config.apiKey : void 0),
17
21
  baseUrl: savedCfg?.baseUrl ?? (inheritsPrimary ? config.baseUrl : void 0)
18
22
  };
19
23
  }
@@ -90,4 +94,4 @@ export {
90
94
  resolveProviderCfgWithProxy,
91
95
  buildProviderForId
92
96
  };
93
- //# sourceMappingURL=chunk-S4FFHDJG.js.map
97
+ //# sourceMappingURL=chunk-SDJCLEK6.js.map
@@ -27,17 +27,17 @@ import {
27
27
  } from "./chunk-EWKESL4L.js";
28
28
  import {
29
29
  subcommands
30
- } from "./chunk-BEHGRNOQ.js";
30
+ } from "./chunk-3ZTLPNEQ.js";
31
31
  import {
32
32
  renderDeepHelp,
33
33
  renderFocusedHelp
34
34
  } from "./chunk-EPR42SWM.js";
35
35
  import {
36
36
  handleHelpVersionShortCircuit
37
- } from "./chunk-WQV2NP57.js";
37
+ } from "./chunk-L5TD7UIG.js";
38
38
  import {
39
39
  DEFAULT_PORT
40
- } from "./chunk-OAVBM55Q.js";
40
+ } from "./chunk-ENRYW73H.js";
41
41
  import "./chunk-HXJYHAR4.js";
42
42
  import {
43
43
  resolveHqPasswordInput
@@ -928,7 +928,7 @@ async function isPortInUse(host, port) {
928
928
  }
929
929
  async function handleHqShortCircuit(flags) {
930
930
  if (flags["hq"] !== true) return null;
931
- const { startHqServer } = await import("./hq-server-YTKDVQPY.js");
931
+ const { startHqServer } = await import("./hq-server-UIB24LU6.js");
932
932
  const tunnelRequested = flags["tunnel"] === true;
933
933
  const rawPublicUrl = typeof flags["hq-public-url"] === "string" ? flags["hq-public-url"] : process.env.WRONGSTACK_HQ_PUBLIC_URL;
934
934
  let publicOrigin;
@@ -1474,6 +1474,14 @@ async function maybeRestoreDefaultProfileFromBackup(opts) {
1474
1474
  }
1475
1475
  }
1476
1476
 
1477
+ // src/boot/goal-tui-default.ts
1478
+ function applyGoalTuiDefault(flags, positional) {
1479
+ const prompt = flags["prompt"];
1480
+ if ((typeof flags["goal"] === "string" || typeof flags["ask"] === "string") && positional.length === 0 && !(typeof prompt === "string" && prompt.length > 0)) {
1481
+ flags["tui"] = true;
1482
+ }
1483
+ }
1484
+
1477
1485
  // src/boot/system-prompt-menu.ts
1478
1486
  import {
1479
1487
  countSystemPromptTokens,
@@ -2218,8 +2226,25 @@ var ReadlineInputReader = class {
2218
2226
  const eraseAll = () => {
2219
2227
  for (let i = 0; i < buf.length; i++) eraseChar();
2220
2228
  };
2229
+ let escState = 0;
2221
2230
  const onData = (chunk) => {
2222
2231
  for (const ch of chunk) {
2232
+ if (escState === 1) {
2233
+ escState = ch === "[" ? 2 : ch === "O" ? 3 : 0;
2234
+ continue;
2235
+ }
2236
+ if (escState === 2) {
2237
+ if (ch >= "@" && ch <= "~") escState = 0;
2238
+ continue;
2239
+ }
2240
+ if (escState === 3) {
2241
+ escState = 0;
2242
+ continue;
2243
+ }
2244
+ if (ch === "\x1B") {
2245
+ escState = 1;
2246
+ continue;
2247
+ }
2223
2248
  if (ch === "\r" || ch === "\n") {
2224
2249
  cleanup();
2225
2250
  writeOut(` ${dim(`[${buf.length} chars]`)}
@@ -2256,6 +2281,7 @@ var ReadlineInputReader = class {
2256
2281
  buf += ch;
2257
2282
  writeOut("\u2022");
2258
2283
  }
2284
+ if (escState === 1) escState = 0;
2259
2285
  };
2260
2286
  stdin.on("data", onData);
2261
2287
  });
@@ -2771,7 +2797,7 @@ async function boot(argv) {
2771
2797
  });
2772
2798
  }
2773
2799
  if (positional[0] === "remote" || typeof flags["remote"] === "string") {
2774
- const { runRemoteCommand } = await import("./remote-O5WXHLWV.js");
2800
+ const { runRemoteCommand } = await import("./remote-GB5VXCCT.js");
2775
2801
  return runRemoteCommand(
2776
2802
  positional[0] === "remote" ? positional.slice(1) : positional,
2777
2803
  flags,
@@ -3234,6 +3260,7 @@ To start the app with no model connected, pass --provider ${SETUP_PROVIDER_ID} -
3234
3260
  }
3235
3261
  flags["autonomy"] = effectiveChoices.autonomy;
3236
3262
  }
3263
+ applyGoalTuiDefault(flags, positional);
3237
3264
  flags["director"] = true;
3238
3265
  return {
3239
3266
  config,
@@ -3415,4 +3442,4 @@ async function initializeCli(argv) {
3415
3442
  export {
3416
3443
  initializeCli
3417
3444
  };
3418
- //# sourceMappingURL=cli-context-UVGAN3NO.js.map
3445
+ //# sourceMappingURL=cli-context-O2SHBDFH.js.map