@roarkanalytics/sdk 3.11.0 → 3.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/client.d.mts +12 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +12 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent-prompt.d.mts +129 -0
  12. package/resources/agent-prompt.d.mts.map +1 -0
  13. package/resources/agent-prompt.d.ts +129 -0
  14. package/resources/agent-prompt.d.ts.map +1 -0
  15. package/resources/agent-prompt.js +58 -0
  16. package/resources/agent-prompt.js.map +1 -0
  17. package/resources/agent-prompt.mjs +54 -0
  18. package/resources/agent-prompt.mjs.map +1 -0
  19. package/resources/benchmark.d.mts +547 -0
  20. package/resources/benchmark.d.mts.map +1 -0
  21. package/resources/benchmark.d.ts +547 -0
  22. package/resources/benchmark.d.ts.map +1 -0
  23. package/resources/benchmark.js +110 -0
  24. package/resources/benchmark.js.map +1 -0
  25. package/resources/benchmark.mjs +106 -0
  26. package/resources/benchmark.mjs.map +1 -0
  27. package/resources/call.d.mts +1 -1
  28. package/resources/call.d.mts.map +1 -1
  29. package/resources/call.d.ts +1 -1
  30. package/resources/call.d.ts.map +1 -1
  31. package/resources/config.d.mts +169 -21
  32. package/resources/config.d.mts.map +1 -1
  33. package/resources/config.d.ts +169 -21
  34. package/resources/config.d.ts.map +1 -1
  35. package/resources/customer-flow-edge-case.d.mts +99 -27
  36. package/resources/customer-flow-edge-case.d.mts.map +1 -1
  37. package/resources/customer-flow-edge-case.d.ts +99 -27
  38. package/resources/customer-flow-edge-case.d.ts.map +1 -1
  39. package/resources/customer-flow.d.mts +2110 -138
  40. package/resources/customer-flow.d.mts.map +1 -1
  41. package/resources/customer-flow.d.ts +2110 -138
  42. package/resources/customer-flow.d.ts.map +1 -1
  43. package/resources/customer-flow.js +18 -0
  44. package/resources/customer-flow.js.map +1 -1
  45. package/resources/customer-flow.mjs +18 -0
  46. package/resources/customer-flow.mjs.map +1 -1
  47. package/resources/index.d.mts +5 -3
  48. package/resources/index.d.mts.map +1 -1
  49. package/resources/index.d.ts +5 -3
  50. package/resources/index.d.ts.map +1 -1
  51. package/resources/index.js +5 -1
  52. package/resources/index.js.map +1 -1
  53. package/resources/index.mjs +2 -0
  54. package/resources/index.mjs.map +1 -1
  55. package/resources/simulation-environment.d.mts +163 -1
  56. package/resources/simulation-environment.d.mts.map +1 -1
  57. package/resources/simulation-environment.d.ts +163 -1
  58. package/resources/simulation-environment.d.ts.map +1 -1
  59. package/resources/simulation-environment.js +51 -0
  60. package/resources/simulation-environment.js.map +1 -1
  61. package/resources/simulation-environment.mjs +51 -0
  62. package/resources/simulation-environment.mjs.map +1 -1
  63. package/resources/simulation-job.d.mts +68 -6
  64. package/resources/simulation-job.d.mts.map +1 -1
  65. package/resources/simulation-job.d.ts +68 -6
  66. package/resources/simulation-job.d.ts.map +1 -1
  67. package/resources/simulation-persona.d.mts +60 -18
  68. package/resources/simulation-persona.d.mts.map +1 -1
  69. package/resources/simulation-persona.d.ts +60 -18
  70. package/resources/simulation-persona.d.ts.map +1 -1
  71. package/resources/simulation-run-plan-job.d.mts +172 -4
  72. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  73. package/resources/simulation-run-plan-job.d.ts +172 -4
  74. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  75. package/resources/simulation-run-plan-job.js +16 -0
  76. package/resources/simulation-run-plan-job.js.map +1 -1
  77. package/resources/simulation-run-plan-job.mjs +16 -0
  78. package/resources/simulation-run-plan-job.mjs.map +1 -1
  79. package/resources/simulation-run-plan.d.mts +102 -0
  80. package/resources/simulation-run-plan.d.mts.map +1 -1
  81. package/resources/simulation-run-plan.d.ts +102 -0
  82. package/resources/simulation-run-plan.d.ts.map +1 -1
  83. package/resources/simulation-template.d.mts +10 -0
  84. package/resources/simulation-template.d.mts.map +1 -1
  85. package/resources/simulation-template.d.ts +10 -0
  86. package/resources/simulation-template.d.ts.map +1 -1
  87. package/resources/simulation.d.mts +26 -1
  88. package/resources/simulation.d.mts.map +1 -1
  89. package/resources/simulation.d.ts +26 -1
  90. package/resources/simulation.d.ts.map +1 -1
  91. package/src/client.ts +66 -0
  92. package/src/resources/agent-prompt.ts +183 -0
  93. package/src/resources/benchmark.ts +740 -0
  94. package/src/resources/call.ts +1 -1
  95. package/src/resources/config.ts +313 -23
  96. package/src/resources/customer-flow-edge-case.ts +207 -27
  97. package/src/resources/customer-flow.ts +3198 -123
  98. package/src/resources/index.ts +30 -0
  99. package/src/resources/simulation-environment.ts +244 -0
  100. package/src/resources/simulation-job.ts +98 -6
  101. package/src/resources/simulation-persona.ts +126 -18
  102. package/src/resources/simulation-run-plan-job.ts +240 -3
  103. package/src/resources/simulation-run-plan.ts +118 -0
  104. package/src/resources/simulation-template.ts +11 -0
  105. package/src/resources/simulation.ts +28 -1
  106. package/src/version.ts +1 -1
  107. package/version.d.mts +1 -1
  108. package/version.d.ts +1 -1
  109. package/version.js +1 -1
  110. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -37,6 +37,28 @@ import {
37
37
  AgentEndpointUpdateParams,
38
38
  AgentEndpointUpdateResponse,
39
39
  } from './resources/agent-endpoint';
