@cadenya/cadenya 0.66.0 → 0.68.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 (267) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +2 -2
  3. package/client.d.mts +42 -81
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +42 -81
  6. package/client.d.ts.map +1 -1
  7. package/client.js +24 -63
  8. package/client.js.map +1 -1
  9. package/client.mjs +24 -63
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/account.d.mts +18 -22
  13. package/resources/account.d.mts.map +1 -1
  14. package/resources/account.d.ts +18 -22
  15. package/resources/account.d.ts.map +1 -1
  16. package/resources/account.js +2 -6
  17. package/resources/account.js.map +1 -1
  18. package/resources/account.mjs +2 -6
  19. package/resources/account.mjs.map +1 -1
  20. package/resources/agents/agents.d.mts +34 -21
  21. package/resources/agents/agents.d.mts.map +1 -1
  22. package/resources/agents/agents.d.ts +34 -21
  23. package/resources/agents/agents.d.ts.map +1 -1
  24. package/resources/agents/agents.js +17 -16
  25. package/resources/agents/agents.js.map +1 -1
  26. package/resources/agents/agents.mjs +17 -16
  27. package/resources/agents/agents.mjs.map +1 -1
  28. package/resources/agents/feedback.d.mts +15 -15
  29. package/resources/agents/feedback.d.mts.map +1 -1
  30. package/resources/agents/feedback.d.ts +15 -15
  31. package/resources/agents/feedback.d.ts.map +1 -1
  32. package/resources/agents/feedback.js +4 -8
  33. package/resources/agents/feedback.js.map +1 -1
  34. package/resources/agents/feedback.mjs +4 -8
  35. package/resources/agents/feedback.mjs.map +1 -1
  36. package/resources/agents/index.d.mts +1 -1
  37. package/resources/agents/index.d.mts.map +1 -1
  38. package/resources/agents/index.d.ts +1 -1
  39. package/resources/agents/index.d.ts.map +1 -1
  40. package/resources/agents/index.js.map +1 -1
  41. package/resources/agents/index.mjs.map +1 -1
  42. package/resources/agents/schedules.d.mts +44 -26
  43. package/resources/agents/schedules.d.mts.map +1 -1
  44. package/resources/agents/schedules.d.ts +44 -26
  45. package/resources/agents/schedules.d.ts.map +1 -1
  46. package/resources/agents/schedules.js +20 -19
  47. package/resources/agents/schedules.js.map +1 -1
  48. package/resources/agents/schedules.mjs +20 -19
  49. package/resources/agents/schedules.mjs.map +1 -1
  50. package/resources/agents/variations.d.mts +88 -43
  51. package/resources/agents/variations.d.mts.map +1 -1
  52. package/resources/agents/variations.d.ts +88 -43
  53. package/resources/agents/variations.d.ts.map +1 -1
  54. package/resources/agents/variations.js +31 -32
  55. package/resources/agents/variations.js.map +1 -1
  56. package/resources/agents/variations.mjs +31 -32
  57. package/resources/agents/variations.mjs.map +1 -1
  58. package/resources/agents/webhook-deliveries.d.mts +10 -11
  59. package/resources/agents/webhook-deliveries.d.mts.map +1 -1
  60. package/resources/agents/webhook-deliveries.d.ts +10 -11
  61. package/resources/agents/webhook-deliveries.d.ts.map +1 -1
  62. package/resources/agents/webhook-deliveries.js +4 -8
  63. package/resources/agents/webhook-deliveries.js.map +1 -1
  64. package/resources/agents/webhook-deliveries.mjs +4 -8
  65. package/resources/agents/webhook-deliveries.mjs.map +1 -1
  66. package/resources/api-keys.d.mts +48 -28
  67. package/resources/api-keys.d.mts.map +1 -1
  68. package/resources/api-keys.d.ts +48 -28
  69. package/resources/api-keys.d.ts.map +1 -1
  70. package/resources/api-keys.js +21 -17
  71. package/resources/api-keys.js.map +1 -1
  72. package/resources/api-keys.mjs +21 -17
  73. package/resources/api-keys.mjs.map +1 -1
  74. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts +20 -21
  75. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts.map +1 -1
  76. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts +20 -21
  77. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts.map +1 -1
  78. package/resources/bulk-workspace-resources/bulk-workspace-resources.js +13 -17
  79. package/resources/bulk-workspace-resources/bulk-workspace-resources.js.map +1 -1
  80. package/resources/bulk-workspace-resources/bulk-workspace-resources.mjs +13 -17
  81. package/resources/bulk-workspace-resources/bulk-workspace-resources.mjs.map +1 -1
  82. package/resources/bulk-workspace-resources/index.d.mts +1 -1
  83. package/resources/bulk-workspace-resources/index.d.mts.map +1 -1
  84. package/resources/bulk-workspace-resources/index.d.ts +1 -1
  85. package/resources/bulk-workspace-resources/index.d.ts.map +1 -1
  86. package/resources/bulk-workspace-resources/index.js.map +1 -1
  87. package/resources/bulk-workspace-resources/index.mjs.map +1 -1
  88. package/resources/bulk-workspace-resources/results.d.mts +30 -35
  89. package/resources/bulk-workspace-resources/results.d.mts.map +1 -1
  90. package/resources/bulk-workspace-resources/results.d.ts +30 -35
  91. package/resources/bulk-workspace-resources/results.d.ts.map +1 -1
  92. package/resources/bulk-workspace-resources/results.js +6 -10
  93. package/resources/bulk-workspace-resources/results.js.map +1 -1
  94. package/resources/bulk-workspace-resources/results.mjs +6 -10
  95. package/resources/bulk-workspace-resources/results.mjs.map +1 -1
  96. package/resources/index.d.mts +9 -9
  97. package/resources/index.d.mts.map +1 -1
  98. package/resources/index.d.ts +9 -9
  99. package/resources/index.d.ts.map +1 -1
  100. package/resources/index.js.map +1 -1
  101. package/resources/index.mjs +1 -1
  102. package/resources/index.mjs.map +1 -1
  103. package/resources/memory-layers/entries.d.mts +40 -33
  104. package/resources/memory-layers/entries.d.mts.map +1 -1
  105. package/resources/memory-layers/entries.d.ts +40 -33
  106. package/resources/memory-layers/entries.d.ts.map +1 -1
  107. package/resources/memory-layers/entries.js +19 -23
  108. package/resources/memory-layers/entries.js.map +1 -1
  109. package/resources/memory-layers/entries.mjs +19 -23
  110. package/resources/memory-layers/entries.mjs.map +1 -1
  111. package/resources/memory-layers/index.d.mts +1 -1
  112. package/resources/memory-layers/index.d.mts.map +1 -1
  113. package/resources/memory-layers/index.d.ts +1 -1
  114. package/resources/memory-layers/index.d.ts.map +1 -1
  115. package/resources/memory-layers/index.js.map +1 -1
  116. package/resources/memory-layers/index.mjs.map +1 -1
  117. package/resources/memory-layers/memory-layers.d.mts +33 -22
  118. package/resources/memory-layers/memory-layers.d.mts.map +1 -1
  119. package/resources/memory-layers/memory-layers.d.ts +33 -22
  120. package/resources/memory-layers/memory-layers.d.ts.map +1 -1
  121. package/resources/memory-layers/memory-layers.js +17 -20
  122. package/resources/memory-layers/memory-layers.js.map +1 -1
  123. package/resources/memory-layers/memory-layers.mjs +17 -20
  124. package/resources/memory-layers/memory-layers.mjs.map +1 -1
  125. package/resources/models.d.mts +18 -12
  126. package/resources/models.d.mts.map +1 -1
  127. package/resources/models.d.ts +18 -12
  128. package/resources/models.d.ts.map +1 -1
  129. package/resources/models.js +14 -13
  130. package/resources/models.js.map +1 -1
  131. package/resources/models.mjs +14 -13
  132. package/resources/models.mjs.map +1 -1
  133. package/resources/objectives/feedback.d.mts +19 -8
  134. package/resources/objectives/feedback.d.mts.map +1 -1
  135. package/resources/objectives/feedback.d.ts +19 -8
  136. package/resources/objectives/feedback.d.ts.map +1 -1
  137. package/resources/objectives/feedback.js +9 -4
  138. package/resources/objectives/feedback.js.map +1 -1
  139. package/resources/objectives/feedback.mjs +9 -4
  140. package/resources/objectives/feedback.mjs.map +1 -1
  141. package/resources/objectives/index.d.mts +1 -1
  142. package/resources/objectives/index.d.mts.map +1 -1
  143. package/resources/objectives/index.d.ts +1 -1
  144. package/resources/objectives/index.d.ts.map +1 -1
  145. package/resources/objectives/index.js.map +1 -1
  146. package/resources/objectives/index.mjs.map +1 -1
  147. package/resources/objectives/objectives.d.mts +63 -44
  148. package/resources/objectives/objectives.d.mts.map +1 -1
  149. package/resources/objectives/objectives.d.ts +63 -44
  150. package/resources/objectives/objectives.d.ts.map +1 -1
  151. package/resources/objectives/objectives.js +31 -16
  152. package/resources/objectives/objectives.js.map +1 -1
  153. package/resources/objectives/objectives.mjs +31 -16
  154. package/resources/objectives/objectives.mjs.map +1 -1
  155. package/resources/objectives/tasks.d.mts +7 -2
  156. package/resources/objectives/tasks.d.mts.map +1 -1
  157. package/resources/objectives/tasks.d.ts +7 -2
  158. package/resources/objectives/tasks.d.ts.map +1 -1
  159. package/resources/objectives/tasks.js +5 -4
  160. package/resources/objectives/tasks.js.map +1 -1
  161. package/resources/objectives/tasks.mjs +5 -4
  162. package/resources/objectives/tasks.mjs.map +1 -1
  163. package/resources/objectives/tool-calls.d.mts +18 -9
  164. package/resources/objectives/tool-calls.d.mts.map +1 -1
  165. package/resources/objectives/tool-calls.d.ts +18 -9
  166. package/resources/objectives/tool-calls.d.ts.map +1 -1
  167. package/resources/objectives/tool-calls.js +7 -12
  168. package/resources/objectives/tool-calls.js.map +1 -1
  169. package/resources/objectives/tool-calls.mjs +7 -12
  170. package/resources/objectives/tool-calls.mjs.map +1 -1
  171. package/resources/objectives/tools.d.mts +5 -1
  172. package/resources/objectives/tools.d.mts.map +1 -1
  173. package/resources/objectives/tools.d.ts +5 -1
  174. package/resources/objectives/tools.d.ts.map +1 -1
  175. package/resources/objectives/tools.js +3 -2
  176. package/resources/objectives/tools.js.map +1 -1
  177. package/resources/objectives/tools.mjs +3 -2
  178. package/resources/objectives/tools.mjs.map +1 -1
  179. package/resources/search.d.mts +1 -1
  180. package/resources/search.d.mts.map +1 -1
  181. package/resources/search.d.ts +1 -1
  182. package/resources/search.d.ts.map +1 -1
  183. package/resources/search.js +6 -2
  184. package/resources/search.js.map +1 -1
  185. package/resources/search.mjs +6 -2
  186. package/resources/search.mjs.map +1 -1
  187. package/resources/tool-sets/index.d.mts +1 -1
  188. package/resources/tool-sets/index.d.mts.map +1 -1
  189. package/resources/tool-sets/index.d.ts +1 -1
  190. package/resources/tool-sets/index.d.ts.map +1 -1
  191. package/resources/tool-sets/index.js.map +1 -1
  192. package/resources/tool-sets/index.mjs.map +1 -1
  193. package/resources/tool-sets/tool-sets.d.mts +66 -43
  194. package/resources/tool-sets/tool-sets.d.mts.map +1 -1
  195. package/resources/tool-sets/tool-sets.d.ts +66 -43
  196. package/resources/tool-sets/tool-sets.d.ts.map +1 -1
  197. package/resources/tool-sets/tool-sets.js +23 -23
  198. package/resources/tool-sets/tool-sets.js.map +1 -1
  199. package/resources/tool-sets/tool-sets.mjs +23 -23
  200. package/resources/tool-sets/tool-sets.mjs.map +1 -1
  201. package/resources/tool-sets/tools.d.mts +50 -31
  202. package/resources/tool-sets/tools.d.mts.map +1 -1
  203. package/resources/tool-sets/tools.d.ts +50 -31
  204. package/resources/tool-sets/tools.d.ts.map +1 -1
  205. package/resources/tool-sets/tools.js +22 -21
  206. package/resources/tool-sets/tools.js.map +1 -1
  207. package/resources/tool-sets/tools.mjs +22 -21
  208. package/resources/tool-sets/tools.mjs.map +1 -1
  209. package/resources/uploads.d.mts +21 -19
  210. package/resources/uploads.d.mts.map +1 -1
  211. package/resources/uploads.d.ts +21 -19
  212. package/resources/uploads.d.ts.map +1 -1
  213. package/resources/uploads.js +8 -11
  214. package/resources/uploads.js.map +1 -1
  215. package/resources/uploads.mjs +8 -11
  216. package/resources/uploads.mjs.map +1 -1
  217. package/resources/workspace-secrets.d.mts +33 -13
  218. package/resources/workspace-secrets.d.mts.map +1 -1
  219. package/resources/workspace-secrets.d.ts +33 -13
  220. package/resources/workspace-secrets.d.ts.map +1 -1
  221. package/resources/workspace-secrets.js +16 -13
  222. package/resources/workspace-secrets.js.map +1 -1
  223. package/resources/workspace-secrets.mjs +16 -13
  224. package/resources/workspace-secrets.mjs.map +1 -1
  225. package/resources/workspaces.d.mts +2 -6
  226. package/resources/workspaces.d.mts.map +1 -1
  227. package/resources/workspaces.d.ts +2 -6
  228. package/resources/workspaces.d.ts.map +1 -1
  229. package/resources/workspaces.js +2 -6
  230. package/resources/workspaces.js.map +1 -1
  231. package/resources/workspaces.mjs +2 -6
  232. package/resources/workspaces.mjs.map +1 -1
  233. package/src/client.ts +54 -63
  234. package/src/resources/account.ts +18 -22
  235. package/src/resources/agents/agents.ts +49 -24
  236. package/src/resources/agents/feedback.ts +18 -16
  237. package/src/resources/agents/index.ts +2 -0
  238. package/src/resources/agents/schedules.ts +69 -37
  239. package/src/resources/agents/variations.ts +141 -73
  240. package/src/resources/agents/webhook-deliveries.ts +13 -12
  241. package/src/resources/api-keys.ts +67 -32
  242. package/src/resources/bulk-workspace-resources/bulk-workspace-resources.ts +40 -25
  243. package/src/resources/bulk-workspace-resources/index.ts +1 -0
  244. package/src/resources/bulk-workspace-resources/results.ts +33 -36
  245. package/src/resources/index.ts +22 -1
  246. package/src/resources/memory-layers/entries.ts +67 -44
  247. package/src/resources/memory-layers/index.ts +2 -0
  248. package/src/resources/memory-layers/memory-layers.ts +53 -25
  249. package/src/resources/models.ts +28 -13
  250. package/src/resources/objectives/feedback.ts +29 -11
  251. package/src/resources/objectives/index.ts +1 -0
  252. package/src/resources/objectives/objectives.ts +100 -50
  253. package/src/resources/objectives/tasks.ts +16 -5
  254. package/src/resources/objectives/tool-calls.ts +33 -20
  255. package/src/resources/objectives/tools.ts +9 -3
  256. package/src/resources/search.ts +6 -1
  257. package/src/resources/tool-sets/index.ts +2 -0
  258. package/src/resources/tool-sets/tool-sets.ts +88 -50
  259. package/src/resources/tool-sets/tools.ts +75 -42
  260. package/src/resources/uploads.ts +25 -20
  261. package/src/resources/workspace-secrets.ts +60 -19
  262. package/src/resources/workspaces.ts +2 -6
  263. package/src/version.ts +1 -1
  264. package/version.d.mts +1 -1
  265. package/version.d.ts +1 -1
  266. package/version.js +1 -1
  267. package/version.mjs +1 -1
