@wrongstack/cli 0.309.0 → 0.310.0

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 (83) hide show
  1. package/dist/{acp-5ZLGFHWP.js → acp-EA57GUFB.js} +6 -4
  2. package/dist/acp-server-agent.d.ts +1 -1
  3. package/dist/{audit-BBR22QH3.js → audit-ZPCLCC3C.js} +1 -1
  4. package/dist/{auth-WOKC2RVG.js → auth-VQMSZGKE.js} +4 -4
  5. package/dist/auth-menu/loopback-server.d.ts +0 -12
  6. package/dist/{bench-XNDUJOSZ.js → bench-XYG56AMO.js} +1 -1
  7. package/dist/boot/tui-session-stub-enrich.d.ts +20 -0
  8. package/dist/{chronicle-63MFCZN6.js → chronicle-6EPPMUC5.js} +1 -1
  9. package/dist/{chunk-53STH6CX.js → chunk-63GFD62R.js} +3 -2
  10. package/dist/{chunk-SZ42FYPT.js → chunk-BXFYBQKR.js} +4 -6
  11. package/dist/{chunk-JQURRYU4.js → chunk-CHZZEEIP.js} +2 -2
  12. package/dist/{chunk-CB35UVXO.js → chunk-KQNYSZG2.js} +34 -9
  13. package/dist/{chunk-XSG33WHN.js → chunk-QAC263FZ.js} +4 -2
  14. package/dist/{chunk-SSSJQVUY.js → chunk-QYIIOMLE.js} +15 -2
  15. package/dist/{chunk-7JOMY3HO.js → chunk-USYOJIV2.js} +3 -3
  16. package/dist/{chunk-DOJLAULS.js → chunk-WOTGMHAH.js} +36 -26
  17. package/dist/{chunk-T6YAVFXA.js → chunk-X3N5TS2S.js} +2 -1
  18. package/dist/{cli-main-RG2PTQ6S.js → cli-main-RFEZAJ4U.js} +3190 -2839
  19. package/dist/{diag-doctor-WTBHPOMB.js → diag-doctor-HJKFUY6B.js} +1 -1
  20. package/dist/diff-renderer.d.ts +17 -0
  21. package/dist/{execution-TYUXABWI.js → execution-WA2UCXNM.js} +180 -61
  22. package/dist/{export-CCUXRJOU.js → export-ROG3DKTZ.js} +1 -1
  23. package/dist/{hq-PA6RH2UW.js → hq-AG4VW4XO.js} +18 -10
  24. package/dist/hq-server/handle-types.d.ts +32 -0
  25. package/dist/hq-server/login-attempt-store.d.ts +5 -0
  26. package/dist/{hq-server-PBRU275L.js → hq-server-GZGM4BHA.js} +2 -2
  27. package/dist/hq-server.d.ts +2 -20
  28. package/dist/index.js +105 -76
  29. package/dist/{init-E2NDDOHI.js → init-4JQSG66Q.js} +1 -1
  30. package/dist/{mailbox-serve-V3QIJBDH.js → mailbox-serve-5S3PHG5D.js} +1 -1
  31. package/dist/{mcp-CMLFHRG2.js → mcp-RRPKNRSN.js} +3 -1
  32. package/dist/mcp-serve.d.ts +1 -1
  33. package/dist/{modeldiag-ICMPHT5L.js → modeldiag-H6DKWJ2N.js} +6 -12
  34. package/dist/{plugin-usage-26LIIW3P.js → plugin-usage-GCTYOZPH.js} +1 -1
  35. package/dist/{projects-XE76NFNZ.js → projects-5J727S4L.js} +1 -1
  36. package/dist/provider-config-utils.d.ts +1 -2
  37. package/dist/{providers-models-D23WUD74.js → providers-models-663NDPRQ.js} +2 -2
  38. package/dist/{quick-VIO2BEHS.js → quick-XLYLZX4B.js} +1 -1
  39. package/dist/{replay-WBRMEWQ5.js → replay-RZXZKP2U.js} +1 -1
  40. package/dist/{rewind-7RE6ONIC.js → rewind-2FFNOOKS.js} +1 -1
  41. package/dist/{sessions-config-YX2ZPAFM.js → sessions-config-7Q7QJBKJ.js} +1 -1
  42. package/dist/slash-commands/dev.d.ts +50 -0
  43. package/dist/subcommands/handlers/acp.d.ts +1 -1
  44. package/dist/subcommands/handlers/audit.d.ts +1 -1
  45. package/dist/subcommands/handlers/auth.d.ts +1 -1
  46. package/dist/subcommands/handlers/bench.d.ts +1 -1
  47. package/dist/subcommands/handlers/chronicle.d.ts +1 -1
  48. package/dist/subcommands/handlers/config-history.d.ts +1 -1
  49. package/dist/subcommands/handlers/diag-doctor.d.ts +1 -1
  50. package/dist/subcommands/handlers/export.d.ts +1 -1
  51. package/dist/subcommands/handlers/hq.d.ts +1 -1
  52. package/dist/subcommands/handlers/init.d.ts +1 -1
  53. package/dist/subcommands/handlers/mailbox-serve.d.ts +1 -1
  54. package/dist/subcommands/handlers/mcp.d.ts +1 -1
  55. package/dist/subcommands/handlers/modeldiag-bench.d.ts +1 -1
  56. package/dist/subcommands/handlers/modeldiag-eval.d.ts +1 -1
  57. package/dist/subcommands/handlers/modeldiag-test.d.ts +1 -1
  58. package/dist/subcommands/handlers/modeldiag.d.ts +1 -1
  59. package/dist/subcommands/handlers/plugin-usage.d.ts +1 -1
  60. package/dist/subcommands/handlers/projects.d.ts +1 -1
  61. package/dist/subcommands/handlers/providers-models.d.ts +1 -1
  62. package/dist/subcommands/handlers/quick.d.ts +1 -1
  63. package/dist/subcommands/handlers/replay.d.ts +1 -1
  64. package/dist/subcommands/handlers/rewind.d.ts +1 -1
  65. package/dist/subcommands/handlers/sessions-config.d.ts +1 -1
  66. package/dist/subcommands/handlers/sessions-fleet.d.ts +1 -1
  67. package/dist/subcommands/handlers/tools-skills.d.ts +1 -1
  68. package/dist/subcommands/handlers/update.d.ts +1 -1
  69. package/dist/subcommands/handlers/version-help.d.ts +1 -1
  70. package/dist/subcommands/index.d.ts +2 -3
  71. package/dist/{tools-skills-UNKLOB7M.js → tools-skills-Q4P27URS.js} +1 -1
  72. package/dist/{update-VZSOZGYC.js → update-RATFF63M.js} +2 -2
  73. package/dist/{version-help-TFD6VPF3.js → version-help-WMPSEL4U.js} +2 -2
  74. package/dist/{webui-server-JXJ4CGIX.js → webui-server-3DU6BVTB.js} +7 -10
  75. package/dist/wiring/cli-execute-builder.d.ts +110 -85
  76. package/dist/wiring/cli-slash-commands-setup.d.ts +102 -72
  77. package/dist/wiring/director-announcement.d.ts +31 -0
  78. package/dist/wiring/session-establishment.d.ts +45 -0
  79. package/dist/wiring/session-registry.d.ts +1 -1
  80. package/dist/wiring/session-runtime.d.ts +64 -0
  81. package/dist/wiring/teardown-registrar.d.ts +41 -0
  82. package/dist/wiring/vector-memory-setup.d.ts +30 -0
  83. package/package.json +27 -25
