@roarkanalytics/sdk 7.8.0 → 8.0.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 (205) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/client.d.mts +20 -5
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +20 -5
  5. package/client.d.ts.map +1 -1
  6. package/client.js +18 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +18 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent-connection.d.mts +1952 -0
  12. package/resources/agent-connection.d.mts.map +1 -0
  13. package/resources/agent-connection.d.ts +1952 -0
  14. package/resources/agent-connection.d.ts.map +1 -0
  15. package/resources/agent-connection.js +173 -0
  16. package/resources/agent-connection.js.map +1 -0
  17. package/resources/agent-connection.mjs +169 -0
  18. package/resources/agent-connection.mjs.map +1 -0
  19. package/resources/agent-conversation.d.mts +110 -0
  20. package/resources/agent-conversation.d.mts.map +1 -0
  21. package/resources/agent-conversation.d.ts +110 -0
  22. package/resources/agent-conversation.d.ts.map +1 -0
  23. package/resources/agent-conversation.js +41 -0
  24. package/resources/agent-conversation.js.map +1 -0
  25. package/resources/agent-conversation.mjs +37 -0
  26. package/resources/agent-conversation.mjs.map +1 -0
  27. package/resources/agent-draft.d.mts +101 -35
  28. package/resources/agent-draft.d.mts.map +1 -1
  29. package/resources/agent-draft.d.ts +101 -35
  30. package/resources/agent-draft.d.ts.map +1 -1
  31. package/resources/agent-endpoint.d.mts +4 -4
  32. package/resources/agent-endpoint.d.mts.map +1 -1
  33. package/resources/agent-endpoint.d.ts +4 -4
  34. package/resources/agent-endpoint.d.ts.map +1 -1
  35. package/resources/agent-setup.d.mts +1057 -0
  36. package/resources/agent-setup.d.mts.map +1 -0
  37. package/resources/agent-setup.d.ts +1057 -0
  38. package/resources/agent-setup.d.ts.map +1 -0
  39. package/resources/agent-setup.js +113 -0
  40. package/resources/agent-setup.js.map +1 -0
  41. package/resources/agent-setup.mjs +109 -0
  42. package/resources/agent-setup.mjs.map +1 -0
  43. package/resources/agent-version.d.mts +57 -18
  44. package/resources/agent-version.d.mts.map +1 -1
  45. package/resources/agent-version.d.ts +57 -18
  46. package/resources/agent-version.d.ts.map +1 -1
  47. package/resources/agent.d.mts +263 -4
  48. package/resources/agent.d.mts.map +1 -1
  49. package/resources/agent.d.ts +263 -4
  50. package/resources/agent.d.ts.map +1 -1
  51. package/resources/calendar-connection.d.mts +834 -56
  52. package/resources/calendar-connection.d.mts.map +1 -1
  53. package/resources/calendar-connection.d.ts +834 -56
  54. package/resources/calendar-connection.d.ts.map +1 -1
  55. package/resources/calendar-connection.js +127 -8
  56. package/resources/calendar-connection.js.map +1 -1
  57. package/resources/calendar-connection.mjs +127 -8
  58. package/resources/calendar-connection.mjs.map +1 -1
  59. package/resources/call.d.mts +2 -2
  60. package/resources/call.d.mts.map +1 -1
  61. package/resources/call.d.ts +2 -2
  62. package/resources/call.d.ts.map +1 -1
  63. package/resources/config.d.mts +78 -36
  64. package/resources/config.d.mts.map +1 -1
  65. package/resources/config.d.ts +78 -36
  66. package/resources/config.d.ts.map +1 -1
  67. package/resources/conversation.d.mts +156 -0
  68. package/resources/conversation.d.mts.map +1 -0
  69. package/resources/conversation.d.ts +156 -0
  70. package/resources/conversation.d.ts.map +1 -0
  71. package/resources/conversation.js +40 -0
  72. package/resources/conversation.js.map +1 -0
  73. package/resources/conversation.mjs +36 -0
  74. package/resources/conversation.mjs.map +1 -0
  75. package/resources/customer-flow-edge-case.d.mts +637 -40
  76. package/resources/customer-flow-edge-case.d.mts.map +1 -1
  77. package/resources/customer-flow-edge-case.d.ts +637 -40
  78. package/resources/customer-flow-edge-case.d.ts.map +1 -1
  79. package/resources/customer-flow.d.mts +2583 -156
  80. package/resources/customer-flow.d.mts.map +1 -1
  81. package/resources/customer-flow.d.ts +2583 -156
  82. package/resources/customer-flow.d.ts.map +1 -1
  83. package/resources/{customer-profile.d.mts → customer.d.mts} +287 -98
  84. package/resources/customer.d.mts.map +1 -0
  85. package/resources/{customer-profile.d.ts → customer.d.ts} +287 -98
  86. package/resources/customer.d.ts.map +1 -0
  87. package/resources/customer.js +180 -0
  88. package/resources/customer.js.map +1 -0
  89. package/resources/customer.mjs +176 -0
  90. package/resources/customer.mjs.map +1 -0
  91. package/resources/index.d.mts +7 -2
  92. package/resources/index.d.mts.map +1 -1
  93. package/resources/index.d.ts +7 -2
  94. package/resources/index.d.ts.map +1 -1
  95. package/resources/index.js +13 -3
  96. package/resources/index.js.map +1 -1
  97. package/resources/index.mjs +6 -1
  98. package/resources/index.mjs.map +1 -1
  99. package/resources/mcp-server.d.mts +588 -0
  100. package/resources/mcp-server.d.mts.map +1 -0
  101. package/resources/mcp-server.d.ts +588 -0
  102. package/resources/mcp-server.d.ts.map +1 -0
  103. package/resources/mcp-server.js +109 -0
  104. package/resources/mcp-server.js.map +1 -0
  105. package/resources/mcp-server.mjs +105 -0
  106. package/resources/mcp-server.mjs.map +1 -0
  107. package/resources/metric-policy.d.mts +5 -4
  108. package/resources/metric-policy.d.mts.map +1 -1
  109. package/resources/metric-policy.d.ts +5 -4
  110. package/resources/metric-policy.d.ts.map +1 -1
  111. package/resources/metric-policy.js +1 -1
  112. package/resources/metric-policy.mjs +1 -1
  113. package/resources/metric-variant.d.mts +4 -1
  114. package/resources/metric-variant.d.mts.map +1 -1
  115. package/resources/metric-variant.d.ts +4 -1
  116. package/resources/metric-variant.d.ts.map +1 -1
  117. package/resources/metric.d.mts +7 -2
  118. package/resources/metric.d.mts.map +1 -1
  119. package/resources/metric.d.ts +7 -2
  120. package/resources/metric.d.ts.map +1 -1
  121. package/resources/simulation-environment.d.mts +366 -0
  122. package/resources/simulation-environment.d.mts.map +1 -1
  123. package/resources/simulation-environment.d.ts +366 -0
  124. package/resources/simulation-environment.d.ts.map +1 -1
  125. package/resources/simulation-job.d.mts +12 -8
  126. package/resources/simulation-job.d.mts.map +1 -1
  127. package/resources/simulation-job.d.ts +12 -8
  128. package/resources/simulation-job.d.ts.map +1 -1
  129. package/resources/simulation-persona.d.mts +25 -15
  130. package/resources/simulation-persona.d.mts.map +1 -1
  131. package/resources/simulation-persona.d.ts +25 -15
  132. package/resources/simulation-persona.d.ts.map +1 -1
  133. package/resources/simulation-run-plan-job.d.mts +32 -6
  134. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  135. package/resources/simulation-run-plan-job.d.ts +32 -6
  136. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  137. package/resources/simulation-run-plan.d.mts +126 -13
  138. package/resources/simulation-run-plan.d.mts.map +1 -1
  139. package/resources/simulation-run-plan.d.ts +126 -13
  140. package/resources/simulation-run-plan.d.ts.map +1 -1
  141. package/resources/simulation-template.d.mts +1 -1
  142. package/resources/simulation-template.d.mts.map +1 -1
  143. package/resources/simulation-template.d.ts +1 -1
  144. package/resources/simulation-template.d.ts.map +1 -1
  145. package/resources/simulation.d.mts +35 -3
  146. package/resources/simulation.d.mts.map +1 -1
  147. package/resources/simulation.d.ts +35 -3
  148. package/resources/simulation.d.ts.map +1 -1
  149. package/resources/tool.d.mts +565 -6
  150. package/resources/tool.d.mts.map +1 -1
  151. package/resources/tool.d.ts +565 -6
  152. package/resources/tool.d.ts.map +1 -1
  153. package/resources/tool.js +9 -6
  154. package/resources/tool.js.map +1 -1
  155. package/resources/tool.mjs +9 -6
  156. package/resources/tool.mjs.map +1 -1
  157. package/resources/usage.d.mts +1 -1
  158. package/resources/usage.d.mts.map +1 -1
  159. package/resources/usage.d.ts +1 -1
  160. package/resources/usage.d.ts.map +1 -1
  161. package/resources/webhook.d.mts +4 -4
  162. package/resources/webhook.d.mts.map +1 -1
  163. package/resources/webhook.d.ts +4 -4
  164. package/resources/webhook.d.ts.map +1 -1
  165. package/src/client.ts +197 -34
  166. package/src/resources/agent-connection.ts +2523 -0
  167. package/src/resources/agent-conversation.ts +139 -0
  168. package/src/resources/agent-draft.ts +239 -35
  169. package/src/resources/agent-endpoint.ts +8 -4
  170. package/src/resources/agent-setup.ts +1685 -0
  171. package/src/resources/agent-version.ts +126 -18
  172. package/src/resources/agent.ts +506 -4
  173. package/src/resources/calendar-connection.ts +1035 -63
  174. package/src/resources/call.ts +12 -2
  175. package/src/resources/config.ts +198 -36
  176. package/src/resources/conversation.ts +205 -0
  177. package/src/resources/customer-flow-edge-case.ts +709 -40
  178. package/src/resources/customer-flow.ts +3141 -156
  179. package/src/resources/{customer-profile.ts → customer.ts} +406 -306
  180. package/src/resources/index.ts +91 -17
  181. package/src/resources/mcp-server.ts +786 -0
  182. package/src/resources/metric-policy.ts +5 -4
  183. package/src/resources/metric-variant.ts +4 -1
  184. package/src/resources/metric.ts +7 -2
  185. package/src/resources/simulation-environment.ts +414 -0
  186. package/src/resources/simulation-job.ts +14 -8
  187. package/src/resources/simulation-persona.ts +25 -15
  188. package/src/resources/simulation-run-plan-job.ts +47 -6
  189. package/src/resources/simulation-run-plan.ts +140 -0
  190. package/src/resources/simulation-template.ts +1 -0
  191. package/src/resources/simulation.ts +39 -0
  192. package/src/resources/tool.ts +697 -6
  193. package/src/resources/usage.ts +6 -1
  194. package/src/resources/webhook.ts +8 -0
  195. package/src/version.ts +1 -1
  196. package/version.d.mts +1 -1
  197. package/version.d.ts +1 -1
  198. package/version.js +1 -1
  199. package/version.mjs +1 -1
  200. package/resources/customer-profile.d.mts.map +0 -1
  201. package/resources/customer-profile.d.ts.map +0 -1
  202. package/resources/customer-profile.js +0 -141
  203. package/resources/customer-profile.js.map +0 -1
  204. package/resources/customer-profile.mjs +0 -137
  205. package/resources/customer-profile.mjs.map +0 -1
