@wrongstack/cli 0.307.0 → 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
  }
@@ -131,6 +131,6 @@ export declare function reviewerAttemptTimeoutMs(remainingMs: number, attemptTim
131
131
  * Chimera reviewers only inspect code and return a report. They never repair
132
132
  * files themselves; bug-hunter/security-scanner/fix agents own all mutations.
133
133
  */
134
- export declare const CHIMERA_REVIEW_READ_ONLY_TOOLS: readonly ["read", "grep", "glob", "tree", "codebase-search", "codebase-stats"];
134
+ export declare const CHIMERA_REVIEW_READ_ONLY_TOOLS: readonly ["read", "grep", "glob", "tree", "codebase-stats", "codebase-search", "codebase-skeleton", "codebase-repo-map", "codebase-incoming-calls", "codebase-outgoing-calls"];
135
135
  export declare function applyChimeraReviewerReadOnlyPolicy(config: SubagentConfig): SubagentConfig;
136
136
  //# sourceMappingURL=chimera-reviewer-policy.d.ts.map
@@ -5563,7 +5563,7 @@ async function runCliExecution(params) {
5563
5563
  governanceHandle,
5564
5564
  setConfig
5565
5565
  } = params;
5566
- const { execute } = await import("./execution-CGT6J5ZN.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
  });
@@ -30470,90 +30473,7 @@ function createLifecycleHooksExtension(hookRunner) {
30470
30473
  }
30471
30474
 
30472
30475
  // src/vibe-protocol-wiring.ts
30473
- import { hasVibeTag } from "@wrongstack/requirement-intake";
30474
- import {
30475
- auditVibeExecution,
30476
- buildCoderContract,
30477
- formatVibeReport,
30478
- synthesizeVibeSpec
30479
- } from "@wrongstack/sdd";
30480
- var VIBE_PROTOCOL_META_KEY = "vibeProtocol";
30481
- function formatCoderInput(spec, coder) {
30482
- return [
30483
- "[vibe_protocol]",
30484
- "The user explicitly requested the VIBE three-stage verification protocol.",
30485
- "Implement the request using the synthesized specification and coder contract below.",
30486
- "Do not merely describe the contract: perform the requested work, verify it, and report the result.",
30487
- "",
30488
- spec.formattedSpecMarkdown,
30489
- "",
30490
- "## Coder Contract",
30491
- ...coder.instructions.map((instruction) => `- ${instruction}`),
30492
- "[/vibe_protocol]"
30493
- ].join("\n");
30494
- }
30495
- function installVibeProtocol(pipelines) {
30496
- let active2;
30497
- const userInput = {
30498
- name: "VibeProtocolInput",
30499
- owner: "cli",
30500
- async handler(payload, next) {
30501
- active2 = void 0;
30502
- delete payload.ctx.meta[VIBE_PROTOCOL_META_KEY];
30503
- if (!hasVibeTag(payload.text)) return next(payload);
30504
- const rawPrompt = payload.text;
30505
- const spec = synthesizeVibeSpec(rawPrompt);
30506
- const coder = buildCoderContract(spec);
30507
- const contractBlock = { type: "text", text: formatCoderInput(spec, coder) };
30508
- payload.content = [...payload.content, contractBlock];
30509
- payload.text = `${payload.text}
30510
-
30511
- ${contractBlock.text}`;
30512
- active2 = { rawPrompt, spec, coder, ctx: payload.ctx };
30513
- payload.ctx.meta[VIBE_PROTOCOL_META_KEY] = {
30514
- isVibeMode: true,
30515
- stage: "coder",
30516
- synthesizer: spec,
30517
- coder
30518
- };
30519
- return next(payload);
30520
- }
30521
- };
30522
- const response = {
30523
- name: "VibeProtocolAuditor",
30524
- owner: "cli",
30525
- async handler(value, next) {
30526
- const run = active2;
30527
- if (!run || value.content.some((block) => block.type === "tool_use")) return next(value);
30528
- const coderOutput = value.content.filter((block) => block.type === "text").map((block) => block.text).join("\n").trim();
30529
- if (!coderOutput) return next(value);
30530
- const audit = auditVibeExecution({
30531
- rawPrompt: run.rawPrompt,
30532
- spec: run.spec,
30533
- coderOutput
30534
- });
30535
- const markdown = formatVibeReport(run.rawPrompt, run.spec, run.coder, audit);
30536
- const report = {
30537
- isVibeMode: true,
30538
- stage: audit.verdict === "PASS" ? "passed" : "auditor",
30539
- synthesizer: run.spec,
30540
- coder: run.coder,
30541
- audit,
30542
- markdown
30543
- };
30544
- active2 = void 0;
30545
- run.ctx.meta[VIBE_PROTOCOL_META_KEY] = report;
30546
- return next({
30547
- ...value,
30548
- content: [...value.content, { type: "text", text: `
30549
-
30550
- ${markdown}` }]
30551
- });
30552
- }
30553
- };
30554
- pipelines.userInput.use(userInput);
30555
- pipelines.response.use(response);
30556
- }
30476
+ import { installVibeProtocol, VIBE_PROTOCOL_META_KEY } from "@wrongstack/sdd";
30557
30477
 
