@osfactory/otel-hook 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1020 -0
  3. package/dist/adapter-DIgRACtL.d.ts +303 -0
  4. package/dist/cli.js +12607 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/config.d.ts +233 -0
  7. package/dist/config.js +996 -0
  8. package/dist/config.js.map +1 -0
  9. package/dist/content-CoB7aNP1.d.ts +118 -0
  10. package/dist/diagnostics.d.ts +58 -0
  11. package/dist/diagnostics.js +46 -0
  12. package/dist/diagnostics.js.map +1 -0
  13. package/dist/errors.d.ts +91 -0
  14. package/dist/errors.js +322 -0
  15. package/dist/errors.js.map +1 -0
  16. package/dist/events-VxBnDFaO.d.ts +2044 -0
  17. package/dist/filesystem-store-J8jjDMTh.d.ts +65 -0
  18. package/dist/hook-CGpo-vks.d.ts +292 -0
  19. package/dist/identity-BrVBs901.d.ts +227 -0
  20. package/dist/index.d.ts +44 -0
  21. package/dist/index.js +11798 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/install.d.ts +1021 -0
  24. package/dist/install.js +3271 -0
  25. package/dist/install.js.map +1 -0
  26. package/dist/integration.d.ts +303 -0
  27. package/dist/integration.js +5942 -0
  28. package/dist/integration.js.map +1 -0
  29. package/dist/keys-Dej5bN3L.d.ts +7 -0
  30. package/dist/lifecycle.d.ts +428 -0
  31. package/dist/lifecycle.js +1077 -0
  32. package/dist/lifecycle.js.map +1 -0
  33. package/dist/memory-DXVBc8V9.d.ts +94 -0
  34. package/dist/model.d.ts +45 -0
  35. package/dist/model.js +1023 -0
  36. package/dist/model.js.map +1 -0
  37. package/dist/otlp-log-sink-CeIFDDpn.d.ts +457 -0
  38. package/dist/payload-CHr53E_v.d.ts +201 -0
  39. package/dist/policy-D1CrlYn3.d.ts +73 -0
  40. package/dist/ports-Q8x0ODhs.d.ts +200 -0
  41. package/dist/primitives-CJ8-rn-f.d.ts +75 -0
  42. package/dist/privacy.d.ts +51 -0
  43. package/dist/privacy.js +633 -0
  44. package/dist/privacy.js.map +1 -0
  45. package/dist/providers.d.ts +257 -0
  46. package/dist/providers.js +4398 -0
  47. package/dist/providers.js.map +1 -0
  48. package/dist/registry-BzYmC9OC.d.ts +49 -0
  49. package/dist/runtime.d.ts +32 -0
  50. package/dist/runtime.js +2907 -0
  51. package/dist/runtime.js.map +1 -0
  52. package/dist/schema-Cn0-xz8L.d.ts +224 -0
  53. package/dist/semconv-Baoz-0OI.d.ts +188 -0
  54. package/dist/service-j4jEO6cZ.d.ts +68 -0
  55. package/dist/state.d.ts +36 -0
  56. package/dist/state.js +710 -0
  57. package/dist/state.js.map +1 -0
  58. package/dist/taxonomy-DwhTtuWd.d.ts +87 -0
  59. package/dist/telemetry.d.ts +77 -0
  60. package/dist/telemetry.js +2294 -0
  61. package/dist/telemetry.js.map +1 -0
  62. package/dist/testing.d.ts +155 -0
  63. package/dist/testing.js +6513 -0
  64. package/dist/testing.js.map +1 -0
  65. package/package.json +124 -0
