@roarkanalytics/sdk 5.21.0 → 5.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/client.d.mts +6 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent-draft.d.mts +1311 -0
  12. package/resources/agent-draft.d.mts.map +1 -0
  13. package/resources/agent-draft.d.ts +1311 -0
  14. package/resources/agent-draft.d.ts.map +1 -0
  15. package/resources/agent-draft.js +83 -0
  16. package/resources/agent-draft.js.map +1 -0
  17. package/resources/agent-draft.mjs +79 -0
  18. package/resources/agent-draft.mjs.map +1 -0
  19. package/resources/agent-version.d.mts +767 -0
  20. package/resources/agent-version.d.mts.map +1 -0
  21. package/resources/agent-version.d.ts +767 -0
  22. package/resources/agent-version.d.ts.map +1 -0
  23. package/resources/agent-version.js +59 -0
  24. package/resources/agent-version.js.map +1 -0
  25. package/resources/agent-version.mjs +55 -0
  26. package/resources/agent-version.mjs.map +1 -0
  27. package/resources/agent.d.mts +2 -3
  28. package/resources/agent.d.mts.map +1 -1
  29. package/resources/agent.d.ts +2 -3
  30. package/resources/agent.d.ts.map +1 -1
  31. package/resources/index.d.mts +2 -0
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +2 -0
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +5 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +2 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/src/client.ts +46 -0
  40. package/src/resources/agent-draft.ts +1846 -0
  41. package/src/resources/agent-version.ts +1065 -0
  42. package/src/resources/agent.ts +2 -3
  43. package/src/resources/index.ts +20 -0
  44. package/src/version.ts +1 -1
  45. package/version.d.mts +1 -1
  46. package/version.d.ts +1 -1
  47. package/version.js +1 -1
  48. package/version.mjs +1 -1
