@wrongstack/cli 1.1.4 → 1.1.6

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 (103) hide show
  1. package/dist/{acp-MZ5MQBFN.js → acp-CZBSFQB7.js} +6 -5
  2. package/dist/acp-leader/acp-leader-confirm.d.ts +2 -0
  3. package/dist/acp-leader/acp-leader-host-binding.d.ts +1 -0
  4. package/dist/acp-leader/acp-leader-host.d.ts +9 -0
  5. package/dist/acp-leader/acp-leader-picker.d.ts +6 -3
  6. package/dist/acp-leader/acp-leader-provider.d.ts +10 -0
  7. package/dist/acp-leader/acp-leader-skills.d.ts +5 -0
  8. package/dist/acp-leader/acp-leader-stream.d.ts +9 -0
  9. package/dist/{auth-IHQS6AFW.js → auth-2ZG5DBHS.js} +4 -4
  10. package/dist/boot/launch-menu-arrow.d.ts +20 -0
  11. package/dist/boot/launch-menu-types.d.ts +36 -0
  12. package/dist/boot/launch-menu.d.ts +1 -57
  13. package/dist/boot/tui-session-resume-rollback.d.ts +31 -0
  14. package/dist/{boot-auto-thin-7D4OVEWA.js → boot-auto-thin-N2CIGTXE.js} +3 -3
  15. package/dist/{chunk-TZPKOS5G.js → chunk-2XQ6SRKG.js} +2 -2
  16. package/dist/{chunk-3EXRPTAU.js → chunk-5TQ65PXQ.js} +17 -17
  17. package/dist/{chunk-VAQXOZKP.js → chunk-AJM4EFCM.js} +139 -136
  18. package/dist/{chunk-C2BBH4S4.js → chunk-E3MJFAFR.js} +2 -2
  19. package/dist/{chunk-COGI7EQU.js → chunk-EAATL6FL.js} +713 -21
  20. package/dist/{chunk-AWRZWPJ3.js → chunk-FWUIKCCO.js} +152 -123
  21. package/dist/{chunk-TAE3EGBM.js → chunk-H5DCQFUI.js} +5 -5
  22. package/dist/{chunk-BIGSVBPI.js → chunk-KNYIEQAY.js} +64 -61
  23. package/dist/chunk-LYWOV4OX.js +252 -0
  24. package/dist/{chunk-75OLD563.js → chunk-M7PSENGF.js} +3 -1
  25. package/dist/{chunk-I5LJLKA3.js → chunk-MKMM5RIW.js} +12 -5
  26. package/dist/{chunk-ZF4HRR5F.js → chunk-P7MEEUGT.js} +275 -250
  27. package/dist/chunk-PGC44T7N.js +255 -0
  28. package/dist/chunk-QLYPIJ7X.js +258 -0
  29. package/dist/{chunk-JKTJSLUT.js → chunk-QRWXHGLB.js} +242 -18
  30. package/dist/chunk-RN5CFAVQ.js +292 -0
  31. package/dist/{chunk-WDXNBYGD.js → chunk-TDP7CZGE.js} +6 -1
  32. package/dist/{chunk-6VPWQ4TG.js → chunk-UROB7MK5.js} +2 -1
  33. package/dist/{chunk-IJLIAPCW.js → chunk-VPSAKGLK.js} +47 -47
  34. package/dist/{chunk-2LTHDKZX.js → chunk-W7X23HI6.js} +18 -18
  35. package/dist/{chunk-GKGWPFW2.js → chunk-X4DEQLAZ.js} +1 -1
  36. package/dist/{cli-context-E44HQ4ZO.js → cli-context-6KS3HV5R.js} +247 -236
  37. package/dist/{cli-main-OT63I2FX.js → cli-main-NF3YGDME.js} +1779 -1494
  38. package/dist/cli-main-boot.d.ts +1 -1
  39. package/dist/config-doctor-known-keys.d.ts +33 -0
  40. package/dist/config-doctor.d.ts +2 -47
  41. package/dist/config-history-support.d.ts +36 -0
  42. package/dist/config-history.d.ts +1 -1
  43. package/dist/{config-transfer-Y7XJMJRN.js → config-transfer-B4GOZTFC.js} +2 -2
  44. package/dist/{execution-OK34CJKJ.js → execution-RVDUXLNT.js} +6522 -6426
  45. package/dist/execution-tui.d.ts +30 -0
  46. package/dist/fleet/acp-wrongstack-bridge.d.ts +11 -3
  47. package/dist/fleet/host-acp.d.ts +3 -0
  48. package/dist/fleet/wrongforge-client.d.ts +116 -0
  49. package/dist/fleet/wrongforge-gateway.d.ts +20 -0
  50. package/dist/fleet/wrongforge-info.d.ts +32 -0
  51. package/dist/fleet/wrongforge-quota.d.ts +10 -0
  52. package/dist/fleet/wrongforge-runner.d.ts +37 -0
  53. package/dist/fleet/wrongforge-runtime.d.ts +10 -0
  54. package/dist/{hq-JD5AZVMG.js → hq-V2M4IYCI.js} +320 -306
  55. package/dist/hq-server/login-attempt-store.d.ts +2 -0
  56. package/dist/hq-server/sweeps.d.ts +28 -0
  57. package/dist/{hq-server-BI23EPM7.js → hq-server-QM7EIVGJ.js} +3 -3
  58. package/dist/index.js +5 -5
  59. package/dist/mcp-22CFBX4H.js +236 -0
  60. package/dist/mcp-serve.d.ts +0 -63
  61. package/dist/{modeldiag-HDIKG37X.js → modeldiag-5PBB777J.js} +4 -4
  62. package/dist/{per-subcommand-help-4GYSCMLU.js → per-subcommand-help-MQGERD4E.js} +2 -2
  63. package/dist/plugin-llm-command.d.ts +9 -0
  64. package/dist/{plugin-usage-TYF5HY4K.js → plugin-usage-UWKYMNQU.js} +3 -3
  65. package/dist/{plugins-XGAXDLPT.js → plugins-VP7JQH47.js} +4 -4
  66. package/dist/{sdd-runtime-6MFUXWJK.js → sdd-runtime-HIJ4Z5TF.js} +2 -2
  67. package/dist/services/sdd/state.d.ts +2 -0
  68. package/dist/session-event-wiring-types.d.ts +62 -0
  69. package/dist/session-event-wiring.d.ts +2 -52
  70. package/dist/{sessions-config-SJVQXCIE.js → sessions-config-7MK742OW.js} +2 -2
  71. package/dist/short-circuit-flags-276OLPIN.js +11 -0
  72. package/dist/slash-commands/command-context-fleet.d.ts +187 -0
  73. package/dist/slash-commands/command-context-sdd-goal.d.ts +102 -0
  74. package/dist/slash-commands/command-context.d.ts +3 -282
  75. package/dist/slash-commands/project-switch-interactive.d.ts +11 -0
  76. package/dist/slash-commands/setmodel-helpers.d.ts +36 -0
  77. package/dist/subcommands/handlers/hq-token.d.ts +3 -0
  78. package/dist/subcommands/handlers/hq.d.ts +0 -21
  79. package/dist/subcommands/handlers/per-subcommand-help-operations.d.ts +8 -0
  80. package/dist/subcommands/handlers/tools-cli-args.d.ts +57 -0
  81. package/dist/subcommands/handlers/tools-cli.d.ts +5 -0
  82. package/dist/subcommands/handlers/tools-serve.d.ts +4 -0
  83. package/dist/{subcommands-YADUV7IJ.js → subcommands-SKJPUJ7N.js} +2 -2
  84. package/dist/tool-gateway-http.d.ts +30 -0
  85. package/dist/tool-gateway.d.ts +185 -0
  86. package/dist/tools-cli-44MLIUQO.js +509 -0
  87. package/dist/tools-serve-TRCET2M7.js +102 -0
  88. package/dist/{tools-skills-55QVTMSK.js → tools-skills-WDTMCE46.js} +7 -2
  89. package/dist/tuneup-runtime-checks.d.ts +7 -0
  90. package/dist/tuneup-types.d.ts +118 -0
  91. package/dist/tuneup.d.ts +3 -122
  92. package/dist/{typesafe-YBEADNAH.js → typesafe-QLSMFU7J.js} +1 -1
  93. package/dist/{version-help-RBZC5GZZ.js → version-help-X6CC4CFY.js} +2 -2
  94. package/dist/{webui-server-CB64CFDG.js → webui-server-6I6QOECV.js} +44 -6
  95. package/dist/wiring/provider-runtime-setup.d.ts +3 -1
  96. package/dist/wiring/session-runtime.d.ts +1 -1
  97. package/dist/wrongforge-gateway-UOFBK56J.js +92 -0
  98. package/dist/wrongforge-leader/wrongforge-leader-gateway.d.ts +9 -0
  99. package/dist/wrongforge-leader/wrongforge-leader-picker.d.ts +12 -0
  100. package/dist/wrongforge-leader/wrongforge-leader-provider.d.ts +56 -0
  101. package/package.json +1 -1
  102. package/dist/mcp-W7A5HUXV.js +0 -560
  103. package/dist/short-circuit-flags-QEXUS3BY.js +0 -11