@@ -1,86 +1,116 @@
1
+ import type { Container } from '@wrongstack/core/kernel';
2
+ import { createCommandHostAdapters } from './command-host-adapters.js';
3
+ import { createEternalCommandHandlers } from './eternal-command-handlers.js';
4
+ import { createFleetCommandHandlers } from './fleet-command-handlers.js';
5
+ import { createSddHandlers } from './sdd-handlers.js';
6
+ import { createSessionCommandHandlers } from './session-command-handlers.js';
7
+ import { buildCommandHostSlashCommands } from './slash-commands.js';
8
+ type B = Parameters<typeof buildCommandHostSlashCommands>[0];
9
+ type A = Parameters<typeof createCommandHostAdapters>[0];
10
+ type F = Parameters<typeof createFleetCommandHandlers>[0];
11
+ type SE = Parameters<typeof createSessionCommandHandlers>[0];
12
+ type E = Parameters<typeof createEternalCommandHandlers>[0];
13
+ type SD = Parameters<typeof createSddHandlers>[0];
1
14
  export declare function setupCliSlashCommands(params: {
2
- slashRegistry: any;
3
- toolRegistry: any;
4
- agent: any;
5
- interruptController: any;
6
- reader: any;
7
- wpaths: any;
8
- container: any;
9
- sessionStore: any;
10
- skillLoader: any;
11
- tokenCounter: any;
12
- renderer: any;
13
- events: any;
14
- memoryStore: any;
15
+ slashRegistry: B['registry'];
16
+ toolRegistry: B['toolRegistry'];
17
+ agent: A['agent'];
18
+ interruptController: NonNullable<B['interruptController']>;
19
+ reader: A['reader'];
20
+ wpaths: B['paths'];
21
+ container: Container;
22
+ sessionStore: B['sessionStore'];
23
+ skillLoader: B['skillLoader'];
24
+ tokenCounter: B['tokenCounter'];
25
+ renderer: B['renderer'];
26
+ events: B['events'];
27
+ memoryStore: B['memoryStore'];
15
28
  /**
16
29
  * Vector memory store (semantic recall channel). When supplied, the
17
30
  * `/memory diagnostics` and `/memory race` slash commands can
18
31
  * surface cross-system health and the lexical vs semantic channel
19
32
  * comparison.
20
33
  */
21
- vectorMemoryStore?: any;
22
- context: any;
34
+ vectorMemoryStore?: B['vectorMemoryStore'];
35
+ context: NonNullable<B['context']>;
23
36
  cwd: string;
24
37
  projectRoot: string;
25
- metricsSink: any;
26
- healthRegistry: any;
27
- metricsStatus: any;
38
+ metricsSink: B['metricsSink'];
39
+ healthRegistry: B['healthRegistry'];
40
+ metricsStatus: B['metricsStatus'];
28
41
  planPath: string;
29
- modeStore: any;
30
- fleetStreamController: any;
31
- enhanceController: any;
32
- provider: any;
33
- config: any;
34
- buildProviderForId: (pid: string) => any;
35
- statuslineConfigDeps: any;
36
- getCurrentHiddenItems: () => any[];
37
- setStatuslineHiddenItems: any;
38
- saveStatuslineHiddenItems: any;
39
- agentsMonitorController: any;
40
- agentMonitor: any;
41
- onPanelOpen: any;
42
- configStore: any;
43
- secretInputController: any;
44
- vault: any;
45
- brain: any;
46
- brainSettings: any;
47
- brainRuntime: any;
48
- brainLog: any;
49
- coordinatorController: any;
50
- statusTracker: any;
51
- shadowController: any;
52
- multiAgentHost: any;
53
- director: any;
54
- sessionRef: any;
55
- session: any;
42
+ modeStore: B['modeStore'];
43
+ fleetStreamController: B['fleetStreamController'];
44
+ enhanceController: B['enhanceController'];
45
+ provider: B['llmProvider'];
46
+ config: SD['config'];
47
+ buildProviderForId: NonNullable<B['createProvider']>;
48
+ statuslineConfigDeps: B['statuslineConfig'];
49
+ getCurrentHiddenItems: () => NonNullable<B['statuslineHiddenItems']>;
50
+ setStatuslineHiddenItems: NonNullable<B['setStatuslineHiddenItems']>;
51
+ saveStatuslineHiddenItems: NonNullable<B['saveStatuslineHiddenItems']>;
52
+ agentsMonitorController: B['agentsMonitorController'];
53
+ agentMonitor: B['agentMonitor'];
54
+ onPanelOpen: B['onPanelOpen'];
55
+ configStore: B['configStore'];
56
+ secretInputController: {
57
+ readSecret: NonNullable<B['readSecret']>;
58
+ readText: NonNullable<B['readText']>;
59
+ };
60
+ vault: B['vault'];
61
+ brain: B['brain'];
62
+ brainSettings: B['brainSettings'];
63
+ brainRuntime: B['brainRuntime'];
64
+ initialBrainLog: ReturnType<NonNullable<B['getBrainLog']>>;
65
+ coordinatorController: B['coordinatorController'];
66
+ statusTracker: B['statusTracker'];
67
+ shadowController: B['shadowController'];
68
+ multiAgentHost: F['multiAgentHost'];
69
+ director: ReturnType<F['getDirector']>;
70
+ sessionRef: SD['sessionRef'];
71
+ session: SD['session'];
56
72
  fleetRootForPromotion: string;
57
73
  profileConfigPath: string;
58
- effectiveMaxContextRef: any;
59
- autoCompactor: any;
60
- eventWiring: any;
61
- mcpRegistry: any;
62
- setYoloMode: (setTo?: boolean) => boolean;
63
- getNextPredict: () => boolean;
64
- setNextPredict: (enabled: boolean) => void;
65
- getCurrentSuggestions: () => any;
66
- setCurrentSuggestions: (s: any) => void;
67
- teardownHandlers: Array<() => void>;
68
- pluginHost: any;
69
- logger: any;
70
- flags: any;
71
- errorRing: any;
72
- stats: any;
73
- broadcastEternalIteration: any;
74
- broadcastAutonomyStage: any;
75
- getAutonomyMode: () => any;
76
- setAutonomyMode: (m: any) => void;
77
- autonomyModeRef: any;
78
- getEternalEngine: () => any;
79
- setEternalEngine: (e: any) => void;
80
- getParallelEngine: () => any;
81
- setParallelEngine: (e: any) => void;
82
- sddRunRegistry: any;
83
- goalHost: any;
84
- setConfig: (cfg: any) => void;
74
+ effectiveMaxContextRef: SE['effectiveMaxContext'];
75
+ autoCompactor: SE['autoCompactor'];
76
+ eventWiring: {
77
+ setEffectiveMaxContext: SE['setEventMaxContext'];
78
+ };
79
+ mcpRegistry: SE['mcpRegistry'];
80
+ setYoloMode: SE['onYolo'];
81
+ getNextPredict: SE['getNextPredict'];
82
+ setNextPredict: SE['setNextPredict'];
83
+ getCurrentSuggestions: SE['getCurrentSuggestions'];
84
+ setCurrentSuggestions: SE['setCurrentSuggestions'];
85
+ teardownHandlers: SE['teardownHandlers'];
86
+ pluginHost: SE['pluginHost'];
87
+ logger: SD['logger'];
88
+ flags: SE['flags'];
89
+ errorRing: SE['errorRing'];
90
+ stats: SE['stats'];
91
+ broadcastEternalIteration: E['onIteration'];
92
+ broadcastAutonomyStage: E['onStage'];
93
+ getAutonomyMode: E['getAutonomyMode'];
94
+ setAutonomyMode: E['setAutonomyMode'];
95
+ autonomyModeRef: E['autonomyModeRef'];
96
+ getEternalEngine: E['getEternalEngine'];
97
+ setEternalEngine: E['setEternalEngine'];
98
+ getParallelEngine: E['getParallelEngine'];
99
+ setParallelEngine: E['setParallelEngine'];
100
+ sddRunRegistry: SD['sddRunRegistry'];
101
+ goalHost?: {
102
+ onGoalStart: NonNullable<B['onGoalStart']>;
103
+ onGoalPause: NonNullable<B['onGoalPause']>;
104
+ onGoalResume: NonNullable<B['onGoalResume']>;
105
+ onGoalStop: NonNullable<B['onGoalStop']>;
106
+ getGoalRunner: NonNullable<B['getGoalRunner']>;
107
+ onGoalMoveTask: NonNullable<B['onGoalMoveTask']>;
108
+ onGoalAssignTask: NonNullable<B['onGoalAssignTask']>;
109
+ onGoalAddTask: NonNullable<B['onGoalAddTask']>;
110
+ onGoalRetryTask: NonNullable<B['onGoalRetryTask']>;
111
+ onWorktree: NonNullable<B['onWorktree']>;
112
+ };
113
+ setConfig: SE['setConfig'];
85
114
  }): void;
