xo-harness 0.2.0 → 0.3.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/README.md +92 -5
- package/dist/browser/worklets/capture-processor.js +34 -0
- package/dist/browser/worklets/playback-processor.js +188 -0
- package/dist/browser.d.ts +1 -0
- package/dist/browser.js +1 -0
- package/dist/internal/browser/browser-voice-client.d.ts +33 -0
- package/dist/internal/browser/browser-voice-client.js +316 -0
- package/dist/internal/browser/index.d.ts +2 -0
- package/dist/internal/browser/index.js +1 -0
- package/dist/internal/harness/conversation-context.d.ts +45 -0
- package/dist/internal/harness/conversation-context.js +79 -0
- package/dist/internal/harness/conversation-projection.d.ts +55 -0
- package/dist/internal/harness/conversation-projection.js +145 -0
- package/dist/internal/harness/event-stream.d.ts +23 -2
- package/dist/internal/harness/event-stream.js +148 -18
- package/dist/internal/harness/index.d.ts +7 -1
- package/dist/internal/harness/index.js +7 -1
- package/dist/internal/harness/message.d.ts +24 -11
- package/dist/internal/harness/message.js +271 -77
- package/dist/internal/harness/report-diff.d.ts +3 -0
- package/dist/internal/harness/report-diff.js +10 -0
- package/dist/internal/harness/report.d.ts +17 -14
- package/dist/internal/harness/report.js +41 -24
- package/dist/internal/harness/runtime-limits.d.ts +18 -0
- package/dist/internal/harness/runtime-limits.js +19 -0
- package/dist/internal/harness/session-persistence.d.ts +16 -0
- package/dist/internal/harness/session-persistence.js +106 -0
- package/dist/internal/harness/shadow.d.ts +5 -5
- package/dist/internal/harness/shadow.js +214 -52
- package/dist/internal/harness/socket-bridge.d.ts +45 -4
- package/dist/internal/harness/socket-bridge.js +215 -46
- package/dist/internal/harness/task-supervisor.d.ts +6 -2
- package/dist/internal/harness/task-supervisor.js +97 -15
- package/dist/internal/harness/tool-calls.d.ts +40 -0
- package/dist/internal/harness/tool-calls.js +132 -0
- package/dist/internal/harness/tool-policy.d.ts +2 -2
- package/dist/internal/harness/tool-runtime.d.ts +2 -2
- package/dist/internal/harness/tool-runtime.js +37 -40
- package/dist/internal/harness/tools.d.ts +21 -0
- package/dist/internal/harness/tools.js +7 -1
- package/dist/internal/harness/usage-tracker.d.ts +39 -0
- package/dist/internal/harness/usage-tracker.js +104 -0
- package/dist/internal/harness/voice-session.d.ts +39 -8
- package/dist/internal/harness/voice-session.js +353 -58
- package/dist/internal/harness/xo.d.ts +7 -12
- package/dist/internal/harness/xo.js +25 -13
- package/dist/internal/protocol/async-queue.d.ts +22 -1
- package/dist/internal/protocol/async-queue.js +86 -12
- package/dist/internal/protocol/audio.d.ts +16 -2
- package/dist/internal/protocol/audio.js +23 -5
- package/dist/internal/protocol/backend-output.d.ts +70 -0
- package/dist/internal/protocol/backend-output.js +39 -0
- package/dist/internal/protocol/event-json.d.ts +3 -0
- package/dist/internal/protocol/event-json.js +15 -0
- package/dist/internal/protocol/events.d.ts +342 -4
- package/dist/internal/protocol/events.js +53 -25
- package/dist/internal/protocol/index.d.ts +5 -0
- package/dist/internal/protocol/index.js +5 -0
- package/dist/internal/protocol/output-source.d.ts +18 -0
- package/dist/internal/protocol/output-source.js +15 -0
- package/dist/internal/protocol/paced-audio.d.ts +27 -0
- package/dist/internal/protocol/paced-audio.js +117 -0
- package/dist/internal/protocol/parts.d.ts +154 -0
- package/dist/internal/protocol/parts.js +32 -6
- package/dist/internal/protocol/provider.d.ts +308 -1
- package/dist/internal/protocol/provider.js +102 -3
- package/dist/internal/protocol/records.d.ts +773 -0
- package/dist/internal/protocol/records.js +46 -0
- package/dist/internal/protocol/tools.d.ts +40 -0
- package/dist/internal/protocol/tools.js +12 -0
- package/dist/internal/protocol/transcript.d.ts +19 -0
- package/dist/internal/protocol/transcript.js +53 -0
- package/dist/internal/provider/contract.d.ts +25 -2
- package/dist/internal/provider/event-queue.d.ts +17 -0
- package/dist/internal/provider/event-queue.js +78 -0
- package/dist/internal/provider/grok-voice.d.ts +12 -9
- package/dist/internal/provider/grok-voice.js +26 -15
- package/dist/internal/provider/index.d.ts +1 -0
- package/dist/internal/provider/index.js +1 -0
- package/dist/internal/provider/live-session.d.ts +29 -0
- package/dist/internal/provider/live-session.js +840 -0
- package/dist/internal/provider/node-socket.js +6 -0
- package/dist/internal/provider/openai-live.d.ts +62 -0
- package/dist/internal/provider/openai-live.js +160 -0
- package/dist/internal/provider/openai-realtime.d.ts +9 -5
- package/dist/internal/provider/openai-realtime.js +24 -10
- package/dist/internal/provider/realtime-session.d.ts +12 -1
- package/dist/internal/provider/realtime-session.js +373 -70
- package/dist/internal/provider/realtime-socket.d.ts +3 -1
- package/dist/internal/provider/tool-status-context.d.ts +10 -0
- package/dist/internal/provider/tool-status-context.js +30 -0
- package/dist/internal/provider/workers-socket.js +63 -15
- package/dist/internal/provider/workers.d.ts +1 -0
- package/dist/internal/provider/workers.js +1 -0
- package/dist/internal/provider-fake/replay-voice-provider.d.ts +9 -11
- package/dist/internal/provider-fake/replay-voice-provider.js +47 -23
- package/dist/internal/storage/event-store.d.ts +22 -4
- package/dist/internal/storage/jsonl-event-store.d.ts +4 -4
- package/dist/internal/storage/jsonl-event-store.js +21 -16
- package/dist/internal/storage/memory-event-store.d.ts +4 -3
- package/dist/internal/storage/memory-event-store.js +8 -2
- package/dist/internal/storage/memory.d.ts +1 -1
- package/dist/internal/testkit/events.d.ts +14 -0
- package/dist/internal/testkit/events.js +33 -0
- package/dist/internal/testkit/runtime.d.ts +3 -0
- package/dist/internal/testkit/runtime.js +3 -0
- package/dist/internal/testkit/trajectory.d.ts +23 -0
- package/dist/internal/testkit/trajectory.js +58 -0
- package/dist/internal/tools-openai/index.d.ts +2 -0
- package/dist/internal/tools-openai/index.js +79 -72
- package/dist/internal/tools-openai/responses.d.ts +5 -1
- package/dist/internal/tools-openai/responses.js +53 -5
- package/dist/testing.d.ts +1 -0
- package/dist/testing.js +1 -0
- package/package.json +7 -1
|
@@ -0,0 +1,773 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type HarnessEvent } from "./events.js";
|
|
3
|
+
/** Retention affects stored audio, never live capture or playback. */
|
|
4
|
+
export type AudioRetention = "full" | "metadata";
|
|
5
|
+
/** Same identities and order as live events; audio bytes may be explicitly unavailable. */
|
|
6
|
+
export declare const HarnessRecordSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
sessionId: z.ZodString;
|
|
9
|
+
sequence: z.ZodInt;
|
|
10
|
+
recordedAtMs: z.ZodNumber;
|
|
11
|
+
sessionTimeMs: z.ZodNumber;
|
|
12
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
14
|
+
type: z.ZodLiteral<"session.started">;
|
|
15
|
+
formatVersion: z.ZodOptional<z.ZodInt>;
|
|
16
|
+
providerId: z.ZodString;
|
|
17
|
+
capabilities: z.ZodObject<{
|
|
18
|
+
continuousInputDuringOutput: z.ZodBoolean;
|
|
19
|
+
modelManagedFloor: z.ZodBoolean;
|
|
20
|
+
supportsToolCalls: z.ZodBoolean;
|
|
21
|
+
supportsAsyncContext: z.ZodBoolean;
|
|
22
|
+
supportsToolStatusContext: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
supportsPlayoutAcknowledgements: z.ZodBoolean;
|
|
24
|
+
reportsResponseState: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
inputCadence: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
continuous: "continuous";
|
|
27
|
+
"on-demand": "on-demand";
|
|
28
|
+
}>>;
|
|
29
|
+
outputLifecycle: z.ZodOptional<z.ZodEnum<{
|
|
30
|
+
continuous: "continuous";
|
|
31
|
+
response: "response";
|
|
32
|
+
}>>;
|
|
33
|
+
supportsAssistantTurn: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
supportsTextOutput: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
textInput: z.ZodOptional<z.ZodEnum<{
|
|
36
|
+
backend: "backend";
|
|
37
|
+
conversation: "conversation";
|
|
38
|
+
unsupported: "unsupported";
|
|
39
|
+
}>>;
|
|
40
|
+
maxContextUpdateBytes: z.ZodOptional<z.ZodInt>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
43
|
+
outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
44
|
+
audio: "audio";
|
|
45
|
+
text: "text";
|
|
46
|
+
}>>>;
|
|
47
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
sessionId: z.ZodString;
|
|
50
|
+
sequence: z.ZodInt;
|
|
51
|
+
recordedAtMs: z.ZodNumber;
|
|
52
|
+
sessionTimeMs: z.ZodNumber;
|
|
53
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
54
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
55
|
+
type: z.ZodLiteral<"session.ended">;
|
|
56
|
+
reason: z.ZodString;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
sessionId: z.ZodString;
|
|
60
|
+
sequence: z.ZodInt;
|
|
61
|
+
recordedAtMs: z.ZodNumber;
|
|
62
|
+
sessionTimeMs: z.ZodNumber;
|
|
63
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
64
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
65
|
+
type: z.ZodLiteral<"provider.ready">;
|
|
66
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
67
|
+
id: z.ZodString;
|
|
68
|
+
sessionId: z.ZodString;
|
|
69
|
+
sequence: z.ZodInt;
|
|
70
|
+
recordedAtMs: z.ZodNumber;
|
|
71
|
+
sessionTimeMs: z.ZodNumber;
|
|
72
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
74
|
+
type: z.ZodLiteral<"response.state">;
|
|
75
|
+
state: z.ZodEnum<{
|
|
76
|
+
idle: "idle";
|
|
77
|
+
pending: "pending";
|
|
78
|
+
}>;
|
|
79
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
80
|
+
id: z.ZodString;
|
|
81
|
+
sessionId: z.ZodString;
|
|
82
|
+
sequence: z.ZodInt;
|
|
83
|
+
recordedAtMs: z.ZodNumber;
|
|
84
|
+
sessionTimeMs: z.ZodNumber;
|
|
85
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
86
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
87
|
+
type: z.ZodLiteral<"provider.diagnostic">;
|
|
88
|
+
diagnostic: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
89
|
+
kind: z.ZodLiteral<"session">;
|
|
90
|
+
model: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
92
|
+
kind: z.ZodLiteral<"speech">;
|
|
93
|
+
phase: z.ZodEnum<{
|
|
94
|
+
started: "started";
|
|
95
|
+
stopped: "stopped";
|
|
96
|
+
}>;
|
|
97
|
+
streamId: z.ZodOptional<z.ZodString>;
|
|
98
|
+
audioOffsetMs: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
100
|
+
kind: z.ZodLiteral<"response">;
|
|
101
|
+
phase: z.ZodEnum<{
|
|
102
|
+
completed: "completed";
|
|
103
|
+
started: "started";
|
|
104
|
+
}>;
|
|
105
|
+
responseId: z.ZodOptional<z.ZodString>;
|
|
106
|
+
status: z.ZodOptional<z.ZodString>;
|
|
107
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
108
|
+
code: z.ZodOptional<z.ZodString>;
|
|
109
|
+
outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
110
|
+
streamId: z.ZodOptional<z.ZodString>;
|
|
111
|
+
type: z.ZodString;
|
|
112
|
+
contentTypes: z.ZodArray<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>>>;
|
|
114
|
+
}, z.core.$strip>], "kind">;
|
|
115
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
116
|
+
id: z.ZodString;
|
|
117
|
+
sessionId: z.ZodString;
|
|
118
|
+
sequence: z.ZodInt;
|
|
119
|
+
recordedAtMs: z.ZodNumber;
|
|
120
|
+
sessionTimeMs: z.ZodNumber;
|
|
121
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
122
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
123
|
+
type: z.ZodLiteral<"assistant.turn.requested">;
|
|
124
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
sessionId: z.ZodString;
|
|
127
|
+
sequence: z.ZodInt;
|
|
128
|
+
recordedAtMs: z.ZodNumber;
|
|
129
|
+
sessionTimeMs: z.ZodNumber;
|
|
130
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
131
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
132
|
+
type: z.ZodLiteral<"provider.closed">;
|
|
133
|
+
reason: z.ZodString;
|
|
134
|
+
finalized: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
136
|
+
id: z.ZodString;
|
|
137
|
+
sessionId: z.ZodString;
|
|
138
|
+
sequence: z.ZodInt;
|
|
139
|
+
recordedAtMs: z.ZodNumber;
|
|
140
|
+
sessionTimeMs: z.ZodNumber;
|
|
141
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
142
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
143
|
+
type: z.ZodLiteral<"provider.error">;
|
|
144
|
+
message: z.ZodString;
|
|
145
|
+
recoverable: z.ZodBoolean;
|
|
146
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
147
|
+
id: z.ZodString;
|
|
148
|
+
sessionId: z.ZodString;
|
|
149
|
+
sequence: z.ZodInt;
|
|
150
|
+
recordedAtMs: z.ZodNumber;
|
|
151
|
+
sessionTimeMs: z.ZodNumber;
|
|
152
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
153
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
154
|
+
type: z.ZodLiteral<"message.input">;
|
|
155
|
+
text: z.ZodString;
|
|
156
|
+
parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
157
|
+
type: z.ZodLiteral<"text">;
|
|
158
|
+
text: z.ZodString;
|
|
159
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
160
|
+
type: z.ZodLiteral<"image">;
|
|
161
|
+
mediaType: z.ZodString;
|
|
162
|
+
url: z.ZodString;
|
|
163
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
164
|
+
type: z.ZodLiteral<"file">;
|
|
165
|
+
mediaType: z.ZodString;
|
|
166
|
+
url: z.ZodString;
|
|
167
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
168
|
+
}, z.core.$strip>], "type">>>;
|
|
169
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
sessionId: z.ZodString;
|
|
172
|
+
sequence: z.ZodInt;
|
|
173
|
+
recordedAtMs: z.ZodNumber;
|
|
174
|
+
sessionTimeMs: z.ZodNumber;
|
|
175
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
176
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
177
|
+
type: z.ZodLiteral<"input.delivery">;
|
|
178
|
+
inputId: z.ZodString;
|
|
179
|
+
providerId: z.ZodString;
|
|
180
|
+
target: z.ZodEnum<{
|
|
181
|
+
backend: "backend";
|
|
182
|
+
conversation: "conversation";
|
|
183
|
+
}>;
|
|
184
|
+
phase: z.ZodEnum<{
|
|
185
|
+
failed: "failed";
|
|
186
|
+
submitted: "submitted";
|
|
187
|
+
}>;
|
|
188
|
+
error: z.ZodOptional<z.ZodString>;
|
|
189
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
190
|
+
id: z.ZodString;
|
|
191
|
+
sessionId: z.ZodString;
|
|
192
|
+
sequence: z.ZodInt;
|
|
193
|
+
recordedAtMs: z.ZodNumber;
|
|
194
|
+
sessionTimeMs: z.ZodNumber;
|
|
195
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
196
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
197
|
+
type: z.ZodLiteral<"audio.input">;
|
|
198
|
+
chunk: z.ZodObject<{
|
|
199
|
+
streamId: z.ZodString;
|
|
200
|
+
sequence: z.ZodInt;
|
|
201
|
+
encoding: z.ZodLiteral<"pcm_s16le">;
|
|
202
|
+
sampleRate: z.ZodInt;
|
|
203
|
+
channels: z.ZodInt;
|
|
204
|
+
startSample: z.ZodInt;
|
|
205
|
+
data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
|
|
206
|
+
}, z.core.$strict>;
|
|
207
|
+
syntheticSilence: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
sessionId: z.ZodString;
|
|
211
|
+
sequence: z.ZodInt;
|
|
212
|
+
recordedAtMs: z.ZodNumber;
|
|
213
|
+
sessionTimeMs: z.ZodNumber;
|
|
214
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
215
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
216
|
+
type: z.ZodLiteral<"audio.output">;
|
|
217
|
+
chunk: z.ZodObject<{
|
|
218
|
+
streamId: z.ZodString;
|
|
219
|
+
sequence: z.ZodInt;
|
|
220
|
+
encoding: z.ZodLiteral<"pcm_s16le">;
|
|
221
|
+
sampleRate: z.ZodInt;
|
|
222
|
+
channels: z.ZodInt;
|
|
223
|
+
startSample: z.ZodInt;
|
|
224
|
+
data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
|
|
225
|
+
}, z.core.$strict>;
|
|
226
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
scope: z.ZodEnum<{
|
|
228
|
+
backend: "backend";
|
|
229
|
+
voice: "voice";
|
|
230
|
+
}>;
|
|
231
|
+
responseId: z.ZodOptional<z.ZodString>;
|
|
232
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
233
|
+
outputIndex: z.ZodOptional<z.ZodInt>;
|
|
234
|
+
contentIndex: z.ZodOptional<z.ZodInt>;
|
|
235
|
+
summaryIndex: z.ZodOptional<z.ZodInt>;
|
|
236
|
+
delegationId: z.ZodOptional<z.ZodString>;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
239
|
+
id: z.ZodString;
|
|
240
|
+
sessionId: z.ZodString;
|
|
241
|
+
sequence: z.ZodInt;
|
|
242
|
+
recordedAtMs: z.ZodNumber;
|
|
243
|
+
sessionTimeMs: z.ZodNumber;
|
|
244
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
245
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
246
|
+
type: z.ZodLiteral<"audio.interrupted">;
|
|
247
|
+
streamId: z.ZodString;
|
|
248
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
249
|
+
role: z.ZodEnum<{
|
|
250
|
+
assistant: "assistant";
|
|
251
|
+
user: "user";
|
|
252
|
+
}>;
|
|
253
|
+
text: z.ZodString;
|
|
254
|
+
streamId: z.ZodOptional<z.ZodString>;
|
|
255
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
256
|
+
scope: z.ZodEnum<{
|
|
257
|
+
backend: "backend";
|
|
258
|
+
voice: "voice";
|
|
259
|
+
}>;
|
|
260
|
+
responseId: z.ZodOptional<z.ZodString>;
|
|
261
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
262
|
+
outputIndex: z.ZodOptional<z.ZodInt>;
|
|
263
|
+
contentIndex: z.ZodOptional<z.ZodInt>;
|
|
264
|
+
summaryIndex: z.ZodOptional<z.ZodInt>;
|
|
265
|
+
delegationId: z.ZodOptional<z.ZodString>;
|
|
266
|
+
}, z.core.$strip>>;
|
|
267
|
+
id: z.ZodString;
|
|
268
|
+
sessionId: z.ZodString;
|
|
269
|
+
sequence: z.ZodInt;
|
|
270
|
+
recordedAtMs: z.ZodNumber;
|
|
271
|
+
sessionTimeMs: z.ZodNumber;
|
|
272
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
273
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
274
|
+
type: z.ZodLiteral<"transcript">;
|
|
275
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
276
|
+
role: z.ZodEnum<{
|
|
277
|
+
assistant: "assistant";
|
|
278
|
+
user: "user";
|
|
279
|
+
}>;
|
|
280
|
+
delta: z.ZodString;
|
|
281
|
+
streamId: z.ZodOptional<z.ZodString>;
|
|
282
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
283
|
+
scope: z.ZodEnum<{
|
|
284
|
+
backend: "backend";
|
|
285
|
+
voice: "voice";
|
|
286
|
+
}>;
|
|
287
|
+
responseId: z.ZodOptional<z.ZodString>;
|
|
288
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
289
|
+
outputIndex: z.ZodOptional<z.ZodInt>;
|
|
290
|
+
contentIndex: z.ZodOptional<z.ZodInt>;
|
|
291
|
+
summaryIndex: z.ZodOptional<z.ZodInt>;
|
|
292
|
+
delegationId: z.ZodOptional<z.ZodString>;
|
|
293
|
+
}, z.core.$strip>>;
|
|
294
|
+
id: z.ZodString;
|
|
295
|
+
sessionId: z.ZodString;
|
|
296
|
+
sequence: z.ZodInt;
|
|
297
|
+
recordedAtMs: z.ZodNumber;
|
|
298
|
+
sessionTimeMs: z.ZodNumber;
|
|
299
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
300
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
301
|
+
type: z.ZodLiteral<"transcript.delta">;
|
|
302
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
303
|
+
role: z.ZodEnum<{
|
|
304
|
+
assistant: "assistant";
|
|
305
|
+
user: "user";
|
|
306
|
+
}>;
|
|
307
|
+
text: z.ZodString;
|
|
308
|
+
fragmentId: z.ZodString;
|
|
309
|
+
startMs: z.ZodNumber;
|
|
310
|
+
endMs: z.ZodNumber;
|
|
311
|
+
timebase: z.ZodLiteral<"provider-session">;
|
|
312
|
+
id: z.ZodString;
|
|
313
|
+
sessionId: z.ZodString;
|
|
314
|
+
sequence: z.ZodInt;
|
|
315
|
+
recordedAtMs: z.ZodNumber;
|
|
316
|
+
sessionTimeMs: z.ZodNumber;
|
|
317
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
318
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
319
|
+
type: z.ZodLiteral<"transcript.fragment">;
|
|
320
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
321
|
+
kind: z.ZodEnum<{
|
|
322
|
+
reasoning_summary: "reasoning_summary";
|
|
323
|
+
refusal: "refusal";
|
|
324
|
+
text: "text";
|
|
325
|
+
}>;
|
|
326
|
+
source: z.ZodObject<{
|
|
327
|
+
delegationId: z.ZodOptional<z.ZodString>;
|
|
328
|
+
scope: z.ZodLiteral<"backend">;
|
|
329
|
+
responseId: z.ZodString;
|
|
330
|
+
itemId: z.ZodString;
|
|
331
|
+
outputIndex: z.ZodInt;
|
|
332
|
+
contentIndex: z.ZodOptional<z.ZodInt>;
|
|
333
|
+
summaryIndex: z.ZodOptional<z.ZodInt>;
|
|
334
|
+
}, z.core.$strip>;
|
|
335
|
+
delta: z.ZodString;
|
|
336
|
+
id: z.ZodString;
|
|
337
|
+
sessionId: z.ZodString;
|
|
338
|
+
sequence: z.ZodInt;
|
|
339
|
+
recordedAtMs: z.ZodNumber;
|
|
340
|
+
sessionTimeMs: z.ZodNumber;
|
|
341
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
342
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
343
|
+
type: z.ZodLiteral<"backend.output.delta">;
|
|
344
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
345
|
+
source: z.ZodObject<{
|
|
346
|
+
delegationId: z.ZodOptional<z.ZodString>;
|
|
347
|
+
scope: z.ZodLiteral<"backend">;
|
|
348
|
+
responseId: z.ZodString;
|
|
349
|
+
itemId: z.ZodString;
|
|
350
|
+
outputIndex: z.ZodInt;
|
|
351
|
+
}, z.core.$strip>;
|
|
352
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
353
|
+
kind: z.ZodEnum<{
|
|
354
|
+
refusal: "refusal";
|
|
355
|
+
text: "text";
|
|
356
|
+
}>;
|
|
357
|
+
text: z.ZodString;
|
|
358
|
+
contentIndex: z.ZodInt;
|
|
359
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
360
|
+
kind: z.ZodLiteral<"reasoning_summary">;
|
|
361
|
+
text: z.ZodString;
|
|
362
|
+
summaryIndex: z.ZodInt;
|
|
363
|
+
}, z.core.$strip>], "kind">>;
|
|
364
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
365
|
+
cancelled: "cancelled";
|
|
366
|
+
completed: "completed";
|
|
367
|
+
failed: "failed";
|
|
368
|
+
in_progress: "in_progress";
|
|
369
|
+
incomplete: "incomplete";
|
|
370
|
+
}>>;
|
|
371
|
+
id: z.ZodString;
|
|
372
|
+
sessionId: z.ZodString;
|
|
373
|
+
sequence: z.ZodInt;
|
|
374
|
+
recordedAtMs: z.ZodNumber;
|
|
375
|
+
sessionTimeMs: z.ZodNumber;
|
|
376
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
377
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
378
|
+
type: z.ZodLiteral<"backend.output">;
|
|
379
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
380
|
+
delegationId: z.ZodOptional<z.ZodString>;
|
|
381
|
+
responseId: z.ZodString;
|
|
382
|
+
phase: z.ZodEnum<{
|
|
383
|
+
completed: "completed";
|
|
384
|
+
started: "started";
|
|
385
|
+
"waiting-for-tools": "waiting-for-tools";
|
|
386
|
+
}>;
|
|
387
|
+
status: z.ZodOptional<z.ZodString>;
|
|
388
|
+
id: z.ZodString;
|
|
389
|
+
sessionId: z.ZodString;
|
|
390
|
+
sequence: z.ZodInt;
|
|
391
|
+
recordedAtMs: z.ZodNumber;
|
|
392
|
+
sessionTimeMs: z.ZodNumber;
|
|
393
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
394
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
395
|
+
type: z.ZodLiteral<"backend.response">;
|
|
396
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
397
|
+
delegationId: z.ZodOptional<z.ZodString>;
|
|
398
|
+
responseId: z.ZodString;
|
|
399
|
+
toolId: z.ZodString;
|
|
400
|
+
outputIndex: z.ZodOptional<z.ZodInt>;
|
|
401
|
+
name: z.ZodString;
|
|
402
|
+
phase: z.ZodEnum<{
|
|
403
|
+
completed: "completed";
|
|
404
|
+
failed: "failed";
|
|
405
|
+
started: "started";
|
|
406
|
+
}>;
|
|
407
|
+
id: z.ZodString;
|
|
408
|
+
sessionId: z.ZodString;
|
|
409
|
+
sequence: z.ZodInt;
|
|
410
|
+
recordedAtMs: z.ZodNumber;
|
|
411
|
+
sessionTimeMs: z.ZodNumber;
|
|
412
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
413
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
414
|
+
type: z.ZodLiteral<"backend.tool">;
|
|
415
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
416
|
+
delegationId: z.ZodString;
|
|
417
|
+
target: z.ZodEnum<{
|
|
418
|
+
client: "client";
|
|
419
|
+
responses: "responses";
|
|
420
|
+
}>;
|
|
421
|
+
offsetMs: z.ZodNumber;
|
|
422
|
+
responseId: z.ZodOptional<z.ZodString>;
|
|
423
|
+
id: z.ZodString;
|
|
424
|
+
sessionId: z.ZodString;
|
|
425
|
+
sequence: z.ZodInt;
|
|
426
|
+
recordedAtMs: z.ZodNumber;
|
|
427
|
+
sessionTimeMs: z.ZodNumber;
|
|
428
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
429
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
430
|
+
type: z.ZodLiteral<"delegation.created">;
|
|
431
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
432
|
+
contextId: z.ZodString;
|
|
433
|
+
callId: z.ZodOptional<z.ZodString>;
|
|
434
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
435
|
+
phase: z.ZodEnum<{
|
|
436
|
+
acknowledged: "acknowledged";
|
|
437
|
+
failed: "failed";
|
|
438
|
+
submitted: "submitted";
|
|
439
|
+
}>;
|
|
440
|
+
kind: z.ZodEnum<{
|
|
441
|
+
commentary: "commentary";
|
|
442
|
+
instructions: "instructions";
|
|
443
|
+
thinking: "thinking";
|
|
444
|
+
}>;
|
|
445
|
+
startMs: z.ZodOptional<z.ZodNumber>;
|
|
446
|
+
endMs: z.ZodOptional<z.ZodNumber>;
|
|
447
|
+
message: z.ZodOptional<z.ZodString>;
|
|
448
|
+
id: z.ZodString;
|
|
449
|
+
sessionId: z.ZodString;
|
|
450
|
+
sequence: z.ZodInt;
|
|
451
|
+
recordedAtMs: z.ZodNumber;
|
|
452
|
+
sessionTimeMs: z.ZodNumber;
|
|
453
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
454
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
455
|
+
type: z.ZodLiteral<"context.delivery">;
|
|
456
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
457
|
+
seconds: z.ZodNumber;
|
|
458
|
+
final: z.ZodBoolean;
|
|
459
|
+
contextWindowUsageRatio: z.ZodOptional<z.ZodNumber>;
|
|
460
|
+
id: z.ZodString;
|
|
461
|
+
sessionId: z.ZodString;
|
|
462
|
+
sequence: z.ZodInt;
|
|
463
|
+
recordedAtMs: z.ZodNumber;
|
|
464
|
+
sessionTimeMs: z.ZodNumber;
|
|
465
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
466
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
467
|
+
type: z.ZodLiteral<"usage.duration">;
|
|
468
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
469
|
+
streamId: z.ZodString;
|
|
470
|
+
startSample: z.ZodInt;
|
|
471
|
+
endSample: z.ZodInt;
|
|
472
|
+
status: z.ZodEnum<{
|
|
473
|
+
discarded: "discarded";
|
|
474
|
+
played: "played";
|
|
475
|
+
}>;
|
|
476
|
+
id: z.ZodString;
|
|
477
|
+
sessionId: z.ZodString;
|
|
478
|
+
sequence: z.ZodInt;
|
|
479
|
+
recordedAtMs: z.ZodNumber;
|
|
480
|
+
sessionTimeMs: z.ZodNumber;
|
|
481
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
482
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
483
|
+
type: z.ZodLiteral<"playout.range">;
|
|
484
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
485
|
+
responseId: z.ZodOptional<z.ZodString>;
|
|
486
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
487
|
+
backend: "backend";
|
|
488
|
+
voice: "voice";
|
|
489
|
+
}>>;
|
|
490
|
+
inputTokens: z.ZodNumber;
|
|
491
|
+
outputTokens: z.ZodNumber;
|
|
492
|
+
totalTokens: z.ZodNumber;
|
|
493
|
+
cachedInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
494
|
+
audioInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
495
|
+
audioOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
496
|
+
cachedAudioInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
497
|
+
id: z.ZodString;
|
|
498
|
+
sessionId: z.ZodString;
|
|
499
|
+
sequence: z.ZodInt;
|
|
500
|
+
recordedAtMs: z.ZodNumber;
|
|
501
|
+
sessionTimeMs: z.ZodNumber;
|
|
502
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
503
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
504
|
+
type: z.ZodLiteral<"usage">;
|
|
505
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
506
|
+
id: z.ZodString;
|
|
507
|
+
sessionId: z.ZodString;
|
|
508
|
+
sequence: z.ZodInt;
|
|
509
|
+
recordedAtMs: z.ZodNumber;
|
|
510
|
+
sessionTimeMs: z.ZodNumber;
|
|
511
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
512
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
513
|
+
type: z.ZodLiteral<"playout.progress">;
|
|
514
|
+
streamId: z.ZodString;
|
|
515
|
+
playedThroughSample: z.ZodInt;
|
|
516
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
517
|
+
id: z.ZodString;
|
|
518
|
+
sessionId: z.ZodString;
|
|
519
|
+
sequence: z.ZodInt;
|
|
520
|
+
recordedAtMs: z.ZodNumber;
|
|
521
|
+
sessionTimeMs: z.ZodNumber;
|
|
522
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
523
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
524
|
+
type: z.ZodLiteral<"tool.requested">;
|
|
525
|
+
call: z.ZodObject<{
|
|
526
|
+
callId: z.ZodString;
|
|
527
|
+
name: z.ZodString;
|
|
528
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
529
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
530
|
+
scope: z.ZodEnum<{
|
|
531
|
+
backend: "backend";
|
|
532
|
+
voice: "voice";
|
|
533
|
+
}>;
|
|
534
|
+
responseId: z.ZodOptional<z.ZodString>;
|
|
535
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
536
|
+
outputIndex: z.ZodOptional<z.ZodInt>;
|
|
537
|
+
contentIndex: z.ZodOptional<z.ZodInt>;
|
|
538
|
+
summaryIndex: z.ZodOptional<z.ZodInt>;
|
|
539
|
+
delegationId: z.ZodOptional<z.ZodString>;
|
|
540
|
+
}, z.core.$strip>>;
|
|
541
|
+
}, z.core.$strip>;
|
|
542
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
543
|
+
id: z.ZodString;
|
|
544
|
+
sessionId: z.ZodString;
|
|
545
|
+
sequence: z.ZodInt;
|
|
546
|
+
recordedAtMs: z.ZodNumber;
|
|
547
|
+
sessionTimeMs: z.ZodNumber;
|
|
548
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
549
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
550
|
+
type: z.ZodLiteral<"tool.denied">;
|
|
551
|
+
callId: z.ZodString;
|
|
552
|
+
name: z.ZodString;
|
|
553
|
+
reason: z.ZodString;
|
|
554
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
555
|
+
id: z.ZodString;
|
|
556
|
+
sessionId: z.ZodString;
|
|
557
|
+
sequence: z.ZodInt;
|
|
558
|
+
recordedAtMs: z.ZodNumber;
|
|
559
|
+
sessionTimeMs: z.ZodNumber;
|
|
560
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
561
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
562
|
+
type: z.ZodLiteral<"tool.started">;
|
|
563
|
+
callId: z.ZodString;
|
|
564
|
+
name: z.ZodString;
|
|
565
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
566
|
+
id: z.ZodString;
|
|
567
|
+
sessionId: z.ZodString;
|
|
568
|
+
sequence: z.ZodInt;
|
|
569
|
+
recordedAtMs: z.ZodNumber;
|
|
570
|
+
sessionTimeMs: z.ZodNumber;
|
|
571
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
572
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
573
|
+
type: z.ZodLiteral<"tool.progress">;
|
|
574
|
+
callId: z.ZodString;
|
|
575
|
+
update: z.ZodJSONSchema;
|
|
576
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
577
|
+
id: z.ZodString;
|
|
578
|
+
sessionId: z.ZodString;
|
|
579
|
+
sequence: z.ZodInt;
|
|
580
|
+
recordedAtMs: z.ZodNumber;
|
|
581
|
+
sessionTimeMs: z.ZodNumber;
|
|
582
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
583
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
584
|
+
type: z.ZodLiteral<"tool.completed">;
|
|
585
|
+
callId: z.ZodString;
|
|
586
|
+
outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
587
|
+
type: z.ZodLiteral<"completed">;
|
|
588
|
+
value: z.ZodJSONSchema;
|
|
589
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
590
|
+
type: z.ZodLiteral<"accepted_task">;
|
|
591
|
+
taskId: z.ZodString;
|
|
592
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
593
|
+
type: z.ZodLiteral<"failed">;
|
|
594
|
+
error: z.ZodString;
|
|
595
|
+
}, z.core.$strip>], "type">;
|
|
596
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
597
|
+
id: z.ZodString;
|
|
598
|
+
sessionId: z.ZodString;
|
|
599
|
+
sequence: z.ZodInt;
|
|
600
|
+
recordedAtMs: z.ZodNumber;
|
|
601
|
+
sessionTimeMs: z.ZodNumber;
|
|
602
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
603
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
604
|
+
type: z.ZodLiteral<"tool.failed">;
|
|
605
|
+
callId: z.ZodString;
|
|
606
|
+
error: z.ZodString;
|
|
607
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
608
|
+
id: z.ZodString;
|
|
609
|
+
sessionId: z.ZodString;
|
|
610
|
+
sequence: z.ZodInt;
|
|
611
|
+
recordedAtMs: z.ZodNumber;
|
|
612
|
+
sessionTimeMs: z.ZodNumber;
|
|
613
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
614
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
615
|
+
type: z.ZodLiteral<"tool.delivery_failed">;
|
|
616
|
+
callId: z.ZodString;
|
|
617
|
+
error: z.ZodString;
|
|
618
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
619
|
+
id: z.ZodString;
|
|
620
|
+
sessionId: z.ZodString;
|
|
621
|
+
sequence: z.ZodInt;
|
|
622
|
+
recordedAtMs: z.ZodNumber;
|
|
623
|
+
sessionTimeMs: z.ZodNumber;
|
|
624
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
625
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
626
|
+
type: z.ZodLiteral<"task.accepted">;
|
|
627
|
+
taskId: z.ZodString;
|
|
628
|
+
callId: z.ZodString;
|
|
629
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
630
|
+
id: z.ZodString;
|
|
631
|
+
sessionId: z.ZodString;
|
|
632
|
+
sequence: z.ZodInt;
|
|
633
|
+
recordedAtMs: z.ZodNumber;
|
|
634
|
+
sessionTimeMs: z.ZodNumber;
|
|
635
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
636
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
637
|
+
type: z.ZodLiteral<"task.cancellation_requested">;
|
|
638
|
+
taskId: z.ZodString;
|
|
639
|
+
callId: z.ZodString;
|
|
640
|
+
reason: z.ZodString;
|
|
641
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
642
|
+
id: z.ZodString;
|
|
643
|
+
sessionId: z.ZodString;
|
|
644
|
+
sequence: z.ZodInt;
|
|
645
|
+
recordedAtMs: z.ZodNumber;
|
|
646
|
+
sessionTimeMs: z.ZodNumber;
|
|
647
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
648
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
649
|
+
type: z.ZodLiteral<"task.progress">;
|
|
650
|
+
taskId: z.ZodString;
|
|
651
|
+
callId: z.ZodString;
|
|
652
|
+
update: z.ZodJSONSchema;
|
|
653
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
654
|
+
id: z.ZodString;
|
|
655
|
+
sessionId: z.ZodString;
|
|
656
|
+
sequence: z.ZodInt;
|
|
657
|
+
recordedAtMs: z.ZodNumber;
|
|
658
|
+
sessionTimeMs: z.ZodNumber;
|
|
659
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
660
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
661
|
+
type: z.ZodLiteral<"task.completed">;
|
|
662
|
+
taskId: z.ZodString;
|
|
663
|
+
callId: z.ZodString;
|
|
664
|
+
result: z.ZodJSONSchema;
|
|
665
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
666
|
+
id: z.ZodString;
|
|
667
|
+
sessionId: z.ZodString;
|
|
668
|
+
sequence: z.ZodInt;
|
|
669
|
+
recordedAtMs: z.ZodNumber;
|
|
670
|
+
sessionTimeMs: z.ZodNumber;
|
|
671
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
672
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
673
|
+
type: z.ZodLiteral<"task.failed">;
|
|
674
|
+
taskId: z.ZodString;
|
|
675
|
+
callId: z.ZodString;
|
|
676
|
+
error: z.ZodString;
|
|
677
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
678
|
+
id: z.ZodString;
|
|
679
|
+
sessionId: z.ZodString;
|
|
680
|
+
sequence: z.ZodInt;
|
|
681
|
+
recordedAtMs: z.ZodNumber;
|
|
682
|
+
sessionTimeMs: z.ZodNumber;
|
|
683
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
684
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
685
|
+
type: z.ZodLiteral<"task.cancelled">;
|
|
686
|
+
taskId: z.ZodString;
|
|
687
|
+
callId: z.ZodString;
|
|
688
|
+
reason: z.ZodString;
|
|
689
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
690
|
+
id: z.ZodString;
|
|
691
|
+
sessionId: z.ZodString;
|
|
692
|
+
sequence: z.ZodInt;
|
|
693
|
+
recordedAtMs: z.ZodNumber;
|
|
694
|
+
sessionTimeMs: z.ZodNumber;
|
|
695
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
696
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
697
|
+
type: z.ZodLiteral<"task.delivery_failed">;
|
|
698
|
+
taskId: z.ZodString;
|
|
699
|
+
callId: z.ZodString;
|
|
700
|
+
phase: z.ZodEnum<{
|
|
701
|
+
progress: "progress";
|
|
702
|
+
terminal: "terminal";
|
|
703
|
+
}>;
|
|
704
|
+
error: z.ZodString;
|
|
705
|
+
}, z.core.$strip>], "type">, z.ZodObject<{
|
|
706
|
+
id: z.ZodString;
|
|
707
|
+
sessionId: z.ZodString;
|
|
708
|
+
sequence: z.ZodInt;
|
|
709
|
+
recordedAtMs: z.ZodNumber;
|
|
710
|
+
sessionTimeMs: z.ZodNumber;
|
|
711
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
712
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
713
|
+
type: z.ZodLiteral<"audio.input">;
|
|
714
|
+
syntheticSilence: z.ZodOptional<z.ZodBoolean>;
|
|
715
|
+
chunk: z.ZodObject<{
|
|
716
|
+
streamId: z.ZodString;
|
|
717
|
+
sequence: z.ZodInt;
|
|
718
|
+
encoding: z.ZodLiteral<"pcm_s16le">;
|
|
719
|
+
sampleRate: z.ZodInt;
|
|
720
|
+
channels: z.ZodInt;
|
|
721
|
+
startSample: z.ZodInt;
|
|
722
|
+
sampleCount: z.ZodInt;
|
|
723
|
+
availability: z.ZodLiteral<"omitted">;
|
|
724
|
+
data: z.ZodOptional<z.ZodNever>;
|
|
725
|
+
}, z.core.$strict>;
|
|
726
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
727
|
+
id: z.ZodString;
|
|
728
|
+
sessionId: z.ZodString;
|
|
729
|
+
sequence: z.ZodInt;
|
|
730
|
+
recordedAtMs: z.ZodNumber;
|
|
731
|
+
sessionTimeMs: z.ZodNumber;
|
|
732
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
733
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
734
|
+
type: z.ZodLiteral<"audio.output">;
|
|
735
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
736
|
+
scope: z.ZodEnum<{
|
|
737
|
+
backend: "backend";
|
|
738
|
+
voice: "voice";
|
|
739
|
+
}>;
|
|
740
|
+
responseId: z.ZodOptional<z.ZodString>;
|
|
741
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
742
|
+
outputIndex: z.ZodOptional<z.ZodInt>;
|
|
743
|
+
contentIndex: z.ZodOptional<z.ZodInt>;
|
|
744
|
+
summaryIndex: z.ZodOptional<z.ZodInt>;
|
|
745
|
+
delegationId: z.ZodOptional<z.ZodString>;
|
|
746
|
+
}, z.core.$strip>>;
|
|
747
|
+
chunk: z.ZodObject<{
|
|
748
|
+
streamId: z.ZodString;
|
|
749
|
+
sequence: z.ZodInt;
|
|
750
|
+
encoding: z.ZodLiteral<"pcm_s16le">;
|
|
751
|
+
sampleRate: z.ZodInt;
|
|
752
|
+
channels: z.ZodInt;
|
|
753
|
+
startSample: z.ZodInt;
|
|
754
|
+
sampleCount: z.ZodInt;
|
|
755
|
+
availability: z.ZodLiteral<"omitted">;
|
|
756
|
+
data: z.ZodOptional<z.ZodNever>;
|
|
757
|
+
}, z.core.$strict>;
|
|
758
|
+
}, z.core.$strip>]>;
|
|
759
|
+
export type HarnessRecord = z.infer<typeof HarnessRecordSchema>;
|
|
760
|
+
/** Does not mutate the source. Non-audio records are shared; callers own snapshot isolation. */
|
|
761
|
+
export declare function toHarnessRecord(event: HarnessRecord, retention: AudioRetention): HarnessRecord;
|
|
762
|
+
export declare class AudioUnavailableError extends Error {
|
|
763
|
+
readonly sessionId: string;
|
|
764
|
+
readonly sequence: number;
|
|
765
|
+
readonly code = "audio_unavailable";
|
|
766
|
+
constructor(sessionId: string, sequence: number);
|
|
767
|
+
}
|
|
768
|
+
/** Explicit boundary for operations that require the original PCM, such as provider replay. */
|
|
769
|
+
export declare function requireRecordedAudio(record: HarnessRecord): HarnessEvent;
|
|
770
|
+
export declare function requireRecordedAudioHistory(records: readonly HarnessRecord[]): HarnessEvent[];
|
|
771
|
+
export declare function stringifyHarnessRecord(record: HarnessRecord): string;
|
|
772
|
+
/** Reads both legacy full-audio JSONL and records with explicitly omitted audio. */
|
|
773
|
+
export declare function parseHarnessRecord(serialized: string): HarnessRecord;
|