30558
30478
  // src/wiring/design-studio.ts
30559
30479
  import { installDesignStudioMiddleware as installDesignStudioMiddleware2 } from "@wrongstack/core/design";
@@ -31242,6 +31162,117 @@ function registerOrOverride(registry, name, tool) {
31242
31162
  }
31243
31163
  }
31244
31164
 
31165
+ // src/wiring/prompt-journal-recorder.ts
31166
+ import {
31167
+ PROMPT_JOURNAL_RAW_MARKER,
31168
+ recordPromptJournalEntry
31169
+ } from "@wrongstack/core/prompts";
31170
+ function systemPromptText(blocks) {
31171
+ if (!blocks || blocks.length === 0) return "";
31172
+ return blocks.map((block) => block.type === "text" ? block.text : "").filter((text) => text.trim().length > 0).join("\n").trim();
31173
+ }
31174
+ function createPromptJournalRecorder() {
31175
+ const systemPromptRecorded = /* @__PURE__ */ new Set();
31176
+ return {
31177
+ name: "PromptJournalRecorder",
31178
+ async handler(payload, next) {
31179
+ const ctx = payload.ctx;
31180
+ const meta = ctx.meta;
31181
+ const raw = typeof meta?.[PROMPT_JOURNAL_RAW_MARKER] === "string" ? meta[PROMPT_JOURNAL_RAW_MARKER] : void 0;
31182
+ if (meta) delete meta[PROMPT_JOURNAL_RAW_MARKER];
31183
+ const projectRoot = ctx.projectRoot;
31184
+ const text = payload.text.trim();
31185
+ if (projectRoot && text) {
31186
+ const sessionId = ctx.session?.id ?? ctx.activeRunSessionId ?? "general";
31187
+ const common = {
31188
+ projectRoot,
31189
+ sessionId,
31190
+ model: ctx.model,
31191
+ provider: ctx.provider?.id,
31192
+ activeTools: ctx.tools?.map((tool) => tool.name) ?? []
31193
+ };
31194
+ if (raw !== void 0 && raw !== text) {
31195
+ void recordPromptJournalEntry({
31196
+ ...common,
31197
+ category: "refined_user",
31198
+ content: text,
31199
+ rawContent: raw
31200
+ }).catch(() => {
31201
+ });
31202
+ } else {
31203
+ void recordPromptJournalEntry({
31204
+ ...common,
31205
+ category: "raw_user",
31206
+ content: text
31207
+ }).catch(() => {
31208
+ });
31209
+ }
31210
+ if (!systemPromptRecorded.has(sessionId)) {
31211
+ systemPromptRecorded.add(sessionId);
31212
+ const systemText = systemPromptText(ctx.systemPrompt);
31213
+ if (systemText) {
31214
+ void recordPromptJournalEntry({
31215
+ ...common,
31216
+ category: "system_prompt",
31217
+ content: systemText
31218
+ }).catch(() => {
31219
+ });
31220
+ }
31221
+ }
31222
+ }
31223
+ return next(payload);
31224
+ }
31225
+ };
31226
+ }
31227
+ var TOOL_CATEGORY = {
31228
+ clarify: "clarify_interaction",
31229
+ delegate: "subagent_delegation",
31230
+ continue_to_next_iteration: "autonomous_next_step"
31231
+ };
31232
+ function createPromptJournalToolCallRecorder() {
31233
+ return {
31234
+ name: "PromptJournalToolCallRecorder",
31235
+ async handler(payload, next) {
31236
+ const ctx = payload.ctx;
31237
+ const projectRoot = ctx.projectRoot;
31238
+ const toolName = payload.toolUse?.name;
31239
+ const category = toolName ? TOOL_CATEGORY[toolName] : void 0;
31240
+ if (projectRoot && category) {
31241
+ const input = payload.toolUse.input;
31242
+ const sessionId = ctx.session?.id ?? ctx.activeRunSessionId ?? "general";
31243
+ const common = {
31244
+ projectRoot,
31245
+ sessionId,
31246
+ model: ctx.model,
31247
+ provider: ctx.provider?.id,
31248
+ activeTools: ctx.tools?.map((tool) => tool.name) ?? []
31249
+ };
31250
+ let content = "";
31251
+ let decisionReason;
31252
+ if (toolName === "clarify") {
31253
+ content = typeof input?.question === "string" ? input.question : "";
31254
+ decisionReason = typeof input?.context === "string" ? input.context : void 0;
31255
+ } else if (toolName === "delegate") {
31256
+ content = typeof input?.task === "string" ? input.task : "";
31257
+ decisionReason = typeof input?.role === "string" ? `delegated to ${input.role}` : typeof input?.name === "string" ? `delegated to ${input.name}` : void 0;
31258
+ } else {
31259
+ content = "Autonomous continue to the next iteration";
31260
+ }
31261
+ if (content.trim()) {
31262
+ void recordPromptJournalEntry({
31263
+ ...common,
31264
+ category,
31265
+ content,
31266
+ decisionReason
31267
+ }).catch(() => {
31268
+ });
31269
+ }
31270
+ }
31271
+ return next(payload);
31272
+ }
31273
+ };
31274
+ }
31275
+
31245
31276
  // src/wiring/lifecycle-plugins.ts
