@cadenya/cadenya 0.44.0 → 0.46.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 (98) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/client.d.mts +31 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +31 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +27 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +27 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent-variations.d.mts +79 -1
  12. package/resources/agent-variations.d.mts.map +1 -1
  13. package/resources/agent-variations.d.ts +79 -1
  14. package/resources/agent-variations.d.ts.map +1 -1
  15. package/resources/agent-variations.js +31 -0
  16. package/resources/agent-variations.js.map +1 -1
  17. package/resources/agent-variations.mjs +31 -0
  18. package/resources/agent-variations.mjs.map +1 -1
  19. package/resources/agents/webhook-deliveries.d.mts +2 -2
  20. package/resources/agents/webhook-deliveries.d.mts.map +1 -1
  21. package/resources/agents/webhook-deliveries.d.ts +2 -2
  22. package/resources/agents/webhook-deliveries.d.ts.map +1 -1
  23. package/resources/index.d.mts +4 -2
  24. package/resources/index.d.mts.map +1 -1
  25. package/resources/index.d.ts +4 -2
  26. package/resources/index.d.ts.map +1 -1
  27. package/resources/index.js +5 -1
  28. package/resources/index.js.map +1 -1
  29. package/resources/index.mjs +2 -0
  30. package/resources/index.mjs.map +1 -1
  31. package/resources/memory-layers/entries.d.mts +241 -0
  32. package/resources/memory-layers/entries.d.mts.map +1 -0
  33. package/resources/memory-layers/entries.d.ts +241 -0
  34. package/resources/memory-layers/entries.d.ts.map +1 -0
  35. package/resources/memory-layers/entries.js +63 -0
  36. package/resources/memory-layers/entries.js.map +1 -0
  37. package/resources/memory-layers/entries.mjs +59 -0
  38. package/resources/memory-layers/entries.mjs.map +1 -0
  39. package/resources/memory-layers/index.d.mts +3 -0
  40. package/resources/memory-layers/index.d.mts.map +1 -0
  41. package/resources/memory-layers/index.d.ts +3 -0
  42. package/resources/memory-layers/index.d.ts.map +1 -0
  43. package/resources/memory-layers/index.js +9 -0
  44. package/resources/memory-layers/index.js.map +1 -0
  45. package/resources/memory-layers/index.mjs +4 -0
  46. package/resources/memory-layers/index.mjs.map +1 -0
  47. package/resources/memory-layers/memory-layers.d.mts +139 -0
  48. package/resources/memory-layers/memory-layers.d.mts.map +1 -0
  49. package/resources/memory-layers/memory-layers.d.ts +139 -0
  50. package/resources/memory-layers/memory-layers.d.ts.map +1 -0
  51. package/resources/memory-layers/memory-layers.js +65 -0
  52. package/resources/memory-layers/memory-layers.js.map +1 -0
  53. package/resources/memory-layers/memory-layers.mjs +60 -0
  54. package/resources/memory-layers/memory-layers.mjs.map +1 -0
  55. package/resources/memory-layers.d.mts +2 -0
  56. package/resources/memory-layers.d.mts.map +1 -0
  57. package/resources/memory-layers.d.ts +2 -0
  58. package/resources/memory-layers.d.ts.map +1 -0
  59. package/resources/memory-layers.js +6 -0
  60. package/resources/memory-layers.js.map +1 -0
  61. package/resources/memory-layers.mjs +3 -0
  62. package/resources/memory-layers.mjs.map +1 -0
  63. package/resources/objectives/index.d.mts +1 -1
  64. package/resources/objectives/index.d.mts.map +1 -1
  65. package/resources/objectives/index.d.ts +1 -1
  66. package/resources/objectives/index.d.ts.map +1 -1
  67. package/resources/objectives/index.js.map +1 -1
  68. package/resources/objectives/index.mjs.map +1 -1
  69. package/resources/objectives/objectives.d.mts +76 -1
  70. package/resources/objectives/objectives.d.mts.map +1 -1
  71. package/resources/objectives/objectives.d.ts +76 -1
  72. package/resources/objectives/objectives.d.ts.map +1 -1
  73. package/resources/objectives/objectives.js.map +1 -1
  74. package/resources/objectives/objectives.mjs.map +1 -1
  75. package/resources/uploads.d.mts +97 -0
  76. package/resources/uploads.d.mts.map +1 -0
  77. package/resources/uploads.d.ts +97 -0
  78. package/resources/uploads.d.ts.map +1 -0
  79. package/resources/uploads.js +33 -0
  80. package/resources/uploads.js.map +1 -0
  81. package/resources/uploads.mjs +29 -0
  82. package/resources/uploads.mjs.map +1 -0
  83. package/src/client.ts +73 -0
  84. package/src/resources/agent-variations.ts +124 -0
  85. package/src/resources/agents/webhook-deliveries.ts +4 -2
  86. package/src/resources/index.ts +17 -0
  87. package/src/resources/memory-layers/entries.ts +325 -0
  88. package/src/resources/memory-layers/index.ts +27 -0
  89. package/src/resources/memory-layers/memory-layers.ts +224 -0
  90. package/src/resources/memory-layers.ts +3 -0
  91. package/src/resources/objectives/index.ts +2 -0
  92. package/src/resources/objectives/objectives.ts +85 -0
  93. package/src/resources/uploads.ts +128 -0
  94. package/src/version.ts +1 -1
  95. package/version.d.mts +1 -1
  96. package/version.d.ts +1 -1
  97. package/version.js +1 -1
  98. package/version.mjs +1 -1
