@pugi/sdk 0.1.0-alpha.3 → 0.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audit-trace.d.ts +828 -54
- package/dist/audit-trace.js +141 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/subagent-contracts.d.ts +549 -0
- package/dist/subagent-contracts.js +230 -0
- package/package.json +1 -1
package/dist/audit-trace.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ export declare const auditEventBaseSchema: z.ZodObject<{
|
|
|
5
5
|
timestamp: z.ZodString;
|
|
6
6
|
}, "strip", z.ZodTypeAny, {
|
|
7
7
|
id: string;
|
|
8
|
-
sessionId: string;
|
|
9
8
|
timestamp: string;
|
|
9
|
+
sessionId: string;
|
|
10
10
|
}, {
|
|
11
11
|
id: string;
|
|
12
|
-
sessionId: string;
|
|
13
12
|
timestamp: string;
|
|
13
|
+
sessionId: string;
|
|
14
14
|
}>;
|
|
15
15
|
export declare const toolCallEventSchema: z.ZodObject<{
|
|
16
16
|
id: z.ZodString;
|
|
@@ -26,13 +26,13 @@ export declare const toolCallEventSchema: z.ZodObject<{
|
|
|
26
26
|
source: z.ZodString;
|
|
27
27
|
expiresAt: z.ZodOptional<z.ZodString>;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
reason: string;
|
|
30
29
|
decision: "allow";
|
|
30
|
+
reason: string;
|
|
31
31
|
source: string;
|
|
32
32
|
expiresAt?: string | undefined;
|
|
33
33
|
}, {
|
|
34
|
-
reason: string;
|
|
35
34
|
decision: "allow";
|
|
35
|
+
reason: string;
|
|
36
36
|
source: string;
|
|
37
37
|
expiresAt?: string | undefined;
|
|
38
38
|
}>, z.ZodObject<{
|
|
@@ -40,66 +40,66 @@ export declare const toolCallEventSchema: z.ZodObject<{
|
|
|
40
40
|
reason: z.ZodString;
|
|
41
41
|
risk: z.ZodEnum<["low", "medium", "high"]>;
|
|
42
42
|
}, "strip", z.ZodTypeAny, {
|
|
43
|
-
reason: string;
|
|
44
43
|
decision: "ask";
|
|
44
|
+
reason: string;
|
|
45
45
|
risk: "low" | "medium" | "high";
|
|
46
46
|
}, {
|
|
47
|
-
reason: string;
|
|
48
47
|
decision: "ask";
|
|
48
|
+
reason: string;
|
|
49
49
|
risk: "low" | "medium" | "high";
|
|
50
50
|
}>, z.ZodObject<{
|
|
51
51
|
decision: z.ZodLiteral<"deny">;
|
|
52
52
|
reason: z.ZodString;
|
|
53
53
|
source: z.ZodString;
|
|
54
54
|
}, "strip", z.ZodTypeAny, {
|
|
55
|
-
reason: string;
|
|
56
55
|
decision: "deny";
|
|
56
|
+
reason: string;
|
|
57
57
|
source: string;
|
|
58
58
|
}, {
|
|
59
|
-
reason: string;
|
|
60
59
|
decision: "deny";
|
|
60
|
+
reason: string;
|
|
61
61
|
source: string;
|
|
62
62
|
}>]>>;
|
|
63
63
|
}, "strip", z.ZodTypeAny, {
|
|
64
64
|
type: "tool_call";
|
|
65
|
-
tool: string;
|
|
66
65
|
id: string;
|
|
67
|
-
sessionId: string;
|
|
68
66
|
timestamp: string;
|
|
67
|
+
sessionId: string;
|
|
68
|
+
tool: string;
|
|
69
69
|
inputSummary: string;
|
|
70
70
|
permissionDecision?: {
|
|
71
|
-
reason: string;
|
|
72
71
|
decision: "allow";
|
|
72
|
+
reason: string;
|
|
73
73
|
source: string;
|
|
74
74
|
expiresAt?: string | undefined;
|
|
75
75
|
} | {
|
|
76
|
-
reason: string;
|
|
77
76
|
decision: "ask";
|
|
77
|
+
reason: string;
|
|
78
78
|
risk: "low" | "medium" | "high";
|
|
79
79
|
} | {
|
|
80
|
-
reason: string;
|
|
81
80
|
decision: "deny";
|
|
81
|
+
reason: string;
|
|
82
82
|
source: string;
|
|
83
83
|
} | undefined;
|
|
84
84
|
}, {
|
|
85
85
|
type: "tool_call";
|
|
86
|
-
tool: string;
|
|
87
86
|
id: string;
|
|
88
|
-
sessionId: string;
|
|
89
87
|
timestamp: string;
|
|
88
|
+
sessionId: string;
|
|
89
|
+
tool: string;
|
|
90
90
|
inputSummary: string;
|
|
91
91
|
permissionDecision?: {
|
|
92
|
-
reason: string;
|
|
93
92
|
decision: "allow";
|
|
93
|
+
reason: string;
|
|
94
94
|
source: string;
|
|
95
95
|
expiresAt?: string | undefined;
|
|
96
96
|
} | {
|
|
97
|
-
reason: string;
|
|
98
97
|
decision: "ask";
|
|
98
|
+
reason: string;
|
|
99
99
|
risk: "low" | "medium" | "high";
|
|
100
100
|
} | {
|
|
101
|
-
reason: string;
|
|
102
101
|
decision: "deny";
|
|
102
|
+
reason: string;
|
|
103
103
|
source: string;
|
|
104
104
|
} | undefined;
|
|
105
105
|
}>;
|
|
@@ -115,20 +115,20 @@ export declare const toolResultEventSchema: z.ZodObject<{
|
|
|
115
115
|
outputRef: z.ZodOptional<z.ZodString>;
|
|
116
116
|
}, "strip", z.ZodTypeAny, {
|
|
117
117
|
type: "tool_result";
|
|
118
|
-
status: "
|
|
118
|
+
status: "cancelled" | "error" | "success";
|
|
119
119
|
id: string;
|
|
120
|
+
timestamp: string;
|
|
120
121
|
toolCallId: string;
|
|
121
122
|
sessionId: string;
|
|
122
|
-
timestamp: string;
|
|
123
123
|
outputSummary: string;
|
|
124
124
|
outputRef?: string | undefined;
|
|
125
125
|
}, {
|
|
126
126
|
type: "tool_result";
|
|
127
|
-
status: "
|
|
127
|
+
status: "cancelled" | "error" | "success";
|
|
128
128
|
id: string;
|
|
129
|
+
timestamp: string;
|
|
129
130
|
toolCallId: string;
|
|
130
131
|
sessionId: string;
|
|
131
|
-
timestamp: string;
|
|
132
132
|
outputSummary: string;
|
|
133
133
|
outputRef?: string | undefined;
|
|
134
134
|
}>;
|
|
@@ -150,9 +150,9 @@ export declare const fileMutationEventSchema: z.ZodObject<{
|
|
|
150
150
|
path: string;
|
|
151
151
|
type: "file_mutation";
|
|
152
152
|
id: string;
|
|
153
|
+
timestamp: string;
|
|
153
154
|
toolCallId: string;
|
|
154
155
|
sessionId: string;
|
|
155
|
-
timestamp: string;
|
|
156
156
|
operation: "create" | "update" | "delete" | "move";
|
|
157
157
|
beforeBlob?: string | undefined;
|
|
158
158
|
afterBlob?: string | undefined;
|
|
@@ -163,9 +163,9 @@ export declare const fileMutationEventSchema: z.ZodObject<{
|
|
|
163
163
|
path: string;
|
|
164
164
|
type: "file_mutation";
|
|
165
165
|
id: string;
|
|
166
|
+
timestamp: string;
|
|
166
167
|
toolCallId: string;
|
|
167
168
|
sessionId: string;
|
|
168
|
-
timestamp: string;
|
|
169
169
|
operation: "create" | "update" | "delete" | "move";
|
|
170
170
|
beforeBlob?: string | undefined;
|
|
171
171
|
afterBlob?: string | undefined;
|
|
@@ -185,20 +185,413 @@ export declare const sessionEventSchema: z.ZodObject<{
|
|
|
185
185
|
}, "strip", z.ZodTypeAny, {
|
|
186
186
|
type: "session";
|
|
187
187
|
id: string;
|
|
188
|
-
name: "created" | "command_started" | "command_completed";
|
|
189
|
-
sessionId: string;
|
|
190
188
|
timestamp: string;
|
|
189
|
+
sessionId: string;
|
|
190
|
+
name: "created" | "command_started" | "command_completed";
|
|
191
191
|
status?: "error" | "success" | undefined;
|
|
192
192
|
command?: string | undefined;
|
|
193
193
|
}, {
|
|
194
194
|
type: "session";
|
|
195
195
|
id: string;
|
|
196
|
-
name: "created" | "command_started" | "command_completed";
|
|
197
|
-
sessionId: string;
|
|
198
196
|
timestamp: string;
|
|
197
|
+
sessionId: string;
|
|
198
|
+
name: "created" | "command_started" | "command_completed";
|
|
199
199
|
status?: "error" | "success" | undefined;
|
|
200
200
|
command?: string | undefined;
|
|
201
201
|
}>;
|
|
202
|
+
export declare const hookInvokedEventSchema: z.ZodObject<{
|
|
203
|
+
id: z.ZodString;
|
|
204
|
+
sessionId: z.ZodString;
|
|
205
|
+
timestamp: z.ZodString;
|
|
206
|
+
} & {
|
|
207
|
+
type: z.ZodLiteral<"hook.invoked">;
|
|
208
|
+
event: z.ZodEnum<["SessionStart", "UserPromptSubmit", "PreToolUse", "PermissionRequest", "PostToolUse", "PostToolUseFailure", "Stop", "SessionEnd"]>;
|
|
209
|
+
matchSummary: z.ZodString;
|
|
210
|
+
runSummary: z.ZodString;
|
|
211
|
+
}, "strip", z.ZodTypeAny, {
|
|
212
|
+
type: "hook.invoked";
|
|
213
|
+
id: string;
|
|
214
|
+
timestamp: string;
|
|
215
|
+
sessionId: string;
|
|
216
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
217
|
+
matchSummary: string;
|
|
218
|
+
runSummary: string;
|
|
219
|
+
}, {
|
|
220
|
+
type: "hook.invoked";
|
|
221
|
+
id: string;
|
|
222
|
+
timestamp: string;
|
|
223
|
+
sessionId: string;
|
|
224
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
225
|
+
matchSummary: string;
|
|
226
|
+
runSummary: string;
|
|
227
|
+
}>;
|
|
228
|
+
export declare const hookResultEventSchema: z.ZodObject<{
|
|
229
|
+
id: z.ZodString;
|
|
230
|
+
sessionId: z.ZodString;
|
|
231
|
+
timestamp: z.ZodString;
|
|
232
|
+
} & {
|
|
233
|
+
type: z.ZodLiteral<"hook.result">;
|
|
234
|
+
event: z.ZodEnum<["SessionStart", "UserPromptSubmit", "PreToolUse", "PermissionRequest", "PostToolUse", "PostToolUseFailure", "Stop", "SessionEnd"]>;
|
|
235
|
+
ok: z.ZodBoolean;
|
|
236
|
+
exitCode: z.ZodNumber;
|
|
237
|
+
elapsedMs: z.ZodNumber;
|
|
238
|
+
stdoutLen: z.ZodNumber;
|
|
239
|
+
stderrLen: z.ZodNumber;
|
|
240
|
+
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
type: "hook.result";
|
|
242
|
+
id: string;
|
|
243
|
+
timestamp: string;
|
|
244
|
+
sessionId: string;
|
|
245
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
246
|
+
ok: boolean;
|
|
247
|
+
exitCode: number;
|
|
248
|
+
elapsedMs: number;
|
|
249
|
+
stdoutLen: number;
|
|
250
|
+
stderrLen: number;
|
|
251
|
+
}, {
|
|
252
|
+
type: "hook.result";
|
|
253
|
+
id: string;
|
|
254
|
+
timestamp: string;
|
|
255
|
+
sessionId: string;
|
|
256
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
257
|
+
ok: boolean;
|
|
258
|
+
exitCode: number;
|
|
259
|
+
elapsedMs: number;
|
|
260
|
+
stdoutLen: number;
|
|
261
|
+
stderrLen: number;
|
|
262
|
+
}>;
|
|
263
|
+
export declare const hookSkippedEventSchema: z.ZodObject<{
|
|
264
|
+
id: z.ZodString;
|
|
265
|
+
sessionId: z.ZodString;
|
|
266
|
+
timestamp: z.ZodString;
|
|
267
|
+
} & {
|
|
268
|
+
type: z.ZodLiteral<"hook.skipped">;
|
|
269
|
+
event: z.ZodEnum<["SessionStart", "UserPromptSubmit", "PreToolUse", "PermissionRequest", "PostToolUse", "PostToolUseFailure", "Stop", "SessionEnd"]>;
|
|
270
|
+
reason: z.ZodEnum<["dedup", "no-match", "untrusted-project"]>;
|
|
271
|
+
}, "strip", z.ZodTypeAny, {
|
|
272
|
+
type: "hook.skipped";
|
|
273
|
+
id: string;
|
|
274
|
+
reason: "dedup" | "no-match" | "untrusted-project";
|
|
275
|
+
timestamp: string;
|
|
276
|
+
sessionId: string;
|
|
277
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
278
|
+
}, {
|
|
279
|
+
type: "hook.skipped";
|
|
280
|
+
id: string;
|
|
281
|
+
reason: "dedup" | "no-match" | "untrusted-project";
|
|
282
|
+
timestamp: string;
|
|
283
|
+
sessionId: string;
|
|
284
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
285
|
+
}>;
|
|
286
|
+
export declare const compactionTierSchema: z.ZodEnum<["microcompact", "cached_microcompact", "reactive_summary", "session_memory", "full_compaction", "reset"]>;
|
|
287
|
+
export declare const compactionStartedEventSchema: z.ZodObject<{
|
|
288
|
+
id: z.ZodString;
|
|
289
|
+
sessionId: z.ZodString;
|
|
290
|
+
timestamp: z.ZodString;
|
|
291
|
+
} & {
|
|
292
|
+
type: z.ZodLiteral<"compaction.started">;
|
|
293
|
+
tier: z.ZodEnum<["microcompact", "cached_microcompact", "reactive_summary", "session_memory", "full_compaction", "reset"]>;
|
|
294
|
+
trigger: z.ZodObject<{
|
|
295
|
+
budgetUsed: z.ZodNumber;
|
|
296
|
+
budgetMax: z.ZodNumber;
|
|
297
|
+
}, "strip", z.ZodTypeAny, {
|
|
298
|
+
budgetUsed: number;
|
|
299
|
+
budgetMax: number;
|
|
300
|
+
}, {
|
|
301
|
+
budgetUsed: number;
|
|
302
|
+
budgetMax: number;
|
|
303
|
+
}>;
|
|
304
|
+
}, "strip", z.ZodTypeAny, {
|
|
305
|
+
type: "compaction.started";
|
|
306
|
+
id: string;
|
|
307
|
+
timestamp: string;
|
|
308
|
+
sessionId: string;
|
|
309
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
310
|
+
trigger: {
|
|
311
|
+
budgetUsed: number;
|
|
312
|
+
budgetMax: number;
|
|
313
|
+
};
|
|
314
|
+
}, {
|
|
315
|
+
type: "compaction.started";
|
|
316
|
+
id: string;
|
|
317
|
+
timestamp: string;
|
|
318
|
+
sessionId: string;
|
|
319
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
320
|
+
trigger: {
|
|
321
|
+
budgetUsed: number;
|
|
322
|
+
budgetMax: number;
|
|
323
|
+
};
|
|
324
|
+
}>;
|
|
325
|
+
export declare const compactionCompletedEventSchema: z.ZodObject<{
|
|
326
|
+
id: z.ZodString;
|
|
327
|
+
sessionId: z.ZodString;
|
|
328
|
+
timestamp: z.ZodString;
|
|
329
|
+
} & {
|
|
330
|
+
type: z.ZodLiteral<"compaction.completed">;
|
|
331
|
+
tier: z.ZodEnum<["microcompact", "cached_microcompact", "reactive_summary", "session_memory", "full_compaction", "reset"]>;
|
|
332
|
+
bytesReclaimed: z.ZodNumber;
|
|
333
|
+
newContextSize: z.ZodNumber;
|
|
334
|
+
artifactsCreated: z.ZodArray<z.ZodObject<{
|
|
335
|
+
sha256: z.ZodString;
|
|
336
|
+
size: z.ZodNumber;
|
|
337
|
+
producedBy: z.ZodString;
|
|
338
|
+
}, "strip", z.ZodTypeAny, {
|
|
339
|
+
sha256: string;
|
|
340
|
+
size: number;
|
|
341
|
+
producedBy: string;
|
|
342
|
+
}, {
|
|
343
|
+
sha256: string;
|
|
344
|
+
size: number;
|
|
345
|
+
producedBy: string;
|
|
346
|
+
}>, "many">;
|
|
347
|
+
}, "strip", z.ZodTypeAny, {
|
|
348
|
+
type: "compaction.completed";
|
|
349
|
+
id: string;
|
|
350
|
+
timestamp: string;
|
|
351
|
+
sessionId: string;
|
|
352
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
353
|
+
bytesReclaimed: number;
|
|
354
|
+
newContextSize: number;
|
|
355
|
+
artifactsCreated: {
|
|
356
|
+
sha256: string;
|
|
357
|
+
size: number;
|
|
358
|
+
producedBy: string;
|
|
359
|
+
}[];
|
|
360
|
+
}, {
|
|
361
|
+
type: "compaction.completed";
|
|
362
|
+
id: string;
|
|
363
|
+
timestamp: string;
|
|
364
|
+
sessionId: string;
|
|
365
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
366
|
+
bytesReclaimed: number;
|
|
367
|
+
newContextSize: number;
|
|
368
|
+
artifactsCreated: {
|
|
369
|
+
sha256: string;
|
|
370
|
+
size: number;
|
|
371
|
+
producedBy: string;
|
|
372
|
+
}[];
|
|
373
|
+
}>;
|
|
374
|
+
export declare const compactionSkippedEventSchema: z.ZodObject<{
|
|
375
|
+
id: z.ZodString;
|
|
376
|
+
sessionId: z.ZodString;
|
|
377
|
+
timestamp: z.ZodString;
|
|
378
|
+
} & {
|
|
379
|
+
type: z.ZodLiteral<"compaction.skipped">;
|
|
380
|
+
tier: z.ZodEnum<["microcompact", "cached_microcompact", "reactive_summary", "session_memory", "full_compaction", "reset"]>;
|
|
381
|
+
reason: z.ZodString;
|
|
382
|
+
}, "strip", z.ZodTypeAny, {
|
|
383
|
+
type: "compaction.skipped";
|
|
384
|
+
id: string;
|
|
385
|
+
reason: string;
|
|
386
|
+
timestamp: string;
|
|
387
|
+
sessionId: string;
|
|
388
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
389
|
+
}, {
|
|
390
|
+
type: "compaction.skipped";
|
|
391
|
+
id: string;
|
|
392
|
+
reason: string;
|
|
393
|
+
timestamp: string;
|
|
394
|
+
sessionId: string;
|
|
395
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
396
|
+
}>;
|
|
397
|
+
export declare const compactionInvariantViolatedEventSchema: z.ZodObject<{
|
|
398
|
+
id: z.ZodString;
|
|
399
|
+
sessionId: z.ZodString;
|
|
400
|
+
timestamp: z.ZodString;
|
|
401
|
+
} & {
|
|
402
|
+
type: z.ZodLiteral<"compaction.invariant_violated">;
|
|
403
|
+
invariant: z.ZodEnum<["secrets-never-summarize", "open-decisions-preserved", "artifact-refs-resolvable", "static-hash-unchanged"]>;
|
|
404
|
+
evidence: z.ZodString;
|
|
405
|
+
artifactRef: z.ZodOptional<z.ZodString>;
|
|
406
|
+
}, "strip", z.ZodTypeAny, {
|
|
407
|
+
type: "compaction.invariant_violated";
|
|
408
|
+
id: string;
|
|
409
|
+
timestamp: string;
|
|
410
|
+
sessionId: string;
|
|
411
|
+
invariant: "secrets-never-summarize" | "open-decisions-preserved" | "artifact-refs-resolvable" | "static-hash-unchanged";
|
|
412
|
+
evidence: string;
|
|
413
|
+
artifactRef?: string | undefined;
|
|
414
|
+
}, {
|
|
415
|
+
type: "compaction.invariant_violated";
|
|
416
|
+
id: string;
|
|
417
|
+
timestamp: string;
|
|
418
|
+
sessionId: string;
|
|
419
|
+
invariant: "secrets-never-summarize" | "open-decisions-preserved" | "artifact-refs-resolvable" | "static-hash-unchanged";
|
|
420
|
+
evidence: string;
|
|
421
|
+
artifactRef?: string | undefined;
|
|
422
|
+
}>;
|
|
423
|
+
/**
|
|
424
|
+
* Subagent lifecycle events. Extended in Sprint a5.4 (M1 gap remediation D)
|
|
425
|
+
* so dispatcher activity surfaces in the same `.pugi/events.jsonl` audit
|
|
426
|
+
* stream as tool calls, hooks, and compactions. The dispatcher
|
|
427
|
+
* implementation lives in `apps/pugi-cli/src/core/subagents/dispatcher.ts`;
|
|
428
|
+
* the wire-level shape and role/isolation enums are defined in
|
|
429
|
+
* `subagent-contracts.ts` and re-used here so a single source of truth
|
|
430
|
+
* governs validation on both sides of the boundary.
|
|
431
|
+
*/
|
|
432
|
+
export declare const subagentSpawnedAuditEventSchema: z.ZodObject<{
|
|
433
|
+
id: z.ZodString;
|
|
434
|
+
sessionId: z.ZodString;
|
|
435
|
+
timestamp: z.ZodString;
|
|
436
|
+
} & {
|
|
437
|
+
type: z.ZodLiteral<"subagent.spawned">;
|
|
438
|
+
taskId: z.ZodString;
|
|
439
|
+
role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
|
|
440
|
+
personaSlug: z.ZodString;
|
|
441
|
+
parentSessionId: z.ZodString;
|
|
442
|
+
isolation: z.ZodEnum<["prompt_only", "shared_fs_readonly", "shared_fs_serialized", "worktree", "remote_vm"]>;
|
|
443
|
+
}, "strip", z.ZodTypeAny, {
|
|
444
|
+
type: "subagent.spawned";
|
|
445
|
+
id: string;
|
|
446
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
447
|
+
taskId: string;
|
|
448
|
+
personaSlug: string;
|
|
449
|
+
parentSessionId: string;
|
|
450
|
+
isolation: "prompt_only" | "shared_fs_readonly" | "shared_fs_serialized" | "worktree" | "remote_vm";
|
|
451
|
+
timestamp: string;
|
|
452
|
+
sessionId: string;
|
|
453
|
+
}, {
|
|
454
|
+
type: "subagent.spawned";
|
|
455
|
+
id: string;
|
|
456
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
457
|
+
taskId: string;
|
|
458
|
+
personaSlug: string;
|
|
459
|
+
parentSessionId: string;
|
|
460
|
+
isolation: "prompt_only" | "shared_fs_readonly" | "shared_fs_serialized" | "worktree" | "remote_vm";
|
|
461
|
+
timestamp: string;
|
|
462
|
+
sessionId: string;
|
|
463
|
+
}>;
|
|
464
|
+
export declare const subagentToolCallAuditEventSchema: z.ZodObject<{
|
|
465
|
+
id: z.ZodString;
|
|
466
|
+
sessionId: z.ZodString;
|
|
467
|
+
timestamp: z.ZodString;
|
|
468
|
+
} & {
|
|
469
|
+
type: z.ZodLiteral<"subagent.tool_call">;
|
|
470
|
+
taskId: z.ZodString;
|
|
471
|
+
role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
|
|
472
|
+
personaSlug: z.ZodString;
|
|
473
|
+
toolName: z.ZodString;
|
|
474
|
+
toolCallId: z.ZodString;
|
|
475
|
+
}, "strip", z.ZodTypeAny, {
|
|
476
|
+
type: "subagent.tool_call";
|
|
477
|
+
id: string;
|
|
478
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
479
|
+
taskId: string;
|
|
480
|
+
personaSlug: string;
|
|
481
|
+
timestamp: string;
|
|
482
|
+
toolName: string;
|
|
483
|
+
toolCallId: string;
|
|
484
|
+
sessionId: string;
|
|
485
|
+
}, {
|
|
486
|
+
type: "subagent.tool_call";
|
|
487
|
+
id: string;
|
|
488
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
489
|
+
taskId: string;
|
|
490
|
+
personaSlug: string;
|
|
491
|
+
timestamp: string;
|
|
492
|
+
toolName: string;
|
|
493
|
+
toolCallId: string;
|
|
494
|
+
sessionId: string;
|
|
495
|
+
}>;
|
|
496
|
+
export declare const subagentCompletedAuditEventSchema: z.ZodObject<{
|
|
497
|
+
id: z.ZodString;
|
|
498
|
+
sessionId: z.ZodString;
|
|
499
|
+
timestamp: z.ZodString;
|
|
500
|
+
} & {
|
|
501
|
+
type: z.ZodLiteral<"subagent.completed">;
|
|
502
|
+
taskId: z.ZodString;
|
|
503
|
+
role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
|
|
504
|
+
personaSlug: z.ZodString;
|
|
505
|
+
toolCallCount: z.ZodNumber;
|
|
506
|
+
tokensIn: z.ZodNumber;
|
|
507
|
+
tokensOut: z.ZodNumber;
|
|
508
|
+
durationMs: z.ZodNumber;
|
|
509
|
+
}, "strip", z.ZodTypeAny, {
|
|
510
|
+
type: "subagent.completed";
|
|
511
|
+
id: string;
|
|
512
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
513
|
+
taskId: string;
|
|
514
|
+
personaSlug: string;
|
|
515
|
+
toolCallCount: number;
|
|
516
|
+
tokensIn: number;
|
|
517
|
+
tokensOut: number;
|
|
518
|
+
durationMs: number;
|
|
519
|
+
timestamp: string;
|
|
520
|
+
sessionId: string;
|
|
521
|
+
}, {
|
|
522
|
+
type: "subagent.completed";
|
|
523
|
+
id: string;
|
|
524
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
525
|
+
taskId: string;
|
|
526
|
+
personaSlug: string;
|
|
527
|
+
toolCallCount: number;
|
|
528
|
+
tokensIn: number;
|
|
529
|
+
tokensOut: number;
|
|
530
|
+
durationMs: number;
|
|
531
|
+
timestamp: string;
|
|
532
|
+
sessionId: string;
|
|
533
|
+
}>;
|
|
534
|
+
export declare const subagentBlockedAuditEventSchema: z.ZodObject<{
|
|
535
|
+
id: z.ZodString;
|
|
536
|
+
sessionId: z.ZodString;
|
|
537
|
+
timestamp: z.ZodString;
|
|
538
|
+
} & {
|
|
539
|
+
type: z.ZodLiteral<"subagent.blocked">;
|
|
540
|
+
taskId: z.ZodString;
|
|
541
|
+
role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
|
|
542
|
+
personaSlug: z.ZodString;
|
|
543
|
+
reason: z.ZodEnum<["budget_exhausted", "plan_mode_refused", "permission_denied", "tool_unavailable"]>;
|
|
544
|
+
detail: z.ZodString;
|
|
545
|
+
}, "strip", z.ZodTypeAny, {
|
|
546
|
+
type: "subagent.blocked";
|
|
547
|
+
id: string;
|
|
548
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
549
|
+
taskId: string;
|
|
550
|
+
personaSlug: string;
|
|
551
|
+
reason: "budget_exhausted" | "plan_mode_refused" | "permission_denied" | "tool_unavailable";
|
|
552
|
+
timestamp: string;
|
|
553
|
+
detail: string;
|
|
554
|
+
sessionId: string;
|
|
555
|
+
}, {
|
|
556
|
+
type: "subagent.blocked";
|
|
557
|
+
id: string;
|
|
558
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
559
|
+
taskId: string;
|
|
560
|
+
personaSlug: string;
|
|
561
|
+
reason: "budget_exhausted" | "plan_mode_refused" | "permission_denied" | "tool_unavailable";
|
|
562
|
+
timestamp: string;
|
|
563
|
+
detail: string;
|
|
564
|
+
sessionId: string;
|
|
565
|
+
}>;
|
|
566
|
+
export declare const subagentFailedAuditEventSchema: z.ZodObject<{
|
|
567
|
+
id: z.ZodString;
|
|
568
|
+
sessionId: z.ZodString;
|
|
569
|
+
timestamp: z.ZodString;
|
|
570
|
+
} & {
|
|
571
|
+
type: z.ZodLiteral<"subagent.failed">;
|
|
572
|
+
taskId: z.ZodString;
|
|
573
|
+
role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
|
|
574
|
+
personaSlug: z.ZodString;
|
|
575
|
+
error: z.ZodString;
|
|
576
|
+
}, "strip", z.ZodTypeAny, {
|
|
577
|
+
type: "subagent.failed";
|
|
578
|
+
id: string;
|
|
579
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
580
|
+
taskId: string;
|
|
581
|
+
personaSlug: string;
|
|
582
|
+
timestamp: string;
|
|
583
|
+
error: string;
|
|
584
|
+
sessionId: string;
|
|
585
|
+
}, {
|
|
586
|
+
type: "subagent.failed";
|
|
587
|
+
id: string;
|
|
588
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
589
|
+
taskId: string;
|
|
590
|
+
personaSlug: string;
|
|
591
|
+
timestamp: string;
|
|
592
|
+
error: string;
|
|
593
|
+
sessionId: string;
|
|
594
|
+
}>;
|
|
202
595
|
export declare const auditEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
203
596
|
id: z.ZodString;
|
|
204
597
|
sessionId: z.ZodString;
|
|
@@ -211,17 +604,17 @@ export declare const auditEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
|
|
|
211
604
|
}, "strip", z.ZodTypeAny, {
|
|
212
605
|
type: "session";
|
|
213
606
|
id: string;
|
|
214
|
-
name: "created" | "command_started" | "command_completed";
|
|
215
|
-
sessionId: string;
|
|
216
607
|
timestamp: string;
|
|
608
|
+
sessionId: string;
|
|
609
|
+
name: "created" | "command_started" | "command_completed";
|
|
217
610
|
status?: "error" | "success" | undefined;
|
|
218
611
|
command?: string | undefined;
|
|
219
612
|
}, {
|
|
220
613
|
type: "session";
|
|
221
614
|
id: string;
|
|
222
|
-
name: "created" | "command_started" | "command_completed";
|
|
223
|
-
sessionId: string;
|
|
224
615
|
timestamp: string;
|
|
616
|
+
sessionId: string;
|
|
617
|
+
name: "created" | "command_started" | "command_completed";
|
|
225
618
|
status?: "error" | "success" | undefined;
|
|
226
619
|
command?: string | undefined;
|
|
227
620
|
}>, z.ZodObject<{
|
|
@@ -238,13 +631,13 @@ export declare const auditEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
|
|
|
238
631
|
source: z.ZodString;
|
|
239
632
|
expiresAt: z.ZodOptional<z.ZodString>;
|
|
240
633
|
}, "strip", z.ZodTypeAny, {
|
|
241
|
-
reason: string;
|
|
242
634
|
decision: "allow";
|
|
635
|
+
reason: string;
|
|
243
636
|
source: string;
|
|
244
637
|
expiresAt?: string | undefined;
|
|
245
638
|
}, {
|
|
246
|
-
reason: string;
|
|
247
639
|
decision: "allow";
|
|
640
|
+
reason: string;
|
|
248
641
|
source: string;
|
|
249
642
|
expiresAt?: string | undefined;
|
|
250
643
|
}>, z.ZodObject<{
|
|
@@ -252,66 +645,66 @@ export declare const auditEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
|
|
|
252
645
|
reason: z.ZodString;
|
|
253
646
|
risk: z.ZodEnum<["low", "medium", "high"]>;
|
|
254
647
|
}, "strip", z.ZodTypeAny, {
|
|
255
|
-
reason: string;
|
|
256
648
|
decision: "ask";
|
|
649
|
+
reason: string;
|
|
257
650
|
risk: "low" | "medium" | "high";
|
|
258
651
|
}, {
|
|
259
|
-
reason: string;
|
|
260
652
|
decision: "ask";
|
|
653
|
+
reason: string;
|
|
261
654
|
risk: "low" | "medium" | "high";
|
|
262
655
|
}>, z.ZodObject<{
|
|
263
656
|
decision: z.ZodLiteral<"deny">;
|
|
264
657
|
reason: z.ZodString;
|
|
265
658
|
source: z.ZodString;
|
|
266
659
|
}, "strip", z.ZodTypeAny, {
|
|
267
|
-
reason: string;
|
|
268
660
|
decision: "deny";
|
|
661
|
+
reason: string;
|
|
269
662
|
source: string;
|
|
270
663
|
}, {
|
|
271
|
-
reason: string;
|
|
272
664
|
decision: "deny";
|
|
665
|
+
reason: string;
|
|
273
666
|
source: string;
|
|
274
667
|
}>]>>;
|
|
275
668
|
}, "strip", z.ZodTypeAny, {
|
|
276
669
|
type: "tool_call";
|
|
277
|
-
tool: string;
|
|
278
670
|
id: string;
|
|
279
|
-
sessionId: string;
|
|
280
671
|
timestamp: string;
|
|
672
|
+
sessionId: string;
|
|
673
|
+
tool: string;
|
|
281
674
|
inputSummary: string;
|
|
282
675
|
permissionDecision?: {
|
|
283
|
-
reason: string;
|
|
284
676
|
decision: "allow";
|
|
677
|
+
reason: string;
|
|
285
678
|
source: string;
|
|
286
679
|
expiresAt?: string | undefined;
|
|
287
680
|
} | {
|
|
288
|
-
reason: string;
|
|
289
681
|
decision: "ask";
|
|
682
|
+
reason: string;
|
|
290
683
|
risk: "low" | "medium" | "high";
|
|
291
684
|
} | {
|
|
292
|
-
reason: string;
|
|
293
685
|
decision: "deny";
|
|
686
|
+
reason: string;
|
|
294
687
|
source: string;
|
|
295
688
|
} | undefined;
|
|
296
689
|
}, {
|
|
297
690
|
type: "tool_call";
|
|
298
|
-
tool: string;
|
|
299
691
|
id: string;
|
|
300
|
-
sessionId: string;
|
|
301
692
|
timestamp: string;
|
|
693
|
+
sessionId: string;
|
|
694
|
+
tool: string;
|
|
302
695
|
inputSummary: string;
|
|
303
696
|
permissionDecision?: {
|
|
304
|
-
reason: string;
|
|
305
697
|
decision: "allow";
|
|
698
|
+
reason: string;
|
|
306
699
|
source: string;
|
|
307
700
|
expiresAt?: string | undefined;
|
|
308
701
|
} | {
|
|
309
|
-
reason: string;
|
|
310
702
|
decision: "ask";
|
|
703
|
+
reason: string;
|
|
311
704
|
risk: "low" | "medium" | "high";
|
|
312
705
|
} | {
|
|
313
|
-
reason: string;
|
|
314
706
|
decision: "deny";
|
|
707
|
+
reason: string;
|
|
315
708
|
source: string;
|
|
316
709
|
} | undefined;
|
|
317
710
|
}>, z.ZodObject<{
|
|
@@ -326,20 +719,20 @@ export declare const auditEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
|
|
|
326
719
|
outputRef: z.ZodOptional<z.ZodString>;
|
|
327
720
|
}, "strip", z.ZodTypeAny, {
|
|
328
721
|
type: "tool_result";
|
|
329
|
-
status: "
|
|
722
|
+
status: "cancelled" | "error" | "success";
|
|
330
723
|
id: string;
|
|
724
|
+
timestamp: string;
|
|
331
725
|
toolCallId: string;
|
|
332
726
|
sessionId: string;
|
|
333
|
-
timestamp: string;
|
|
334
727
|
outputSummary: string;
|
|
335
728
|
outputRef?: string | undefined;
|
|
336
729
|
}, {
|
|
337
730
|
type: "tool_result";
|
|
338
|
-
status: "
|
|
731
|
+
status: "cancelled" | "error" | "success";
|
|
339
732
|
id: string;
|
|
733
|
+
timestamp: string;
|
|
340
734
|
toolCallId: string;
|
|
341
735
|
sessionId: string;
|
|
342
|
-
timestamp: string;
|
|
343
736
|
outputSummary: string;
|
|
344
737
|
outputRef?: string | undefined;
|
|
345
738
|
}>, z.ZodObject<{
|
|
@@ -360,9 +753,9 @@ export declare const auditEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
|
|
|
360
753
|
path: string;
|
|
361
754
|
type: "file_mutation";
|
|
362
755
|
id: string;
|
|
756
|
+
timestamp: string;
|
|
363
757
|
toolCallId: string;
|
|
364
758
|
sessionId: string;
|
|
365
|
-
timestamp: string;
|
|
366
759
|
operation: "create" | "update" | "delete" | "move";
|
|
367
760
|
beforeBlob?: string | undefined;
|
|
368
761
|
afterBlob?: string | undefined;
|
|
@@ -373,15 +766,396 @@ export declare const auditEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
|
|
|
373
766
|
path: string;
|
|
374
767
|
type: "file_mutation";
|
|
375
768
|
id: string;
|
|
769
|
+
timestamp: string;
|
|
376
770
|
toolCallId: string;
|
|
377
771
|
sessionId: string;
|
|
378
|
-
timestamp: string;
|
|
379
772
|
operation: "create" | "update" | "delete" | "move";
|
|
380
773
|
beforeBlob?: string | undefined;
|
|
381
774
|
afterBlob?: string | undefined;
|
|
382
775
|
beforeHash?: string | undefined;
|
|
383
776
|
afterHash?: string | undefined;
|
|
384
777
|
diffRef?: string | undefined;
|
|
778
|
+
}>, z.ZodObject<{
|
|
779
|
+
id: z.ZodString;
|
|
780
|
+
sessionId: z.ZodString;
|
|
781
|
+
timestamp: z.ZodString;
|
|
782
|
+
} & {
|
|
783
|
+
type: z.ZodLiteral<"hook.invoked">;
|
|
784
|
+
event: z.ZodEnum<["SessionStart", "UserPromptSubmit", "PreToolUse", "PermissionRequest", "PostToolUse", "PostToolUseFailure", "Stop", "SessionEnd"]>;
|
|
785
|
+
matchSummary: z.ZodString;
|
|
786
|
+
runSummary: z.ZodString;
|
|
787
|
+
}, "strip", z.ZodTypeAny, {
|
|
788
|
+
type: "hook.invoked";
|
|
789
|
+
id: string;
|
|
790
|
+
timestamp: string;
|
|
791
|
+
sessionId: string;
|
|
792
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
793
|
+
matchSummary: string;
|
|
794
|
+
runSummary: string;
|
|
795
|
+
}, {
|
|
796
|
+
type: "hook.invoked";
|
|
797
|
+
id: string;
|
|
798
|
+
timestamp: string;
|
|
799
|
+
sessionId: string;
|
|
800
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
801
|
+
matchSummary: string;
|
|
802
|
+
runSummary: string;
|
|
803
|
+
}>, z.ZodObject<{
|
|
804
|
+
id: z.ZodString;
|
|
805
|
+
sessionId: z.ZodString;
|
|
806
|
+
timestamp: z.ZodString;
|
|
807
|
+
} & {
|
|
808
|
+
type: z.ZodLiteral<"hook.result">;
|
|
809
|
+
event: z.ZodEnum<["SessionStart", "UserPromptSubmit", "PreToolUse", "PermissionRequest", "PostToolUse", "PostToolUseFailure", "Stop", "SessionEnd"]>;
|
|
810
|
+
ok: z.ZodBoolean;
|
|
811
|
+
exitCode: z.ZodNumber;
|
|
812
|
+
elapsedMs: z.ZodNumber;
|
|
813
|
+
stdoutLen: z.ZodNumber;
|
|
814
|
+
stderrLen: z.ZodNumber;
|
|
815
|
+
}, "strip", z.ZodTypeAny, {
|
|
816
|
+
type: "hook.result";
|
|
817
|
+
id: string;
|
|
818
|
+
timestamp: string;
|
|
819
|
+
sessionId: string;
|
|
820
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
821
|
+
ok: boolean;
|
|
822
|
+
exitCode: number;
|
|
823
|
+
elapsedMs: number;
|
|
824
|
+
stdoutLen: number;
|
|
825
|
+
stderrLen: number;
|
|
826
|
+
}, {
|
|
827
|
+
type: "hook.result";
|
|
828
|
+
id: string;
|
|
829
|
+
timestamp: string;
|
|
830
|
+
sessionId: string;
|
|
831
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
832
|
+
ok: boolean;
|
|
833
|
+
exitCode: number;
|
|
834
|
+
elapsedMs: number;
|
|
835
|
+
stdoutLen: number;
|
|
836
|
+
stderrLen: number;
|
|
837
|
+
}>, z.ZodObject<{
|
|
838
|
+
id: z.ZodString;
|
|
839
|
+
sessionId: z.ZodString;
|
|
840
|
+
timestamp: z.ZodString;
|
|
841
|
+
} & {
|
|
842
|
+
type: z.ZodLiteral<"hook.skipped">;
|
|
843
|
+
event: z.ZodEnum<["SessionStart", "UserPromptSubmit", "PreToolUse", "PermissionRequest", "PostToolUse", "PostToolUseFailure", "Stop", "SessionEnd"]>;
|
|
844
|
+
reason: z.ZodEnum<["dedup", "no-match", "untrusted-project"]>;
|
|
845
|
+
}, "strip", z.ZodTypeAny, {
|
|
846
|
+
type: "hook.skipped";
|
|
847
|
+
id: string;
|
|
848
|
+
reason: "dedup" | "no-match" | "untrusted-project";
|
|
849
|
+
timestamp: string;
|
|
850
|
+
sessionId: string;
|
|
851
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
852
|
+
}, {
|
|
853
|
+
type: "hook.skipped";
|
|
854
|
+
id: string;
|
|
855
|
+
reason: "dedup" | "no-match" | "untrusted-project";
|
|
856
|
+
timestamp: string;
|
|
857
|
+
sessionId: string;
|
|
858
|
+
event: "SessionStart" | "UserPromptSubmit" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Stop" | "SessionEnd";
|
|
859
|
+
}>, z.ZodObject<{
|
|
860
|
+
id: z.ZodString;
|
|
861
|
+
sessionId: z.ZodString;
|
|
862
|
+
timestamp: z.ZodString;
|
|
863
|
+
} & {
|
|
864
|
+
type: z.ZodLiteral<"compaction.started">;
|
|
865
|
+
tier: z.ZodEnum<["microcompact", "cached_microcompact", "reactive_summary", "session_memory", "full_compaction", "reset"]>;
|
|
866
|
+
trigger: z.ZodObject<{
|
|
867
|
+
budgetUsed: z.ZodNumber;
|
|
868
|
+
budgetMax: z.ZodNumber;
|
|
869
|
+
}, "strip", z.ZodTypeAny, {
|
|
870
|
+
budgetUsed: number;
|
|
871
|
+
budgetMax: number;
|
|
872
|
+
}, {
|
|
873
|
+
budgetUsed: number;
|
|
874
|
+
budgetMax: number;
|
|
875
|
+
}>;
|
|
876
|
+
}, "strip", z.ZodTypeAny, {
|
|
877
|
+
type: "compaction.started";
|
|
878
|
+
id: string;
|
|
879
|
+
timestamp: string;
|
|
880
|
+
sessionId: string;
|
|
881
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
882
|
+
trigger: {
|
|
883
|
+
budgetUsed: number;
|
|
884
|
+
budgetMax: number;
|
|
885
|
+
};
|
|
886
|
+
}, {
|
|
887
|
+
type: "compaction.started";
|
|
888
|
+
id: string;
|
|
889
|
+
timestamp: string;
|
|
890
|
+
sessionId: string;
|
|
891
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
892
|
+
trigger: {
|
|
893
|
+
budgetUsed: number;
|
|
894
|
+
budgetMax: number;
|
|
895
|
+
};
|
|
896
|
+
}>, z.ZodObject<{
|
|
897
|
+
id: z.ZodString;
|
|
898
|
+
sessionId: z.ZodString;
|
|
899
|
+
timestamp: z.ZodString;
|
|
900
|
+
} & {
|
|
901
|
+
type: z.ZodLiteral<"compaction.completed">;
|
|
902
|
+
tier: z.ZodEnum<["microcompact", "cached_microcompact", "reactive_summary", "session_memory", "full_compaction", "reset"]>;
|
|
903
|
+
bytesReclaimed: z.ZodNumber;
|
|
904
|
+
newContextSize: z.ZodNumber;
|
|
905
|
+
artifactsCreated: z.ZodArray<z.ZodObject<{
|
|
906
|
+
sha256: z.ZodString;
|
|
907
|
+
size: z.ZodNumber;
|
|
908
|
+
producedBy: z.ZodString;
|
|
909
|
+
}, "strip", z.ZodTypeAny, {
|
|
910
|
+
sha256: string;
|
|
911
|
+
size: number;
|
|
912
|
+
producedBy: string;
|
|
913
|
+
}, {
|
|
914
|
+
sha256: string;
|
|
915
|
+
size: number;
|
|
916
|
+
producedBy: string;
|
|
917
|
+
}>, "many">;
|
|
918
|
+
}, "strip", z.ZodTypeAny, {
|
|
919
|
+
type: "compaction.completed";
|
|
920
|
+
id: string;
|
|
921
|
+
timestamp: string;
|
|
922
|
+
sessionId: string;
|
|
923
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
924
|
+
bytesReclaimed: number;
|
|
925
|
+
newContextSize: number;
|
|
926
|
+
artifactsCreated: {
|
|
927
|
+
sha256: string;
|
|
928
|
+
size: number;
|
|
929
|
+
producedBy: string;
|
|
930
|
+
}[];
|
|
931
|
+
}, {
|
|
932
|
+
type: "compaction.completed";
|
|
933
|
+
id: string;
|
|
934
|
+
timestamp: string;
|
|
935
|
+
sessionId: string;
|
|
936
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
937
|
+
bytesReclaimed: number;
|
|
938
|
+
newContextSize: number;
|
|
939
|
+
artifactsCreated: {
|
|
940
|
+
sha256: string;
|
|
941
|
+
size: number;
|
|
942
|
+
producedBy: string;
|
|
943
|
+
}[];
|
|
944
|
+
}>, z.ZodObject<{
|
|
945
|
+
id: z.ZodString;
|
|
946
|
+
sessionId: z.ZodString;
|
|
947
|
+
timestamp: z.ZodString;
|
|
948
|
+
} & {
|
|
949
|
+
type: z.ZodLiteral<"compaction.skipped">;
|
|
950
|
+
tier: z.ZodEnum<["microcompact", "cached_microcompact", "reactive_summary", "session_memory", "full_compaction", "reset"]>;
|
|
951
|
+
reason: z.ZodString;
|
|
952
|
+
}, "strip", z.ZodTypeAny, {
|
|
953
|
+
type: "compaction.skipped";
|
|
954
|
+
id: string;
|
|
955
|
+
reason: string;
|
|
956
|
+
timestamp: string;
|
|
957
|
+
sessionId: string;
|
|
958
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
959
|
+
}, {
|
|
960
|
+
type: "compaction.skipped";
|
|
961
|
+
id: string;
|
|
962
|
+
reason: string;
|
|
963
|
+
timestamp: string;
|
|
964
|
+
sessionId: string;
|
|
965
|
+
tier: "microcompact" | "cached_microcompact" | "reactive_summary" | "session_memory" | "full_compaction" | "reset";
|
|
966
|
+
}>, z.ZodObject<{
|
|
967
|
+
id: z.ZodString;
|
|
968
|
+
sessionId: z.ZodString;
|
|
969
|
+
timestamp: z.ZodString;
|
|
970
|
+
} & {
|
|
971
|
+
type: z.ZodLiteral<"compaction.invariant_violated">;
|
|
972
|
+
invariant: z.ZodEnum<["secrets-never-summarize", "open-decisions-preserved", "artifact-refs-resolvable", "static-hash-unchanged"]>;
|
|
973
|
+
evidence: z.ZodString;
|
|
974
|
+
artifactRef: z.ZodOptional<z.ZodString>;
|
|
975
|
+
}, "strip", z.ZodTypeAny, {
|
|
976
|
+
type: "compaction.invariant_violated";
|
|
977
|
+
id: string;
|
|
978
|
+
timestamp: string;
|
|
979
|
+
sessionId: string;
|
|
980
|
+
invariant: "secrets-never-summarize" | "open-decisions-preserved" | "artifact-refs-resolvable" | "static-hash-unchanged";
|
|
981
|
+
evidence: string;
|
|
982
|
+
artifactRef?: string | undefined;
|
|
983
|
+
}, {
|
|
984
|
+
type: "compaction.invariant_violated";
|
|
985
|
+
id: string;
|
|
986
|
+
timestamp: string;
|
|
987
|
+
sessionId: string;
|
|
988
|
+
invariant: "secrets-never-summarize" | "open-decisions-preserved" | "artifact-refs-resolvable" | "static-hash-unchanged";
|
|
989
|
+
evidence: string;
|
|
990
|
+
artifactRef?: string | undefined;
|
|
991
|
+
}>, z.ZodObject<{
|
|
992
|
+
id: z.ZodString;
|
|
993
|
+
sessionId: z.ZodString;
|
|
994
|
+
timestamp: z.ZodString;
|
|
995
|
+
} & {
|
|
996
|
+
type: z.ZodLiteral<"subagent.spawned">;
|
|
997
|
+
taskId: z.ZodString;
|
|
998
|
+
role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
|
|
999
|
+
personaSlug: z.ZodString;
|
|
1000
|
+
parentSessionId: z.ZodString;
|
|
1001
|
+
isolation: z.ZodEnum<["prompt_only", "shared_fs_readonly", "shared_fs_serialized", "worktree", "remote_vm"]>;
|
|
1002
|
+
}, "strip", z.ZodTypeAny, {
|
|
1003
|
+
type: "subagent.spawned";
|
|
1004
|
+
id: string;
|
|
1005
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
1006
|
+
taskId: string;
|
|
1007
|
+
personaSlug: string;
|
|
1008
|
+
parentSessionId: string;
|
|
1009
|
+
isolation: "prompt_only" | "shared_fs_readonly" | "shared_fs_serialized" | "worktree" | "remote_vm";
|
|
1010
|
+
timestamp: string;
|
|
1011
|
+
sessionId: string;
|
|
1012
|
+
}, {
|
|
1013
|
+
type: "subagent.spawned";
|
|
1014
|
+
id: string;
|
|
1015
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
1016
|
+
taskId: string;
|
|
1017
|
+
personaSlug: string;
|
|
1018
|
+
parentSessionId: string;
|
|
1019
|
+
isolation: "prompt_only" | "shared_fs_readonly" | "shared_fs_serialized" | "worktree" | "remote_vm";
|
|
1020
|
+
timestamp: string;
|
|
1021
|
+
sessionId: string;
|
|
1022
|
+
}>, z.ZodObject<{
|
|
1023
|
+
id: z.ZodString;
|
|
1024
|
+
sessionId: z.ZodString;
|
|
1025
|
+
timestamp: z.ZodString;
|
|
1026
|
+
} & {
|
|
1027
|
+
type: z.ZodLiteral<"subagent.tool_call">;
|
|
1028
|
+
taskId: z.ZodString;
|
|
1029
|
+
role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
|
|
1030
|
+
personaSlug: z.ZodString;
|
|
1031
|
+
toolName: z.ZodString;
|
|
1032
|
+
toolCallId: z.ZodString;
|
|
1033
|
+
}, "strip", z.ZodTypeAny, {
|
|
1034
|
+
type: "subagent.tool_call";
|
|
1035
|
+
id: string;
|
|
1036
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
1037
|
+
taskId: string;
|
|
1038
|
+
personaSlug: string;
|
|
1039
|
+
timestamp: string;
|
|
1040
|
+
toolName: string;
|
|
1041
|
+
toolCallId: string;
|
|
1042
|
+
sessionId: string;
|
|
1043
|
+
}, {
|
|
1044
|
+
type: "subagent.tool_call";
|
|
1045
|
+
id: string;
|
|
1046
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
1047
|
+
taskId: string;
|
|
1048
|
+
personaSlug: string;
|
|
1049
|
+
timestamp: string;
|
|
1050
|
+
toolName: string;
|
|
1051
|
+
toolCallId: string;
|
|
1052
|
+
sessionId: string;
|
|
1053
|
+
}>, z.ZodObject<{
|
|
1054
|
+
id: z.ZodString;
|
|
1055
|
+
sessionId: z.ZodString;
|
|
1056
|
+
timestamp: z.ZodString;
|
|
1057
|
+
} & {
|
|
1058
|
+
type: z.ZodLiteral<"subagent.completed">;
|
|
1059
|
+
taskId: z.ZodString;
|
|
1060
|
+
role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
|
|
1061
|
+
personaSlug: z.ZodString;
|
|
1062
|
+
toolCallCount: z.ZodNumber;
|
|
1063
|
+
tokensIn: z.ZodNumber;
|
|
1064
|
+
tokensOut: z.ZodNumber;
|
|
1065
|
+
durationMs: z.ZodNumber;
|
|
1066
|
+
}, "strip", z.ZodTypeAny, {
|
|
1067
|
+
type: "subagent.completed";
|
|
1068
|
+
id: string;
|
|
1069
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
1070
|
+
taskId: string;
|
|
1071
|
+
personaSlug: string;
|
|
1072
|
+
toolCallCount: number;
|
|
1073
|
+
tokensIn: number;
|
|
1074
|
+
tokensOut: number;
|
|
1075
|
+
durationMs: number;
|
|
1076
|
+
timestamp: string;
|
|
1077
|
+
sessionId: string;
|
|
1078
|
+
}, {
|
|
1079
|
+
type: "subagent.completed";
|
|
1080
|
+
id: string;
|
|
1081
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
1082
|
+
taskId: string;
|
|
1083
|
+
personaSlug: string;
|
|
1084
|
+
toolCallCount: number;
|
|
1085
|
+
tokensIn: number;
|
|
1086
|
+
tokensOut: number;
|
|
1087
|
+
durationMs: number;
|
|
1088
|
+
timestamp: string;
|
|
1089
|
+
sessionId: string;
|
|
1090
|
+
}>, z.ZodObject<{
|
|
1091
|
+
id: z.ZodString;
|
|
1092
|
+
sessionId: z.ZodString;
|
|
1093
|
+
timestamp: z.ZodString;
|
|
1094
|
+
} & {
|
|
1095
|
+
type: z.ZodLiteral<"subagent.blocked">;
|
|
1096
|
+
taskId: z.ZodString;
|
|
1097
|
+
role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
|
|
1098
|
+
personaSlug: z.ZodString;
|
|
1099
|
+
reason: z.ZodEnum<["budget_exhausted", "plan_mode_refused", "permission_denied", "tool_unavailable"]>;
|
|
1100
|
+
detail: z.ZodString;
|
|
1101
|
+
}, "strip", z.ZodTypeAny, {
|
|
1102
|
+
type: "subagent.blocked";
|
|
1103
|
+
id: string;
|
|
1104
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
1105
|
+
taskId: string;
|
|
1106
|
+
personaSlug: string;
|
|
1107
|
+
reason: "budget_exhausted" | "plan_mode_refused" | "permission_denied" | "tool_unavailable";
|
|
1108
|
+
timestamp: string;
|
|
1109
|
+
detail: string;
|
|
1110
|
+
sessionId: string;
|
|
1111
|
+
}, {
|
|
1112
|
+
type: "subagent.blocked";
|
|
1113
|
+
id: string;
|
|
1114
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
1115
|
+
taskId: string;
|
|
1116
|
+
personaSlug: string;
|
|
1117
|
+
reason: "budget_exhausted" | "plan_mode_refused" | "permission_denied" | "tool_unavailable";
|
|
1118
|
+
timestamp: string;
|
|
1119
|
+
detail: string;
|
|
1120
|
+
sessionId: string;
|
|
1121
|
+
}>, z.ZodObject<{
|
|
1122
|
+
id: z.ZodString;
|
|
1123
|
+
sessionId: z.ZodString;
|
|
1124
|
+
timestamp: z.ZodString;
|
|
1125
|
+
} & {
|
|
1126
|
+
type: z.ZodLiteral<"subagent.failed">;
|
|
1127
|
+
taskId: z.ZodString;
|
|
1128
|
+
role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
|
|
1129
|
+
personaSlug: z.ZodString;
|
|
1130
|
+
error: z.ZodString;
|
|
1131
|
+
}, "strip", z.ZodTypeAny, {
|
|
1132
|
+
type: "subagent.failed";
|
|
1133
|
+
id: string;
|
|
1134
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
1135
|
+
taskId: string;
|
|
1136
|
+
personaSlug: string;
|
|
1137
|
+
timestamp: string;
|
|
1138
|
+
error: string;
|
|
1139
|
+
sessionId: string;
|
|
1140
|
+
}, {
|
|
1141
|
+
type: "subagent.failed";
|
|
1142
|
+
id: string;
|
|
1143
|
+
role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
|
|
1144
|
+
taskId: string;
|
|
1145
|
+
personaSlug: string;
|
|
1146
|
+
timestamp: string;
|
|
1147
|
+
error: string;
|
|
1148
|
+
sessionId: string;
|
|
385
1149
|
}>]>;
|
|
386
1150
|
export type AuditEvent = z.infer<typeof auditEventSchema>;
|
|
1151
|
+
export type CompactionTier = z.infer<typeof compactionTierSchema>;
|
|
1152
|
+
export type CompactionStartedEvent = z.infer<typeof compactionStartedEventSchema>;
|
|
1153
|
+
export type CompactionCompletedEvent = z.infer<typeof compactionCompletedEventSchema>;
|
|
1154
|
+
export type CompactionSkippedEvent = z.infer<typeof compactionSkippedEventSchema>;
|
|
1155
|
+
export type CompactionInvariantViolatedEvent = z.infer<typeof compactionInvariantViolatedEventSchema>;
|
|
1156
|
+
export type SubagentSpawnedAuditEvent = z.infer<typeof subagentSpawnedAuditEventSchema>;
|
|
1157
|
+
export type SubagentToolCallAuditEvent = z.infer<typeof subagentToolCallAuditEventSchema>;
|
|
1158
|
+
export type SubagentCompletedAuditEvent = z.infer<typeof subagentCompletedAuditEventSchema>;
|
|
1159
|
+
export type SubagentBlockedAuditEvent = z.infer<typeof subagentBlockedAuditEventSchema>;
|
|
1160
|
+
export type SubagentFailedAuditEvent = z.infer<typeof subagentFailedAuditEventSchema>;
|
|
387
1161
|
//# sourceMappingURL=audit-trace.d.ts.map
|