@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
@@ -9,12 +9,23 @@ import { buildHeaders } from '../../internal/headers';
9
9
  import { RequestOptions } from '../../internal/request-options';
10
10
  import { path } from '../../internal/utils/path';
11
11
 
12
+ /**
13
+ * Manage variations of an agent and their tool, sub-agent, and memory layer assignments.
14
+ */
12
15
  export class Variations extends APIResource {
13
16
  /**
14
17
  * Creates a new variation for an agent
15
18
  */
16
- create(agentID: string, body: VariationCreateParams, options?: RequestOptions): APIPromise<AgentVariation> {
17
- return this._client.post(path`/v1/agents/${agentID}/variations`, { body, ...options });
19
+ create(
20
+ agentID: string,
21
+ params: VariationCreateParams,
22
+ options?: RequestOptions,
23
+ ): APIPromise<AgentVariation> {
24
+ const { workspaceId, ...body } = params;
25
+ return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${agentID}/variations`, {
26
+ body,
27
+ ...options,
28
+ });
18
29
  }
19
30
 
20
31
  /**
@@ -25,16 +36,19 @@ export class Variations extends APIResource {
25
36
  params: VariationRetrieveParams,
26
37
  options?: RequestOptions,
27
38
  ): APIPromise<AgentVariation> {
28
- const { agentId } = params;
29
- return this._client.get(path`/v1/agents/${agentId}/variations/${id}`, options);
39
+ const { workspaceId, agentId } = params;
40
+ return this._client.get(path`/v1/workspaces/${workspaceId}/agents/${agentId}/variations/${id}`, options);
30
41
  }
31
42
 
32
43
  /**
33
44
  * Updates a variation for an agent
34
45
  */
35
46
  update(id: string, params: VariationUpdateParams, options?: RequestOptions): APIPromise<AgentVariation> {
36
- const { agentId, ...body } = params;
37
- return this._client.patch(path`/v1/agents/${agentId}/variations/${id}`, { body, ...options });
47
+ const { workspaceId, agentId, ...body } = params;
48
+ return this._client.patch(path`/v1/workspaces/${workspaceId}/agents/${agentId}/variations/${id}`, {
49
+ body,
50
+ ...options,
51
+ });
38
52
  }
39
53
 
40
54
  /**
@@ -42,21 +56,23 @@ export class Variations extends APIResource {
42
56
  */
43
57
  list(
44
58
  agentID: string,
45
- query: VariationListParams | null | undefined = {},
59
+ params: VariationListParams,
46
60
  options?: RequestOptions,
47
61
  ): PagePromise<AgentVariationsCursorPagination, AgentVariation> {
48
- return this._client.getAPIList(path`/v1/agents/${agentID}/variations`, CursorPagination<AgentVariation>, {
49
- query,
50
- ...options,
51
- });
62
+ const { workspaceId, ...query } = params;
63
+ return this._client.getAPIList(
64
+ path`/v1/workspaces/${workspaceId}/agents/${agentID}/variations`,
65
+ CursorPagination<AgentVariation>,
66
+ { query, ...options },
67
+ );
52
68
  }
53
69
 
54
70
  /**
55
71
  * Deletes a variation from an agent
56
72
  */
57
73
  delete(id: string, params: VariationDeleteParams, options?: RequestOptions): APIPromise<void> {
58
- const { agentId } = params;
59
- return this._client.delete(path`/v1/agents/${agentId}/variations/${id}`, {
74
+ const { workspaceId, agentId } = params;
75
+ return this._client.delete(path`/v1/workspaces/${workspaceId}/agents/${agentId}/variations/${id}`, {
60
76
  ...options,
61
77
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
62
78
  });
@@ -71,11 +87,11 @@ export class Variations extends APIResource {
71
87
  params: VariationAddAssignmentParams,
72
88
  options?: RequestOptions,
73
89
  ): APIPromise<VariationAssignment> {
74
- const { agentId, ...body } = params;
75
- return this._client.post(path`/v1/agents/${agentId}/variations/${variationID}/assignments`, {
76
- body,
77
- ...options,
78
- });
90
+ const { workspaceId, agentId, ...body } = params;
91
+ return this._client.post(
92
+ path`/v1/workspaces/${workspaceId}/agents/${agentId}/variations/${variationID}/assignments`,
93
+ { body, ...options },
94
+ );
79
95
  }
80
96
 
81
97
  /**
@@ -87,11 +103,11 @@ export class Variations extends APIResource {
87
103
  params: VariationAddMemoryLayerParams,
88
104
  options?: RequestOptions,
89
105
  ): APIPromise<VariationMemoryLayerAssignment> {
90
- const { agentId, ...body } = params;
91
- return this._client.post(path`/v1/agents/${agentId}/variations/${variationID}/memory_layer_assignments`, {
92
- body,
93
- ...options,
94
- });
106
+ const { workspaceId, agentId, ...body } = params;
107
+ return this._client.post(
108
+ path`/v1/workspaces/${workspaceId}/agents/${agentId}/variations/${variationID}/memory_layer_assignments`,
109
+ { body, ...options },
110
+ );
95
111
  }
96
112
 
97
113
  /**
@@ -103,11 +119,11 @@ export class Variations extends APIResource {
103
119
  params: VariationRemoveAssignmentParams,
104
120
  options?: RequestOptions,
105
121
  ): APIPromise<void> {
106
- const { agentId, variationId } = params;
107
- return this._client.delete(path`/v1/agents/${agentId}/variations/${variationId}/assignments/${id}`, {
108
- ...options,
109
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
110
- });
122
+ const { workspaceId, agentId, variationId } = params;
123
+ return this._client.delete(
124
+ path`/v1/workspaces/${workspaceId}/agents/${agentId}/variations/${variationId}/assignments/${id}`,
125
+ { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]) },
126
+ );
111
127
  }
112
128
 
113
129
  /**
@@ -119,9 +135,9 @@ export class Variations extends APIResource {
119
135
  params: VariationRemoveMemoryLayerParams,
120
136
  options?: RequestOptions,
121
137
  ): APIPromise<void> {
122
- const { agentId, variationId } = params;
138
+ const { workspaceId, agentId, variationId } = params;
123
139
  return this._client.delete(
124
- path`/v1/agents/${agentId}/variations/${variationId}/memory_layer_assignments/${id}`,
140
+ path`/v1/workspaces/${workspaceId}/agents/${agentId}/variations/${variationId}/memory_layer_assignments/${id}`,
125
141
  { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]) },
126
142
  );
127
143
  }
@@ -134,9 +150,9 @@ export class Variations extends APIResource {
134
150
  params: VariationUpdateMemoryLayerParams,
135
151
  options?: RequestOptions,
136
152
  ): APIPromise<VariationMemoryLayerAssignment> {
137
- const { agentId, variationId, ...body } = params;
153
+ const { workspaceId, agentId, variationId, ...body } = params;
138
154
  return this._client.patch(
139
- path`/v1/agents/${agentId}/variations/${variationId}/memory_layer_assignments/${id}`,
155
+ path`/v1/workspaces/${workspaceId}/agents/${agentId}/variations/${variationId}/memory_layer_assignments/${id}`,
140
156
  { body, ...options },
141
157
  );
142
158
  }
@@ -176,9 +192,9 @@ export interface AgentVariationInfo {
176
192
  assignments?: Array<VariationAssignment>;
177
193
 
178
194
  /**
179
- * Profile represents a human user at the account level. Profiles are
180
- * account-scoped resources that can be associated with multiple workspaces through
181
- * the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
195
+ * A profile identifies a user or non-human principal (such as an API key) at the
196
+ * account level. Profiles are account-scoped and can be granted access to multiple
197
+ * workspaces.
182
198
  */
183
199
  createdBy?: AccountAPI.Profile;
184
200
 
@@ -389,15 +405,14 @@ export interface CompactionConfigToolResultClearingStrategy {
389
405
  }
390
406
 
391
407
  /**
392
- * VariationAssignment is a read-only reference to a single tool, tool set, or
393
- * sub-agent attached to a variation. Clients read the full set of assignments via
408
+ * A read-only reference to a single tool, tool set, or sub-agent attached to a
409
+ * variation. Read the full set of assignments via
394
410
  * `AgentVariationInfo.assignments`; mutations go through the dedicated add/remove
395
- * assignment endpoints under
396
- * /v1/agents/{agent_id}/variations/{variation_id}/assignments.
411
+ * assignment endpoints.
397
412
  *
398
- * The `id` identifies the assignment row itself (not the referenced resource) and
399
- * is the handle used to remove the assignment. It is returned by the add endpoint
400
- * and present on every entry in AgentVariationInfo.assignments.
413
+ * The `id` identifies the assignment itself (not the referenced resource) and is
414
+ * the handle used to remove the assignment. It is returned by the add endpoint and
415
+ * present on every entry in `AgentVariationInfo.assignments`.
401
416
  */
402
417
  export interface VariationAssignment {
403
418
  id?: string;
@@ -470,30 +485,47 @@ export interface VariationMemoryLayerAssignment {
470
485
 
471
486
  export interface VariationCreateParams {
472
487
  /**
473
- * CreateResourceMetadata contains the user-provided fields for creating a
474
- * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
475
- * profile_id, created_at) are excluded since they are set by the server.
488
+ * Path param: Workspace ID.
489
+ */
490
+ workspaceId: string;
491
+
492
+ /**
493
+ * Body param: CreateResourceMetadata contains the user-provided fields for
494
+ * creating a workspace-scoped resource. Read-only fields (id, account_id,
495
+ * workspace_id, profile_id, created_at) are excluded since they are set by the
496
+ * server.
476
497
  */
477
498
  metadata: Shared.CreateResourceMetadata;
478
499
 
479
500
  /**
480
- * AgentVariationSpec defines the operational configuration for a variation
501
+ * Body param: AgentVariationSpec defines the operational configuration for a
502
+ * variation
481
503
  */
482
504
  spec: AgentVariationSpec;
483
505
  }
484
506
 
485
507
  export interface VariationRetrieveParams {
486
508
  /**
487
- * Agent ID (from path). Accepts canonical agent\_… form or external_id:<value>
488
- * form (see common.proto "Path-parameter ID resolution").
509
+ * Workspace ID.
510
+ */
511
+ workspaceId: string;
512
+
513
+ /**
514
+ * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
515
+ * form.
489
516
  */
490
517
  agentId: string;
491
518
  }
492
519
 
493
520
  export interface VariationUpdateParams {
494
521
  /**
495
- * Path param: Agent ID (from path). Accepts canonical agent\_… form or
496
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
522
+ * Path param: Workspace ID.
523
+ */
524
+ workspaceId: string;
525
+
526
+ /**
527
+ * Path param: Agent ID. Accepts the canonical `agent_…` form or the
528
+ * `external_id:<value>` form.
497
529
  */
498
530
  agentId: string;
499
531
 
@@ -519,33 +551,49 @@ export interface VariationUpdateParams {
519
551
 
520
552
  export interface VariationListParams extends CursorPaginationParams {
521
553
  /**
522
- * Filter by bundle_key — return only resources owned by this bundle.
554
+ * Path param: Workspace ID.
555
+ */
556
+ workspaceId: string;
557
+
558
+ /**
559
+ * Query param: Filter by bundle_key — return only resources owned by this bundle.
523
560
  */
524
561
  bundleKey?: string;
525
562
 
526
563
  /**
527
- * When set to true you may use more of your alloted API rate-limit
564
+ * Query param: When true, the `info` field on each returned variation is
565
+ * populated. Requests with this flag count more against your rate limit.
528
566
  */
529
567
  includeInfo?: boolean;
530
568
 
531
569
  /**
532
- * Sort order for results (asc or desc by creation time)
570
+ * Query param: Sort order for results (asc or desc by creation time)
533
571
  */
534
572
  sortOrder?: string;
535
573
  }
536
574
 
537
575
  export interface VariationDeleteParams {
538
576
  /**
539
- * Agent ID (from path). Accepts canonical agent\_… form or external_id:<value>
540
- * form (see common.proto "Path-parameter ID resolution").
577
+ * Workspace ID.
578
+ */
579
+ workspaceId: string;
580
+
581
+ /**
582
+ * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
583
+ * form.
541
584
  */
542
585
  agentId: string;
543
586
  }
544
587
 
545
588
  export interface VariationAddAssignmentParams {
546
589
  /**
547
- * Path param: Agent ID (from path). Accepts canonical agent\_… form or
548
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
590
+ * Path param: Workspace ID.
591
+ */
592
+ workspaceId: string;
593
+
594
+ /**
595
+ * Path param: Agent ID. Accepts the canonical `agent_…` form or the
596
+ * `external_id:<value>` form.
549
597
  */
550
598
  agentId: string;
551
599
 
@@ -567,14 +615,19 @@ export interface VariationAddAssignmentParams {
567
615
 
568
616
  export interface VariationAddMemoryLayerParams {
569
617
  /**
570
- * Path param: Agent ID (from path). Accepts canonical agent\_… form or
571
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
618
+ * Path param: Workspace ID.
619
+ */
620
+ workspaceId: string;
621
+
622
+ /**
623
+ * Path param: Agent ID. Accepts the canonical `agent_…` form or the
624
+ * `external_id:<value>` form.
572
625
  */
573
626
  agentId: string;
574
627
 
575
628
  /**
576
- * Body param: Layer to attach. Accepts canonical memlyr\_… form or
577
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
629
+ * Body param: Layer to attach. Accepts the canonical `memlyr_…` form or the
630
+ * `external_id:<value>` form.
578
631
  */
579
632
  memoryLayerId?: string;
580
633
 
@@ -587,42 +640,57 @@ export interface VariationAddMemoryLayerParams {
587
640
 
588
641
  export interface VariationRemoveAssignmentParams {
589
642
  /**
590
- * Agent ID (from path). Accepts canonical agent\_… form or external_id:<value>
591
- * form (see common.proto "Path-parameter ID resolution").
643
+ * Workspace ID.
644
+ */
645
+ workspaceId: string;
646
+
647
+ /**
648
+ * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
649
+ * form.
592
650
  */
593
651
  agentId: string;
594
652
 
595
653
  /**
596
- * Variation ID (from path). Accepts canonical av\_… form or external_id:<value>
597
- * form (see common.proto "Path-parameter ID resolution").
654
+ * Variation ID. Accepts the canonical `av_…` form or the `external_id:<value>`
655
+ * form.
598
656
  */
599
657
  variationId: string;
600
658
  }
601
659
 
602
660
  export interface VariationRemoveMemoryLayerParams {
603
661
  /**
604
- * Agent ID (from path). Accepts canonical agent\_… form or external_id:<value>
605
- * form (see common.proto "Path-parameter ID resolution").
662
+ * Workspace ID.
663
+ */
664
+ workspaceId: string;
665
+
666
+ /**
667
+ * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
668
+ * form.
606
669
  */
607
670
  agentId: string;
608
671
 
609
672
  /**
610
- * Variation ID (from path). Accepts canonical av\_… form or external_id:<value>
611
- * form (see common.proto "Path-parameter ID resolution").
673
+ * Variation ID. Accepts the canonical `av_…` form or the `external_id:<value>`
674
+ * form.
612
675
  */
613
676
  variationId: string;
614
677
  }
615
678
 
616
679
  export interface VariationUpdateMemoryLayerParams {
617
680
  /**
618
- * Path param: Agent ID (from path). Accepts canonical agent\_… form or
619
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
681
+ * Path param: Workspace ID.
682
+ */
683
+ workspaceId: string;
684
+
685
+ /**
686
+ * Path param: Agent ID. Accepts the canonical `agent_…` form or the
687
+ * `external_id:<value>` form.
620
688
  */
621
689
  agentId: string;
622
690
 
623
691
  /**
624
- * Path param: Variation ID (from path). Accepts canonical av\_… form or
625
- * external_id:<value> form (see common.proto "Path-parameter ID resolution").
692
+ * Path param: Variation ID. Accepts the canonical `av_…` form or the
693
+ * `external_id:<value>` form.
626
694
  */
627
695
  variationId: string;
628
696
 
@@ -7,12 +7,7 @@ import { RequestOptions } from '../../internal/request-options';
7
7
  import { path } from '../../internal/utils/path';
8
8
 
9
9
  /**
10
- * AgentService manages AI agents at the WORKSPACE level.
11
- * Agents are workspace-scoped resources that define AI behavior and tool access.
12
- * All operations are implicitly scoped to the workspace determined by the JWT token.
13
- *
14
- * Authentication: Bearer token (JWT)
15
- * Scope: Workspace-level operations
10
+ * Manage AI agents within a workspace. Agents define AI behavior and tool access.
16
11
  */
17
12
  export class WebhookDeliveries extends APIResource {
18
13
  /**
@@ -20,11 +15,12 @@ export class WebhookDeliveries extends APIResource {
20
15
  */
21
16
  list(
22
17
  agentID: string,
23
- query: WebhookDeliveryListParams | null | undefined = {},
18
+ params: WebhookDeliveryListParams,
24
19
  options?: RequestOptions,
25
20
  ): PagePromise<WebhookDeliveriesCursorPagination, WebhookDelivery> {
21
+ const { workspaceId, ...query } = params;
26
22
  return this._client.getAPIList(
27
- path`/v1/agents/${agentID}/webhook_deliveries`,
23
+ path`/v1/workspaces/${workspaceId}/agents/${agentID}/webhook_deliveries`,
28
24
  CursorPagination<WebhookDelivery>,
29
25
  { query, ...options },
30
26
  );
@@ -35,7 +31,7 @@ export type WebhookDeliveriesCursorPagination = CursorPagination<WebhookDelivery
35
31
 
36
32
  export interface WebhookDelivery {
37
33
  /**
38
- * Webhook delivery data
34
+ * Webhook delivery details.
39
35
  */
40
36
  data: WebhookDeliveryData;
41
37
 
@@ -74,7 +70,7 @@ export interface WebhookDeliveryData {
74
70
  | 'OBJECTIVE_EVENT_TYPE_CANCELLED';
75
71
 
76
72
  /**
77
- * Response details (no response_body to avoid storing large payloads)
73
+ * Response details. The response body is not retained.
78
74
  */
79
75
  httpStatusCode: number;
80
76
 
@@ -115,7 +111,12 @@ export interface WebhookDeliveryData {
115
111
 
116
112
  export interface WebhookDeliveryListParams extends CursorPaginationParams {
117
113
  /**
118
- * Optional filter by event type
114
+ * Path param: Workspace ID.
115
+ */
116
+ workspaceId: string;
117
+
118
+ /**
119
+ * Query param: Optional filter by event type
119
120
  */
120
121
  eventType?:
121
122
  | 'OBJECTIVE_EVENT_TYPE_UNSPECIFIED'
@@ -134,7 +135,7 @@ export interface WebhookDeliveryListParams extends CursorPaginationParams {
134
135
  | 'OBJECTIVE_EVENT_TYPE_CANCELLED';
135
136
 
136
137
  /**
137
- * Optional filter by objective ID
138
+ * Query param: Optional filter by objective ID
138
139
  */
139
140
  objectiveId?: string;
140
141
  }
@@ -10,49 +10,53 @@ import { RequestOptions } from '../internal/request-options';
10
10
  import { path } from '../internal/utils/path';
11
11
 
12
12
  /**
13
- * APIKeyService manages workspace-scoped API Keys.
14
- * Each API key belongs to a single workspace, ensuring isolation between environments.
15
- *
16
- * Authentication: Bearer token (JWT)
17
- * Scope: Workspace-level operations
13
+ * Issue, rotate, and revoke API keys for a workspace. Each API key belongs to
14
+ * exactly one workspace, ensuring isolation between environments.
18
15
  */
19
16
  export class APIKeys extends APIResource {
20
17
  /**
21
18
  * Creates a new API key in the workspace.
22
19
  */
23
- create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey> {
24
- return this._client.post('/v1/api_keys', { body, ...options });
20
+ create(workspaceID: string, body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey> {
21
+ return this._client.post(path`/v1/workspaces/${workspaceID}/api_keys`, { body, ...options });
25
22
  }
26
23
 
27
24
  /**
28
25
  * Retrieves an API key by ID from the workspace
29
26
  */
30
- retrieve(id: string, options?: RequestOptions): APIPromise<APIKey> {
31
- return this._client.get(path`/v1/api_keys/${id}`, options);
27
+ retrieve(id: string, params: APIKeyRetrieveParams, options?: RequestOptions): APIPromise<APIKey> {
28
+ const { workspaceId } = params;
29
+ return this._client.get(path`/v1/workspaces/${workspaceId}/api_keys/${id}`, options);
32
30
  }
33
31
 
34
32
  /**
35
33
  * Updates an API key in the workspace
36
34
  */
37
- update(id: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey> {
38
- return this._client.patch(path`/v1/api_keys/${id}`, { body, ...options });
35
+ update(id: string, params: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey> {
36
+ const { workspaceId, ...body } = params;
37
+ return this._client.patch(path`/v1/workspaces/${workspaceId}/api_keys/${id}`, { body, ...options });
39
38
  }
40
39
 
41
40
  /**
42
41
  * Lists all API keys in the workspace
43
42
  */
44
43
  list(
44
+ workspaceID: string,
45
45
  query: APIKeyListParams | null | undefined = {},
46
46
  options?: RequestOptions,
47
47
  ): PagePromise<APIKeysCursorPagination, APIKey> {
48
- return this._client.getAPIList('/v1/api_keys', CursorPagination<APIKey>, { query, ...options });
48
+ return this._client.getAPIList(path`/v1/workspaces/${workspaceID}/api_keys`, CursorPagination<APIKey>, {
49
+ query,
50
+ ...options,
51
+ });
49
52
  }
50
53
 
51
54
  /**
52
55
  * Deletes an API key from the workspace
53
56
  */
54
- delete(id: string, options?: RequestOptions): APIPromise<void> {
55
- return this._client.delete(path`/v1/api_keys/${id}`, {
57
+ delete(id: string, params: APIKeyDeleteParams, options?: RequestOptions): APIPromise<void> {
58
+ const { workspaceId } = params;
59
+ return this._client.delete(path`/v1/workspaces/${workspaceId}/api_keys/${id}`, {
56
60
  ...options,
57
61
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
58
62
  });
@@ -62,17 +66,17 @@ export class APIKeys extends APIResource {
62
66
  * Rotates an API Key and returns a new token. All previous API Key tokens in use
63
67
  * will be invalidated.
64
68
  */
65
- rotate(id: string, options?: RequestOptions): APIPromise<APIKey> {
66
- return this._client.put(path`/v1/api_keys/${id}/rotate`, options);
69
+ rotate(id: string, params: APIKeyRotateParams, options?: RequestOptions): APIPromise<APIKey> {
70
+ const { workspaceId } = params;
71
+ return this._client.put(path`/v1/workspaces/${workspaceId}/api_keys/${id}/rotate`, options);
67
72
  }
68
73
  }
69
74
 
70
75
  export type APIKeysCursorPagination = CursorPagination<APIKey>;
71
76
 
72
77
  /**
73
- * APIKey represents a workspace-scoped API key. Each API key belongs to exactly
74
- * one workspace, ensuring workspace isolation. Authentication is handled via
75
- * Cadenya-issued JWTs signed with the key's own signing secret.
78
+ * An API key scoped to a single workspace. The key's token is used to authenticate
79
+ * requests against that workspace's resources.
76
80
  */
77
81
  export interface APIKey {
78
82
  /**
@@ -81,7 +85,7 @@ export interface APIKey {
81
85
  metadata: Shared.ResourceMetadata;
82
86
 
83
87
  /**
84
- * APIKeySpec contains the API Key-specific fields
88
+ * Configuration for an API key.
85
89
  */
86
90
  spec: APIKeySpec;
87
91
 
@@ -90,24 +94,25 @@ export interface APIKey {
90
94
 
91
95
  export interface APIKeyInfo {
92
96
  /**
93
- * Profile represents a human user at the account level. Profiles are
94
- * account-scoped resources that can be associated with multiple workspaces through
95
- * the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
97
+ * A profile identifies a user or non-human principal (such as an API key) at the
98
+ * account level. Profiles are account-scoped and can be granted access to multiple
99
+ * workspaces.
96
100
  */
97
101
  createdBy?: AccountAPI.Profile;
98
102
  }
99
103
 
100
104
  /**
101
- * APIKeySpec contains the API Key-specific fields
105
+ * Configuration for an API key.
102
106
  */
103
107
  export interface APIKeySpec {
104
108
  /**
105
- * The actual token value (only returned on creation and rotation, read-only)
109
+ * The bearer token used to authenticate as this API key. Returned only on creation
110
+ * and rotation; subsequent reads omit this field.
106
111
  */
107
112
  token?: string;
108
113
 
109
114
  /**
110
- * Description of what this API Key is used for
115
+ * Free-form description of what this API key is used for.
111
116
  */
112
117
  description?: string;
113
118
  }
@@ -121,26 +126,39 @@ export interface APIKeyCreateParams {
121
126
  metadata: Shared.CreateResourceMetadata;
122
127
 
123
128
  /**
124
- * APIKeySpec contains the API Key-specific fields
129
+ * Configuration for an API key.
125
130
  */
126
131
  spec: APIKeySpec;
127
132
  }
128
133
 
134
+ export interface APIKeyRetrieveParams {
135
+ /**
136
+ * The workspace the API key belongs to.
137
+ */
138
+ workspaceId: string;
139
+ }
140
+
129
141
  export interface APIKeyUpdateParams {
130
142
  /**
131
- * UpdateResourceMetadata contains the user-provided fields for updating a
132
- * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
133
- * profile_id, created_at) are excluded since they are set by the server.
143
+ * Path param: The workspace the API key belongs to.
144
+ */
145
+ workspaceId: string;
146
+
147
+ /**
148
+ * Body param: UpdateResourceMetadata contains the user-provided fields for
149
+ * updating a workspace-scoped resource. Read-only fields (id, account_id,
150
+ * workspace_id, profile_id, created_at) are excluded since they are set by the
151
+ * server.
134
152
  */
135
153
  metadata?: Shared.UpdateResourceMetadata;
136
154
 
137
155
  /**
138
- * APIKeySpec contains the API Key-specific fields
156
+ * Body param: Configuration for an API key.
139
157
  */
140
158
  spec?: APIKeySpec;
141
159
 
142
160
  /**
143
- * Fields to update
161
+ * Body param: Fields to update.
144
162
  */
145
163
  updateMask?: string;
146
164
  }
@@ -172,6 +190,20 @@ export interface APIKeyListParams extends CursorPaginationParams {
172
190
  sortOrder?: string;
173
191
  }
174
192
 
193
+ export interface APIKeyDeleteParams {
194
+ /**
195
+ * The workspace the API key belongs to.
196
+ */
197
+ workspaceId: string;
198
+ }
199
+
200
+ export interface APIKeyRotateParams {
201
+ /**
202
+ * The workspace the API key belongs to.
203
+ */
204
+ workspaceId: string;
205
+ }
206
+
175
207
  export declare namespace APIKeys {
176
208
  export {
177
209
  type APIKey as APIKey,
@@ -179,7 +211,10 @@ export declare namespace APIKeys {
179
211
  type APIKeySpec as APIKeySpec,
180
212
  type APIKeysCursorPagination as APIKeysCursorPagination,
181
213
  type APIKeyCreateParams as APIKeyCreateParams,
214
+ type APIKeyRetrieveParams as APIKeyRetrieveParams,
182
215
  type APIKeyUpdateParams as APIKeyUpdateParams,
183
216
  type APIKeyListParams as APIKeyListParams,
217
+ type APIKeyDeleteParams as APIKeyDeleteParams,
218
+ type APIKeyRotateParams as APIKeyRotateParams,
184
219
  };
185
220
  }