@open-cr-agent/core 0.7.0 → 0.10.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/dist/agent/model-call.d.ts +13 -0
- package/dist/agent/model-call.js +22 -0
- package/dist/agent/settings.d.ts +10 -5
- package/dist/agent/settings.js +22 -8
- package/dist/agent/spend-limit.d.ts +18 -0
- package/dist/agent/spend-limit.js +53 -0
- package/dist/anchor/relocate.d.ts +1 -1
- package/dist/anchor/relocate.js +8 -14
- package/dist/bundle/runtime-grouper.d.ts +1 -1
- package/dist/bundle/runtime-grouper.js +8 -14
- package/dist/chat/answer.d.ts +10 -0
- package/dist/chat/answer.js +26 -0
- package/dist/chat/prompt.d.ts +22 -0
- package/dist/chat/prompt.js +65 -0
- package/dist/contracts.d.ts +27 -0
- package/dist/contracts.js +10 -0
- package/dist/domain.d.ts +7 -0
- package/dist/domain.js +2 -0
- package/dist/index.d.ts +10 -7
- package/dist/index.js +4 -4
- package/dist/internal.d.ts +8 -3
- package/dist/internal.js +8 -3
- package/dist/judge/judge.d.ts +1 -1
- package/dist/judge/judge.js +10 -13
- package/dist/judge/prompt.d.ts +1 -1
- package/dist/judge/prompt.js +10 -1
- package/dist/judge/verdict.d.ts +2 -1
- package/dist/judge/verdict.js +4 -2
- package/dist/knowledge/learning.d.ts +21 -0
- package/dist/knowledge/learning.js +1 -0
- package/dist/knowledge/paths.d.ts +1 -0
- package/dist/knowledge/paths.js +18 -0
- package/dist/knowledge/select.d.ts +15 -0
- package/dist/knowledge/select.js +116 -0
- package/dist/knowledge/terms.d.ts +21 -0
- package/dist/knowledge/terms.js +153 -0
- package/dist/learn/draft.d.ts +21 -0
- package/dist/learn/draft.js +126 -0
- package/dist/{pipeline → matrix}/matrix.d.ts +1 -2
- package/dist/{pipeline → matrix}/matrix.js +1 -1
- package/dist/pipeline/answer.d.ts +16 -0
- package/dist/pipeline/answer.js +29 -0
- package/dist/pipeline/assemble-report.d.ts +2 -6
- package/dist/pipeline/assemble-report.js +38 -22
- package/dist/pipeline/check-stage.js +31 -11
- package/dist/pipeline/context.d.ts +2 -1
- package/dist/pipeline/context.js +19 -3
- package/dist/pipeline/coverage.d.ts +1 -1
- package/dist/pipeline/execute-stage.d.ts +5 -5
- package/dist/pipeline/execute-stage.js +27 -30
- package/dist/pipeline/execute.d.ts +12 -7
- package/dist/pipeline/execute.js +40 -55
- package/dist/pipeline/filter-stage.js +2 -0
- package/dist/pipeline/imports.js +2 -16
- package/dist/pipeline/learnings.d.ts +7 -0
- package/dist/pipeline/learnings.js +20 -0
- package/dist/pipeline/options.d.ts +22 -1
- package/dist/pipeline/options.js +32 -0
- package/dist/pipeline/plan-output.d.ts +7 -0
- package/dist/pipeline/plan-output.js +9 -1
- package/dist/pipeline/plan.d.ts +14 -8
- package/dist/pipeline/plan.js +60 -8
- package/dist/pipeline/preview.d.ts +5 -4
- package/dist/pipeline/preview.js +20 -27
- package/dist/pipeline/run.js +23 -47
- package/dist/pipeline/task-prompt.d.ts +17 -0
- package/dist/pipeline/task-prompt.js +44 -0
- package/dist/pipeline/task.d.ts +3 -0
- package/dist/pipeline/task.js +3 -1
- package/dist/pipeline/walkthrough-stage.d.ts +9 -0
- package/dist/pipeline/walkthrough-stage.js +20 -0
- package/dist/report/output-schema.d.ts +39 -0
- package/dist/report/output-schema.js +31 -2
- package/dist/report/output.js +33 -0
- package/dist/report/report.d.ts +34 -2
- package/dist/report/report.js +29 -0
- package/dist/review/impact.d.ts +21 -4
- package/dist/review/impact.js +186 -28
- package/dist/review/plan-phase.d.ts +1 -1
- package/dist/review/plan-phase.js +13 -12
- package/dist/review/prompt-text.d.ts +1 -1
- package/dist/review/prompt-text.js +84 -20
- package/dist/review/prompt.d.ts +6 -0
- package/dist/review/prompt.js +57 -2
- package/dist/review/tools.d.ts +1 -0
- package/dist/review/tools.js +1 -0
- package/dist/runtime/attempt.d.ts +12 -0
- package/dist/runtime/attempt.js +21 -1
- package/dist/runtime/chain-runner.d.ts +2 -2
- package/dist/runtime/failback.d.ts +2 -2
- package/dist/runtime/failback.js +29 -12
- package/dist/runtime/tools.js +11 -0
- package/dist/runtime/wrap-up.d.ts +6 -0
- package/dist/runtime/wrap-up.js +27 -0
- package/dist/sarif/candidates.d.ts +3 -2
- package/dist/sarif/candidates.js +2 -0
- package/dist/sarif/evidence.d.ts +42 -0
- package/dist/sarif/evidence.js +142 -0
- package/dist/sarif/schema.d.ts +18 -0
- package/dist/sarif/schema.js +8 -0
- package/dist/select/patterns.d.ts +1 -0
- package/dist/select/patterns.js +46 -0
- package/dist/select/select.d.ts +1 -0
- package/dist/select/select.js +18 -1
- package/dist/session/resume-read.js +3 -0
- package/dist/session/seal.js +5 -0
- package/dist/vcs.d.ts +22 -0
- package/dist/verify/prompt.d.ts +6 -2
- package/dist/verify/prompt.js +13 -4
- package/dist/verify/related.d.ts +3 -0
- package/dist/verify/related.js +88 -0
- package/dist/verify/verify.d.ts +3 -3
- package/dist/verify/verify.js +27 -19
- package/dist/walkthrough/diagram.d.ts +1 -0
- package/dist/walkthrough/diagram.js +49 -0
- package/dist/walkthrough/prompt.d.ts +19 -0
- package/dist/walkthrough/prompt.js +62 -0
- package/dist/walkthrough/walkthrough.d.ts +27 -0
- package/dist/walkthrough/walkthrough.js +71 -0
- package/package.json +3 -3
- package/dist/agent/budget.d.ts +0 -12
- package/dist/agent/budget.js +0 -27
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type AgentSettings } from "../agent/settings.js";
|
|
2
2
|
import { type AnchorContext } from "../anchor/anchor.js";
|
|
3
|
-
import type { AgentRuntime, Usage } from "../contracts.js";
|
|
3
|
+
import type { AgentRuntime, ReferenceIndex, SymbolExtractor, Usage } from "../contracts.js";
|
|
4
4
|
import type { Finding } from "../domain.js";
|
|
5
|
+
import type { MatrixCell } from "../matrix/matrix.js";
|
|
5
6
|
import type { ReviewEvent, TaskOutcome } from "../report/report.js";
|
|
6
7
|
import { planBundle } from "../review/plan-phase.js";
|
|
7
|
-
import type { MatrixCell } from "./matrix.js";
|
|
8
8
|
import type { ReviewPlan } from "./plan.js";
|
|
9
9
|
import type { ReusePool } from "./resume.js";
|
|
10
|
+
import { type TaskPrompt } from "./task-prompt.js";
|
|
10
11
|
export interface JobResult {
|
|
11
12
|
outcome: TaskOutcome;
|
|
12
13
|
findings: Finding[];
|
|
@@ -16,9 +17,12 @@ export interface JobResult {
|
|
|
16
17
|
export interface ExecuteOptions {
|
|
17
18
|
runtime: AgentRuntime;
|
|
18
19
|
ultra?: boolean;
|
|
20
|
+
securityFiles?: ReadonlySet<string>;
|
|
19
21
|
taskTimeoutMs: number;
|
|
20
22
|
abortGraceMs?: number | undefined;
|
|
21
23
|
relocate?: AnchorContext["relocate"] | undefined;
|
|
24
|
+
symbols?: SymbolExtractor | undefined;
|
|
25
|
+
references?: ReferenceIndex | undefined;
|
|
22
26
|
plans?: Map<string, Promise<PlannedBundle>>;
|
|
23
27
|
emit: (event: ReviewEvent) => void;
|
|
24
28
|
onUsage?: ((usage: Usage) => void) | undefined;
|
|
@@ -31,10 +35,11 @@ export interface ExecuteOptions {
|
|
|
31
35
|
keyInputs?: unknown;
|
|
32
36
|
}
|
|
33
37
|
type PlannedBundle = Awaited<ReturnType<typeof planBundle>>;
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export declare function
|
|
38
|
+
export interface PreparedJob {
|
|
39
|
+
task: TaskPrompt;
|
|
40
|
+
key: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function prepareJob(job: MatrixCell, plan: ReviewPlan, options: ExecuteOptions): PreparedJob;
|
|
43
|
+
export declare function runJob(job: MatrixCell, plan: ReviewPlan, options: ExecuteOptions, { task, key }: PreparedJob): Promise<JobResult>;
|
|
39
44
|
export declare function reuseJob(job: MatrixCell, plan: ReviewPlan, options: ExecuteOptions, key: string): Promise<JobResult | undefined>;
|
|
40
45
|
export {};
|
package/dist/pipeline/execute.js
CHANGED
|
@@ -1,35 +1,27 @@
|
|
|
1
|
-
import { reviewerCall } from "../agent/settings.js";
|
|
1
|
+
import { chainOf, reviewerCall, } from "../agent/settings.js";
|
|
2
2
|
import { addUsage, emptyUsage } from "../agent/usage.js";
|
|
3
3
|
import { anchorFinding } from "../anchor/anchor.js";
|
|
4
|
-
import { memoryFor } from "../memory/memory.js";
|
|
5
4
|
import { findCallers } from "../review/impact.js";
|
|
6
5
|
import { planBundle } from "../review/plan-phase.js";
|
|
7
6
|
import { buildReviewPrompt } from "../review/prompt.js";
|
|
8
|
-
import { resolveRules } from "../rules/resolve.js";
|
|
9
7
|
import { toFinding } from "./findings.js";
|
|
10
8
|
import { stableHash } from "./provenance.js";
|
|
11
9
|
import { executeTask } from "./task.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const PLAN_MIN_FILES = 5;
|
|
15
|
-
const PLAN_MIN_PATCH_CHARS = 40_000;
|
|
16
|
-
export function isLargeBundle(files) {
|
|
17
|
-
const chars = files.reduce((sum, f) => sum + f.patch.length, 0);
|
|
18
|
-
return files.length >= PLAN_MIN_FILES || chars >= PLAN_MIN_PATCH_CHARS;
|
|
19
|
-
}
|
|
20
|
-
// The key of a cell's inputs (taskKey), under which its answer is reported
|
|
21
|
-
// and an earlier run's answer is reused.
|
|
22
|
-
export function jobKey(job, plan, options) {
|
|
10
|
+
import { taskPrompt } from "./task-prompt.js";
|
|
11
|
+
export function prepareJob(job, plan, options) {
|
|
23
12
|
const call = reviewerCall(job.reviewer, options.agents ?? {});
|
|
24
|
-
|
|
13
|
+
const task = taskPrompt(job, plan, settingsOf(options));
|
|
14
|
+
return { task, key: taskKey(job, plan, task.prompt, call, options) };
|
|
15
|
+
}
|
|
16
|
+
function settingsOf(options) {
|
|
17
|
+
return { ultra: options.ultra === true, securityFiles: options.securityFiles ?? new Set() };
|
|
25
18
|
}
|
|
26
19
|
// Runs one (bundle, reviewer) cell and anchors what it reports.
|
|
27
|
-
export async function runJob(job, plan, options, key) {
|
|
20
|
+
export async function runJob(job, plan, options, { task, key }) {
|
|
28
21
|
const { emit } = options;
|
|
29
22
|
const files = job.bundle.files.map((f) => f.newPath);
|
|
30
23
|
const call = reviewerCall(job.reviewer, options.agents ?? {});
|
|
31
|
-
const
|
|
32
|
-
const prepared = await preparePrompt(job, plan, options, call, input);
|
|
24
|
+
const prepared = await preparePrompt(job, plan, options, call, task);
|
|
33
25
|
emit({
|
|
34
26
|
type: "task_started",
|
|
35
27
|
taskId: job.taskId,
|
|
@@ -75,6 +67,8 @@ export async function runJob(job, plan, options, key) {
|
|
|
75
67
|
outcome.error = result.error;
|
|
76
68
|
if (result.ended !== undefined)
|
|
77
69
|
outcome.ended = result.ended;
|
|
70
|
+
if (result.wrapUp)
|
|
71
|
+
outcome.wrapUp = result.wrapUp;
|
|
78
72
|
// A task cut off before it finished (ADR-0030) is reviewed again, not reused.
|
|
79
73
|
if (result.status === "completed" && result.ended === undefined) {
|
|
80
74
|
emit({ type: "task_reported", taskId: job.taskId, key, findings: result.findings });
|
|
@@ -82,32 +76,20 @@ export async function runJob(job, plan, options, key) {
|
|
|
82
76
|
emit({ type: "task_finished", outcome });
|
|
83
77
|
return { outcome, findings: anchored.findings, usage, warnings };
|
|
84
78
|
}
|
|
85
|
-
// The task's review prompt before a plan phase or callers are added.
|
|
86
|
-
function promptInput(job, plan) {
|
|
87
|
-
const files = job.bundle.files.map((f) => f.newPath);
|
|
88
|
-
return {
|
|
89
|
-
reviewer: job.reviewer,
|
|
90
|
-
changeRequest: plan.changeRequest,
|
|
91
|
-
changedFiles: plan.selected,
|
|
92
|
-
bundle: job.bundle.files,
|
|
93
|
-
rules: resolveRules(files, plan.repoRules, job.reviewer.rules),
|
|
94
|
-
guidelines: plan.guidelines,
|
|
95
|
-
accepted: memoryFor(files, plan.memory),
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
79
|
// Everything a task's answer depends on, so an earlier answer is reused only
|
|
99
80
|
// for the same question: the prompt (instructions, change, bundle, rules,
|
|
100
81
|
// guidelines, memory), the commits (the code around the change, which the
|
|
101
82
|
// reviewer reads but the prompt does not hold), the model chain and effort,
|
|
102
|
-
// --ultra (which adds a plan phase and callers
|
|
103
|
-
// inputs), and the caller's build
|
|
83
|
+
// --ultra (which adds a plan phase and callers; callers at the full tier,
|
|
84
|
+
// like the plan, are derived from the same inputs), and the caller's build
|
|
85
|
+
// and sampling.
|
|
104
86
|
function taskKey(job, plan, prompt, call, options) {
|
|
105
87
|
const { baseSha, headSha } = plan.changeRequest;
|
|
106
88
|
return stableHash({
|
|
107
89
|
prompt: { system: prompt.system, user: prompt.user },
|
|
108
90
|
commits: { base: baseSha, head: headSha },
|
|
109
91
|
tier: job.reviewer.modelTier,
|
|
110
|
-
chain: call
|
|
92
|
+
chain: chainOf(call, job.reviewer.modelTier, options.agents ?? {}),
|
|
111
93
|
effort: call.effort,
|
|
112
94
|
ultra: options.ultra === true,
|
|
113
95
|
inputs: options.keyInputs,
|
|
@@ -148,21 +130,21 @@ export async function reuseJob(job, plan, options, key) {
|
|
|
148
130
|
emit({ type: "task_finished", outcome });
|
|
149
131
|
return { outcome, findings: anchored.findings, usage: emptyUsage(), warnings: anchored.warnings };
|
|
150
132
|
}
|
|
151
|
-
// The review prompt, with a plan phase and
|
|
152
|
-
//
|
|
153
|
-
async function preparePrompt(job, plan, options, call,
|
|
154
|
-
|
|
155
|
-
|
|
133
|
+
// The review prompt, with a plan phase and the callers of changed symbols
|
|
134
|
+
// when the task gets them.
|
|
135
|
+
async function preparePrompt(job, plan, options, call, task) {
|
|
136
|
+
const { planCall } = task;
|
|
137
|
+
const callers = task.callers ? await findCallers(job.bundle.files, plan.context, options) : [];
|
|
138
|
+
if (!planCall) {
|
|
139
|
+
const prompt = callers.length > 0 ? buildReviewPrompt({ ...task.input, callers }) : task.prompt;
|
|
140
|
+
return { prompt, usage: [], warnings: [] };
|
|
156
141
|
}
|
|
157
|
-
const
|
|
158
|
-
const
|
|
159
|
-
const shared = options.plans?.get(key);
|
|
160
|
-
const planning = shared ??
|
|
161
|
-
planBundle(options.runtime, job.reviewer, buildReviewPrompt({ ...input, forPlanning: true }), options.signal, call);
|
|
142
|
+
const shared = options.plans?.get(planCall.key);
|
|
143
|
+
const planning = shared ?? planBundle(options.runtime, job.reviewer, planCall.prompt(), options.signal, call);
|
|
162
144
|
if (!shared)
|
|
163
|
-
options.plans?.set(key, planning);
|
|
145
|
+
options.plans?.set(planCall.key, planning);
|
|
164
146
|
const planned = await planning;
|
|
165
|
-
const prompt = buildReviewPrompt({ ...input, callers, plan: planned.plan });
|
|
147
|
+
const prompt = buildReviewPrompt({ ...task.input, callers, plan: planned.plan });
|
|
166
148
|
// The sample that made the call pays for it and reports its warning.
|
|
167
149
|
if (shared)
|
|
168
150
|
return { prompt, usage: [], warnings: [] };
|
|
@@ -179,26 +161,29 @@ async function anchorFindings(job, plan, options, reportedFindings) {
|
|
|
179
161
|
};
|
|
180
162
|
if (options.relocate)
|
|
181
163
|
anchorContext.relocate = options.relocate;
|
|
182
|
-
// A finding on
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
|
|
164
|
+
// A finding on another file of the change is kept: a bug often shows where
|
|
165
|
+
// a changed caller meets a changed callee in another bundle, and dropping
|
|
166
|
+
// it lost the finding outright. A copy the task owning that file also
|
|
167
|
+
// reports shares its fingerprint, so the run keeps one (dedupeFindings).
|
|
168
|
+
// A file outside the change, or left out of an incremental review, is
|
|
169
|
+
// not under review.
|
|
170
|
+
const reviewed = new Set(plan.bundles.flatMap((b) => b.files.map((f) => f.newPath)));
|
|
186
171
|
let outside = 0;
|
|
187
172
|
for (const { reported, model } of reportedFindings) {
|
|
188
|
-
// Relocating a quote on a file outside the
|
|
173
|
+
// Relocating a quote on a file outside the review would pay for an
|
|
189
174
|
// answer the next check throws away.
|
|
190
|
-
const context =
|
|
175
|
+
const context = reviewed.has(reported.file)
|
|
191
176
|
? anchorContext
|
|
192
177
|
: { diffs: anchorContext.diffs, readNewFile: anchorContext.readNewFile };
|
|
193
178
|
const anchor = await anchorFinding(reported, context);
|
|
194
179
|
if (anchor.warning)
|
|
195
180
|
warnings.push(`${job.taskId}: ${anchor.warning}`);
|
|
196
|
-
if (!
|
|
181
|
+
if (!reviewed.has(anchor.file)) {
|
|
197
182
|
outside += 1;
|
|
198
183
|
options.emit({
|
|
199
184
|
type: "finding_dropped",
|
|
200
185
|
taskId: job.taskId,
|
|
201
|
-
reason: "
|
|
186
|
+
reason: "outside_review",
|
|
202
187
|
file: anchor.file,
|
|
203
188
|
title: reported.title,
|
|
204
189
|
});
|
|
@@ -213,7 +198,7 @@ async function anchorFindings(job, plan, options, reportedFindings) {
|
|
|
213
198
|
options.emit({ type: "finding", taskId: job.taskId, finding });
|
|
214
199
|
}
|
|
215
200
|
if (outside > 0) {
|
|
216
|
-
warnings.push(`${job.taskId}: dropped ${outside} finding(s) on files outside
|
|
201
|
+
warnings.push(`${job.taskId}: dropped ${outside} finding(s) on files outside the review`);
|
|
217
202
|
}
|
|
218
203
|
return { findings, warnings };
|
|
219
204
|
}
|
|
@@ -9,12 +9,14 @@ import { importSarif } from "./imports.js";
|
|
|
9
9
|
// paid for findings that will not be reported, and a person's dismissal
|
|
10
10
|
// keeps a finding out of the verdict whatever the models say.
|
|
11
11
|
export async function filterStage(executed, prior, { options, plan, emit }) {
|
|
12
|
+
emit({ type: "stage_started", stage: "filter" });
|
|
12
13
|
const imported = options.sarif && options.sarif.length > 0
|
|
13
14
|
? await importSarif(options.sarif, plan, emit)
|
|
14
15
|
: { findings: [], outcomes: [], warnings: [] };
|
|
15
16
|
const { results } = executed;
|
|
16
17
|
const found = dedupeFindings([...results.flatMap((r) => r.findings), ...imported.findings]);
|
|
17
18
|
const coverage = coverageOf(plan.decisions, results, plan.unchanged, executed.matrix.limited ?? [], executed.notStarted);
|
|
19
|
+
emit({ type: "coverage_settled", coverage });
|
|
18
20
|
const remembered = applyMemory(found, plan.memory);
|
|
19
21
|
const reported = new Set(found.map((f) => f.fingerprint));
|
|
20
22
|
const priorReview = withoutRemembered(prior, plan.memory);
|
package/dist/pipeline/imports.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { emptyUsage } from "../agent/usage.js";
|
|
2
2
|
import { anchorFinding } from "../anchor/anchor.js";
|
|
3
3
|
import { sarifCandidates } from "../sarif/candidates.js";
|
|
4
|
+
import { changedLines, overlaps } from "../sarif/evidence.js";
|
|
4
5
|
import { toFinding } from "./findings.js";
|
|
5
6
|
import { boundFinding } from "./task.js";
|
|
6
7
|
// A hostile log could carry thousands of results on the change.
|
|
@@ -87,23 +88,8 @@ function quoteFrom(content, lines) {
|
|
|
87
88
|
.trim();
|
|
88
89
|
return quote || undefined;
|
|
89
90
|
}
|
|
90
|
-
// The new-side lines each hunk covers, context included.
|
|
91
|
-
function changedLines(diffs) {
|
|
92
|
-
const windows = new Map();
|
|
93
|
-
for (const diff of diffs) {
|
|
94
|
-
const ranges = diff.hunks
|
|
95
|
-
.filter((h) => h.newLines > 0)
|
|
96
|
-
.map((h) => ({ start: h.newStart, end: h.newStart + h.newLines - 1 }));
|
|
97
|
-
if (ranges.length > 0)
|
|
98
|
-
windows.set(diff.newPath, ranges);
|
|
99
|
-
}
|
|
100
|
-
return windows;
|
|
101
|
-
}
|
|
102
91
|
function touches(windows, candidate) {
|
|
103
|
-
|
|
104
|
-
if (!ranges)
|
|
105
|
-
return false;
|
|
106
|
-
return ranges.some((r) => candidate.lines.start <= r.end && candidate.lines.end >= r.start);
|
|
92
|
+
return (windows.get(candidate.file) ?? []).some((r) => overlaps(candidate.lines, r, 0));
|
|
107
93
|
}
|
|
108
94
|
function importWarnings(tool, c) {
|
|
109
95
|
const left = [];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReviewContext, SymbolExtractor } from "../contracts.js";
|
|
2
|
+
import type { FileDiff } from "../domain.js";
|
|
3
|
+
import type { Learning } from "../knowledge/learning.js";
|
|
4
|
+
import { type SelectLearnings } from "../knowledge/select.js";
|
|
5
|
+
export declare function bundleLearnings(learnings: readonly Learning[], bundles: readonly {
|
|
6
|
+
files: readonly FileDiff[];
|
|
7
|
+
}[], context: Pick<ReviewContext, "readFile" | "searchCode">, extractor: SymbolExtractor | undefined): Promise<SelectLearnings>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { mapWithConcurrency } from "../agent/pool.js";
|
|
2
|
+
import { learningSelector } from "../knowledge/select.js";
|
|
3
|
+
import { changedCode } from "../review/impact.js";
|
|
4
|
+
// Characters of the code around one bundle's change that ranking reads.
|
|
5
|
+
const MAX_AROUND_CHARS = 50_000;
|
|
6
|
+
const READ_CONCURRENCY = 4;
|
|
7
|
+
// Each bundle's learnings, ranked with the code around its change where the
|
|
8
|
+
// limits leave a candidate out: only there does the ranking decide what a
|
|
9
|
+
// reviewer misses, so only there are the bundle's files read and parsed.
|
|
10
|
+
export async function bundleLearnings(learnings, bundles, context, extractor) {
|
|
11
|
+
const select = learningSelector(learnings);
|
|
12
|
+
if (!extractor)
|
|
13
|
+
return select;
|
|
14
|
+
const crowded = bundles.filter((b) => select(b.files).left.length > 0);
|
|
15
|
+
const around = new Map();
|
|
16
|
+
await mapWithConcurrency(crowded, READ_CONCURRENCY, async ({ files }) => {
|
|
17
|
+
around.set(files, await changedCode(files, context, extractor, MAX_AROUND_CHARS));
|
|
18
|
+
});
|
|
19
|
+
return (files, code) => select(files, code ?? around.get(files));
|
|
20
|
+
}
|
|
@@ -2,7 +2,8 @@ import type { ReviewerOverrides, RoleSettings, TierEfforts } from "../agent/sett
|
|
|
2
2
|
import type { AnchorContext } from "../anchor/anchor.js";
|
|
3
3
|
import type { BundlePolicy } from "../bundle/bundle.js";
|
|
4
4
|
import type { FileGrouper } from "../bundle/grouping.js";
|
|
5
|
-
import type { AgentRuntime, ModelChains } from "../contracts.js";
|
|
5
|
+
import type { AgentRuntime, ModelChains, ReferenceIndex, SymbolExtractor } from "../contracts.js";
|
|
6
|
+
import type { Learning } from "../knowledge/learning.js";
|
|
6
7
|
import type { MemoryEntry } from "../memory/memory.js";
|
|
7
8
|
import type { ReviewEvent } from "../report/report.js";
|
|
8
9
|
import type { ReviewerDefinition } from "../review/reviewer.js";
|
|
@@ -23,13 +24,17 @@ export interface ReviewOptions {
|
|
|
23
24
|
rules?: readonly SourcedRule[];
|
|
24
25
|
readTrusted?: (path: string) => Promise<string | undefined>;
|
|
25
26
|
accountMemory?: readonly MemoryEntry[];
|
|
27
|
+
learnings?: readonly Learning[];
|
|
26
28
|
selection?: Partial<SelectionPolicy>;
|
|
27
29
|
limits?: ReviewLimits;
|
|
28
30
|
stages?: ReviewStages;
|
|
29
31
|
mode?: ReviewMode;
|
|
30
32
|
identity?: RunIdentity;
|
|
31
33
|
resume?: ResumedRun;
|
|
34
|
+
symbols?: SymbolExtractor;
|
|
35
|
+
references?: ReferenceIndex;
|
|
32
36
|
sarif?: readonly SarifLog[];
|
|
37
|
+
sarifEvidence?: readonly SarifLog[];
|
|
33
38
|
signal?: AbortSignal;
|
|
34
39
|
onEvent?: (event: ReviewEvent) => void;
|
|
35
40
|
}
|
|
@@ -43,6 +48,8 @@ export interface ReviewLimits {
|
|
|
43
48
|
export interface ReviewStages {
|
|
44
49
|
verify?: boolean;
|
|
45
50
|
judge?: boolean;
|
|
51
|
+
showPreExisting?: boolean;
|
|
52
|
+
walkthrough?: boolean;
|
|
46
53
|
}
|
|
47
54
|
export interface ReviewMode {
|
|
48
55
|
full?: boolean;
|
|
@@ -64,3 +71,17 @@ export declare const REVIEW_DEFAULTS: {
|
|
|
64
71
|
readonly runTimeoutMs: number;
|
|
65
72
|
};
|
|
66
73
|
export declare const MAX_TIMER_MS: number;
|
|
74
|
+
export interface RunSettings {
|
|
75
|
+
concurrency: number;
|
|
76
|
+
taskTimeoutMs: number;
|
|
77
|
+
runTimeoutMs: number;
|
|
78
|
+
maxCostUsd?: number;
|
|
79
|
+
maxTasks?: number;
|
|
80
|
+
ultra: boolean;
|
|
81
|
+
full: boolean;
|
|
82
|
+
verify: boolean;
|
|
83
|
+
judge: boolean;
|
|
84
|
+
showPreExisting: boolean;
|
|
85
|
+
walkthrough: boolean;
|
|
86
|
+
}
|
|
87
|
+
export declare function runSettings(options: Pick<ReviewOptions, "limits" | "mode" | "stages">): RunSettings;
|
package/dist/pipeline/options.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { OcraError } from "../errors.js";
|
|
1
3
|
export const REVIEW_DEFAULTS = {
|
|
2
4
|
concurrency: 4,
|
|
3
5
|
taskTimeoutMs: 10 * 60_000,
|
|
@@ -6,3 +8,33 @@ export const REVIEW_DEFAULTS = {
|
|
|
6
8
|
// Timers fire at once past 2^31 - 1 ms (about 24.8 days); a longer timeout
|
|
7
9
|
// means no practical limit, so it is cut to the longest one a timer keeps.
|
|
8
10
|
export const MAX_TIMER_MS = 2 ** 31 - 1;
|
|
11
|
+
// Infinity is allowed (no practical limit), NaN never: z.number() refuses both.
|
|
12
|
+
const atLeast = (min, exclusive, what) => z.custom((v) => typeof v === "number" && (exclusive ? v > min : v >= min), `must be ${what}`);
|
|
13
|
+
const timeoutMs = atLeast(0, true, "a positive number of milliseconds");
|
|
14
|
+
const limitsSchema = z.object({
|
|
15
|
+
concurrency: z.int().positive().optional(),
|
|
16
|
+
taskTimeoutMs: timeoutMs.optional(),
|
|
17
|
+
runTimeoutMs: timeoutMs.optional(),
|
|
18
|
+
maxCostUsd: atLeast(0, false, "a number of US dollars, 0 or more").optional(),
|
|
19
|
+
maxTasks: z.int().nonnegative().optional(),
|
|
20
|
+
});
|
|
21
|
+
export function runSettings(options) {
|
|
22
|
+
const parsed = limitsSchema.safeParse(options.limits ?? {});
|
|
23
|
+
if (!parsed.success) {
|
|
24
|
+
throw new OcraError("CONFIG_INVALID", `ReviewOptions.limits is invalid: ${z.prettifyError(parsed.error)}`);
|
|
25
|
+
}
|
|
26
|
+
const limits = parsed.data;
|
|
27
|
+
return {
|
|
28
|
+
concurrency: limits.concurrency ?? REVIEW_DEFAULTS.concurrency,
|
|
29
|
+
taskTimeoutMs: Math.min(limits.taskTimeoutMs ?? REVIEW_DEFAULTS.taskTimeoutMs, MAX_TIMER_MS),
|
|
30
|
+
runTimeoutMs: Math.min(limits.runTimeoutMs ?? REVIEW_DEFAULTS.runTimeoutMs, MAX_TIMER_MS),
|
|
31
|
+
...(limits.maxCostUsd === undefined ? {} : { maxCostUsd: limits.maxCostUsd }),
|
|
32
|
+
...(limits.maxTasks === undefined ? {} : { maxTasks: limits.maxTasks }),
|
|
33
|
+
ultra: options.mode?.ultra === true,
|
|
34
|
+
full: options.mode?.full === true,
|
|
35
|
+
verify: options.stages?.verify !== false,
|
|
36
|
+
judge: options.stages?.judge !== false,
|
|
37
|
+
showPreExisting: options.stages?.showPreExisting !== false,
|
|
38
|
+
walkthrough: options.stages?.walkthrough === true,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -19,6 +19,13 @@ export declare const planOutputSchema: z.ZodObject<{
|
|
|
19
19
|
lite: "lite";
|
|
20
20
|
trivial: "trivial";
|
|
21
21
|
}>;
|
|
22
|
+
scope: z.ZodExactOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
23
|
+
mode: z.ZodLiteral<"incremental">;
|
|
24
|
+
since: z.ZodString;
|
|
25
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
26
|
+
mode: z.ZodLiteral<"full">;
|
|
27
|
+
reason: z.ZodString;
|
|
28
|
+
}, z.core.$strict>], "mode">>;
|
|
22
29
|
selected: z.ZodArray<z.ZodString>;
|
|
23
30
|
excluded: z.ZodArray<z.ZodObject<{
|
|
24
31
|
path: z.ZodString;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { EFFORT_LEVELS } from "../agent/settings.js";
|
|
3
3
|
import { riskTierSchema } from "../domain.js";
|
|
4
|
-
import { changeRequestSchema, skippedCellSchema } from "../report/output-schema.js";
|
|
4
|
+
import { changeRequestSchema, scopeSchema, skippedCellSchema } from "../report/output-schema.js";
|
|
5
5
|
import { exclusionReasonSchema } from "../select/select.js";
|
|
6
6
|
// The published shape of `ocra review --plan --format json` without what
|
|
7
7
|
// the CLI adds (where each setting came from), versioned like the report: a
|
|
@@ -28,6 +28,8 @@ export const planOutputSchema = z.strictObject({
|
|
|
28
28
|
version: z.literal(PLAN_VERSION),
|
|
29
29
|
changeRequest: changeRequestSchema,
|
|
30
30
|
tier: riskTierSchema,
|
|
31
|
+
// Added in version 1 without a bump, like planCalls: the report's scope.
|
|
32
|
+
scope: scopeSchema.exactOptional(),
|
|
31
33
|
selected: z.array(z.string()),
|
|
32
34
|
excluded: z.array(z.strictObject({ path: z.string(), reason: exclusionReasonSchema })),
|
|
33
35
|
bundles: z.array(z.strictObject({ label: z.string(), files: z.array(z.string()) })),
|
|
@@ -61,6 +63,7 @@ export function toPlanOutput(preview) {
|
|
|
61
63
|
...(c.override ? { override: { by: c.override.by, reason: c.override.reason } } : {}),
|
|
62
64
|
},
|
|
63
65
|
tier: preview.tier,
|
|
66
|
+
...(preview.scope ? { scope: planScope(preview.scope) } : {}),
|
|
64
67
|
selected: [...preview.selected],
|
|
65
68
|
excluded: preview.excluded.map((e) => ({ path: e.path, reason: e.reason })),
|
|
66
69
|
bundles: preview.bundles.map((b) => ({ label: b.label, files: [...b.files] })),
|
|
@@ -106,3 +109,8 @@ function planTask(t) {
|
|
|
106
109
|
: {}),
|
|
107
110
|
};
|
|
108
111
|
}
|
|
112
|
+
function planScope(scope) {
|
|
113
|
+
return scope.mode === "incremental"
|
|
114
|
+
? { mode: "incremental", since: scope.since }
|
|
115
|
+
: { mode: "full", reason: scope.reason };
|
|
116
|
+
}
|
package/dist/pipeline/plan.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type Bundle } from "../bundle/bundle.js";
|
|
2
2
|
import type { AgentRuntime, ReviewContext, Usage } from "../contracts.js";
|
|
3
|
-
import type { ChangeRequest, FileDiff, RiskTier } from "../domain.js";
|
|
3
|
+
import type { ChangeRequest, FileDiff, PriorReview, RiskTier } from "../domain.js";
|
|
4
|
+
import type { SelectLearnings } from "../knowledge/select.js";
|
|
4
5
|
import { type RememberedEntry } from "../memory/memory.js";
|
|
5
|
-
import type { ReviewEvent } from "../report/report.js";
|
|
6
|
+
import type { ReviewEvent, ReviewReport } from "../report/report.js";
|
|
6
7
|
import { type SourcedRule } from "../rules/repo-rules.js";
|
|
8
|
+
import { type AnalyzerEvidence } from "../sarif/evidence.js";
|
|
7
9
|
import { type FileDecision } from "../select/select.js";
|
|
8
10
|
import type { ReviewHooks, ReviewOptions } from "./options.js";
|
|
9
11
|
export interface ReviewPlan {
|
|
@@ -13,21 +15,25 @@ export interface ReviewPlan {
|
|
|
13
15
|
tier: RiskTier;
|
|
14
16
|
bundles: Bundle[];
|
|
15
17
|
unchanged: ReadonlySet<string>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
prior: {
|
|
19
|
+
review?: PriorReview;
|
|
20
|
+
warning?: string;
|
|
19
21
|
};
|
|
22
|
+
scope?: ReviewScope;
|
|
20
23
|
context: ReviewContext;
|
|
21
24
|
guidelines: string | undefined;
|
|
22
25
|
repoRules: SourcedRule[];
|
|
23
26
|
memory: RememberedEntry[];
|
|
27
|
+
learnings: SelectLearnings;
|
|
28
|
+
evidence: AnalyzerEvidence;
|
|
24
29
|
usage: Usage[];
|
|
25
30
|
warnings: string[];
|
|
26
31
|
}
|
|
27
|
-
export type PlanOptions = Pick<ReviewOptions & ReviewHooks, "vcs" | "rules" | "readTrusted" | "accountMemory" | "selection" | "bundling" | "grouper" | "effort" | "roles" | "resume"> & {
|
|
32
|
+
export type PlanOptions = Pick<ReviewOptions & ReviewHooks, "vcs" | "rules" | "readTrusted" | "accountMemory" | "learnings" | "symbols" | "sarifEvidence" | "selection" | "bundling" | "grouper" | "effort" | "roles" | "resume"> & {
|
|
28
33
|
runId?: string;
|
|
29
34
|
runtime?: AgentRuntime;
|
|
30
|
-
|
|
31
|
-
priorTier?: RiskTier;
|
|
35
|
+
full?: boolean;
|
|
32
36
|
};
|
|
37
|
+
type ReviewScope = NonNullable<ReviewReport["scope"]>;
|
|
33
38
|
export declare function planReview(options: PlanOptions, emit: (event: ReviewEvent) => void, signal: AbortSignal): Promise<ReviewPlan>;
|
|
39
|
+
export {};
|
package/dist/pipeline/plan.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import { roleCall } from "../agent/settings.js";
|
|
2
2
|
import { bundleFiles, defaultBundlePolicy } from "../bundle/bundle.js";
|
|
3
3
|
import { runtimeGrouper } from "../bundle/runtime-grouper.js";
|
|
4
|
+
import { errorMessage } from "../errors.js";
|
|
5
|
+
import { rank } from "../matrix/matrix.js";
|
|
4
6
|
import { MEMORY_PATH, mergeMemory, parseMemory } from "../memory/memory.js";
|
|
5
7
|
import { parseRepoRules, REPO_RULES_PATH, } from "../rules/repo-rules.js";
|
|
6
|
-
import {
|
|
8
|
+
import { analyzerEvidence } from "../sarif/evidence.js";
|
|
9
|
+
import { binaryTextWarning, defaultSelectionPolicy, selectFiles, } from "../select/select.js";
|
|
7
10
|
import { triage } from "../triage.js";
|
|
8
11
|
import { reviewContext } from "./context.js";
|
|
9
|
-
import {
|
|
12
|
+
import { bundleLearnings } from "./learnings.js";
|
|
10
13
|
import { resumedBundles } from "./resume.js";
|
|
11
14
|
import { newRunId } from "./run-id.js";
|
|
12
15
|
const GUIDELINES_PATH = "AGENTS.md";
|
|
13
16
|
export async function planReview(options, emit, signal) {
|
|
14
17
|
const { vcs } = options;
|
|
15
18
|
const readTrusted = options.readTrusted ?? ((path) => vcs.readFile(path));
|
|
19
|
+
const prior = await loadPriorReview(vcs);
|
|
20
|
+
const scope = reviewScope(prior.review, options.full === true);
|
|
16
21
|
const changeRequest = await vcs.getChangeRequest();
|
|
17
22
|
emit({ type: "run_started", runId: options.runId ?? newRunId(), changeRequest });
|
|
23
|
+
emit({ type: "stage_started", stage: "select" });
|
|
18
24
|
const diffs = await vcs.getDiff();
|
|
19
25
|
const decisions = selectFiles(diffs, { ...defaultSelectionPolicy, ...options.selection });
|
|
20
26
|
const selected = decisions.filter((d) => d.selected).map((d) => d.diff);
|
|
@@ -35,14 +41,18 @@ export async function planReview(options, emit, signal) {
|
|
|
35
41
|
(options.runtime
|
|
36
42
|
? runtimeGrouper(options.runtime, signal, (u) => usage.push(u), roleCall("helper", options))
|
|
37
43
|
: undefined);
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
// The rest of the change still sets the risk tier; a tier above the prior
|
|
45
|
+
// review's adds reviewers, so everything is reviewed again.
|
|
46
|
+
const priorTier = prior.review?.tier;
|
|
47
|
+
const widened = scope.only && priorTier && rank(tier) > rank(priorTier)
|
|
48
|
+
? { from: priorTier, to: tier }
|
|
40
49
|
: undefined;
|
|
41
|
-
const only = widened ? undefined :
|
|
50
|
+
const only = widened ? undefined : scope.only;
|
|
42
51
|
const inScope = only
|
|
43
52
|
? selected.filter((d) => only.has(d.newPath) || only.has(d.oldPath))
|
|
44
53
|
: selected;
|
|
45
54
|
const unchanged = new Set(selected.filter((d) => !inScope.includes(d)).map((d) => d.newPath));
|
|
55
|
+
emit({ type: "stage_started", stage: "bundle" });
|
|
46
56
|
const resumed = options.resume && resumedBundles(options.resume, inScope);
|
|
47
57
|
const bundled = resumed
|
|
48
58
|
? { bundles: resumed, strategy: "resumed", warnings: [] }
|
|
@@ -54,6 +64,10 @@ export async function planReview(options, emit, signal) {
|
|
|
54
64
|
groups: bundled.bundles.map((b) => ({ label: b.label, files: b.files.map((f) => f.newPath) })),
|
|
55
65
|
warnings: bundled.warnings,
|
|
56
66
|
});
|
|
67
|
+
const binaryText = binaryTextWarning(decisions);
|
|
68
|
+
const evidence = analyzerEvidence(options.sarifEvidence ?? [], bundled.bundles);
|
|
69
|
+
const context = reviewContext(vcs, diffs, options.learnings);
|
|
70
|
+
const learnings = await bundleLearnings(options.learnings ?? [], bundled.bundles, context, options.symbols);
|
|
57
71
|
return {
|
|
58
72
|
changeRequest,
|
|
59
73
|
decisions,
|
|
@@ -61,19 +75,57 @@ export async function planReview(options, emit, signal) {
|
|
|
61
75
|
tier,
|
|
62
76
|
bundles: bundled.bundles,
|
|
63
77
|
unchanged,
|
|
64
|
-
|
|
65
|
-
|
|
78
|
+
prior,
|
|
79
|
+
...(widened
|
|
80
|
+
? {
|
|
81
|
+
scope: {
|
|
82
|
+
mode: "full",
|
|
83
|
+
reason: `the risk tier rose from ${widened.from} to ${widened.to}, which adds reviewers`,
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
: scope.note
|
|
87
|
+
? { scope: scope.note }
|
|
88
|
+
: {}),
|
|
89
|
+
context,
|
|
66
90
|
guidelines,
|
|
67
91
|
repoRules: [
|
|
68
92
|
...(options.rules ?? []),
|
|
69
93
|
...fileRules.map((rule) => ({ ...rule, source: "repository" })),
|
|
70
94
|
],
|
|
71
95
|
memory: mergeMemory(memoryText === undefined ? [] : parseMemory(memoryText), options.accountMemory ?? []),
|
|
96
|
+
learnings,
|
|
97
|
+
evidence,
|
|
72
98
|
usage,
|
|
73
|
-
warnings: bundled.warnings,
|
|
99
|
+
warnings: [...(binaryText ? [binaryText] : []), ...bundled.warnings, ...evidence.warnings],
|
|
74
100
|
};
|
|
75
101
|
}
|
|
76
102
|
async function loadRepoRules(read) {
|
|
77
103
|
const text = await read(REPO_RULES_PATH);
|
|
78
104
|
return text === undefined ? [] : parseRepoRules(text);
|
|
79
105
|
}
|
|
106
|
+
// Review only what changed since the prior review when the platform can
|
|
107
|
+
// tell; otherwise everything, with the reason in the report.
|
|
108
|
+
function reviewScope(review, full) {
|
|
109
|
+
if (!review)
|
|
110
|
+
return {};
|
|
111
|
+
if (full)
|
|
112
|
+
return { note: { mode: "full", reason: "a full review was requested" } };
|
|
113
|
+
if (review.changedSince) {
|
|
114
|
+
return {
|
|
115
|
+
only: new Set(review.changedSince.files),
|
|
116
|
+
note: { mode: "incremental", since: review.changedSince.head },
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const reason = review.fullReviewReason ?? "the platform cannot tell what changed since";
|
|
120
|
+
return { note: { mode: "full", reason } };
|
|
121
|
+
}
|
|
122
|
+
// A missing prior review only costs the comparison, never the review.
|
|
123
|
+
async function loadPriorReview(vcs) {
|
|
124
|
+
try {
|
|
125
|
+
const review = await vcs.getPriorReview();
|
|
126
|
+
return review ? { review } : {};
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
return { warning: `could not load the previous review: ${errorMessage(error)}` };
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Effort } from "../contracts.js";
|
|
2
2
|
import type { ChangeRequest, RiskTier } from "../domain.js";
|
|
3
|
+
import { type SkippedCell } from "../matrix/matrix.js";
|
|
3
4
|
import type { FileDecision } from "../select/select.js";
|
|
4
|
-
import { type
|
|
5
|
-
import type
|
|
6
|
-
import { type PlanOptions } from "./plan.js";
|
|
5
|
+
import { type ReviewOptions } from "./options.js";
|
|
6
|
+
import { type PlanOptions, type ReviewPlan } from "./plan.js";
|
|
7
7
|
export interface PreviewTask {
|
|
8
8
|
taskId: string;
|
|
9
9
|
reviewer: string;
|
|
@@ -29,6 +29,7 @@ type InputCost = {
|
|
|
29
29
|
export interface ReviewPreview {
|
|
30
30
|
changeRequest: ChangeRequest;
|
|
31
31
|
tier: RiskTier;
|
|
32
|
+
scope?: NonNullable<ReviewPlan["scope"]>;
|
|
32
33
|
selected: string[];
|
|
33
34
|
excluded: {
|
|
34
35
|
path: string;
|
|
@@ -53,7 +54,7 @@ export interface ReviewPreview {
|
|
|
53
54
|
};
|
|
54
55
|
warnings: string[];
|
|
55
56
|
}
|
|
56
|
-
export type PreviewOptions = Omit<PlanOptions, "runtime"> & Omit<ReviewOptions, "vcs" | "runtime"> & {
|
|
57
|
+
export type PreviewOptions = Omit<PlanOptions, "runtime" | "full"> & Omit<ReviewOptions, "vcs" | "runtime" | "full"> & {
|
|
57
58
|
inputPrice?: (model: string) => number | undefined;
|
|
58
59
|
};
|
|
59
60
|
export declare function previewReview(options: PreviewOptions): Promise<ReviewPreview>;
|