@wrongstack/cli 0.302.0 → 0.302.2

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 (112) hide show
  1. package/data/providers.json +41 -155
  2. package/dist/{acp-DATHHPNT.js → acp-XCE4JJF3.js} +4 -4
  3. package/dist/{audit-QRCLEHHW.js → audit-BBR22QH3.js} +2 -2
  4. package/dist/{auth-PJD3JRH2.js → auth-K7CYVVKH.js} +121 -78
  5. package/dist/auth-menu/index.d.ts +5 -5
  6. package/dist/auth-menu/local.d.ts +4 -5
  7. package/dist/auth-menu/openai-codex-oauth.d.ts +1 -1
  8. package/dist/{auto-discover-providers-DRW4OZHG.js → auto-discover-providers-MHFLDSD3.js} +2 -2
  9. package/dist/{bench-7ZDWSNEF.js → bench-XNDUJOSZ.js} +10 -11
  10. package/dist/boot/auto-discover-providers.d.ts +1 -1
  11. package/dist/boot/container-wiring.d.ts +3 -3
  12. package/dist/boot/dispatch-webui.d.ts +1 -1
  13. package/dist/boot/system-prompt.d.ts +1 -2
  14. package/dist/boot/tool-registry.d.ts +1 -1
  15. package/dist/boot/tui-coordinator-setup.d.ts +1 -1
  16. package/dist/boot/tui-project-picker-callback.d.ts +1 -1
  17. package/dist/boot-config.d.ts +2 -2
  18. package/dist/boot.d.ts +1 -1
  19. package/dist/{chunk-ETOEGL3V.js → chunk-3IC4IEZC.js} +7 -2
  20. package/dist/{chunk-PFVVUH5B.js → chunk-3JPTNADJ.js} +3 -2
  21. package/dist/{chunk-4GVH7V3S.js → chunk-52C7PD2H.js} +1 -1
  22. package/dist/{chunk-OP47B3IX.js → chunk-7YLN7YUA.js} +7 -2
  23. package/dist/{chunk-263G3FMB.js → chunk-B4JLSXZB.js} +11 -14
  24. package/dist/{chunk-I5MEUFDI.js → chunk-BXQG3H2Y.js} +8 -3
  25. package/dist/{chunk-MT6FGXO3.js → chunk-C5NXM2SI.js} +19 -6
  26. package/dist/{chunk-XTIXVJXP.js → chunk-DGXNL7OT.js} +1 -1
  27. package/dist/{chunk-3MOUBRKZ.js → chunk-FJVCVZIV.js} +974 -935
  28. package/dist/{chunk-MRLYDHQ7.js → chunk-JQURRYU4.js} +4 -6
  29. package/dist/{chunk-ZECLGUTF.js → chunk-KV6DNQT6.js} +2 -2
  30. package/dist/{chunk-F4PEGAJZ.js → chunk-NUIHRGPY.js} +1 -1
  31. package/dist/{chunk-GUHQQG63.js → chunk-RK7E3IXT.js} +2 -4
  32. package/dist/{chunk-PYTFS4MC.js → chunk-SSSJQVUY.js} +27 -16
  33. package/dist/{chunk-PJHET45A.js → chunk-SZ42FYPT.js} +3 -3
  34. package/dist/{chunk-2KDOFTTM.js → chunk-WOXUE2CN.js} +1067 -900
  35. package/dist/{chunk-A6Q5KGLV.js → chunk-YKBRFSGL.js} +5 -5
  36. package/dist/cli-context.d.ts +2 -2
  37. package/dist/cli-eternal-flag.d.ts +1 -2
  38. package/dist/{cli-main-EOJ74CI4.js → cli-main-PJMDZHDK.js} +2680 -2133
  39. package/dist/context-limit.d.ts +11 -5
  40. package/dist/{diag-doctor-OQ3AA63O.js → diag-doctor-ZF5BF2MK.js} +2 -3
  41. package/dist/execute-deps.d.ts +1 -1
  42. package/dist/{execution-CQ772VPS.js → execution-LZRYRGDD.js} +234 -143
  43. package/dist/{export-DOBGPY23.js → export-CCUXRJOU.js} +3 -11
  44. package/dist/fleet/host-supervisor.d.ts +1 -1
  45. package/dist/fleet/host.d.ts +1 -1
  46. package/dist/fleet/routing.d.ts +1 -2
  47. package/dist/goal-host.d.ts +2 -2
  48. package/dist/hooks-wiring.d.ts +1 -1
  49. package/dist/{hq-LN5CJHCM.js → hq-AHPAE7EN.js} +104 -55
  50. package/dist/hq-command-controller.d.ts +1 -1
  51. package/dist/hq-server/routes/system-handlers.d.ts +1 -2
  52. package/dist/hq-server/routes.d.ts +7 -7
  53. package/dist/{hq-server-S7HZG3PA.js → hq-server-KU2Z54QU.js} +2 -2
  54. package/dist/index.d.ts +1 -1
  55. package/dist/index.js +2635 -2642
  56. package/dist/mailbox-bridge-bootstrap.d.ts +2 -2
  57. package/dist/{mcp-OHPJH73U.js → mcp-E5EBGOHF.js} +6 -6
  58. package/dist/mcp-serve.d.ts +1 -1
  59. package/dist/{modeldiag-3DOK4BWW.js → modeldiag-SIVUOX2Y.js} +18 -13
  60. package/dist/{permissions-FNYLZIL4.js → permissions-2PWBL4YU.js} +5 -3
  61. package/dist/picker.d.ts +1 -1
  62. package/dist/plugin-management.d.ts +1 -1
  63. package/dist/{plugin-usage-YEVLOR33.js → plugin-usage-PTEETL3J.js} +2 -2
  64. package/dist/{plugins-K3BAUP4D.js → plugins-XRGWC3NJ.js} +3 -3
  65. package/dist/pre-launch.d.ts +2 -2
  66. package/dist/{providers-models-WEZ4EGLL.js → providers-models-VV74TRQ2.js} +86 -37
  67. package/dist/repl.d.ts +1 -1
  68. package/dist/{replay-FCBNHW3K.js → replay-WBRMEWQ5.js} +2 -2
  69. package/dist/{rewind-AOD3JIYX.js → rewind-7RE6ONIC.js} +17 -17
  70. package/dist/{sdd-runtime-AIJCJGWC.js → sdd-runtime-GFZ3NJKS.js} +2 -2
  71. package/dist/{sessions-config-XXN7267N.js → sessions-config-YX2ZPAFM.js} +36 -32
  72. package/dist/{simpleui-dist-JIFGUJO7.js → simpleui-dist-33VO3QHF.js} +9 -2
  73. package/dist/slash-commands/agents.d.ts +14 -0
  74. package/dist/slash-commands/command-context.d.ts +2 -3
  75. package/dist/slash-commands/helpers.d.ts +1 -1
  76. package/dist/slash-commands/index.d.ts +1 -1
  77. package/dist/slash-commands/intake.d.ts +10 -0
  78. package/dist/slash-commands/memory-triage.d.ts +1 -1
  79. package/dist/slash-commands/provider-status.d.ts +1 -1
  80. package/dist/subcommands/handlers/hq.d.ts +20 -0
  81. package/dist/subcommands/handlers/per-subcommand-help-data.d.ts +1 -1
  82. package/dist/{update-MV6TUACD.js → update-LTDJGAFU.js} +3 -3
  83. package/dist/{update-check-UMYTOH7Z.js → update-check-WARHSVZA.js} +2 -2
  84. package/dist/webui-server/connection-handler.d.ts +1 -1
  85. package/dist/webui-server/context-breakdown.d.ts +1 -1
  86. package/dist/webui-server/cost-helpers.d.ts +1 -1
  87. package/dist/webui-server/lifecycle.d.ts +1 -1
  88. package/dist/webui-server/prefs-seeding.d.ts +1 -1
  89. package/dist/webui-server/setup-events.d.ts +1 -1
  90. package/dist/webui-server/static-serve.d.ts +1 -1
  91. package/dist/{webui-server-NFNRGNNT.js → webui-server-E3OPEKU5.js} +18 -10
  92. package/dist/webui-server-options.d.ts +1 -1
  93. package/dist/wiring/command-host-state.d.ts +2 -2
  94. package/dist/wiring/controllers.d.ts +1 -2
  95. package/dist/wiring/dep-watcher.d.ts +1 -1
  96. package/dist/wiring/director-setup.d.ts +3 -3
  97. package/dist/wiring/eternal-command-handlers.d.ts +2 -2
  98. package/dist/wiring/management-tools.d.ts +2 -2
  99. package/dist/wiring/provider-runtime.d.ts +1 -1
  100. package/dist/wiring/provider-status.d.ts +1 -1
  101. package/dist/wiring/provider-utility-tools.d.ts +3 -3
  102. package/dist/wiring/provider.d.ts +1 -1
  103. package/dist/wiring/replay.d.ts +1 -1
  104. package/dist/wiring/runtime-controller-deps.d.ts +1 -1
  105. package/dist/wiring/runtime-dispatch-state.d.ts +1 -2
  106. package/dist/wiring/runtime-lifecycle-deps.d.ts +2 -2
  107. package/dist/wiring/runtime-picker-deps.d.ts +1 -2
  108. package/dist/wiring/sage.d.ts +1 -1
  109. package/dist/wiring/session-command-handlers.d.ts +1 -2
  110. package/dist/wiring/session.d.ts +6 -1
  111. package/dist/wiring/slash-commands.d.ts +2 -3
  112. package/package.json +23 -23
