@sentry/warden 0.20.0 → 0.22.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/CHANGELOG.md +353 -0
- package/README.md +3 -3
- package/dist/cli/args.d.ts +7 -5
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +31 -17
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/commands/runs.d.ts +26 -0
- package/dist/cli/commands/runs.d.ts.map +1 -0
- package/dist/cli/commands/runs.js +726 -0
- package/dist/cli/commands/runs.js.map +1 -0
- package/dist/cli/log-cleanup.d.ts.map +1 -1
- package/dist/cli/log-cleanup.js +4 -0
- package/dist/cli/log-cleanup.js.map +1 -1
- package/dist/cli/main.d.ts +15 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +428 -128
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/output/index.d.ts +1 -1
- package/dist/cli/output/index.d.ts.map +1 -1
- package/dist/cli/output/index.js +1 -1
- package/dist/cli/output/index.js.map +1 -1
- package/dist/cli/output/ink-runner.d.ts.map +1 -1
- package/dist/cli/output/ink-runner.js +50 -14
- package/dist/cli/output/ink-runner.js.map +1 -1
- package/dist/cli/output/jsonl-schema-gen.d.ts +16 -0
- package/dist/cli/output/jsonl-schema-gen.d.ts.map +1 -0
- package/dist/cli/output/jsonl-schema-gen.js +65 -0
- package/dist/cli/output/jsonl-schema-gen.js.map +1 -0
- package/dist/cli/output/jsonl.d.ts +266 -26
- package/dist/cli/output/jsonl.d.ts.map +1 -1
- package/dist/cli/output/jsonl.js +377 -139
- package/dist/cli/output/jsonl.js.map +1 -1
- package/dist/cli/output/tasks.d.ts +6 -1
- package/dist/cli/output/tasks.d.ts.map +1 -1
- package/dist/cli/output/tasks.js +183 -27
- package/dist/cli/output/tasks.js.map +1 -1
- package/dist/cli/terminal.d.ts.map +1 -1
- package/dist/cli/terminal.js +20 -0
- package/dist/cli/terminal.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/sdk/analyze.d.ts.map +1 -1
- package/dist/sdk/analyze.js +103 -10
- package/dist/sdk/analyze.js.map +1 -1
- package/dist/sdk/errors.d.ts +11 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +50 -0
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/runner.d.ts +1 -1
- package/dist/sdk/runner.d.ts.map +1 -1
- package/dist/sdk/types.d.ts +28 -1
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +130 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +72 -3
- package/dist/types/index.js.map +1 -1
- package/package.json +2 -1
- package/skills/warden/SKILL.md +5 -5
- package/skills/warden/SOURCES.md +39 -0
- package/skills/warden/references/cli-reference.md +11 -4
- package/skills/warden/references/config-schema.md +9 -0
- package/skills/warden/references/configuration.md +9 -0
- package/skills/warden-sweep/SKILL.md +43 -365
- package/skills/warden-sweep/SOURCES.md +43 -0
- package/skills/warden-sweep/references/issue-phase.md +24 -0
- package/skills/warden-sweep/references/organize-phase.md +31 -0
- package/skills/warden-sweep/references/patch-phase.md +142 -0
- package/skills/warden-sweep/references/resume-and-artifacts.md +51 -0
- package/skills/warden-sweep/references/scan-phase.md +46 -0
- package/skills/warden-sweep/references/script-interfaces.md +127 -0
- package/skills/warden-sweep/references/verify-phase.md +69 -0
- package/dist/cli/commands/logs.d.ts +0 -19
- package/dist/cli/commands/logs.d.ts.map +0 -1
- package/dist/cli/commands/logs.js +0 -412
- package/dist/cli/commands/logs.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { SkillReport } from '../../types/index.js';
|
|
2
|
+
import type { SkillReport, SkillError } from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Sentinel value recorded in JSONL metadata when no model is explicitly configured.
|
|
5
5
|
*/
|
|
@@ -23,6 +23,16 @@ export declare function getRepoLogPath(repoRoot: string, runId: string, timestam
|
|
|
23
23
|
* Formal JSON Schema: specs/jsonl-schema.json
|
|
24
24
|
* Example payloads: specs/jsonl-examples.jsonl
|
|
25
25
|
* Reporter spec: specs/reporters.md Section 3 "JSONL Specification"
|
|
26
|
+
*
|
|
27
|
+
* BACKWARD COMPATIBILITY: breaking on-disk JSONL log formats is NEVER
|
|
28
|
+
* ALLOWED. Users keep .warden/logs/*.jsonl across versions. The schema
|
|
29
|
+
* may evolve — new optional fields, additive enum values, normalization
|
|
30
|
+
* — but every historical shape must continue to parse cleanly. Field
|
|
31
|
+
* renames require a preprocess that maps the old name to the new one
|
|
32
|
+
* (see FileReportSchema's `findingCount → findings` preprocess in
|
|
33
|
+
* src/types/index.ts). Removing a field is fine; making it optional in
|
|
34
|
+
* the schema preserves old logs. If you can't reconcile an old shape
|
|
35
|
+
* with a preprocess, the change is wrong — find a different path.
|
|
26
36
|
*/
|
|
27
37
|
/** Metadata common to every JSONL record. */
|
|
28
38
|
export declare const JsonlRunMetadataSchema: z.ZodObject<{
|
|
@@ -35,8 +45,8 @@ export declare const JsonlRunMetadataSchema: z.ZodObject<{
|
|
|
35
45
|
headSha: z.ZodOptional<z.ZodString>;
|
|
36
46
|
}, z.core.$strip>;
|
|
37
47
|
export type JsonlRunMetadata = z.infer<typeof JsonlRunMetadataSchema>;
|
|
38
|
-
/** Per-file breakdown within a skill record. */
|
|
39
|
-
export declare const JsonlFileRecordSchema: z.ZodObject<{
|
|
48
|
+
/** Per-file breakdown within a skill record (re-exported from shared types). */
|
|
49
|
+
export declare const JsonlFileRecordSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
40
50
|
filename: z.ZodString;
|
|
41
51
|
findings: z.ZodNumber;
|
|
42
52
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -47,10 +57,11 @@ export declare const JsonlFileRecordSchema: z.ZodObject<{
|
|
|
47
57
|
cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
48
58
|
costUSD: z.ZodNumber;
|
|
49
59
|
}, z.core.$strip>>;
|
|
50
|
-
}, z.core.$strip
|
|
60
|
+
}, z.core.$strip>>;
|
|
51
61
|
export type JsonlFileRecord = z.infer<typeof JsonlFileRecordSchema>;
|
|
52
|
-
/**
|
|
53
|
-
export declare const
|
|
62
|
+
/** Unit of work scanned by Warden. New run logs contain only this record type. */
|
|
63
|
+
export declare const JsonlChunkRecordSchema: z.ZodObject<{
|
|
64
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
54
65
|
run: z.ZodObject<{
|
|
55
66
|
timestamp: z.ZodString;
|
|
56
67
|
durationMs: z.ZodNumber;
|
|
@@ -60,6 +71,103 @@ export declare const JsonlRecordSchema: z.ZodObject<{
|
|
|
60
71
|
model: z.ZodOptional<z.ZodString>;
|
|
61
72
|
headSha: z.ZodOptional<z.ZodString>;
|
|
62
73
|
}, z.core.$strip>;
|
|
74
|
+
skill: z.ZodString;
|
|
75
|
+
model: z.ZodOptional<z.ZodString>;
|
|
76
|
+
chunk: z.ZodObject<{
|
|
77
|
+
file: z.ZodString;
|
|
78
|
+
index: z.ZodNumber;
|
|
79
|
+
total: z.ZodNumber;
|
|
80
|
+
lineRange: z.ZodString;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
status: z.ZodEnum<{
|
|
83
|
+
error: "error";
|
|
84
|
+
skipped: "skipped";
|
|
85
|
+
ok: "ok";
|
|
86
|
+
}>;
|
|
87
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
88
|
+
id: z.ZodString;
|
|
89
|
+
severity: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
|
|
90
|
+
high: "high";
|
|
91
|
+
low: "low";
|
|
92
|
+
medium: "medium";
|
|
93
|
+
}>>;
|
|
94
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
95
|
+
high: "high";
|
|
96
|
+
low: "low";
|
|
97
|
+
medium: "medium";
|
|
98
|
+
}>>;
|
|
99
|
+
title: z.ZodString;
|
|
100
|
+
description: z.ZodString;
|
|
101
|
+
verification: z.ZodOptional<z.ZodString>;
|
|
102
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
path: z.ZodString;
|
|
104
|
+
startLine: z.ZodNumber;
|
|
105
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
}, z.core.$strip>>;
|
|
107
|
+
additionalLocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
108
|
+
path: z.ZodString;
|
|
109
|
+
startLine: z.ZodNumber;
|
|
110
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
}, z.core.$strip>>>;
|
|
112
|
+
suggestedFix: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
description: z.ZodString;
|
|
114
|
+
diff: z.ZodString;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
elapsedMs: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
}, z.core.$strip>>;
|
|
118
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
inputTokens: z.ZodNumber;
|
|
120
|
+
outputTokens: z.ZodNumber;
|
|
121
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
costUSD: z.ZodNumber;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
durationMs: z.ZodNumber;
|
|
126
|
+
auxiliaryUsage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
127
|
+
inputTokens: z.ZodNumber;
|
|
128
|
+
outputTokens: z.ZodNumber;
|
|
129
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
costUSD: z.ZodNumber;
|
|
132
|
+
}, z.core.$strip>>>;
|
|
133
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
code: z.ZodEnum<{
|
|
135
|
+
unknown: "unknown";
|
|
136
|
+
auth_failed: "auth_failed";
|
|
137
|
+
sdk_error: "sdk_error";
|
|
138
|
+
subprocess_failure: "subprocess_failure";
|
|
139
|
+
max_turns: "max_turns";
|
|
140
|
+
aborted: "aborted";
|
|
141
|
+
all_hunks_failed: "all_hunks_failed";
|
|
142
|
+
skill_resolution_failed: "skill_resolution_failed";
|
|
143
|
+
extraction_invalid_json: "extraction_invalid_json";
|
|
144
|
+
extraction_unbalanced_json: "extraction_unbalanced_json";
|
|
145
|
+
extraction_no_findings_json: "extraction_no_findings_json";
|
|
146
|
+
extraction_missing_findings_key: "extraction_missing_findings_key";
|
|
147
|
+
extraction_findings_not_array: "extraction_findings_not_array";
|
|
148
|
+
extraction_llm_failed: "extraction_llm_failed";
|
|
149
|
+
extraction_llm_timeout: "extraction_llm_timeout";
|
|
150
|
+
extraction_no_api_key: "extraction_no_api_key";
|
|
151
|
+
}>;
|
|
152
|
+
message: z.ZodString;
|
|
153
|
+
timestamp: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, z.core.$strip>>;
|
|
155
|
+
skippedFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
156
|
+
filename: z.ZodString;
|
|
157
|
+
reason: z.ZodEnum<{
|
|
158
|
+
pattern: "pattern";
|
|
159
|
+
builtin: "builtin";
|
|
160
|
+
}>;
|
|
161
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, z.core.$strip>>>;
|
|
163
|
+
}, z.core.$strip>;
|
|
164
|
+
export type JsonlChunkRecord = z.infer<typeof JsonlChunkRecordSchema>;
|
|
165
|
+
/**
|
|
166
|
+
* One skill's analysis results. This is the shared SkillReport plus a `run`
|
|
167
|
+
* block of run-wide metadata, so any new SkillReport field is automatically
|
|
168
|
+
* part of the JSONL contract without a parallel schema.
|
|
169
|
+
*/
|
|
170
|
+
export declare const JsonlRecordSchema: z.ZodObject<{
|
|
63
171
|
skill: z.ZodString;
|
|
64
172
|
summary: z.ZodString;
|
|
65
173
|
findings: z.ZodArray<z.ZodObject<{
|
|
@@ -94,7 +202,6 @@ export declare const JsonlRecordSchema: z.ZodObject<{
|
|
|
94
202
|
elapsedMs: z.ZodOptional<z.ZodNumber>;
|
|
95
203
|
}, z.core.$strip>>;
|
|
96
204
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
97
|
-
model: z.ZodOptional<z.ZodString>;
|
|
98
205
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
99
206
|
usage: z.ZodOptional<z.ZodObject<{
|
|
100
207
|
inputTokens: z.ZodNumber;
|
|
@@ -103,6 +210,67 @@ export declare const JsonlRecordSchema: z.ZodObject<{
|
|
|
103
210
|
cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
104
211
|
costUSD: z.ZodNumber;
|
|
105
212
|
}, z.core.$strip>>;
|
|
213
|
+
skippedFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
214
|
+
filename: z.ZodString;
|
|
215
|
+
reason: z.ZodEnum<{
|
|
216
|
+
pattern: "pattern";
|
|
217
|
+
builtin: "builtin";
|
|
218
|
+
}>;
|
|
219
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strip>>>;
|
|
221
|
+
failedHunks: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
failedExtractions: z.ZodOptional<z.ZodNumber>;
|
|
223
|
+
hunkFailures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
224
|
+
type: z.ZodEnum<{
|
|
225
|
+
analysis: "analysis";
|
|
226
|
+
extraction: "extraction";
|
|
227
|
+
}>;
|
|
228
|
+
filename: z.ZodString;
|
|
229
|
+
lineRange: z.ZodString;
|
|
230
|
+
code: z.ZodEnum<{
|
|
231
|
+
unknown: "unknown";
|
|
232
|
+
auth_failed: "auth_failed";
|
|
233
|
+
sdk_error: "sdk_error";
|
|
234
|
+
subprocess_failure: "subprocess_failure";
|
|
235
|
+
max_turns: "max_turns";
|
|
236
|
+
aborted: "aborted";
|
|
237
|
+
all_hunks_failed: "all_hunks_failed";
|
|
238
|
+
skill_resolution_failed: "skill_resolution_failed";
|
|
239
|
+
extraction_invalid_json: "extraction_invalid_json";
|
|
240
|
+
extraction_unbalanced_json: "extraction_unbalanced_json";
|
|
241
|
+
extraction_no_findings_json: "extraction_no_findings_json";
|
|
242
|
+
extraction_missing_findings_key: "extraction_missing_findings_key";
|
|
243
|
+
extraction_findings_not_array: "extraction_findings_not_array";
|
|
244
|
+
extraction_llm_failed: "extraction_llm_failed";
|
|
245
|
+
extraction_llm_timeout: "extraction_llm_timeout";
|
|
246
|
+
extraction_no_api_key: "extraction_no_api_key";
|
|
247
|
+
}>;
|
|
248
|
+
message: z.ZodString;
|
|
249
|
+
preview: z.ZodOptional<z.ZodString>;
|
|
250
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
251
|
+
}, z.core.$strip>>>;
|
|
252
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
253
|
+
code: z.ZodEnum<{
|
|
254
|
+
unknown: "unknown";
|
|
255
|
+
auth_failed: "auth_failed";
|
|
256
|
+
sdk_error: "sdk_error";
|
|
257
|
+
subprocess_failure: "subprocess_failure";
|
|
258
|
+
max_turns: "max_turns";
|
|
259
|
+
aborted: "aborted";
|
|
260
|
+
all_hunks_failed: "all_hunks_failed";
|
|
261
|
+
skill_resolution_failed: "skill_resolution_failed";
|
|
262
|
+
extraction_invalid_json: "extraction_invalid_json";
|
|
263
|
+
extraction_unbalanced_json: "extraction_unbalanced_json";
|
|
264
|
+
extraction_no_findings_json: "extraction_no_findings_json";
|
|
265
|
+
extraction_missing_findings_key: "extraction_missing_findings_key";
|
|
266
|
+
extraction_findings_not_array: "extraction_findings_not_array";
|
|
267
|
+
extraction_llm_failed: "extraction_llm_failed";
|
|
268
|
+
extraction_llm_timeout: "extraction_llm_timeout";
|
|
269
|
+
extraction_no_api_key: "extraction_no_api_key";
|
|
270
|
+
}>;
|
|
271
|
+
message: z.ZodString;
|
|
272
|
+
timestamp: z.ZodOptional<z.ZodString>;
|
|
273
|
+
}, z.core.$strip>>;
|
|
106
274
|
auxiliaryUsage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
107
275
|
inputTokens: z.ZodNumber;
|
|
108
276
|
outputTokens: z.ZodNumber;
|
|
@@ -110,7 +278,7 @@ export declare const JsonlRecordSchema: z.ZodObject<{
|
|
|
110
278
|
cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
111
279
|
costUSD: z.ZodNumber;
|
|
112
280
|
}, z.core.$strip>>>;
|
|
113
|
-
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
281
|
+
files: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
114
282
|
filename: z.ZodString;
|
|
115
283
|
findings: z.ZodNumber;
|
|
116
284
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -121,17 +289,17 @@ export declare const JsonlRecordSchema: z.ZodObject<{
|
|
|
121
289
|
cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
122
290
|
costUSD: z.ZodNumber;
|
|
123
291
|
}, z.core.$strip>>;
|
|
124
|
-
}, z.core.$strip
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
292
|
+
}, z.core.$strip>>>>;
|
|
293
|
+
model: z.ZodOptional<z.ZodString>;
|
|
294
|
+
run: z.ZodObject<{
|
|
295
|
+
timestamp: z.ZodString;
|
|
296
|
+
durationMs: z.ZodNumber;
|
|
297
|
+
cwd: z.ZodString;
|
|
298
|
+
runId: z.ZodString;
|
|
299
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
300
|
+
model: z.ZodOptional<z.ZodString>;
|
|
301
|
+
headSha: z.ZodOptional<z.ZodString>;
|
|
302
|
+
}, z.core.$strip>;
|
|
135
303
|
}, z.core.$strip>;
|
|
136
304
|
export type JsonlRecord = z.infer<typeof JsonlRecordSchema>;
|
|
137
305
|
/** Aggregate summary across all skills (always the last JSONL line). */
|
|
@@ -147,7 +315,15 @@ export declare const JsonlSummaryRecordSchema: z.ZodObject<{
|
|
|
147
315
|
}, z.core.$strip>;
|
|
148
316
|
type: z.ZodLiteral<"summary">;
|
|
149
317
|
totalFindings: z.ZodNumber;
|
|
150
|
-
bySeverity: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodNumber>, z.ZodTransform<
|
|
318
|
+
bySeverity: z.ZodPipe<z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodNumber>, z.ZodTransform<{
|
|
319
|
+
high: number;
|
|
320
|
+
medium: number;
|
|
321
|
+
low: number;
|
|
322
|
+
}, Record<string, number>>>, z.ZodObject<{
|
|
323
|
+
high: z.ZodNumber;
|
|
324
|
+
medium: z.ZodNumber;
|
|
325
|
+
low: z.ZodNumber;
|
|
326
|
+
}, z.core.$strip>>;
|
|
151
327
|
usage: z.ZodOptional<z.ZodObject<{
|
|
152
328
|
inputTokens: z.ZodNumber;
|
|
153
329
|
outputTokens: z.ZodNumber;
|
|
@@ -163,6 +339,31 @@ export declare const JsonlSummaryRecordSchema: z.ZodObject<{
|
|
|
163
339
|
cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
164
340
|
costUSD: z.ZodNumber;
|
|
165
341
|
}, z.core.$strip>>>;
|
|
342
|
+
failedSkills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
343
|
+
totalFailedHunks: z.ZodOptional<z.ZodNumber>;
|
|
344
|
+
totalFailedExtractions: z.ZodOptional<z.ZodNumber>;
|
|
345
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
346
|
+
code: z.ZodEnum<{
|
|
347
|
+
unknown: "unknown";
|
|
348
|
+
auth_failed: "auth_failed";
|
|
349
|
+
sdk_error: "sdk_error";
|
|
350
|
+
subprocess_failure: "subprocess_failure";
|
|
351
|
+
max_turns: "max_turns";
|
|
352
|
+
aborted: "aborted";
|
|
353
|
+
all_hunks_failed: "all_hunks_failed";
|
|
354
|
+
skill_resolution_failed: "skill_resolution_failed";
|
|
355
|
+
extraction_invalid_json: "extraction_invalid_json";
|
|
356
|
+
extraction_unbalanced_json: "extraction_unbalanced_json";
|
|
357
|
+
extraction_no_findings_json: "extraction_no_findings_json";
|
|
358
|
+
extraction_missing_findings_key: "extraction_missing_findings_key";
|
|
359
|
+
extraction_findings_not_array: "extraction_findings_not_array";
|
|
360
|
+
extraction_llm_failed: "extraction_llm_failed";
|
|
361
|
+
extraction_llm_timeout: "extraction_llm_timeout";
|
|
362
|
+
extraction_no_api_key: "extraction_no_api_key";
|
|
363
|
+
}>;
|
|
364
|
+
message: z.ZodString;
|
|
365
|
+
timestamp: z.ZodOptional<z.ZodString>;
|
|
366
|
+
}, z.core.$strip>>;
|
|
166
367
|
}, z.core.$strip>;
|
|
167
368
|
export type JsonlSummaryRecord = z.infer<typeof JsonlSummaryRecordSchema>;
|
|
168
369
|
/** Per-evaluation detail for fix evaluation records. */
|
|
@@ -231,6 +432,38 @@ export declare const JsonlFixEvaluationRecordSchema: z.ZodObject<{
|
|
|
231
432
|
}, z.core.$strip>>>;
|
|
232
433
|
}, z.core.$strip>;
|
|
233
434
|
export type JsonlFixEvaluationRecord = z.infer<typeof JsonlFixEvaluationRecordSchema>;
|
|
435
|
+
/**
|
|
436
|
+
* Build a JSONL run metadata block. `durationMs` is a snapshot at write
|
|
437
|
+
* time for skill records, the run total on the trailing summary record.
|
|
438
|
+
*/
|
|
439
|
+
export declare function buildRunMetadata(options: {
|
|
440
|
+
runId: string;
|
|
441
|
+
durationMs: number;
|
|
442
|
+
timestamp?: Date;
|
|
443
|
+
traceId?: string;
|
|
444
|
+
model?: string;
|
|
445
|
+
headSha?: string;
|
|
446
|
+
cwd?: string;
|
|
447
|
+
}): JsonlRunMetadata;
|
|
448
|
+
/** Build a skill JSONL record, dropping zero-valued optional fields. */
|
|
449
|
+
export declare function buildSkillJsonlRecord(report: SkillReport, run: JsonlRunMetadata): JsonlRecord;
|
|
450
|
+
/** Build the aggregate summary JSONL record. */
|
|
451
|
+
export declare function buildSummaryJsonlRecord(reports: SkillReport[], run: JsonlRunMetadata, error?: SkillError): JsonlSummaryRecord;
|
|
452
|
+
/** Render a single skill JSONL record as one line including trailing newline. */
|
|
453
|
+
export declare function renderJsonlSkillLine(report: SkillReport, run: JsonlRunMetadata): string;
|
|
454
|
+
/** Render the summary JSONL record as one line including trailing newline. */
|
|
455
|
+
export declare function renderJsonlSummaryLine(reports: SkillReport[], run: JsonlRunMetadata, error?: SkillError): string;
|
|
456
|
+
/** Render one chunk result record as one JSONL line. */
|
|
457
|
+
export declare function renderJsonlChunkLine(record: JsonlChunkRecord): string;
|
|
458
|
+
export declare function renderJsonlChunkRecords(records: JsonlChunkRecord[]): string;
|
|
459
|
+
/** Create parent dirs and truncate the file to empty. */
|
|
460
|
+
export declare function initJsonlFile(outputPath: string): void;
|
|
461
|
+
/**
|
|
462
|
+
* Append a pre-rendered line (must include its trailing newline).
|
|
463
|
+
* This uses one synchronous append call so parallel skill callbacks in this
|
|
464
|
+
* process cannot interleave partial JSON records.
|
|
465
|
+
*/
|
|
466
|
+
export declare function appendJsonlLine(outputPath: string, line: string): void;
|
|
234
467
|
/**
|
|
235
468
|
* Render skill reports as a JSONL string.
|
|
236
469
|
* Each line contains one skill report with run metadata.
|
|
@@ -243,6 +476,8 @@ export declare function renderJsonlString(reports: SkillReport[], durationMs: nu
|
|
|
243
476
|
model?: string;
|
|
244
477
|
headSha?: string;
|
|
245
478
|
cwd?: string;
|
|
479
|
+
/** Top-level run error (e.g. auth failure) recorded on the summary record. */
|
|
480
|
+
error?: SkillError;
|
|
246
481
|
}): string;
|
|
247
482
|
/**
|
|
248
483
|
* Write skill reports to a JSONL file.
|
|
@@ -271,20 +506,25 @@ export interface ParsedJsonlLog {
|
|
|
271
506
|
}
|
|
272
507
|
export declare function parseJsonlReports(content: string): ParsedJsonlLog;
|
|
273
508
|
/**
|
|
274
|
-
* Lightweight metadata extracted from a JSONL log file.
|
|
275
|
-
*
|
|
509
|
+
* Lightweight metadata extracted from a JSONL log file. `summary` is
|
|
510
|
+
* parsed from legacy summary records or synthesized from chunk records;
|
|
511
|
+
* use `inProgress` to distinguish active runs from completed runs.
|
|
276
512
|
*/
|
|
277
513
|
export interface LogFileMetadata {
|
|
278
|
-
summary
|
|
514
|
+
summary?: JsonlSummaryRecord;
|
|
515
|
+
inProgress: boolean;
|
|
516
|
+
/** Run metadata pulled from the summary or, failing that, the first skill record. */
|
|
517
|
+
runMetadata?: JsonlRunMetadata;
|
|
279
518
|
skills: string[];
|
|
280
519
|
model?: string;
|
|
281
520
|
headSha?: string;
|
|
282
521
|
totalFiles: number;
|
|
283
522
|
}
|
|
284
523
|
/**
|
|
285
|
-
* Parse a JSONL log file
|
|
286
|
-
*
|
|
287
|
-
*
|
|
524
|
+
* Parse a JSONL log file's summary, skill names, and high-level metadata.
|
|
525
|
+
* Returns undefined when the file can't be read or contains no parseable
|
|
526
|
+
* records; in-progress files (valid records but no summary yet) return
|
|
527
|
+
* metadata with `inProgress: true`.
|
|
288
528
|
*/
|
|
289
529
|
export declare function parseLogMetadata(filePath: string): LogFileMetadata | undefined;
|
|
290
530
|
//# sourceMappingURL=jsonl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../../src/cli/output/jsonl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../../src/cli/output/jsonl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KA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