115
+ export {};
86
116
  //# sourceMappingURL=cli-slash-commands-setup.d.ts.map
@@ -0,0 +1,31 @@
1
+ import type { Director } from '@wrongstack/core/coordination';
2
+ import type { ToolRegistry } from '@wrongstack/core/registry';
3
+ import type { MultiAgentHost } from '../fleet/host.js';
4
+ /**
5
+ * Phase: director activation + announcement (card #7C slice 4).
6
+ *
7
+ * Verbatim extraction of the cli-main.ts director block: resolves the Director
8
+ * from the multi-agent host, restores any fleet checkpoint state, registers
9
+ * the roster tools, and prints the mode announcement (short line for browser
10
+ * surfaces, full paths for the terminal; budget summary only when resuming
11
+ * from a checkpoint so fresh starts stay quiet).
12
+ *
13
+ * Returns the resolved Director (or null when Director mode is disabled) so
14
+ * the composition root keeps owning the mutable `director` binding.
15
+ */
16
+ export declare function ensureDirectorAndAnnounce(args: {
17
+ multiAgentHost: MultiAgentHost;
18
+ /** Fleet checkpoint restored from the resumed session, if any. */
19
+ priorFleetState: Parameters<Director['setCheckpointState']>[0] | undefined;
20
+ renderer: {
21
+ writeInfo(msg: string): void;
22
+ };
23
+ toolRegistry: ToolRegistry;
24
+ flags: Record<string, unknown>;
25
+ /** Fleet paths are optional in DirectorAutonomyResult; the announcement prints them verbatim. */
26
+ fleetRoot: string | undefined;
27
+ manifestPath: string | undefined;
28
+ sharedScratchpadPath: string | undefined;
29
+ subagentSessionsRoot: string | undefined;
30
+ }): Promise<Director | null>;
31
+ //# sourceMappingURL=director-announcement.d.ts.map
@@ -0,0 +1,45 @@
1
+ import type { CliContext } from '../cli-context.js';
2
+ import type { loadOnlineAgentsForPrompt } from '../cli-main-helpers.js';
3
+ import { setupSession } from './session.js';
4
+ export interface SessionEstablishmentArgs {
5
+ /** Container used to resolve SessionStore + TokenCounter. */
6
+ container: Pick<CliContext['container'], 'resolve'>;
7
+ config: {
8
+ provider: string;
9
+ model: string;
10
+ };
11
+ wpaths: Parameters<typeof setupSession>[0]['wpaths'];
12
+ projectRoot: string;
13
+ cwd: string;
14
+ systemPrompt: Parameters<typeof setupSession>[0]['systemPrompt'];
15
+ provider: Parameters<typeof setupSession>[0]['provider'];
16
+ renderer: Parameters<typeof setupSession>[0]['renderer'];
17
+ flags: Parameters<typeof setupSession>[0]['flags'];
18
+ events: NonNullable<Parameters<typeof setupSession>[0]['events']>;
19
+ logger: Parameters<typeof setupSession>[0]['logger'];
20
+ /** Live ref so /resume writer swaps are picked up without re-wiring. */
21
+ sessionRef: {
22
+ current: {
23
+ id?: string;
24
+ flushSync?: () => void;
25
+ } | undefined;
26
+ };
27
+ onlineAgents: Awaited<ReturnType<typeof loadOnlineAgentsForPrompt>>;
28
+ /** Owned by the teardown-registrar phase; consumed here for clientType. */
29
+ tuiOwnsScreen: boolean;
30
+ }
31
+ export declare function setupSessionEstablishment(args: SessionEstablishmentArgs): Promise<{
32
+ sessionStore: import("@wrongstack/core").SessionStore;
33
+ tokenCounter: import("@wrongstack/core").TokenCounter;
34
+ context: import("@wrongstack/core").Context;
35
+ planPath: string;
36
+ session: import("@wrongstack/core").SessionWriter;
37
+ attachments: import("@wrongstack/core/storage").DefaultAttachmentStore;
38
+ queueStore: import("@wrongstack/core/storage").QueueStore;
39
+ detachTodosCheckpoint: () => void | Promise<void>;
40
+ priorFleetState: import("@wrongstack/core/storage").DirectorStateSnapshot | undefined;
41
+ /** Full SessionResult, passed through for downstream consumers
42
+ * (runCliExecution, multi-agent setup read traceId/resumed* off it). */
43
+ sessResult: import("./session.js").SessionResult;
44
+ }>;
45
+ //# sourceMappingURL=session-establishment.d.ts.map
@@ -20,7 +20,7 @@ export interface SetupSessionRegistryDeps {
20
20
  }