40
+ import {
41
+ AgentPrompt,
42
+ AgentPromptListResponse,
43
+ AgentPromptListVersionsParams,
44
+ AgentPromptListVersionsResponse,
45
+ AgentPromptUpdateParams,
46
+ AgentPromptUpdateResponse,
47
+ } from './resources/agent-prompt';
48
+ import {
49
+ Benchmark,
50
+ BenchmarkGetLeaderboardParams,
51
+ BenchmarkGetLeaderboardResponse,
52
+ BenchmarkGetTargetParams,
53
+ BenchmarkGetTargetResponse,
54
+ BenchmarkListMetricsParams,
55
+ BenchmarkListMetricsResponse,
56
+ BenchmarkListSuitesResponse,
57
+ BenchmarkListTargetHistoryParams,
58
+ BenchmarkListTargetHistoryResponse,
59
+ BenchmarkListTargetScoreSamplesParams,
60
+ BenchmarkListTargetScoreSamplesResponse,
61
+ } from './resources/benchmark';
40
62
  import {
41
63
  Call,
42
64
  CallAppendToolInvocationsParams,
@@ -66,6 +88,8 @@ import {
66
88
  CustomerFlowCreateParams,
67
89
  CustomerFlowCreateResponse,
68
90
  CustomerFlowDeleteResponse,
91
+ CustomerFlowDuplicateParams,
92
+ CustomerFlowDuplicateResponse,
69
93
  CustomerFlowGetByIDResponse,
70
94
  CustomerFlowListParams,
71
95
  CustomerFlowListResponse,
@@ -142,9 +166,14 @@ import {
142
166
  import { Simulation, SimulationRunParams, SimulationRunResponse } from './resources/simulation';
143
167
  import {
144
168
  SimulationEnvironment,
169
+ SimulationEnvironmentCreateParams,
170
+ SimulationEnvironmentCreateResponse,
171
+ SimulationEnvironmentDeleteResponse,
145
172
  SimulationEnvironmentGetByIDResponse,
146
173
  SimulationEnvironmentListParams,
147
174
  SimulationEnvironmentListResponse,
175
+ SimulationEnvironmentUpdateParams,
176
+ SimulationEnvironmentUpdateResponse,
148
177
  } from './resources/simulation-environment';
149
178
  import {
150
179
  SimulationJob,
@@ -175,6 +204,7 @@ import {
175
204
  } from './resources/simulation-run-plan';
176
205
  import {
177
206
  SimulationRunPlanJob,
207
+ SimulationRunPlanJobCancelResponse,
178
208
  SimulationRunPlanJobGetByIDResponse,
179
209
  SimulationRunPlanJobListParams,
180
210
  SimulationRunPlanJobListResponse,
@@ -925,8 +955,10 @@ export class Roark {
925
955
  customerFlowEdgeCase: API.CustomerFlowEdgeCase = new API.CustomerFlowEdgeCase(this);
926
956
  agent: API.Agent = new API.Agent(this);
927
957
  agentEndpoint: API.AgentEndpoint = new API.AgentEndpoint(this);
958
+ agentPrompt: API.AgentPrompt = new API.AgentPrompt(this);
928
959
  httpRequestDefinition: API.HTTPRequestDefinition = new API.HTTPRequestDefinition(this);
929
960
  webhook: API.Webhook = new API.Webhook(this);
961
+ benchmark: API.Benchmark = new API.Benchmark(this);
930
962
  config: API.Config = new API.Config(this);
931
963
  }
932
964
 
@@ -947,8 +979,10 @@ Roark.CustomerFlow = CustomerFlow;
947
979
  Roark.CustomerFlowEdgeCase = CustomerFlowEdgeCase;
948
980
  Roark.Agent = Agent;
949
981
  Roark.AgentEndpoint = AgentEndpoint;
982
+ Roark.AgentPrompt = AgentPrompt;
950
983
  Roark.HTTPRequestDefinition = HTTPRequestDefinition;
951
984
  Roark.Webhook = Webhook;
985
+ Roark.Benchmark = Benchmark;
952
986
  Roark.Config = Config;
953
987
 
954
988
  export declare namespace Roark {
@@ -1044,6 +1078,7 @@ export declare namespace Roark {
1044
1078
  export {
1045
1079
  SimulationRunPlanJob as SimulationRunPlanJob,
1046
1080
  type SimulationRunPlanJobListResponse as SimulationRunPlanJobListResponse,
1081
+ type SimulationRunPlanJobCancelResponse as SimulationRunPlanJobCancelResponse,
1047
1082
  type SimulationRunPlanJobGetByIDResponse as SimulationRunPlanJobGetByIDResponse,
1048
1083
  type SimulationRunPlanJobStartResponse as SimulationRunPlanJobStartResponse,
1049
1084
  type SimulationRunPlanJobListParams as SimulationRunPlanJobListParams,
@@ -1063,8 +1098,13 @@ export declare namespace Roark {
1063
1098
 
1064
1099
  export {
1065
1100
  SimulationEnvironment as SimulationEnvironment,
1101
+ type SimulationEnvironmentCreateResponse as SimulationEnvironmentCreateResponse,
1102
+ type SimulationEnvironmentUpdateResponse as SimulationEnvironmentUpdateResponse,
1066
1103
  type SimulationEnvironmentListResponse as SimulationEnvironmentListResponse,
1104
+ type SimulationEnvironmentDeleteResponse as SimulationEnvironmentDeleteResponse,
1067
1105
  type SimulationEnvironmentGetByIDResponse as SimulationEnvironmentGetByIDResponse,
1106
+ type SimulationEnvironmentCreateParams as SimulationEnvironmentCreateParams,
1107
+ type SimulationEnvironmentUpdateParams as SimulationEnvironmentUpdateParams,
1068
1108
  type SimulationEnvironmentListParams as SimulationEnvironmentListParams,
1069
1109
  };
1070
1110
 
@@ -1080,12 +1120,14 @@ export declare namespace Roark {
1080
1120
  type CustomerFlowUpdateResponse as CustomerFlowUpdateResponse,
1081
1121
  type CustomerFlowListResponse as CustomerFlowListResponse,
1082
1122
  type CustomerFlowDeleteResponse as CustomerFlowDeleteResponse,
1123
+ type CustomerFlowDuplicateResponse as CustomerFlowDuplicateResponse,
1083
1124
  type CustomerFlowGetByIDResponse as CustomerFlowGetByIDResponse,
1084
1125
  type CustomerFlowReplaceGraphResponse as CustomerFlowReplaceGraphResponse,
1085
1126
  type CustomerFlowUpdateHappyPathResponse as CustomerFlowUpdateHappyPathResponse,
1086
1127
  type CustomerFlowCreateParams as CustomerFlowCreateParams,
1087
1128
  type CustomerFlowUpdateParams as CustomerFlowUpdateParams,
1088
1129
  type CustomerFlowListParams as CustomerFlowListParams,
1130
+ type CustomerFlowDuplicateParams as CustomerFlowDuplicateParams,
1089
1131
  type CustomerFlowReplaceGraphParams as CustomerFlowReplaceGraphParams,
1090
1132
  type CustomerFlowUpdateHappyPathParams as CustomerFlowUpdateHappyPathParams,
1091
1133
  };
@@ -1124,6 +1166,15 @@ export declare namespace Roark {
1124
1166
  type AgentEndpointListParams as AgentEndpointListParams,
1125
1167
  };
1126
1168
 
1169
+ export {
1170
+ AgentPrompt as AgentPrompt,
1171
+ type AgentPromptUpdateResponse as AgentPromptUpdateResponse,
1172
+ type AgentPromptListResponse as AgentPromptListResponse,
1173
+ type AgentPromptListVersionsResponse as AgentPromptListVersionsResponse,
1174
+ type AgentPromptUpdateParams as AgentPromptUpdateParams,
1175
+ type AgentPromptListVersionsParams as AgentPromptListVersionsParams,
1176
+ };
1177
+
1127
1178
  export {
1128
1179
  HTTPRequestDefinition as HTTPRequestDefinition,
1129
1180
  type HTTPRequestDefinitionCreateResponse as HTTPRequestDefinitionCreateResponse,
@@ -1145,6 +1196,21 @@ export declare namespace Roark {
1145
1196
  type WebhookListParams as WebhookListParams,
1146
1197
  };
1147
1198
 
1199
+ export {
1200
+ Benchmark as Benchmark,
1201
+ type BenchmarkGetLeaderboardResponse as BenchmarkGetLeaderboardResponse,
1202
+ type BenchmarkGetTargetResponse as BenchmarkGetTargetResponse,
1203
+ type BenchmarkListMetricsResponse as BenchmarkListMetricsResponse,
1204
+ type BenchmarkListSuitesResponse as BenchmarkListSuitesResponse,
1205
+ type BenchmarkListTargetHistoryResponse as BenchmarkListTargetHistoryResponse,
1206
+ type BenchmarkListTargetScoreSamplesResponse as BenchmarkListTargetScoreSamplesResponse,
1207
+ type BenchmarkGetLeaderboardParams as BenchmarkGetLeaderboardParams,
1208
+ type BenchmarkGetTargetParams as BenchmarkGetTargetParams,
1209
+ type BenchmarkListMetricsParams as BenchmarkListMetricsParams,
1210
+ type BenchmarkListTargetHistoryParams as BenchmarkListTargetHistoryParams,
1211
+ type BenchmarkListTargetScoreSamplesParams as BenchmarkListTargetScoreSamplesParams,
1212
+ };
1213
+
1148
1214
  export {
1149
1215
  Config as Config,
1150
1216
  type Bundle as Bundle,
@@ -0,0 +1,183 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ export class AgentPrompt extends APIResource {
9
+ /**
10
+ * Sets the agent's API-managed prompt. This is its own version history
11
+ * (`source: API_MANAGED`), separate from prompts observed on calls, edited in the
12
+ * app, or managed by config-as-code. Setting the same content twice is a no-op (no
13
+ * new version). Roark does not run your agent and no metric reads this prompt: it
14
+ * is stored and versioned for your reference.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const agentPrompt = await client.agentPrompt.update(
19
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
20
+ * { prompt: 'x' },
21
+ * );
22
+ * ```
23
+ */
24
+ update(
25
+ agentID: string,
26
+ body: AgentPromptUpdateParams,
27
+ options?: RequestOptions,
28
+ ): APIPromise<AgentPromptUpdateResponse> {
29
+ return this._client.put(path`/v1/agent/${agentID}/prompts`, { body, ...options });
30
+ }
31
+
32
+ /**
33
+ * Returns the agent's prompt lineages. Each lineage is an independent version
34
+ * history, labelled by its `source` (USER, API, CONFIG, or a provider
35
+ * integration). `prompt` is the current content.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const agentPrompts = await client.agentPrompt.list(
40
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
41
+ * );
42
+ * ```
43
+ */
44
+ list(agentID: string, options?: RequestOptions): APIPromise<AgentPromptListResponse> {
45
+ return this._client.get(path`/v1/agent/${agentID}/prompts`, options);
46
+ }
47
+
48
+ /**
49
+ * Returns the full version history of a single prompt lineage, newest first.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const response = await client.agentPrompt.listVersions(
54
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
55
+ * { agentId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
56
+ * );
57
+ * ```
58
+ */
59
+ listVersions(
60
+ promptID: string,
61
+ params: AgentPromptListVersionsParams,
62
+ options?: RequestOptions,
63
+ ): APIPromise<AgentPromptListVersionsResponse> {
64
+ const { agentId } = params;
65
+ return this._client.get(path`/v1/agent/${agentId}/prompts/${promptID}/versions`, options);
66
+ }
67
+ }
68
+
69
+ export interface AgentPromptUpdateResponse {
70
+ data: AgentPromptUpdateResponse.Data;
71
+ }
72
+
73
+ export namespace AgentPromptUpdateResponse {
74
+ export interface Data {
75
+ /**
76
+ * True if a new version was appended; false if the content matched the current
77
+ * version (no-op).
78
+ */
79
+ changed: boolean;
80
+
81
+ /**
82
+ * The ID of the API-managed prompt lineage.
83
+ */
84
+ promptId: string;
85
+
86
+ /**
87
+ * The current version number after the set.
88
+ */
89
+ versionNumber: number;
90
+ }
91
+ }
92
+
93
+ export interface AgentPromptListResponse {
94
+ data: Array<AgentPromptListResponse.Data>;
95
+ }
96
+
97
+ export namespace AgentPromptListResponse {
98
+ /**
99
+ * A prompt lineage on an agent.
100
+ */
101
+ export interface Data {
102
+ /**
103
+ * Prompt lineage ID (its own version history).
104
+ */
105
+ id: string;
106
+
107
+ /**
108
+ * When this prompt lineage was first created (ISO 8601).
109
+ */
110
+ createdAt: string;
111
+
112
+ /**
113
+ * Current prompt content (the latest version).
114
+ */
115
+ prompt: string;
116
+
117
+ /**
118
+ * Where this prompt came from: USER (edited in the app), API (provided via the API
119
+ * or on calls), CONFIG (managed by config-as-code), or a provider integration.
120
+ */
121
+ source:
122
+ | 'USER'
123
+ | 'RETELL_INTEGRATION'
124
+ | 'VAPI_INTEGRATION'
125
+ | 'ELEVEN_LABS_INTEGRATION'
126
+ | 'BLAND_INTEGRATION'
127
+ | 'PIPECAT_CLOUD_INTEGRATION'
128
+ | 'PIPECAT_SELF_HOSTED_INTEGRATION'
129
+ | 'LIVEKIT_SELF_HOSTED_INTEGRATION'
130
+ | 'API'
131
+ | 'CONFIG'
132
+ | 'API_MANAGED';
133
+
134
+ /**
135
+ * When the current version was recorded (ISO 8601).
136
+ */
137
+ updatedAt: string;
138
+ }
139
+ }
140
+
141
+ export interface AgentPromptListVersionsResponse {
142
+ data: Array<AgentPromptListVersionsResponse.Data>;
143
+ }
144
+
145
+ export namespace AgentPromptListVersionsResponse {
146
+ export interface Data {
147
+ /**
148
+ * When this version was recorded (ISO 8601).
149
+ */
150
+ createdAt: string;
151
+
152
+ /**
153
+ * Prompt content at this version.
154
+ */
155
+ prompt: string;
156
+
157
+ /**
158
+ * Version number: 1-based and increasing.
159
+ */
160
+ versionNumber: number;
161
+ }
162
+ }
163
+
164
+ export interface AgentPromptUpdateParams {
165
+ /**
166
+ * The prompt content to set.
167
+ */
168
+ prompt: string;
169
+ }
170
+
171
+ export interface AgentPromptListVersionsParams {
172
+ agentId: string;
173
+ }
174
+
175
+ export declare namespace AgentPrompt {
176
+ export {
177
+ type AgentPromptUpdateResponse as AgentPromptUpdateResponse,
178
+ type AgentPromptListResponse as AgentPromptListResponse,
179
+ type AgentPromptListVersionsResponse as AgentPromptListVersionsResponse,
180
+ type AgentPromptUpdateParams as AgentPromptUpdateParams,
181
+ type AgentPromptListVersionsParams as AgentPromptListVersionsParams,
182
+ };
183
+ }