@wrongstack/cli 0.307.1 → 0.308.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.
@@ -4,6 +4,7 @@ import type { JournalEntry } from '@wrongstack/core/goal';
4
4
  import type { EventBus } from '@wrongstack/core/kernel';
5
5
  import type { Config, MemoryPort, ModelsRegistry, ModeStore, SessionStore, SessionWriter, SkillLoader } from '@wrongstack/core/types';
6
6
  import type { MCPRegistry } from '@wrongstack/mcp';
7
+ import type { VectorMemoryStore } from '@wrongstack/vector-memory';
7
8
  import type { TerminalRenderer } from '../renderer.js';
8
9
  import type { AutonomyMode } from '../services/autonomy-mode.js';
9
10
  import type { CliWebUIOptions } from '../webui-server-options.js';
@@ -40,6 +41,16 @@ export interface WebUIDispatchContext {
40
41
  subscribeEternalIteration: ((fn: (entry: JournalEntry) => void) => () => void) | undefined;
41
42
  sessionStore: SessionStore | undefined;
42
43
  memoryStore: MemoryPort | undefined;
44
+ /**
45
+ * Optional vector-memory store. When provided, the four
46
+ * `/api/vector-memory/{status,search,store,store/:id}` endpoints become
47
+ * active on the embedded WebUI server. When omitted, the routes respond
48
+ * with `{ enabled: false }` or 503 — the embedded WebUI stays on its
49
+ * existing surface with zero behavior change.
50
+ */
51
+ getVectorMemoryStore?: (() => VectorMemoryStore | undefined) | undefined;
52
+ /** Model cache directory for the vector-memory provider. */
53
+ vectorMemoryModelCacheDir?: string | undefined;
43
54
  skillLoader: SkillLoader | undefined;
44
55
  promptLoader: import('@wrongstack/core/types').PromptLoader | undefined;
45
56
  modeStore: ModeStore | undefined;
@@ -3,6 +3,7 @@ import type { EventBus } from '@wrongstack/core/kernel';
3
3
  import type { ToolRegistry } from '@wrongstack/core/registry';
4
4
  import type { MemoryPort, TokenSavingTier, ToolDescriptionModeConfig, ToolResultRenderModeConfig } from '@wrongstack/core/types';
5
5
  import type { WstackPaths } from '@wrongstack/core/utils';
6
+ import type { VectorMemoryStore } from '@wrongstack/vector-memory';
6
7
  interface RegisterBuiltinToolsDeps {
7
8
  toolRegistry: ToolRegistry;
8
9
  compactor: unknown;
@@ -34,6 +35,13 @@ interface RegisterBuiltinToolsDeps {
34
35
  } | undefined;
35
36
  };
36
37
  memoryStore: MemoryPort | null | undefined;
38
+ /**
39
+ * Optional vector memory store. When provided, the four
40
+ * `vector_memory_*` tools are registered alongside the SAGE tools so
41
+ * agents get both lexical and semantic retrieval paths in one surface.
42
+ * Omit (or pass `undefined`) to keep the CLI on the SAGE-only surface.
43
+ */
44
+ vectorMemoryStore?: VectorMemoryStore | undefined;
37
45
  events: EventBus;
38
46
  wpaths: Pick<WstackPaths, 'projectDir'>;
39
47
  }
@@ -5563,7 +5563,7 @@ async function runCliExecution(params) {
5563
5563
  governanceHandle,
5564
5564
  setConfig
5565
5565
  } = params;
