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