@cadenya/cadenya 0.124.0 → 0.126.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 (278) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +18 -7
  3. package/client.d.mts +17 -11
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +17 -11
  6. package/client.d.ts.map +1 -1
  7. package/client.js +7 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +7 -3
  10. package/client.mjs.map +1 -1
  11. package/internal/request-options.d.mts +1 -1
  12. package/internal/request-options.d.ts +1 -1
  13. package/package.json +1 -1
  14. package/resources/agents/agents.d.mts +115 -28
  15. package/resources/agents/agents.d.mts.map +1 -1
  16. package/resources/agents/agents.d.ts +115 -28
  17. package/resources/agents/agents.d.ts.map +1 -1
  18. package/resources/agents/agents.js +93 -13
  19. package/resources/agents/agents.js.map +1 -1
  20. package/resources/agents/agents.mjs +93 -13
  21. package/resources/agents/agents.mjs.map +1 -1
  22. package/resources/agents/feedback.d.mts +13 -2
  23. package/resources/agents/feedback.d.mts.map +1 -1
  24. package/resources/agents/feedback.d.ts +13 -2
  25. package/resources/agents/feedback.d.ts.map +1 -1
  26. package/resources/agents/feedback.js +13 -2
  27. package/resources/agents/feedback.js.map +1 -1
  28. package/resources/agents/feedback.mjs +13 -2
  29. package/resources/agents/feedback.mjs.map +1 -1
  30. package/resources/agents/index.d.mts +1 -1
  31. package/resources/agents/index.d.mts.map +1 -1
  32. package/resources/agents/index.d.ts +1 -1
  33. package/resources/agents/index.d.ts.map +1 -1
  34. package/resources/agents/index.js.map +1 -1
  35. package/resources/agents/index.mjs.map +1 -1
  36. package/resources/agents/schedules.d.mts +100 -52
  37. package/resources/agents/schedules.d.mts.map +1 -1
  38. package/resources/agents/schedules.d.ts +100 -52
  39. package/resources/agents/schedules.d.ts.map +1 -1
  40. package/resources/agents/schedules.js +99 -21
  41. package/resources/agents/schedules.js.map +1 -1
  42. package/resources/agents/schedules.mjs +99 -21
  43. package/resources/agents/schedules.mjs.map +1 -1
  44. package/resources/agents/variations.d.mts +252 -105
  45. package/resources/agents/variations.d.mts.map +1 -1
  46. package/resources/agents/variations.d.ts +252 -105
  47. package/resources/agents/variations.d.ts.map +1 -1
  48. package/resources/agents/variations.js +138 -27
  49. package/resources/agents/variations.js.map +1 -1
  50. package/resources/agents/variations.mjs +138 -27
  51. package/resources/agents/variations.mjs.map +1 -1
  52. package/resources/agents/webhook-deliveries.d.mts +13 -2
  53. package/resources/agents/webhook-deliveries.d.mts.map +1 -1
  54. package/resources/agents/webhook-deliveries.d.ts +13 -2
  55. package/resources/agents/webhook-deliveries.d.ts.map +1 -1
  56. package/resources/agents/webhook-deliveries.js +13 -2
  57. package/resources/agents/webhook-deliveries.js.map +1 -1
  58. package/resources/agents/webhook-deliveries.mjs +13 -2
  59. package/resources/agents/webhook-deliveries.mjs.map +1 -1
  60. package/resources/ai-provider-keys.d.mts +125 -110
  61. package/resources/ai-provider-keys.d.mts.map +1 -1
  62. package/resources/ai-provider-keys.d.ts +125 -110
  63. package/resources/ai-provider-keys.d.ts.map +1 -1
  64. package/resources/ai-provider-keys.js +11 -9
  65. package/resources/ai-provider-keys.js.map +1 -1
  66. package/resources/ai-provider-keys.mjs +11 -9
  67. package/resources/ai-provider-keys.mjs.map +1 -1
  68. package/resources/api-keys.d.mts +28 -20
  69. package/resources/api-keys.d.mts.map +1 -1
  70. package/resources/api-keys.d.ts +28 -20
  71. package/resources/api-keys.d.ts.map +1 -1
  72. package/resources/api-keys.js +14 -12
  73. package/resources/api-keys.js.map +1 -1
  74. package/resources/api-keys.mjs +14 -12
  75. package/resources/api-keys.mjs.map +1 -1
  76. package/resources/index.d.mts +4 -4
  77. package/resources/index.d.mts.map +1 -1
  78. package/resources/index.d.ts +4 -4
  79. package/resources/index.d.ts.map +1 -1
  80. package/resources/index.js.map +1 -1
  81. package/resources/index.mjs.map +1 -1
  82. package/resources/memory-layers/entries.d.mts +27 -30
  83. package/resources/memory-layers/entries.d.mts.map +1 -1
  84. package/resources/memory-layers/entries.d.ts +27 -30
  85. package/resources/memory-layers/entries.d.ts.map +1 -1
  86. package/resources/memory-layers/entries.js +12 -12
  87. package/resources/memory-layers/entries.js.map +1 -1
  88. package/resources/memory-layers/entries.mjs +12 -12
  89. package/resources/memory-layers/entries.mjs.map +1 -1
  90. package/resources/memory-layers/index.d.mts +1 -1
  91. package/resources/memory-layers/index.d.mts.map +1 -1
  92. package/resources/memory-layers/index.d.ts +1 -1
  93. package/resources/memory-layers/index.d.ts.map +1 -1
  94. package/resources/memory-layers/index.js.map +1 -1
  95. package/resources/memory-layers/index.mjs.map +1 -1
  96. package/resources/memory-layers/memory-layers.d.mts +34 -22
  97. package/resources/memory-layers/memory-layers.d.mts.map +1 -1
  98. package/resources/memory-layers/memory-layers.d.ts +34 -22
  99. package/resources/memory-layers/memory-layers.d.ts.map +1 -1
  100. package/resources/memory-layers/memory-layers.js +11 -9
  101. package/resources/memory-layers/memory-layers.js.map +1 -1
  102. package/resources/memory-layers/memory-layers.mjs +11 -9
  103. package/resources/memory-layers/memory-layers.mjs.map +1 -1
  104. package/resources/models.d.mts +32 -24
  105. package/resources/models.d.mts.map +1 -1
  106. package/resources/models.d.ts +32 -24
  107. package/resources/models.d.ts.map +1 -1
  108. package/resources/models.js +10 -8
  109. package/resources/models.js.map +1 -1
  110. package/resources/models.mjs +10 -8
  111. package/resources/models.mjs.map +1 -1
  112. package/resources/objectives/feedback.d.mts +27 -3
  113. package/resources/objectives/feedback.d.mts.map +1 -1
  114. package/resources/objectives/feedback.d.ts +27 -3
  115. package/resources/objectives/feedback.d.ts.map +1 -1
  116. package/resources/objectives/feedback.js +27 -3
  117. package/resources/objectives/feedback.js.map +1 -1
  118. package/resources/objectives/feedback.mjs +27 -3
  119. package/resources/objectives/feedback.mjs.map +1 -1
  120. package/resources/objectives/index.d.mts +2 -2
  121. package/resources/objectives/index.d.mts.map +1 -1
  122. package/resources/objectives/index.d.ts +2 -2
  123. package/resources/objectives/index.d.ts.map +1 -1
  124. package/resources/objectives/index.js.map +1 -1
  125. package/resources/objectives/index.mjs.map +1 -1
  126. package/resources/objectives/objectives.d.mts +273 -102
  127. package/resources/objectives/objectives.d.mts.map +1 -1
  128. package/resources/objectives/objectives.d.ts +273 -102
  129. package/resources/objectives/objectives.d.ts.map +1 -1
  130. package/resources/objectives/objectives.js +112 -17
  131. package/resources/objectives/objectives.js.map +1 -1
  132. package/resources/objectives/objectives.mjs +112 -17
  133. package/resources/objectives/objectives.mjs.map +1 -1
  134. package/resources/objectives/tasks.d.mts +25 -8
  135. package/resources/objectives/tasks.d.mts.map +1 -1
  136. package/resources/objectives/tasks.d.ts +25 -8
  137. package/resources/objectives/tasks.d.ts.map +1 -1
  138. package/resources/objectives/tasks.js +26 -5
  139. package/resources/objectives/tasks.js.map +1 -1
  140. package/resources/objectives/tasks.mjs +26 -5
  141. package/resources/objectives/tasks.mjs.map +1 -1
  142. package/resources/objectives/tool-calls.d.mts +99 -42
  143. package/resources/objectives/tool-calls.d.mts.map +1 -1
  144. package/resources/objectives/tool-calls.d.ts +99 -42
  145. package/resources/objectives/tool-calls.d.ts.map +1 -1
  146. package/resources/objectives/tool-calls.js +73 -14
  147. package/resources/objectives/tool-calls.js.map +1 -1
  148. package/resources/objectives/tool-calls.mjs +73 -14
  149. package/resources/objectives/tool-calls.mjs.map +1 -1
  150. package/resources/objectives/tools.d.mts +13 -2
  151. package/resources/objectives/tools.d.mts.map +1 -1
  152. package/resources/objectives/tools.d.ts +13 -2
  153. package/resources/objectives/tools.d.ts.map +1 -1
  154. package/resources/objectives/tools.js +13 -2
  155. package/resources/objectives/tools.js.map +1 -1
  156. package/resources/objectives/tools.mjs +13 -2
  157. package/resources/objectives/tools.mjs.map +1 -1
  158. package/resources/search.d.mts +11 -2
  159. package/resources/search.d.mts.map +1 -1
  160. package/resources/search.d.ts +11 -2
  161. package/resources/search.d.ts.map +1 -1
  162. package/resources/search.js +3 -2
  163. package/resources/search.js.map +1 -1
  164. package/resources/search.mjs +3 -2
  165. package/resources/search.mjs.map +1 -1
  166. package/resources/tool-sets/index.d.mts +2 -2
  167. package/resources/tool-sets/index.d.mts.map +1 -1
  168. package/resources/tool-sets/index.d.ts +2 -2
  169. package/resources/tool-sets/index.d.ts.map +1 -1
  170. package/resources/tool-sets/index.js.map +1 -1
  171. package/resources/tool-sets/index.mjs.map +1 -1
  172. package/resources/tool-sets/secrets.d.mts +9 -24
  173. package/resources/tool-sets/secrets.d.mts.map +1 -1
  174. package/resources/tool-sets/secrets.d.ts +9 -24
  175. package/resources/tool-sets/secrets.d.ts.map +1 -1
  176. package/resources/tool-sets/secrets.js +12 -12
  177. package/resources/tool-sets/secrets.js.map +1 -1
  178. package/resources/tool-sets/secrets.mjs +12 -12
  179. package/resources/tool-sets/secrets.mjs.map +1 -1
  180. package/resources/tool-sets/tool-sets.d.mts +149 -64
  181. package/resources/tool-sets/tool-sets.d.mts.map +1 -1
  182. package/resources/tool-sets/tool-sets.d.ts +149 -64
  183. package/resources/tool-sets/tool-sets.d.ts.map +1 -1
  184. package/resources/tool-sets/tool-sets.js +17 -15
  185. package/resources/tool-sets/tool-sets.js.map +1 -1
  186. package/resources/tool-sets/tool-sets.mjs +17 -15
  187. package/resources/tool-sets/tool-sets.mjs.map +1 -1
  188. package/resources/tool-sets/tools.d.mts +33 -43
  189. package/resources/tool-sets/tools.d.mts.map +1 -1
  190. package/resources/tool-sets/tools.d.ts +33 -43
  191. package/resources/tool-sets/tools.d.ts.map +1 -1
  192. package/resources/tool-sets/tools.js +18 -18
  193. package/resources/tool-sets/tools.js.map +1 -1
  194. package/resources/tool-sets/tools.mjs +18 -18
  195. package/resources/tool-sets/tools.mjs.map +1 -1
  196. package/resources/uploads.d.mts +14 -6
  197. package/resources/uploads.d.mts.map +1 -1
  198. package/resources/uploads.d.ts +14 -6
  199. package/resources/uploads.d.ts.map +1 -1
  200. package/resources/uploads.js +5 -4
  201. package/resources/uploads.js.map +1 -1
  202. package/resources/uploads.mjs +5 -4
  203. package/resources/uploads.mjs.map +1 -1
  204. package/resources/workspace-admin/index.d.mts +1 -1
  205. package/resources/workspace-admin/index.d.mts.map +1 -1
  206. package/resources/workspace-admin/index.d.ts +1 -1
  207. package/resources/workspace-admin/index.d.ts.map +1 -1
  208. package/resources/workspace-admin/index.js.map +1 -1
  209. package/resources/workspace-admin/index.mjs.map +1 -1
  210. package/resources/workspace-admin/members.d.mts +41 -6
  211. package/resources/workspace-admin/members.d.mts.map +1 -1
  212. package/resources/workspace-admin/members.d.ts +41 -6
  213. package/resources/workspace-admin/members.d.ts.map +1 -1
  214. package/resources/workspace-admin/members.js +34 -6
  215. package/resources/workspace-admin/members.js.map +1 -1
  216. package/resources/workspace-admin/members.mjs +34 -6
  217. package/resources/workspace-admin/members.mjs.map +1 -1
  218. package/resources/workspace-admin/profiles.d.mts +8 -0
  219. package/resources/workspace-admin/profiles.d.mts.map +1 -1
  220. package/resources/workspace-admin/profiles.d.ts +8 -0
  221. package/resources/workspace-admin/profiles.d.ts.map +1 -1
  222. package/resources/workspace-admin/profiles.js +8 -0
  223. package/resources/workspace-admin/profiles.js.map +1 -1
  224. package/resources/workspace-admin/profiles.mjs +8 -0
  225. package/resources/workspace-admin/profiles.mjs.map +1 -1
  226. package/resources/workspace-admin/workspace-admin.d.mts +65 -9
  227. package/resources/workspace-admin/workspace-admin.d.mts.map +1 -1
  228. package/resources/workspace-admin/workspace-admin.d.ts +65 -9
  229. package/resources/workspace-admin/workspace-admin.d.ts.map +1 -1
  230. package/resources/workspace-admin/workspace-admin.js +46 -6
  231. package/resources/workspace-admin/workspace-admin.js.map +1 -1
  232. package/resources/workspace-admin/workspace-admin.mjs +46 -6
  233. package/resources/workspace-admin/workspace-admin.mjs.map +1 -1
  234. package/resources/workspace-secrets.d.mts +27 -15
  235. package/resources/workspace-secrets.d.mts.map +1 -1
  236. package/resources/workspace-secrets.d.ts +27 -15
  237. package/resources/workspace-secrets.d.ts.map +1 -1
  238. package/resources/workspace-secrets.js +11 -9
  239. package/resources/workspace-secrets.js.map +1 -1
  240. package/resources/workspace-secrets.mjs +11 -9
  241. package/resources/workspace-secrets.mjs.map +1 -1
  242. package/src/client.ts +102 -5
  243. package/src/internal/request-options.ts +1 -1
  244. package/src/resources/agents/agents.ts +147 -37
  245. package/src/resources/agents/feedback.ts +14 -3
  246. package/src/resources/agents/index.ts +6 -0
  247. package/src/resources/agents/schedules.ts +143 -71
  248. package/src/resources/agents/variations.ts +319 -125
  249. package/src/resources/agents/webhook-deliveries.ts +14 -3
  250. package/src/resources/ai-provider-keys.ts +155 -127
  251. package/src/resources/api-keys.ts +48 -29
  252. package/src/resources/index.ts +44 -1
  253. package/src/resources/memory-layers/entries.ts +56 -40
  254. package/src/resources/memory-layers/index.ts +2 -0
  255. package/src/resources/memory-layers/memory-layers.ts +53 -30
  256. package/src/resources/models.ts +46 -31
  257. package/src/resources/objectives/feedback.ts +29 -5
  258. package/src/resources/objectives/index.ts +26 -0
  259. package/src/resources/objectives/objectives.ts +373 -125
  260. package/src/resources/objectives/tasks.ts +33 -12
  261. package/src/resources/objectives/tool-calls.ts +123 -46
  262. package/src/resources/objectives/tools.ts +14 -3
  263. package/src/resources/search.ts +14 -4
  264. package/src/resources/tool-sets/index.ts +23 -3
  265. package/src/resources/tool-sets/secrets.ts +32 -35
  266. package/src/resources/tool-sets/tool-sets.ts +239 -79
  267. package/src/resources/tool-sets/tools.ts +79 -61
  268. package/src/resources/uploads.ts +22 -8
  269. package/src/resources/workspace-admin/index.ts +2 -0
  270. package/src/resources/workspace-admin/members.ts +53 -12
  271. package/src/resources/workspace-admin/profiles.ts +8 -0
  272. package/src/resources/workspace-admin/workspace-admin.ts +80 -11
  273. package/src/resources/workspace-secrets.ts +40 -25
  274. package/src/version.ts +1 -1
  275. package/version.d.mts +1 -1
  276. package/version.d.ts +1 -1
  277. package/version.js +1 -1
  278. package/version.mjs +1 -1