@@ -0,0 +1,1846 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ export class AgentDraft extends APIResource {
9
+ /**
10
+ * Opens the agent's one shared draft, a copy of the live version or of an older
11
+ * published version. Fails with 409 when a draft is already open.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const agentDraft = await client.agentDraft.create(
16
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
17
+ * );
18
+ * ```
19
+ */
20
+ create(
21
+ agentID: string,
22
+ body: AgentDraftCreateParams | null | undefined = {},
23
+ options?: RequestOptions,
24
+ ): APIPromise<AgentDraftCreateResponse> {
25
+ return this._client.post(path`/v1/agent/${agentID}/draft`, { body, ...options });
26
+ }
27
+
28
+ /**
29
+ * Changes settings on the draft. Omitted settings stay as they are. Pass the
30
+ * revision you read as expectedRevision to fail with 409 if anyone edited the
31
+ * draft since, instead of applying on top of their edit.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const agentDraft = await client.agentDraft.update(
36
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
37
+ * { settings: {} },
38
+ * );
39
+ * ```
40
+ */
41
+ update(
42
+ agentID: string,
43
+ body: AgentDraftUpdateParams,
44
+ options?: RequestOptions,
45
+ ): APIPromise<AgentDraftUpdateResponse> {
46
+ return this._client.patch(path`/v1/agent/${agentID}/draft`, { body, ...options });
47
+ }
48
+
49
+ /**
50
+ * Throws the open draft away and returns it. The live version is unchanged.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const agentDraft = await client.agentDraft.delete(
55
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
56
+ * );
57
+ * ```
58
+ */
59
+ delete(agentID: string, options?: RequestOptions): APIPromise<AgentDraftDeleteResponse> {
60
+ return this._client.delete(path`/v1/agent/${agentID}/draft`, options);
61
+ }
62
+
63
+ /**
64
+ * The agent's open draft, with the issues that would stop it from being published.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const agentDraft = await client.agentDraft.get(
69
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
70
+ * );
71
+ * ```
72
+ */
73
+ get(agentID: string, options?: RequestOptions): APIPromise<AgentDraftGetResponse> {
74
+ return this._client.get(path`/v1/agent/${agentID}/draft`, options);
75
+ }
76
+
77
+ /**
78
+ * Makes the draft the live version, numbered v1, v2, ... Fails with 409 if the
79
+ * draft was edited after expectedRevision, if another version was published since
80
+ * the draft started, or if it changes nothing; with 400 and the issues if the
81
+ * version cannot run.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * const response = await client.agentDraft.publish(
86
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
87
+ * { expectedRevision: 1 },
88
+ * );
89
+ * ```
90
+ */
91
+ publish(
92
+ agentID: string,
93
+ body: AgentDraftPublishParams,
94
+ options?: RequestOptions,
95
+ ): APIPromise<AgentDraftPublishResponse> {
96
+ return this._client.post(path`/v1/agent/${agentID}/draft/publish`, { body, ...options });
97
+ }
98
+ }
99
+
100
+ export interface AgentDraftCreateResponse {
101
+ /**
102
+ * One version of a Roark-hosted agent's configuration. Null settings use the
103
+ * runtime default.
104
+ */
105
+ data: AgentDraftCreateResponse.Data;
106
+ }
107
+
108
+ export namespace AgentDraftCreateResponse {
109
+ /**
110
+ * One version of a Roark-hosted agent's configuration. Null settings use the
111
+ * runtime default.
112
+ */
113
+ export interface Data {
114
+ id: string;
115
+
116
+ agentId: string;
117
+
118
+ /**
119
+ * A background preset.
120
+ */
121
+ backgroundNoise:
122
+ | 'NONE'
123
+ | 'AIRPORT'
124
+ | 'CHILDREN_PLAYING'
125
+ | 'CITY'
126
+ | 'COFFEE_SHOP'
127
+ | 'CONSTRUCTION'
128
+ | 'CRYING_BABY'
129
+ | 'DRIVING'
130
+ | 'LIBRARY'
131
+ | 'OFFICE'
132
+ | 'THUNDERSTORM'
133
+ | 'TRAIN'
134
+ | null;
135
+
136
+ /**
137
+ * A custom background recording, instead of a preset.
138
+ */
139
+ backgroundNoiseUrl: string | null;
140
+
141
+ /**
142
+ * 0 to 1.
143
+ */
144
+ backgroundNoiseVolume: number | null;
145
+
146
+ /**
147
+ * The published version a draft started from.
148
+ */
149
+ baseVersionId: string | null;
150
+
151
+ callMaxDurationSeconds: number | null;
152
+
153
+ callSilenceTimeoutSeconds: number | null;
154
+
155
+ chatInactivityTimeoutSeconds: number | null;
156
+
157
+ chatMaxDurationSeconds: number | null;
158
+
159
+ /**
160
+ * ISO 8601.
161
+ */
162
+ createdAt: string;
163
+
164
+ createdById: string | null;
165
+
166
+ createdByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM';
167
+
168
+ endCallGoodbyeMessage: string | null;
169
+
170
+ /**
171
+ * Phrases that end the call when the caller says them, matched anywhere in what
172
+ * they say.
173
+ */
174
+ endDetectionPhrases: Array<string>;
175
+
176
+ /**
177
+ * When the agent may decide to end the call itself.
178
+ */
179
+ endDetectionReasons: Array<string>;
180
+
181
+ /**
182
+ * What the agent says first, with firstMessageMode SPEAK_TEXT.
183
+ */
184
+ firstMessage: string | null;
185
+
186
+ /**
187
+ * The audio a call opens with, with firstMessageMode PLAY_AUDIO.
188
+ */
189
+ firstMessageAudioUrl: string | null;
190
+
191
+ firstMessageMode: 'SPEAK_TEXT' | 'PLAY_AUDIO' | 'WAIT_FOR_CALLER' | null;
192
+
193
+ idleMaxCount: number | null;
194
+
195
+ idleMessages: Array<string>;
196
+
197
+ idleTimeoutSeconds: number | null;
198
+
199
+ interruptionMode: 'ALLOW' | 'BLOCK' | null;
200
+
201
+ /**
202
+ * ISO 639-1, e.g. en.
203
+ */
204
+ language: string | null;
205
+
206
+ /**
207
+ * OpenAI Live models only: the text model they delegate to.
208
+ */
209
+ llmBackendModel: string | null;
210
+
211
+ llmMaxTokens: number | null;
212
+
213
+ /**
214
+ * Any model id the provider accepts. One model serves every speaker.
215
+ */
216
+ llmModel: string | null;
217
+
218
+ llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
219
+
220
+ /**
221
+ * 0 to 2.
222
+ */
223
+ llmTemperature: number | null;
224
+
225
+ /**
226
+ * Speech-to-speech models only: the model's own voice.
227
+ */
228
+ llmVoice: string | null;
229
+
230
+ /**
231
+ * Whether the agent takes calls, chats, or both.
232
+ */
233
+ modalities: Array<'call' | 'chat'>;
234
+
235
+ /**
236
+ * ISO 8601.
237
+ */
238
+ publishedAt: string | null;
239
+
240
+ publishedById: string | null;
241
+
242
+ publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
243
+
244
+ /**
245
+ * Set when this version restores an older one.
246
+ */
247
+ restoredFromVersionId: string | null;
248
+
249
+ /**
250
+ * Increases with every edit to a draft. Send it back as expectedRevision when you
251
+ * publish.
252
+ */
253
+ revision: number;
254
+
255
+ /**
256
+ * DRAFT while being edited, PUBLISHED once it has been live.
257
+ */
258
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
259
+
260
+ sttEndpointingMs: number | null;
261
+
262
+ /**
263
+ * Words and phrases the transcriber should listen for.
264
+ */
265
+ sttKeyterms: Array<string>;
266
+
267
+ sttModel: string | null;
268
+
269
+ sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
270
+
271
+ sttSmartFormat: boolean | null;
272
+
273
+ sttTurnDetection: 'pipeline' | 'provider' | null;
274
+
275
+ /**
276
+ * The main agent (key `main`) first, then the sub-agents it can hand the call to.
277
+ */
278
+ subAgents: Array<Data.SubAgent>;
279
+
280
+ /**
281
+ * What changed, written on publish.
282
+ */
283
+ summary: string | null;
284
+
285
+ /**
286
+ * ISO 8601.
287
+ */
288
+ updatedAt: string;
289
+
290
+ vadStartSecs: number | null;
291
+
292
+ vadStopSecs: number | null;
293
+
294
+ /**
295
+ * v1, v2, ... assigned on publish; null on a draft.
296
+ */
297
+ versionNumber: number | null;
298
+
299
+ /**
300
+ * Why this version cannot run; empty when it can be published. Returned when
301
+ * reading one version.
302
+ */
303
+ issues?: Array<Data.Issue>;
304
+ }
305
+
306
+ export namespace Data {
307
+ /**
308
+ * A speaker in the conversation. On a sub-agent, null voice settings use the main
309
+ * agent's.
310
+ */
311
+ export interface SubAgent {
312
+ handoffs: Array<SubAgent.Handoff>;
313
+
314
+ /**
315
+ * The call opens as this sub-agent instead of the main agent.
316
+ */
317
+ isInitial: boolean;
318
+
319
+ /**
320
+ * `main` for the main agent; otherwise letters, digits, `_` or `-`.
321
+ */
322
+ key: string;
323
+
324
+ /**
325
+ * How the agent refers to this speaker.
326
+ */
327
+ name: string | null;
328
+
329
+ /**
330
+ * The speaker's prompt.
331
+ */
332
+ systemPrompt: string | null;
333
+
334
+ tools: Array<SubAgent.Tool>;
335
+
336
+ ttsModel: string | null;
337
+
338
+ ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
339
+
340
+ /**
341
+ * 0 to 1, ElevenLabs.
342
+ */
343
+ ttsSimilarityBoost: number | null;
344
+
345
+ /**
346
+ * 0.5 to 2.
347
+ */
348
+ ttsSpeed: number | null;
349
+
350
+ /**
351
+ * 0 to 1, ElevenLabs.
352
+ */
353
+ ttsStability: number | null;
354
+
355
+ /**
356
+ * Any voice id the provider accepts, including your own voices.
357
+ */
358
+ ttsVoiceId: string | null;
359
+ }
360
+
361
+ export namespace SubAgent {
362
+ export interface Handoff {
363
+ /**
364
+ * When to hand off, in the words the model is given.
365
+ */
366
+ description: string;
367
+
368
+ /**
369
+ * SHARED: the new speaker hears the conversation so far. NONE: it starts fresh.
370
+ */
371
+ history: 'SHARED' | 'NONE';
372
+
373
+ /**
374
+ * Added to the new speaker's prompt at the handoff, such as a warm-transfer brief.
375
+ */
376
+ note: string | null;
377
+
378
+ /**
379
+ * At most once per call.
380
+ */
381
+ once: boolean;
382
+
383
+ /**
384
+ * The key of the sub-agent that takes over; `main` for the main agent.
385
+ */
386
+ to: string;
387
+ }
388
+
389
+ export interface Tool {
390
+ /**
391
+ * The tool version the agent runs; null runs the tool's latest declared version.
392
+ */
393
+ pinnedVersion: number | null;
394
+
395
+ toolDefinitionId: string;
396
+ }
397
+ }
398
+
399
+ /**
400
+ * Something that stops a version from running.
401
+ */
402
+ export interface Issue {
403
+ /**
404
+ * The setting the issue is about.
405
+ */
406
+ field: string;
407
+
408
+ message: string;
409
+ }
410
+ }
411
+ }
412
+
413
+ export interface AgentDraftUpdateResponse {
414
+ /**
415
+ * One version of a Roark-hosted agent's configuration. Null settings use the
416
+ * runtime default.
417
+ */
418
+ data: AgentDraftUpdateResponse.Data;
419
+ }
420
+
421
+ export namespace AgentDraftUpdateResponse {
422
+ /**
423
+ * One version of a Roark-hosted agent's configuration. Null settings use the
424
+ * runtime default.
425
+ */
426
+ export interface Data {
427
+ id: string;
428
+
429
+ agentId: string;
430
+
431
+ /**
432
+ * A background preset.
433
+ */
434
+ backgroundNoise:
435
+ | 'NONE'
436
+ | 'AIRPORT'
437
+ | 'CHILDREN_PLAYING'
438
+ | 'CITY'
439
+ | 'COFFEE_SHOP'
440
+ | 'CONSTRUCTION'
441
+ | 'CRYING_BABY'
442
+ | 'DRIVING'
443
+ | 'LIBRARY'
444
+ | 'OFFICE'
445
+ | 'THUNDERSTORM'
446
+ | 'TRAIN'
447
+ | null;
448
+
449
+ /**
450
+ * A custom background recording, instead of a preset.
451
+ */
452
+ backgroundNoiseUrl: string | null;
453
+
454
+ /**
455
+ * 0 to 1.
456
+ */
457
+ backgroundNoiseVolume: number | null;
458
+
459
+ /**
460
+ * The published version a draft started from.
461
+ */
462
+ baseVersionId: string | null;
463
+
464
+ callMaxDurationSeconds: number | null;
465
+
466
+ callSilenceTimeoutSeconds: number | null;
467
+
468
+ chatInactivityTimeoutSeconds: number | null;
469
+
470
+ chatMaxDurationSeconds: number | null;
471
+
472
+ /**
473
+ * ISO 8601.
474
+ */
475
+ createdAt: string;
476
+
477
+ createdById: string | null;
478
+
479
+ createdByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM';
480
+
481
+ endCallGoodbyeMessage: string | null;
482
+
483
+ /**
484
+ * Phrases that end the call when the caller says them, matched anywhere in what
485
+ * they say.
486
+ */
487
+ endDetectionPhrases: Array<string>;
488
+
489
+ /**
490
+ * When the agent may decide to end the call itself.
491
+ */
492
+ endDetectionReasons: Array<string>;
493
+
494
+ /**
495
+ * What the agent says first, with firstMessageMode SPEAK_TEXT.
496
+ */
497
+ firstMessage: string | null;
498
+
499
+ /**
500
+ * The audio a call opens with, with firstMessageMode PLAY_AUDIO.
501
+ */
502
+ firstMessageAudioUrl: string | null;
503
+
504
+ firstMessageMode: 'SPEAK_TEXT' | 'PLAY_AUDIO' | 'WAIT_FOR_CALLER' | null;
505
+
506
+ idleMaxCount: number | null;
507
+
508
+ idleMessages: Array<string>;
509
+
510
+ idleTimeoutSeconds: number | null;
511
+
512
+ interruptionMode: 'ALLOW' | 'BLOCK' | null;
513
+
514
+ /**
515
+ * ISO 639-1, e.g. en.
516
+ */
517
+ language: string | null;
518
+
519
+ /**
520
+ * OpenAI Live models only: the text model they delegate to.
521
+ */
522
+ llmBackendModel: string | null;
523
+
524
+ llmMaxTokens: number | null;
525
+
526
+ /**
527
+ * Any model id the provider accepts. One model serves every speaker.
528
+ */
529
+ llmModel: string | null;
530
+
531
+ llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
532
+
533
+ /**
534
+ * 0 to 2.
535
+ */
536
+ llmTemperature: number | null;
537
+
538
+ /**
539
+ * Speech-to-speech models only: the model's own voice.
540
+ */
541
+ llmVoice: string | null;
542
+
543
+ /**
544
+ * Whether the agent takes calls, chats, or both.
545
+ */
546
+ modalities: Array<'call' | 'chat'>;
547
+
548
+ /**
549
+ * ISO 8601.
550
+ */
551
+ publishedAt: string | null;
552
+
553
+ publishedById: string | null;
554
+
555
+ publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
556
+
557
+ /**
558
+ * Set when this version restores an older one.
559
+ */
560
+ restoredFromVersionId: string | null;
561
+
562
+ /**
563
+ * Increases with every edit to a draft. Send it back as expectedRevision when you
564
+ * publish.
565
+ */
566
+ revision: number;
567
+
568
+ /**
569
+ * DRAFT while being edited, PUBLISHED once it has been live.
570
+ */
571
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
572
+
573
+ sttEndpointingMs: number | null;
574
+
575
+ /**
576
+ * Words and phrases the transcriber should listen for.
577
+ */
578
+ sttKeyterms: Array<string>;
579
+
580
+ sttModel: string | null;
581
+
582
+ sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
583
+
584
+ sttSmartFormat: boolean | null;
585
+
586
+ sttTurnDetection: 'pipeline' | 'provider' | null;
587
+
588
+ /**
589
+ * The main agent (key `main`) first, then the sub-agents it can hand the call to.
590
+ */
591
+ subAgents: Array<Data.SubAgent>;
592
+
593
+ /**
594
+ * What changed, written on publish.
595
+ */
596
+ summary: string | null;
597
+
598
+ /**
599
+ * ISO 8601.
600
+ */
601
+ updatedAt: string;
602
+
603
+ vadStartSecs: number | null;
604
+
605
+ vadStopSecs: number | null;
606
+
607
+ /**
608
+ * v1, v2, ... assigned on publish; null on a draft.
609
+ */
610
+ versionNumber: number | null;
611
+
612
+ /**
613
+ * Why this version cannot run; empty when it can be published. Returned when
614
+ * reading one version.
615
+ */
616
+ issues?: Array<Data.Issue>;
617
+ }
618
+
619
+ export namespace Data {
620
+ /**
621
+ * A speaker in the conversation. On a sub-agent, null voice settings use the main
622
+ * agent's.
623
+ */
624
+ export interface SubAgent {
625
+ handoffs: Array<SubAgent.Handoff>;
626
+
627
+ /**
628
+ * The call opens as this sub-agent instead of the main agent.
629
+ */
630
+ isInitial: boolean;
631
+
632
+ /**
633
+ * `main` for the main agent; otherwise letters, digits, `_` or `-`.
634
+ */
635
+ key: string;
636
+
637
+ /**
638
+ * How the agent refers to this speaker.
639
+ */
640
+ name: string | null;
641
+
642
+ /**
643
+ * The speaker's prompt.
644
+ */
645
+ systemPrompt: string | null;
646
+
647
+ tools: Array<SubAgent.Tool>;
648
+
649
+ ttsModel: string | null;
650
+
651
+ ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
652
+
653
+ /**
654
+ * 0 to 1, ElevenLabs.
655
+ */
656
+ ttsSimilarityBoost: number | null;
657
+
658
+ /**
659
+ * 0.5 to 2.
660
+ */
661
+ ttsSpeed: number | null;
662
+
663
+ /**
664
+ * 0 to 1, ElevenLabs.
665
+ */
666
+ ttsStability: number | null;
667
+
668
+ /**
669
+ * Any voice id the provider accepts, including your own voices.
670
+ */
671
+ ttsVoiceId: string | null;
672
+ }
673
+
674
+ export namespace SubAgent {
675
+ export interface Handoff {
676
+ /**
677
+ * When to hand off, in the words the model is given.
678
+ */
679
+ description: string;
680
+
681
+ /**
682
+ * SHARED: the new speaker hears the conversation so far. NONE: it starts fresh.
683
+ */
684
+ history: 'SHARED' | 'NONE';
685
+
686
+ /**
687
+ * Added to the new speaker's prompt at the handoff, such as a warm-transfer brief.
688
+ */
689
+ note: string | null;
690
+
691
+ /**
692
+ * At most once per call.
693
+ */
694
+ once: boolean;
695
+
696
+ /**
697
+ * The key of the sub-agent that takes over; `main` for the main agent.
698
+ */
699
+ to: string;
700
+ }
701
+
702
+ export interface Tool {
703
+ /**
704
+ * The tool version the agent runs; null runs the tool's latest declared version.
705
+ */
706
+ pinnedVersion: number | null;
707
+
708
+ toolDefinitionId: string;
709
+ }
710
+ }
711
+
712
+ /**
713
+ * Something that stops a version from running.
714
+ */
715
+ export interface Issue {
716
+ /**
717
+ * The setting the issue is about.
718
+ */
719
+ field: string;
720
+
721
+ message: string;
722
+ }
723
+ }
724
+ }
725
+
726
+ export interface AgentDraftDeleteResponse {
727
+ /**
728
+ * One version of a Roark-hosted agent's configuration. Null settings use the
729
+ * runtime default.
730
+ */
731
+ data: AgentDraftDeleteResponse.Data;
732
+ }
733
+
734
+ export namespace AgentDraftDeleteResponse {
735
+ /**
736
+ * One version of a Roark-hosted agent's configuration. Null settings use the
737
+ * runtime default.
738
+ */
739
+ export interface Data {
740
+ id: string;
741
+
742
+ agentId: string;
743
+
744
+ /**
745
+ * A background preset.
746
+ */
747
+ backgroundNoise:
748
+ | 'NONE'
749
+ | 'AIRPORT'
750
+ | 'CHILDREN_PLAYING'
751
+ | 'CITY'
752
+ | 'COFFEE_SHOP'
753
+ | 'CONSTRUCTION'
754
+ | 'CRYING_BABY'
755
+ | 'DRIVING'
756
+ | 'LIBRARY'
757
+ | 'OFFICE'
758
+ | 'THUNDERSTORM'
759
+ | 'TRAIN'
760
+ | null;
761
+
762
+ /**
763
+ * A custom background recording, instead of a preset.
764
+ */
765
+ backgroundNoiseUrl: string | null;
766
+
767
+ /**
768
+ * 0 to 1.
769
+ */
770
+ backgroundNoiseVolume: number | null;
771
+
772
+ /**
773
+ * The published version a draft started from.
774
+ */
775
+ baseVersionId: string | null;
776
+
777
+ callMaxDurationSeconds: number | null;
778
+
779
+ callSilenceTimeoutSeconds: number | null;
780
+
781
+ chatInactivityTimeoutSeconds: number | null;
782
+
783
+ chatMaxDurationSeconds: number | null;
784
+
785
+ /**
786
+ * ISO 8601.
787
+ */
788
+ createdAt: string;
789
+
790
+ createdById: string | null;
791
+
792
+ createdByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM';
793
+
794
+ endCallGoodbyeMessage: string | null;
795
+
796
+ /**
797
+ * Phrases that end the call when the caller says them, matched anywhere in what
798
+ * they say.
799
+ */
800
+ endDetectionPhrases: Array<string>;
801
+
802
+ /**
803
+ * When the agent may decide to end the call itself.
804
+ */
805
+ endDetectionReasons: Array<string>;
806
+
807
+ /**
808
+ * What the agent says first, with firstMessageMode SPEAK_TEXT.
809
+ */
810
+ firstMessage: string | null;
811
+
812
+ /**
813
+ * The audio a call opens with, with firstMessageMode PLAY_AUDIO.
814
+ */
815
+ firstMessageAudioUrl: string | null;
816
+
817
+ firstMessageMode: 'SPEAK_TEXT' | 'PLAY_AUDIO' | 'WAIT_FOR_CALLER' | null;
818
+
819
+ idleMaxCount: number | null;
820
+
821
+ idleMessages: Array<string>;
822
+
823
+ idleTimeoutSeconds: number | null;
824
+
825
+ interruptionMode: 'ALLOW' | 'BLOCK' | null;
826
+
827
+ /**
828
+ * ISO 639-1, e.g. en.
829
+ */
830
+ language: string | null;
831
+
832
+ /**
833
+ * OpenAI Live models only: the text model they delegate to.
834
+ */
835
+ llmBackendModel: string | null;
836
+
837
+ llmMaxTokens: number | null;
838
+
839
+ /**
840
+ * Any model id the provider accepts. One model serves every speaker.
841
+ */
842
+ llmModel: string | null;
843
+
844
+ llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
845
+
846
+ /**
847
+ * 0 to 2.
848
+ */
849
+ llmTemperature: number | null;
850
+
851
+ /**
852
+ * Speech-to-speech models only: the model's own voice.
853
+ */
854
+ llmVoice: string | null;
855
+
856
+ /**
857
+ * Whether the agent takes calls, chats, or both.
858
+ */
859
+ modalities: Array<'call' | 'chat'>;
860
+
861
+ /**
862
+ * ISO 8601.
863
+ */
864
+ publishedAt: string | null;
865
+
866
+ publishedById: string | null;
867
+
868
+ publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
869
+
870
+ /**
871
+ * Set when this version restores an older one.
872
+ */
873
+ restoredFromVersionId: string | null;
874
+
875
+ /**
876
+ * Increases with every edit to a draft. Send it back as expectedRevision when you
877
+ * publish.
878
+ */
879
+ revision: number;
880
+
881
+ /**
882
+ * DRAFT while being edited, PUBLISHED once it has been live.
883
+ */
884
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
885
+
886
+ sttEndpointingMs: number | null;
887
+
888
+ /**
889
+ * Words and phrases the transcriber should listen for.
890
+ */
891
+ sttKeyterms: Array<string>;
892
+
893
+ sttModel: string | null;
894
+
895
+ sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
896
+
897
+ sttSmartFormat: boolean | null;
898
+
899
+ sttTurnDetection: 'pipeline' | 'provider' | null;
900
+
901
+ /**
902
+ * The main agent (key `main`) first, then the sub-agents it can hand the call to.
903
+ */
904
+ subAgents: Array<Data.SubAgent>;
905
+
906
+ /**
907
+ * What changed, written on publish.
908
+ */
909
+ summary: string | null;
910
+
911
+ /**
912
+ * ISO 8601.
913
+ */
914
+ updatedAt: string;
915
+
916
+ vadStartSecs: number | null;
917
+
918
+ vadStopSecs: number | null;
919
+
920
+ /**
921
+ * v1, v2, ... assigned on publish; null on a draft.
922
+ */
923
+ versionNumber: number | null;
924
+
925
+ /**
926
+ * Why this version cannot run; empty when it can be published. Returned when
927
+ * reading one version.
928
+ */
929
+ issues?: Array<Data.Issue>;
930
+ }
931
+
932
+ export namespace Data {
933
+ /**
934
+ * A speaker in the conversation. On a sub-agent, null voice settings use the main
935
+ * agent's.
936
+ */
937
+ export interface SubAgent {
938
+ handoffs: Array<SubAgent.Handoff>;
939
+
940
+ /**
941
+ * The call opens as this sub-agent instead of the main agent.
942
+ */
943
+ isInitial: boolean;
944
+
945
+ /**
946
+ * `main` for the main agent; otherwise letters, digits, `_` or `-`.
947
+ */
948
+ key: string;
949
+
950
+ /**
951
+ * How the agent refers to this speaker.
952
+ */
953
+ name: string | null;
954
+
955
+ /**
956
+ * The speaker's prompt.
957
+ */
958
+ systemPrompt: string | null;
959
+
960
+ tools: Array<SubAgent.Tool>;
961
+
962
+ ttsModel: string | null;
963
+
964
+ ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
965
+
966
+ /**
967
+ * 0 to 1, ElevenLabs.
968
+ */
969
+ ttsSimilarityBoost: number | null;
970
+
971
+ /**
972
+ * 0.5 to 2.
973
+ */
974
+ ttsSpeed: number | null;
975
+
976
+ /**
977
+ * 0 to 1, ElevenLabs.
978
+ */
979
+ ttsStability: number | null;
980
+
981
+ /**
982
+ * Any voice id the provider accepts, including your own voices.
983
+ */
984
+ ttsVoiceId: string | null;
985
+ }
986
+
987
+ export namespace SubAgent {
988
+ export interface Handoff {
989
+ /**
990
+ * When to hand off, in the words the model is given.
991
+ */
992
+ description: string;
993
+
994
+ /**
995
+ * SHARED: the new speaker hears the conversation so far. NONE: it starts fresh.
996
+ */
997
+ history: 'SHARED' | 'NONE';
998
+
999
+ /**
1000
+ * Added to the new speaker's prompt at the handoff, such as a warm-transfer brief.
1001
+ */
1002
+ note: string | null;
1003
+
1004
+ /**
1005
+ * At most once per call.
1006
+ */
1007
+ once: boolean;
1008
+
1009
+ /**
1010
+ * The key of the sub-agent that takes over; `main` for the main agent.
1011
+ */
1012
+ to: string;
1013
+ }
1014
+
1015
+ export interface Tool {
1016
+ /**
1017
+ * The tool version the agent runs; null runs the tool's latest declared version.
1018
+ */
1019
+ pinnedVersion: number | null;
1020
+
1021
+ toolDefinitionId: string;
1022
+ }
1023
+ }
1024
+
1025
+ /**
1026
+ * Something that stops a version from running.
1027
+ */
1028
+ export interface Issue {
1029
+ /**
1030
+ * The setting the issue is about.
1031
+ */
1032
+ field: string;
1033
+
1034
+ message: string;
1035
+ }
1036
+ }
1037
+ }
1038
+
1039
+ export interface AgentDraftGetResponse {
1040
+ /**
1041
+ * One version of a Roark-hosted agent's configuration. Null settings use the
1042
+ * runtime default.
1043
+ */
1044
+ data: AgentDraftGetResponse.Data;
1045
+ }
1046
+
1047
+ export namespace AgentDraftGetResponse {
1048
+ /**
1049
+ * One version of a Roark-hosted agent's configuration. Null settings use the
1050
+ * runtime default.
1051
+ */
1052
+ export interface Data {
1053
+ id: string;
1054
+
1055
+ agentId: string;
1056
+
1057
+ /**
1058
+ * A background preset.
1059
+ */
1060
+ backgroundNoise:
1061
+ | 'NONE'
1062
+ | 'AIRPORT'
1063
+ | 'CHILDREN_PLAYING'
1064
+ | 'CITY'
1065
+ | 'COFFEE_SHOP'
1066
+ | 'CONSTRUCTION'
1067
+ | 'CRYING_BABY'
1068
+ | 'DRIVING'
1069
+ | 'LIBRARY'
1070
+ | 'OFFICE'
1071
+ | 'THUNDERSTORM'
1072
+ | 'TRAIN'
1073
+ | null;
1074
+
1075
+ /**
1076
+ * A custom background recording, instead of a preset.
1077
+ */
1078
+ backgroundNoiseUrl: string | null;
1079
+
1080
+ /**
1081
+ * 0 to 1.
1082
+ */
1083
+ backgroundNoiseVolume: number | null;
1084
+
1085
+ /**
1086
+ * The published version a draft started from.
1087
+ */
1088
+ baseVersionId: string | null;
1089
+
1090
+ callMaxDurationSeconds: number | null;
1091
+
1092
+ callSilenceTimeoutSeconds: number | null;
1093
+
1094
+ chatInactivityTimeoutSeconds: number | null;
1095
+
1096
+ chatMaxDurationSeconds: number | null;
1097
+
1098
+ /**
1099
+ * ISO 8601.
1100
+ */
1101
+ createdAt: string;
1102
+
1103
+ createdById: string | null;
1104
+
1105
+ createdByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM';
1106
+
1107
+ endCallGoodbyeMessage: string | null;
1108
+
1109
+ /**
1110
+ * Phrases that end the call when the caller says them, matched anywhere in what
1111
+ * they say.
1112
+ */
1113
+ endDetectionPhrases: Array<string>;
1114
+
1115
+ /**
1116
+ * When the agent may decide to end the call itself.
1117
+ */
1118
+ endDetectionReasons: Array<string>;
1119
+
1120
+ /**
1121
+ * What the agent says first, with firstMessageMode SPEAK_TEXT.
1122
+ */
1123
+ firstMessage: string | null;
1124
+
1125
+ /**
1126
+ * The audio a call opens with, with firstMessageMode PLAY_AUDIO.
1127
+ */
1128
+ firstMessageAudioUrl: string | null;
1129
+
1130
+ firstMessageMode: 'SPEAK_TEXT' | 'PLAY_AUDIO' | 'WAIT_FOR_CALLER' | null;
1131
+
1132
+ idleMaxCount: number | null;
1133
+
1134
+ idleMessages: Array<string>;
1135
+
1136
+ idleTimeoutSeconds: number | null;
1137
+
1138
+ interruptionMode: 'ALLOW' | 'BLOCK' | null;
1139
+
1140
+ /**
1141
+ * ISO 639-1, e.g. en.
1142
+ */
1143
+ language: string | null;
1144
+
1145
+ /**
1146
+ * OpenAI Live models only: the text model they delegate to.
1147
+ */
1148
+ llmBackendModel: string | null;
1149
+
1150
+ llmMaxTokens: number | null;
1151
+
1152
+ /**
1153
+ * Any model id the provider accepts. One model serves every speaker.
1154
+ */
1155
+ llmModel: string | null;
1156
+
1157
+ llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
1158
+
1159
+ /**
1160
+ * 0 to 2.
1161
+ */
1162
+ llmTemperature: number | null;
1163
+
1164
+ /**
1165
+ * Speech-to-speech models only: the model's own voice.
1166
+ */
1167
+ llmVoice: string | null;
1168
+
1169
+ /**
1170
+ * Whether the agent takes calls, chats, or both.
1171
+ */
1172
+ modalities: Array<'call' | 'chat'>;
1173
+
1174
+ /**
1175
+ * ISO 8601.
1176
+ */
1177
+ publishedAt: string | null;
1178
+
1179
+ publishedById: string | null;
1180
+
1181
+ publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
1182
+
1183
+ /**
1184
+ * Set when this version restores an older one.
1185
+ */
1186
+ restoredFromVersionId: string | null;
1187
+
1188
+ /**
1189
+ * Increases with every edit to a draft. Send it back as expectedRevision when you
1190
+ * publish.
1191
+ */
1192
+ revision: number;
1193
+
1194
+ /**
1195
+ * DRAFT while being edited, PUBLISHED once it has been live.
1196
+ */
1197
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
1198
+
1199
+ sttEndpointingMs: number | null;
1200
+
1201
+ /**
1202
+ * Words and phrases the transcriber should listen for.
1203
+ */
1204
+ sttKeyterms: Array<string>;
1205
+
1206
+ sttModel: string | null;
1207
+
1208
+ sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
1209
+
1210
+ sttSmartFormat: boolean | null;
1211
+
1212
+ sttTurnDetection: 'pipeline' | 'provider' | null;
1213
+
1214
+ /**
1215
+ * The main agent (key `main`) first, then the sub-agents it can hand the call to.
1216
+ */
1217
+ subAgents: Array<Data.SubAgent>;
1218
+
1219
+ /**
1220
+ * What changed, written on publish.
1221
+ */
1222
+ summary: string | null;
1223
+
1224
+ /**
1225
+ * ISO 8601.
1226
+ */
1227
+ updatedAt: string;
1228
+
1229
+ vadStartSecs: number | null;
1230
+
1231
+ vadStopSecs: number | null;
1232
+
1233
+ /**
1234
+ * v1, v2, ... assigned on publish; null on a draft.
1235
+ */
1236
+ versionNumber: number | null;
1237
+
1238
+ /**
1239
+ * Why this version cannot run; empty when it can be published. Returned when
1240
+ * reading one version.
1241
+ */
1242
+ issues?: Array<Data.Issue>;
1243
+ }
1244
+
1245
+ export namespace Data {
1246
+ /**
1247
+ * A speaker in the conversation. On a sub-agent, null voice settings use the main
1248
+ * agent's.
1249
+ */
1250
+ export interface SubAgent {
1251
+ handoffs: Array<SubAgent.Handoff>;
1252
+
1253
+ /**
1254
+ * The call opens as this sub-agent instead of the main agent.
1255
+ */
1256
+ isInitial: boolean;
1257
+
1258
+ /**
1259
+ * `main` for the main agent; otherwise letters, digits, `_` or `-`.
1260
+ */
1261
+ key: string;
1262
+
1263
+ /**
1264
+ * How the agent refers to this speaker.
1265
+ */
1266
+ name: string | null;
1267
+
1268
+ /**
1269
+ * The speaker's prompt.
1270
+ */
1271
+ systemPrompt: string | null;
1272
+
1273
+ tools: Array<SubAgent.Tool>;
1274
+
1275
+ ttsModel: string | null;
1276
+
1277
+ ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
1278
+
1279
+ /**
1280
+ * 0 to 1, ElevenLabs.
1281
+ */
1282
+ ttsSimilarityBoost: number | null;
1283
+
1284
+ /**
1285
+ * 0.5 to 2.
1286
+ */
1287
+ ttsSpeed: number | null;
1288
+
1289
+ /**
1290
+ * 0 to 1, ElevenLabs.
1291
+ */
1292
+ ttsStability: number | null;
1293
+
1294
+ /**
1295
+ * Any voice id the provider accepts, including your own voices.
1296
+ */
1297
+ ttsVoiceId: string | null;
1298
+ }
1299
+
1300
+ export namespace SubAgent {
1301
+ export interface Handoff {
1302
+ /**
1303
+ * When to hand off, in the words the model is given.
1304
+ */
1305
+ description: string;
1306
+
1307
+ /**
1308
+ * SHARED: the new speaker hears the conversation so far. NONE: it starts fresh.
1309
+ */
1310
+ history: 'SHARED' | 'NONE';
1311
+
1312
+ /**
1313
+ * Added to the new speaker's prompt at the handoff, such as a warm-transfer brief.
1314
+ */
1315
+ note: string | null;
1316
+
1317
+ /**
1318
+ * At most once per call.
1319
+ */
1320
+ once: boolean;
1321
+
1322
+ /**
1323
+ * The key of the sub-agent that takes over; `main` for the main agent.
1324
+ */
1325
+ to: string;
1326
+ }
1327
+
1328
+ export interface Tool {
1329
+ /**
1330
+ * The tool version the agent runs; null runs the tool's latest declared version.
1331
+ */
1332
+ pinnedVersion: number | null;
1333
+
1334
+ toolDefinitionId: string;
1335
+ }
1336
+ }
1337
+
1338
+ /**
1339
+ * Something that stops a version from running.
1340
+ */
1341
+ export interface Issue {
1342
+ /**
1343
+ * The setting the issue is about.
1344
+ */
1345
+ field: string;
1346
+
1347
+ message: string;
1348
+ }
1349
+ }
1350
+ }
1351
+
1352
+ export interface AgentDraftPublishResponse {
1353
+ /**
1354
+ * One version of a Roark-hosted agent's configuration. Null settings use the
1355
+ * runtime default.
1356
+ */
1357
+ data: AgentDraftPublishResponse.Data;
1358
+ }
1359
+
1360
+ export namespace AgentDraftPublishResponse {
1361
+ /**
1362
+ * One version of a Roark-hosted agent's configuration. Null settings use the
1363
+ * runtime default.
1364
+ */
1365
+ export interface Data {
1366
+ id: string;
1367
+
1368
+ agentId: string;
1369
+
1370
+ /**
1371
+ * A background preset.
1372
+ */
1373
+ backgroundNoise:
1374
+ | 'NONE'
1375
+ | 'AIRPORT'
1376
+ | 'CHILDREN_PLAYING'
1377
+ | 'CITY'
1378
+ | 'COFFEE_SHOP'
1379
+ | 'CONSTRUCTION'
1380
+ | 'CRYING_BABY'
1381
+ | 'DRIVING'
1382
+ | 'LIBRARY'
1383
+ | 'OFFICE'
1384
+ | 'THUNDERSTORM'
1385
+ | 'TRAIN'
1386
+ | null;
1387
+
1388
+ /**
1389
+ * A custom background recording, instead of a preset.
1390
+ */
1391
+ backgroundNoiseUrl: string | null;
1392
+
1393
+ /**
1394
+ * 0 to 1.
1395
+ */
1396
+ backgroundNoiseVolume: number | null;
1397
+
1398
+ /**
1399
+ * The published version a draft started from.
1400
+ */
1401
+ baseVersionId: string | null;
1402
+
1403
+ callMaxDurationSeconds: number | null;
1404
+
1405
+ callSilenceTimeoutSeconds: number | null;
1406
+
1407
+ chatInactivityTimeoutSeconds: number | null;
1408
+
1409
+ chatMaxDurationSeconds: number | null;
1410
+
1411
+ /**
1412
+ * ISO 8601.
1413
+ */
1414
+ createdAt: string;
1415
+
1416
+ createdById: string | null;
1417
+
1418
+ createdByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM';
1419
+
1420
+ endCallGoodbyeMessage: string | null;
1421
+
1422
+ /**
1423
+ * Phrases that end the call when the caller says them, matched anywhere in what
1424
+ * they say.
1425
+ */
1426
+ endDetectionPhrases: Array<string>;
1427
+
1428
+ /**
1429
+ * When the agent may decide to end the call itself.
1430
+ */
1431
+ endDetectionReasons: Array<string>;
1432
+
1433
+ /**
1434
+ * What the agent says first, with firstMessageMode SPEAK_TEXT.
1435
+ */
1436
+ firstMessage: string | null;
1437
+
1438
+ /**
1439
+ * The audio a call opens with, with firstMessageMode PLAY_AUDIO.
1440
+ */
1441
+ firstMessageAudioUrl: string | null;
1442
+
1443
+ firstMessageMode: 'SPEAK_TEXT' | 'PLAY_AUDIO' | 'WAIT_FOR_CALLER' | null;
1444
+
1445
+ idleMaxCount: number | null;
1446
+
1447
+ idleMessages: Array<string>;
1448
+
1449
+ idleTimeoutSeconds: number | null;
1450
+
1451
+ interruptionMode: 'ALLOW' | 'BLOCK' | null;
1452
+
1453
+ /**
1454
+ * ISO 639-1, e.g. en.
1455
+ */
1456
+ language: string | null;
1457
+
1458
+ /**
1459
+ * OpenAI Live models only: the text model they delegate to.
1460
+ */
1461
+ llmBackendModel: string | null;
1462
+
1463
+ llmMaxTokens: number | null;
1464
+
1465
+ /**
1466
+ * Any model id the provider accepts. One model serves every speaker.
1467
+ */
1468
+ llmModel: string | null;
1469
+
1470
+ llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
1471
+
1472
+ /**
1473
+ * 0 to 2.
1474
+ */
1475
+ llmTemperature: number | null;
1476
+
1477
+ /**
1478
+ * Speech-to-speech models only: the model's own voice.
1479
+ */
1480
+ llmVoice: string | null;
1481
+
1482
+ /**
1483
+ * Whether the agent takes calls, chats, or both.
1484
+ */
1485
+ modalities: Array<'call' | 'chat'>;
1486
+
1487
+ /**
1488
+ * ISO 8601.
1489
+ */
1490
+ publishedAt: string | null;
1491
+
1492
+ publishedById: string | null;
1493
+
1494
+ publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
1495
+
1496
+ /**
1497
+ * Set when this version restores an older one.
1498
+ */
1499
+ restoredFromVersionId: string | null;
1500
+
1501
+ /**
1502
+ * Increases with every edit to a draft. Send it back as expectedRevision when you
1503
+ * publish.
1504
+ */
1505
+ revision: number;
1506
+
1507
+ /**
1508
+ * DRAFT while being edited, PUBLISHED once it has been live.
1509
+ */
1510
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
1511
+
1512
+ sttEndpointingMs: number | null;
1513
+
1514
+ /**
1515
+ * Words and phrases the transcriber should listen for.
1516
+ */
1517
+ sttKeyterms: Array<string>;
1518
+
1519
+ sttModel: string | null;
1520
+
1521
+ sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
1522
+
1523
+ sttSmartFormat: boolean | null;
1524
+
1525
+ sttTurnDetection: 'pipeline' | 'provider' | null;
1526
+
1527
+ /**
1528
+ * The main agent (key `main`) first, then the sub-agents it can hand the call to.
1529
+ */
1530
+ subAgents: Array<Data.SubAgent>;
1531
+
1532
+ /**
1533
+ * What changed, written on publish.
1534
+ */
1535
+ summary: string | null;
1536
+
1537
+ /**
1538
+ * ISO 8601.
1539
+ */
1540
+ updatedAt: string;
1541
+
1542
+ vadStartSecs: number | null;
1543
+
1544
+ vadStopSecs: number | null;
1545
+
1546
+ /**
1547
+ * v1, v2, ... assigned on publish; null on a draft.
1548
+ */
1549
+ versionNumber: number | null;
1550
+
1551
+ /**
1552
+ * Why this version cannot run; empty when it can be published. Returned when
1553
+ * reading one version.
1554
+ */
1555
+ issues?: Array<Data.Issue>;
1556
+ }
1557
+
1558
+ export namespace Data {
1559
+ /**
1560
+ * A speaker in the conversation. On a sub-agent, null voice settings use the main
1561
+ * agent's.
1562
+ */
1563
+ export interface SubAgent {
1564
+ handoffs: Array<SubAgent.Handoff>;
1565
+
1566
+ /**
1567
+ * The call opens as this sub-agent instead of the main agent.
1568
+ */
1569
+ isInitial: boolean;
1570
+
1571
+ /**
1572
+ * `main` for the main agent; otherwise letters, digits, `_` or `-`.
1573
+ */
1574
+ key: string;
1575
+
1576
+ /**
1577
+ * How the agent refers to this speaker.
1578
+ */
1579
+ name: string | null;
1580
+
1581
+ /**
1582
+ * The speaker's prompt.
1583
+ */
1584
+ systemPrompt: string | null;
1585
+
1586
+ tools: Array<SubAgent.Tool>;
1587
+
1588
+ ttsModel: string | null;
1589
+
1590
+ ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
1591
+
1592
+ /**
1593
+ * 0 to 1, ElevenLabs.
1594
+ */
1595
+ ttsSimilarityBoost: number | null;
1596
+
1597
+ /**
1598
+ * 0.5 to 2.
1599
+ */
1600
+ ttsSpeed: number | null;
1601
+
1602
+ /**
1603
+ * 0 to 1, ElevenLabs.
1604
+ */
1605
+ ttsStability: number | null;
1606
+
1607
+ /**
1608
+ * Any voice id the provider accepts, including your own voices.
1609
+ */
1610
+ ttsVoiceId: string | null;
1611
+ }
1612
+
1613
+ export namespace SubAgent {
1614
+ export interface Handoff {
1615
+ /**
1616
+ * When to hand off, in the words the model is given.
1617
+ */
1618
+ description: string;
1619
+
1620
+ /**
1621
+ * SHARED: the new speaker hears the conversation so far. NONE: it starts fresh.
1622
+ */
1623
+ history: 'SHARED' | 'NONE';
1624
+
1625
+ /**
1626
+ * Added to the new speaker's prompt at the handoff, such as a warm-transfer brief.
1627
+ */
1628
+ note: string | null;
1629
+
1630
+ /**
1631
+ * At most once per call.
1632
+ */
1633
+ once: boolean;
1634
+
1635
+ /**
1636
+ * The key of the sub-agent that takes over; `main` for the main agent.
1637
+ */
1638
+ to: string;
1639
+ }
1640
+
1641
+ export interface Tool {
1642
+ /**
1643
+ * The tool version the agent runs; null runs the tool's latest declared version.
1644
+ */
1645
+ pinnedVersion: number | null;
1646
+
1647
+ toolDefinitionId: string;
1648
+ }
1649
+ }
1650
+
1651
+ /**
1652
+ * Something that stops a version from running.
1653
+ */
1654
+ export interface Issue {
1655
+ /**
1656
+ * The setting the issue is about.
1657
+ */
1658
+ field: string;
1659
+
1660
+ message: string;
1661
+ }
1662
+ }
1663
+ }
1664
+
1665
+ export interface AgentDraftCreateParams {
1666
+ /**
1667
+ * Start from this published version instead of the live one.
1668
+ */
1669
+ fromVersionId?: string;
1670
+ }
1671
+
1672
+ export interface AgentDraftUpdateParams {
1673
+ /**
1674
+ * The settings to change. Omitted settings stay as they are; null clears one to
1675
+ * the runtime default. subAgents replaces every speaker and must include `main`.
1676
+ */
1677
+ settings: AgentDraftUpdateParams.Settings;
1678
+
1679
+ /**
1680
+ * The draft's revision when you read it. When sent, the edit is refused if the
1681
+ * draft changed since; when omitted, it applies on top of the latest edit.
1682
+ */
1683
+ expectedRevision?: number;
1684
+ }
1685
+
1686
+ export namespace AgentDraftUpdateParams {
1687
+ /**
1688
+ * The settings to change. Omitted settings stay as they are; null clears one to
1689
+ * the runtime default. subAgents replaces every speaker and must include `main`.
1690
+ */
1691
+ export interface Settings {
1692
+ backgroundNoise?:
1693
+ | 'NONE'
1694
+ | 'AIRPORT'
1695
+ | 'CHILDREN_PLAYING'
1696
+ | 'CITY'
1697
+ | 'COFFEE_SHOP'
1698
+ | 'CONSTRUCTION'
1699
+ | 'CRYING_BABY'
1700
+ | 'DRIVING'
1701
+ | 'LIBRARY'
1702
+ | 'OFFICE'
1703
+ | 'THUNDERSTORM'
1704
+ | 'TRAIN'
1705
+ | null;
1706
+
1707
+ backgroundNoiseUrl?: string | null;
1708
+
1709
+ backgroundNoiseVolume?: number | null;
1710
+
1711
+ callMaxDurationSeconds?: number | null;
1712
+
1713
+ callSilenceTimeoutSeconds?: number | null;
1714
+
1715
+ chatInactivityTimeoutSeconds?: number | null;
1716
+
1717
+ chatMaxDurationSeconds?: number | null;
1718
+
1719
+ endCallGoodbyeMessage?: string | null;
1720
+
1721
+ endDetectionPhrases?: Array<string>;
1722
+
1723
+ endDetectionReasons?: Array<string>;
1724
+
1725
+ firstMessage?: string | null;
1726
+
1727
+ firstMessageAudioUrl?: string | null;
1728
+
1729
+ firstMessageMode?: 'SPEAK_TEXT' | 'PLAY_AUDIO' | 'WAIT_FOR_CALLER' | null;
1730
+
1731
+ idleMaxCount?: number | null;
1732
+
1733
+ idleMessages?: Array<string>;
1734
+
1735
+ idleTimeoutSeconds?: number | null;
1736
+
1737
+ interruptionMode?: 'ALLOW' | 'BLOCK' | null;
1738
+
1739
+ language?: string | null;
1740
+
1741
+ llmBackendModel?: string | null;
1742
+
1743
+ llmMaxTokens?: number | null;
1744
+
1745
+ llmModel?: string | null;
1746
+
1747
+ llmProvider?: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
1748
+
1749
+ llmTemperature?: number | null;
1750
+
1751
+ llmVoice?: string | null;
1752
+
1753
+ modalities?: Array<'call' | 'chat'>;
1754
+
1755
+ sttEndpointingMs?: number | null;
1756
+
1757
+ sttKeyterms?: Array<string>;
1758
+
1759
+ sttModel?: string | null;
1760
+
1761
+ sttProvider?: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
1762
+
1763
+ sttSmartFormat?: boolean | null;
1764
+
1765
+ sttTurnDetection?: 'pipeline' | 'provider' | null;
1766
+
1767
+ subAgents?: Array<Settings.SubAgent>;
1768
+
1769
+ vadStartSecs?: number | null;
1770
+
1771
+ vadStopSecs?: number | null;
1772
+ }
1773
+
1774
+ export namespace Settings {
1775
+ export interface SubAgent {
1776
+ handoffs: Array<SubAgent.Handoff>;
1777
+
1778
+ isInitial: boolean;
1779
+
1780
+ key: 'main' | string;
1781
+
1782
+ name: string | null;
1783
+
1784
+ systemPrompt: string | null;
1785
+
1786
+ tools: Array<SubAgent.Tool>;
1787
+
1788
+ ttsModel: string | null;
1789
+
1790
+ ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
1791
+
1792
+ ttsSimilarityBoost: number | null;
1793
+
1794
+ ttsSpeed: number | null;
1795
+
1796
+ ttsStability: number | null;
1797
+
1798
+ ttsVoiceId: string | null;
1799
+ }
1800
+
1801
+ export namespace SubAgent {
1802
+ export interface Handoff {
1803
+ description: string;
1804
+
1805
+ history: 'SHARED' | 'NONE';
1806
+
1807
+ note: string | null;
1808
+
1809
+ once: boolean;
1810
+
1811
+ to: 'main' | string;
1812
+ }
1813
+
1814
+ export interface Tool {
1815
+ pinnedVersion: number | null;
1816
+
1817
+ toolDefinitionId: string;
1818
+ }
1819
+ }
1820
+ }
1821
+ }
1822
+
1823
+ export interface AgentDraftPublishParams {
1824
+ /**
1825
+ * The draft revision you reviewed.
1826
+ */
1827
+ expectedRevision: number;
1828
+
1829
+ /**
1830
+ * What changed.
1831
+ */
1832
+ summary?: string;
1833
+ }
1834
+
1835
+ export declare namespace AgentDraft {
1836
+ export {
1837
+ type AgentDraftCreateResponse as AgentDraftCreateResponse,
1838
+ type AgentDraftUpdateResponse as AgentDraftUpdateResponse,
1839
+ type AgentDraftDeleteResponse as AgentDraftDeleteResponse,
1840
+ type AgentDraftGetResponse as AgentDraftGetResponse,
1841
+ type AgentDraftPublishResponse as AgentDraftPublishResponse,
1842
+ type AgentDraftCreateParams as AgentDraftCreateParams,
1843
+ type AgentDraftUpdateParams as AgentDraftUpdateParams,
1844
+ type AgentDraftPublishParams as AgentDraftPublishParams,
1845
+ };
1846
+ }