@roarkanalytics/sdk 3.12.0 → 3.13.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 (78) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/client.d.mts +5 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/benchmark.d.mts +547 -0
  12. package/resources/benchmark.d.mts.map +1 -0
  13. package/resources/benchmark.d.ts +547 -0
  14. package/resources/benchmark.d.ts.map +1 -0
  15. package/resources/benchmark.js +110 -0
  16. package/resources/benchmark.js.map +1 -0
  17. package/resources/benchmark.mjs +106 -0
  18. package/resources/benchmark.mjs.map +1 -0
  19. package/resources/config.d.mts +3 -3
  20. package/resources/config.d.mts.map +1 -1
  21. package/resources/config.d.ts +3 -3
  22. package/resources/config.d.ts.map +1 -1
  23. package/resources/customer-flow-edge-case.d.mts +27 -18
  24. package/resources/customer-flow-edge-case.d.mts.map +1 -1
  25. package/resources/customer-flow-edge-case.d.ts +27 -18
  26. package/resources/customer-flow-edge-case.d.ts.map +1 -1
  27. package/resources/customer-flow.d.mts +117 -72
  28. package/resources/customer-flow.d.mts.map +1 -1
  29. package/resources/customer-flow.d.ts +117 -72
  30. package/resources/customer-flow.d.ts.map +1 -1
  31. package/resources/index.d.mts +2 -1
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +2 -1
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +3 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +1 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/simulation-job.d.mts +6 -4
  40. package/resources/simulation-job.d.mts.map +1 -1
  41. package/resources/simulation-job.d.ts +6 -4
  42. package/resources/simulation-job.d.ts.map +1 -1
  43. package/resources/simulation-persona.d.mts +18 -12
  44. package/resources/simulation-persona.d.mts.map +1 -1
  45. package/resources/simulation-persona.d.ts +18 -12
  46. package/resources/simulation-persona.d.ts.map +1 -1
  47. package/resources/simulation-run-plan-job.d.mts +141 -3
  48. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  49. package/resources/simulation-run-plan-job.d.ts +141 -3
  50. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  51. package/resources/simulation-run-plan-job.js +16 -0
  52. package/resources/simulation-run-plan-job.js.map +1 -1
  53. package/resources/simulation-run-plan-job.mjs +16 -0
  54. package/resources/simulation-run-plan-job.mjs.map +1 -1
  55. package/resources/simulation-run-plan.d.mts +38 -0
  56. package/resources/simulation-run-plan.d.mts.map +1 -1
  57. package/resources/simulation-run-plan.d.ts +38 -0
  58. package/resources/simulation-run-plan.d.ts.map +1 -1
  59. package/resources/simulation.d.mts +9 -0
  60. package/resources/simulation.d.mts.map +1 -1
  61. package/resources/simulation.d.ts +9 -0
  62. package/resources/simulation.d.ts.map +1 -1
  63. package/src/client.ts +33 -0
  64. package/src/resources/benchmark.ts +740 -0
  65. package/src/resources/config.ts +3 -3
  66. package/src/resources/customer-flow-edge-case.ts +27 -18
  67. package/src/resources/customer-flow.ts +120 -73
  68. package/src/resources/index.ts +15 -0
  69. package/src/resources/simulation-job.ts +6 -4
  70. package/src/resources/simulation-persona.ts +18 -12
  71. package/src/resources/simulation-run-plan-job.ts +201 -2
  72. package/src/resources/simulation-run-plan.ts +44 -0
  73. package/src/resources/simulation.ts +10 -0
  74. package/src/version.ts +1 -1
  75. package/version.d.mts +1 -1
  76. package/version.d.ts +1 -1
  77. package/version.js +1 -1
  78. package/version.mjs +1 -1
