@kodrunhq/opencode-autopilot 1.14.1 → 1.15.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.
@@ -26,7 +26,7 @@ import {
26
26
  } from "../review/memory";
27
27
  import type { ReviewState } from "../review/pipeline";
28
28
  import { advancePipeline } from "../review/pipeline";
29
- import { reviewStateSchema } from "../review/schemas";
29
+ import { reviewFindingsEnvelopeSchema, reviewStateSchema } from "../review/schemas";
30
30
  import { selectAgents } from "../review/selection";
31
31
  import { detectStackTags } from "../review/stack-gate";
32
32
  import { ensureDir, isEnoentError } from "../utils/fs-helpers";
@@ -219,7 +219,29 @@ export async function reviewCore(args: ReviewArgs, projectRoot: string): Promise
219
219
 
220
220
  // Case 3: State exists, findings provided -> advance pipeline
221
221
  if (currentState !== null && args.findings) {
222
- const result = advancePipeline(args.findings, currentState);
222
+ let findingsPayload = args.findings;
223
+ try {
224
+ const parsed = JSON.parse(args.findings);
225
+ if (
226
+ parsed &&
227
+ typeof parsed === "object" &&
228
+ "report" in parsed &&
229
+ typeof parsed.report === "object" &&
230
+ parsed.report !== null &&
231
+ Array.isArray((parsed.report as { findings?: unknown }).findings)
232
+ ) {
233
+ findingsPayload = JSON.stringify(
234
+ reviewFindingsEnvelopeSchema.parse({
235
+ schemaVersion: 1,
236
+ kind: "review_findings",
237
+ findings: (parsed.report as { findings: unknown[] }).findings,
238
+ }),
239
+ );
240
+ }
241
+ } catch {
242
+ // keep legacy payload for parser fallback
243
+ }
244
+ const result = advancePipeline(findingsPayload, currentState);
223
245
 
224
246
  if (result.action === "dispatch" && result.state) {
225
247
  await saveReviewState(result.state, artifactDir);
@@ -228,6 +250,7 @@ export async function reviewCore(args: ReviewArgs, projectRoot: string): Promise
228
250
  stage: result.stage,
229
251
  agents: result.agents,
230
252
  message: result.message,
253
+ parseMode: result.parseMode,
231
254
  });
232
255
  }
233
256
 
@@ -247,6 +270,8 @@ export async function reviewCore(args: ReviewArgs, projectRoot: string): Promise
247
270
  return JSON.stringify({
248
271
  action: "complete",
249
272
  report: result.report,
273
+ findingsEnvelope: result.findingsEnvelope,
274
+ parseMode: result.parseMode,
250
275
  });
251
276
  }
252
277
 
@@ -0,0 +1,42 @@
1
+ declare module "@inquirer/checkbox" {
2
+ class Separator {
3
+ constructor(label?: string);
4
+ readonly separator: true;
5
+ }
6
+
7
+ interface CheckboxChoice {
8
+ readonly value: string;
9
+ readonly name?: string;
10
+ }
11
+
12
+ interface CheckboxOptions {
13
+ readonly message: string;
14
+ readonly choices: readonly (CheckboxChoice | Separator)[];
15
+ readonly pageSize?: number;
16
+ }
17
+
18
+ function checkbox(options: CheckboxOptions): Promise<string[]>;
19
+ export { Separator };
20
+ export default checkbox;
21
+ }
22
+
23
+ declare module "@inquirer/confirm" {
24
+ interface ConfirmOptions {
25
+ readonly message: string;
26
+ readonly default?: boolean;
27
+ }
28
+
29
+ function confirm(options: ConfirmOptions): Promise<boolean>;
30
+ export default confirm;
31
+ }
32
+
33
+ declare module "@inquirer/search" {
34
+ interface SearchOptions {
35
+ readonly message: string;
36
+ readonly source: (input?: string) => Promise<readonly unknown[]>;
37
+ readonly pageSize?: number;
38
+ }
39
+
40
+ function search(options: SearchOptions): Promise<string>;
41
+ export default search;
42
+ }