@roarkanalytics/sdk 5.2.0 → 5.4.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 +24 -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/config.d.mts +416 -8
  12. package/resources/config.d.mts.map +1 -1
  13. package/resources/config.d.ts +416 -8
  14. package/resources/config.d.ts.map +1 -1
  15. package/resources/index.d.mts +2 -0
  16. package/resources/index.d.mts.map +1 -1
  17. package/resources/index.d.ts +2 -0
  18. package/resources/index.d.ts.map +1 -1
  19. package/resources/index.js +5 -1
  20. package/resources/index.js.map +1 -1
  21. package/resources/index.mjs +2 -0
  22. package/resources/index.mjs.map +1 -1
  23. package/resources/simulation-group.d.mts +777 -0
  24. package/resources/simulation-group.d.mts.map +1 -0
  25. package/resources/simulation-group.d.ts +777 -0
  26. package/resources/simulation-group.d.ts.map +1 -0
  27. package/resources/simulation-group.js +116 -0
  28. package/resources/simulation-group.js.map +1 -0
  29. package/resources/simulation-group.mjs +112 -0
  30. package/resources/simulation-group.mjs.map +1 -0
  31. package/resources/simulation-run-group.d.mts +890 -0
  32. package/resources/simulation-run-group.d.mts.map +1 -0
  33. package/resources/simulation-run-group.d.ts +890 -0
  34. package/resources/simulation-run-group.d.ts.map +1 -0
  35. package/resources/simulation-run-group.js +91 -0
  36. package/resources/simulation-run-group.js.map +1 -0
  37. package/resources/simulation-run-group.mjs +87 -0
  38. package/resources/simulation-run-group.mjs.map +1 -0
  39. package/src/client.ts +50 -0
  40. package/src/resources/config.ts +759 -31
  41. package/src/resources/index.ts +22 -0
  42. package/src/resources/simulation-group.ts +1105 -0
  43. package/src/resources/simulation-run-group.ts +1489 -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,1105 @@
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 SimulationGroup extends APIResource {
9
+ /**
10
+ * Saves a named set of plans to run together, again and again. Nothing runs yet:
11
+ * POST /v1/simulation/group/{groupId}/run starts one run of every plan and groups
12
+ * them into a run group with one combined report.
13
+ *
14
+ * Slack channels need Slack connected to the project. Email is on by default.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const simulationGroup = await client.simulationGroup.create(
19
+ * {
20
+ * name: 'Release regression',
21
+ * simulationRunPlanIds: [
22
+ * '3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f',
23
+ * '6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f9a',
24
+ * ],
25
+ * },
26
+ * );
27
+ * ```
28
+ */
29
+ create(
30
+ body: SimulationGroupCreateParams,
31
+ options?: RequestOptions,
32
+ ): APIPromise<SimulationGroupCreateResponse> {
33
+ return this._client.post('/v1/simulation/group', { body, ...options });
34
+ }
35
+
36
+ /**
37
+ * Edits a saved simulation group. Omitted fields keep their current value;
38
+ * `notifications`, when sent, replaces the settings as a whole. Run groups it
39
+ * already started keep theirs.
40
+ *
41
+ * A group managed by config as code (`configManaged: true`) returns 409: change it
42
+ * in the config file.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const simulationGroup = await client.simulationGroup.update(
47
+ * '2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d',
48
+ * );
49
+ * ```
50
+ */
51
+ update(
52
+ groupID: string,
53
+ body: SimulationGroupUpdateParams | null | undefined = {},
54
+ options?: RequestOptions,
55
+ ): APIPromise<SimulationGroupUpdateResponse> {
56
+ return this._client.put(path`/v1/simulation/group/${groupID}`, { body, ...options });
57
+ }
58
+
59
+ /**
60
+ * Returns the saved simulation groups in the project, most recently edited first,
61
+ * each with its plans in run order and notification settings.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * const simulationGroups =
66
+ * await client.simulationGroup.list();
67
+ * ```
68
+ */
69
+ list(
70
+ query: SimulationGroupListParams | null | undefined = {},
71
+ options?: RequestOptions,
72
+ ): APIPromise<SimulationGroupListResponse> {
73
+ return this._client.get('/v1/simulation/group', { query, ...options });
74
+ }
75
+
76
+ /**
77
+ * Deletes a saved simulation group and any schedules that run it. Run groups it
78
+ * already started, and their reports, stay. A group managed by config as code
79
+ * returns 409.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * const simulationGroup = await client.simulationGroup.delete(
84
+ * '2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d',
85
+ * );
86
+ * ```
87
+ */
88
+ delete(groupID: string, options?: RequestOptions): APIPromise<SimulationGroupDeleteResponse> {
89
+ return this._client.delete(path`/v1/simulation/group/${groupID}`, options);
90
+ }
91
+
92
+ /**
93
+ * Returns a saved simulation group with its plans in run order and notification
94
+ * settings.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * const response = await client.simulationGroup.getByID(
99
+ * '2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d',
100
+ * );
101
+ * ```
102
+ */
103
+ getByID(groupID: string, options?: RequestOptions): APIPromise<SimulationGroupGetByIDResponse> {
104
+ return this._client.get(path`/v1/simulation/group/${groupID}`, options);
105
+ }
106
+
107
+ /**
108
+ * Starts one run of every plan in the group, exactly as POST
109
+ * /v1/simulation/plan/{planId}/job would for each, and groups the runs into a run
110
+ * group whose combined report is announced through the group's notification
111
+ * settings once it is ready. This places real calls. Config-managed groups can be
112
+ * run here too.
113
+ *
114
+ * Returns the run group. Poll GET /v1/simulation/run-group/{groupId} until
115
+ * `latestReport.status` is READY.
116
+ *
117
+ * If a plan cannot start after others did, the runs that started are still grouped
118
+ * and the 400 names the run group id.
119
+ *
120
+ * @example
121
+ * ```ts
122
+ * const response = await client.simulationGroup.run(
123
+ * '2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d',
124
+ * );
125
+ * ```
126
+ */
127
+ run(groupID: string, options?: RequestOptions): APIPromise<SimulationGroupRunResponse> {
128
+ return this._client.post(path`/v1/simulation/group/${groupID}/run`, options);
129
+ }
130
+ }
131
+
132
+ export interface SimulationGroupCreateResponse {
133
+ /**
134
+ * A saved, repeatable set of plans that run together. Each run starts one run of
135
+ * every plan and groups them into a run group with one combined report.
136
+ */
137
+ data: SimulationGroupCreateResponse.Data;
138
+ }
139
+
140
+ export namespace SimulationGroupCreateResponse {
141
+ /**
142
+ * A saved, repeatable set of plans that run together. Each run starts one run of
143
+ * every plan and groups them into a run group with one combined report.
144
+ */
145
+ export interface Data {
146
+ id: string;
147
+
148
+ /**
149
+ * Whether this group is managed by config as code. A managed group can be run
150
+ * here, but PUT and DELETE on it return 409: change it in the config file.
151
+ */
152
+ configManaged: boolean;
153
+
154
+ /**
155
+ * ISO 8601
156
+ */
157
+ createdAt: string;
158
+
159
+ description: string | null;
160
+
161
+ /**
162
+ * ISO 8601. Null when it has never run.
163
+ */
164
+ lastRunAt: string | null;
165
+
166
+ /**
167
+ * The most recent run group it started, readable at GET
168
+ * /v1/simulation/run-group/{groupId}. Null when it has never run.
169
+ */
170
+ latestRunGroupId: string | null;
171
+
172
+ name: string;
173
+
174
+ /**
175
+ * Where each run's group report announces itself once it is ready.
176
+ */
177
+ notifications: Data.Notifications;
178
+
179
+ /**
180
+ * The plans in run order. A plan deleted since it was added is left out.
181
+ */
182
+ plans: Array<Data.Plan>;
183
+
184
+ /**
185
+ * ISO 8601
186
+ */
187
+ updatedAt: string;
188
+ }
189
+
190
+ export namespace Data {
191
+ /**
192
+ * Where each run's group report announces itself once it is ready.
193
+ */
194
+ export interface Notifications {
195
+ email: Notifications.Email;
196
+
197
+ slack: Array<Notifications.Slack>;
198
+ }
199
+
200
+ export namespace Notifications {
201
+ export interface Email {
202
+ enabled: boolean;
203
+
204
+ recipients: Array<string>;
205
+ }
206
+
207
+ export interface Slack {
208
+ channelId: string;
209
+
210
+ channelName: string;
211
+ }
212
+ }
213
+
214
+ export interface Plan {
215
+ /**
216
+ * The plan, readable at GET /v1/simulation/plan/{planId}
217
+ */
218
+ id: string;
219
+
220
+ name: string;
221
+ }
222
+ }
223
+ }
224
+
225
+ export interface SimulationGroupUpdateResponse {
226
+ /**
227
+ * A saved, repeatable set of plans that run together. Each run starts one run of
228
+ * every plan and groups them into a run group with one combined report.
229
+ */
230
+ data: SimulationGroupUpdateResponse.Data;
231
+ }
232
+
233
+ export namespace SimulationGroupUpdateResponse {
234
+ /**
235
+ * A saved, repeatable set of plans that run together. Each run starts one run of
236
+ * every plan and groups them into a run group with one combined report.
237
+ */
238
+ export interface Data {
239
+ id: string;
240
+
241
+ /**
242
+ * Whether this group is managed by config as code. A managed group can be run
243
+ * here, but PUT and DELETE on it return 409: change it in the config file.
244
+ */
245
+ configManaged: boolean;
246
+
247
+ /**
248
+ * ISO 8601
249
+ */
250
+ createdAt: string;
251
+
252
+ description: string | null;
253
+
254
+ /**
255
+ * ISO 8601. Null when it has never run.
256
+ */
257
+ lastRunAt: string | null;
258
+
259
+ /**
260
+ * The most recent run group it started, readable at GET
261
+ * /v1/simulation/run-group/{groupId}. Null when it has never run.
262
+ */
263
+ latestRunGroupId: string | null;
264
+
265
+ name: string;
266
+
267
+ /**
268
+ * Where each run's group report announces itself once it is ready.
269
+ */
270
+ notifications: Data.Notifications;
271
+
272
+ /**
273
+ * The plans in run order. A plan deleted since it was added is left out.
274
+ */
275
+ plans: Array<Data.Plan>;
276
+
277
+ /**
278
+ * ISO 8601
279
+ */
280
+ updatedAt: string;
281
+ }
282
+
283
+ export namespace Data {
284
+ /**
285
+ * Where each run's group report announces itself once it is ready.
286
+ */
287
+ export interface Notifications {
288
+ email: Notifications.Email;
289
+
290
+ slack: Array<Notifications.Slack>;
291
+ }
292
+
293
+ export namespace Notifications {
294
+ export interface Email {
295
+ enabled: boolean;
296
+
297
+ recipients: Array<string>;
298
+ }
299
+
300
+ export interface Slack {
301
+ channelId: string;
302
+
303
+ channelName: string;
304
+ }
305
+ }
306
+
307
+ export interface Plan {
308
+ /**
309
+ * The plan, readable at GET /v1/simulation/plan/{planId}
310
+ */
311
+ id: string;
312
+
313
+ name: string;
314
+ }
315
+ }
316
+ }
317
+
318
+ export interface SimulationGroupListResponse {
319
+ data: Array<SimulationGroupListResponse.Data>;
320
+
321
+ pagination: SimulationGroupListResponse.Pagination;
322
+ }
323
+
324
+ export namespace SimulationGroupListResponse {
325
+ /**
326
+ * A saved, repeatable set of plans that run together. Each run starts one run of
327
+ * every plan and groups them into a run group with one combined report.
328
+ */
329
+ export interface Data {
330
+ id: string;
331
+
332
+ /**
333
+ * Whether this group is managed by config as code. A managed group can be run
334
+ * here, but PUT and DELETE on it return 409: change it in the config file.
335
+ */
336
+ configManaged: boolean;
337
+
338
+ /**
339
+ * ISO 8601
340
+ */
341
+ createdAt: string;
342
+
343
+ description: string | null;
344
+
345
+ /**
346
+ * ISO 8601. Null when it has never run.
347
+ */
348
+ lastRunAt: string | null;
349
+
350
+ /**
351
+ * The most recent run group it started, readable at GET
352
+ * /v1/simulation/run-group/{groupId}. Null when it has never run.
353
+ */
354
+ latestRunGroupId: string | null;
355
+
356
+ name: string;
357
+
358
+ /**
359
+ * Where each run's group report announces itself once it is ready.
360
+ */
361
+ notifications: Data.Notifications;
362
+
363
+ /**
364
+ * The plans in run order. A plan deleted since it was added is left out.
365
+ */
366
+ plans: Array<Data.Plan>;
367
+
368
+ /**
369
+ * ISO 8601
370
+ */
371
+ updatedAt: string;
372
+ }
373
+
374
+ export namespace Data {
375
+ /**
376
+ * Where each run's group report announces itself once it is ready.
377
+ */
378
+ export interface Notifications {
379
+ email: Notifications.Email;
380
+
381
+ slack: Array<Notifications.Slack>;
382
+ }
383
+
384
+ export namespace Notifications {
385
+ export interface Email {
386
+ enabled: boolean;
387
+
388
+ recipients: Array<string>;
389
+ }
390
+
391
+ export interface Slack {
392
+ channelId: string;
393
+
394
+ channelName: string;
395
+ }
396
+ }
397
+
398
+ export interface Plan {
399
+ /**
400
+ * The plan, readable at GET /v1/simulation/plan/{planId}
401
+ */
402
+ id: string;
403
+
404
+ name: string;
405
+ }
406
+ }
407
+
408
+ export interface Pagination {
409
+ hasMore: boolean;
410
+
411
+ limit: number;
412
+
413
+ offset: number;
414
+
415
+ /**
416
+ * Total groups in the project, ignoring this page.
417
+ */
418
+ total: number;
419
+ }
420
+ }
421
+
422
+ export interface SimulationGroupDeleteResponse {
423
+ data: SimulationGroupDeleteResponse.Data;
424
+ }
425
+
426
+ export namespace SimulationGroupDeleteResponse {
427
+ export interface Data {
428
+ /**
429
+ * Whether the group was deleted
430
+ */
431
+ deleted: boolean;
432
+ }
433
+ }
434
+
435
+ export interface SimulationGroupGetByIDResponse {
436
+ /**
437
+ * A saved, repeatable set of plans that run together. Each run starts one run of
438
+ * every plan and groups them into a run group with one combined report.
439
+ */
440
+ data: SimulationGroupGetByIDResponse.Data;
441
+ }
442
+
443
+ export namespace SimulationGroupGetByIDResponse {
444
+ /**
445
+ * A saved, repeatable set of plans that run together. Each run starts one run of
446
+ * every plan and groups them into a run group with one combined report.
447
+ */
448
+ export interface Data {
449
+ id: string;
450
+
451
+ /**
452
+ * Whether this group is managed by config as code. A managed group can be run
453
+ * here, but PUT and DELETE on it return 409: change it in the config file.
454
+ */
455
+ configManaged: boolean;
456
+
457
+ /**
458
+ * ISO 8601
459
+ */
460
+ createdAt: string;
461
+
462
+ description: string | null;
463
+
464
+ /**
465
+ * ISO 8601. Null when it has never run.
466
+ */
467
+ lastRunAt: string | null;
468
+
469
+ /**
470
+ * The most recent run group it started, readable at GET
471
+ * /v1/simulation/run-group/{groupId}. Null when it has never run.
472
+ */
473
+ latestRunGroupId: string | null;
474
+
475
+ name: string;
476
+
477
+ /**
478
+ * Where each run's group report announces itself once it is ready.
479
+ */
480
+ notifications: Data.Notifications;
481
+
482
+ /**
483
+ * The plans in run order. A plan deleted since it was added is left out.
484
+ */
485
+ plans: Array<Data.Plan>;
486
+
487
+ /**
488
+ * ISO 8601
489
+ */
490
+ updatedAt: string;
491
+ }
492
+
493
+ export namespace Data {
494
+ /**
495
+ * Where each run's group report announces itself once it is ready.
496
+ */
497
+ export interface Notifications {
498
+ email: Notifications.Email;
499
+
500
+ slack: Array<Notifications.Slack>;
501
+ }
502
+
503
+ export namespace Notifications {
504
+ export interface Email {
505
+ enabled: boolean;
506
+
507
+ recipients: Array<string>;
508
+ }
509
+
510
+ export interface Slack {
511
+ channelId: string;
512
+
513
+ channelName: string;
514
+ }
515
+ }
516
+
517
+ export interface Plan {
518
+ /**
519
+ * The plan, readable at GET /v1/simulation/plan/{planId}
520
+ */
521
+ id: string;
522
+
523
+ name: string;
524
+ }
525
+ }
526
+ }
527
+
528
+ export interface SimulationGroupRunResponse {
529
+ /**
530
+ * Several simulation runs read as one.
531
+ */
532
+ data: SimulationGroupRunResponse.Data;
533
+ }
534
+
535
+ export namespace SimulationGroupRunResponse {
536
+ /**
537
+ * Several simulation runs read as one.
538
+ */
539
+ export interface Data {
540
+ id: string;
541
+
542
+ /**
543
+ * ISO 8601
544
+ */
545
+ createdAt: string;
546
+
547
+ /**
548
+ * One generation of the group report.
549
+ */
550
+ latestReport: Data.LatestReport | null;
551
+
552
+ name: string;
553
+
554
+ runCount: number;
555
+
556
+ runs: Array<Data.Run>;
557
+ }
558
+
559
+ export namespace Data {
560
+ /**
561
+ * One generation of the group report.
562
+ */
563
+ export interface LatestReport {
564
+ id: string;
565
+
566
+ /**
567
+ * ISO 8601. Null until the report settles.
568
+ */
569
+ completedAt: string | null;
570
+
571
+ /**
572
+ * ISO 8601
573
+ */
574
+ createdAt: string;
575
+
576
+ /**
577
+ * The group report: the runs it covers, a scorecard summed across them, what went
578
+ * well, and the issues found, each merged from the per-run debriefs with
579
+ * call-level evidence. Every figure is computed from the runs; the prose is
580
+ * AI-written around those facts.
581
+ */
582
+ document: LatestReport.Document | null;
583
+
584
+ errorMessage: string | null;
585
+
586
+ /**
587
+ * PENDING and GENERATING are in flight; READY carries the document; FAILED carries
588
+ * errorMessage.
589
+ */
590
+ status: 'PENDING' | 'GENERATING' | 'READY' | 'FAILED';
591
+ }
592
+
593
+ export namespace LatestReport {
594
+ /**
595
+ * The group report: the runs it covers, a scorecard summed across them, what went
596
+ * well, and the issues found, each merged from the per-run debriefs with
597
+ * call-level evidence. Every figure is computed from the runs; the prose is
598
+ * AI-written around those facts.
599
+ */
600
+ export interface Document {
601
+ aggregates: Array<Document.Aggregate>;
602
+
603
+ executiveSummary: Array<Document.ExecutiveSummary>;
604
+
605
+ generatedAtIso: string;
606
+
607
+ headline: Document.Headline;
608
+
609
+ issues: Array<Document.Issue>;
610
+
611
+ methodology: string;
612
+
613
+ model: string;
614
+
615
+ recommendations: Array<Document.Recommendation>;
616
+
617
+ runs: Array<Document.Run>;
618
+
619
+ scorecard: Array<Document.Scorecard>;
620
+
621
+ simulationRunGroupId: string;
622
+
623
+ smallerItems: Array<Document.SmallerItem>;
624
+
625
+ version: 1;
626
+
627
+ wentWell: Array<Document.WentWell>;
628
+ }
629
+
630
+ export namespace Document {
631
+ export interface Aggregate {
632
+ averageLabel: string | null;
633
+
634
+ evaluatedCount: number;
635
+
636
+ medianLabel: string | null;
637
+
638
+ metricName: string;
639
+
640
+ p95Label: string | null;
641
+ }
642
+
643
+ export interface ExecutiveSummary {
644
+ body: string;
645
+
646
+ heading: string;
647
+ }
648
+
649
+ export interface Headline {
650
+ callCount: number;
651
+
652
+ completedAtIso: string | null;
653
+
654
+ groupName: string;
655
+
656
+ passedRunCount: number;
657
+
658
+ reportedRunCount: number;
659
+
660
+ runCount: number;
661
+
662
+ statTiles: Array<Headline.StatTile>;
663
+
664
+ verdict: 'PASSED' | 'THRESHOLD_FAILED';
665
+
666
+ verdictProse: string;
667
+ }
668
+
669
+ export namespace Headline {
670
+ export interface StatTile {
671
+ deltaDirection: 'POSITIVE' | 'NEGATIVE' | 'NEUTRAL' | null;
672
+
673
+ label: string;
674
+
675
+ sub: string | null;
676
+
677
+ value: string;
678
+ }
679
+ }
680
+
681
+ export interface Issue {
682
+ affectedCallCount: number;
683
+
684
+ body: string;
685
+
686
+ calls: Array<Issue.Call>;
687
+
688
+ checkNames: Array<string>;
689
+
690
+ evidence: Array<Issue.Evidence>;
691
+
692
+ order: number;
693
+
694
+ rootCauseChannel:
695
+ | 'PROMPT'
696
+ | 'VOICE_CONFIG'
697
+ | 'STT'
698
+ | 'SPEECH_MODEL'
699
+ | 'LLM_MODEL'
700
+ | 'INFRA'
701
+ | 'EXTERNAL'
702
+ | null;
703
+
704
+ runLabels: Array<string>;
705
+
706
+ severity: 'HIGH' | 'MEDIUM' | 'LOW';
707
+
708
+ sourceThemes: Array<Issue.SourceTheme>;
709
+
710
+ title: string;
711
+ }
712
+
713
+ export namespace Issue {
714
+ export interface Call {
715
+ callId: string | null;
716
+
717
+ conversationId: string;
718
+
719
+ cueMs: number | null;
720
+
721
+ personaName: string | null;
722
+
723
+ simulationRunPlanJobId: string;
724
+ }
725
+
726
+ export interface Evidence {
727
+ callId: string | null;
728
+
729
+ conversationId: string;
730
+
731
+ cueMs: number | null;
732
+
733
+ personaName: string | null;
734
+
735
+ simulationRunPlanJobId: string;
736
+
737
+ text: string;
738
+ }
739
+
740
+ export interface SourceTheme {
741
+ simulationRunPlanJobId: string;
742
+
743
+ slug: string;
744
+ }
745
+ }
746
+
747
+ export interface Recommendation {
748
+ body: string;
749
+
750
+ channel:
751
+ | 'PROMPT'
752
+ | 'VOICE_CONFIG'
753
+ | 'STT'
754
+ | 'SPEECH_MODEL'
755
+ | 'LLM_MODEL'
756
+ | 'INFRA'
757
+ | 'EXTERNAL'
758
+ | null;
759
+
760
+ issueOrders: Array<number>;
761
+
762
+ order: number;
763
+
764
+ title: string;
765
+ }
766
+
767
+ export interface Run {
768
+ callCount: number;
769
+
770
+ checksPassed: number;
771
+
772
+ checksTotal: number;
773
+
774
+ completedAtIso: string | null;
775
+
776
+ runLabel: string;
777
+
778
+ runNumber: number | null;
779
+
780
+ simulationRunPlanJobId: string;
781
+
782
+ status:
783
+ | 'PENDING'
784
+ | 'QUEUED'
785
+ | 'CREATING_SNAPSHOTS'
786
+ | 'CREATING_SIMULATIONS'
787
+ | 'PREPARING_CAPACITY'
788
+ | 'RUNNING_SIMULATIONS'
789
+ | 'COMPLETED'
790
+ | 'FAILED'
791
+ | 'TIMED_OUT'
792
+ | 'CANCELLED'
793
+ | 'CANCELLING'
794
+ | 'ENDING_SIMULATIONS';
795
+
796
+ summary: string | null;
797
+
798
+ themeCount: number;
799
+
800
+ verdict: 'PASSED' | 'THRESHOLD_FAILED' | null;
801
+ }
802
+
803
+ export interface Scorecard {
804
+ checkName: string;
805
+
806
+ evaluatedCount: number;
807
+
808
+ failedCount: number;
809
+
810
+ failedRunCount: number;
811
+
812
+ passRatePct: number | null;
813
+
814
+ runCount: number;
815
+ }
816
+
817
+ export interface SmallerItem {
818
+ affectedCallCount: number;
819
+
820
+ body: string;
821
+
822
+ calls: Array<SmallerItem.Call>;
823
+
824
+ checkNames: Array<string>;
825
+
826
+ evidence: Array<SmallerItem.Evidence>;
827
+
828
+ order: number;
829
+
830
+ rootCauseChannel:
831
+ | 'PROMPT'
832
+ | 'VOICE_CONFIG'
833
+ | 'STT'
834
+ | 'SPEECH_MODEL'
835
+ | 'LLM_MODEL'
836
+ | 'INFRA'
837
+ | 'EXTERNAL'
838
+ | null;
839
+
840
+ runLabels: Array<string>;
841
+
842
+ severity: 'HIGH' | 'MEDIUM' | 'LOW';
843
+
844
+ sourceThemes: Array<SmallerItem.SourceTheme>;
845
+
846
+ title: string;
847
+ }
848
+
849
+ export namespace SmallerItem {
850
+ export interface Call {
851
+ callId: string | null;
852
+
853
+ conversationId: string;
854
+
855
+ cueMs: number | null;
856
+
857
+ personaName: string | null;
858
+
859
+ simulationRunPlanJobId: string;
860
+ }
861
+
862
+ export interface Evidence {
863
+ callId: string | null;
864
+
865
+ conversationId: string;
866
+
867
+ cueMs: number | null;
868
+
869
+ personaName: string | null;
870
+
871
+ simulationRunPlanJobId: string;
872
+
873
+ text: string;
874
+ }
875
+
876
+ export interface SourceTheme {
877
+ simulationRunPlanJobId: string;
878
+
879
+ slug: string;
880
+ }
881
+ }
882
+
883
+ export interface WentWell {
884
+ body: string;
885
+
886
+ evidence: Array<WentWell.Evidence>;
887
+
888
+ title: string;
889
+ }
890
+
891
+ export namespace WentWell {
892
+ export interface Evidence {
893
+ callId: string | null;
894
+
895
+ conversationId: string;
896
+
897
+ cueMs: number | null;
898
+
899
+ personaName: string | null;
900
+
901
+ simulationRunPlanJobId: string;
902
+
903
+ text: string;
904
+ }
905
+ }
906
+ }
907
+ }
908
+
909
+ /**
910
+ * One run in the group, in group order.
911
+ */
912
+ export interface Run {
913
+ /**
914
+ * ISO 8601
915
+ */
916
+ createdAt: string;
917
+
918
+ endedAt: string | null;
919
+
920
+ /**
921
+ * The name of the plan the run ran. Null when the plan was deleted.
922
+ */
923
+ planName: string | null;
924
+
925
+ /**
926
+ * Per-project run number, shown as SR-42 in the app.
927
+ */
928
+ runNumber: number | null;
929
+
930
+ simulationRunPlanId: string;
931
+
932
+ /**
933
+ * The run, readable at GET /v1/simulation/plan/job/{jobId}
934
+ */
935
+ simulationRunPlanJobId: string;
936
+
937
+ startedAt: string | null;
938
+
939
+ status:
940
+ | 'PENDING'
941
+ | 'QUEUED'
942
+ | 'CREATING_SNAPSHOTS'
943
+ | 'CREATING_SIMULATIONS'
944
+ | 'PREPARING_CAPACITY'
945
+ | 'RUNNING_SIMULATIONS'
946
+ | 'COMPLETED'
947
+ | 'FAILED'
948
+ | 'TIMED_OUT'
949
+ | 'CANCELLED'
950
+ | 'CANCELLING'
951
+ | 'ENDING_SIMULATIONS';
952
+ }
953
+ }
954
+ }
955
+
956
+ export interface SimulationGroupCreateParams {
957
+ /**
958
+ * What to call the group.
959
+ */
960
+ name: string;
961
+
962
+ /**
963
+ * The plans to run together, in run order (2 to 20). Duplicates are dropped.
964
+ */
965
+ simulationRunPlanIds: Array<string>;
966
+
967
+ /**
968
+ * What the group is for.
969
+ */
970
+ description?: string | null;
971
+
972
+ /**
973
+ * Defaults to email on (to the default audience) and no Slack.
974
+ */
975
+ notifications?: SimulationGroupCreateParams.Notifications;
976
+ }
977
+
978
+ export namespace SimulationGroupCreateParams {
979
+ /**
980
+ * Defaults to email on (to the default audience) and no Slack.
981
+ */
982
+ export interface Notifications {
983
+ email?: Notifications.Email;
984
+
985
+ /**
986
+ * Channels in the project's connected Slack workspace to post the report to (at
987
+ * most 10). Slack must be connected to the project first.
988
+ */
989
+ slack?: Array<Notifications.Slack>;
990
+ }
991
+
992
+ export namespace Notifications {
993
+ export interface Email {
994
+ /**
995
+ * Whether the group report of each run is emailed when it is ready.
996
+ */
997
+ enabled: boolean;
998
+
999
+ /**
1000
+ * Addresses to email (at most 50), Roark users or not: the email attaches the
1001
+ * report PDF. Empty emails every member of the project.
1002
+ */
1003
+ recipients?: Array<string>;
1004
+ }
1005
+
1006
+ export interface Slack {
1007
+ /**
1008
+ * The Slack channel id
1009
+ */
1010
+ channelId: string;
1011
+
1012
+ /**
1013
+ * The channel name, shown in Roark
1014
+ */
1015
+ channelName: string;
1016
+ }
1017
+ }
1018
+ }
1019
+
1020
+ export interface SimulationGroupUpdateParams {
1021
+ /**
1022
+ * Send null to clear it.
1023
+ */
1024
+ description?: string | null;
1025
+
1026
+ name?: string;
1027
+
1028
+ /**
1029
+ * Replaces the notification settings as a whole.
1030
+ */
1031
+ notifications?: SimulationGroupUpdateParams.Notifications;
1032
+
1033
+ /**
1034
+ * Replaces the plans, in run order.
1035
+ */
1036
+ simulationRunPlanIds?: Array<string>;
1037
+ }
1038
+
1039
+ export namespace SimulationGroupUpdateParams {
1040
+ /**
1041
+ * Replaces the notification settings as a whole.
1042
+ */
1043
+ export interface Notifications {
1044
+ email?: Notifications.Email;
1045
+
1046
+ /**
1047
+ * Channels in the project's connected Slack workspace to post the report to (at
1048
+ * most 10). Slack must be connected to the project first.
1049
+ */
1050
+ slack?: Array<Notifications.Slack>;
1051
+ }
1052
+
1053
+ export namespace Notifications {
1054
+ export interface Email {
1055
+ /**
1056
+ * Whether the group report of each run is emailed when it is ready.
1057
+ */
1058
+ enabled: boolean;
1059
+
1060
+ /**
1061
+ * Addresses to email (at most 50), Roark users or not: the email attaches the
1062
+ * report PDF. Empty emails every member of the project.
1063
+ */
1064
+ recipients?: Array<string>;
1065
+ }
1066
+
1067
+ export interface Slack {
1068
+ /**
1069
+ * The Slack channel id
1070
+ */
1071
+ channelId: string;
1072
+
1073
+ /**
1074
+ * The channel name, shown in Roark
1075
+ */
1076
+ channelName: string;
1077
+ }
1078
+ }
1079
+ }
1080
+
1081
+ export interface SimulationGroupListParams {
1082
+ /**
1083
+ * Maximum number of groups to return (default: 20, max: 100)
1084
+ */
1085
+ limit?: number;
1086
+
1087
+ /**
1088
+ * Pagination offset
1089
+ */
1090
+ offset?: number;
1091
+ }
1092
+
1093
+ export declare namespace SimulationGroup {
1094
+ export {
1095
+ type SimulationGroupCreateResponse as SimulationGroupCreateResponse,
1096
+ type SimulationGroupUpdateResponse as SimulationGroupUpdateResponse,
1097
+ type SimulationGroupListResponse as SimulationGroupListResponse,
1098
+ type SimulationGroupDeleteResponse as SimulationGroupDeleteResponse,
1099
+ type SimulationGroupGetByIDResponse as SimulationGroupGetByIDResponse,
1100
+ type SimulationGroupRunResponse as SimulationGroupRunResponse,
1101
+ type SimulationGroupCreateParams as SimulationGroupCreateParams,
1102
+ type SimulationGroupUpdateParams as SimulationGroupUpdateParams,
1103
+ type SimulationGroupListParams as SimulationGroupListParams,
1104
+ };
1105
+ }