@wrongstack/cli 0.307.0 → 0.307.1

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.
@@ -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-4ASWJ7EY.js");
5567
5567
  return execute(
5568
5568
  toExecuteDeps({
5569
5569
  core: {
@@ -30470,90 +30470,7 @@ function createLifecycleHooksExtension(hookRunner) {
30470
30470
  }
30471
30471
 
30472
30472
  // 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
- }
30473
+ import { installVibeProtocol, VIBE_PROTOCOL_META_KEY } from "@wrongstack/sdd";
30557
30474
 
30558
30475
  // src/wiring/design-studio.ts
30559
30476
  import { installDesignStudioMiddleware as installDesignStudioMiddleware2 } from "@wrongstack/core/design";
@@ -31242,6 +31159,117 @@ function registerOrOverride(registry, name, tool) {
31242
31159
  }
31243
31160
  }
31244
31161
 
31162
+ // src/wiring/prompt-journal-recorder.ts
31163
+ import {
31164
+ PROMPT_JOURNAL_RAW_MARKER,
31165
+ recordPromptJournalEntry
31166
+ } from "@wrongstack/core/prompts";
31167
+ function systemPromptText(blocks) {
31168
+ if (!blocks || blocks.length === 0) return "";
31169
+ return blocks.map((block) => block.type === "text" ? block.text : "").filter((text) => text.trim().length > 0).join("\n").trim();
31170
+ }
31171
+ function createPromptJournalRecorder() {
31172
+ const systemPromptRecorded = /* @__PURE__ */ new Set();
31173
+ return {
31174
+ name: "PromptJournalRecorder",
31175
+ async handler(payload, next) {
31176
+ const ctx = payload.ctx;
31177
+ const meta = ctx.meta;
31178
+ const raw = typeof meta?.[PROMPT_JOURNAL_RAW_MARKER] === "string" ? meta[PROMPT_JOURNAL_RAW_MARKER] : void 0;
31179
+ if (meta) delete meta[PROMPT_JOURNAL_RAW_MARKER];
31180
+ const projectRoot = ctx.projectRoot;
31181
+ const text = payload.text.trim();
31182
+ if (projectRoot && text) {
31183
+ const sessionId = ctx.session?.id ?? ctx.activeRunSessionId ?? "general";
31184
+ const common = {
31185
+ projectRoot,
31186
+ sessionId,
31187
+ model: ctx.model,
31188
+ provider: ctx.provider?.id,
31189
+ activeTools: ctx.tools?.map((tool) => tool.name) ?? []
31190
+ };
31191
+ if (raw !== void 0 && raw !== text) {
31192
+ void recordPromptJournalEntry({
31193
+ ...common,
31194
+ category: "refined_user",
31195
+ content: text,
31196
+ rawContent: raw
31197
+ }).catch(() => {
31198
+ });
31199
+ } else {
31200
+ void recordPromptJournalEntry({
31201
+ ...common,
31202
+ category: "raw_user",
31203
+ content: text
31204
+ }).catch(() => {
31205
+ });
31206
+ }
31207
+ if (!systemPromptRecorded.has(sessionId)) {
31208
+ systemPromptRecorded.add(sessionId);
31209
+ const systemText = systemPromptText(ctx.systemPrompt);
31210
+ if (systemText) {
31211
+ void recordPromptJournalEntry({
31212
+ ...common,
31213
+ category: "system_prompt",
31214
+ content: systemText
31215
+ }).catch(() => {
31216
+ });
31217
+ }
31218
+ }
31219
+ }
31220
+ return next(payload);
31221
+ }
31222
+ };
31223
+ }
31224
+ var TOOL_CATEGORY = {
31225
+ clarify: "clarify_interaction",
31226
+ delegate: "subagent_delegation",
31227
+ continue_to_next_iteration: "autonomous_next_step"
31228
+ };
31229
+ function createPromptJournalToolCallRecorder() {
31230
+ return {
31231
+ name: "PromptJournalToolCallRecorder",
31232
+ async handler(payload, next) {
31233
+ const ctx = payload.ctx;
31234
+ const projectRoot = ctx.projectRoot;
31235
+ const toolName = payload.toolUse?.name;
31236
+ const category = toolName ? TOOL_CATEGORY[toolName] : void 0;
31237
+ if (projectRoot && category) {
31238
+ const input = payload.toolUse.input;
31239
+ const sessionId = ctx.session?.id ?? ctx.activeRunSessionId ?? "general";
31240
+ const common = {
31241
+ projectRoot,
31242
+ sessionId,
31243
+ model: ctx.model,
31244
+ provider: ctx.provider?.id,
31245
+ activeTools: ctx.tools?.map((tool) => tool.name) ?? []
31246
+ };
31247
+ let content = "";
31248
+ let decisionReason;
31249
+ if (toolName === "clarify") {
31250
+ content = typeof input?.question === "string" ? input.question : "";
31251
+ decisionReason = typeof input?.context === "string" ? input.context : void 0;
31252
+ } else if (toolName === "delegate") {
31253
+ content = typeof input?.task === "string" ? input.task : "";
31254
+ decisionReason = typeof input?.role === "string" ? `delegated to ${input.role}` : typeof input?.name === "string" ? `delegated to ${input.name}` : void 0;
31255
+ } else {
31256
+ content = "Autonomous continue to the next iteration";
31257
+ }
31258
+ if (content.trim()) {
31259
+ void recordPromptJournalEntry({
31260
+ ...common,
31261
+ category,
31262
+ content,
31263
+ decisionReason
31264
+ }).catch(() => {
31265
+ });
31266
+ }
31267
+ }
31268
+ return next(payload);
31269
+ }
31270
+ };
31271
+ }
31272
+
31245
31273
  // src/wiring/lifecycle-plugins.ts
31246
31274
  async function setupLifecycleAndPlugins(deps) {
31247
31275
  const {
@@ -31281,7 +31309,9 @@ async function setupLifecycleAndPlugins(deps) {
31281
31309
  allowNonPolicy: hooksEnabled,
31282
31310
  sessionId: () => session.id
31283
31311
  });
31312
+ pipelines.userInput.use(createPromptJournalRecorder());
31284
31313
  pipelines.userInput.use(createUserPromptSubmitMiddleware(hookRunner));
31314
+ pipelines.toolCall?.use(createPromptJournalToolCallRecorder());
31285
31315
  configStore.watch((next, prev) => {
31286
31316
  if (!shellHooksEqual(next.hooks, prev.hooks)) {
31287
31317
  try {
@@ -33327,4 +33357,4 @@ export {
33327
33357
  CLI_VERSION,
33328
33358
  runInteractive
33329
33359
  };
33330
- //# sourceMappingURL=cli-main-YDOZZOZA.js.map
33360
+ //# sourceMappingURL=cli-main-DD3I7KOO.js.map
@@ -2182,8 +2182,12 @@ var CHIMERA_REVIEW_READ_ONLY_TOOLS = Object.freeze([
2182
2182
  "grep",
2183
2183
  "glob",
2184
2184
  "tree",
2185
+ "codebase-stats",
2185
2186
  "codebase-search",
2186
- "codebase-stats"
2187
+ "codebase-skeleton",
2188
+ "codebase-repo-map",
2189
+ "codebase-incoming-calls",
2190
+ "codebase-outgoing-calls"
2187
2191
  ]);
2188
2192
  function applyChimeraReviewerReadOnlyPolicy(config) {
2189
2193
  return {
@@ -6030,4 +6034,4 @@ export {
6030
6034
  execute,
6031
6035
  resolveReviewerFallbackModels
6032
6036
  };
6033
- //# sourceMappingURL=execution-CGT6J5ZN.js.map
6037
+ //# sourceMappingURL=execution-4ASWJ7EY.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-DD3I7KOO.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
@@ -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.307.1",
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,31 @@
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.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"
67
67
  },
68
68
  "optionalDependencies": {
69
- "@wrongstack/desktop": "0.307.0"
69
+ "@wrongstack/desktop": "0.307.1"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/node": "^26.2.0",