stitchkit 0.62.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.
- package/dist/agent-runtime/compaction.d.ts +14 -1
- package/dist/agent-runtime/compaction.d.ts.map +1 -1
- package/dist/agent-runtime/coordinator.d.ts +8 -2
- package/dist/agent-runtime/coordinator.d.ts.map +1 -1
- package/dist/agent-runtime/events.d.ts +124 -0
- package/dist/agent-runtime/events.d.ts.map +1 -1
- package/dist/agent-runtime/observability.d.ts +333 -12
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution.d.ts +4 -0
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/schemas.d.ts +199 -77
- package/dist/agent-runtime/schemas.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver.d.ts +180 -0
- package/dist/agent-runtime/store-driver.d.ts.map +1 -1
- package/dist/agent-runtime/store.d.ts +556 -0
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-commit.d.ts +33 -3
- package/dist/agent-runtime/terminal-commit.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-status.d.ts.map +1 -1
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/agent-runtime.d.ts.map +1 -1
- package/dist/agent-runtime.js +184 -29
- package/dist/{index-58vkx74h.js → index-b1k33127.js} +22 -18
- package/dist/testing/agent-store-conformance.d.ts.map +1 -1
- package/dist/testing.js +26 -4
- package/llms-full.txt +192 -12
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ZodType, z } from 'zod';
|
|
2
|
-
import type { AgentMessage, AgentSnapshot } from './schemas';
|
|
2
|
+
import type { AgentMessage, AgentSnapshot, AgentUsage } from './schemas';
|
|
3
3
|
import type { AgentRuntimeStore } from './store';
|
|
4
4
|
export interface AgentCompactionContext<SUMMARY> {
|
|
5
5
|
conversationId: string;
|
|
@@ -26,6 +26,19 @@ export interface AgentCompactionResult {
|
|
|
26
26
|
outcome: 'not_needed' | 'nothing_eligible' | 'applied' | 'conflict' | 'not_found';
|
|
27
27
|
snapshot: AgentSnapshot;
|
|
28
28
|
attempts: number;
|
|
29
|
+
/**
|
|
30
|
+
* What summarising cost, if the implementation counted it.
|
|
31
|
+
*
|
|
32
|
+
* Compaction runs inside the turn and calls a model, so its spend is the
|
|
33
|
+
* run's spend — but it produces no step and no event of its own, so without
|
|
34
|
+
* this it was invisible. `maxAttempts` can pay for it more than once on a CAS
|
|
35
|
+
* conflict; report the total, not the last attempt.
|
|
36
|
+
*
|
|
37
|
+
* `structuredCompaction` cannot fill this in for you: it hands `summarize` a
|
|
38
|
+
* context and takes a summary back, and what the summariser spent getting
|
|
39
|
+
* there is known only inside it. Return it from your own wrapper.
|
|
40
|
+
*/
|
|
41
|
+
usage?: AgentUsage;
|
|
29
42
|
}
|
|
30
43
|
export declare function structuredCompaction<SUMMARY_SCHEMA extends ZodType>(config: StructuredCompactionConfig<SUMMARY_SCHEMA>): (input: {
|
|
31
44
|
conversationId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/compaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/compaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAA4B,MAAM,SAAS,CA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OAAO,EACjE,MAAM,EAAE,0BAA0B,CAAC,cAAc,CAAC,WAU7B;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,EAAE,WAAW,CAAC;IACpB,eAAe,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;CAC3C,KAAG,OAAO,CAAC,qBAAqB,CAAC,CA0DnC"}
|
|
@@ -4,7 +4,13 @@
|
|
|
4
4
|
* `queue` finishes the run first. `interrupt` and `supersede` both end it, and
|
|
5
5
|
* differ in one thing only: what becomes of what it produced. An interrupted
|
|
6
6
|
* run's partial answer stays part of the conversation; a superseded run's does
|
|
7
|
-
* not reach the model again.
|
|
7
|
+
* not reach the model again. `inject` ends nothing: the run in flight takes the
|
|
8
|
+
* new input at its next step boundary and keeps going, which is right when the
|
|
9
|
+
* input refines rather than redirects and the work so far is still valid.
|
|
10
|
+
*
|
|
11
|
+
* `inject` queues like `queue` and is absorbed opportunistically, so a run that
|
|
12
|
+
* finishes before the next boundary simply answers it next — there is no case
|
|
13
|
+
* where an input is recorded as answered by a turn that never saw it.
|
|
8
14
|
*
|
|
9
15
|
* The runtime cannot decide that on its own, because the fact it turns on —
|
|
10
16
|
* whether anyone saw the partial answer — belongs to the delivery surface. A
|
|
@@ -13,7 +19,7 @@
|
|
|
13
19
|
* `inputPolicy` accepting a function of the input: one application can hold
|
|
14
20
|
* both surfaces.
|
|
15
21
|
*/
|
|
16
|
-
export type AgentInputPolicy = 'queue' | 'interrupt' | 'supersede';
|
|
22
|
+
export type AgentInputPolicy = 'queue' | 'interrupt' | 'supersede' | 'inject';
|
|
17
23
|
export type AgentStopReason = 'user-interrupt' | 'supersede' | 'timeout' | 'shutdown';
|
|
18
24
|
export interface AgentCoordinatedRun<RESULT> {
|
|
19
25
|
runId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coord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OG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,uBAAuB;IACtC,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAiBD,wBAAgB,6BAA6B,IAAI,uBAAuB,CAiJvE"}
|
|
@@ -92,6 +92,7 @@ export declare const AgentAdmissionEventSchema: z.ZodObject<{
|
|
|
92
92
|
assistantMessageId: z.ZodString;
|
|
93
93
|
state: z.ZodEnum<{
|
|
94
94
|
abandoned: "abandoned";
|
|
95
|
+
absorbed: "absorbed";
|
|
95
96
|
cancelled: "cancelled";
|
|
96
97
|
completed: "completed";
|
|
97
98
|
failed: "failed";
|
|
@@ -110,6 +111,7 @@ export declare const AgentAdmissionEventSchema: z.ZodObject<{
|
|
|
110
111
|
interrupted: "interrupted";
|
|
111
112
|
policy_stop: "policy_stop";
|
|
112
113
|
provider_failure: "provider_failure";
|
|
114
|
+
provider_stop: "provider_stop";
|
|
113
115
|
shutdown: "shutdown";
|
|
114
116
|
success: "success";
|
|
115
117
|
superseded: "superseded";
|
|
@@ -117,6 +119,64 @@ export declare const AgentAdmissionEventSchema: z.ZodObject<{
|
|
|
117
119
|
tool_failure: "tool_failure";
|
|
118
120
|
}>>;
|
|
119
121
|
terminalPolicyName: z.ZodOptional<z.ZodString>;
|
|
122
|
+
absorbedIntoRunId: z.ZodOptional<z.ZodString>;
|
|
123
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
inputTokens: z.ZodObject<{
|
|
125
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
provenance: z.ZodEnum<{
|
|
127
|
+
computed: "computed";
|
|
128
|
+
estimated: "estimated";
|
|
129
|
+
"provider-reported": "provider-reported";
|
|
130
|
+
unavailable: "unavailable";
|
|
131
|
+
}>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
outputTokens: z.ZodObject<{
|
|
134
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
provenance: z.ZodEnum<{
|
|
136
|
+
computed: "computed";
|
|
137
|
+
estimated: "estimated";
|
|
138
|
+
"provider-reported": "provider-reported";
|
|
139
|
+
unavailable: "unavailable";
|
|
140
|
+
}>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
reasoningTokens: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
provenance: z.ZodEnum<{
|
|
145
|
+
computed: "computed";
|
|
146
|
+
estimated: "estimated";
|
|
147
|
+
"provider-reported": "provider-reported";
|
|
148
|
+
unavailable: "unavailable";
|
|
149
|
+
}>;
|
|
150
|
+
}, z.core.$strip>>;
|
|
151
|
+
cacheReadTokens: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
provenance: z.ZodEnum<{
|
|
154
|
+
computed: "computed";
|
|
155
|
+
estimated: "estimated";
|
|
156
|
+
"provider-reported": "provider-reported";
|
|
157
|
+
unavailable: "unavailable";
|
|
158
|
+
}>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
cacheWriteTokens: z.ZodOptional<z.ZodObject<{
|
|
161
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
provenance: z.ZodEnum<{
|
|
163
|
+
computed: "computed";
|
|
164
|
+
estimated: "estimated";
|
|
165
|
+
"provider-reported": "provider-reported";
|
|
166
|
+
unavailable: "unavailable";
|
|
167
|
+
}>;
|
|
168
|
+
}, z.core.$strip>>;
|
|
169
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
172
|
+
provenance: z.ZodEnum<{
|
|
173
|
+
computed: "computed";
|
|
174
|
+
estimated: "estimated";
|
|
175
|
+
"provider-reported": "provider-reported";
|
|
176
|
+
unavailable: "unavailable";
|
|
177
|
+
}>;
|
|
178
|
+
}, z.core.$strip>>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
120
180
|
createdAt: z.ZodISODateTime;
|
|
121
181
|
updatedAt: z.ZodISODateTime;
|
|
122
182
|
}, z.core.$strip>;
|
|
@@ -421,6 +481,7 @@ export declare const AgentRunStateEventSchema: z.ZodObject<{
|
|
|
421
481
|
snapshotVersion: z.ZodInt;
|
|
422
482
|
state: z.ZodEnum<{
|
|
423
483
|
abandoned: "abandoned";
|
|
484
|
+
absorbed: "absorbed";
|
|
424
485
|
cancelled: "cancelled";
|
|
425
486
|
completed: "completed";
|
|
426
487
|
failed: "failed";
|
|
@@ -462,6 +523,7 @@ export declare const AgentTerminalEventSchema: z.ZodObject<{
|
|
|
462
523
|
interrupted: "interrupted";
|
|
463
524
|
policy_stop: "policy_stop";
|
|
464
525
|
provider_failure: "provider_failure";
|
|
526
|
+
provider_stop: "provider_stop";
|
|
465
527
|
shutdown: "shutdown";
|
|
466
528
|
success: "success";
|
|
467
529
|
superseded: "superseded";
|
|
@@ -702,6 +764,7 @@ export declare const AgentRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
702
764
|
assistantMessageId: z.ZodString;
|
|
703
765
|
state: z.ZodEnum<{
|
|
704
766
|
abandoned: "abandoned";
|
|
767
|
+
absorbed: "absorbed";
|
|
705
768
|
cancelled: "cancelled";
|
|
706
769
|
completed: "completed";
|
|
707
770
|
failed: "failed";
|
|
@@ -720,6 +783,7 @@ export declare const AgentRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
720
783
|
interrupted: "interrupted";
|
|
721
784
|
policy_stop: "policy_stop";
|
|
722
785
|
provider_failure: "provider_failure";
|
|
786
|
+
provider_stop: "provider_stop";
|
|
723
787
|
shutdown: "shutdown";
|
|
724
788
|
success: "success";
|
|
725
789
|
superseded: "superseded";
|
|
@@ -727,6 +791,64 @@ export declare const AgentRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
727
791
|
tool_failure: "tool_failure";
|
|
728
792
|
}>>;
|
|
729
793
|
terminalPolicyName: z.ZodOptional<z.ZodString>;
|
|
794
|
+
absorbedIntoRunId: z.ZodOptional<z.ZodString>;
|
|
795
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
796
|
+
inputTokens: z.ZodObject<{
|
|
797
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
798
|
+
provenance: z.ZodEnum<{
|
|
799
|
+
computed: "computed";
|
|
800
|
+
estimated: "estimated";
|
|
801
|
+
"provider-reported": "provider-reported";
|
|
802
|
+
unavailable: "unavailable";
|
|
803
|
+
}>;
|
|
804
|
+
}, z.core.$strip>;
|
|
805
|
+
outputTokens: z.ZodObject<{
|
|
806
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
807
|
+
provenance: z.ZodEnum<{
|
|
808
|
+
computed: "computed";
|
|
809
|
+
estimated: "estimated";
|
|
810
|
+
"provider-reported": "provider-reported";
|
|
811
|
+
unavailable: "unavailable";
|
|
812
|
+
}>;
|
|
813
|
+
}, z.core.$strip>;
|
|
814
|
+
reasoningTokens: z.ZodOptional<z.ZodObject<{
|
|
815
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
816
|
+
provenance: z.ZodEnum<{
|
|
817
|
+
computed: "computed";
|
|
818
|
+
estimated: "estimated";
|
|
819
|
+
"provider-reported": "provider-reported";
|
|
820
|
+
unavailable: "unavailable";
|
|
821
|
+
}>;
|
|
822
|
+
}, z.core.$strip>>;
|
|
823
|
+
cacheReadTokens: z.ZodOptional<z.ZodObject<{
|
|
824
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
825
|
+
provenance: z.ZodEnum<{
|
|
826
|
+
computed: "computed";
|
|
827
|
+
estimated: "estimated";
|
|
828
|
+
"provider-reported": "provider-reported";
|
|
829
|
+
unavailable: "unavailable";
|
|
830
|
+
}>;
|
|
831
|
+
}, z.core.$strip>>;
|
|
832
|
+
cacheWriteTokens: z.ZodOptional<z.ZodObject<{
|
|
833
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
834
|
+
provenance: z.ZodEnum<{
|
|
835
|
+
computed: "computed";
|
|
836
|
+
estimated: "estimated";
|
|
837
|
+
"provider-reported": "provider-reported";
|
|
838
|
+
unavailable: "unavailable";
|
|
839
|
+
}>;
|
|
840
|
+
}, z.core.$strip>>;
|
|
841
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
842
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
843
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
844
|
+
provenance: z.ZodEnum<{
|
|
845
|
+
computed: "computed";
|
|
846
|
+
estimated: "estimated";
|
|
847
|
+
"provider-reported": "provider-reported";
|
|
848
|
+
unavailable: "unavailable";
|
|
849
|
+
}>;
|
|
850
|
+
}, z.core.$strip>>;
|
|
851
|
+
}, z.core.$strip>>;
|
|
730
852
|
createdAt: z.ZodISODateTime;
|
|
731
853
|
updatedAt: z.ZodISODateTime;
|
|
732
854
|
}, z.core.$strip>;
|
|
@@ -1018,6 +1140,7 @@ export declare const AgentRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
1018
1140
|
snapshotVersion: z.ZodInt;
|
|
1019
1141
|
state: z.ZodEnum<{
|
|
1020
1142
|
abandoned: "abandoned";
|
|
1143
|
+
absorbed: "absorbed";
|
|
1021
1144
|
cancelled: "cancelled";
|
|
1022
1145
|
completed: "completed";
|
|
1023
1146
|
failed: "failed";
|
|
@@ -1057,6 +1180,7 @@ export declare const AgentRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
1057
1180
|
interrupted: "interrupted";
|
|
1058
1181
|
policy_stop: "policy_stop";
|
|
1059
1182
|
provider_failure: "provider_failure";
|
|
1183
|
+
provider_stop: "provider_stop";
|
|
1060
1184
|
shutdown: "shutdown";
|
|
1061
1185
|
success: "success";
|
|
1062
1186
|
superseded: "superseded";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAcvE,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAcvE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUpC,CAAC;AAQH;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;iBAKzC,CAAC;AAQH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;iBAEzC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;iBAGzC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;iBAEvC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,qBAAqB,CAAC;IAC/B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,SAAS,IAAI,uBAAuB,CAAC;IACrC,KAAK,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC3C;AAED,sEAAsE;AACtE,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,2BAA2B,GAClC,qBAAqB,CAiBvB;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,GAAG,sBAAsB,GAAG,WAAW,GAAG,UAAU,EACrE,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,GACtB,MAAM,CAER"}
|
|
@@ -1,13 +1,118 @@
|
|
|
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;
|
|
32
|
+
conversationId: z.ZodString;
|
|
33
|
+
runId: z.ZodString;
|
|
34
|
+
traceId: z.ZodString;
|
|
35
|
+
spanId: z.ZodString;
|
|
36
|
+
parentSpanId: z.ZodOptional<z.ZodString>;
|
|
37
|
+
state: z.ZodEnum<{
|
|
38
|
+
abandoned: "abandoned";
|
|
39
|
+
absorbed: "absorbed";
|
|
40
|
+
cancelled: "cancelled";
|
|
41
|
+
completed: "completed";
|
|
42
|
+
failed: "failed";
|
|
43
|
+
interrupt_requested: "interrupt_requested";
|
|
44
|
+
interrupted: "interrupted";
|
|
45
|
+
queued: "queued";
|
|
46
|
+
running: "running";
|
|
47
|
+
superseded: "superseded";
|
|
48
|
+
}>;
|
|
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;
|
|
11
116
|
conversationId: z.ZodString;
|
|
12
117
|
runId: z.ZodString;
|
|
13
118
|
traceId: z.ZodString;
|
|
@@ -15,6 +120,7 @@ export declare const AgentRunEventSchema: z.ZodObject<{
|
|
|
15
120
|
parentSpanId: z.ZodOptional<z.ZodString>;
|
|
16
121
|
state: z.ZodEnum<{
|
|
17
122
|
abandoned: "abandoned";
|
|
123
|
+
absorbed: "absorbed";
|
|
18
124
|
cancelled: "cancelled";
|
|
19
125
|
completed: "completed";
|
|
20
126
|
failed: "failed";
|
|
@@ -24,24 +130,142 @@ export declare const AgentRunEventSchema: z.ZodObject<{
|
|
|
24
130
|
running: "running";
|
|
25
131
|
superseded: "superseded";
|
|
26
132
|
}>;
|
|
27
|
-
|
|
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<{
|
|
28
138
|
abandoned: "abandoned";
|
|
29
139
|
cancelled: "cancelled";
|
|
30
140
|
interrupted: "interrupted";
|
|
31
141
|
policy_stop: "policy_stop";
|
|
32
142
|
provider_failure: "provider_failure";
|
|
143
|
+
provider_stop: "provider_stop";
|
|
33
144
|
shutdown: "shutdown";
|
|
34
145
|
success: "success";
|
|
35
146
|
superseded: "superseded";
|
|
36
147
|
timeout: "timeout";
|
|
37
148
|
tool_failure: "tool_failure";
|
|
38
|
-
}
|
|
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
|
+
}>;
|
|
39
237
|
modelId: z.ZodOptional<z.ZodString>;
|
|
40
|
-
|
|
238
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
emittedAt: z.ZodISODateTime;
|
|
240
|
+
type: z.ZodLiteral<"run-started">;
|
|
41
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>;
|
|
42
263
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
emittedAt: z.ZodISODateTime;
|
|
265
|
+
type: z.ZodLiteral<"step-finished">;
|
|
266
|
+
step: z.ZodInt;
|
|
43
267
|
ttftMs: z.ZodOptional<z.ZodNumber>;
|
|
44
|
-
usage: z.
|
|
268
|
+
usage: z.ZodObject<{
|
|
45
269
|
inputTokens: z.ZodObject<{
|
|
46
270
|
value: z.ZodOptional<z.ZodNumber>;
|
|
47
271
|
provenance: z.ZodEnum<{
|
|
@@ -97,10 +321,107 @@ export declare const AgentRunEventSchema: z.ZodObject<{
|
|
|
97
321
|
unavailable: "unavailable";
|
|
98
322
|
}>;
|
|
99
323
|
}, z.core.$strip>>;
|
|
100
|
-
}, z.core.$strip
|
|
101
|
-
|
|
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>;
|
|
102
347
|
emittedAt: z.ZodISODateTime;
|
|
103
|
-
|
|
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>;
|
|
104
425
|
export type AgentRunEvent = z.infer<typeof AgentRunEventSchema>;
|
|
105
426
|
export interface AgentRunSinkError {
|
|
106
427
|
error: unknown;
|