21
21
  export interface SetupSessionRegistryResult {
22
22
  /** AgentStatusTracker when the dynamic import and setup succeeded, else undefined. */
23
- tracker: InstanceType<typeof import('@wrongstack/core/storage').AgentStatusTracker> | undefined;
23
+ tracker: InstanceType<typeof import('@wrongstack/core/coordination').AgentStatusTracker> | undefined;
24
24
  /**
25
25
  * Atomically move this process's registry ownership to another session.
26
26
  * Used by explicit resume; unrelated sessions in other processes are untouched.
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Session-runtime wiring for the interactive CLI (card #7C slice 4).
3
+ *
4
+ * Extracted verbatim from cli-main.ts. Owns the post-establishment session
5
+ * surface:
6
+ *
7
+ * - `wireSessionEvents` (error ring, session bridge, chronicle) plus the
8
+ * `process.once('beforeExit')` hook that flushes the chronicle on the way
9
+ * out — the last teardown hook that lived inline in the orchestrator.
10
+ * - `SessionStats` fed by the shared EventBus + token counter.
11
+ * - The active reasoning-config refresher (best-effort modelsRegistry lookup)
12
+ * and the warning-dedup set behind `model-runtime` pipeline warnings.
13
+ * - `setupPipelines` with the modelRuntime overlay, then the governance
14
+ * tool-boundary install when replay-governance is active.
15
+ *
16
+ * `getActiveReasoningConfig()` exposes the CURRENT reasoning config exactly
17
+ * the way the orchestrator's inline `let` did when `runCliExecution` read it
18
+ * by value at call time.
19
+ */
20
+ import type { Context } from '@wrongstack/core/agent';
21
+ import type { Provider } from '@wrongstack/core/types';
22
+ import type { CliContext } from '../cli-context.js';
23
+ import { wireSessionEvents } from '../session-event-wiring.js';
24
+ import { SessionStats } from '../session-stats.js';
25
+ import type { setupReplayAndGovernance } from './replay-governance-setup.js';
26
+ type WireArgs = Parameters<typeof wireSessionEvents>[0];
27
+ type GovernanceHandle = Awaited<ReturnType<typeof setupReplayAndGovernance>>['governanceHandle'];
28
+ export interface SessionRuntimeArgs {
29
+ evOn: WireArgs['evOn'];
30
+ events: NonNullable<WireArgs['events']>;
31
+ /** Live config binding; provider/model are read once at setup time. */
32
+ config: CliContext['config'];
33
+ context: Context;
34
+ session: WireArgs['session'];
35
+ sessionRef: WireArgs['sessionRef'];
36
+ wpaths: WireArgs['wpaths'];
37
+ projectRoot: WireArgs['projectRoot'];
38
+ renderer: NonNullable<WireArgs['renderer']>;
39
+ tuiOwnsScreen: boolean;
40
+ tokenCounter: ConstructorParameters<typeof SessionStats>[1];
41
+ modelsRegistry: CliContext['modelsRegistry'];
42
+ configStore: CliContext['configStore'];
43
+ provider: {
44
+ capabilities: Provider['capabilities'];
45
+ };
46
+ logger: CliContext['logger'];
47
+ governanceHandle: GovernanceHandle;
48
+ }
49
+ export declare function setupSessionRuntime(args: SessionRuntimeArgs): {
50
+ errorRing: import("../session-event-wiring.js").ErrorEntry[];
51
+ sessionBridge: import("@wrongstack/core").SessionEventBridge;
52
+ stats: SessionStats;
53
+ pipelines: import("@wrongstack/core/agent").AgentPipelines;
54
+ refreshActiveReasoningConfig: (providerId: string, modelId: string) => Promise<void>;
55
+ getActiveReasoningConfig: () => import("@wrongstack/core/types").ReasoningConfig | undefined;
56
+ /**
57
+ * Lifecycle registration is intentionally NOT done here — this module is
58
+ * reusable and must not install process-level hooks (chimera review).
59
+ * The composition root owns `process.once('beforeExit', ...)` wiring.
60
+ */
61
+ disposeChronicle: () => Promise<void>;
62
+ };
63
+ export {};
64
+ //# sourceMappingURL=session-runtime.d.ts.map
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Teardown-registrar phase (card #7C-2), extracted verbatim from
3
+ * `cli-main.ts` (was lines 164-179).
4
+ *
5
+ * Two concerns that must stay together because of the LIFO teardown
6
+ * contract:
7
+ *
8
+ * 1. `createTeardownEventRegistrar` wraps `events` so event-driven
9
+ * subscriptions unregister themselves on shutdown (their disposers go
10
+ * to the same chain).
11
+ * 2. The vector-memory SQLite `close()` teardown is pushed *after* the
12
+ * registrar — in the original file the store-close push sat at line
13
+ * 170, after the mirror-dispose push at line 168 from the setup
14
+ * phase, so on LIFO teardown close runs before the mirror dispose.
15
+ * Keeping this registration inside the same function preserves that
16
+ * exact ordering; moving it back into the setup phase would invert
17
+ * the shutdown sequence.
18
+ *
19
+ * `tuiOwnsScreen` is resolved here as well (was line 164): it derives
20
+ * purely from flags and is consumed by the event wiring below.
21
+ */
22
+ import type { VectorMemoryStore } from '@wrongstack/vector-memory';
23
+ import { createTeardownEventRegistrar } from '../cli-main-helpers.js';
24
+ export interface TeardownRegistrarArgs {
25
+ flags: {
26
+ tui?: unknown;
27
+ 'no-tui'?: unknown;
28
+ };
29
+ events: Parameters<typeof createTeardownEventRegistrar>[0];
30
+ logger: {
31
+ debug?: (message: string) => void;
32
+ };
33
+ teardownHandlers: Array<() => void>;
34
+ vectorMemoryStore: VectorMemoryStore | undefined;
35
+ }
36
+ export interface TeardownRegistrarResult {
37
+ tuiOwnsScreen: boolean;
38
+ evOn: ReturnType<typeof createTeardownEventRegistrar>;
39
+ }
40
+ export declare function setupTeardownRegistrar(args: TeardownRegistrarArgs): TeardownRegistrarResult;
41
+ //# sourceMappingURL=teardown-registrar.d.ts.map
@@ -0,0 +1,30 @@
1
+ import type { MemoryPort } from '@wrongstack/core/types';
2
+ import { VectorMemoryStore } from '@wrongstack/vector-memory';
3
+ export interface VectorMemoryArgs {
4
+ projectRoot: string;
5
+ flags: {
6
+ 'vector-sync'?: unknown;
7
+ };
8
+ logger: {
9
+ warn: (message: string) => void;
10
+ info: (message: string) => void;
11
+ debug?: (message: string) => void;
12
+ };
13
+ /** The SAGE memory port; returned wrapped when the vector store comes up. */
14
+ memoryStore: MemoryPort;
15
+ /** Disposer chain; the mirror-dispose handler is pushed from inside. */
16
+ teardownHandlers: Array<() => void>;
17
+ }
18
+ export interface VectorMemoryResult {
19
+ memoryStore: MemoryPort;
20
+ vectorMemoryStore: VectorMemoryStore | undefined;
21
+ /**
22
+ * Model-cache directory (`.wrongstack/cache/transformers-models` under the
23
+ * project root). Surfaced because `session-start-payload` advertises the
24
+ * cache location to the WebUI — callers pass it onward (original
25
+ * cli-main.ts line 801 shorthand).
26
+ */
27
+ vectorMemoryModelCacheDir: string;
28
+ }
29
+ export declare function setupVectorMemory(args: VectorMemoryArgs): Promise<VectorMemoryResult>;
30
+ //# sourceMappingURL=vector-memory-setup.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/cli",
3
- "version": "0.309.0",
3
+ "version": "0.310.0",
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": [
@@ -42,32 +42,34 @@
42
42
  ],
43
43
  "dependencies": {
44
44
  "ws": "^8.21.3",
45
- "@wrongstack/acp": "0.309.0",
46
- "@wrongstack/core": "0.309.0",
47
- "@wrongstack/kanban": "0.309.0",
48
- "@wrongstack/bench": "0.309.0",
49
- "@wrongstack/mcp": "0.309.0",
50
- "@wrongstack/providers": "0.309.0",
51
- "@wrongstack/requirement-intake": "0.309.0",
52
- "@wrongstack/persistence": "0.309.0",
53
- "@wrongstack/plug-lsp": "0.309.0",
54
- "@wrongstack/sage": "0.309.0",
55
- "@wrongstack/runtime": "0.309.0",
56
- "@wrongstack/plugins": "0.309.0",
57
- "@wrongstack/security-scanner": "0.309.0",
58
- "@wrongstack/simpleui": "0.309.0",
59
- "@wrongstack/sdd": "0.309.0",
60
- "@wrongstack/telegram": "0.309.0",
61
- "@wrongstack/techstack": "0.309.0",
62
- "@wrongstack/tui": "0.309.0",
63
- "@wrongstack/tools": "0.309.0",
64
- "@wrongstack/vector-memory": "0.309.0",
65
- "@wrongstack/webui": "0.309.0",
66
- "@wrongstack/webui-hq": "0.309.0",
67
- "@wrongstack/webui-server": "0.309.0"
45
+ "@wrongstack/acp": "0.310.0",
46
+ "@wrongstack/bench": "0.310.0",
47
+ "@wrongstack/core": "0.310.0",
48
+ "@wrongstack/persistence": "0.310.0",
49
+ "@wrongstack/kanban": "0.310.0",
50
+ "@wrongstack/plugins": "0.310.0",
51
+ "@wrongstack/plug-lsp": "0.310.0",
52
+ "@wrongstack/primitives": "0.310.0",
53
+ "@wrongstack/providers": "0.310.0",
54
+ "@wrongstack/runtime": "0.310.0",
55
+ "@wrongstack/sdd": "0.310.0",
56
+ "@wrongstack/mcp": "0.310.0",
57
+ "@wrongstack/requirement-intake": "0.310.0",
58
+ "@wrongstack/sage": "0.310.0",
59
+ "@wrongstack/security-scanner": "0.310.0",
60
+ "@wrongstack/techstack": "0.310.0",
61
+ "@wrongstack/telegram": "0.310.0",
62
+ "@wrongstack/simpleui": "0.310.0",
63
+ "@wrongstack/vector-memory": "0.310.0",
64
+ "@wrongstack/tools": "0.310.0",
65
+ "@wrongstack/webui": "0.310.0",
66
+ "@wrongstack/webui-server": "0.310.0",
67
+ "@wrongstack/webui-hq": "0.310.0",
68
+ "@wrongstack/tui": "0.310.0",
69
+ "@wrongstack/webui-protocol": "0.310.0"
68
70
  },
69
71
  "optionalDependencies": {
70
- "@wrongstack/desktop": "0.309.0"
72
+ "@wrongstack/desktop": "0.310.0"
71
73
  },
72
74
  "devDependencies": {
73
75
  "@types/node": "^26.2.0",