@relayfx/sdk 0.7.2 → 0.7.4

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,507 @@
1
+ import { Schema } from "effect";
2
+ export declare const ModelCallPurpose: Schema.Literals<readonly ["conversation", "structured-output", "compaction-summary"]>;
3
+ export declare const ModelFailureCategory: Schema.Literals<readonly ["authentication", "rate-limit", "transport", "provider-response", "stream-decode", "context-overflow", "invalid-tool-call", "token-budget", "timeout", "cancellation", "unknown"]>;
4
+ export declare const ModelFailureClassification: Schema.Literals<readonly ["transient", "terminal"]>;
5
+ export declare const ModelRetryReason: Schema.Literals<readonly ["provider-resilience", "invalid-tool-call-correction"]>;
6
+ export declare const ModelFirstOutputKind: Schema.Literals<readonly ["reasoning", "text", "tool-call"]>;
7
+ export declare const ModelFinishReason: Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>;
8
+ export declare const CompactionTrigger: Schema.Literals<readonly ["threshold", "overflow"]>;
9
+ export declare const CompactionKind: Schema.Literals<readonly ["microcompact", "summarize", "unchanged"]>;
10
+ export declare const ModelUsage: Schema.Struct<{
11
+ readonly input_tokens: Schema.NullOr<Schema.Int>;
12
+ readonly input_tokens_uncached: Schema.NullOr<Schema.Int>;
13
+ readonly input_tokens_cache_read: Schema.NullOr<Schema.Int>;
14
+ readonly input_tokens_cache_write: Schema.NullOr<Schema.Int>;
15
+ readonly output_tokens: Schema.NullOr<Schema.Int>;
16
+ readonly output_tokens_reasoning: Schema.NullOr<Schema.Int>;
17
+ readonly output_tokens_text: Schema.optionalKey<Schema.NullOr<Schema.Int>>;
18
+ }>;
19
+ export interface ModelUsage extends Schema.Schema.Type<typeof ModelUsage> {
20
+ }
21
+ export declare const ModelCallStartedEventData: Schema.Struct<{
22
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
23
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
24
+ readonly turn: Schema.Int;
25
+ readonly model_call_id: Schema.String;
26
+ readonly purpose: Schema.Literals<readonly ["conversation", "structured-output", "compaction-summary"]>;
27
+ readonly provider: Schema.optionalKey<Schema.String>;
28
+ readonly model: Schema.optionalKey<Schema.String>;
29
+ readonly compaction_id: Schema.optionalKey<Schema.String>;
30
+ readonly started_at: Schema.Int;
31
+ }>;
32
+ export declare const ModelAttemptStartedEventData: Schema.Struct<{
33
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
34
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
35
+ readonly turn: Schema.Int;
36
+ readonly model_call_id: Schema.String;
37
+ readonly model_attempt_id: Schema.String;
38
+ readonly attempt: Schema.Int;
39
+ readonly started_at: Schema.Int;
40
+ }>;
41
+ export declare const ModelAttemptFirstOutputEventData: Schema.Struct<{
42
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
43
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
44
+ readonly turn: Schema.Int;
45
+ readonly model_call_id: Schema.String;
46
+ readonly model_attempt_id: Schema.String;
47
+ readonly attempt: Schema.Int;
48
+ readonly kind: Schema.Literals<readonly ["reasoning", "text", "tool-call"]>;
49
+ readonly at: Schema.Int;
50
+ }>;
51
+ export declare const ModelAttemptCompletedEventData: Schema.Struct<{
52
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
53
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
54
+ readonly turn: Schema.Int;
55
+ readonly model_call_id: Schema.String;
56
+ readonly model_attempt_id: Schema.String;
57
+ readonly attempt: Schema.Int;
58
+ readonly completed_at: Schema.Int;
59
+ readonly usage: Schema.optionalKey<Schema.Struct<{
60
+ readonly input_tokens: Schema.NullOr<Schema.Int>;
61
+ readonly input_tokens_uncached: Schema.NullOr<Schema.Int>;
62
+ readonly input_tokens_cache_read: Schema.NullOr<Schema.Int>;
63
+ readonly input_tokens_cache_write: Schema.NullOr<Schema.Int>;
64
+ readonly output_tokens: Schema.NullOr<Schema.Int>;
65
+ readonly output_tokens_reasoning: Schema.NullOr<Schema.Int>;
66
+ readonly output_tokens_text: Schema.optionalKey<Schema.NullOr<Schema.Int>>;
67
+ }>>;
68
+ readonly usage_at: Schema.optionalKey<Schema.Int>;
69
+ readonly finish_reason: Schema.optionalKey<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
70
+ readonly request_id: Schema.optionalKey<Schema.String>;
71
+ readonly response_model: Schema.optionalKey<Schema.String>;
72
+ readonly service_tier: Schema.optionalKey<Schema.String>;
73
+ readonly cost: Schema.optionalKey<Schema.Struct<{
74
+ readonly amount: Schema.Finite;
75
+ readonly currency: Schema.String;
76
+ }>>;
77
+ }>;
78
+ export declare const ModelAttemptFailedEventData: Schema.Struct<{
79
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
80
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
81
+ readonly turn: Schema.Int;
82
+ readonly model_call_id: Schema.String;
83
+ readonly model_attempt_id: Schema.String;
84
+ readonly attempt: Schema.Int;
85
+ readonly failed_at: Schema.Int;
86
+ readonly category: Schema.Literals<readonly ["authentication", "rate-limit", "transport", "provider-response", "stream-decode", "context-overflow", "invalid-tool-call", "token-budget", "timeout", "cancellation", "unknown"]>;
87
+ readonly classification: Schema.Literals<readonly ["transient", "terminal"]>;
88
+ }>;
89
+ export declare const ModelRetryScheduledEventData: Schema.Struct<{
90
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
91
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
92
+ readonly turn: Schema.Int;
93
+ readonly model_call_id: Schema.String;
94
+ readonly attempt: Schema.Int;
95
+ readonly reason: Schema.Literals<readonly ["provider-resilience", "invalid-tool-call-correction"]>;
96
+ readonly category: Schema.Literals<readonly ["authentication", "rate-limit", "transport", "provider-response", "stream-decode", "context-overflow", "invalid-tool-call", "token-budget", "timeout", "cancellation", "unknown"]>;
97
+ readonly delay_millis: Schema.Finite;
98
+ readonly at: Schema.Int;
99
+ }>;
100
+ export declare const ModelCallCompletedEventData: Schema.Struct<{
101
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
102
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
103
+ readonly turn: Schema.Int;
104
+ readonly model_call_id: Schema.String;
105
+ readonly purpose: Schema.Literals<readonly ["conversation", "structured-output", "compaction-summary"]>;
106
+ readonly attempts: Schema.Int;
107
+ readonly completed_at: Schema.Int;
108
+ readonly usage: Schema.optionalKey<Schema.Struct<{
109
+ readonly input_tokens: Schema.NullOr<Schema.Int>;
110
+ readonly input_tokens_uncached: Schema.NullOr<Schema.Int>;
111
+ readonly input_tokens_cache_read: Schema.NullOr<Schema.Int>;
112
+ readonly input_tokens_cache_write: Schema.NullOr<Schema.Int>;
113
+ readonly output_tokens: Schema.NullOr<Schema.Int>;
114
+ readonly output_tokens_reasoning: Schema.NullOr<Schema.Int>;
115
+ readonly output_tokens_text: Schema.optionalKey<Schema.NullOr<Schema.Int>>;
116
+ }>>;
117
+ readonly finish_reason: Schema.optionalKey<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
118
+ }>;
119
+ export declare const ModelCallFailedEventData: Schema.Struct<{
120
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
121
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
122
+ readonly turn: Schema.Int;
123
+ readonly model_call_id: Schema.String;
124
+ readonly purpose: Schema.Literals<readonly ["conversation", "structured-output", "compaction-summary"]>;
125
+ readonly attempts: Schema.Int;
126
+ readonly failed_at: Schema.Int;
127
+ readonly category: Schema.Literals<readonly ["authentication", "rate-limit", "transport", "provider-response", "stream-decode", "context-overflow", "invalid-tool-call", "token-budget", "timeout", "cancellation", "unknown"]>;
128
+ }>;
129
+ export declare const CompactionStartedEventData: Schema.Struct<{
130
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
131
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
132
+ readonly turn: Schema.Int;
133
+ readonly compaction_id: Schema.String;
134
+ readonly trigger: Schema.Literals<readonly ["threshold", "overflow"]>;
135
+ readonly started_at: Schema.Int;
136
+ readonly context_tokens_before: Schema.optionalKey<Schema.Finite>;
137
+ readonly entries_before: Schema.optionalKey<Schema.Finite>;
138
+ }>;
139
+ export declare const CompactionCompletedEventData: Schema.Struct<{
140
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
141
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
142
+ readonly turn: Schema.Int;
143
+ readonly compaction_id: Schema.String;
144
+ readonly kind: Schema.Literals<readonly ["microcompact", "summarize", "unchanged"]>;
145
+ readonly completed_at: Schema.Int;
146
+ readonly summary_model_call_id: Schema.optionalKey<Schema.String>;
147
+ }>;
148
+ export declare const CompactionFailedEventData: Schema.Struct<{
149
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
150
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
151
+ readonly turn: Schema.Int;
152
+ readonly compaction_id: Schema.String;
153
+ readonly failed_at: Schema.Int;
154
+ }>;
155
+ export declare const CompactionCommittedEventData: Schema.Struct<{
156
+ readonly checkpoint_id: Schema.brand<Schema.String, "Relay.SessionEntryId"> & {
157
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SessionEntryId">;
158
+ };
159
+ readonly session_id: Schema.brand<Schema.String, "Relay.SessionId"> & {
160
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SessionId">;
161
+ };
162
+ readonly compaction_id: Schema.String;
163
+ readonly summary_model_call_id: Schema.optionalKey<Schema.String>;
164
+ readonly context_tokens_before: Schema.optionalKey<Schema.Finite>;
165
+ readonly context_tokens_after: Schema.optionalKey<Schema.Finite>;
166
+ readonly entries_before: Schema.optionalKey<Schema.Finite>;
167
+ readonly entries_after: Schema.optionalKey<Schema.Finite>;
168
+ }>;
169
+ export interface CompactionCommittedEventData extends Schema.Schema.Type<typeof CompactionCommittedEventData> {
170
+ }
171
+ export declare const ModelUsageReportedEventData: Schema.Struct<{
172
+ readonly input_tokens: Schema.NullOr<Schema.Int>;
173
+ readonly input_tokens_uncached: Schema.NullOr<Schema.Int>;
174
+ readonly input_tokens_cache_read: Schema.NullOr<Schema.Int>;
175
+ readonly input_tokens_cache_write: Schema.NullOr<Schema.Int>;
176
+ readonly output_tokens: Schema.NullOr<Schema.Int>;
177
+ readonly output_tokens_reasoning: Schema.NullOr<Schema.Int>;
178
+ readonly output_tokens_text: Schema.optionalKey<Schema.NullOr<Schema.Int>>;
179
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
180
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
181
+ readonly turn: Schema.Int;
182
+ readonly model_call_id: Schema.String;
183
+ readonly model_attempt_id: Schema.String;
184
+ readonly attempt: Schema.Int;
185
+ readonly provider: Schema.String;
186
+ readonly model: Schema.String;
187
+ readonly model_snapshot: Schema.optionalKey<Schema.String>;
188
+ readonly service_tier: Schema.optionalKey<Schema.String>;
189
+ readonly finish_reason: Schema.optionalKey<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
190
+ readonly usage_at: Schema.Int;
191
+ }>;
192
+ export interface ModelUsageReportedEventData extends Schema.Schema.Type<typeof ModelUsageReportedEventData> {
193
+ }
194
+ export declare const AnalyticalExecutionEvent: Schema.Union<readonly [Schema.Struct<{
195
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
196
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
197
+ };
198
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
199
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
200
+ };
201
+ readonly sequence: Schema.Int;
202
+ readonly cursor: Schema.String;
203
+ readonly created_at: Schema.Int;
204
+ readonly type: Schema.Literal<"model.call.started">;
205
+ readonly data: Schema.Struct<{
206
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
207
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
208
+ readonly turn: Schema.Int;
209
+ readonly model_call_id: Schema.String;
210
+ readonly purpose: Schema.Literals<readonly ["conversation", "structured-output", "compaction-summary"]>;
211
+ readonly provider: Schema.optionalKey<Schema.String>;
212
+ readonly model: Schema.optionalKey<Schema.String>;
213
+ readonly compaction_id: Schema.optionalKey<Schema.String>;
214
+ readonly started_at: Schema.Int;
215
+ }>;
216
+ }>, Schema.Struct<{
217
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
218
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
219
+ };
220
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
221
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
222
+ };
223
+ readonly sequence: Schema.Int;
224
+ readonly cursor: Schema.String;
225
+ readonly created_at: Schema.Int;
226
+ readonly type: Schema.Literal<"model.attempt.started">;
227
+ readonly data: Schema.Struct<{
228
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
229
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
230
+ readonly turn: Schema.Int;
231
+ readonly model_call_id: Schema.String;
232
+ readonly model_attempt_id: Schema.String;
233
+ readonly attempt: Schema.Int;
234
+ readonly started_at: Schema.Int;
235
+ }>;
236
+ }>, Schema.Struct<{
237
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
238
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
239
+ };
240
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
241
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
242
+ };
243
+ readonly sequence: Schema.Int;
244
+ readonly cursor: Schema.String;
245
+ readonly created_at: Schema.Int;
246
+ readonly type: Schema.Literal<"model.attempt.first_output">;
247
+ readonly data: Schema.Struct<{
248
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
249
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
250
+ readonly turn: Schema.Int;
251
+ readonly model_call_id: Schema.String;
252
+ readonly model_attempt_id: Schema.String;
253
+ readonly attempt: Schema.Int;
254
+ readonly kind: Schema.Literals<readonly ["reasoning", "text", "tool-call"]>;
255
+ readonly at: Schema.Int;
256
+ }>;
257
+ }>, Schema.Struct<{
258
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
259
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
260
+ };
261
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
262
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
263
+ };
264
+ readonly sequence: Schema.Int;
265
+ readonly cursor: Schema.String;
266
+ readonly created_at: Schema.Int;
267
+ readonly type: Schema.Literal<"model.attempt.completed">;
268
+ readonly data: Schema.Struct<{
269
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
270
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
271
+ readonly turn: Schema.Int;
272
+ readonly model_call_id: Schema.String;
273
+ readonly model_attempt_id: Schema.String;
274
+ readonly attempt: Schema.Int;
275
+ readonly completed_at: Schema.Int;
276
+ readonly usage: Schema.optionalKey<Schema.Struct<{
277
+ readonly input_tokens: Schema.NullOr<Schema.Int>;
278
+ readonly input_tokens_uncached: Schema.NullOr<Schema.Int>;
279
+ readonly input_tokens_cache_read: Schema.NullOr<Schema.Int>;
280
+ readonly input_tokens_cache_write: Schema.NullOr<Schema.Int>;
281
+ readonly output_tokens: Schema.NullOr<Schema.Int>;
282
+ readonly output_tokens_reasoning: Schema.NullOr<Schema.Int>;
283
+ readonly output_tokens_text: Schema.optionalKey<Schema.NullOr<Schema.Int>>;
284
+ }>>;
285
+ readonly usage_at: Schema.optionalKey<Schema.Int>;
286
+ readonly finish_reason: Schema.optionalKey<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
287
+ readonly request_id: Schema.optionalKey<Schema.String>;
288
+ readonly response_model: Schema.optionalKey<Schema.String>;
289
+ readonly service_tier: Schema.optionalKey<Schema.String>;
290
+ readonly cost: Schema.optionalKey<Schema.Struct<{
291
+ readonly amount: Schema.Finite;
292
+ readonly currency: Schema.String;
293
+ }>>;
294
+ }>;
295
+ }>, Schema.Struct<{
296
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
297
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
298
+ };
299
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
300
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
301
+ };
302
+ readonly sequence: Schema.Int;
303
+ readonly cursor: Schema.String;
304
+ readonly created_at: Schema.Int;
305
+ readonly type: Schema.Literal<"model.attempt.failed">;
306
+ readonly data: Schema.Struct<{
307
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
308
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
309
+ readonly turn: Schema.Int;
310
+ readonly model_call_id: Schema.String;
311
+ readonly model_attempt_id: Schema.String;
312
+ readonly attempt: Schema.Int;
313
+ readonly failed_at: Schema.Int;
314
+ readonly category: Schema.Literals<readonly ["authentication", "rate-limit", "transport", "provider-response", "stream-decode", "context-overflow", "invalid-tool-call", "token-budget", "timeout", "cancellation", "unknown"]>;
315
+ readonly classification: Schema.Literals<readonly ["transient", "terminal"]>;
316
+ }>;
317
+ }>, Schema.Struct<{
318
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
319
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
320
+ };
321
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
322
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
323
+ };
324
+ readonly sequence: Schema.Int;
325
+ readonly cursor: Schema.String;
326
+ readonly created_at: Schema.Int;
327
+ readonly type: Schema.Literal<"model.retry.scheduled">;
328
+ readonly data: Schema.Struct<{
329
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
330
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
331
+ readonly turn: Schema.Int;
332
+ readonly model_call_id: Schema.String;
333
+ readonly attempt: Schema.Int;
334
+ readonly reason: Schema.Literals<readonly ["provider-resilience", "invalid-tool-call-correction"]>;
335
+ readonly category: Schema.Literals<readonly ["authentication", "rate-limit", "transport", "provider-response", "stream-decode", "context-overflow", "invalid-tool-call", "token-budget", "timeout", "cancellation", "unknown"]>;
336
+ readonly delay_millis: Schema.Finite;
337
+ readonly at: Schema.Int;
338
+ }>;
339
+ }>, Schema.Struct<{
340
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
341
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
342
+ };
343
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
344
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
345
+ };
346
+ readonly sequence: Schema.Int;
347
+ readonly cursor: Schema.String;
348
+ readonly created_at: Schema.Int;
349
+ readonly type: Schema.Literal<"model.call.completed">;
350
+ readonly data: Schema.Struct<{
351
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
352
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
353
+ readonly turn: Schema.Int;
354
+ readonly model_call_id: Schema.String;
355
+ readonly purpose: Schema.Literals<readonly ["conversation", "structured-output", "compaction-summary"]>;
356
+ readonly attempts: Schema.Int;
357
+ readonly completed_at: Schema.Int;
358
+ readonly usage: Schema.optionalKey<Schema.Struct<{
359
+ readonly input_tokens: Schema.NullOr<Schema.Int>;
360
+ readonly input_tokens_uncached: Schema.NullOr<Schema.Int>;
361
+ readonly input_tokens_cache_read: Schema.NullOr<Schema.Int>;
362
+ readonly input_tokens_cache_write: Schema.NullOr<Schema.Int>;
363
+ readonly output_tokens: Schema.NullOr<Schema.Int>;
364
+ readonly output_tokens_reasoning: Schema.NullOr<Schema.Int>;
365
+ readonly output_tokens_text: Schema.optionalKey<Schema.NullOr<Schema.Int>>;
366
+ }>>;
367
+ readonly finish_reason: Schema.optionalKey<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
368
+ }>;
369
+ }>, Schema.Struct<{
370
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
371
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
372
+ };
373
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
374
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
375
+ };
376
+ readonly sequence: Schema.Int;
377
+ readonly cursor: Schema.String;
378
+ readonly created_at: Schema.Int;
379
+ readonly type: Schema.Literal<"model.call.failed">;
380
+ readonly data: Schema.Struct<{
381
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
382
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
383
+ readonly turn: Schema.Int;
384
+ readonly model_call_id: Schema.String;
385
+ readonly purpose: Schema.Literals<readonly ["conversation", "structured-output", "compaction-summary"]>;
386
+ readonly attempts: Schema.Int;
387
+ readonly failed_at: Schema.Int;
388
+ readonly category: Schema.Literals<readonly ["authentication", "rate-limit", "transport", "provider-response", "stream-decode", "context-overflow", "invalid-tool-call", "token-budget", "timeout", "cancellation", "unknown"]>;
389
+ }>;
390
+ }>, Schema.Struct<{
391
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
392
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
393
+ };
394
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
395
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
396
+ };
397
+ readonly sequence: Schema.Int;
398
+ readonly cursor: Schema.String;
399
+ readonly created_at: Schema.Int;
400
+ readonly type: Schema.Literal<"agent.compaction.started">;
401
+ readonly data: Schema.Struct<{
402
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
403
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
404
+ readonly turn: Schema.Int;
405
+ readonly compaction_id: Schema.String;
406
+ readonly trigger: Schema.Literals<readonly ["threshold", "overflow"]>;
407
+ readonly started_at: Schema.Int;
408
+ readonly context_tokens_before: Schema.optionalKey<Schema.Finite>;
409
+ readonly entries_before: Schema.optionalKey<Schema.Finite>;
410
+ }>;
411
+ }>, Schema.Struct<{
412
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
413
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
414
+ };
415
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
416
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
417
+ };
418
+ readonly sequence: Schema.Int;
419
+ readonly cursor: Schema.String;
420
+ readonly created_at: Schema.Int;
421
+ readonly type: Schema.Literal<"agent.compaction.completed">;
422
+ readonly data: Schema.Struct<{
423
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
424
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
425
+ readonly turn: Schema.Int;
426
+ readonly compaction_id: Schema.String;
427
+ readonly kind: Schema.Literals<readonly ["microcompact", "summarize", "unchanged"]>;
428
+ readonly completed_at: Schema.Int;
429
+ readonly summary_model_call_id: Schema.optionalKey<Schema.String>;
430
+ }>;
431
+ }>, Schema.Struct<{
432
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
433
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
434
+ };
435
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
436
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
437
+ };
438
+ readonly sequence: Schema.Int;
439
+ readonly cursor: Schema.String;
440
+ readonly created_at: Schema.Int;
441
+ readonly type: Schema.Literal<"agent.compaction.failed">;
442
+ readonly data: Schema.Struct<{
443
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
444
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
445
+ readonly turn: Schema.Int;
446
+ readonly compaction_id: Schema.String;
447
+ readonly failed_at: Schema.Int;
448
+ }>;
449
+ }>, Schema.Struct<{
450
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
451
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
452
+ };
453
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
454
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
455
+ };
456
+ readonly sequence: Schema.Int;
457
+ readonly cursor: Schema.String;
458
+ readonly created_at: Schema.Int;
459
+ readonly type: Schema.Literal<"agent.compaction.committed">;
460
+ readonly data: Schema.Struct<{
461
+ readonly checkpoint_id: Schema.brand<Schema.String, "Relay.SessionEntryId"> & {
462
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SessionEntryId">;
463
+ };
464
+ readonly session_id: Schema.brand<Schema.String, "Relay.SessionId"> & {
465
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SessionId">;
466
+ };
467
+ readonly compaction_id: Schema.String;
468
+ readonly summary_model_call_id: Schema.optionalKey<Schema.String>;
469
+ readonly context_tokens_before: Schema.optionalKey<Schema.Finite>;
470
+ readonly context_tokens_after: Schema.optionalKey<Schema.Finite>;
471
+ readonly entries_before: Schema.optionalKey<Schema.Finite>;
472
+ readonly entries_after: Schema.optionalKey<Schema.Finite>;
473
+ }>;
474
+ }>, Schema.Struct<{
475
+ readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
476
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
477
+ };
478
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
479
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
480
+ };
481
+ readonly sequence: Schema.Int;
482
+ readonly cursor: Schema.String;
483
+ readonly created_at: Schema.Int;
484
+ readonly type: Schema.Literal<"model.usage.reported">;
485
+ readonly data: Schema.Struct<{
486
+ readonly input_tokens: Schema.NullOr<Schema.Int>;
487
+ readonly input_tokens_uncached: Schema.NullOr<Schema.Int>;
488
+ readonly input_tokens_cache_read: Schema.NullOr<Schema.Int>;
489
+ readonly input_tokens_cache_write: Schema.NullOr<Schema.Int>;
490
+ readonly output_tokens: Schema.NullOr<Schema.Int>;
491
+ readonly output_tokens_reasoning: Schema.NullOr<Schema.Int>;
492
+ readonly output_tokens_text: Schema.optionalKey<Schema.NullOr<Schema.Int>>;
493
+ readonly telemetry_session_id: Schema.optionalKey<Schema.String>;
494
+ readonly delivery_id: Schema.optionalKey<Schema.String>;
495
+ readonly turn: Schema.Int;
496
+ readonly model_call_id: Schema.String;
497
+ readonly model_attempt_id: Schema.String;
498
+ readonly attempt: Schema.Int;
499
+ readonly provider: Schema.String;
500
+ readonly model: Schema.String;
501
+ readonly model_snapshot: Schema.optionalKey<Schema.String>;
502
+ readonly service_tier: Schema.optionalKey<Schema.String>;
503
+ readonly finish_reason: Schema.optionalKey<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
504
+ readonly usage_at: Schema.Int;
505
+ }>;
506
+ }>]>;
507
+ export type AnalyticalExecutionEvent = typeof AnalyticalExecutionEvent.Type;
@@ -1,8 +1,29 @@
1
1
  import { Schema } from "effect";
