stitchkit 0.63.0 → 0.64.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.
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { ObservabilitySinkStatus } from '../observability/status';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const AgentRunStartedEventSchema: z.ZodObject<{
|
|
4
4
|
schemaVersion: z.ZodLiteral<1>;
|
|
5
5
|
eventId: z.ZodString;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
conversationId: z.ZodString;
|
|
7
|
+
runId: z.ZodString;
|
|
8
|
+
traceId: z.ZodString;
|
|
9
|
+
spanId: z.ZodString;
|
|
10
|
+
parentSpanId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
state: z.ZodEnum<{
|
|
12
|
+
abandoned: "abandoned";
|
|
13
|
+
absorbed: "absorbed";
|
|
14
|
+
cancelled: "cancelled";
|
|
15
|
+
completed: "completed";
|
|
16
|
+
failed: "failed";
|
|
17
|
+
interrupt_requested: "interrupt_requested";
|
|
18
|
+
interrupted: "interrupted";
|
|
19
|
+
queued: "queued";
|
|
20
|
+
running: "running";
|
|
21
|
+
superseded: "superseded";
|
|
10
22
|
}>;
|
|
23
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
24
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
emittedAt: z.ZodISODateTime;
|
|
26
|
+
type: z.ZodLiteral<"run-started">;
|
|
27
|
+
queueWaitMs: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export declare const AgentStepFinishedEventSchema: z.ZodObject<{
|
|
30
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
31
|
+
eventId: z.ZodString;
|
|
11
32
|
conversationId: z.ZodString;
|
|
12
33
|
runId: z.ZodString;
|
|
13
34
|
traceId: z.ZodString;
|
|
@@ -25,7 +46,95 @@ export declare const AgentRunEventSchema: z.ZodObject<{
|
|
|
25
46
|
running: "running";
|
|
26
47
|
superseded: "superseded";
|
|
27
48
|
}>;
|
|
28
|
-
|
|
49
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
50
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
emittedAt: z.ZodISODateTime;
|
|
52
|
+
type: z.ZodLiteral<"step-finished">;
|
|
53
|
+
step: z.ZodInt;
|
|
54
|
+
ttftMs: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
usage: z.ZodObject<{
|
|
56
|
+
inputTokens: z.ZodObject<{
|
|
57
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
provenance: z.ZodEnum<{
|
|
59
|
+
computed: "computed";
|
|
60
|
+
estimated: "estimated";
|
|
61
|
+
"provider-reported": "provider-reported";
|
|
62
|
+
unavailable: "unavailable";
|
|
63
|
+
}>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
outputTokens: z.ZodObject<{
|
|
66
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
provenance: z.ZodEnum<{
|
|
68
|
+
computed: "computed";
|
|
69
|
+
estimated: "estimated";
|
|
70
|
+
"provider-reported": "provider-reported";
|
|
71
|
+
unavailable: "unavailable";
|
|
72
|
+
}>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
reasoningTokens: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
provenance: z.ZodEnum<{
|
|
77
|
+
computed: "computed";
|
|
78
|
+
estimated: "estimated";
|
|
79
|
+
"provider-reported": "provider-reported";
|
|
80
|
+
unavailable: "unavailable";
|
|
81
|
+
}>;
|
|
82
|
+
}, z.core.$strip>>;
|
|
83
|
+
cacheReadTokens: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
provenance: z.ZodEnum<{
|
|
86
|
+
computed: "computed";
|
|
87
|
+
estimated: "estimated";
|
|
88
|
+
"provider-reported": "provider-reported";
|
|
89
|
+
unavailable: "unavailable";
|
|
90
|
+
}>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
cacheWriteTokens: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
provenance: z.ZodEnum<{
|
|
95
|
+
computed: "computed";
|
|
96
|
+
estimated: "estimated";
|
|
97
|
+
"provider-reported": "provider-reported";
|
|
98
|
+
unavailable: "unavailable";
|
|
99
|
+
}>;
|
|
100
|
+
}, z.core.$strip>>;
|
|
101
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
102
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
104
|
+
provenance: z.ZodEnum<{
|
|
105
|
+
computed: "computed";
|
|
106
|
+
estimated: "estimated";
|
|
107
|
+
"provider-reported": "provider-reported";
|
|
108
|
+
unavailable: "unavailable";
|
|
109
|
+
}>;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export declare const AgentRunTerminalEventSchema: z.ZodObject<{
|
|
114
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
115
|
+
eventId: z.ZodString;
|
|
116
|
+
conversationId: z.ZodString;
|
|
117
|
+
runId: z.ZodString;
|
|
118
|
+
traceId: z.ZodString;
|
|
119
|
+
spanId: z.ZodString;
|
|
120
|
+
parentSpanId: z.ZodOptional<z.ZodString>;
|
|
121
|
+
state: z.ZodEnum<{
|
|
122
|
+
abandoned: "abandoned";
|
|
123
|
+
absorbed: "absorbed";
|
|
124
|
+
cancelled: "cancelled";
|
|
125
|
+
completed: "completed";
|
|
126
|
+
failed: "failed";
|
|
127
|
+
interrupt_requested: "interrupt_requested";
|
|
128
|
+
interrupted: "interrupted";
|
|
129
|
+
queued: "queued";
|
|
130
|
+
running: "running";
|
|
131
|
+
superseded: "superseded";
|
|
132
|
+
}>;
|
|
133
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
134
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
emittedAt: z.ZodISODateTime;
|
|
136
|
+
type: z.ZodLiteral<"run-terminal">;
|
|
137
|
+
terminalReason: z.ZodEnum<{
|
|
29
138
|
abandoned: "abandoned";
|
|
30
139
|
cancelled: "cancelled";
|
|
31
140
|
interrupted: "interrupted";
|
|
@@ -37,13 +146,126 @@ export declare const AgentRunEventSchema: z.ZodObject<{
|
|
|
37
146
|
superseded: "superseded";
|
|
38
147
|
timeout: "timeout";
|
|
39
148
|
tool_failure: "tool_failure";
|
|
40
|
-
}
|
|
149
|
+
}>;
|
|
150
|
+
ttftMs: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
internalCause: z.ZodOptional<z.ZodUnknown>;
|
|
152
|
+
usage: z.ZodObject<{
|
|
153
|
+
inputTokens: z.ZodObject<{
|
|
154
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
provenance: z.ZodEnum<{
|
|
156
|
+
computed: "computed";
|
|
157
|
+
estimated: "estimated";
|
|
158
|
+
"provider-reported": "provider-reported";
|
|
159
|
+
unavailable: "unavailable";
|
|
160
|
+
}>;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
outputTokens: z.ZodObject<{
|
|
163
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
provenance: z.ZodEnum<{
|
|
165
|
+
computed: "computed";
|
|
166
|
+
estimated: "estimated";
|
|
167
|
+
"provider-reported": "provider-reported";
|
|
168
|
+
unavailable: "unavailable";
|
|
169
|
+
}>;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
reasoningTokens: z.ZodOptional<z.ZodObject<{
|
|
172
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
provenance: z.ZodEnum<{
|
|
174
|
+
computed: "computed";
|
|
175
|
+
estimated: "estimated";
|
|
176
|
+
"provider-reported": "provider-reported";
|
|
177
|
+
unavailable: "unavailable";
|
|
178
|
+
}>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
cacheReadTokens: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
provenance: z.ZodEnum<{
|
|
183
|
+
computed: "computed";
|
|
184
|
+
estimated: "estimated";
|
|
185
|
+
"provider-reported": "provider-reported";
|
|
186
|
+
unavailable: "unavailable";
|
|
187
|
+
}>;
|
|
188
|
+
}, z.core.$strip>>;
|
|
189
|
+
cacheWriteTokens: z.ZodOptional<z.ZodObject<{
|
|
190
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
provenance: z.ZodEnum<{
|
|
192
|
+
computed: "computed";
|
|
193
|
+
estimated: "estimated";
|
|
194
|
+
"provider-reported": "provider-reported";
|
|
195
|
+
unavailable: "unavailable";
|
|
196
|
+
}>;
|
|
197
|
+
}, z.core.$strip>>;
|
|
198
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
199
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
201
|
+
provenance: z.ZodEnum<{
|
|
202
|
+
computed: "computed";
|
|
203
|
+
estimated: "estimated";
|
|
204
|
+
"provider-reported": "provider-reported";
|
|
205
|
+
unavailable: "unavailable";
|
|
206
|
+
}>;
|
|
207
|
+
}, z.core.$strip>>;
|
|
208
|
+
}, z.core.$strip>;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
/**
|
|
211
|
+
* One operator event, discriminated by what kind of thing happened.
|
|
212
|
+
*
|
|
213
|
+
* The fields were flat and every one of them optional, so nothing could say
|
|
214
|
+
* that a step always has a step number, that only a terminal has a terminal
|
|
215
|
+
* reason, or that a terminal always states what it spent.
|
|
216
|
+
*/
|
|
217
|
+
export declare const AgentRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
218
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
219
|
+
eventId: z.ZodString;
|
|
220
|
+
conversationId: z.ZodString;
|
|
221
|
+
runId: z.ZodString;
|
|
222
|
+
traceId: z.ZodString;
|
|
223
|
+
spanId: z.ZodString;
|
|
224
|
+
parentSpanId: z.ZodOptional<z.ZodString>;
|
|
225
|
+
state: z.ZodEnum<{
|
|
226
|
+
abandoned: "abandoned";
|
|
227
|
+
absorbed: "absorbed";
|
|
228
|
+
cancelled: "cancelled";
|
|
229
|
+
completed: "completed";
|
|
230
|
+
failed: "failed";
|
|
231
|
+
interrupt_requested: "interrupt_requested";
|
|
232
|
+
interrupted: "interrupted";
|
|
233
|
+
queued: "queued";
|
|
234
|
+
running: "running";
|
|
235
|
+
superseded: "superseded";
|
|
236
|
+
}>;
|
|
41
237
|
modelId: z.ZodOptional<z.ZodString>;
|
|
42
|
-
|
|
238
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
emittedAt: z.ZodISODateTime;
|
|
240
|
+
type: z.ZodLiteral<"run-started">;
|
|
43
241
|
queueWaitMs: z.ZodOptional<z.ZodNumber>;
|
|
242
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
243
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
244
|
+
eventId: z.ZodString;
|
|
245
|
+
conversationId: z.ZodString;
|
|
246
|
+
runId: z.ZodString;
|
|
247
|
+
traceId: z.ZodString;
|
|
248
|
+
spanId: z.ZodString;
|
|
249
|
+
parentSpanId: z.ZodOptional<z.ZodString>;
|
|
250
|
+
state: z.ZodEnum<{
|
|
251
|
+
abandoned: "abandoned";
|
|
252
|
+
absorbed: "absorbed";
|
|
253
|
+
cancelled: "cancelled";
|
|
254
|
+
completed: "completed";
|
|
255
|
+
failed: "failed";
|
|
256
|
+
interrupt_requested: "interrupt_requested";
|
|
257
|
+
interrupted: "interrupted";
|
|
258
|
+
queued: "queued";
|
|
259
|
+
running: "running";
|
|
260
|
+
superseded: "superseded";
|
|
261
|
+
}>;
|
|
262
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
44
263
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
emittedAt: z.ZodISODateTime;
|
|
265
|
+
type: z.ZodLiteral<"step-finished">;
|
|
266
|
+
step: z.ZodInt;
|
|
45
267
|
ttftMs: z.ZodOptional<z.ZodNumber>;
|
|
46
|
-
usage: z.
|
|
268
|
+
usage: z.ZodObject<{
|
|
47
269
|
inputTokens: z.ZodObject<{
|
|
48
270
|
value: z.ZodOptional<z.ZodNumber>;
|
|
49
271
|
provenance: z.ZodEnum<{
|
|
@@ -99,10 +321,107 @@ export declare const AgentRunEventSchema: z.ZodObject<{
|
|
|
99
321
|
unavailable: "unavailable";
|
|
100
322
|
}>;
|
|
101
323
|
}, z.core.$strip>>;
|
|
102
|
-
}, z.core.$strip
|
|
103
|
-
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
326
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
327
|
+
eventId: z.ZodString;
|
|
328
|
+
conversationId: z.ZodString;
|
|
329
|
+
runId: z.ZodString;
|
|
330
|
+
traceId: z.ZodString;
|
|
331
|
+
spanId: z.ZodString;
|
|
332
|
+
parentSpanId: z.ZodOptional<z.ZodString>;
|
|
333
|
+
state: z.ZodEnum<{
|
|
334
|
+
abandoned: "abandoned";
|
|
335
|
+
absorbed: "absorbed";
|
|
336
|
+
cancelled: "cancelled";
|
|
337
|
+
completed: "completed";
|
|
338
|
+
failed: "failed";
|
|
339
|
+
interrupt_requested: "interrupt_requested";
|
|
340
|
+
interrupted: "interrupted";
|
|
341
|
+
queued: "queued";
|
|
342
|
+
running: "running";
|
|
343
|
+
superseded: "superseded";
|
|
344
|
+
}>;
|
|
345
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
346
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
104
347
|
emittedAt: z.ZodISODateTime;
|
|
105
|
-
|
|
348
|
+
type: z.ZodLiteral<"run-terminal">;
|
|
349
|
+
terminalReason: z.ZodEnum<{
|
|
350
|
+
abandoned: "abandoned";
|
|
351
|
+
cancelled: "cancelled";
|
|
352
|
+
interrupted: "interrupted";
|
|
353
|
+
policy_stop: "policy_stop";
|
|
354
|
+
provider_failure: "provider_failure";
|
|
355
|
+
provider_stop: "provider_stop";
|
|
356
|
+
shutdown: "shutdown";
|
|
357
|
+
success: "success";
|
|
358
|
+
superseded: "superseded";
|
|
359
|
+
timeout: "timeout";
|
|
360
|
+
tool_failure: "tool_failure";
|
|
361
|
+
}>;
|
|
362
|
+
ttftMs: z.ZodOptional<z.ZodNumber>;
|
|
363
|
+
internalCause: z.ZodOptional<z.ZodUnknown>;
|
|
364
|
+
usage: z.ZodObject<{
|
|
365
|
+
inputTokens: z.ZodObject<{
|
|
366
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
367
|
+
provenance: z.ZodEnum<{
|
|
368
|
+
computed: "computed";
|
|
369
|
+
estimated: "estimated";
|
|
370
|
+
"provider-reported": "provider-reported";
|
|
371
|
+
unavailable: "unavailable";
|
|
372
|
+
}>;
|
|
373
|
+
}, z.core.$strip>;
|
|
374
|
+
outputTokens: z.ZodObject<{
|
|
375
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
376
|
+
provenance: z.ZodEnum<{
|
|
377
|
+
computed: "computed";
|
|
378
|
+
estimated: "estimated";
|
|
379
|
+
"provider-reported": "provider-reported";
|
|
380
|
+
unavailable: "unavailable";
|
|
381
|
+
}>;
|
|
382
|
+
}, z.core.$strip>;
|
|
383
|
+
reasoningTokens: z.ZodOptional<z.ZodObject<{
|
|
384
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
385
|
+
provenance: z.ZodEnum<{
|
|
386
|
+
computed: "computed";
|
|
387
|
+
estimated: "estimated";
|
|
388
|
+
"provider-reported": "provider-reported";
|
|
389
|
+
unavailable: "unavailable";
|
|
390
|
+
}>;
|
|
391
|
+
}, z.core.$strip>>;
|
|
392
|
+
cacheReadTokens: z.ZodOptional<z.ZodObject<{
|
|
393
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
394
|
+
provenance: z.ZodEnum<{
|
|
395
|
+
computed: "computed";
|
|
396
|
+
estimated: "estimated";
|
|
397
|
+
"provider-reported": "provider-reported";
|
|
398
|
+
unavailable: "unavailable";
|
|
399
|
+
}>;
|
|
400
|
+
}, z.core.$strip>>;
|
|
401
|
+
cacheWriteTokens: z.ZodOptional<z.ZodObject<{
|
|
402
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
403
|
+
provenance: z.ZodEnum<{
|
|
404
|
+
computed: "computed";
|
|
405
|
+
estimated: "estimated";
|
|
406
|
+
"provider-reported": "provider-reported";
|
|
407
|
+
unavailable: "unavailable";
|
|
408
|
+
}>;
|
|
409
|
+
}, z.core.$strip>>;
|
|
410
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
411
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
412
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
413
|
+
provenance: z.ZodEnum<{
|
|
414
|
+
computed: "computed";
|
|
415
|
+
estimated: "estimated";
|
|
416
|
+
"provider-reported": "provider-reported";
|
|
417
|
+
unavailable: "unavailable";
|
|
418
|
+
}>;
|
|
419
|
+
}, z.core.$strip>>;
|
|
420
|
+
}, z.core.$strip>;
|
|
421
|
+
}, z.core.$strip>], "type">;
|
|
422
|
+
export type AgentRunStartedEvent = z.infer<typeof AgentRunStartedEventSchema>;
|
|
423
|
+
export type AgentStepFinishedEvent = z.infer<typeof AgentStepFinishedEventSchema>;
|
|
424
|
+
export type AgentRunTerminalEvent = z.infer<typeof AgentRunTerminalEventSchema>;
|
|
106
425
|
export type AgentRunEvent = z.infer<typeof AgentRunEventSchema>;
|
|
107
426
|
export interface AgentRunSinkError {
|
|
108
427
|
error: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/observability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/observability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AA2BvE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;iBAIrC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMvC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgBtC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAI9B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,qBAA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B,CAAC;IACrC,KAAK,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC3C;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAkDvF"}
|
package/dist/agent-runtime.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { AgentAdmissionEventSchema, AgentCheckpointEventSchema, AgentReasoningDe
|
|
|
4
4
|
export { type AgentHistoryProjectionDecision, type AgentHistoryProjectionOptions, type AgentHistoryProjectionResult, projectAgentHistory, projectAgentHistoryDetailed, } from './agent-runtime/history';
|
|
5
5
|
export { type AgentToolFenceConfig, type AgentToolFenceContext, createAgentToolFenceLifecycle, } from './agent-runtime/managed-tools';
|
|
6
6
|
export { type AgentLanguageModelProvider, type AgentModelCapability, AgentModelCapabilitySchema, type AgentModelDescriptor, AgentModelDescriptorSchema, type AgentModelRegistry, type AgentModelRegistryConfig, type AgentModelRegistrySnapshot, AgentModelRegistrySnapshotSchema, type AgentModelSnapshotPolicy, type AgentResolvedModel, defineModelRegistry, validateAgentModelSnapshot, } from './agent-runtime/models';
|
|
7
|
-
export { type AgentObservability, type AgentRunEvent, AgentRunEventSchema, type AgentRunSinkConfig, type AgentRunSinkDrop, type AgentRunSinkError, createAgentObservability, } from './agent-runtime/observability';
|
|
7
|
+
export { type AgentObservability, type AgentRunEvent, AgentRunEventSchema, type AgentRunSinkConfig, type AgentRunSinkDrop, type AgentRunSinkError, type AgentRunStartedEvent, AgentRunStartedEventSchema, type AgentRunTerminalEvent, AgentRunTerminalEventSchema, type AgentStepFinishedEvent, AgentStepFinishedEventSchema, createAgentObservability, } from './agent-runtime/observability';
|
|
8
8
|
export { type AgentHistoryBudgetDecision, type AgentHistoryBudgetResult, type AgentPromptBudget, type AgentPromptSection, type AgentPromptSectionContext, type AgentTokenCount, AgentTokenCountSchema, type ComposeAgentPromptOptions, type ComposedAgentPrompt, composeAgentPrompt, type SelectAgentHistoryOptions, selectAgentHistory, } from './agent-runtime/prompt';
|
|
9
9
|
export { type AgentProtocol, type AgentProtocolConfig, defineAgentProtocol, } from './agent-runtime/protocol';
|
|
10
10
|
export { type AgentRuntime, type AgentRuntimeAdmission, type AgentRuntimeConfig, type AgentRuntimeInput, type AgentRuntimeInterruptInput, type AgentRuntimePrepareStep, type AgentRuntimeProtocolInput, type AgentRuntimeRecordIds, type AgentRuntimeRecoverOptions, type AgentRuntimeRecoveryDecision, type AgentRuntimeRecoveryInput, type AgentRuntimeRecoveryOutcome, type AgentRuntimeRunContext, type AgentRuntimeStopPolicy, createAgentRuntime, } from './agent-runtime/runtime';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-runtime.d.ts","sourceRoot":"","sources":["../src/agent-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,EAC9B,4BAA4B,EAC5B,8BAA8B,EAC9B,wBAAwB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,6BAA6B,EAC7B,uBAAuB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,EAC9B,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,4BAA4B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EACxB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,KAAK,0BAA0B,EAC/B,gCAAgC,EAChC,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACnC,KAAK,cAAc,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/dist/agent-runtime.js
CHANGED
|
@@ -758,26 +758,41 @@ function validateAgentModelSnapshot(input, policy) {
|
|
|
758
758
|
}
|
|
759
759
|
// src/agent-runtime/observability.ts
|
|
760
760
|
import { z as z3 } from "zod";
|
|
761
|
-
var
|
|
761
|
+
var AgentRunEventBaseSchema = z3.object({
|
|
762
762
|
schemaVersion: z3.literal(1),
|
|
763
763
|
eventId: AgentRecordIdSchema,
|
|
764
|
-
type: z3.enum(["run-started", "step-finished", "run-terminal"]),
|
|
765
764
|
conversationId: AgentRecordIdSchema,
|
|
766
765
|
runId: AgentRecordIdSchema,
|
|
767
766
|
traceId: z3.string().min(1),
|
|
768
767
|
spanId: z3.string().min(1),
|
|
769
768
|
parentSpanId: z3.string().min(1).optional(),
|
|
770
769
|
state: AgentRunStateSchema,
|
|
771
|
-
terminalReason: AgentTerminalReasonSchema.optional(),
|
|
772
770
|
modelId: z3.string().min(1).optional(),
|
|
773
|
-
step: z3.int().nonnegative().optional(),
|
|
774
|
-
queueWaitMs: z3.number().nonnegative().optional(),
|
|
775
771
|
durationMs: z3.number().nonnegative().optional(),
|
|
772
|
+
emittedAt: AgentTimestampSchema
|
|
773
|
+
});
|
|
774
|
+
var AgentRunStartedEventSchema = AgentRunEventBaseSchema.extend({
|
|
775
|
+
type: z3.literal("run-started"),
|
|
776
|
+
queueWaitMs: z3.number().nonnegative().optional()
|
|
777
|
+
});
|
|
778
|
+
var AgentStepFinishedEventSchema = AgentRunEventBaseSchema.extend({
|
|
779
|
+
type: z3.literal("step-finished"),
|
|
780
|
+
step: z3.int().nonnegative(),
|
|
781
|
+
ttftMs: z3.number().nonnegative().optional(),
|
|
782
|
+
usage: AgentUsageSchema
|
|
783
|
+
});
|
|
784
|
+
var AgentRunTerminalEventSchema = AgentRunEventBaseSchema.extend({
|
|
785
|
+
type: z3.literal("run-terminal"),
|
|
786
|
+
terminalReason: AgentTerminalReasonSchema,
|
|
776
787
|
ttftMs: z3.number().nonnegative().optional(),
|
|
777
|
-
usage: AgentUsageSchema.optional(),
|
|
778
788
|
internalCause: z3.unknown().optional(),
|
|
779
|
-
|
|
789
|
+
usage: AgentUsageSchema
|
|
780
790
|
});
|
|
791
|
+
var AgentRunEventSchema = z3.discriminatedUnion("type", [
|
|
792
|
+
AgentRunStartedEventSchema,
|
|
793
|
+
AgentStepFinishedEventSchema,
|
|
794
|
+
AgentRunTerminalEventSchema
|
|
795
|
+
]);
|
|
781
796
|
function createAgentObservability(config) {
|
|
782
797
|
const manager = createBoundedSinkManager({
|
|
783
798
|
write: config.write,
|
|
@@ -808,7 +823,13 @@ function createAgentObservability(config) {
|
|
|
808
823
|
if ((config.deduplicate ?? true) && emitted.has(parsed.eventId))
|
|
809
824
|
return;
|
|
810
825
|
remember(parsed.eventId);
|
|
811
|
-
manager.submit(() =>
|
|
826
|
+
manager.submit(() => {
|
|
827
|
+
if (config.includeInternalCause)
|
|
828
|
+
return parsed;
|
|
829
|
+
if (parsed.type !== "run-terminal")
|
|
830
|
+
return parsed;
|
|
831
|
+
return AgentRunTerminalEventSchema.omit({ internalCause: true }).parse(parsed);
|
|
832
|
+
});
|
|
812
833
|
},
|
|
813
834
|
flush: () => manager.flush(),
|
|
814
835
|
getStatus: () => manager.getStatus(),
|
|
@@ -3300,14 +3321,17 @@ export {
|
|
|
3300
3321
|
AgentRunEventSchema,
|
|
3301
3322
|
AgentRunMetricsSchema,
|
|
3302
3323
|
AgentRunSchema,
|
|
3324
|
+
AgentRunStartedEventSchema,
|
|
3303
3325
|
AgentRunStateEventSchema,
|
|
3304
3326
|
AgentRunStateSchema,
|
|
3327
|
+
AgentRunTerminalEventSchema,
|
|
3305
3328
|
AgentRuntimeConflictError,
|
|
3306
3329
|
AgentRuntimeEventCursorSchema,
|
|
3307
3330
|
AgentRuntimeEventSchema,
|
|
3308
3331
|
AgentRuntimeHeadSchema,
|
|
3309
3332
|
AgentSnapshotSchema,
|
|
3310
3333
|
AgentSourcePartSchema,
|
|
3334
|
+
AgentStepFinishedEventSchema,
|
|
3311
3335
|
AgentStoreAppliedSchema,
|
|
3312
3336
|
AgentStoreConflictSchema,
|
|
3313
3337
|
AgentStoreDuplicateSchema,
|
package/llms-full.txt
CHANGED
|
@@ -58,7 +58,7 @@ own, recorded as an ADR.
|
|
|
58
58
|
| `stitchkit/testing` | tests on Bun or Node | stable | in-process generated clients over a real Fetch handler, plus the store and managed-resource conformance kits |
|
|
59
59
|
| `stitchkit/declaration` | build and deployment tooling (Bun or Node) | evolving | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
|
|
60
60
|
| `stitchkit/react` | browser | stable | `createCursorQuery`, `createCacheBridge` |
|
|
61
|
-
| `stitchkit/agent-runtime` | server | evolving | optional durable conversation/run loop, history, models, prompts, fencing and events |
|
|
61
|
+
| `stitchkit/agent-runtime` | server | evolving<br>_redefined in 7 of the 9 minors since 0.56.2, most recently 0.64.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
|
|
62
62
|
| `stitchkit/agent-runtime/openrouter` | server | evolving | isolated OpenRouter language-model adapter |
|
|
63
63
|
| `stitchkit/application` | server | evolving | managed resource graph, readiness, admission, schedules and bounded shutdown |
|
|
64
64
|
| `stitchkit/application/grammy` | server | evolving | isolated grammY polling and webhook lifecycle adapters |
|
|
@@ -7763,6 +7763,24 @@ additive** — adopting it changes nothing in your code. (See
|
|
|
7763
7763
|
So upgrading is: read the `### ⚠️ Breaking changes` of every version *above* your
|
|
7764
7764
|
current one *up to* your target, and apply each snippet.
|
|
7765
7765
|
|
|
7766
|
+
## Before you bump, if you implement an agent store
|
|
7767
|
+
|
|
7768
|
+
One step, and it is mechanical. If your project has an `AgentRuntimeStore` — a
|
|
7769
|
+
Prisma adapter, an in-memory one, anything — run the conformance kit against it
|
|
7770
|
+
**on the version you are leaving**, then again after the bump:
|
|
7771
|
+
|
|
7772
|
+
```ts
|
|
7773
|
+
import { runAgentStoreConformance } from 'stitchkit/testing'
|
|
7774
|
+
|
|
7775
|
+
await runAgentStoreConformance({ store: yourStore, conversationId: 'conformance' })
|
|
7776
|
+
```
|
|
7777
|
+
|
|
7778
|
+
Green before and red after tells you the contract grew and where, in one run,
|
|
7779
|
+
instead of one failure at a time in production. Green both times means the
|
|
7780
|
+
upgrade owes you nothing on that surface — which is the usual answer if you
|
|
7781
|
+
implement `AgentRuntimeStoreDriver` and compose the aggregate with
|
|
7782
|
+
`createAgentRuntimeStore(driver)`, the supported shape (→ ADR 0111).
|
|
7783
|
+
|
|
7766
7784
|
## Flow (agent or human)
|
|
7767
7785
|
|
|
7768
7786
|
1. **Find the current version.** In the consumer: the resolved `stitchkit` in
|
|
@@ -7801,6 +7819,47 @@ current one *up to* your target, and apply each snippet.
|
|
|
7801
7819
|
runtime): bootstrap the server, one HTTP request, and any feature you rely on
|
|
7802
7820
|
(Socket.IO connect, an MCP tool call, a multipart upload, …).
|
|
7803
7821
|
|
|
7822
|
+
## Released migration: 0.64.0
|
|
7823
|
+
|
|
7824
|
+
Two changes, and only one of them can break a build. Nothing was removed.
|
|
7825
|
+
|
|
7826
|
+
### An event that says which kind it is
|
|
7827
|
+
|
|
7828
|
+
### Narrow `AgentRunEvent` on `type`
|
|
7829
|
+
|
|
7830
|
+
```ts
|
|
7831
|
+
// before
|
|
7832
|
+
for (const event of events) record(event.usage?.cost?.value ?? 0)
|
|
7833
|
+
|
|
7834
|
+
// after — and the compiler will point at every site
|
|
7835
|
+
for (const event of events) {
|
|
7836
|
+
if (event.type !== 'run-terminal') continue
|
|
7837
|
+
record(event.usage.cost.value ?? null) // `usage` is present; unknown says so
|
|
7838
|
+
}
|
|
7839
|
+
```
|
|
7840
|
+
|
|
7841
|
+
`step` is now required on `step-finished`, `terminalReason` on `run-terminal`,
|
|
7842
|
+
and `usage` on both. `queueWaitMs` exists only on `run-started`. Nothing was
|
|
7843
|
+
removed — the fields that were optional because a *different* kind of event
|
|
7844
|
+
lacked them are now simply on the kinds that have them.
|
|
7845
|
+
|
|
7846
|
+
Import `AgentRunTerminalEventSchema` (or the sibling schemas) if you construct
|
|
7847
|
+
events in tests.
|
|
7848
|
+
|
|
7849
|
+
### If you implement `AgentRuntimeStore` directly, move to the driver
|
|
7850
|
+
|
|
7851
|
+
Not urgent and nothing breaks today — but the aggregate is no longer the
|
|
7852
|
+
supported target, so its future growth will not be announced as breaking
|
|
7853
|
+
(→ ADR 0111). The supported shape is one line:
|
|
7854
|
+
|
|
7855
|
+
```ts
|
|
7856
|
+
const driver: AgentRuntimeStoreDriver<TransactionClient> = { /* six primitives */ }
|
|
7857
|
+
export const store = createAgentRuntimeStore(driver)
|
|
7858
|
+
```
|
|
7859
|
+
|
|
7860
|
+
Run `runAgentStoreConformance` against your adapter before and after any bump —
|
|
7861
|
+
see *Before you bump, if you implement an agent store* above.
|
|
7862
|
+
|
|
7804
7863
|
## Released migration: 0.63.0
|
|
7805
7864
|
|
|
7806
7865
|
Four changes to what a running system reports and how an input reaches a run
|
|
@@ -10391,6 +10450,8 @@ snapshot reload; the bounded sink isolates transport failure and supports a type
|
|
|
10391
10450
|
|
|
10392
10451
|
Managed effects and operator telemetry additionally export `AgentToolFenceConfig`,
|
|
10393
10452
|
`AgentToolFenceContext`, `AgentObservability`, `AgentRunEvent`, `AgentRunEventSchema`,
|
|
10453
|
+
`AgentRunStartedEvent`, `AgentRunStartedEventSchema`, `AgentStepFinishedEvent`,
|
|
10454
|
+
`AgentStepFinishedEventSchema`, `AgentRunTerminalEvent`, `AgentRunTerminalEventSchema`,
|
|
10394
10455
|
`AgentRunSinkConfig`, `AgentRunSinkDrop` and `AgentRunSinkError`. A monotonic run `fencingToken`
|
|
10395
10456
|
may accompany checkpoint/terminal writes and tool context; internal causes are redacted unless an
|
|
10396
10457
|
operator-only observability sink explicitly opts in.
|
package/package.json
CHANGED