@bryan-thompson/inspector-assessment-client 1.32.2 → 1.32.3
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/lib/lib/assessment/configSchemas.d.ts +763 -0
- package/lib/lib/assessment/configSchemas.d.ts.map +1 -0
- package/lib/lib/assessment/configSchemas.js +187 -0
- package/lib/lib/assessment/coreTypes.d.ts +41 -0
- package/lib/lib/assessment/coreTypes.d.ts.map +1 -1
- package/lib/lib/assessment/jsonlEventSchemas.d.ts +1667 -0
- package/lib/lib/assessment/jsonlEventSchemas.d.ts.map +1 -0
- package/lib/lib/assessment/jsonlEventSchemas.js +437 -0
- package/lib/lib/assessment/progressTypes.d.ts +49 -1
- package/lib/lib/assessment/progressTypes.d.ts.map +1 -1
- package/lib/services/assessment/AssessmentOrchestrator.d.ts +3 -3
- package/lib/services/assessment/AssessmentOrchestrator.d.ts.map +1 -1
- package/lib/services/assessment/TestDataGenerator.d.ts +42 -8
- package/lib/services/assessment/TestDataGenerator.d.ts.map +1 -1
- package/lib/services/assessment/TestDataGenerator.js +23 -153
- package/lib/services/assessment/modules/CrossCapabilitySecurityAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/DeveloperExperienceAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/DocumentationAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ErrorHandlingAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ErrorHandlingAssessor.js +18 -1
- package/lib/services/assessment/modules/FunctionalityAssessor.d.ts +2 -2
- package/lib/services/assessment/modules/FunctionalityAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/FunctionalityAssessor.js +6 -3
- package/lib/services/assessment/modules/MCPSpecComplianceAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/PortabilityAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ProhibitedLibrariesAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ProtocolComplianceAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/securityTests/SecurityPayloadTester.d.ts.map +1 -1
- package/lib/services/assessment/modules/securityTests/SecurityPayloadTester.js +78 -2
- package/lib/services/assessment/testdata/index.d.ts +12 -0
- package/lib/services/assessment/testdata/index.d.ts.map +1 -0
- package/lib/services/assessment/testdata/index.js +11 -0
- package/lib/services/assessment/testdata/realistic-values.d.ts +126 -0
- package/lib/services/assessment/testdata/realistic-values.d.ts.map +1 -0
- package/lib/services/assessment/testdata/realistic-values.js +162 -0
- package/lib/services/assessment/testdata/tool-category-data.d.ts +28 -0
- package/lib/services/assessment/testdata/tool-category-data.d.ts.map +1 -0
- package/lib/services/assessment/testdata/tool-category-data.js +60 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1667 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod Schemas for JSONL Event Types
|
|
3
|
+
*
|
|
4
|
+
* Runtime validation schemas for all 13 JSONL event types emitted during
|
|
5
|
+
* CLI assessment runs. Enables type-safe parsing for external consumers.
|
|
6
|
+
*
|
|
7
|
+
* @module assessment/jsonlEventSchemas
|
|
8
|
+
* @see scripts/lib/jsonl-events.ts - TypeScript interface definitions
|
|
9
|
+
* @see docs/JSONL_EVENTS_REFERENCE.md - Event documentation
|
|
10
|
+
*/
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import { ZOD_SCHEMA_VERSION, TransportTypeSchema } from "../../lib/assessment/sharedSchemas.js";
|
|
13
|
+
export { ZOD_SCHEMA_VERSION, TransportTypeSchema };
|
|
14
|
+
/**
|
|
15
|
+
* Schema for module completion status.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ModuleStatusSchema: z.ZodEnum<["PASS", "FAIL", "NEED_MORE_INFO"]>;
|
|
18
|
+
export type ModuleStatus = z.infer<typeof ModuleStatusSchema>;
|
|
19
|
+
/**
|
|
20
|
+
* Schema for confidence level (lowercase).
|
|
21
|
+
*/
|
|
22
|
+
export declare const ConfidenceLevelSchema: z.ZodEnum<["high", "medium", "low"]>;
|
|
23
|
+
export type ConfidenceLevel = z.infer<typeof ConfidenceLevelSchema>;
|
|
24
|
+
/**
|
|
25
|
+
* Schema for risk level (uppercase).
|
|
26
|
+
*/
|
|
27
|
+
export declare const RiskLevelSchema: z.ZodEnum<["HIGH", "MEDIUM", "LOW"]>;
|
|
28
|
+
export type RiskLevel = z.infer<typeof RiskLevelSchema>;
|
|
29
|
+
/**
|
|
30
|
+
* Schema for AUP violation severity.
|
|
31
|
+
*/
|
|
32
|
+
export declare const SeveritySchema: z.ZodEnum<["CRITICAL", "HIGH", "MEDIUM"]>;
|
|
33
|
+
export type Severity = z.infer<typeof SeveritySchema>;
|
|
34
|
+
/**
|
|
35
|
+
* Schema for AUP violation location.
|
|
36
|
+
*/
|
|
37
|
+
export declare const LocationSchema: z.ZodEnum<["tool_name", "tool_description", "readme", "source_code"]>;
|
|
38
|
+
export type Location = z.infer<typeof LocationSchema>;
|
|
39
|
+
/**
|
|
40
|
+
* Schema for annotation field types.
|
|
41
|
+
*/
|
|
42
|
+
export declare const AnnotationFieldSchema: z.ZodEnum<["readOnlyHint", "destructiveHint"]>;
|
|
43
|
+
export type AnnotationField = z.infer<typeof AnnotationFieldSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* Schema for modules_configured reason.
|
|
46
|
+
*/
|
|
47
|
+
export declare const ModulesConfiguredReasonSchema: z.ZodEnum<["skip-modules", "only-modules", "default"]>;
|
|
48
|
+
export type ModulesConfiguredReason = z.infer<typeof ModulesConfiguredReasonSchema>;
|
|
49
|
+
/**
|
|
50
|
+
* Schema for tool parameter information.
|
|
51
|
+
*/
|
|
52
|
+
export declare const ToolParamSchema: z.ZodObject<{
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
type: z.ZodString;
|
|
55
|
+
required: z.ZodBoolean;
|
|
56
|
+
description: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
name?: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
type?: string;
|
|
61
|
+
required?: boolean;
|
|
62
|
+
}, {
|
|
63
|
+
name?: string;
|
|
64
|
+
description?: string;
|
|
65
|
+
type?: string;
|
|
66
|
+
required?: boolean;
|
|
67
|
+
}>;
|
|
68
|
+
export type ToolParam = z.infer<typeof ToolParamSchema>;
|
|
69
|
+
/**
|
|
70
|
+
* Schema for tool annotations object.
|
|
71
|
+
*/
|
|
72
|
+
export declare const ToolAnnotationsSchema: z.ZodNullable<z.ZodObject<{
|
|
73
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
readOnlyHint?: boolean;
|
|
79
|
+
destructiveHint?: boolean;
|
|
80
|
+
idempotentHint?: boolean;
|
|
81
|
+
openWorldHint?: boolean;
|
|
82
|
+
}, {
|
|
83
|
+
readOnlyHint?: boolean;
|
|
84
|
+
destructiveHint?: boolean;
|
|
85
|
+
idempotentHint?: boolean;
|
|
86
|
+
openWorldHint?: boolean;
|
|
87
|
+
}>>;
|
|
88
|
+
export type ToolAnnotations = z.infer<typeof ToolAnnotationsSchema>;
|
|
89
|
+
/**
|
|
90
|
+
* Schema for inferred behavior in annotation_missing events.
|
|
91
|
+
*/
|
|
92
|
+
export declare const InferredBehaviorSchema: z.ZodObject<{
|
|
93
|
+
expectedReadOnly: z.ZodBoolean;
|
|
94
|
+
expectedDestructive: z.ZodBoolean;
|
|
95
|
+
reason: z.ZodString;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
reason?: string;
|
|
98
|
+
expectedReadOnly?: boolean;
|
|
99
|
+
expectedDestructive?: boolean;
|
|
100
|
+
}, {
|
|
101
|
+
reason?: string;
|
|
102
|
+
expectedReadOnly?: boolean;
|
|
103
|
+
expectedDestructive?: boolean;
|
|
104
|
+
}>;
|
|
105
|
+
export type InferredBehavior = z.infer<typeof InferredBehaviorSchema>;
|
|
106
|
+
/**
|
|
107
|
+
* Schema for sampled AUP violation.
|
|
108
|
+
*/
|
|
109
|
+
export declare const AUPViolationSampleSchema: z.ZodObject<{
|
|
110
|
+
category: z.ZodString;
|
|
111
|
+
categoryName: z.ZodString;
|
|
112
|
+
severity: z.ZodEnum<["CRITICAL", "HIGH", "MEDIUM"]>;
|
|
113
|
+
matchedText: z.ZodString;
|
|
114
|
+
location: z.ZodEnum<["tool_name", "tool_description", "readme", "source_code"]>;
|
|
115
|
+
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
category?: string;
|
|
118
|
+
confidence?: "high" | "medium" | "low";
|
|
119
|
+
categoryName?: string;
|
|
120
|
+
location?: "tool_name" | "tool_description" | "readme" | "source_code";
|
|
121
|
+
severity?: "MEDIUM" | "HIGH" | "CRITICAL";
|
|
122
|
+
matchedText?: string;
|
|
123
|
+
}, {
|
|
124
|
+
category?: string;
|
|
125
|
+
confidence?: "high" | "medium" | "low";
|
|
126
|
+
categoryName?: string;
|
|
127
|
+
location?: "tool_name" | "tool_description" | "readme" | "source_code";
|
|
128
|
+
severity?: "MEDIUM" | "HIGH" | "CRITICAL";
|
|
129
|
+
matchedText?: string;
|
|
130
|
+
}>;
|
|
131
|
+
export type AUPViolationSample = z.infer<typeof AUPViolationSampleSchema>;
|
|
132
|
+
/**
|
|
133
|
+
* Schema for AUP violation metrics.
|
|
134
|
+
*/
|
|
135
|
+
export declare const AUPViolationMetricsSchema: z.ZodObject<{
|
|
136
|
+
total: z.ZodNumber;
|
|
137
|
+
critical: z.ZodNumber;
|
|
138
|
+
high: z.ZodNumber;
|
|
139
|
+
medium: z.ZodNumber;
|
|
140
|
+
byCategory: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
141
|
+
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
high?: number;
|
|
143
|
+
medium?: number;
|
|
144
|
+
critical?: number;
|
|
145
|
+
total?: number;
|
|
146
|
+
byCategory?: Record<string, number>;
|
|
147
|
+
}, {
|
|
148
|
+
high?: number;
|
|
149
|
+
medium?: number;
|
|
150
|
+
critical?: number;
|
|
151
|
+
total?: number;
|
|
152
|
+
byCategory?: Record<string, number>;
|
|
153
|
+
}>;
|
|
154
|
+
export type AUPViolationMetrics = z.infer<typeof AUPViolationMetricsSchema>;
|
|
155
|
+
/**
|
|
156
|
+
* Schema for AUP scanned locations.
|
|
157
|
+
*/
|
|
158
|
+
export declare const AUPScannedLocationsSchema: z.ZodObject<{
|
|
159
|
+
toolNames: z.ZodBoolean;
|
|
160
|
+
toolDescriptions: z.ZodBoolean;
|
|
161
|
+
readme: z.ZodBoolean;
|
|
162
|
+
sourceCode: z.ZodBoolean;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
readme?: boolean;
|
|
165
|
+
toolNames?: boolean;
|
|
166
|
+
toolDescriptions?: boolean;
|
|
167
|
+
sourceCode?: boolean;
|
|
168
|
+
}, {
|
|
169
|
+
readme?: boolean;
|
|
170
|
+
toolNames?: boolean;
|
|
171
|
+
toolDescriptions?: boolean;
|
|
172
|
+
sourceCode?: boolean;
|
|
173
|
+
}>;
|
|
174
|
+
export type AUPScannedLocations = z.infer<typeof AUPScannedLocationsSchema>;
|
|
175
|
+
/**
|
|
176
|
+
* Base schema for all JSONL events.
|
|
177
|
+
* All events include version (software version) and schemaVersion (event schema version).
|
|
178
|
+
*/
|
|
179
|
+
export declare const BaseEventSchema: z.ZodObject<{
|
|
180
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
181
|
+
version: z.ZodString;
|
|
182
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
183
|
+
schemaVersion: z.ZodNumber;
|
|
184
|
+
}, "strip", z.ZodTypeAny, {
|
|
185
|
+
version?: string;
|
|
186
|
+
schemaVersion?: number;
|
|
187
|
+
}, {
|
|
188
|
+
version?: string;
|
|
189
|
+
schemaVersion?: number;
|
|
190
|
+
}>;
|
|
191
|
+
export type BaseEvent = z.infer<typeof BaseEventSchema>;
|
|
192
|
+
/**
|
|
193
|
+
* 1. ServerConnectedEvent - Emitted after successful MCP connection.
|
|
194
|
+
*/
|
|
195
|
+
export declare const ServerConnectedEventSchema: z.ZodObject<{
|
|
196
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
197
|
+
version: z.ZodString;
|
|
198
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
199
|
+
schemaVersion: z.ZodNumber;
|
|
200
|
+
} & {
|
|
201
|
+
event: z.ZodLiteral<"server_connected">;
|
|
202
|
+
serverName: z.ZodString;
|
|
203
|
+
transport: z.ZodEnum<["stdio", "http", "sse"]>;
|
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
|
205
|
+
version?: string;
|
|
206
|
+
event?: "server_connected";
|
|
207
|
+
schemaVersion?: number;
|
|
208
|
+
serverName?: string;
|
|
209
|
+
transport?: "http" | "sse" | "stdio";
|
|
210
|
+
}, {
|
|
211
|
+
version?: string;
|
|
212
|
+
event?: "server_connected";
|
|
213
|
+
schemaVersion?: number;
|
|
214
|
+
serverName?: string;
|
|
215
|
+
transport?: "http" | "sse" | "stdio";
|
|
216
|
+
}>;
|
|
217
|
+
export type ServerConnectedEvent = z.infer<typeof ServerConnectedEventSchema>;
|
|
218
|
+
/**
|
|
219
|
+
* 2. ToolDiscoveredEvent - Emitted for each tool found.
|
|
220
|
+
*/
|
|
221
|
+
export declare const ToolDiscoveredEventSchema: z.ZodObject<{
|
|
222
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
223
|
+
version: z.ZodString;
|
|
224
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
225
|
+
schemaVersion: z.ZodNumber;
|
|
226
|
+
} & {
|
|
227
|
+
event: z.ZodLiteral<"tool_discovered">;
|
|
228
|
+
name: z.ZodString;
|
|
229
|
+
description: z.ZodNullable<z.ZodString>;
|
|
230
|
+
params: z.ZodArray<z.ZodObject<{
|
|
231
|
+
name: z.ZodString;
|
|
232
|
+
type: z.ZodString;
|
|
233
|
+
required: z.ZodBoolean;
|
|
234
|
+
description: z.ZodOptional<z.ZodString>;
|
|
235
|
+
}, "strip", z.ZodTypeAny, {
|
|
236
|
+
name?: string;
|
|
237
|
+
description?: string;
|
|
238
|
+
type?: string;
|
|
239
|
+
required?: boolean;
|
|
240
|
+
}, {
|
|
241
|
+
name?: string;
|
|
242
|
+
description?: string;
|
|
243
|
+
type?: string;
|
|
244
|
+
required?: boolean;
|
|
245
|
+
}>, "many">;
|
|
246
|
+
annotations: z.ZodNullable<z.ZodObject<{
|
|
247
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
248
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
249
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
250
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
251
|
+
}, "strip", z.ZodTypeAny, {
|
|
252
|
+
readOnlyHint?: boolean;
|
|
253
|
+
destructiveHint?: boolean;
|
|
254
|
+
idempotentHint?: boolean;
|
|
255
|
+
openWorldHint?: boolean;
|
|
256
|
+
}, {
|
|
257
|
+
readOnlyHint?: boolean;
|
|
258
|
+
destructiveHint?: boolean;
|
|
259
|
+
idempotentHint?: boolean;
|
|
260
|
+
openWorldHint?: boolean;
|
|
261
|
+
}>>;
|
|
262
|
+
}, "strip", z.ZodTypeAny, {
|
|
263
|
+
name?: string;
|
|
264
|
+
version?: string;
|
|
265
|
+
description?: string;
|
|
266
|
+
annotations?: {
|
|
267
|
+
readOnlyHint?: boolean;
|
|
268
|
+
destructiveHint?: boolean;
|
|
269
|
+
idempotentHint?: boolean;
|
|
270
|
+
openWorldHint?: boolean;
|
|
271
|
+
};
|
|
272
|
+
event?: "tool_discovered";
|
|
273
|
+
schemaVersion?: number;
|
|
274
|
+
params?: {
|
|
275
|
+
name?: string;
|
|
276
|
+
description?: string;
|
|
277
|
+
type?: string;
|
|
278
|
+
required?: boolean;
|
|
279
|
+
}[];
|
|
280
|
+
}, {
|
|
281
|
+
name?: string;
|
|
282
|
+
version?: string;
|
|
283
|
+
description?: string;
|
|
284
|
+
annotations?: {
|
|
285
|
+
readOnlyHint?: boolean;
|
|
286
|
+
destructiveHint?: boolean;
|
|
287
|
+
idempotentHint?: boolean;
|
|
288
|
+
openWorldHint?: boolean;
|
|
289
|
+
};
|
|
290
|
+
event?: "tool_discovered";
|
|
291
|
+
schemaVersion?: number;
|
|
292
|
+
params?: {
|
|
293
|
+
name?: string;
|
|
294
|
+
description?: string;
|
|
295
|
+
type?: string;
|
|
296
|
+
required?: boolean;
|
|
297
|
+
}[];
|
|
298
|
+
}>;
|
|
299
|
+
export type ToolDiscoveredEvent = z.infer<typeof ToolDiscoveredEventSchema>;
|
|
300
|
+
/**
|
|
301
|
+
* 3. ToolsDiscoveryCompleteEvent - Emitted after all tools listed.
|
|
302
|
+
*/
|
|
303
|
+
export declare const ToolsDiscoveryCompleteEventSchema: z.ZodObject<{
|
|
304
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
305
|
+
version: z.ZodString;
|
|
306
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
307
|
+
schemaVersion: z.ZodNumber;
|
|
308
|
+
} & {
|
|
309
|
+
event: z.ZodLiteral<"tools_discovery_complete">;
|
|
310
|
+
count: z.ZodNumber;
|
|
311
|
+
}, "strip", z.ZodTypeAny, {
|
|
312
|
+
version?: string;
|
|
313
|
+
count?: number;
|
|
314
|
+
event?: "tools_discovery_complete";
|
|
315
|
+
schemaVersion?: number;
|
|
316
|
+
}, {
|
|
317
|
+
version?: string;
|
|
318
|
+
count?: number;
|
|
319
|
+
event?: "tools_discovery_complete";
|
|
320
|
+
schemaVersion?: number;
|
|
321
|
+
}>;
|
|
322
|
+
export type ToolsDiscoveryCompleteEvent = z.infer<typeof ToolsDiscoveryCompleteEventSchema>;
|
|
323
|
+
/**
|
|
324
|
+
* 4. ModulesConfiguredEvent - Emitted when --skip-modules or --only-modules used.
|
|
325
|
+
*/
|
|
326
|
+
export declare const ModulesConfiguredEventSchema: z.ZodObject<{
|
|
327
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
328
|
+
version: z.ZodString;
|
|
329
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
330
|
+
schemaVersion: z.ZodNumber;
|
|
331
|
+
} & {
|
|
332
|
+
event: z.ZodLiteral<"modules_configured">;
|
|
333
|
+
enabled: z.ZodArray<z.ZodString, "many">;
|
|
334
|
+
skipped: z.ZodArray<z.ZodString, "many">;
|
|
335
|
+
reason: z.ZodEnum<["skip-modules", "only-modules", "default"]>;
|
|
336
|
+
}, "strip", z.ZodTypeAny, {
|
|
337
|
+
version?: string;
|
|
338
|
+
enabled?: string[];
|
|
339
|
+
event?: "modules_configured";
|
|
340
|
+
schemaVersion?: number;
|
|
341
|
+
reason?: "default" | "skip-modules" | "only-modules";
|
|
342
|
+
skipped?: string[];
|
|
343
|
+
}, {
|
|
344
|
+
version?: string;
|
|
345
|
+
enabled?: string[];
|
|
346
|
+
event?: "modules_configured";
|
|
347
|
+
schemaVersion?: number;
|
|
348
|
+
reason?: "default" | "skip-modules" | "only-modules";
|
|
349
|
+
skipped?: string[];
|
|
350
|
+
}>;
|
|
351
|
+
export type ModulesConfiguredEvent = z.infer<typeof ModulesConfiguredEventSchema>;
|
|
352
|
+
/**
|
|
353
|
+
* 5. ModuleStartedEvent - Emitted when a module begins execution.
|
|
354
|
+
*/
|
|
355
|
+
export declare const ModuleStartedEventSchema: z.ZodObject<{
|
|
356
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
357
|
+
version: z.ZodString;
|
|
358
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
359
|
+
schemaVersion: z.ZodNumber;
|
|
360
|
+
} & {
|
|
361
|
+
event: z.ZodLiteral<"module_started">;
|
|
362
|
+
module: z.ZodString;
|
|
363
|
+
estimatedTests: z.ZodNumber;
|
|
364
|
+
toolCount: z.ZodNumber;
|
|
365
|
+
}, "strip", z.ZodTypeAny, {
|
|
366
|
+
version?: string;
|
|
367
|
+
module?: string;
|
|
368
|
+
event?: "module_started";
|
|
369
|
+
schemaVersion?: number;
|
|
370
|
+
estimatedTests?: number;
|
|
371
|
+
toolCount?: number;
|
|
372
|
+
}, {
|
|
373
|
+
version?: string;
|
|
374
|
+
module?: string;
|
|
375
|
+
event?: "module_started";
|
|
376
|
+
schemaVersion?: number;
|
|
377
|
+
estimatedTests?: number;
|
|
378
|
+
toolCount?: number;
|
|
379
|
+
}>;
|
|
380
|
+
export type ModuleStartedEvent = z.infer<typeof ModuleStartedEventSchema>;
|
|
381
|
+
/**
|
|
382
|
+
* 6. TestBatchEvent - Emitted during test execution with progress.
|
|
383
|
+
*/
|
|
384
|
+
export declare const TestBatchEventSchema: z.ZodObject<{
|
|
385
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
386
|
+
version: z.ZodString;
|
|
387
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
388
|
+
schemaVersion: z.ZodNumber;
|
|
389
|
+
} & {
|
|
390
|
+
event: z.ZodLiteral<"test_batch">;
|
|
391
|
+
module: z.ZodString;
|
|
392
|
+
completed: z.ZodNumber;
|
|
393
|
+
total: z.ZodNumber;
|
|
394
|
+
batchSize: z.ZodNumber;
|
|
395
|
+
elapsed: z.ZodNumber;
|
|
396
|
+
}, "strip", z.ZodTypeAny, {
|
|
397
|
+
version?: string;
|
|
398
|
+
completed?: number;
|
|
399
|
+
module?: string;
|
|
400
|
+
event?: "test_batch";
|
|
401
|
+
schemaVersion?: number;
|
|
402
|
+
total?: number;
|
|
403
|
+
batchSize?: number;
|
|
404
|
+
elapsed?: number;
|
|
405
|
+
}, {
|
|
406
|
+
version?: string;
|
|
407
|
+
completed?: number;
|
|
408
|
+
module?: string;
|
|
409
|
+
event?: "test_batch";
|
|
410
|
+
schemaVersion?: number;
|
|
411
|
+
total?: number;
|
|
412
|
+
batchSize?: number;
|
|
413
|
+
elapsed?: number;
|
|
414
|
+
}>;
|
|
415
|
+
export type TestBatchEvent = z.infer<typeof TestBatchEventSchema>;
|
|
416
|
+
/**
|
|
417
|
+
* 7. ModuleCompleteEvent - Emitted after module finishes with summary.
|
|
418
|
+
* Includes optional AUP enrichment when module=aup.
|
|
419
|
+
*/
|
|
420
|
+
export declare const ModuleCompleteEventSchema: z.ZodObject<{
|
|
421
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
422
|
+
version: z.ZodString;
|
|
423
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
424
|
+
schemaVersion: z.ZodNumber;
|
|
425
|
+
} & {
|
|
426
|
+
event: z.ZodLiteral<"module_complete">;
|
|
427
|
+
module: z.ZodString;
|
|
428
|
+
status: z.ZodEnum<["PASS", "FAIL", "NEED_MORE_INFO"]>;
|
|
429
|
+
score: z.ZodNumber;
|
|
430
|
+
testsRun: z.ZodNumber;
|
|
431
|
+
duration: z.ZodNumber;
|
|
432
|
+
violationsSample: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
433
|
+
category: z.ZodString;
|
|
434
|
+
categoryName: z.ZodString;
|
|
435
|
+
severity: z.ZodEnum<["CRITICAL", "HIGH", "MEDIUM"]>;
|
|
436
|
+
matchedText: z.ZodString;
|
|
437
|
+
location: z.ZodEnum<["tool_name", "tool_description", "readme", "source_code"]>;
|
|
438
|
+
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
439
|
+
}, "strip", z.ZodTypeAny, {
|
|
440
|
+
category?: string;
|
|
441
|
+
confidence?: "high" | "medium" | "low";
|
|
442
|
+
categoryName?: string;
|
|
443
|
+
location?: "tool_name" | "tool_description" | "readme" | "source_code";
|
|
444
|
+
severity?: "MEDIUM" | "HIGH" | "CRITICAL";
|
|
445
|
+
matchedText?: string;
|
|
446
|
+
}, {
|
|
447
|
+
category?: string;
|
|
448
|
+
confidence?: "high" | "medium" | "low";
|
|
449
|
+
categoryName?: string;
|
|
450
|
+
location?: "tool_name" | "tool_description" | "readme" | "source_code";
|
|
451
|
+
severity?: "MEDIUM" | "HIGH" | "CRITICAL";
|
|
452
|
+
matchedText?: string;
|
|
453
|
+
}>, "many">>;
|
|
454
|
+
samplingNote: z.ZodOptional<z.ZodString>;
|
|
455
|
+
violationMetrics: z.ZodOptional<z.ZodObject<{
|
|
456
|
+
total: z.ZodNumber;
|
|
457
|
+
critical: z.ZodNumber;
|
|
458
|
+
high: z.ZodNumber;
|
|
459
|
+
medium: z.ZodNumber;
|
|
460
|
+
byCategory: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
461
|
+
}, "strip", z.ZodTypeAny, {
|
|
462
|
+
high?: number;
|
|
463
|
+
medium?: number;
|
|
464
|
+
critical?: number;
|
|
465
|
+
total?: number;
|
|
466
|
+
byCategory?: Record<string, number>;
|
|
467
|
+
}, {
|
|
468
|
+
high?: number;
|
|
469
|
+
medium?: number;
|
|
470
|
+
critical?: number;
|
|
471
|
+
total?: number;
|
|
472
|
+
byCategory?: Record<string, number>;
|
|
473
|
+
}>>;
|
|
474
|
+
scannedLocations: z.ZodOptional<z.ZodObject<{
|
|
475
|
+
toolNames: z.ZodBoolean;
|
|
476
|
+
toolDescriptions: z.ZodBoolean;
|
|
477
|
+
readme: z.ZodBoolean;
|
|
478
|
+
sourceCode: z.ZodBoolean;
|
|
479
|
+
}, "strip", z.ZodTypeAny, {
|
|
480
|
+
readme?: boolean;
|
|
481
|
+
toolNames?: boolean;
|
|
482
|
+
toolDescriptions?: boolean;
|
|
483
|
+
sourceCode?: boolean;
|
|
484
|
+
}, {
|
|
485
|
+
readme?: boolean;
|
|
486
|
+
toolNames?: boolean;
|
|
487
|
+
toolDescriptions?: boolean;
|
|
488
|
+
sourceCode?: boolean;
|
|
489
|
+
}>>;
|
|
490
|
+
highRiskDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
491
|
+
}, "strip", z.ZodTypeAny, {
|
|
492
|
+
version?: string;
|
|
493
|
+
status?: "PASS" | "FAIL" | "NEED_MORE_INFO";
|
|
494
|
+
module?: string;
|
|
495
|
+
score?: number;
|
|
496
|
+
event?: "module_complete";
|
|
497
|
+
testsRun?: number;
|
|
498
|
+
duration?: number;
|
|
499
|
+
schemaVersion?: number;
|
|
500
|
+
scannedLocations?: {
|
|
501
|
+
readme?: boolean;
|
|
502
|
+
toolNames?: boolean;
|
|
503
|
+
toolDescriptions?: boolean;
|
|
504
|
+
sourceCode?: boolean;
|
|
505
|
+
};
|
|
506
|
+
highRiskDomains?: string[];
|
|
507
|
+
violationsSample?: {
|
|
508
|
+
category?: string;
|
|
509
|
+
confidence?: "high" | "medium" | "low";
|
|
510
|
+
categoryName?: string;
|
|
511
|
+
location?: "tool_name" | "tool_description" | "readme" | "source_code";
|
|
512
|
+
severity?: "MEDIUM" | "HIGH" | "CRITICAL";
|
|
513
|
+
matchedText?: string;
|
|
514
|
+
}[];
|
|
515
|
+
samplingNote?: string;
|
|
516
|
+
violationMetrics?: {
|
|
517
|
+
high?: number;
|
|
518
|
+
medium?: number;
|
|
519
|
+
critical?: number;
|
|
520
|
+
total?: number;
|
|
521
|
+
byCategory?: Record<string, number>;
|
|
522
|
+
};
|
|
523
|
+
}, {
|
|
524
|
+
version?: string;
|
|
525
|
+
status?: "PASS" | "FAIL" | "NEED_MORE_INFO";
|
|
526
|
+
module?: string;
|
|
527
|
+
score?: number;
|
|
528
|
+
event?: "module_complete";
|
|
529
|
+
testsRun?: number;
|
|
530
|
+
duration?: number;
|
|
531
|
+
schemaVersion?: number;
|
|
532
|
+
scannedLocations?: {
|
|
533
|
+
readme?: boolean;
|
|
534
|
+
toolNames?: boolean;
|
|
535
|
+
toolDescriptions?: boolean;
|
|
536
|
+
sourceCode?: boolean;
|
|
537
|
+
};
|
|
538
|
+
highRiskDomains?: string[];
|
|
539
|
+
violationsSample?: {
|
|
540
|
+
category?: string;
|
|
541
|
+
confidence?: "high" | "medium" | "low";
|
|
542
|
+
categoryName?: string;
|
|
543
|
+
location?: "tool_name" | "tool_description" | "readme" | "source_code";
|
|
544
|
+
severity?: "MEDIUM" | "HIGH" | "CRITICAL";
|
|
545
|
+
matchedText?: string;
|
|
546
|
+
}[];
|
|
547
|
+
samplingNote?: string;
|
|
548
|
+
violationMetrics?: {
|
|
549
|
+
high?: number;
|
|
550
|
+
medium?: number;
|
|
551
|
+
critical?: number;
|
|
552
|
+
total?: number;
|
|
553
|
+
byCategory?: Record<string, number>;
|
|
554
|
+
};
|
|
555
|
+
}>;
|
|
556
|
+
export type ModuleCompleteEvent = z.infer<typeof ModuleCompleteEventSchema>;
|
|
557
|
+
/**
|
|
558
|
+
* 8. VulnerabilityFoundEvent - Emitted when security vulnerability detected.
|
|
559
|
+
*/
|
|
560
|
+
export declare const VulnerabilityFoundEventSchema: z.ZodObject<{
|
|
561
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
562
|
+
version: z.ZodString;
|
|
563
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
564
|
+
schemaVersion: z.ZodNumber;
|
|
565
|
+
} & {
|
|
566
|
+
event: z.ZodLiteral<"vulnerability_found">;
|
|
567
|
+
tool: z.ZodString;
|
|
568
|
+
pattern: z.ZodString;
|
|
569
|
+
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
570
|
+
evidence: z.ZodString;
|
|
571
|
+
riskLevel: z.ZodEnum<["HIGH", "MEDIUM", "LOW"]>;
|
|
572
|
+
requiresReview: z.ZodBoolean;
|
|
573
|
+
payload: z.ZodOptional<z.ZodString>;
|
|
574
|
+
}, "strip", z.ZodTypeAny, {
|
|
575
|
+
version?: string;
|
|
576
|
+
evidence?: string;
|
|
577
|
+
payload?: string;
|
|
578
|
+
riskLevel?: "LOW" | "MEDIUM" | "HIGH";
|
|
579
|
+
confidence?: "high" | "medium" | "low";
|
|
580
|
+
pattern?: string;
|
|
581
|
+
event?: "vulnerability_found";
|
|
582
|
+
schemaVersion?: number;
|
|
583
|
+
tool?: string;
|
|
584
|
+
requiresReview?: boolean;
|
|
585
|
+
}, {
|
|
586
|
+
version?: string;
|
|
587
|
+
evidence?: string;
|
|
588
|
+
payload?: string;
|
|
589
|
+
riskLevel?: "LOW" | "MEDIUM" | "HIGH";
|
|
590
|
+
confidence?: "high" | "medium" | "low";
|
|
591
|
+
pattern?: string;
|
|
592
|
+
event?: "vulnerability_found";
|
|
593
|
+
schemaVersion?: number;
|
|
594
|
+
tool?: string;
|
|
595
|
+
requiresReview?: boolean;
|
|
596
|
+
}>;
|
|
597
|
+
export type VulnerabilityFoundEvent = z.infer<typeof VulnerabilityFoundEventSchema>;
|
|
598
|
+
/**
|
|
599
|
+
* 9. AnnotationMissingEvent - Emitted when tool lacks annotations.
|
|
600
|
+
*/
|
|
601
|
+
export declare const AnnotationMissingEventSchema: z.ZodObject<{
|
|
602
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
603
|
+
version: z.ZodString;
|
|
604
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
605
|
+
schemaVersion: z.ZodNumber;
|
|
606
|
+
} & {
|
|
607
|
+
event: z.ZodLiteral<"annotation_missing">;
|
|
608
|
+
tool: z.ZodString;
|
|
609
|
+
title: z.ZodOptional<z.ZodString>;
|
|
610
|
+
description: z.ZodOptional<z.ZodString>;
|
|
611
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
612
|
+
name: z.ZodString;
|
|
613
|
+
type: z.ZodString;
|
|
614
|
+
required: z.ZodBoolean;
|
|
615
|
+
description: z.ZodOptional<z.ZodString>;
|
|
616
|
+
}, "strip", z.ZodTypeAny, {
|
|
617
|
+
name?: string;
|
|
618
|
+
description?: string;
|
|
619
|
+
type?: string;
|
|
620
|
+
required?: boolean;
|
|
621
|
+
}, {
|
|
622
|
+
name?: string;
|
|
623
|
+
description?: string;
|
|
624
|
+
type?: string;
|
|
625
|
+
required?: boolean;
|
|
626
|
+
}>, "many">;
|
|
627
|
+
inferredBehavior: z.ZodObject<{
|
|
628
|
+
expectedReadOnly: z.ZodBoolean;
|
|
629
|
+
expectedDestructive: z.ZodBoolean;
|
|
630
|
+
reason: z.ZodString;
|
|
631
|
+
}, "strip", z.ZodTypeAny, {
|
|
632
|
+
reason?: string;
|
|
633
|
+
expectedReadOnly?: boolean;
|
|
634
|
+
expectedDestructive?: boolean;
|
|
635
|
+
}, {
|
|
636
|
+
reason?: string;
|
|
637
|
+
expectedReadOnly?: boolean;
|
|
638
|
+
expectedDestructive?: boolean;
|
|
639
|
+
}>;
|
|
640
|
+
}, "strip", z.ZodTypeAny, {
|
|
641
|
+
version?: string;
|
|
642
|
+
description?: string;
|
|
643
|
+
title?: string;
|
|
644
|
+
event?: "annotation_missing";
|
|
645
|
+
schemaVersion?: number;
|
|
646
|
+
tool?: string;
|
|
647
|
+
parameters?: {
|
|
648
|
+
name?: string;
|
|
649
|
+
description?: string;
|
|
650
|
+
type?: string;
|
|
651
|
+
required?: boolean;
|
|
652
|
+
}[];
|
|
653
|
+
inferredBehavior?: {
|
|
654
|
+
reason?: string;
|
|
655
|
+
expectedReadOnly?: boolean;
|
|
656
|
+
expectedDestructive?: boolean;
|
|
657
|
+
};
|
|
658
|
+
}, {
|
|
659
|
+
version?: string;
|
|
660
|
+
description?: string;
|
|
661
|
+
title?: string;
|
|
662
|
+
event?: "annotation_missing";
|
|
663
|
+
schemaVersion?: number;
|
|
664
|
+
tool?: string;
|
|
665
|
+
parameters?: {
|
|
666
|
+
name?: string;
|
|
667
|
+
description?: string;
|
|
668
|
+
type?: string;
|
|
669
|
+
required?: boolean;
|
|
670
|
+
}[];
|
|
671
|
+
inferredBehavior?: {
|
|
672
|
+
reason?: string;
|
|
673
|
+
expectedReadOnly?: boolean;
|
|
674
|
+
expectedDestructive?: boolean;
|
|
675
|
+
};
|
|
676
|
+
}>;
|
|
677
|
+
export type AnnotationMissingEvent = z.infer<typeof AnnotationMissingEventSchema>;
|
|
678
|
+
/**
|
|
679
|
+
* 10. AnnotationMisalignedEvent - Emitted when annotation doesn't match behavior.
|
|
680
|
+
*/
|
|
681
|
+
export declare const AnnotationMisalignedEventSchema: z.ZodObject<{
|
|
682
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
683
|
+
version: z.ZodString;
|
|
684
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
685
|
+
schemaVersion: z.ZodNumber;
|
|
686
|
+
} & {
|
|
687
|
+
event: z.ZodLiteral<"annotation_misaligned">;
|
|
688
|
+
tool: z.ZodString;
|
|
689
|
+
title: z.ZodOptional<z.ZodString>;
|
|
690
|
+
description: z.ZodOptional<z.ZodString>;
|
|
691
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
692
|
+
name: z.ZodString;
|
|
693
|
+
type: z.ZodString;
|
|
694
|
+
required: z.ZodBoolean;
|
|
695
|
+
description: z.ZodOptional<z.ZodString>;
|
|
696
|
+
}, "strip", z.ZodTypeAny, {
|
|
697
|
+
name?: string;
|
|
698
|
+
description?: string;
|
|
699
|
+
type?: string;
|
|
700
|
+
required?: boolean;
|
|
701
|
+
}, {
|
|
702
|
+
name?: string;
|
|
703
|
+
description?: string;
|
|
704
|
+
type?: string;
|
|
705
|
+
required?: boolean;
|
|
706
|
+
}>, "many">;
|
|
707
|
+
field: z.ZodEnum<["readOnlyHint", "destructiveHint"]>;
|
|
708
|
+
actual: z.ZodOptional<z.ZodBoolean>;
|
|
709
|
+
expected: z.ZodBoolean;
|
|
710
|
+
confidence: z.ZodNumber;
|
|
711
|
+
reason: z.ZodString;
|
|
712
|
+
}, "strip", z.ZodTypeAny, {
|
|
713
|
+
version?: string;
|
|
714
|
+
description?: string;
|
|
715
|
+
confidence?: number;
|
|
716
|
+
title?: string;
|
|
717
|
+
event?: "annotation_misaligned";
|
|
718
|
+
schemaVersion?: number;
|
|
719
|
+
expected?: boolean;
|
|
720
|
+
reason?: string;
|
|
721
|
+
tool?: string;
|
|
722
|
+
parameters?: {
|
|
723
|
+
name?: string;
|
|
724
|
+
description?: string;
|
|
725
|
+
type?: string;
|
|
726
|
+
required?: boolean;
|
|
727
|
+
}[];
|
|
728
|
+
field?: "readOnlyHint" | "destructiveHint";
|
|
729
|
+
actual?: boolean;
|
|
730
|
+
}, {
|
|
731
|
+
version?: string;
|
|
732
|
+
description?: string;
|
|
733
|
+
confidence?: number;
|
|
734
|
+
title?: string;
|
|
735
|
+
event?: "annotation_misaligned";
|
|
736
|
+
schemaVersion?: number;
|
|
737
|
+
expected?: boolean;
|
|
738
|
+
reason?: string;
|
|
739
|
+
tool?: string;
|
|
740
|
+
parameters?: {
|
|
741
|
+
name?: string;
|
|
742
|
+
description?: string;
|
|
743
|
+
type?: string;
|
|
744
|
+
required?: boolean;
|
|
745
|
+
}[];
|
|
746
|
+
field?: "readOnlyHint" | "destructiveHint";
|
|
747
|
+
actual?: boolean;
|
|
748
|
+
}>;
|
|
749
|
+
export type AnnotationMisalignedEvent = z.infer<typeof AnnotationMisalignedEventSchema>;
|
|
750
|
+
/**
|
|
751
|
+
* 11. AnnotationReviewRecommendedEvent - Emitted for ambiguous patterns.
|
|
752
|
+
*/
|
|
753
|
+
export declare const AnnotationReviewRecommendedEventSchema: z.ZodObject<{
|
|
754
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
755
|
+
version: z.ZodString;
|
|
756
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
757
|
+
schemaVersion: z.ZodNumber;
|
|
758
|
+
} & {
|
|
759
|
+
event: z.ZodLiteral<"annotation_review_recommended">;
|
|
760
|
+
tool: z.ZodString;
|
|
761
|
+
title: z.ZodOptional<z.ZodString>;
|
|
762
|
+
description: z.ZodOptional<z.ZodString>;
|
|
763
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
764
|
+
name: z.ZodString;
|
|
765
|
+
type: z.ZodString;
|
|
766
|
+
required: z.ZodBoolean;
|
|
767
|
+
description: z.ZodOptional<z.ZodString>;
|
|
768
|
+
}, "strip", z.ZodTypeAny, {
|
|
769
|
+
name?: string;
|
|
770
|
+
description?: string;
|
|
771
|
+
type?: string;
|
|
772
|
+
required?: boolean;
|
|
773
|
+
}, {
|
|
774
|
+
name?: string;
|
|
775
|
+
description?: string;
|
|
776
|
+
type?: string;
|
|
777
|
+
required?: boolean;
|
|
778
|
+
}>, "many">;
|
|
779
|
+
field: z.ZodEnum<["readOnlyHint", "destructiveHint"]>;
|
|
780
|
+
actual: z.ZodOptional<z.ZodBoolean>;
|
|
781
|
+
inferred: z.ZodBoolean;
|
|
782
|
+
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
783
|
+
isAmbiguous: z.ZodBoolean;
|
|
784
|
+
reason: z.ZodString;
|
|
785
|
+
}, "strip", z.ZodTypeAny, {
|
|
786
|
+
version?: string;
|
|
787
|
+
description?: string;
|
|
788
|
+
inferred?: boolean;
|
|
789
|
+
confidence?: "high" | "medium" | "low";
|
|
790
|
+
title?: string;
|
|
791
|
+
event?: "annotation_review_recommended";
|
|
792
|
+
schemaVersion?: number;
|
|
793
|
+
reason?: string;
|
|
794
|
+
tool?: string;
|
|
795
|
+
parameters?: {
|
|
796
|
+
name?: string;
|
|
797
|
+
description?: string;
|
|
798
|
+
type?: string;
|
|
799
|
+
required?: boolean;
|
|
800
|
+
}[];
|
|
801
|
+
field?: "readOnlyHint" | "destructiveHint";
|
|
802
|
+
actual?: boolean;
|
|
803
|
+
isAmbiguous?: boolean;
|
|
804
|
+
}, {
|
|
805
|
+
version?: string;
|
|
806
|
+
description?: string;
|
|
807
|
+
inferred?: boolean;
|
|
808
|
+
confidence?: "high" | "medium" | "low";
|
|
809
|
+
title?: string;
|
|
810
|
+
event?: "annotation_review_recommended";
|
|
811
|
+
schemaVersion?: number;
|
|
812
|
+
reason?: string;
|
|
813
|
+
tool?: string;
|
|
814
|
+
parameters?: {
|
|
815
|
+
name?: string;
|
|
816
|
+
description?: string;
|
|
817
|
+
type?: string;
|
|
818
|
+
required?: boolean;
|
|
819
|
+
}[];
|
|
820
|
+
field?: "readOnlyHint" | "destructiveHint";
|
|
821
|
+
actual?: boolean;
|
|
822
|
+
isAmbiguous?: boolean;
|
|
823
|
+
}>;
|
|
824
|
+
export type AnnotationReviewRecommendedEvent = z.infer<typeof AnnotationReviewRecommendedEventSchema>;
|
|
825
|
+
/**
|
|
826
|
+
* 12. AnnotationAlignedEvent - Emitted when annotations correctly match behavior.
|
|
827
|
+
*/
|
|
828
|
+
export declare const AnnotationAlignedEventSchema: z.ZodObject<{
|
|
829
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
830
|
+
version: z.ZodString;
|
|
831
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
832
|
+
schemaVersion: z.ZodNumber;
|
|
833
|
+
} & {
|
|
834
|
+
event: z.ZodLiteral<"annotation_aligned">;
|
|
835
|
+
tool: z.ZodString;
|
|
836
|
+
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
837
|
+
annotations: z.ZodNullable<z.ZodObject<{
|
|
838
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
839
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
840
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
841
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
842
|
+
}, "strip", z.ZodTypeAny, {
|
|
843
|
+
readOnlyHint?: boolean;
|
|
844
|
+
destructiveHint?: boolean;
|
|
845
|
+
idempotentHint?: boolean;
|
|
846
|
+
openWorldHint?: boolean;
|
|
847
|
+
}, {
|
|
848
|
+
readOnlyHint?: boolean;
|
|
849
|
+
destructiveHint?: boolean;
|
|
850
|
+
idempotentHint?: boolean;
|
|
851
|
+
openWorldHint?: boolean;
|
|
852
|
+
}>>;
|
|
853
|
+
}, "strip", z.ZodTypeAny, {
|
|
854
|
+
version?: string;
|
|
855
|
+
confidence?: "high" | "medium" | "low";
|
|
856
|
+
annotations?: {
|
|
857
|
+
readOnlyHint?: boolean;
|
|
858
|
+
destructiveHint?: boolean;
|
|
859
|
+
idempotentHint?: boolean;
|
|
860
|
+
openWorldHint?: boolean;
|
|
861
|
+
};
|
|
862
|
+
event?: "annotation_aligned";
|
|
863
|
+
schemaVersion?: number;
|
|
864
|
+
tool?: string;
|
|
865
|
+
}, {
|
|
866
|
+
version?: string;
|
|
867
|
+
confidence?: "high" | "medium" | "low";
|
|
868
|
+
annotations?: {
|
|
869
|
+
readOnlyHint?: boolean;
|
|
870
|
+
destructiveHint?: boolean;
|
|
871
|
+
idempotentHint?: boolean;
|
|
872
|
+
openWorldHint?: boolean;
|
|
873
|
+
};
|
|
874
|
+
event?: "annotation_aligned";
|
|
875
|
+
schemaVersion?: number;
|
|
876
|
+
tool?: string;
|
|
877
|
+
}>;
|
|
878
|
+
export type AnnotationAlignedEvent = z.infer<typeof AnnotationAlignedEventSchema>;
|
|
879
|
+
/**
|
|
880
|
+
* 13. AssessmentCompleteEvent - Emitted at end of assessment.
|
|
881
|
+
*/
|
|
882
|
+
export declare const AssessmentCompleteEventSchema: z.ZodObject<{
|
|
883
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
884
|
+
version: z.ZodString;
|
|
885
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
886
|
+
schemaVersion: z.ZodNumber;
|
|
887
|
+
} & {
|
|
888
|
+
event: z.ZodLiteral<"assessment_complete">;
|
|
889
|
+
overallStatus: z.ZodString;
|
|
890
|
+
totalTests: z.ZodNumber;
|
|
891
|
+
executionTime: z.ZodNumber;
|
|
892
|
+
outputPath: z.ZodString;
|
|
893
|
+
}, "strip", z.ZodTypeAny, {
|
|
894
|
+
version?: string;
|
|
895
|
+
event?: "assessment_complete";
|
|
896
|
+
schemaVersion?: number;
|
|
897
|
+
overallStatus?: string;
|
|
898
|
+
executionTime?: number;
|
|
899
|
+
totalTests?: number;
|
|
900
|
+
outputPath?: string;
|
|
901
|
+
}, {
|
|
902
|
+
version?: string;
|
|
903
|
+
event?: "assessment_complete";
|
|
904
|
+
schemaVersion?: number;
|
|
905
|
+
overallStatus?: string;
|
|
906
|
+
executionTime?: number;
|
|
907
|
+
totalTests?: number;
|
|
908
|
+
outputPath?: string;
|
|
909
|
+
}>;
|
|
910
|
+
export type AssessmentCompleteEvent = z.infer<typeof AssessmentCompleteEventSchema>;
|
|
911
|
+
/**
|
|
912
|
+
* Union of all JSONL event schemas.
|
|
913
|
+
* Uses z.union() with z.literal() for event type discrimination.
|
|
914
|
+
*/
|
|
915
|
+
export declare const JSONLEventSchema: z.ZodUnion<[z.ZodObject<{
|
|
916
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
917
|
+
version: z.ZodString;
|
|
918
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
919
|
+
schemaVersion: z.ZodNumber;
|
|
920
|
+
} & {
|
|
921
|
+
event: z.ZodLiteral<"server_connected">;
|
|
922
|
+
serverName: z.ZodString;
|
|
923
|
+
transport: z.ZodEnum<["stdio", "http", "sse"]>;
|
|
924
|
+
}, "strip", z.ZodTypeAny, {
|
|
925
|
+
version?: string;
|
|
926
|
+
event?: "server_connected";
|
|
927
|
+
schemaVersion?: number;
|
|
928
|
+
serverName?: string;
|
|
929
|
+
transport?: "http" | "sse" | "stdio";
|
|
930
|
+
}, {
|
|
931
|
+
version?: string;
|
|
932
|
+
event?: "server_connected";
|
|
933
|
+
schemaVersion?: number;
|
|
934
|
+
serverName?: string;
|
|
935
|
+
transport?: "http" | "sse" | "stdio";
|
|
936
|
+
}>, z.ZodObject<{
|
|
937
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
938
|
+
version: z.ZodString;
|
|
939
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
940
|
+
schemaVersion: z.ZodNumber;
|
|
941
|
+
} & {
|
|
942
|
+
event: z.ZodLiteral<"tool_discovered">;
|
|
943
|
+
name: z.ZodString;
|
|
944
|
+
description: z.ZodNullable<z.ZodString>;
|
|
945
|
+
params: z.ZodArray<z.ZodObject<{
|
|
946
|
+
name: z.ZodString;
|
|
947
|
+
type: z.ZodString;
|
|
948
|
+
required: z.ZodBoolean;
|
|
949
|
+
description: z.ZodOptional<z.ZodString>;
|
|
950
|
+
}, "strip", z.ZodTypeAny, {
|
|
951
|
+
name?: string;
|
|
952
|
+
description?: string;
|
|
953
|
+
type?: string;
|
|
954
|
+
required?: boolean;
|
|
955
|
+
}, {
|
|
956
|
+
name?: string;
|
|
957
|
+
description?: string;
|
|
958
|
+
type?: string;
|
|
959
|
+
required?: boolean;
|
|
960
|
+
}>, "many">;
|
|
961
|
+
annotations: z.ZodNullable<z.ZodObject<{
|
|
962
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
963
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
964
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
965
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
966
|
+
}, "strip", z.ZodTypeAny, {
|
|
967
|
+
readOnlyHint?: boolean;
|
|
968
|
+
destructiveHint?: boolean;
|
|
969
|
+
idempotentHint?: boolean;
|
|
970
|
+
openWorldHint?: boolean;
|
|
971
|
+
}, {
|
|
972
|
+
readOnlyHint?: boolean;
|
|
973
|
+
destructiveHint?: boolean;
|
|
974
|
+
idempotentHint?: boolean;
|
|
975
|
+
openWorldHint?: boolean;
|
|
976
|
+
}>>;
|
|
977
|
+
}, "strip", z.ZodTypeAny, {
|
|
978
|
+
name?: string;
|
|
979
|
+
version?: string;
|
|
980
|
+
description?: string;
|
|
981
|
+
annotations?: {
|
|
982
|
+
readOnlyHint?: boolean;
|
|
983
|
+
destructiveHint?: boolean;
|
|
984
|
+
idempotentHint?: boolean;
|
|
985
|
+
openWorldHint?: boolean;
|
|
986
|
+
};
|
|
987
|
+
event?: "tool_discovered";
|
|
988
|
+
schemaVersion?: number;
|
|
989
|
+
params?: {
|
|
990
|
+
name?: string;
|
|
991
|
+
description?: string;
|
|
992
|
+
type?: string;
|
|
993
|
+
required?: boolean;
|
|
994
|
+
}[];
|
|
995
|
+
}, {
|
|
996
|
+
name?: string;
|
|
997
|
+
version?: string;
|
|
998
|
+
description?: string;
|
|
999
|
+
annotations?: {
|
|
1000
|
+
readOnlyHint?: boolean;
|
|
1001
|
+
destructiveHint?: boolean;
|
|
1002
|
+
idempotentHint?: boolean;
|
|
1003
|
+
openWorldHint?: boolean;
|
|
1004
|
+
};
|
|
1005
|
+
event?: "tool_discovered";
|
|
1006
|
+
schemaVersion?: number;
|
|
1007
|
+
params?: {
|
|
1008
|
+
name?: string;
|
|
1009
|
+
description?: string;
|
|
1010
|
+
type?: string;
|
|
1011
|
+
required?: boolean;
|
|
1012
|
+
}[];
|
|
1013
|
+
}>, z.ZodObject<{
|
|
1014
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
1015
|
+
version: z.ZodString;
|
|
1016
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
1017
|
+
schemaVersion: z.ZodNumber;
|
|
1018
|
+
} & {
|
|
1019
|
+
event: z.ZodLiteral<"tools_discovery_complete">;
|
|
1020
|
+
count: z.ZodNumber;
|
|
1021
|
+
}, "strip", z.ZodTypeAny, {
|
|
1022
|
+
version?: string;
|
|
1023
|
+
count?: number;
|
|
1024
|
+
event?: "tools_discovery_complete";
|
|
1025
|
+
schemaVersion?: number;
|
|
1026
|
+
}, {
|
|
1027
|
+
version?: string;
|
|
1028
|
+
count?: number;
|
|
1029
|
+
event?: "tools_discovery_complete";
|
|
1030
|
+
schemaVersion?: number;
|
|
1031
|
+
}>, z.ZodObject<{
|
|
1032
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
1033
|
+
version: z.ZodString;
|
|
1034
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
1035
|
+
schemaVersion: z.ZodNumber;
|
|
1036
|
+
} & {
|
|
1037
|
+
event: z.ZodLiteral<"modules_configured">;
|
|
1038
|
+
enabled: z.ZodArray<z.ZodString, "many">;
|
|
1039
|
+
skipped: z.ZodArray<z.ZodString, "many">;
|
|
1040
|
+
reason: z.ZodEnum<["skip-modules", "only-modules", "default"]>;
|
|
1041
|
+
}, "strip", z.ZodTypeAny, {
|
|
1042
|
+
version?: string;
|
|
1043
|
+
enabled?: string[];
|
|
1044
|
+
event?: "modules_configured";
|
|
1045
|
+
schemaVersion?: number;
|
|
1046
|
+
reason?: "default" | "skip-modules" | "only-modules";
|
|
1047
|
+
skipped?: string[];
|
|
1048
|
+
}, {
|
|
1049
|
+
version?: string;
|
|
1050
|
+
enabled?: string[];
|
|
1051
|
+
event?: "modules_configured";
|
|
1052
|
+
schemaVersion?: number;
|
|
1053
|
+
reason?: "default" | "skip-modules" | "only-modules";
|
|
1054
|
+
skipped?: string[];
|
|
1055
|
+
}>, z.ZodObject<{
|
|
1056
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
1057
|
+
version: z.ZodString;
|
|
1058
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
1059
|
+
schemaVersion: z.ZodNumber;
|
|
1060
|
+
} & {
|
|
1061
|
+
event: z.ZodLiteral<"module_started">;
|
|
1062
|
+
module: z.ZodString;
|
|
1063
|
+
estimatedTests: z.ZodNumber;
|
|
1064
|
+
toolCount: z.ZodNumber;
|
|
1065
|
+
}, "strip", z.ZodTypeAny, {
|
|
1066
|
+
version?: string;
|
|
1067
|
+
module?: string;
|
|
1068
|
+
event?: "module_started";
|
|
1069
|
+
schemaVersion?: number;
|
|
1070
|
+
estimatedTests?: number;
|
|
1071
|
+
toolCount?: number;
|
|
1072
|
+
}, {
|
|
1073
|
+
version?: string;
|
|
1074
|
+
module?: string;
|
|
1075
|
+
event?: "module_started";
|
|
1076
|
+
schemaVersion?: number;
|
|
1077
|
+
estimatedTests?: number;
|
|
1078
|
+
toolCount?: number;
|
|
1079
|
+
}>, z.ZodObject<{
|
|
1080
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
1081
|
+
version: z.ZodString;
|
|
1082
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
1083
|
+
schemaVersion: z.ZodNumber;
|
|
1084
|
+
} & {
|
|
1085
|
+
event: z.ZodLiteral<"test_batch">;
|
|
1086
|
+
module: z.ZodString;
|
|
1087
|
+
completed: z.ZodNumber;
|
|
1088
|
+
total: z.ZodNumber;
|
|
1089
|
+
batchSize: z.ZodNumber;
|
|
1090
|
+
elapsed: z.ZodNumber;
|
|
1091
|
+
}, "strip", z.ZodTypeAny, {
|
|
1092
|
+
version?: string;
|
|
1093
|
+
completed?: number;
|
|
1094
|
+
module?: string;
|
|
1095
|
+
event?: "test_batch";
|
|
1096
|
+
schemaVersion?: number;
|
|
1097
|
+
total?: number;
|
|
1098
|
+
batchSize?: number;
|
|
1099
|
+
elapsed?: number;
|
|
1100
|
+
}, {
|
|
1101
|
+
version?: string;
|
|
1102
|
+
completed?: number;
|
|
1103
|
+
module?: string;
|
|
1104
|
+
event?: "test_batch";
|
|
1105
|
+
schemaVersion?: number;
|
|
1106
|
+
total?: number;
|
|
1107
|
+
batchSize?: number;
|
|
1108
|
+
elapsed?: number;
|
|
1109
|
+
}>, z.ZodObject<{
|
|
1110
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
1111
|
+
version: z.ZodString;
|
|
1112
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
1113
|
+
schemaVersion: z.ZodNumber;
|
|
1114
|
+
} & {
|
|
1115
|
+
event: z.ZodLiteral<"module_complete">;
|
|
1116
|
+
module: z.ZodString;
|
|
1117
|
+
status: z.ZodEnum<["PASS", "FAIL", "NEED_MORE_INFO"]>;
|
|
1118
|
+
score: z.ZodNumber;
|
|
1119
|
+
testsRun: z.ZodNumber;
|
|
1120
|
+
duration: z.ZodNumber;
|
|
1121
|
+
violationsSample: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1122
|
+
category: z.ZodString;
|
|
1123
|
+
categoryName: z.ZodString;
|
|
1124
|
+
severity: z.ZodEnum<["CRITICAL", "HIGH", "MEDIUM"]>;
|
|
1125
|
+
matchedText: z.ZodString;
|
|
1126
|
+
location: z.ZodEnum<["tool_name", "tool_description", "readme", "source_code"]>;
|
|
1127
|
+
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
1128
|
+
}, "strip", z.ZodTypeAny, {
|
|
1129
|
+
category?: string;
|
|
1130
|
+
confidence?: "high" | "medium" | "low";
|
|
1131
|
+
categoryName?: string;
|
|
1132
|
+
location?: "tool_name" | "tool_description" | "readme" | "source_code";
|
|
1133
|
+
severity?: "MEDIUM" | "HIGH" | "CRITICAL";
|
|
1134
|
+
matchedText?: string;
|
|
1135
|
+
}, {
|
|
1136
|
+
category?: string;
|
|
1137
|
+
confidence?: "high" | "medium" | "low";
|
|
1138
|
+
categoryName?: string;
|
|
1139
|
+
location?: "tool_name" | "tool_description" | "readme" | "source_code";
|
|
1140
|
+
severity?: "MEDIUM" | "HIGH" | "CRITICAL";
|
|
1141
|
+
matchedText?: string;
|
|
1142
|
+
}>, "many">>;
|
|
1143
|
+
samplingNote: z.ZodOptional<z.ZodString>;
|
|
1144
|
+
violationMetrics: z.ZodOptional<z.ZodObject<{
|
|
1145
|
+
total: z.ZodNumber;
|
|
1146
|
+
critical: z.ZodNumber;
|
|
1147
|
+
high: z.ZodNumber;
|
|
1148
|
+
medium: z.ZodNumber;
|
|
1149
|
+
byCategory: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
1150
|
+
}, "strip", z.ZodTypeAny, {
|
|
1151
|
+
high?: number;
|
|
1152
|
+
medium?: number;
|
|
1153
|
+
critical?: number;
|
|
1154
|
+
total?: number;
|
|
1155
|
+
byCategory?: Record<string, number>;
|
|
1156
|
+
}, {
|
|
1157
|
+
high?: number;
|
|
1158
|
+
medium?: number;
|
|
1159
|
+
critical?: number;
|
|
1160
|
+
total?: number;
|
|
1161
|
+
byCategory?: Record<string, number>;
|
|
1162
|
+
}>>;
|
|
1163
|
+
scannedLocations: z.ZodOptional<z.ZodObject<{
|
|
1164
|
+
toolNames: z.ZodBoolean;
|
|
1165
|
+
toolDescriptions: z.ZodBoolean;
|
|
1166
|
+
readme: z.ZodBoolean;
|
|
1167
|
+
sourceCode: z.ZodBoolean;
|
|
1168
|
+
}, "strip", z.ZodTypeAny, {
|
|
1169
|
+
readme?: boolean;
|
|
1170
|
+
toolNames?: boolean;
|
|
1171
|
+
toolDescriptions?: boolean;
|
|
1172
|
+
sourceCode?: boolean;
|
|
1173
|
+
}, {
|
|
1174
|
+
readme?: boolean;
|
|
1175
|
+
toolNames?: boolean;
|
|
1176
|
+
toolDescriptions?: boolean;
|
|
1177
|
+
sourceCode?: boolean;
|
|
1178
|
+
}>>;
|
|
1179
|
+
highRiskDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1180
|
+
}, "strip", z.ZodTypeAny, {
|
|
1181
|
+
version?: string;
|
|
1182
|
+
status?: "PASS" | "FAIL" | "NEED_MORE_INFO";
|
|
1183
|
+
module?: string;
|
|
1184
|
+
score?: number;
|
|
1185
|
+
event?: "module_complete";
|
|
1186
|
+
testsRun?: number;
|
|
1187
|
+
duration?: number;
|
|
1188
|
+
schemaVersion?: number;
|
|
1189
|
+
scannedLocations?: {
|
|
1190
|
+
readme?: boolean;
|
|
1191
|
+
toolNames?: boolean;
|
|
1192
|
+
toolDescriptions?: boolean;
|
|
1193
|
+
sourceCode?: boolean;
|
|
1194
|
+
};
|
|
1195
|
+
highRiskDomains?: string[];
|
|
1196
|
+
violationsSample?: {
|
|
1197
|
+
category?: string;
|
|
1198
|
+
confidence?: "high" | "medium" | "low";
|
|
1199
|
+
categoryName?: string;
|
|
1200
|
+
location?: "tool_name" | "tool_description" | "readme" | "source_code";
|
|
1201
|
+
severity?: "MEDIUM" | "HIGH" | "CRITICAL";
|
|
1202
|
+
matchedText?: string;
|
|
1203
|
+
}[];
|
|
1204
|
+
samplingNote?: string;
|
|
1205
|
+
violationMetrics?: {
|
|
1206
|
+
high?: number;
|
|
1207
|
+
medium?: number;
|
|
1208
|
+
critical?: number;
|
|
1209
|
+
total?: number;
|
|
1210
|
+
byCategory?: Record<string, number>;
|
|
1211
|
+
};
|
|
1212
|
+
}, {
|
|
1213
|
+
version?: string;
|
|
1214
|
+
status?: "PASS" | "FAIL" | "NEED_MORE_INFO";
|
|
1215
|
+
module?: string;
|
|
1216
|
+
score?: number;
|
|
1217
|
+
event?: "module_complete";
|
|
1218
|
+
testsRun?: number;
|
|
1219
|
+
duration?: number;
|
|
1220
|
+
schemaVersion?: number;
|
|
1221
|
+
scannedLocations?: {
|
|
1222
|
+
readme?: boolean;
|
|
1223
|
+
toolNames?: boolean;
|
|
1224
|
+
toolDescriptions?: boolean;
|
|
1225
|
+
sourceCode?: boolean;
|
|
1226
|
+
};
|
|
1227
|
+
highRiskDomains?: string[];
|
|
1228
|
+
violationsSample?: {
|
|
1229
|
+
category?: string;
|
|
1230
|
+
confidence?: "high" | "medium" | "low";
|
|
1231
|
+
categoryName?: string;
|
|
1232
|
+
location?: "tool_name" | "tool_description" | "readme" | "source_code";
|
|
1233
|
+
severity?: "MEDIUM" | "HIGH" | "CRITICAL";
|
|
1234
|
+
matchedText?: string;
|
|
1235
|
+
}[];
|
|
1236
|
+
samplingNote?: string;
|
|
1237
|
+
violationMetrics?: {
|
|
1238
|
+
high?: number;
|
|
1239
|
+
medium?: number;
|
|
1240
|
+
critical?: number;
|
|
1241
|
+
total?: number;
|
|
1242
|
+
byCategory?: Record<string, number>;
|
|
1243
|
+
};
|
|
1244
|
+
}>, z.ZodObject<{
|
|
1245
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
1246
|
+
version: z.ZodString;
|
|
1247
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
1248
|
+
schemaVersion: z.ZodNumber;
|
|
1249
|
+
} & {
|
|
1250
|
+
event: z.ZodLiteral<"vulnerability_found">;
|
|
1251
|
+
tool: z.ZodString;
|
|
1252
|
+
pattern: z.ZodString;
|
|
1253
|
+
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
1254
|
+
evidence: z.ZodString;
|
|
1255
|
+
riskLevel: z.ZodEnum<["HIGH", "MEDIUM", "LOW"]>;
|
|
1256
|
+
requiresReview: z.ZodBoolean;
|
|
1257
|
+
payload: z.ZodOptional<z.ZodString>;
|
|
1258
|
+
}, "strip", z.ZodTypeAny, {
|
|
1259
|
+
version?: string;
|
|
1260
|
+
evidence?: string;
|
|
1261
|
+
payload?: string;
|
|
1262
|
+
riskLevel?: "LOW" | "MEDIUM" | "HIGH";
|
|
1263
|
+
confidence?: "high" | "medium" | "low";
|
|
1264
|
+
pattern?: string;
|
|
1265
|
+
event?: "vulnerability_found";
|
|
1266
|
+
schemaVersion?: number;
|
|
1267
|
+
tool?: string;
|
|
1268
|
+
requiresReview?: boolean;
|
|
1269
|
+
}, {
|
|
1270
|
+
version?: string;
|
|
1271
|
+
evidence?: string;
|
|
1272
|
+
payload?: string;
|
|
1273
|
+
riskLevel?: "LOW" | "MEDIUM" | "HIGH";
|
|
1274
|
+
confidence?: "high" | "medium" | "low";
|
|
1275
|
+
pattern?: string;
|
|
1276
|
+
event?: "vulnerability_found";
|
|
1277
|
+
schemaVersion?: number;
|
|
1278
|
+
tool?: string;
|
|
1279
|
+
requiresReview?: boolean;
|
|
1280
|
+
}>, z.ZodObject<{
|
|
1281
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
1282
|
+
version: z.ZodString;
|
|
1283
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
1284
|
+
schemaVersion: z.ZodNumber;
|
|
1285
|
+
} & {
|
|
1286
|
+
event: z.ZodLiteral<"annotation_missing">;
|
|
1287
|
+
tool: z.ZodString;
|
|
1288
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1289
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1290
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
1291
|
+
name: z.ZodString;
|
|
1292
|
+
type: z.ZodString;
|
|
1293
|
+
required: z.ZodBoolean;
|
|
1294
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1295
|
+
}, "strip", z.ZodTypeAny, {
|
|
1296
|
+
name?: string;
|
|
1297
|
+
description?: string;
|
|
1298
|
+
type?: string;
|
|
1299
|
+
required?: boolean;
|
|
1300
|
+
}, {
|
|
1301
|
+
name?: string;
|
|
1302
|
+
description?: string;
|
|
1303
|
+
type?: string;
|
|
1304
|
+
required?: boolean;
|
|
1305
|
+
}>, "many">;
|
|
1306
|
+
inferredBehavior: z.ZodObject<{
|
|
1307
|
+
expectedReadOnly: z.ZodBoolean;
|
|
1308
|
+
expectedDestructive: z.ZodBoolean;
|
|
1309
|
+
reason: z.ZodString;
|
|
1310
|
+
}, "strip", z.ZodTypeAny, {
|
|
1311
|
+
reason?: string;
|
|
1312
|
+
expectedReadOnly?: boolean;
|
|
1313
|
+
expectedDestructive?: boolean;
|
|
1314
|
+
}, {
|
|
1315
|
+
reason?: string;
|
|
1316
|
+
expectedReadOnly?: boolean;
|
|
1317
|
+
expectedDestructive?: boolean;
|
|
1318
|
+
}>;
|
|
1319
|
+
}, "strip", z.ZodTypeAny, {
|
|
1320
|
+
version?: string;
|
|
1321
|
+
description?: string;
|
|
1322
|
+
title?: string;
|
|
1323
|
+
event?: "annotation_missing";
|
|
1324
|
+
schemaVersion?: number;
|
|
1325
|
+
tool?: string;
|
|
1326
|
+
parameters?: {
|
|
1327
|
+
name?: string;
|
|
1328
|
+
description?: string;
|
|
1329
|
+
type?: string;
|
|
1330
|
+
required?: boolean;
|
|
1331
|
+
}[];
|
|
1332
|
+
inferredBehavior?: {
|
|
1333
|
+
reason?: string;
|
|
1334
|
+
expectedReadOnly?: boolean;
|
|
1335
|
+
expectedDestructive?: boolean;
|
|
1336
|
+
};
|
|
1337
|
+
}, {
|
|
1338
|
+
version?: string;
|
|
1339
|
+
description?: string;
|
|
1340
|
+
title?: string;
|
|
1341
|
+
event?: "annotation_missing";
|
|
1342
|
+
schemaVersion?: number;
|
|
1343
|
+
tool?: string;
|
|
1344
|
+
parameters?: {
|
|
1345
|
+
name?: string;
|
|
1346
|
+
description?: string;
|
|
1347
|
+
type?: string;
|
|
1348
|
+
required?: boolean;
|
|
1349
|
+
}[];
|
|
1350
|
+
inferredBehavior?: {
|
|
1351
|
+
reason?: string;
|
|
1352
|
+
expectedReadOnly?: boolean;
|
|
1353
|
+
expectedDestructive?: boolean;
|
|
1354
|
+
};
|
|
1355
|
+
}>, z.ZodObject<{
|
|
1356
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
1357
|
+
version: z.ZodString;
|
|
1358
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
1359
|
+
schemaVersion: z.ZodNumber;
|
|
1360
|
+
} & {
|
|
1361
|
+
event: z.ZodLiteral<"annotation_misaligned">;
|
|
1362
|
+
tool: z.ZodString;
|
|
1363
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1364
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1365
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
1366
|
+
name: z.ZodString;
|
|
1367
|
+
type: z.ZodString;
|
|
1368
|
+
required: z.ZodBoolean;
|
|
1369
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1370
|
+
}, "strip", z.ZodTypeAny, {
|
|
1371
|
+
name?: string;
|
|
1372
|
+
description?: string;
|
|
1373
|
+
type?: string;
|
|
1374
|
+
required?: boolean;
|
|
1375
|
+
}, {
|
|
1376
|
+
name?: string;
|
|
1377
|
+
description?: string;
|
|
1378
|
+
type?: string;
|
|
1379
|
+
required?: boolean;
|
|
1380
|
+
}>, "many">;
|
|
1381
|
+
field: z.ZodEnum<["readOnlyHint", "destructiveHint"]>;
|
|
1382
|
+
actual: z.ZodOptional<z.ZodBoolean>;
|
|
1383
|
+
expected: z.ZodBoolean;
|
|
1384
|
+
confidence: z.ZodNumber;
|
|
1385
|
+
reason: z.ZodString;
|
|
1386
|
+
}, "strip", z.ZodTypeAny, {
|
|
1387
|
+
version?: string;
|
|
1388
|
+
description?: string;
|
|
1389
|
+
confidence?: number;
|
|
1390
|
+
title?: string;
|
|
1391
|
+
event?: "annotation_misaligned";
|
|
1392
|
+
schemaVersion?: number;
|
|
1393
|
+
expected?: boolean;
|
|
1394
|
+
reason?: string;
|
|
1395
|
+
tool?: string;
|
|
1396
|
+
parameters?: {
|
|
1397
|
+
name?: string;
|
|
1398
|
+
description?: string;
|
|
1399
|
+
type?: string;
|
|
1400
|
+
required?: boolean;
|
|
1401
|
+
}[];
|
|
1402
|
+
field?: "readOnlyHint" | "destructiveHint";
|
|
1403
|
+
actual?: boolean;
|
|
1404
|
+
}, {
|
|
1405
|
+
version?: string;
|
|
1406
|
+
description?: string;
|
|
1407
|
+
confidence?: number;
|
|
1408
|
+
title?: string;
|
|
1409
|
+
event?: "annotation_misaligned";
|
|
1410
|
+
schemaVersion?: number;
|
|
1411
|
+
expected?: boolean;
|
|
1412
|
+
reason?: string;
|
|
1413
|
+
tool?: string;
|
|
1414
|
+
parameters?: {
|
|
1415
|
+
name?: string;
|
|
1416
|
+
description?: string;
|
|
1417
|
+
type?: string;
|
|
1418
|
+
required?: boolean;
|
|
1419
|
+
}[];
|
|
1420
|
+
field?: "readOnlyHint" | "destructiveHint";
|
|
1421
|
+
actual?: boolean;
|
|
1422
|
+
}>, z.ZodObject<{
|
|
1423
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
1424
|
+
version: z.ZodString;
|
|
1425
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
1426
|
+
schemaVersion: z.ZodNumber;
|
|
1427
|
+
} & {
|
|
1428
|
+
event: z.ZodLiteral<"annotation_review_recommended">;
|
|
1429
|
+
tool: z.ZodString;
|
|
1430
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1431
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1432
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
1433
|
+
name: z.ZodString;
|
|
1434
|
+
type: z.ZodString;
|
|
1435
|
+
required: z.ZodBoolean;
|
|
1436
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1437
|
+
}, "strip", z.ZodTypeAny, {
|
|
1438
|
+
name?: string;
|
|
1439
|
+
description?: string;
|
|
1440
|
+
type?: string;
|
|
1441
|
+
required?: boolean;
|
|
1442
|
+
}, {
|
|
1443
|
+
name?: string;
|
|
1444
|
+
description?: string;
|
|
1445
|
+
type?: string;
|
|
1446
|
+
required?: boolean;
|
|
1447
|
+
}>, "many">;
|
|
1448
|
+
field: z.ZodEnum<["readOnlyHint", "destructiveHint"]>;
|
|
1449
|
+
actual: z.ZodOptional<z.ZodBoolean>;
|
|
1450
|
+
inferred: z.ZodBoolean;
|
|
1451
|
+
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
1452
|
+
isAmbiguous: z.ZodBoolean;
|
|
1453
|
+
reason: z.ZodString;
|
|
1454
|
+
}, "strip", z.ZodTypeAny, {
|
|
1455
|
+
version?: string;
|
|
1456
|
+
description?: string;
|
|
1457
|
+
inferred?: boolean;
|
|
1458
|
+
confidence?: "high" | "medium" | "low";
|
|
1459
|
+
title?: string;
|
|
1460
|
+
event?: "annotation_review_recommended";
|
|
1461
|
+
schemaVersion?: number;
|
|
1462
|
+
reason?: string;
|
|
1463
|
+
tool?: string;
|
|
1464
|
+
parameters?: {
|
|
1465
|
+
name?: string;
|
|
1466
|
+
description?: string;
|
|
1467
|
+
type?: string;
|
|
1468
|
+
required?: boolean;
|
|
1469
|
+
}[];
|
|
1470
|
+
field?: "readOnlyHint" | "destructiveHint";
|
|
1471
|
+
actual?: boolean;
|
|
1472
|
+
isAmbiguous?: boolean;
|
|
1473
|
+
}, {
|
|
1474
|
+
version?: string;
|
|
1475
|
+
description?: string;
|
|
1476
|
+
inferred?: boolean;
|
|
1477
|
+
confidence?: "high" | "medium" | "low";
|
|
1478
|
+
title?: string;
|
|
1479
|
+
event?: "annotation_review_recommended";
|
|
1480
|
+
schemaVersion?: number;
|
|
1481
|
+
reason?: string;
|
|
1482
|
+
tool?: string;
|
|
1483
|
+
parameters?: {
|
|
1484
|
+
name?: string;
|
|
1485
|
+
description?: string;
|
|
1486
|
+
type?: string;
|
|
1487
|
+
required?: boolean;
|
|
1488
|
+
}[];
|
|
1489
|
+
field?: "readOnlyHint" | "destructiveHint";
|
|
1490
|
+
actual?: boolean;
|
|
1491
|
+
isAmbiguous?: boolean;
|
|
1492
|
+
}>, z.ZodObject<{
|
|
1493
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
1494
|
+
version: z.ZodString;
|
|
1495
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
1496
|
+
schemaVersion: z.ZodNumber;
|
|
1497
|
+
} & {
|
|
1498
|
+
event: z.ZodLiteral<"annotation_aligned">;
|
|
1499
|
+
tool: z.ZodString;
|
|
1500
|
+
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
1501
|
+
annotations: z.ZodNullable<z.ZodObject<{
|
|
1502
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
1503
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
1504
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
1505
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
1506
|
+
}, "strip", z.ZodTypeAny, {
|
|
1507
|
+
readOnlyHint?: boolean;
|
|
1508
|
+
destructiveHint?: boolean;
|
|
1509
|
+
idempotentHint?: boolean;
|
|
1510
|
+
openWorldHint?: boolean;
|
|
1511
|
+
}, {
|
|
1512
|
+
readOnlyHint?: boolean;
|
|
1513
|
+
destructiveHint?: boolean;
|
|
1514
|
+
idempotentHint?: boolean;
|
|
1515
|
+
openWorldHint?: boolean;
|
|
1516
|
+
}>>;
|
|
1517
|
+
}, "strip", z.ZodTypeAny, {
|
|
1518
|
+
version?: string;
|
|
1519
|
+
confidence?: "high" | "medium" | "low";
|
|
1520
|
+
annotations?: {
|
|
1521
|
+
readOnlyHint?: boolean;
|
|
1522
|
+
destructiveHint?: boolean;
|
|
1523
|
+
idempotentHint?: boolean;
|
|
1524
|
+
openWorldHint?: boolean;
|
|
1525
|
+
};
|
|
1526
|
+
event?: "annotation_aligned";
|
|
1527
|
+
schemaVersion?: number;
|
|
1528
|
+
tool?: string;
|
|
1529
|
+
}, {
|
|
1530
|
+
version?: string;
|
|
1531
|
+
confidence?: "high" | "medium" | "low";
|
|
1532
|
+
annotations?: {
|
|
1533
|
+
readOnlyHint?: boolean;
|
|
1534
|
+
destructiveHint?: boolean;
|
|
1535
|
+
idempotentHint?: boolean;
|
|
1536
|
+
openWorldHint?: boolean;
|
|
1537
|
+
};
|
|
1538
|
+
event?: "annotation_aligned";
|
|
1539
|
+
schemaVersion?: number;
|
|
1540
|
+
tool?: string;
|
|
1541
|
+
}>, z.ZodObject<{
|
|
1542
|
+
/** Inspector software version (e.g., "1.29.0") */
|
|
1543
|
+
version: z.ZodString;
|
|
1544
|
+
/** Event schema version (integer, increment when structure changes) */
|
|
1545
|
+
schemaVersion: z.ZodNumber;
|
|
1546
|
+
} & {
|
|
1547
|
+
event: z.ZodLiteral<"assessment_complete">;
|
|
1548
|
+
overallStatus: z.ZodString;
|
|
1549
|
+
totalTests: z.ZodNumber;
|
|
1550
|
+
executionTime: z.ZodNumber;
|
|
1551
|
+
outputPath: z.ZodString;
|
|
1552
|
+
}, "strip", z.ZodTypeAny, {
|
|
1553
|
+
version?: string;
|
|
1554
|
+
event?: "assessment_complete";
|
|
1555
|
+
schemaVersion?: number;
|
|
1556
|
+
overallStatus?: string;
|
|
1557
|
+
executionTime?: number;
|
|
1558
|
+
totalTests?: number;
|
|
1559
|
+
outputPath?: string;
|
|
1560
|
+
}, {
|
|
1561
|
+
version?: string;
|
|
1562
|
+
event?: "assessment_complete";
|
|
1563
|
+
schemaVersion?: number;
|
|
1564
|
+
overallStatus?: string;
|
|
1565
|
+
executionTime?: number;
|
|
1566
|
+
totalTests?: number;
|
|
1567
|
+
outputPath?: string;
|
|
1568
|
+
}>]>;
|
|
1569
|
+
/**
|
|
1570
|
+
* Inferred union type for all JSONL events.
|
|
1571
|
+
*/
|
|
1572
|
+
export type JSONLEventParsed = z.infer<typeof JSONLEventSchema>;
|
|
1573
|
+
/**
|
|
1574
|
+
* Event type literal union for type guards.
|
|
1575
|
+
*/
|
|
1576
|
+
export type JSONLEventType = JSONLEventParsed["event"];
|
|
1577
|
+
/**
|
|
1578
|
+
* Parse a JSONL event string or object with validation.
|
|
1579
|
+
*
|
|
1580
|
+
* @param input - Raw JSON string or parsed object
|
|
1581
|
+
* @returns Validated and typed event
|
|
1582
|
+
* @throws ZodError if validation fails
|
|
1583
|
+
* @throws SyntaxError if input is invalid JSON string
|
|
1584
|
+
*
|
|
1585
|
+
* @example
|
|
1586
|
+
* ```typescript
|
|
1587
|
+
* const event = parseEvent('{"event":"server_connected",...}');
|
|
1588
|
+
* console.log(event.serverName);
|
|
1589
|
+
* ```
|
|
1590
|
+
*/
|
|
1591
|
+
export declare function parseEvent(input: string | unknown): JSONLEventParsed;
|
|
1592
|
+
/**
|
|
1593
|
+
* Safely parse a JSONL event without throwing.
|
|
1594
|
+
*
|
|
1595
|
+
* @param input - Raw JSON string or parsed object
|
|
1596
|
+
* @returns SafeParseResult with success status and data/error
|
|
1597
|
+
*
|
|
1598
|
+
* @remarks
|
|
1599
|
+
* JSON parse errors are converted to ZodError with code "custom" and message prefixed with "Invalid JSON:".
|
|
1600
|
+
* This allows uniform error handling, but consumers should be aware that not all errors are schema validation failures.
|
|
1601
|
+
*
|
|
1602
|
+
* @example
|
|
1603
|
+
* ```typescript
|
|
1604
|
+
* const result = safeParseEvent(line);
|
|
1605
|
+
* if (result.success) {
|
|
1606
|
+
* console.log(result.data.event);
|
|
1607
|
+
* } else {
|
|
1608
|
+
* console.error(result.error);
|
|
1609
|
+
* }
|
|
1610
|
+
* ```
|
|
1611
|
+
*/
|
|
1612
|
+
export declare function safeParseEvent(input: string | unknown): z.SafeParseReturnType<unknown, JSONLEventParsed>;
|
|
1613
|
+
/**
|
|
1614
|
+
* Validate an event and return error messages.
|
|
1615
|
+
*
|
|
1616
|
+
* @param input - Raw event data
|
|
1617
|
+
* @returns Array of validation error messages (empty if valid)
|
|
1618
|
+
*
|
|
1619
|
+
* @example
|
|
1620
|
+
* ```typescript
|
|
1621
|
+
* const errors = validateEvent(data);
|
|
1622
|
+
* if (errors.length > 0) {
|
|
1623
|
+
* console.error('Validation failed:', errors);
|
|
1624
|
+
* }
|
|
1625
|
+
* ```
|
|
1626
|
+
*/
|
|
1627
|
+
export declare function validateEvent(input: unknown): string[];
|
|
1628
|
+
/**
|
|
1629
|
+
* Type guard for specific event types.
|
|
1630
|
+
*
|
|
1631
|
+
* @param event - Parsed event
|
|
1632
|
+
* @param eventType - Event type to check
|
|
1633
|
+
* @returns True if event matches the specified type
|
|
1634
|
+
*
|
|
1635
|
+
* @example
|
|
1636
|
+
* ```typescript
|
|
1637
|
+
* const event = parseEvent(line);
|
|
1638
|
+
* if (isEventType(event, 'server_connected')) {
|
|
1639
|
+
* // event is narrowed to ServerConnectedEvent
|
|
1640
|
+
* console.log(event.serverName);
|
|
1641
|
+
* }
|
|
1642
|
+
* ```
|
|
1643
|
+
*/
|
|
1644
|
+
export declare function isEventType<T extends JSONLEventType>(event: JSONLEventParsed, eventType: T): event is Extract<JSONLEventParsed, {
|
|
1645
|
+
event: T;
|
|
1646
|
+
}>;
|
|
1647
|
+
/**
|
|
1648
|
+
* Parse multiple JSONL lines with line number tracking.
|
|
1649
|
+
*
|
|
1650
|
+
* @param lines - Array of JSONL strings
|
|
1651
|
+
* @returns Array of parse results with line numbers (1-indexed)
|
|
1652
|
+
*
|
|
1653
|
+
* @example
|
|
1654
|
+
* ```typescript
|
|
1655
|
+
* const results = parseEventLines(lines);
|
|
1656
|
+
* for (const { line, result } of results) {
|
|
1657
|
+
* if (!result.success) {
|
|
1658
|
+
* console.error(`Line ${line}: ${result.error.message}`);
|
|
1659
|
+
* }
|
|
1660
|
+
* }
|
|
1661
|
+
* ```
|
|
1662
|
+
*/
|
|
1663
|
+
export declare function parseEventLines(lines: string[]): Array<{
|
|
1664
|
+
line: number;
|
|
1665
|
+
result: z.SafeParseReturnType<unknown, JSONLEventParsed>;
|
|
1666
|
+
}>;
|
|
1667
|
+
//# sourceMappingURL=jsonlEventSchemas.d.ts.map
|