@roarkanalytics/sdk 2.31.0 → 2.33.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 (245) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/api-promise.d.mts +1 -0
  3. package/api-promise.d.mts.map +1 -1
  4. package/api-promise.d.ts +1 -0
  5. package/api-promise.d.ts.map +1 -1
  6. package/api-promise.mjs +1 -0
  7. package/api-promise.mjs.map +1 -1
  8. package/client.d.mts +17 -5
  9. package/client.d.mts.map +1 -1
  10. package/client.d.ts +17 -5
  11. package/client.d.ts.map +1 -1
  12. package/client.js +35 -4
  13. package/client.js.map +1 -1
  14. package/client.mjs +35 -4
  15. package/client.mjs.map +1 -1
  16. package/core/api-promise.d.mts.map +1 -1
  17. package/core/api-promise.d.ts.map +1 -1
  18. package/core/api-promise.mjs.map +1 -1
  19. package/core/error.mjs.map +1 -1
  20. package/core/resource.d.mts.map +1 -1
  21. package/core/resource.d.ts.map +1 -1
  22. package/core/uploads.d.mts.map +1 -1
  23. package/core/uploads.d.ts.map +1 -1
  24. package/core/uploads.mjs.map +1 -1
  25. package/error.d.mts +1 -0
  26. package/error.d.mts.map +1 -1
  27. package/error.d.ts +1 -0
  28. package/error.d.ts.map +1 -1
  29. package/error.mjs +1 -0
  30. package/error.mjs.map +1 -1
  31. package/index.d.mts.map +1 -1
  32. package/index.d.ts.map +1 -1
  33. package/index.mjs.map +1 -1
  34. package/internal/detect-platform.mjs.map +1 -1
  35. package/internal/headers.mjs.map +1 -1
  36. package/internal/parse.d.mts.map +1 -1
  37. package/internal/parse.d.ts.map +1 -1
  38. package/internal/parse.mjs.map +1 -1
  39. package/internal/qs/formats.d.mts.map +1 -1
  40. package/internal/qs/formats.d.ts.map +1 -1
  41. package/internal/qs/index.d.mts +2 -2
  42. package/internal/qs/index.d.mts.map +1 -1
  43. package/internal/qs/index.d.ts +2 -2
  44. package/internal/qs/index.d.ts.map +1 -1
  45. package/internal/qs/index.mjs.map +1 -1
  46. package/internal/qs/stringify.d.mts.map +1 -1
  47. package/internal/qs/stringify.d.ts.map +1 -1
  48. package/internal/qs/stringify.mjs.map +1 -1
  49. package/internal/qs/utils.d.mts.map +1 -1
  50. package/internal/qs/utils.d.ts.map +1 -1
  51. package/internal/qs/utils.mjs.map +1 -1
  52. package/internal/request-options.d.mts.map +1 -1
  53. package/internal/request-options.d.ts.map +1 -1
  54. package/internal/shims.d.mts +6 -0
  55. package/internal/shims.d.mts.map +1 -1
  56. package/internal/shims.d.ts +6 -0
  57. package/internal/shims.d.ts.map +1 -1
  58. package/internal/to-file.d.mts.map +1 -1
  59. package/internal/to-file.d.ts.map +1 -1
  60. package/internal/to-file.mjs.map +1 -1
  61. package/internal/types.d.mts +10 -10
  62. package/internal/types.d.mts.map +1 -1
  63. package/internal/types.d.ts +10 -10
  64. package/internal/types.d.ts.map +1 -1
  65. package/internal/uploads.d.mts.map +1 -1
  66. package/internal/uploads.d.ts.map +1 -1
  67. package/internal/uploads.mjs.map +1 -1
  68. package/internal/utils/base64.mjs.map +1 -1
  69. package/internal/utils/log.d.mts.map +1 -1
  70. package/internal/utils/log.d.ts.map +1 -1
  71. package/internal/utils/log.js +2 -0
  72. package/internal/utils/log.js.map +1 -1
  73. package/internal/utils/log.mjs +2 -0
  74. package/internal/utils/log.mjs.map +1 -1
  75. package/internal/utils/path.mjs.map +1 -1
  76. package/internal/utils/query.mjs.map +1 -1
  77. package/internal/utils/values.mjs.map +1 -1
  78. package/internal/utils.d.mts.map +1 -1
  79. package/internal/utils.d.ts.map +1 -1
  80. package/internal/utils.mjs.map +1 -1
  81. package/package.json +1 -1
  82. package/resource.d.mts +1 -0
  83. package/resource.d.mts.map +1 -1
  84. package/resource.d.ts +1 -0
  85. package/resource.d.ts.map +1 -1
  86. package/resource.mjs +1 -0
  87. package/resource.mjs.map +1 -1
  88. package/resources/agent-endpoint.d.mts +4 -4
  89. package/resources/agent-endpoint.d.mts.map +1 -1
  90. package/resources/agent-endpoint.d.ts +4 -4
  91. package/resources/agent-endpoint.d.ts.map +1 -1
  92. package/resources/agent-endpoint.mjs.map +1 -1
  93. package/resources/agent.d.mts.map +1 -1
  94. package/resources/agent.d.ts.map +1 -1
  95. package/resources/agent.mjs.map +1 -1
  96. package/resources/call.d.mts +303 -155
  97. package/resources/call.d.mts.map +1 -1
  98. package/resources/call.d.ts +303 -155
  99. package/resources/call.d.ts.map +1 -1
  100. package/resources/call.js +6 -7
  101. package/resources/call.js.map +1 -1
  102. package/resources/call.mjs +6 -7
  103. package/resources/call.mjs.map +1 -1
  104. package/resources/config.d.mts +535 -0
  105. package/resources/config.d.mts.map +1 -0
  106. package/resources/config.d.ts +535 -0
  107. package/resources/config.d.ts.map +1 -0
  108. package/resources/config.js +28 -0
  109. package/resources/config.js.map +1 -0
  110. package/resources/config.mjs +24 -0
  111. package/resources/config.mjs.map +1 -0
  112. package/resources/customer-flow-edge-case.d.mts +1742 -0
  113. package/resources/customer-flow-edge-case.d.mts.map +1 -0
  114. package/resources/customer-flow-edge-case.d.ts +1742 -0
  115. package/resources/customer-flow-edge-case.d.ts.map +1 -0
  116. package/resources/customer-flow-edge-case.js +50 -0
  117. package/resources/customer-flow-edge-case.js.map +1 -0
  118. package/resources/customer-flow-edge-case.mjs +46 -0
  119. package/resources/customer-flow-edge-case.mjs.map +1 -0
  120. package/resources/customer-flow.d.mts +7163 -0
  121. package/resources/customer-flow.d.mts.map +1 -0
  122. package/resources/customer-flow.d.ts +7163 -0
  123. package/resources/customer-flow.d.ts.map +1 -0
  124. package/resources/customer-flow.js +87 -0
  125. package/resources/customer-flow.js.map +1 -0
  126. package/resources/customer-flow.mjs +83 -0
  127. package/resources/customer-flow.mjs.map +1 -0
  128. package/resources/health.d.mts.map +1 -1
  129. package/resources/health.d.ts.map +1 -1
  130. package/resources/health.mjs.map +1 -1
  131. package/resources/http-request-definition.d.mts.map +1 -1
  132. package/resources/http-request-definition.d.ts.map +1 -1
  133. package/resources/http-request-definition.mjs.map +1 -1
  134. package/resources/index.d.mts +6 -2
  135. package/resources/index.d.mts.map +1 -1
  136. package/resources/index.d.ts +6 -2
  137. package/resources/index.d.ts.map +1 -1
  138. package/resources/index.js +11 -3
  139. package/resources/index.js.map +1 -1
  140. package/resources/index.mjs +5 -1
  141. package/resources/index.mjs.map +1 -1
  142. package/resources/metric-collection-job.d.mts +5 -3
  143. package/resources/metric-collection-job.d.mts.map +1 -1
  144. package/resources/metric-collection-job.d.ts +5 -3
  145. package/resources/metric-collection-job.d.ts.map +1 -1
  146. package/resources/metric-collection-job.mjs.map +1 -1
  147. package/resources/metric-policy.d.mts.map +1 -1
  148. package/resources/metric-policy.d.ts.map +1 -1
  149. package/resources/metric-policy.mjs.map +1 -1
  150. package/resources/metric.d.mts +804 -109
  151. package/resources/metric.d.mts.map +1 -1
  152. package/resources/metric.d.ts +804 -109
  153. package/resources/metric.d.ts.map +1 -1
  154. package/resources/metric.js +6 -7
  155. package/resources/metric.js.map +1 -1
  156. package/resources/metric.mjs +6 -7
  157. package/resources/metric.mjs.map +1 -1
  158. package/resources/simulation-environment.d.mts +95 -0
  159. package/resources/simulation-environment.d.mts.map +1 -0
  160. package/resources/simulation-environment.d.ts +95 -0
  161. package/resources/simulation-environment.d.ts.map +1 -0
  162. package/resources/simulation-environment.js +24 -0
  163. package/resources/simulation-environment.js.map +1 -0
  164. package/resources/simulation-environment.mjs +20 -0
  165. package/resources/simulation-environment.mjs.map +1 -0
  166. package/resources/simulation-job.d.mts +58 -10
  167. package/resources/simulation-job.d.mts.map +1 -1
  168. package/resources/simulation-job.d.ts +58 -10
  169. package/resources/simulation-job.d.ts.map +1 -1
  170. package/resources/simulation-job.mjs.map +1 -1
  171. package/resources/simulation-persona.d.mts +60 -24
  172. package/resources/simulation-persona.d.mts.map +1 -1
  173. package/resources/simulation-persona.d.ts +60 -24
  174. package/resources/simulation-persona.d.ts.map +1 -1
  175. package/resources/simulation-persona.mjs.map +1 -1
  176. package/resources/simulation-run-plan-job.d.mts +73 -32
  177. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  178. package/resources/simulation-run-plan-job.d.ts +73 -32
  179. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  180. package/resources/simulation-run-plan-job.js +7 -8
  181. package/resources/simulation-run-plan-job.js.map +1 -1
  182. package/resources/simulation-run-plan-job.mjs +7 -8
  183. package/resources/simulation-run-plan-job.mjs.map +1 -1
  184. package/resources/simulation-run-plan.d.mts +408 -39
  185. package/resources/simulation-run-plan.d.mts.map +1 -1
  186. package/resources/simulation-run-plan.d.ts +408 -39
  187. package/resources/simulation-run-plan.d.ts.map +1 -1
  188. package/resources/simulation-run-plan.js +6 -11
  189. package/resources/simulation-run-plan.js.map +1 -1
  190. package/resources/simulation-run-plan.mjs +6 -11
  191. package/resources/simulation-run-plan.mjs.map +1 -1
  192. package/resources/simulation.d.mts +379 -0
  193. package/resources/simulation.d.mts.map +1 -0
  194. package/resources/simulation.d.ts +379 -0
  195. package/resources/simulation.d.ts.map +1 -0
  196. package/resources/simulation.js +33 -0
  197. package/resources/simulation.js.map +1 -0
  198. package/resources/simulation.mjs +29 -0
  199. package/resources/simulation.mjs.map +1 -0
  200. package/resources/webhook.d.mts +4 -4
  201. package/resources/webhook.d.mts.map +1 -1
  202. package/resources/webhook.d.ts +4 -4
  203. package/resources/webhook.d.ts.map +1 -1
  204. package/resources/webhook.mjs.map +1 -1
  205. package/resources.d.mts.map +1 -1
  206. package/resources.d.ts.map +1 -1
  207. package/resources.mjs.map +1 -1
  208. package/src/client.ts +124 -28
  209. package/src/internal/types.ts +6 -8
  210. package/src/internal/utils/log.ts +2 -0
  211. package/src/resources/agent-endpoint.ts +36 -4
  212. package/src/resources/call.ts +326 -169
  213. package/src/resources/config.ts +1162 -0
  214. package/src/resources/customer-flow-edge-case.ts +2884 -0
  215. package/src/resources/customer-flow.ts +11713 -0
  216. package/src/resources/index.ts +42 -12
  217. package/src/resources/metric-collection-job.ts +5 -3
  218. package/src/resources/metric.ts +1057 -115
  219. package/src/resources/simulation-environment.ts +147 -0
  220. package/src/resources/simulation-job.ts +122 -10
  221. package/src/resources/simulation-persona.ts +192 -24
  222. package/src/resources/simulation-run-plan-job.ts +109 -27
  223. package/src/resources/simulation-run-plan.ts +445 -40
  224. package/src/resources/simulation.ts +444 -0
  225. package/src/resources/webhook.ts +8 -0
  226. package/src/version.ts +1 -1
  227. package/uploads.d.mts +1 -0
  228. package/uploads.d.mts.map +1 -1
  229. package/uploads.d.ts +1 -0
  230. package/uploads.d.ts.map +1 -1
  231. package/uploads.mjs +1 -0
  232. package/uploads.mjs.map +1 -1
  233. package/version.d.mts +1 -1
  234. package/version.d.ts +1 -1
  235. package/version.js +1 -1
  236. package/version.mjs +1 -1
  237. package/resources/simulation-scenario.d.mts +0 -424
  238. package/resources/simulation-scenario.d.mts.map +0 -1
  239. package/resources/simulation-scenario.d.ts +0 -424
  240. package/resources/simulation-scenario.d.ts.map +0 -1
  241. package/resources/simulation-scenario.js +0 -40
  242. package/resources/simulation-scenario.js.map +0 -1
  243. package/resources/simulation-scenario.mjs +0 -36
  244. package/resources/simulation-scenario.mjs.map +0 -1
  245. package/src/resources/simulation-scenario.ts +0 -602
