@roarkanalytics/sdk 3.10.0 → 3.12.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 (101) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/client.d.mts +7 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -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/call.d.mts +1 -1
  20. package/resources/call.d.mts.map +1 -1
  21. package/resources/call.d.ts +1 -1
  22. package/resources/call.d.ts.map +1 -1
  23. package/resources/config.d.mts +166 -18
  24. package/resources/config.d.mts.map +1 -1
  25. package/resources/config.d.ts +166 -18
  26. package/resources/config.d.ts.map +1 -1
  27. package/resources/customer-flow-edge-case.d.mts +72 -9
  28. package/resources/customer-flow-edge-case.d.mts.map +1 -1
  29. package/resources/customer-flow-edge-case.d.ts +72 -9
  30. package/resources/customer-flow-edge-case.d.ts.map +1 -1
  31. package/resources/customer-flow.d.mts +2005 -78
  32. package/resources/customer-flow.d.mts.map +1 -1
  33. package/resources/customer-flow.d.ts +2005 -78
  34. package/resources/customer-flow.d.ts.map +1 -1
  35. package/resources/customer-flow.js +18 -0
  36. package/resources/customer-flow.js.map +1 -1
  37. package/resources/customer-flow.mjs +18 -0
  38. package/resources/customer-flow.mjs.map +1 -1
  39. package/resources/index.d.mts +3 -2
  40. package/resources/index.d.mts.map +1 -1
  41. package/resources/index.d.ts +3 -2
  42. package/resources/index.d.ts.map +1 -1
  43. package/resources/index.js +3 -1
  44. package/resources/index.js.map +1 -1
  45. package/resources/index.mjs +1 -0
  46. package/resources/index.mjs.map +1 -1
  47. package/resources/simulation-environment.d.mts +163 -1
  48. package/resources/simulation-environment.d.mts.map +1 -1
  49. package/resources/simulation-environment.d.ts +163 -1
  50. package/resources/simulation-environment.d.ts.map +1 -1
  51. package/resources/simulation-environment.js +51 -0
  52. package/resources/simulation-environment.js.map +1 -1
  53. package/resources/simulation-environment.mjs +51 -0
  54. package/resources/simulation-environment.mjs.map +1 -1
  55. package/resources/simulation-job.d.mts +62 -2
  56. package/resources/simulation-job.d.mts.map +1 -1
  57. package/resources/simulation-job.d.ts +62 -2
  58. package/resources/simulation-job.d.ts.map +1 -1
  59. package/resources/simulation-persona.d.mts +42 -6
  60. package/resources/simulation-persona.d.mts.map +1 -1
  61. package/resources/simulation-persona.d.ts +42 -6
  62. package/resources/simulation-persona.d.ts.map +1 -1
  63. package/resources/simulation-run-plan-job.d.mts +31 -1
  64. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  65. package/resources/simulation-run-plan-job.d.ts +31 -1
  66. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  67. package/resources/simulation-run-plan.d.mts +154 -12
  68. package/resources/simulation-run-plan.d.mts.map +1 -1
  69. package/resources/simulation-run-plan.d.ts +154 -12
  70. package/resources/simulation-run-plan.d.ts.map +1 -1
  71. package/resources/simulation-template.d.mts +10 -0
  72. package/resources/simulation-template.d.mts.map +1 -1
  73. package/resources/simulation-template.d.ts +10 -0
  74. package/resources/simulation-template.d.ts.map +1 -1
  75. package/resources/simulation.d.mts +221 -6
  76. package/resources/simulation.d.mts.map +1 -1
  77. package/resources/simulation.d.ts +221 -6
  78. package/resources/simulation.d.ts.map +1 -1
  79. package/resources/simulation.js +10 -3
  80. package/resources/simulation.js.map +1 -1
  81. package/resources/simulation.mjs +10 -3
  82. package/resources/simulation.mjs.map +1 -1
  83. package/src/client.ts +33 -0
  84. package/src/resources/agent-prompt.ts +183 -0
  85. package/src/resources/call.ts +1 -1
  86. package/src/resources/config.ts +310 -20
  87. package/src/resources/customer-flow-edge-case.ts +180 -9
  88. package/src/resources/customer-flow.ts +3091 -63
  89. package/src/resources/index.ts +15 -0
  90. package/src/resources/simulation-environment.ts +244 -0
  91. package/src/resources/simulation-job.ts +92 -2
  92. package/src/resources/simulation-persona.ts +108 -6
  93. package/src/resources/simulation-run-plan-job.ts +39 -1
  94. package/src/resources/simulation-run-plan.ts +176 -12
  95. package/src/resources/simulation-template.ts +11 -0
  96. package/src/resources/simulation.ts +247 -6
  97. package/src/version.ts +1 -1
  98. package/version.d.mts +1 -1
  99. package/version.d.ts +1 -1
  100. package/version.js +1 -1
  101. package/version.mjs +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"simulation.mjs","sourceRoot":"","sources":["../src/resources/simulation.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,GAAG,CAAC,IAAyB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
1
+ {"version":3,"file":"simulation.mjs","sourceRoot":"","sources":["../src/resources/simulation.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,GAAG,CAAC,IAAyB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -37,6 +37,14 @@ 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';
40
48
  import {
41
49
  Call,
42
50
  CallAppendToolInvocationsParams,
@@ -66,6 +74,8 @@ import {
66
74
  CustomerFlowCreateParams,
67
75
  CustomerFlowCreateResponse,
68
76
  CustomerFlowDeleteResponse,
77
+ CustomerFlowDuplicateParams,
78
+ CustomerFlowDuplicateResponse,
69
79
  CustomerFlowGetByIDResponse,
70
80
  CustomerFlowListParams,
71
81
  CustomerFlowListResponse,
@@ -142,9 +152,14 @@ import {
142
152
  import { Simulation, SimulationRunParams, SimulationRunResponse } from './resources/simulation';
143
153
  import {
144
154
  SimulationEnvironment,
155
+ SimulationEnvironmentCreateParams,
156
+ SimulationEnvironmentCreateResponse,
157
+ SimulationEnvironmentDeleteResponse,
145
158
  SimulationEnvironmentGetByIDResponse,
146
159
  SimulationEnvironmentListParams,
147
160
  SimulationEnvironmentListResponse,
161
+ SimulationEnvironmentUpdateParams,
162
+ SimulationEnvironmentUpdateResponse,
148
163
  } from './resources/simulation-environment';
149
164
  import {
150
165
  SimulationJob,
@@ -925,6 +940,7 @@ export class Roark {
925
940
  customerFlowEdgeCase: API.CustomerFlowEdgeCase = new API.CustomerFlowEdgeCase(this);
926
941
  agent: API.Agent = new API.Agent(this);
927
942
  agentEndpoint: API.AgentEndpoint = new API.AgentEndpoint(this);
943
+ agentPrompt: API.AgentPrompt = new API.AgentPrompt(this);
928
944
  httpRequestDefinition: API.HTTPRequestDefinition = new API.HTTPRequestDefinition(this);
929
945
  webhook: API.Webhook = new API.Webhook(this);
930
946
  config: API.Config = new API.Config(this);
@@ -947,6 +963,7 @@ Roark.CustomerFlow = CustomerFlow;
947
963
  Roark.CustomerFlowEdgeCase = CustomerFlowEdgeCase;
948
964
  Roark.Agent = Agent;
949
965
  Roark.AgentEndpoint = AgentEndpoint;
966
+ Roark.AgentPrompt = AgentPrompt;
950
967
  Roark.HTTPRequestDefinition = HTTPRequestDefinition;
951
968
  Roark.Webhook = Webhook;
952
969
  Roark.Config = Config;
@@ -1063,8 +1080,13 @@ export declare namespace Roark {
1063
1080
 
1064
1081
  export {
1065
1082
  SimulationEnvironment as SimulationEnvironment,
1083
+ type SimulationEnvironmentCreateResponse as SimulationEnvironmentCreateResponse,
1084
+ type SimulationEnvironmentUpdateResponse as SimulationEnvironmentUpdateResponse,
1066
1085
  type SimulationEnvironmentListResponse as SimulationEnvironmentListResponse,
1086
+ type SimulationEnvironmentDeleteResponse as SimulationEnvironmentDeleteResponse,
1067
1087
  type SimulationEnvironmentGetByIDResponse as SimulationEnvironmentGetByIDResponse,
1088
+ type SimulationEnvironmentCreateParams as SimulationEnvironmentCreateParams,
1089
+ type SimulationEnvironmentUpdateParams as SimulationEnvironmentUpdateParams,
1068
1090
  type SimulationEnvironmentListParams as SimulationEnvironmentListParams,
1069
1091
  };
1070
1092
 
@@ -1080,12 +1102,14 @@ export declare namespace Roark {
1080
1102
  type CustomerFlowUpdateResponse as CustomerFlowUpdateResponse,
1081
1103
  type CustomerFlowListResponse as CustomerFlowListResponse,
1082
1104
  type CustomerFlowDeleteResponse as CustomerFlowDeleteResponse,
1105
+ type CustomerFlowDuplicateResponse as CustomerFlowDuplicateResponse,
1083
1106
  type CustomerFlowGetByIDResponse as CustomerFlowGetByIDResponse,
1084
1107
  type CustomerFlowReplaceGraphResponse as CustomerFlowReplaceGraphResponse,
1085
1108
  type CustomerFlowUpdateHappyPathResponse as CustomerFlowUpdateHappyPathResponse,
1086
1109
  type CustomerFlowCreateParams as CustomerFlowCreateParams,
1087
1110
  type CustomerFlowUpdateParams as CustomerFlowUpdateParams,
1088
1111
  type CustomerFlowListParams as CustomerFlowListParams,
1112
+ type CustomerFlowDuplicateParams as CustomerFlowDuplicateParams,
1089
1113
  type CustomerFlowReplaceGraphParams as CustomerFlowReplaceGraphParams,
1090
1114
  type CustomerFlowUpdateHappyPathParams as CustomerFlowUpdateHappyPathParams,
1091
1115
  };
@@ -1124,6 +1148,15 @@ export declare namespace Roark {
1124
1148
  type AgentEndpointListParams as AgentEndpointListParams,
1125
1149
  };
1126
1150
 
1151
+ export {
1152
+ AgentPrompt as AgentPrompt,
1153
+ type AgentPromptUpdateResponse as AgentPromptUpdateResponse,
1154
+ type AgentPromptListResponse as AgentPromptListResponse,
1155
+ type AgentPromptListVersionsResponse as AgentPromptListVersionsResponse,
1156
+ type AgentPromptUpdateParams as AgentPromptUpdateParams,
1157
+ type AgentPromptListVersionsParams as AgentPromptListVersionsParams,
1158
+ };
1159
+
1127
1160
  export {
1128
1161
  HTTPRequestDefinition as HTTPRequestDefinition,
1129
1162
  type HTTPRequestDefinitionCreateResponse as HTTPRequestDefinitionCreateResponse,
@@ -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
+ }
@@ -1148,7 +1148,7 @@ export namespace CallListMetricsResponse {
1148
1148
  * How this property resolved against the transcript. NOT_MENTIONED means the
1149
1149
  * subject never came up and is not a mismatch.
1150
1150
  */
1151
- verdict: 'MATCH' | 'MISMATCH' | 'NOT_MENTIONED';
1151
+ verdict: 'MATCH' | 'MISMATCH' | 'TRANSCRIPTION_ERROR' | 'NOT_MENTIONED';
1152
1152
 
1153
1153
  /**
1154
1154
  * What the transcript said instead. Only present when verdict is MISMATCH.