codecartographer-pi 0.16.0 → 0.17.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/.codecarto/GUIDE.md +15 -2
- package/.codecarto/README.md +3 -0
- package/.codecarto/broadside/SKILL.md +143 -0
- package/.codecarto/broadside/config.yaml +104 -0
- package/.codecarto/findings/broadside-scout/README.md +20 -0
- package/.codecarto/findings/broadside-scout/SKILL.md +101 -0
- package/.codecarto/skills/spec-delta-application/SKILL.md +3 -1
- package/.codecarto/templates/backlog-project.md +51 -0
- package/.codecarto/templates/broadside-scout-brief.md +97 -0
- package/.codecarto/{THREAD_LOG.md → templates/thread-log.md} +2 -5
- package/.codecarto/workflow/pipeline-scout-first.yaml +271 -0
- package/.codecarto/workflow/scaffold-version.yaml +1 -1
- package/README.md +47 -2
- package/agent-skill/codecartographer/SKILL.md +3 -1
- package/agent-skill/codecartographer/references/broadside.md +115 -0
- package/agent-skill/codecartographer/references/library.md +1 -1
- package/agent-skill/codecartographer/references/pipeline-selection.md +14 -0
- package/dist/core/broadside.d.ts +421 -0
- package/dist/core/broadside.js +2349 -0
- package/dist/core/completion.js +20 -4
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/library.d.ts +22 -0
- package/dist/core/library.js +101 -1
- package/dist/core/orchestrator-config.js +5 -2
- package/dist/core/pipeline.js +1 -0
- package/dist/core/status.js +9 -1
- package/dist/core/utils.js +7 -1
- package/dist/core/workspace.d.ts +17 -0
- package/dist/core/workspace.js +68 -2
- package/dist/extensions/codecarto/agent-runner.js +6 -0
- package/dist/extensions/codecarto/broadside-flags.d.ts +21 -0
- package/dist/extensions/codecarto/broadside-flags.js +116 -0
- package/dist/extensions/codecarto/index.js +232 -4
- package/dist/mcp-server/server.d.ts +22 -0
- package/dist/mcp-server/server.js +218 -11
- package/package.json +10 -1
- package/.codecarto/BACKLOG.md +0 -184
- package/.codecarto/CHANGELOG-2026-05-02-feedback-pass.md +0 -118
- package/.codecarto/closeouts/2026-05-02-framework-feedback-pass.md +0 -111
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
export declare const BROADSIDE_MODEL = "google/gemini-3.7-flash:batch";
|
|
2
|
+
export declare const BROADSIDE_BATCH_URL = "https://openrouter.ai/api/beta/batches";
|
|
3
|
+
export declare const BROADSIDE_DIR = "broadside";
|
|
4
|
+
/** Name Broad-Side answers to on the skill surfaces. Not a post-pipeline skill — see readBroadsideSkill. */
|
|
5
|
+
export declare const BROADSIDE_SKILL_NAME = "broadside";
|
|
6
|
+
export declare const BROADSIDE_STATE_FILE = "state.json";
|
|
7
|
+
export declare const BROADSIDE_CONFIG_FILE = "config.yaml";
|
|
8
|
+
export declare const BROADSIDE_STATE_SCHEMA_VERSION = 1;
|
|
9
|
+
export declare const BROADSIDE_INPUT_PRICE_PER_M = 0.1875;
|
|
10
|
+
export declare const BROADSIDE_OUTPUT_PRICE_PER_M = 0.9375;
|
|
11
|
+
export declare const BROADSIDE_MODELS_URL = "https://openrouter.ai/api/v1/models";
|
|
12
|
+
export declare const BROADSIDE_BENCHMARKS_URL = "https://openrouter.ai/api/v1/benchmarks";
|
|
13
|
+
export declare const BROADSIDE_CATALOG_CACHE_FILE = "model-catalog.json";
|
|
14
|
+
export declare const BROADSIDE_CATALOG_CACHE_TTL_MS: number;
|
|
15
|
+
export declare const BROADSIDE_LENS_IDS: readonly ["architecture", "api", "security", "defect", "conventions", "porting"];
|
|
16
|
+
export type BroadsideLensId = (typeof BROADSIDE_LENS_IDS)[number];
|
|
17
|
+
export declare const BROADSIDE_POLL_INTERVAL_MS = 15000;
|
|
18
|
+
export declare const BROADSIDE_DEFAULT_POLL_BUDGET_MS: number;
|
|
19
|
+
export type ModelPricing = {
|
|
20
|
+
/** USD per million input tokens. */
|
|
21
|
+
inputPerM: number;
|
|
22
|
+
/** USD per million output tokens. */
|
|
23
|
+
outputPerM: number;
|
|
24
|
+
/** Where the numbers came from — affects what the submit text claims. */
|
|
25
|
+
source: "built-in" | "config" | "live" | "cache";
|
|
26
|
+
};
|
|
27
|
+
/** The subset of the OpenRouter model catalog Broad-Side actually uses. */
|
|
28
|
+
export type CatalogEntry = {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
inputPerM: number;
|
|
32
|
+
outputPerM: number;
|
|
33
|
+
cachedInputPerM?: number;
|
|
34
|
+
contextLength?: number;
|
|
35
|
+
maxCompletionTokens?: number;
|
|
36
|
+
/** Empty array means unknown, not "supports nothing". */
|
|
37
|
+
supportedParameters: string[];
|
|
38
|
+
expirationDate?: string | null;
|
|
39
|
+
};
|
|
40
|
+
export type CodingBenchmarks = {
|
|
41
|
+
/** Base model slug (batch suffix stripped) → indices. */
|
|
42
|
+
byBaseSlug: Record<string, {
|
|
43
|
+
codingIndex?: number;
|
|
44
|
+
intelligenceIndex?: number;
|
|
45
|
+
}>;
|
|
46
|
+
/** Citation/attribution metadata from the benchmarks endpoint. */
|
|
47
|
+
meta: Record<string, unknown>;
|
|
48
|
+
};
|
|
49
|
+
export type BroadsideCatalogResult = {
|
|
50
|
+
model: string;
|
|
51
|
+
source: "built-in" | "config" | "live" | "cache";
|
|
52
|
+
entry: CatalogEntry | null;
|
|
53
|
+
benchmarks?: CodingBenchmarks;
|
|
54
|
+
};
|
|
55
|
+
export type JsonSchemaDef = {
|
|
56
|
+
name: string;
|
|
57
|
+
strict: boolean;
|
|
58
|
+
schema: Record<string, unknown>;
|
|
59
|
+
};
|
|
60
|
+
export type RepoInfo = {
|
|
61
|
+
name: string;
|
|
62
|
+
path: string;
|
|
63
|
+
language: string;
|
|
64
|
+
manifest: {
|
|
65
|
+
path: string;
|
|
66
|
+
content: string;
|
|
67
|
+
} | null;
|
|
68
|
+
mainFile: string;
|
|
69
|
+
readmeFirst: string;
|
|
70
|
+
fileTree: string;
|
|
71
|
+
fileCounts: Record<string, number>;
|
|
72
|
+
sourceGlob: string;
|
|
73
|
+
sourceExts: string[];
|
|
74
|
+
};
|
|
75
|
+
export type FileSlice = {
|
|
76
|
+
moduleName: string;
|
|
77
|
+
content: string;
|
|
78
|
+
fileCount: number;
|
|
79
|
+
chars: number;
|
|
80
|
+
/** Repo-relative paths of the files folded into this slice. */
|
|
81
|
+
files: string[];
|
|
82
|
+
};
|
|
83
|
+
export type BatchRequest = {
|
|
84
|
+
custom_id: string;
|
|
85
|
+
body: {
|
|
86
|
+
model: string;
|
|
87
|
+
messages: {
|
|
88
|
+
role: "system" | "user";
|
|
89
|
+
content: string;
|
|
90
|
+
}[];
|
|
91
|
+
response_format: {
|
|
92
|
+
type: "json_schema";
|
|
93
|
+
json_schema: JsonSchemaDef;
|
|
94
|
+
};
|
|
95
|
+
max_tokens: number;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export type BatchTerminalStatus = "completed" | "failed" | "expired" | "cancelled";
|
|
99
|
+
export type BroadsideBatchEntry = {
|
|
100
|
+
batchId: string;
|
|
101
|
+
requests: number;
|
|
102
|
+
status: string;
|
|
103
|
+
submittedAt: string;
|
|
104
|
+
completedAt?: string;
|
|
105
|
+
estimatedCost: number;
|
|
106
|
+
cost?: number;
|
|
107
|
+
resultCount?: number;
|
|
108
|
+
error?: unknown;
|
|
109
|
+
/** Set when this lens used a model other than the run default. */
|
|
110
|
+
model?: string;
|
|
111
|
+
/** The completion ceiling of this lens's model; bounds the truncation retry. */
|
|
112
|
+
outputCap?: number;
|
|
113
|
+
};
|
|
114
|
+
export type BroadsideSynthesisEntry = {
|
|
115
|
+
batchId?: string;
|
|
116
|
+
status: "pending" | "submitted" | "completed" | "failed";
|
|
117
|
+
cost?: number;
|
|
118
|
+
};
|
|
119
|
+
/** One triage item — a scouting lead turned into a work-order entry. */
|
|
120
|
+
export type TriageItem = {
|
|
121
|
+
title: string;
|
|
122
|
+
severity: string;
|
|
123
|
+
module: string;
|
|
124
|
+
impact: "high" | "medium" | "low";
|
|
125
|
+
difficulty: "high" | "medium" | "low";
|
|
126
|
+
priority: string;
|
|
127
|
+
effort_estimate: string;
|
|
128
|
+
rationale: string;
|
|
129
|
+
};
|
|
130
|
+
export type BroadsideTriageEntry = {
|
|
131
|
+
batchId?: string;
|
|
132
|
+
status: "pending" | "submitted" | "completed" | "failed";
|
|
133
|
+
cost?: number;
|
|
134
|
+
};
|
|
135
|
+
export type BroadsideRun = {
|
|
136
|
+
id: string;
|
|
137
|
+
createdAt: string;
|
|
138
|
+
model: string;
|
|
139
|
+
lenses: BroadsideLensId[];
|
|
140
|
+
status: "in-flight" | "completed" | "partial" | "failed";
|
|
141
|
+
outputDir: string;
|
|
142
|
+
batches: Partial<Record<BroadsideLensId, BroadsideBatchEntry>>;
|
|
143
|
+
synthesis: BroadsideSynthesisEntry;
|
|
144
|
+
triage: BroadsideTriageEntry;
|
|
145
|
+
totalCost?: number;
|
|
146
|
+
pricing?: ModelPricing;
|
|
147
|
+
maxCost?: number;
|
|
148
|
+
/** The model's completion ceiling, recorded so collect can cap retries. */
|
|
149
|
+
outputCap?: number;
|
|
150
|
+
/** Git HEAD at submit time, for incremental re-scouting (#142). */
|
|
151
|
+
sourceHead?: string | null;
|
|
152
|
+
/** Whether the working tree was dirty at submit time. */
|
|
153
|
+
sourceDirty?: boolean;
|
|
154
|
+
/** When incremental, the previous run's HEAD this run diffs against. */
|
|
155
|
+
baseHead?: string | null;
|
|
156
|
+
};
|
|
157
|
+
export type BroadsideStateFile = {
|
|
158
|
+
schema_version: number;
|
|
159
|
+
runs: BroadsideRun[];
|
|
160
|
+
};
|
|
161
|
+
export type BroadsideConfig = {
|
|
162
|
+
model: string;
|
|
163
|
+
apiKey: string;
|
|
164
|
+
defaultLenses: BroadsideLensId[];
|
|
165
|
+
/** Approximate run expense limit in USD; 0 means no limit. */
|
|
166
|
+
maxCost: number;
|
|
167
|
+
/** Manual pricing overrides (USD per million). Live lookup is preferred. */
|
|
168
|
+
pricing: {
|
|
169
|
+
inputPerM: number;
|
|
170
|
+
outputPerM: number;
|
|
171
|
+
} | null;
|
|
172
|
+
/**
|
|
173
|
+
* Per-lens model overrides. A lens absent here uses `model`. This is how a
|
|
174
|
+
* repository routes the semantic lenses (security, defect) to a stronger
|
|
175
|
+
* batch model while the cheap default carries the rest — the whole point of
|
|
176
|
+
* the cheap model is telling the expensive one where to look, and that
|
|
177
|
+
* trade-off is not the same for every lens.
|
|
178
|
+
*/
|
|
179
|
+
lensModels: Partial<Record<BroadsideLensId, string>>;
|
|
180
|
+
/**
|
|
181
|
+
* Repo defaults for the per-call run knobs. Each mirrors a tool parameter
|
|
182
|
+
* of the same name; an explicit parameter always wins. They live here so a
|
|
183
|
+
* repository can fix its own scouting policy once instead of restating it
|
|
184
|
+
* on every submit and collect.
|
|
185
|
+
*/
|
|
186
|
+
incremental: boolean;
|
|
187
|
+
retryTruncated: boolean;
|
|
188
|
+
includeSynthesis: boolean;
|
|
189
|
+
includeTriage: boolean;
|
|
190
|
+
/** Default poll budget in seconds; 0 means "return immediately". */
|
|
191
|
+
waitSeconds: number;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* The pre-flight facts a caller needs to decide whether a run is worth its
|
|
195
|
+
* price: what each lens would cost, at what rates, against which limit. Handed
|
|
196
|
+
* to {@link BroadsideSubmitOptions.confirm} before anything is submitted.
|
|
197
|
+
*/
|
|
198
|
+
export type BroadsideEstimate = {
|
|
199
|
+
model: string;
|
|
200
|
+
pricing: ModelPricing;
|
|
201
|
+
lenses: Array<{
|
|
202
|
+
lensId: BroadsideLensId;
|
|
203
|
+
name: string;
|
|
204
|
+
slices: number;
|
|
205
|
+
maxTokens: number;
|
|
206
|
+
cost: number;
|
|
207
|
+
/** The model this lens would use — `model` unless a per-lens override applies. */
|
|
208
|
+
model: string;
|
|
209
|
+
pricing: ModelPricing;
|
|
210
|
+
}>;
|
|
211
|
+
/** True when at least one lens uses a model other than the run default. */
|
|
212
|
+
mixedModels: boolean;
|
|
213
|
+
totalCost: number;
|
|
214
|
+
inputTokens: number;
|
|
215
|
+
outputTokens: number;
|
|
216
|
+
/** Run expense limit in USD; 0 means no limit. */
|
|
217
|
+
maxCost: number;
|
|
218
|
+
/** True when totalCost is over a non-zero maxCost. */
|
|
219
|
+
exceedsLimit: boolean;
|
|
220
|
+
/** Set when incremental scouting found a baseline to diff against. */
|
|
221
|
+
baseHead: string | null;
|
|
222
|
+
sourceDirty: boolean;
|
|
223
|
+
/** The provider's completion ceiling, when the catalog advertises one. */
|
|
224
|
+
outputCap?: number;
|
|
225
|
+
};
|
|
226
|
+
/** Thrown when a confirm hook declines a run. Nothing was submitted. */
|
|
227
|
+
export declare class BroadsideCancelledError extends Error {
|
|
228
|
+
constructor(message?: string);
|
|
229
|
+
}
|
|
230
|
+
export type BroadsideSubmitResult = {
|
|
231
|
+
runId: string;
|
|
232
|
+
outputDir: string;
|
|
233
|
+
batches: Partial<Record<BroadsideLensId, BroadsideBatchEntry>>;
|
|
234
|
+
estimatedTotalCost: number;
|
|
235
|
+
estimatedInputTokens: number;
|
|
236
|
+
estimatedOutputTokens: number;
|
|
237
|
+
pricing: ModelPricing;
|
|
238
|
+
maxCost?: number;
|
|
239
|
+
modelInfo: {
|
|
240
|
+
contextLength?: number;
|
|
241
|
+
maxCompletionTokens?: number;
|
|
242
|
+
supportsStructuredOutputs?: boolean;
|
|
243
|
+
expirationDate?: string | null;
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
export type BroadsideCollectResult = {
|
|
247
|
+
runId: string;
|
|
248
|
+
status: string;
|
|
249
|
+
totalCost: number;
|
|
250
|
+
resultCount: number;
|
|
251
|
+
/** Results whose JSON did not parse even after fence stripping —
|
|
252
|
+
* the signature of an output cut off at max_tokens. */
|
|
253
|
+
truncatedCount: number;
|
|
254
|
+
/** Truncated slices recovered by the automatic re-submit pass (#133). */
|
|
255
|
+
retriedCount: number;
|
|
256
|
+
lensOutcomes: Partial<Record<BroadsideLensId, {
|
|
257
|
+
status: string;
|
|
258
|
+
cost?: number;
|
|
259
|
+
resultCount?: number;
|
|
260
|
+
truncated?: number;
|
|
261
|
+
}>>;
|
|
262
|
+
synthesis: BroadsideSynthesisEntry;
|
|
263
|
+
triage: BroadsideTriageEntry;
|
|
264
|
+
topFindings: {
|
|
265
|
+
title: string;
|
|
266
|
+
severity: string;
|
|
267
|
+
sourceLens: string;
|
|
268
|
+
summary: string;
|
|
269
|
+
}[];
|
|
270
|
+
topTriageItems: TriageItem[];
|
|
271
|
+
};
|
|
272
|
+
type LensDefinition = {
|
|
273
|
+
id: BroadsideLensId;
|
|
274
|
+
name: string;
|
|
275
|
+
description: string;
|
|
276
|
+
schemaName: string;
|
|
277
|
+
sliceBy: "none" | "directory" | "auto";
|
|
278
|
+
maxChars: number;
|
|
279
|
+
maxTokens: number;
|
|
280
|
+
skipTestFiles?: boolean;
|
|
281
|
+
globsFor: (info: RepoInfo) => string[];
|
|
282
|
+
systemPrompt: (info: RepoInfo) => string;
|
|
283
|
+
userPrompt: (info: RepoInfo, source: string, moduleName: string) => string;
|
|
284
|
+
};
|
|
285
|
+
export declare function getLens(lensId: BroadsideLensId): LensDefinition;
|
|
286
|
+
export declare function listLenses(): LensDefinition[];
|
|
287
|
+
export declare function collectRepoInfo(targetDir: string): Promise<RepoInfo>;
|
|
288
|
+
export declare function gatherSlices(targetDir: string, lens: LensDefinition, info: RepoInfo): Promise<FileSlice[]>;
|
|
289
|
+
export declare function buildBatchRequest(lens: LensDefinition, info: RepoInfo, slice: FileSlice, index: number, sliceCount: number, model?: string, maxTokensOverride?: number): BatchRequest;
|
|
290
|
+
export declare function estimateCost(lens: LensDefinition, slices: FileSlice[], pricing: ModelPricing, maxTokensOverride?: number): {
|
|
291
|
+
inputTokens: number;
|
|
292
|
+
outputTokens: number;
|
|
293
|
+
cost: number;
|
|
294
|
+
};
|
|
295
|
+
export declare function broadsideDirFor(cwd: string): string;
|
|
296
|
+
/**
|
|
297
|
+
* Read the Broad-Side reading guide.
|
|
298
|
+
*
|
|
299
|
+
* It is deliberately not a post-pipeline skill under `.codecarto/skills/`: a
|
|
300
|
+
* scout run is read *before* or *during* the interactive pipeline, and the
|
|
301
|
+
* post-pipeline machinery gates on a completed run and wraps its prompt in
|
|
302
|
+
* post-pipeline framing that would be false here. It is also readable on a
|
|
303
|
+
* repository that has scout state and no workspace at all, which is why this
|
|
304
|
+
* falls back to the packaged copy.
|
|
305
|
+
*
|
|
306
|
+
* @param cwd - Absolute path to the target repository.
|
|
307
|
+
* @returns the skill text and the path it came from.
|
|
308
|
+
* @throws when neither the workspace copy nor the packaged copy exists.
|
|
309
|
+
*/
|
|
310
|
+
export declare function readBroadsideSkill(cwd: string): Promise<{
|
|
311
|
+
path: string;
|
|
312
|
+
content: string;
|
|
313
|
+
}>;
|
|
314
|
+
export declare function defaultBroadsideState(): BroadsideStateFile;
|
|
315
|
+
export declare function loadBroadsideState(broadsideDir: string): Promise<BroadsideStateFile>;
|
|
316
|
+
export declare function saveBroadsideState(broadsideDir: string, state: BroadsideStateFile): Promise<void>;
|
|
317
|
+
export declare function loadBroadsideConfig(broadsideDir: string): Promise<BroadsideConfig>;
|
|
318
|
+
export declare function builtInCatalogEntry(model: string): CatalogEntry | null;
|
|
319
|
+
export declare function builtInPricing(model: string): ModelPricing | null;
|
|
320
|
+
export declare function resolveCatalogEntry(broadsideDir: string, config: BroadsideConfig, model: string, apiKey: string, fetcher?: FetchLike): Promise<BroadsideCatalogResult>;
|
|
321
|
+
export declare function resolveModelPricing(broadsideDir: string, config: BroadsideConfig, model: string, apiKey: string, fetcher?: FetchLike): Promise<ModelPricing>;
|
|
322
|
+
export declare function fetchCodingBenchmarks(apiKey: string, fetcher?: FetchLike): Promise<CodingBenchmarks | null>;
|
|
323
|
+
export declare function listBatchModels(broadsideDir: string, config: BroadsideConfig, apiKey: string, opts?: {
|
|
324
|
+
includeBenchmarks?: boolean;
|
|
325
|
+
fetcher?: FetchLike;
|
|
326
|
+
}): Promise<{
|
|
327
|
+
entries: CatalogEntry[];
|
|
328
|
+
source: string;
|
|
329
|
+
benchmarks: CodingBenchmarks | null;
|
|
330
|
+
defaultModel: string;
|
|
331
|
+
}>;
|
|
332
|
+
export type FetchLike = (url: string, init: Record<string, unknown>) => Promise<Response>;
|
|
333
|
+
export declare function submitBatch(batchRequests: BatchRequest[], apiKey: string, fetcher?: FetchLike, model?: string): Promise<{
|
|
334
|
+
batchId: string;
|
|
335
|
+
status: string;
|
|
336
|
+
error?: unknown;
|
|
337
|
+
}>;
|
|
338
|
+
export declare function fetchBatch(batchId: string, apiKey: string, fetcher?: FetchLike): Promise<Record<string, unknown>>;
|
|
339
|
+
export declare function pollBatchUntilTerminal(batchId: string, apiKey: string, opts?: {
|
|
340
|
+
deadlineMs?: number;
|
|
341
|
+
onStatus?: (status: string, counts: Record<string, unknown>) => void;
|
|
342
|
+
fetcher?: FetchLike;
|
|
343
|
+
pollIntervalMs?: number;
|
|
344
|
+
}): Promise<Record<string, unknown>>;
|
|
345
|
+
/**
|
|
346
|
+
* Poll several batch ids in parallel against one shared deadline. Collect
|
|
347
|
+
* previously polled one lens at a time, so a slow first lens serialized the
|
|
348
|
+
* wall clock for lenses that had already finished server-side (#136). The
|
|
349
|
+
* onStatus callback identifies the lens so progress output stays readable
|
|
350
|
+
* even while the polls interleave.
|
|
351
|
+
*/
|
|
352
|
+
export declare function pollBatchesConcurrently(entries: Array<{
|
|
353
|
+
lensId: BroadsideLensId;
|
|
354
|
+
batchId: string;
|
|
355
|
+
}>, apiKey: string, opts?: {
|
|
356
|
+
deadlineMs?: number;
|
|
357
|
+
fetcher?: FetchLike;
|
|
358
|
+
pollIntervalMs?: number;
|
|
359
|
+
onStatus?: (lensId: string, status: string, counts: Record<string, unknown>) => void;
|
|
360
|
+
}): Promise<Map<string, Record<string, unknown>>>;
|
|
361
|
+
export declare function runBroadsideSubmit(cwd: string, apiKey: string, opts?: {
|
|
362
|
+
lenses?: BroadsideLensId[];
|
|
363
|
+
fetcher?: FetchLike;
|
|
364
|
+
model?: string;
|
|
365
|
+
/** Approximate run expense limit in USD; 0 means no limit. */
|
|
366
|
+
maxCost?: number;
|
|
367
|
+
/** Submit even when the estimate exceeds maxCost. */
|
|
368
|
+
force?: boolean;
|
|
369
|
+
/** Diff against the previous run's HEAD and scan only changed modules (#142). */
|
|
370
|
+
incremental?: boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Called with the pre-flight estimate after slicing and before any state
|
|
373
|
+
* write or submission. Returning false throws {@link BroadsideCancelledError}
|
|
374
|
+
* and nothing is submitted; returning true proceeds even past maxCost,
|
|
375
|
+
* because an interactive approval of a priced run *is* the force flag.
|
|
376
|
+
*
|
|
377
|
+
* A surface that cannot ask a human (MCP) omits this and keeps the
|
|
378
|
+
* refuse-unless-force behavior.
|
|
379
|
+
*/
|
|
380
|
+
confirm?: (estimate: BroadsideEstimate) => boolean | Promise<boolean>;
|
|
381
|
+
}): Promise<BroadsideSubmitResult>;
|
|
382
|
+
export type StoredLensResult = {
|
|
383
|
+
lensId: BroadsideLensId;
|
|
384
|
+
customId: string;
|
|
385
|
+
moduleName: string;
|
|
386
|
+
content: string;
|
|
387
|
+
raw: Record<string, unknown>;
|
|
388
|
+
/** True when the content is not parseable JSON even after fence stripping —
|
|
389
|
+
* the telltale of an output cut off at max_tokens. */
|
|
390
|
+
truncated: boolean;
|
|
391
|
+
};
|
|
392
|
+
/**
|
|
393
|
+
* Parse lens content as JSON, tolerating the markdown code fences some models
|
|
394
|
+
* wrap structured output in (the same tolerance OpenRouter's headless-agent
|
|
395
|
+
* scaffold ships for --output-schema). Returns null when the content is not
|
|
396
|
+
* JSON at all — which for a strict json_schema request means the output was
|
|
397
|
+
* truncated at max_tokens, not that the model chose prose.
|
|
398
|
+
*/
|
|
399
|
+
export declare function parseLensJson(content: string): unknown | null;
|
|
400
|
+
export declare function saveLensResults(runDir: string, lensId: BroadsideLensId, batch: Record<string, unknown>): Promise<StoredLensResult[]>;
|
|
401
|
+
export declare function runBroadsideCollect(cwd: string, apiKey: string, opts?: {
|
|
402
|
+
waitMs?: number;
|
|
403
|
+
includeSynthesis?: boolean;
|
|
404
|
+
includeTriage?: boolean;
|
|
405
|
+
/** Re-submit truncated slices once with a doubled output cap (#133). */
|
|
406
|
+
retryTruncated?: boolean;
|
|
407
|
+
onStatus?: (lensId: string, status: string, counts: Record<string, unknown>) => void;
|
|
408
|
+
fetcher?: FetchLike;
|
|
409
|
+
}): Promise<BroadsideCollectResult>;
|
|
410
|
+
export declare function runBroadsideStatus(cwd: string): Promise<{
|
|
411
|
+
state: BroadsideStateFile;
|
|
412
|
+
}>;
|
|
413
|
+
export declare function renderFindingsMarkdown(content: string): string;
|
|
414
|
+
export declare function estimateSubmitText(result: BroadsideSubmitResult, lenses: LensDefinition[]): string;
|
|
415
|
+
export declare function modelsText(entries: CatalogEntry[], opts: {
|
|
416
|
+
benchmarks: CodingBenchmarks | null;
|
|
417
|
+
defaultModel: string;
|
|
418
|
+
}): string;
|
|
419
|
+
export declare function collectResultText(result: BroadsideCollectResult): string;
|
|
420
|
+
export declare function statusText(state: BroadsideStateFile): string;
|
|
421
|
+
export {};
|