@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
@@ -11,10 +11,10 @@ import {
11
11
  createHqCommandDispatcher,
12
12
  createProjectKanbanAssignHandler,
13
13
  createProjectKanbanTransitionHandler
14
- } from "./chunk-2EBVTYJR.js";
14
+ } from "./chunk-NRXWOMK7.js";
15
15
  import {
16
16
  startCliHqConnection
17
- } from "./chunk-KJS5543T.js";
17
+ } from "./chunk-RGFWGUAB.js";
18
18
  import {
19
19
  CLI_VERSION
20
20
  } from "./chunk-F5DCFAKI.js";
@@ -427,7 +427,10 @@ function createWebuiClientRegistration(deps) {
427
427
  ...deps.getSessionWriter ? { getSessionWriter: deps.getSessionWriter } : {},
428
428
  startHqConnection: (options) => startCliHqConnection({
429
429
  ...options,
430
- capabilities: options.capabilities
430
+ capabilities: options.capabilities,
431
+ // Embedded in the CLI host, whose own HQ connection already syncs
432
+ // this project's Kanban boards; a second sync is a second writer.
433
+ ownKanbanSync: false
431
434
  }),
432
435
  ...control ? {
433
436
  createCommandHandler: (mailbox, approvals) => createHqCommandDispatcher({
@@ -437,6 +440,9 @@ function createWebuiClientRegistration(deps) {
437
440
  // Same registry the approval bridge publishes from, so every
438
441
  // prompt HQ shows is one this handler can actually answer.
439
442
  resolveApproval: (toolUseId, decision, sessionId) => approvals.resolve(toolUseId, decision, sessionId),
443
+ // Same registry again: it publishes `user_input.requested`, so
444
+ // it has to be the one that answers `answer-input`.
445
+ resolveUserInput: (requestId, response, sessionId) => approvals.resolveUserInput?.(requestId, response, sessionId) ?? false,
440
446
  ...deps.projectRoot ? {
441
447
  kanbanTransition: createProjectKanbanTransitionHandler(deps.projectRoot),
442
448
  kanbanAssign: createProjectKanbanAssignHandler(deps.projectRoot)
@@ -462,6 +468,20 @@ function createWebuiClientRegistration(deps) {
462
468
 
463
469
  // src/webui-client-observability.ts
464
470
  function createEmbeddedClientRegistration(opts, clients, abortControllers, getSessionAgents) {
471
+ const interruptSession = (sessionId) => {
472
+ const leaderId = sessionId ?? opts.session.id;
473
+ const controller = abortControllers.get(leaderId);
474
+ if (!controller) return false;
475
+ controller.abort();
476
+ try {
477
+ void Promise.resolve(opts.stopSessionFleet?.(leaderId)).catch(() => void 0);
478
+ } catch {
479
+ }
480
+ return true;
481
+ };
482
+ if (opts.interruptController) {
483
+ opts.interruptController.abortLeader = () => interruptSession(opts.agent.ctx.session?.id ?? opts.session.id);
484
+ }
465
485
  return createWebuiClientRegistration({
466
486
  projectRoot: opts.projectRoot,
467
487
  appConfig: opts.appConfig,
@@ -478,36 +498,23 @@ function createEmbeddedClientRegistration(opts, clients, abortControllers, getSe
478
498
  }
479
499
  return [...ids];
480
500
  },
481
- // `cli-main` already runs a tracker and a bridge for the boot session.
482
- // Announcing it here too would put two trackers on one bus flushing the
483
- // same agent list.
484
- isSessionOwnedElsewhere: (sessionId) => sessionId === opts.session.id,
501
+ // `cli-main` already runs a tracker and a bridge for the root
502
+ // conversation; announcing it here too would put two trackers on one bus
503
+ // flushing the same agent list. Compared against the LIVE root writer:
504
+ // the CLI host's telemetry follows `ctx.session`, so once the root moves
505
+ // (session.new / resume) the old boot id is an ordinary tab this client
506
+ // must publish, and the new root id must not be published twice.
507
+ isSessionOwnedElsewhere: (sessionId) => sessionId === (opts.agent.ctx.session?.id ?? opts.session.id),
485
508
  // The tab's own journal, so HQ takes its turns from the write path
486
509
  // instead of tailing the file.
487
510
  getSessionWriter: (sessionId) => getSessionAgents()?.peek(sessionId)?.ctx.session,
488
511
  hqControl: {
489
- // HQ speaks for the LEADER — the boot session, the one it registered
490
- // itself under (`hqSessionId`) — not for whatever else the browser
491
- // has open. This used to abort every controller in the map and clear
492
- // it, so a remote "interrupt" issued against the leader also killed
493
- // the three other tabs' in-flight runs. Deleting the entries was
494
- // wrong on its own terms too: the run's own `end()` owns removal, and
495
- // clearing early makes `isRunActive` lie to every tab still running.
496
- // Every open tab is its own session with its own abort controller, so
497
- // the command's session is the one that gets stopped. Falling back to
498
- // the boot session keeps a dashboard that sends no session — every one
499
- // before this existed — behaving exactly as before.
500
- interruptLeader: (sessionId) => {
501
- const leaderId = sessionId ?? opts.session.id;
502
- const controller = abortControllers.get(leaderId);
503
- if (!controller) return false;
504
- controller.abort();
505
- try {
506
- void Promise.resolve(opts.stopSessionFleet?.(leaderId)).catch(() => void 0);
507
- } catch {
508
- }
509
- return true;
510
- },
512
+ interruptLeader: interruptSession,
513
+ ...opts.hqFleetControl ? {
514
+ killFleet: opts.hqFleetControl.killFleet,
515
+ terminateAgent: opts.hqFleetControl.terminateAgent,
516
+ spawnAgent: opts.hqFleetControl.spawnAgent
517
+ } : {},
511
518
  allowRunCommand: () => opts.hqAllowExec === true,
512
519
  // A command naming a tab this process no longer holds is refused, not
513
520
  // redirected onto the boot session: the operator picked a terminal,
@@ -2237,4 +2244,4 @@ async function runWebUI(opts) {
2237
2244
  export {
2238
2245
  runWebUI
2239
2246
  };
2240
- //# sourceMappingURL=webui-server-YTHLRFD2.js.map
2247
+ //# sourceMappingURL=webui-server-GCXIO3JY.js.map
@@ -69,6 +69,16 @@ export interface CliWebUIOptions {
69
69
  * stopping one must never reach into another's fleet.
70
70
  */
71
71
  stopSessionFleet?: ((sessionId: string) => void | Promise<void>) | undefined;
72
+ /**
73
+ * The host's interrupt seam. HQ addresses the root conversation through the
74
+ * CLI host's own publisher, whose "abort leader" calls `abortLeader()`; the
75
+ * embedded server binds it to that conversation's run controller.
76
+ */
77
+ interruptController?: {
78
+ abortLeader: () => boolean;
79
+ } | undefined;
80
+ /** HQ fleet commands for a tab's session (abort fleet / agent, spawn). */
81
+ hqFleetControl?: import('./hq-fleet-control.js').HqFleetControl | undefined;
72
82
  /**
73
83
  * A tab was closed: release the host-side helpers pinned to its
74
84
  * conversation (explore companion, shadow-review bookkeeping).
@@ -15,6 +15,8 @@ interface CommandHostStateInput {
15
15
  setConfig: (config: Config) => void;
16
16
  getDirector: () => Director | null;
17
17
  hqCommandController: HqCommandController;
18
+ /** Several conversations share the Director (WebUI host): see `HqFleetScope`. */
19
+ hqMultiConversation?: boolean | undefined;
18
20
  multiAgentHost: MultiAgentHost;
19
21
  events: EventBus;
20
22
  sessionRef: {
@@ -36,6 +36,18 @@ interface SetupHqTelemetryDeps {
36
36
  */
37
37
  approvalMirror?: ApprovalMirrorRef | undefined;
38
38
  mcpRegistry: Pick<MCPRegistry, 'onOperation' | 'operationalHealth'>;
39
+ /**
40
+ * The LIVE conversation writer. An in-process `/resume` and an in-place
41
+ * project switch replace `ctx.session`; `session` above is only the boot
42
+ * writer. Defaults to it for hosts that never swap.
43
+ */
44
+ liveSession?: (() => SessionWriter) | undefined;
45
+ /** The LIVE project root (an in-place project switch re-roots the process). */
46
+ liveProjectRoot?: (() => string) | undefined;
47
+ /** How often the live session/project is compared to what HQ is bound to. */
48
+ scopeCheckIntervalMs?: number | undefined;
49
+ /** The LIVE app config, so `/hq` changes re-point the running connection. */
50
+ getConfig?: (() => Config) | undefined;
39
51
  }
40
52
  interface HqTelemetryResult {
41
53
  hqCommandController: HqCommandController;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/cli",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack CLI — terminal AI coding agent with provider catalog from models.dev. Provides `wrongstack` and `wstack` binaries.",
6
6
  "keywords": [
@@ -41,40 +41,41 @@
41
41
  "data"
42
42
  ],
43
43
  "dependencies": {
44
- "@wrongstack/acp": "1.0.26",
45
- "@wrongstack/bench": "1.0.26",
46
- "@wrongstack/core": "1.0.26",
47
- "@wrongstack/kanban": "1.0.26",
48
- "@wrongstack/mcp": "1.0.26",
49
- "@wrongstack/persistence": "1.0.26",
50
- "@wrongstack/plug-lsp": "1.0.26",
51
- "@wrongstack/plugins": "1.0.26",
52
- "@wrongstack/primitives": "1.0.26",
53
- "@wrongstack/providers": "1.0.26",
54
- "@wrongstack/requirement-intake": "1.0.26",
55
- "@wrongstack/runtime": "1.0.26",
56
- "@wrongstack/sage": "1.0.26",
57
- "@wrongstack/sdd": "1.0.26",
58
- "@wrongstack/security-scanner": "1.0.26",
59
- "@wrongstack/simpleui": "1.0.26",
60
- "@wrongstack/techstack": "1.0.26",
61
- "@wrongstack/telegram": "1.0.26",
62
- "@wrongstack/tools": "1.0.26",
63
- "@wrongstack/tui": "1.0.26",
64
- "@wrongstack/vector-memory": "1.0.26",
65
- "@wrongstack/webui": "1.0.26",
66
- "@wrongstack/webui-hq": "1.0.26",
67
- "@wrongstack/webui-protocol": "1.0.26",
68
- "@wrongstack/webui-server": "1.0.26",
69
- "@wrongstack/wrongtrace": "1.0.26",
44
+ "@wrongstack/acp": "1.0.28",
45
+ "@wrongstack/bench": "1.0.28",
46
+ "@wrongstack/core": "1.0.28",
47
+ "@wrongstack/kanban": "1.0.28",
48
+ "@wrongstack/mcp": "1.0.28",
49
+ "@wrongstack/persistence": "1.0.28",
50
+ "@wrongstack/plug-lsp": "1.0.28",
51
+ "@wrongstack/plugins": "1.0.28",
52
+ "@wrongstack/primitives": "1.0.28",
53
+ "@wrongstack/providers": "1.0.28",
54
+ "@wrongstack/requirement-intake": "1.0.28",
55
+ "@wrongstack/runtime": "1.0.28",
56
+ "@wrongstack/sage": "1.0.28",
57
+ "@wrongstack/sdd": "1.0.28",
58
+ "@wrongstack/security-scanner": "1.0.28",
59
+ "@wrongstack/simpleui": "1.0.28",
60
+ "@wrongstack/techstack": "1.0.28",
61
+ "@wrongstack/telegram": "1.0.28",
62
+ "@wrongstack/tools": "1.0.28",
63
+ "@wrongstack/tui": "1.0.28",
64
+ "@wrongstack/vector-memory": "1.0.28",
65
+ "@wrongstack/webui": "1.0.28",
66
+ "@wrongstack/webui-hq": "1.0.28",
67
+ "@wrongstack/webui-protocol": "1.0.28",
68
+ "@wrongstack/webui-server": "1.0.28",
69
+ "@wrongstack/wrongtrace": "1.0.28",
70
70
  "ws": "^8.21.3"
71
71
  },
72
72
  "optionalDependencies": {
73
- "@wrongstack/desktop": "1.0.26"
73
+ "@wrongstack/desktop": "1.0.28"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/node": "^26.5.1",
77
77
  "@types/ws": "^8.18.1",
78
+ "@wrongstack/governance": "1.0.28",
78
79
  "jsdom": "^30.0.1",
79
80
  "typescript": "^7.0.2"
80
81
  },
@@ -1,78 +0,0 @@
1
-
2
- // src/services/suggestion-store.ts
3
- var sharedSuggestions = [];
4
- var sharedAutoSuggestions = [];
5
- function setSuggestions(suggestions) {
6
- sharedSuggestions = suggestions;
7
- }
8
- function setAutoSuggestions(suggestions) {
9
- sharedAutoSuggestions = suggestions;
10
- }
11
- function getSuggestions() {
12
- return sharedSuggestions;
13
- }
14
- function removeSuggestions(indices) {
15
- if (indices.length === 0) return;
16
- const set = new Set(indices);
17
- sharedSuggestions = sharedSuggestions.filter((_, i) => !set.has(i));
18
- sharedAutoSuggestions = [];
19
- }
20
- function clearSuggestions() {
21
- sharedSuggestions = [];
22
- sharedAutoSuggestions = [];
23
- }
24
-
25
- // src/tui-thinking-word.ts
26
- var DEFAULT_TUI_THINKING_WORD = "thinking";
27
- var MAX_TUI_THINKING_WORD_LENGTH = 16;
28
- function normalizeTuiThinkingWord(value) {
29
- if (typeof value !== "string") return DEFAULT_TUI_THINKING_WORD;
30
- const word = value.trim();
31
- if (word.length === 0 || word.length > MAX_TUI_THINKING_WORD_LENGTH) {
32
- return DEFAULT_TUI_THINKING_WORD;
33
- }
34
- if (!/^[\p{L}\p{N}_-]+$/u.test(word)) return DEFAULT_TUI_THINKING_WORD;
35
- return word;
36
- }
37
-
38
- // src/services/run-git.ts
39
- import { spawn } from "node:child_process";
40
- import { toErrorMessage } from "@wrongstack/core/utils";
41
- async function runGit(args, cwd) {
42
- try {
43
- return await new Promise((resolve, reject) => {
44
- const child = spawn("git", args, {
45
- cwd,
46
- stdio: ["ignore", "pipe", "pipe"],
47
- signal: AbortSignal.timeout(3e4),
48
- windowsHide: true
49
- });
50
- let stdout = "";
51
- let stderr = "";
52
- child.stdout?.on("data", (d) => {
53
- stdout += d;
54
- });
55
- child.stderr?.on("data", (d) => {
56
- stderr += d;
57
- });
58
- child.on("error", (err) => {
59
- reject(new Error(`Failed to run git: ${err.message}`));
60
- });
61
- child.on("close", (code) => resolve({ stdout, stderr, code: code ?? 1 }));
62
- });
63
- } catch (err) {
64
- throw new Error(toErrorMessage(err));
65
- }
66
- }
67
-
68
- export {
69
- setSuggestions,
70
- setAutoSuggestions,
71
- getSuggestions,
72
- removeSuggestions,
73
- clearSuggestions,
74
- MAX_TUI_THINKING_WORD_LENGTH,
75
- normalizeTuiThinkingWord,
76
- runGit
77
- };
78
- //# sourceMappingURL=chunk-OWNC7LMD.js.map