@voicelayer/sdk 0.6.0 → 0.6.2

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,5 +1,5 @@
1
- import { A as AgentEnvironment, P as ProcessSchemaDTO, R as ReadinessProbe, a as AgentLifecycleEvent, b as AgentDTO, c as AgentEventEmitter, T as ToolDefinition, d as AgentConfig$1, e as ProcessField, M as ModelConfig, C as ConnectorInstance, f as ProviderFactory, S as STTProvider, g as TTSProvider, L as LLMProvider, h as RealtimeProvider, i as TurnDetectorProvider, V as VADProvider, j as ProcessDefinition, k as TriggerDefinition, H as HandoffConfig, l as MemoryConfig, m as SpeechConfig, n as ToolExecutor, o as AgentContext, p as ToolRunInfo, q as HostLookup } from './text-session-CoyEcdmg.js';
2
- export { r as AgentEventListener, s as AgentTurnEvent, t as AudioProfile, u as AudioSurface, v as CallInfo, w as CallOutcomeSummary, x as ChannelKind, y as CompletionStrategy, z as ComplianceTag, B as ConsultationPolicy, D as DtmfEvent, E as DtmfHandler, F as EndCallControllerHandle, G as EndCallInfo, I as EndCallOutcome, J as EndCallPolicy, K as EndCallTrigger, N as EndpointingConfig, O as FakeSessionAdapter, Q as FloorControlConfig, U as InboundOptions, W as InferProcessData, X as InterruptionConfig, Y as LK_AGENT_STATE_MAP, Z as MemoryHandle, _ as MemoryScope, $ as MetricsEvent, a0 as NON_BUSY_STATES, a1 as Participant, a2 as ParticipantId, a3 as ParticipantKind, a4 as ParticipantSet, a5 as ParticipantsConfig, a6 as ProcessBackendAck, a7 as ProcessFieldType, a8 as ProcessSnapshot, a9 as ReadinessReport, aa as ReadinessResult, ab as RespondOptions, ac as Room, ad as RouteEntry, ae as RoutingRule, af as RoutingSnapshot, ag as RunTextSessionOptions, ah as RunTextTranscriptOptions, ai as SayOptions, aj as SecurityConfig, ak as SendDtmfOptions, al as SessionAdapter, am as SessionCapabilities, an as SessionErrorEvent, ao as SessionEvent, ap as SessionEventMap, aq as SessionFactory, ar as SessionFactoryInput, as as SessionOutbound, at as SessionState, au as ShorthandPrimitive, av as SpeechResult, aw as SpeechTarget, ax as StateChangeEvent, ay as TextSession, az as TextTranscriptResult, aA as ToolInputShape, aB as TriggerAction, aC as TriggerCondition, aD as TtsVoiceConfig, aE as TurnEvent, aF as Unsubscribe, aG as UserInputEvent, aH as UserStateEvent, aI as UserTurn, aJ as VoiceLayerAuthError, aK as VoiceLayerError, aL as VoiceLayerHttpError, aM as VoiceLayerNetworkError, aN as VoiceLayerValidationError, aO as applySpeechTurnHandling, aP as asyncProbe, aQ as defineProcess, aR as dtmfCodeToDigit, aS as dtmfDigitToCode, aT as duck, aU as envProbe, aV as mute, aW as normalizeState, a2 as participantId, aX as passthrough, aY as runProbes, aZ as runTextSession, a_ as runTextTranscript, a$ as transform, b0 as urlProbe } from './text-session-CoyEcdmg.js';
1
+ import { A as AgentEnvironment, P as ProcessSchemaDTO, R as ReadinessProbe, a as AgentLifecycleEvent, b as AgentDTO, c as AgentEventEmitter, T as ToolDefinition, d as AgentConfig$1, e as ProcessField, M as ModelConfig, C as ConnectorInstance, f as ProviderFactory, S as STTProvider, g as TTSProvider, L as LLMProvider, h as RealtimeProvider, i as TurnDetectorProvider, V as VADProvider, j as ProcessDefinition, k as TriggerDefinition, H as HandoffConfig, l as MemoryConfig, m as SpeechConfig, n as ToolExecutor, o as AgentContext, p as ToolRunInfo, q as HostLookup } from './text-session-B-T33y5P.js';
2
+ export { r as AgentEventListener, s as AgentTurnEvent, t as AudioProfile, u as AudioSurface, v as CallInfo, w as CallOutcomeSummary, x as ChannelKind, y as CompletionStrategy, z as ComplianceTag, B as ConsultationPolicy, D as DtmfEvent, E as DtmfHandler, F as EndCallControllerHandle, G as EndCallInfo, I as EndCallOutcome, J as EndCallPolicy, K as EndCallTrigger, N as EndpointingConfig, O as FakeSessionAdapter, Q as FloorControlConfig, U as InboundOptions, W as InferProcessData, X as InterruptionConfig, Y as LK_AGENT_STATE_MAP, Z as MemoryHandle, _ as MemoryScope, $ as MetricsEvent, a0 as NON_BUSY_STATES, a1 as Participant, a2 as ParticipantId, a3 as ParticipantKind, a4 as ParticipantSet, a5 as ParticipantsConfig, a6 as ProcessBackendAck, a7 as ProcessFieldType, a8 as ProcessSnapshot, a9 as ReadinessReport, aa as ReadinessResult, ab as RespondOptions, ac as Room, ad as RouteEntry, ae as RoutingRule, af as RoutingSnapshot, ag as RunTextSessionOptions, ah as RunTextTranscriptOptions, ai as SayOptions, aj as SecurityConfig, ak as SendDtmfOptions, al as SessionAdapter, am as SessionCapabilities, an as SessionErrorEvent, ao as SessionEvent, ap as SessionEventMap, aq as SessionFactory, ar as SessionFactoryInput, as as SessionOutbound, at as SessionState, au as ShorthandPrimitive, av as SpeechResult, aw as SpeechTarget, ax as StateChangeEvent, ay as TextSession, az as TextTranscriptResult, aA as ToolInputShape, aB as TriggerAction, aC as TriggerCondition, aD as TtsVoiceConfig, aE as TurnEvent, aF as Unsubscribe, aG as UserInputEvent, aH as UserStateEvent, aI as UserTurn, aJ as VoiceLayerAuthError, aK as VoiceLayerError, aL as VoiceLayerHttpError, aM as VoiceLayerNetworkError, aN as VoiceLayerValidationError, aO as applySpeechTurnHandling, aP as asyncProbe, aQ as defineProcess, aR as dtmfCodeToDigit, aS as dtmfDigitToCode, aT as duck, aU as envProbe, aV as mute, aW as normalizeState, a2 as participantId, aX as passthrough, aY as runProbes, aZ as runTextSession, a_ as runTextTranscript, a$ as transform, b0 as urlProbe } from './text-session-B-T33y5P.js';
3
3
  import { z, ZodType } from 'zod';
4
4
  import { O as OnQuery, B as BrainTransport } from './types-KqrAfY85.js';
5
5
  export { a as BrainCallMetadata, b as BrainCapabilities, c as BrainChunk, d as BrainMessage, e as BrainRequest, f as OnQueryContext, g as OnQueryResult } from './types-KqrAfY85.js';
