@roarkanalytics/sdk 2.13.1 → 2.15.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 (54) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +1 -1
  3. package/README.md +11 -9
  4. package/index.d.mts +10 -10
  5. package/index.d.ts +10 -10
  6. package/index.d.ts.map +1 -1
  7. package/index.js.map +1 -1
  8. package/index.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/call.d.ts +741 -16
  11. package/resources/call.d.ts.map +1 -1
  12. package/resources/call.js +16 -4
  13. package/resources/call.js.map +1 -1
  14. package/resources/call.mjs +16 -4
  15. package/resources/call.mjs.map +1 -1
  16. package/resources/evaluation.d.ts +85 -81
  17. package/resources/evaluation.d.ts.map +1 -1
  18. package/resources/evaluation.js +8 -8
  19. package/resources/evaluation.js.map +1 -1
  20. package/resources/evaluation.mjs +8 -8
  21. package/resources/evaluation.mjs.map +1 -1
  22. package/resources/index.d.ts +5 -5
  23. package/resources/index.d.ts.map +1 -1
  24. package/resources/index.js.map +1 -1
  25. package/resources/index.mjs.map +1 -1
  26. package/resources/metric.d.ts +5 -5
  27. package/resources/metric.d.ts.map +1 -1
  28. package/resources/metric.js +1 -1
  29. package/resources/metric.js.map +1 -1
  30. package/resources/metric.mjs +1 -1
  31. package/resources/metric.mjs.map +1 -1
  32. package/resources/persona.d.ts +21 -21
  33. package/resources/persona.d.ts.map +1 -1
  34. package/resources/persona.js +2 -2
  35. package/resources/persona.js.map +1 -1
  36. package/resources/persona.mjs +2 -2
  37. package/resources/persona.mjs.map +1 -1
  38. package/resources/simulation.d.ts +273 -28
  39. package/resources/simulation.d.ts.map +1 -1
  40. package/resources/simulation.js +37 -8
  41. package/resources/simulation.js.map +1 -1
  42. package/resources/simulation.mjs +37 -8
  43. package/resources/simulation.mjs.map +1 -1
  44. package/src/index.ts +40 -28
  45. package/src/resources/call.ts +964 -27
  46. package/src/resources/evaluation.ts +113 -108
  47. package/src/resources/index.ts +20 -14
  48. package/src/resources/metric.ts +5 -5
  49. package/src/resources/persona.ts +110 -29
  50. package/src/resources/simulation.ts +390 -34
  51. package/src/version.ts +1 -1
  52. package/version.d.ts +1 -1
  53. package/version.js +1 -1
  54. package/version.mjs +1 -1
@@ -1,6 +1,15 @@
1
1
  import { APIResource } from "../resource.js";
2
2
  import * as Core from "../core.js";
