@cadenya/cadenya 0.86.0 → 0.88.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 (49) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/resources/agents/agents.d.mts +14 -0
  4. package/resources/agents/agents.d.mts.map +1 -1
  5. package/resources/agents/agents.d.ts +14 -0
  6. package/resources/agents/agents.d.ts.map +1 -1
  7. package/resources/agents/agents.js.map +1 -1
  8. package/resources/agents/agents.mjs.map +1 -1
  9. package/resources/agents/variations.d.mts +0 -13
  10. package/resources/agents/variations.d.mts.map +1 -1
  11. package/resources/agents/variations.d.ts +0 -13
  12. package/resources/agents/variations.d.ts.map +1 -1
  13. package/resources/memory-layers/memory-layers.d.mts +20 -0
  14. package/resources/memory-layers/memory-layers.d.mts.map +1 -1
  15. package/resources/memory-layers/memory-layers.d.ts +20 -0
  16. package/resources/memory-layers/memory-layers.d.ts.map +1 -1
  17. package/resources/memory-layers/memory-layers.js.map +1 -1
  18. package/resources/memory-layers/memory-layers.mjs.map +1 -1
  19. package/resources/objectives/index.d.mts +1 -1
  20. package/resources/objectives/index.d.mts.map +1 -1
  21. package/resources/objectives/index.d.ts +1 -1
  22. package/resources/objectives/index.d.ts.map +1 -1
  23. package/resources/objectives/index.js.map +1 -1
  24. package/resources/objectives/index.mjs.map +1 -1
  25. package/resources/objectives/objectives.d.mts +45 -4
  26. package/resources/objectives/objectives.d.mts.map +1 -1
  27. package/resources/objectives/objectives.d.ts +45 -4
  28. package/resources/objectives/objectives.d.ts.map +1 -1
  29. package/resources/objectives/objectives.js.map +1 -1
  30. package/resources/objectives/objectives.mjs.map +1 -1
  31. package/resources/objectives/tool-calls.d.mts +95 -5
  32. package/resources/objectives/tool-calls.d.mts.map +1 -1
  33. package/resources/objectives/tool-calls.d.ts +95 -5
  34. package/resources/objectives/tool-calls.d.ts.map +1 -1
  35. package/resources/objectives/tool-calls.js +8 -0
  36. package/resources/objectives/tool-calls.js.map +1 -1
  37. package/resources/objectives/tool-calls.mjs +8 -0
  38. package/resources/objectives/tool-calls.mjs.map +1 -1
  39. package/src/resources/agents/agents.ts +16 -0
  40. package/src/resources/agents/variations.ts +0 -15
  41. package/src/resources/memory-layers/memory-layers.ts +24 -0
  42. package/src/resources/objectives/index.ts +7 -0
  43. package/src/resources/objectives/objectives.ts +62 -2
  44. package/src/resources/objectives/tool-calls.ts +143 -5
  45. package/src/version.ts +1 -1
  46. package/version.d.mts +1 -1
  47. package/version.d.ts +1 -1
  48. package/version.js +1 -1
  49. package/version.mjs +1 -1