5566
- const { execute } = await import("./execution-4ASWJ7EY.js");
5566
+ const { execute } = await import("./execution-4S6RSEQI.js");
5567
5567
  return execute(
5568
5568
  toExecuteDeps({
5569
5569
  core: {
@@ -6457,6 +6457,7 @@ function registerBuiltinTools(deps) {
6457
6457
  tier,
6458
6458
  contextTool: createContextManagerTool({ compactor: deps.compactor }),
6459
6459
  memory: { enabled: deps.config.features.memory, store: deps.memoryStore },
6460
+ vectorMemory: deps.vectorMemoryStore ? { store: deps.vectorMemoryStore } : void 0,
6460
6461
  nextSteps: { enabled: deps.config.tools?.nextsteps?.enabled === true },
6461
6462
  coordinationTools: [
6462
6463
  makeMailboxTool({ projectDir: deps.wpaths.projectDir, events: deps.events }),
@@ -6541,7 +6542,8 @@ async function setupCliPromptAndTools(params) {
6541
6542
  config,
6542
6543
  wpaths,
6543
6544
  projectRoot,
6544
- events
6545
+ events,
6546
+ vectorMemoryStore
6545
6547
  } = params;
6546
6548
  bindSystemPromptBuilder({
6547
6549
  container,
@@ -6575,6 +6577,7 @@ async function setupCliPromptAndTools(params) {
6575
6577
  compactor: container.resolve(TOKENS8.Compactor),
6576
6578
  config,
6577
6579
  memoryStore,
6580
+ vectorMemoryStore,
6578
6581
  events,
6579
6582
  wpaths
6580
6583
  });
@@ -32059,6 +32062,12 @@ function warnUnlessMissing(logger, operation, error) {
32059
32062
  }
32060
32063
  }
32061
32064
 
32065
+ // src/cli-main.ts
32066
+ import {
32067
+ TransformersEmbeddingProvider,
32068
+ VectorMemoryStore
32069
+ } from "@wrongstack/vector-memory";
32070
+
32062
32071
  // src/wiring/replay-governance-setup.ts
32063
32072
  async function setupReplayAndGovernance({
32064
32073
  flags,
@@ -32665,6 +32674,27 @@ async function runInteractive(cliCtx) {
32665
32674
  };
32666
32675
  const memoryStore = container.resolve(TOKENS12.MemoryStore);
32667
32676
  await memoryStore.initialize();
32677
+ let vectorMemoryStore;
32678
+ const vectorMemoryModelCacheDir = path32.join(
32679
+ projectRoot,
32680
+ ".wrongstack",
32681
+ "cache",
32682
+ "transformers-models"
32683
+ );
32684
+ try {
32685
+ vectorMemoryStore = new VectorMemoryStore({
32686
+ provider: new TransformersEmbeddingProvider({
32687
+ cacheDir: vectorMemoryModelCacheDir
32688
+ }),
32689
+ projectRoot
32690
+ });
32691
+ } catch (error) {
32692
+ const message = error instanceof Error ? error.message : String(error);
32693
+ logger.warn(
32694
+ `vector memory store disabled: ${message} \u2014 CLI will run with the SAGE-only surface.`
32695
+ );
32696
+ vectorMemoryStore = void 0;
32697
+ }
32668
32698
  const skillLoader = container.resolve(TOKENS12.SkillLoader);
32669
32699
  const promptLoader = container.resolve(TOKENS12.PromptLoader);
32670
32700
  const sessionRef = {
@@ -32684,7 +32714,8 @@ async function runInteractive(cliCtx) {
32684
32714
  config,
32685
32715
  wpaths,
32686
32716
  projectRoot,
32687
- events
32717
+ events,
32718
+ vectorMemoryStore
32688
32719
  });
32689
32720
  const stdinInteractive = process.stdin.isTTY;
32690
32721
  const hookRunnerRef = { current: null };
@@ -32707,6 +32738,18 @@ async function runInteractive(cliCtx) {
32707
32738
  const tuiOwnsScreen = flags.tui === true && flags["no-tui"] !== true;
32708
32739
  const teardownHandlers = [];
32709
32740
  const evOn = createTeardownEventRegistrar(events, teardownHandlers);
32741
+ if (vectorMemoryStore) {
32742
+ const store = vectorMemoryStore;
32743
+ teardownHandlers.push(() => {
32744
+ try {
32745
+ store.close();
32746
+ } catch (error) {
32747
+ logger.debug?.(
32748
+ `vector memory close failed: ${error instanceof Error ? error.message : String(error)}`
32749
+ );
32750
+ }
32751
+ });
32752
+ }
32710
32753
  const eventWiring = wireEventWiring({
32711
32754
  evOn,
32712
32755
  events,
@@ -33283,6 +33326,8 @@ async function runInteractive(cliCtx) {
33283
33326
  sessResult,
33284
33327
  sessionStore,
33285
33328
  memoryStore,
33329
+ vectorMemoryStore,
33330
+ vectorMemoryModelCacheDir,
33286
33331
  modeStore,
33287
33332
  needsSetup,
33288
33333
  statusTracker,
@@ -33357,4 +33402,4 @@ export {
33357
33402
  CLI_VERSION,
33358
33403
  runInteractive
33359
33404
  };
33360
- //# sourceMappingURL=cli-main-DD3I7KOO.js.map
33405
+ //# sourceMappingURL=cli-main-RJSOWUGD.js.map
@@ -19,6 +19,7 @@ import type { AttachmentStore, AutonomyStage, Config, ConfigStore, MemoryPort, M
19
19
  import type { WstackPaths } from '@wrongstack/core/utils';
20
20
  import type { MCPRegistry } from '@wrongstack/mcp';
21
21
  import type { SddLifecycleResult, SddRunControl } from '@wrongstack/sdd';
22
+ import type { VectorMemoryStore } from '@wrongstack/vector-memory';
22
23
  import type { WebuiSessionChildOptions } from './boot/webui-session-child.js';
23
24
  import type { ReadlineInputReader } from './input-reader.js';
24
25
  import type { LiveSettingsInput } from './live-settings-input.js';
@@ -126,6 +127,12 @@ export interface SessionDeps {
126
127
  queueStore: QueueStore;
127
128
  sessionStore?: SessionStore | undefined;
128
129
  memoryStore?: MemoryPort | undefined;
130
+ /** Optional vector-memory store (additional to SAGE). When omitted, the
131
+ * embedded WebUI's `/api/vector-memory/*` routes default to disabled. */
132
+ vectorMemoryStore?: VectorMemoryStore | undefined;
133
+ /** Model cache directory for the vector-memory provider (shared with the
134
+ * CLI's on-disk transformers cache so a future cleanup never sweeps it). */
135
+ vectorMemoryModelCacheDir?: string | undefined;
129
136
  modeStore?: ModeStore | undefined;
130
137
  mcpRegistry: MCPRegistry;
131
138
  mailbox: RemoteMailbox;
@@ -184,6 +184,8 @@ async function runWebUIDispatch(ctx) {
184
184
  subscribeEternalIteration,
185
185
  sessionStore,
186
186
  memoryStore,
187
+ getVectorMemoryStore,
188
+ vectorMemoryModelCacheDir,
187
189
  skillLoader,
188
190
  promptLoader,
189
191
  modeStore,
@@ -205,7 +207,7 @@ async function runWebUIDispatch(ctx) {
205
207
  const isSimpleUi = !isSessionChild && flags["simpleui"] === true;
206
208
  agent.disableInteractiveConfirmation();
207
209
  renderer.setSilent(true);
208
- const { runWebUI } = await import("./webui-server-IPHGJGXE.js");
210
+ const { runWebUI } = await import("./webui-server-A3H2SM6J.js");
209
211
  const flagValue = (names) => {
210
212
  for (const name of names) {
211
213
  if (!Object.hasOwn(flags, name)) continue;
@@ -334,6 +336,8 @@ async function runWebUIDispatch(ctx) {
334
336
  sddSubagentFactory,
335
337
  updateInfo: ctx.updateInfo,
336
338
  onKanbanDispatch,
339
+ getVectorMemoryStore,
340
+ vectorMemoryModelCacheDir,
337
341
  // Print the "open this" banner only once the server is actually
338
342
  // listening, using the RESOLVED port. Requested ports auto-advance past
339
343
  // busy ports inside runWebUI, so a banner printed up-front lies whenever
@@ -5456,6 +5460,8 @@ async function execute(deps) {
5456
5460
  mailbox,
5457
5461
  sessionStore,
5458
5462
  memoryStore,
5463
+ vectorMemoryStore: vectorMemoryStoreFromExecute,
5464
+ vectorMemoryModelCacheDir: vectorMemoryModelCacheDirFromExecute,
5459
5465
  modeStore,
5460
5466
  detachTodosCheckpoint,
5461
5467
  rebindTodosCheckpoint,
@@ -5917,6 +5923,8 @@ async function execute(deps) {
5917
5923
  subscribeEternalIteration,
5918
5924
  sessionStore: activeSessionStore,
5919
5925
  memoryStore,
5926
+ getVectorMemoryStore: () => vectorMemoryStoreFromExecute,
5927
+ vectorMemoryModelCacheDir: vectorMemoryModelCacheDirFromExecute,
5920
5928
  skillLoader,
5921
5929
  promptLoader,
5922
5930
  modeStore,
@@ -6034,4 +6042,4 @@ export {
6034
6042
  execute,
6035
6043
  resolveReviewerFallbackModels
6036
6044
  };
6037
- //# sourceMappingURL=execution-4ASWJ7EY.js.map
6045
+ //# sourceMappingURL=execution-4S6RSEQI.js.map
package/dist/index.js CHANGED
@@ -4447,7 +4447,7 @@ async function initializeCli(argv) {
4447
4447
  async function main(argv) {
4448
4448
  const cliCtx = await initializeCli(argv);
4449
4449
  if (typeof cliCtx === "number") return cliCtx;
4450
- const { runInteractive } = await import("./cli-main-DD3I7KOO.js");
4450
+ const { runInteractive } = await import("./cli-main-RJSOWUGD.js");
4451
4451
  return runInteractive(cliCtx);
4452
4452
  }
4453
4453
 
@@ -1331,7 +1331,9 @@ async function runWebUI(opts) {
1331
1331
  publicWsUrl,
1332
1332
  apiToken: wsToken,
1333
1333
  requireToken,
1334
- deferListen: surface === "simpleui"
1334
+ deferListen: surface === "simpleui",
1335
+ ...opts.getVectorMemoryStore ? { getVectorMemoryStore: opts.getVectorMemoryStore } : {},
1336
+ ...opts.vectorMemoryModelCacheDir ? { vectorMemoryModelCacheDir: opts.vectorMemoryModelCacheDir } : {}
1335
1337
  });
1336
1338
  const wss = httpServer ? new WebSocketServer({ server: httpServer.server, maxPayload: 20 * 1024 * 1024 }) : new WebSocketServer({ port: httpPort, host, maxPayload: 20 * 1024 * 1024 });
1337
1339
  if (httpServer && surface === "simpleui") {
@@ -1669,4 +1671,4 @@ async function runWebUI(opts) {
1669
1671
  export {
1670
1672
  runWebUI
1671
1673
  };
1672
- //# sourceMappingURL=webui-server-IPHGJGXE.js.map
1674
+ //# sourceMappingURL=webui-server-A3H2SM6J.js.map
@@ -5,6 +5,7 @@ import type { EventBus } from '@wrongstack/core/kernel';
5
5
  import type { TrustBoundary } from '@wrongstack/core/security';
6
6
  import type { MemoryPort, ModelsRegistry, ModeStore, PromptLoader, SessionStore, SessionWriter, SkillLoader } from '@wrongstack/core/types';
7
7
  import type { MCPRegistry } from '@wrongstack/mcp';
8
+ import type { VectorMemoryStore } from '@wrongstack/vector-memory';
8
9
  import type { WebuiSessionChildOptions } from './boot/webui-session-child.js';
9
10
  /**
10
11
  * CLI-shaped webui options. Distinct from the standalone
@@ -170,6 +171,16 @@ export interface CliWebUIOptions {
170
171
  }) => void | Promise<void>) | undefined;
171
172
  /** Memory store — enables the Memory panel + chat `/memory` (memory.list) and the structured memory.sage.* operations. */
172
173
  memoryStore?: MemoryPort | undefined;
174
+ /**
175
+ * Optional vector-memory store. When provided, the four
176
+ * `/api/vector-memory/{status,search,store,store/:id}` endpoints become
177
+ * active. When omitted, the routes respond with `{ enabled: false }` or
178
+ * 503 — a non-CLI webui-server host stays on its existing surface with
179
+ * zero behavior change.
180
+ */
181
+ getVectorMemoryStore?: (() => VectorMemoryStore | undefined) | undefined;
182
+ /** Model cache directory for the vector-memory provider. */
183
+ vectorMemoryModelCacheDir?: string | undefined;
173
184
  /** Skill loader — enables the SkillsPanel (skills.list). */
174
185
  skillLoader?: SkillLoader | undefined;
175
186
  /** Prompt loader — enables the prompt library (prompts.list/search/content/favorite/create). */
@@ -23,6 +23,8 @@ export declare function runCliExecution(params: {
23
23
  sessResult: any;
24
24
  sessionStore: any;
25
25
  memoryStore: any;
26
+ vectorMemoryStore: any;
27
+ vectorMemoryModelCacheDir: any;
26
28
  modeStore: any;
27
29
  needsSetup: any;
28
30
  statusTracker: any;
@@ -1,4 +1,5 @@
1
1
  import { ToolRegistry } from '@wrongstack/core/registry';
2
+ import type { VectorMemoryStore } from '@wrongstack/vector-memory';
2
3
  export declare function setupCliPromptAndTools(params: {
3
4
  container: any;
4
5
  modeStore: any;
@@ -19,6 +20,13 @@ export declare function setupCliPromptAndTools(params: {
19
20
  wpaths: any;
20
21
  projectRoot: string;
21
22
  events: any;
23
+ /**
24
+ * Optional vector memory store. When provided, the four
25
+ * `vector_memory_*` tools are registered alongside the SAGE tools so
26
+ * agents get both lexical and semantic retrieval paths in one surface.
27
+ * Omit (or pass `undefined`) to keep the CLI on the SAGE-only surface.
28
+ */
29
+ vectorMemoryStore?: VectorMemoryStore | undefined;
22
30
  }): Promise<{
23
31
  toolRegistry: ToolRegistry;
24
32
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/cli",
3
- "version": "0.307.1",
3
+ "version": "0.308.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,31 +42,32 @@
42
42
  ],
43
43
  "dependencies": {
44
44
  "ws": "^8.21.3",
45
- "@wrongstack/core": "0.307.1",
46
- "@wrongstack/bench": "0.307.1",
47
- "@wrongstack/kanban": "0.307.1",
48
- "@wrongstack/plug-lsp": "0.307.1",
49
- "@wrongstack/mcp": "0.307.1",
50
- "@wrongstack/acp": "0.307.1",
51
- "@wrongstack/providers": "0.307.1",
52
- "@wrongstack/plugins": "0.307.1",
53
- "@wrongstack/runtime": "0.307.1",
54
- "@wrongstack/sage": "0.307.1",
55
- "@wrongstack/persistence": "0.307.1",
56
- "@wrongstack/requirement-intake": "0.307.1",
57
- "@wrongstack/sdd": "0.307.1",
58
- "@wrongstack/techstack": "0.307.1",
59
- "@wrongstack/telegram": "0.307.1",
60
- "@wrongstack/tui": "0.307.1",
61
- "@wrongstack/tools": "0.307.1",
62
- "@wrongstack/simpleui": "0.307.1",
63
- "@wrongstack/webui-hq": "0.307.1",
64
- "@wrongstack/webui": "0.307.1",
65
- "@wrongstack/security-scanner": "0.307.1",
66
- "@wrongstack/webui-server": "0.307.1"
45
+ "@wrongstack/core": "0.308.0",
46
+ "@wrongstack/mcp": "0.308.0",
47
+ "@wrongstack/bench": "0.308.0",
48
+ "@wrongstack/kanban": "0.308.0",
49
+ "@wrongstack/acp": "0.308.0",
50
+ "@wrongstack/plugins": "0.308.0",
51
+ "@wrongstack/providers": "0.308.0",
52
+ "@wrongstack/persistence": "0.308.0",
53
+ "@wrongstack/sage": "0.308.0",
54
+ "@wrongstack/runtime": "0.308.0",
55
+ "@wrongstack/plug-lsp": "0.308.0",
56
+ "@wrongstack/techstack": "0.308.0",
57
+ "@wrongstack/sdd": "0.308.0",
58
+ "@wrongstack/tui": "0.308.0",
59
+ "@wrongstack/requirement-intake": "0.308.0",
60
+ "@wrongstack/telegram": "0.308.0",
61
+ "@wrongstack/simpleui": "0.308.0",
62
+ "@wrongstack/vector-memory": "0.308.0",
63
+ "@wrongstack/tools": "0.308.0",
64
+ "@wrongstack/webui": "0.308.0",
65
+ "@wrongstack/security-scanner": "0.308.0",
66
+ "@wrongstack/webui-server": "0.308.0",
67
+ "@wrongstack/webui-hq": "0.308.0"
67
68
  },
68
69
  "optionalDependencies": {
69
- "@wrongstack/desktop": "0.307.1"
70
+ "@wrongstack/desktop": "0.308.0"
70
71
  },
71
72
  "devDependencies": {
72
73
  "@types/node": "^26.2.0",