@@ -207,6 +207,51 @@ export interface ContextWindowCompacted {
207
207
  summary?: string;
208
208
  }
209
209
 
210
+ /**
211
+ * MemoryRead is emitted each time the agent resolves a key against the memory
212
+ * stack and loads an entry. Lookups that miss (key not found in any layer) do not
213
+ * emit this event.
214
+ */
215
+ export interface MemoryRead {
216
+ /**
217
+ * The specific entry that was read.
218
+ */
219
+ memoryEntryId?: string;
220
+
221
+ /**
222
+ * The layer the entry resolved to. The top-most layer that contained the key —
223
+ * other layers beneath it that also contained the key are shadowed and not
224
+ * referenced here.
225
+ */
226
+ memoryLayerId?: string;
227
+
228
+ /**
229
+ * Human-readable description of the read, set by the runtime. For example: "Loaded
230
+ * skill", "Resolved context key". Not machine-parsed; intended for UI display
231
+ * alongside the other events in an objective's timeline.
232
+ */
233
+ message?: string;
234
+ }
235
+
236
+ /**
237
+ * MemoryReference identifies a memory layer or a specific entry within one, for
238
+ * composition into a memory stack. Used on objectives (where entry pinning is
239
+ * permitted).
240
+ *
241
+ * memory*layer_id accepts both the canonical form (memlyr*…) and the external-id
242
+ * form (external_id:my-custom-id). The same applies to memory_entry_id.
243
+ */
244
+ export interface MemoryReference {
245
+ /**
246
+ * When set, pushes only this entry from memory_layer_id onto the stack — behaves
247
+ * as a single-entry layer (only this key resolves at this position). The entry
248
+ * must belong to memory_layer_id; mismatches are rejected with InvalidArgument.
249
+ */
250
+ memoryEntryId?: string;
251
+
252
+ memoryLayerId?: string;
253
+ }
254
+
210
255
  export interface Objective {
211
256
  data: ObjectiveData;
212
257
 
@@ -316,6 +361,29 @@ export interface ObjectiveData {
316
361
  */
317
362
  initialMessage?: string;
318
363
 
364
+ /**
365
+ * Memory layers/entries to push onto this objective's memory stack on top of the
366
+ * baseline stack inherited from the selected variation.
367
+ *
368
+ * See "Memory stack composition" in memory.proto for lookup semantics.
369
+ *
370
+ * Array order is push order: the first element sits lower in the objective's
371
+ * contribution to the stack; the LAST element ends up on top of the effective
372
+ * stack. Entries pinned via memory_entry_id behave as single-entry layers at their
373
+ * position.
374
+ *
375
+ * System-managed layers (e.g., episodic) cannot be referenced here; they attach
376
+ * themselves automatically via the runtime based on episodic_key.
377
+ *
378
+ * Stack size cap: the TOTAL effective stack (variation's memory layers
379
+ *
380
+ * - this field) must not exceed 10 entries. A request that would produce an
381
+ * effective stack larger than 10 is rejected with InvalidArgument. Variations
382
+ * themselves are capped at 10 memory layer assignments, so a variation that is
383
+ * already "full" leaves no room for objective-level references.
384
+ */
385
+ memoryStack?: Array<MemoryReference>;
386
+
319
387
  /**
320
388
  * A parent objective means the objective was spawned off using a separate agent to
321
389
  * complete an objective
@@ -358,6 +426,13 @@ export interface ObjectiveEventData {
358
426
 
359
427
  error?: ObjectiveError;
360
428
 
429
+ /**
430
+ * MemoryRead is emitted each time the agent resolves a key against the memory
431
+ * stack and loads an entry. Lookups that miss (key not found in any layer) do not
432
+ * emit this event.
433
+ */
434
+ memoryRead?: MemoryRead;
435
+
361
436
  subObjectiveCreated?: SubObjectiveCreated;
362
437
 
363
438
  toolApprovalRequested?: ToolApprovalRequested;
@@ -472,6 +547,14 @@ export interface ObjectiveInfo {
472
547
  */
473
548
  createdBy?: AccountAPI.Profile;
474
549
 
550
+ /**
551
+ * The effective memory stack at objective creation time, flattened from the
552
+ * variation's baseline plus ObjectiveData.memory_stack. Order is push order (last
553
+ * = top). Returned on reads so clients can see exactly what stack the objective is
554
+ * using without having to re-join variation state.
555
+ */
556
+ effectiveMemoryStack?: Array<MemoryReference>;
557
+
475
558
  /**
476
559
  * Total number of context windows that this objective has generated
477
560
  */
@@ -746,6 +829,8 @@ export declare namespace Objectives {
746
829
  type AssistantToolCall as AssistantToolCall,
747
830
  type CallableTool as CallableTool,
748
831
  type ContextWindowCompacted as ContextWindowCompacted,
832
+ type MemoryRead as MemoryRead,
833
+ type MemoryReference as MemoryReference,
749
834
  type Objective as Objective,
750
835
  type ObjectiveContextWindow as ObjectiveContextWindow,
751
836
  type ObjectiveContextWindowData as ObjectiveContextWindowData,
@@ -0,0 +1,128 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as AccountAPI from './account';
5
+ import * as Shared from './shared';
6
+ import { APIPromise } from '../core/api-promise';
7
+ import { RequestOptions } from '../internal/request-options';
8
+ import { path } from '../internal/utils/path';
9
+
10
+ /**
11
+ * UploadService issues short-lived presigned URLs for direct client-to-object-
12
+ * storage uploads at the WORKSPACE level. Created uploads can be referenced by
13
+ * id when creating or updating resources that accept binary content (e.g.,
14
+ * MemoryEntry).
15
+ *
16
+ * Authentication: Bearer token (JWT)
17
+ * Scope: Workspace-level operations
18
+ */
19
+ export class Uploads extends APIResource {
20
+ /**
21
+ * Issues a short-lived presigned URL for direct upload to object storage. The
22
+ * returned id is used to reference the upload from resources that accept binary
23
+ * content.
24
+ */
25
+ create(body: UploadCreateParams, options?: RequestOptions): APIPromise<Upload> {
26
+ return this._client.post('/v1/uploads', { body, ...options });
27
+ }
28
+
29
+ /**
30
+ * Retrieves the current state of an upload, including its lifecycle status
31
+ */
32
+ retrieve(id: string, options?: RequestOptions): APIPromise<Upload> {
33
+ return this._client.get(path`/v1/uploads/${id}`, options);
34
+ }
35
+ }
36
+
37
+ /**
38
+ * Upload is a workspace-scoped handle representing a single file upload flow.
39
+ * Clients call CreateUpload to receive a short-lived presigned URL, PUT the file
40
+ * directly to object storage, then reference the upload by id when creating or
41
+ * updating resources that accept binary content.
42
+ *
43
+ * Uploads are one-shot: once consumed by a creating or updating resource, the
44
+ * upload transitions to UPLOAD_STATUS_CONSUMED and cannot be reused. Unused
45
+ * uploads expire and are garbage-collected by the runtime.
46
+ */
47
+ export interface Upload {
48
+ info: UploadInfo;
49
+
50
+ /**
51
+ * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
52
+ */
53
+ metadata: Shared.ResourceMetadata;
54
+
55
+ spec: UploadSpec;
56
+ }
57
+
58
+ export interface UploadInfo {
59
+ /**
60
+ * Profile represents a human user at the account level. Profiles are
61
+ * account-scoped resources that can be associated with multiple workspaces through
62
+ * the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
63
+ */
64
+ createdBy?: AccountAPI.Profile;
65
+
66
+ /**
67
+ * Lifecycle state. Transitions PENDING → COMPLETE (storage confirms the object
68
+ * exists) → CONSUMED (a resource referenced this upload), or → EXPIRED (URL
69
+ * elapsed without a PUT).
70
+ */
71
+ status?:
72
+ | 'UPLOAD_STATUS_UNSPECIFIED'
73
+ | 'UPLOAD_STATUS_PENDING'
74
+ | 'UPLOAD_STATUS_COMPLETE'
75
+ | 'UPLOAD_STATUS_CONSUMED'
76
+ | 'UPLOAD_STATUS_EXPIRED';
77
+
78
+ /**
79
+ * Presigned PUT URL. Short-lived. The client must PUT with the exact Content-Type
80
+ * declared in the spec, and the body length must match size_bytes.
81
+ */
82
+ uploadUrl?: string;
83
+
84
+ /**
85
+ * Absolute time at which upload_url stops working.
86
+ */
87
+ uploadUrlExpiresAt?: string;
88
+ }
89
+
90
+ export interface UploadSpec {
91
+ /**
92
+ * MIME type the client will send. Baked into the presigned URL's signature — the
93
+ * PUT must match exactly or object storage will reject it.
94
+ */
95
+ contentType: string;
96
+
97
+ /**
98
+ * Client-supplied filename. Used for audit and display only; does not control the
99
+ * object's storage path.
100
+ */
101
+ filename: string;
102
+
103
+ /**
104
+ * Expected size of the upload in bytes. Baked into the presigned URL as a
105
+ * Content-Length constraint.
106
+ */
107
+ sizeBytes: string;
108
+ }
109
+
110
+ export interface UploadCreateParams {
111
+ /**
112
+ * CreateResourceMetadata contains the user-provided fields for creating a
113
+ * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
114
+ * profile_id, created_at) are excluded since they are set by the server.
115
+ */
116
+ metadata: Shared.CreateResourceMetadata;
117
+
118
+ spec: UploadSpec;
119
+ }
120
+
121
+ export declare namespace Uploads {
122
+ export {
123
+ type Upload as Upload,
124
+ type UploadInfo as UploadInfo,
125
+ type UploadSpec as UploadSpec,
126
+ type UploadCreateParams as UploadCreateParams,
127
+ };
128
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.44.0'; // x-release-please-version
1
+ export const VERSION = '0.46.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.44.0";
1
+ export declare const VERSION = "0.46.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.44.0";
1
+ export declare const VERSION = "0.46.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.44.0'; // x-release-please-version
4
+ exports.VERSION = '0.46.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.44.0'; // x-release-please-version
1
+ export const VERSION = '0.46.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map