@@ -234,9 +234,10 @@ export namespace SimulationPersonaCreateResponse {
234
234
 
235
235
  /**
236
236
  * Controls how quickly the persona responds to pauses in conversation (QUICK,
237
- * NORMAL, RELAXED)
237
+ * NORMAL, RELAXED). BARGE_IN also talks over the agent once it has held the floor
238
+ * for several seconds.
238
239
  */
239
- responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK';
240
+ responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK' | 'BARGE_IN';
240
241
 
241
242
  /**
242
243
  * Speech clarity of the persona
@@ -462,9 +463,10 @@ export namespace SimulationPersonaUpdateResponse {
462
463
 
463
464
  /**
464
465
  * Controls how quickly the persona responds to pauses in conversation (QUICK,
465
- * NORMAL, RELAXED)
466
+ * NORMAL, RELAXED). BARGE_IN also talks over the agent once it has held the floor
467
+ * for several seconds.
466
468
  */
467
- responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK';
469
+ responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK' | 'BARGE_IN';
468
470
 
469
471
  /**
470
472
  * Speech clarity of the persona
@@ -692,9 +694,10 @@ export namespace SimulationPersonaListResponse {
692
694
 
693
695
  /**
694
696
  * Controls how quickly the persona responds to pauses in conversation (QUICK,
695
- * NORMAL, RELAXED)
697
+ * NORMAL, RELAXED). BARGE_IN also talks over the agent once it has held the floor
698
+ * for several seconds.
696
699
  */
697
- responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK';
700
+ responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK' | 'BARGE_IN';
698
701
 
699
702
  /**
700
703
  * Speech clarity of the persona
@@ -937,9 +940,10 @@ export namespace SimulationPersonaGetByIDResponse {
937
940
 
938
941
  /**
939
942
  * Controls how quickly the persona responds to pauses in conversation (QUICK,
940
- * NORMAL, RELAXED)
943
+ * NORMAL, RELAXED). BARGE_IN also talks over the agent once it has held the floor
944
+ * for several seconds.
941
945
  */
942
- responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK';
946
+ responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK' | 'BARGE_IN';
943
947
 
944
948
  /**
945
949
  * Speech clarity of the persona
@@ -1167,9 +1171,10 @@ export interface SimulationPersonaCreateParams {
1167
1171
 
1168
1172
  /**
1169
1173
  * Controls how quickly the persona responds to pauses in conversation (QUICK,
1170
- * NORMAL, RELAXED)
1174
+ * NORMAL, RELAXED). BARGE_IN also talks over the agent once it has held the floor
1175
+ * for several seconds.
1171
1176
  */
1172
- responseTiming?: 'RELAXED' | 'NORMAL' | 'QUICK';
1177
+ responseTiming?: 'RELAXED' | 'NORMAL' | 'QUICK' | 'BARGE_IN';
1173
1178
 
1174
1179
  /**
1175
1180
  * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
@@ -1374,9 +1379,10 @@ export interface SimulationPersonaUpdateParams {
1374
1379
 
1375
1380
  /**
1376
1381
  * Controls how quickly the persona responds to pauses in conversation (QUICK,
1377
- * NORMAL, RELAXED)
1382
+ * NORMAL, RELAXED). BARGE_IN also talks over the agent once it has held the floor
1383
+ * for several seconds.
1378
1384
  */
1379
- responseTiming?: 'RELAXED' | 'NORMAL' | 'QUICK';
1385
+ responseTiming?: 'RELAXED' | 'NORMAL' | 'QUICK' | 'BARGE_IN';
1380
1386
 
1381
1387
  /**
1382
1388
  * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
@@ -23,6 +23,23 @@ export class SimulationRunPlanJob extends APIResource {
23
23
  return this._client.get('/v1/simulation/plan/jobs', { query, ...options });
24
24
  }
25
25
 
26
+ /**
27
+ * Stops a run that has not finished yet. Already-finished runs are left alone.
28
+ *
29
+ * Intended for CI: when a pipeline is cancelled or superseded, cancelling the run
30
+ * stops it placing calls you no longer need. Safe to call more than once.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const response = await client.simulationRunPlanJob.cancel(
35
+ * '7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f',
36
+ * );
37
+ * ```
38
+ */
39
+ cancel(jobID: string, options?: RequestOptions): APIPromise<SimulationRunPlanJobCancelResponse> {
40
+ return this._client.post(path`/v1/simulation/plan/job/${jobID}/cancel`, options);
41
+ }
42
+
26
43
  /**
27
44
  * Retrieve details of a simulation plan job including all associated simulation
28
45
  * jobs (calls)
@@ -144,6 +161,45 @@ export namespace SimulationRunPlanJobListResponse {
144
161
  }
145
162
  }
146
163
 
164
+ export interface SimulationRunPlanJobCancelResponse {
165
+ /**
166
+ * Result of cancelling a simulation plan job
167
+ */
168
+ data: SimulationRunPlanJobCancelResponse.Data;
169
+ }
170
+
171
+ export namespace SimulationRunPlanJobCancelResponse {
172
+ /**
173
+ * Result of cancelling a simulation plan job
174
+ */
175
+ export interface Data {
176
+ /**
177
+ * True when this request stopped the run. False when it had already finished,
178
+ * which is not an error.
179
+ */
180
+ cancelled: boolean;
181
+
182
+ simulationRunPlanJobId: string;
183
+
184
+ /**
185
+ * The job status after the request. Unchanged when the run had already finished.
186
+ */
187
+ status:
188
+ | 'PENDING'
189
+ | 'QUEUED'
190
+ | 'CREATING_SNAPSHOTS'
191
+ | 'CREATING_SIMULATIONS'
192
+ | 'PREPARING_CAPACITY'
193
+ | 'RUNNING_SIMULATIONS'
194
+ | 'COMPLETED'
195
+ | 'FAILED'
196
+ | 'TIMED_OUT'
197
+ | 'CANCELLED'
198
+ | 'CANCELLING'
199
+ | 'ENDING_SIMULATIONS';
200
+ }
201
+ }
202
+
147
203
  export interface SimulationRunPlanJobGetByIDResponse {
148
204
  /**
149
205
  * Simulation run plan job with all associated simulation jobs
@@ -202,6 +258,12 @@ export namespace SimulationRunPlanJobGetByIDResponse {
202
258
  * When the job started
203
259
  */
204
260
  startedAt?: string | null;
261
+
262
+ /**
263
+ * Pass/fail verdict for the run, judged against the success criteria pinned on the
264
+ * run plan when the run started.
265
+ */
266
+ verdict?: Data.Verdict | null;
205
267
  }