@@ -261,21 +261,6 @@ export interface AgentVariationSpec {
261
261
  */
262
262
  description?: string;
263
263
 
264
- /**
265
- * Enable episodic memory for objectives using this variation. When true, the
266
- * system automatically creates a document namespace for each objective using the
267
- * objective's episodic_key as the external_id, allowing the agent to store and
268
- * retrieve documents specific to that episode.
269
- */
270
- enableEpisodicMemory?: boolean;
271
-
272
- /**
273
- * How long episodic memories should be retained. After this duration, episodic
274
- * document namespaces can be automatically cleaned up. If not set, episodic
275
- * memories are retained indefinitely.
276
- */
277
- episodicMemoryTtl?: number;
278
-
279
264
  /**
280
265
  * ModelConfig defines the model configuration for a variation
281
266
  */
@@ -132,12 +132,24 @@ export interface MemoryLayerInfo {
132
132
  export interface MemoryLayerSpec {
133
133
  type: 'MEMORY_LAYER_TYPE_UNSPECIFIED' | 'MEMORY_LAYER_TYPE_EPISODIC' | 'MEMORY_LAYER_TYPE_SKILLS';
134
134
 
135
+ /**
136
+ * Server-set on episodic layers: the agent this layer belongs to. Unset for
137
+ * non-episodic layers.
138
+ */
139
+ agentId?: string;
140
+
135
141
  /**
136
142
  * Human-readable description of the layer's purpose. Encouraged for user-created
137
143
  * layers; system-managed layers may have a generated description.
138
144
  */
139
145
  description?: string;
140
146
 
147
+ /**
148
+ * Server-set on episodic layers: the caller-supplied episodic key the layer was
149
+ * created for. Unset for non-episodic layers.
150
+ */
151
+ episodicKey?: string;
152
+
141
153
  /**
142
154
  * For layers with a finite lifetime (e.g., episodic), the time at which the layer
143
155
  * becomes eligible for cleanup. Set by the system; unset for persistent layers.
@@ -194,11 +206,23 @@ export interface MemoryLayerUpdateParams {
194
206
  }
195
207
 
196
208
  export interface MemoryLayerListParams extends CursorPaginationParams {
209
+ /**
210
+ * Filter to episodic layers belonging to this agent.
211
+ */
212
+ agentId?: string;
213
+
197
214
  /**
198
215
  * Filter by bundle_key — return only resources owned by this bundle.
199
216
  */
200
217
  bundleKey?: string;
201
218
 
219
+ /**
220
+ * Filter to episodic layers whose episodic key starts with this prefix (e.g.
221
+ * "customer/" matches "customer/42" and "customer/43"). Useful for namespaced
222
+ * keys, similar to a redis key scan.
223
+ */
224
+ episodicKeyPrefix?: string;
225
+
202
226
  /**
203
227
  * When set to true you may use more of your alloted API rate-limit
204
228
  */
@@ -64,6 +64,13 @@ export {
64
64
  type ObjectiveToolCall,
65
65
  type ObjectiveToolCallData,
66
66
  type ObjectiveToolCallInfo,
67
+ type ObjectiveToolCallResult,
68
+ type ObjectiveToolCallResultAudioBlock,
69
+ type ObjectiveToolCallResultContentBlock,
70
+ type ObjectiveToolCallResultImageBlock,
71
+ type ObjectiveToolCallResultTextBlock,
72
+ type ObjectiveToolCallWithResult,
73
+ type ToolCallRetrieveParams,
67
74
  type ToolCallListParams,
68
75
  type ToolCallApproveParams,
69
76
  type ToolCallDenyParams,
@@ -31,10 +31,17 @@ import {
31
31
  ObjectiveToolCall,
32
32
  ObjectiveToolCallData,
33
33
  ObjectiveToolCallInfo,
34
+ ObjectiveToolCallResult,
35
+ ObjectiveToolCallResultAudioBlock,
36
+ ObjectiveToolCallResultContentBlock,
37
+ ObjectiveToolCallResultImageBlock,
38
+ ObjectiveToolCallResultTextBlock,
39
+ ObjectiveToolCallWithResult,
34
40
  ObjectiveToolCallsCursorPagination,
35
41
  ToolCallApproveParams,
36
42
  ToolCallDenyParams,
37
43
  ToolCallListParams,
44
+ ToolCallRetrieveParams,
38
45
  ToolCalls,
39
46
  } from './tool-calls';
40
47
  import * as ToolsAPI from './tools';
@@ -323,6 +330,11 @@ export interface Objective {
323
330
  */
324
331
  data?: { [key: string]: unknown };
325
332
 
333
+ /**
334
+ * Episodic is used to configure the episodic memory for the objective
335
+ */
336
+ episodicMemory?: Objective.EpisodicMemory;
337
+
326
338
  /**
327
339
  * ObjectiveInfo provides read-only aggregated statistics about an objective's
328
340
  * execution
@@ -378,6 +390,25 @@ export interface Objective {
378
390
  userData?: { [key: string]: unknown };
379
391
  }
380
392
 
393
+ export namespace Objective {
394
+ /**
395
+ * Episodic is used to configure the episodic memory for the objective
396
+ */
397
+ export interface EpisodicMemory {
398
+ /**
399
+ * The caller-supplied episodic key. Objectives created with the same key (for the
400
+ * same agent) share one episodic memory layer.
401
+ */
402
+ key?: string;
403
+
404
+ /**
405
+ * The episodic memory layer resolved (created or reused) for this objective's key.
406
+ * Populated by the system at objective creation.
407
+ */
408
+ memoryLayerId?: string;
409
+ }
410
+ }
411
+
381
412
  /**
382
413
  * ObjectiveConfigSnapshot is the point-in-time snapshot of the agent, variation,
383
414
  * and (when applicable) schedule that an objective was started with.
@@ -793,9 +824,15 @@ export interface ToolError {
793
824
  }
794
825
 
795
826
  export interface ToolResult {
796
- content?: string;
827
+ /**
828
+ * ObjectiveToolCallResult is the content a tool returned after execution. Tools
829
+ * can return multiple content blocks, and blocks can be multi-modal (text, image,
830
+ * audio). Media blocks are stored by Cadenya and served as short-lived signed URLs
831
+ * rather than inline bytes.
832
+ */
833
+ result: ToolCallsAPI.ObjectiveToolCallResult;
797
834
 
798
- toolCallId?: string;
835
+ toolCallId: string;
799
836
  }
800
837
 
801
838
  export interface UserMessage {
@@ -849,6 +886,11 @@ export interface ObjectiveCreateParams {
849
886
  */
850
887
  data: { [key: string]: unknown };
851
888
 
889
+ /**
890
+ * Episodic is used to configure the episodic memory for the objective
891
+ */
892
+ episodicMemory?: ObjectiveCreateParams.EpisodicMemory;
893
+
852
894
  /**
853
895
  * Optional override for the initial message sent to the agent. This becomes the
854
896
  * first user message in the LLM chat history. When not set, the selected
@@ -905,6 +947,17 @@ export interface ObjectiveCreateParams {
905
947
  }
906
948
 
907
949
  export namespace ObjectiveCreateParams {
950
+ /**
951
+ * Episodic is used to configure the episodic memory for the objective
952
+ */
953
+ export interface EpisodicMemory {
954
+ /**
955
+ * The caller-supplied episodic key. Objectives created with the same key (for the
956
+ * same agent) share one episodic memory layer.
957
+ */
958
+ key?: string;
959
+ }
960
+
908
961
  export interface Secret {
909
962
  name?: string;
910
963
 
@@ -1116,7 +1169,14 @@ export declare namespace Objectives {
1116
1169
  type ObjectiveToolCall as ObjectiveToolCall,
1117
1170
  type ObjectiveToolCallData as ObjectiveToolCallData,
1118
1171
  type ObjectiveToolCallInfo as ObjectiveToolCallInfo,
1172
+ type ObjectiveToolCallResult as ObjectiveToolCallResult,
1173
+ type ObjectiveToolCallResultAudioBlock as ObjectiveToolCallResultAudioBlock,
1174
+ type ObjectiveToolCallResultContentBlock as ObjectiveToolCallResultContentBlock,
1175
+ type ObjectiveToolCallResultImageBlock as ObjectiveToolCallResultImageBlock,
1176
+ type ObjectiveToolCallResultTextBlock as ObjectiveToolCallResultTextBlock,
1177
+ type ObjectiveToolCallWithResult as ObjectiveToolCallWithResult,
1119
1178
  type ObjectiveToolCallsCursorPagination as ObjectiveToolCallsCursorPagination,
1179
+ type ToolCallRetrieveParams as ToolCallRetrieveParams,
1120
1180
  type ToolCallListParams as ToolCallListParams,
1121
1181
  type ToolCallApproveParams as ToolCallApproveParams,
1122
1182
  type ToolCallDenyParams as ToolCallDenyParams,
@@ -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.86.0'; // x-release-please-version
1
+ export const VERSION = '0.88.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.86.0";
1
+ export declare const VERSION = "0.88.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.86.0";
1
+ export declare const VERSION = "0.88.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.86.0'; // x-release-please-version
4
+ exports.VERSION = '0.88.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.86.0'; // x-release-please-version
1
+ export const VERSION = '0.88.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map