@cadenya/cadenya 0.85.0 → 0.87.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 (40) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/resources/agents/schedules.d.mts +12 -5
  4. package/resources/agents/schedules.d.mts.map +1 -1
  5. package/resources/agents/schedules.d.ts +12 -5
  6. package/resources/agents/schedules.d.ts.map +1 -1
  7. package/resources/agents/variations.d.mts +11 -2
  8. package/resources/agents/variations.d.mts.map +1 -1
  9. package/resources/agents/variations.d.ts +11 -2
  10. package/resources/agents/variations.d.ts.map +1 -1
  11. package/resources/objectives/index.d.mts +1 -1
  12. package/resources/objectives/index.d.mts.map +1 -1
  13. package/resources/objectives/index.d.ts +1 -1
  14. package/resources/objectives/index.d.ts.map +1 -1
  15. package/resources/objectives/index.js.map +1 -1
  16. package/resources/objectives/index.mjs.map +1 -1
  17. package/resources/objectives/objectives.d.mts +29 -7
  18. package/resources/objectives/objectives.d.mts.map +1 -1
  19. package/resources/objectives/objectives.d.ts +29 -7
  20. package/resources/objectives/objectives.d.ts.map +1 -1
  21. package/resources/objectives/objectives.js.map +1 -1
  22. package/resources/objectives/objectives.mjs.map +1 -1
  23. package/resources/objectives/tool-calls.d.mts +95 -5
  24. package/resources/objectives/tool-calls.d.mts.map +1 -1
  25. package/resources/objectives/tool-calls.d.ts +95 -5
  26. package/resources/objectives/tool-calls.d.ts.map +1 -1
  27. package/resources/objectives/tool-calls.js +8 -0
  28. package/resources/objectives/tool-calls.js.map +1 -1
  29. package/resources/objectives/tool-calls.mjs +8 -0
  30. package/resources/objectives/tool-calls.mjs.map +1 -1
  31. package/src/resources/agents/schedules.ts +14 -6
  32. package/src/resources/agents/variations.ts +12 -2
  33. package/src/resources/objectives/index.ts +7 -0
  34. package/src/resources/objectives/objectives.ts +39 -5
  35. package/src/resources/objectives/tool-calls.ts +143 -5
  36. package/src/version.ts +1 -1
  37. package/version.d.mts +1 -1
  38. package/version.d.ts +1 -1
  39. package/version.js +1 -1
  40. package/version.mjs +1 -1
@@ -10,6 +10,22 @@ import { RequestOptions } from '../../internal/request-options';
10
10
  import { path } from '../../internal/utils/path';
11
11
 