206
268
 
207
269
  export namespace Data {
@@ -496,9 +558,10 @@ export namespace SimulationRunPlanJobGetByIDResponse {
496
558
 
497
559
  /**
498
560
  * Controls how quickly the persona responds to pauses in conversation (QUICK,
499
- * NORMAL, RELAXED)
561
+ * NORMAL, RELAXED). BARGE_IN also talks over the agent once it has held the floor
562
+ * for several seconds.
500
563
  */
501
- responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK';
564
+ responseTiming: 'RELAXED' | 'NORMAL' | 'QUICK' | 'BARGE_IN';
502
565
 
503
566
  /**
504
567
  * Speech clarity of the persona
@@ -578,6 +641,141 @@ export namespace SimulationRunPlanJobGetByIDResponse {
578
641
  description?: string | null;
579
642
  }
580
643
  }
644
+
645
+ /**
646
+ * Pass/fail verdict for the run, judged against the success criteria pinned on the
647
+ * run plan when the run started.
648
+ */
649
+ export interface Verdict {
650
+ /**
651
+ * Every check the run was judged on, with its rate and the minimum it had to
652
+ * reach.
653
+ */
654
+ checks: Array<Verdict.Check>;
655
+
656
+ /**
657
+ * Every criterion the run missed. Empty when it passed.
658
+ */
659
+ failures: Array<
660
+ Verdict.UnionMember0 | Verdict.UnionMember1 | Verdict.UnionMember2 | Verdict.UnionMember3
661
+ >;
662
+
663
+ /**
664
+ * Whether every check cleared its own `minPassRate` (and the run completed with
665
+ * full coverage). Use this as the CI exit status.
666
+ *
667
+ * Never derived from `score`: a run can score 95 and still fail, or score 40 and
668
+ * still pass.
669
+ */
670
+ passed: boolean;
671
+
672
+ /**
673
+ * The run's headline quality number, 0-100: the mean of each check's own pass
674
+ * rate.
675
+ *
676
+ * REPORTING ONLY, for dashboards and trend lines. Nothing is judged against it.
677
+ * Null when nothing was evaluated.
678
+ */
679
+ score: number | null;
680
+ }
681
+
682
+ export namespace Verdict {
683
+ /**
684
+ * How one pass/fail metric did. Present for every check, passing or not.
685
+ */
686
+ export interface Check {
687
+ evaluatedSims: number;
688
+
689
+ /**
690
+ * Whether `minPassRate` is the 80% default (`true`) or a minimum this metric set
691
+ * for itself.
692
+ */
693
+ inherited: boolean;
694
+
695
+ metricDefinitionId: string;
696
+
697
+ /**
698
+ * THE BAR it was judged against: the share of the run's simulations it had to
699
+ * pass.
700
+ */
701
+ minPassRate: number;
702
+
703
+ /**
704
+ * This check's own pass rate, 0-100: the share of sims it evaluated that passed
705
+ * it. Null when it evaluated nothing.
706
+ */
707
+ passRate: number | null;
708
+
709
+ /**
710
+ * `passRate >= minPassRate`.
711
+ */
712
+ passed: boolean;
713
+
714
+ passedSims: number;
715
+
716
+ metricName?: string | null;
717
+ }
718
+
719
+ export interface UnionMember0 {
720
+ /**
721
+ * The status the run actually ended in.
722
+ */
723
+ status:
724
+ | 'PENDING'
725
+ | 'QUEUED'
726
+ | 'CREATING_SNAPSHOTS'
727
+ | 'CREATING_SIMULATIONS'
728
+ | 'PREPARING_CAPACITY'
729
+ | 'RUNNING_SIMULATIONS'
730
+ | 'COMPLETED'
731
+ | 'FAILED'
732
+ | 'TIMED_OUT'
733
+ | 'CANCELLED'
734
+ | 'CANCELLING'
735
+ | 'ENDING_SIMULATIONS';
736
+
737
+ type: 'RUN_NOT_COMPLETED';
738
+ }
739
+
740
+ export interface UnionMember1 {
741
+ evaluatedCalls: number;
742
+
743
+ expectedCalls: number;
744
+
745
+ type: 'INCOMPLETE_COVERAGE';
746
+ }
747
+
748
+ export interface UnionMember2 {
749
+ metricDefinitionId: string;
750
+
751
+ type: 'METRIC_NOT_EVALUATED';
752
+
753
+ /**
754
+ * The check’s name, for rendering the failure.
755
+ */
756
+ metricName?: string | null;
757
+ }
758
+
759
+ export interface UnionMember3 {
760
+ /**
761
+ * Whether the missed minimum was the 80% default (`true`) or this metric's own.
762
+ */
763
+ inherited: boolean;
764
+
765
+ metricDefinitionId: string;
766
+
767
+ minPassRate: number;
768
+
769
+ passRate: number;
770
+
771
+ type: 'METRIC_BELOW_MIN_PASS_RATE';
772
+
773
+ /**
774
+ * The check’s name, for rendering the failure.
775
+ */
776
+ metricName?: string | null;
777
+ }
778
+ }
581
779
  }
582
780
  }
