@viberaven/mcp 1.6.12 → 1.7.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.
@@ -32,12 +32,514 @@ __export(cli_runner_exports, {
32
32
  mcpVersion: () => mcpVersion,
33
33
  resolveCwd: () => resolveCwd,
34
34
  runVibeRaven: () => runVibeRaven,
35
+ runVibeRavenDetailed: () => runVibeRavenDetailed,
35
36
  safeStringArg: () => safeStringArg
36
37
  });
37
38
  module.exports = __toCommonJS(cli_runner_exports);
39
+
40
+ // ../../shared/taskContract.ts
41
+ var TASK_CONTRACT_MAX_BYTES = 4800;
42
+ var condition = { type: "object", properties: {
43
+ id: { type: "string", pattern: "^[a-z][a-z0-9_-]{0,39}$" },
44
+ description: { type: "string", minLength: 1, maxLength: 240, pattern: "\\S" }
45
+ }, required: ["id", "description"], additionalProperties: false };
46
+ var TASK_CONTRACT_SCHEMA = {
47
+ $schema: "http://json-schema.org/draft-07/schema#",
48
+ title: "VibeRaven Task contract v1",
49
+ type: "object",
50
+ description: "Declarative task definition, not executable commands or evidence. Runtime also enforces a 4800-byte UTF-8 limit and condition IDs unique across both lists.",
51
+ properties: {
52
+ schemaVersion: { const: 1 },
53
+ status: { type: "string", enum: ["draft", "ready"] },
54
+ request: { type: "string", minLength: 1, maxLength: 1200, pattern: "^\\S(?:[\\s\\S]*\\S)?(?![\\s\\S])" },
55
+ acceptance: { type: "array", items: condition, maxItems: 16, uniqueItems: true },
56
+ mustNotBreak: { type: "array", items: condition, maxItems: 16, uniqueItems: true },
57
+ scope: { type: "object", properties: {
58
+ environment: { type: "string", enum: ["local", "preview", "test-mode"] },
59
+ paths: { type: "array", minItems: 0, maxItems: 16, uniqueItems: true, items: {
60
+ type: "string",
61
+ minLength: 1,
62
+ maxLength: 200,
63
+ pattern: '^(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\\\:*?"<>|\\u0000-\\u001f])(?!/)(?!.*//)(?!.*[. ](?:/|$))[^/]+(?:/[^/]+)*$'
64
+ } },
65
+ providers: { type: "array", maxItems: 8, uniqueItems: true, items: { type: "string", pattern: "^[a-z][a-z0-9-]{0,39}$" } }
66
+ }, required: ["environment", "paths", "providers"], additionalProperties: false }
67
+ },
68
+ required: ["schemaVersion", "status", "request", "acceptance", "mustNotBreak", "scope"],
69
+ additionalProperties: false,
70
+ allOf: [{ if: { properties: { status: { const: "ready" } } }, then: { properties: {
71
+ acceptance: { minItems: 1 },
72
+ scope: { properties: { paths: { minItems: 1 } } }
73
+ } } }]
74
+ };
75
+ function validate(value, schema, path2) {
76
+ const fail = () => {
77
+ throw new Error(`Invalid Task contract at ${path2}.`);
78
+ };
79
+ if ("const" in schema && value !== schema.const) fail();
80
+ if (schema.enum && !schema.enum.includes(value)) fail();
81
+ if (schema.type === "object" && (!value || typeof value !== "object" || Array.isArray(value))) fail();
82
+ if (schema.type === "string" && typeof value !== "string") fail();
83
+ if (schema.type === "array" && !Array.isArray(value)) fail();
84
+ if (typeof value === "string" && (schema.minLength !== void 0 && [...value].length < schema.minLength || schema.maxLength !== void 0 && [...value].length > schema.maxLength || schema.pattern && !new RegExp(schema.pattern, "u").test(value))) fail();
85
+ if (Array.isArray(value)) {
86
+ if (schema.minItems !== void 0 && value.length < schema.minItems || schema.maxItems !== void 0 && value.length > schema.maxItems || schema.uniqueItems && new Set(value.map((v) => JSON.stringify(v))).size !== value.length) fail();
87
+ value.forEach((item, i) => {
88
+ if (schema.items) validate(item, schema.items, `${path2}[${i}]`);
89
+ });
90
+ } else if (value && typeof value === "object") {
91
+ const object = value;
92
+ for (const key of schema.required ?? []) if (!Object.hasOwn(object, key)) fail();
93
+ for (const key of Object.keys(object)) {
94
+ if (schema.additionalProperties === false && !Object.hasOwn(schema.properties ?? {}, key)) fail();
95
+ if (Object.hasOwn(schema.properties ?? {}, key)) validate(object[key], schema.properties[key], `${path2}.${key}`);
96
+ }
97
+ }
98
+ for (const clause of schema.allOf ?? []) {
99
+ let matches = true;
100
+ try {
101
+ validate(value, clause.if, path2);
102
+ } catch {
103
+ matches = false;
104
+ }
105
+ if (matches) validate(value, clause.then, path2);
106
+ }
107
+ }
108
+ function parseTaskContract(raw) {
109
+ const serialized = JSON.stringify(raw);
110
+ if (!serialized || Buffer.byteLength(serialized, "utf8") > TASK_CONTRACT_MAX_BYTES) throw new Error("Task contract exceeds 4800 UTF-8 bytes.");
111
+ validate(raw, TASK_CONTRACT_SCHEMA, "$");
112
+ const contract = JSON.parse(serialized);
113
+ const ids = [...contract.acceptance, ...contract.mustNotBreak].map((c) => c.id);
114
+ if (new Set(ids).size !== ids.length) throw new Error("Task condition IDs must be unique across acceptance and mustNotBreak.");
115
+ if (contract.request.length > 1200) throw new Error("Task request exceeds the account API limit of 1200 characters.");
116
+ return contract;
117
+ }
118
+ function draftTaskContract(request) {
119
+ return parseTaskContract({ schemaVersion: 1, status: "draft", request, acceptance: [], mustNotBreak: [], scope: { environment: "local", paths: [], providers: [] } });
120
+ }
121
+
122
+ // ../../shared/verificationPlan.ts
123
+ var VERIFICATION_PLAN_MAX_BYTES = 65536;
124
+ var HTTP_LIMITS = { bodyBytes: 8192, responseBytes: 8192, requestTimeoutMs: 2e3, totalResponseBytes: 32768 };
125
+ var httpMethods = ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"];
126
+ var httpPathPattern = "^/(?!/)(?!.*%(?:0[0-9a-fA-F]|1[0-9a-fA-F]|20|7[fF]|5[cC]))[!-~]*$(?![\\s\\S])";
127
+ var httpHeaderPattern = "^(?:accept|content-type|stripe-signature|x-(?:fixture|test)-[a-z0-9-]{1,40})$(?![\\s\\S])";
128
+ var httpExpected = {
129
+ type: "object",
130
+ properties: { status: { type: "integer", minimum: 200, maximum: 599 }, json: {}, text: { type: "string", maxLength: HTTP_LIMITS.responseBytes } },
131
+ required: ["status"],
132
+ additionalProperties: false,
133
+ oneOf: [{ required: ["json"], not: { required: ["text"] } }, { required: ["text"], not: { required: ["json"] } }],
134
+ allOf: [{ if: { properties: { status: { enum: [204, 205, 304] } } }, then: { required: ["text"], properties: { text: { const: "" } }, not: { required: ["json"] } } }]
135
+ };
136
+ var httpCase = {
137
+ type: "object",
138
+ properties: { request: {
139
+ type: "object",
140
+ properties: {
141
+ method: { enum: httpMethods },
142
+ path: { type: "string", minLength: 1, maxLength: 2048, allOf: [{ pattern: httpPathPattern }, { not: { pattern: "[\\\\#]" } }] },
143
+ headers: { type: "object", maxProperties: 8, propertyNames: { pattern: httpHeaderPattern }, additionalProperties: { type: "string", maxLength: 512, pattern: "^[ -~]*$(?![\\s\\S])" } },
144
+ body: { type: "string", maxLength: HTTP_LIMITS.bodyBytes }
145
+ },
146
+ required: ["method", "path"],
147
+ additionalProperties: false,
148
+ allOf: [{ if: { properties: { method: { enum: ["GET", "HEAD"] } } }, then: { not: { required: ["body"] } } }]
149
+ }, expected: httpExpected },
150
+ required: ["request", "expected"],
151
+ additionalProperties: false,
152
+ allOf: [{ if: { properties: { request: { properties: { method: { const: "HEAD" } } } } }, then: { properties: { expected: { required: ["text"], properties: { text: { const: "" } }, not: { required: ["json"] } } } } }]
153
+ };
154
+ var id = { type: "string", pattern: "^[a-z][a-z0-9_-]{0,39}$" };
155
+ var verificationPathPattern = '^(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\\\:*?"<>|\\u0000-\\u001f])(?!/)(?!.*//)(?!.*[. ](?:/|$))[^/]+(?:/[^/]+)*$';
156
+ var path = { type: "string", minLength: 1, maxLength: 200, pattern: verificationPathPattern };
157
+ var common = { id, conditionId: id };
158
+ var VERIFICATION_PLAN_SCHEMA = {
159
+ $schema: "http://json-schema.org/draft-07/schema#",
160
+ title: "VibeRaven local verification plan v1",
161
+ type: "object",
162
+ properties: { schemaVersion: { const: 1 }, checks: { type: "array", minItems: 1, maxItems: 32, items: { oneOf: [
163
+ { type: "object", properties: {
164
+ ...common,
165
+ adapter: { const: "module" },
166
+ module: path,
167
+ export: { type: "string", pattern: "^[A-Za-z_$][A-Za-z0-9_$]{0,79}$" },
168
+ cases: { type: "array", minItems: 1, maxItems: 32, items: { type: "object", properties: { args: { type: "array", maxItems: 16 }, expected: {} }, required: ["args", "expected"], additionalProperties: false } }
169
+ }, required: ["id", "conditionId", "adapter", "module", "export", "cases"], additionalProperties: false },
170
+ { type: "object", properties: { ...common, adapter: { const: "node-test" }, entry: path, frozenPaths: { type: "array", minItems: 0, maxItems: 16, uniqueItems: true, items: path } }, required: ["id", "conditionId", "adapter", "entry", "frozenPaths"], additionalProperties: false },
171
+ { type: "object", properties: { ...common, adapter: { const: "http" }, module: path, export: { type: "string", pattern: "^[A-Za-z_$][A-Za-z0-9_$]{0,79}$" }, cases: { type: "array", minItems: 1, maxItems: 32, items: httpCase } }, required: ["id", "conditionId", "adapter", "module", "export", "cases"], additionalProperties: false }
172
+ ] } } },
173
+ required: ["schemaVersion", "checks"],
174
+ additionalProperties: false,
175
+ description: "Reviewed local observations, not commands or imported proof. Runtime also bounds JSON depth/UTF-8 bytes, including HTTP request/expected bodies to 8192 bytes, rejects unknown condition IDs, and restricts node-test to preservation conditions and frozen test-owned paths. HTTP factories return unlistened Node servers; sequential requests observe volatile state only. Runtime package/config files remain candidate inputs. Expected values remain in the host comparator. Coverage completeness is a human judgment."
176
+ };
177
+ function validVerificationPath(value) {
178
+ return typeof value === "string" && value.length <= 200 && new RegExp(verificationPathPattern, "u").test(value) && !value.split("/").some((p) => /^(?:con|prn|aux|nul|com[0-9]|lpt[0-9])(?:\.|$)/i.test(p));
179
+ }
180
+ function frozenVerificationPath(path2) {
181
+ return /^(?:tests?|__tests__)(?:\/|$)|(?:^|\/)[^/]+\.(?:test|spec)\.[^/]+$/i.test(path2);
182
+ }
183
+ function keys(value, required) {
184
+ if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).sort().join(",") !== [...required].sort().join(",")) throw new Error("Invalid verification plan fields. Commands and evidence are not accepted.");
185
+ }
186
+ function boundedJson(value, depth = 0) {
187
+ if (depth > 12) throw new Error("Verification JSON exceeds depth 12.");
188
+ if (value === null || typeof value === "boolean" || typeof value === "string") return;
189
+ if (typeof value === "number" && Number.isFinite(value)) return;
190
+ if (Array.isArray(value)) {
191
+ if (value.length > 256) throw new Error("Verification JSON array exceeds 256 items.");
192
+ value.forEach((v) => boundedJson(v, depth + 1));
193
+ return;
194
+ }
195
+ if (value && typeof value === "object" && Object.getPrototypeOf(value) === Object.prototype) {
196
+ if (Object.keys(value).length > 256) throw new Error("Verification JSON object exceeds 256 keys.");
197
+ for (const [k, v] of Object.entries(value)) {
198
+ if (["__proto__", "prototype", "constructor"].includes(k)) throw new Error("Unsafe verification JSON key.");
199
+ boundedJson(v, depth + 1);
200
+ }
201
+ return;
202
+ }
203
+ throw new Error("Verification values must be finite JSON data.");
204
+ }
205
+ function parseVerificationPlan(raw, contract) {
206
+ boundedJson(raw);
207
+ if (Buffer.byteLength(JSON.stringify(raw), "utf8") > VERIFICATION_PLAN_MAX_BYTES) throw new Error("Verification plan exceeds 65536 UTF-8 bytes.");
208
+ keys(raw, ["schemaVersion", "checks"]);
209
+ if (raw.schemaVersion !== 1 || !Array.isArray(raw.checks) || !raw.checks.length || raw.checks.length > 32) throw new Error("Invalid verification plan checks.");
210
+ const seen = /* @__PURE__ */ new Set();
211
+ for (const c of raw.checks) {
212
+ if (!c || typeof c !== "object") throw new Error("Invalid verification check.");
213
+ if (c.adapter === "module" || c.adapter === "http") {
214
+ keys(c, ["id", "conditionId", "adapter", "module", "export", "cases"]);
215
+ if (!validVerificationPath(c.module) || typeof c.export !== "string" || !/^[A-Za-z_$][A-Za-z0-9_$]{0,79}$/.test(c.export) || !Array.isArray(c.cases) || !c.cases.length || c.cases.length > 32) throw new Error("Invalid module verification check.");
216
+ for (const test of c.cases) {
217
+ if (c.adapter === "module") {
218
+ keys(test, ["args", "expected"]);
219
+ if (!Array.isArray(test.args) || test.args.length > 16) throw new Error("Invalid module arguments.");
220
+ } else validateHttpCase(test);
221
+ }
222
+ } else if (c.adapter === "node-test") {
223
+ keys(c, ["id", "conditionId", "adapter", "entry", "frozenPaths"]);
224
+ if (!validVerificationPath(c.entry) || !frozenVerificationPath(c.entry) || !Array.isArray(c.frozenPaths) || c.frozenPaths.length > 16 || new Set(c.frozenPaths).size !== c.frozenPaths.length || c.frozenPaths.some((p) => !validVerificationPath(p) || !frozenVerificationPath(p))) throw new Error("Node-test entries/helpers must be frozen test-owned paths; runtime package/config files stay candidate inputs.");
225
+ if (contract && !contract.mustNotBreak.some((condition2) => condition2.id === c.conditionId)) throw new Error("Node-test checks support mustNotBreak only; use independent module observations for acceptance.");
226
+ } else throw new Error("Unsupported verification adapter. No shell commands are accepted.");
227
+ if (typeof c.id !== "string" || !/^[a-z][a-z0-9_-]{0,39}$/.test(c.id) || seen.has(c.id) || typeof c.conditionId !== "string" || !/^[a-z][a-z0-9_-]{0,39}$/.test(c.conditionId)) throw new Error("Invalid or duplicate verification ID.");
228
+ seen.add(c.id);
229
+ if (contract && ![...contract.acceptance, ...contract.mustNotBreak].some((condition2) => condition2.id === c.conditionId)) throw new Error("Unknown verification condition ID.");
230
+ }
231
+ return JSON.parse(JSON.stringify(raw));
232
+ }
233
+ function validateHttpCase(test) {
234
+ keys(test, ["request", "expected"]);
235
+ const request = test.request, expected = test.expected;
236
+ if (!request || typeof request !== "object" || Array.isArray(request)) throw new Error("Invalid HTTP request.");
237
+ keys(request, ["method", "path", ..."headers" in request ? ["headers"] : [], ..."body" in request ? ["body"] : []]);
238
+ if (!httpMethods.includes(request.method) || typeof request.path !== "string" || request.path.length > 2048 || !new RegExp(httpPathPattern).test(request.path) || /[\\#]/.test(request.path)) throw new Error("Invalid HTTP method or origin-relative path.");
239
+ if ("body" in request && (typeof request.body !== "string" || Buffer.byteLength(request.body, "utf8") > HTTP_LIMITS.bodyBytes || ["GET", "HEAD"].includes(request.method))) throw new Error("Invalid HTTP request body.");
240
+ if ("headers" in request) {
241
+ const headers = request.headers;
242
+ if (!headers || typeof headers !== "object" || Array.isArray(headers) || Object.keys(headers).length > 8 || Object.entries(headers).some(([name, value]) => !new RegExp(httpHeaderPattern).test(name) || typeof value !== "string" || value.length > 512 || /[^ -~]/.test(value))) throw new Error("Invalid synthetic HTTP headers.");
243
+ }
244
+ if (!expected || typeof expected !== "object" || Array.isArray(expected)) throw new Error("Missing HTTP expectation.");
245
+ const hasJson = Object.hasOwn(expected, "json");
246
+ keys(expected, ["status", hasJson ? "json" : "text"]);
247
+ if (!Number.isInteger(expected.status) || expected.status < 200 || expected.status > 599 || !hasJson && typeof expected.text !== "string") throw new Error("Invalid HTTP expectation.");
248
+ if (Buffer.byteLength(hasJson ? JSON.stringify(expected.json) : expected.text, "utf8") > HTTP_LIMITS.responseBytes) throw new Error("HTTP expected body exceeds byte limit.");
249
+ if ((request.method === "HEAD" || [204, 205, 304].includes(expected.status)) && (hasJson || expected.text !== "")) throw new Error("HTTP response must have an empty text body.");
250
+ }
251
+
252
+ // ../../shared/workTools.ts
253
+ var cwd = { type: "string", minLength: 1, maxLength: 4096 };
254
+ var taskId = { type: "string", pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" };
255
+ var WORK_TOOLS = [
256
+ {
257
+ name: "viberaven_work_start",
258
+ description: "Save a versioned Task contract and run a free local check without login, network, edits or payment. Prefer contract; request alone saves a draft with unknown acceptance. No credentials or shell command fields. Review the returned contract before approving resume. Resume shares its short request and redacted results with the account; the full definition stays local. Provider and non-local contracts are planning only.",
259
+ inputSchema: { type: "object", properties: { cwd, contract: TASK_CONTRACT_SCHEMA, request: { type: "string", minLength: 1, maxLength: 1200 }, cli: { type: "string", enum: ["claude", "codex", "gemini"] }, access: { type: "string", enum: ["ask", "approve"] } }, required: ["cli", "access"], oneOf: [{ required: ["contract"], not: { required: ["request"] } }, { required: ["request"], not: { required: ["contract"] } }], additionalProperties: false }
260
+ },
261
+ {
262
+ name: "viberaven_work_resume",
263
+ description: "Resume the SAME saved task through account sign-in, quota or payment. Set approvedContract=true only after explicit human approval of its exact acceptance, must-not-break conditions and declared scope. A draft can be upgraded with contract before any job exists; its request must stay identical. Never authorize sign-in or payment for the person. Execution state is separate from independent verification observations; agent success is not condition proof. Scope declarations are not an enforced sandbox.",
264
+ inputSchema: { type: "object", properties: { cwd, taskId, contract: TASK_CONTRACT_SCHEMA, approvedContract: { type: "boolean" } }, required: ["taskId"], additionalProperties: false }
265
+ },
266
+ {
267
+ name: "viberaven_work_status",
268
+ description: "Read the saved Task contract, execution state and independent verification receipts locally without account, network, edits or payment. Current worktree changes invalidate checked proof; missing observations stay not_checked. Checked conditions separately report passed/failed outcomes. Historical agent results do not verify conditions.",
269
+ inputSchema: { type: "object", properties: { cwd, taskId }, required: ["taskId"], additionalProperties: false }
270
+ },
271
+ {
272
+ name: "viberaven_work_prepare",
273
+ description: "Before implementing a local Node feature, freeze reviewed expected behavior and actual dirty/untracked baseline. Supports module comparisons, sequential HTTP requests to an isolated local server factory, and frozen Node preservation tests. No login or network; no commands or imported proof. MCP plans are limited to 4800 UTF-8 bytes; larger plans use the CLI JSON file (65536 bytes). No browser, database or live provider proof. Changed plans require a new task.",
274
+ inputSchema: { type: "object", properties: { cwd, taskId, verification: VERIFICATION_PLAN_SCHEMA }, required: ["taskId", "verification"], additionalProperties: false }
275
+ },
276
+ {
277
+ name: "viberaven_work_verify",
278
+ description: "Run or resume the SAME frozen plan using the locally available pinned Docker image only. Set approvedVerification=true only after human review/approval. Network is disabled and no dependencies are installed. No login or billing. Missing conditions, dependencies or Docker remain not_checked; completed receipts are reused for the identical candidate. Coding-agent success is not proof.",
279
+ inputSchema: { type: "object", properties: { cwd, taskId, approvedVerification: { type: "boolean" } }, required: ["taskId", "approvedVerification"], additionalProperties: false }
280
+ },
281
+ {
282
+ name: "viberaven_work_report",
283
+ description: "Export a bounded local draft proof report with Markdown from current integrity-checked verification receipts. Read-only: no login, network, Docker, agent or GitHub execution. Failed and unknown evidence remain explicit; agent success is not proof. Not authoritative CI or a completed live PR pilot. Review redacted text before sharing; redaction is not a complete secret scanner.",
284
+ inputSchema: { type: "object", properties: { cwd, taskId }, required: ["taskId"], additionalProperties: false }
285
+ }
286
+ ];
287
+ var isWorkTool = (name) => WORK_TOOLS.some((tool) => tool.name === name);
288
+ function buildWorkToolArgs(name, raw) {
289
+ const invalid2 = () => {
290
+ throw new Error("Invalid work-tool arguments. Use only the documented Task contract or taskId; no credentials or commands.");
291
+ };
292
+ if (!isWorkTool(name) || !raw || typeof raw !== "object" || Array.isArray(raw)) return invalid2();
293
+ const args = raw;
294
+ const action = name.slice("viberaven_work_".length);
295
+ const allowed = action === "start" ? ["cwd", "request", "contract", "cli", "access"] : action === "resume" ? ["cwd", "taskId", "contract", "approvedContract"] : action === "prepare" ? ["cwd", "taskId", "verification"] : action === "verify" ? ["cwd", "taskId", "approvedVerification"] : ["cwd", "taskId"];
296
+ if (Object.keys(args).some((key) => !allowed.includes(key))) return invalid2();
297
+ if (args.cwd !== void 0 && (typeof args.cwd !== "string" || !args.cwd.trim() || args.cwd.length > 4096 || /[\0\r\n]/.test(args.cwd))) return invalid2();
298
+ const out = ["work", action];
299
+ if (action === "start") {
300
+ if (args.contract === void 0 === (args.request === void 0) || !["claude", "codex", "gemini"].includes(args.cli) || !["ask", "approve"].includes(args.access)) return invalid2();
301
+ if (args.request !== void 0) {
302
+ if (typeof args.request !== "string") return invalid2();
303
+ draftTaskContract(args.request);
304
+ out.push("--request-base64", Buffer.from(args.request, "utf8").toString("base64url"));
305
+ }
306
+ out.push("--source", "mcp", "--cli", args.cli, "--access", args.access);
307
+ } else {
308
+ if (typeof args.taskId !== "string" || !new RegExp(taskId.pattern).test(args.taskId)) return invalid2();
309
+ if (args.approvedContract !== void 0 && typeof args.approvedContract !== "boolean") return invalid2();
310
+ out.push("--id", args.taskId);
311
+ if (args.approvedContract === true) out.push("--approve-contract");
312
+ if (action === "prepare") {
313
+ const plan = JSON.stringify(parseVerificationPlan(args.verification));
314
+ if (Buffer.byteLength(plan, "utf8") > 4800) throw new Error("MCP verification transport exceeds 4800 bytes. Use work prepare --verification <file.json>.");
315
+ out.push("--verification-base64", Buffer.from(plan, "utf8").toString("base64url"));
316
+ }
317
+ if (action === "verify") {
318
+ if (typeof args.approvedVerification !== "boolean") return invalid2();
319
+ if (args.approvedVerification) out.push("--approve-verification");
320
+ }
321
+ }
322
+ if (args.contract !== void 0) out.push("--contract-base64", Buffer.from(JSON.stringify(parseTaskContract(args.contract)), "utf8").toString("base64url"));
323
+ return [...out, "--json"];
324
+ }
325
+
326
+ // ../../shared/rlsTool.ts
327
+ var RLS_TOOL_NAME = "viberaven_rls_test";
328
+ var RLS_RUN_TIMEOUT_MS = 3e5;
329
+ var RLS_MAX_OUTPUT_BYTES = 8 * 1024 * 1024;
330
+ var MAX_PATH_LENGTH = 4096;
331
+ function record(value) {
332
+ return value !== null && typeof value === "object" && !Array.isArray(value);
333
+ }
334
+ function nonempty(value) {
335
+ return typeof value === "string" && Boolean(value.trim());
336
+ }
337
+ function pathArg(value, name, commandLine = true) {
338
+ if (!nonempty(value) || value.length > MAX_PATH_LENGTH || /[\x00-\x1f\x7f]/.test(value)) throw Error(`Invalid RLS ${name}: expected a non-empty local path up to ${MAX_PATH_LENGTH} characters`);
339
+ if (commandLine && (value.trimStart().startsWith("-") || /[&|<>^%!"'`$();]/.test(value))) throw Error(`Unsafe RLS ${name} path`);
340
+ return value;
341
+ }
342
+ function buildRlsToolArgs(input) {
343
+ if (!record(input) || Object.keys(input).some((key) => !["matrix", "migrations", "cwd"].includes(key))) throw Error("Invalid RLS tool arguments: only matrix, migrations and cwd are accepted");
344
+ const args = ["rls-test", "--json", "--matrix", pathArg(input.matrix, "matrix")];
345
+ if ("migrations" in input) args.push("--migrations", pathArg(input.migrations, "migrations"));
346
+ if ("cwd" in input) pathArg(input.cwd, "cwd", false);
347
+ return args;
348
+ }
349
+
350
+ // src/lib/cli-runner.ts
38
351
  var import_node_child_process = require("node:child_process");
39
- var import_node_fs = require("node:fs");
352
+ var import_node_fs3 = require("node:fs");
353
+ var import_node_path2 = require("node:path");
354
+
355
+ // ../../shared/liveTools.ts
356
+ var cwd2 = { type: "string", description: "Local project directory. Defaults to the MCP working directory." };
357
+ var stepId = { type: "string", format: "uuid", description: "The stepId returned by live_start; preserve it through sign-in, payment and retries." };
358
+ var supabaseProjectPattern = "^[a-z]{20}$";
359
+ var vercelProjectPattern = "^prj_[a-zA-Z0-9]{8,80}$";
360
+ var vercelTeamPattern = "^team_[a-zA-Z0-9]{8,80}$";
361
+ var schemaPattern = "^(?!pg_)(?!(?:auth|storage|vault|information_schema)$)[a-z][a-z0-9_]{0,62}$";
362
+ var LIVE_TOOLS = [
363
+ {
364
+ name: "viberaven_live_start",
365
+ description: "Local candidate feature: save a scoped metadata-verification request without provider reads or payment. Supabase catalog reads require a VibeRaven account and explicit human consent on resume. Vercel is deliberately blocked before network access. Local repository checks stay free without an account. Never pass credentials as tool arguments.",
366
+ inputSchema: {
367
+ type: "object",
368
+ properties: {
369
+ cwd: cwd2,
370
+ provider: { type: "string", enum: ["supabase", "vercel"] },
371
+ projectRef: { type: "string", description: "Exact provider project ID: 20 lowercase letters for Supabase, or prj_ followed by 8\u201380 alphanumeric characters for Vercel." },
372
+ schemas: { type: "array", items: { type: "string", pattern: schemaPattern }, minItems: 1, maxItems: 8, uniqueItems: true, description: "1\u20138 lowercase application schemas; defaults to public. Excludes pg_, auth, storage, vault and information_schema. No application-row reads." },
373
+ teamId: { type: "string", pattern: vercelTeamPattern, description: "Optional Vercel team_ ID with 8\u201380 alphanumeric characters. Vercel transport is currently blocked." }
374
+ },
375
+ required: ["provider", "projectRef"],
376
+ additionalProperties: false,
377
+ allOf: [
378
+ { if: { properties: { provider: { const: "supabase" } } }, then: { properties: { projectRef: { pattern: supabaseProjectPattern } }, not: { required: ["teamId"] } } },
379
+ { if: { properties: { provider: { const: "vercel" } } }, then: { properties: { projectRef: { pattern: vercelProjectPattern } }, not: { required: ["schemas"] } } }
380
+ ]
381
+ }
382
+ },
383
+ {
384
+ name: "viberaven_live_resume",
385
+ description: "Local candidate feature: resume the SAME saved live step through account connection, allowance and metadata verification. Set approvedRead=true only after the person explicitly approves the named Supabase project/schema catalog read. Show any returned action URL and wait for the person; never approve sign-in or payment for them. Credentials stay local and are never tool arguments. Vercel stays blocked; local checks stay free.",
386
+ inputSchema: { type: "object", properties: { cwd: cwd2, stepId, approvedRead: { type: "boolean", description: "True only after explicit human approval of this saved provider/project/schema read." } }, required: ["stepId"], additionalProperties: false }
387
+ },
388
+ {
389
+ name: "viberaven_live_status",
390
+ description: "Local candidate feature: read the saved live-step receipt without provider reads, payment or another live-step charge. Evidence is historical and scoped, not proof of application security. Local checks stay free.",
391
+ inputSchema: { type: "object", properties: { cwd: cwd2, stepId }, required: ["stepId"], additionalProperties: false }
392
+ },
393
+ {
394
+ name: "viberaven_live_disconnect",
395
+ description: "Local candidate feature: disconnect the saved live step and remove its locally retained provider credential and evidence. Does not alter provider settings or unrelated MCP credentials. Unfinished account reservations expire. Local checks stay free.",
396
+ inputSchema: { type: "object", properties: { cwd: cwd2, stepId }, required: ["stepId"], additionalProperties: false }
397
+ }
398
+ ];
399
+ function isLiveTool(name) {
400
+ return LIVE_TOOLS.some((tool) => tool.name === name);
401
+ }
402
+ var uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
403
+ function invalid() {
404
+ throw new Error("Invalid live-tool arguments. Use only the documented scope or saved stepId; never pass credentials.");
405
+ }
406
+ function buildLiveToolArgs(name, raw) {
407
+ if (!isLiveTool(name) || !raw || typeof raw !== "object" || Array.isArray(raw)) return invalid();
408
+ const args = raw;
409
+ const allowed = name === "viberaven_live_start" ? ["cwd", "provider", "projectRef", "schemas", "teamId"] : name === "viberaven_live_resume" ? ["cwd", "stepId", "approvedRead"] : ["cwd", "stepId"];
410
+ if (Object.keys(args).some((key) => !allowed.includes(key))) return invalid();
411
+ if (args.cwd !== void 0 && (typeof args.cwd !== "string" || !args.cwd.trim() || args.cwd.length > 4096 || /[\0\r\n]/.test(args.cwd))) return invalid();
412
+ if (name === "viberaven_live_start") {
413
+ if (!["supabase", "vercel"].includes(args.provider) || typeof args.projectRef !== "string" || !new RegExp(args.provider === "supabase" ? supabaseProjectPattern : vercelProjectPattern).test(args.projectRef)) return invalid();
414
+ const out = ["live", "start", "--provider", args.provider, "--project", args.projectRef];
415
+ if (args.schemas !== void 0) {
416
+ if (args.provider !== "supabase" || !Array.isArray(args.schemas) || args.schemas.length < 1 || args.schemas.length > 8 || args.schemas.some((s) => typeof s !== "string" || !new RegExp(schemaPattern).test(s)) || new Set(args.schemas).size !== args.schemas.length) return invalid();
417
+ out.push("--schemas", args.schemas.join(","));
418
+ }
419
+ if (args.teamId !== void 0) {
420
+ if (args.provider !== "vercel" || typeof args.teamId !== "string" || !new RegExp(vercelTeamPattern).test(args.teamId)) return invalid();
421
+ out.push("--team", args.teamId);
422
+ }
423
+ return [...out, "--json"];
424
+ }
425
+ if (typeof args.stepId !== "string" || !uuid.test(args.stepId) || args.approvedRead !== void 0 && typeof args.approvedRead !== "boolean") return invalid();
426
+ return ["live", name.slice("viberaven_live_".length), "--id", args.stepId.toLowerCase(), ...args.approvedRead === true ? ["--approve-read"] : [], "--json"];
427
+ }
428
+
429
+ // src/lib/work-report-runner.ts
430
+ var import_node_fs2 = require("node:fs");
431
+ var import_node_module = require("node:module");
40
432
  var import_node_path = require("node:path");
433
+
434
+ // ../../shared/workReportRunner.ts
435
+ var import_node_fs = require("node:fs");
436
+ var MAX_OUTPUT_BYTES = 65536;
437
+ var REPORT_TIMEOUT_MS = 3e4;
438
+ var workReportFailure = () => {
439
+ const stdout = JSON.stringify({ error: "Local proof report unavailable. Check the matching installed CLI, task ID, saved state integrity and current source readability.", code: "work_report_unavailable" });
440
+ return { stdout, stderr: "", exitCode: 1, text: `exit 1
441
+ ${stdout}` };
442
+ };
443
+ function runWorkReportProcess(entry, args, cwd3, spawnFn2) {
444
+ let canonicalCwd;
445
+ try {
446
+ if (cwd3 !== void 0 && (typeof cwd3 !== "string" || !cwd3.trim())) return Promise.resolve(workReportFailure());
447
+ canonicalCwd = (0, import_node_fs.realpathSync)(cwd3 === void 0 ? process.cwd() : cwd3);
448
+ } catch {
449
+ return Promise.resolve(workReportFailure());
450
+ }
451
+ return new Promise((resolve2) => {
452
+ let settled = false, stdoutBytes = 0, stderrBytes = 0;
453
+ const chunks = [];
454
+ let child;
455
+ const finish = (result) => {
456
+ if (!settled) {
457
+ settled = true;
458
+ clearTimeout(timer);
459
+ resolve2(result);
460
+ }
461
+ };
462
+ const fail = () => {
463
+ if (settled) return;
464
+ finish(workReportFailure());
465
+ child?.kill();
466
+ };
467
+ const timer = setTimeout(fail, REPORT_TIMEOUT_MS);
468
+ timer.unref();
469
+ try {
470
+ const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => !/^(?:node_|npm_)/i.test(key) && key.toLowerCase() !== "viberaven_cli_path"));
471
+ child = spawnFn2(process.execPath, [entry, ...args], { cwd: canonicalCwd, env, shell: false, windowsHide: true, stdio: ["ignore", "pipe", "pipe"] });
472
+ child.stdout?.on("data", (chunk) => {
473
+ if (settled) return;
474
+ stdoutBytes += chunk.length;
475
+ if (stdoutBytes > MAX_OUTPUT_BYTES - 8) return fail();
476
+ chunks.push(Buffer.from(chunk));
477
+ });
478
+ child.stderr?.on("data", (chunk) => {
479
+ if (settled) return;
480
+ stderrBytes += chunk.length;
481
+ if (stderrBytes > MAX_OUTPUT_BYTES) fail();
482
+ });
483
+ child.on("error", fail);
484
+ child.on("close", (code) => {
485
+ if (settled) return;
486
+ try {
487
+ const stdout = new TextDecoder("utf-8", { fatal: true }).decode(Buffer.concat(chunks));
488
+ const report = JSON.parse(stdout);
489
+ const requestedId = args[args.indexOf("--id") + 1];
490
+ if (code !== 0 || !report || Array.isArray(report) || report.reportVersion !== 1 || report.taskId !== requestedId || !["passed", "failed", "not_checked"].includes(report.outcome) || typeof report.markdown !== "string" || "error" in report) return finish(workReportFailure());
491
+ finish({ stdout, stderr: "", exitCode: 0, text: `exit 0
492
+ ${stdout.trim()}` });
493
+ } catch {
494
+ finish(workReportFailure());
495
+ }
496
+ });
497
+ } catch {
498
+ fail();
499
+ }
500
+ });
501
+ }
502
+
503
+ // src/lib/work-report-runner.ts
504
+ var within = (root, target) => {
505
+ const rel = (0, import_node_path.relative)(root, target);
506
+ return !rel || !(0, import_node_path.isAbsolute)(rel) && rel !== ".." && !rel.startsWith(`..${import_node_path.sep}`);
507
+ };
508
+ function resolveInstalledCli(version, cwd3) {
509
+ const override = process.env.VIBERAVEN_CLI_PATH;
510
+ try {
511
+ if (override !== void 0 && !(0, import_node_path.isAbsolute)(override)) throw new Error("Unavailable installed CLI");
512
+ const selected = override ?? (0, import_node_path.join)((0, import_node_path.dirname)((0, import_node_module.createRequire)(__filename).resolve("@viberaven/cli/package.json")), "dist", "cli.js");
513
+ const info = (0, import_node_fs2.lstatSync)(selected);
514
+ if (!info.isFile() || info.isSymbolicLink()) throw new Error("Unavailable installed CLI");
515
+ const entry = (0, import_node_fs2.realpathSync)(selected);
516
+ const root = (0, import_node_fs2.realpathSync)((0, import_node_path.join)((0, import_node_path.dirname)(entry), ".."));
517
+ if (entry !== (0, import_node_path.resolve)(selected) || entry !== (0, import_node_path.join)(root, "dist", "cli.js") || within((0, import_node_fs2.realpathSync)(cwd3), entry)) throw new Error("Unavailable installed CLI");
518
+ const manifestPath = (0, import_node_path.join)(root, "package.json"), manifestInfo = (0, import_node_fs2.lstatSync)(manifestPath);
519
+ if (!manifestInfo.isFile() || manifestInfo.isSymbolicLink() || manifestInfo.size > 65536 || (0, import_node_fs2.realpathSync)(manifestPath) !== manifestPath) throw new Error("Unavailable installed CLI");
520
+ const manifest = JSON.parse((0, import_node_fs2.readFileSync)(manifestPath, "utf8"));
521
+ if (manifest.name !== "@viberaven/cli" || manifest.version !== version) throw new Error("Unavailable installed CLI");
522
+ return entry;
523
+ } catch {
524
+ if (override !== void 0) throw new Error("Matching installed CLI unavailable. Check VIBERAVEN_CLI_PATH, its exact version and installation outside the task repository.");
525
+ return void 0;
526
+ }
527
+ }
528
+ function runInstalledWorkReport(args, cwd3, version, spawnFn2) {
529
+ let entry, canonicalCwd;
530
+ try {
531
+ if (cwd3 !== void 0 && (typeof cwd3 !== "string" || !cwd3.trim())) return Promise.resolve(workReportFailure());
532
+ canonicalCwd = (0, import_node_fs2.realpathSync)(cwd3 === void 0 ? process.cwd() : cwd3);
533
+ const installed = resolveInstalledCli(version, canonicalCwd);
534
+ if (!installed) return Promise.resolve(workReportFailure());
535
+ entry = installed;
536
+ } catch {
537
+ return Promise.resolve(workReportFailure());
538
+ }
539
+ return runWorkReportProcess(entry, args, canonicalCwd, spawnFn2);
540
+ }
541
+
542
+ // src/lib/cli-runner.ts
41
543
  var CLI_PACKAGE = "@viberaven/cli";
42
544
  var MCP_PACKAGE = "@viberaven/mcp";
43
545
  var PLAIN_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
@@ -45,14 +547,14 @@ var cachedVersion;
45
547
  function mcpVersion() {
46
548
  if (cachedVersion) return cachedVersion;
47
549
  let found;
48
- for (let dir = __dirname, depth = 0; depth < 4 && !found; depth += 1, dir = (0, import_node_path.dirname)(dir)) {
550
+ for (let dir = __dirname, depth = 0; depth < 4 && !found; depth += 1, dir = (0, import_node_path2.dirname)(dir)) {
49
551
  try {
50
- const manifest = JSON.parse((0, import_node_fs.readFileSync)((0, import_node_path.join)(dir, "package.json"), "utf8"));
552
+ const manifest = JSON.parse((0, import_node_fs3.readFileSync)((0, import_node_path2.join)(dir, "package.json"), "utf8"));
51
553
  if (manifest.name === MCP_PACKAGE && typeof manifest.version === "string") found = manifest.version;
52
554
  } catch {
53
555
  }
54
556
  }
55
- found ??= true ? "1.6.12" : void 0;
557
+ found ??= true ? "1.7.1" : void 0;
56
558
  if (!found || !PLAIN_VERSION.test(found)) {
57
559
  throw new Error(`Could not read a valid ${MCP_PACKAGE} version (got ${JSON.stringify(found)}), so the matching ${CLI_PACKAGE} cannot be pinned.`);
58
560
  }
@@ -90,11 +592,11 @@ function safeStringArg(value, label) {
90
592
  if (/[&|<>^%!"\r\n]/.test(value)) throw new Error(`Unsafe characters in ${label}`);
91
593
  return value;
92
594
  }
93
- function resolveCwd(cwd) {
94
- if (cwd === void 0 || cwd === null) return process.cwd();
95
- if (typeof cwd !== "string") throw new Error("Invalid cwd: expected string");
96
- if (!cwd.trim()) throw new Error("Invalid cwd: expected non-empty string");
97
- return cwd;
595
+ function resolveCwd(cwd3) {
596
+ if (cwd3 === void 0 || cwd3 === null) return process.cwd();
597
+ if (typeof cwd3 !== "string") throw new Error("Invalid cwd: expected string");
598
+ if (!cwd3.trim()) throw new Error("Invalid cwd: expected non-empty string");
599
+ return cwd3;
98
600
  }
99
601
  function buildNpxCommand(args) {
100
602
  if (process.platform === "win32") {
@@ -109,6 +611,9 @@ function buildHealArgs(prefix, args) {
109
611
  return cliArgs;
110
612
  }
111
613
  function buildToolArgs(name, args) {
614
+ if (name === RLS_TOOL_NAME) return buildRlsToolArgs(args);
615
+ if (isLiveTool(name)) return buildLiveToolArgs(name, args);
616
+ if (isWorkTool(name)) return buildWorkToolArgs(name, args);
112
617
  switch (name) {
113
618
  case "viberaven_check_readiness":
114
619
  return ["check", "--json"];
@@ -156,34 +661,102 @@ function buildToolArgs(name, args) {
156
661
  throw new Error(`Unknown VibeRaven tool: ${name}`);
157
662
  }
158
663
  }
159
- function runVibeRaven(args, cwd) {
160
- let npxArgs;
664
+ function transportFailure(error, stderr = "") {
665
+ return { stdout: "", stderr, exitCode: 1, transportError: true, text: `ERROR: ${error instanceof Error ? error.message : String(error)}` };
666
+ }
667
+ async function runVibeRaven(args, cwd3) {
668
+ return (await runVibeRavenDetailed(args, cwd3)).text;
669
+ }
670
+ function runVibeRavenDetailed(args, cwd3) {
671
+ if (args[0] === "work" && args[1] === "report") {
672
+ try {
673
+ return runInstalledWorkReport(args, cwd3, mcpVersion(), spawnFn);
674
+ } catch {
675
+ return Promise.resolve(workReportFailure());
676
+ }
677
+ }
678
+ let built;
679
+ let childCwd, env;
161
680
  try {
162
- npxArgs = cliNpxArgs(args);
681
+ childCwd = resolveCwd(cwd3);
682
+ const installed = resolveInstalledCli(mcpVersion(), childCwd);
683
+ if (args[0] === "rls-test" && !installed) return Promise.resolve(transportFailure(new Error("RLS testing requires a matching installed CLI outside the task repository, with optional PGlite installed next to it. Configure the local MCP host installation or VIBERAVEN_CLI_PATH; this tool does not download or install dependencies.")));
684
+ built = installed ? { command: process.execPath, args: [installed, ...args], shell: false } : buildNpxCommand(cliNpxArgs(args));
685
+ env = installed ? Object.fromEntries(Object.entries(process.env).filter(([key]) => !/^(?:node_|npm_)/i.test(key) && key.toLowerCase() !== "viberaven_cli_path")) : cliChildEnv();
163
686
  } catch (error) {
164
- return Promise.resolve(`ERROR: ${error instanceof Error ? error.message : String(error)}`);
165
- }
166
- return new Promise((resolve) => {
167
- const built = buildNpxCommand(npxArgs);
168
- const child = spawnFn(built.command, built.args, {
169
- cwd: resolveCwd(cwd),
170
- env: cliChildEnv(),
171
- shell: built.shell,
172
- stdio: ["ignore", "pipe", "pipe"]
173
- });
687
+ return Promise.resolve(transportFailure(error));
688
+ }
689
+ return new Promise((resolve2) => {
690
+ let child;
691
+ try {
692
+ child = spawnFn(built.command, built.args, {
693
+ cwd: childCwd,
694
+ env,
695
+ shell: built.shell,
696
+ windowsHide: true,
697
+ stdio: ["ignore", "pipe", "pipe"]
698
+ });
699
+ } catch (error) {
700
+ resolve2(transportFailure(error));
701
+ return;
702
+ }
174
703
  let stdout = "";
175
704
  let stderr = "";
176
- child.stdout?.on("data", (chunk) => {
177
- stdout += chunk.toString();
178
- });
179
- child.stderr?.on("data", (chunk) => {
180
- stderr += chunk.toString();
181
- });
182
- child.on("error", (error) => resolve(`ERROR: ${error.message}`));
705
+ const boundedRls = args[0] === "rls-test";
706
+ const rlsChunks = { stdout: [], stderr: [] };
707
+ let outputBytes = 0;
708
+ let settled = false;
709
+ let timer;
710
+ const finish = (result) => {
711
+ if (settled) return;
712
+ settled = true;
713
+ if (timer) clearTimeout(timer);
714
+ resolve2(result);
715
+ };
716
+ const stopRls = (reason) => {
717
+ finish(transportFailure(new Error(reason)));
718
+ try {
719
+ child.kill("SIGKILL");
720
+ } catch {
721
+ }
722
+ };
723
+ if (boundedRls) timer = setTimeout(() => stopRls("RLS test exceeded its 300-second aggregate time limit and was stopped; no partial result is reported as passed."), RLS_RUN_TIMEOUT_MS);
724
+ const collect = (chunk, stream) => {
725
+ if (settled) return;
726
+ outputBytes += Buffer.byteLength(chunk);
727
+ if (boundedRls && outputBytes > RLS_MAX_OUTPUT_BYTES) {
728
+ stopRls("RLS test exceeded its combined output limit and was stopped; no partial result is reported as passed.");
729
+ return;
730
+ }
731
+ if (boundedRls) {
732
+ rlsChunks[stream].push(Buffer.from(chunk));
733
+ return;
734
+ }
735
+ if (stream === "stdout") stdout += chunk.toString();
736
+ else stderr += chunk.toString();
737
+ };
738
+ child.stdout?.on("data", (chunk) => collect(chunk, "stdout"));
739
+ child.stderr?.on("data", (chunk) => collect(chunk, "stderr"));
740
+ child.on("error", (error) => finish(transportFailure(error, boundedRls ? "" : stderr)));
183
741
  child.on("close", (code) => {
742
+ if (settled) return;
743
+ if (code === null) {
744
+ finish(transportFailure(new Error("CLI process ended without an exit code"), boundedRls ? "" : stderr));
745
+ return;
746
+ }
747
+ if (boundedRls) {
748
+ try {
749
+ const decoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
750
+ stdout = decoder.decode(Buffer.concat(rlsChunks.stdout));
751
+ stderr = decoder.decode(Buffer.concat(rlsChunks.stderr));
752
+ } catch {
753
+ finish(transportFailure(new Error("RLS test returned invalid UTF-8; no partial result is reported as passed.")));
754
+ return;
755
+ }
756
+ }
184
757
  const combined = `${stdout}${stderr}`.trim();
185
- resolve(`exit ${code ?? 1}${combined ? `
186
- ${combined}` : ""}`);
758
+ finish({ stdout, stderr, exitCode: code ?? 1, text: `exit ${code ?? 1}${combined ? `
759
+ ${combined}` : ""}` });
187
760
  });
188
761
  });
189
762
  }
@@ -200,5 +773,6 @@ ${combined}` : ""}`);
200
773
  mcpVersion,
201
774
  resolveCwd,
202
775
  runVibeRaven,
776
+ runVibeRavenDetailed,
203
777
  safeStringArg
204
778
  });