@@ -33,10 +33,10 @@ declare const TextTurn: z.ZodObject<{
33
33
  deadlineAt: z.ZodString;
34
34
  }, "strip", z.ZodTypeAny, {
35
35
  text: string;
36
+ from: string;
36
37
  agentId: string;
37
38
  turnId: string;
38
39
  channel: string;
39
- from: string;
40
40
  conversationKey: string;
41
41
  history: {
42
42
  role: "user" | "assistant";
@@ -45,10 +45,10 @@ declare const TextTurn: z.ZodObject<{
45
45
  deadlineAt: string;
46
46
  }, {
47
47
  text: string;
48
+ from: string;
48
49
  agentId: string;
49
50
  turnId: string;
50
51
  channel: string;
51
- from: string;
52
52
  conversationKey: string;
53
53
  history: {
54
54
  role: "user" | "assistant";
@@ -81,8 +81,8 @@ declare const TextTurnReply: z.ZodUnion<[z.ZodObject<{
81
81
  byok: boolean;
82
82
  }>, "many">>;
83
83
  }, "strip", z.ZodTypeAny, {
84
- agentId: string;
85
84
  replies: string[];
85
+ agentId: string;
86
86
  usage: {
87
87
  provider: string;
88
88
  model: string;
@@ -91,8 +91,8 @@ declare const TextTurnReply: z.ZodUnion<[z.ZodObject<{
91
91
  byok: boolean;
92
92
  }[];
93
93
  }, {
94
- agentId: string;
95
94
  replies: string[];
95
+ agentId: string;
96
96
  usage?: {
97
97
  provider: string;
98
98
  model: string;
@@ -150,61 +150,6 @@ declare const CallPlan: z.ZodObject<{
150
150
  e164?: string | undefined;
151
151
  }>;
152
152
  draftConfig: z.ZodDefault<z.ZodObject<{
153
- stt: z.ZodOptional<z.ZodOptional<z.ZodObject<{
154
- provider: z.ZodEnum<["deepgram", "cartesia", "assemblyai"]>;
155
- model: z.ZodOptional<z.ZodString>;
156
- language: z.ZodOptional<z.ZodString>;
157
- endOfTurnConfidence: z.ZodOptional<z.ZodNumber>;
158
- endOfTurnTimeoutMs: z.ZodOptional<z.ZodNumber>;
159
- keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
160
- }, "strip", z.ZodTypeAny, {
161
- provider: "deepgram" | "cartesia" | "assemblyai";
162
- model?: string | undefined;
163
- language?: string | undefined;
164
- endOfTurnConfidence?: number | undefined;
165
- endOfTurnTimeoutMs?: number | undefined;
166
- keywords?: string[] | undefined;
167
- }, {
168
- provider: "deepgram" | "cartesia" | "assemblyai";
169
- model?: string | undefined;
170
- language?: string | undefined;
171
- endOfTurnConfidence?: number | undefined;
172
- endOfTurnTimeoutMs?: number | undefined;
173
- keywords?: string[] | undefined;
174
- }>>>;
175
- realtime: z.ZodOptional<z.ZodOptional<z.ZodObject<{
176
- provider: z.ZodEnum<["openai", "google"]>;
177
- model: z.ZodString;
178
- voice: z.ZodOptional<z.ZodString>;
179
- temperature: z.ZodOptional<z.ZodNumber>;
180
- }, "strip", z.ZodTypeAny, {
181
- provider: "openai" | "google";
182
- model: string;
183
- voice?: string | undefined;
184
- temperature?: number | undefined;
185
- }, {
186
- provider: "openai" | "google";
187
- model: string;
188
- voice?: string | undefined;
189
- temperature?: number | undefined;
190
- }>>>;
191
- voice: z.ZodOptional<z.ZodObject<{
192
- provider: z.ZodEnum<["deepgram", "elevenlabs", "openai", "cartesia"]>;
193
- voiceId: z.ZodString;
194
- model: z.ZodOptional<z.ZodString>;
195
- rate: z.ZodOptional<z.ZodNumber>;
196
- }, "strip", z.ZodTypeAny, {
197
- provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
198
- voiceId: string;
199
- model?: string | undefined;
200
- rate?: number | undefined;
201
- }, {
202
- provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
203
- voiceId: string;
204
- model?: string | undefined;
205
- rate?: number | undefined;
206
- }>>;
207
- source: z.ZodOptional<z.ZodOptional<z.ZodEnum<["sdk", "flow", "playbook", "connector"]>>>;
208
153
  name: z.ZodOptional<z.ZodString>;
209
154
  triggers: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
210
155
  on: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
@@ -212,22 +157,22 @@ declare const CallPlan: z.ZodObject<{
212
157
  pattern: z.ZodString;
213
158
  flags: z.ZodOptional<z.ZodString>;
214
159
  }, "strip", z.ZodTypeAny, {
215
- kind: "regex";
216
160
  pattern: string;
161
+ kind: "regex";
217
162
  flags?: string | undefined;
218
163
  }, {
219
- kind: "regex";
220
164
  pattern: string;
165
+ kind: "regex";
221
166
  flags?: string | undefined;
222
167
  }>, z.ZodObject<{
223
168
  kind: z.ZodLiteral<"signal">;
224
169
  name: z.ZodString;
225
170
  }, "strip", z.ZodTypeAny, {
226
- kind: "signal";
227
171
  name: string;
228
- }, {
229
172
  kind: "signal";
173
+ }, {
230
174
  name: string;
175
+ kind: "signal";
231
176
  }>]>;
232
177
  then: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
233
178
  kind: z.ZodLiteral<"handoff">;
@@ -262,12 +207,12 @@ declare const CallPlan: z.ZodObject<{
262
207
  kind: "say";
263
208
  };
264
209
  on: {
265
- kind: "regex";
266
210
  pattern: string;
211
+ kind: "regex";
267
212
  flags?: string | undefined;
268
213
  } | {
269
- kind: "signal";
270
214
  name: string;
215
+ kind: "signal";
271
216
  };
272
217
  onlyWhile?: string | undefined;
273
218
  }, {
@@ -280,12 +225,12 @@ declare const CallPlan: z.ZodObject<{
280
225
  kind: "say";
281
226
  };
282
227
  on: {
283
- kind: "regex";
284
228
  pattern: string;
229
+ kind: "regex";
285
230
  flags?: string | undefined;
286
231
  } | {
287
- kind: "signal";
288
232
  name: string;
233
+ kind: "signal";
289
234
  };
290
235
  onlyWhile?: string | undefined;
291
236
  }>>>>;
@@ -299,6 +244,61 @@ declare const CallPlan: z.ZodObject<{
299
244
  toolName: string;
300
245
  defaultArgs?: Record<string, unknown> | undefined;
301
246
  }>, "many">>>;
247
+ stt: z.ZodOptional<z.ZodOptional<z.ZodObject<{
248
+ provider: z.ZodEnum<["deepgram", "cartesia", "assemblyai"]>;
249
+ model: z.ZodOptional<z.ZodString>;
250
+ language: z.ZodOptional<z.ZodString>;
251
+ endOfTurnConfidence: z.ZodOptional<z.ZodNumber>;
252
+ endOfTurnTimeoutMs: z.ZodOptional<z.ZodNumber>;
253
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
254
+ }, "strip", z.ZodTypeAny, {
255
+ provider: "deepgram" | "cartesia" | "assemblyai";
256
+ model?: string | undefined;
257
+ language?: string | undefined;
258
+ endOfTurnConfidence?: number | undefined;
259
+ endOfTurnTimeoutMs?: number | undefined;
260
+ keywords?: string[] | undefined;
261
+ }, {
262
+ provider: "deepgram" | "cartesia" | "assemblyai";
263
+ model?: string | undefined;
264
+ language?: string | undefined;
265
+ endOfTurnConfidence?: number | undefined;
266
+ endOfTurnTimeoutMs?: number | undefined;
267
+ keywords?: string[] | undefined;
268
+ }>>>;
269
+ realtime: z.ZodOptional<z.ZodOptional<z.ZodObject<{
270
+ provider: z.ZodEnum<["openai", "google"]>;
271
+ model: z.ZodString;
272
+ voice: z.ZodOptional<z.ZodString>;
273
+ temperature: z.ZodOptional<z.ZodNumber>;
274
+ }, "strip", z.ZodTypeAny, {
275
+ provider: "openai" | "google";
276
+ model: string;
277
+ voice?: string | undefined;
278
+ temperature?: number | undefined;
279
+ }, {
280
+ provider: "openai" | "google";
281
+ model: string;
282
+ voice?: string | undefined;
283
+ temperature?: number | undefined;
284
+ }>>>;
285
+ voice: z.ZodOptional<z.ZodObject<{
286
+ provider: z.ZodEnum<["deepgram", "elevenlabs", "openai", "cartesia"]>;
287
+ voiceId: z.ZodString;
288
+ model: z.ZodOptional<z.ZodString>;
289
+ rate: z.ZodOptional<z.ZodNumber>;
290
+ }, "strip", z.ZodTypeAny, {
291
+ provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
292
+ voiceId: string;
293
+ model?: string | undefined;
294
+ rate?: number | undefined;
295
+ }, {
296
+ provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
297
+ voiceId: string;
298
+ model?: string | undefined;
299
+ rate?: number | undefined;
300
+ }>>;
301
+ source: z.ZodOptional<z.ZodOptional<z.ZodEnum<["sdk", "flow", "playbook", "connector"]>>>;
302
302
  mode: z.ZodOptional<z.ZodDefault<z.ZodEnum<["cascade", "realtime"]>>>;
303
303
  model: z.ZodOptional<z.ZodObject<{
304
304
  provider: z.ZodEnum<["openai", "anthropic", "gemini"]>;
@@ -406,12 +406,12 @@ declare const CallPlan: z.ZodObject<{
406
406
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
407
407
  }, "strip", z.ZodTypeAny, {
408
408
  url: string;
409
- headers?: Record<string, string> | undefined;
410
409
  timeoutMs?: number | undefined;
410
+ headers?: Record<string, string> | undefined;
411
411
  }, {
412
412
  url: string;
413
- headers?: Record<string, string> | undefined;
414
413
  timeoutMs?: number | undefined;
414
+ headers?: Record<string, string> | undefined;
415
415
  }>>;
416
416
  }, "strip", z.ZodTypeAny, {
417
417
  collect: Record<string, {
@@ -427,14 +427,14 @@ declare const CallPlan: z.ZodObject<{
427
427
  completeWhen: "all-required-captured" | "all-captured";
428
428
  backendAck?: {
429
429
  url: string;
430
- headers?: Record<string, string> | undefined;
431
430
  timeoutMs?: number | undefined;
431
+ headers?: Record<string, string> | undefined;
432
432
  } | undefined;
433
433
  }, {
434
434
  backendAck?: {
435
435
  url: string;
436
- headers?: Record<string, string> | undefined;
437
436
  timeoutMs?: number | undefined;
437
+ headers?: Record<string, string> | undefined;
438
438
  } | undefined;
439
439
  collect?: Record<string, {
440
440
  type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
@@ -450,6 +450,58 @@ declare const CallPlan: z.ZodObject<{
450
450
  }>>>;
451
451
  tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
452
452
  brainConnectorId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
453
+ callLimits: z.ZodOptional<z.ZodOptional<z.ZodObject<{
454
+ maxDurationMinutes: z.ZodOptional<z.ZodNumber>;
455
+ wrapUpWarningSeconds: z.ZodOptional<z.ZodNumber>;
456
+ wrapUpMessage: z.ZodOptional<z.ZodString>;
457
+ goodbyeMessage: z.ZodOptional<z.ZodString>;
458
+ callerRateLimit: z.ZodOptional<z.ZodObject<{
459
+ enabled: z.ZodOptional<z.ZodBoolean>;
460
+ perTenMinutes: z.ZodOptional<z.ZodNumber>;
461
+ perDay: z.ZodOptional<z.ZodNumber>;
462
+ withheldPerTenMinutes: z.ZodOptional<z.ZodNumber>;
463
+ withheldPerDay: z.ZodOptional<z.ZodNumber>;
464
+ }, "strip", z.ZodTypeAny, {
465
+ enabled?: boolean | undefined;
466
+ perTenMinutes?: number | undefined;
467
+ perDay?: number | undefined;
468
+ withheldPerTenMinutes?: number | undefined;
469
+ withheldPerDay?: number | undefined;
470
+ }, {
471
+ enabled?: boolean | undefined;
472
+ perTenMinutes?: number | undefined;
473
+ perDay?: number | undefined;
474
+ withheldPerTenMinutes?: number | undefined;
475
+ withheldPerDay?: number | undefined;
476
+ }>>;
477
+ rateLimitedMessage: z.ZodOptional<z.ZodString>;
478
+ }, "strip", z.ZodTypeAny, {
479
+ maxDurationMinutes?: number | undefined;
480
+ wrapUpWarningSeconds?: number | undefined;
481
+ wrapUpMessage?: string | undefined;
482
+ goodbyeMessage?: string | undefined;
483
+ callerRateLimit?: {
484
+ enabled?: boolean | undefined;
485
+ perTenMinutes?: number | undefined;
486
+ perDay?: number | undefined;
487
+ withheldPerTenMinutes?: number | undefined;
488
+ withheldPerDay?: number | undefined;
489
+ } | undefined;
490
+ rateLimitedMessage?: string | undefined;
491
+ }, {
492
+ maxDurationMinutes?: number | undefined;
493
+ wrapUpWarningSeconds?: number | undefined;
494
+ wrapUpMessage?: string | undefined;
495
+ goodbyeMessage?: string | undefined;
496
+ callerRateLimit?: {
497
+ enabled?: boolean | undefined;
498
+ perTenMinutes?: number | undefined;
499
+ perDay?: number | undefined;
500
+ withheldPerTenMinutes?: number | undefined;
501
+ withheldPerDay?: number | undefined;
502
+ } | undefined;
503
+ rateLimitedMessage?: string | undefined;
504
+ }>>>;
453
505
  modeLocked: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
454
506
  requiredInfo: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
455
507
  name: z.ZodString;
@@ -472,27 +524,6 @@ declare const CallPlan: z.ZodObject<{
472
524
  }>, "many">>>;
473
525
  draftUpdatedAt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
474
526
  }, "strip", z.ZodTypeAny, {
475
- stt?: {
476
- provider: "deepgram" | "cartesia" | "assemblyai";
477
- model?: string | undefined;
478
- language?: string | undefined;
479
- endOfTurnConfidence?: number | undefined;
480
- endOfTurnTimeoutMs?: number | undefined;
481
- keywords?: string[] | undefined;
482
- } | undefined;
483
- realtime?: {
484
- provider: "openai" | "google";
485
- model: string;
486
- voice?: string | undefined;
487
- temperature?: number | undefined;
488
- } | undefined;
489
- voice?: {
490
- provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
491
- voiceId: string;
492
- model?: string | undefined;
493
- rate?: number | undefined;
494
- } | undefined;
495
- source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
496
527
  name?: string | undefined;
497
528
  triggers?: Record<string, {
498
529
  then: {
@@ -504,12 +535,12 @@ declare const CallPlan: z.ZodObject<{
504
535
  kind: "say";
505
536
  };
506
537
  on: {
507
- kind: "regex";
508
538
  pattern: string;
539
+ kind: "regex";
509
540
  flags?: string | undefined;
510
541
  } | {
511
- kind: "signal";
512
542
  name: string;
543
+ kind: "signal";
513
544
  };
514
545
  onlyWhile?: string | undefined;
515
546
  }> | undefined;
@@ -517,6 +548,27 @@ declare const CallPlan: z.ZodObject<{
517
548
  toolName: string;
518
549
  defaultArgs?: Record<string, unknown> | undefined;
519
550
  }[] | undefined;
551
+ stt?: {
552
+ provider: "deepgram" | "cartesia" | "assemblyai";
553
+ model?: string | undefined;
554
+ language?: string | undefined;
555
+ endOfTurnConfidence?: number | undefined;
556
+ endOfTurnTimeoutMs?: number | undefined;
557
+ keywords?: string[] | undefined;
558
+ } | undefined;
559
+ realtime?: {
560
+ provider: "openai" | "google";
561
+ model: string;
562
+ voice?: string | undefined;
563
+ temperature?: number | undefined;
564
+ } | undefined;
565
+ voice?: {
566
+ provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
567
+ voiceId: string;
568
+ model?: string | undefined;
569
+ rate?: number | undefined;
570
+ } | undefined;
571
+ source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
520
572
  mode?: "realtime" | "cascade" | undefined;
521
573
  model?: {
522
574
  provider: "openai" | "anthropic" | "gemini";
@@ -556,12 +608,26 @@ declare const CallPlan: z.ZodObject<{
556
608
  completeWhen: "all-required-captured" | "all-captured";
557
609
  backendAck?: {
558
610
  url: string;
559
- headers?: Record<string, string> | undefined;
560
611
  timeoutMs?: number | undefined;
612
+ headers?: Record<string, string> | undefined;
561
613
  } | undefined;
562
614
  } | undefined;
563
615
  tags?: string[] | undefined;
564
616
  brainConnectorId?: string | null | undefined;
617
+ callLimits?: {
618
+ maxDurationMinutes?: number | undefined;
619
+ wrapUpWarningSeconds?: number | undefined;
620
+ wrapUpMessage?: string | undefined;
621
+ goodbyeMessage?: string | undefined;
622
+ callerRateLimit?: {
623
+ enabled?: boolean | undefined;
624
+ perTenMinutes?: number | undefined;
625
+ perDay?: number | undefined;
626
+ withheldPerTenMinutes?: number | undefined;
627
+ withheldPerDay?: number | undefined;
628
+ } | undefined;
629
+ rateLimitedMessage?: string | undefined;
630
+ } | undefined;
565
631
  modeLocked?: boolean | undefined;
566
632
  requiredInfo?: {
567
633
  type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
@@ -572,27 +638,6 @@ declare const CallPlan: z.ZodObject<{
572
638
  }[] | undefined;
573
639
  draftUpdatedAt?: string | undefined;
574
640
  }, {
575
- stt?: {
576
- provider: "deepgram" | "cartesia" | "assemblyai";
577
- model?: string | undefined;
578
- language?: string | undefined;
579
- endOfTurnConfidence?: number | undefined;
580
- endOfTurnTimeoutMs?: number | undefined;
581
- keywords?: string[] | undefined;
582
- } | undefined;
583
- realtime?: {
584
- provider: "openai" | "google";
585
- model: string;
586
- voice?: string | undefined;
587
- temperature?: number | undefined;
588
- } | undefined;
589
- voice?: {
590
- provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
591
- voiceId: string;
592
- model?: string | undefined;
593
- rate?: number | undefined;
594
- } | undefined;
595
- source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
596
641
  name?: string | undefined;
597
642
  triggers?: Record<string, {
598
643
  then: {
@@ -604,12 +649,12 @@ declare const CallPlan: z.ZodObject<{
604
649
  kind: "say";
605
650
  };
606
651
  on: {
607
- kind: "regex";
608
652
  pattern: string;
653
+ kind: "regex";
609
654
  flags?: string | undefined;
610
655
  } | {
611
- kind: "signal";
612
656
  name: string;
657
+ kind: "signal";
613
658
  };
614
659
  onlyWhile?: string | undefined;
615
660
  }> | undefined;
@@ -617,6 +662,27 @@ declare const CallPlan: z.ZodObject<{
617
662
  toolName: string;
618
663
  defaultArgs?: Record<string, unknown> | undefined;
619
664
  }[] | undefined;
665
+ stt?: {
666
+ provider: "deepgram" | "cartesia" | "assemblyai";
667
+ model?: string | undefined;
668
+ language?: string | undefined;
669
+ endOfTurnConfidence?: number | undefined;
670
+ endOfTurnTimeoutMs?: number | undefined;
671
+ keywords?: string[] | undefined;
672
+ } | undefined;
673
+ realtime?: {
674
+ provider: "openai" | "google";
675
+ model: string;
676
+ voice?: string | undefined;
677
+ temperature?: number | undefined;
678
+ } | undefined;
679
+ voice?: {
680
+ provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
681
+ voiceId: string;
682
+ model?: string | undefined;
683
+ rate?: number | undefined;
684
+ } | undefined;
685
+ source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
620
686
  mode?: "realtime" | "cascade" | undefined;
621
687
  model?: {
622
688
  provider: "openai" | "anthropic" | "gemini";
@@ -645,8 +711,8 @@ declare const CallPlan: z.ZodObject<{
645
711
  process?: {
646
712
  backendAck?: {
647
713
  url: string;
648
- headers?: Record<string, string> | undefined;
649
714
  timeoutMs?: number | undefined;
715
+ headers?: Record<string, string> | undefined;
650
716
  } | undefined;
651
717
  collect?: Record<string, {
652
718
  type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
@@ -662,6 +728,20 @@ declare const CallPlan: z.ZodObject<{
662
728
  } | undefined;
663
729
  tags?: string[] | undefined;
664
730
  brainConnectorId?: string | null | undefined;
731
+ callLimits?: {
732
+ maxDurationMinutes?: number | undefined;
733
+ wrapUpWarningSeconds?: number | undefined;
734
+ wrapUpMessage?: string | undefined;
735
+ goodbyeMessage?: string | undefined;
736
+ callerRateLimit?: {
737
+ enabled?: boolean | undefined;
738
+ perTenMinutes?: number | undefined;
739
+ perDay?: number | undefined;
740
+ withheldPerTenMinutes?: number | undefined;
741
+ withheldPerDay?: number | undefined;
742
+ } | undefined;
743
+ rateLimitedMessage?: string | undefined;
744
+ } | undefined;
665
745
  modeLocked?: boolean | undefined;
666
746
  requiredInfo?: {
667
747
  type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
@@ -679,14 +759,14 @@ declare const CallPlan: z.ZodObject<{
679
759
  options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
680
760
  deferrableToCallee: z.ZodDefault<z.ZodBoolean>;
681
761
  }, "strip", z.ZodTypeAny, {
682
- kind: "decision" | "auth" | "fact";
683
762
  id: string;
763
+ kind: "decision" | "auth" | "fact";
684
764
  prompt: string;
685
765
  deferrableToCallee: boolean;
686
766
  options?: string[] | undefined;
687
767
  }, {
688
- kind: "decision" | "auth" | "fact";
689
768
  id: string;
769
+ kind: "decision" | "auth" | "fact";
690
770
  prompt: string;
691
771
  options?: string[] | undefined;
692
772
  deferrableToCallee?: boolean | undefined;
@@ -698,14 +778,14 @@ declare const CallPlan: z.ZodObject<{
698
778
  options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
699
779
  deferrableToCallee: z.ZodDefault<z.ZodBoolean>;
700
780
  }, "strip", z.ZodTypeAny, {
701
- kind: "decision" | "auth" | "fact";
702
781
  id: string;
782
+ kind: "decision" | "auth" | "fact";
703
783
  prompt: string;
704
784
  deferrableToCallee: boolean;
705
785
  options?: string[] | undefined;
706
786
  }, {
707
- kind: "decision" | "auth" | "fact";
708
787
  id: string;
788
+ kind: "decision" | "auth" | "fact";
709
789
  prompt: string;
710
790
  options?: string[] | undefined;
711
791
  deferrableToCallee?: boolean | undefined;
@@ -743,27 +823,6 @@ declare const CallPlan: z.ZodObject<{
743
823
  e164?: string | undefined;
744
824
  };
745
825
  draftConfig: {
746
- stt?: {
747
- provider: "deepgram" | "cartesia" | "assemblyai";
748
- model?: string | undefined;
749
- language?: string | undefined;
750
- endOfTurnConfidence?: number | undefined;
751
- endOfTurnTimeoutMs?: number | undefined;
752
- keywords?: string[] | undefined;
753
- } | undefined;
754
- realtime?: {
755
- provider: "openai" | "google";
756
- model: string;
757
- voice?: string | undefined;
758
- temperature?: number | undefined;
759
- } | undefined;
760
- voice?: {
761
- provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
762
- voiceId: string;
763
- model?: string | undefined;
764
- rate?: number | undefined;
765
- } | undefined;
766
- source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
767
826
  name?: string | undefined;
768
827
  triggers?: Record<string, {
769
828
  then: {
@@ -775,12 +834,12 @@ declare const CallPlan: z.ZodObject<{
775
834
  kind: "say";
776
835
  };
777
836
  on: {
778
- kind: "regex";
779
837
  pattern: string;
838
+ kind: "regex";
780
839
  flags?: string | undefined;
781
840
  } | {
782
- kind: "signal";
783
841
  name: string;
842
+ kind: "signal";
784
843
  };
785
844
  onlyWhile?: string | undefined;
786
845
  }> | undefined;
@@ -788,6 +847,27 @@ declare const CallPlan: z.ZodObject<{
788
847
  toolName: string;
789
848
  defaultArgs?: Record<string, unknown> | undefined;
790
849
  }[] | undefined;
850
+ stt?: {
851
+ provider: "deepgram" | "cartesia" | "assemblyai";
852
+ model?: string | undefined;
853
+ language?: string | undefined;
854
+ endOfTurnConfidence?: number | undefined;
855
+ endOfTurnTimeoutMs?: number | undefined;
856
+ keywords?: string[] | undefined;
857
+ } | undefined;
858
+ realtime?: {
859
+ provider: "openai" | "google";
860
+ model: string;
861
+ voice?: string | undefined;
862
+ temperature?: number | undefined;
863
+ } | undefined;
864
+ voice?: {
865
+ provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
866
+ voiceId: string;
867
+ model?: string | undefined;
868
+ rate?: number | undefined;
869
+ } | undefined;
870
+ source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
791
871
  mode?: "realtime" | "cascade" | undefined;
792
872
  model?: {
793
873
  provider: "openai" | "anthropic" | "gemini";
@@ -827,12 +907,26 @@ declare const CallPlan: z.ZodObject<{
827
907
  completeWhen: "all-required-captured" | "all-captured";
828
908
  backendAck?: {
829
909
  url: string;
830
- headers?: Record<string, string> | undefined;
831
910
  timeoutMs?: number | undefined;
911
+ headers?: Record<string, string> | undefined;
832
912
  } | undefined;
833
913
  } | undefined;
834
914
  tags?: string[] | undefined;
835
915
  brainConnectorId?: string | null | undefined;
916
+ callLimits?: {
917
+ maxDurationMinutes?: number | undefined;
918
+ wrapUpWarningSeconds?: number | undefined;
919
+ wrapUpMessage?: string | undefined;
920
+ goodbyeMessage?: string | undefined;
921
+ callerRateLimit?: {
922
+ enabled?: boolean | undefined;
923
+ perTenMinutes?: number | undefined;
924
+ perDay?: number | undefined;
925
+ withheldPerTenMinutes?: number | undefined;
926
+ withheldPerDay?: number | undefined;
927
+ } | undefined;
928
+ rateLimitedMessage?: string | undefined;
929
+ } | undefined;
836
930
  modeLocked?: boolean | undefined;
837
931
  requiredInfo?: {
838
932
  type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
@@ -844,15 +938,15 @@ declare const CallPlan: z.ZodObject<{
844
938
  draftUpdatedAt?: string | undefined;
845
939
  };
846
940
  openQuestions: {
847
- kind: "decision" | "auth" | "fact";
848
941
  id: string;
942
+ kind: "decision" | "auth" | "fact";
849
943
  prompt: string;
850
944
  deferrableToCallee: boolean;
851
945
  options?: string[] | undefined;
852
946
  }[];
853
947
  unresolvedQuestions: {
854
- kind: "decision" | "auth" | "fact";
855
948
  id: string;
949
+ kind: "decision" | "auth" | "fact";
856
950
  prompt: string;
857
951
  deferrableToCallee: boolean;
858
952
  options?: string[] | undefined;
@@ -884,27 +978,6 @@ declare const CallPlan: z.ZodObject<{
884
978
  secondary?: "ask_callee" | "fallback_phrase" | undefined;
885
979
  };
886
980
  draftConfig?: {
887
- stt?: {
888
- provider: "deepgram" | "cartesia" | "assemblyai";
889
- model?: string | undefined;
890
- language?: string | undefined;
891
- endOfTurnConfidence?: number | undefined;
892
- endOfTurnTimeoutMs?: number | undefined;
893
- keywords?: string[] | undefined;
894
- } | undefined;
895
- realtime?: {
896
- provider: "openai" | "google";
897
- model: string;
898
- voice?: string | undefined;
899
- temperature?: number | undefined;
900
- } | undefined;
901
- voice?: {
902
- provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
903
- voiceId: string;
904
- model?: string | undefined;
905
- rate?: number | undefined;
906
- } | undefined;
907
- source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
908
981
  name?: string | undefined;
909
982
  triggers?: Record<string, {
910
983
  then: {
@@ -916,12 +989,12 @@ declare const CallPlan: z.ZodObject<{
916
989
  kind: "say";
917
990
  };
918
991
  on: {
919
- kind: "regex";
920
992
  pattern: string;
993
+ kind: "regex";
921
994
  flags?: string | undefined;
922
995
  } | {
923
- kind: "signal";
924
996
  name: string;
997
+ kind: "signal";
925
998
  };
926
999
  onlyWhile?: string | undefined;
927
1000
  }> | undefined;
@@ -929,6 +1002,27 @@ declare const CallPlan: z.ZodObject<{
929
1002
  toolName: string;
930
1003
  defaultArgs?: Record<string, unknown> | undefined;
931
1004
  }[] | undefined;
1005
+ stt?: {
1006
+ provider: "deepgram" | "cartesia" | "assemblyai";
1007
+ model?: string | undefined;
1008
+ language?: string | undefined;
1009
+ endOfTurnConfidence?: number | undefined;
1010
+ endOfTurnTimeoutMs?: number | undefined;
1011
+ keywords?: string[] | undefined;
1012
+ } | undefined;
1013
+ realtime?: {
1014
+ provider: "openai" | "google";
1015
+ model: string;
1016
+ voice?: string | undefined;
1017
+ temperature?: number | undefined;
1018
+ } | undefined;
1019
+ voice?: {
1020
+ provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
1021
+ voiceId: string;
1022
+ model?: string | undefined;
1023
+ rate?: number | undefined;
1024
+ } | undefined;
1025
+ source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
932
1026
  mode?: "realtime" | "cascade" | undefined;
933
1027
  model?: {
934
1028
  provider: "openai" | "anthropic" | "gemini";
@@ -957,8 +1051,8 @@ declare const CallPlan: z.ZodObject<{
957
1051
  process?: {
958
1052
  backendAck?: {
959
1053
  url: string;
960
- headers?: Record<string, string> | undefined;
961
1054
  timeoutMs?: number | undefined;
1055
+ headers?: Record<string, string> | undefined;
962
1056
  } | undefined;
963
1057
  collect?: Record<string, {
964
1058
  type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
@@ -974,6 +1068,20 @@ declare const CallPlan: z.ZodObject<{
974
1068
  } | undefined;
975
1069
  tags?: string[] | undefined;
976
1070
  brainConnectorId?: string | null | undefined;
1071
+ callLimits?: {
1072
+ maxDurationMinutes?: number | undefined;
1073
+ wrapUpWarningSeconds?: number | undefined;
1074
+ wrapUpMessage?: string | undefined;
1075
+ goodbyeMessage?: string | undefined;
1076
+ callerRateLimit?: {
1077
+ enabled?: boolean | undefined;
1078
+ perTenMinutes?: number | undefined;
1079
+ perDay?: number | undefined;
1080
+ withheldPerTenMinutes?: number | undefined;
1081
+ withheldPerDay?: number | undefined;
1082
+ } | undefined;
1083
+ rateLimitedMessage?: string | undefined;
1084
+ } | undefined;
977
1085
  modeLocked?: boolean | undefined;
978
1086
  requiredInfo?: {
979
1087
  type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
@@ -985,15 +1093,15 @@ declare const CallPlan: z.ZodObject<{
985
1093
  draftUpdatedAt?: string | undefined;
986
1094
  } | undefined;
987
1095
  openQuestions?: {
988
- kind: "decision" | "auth" | "fact";
989
1096
  id: string;
1097
+ kind: "decision" | "auth" | "fact";
990
1098
  prompt: string;
991
1099
  options?: string[] | undefined;
992
1100
  deferrableToCallee?: boolean | undefined;
993
1101
  }[] | undefined;
994
1102
  unresolvedQuestions?: {
995
- kind: "decision" | "auth" | "fact";
996
1103
  id: string;
1104
+ kind: "decision" | "auth" | "fact";
997
1105
  prompt: string;
998
1106
  options?: string[] | undefined;
999
1107
  deferrableToCallee?: boolean | undefined;
@@ -1011,13 +1119,13 @@ declare const RelevantContext: z.ZodObject<{
1011
1119
  account: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1012
1120
  platform: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1013
1121
  }, "strip", z.ZodTypeAny, {
1014
- caller: Record<string, unknown>;
1015
1122
  call: Record<string, unknown>;
1123
+ caller: Record<string, unknown>;
1016
1124
  account: Record<string, unknown>;
1017
1125
  platform: Record<string, unknown>;
1018
1126
  }, {
1019
- caller: Record<string, unknown>;
1020
1127
  call: Record<string, unknown>;
1128
+ caller: Record<string, unknown>;
1021
1129
  account: Record<string, unknown>;
1022
1130
  platform: Record<string, unknown>;
1023
1131
  }>;
@@ -1033,38 +1141,38 @@ declare const ResolveCallerResponse: z.ZodObject<{
1033
1141
  updatedAt: z.ZodString;
1034
1142
  }, "strip", z.ZodTypeAny, {
1035
1143
  id: string;
1144
+ displayName: string | null;
1036
1145
  projectId: string;
1037
1146
  createdAt: string;
1038
1147
  updatedAt: string;
1039
- displayName: string | null;
1040
1148
  metadata: Record<string, unknown>;
1041
1149
  externalKey: string;
1042
1150
  }, {
1043
1151
  id: string;
1152
+ displayName: string | null;
1044
1153
  projectId: string;
1045
1154
  createdAt: string;
1046
1155
  updatedAt: string;
1047
- displayName: string | null;
1048
1156
  metadata: Record<string, unknown>;
1049
1157
  externalKey: string;
1050
1158
  }>;
1051
1159
  }, "strip", z.ZodTypeAny, {
1052
1160
  caller: {
1053
1161
  id: string;
1162
+ displayName: string | null;
1054
1163
  projectId: string;
1055
1164
  createdAt: string;
1056
1165
  updatedAt: string;
1057
- displayName: string | null;
1058
1166
  metadata: Record<string, unknown>;
1059
1167
  externalKey: string;
1060
1168
  };
1061
1169
  }, {
1062
1170
  caller: {
1063
1171
  id: string;
1172
+ displayName: string | null;
1064
1173
  projectId: string;
1065
1174
  createdAt: string;
1066
1175
  updatedAt: string;
1067
- displayName: string | null;
1068
1176
  metadata: Record<string, unknown>;
1069
1177
  externalKey: string;
1070
1178
  };
@@ -1075,10 +1183,10 @@ declare const DeleteCallerResponse: z.ZodObject<{
1075
1183
  scopesPurged: z.ZodArray<z.ZodEnum<["call", "caller", "account", "platform"]>, "many">;
1076
1184
  }, "strip", z.ZodTypeAny, {
1077
1185
  ok: true;
1078
- scopesPurged: ("caller" | "call" | "account" | "platform")[];
1186
+ scopesPurged: ("call" | "caller" | "account" | "platform")[];
1079
1187
  }, {
1080
1188
  ok: true;
1081
- scopesPurged: ("caller" | "call" | "account" | "platform")[];
1189
+ scopesPurged: ("call" | "caller" | "account" | "platform")[];
1082
1190
  }>;
1083
1191
  type DeleteCallerResponse = z.infer<typeof DeleteCallerResponse>;
1084
1192
 
@@ -1257,12 +1365,12 @@ declare const AgentConfig: z.ZodObject<{
1257
1365
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1258
1366
  }, "strip", z.ZodTypeAny, {
1259
1367
  url: string;
1260
- headers?: Record<string, string> | undefined;
1261
1368
  timeoutMs?: number | undefined;
1369
+ headers?: Record<string, string> | undefined;
1262
1370
  }, {
1263
1371
  url: string;
1264
- headers?: Record<string, string> | undefined;
1265
1372
  timeoutMs?: number | undefined;
1373
+ headers?: Record<string, string> | undefined;
1266
1374
  }>>;
1267
1375
  }, "strip", z.ZodTypeAny, {
1268
1376
  collect: Record<string, {
@@ -1278,14 +1386,14 @@ declare const AgentConfig: z.ZodObject<{
1278
1386
  completeWhen: "all-required-captured" | "all-captured";
1279
1387
  backendAck?: {
1280
1388
  url: string;
1281
- headers?: Record<string, string> | undefined;
1282
1389
  timeoutMs?: number | undefined;
1390
+ headers?: Record<string, string> | undefined;
1283
1391
  } | undefined;
1284
1392
  }, {
1285
1393
  backendAck?: {
1286
1394
  url: string;
1287
- headers?: Record<string, string> | undefined;
1288
1395
  timeoutMs?: number | undefined;
1396
+ headers?: Record<string, string> | undefined;
1289
1397
  } | undefined;
1290
1398
  collect?: Record<string, {
1291
1399
  type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
@@ -1305,22 +1413,22 @@ declare const AgentConfig: z.ZodObject<{
1305
1413
  pattern: z.ZodString;
1306
1414
  flags: z.ZodOptional<z.ZodString>;
1307
1415
  }, "strip", z.ZodTypeAny, {
1308
- kind: "regex";
1309
1416
  pattern: string;
1417
+ kind: "regex";
1310
1418
  flags?: string | undefined;
1311
1419
  }, {
1312
- kind: "regex";
1313
1420
  pattern: string;
1421
+ kind: "regex";
1314
1422
  flags?: string | undefined;
1315
1423
  }>, z.ZodObject<{
1316
1424
  kind: z.ZodLiteral<"signal">;
1317
1425
  name: z.ZodString;
1318
1426
  }, "strip", z.ZodTypeAny, {
1319
- kind: "signal";
1320
1427
  name: string;
1321
- }, {
1322
1428
  kind: "signal";
1429
+ }, {
1323
1430
  name: string;
1431
+ kind: "signal";
1324
1432
  }>]>;
1325
1433
  then: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1326
1434
  kind: z.ZodLiteral<"handoff">;
@@ -1355,12 +1463,12 @@ declare const AgentConfig: z.ZodObject<{
1355
1463
  kind: "say";
1356
1464
  };
1357
1465
  on: {
1358
- kind: "regex";
1359
1466
  pattern: string;
1467
+ kind: "regex";
1360
1468
  flags?: string | undefined;
1361
1469
  } | {
1362
- kind: "signal";
1363
1470
  name: string;
1471
+ kind: "signal";
1364
1472
  };
1365
1473
  onlyWhile?: string | undefined;
1366
1474
  }, {
@@ -1373,17 +1481,69 @@ declare const AgentConfig: z.ZodObject<{
1373
1481
  kind: "say";
1374
1482
  };
1375
1483
  on: {
1376
- kind: "regex";
1377
1484
  pattern: string;
1485
+ kind: "regex";
1378
1486
  flags?: string | undefined;
1379
1487
  } | {
1380
- kind: "signal";
1381
1488
  name: string;
1489
+ kind: "signal";
1382
1490
  };
1383
1491
  onlyWhile?: string | undefined;
1384
1492
  }>>>;
1385
1493
  tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1386
1494
  brainConnectorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1495
+ callLimits: z.ZodOptional<z.ZodObject<{
1496
+ maxDurationMinutes: z.ZodOptional<z.ZodNumber>;
1497
+ wrapUpWarningSeconds: z.ZodOptional<z.ZodNumber>;
1498
+ wrapUpMessage: z.ZodOptional<z.ZodString>;
1499
+ goodbyeMessage: z.ZodOptional<z.ZodString>;
1500
+ callerRateLimit: z.ZodOptional<z.ZodObject<{
1501
+ enabled: z.ZodOptional<z.ZodBoolean>;
1502
+ perTenMinutes: z.ZodOptional<z.ZodNumber>;
1503
+ perDay: z.ZodOptional<z.ZodNumber>;
1504
+ withheldPerTenMinutes: z.ZodOptional<z.ZodNumber>;
1505
+ withheldPerDay: z.ZodOptional<z.ZodNumber>;
1506
+ }, "strip", z.ZodTypeAny, {
1507
+ enabled?: boolean | undefined;
1508
+ perTenMinutes?: number | undefined;
1509
+ perDay?: number | undefined;
1510
+ withheldPerTenMinutes?: number | undefined;
1511
+ withheldPerDay?: number | undefined;
1512
+ }, {
1513
+ enabled?: boolean | undefined;
1514
+ perTenMinutes?: number | undefined;
1515
+ perDay?: number | undefined;
1516
+ withheldPerTenMinutes?: number | undefined;
1517
+ withheldPerDay?: number | undefined;
1518
+ }>>;
1519
+ rateLimitedMessage: z.ZodOptional<z.ZodString>;
1520
+ }, "strip", z.ZodTypeAny, {
1521
+ maxDurationMinutes?: number | undefined;
1522
+ wrapUpWarningSeconds?: number | undefined;
1523
+ wrapUpMessage?: string | undefined;
1524
+ goodbyeMessage?: string | undefined;
1525
+ callerRateLimit?: {
1526
+ enabled?: boolean | undefined;
1527
+ perTenMinutes?: number | undefined;
1528
+ perDay?: number | undefined;
1529
+ withheldPerTenMinutes?: number | undefined;
1530
+ withheldPerDay?: number | undefined;
1531
+ } | undefined;
1532
+ rateLimitedMessage?: string | undefined;
1533
+ }, {
1534
+ maxDurationMinutes?: number | undefined;
1535
+ wrapUpWarningSeconds?: number | undefined;
1536
+ wrapUpMessage?: string | undefined;
1537
+ goodbyeMessage?: string | undefined;
1538
+ callerRateLimit?: {
1539
+ enabled?: boolean | undefined;
1540
+ perTenMinutes?: number | undefined;
1541
+ perDay?: number | undefined;
1542
+ withheldPerTenMinutes?: number | undefined;
1543
+ withheldPerDay?: number | undefined;
1544
+ } | undefined;
1545
+ rateLimitedMessage?: string | undefined;
1546
+ }>>;
1387
1547
  source: z.ZodOptional<z.ZodEnum<["sdk", "flow", "playbook", "connector"]>>;
1388
1548
  modeLocked: z.ZodOptional<z.ZodBoolean>;
1389
1549
  requiredInfo: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1409,21 +1569,21 @@ declare const AgentConfig: z.ZodObject<{
1409
1569
  updatedAt: z.ZodString;
1410
1570
  draftUpdatedAt: z.ZodOptional<z.ZodString>;
1411
1571
  }, "strip", z.ZodTypeAny, {
1572
+ id: string;
1573
+ name: string;
1574
+ tools: {
1575
+ toolName: string;
1576
+ defaultArgs?: Record<string, unknown> | undefined;
1577
+ }[];
1412
1578
  voice: {
1413
1579
  provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
1414
1580
  voiceId: string;
1415
1581
  model?: string | undefined;
1416
1582
  rate?: number | undefined;
1417
1583
  };
1418
- id: string;
1419
1584
  projectId: string;
1420
- name: string;
1421
1585
  createdAt: string;
1422
1586
  updatedAt: string;
1423
- tools: {
1424
- toolName: string;
1425
- defaultArgs?: Record<string, unknown> | undefined;
1426
- }[];
1427
1587
  mode: "realtime" | "cascade";
1428
1588
  model: {
1429
1589
  provider: "openai" | "anthropic" | "gemini";
@@ -1454,21 +1614,6 @@ declare const AgentConfig: z.ZodObject<{
1454
1614
  enum?: string[] | undefined;
1455
1615
  description?: string | undefined;
1456
1616
  }[];
1457
- stt?: {
1458
- provider: "deepgram" | "cartesia" | "assemblyai";
1459
- model?: string | undefined;
1460
- language?: string | undefined;
1461
- endOfTurnConfidence?: number | undefined;
1462
- endOfTurnTimeoutMs?: number | undefined;
1463
- keywords?: string[] | undefined;
1464
- } | undefined;
1465
- realtime?: {
1466
- provider: "openai" | "google";
1467
- model: string;
1468
- voice?: string | undefined;
1469
- temperature?: number | undefined;
1470
- } | undefined;
1471
- source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
1472
1617
  triggers?: Record<string, {
1473
1618
  then: {
1474
1619
  kind: "handoff";
@@ -1479,15 +1624,30 @@ declare const AgentConfig: z.ZodObject<{
1479
1624
  kind: "say";
1480
1625
  };
1481
1626
  on: {
1482
- kind: "regex";
1483
1627
  pattern: string;
1628
+ kind: "regex";
1484
1629
  flags?: string | undefined;
1485
1630
  } | {
1486
- kind: "signal";
1487
1631
  name: string;
1632
+ kind: "signal";
1488
1633
  };
1489
1634
  onlyWhile?: string | undefined;
1490
1635
  }> | undefined;
1636
+ stt?: {
1637
+ provider: "deepgram" | "cartesia" | "assemblyai";
1638
+ model?: string | undefined;
1639
+ language?: string | undefined;
1640
+ endOfTurnConfidence?: number | undefined;
1641
+ endOfTurnTimeoutMs?: number | undefined;
1642
+ keywords?: string[] | undefined;
1643
+ } | undefined;
1644
+ realtime?: {
1645
+ provider: "openai" | "google";
1646
+ model: string;
1647
+ voice?: string | undefined;
1648
+ temperature?: number | undefined;
1649
+ } | undefined;
1650
+ source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
1491
1651
  systemPrompt?: string | undefined;
1492
1652
  routingInstructions?: string | undefined;
1493
1653
  process?: {
@@ -1504,24 +1664,38 @@ declare const AgentConfig: z.ZodObject<{
1504
1664
  completeWhen: "all-required-captured" | "all-captured";
1505
1665
  backendAck?: {
1506
1666
  url: string;
1507
- headers?: Record<string, string> | undefined;
1508
1667
  timeoutMs?: number | undefined;
1668
+ headers?: Record<string, string> | undefined;
1509
1669
  } | undefined;
1510
1670
  } | undefined;
1511
1671
  tags?: string[] | undefined;
1512
1672
  brainConnectorId?: string | null | undefined;
1673
+ callLimits?: {
1674
+ maxDurationMinutes?: number | undefined;
1675
+ wrapUpWarningSeconds?: number | undefined;
1676
+ wrapUpMessage?: string | undefined;
1677
+ goodbyeMessage?: string | undefined;
1678
+ callerRateLimit?: {
1679
+ enabled?: boolean | undefined;
1680
+ perTenMinutes?: number | undefined;
1681
+ perDay?: number | undefined;
1682
+ withheldPerTenMinutes?: number | undefined;
1683
+ withheldPerDay?: number | undefined;
1684
+ } | undefined;
1685
+ rateLimitedMessage?: string | undefined;
1686
+ } | undefined;
1513
1687
  modeLocked?: boolean | undefined;
1514
1688
  draftUpdatedAt?: string | undefined;
1515
1689
  }, {
1690
+ id: string;
1691
+ name: string;
1516
1692
  voice: {
1517
1693
  provider: "deepgram" | "elevenlabs" | "openai" | "cartesia";
1518
1694
  voiceId: string;
1519
1695
  model?: string | undefined;
1520
1696
  rate?: number | undefined;
1521
1697
  };
1522
- id: string;
1523
1698
  projectId: string;
1524
- name: string;
1525
1699
  createdAt: string;
1526
1700
  updatedAt: string;
1527
1701
  model: {
@@ -1545,21 +1719,6 @@ declare const AgentConfig: z.ZodObject<{
1545
1719
  normal?: number | undefined;
1546
1720
  } | undefined;
1547
1721
  };
1548
- stt?: {
1549
- provider: "deepgram" | "cartesia" | "assemblyai";
1550
- model?: string | undefined;
1551
- language?: string | undefined;
1552
- endOfTurnConfidence?: number | undefined;
1553
- endOfTurnTimeoutMs?: number | undefined;
1554
- keywords?: string[] | undefined;
1555
- } | undefined;
1556
- realtime?: {
1557
- provider: "openai" | "google";
1558
- model: string;
1559
- voice?: string | undefined;
1560
- temperature?: number | undefined;
1561
- } | undefined;
1562
- source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
1563
1722
  triggers?: Record<string, {
1564
1723
  then: {
1565
1724
  kind: "handoff";
@@ -1570,12 +1729,12 @@ declare const AgentConfig: z.ZodObject<{
1570
1729
  kind: "say";
1571
1730
  };
1572
1731
  on: {
1573
- kind: "regex";
1574
1732
  pattern: string;
1733
+ kind: "regex";
1575
1734
  flags?: string | undefined;
1576
1735
  } | {
1577
- kind: "signal";
1578
1736
  name: string;
1737
+ kind: "signal";
1579
1738
  };
1580
1739
  onlyWhile?: string | undefined;
1581
1740
  }> | undefined;
@@ -1583,6 +1742,21 @@ declare const AgentConfig: z.ZodObject<{
1583
1742
  toolName: string;
1584
1743
  defaultArgs?: Record<string, unknown> | undefined;
1585
1744
  }[] | undefined;
1745
+ stt?: {
1746
+ provider: "deepgram" | "cartesia" | "assemblyai";
1747
+ model?: string | undefined;
1748
+ language?: string | undefined;
1749
+ endOfTurnConfidence?: number | undefined;
1750
+ endOfTurnTimeoutMs?: number | undefined;
1751
+ keywords?: string[] | undefined;
1752
+ } | undefined;
1753
+ realtime?: {
1754
+ provider: "openai" | "google";
1755
+ model: string;
1756
+ voice?: string | undefined;
1757
+ temperature?: number | undefined;
1758
+ } | undefined;
1759
+ source?: "playbook" | "sdk" | "flow" | "connector" | undefined;
1586
1760
  mode?: "realtime" | "cascade" | undefined;
1587
1761
  language?: string | undefined;
1588
1762
  systemPrompt?: string | undefined;
@@ -1590,8 +1764,8 @@ declare const AgentConfig: z.ZodObject<{
1590
1764
  process?: {
1591
1765
  backendAck?: {
1592
1766
  url: string;
1593
- headers?: Record<string, string> | undefined;
1594
1767
  timeoutMs?: number | undefined;
1768
+ headers?: Record<string, string> | undefined;
1595
1769
  } | undefined;
1596
1770
  collect?: Record<string, {
1597
1771
  type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
@@ -1607,6 +1781,20 @@ declare const AgentConfig: z.ZodObject<{
1607
1781
  } | undefined;
1608
1782
  tags?: string[] | undefined;
1609
1783
  brainConnectorId?: string | null | undefined;
1784
+ callLimits?: {
1785
+ maxDurationMinutes?: number | undefined;
1786
+ wrapUpWarningSeconds?: number | undefined;
1787
+ wrapUpMessage?: string | undefined;
1788
+ goodbyeMessage?: string | undefined;
1789
+ callerRateLimit?: {
1790
+ enabled?: boolean | undefined;
1791
+ perTenMinutes?: number | undefined;
1792
+ perDay?: number | undefined;
1793
+ withheldPerTenMinutes?: number | undefined;
1794
+ withheldPerDay?: number | undefined;
1795
+ } | undefined;
1796
+ rateLimitedMessage?: string | undefined;
1797
+ } | undefined;
1610
1798
  modeLocked?: boolean | undefined;
1611
1799
  requiredInfo?: {
1612
1800
  type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
@@ -1619,9 +1807,246 @@ declare const AgentConfig: z.ZodObject<{
1619
1807
  }>;
1620
1808
  type AgentConfig = z.infer<typeof AgentConfig>;
1621
1809
 
1622
- declare const AgentEndReason: z.ZodEnum<["flow_boot:schema_fetch_failed" | "flow_boot:no_process_schema" | "flow_boot:missing_agent_id" | "flow_boot:no_api_key" | "flow_boot:worker_identity_refused" | "flow_boot:provider_unavailable", ...("flow_boot:schema_fetch_failed" | "flow_boot:no_process_schema" | "flow_boot:missing_agent_id" | "flow_boot:no_api_key" | "flow_boot:worker_identity_refused" | "flow_boot:provider_unavailable")[]]>;
1810
+ /** POST /v1/calls/:id/finalize — sent once, at the session's close, after the worker's last write for the call. */
1811
+ declare const CallFinalizeInput: z.ZodEffects<z.ZodObject<{
1812
+ fields: z.ZodArray<z.ZodObject<{
1813
+ name: z.ZodString;
1814
+ type: z.ZodEnum<["string", "string[]", "number", "boolean", "datetime", "email", "phone"]>;
1815
+ required: z.ZodBoolean;
1816
+ filled: z.ZodBoolean;
1817
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodNull]>;
1818
+ }, "strip", z.ZodTypeAny, {
1819
+ value: string | number | boolean | string[] | null;
1820
+ type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
1821
+ name: string;
1822
+ required: boolean;
1823
+ filled: boolean;
1824
+ }, {
1825
+ value: string | number | boolean | string[] | null;
1826
+ type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
1827
+ name: string;
1828
+ required: boolean;
1829
+ filled: boolean;
1830
+ }>, "many">;
1831
+ }, "strip", z.ZodTypeAny, {
1832
+ fields: {
1833
+ value: string | number | boolean | string[] | null;
1834
+ type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
1835
+ name: string;
1836
+ required: boolean;
1837
+ filled: boolean;
1838
+ }[];
1839
+ }, {
1840
+ fields: {
1841
+ value: string | number | boolean | string[] | null;
1842
+ type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
1843
+ name: string;
1844
+ required: boolean;
1845
+ filled: boolean;
1846
+ }[];
1847
+ }>, {
1848
+ fields: {
1849
+ value: string | number | boolean | string[] | null;
1850
+ type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
1851
+ name: string;
1852
+ required: boolean;
1853
+ filled: boolean;
1854
+ }[];
1855
+ }, {
1856
+ fields: {
1857
+ value: string | number | boolean | string[] | null;
1858
+ type: "string" | "number" | "boolean" | "email" | "string[]" | "datetime" | "phone";
1859
+ name: string;
1860
+ required: boolean;
1861
+ filled: boolean;
1862
+ }[];
1863
+ }>;
1864
+ type CallFinalizeInput = z.infer<typeof CallFinalizeInput>;
1865
+
1866
+ declare const FLOW_BOOT_FAILURES: readonly ["schema_fetch_failed", "no_process_schema", "missing_agent_id", "no_api_key", "worker_identity_refused", "provider_unavailable"];
1867
+ type FlowBootFailure = (typeof FLOW_BOOT_FAILURES)[number];
1868
+ type AgentEndReasonValue = `flow_boot:${FlowBootFailure}` | 'max_duration';
1869
+ declare const AgentEndReason: z.ZodEnum<[AgentEndReasonValue, ...AgentEndReasonValue[]]>;
1623
1870
  type AgentEndReason = z.infer<typeof AgentEndReason>;
1624
1871
 
1872
+ declare const CallAdmissionRequest: z.ZodObject<{
1873
+ roomName: z.ZodString;
1874
+ /** From the dispatch metadata: lets the API admit (gate) a room whose call row doesn't exist yet. */
1875
+ agentId: z.ZodOptional<z.ZodString>;
1876
+ phoneNumberId: z.ZodOptional<z.ZodString>;
1877
+ caller: z.ZodObject<{
1878
+ channel: z.ZodEnum<["phone", "web"]>;
1879
+ /** The caller's number as the carrier presented it; null / absent / not E.164 ⇒ the withheld bucket. */
1880
+ number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1881
+ }, "strip", z.ZodTypeAny, {
1882
+ channel: "phone" | "web";
1883
+ number?: string | null | undefined;
1884
+ }, {
1885
+ channel: "phone" | "web";
1886
+ number?: string | null | undefined;
1887
+ }>;
1888
+ }, "strip", z.ZodTypeAny, {
1889
+ caller: {
1890
+ channel: "phone" | "web";
1891
+ number?: string | null | undefined;
1892
+ };
1893
+ roomName: string;
1894
+ agentId?: string | undefined;
1895
+ phoneNumberId?: string | undefined;
1896
+ }, {
1897
+ caller: {
1898
+ channel: "phone" | "web";
1899
+ number?: string | null | undefined;
1900
+ };
1901
+ roomName: string;
1902
+ agentId?: string | undefined;
1903
+ phoneNumberId?: string | undefined;
1904
+ }>;
1905
+ type CallAdmissionRequest = z.infer<typeof CallAdmissionRequest>;
1906
+ declare const CallAdmissionResponse: z.ZodDiscriminatedUnion<"admitted", [z.ZodObject<{
1907
+ admitted: z.ZodLiteral<true>;
1908
+ limits: z.ZodObject<{
1909
+ /** The agent's own ceiling (already clamped to the plan), or null when it set none. */
1910
+ agentMaxSeconds: z.ZodNullable<z.ZodNumber>;
1911
+ /** The plan ceiling — the platform bound no call outlives. */
1912
+ ceilingSeconds: z.ZodNumber;
1913
+ wrapUpWarningSeconds: z.ZodNumber;
1914
+ wrapUpMessage: z.ZodString;
1915
+ goodbyeMessage: z.ZodString;
1916
+ }, "strip", z.ZodTypeAny, {
1917
+ wrapUpWarningSeconds: number;
1918
+ wrapUpMessage: string;
1919
+ goodbyeMessage: string;
1920
+ agentMaxSeconds: number | null;
1921
+ ceilingSeconds: number;
1922
+ }, {
1923
+ wrapUpWarningSeconds: number;
1924
+ wrapUpMessage: string;
1925
+ goodbyeMessage: string;
1926
+ agentMaxSeconds: number | null;
1927
+ ceilingSeconds: number;
1928
+ }>;
1929
+ }, "strip", z.ZodTypeAny, {
1930
+ admitted: true;
1931
+ limits: {
1932
+ wrapUpWarningSeconds: number;
1933
+ wrapUpMessage: string;
1934
+ goodbyeMessage: string;
1935
+ agentMaxSeconds: number | null;
1936
+ ceilingSeconds: number;
1937
+ };
1938
+ }, {
1939
+ admitted: true;
1940
+ limits: {
1941
+ wrapUpWarningSeconds: number;
1942
+ wrapUpMessage: string;
1943
+ goodbyeMessage: string;
1944
+ agentMaxSeconds: number | null;
1945
+ ceilingSeconds: number;
1946
+ };
1947
+ }>, z.ZodObject<{
1948
+ admitted: z.ZodLiteral<false>;
1949
+ /** 'rate_limited:caller' | 'inbound_refused:<code>' — already recorded as the call's end reason. */
1950
+ endReason: z.ZodString;
1951
+ /** The fixed line to speak before hanging up. */
1952
+ message: z.ZodString;
1953
+ }, "strip", z.ZodTypeAny, {
1954
+ message: string;
1955
+ admitted: false;
1956
+ endReason: string;
1957
+ }, {
1958
+ message: string;
1959
+ admitted: false;
1960
+ endReason: string;
1961
+ }>]>;
1962
+ type CallAdmissionResponse = z.infer<typeof CallAdmissionResponse>;
1963
+
1964
+ declare const PipelineKeys: z.ZodObject<{
1965
+ llm: z.ZodOptional<z.ZodObject<{
1966
+ /** The provider as the slot reports it (LiveKit's label: `openai`, `api.openai.com`, `Deepgram`, …). */
1967
+ provider: z.ZodString;
1968
+ /** true = the workspace's own key built it; false = the platform's. */
1969
+ byok: z.ZodBoolean;
1970
+ }, "strip", z.ZodTypeAny, {
1971
+ provider: string;
1972
+ byok: boolean;
1973
+ }, {
1974
+ provider: string;
1975
+ byok: boolean;
1976
+ }>>;
1977
+ stt: z.ZodOptional<z.ZodObject<{
1978
+ /** The provider as the slot reports it (LiveKit's label: `openai`, `api.openai.com`, `Deepgram`, …). */
1979
+ provider: z.ZodString;
1980
+ /** true = the workspace's own key built it; false = the platform's. */
1981
+ byok: z.ZodBoolean;
1982
+ }, "strip", z.ZodTypeAny, {
1983
+ provider: string;
1984
+ byok: boolean;
1985
+ }, {
1986
+ provider: string;
1987
+ byok: boolean;
1988
+ }>>;
1989
+ tts: z.ZodOptional<z.ZodObject<{
1990
+ /** The provider as the slot reports it (LiveKit's label: `openai`, `api.openai.com`, `Deepgram`, …). */
1991
+ provider: z.ZodString;
1992
+ /** true = the workspace's own key built it; false = the platform's. */
1993
+ byok: z.ZodBoolean;
1994
+ }, "strip", z.ZodTypeAny, {
1995
+ provider: string;
1996
+ byok: boolean;
1997
+ }, {
1998
+ provider: string;
1999
+ byok: boolean;
2000
+ }>>;
2001
+ realtime: z.ZodOptional<z.ZodObject<{
2002
+ /** The provider as the slot reports it (LiveKit's label: `openai`, `api.openai.com`, `Deepgram`, …). */
2003
+ provider: z.ZodString;
2004
+ /** true = the workspace's own key built it; false = the platform's. */
2005
+ byok: z.ZodBoolean;
2006
+ }, "strip", z.ZodTypeAny, {
2007
+ provider: string;
2008
+ byok: boolean;
2009
+ }, {
2010
+ provider: string;
2011
+ byok: boolean;
2012
+ }>>;
2013
+ }, "strip", z.ZodTypeAny, {
2014
+ llm?: {
2015
+ provider: string;
2016
+ byok: boolean;
2017
+ } | undefined;
2018
+ stt?: {
2019
+ provider: string;
2020
+ byok: boolean;
2021
+ } | undefined;
2022
+ tts?: {
2023
+ provider: string;
2024
+ byok: boolean;
2025
+ } | undefined;
2026
+ realtime?: {
2027
+ provider: string;
2028
+ byok: boolean;
2029
+ } | undefined;
2030
+ }, {
2031
+ llm?: {
2032
+ provider: string;
2033
+ byok: boolean;
2034
+ } | undefined;
2035
+ stt?: {
2036
+ provider: string;
2037
+ byok: boolean;
2038
+ } | undefined;
2039
+ tts?: {
2040
+ provider: string;
2041
+ byok: boolean;
2042
+ } | undefined;
2043
+ realtime?: {
2044
+ provider: string;
2045
+ byok: boolean;
2046
+ } | undefined;
2047
+ }>;
2048
+ type PipelineKeys = z.infer<typeof PipelineKeys>;
2049
+
1625
2050
  interface ApiCredential {
1626
2051
  readonly apiKey: string;
1627
2052
  readonly baseUrl: string;
@@ -1818,8 +2243,8 @@ declare class AgentsClient {
1818
2243
  agents: {
1819
2244
  status: "online" | "offline" | "degraded";
1820
2245
  id: string;
1821
- projectId: string;
1822
2246
  name: string;
2247
+ projectId: string;
1823
2248
  createdAt: string;
1824
2249
  updatedAt: string;
1825
2250
  version: string;
@@ -1859,7 +2284,7 @@ declare class AgentsClient {
1859
2284
  routes?: Record<string, string> | undefined;
1860
2285
  } | undefined;
1861
2286
  memory?: {
1862
- scope?: "caller" | "call" | "account" | "participant" | "platform" | undefined;
2287
+ scope?: "call" | "caller" | "participant" | "account" | "platform" | undefined;
1863
2288
  retentionDays?: number | undefined;
1864
2289
  piiFields?: string[] | undefined;
1865
2290
  } | undefined;
@@ -1875,8 +2300,8 @@ declare class AgentsClient {
1875
2300
  } | undefined;
1876
2301
  } | undefined;
1877
2302
  prompts?: {
1878
- text: string;
1879
2303
  id: string;
2304
+ text: string;
1880
2305
  }[] | undefined;
1881
2306
  triggers?: {
1882
2307
  then: string;
@@ -1886,32 +2311,32 @@ declare class AgentsClient {
1886
2311
  }[] | undefined;
1887
2312
  tools?: {
1888
2313
  name: string;
2314
+ url: string;
1889
2315
  description: string;
1890
2316
  input: Record<string, "string" | "number" | "boolean">;
1891
- url: string;
1892
2317
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1893
2318
  auth: "none" | "connection";
2319
+ allowPrivateNetwork?: boolean | undefined;
1894
2320
  headers?: Record<string, string> | undefined;
1895
2321
  connectionRef?: string | undefined;
1896
- allowPrivateNetwork?: boolean | undefined;
1897
2322
  sendRealValues?: boolean | undefined;
1898
2323
  }[] | undefined;
1899
2324
  displayName?: string | undefined;
1900
2325
  program?: {
2326
+ v: 1;
1901
2327
  id: string;
2328
+ entry: string[];
1902
2329
  nodes: Record<string, {
1903
- type: "llm" | "code" | "start" | "say" | "ask" | "confirm" | "tool" | "email" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "set" | "subflow" | "rag" | "memory" | "speech" | "classify" | "router" | "note";
2330
+ type: "code" | "set" | "start" | "say" | "ask" | "confirm" | "tool" | "email" | "decision" | "handoff" | "end" | "trigger" | "gate" | "playbook" | "menu" | "subflow" | "llm" | "rag" | "memory" | "speech" | "classify" | "router" | "note";
1904
2331
  id: string;
1905
2332
  config: Record<string, unknown>;
1906
2333
  out: {
1907
2334
  to: string;
2335
+ condition?: string | undefined;
1908
2336
  sourceHandle?: string | undefined;
1909
2337
  label?: string | undefined;
1910
- condition?: string | undefined;
1911
2338
  }[];
1912
2339
  }>;
1913
- v: 1;
1914
- entry: string[];
1915
2340
  completionGate: {
1916
2341
  requiredFields: string[];
1917
2342
  };
@@ -1991,14 +2416,18 @@ interface CallUsageReport {
1991
2416
  readonly model: string;
1992
2417
  readonly inputTokens: number;
1993
2418
  readonly outputTokens: number;
2419
+ /** Whose key paid: true = the customer's (passed through at $0), false or absent = the platform's (at cost). */
2420
+ readonly byok?: boolean;
1994
2421
  }[];
1995
2422
  readonly tts: readonly {
1996
2423
  readonly provider: string;
1997
2424
  readonly chars: number;
2425
+ readonly byok?: boolean;
1998
2426
  }[];
1999
2427
  readonly stt: readonly {
2000
2428
  readonly provider: string;
2001
2429
  readonly seconds: number;
2430
+ readonly byok?: boolean;
2002
2431
  }[];
2003
2432
  }
2004
2433
  interface AppendTranscriptInput {
@@ -2026,6 +2455,11 @@ interface EnsureCallByRoomInput {
2026
2455
  readonly participants?: CallParticipantInput[];
2027
2456
  readonly legs?: CallLegInput[];
2028
2457
  readonly startedAt?: string;
2458
+ /** Whose key each pipeline slot runs on (metering F-16). The API pins it on the call only from the call's own worker
2459
+ * token; every billing path prices from it. */
2460
+ readonly pipelineKeys?: PipelineKeys;
2461
+ /** This worker will finalize the call at its close (POST /v1/calls/:id/finalize); `call.ended` waits for it. */
2462
+ readonly finalizes?: boolean;
2029
2463
  }
2030
2464
  interface CallParticipantInput {
2031
2465
  readonly participantKey: string;
@@ -2063,9 +2497,25 @@ declare class CallsClient {
2063
2497
  constructor(transport: Transport);
2064
2498
  getByRoom(roomName: string): Promise<CallSummary>;
2065
2499
  ensureByRoom(input: EnsureCallByRoomInput): Promise<CallSummary>;
2500
+ /**
2501
+ * The call's admission (burn-down G-41/G-42/G-43), asked once right after the caller joins and before the agent
2502
+ * speaks: admitted with its duration limits, or refused with the end reason the platform recorded and the line to
2503
+ * speak before hanging up. Throws on a transport / server error — the runtime retries, then refuses (fail closed).
2504
+ */
2505
+ admit(input: CallAdmissionRequest): Promise<CallAdmissionResponse>;
2066
2506
  syncState(callId: string, input: SyncCallStateInput): Promise<void>;
2067
2507
  appendTranscriptSegment(callId: string, input: AppendTranscriptInput): Promise<void>;
2068
- reportUsage(callId: string, report: CallUsageReport): Promise<void>;
2508
+ reportUsage(callId: string, report: CallUsageReport, opts?: {
2509
+ readonly signal?: AbortSignal;
2510
+ }): Promise<void>;
2511
+ /**
2512
+ * The worker's last word on a call (burn-down G-20): what the call captured — every declared field — sent at the
2513
+ * session's close after the worker's other writes for the call have landed. The API keeps the fields on the call
2514
+ * and releases the call's held `call.ended` webhook. Idempotent.
2515
+ */
2516
+ finalize(callId: string, input: CallFinalizeInput, opts?: {
2517
+ readonly signal?: AbortSignal;
2518
+ }): Promise<void>;
2069
2519
  appendDtmfEvent(callId: string, input: AppendDtmfEventInput): Promise<void>;
2070
2520
  /**
2071
2521
  * Append a structured call event — consultation lifecycle kinds, or the
@@ -2079,7 +2529,7 @@ declare class CallsClient {
2079
2529
  * is visible in the dashboard, not just the spoken transcript.
2080
2530
  */
2081
2531
  appendEvent(callId: string, input: {
2082
- readonly kind: 'consultation.requested' | 'consultation.resolved' | `tool.${string}` | `handoff.${string}` | `lookup.${string}` | `record.${string}` | `notify.${string}`;
2532
+ readonly kind: 'consultation.requested' | 'consultation.resolved' | 'turn.latency' | `tool.${string}` | `handoff.${string}` | `lookup.${string}` | `record.${string}` | `notify.${string}`;
2083
2533
  readonly payload: Record<string, unknown>;
2084
2534
  }): Promise<void>;
2085
2535
  }
@@ -2193,8 +2643,8 @@ declare const BrainConnectorConfig: z.ZodObject<{
2193
2643
  baseUrl: string;
2194
2644
  }>>>;
2195
2645
  }, "strip", z.ZodTypeAny, {
2196
- enabled: boolean;
2197
2646
  id: string;
2647
+ enabled: boolean;
2198
2648
  mode: "tunnel" | "direct";
2199
2649
  defaultModel: string | null;
2200
2650
  connectionId: string | null;
@@ -2204,8 +2654,8 @@ declare const BrainConnectorConfig: z.ZodObject<{
2204
2654
  baseUrl: string;
2205
2655
  } | null | undefined;
2206
2656
  }, {
2207
- enabled: boolean;
2208
2657
  id: string;
2658
+ enabled: boolean;
2209
2659
  mode: "tunnel" | "direct";
2210
2660
  defaultModel: string | null;
2211
2661
  connectionId: string | null;
@@ -2217,8 +2667,8 @@ declare const BrainConnectorConfig: z.ZodObject<{
2217
2667
  }>;
2218
2668
  }, "strip", z.ZodTypeAny, {
2219
2669
  connector: {
2220
- enabled: boolean;
2221
2670
  id: string;
2671
+ enabled: boolean;
2222
2672
  mode: "tunnel" | "direct";
2223
2673
  defaultModel: string | null;
2224
2674
  connectionId: string | null;
@@ -2230,8 +2680,8 @@ declare const BrainConnectorConfig: z.ZodObject<{
2230
2680
  };
2231
2681
  }, {
2232
2682
  connector: {
2233
- enabled: boolean;
2234
2683
  id: string;
2684
+ enabled: boolean;
2235
2685
  mode: "tunnel" | "direct";
2236
2686
  defaultModel: string | null;
2237
2687
  connectionId: string | null;