@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
@@ -10,24 +10,50 @@ import { path } from '../../internal/utils/path';
10
10
  export class Tasks extends APIResource {
11
11
  /**
12
12
  * Retrieves a task by ID from an objective
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const objectiveTask =
17
+ * await client.objectives.tasks.retrieve(
18
+ * 'obj_01HXKD2E5NQM3T9AYWCFQAZGFV',
19
+ * 'id',
20
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
21
+ * );
22
+ * ```
13
23
  */
14
- retrieve(id: string, params: TaskRetrieveParams, options?: RequestOptions): APIPromise<ObjectiveTask> {
15
- const { workspaceId, objectiveId } = params;
24
+ retrieve(
25
+ objectiveID: string,
26
+ id: string,
27
+ params: TaskRetrieveParams | null | undefined = {},
28
+ options?: RequestOptions,
29
+ ): APIPromise<ObjectiveTask> {
30
+ const { workspaceId = this._client.workspaceID } = params ?? {};
16
31
  return this._client.get(
17
- path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tasks/${id}`,
32
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tasks/${id}`,
18
33
  options,
19
34
  );
20
35
  }
21
36
 
22
37
  /**
23
38
  * Lists all tasks for an objective
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * // Automatically fetches more pages as needed.
43
+ * for await (const objectiveTask of client.objectives.tasks.list(
44
+ * 'obj_01HXKD2E5NQM3T9AYWCFQAZGFV',
45
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
46
+ * )) {
47
+ * // ...
48
+ * }
49
+ * ```
24
50
  */
25
51
  list(
26
52
  objectiveID: string,
27
- params: TaskListParams,
53
+ params: TaskListParams | null | undefined = {},
28
54
  options?: RequestOptions,
29
55
  ): PagePromise<ObjectiveTasksCursorPagination, ObjectiveTask> {
30
- const { workspaceId, ...query } = params;
56
+ const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
31
57
  return this._client.getAPIList(
32
58
  path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tasks`,
33
59
  CursorPagination<ObjectiveTask>,
@@ -79,19 +105,14 @@ export interface ObjectiveTaskData {
79
105
  }
80
106
 
81
107
  export interface TaskRetrieveParams {
82
- workspaceId: string;
83
-
84
- /**
85
- * The ID of the objective. Supports "external_id:" prefix for external IDs.
86
- */
87
- objectiveId: string;
108
+ workspaceId?: string;
88
109
  }
89
110
 
90
111
  export interface TaskListParams extends CursorPaginationParams {
91
112
  /**
92
113
  * Path param
93
114
  */
94
- workspaceId: string;
115
+ workspaceId?: string;
95
116
 
96
117
  /**
97
118
  * Query param: Sort order for results
@@ -13,28 +13,50 @@ export class ToolCalls extends APIResource {
13
13
  /**
14
14
  * Retrieves a single tool call, including the content the tool returned. Media
15
15
  * content (images, audio) is served as short-lived signed URLs.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const objectiveToolCallWithResult =
20
+ * await client.objectives.toolCalls.retrieve(
21
+ * 'obj_01HXKD2E5NQM3T9AYWCFQAZGFV',
22
+ * 'toolcall_01HXKD2E5NQM3T9AYWCFTANFGV',
23
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
24
+ * );
25
+ * ```
16
26
  */
17
27
  retrieve(
28
+ objectiveID: string,
18
29
  toolCallID: string,
19
- params: ToolCallRetrieveParams,
30
+ params: ToolCallRetrieveParams | null | undefined = {},
20
31
  options?: RequestOptions,
21
32
  ): APIPromise<ObjectiveToolCallWithResult> {
22
- const { workspaceId, objectiveId } = params;
33
+ const { workspaceId = this._client.workspaceID } = params ?? {};
23
34
  return this._client.get(
24
- path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}`,
35
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tool_calls/${toolCallID}`,
25
36
  options,
26
37
  );
27
38
  }
28
39
 
29
40
  /**
30
41
  * Lists all tool calls for an objective
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * // Automatically fetches more pages as needed.
46
+ * for await (const objectiveToolCall of client.objectives.toolCalls.list(
47
+ * 'obj_01HXKD2E5NQM3T9AYWCFQAZGFV',
48
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
49
+ * )) {
50
+ * // ...
51
+ * }
52
+ * ```
31
53
  */
32
54
  list(
33
55
  objectiveID: string,
34
- params: ToolCallListParams,
56
+ params: ToolCallListParams | null | undefined = {},
35
57
  options?: RequestOptions,
36
58
  ): PagePromise<ObjectiveToolCallsCursorPagination, ObjectiveToolCall> {
37
- const { workspaceId, ...query } = params;
59
+ const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
38
60
  return this._client.getAPIList(
39
61
  path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tool_calls`,
40
62
  CursorPagination<ObjectiveToolCall>,
@@ -45,15 +67,26 @@ export class ToolCalls extends APIResource {
45
67
  /**
46
68
  * When an agent attempts to use a tool that requires approval, use this endpoint
47
69
  * to mark it as approved.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const objectiveToolCall =
74
+ * await client.objectives.toolCalls.approve(
75
+ * 'obj_01HXKD2E5NQM3T9AYWCFQAZGFV',
76
+ * 'toolcall_01HXKD2E5NQM3T9AYWCFTANFGV',
77
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
78
+ * );
79
+ * ```
48
80
  */
49
81
  approve(
82
+ objectiveID: string,
50
83
  toolCallID: string,
51
84
  params: ToolCallApproveParams,
52
85
  options?: RequestOptions,
53
86
  ): APIPromise<ObjectiveToolCall> {
54
- const { workspaceId, objectiveId, ...body } = params;
87
+ const { workspaceId = this._client.workspaceID, ...body } = params;
55
88
  return this._client.post(
56
- path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}:approve`,
89
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tool_calls/${toolCallID}:approve`,
57
90
  { body, ...options },
58
91
  );
59
92
  }
@@ -62,15 +95,26 @@ export class ToolCalls extends APIResource {
62
95
  * When an agent attempts to use a tool that requires approval, use this endpoint
63
96
  * to mark it as denied. Use a memo to steer the LLM to a different decision or
64
97
  * usage of the tool.
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * const objectiveToolCall =
102
+ * await client.objectives.toolCalls.deny(
103
+ * 'obj_01HXKD2E5NQM3T9AYWCFQAZGFV',
104
+ * 'toolcall_01HXKD2E5NQM3T9AYWCFTANFGV',
105
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
106
+ * );
107
+ * ```
65
108
  */
66
109
  deny(
110
+ objectiveID: string,
67
111
  toolCallID: string,
68
112
  params: ToolCallDenyParams,
69
113
  options?: RequestOptions,
70
114
  ): APIPromise<ObjectiveToolCall> {
71
- const { workspaceId, objectiveId, ...body } = params;
115
+ const { workspaceId = this._client.workspaceID, ...body } = params;
72
116
  return this._client.post(
73
- path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}:deny`,
117
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tool_calls/${toolCallID}:deny`,
74
118
  { body, ...options },
75
119
  );
76
120
  }
@@ -79,15 +123,34 @@ export class ToolCalls extends APIResource {
79
123
  * For bare tool calls (tool sets with no execution adapter), sets the content an
80
124
  * external API consumer supplies for the call — used for human-in-the-loop tools
81
125
  * and reverse harnesses that execute tools locally and report results back.
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * const objectiveToolCall =
130
+ * await client.objectives.toolCalls.setContent(
131
+ * 'obj_01HXKD2E5NQM3T9AYWCFQAZGFV',
132
+ * 'toolcall_01HXKD2E5NQM3T9AYWCFTANFGV',
133
+ * {
134
+ * workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
135
+ * content: [
136
+ * {
137
+ * text: { text: 'text' },
138
+ * type: 'text',
139
+ * },
140
+ * ],
141
+ * },
142
+ * );
143
+ * ```
82
144
  */
83
145
  setContent(
146
+ objectiveID: string,
84
147
  toolCallID: string,
85
148
  params: ToolCallSetContentParams,
86
149
  options?: RequestOptions,
87
150
  ): APIPromise<ObjectiveToolCall> {
88
- const { workspaceId, objectiveId, ...body } = params;
151
+ const { workspaceId = this._client.workspaceID, ...body } = params;
89
152
  return this._client.post(
90
- path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}:setContent`,
153
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tool_calls/${toolCallID}:setContent`,
91
154
  { body, ...options },
92
155
  );
93
156
  }
@@ -233,12 +296,27 @@ export interface ObjectiveToolCallResultAudioBlock {
233
296
  * ContentBlock is a single block of tool result content. Exactly one of the
234
297
  * variants is set.
235
298
  */
236
- export interface ObjectiveToolCallResultContentBlock {
237
- audio?: ObjectiveToolCallResultAudioBlock;
299
+ export type ObjectiveToolCallResultContentBlock =
300
+ | ObjectiveToolCallResultContentBlockText
301
+ | ObjectiveToolCallResultContentBlockImage
302
+ | ObjectiveToolCallResultContentBlockAudio;
303
+
304
+ export interface ObjectiveToolCallResultContentBlockAudio {
305
+ audio: ObjectiveToolCallResultAudioBlock;
306
+
307
+ type: 'audio';
308
+ }
238
309
 
239
- image?: ObjectiveToolCallResultImageBlock;
310
+ export interface ObjectiveToolCallResultContentBlockImage {
311
+ image: ObjectiveToolCallResultImageBlock;
240
312
 
241
- text?: ObjectiveToolCallResultTextBlock;
313
+ type: 'image';
314
+ }
315
+
316
+ export interface ObjectiveToolCallResultContentBlockText {
317
+ text: ObjectiveToolCallResultTextBlock;
318
+
319
+ type: 'text';
242
320
  }
243
321
 
244
322
  export interface ObjectiveToolCallResultImageBlock {
@@ -348,12 +426,27 @@ export interface SetToolCallContentRequestAudioBlock {
348
426
  * ContentBlock is a single block of tool call content supplied on input. Exactly
349
427
  * one of the variants is set.
350
428
  */
351
- export interface SetToolCallContentRequestContentBlock {
352
- audio?: SetToolCallContentRequestAudioBlock;
429
+ export type SetToolCallContentRequestContentBlock =
430
+ | SetToolCallContentRequestContentBlockText
431
+ | SetToolCallContentRequestContentBlockImage
432
+ | SetToolCallContentRequestContentBlockAudio;
433
+
434
+ export interface SetToolCallContentRequestContentBlockAudio {
435
+ audio: SetToolCallContentRequestAudioBlock;
436
+
437
+ type: 'audio';
438
+ }
439
+
440
+ export interface SetToolCallContentRequestContentBlockImage {
441
+ image: SetToolCallContentRequestImageBlock;
353
442
 
354
- image?: SetToolCallContentRequestImageBlock;
443
+ type: 'image';
444
+ }
445
+
446
+ export interface SetToolCallContentRequestContentBlockText {
447
+ text: SetToolCallContentRequestTextBlock;
355
448
 
356
- text?: SetToolCallContentRequestTextBlock;
449
+ type: 'text';
357
450
  }
358
451
 
359
452
  export interface SetToolCallContentRequestImageBlock {
@@ -373,19 +466,14 @@ export interface SetToolCallContentRequestTextBlock {
373
466
  }
374
467
 
375
468
  export interface ToolCallRetrieveParams {
376
- workspaceId: string;
377
-
378
- /**
379
- * The ID of the objective. Supports "external_id:" prefix for external IDs.
380
- */
381
- objectiveId: string;
469
+ workspaceId?: string;
382
470
  }
383
471
 
384
472
  export interface ToolCallListParams extends CursorPaginationParams {
385
473
  /**
386
474
  * Path param
387
475
  */
388
- workspaceId: string;
476
+ workspaceId?: string;
389
477
 
390
478
  /**
391
479
  * Query param: Filter by tool call execution status. Useful for reverse-harness
@@ -424,25 +512,14 @@ export interface ToolCallListParams extends CursorPaginationParams {
424
512
  }
425
513
 
426
514
  export interface ToolCallApproveParams {
427
- workspaceId: string;
428
-
429
- /**
430
- * The ID of the objective. Supports "external_id:" prefix for external IDs.
431
- */
432
- objectiveId: string;
515
+ workspaceId?: string;
433
516
  }
434
517
 
435
518
  export interface ToolCallDenyParams {
436
519
  /**
437
520
  * Path param
438
521
  */
439
- workspaceId: string;
440
-
441
- /**
442
- * Path param: The ID of the objective. Supports "external_id:" prefix for external
443
- * IDs.
444
- */
445
- objectiveId: string;
522
+ workspaceId?: string;
446
523
 
447
524
  /**
448
525
  * Body param: A memo to associate to the tool call denial. Use a memo to steer the
@@ -455,13 +532,7 @@ export interface ToolCallSetContentParams {
455
532
  /**
456
533
  * Path param
457
534
  */
458
- workspaceId: string;
459
-
460
- /**
461
- * Path param: The ID of the objective. Supports "external_id:" prefix for external
462
- * IDs.
463
- */
464
- objectiveId: string;
535
+ workspaceId?: string;
465
536
 
466
537
  /**
467
538
  * Body param: The content to set on the tool call. Mirrors
@@ -479,12 +550,18 @@ export declare namespace ToolCalls {
479
550
  type ObjectiveToolCallResult as ObjectiveToolCallResult,
480
551
  type ObjectiveToolCallResultAudioBlock as ObjectiveToolCallResultAudioBlock,
481
552
  type ObjectiveToolCallResultContentBlock as ObjectiveToolCallResultContentBlock,
553
+ type ObjectiveToolCallResultContentBlockAudio as ObjectiveToolCallResultContentBlockAudio,
554
+ type ObjectiveToolCallResultContentBlockImage as ObjectiveToolCallResultContentBlockImage,
555
+ type ObjectiveToolCallResultContentBlockText as ObjectiveToolCallResultContentBlockText,
482
556
  type ObjectiveToolCallResultImageBlock as ObjectiveToolCallResultImageBlock,
483
557
  type ObjectiveToolCallResultTextBlock as ObjectiveToolCallResultTextBlock,
484
558
  type ObjectiveToolCallWithResult as ObjectiveToolCallWithResult,
485
559
  type ResolvedSecret as ResolvedSecret,
486
560
  type SetToolCallContentRequestAudioBlock as SetToolCallContentRequestAudioBlock,
487
561
  type SetToolCallContentRequestContentBlock as SetToolCallContentRequestContentBlock,
562
+ type SetToolCallContentRequestContentBlockAudio as SetToolCallContentRequestContentBlockAudio,
563
+ type SetToolCallContentRequestContentBlockImage as SetToolCallContentRequestContentBlockImage,
564
+ type SetToolCallContentRequestContentBlockText as SetToolCallContentRequestContentBlockText,
488
565
  type SetToolCallContentRequestImageBlock as SetToolCallContentRequestImageBlock,
489
566
  type SetToolCallContentRequestTextBlock as SetToolCallContentRequestTextBlock,
490
567
  type ObjectiveToolCallsCursorPagination as ObjectiveToolCallsCursorPagination,
@@ -10,13 +10,24 @@ import { path } from '../../internal/utils/path';
10
10
  export class Tools extends APIResource {
11
11
  /**
12
12
  * Lists all tools that were assigned to an objective
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * // Automatically fetches more pages as needed.
17
+ * for await (const objectiveTool of client.objectives.tools.list(
18
+ * 'obj_01HXKD2E5NQM3T9AYWCFQAZGFV',
19
+ * { workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q' },
20
+ * )) {
21
+ * // ...
22
+ * }
23
+ * ```
13
24
  */
14
25
  list(
15
26
  objectiveID: string,
16
- params: ToolListParams,
27
+ params: ToolListParams | null | undefined = {},
17
28
  options?: RequestOptions,
18
29
  ): PagePromise<ObjectiveToolsCursorPagination, ObjectiveTool> {
19
- const { workspaceId, ...query } = params;
30
+ const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
20
31
  return this._client.getAPIList(
21
32
  path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/tools`,
22
33
  CursorPagination<ObjectiveTool>,
@@ -53,7 +64,7 @@ export interface ToolListParams extends CursorPaginationParams {
53
64
  /**
54
65
  * Path param
55
66
  */
56
- workspaceId: string;
67
+ workspaceId?: string;
57
68
  }
58
69
 
59
70
  export declare namespace Tools {
@@ -13,11 +13,11 @@ export class Search extends APIResource {
13
13
  * Searches for tools or tool sets in the workspace
14
14
  */
15
15
  searchToolsOrToolSets(
16
- workspaceID: string,
17
- query: SearchSearchToolsOrToolSetsParams | null | undefined = {},
16
+ params: SearchSearchToolsOrToolSetsParams,
18
17
  options?: RequestOptions,
19
18
  ): APIPromise<SearchSearchToolsOrToolSetsResponse> {
20
- return this._client.get(path`/v1/workspaces/${workspaceID}/search/tools_or_tool_sets`, {
19
+ const { workspaceId = this._client.workspaceID, ...query } = params;
20
+ return this._client.get(path`/v1/workspaces/${workspaceId}/search/tools_or_tool_sets`, {
21
21
  query,
22
22
  ...options,
23
23
  });
@@ -33,7 +33,17 @@ export interface SearchSearchToolsOrToolSetsResponse {
33
33
  }
34
34
 
35
35
  export interface SearchSearchToolsOrToolSetsParams {
36
- query?: string;
36
+ /**
37
+ * Path param: NOTE: `query` is runtime-required (buf.validate min_len), but
38
+ * gnostic does not propagate message-level schema `required` to GET query
39
+ * parameters — overlay.yaml marks the parameter required instead.
40
+ */
41
+ workspaceId?: string;
42
+
43
+ /**
44
+ * Query param
45
+ */
46
+ query: string;
37
47
  }
38
48
 
39
49
  export declare namespace Search {
@@ -15,8 +15,15 @@ export {
15
15
  export {
16
16
  ToolSets,
17
17
  type ApprovalRequirementFilter,
18
+ type ApprovalRequirementFilterAlways,
19
+ type ApprovalRequirementFilterOnly,
18
20
  type AttributeFilter,
19
21
  type StringMatcher,
22
+ type StringMatcherContains,
23
+ type StringMatcherEndsWith,
24
+ type StringMatcherExact,
25
+ type StringMatcherRegex,
26
+ type StringMatcherStartsWith,
20
27
  type SyncCompleted,
21
28
  type SyncFailed,
22
29
  type SyncStarted,
@@ -24,11 +31,20 @@ export {
24
31
  type ToolSet,
25
32
  type ToolSetAdapter,
26
33
  type ToolSetAdapterBare,
34
+ type ToolSetAdapterBareVariant,
27
35
  type ToolSetAdapterHTTP,
28
- type ToolSetAdapterMcp,
36
+ type ToolSetAdapterHTTPVariant,
37
+ type ToolSetAdapterMCP,
38
+ type ToolSetAdapterMCPVariant,
29
39
  type ToolSetAdapterOpenAPI,
40
+ type ToolSetAdapterOpenAPIUploadID,
41
+ type ToolSetAdapterOpenAPIURL,
42
+ type ToolSetAdapterOpenAPIVariant,
30
43
  type ToolSetEvent,
31
44
  type ToolSetEventData,
45
+ type ToolSetEventDataSyncCompleted,
46
+ type ToolSetEventDataSyncFailed,
47
+ type ToolSetEventDataSyncStarted,
32
48
  type ToolSetInfo,
33
49
  type ToolSetSpec,
34
50
  type ToolSetGetOpenAPISpecResponse,
@@ -48,13 +64,17 @@ export {
48
64
  Tools,
49
65
  type ConfigBare,
50
66
  type ConfigHTTP,
51
- type ConfigMcp,
67
+ type ConfigMCP,
52
68
  type ConfigOpenAPI,
53
- type McpAnnotations,
69
+ type MCPAnnotations,
54
70
  type Tool,
55
71
  type ToolInfo,
56
72
  type ToolSpec,
57
73
  type ToolSpecConfig,
74
+ type ToolSpecConfigBare,
75
+ type ToolSpecConfigHTTP,
76
+ type ToolSpecConfigMCP,
77
+ type ToolSpecConfigOpenAPI,
58
78
  type ToolCreateParams,
59
79
  type ToolRetrieveParams,
60
80
  type ToolUpdateParams,
@@ -21,7 +21,7 @@ export class Secrets extends APIResource {
21
21
  * Creates a new secret scoped to the tool set
22
22
  */
23
23
  create(toolSetID: string, params: SecretCreateParams, options?: RequestOptions): APIPromise<ToolSetSecret> {
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}/secrets`, {
26
26
  body,
27
27
  ...options,
@@ -31,10 +31,15 @@ export class Secrets extends APIResource {
31
31
  /**
32
32
  * Retrieves a tool set secret by ID from the tool set
33
33
  */
34
- retrieve(id: string, params: SecretRetrieveParams, options?: RequestOptions): APIPromise<ToolSetSecret> {
35
- const { workspaceId, toolSetId } = params;
34
+ retrieve(
35
+ toolSetID: string,
36
+ id: string,
37
+ params: SecretRetrieveParams | null | undefined = {},
38
+ options?: RequestOptions,
39
+ ): APIPromise<ToolSetSecret> {
40
+ const { workspaceId = this._client.workspaceID } = params ?? {};
36
41
  return this._client.get(
37
- path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetId}/secrets/${id}`,
42
+ path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/secrets/${id}`,
38
43
  options,
39
44
  );
40
45
  }
@@ -42,9 +47,14 @@ export class Secrets extends APIResource {
42
47
  /**
43
48
  * Updates a secret scoped to the tool set
44
49
  */
45
- update(id: string, params: SecretUpdateParams, options?: RequestOptions): APIPromise<ToolSetSecret> {
46
- const { workspaceId, toolSetId, ...body } = params;
47
- return this._client.patch(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetId}/secrets/${id}`, {
50
+ update(
51
+ toolSetID: string,
52
+ id: string,
53
+ params: SecretUpdateParams,
54
+ options?: RequestOptions,
55
+ ): APIPromise<ToolSetSecret> {
56
+ const { workspaceId = this._client.workspaceID, ...body } = params;
57
+ return this._client.patch(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/secrets/${id}`, {
48
58
  body,
49
59
  ...options,
50
60
  });
@@ -55,10 +65,10 @@ export class Secrets extends APIResource {
55
65
  */
56
66
  list(
57
67
  toolSetID: string,
58
- params: SecretListParams,
68
+ params: SecretListParams | null | undefined = {},
59
69
  options?: RequestOptions,
60
70
  ): PagePromise<ToolSetSecretsCursorPagination, ToolSetSecret> {
61
- const { workspaceId, ...query } = params;
71
+ const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
62
72
  return this._client.getAPIList(
63
73
  path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/secrets`,
64
74
  CursorPagination<ToolSetSecret>,
@@ -69,9 +79,14 @@ export class Secrets extends APIResource {
69
79
  /**
70
80
  * Deletes a secret scoped to the tool set
71
81
  */
72
- delete(id: string, params: SecretDeleteParams, options?: RequestOptions): APIPromise<void> {
73
- const { workspaceId, toolSetId } = params;
74
- return this._client.delete(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetId}/secrets/${id}`, {
82
+ delete(
83
+ toolSetID: string,
84
+ id: string,
85
+ params: SecretDeleteParams | null | undefined = {},
86
+ options?: RequestOptions,
87
+ ): APIPromise<void> {
88
+ const { workspaceId = this._client.workspaceID } = params ?? {};
89
+ return this._client.delete(path`/v1/workspaces/${workspaceId}/tool_sets/${toolSetID}/secrets/${id}`, {
75
90
  ...options,
76
91
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
77
92
  });
@@ -113,7 +128,7 @@ export interface SecretCreateParams {
113
128
  /**
114
129
  * Path param: The workspace that owns the tool set.
115
130
  */
116
- workspaceId: string;
131
+ workspaceId?: string;
117
132
 
118
133
  /**
119
134
  * Body param: CreateResourceMetadata contains the user-provided fields for
@@ -133,26 +148,14 @@ export interface SecretRetrieveParams {
133
148
  /**
134
149
  * The workspace that owns the tool set.
135
150
  */
136
- workspaceId: string;
137
-
138
- /**
139
- * The tool set the secret belongs to. Accepts the canonical ts\_… form or the
140
- * external_id:<value> form.
141
- */
142
- toolSetId: string;
151
+ workspaceId?: string;
143
152
  }
144
153
 
145
154
  export interface SecretUpdateParams {
146
155
  /**
147
156
  * Path param: The workspace that owns the tool set.
148
157
  */
149
- workspaceId: string;
150
-
151
- /**
152
- * Path param: The tool set the secret belongs to. Accepts the canonical ts\_… form
153
- * or the external_id:<value> form.
154
- */
155
- toolSetId: string;
158
+ workspaceId?: string;
156
159
 
157
160
  /**
158
161
  * Body param: UpdateResourceMetadata contains the user-provided fields for
@@ -177,7 +180,7 @@ export interface SecretListParams extends CursorPaginationParams {
177
180
  /**
178
181
  * Path param: The workspace that owns the tool set.
179
182
  */
180
- workspaceId: string;
183
+ workspaceId?: string;
181
184
 
182
185
  /**
183
186
  * Query param: When set to true you may use more of your alloted API rate-limit
@@ -204,13 +207,7 @@ export interface SecretDeleteParams {
204
207
  /**
205
208
  * The workspace that owns the tool set.
206
209
  */
207
- workspaceId: string;
208
-
209
- /**
210
- * The tool set the secret belongs to. Accepts the canonical ts\_… form or the
211
- * external_id:<value> form.
212
- */
213
- toolSetId: string;
210
+ workspaceId?: string;
214
211
  }
215
212
 
216
213
  export declare namespace Secrets {