@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
@@ -0,0 +1,325 @@
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 { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
8
+ import { buildHeaders } from '../../internal/headers';
9
+ import { RequestOptions } from '../../internal/request-options';
10
+ import { path } from '../../internal/utils/path';
11
+
12
+ /**
13
+ * MemoryService manages memory layers and their entries at the WORKSPACE level.
14
+ * Layers are named containers that can be composed into an objective's memory
15
+ * stack; entries are the keyed values within a layer.
16
+ *
17
+ * All operations are implicitly scoped to the workspace determined by the JWT
18
+ * token. System-managed layers (e.g., episodic layers created by the runtime)
19
+ * cannot be mutated through this API.
20
+ *
21
+ * Authentication: Bearer token (JWT)
22
+ * Scope: Workspace-level operations
23
+ */
24
+ export class Entries extends APIResource {
25
+ /**
26
+ * Creates a new entry in a memory layer. Returns the detail view, including the
27
+ * resolved content body.
28
+ */
29
+ create(
30
+ memoryLayerID: string,
31
+ body: EntryCreateParams,
32
+ options?: RequestOptions,
33
+ ): APIPromise<MemoryEntryDetail> {
34
+ return this._client.post(path`/v1/memory_layers/${memoryLayerID}/entries`, { body, ...options });
35
+ }
36
+
37
+ /**
38
+ * Retrieves a memory entry by ID from a memory layer. Returns the detail view,
39
+ * including the content body.
40
+ */
41
+ retrieve(id: string, params: EntryRetrieveParams, options?: RequestOptions): APIPromise<MemoryEntryDetail> {
42
+ const { memoryLayerId } = params;
43
+ return this._client.get(path`/v1/memory_layers/${memoryLayerId}/entries/${id}`, options);
44
+ }
45
+
46
+ /**
47
+ * Updates a memory entry in a memory layer. Returns the detail view, including the
48
+ * resolved content body.
49
+ */
50
+ update(id: string, params: EntryUpdateParams, options?: RequestOptions): APIPromise<MemoryEntryDetail> {
51
+ const { memoryLayerId, ...body } = params;
52
+ return this._client.patch(path`/v1/memory_layers/${memoryLayerId}/entries/${id}`, { body, ...options });
53
+ }
54
+
55
+ /**
56
+ * Lists all entries in a memory layer
57
+ */
58
+ list(
59
+ memoryLayerID: string,
60
+ query: EntryListParams | null | undefined = {},
61
+ options?: RequestOptions,
62
+ ): PagePromise<MemoryEntriesCursorPagination, MemoryEntry> {
63
+ return this._client.getAPIList(
64
+ path`/v1/memory_layers/${memoryLayerID}/entries`,
65
+ CursorPagination<MemoryEntry>,
66
+ { query, ...options },
67
+ );
68
+ }
69
+
70
+ /**
71
+ * Deletes a memory entry from a memory layer
72
+ */
73
+ delete(id: string, params: EntryDeleteParams, options?: RequestOptions): APIPromise<void> {
74
+ const { memoryLayerId } = params;
75
+ return this._client.delete(path`/v1/memory_layers/${memoryLayerId}/entries/${id}`, {
76
+ ...options,
77
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
78
+ });
79
+ }
80
+ }
81
+
82
+ export type MemoryEntriesCursorPagination = CursorPagination<MemoryEntry>;
83
+
84
+ /**
85
+ * MemoryEntry is a single keyed value within a MemoryLayer. Entries are addressed
86
+ * by their key, which follows the S3 object key safe-character convention (see
87
+ * MemoryEntrySpec.key for the full rule). Keys are unique within a single layer;
88
+ * the same key may appear in multiple layers, in which case the LIFO stack-walk
89
+ * determines which one wins for a given objective.
90
+ *
91
+ * MemoryEntry is the summary shape, returned by ListMemoryEntries. It does not
92
+ * carry the entry body — callers that need the body must fetch the entry
93
+ * individually via GetMemoryEntry, which returns a MemoryEntryDetail.
94
+ */
95
+ export interface MemoryEntry {
96
+ /**
97
+ * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
98
+ */
99
+ metadata: Shared.ResourceMetadata;
100
+
101
+ /**
102
+ * MemoryEntrySpec is the metadata portion of an entry — the fields that identify
103
+ * and describe it, without the body. It appears on both the summary (MemoryEntry)
104
+ * and detail (MemoryEntryDetail) views.
105
+ */
106
+ spec: MemoryEntrySpec;
107
+
108
+ info?: MemoryEntryInfo;
109
+ }
110
+
111
+ /**
112
+ * MemoryEntryCreateSpec is the input shape for CreateMemoryEntry. It accepts
113
+ * either inline content or a reference to a completed Upload; exactly one of the
114
+ * two must be set.
115
+ */
116
+ export interface MemoryEntryCreateSpec {
117
+ /**
118
+ * See MemoryEntrySpec.key for the full rule set. Same constraints apply here.
119
+ */
120
+ key: string;
121
+
122
+ /**
123
+ * Inline content, written directly into the entry.
124
+ */
125
+ content?: string;
126
+
127
+ description?: string;
128
+
129
+ title?: string;
130
+
131
+ /**
132
+ * ID of a COMPLETE Upload. The server reads the object from storage, copies its
133
+ * bytes into the entry, and marks the upload consumed.
134
+ */
135
+ uploadId?: string;
136
+ }
137
+
138
+ /**
139
+ * MemoryEntryDetail is the full representation of an entry, including the resolved
140
+ * content body. Returned by GetMemoryEntry, CreateMemoryEntry, and
141
+ * UpdateMemoryEntry.
142
+ */
143
+ export interface MemoryEntryDetail {
144
+ /**
145
+ * The resolved body of the entry. For entries created or updated via an upload_id,
146
+ * this is the ingested content, not the original upload handle. May be empty; an
147
+ * entry with only a key, title, and description is valid (e.g., a stub skill being
148
+ * drafted, or an entry where the frontmatter alone is the payload).
149
+ */
150
+ content: string;
151
+
152
+ /**
153
+ * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
154
+ */
155
+ metadata: Shared.ResourceMetadata;
156
+
157
+ /**
158
+ * MemoryEntrySpec is the metadata portion of an entry — the fields that identify
159
+ * and describe it, without the body. It appears on both the summary (MemoryEntry)
160
+ * and detail (MemoryEntryDetail) views.
161
+ */
162
+ spec: MemoryEntrySpec;
163
+
164
+ info?: MemoryEntryInfo;
165
+ }
166
+
167
+ export interface MemoryEntryInfo {
168
+ /**
169
+ * Profile represents a human user at the account level. Profiles are
170
+ * account-scoped resources that can be associated with multiple workspaces through
171
+ * the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
172
+ */
173
+ createdBy?: AccountAPI.Profile;
174
+
175
+ /**
176
+ * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
177
+ */
178
+ memoryLayer?: Shared.ResourceMetadata;
179
+ }
180
+
181
+ /**
182
+ * MemoryEntrySpec is the metadata portion of an entry — the fields that identify
183
+ * and describe it, without the body. It appears on both the summary (MemoryEntry)
184
+ * and detail (MemoryEntryDetail) views.
185
+ */
186
+ export interface MemoryEntrySpec {
187
+ /**
188
+ * The lookup key for this entry within its layer. Must conform to the S3 object
189
+ * key safe-characters spec: ASCII alphanumerics and the special characters !, -,
190
+ * \_, ., \*, ', (, ), and /. Forward slashes may be used to suggest hierarchy
191
+ * (e.g., "skills/postmortem/write"), but lookups are flat — the key is a single
192
+ * opaque string, not a path.
193
+ *
194
+ * Additional rules enforced by the service:
195
+ *
196
+ * - May not begin or end with /
197
+ * - May not contain consecutive slashes (//)
198
+ * - May not begin with reserved prefixes (cadenya/, system/)
199
+ * - Case-sensitive
200
+ * - Unique within the parent layer
201
+ *
202
+ * For skills entries, this key is also the id the model passes to
203
+ * memory_load_skill when it decides to load the entry's content.
204
+ */
205
+ key: string;
206
+
207
+ /**
208
+ * One-line "when to use this" hint shown in the frontmatter manifest for skills
209
+ * entries. The model uses this to decide whether to load the body, so it should be
210
+ * written for the model as the audience. Ignored for layer types that do not
211
+ * advertise frontmatter.
212
+ */
213
+ description?: string;
214
+
215
+ /**
216
+ * Short human/LLM-readable title shown in the frontmatter manifest for skills
217
+ * entries. Ignored for layer types that do not advertise frontmatter.
218
+ */
219
+ title?: string;
220
+ }
221
+
222
+ /**
223
+ * MemoryEntryUpdateSpec is the input shape for UpdateMemoryEntry. Fields present
224
+ * in the request's update_mask are applied; unset fields are left alone. The
225
+ * source oneof is optional for updates — omit it to leave the body untouched, or
226
+ * set exactly one branch to replace it.
227
+ */
228
+ export interface MemoryEntryUpdateSpec {
229
+ content?: string;
230
+
231
+ description?: string;
232
+
233
+ key?: string;
234
+
235
+ title?: string;
236
+
237
+ uploadId?: string;
238
+ }
239
+
240
+ export interface EntryCreateParams {
241
+ /**
242
+ * CreateResourceMetadata contains the user-provided fields for creating a
243
+ * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
244
+ * profile_id, created_at) are excluded since they are set by the server.
245
+ */
246
+ metadata: Shared.CreateResourceMetadata;
247
+
248
+ /**
249
+ * MemoryEntryCreateSpec is the input shape for CreateMemoryEntry. It accepts
250
+ * either inline content or a reference to a completed Upload; exactly one of the
251
+ * two must be set.
252
+ */
253
+ spec: MemoryEntryCreateSpec;
254
+ }
255
+
256
+ export interface EntryRetrieveParams {
257
+ memoryLayerId: string;
258
+ }
259
+
260
+ export interface EntryUpdateParams {
261
+ /**
262
+ * Path param
263
+ */
264
+ memoryLayerId: string;
265
+
266
+ /**
267
+ * Body param: UpdateResourceMetadata contains the user-provided fields for
268
+ * updating a workspace-scoped resource. Read-only fields (id, account_id,
269
+ * workspace_id, profile_id, created_at) are excluded since they are set by the
270
+ * server.
271
+ */
272
+ metadata?: Shared.UpdateResourceMetadata;
273
+
274
+ /**
275
+ * Body param: MemoryEntryUpdateSpec is the input shape for UpdateMemoryEntry.
276
+ * Fields present in the request's update_mask are applied; unset fields are left
277
+ * alone. The source oneof is optional for updates — omit it to leave the body
278
+ * untouched, or set exactly one branch to replace it.
279
+ */
280
+ spec?: MemoryEntryUpdateSpec;
281
+
282
+ /**
283
+ * Body param
284
+ */
285
+ updateMask?: string;
286
+ }
287
+
288
+ export interface EntryListParams extends CursorPaginationParams {
289
+ /**
290
+ * When set to true you may use more of your alloted API rate-limit
291
+ */
292
+ includeInfo?: boolean;
293
+
294
+ /**
295
+ * Filter by key prefix (e.g., "skills/postmortem/" to list all entries under that
296
+ * hierarchy). Matches against the entry's key, not its name.
297
+ */
298
+ prefix?: string;
299
+
300
+ /**
301
+ * Sort order for results (asc or desc by creation time)
302
+ */
303
+ sortOrder?: string;
304
+ }
305
+
306
+ export interface EntryDeleteParams {
307
+ memoryLayerId: string;
308
+ }
309
+
310
+ export declare namespace Entries {
311
+ export {
312
+ type MemoryEntry as MemoryEntry,
313
+ type MemoryEntryCreateSpec as MemoryEntryCreateSpec,
314
+ type MemoryEntryDetail as MemoryEntryDetail,
315
+ type MemoryEntryInfo as MemoryEntryInfo,
316
+ type MemoryEntrySpec as MemoryEntrySpec,
317
+ type MemoryEntryUpdateSpec as MemoryEntryUpdateSpec,
318
+ type MemoryEntriesCursorPagination as MemoryEntriesCursorPagination,
319
+ type EntryCreateParams as EntryCreateParams,
320
+ type EntryRetrieveParams as EntryRetrieveParams,
321
+ type EntryUpdateParams as EntryUpdateParams,
322
+ type EntryListParams as EntryListParams,
323
+ type EntryDeleteParams as EntryDeleteParams,
324
+ };
325
+ }
@@ -0,0 +1,27 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Entries,
5
+ type MemoryEntry,
6
+ type MemoryEntryCreateSpec,
7
+ type MemoryEntryDetail,
8
+ type MemoryEntryInfo,
9
+ type MemoryEntrySpec,
10
+ type MemoryEntryUpdateSpec,
11
+ type EntryCreateParams,
12
+ type EntryRetrieveParams,
13
+ type EntryUpdateParams,
14
+ type EntryListParams,
15
+ type EntryDeleteParams,
16
+ type MemoryEntriesCursorPagination,
17
+ } from './entries';
18
+ export {
19
+ MemoryLayers,
20
+ type MemoryLayer,
21
+ type MemoryLayerInfo,
22
+ type MemoryLayerSpec,
23
+ type MemoryLayerCreateParams,
24
+ type MemoryLayerUpdateParams,
25
+ type MemoryLayerListParams,
26
+ type MemoryLayersCursorPagination,
27
+ } from './memory-layers';
@@ -0,0 +1,224 @@
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 * as EntriesAPI from './entries';
7
+ import {
8
+ Entries,
9
+ EntryCreateParams,
10
+ EntryDeleteParams,
11
+ EntryListParams,
12
+ EntryRetrieveParams,
13
+ EntryUpdateParams,
14
+ MemoryEntriesCursorPagination,
15
+ MemoryEntry,
16
+ MemoryEntryCreateSpec,
17
+ MemoryEntryDetail,
18
+ MemoryEntryInfo,
19
+ MemoryEntrySpec,
20
+ MemoryEntryUpdateSpec,
21
+ } from './entries';
22
+ import { APIPromise } from '../../core/api-promise';
23
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
24
+ import { buildHeaders } from '../../internal/headers';
25
+ import { RequestOptions } from '../../internal/request-options';
26
+ import { path } from '../../internal/utils/path';
27
+
28
+ /**
29
+ * MemoryService manages memory layers and their entries at the WORKSPACE level.
30
+ * Layers are named containers that can be composed into an objective's memory
31
+ * stack; entries are the keyed values within a layer.
32
+ *
33
+ * All operations are implicitly scoped to the workspace determined by the JWT
34
+ * token. System-managed layers (e.g., episodic layers created by the runtime)
35
+ * cannot be mutated through this API.
36
+ *
37
+ * Authentication: Bearer token (JWT)
38
+ * Scope: Workspace-level operations
39
+ */
40
+ export class MemoryLayers extends APIResource {
41
+ entries: EntriesAPI.Entries = new EntriesAPI.Entries(this._client);
42
+
43
+ /**
44
+ * Creates a new memory layer in the workspace
45
+ */
46
+ create(body: MemoryLayerCreateParams, options?: RequestOptions): APIPromise<MemoryLayer> {
47
+ return this._client.post('/v1/memory_layers', { body, ...options });
48
+ }
49
+
50
+ /**
51
+ * Retrieves a memory layer by ID from the workspace
52
+ */
53
+ retrieve(id: string, options?: RequestOptions): APIPromise<MemoryLayer> {
54
+ return this._client.get(path`/v1/memory_layers/${id}`, options);
55
+ }
56
+
57
+ /**
58
+ * Updates a memory layer in the workspace
59
+ */
60
+ update(id: string, body: MemoryLayerUpdateParams, options?: RequestOptions): APIPromise<MemoryLayer> {
61
+ return this._client.patch(path`/v1/memory_layers/${id}`, { body, ...options });
62
+ }
63
+
64
+ /**
65
+ * Lists all memory layers in the workspace
66
+ */
67
+ list(
68
+ query: MemoryLayerListParams | null | undefined = {},
69
+ options?: RequestOptions,
70
+ ): PagePromise<MemoryLayersCursorPagination, MemoryLayer> {
71
+ return this._client.getAPIList('/v1/memory_layers', CursorPagination<MemoryLayer>, { query, ...options });
72
+ }
73
+
74
+ /**
75
+ * Deletes a memory layer from the workspace
76
+ */
77
+ delete(id: string, options?: RequestOptions): APIPromise<void> {
78
+ return this._client.delete(path`/v1/memory_layers/${id}`, {
79
+ ...options,
80
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
81
+ });
82
+ }
83
+ }
84
+
85
+ export type MemoryLayersCursorPagination = CursorPagination<MemoryLayer>;
86
+
87
+ /**
88
+ * MemoryLayer is a named container of memory entries that can be composed into an
89
+ * objective's memory stack. Layers are workspace-scoped resources. The layer type
90
+ * controls how its entries participate in the agent loop — see MemoryLayerType for
91
+ * details.
92
+ *
93
+ * See "Memory stack composition" above for how layers compose at lookup time.
94
+ */
95
+ export interface MemoryLayer {
96
+ /**
97
+ * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
98
+ */
99
+ metadata: Shared.ResourceMetadata;
100
+
101
+ spec: MemoryLayerSpec;
102
+
103
+ info?: MemoryLayerInfo;
104
+ }
105
+
106
+ export interface MemoryLayerInfo {
107
+ /**
108
+ * Profile represents a human user at the account level. Profiles are
109
+ * account-scoped resources that can be associated with multiple workspaces through
110
+ * the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
111
+ */
112
+ createdBy?: AccountAPI.Profile;
113
+
114
+ /**
115
+ * Number of entries currently in this layer.
116
+ */
117
+ entryCount?: number;
118
+
119
+ /**
120
+ * Timestamp of the most recent objective that resolved against this layer. Useful
121
+ * for surfacing unused layers in the dashboard.
122
+ */
123
+ lastUsedAt?: string;
124
+ }
125
+
126
+ export interface MemoryLayerSpec {
127
+ type: 'MEMORY_LAYER_TYPE_UNSPECIFIED' | 'MEMORY_LAYER_TYPE_EPISODIC' | 'MEMORY_LAYER_TYPE_SKILLS';
128
+
129
+ /**
130
+ * Human-readable description of the layer's purpose. Encouraged for user-created
131
+ * layers; system-managed layers may have a generated description.
132
+ */
133
+ description?: string;
134
+
135
+ /**
136
+ * For layers with a finite lifetime (e.g., episodic), the time at which the layer
137
+ * becomes eligible for cleanup. Set by the system; unset for persistent layers.
138
+ */
139
+ expiresAt?: string;
140
+
141
+ /**
142
+ * Server-set. True for layers managed by the system (e.g., episodic layers created
143
+ * automatically when an objective uses an episodic_key). System-managed layers
144
+ * cannot be assigned to objective stacks via the API and cannot be mutated by
145
+ * clients — their lifecycle is controlled entirely by the runtime.
146
+ */
147
+ systemManaged?: boolean;
148
+ }
149
+
150
+ export interface MemoryLayerCreateParams {
151
+ /**
152
+ * CreateResourceMetadata contains the user-provided fields for creating a
153
+ * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
154
+ * profile_id, created_at) are excluded since they are set by the server.
155
+ */
156
+ metadata: Shared.CreateResourceMetadata;
157
+
158
+ spec: MemoryLayerSpec;
159
+ }
160
+
161
+ export interface MemoryLayerUpdateParams {
162
+ /**
163
+ * UpdateResourceMetadata contains the user-provided fields for updating a
164
+ * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
165
+ * profile_id, created_at) are excluded since they are set by the server.
166
+ */
167
+ metadata?: Shared.UpdateResourceMetadata;
168
+
169
+ spec?: MemoryLayerSpec;
170
+
171
+ updateMask?: string;
172
+ }
173
+
174
+ export interface MemoryLayerListParams extends CursorPaginationParams {
175
+ /**
176
+ * When set to true you may use more of your alloted API rate-limit
177
+ */
178
+ includeInfo?: boolean;
179
+
180
+ /**
181
+ * Filter expression (query param: prefix)
182
+ */
183
+ prefix?: string;
184
+
185
+ /**
186
+ * Sort order for results (asc or desc by creation time)
187
+ */
188
+ sortOrder?: string;
189
+
190
+ /**
191
+ * Filter by layer type
192
+ */
193
+ type?: 'MEMORY_LAYER_TYPE_UNSPECIFIED' | 'MEMORY_LAYER_TYPE_EPISODIC' | 'MEMORY_LAYER_TYPE_SKILLS';
194
+ }
195
+
196
+ MemoryLayers.Entries = Entries;
197
+
198
+ export declare namespace MemoryLayers {
199
+ export {
200
+ type MemoryLayer as MemoryLayer,
201
+ type MemoryLayerInfo as MemoryLayerInfo,
202
+ type MemoryLayerSpec as MemoryLayerSpec,
203
+ type MemoryLayersCursorPagination as MemoryLayersCursorPagination,
204
+ type MemoryLayerCreateParams as MemoryLayerCreateParams,
205
+ type MemoryLayerUpdateParams as MemoryLayerUpdateParams,
206
+ type MemoryLayerListParams as MemoryLayerListParams,
207
+ };
208
+
209
+ export {
210
+ Entries as Entries,
211
+ type MemoryEntry as MemoryEntry,
212
+ type MemoryEntryCreateSpec as MemoryEntryCreateSpec,
213
+ type MemoryEntryDetail as MemoryEntryDetail,
214
+ type MemoryEntryInfo as MemoryEntryInfo,
215
+ type MemoryEntrySpec as MemoryEntrySpec,
216
+ type MemoryEntryUpdateSpec as MemoryEntryUpdateSpec,
217
+ type MemoryEntriesCursorPagination as MemoryEntriesCursorPagination,
218
+ type EntryCreateParams as EntryCreateParams,
219
+ type EntryRetrieveParams as EntryRetrieveParams,
220
+ type EntryUpdateParams as EntryUpdateParams,
221
+ type EntryListParams as EntryListParams,
222
+ type EntryDeleteParams as EntryDeleteParams,
223
+ };
224
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './memory-layers/index';
@@ -15,6 +15,8 @@ export {
15
15
  type AssistantToolCall,
16
16
  type CallableTool,
17
17
  type ContextWindowCompacted,
18
+ type MemoryRead,
19
+ type MemoryReference,
18
20
  type Objective,
19
21
  type ObjectiveContextWindow,
20
22
  type ObjectiveContextWindowData,