@@ -42,16 +42,14 @@ export class Call extends APIResource {
42
42
  return this._client.get(path`/v1/call/${callID}/transcript`, { query, ...options });
43
43
  }
44
44
 
45
- /**
46
- * Fetch all evaluation run results for a specific call.
47
- */
48
- listEvaluationRuns(callID: string, options?: RequestOptions): APIPromise<CallListEvaluationRunsResponse> {
49
- return this._client.get(path`/v1/call/${callID}/evaluation-run`, options);
50
- }
51
-
52
45
  /**
53
46
  * Fetch all call-level metrics for a specific call, including both
54
- * system-generated and custom metrics. Only returns successfully computed metrics.
47
+ * system-generated and custom metrics. Only returns rows from the **latest**
48
+ * metric-collection job per metric — if the same metric has been recomputed, prior
49
+ * runs are excluded and remain in the metric history. By default returns only
50
+ * successfully computed metrics; pass `?status=all` to also include rows that
51
+ * resolved as NOT_APPLICABLE / DATA_MISSING / ERROR (the `value` field is omitted
52
+ * on those entries — check `captureStatus`).
55
53
  */
56
54
  listMetrics(
57
55
  callID: string,
@@ -98,6 +96,8 @@ export namespace CallCreateResponse {
98
96
 
99
97
  customers: Array<Data.Customer> | null;
100
98
 
99
+ externalId: string | null;
100
+
101
101
  /**
102
102
  * ID of the project this call belongs to
103
103
  */
@@ -162,6 +162,14 @@ export namespace CallListResponse {
162
162
  */
163
163
  projectId: string;
164
164
 
165
+ /**
166
+ * Indicates the status of `recordingUrl`. `AVAILABLE`: signed URL returned.
167
+ * `NOT_AVAILABLE`: no recording on file yet (e.g. still processing). `RESTRICTED`:
168
+ * the calling API key does not have the `recording:read` permission and the URL
169
+ * has been withheld.
170
+ */
171
+ recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED';
172
+
165
173
  /**
166
174
  * Timestamp when the call started
167
175
  */
@@ -217,6 +225,12 @@ export namespace CallListResponse {
217
225
  | 'UNKNOWN'
218
226
  | null;
219
227
 
228
+ /**
229
+ * Caller-supplied correlation ID echoed back from the create request, if any was
230
+ * provided
231
+ */
232
+ externalId?: string | null;
233
+
220
234
  /**
221
235
  * IDs of metric policies that have been applied to this call
222
236
  */
@@ -332,6 +346,14 @@ export namespace CallGetByIDResponse {
332
346
  */
333
347
  projectId: string;
334
348
 
349
+ /**
350
+ * Indicates the status of `recordingUrl`. `AVAILABLE`: signed URL returned.
351
+ * `NOT_AVAILABLE`: no recording on file yet (e.g. still processing). `RESTRICTED`:
352
+ * the calling API key does not have the `recording:read` permission and the URL
353
+ * has been withheld.
354
+ */
355
+ recordingUrlAccess: 'AVAILABLE' | 'NOT_AVAILABLE' | 'RESTRICTED';
356
+
335
357
  /**
336
358
  * Timestamp when the call started
337
359
  */
@@ -387,6 +409,12 @@ export namespace CallGetByIDResponse {
387
409
  | 'UNKNOWN'
388
410
  | null;
389
411
 
412
+ /**
413
+ * Caller-supplied correlation ID echoed back from the create request, if any was
414
+ * provided
415
+ */
416
+ externalId?: string | null;
417
+
390
418
  /**
391
419
  * IDs of metric policies that have been applied to this call
392
420
  */
@@ -584,260 +612,242 @@ export namespace CallGetTranscriptResponse {
584
612
  }
585
613
  }
586
614
 
587
- export interface CallListEvaluationRunsResponse {
615
+ export interface CallListMetricsResponse {
588
616
  /**
589
- * Evaluation run response payload
617
+ * Conversation metrics response payload grouped by metric definition
590
618
  */
591
- data: Array<CallListEvaluationRunsResponse.Data>;
619
+ data: Array<CallListMetricsResponse.Data>;
592
620
  }
593
621
 
594
- export namespace CallListEvaluationRunsResponse {
622
+ export namespace CallListMetricsResponse {
623
+ /**
624
+ * Metric data grouped by metric definition
625
+ */
595
626
  export interface Data {
596
627
  /**
597
- * All block runs for this evaluator, including skipped ones
628
+ * Description of what the metric measures
598
629
  */
599
- blockRuns: Array<Data.BlockRun>;
600
-
601
- evaluator: Data.Evaluator;
602
-
603
- evidence: Array<Data.Evidence>;
630
+ description: string;
604
631
 
605
- metrics: Array<Data.Metric>;
632
+ /**
633
+ * Unique identifier for the metric definition
634
+ */
635
+ metricDefinitionId: string;
606
636
 
607
637
  /**
608
- * Status of the evaluator run
638
+ * Alias of `slug` retained for backwards compatibility. Same value as `slug`.
609
639
  */
610
- status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
640
+ metricId: string;
611
641
 
612
642
  /**
613
- * ID of the evaluator run
643
+ * Name of the metric
614
644
  */
615
- id?: string;
645
+ name: string;
616
646
 
617
647
  /**
618
- * When the evaluator run completed
648
+ * Whether metric is global or per-participant
619
649
  */
620
- completedAt?: string | null;
650
+ scope: 'GLOBAL' | 'PER_PARTICIPANT';
621
651
 
622
652
  /**
623
- * Result of the evaluator run based on score threshold (IRRELEVANT is mapped to
624
- * SKIPPED)
653
+ * Stable metric slug
625
654
  */
626
- result?: 'SUCCESS' | 'FAILURE' | 'SKIPPED' | null;
655
+ slug: string;
627
656
 
628
657
  /**
629
- * Score of the evaluation run (0-1)
658
+ * Type of value this metric produces
630
659
  */
631
- score?: number | null;
660
+ type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET';
632
661
 
633
662
  /**
634
- * When the evaluator run started
663
+ * Array of metric values (multiple for PER_PARTICIPANT metrics, or multiple
664
+ * segments/turns)
635
665
  */
636
- startedAt?: string | null;
666
+ values: Array<Data.StandardMetricValue | Data.PropertyVerificationMetricValue>;
637
667
 
638
668
  /**
639
- * Summary of the evaluation run
669
+ * Unit information if applicable
640
670
  */
641
- summary?: string | null;
671
+ unit?: Data.Unit;
642
672
  }
643
673
 
644
674
  export namespace Data {
645
- export interface BlockRun {
646
- /**
647
- * ID of the block definition
648
- */
649
- blockDefinitionId: string;
650
-
675
+ /**
676
+ * A metric value entry. Applies to every metric.
677
+ */
678
+ export interface StandardMetricValue {
651
679
  /**
652
- * Name of the evaluation block
680
+ * Result state of this metric computation. SUCCESS carries a real `value`;
681
+ * NOT_APPLICABLE / DATA_MISSING / ERROR do not (the `value` field is omitted).
682
+ * Non-SUCCESS rows only appear when the request includes ?status=all.
653
683
  */
654
- blockName: string;
684
+ captureStatus: 'SUCCESS' | 'NOT_APPLICABLE' | 'DATA_MISSING' | 'ERROR';
655
685
 
656
686
  /**
657
- * ID of the block run instance
687
+ * ISO 8601 timestamp when the metric was computed
658
688
  */
659
- blockRunId: string;
689
+ computedAt: string;
660
690
 
661
691
  /**
662
- * When the block run was created
692
+ * Context level: CALL (entire conversation), SEGMENT (single segment),
693
+ * SEGMENT_RANGE (between/across segments)
663
694
  */
664
- createdAt: string;
695
+ context: 'CALL' | 'SEGMENT' | 'SEGMENT_RANGE';
665
696
 
666
697
  /**
667
- * Reason for the outcome (pass/fail explanation or skip reason)
698
+ * ID of the call this value was computed on. Only set when the response spans
699
+ * multiple conversations (e.g. job-scoped metric values).
668
700
  */
669
- reason: string | null;
701
+ callId?: string;
670
702
 
671
703
  /**
672
- * Result of the block run
704
+ * ID of the chat this value was computed on. Only set when the response spans
705
+ * multiple conversations (e.g. job-scoped metric values).
673
706
  */
674
- result: 'PASSED' | 'FAILED' | 'SKIPPED' | null;
707
+ chatId?: string;
675
708
 
676
709
  /**
677
- * Score of the block run (0-1)
710
+ * Confidence score (0-1) for the computed value. Defaults to 1.0 for deterministic
711
+ * metrics. Omitted on non-SUCCESS rows.
678
712
  */
679
- score: number | null;
713
+ confidence?: number;
680
714
 
681
715
  /**
682
- * Status of the block run
716
+ * Error detail when captureStatus is ERROR — e.g. provider down, LLM timeout.
717
+ * Undefined for other statuses.
683
718
  */
684
- status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED';
685
- }
719
+ errorMessage?: string;
686
720
 
687
- export interface Evaluator {
688
721
  /**
689
- * ID of the evaluator
722
+ * Starting segment information (for SEGMENT_RANGE context metrics)
690
723
  */
691
- id: string;
724
+ fromSegment?: StandardMetricValue.FromSegment;
692
725
 
693
726
  /**
694
- * Name of the evaluator
727
+ * Role of participant (only for PER_PARTICIPANT metrics)
695
728
  */
696
- name: string;
729
+ participantRole?: 'agent' | 'customer';
697
730
 
698
731
  /**
699
- * Weight of the evaluator
732
+ * IDs of metric policies that triggered this metric computation
700
733
  */
701
- weight?: number;
702
- }
734
+ policyIds?: Array<string>;
703
735
 
704
- export interface Evidence {
705
736
  /**
706
- * Comment text of the evidence
737
+ * Segment information (for SEGMENT context metrics)
707
738
  */
708
- commentText: string | null;
739
+ segment?: StandardMetricValue.Segment;
709
740
 
710
741
  /**
711
- * Created at of the evidence
742
+ * Ending segment information (for SEGMENT_RANGE context metrics)
712
743
  */
713
- createdAt: string;
744
+ toSegment?: StandardMetricValue.ToSegment;
714
745
 
715
746
  /**
716
- * Is positive of the evidence
747
+ * The metric value (type depends on outputType). Present only on SUCCESS rows;
748
+ * omitted for NOT_APPLICABLE / DATA_MISSING / ERROR.
717
749
  */
718
- isPositive: boolean;
750
+ value?: number | boolean | string;
719
751
 
720
752
  /**
721
- * Snippet text of the evidence
753
+ * Explanation for the metric value (especially useful for AI-computed metrics)
722
754
  */
723
- snippetText: string;
755
+ valueReasoning?: string;
724
756
  }
725
757
 
726
- export interface Metric {
758
+ export namespace StandardMetricValue {
727
759
  /**
728
- * Boolean value of the metric
760
+ * Starting segment information (for SEGMENT_RANGE context metrics)
729
761
  */
730
- booleanValue: boolean | null;
762
+ export interface FromSegment {
763
+ /**
764
+ * Segment ID
765
+ */
766
+ id: string;
731
767
 
732
- /**
733
- * Confidence level of the metric (0-1)
734
- */
735
- confidence: number | null;
768
+ /**
769
+ * End time offset in milliseconds
770
+ */
771
+ endOffsetMs: number;
736
772
 
737
- /**
738
- * Created at of the metric
739
- */
740
- createdAt: string;
773
+ /**
774
+ * Start time offset in milliseconds
775
+ */
776
+ startOffsetMs: number;
741
777
 
742
- /**
743
- * Name of the metric
744
- */
745
- name: string;
778
+ /**
779
+ * Segment text content
780
+ */
781
+ text: string;
782
+ }
746
783
 
747
784
  /**
748
- * Numeric value of the metric
785
+ * Segment information (for SEGMENT context metrics)
749
786
  */
750
- numericValue: number | null;
787
+ export interface Segment {
788
+ /**
789
+ * Segment ID
790
+ */
791
+ id: string;
751
792
 
752
- /**
753
- * Reasoning of the metric
754
- */
755
- reasoning: string | null;
793
+ /**
794
+ * End time offset in milliseconds
795
+ */
796
+ endOffsetMs: number;
756
797
 
757
- /**
758
- * Role of the metric
759
- */
760
- role: string;
798
+ /**
799
+ * Start time offset in milliseconds
800
+ */
801
+ startOffsetMs: number;
761
802
 
762
- /**
763
- * Text value of the metric
764
- */
765
- textValue: string | null;
803
+ /**
804
+ * Segment text content
805
+ */
806
+ text: string;
807
+ }
766
808
 
767
809
  /**
768
- * Value type of the metric
810
+ * Ending segment information (for SEGMENT_RANGE context metrics)
769
811
  */
770
- valueType: string;
771
- }
772
- }
773
- }
774
-
775
- export interface CallListMetricsResponse {
776
- /**
777
- * Conversation metrics response payload grouped by metric definition
778
- */
779
- data: Array<CallListMetricsResponse.Data>;
780
- }
781
-
782
- export namespace CallListMetricsResponse {
783
- /**
784
- * Metric data grouped by metric definition
785
- */
786
- export interface Data {
787
- /**
788
- * Description of what the metric measures
789
- */
790
- description: string;
791
-
792
- /**
793
- * Unique identifier for the metric definition
794
- */
795
- metricDefinitionId: string;
796
-
797
- /**
798
- * Stable metric identifier
799
- */
800
- metricId: string;
801
-
802
- /**
803
- * Name of the metric
804
- */
805
- name: string;
812
+ export interface ToSegment {
813
+ /**
814
+ * Segment ID
815
+ */
816
+ id: string;
806
817
 
807
- /**
808
- * Whether metric is global or per-participant
809
- */
810
- scope: 'GLOBAL' | 'PER_PARTICIPANT';
818
+ /**
819
+ * End time offset in milliseconds
820
+ */
821
+ endOffsetMs: number;
811
822
 
812
- /**
813
- * Type of value this metric produces
814
- */
815
- type: 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET';
823
+ /**
824
+ * Start time offset in milliseconds
825
+ */
826
+ startOffsetMs: number;
816
827
 
817
- /**
818
- * Array of metric values (multiple for PER_PARTICIPANT metrics, or multiple
819
- * segments/turns)
820
- */
821
- values: Array<Data.Value>;
828
+ /**
829
+ * Segment text content
830
+ */
831
+ text: string;
832
+ }
833
+ }
822
834
 
823
835
  /**
824
- * Unit information if applicable
836
+ * Returned for the Property Mismatch metric (`property_transcript_mismatch`): the
837
+ * standard entry plus the per-property verdict breakdown.
825
838
  */
826
- unit?: Data.Unit;
827
- }
828
-
829
- export namespace Data {
830
- export interface Value {
839
+ export interface PropertyVerificationMetricValue {
831
840
  /**
832
- * ISO 8601 timestamp when the metric was computed
841
+ * Result state of this metric computation. SUCCESS carries a real `value`;
842
+ * NOT_APPLICABLE / DATA_MISSING / ERROR do not (the `value` field is omitted).
843
+ * Non-SUCCESS rows only appear when the request includes ?status=all.
833
844
  */
834
- computedAt: string;
845
+ captureStatus: 'SUCCESS' | 'NOT_APPLICABLE' | 'DATA_MISSING' | 'ERROR';
835
846
 
836
847
  /**
837
- * Confidence score (0-1) for the computed value. Defaults to 1.0 for deterministic
838
- * metrics.
848
+ * ISO 8601 timestamp when the metric was computed
839
849
  */
840
- confidence: number;
850
+ computedAt: string;
841
851
 
842
852
  /**
843
853
  * Context level: CALL (entire conversation), SEGMENT (single segment),
@@ -846,14 +856,33 @@ export namespace CallListMetricsResponse {
846
856
  context: 'CALL' | 'SEGMENT' | 'SEGMENT_RANGE';
847
857
 
848
858
  /**
849
- * The metric value (type depends on outputType)
859
+ * ID of the call this value was computed on. Only set when the response spans
860
+ * multiple conversations (e.g. job-scoped metric values).
850
861
  */
851
- value: number | boolean | string;
862
+ callId?: string;
863
+
864
+ /**
865
+ * ID of the chat this value was computed on. Only set when the response spans
866
+ * multiple conversations (e.g. job-scoped metric values).
867
+ */
868
+ chatId?: string;
869
+
870
+ /**
871
+ * Confidence score (0-1) for the computed value. Defaults to 1.0 for deterministic
872
+ * metrics. Omitted on non-SUCCESS rows.
873
+ */
874
+ confidence?: number;
875
+
876
+ /**
877
+ * Error detail when captureStatus is ERROR — e.g. provider down, LLM timeout.
878
+ * Undefined for other statuses.
879
+ */
880
+ errorMessage?: string;
852
881
 
853
882
  /**
854
883
  * Starting segment information (for SEGMENT_RANGE context metrics)
855
884
  */
856
- fromSegment?: Value.FromSegment;
885
+ fromSegment?: PropertyVerificationMetricValue.FromSegment;
857
886
 
858
887
  /**
859
888
  * Role of participant (only for PER_PARTICIPANT metrics)
@@ -865,15 +894,27 @@ export namespace CallListMetricsResponse {
865
894
  */
866
895
  policyIds?: Array<string>;
867
896
 
897
+ /**
898
+ * Per-property verdicts for the Property Mismatch metric, in the order the
899
+ * properties were checked. Omitted for every other metric.
900
+ */
901
+ propertyVerdicts?: Array<PropertyVerificationMetricValue.PropertyVerdict>;
902
+
868
903
  /**
869
904
  * Segment information (for SEGMENT context metrics)
870
905
  */
871
- segment?: Value.Segment;
906
+ segment?: PropertyVerificationMetricValue.Segment;
872
907
 
873
908
  /**
874
909
  * Ending segment information (for SEGMENT_RANGE context metrics)
875
910
  */
876
- toSegment?: Value.ToSegment;
911
+ toSegment?: PropertyVerificationMetricValue.ToSegment;
912
+
913
+ /**
914
+ * The metric value (type depends on outputType). Present only on SUCCESS rows;
915
+ * omitted for NOT_APPLICABLE / DATA_MISSING / ERROR.
916
+ */
917
+ value?: number | boolean | string;
877
918
 
878
919
  /**
879
920
  * Explanation for the metric value (especially useful for AI-computed metrics)
@@ -881,7 +922,7 @@ export namespace CallListMetricsResponse {
881
922
  valueReasoning?: string;
882
923
  }
883
924
 
884
- export namespace Value {
925
+ export namespace PropertyVerificationMetricValue {
885
926
  /**
886
927
  * Starting segment information (for SEGMENT_RANGE context metrics)
887
928
  */
@@ -907,6 +948,70 @@ export namespace CallListMetricsResponse {
907
948
  text: string;
908
949
  }
909
950
 
951
+ export interface PropertyVerdict {
952
+ /**
953
+ * The value supplied at ingest, frozen at scoring time
954
+ */
955
+ expectedValue: string;
956
+
957
+ /**
958
+ * The call property checked, as sent at ingest
959
+ */
960
+ propertyName: string;
961
+
962
+ /**
963
+ * How this property resolved against the transcript. NOT_MENTIONED means the
964
+ * subject never came up and is not a mismatch.
965
+ */
966
+ verdict: 'MATCH' | 'MISMATCH' | 'NOT_MENTIONED';
967
+
968
+ /**
969
+ * What the transcript said instead. Only present when verdict is MISMATCH.
970
+ */
971
+ observedValue?: string;
972
+
973
+ /**
974
+ * Judge reasoning for this verdict
975
+ */
976
+ reasoning?: string;
977
+
978
+ /**
979
+ * The transcript segment this property was referred to in: the conflicting value
980
+ * for MISMATCH, the confirming reference for MATCH. Omitted for NOT_MENTIONED and
981
+ * when the verdict could not be anchored.
982
+ */
983
+ segment?: PropertyVerdict.Segment;
984
+ }
985
+
986
+ export namespace PropertyVerdict {
987
+ /**
988
+ * The transcript segment this property was referred to in: the conflicting value
989
+ * for MISMATCH, the confirming reference for MATCH. Omitted for NOT_MENTIONED and
990
+ * when the verdict could not be anchored.
991
+ */
992
+ export interface Segment {
993
+ /**
994
+ * Segment ID
995
+ */
996
+ id: string;
997
+
998
+ /**
999
+ * End time offset in milliseconds
1000
+ */
1001
+ endOffsetMs: number;
1002
+
1003
+ /**
1004
+ * Start time offset in milliseconds
1005
+ */
1006
+ startOffsetMs: number;
1007
+
1008
+ /**
1009
+ * Segment text content
1010
+ */
1011
+ text: string;
1012
+ }
1013
+ }
1014
+
910
1015
  /**
911
1016
  * Segment information (for SEGMENT context metrics)
912
1017
  */
@@ -1085,6 +1190,20 @@ export interface CallCreateParams {
1085
1190
  | 'MAX_DURATION_REACHED'
1086
1191
  | 'UNKNOWN';
1087
1192
 
1193
+ /**
1194
+ * A stable identifier from your own system (e.g. session ID, conversation ID) used
1195
+ * to correlate this call with OpenTelemetry traces. Set the same value as a
1196
+ * `roark.external_id` span or resource attribute on your traces and the matching
1197
+ * trace will be linked automatically. Must be unique within a project.
1198
+ */
1199
+ externalId?: string;
1200
+
1201
+ /**
1202
+ * The LiveKit Cloud room ID to link this call with OpenTelemetry trace data from
1203
+ * LiveKit. Used for matching calls with OTEL traces.
1204
+ */
1205
+ livekitRoomId?: string;
1206
+
1088
1207
  /**
1089
1208
  * Custom properties to include with the call. These can be used for filtering and
1090
1209
  * will show in the call details page
@@ -1106,6 +1225,12 @@ export interface CallCreateParams {
1106
1225
  * List of transcript entries made during the call
1107
1226
  */
1108
1227
  transcript?: Array<CallCreateParams.TranscriptEntryAgent | CallCreateParams.TranscriptEntryCustomer>;
1228
+
1229
+ /**
1230
+ * The Vapi call ID (UUID) to link this call with OpenTelemetry trace data from
1231
+ * Vapi. Used for matching calls with OTEL traces.
1232
+ */
1233
+ vapiCallId?: string;
1109
1234
  }
1110
1235
 
1111
1236
  export namespace CallCreateParams {
@@ -1567,8 +1692,14 @@ export namespace CallCreateParams {
1567
1692
  * the agents array this tool invocation belongs to
1568
1693
  */
1569
1694
  export interface Agent {
1695
+ /**
1696
+ * The custom ID set on the agent
1697
+ */
1570
1698
  customId?: string;
1571
1699
 
1700
+ /**
1701
+ * The Roark ID of the agent
1702
+ */
1572
1703
  roarkId?: string;
1573
1704
  }
1574
1705
  }
@@ -1582,15 +1713,31 @@ export namespace CallCreateParams {
1582
1713
 
1583
1714
  text: string;
1584
1715
 
1716
+ /**
1717
+ * Metadata about the agent that spoke this turn - used to match which agent from
1718
+ * the `agents` array this transcript entry belongs to
1719
+ */
1585
1720
  agent?: TranscriptEntryAgent.Agent;
1586
1721
 
1587
1722
  languageCode?: string;
1723
+
1724
+ payload?: { [key: string]: unknown } | null;
1588
1725
  }
1589
1726
 
1590
1727
  export namespace TranscriptEntryAgent {
1728
+ /**
1729
+ * Metadata about the agent that spoke this turn - used to match which agent from
1730
+ * the `agents` array this transcript entry belongs to
1731
+ */
1591
1732
  export interface Agent {
1733
+ /**
1734
+ * The custom ID set on the agent
1735
+ */
1592
1736
  customId?: string;
1593
1737
 
1738
+ /**
1739
+ * The Roark ID of the agent
1740
+ */
1594
1741
  roarkId?: string;
1595
1742
  }
1596
1743
  }
@@ -1611,6 +1758,8 @@ export namespace CallCreateParams {
1611
1758
  customer?: TranscriptEntryCustomer.Customer;
1612
1759
 
1613
1760
  languageCode?: string;
1761
+
1762
+ payload?: { [key: string]: unknown } | null;
1614
1763
  }
1615
1764
 
1616
1765
  export namespace TranscriptEntryCustomer {
@@ -1686,6 +1835,15 @@ export interface CallListMetricsParams {
1686
1835
  * false)
1687
1836
  */
1688
1837
  flatten?: string;
1838
+
1839
+ /**
1840
+ * Filter metrics by capture status. `success` (default) returns only successfully
1841
+ * computed metrics — backwards-compatible with the historical behavior. `all` also
1842
+ * returns NOT_APPLICABLE / DATA_MISSING / ERROR rows (with `value` omitted), so
1843
+ * clients can distinguish "still computing" from "computed but no value" and exit
1844
+ * retry loops correctly.
1845
+ */
1846
+ status?: 'success' | 'all';
1689
1847
  }
1690
1848
 
1691
1849
  export declare namespace Call {
@@ -1694,7 +1852,6 @@ export declare namespace Call {
1694
1852
  type CallListResponse as CallListResponse,
1695
1853
  type CallGetByIDResponse as CallGetByIDResponse,
1696
1854
  type CallGetTranscriptResponse as CallGetTranscriptResponse,
1697
- type CallListEvaluationRunsResponse as CallListEvaluationRunsResponse,
1698
1855
  type CallListMetricsResponse as CallListMetricsResponse,
1699
1856
  type CallListSentimentRunsResponse as CallListSentimentRunsResponse,
1700
1857
  type CallCreateParams as CallCreateParams,