@@ -12,8 +12,11 @@ export class Tasks extends APIResource {
12
12
  * Retrieves a task by ID from an objective
13
13
  */
14
14
  retrieve(id: string, params: TaskRetrieveParams, options?: RequestOptions): APIPromise<ObjectiveTask> {
15
- const { objectiveId } = params;
16
- return this._client.get(path`/v1/objectives/${objectiveId}/tasks/${id}`, options);
15
+ const { workspaceId, objectiveId } = params;
16
+ return this._client.get(
17
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tasks/${id}`,
18
+ options,
19
+ );
17
20
  }
18
21
 
19
22
  /**
@@ -21,11 +24,12 @@ export class Tasks extends APIResource {
21
24
  */
22
25
  list(
23
26
  objectiveID: string,
24
- query: TaskListParams | null | undefined = {},
27
+ params: TaskListParams,
25
28
  options?: RequestOptions,
26
29
  ): PagePromise<ObjectiveTasksCursorPagination, ObjectiveTask> {
30
+ const { workspaceId, ...query } = params;
27
31
  return this._client.getAPIList(
28
- path`/v1/objectives/${objectiveID}/tasks`,
32
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tasks`,
29
33
  CursorPagination<ObjectiveTask>,
30
34
  { query, ...options },
31
35
  );
@@ -75,6 +79,8 @@ export interface ObjectiveTaskData {
75
79
  }
76
80
 
77
81
  export interface TaskRetrieveParams {
82
+ workspaceId: string;
83
+
78
84
  /**
79
85
  * The ID of the objective. Supports "external_id:" prefix for external IDs.
80
86
  */
@@ -83,7 +89,12 @@ export interface TaskRetrieveParams {
83
89
 
84
90
  export interface TaskListParams extends CursorPaginationParams {
85
91
  /**
86
- * Sort order for results
92
+ * Path param
93
+ */
94
+ workspaceId: string;
95
+
96
+ /**
97
+ * Query param: Sort order for results
87
98
  */
88
99
  sortOrder?: string;
89
100
  }
@@ -15,11 +15,12 @@ export class ToolCalls extends APIResource {
15
15
  */
16
16
  list(
17
17
  objectiveID: string,
18
- query: ToolCallListParams | null | undefined = {},
18
+ params: ToolCallListParams,
19
19
  options?: RequestOptions,
20
20
  ): PagePromise<ObjectiveToolCallsCursorPagination, ObjectiveToolCall> {
21
+ const { workspaceId, ...query } = params;
21
22
  return this._client.getAPIList(
22
- path`/v1/objectives/${objectiveID}/tool_calls`,
23
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tool_calls`,
23
24
  CursorPagination<ObjectiveToolCall>,
24
25
  { query, ...options },
25
26
  );
@@ -34,11 +35,11 @@ export class ToolCalls extends APIResource {
34
35
  params: ToolCallApproveParams,
35
36
  options?: RequestOptions,
36
37
  ): APIPromise<ObjectiveToolCall> {
37
- const { objectiveId, ...body } = params;
38
- return this._client.put(path`/v1/objectives/${objectiveId}/tool_calls/${toolCallID}/approve`, {
39
- body,
40
- ...options,
41
- });
38
+ const { workspaceId, objectiveId, ...body } = params;
39
+ return this._client.put(
40
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}/approve`,
41
+ { body, ...options },
42
+ );
42
43
  }
43
44
 
44
45
  /**
@@ -51,11 +52,11 @@ export class ToolCalls extends APIResource {
51
52
  params: ToolCallDenyParams,
52
53
  options?: RequestOptions,
53
54
  ): APIPromise<ObjectiveToolCall> {
54
- const { objectiveId, ...body } = params;
55
- return this._client.put(path`/v1/objectives/${objectiveId}/tool_calls/${toolCallID}/deny`, {
56
- body,
57
- ...options,
58
- });
55
+ const { workspaceId, objectiveId, ...body } = params;
56
+ return this._client.put(
57
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}/deny`,
58
+ { body, ...options },
59
+ );
59
60
  }
60
61
  }
61
62
 
@@ -120,18 +121,18 @@ export interface ObjectiveToolCallData {
120
121
  result?: string;
121
122
 
122
123
  /**
123
- * Profile represents a human user at the account level. Profiles are
124
- * account-scoped resources that can be associated with multiple workspaces through
125
- * the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
124
+ * A profile identifies a user or non-human principal (such as an API key) at the
125
+ * account level. Profiles are account-scoped and can be granted access to multiple
126
+ * workspaces.
126
127
  */
127
128
  statusChangedBy?: AccountAPI.Profile;
128
129
  }
129
130
 
130
131
  export interface ObjectiveToolCallInfo {
131
132
  /**
132
- * Profile represents a human user at the account level. Profiles are
133
- * account-scoped resources that can be associated with multiple workspaces through
134
- * the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
133
+ * A profile identifies a user or non-human principal (such as an API key) at the
134
+ * account level. Profiles are account-scoped and can be granted access to multiple
135
+ * workspaces.
135
136
  */
136
137
  createdBy?: AccountAPI.Profile;
137
138
 
@@ -144,12 +145,17 @@ export interface ObjectiveToolCallInfo {
144
145
 
145
146
  export interface ToolCallListParams extends CursorPaginationParams {
146
147
  /**
147
- * When set to true you may use more of your alloted API rate-limit
148
+ * Path param
149
+ */
150
+ workspaceId: string;
151
+
152
+ /**
153
+ * Query param: When set to true you may use more of your alloted API rate-limit
148
154
  */
149
155
  includeInfo?: boolean;
150
156
 
151
157
  /**
152
- * Filter by tool call status
158
+ * Query param: Filter by tool call status
153
159
  */
154
160
  status?:
155
161
  | 'TOOL_CALL_STATUS_UNSPECIFIED'
@@ -160,6 +166,8 @@ export interface ToolCallListParams extends CursorPaginationParams {
160
166
  }
161
167
 
162
168
  export interface ToolCallApproveParams {
169
+ workspaceId: string;
170
+
163
171
  /**
164
172
  * The ID of the objective. Supports "external_id:" prefix for external IDs.
165
173
  */
@@ -167,6 +175,11 @@ export interface ToolCallApproveParams {
167
175
  }
168
176
 
169
177
  export interface ToolCallDenyParams {
178
+ /**
179
+ * Path param
180
+ */
181
+ workspaceId: string;
182
+
170
183
  /**
171
184
  * Path param: The ID of the objective. Supports "external_id:" prefix for external
172
185
  * IDs.
@@ -13,11 +13,12 @@ export class Tools extends APIResource {
13
13
  */
14
14
  list(
15
15
  objectiveID: string,
16
- query: ToolListParams | null | undefined = {},
16
+ params: ToolListParams,
17
17
  options?: RequestOptions,
18
18
  ): PagePromise<ObjectiveToolsCursorPagination, ObjectiveTool> {
19
+ const { workspaceId, ...query } = params;
19
20
  return this._client.getAPIList(
20
- path`/v1/objectives/${objectiveID}/tools`,
21
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tools`,
21
22
  CursorPagination<ObjectiveTool>,
22
23
  { query, ...options },
23
24
  );
@@ -48,7 +49,12 @@ export interface ObjectiveTool {
48
49
  snapshot?: ToolSetsToolsAPI.Tool;
49
50
  }
50
51
 
51
- export interface ToolListParams extends CursorPaginationParams {}
52
+ export interface ToolListParams extends CursorPaginationParams {
53
+ /**
54
+ * Path param
55
+ */
56
+ workspaceId: string;
57
+ }
52
58
 
53
59
  export declare namespace Tools {
54
60
  export {
@@ -6,16 +6,21 @@ import * as ToolSetsAPI from './tool-sets/tool-sets';
6
6
  import * as ToolsAPI from './tool-sets/tools';
7
7
  import { APIPromise } from '../core/api-promise';
8
8
  import { RequestOptions } from '../internal/request-options';
9
+ import { path } from '../internal/utils/path';
9
10
 
10
11
  export class Search extends APIResource {
11
12
  /**
12
13
  * Searches for tools or tool sets in the workspace
13
14
  */
14
15
  searchToolsOrToolSets(
16
+ workspaceID: string,
15
17
  query: SearchSearchToolsOrToolSetsParams | null | undefined = {},
16
18
  options?: RequestOptions,
17
19
  ): APIPromise<SearchSearchToolsOrToolSetsResponse> {
18
- return this._client.get('/v1/search/tools_or_tool_sets', { query, ...options });
20
+ return this._client.get(path`/v1/workspaces/${workspaceID}/search/tools_or_tool_sets`, {
21
+ query,
22
+ ...options,
23
+ });
19
24
  }
20
25
  }
21
26
 
@@ -15,8 +15,10 @@ export {
15
15
  type ToolSetInfo,
16
16
  type ToolSetSpec,
17
17
  type ToolSetCreateParams,
18
+ type ToolSetRetrieveParams,
18
19
  type ToolSetUpdateParams,
19
20
  type ToolSetListParams,
21
+ type ToolSetDeleteParams,
20
22
  type ToolSetListEventsParams,
21
23
  type ToolSetsCursorPagination,
22
24
  type ToolSetEventsCursorPagination,
@@ -27,15 +27,11 @@ import { RequestOptions } from '../../internal/request-options';
27
27
  import { path } from '../../internal/utils/path';
28
28
 
29
29
  /**
30
- * ToolService manages tool sets and tools at the WORKSPACE level.
31
- * Tool sets group related tools, and tools define specific capabilities for agents.
32
- * All operations are implicitly scoped to the workspace determined by the JWT token.
30
+ * Manage tool sets and the tools they contain. Tool sets group related tools,
31
+ * and tools define specific capabilities available to agents.
33
32
  *
34
- * Note: When a ToolSet has managed=true, only API Key actors can modify its tools.
35
- * Profile actors (humans) are restricted from modifying managed tool sets.
36
- *
37
- * Authentication: Bearer token (JWT)
38
- * Scope: Workspace-level operations
33
+ * When a tool set is managed, only API key actors can modify its tools; human
34
+ * (profile) actors cannot.
39
35
  */
40
36
  export class ToolSets extends APIResource {
41
37
  tools: ToolsAPI.Tools = new ToolsAPI.Tools(this._client);
@@ -43,39 +39,46 @@ export class ToolSets extends APIResource {
43
39
  /**
44
40
  * Creates a new tool set in the workspace
45
41
  */
46
- create(body: ToolSetCreateParams, options?: RequestOptions): APIPromise<ToolSet> {
47
- return this._client.post('/v1/tool_sets', { body, ...options });
42
+ create(workspaceID: string, body: ToolSetCreateParams, options?: RequestOptions): APIPromise<ToolSet> {
43
+ return this._client.post(path`/v1/workspaces/${workspaceID}/tool_sets`, { body, ...options });
48
44
  }
49
45
 
50
46
  /**
51
47
  * Retrieves a tool set by ID from the workspace
52
48
  */
53
- retrieve(id: string, options?: RequestOptions): APIPromise<ToolSet> {
54
- return this._client.get(path`/v1/tool_sets/${id}`, options);
49
+ retrieve(id: string, params: ToolSetRetrieveParams, options?: RequestOptions): APIPromise<ToolSet> {
50
+ const { workspaceId } = params;
51
+ return this._client.get(path`/v1/workspaces/${workspaceId}/tool_sets/${id}`, options);
55
52
  }
56
53
 
57
54
  /**
58
55
  * Updates a tool set in the workspace
59
56
  */
60
- update(id: string, body: ToolSetUpdateParams, options?: RequestOptions): APIPromise<ToolSet> {
61
- return this._client.put(path`/v1/tool_sets/${id}`, { body, ...options });
57
+ update(id: string, params: ToolSetUpdateParams, options?: RequestOptions): APIPromise<ToolSet> {
58
+ const { workspaceId, ...body } = params;
59
+ return this._client.put(path`/v1/workspaces/${workspaceId}/tool_sets/${id}`, { body, ...options });
62
60
  }
63
61
 
64
62
  /**
65
63
  * Lists all tool sets in the workspace
66
64
  */
67
65
  list(
66
+ workspaceID: string,
68
67
  query: ToolSetListParams | null | undefined = {},
69
68
  options?: RequestOptions,
70
69
  ): PagePromise<ToolSetsCursorPagination, ToolSet> {
71
- return this._client.getAPIList('/v1/tool_sets', CursorPagination<ToolSet>, { query, ...options });
70
+ return this._client.getAPIList(path`/v1/workspaces/${workspaceID}/tool_sets`, CursorPagination<ToolSet>, {
71
+ query,
72
+ ...options,
73
+ });
72
74
  }
73
75
 
74
76
  /**
75
77
  * Deletes a tool set in the workspace
76
78
  */
77
- delete(id: string, options?: RequestOptions): APIPromise<void> {
78
- return this._client.delete(path`/v1/tool_sets/${id}`, {
79
+ delete(id: string, params: ToolSetDeleteParams, options?: RequestOptions): APIPromise<void> {
80
+ const { workspaceId } = params;
81
+ return this._client.delete(path`/v1/workspaces/${workspaceId}/tool_sets/${id}`, {
79
82
  ...options,
80
83
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
81
84
  });
@@ -86,13 +89,15 @@ export class ToolSets extends APIResource {
86
89
  */
87
90
  listEvents(
88
91
  toolSetID: string,
89
- query: ToolSetListEventsParams | null | undefined = {},
92
+ params: ToolSetListEventsParams,
90
93
  options?: RequestOptions,
91
94
  ): PagePromise<ToolSetEventsCursorPagination, ToolSetEvent> {
92
- return this._client.getAPIList(path`/v1/tool_sets/${toolSetID}/events`, CursorPagination<ToolSetEvent>, {
93
- query,
94
- ...options,
95
- });
95
+ const { workspaceId, ...query } = params;
96
+ return this._client.getAPIList(
97
+ path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/events`,
98
+ CursorPagination<ToolSetEvent>,
99
+ { query, ...options },
100
+ );
96
101
  }
97
102
  }
98
103
 
@@ -143,46 +148,46 @@ export namespace McpToolFilter {
143
148
  }
144
149
 
145
150
  /**
146
- * SyncCompleted is emitted when a tool set sync operation completes successfully
151
+ * Emitted when a tool set sync operation completes successfully.
147
152
  */
148
153
  export interface SyncCompleted {
149
154
  /**
150
- * Optional message with additional details
155
+ * Optional message with additional details.
151
156
  */
152
157
  message?: string;
153
158
 
154
159
  /**
155
- * Number of tools synced
160
+ * Number of tools synced.
156
161
  */
157
162
  toolsSynced?: number;
158
163
  }
159
164
 
160
165
  /**
161
- * SyncFailed is emitted when a tool set sync operation fails
166
+ * Emitted when a tool set sync operation fails.
162
167
  */
163
168
  export interface SyncFailed {
164
169
  /**
165
- * Indicates this is an error event
170
+ * Indicates this is an error event.
166
171
  */
167
172
  error?: boolean;
168
173
 
169
174
  /**
170
- * Optional error type/code for programmatic handling
175
+ * Optional error type/code for programmatic handling.
171
176
  */
172
177
  errorType?: string;
173
178
 
174
179
  /**
175
- * Error message describing what went wrong
180
+ * Error message describing what went wrong.
176
181
  */
177
182
  message?: string;
178
183
  }
179
184
 
180
185
  /**
181
- * SyncStarted is emitted when a tool set sync operation begins
186
+ * Emitted when a tool set sync operation begins.
182
187
  */
183
188
  export interface SyncStarted {
184
189
  /**
185
- * Timestamp when the sync was initiated
190
+ * Human-readable message describing the start of the sync.
186
191
  */
187
192
  message?: string;
188
193
  }
@@ -251,7 +256,7 @@ export namespace ToolSetAdapterMcp {
251
256
  }
252
257
 
253
258
  /**
254
- * ToolSetEvent represents a single event in the tool set's operation timeline
259
+ * A single event in the tool set's operation timeline.
255
260
  */
256
261
  export interface ToolSetEvent {
257
262
  /**
@@ -261,14 +266,14 @@ export interface ToolSetEvent {
261
266
  metadata: Shared.OperationMetadata;
262
267
 
263
268
  /**
264
- * ToolSetEventData represents the actual event payload for tool set operations
269
+ * Event payload for a tool set operation.
265
270
  */
266
271
  event?: ToolSetEventData;
267
272
 
268
273
  info?: ToolSetEvent.Info;
269
274
 
270
275
  /**
271
- * The tool set this event is associated with
276
+ * The tool set this event is associated with.
272
277
  */
273
278
  toolSetId?: string;
274
279
  }
@@ -276,9 +281,9 @@ export interface ToolSetEvent {
276
281
  export namespace ToolSetEvent {
277
282
  export interface Info {
278
283
  /**
279
- * Profile represents a human user at the account level. Profiles are
280
- * account-scoped resources that can be associated with multiple workspaces through
281
- * the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
284
+ * A profile identifies a user or non-human principal (such as an API key) at the
285
+ * account level. Profiles are account-scoped and can be granted access to multiple
286
+ * workspaces.
282
287
  */
283
288
  createdBy?: AccountAPI.Profile;
284
289
 
@@ -290,26 +295,26 @@ export namespace ToolSetEvent {
290
295
  }
291
296
 
292
297
  /**
293
- * ToolSetEventData represents the actual event payload for tool set operations
298
+ * Event payload for a tool set operation.
294
299
  */
295
300
  export interface ToolSetEventData {
296
301
  /**
297
- * SyncCompleted is emitted when a tool set sync operation completes successfully
302
+ * Emitted when a tool set sync operation completes successfully.
298
303
  */
299
304
  syncCompleted?: SyncCompleted;
300
305
 
301
306
  /**
302
- * SyncFailed is emitted when a tool set sync operation fails
307
+ * Emitted when a tool set sync operation fails.
303
308
  */
304
309
  syncFailed?: SyncFailed;
305
310
 
306
311
  /**
307
- * SyncStarted is emitted when a tool set sync operation begins
312
+ * Emitted when a tool set sync operation begins.
308
313
  */
309
314
  syncStarted?: SyncStarted;
310
315
 
311
316
  /**
312
- * Type of the event (e.g., "sync_started", "sync_completed", "sync_failed")
317
+ * Type of the event (e.g., "sync_started", "sync_completed", "sync_failed").
313
318
  */
314
319
  type?: string;
315
320
  }
@@ -318,9 +323,9 @@ export interface ToolSetInfo {
318
323
  agentCount?: number;
319
324
 
320
325
  /**
321
- * Profile represents a human user at the account level. Profiles are
322
- * account-scoped resources that can be associated with multiple workspaces through
323
- * the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
326
+ * A profile identifies a user or non-human principal (such as an API key) at the
327
+ * account level. Profiles are account-scoped and can be granted access to multiple
328
+ * workspaces.
324
329
  */
325
330
  createdBy?: AccountAPI.Profile;
326
331
 
@@ -346,16 +351,35 @@ export interface ToolSetCreateParams {
346
351
  spec: ToolSetSpec;
347
352
  }
348
353
 
354
+ export interface ToolSetRetrieveParams {
355
+ /**
356
+ * Workspace ID.
357
+ */
358
+ workspaceId: string;
359
+ }
360
+
349
361
  export interface ToolSetUpdateParams {
350
362
  /**
351
- * UpdateResourceMetadata contains the user-provided fields for updating a
352
- * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
353
- * profile_id, created_at) are excluded since they are set by the server.
363
+ * Path param: Workspace ID.
364
+ */
365
+ workspaceId: string;
366
+
367
+ /**
368
+ * Body param: UpdateResourceMetadata contains the user-provided fields for
369
+ * updating a workspace-scoped resource. Read-only fields (id, account_id,
370
+ * workspace_id, profile_id, created_at) are excluded since they are set by the
371
+ * server.
354
372
  */
355
373
  metadata?: Shared.UpdateResourceMetadata;
356
374
 
375
+ /**
376
+ * Body param
377
+ */
357
378
  spec?: ToolSetSpec;
358
379
 
380
+ /**
381
+ * Body param
382
+ */
359
383
  updateMask?: string;
360
384
  }
361
385
 
@@ -386,14 +410,26 @@ export interface ToolSetListParams extends CursorPaginationParams {
386
410
  sortOrder?: string;
387
411
  }
388
412
 
413
+ export interface ToolSetDeleteParams {
414
+ /**
415
+ * Workspace ID.
416
+ */
417
+ workspaceId: string;
418
+ }
419
+
389
420
  export interface ToolSetListEventsParams extends CursorPaginationParams {
390
421
  /**
391
- * When set to true you may use more of your alloted API rate-limit
422
+ * Path param: Workspace ID.
423
+ */
424
+ workspaceId: string;
425
+
426
+ /**
427
+ * Query param: When set to true you may use more of your alloted API rate-limit
392
428
  */
393
429
  includeInfo?: boolean;
394
430
 
395
431
  /**
396
- * Sort order for results (asc or desc by creation time)
432
+ * Query param: Sort order for results (asc or desc by creation time)
397
433
  */
398
434
  sortOrder?: string;
399
435
  }
@@ -417,8 +453,10 @@ export declare namespace ToolSets {
417
453
  type ToolSetsCursorPagination as ToolSetsCursorPagination,
418
454
  type ToolSetEventsCursorPagination as ToolSetEventsCursorPagination,
419
455
  type ToolSetCreateParams as ToolSetCreateParams,
456
+ type ToolSetRetrieveParams as ToolSetRetrieveParams,
420
457
  type ToolSetUpdateParams as ToolSetUpdateParams,
421
458
  type ToolSetListParams as ToolSetListParams,
459
+ type ToolSetDeleteParams as ToolSetDeleteParams,
422
460
  type ToolSetListEventsParams as ToolSetListEventsParams,
423
461
  };
424
462