MCPcopy Create free account
hub / github.com/backnotprop/plannotator / runCliPlanReview

Function runCliPlanReview

apps/opencode-plugin/cli-bridge.ts:333–359  ·  view source on GitHub ↗
(input: {
  client: OpenCodeClient;
  planContent: string;
  cwd?: string;
  timeoutSeconds: number | null;
  bridge?: OpenCodeBridgeContext;
})

Source from the content-addressed store, hash-verified

331}
332
333export async function runCliPlanReview(input: {
334 client: OpenCodeClient;
335 planContent: string;
336 cwd?: string;
337 timeoutSeconds: number | null;
338 bridge?: OpenCodeBridgeContext;
339}): Promise<OpenCodePlanReviewResult> {
340 const result = await runPlannotatorCli({
341 client: input.client,
342 args: ["opencode-plan"],
343 cwd: input.cwd,
344 input: JSON.stringify({
345 plan: input.planContent,
346 timeoutSeconds: input.timeoutSeconds,
347 ...buildBridgePayload(input.bridge),
348 }),
349 readyLabel: "plan review",
350 bridge: input.bridge,
351 });
352
353 if (result.exitCode !== 0) {
354 throw new Error(result.stderr.trim() || `Plannotator CLI exited with code ${result.exitCode}`);
355 }
356
357 logCliWarnings(input.client, result.stderr);
358 return parseLastJson<OpenCodePlanReviewResult>(result.stdout);
359}
360
361async function injectSessionPrompt(
362 client: OpenCodeClient,

Callers 1

runPlanReviewFunction · 0.90

Calls 4

runPlannotatorCliFunction · 0.85
buildBridgePayloadFunction · 0.85
logCliWarningsFunction · 0.85
parseLastJsonFunction · 0.85

Tested by

no test coverage detected