@voicelayer/sdk 0.1.7 → 0.1.9

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/index.d.ts CHANGED
@@ -1,1003 +1,9 @@
1
+ import { A as AgentDTO, a as AgentStatus, b as AgentEnvironment, P as ProcessSchemaDTO, c as AgentContext, d as Participant, C as CallInfo } from './text-session-D1j8nQac.js';
2
+ export { e as AgentTurnEvent, f as AudioProfile, g as AudioSurface, h as ChannelKind, D as DtmfEvent, i as DtmfHandler, E as EndCallControllerHandle, j as EndCallOutcome, F as FakeSessionAdapter, k as FloorControlConfig, I as InboundOptions, L as LK_AGENT_STATE_MAP, M as MemoryHandle, l as MetricsEvent, N as NON_BUSY_STATES, m as ParticipantId, n as ParticipantKind, o as ParticipantSet, p as ProcessSnapshot, R as RespondOptions, q as Room, r as RouteEntry, s as RoutingRule, t as RoutingSnapshot, u as RunTextSessionOptions, v as RunTextTranscriptOptions, S as SayOptions, w as SendDtmfOptions, x as SessionAdapter, y as SessionCapabilities, z as SessionErrorEvent, B as SessionEvent, G as SessionEventMap, H as SessionFactory, J as SessionFactoryInput, K as SessionOutbound, O as SessionState, Q as SpeechResult, T as SpeechTarget, U as StateChangeEvent, V as TextSession, W as TextTranscriptResult, X as TtsVoiceConfig, Y as TurnEvent, Z as Unsubscribe, _ as UserInputEvent, $ as UserTurn, a0 as applySpeechTurnHandling, a1 as dtmfCodeToDigit, a2 as dtmfDigitToCode, a3 as duck, a4 as mute, a5 as normalizeState, m as participantId, a6 as passthrough, a7 as runTextSession, a8 as runTextTranscript, a9 as transform } from './text-session-D1j8nQac.js';
1
3
  import { z, ZodType } from 'zod';
2
- import { A as AgentContext, P as Participant, C as CallInfo } from './text-session-B8-jhQzv.js';
3
- export { a as AgentTurnEvent, b as AudioProfile, c as AudioSurface, d as ChannelKind, D as DtmfEvent, e as DtmfHandler, E as EndCallControllerHandle, f as EndCallOutcome, F as FakeSessionAdapter, g as FloorControlConfig, I as InboundOptions, L as LK_AGENT_STATE_MAP, M as MemoryHandle, h as MetricsEvent, N as NON_BUSY_STATES, i as ParticipantId, j as ParticipantKind, k as ParticipantSet, l as ProcessSnapshot, R as RespondOptions, m as Room, n as RouteEntry, o as RoutingRule, p as RoutingSnapshot, q as RunTextSessionOptions, r as RunTextTranscriptOptions, S as SayOptions, s as SendDtmfOptions, t as SessionAdapter, u as SessionCapabilities, v as SessionErrorEvent, w as SessionEvent, x as SessionEventMap, y as SessionFactory, z as SessionFactoryInput, B as SessionOutbound, G as SessionState, H as SpeechResult, J as SpeechTarget, K as StateChangeEvent, T as TextSession, O as TextTranscriptResult, Q as TtsVoiceConfig, U as TurnEvent, V as Unsubscribe, W as UserInputEvent, X as UserTurn, Y as applySpeechTurnHandling, Z as dtmfCodeToDigit, _ as dtmfDigitToCode, $ as duck, a0 as mute, a1 as normalizeState, i as participantId, a2 as passthrough, a3 as runTextSession, a4 as runTextTranscript, a5 as transform } from './text-session-B8-jhQzv.js';
4
4
  import { llm } from '@livekit/agents';
5
5
  import { Redis } from 'ioredis';
6
6
 