@@ -6,7 +6,7 @@ import {
6
6
  listHistory,
7
7
  restoreFromHistory,
8
8
  restoreLast
9
- } from "./chunk-263G3FMB.js";
9
+ } from "./chunk-B4JLSXZB.js";
10
10
  import {
11
11
  activeProfileConfigPath
12
12
  } from "./chunk-YMXXOOFN.js";
@@ -50,35 +50,37 @@ async function listFleetRuns(deps) {
50
50
  }
51
51
  const runs = [];
52
52
  const perEntry = await Promise.all(
53
- entries.map(async (id) => {
54
- const runDir = path.join(deps.paths.projectSessions, id);
55
- try {
56
- const stat2 = await fsp.stat(runDir);
57
- if (!stat2.isDirectory()) return null;
58
- } catch {
59
- return null;
53
+ entries.map(
54
+ async (id) => {
55
+ const runDir = path.join(deps.paths.projectSessions, id);
56
+ try {
57
+ const stat2 = await fsp.stat(runDir);
58
+ if (!stat2.isDirectory()) return null;
59
+ } catch {
60
+ return null;
61
+ }
62
+ const [manifestResult, checkpointResult, subagentFilesResult] = await Promise.all([
63
+ fsp.access(path.join(runDir, "fleet.json")).then(
64
+ () => true,
65
+ () => false
66
+ ),
67
+ fsp.access(path.join(runDir, "checkpoint.json")).then(
68
+ () => true,
69
+ () => false
70
+ ),
71
+ fsp.readdir(path.join(runDir, "subagents")).then(
72
+ (files) => files.filter((f) => f.endsWith(".jsonl")).length,
73
+ () => 0
74
+ )
75
+ ]);
76
+ return {
77
+ id,
78
+ manifest: manifestResult,
79
+ checkpoint: checkpointResult,
80
+ subagents: subagentFilesResult
81
+ };
60
82
  }
61
- const [manifestResult, checkpointResult, subagentFilesResult] = await Promise.all([
62
- fsp.access(path.join(runDir, "fleet.json")).then(
63
- () => true,
64
- () => false
65
- ),
66
- fsp.access(path.join(runDir, "checkpoint.json")).then(
67
- () => true,
68
- () => false
69
- ),
70
- fsp.readdir(path.join(runDir, "subagents")).then(
71
- (files) => files.filter((f) => f.endsWith(".jsonl")).length,
72
- () => 0
73
- )
74
- ]);
75
- return {
76
- id,
77
- manifest: manifestResult,
78
- checkpoint: checkpointResult,
79
- subagents: subagentFilesResult
80
- };
81
- })
83
+ )
82
84
  );
83
85
  for (const r of perEntry) if (r) runs.push(r);
84
86
  if (runs.length === 0) {
@@ -288,8 +290,10 @@ var sessionsCmd = async (args, deps) => {
288
290
  );
289
291
  return 0;
290
292
  } catch (err) {
291
- deps.renderer.writeError(`Fork failed: ${err instanceof Error ? err.message : String(err)}
292
- `);
293
+ deps.renderer.writeError(
294
+ `Fork failed: ${err instanceof Error ? err.message : String(err)}
295
+ `
296
+ );
293
297
  return 1;
294
298
  }
295
299
  }