12
12
  export class ToolCalls extends APIResource {
13
+ /**
14
+ * Retrieves a single tool call, including the content the tool returned. Media
15
+ * content (images, audio) is served as short-lived signed URLs.
16
+ */
17
+ retrieve(
18
+ toolCallID: string,
19
+ params: ToolCallRetrieveParams,
20
+ options?: RequestOptions,
21
+ ): APIPromise<ObjectiveToolCallWithResult> {
22
+ const { workspaceId, objectiveId } = params;
23
+ return this._client.get(
24
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}`,
25
+ options,
26
+ );
27
+ }
28
+
13
29
  /**
14
30
  * Lists all tool calls for an objective
15
31
  */
@@ -115,11 +131,6 @@ export interface ObjectiveToolCallData {
115
131
  */
116
132
  memo?: string;
117
133
 
118
- /**
119
- * The result content returned by the tool after execution
120
- */
121
- result?: string;
122
-
123
134
  /**
124
135
  * A profile identifies a user or non-human principal (such as an API key) at the
125
136
  * account level. Profiles are account-scoped and can be granted access to multiple
@@ -143,6 +154,126 @@ export interface ObjectiveToolCallInfo {
143
154
  objective?: Shared.OperationMetadata;
144
155
  }
145
156
 
157
+ /**
158
+ * ObjectiveToolCallResult is the content a tool returned after execution. Tools
159
+ * can return multiple content blocks, and blocks can be multi-modal (text, image,
160
+ * audio). Media blocks are stored by Cadenya and served as short-lived signed URLs
161
+ * rather than inline bytes.
162
+ */
163
+ export interface ObjectiveToolCallResult {
164
+ content: Array<ObjectiveToolCallResultContentBlock>;
165
+ }
166
+
167
+ export interface ObjectiveToolCallResultAudioBlock {
168
+ /**
169
+ * When the signed URL expires.
170
+ */
171
+ expiresAt: string;
172
+
173
+ /**
174
+ * IANA media type of the stored audio, e.g. audio/wav.
175
+ */
176
+ mimeType: string;
177
+
178
+ /**
179
+ * Size of the stored audio in bytes.
180
+ */
181
+ sizeBytes: string;
182
+
183
+ /**
184
+ * Short-lived signed URL to download the stored audio.
185
+ */
186
+ url: string;
187
+ }
188
+
189
+ /**
190
+ * ContentBlock is a single block of tool result content. Exactly one of the
191
+ * variants is set.
192
+ */
193
+ export interface ObjectiveToolCallResultContentBlock {
194
+ audio?: ObjectiveToolCallResultAudioBlock;
195
+
196
+ image?: ObjectiveToolCallResultImageBlock;
197
+
198
+ text?: ObjectiveToolCallResultTextBlock;
199
+ }
200
+
201
+ export interface ObjectiveToolCallResultImageBlock {
202
+ /**
203
+ * When the signed URL expires.
204
+ */
205
+ expiresAt: string;
206
+
207
+ /**
208
+ * IANA media type of the stored image, e.g. image/png.
209
+ */
210
+ mimeType: string;
211
+
212
+ /**
213
+ * Size of the stored image in bytes.
214
+ */
215
+ sizeBytes: string;
216
+
217
+ /**
218
+ * Short-lived signed URL to download the stored image.
219
+ */
220
+ url: string;
221
+ }
222
+
223
+ export interface ObjectiveToolCallResultTextBlock {
224
+ text: string;
225
+ }
226
+
227
+ /**
228
+ * ObjectiveToolCallWithResult is an ObjectiveToolCall plus the content the tool
229
+ * returned. Returned by GetObjectiveToolCall.
230
+ */
231
+ export interface ObjectiveToolCallWithResult {
232
+ data: ObjectiveToolCallData;
233
+
234
+ executionStatus:
235
+ | 'TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED'
236
+ | 'TOOL_CALL_EXECUTION_STATUS_PENDING'
237
+ | 'TOOL_CALL_EXECUTION_STATUS_RUNNING'
238
+ | 'TOOL_CALL_EXECUTION_STATUS_COMPLETED'
239
+ | 'TOOL_CALL_EXECUTION_STATUS_ERRORED';
240
+
241
+ info: ObjectiveToolCallInfo;
242
+
243
+ /**
244
+ * Metadata for ephemeral operations and activities (e.g., objectives, executions,
245
+ * runs)
246
+ */
247
+ metadata: Shared.OperationMetadata;
248
+
249
+ /**
250
+ * Current status of the tool call
251
+ */
252
+ status:
253
+ | 'TOOL_CALL_STATUS_UNSPECIFIED'
254
+ | 'TOOL_CALL_STATUS_AUTO_APPROVED'
255
+ | 'TOOL_CALL_STATUS_WAITING_FOR_APPROVAL'
256
+ | 'TOOL_CALL_STATUS_APPROVED'
257
+ | 'TOOL_CALL_STATUS_DENIED';
258
+
259
+ /**
260
+ * ObjectiveToolCallResult is the content a tool returned after execution. Tools
261
+ * can return multiple content blocks, and blocks can be multi-modal (text, image,
262
+ * audio). Media blocks are stored by Cadenya and served as short-lived signed URLs
263
+ * rather than inline bytes.
264
+ */
265
+ result?: ObjectiveToolCallResult;
266
+ }
267
+
268
+ export interface ToolCallRetrieveParams {
269
+ workspaceId: string;
270
+
271
+ /**
272
+ * The ID of the objective. Supports "external_id:" prefix for external IDs.
273
+ */
274
+ objectiveId: string;
275
+ }
276
+
146
277
  export interface ToolCallListParams extends CursorPaginationParams {
147
278
  /**
148
279
  * Path param
@@ -198,7 +329,14 @@ export declare namespace ToolCalls {
198
329
  type ObjectiveToolCall as ObjectiveToolCall,
199
330
  type ObjectiveToolCallData as ObjectiveToolCallData,
200
331
  type ObjectiveToolCallInfo as ObjectiveToolCallInfo,
332
+ type ObjectiveToolCallResult as ObjectiveToolCallResult,
333
+ type ObjectiveToolCallResultAudioBlock as ObjectiveToolCallResultAudioBlock,
334
+ type ObjectiveToolCallResultContentBlock as ObjectiveToolCallResultContentBlock,
335
+ type ObjectiveToolCallResultImageBlock as ObjectiveToolCallResultImageBlock,
336
+ type ObjectiveToolCallResultTextBlock as ObjectiveToolCallResultTextBlock,
337
+ type ObjectiveToolCallWithResult as ObjectiveToolCallWithResult,
201
338
  type ObjectiveToolCallsCursorPagination as ObjectiveToolCallsCursorPagination,
339
+ type ToolCallRetrieveParams as ToolCallRetrieveParams,
202
340
  type ToolCallListParams as ToolCallListParams,
203
341
  type ToolCallApproveParams as ToolCallApproveParams,
204
342
  type ToolCallDenyParams as ToolCallDenyParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.85.0'; // x-release-please-version
1
+ export const VERSION = '0.87.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.85.0";
1
+ export declare const VERSION = "0.87.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.85.0";
1
+ export declare const VERSION = "0.87.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.85.0'; // x-release-please-version
4
+ exports.VERSION = '0.87.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.85.0'; // x-release-please-version
1
+ export const VERSION = '0.87.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map