3
3
  export declare class Call extends APIResource {
4
+ /**
5
+ * Create a new call with recording, transcript, agents, and customers
6
+ */
7
+ create(body: CallCreateParams, options?: Core.RequestOptions): Core.APIPromise<CallCreateResponse>;
8
+ /**
9
+ * Returns a paginated list of calls for the authenticated project.
10
+ */
11
+ list(query?: CallListParams, options?: Core.RequestOptions): Core.APIPromise<CallListResponse>;
12
+ list(options?: Core.RequestOptions): Core.APIPromise<CallListResponse>;
4
13
  /**
5
14
  * Retrieve an existing call by its unique identifier
6
15
  */
@@ -8,18 +17,184 @@ export declare class Call extends APIResource {
8
17
  /**
9
18
  * Fetch all evaluation run results for a specific call.
10
19
  */
11
- getEvaluationRuns(callId: string, options?: Core.RequestOptions): Core.APIPromise<CallGetEvaluationRunsResponse>;
20
+ listEvaluationRuns(callId: string, options?: Core.RequestOptions): Core.APIPromise<CallListEvaluationRunsResponse>;
12
21
  /**
13
22
  * Fetch all call-level metrics for a specific call, including both
14
23
  * system-generated and custom metrics. Only returns successfully computed metrics.
15
24
  */
16
- getMetrics(callId: string, query?: CallGetMetricsParams, options?: Core.RequestOptions): Core.APIPromise<CallGetMetricsResponse>;
17
- getMetrics(callId: string, options?: Core.RequestOptions): Core.APIPromise<CallGetMetricsResponse>;
25
+ listMetrics(callId: string, query?: CallListMetricsParams, options?: Core.RequestOptions): Core.APIPromise<CallListMetricsResponse>;
26
+ listMetrics(callId: string, options?: Core.RequestOptions): Core.APIPromise<CallListMetricsResponse>;
18
27
  /**
19
28
  * Fetch detailed sentiment analysis results for a specific call, including
20
29
  * emotional tone, key phrases, and sentiment scores.
21
30
  */
22
- getSentimentRuns(callId: string, options?: Core.RequestOptions): Core.APIPromise<CallGetSentimentRunsResponse>;
31
+ listSentimentRuns(callId: string, options?: Core.RequestOptions): Core.APIPromise<CallListSentimentRunsResponse>;
32
+ }
33
+ export interface CallCreateResponse {
34
+ /**
35
+ * Response after creating a call
36
+ */
37
+ data: CallCreateResponse.Data;
38
+ }
39
+ export declare namespace CallCreateResponse {
40
+ /**
41
+ * Response after creating a call
42
+ */
43
+ interface Data {
44
+ /**
45
+ * Unique identifier for the call
46
+ */
47
+ id: string;
48
+ agents: Array<Data.Agent> | null;
49
+ /**
50
+ * Direction of the call (inbound or outbound)
51
+ */
52
+ callDirection: 'INBOUND' | 'OUTBOUND';
53
+ createdAt: string | null;
54
+ customers: Array<Data.Customer> | null;
55
+ /**
56
+ * ID of the project this call belongs to
57
+ */
58
+ projectId: string;
59
+ /**
60
+ * Timestamp when the call started
61
+ */
62
+ startedAt: string;
63
+ status: 'RINGING' | 'IN_PROGRESS' | 'ENDED' | null;
64
+ }
65
+ namespace Data {
66
+ interface Agent {
67
+ id: string;
68
+ endpoint?: Agent.Endpoint | null;
69
+ }
70
+ namespace Agent {
71
+ interface Endpoint {
72
+ id: string;
73
+ environment: string;
74
+ phoneNumberE164?: string | null;
75
+ }
76
+ }
77
+ interface Customer {
78
+ label?: string | null;
79
+ phoneNumberE164?: string | null;
80
+ }
81
+ }
82
+ }
83
+ export interface CallListResponse {
84
+ data: Array<CallListResponse.Data>;
85
+ pagination: CallListResponse.Pagination;
86
+ }
87
+ export declare namespace CallListResponse {
88
+ /**
89
+ * Response containing call information
90
+ */
91
+ interface Data {
92
+ /**
93
+ * Unique identifier for the call
94
+ */
95
+ id: string;
96
+ /**
97
+ * Direction of the call (inbound or outbound)
98
+ */
99
+ callDirection: 'INBOUND' | 'OUTBOUND';
100
+ /**
101
+ * ID of the project this call belongs to
102
+ */
103
+ projectId: string;
104
+ /**
105
+ * Timestamp when the call started
106
+ */
107
+ startedAt: string;
108
+ /**
109
+ * Agent information
110
+ */
111
+ agents?: Array<Data.Agent> | null;
112
+ /**
113
+ * Timestamp when the call record was created
114
+ */
115
+ createdAt?: string | null;
116
+ /**
117
+ * Customer information
118
+ */
119
+ customers?: Array<Data.Customer> | null;
120
+ /**
121
+ * Duration of the call in milliseconds
122
+ */
123
+ durationMs?: number | null;
124
+ /**
125
+ * Timestamp when the call ended
126
+ */
127
+ endedAt?: string | null;
128
+ /**
129
+ * Status indicating how the call ended
130
+ */
131
+ endedStatus?: 'PARTICIPANTS_DID_NOT_SPEAK' | 'AGENT_DID_NOT_ANSWER' | 'AGENT_DID_NOT_SPEAK' | 'AGENT_STOPPED_SPEAKING' | 'AGENT_ENDED_CALL' | 'AGENT_TRANSFERRED_CALL' | 'AGENT_BUSY' | 'AGENT_ERROR' | 'CUSTOMER_ENDED_CALL' | 'VOICE_MAIL_REACHED' | 'SILENCE_TIME_OUT' | 'PHONE_CALL_PROVIDER_CONNECTION_ERROR' | 'CUSTOMER_DID_NOT_ANSWER' | 'CUSTOMER_DID_NOT_SPEAK' | 'CUSTOMER_STOPPED_SPEAKING' | 'CUSTOMER_BUSY' | 'DIAL_ERROR' | 'MAX_DURATION_REACHED' | 'UNKNOWN' | null;
132
+ /**
133
+ * Custom properties associated with the call
134
+ */
135
+ properties?: {
136
+ [key: string]: unknown;
137
+ } | null;
138
+ /**
139
+ * Pre-signed URL to the call recording (expires in 1 hour)
140
+ */
141
+ recordingUrl?: string | null;
142
+ /**
143
+ * ID of the simulation job if this call was generated by a simulation
144
+ */
145
+ simulationJobId?: string | null;
146
+ /**
147
+ * Current status of the call
148
+ */
149
+ status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED' | null;
150
+ /**
151
+ * Auto-generated summary of the call conversation
152
+ */
153
+ summary?: string | null;
154
+ /**
155
+ * ID of the call that superseded this one (if applicable)
156
+ */
157
+ supersededByCallId?: string | null;
158
+ /**
159
+ * Auto-generated title for the call based on content
160
+ */
161
+ title?: string | null;
162
+ /**
163
+ * Timestamp when the call record was last updated
164
+ */
165
+ updatedAt?: string | null;
166
+ }
167
+ namespace Data {
168
+ interface Agent {
169
+ id: string;
170
+ endpoint?: Agent.Endpoint | null;
171
+ }
172
+ namespace Agent {
173
+ interface Endpoint {
174
+ id: string;
175
+ environment: string;
176
+ phoneNumberE164?: string | null;
177
+ }
178
+ }
179
+ interface Customer {
180
+ label?: string | null;
181
+ phoneNumberE164?: string | null;
182
+ }
183
+ }
184
+ interface Pagination {
185
+ /**
186
+ * Whether there are more items to fetch
187
+ */
188
+ hasMore: boolean;
189
+ /**
190
+ * Cursor for the next page of items
191
+ */
192
+ nextCursor: string | null;
193
+ /**
194
+ * Total number of items
195
+ */
196
+ total: number;
197
+ }
23
198
  }
24
199
  export interface CallGetByIDResponse {
25
200
  /**
@@ -72,6 +247,12 @@ export declare namespace CallGetByIDResponse {
72
247
  * Status indicating how the call ended
73
248
  */
74
249
  endedStatus?: 'PARTICIPANTS_DID_NOT_SPEAK' | 'AGENT_DID_NOT_ANSWER' | 'AGENT_DID_NOT_SPEAK' | 'AGENT_STOPPED_SPEAKING' | 'AGENT_ENDED_CALL' | 'AGENT_TRANSFERRED_CALL' | 'AGENT_BUSY' | 'AGENT_ERROR' | 'CUSTOMER_ENDED_CALL' | 'VOICE_MAIL_REACHED' | 'SILENCE_TIME_OUT' | 'PHONE_CALL_PROVIDER_CONNECTION_ERROR' | 'CUSTOMER_DID_NOT_ANSWER' | 'CUSTOMER_DID_NOT_SPEAK' | 'CUSTOMER_STOPPED_SPEAKING' | 'CUSTOMER_BUSY' | 'DIAL_ERROR' | 'MAX_DURATION_REACHED' | 'UNKNOWN' | null;
250
+ /**
251
+ * Custom properties associated with the call
252
+ */
253
+ properties?: {
254
+ [key: string]: unknown;
255
+ } | null;
75
256
  /**
76
257
  * Pre-signed URL to the call recording (expires in 1 hour)
77
258
  */
@@ -104,7 +285,7 @@ export declare namespace CallGetByIDResponse {
104
285
  namespace Data {
105
286
  interface Agent {
106
287
  id: string;
107
- endpoint: Agent.Endpoint;
288
+ endpoint?: Agent.Endpoint | null;
108
289
  }
109
290
  namespace Agent {
110
291
  interface Endpoint {
@@ -114,17 +295,18 @@ export declare namespace CallGetByIDResponse {
114
295
  }
115
296
  }
116
297
  interface Customer {
298
+ label?: string | null;
117
299
  phoneNumberE164?: string | null;
118
300
  }
119
301
  }
120
302
  }
121
- export interface CallGetEvaluationRunsResponse {
303
+ export interface CallListEvaluationRunsResponse {
122
304
  /**
123
305
  * Evaluation run response payload
124
306
  */
125
- data: Array<CallGetEvaluationRunsResponse.Data>;
307
+ data: Array<CallListEvaluationRunsResponse.Data>;
126
308
  }
127
- export declare namespace CallGetEvaluationRunsResponse {
309
+ export declare namespace CallListEvaluationRunsResponse {
128
310
  interface Data {
129
311
  /**
130
312
  * All block runs for this evaluator, including skipped ones
@@ -270,13 +452,13 @@ export declare namespace CallGetEvaluationRunsResponse {
270
452
  }
271
453
  }
272
454
  }
273
- export interface CallGetMetricsResponse {
455
+ export interface CallListMetricsResponse {
274
456
  /**
275
457
  * Call metrics response payload grouped by metric definition
276
458
  */
277
- data: Array<CallGetMetricsResponse.Data>;
459
+ data: Array<CallListMetricsResponse.Data>;
278
460
  }
279
- export declare namespace CallGetMetricsResponse {
461
+ export declare namespace CallListMetricsResponse {
280
462
  /**
281
463
  * Call metric data grouped by metric definition
282
464
  */
@@ -436,13 +618,13 @@ export declare namespace CallGetMetricsResponse {
436
618
  }
437
619
  }
438
620
  }
439
- export interface CallGetSentimentRunsResponse {
621
+ export interface CallListSentimentRunsResponse {
440
622
  /**
441
623
  * Sentiment run response payload
442
624
  */
443
- data: CallGetSentimentRunsResponse.Data;
625
+ data: CallListSentimentRunsResponse.Data;
444
626
  }
445
- export declare namespace CallGetSentimentRunsResponse {
627
+ export declare namespace CallListSentimentRunsResponse {
446
628
  /**
447
629
  * Sentiment run response payload
448
630
  */
@@ -465,7 +647,550 @@ export declare namespace CallGetSentimentRunsResponse {
465
647
  commonEmotion?: string;
466
648
  }
467
649
  }
468
- export interface CallGetMetricsParams {
650
+ export interface CallCreateParams {
651
+ /**
652
+ * Direction of the call (INBOUND or OUTBOUND)
653
+ */
654
+ callDirection: 'INBOUND' | 'OUTBOUND';
655
+ /**
656
+ * Interface type of the call (PHONE or WEB)
657
+ */
658
+ interfaceType: 'PHONE' | 'WEB';
659
+ /**
660
+ * URL of source recording (must be an accessible WAV, MP3, or MP4 file). Can be a
661
+ * signed URL.
662
+ */
663
+ recordingUrl: string;
664
+ /**
665
+ * When the call started (ISO 8601 format)
666
+ */
667
+ startedAt: string;
668
+ /**
669
+ * Single agent participating in the call. Use this for simpler API when you have
670
+ * only one agent.
671
+ */
672
+ agent?: CallCreateParams.AgentIdentificationByRoarkID | CallCreateParams.AgentIdentificationByName | CallCreateParams.AgentIdentificationByCustomID;
673
+ /**
674
+ * Agents participating in the call. Each agent requires identification and prompt
675
+ * information.
676
+ */
677
+ agents?: Array<CallCreateParams.AgentIdentificationByRoarkID | CallCreateParams.AgentIdentificationByName | CallCreateParams.AgentIdentificationByCustomID>;
678
+ /**
679
+ * Single customer participating in the call. Use this for simpler API when you
680
+ * have only one customer.
681
+ */
682
+ customer?: CallCreateParams.Customer;
683
+ /**
684
+ * Customers participating in the call.
685
+ */
686
+ customers?: Array<CallCreateParams.Customer>;
687
+ /**
688
+ * High-level call end status, indicating how the call terminated
689
+ */
690
+ endedStatus?: 'PARTICIPANTS_DID_NOT_SPEAK' | 'AGENT_DID_NOT_ANSWER' | 'AGENT_DID_NOT_SPEAK' | 'AGENT_STOPPED_SPEAKING' | 'AGENT_ENDED_CALL' | 'AGENT_TRANSFERRED_CALL' | 'AGENT_BUSY' | 'AGENT_ERROR' | 'CUSTOMER_ENDED_CALL' | 'VOICE_MAIL_REACHED' | 'SILENCE_TIME_OUT' | 'PHONE_CALL_PROVIDER_CONNECTION_ERROR' | 'CUSTOMER_DID_NOT_ANSWER' | 'CUSTOMER_DID_NOT_SPEAK' | 'CUSTOMER_STOPPED_SPEAKING' | 'CUSTOMER_BUSY' | 'DIAL_ERROR' | 'MAX_DURATION_REACHED' | 'UNKNOWN';
691
+ /**
692
+ * Custom properties to include with the call. These can be used for filtering and
693
+ * will show in the call details page
694
+ */
695
+ properties?: {
696
+ [key: string]: unknown;
697
+ };
698
+ /**
699
+ * URL of source stereo recording. Must be accessible. Can be a signed URL.
700
+ * Supported formats: WAV, MP3, MP4.
701
+ */
702
+ stereoRecordingUrl?: string;
703
+ /**
704
+ * List of tool invocations made during the call
705
+ */
706
+ toolInvocations?: Array<CallCreateParams.ToolInvocation>;
707
+ /**
708
+ * List of transcript entries made during the call
709
+ */
710
+ transcript?: Array<CallCreateParams.TranscriptEntryAgent | CallCreateParams.TranscriptEntryCustomer>;
711
+ }
712
+ export declare namespace CallCreateParams {
713
+ interface AgentIdentificationByRoarkID {
714
+ /**
715
+ * Existing Roark agent ID
716
+ */
717
+ roarkId: string;
718
+ /**
719
+ * Endpoint configuration for this agent (optional)
720
+ */
721
+ endpoint?: AgentIdentificationByRoarkID.AgentEndpointByID | AgentIdentificationByRoarkID.AgentEndpointByValue;
722
+ /**
723
+ * Agent's prompt configuration (optional)
724
+ */
725
+ prompt?: AgentIdentificationByRoarkID.Prompt;
726
+ }
727
+ namespace AgentIdentificationByRoarkID {
728
+ interface AgentEndpointByID {
729
+ /**
730
+ * Existing Roark endpoint ID
731
+ */
732
+ id: string;
733
+ }
734
+ /**
735
+ * Lookup or create endpoint if one with these values does not exist
736
+ */
737
+ interface AgentEndpointByValue {
738
+ /**
739
+ * Type of endpoint (phone or websocket)
740
+ */
741
+ type: string;
742
+ /**
743
+ * Endpoint value (phone number in E.164 format or websocket URL)
744
+ */
745
+ value: string;
746
+ /**
747
+ * Call direction for this endpoint
748
+ */
749
+ direction?: string;
750
+ }
751
+ /**
752
+ * Agent's prompt configuration (optional)
753
+ */
754
+ interface Prompt {
755
+ /**
756
+ * The agent's system prompt used during this call
757
+ */
758
+ resolvedPrompt: string;
759
+ }
760
+ }
761
+ /**
762
+ * Create a new agent or find existing by customId if provided
763
+ */
764
+ interface AgentIdentificationByName {
765
+ /**
766
+ * Agent name
767
+ */
768
+ name: string;
769
+ /**
770
+ * Agent custom ID
771
+ */
772
+ customId?: string;
773
+ /**
774
+ * Agent description
775
+ */
776
+ description?: string;
777
+ /**
778
+ * Endpoint configuration for this agent (optional)
779
+ */
780
+ endpoint?: AgentIdentificationByName.AgentEndpointByID | AgentIdentificationByName.AgentEndpointByValue;
781
+ /**
782
+ * Agent's prompt configuration (optional)
783
+ */
784
+ prompt?: AgentIdentificationByName.Prompt;
785
+ }
786
+ namespace AgentIdentificationByName {
787
+ interface AgentEndpointByID {
788
+ /**
789
+ * Existing Roark endpoint ID
790
+ */
791
+ id: string;
792
+ }
793
+ /**
794
+ * Lookup or create endpoint if one with these values does not exist
795
+ */
796
+ interface AgentEndpointByValue {
797
+ /**
798
+ * Type of endpoint (phone or websocket)
799
+ */
800
+ type: string;
801
+ /**
802
+ * Endpoint value (phone number in E.164 format or websocket URL)
803
+ */
804
+ value: string;
805
+ /**
806
+ * Call direction for this endpoint
807
+ */
808
+ direction?: string;
809
+ }
810
+ /**
811
+ * Agent's prompt configuration (optional)
812
+ */
813
+ interface Prompt {
814
+ /**
815
+ * The agent's system prompt used during this call
816
+ */
817
+ resolvedPrompt: string;
818
+ }
819
+ }
820
+ interface AgentIdentificationByCustomID {
821
+ /**
822
+ * Existing custom ID for a Roark agent
823
+ */
824
+ customId: string;
825
+ /**
826
+ * Endpoint configuration for this agent (optional)
827
+ */
828
+ endpoint?: AgentIdentificationByCustomID.AgentEndpointByID | AgentIdentificationByCustomID.AgentEndpointByValue;
829
+ /**
830
+ * Agent's prompt configuration (optional)
831
+ */
832
+ prompt?: AgentIdentificationByCustomID.Prompt;
833
+ }
834
+ namespace AgentIdentificationByCustomID {
835
+ interface AgentEndpointByID {
836
+ /**
837
+ * Existing Roark endpoint ID
838
+ */
839
+ id: string;
840
+ }
841
+ /**
842
+ * Lookup or create endpoint if one with these values does not exist
843
+ */
844
+ interface AgentEndpointByValue {
845
+ /**
846
+ * Type of endpoint (phone or websocket)
847
+ */
848
+ type: string;
849
+ /**
850
+ * Endpoint value (phone number in E.164 format or websocket URL)
851
+ */
852
+ value: string;
853
+ /**
854
+ * Call direction for this endpoint
855
+ */
856
+ direction?: string;
857
+ }
858
+ /**
859
+ * Agent's prompt configuration (optional)
860
+ */
861
+ interface Prompt {
862
+ /**
863
+ * The agent's system prompt used during this call
864
+ */
865
+ resolvedPrompt: string;
866
+ }
867
+ }
868
+ interface AgentIdentificationByRoarkID {
869
+ /**
870
+ * Existing Roark agent ID
871
+ */
872
+ roarkId: string;
873
+ /**
874
+ * Endpoint configuration for this agent (optional)
875
+ */
876
+ endpoint?: AgentIdentificationByRoarkID.AgentEndpointByID | AgentIdentificationByRoarkID.AgentEndpointByValue;
877
+ /**
878
+ * Agent's prompt configuration (optional)
879
+ */
880
+ prompt?: AgentIdentificationByRoarkID.Prompt;
881
+ }
882
+ namespace AgentIdentificationByRoarkID {
883
+ interface AgentEndpointByID {
884
+ /**
885
+ * Existing Roark endpoint ID
886
+ */
887
+ id: string;
888
+ }
889
+ /**
890
+ * Lookup or create endpoint if one with these values does not exist
891
+ */
892
+ interface AgentEndpointByValue {
893
+ /**
894
+ * Type of endpoint (phone or websocket)
895
+ */
896
+ type: string;
897
+ /**
898
+ * Endpoint value (phone number in E.164 format or websocket URL)
899
+ */
900
+ value: string;
901
+ /**
902
+ * Call direction for this endpoint
903
+ */
904
+ direction?: string;
905
+ }
906
+ /**
907
+ * Agent's prompt configuration (optional)
908
+ */
909
+ interface Prompt {
910
+ /**
911
+ * The agent's system prompt used during this call
912
+ */
913
+ resolvedPrompt: string;
914
+ }
915
+ }
916
+ /**
917
+ * Create a new agent or find existing by customId if provided
918
+ */
919
+ interface AgentIdentificationByName {
920
+ /**
921
+ * Agent name
922
+ */
923
+ name: string;
924
+ /**
925
+ * Agent custom ID
926
+ */
927
+ customId?: string;
928
+ /**
929
+ * Agent description
930
+ */
931
+ description?: string;
932
+ /**
933
+ * Endpoint configuration for this agent (optional)
934
+ */
935
+ endpoint?: AgentIdentificationByName.AgentEndpointByID | AgentIdentificationByName.AgentEndpointByValue;
936
+ /**
937
+ * Agent's prompt configuration (optional)
938
+ */
939
+ prompt?: AgentIdentificationByName.Prompt;
940
+ }
941
+ namespace AgentIdentificationByName {
942
+ interface AgentEndpointByID {
943
+ /**
944
+ * Existing Roark endpoint ID
945
+ */
946
+ id: string;
947
+ }
948
+ /**
949
+ * Lookup or create endpoint if one with these values does not exist
950
+ */
951
+ interface AgentEndpointByValue {
952
+ /**
953
+ * Type of endpoint (phone or websocket)
954
+ */
955
+ type: string;
956
+ /**
957
+ * Endpoint value (phone number in E.164 format or websocket URL)
958
+ */
959
+ value: string;
960
+ /**
961
+ * Call direction for this endpoint
962
+ */
963
+ direction?: string;
964
+ }
965
+ /**
966
+ * Agent's prompt configuration (optional)
967
+ */
968
+ interface Prompt {
969
+ /**
970
+ * The agent's system prompt used during this call
971
+ */
972
+ resolvedPrompt: string;
973
+ }
974
+ }
975
+ interface AgentIdentificationByCustomID {
976
+ /**
977
+ * Existing custom ID for a Roark agent
978
+ */
979
+ customId: string;
980
+ /**
981
+ * Endpoint configuration for this agent (optional)
982
+ */
983
+ endpoint?: AgentIdentificationByCustomID.AgentEndpointByID | AgentIdentificationByCustomID.AgentEndpointByValue;
984
+ /**
985
+ * Agent's prompt configuration (optional)
986
+ */
987
+ prompt?: AgentIdentificationByCustomID.Prompt;
988
+ }
989
+ namespace AgentIdentificationByCustomID {
990
+ interface AgentEndpointByID {
991
+ /**
992
+ * Existing Roark endpoint ID
993
+ */
994
+ id: string;
995
+ }
996
+ /**
997
+ * Lookup or create endpoint if one with these values does not exist
998
+ */
999
+ interface AgentEndpointByValue {
1000
+ /**
1001
+ * Type of endpoint (phone or websocket)
1002
+ */
1003
+ type: string;
1004
+ /**
1005
+ * Endpoint value (phone number in E.164 format or websocket URL)
1006
+ */
1007
+ value: string;
1008
+ /**
1009
+ * Call direction for this endpoint
1010
+ */
1011
+ direction?: string;
1012
+ }
1013
+ /**
1014
+ * Agent's prompt configuration (optional)
1015
+ */
1016
+ interface Prompt {
1017
+ /**
1018
+ * The agent's system prompt used during this call
1019
+ */
1020
+ resolvedPrompt: string;
1021
+ }
1022
+ }
1023
+ /**
1024
+ * Single customer participating in the call. Use this for simpler API when you
1025
+ * have only one customer.
1026
+ */
1027
+ interface Customer {
1028
+ /**
1029
+ * Customer phone number in E.164 format (e.g., +14155551234)
1030
+ */
1031
+ phoneNumberE164: string | null;
1032
+ /**
1033
+ * Label to identify this customer in the transcript (e.g., "speaker-01",
1034
+ * "speaker-02")
1035
+ */
1036
+ label?: string | null;
1037
+ }
1038
+ /**
1039
+ * Customer participating in the call
1040
+ */
1041
+ interface Customer {
1042
+ /**
1043
+ * Customer phone number in E.164 format (e.g., +14155551234)
1044
+ */
1045
+ phoneNumberE164: string | null;
1046
+ /**
1047
+ * Label to identify this customer in the transcript (e.g., "speaker-01",
1048
+ * "speaker-02")
1049
+ */
1050
+ label?: string | null;
1051
+ }
1052
+ interface ToolInvocation {
1053
+ /**
1054
+ * Name of the tool that was invoked
1055
+ */
1056
+ name: string;
1057
+ /**
1058
+ * Parameters provided to the tool during invocation
1059
+ */
1060
+ parameters: {
1061
+ [key: string]: ToolInvocation.UnionMember0 | unknown;
1062
+ };
1063
+ /**
1064
+ * Result returned by the tool after execution. Can be a string or a JSON object
1065
+ */
1066
+ result: string | {
1067
+ [key: string]: unknown;
1068
+ };
1069
+ /**
1070
+ * Offset in milliseconds from the start of the call when the tool was invoked
1071
+ */
1072
+ startOffsetMs: number;
1073
+ /**
1074
+ * Metadata about the agent that invoked this tool - used to match which agent from
1075
+ * the agents array this tool invocation belongs to
1076
+ */
1077
+ agent?: ToolInvocation.Agent;
1078
+ /**
1079
+ * Description of when the tool should be invoked
1080
+ */
1081
+ description?: string;
1082
+ /**
1083
+ * Offset in milliseconds from the start of the call when the tool execution
1084
+ * completed. Used to calculate duration of the tool execution
1085
+ */
1086
+ endOffsetMs?: number;
1087
+ }
1088
+ namespace ToolInvocation {
1089
+ interface UnionMember0 {
1090
+ description?: string;
1091
+ type?: 'string' | 'number' | 'boolean';
1092
+ value?: unknown;
1093
+ }
1094
+ /**
1095
+ * Metadata about the agent that invoked this tool - used to match which agent from
1096
+ * the agents array this tool invocation belongs to
1097
+ */
1098
+ interface Agent {
1099
+ /**
1100
+ * The custom ID set on the agent
1101
+ */
1102
+ customId?: string;
1103
+ /**
1104
+ * The Roark ID of the agent
1105
+ */
1106
+ roarkId?: string;
1107
+ }
1108
+ }
1109
+ interface TranscriptEntryAgent {
1110
+ endOffsetMs: number;
1111
+ role: 'AGENT';
1112
+ startOffsetMs: number;
1113
+ text: string;
1114
+ /**
1115
+ * Metadata about the agent that spoke this turn - used to match which agent from
1116
+ * the `agents` array this transcript entry belongs to
1117
+ */
1118
+ agent?: TranscriptEntryAgent.Agent;
1119
+ languageCode?: string;
1120
+ }
1121
+ namespace TranscriptEntryAgent {
1122
+ /**
1123
+ * Metadata about the agent that spoke this turn - used to match which agent from
1124
+ * the `agents` array this transcript entry belongs to
1125
+ */
1126
+ interface Agent {
1127
+ /**
1128
+ * The custom ID set on the agent
1129
+ */
1130
+ customId?: string;
1131
+ /**
1132
+ * The Roark ID of the agent
1133
+ */
1134
+ roarkId?: string;
1135
+ }
1136
+ }
1137
+ interface TranscriptEntryCustomer {
1138
+ endOffsetMs: number;
1139
+ role: 'CUSTOMER';
1140
+ startOffsetMs: number;
1141
+ text: string;
1142
+ /**
1143
+ * Metadata about the customer that spoke this turn - used to match which customer
1144
+ * from the `customers` array this transcript entry belongs to
1145
+ */
1146
+ customer?: TranscriptEntryCustomer.Customer;
1147
+ languageCode?: string;
1148
+ }
1149
+ namespace TranscriptEntryCustomer {
1150
+ /**
1151
+ * Metadata about the customer that spoke this turn - used to match which customer
1152
+ * from the `customers` array this transcript entry belongs to
1153
+ */
1154
+ interface Customer {
1155
+ /**
1156
+ * Label matching the `label` field on the `customers` array when creating the call
1157
+ */
1158
+ label?: string;
1159
+ /**
1160
+ * The phone number of the customer in E.164 format, matching the `phoneNumberE164`
1161
+ * field on the `customers` array when creating the call
1162
+ */
1163
+ phoneNumberE164?: string;
1164
+ }
1165
+ }
1166
+ }
1167
+ export interface CallListParams {
1168
+ /**
1169
+ * Cursor for pagination - use the nextCursor value from a previous response
1170
+ */
1171
+ after?: string;
1172
+ /**
1173
+ * Maximum number of calls to return (default: 20, max: 100)
1174
+ */
1175
+ limit?: number;
1176
+ /**
1177
+ * Search text to filter calls by title, summary, or transcript
1178
+ */
1179
+ searchText?: string;
1180
+ /**
1181
+ * Field to sort by (default: createdAt)
1182
+ */
1183
+ sortBy?: 'createdAt' | 'startedAt' | 'endedAt' | 'duration' | 'title' | 'status';
1184
+ /**
1185
+ * Sort direction (default: desc)
1186
+ */
1187
+ sortDirection?: 'asc' | 'desc';
1188
+ /**
1189
+ * Filter by call status
1190
+ */
1191
+ status?: 'RINGING' | 'IN_PROGRESS' | 'ENDED';
1192
+ }
1193
+ export interface CallListMetricsParams {
469
1194
  /**
470
1195
  * Whether to return a flat list instead of grouped by metric definition (default:
471
1196
  * false)
@@ -473,6 +1198,6 @@ export interface CallGetMetricsParams {
473
1198
  flatten?: string;
474
1199
  }
475
1200
  export declare namespace Call {
476
- export { type CallGetByIDResponse as CallGetByIDResponse, type CallGetEvaluationRunsResponse as CallGetEvaluationRunsResponse, type CallGetMetricsResponse as CallGetMetricsResponse, type CallGetSentimentRunsResponse as CallGetSentimentRunsResponse, type CallGetMetricsParams as CallGetMetricsParams, };
1201
+ export { type CallCreateResponse as CallCreateResponse, type CallListResponse as CallListResponse, type CallGetByIDResponse as CallGetByIDResponse, type CallListEvaluationRunsResponse as CallListEvaluationRunsResponse, type CallListMetricsResponse as CallListMetricsResponse, type CallListSentimentRunsResponse as CallListSentimentRunsResponse, type CallCreateParams as CallCreateParams, type CallListParams as CallListParams, type CallListMetricsParams as CallListMetricsParams, };
477
1202
  }
478
1203
  //# sourceMappingURL=call.d.ts.map