2
2
  import { Definition } from "./agent-schema";
3
3
  import { ChildExecutionId, ExecutionId } from "./ids-schema";
4
+ export * from "./execution-analytics-schema";
4
5
  export declare const ExecutionStatus: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
5
6
  export type ExecutionStatus = typeof ExecutionStatus.Type;
7
+ export declare const ExecutionOriginBuild: Schema.Struct<{
8
+ readonly name: Schema.String;
9
+ readonly version: Schema.optionalKey<Schema.String>;
10
+ readonly commit: Schema.optionalKey<Schema.String>;
11
+ }>;
12
+ export interface ExecutionOriginBuild extends Schema.Schema.Type<typeof ExecutionOriginBuild> {
13
+ }
14
+ export declare const ExecutionOrigin: Schema.Struct<{
15
+ readonly owner_kind: Schema.Literals<readonly ["service", "user", "workflow", "system"]>;
16
+ readonly owner: Schema.String;
17
+ readonly purpose: Schema.String;
18
+ readonly build: Schema.optionalKey<Schema.Struct<{
19
+ readonly name: Schema.String;
20
+ readonly version: Schema.optionalKey<Schema.String>;
21
+ readonly commit: Schema.optionalKey<Schema.String>;
22
+ }>>;
23
+ }>;
24
+ export interface ExecutionOrigin extends Schema.Schema.Type<typeof ExecutionOrigin> {
25
+ }
26
+ export declare const executionOriginMetadataKey = "relay_origin";
6
27
  export declare const Execution: Schema.Struct<{
7
28
  readonly id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
8
29
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
@@ -51,7 +72,7 @@ export declare const Execution: Schema.Struct<{
51
72
  };
52
73
  readonly turn_policy?: import("./agent-schema").TurnPolicySnapshot;
53
74
  readonly tool_execution?: Schema.Struct.ReadonlySide<{
54
- readonly concurrency: Schema.Finite;
75
+ readonly concurrency: Schema.Union<readonly [Schema.Finite, Schema.Literal<"unbounded">]>;
55
76
  }, "Encoded">;
56
77
  readonly compaction_policy?: {
57
78
  readonly context_window: number;
@@ -124,6 +145,16 @@ export declare const Execution: Schema.Struct<{
124
145
  };
125
146
  }, never, never>>;
126
147
  readonly agent_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
148
+ readonly origin: Schema.optionalKey<Schema.Struct<{
149
+ readonly owner_kind: Schema.Literals<readonly ["service", "user", "workflow", "system"]>;
150
+ readonly owner: Schema.String;
151
+ readonly purpose: Schema.String;
152
+ readonly build: Schema.optionalKey<Schema.Struct<{
153
+ readonly name: Schema.String;
154
+ readonly version: Schema.optionalKey<Schema.String>;
155
+ readonly commit: Schema.optionalKey<Schema.String>;
156
+ }>>;
157
+ }>>;
127
158
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
128
159
  readonly created_at: Schema.Int;
129
160
  readonly updated_at: Schema.Int;
@@ -390,25 +421,8 @@ export declare const steeringMessageId: (input: {
390
421
  readonly kind: "steering" | "follow_up";
391
422
  readonly sequence: number;
392
423
  }) => string & import("effect/Brand").Brand<"Relay.SteeringMessageId">;
393
- export declare const ExecutionEventType: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "agent.compaction.started", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
424
+ export declare const ExecutionEventType: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "model.call.started", "model.attempt.started", "model.attempt.first_output", "model.attempt.completed", "model.attempt.failed", "model.retry.scheduled", "model.call.completed", "model.call.failed", "agent.compaction.started", "agent.compaction.completed", "agent.compaction.failed", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
394
425
  export type ExecutionEventType = typeof ExecutionEventType.Type;
395
- export declare const CompactionStartedEventData: Schema.Struct<{
396
- readonly turn: Schema.Finite;
397
- readonly overflow: Schema.Boolean;
398
- }>;
399
- export interface CompactionStartedEventData extends Schema.Schema.Type<typeof CompactionStartedEventData> {
400
- }
401
- export declare const CompactionCommittedEventData: Schema.Struct<{
402
- readonly checkpoint_id: Schema.brand<Schema.String, "Relay.SessionEntryId"> & {
403
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SessionEntryId">;
404
- };
405
- readonly session_id: Schema.brand<Schema.String, "Relay.SessionId"> & {
406
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SessionId">;
407
- };
408
- readonly summary_present: Schema.Boolean;
409
- }>;
410
- export interface CompactionCommittedEventData extends Schema.Schema.Type<typeof CompactionCommittedEventData> {
411
- }
412
426
  export declare const ExecutionEvent: Schema.Struct<{
413
427
  readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
414
428
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
@@ -419,7 +433,7 @@ export declare const ExecutionEvent: Schema.Struct<{
419
433
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
420
434
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
421
435
  }>;
422
- readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "agent.compaction.started", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
436
+ readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "model.call.started", "model.attempt.started", "model.attempt.first_output", "model.attempt.completed", "model.attempt.failed", "model.retry.scheduled", "model.call.completed", "model.call.failed", "agent.compaction.started", "agent.compaction.completed", "agent.compaction.failed", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
423
437
  readonly sequence: Schema.Int;
424
438
  readonly cursor: Schema.String;
425
439
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -20,6 +20,7 @@ export interface Interface {
20
20
  readonly recordTerminal: (input: RecordTerminalInput) => Effect.Effect<RecordTerminalResult | undefined, ChildFanOutRepositoryError>;
21
21
  readonly cancel: (id: Ids.ChildFanOutId, cancelledAt: number) => Effect.Effect<CancelResult | undefined, ChildFanOutRepositoryError>;
22
22
  readonly listNonTerminal: (parentExecutionId?: Ids.ExecutionId) => Effect.Effect<ReadonlyArray<ChildOrchestration.FanOutState>, ChildFanOutRepositoryError>;
23
+ readonly listByParent: (parentExecutionId: Ids.ExecutionId) => Effect.Effect<ReadonlyArray<ChildOrchestration.FanOutState>, ChildFanOutRepositoryError>;
23
24
  }
24
25
  export interface RecordTerminalInput {
25
26
  readonly childExecutionId: Ids.ChildExecutionId;
@@ -50,4 +51,5 @@ export declare const claimAdmissions: (id: string & import("effect/Brand").Brand
50
51
  export declare const recordTerminal: (input: RecordTerminalInput) => Effect.Effect<RecordTerminalResult | undefined, ChildFanOutRepositoryError, Service>;
51
52
  export declare const cancel: (id: string & import("effect/Brand").Brand<"Relay.ChildFanOutId">, cancelledAt: number) => Effect.Effect<CancelResult | undefined, ChildFanOutRepositoryError, Service>;
52
53
  export declare const listNonTerminal: (parentExecutionId?: (string & import("effect/Brand").Brand<"Relay.ExecutionId">) | undefined) => Effect.Effect<readonly ChildOrchestration.FanOutState[], ChildFanOutRepositoryError, Service>;
54
+ export declare const listByParent: (parentExecutionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<readonly ChildOrchestration.FanOutState[], ChildFanOutRepositoryError, Service>;
53
55
  export {};