@@ -4,12 +4,13 @@ import {
4
4
  loadCachedAcpRegistry,
5
5
  refreshAcpRegistry,
6
6
  setupProvider
7
- } from "./chunk-COGI7EQU.js";
7
+ } from "./chunk-EAATL6FL.js";
8
8
  import {
9
9
  createHqCommandDispatcher,
10
10
  wrongstackBridgeSetup
11
- } from "./chunk-JKTJSLUT.js";
11
+ } from "./chunk-QRWXHGLB.js";
12
12
  import "./chunk-3LEIFO5D.js";
13
+ import "./chunk-PGC44T7N.js";
13
14
  import {
14
15
  startCliHqConnection
15
16
  } from "./chunk-76JE54WD.js";
@@ -17,7 +18,7 @@ import {
17
18
  WebSocketServer
18
19
  } from "./chunk-OZCYZYN2.js";
19
20
  import "./chunk-UFRVTBV6.js";
20
- import "./chunk-GKGWPFW2.js";
21
+ import "./chunk-X4DEQLAZ.js";
21
22
  import "./chunk-HKMOIIPQ.js";
22
23
  import "./chunk-W23PY4IJ.js";
23
24
 
@@ -1123,7 +1124,7 @@ var acpCmd = async (args, deps) => {
1123
1124
  const sub = args[0];
1124
1125
  const loginIndex = sub === "auth" ? 0 : (sub === "server" || sub === "serve") && args[1] === "auth" ? 1 : -1;
1125
1126
  if (loginIndex >= 0) {
1126
- const { authCmd } = await import("./auth-IHQS6AFW.js");
1127
+ const { authCmd } = await import("./auth-2ZG5DBHS.js");
1127
1128
  return authCmd(args.slice(loginIndex + 1), deps);
1128
1129
  }
1129
1130
  if (!sub || sub === "server" || sub === "serve") {
@@ -1204,4 +1205,4 @@ parallel:
1204
1205
  export {
1205
1206
  acpCmd
1206
1207
  };
1207
- //# sourceMappingURL=acp-MZ5MQBFN.js.map
1208
+ //# sourceMappingURL=acp-CZBSFQB7.js.map
@@ -11,6 +11,8 @@ export interface EventConfirmRequest {
11
11
  signal: AbortSignal;
12
12
  /** Where an "always" or "deny" answer is remembered, as for the leader's own tools. */
13
13
  permission?: Pick<PermissionPolicy, 'trust' | 'deny'> | undefined;
14
+ /** The context the policy evaluates the agent's calls in: an exact-input answer is keyed to it. */
15
+ context: Parameters<PermissionPolicy['evaluate']>[2];
14
16
  timeoutMs?: number | undefined;
15
17
  }
16
18
  /** Resolves true when the user approved the call. */
@@ -10,6 +10,7 @@ export interface AcpLeaderHostOptions {
10
10
  stateDir?: string | undefined;
11
11
  getConfig(): Config;
12
12
  getTool(name: string): Tool | undefined;
13
+ listTools?(): Tool[];
13
14
  confirmAwaiter?: ConfirmAwaiter | undefined;
14
15
  }
15
16
  export declare function createAcpLeaderHost(opts: AcpLeaderHostOptions): AcpLeaderHost;
@@ -28,6 +28,8 @@ export interface AcpLeaderHost {
28
28
  /** That agent's context, which the policy reads (files already read, the session). */
29
29
  context(sessionId?: string): Parameters<PermissionPolicy['evaluate']>[2];
30
30
  getTool(name: string): Tool | undefined;
31
+ /** Every tool the leader has (the WrongForge leader offers them over its gateway). */
32
+ listTools?(): Tool[];
31
33
  /**
32
34
  * Run one of the leader's tools as the leader would — the executor and
33
35
  * context of the agent running `sessionId`, so permissions, hooks, events
@@ -38,6 +40,13 @@ export interface AcpLeaderHost {
38
40
  runTool(name: string, input: Record<string, unknown>, run?: {
39
41
  sessionId?: string | undefined;
40
42
  approve?: ((tool: Tool, input: Record<string, unknown>) => Promise<boolean>) | undefined;
43
+ /**
44
+ * Settle the call's tool card here: no tool_result reaches the
45
+ * conversation, and the caller's own stream does not draw one (the
46
+ * WrongForge leader's `wstack_*` calls). An ACP agent reports its fleet
47
+ * calls itself, so its cards come from its stream instead.
48
+ */
49
+ announce?: boolean | undefined;
41
50
  }): Promise<{
42
51
  content: string;
43
52
  isError: boolean;
@@ -3,19 +3,22 @@ import type { Config, Provider, ProviderConfig } from '@wrongstack/core/types';
3
3
  export interface PickableHostProvider {
4
4
  id: string;
5
5
  type: string;
6
+ refreshQuota?: () => Promise<boolean>;
6
7
  models: Array<{
7
8
  id: string;
8
9
  name: string;
9
10
  description: string;
10
11
  contextWindow?: number;
12
+ reasoningEffortLevels?: string[];
13
+ effortSupported?: boolean;
11
14
  }>;
12
15
  }
13
16
  /** The `acp` entry, or none when no ACP agent is installed. */
14
17
  export declare function acpLeaderPickable(config: Config | undefined): PickableHostProvider[];
15
18
  /**
16
- * Build the ACP leader from the host's provider registry, where its factory
17
- * is registered; undefined for every other provider, which the WebUI builds
18
- * as before.
19
+ * Build a host-registered leader (the ACP leader, WrongForge) from the host's
20
+ * provider registry, where its factory is registered; undefined for every
21
+ * other provider, which the WebUI builds as before.
19
22
  */
20
23
  export declare function buildAcpLeaderProvider(registry: Pick<ProviderRegistry, 'has' | 'create'> | undefined, providerId: string, config: ProviderConfig): Provider | undefined;
21
24
  //# sourceMappingURL=acp-leader-picker.d.ts.map
@@ -1,6 +1,15 @@
1
1
  import type { AgentContextUsage, Capabilities, Config, Provider, ProviderFactory, Request, Response, StreamEvent } from '@wrongstack/core/types';
2
2
  import { ACP_LEADER_PROVIDER_ID } from './acp-leader-host.js';
3
3
  export { ACP_LEADER_PROVIDER_ID };
4
+ /**
5
+ * The side model the user set for an agent leader (`acp.leader.sideModel`),
6
+ * without falling back to the fallback chain: a leader that can answer side
7
+ * requests itself (WrongForge) must not hand them to `fallbackModels[0]`.
8
+ */
9
+ export declare function explicitLeaderSideModel(config: Config): {
10
+ provider: string;
11
+ model: string;
12
+ } | undefined;
4
13
  export declare function leaderSideModel(config: Config): {
5
14
  provider: string;
6
15
  model: string;
@@ -58,6 +67,7 @@ export declare class AcpLeaderProvider implements Provider {
58
67
  private observeContext;
59
68
  private publishContext;
60
69
  private loadAcp;
70
+ private dropFleetGrants;
61
71
  private drop;
62
72
  /** The persistent agent session for this conversation, started on first use. */
63
73
  private sessionFor;
@@ -0,0 +1,5 @@
1
+ /** The WrongStack `skill` tool as an agent sees it on this route, if offered. */
2
+ export declare function externalSkillLoader(offered: readonly string[] | undefined, prefix: string): string | undefined;
3
+ /** `text` with its required-skills marker rewritten for an agent leader. */
4
+ export declare function externalSkillDirective(text: string, loader: string | undefined): string;
5
+ //# sourceMappingURL=acp-leader-skills.d.ts.map
@@ -34,6 +34,13 @@ export declare class TextBlocks {
34
34
  text(chunk: string): void;
35
35
  close(): void;
36
36
  }
37
+ interface CardOutput {
38
+ output: string;
39
+ fullOutput?: string | undefined;
40
+ outputBytes: number;
41
+ }
42
+ /** A card's output fields for a result text that no tool_result will carry. */
43
+ export declare function cardOutputForText(text: string): CardOutput;
37
44
  /**
38
45
  * The agent's own tool calls as the host's tool cards: `tool.started` once a
39
46
  * call is announced, `tool.executed` once it settles. Named by the agent's
@@ -47,6 +54,7 @@ export declare class ToolCardRelay {
47
54
  constructor(events: EventBus | undefined, meta: {
48
55
  sessionId?: string | undefined;
49
56
  model: string;
57
+ provider?: string | undefined;
50
58
  });
51
59
  update(call: ACPCapturedToolCall): void;
52
60
  }
@@ -79,4 +87,5 @@ export declare function agentTurnError(err: unknown, agentId: string, classify:
79
87
  error: ProviderError;
80
88
  dead: boolean;
81
89
  };
90
+ export {};
82
91
  //# sourceMappingURL=acp-leader-stream.d.ts.map
@@ -20,7 +20,7 @@ import {
20
20
  runOAuthLoginKind,
21
21
  runOAuthLoginMenu,
22
22
  validateFamily
23
- } from "./chunk-I5LJLKA3.js";
23
+ } from "./chunk-MKMM5RIW.js";
24
24
  import {
25
25
  renderAuthLocalHelpToString,
26
26
  wantsLocalHelp
@@ -37,14 +37,14 @@ import {
37
37
  import {
38
38
  activeProfileConfigPath
39
39
  } from "./chunk-SPSHEZ46.js";
40
- import "./chunk-BIGSVBPI.js";
40
+ import "./chunk-KNYIEQAY.js";
41
41
  import {
42
42
  restoreFlags
43
43
  } from "./chunk-QC6CLAK7.js";
44
44
  import "./chunk-BCKVNORU.js";
45
45
  import {
46
46
  parseAuthFlags
47
- } from "./chunk-75OLD563.js";
47
+ } from "./chunk-M7PSENGF.js";
48
48
  import "./chunk-W23PY4IJ.js";
49
49
 
50
50
  // src/subcommands/handlers/auth.ts
@@ -745,4 +745,4 @@ async function runAuthRemove(deps, providerId) {
745
745
  export {
746
746
  authCmd
747
747
  };
748
- //# sourceMappingURL=auth-IHQS6AFW.js.map
748
+ //# sourceMappingURL=auth-2ZG5DBHS.js.map
@@ -0,0 +1,20 @@
1
+ import type { LaunchMenuMode, RunLaunchMenuDeps } from './launch-menu-types.js';
2
+ interface ArrowPickResult {
3
+ cancelled: boolean;
4
+ mode: LaunchMenuMode;
5
+ }
6
+ /**
7
+ * Raw-mode arrow-key selector over {@link MODE_OPTIONS}.
8
+ *
9
+ * Keys: ↑/↓ (or k/j) move, Enter launches, 1–5 jump-launch, q/Esc/Ctrl+C
10
+ * cancel. A live countdown auto-launches the highlighted option after
11
+ * {@link MENU_TIMEOUT_MS}; any keypress stops the countdown. On settle the
12
+ * whole block collapses to a single confirmation line so scrollback stays
13
+ * tidy.
14
+ *
15
+ * Returns `null` when raw mode is unavailable or fails to engage —
16
+ * the caller then runs the numbered readline prompt instead.
17
+ */
18
+ export declare function promptModeArrow(deps: RunLaunchMenuDeps): Promise<ArrowPickResult | null>;
19
+ export {};
20
+ //# sourceMappingURL=launch-menu-arrow.d.ts.map
@@ -0,0 +1,36 @@
1
+ import type { LaunchMenuChoice } from '@wrongstack/core/types';
2
+ import type { ReadlineInputReader } from '../input-reader.js';
3
+ import type { TerminalRenderer } from '../renderer.js';
4
+ /** Top-level surfaces the user can launch from the menu. */
5
+ export type LaunchMenuMode = LaunchMenuChoice['mode'];
6
+ /** Surfaces that bind a TCP listener and therefore need a port/host prompt. */
7
+ export type NetworkLaunchMode = Exclude<LaunchMenuMode, 'tui-repl' | 'desktop'>;
8
+ export declare const DEFAULT_PORTS: Record<NetworkLaunchMode, number>;
9
+ /** Numbered choices shown to the user. Order MUST match the menu printout. */
10
+ export declare const MODE_OPTIONS: ReadonlyArray<{
11
+ key: number;
12
+ mode: LaunchMenuMode;
13
+ label: string;
14
+ hint: string;
15
+ icon: string;
16
+ }>;
17
+ export declare const MENU_TIMEOUT_MS = 8000;
18
+ export interface RunLaunchMenuDeps {
19
+ argv: string[];
20
+ flags: Record<string, string | boolean>;
21
+ positional: string[];
22
+ renderer: TerminalRenderer;
23
+ reader: ReadlineInputReader;
24
+ /**
25
+ * Last saved menu choice, if any. When provided the menu shows a
26
+ * one-line summary + "Continue? [Y/n/q]" gate before re-asking,
27
+ * matching the `runLaunchPrompts` pattern.
28
+ */
29
+ lastChoice?: LaunchMenuChoice | undefined;
30
+ /**
31
+ * Override the default ports (used by tests). Production callers
32
+ * should leave this unset.
33
+ */
34
+ defaultPorts?: Partial<typeof DEFAULT_PORTS> | undefined;
35
+ }
36
+ //# sourceMappingURL=launch-menu-types.d.ts.map
@@ -1,40 +1,5 @@
1
- /**
2
- * Interactive launch menu — surfaced when `wstack` is invoked with no
3
- * mode flag (no `--webui`, `--simpleui`, `--hq`, or `--desktop`) and no
4
- * positional subcommand, on an interactive TTY.
5
- *
6
- * The menu asks the user **once** which top-level surface to launch:
7
- * 1) TUI / REPL — interactive terminal (the historical default)
8
- * 2) WebUI — browser-based project UI (port 3456 by default)
9
- * 3) SimpleUI — lightweight browser UI (port 3466 by default)
10
- * 4) HQ — project-independent HQ dashboard (port 3499)
11
- * 5) Desktop — Electron desktop shell (`wstack --desktop`)
12
- *
13
- * It returns either:
14
- * - `null` — caller should fall through to the historical
15
- * boot() flow unchanged (menu skipped).
16
- * - `LaunchChoice` — caller should honor the selection:
17
- * * `tui-repl` → proceed to boot() with no flag
18
- * changes (the inner pre-launch prompts still
19
- * ask TUI vs REPL + YOLO + autonomy).
20
- * * `webui` / `simpleui` → caller injects the
21
- * surface flag + chosen port into argv.
22
- * * `hq` → caller dispatches to the HQ
23
- * short-circuit with the chosen port/host.
24
- * * `desktop` → caller injects `--desktop` and
25
- * dispatches to the desktop short-circuit.
26
- *
27
- * Why this lives in `boot/`: it sits next to the other entry-point
28
- * short-circuits (`short-circuit-{flags,desktop,hq}.ts`) and is
29
- * consumed by `cli-context.ts` between those short-circuits and
30
- * `boot()`. It deliberately does NOT take any DI container, agent,
31
- * or session — those are owned by the post-boot phase.
32
- */
33
1
  import type { LaunchMenuChoice } from '@wrongstack/core/types';
34
- import type { ReadlineInputReader } from '../input-reader.js';
35
- import type { TerminalRenderer } from '../renderer.js';
36
- /** Top-level surfaces the user can launch from the menu. */
37
- type LaunchMenuMode = LaunchMenuChoice['mode'];
2
+ import type { RunLaunchMenuDeps } from './launch-menu-types.js';
38
3
  /** Resolved menu result — the caller must act on this, not re-derive. */
39
4
  interface LaunchMenuResult extends LaunchMenuChoice {
40
5
  /**
@@ -43,9 +8,6 @@ interface LaunchMenuResult extends LaunchMenuChoice {
43
8
  */
44
9
  cancelled: boolean;
45
10
  }
46
- /** Surfaces that bind a TCP listener and therefore need a port/host prompt. */
47
- type NetworkLaunchMode = Exclude<LaunchMenuMode, 'tui-repl' | 'desktop'>;
48
- declare const DEFAULT_PORTS: Record<NetworkLaunchMode, number>;
49
11
  /**
50
12
  * Pure predicate — extracted so unit tests can lock the skip
51
13
  * conditions down without booting a renderer or reader.
@@ -62,24 +24,6 @@ declare const DEFAULT_PORTS: Record<NetworkLaunchMode, number>;
62
24
  * query. The user already said what they wanted.
63
25
  */
64
26
  export declare function shouldSkipMenu(argv: string[], flags: Record<string, string | boolean>, positional: string[]): boolean;
65
- interface RunLaunchMenuDeps {
66
- argv: string[];
67
- flags: Record<string, string | boolean>;
68
- positional: string[];
69
- renderer: TerminalRenderer;
70
- reader: ReadlineInputReader;
71
- /**
72
- * Last saved menu choice, if any. When provided the menu shows a
73
- * one-line summary + "Continue? [Y/n/q]" gate before re-asking,
74
- * matching the `runLaunchPrompts` pattern.
75
- */
76
- lastChoice?: LaunchMenuChoice | undefined;
77
- /**
78
- * Override the default ports (used by tests). Production callers
79
- * should leave this unset.
80
- */
81
- defaultPorts?: Partial<typeof DEFAULT_PORTS> | undefined;
82
- }
83
27
  /**
84
28
  * Run the interactive launch menu.
85
29
  *
@@ -0,0 +1,31 @@
1
+ import type { TodoItem } from '@wrongstack/core/agent';
2
+ import type { SessionResumeClaim } from '@wrongstack/core/storage';
3
+ import type { SessionWriter } from '@wrongstack/core/types';
4
+ import type { SessionResumeContext } from './tui-session-resume-contracts.js';
5
+ type ResumeAgent = SessionResumeContext['agent'];
6
+ /** What a failed resume had claimed or swapped, and what it captured before. */
7
+ export interface FailedResumeState {
8
+ agent: ResumeAgent;
9
+ state: SessionResumeContext['state'];
10
+ previousSessionId: string | undefined;
11
+ identityClaimed: boolean;
12
+ resumeClaim: SessionResumeClaim | undefined;
13
+ writerSwapped: boolean;
14
+ openedWriter: SessionWriter | undefined;
15
+ oldWriter: ResumeAgent['ctx']['session'] | undefined;
16
+ oldMessages: ResumeAgent['ctx']['messages'] | undefined;
17
+ oldSessionRefCurrent: SessionWriter | undefined;
18
+ previousDetachFn: SessionResumeContext['state']['detachActiveTodosCheckpoint'];
19
+ oldTodos: TodoItem[];
20
+ oldPlanPath: unknown;
21
+ oldTaskPath: unknown;
22
+ }
23
+ /**
24
+ * Undo a failed resume: release or roll back the session identity, then close
25
+ * the writer it opened — or, after the writer swap, put the agent's writer,
26
+ * messages and sidecars back. Best-effort throughout: a throw here would mask
27
+ * the original failure, so every step swallows and logs.
28
+ */
29
+ export declare function rollbackFailedResume(r: FailedResumeState): Promise<void>;
30
+ export {};
31
+ //# sourceMappingURL=tui-session-resume-rollback.d.ts.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  persistConfigSetting
3
- } from "./chunk-C2BBH4S4.js";
3
+ } from "./chunk-E3MJFAFR.js";
4
4
  import {
5
5
  activeProfileConfigPath
6
6
  } from "./chunk-SPSHEZ46.js";
7
- import "./chunk-BIGSVBPI.js";
7
+ import "./chunk-KNYIEQAY.js";
8
8
  import "./chunk-W23PY4IJ.js";
9
9
 
10
10
  // src/boot/boot-auto-thin.ts
@@ -100,4 +100,4 @@ async function runBootAutoThin(deps) {
100
100
  export {
101
101
  runBootAutoThin
102
102
  };
103
- //# sourceMappingURL=boot-auto-thin-7D4OVEWA.js.map
103
+ //# sourceMappingURL=boot-auto-thin-N2CIGTXE.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  PLUGIN_AUDIT_ENTRIES,
6
6
  loadExternalPlugins
7
- } from "./chunk-VAQXOZKP.js";
7
+ } from "./chunk-AJM4EFCM.js";
8
8
 
9
9
  // src/wiring/plugins.ts
10
10
  import { join } from "node:path";
@@ -306,4 +306,4 @@ export {
306
306
  BUILTIN_PLUGIN_NAME_HINTS,
307
307
  setupPlugins
308
308
  };
309
- //# sourceMappingURL=chunk-TZPKOS5G.js.map
309
+ //# sourceMappingURL=chunk-2XQ6SRKG.js.map
@@ -1,19 +1,7 @@
1
1
 
2
- // src/hq-server/audit-actor.ts
3
- import * as os from "node:os";
4
- function resolveAuditActor() {
5
- const user = (process.env.USERNAME ?? process.env.USER ?? "").toString();
6
- try {
7
- const host = os.hostname();
8
- return user ? `${user}@${host}` : `cli@${host}`;
9
- } catch {
10
- return user ? `${user}@unknown` : "cli";
11
- }
12
- }
13
-
14
2
  // src/hq-server/utils.ts
15
3
  import * as fs from "node:fs/promises";
16
- import * as os2 from "node:os";
4
+ import * as os from "node:os";
17
5
  import * as path from "node:path";
18
6
  import { resolveHqDataDir } from "@wrongstack/core/hq";
19
7
  import { isSafeSessionId as coreIsSafeSessionId } from "@wrongstack/core/utils";
@@ -166,7 +154,7 @@ function hqRuntimeMarkerPath(dataDir) {
166
154
  function lanIPv4Addresses() {
167
155
  const out = [];
168
156
  try {
169
- const ifaces = os2.networkInterfaces();
157
+ const ifaces = os.networkInterfaces();
170
158
  for (const name of Object.keys(ifaces)) {
171
159
  for (const ni of ifaces[name] ?? []) {
172
160
  if (ni.family === "IPv4" && !ni.internal) out.push(ni.address);
@@ -212,8 +200,19 @@ function recordTimeseriesSignal(persistence, event) {
212
200
  }
213
201
  }
214
202
 
203
+ // src/hq-server/audit-actor.ts
204
+ import * as os2 from "node:os";
205
+ function resolveAuditActor() {
206
+ const user = (process.env.USERNAME ?? process.env.USER ?? "").toString();
207
+ try {
208
+ const host = os2.hostname();
209
+ return user ? `${user}@${host}` : `cli@${host}`;
210
+ } catch {
211
+ return user ? `${user}@unknown` : "cli";
212
+ }
213
+ }
214
+
215
215
  export {
216
- resolveAuditActor,
217
216
  TRANSCRIPT_RING_MAX,
218
217
  MAX_TRANSCRIPT_SESSIONS,
219
218
  MAX_AGENT_RINGS,
@@ -234,6 +233,7 @@ export {
234
233
  truncateHqSummary,
235
234
  hqMachineKey,
236
235
  recordTimeseriesSignal,
237
- sanitizeApiError
236
+ sanitizeApiError,
237
+ resolveAuditActor
238
238
  };
239
- //# sourceMappingURL=chunk-3EXRPTAU.js.map
239
+ //# sourceMappingURL=chunk-5TQ65PXQ.js.map