31246
31277
  async function setupLifecycleAndPlugins(deps) {
31247
31278
  const {
@@ -31281,7 +31312,9 @@ async function setupLifecycleAndPlugins(deps) {
31281
31312
  allowNonPolicy: hooksEnabled,
31282
31313
  sessionId: () => session.id
31283
31314
  });
31315
+ pipelines.userInput.use(createPromptJournalRecorder());
31284
31316
  pipelines.userInput.use(createUserPromptSubmitMiddleware(hookRunner));
31317
+ pipelines.toolCall?.use(createPromptJournalToolCallRecorder());
31285
31318
  configStore.watch((next, prev) => {
31286
31319
  if (!shellHooksEqual(next.hooks, prev.hooks)) {
31287
31320
  try {
@@ -32029,6 +32062,12 @@ function warnUnlessMissing(logger, operation, error) {
32029
32062
  }
32030
32063
  }
32031
32064
 
32065
+ // src/cli-main.ts
32066
+ import {
32067
+ TransformersEmbeddingProvider,
32068
+ VectorMemoryStore
32069
+ } from "@wrongstack/vector-memory";
32070
+
32032
32071
  // src/wiring/replay-governance-setup.ts
32033
32072
  async function setupReplayAndGovernance({
32034
32073
  flags,
@@ -32635,6 +32674,27 @@ async function runInteractive(cliCtx) {
32635
32674
  };
32636
32675
  const memoryStore = container.resolve(TOKENS12.MemoryStore);
32637
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
+ }
32638
32698
  const skillLoader = container.resolve(TOKENS12.SkillLoader);
32639
32699
  const promptLoader = container.resolve(TOKENS12.PromptLoader);
32640
32700
  const sessionRef = {
@@ -32654,7 +32714,8 @@ async function runInteractive(cliCtx) {
32654
32714
  config,
32655
32715
  wpaths,
32656
32716
  projectRoot,
32657
- events
32717
+ events,
32718
+ vectorMemoryStore
32658
32719
  });
32659
32720
  const stdinInteractive = process.stdin.isTTY;
32660
32721
  const hookRunnerRef = { current: null };
@@ -32677,6 +32738,18 @@ async function runInteractive(cliCtx) {
32677
32738
  const tuiOwnsScreen = flags.tui === true && flags["no-tui"] !== true;
32678
32739
  const teardownHandlers = [];
32679
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
+ }
32680
32753
  const eventWiring = wireEventWiring({
32681
32754
  evOn,
32682
32755
  events,
@@ -33253,6 +33326,8 @@ async function runInteractive(cliCtx) {
33253
33326
  sessResult,
33254
33327
  sessionStore,
33255
33328
  memoryStore,
33329
+ vectorMemoryStore,
33330
+ vectorMemoryModelCacheDir,
33256
33331
  modeStore,
33257
33332
  needsSetup,
33258
33333
  statusTracker,
@@ -33327,4 +33402,4 @@ export {
33327
33402
  CLI_VERSION,
33328
33403
  runInteractive
33329
33404
  };
33330
- //# sourceMappingURL=cli-main-YDOZZOZA.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
@@ -2182,8 +2186,12 @@ var CHIMERA_REVIEW_READ_ONLY_TOOLS = Object.freeze([
2182
2186
  "grep",
2183
2187
  "glob",
2184
2188
  "tree",
2189
+ "codebase-stats",
2185
2190
  "codebase-search",
2186
- "codebase-stats"
2191
+ "codebase-skeleton",
2192
+ "codebase-repo-map",
2193
+ "codebase-incoming-calls",
2194
+ "codebase-outgoing-calls"
2187
2195
  ]);
2188
2196
  function applyChimeraReviewerReadOnlyPolicy(config) {
2189
2197
  return {
@@ -5452,6 +5460,8 @@ async function execute(deps) {
5452
5460
  mailbox,
5453
5461
  sessionStore,
5454
5462
  memoryStore,
5463
+ vectorMemoryStore: vectorMemoryStoreFromExecute,
5464
+ vectorMemoryModelCacheDir: vectorMemoryModelCacheDirFromExecute,
5455
5465
  modeStore,
5456
5466
  detachTodosCheckpoint,
5457
5467
  rebindTodosCheckpoint,
@@ -5913,6 +5923,8 @@ async function execute(deps) {
5913
5923
  subscribeEternalIteration,
5914
5924
  sessionStore: activeSessionStore,
5915
5925
  memoryStore,
5926
+ getVectorMemoryStore: () => vectorMemoryStoreFromExecute,
5927
+ vectorMemoryModelCacheDir: vectorMemoryModelCacheDirFromExecute,
5916
5928
  skillLoader,
5917
5929
  promptLoader,
5918
5930
  modeStore,
@@ -6030,4 +6042,4 @@ export {
6030
6042
  execute,
6031
6043
  resolveReviewerFallbackModels
6032
6044
  };
6033
- //# sourceMappingURL=execution-CGT6J5ZN.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-YDOZZOZA.js");
4450
+ const { runInteractive } = await import("./cli-main-RJSOWUGD.js");
4451
4451
  return runInteractive(cliCtx);
4452
4452
  }
4453
4453
 
@@ -1,10 +1,2 @@
1
- import type { AgentPipelines } from '@wrongstack/core/agent';
2
- export declare const VIBE_PROTOCOL_META_KEY = "vibeProtocol";
3
- /**
4
- * Installs the VIBE protocol on the shared Agent pipelines used by CLI, TUI,
5
- * WebUI, and single-shot runs. A tagged user turn receives the synthesized spec
6
- * and coder contract before the model runs; the first final text response is
7
- * then audited and receives the durable three-stage report.
8
- */
9
- export declare function installVibeProtocol(pipelines: AgentPipelines): void;
1
+ export { installVibeProtocol, VIBE_PROTOCOL_META_KEY } from '@wrongstack/sdd';
10
2
  //# sourceMappingURL=vibe-protocol-wiring.d.ts.map
@@ -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
  }>;
@@ -0,0 +1,45 @@
1
+ import { PROMPT_JOURNAL_RAW_MARKER } from '@wrongstack/core/prompts';
2
+ import type { ToolCallPipelinePayload, UserInputPayload } from '@wrongstack/core/agent';
3
+ /**
4
+ * userInput-pipeline middleware that records every submitted user prompt into
5
+ * the project's hierarchical prompt journal (`<projectRoot>/.wrongstack/prompts/`).
6
+ *
7
+ * The TUI's submit path stamps the raw (unrefined) text under
8
+ * `ctx.meta[PROMPT_JOURNAL_RAW_MARKER]` when the refiner rewrote the prompt;
9
+ * this middleware consumes the marker and labels the turn `refined_user` with
10
+ * `rawContent` set. Unmarked turns are `raw_user`. The session's system prompt
11
+ * is recorded once per session as `system_prompt`.
12
+ *
13
+ * Best-effort by design: recording must never block or fail a turn, so writes
14
+ * are fire-and-forget and failures are swallowed (the core writer already
15
+ * treats journal I/O as non-fatal).
16
+ */
17
+ export { PROMPT_JOURNAL_RAW_MARKER };
18
+ export interface PromptJournalRecorder {
19
+ name: string;
20
+ handler: (payload: UserInputPayload, next: (v: UserInputPayload) => Promise<UserInputPayload>) => Promise<UserInputPayload>;
21
+ }
22
+ export declare function createPromptJournalRecorder(): PromptJournalRecorder;
23
+ /**
24
+ * toolCall-pipeline middleware that records the agent-driven journal
25
+ * categories — `clarify_interaction`, `subagent_delegation` and
26
+ * `autonomous_next_step` — by recognising the tools that produce them.
27
+ *
28
+ * This complements the userInput recorder (raw/refined/system prompts) so the
29
+ * journal captures more than user submissions. Every executed tool call flows
30
+ * through the `toolCall` pipeline (`agent-tools.ts`), so one middleware sees
31
+ * all three emission points:
32
+ *
33
+ * - `clarify` → `clarify_interaction` (content: question)
34
+ * - `delegate` → `subagent_delegation` (content: task)
35
+ * - `continue_to_next_iteration` → `autonomous_next_step` (content: marker)
36
+ *
37
+ * Best-effort by design, same as the userInput recorder: writes are
38
+ * fire-and-forget and failures are swallowed.
39
+ */
40
+ export interface PromptJournalToolCallRecorder {
41
+ name: string;
42
+ handler: (payload: ToolCallPipelinePayload, next: (v: ToolCallPipelinePayload) => Promise<ToolCallPipelinePayload>) => Promise<ToolCallPipelinePayload>;
43
+ }
44
+ export declare function createPromptJournalToolCallRecorder(): PromptJournalToolCallRecorder;
45
+ //# sourceMappingURL=prompt-journal-recorder.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/cli",
3
- "version": "0.307.0",
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/bench": "0.307.0",
46
- "@wrongstack/mcp": "0.307.0",
47
- "@wrongstack/core": "0.307.0",
48
- "@wrongstack/plug-lsp": "0.307.0",
49
- "@wrongstack/kanban": "0.307.0",
50
- "@wrongstack/providers": "0.307.0",
51
- "@wrongstack/acp": "0.307.0",
52
- "@wrongstack/persistence": "0.307.0",
53
- "@wrongstack/plugins": "0.307.0",
54
- "@wrongstack/sage": "0.307.0",
55
- "@wrongstack/requirement-intake": "0.307.0",
56
- "@wrongstack/techstack": "0.307.0",
57
- "@wrongstack/sdd": "0.307.0",
58
- "@wrongstack/runtime": "0.307.0",
59
- "@wrongstack/telegram": "0.307.0",
60
- "@wrongstack/tools": "0.307.0",
61
- "@wrongstack/tui": "0.307.0",
62
- "@wrongstack/security-scanner": "0.307.0",
63
- "@wrongstack/simpleui": "0.307.0",
64
- "@wrongstack/webui": "0.307.0",
65
- "@wrongstack/webui-hq": "0.307.0",
66
- "@wrongstack/webui-server": "0.307.0"
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.0"
70
+ "@wrongstack/desktop": "0.308.0"
70
71
  },
71
72
  "devDependencies": {
72
73
  "@types/node": "^26.2.0",