@roarkanalytics/sdk 4.19.0 → 4.21.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 (65) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/package.json +1 -1
  3. package/resources/benchmark.d.mts +6 -4
  4. package/resources/benchmark.d.mts.map +1 -1
  5. package/resources/benchmark.d.ts +6 -4
  6. package/resources/benchmark.d.ts.map +1 -1
  7. package/resources/call.d.mts +128 -0
  8. package/resources/call.d.mts.map +1 -1
  9. package/resources/call.d.ts +128 -0
  10. package/resources/call.d.ts.map +1 -1
  11. package/resources/config.d.mts +24 -0
  12. package/resources/config.d.mts.map +1 -1
  13. package/resources/config.d.ts +24 -0
  14. package/resources/config.d.ts.map +1 -1
  15. package/resources/customer-flow-edge-case.d.mts +60 -0
  16. package/resources/customer-flow-edge-case.d.mts.map +1 -1
  17. package/resources/customer-flow-edge-case.d.ts +60 -0
  18. package/resources/customer-flow-edge-case.d.ts.map +1 -1
  19. package/resources/customer-flow.d.mts +240 -0
  20. package/resources/customer-flow.d.mts.map +1 -1
  21. package/resources/customer-flow.d.ts +240 -0
  22. package/resources/customer-flow.d.ts.map +1 -1
  23. package/resources/simulation-job.d.mts +44 -2
  24. package/resources/simulation-job.d.mts.map +1 -1
  25. package/resources/simulation-job.d.ts +44 -2
  26. package/resources/simulation-job.d.ts.map +1 -1
  27. package/resources/simulation-persona.d.mts +20 -0
  28. package/resources/simulation-persona.d.mts.map +1 -1
  29. package/resources/simulation-persona.d.ts +20 -0
  30. package/resources/simulation-persona.d.ts.map +1 -1
  31. package/resources/simulation-run-plan-job.d.mts +172 -5
  32. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  33. package/resources/simulation-run-plan-job.d.ts +172 -5
  34. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  35. package/resources/simulation-run-plan.d.mts +148 -42
  36. package/resources/simulation-run-plan.d.mts.map +1 -1
  37. package/resources/simulation-run-plan.d.ts +148 -42
  38. package/resources/simulation-run-plan.d.ts.map +1 -1
  39. package/resources/simulation-run-plan.js +0 -1
  40. package/resources/simulation-run-plan.js.map +1 -1
  41. package/resources/simulation-run-plan.mjs +0 -1
  42. package/resources/simulation-run-plan.mjs.map +1 -1
  43. package/resources/simulation.d.mts +80 -42
  44. package/resources/simulation.d.mts.map +1 -1
  45. package/resources/simulation.d.ts +80 -42
  46. package/resources/simulation.d.ts.map +1 -1
  47. package/resources/simulation.js +0 -1
  48. package/resources/simulation.js.map +1 -1
  49. package/resources/simulation.mjs +0 -1
  50. package/resources/simulation.mjs.map +1 -1
  51. package/src/resources/benchmark.ts +6 -4
  52. package/src/resources/call.ts +152 -0
  53. package/src/resources/config.ts +48 -0
  54. package/src/resources/customer-flow-edge-case.ts +72 -0
  55. package/src/resources/customer-flow.ts +288 -0
  56. package/src/resources/simulation-job.ts +52 -2
  57. package/src/resources/simulation-persona.ts +24 -0
  58. package/src/resources/simulation-run-plan-job.ts +209 -5
  59. package/src/resources/simulation-run-plan.ts +166 -48
  60. package/src/resources/simulation.ts +90 -48
  61. package/src/version.ts +1 -1
  62. package/version.d.mts +1 -1
  63. package/version.d.ts +1 -1
  64. package/version.js +1 -1
  65. package/version.mjs +1 -1
