@pinecall/protocol 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1234 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The gateway applied an agent.configure. Live calls keep their session; the next call starts with
4
+ * the new config.
5
+ */
6
+ export declare const AgentConfiguredSchema: z.ZodObject<{
7
+ changed: z.ZodArray<z.ZodString>;
8
+ }, z.core.$strict>;
9
+ export type AgentConfigured = z.infer<typeof AgentConfiguredSchema>;
10
+ /** One socket stopped holding the agent. */
11
+ export declare const AgentDetachedSchema: z.ZodObject<{
12
+ app: z.ZodString;
13
+ env: z.ZodEnum<{
14
+ production: "production";
15
+ sandbox: "sandbox";
16
+ }>;
17
+ left: z.ZodBoolean;
18
+ }, z.core.$strict>;
19
+ export type AgentDetached = z.infer<typeof AgentDetachedSchema>;
20
+ /**
21
+ * The gateway accepted an agent.register: this socket now speaks for the agent and answers its
22
+ * routes. Many sockets may hold one agent at once — a new call takes the newest of them, unless
23
+ * the caller names one by its `app` id.
24
+ */
25
+ export declare const AgentRegisteredSchema: z.ZodObject<{
26
+ routes: z.ZodArray<z.ZodObject<{
27
+ channel: z.ZodEnum<{
28
+ phone: "phone";
29
+ web: "web";
30
+ whatsapp: "whatsapp";
31
+ }>;
32
+ number: z.ZodNullable<z.ZodString>;
33
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
+ }, z.core.$strict>>;
35
+ app: z.ZodString;
36
+ sdk: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
+ env: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
38
+ production: "production";
39
+ sandbox: "sandbox";
40
+ }>>>;
41
+ }, z.core.$strict>;
42
+ export type AgentRegistered = z.infer<typeof AgentRegisteredSchema>;
43
+ /** The agent's state changed, in the session's own words. */
44
+ export declare const AgentStateChangedSchema: z.ZodObject<{
45
+ state: z.ZodEnum<{
46
+ listening: "listening";
47
+ speaking: "speaking";
48
+ initializing: "initializing";
49
+ idle: "idle";
50
+ thinking: "thinking";
51
+ }>;
52
+ }, z.core.$strict>;
53
+ export type AgentStateChanged = z.infer<typeof AgentStateChangedSchema>;
54
+ /**
55
+ * Words from the agent as they are played, synced to the audio. Interim while final is false; the
56
+ * whole reply becomes turn.agent. Interim entries are ephemeral.
57
+ */
58
+ export declare const AgentTranscriptSchema: z.ZodObject<{
59
+ speech_id: z.ZodString;
60
+ text: z.ZodString;
61
+ final: z.ZodBoolean;
62
+ start: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
63
+ end: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
64
+ }, z.core.$strict>;
65
+ export type AgentTranscript = z.infer<typeof AgentTranscriptSchema>;
66
+ /**
67
+ * The platform is placing an outbound call and the far end has not answered yet. The first entry
68
+ * of an outbound call's log.
69
+ */
70
+ export declare const CallDialingSchema: z.ZodObject<{
71
+ channel: z.ZodEnum<{
72
+ phone: "phone";
73
+ web: "web";
74
+ whatsapp: "whatsapp";
75
+ }>;
76
+ from: z.ZodString;
77
+ to: z.ZodString;
78
+ run: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
79
+ caller: z.ZodNullable<z.ZodObject<{
80
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
83
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
+ external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
+ }, z.core.$strict>>;
86
+ external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
+ }, z.core.$strict>;
88
+ export type CallDialing = z.infer<typeof CallDialingSchema>;
89
+ /** The call is over. Nothing about the conversation follows; call.summary still does. */
90
+ export declare const CallEndedSchema: z.ZodObject<{
91
+ reason: z.ZodEnum<{
92
+ caller_hung_up: "caller_hung_up";
93
+ agent_hung_up: "agent_hung_up";
94
+ supervisor_ended: "supervisor_ended";
95
+ transferred: "transferred";
96
+ no_answer: "no_answer";
97
+ busy: "busy";
98
+ dial_failed: "dial_failed";
99
+ timeout: "timeout";
100
+ drained: "drained";
101
+ app_detached: "app_detached";
102
+ error: "error";
103
+ }>;
104
+ ended_by: z.ZodEnum<{
105
+ agent: "agent";
106
+ caller: "caller";
107
+ supervisor: "supervisor";
108
+ platform: "platform";
109
+ }>;
110
+ ended_at: z.ZodNumber;
111
+ duration_s: z.ZodNumber;
112
+ }, z.core.$strict>;
113
+ export type CallEnded = z.infer<typeof CallEndedSchema>;
114
+ /**
115
+ * The line's hold and mute flags after one of them changed. Both are stated so a reader never has
116
+ * to remember the other.
117
+ */
118
+ export declare const CallLineSchema: z.ZodObject<{
119
+ held: z.ZodBoolean;
120
+ muted: z.ZodBoolean;
121
+ }, z.core.$strict>;
122
+ export type CallLine = z.infer<typeof CallLineSchema>;
123
+ /**
124
+ * An inbound call is offered to this agent and has not been answered yet. The first entry of an
125
+ * inbound call's log.
126
+ */
127
+ export declare const CallRingingSchema: z.ZodObject<{
128
+ channel: z.ZodEnum<{
129
+ phone: "phone";
130
+ web: "web";
131
+ whatsapp: "whatsapp";
132
+ }>;
133
+ from: z.ZodString;
134
+ to: z.ZodString;
135
+ route: z.ZodObject<{
136
+ channel: z.ZodEnum<{
137
+ phone: "phone";
138
+ web: "web";
139
+ whatsapp: "whatsapp";
140
+ }>;
141
+ number: z.ZodNullable<z.ZodString>;
142
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
+ }, z.core.$strict>;
144
+ run: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
145
+ caller: z.ZodNullable<z.ZodObject<{
146
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
147
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
148
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
149
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
150
+ external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
151
+ }, z.core.$strict>>;
152
+ external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
153
+ }, z.core.$strict>;
154
+ export type CallRinging = z.infer<typeof CallRingingSchema>;
155
+ /**
156
+ * Where in the call's own log a judgment is about. A reader who disagrees with a verdict opens the
157
+ * log at those lines.
158
+ */
159
+ export declare const JudgmentEvidenceSchema: z.ZodObject<{
160
+ seqs: z.ZodArray<z.ZodInt>;
161
+ said: z.ZodOptional<z.ZodNullable<z.ZodString>>;
162
+ }, z.core.$strict>;
163
+ export type JudgmentEvidence = z.infer<typeof JudgmentEvidenceSchema>;
164
+ /**
165
+ * One judge's answer about one call: the question it was asked, the word it answered and the
166
+ * sentence that says why.
167
+ */
168
+ export declare const JudgmentSchema: z.ZodObject<{
169
+ name: z.ZodString;
170
+ verdict: z.ZodEnum<{
171
+ held: "held";
172
+ broken: "broken";
173
+ deferred: "deferred";
174
+ skipped: "skipped";
175
+ }>;
176
+ criteria: z.ZodString;
177
+ reason: z.ZodString;
178
+ evidence: z.ZodObject<{
179
+ seqs: z.ZodArray<z.ZodInt>;
180
+ said: z.ZodOptional<z.ZodNullable<z.ZodString>>;
181
+ }, z.core.$strict>;
182
+ }, z.core.$strict>;
183
+ export type Judgment = z.infer<typeof JudgmentSchema>;
184
+ /**
185
+ * The last entry of a call: what the judges said about it at hang-up, one row per judge. Written
186
+ * after call.summary, and the entry the log seals on.
187
+ */
188
+ export declare const CallScoreSchema: z.ZodObject<{
189
+ passed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
190
+ not_judged: z.ZodOptional<z.ZodNullable<z.ZodString>>;
191
+ judges: z.ZodArray<z.ZodObject<{
192
+ name: z.ZodString;
193
+ verdict: z.ZodEnum<{
194
+ held: "held";
195
+ broken: "broken";
196
+ deferred: "deferred";
197
+ skipped: "skipped";
198
+ }>;
199
+ criteria: z.ZodString;
200
+ reason: z.ZodString;
201
+ evidence: z.ZodObject<{
202
+ seqs: z.ZodArray<z.ZodInt>;
203
+ said: z.ZodOptional<z.ZodNullable<z.ZodString>>;
204
+ }, z.core.$strict>;
205
+ }, z.core.$strict>>;
206
+ panel: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
207
+ judge_calls: z.ZodInt;
208
+ judge_cost_eur: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
209
+ }, z.core.$strict>;
210
+ export type CallScore = z.infer<typeof CallScoreSchema>;
211
+ /**
212
+ * Media is up: the caller and the agent can hear each other, or the text session is open.
213
+ * Everything the agent says and hears comes after this.
214
+ */
215
+ export declare const CallStartedSchema: z.ZodObject<{
216
+ channel: z.ZodEnum<{
217
+ phone: "phone";
218
+ web: "web";
219
+ whatsapp: "whatsapp";
220
+ }>;
221
+ direction: z.ZodEnum<{
222
+ inbound: "inbound";
223
+ outbound: "outbound";
224
+ }>;
225
+ from: z.ZodString;
226
+ to: z.ZodString;
227
+ run: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
228
+ caller: z.ZodNullable<z.ZodObject<{
229
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
230
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
231
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
232
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
233
+ external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
234
+ }, z.core.$strict>>;
235
+ started_at: z.ZodNumber;
236
+ env: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
237
+ production: "production";
238
+ sandbox: "sandbox";
239
+ }>>>;
240
+ }, z.core.$strict>;
241
+ export type CallStarted = z.infer<typeof CallStartedSchema>;
242
+ /**
243
+ * What the call was about, how it went, what it consumed and what that cost. Written after
244
+ * call.ended, once memory and pricing are done; call.score follows it and seals the log.
245
+ */
246
+ export declare const CallSummarySchema: z.ZodObject<{
247
+ reason: z.ZodEnum<{
248
+ caller_hung_up: "caller_hung_up";
249
+ agent_hung_up: "agent_hung_up";
250
+ supervisor_ended: "supervisor_ended";
251
+ transferred: "transferred";
252
+ no_answer: "no_answer";
253
+ busy: "busy";
254
+ dial_failed: "dial_failed";
255
+ timeout: "timeout";
256
+ drained: "drained";
257
+ app_detached: "app_detached";
258
+ error: "error";
259
+ }>;
260
+ outcome: z.ZodString;
261
+ duration_s: z.ZodNumber;
262
+ turns: z.ZodInt;
263
+ usage: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
264
+ type: z.ZodLiteral<"llm_usage">;
265
+ provider: z.ZodString;
266
+ model: z.ZodString;
267
+ input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
268
+ input_cached_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
269
+ input_cache_creation_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
270
+ input_audio_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
271
+ input_cached_audio_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
272
+ input_text_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
273
+ input_cached_text_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
274
+ input_image_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
275
+ input_cached_image_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
276
+ output_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
277
+ output_audio_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
278
+ output_text_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
279
+ output_reasoning_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
280
+ session_duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
281
+ }, z.core.$strict>, z.ZodObject<{
282
+ type: z.ZodLiteral<"tts_usage">;
283
+ provider: z.ZodString;
284
+ model: z.ZodString;
285
+ input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
286
+ output_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
287
+ characters_count: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
288
+ audio_duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
289
+ }, z.core.$strict>, z.ZodObject<{
290
+ type: z.ZodLiteral<"stt_usage">;
291
+ provider: z.ZodString;
292
+ model: z.ZodString;
293
+ input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
294
+ output_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
295
+ audio_duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
296
+ }, z.core.$strict>, z.ZodObject<{
297
+ type: z.ZodLiteral<"interruption_usage">;
298
+ provider: z.ZodString;
299
+ model: z.ZodString;
300
+ total_requests: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
301
+ }, z.core.$strict>, z.ZodObject<{
302
+ type: z.ZodLiteral<"eot_usage">;
303
+ provider: z.ZodString;
304
+ model: z.ZodString;
305
+ total_requests: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
306
+ }, z.core.$strict>], "type">>;
307
+ cost: z.ZodObject<{
308
+ eur: z.ZodNumber;
309
+ rate: z.ZodObject<{
310
+ currency: z.ZodLiteral<"EUR">;
311
+ usd_to_eur: z.ZodNumber;
312
+ as_of: z.ZodString;
313
+ }, z.core.$strict>;
314
+ rows: z.ZodArray<z.ZodObject<{
315
+ provider: z.ZodString;
316
+ model: z.ZodString;
317
+ unit: z.ZodEnum<{
318
+ input_tokens: "input_tokens";
319
+ cached_input_tokens: "cached_input_tokens";
320
+ cache_creation_tokens: "cache_creation_tokens";
321
+ output_tokens: "output_tokens";
322
+ characters: "characters";
323
+ audio_seconds: "audio_seconds";
324
+ requests: "requests";
325
+ session_seconds: "session_seconds";
326
+ }>;
327
+ quantity: z.ZodNumber;
328
+ unit_price_usd: z.ZodNumber;
329
+ eur: z.ZodNumber;
330
+ }, z.core.$strict>>;
331
+ unpriced: z.ZodArray<z.ZodObject<{
332
+ provider: z.ZodString;
333
+ model: z.ZodString;
334
+ }, z.core.$strict>>;
335
+ }, z.core.$strict>;
336
+ recording: z.ZodOptional<z.ZodNullable<z.ZodString>>;
337
+ }, z.core.$strict>;
338
+ export type CallSummary = z.infer<typeof CallSummarySchema>;
339
+ /** A transfer asked for by the agent or a supervisor finished, one way or the other. */
340
+ export declare const CallTransferredSchema: z.ZodObject<{
341
+ to: z.ZodString;
342
+ mode: z.ZodEnum<{
343
+ cold: "cold";
344
+ warm: "warm";
345
+ }>;
346
+ ok: z.ZodBoolean;
347
+ error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
348
+ }, z.core.$strict>;
349
+ export type CallTransferred = z.infer<typeof CallTransferredSchema>;
350
+ /**
351
+ * Somebody asked to be called back because no seat was free: a phone caller the overflow agent
352
+ * answered, or a web visitor who left a number at the widget. Written into the agent's own log;
353
+ * the tenant's app reads it and places the call.
354
+ */
355
+ export declare const CallbackRequestedSchema: z.ZodObject<{
356
+ channel: z.ZodEnum<{
357
+ phone: "phone";
358
+ web: "web";
359
+ whatsapp: "whatsapp";
360
+ }>;
361
+ number: z.ZodString;
362
+ via: z.ZodEnum<{
363
+ overflow: "overflow";
364
+ widget: "widget";
365
+ }>;
366
+ call: z.ZodNullable<z.ZodString>;
367
+ contact: z.ZodNullable<z.ZodObject<{
368
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
369
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
370
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
371
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
372
+ external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
373
+ }, z.core.$strict>>;
374
+ }, z.core.$strict>;
375
+ export type CallbackRequested = z.infer<typeof CallbackRequestedSchema>;
376
+ /** The caller did not say yes, or the request lapsed. The tool does not run; the model is told. */
377
+ export declare const ConfirmDeclinedSchema: z.ZodObject<{
378
+ tool: z.ZodString;
379
+ call_id: z.ZodString;
380
+ audience: z.ZodString;
381
+ said: z.ZodOptional<z.ZodNullable<z.ZodString>>;
382
+ reason: z.ZodEnum<{
383
+ timeout: "timeout";
384
+ changed: "changed";
385
+ cancelled: "cancelled";
386
+ no: "no";
387
+ }>;
388
+ }, z.core.$strict>;
389
+ export type ConfirmDeclined = z.infer<typeof ConfirmDeclinedSchema>;
390
+ /**
391
+ * The caller said yes. The platform minted a one-shot token bound to the audience and the tool now
392
+ * runs. The token itself never enters the log.
393
+ */
394
+ export declare const ConfirmGrantedSchema: z.ZodObject<{
395
+ tool: z.ZodString;
396
+ call_id: z.ZodString;
397
+ audience: z.ZodString;
398
+ said: z.ZodString;
399
+ ttl_s: z.ZodInt;
400
+ }, z.core.$strict>;
401
+ export type ConfirmGranted = z.infer<typeof ConfirmGrantedSchema>;
402
+ /**
403
+ * A tool with confirm set is about to run and the platform is asking the caller. The agent reads
404
+ * the phrase; nothing runs until confirm.granted.
405
+ */
406
+ export declare const ConfirmRequestSchema: z.ZodObject<{
407
+ tool: z.ZodString;
408
+ call_id: z.ZodString;
409
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
410
+ audience: z.ZodString;
411
+ phrase: z.ZodString;
412
+ ttl_s: z.ZodInt;
413
+ }, z.core.$strict>;
414
+ export type ConfirmRequest = z.infer<typeof ConfirmRequestSchema>;
415
+ /**
416
+ * The gateway refused a call or a register because one of the org's quotas ran out. Written into
417
+ * the agent's own log, which is the org's, before the door says no.
418
+ */
419
+ export declare const CreditsExhaustedSchema: z.ZodObject<{
420
+ org: z.ZodString;
421
+ quota: z.ZodEnum<{
422
+ minutes: "minutes";
423
+ messages: "messages";
424
+ agents: "agents";
425
+ concurrent_calls: "concurrent_calls";
426
+ memory_facts: "memory_facts";
427
+ knowledge_chunks: "knowledge_chunks";
428
+ numbers: "numbers";
429
+ seats: "seats";
430
+ }>;
431
+ used: z.ZodNumber;
432
+ limit: z.ZodInt;
433
+ }, z.core.$strict>;
434
+ export type CreditsExhausted = z.infer<typeof CreditsExhaustedSchema>;
435
+ /**
436
+ * A line the app wrote into the log with call.log. The platform never reads it; the console shows
437
+ * it and evals may.
438
+ */
439
+ export declare const CustomSchema: z.ZodObject<{
440
+ name: z.ZodString;
441
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
442
+ }, z.core.$strict>;
443
+ export type Custom = z.infer<typeof CustomSchema>;
444
+ /** One ask of the process in the agent's directory, on a console's behalf. */
445
+ export declare const DevRequestSchema: z.ZodObject<{
446
+ id: z.ZodString;
447
+ verb: z.ZodEnum<{
448
+ "chat.roster": "chat.roster";
449
+ "chat.start": "chat.start";
450
+ "chat.say": "chat.say";
451
+ "chat.end": "chat.end";
452
+ "simulate.roster": "simulate.roster";
453
+ "simulate.start": "simulate.start";
454
+ "goldens.roster": "goldens.roster";
455
+ "goldens.run": "goldens.run";
456
+ "knowledge.roster": "knowledge.roster";
457
+ "knowledge.push": "knowledge.push";
458
+ "knowledge.eval": "knowledge.eval";
459
+ "memory.roster": "memory.roster";
460
+ "memory.eval": "memory.eval";
461
+ "memory.extraction": "memory.extraction";
462
+ "promote.roster": "promote.roster";
463
+ "promote.write": "promote.write";
464
+ "drift.read": "drift.read";
465
+ "reproductions.roster": "reproductions.roster";
466
+ "reproductions.read": "reproductions.read";
467
+ }>;
468
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
469
+ }, z.core.$strict>;
470
+ export type DevRequest = z.infer<typeof DevRequestSchema>;
471
+ /**
472
+ * What retrieval put in front of the model for this turn. An answer can be traced back to its
473
+ * chunks.
474
+ */
475
+ export declare const DocsSourcesSchema: z.ZodObject<{
476
+ query: z.ZodString;
477
+ sources: z.ZodArray<z.ZodObject<{
478
+ id: z.ZodString;
479
+ path: z.ZodString;
480
+ heading: z.ZodOptional<z.ZodNullable<z.ZodString>>;
481
+ score: z.ZodNumber;
482
+ excerpt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
483
+ }, z.core.$strict>>;
484
+ took_ms: z.ZodNumber;
485
+ speech_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
486
+ }, z.core.$strict>;
487
+ export type DocsSources = z.infer<typeof DocsSourcesSchema>;
488
+ /**
489
+ * Something went wrong. Inside a call it says what failed; outside a call it says which command
490
+ * the gateway refused.
491
+ */
492
+ export declare const ErrorEventSchema: z.ZodObject<{
493
+ code: z.ZodString;
494
+ message: z.ZodString;
495
+ command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
496
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
497
+ recoverable: z.ZodBoolean;
498
+ }, z.core.$strict>;
499
+ export type ErrorEvent = z.infer<typeof ErrorEventSchema>;
500
+ /**
501
+ * The gateway refused to open a call because every worker of the fleet was full. Written into the
502
+ * agent's own log, which is the org's, before the door says no — the caller was offered a call
503
+ * back instead of a room.
504
+ */
505
+ export declare const FleetFullSchema: z.ZodObject<{
506
+ channel: z.ZodEnum<{
507
+ phone: "phone";
508
+ web: "web";
509
+ whatsapp: "whatsapp";
510
+ }>;
511
+ workers: z.ZodInt;
512
+ active: z.ZodInt;
513
+ }, z.core.$strict>;
514
+ export type FleetFull = z.infer<typeof FleetFullSchema>;
515
+ /**
516
+ * The replay is done: everything up to seq has been sent and what follows is live. Never stored;
517
+ * sent to the reader.
518
+ */
519
+ export declare const LogCaughtUpSchema: z.ZodObject<{
520
+ seq: z.ZodInt;
521
+ }, z.core.$strict>;
522
+ export type LogCaughtUp = z.infer<typeof LogCaughtUpSchema>;
523
+ /**
524
+ * This reader missed a stretch: it reconnected too late for the store, or fell behind and the
525
+ * fanout dropped ephemeral entries. When the platform has a snapshot, it is here so the reader can
526
+ * catch up in one step. Never stored; sent to the reader.
527
+ */
528
+ export declare const LogGapSchema: z.ZodObject<{
529
+ from_seq: z.ZodInt;
530
+ to_seq: z.ZodInt;
531
+ snapshot: z.ZodNullable<z.ZodObject<{
532
+ seq: z.ZodInt;
533
+ agent: z.ZodString;
534
+ call: z.ZodNullable<z.ZodString>;
535
+ status: z.ZodEnum<{
536
+ idle: "idle";
537
+ ringing: "ringing";
538
+ dialing: "dialing";
539
+ active: "active";
540
+ ended: "ended";
541
+ }>;
542
+ channel: z.ZodNullable<z.ZodEnum<{
543
+ phone: "phone";
544
+ web: "web";
545
+ whatsapp: "whatsapp";
546
+ }>>;
547
+ direction: z.ZodNullable<z.ZodEnum<{
548
+ inbound: "inbound";
549
+ outbound: "outbound";
550
+ }>>;
551
+ from: z.ZodNullable<z.ZodString>;
552
+ to: z.ZodNullable<z.ZodString>;
553
+ caller: z.ZodNullable<z.ZodObject<{
554
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
555
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
556
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
557
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
558
+ external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
559
+ }, z.core.$strict>>;
560
+ room: z.ZodNullable<z.ZodObject<{
561
+ name: z.ZodString;
562
+ sid: z.ZodString;
563
+ participants: z.ZodArray<z.ZodObject<{
564
+ identity: z.ZodString;
565
+ kind: z.ZodEnum<{
566
+ agent: "agent";
567
+ caller: "caller";
568
+ supervisor: "supervisor";
569
+ listener: "listener";
570
+ sip: "sip";
571
+ }>;
572
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
573
+ joined_at: z.ZodNumber;
574
+ speaking: z.ZodBoolean;
575
+ attributes: z.ZodRecord<z.ZodString, z.ZodUnknown>;
576
+ }, z.core.$strict>>;
577
+ caller: z.ZodNullable<z.ZodString>;
578
+ }, z.core.$strict>>;
579
+ started_at: z.ZodNullable<z.ZodNumber>;
580
+ ended_at: z.ZodNullable<z.ZodNumber>;
581
+ end_reason: z.ZodNullable<z.ZodEnum<{
582
+ caller_hung_up: "caller_hung_up";
583
+ agent_hung_up: "agent_hung_up";
584
+ supervisor_ended: "supervisor_ended";
585
+ transferred: "transferred";
586
+ no_answer: "no_answer";
587
+ busy: "busy";
588
+ dial_failed: "dial_failed";
589
+ timeout: "timeout";
590
+ drained: "drained";
591
+ app_detached: "app_detached";
592
+ error: "error";
593
+ }>>;
594
+ outcome: z.ZodNullable<z.ZodString>;
595
+ user_state: z.ZodNullable<z.ZodEnum<{
596
+ listening: "listening";
597
+ speaking: "speaking";
598
+ away: "away";
599
+ }>>;
600
+ agent_state: z.ZodNullable<z.ZodEnum<{
601
+ listening: "listening";
602
+ speaking: "speaking";
603
+ initializing: "initializing";
604
+ idle: "idle";
605
+ thinking: "thinking";
606
+ }>>;
607
+ live: z.ZodObject<{
608
+ user: z.ZodNullable<z.ZodString>;
609
+ agent: z.ZodNullable<z.ZodString>;
610
+ }, z.core.$strict>;
611
+ turns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
612
+ role: z.ZodLiteral<"user">;
613
+ speech_id: z.ZodString;
614
+ item_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
615
+ text: z.ZodString;
616
+ language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
617
+ transcript_confidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
618
+ metrics: z.ZodObject<{
619
+ started_speaking_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
620
+ stopped_speaking_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
621
+ transcription_delay: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
622
+ end_of_turn_delay: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
623
+ on_user_turn_completed_delay: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
624
+ stt_metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
625
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
626
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
627
+ }, z.core.$strict>>>;
628
+ }, z.core.$strict>;
629
+ }, z.core.$strict>, z.ZodObject<{
630
+ role: z.ZodLiteral<"agent">;
631
+ speech_id: z.ZodString;
632
+ item_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
633
+ text: z.ZodString;
634
+ interrupted: z.ZodBoolean;
635
+ metrics: z.ZodObject<{
636
+ started_speaking_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
637
+ stopped_speaking_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
638
+ llm_node_ttft: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
639
+ llm_node_tps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
640
+ llm_node_ttfs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
641
+ tts_node_ttfb: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
642
+ playback_latency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
643
+ e2e_latency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
644
+ provider_request_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
645
+ llm_metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
646
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
647
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
648
+ }, z.core.$strict>>>;
649
+ tts_metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
650
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
651
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
652
+ }, z.core.$strict>>>;
653
+ }, z.core.$strict>;
654
+ }, z.core.$strict>], "role">>;
655
+ metrics: z.ZodObject<{
656
+ llm: z.ZodArray<z.ZodObject<{
657
+ type: z.ZodLiteral<"llm_metrics">;
658
+ label: z.ZodString;
659
+ request_id: z.ZodString;
660
+ timestamp: z.ZodNumber;
661
+ duration: z.ZodNumber;
662
+ ttft: z.ZodNumber;
663
+ cancelled: z.ZodBoolean;
664
+ completion_tokens: z.ZodInt;
665
+ prompt_tokens: z.ZodInt;
666
+ prompt_cached_tokens: z.ZodInt;
667
+ cache_creation_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
668
+ reasoning_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
669
+ total_tokens: z.ZodInt;
670
+ tokens_per_second: z.ZodNumber;
671
+ speech_id: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
672
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
673
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
674
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
675
+ }, z.core.$strict>>>>;
676
+ }, z.core.$strict>>;
677
+ stt: z.ZodArray<z.ZodObject<{
678
+ type: z.ZodLiteral<"stt_metrics">;
679
+ label: z.ZodString;
680
+ request_id: z.ZodString;
681
+ timestamp: z.ZodNumber;
682
+ duration: z.ZodNumber;
683
+ audio_duration: z.ZodNumber;
684
+ input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
685
+ output_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
686
+ streamed: z.ZodBoolean;
687
+ acquire_time: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
688
+ connection_reused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
689
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
690
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
691
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
692
+ }, z.core.$strict>>>>;
693
+ }, z.core.$strict>>;
694
+ tts: z.ZodArray<z.ZodObject<{
695
+ type: z.ZodLiteral<"tts_metrics">;
696
+ label: z.ZodString;
697
+ request_id: z.ZodString;
698
+ timestamp: z.ZodNumber;
699
+ ttfb: z.ZodNumber;
700
+ duration: z.ZodNumber;
701
+ audio_duration: z.ZodNumber;
702
+ cancelled: z.ZodBoolean;
703
+ characters_count: z.ZodInt;
704
+ input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
705
+ output_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
706
+ streamed: z.ZodBoolean;
707
+ acquire_time: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
708
+ connection_reused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
709
+ segment_id: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
710
+ speech_id: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
711
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
712
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
713
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
714
+ }, z.core.$strict>>>>;
715
+ }, z.core.$strict>>;
716
+ vad: z.ZodArray<z.ZodObject<{
717
+ type: z.ZodLiteral<"vad_metrics">;
718
+ label: z.ZodString;
719
+ timestamp: z.ZodNumber;
720
+ idle_time: z.ZodNumber;
721
+ inference_duration_total: z.ZodNumber;
722
+ inference_count: z.ZodInt;
723
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
724
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
725
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
726
+ }, z.core.$strict>>>>;
727
+ }, z.core.$strict>>;
728
+ eou: z.ZodArray<z.ZodObject<{
729
+ type: z.ZodLiteral<"eou_metrics">;
730
+ timestamp: z.ZodNumber;
731
+ end_of_utterance_delay: z.ZodNumber;
732
+ transcription_delay: z.ZodNumber;
733
+ on_user_turn_completed_delay: z.ZodNumber;
734
+ speech_id: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
735
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
736
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
737
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
738
+ }, z.core.$strict>>>>;
739
+ }, z.core.$strict>>;
740
+ eot: z.ZodArray<z.ZodObject<{
741
+ type: z.ZodLiteral<"eot_inference_metrics">;
742
+ timestamp: z.ZodNumber;
743
+ total_duration: z.ZodNumber;
744
+ detection_delay: z.ZodNumber;
745
+ prediction_duration: z.ZodNumber;
746
+ num_requests: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
747
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
748
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
749
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
750
+ }, z.core.$strict>>>>;
751
+ }, z.core.$strict>>;
752
+ interruption: z.ZodArray<z.ZodObject<{
753
+ type: z.ZodLiteral<"interruption_metrics">;
754
+ timestamp: z.ZodNumber;
755
+ total_duration: z.ZodNumber;
756
+ prediction_duration: z.ZodNumber;
757
+ detection_delay: z.ZodNumber;
758
+ num_interruptions: z.ZodInt;
759
+ num_backchannels: z.ZodInt;
760
+ num_requests: z.ZodInt;
761
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
762
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
763
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
764
+ }, z.core.$strict>>>>;
765
+ }, z.core.$strict>>;
766
+ realtime: z.ZodArray<z.ZodObject<{
767
+ type: z.ZodLiteral<"realtime_model_metrics">;
768
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
769
+ request_id: z.ZodString;
770
+ timestamp: z.ZodNumber;
771
+ duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
772
+ session_duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
773
+ ttft: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
774
+ cancelled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
775
+ input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
776
+ output_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
777
+ total_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
778
+ tokens_per_second: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
779
+ input_token_details: z.ZodObject<{
780
+ audio_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
781
+ text_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
782
+ image_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
783
+ cached_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
784
+ cached_tokens_details: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
785
+ audio_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
786
+ text_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
787
+ image_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
788
+ }, z.core.$strict>>>>;
789
+ }, z.core.$strict>;
790
+ output_token_details: z.ZodObject<{
791
+ text_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
792
+ audio_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
793
+ image_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
794
+ }, z.core.$strict>;
795
+ acquire_time: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
796
+ connection_reused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
797
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
798
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
799
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
800
+ }, z.core.$strict>>>>;
801
+ }, z.core.$strict>>;
802
+ avatar: z.ZodArray<z.ZodObject<{
803
+ type: z.ZodLiteral<"avatar_metrics">;
804
+ timestamp: z.ZodNumber;
805
+ playback_latency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
806
+ session_started_time: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodNumber>>>;
807
+ avatar_joined_time: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodNumber>>>;
808
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
809
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
810
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
811
+ }, z.core.$strict>>>>;
812
+ }, z.core.$strict>>;
813
+ }, z.core.$strict>;
814
+ tools: z.ZodArray<z.ZodObject<{
815
+ call_id: z.ZodString;
816
+ name: z.ZodString;
817
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
818
+ speech_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
819
+ status: z.ZodEnum<{
820
+ running: "running";
821
+ done: "done";
822
+ failed: "failed";
823
+ }>;
824
+ output: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
825
+ error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
826
+ summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
827
+ duration_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
828
+ seq: z.ZodInt;
829
+ }, z.core.$strict>>;
830
+ app_state: z.ZodRecord<z.ZodString, z.ZodUnknown>;
831
+ events: z.ZodArray<z.ZodObject<{
832
+ seq: z.ZodInt;
833
+ name: z.ZodString;
834
+ source: z.ZodEnum<{
835
+ app: "app";
836
+ participant: "participant";
837
+ }>;
838
+ identity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
839
+ }, z.core.$strict>>;
840
+ prompt: z.ZodRecord<z.ZodString, z.ZodObject<{
841
+ hash: z.ZodString;
842
+ chars: z.ZodInt;
843
+ seq: z.ZodInt;
844
+ }, z.core.$strict>>;
845
+ tools_visible: z.ZodArray<z.ZodString>;
846
+ confirms: z.ZodArray<z.ZodObject<{
847
+ tool: z.ZodString;
848
+ call_id: z.ZodString;
849
+ audience: z.ZodString;
850
+ phrase: z.ZodString;
851
+ status: z.ZodEnum<{
852
+ pending: "pending";
853
+ granted: "granted";
854
+ declined: "declined";
855
+ }>;
856
+ said: z.ZodOptional<z.ZodNullable<z.ZodString>>;
857
+ reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
858
+ }, z.core.$strict>>;
859
+ memory: z.ZodArray<z.ZodObject<{
860
+ op: z.ZodEnum<{
861
+ recall: "recall";
862
+ remember: "remember";
863
+ forget: "forget";
864
+ }>;
865
+ contact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
866
+ query: z.ZodOptional<z.ZodNullable<z.ZodString>>;
867
+ facts: z.ZodArray<z.ZodObject<{
868
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
869
+ text: z.ZodString;
870
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
871
+ score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
872
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
873
+ }, z.core.$strict>>;
874
+ took_ms: z.ZodNumber;
875
+ }, z.core.$strict>>;
876
+ sources: z.ZodArray<z.ZodObject<{
877
+ id: z.ZodString;
878
+ path: z.ZodString;
879
+ heading: z.ZodOptional<z.ZodNullable<z.ZodString>>;
880
+ score: z.ZodNumber;
881
+ excerpt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
882
+ }, z.core.$strict>>;
883
+ handoff: z.ZodObject<{
884
+ active: z.ZodBoolean;
885
+ by: z.ZodNullable<z.ZodObject<{
886
+ id: z.ZodString;
887
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
888
+ }, z.core.$strict>>;
889
+ }, z.core.$strict>;
890
+ held: z.ZodBoolean;
891
+ muted: z.ZodBoolean;
892
+ transfer: z.ZodNullable<z.ZodObject<{
893
+ to: z.ZodString;
894
+ mode: z.ZodEnum<{
895
+ cold: "cold";
896
+ warm: "warm";
897
+ }>;
898
+ status: z.ZodEnum<{
899
+ done: "done";
900
+ failed: "failed";
901
+ requested: "requested";
902
+ }>;
903
+ by: z.ZodEnum<{
904
+ agent: "agent";
905
+ supervisor: "supervisor";
906
+ }>;
907
+ }, z.core.$strict>>;
908
+ usage: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
909
+ type: z.ZodLiteral<"llm_usage">;
910
+ provider: z.ZodString;
911
+ model: z.ZodString;
912
+ input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
913
+ input_cached_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
914
+ input_cache_creation_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
915
+ input_audio_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
916
+ input_cached_audio_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
917
+ input_text_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
918
+ input_cached_text_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
919
+ input_image_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
920
+ input_cached_image_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
921
+ output_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
922
+ output_audio_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
923
+ output_text_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
924
+ output_reasoning_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
925
+ session_duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
926
+ }, z.core.$strict>, z.ZodObject<{
927
+ type: z.ZodLiteral<"tts_usage">;
928
+ provider: z.ZodString;
929
+ model: z.ZodString;
930
+ input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
931
+ output_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
932
+ characters_count: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
933
+ audio_duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
934
+ }, z.core.$strict>, z.ZodObject<{
935
+ type: z.ZodLiteral<"stt_usage">;
936
+ provider: z.ZodString;
937
+ model: z.ZodString;
938
+ input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
939
+ output_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
940
+ audio_duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
941
+ }, z.core.$strict>, z.ZodObject<{
942
+ type: z.ZodLiteral<"interruption_usage">;
943
+ provider: z.ZodString;
944
+ model: z.ZodString;
945
+ total_requests: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
946
+ }, z.core.$strict>, z.ZodObject<{
947
+ type: z.ZodLiteral<"eot_usage">;
948
+ provider: z.ZodString;
949
+ model: z.ZodString;
950
+ total_requests: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
951
+ }, z.core.$strict>], "type">>;
952
+ cost: z.ZodNullable<z.ZodObject<{
953
+ eur: z.ZodNumber;
954
+ rate: z.ZodObject<{
955
+ currency: z.ZodLiteral<"EUR">;
956
+ usd_to_eur: z.ZodNumber;
957
+ as_of: z.ZodString;
958
+ }, z.core.$strict>;
959
+ rows: z.ZodArray<z.ZodObject<{
960
+ provider: z.ZodString;
961
+ model: z.ZodString;
962
+ unit: z.ZodEnum<{
963
+ input_tokens: "input_tokens";
964
+ cached_input_tokens: "cached_input_tokens";
965
+ cache_creation_tokens: "cache_creation_tokens";
966
+ output_tokens: "output_tokens";
967
+ characters: "characters";
968
+ audio_seconds: "audio_seconds";
969
+ requests: "requests";
970
+ session_seconds: "session_seconds";
971
+ }>;
972
+ quantity: z.ZodNumber;
973
+ unit_price_usd: z.ZodNumber;
974
+ eur: z.ZodNumber;
975
+ }, z.core.$strict>>;
976
+ unpriced: z.ZodArray<z.ZodObject<{
977
+ provider: z.ZodString;
978
+ model: z.ZodString;
979
+ }, z.core.$strict>>;
980
+ }, z.core.$strict>>;
981
+ routes: z.ZodArray<z.ZodObject<{
982
+ channel: z.ZodEnum<{
983
+ phone: "phone";
984
+ web: "web";
985
+ whatsapp: "whatsapp";
986
+ }>;
987
+ number: z.ZodNullable<z.ZodString>;
988
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
989
+ }, z.core.$strict>>;
990
+ gaps: z.ZodArray<z.ZodObject<{
991
+ from_seq: z.ZodInt;
992
+ to_seq: z.ZodInt;
993
+ }, z.core.$strict>>;
994
+ errors: z.ZodArray<z.ZodObject<{
995
+ seq: z.ZodInt;
996
+ code: z.ZodString;
997
+ message: z.ZodString;
998
+ }, z.core.$strict>>;
999
+ custom: z.ZodArray<z.ZodObject<{
1000
+ seq: z.ZodInt;
1001
+ name: z.ZodString;
1002
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1003
+ }, z.core.$strict>>;
1004
+ }, z.core.$strict>>;
1005
+ }, z.core.$strict>;
1006
+ export type LogGap = z.infer<typeof LogGapSchema>;
1007
+ /**
1008
+ * What memory did for this turn or at hangup: a recall before the reply, a remember after the
1009
+ * call, a forget on request.
1010
+ */
1011
+ export declare const MemoryOpsSchema: z.ZodObject<{
1012
+ ops: z.ZodArray<z.ZodObject<{
1013
+ op: z.ZodEnum<{
1014
+ recall: "recall";
1015
+ remember: "remember";
1016
+ forget: "forget";
1017
+ }>;
1018
+ contact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1019
+ query: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1020
+ facts: z.ZodArray<z.ZodObject<{
1021
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1022
+ text: z.ZodString;
1023
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1024
+ score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1025
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1026
+ }, z.core.$strict>>;
1027
+ took_ms: z.ZodNumber;
1028
+ }, z.core.$strict>>;
1029
+ speech_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1030
+ }, z.core.$strict>;
1031
+ export type MemoryOps = z.infer<typeof MemoryOpsSchema>;
1032
+ /** The answer to ping. Ephemeral: it proves the socket is alive and says nothing else. */
1033
+ export declare const PongSchema: z.ZodObject<{
1034
+ ts: z.ZodNumber;
1035
+ }, z.core.$strict>;
1036
+ export type Pong = z.infer<typeof PongSchema>;
1037
+ /**
1038
+ * A block of the prompt was rewritten. The text stays out of the log; its hash and length let two
1039
+ * states be compared.
1040
+ */
1041
+ export declare const PromptChangedSchema: z.ZodObject<{
1042
+ name: z.ZodString;
1043
+ hash: z.ZodString;
1044
+ chars: z.ZodInt;
1045
+ }, z.core.$strict>;
1046
+ export type PromptChanged = z.infer<typeof PromptChangedSchema>;
1047
+ /** A tool call's result changed the state. */
1048
+ export declare const StateCauseToolSchema: z.ZodObject<{
1049
+ kind: z.ZodLiteral<"tool">;
1050
+ tool: z.ZodString;
1051
+ call_id: z.ZodString;
1052
+ }, z.core.$strict>;
1053
+ export type StateCauseTool = z.infer<typeof StateCauseToolSchema>;
1054
+ /** A fact from outside changed the state: the app's handler for an event.received moved a field. */
1055
+ export declare const StateCauseEventSchema: z.ZodObject<{
1056
+ kind: z.ZodLiteral<"event">;
1057
+ name: z.ZodString;
1058
+ seq: z.ZodInt;
1059
+ }, z.core.$strict>;
1060
+ export type StateCauseEvent = z.infer<typeof StateCauseEventSchema>;
1061
+ /** What changed the state: a tool's result, or a fact from outside. Told apart by kind. */
1062
+ export declare const StateCauseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1063
+ kind: z.ZodLiteral<"tool">;
1064
+ tool: z.ZodString;
1065
+ call_id: z.ZodString;
1066
+ }, z.core.$strict>, z.ZodObject<{
1067
+ kind: z.ZodLiteral<"event">;
1068
+ name: z.ZodString;
1069
+ seq: z.ZodInt;
1070
+ }, z.core.$strict>], "kind">;
1071
+ export type StateCause = z.infer<typeof StateCauseSchema>;
1072
+ /**
1073
+ * The app's declared state changed. A tool's result or an outside fact caused it, and the cause
1074
+ * says which; the whole state travels so a reader never needs the previous entry.
1075
+ */
1076
+ export declare const StateChangedSchema: z.ZodObject<{
1077
+ state: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1078
+ changed: z.ZodArray<z.ZodString>;
1079
+ cause: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1080
+ kind: z.ZodLiteral<"tool">;
1081
+ tool: z.ZodString;
1082
+ call_id: z.ZodString;
1083
+ }, z.core.$strict>, z.ZodObject<{
1084
+ kind: z.ZodLiteral<"event">;
1085
+ name: z.ZodString;
1086
+ seq: z.ZodInt;
1087
+ }, z.core.$strict>], "kind">>>;
1088
+ }, z.core.$strict>;
1089
+ export type StateChanged = z.infer<typeof StateChangedSchema>;
1090
+ /** A supervisor hung up the call. call.ended follows with reason supervisor_ended. */
1091
+ export declare const SupervisorEndedSchema: z.ZodObject<{
1092
+ by: z.ZodObject<{
1093
+ id: z.ZodString;
1094
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1095
+ }, z.core.$strict>;
1096
+ reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1097
+ }, z.core.$strict>;
1098
+ export type SupervisorEnded = z.infer<typeof SupervisorEndedSchema>;
1099
+ /** The supervisor gave the line back; the agent resumes with the history intact. */
1100
+ export declare const SupervisorReleasedSchema: z.ZodObject<{
1101
+ by: z.ZodObject<{
1102
+ id: z.ZodString;
1103
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1104
+ }, z.core.$strict>;
1105
+ }, z.core.$strict>;
1106
+ export type SupervisorReleased = z.infer<typeof SupervisorReleasedSchema>;
1107
+ /** A supervisor made the agent say this to the caller. */
1108
+ export declare const SupervisorSaidSchema: z.ZodObject<{
1109
+ by: z.ZodObject<{
1110
+ id: z.ZodString;
1111
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1112
+ }, z.core.$strict>;
1113
+ text: z.ZodString;
1114
+ }, z.core.$strict>;
1115
+ export type SupervisorSaid = z.infer<typeof SupervisorSaidSchema>;
1116
+ /** A supervisor took the line; the agent is quiet until supervisor.released. */
1117
+ export declare const SupervisorTookOverSchema: z.ZodObject<{
1118
+ by: z.ZodObject<{
1119
+ id: z.ZodString;
1120
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1121
+ }, z.core.$strict>;
1122
+ }, z.core.$strict>;
1123
+ export type SupervisorTookOver = z.infer<typeof SupervisorTookOverSchema>;
1124
+ /** A supervisor asked for a transfer. call.transferred says how it went. */
1125
+ export declare const SupervisorTransferredSchema: z.ZodObject<{
1126
+ by: z.ZodObject<{
1127
+ id: z.ZodString;
1128
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1129
+ }, z.core.$strict>;
1130
+ to: z.ZodString;
1131
+ mode: z.ZodEnum<{
1132
+ cold: "cold";
1133
+ warm: "warm";
1134
+ }>;
1135
+ }, z.core.$strict>;
1136
+ export type SupervisorTransferred = z.infer<typeof SupervisorTransferredSchema>;
1137
+ /** A supervisor told the agent something the caller never heard. */
1138
+ export declare const SupervisorWhisperedSchema: z.ZodObject<{
1139
+ by: z.ZodObject<{
1140
+ id: z.ZodString;
1141
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1142
+ }, z.core.$strict>;
1143
+ text: z.ZodString;
1144
+ }, z.core.$strict>;
1145
+ export type SupervisorWhispered = z.infer<typeof SupervisorWhisperedSchema>;
1146
+ /**
1147
+ * The model called a tool. The platform sends this to the app and the app's method runs in the
1148
+ * app's own process; tool.result closes it.
1149
+ */
1150
+ export declare const ToolCallSchema: z.ZodObject<{
1151
+ call_id: z.ZodString;
1152
+ name: z.ZodString;
1153
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1154
+ speech_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1155
+ }, z.core.$strict>;
1156
+ export type ToolCall = z.infer<typeof ToolCallSchema>;
1157
+ /** The tools the model can see changed. The app's state moved and each tool's when was recomputed. */
1158
+ export declare const ToolsChangedSchema: z.ZodObject<{
1159
+ visible: z.ZodArray<z.ZodString>;
1160
+ }, z.core.$strict>;
1161
+ export type ToolsChanged = z.infer<typeof ToolsChangedSchema>;
1162
+ /**
1163
+ * The agent's reply is over and this is what was said. With it, everything the session measured
1164
+ * about the reply.
1165
+ */
1166
+ export declare const AgentTurnEndedSchema: z.ZodObject<{
1167
+ speech_id: z.ZodString;
1168
+ item_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1169
+ text: z.ZodString;
1170
+ interrupted: z.ZodBoolean;
1171
+ metrics: z.ZodObject<{
1172
+ started_speaking_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1173
+ stopped_speaking_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1174
+ llm_node_ttft: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1175
+ llm_node_tps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1176
+ llm_node_ttfs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1177
+ tts_node_ttfb: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1178
+ playback_latency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1179
+ e2e_latency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1180
+ provider_request_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1181
+ llm_metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1182
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1183
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1184
+ }, z.core.$strict>>>;
1185
+ tts_metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1186
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1187
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1188
+ }, z.core.$strict>>>;
1189
+ }, z.core.$strict>;
1190
+ }, z.core.$strict>;
1191
+ export type AgentTurnEnded = z.infer<typeof AgentTurnEndedSchema>;
1192
+ /**
1193
+ * The caller's turn is over and this is what they said. With it, everything the session measured
1194
+ * about the turn.
1195
+ */
1196
+ export declare const UserTurnEndedSchema: z.ZodObject<{
1197
+ speech_id: z.ZodString;
1198
+ item_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1199
+ text: z.ZodString;
1200
+ language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1201
+ transcript_confidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1202
+ metrics: z.ZodObject<{
1203
+ started_speaking_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1204
+ stopped_speaking_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1205
+ transcription_delay: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1206
+ end_of_turn_delay: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1207
+ on_user_turn_completed_delay: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1208
+ stt_metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1209
+ model_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1210
+ model_provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1211
+ }, z.core.$strict>>>;
1212
+ }, z.core.$strict>;
1213
+ }, z.core.$strict>;
1214
+ export type UserTurnEnded = z.infer<typeof UserTurnEndedSchema>;
1215
+ /** The caller's state changed, in the session's own words. */
1216
+ export declare const UserStateChangedSchema: z.ZodObject<{
1217
+ state: z.ZodEnum<{
1218
+ listening: "listening";
1219
+ speaking: "speaking";
1220
+ away: "away";
1221
+ }>;
1222
+ }, z.core.$strict>;
1223
+ export type UserStateChanged = z.infer<typeof UserStateChangedSchema>;
1224
+ /**
1225
+ * Words from the caller as the recognizer hears them. Interim while final is false; the final one
1226
+ * becomes turn.user. Interim entries are ephemeral.
1227
+ */
1228
+ export declare const UserTranscriptSchema: z.ZodObject<{
1229
+ text: z.ZodString;
1230
+ final: z.ZodBoolean;
1231
+ language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1232
+ confidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1233
+ }, z.core.$strict>;
1234
+ export type UserTranscript = z.infer<typeof UserTranscriptSchema>;