583
781
 
@@ -745,6 +943,7 @@ export namespace SimulationRunPlanJobStartParams {
745
943
  export declare namespace SimulationRunPlanJob {
746
944
  export {
747
945
  type SimulationRunPlanJobListResponse as SimulationRunPlanJobListResponse,
946
+ type SimulationRunPlanJobCancelResponse as SimulationRunPlanJobCancelResponse,
748
947
  type SimulationRunPlanJobGetByIDResponse as SimulationRunPlanJobGetByIDResponse,
749
948
  type SimulationRunPlanJobStartResponse as SimulationRunPlanJobStartResponse,
750
949
  type SimulationRunPlanJobListParams as SimulationRunPlanJobListParams,
@@ -342,6 +342,12 @@ export namespace SimulationRunPlanCreateResponse {
342
342
  * default, SIMULATED.
343
343
  */
344
344
  conversationSource: 'SIMULATED' | 'LIVE' | null;
345
+
346
+ /**
347
+ * THE BAR. The share of the run's simulations (0-100) that must pass this check.
348
+ * `null` means the 80% default.
349
+ */
350
+ minPassRate: number | null;
345
351
  }
346
352
 
347
353
  export interface Persona {
@@ -624,6 +630,12 @@ export namespace SimulationRunPlanUpdateResponse {
624
630
  * default, SIMULATED.
625
631
  */
626
632
  conversationSource: 'SIMULATED' | 'LIVE' | null;
633
+
634
+ /**
635
+ * THE BAR. The share of the run's simulations (0-100) that must pass this check.
636
+ * `null` means the 80% default.
637
+ */
638
+ minPassRate: number | null;
627
639
  }
628
640
 
629
641
  export interface Persona {
@@ -870,6 +882,12 @@ export namespace SimulationRunPlanListResponse {
870
882
  * default, SIMULATED.
871
883
  */
872
884
  conversationSource: 'SIMULATED' | 'LIVE' | null;
885
+
886
+ /**
887
+ * THE BAR. The share of the run's simulations (0-100) that must pass this check.
888
+ * `null` means the 80% default.
889
+ */
890
+ minPassRate: number | null;
873
891
  }
874
892
 
875
893
  export interface Persona {
@@ -1144,6 +1162,12 @@ export namespace SimulationRunPlanGetByIDResponse {
1144
1162
  * default, SIMULATED.
1145
1163
  */
1146
1164
  conversationSource: 'SIMULATED' | 'LIVE' | null;
1165
+
1166
+ /**
1167
+ * THE BAR. The share of the run's simulations (0-100) that must pass this check.
1168
+ * `null` means the 80% default.
1169
+ */
1170
+ minPassRate: number | null;
1147
1171
  }
1148
1172
 
1149
1173
  export interface Persona {
@@ -1326,6 +1350,16 @@ export namespace SimulationRunPlanCreateParams {
1326
1350
  */
1327
1351
  metricId?: string;
1328
1352
 
1353
+ /**
1354
+ * THE BAR, and the only thing that decides pass/fail. The share of the run's
1355
+ * simulations that must pass this check, 0-100.
1356
+ *
1357
+ * Applied to this check alone and never pooled: silence duration at 40 and word
1358
+ * count at 80 means the run fails unless 40% of sims clear silence AND 80% clear
1359
+ * word count. Omit or `null` for the 80% default.
1360
+ */
1361
+ minPassRate?: number | null;
1362
+
1329
1363
  /**
1330
1364
  * Stable metric slug (e.g. `customer_satisfaction`). Provide either this or `id`,
1331
1365
  * not both.
@@ -1629,6 +1663,16 @@ export namespace SimulationRunPlanUpdateParams {
1629
1663
  */
1630
1664
  metricId?: string;
1631
1665
 
1666
+ /**
1667
+ * THE BAR, and the only thing that decides pass/fail. The share of the run's
1668
+ * simulations that must pass this check, 0-100.
1669
+ *
1670
+ * Applied to this check alone and never pooled: silence duration at 40 and word
1671
+ * count at 80 means the run fails unless 40% of sims clear silence AND 80% clear
1672
+ * word count. Omit or `null` for the 80% default.
1673
+ */
1674
+ minPassRate?: number | null;
1675
+
1632
1676
  /**
1633
1677
  * Stable metric slug (e.g. `customer_satisfaction`). Provide either this or `id`,
1634
1678
  * not both.
@@ -312,6 +312,16 @@ export declare namespace SimulationRunParams {
312
312
  */
313
313
  metricId?: string;
314
314
 
315
+ /**
316
+ * THE BAR, and the only thing that decides pass/fail. The share of the run's
317
+ * simulations that must pass this check, 0-100.
318
+ *
319
+ * Applied to this check alone and never pooled: silence duration at 40 and word
320
+ * count at 80 means the run fails unless 40% of sims clear silence AND 80% clear
321
+ * word count. Omit or `null` for the 80% default.
322
+ */
323
+ minPassRate?: number | null;
324
+
315
325
  /**
316
326
  * Stable metric slug (e.g. `customer_satisfaction`). Provide either this or `id`,
317
327
  * not both.
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '3.12.0'; // x-release-please-version
1
+ export const VERSION = '3.13.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.12.0";
1
+ export declare const VERSION = "3.13.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.12.0";
1
+ export declare const VERSION = "3.13.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '3.12.0'; // x-release-please-version
4
+ exports.VERSION = '3.13.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.12.0'; // x-release-please-version
1
+ export const VERSION = '3.13.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map