@pugi/sdk 0.1.0-alpha.10

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.
@@ -0,0 +1,1161 @@
1
+ import { z } from 'zod';
2
+ export declare const auditEventBaseSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ sessionId: z.ZodString;
5
+ timestamp: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ id: string;
8
+ timestamp: string;
9
+ sessionId: string;
10
+ }, {
11
+ id: string;
12
+ timestamp: string;
13
+ sessionId: string;
14
+ }>;
15
+ export declare const toolCallEventSchema: z.ZodObject<{
16
+ id: z.ZodString;
17
+ sessionId: z.ZodString;
18
+ timestamp: z.ZodString;
19
+ } & {
20
+ type: z.ZodLiteral<"tool_call">;
21
+ tool: z.ZodString;
22
+ inputSummary: z.ZodString;
23
+ permissionDecision: z.ZodOptional<z.ZodDiscriminatedUnion<"decision", [z.ZodObject<{
24
+ decision: z.ZodLiteral<"allow">;
25
+ reason: z.ZodString;
26
+ source: z.ZodString;
27
+ expiresAt: z.ZodOptional<z.ZodString>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ decision: "allow";
30
+ reason: string;
31
+ source: string;
32
+ expiresAt?: string | undefined;
33
+ }, {
34
+ decision: "allow";
35
+ reason: string;
36
+ source: string;
37
+ expiresAt?: string | undefined;
38
+ }>, z.ZodObject<{
39
+ decision: z.ZodLiteral<"ask">;
40
+ reason: z.ZodString;
41
+ risk: z.ZodEnum<["low", "medium", "high"]>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ decision: "ask";
44
+ reason: string;
45
+ risk: "low" | "medium" | "high";
46
+ }, {
47
+ decision: "ask";
48
+ reason: string;
49
+ risk: "low" | "medium" | "high";
50
+ }>, z.ZodObject<{
51
+ decision: z.ZodLiteral<"deny">;
52
+ reason: z.ZodString;
53
+ source: z.ZodString;
54
+ }, "strip", z.ZodTypeAny, {
55
+ decision: "deny";
56
+ reason: string;
57
+ source: string;
58
+ }, {
59
+ decision: "deny";
60
+ reason: string;
61
+ source: string;
62
+ }>]>>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ type: "tool_call";
65
+ id: string;
66
+ timestamp: string;
67
+ sessionId: string;
68
+ tool: string;
69
+ inputSummary: string;
70
+ permissionDecision?: {
71
+ decision: "allow";
72
+ reason: string;
73
+ source: string;
74
+ expiresAt?: string | undefined;
75
+ } | {
76
+ decision: "ask";
77
+ reason: string;
78
+ risk: "low" | "medium" | "high";
79
+ } | {
80
+ decision: "deny";
81
+ reason: string;
82
+ source: string;
83
+ } | undefined;
84
+ }, {
85
+ type: "tool_call";
86
+ id: string;
87
+ timestamp: string;
88
+ sessionId: string;
89
+ tool: string;
90
+ inputSummary: string;
91
+ permissionDecision?: {
92
+ decision: "allow";
93
+ reason: string;
94
+ source: string;
95
+ expiresAt?: string | undefined;
96
+ } | {
97
+ decision: "ask";
98
+ reason: string;
99
+ risk: "low" | "medium" | "high";
100
+ } | {
101
+ decision: "deny";
102
+ reason: string;
103
+ source: string;
104
+ } | undefined;
105
+ }>;
106
+ export declare const toolResultEventSchema: z.ZodObject<{
107
+ id: z.ZodString;
108
+ sessionId: z.ZodString;
109
+ timestamp: z.ZodString;
110
+ } & {
111
+ type: z.ZodLiteral<"tool_result">;
112
+ toolCallId: z.ZodString;
113
+ status: z.ZodEnum<["success", "error", "cancelled"]>;
114
+ outputSummary: z.ZodString;
115
+ outputRef: z.ZodOptional<z.ZodString>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ type: "tool_result";
118
+ status: "cancelled" | "error" | "success";
119
+ id: string;
120
+ timestamp: string;
121
+ toolCallId: string;
122
+ sessionId: string;
123
+ outputSummary: string;
124
+ outputRef?: string | undefined;
125
+ }, {
126
+ type: "tool_result";
127
+ status: "cancelled" | "error" | "success";
128
+ id: string;
129
+ timestamp: string;
130
+ toolCallId: string;
131
+ sessionId: string;
132
+ outputSummary: string;
133
+ outputRef?: string | undefined;
134
+ }>;
135
+ export declare const fileMutationEventSchema: z.ZodObject<{
136
+ id: z.ZodString;
137
+ sessionId: z.ZodString;
138
+ timestamp: z.ZodString;
139
+ } & {
140
+ type: z.ZodLiteral<"file_mutation">;
141
+ toolCallId: z.ZodString;
142
+ path: z.ZodString;
143
+ operation: z.ZodEnum<["create", "update", "delete", "move"]>;
144
+ beforeBlob: z.ZodOptional<z.ZodString>;
145
+ afterBlob: z.ZodOptional<z.ZodString>;
146
+ beforeHash: z.ZodOptional<z.ZodString>;
147
+ afterHash: z.ZodOptional<z.ZodString>;
148
+ diffRef: z.ZodOptional<z.ZodString>;
149
+ }, "strip", z.ZodTypeAny, {
150
+ path: string;
151
+ type: "file_mutation";
152
+ id: string;
153
+ timestamp: string;
154
+ toolCallId: string;
155
+ sessionId: string;
156
+ operation: "create" | "update" | "delete" | "move";
157
+ beforeBlob?: string | undefined;
158
+ afterBlob?: string | undefined;
159
+ beforeHash?: string | undefined;
160
+ afterHash?: string | undefined;
161
+ diffRef?: string | undefined;
162
+ }, {
163
+ path: string;
164
+ type: "file_mutation";
165
+ id: string;
166
+ timestamp: string;
167
+ toolCallId: string;
168
+ sessionId: string;
169
+ operation: "create" | "update" | "delete" | "move";
170
+ beforeBlob?: string | undefined;
171
+ afterBlob?: string | undefined;
172
+ beforeHash?: string | undefined;
173
+ afterHash?: string | undefined;
174
+ diffRef?: string | undefined;
175
+ }>;
176
+ export declare const sessionEventSchema: z.ZodObject<{
177
+ id: z.ZodString;
178
+ sessionId: z.ZodString;
179
+ timestamp: z.ZodString;
180
+ } & {
181
+ type: z.ZodLiteral<"session">;
182
+ name: z.ZodEnum<["created", "command_started", "command_completed"]>;
183
+ command: z.ZodOptional<z.ZodString>;
184
+ status: z.ZodOptional<z.ZodEnum<["success", "error"]>>;
185
+ }, "strip", z.ZodTypeAny, {
186
+ type: "session";
187
+ id: string;
188
+ timestamp: string;
189
+ sessionId: string;
190
+ name: "created" | "command_started" | "command_completed";
191
+ status?: "error" | "success" | undefined;
192
+ command?: string | undefined;
193
+ }, {
194
+ type: "session";
195
+ id: string;
196
+ timestamp: string;
197
+ sessionId: string;
198
+ name: "created" | "command_started" | "command_completed";
199
+ status?: "error" | "success" | undefined;
200
+ command?: string | undefined;
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
+ }>;
595
+ export declare const auditEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
596
+ id: z.ZodString;
597
+ sessionId: z.ZodString;
598
+ timestamp: z.ZodString;
599
+ } & {
600
+ type: z.ZodLiteral<"session">;
601
+ name: z.ZodEnum<["created", "command_started", "command_completed"]>;
602
+ command: z.ZodOptional<z.ZodString>;
603
+ status: z.ZodOptional<z.ZodEnum<["success", "error"]>>;
604
+ }, "strip", z.ZodTypeAny, {
605
+ type: "session";
606
+ id: string;
607
+ timestamp: string;
608
+ sessionId: string;
609
+ name: "created" | "command_started" | "command_completed";
610
+ status?: "error" | "success" | undefined;
611
+ command?: string | undefined;
612
+ }, {
613
+ type: "session";
614
+ id: string;
615
+ timestamp: string;
616
+ sessionId: string;
617
+ name: "created" | "command_started" | "command_completed";
618
+ status?: "error" | "success" | undefined;
619
+ command?: string | undefined;
620
+ }>, z.ZodObject<{
621
+ id: z.ZodString;
622
+ sessionId: z.ZodString;
623
+ timestamp: z.ZodString;
624
+ } & {
625
+ type: z.ZodLiteral<"tool_call">;
626
+ tool: z.ZodString;
627
+ inputSummary: z.ZodString;
628
+ permissionDecision: z.ZodOptional<z.ZodDiscriminatedUnion<"decision", [z.ZodObject<{
629
+ decision: z.ZodLiteral<"allow">;
630
+ reason: z.ZodString;
631
+ source: z.ZodString;
632
+ expiresAt: z.ZodOptional<z.ZodString>;
633
+ }, "strip", z.ZodTypeAny, {
634
+ decision: "allow";
635
+ reason: string;
636
+ source: string;
637
+ expiresAt?: string | undefined;
638
+ }, {
639
+ decision: "allow";
640
+ reason: string;
641
+ source: string;
642
+ expiresAt?: string | undefined;
643
+ }>, z.ZodObject<{
644
+ decision: z.ZodLiteral<"ask">;
645
+ reason: z.ZodString;
646
+ risk: z.ZodEnum<["low", "medium", "high"]>;
647
+ }, "strip", z.ZodTypeAny, {
648
+ decision: "ask";
649
+ reason: string;
650
+ risk: "low" | "medium" | "high";
651
+ }, {
652
+ decision: "ask";
653
+ reason: string;
654
+ risk: "low" | "medium" | "high";
655
+ }>, z.ZodObject<{
656
+ decision: z.ZodLiteral<"deny">;
657
+ reason: z.ZodString;
658
+ source: z.ZodString;
659
+ }, "strip", z.ZodTypeAny, {
660
+ decision: "deny";
661
+ reason: string;
662
+ source: string;
663
+ }, {
664
+ decision: "deny";
665
+ reason: string;
666
+ source: string;
667
+ }>]>>;
668
+ }, "strip", z.ZodTypeAny, {
669
+ type: "tool_call";
670
+ id: string;
671
+ timestamp: string;
672
+ sessionId: string;
673
+ tool: string;
674
+ inputSummary: string;
675
+ permissionDecision?: {
676
+ decision: "allow";
677
+ reason: string;
678
+ source: string;
679
+ expiresAt?: string | undefined;
680
+ } | {
681
+ decision: "ask";
682
+ reason: string;
683
+ risk: "low" | "medium" | "high";
684
+ } | {
685
+ decision: "deny";
686
+ reason: string;
687
+ source: string;
688
+ } | undefined;
689
+ }, {
690
+ type: "tool_call";
691
+ id: string;
692
+ timestamp: string;
693
+ sessionId: string;
694
+ tool: string;
695
+ inputSummary: string;
696
+ permissionDecision?: {
697
+ decision: "allow";
698
+ reason: string;
699
+ source: string;
700
+ expiresAt?: string | undefined;
701
+ } | {
702
+ decision: "ask";
703
+ reason: string;
704
+ risk: "low" | "medium" | "high";
705
+ } | {
706
+ decision: "deny";
707
+ reason: string;
708
+ source: string;
709
+ } | undefined;
710
+ }>, z.ZodObject<{
711
+ id: z.ZodString;
712
+ sessionId: z.ZodString;
713
+ timestamp: z.ZodString;
714
+ } & {
715
+ type: z.ZodLiteral<"tool_result">;
716
+ toolCallId: z.ZodString;
717
+ status: z.ZodEnum<["success", "error", "cancelled"]>;
718
+ outputSummary: z.ZodString;
719
+ outputRef: z.ZodOptional<z.ZodString>;
720
+ }, "strip", z.ZodTypeAny, {
721
+ type: "tool_result";
722
+ status: "cancelled" | "error" | "success";
723
+ id: string;
724
+ timestamp: string;
725
+ toolCallId: string;
726
+ sessionId: string;
727
+ outputSummary: string;
728
+ outputRef?: string | undefined;
729
+ }, {
730
+ type: "tool_result";
731
+ status: "cancelled" | "error" | "success";
732
+ id: string;
733
+ timestamp: string;
734
+ toolCallId: string;
735
+ sessionId: string;
736
+ outputSummary: string;
737
+ outputRef?: string | undefined;
738
+ }>, z.ZodObject<{
739
+ id: z.ZodString;
740
+ sessionId: z.ZodString;
741
+ timestamp: z.ZodString;
742
+ } & {
743
+ type: z.ZodLiteral<"file_mutation">;
744
+ toolCallId: z.ZodString;
745
+ path: z.ZodString;
746
+ operation: z.ZodEnum<["create", "update", "delete", "move"]>;
747
+ beforeBlob: z.ZodOptional<z.ZodString>;
748
+ afterBlob: z.ZodOptional<z.ZodString>;
749
+ beforeHash: z.ZodOptional<z.ZodString>;
750
+ afterHash: z.ZodOptional<z.ZodString>;
751
+ diffRef: z.ZodOptional<z.ZodString>;
752
+ }, "strip", z.ZodTypeAny, {
753
+ path: string;
754
+ type: "file_mutation";
755
+ id: string;
756
+ timestamp: string;
757
+ toolCallId: string;
758
+ sessionId: string;
759
+ operation: "create" | "update" | "delete" | "move";
760
+ beforeBlob?: string | undefined;
761
+ afterBlob?: string | undefined;
762
+ beforeHash?: string | undefined;
763
+ afterHash?: string | undefined;
764
+ diffRef?: string | undefined;
765
+ }, {
766
+ path: string;
767
+ type: "file_mutation";
768
+ id: string;
769
+ timestamp: string;
770
+ toolCallId: string;
771
+ sessionId: string;
772
+ operation: "create" | "update" | "delete" | "move";
773
+ beforeBlob?: string | undefined;
774
+ afterBlob?: string | undefined;
775
+ beforeHash?: string | undefined;
776
+ afterHash?: string | undefined;
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;
1149
+ }>]>;
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>;
1161
+ //# sourceMappingURL=audit-trace.d.ts.map