@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.
@@ -0,0 +1,549 @@
1
+ /**
2
+ * Subagent dispatch contracts (Sprint a5.4 — M1 gap remediation D).
3
+ *
4
+ * The Pugi CLI's subagent surface is a typed contract between three layers:
5
+ * 1. The orchestrator (Mira in the brand persona registry; the parent
6
+ * engine loop in the actual runtime) decides a SubagentTask.
7
+ * 2. The CLI dispatcher (apps/pugi-cli/src/core/subagents/dispatcher.ts)
8
+ * resolves role to Cyber-Zoo persona, classifies isolation, emits
9
+ * lifecycle events, and returns a SubagentResult.
10
+ * 3. Future M2 worktree + M3 remote-VM implementations swap the dispatch
11
+ * backend without changing the contract.
12
+ *
13
+ * IMPORTANT: this module does NOT re-declare the persona roster. The
14
+ * Cyber-Zoo persona identities live in @pugi/personas and are mapped to
15
+ * roles inside the CLI. The SDK only carries the role + persona-slug pair
16
+ * on the wire so the cabinet UI can render the brand persona without
17
+ * shipping the full roster.
18
+ */
19
+ import { z } from 'zod';
20
+ /**
21
+ * Closed enumeration of CLI subagent roles. Mirrors the SubagentRole union
22
+ * declared in apps/pugi-cli/src/core/agents/registry.ts. Keep both in
23
+ * lockstep: the CLI dispatcher imports from @pugi/sdk for wire validation
24
+ * and from the local registry for persona resolution, so adding a role
25
+ * requires touching both files together.
26
+ */
27
+ export declare const subagentRoleSchema: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
28
+ export type SubagentRole = z.infer<typeof subagentRoleSchema>;
29
+ /**
30
+ * Isolation classification for a dispatched subagent. M1 ships the first
31
+ * three tiers; worktree lands in alpha-6 (per-task git worktree for every
32
+ * write subagent), remote_vm in M3 (dangerous / long-running jobs).
33
+ *
34
+ * - prompt_only: reasoning/review folded into the parent
35
+ * engine context. No separate filesystem
36
+ * handle; the parent owns every tool call.
37
+ * Mira (orchestrator) uses this at M1.
38
+ * - shared_fs_readonly: read tools are allowed; write/edit/bash
39
+ * classes are denied at the permission layer.
40
+ * Marcus / Vera / Anika get this at M1.
41
+ * - shared_fs_serialized: write tools are allowed but serialized
42
+ * through a coordinator-held lock so two
43
+ * write-subagents never race on the same
44
+ * workspace. Hiroshi / Olivia / Diego / Sofia.
45
+ * - worktree: per-subagent worktree directory (M2,
46
+ * ADR-0057). Writes never touch the primary
47
+ * workspace until merge.
48
+ * - remote_vm: engine VM spawn (M3). Out of scope for the
49
+ * CLI but reserved in the enum so the wire
50
+ * format does not change between milestones.
51
+ */
52
+ export declare const subagentIsolationSchema: z.ZodEnum<["prompt_only", "shared_fs_readonly", "shared_fs_serialized", "worktree", "remote_vm"]>;
53
+ export type SubagentIsolation = z.infer<typeof subagentIsolationSchema>;
54
+ /**
55
+ * Status of a completed subagent dispatch.
56
+ * - shipped: the subagent returned a final answer and any write tools
57
+ * it invoked succeeded.
58
+ * - blocked: the subagent stopped because the budget was hit, plan
59
+ * mode refused a write, or a permission rule denied a tool
60
+ * call.
61
+ * - failed: the subagent crashed or returned a parseable error.
62
+ * - cancelled: the parent or operator cancelled the dispatch via the
63
+ * abort signal.
64
+ */
65
+ export declare const subagentStatusSchema: z.ZodEnum<["shipped", "blocked", "failed", "cancelled"]>;
66
+ export type SubagentStatus = z.infer<typeof subagentStatusSchema>;
67
+ /**
68
+ * Per-dispatch budget. All three limits are optional; the dispatcher
69
+ * applies its own per-role defaults when a field is missing. Setting a
70
+ * field tightens the cap; the dispatcher never relaxes a budget.
71
+ */
72
+ export declare const subagentBudgetSchema: z.ZodObject<{
73
+ tokens: z.ZodOptional<z.ZodNumber>;
74
+ dollars: z.ZodOptional<z.ZodNumber>;
75
+ wallClockMs: z.ZodOptional<z.ZodNumber>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ tokens?: number | undefined;
78
+ dollars?: number | undefined;
79
+ wallClockMs?: number | undefined;
80
+ }, {
81
+ tokens?: number | undefined;
82
+ dollars?: number | undefined;
83
+ wallClockMs?: number | undefined;
84
+ }>;
85
+ export type SubagentBudget = z.infer<typeof subagentBudgetSchema>;
86
+ /**
87
+ * Dispatch input. allowedPaths / deniedPaths mirror the per-task shape on
88
+ * EngineTask so callers that already build engine tasks can promote a
89
+ * subset of the fields into a subagent dispatch without a second
90
+ * translation step.
91
+ */
92
+ export declare const subagentTaskSchema: z.ZodObject<{
93
+ id: z.ZodString;
94
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
95
+ prompt: z.ZodString;
96
+ permissionMode: z.ZodEnum<["plan", "ask", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>;
97
+ budget: z.ZodOptional<z.ZodObject<{
98
+ tokens: z.ZodOptional<z.ZodNumber>;
99
+ dollars: z.ZodOptional<z.ZodNumber>;
100
+ wallClockMs: z.ZodOptional<z.ZodNumber>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ tokens?: number | undefined;
103
+ dollars?: number | undefined;
104
+ wallClockMs?: number | undefined;
105
+ }, {
106
+ tokens?: number | undefined;
107
+ dollars?: number | undefined;
108
+ wallClockMs?: number | undefined;
109
+ }>>;
110
+ allowedPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
111
+ deniedPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
112
+ }, "strip", z.ZodTypeAny, {
113
+ id: string;
114
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
115
+ prompt: string;
116
+ permissionMode: "plan" | "ask" | "acceptEdits" | "auto" | "dontAsk" | "bypassPermissions";
117
+ budget?: {
118
+ tokens?: number | undefined;
119
+ dollars?: number | undefined;
120
+ wallClockMs?: number | undefined;
121
+ } | undefined;
122
+ allowedPaths?: string[] | undefined;
123
+ deniedPaths?: string[] | undefined;
124
+ }, {
125
+ id: string;
126
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
127
+ prompt: string;
128
+ permissionMode: "plan" | "ask" | "acceptEdits" | "auto" | "dontAsk" | "bypassPermissions";
129
+ budget?: {
130
+ tokens?: number | undefined;
131
+ dollars?: number | undefined;
132
+ wallClockMs?: number | undefined;
133
+ } | undefined;
134
+ allowedPaths?: string[] | undefined;
135
+ deniedPaths?: string[] | undefined;
136
+ }>;
137
+ export type SubagentTask = z.infer<typeof subagentTaskSchema>;
138
+ /**
139
+ * Dispatch result. personaSlug is the brand persona that owned the
140
+ * dispatch (from @pugi/personas via the CLI registry); cabinet UI and
141
+ * audit replay use it to render the persona avatar / hue token without
142
+ * needing to re-resolve the role.
143
+ *
144
+ * permissionDecisions is an OPTIONAL summary of the most important
145
+ * permission decisions the dispatcher applied or recorded. Full decision
146
+ * history lives in .pugi/events.jsonl; this field is a convenience pointer
147
+ * so cabinet UI can render the "Vera was blocked from editing X" line
148
+ * without re-parsing the events log.
149
+ */
150
+ export declare const subagentResultSchema: z.ZodObject<{
151
+ taskId: z.ZodString;
152
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
153
+ personaSlug: z.ZodString;
154
+ status: z.ZodEnum<["shipped", "blocked", "failed", "cancelled"]>;
155
+ summary: z.ZodString;
156
+ filesChanged: z.ZodArray<z.ZodString, "many">;
157
+ toolCallCount: z.ZodNumber;
158
+ tokensIn: z.ZodNumber;
159
+ tokensOut: z.ZodNumber;
160
+ durationMs: z.ZodNumber;
161
+ permissionDecisions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"decision", [z.ZodObject<{
162
+ decision: z.ZodLiteral<"allow">;
163
+ reason: z.ZodString;
164
+ source: z.ZodString;
165
+ expiresAt: z.ZodOptional<z.ZodString>;
166
+ }, "strip", z.ZodTypeAny, {
167
+ decision: "allow";
168
+ reason: string;
169
+ source: string;
170
+ expiresAt?: string | undefined;
171
+ }, {
172
+ decision: "allow";
173
+ reason: string;
174
+ source: string;
175
+ expiresAt?: string | undefined;
176
+ }>, z.ZodObject<{
177
+ decision: z.ZodLiteral<"ask">;
178
+ reason: z.ZodString;
179
+ risk: z.ZodEnum<["low", "medium", "high"]>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ decision: "ask";
182
+ reason: string;
183
+ risk: "low" | "medium" | "high";
184
+ }, {
185
+ decision: "ask";
186
+ reason: string;
187
+ risk: "low" | "medium" | "high";
188
+ }>, z.ZodObject<{
189
+ decision: z.ZodLiteral<"deny">;
190
+ reason: z.ZodString;
191
+ source: z.ZodString;
192
+ }, "strip", z.ZodTypeAny, {
193
+ decision: "deny";
194
+ reason: string;
195
+ source: string;
196
+ }, {
197
+ decision: "deny";
198
+ reason: string;
199
+ source: string;
200
+ }>]>, "many">>;
201
+ }, "strip", z.ZodTypeAny, {
202
+ status: "shipped" | "blocked" | "failed" | "cancelled";
203
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
204
+ taskId: string;
205
+ personaSlug: string;
206
+ summary: string;
207
+ filesChanged: string[];
208
+ toolCallCount: number;
209
+ tokensIn: number;
210
+ tokensOut: number;
211
+ durationMs: number;
212
+ permissionDecisions?: ({
213
+ decision: "allow";
214
+ reason: string;
215
+ source: string;
216
+ expiresAt?: string | undefined;
217
+ } | {
218
+ decision: "ask";
219
+ reason: string;
220
+ risk: "low" | "medium" | "high";
221
+ } | {
222
+ decision: "deny";
223
+ reason: string;
224
+ source: string;
225
+ })[] | undefined;
226
+ }, {
227
+ status: "shipped" | "blocked" | "failed" | "cancelled";
228
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
229
+ taskId: string;
230
+ personaSlug: string;
231
+ summary: string;
232
+ filesChanged: string[];
233
+ toolCallCount: number;
234
+ tokensIn: number;
235
+ tokensOut: number;
236
+ durationMs: number;
237
+ permissionDecisions?: ({
238
+ decision: "allow";
239
+ reason: string;
240
+ source: string;
241
+ expiresAt?: string | undefined;
242
+ } | {
243
+ decision: "ask";
244
+ reason: string;
245
+ risk: "low" | "medium" | "high";
246
+ } | {
247
+ decision: "deny";
248
+ reason: string;
249
+ source: string;
250
+ })[] | undefined;
251
+ }>;
252
+ export type SubagentResult = z.infer<typeof subagentResultSchema>;
253
+ /**
254
+ * Emitted once at dispatch start. parentSessionId is the session that owns
255
+ * the dispatch (typically the CLI's top-level PugiSession.id); future M2
256
+ * worktree dispatches will introduce a child session id that
257
+ * cross-references back to the parent.
258
+ */
259
+ export declare const subagentSpawnedEventSchema: z.ZodObject<{
260
+ type: z.ZodLiteral<"subagent.spawned">;
261
+ taskId: z.ZodString;
262
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
263
+ personaSlug: z.ZodString;
264
+ parentSessionId: z.ZodString;
265
+ isolation: z.ZodEnum<["prompt_only", "shared_fs_readonly", "shared_fs_serialized", "worktree", "remote_vm"]>;
266
+ timestamp: z.ZodString;
267
+ }, "strip", z.ZodTypeAny, {
268
+ type: "subagent.spawned";
269
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
270
+ taskId: string;
271
+ personaSlug: string;
272
+ parentSessionId: string;
273
+ isolation: "prompt_only" | "shared_fs_readonly" | "shared_fs_serialized" | "worktree" | "remote_vm";
274
+ timestamp: string;
275
+ }, {
276
+ type: "subagent.spawned";
277
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
278
+ taskId: string;
279
+ personaSlug: string;
280
+ parentSessionId: string;
281
+ isolation: "prompt_only" | "shared_fs_readonly" | "shared_fs_serialized" | "worktree" | "remote_vm";
282
+ timestamp: string;
283
+ }>;
284
+ export type SubagentSpawnedEvent = z.infer<typeof subagentSpawnedEventSchema>;
285
+ /**
286
+ * Emitted once per tool call the subagent makes. toolName is the
287
+ * registered tool slug (read, write, edit, bash, ...). Full argument
288
+ * payloads stay in the global audit log under tool_call; this event is
289
+ * the subagent-scoped index so cabinet UI can render the per-persona tool
290
+ * tree without a second join.
291
+ */
292
+ export declare const subagentToolCallEventSchema: z.ZodObject<{
293
+ type: z.ZodLiteral<"subagent.tool_call">;
294
+ taskId: z.ZodString;
295
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
296
+ personaSlug: z.ZodString;
297
+ toolName: z.ZodString;
298
+ toolCallId: z.ZodString;
299
+ timestamp: z.ZodString;
300
+ }, "strip", z.ZodTypeAny, {
301
+ type: "subagent.tool_call";
302
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
303
+ taskId: string;
304
+ personaSlug: string;
305
+ timestamp: string;
306
+ toolName: string;
307
+ toolCallId: string;
308
+ }, {
309
+ type: "subagent.tool_call";
310
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
311
+ taskId: string;
312
+ personaSlug: string;
313
+ timestamp: string;
314
+ toolName: string;
315
+ toolCallId: string;
316
+ }>;
317
+ export type SubagentToolCallEvent = z.infer<typeof subagentToolCallEventSchema>;
318
+ /**
319
+ * Emitted once when the subagent reaches a terminal state with status
320
+ * shipped. The numeric fields mirror the SubagentResult summary so a
321
+ * downstream consumer can build a cabinet UI activity row from a single
322
+ * event without joining back to the result envelope.
323
+ */
324
+ export declare const subagentCompletedEventSchema: z.ZodObject<{
325
+ type: z.ZodLiteral<"subagent.completed">;
326
+ taskId: z.ZodString;
327
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
328
+ personaSlug: z.ZodString;
329
+ toolCallCount: z.ZodNumber;
330
+ tokensIn: z.ZodNumber;
331
+ tokensOut: z.ZodNumber;
332
+ durationMs: z.ZodNumber;
333
+ timestamp: z.ZodString;
334
+ }, "strip", z.ZodTypeAny, {
335
+ type: "subagent.completed";
336
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
337
+ taskId: string;
338
+ personaSlug: string;
339
+ toolCallCount: number;
340
+ tokensIn: number;
341
+ tokensOut: number;
342
+ durationMs: number;
343
+ timestamp: string;
344
+ }, {
345
+ type: "subagent.completed";
346
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
347
+ taskId: string;
348
+ personaSlug: string;
349
+ toolCallCount: number;
350
+ tokensIn: number;
351
+ tokensOut: number;
352
+ durationMs: number;
353
+ timestamp: string;
354
+ }>;
355
+ export type SubagentCompletedEvent = z.infer<typeof subagentCompletedEventSchema>;
356
+ /**
357
+ * Emitted once when the subagent terminates with status blocked. reason is
358
+ * a short machine-friendly slug (budget_exhausted, plan_mode_refused,
359
+ * permission_denied, tool_unavailable) so cabinet UI can group blocked
360
+ * dispatches by cause; detail is a human-readable summary the operator
361
+ * can act on.
362
+ */
363
+ export declare const subagentBlockedEventSchema: z.ZodObject<{
364
+ type: z.ZodLiteral<"subagent.blocked">;
365
+ taskId: z.ZodString;
366
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
367
+ personaSlug: z.ZodString;
368
+ reason: z.ZodEnum<["budget_exhausted", "plan_mode_refused", "permission_denied", "tool_unavailable"]>;
369
+ detail: z.ZodString;
370
+ timestamp: z.ZodString;
371
+ }, "strip", z.ZodTypeAny, {
372
+ type: "subagent.blocked";
373
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
374
+ taskId: string;
375
+ personaSlug: string;
376
+ reason: "budget_exhausted" | "plan_mode_refused" | "permission_denied" | "tool_unavailable";
377
+ timestamp: string;
378
+ detail: string;
379
+ }, {
380
+ type: "subagent.blocked";
381
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
382
+ taskId: string;
383
+ personaSlug: string;
384
+ reason: "budget_exhausted" | "plan_mode_refused" | "permission_denied" | "tool_unavailable";
385
+ timestamp: string;
386
+ detail: string;
387
+ }>;
388
+ export type SubagentBlockedEvent = z.infer<typeof subagentBlockedEventSchema>;
389
+ /**
390
+ * Emitted once when the subagent terminates with status failed. The error
391
+ * field is a one-line summary safe to print in the operator console; full
392
+ * stack traces stay in the global audit log.
393
+ */
394
+ export declare const subagentFailedEventSchema: z.ZodObject<{
395
+ type: z.ZodLiteral<"subagent.failed">;
396
+ taskId: z.ZodString;
397
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
398
+ personaSlug: z.ZodString;
399
+ error: z.ZodString;
400
+ timestamp: z.ZodString;
401
+ }, "strip", z.ZodTypeAny, {
402
+ type: "subagent.failed";
403
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
404
+ taskId: string;
405
+ personaSlug: string;
406
+ timestamp: string;
407
+ error: string;
408
+ }, {
409
+ type: "subagent.failed";
410
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
411
+ taskId: string;
412
+ personaSlug: string;
413
+ timestamp: string;
414
+ error: string;
415
+ }>;
416
+ export type SubagentFailedEvent = z.infer<typeof subagentFailedEventSchema>;
417
+ /**
418
+ * Discriminated union of every subagent lifecycle event. Folded into the
419
+ * broader auditEventSchema in audit-trace.ts; exported here separately so
420
+ * dispatcher unit tests can validate against just the subagent surface
421
+ * without pulling the full audit-trace dependency graph through the test
422
+ * bundle.
423
+ */
424
+ export declare const subagentEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
425
+ type: z.ZodLiteral<"subagent.spawned">;
426
+ taskId: z.ZodString;
427
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
428
+ personaSlug: z.ZodString;
429
+ parentSessionId: z.ZodString;
430
+ isolation: z.ZodEnum<["prompt_only", "shared_fs_readonly", "shared_fs_serialized", "worktree", "remote_vm"]>;
431
+ timestamp: z.ZodString;
432
+ }, "strip", z.ZodTypeAny, {
433
+ type: "subagent.spawned";
434
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
435
+ taskId: string;
436
+ personaSlug: string;
437
+ parentSessionId: string;
438
+ isolation: "prompt_only" | "shared_fs_readonly" | "shared_fs_serialized" | "worktree" | "remote_vm";
439
+ timestamp: string;
440
+ }, {
441
+ type: "subagent.spawned";
442
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
443
+ taskId: string;
444
+ personaSlug: string;
445
+ parentSessionId: string;
446
+ isolation: "prompt_only" | "shared_fs_readonly" | "shared_fs_serialized" | "worktree" | "remote_vm";
447
+ timestamp: string;
448
+ }>, z.ZodObject<{
449
+ type: z.ZodLiteral<"subagent.tool_call">;
450
+ taskId: z.ZodString;
451
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
452
+ personaSlug: z.ZodString;
453
+ toolName: z.ZodString;
454
+ toolCallId: z.ZodString;
455
+ timestamp: z.ZodString;
456
+ }, "strip", z.ZodTypeAny, {
457
+ type: "subagent.tool_call";
458
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
459
+ taskId: string;
460
+ personaSlug: string;
461
+ timestamp: string;
462
+ toolName: string;
463
+ toolCallId: string;
464
+ }, {
465
+ type: "subagent.tool_call";
466
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
467
+ taskId: string;
468
+ personaSlug: string;
469
+ timestamp: string;
470
+ toolName: string;
471
+ toolCallId: string;
472
+ }>, z.ZodObject<{
473
+ type: z.ZodLiteral<"subagent.completed">;
474
+ taskId: z.ZodString;
475
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
476
+ personaSlug: z.ZodString;
477
+ toolCallCount: z.ZodNumber;
478
+ tokensIn: z.ZodNumber;
479
+ tokensOut: z.ZodNumber;
480
+ durationMs: z.ZodNumber;
481
+ timestamp: z.ZodString;
482
+ }, "strip", z.ZodTypeAny, {
483
+ type: "subagent.completed";
484
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
485
+ taskId: string;
486
+ personaSlug: string;
487
+ toolCallCount: number;
488
+ tokensIn: number;
489
+ tokensOut: number;
490
+ durationMs: number;
491
+ timestamp: string;
492
+ }, {
493
+ type: "subagent.completed";
494
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
495
+ taskId: string;
496
+ personaSlug: string;
497
+ toolCallCount: number;
498
+ tokensIn: number;
499
+ tokensOut: number;
500
+ durationMs: number;
501
+ timestamp: string;
502
+ }>, z.ZodObject<{
503
+ type: z.ZodLiteral<"subagent.blocked">;
504
+ taskId: z.ZodString;
505
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
506
+ personaSlug: z.ZodString;
507
+ reason: z.ZodEnum<["budget_exhausted", "plan_mode_refused", "permission_denied", "tool_unavailable"]>;
508
+ detail: z.ZodString;
509
+ timestamp: z.ZodString;
510
+ }, "strip", z.ZodTypeAny, {
511
+ type: "subagent.blocked";
512
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
513
+ taskId: string;
514
+ personaSlug: string;
515
+ reason: "budget_exhausted" | "plan_mode_refused" | "permission_denied" | "tool_unavailable";
516
+ timestamp: string;
517
+ detail: string;
518
+ }, {
519
+ type: "subagent.blocked";
520
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
521
+ taskId: string;
522
+ personaSlug: string;
523
+ reason: "budget_exhausted" | "plan_mode_refused" | "permission_denied" | "tool_unavailable";
524
+ timestamp: string;
525
+ detail: string;
526
+ }>, z.ZodObject<{
527
+ type: z.ZodLiteral<"subagent.failed">;
528
+ taskId: z.ZodString;
529
+ role: z.ZodEnum<["orchestrator", "architect", "coder", "verifier", "reviewer", "researcher", "release", "devops", "design_qa"]>;
530
+ personaSlug: z.ZodString;
531
+ error: z.ZodString;
532
+ timestamp: z.ZodString;
533
+ }, "strip", z.ZodTypeAny, {
534
+ type: "subagent.failed";
535
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
536
+ taskId: string;
537
+ personaSlug: string;
538
+ timestamp: string;
539
+ error: string;
540
+ }, {
541
+ type: "subagent.failed";
542
+ role: "orchestrator" | "architect" | "coder" | "verifier" | "reviewer" | "researcher" | "release" | "devops" | "design_qa";
543
+ taskId: string;
544
+ personaSlug: string;
545
+ timestamp: string;
546
+ error: string;
547
+ }>]>;
548
+ export type SubagentEvent = z.infer<typeof subagentEventSchema>;
549
+ //# sourceMappingURL=subagent-contracts.d.ts.map