@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,1065 @@
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 AgentVersion extends APIResource {
9
+ /**
10
+ * The open draft first, if there is one, then published versions newest first.
11
+ * Paginated: pass `pagination.nextCursor` as `after` for the next page.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const agentVersions =
16
+ * await client.agentVersion.list('agentId');
17
+ * ```
18
+ */
19
+ list(
20
+ agentID: string,
21
+ query: AgentVersionListParams | null | undefined = {},
22
+ options?: RequestOptions,
23
+ ): APIPromise<AgentVersionListResponse> {
24
+ return this._client.get(path`/v1/agent/${agentID}/versions`, { query, ...options });
25
+ }
26
+
27
+ /**
28
+ * One version with every setting, plus the issues that stop it from running, if
29
+ * any.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const response = await client.agentVersion.getByID(
34
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
35
+ * { agentId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
36
+ * );
37
+ * ```
38
+ */
39
+ getByID(
40
+ versionID: string,
41
+ params: AgentVersionGetByIDParams,
42
+ options?: RequestOptions,
43
+ ): APIPromise<AgentVersionGetByIDResponse> {
44
+ const { agentId } = params;
45
+ return this._client.get(path`/v1/agent/${agentId}/versions/${versionID}`, options);
46
+ }
47
+
48
+ /**
49
+ * Roll back: publishes a new version, numbered after the latest, with this
50
+ * version's settings and makes it live. History stays append-only. An open draft
51
+ * started before this is kept but can no longer be published (409
52
+ * `agent_draft_base_changed`); discard it or start a new one. Pass
53
+ * `expectedLiveVersionId` to be refused (409 `agent_live_version_changed`) if
54
+ * another version went live since you read it.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const response = await client.agentVersion.restore(
59
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
60
+ * { agentId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
61
+ * );
62
+ * ```
63
+ */
64
+ restore(
65
+ versionID: string,
66
+ params: AgentVersionRestoreParams,
67
+ options?: RequestOptions,
68
+ ): APIPromise<AgentVersionRestoreResponse> {
69
+ const { agentId, ...body } = params;
70
+ return this._client.post(path`/v1/agent/${agentId}/versions/${versionID}/restore`, { body, ...options });
71
+ }
72
+ }
73
+
74
+ export interface AgentVersionListResponse {
75
+ data: Array<AgentVersionListResponse.Data>;
76
+
77
+ pagination: AgentVersionListResponse.Pagination;
78
+ }
79
+
80
+ export namespace AgentVersionListResponse {
81
+ /**
82
+ * One version of a Roark-hosted agent's configuration. Null settings use the
83
+ * runtime default.
84
+ */
85
+ export interface Data {
86
+ id: string;
87
+
88
+ agentId: string;
89
+
90
+ /**
91
+ * A background preset.
92
+ */
93
+ backgroundNoise:
94
+ | 'NONE'
95
+ | 'AIRPORT'
96
+ | 'CHILDREN_PLAYING'
97
+ | 'CITY'
98
+ | 'COFFEE_SHOP'
99
+ | 'CONSTRUCTION'
100
+ | 'CRYING_BABY'
101
+ | 'DRIVING'
102
+ | 'LIBRARY'
103
+ | 'OFFICE'
104
+ | 'THUNDERSTORM'
105
+ | 'TRAIN'
106
+ | null;
107
+
108
+ /**
109
+ * A custom background recording, instead of a preset.
110
+ */
111
+ backgroundNoiseUrl: string | null;
112
+
113
+ /**
114
+ * 0 to 1.
115
+ */
116
+ backgroundNoiseVolume: number | null;
117
+
118
+ /**
119
+ * The published version a draft started from.
120
+ */
121
+ baseVersionId: string | null;
122
+
123
+ callMaxDurationSeconds: number | null;
124
+
125
+ callSilenceTimeoutSeconds: number | null;
126
+
127
+ chatInactivityTimeoutSeconds: number | null;
128
+
129
+ chatMaxDurationSeconds: number | null;
130
+
131
+ /**
132
+ * ISO 8601.
133
+ */
134
+ createdAt: string;
135
+
136
+ createdById: string | null;
137
+
138
+ createdByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM';
139
+
140
+ endCallGoodbyeMessage: string | null;
141
+
142
+ /**
143
+ * Phrases that end the call when the caller says them, matched anywhere in what
144
+ * they say.
145
+ */
146
+ endDetectionPhrases: Array<string>;
147
+
148
+ /**
149
+ * When the agent may decide to end the call itself.
150
+ */
151
+ endDetectionReasons: Array<string>;
152
+
153
+ /**
154
+ * What the agent says first, with firstMessageMode SPEAK_TEXT.
155
+ */
156
+ firstMessage: string | null;
157
+
158
+ /**
159
+ * The audio a call opens with, with firstMessageMode PLAY_AUDIO.
160
+ */
161
+ firstMessageAudioUrl: string | null;
162
+
163
+ firstMessageMode: 'SPEAK_TEXT' | 'PLAY_AUDIO' | 'WAIT_FOR_CALLER' | null;
164
+
165
+ idleMaxCount: number | null;
166
+
167
+ idleMessages: Array<string>;
168
+
169
+ idleTimeoutSeconds: number | null;
170
+
171
+ interruptionMode: 'ALLOW' | 'BLOCK' | null;
172
+
173
+ /**
174
+ * ISO 639-1, e.g. en.
175
+ */
176
+ language: string | null;
177
+
178
+ /**
179
+ * OpenAI Live models only: the text model they delegate to.
180
+ */
181
+ llmBackendModel: string | null;
182
+
183
+ llmMaxTokens: number | null;
184
+
185
+ /**
186
+ * Any model id the provider accepts. One model serves every speaker.
187
+ */
188
+ llmModel: string | null;
189
+
190
+ llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
191
+
192
+ /**
193
+ * 0 to 2.
194
+ */
195
+ llmTemperature: number | null;
196
+
197
+ /**
198
+ * Speech-to-speech models only: the model's own voice.
199
+ */
200
+ llmVoice: string | null;
201
+
202
+ /**
203
+ * Whether the agent takes calls, chats, or both.
204
+ */
205
+ modalities: Array<'call' | 'chat'>;
206
+
207
+ /**
208
+ * ISO 8601.
209
+ */
210
+ publishedAt: string | null;
211
+
212
+ publishedById: string | null;
213
+
214
+ publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
215
+
216
+ /**
217
+ * Set when this version restores an older one.
218
+ */
219
+ restoredFromVersionId: string | null;
220
+
221
+ /**
222
+ * Increases with every edit to a draft. Send it back as expectedRevision when you
223
+ * publish.
224
+ */
225
+ revision: number;
226
+
227
+ /**
228
+ * DRAFT while being edited, PUBLISHED once it has been live.
229
+ */
230
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
231
+
232
+ sttEndpointingMs: number | null;
233
+
234
+ /**
235
+ * Words and phrases the transcriber should listen for.
236
+ */
237
+ sttKeyterms: Array<string>;
238
+
239
+ sttModel: string | null;
240
+
241
+ sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
242
+
243
+ sttSmartFormat: boolean | null;
244
+
245
+ sttTurnDetection: 'pipeline' | 'provider' | null;
246
+
247
+ /**
248
+ * The main agent (key `main`) first, then the sub-agents it can hand the call to.
249
+ */
250
+ subAgents: Array<Data.SubAgent>;
251
+
252
+ /**
253
+ * What changed, written on publish.
254
+ */
255
+ summary: string | null;
256
+
257
+ /**
258
+ * ISO 8601.
259
+ */
260
+ updatedAt: string;
261
+
262
+ vadStartSecs: number | null;
263
+
264
+ vadStopSecs: number | null;
265
+
266
+ /**
267
+ * v1, v2, ... assigned on publish; null on a draft.
268
+ */
269
+ versionNumber: number | null;
270
+
271
+ /**
272
+ * Why this version cannot run; empty when it can be published. Returned when
273
+ * reading one version.
274
+ */
275
+ issues?: Array<Data.Issue>;
276
+ }
277
+
278
+ export namespace Data {
279
+ /**
280
+ * A speaker in the conversation. On a sub-agent, null voice settings use the main
281
+ * agent's.
282
+ */
283
+ export interface SubAgent {
284
+ handoffs: Array<SubAgent.Handoff>;
285
+
286
+ /**
287
+ * The call opens as this sub-agent instead of the main agent.
288
+ */
289
+ isInitial: boolean;
290
+
291
+ /**
292
+ * `main` for the main agent; otherwise letters, digits, `_` or `-`.
293
+ */
294
+ key: string;
295
+
296
+ /**
297
+ * How the agent refers to this speaker.
298
+ */
299
+ name: string | null;
300
+
301
+ /**
302
+ * The speaker's prompt.
303
+ */
304
+ systemPrompt: string | null;
305
+
306
+ tools: Array<SubAgent.Tool>;
307
+
308
+ ttsModel: string | null;
309
+
310
+ ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
311
+
312
+ /**
313
+ * 0 to 1, ElevenLabs.
314
+ */
315
+ ttsSimilarityBoost: number | null;
316
+
317
+ /**
318
+ * 0.5 to 2.
319
+ */
320
+ ttsSpeed: number | null;
321
+
322
+ /**
323
+ * 0 to 1, ElevenLabs.
324
+ */
325
+ ttsStability: number | null;
326
+
327
+ /**
328
+ * Any voice id the provider accepts, including your own voices.
329
+ */
330
+ ttsVoiceId: string | null;
331
+ }
332
+
333
+ export namespace SubAgent {
334
+ export interface Handoff {
335
+ /**
336
+ * When to hand off, in the words the model is given.
337
+ */
338
+ description: string;
339
+
340
+ /**
341
+ * SHARED: the new speaker hears the conversation so far. NONE: it starts fresh.
342
+ */
343
+ history: 'SHARED' | 'NONE';
344
+
345
+ /**
346
+ * Added to the new speaker's prompt at the handoff, such as a warm-transfer brief.
347
+ */
348
+ note: string | null;
349
+
350
+ /**
351
+ * At most once per call.
352
+ */
353
+ once: boolean;
354
+
355
+ /**
356
+ * The key of the sub-agent that takes over; `main` for the main agent.
357
+ */
358
+ to: string;
359
+ }
360
+
361
+ export interface Tool {
362
+ /**
363
+ * The tool version the agent runs; null runs the tool's latest declared version.
364
+ */
365
+ pinnedVersion: number | null;
366
+
367
+ toolDefinitionId: string;
368
+ }
369
+ }
370
+
371
+ /**
372
+ * Something that stops a version from running.
373
+ */
374
+ export interface Issue {
375
+ /**
376
+ * The setting the issue is about.
377
+ */
378
+ field: string;
379
+
380
+ message: string;
381
+ }
382
+ }
383
+
384
+ export interface Pagination {
385
+ /**
386
+ * Whether there are more items to fetch
387
+ */
388
+ hasMore: boolean;
389
+
390
+ /**
391
+ * Cursor for the next page of items
392
+ */
393
+ nextCursor: string | null;
394
+
395
+ /**
396
+ * Total number of items
397
+ */
398
+ total: number;
399
+ }
400
+ }
401
+
402
+ export interface AgentVersionGetByIDResponse {
403
+ /**
404
+ * One version of a Roark-hosted agent's configuration. Null settings use the
405
+ * runtime default.
406
+ */
407
+ data: AgentVersionGetByIDResponse.Data;
408
+ }
409
+
410
+ export namespace AgentVersionGetByIDResponse {
411
+ /**
412
+ * One version of a Roark-hosted agent's configuration. Null settings use the
413
+ * runtime default.
414
+ */
415
+ export interface Data {
416
+ id: string;
417
+
418
+ agentId: string;
419
+
420
+ /**
421
+ * A background preset.
422
+ */
423
+ backgroundNoise:
424
+ | 'NONE'
425
+ | 'AIRPORT'
426
+ | 'CHILDREN_PLAYING'
427
+ | 'CITY'
428
+ | 'COFFEE_SHOP'
429
+ | 'CONSTRUCTION'
430
+ | 'CRYING_BABY'
431
+ | 'DRIVING'
432
+ | 'LIBRARY'
433
+ | 'OFFICE'
434
+ | 'THUNDERSTORM'
435
+ | 'TRAIN'
436
+ | null;
437
+
438
+ /**
439
+ * A custom background recording, instead of a preset.
440
+ */
441
+ backgroundNoiseUrl: string | null;
442
+
443
+ /**
444
+ * 0 to 1.
445
+ */
446
+ backgroundNoiseVolume: number | null;
447
+
448
+ /**
449
+ * The published version a draft started from.
450
+ */
451
+ baseVersionId: string | null;
452
+
453
+ callMaxDurationSeconds: number | null;
454
+
455
+ callSilenceTimeoutSeconds: number | null;
456
+
457
+ chatInactivityTimeoutSeconds: number | null;
458
+
459
+ chatMaxDurationSeconds: number | null;
460
+
461
+ /**
462
+ * ISO 8601.
463
+ */
464
+ createdAt: string;
465
+
466
+ createdById: string | null;
467
+
468
+ createdByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM';
469
+
470
+ endCallGoodbyeMessage: string | null;
471
+
472
+ /**
473
+ * Phrases that end the call when the caller says them, matched anywhere in what
474
+ * they say.
475
+ */
476
+ endDetectionPhrases: Array<string>;
477
+
478
+ /**
479
+ * When the agent may decide to end the call itself.
480
+ */
481
+ endDetectionReasons: Array<string>;
482
+
483
+ /**
484
+ * What the agent says first, with firstMessageMode SPEAK_TEXT.
485
+ */
486
+ firstMessage: string | null;
487
+
488
+ /**
489
+ * The audio a call opens with, with firstMessageMode PLAY_AUDIO.
490
+ */
491
+ firstMessageAudioUrl: string | null;
492
+
493
+ firstMessageMode: 'SPEAK_TEXT' | 'PLAY_AUDIO' | 'WAIT_FOR_CALLER' | null;
494
+
495
+ idleMaxCount: number | null;
496
+
497
+ idleMessages: Array<string>;
498
+
499
+ idleTimeoutSeconds: number | null;
500
+
501
+ interruptionMode: 'ALLOW' | 'BLOCK' | null;
502
+
503
+ /**
504
+ * ISO 639-1, e.g. en.
505
+ */
506
+ language: string | null;
507
+
508
+ /**
509
+ * OpenAI Live models only: the text model they delegate to.
510
+ */
511
+ llmBackendModel: string | null;
512
+
513
+ llmMaxTokens: number | null;
514
+
515
+ /**
516
+ * Any model id the provider accepts. One model serves every speaker.
517
+ */
518
+ llmModel: string | null;
519
+
520
+ llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
521
+
522
+ /**
523
+ * 0 to 2.
524
+ */
525
+ llmTemperature: number | null;
526
+
527
+ /**
528
+ * Speech-to-speech models only: the model's own voice.
529
+ */
530
+ llmVoice: string | null;
531
+
532
+ /**
533
+ * Whether the agent takes calls, chats, or both.
534
+ */
535
+ modalities: Array<'call' | 'chat'>;
536
+
537
+ /**
538
+ * ISO 8601.
539
+ */
540
+ publishedAt: string | null;
541
+
542
+ publishedById: string | null;
543
+
544
+ publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
545
+
546
+ /**
547
+ * Set when this version restores an older one.
548
+ */
549
+ restoredFromVersionId: string | null;
550
+
551
+ /**
552
+ * Increases with every edit to a draft. Send it back as expectedRevision when you
553
+ * publish.
554
+ */
555
+ revision: number;
556
+
557
+ /**
558
+ * DRAFT while being edited, PUBLISHED once it has been live.
559
+ */
560
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
561
+
562
+ sttEndpointingMs: number | null;
563
+
564
+ /**
565
+ * Words and phrases the transcriber should listen for.
566
+ */
567
+ sttKeyterms: Array<string>;
568
+
569
+ sttModel: string | null;
570
+
571
+ sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
572
+
573
+ sttSmartFormat: boolean | null;
574
+
575
+ sttTurnDetection: 'pipeline' | 'provider' | null;
576
+
577
+ /**
578
+ * The main agent (key `main`) first, then the sub-agents it can hand the call to.
579
+ */
580
+ subAgents: Array<Data.SubAgent>;
581
+
582
+ /**
583
+ * What changed, written on publish.
584
+ */
585
+ summary: string | null;
586
+
587
+ /**
588
+ * ISO 8601.
589
+ */
590
+ updatedAt: string;
591
+
592
+ vadStartSecs: number | null;
593
+
594
+ vadStopSecs: number | null;
595
+
596
+ /**
597
+ * v1, v2, ... assigned on publish; null on a draft.
598
+ */
599
+ versionNumber: number | null;
600
+
601
+ /**
602
+ * Why this version cannot run; empty when it can be published. Returned when
603
+ * reading one version.
604
+ */
605
+ issues?: Array<Data.Issue>;
606
+ }
607
+
608
+ export namespace Data {
609
+ /**
610
+ * A speaker in the conversation. On a sub-agent, null voice settings use the main
611
+ * agent's.
612
+ */
613
+ export interface SubAgent {
614
+ handoffs: Array<SubAgent.Handoff>;
615
+
616
+ /**
617
+ * The call opens as this sub-agent instead of the main agent.
618
+ */
619
+ isInitial: boolean;
620
+
621
+ /**
622
+ * `main` for the main agent; otherwise letters, digits, `_` or `-`.
623
+ */
624
+ key: string;
625
+
626
+ /**
627
+ * How the agent refers to this speaker.
628
+ */
629
+ name: string | null;
630
+
631
+ /**
632
+ * The speaker's prompt.
633
+ */
634
+ systemPrompt: string | null;
635
+
636
+ tools: Array<SubAgent.Tool>;
637
+
638
+ ttsModel: string | null;
639
+
640
+ ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
641
+
642
+ /**
643
+ * 0 to 1, ElevenLabs.
644
+ */
645
+ ttsSimilarityBoost: number | null;
646
+
647
+ /**
648
+ * 0.5 to 2.
649
+ */
650
+ ttsSpeed: number | null;
651
+
652
+ /**
653
+ * 0 to 1, ElevenLabs.
654
+ */
655
+ ttsStability: number | null;
656
+
657
+ /**
658
+ * Any voice id the provider accepts, including your own voices.
659
+ */
660
+ ttsVoiceId: string | null;
661
+ }
662
+
663
+ export namespace SubAgent {
664
+ export interface Handoff {
665
+ /**
666
+ * When to hand off, in the words the model is given.
667
+ */
668
+ description: string;
669
+
670
+ /**
671
+ * SHARED: the new speaker hears the conversation so far. NONE: it starts fresh.
672
+ */
673
+ history: 'SHARED' | 'NONE';
674
+
675
+ /**
676
+ * Added to the new speaker's prompt at the handoff, such as a warm-transfer brief.
677
+ */
678
+ note: string | null;
679
+
680
+ /**
681
+ * At most once per call.
682
+ */
683
+ once: boolean;
684
+
685
+ /**
686
+ * The key of the sub-agent that takes over; `main` for the main agent.
687
+ */
688
+ to: string;
689
+ }
690
+
691
+ export interface Tool {
692
+ /**
693
+ * The tool version the agent runs; null runs the tool's latest declared version.
694
+ */
695
+ pinnedVersion: number | null;
696
+
697
+ toolDefinitionId: string;
698
+ }
699
+ }
700
+
701
+ /**
702
+ * Something that stops a version from running.
703
+ */
704
+ export interface Issue {
705
+ /**
706
+ * The setting the issue is about.
707
+ */
708
+ field: string;
709
+
710
+ message: string;
711
+ }
712
+ }
713
+ }
714
+
715
+ export interface AgentVersionRestoreResponse {
716
+ /**
717
+ * One version of a Roark-hosted agent's configuration. Null settings use the
718
+ * runtime default.
719
+ */
720
+ data: AgentVersionRestoreResponse.Data;
721
+ }
722
+
723
+ export namespace AgentVersionRestoreResponse {
724
+ /**
725
+ * One version of a Roark-hosted agent's configuration. Null settings use the
726
+ * runtime default.
727
+ */
728
+ export interface Data {
729
+ id: string;
730
+
731
+ agentId: string;
732
+
733
+ /**
734
+ * A background preset.
735
+ */
736
+ backgroundNoise:
737
+ | 'NONE'
738
+ | 'AIRPORT'
739
+ | 'CHILDREN_PLAYING'
740
+ | 'CITY'
741
+ | 'COFFEE_SHOP'
742
+ | 'CONSTRUCTION'
743
+ | 'CRYING_BABY'
744
+ | 'DRIVING'
745
+ | 'LIBRARY'
746
+ | 'OFFICE'
747
+ | 'THUNDERSTORM'
748
+ | 'TRAIN'
749
+ | null;
750
+
751
+ /**
752
+ * A custom background recording, instead of a preset.
753
+ */
754
+ backgroundNoiseUrl: string | null;
755
+
756
+ /**
757
+ * 0 to 1.
758
+ */
759
+ backgroundNoiseVolume: number | null;
760
+
761
+ /**
762
+ * The published version a draft started from.
763
+ */
764
+ baseVersionId: string | null;
765
+
766
+ callMaxDurationSeconds: number | null;
767
+
768
+ callSilenceTimeoutSeconds: number | null;
769
+
770
+ chatInactivityTimeoutSeconds: number | null;
771
+
772
+ chatMaxDurationSeconds: number | null;
773
+
774
+ /**
775
+ * ISO 8601.
776
+ */
777
+ createdAt: string;
778
+
779
+ createdById: string | null;
780
+
781
+ createdByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM';
782
+
783
+ endCallGoodbyeMessage: string | null;
784
+
785
+ /**
786
+ * Phrases that end the call when the caller says them, matched anywhere in what
787
+ * they say.
788
+ */
789
+ endDetectionPhrases: Array<string>;
790
+
791
+ /**
792
+ * When the agent may decide to end the call itself.
793
+ */
794
+ endDetectionReasons: Array<string>;
795
+
796
+ /**
797
+ * What the agent says first, with firstMessageMode SPEAK_TEXT.
798
+ */
799
+ firstMessage: string | null;
800
+
801
+ /**
802
+ * The audio a call opens with, with firstMessageMode PLAY_AUDIO.
803
+ */
804
+ firstMessageAudioUrl: string | null;
805
+
806
+ firstMessageMode: 'SPEAK_TEXT' | 'PLAY_AUDIO' | 'WAIT_FOR_CALLER' | null;
807
+
808
+ idleMaxCount: number | null;
809
+
810
+ idleMessages: Array<string>;
811
+
812
+ idleTimeoutSeconds: number | null;
813
+
814
+ interruptionMode: 'ALLOW' | 'BLOCK' | null;
815
+
816
+ /**
817
+ * ISO 639-1, e.g. en.
818
+ */
819
+ language: string | null;
820
+
821
+ /**
822
+ * OpenAI Live models only: the text model they delegate to.
823
+ */
824
+ llmBackendModel: string | null;
825
+
826
+ llmMaxTokens: number | null;
827
+
828
+ /**
829
+ * Any model id the provider accepts. One model serves every speaker.
830
+ */
831
+ llmModel: string | null;
832
+
833
+ llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
834
+
835
+ /**
836
+ * 0 to 2.
837
+ */
838
+ llmTemperature: number | null;
839
+
840
+ /**
841
+ * Speech-to-speech models only: the model's own voice.
842
+ */
843
+ llmVoice: string | null;
844
+
845
+ /**
846
+ * Whether the agent takes calls, chats, or both.
847
+ */
848
+ modalities: Array<'call' | 'chat'>;
849
+
850
+ /**
851
+ * ISO 8601.
852
+ */
853
+ publishedAt: string | null;
854
+
855
+ publishedById: string | null;
856
+
857
+ publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
858
+
859
+ /**
860
+ * Set when this version restores an older one.
861
+ */
862
+ restoredFromVersionId: string | null;
863
+
864
+ /**
865
+ * Increases with every edit to a draft. Send it back as expectedRevision when you
866
+ * publish.
867
+ */
868
+ revision: number;
869
+
870
+ /**
871
+ * DRAFT while being edited, PUBLISHED once it has been live.
872
+ */
873
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
874
+
875
+ sttEndpointingMs: number | null;
876
+
877
+ /**
878
+ * Words and phrases the transcriber should listen for.
879
+ */
880
+ sttKeyterms: Array<string>;
881
+
882
+ sttModel: string | null;
883
+
884
+ sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
885
+
886
+ sttSmartFormat: boolean | null;
887
+
888
+ sttTurnDetection: 'pipeline' | 'provider' | null;
889
+
890
+ /**
891
+ * The main agent (key `main`) first, then the sub-agents it can hand the call to.
892
+ */
893
+ subAgents: Array<Data.SubAgent>;
894
+
895
+ /**
896
+ * What changed, written on publish.
897
+ */
898
+ summary: string | null;
899
+
900
+ /**
901
+ * ISO 8601.
902
+ */
903
+ updatedAt: string;
904
+
905
+ vadStartSecs: number | null;
906
+
907
+ vadStopSecs: number | null;
908
+
909
+ /**
910
+ * v1, v2, ... assigned on publish; null on a draft.
911
+ */
912
+ versionNumber: number | null;
913
+
914
+ /**
915
+ * Why this version cannot run; empty when it can be published. Returned when
916
+ * reading one version.
917
+ */
918
+ issues?: Array<Data.Issue>;
919
+ }
920
+
921
+ export namespace Data {
922
+ /**
923
+ * A speaker in the conversation. On a sub-agent, null voice settings use the main
924
+ * agent's.
925
+ */
926
+ export interface SubAgent {
927
+ handoffs: Array<SubAgent.Handoff>;
928
+
929
+ /**
930
+ * The call opens as this sub-agent instead of the main agent.
931
+ */
932
+ isInitial: boolean;
933
+
934
+ /**
935
+ * `main` for the main agent; otherwise letters, digits, `_` or `-`.
936
+ */
937
+ key: string;
938
+
939
+ /**
940
+ * How the agent refers to this speaker.
941
+ */
942
+ name: string | null;
943
+
944
+ /**
945
+ * The speaker's prompt.
946
+ */
947
+ systemPrompt: string | null;
948
+
949
+ tools: Array<SubAgent.Tool>;
950
+
951
+ ttsModel: string | null;
952
+
953
+ ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
954
+
955
+ /**
956
+ * 0 to 1, ElevenLabs.
957
+ */
958
+ ttsSimilarityBoost: number | null;
959
+
960
+ /**
961
+ * 0.5 to 2.
962
+ */
963
+ ttsSpeed: number | null;
964
+
965
+ /**
966
+ * 0 to 1, ElevenLabs.
967
+ */
968
+ ttsStability: number | null;
969
+
970
+ /**
971
+ * Any voice id the provider accepts, including your own voices.
972
+ */
973
+ ttsVoiceId: string | null;
974
+ }
975
+
976
+ export namespace SubAgent {
977
+ export interface Handoff {
978
+ /**
979
+ * When to hand off, in the words the model is given.
980
+ */
981
+ description: string;
982
+
983
+ /**
984
+ * SHARED: the new speaker hears the conversation so far. NONE: it starts fresh.
985
+ */
986
+ history: 'SHARED' | 'NONE';
987
+
988
+ /**
989
+ * Added to the new speaker's prompt at the handoff, such as a warm-transfer brief.
990
+ */
991
+ note: string | null;
992
+
993
+ /**
994
+ * At most once per call.
995
+ */
996
+ once: boolean;
997
+
998
+ /**
999
+ * The key of the sub-agent that takes over; `main` for the main agent.
1000
+ */
1001
+ to: string;
1002
+ }
1003
+
1004
+ export interface Tool {
1005
+ /**
1006
+ * The tool version the agent runs; null runs the tool's latest declared version.
1007
+ */
1008
+ pinnedVersion: number | null;
1009
+
1010
+ toolDefinitionId: string;
1011
+ }
1012
+ }
1013
+
1014
+ /**
1015
+ * Something that stops a version from running.
1016
+ */
1017
+ export interface Issue {
1018
+ /**
1019
+ * The setting the issue is about.
1020
+ */
1021
+ field: string;
1022
+
1023
+ message: string;
1024
+ }
1025
+ }
1026
+ }
1027
+
1028
+ export interface AgentVersionListParams {
1029
+ after?: string;
1030
+
1031
+ limit?: number;
1032
+ }
1033
+
1034
+ export interface AgentVersionGetByIDParams {
1035
+ agentId: string;
1036
+ }
1037
+
1038
+ export interface AgentVersionRestoreParams {
1039
+ /**
1040
+ * Path param
1041
+ */
1042
+ agentId: string;
1043
+
1044
+ /**
1045
+ * Body param: The live version when you decided to restore. When sent, the restore
1046
+ * is refused with 409 if another version went live since.
1047
+ */
1048
+ expectedLiveVersionId?: string;
1049
+
1050
+ /**
1051
+ * Body param
1052
+ */
1053
+ summary?: string;
1054
+ }
1055
+
1056
+ export declare namespace AgentVersion {
1057
+ export {
1058
+ type AgentVersionListResponse as AgentVersionListResponse,
1059
+ type AgentVersionGetByIDResponse as AgentVersionGetByIDResponse,
1060
+ type AgentVersionRestoreResponse as AgentVersionRestoreResponse,
1061
+ type AgentVersionListParams as AgentVersionListParams,
1062
+ type AgentVersionGetByIDParams as AgentVersionGetByIDParams,
1063
+ type AgentVersionRestoreParams as AgentVersionRestoreParams,
1064
+ };
1065
+ }