@@ -57,6 +57,13 @@ export namespace SimulationJobGetByIDResponse {
57
57
  */
58
58
  agentEndpoint: Data.AgentEndpoint;
59
59
 
60
+ /**
61
+ * This simulation’s place among its test case’s attempts: 1 for the first, 2 for
62
+ * the first retry. Above 1 only when the plan retries simulations your agent never
63
+ * spoke on.
64
+ */
65
+ attemptNumber: number;
66
+
60
67
  /**
61
68
  * The background noise the call actually ran with. `persona.backgroundNoise` is
62
69
  * only what the persona was set to; a flow’s environment overrides it, and on a
@@ -107,6 +114,12 @@ export namespace SimulationJobGetByIDResponse {
107
114
  */
108
115
  queuePosition: number | null;
109
116
 
117
+ /**
118
+ * The simulation this one retries, because your agent never spoke on it. Null on a
119
+ * test case’s first attempt.
120
+ */
121
+ retryOfSimulationJobId: string | null;
122
+
110
123
  runPlan: Data.RunPlan;
111
124
 
112
125
  /**
@@ -114,13 +127,19 @@ export namespace SimulationJobGetByIDResponse {
114
127
  */
115
128
  scenario: Data.Scenario;
116
129
 
130
+ /**
131
+ * When a `RETRY_SCHEDULED` retry dials, ISO 8601. Null on a first attempt.
132
+ */
133
+ scheduledAt: string | null;
134
+
117
135
  /**
118
136
  * Simulation job ID
119
137
  */
120
138
  simulationJobId: string;
121
139
 
122
140
  /**
123
- * Job status
141
+ * Job status. `RETRY_SCHEDULED` is a retry of a simulation your agent never spoke
142
+ * on, waiting out the plan’s `noResponseRetryBackoffSeconds` before it dials.
124
143
  */
125
144
  status: string;
126
145
 
@@ -534,6 +553,12 @@ export namespace SimulationJobGetByIDResponse {
534
553
  */
535
554
  displayName?: string | null;
536
555
 
556
+ /**
557
+ * The E.164 number every call with this persona uses, when Roark has pinned one
558
+ * for your project. Present only when set; read-only.
559
+ */
560
+ phoneNumber?: string;
561
+
537
562
  /**
538
563
  * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
539
564
  */
@@ -592,6 +617,13 @@ export namespace SimulationJobLookupResponse {
592
617
  */
593
618
  agentEndpoint: Data.AgentEndpoint;
594
619
 
620
+ /**
621
+ * This simulation’s place among its test case’s attempts: 1 for the first, 2 for
622
+ * the first retry. Above 1 only when the plan retries simulations your agent never
623
+ * spoke on.
624
+ */
625
+ attemptNumber: number;
626
+
595
627
  /**
596
628
  * The background noise the call actually ran with. `persona.backgroundNoise` is
597
629
  * only what the persona was set to; a flow’s environment overrides it, and on a
@@ -642,6 +674,12 @@ export namespace SimulationJobLookupResponse {
642
674
  */
643
675
  queuePosition: number | null;
644
676
 
677
+ /**
678
+ * The simulation this one retries, because your agent never spoke on it. Null on a
679
+ * test case’s first attempt.
680
+ */
681
+ retryOfSimulationJobId: string | null;
682
+
645
683
  runPlan: Data.RunPlan;
646
684
 
647
685
  /**
@@ -649,13 +687,19 @@ export namespace SimulationJobLookupResponse {
649
687
  */
650
688
  scenario: Data.Scenario;
651
689
 
690
+ /**
691
+ * When a `RETRY_SCHEDULED` retry dials, ISO 8601. Null on a first attempt.
692
+ */
693
+ scheduledAt: string | null;
694
+
652
695
  /**
653
696
  * Simulation job ID
654
697
  */
655
698
  simulationJobId: string;
656
699
 
657
700
  /**
658
- * Job status
701
+ * Job status. `RETRY_SCHEDULED` is a retry of a simulation your agent never spoke
702
+ * on, waiting out the plan’s `noResponseRetryBackoffSeconds` before it dials.
659
703
  */
660
704
  status: string;
661
705
 
@@ -1069,6 +1113,12 @@ export namespace SimulationJobLookupResponse {
1069
1113
  */
1070
1114
  displayName?: string | null;
1071
1115
 
1116
+ /**
1117
+ * The E.164 number every call with this persona uses, when Roark has pinned one
1118
+ * for your project. Present only when set; read-only.
1119
+ */
1120
+ phoneNumber?: string;
1121
+
1072
1122
  /**
1073
1123
  * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
1074
1124
  */
@@ -314,6 +314,12 @@ export namespace SimulationPersonaCreateResponse {
314
314
  */
315
315
  displayName?: string | null;
316
316
 
317
+ /**
318
+ * The E.164 number every call with this persona uses, when Roark has pinned one
319
+ * for your project. Present only when set; read-only.
320
+ */
321
+ phoneNumber?: string;
322
+
317
323
  /**
318
324
  * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
319
325
  */
@@ -561,6 +567,12 @@ export namespace SimulationPersonaUpdateResponse {
561
567
  */
562
568
  displayName?: string | null;
563
569
 
570
+ /**
571
+ * The E.164 number every call with this persona uses, when Roark has pinned one
572
+ * for your project. Present only when set; read-only.
573
+ */
574
+ phoneNumber?: string;
575
+
564
576
  /**
565
577
  * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
566
578
  */
@@ -810,6 +822,12 @@ export namespace SimulationPersonaListResponse {
810
822
  */
811
823
  displayName?: string | null;
812
824
 
825
+ /**
826
+ * The E.164 number every call with this persona uses, when Roark has pinned one
827
+ * for your project. Present only when set; read-only.
828
+ */
829
+ phoneNumber?: string;
830
+
813
831
  /**
814
832
  * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
815
833
  */
@@ -1074,6 +1092,12 @@ export namespace SimulationPersonaGetByIDResponse {
1074
1092
  */
1075
1093
  displayName?: string | null;
1076
1094
 
1095
+ /**
1096
+ * The E.164 number every call with this persona uses, when Roark has pinned one
1097
+ * for your project. Present only when set; read-only.
1098
+ */
1099
+ phoneNumber?: string;
1100
+
1077
1101
  /**
1078
1102
  * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
1079
1103
  */
@@ -212,13 +212,27 @@ export namespace SimulationRunPlanJobGetByIDResponse {
212
212
  * Simulation run plan job with all associated simulation jobs
213
213
  */
214
214
  export interface Data {
215
+ /**
216
+ * The run’s simulations against its test cases. Differs from a plain job count
217
+ * only when the plan retries simulations your agent never spoke on.
218
+ */
219
+ attemptSummary: Data.AttemptSummary;
220
+
215
221
  /**
216
222
  * When the job was created
217
223
  */
218
224
  createdAt: string;
219
225
 
220
226
  /**
221
- * List of simulation jobs (calls) in this run plan job
227
+ * Retries waiting out their backoff, soonest first. While this is not empty the
228
+ * run is waiting, not stuck: it settles only once every test case has a final
229
+ * attempt. Empty when nothing is scheduled.
230
+ */
231
+ pendingRetries: Array<Data.PendingRetry>;
232
+
233
+ /**
234
+ * List of simulation jobs (calls) in this run plan job, every attempt included: a
235
+ * simulation your agent never spoke on stays listed after a retry replaces it.
222
236
  */
223
237
  simulationJobs: Array<Data.SimulationJob>;
224
238
 
@@ -280,12 +294,80 @@ export namespace SimulationRunPlanJobGetByIDResponse {
280
294
  }
281
295
 
282
296
  export namespace Data {
297
+ /**
298
+ * The run’s simulations against its test cases. Differs from a plain job count
299
+ * only when the plan retries simulations your agent never spoke on.
300
+ */
301
+ export interface AttemptSummary {
302
+ /**
303
+ * Every simulation placed, retries included. Each is a separate, billed call.
304
+ */
305
+ attemptCount: number;
306
+
307
+ /**
308
+ * Simulations placed as a retry of one your agent never spoke on.
309
+ */
310
+ retryCount: number;
311
+
312
+ /**
313
+ * Simulations your agent never spoke on, including the ones a retry replaced.
314
+ */
315
+ silentAttemptCount: number;
316
+
317
+ /**
318
+ * Test cases whose final attempt your agent still never spoke on. This is what the
319
+ * `AGENT_NEVER_SPOKE` verdict failure counts.
320
+ */
321
+ stillSilentTestCaseCount: number;
322
+
323
+ /**
324
+ * Test cases in the run. Each one has a single final attempt that its result is
325
+ * read from.
326
+ */
327
+ testCaseCount: number;
328
+ }
329
+
330
+ /**
331
+ * A retry of a simulation your agent never spoke on, waiting out its backoff
332
+ * before it dials.
333
+ */
334
+ export interface PendingRetry {
335
+ /**
336
+ * Its place among its test case’s attempts, 2 for the first retry.
337
+ */
338
+ attemptNumber: number;
339
+
340
+ /**
341
+ * The most attempts a test case can get on this run: the plan’s
342
+ * `maxNoResponseRetries` plus 1.
343
+ */
344
+ maxAttempts: number;
345
+
346
+ /**
347
+ * When the retry dials, ISO 8601. It may wait longer behind the run’s concurrency
348
+ * limit.
349
+ */
350
+ scheduledAt: string | null;
351
+
352
+ /**
353
+ * The scheduled retry.
354
+ */
355
+ simulationJobId: string;
356
+ }
357
+
283
358
  export interface SimulationJob {
284
359
  /**
285
360
  * Agent endpoint used in a simulation
286
361
  */
287
362
  agentEndpoint: SimulationJob.AgentEndpoint;
288
363
 
364
+ /**
365
+ * This simulation’s place among its test case’s attempts: 1 for the first, 2 for
366
+ * the first retry. Above 1 only when the plan retries simulations your agent never
367
+ * spoke on.
368
+ */
369
+ attemptNumber: number;
370
+
289
371
  /**
290
372
  * The background noise the call actually ran with. `persona.backgroundNoise` is
291
373
  * only what the persona was set to; a flow’s environment overrides it, and on a
@@ -325,18 +407,30 @@ export namespace SimulationRunPlanJobGetByIDResponse {
325
407
  | 'COLLECTING_METRICS'
326
408
  | 'COMPLETED';
327
409
 
410
+ /**
411
+ * The simulation this one retries, because your agent never spoke on it. Null on a
412
+ * test case’s first attempt.
413
+ */
414
+ retryOfSimulationJobId: string | null;
415
+
328
416
  /**
329
417
  * Scenario used in a simulation
330
418
  */
331
419
  scenario: SimulationJob.Scenario;
332
420
 
421
+ /**
422
+ * When a `RETRY_SCHEDULED` retry dials, ISO 8601. Null on a first attempt.
423
+ */
424
+ scheduledAt: string | null;
425
+
333
426
  /**
334
427
  * Simulation job ID
335
428
  */
336
429
  simulationJobId: string;
337
430
 
338
431
  /**
339
- * Job status
432
+ * Job status. `RETRY_SCHEDULED` is a retry of a simulation your agent never spoke
433
+ * on, waiting out the plan’s `noResponseRetryBackoffSeconds` before it dials.
340
434
  */
341
435
  status:
342
436
  | 'PENDING'
@@ -346,7 +440,8 @@ export namespace SimulationRunPlanJobGetByIDResponse {
346
440
  | 'FAILED'
347
441
  | 'TIMED_OUT'
348
442
  | 'CANCELLED'
349
- | 'CANCELLING';
443
+ | 'CANCELLING'
444
+ | 'RETRY_SCHEDULED';
350
445
 
351
446
  /**
352
447
  * ID of the call created for this simulation job. Null if the call has not been
@@ -712,6 +807,12 @@ export namespace SimulationRunPlanJobGetByIDResponse {
712
807
  */
713
808
  displayName?: string | null;
714
809
 
810
+ /**
811
+ * The E.164 number every call with this persona uses, when Roark has pinned one
812
+ * for your project. Present only when set; read-only.
813
+ */
814
+ phoneNumber?: string;
815
+
715
816
  /**
716
817
  * Secondary language ISO 639-1 code for code-switching (e.g., Hinglish, Spanglish)
717
818
  */
@@ -783,6 +884,13 @@ export namespace SimulationRunPlanJobGetByIDResponse {
783
884
  */
784
885
  minimumDetectableGap: number | null;
785
886
 
887
+ /**
888
+ * The values your agent never spoke on significantly more often than the rest of
889
+ * the run, most significant first, tested the same way as `worseValues`. Empty on
890
+ * a run with no silent simulations.
891
+ */
892
+ neverSpokeValues: Array<SweepAttribution.NeverSpokeValue>;
893
+
786
894
  /**
787
895
  * How many values had enough counted simulations to be compared.
788
896
  */
@@ -876,6 +984,47 @@ export namespace SimulationRunPlanJobGetByIDResponse {
876
984
  }
877
985
  }
878
986
 
987
+ /**
988
+ * A value your agent never spoke on significantly more often than the rest of the
989
+ * run.
990
+ */
991
+ export interface NeverSpokeValue {
992
+ /**
993
+ * How likely a difference at least this large would be by chance alone, after
994
+ * correcting across the values (Benjamini-Hochberg).
995
+ */
996
+ adjustedPValue: number;
997
+
998
+ /**
999
+ * Simulations run at this value.
1000
+ */
1001
+ attempted: number;
1002
+
1003
+ label: string;
1004
+
1005
+ /**
1006
+ * Simulations run across every other value combined.
1007
+ */
1008
+ restAttempted: number;
1009
+
1010
+ /**
1011
+ * Simulations your agent never spoke on across every other value combined.
1012
+ */
1013
+ restSilentAttempts: number;
1014
+
1015
+ /**
1016
+ * Retries placed at this value because your agent never spoke.
1017
+ */
1018
+ retries: number;
1019
+
1020
+ /**
1021
+ * Simulations at this value your agent never spoke on, retried or not.
1022
+ */
1023
+ silentAttempts: number;
1024
+
1025
+ value: string;
1026
+ }
1027
+
879
1028
  /**
880
1029
  * One value of the swept property.
881
1030
  */
@@ -902,6 +1051,12 @@ export namespace SimulationRunPlanJobGetByIDResponse {
902
1051
  */
903
1052
  label: string;
904
1053
 
1054
+ /**
1055
+ * Of `attempted`, the retries of simulations your agent never spoke on. Zero
1056
+ * unless the plan retries silent simulations.
1057
+ */
1058
+ retries: number;
1059
+
905
1060
  /**
906
1061
  * The mean of each check's pass rate at this value, 0-100, the same rule as the
907
1062
  * run's `score`. Descriptive only: a lower score alone never makes a value worse.
@@ -909,6 +1064,12 @@ export namespace SimulationRunPlanJobGetByIDResponse {
909
1064
  */
910
1065
  score: number | null;
911
1066
 
1067
+ /**
1068
+ * Of `attempted`, the simulations your agent never spoke on, whether or not a
1069
+ * retry followed. They are invalidated, so they are never in `counted`.
1070
+ */
1071
+ silentAttempts: number;
1072
+
912
1073
  /**
913
1074
  * Whether this value had at least `minArmCalls` counted simulations. A value below
914
1075
  * that is "insufficient data": it is reported with its numbers but never compared
@@ -941,7 +1102,11 @@ export namespace SimulationRunPlanJobGetByIDResponse {
941
1102
  * Every criterion the run missed. Empty when it passed.
942
1103
  */
943
1104
  failures: Array<
944
- Verdict.UnionMember0 | Verdict.UnionMember1 | Verdict.UnionMember2 | Verdict.UnionMember3
1105
+ | Verdict.UnionMember0
1106
+ | Verdict.UnionMember1
1107
+ | Verdict.UnionMember2
1108
+ | Verdict.UnionMember3
1109
+ | Verdict.UnionMember4
945
1110
  >;
946
1111
 
947
1112
  /**
@@ -1040,7 +1205,46 @@ export namespace SimulationRunPlanJobGetByIDResponse {
1040
1205
  type: 'INCOMPLETE_COVERAGE';
1041
1206
  }
1042
1207
 
1208
+ /**
1209
+ * Your agent never spoke on more than `maxShare` percent of the run. Those
1210
+ * simulations are left out of every check, so the run fails on them whatever the
1211
+ * checks say.
1212
+ */
1043
1213
  export interface UnionMember2 {
1214
+ /**
1215
+ * The largest share of simulations, 0-100, your agent may never speak on while the
1216
+ * run can pass.
1217
+ */
1218
+ maxShare: number;
1219
+
1220
+ /**
1221
+ * Test cases your agent never spoke on, judged on each test case’s last attempt: a
1222
+ * silent simulation a retry later reached your agent on does not count here.
1223
+ */
1224
+ neverSpokeCalls: number;
1225
+
1226
+ /**
1227
+ * Every test case of the run whose last attempt reached your agent.
1228
+ */
1229
+ totalCalls: number;
1230
+
1231
+ type: 'AGENT_NEVER_SPOKE';
1232
+
1233
+ /**
1234
+ * The agent as the run tested it. Null when the simulations tested more than one
1235
+ * agent.
1236
+ */
1237
+ agentName?: string | null;
1238
+
1239
+ /**
1240
+ * Every simulation your agent never spoke on, including the ones a retry replaced.
1241
+ * Above `neverSpokeCalls` only when the plan retries silent simulations
1242
+ * (`maxNoResponseRetries`).
1243
+ */
1244
+ silentAttempts?: number;
1245
+ }
1246
+
1247
+ export interface UnionMember3 {
1044
1248
  metricDefinitionId: string;
1045
1249
 
1046
1250
  type: 'METRIC_NOT_EVALUATED';
@@ -1051,7 +1255,7 @@ export namespace SimulationRunPlanJobGetByIDResponse {
1051
1255
  metricName?: string | null;
1052
1256
  }
1053
1257
 
1054
- export interface UnionMember3 {
1258
+ export interface UnionMember4 {
1055
1259
  /**
1056
1260
  * Whether the missed minimum was the 80% default (`true`) or this metric's own.
1057
1261
  */