@@ -21,7 +21,7 @@ export class Tools extends APIResource {
21
21
  * Creates a new tool in the tool set
22
22
  */
23
23
  create(toolSetID: string, params: ToolCreateParams, options?: RequestOptions): APIPromise<Tool> {
24
- const { workspaceId, ...body } = params;
24
+ const { workspaceId = this._client.workspaceID, ...body } = params;
25
25
  return this._client.post(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/tools`, {
26
26
  body,
27
27
  ...options,
@@ -31,17 +31,27 @@ export class Tools extends APIResource {
31
31
  /**
32
32
  * Retrieves a tool by ID from the workspace
33
33
  */
34
- retrieve(id: string, params: ToolRetrieveParams, options?: RequestOptions): APIPromise<Tool> {
35
- const { workspaceId, toolSetId } = params;
36
- return this._client.get(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetId}/tools/${id}`, options);
34
+ retrieve(
35
+ toolSetID: string,
36
+ id: string,
37
+ params: ToolRetrieveParams | null | undefined = {},
38
+ options?: RequestOptions,
39
+ ): APIPromise<Tool> {
40
+ const { workspaceId = this._client.workspaceID } = params ?? {};
41
+ return this._client.get(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/tools/${id}`, options);
37
42
  }
38
43
 
39
44
  /**
40
45
  * Updates a tool in the tool set
41
46
  */
42
- update(id: string, params: ToolUpdateParams, options?: RequestOptions): APIPromise<Tool> {
43
- const { workspaceId, toolSetId, ...body } = params;
44
- return this._client.patch(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetId}/tools/${id}`, {
47
+ update(
48
+ toolSetID: string,
49
+ id: string,
50
+ params: ToolUpdateParams,
51
+ options?: RequestOptions,
52
+ ): APIPromise<Tool> {
53
+ const { workspaceId = this._client.workspaceID, ...body } = params;
54
+ return this._client.patch(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/tools/${id}`, {
45
55
  body,
46
56
  ...options,
47
57
  });
@@ -52,10 +62,10 @@ export class Tools extends APIResource {
52
62
  */
53
63
  list(
54
64
  toolSetID: string,
55
- params: ToolListParams,
65
+ params: ToolListParams | null | undefined = {},
56
66
  options?: RequestOptions,
57
67
  ): PagePromise<ToolsCursorPagination, Tool> {
58
- const { workspaceId, ...query } = params;
68
+ const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
59
69
  return this._client.getAPIList(
60
70
  path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/tools`,
61
71
  CursorPagination<Tool>,
@@ -66,9 +76,14 @@ export class Tools extends APIResource {
66
76
  /**
67
77
  * Deletes a tool in the tool set
68
78
  */
69
- delete(id: string, params: ToolDeleteParams, options?: RequestOptions): APIPromise<void> {
70
- const { workspaceId, toolSetId } = params;
71
- return this._client.delete(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetId}/tools/${id}`, {
79
+ delete(
80
+ toolSetID: string,
81
+ id: string,
82
+ params: ToolDeleteParams | null | undefined = {},
83
+ options?: RequestOptions,
84
+ ): APIPromise<void> {
85
+ const { workspaceId = this._client.workspaceID } = params ?? {};
86
+ return this._client.delete(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/tools/${id}`, {
72
87
  ...options,
73
88
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
74
89
  });
@@ -78,9 +93,9 @@ export class Tools extends APIResource {
78
93
  * Transitions a tool to STATE_OMITTED, excluding it from agent use. Fails if the
79
94
  * tool is currently assigned to agent variations.
80
95
  */
81
- omit(id: string, params: ToolOmitParams, options?: RequestOptions): APIPromise<Tool> {
82
- const { workspaceId, toolSetId, ...body } = params;
83
- return this._client.post(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetId}/tools/${id}:omit`, {
96
+ omit(toolSetID: string, id: string, params: ToolOmitParams, options?: RequestOptions): APIPromise<Tool> {
97
+ const { workspaceId = this._client.workspaceID, ...body } = params;
98
+ return this._client.post(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/tools/${id}:omit`, {
84
99
  body,
85
100
  ...options,
86
101
  });
@@ -90,9 +105,14 @@ export class Tools extends APIResource {
90
105
  * Transitions an omitted tool back to STATE_AVAILABLE. For managed tool sets, the
91
106
  * next sync may omit the tool again if its filters still exclude it.
92
107
  */
93
- restore(id: string, params: ToolRestoreParams, options?: RequestOptions): APIPromise<Tool> {
94
- const { workspaceId, toolSetId, ...body } = params;
95
- return this._client.post(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetId}/tools/${id}:restore`, {
108
+ restore(
109
+ toolSetID: string,
110
+ id: string,
111
+ params: ToolRestoreParams,
112
+ options?: RequestOptions,
113
+ ): APIPromise<Tool> {
114
+ const { workspaceId = this._client.workspaceID, ...body } = params;
115
+ return this._client.post(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/tools/${id}:restore`, {
96
116
  body,
97
117
  ...options,
98
118
  });
@@ -125,7 +145,7 @@ export interface ConfigHTTP {
125
145
  requestBodyTemplate?: string;
126
146
  }
127
147
 
128
- export interface ConfigMcp {
148
+ export interface ConfigMCP {
129
149
  /**
130
150
  * Behavior hints synced from the MCP server's tool definition (ToolAnnotations in
131
151
  * the MCP specification). All hints are advisory: servers are not required to send
@@ -133,7 +153,7 @@ export interface ConfigMcp {
133
153
  * keep the MCP spec defaults (destructiveHint and openWorldHint default to true;
134
154
  * readOnlyHint and idempotentHint default to false).
135
155
  */
136
- annotations?: McpAnnotations;
156
+ annotations?: MCPAnnotations;
137
157
  }
138
158
 
139
159
  export interface ConfigOpenAPI {
@@ -149,7 +169,7 @@ export interface ConfigOpenAPI {
149
169
  * keep the MCP spec defaults (destructiveHint and openWorldHint default to true;
150
170
  * readOnlyHint and idempotentHint default to false).
151
171
  */
152
- export interface McpAnnotations {
172
+ export interface MCPAnnotations {
153
173
  /**
154
174
  * If true, the tool may perform destructive updates to its environment. Only
155
175
  * meaningful when read_only_hint is false.
@@ -252,26 +272,46 @@ export interface ToolSpec {
252
272
  * the tool is called. For example, if the tool is an HTTP tool, the adapter will
253
273
  * be Http. If the tool is an inline tool, the adapter will be Inline.
254
274
  */
255
- export interface ToolSpecConfig {
275
+ export type ToolSpecConfig =
276
+ | ToolSpecConfigHTTP
277
+ | ToolSpecConfigMCP
278
+ | ToolSpecConfigOpenAPI
279
+ | ToolSpecConfigBare;
280
+
281
+ export interface ToolSpecConfigBare {
256
282
  /**
257
283
  * Marks the tool as bare: it has no execution adapter of its own and relies on the
258
284
  * parent tool set being a Bare tool set. Present so a webhook consumer can tell a
259
285
  * tool is bare from the tool data alone, without cross-referencing the tool set.
260
286
  */
261
- bare?: ConfigBare;
287
+ bare: ConfigBare;
288
+
289
+ type: 'bare';
290
+ }
291
+
292
+ export interface ToolSpecConfigHTTP {
293
+ http: ConfigHTTP;
262
294
 
263
- http?: ConfigHTTP;
295
+ type: 'http';
296
+ }
297
+
298
+ export interface ToolSpecConfigMCP {
299
+ mcp: ConfigMCP;
300
+
301
+ type: 'mcp';
302
+ }
264
303
 
265
- mcp?: ConfigMcp;
304
+ export interface ToolSpecConfigOpenAPI {
305
+ openapi: ConfigOpenAPI;
266
306
 
267
- openapi?: ConfigOpenAPI;
307
+ type: 'openapi';
268
308
  }
269
309
 
270
310
  export interface ToolCreateParams {
271
311
  /**
272
312
  * Path param: Workspace ID.
273
313
  */
274
- workspaceId: string;
314
+ workspaceId?: string;
275
315
 
276
316
  /**
277
317
  * Body param: CreateResourceMetadata contains the user-provided fields for
@@ -291,25 +331,14 @@ export interface ToolRetrieveParams {
291
331
  /**
292
332
  * Workspace ID.
293
333
  */
294
- workspaceId: string;
295
-
296
- /**
297
- * Tool set ID. Accepts the canonical ts\_… form or the external_id:<value> form.
298
- */
299
- toolSetId: string;
334
+ workspaceId?: string;
300
335
  }
301
336
 
302
337
  export interface ToolUpdateParams {
303
338
  /**
304
339
  * Path param: Workspace ID.
305
340
  */
306
- workspaceId: string;
307
-
308
- /**
309
- * Path param: Tool set ID. Accepts the canonical ts\_… form or the
310
- * external_id:<value> form.
311
- */
312
- toolSetId: string;
341
+ workspaceId?: string;
313
342
 
314
343
  /**
315
344
  * Body param: UpdateResourceMetadata contains the user-provided fields for
@@ -334,7 +363,7 @@ export interface ToolListParams extends CursorPaginationParams {
334
363
  /**
335
364
  * Path param: Workspace ID.
336
365
  */
337
- workspaceId: string;
366
+ workspaceId?: string;
338
367
 
339
368
  /**
340
369
  * Query param: When set to true you may use more of your alloted API rate-limit
@@ -385,49 +414,38 @@ export interface ToolDeleteParams {
385
414
  /**
386
415
  * Workspace ID.
387
416
  */
388
- workspaceId: string;
389
-
390
- /**
391
- * Tool set ID. Accepts the canonical ts\_… form or the external_id:<value> form.
392
- */
393
- toolSetId: string;
417
+ workspaceId?: string;
394
418
  }
395
419
 
396
420
  export interface ToolOmitParams {
397
421
  /**
398
422
  * Workspace ID.
399
423
  */
400
- workspaceId: string;
401
-
402
- /**
403
- * Tool set ID. Accepts the canonical ts\_… form or the external_id:<value> form.
404
- */
405
- toolSetId: string;
424
+ workspaceId?: string;
406
425
  }
407
426
 
408
427
  export interface ToolRestoreParams {
409
428
  /**
410
429
  * Workspace ID.
411
430
  */
412
- workspaceId: string;
413
-
414
- /**
415
- * Tool set ID. Accepts the canonical ts\_… form or the external_id:<value> form.
416
- */
417
- toolSetId: string;
431
+ workspaceId?: string;
418
432
  }
419
433
 
420
434
  export declare namespace Tools {
421
435
  export {
422
436
  type ConfigBare as ConfigBare,
423
437
  type ConfigHTTP as ConfigHTTP,
424
- type ConfigMcp as ConfigMcp,
438
+ type ConfigMCP as ConfigMCP,
425
439
  type ConfigOpenAPI as ConfigOpenAPI,
426
- type McpAnnotations as McpAnnotations,
440
+ type MCPAnnotations as MCPAnnotations,
427
441
  type Tool as Tool,
428
442
  type ToolInfo as ToolInfo,
429
443
  type ToolSpec as ToolSpec,
430
444
  type ToolSpecConfig as ToolSpecConfig,
445
+ type ToolSpecConfigBare as ToolSpecConfigBare,
446
+ type ToolSpecConfigHTTP as ToolSpecConfigHTTP,
447
+ type ToolSpecConfigMCP as ToolSpecConfigMCP,
448
+ type ToolSpecConfigOpenAPI as ToolSpecConfigOpenAPI,
431
449
  type ToolsCursorPagination as ToolsCursorPagination,
432
450
  type ToolCreateParams as ToolCreateParams,
433
451
  type ToolRetrieveParams as ToolRetrieveParams,
@@ -18,15 +18,20 @@ export class Uploads extends APIResource {
18
18
  * returned id is used to reference the upload from resources that accept binary
19
19
  * content.
20
20
  */
21
- create(workspaceID: string, body: UploadCreateParams, options?: RequestOptions): APIPromise<Upload> {
22
- return this._client.post(path`/v1/workspaces/${workspaceID}/uploads`, { body, ...options });
21
+ create(params: UploadCreateParams, options?: RequestOptions): APIPromise<Upload> {
22
+ const { workspaceId = this._client.workspaceID, ...body } = params;
23
+ return this._client.post(path`/v1/workspaces/${workspaceId}/uploads`, { body, ...options });
23
24
  }
24
25
 
25
26
  /**
26
27
  * Retrieves the current state of an upload, including its lifecycle status
27
28
  */
28
- retrieve(id: string, params: UploadRetrieveParams, options?: RequestOptions): APIPromise<Upload> {
29
- const { workspaceId } = params;
29
+ retrieve(
30
+ id: string,
31
+ params: UploadRetrieveParams | null | undefined = {},
32
+ options?: RequestOptions,
33
+ ): APIPromise<Upload> {
34
+ const { workspaceId = this._client.workspaceID } = params ?? {};
30
35
  return this._client.get(path`/v1/workspaces/${workspaceId}/uploads/${id}`, options);
31
36
  }
32
37
  }
@@ -106,12 +111,21 @@ export interface UploadSpec {
106
111
 
107
112
  export interface UploadCreateParams {
108
113
  /**
109
- * CreateResourceMetadata contains the user-provided fields for creating a
110
- * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
111
- * profile_id, created_at) are excluded since they are set by the server.
114
+ * Path param: Workspace ID.
115
+ */
116
+ workspaceId?: string;
117
+
118
+ /**
119
+ * Body param: CreateResourceMetadata contains the user-provided fields for
120
+ * creating a workspace-scoped resource. Read-only fields (id, account_id,
121
+ * workspace_id, profile_id, created_at) are excluded since they are set by the
122
+ * server.
112
123
  */
113
124
  metadata: Shared.CreateResourceMetadata;
114
125
 
126
+ /**
127
+ * Body param
128
+ */
115
129
  spec: UploadSpec;
116
130
  }
117
131
 
@@ -119,7 +133,7 @@ export interface UploadRetrieveParams {
119
133
  /**
120
134
  * Workspace ID.
121
135
  */
122
- workspaceId: string;
136
+ workspaceId?: string;
123
137
  }
124
138
 
125
139
  export declare namespace Uploads {
@@ -6,7 +6,9 @@ export {
6
6
  WorkspaceAdmin,
7
7
  type WorkspaceMember,
8
8
  type WorkspaceAdminCreateParams,
9
+ type WorkspaceAdminRetrieveParams,
9
10
  type WorkspaceAdminUpdateParams,
10
11
  type WorkspaceAdminListParams,
12
+ type WorkspaceAdminArchiveParams,
11
13
  type WorkspaceMembersCursorPagination,
12
14
  } from './workspace-admin';
@@ -20,14 +20,24 @@ import { path } from '../../internal/utils/path';
20
20
  export class Members extends APIResource {
21
21
  /**
22
22
  * Lists the members of a workspace. Admin only.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * // Automatically fetches more pages as needed.
27
+ * for await (const workspaceMember of client.workspaceAdmin.members.list(
28
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
29
+ * )) {
30
+ * // ...
31
+ * }
32
+ * ```
23
33
  */
24
34
  list(
25
- workspaceID: string,
26
- query: MemberListParams | null | undefined = {},
35
+ params: MemberListParams | null | undefined = {},
27
36
  options?: RequestOptions,
28
37
  ): PagePromise<WorkspaceMembersCursorPagination, WorkspaceAdminAPI.WorkspaceMember> {
38
+ const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
29
39
  return this._client.getAPIList(
30
- path`/v1/account/workspaces/${workspaceID}/members`,
40
+ path`/v1/account/workspaces/${workspaceId}/members`,
31
41
  CursorPagination<WorkspaceAdminAPI.WorkspaceMember>,
32
42
  { query, ...options },
33
43
  );
@@ -38,21 +48,41 @@ export class Members extends APIResource {
38
48
  * that links the profile to the workspace. Accepts either an existing profile_id
39
49
  * or an email to resolve-or-invite. Idempotent for an already-active member. Admin
40
50
  * only.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const workspaceMember =
55
+ * await client.workspaceAdmin.members.add({
56
+ * workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
57
+ * });
58
+ * ```
41
59
  */
42
60
  add(
43
- workspaceID: string,
44
- body: MemberAddParams,
61
+ params: MemberAddParams | null | undefined = {},
45
62
  options?: RequestOptions,
46
63
  ): APIPromise<WorkspaceAdminAPI.WorkspaceMember> {
47
- return this._client.post(path`/v1/account/workspaces/${workspaceID}/members`, { body, ...options });
64
+ const { workspaceId = this._client.workspaceID, ...body } = params ?? {};
65
+ return this._client.post(path`/v1/account/workspaces/${workspaceId}/members`, { body, ...options });
48
66
  }
49
67
 
50
68
  /**
51
69
  * Revokes a member's access by deactivating their actor; the member is immediately
52
70
  * cut off. The underlying profile is not deleted. Admin only.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * await client.workspaceAdmin.members.remove(
75
+ * 'profile_01HXKD2E5NQM3T9AYWCFS0AP08',
76
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
77
+ * );
78
+ * ```
53
79
  */
54
- remove(profileID: string, params: MemberRemoveParams, options?: RequestOptions): APIPromise<void> {
55
- const { workspaceId } = params;
80
+ remove(
81
+ profileID: string,
82
+ params: MemberRemoveParams | null | undefined = {},
83
+ options?: RequestOptions,
84
+ ): APIPromise<void> {
85
+ const { workspaceId = this._client.workspaceID } = params ?? {};
56
86
  return this._client.delete(path`/v1/account/workspaces/${workspaceId}/members/${profileID}`, {
57
87
  ...options,
58
88
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
@@ -60,16 +90,27 @@ export class Members extends APIResource {
60
90
  }
61
91
  }
62
92
 
63
- export interface MemberListParams extends CursorPaginationParams {}
93
+ export interface MemberListParams extends CursorPaginationParams {
94
+ /**
95
+ * Path param: The workspace whose members will be listed (path).
96
+ */
97
+ workspaceId?: string;
98
+ }
64
99
 
65
100
  export interface MemberAddParams {
66
101
  /**
67
- * Email address to add (resolve-or-invite). Mutually exclusive with profile_id.
102
+ * Path param: The workspace to add the member to (path).
103
+ */
104
+ workspaceId?: string;
105
+
106
+ /**
107
+ * Body param: Email address to add (resolve-or-invite). Mutually exclusive with
108
+ * profile_id.
68
109
  */
69
110
  email?: string;
70
111
 
71
112
  /**
72
- * An existing account profile to add. Mutually exclusive with email.
113
+ * Body param: An existing account profile to add. Mutually exclusive with email.
73
114
  */
74
115
  profileId?: string;
75
116
  }
@@ -78,7 +119,7 @@ export interface MemberRemoveParams {
78
119
  /**
79
120
  * The workspace to remove the member from (path).
80
121
  */
81
- workspaceId: string;
122
+ workspaceId?: string;
82
123
  }
83
124
 
84
125
  export declare namespace Members {
@@ -18,6 +18,14 @@ export class Profiles extends APIResource {
18
18
  /**
19
19
  * Searches the account's profiles for a member picker, with free-form name/email
20
20
  * search and an optional type filter. Account-scoped; admin only.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * // Automatically fetches more pages as needed.
25
+ * for await (const profile of client.workspaceAdmin.profiles.list()) {
26
+ * // ...
27
+ * }
28
+ * ```
21
29
  */
22
30
  list(
23
31
  query: ProfileListParams | null | undefined = {},
@@ -27,6 +27,14 @@ export class WorkspaceAdmin extends APIResource {
27
27
 
28
28
  /**
29
29
  * Creates a new workspace in the account. Admin only.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const workspace = await client.workspaceAdmin.create({
34
+ * metadata: { name: 'name' },
35
+ * spec: {},
36
+ * });
37
+ * ```
30
38
  */
31
39
  create(body: WorkspaceAdminCreateParams, options?: RequestOptions): APIPromise<WorkspacesAPI.Workspace> {
32
40
  return this._client.post('/v1/account/workspaces', { body, ...options });
@@ -34,25 +42,51 @@ export class WorkspaceAdmin extends APIResource {
34
42
 
35
43
  /**
36
44
  * Retrieves a workspace in the account by ID. Admin only.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const workspace = await client.workspaceAdmin.retrieve({
49
+ * workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
50
+ * });
51
+ * ```
37
52
  */
38
- retrieve(workspaceID: string, options?: RequestOptions): APIPromise<WorkspacesAPI.Workspace> {
39
- return this._client.get(path`/v1/account/workspaces/${workspaceID}`, options);
53
+ retrieve(
54
+ params: WorkspaceAdminRetrieveParams | null | undefined = {},
55
+ options?: RequestOptions,
56
+ ): APIPromise<WorkspacesAPI.Workspace> {
57
+ const { workspaceId = this._client.workspaceID } = params ?? {};
58
+ return this._client.get(path`/v1/account/workspaces/${workspaceId}`, options);
40
59
  }
41
60
 
42
61
  /**
43
62
  * Updates a workspace's metadata (e.g. name) and spec. Admin only.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const workspace = await client.workspaceAdmin.update({
67
+ * workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
68
+ * });
69
+ * ```
44
70
  */
45
71
  update(
46
- workspaceID: string,
47
- body: WorkspaceAdminUpdateParams,
72
+ params: WorkspaceAdminUpdateParams | null | undefined = {},
48
73
  options?: RequestOptions,
49
74
  ): APIPromise<WorkspacesAPI.Workspace> {
50
- return this._client.patch(path`/v1/account/workspaces/${workspaceID}`, { body, ...options });
75
+ const { workspaceId = this._client.workspaceID, ...body } = params ?? {};
76
+ return this._client.patch(path`/v1/account/workspaces/${workspaceId}`, { body, ...options });
51
77
  }
52
78
 
53
79
  /**
54
80
  * Lists every workspace in the account, optionally including archived ones. Admin
55
81
  * only.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * // Automatically fetches more pages as needed.
86
+ * for await (const workspace of client.workspaceAdmin.list()) {
87
+ * // ...
88
+ * }
89
+ * ```
56
90
  */
57
91
  list(
58
92
  query: WorkspaceAdminListParams | null | undefined = {},
@@ -69,9 +103,20 @@ export class WorkspaceAdmin extends APIResource {
69
103
  * subsequent request scoped to it returns a permission error. Archiving the
70
104
  * account's last active (non-archived) workspace is not allowed and returns
71
105
  * FailedPrecondition. Admin only.
106
+ *
107
+ * @example
108
+ * ```ts
109
+ * await client.workspaceAdmin.archive({
110
+ * workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
111
+ * });
112
+ * ```
72
113
  */
73
- archive(workspaceID: string, options?: RequestOptions): APIPromise<void> {
74
- return this._client.delete(path`/v1/account/workspaces/${workspaceID}`, {
114
+ archive(
115
+ params: WorkspaceAdminArchiveParams | null | undefined = {},
116
+ options?: RequestOptions,
117
+ ): APIPromise<void> {
118
+ const { workspaceId = this._client.workspaceID } = params ?? {};
119
+ return this._client.delete(path`/v1/account/workspaces/${workspaceId}`, {
75
120
  ...options,
76
121
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
77
122
  });
@@ -151,18 +196,33 @@ export namespace WorkspaceAdminCreateParams {
151
196
  }
152
197
  }
153
198
 
199
+ export interface WorkspaceAdminRetrieveParams {
200
+ /**
201
+ * Workspace ID to retrieve (path).
202
+ */
203
+ workspaceId?: string;
204
+ }
205
+
154
206
  export interface WorkspaceAdminUpdateParams {
155
207
  /**
156
- * UpdateAccountResourceMetadata contains the user-provided fields for updating an
157
- * account-scoped resource. Read-only fields (id, account_id, profile_id) are
158
- * excluded since they are set by the server.
208
+ * Path param: Workspace ID to update (path).
209
+ */
210
+ workspaceId?: string;
211
+
212
+ /**
213
+ * Body param: UpdateAccountResourceMetadata contains the user-provided fields for
214
+ * updating an account-scoped resource. Read-only fields (id, account_id,
215
+ * profile_id) are excluded since they are set by the server.
159
216
  */
160
217
  metadata?: WorkspaceAdminUpdateParams.Metadata;
161
218
 
219
+ /**
220
+ * Body param
221
+ */
162
222
  spec?: WorkspacesAPI.WorkspaceSpec;
163
223
 
164
224
  /**
165
- * Fields to update.
225
+ * Body param: Fields to update.
166
226
  */
167
227
  updateMask?: string;
168
228
  }
@@ -211,6 +271,13 @@ export interface WorkspaceAdminListParams extends CursorPaginationParams {
211
271
  labels?: string;
212
272
  }
213
273
 
274
+ export interface WorkspaceAdminArchiveParams {
275
+ /**
276
+ * Workspace ID to archive (path).
277
+ */
278
+ workspaceId?: string;
279
+ }
280
+
214
281
  WorkspaceAdmin.Members = Members;
215
282
  WorkspaceAdmin.Profiles = Profiles;
216
283
 
@@ -218,8 +285,10 @@ export declare namespace WorkspaceAdmin {
218
285
  export {
219
286
  type WorkspaceMember as WorkspaceMember,
220
287
  type WorkspaceAdminCreateParams as WorkspaceAdminCreateParams,
288
+ type WorkspaceAdminRetrieveParams as WorkspaceAdminRetrieveParams,
221
289
  type WorkspaceAdminUpdateParams as WorkspaceAdminUpdateParams,
222
290
  type WorkspaceAdminListParams as WorkspaceAdminListParams,
291
+ type WorkspaceAdminArchiveParams as WorkspaceAdminArchiveParams,
223
292
  };
224
293
 
225
294
  export {