(input: {
client: OpenCodeClient;
planContent: string;
cwd?: string;
timeoutSeconds: number | null;
bridge?: OpenCodeBridgeContext;
})
| 331 | } |
| 332 | |
| 333 | export 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 | |
| 361 | async function injectSessionPrompt( |
| 362 | client: OpenCodeClient, |
no test coverage detected