@@ -411,4 +415,4 @@ export {
411
415
  configCmd,
412
416
  sessionsCmd
413
417
  };
414
- //# sourceMappingURL=sessions-config-XXN7267N.js.map
418
+ //# sourceMappingURL=sessions-config-YX2ZPAFM.js.map
@@ -51,7 +51,14 @@ async function ensureSimpleUiDistDir(deps = {}) {
51
51
  return path.resolve(pkgDir, "..", "..");
52
52
  });
53
53
  const workspaceRoot = findRoot(packageDir);
54
- console.warn(JSON.stringify({ level: "warn", event: "simpleui.auto_build", message: "Frontend not built \u2014 building now", timestamp: (/* @__PURE__ */ new Date()).toISOString() }));
54
+ console.warn(
55
+ JSON.stringify({
56
+ level: "warn",
57
+ event: "simpleui.auto_build",
58
+ message: "Frontend not built \u2014 building now",
59
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
60
+ })
61
+ );
55
62
  const runBuild = deps.runBuild ?? ((cwd) => runPnpmBuild(cwd, "@wrongstack/simpleui", 12e4));
56
63
  try {
57
64
  await runBuild(workspaceRoot);
@@ -90,4 +97,4 @@ export {
90
97
  ensureSimpleUiDistDir,
91
98
  resolveSimpleUiDistDir
92
99
  };
93
- //# sourceMappingURL=simpleui-dist-JIFGUJO7.js.map
100
+ //# sourceMappingURL=simpleui-dist-33VO3QHF.js.map
@@ -1,3 +1,17 @@
1
+ /**
2
+ * `/agents` — agent monitoring and timeline streaming commands.
3
+ *
4
+ * Commands:
5
+ * /agents — Show legacy subagent status
6
+ * /agents help — Show detailed help
7
+ * /agents chat off|full — Fleet-chat verbosity for the main chat
8
+ * /agents chat status — Show current fleet-chat verbosity
9
+ * /agents stream on — Show agent conversations in the main chat timeline
10
+ * /agents stream off — Hide agent conversations from the main chat
11
+ * /agents stream status — Show current stream state
12
+ * /agents list — List all active subagents
13
+ * /agents show <id> — Show transcript for a specific agent
14
+ */
1
15
  import type { SlashCommand } from '@wrongstack/core/types';
2
16
  import type { SlashCommandContext } from './command-context.js';
3
17
  export declare function buildAgentsCommand(opts: SlashCommandContext): SlashCommand;
@@ -1,9 +1,8 @@
1
- import type { CompactReport, HealthRegistry, MemoryPort, MetricsRuntimeStatus, MetricsSink, ModeStore, Renderer, SkillLoader, TokenCounter } from '@wrongstack/core/types';
2
- import type { WstackPaths } from '@wrongstack/core/utils';
3
1
  import type { Context } from '@wrongstack/core/agent';
4
2
  import type { EventBus } from '@wrongstack/core/kernel';
5
- import type { SessionStore } from '@wrongstack/core/types';
6
3
  import type { SlashCommandRegistry, ToolRegistry } from '@wrongstack/core/registry';
4
+ import type { CompactReport, HealthRegistry, MemoryPort, MetricsRuntimeStatus, MetricsSink, ModeStore, Renderer, SessionStore, SkillLoader, TokenCounter } from '@wrongstack/core/types';
5
+ import type { WstackPaths } from '@wrongstack/core/utils';
7
6
  /** Host capabilities supplied to command adapters. */
8
7
  export interface SlashCommandContext {
9
8
  registry: SlashCommandRegistry;
@@ -1,6 +1,6 @@
1
1
  import type { Context } from '@wrongstack/core/agent';
2
- export { detectProjectFacts, renderAgentsTemplate } from '../services/project-facts.js';
3
2
  export type { ProjectFacts } from '../services/project-facts.js';
3
+ export { detectProjectFacts, renderAgentsTemplate } from '../services/project-facts.js';
4
4
  /**
5
5
  * Parse a slash command's args string into subcommand + rest tokens.
6
6
  *
@@ -1,7 +1,7 @@
1
1
  import type { SlashCommand } from '@wrongstack/core/types';
2
2
  import type { SlashCommandContext } from './command-context.js';
3
- export type { TokenCounter } from '@wrongstack/core/types';
4
3
  export type { ToolRegistry } from '@wrongstack/core/registry';
4
+ export type { TokenCounter } from '@wrongstack/core/types';
5
5
  export type { SlashCommandContext } from './command-context.js';
6
6
  export type { ProjectFacts } from './helpers.js';
7
7
  export { detectProjectFacts, renderAgentsTemplate } from './helpers.js';
@@ -1,3 +1,13 @@
1
+ /**
2
+ * `/intake [text]` — create and submit a requirement intake record from the
3
+ * current prompt.
4
+ *
5
+ * With no arguments it uses the most recent user prompt in the live session;
6
+ * with text it uses that verbatim. The exact text becomes the record's
7
+ * immutable `originalRequest`. Records are stored under the project's
8
+ * `.wrongstack` state dir (`~/.wrongstack/projects/<slug>/requirement-intakes`)
9
+ * and are ready for downstream modules (SDD interview kickoff, planning).
10
+ */
1
11
  import type { SlashCommand } from '@wrongstack/core/types';
2
12
  import type { SlashCommandContext } from './command-context.js';
3
13
  export declare function buildIntakeCommand(opts: SlashCommandContext): SlashCommand;
@@ -19,7 +19,7 @@
19
19
  * `/memory compact`. Falls back to a no-op LLM if the provider is absent
20
20
  * (Phase 3 and 4 will degrade to skip-only; report is still useful).
21
21
  */
22
- import type { SageSurface, CreateCandidateInput } from '@wrongstack/sage';
22
+ import type { CreateCandidateInput, SageSurface } from '@wrongstack/sage';
23
23
  import { type TriageReport } from '@wrongstack/sage';
24
24
  import type { SlashCommandContext } from './command-context.js';
25
25
  export declare function runTriageCommand(opts: SlashCommandContext, args: string[]): Promise<{
@@ -17,7 +17,7 @@
17
17
  * /provider-status clear <provider> <model> Reset one pair
18
18
  * /provider-status retry <provider> <model> Release one pair for a half-open probe
19
19
  */
20
- import type { SlashCommand } from '@wrongstack/core/types';
21
20
  import type { ProviderModelStatusTracker } from '@wrongstack/core/coordination';
21
+ import type { SlashCommand } from '@wrongstack/core/types';
22
22
  export declare function buildProviderStatusCommand(tracker: ProviderModelStatusTracker): SlashCommand;
23
23
  //# sourceMappingURL=provider-status.d.ts.map
@@ -1,3 +1,23 @@
1
+ /**
2
+ * `wstack hq` subcommand group — HQ command center lifecycle + browser
3
+ * token management.
4
+ *
5
+ * Subcommand tree:
6
+ * wstack hq → start HQ server (alias for `wstack --hq`)
7
+ * wstack hq serve → start HQ server (explicit form)
8
+ * wstack hq token create [label] [--ttl <duration>] → mint a browser token, write auth.json
9
+ * wstack hq token create --client [label] [--ttl <duration>] → mint a client token (/ws/client)
10
+ * wstack hq token list → list issued browser tokens
11
+ * wstack hq token list --client → list issued client tokens
12
+ * wstack hq token revoke <id> → revoke a browser token (prefix match)
13
+ * wstack hq token revoke --client <id> → revoke a client token
14
+ *
15
+ * All subcommands accept `--data-dir <path>` to override the HQ data
16
+ * directory (default `~/.wrongstack/hq`, honors `WRONGSTACK_HOME` /
17
+ * `WRONGSTACK_HQ_DATA_DIR`).
18
+ *
19
+ * @module subcommands/handlers/hq
20
+ */
1
21
  import type { SubcommandHandler } from '../index.js';
2
22
  export { resolveAuditActor } from '../../hq-server/audit-actor.js';
3
23
  export declare const hqCmd: SubcommandHandler;
@@ -1,3 +1,3 @@
1
- export { helpTable } from './per-subcommand-help-table.js';
2
1
  export { deepHelpTable } from './per-subcommand-deep-help-table.js';
2
+ export { helpTable } from './per-subcommand-help-table.js';
3
3
  //# sourceMappingURL=per-subcommand-help-data.d.ts.map
@@ -3,9 +3,9 @@ import {
3
3
  detectUpdatePackageName,
4
4
  runUpdateCommand,
5
5
  updateCmd
6
- } from "./chunk-I5MEUFDI.js";
6
+ } from "./chunk-BXQG3H2Y.js";
7
7
  import "./chunk-U3SS4NRH.js";
8
- import "./chunk-F4PEGAJZ.js";
8
+ import "./chunk-NUIHRGPY.js";
9
9
  import "./chunk-7OCVIDC7.js";
10
10
  export {
11
11
  detectUpdatePackageManager,
@@ -13,4 +13,4 @@ export {
13
13
  runUpdateCommand,
14
14
  updateCmd
15
15
  };
16
- //# sourceMappingURL=update-MV6TUACD.js.map
16
+ //# sourceMappingURL=update-LTDJGAFU.js.map
@@ -5,7 +5,7 @@ import {
5
5
  fetchLatestFromNpm,
6
6
  getUpdateNotification,
7
7
  isNewer
8
- } from "./chunk-F4PEGAJZ.js";
8
+ } from "./chunk-NUIHRGPY.js";
9
9
  import "./chunk-7OCVIDC7.js";
10
10
  export {
11
11
  cachePath,
@@ -15,4 +15,4 @@ export {
15
15
  getUpdateNotification,
16
16
  isNewer
17
17
  };
18
- //# sourceMappingURL=update-check-UMYTOH7Z.js.map
18
+ //# sourceMappingURL=update-check-WARHSVZA.js.map
@@ -27,7 +27,7 @@ export interface ConnectionHandlerDeps {
27
27
  sessionId: string;
28
28
  };
29
29
  handleMessage: (ws: WebSocket, client: ConnectedClient, msg: WSClientMessage) => Promise<void>;
30
- abortControllers: Map<WebSocket, AbortController>;
30
+ abortControllers: Map<string, AbortController>;
31
31
  pendingConfirms: Map<string, PendingConfirm>;
32
32
  buildSessionStartPayload: (overrides?: Record<string, unknown>, needsSetup?: boolean) => Promise<Record<string, unknown>>;
33
33
  loadReplay?: (() => Promise<{
@@ -1,2 +1,2 @@
1
- export { estimateContextBreakdown, type ContextBreakdown } from '@wrongstack/webui-server';
1
+ export { type ContextBreakdown, estimateContextBreakdown } from '@wrongstack/webui-server';
2
2
  //# sourceMappingURL=context-breakdown.d.ts.map
@@ -1,2 +1,2 @@
1
- export { computeUsageCost, getCostRates, type CostRates, type TokenUsage, } from '@wrongstack/webui-server';
1
+ export { type CostRates, computeUsageCost, getCostRates, type TokenUsage, } from '@wrongstack/webui-server';
2
2
  //# sourceMappingURL=cost-helpers.d.ts.map
@@ -1,3 +1,3 @@
1
- export { announceWebuiReady, createWebuiShutdown, registerWebuiInstance, registerWebuiSignalHandlers, type AnnounceWebuiReadyParams, type RegisterWebuiInstanceDeps, type RegisterWebuiInstanceParams, type WebuiShutdownResources, } from '@wrongstack/webui-server';
2
1
  export type { WebUIInstanceRecord } from '@wrongstack/webui-server';
2
+ export { type AnnounceWebuiReadyParams, announceWebuiReady, createWebuiShutdown, type RegisterWebuiInstanceDeps, type RegisterWebuiInstanceParams, registerWebuiInstance, registerWebuiSignalHandlers, type WebuiShutdownResources, } from '@wrongstack/webui-server';
3
3
  //# sourceMappingURL=lifecycle.d.ts.map
@@ -1,5 +1,5 @@
1
- import type { Config } from '@wrongstack/core/types';
2
1
  import type { ModelBlackoutRule } from '@wrongstack/core/models';
2
+ import type { Config } from '@wrongstack/core/types';
3
3
  import { PREF_KEYS } from '@wrongstack/webui-server';
4
4
  interface CliWebUIOptions {
5
5
  agent: {
@@ -1,6 +1,6 @@
1
1
  import type { Context } from '@wrongstack/core/agent';
2
- import type { EventBus } from '@wrongstack/core/kernel';
3
2
  import type { JournalEntry } from '@wrongstack/core/goal';
3
+ import type { EventBus } from '@wrongstack/core/kernel';
4
4
  import type { SecretScrubber } from '@wrongstack/core/types';
5
5
  import { createEternalSubscription, type PendingConfirm } from '@wrongstack/webui-server';
6
6
  import type { StreamCoalescer } from './stream-coalescer.js';
@@ -1,2 +1,2 @@
1
- export { ensureDistDir, resolveDistDir, startStaticServe, type EnsureDistDeps, type ResolveDistOptions, type StaticServeDeps, type StaticServeHandle, type StaticServeOptions, } from '@wrongstack/webui-server';
1
+ export { type EnsureDistDeps, ensureDistDir, type ResolveDistOptions, resolveDistDir, type StaticServeDeps, type StaticServeHandle, type StaticServeOptions, startStaticServe, } from '@wrongstack/webui-server';
2
2
  //# sourceMappingURL=static-serve.d.ts.map
@@ -3,17 +3,17 @@ import {
3
3
  } from "./chunk-VCYZ3WZV.js";
4
4
  import {
5
5
  createHqCommandDispatcher
6
- } from "./chunk-OP47B3IX.js";
6
+ } from "./chunk-7YLN7YUA.js";
7
7
  import {
8
8
  startCliHqConnection
9
9
  } from "./chunk-JW75HY4F.js";
10
10
  import {
11
11
  WEBUI_SESSION_CHILD_CAPABILITIES
12
- } from "./chunk-PFVVUH5B.js";
12
+ } from "./chunk-3JPTNADJ.js";
13
13
  import {
14
14
  loadConfigProviders,
15
15
  mutateConfigProviders
16
- } from "./chunk-PJHET45A.js";
16
+ } from "./chunk-SZ42FYPT.js";
17
17
  import "./chunk-7OCVIDC7.js";
18
18
 
19
19
  // src/webui-server.ts
@@ -44,8 +44,8 @@ import {
44
44
  resolveAuthToken,
45
45
  SddBoardWebSocketHandler,
46
46
  SddWizardWebSocketHandler,
47
- sendSerialized,
48
47
  SpecsWebSocketHandler,
48
+ sendSerialized,
49
49
  TerminalWebSocketHandler,
50
50
  WorktreeWebSocketHandler
51
51
  } from "@wrongstack/webui-server";
@@ -155,7 +155,9 @@ function createConnectionHandler(deps) {
155
155
  send: deps.send,
156
156
  sessionPayload: deps.sessionPayload,
157
157
  rateLimitMax: deps.rateLimitMax,
158
- onClose: (ws) => deps.abortControllers.delete(ws),
158
+ onClose: (_ws, client) => {
159
+ if (client?.sessionId) deps.abortControllers.delete(client.sessionId);
160
+ },
159
161
  buildInitialPayload: async () => {
160
162
  const payload = { ...await deps.buildSessionStartPayload({}, deps.needsSetup) };
161
163
  try {
@@ -463,7 +465,11 @@ function createNodePtyLoader(importMetaUrl, logger) {
463
465
  logger.debug?.(`[terminal] direct require failed: ${err.message}`);
464
466
  }
465
467
  try {
466
- const cliPkgJson = path.join(path.dirname(fileURLToPath(importMetaUrl)), "..", "package.json");
468
+ const cliPkgJson = path.join(
469
+ path.dirname(fileURLToPath(importMetaUrl)),
470
+ "..",
471
+ "package.json"
472
+ );
467
473
  let dir = path.dirname(cliPkgJson);
468
474
  for (let i = 0; i < 6; i++) {
469
475
  const candidate = path.join(dir, "node_modules", "node-pty");
@@ -482,7 +488,9 @@ function createNodePtyLoader(importMetaUrl, logger) {
482
488
  logger.debug?.(`[terminal] workspace-root walk failed: ${err.message}`);
483
489
  }
484
490
  cachedNodePty = null;
485
- logger.debug?.('[terminal] node-pty resolution failed; terminal panel will report "unavailable"');
491
+ logger.debug?.(
492
+ '[terminal] node-pty resolution failed; terminal panel will report "unavailable"'
493
+ );
486
494
  return cachedNodePty;
487
495
  };
488
496
  }
@@ -494,8 +502,8 @@ import { DefaultSecretVault } from "@wrongstack/core/security";
494
502
  import {
495
503
  PREF_KEYS,
496
504
  persistPrefsToConfig,
497
- prefSnapshot as snapshotPrefs,
498
- seedContextMeta
505
+ seedContextMeta,
506
+ prefSnapshot as snapshotPrefs
499
507
  } from "@wrongstack/webui-server";
500
508
  async function seedConfigToMeta(opts) {
501
509
  let config = opts.appConfig;
@@ -1583,4 +1591,4 @@ async function runWebUI(opts) {
1583
1591
  export {
1584
1592
  runWebUI
1585
1593
  };
1586
- //# sourceMappingURL=webui-server-NFNRGNNT.js.map
1594
+ //# sourceMappingURL=webui-server-E3OPEKU5.js.map
@@ -1,11 +1,11 @@
1
1
  import type { Agent } from '@wrongstack/core/agent';
2
2
  import type { BrainArbiter } from '@wrongstack/core/coordination';
3
- import type { WebuiSessionChildOptions } from './boot/webui-session-child.js';
4
3
  import type { BrainAutoRisk } from '@wrongstack/core/execution';
5
4
  import type { EventBus } from '@wrongstack/core/kernel';
6
5
  import type { TrustBoundary } from '@wrongstack/core/security';
7
6
  import type { MemoryPort, ModelsRegistry, ModeStore, PromptLoader, SessionStore, SessionWriter, SkillLoader } from '@wrongstack/core/types';
8
7
  import type { MCPRegistry } from '@wrongstack/mcp';
8
+ import type { WebuiSessionChildOptions } from './boot/webui-session-child.js';
9
9
  /**
10
10
  * CLI-shaped webui options. Distinct from the standalone
11
11
  * `WebUIOptions` exported by `@wrongstack/webui-server` (which is the
@@ -1,12 +1,12 @@
1
1
  /** Mutable command-host state created after the runtime fleet is available. */
2
- import { type Config, type SessionWriter } from '@wrongstack/core/types';
3
2
  import type { BrainArbiter, Director } from '@wrongstack/core/coordination';
4
3
  import type { EventBus } from '@wrongstack/core/kernel';
4
+ import { type Config, type SessionWriter } from '@wrongstack/core/types';
5
5
  import type { WstackPaths } from '@wrongstack/core/utils';
6
6
  import { SddRunRegistry } from '@wrongstack/sdd';
7
7
  import type { HqCommandController } from '../hq-command-controller.js';
8
- import type { MultiAgentHost } from '../multi-agent.js';
9
8
  import type { ReadlineInputReader } from '../input-reader.js';
9
+ import type { MultiAgentHost } from '../multi-agent.js';
10
10
  import type { TerminalRenderer } from '../renderer.js';
11
11
  export interface CommandHostStateInput {
12
12
  getConfig: () => Config;
@@ -7,8 +7,7 @@
7
7
  * Step 2 of the cli-main/ExecutionDeps refactor plan:
8
8
  * docs/plans/cli-main-executiondeps-refactor.md
9
9
  */
10
- import type { Config } from '@wrongstack/core/types';
11
- import type { FleetChatVerbosity } from '@wrongstack/core/types';
10
+ import type { Config, FleetChatVerbosity } from '@wrongstack/core/types';
12
11
  import type { StatuslineConfigKey } from '../services/statusline-config.js';
13
12
  import { type StatuslineConfig } from '../services/statusline-config.js';
14
13
  export interface FleetStreamController {
@@ -1,5 +1,5 @@
1
- import type { EventBus } from '@wrongstack/core/kernel';
2
1
  import type { DefaultLogger } from '@wrongstack/core/infrastructure';
2
+ import type { EventBus } from '@wrongstack/core/kernel';
3
3
  import type { MultiAgentHost } from '../multi-agent.js';
4
4
  export interface SetupDepWatcherConsumersDeps {
5
5
  dwCfg: Record<string, unknown> | undefined;
@@ -1,8 +1,8 @@
1
- import type { AutonomyStage, Config, SessionWriter } from '@wrongstack/core/types';
2
1
  import type { Director } from '@wrongstack/core/coordination';
3
- import type { EventBus } from '@wrongstack/core/kernel';
4
- import type { EternalAutonomyEngine, ParallelEternalEngine } from '@wrongstack/core/execution';
5
2
  import { type AgentMonitorService } from '@wrongstack/core/coordination';
3
+ import type { EternalAutonomyEngine, ParallelEternalEngine } from '@wrongstack/core/execution';
4
+ import type { EventBus } from '@wrongstack/core/kernel';
5
+ import type { AutonomyStage, Config, SessionWriter } from '@wrongstack/core/types';
6
6
  import type { WstackPaths } from '@wrongstack/core/utils';
7
7
  /**
8
8
  * Persistent ref for autonomy mode — set once here, read elsewhere via
@@ -1,10 +1,10 @@
1
1
  /** Eternal/autonomy slash-command adapters. */
2
2
  import type { Agent } from '@wrongstack/core/agent';
3
- import type { AutonomyStage, Compactor, Config } from '@wrongstack/core/types';
4
3
  import type { BrainArbiter } from '@wrongstack/core/coordination';
5
4
  import { EternalAutonomyEngine, ParallelEternalEngine } from '@wrongstack/core/execution';
6
- import type { EventBus } from '@wrongstack/core/kernel';
7
5
  import type { JournalEntry } from '@wrongstack/core/goal';
6
+ import type { EventBus } from '@wrongstack/core/kernel';
7
+ import type { AutonomyStage, Compactor, Config } from '@wrongstack/core/types';
8
8
  import type { MultiAgentHost } from '../multi-agent.js';
9
9
  import type { AutonomyMode } from '../services/autonomy-mode.js';
10
10
  import type { BuiltinSlashCommandDeps } from './slash-commands.js';
@@ -1,6 +1,6 @@
1
- import type { Config } from '@wrongstack/core/types';
2
- import { type PluginManagerHookRunner } from '@wrongstack/core/tools';
3
1
  import type { ToolRegistry } from '@wrongstack/core/registry';
2
+ import { type PluginManagerHookRunner } from '@wrongstack/core/tools';
3
+ import type { Config } from '@wrongstack/core/types';
4
4
  type ConfigStoreLike = {
5
5
  get(): Config;
6
6
  update(patch: Partial<Config>): void;
@@ -1,5 +1,5 @@
1
- import type { Config, Provider, ProviderConfig } from '@wrongstack/core/types';
2
1
  import type { ProviderRegistry } from '@wrongstack/core/registry';
2
+ import type { Config, Provider, ProviderConfig } from '@wrongstack/core/types';
3
3
  /**
4
4
  * Resolve the user-visible providerId into a runtime cfg + a factory type
5
5
  * for catalog lookups. Single source of truth for how a saved-config
@@ -1,6 +1,6 @@
1
- import type { EventBus } from '@wrongstack/core/kernel';
2
1
  import type { FallbackProfileManager } from '@wrongstack/core/agent';
3
2
  import { ProviderModelStatusTracker } from '@wrongstack/core/coordination';
3
+ import type { EventBus } from '@wrongstack/core/kernel';
4
4
  import type { WstackPaths } from '@wrongstack/core/utils';
5
5
  export interface ProviderStatusInput {
6
6
  events: EventBus;
@@ -1,10 +1,10 @@
1
1
  /** Registers provider-neutral one-shot, council, and context-summary tools. */
2
- import type { Config, CouncilToolConfig, OneShotModelRouter, Provider } from '@wrongstack/core/types';
3
- import { createContextManagerTool } from '@wrongstack/core/infrastructure';
4
2
  import type { FallbackProfileManager } from '@wrongstack/core/agent';
5
- import { type CouncilPersonaRegistry, type CouncilProfileRegistry } from '@wrongstack/core/execution';
6
3
  import type { ProviderModelStatusTracker } from '@wrongstack/core/coordination';
4
+ import { type CouncilPersonaRegistry, type CouncilProfileRegistry } from '@wrongstack/core/execution';
5
+ import { createContextManagerTool } from '@wrongstack/core/infrastructure';
7
6
  import type { ToolRegistry } from '@wrongstack/core/registry';
7
+ import type { Config, CouncilToolConfig, OneShotModelRouter, Provider } from '@wrongstack/core/types';
8
8
  export interface ProviderUtilityToolsInput {
9
9
  toolRegistry: ToolRegistry;
10
10
  buildProvider: (providerId: string) => Provider;
@@ -1,6 +1,6 @@
1
+ import { ProviderRegistry } from '@wrongstack/core/registry';
1
2
  import type { ResolvedProvider } from '@wrongstack/core/types';
2
3
  import { type Config, type Logger, type ModelsRegistry } from '@wrongstack/core/types';
3
- import { ProviderRegistry } from '@wrongstack/core/registry';
4
4
  export interface ProviderSetupResult {
5
5
  resolvedProvider: ResolvedProvider | undefined;
6
6
  provider: ReturnType<ProviderRegistry['create']>;
@@ -1,6 +1,6 @@
1
1
  import { type Container } from '@wrongstack/core/kernel';
2
- import type { Logger } from '@wrongstack/core/types';
3
2
  import { type ReplayMode } from '@wrongstack/core/replay';
3
+ import type { Logger } from '@wrongstack/core/types';
4
4
  import type { WstackPaths } from '@wrongstack/core/utils';
5
5
  /**
6
6
  * Bind a `ReplayProviderRunner` into the container under
@@ -1,8 +1,8 @@
1
1
  /** Builds live controller callbacks for the running CLI session. */
2
2
  import type { Agent, Context } from '@wrongstack/core/agent';
3
+ import type { EventBus } from '@wrongstack/core/kernel';
3
4
  import type { AuditLevel } from '@wrongstack/core/storage';
4
5
  import type { Config, LogLevel, Provider } from '@wrongstack/core/types';
5
- import type { EventBus } from '@wrongstack/core/kernel';
6
6
  import type { ControllerDeps } from '../execute-deps.js';
7
7
  import type { AutonomyMode } from '../services/autonomy-mode.js';
8
8
  export interface RuntimeControllerDepsInput {
@@ -1,9 +1,8 @@
1
1
  /** Final runtime preparation before a CLI surface is dispatched. */
2
2
  import type { Agent, Context } from '@wrongstack/core/agent';
3
- import type { Config, MemoryPort } from '@wrongstack/core/types';
4
- import type { ConfigStore } from '@wrongstack/core/types';
5
3
  import type { EventBus } from '@wrongstack/core/kernel';
6
4
  import type { ToolRegistry } from '@wrongstack/core/registry';
5
+ import type { Config, ConfigStore, MemoryPort } from '@wrongstack/core/types';
7
6
  import type { PluginPickerItem, ToolPickerItem } from '../execute-deps.js';
8
7
  import { setupSage } from './sage.js';
9
8
  export interface RuntimeDispatchStateInput {
@@ -1,9 +1,9 @@
1
1
  /** Runtime lifecycle callbacks shared by CLI execution surfaces. */
2
- import type { AutonomyStage, Config } from '@wrongstack/core/types';
3
- import type { JournalEntry } from '@wrongstack/core/goal';
4
2
  import type { Context } from '@wrongstack/core/agent';
5
3
  import type { EternalAutonomyEngine, ParallelEternalEngine } from '@wrongstack/core/execution';
4
+ import type { JournalEntry } from '@wrongstack/core/goal';
6
5
  import type { EventBus } from '@wrongstack/core/kernel';
6
+ import type { AutonomyStage, Config } from '@wrongstack/core/types';
7
7
  import type { SddRunRegistry } from '@wrongstack/sdd';
8
8
  import type { LifecycleDeps } from '../execute-deps.js';
9
9
  import type { SessionStats } from '../session-stats.js';
@@ -1,6 +1,5 @@
1
- import type { Config } from '@wrongstack/core/types';
2
- import type { ConfigStore } from '@wrongstack/core/types';
3
1
  import type { ToolRegistry } from '@wrongstack/core/registry';
2
+ import type { Config, ConfigStore } from '@wrongstack/core/types';
4
3
  import type { MCPRegistry } from '@wrongstack/mcp';
5
4
  import type { PickerDeps, PluginPickerItem, ToolPickerItem } from '../execute-deps.js';
6
5
  export interface RuntimePickerDepsInput {
@@ -1,6 +1,6 @@
1
1
  import type { AgentPipelines } from '@wrongstack/core/agent';
2
- import type { Config, Logger, MemoryPort } from '@wrongstack/core/types';
3
2
  import type { EventBus } from '@wrongstack/core/kernel';
3
+ import type { Config, Logger, MemoryPort } from '@wrongstack/core/types';
4
4
  export interface SageWiringDeps {
5
5
  config: Config;
6
6
  pipelines: AgentPipelines;
@@ -1,8 +1,7 @@
1
- import type { Config, TokenCounter } from '@wrongstack/core/types';
2
- import type { ConfigStore } from '@wrongstack/core/types';
3
1
  import type { Context } from '@wrongstack/core/agent';
4
2
  import type { EventBus } from '@wrongstack/core/kernel';
5
3
  import type { ToolRegistry } from '@wrongstack/core/registry';
4
+ import type { Config, ConfigStore, TokenCounter } from '@wrongstack/core/types';
6
5
  import type { MCPRegistry } from '@wrongstack/mcp';
7
6
  import type { MultiAgentHost } from '../multi-agent.js';
8
7
  import type { SessionStats } from '../session-stats.js';
@@ -47,6 +47,11 @@ export interface SessionResult {
47
47
  resumedModel?: string | undefined;
48
48
  resumedProvider?: string | undefined;
49
49
  }
50
+ export interface SessionClaimHandle {
51
+ rollback(): Promise<void>;
52
+ /** Convert the pre-hydration reservation into the live writer lease. */
53
+ activate(): Promise<void>;
54
+ }
50
55
  export declare function setupSession(params: {
51
56
  config: {
52
57
  model: string;
@@ -74,7 +79,7 @@ export declare function setupSession(params: {
74
79
  * Atomically reserve an explicitly resumed session in the cross-process
75
80
  * SessionRegistry. Returns a rollback used when loading the session fails.
76
81
  */
77
- claimSession?: ((sessionId: string) => Promise<() => Promise<void>>) | undefined;
82
+ claimSession?: ((sessionId: string) => Promise<SessionClaimHandle | (() => Promise<void>)>) | undefined;
78
83
  /** Optional EventBus for emitting storage.* events from todo/queue/task stores. */
79
84
  events?: import('@wrongstack/core/kernel').EventBus;
80
85
  /** Logger for structured storage warnings. */