@kodrunhq/opencode-autopilot 1.14.0 → 1.15.0
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.
- package/package.json +1 -1
- package/src/orchestrator/artifacts.ts +1 -1
- package/src/orchestrator/contracts/invariants.ts +121 -0
- package/src/orchestrator/contracts/legacy-result-adapter.ts +47 -0
- package/src/orchestrator/contracts/phase-artifacts.ts +90 -0
- package/src/orchestrator/contracts/result-envelope.ts +23 -0
- package/src/orchestrator/handlers/architect.ts +5 -1
- package/src/orchestrator/handlers/build.ts +110 -18
- package/src/orchestrator/handlers/challenge.ts +3 -1
- package/src/orchestrator/handlers/explore.ts +1 -0
- package/src/orchestrator/handlers/plan.ts +189 -7
- package/src/orchestrator/handlers/recon.ts +3 -1
- package/src/orchestrator/handlers/retrospective.ts +8 -0
- package/src/orchestrator/handlers/ship.ts +6 -1
- package/src/orchestrator/handlers/types.ts +21 -2
- package/src/orchestrator/renderers/tasks-markdown.ts +22 -0
- package/src/orchestrator/replay.ts +14 -0
- package/src/orchestrator/schemas.ts +19 -0
- package/src/orchestrator/state.ts +48 -7
- package/src/orchestrator/types.ts +4 -0
- package/src/review/pipeline.ts +41 -6
- package/src/review/schemas.ts +6 -0
- package/src/review/types.ts +2 -0
- package/src/tools/doctor.ts +34 -0
- package/src/tools/forensics.ts +34 -0
- package/src/tools/orchestrate.ts +418 -54
- package/src/tools/quick.ts +4 -0
- package/src/tools/review.ts +27 -2
- package/src/types/inquirer-shims.d.ts +42 -0
package/src/tools/review.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
+
}
|