@@ -0,0 +1,2044 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Whether an observation reports the change since the previous observation
5
+ * (`delta`) or the running total for the session/generation (`cumulative`).
6
+ *
7
+ * The canonical model keeps temporality explicit rather than assuming one:
8
+ * summing cumulative observations double-counts, and diffing delta observations
9
+ * silently loses tokens.
10
+ */
11
+ declare const usageTemporalitySchema: z.ZodEnum<{
12
+ delta: "delta";
13
+ cumulative: "cumulative";
14
+ }>;
15
+ type UsageTemporality = z.infer<typeof usageTemporalitySchema>;
16
+ /**
17
+ * Whether the provider counts cache-creation tokens inside its input total or
18
+ * reports them as a disjoint bucket.
19
+ *
20
+ * - `included-in-input`: `cacheCreationInputTokens` is a subset of `inputTokens`.
21
+ * - `disjoint-from-input`: cache-creation tokens are billed in addition to
22
+ * `inputTokens` and must be added when computing a total.
23
+ * - `not-reported`: the provider exposes no cache-creation counter; the field is
24
+ * pinned to zero.
25
+ */
26
+ declare const cacheCreationAccountingSchema: z.ZodEnum<{
27
+ "included-in-input": "included-in-input";
28
+ "disjoint-from-input": "disjoint-from-input";
29
+ "not-reported": "not-reported";
30
+ }>;
31
+ type CacheCreationAccounting = z.infer<typeof cacheCreationAccountingSchema>;
32
+ /** Whether a provider-reported total agrees with the canonical computation. */
33
+ declare const providerTotalAgreementSchema: z.ZodEnum<{
34
+ unreported: "unreported";
35
+ agrees: "agrees";
36
+ disagrees: "disagrees";
37
+ }>;
38
+ type ProviderTotalAgreement = z.infer<typeof providerTotalAgreementSchema>;
39
+ /**
40
+ * What an adapter reports, before normalization.
41
+ *
42
+ * `inputTokens` is *inclusive*: it counts every input token the provider
43
+ * attributes to the call, including cache reads (and cache creation when the
44
+ * provider folds it in). `outputTokens` is likewise inclusive of reasoning
45
+ * output. Subset fields describe portions of those totals, never additions.
46
+ */
47
+ declare const usageReportSchema: z.ZodObject<{
48
+ temporality: z.ZodEnum<{
49
+ delta: "delta";
50
+ cumulative: "cumulative";
51
+ }>;
52
+ inputTokens: z.ZodOptional<z.ZodNumber>;
53
+ cachedInputTokens: z.ZodOptional<z.ZodNumber>;
54
+ cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
55
+ cacheCreationAccounting: z.ZodOptional<z.ZodEnum<{
56
+ "included-in-input": "included-in-input";
57
+ "disjoint-from-input": "disjoint-from-input";
58
+ "not-reported": "not-reported";
59
+ }>>;
60
+ outputTokens: z.ZodOptional<z.ZodNumber>;
61
+ reasoningOutputTokens: z.ZodOptional<z.ZodNumber>;
62
+ providerTotalTokens: z.ZodOptional<z.ZodNumber>;
63
+ }, z.core.$strict>;
64
+ type UsageReport = z.infer<typeof usageReportSchema>;
65
+ /**
66
+ * Fully normalized usage.
67
+ *
68
+ * Derived fields (`uncachedInputTokens`, `totalTokens`,
69
+ * `providerTotalAgreement`) are part of the schema and are re-checked on parse,
70
+ * so an inconsistent object cannot exist. Construct values with
71
+ * {@link normalizeUsage} rather than by hand.
72
+ */
73
+ declare const canonicalUsageSchema: z.ZodObject<{
74
+ temporality: z.ZodEnum<{
75
+ delta: "delta";
76
+ cumulative: "cumulative";
77
+ }>;
78
+ inputTokens: z.ZodNumber;
79
+ cachedInputTokens: z.ZodNumber;
80
+ cacheCreationInputTokens: z.ZodNumber;
81
+ cacheCreationAccounting: z.ZodEnum<{
82
+ "included-in-input": "included-in-input";
83
+ "disjoint-from-input": "disjoint-from-input";
84
+ "not-reported": "not-reported";
85
+ }>;
86
+ outputTokens: z.ZodNumber;
87
+ reasoningOutputTokens: z.ZodNumber;
88
+ uncachedInputTokens: z.ZodNumber;
89
+ totalTokens: z.ZodNumber;
90
+ providerTotalTokens: z.ZodOptional<z.ZodNumber>;
91
+ providerTotalAgreement: z.ZodEnum<{
92
+ unreported: "unreported";
93
+ agrees: "agrees";
94
+ disagrees: "disagrees";
95
+ }>;
96
+ }, z.core.$strict>;
97
+ type CanonicalUsage = z.infer<typeof canonicalUsageSchema>;
98
+ type UsageNormalizationIssue = {
99
+ readonly code: "invalid-report" | "cached-exceeds-input" | "reasoning-exceeds-output" | "cache-creation-exceeds-input" | "cache-creation-accounting-missing";
100
+ readonly message: string;
101
+ };
102
+ type UsageNormalizationResult = {
103
+ readonly status: "ok";
104
+ readonly usage: CanonicalUsage;
105
+ readonly notes: readonly string[];
106
+ } | {
107
+ readonly status: "invalid";
108
+ readonly issues: readonly UsageNormalizationIssue[];
109
+ };
110
+ /**
111
+ * Normalize a provider usage report into canonical usage.
112
+ *
113
+ * Deterministic rules:
114
+ * 1. Absent counters default to `0`; `providerTotalTokens` stays absent.
115
+ * 2. Non-integer, negative, or non-finite counters are rejected.
116
+ * 3. A subset exceeding its total is rejected — never clamped — because
117
+ * clamping would silently invent a billing story.
118
+ * 4. `cacheCreationAccounting` defaults to `not-reported` when no cache-creation
119
+ * tokens are reported, and is *required* when they are: guessing whether the
120
+ * bucket is disjoint would mis-total every downstream cost calculation.
121
+ * 5. A provider total that disagrees with the canonical total is preserved as
122
+ * reported and flagged `disagrees`. Both numbers survive; neither is edited.
123
+ */
124
+ declare const normalizeUsage: (report: unknown) => UsageNormalizationResult;
125
+ declare class UsageNormalizationError extends Error {
126
+ readonly issues: readonly UsageNormalizationIssue[];
127
+ constructor(issues: readonly UsageNormalizationIssue[]);
128
+ }
129
+ /** Convenience wrapper for call sites that treat invalid usage as a bug. */
130
+ declare const normalizeUsageOrThrow: (report: unknown) => CanonicalUsage;
131
+ declare const EMPTY_DELTA_USAGE: CanonicalUsage;
132
+ type UsageDeltaResult = {
133
+ readonly usage: CanonicalUsage;
134
+ /**
135
+ * True when the current snapshot is smaller than the previous one on any
136
+ * counter. That means the cumulative series restarted (new session, replayed
137
+ * transcript, provider reset), so the current snapshot is emitted as the delta
138
+ * instead of a negative difference.
139
+ */
140
+ readonly resetDetected: boolean;
141
+ };
142
+ /**
143
+ * Convert two cumulative snapshots into a delta observation.
144
+ *
145
+ * Replay safety: re-processing the same snapshot yields an all-zero delta, and a
146
+ * decreasing series is reported as a reset rather than a negative delta.
147
+ * Accounting mode must match; mixing modes would make the subtraction meaningless.
148
+ */
149
+ declare const cumulativeToDelta: (previous: CanonicalUsage, current: CanonicalUsage) => UsageDeltaResult;
150
+ /** Project canonical usage back onto the reported shape. */
151
+ declare const toReport: (usage: CanonicalUsage) => UsageReport;
152
+ /**
153
+ * Add two delta observations. Cumulative usage is never summed, because two
154
+ * running totals do not compose.
155
+ */
156
+ declare const addUsage: (a: CanonicalUsage, b: CanonicalUsage) => CanonicalUsage;
157
+
158
+ /** Model being invoked. Model identifiers are not treated as sensitive. */
159
+ declare const modelDescriptorSchema: z.ZodObject<{
160
+ modelId: z.ZodString;
161
+ vendor: z.ZodOptional<z.ZodString>;
162
+ family: z.ZodOptional<z.ZodString>;
163
+ }, z.core.$strict>;
164
+ type ModelDescriptor = z.infer<typeof modelDescriptorSchema>;
165
+ declare const costFactsSchema: z.ZodObject<{
166
+ currency: z.ZodString;
167
+ amount: z.ZodNumber;
168
+ source: z.ZodEnum<{
169
+ "provider-reported": "provider-reported";
170
+ computed: "computed";
171
+ }>;
172
+ }, z.core.$strict>;
173
+ type CostFacts = z.infer<typeof costFactsSchema>;
174
+ declare const canonicalEventTypeSchema: z.ZodEnum<{
175
+ "session.start": "session.start";
176
+ "session.end": "session.end";
177
+ "prompt.submitted": "prompt.submitted";
178
+ "generation.start": "generation.start";
179
+ "generation.end": "generation.end";
180
+ "tool.start": "tool.start";
181
+ "tool.end": "tool.end";
182
+ "subagent.start": "subagent.start";
183
+ "subagent.end": "subagent.end";
184
+ "compaction.performed": "compaction.performed";
185
+ "error.raised": "error.raised";
186
+ }>;
187
+ type CanonicalEventType = z.infer<typeof canonicalEventTypeSchema>;
188
+ declare const CANONICAL_EVENT_TYPES: ("session.start" | "session.end" | "prompt.submitted" | "generation.start" | "generation.end" | "tool.start" | "tool.end" | "subagent.start" | "subagent.end" | "compaction.performed" | "error.raised")[];
189
+ declare const outcomeSchema: z.ZodEnum<{
190
+ error: "error";
191
+ unknown: "unknown";
192
+ ok: "ok";
193
+ cancelled: "cancelled";
194
+ timeout: "timeout";
195
+ denied: "denied";
196
+ }>;
197
+ type EventOutcome = z.infer<typeof outcomeSchema>;
198
+ declare const sessionStartEventSchema: z.ZodObject<{
199
+ schemaVersion: z.ZodLiteral<1>;
200
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
201
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
202
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
203
+ sequence: z.ZodNumber;
204
+ occurredAt: z.ZodNumber;
205
+ provenance: z.ZodReadonly<z.ZodObject<{
206
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
207
+ providerVersion: z.ZodOptional<z.ZodString>;
208
+ adapterId: z.ZodString;
209
+ adapterVersion: z.ZodString;
210
+ detectionConfidence: z.ZodEnum<{
211
+ none: "none";
212
+ weak: "weak";
213
+ strong: "strong";
214
+ exact: "exact";
215
+ }>;
216
+ sourceEventName: z.ZodOptional<z.ZodString>;
217
+ transport: z.ZodEnum<{
218
+ "hook-stdin": "hook-stdin";
219
+ "cli-argument": "cli-argument";
220
+ "library-call": "library-call";
221
+ "test-fixture": "test-fixture";
222
+ }>;
223
+ }, z.core.$strict>>;
224
+ workspace: z.ZodReadonly<z.ZodObject<{
225
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
226
+ keySource: z.ZodEnum<{
227
+ unknown: "unknown";
228
+ "git-remote": "git-remote";
229
+ "git-root": "git-root";
230
+ "working-directory": "working-directory";
231
+ explicit: "explicit";
232
+ }>;
233
+ repositoryName: z.ZodOptional<z.ZodString>;
234
+ vcsBranchName: z.ZodOptional<z.ZodString>;
235
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
236
+ }, z.core.$strict>>;
237
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
238
+ type: z.ZodLiteral<"session.start">;
239
+ sessionKind: z.ZodEnum<{
240
+ unknown: "unknown";
241
+ interactive: "interactive";
242
+ "non-interactive": "non-interactive";
243
+ }>;
244
+ agentName: z.ZodOptional<z.ZodString>;
245
+ agentVersion: z.ZodOptional<z.ZodString>;
246
+ model: z.ZodOptional<z.ZodObject<{
247
+ modelId: z.ZodString;
248
+ vendor: z.ZodOptional<z.ZodString>;
249
+ family: z.ZodOptional<z.ZodString>;
250
+ }, z.core.$strict>>;
251
+ }, z.core.$strict>;
252
+ declare const sessionEndEventSchema: z.ZodObject<{
253
+ schemaVersion: z.ZodLiteral<1>;
254
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
255
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
256
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
257
+ sequence: z.ZodNumber;
258
+ occurredAt: z.ZodNumber;
259
+ provenance: z.ZodReadonly<z.ZodObject<{
260
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
261
+ providerVersion: z.ZodOptional<z.ZodString>;
262
+ adapterId: z.ZodString;
263
+ adapterVersion: z.ZodString;
264
+ detectionConfidence: z.ZodEnum<{
265
+ none: "none";
266
+ weak: "weak";
267
+ strong: "strong";
268
+ exact: "exact";
269
+ }>;
270
+ sourceEventName: z.ZodOptional<z.ZodString>;
271
+ transport: z.ZodEnum<{
272
+ "hook-stdin": "hook-stdin";
273
+ "cli-argument": "cli-argument";
274
+ "library-call": "library-call";
275
+ "test-fixture": "test-fixture";
276
+ }>;
277
+ }, z.core.$strict>>;
278
+ workspace: z.ZodReadonly<z.ZodObject<{
279
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
280
+ keySource: z.ZodEnum<{
281
+ unknown: "unknown";
282
+ "git-remote": "git-remote";
283
+ "git-root": "git-root";
284
+ "working-directory": "working-directory";
285
+ explicit: "explicit";
286
+ }>;
287
+ repositoryName: z.ZodOptional<z.ZodString>;
288
+ vcsBranchName: z.ZodOptional<z.ZodString>;
289
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
290
+ }, z.core.$strict>>;
291
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
292
+ type: z.ZodLiteral<"session.end">;
293
+ reason: z.ZodEnum<{
294
+ error: "error";
295
+ unknown: "unknown";
296
+ timeout: "timeout";
297
+ completed: "completed";
298
+ aborted: "aborted";
299
+ }>;
300
+ durationMillis: z.ZodOptional<z.ZodNumber>;
301
+ usage: z.ZodOptional<z.ZodObject<{
302
+ temporality: z.ZodEnum<{
303
+ delta: "delta";
304
+ cumulative: "cumulative";
305
+ }>;
306
+ inputTokens: z.ZodNumber;
307
+ cachedInputTokens: z.ZodNumber;
308
+ cacheCreationInputTokens: z.ZodNumber;
309
+ cacheCreationAccounting: z.ZodEnum<{
310
+ "included-in-input": "included-in-input";
311
+ "disjoint-from-input": "disjoint-from-input";
312
+ "not-reported": "not-reported";
313
+ }>;
314
+ outputTokens: z.ZodNumber;
315
+ reasoningOutputTokens: z.ZodNumber;
316
+ uncachedInputTokens: z.ZodNumber;
317
+ totalTokens: z.ZodNumber;
318
+ providerTotalTokens: z.ZodOptional<z.ZodNumber>;
319
+ providerTotalAgreement: z.ZodEnum<{
320
+ unreported: "unreported";
321
+ agrees: "agrees";
322
+ disagrees: "disagrees";
323
+ }>;
324
+ }, z.core.$strict>>;
325
+ cost: z.ZodOptional<z.ZodObject<{
326
+ currency: z.ZodString;
327
+ amount: z.ZodNumber;
328
+ source: z.ZodEnum<{
329
+ "provider-reported": "provider-reported";
330
+ computed: "computed";
331
+ }>;
332
+ }, z.core.$strict>>;
333
+ }, z.core.$strict>;
334
+ declare const promptSubmittedEventSchema: z.ZodObject<{
335
+ schemaVersion: z.ZodLiteral<1>;
336
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
337
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
338
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
339
+ sequence: z.ZodNumber;
340
+ occurredAt: z.ZodNumber;
341
+ provenance: z.ZodReadonly<z.ZodObject<{
342
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
343
+ providerVersion: z.ZodOptional<z.ZodString>;
344
+ adapterId: z.ZodString;
345
+ adapterVersion: z.ZodString;
346
+ detectionConfidence: z.ZodEnum<{
347
+ none: "none";
348
+ weak: "weak";
349
+ strong: "strong";
350
+ exact: "exact";
351
+ }>;
352
+ sourceEventName: z.ZodOptional<z.ZodString>;
353
+ transport: z.ZodEnum<{
354
+ "hook-stdin": "hook-stdin";
355
+ "cli-argument": "cli-argument";
356
+ "library-call": "library-call";
357
+ "test-fixture": "test-fixture";
358
+ }>;
359
+ }, z.core.$strict>>;
360
+ workspace: z.ZodReadonly<z.ZodObject<{
361
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
362
+ keySource: z.ZodEnum<{
363
+ unknown: "unknown";
364
+ "git-remote": "git-remote";
365
+ "git-root": "git-root";
366
+ "working-directory": "working-directory";
367
+ explicit: "explicit";
368
+ }>;
369
+ repositoryName: z.ZodOptional<z.ZodString>;
370
+ vcsBranchName: z.ZodOptional<z.ZodString>;
371
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
372
+ }, z.core.$strict>>;
373
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
374
+ type: z.ZodLiteral<"prompt.submitted">;
375
+ promptSource: z.ZodEnum<{
376
+ unknown: "unknown";
377
+ user: "user";
378
+ automation: "automation";
379
+ resumed: "resumed";
380
+ }>;
381
+ content: z.ZodOptional<z.ZodObject<{
382
+ kind: z.ZodEnum<{
383
+ prompt: "prompt";
384
+ response: "response";
385
+ reasoning: "reasoning";
386
+ "tool-input": "tool-input";
387
+ "tool-output": "tool-output";
388
+ "error-message": "error-message";
389
+ "system-instruction": "system-instruction";
390
+ attachment: "attachment";
391
+ }>;
392
+ role: z.ZodOptional<z.ZodEnum<{
393
+ unknown: "unknown";
394
+ user: "user";
395
+ assistant: "assistant";
396
+ system: "system";
397
+ tool: "tool";
398
+ }>>;
399
+ characterLength: z.ZodNumber;
400
+ byteLength: z.ZodNumber;
401
+ contentHash: z.ZodString;
402
+ disclosure: z.ZodEnum<{
403
+ omitted: "omitted";
404
+ masked: "masked";
405
+ redacted: "redacted";
406
+ raw: "raw";
407
+ }>;
408
+ text: z.ZodOptional<z.ZodString>;
409
+ truncated: z.ZodBoolean;
410
+ secretsRedacted: z.ZodNumber;
411
+ label: z.ZodOptional<z.ZodString>;
412
+ }, z.core.$strict>>;
413
+ turnIndex: z.ZodOptional<z.ZodNumber>;
414
+ }, z.core.$strict>;
415
+ declare const generationStartEventSchema: z.ZodObject<{
416
+ schemaVersion: z.ZodLiteral<1>;
417
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
418
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
419
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
420
+ sequence: z.ZodNumber;
421
+ occurredAt: z.ZodNumber;
422
+ provenance: z.ZodReadonly<z.ZodObject<{
423
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
424
+ providerVersion: z.ZodOptional<z.ZodString>;
425
+ adapterId: z.ZodString;
426
+ adapterVersion: z.ZodString;
427
+ detectionConfidence: z.ZodEnum<{
428
+ none: "none";
429
+ weak: "weak";
430
+ strong: "strong";
431
+ exact: "exact";
432
+ }>;
433
+ sourceEventName: z.ZodOptional<z.ZodString>;
434
+ transport: z.ZodEnum<{
435
+ "hook-stdin": "hook-stdin";
436
+ "cli-argument": "cli-argument";
437
+ "library-call": "library-call";
438
+ "test-fixture": "test-fixture";
439
+ }>;
440
+ }, z.core.$strict>>;
441
+ workspace: z.ZodReadonly<z.ZodObject<{
442
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
443
+ keySource: z.ZodEnum<{
444
+ unknown: "unknown";
445
+ "git-remote": "git-remote";
446
+ "git-root": "git-root";
447
+ "working-directory": "working-directory";
448
+ explicit: "explicit";
449
+ }>;
450
+ repositoryName: z.ZodOptional<z.ZodString>;
451
+ vcsBranchName: z.ZodOptional<z.ZodString>;
452
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
453
+ }, z.core.$strict>>;
454
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
455
+ type: z.ZodLiteral<"generation.start">;
456
+ generationId: z.ZodString;
457
+ model: z.ZodObject<{
458
+ modelId: z.ZodString;
459
+ vendor: z.ZodOptional<z.ZodString>;
460
+ family: z.ZodOptional<z.ZodString>;
461
+ }, z.core.$strict>;
462
+ requestedMaxOutputTokens: z.ZodOptional<z.ZodNumber>;
463
+ inputContent: z.ZodOptional<z.ZodArray<z.ZodObject<{
464
+ kind: z.ZodEnum<{
465
+ prompt: "prompt";
466
+ response: "response";
467
+ reasoning: "reasoning";
468
+ "tool-input": "tool-input";
469
+ "tool-output": "tool-output";
470
+ "error-message": "error-message";
471
+ "system-instruction": "system-instruction";
472
+ attachment: "attachment";
473
+ }>;
474
+ role: z.ZodOptional<z.ZodEnum<{
475
+ unknown: "unknown";
476
+ user: "user";
477
+ assistant: "assistant";
478
+ system: "system";
479
+ tool: "tool";
480
+ }>>;
481
+ characterLength: z.ZodNumber;
482
+ byteLength: z.ZodNumber;
483
+ contentHash: z.ZodString;
484
+ disclosure: z.ZodEnum<{
485
+ omitted: "omitted";
486
+ masked: "masked";
487
+ redacted: "redacted";
488
+ raw: "raw";
489
+ }>;
490
+ text: z.ZodOptional<z.ZodString>;
491
+ truncated: z.ZodBoolean;
492
+ secretsRedacted: z.ZodNumber;
493
+ label: z.ZodOptional<z.ZodString>;
494
+ }, z.core.$strict>>>;
495
+ }, z.core.$strict>;
496
+ declare const generationEndEventSchema: z.ZodObject<{
497
+ schemaVersion: z.ZodLiteral<1>;
498
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
499
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
500
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
501
+ sequence: z.ZodNumber;
502
+ occurredAt: z.ZodNumber;
503
+ provenance: z.ZodReadonly<z.ZodObject<{
504
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
505
+ providerVersion: z.ZodOptional<z.ZodString>;
506
+ adapterId: z.ZodString;
507
+ adapterVersion: z.ZodString;
508
+ detectionConfidence: z.ZodEnum<{
509
+ none: "none";
510
+ weak: "weak";
511
+ strong: "strong";
512
+ exact: "exact";
513
+ }>;
514
+ sourceEventName: z.ZodOptional<z.ZodString>;
515
+ transport: z.ZodEnum<{
516
+ "hook-stdin": "hook-stdin";
517
+ "cli-argument": "cli-argument";
518
+ "library-call": "library-call";
519
+ "test-fixture": "test-fixture";
520
+ }>;
521
+ }, z.core.$strict>>;
522
+ workspace: z.ZodReadonly<z.ZodObject<{
523
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
524
+ keySource: z.ZodEnum<{
525
+ unknown: "unknown";
526
+ "git-remote": "git-remote";
527
+ "git-root": "git-root";
528
+ "working-directory": "working-directory";
529
+ explicit: "explicit";
530
+ }>;
531
+ repositoryName: z.ZodOptional<z.ZodString>;
532
+ vcsBranchName: z.ZodOptional<z.ZodString>;
533
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
534
+ }, z.core.$strict>>;
535
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
536
+ type: z.ZodLiteral<"generation.end">;
537
+ generationId: z.ZodString;
538
+ model: z.ZodObject<{
539
+ modelId: z.ZodString;
540
+ vendor: z.ZodOptional<z.ZodString>;
541
+ family: z.ZodOptional<z.ZodString>;
542
+ }, z.core.$strict>;
543
+ outcome: z.ZodEnum<{
544
+ error: "error";
545
+ unknown: "unknown";
546
+ ok: "ok";
547
+ cancelled: "cancelled";
548
+ timeout: "timeout";
549
+ denied: "denied";
550
+ }>;
551
+ stopReason: z.ZodOptional<z.ZodString>;
552
+ durationMillis: z.ZodOptional<z.ZodNumber>;
553
+ usage: z.ZodOptional<z.ZodObject<{
554
+ temporality: z.ZodEnum<{
555
+ delta: "delta";
556
+ cumulative: "cumulative";
557
+ }>;
558
+ inputTokens: z.ZodNumber;
559
+ cachedInputTokens: z.ZodNumber;
560
+ cacheCreationInputTokens: z.ZodNumber;
561
+ cacheCreationAccounting: z.ZodEnum<{
562
+ "included-in-input": "included-in-input";
563
+ "disjoint-from-input": "disjoint-from-input";
564
+ "not-reported": "not-reported";
565
+ }>;
566
+ outputTokens: z.ZodNumber;
567
+ reasoningOutputTokens: z.ZodNumber;
568
+ uncachedInputTokens: z.ZodNumber;
569
+ totalTokens: z.ZodNumber;
570
+ providerTotalTokens: z.ZodOptional<z.ZodNumber>;
571
+ providerTotalAgreement: z.ZodEnum<{
572
+ unreported: "unreported";
573
+ agrees: "agrees";
574
+ disagrees: "disagrees";
575
+ }>;
576
+ }, z.core.$strict>>;
577
+ cost: z.ZodOptional<z.ZodObject<{
578
+ currency: z.ZodString;
579
+ amount: z.ZodNumber;
580
+ source: z.ZodEnum<{
581
+ "provider-reported": "provider-reported";
582
+ computed: "computed";
583
+ }>;
584
+ }, z.core.$strict>>;
585
+ outputContent: z.ZodOptional<z.ZodArray<z.ZodObject<{
586
+ kind: z.ZodEnum<{
587
+ prompt: "prompt";
588
+ response: "response";
589
+ reasoning: "reasoning";
590
+ "tool-input": "tool-input";
591
+ "tool-output": "tool-output";
592
+ "error-message": "error-message";
593
+ "system-instruction": "system-instruction";
594
+ attachment: "attachment";
595
+ }>;
596
+ role: z.ZodOptional<z.ZodEnum<{
597
+ unknown: "unknown";
598
+ user: "user";
599
+ assistant: "assistant";
600
+ system: "system";
601
+ tool: "tool";
602
+ }>>;
603
+ characterLength: z.ZodNumber;
604
+ byteLength: z.ZodNumber;
605
+ contentHash: z.ZodString;
606
+ disclosure: z.ZodEnum<{
607
+ omitted: "omitted";
608
+ masked: "masked";
609
+ redacted: "redacted";
610
+ raw: "raw";
611
+ }>;
612
+ text: z.ZodOptional<z.ZodString>;
613
+ truncated: z.ZodBoolean;
614
+ secretsRedacted: z.ZodNumber;
615
+ label: z.ZodOptional<z.ZodString>;
616
+ }, z.core.$strict>>>;
617
+ }, z.core.$strict>;
618
+ declare const toolKindSchema: z.ZodEnum<{
619
+ unknown: "unknown";
620
+ read: "read";
621
+ write: "write";
622
+ execute: "execute";
623
+ search: "search";
624
+ network: "network";
625
+ delegate: "delegate";
626
+ other: "other";
627
+ }>;
628
+ type ToolKind = z.infer<typeof toolKindSchema>;
629
+ declare const toolStartEventSchema: z.ZodObject<{
630
+ schemaVersion: z.ZodLiteral<1>;
631
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
632
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
633
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
634
+ sequence: z.ZodNumber;
635
+ occurredAt: z.ZodNumber;
636
+ provenance: z.ZodReadonly<z.ZodObject<{
637
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
638
+ providerVersion: z.ZodOptional<z.ZodString>;
639
+ adapterId: z.ZodString;
640
+ adapterVersion: z.ZodString;
641
+ detectionConfidence: z.ZodEnum<{
642
+ none: "none";
643
+ weak: "weak";
644
+ strong: "strong";
645
+ exact: "exact";
646
+ }>;
647
+ sourceEventName: z.ZodOptional<z.ZodString>;
648
+ transport: z.ZodEnum<{
649
+ "hook-stdin": "hook-stdin";
650
+ "cli-argument": "cli-argument";
651
+ "library-call": "library-call";
652
+ "test-fixture": "test-fixture";
653
+ }>;
654
+ }, z.core.$strict>>;
655
+ workspace: z.ZodReadonly<z.ZodObject<{
656
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
657
+ keySource: z.ZodEnum<{
658
+ unknown: "unknown";
659
+ "git-remote": "git-remote";
660
+ "git-root": "git-root";
661
+ "working-directory": "working-directory";
662
+ explicit: "explicit";
663
+ }>;
664
+ repositoryName: z.ZodOptional<z.ZodString>;
665
+ vcsBranchName: z.ZodOptional<z.ZodString>;
666
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
667
+ }, z.core.$strict>>;
668
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
669
+ type: z.ZodLiteral<"tool.start">;
670
+ toolCallId: z.ZodString;
671
+ toolName: z.ZodString;
672
+ toolKind: z.ZodEnum<{
673
+ unknown: "unknown";
674
+ read: "read";
675
+ write: "write";
676
+ execute: "execute";
677
+ search: "search";
678
+ network: "network";
679
+ delegate: "delegate";
680
+ other: "other";
681
+ }>;
682
+ generationId: z.ZodOptional<z.ZodString>;
683
+ input: z.ZodOptional<z.ZodObject<{
684
+ kind: z.ZodEnum<{
685
+ prompt: "prompt";
686
+ response: "response";
687
+ reasoning: "reasoning";
688
+ "tool-input": "tool-input";
689
+ "tool-output": "tool-output";
690
+ "error-message": "error-message";
691
+ "system-instruction": "system-instruction";
692
+ attachment: "attachment";
693
+ }>;
694
+ role: z.ZodOptional<z.ZodEnum<{
695
+ unknown: "unknown";
696
+ user: "user";
697
+ assistant: "assistant";
698
+ system: "system";
699
+ tool: "tool";
700
+ }>>;
701
+ characterLength: z.ZodNumber;
702
+ byteLength: z.ZodNumber;
703
+ contentHash: z.ZodString;
704
+ disclosure: z.ZodEnum<{
705
+ omitted: "omitted";
706
+ masked: "masked";
707
+ redacted: "redacted";
708
+ raw: "raw";
709
+ }>;
710
+ text: z.ZodOptional<z.ZodString>;
711
+ truncated: z.ZodBoolean;
712
+ secretsRedacted: z.ZodNumber;
713
+ label: z.ZodOptional<z.ZodString>;
714
+ }, z.core.$strict>>;
715
+ }, z.core.$strict>;
716
+ declare const toolEndEventSchema: z.ZodObject<{
717
+ schemaVersion: z.ZodLiteral<1>;
718
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
719
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
720
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
721
+ sequence: z.ZodNumber;
722
+ occurredAt: z.ZodNumber;
723
+ provenance: z.ZodReadonly<z.ZodObject<{
724
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
725
+ providerVersion: z.ZodOptional<z.ZodString>;
726
+ adapterId: z.ZodString;
727
+ adapterVersion: z.ZodString;
728
+ detectionConfidence: z.ZodEnum<{
729
+ none: "none";
730
+ weak: "weak";
731
+ strong: "strong";
732
+ exact: "exact";
733
+ }>;
734
+ sourceEventName: z.ZodOptional<z.ZodString>;
735
+ transport: z.ZodEnum<{
736
+ "hook-stdin": "hook-stdin";
737
+ "cli-argument": "cli-argument";
738
+ "library-call": "library-call";
739
+ "test-fixture": "test-fixture";
740
+ }>;
741
+ }, z.core.$strict>>;
742
+ workspace: z.ZodReadonly<z.ZodObject<{
743
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
744
+ keySource: z.ZodEnum<{
745
+ unknown: "unknown";
746
+ "git-remote": "git-remote";
747
+ "git-root": "git-root";
748
+ "working-directory": "working-directory";
749
+ explicit: "explicit";
750
+ }>;
751
+ repositoryName: z.ZodOptional<z.ZodString>;
752
+ vcsBranchName: z.ZodOptional<z.ZodString>;
753
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
754
+ }, z.core.$strict>>;
755
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
756
+ type: z.ZodLiteral<"tool.end">;
757
+ toolCallId: z.ZodString;
758
+ toolName: z.ZodString;
759
+ outcome: z.ZodEnum<{
760
+ error: "error";
761
+ unknown: "unknown";
762
+ ok: "ok";
763
+ cancelled: "cancelled";
764
+ timeout: "timeout";
765
+ denied: "denied";
766
+ }>;
767
+ durationMillis: z.ZodOptional<z.ZodNumber>;
768
+ permissionDecision: z.ZodOptional<z.ZodEnum<{
769
+ denied: "denied";
770
+ allowed: "allowed";
771
+ deferred: "deferred";
772
+ "not-required": "not-required";
773
+ }>>;
774
+ output: z.ZodOptional<z.ZodObject<{
775
+ kind: z.ZodEnum<{
776
+ prompt: "prompt";
777
+ response: "response";
778
+ reasoning: "reasoning";
779
+ "tool-input": "tool-input";
780
+ "tool-output": "tool-output";
781
+ "error-message": "error-message";
782
+ "system-instruction": "system-instruction";
783
+ attachment: "attachment";
784
+ }>;
785
+ role: z.ZodOptional<z.ZodEnum<{
786
+ unknown: "unknown";
787
+ user: "user";
788
+ assistant: "assistant";
789
+ system: "system";
790
+ tool: "tool";
791
+ }>>;
792
+ characterLength: z.ZodNumber;
793
+ byteLength: z.ZodNumber;
794
+ contentHash: z.ZodString;
795
+ disclosure: z.ZodEnum<{
796
+ omitted: "omitted";
797
+ masked: "masked";
798
+ redacted: "redacted";
799
+ raw: "raw";
800
+ }>;
801
+ text: z.ZodOptional<z.ZodString>;
802
+ truncated: z.ZodBoolean;
803
+ secretsRedacted: z.ZodNumber;
804
+ label: z.ZodOptional<z.ZodString>;
805
+ }, z.core.$strict>>;
806
+ }, z.core.$strict>;
807
+ declare const subagentStartEventSchema: z.ZodObject<{
808
+ schemaVersion: z.ZodLiteral<1>;
809
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
810
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
811
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
812
+ sequence: z.ZodNumber;
813
+ occurredAt: z.ZodNumber;
814
+ provenance: z.ZodReadonly<z.ZodObject<{
815
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
816
+ providerVersion: z.ZodOptional<z.ZodString>;
817
+ adapterId: z.ZodString;
818
+ adapterVersion: z.ZodString;
819
+ detectionConfidence: z.ZodEnum<{
820
+ none: "none";
821
+ weak: "weak";
822
+ strong: "strong";
823
+ exact: "exact";
824
+ }>;
825
+ sourceEventName: z.ZodOptional<z.ZodString>;
826
+ transport: z.ZodEnum<{
827
+ "hook-stdin": "hook-stdin";
828
+ "cli-argument": "cli-argument";
829
+ "library-call": "library-call";
830
+ "test-fixture": "test-fixture";
831
+ }>;
832
+ }, z.core.$strict>>;
833
+ workspace: z.ZodReadonly<z.ZodObject<{
834
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
835
+ keySource: z.ZodEnum<{
836
+ unknown: "unknown";
837
+ "git-remote": "git-remote";
838
+ "git-root": "git-root";
839
+ "working-directory": "working-directory";
840
+ explicit: "explicit";
841
+ }>;
842
+ repositoryName: z.ZodOptional<z.ZodString>;
843
+ vcsBranchName: z.ZodOptional<z.ZodString>;
844
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
845
+ }, z.core.$strict>>;
846
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
847
+ type: z.ZodLiteral<"subagent.start">;
848
+ subagentInvocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
849
+ subagentType: z.ZodOptional<z.ZodString>;
850
+ delegationDepth: z.ZodNumber;
851
+ model: z.ZodOptional<z.ZodObject<{
852
+ modelId: z.ZodString;
853
+ vendor: z.ZodOptional<z.ZodString>;
854
+ family: z.ZodOptional<z.ZodString>;
855
+ }, z.core.$strict>>;
856
+ }, z.core.$strict>;
857
+ declare const subagentEndEventSchema: z.ZodObject<{
858
+ schemaVersion: z.ZodLiteral<1>;
859
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
860
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
861
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
862
+ sequence: z.ZodNumber;
863
+ occurredAt: z.ZodNumber;
864
+ provenance: z.ZodReadonly<z.ZodObject<{
865
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
866
+ providerVersion: z.ZodOptional<z.ZodString>;
867
+ adapterId: z.ZodString;
868
+ adapterVersion: z.ZodString;
869
+ detectionConfidence: z.ZodEnum<{
870
+ none: "none";
871
+ weak: "weak";
872
+ strong: "strong";
873
+ exact: "exact";
874
+ }>;
875
+ sourceEventName: z.ZodOptional<z.ZodString>;
876
+ transport: z.ZodEnum<{
877
+ "hook-stdin": "hook-stdin";
878
+ "cli-argument": "cli-argument";
879
+ "library-call": "library-call";
880
+ "test-fixture": "test-fixture";
881
+ }>;
882
+ }, z.core.$strict>>;
883
+ workspace: z.ZodReadonly<z.ZodObject<{
884
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
885
+ keySource: z.ZodEnum<{
886
+ unknown: "unknown";
887
+ "git-remote": "git-remote";
888
+ "git-root": "git-root";
889
+ "working-directory": "working-directory";
890
+ explicit: "explicit";
891
+ }>;
892
+ repositoryName: z.ZodOptional<z.ZodString>;
893
+ vcsBranchName: z.ZodOptional<z.ZodString>;
894
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
895
+ }, z.core.$strict>>;
896
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
897
+ type: z.ZodLiteral<"subagent.end">;
898
+ subagentInvocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
899
+ outcome: z.ZodEnum<{
900
+ error: "error";
901
+ unknown: "unknown";
902
+ ok: "ok";
903
+ cancelled: "cancelled";
904
+ timeout: "timeout";
905
+ denied: "denied";
906
+ }>;
907
+ durationMillis: z.ZodOptional<z.ZodNumber>;
908
+ usage: z.ZodOptional<z.ZodObject<{
909
+ temporality: z.ZodEnum<{
910
+ delta: "delta";
911
+ cumulative: "cumulative";
912
+ }>;
913
+ inputTokens: z.ZodNumber;
914
+ cachedInputTokens: z.ZodNumber;
915
+ cacheCreationInputTokens: z.ZodNumber;
916
+ cacheCreationAccounting: z.ZodEnum<{
917
+ "included-in-input": "included-in-input";
918
+ "disjoint-from-input": "disjoint-from-input";
919
+ "not-reported": "not-reported";
920
+ }>;
921
+ outputTokens: z.ZodNumber;
922
+ reasoningOutputTokens: z.ZodNumber;
923
+ uncachedInputTokens: z.ZodNumber;
924
+ totalTokens: z.ZodNumber;
925
+ providerTotalTokens: z.ZodOptional<z.ZodNumber>;
926
+ providerTotalAgreement: z.ZodEnum<{
927
+ unreported: "unreported";
928
+ agrees: "agrees";
929
+ disagrees: "disagrees";
930
+ }>;
931
+ }, z.core.$strict>>;
932
+ }, z.core.$strict>;
933
+ declare const compactionPerformedEventSchema: z.ZodObject<{
934
+ schemaVersion: z.ZodLiteral<1>;
935
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
936
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
937
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
938
+ sequence: z.ZodNumber;
939
+ occurredAt: z.ZodNumber;
940
+ provenance: z.ZodReadonly<z.ZodObject<{
941
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
942
+ providerVersion: z.ZodOptional<z.ZodString>;
943
+ adapterId: z.ZodString;
944
+ adapterVersion: z.ZodString;
945
+ detectionConfidence: z.ZodEnum<{
946
+ none: "none";
947
+ weak: "weak";
948
+ strong: "strong";
949
+ exact: "exact";
950
+ }>;
951
+ sourceEventName: z.ZodOptional<z.ZodString>;
952
+ transport: z.ZodEnum<{
953
+ "hook-stdin": "hook-stdin";
954
+ "cli-argument": "cli-argument";
955
+ "library-call": "library-call";
956
+ "test-fixture": "test-fixture";
957
+ }>;
958
+ }, z.core.$strict>>;
959
+ workspace: z.ZodReadonly<z.ZodObject<{
960
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
961
+ keySource: z.ZodEnum<{
962
+ unknown: "unknown";
963
+ "git-remote": "git-remote";
964
+ "git-root": "git-root";
965
+ "working-directory": "working-directory";
966
+ explicit: "explicit";
967
+ }>;
968
+ repositoryName: z.ZodOptional<z.ZodString>;
969
+ vcsBranchName: z.ZodOptional<z.ZodString>;
970
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
971
+ }, z.core.$strict>>;
972
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
973
+ type: z.ZodLiteral<"compaction.performed">;
974
+ trigger: z.ZodEnum<{
975
+ unknown: "unknown";
976
+ automatic: "automatic";
977
+ manual: "manual";
978
+ }>;
979
+ contextTokensBefore: z.ZodOptional<z.ZodNumber>;
980
+ contextTokensAfter: z.ZodOptional<z.ZodNumber>;
981
+ droppedMessageCount: z.ZodOptional<z.ZodNumber>;
982
+ usage: z.ZodOptional<z.ZodObject<{
983
+ temporality: z.ZodEnum<{
984
+ delta: "delta";
985
+ cumulative: "cumulative";
986
+ }>;
987
+ inputTokens: z.ZodNumber;
988
+ cachedInputTokens: z.ZodNumber;
989
+ cacheCreationInputTokens: z.ZodNumber;
990
+ cacheCreationAccounting: z.ZodEnum<{
991
+ "included-in-input": "included-in-input";
992
+ "disjoint-from-input": "disjoint-from-input";
993
+ "not-reported": "not-reported";
994
+ }>;
995
+ outputTokens: z.ZodNumber;
996
+ reasoningOutputTokens: z.ZodNumber;
997
+ uncachedInputTokens: z.ZodNumber;
998
+ totalTokens: z.ZodNumber;
999
+ providerTotalTokens: z.ZodOptional<z.ZodNumber>;
1000
+ providerTotalAgreement: z.ZodEnum<{
1001
+ unreported: "unreported";
1002
+ agrees: "agrees";
1003
+ disagrees: "disagrees";
1004
+ }>;
1005
+ }, z.core.$strict>>;
1006
+ }, z.core.$strict>;
1007
+ declare const errorRaisedEventSchema: z.ZodObject<{
1008
+ schemaVersion: z.ZodLiteral<1>;
1009
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1010
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1011
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1012
+ sequence: z.ZodNumber;
1013
+ occurredAt: z.ZodNumber;
1014
+ provenance: z.ZodReadonly<z.ZodObject<{
1015
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1016
+ providerVersion: z.ZodOptional<z.ZodString>;
1017
+ adapterId: z.ZodString;
1018
+ adapterVersion: z.ZodString;
1019
+ detectionConfidence: z.ZodEnum<{
1020
+ none: "none";
1021
+ weak: "weak";
1022
+ strong: "strong";
1023
+ exact: "exact";
1024
+ }>;
1025
+ sourceEventName: z.ZodOptional<z.ZodString>;
1026
+ transport: z.ZodEnum<{
1027
+ "hook-stdin": "hook-stdin";
1028
+ "cli-argument": "cli-argument";
1029
+ "library-call": "library-call";
1030
+ "test-fixture": "test-fixture";
1031
+ }>;
1032
+ }, z.core.$strict>>;
1033
+ workspace: z.ZodReadonly<z.ZodObject<{
1034
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1035
+ keySource: z.ZodEnum<{
1036
+ unknown: "unknown";
1037
+ "git-remote": "git-remote";
1038
+ "git-root": "git-root";
1039
+ "working-directory": "working-directory";
1040
+ explicit: "explicit";
1041
+ }>;
1042
+ repositoryName: z.ZodOptional<z.ZodString>;
1043
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1044
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1045
+ }, z.core.$strict>>;
1046
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1047
+ type: z.ZodLiteral<"error.raised">;
1048
+ errorCode: z.ZodEnum<{
1049
+ "invalid-input": "invalid-input";
1050
+ "schema-validation-failed": "schema-validation-failed";
1051
+ "provider-unknown": "provider-unknown";
1052
+ "provider-detection-ambiguous": "provider-detection-ambiguous";
1053
+ "provider-adapter-failure": "provider-adapter-failure";
1054
+ "identity-conflict": "identity-conflict";
1055
+ "identity-incomplete": "identity-incomplete";
1056
+ "usage-invalid": "usage-invalid";
1057
+ "state-store-failure": "state-store-failure";
1058
+ "telemetry-export-failure": "telemetry-export-failure";
1059
+ "privacy-policy-violation": "privacy-policy-violation";
1060
+ "configuration-invalid": "configuration-invalid";
1061
+ "limit-exceeded": "limit-exceeded";
1062
+ "delivery-identifier-unavailable": "delivery-identifier-unavailable";
1063
+ "delivery-claim-superseded": "delivery-claim-superseded";
1064
+ "internal-error": "internal-error";
1065
+ }>;
1066
+ severity: z.ZodEnum<{
1067
+ error: "error";
1068
+ warning: "warning";
1069
+ }>;
1070
+ phase: z.ZodEnum<{
1071
+ identity: "identity";
1072
+ configuration: "configuration";
1073
+ detection: "detection";
1074
+ parsing: "parsing";
1075
+ normalization: "normalization";
1076
+ privacy: "privacy";
1077
+ state: "state";
1078
+ export: "export";
1079
+ shutdown: "shutdown";
1080
+ }>;
1081
+ retryable: z.ZodBoolean;
1082
+ message: z.ZodOptional<z.ZodObject<{
1083
+ kind: z.ZodEnum<{
1084
+ prompt: "prompt";
1085
+ response: "response";
1086
+ reasoning: "reasoning";
1087
+ "tool-input": "tool-input";
1088
+ "tool-output": "tool-output";
1089
+ "error-message": "error-message";
1090
+ "system-instruction": "system-instruction";
1091
+ attachment: "attachment";
1092
+ }>;
1093
+ role: z.ZodOptional<z.ZodEnum<{
1094
+ unknown: "unknown";
1095
+ user: "user";
1096
+ assistant: "assistant";
1097
+ system: "system";
1098
+ tool: "tool";
1099
+ }>>;
1100
+ characterLength: z.ZodNumber;
1101
+ byteLength: z.ZodNumber;
1102
+ contentHash: z.ZodString;
1103
+ disclosure: z.ZodEnum<{
1104
+ omitted: "omitted";
1105
+ masked: "masked";
1106
+ redacted: "redacted";
1107
+ raw: "raw";
1108
+ }>;
1109
+ text: z.ZodOptional<z.ZodString>;
1110
+ truncated: z.ZodBoolean;
1111
+ secretsRedacted: z.ZodNumber;
1112
+ label: z.ZodOptional<z.ZodString>;
1113
+ }, z.core.$strict>>;
1114
+ detail: z.ZodOptional<z.ZodString>;
1115
+ }, z.core.$strict>;
1116
+ declare const canonicalEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1117
+ schemaVersion: z.ZodLiteral<1>;
1118
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1119
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1120
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1121
+ sequence: z.ZodNumber;
1122
+ occurredAt: z.ZodNumber;
1123
+ provenance: z.ZodReadonly<z.ZodObject<{
1124
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1125
+ providerVersion: z.ZodOptional<z.ZodString>;
1126
+ adapterId: z.ZodString;
1127
+ adapterVersion: z.ZodString;
1128
+ detectionConfidence: z.ZodEnum<{
1129
+ none: "none";
1130
+ weak: "weak";
1131
+ strong: "strong";
1132
+ exact: "exact";
1133
+ }>;
1134
+ sourceEventName: z.ZodOptional<z.ZodString>;
1135
+ transport: z.ZodEnum<{
1136
+ "hook-stdin": "hook-stdin";
1137
+ "cli-argument": "cli-argument";
1138
+ "library-call": "library-call";
1139
+ "test-fixture": "test-fixture";
1140
+ }>;
1141
+ }, z.core.$strict>>;
1142
+ workspace: z.ZodReadonly<z.ZodObject<{
1143
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1144
+ keySource: z.ZodEnum<{
1145
+ unknown: "unknown";
1146
+ "git-remote": "git-remote";
1147
+ "git-root": "git-root";
1148
+ "working-directory": "working-directory";
1149
+ explicit: "explicit";
1150
+ }>;
1151
+ repositoryName: z.ZodOptional<z.ZodString>;
1152
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1153
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1154
+ }, z.core.$strict>>;
1155
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1156
+ type: z.ZodLiteral<"session.start">;
1157
+ sessionKind: z.ZodEnum<{
1158
+ unknown: "unknown";
1159
+ interactive: "interactive";
1160
+ "non-interactive": "non-interactive";
1161
+ }>;
1162
+ agentName: z.ZodOptional<z.ZodString>;
1163
+ agentVersion: z.ZodOptional<z.ZodString>;
1164
+ model: z.ZodOptional<z.ZodObject<{
1165
+ modelId: z.ZodString;
1166
+ vendor: z.ZodOptional<z.ZodString>;
1167
+ family: z.ZodOptional<z.ZodString>;
1168
+ }, z.core.$strict>>;
1169
+ }, z.core.$strict>, z.ZodObject<{
1170
+ schemaVersion: z.ZodLiteral<1>;
1171
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1172
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1173
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1174
+ sequence: z.ZodNumber;
1175
+ occurredAt: z.ZodNumber;
1176
+ provenance: z.ZodReadonly<z.ZodObject<{
1177
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1178
+ providerVersion: z.ZodOptional<z.ZodString>;
1179
+ adapterId: z.ZodString;
1180
+ adapterVersion: z.ZodString;
1181
+ detectionConfidence: z.ZodEnum<{
1182
+ none: "none";
1183
+ weak: "weak";
1184
+ strong: "strong";
1185
+ exact: "exact";
1186
+ }>;
1187
+ sourceEventName: z.ZodOptional<z.ZodString>;
1188
+ transport: z.ZodEnum<{
1189
+ "hook-stdin": "hook-stdin";
1190
+ "cli-argument": "cli-argument";
1191
+ "library-call": "library-call";
1192
+ "test-fixture": "test-fixture";
1193
+ }>;
1194
+ }, z.core.$strict>>;
1195
+ workspace: z.ZodReadonly<z.ZodObject<{
1196
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1197
+ keySource: z.ZodEnum<{
1198
+ unknown: "unknown";
1199
+ "git-remote": "git-remote";
1200
+ "git-root": "git-root";
1201
+ "working-directory": "working-directory";
1202
+ explicit: "explicit";
1203
+ }>;
1204
+ repositoryName: z.ZodOptional<z.ZodString>;
1205
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1206
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1207
+ }, z.core.$strict>>;
1208
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1209
+ type: z.ZodLiteral<"session.end">;
1210
+ reason: z.ZodEnum<{
1211
+ error: "error";
1212
+ unknown: "unknown";
1213
+ timeout: "timeout";
1214
+ completed: "completed";
1215
+ aborted: "aborted";
1216
+ }>;
1217
+ durationMillis: z.ZodOptional<z.ZodNumber>;
1218
+ usage: z.ZodOptional<z.ZodObject<{
1219
+ temporality: z.ZodEnum<{
1220
+ delta: "delta";
1221
+ cumulative: "cumulative";
1222
+ }>;
1223
+ inputTokens: z.ZodNumber;
1224
+ cachedInputTokens: z.ZodNumber;
1225
+ cacheCreationInputTokens: z.ZodNumber;
1226
+ cacheCreationAccounting: z.ZodEnum<{
1227
+ "included-in-input": "included-in-input";
1228
+ "disjoint-from-input": "disjoint-from-input";
1229
+ "not-reported": "not-reported";
1230
+ }>;
1231
+ outputTokens: z.ZodNumber;
1232
+ reasoningOutputTokens: z.ZodNumber;
1233
+ uncachedInputTokens: z.ZodNumber;
1234
+ totalTokens: z.ZodNumber;
1235
+ providerTotalTokens: z.ZodOptional<z.ZodNumber>;
1236
+ providerTotalAgreement: z.ZodEnum<{
1237
+ unreported: "unreported";
1238
+ agrees: "agrees";
1239
+ disagrees: "disagrees";
1240
+ }>;
1241
+ }, z.core.$strict>>;
1242
+ cost: z.ZodOptional<z.ZodObject<{
1243
+ currency: z.ZodString;
1244
+ amount: z.ZodNumber;
1245
+ source: z.ZodEnum<{
1246
+ "provider-reported": "provider-reported";
1247
+ computed: "computed";
1248
+ }>;
1249
+ }, z.core.$strict>>;
1250
+ }, z.core.$strict>, z.ZodObject<{
1251
+ schemaVersion: z.ZodLiteral<1>;
1252
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1253
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1254
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1255
+ sequence: z.ZodNumber;
1256
+ occurredAt: z.ZodNumber;
1257
+ provenance: z.ZodReadonly<z.ZodObject<{
1258
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1259
+ providerVersion: z.ZodOptional<z.ZodString>;
1260
+ adapterId: z.ZodString;
1261
+ adapterVersion: z.ZodString;
1262
+ detectionConfidence: z.ZodEnum<{
1263
+ none: "none";
1264
+ weak: "weak";
1265
+ strong: "strong";
1266
+ exact: "exact";
1267
+ }>;
1268
+ sourceEventName: z.ZodOptional<z.ZodString>;
1269
+ transport: z.ZodEnum<{
1270
+ "hook-stdin": "hook-stdin";
1271
+ "cli-argument": "cli-argument";
1272
+ "library-call": "library-call";
1273
+ "test-fixture": "test-fixture";
1274
+ }>;
1275
+ }, z.core.$strict>>;
1276
+ workspace: z.ZodReadonly<z.ZodObject<{
1277
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1278
+ keySource: z.ZodEnum<{
1279
+ unknown: "unknown";
1280
+ "git-remote": "git-remote";
1281
+ "git-root": "git-root";
1282
+ "working-directory": "working-directory";
1283
+ explicit: "explicit";
1284
+ }>;
1285
+ repositoryName: z.ZodOptional<z.ZodString>;
1286
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1287
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1288
+ }, z.core.$strict>>;
1289
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1290
+ type: z.ZodLiteral<"prompt.submitted">;
1291
+ promptSource: z.ZodEnum<{
1292
+ unknown: "unknown";
1293
+ user: "user";
1294
+ automation: "automation";
1295
+ resumed: "resumed";
1296
+ }>;
1297
+ content: z.ZodOptional<z.ZodObject<{
1298
+ kind: z.ZodEnum<{
1299
+ prompt: "prompt";
1300
+ response: "response";
1301
+ reasoning: "reasoning";
1302
+ "tool-input": "tool-input";
1303
+ "tool-output": "tool-output";
1304
+ "error-message": "error-message";
1305
+ "system-instruction": "system-instruction";
1306
+ attachment: "attachment";
1307
+ }>;
1308
+ role: z.ZodOptional<z.ZodEnum<{
1309
+ unknown: "unknown";
1310
+ user: "user";
1311
+ assistant: "assistant";
1312
+ system: "system";
1313
+ tool: "tool";
1314
+ }>>;
1315
+ characterLength: z.ZodNumber;
1316
+ byteLength: z.ZodNumber;
1317
+ contentHash: z.ZodString;
1318
+ disclosure: z.ZodEnum<{
1319
+ omitted: "omitted";
1320
+ masked: "masked";
1321
+ redacted: "redacted";
1322
+ raw: "raw";
1323
+ }>;
1324
+ text: z.ZodOptional<z.ZodString>;
1325
+ truncated: z.ZodBoolean;
1326
+ secretsRedacted: z.ZodNumber;
1327
+ label: z.ZodOptional<z.ZodString>;
1328
+ }, z.core.$strict>>;
1329
+ turnIndex: z.ZodOptional<z.ZodNumber>;
1330
+ }, z.core.$strict>, z.ZodObject<{
1331
+ schemaVersion: z.ZodLiteral<1>;
1332
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1333
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1334
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1335
+ sequence: z.ZodNumber;
1336
+ occurredAt: z.ZodNumber;
1337
+ provenance: z.ZodReadonly<z.ZodObject<{
1338
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1339
+ providerVersion: z.ZodOptional<z.ZodString>;
1340
+ adapterId: z.ZodString;
1341
+ adapterVersion: z.ZodString;
1342
+ detectionConfidence: z.ZodEnum<{
1343
+ none: "none";
1344
+ weak: "weak";
1345
+ strong: "strong";
1346
+ exact: "exact";
1347
+ }>;
1348
+ sourceEventName: z.ZodOptional<z.ZodString>;
1349
+ transport: z.ZodEnum<{
1350
+ "hook-stdin": "hook-stdin";
1351
+ "cli-argument": "cli-argument";
1352
+ "library-call": "library-call";
1353
+ "test-fixture": "test-fixture";
1354
+ }>;
1355
+ }, z.core.$strict>>;
1356
+ workspace: z.ZodReadonly<z.ZodObject<{
1357
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1358
+ keySource: z.ZodEnum<{
1359
+ unknown: "unknown";
1360
+ "git-remote": "git-remote";
1361
+ "git-root": "git-root";
1362
+ "working-directory": "working-directory";
1363
+ explicit: "explicit";
1364
+ }>;
1365
+ repositoryName: z.ZodOptional<z.ZodString>;
1366
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1367
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1368
+ }, z.core.$strict>>;
1369
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1370
+ type: z.ZodLiteral<"generation.start">;
1371
+ generationId: z.ZodString;
1372
+ model: z.ZodObject<{
1373
+ modelId: z.ZodString;
1374
+ vendor: z.ZodOptional<z.ZodString>;
1375
+ family: z.ZodOptional<z.ZodString>;
1376
+ }, z.core.$strict>;
1377
+ requestedMaxOutputTokens: z.ZodOptional<z.ZodNumber>;
1378
+ inputContent: z.ZodOptional<z.ZodArray<z.ZodObject<{
1379
+ kind: z.ZodEnum<{
1380
+ prompt: "prompt";
1381
+ response: "response";
1382
+ reasoning: "reasoning";
1383
+ "tool-input": "tool-input";
1384
+ "tool-output": "tool-output";
1385
+ "error-message": "error-message";
1386
+ "system-instruction": "system-instruction";
1387
+ attachment: "attachment";
1388
+ }>;
1389
+ role: z.ZodOptional<z.ZodEnum<{
1390
+ unknown: "unknown";
1391
+ user: "user";
1392
+ assistant: "assistant";
1393
+ system: "system";
1394
+ tool: "tool";
1395
+ }>>;
1396
+ characterLength: z.ZodNumber;
1397
+ byteLength: z.ZodNumber;
1398
+ contentHash: z.ZodString;
1399
+ disclosure: z.ZodEnum<{
1400
+ omitted: "omitted";
1401
+ masked: "masked";
1402
+ redacted: "redacted";
1403
+ raw: "raw";
1404
+ }>;
1405
+ text: z.ZodOptional<z.ZodString>;
1406
+ truncated: z.ZodBoolean;
1407
+ secretsRedacted: z.ZodNumber;
1408
+ label: z.ZodOptional<z.ZodString>;
1409
+ }, z.core.$strict>>>;
1410
+ }, z.core.$strict>, z.ZodObject<{
1411
+ schemaVersion: z.ZodLiteral<1>;
1412
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1413
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1414
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1415
+ sequence: z.ZodNumber;
1416
+ occurredAt: z.ZodNumber;
1417
+ provenance: z.ZodReadonly<z.ZodObject<{
1418
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1419
+ providerVersion: z.ZodOptional<z.ZodString>;
1420
+ adapterId: z.ZodString;
1421
+ adapterVersion: z.ZodString;
1422
+ detectionConfidence: z.ZodEnum<{
1423
+ none: "none";
1424
+ weak: "weak";
1425
+ strong: "strong";
1426
+ exact: "exact";
1427
+ }>;
1428
+ sourceEventName: z.ZodOptional<z.ZodString>;
1429
+ transport: z.ZodEnum<{
1430
+ "hook-stdin": "hook-stdin";
1431
+ "cli-argument": "cli-argument";
1432
+ "library-call": "library-call";
1433
+ "test-fixture": "test-fixture";
1434
+ }>;
1435
+ }, z.core.$strict>>;
1436
+ workspace: z.ZodReadonly<z.ZodObject<{
1437
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1438
+ keySource: z.ZodEnum<{
1439
+ unknown: "unknown";
1440
+ "git-remote": "git-remote";
1441
+ "git-root": "git-root";
1442
+ "working-directory": "working-directory";
1443
+ explicit: "explicit";
1444
+ }>;
1445
+ repositoryName: z.ZodOptional<z.ZodString>;
1446
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1447
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1448
+ }, z.core.$strict>>;
1449
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1450
+ type: z.ZodLiteral<"generation.end">;
1451
+ generationId: z.ZodString;
1452
+ model: z.ZodObject<{
1453
+ modelId: z.ZodString;
1454
+ vendor: z.ZodOptional<z.ZodString>;
1455
+ family: z.ZodOptional<z.ZodString>;
1456
+ }, z.core.$strict>;
1457
+ outcome: z.ZodEnum<{
1458
+ error: "error";
1459
+ unknown: "unknown";
1460
+ ok: "ok";
1461
+ cancelled: "cancelled";
1462
+ timeout: "timeout";
1463
+ denied: "denied";
1464
+ }>;
1465
+ stopReason: z.ZodOptional<z.ZodString>;
1466
+ durationMillis: z.ZodOptional<z.ZodNumber>;
1467
+ usage: z.ZodOptional<z.ZodObject<{
1468
+ temporality: z.ZodEnum<{
1469
+ delta: "delta";
1470
+ cumulative: "cumulative";
1471
+ }>;
1472
+ inputTokens: z.ZodNumber;
1473
+ cachedInputTokens: z.ZodNumber;
1474
+ cacheCreationInputTokens: z.ZodNumber;
1475
+ cacheCreationAccounting: z.ZodEnum<{
1476
+ "included-in-input": "included-in-input";
1477
+ "disjoint-from-input": "disjoint-from-input";
1478
+ "not-reported": "not-reported";
1479
+ }>;
1480
+ outputTokens: z.ZodNumber;
1481
+ reasoningOutputTokens: z.ZodNumber;
1482
+ uncachedInputTokens: z.ZodNumber;
1483
+ totalTokens: z.ZodNumber;
1484
+ providerTotalTokens: z.ZodOptional<z.ZodNumber>;
1485
+ providerTotalAgreement: z.ZodEnum<{
1486
+ unreported: "unreported";
1487
+ agrees: "agrees";
1488
+ disagrees: "disagrees";
1489
+ }>;
1490
+ }, z.core.$strict>>;
1491
+ cost: z.ZodOptional<z.ZodObject<{
1492
+ currency: z.ZodString;
1493
+ amount: z.ZodNumber;
1494
+ source: z.ZodEnum<{
1495
+ "provider-reported": "provider-reported";
1496
+ computed: "computed";
1497
+ }>;
1498
+ }, z.core.$strict>>;
1499
+ outputContent: z.ZodOptional<z.ZodArray<z.ZodObject<{
1500
+ kind: z.ZodEnum<{
1501
+ prompt: "prompt";
1502
+ response: "response";
1503
+ reasoning: "reasoning";
1504
+ "tool-input": "tool-input";
1505
+ "tool-output": "tool-output";
1506
+ "error-message": "error-message";
1507
+ "system-instruction": "system-instruction";
1508
+ attachment: "attachment";
1509
+ }>;
1510
+ role: z.ZodOptional<z.ZodEnum<{
1511
+ unknown: "unknown";
1512
+ user: "user";
1513
+ assistant: "assistant";
1514
+ system: "system";
1515
+ tool: "tool";
1516
+ }>>;
1517
+ characterLength: z.ZodNumber;
1518
+ byteLength: z.ZodNumber;
1519
+ contentHash: z.ZodString;
1520
+ disclosure: z.ZodEnum<{
1521
+ omitted: "omitted";
1522
+ masked: "masked";
1523
+ redacted: "redacted";
1524
+ raw: "raw";
1525
+ }>;
1526
+ text: z.ZodOptional<z.ZodString>;
1527
+ truncated: z.ZodBoolean;
1528
+ secretsRedacted: z.ZodNumber;
1529
+ label: z.ZodOptional<z.ZodString>;
1530
+ }, z.core.$strict>>>;
1531
+ }, z.core.$strict>, z.ZodObject<{
1532
+ schemaVersion: z.ZodLiteral<1>;
1533
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1534
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1535
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1536
+ sequence: z.ZodNumber;
1537
+ occurredAt: z.ZodNumber;
1538
+ provenance: z.ZodReadonly<z.ZodObject<{
1539
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1540
+ providerVersion: z.ZodOptional<z.ZodString>;
1541
+ adapterId: z.ZodString;
1542
+ adapterVersion: z.ZodString;
1543
+ detectionConfidence: z.ZodEnum<{
1544
+ none: "none";
1545
+ weak: "weak";
1546
+ strong: "strong";
1547
+ exact: "exact";
1548
+ }>;
1549
+ sourceEventName: z.ZodOptional<z.ZodString>;
1550
+ transport: z.ZodEnum<{
1551
+ "hook-stdin": "hook-stdin";
1552
+ "cli-argument": "cli-argument";
1553
+ "library-call": "library-call";
1554
+ "test-fixture": "test-fixture";
1555
+ }>;
1556
+ }, z.core.$strict>>;
1557
+ workspace: z.ZodReadonly<z.ZodObject<{
1558
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1559
+ keySource: z.ZodEnum<{
1560
+ unknown: "unknown";
1561
+ "git-remote": "git-remote";
1562
+ "git-root": "git-root";
1563
+ "working-directory": "working-directory";
1564
+ explicit: "explicit";
1565
+ }>;
1566
+ repositoryName: z.ZodOptional<z.ZodString>;
1567
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1568
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1569
+ }, z.core.$strict>>;
1570
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1571
+ type: z.ZodLiteral<"tool.start">;
1572
+ toolCallId: z.ZodString;
1573
+ toolName: z.ZodString;
1574
+ toolKind: z.ZodEnum<{
1575
+ unknown: "unknown";
1576
+ read: "read";
1577
+ write: "write";
1578
+ execute: "execute";
1579
+ search: "search";
1580
+ network: "network";
1581
+ delegate: "delegate";
1582
+ other: "other";
1583
+ }>;
1584
+ generationId: z.ZodOptional<z.ZodString>;
1585
+ input: z.ZodOptional<z.ZodObject<{
1586
+ kind: z.ZodEnum<{
1587
+ prompt: "prompt";
1588
+ response: "response";
1589
+ reasoning: "reasoning";
1590
+ "tool-input": "tool-input";
1591
+ "tool-output": "tool-output";
1592
+ "error-message": "error-message";
1593
+ "system-instruction": "system-instruction";
1594
+ attachment: "attachment";
1595
+ }>;
1596
+ role: z.ZodOptional<z.ZodEnum<{
1597
+ unknown: "unknown";
1598
+ user: "user";
1599
+ assistant: "assistant";
1600
+ system: "system";
1601
+ tool: "tool";
1602
+ }>>;
1603
+ characterLength: z.ZodNumber;
1604
+ byteLength: z.ZodNumber;
1605
+ contentHash: z.ZodString;
1606
+ disclosure: z.ZodEnum<{
1607
+ omitted: "omitted";
1608
+ masked: "masked";
1609
+ redacted: "redacted";
1610
+ raw: "raw";
1611
+ }>;
1612
+ text: z.ZodOptional<z.ZodString>;
1613
+ truncated: z.ZodBoolean;
1614
+ secretsRedacted: z.ZodNumber;
1615
+ label: z.ZodOptional<z.ZodString>;
1616
+ }, z.core.$strict>>;
1617
+ }, z.core.$strict>, z.ZodObject<{
1618
+ schemaVersion: z.ZodLiteral<1>;
1619
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1620
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1621
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1622
+ sequence: z.ZodNumber;
1623
+ occurredAt: z.ZodNumber;
1624
+ provenance: z.ZodReadonly<z.ZodObject<{
1625
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1626
+ providerVersion: z.ZodOptional<z.ZodString>;
1627
+ adapterId: z.ZodString;
1628
+ adapterVersion: z.ZodString;
1629
+ detectionConfidence: z.ZodEnum<{
1630
+ none: "none";
1631
+ weak: "weak";
1632
+ strong: "strong";
1633
+ exact: "exact";
1634
+ }>;
1635
+ sourceEventName: z.ZodOptional<z.ZodString>;
1636
+ transport: z.ZodEnum<{
1637
+ "hook-stdin": "hook-stdin";
1638
+ "cli-argument": "cli-argument";
1639
+ "library-call": "library-call";
1640
+ "test-fixture": "test-fixture";
1641
+ }>;
1642
+ }, z.core.$strict>>;
1643
+ workspace: z.ZodReadonly<z.ZodObject<{
1644
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1645
+ keySource: z.ZodEnum<{
1646
+ unknown: "unknown";
1647
+ "git-remote": "git-remote";
1648
+ "git-root": "git-root";
1649
+ "working-directory": "working-directory";
1650
+ explicit: "explicit";
1651
+ }>;
1652
+ repositoryName: z.ZodOptional<z.ZodString>;
1653
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1654
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1655
+ }, z.core.$strict>>;
1656
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1657
+ type: z.ZodLiteral<"tool.end">;
1658
+ toolCallId: z.ZodString;
1659
+ toolName: z.ZodString;
1660
+ outcome: z.ZodEnum<{
1661
+ error: "error";
1662
+ unknown: "unknown";
1663
+ ok: "ok";
1664
+ cancelled: "cancelled";
1665
+ timeout: "timeout";
1666
+ denied: "denied";
1667
+ }>;
1668
+ durationMillis: z.ZodOptional<z.ZodNumber>;
1669
+ permissionDecision: z.ZodOptional<z.ZodEnum<{
1670
+ denied: "denied";
1671
+ allowed: "allowed";
1672
+ deferred: "deferred";
1673
+ "not-required": "not-required";
1674
+ }>>;
1675
+ output: z.ZodOptional<z.ZodObject<{
1676
+ kind: z.ZodEnum<{
1677
+ prompt: "prompt";
1678
+ response: "response";
1679
+ reasoning: "reasoning";
1680
+ "tool-input": "tool-input";
1681
+ "tool-output": "tool-output";
1682
+ "error-message": "error-message";
1683
+ "system-instruction": "system-instruction";
1684
+ attachment: "attachment";
1685
+ }>;
1686
+ role: z.ZodOptional<z.ZodEnum<{
1687
+ unknown: "unknown";
1688
+ user: "user";
1689
+ assistant: "assistant";
1690
+ system: "system";
1691
+ tool: "tool";
1692
+ }>>;
1693
+ characterLength: z.ZodNumber;
1694
+ byteLength: z.ZodNumber;
1695
+ contentHash: z.ZodString;
1696
+ disclosure: z.ZodEnum<{
1697
+ omitted: "omitted";
1698
+ masked: "masked";
1699
+ redacted: "redacted";
1700
+ raw: "raw";
1701
+ }>;
1702
+ text: z.ZodOptional<z.ZodString>;
1703
+ truncated: z.ZodBoolean;
1704
+ secretsRedacted: z.ZodNumber;
1705
+ label: z.ZodOptional<z.ZodString>;
1706
+ }, z.core.$strict>>;
1707
+ }, z.core.$strict>, z.ZodObject<{
1708
+ schemaVersion: z.ZodLiteral<1>;
1709
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1710
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1711
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1712
+ sequence: z.ZodNumber;
1713
+ occurredAt: z.ZodNumber;
1714
+ provenance: z.ZodReadonly<z.ZodObject<{
1715
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1716
+ providerVersion: z.ZodOptional<z.ZodString>;
1717
+ adapterId: z.ZodString;
1718
+ adapterVersion: z.ZodString;
1719
+ detectionConfidence: z.ZodEnum<{
1720
+ none: "none";
1721
+ weak: "weak";
1722
+ strong: "strong";
1723
+ exact: "exact";
1724
+ }>;
1725
+ sourceEventName: z.ZodOptional<z.ZodString>;
1726
+ transport: z.ZodEnum<{
1727
+ "hook-stdin": "hook-stdin";
1728
+ "cli-argument": "cli-argument";
1729
+ "library-call": "library-call";
1730
+ "test-fixture": "test-fixture";
1731
+ }>;
1732
+ }, z.core.$strict>>;
1733
+ workspace: z.ZodReadonly<z.ZodObject<{
1734
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1735
+ keySource: z.ZodEnum<{
1736
+ unknown: "unknown";
1737
+ "git-remote": "git-remote";
1738
+ "git-root": "git-root";
1739
+ "working-directory": "working-directory";
1740
+ explicit: "explicit";
1741
+ }>;
1742
+ repositoryName: z.ZodOptional<z.ZodString>;
1743
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1744
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1745
+ }, z.core.$strict>>;
1746
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1747
+ type: z.ZodLiteral<"subagent.start">;
1748
+ subagentInvocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1749
+ subagentType: z.ZodOptional<z.ZodString>;
1750
+ delegationDepth: z.ZodNumber;
1751
+ model: z.ZodOptional<z.ZodObject<{
1752
+ modelId: z.ZodString;
1753
+ vendor: z.ZodOptional<z.ZodString>;
1754
+ family: z.ZodOptional<z.ZodString>;
1755
+ }, z.core.$strict>>;
1756
+ }, z.core.$strict>, z.ZodObject<{
1757
+ schemaVersion: z.ZodLiteral<1>;
1758
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1759
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1760
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1761
+ sequence: z.ZodNumber;
1762
+ occurredAt: z.ZodNumber;
1763
+ provenance: z.ZodReadonly<z.ZodObject<{
1764
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1765
+ providerVersion: z.ZodOptional<z.ZodString>;
1766
+ adapterId: z.ZodString;
1767
+ adapterVersion: z.ZodString;
1768
+ detectionConfidence: z.ZodEnum<{
1769
+ none: "none";
1770
+ weak: "weak";
1771
+ strong: "strong";
1772
+ exact: "exact";
1773
+ }>;
1774
+ sourceEventName: z.ZodOptional<z.ZodString>;
1775
+ transport: z.ZodEnum<{
1776
+ "hook-stdin": "hook-stdin";
1777
+ "cli-argument": "cli-argument";
1778
+ "library-call": "library-call";
1779
+ "test-fixture": "test-fixture";
1780
+ }>;
1781
+ }, z.core.$strict>>;
1782
+ workspace: z.ZodReadonly<z.ZodObject<{
1783
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1784
+ keySource: z.ZodEnum<{
1785
+ unknown: "unknown";
1786
+ "git-remote": "git-remote";
1787
+ "git-root": "git-root";
1788
+ "working-directory": "working-directory";
1789
+ explicit: "explicit";
1790
+ }>;
1791
+ repositoryName: z.ZodOptional<z.ZodString>;
1792
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1793
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1794
+ }, z.core.$strict>>;
1795
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1796
+ type: z.ZodLiteral<"subagent.end">;
1797
+ subagentInvocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1798
+ outcome: z.ZodEnum<{
1799
+ error: "error";
1800
+ unknown: "unknown";
1801
+ ok: "ok";
1802
+ cancelled: "cancelled";
1803
+ timeout: "timeout";
1804
+ denied: "denied";
1805
+ }>;
1806
+ durationMillis: z.ZodOptional<z.ZodNumber>;
1807
+ usage: z.ZodOptional<z.ZodObject<{
1808
+ temporality: z.ZodEnum<{
1809
+ delta: "delta";
1810
+ cumulative: "cumulative";
1811
+ }>;
1812
+ inputTokens: z.ZodNumber;
1813
+ cachedInputTokens: z.ZodNumber;
1814
+ cacheCreationInputTokens: z.ZodNumber;
1815
+ cacheCreationAccounting: z.ZodEnum<{
1816
+ "included-in-input": "included-in-input";
1817
+ "disjoint-from-input": "disjoint-from-input";
1818
+ "not-reported": "not-reported";
1819
+ }>;
1820
+ outputTokens: z.ZodNumber;
1821
+ reasoningOutputTokens: z.ZodNumber;
1822
+ uncachedInputTokens: z.ZodNumber;
1823
+ totalTokens: z.ZodNumber;
1824
+ providerTotalTokens: z.ZodOptional<z.ZodNumber>;
1825
+ providerTotalAgreement: z.ZodEnum<{
1826
+ unreported: "unreported";
1827
+ agrees: "agrees";
1828
+ disagrees: "disagrees";
1829
+ }>;
1830
+ }, z.core.$strict>>;
1831
+ }, z.core.$strict>, z.ZodObject<{
1832
+ schemaVersion: z.ZodLiteral<1>;
1833
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1834
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1835
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1836
+ sequence: z.ZodNumber;
1837
+ occurredAt: z.ZodNumber;
1838
+ provenance: z.ZodReadonly<z.ZodObject<{
1839
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1840
+ providerVersion: z.ZodOptional<z.ZodString>;
1841
+ adapterId: z.ZodString;
1842
+ adapterVersion: z.ZodString;
1843
+ detectionConfidence: z.ZodEnum<{
1844
+ none: "none";
1845
+ weak: "weak";
1846
+ strong: "strong";
1847
+ exact: "exact";
1848
+ }>;
1849
+ sourceEventName: z.ZodOptional<z.ZodString>;
1850
+ transport: z.ZodEnum<{
1851
+ "hook-stdin": "hook-stdin";
1852
+ "cli-argument": "cli-argument";
1853
+ "library-call": "library-call";
1854
+ "test-fixture": "test-fixture";
1855
+ }>;
1856
+ }, z.core.$strict>>;
1857
+ workspace: z.ZodReadonly<z.ZodObject<{
1858
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1859
+ keySource: z.ZodEnum<{
1860
+ unknown: "unknown";
1861
+ "git-remote": "git-remote";
1862
+ "git-root": "git-root";
1863
+ "working-directory": "working-directory";
1864
+ explicit: "explicit";
1865
+ }>;
1866
+ repositoryName: z.ZodOptional<z.ZodString>;
1867
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1868
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1869
+ }, z.core.$strict>>;
1870
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1871
+ type: z.ZodLiteral<"compaction.performed">;
1872
+ trigger: z.ZodEnum<{
1873
+ unknown: "unknown";
1874
+ automatic: "automatic";
1875
+ manual: "manual";
1876
+ }>;
1877
+ contextTokensBefore: z.ZodOptional<z.ZodNumber>;
1878
+ contextTokensAfter: z.ZodOptional<z.ZodNumber>;
1879
+ droppedMessageCount: z.ZodOptional<z.ZodNumber>;
1880
+ usage: z.ZodOptional<z.ZodObject<{
1881
+ temporality: z.ZodEnum<{
1882
+ delta: "delta";
1883
+ cumulative: "cumulative";
1884
+ }>;
1885
+ inputTokens: z.ZodNumber;
1886
+ cachedInputTokens: z.ZodNumber;
1887
+ cacheCreationInputTokens: z.ZodNumber;
1888
+ cacheCreationAccounting: z.ZodEnum<{
1889
+ "included-in-input": "included-in-input";
1890
+ "disjoint-from-input": "disjoint-from-input";
1891
+ "not-reported": "not-reported";
1892
+ }>;
1893
+ outputTokens: z.ZodNumber;
1894
+ reasoningOutputTokens: z.ZodNumber;
1895
+ uncachedInputTokens: z.ZodNumber;
1896
+ totalTokens: z.ZodNumber;
1897
+ providerTotalTokens: z.ZodOptional<z.ZodNumber>;
1898
+ providerTotalAgreement: z.ZodEnum<{
1899
+ unreported: "unreported";
1900
+ agrees: "agrees";
1901
+ disagrees: "disagrees";
1902
+ }>;
1903
+ }, z.core.$strict>>;
1904
+ }, z.core.$strict>, z.ZodObject<{
1905
+ schemaVersion: z.ZodLiteral<1>;
1906
+ eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
1907
+ invocationId: z.core.$ZodBranded<z.ZodString, "InvocationId", "out">;
1908
+ sessionId: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
1909
+ sequence: z.ZodNumber;
1910
+ occurredAt: z.ZodNumber;
1911
+ provenance: z.ZodReadonly<z.ZodObject<{
1912
+ providerId: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ProviderId", "out">, z.ZodLiteral<"unknown">]>;
1913
+ providerVersion: z.ZodOptional<z.ZodString>;
1914
+ adapterId: z.ZodString;
1915
+ adapterVersion: z.ZodString;
1916
+ detectionConfidence: z.ZodEnum<{
1917
+ none: "none";
1918
+ weak: "weak";
1919
+ strong: "strong";
1920
+ exact: "exact";
1921
+ }>;
1922
+ sourceEventName: z.ZodOptional<z.ZodString>;
1923
+ transport: z.ZodEnum<{
1924
+ "hook-stdin": "hook-stdin";
1925
+ "cli-argument": "cli-argument";
1926
+ "library-call": "library-call";
1927
+ "test-fixture": "test-fixture";
1928
+ }>;
1929
+ }, z.core.$strict>>;
1930
+ workspace: z.ZodReadonly<z.ZodObject<{
1931
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
1932
+ keySource: z.ZodEnum<{
1933
+ unknown: "unknown";
1934
+ "git-remote": "git-remote";
1935
+ "git-root": "git-root";
1936
+ "working-directory": "working-directory";
1937
+ explicit: "explicit";
1938
+ }>;
1939
+ repositoryName: z.ZodOptional<z.ZodString>;
1940
+ vcsBranchName: z.ZodOptional<z.ZodString>;
1941
+ vcsRevisionId: z.ZodOptional<z.ZodString>;
1942
+ }, z.core.$strict>>;
1943
+ extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
1944
+ type: z.ZodLiteral<"error.raised">;
1945
+ errorCode: z.ZodEnum<{
1946
+ "invalid-input": "invalid-input";
1947
+ "schema-validation-failed": "schema-validation-failed";
1948
+ "provider-unknown": "provider-unknown";
1949
+ "provider-detection-ambiguous": "provider-detection-ambiguous";
1950
+ "provider-adapter-failure": "provider-adapter-failure";
1951
+ "identity-conflict": "identity-conflict";
1952
+ "identity-incomplete": "identity-incomplete";
1953
+ "usage-invalid": "usage-invalid";
1954
+ "state-store-failure": "state-store-failure";
1955
+ "telemetry-export-failure": "telemetry-export-failure";
1956
+ "privacy-policy-violation": "privacy-policy-violation";
1957
+ "configuration-invalid": "configuration-invalid";
1958
+ "limit-exceeded": "limit-exceeded";
1959
+ "delivery-identifier-unavailable": "delivery-identifier-unavailable";
1960
+ "delivery-claim-superseded": "delivery-claim-superseded";
1961
+ "internal-error": "internal-error";
1962
+ }>;
1963
+ severity: z.ZodEnum<{
1964
+ error: "error";
1965
+ warning: "warning";
1966
+ }>;
1967
+ phase: z.ZodEnum<{
1968
+ identity: "identity";
1969
+ configuration: "configuration";
1970
+ detection: "detection";
1971
+ parsing: "parsing";
1972
+ normalization: "normalization";
1973
+ privacy: "privacy";
1974
+ state: "state";
1975
+ export: "export";
1976
+ shutdown: "shutdown";
1977
+ }>;
1978
+ retryable: z.ZodBoolean;
1979
+ message: z.ZodOptional<z.ZodObject<{
1980
+ kind: z.ZodEnum<{
1981
+ prompt: "prompt";
1982
+ response: "response";
1983
+ reasoning: "reasoning";
1984
+ "tool-input": "tool-input";
1985
+ "tool-output": "tool-output";
1986
+ "error-message": "error-message";
1987
+ "system-instruction": "system-instruction";
1988
+ attachment: "attachment";
1989
+ }>;
1990
+ role: z.ZodOptional<z.ZodEnum<{
1991
+ unknown: "unknown";
1992
+ user: "user";
1993
+ assistant: "assistant";
1994
+ system: "system";
1995
+ tool: "tool";
1996
+ }>>;
1997
+ characterLength: z.ZodNumber;
1998
+ byteLength: z.ZodNumber;
1999
+ contentHash: z.ZodString;
2000
+ disclosure: z.ZodEnum<{
2001
+ omitted: "omitted";
2002
+ masked: "masked";
2003
+ redacted: "redacted";
2004
+ raw: "raw";
2005
+ }>;
2006
+ text: z.ZodOptional<z.ZodString>;
2007
+ truncated: z.ZodBoolean;
2008
+ secretsRedacted: z.ZodNumber;
2009
+ label: z.ZodOptional<z.ZodString>;
2010
+ }, z.core.$strict>>;
2011
+ detail: z.ZodOptional<z.ZodString>;
2012
+ }, z.core.$strict>], "type">;
2013
+ type CanonicalEvent = z.infer<typeof canonicalEventSchema>;
2014
+ type CanonicalEventInput = z.input<typeof canonicalEventSchema>;
2015
+ type SessionStartEvent = z.infer<typeof sessionStartEventSchema>;
2016
+ type SessionEndEvent = z.infer<typeof sessionEndEventSchema>;
2017
+ type PromptSubmittedEvent = z.infer<typeof promptSubmittedEventSchema>;
2018
+ type GenerationStartEvent = z.infer<typeof generationStartEventSchema>;
2019
+ type GenerationEndEvent = z.infer<typeof generationEndEventSchema>;
2020
+ type ToolStartEvent = z.infer<typeof toolStartEventSchema>;
2021
+ type ToolEndEvent = z.infer<typeof toolEndEventSchema>;
2022
+ type SubagentStartEvent = z.infer<typeof subagentStartEventSchema>;
2023
+ type SubagentEndEvent = z.infer<typeof subagentEndEventSchema>;
2024
+ type CompactionPerformedEvent = z.infer<typeof compactionPerformedEventSchema>;
2025
+ type ErrorRaisedEvent = z.infer<typeof errorRaisedEventSchema>;
2026
+ type CanonicalEventOfType<TType extends CanonicalEventType> = Extract<CanonicalEvent, {
2027
+ type: TType;
2028
+ }>;
2029
+ type EventValidationResult = {
2030
+ readonly status: "ok";
2031
+ readonly event: CanonicalEvent;
2032
+ } | {
2033
+ readonly status: "invalid";
2034
+ readonly issues: readonly string[];
2035
+ };
2036
+ declare const validateCanonicalEvent: (value: unknown) => EventValidationResult;
2037
+ /** Parse or throw. Intended for fixtures and tests, not the hook path. */
2038
+ declare const parseCanonicalEvent: (value: unknown) => CanonicalEvent;
2039
+ /** Usage carried by an event, if the event type can carry any. */
2040
+ declare const eventUsage: (event: CanonicalEvent) => CanonicalUsage | undefined;
2041
+ /** Stable ordering: by sequence, then by timestamp, then by event id. */
2042
+ declare const compareEvents: (a: CanonicalEvent, b: CanonicalEvent) => number;
2043
+
2044
+ export { subagentStartEventSchema as $, canonicalEventTypeSchema as A, canonicalUsageSchema as B, CANONICAL_EVENT_TYPES as C, compactionPerformedEventSchema as D, EMPTY_DELTA_USAGE as E, compareEvents as F, type GenerationEndEvent as G, costFactsSchema as H, cumulativeToDelta as I, errorRaisedEventSchema as J, eventUsage as K, generationEndEventSchema as L, type ModelDescriptor as M, generationStartEventSchema as N, modelDescriptorSchema as O, type PromptSubmittedEvent as P, normalizeUsage as Q, normalizeUsageOrThrow as R, type SessionEndEvent as S, type ToolEndEvent as T, type UsageDeltaResult as U, parseCanonicalEvent as V, promptSubmittedEventSchema as W, providerTotalAgreementSchema as X, sessionEndEventSchema as Y, sessionStartEventSchema as Z, subagentEndEventSchema as _, type CacheCreationAccounting as a, toReport as a0, toolEndEventSchema as a1, toolKindSchema as a2, toolStartEventSchema as a3, usageReportSchema as a4, usageTemporalitySchema as a5, validateCanonicalEvent as a6, type CanonicalEvent as b, type CanonicalEventInput as c, type CanonicalEventOfType as d, type CanonicalEventType as e, type CanonicalUsage as f, type CompactionPerformedEvent as g, type CostFacts as h, type ErrorRaisedEvent as i, type EventOutcome as j, type EventValidationResult as k, type GenerationStartEvent as l, type ProviderTotalAgreement as m, type SessionStartEvent as n, type SubagentEndEvent as o, type SubagentStartEvent as p, type ToolKind as q, type ToolStartEvent as r, UsageNormalizationError as s, type UsageNormalizationIssue as t, type UsageNormalizationResult as u, type UsageReport as v, type UsageTemporality as w, addUsage as x, cacheCreationAccountingSchema as y, canonicalEventSchema as z };