7
- declare const AgentEnvironment: z.ZodEnum<["dev", "stg", "prd"]>;
8
- type AgentEnvironment = z.infer<typeof AgentEnvironment>;
9
- declare const AgentStatus: z.ZodEnum<["online", "offline", "degraded"]>;
10
- type AgentStatus = z.infer<typeof AgentStatus>;
11
- declare const ProcessSchemaDTO: z.ZodObject<{
12
- id: z.ZodString;
13
- prompts: z.ZodOptional<z.ZodArray<z.ZodObject<{
14
- id: z.ZodString;
15
- text: z.ZodString;
16
- }, "strip", z.ZodTypeAny, {
17
- id: string;
18
- text: string;
19
- }, {
20
- id: string;
21
- text: string;
22
- }>, "many">>;
23
- fields: z.ZodArray<z.ZodObject<{
24
- name: z.ZodString;
25
- required: z.ZodBoolean;
26
- type: z.ZodEnum<["string", "string[]", "number", "boolean", "datetime", "email", "phone"]>;
27
- pattern: z.ZodOptional<z.ZodString>;
28
- min: z.ZodOptional<z.ZodNumber>;
29
- max: z.ZodOptional<z.ZodNumber>;
30
- enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
31
- ask: z.ZodOptional<z.ZodString>;
32
- }, "strip", z.ZodTypeAny, {
33
- type: "string" | "number" | "boolean" | "string[]" | "datetime" | "email" | "phone";
34
- name: string;
35
- required: boolean;
36
- ask?: string | undefined;
37
- pattern?: string | undefined;
38
- min?: number | undefined;
39
- max?: number | undefined;
40
- enum?: string[] | undefined;
41
- }, {
42
- type: "string" | "number" | "boolean" | "string[]" | "datetime" | "email" | "phone";
43
- name: string;
44
- required: boolean;
45
- ask?: string | undefined;
46
- pattern?: string | undefined;
47
- min?: number | undefined;
48
- max?: number | undefined;
49
- enum?: string[] | undefined;
50
- }>, "many">;
51
- completionGate: z.ZodObject<{
52
- requiredFields: z.ZodArray<z.ZodString, "many">;
53
- backendAck: z.ZodOptional<z.ZodObject<{
54
- url: z.ZodString;
55
- timeoutMs: z.ZodNumber;
56
- }, "strip", z.ZodTypeAny, {
57
- url: string;
58
- timeoutMs: number;
59
- }, {
60
- url: string;
61
- timeoutMs: number;
62
- }>>;
63
- }, "strip", z.ZodTypeAny, {
64
- requiredFields: string[];
65
- backendAck?: {
66
- url: string;
67
- timeoutMs: number;
68
- } | undefined;
69
- }, {
70
- requiredFields: string[];
71
- backendAck?: {
72
- url: string;
73
- timeoutMs: number;
74
- } | undefined;
75
- }>;
76
- triggers: z.ZodOptional<z.ZodArray<z.ZodObject<{
77
- name: z.ZodString;
78
- on: z.ZodString;
79
- then: z.ZodString;
80
- onlyWhile: z.ZodOptional<z.ZodString>;
81
- }, "strip", z.ZodTypeAny, {
82
- then: string;
83
- name: string;
84
- on: string;
85
- onlyWhile?: string | undefined;
86
- }, {
87
- then: string;
88
- name: string;
89
- on: string;
90
- onlyWhile?: string | undefined;
91
- }>, "many">>;
92
- handoff: z.ZodOptional<z.ZodObject<{
93
- fallback: z.ZodOptional<z.ZodString>;
94
- routes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
95
- }, "strip", z.ZodTypeAny, {
96
- fallback?: string | undefined;
97
- routes?: Record<string, string> | undefined;
98
- }, {
99
- fallback?: string | undefined;
100
- routes?: Record<string, string> | undefined;
101
- }>>;
102
- memory: z.ZodOptional<z.ZodObject<{
103
- scope: z.ZodOptional<z.ZodEnum<["call", "caller", "participant", "account", "platform"]>>;
104
- retentionDays: z.ZodOptional<z.ZodNumber>;
105
- piiFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
106
- }, "strip", z.ZodTypeAny, {
107
- scope?: "caller" | "call" | "account" | "participant" | "platform" | undefined;
108
- retentionDays?: number | undefined;
109
- piiFields?: string[] | undefined;
110
- }, {
111
- scope?: "caller" | "call" | "account" | "participant" | "platform" | undefined;
112
- retentionDays?: number | undefined;
113
- piiFields?: string[] | undefined;
114
- }>>;
115
- tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
116
- name: z.ZodString;
117
- description: z.ZodString;
118
- input: z.ZodRecord<z.ZodString, z.ZodEnum<["string", "number", "boolean"]>>;
119
- url: z.ZodString;
120
- method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
121
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
122
- auth: z.ZodEnum<["none", "connection"]>;
123
- connectionRef: z.ZodOptional<z.ZodString>;
124
- }, "strip", z.ZodTypeAny, {
125
- name: string;
126
- description: string;
127
- input: Record<string, "string" | "number" | "boolean">;
128
- url: string;
129
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
130
- auth: "none" | "connection";
131
- headers?: Record<string, string> | undefined;
132
- connectionRef?: string | undefined;
133
- }, {
134
- name: string;
135
- description: string;
136
- input: Record<string, "string" | "number" | "boolean">;
137
- url: string;
138
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
139
- auth: "none" | "connection";
140
- headers?: Record<string, string> | undefined;
141
- connectionRef?: string | undefined;
142
- }>, "many">>;
143
- program: z.ZodOptional<z.ZodObject<{
144
- v: z.ZodLiteral<1>;
145
- id: z.ZodString;
146
- entry: z.ZodArray<z.ZodString, "many">;
147
- nodes: z.ZodRecord<z.ZodString, z.ZodObject<{
148
- id: z.ZodString;
149
- type: z.ZodEnum<["start", "say", "ask", "confirm", "tool", "decision", "handoff", "end", "trigger", "gate", "playbook", "menu", "code", "set", "subflow", "llm", "rag", "memory", "classify", "router", "note"]>;
150
- config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
151
- out: z.ZodArray<z.ZodObject<{
152
- to: z.ZodString;
153
- condition: z.ZodOptional<z.ZodString>;
154
- sourceHandle: z.ZodOptional<z.ZodString>;
155
- label: z.ZodOptional<z.ZodString>;
156
- }, "strip", z.ZodTypeAny, {
157
- to: string;
158
- sourceHandle?: string | undefined;
159
- label?: string | undefined;
160
- condition?: string | undefined;
161
- }, {
162
- to: string;
163
- sourceHandle?: string | undefined;
164
- label?: string | undefined;
165
- condition?: string | undefined;
166
- }>, "many">;
167
- }, "strip", z.ZodTypeAny, {
168
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
169
- id: string;
170
- config: Record<string, unknown>;
171
- out: {
172
- to: string;
173
- sourceHandle?: string | undefined;
174
- label?: string | undefined;
175
- condition?: string | undefined;
176
- }[];
177
- }, {
178
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
179
- id: string;
180
- config: Record<string, unknown>;
181
- out: {
182
- to: string;
183
- sourceHandle?: string | undefined;
184
- label?: string | undefined;
185
- condition?: string | undefined;
186
- }[];
187
- }>>;
188
- completionGate: z.ZodObject<{
189
- requiredFields: z.ZodArray<z.ZodString, "many">;
190
- }, "strip", z.ZodTypeAny, {
191
- requiredFields: string[];
192
- }, {
193
- requiredFields: string[];
194
- }>;
195
- diagnostics: z.ZodOptional<z.ZodObject<{
196
- acyclic: z.ZodBoolean;
197
- droppedEdges: z.ZodArray<z.ZodString, "many">;
198
- unsupportedNodes: z.ZodArray<z.ZodString, "many">;
199
- }, "strip", z.ZodTypeAny, {
200
- acyclic: boolean;
201
- droppedEdges: string[];
202
- unsupportedNodes: string[];
203
- }, {
204
- acyclic: boolean;
205
- droppedEdges: string[];
206
- unsupportedNodes: string[];
207
- }>>;
208
- }, "strip", z.ZodTypeAny, {
209
- v: 1;
210
- id: string;
211
- nodes: Record<string, {
212
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
213
- id: string;
214
- config: Record<string, unknown>;
215
- out: {
216
- to: string;
217
- sourceHandle?: string | undefined;
218
- label?: string | undefined;
219
- condition?: string | undefined;
220
- }[];
221
- }>;
222
- entry: string[];
223
- completionGate: {
224
- requiredFields: string[];
225
- };
226
- diagnostics?: {
227
- acyclic: boolean;
228
- droppedEdges: string[];
229
- unsupportedNodes: string[];
230
- } | undefined;
231
- }, {
232
- v: 1;
233
- id: string;
234
- nodes: Record<string, {
235
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
236
- id: string;
237
- config: Record<string, unknown>;
238
- out: {
239
- to: string;
240
- sourceHandle?: string | undefined;
241
- label?: string | undefined;
242
- condition?: string | undefined;
243
- }[];
244
- }>;
245
- entry: string[];
246
- completionGate: {
247
- requiredFields: string[];
248
- };
249
- diagnostics?: {
250
- acyclic: boolean;
251
- droppedEdges: string[];
252
- unsupportedNodes: string[];
253
- } | undefined;
254
- }>>;
255
- }, "strip", z.ZodTypeAny, {
256
- id: string;
257
- completionGate: {
258
- requiredFields: string[];
259
- backendAck?: {
260
- url: string;
261
- timeoutMs: number;
262
- } | undefined;
263
- };
264
- fields: {
265
- type: "string" | "number" | "boolean" | "string[]" | "datetime" | "email" | "phone";
266
- name: string;
267
- required: boolean;
268
- ask?: string | undefined;
269
- pattern?: string | undefined;
270
- min?: number | undefined;
271
- max?: number | undefined;
272
- enum?: string[] | undefined;
273
- }[];
274
- handoff?: {
275
- fallback?: string | undefined;
276
- routes?: Record<string, string> | undefined;
277
- } | undefined;
278
- memory?: {
279
- scope?: "caller" | "call" | "account" | "participant" | "platform" | undefined;
280
- retentionDays?: number | undefined;
281
- piiFields?: string[] | undefined;
282
- } | undefined;
283
- prompts?: {
284
- id: string;
285
- text: string;
286
- }[] | undefined;
287
- triggers?: {
288
- then: string;
289
- name: string;
290
- on: string;
291
- onlyWhile?: string | undefined;
292
- }[] | undefined;
293
- tools?: {
294
- name: string;
295
- description: string;
296
- input: Record<string, "string" | "number" | "boolean">;
297
- url: string;
298
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
299
- auth: "none" | "connection";
300
- headers?: Record<string, string> | undefined;
301
- connectionRef?: string | undefined;
302
- }[] | undefined;
303
- program?: {
304
- v: 1;
305
- id: string;
306
- nodes: Record<string, {
307
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
308
- id: string;
309
- config: Record<string, unknown>;
310
- out: {
311
- to: string;
312
- sourceHandle?: string | undefined;
313
- label?: string | undefined;
314
- condition?: string | undefined;
315
- }[];
316
- }>;
317
- entry: string[];
318
- completionGate: {
319
- requiredFields: string[];
320
- };
321
- diagnostics?: {
322
- acyclic: boolean;
323
- droppedEdges: string[];
324
- unsupportedNodes: string[];
325
- } | undefined;
326
- } | undefined;
327
- }, {
328
- id: string;
329
- completionGate: {
330
- requiredFields: string[];
331
- backendAck?: {
332
- url: string;
333
- timeoutMs: number;
334
- } | undefined;
335
- };
336
- fields: {
337
- type: "string" | "number" | "boolean" | "string[]" | "datetime" | "email" | "phone";
338
- name: string;
339
- required: boolean;
340
- ask?: string | undefined;
341
- pattern?: string | undefined;
342
- min?: number | undefined;
343
- max?: number | undefined;
344
- enum?: string[] | undefined;
345
- }[];
346
- handoff?: {
347
- fallback?: string | undefined;
348
- routes?: Record<string, string> | undefined;
349
- } | undefined;
350
- memory?: {
351
- scope?: "caller" | "call" | "account" | "participant" | "platform" | undefined;
352
- retentionDays?: number | undefined;
353
- piiFields?: string[] | undefined;
354
- } | undefined;
355
- prompts?: {
356
- id: string;
357
- text: string;
358
- }[] | undefined;
359
- triggers?: {
360
- then: string;
361
- name: string;
362
- on: string;
363
- onlyWhile?: string | undefined;
364
- }[] | undefined;
365
- tools?: {
366
- name: string;
367
- description: string;
368
- input: Record<string, "string" | "number" | "boolean">;
369
- url: string;
370
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
371
- auth: "none" | "connection";
372
- headers?: Record<string, string> | undefined;
373
- connectionRef?: string | undefined;
374
- }[] | undefined;
375
- program?: {
376
- v: 1;
377
- id: string;
378
- nodes: Record<string, {
379
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
380
- id: string;
381
- config: Record<string, unknown>;
382
- out: {
383
- to: string;
384
- sourceHandle?: string | undefined;
385
- label?: string | undefined;
386
- condition?: string | undefined;
387
- }[];
388
- }>;
389
- entry: string[];
390
- completionGate: {
391
- requiredFields: string[];
392
- };
393
- diagnostics?: {
394
- acyclic: boolean;
395
- droppedEdges: string[];
396
- unsupportedNodes: string[];
397
- } | undefined;
398
- } | undefined;
399
- }>;
400
- type ProcessSchemaDTO = z.infer<typeof ProcessSchemaDTO>;
401
- declare const AgentDTO: z.ZodObject<{
402
- id: z.ZodString;
403
- projectId: z.ZodString;
404
- name: z.ZodString;
405
- version: z.ZodString;
406
- environment: z.ZodEnum<["dev", "stg", "prd"]>;
407
- status: z.ZodEnum<["online", "offline", "degraded"]>;
408
- statusDetail: z.ZodNullable<z.ZodString>;
409
- capabilities: z.ZodArray<z.ZodString, "many">;
410
- readiness: z.ZodArray<z.ZodObject<{
411
- probe: z.ZodString;
412
- ok: z.ZodBoolean;
413
- detail: z.ZodOptional<z.ZodString>;
414
- }, "strip", z.ZodTypeAny, {
415
- probe: string;
416
- ok: boolean;
417
- detail?: string | undefined;
418
- }, {
419
- probe: string;
420
- ok: boolean;
421
- detail?: string | undefined;
422
- }>, "many">;
423
- lastSeenAt: z.ZodNullable<z.ZodString>;
424
- metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
425
- processSchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
426
- id: z.ZodString;
427
- prompts: z.ZodOptional<z.ZodArray<z.ZodObject<{
428
- id: z.ZodString;
429
- text: z.ZodString;
430
- }, "strip", z.ZodTypeAny, {
431
- id: string;
432
- text: string;
433
- }, {
434
- id: string;
435
- text: string;
436
- }>, "many">>;
437
- fields: z.ZodArray<z.ZodObject<{
438
- name: z.ZodString;
439
- required: z.ZodBoolean;
440
- type: z.ZodEnum<["string", "string[]", "number", "boolean", "datetime", "email", "phone"]>;
441
- pattern: z.ZodOptional<z.ZodString>;
442
- min: z.ZodOptional<z.ZodNumber>;
443
- max: z.ZodOptional<z.ZodNumber>;
444
- enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
445
- ask: z.ZodOptional<z.ZodString>;
446
- }, "strip", z.ZodTypeAny, {
447
- type: "string" | "number" | "boolean" | "string[]" | "datetime" | "email" | "phone";
448
- name: string;
449
- required: boolean;
450
- ask?: string | undefined;
451
- pattern?: string | undefined;
452
- min?: number | undefined;
453
- max?: number | undefined;
454
- enum?: string[] | undefined;
455
- }, {
456
- type: "string" | "number" | "boolean" | "string[]" | "datetime" | "email" | "phone";
457
- name: string;
458
- required: boolean;
459
- ask?: string | undefined;
460
- pattern?: string | undefined;
461
- min?: number | undefined;
462
- max?: number | undefined;
463
- enum?: string[] | undefined;
464
- }>, "many">;
465
- completionGate: z.ZodObject<{
466
- requiredFields: z.ZodArray<z.ZodString, "many">;
467
- backendAck: z.ZodOptional<z.ZodObject<{
468
- url: z.ZodString;
469
- timeoutMs: z.ZodNumber;
470
- }, "strip", z.ZodTypeAny, {
471
- url: string;
472
- timeoutMs: number;
473
- }, {
474
- url: string;
475
- timeoutMs: number;
476
- }>>;
477
- }, "strip", z.ZodTypeAny, {
478
- requiredFields: string[];
479
- backendAck?: {
480
- url: string;
481
- timeoutMs: number;
482
- } | undefined;
483
- }, {
484
- requiredFields: string[];
485
- backendAck?: {
486
- url: string;
487
- timeoutMs: number;
488
- } | undefined;
489
- }>;
490
- triggers: z.ZodOptional<z.ZodArray<z.ZodObject<{
491
- name: z.ZodString;
492
- on: z.ZodString;
493
- then: z.ZodString;
494
- onlyWhile: z.ZodOptional<z.ZodString>;
495
- }, "strip", z.ZodTypeAny, {
496
- then: string;
497
- name: string;
498
- on: string;
499
- onlyWhile?: string | undefined;
500
- }, {
501
- then: string;
502
- name: string;
503
- on: string;
504
- onlyWhile?: string | undefined;
505
- }>, "many">>;
506
- handoff: z.ZodOptional<z.ZodObject<{
507
- fallback: z.ZodOptional<z.ZodString>;
508
- routes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
509
- }, "strip", z.ZodTypeAny, {
510
- fallback?: string | undefined;
511
- routes?: Record<string, string> | undefined;
512
- }, {
513
- fallback?: string | undefined;
514
- routes?: Record<string, string> | undefined;
515
- }>>;
516
- memory: z.ZodOptional<z.ZodObject<{
517
- scope: z.ZodOptional<z.ZodEnum<["call", "caller", "participant", "account", "platform"]>>;
518
- retentionDays: z.ZodOptional<z.ZodNumber>;
519
- piiFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
520
- }, "strip", z.ZodTypeAny, {
521
- scope?: "caller" | "call" | "account" | "participant" | "platform" | undefined;
522
- retentionDays?: number | undefined;
523
- piiFields?: string[] | undefined;
524
- }, {
525
- scope?: "caller" | "call" | "account" | "participant" | "platform" | undefined;
526
- retentionDays?: number | undefined;
527
- piiFields?: string[] | undefined;
528
- }>>;
529
- tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
530
- name: z.ZodString;
531
- description: z.ZodString;
532
- input: z.ZodRecord<z.ZodString, z.ZodEnum<["string", "number", "boolean"]>>;
533
- url: z.ZodString;
534
- method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
535
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
536
- auth: z.ZodEnum<["none", "connection"]>;
537
- connectionRef: z.ZodOptional<z.ZodString>;
538
- }, "strip", z.ZodTypeAny, {
539
- name: string;
540
- description: string;
541
- input: Record<string, "string" | "number" | "boolean">;
542
- url: string;
543
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
544
- auth: "none" | "connection";
545
- headers?: Record<string, string> | undefined;
546
- connectionRef?: string | undefined;
547
- }, {
548
- name: string;
549
- description: string;
550
- input: Record<string, "string" | "number" | "boolean">;
551
- url: string;
552
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
553
- auth: "none" | "connection";
554
- headers?: Record<string, string> | undefined;
555
- connectionRef?: string | undefined;
556
- }>, "many">>;
557
- program: z.ZodOptional<z.ZodObject<{
558
- v: z.ZodLiteral<1>;
559
- id: z.ZodString;
560
- entry: z.ZodArray<z.ZodString, "many">;
561
- nodes: z.ZodRecord<z.ZodString, z.ZodObject<{
562
- id: z.ZodString;
563
- type: z.ZodEnum<["start", "say", "ask", "confirm", "tool", "decision", "handoff", "end", "trigger", "gate", "playbook", "menu", "code", "set", "subflow", "llm", "rag", "memory", "classify", "router", "note"]>;
564
- config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
565
- out: z.ZodArray<z.ZodObject<{
566
- to: z.ZodString;
567
- condition: z.ZodOptional<z.ZodString>;
568
- sourceHandle: z.ZodOptional<z.ZodString>;
569
- label: z.ZodOptional<z.ZodString>;
570
- }, "strip", z.ZodTypeAny, {
571
- to: string;
572
- sourceHandle?: string | undefined;
573
- label?: string | undefined;
574
- condition?: string | undefined;
575
- }, {
576
- to: string;
577
- sourceHandle?: string | undefined;
578
- label?: string | undefined;
579
- condition?: string | undefined;
580
- }>, "many">;
581
- }, "strip", z.ZodTypeAny, {
582
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
583
- id: string;
584
- config: Record<string, unknown>;
585
- out: {
586
- to: string;
587
- sourceHandle?: string | undefined;
588
- label?: string | undefined;
589
- condition?: string | undefined;
590
- }[];
591
- }, {
592
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
593
- id: string;
594
- config: Record<string, unknown>;
595
- out: {
596
- to: string;
597
- sourceHandle?: string | undefined;
598
- label?: string | undefined;
599
- condition?: string | undefined;
600
- }[];
601
- }>>;
602
- completionGate: z.ZodObject<{
603
- requiredFields: z.ZodArray<z.ZodString, "many">;
604
- }, "strip", z.ZodTypeAny, {
605
- requiredFields: string[];
606
- }, {
607
- requiredFields: string[];
608
- }>;
609
- diagnostics: z.ZodOptional<z.ZodObject<{
610
- acyclic: z.ZodBoolean;
611
- droppedEdges: z.ZodArray<z.ZodString, "many">;
612
- unsupportedNodes: z.ZodArray<z.ZodString, "many">;
613
- }, "strip", z.ZodTypeAny, {
614
- acyclic: boolean;
615
- droppedEdges: string[];
616
- unsupportedNodes: string[];
617
- }, {
618
- acyclic: boolean;
619
- droppedEdges: string[];
620
- unsupportedNodes: string[];
621
- }>>;
622
- }, "strip", z.ZodTypeAny, {
623
- v: 1;
624
- id: string;
625
- nodes: Record<string, {
626
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
627
- id: string;
628
- config: Record<string, unknown>;
629
- out: {
630
- to: string;
631
- sourceHandle?: string | undefined;
632
- label?: string | undefined;
633
- condition?: string | undefined;
634
- }[];
635
- }>;
636
- entry: string[];
637
- completionGate: {
638
- requiredFields: string[];
639
- };
640
- diagnostics?: {
641
- acyclic: boolean;
642
- droppedEdges: string[];
643
- unsupportedNodes: string[];
644
- } | undefined;
645
- }, {
646
- v: 1;
647
- id: string;
648
- nodes: Record<string, {
649
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
650
- id: string;
651
- config: Record<string, unknown>;
652
- out: {
653
- to: string;
654
- sourceHandle?: string | undefined;
655
- label?: string | undefined;
656
- condition?: string | undefined;
657
- }[];
658
- }>;
659
- entry: string[];
660
- completionGate: {
661
- requiredFields: string[];
662
- };
663
- diagnostics?: {
664
- acyclic: boolean;
665
- droppedEdges: string[];
666
- unsupportedNodes: string[];
667
- } | undefined;
668
- }>>;
669
- }, "strip", z.ZodTypeAny, {
670
- id: string;
671
- completionGate: {
672
- requiredFields: string[];
673
- backendAck?: {
674
- url: string;
675
- timeoutMs: number;
676
- } | undefined;
677
- };
678
- fields: {
679
- type: "string" | "number" | "boolean" | "string[]" | "datetime" | "email" | "phone";
680
- name: string;
681
- required: boolean;
682
- ask?: string | undefined;
683
- pattern?: string | undefined;
684
- min?: number | undefined;
685
- max?: number | undefined;
686
- enum?: string[] | undefined;
687
- }[];
688
- handoff?: {
689
- fallback?: string | undefined;
690
- routes?: Record<string, string> | undefined;
691
- } | undefined;
692
- memory?: {
693
- scope?: "caller" | "call" | "account" | "participant" | "platform" | undefined;
694
- retentionDays?: number | undefined;
695
- piiFields?: string[] | undefined;
696
- } | undefined;
697
- prompts?: {
698
- id: string;
699
- text: string;
700
- }[] | undefined;
701
- triggers?: {
702
- then: string;
703
- name: string;
704
- on: string;
705
- onlyWhile?: string | undefined;
706
- }[] | undefined;
707
- tools?: {
708
- name: string;
709
- description: string;
710
- input: Record<string, "string" | "number" | "boolean">;
711
- url: string;
712
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
713
- auth: "none" | "connection";
714
- headers?: Record<string, string> | undefined;
715
- connectionRef?: string | undefined;
716
- }[] | undefined;
717
- program?: {
718
- v: 1;
719
- id: string;
720
- nodes: Record<string, {
721
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
722
- id: string;
723
- config: Record<string, unknown>;
724
- out: {
725
- to: string;
726
- sourceHandle?: string | undefined;
727
- label?: string | undefined;
728
- condition?: string | undefined;
729
- }[];
730
- }>;
731
- entry: string[];
732
- completionGate: {
733
- requiredFields: string[];
734
- };
735
- diagnostics?: {
736
- acyclic: boolean;
737
- droppedEdges: string[];
738
- unsupportedNodes: string[];
739
- } | undefined;
740
- } | undefined;
741
- }, {
742
- id: string;
743
- completionGate: {
744
- requiredFields: string[];
745
- backendAck?: {
746
- url: string;
747
- timeoutMs: number;
748
- } | undefined;
749
- };
750
- fields: {
751
- type: "string" | "number" | "boolean" | "string[]" | "datetime" | "email" | "phone";
752
- name: string;
753
- required: boolean;
754
- ask?: string | undefined;
755
- pattern?: string | undefined;
756
- min?: number | undefined;
757
- max?: number | undefined;
758
- enum?: string[] | undefined;
759
- }[];
760
- handoff?: {
761
- fallback?: string | undefined;
762
- routes?: Record<string, string> | undefined;
763
- } | undefined;
764
- memory?: {
765
- scope?: "caller" | "call" | "account" | "participant" | "platform" | undefined;
766
- retentionDays?: number | undefined;
767
- piiFields?: string[] | undefined;
768
- } | undefined;
769
- prompts?: {
770
- id: string;
771
- text: string;
772
- }[] | undefined;
773
- triggers?: {
774
- then: string;
775
- name: string;
776
- on: string;
777
- onlyWhile?: string | undefined;
778
- }[] | undefined;
779
- tools?: {
780
- name: string;
781
- description: string;
782
- input: Record<string, "string" | "number" | "boolean">;
783
- url: string;
784
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
785
- auth: "none" | "connection";
786
- headers?: Record<string, string> | undefined;
787
- connectionRef?: string | undefined;
788
- }[] | undefined;
789
- program?: {
790
- v: 1;
791
- id: string;
792
- nodes: Record<string, {
793
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
794
- id: string;
795
- config: Record<string, unknown>;
796
- out: {
797
- to: string;
798
- sourceHandle?: string | undefined;
799
- label?: string | undefined;
800
- condition?: string | undefined;
801
- }[];
802
- }>;
803
- entry: string[];
804
- completionGate: {
805
- requiredFields: string[];
806
- };
807
- diagnostics?: {
808
- acyclic: boolean;
809
- droppedEdges: string[];
810
- unsupportedNodes: string[];
811
- } | undefined;
812
- } | undefined;
813
- }>>>;
814
- createdAt: z.ZodString;
815
- updatedAt: z.ZodString;
816
- }, "strip", z.ZodTypeAny, {
817
- status: "online" | "offline" | "degraded";
818
- id: string;
819
- projectId: string;
820
- name: string;
821
- createdAt: string;
822
- updatedAt: string;
823
- version: string;
824
- environment: "dev" | "stg" | "prd";
825
- statusDetail: string | null;
826
- capabilities: string[];
827
- readiness: {
828
- probe: string;
829
- ok: boolean;
830
- detail?: string | undefined;
831
- }[];
832
- metadata: Record<string, unknown>;
833
- lastSeenAt: string | null;
834
- processSchema?: {
835
- id: string;
836
- completionGate: {
837
- requiredFields: string[];
838
- backendAck?: {
839
- url: string;
840
- timeoutMs: number;
841
- } | undefined;
842
- };
843
- fields: {
844
- type: "string" | "number" | "boolean" | "string[]" | "datetime" | "email" | "phone";
845
- name: string;
846
- required: boolean;
847
- ask?: string | undefined;
848
- pattern?: string | undefined;
849
- min?: number | undefined;
850
- max?: number | undefined;
851
- enum?: string[] | undefined;
852
- }[];
853
- handoff?: {
854
- fallback?: string | undefined;
855
- routes?: Record<string, string> | undefined;
856
- } | undefined;
857
- memory?: {
858
- scope?: "caller" | "call" | "account" | "participant" | "platform" | undefined;
859
- retentionDays?: number | undefined;
860
- piiFields?: string[] | undefined;
861
- } | undefined;
862
- prompts?: {
863
- id: string;
864
- text: string;
865
- }[] | undefined;
866
- triggers?: {
867
- then: string;
868
- name: string;
869
- on: string;
870
- onlyWhile?: string | undefined;
871
- }[] | undefined;
872
- tools?: {
873
- name: string;
874
- description: string;
875
- input: Record<string, "string" | "number" | "boolean">;
876
- url: string;
877
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
878
- auth: "none" | "connection";
879
- headers?: Record<string, string> | undefined;
880
- connectionRef?: string | undefined;
881
- }[] | undefined;
882
- program?: {
883
- v: 1;
884
- id: string;
885
- nodes: Record<string, {
886
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
887
- id: string;
888
- config: Record<string, unknown>;
889
- out: {
890
- to: string;
891
- sourceHandle?: string | undefined;
892
- label?: string | undefined;
893
- condition?: string | undefined;
894
- }[];
895
- }>;
896
- entry: string[];
897
- completionGate: {
898
- requiredFields: string[];
899
- };
900
- diagnostics?: {
901
- acyclic: boolean;
902
- droppedEdges: string[];
903
- unsupportedNodes: string[];
904
- } | undefined;
905
- } | undefined;
906
- } | null | undefined;
907
- }, {
908
- status: "online" | "offline" | "degraded";
909
- id: string;
910
- projectId: string;
911
- name: string;
912
- createdAt: string;
913
- updatedAt: string;
914
- version: string;
915
- environment: "dev" | "stg" | "prd";
916
- statusDetail: string | null;
917
- capabilities: string[];
918
- readiness: {
919
- probe: string;
920
- ok: boolean;
921
- detail?: string | undefined;
922
- }[];
923
- metadata: Record<string, unknown>;
924
- lastSeenAt: string | null;
925
- processSchema?: {
926
- id: string;
927
- completionGate: {
928
- requiredFields: string[];
929
- backendAck?: {
930
- url: string;
931
- timeoutMs: number;
932
- } | undefined;
933
- };
934
- fields: {
935
- type: "string" | "number" | "boolean" | "string[]" | "datetime" | "email" | "phone";
936
- name: string;
937
- required: boolean;
938
- ask?: string | undefined;
939
- pattern?: string | undefined;
940
- min?: number | undefined;
941
- max?: number | undefined;
942
- enum?: string[] | undefined;
943
- }[];
944
- handoff?: {
945
- fallback?: string | undefined;
946
- routes?: Record<string, string> | undefined;
947
- } | undefined;
948
- memory?: {
949
- scope?: "caller" | "call" | "account" | "participant" | "platform" | undefined;
950
- retentionDays?: number | undefined;
951
- piiFields?: string[] | undefined;
952
- } | undefined;
953
- prompts?: {
954
- id: string;
955
- text: string;
956
- }[] | undefined;
957
- triggers?: {
958
- then: string;
959
- name: string;
960
- on: string;
961
- onlyWhile?: string | undefined;
962
- }[] | undefined;
963
- tools?: {
964
- name: string;
965
- description: string;
966
- input: Record<string, "string" | "number" | "boolean">;
967
- url: string;
968
- method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
969
- auth: "none" | "connection";
970
- headers?: Record<string, string> | undefined;
971
- connectionRef?: string | undefined;
972
- }[] | undefined;
973
- program?: {
974
- v: 1;
975
- id: string;
976
- nodes: Record<string, {
977
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
978
- id: string;
979
- config: Record<string, unknown>;
980
- out: {
981
- to: string;
982
- sourceHandle?: string | undefined;
983
- label?: string | undefined;
984
- condition?: string | undefined;
985
- }[];
986
- }>;
987
- entry: string[];
988
- completionGate: {
989
- requiredFields: string[];
990
- };
991
- diagnostics?: {
992
- acyclic: boolean;
993
- droppedEdges: string[];
994
- unsupportedNodes: string[];
995
- } | undefined;
996
- } | undefined;
997
- } | null | undefined;
998
- }>;
999
- type AgentDTO = z.infer<typeof AgentDTO>;
1000
-
1001
7
  /**
1002
8
  * The plan itself. Everything the agent needs to run the call without the
1003
9
  * host being present turn-by-turn.
@@ -2901,6 +1907,17 @@ declare class AgentsClient {
2901
1907
  retentionDays?: number | undefined;
2902
1908
  piiFields?: string[] | undefined;
2903
1909
  } | undefined;
1910
+ speech?: {
1911
+ interruption?: {
1912
+ enabled?: boolean | undefined;
1913
+ minWords?: number | undefined;
1914
+ minDuration?: number | undefined;
1915
+ } | undefined;
1916
+ endpointing?: {
1917
+ minDelay?: number | undefined;
1918
+ maxDelay?: number | undefined;
1919
+ } | undefined;
1920
+ } | undefined;
2904
1921
  prompts?: {
2905
1922
  id: string;
2906
1923
  text: string;
@@ -2925,7 +1942,7 @@ declare class AgentsClient {
2925
1942
  v: 1;
2926
1943
  id: string;
2927
1944
  nodes: Record<string, {
2928
- type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "classify" | "router" | "note";
1945
+ type: "code" | "start" | "say" | "ask" | "confirm" | "tool" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "llm" | "rag" | "memory" | "speech" | "classify" | "router" | "note";
2929
1946
  id: string;
2930
1947
  config: Record<string, unknown>;
2931
1948
  out: {
@@ -3087,15 +2104,18 @@ declare class CallsClient {
3087
2104
  reportUsage(callId: string, report: CallUsageReport): Promise<void>;
3088
2105
  appendDtmfEvent(callId: string, input: AppendDtmfEventInput): Promise<void>;
3089
2106
  /**
3090
- * Append a structured call event. Today the API accepts consultation
3091
- * lifecycle kinds only — see apps/api/src/routes/calls.ts AppendEventBody.
2107
+ * Append a structured call event — consultation lifecycle kinds, or the
2108
+ * operational vocabulary the call-detail Timeline renders between
2109
+ * transcript rows (tool.* / handoff.* / lookup.* / record.* / notify.*).
2110
+ * See apps/api/src/routes/calls.ts AppendEventBody for the accepted shapes.
3092
2111
  *
3093
2112
  * The agent SDK's built-in `ask_host` tool calls this on consultation start
3094
- * / end so the MCP host (via SSE) and dashboard see the "let me check" UX
3095
- * in real time.
2113
+ * / end; the handoff runtime and graph interpreter emit op events through it
2114
+ * so the operational story (dial → answered → briefed → dropped, tool calls)
2115
+ * is visible in the dashboard, not just the spoken transcript.
3096
2116
  */
3097
2117
  appendEvent(callId: string, input: {
3098
- readonly kind: 'consultation.requested' | 'consultation.resolved';
2118
+ readonly kind: 'consultation.requested' | 'consultation.resolved' | `tool.${string}` | `handoff.${string}` | `lookup.${string}` | `record.${string}` | `notify.${string}`;
3099
2119
  readonly payload: Record<string, unknown>;
3100
2120
  }): Promise<void>;
3101
2121
  }
@@ -4342,6 +3362,9 @@ interface CompiledAgentParts {
4342
3362
  readonly handoff?: HandoffConfig;
4343
3363
  readonly memory?: MemoryConfig;
4344
3364
  readonly tools?: Record<string, ToolDefinition$1>;
3365
+ /** Voice turn-taking from the flow's speech capability (schema.speech →
3366
+ * AgentConfig.speech → applySpeechTurnHandling). */
3367
+ readonly speech?: SpeechConfig;
4345
3368
  }
4346
3369
  /**
4347
3370
  * Turn a compiled ProcessSchemaDTO into the full set of `defineAgent` parts a