@@ -14,7 +14,7 @@ export class MetricPolicy extends APIResource {
14
14
  * ```ts
15
15
  * const metricPolicy = await client.metricPolicy.create({
16
16
  * metrics: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],
17
- * modality: 'call',
17
+ * modality: 'voice',
18
18
  * name: 'Evaluate all inbound calls',
19
19
  * });
20
20
  * ```
@@ -750,10 +750,11 @@ export interface MetricPolicyCreateParams {
750
750
  metrics: Array<MetricPolicyCreateParams.Metric>;
751
751
 
752
752
  /**
753
- * Modality this policy targets. A policy fires for exactly one modality and can
754
- * only reference metrics that support that modality.
753
+ * Modality this policy targets: `voice` or `chat` (`call` is still accepted for
754
+ * `voice`). A policy fires for exactly one modality and can only reference metrics
755
+ * that support that modality.
755
756
  */
756
- modality: 'call' | 'chat';
757
+ modality: 'voice' | 'chat' | 'call';
757
758
 
758
759
  /**
759
760
  * Name of the metric policy
@@ -410,7 +410,10 @@ export interface MetricVariantUpdateParams {
410
410
  gradesShortCalls?: boolean;
411
411
 
412
412
  /**
413
- * Body param: The rubric this variant applies. LLM judge metrics only.
413
+ * Body param: The rubric this variant applies. LLM judge metrics only. A custom
414
+ * metric prompt must include a transcript variable such as `{{transcript}}` and
415
+ * `{{world_context}}`, which gives the judge the current date and time when it
416
+ * grades.
414
417
  */
415
418
  llmPrompt?: string;
416
419
 
@@ -2850,7 +2850,9 @@ export declare namespace MetricCreateDefinitionParams {
2850
2850
 
2851
2851
  /**
2852
2852
  * LLM prompt/criteria for evaluating this metric. Required for BOOLEAN, NUMERIC,
2853
- * TEXT, and SCALE types.
2853
+ * TEXT, and SCALE types. A custom metric prompt must include a transcript variable
2854
+ * such as `{{transcript}}` and `{{world_context}}`, which gives the judge the
2855
+ * current date and time when it grades.
2854
2856
  */
2855
2857
  llmPrompt?: string;
2856
2858
 
@@ -3270,7 +3272,10 @@ export interface MetricUpdateDefinitionParams {
3270
3272
  httpRequest?: MetricUpdateDefinitionParams.HTTPRequest;
3271
3273
 
3272
3274
  /**
3273
- * New LLM prompt (only for LLM_JUDGE metrics whose prompt is editable)
3275
+ * New LLM prompt (only for LLM_JUDGE metrics whose prompt is editable). A custom
3276
+ * metric prompt must include a transcript variable such as `{{transcript}}` and
3277
+ * `{{world_context}}`, which gives the judge the current date and time when it
3278
+ * grades.
3274
3279
  */
3275
3280
  llmPrompt?: string;
3276
3281
 
@@ -139,6 +139,22 @@ export namespace SimulationEnvironmentCreateResponse {
139
139
  */
140
140
  createdAt: string;
141
141
 
142
+ /**
143
+ * The per-direction loss of a CUSTOM line.
144
+ */
145
+ lineCustom: Data.LineCustom | null;
146
+
147
+ /**
148
+ * The phone line the simulated caller is on: packet loss applied to its 20 ms
149
+ * audio packets, per direction. The loss pattern is seeded per call, so a redial
150
+ * loses the same packets. CLEAR: No loss. MINOR_LOSS: 1% random, both ways.
151
+ * CELL_EDGE: 5% in 80 ms gaps, both ways. POOR_CONNECTION: 10% in 120 ms gaps,
152
+ * both ways. ONE_WAY_DEGRADED: 8% in 80 ms gaps, toward the agent only. CUSTOM:
153
+ * the per-direction loss in `lineCustom`, up to 20% in 0.5 steps, with a mean
154
+ * burst of up to 10 packets (omit it for random loss).
155
+ */
156
+ lineQuality: 'CLEAR' | 'MINOR_LOSS' | 'CELL_EDGE' | 'POOR_CONNECTION' | 'ONE_WAY_DEGRADED' | 'CUSTOM';
157
+
142
158
  name: string;
143
159
 
144
160
  /**
@@ -148,6 +164,59 @@ export namespace SimulationEnvironmentCreateResponse {
148
164
 
149
165
  description?: string | null;
150
166
  }
167
+
168
+ export namespace Data {
169
+ /**
170
+ * The per-direction loss of a CUSTOM line.
171
+ */
172
+ export interface LineCustom {
173
+ /**
174
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
175
+ * loss.
176
+ */
177
+ fromAgent?: LineCustom.FromAgent;
178
+
179
+ /**
180
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
181
+ * loss.
182
+ */
183
+ toAgent?: LineCustom.ToAgent;
184
+ }
185
+
186
+ export namespace LineCustom {
187
+ /**
188
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
189
+ * loss.
190
+ */
191
+ export interface FromAgent {
192
+ /**
193
+ * Share of packets lost, 0 to 20 in steps of 0.5.
194
+ */
195
+ packetLossPercent: number;
196
+
197
+ /**
198
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
199
+ */
200
+ meanBurstPackets?: number;
201
+ }
202
+
203
+ /**
204
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
205
+ * loss.
206
+ */
207
+ export interface ToAgent {
208
+ /**
209
+ * Share of packets lost, 0 to 20 in steps of 0.5.
210
+ */
211
+ packetLossPercent: number;
212
+
213
+ /**
214
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
215
+ */
216
+ meanBurstPackets?: number;
217
+ }
218
+ }
219
+ }
151
220
  }
152
221
 
153
222
  export interface SimulationEnvironmentUpdateResponse {
@@ -189,6 +258,22 @@ export namespace SimulationEnvironmentUpdateResponse {
189
258
  */
190
259
  createdAt: string;
191
260
 
261
+ /**
262
+ * The per-direction loss of a CUSTOM line.
263
+ */
264
+ lineCustom: Data.LineCustom | null;
265
+
266
+ /**
267
+ * The phone line the simulated caller is on: packet loss applied to its 20 ms
268
+ * audio packets, per direction. The loss pattern is seeded per call, so a redial
269
+ * loses the same packets. CLEAR: No loss. MINOR_LOSS: 1% random, both ways.
270
+ * CELL_EDGE: 5% in 80 ms gaps, both ways. POOR_CONNECTION: 10% in 120 ms gaps,
271
+ * both ways. ONE_WAY_DEGRADED: 8% in 80 ms gaps, toward the agent only. CUSTOM:
272
+ * the per-direction loss in `lineCustom`, up to 20% in 0.5 steps, with a mean
273
+ * burst of up to 10 packets (omit it for random loss).
274
+ */
275
+ lineQuality: 'CLEAR' | 'MINOR_LOSS' | 'CELL_EDGE' | 'POOR_CONNECTION' | 'ONE_WAY_DEGRADED' | 'CUSTOM';
276
+
192
277
  name: string;
193
278
 
194
279
  /**
@@ -198,6 +283,59 @@ export namespace SimulationEnvironmentUpdateResponse {
198
283
 
199
284
  description?: string | null;
200
285
  }
286
+
287
+ export namespace Data {
288
+ /**
289
+ * The per-direction loss of a CUSTOM line.
290
+ */
291
+ export interface LineCustom {
292
+ /**
293
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
294
+ * loss.
295
+ */
296
+ fromAgent?: LineCustom.FromAgent;
297
+
298
+ /**
299
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
300
+ * loss.
301
+ */
302
+ toAgent?: LineCustom.ToAgent;
303
+ }
304
+
305
+ export namespace LineCustom {
306
+ /**
307
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
308
+ * loss.
309
+ */
310
+ export interface FromAgent {
311
+ /**
312
+ * Share of packets lost, 0 to 20 in steps of 0.5.
313
+ */
314
+ packetLossPercent: number;
315
+
316
+ /**
317
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
318
+ */
319
+ meanBurstPackets?: number;
320
+ }
321
+
322
+ /**
323
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
324
+ * loss.
325
+ */
326
+ export interface ToAgent {
327
+ /**
328
+ * Share of packets lost, 0 to 20 in steps of 0.5.
329
+ */
330
+ packetLossPercent: number;
331
+
332
+ /**
333
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
334
+ */
335
+ meanBurstPackets?: number;
336
+ }
337
+ }
338
+ }
201
339
  }
202
340
 
203
341
  /**
@@ -240,6 +378,22 @@ export namespace SimulationEnvironmentListResponse {
240
378
  */
241
379
  createdAt: string;
242
380
 
381
+ /**
382
+ * The per-direction loss of a CUSTOM line.
383
+ */
384
+ lineCustom: Data.LineCustom | null;
385
+
386
+ /**
387
+ * The phone line the simulated caller is on: packet loss applied to its 20 ms
388
+ * audio packets, per direction. The loss pattern is seeded per call, so a redial
389
+ * loses the same packets. CLEAR: No loss. MINOR_LOSS: 1% random, both ways.
390
+ * CELL_EDGE: 5% in 80 ms gaps, both ways. POOR_CONNECTION: 10% in 120 ms gaps,
391
+ * both ways. ONE_WAY_DEGRADED: 8% in 80 ms gaps, toward the agent only. CUSTOM:
392
+ * the per-direction loss in `lineCustom`, up to 20% in 0.5 steps, with a mean
393
+ * burst of up to 10 packets (omit it for random loss).
394
+ */
395
+ lineQuality: 'CLEAR' | 'MINOR_LOSS' | 'CELL_EDGE' | 'POOR_CONNECTION' | 'ONE_WAY_DEGRADED' | 'CUSTOM';
396
+
243
397
  name: string;
244
398
 
245
399
  /**
@@ -250,6 +404,59 @@ export namespace SimulationEnvironmentListResponse {
250
404
  description?: string | null;
251
405
  }
252
406
 
407
+ export namespace Data {
408
+ /**
409
+ * The per-direction loss of a CUSTOM line.
410
+ */
411
+ export interface LineCustom {
412
+ /**
413
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
414
+ * loss.
415
+ */
416
+ fromAgent?: LineCustom.FromAgent;
417
+
418
+ /**
419
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
420
+ * loss.
421
+ */
422
+ toAgent?: LineCustom.ToAgent;
423
+ }
424
+
425
+ export namespace LineCustom {
426
+ /**
427
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
428
+ * loss.
429
+ */
430
+ export interface FromAgent {
431
+ /**
432
+ * Share of packets lost, 0 to 20 in steps of 0.5.
433
+ */
434
+ packetLossPercent: number;
435
+
436
+ /**
437
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
438
+ */
439
+ meanBurstPackets?: number;
440
+ }
441
+
442
+ /**
443
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
444
+ * loss.
445
+ */
446
+ export interface ToAgent {
447
+ /**
448
+ * Share of packets lost, 0 to 20 in steps of 0.5.
449
+ */
450
+ packetLossPercent: number;
451
+
452
+ /**
453
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
454
+ */
455
+ meanBurstPackets?: number;
456
+ }
457
+ }
458
+ }
459
+
253
460
  export interface Pagination {
254
461
  /**
255
462
  * Whether there are more items to fetch
@@ -325,6 +532,22 @@ export namespace SimulationEnvironmentGetByIDResponse {
325
532
  */
326
533
  createdAt: string;
327
534
 
535
+ /**
536
+ * The per-direction loss of a CUSTOM line.
537
+ */
538
+ lineCustom: Data.LineCustom | null;
539
+
540
+ /**
541
+ * The phone line the simulated caller is on: packet loss applied to its 20 ms
542
+ * audio packets, per direction. The loss pattern is seeded per call, so a redial
543
+ * loses the same packets. CLEAR: No loss. MINOR_LOSS: 1% random, both ways.
544
+ * CELL_EDGE: 5% in 80 ms gaps, both ways. POOR_CONNECTION: 10% in 120 ms gaps,
545
+ * both ways. ONE_WAY_DEGRADED: 8% in 80 ms gaps, toward the agent only. CUSTOM:
546
+ * the per-direction loss in `lineCustom`, up to 20% in 0.5 steps, with a mean
547
+ * burst of up to 10 packets (omit it for random loss).
548
+ */
549
+ lineQuality: 'CLEAR' | 'MINOR_LOSS' | 'CELL_EDGE' | 'POOR_CONNECTION' | 'ONE_WAY_DEGRADED' | 'CUSTOM';
550
+
328
551
  name: string;
329
552
 
330
553
  /**
@@ -334,6 +557,59 @@ export namespace SimulationEnvironmentGetByIDResponse {
334
557
 
335
558
  description?: string | null;
336
559
  }
560
+
561
+ export namespace Data {
562
+ /**
563
+ * The per-direction loss of a CUSTOM line.
564
+ */
565
+ export interface LineCustom {
566
+ /**
567
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
568
+ * loss.
569
+ */
570
+ fromAgent?: LineCustom.FromAgent;
571
+
572
+ /**
573
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
574
+ * loss.
575
+ */
576
+ toAgent?: LineCustom.ToAgent;
577
+ }
578
+
579
+ export namespace LineCustom {
580
+ /**
581
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
582
+ * loss.
583
+ */
584
+ export interface FromAgent {
585
+ /**
586
+ * Share of packets lost, 0 to 20 in steps of 0.5.
587
+ */
588
+ packetLossPercent: number;
589
+
590
+ /**
591
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
592
+ */
593
+ meanBurstPackets?: number;
594
+ }
595
+
596
+ /**
597
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
598
+ * loss.
599
+ */
600
+ export interface ToAgent {
601
+ /**
602
+ * Share of packets lost, 0 to 20 in steps of 0.5.
603
+ */
604
+ packetLossPercent: number;
605
+
606
+ /**
607
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
608
+ */
609
+ meanBurstPackets?: number;
610
+ }
611
+ }
612
+ }
337
613
  }
338
614
 
339
615
  export interface SimulationEnvironmentCreateParams {
@@ -370,6 +646,75 @@ export interface SimulationEnvironmentCreateParams {
370
646
  * Optional note on when to use this environment
371
647
  */
372
648
  description?: string | null;
649
+
650
+ /**
651
+ * The per-direction loss of a CUSTOM line.
652
+ */
653
+ lineCustom?: SimulationEnvironmentCreateParams.LineCustom | null;
654
+
655
+ /**
656
+ * The phone line the simulated caller is on: packet loss applied to its 20 ms
657
+ * audio packets, per direction. The loss pattern is seeded per call, so a redial
658
+ * loses the same packets. CLEAR: No loss. MINOR_LOSS: 1% random, both ways.
659
+ * CELL_EDGE: 5% in 80 ms gaps, both ways. POOR_CONNECTION: 10% in 120 ms gaps,
660
+ * both ways. ONE_WAY_DEGRADED: 8% in 80 ms gaps, toward the agent only. CUSTOM:
661
+ * the per-direction loss in `lineCustom`, up to 20% in 0.5 steps, with a mean
662
+ * burst of up to 10 packets (omit it for random loss). Defaults to CLEAR.
663
+ */
664
+ lineQuality?: 'CLEAR' | 'MINOR_LOSS' | 'CELL_EDGE' | 'POOR_CONNECTION' | 'ONE_WAY_DEGRADED' | 'CUSTOM';
665
+ }
666
+
667
+ export namespace SimulationEnvironmentCreateParams {
668
+ /**
669
+ * The per-direction loss of a CUSTOM line.
670
+ */
671
+ export interface LineCustom {
672
+ /**
673
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
674
+ * loss.
675
+ */
676
+ fromAgent?: LineCustom.FromAgent;
677
+
678
+ /**
679
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
680
+ * loss.
681
+ */
682
+ toAgent?: LineCustom.ToAgent;
683
+ }
684
+
685
+ export namespace LineCustom {
686
+ /**
687
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
688
+ * loss.
689
+ */
690
+ export interface FromAgent {
691
+ /**
692
+ * Share of packets lost, 0 to 20 in steps of 0.5.
693
+ */
694
+ packetLossPercent: number;
695
+
696
+ /**
697
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
698
+ */
699
+ meanBurstPackets?: number;
700
+ }
701
+
702
+ /**
703
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
704
+ * loss.
705
+ */
706
+ export interface ToAgent {
707
+ /**
708
+ * Share of packets lost, 0 to 20 in steps of 0.5.
709
+ */
710
+ packetLossPercent: number;
711
+
712
+ /**
713
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
714
+ */
715
+ meanBurstPackets?: number;
716
+ }
717
+ }
373
718
  }
374
719
 
375
720
  export interface SimulationEnvironmentUpdateParams {
@@ -402,12 +747,81 @@ export interface SimulationEnvironmentUpdateParams {
402
747
  */
403
748
  description?: string | null;
404
749
 
750
+ /**
751
+ * The per-direction loss of a CUSTOM line.
752
+ */
753
+ lineCustom?: SimulationEnvironmentUpdateParams.LineCustom | null;
754
+
755
+ /**
756
+ * The phone line the simulated caller is on: packet loss applied to its 20 ms
757
+ * audio packets, per direction. The loss pattern is seeded per call, so a redial
758
+ * loses the same packets. CLEAR: No loss. MINOR_LOSS: 1% random, both ways.
759
+ * CELL_EDGE: 5% in 80 ms gaps, both ways. POOR_CONNECTION: 10% in 120 ms gaps,
760
+ * both ways. ONE_WAY_DEGRADED: 8% in 80 ms gaps, toward the agent only. CUSTOM:
761
+ * the per-direction loss in `lineCustom`, up to 20% in 0.5 steps, with a mean
762
+ * burst of up to 10 packets (omit it for random loss). Defaults to CLEAR.
763
+ */
764
+ lineQuality?: 'CLEAR' | 'MINOR_LOSS' | 'CELL_EDGE' | 'POOR_CONNECTION' | 'ONE_WAY_DEGRADED' | 'CUSTOM';
765
+
405
766
  /**
406
767
  * Display name, shown wherever a flow variant references the environment
407
768
  */
408
769
  name?: string;
409
770
  }
410
771
 
772
+ export namespace SimulationEnvironmentUpdateParams {
773
+ /**
774
+ * The per-direction loss of a CUSTOM line.
775
+ */
776
+ export interface LineCustom {
777
+ /**
778
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
779
+ * loss.
780
+ */
781
+ fromAgent?: LineCustom.FromAgent;
782
+
783
+ /**
784
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
785
+ * loss.
786
+ */
787
+ toAgent?: LineCustom.ToAgent;
788
+ }
789
+
790
+ export namespace LineCustom {
791
+ /**
792
+ * The agent's audio on its way to the caller: what the caller hears. Omit for no
793
+ * loss.
794
+ */
795
+ export interface FromAgent {
796
+ /**
797
+ * Share of packets lost, 0 to 20 in steps of 0.5.
798
+ */
799
+ packetLossPercent: number;
800
+
801
+ /**
802
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
803
+ */
804
+ meanBurstPackets?: number;
805
+ }
806
+
807
+ /**
808
+ * The caller's audio on its way to the agent: what the agent hears. Omit for no
809
+ * loss.
810
+ */
811
+ export interface ToAgent {
812
+ /**
813
+ * Share of packets lost, 0 to 20 in steps of 0.5.
814
+ */
815
+ packetLossPercent: number;
816
+
817
+ /**
818
+ * Mean length of a loss gap in 20 ms packets, 2 to 10. Omit for random loss.
819
+ */
820
+ meanBurstPackets?: number;
821
+ }
822
+ }
823
+ }
824
+
411
825
  export interface SimulationEnvironmentListParams {
412
826
  after?: string;
413
827
 
@@ -197,7 +197,8 @@ export namespace SimulationJobGetByIDResponse {
197
197
  | 'ELEVENLABS_WS'
198
198
  | 'KORE'
199
199
  | 'GOOGLE_CES'
200
- | 'DAILY';
200
+ | 'DAILY'
201
+ | 'ROARK_WEBRTC';
201
202
  }
202
203
 
203
204
  /**
@@ -441,9 +442,11 @@ export namespace SimulationJobGetByIDResponse {
441
442
  * How much the persona talks over the agent while it is still speaking. OFF waits
442
443
  * its turn. BACKCHANNEL makes listening noises ("mm-hm") over the agent without
443
444
  * taking the floor, which tests whether the agent wrongly stops for them.
444
- * OCCASIONAL adds cutting in on some long agent turns, HEAVY on most of them.
445
- * Timing is randomised per turn, so two runs of the same persona do not interrupt
446
- * at identical moments.
445
+ * OCCASIONAL also cuts in where a caller like this plausibly would, and HEAVY does
446
+ * so readily, though never on every turn. The moments are chosen from what the
447
+ * agent is saying, such as reading back a number or starting a long explanation,
448
+ * not on a timer. A customer flow can also say exactly when to cut in, which
449
+ * applies at any level.
447
450
  */
448
451
  interruption: 'OFF' | 'BACKCHANNEL' | 'OCCASIONAL' | 'HEAVY';
449
452
 
@@ -757,7 +760,8 @@ export namespace SimulationJobLookupResponse {
757
760
  | 'ELEVENLABS_WS'
758
761
  | 'KORE'
759
762
  | 'GOOGLE_CES'
760
- | 'DAILY';
763
+ | 'DAILY'
764
+ | 'ROARK_WEBRTC';
761
765
  }
762
766
 
763
767
  /**
@@ -1001,9 +1005,11 @@ export namespace SimulationJobLookupResponse {
1001
1005
  * How much the persona talks over the agent while it is still speaking. OFF waits
1002
1006
  * its turn. BACKCHANNEL makes listening noises ("mm-hm") over the agent without
1003
1007
  * taking the floor, which tests whether the agent wrongly stops for them.
1004
- * OCCASIONAL adds cutting in on some long agent turns, HEAVY on most of them.
1005
- * Timing is randomised per turn, so two runs of the same persona do not interrupt
1006
- * at identical moments.
1008
+ * OCCASIONAL also cuts in where a caller like this plausibly would, and HEAVY does
1009
+ * so readily, though never on every turn. The moments are chosen from what the
1010
+ * agent is saying, such as reading back a number or starting a long explanation,
1011
+ * not on a timer. A customer flow can also say exactly when to cut in, which
1012
+ * applies at any level.
1007
1013
  */
1008
1014
  interruption: 'OFF' | 'BACKCHANNEL' | 'OCCASIONAL' | 'HEAVY';
1009
1015
 
@@ -202,9 +202,11 @@ export namespace SimulationPersonaCreateResponse {
202
202
  * How much the persona talks over the agent while it is still speaking. OFF waits
203
203
  * its turn. BACKCHANNEL makes listening noises ("mm-hm") over the agent without
204
204
  * taking the floor, which tests whether the agent wrongly stops for them.
205
- * OCCASIONAL adds cutting in on some long agent turns, HEAVY on most of them.
206
- * Timing is randomised per turn, so two runs of the same persona do not interrupt
207
- * at identical moments.
205
+ * OCCASIONAL also cuts in where a caller like this plausibly would, and HEAVY does
206
+ * so readily, though never on every turn. The moments are chosen from what the
207
+ * agent is saying, such as reading back a number or starting a long explanation,
208
+ * not on a timer. A customer flow can also say exactly when to cut in, which
209
+ * applies at any level.
208
210
  */
209
211
  interruption: 'OFF' | 'BACKCHANNEL' | 'OCCASIONAL' | 'HEAVY';
210
212
 
@@ -455,9 +457,11 @@ export namespace SimulationPersonaUpdateResponse {
455
457
  * How much the persona talks over the agent while it is still speaking. OFF waits
456
458
  * its turn. BACKCHANNEL makes listening noises ("mm-hm") over the agent without
457
459
  * taking the floor, which tests whether the agent wrongly stops for them.
458
- * OCCASIONAL adds cutting in on some long agent turns, HEAVY on most of them.
459
- * Timing is randomised per turn, so two runs of the same persona do not interrupt
460
- * at identical moments.
460
+ * OCCASIONAL also cuts in where a caller like this plausibly would, and HEAVY does
461
+ * so readily, though never on every turn. The moments are chosen from what the
462
+ * agent is saying, such as reading back a number or starting a long explanation,
463
+ * not on a timer. A customer flow can also say exactly when to cut in, which
464
+ * applies at any level.
461
465
  */
462
466
  interruption: 'OFF' | 'BACKCHANNEL' | 'OCCASIONAL' | 'HEAVY';
463
467
 
@@ -710,9 +714,11 @@ export namespace SimulationPersonaListResponse {
710
714
  * How much the persona talks over the agent while it is still speaking. OFF waits
711
715
  * its turn. BACKCHANNEL makes listening noises ("mm-hm") over the agent without
712
716
  * taking the floor, which tests whether the agent wrongly stops for them.
713
- * OCCASIONAL adds cutting in on some long agent turns, HEAVY on most of them.
714
- * Timing is randomised per turn, so two runs of the same persona do not interrupt
715
- * at identical moments.
717
+ * OCCASIONAL also cuts in where a caller like this plausibly would, and HEAVY does
718
+ * so readily, though never on every turn. The moments are chosen from what the
719
+ * agent is saying, such as reading back a number or starting a long explanation,
720
+ * not on a timer. A customer flow can also say exactly when to cut in, which
721
+ * applies at any level.
716
722
  */
717
723
  interruption: 'OFF' | 'BACKCHANNEL' | 'OCCASIONAL' | 'HEAVY';
718
724
 
@@ -980,9 +986,11 @@ export namespace SimulationPersonaGetByIDResponse {
980
986
  * How much the persona talks over the agent while it is still speaking. OFF waits
981
987
  * its turn. BACKCHANNEL makes listening noises ("mm-hm") over the agent without
982
988
  * taking the floor, which tests whether the agent wrongly stops for them.
983
- * OCCASIONAL adds cutting in on some long agent turns, HEAVY on most of them.
984
- * Timing is randomised per turn, so two runs of the same persona do not interrupt
985
- * at identical moments.
989
+ * OCCASIONAL also cuts in where a caller like this plausibly would, and HEAVY does
990
+ * so readily, though never on every turn. The moments are chosen from what the
991
+ * agent is saying, such as reading back a number or starting a long explanation,
992
+ * not on a timer. A customer flow can also say exactly when to cut in, which
993
+ * applies at any level.
986
994
  */
987
995
  interruption: 'OFF' | 'BACKCHANNEL' | 'OCCASIONAL' | 'HEAVY';
988
996
 
@@ -1457,9 +1465,11 @@ export interface SimulationPersonaUpdateParams {
1457
1465
  * How much the persona talks over the agent while it is still speaking. OFF waits
1458
1466
  * its turn. BACKCHANNEL makes listening noises ("mm-hm") over the agent without
1459
1467
  * taking the floor, which tests whether the agent wrongly stops for them.
1460
- * OCCASIONAL adds cutting in on some long agent turns, HEAVY on most of them.
1461
- * Timing is randomised per turn, so two runs of the same persona do not interrupt
1462
- * at identical moments.
1468
+ * OCCASIONAL also cuts in where a caller like this plausibly would, and HEAVY does
1469
+ * so readily, though never on every turn. The moments are chosen from what the
1470
+ * agent is saying, such as reading back a number or starting a long explanation,
1471
+ * not on a timer. A customer flow can also say exactly when to cut in, which
1472
+ * applies at any level.
1463
1473
  */
1464
1474
  interruption?: 'OFF' | 'BACKCHANNEL' | 'OCCASIONAL' | 'HEAVY';
1465
1475