@cadenya/cadenya 1.1.0 → 1.2.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.
package/api.md CHANGED
@@ -280,27 +280,27 @@ client.agents.variations.update(agentId: string, id: string, params?: AgentVaria
280
280
  Add an assignment to a variation
281
281
 
282
282
  ```ts
283
- client.agents.variations.addAssignment(agentId: string, variationId: string, params: AgentVariationAddAssignmentParams, options?: RequestOptions): APIPromise<VariationAssignment>
283
+ client.agents.variations.addAssignment(agentId: string, variationId: string, params: AgentVariationAddAssignmentParams, options?: RequestOptions): APIPromise<AgentVariation>
284
284
  ```
285
- Remove an assignment from a variation
285
+ Attach a memory layer to a variation
286
286
 
287
287
  ```ts
288
- client.agents.variations.removeAssignment(agentId: string, variationId: string, id: string, params?: AgentVariationRemoveAssignmentParams, options?: RequestOptions): APIPromise<void>
288
+ client.agents.variations.addMemoryLayer(agentId: string, variationId: string, params: AgentVariationAddMemoryLayerParams, options?: RequestOptions): APIPromise<AgentVariation>
289
289
  ```
290
- Attach a memory layer to a variation
290
+ Remove an assignment from a variation
291
291
 
292
292
  ```ts
293
- client.agents.variations.addMemoryLayer(agentId: string, variationId: string, params: AgentVariationAddMemoryLayerParams, options?: RequestOptions): APIPromise<VariationMemoryLayerAssignment>
293
+ client.agents.variations.removeAssignment(agentId: string, variationId: string, params: AgentVariationRemoveAssignmentParams, options?: RequestOptions): APIPromise<AgentVariation>
294
294
  ```
295
295
  Remove a memory layer assignment from a variation
296
296
 
297
297
  ```ts
298
- client.agents.variations.removeMemoryLayer(agentId: string, variationId: string, id: string, params?: AgentVariationRemoveMemoryLayerParams, options?: RequestOptions): APIPromise<void>
298
+ client.agents.variations.removeMemoryLayer(agentId: string, variationId: string, params: AgentVariationRemoveMemoryLayerParams, options?: RequestOptions): APIPromise<AgentVariation>
299
299
  ```
300
300
  Update a variation's memory layer assignment
301
301
 
302
302
  ```ts
303
- client.agents.variations.updateMemoryLayer(agentId: string, variationId: string, id: string, params?: AgentVariationUpdateMemoryLayerParams, options?: RequestOptions): APIPromise<VariationMemoryLayerAssignment>
303
+ client.agents.variations.updateMemoryLayer(agentId: string, variationId: string, params: AgentVariationUpdateMemoryLayerParams, options?: RequestOptions): APIPromise<AgentVariation>
304
304
  ```
305
305
 
306
306
  ## aiProviderKeys
package/dist/client.js CHANGED
@@ -50,7 +50,7 @@ export class Cadenya {
50
50
  authHeader: () => ({ Authorization: `Bearer ${apiKey}` }),
51
51
  maxRetries: options.maxRetries ?? 0,
52
52
  timeout: options.timeout,
53
- defaultHeaders: { 'User-Agent': 'cadenya-typescript/1.0.2 (api 1.0)', ...options.defaultHeaders },
53
+ defaultHeaders: { 'User-Agent': 'cadenya-typescript/1.2.0 (api 1.0)', ...options.defaultHeaders },
54
54
  fetch: options.fetch,
55
55
  logger: options.logger,
56
56
  logLevel: options.logLevel,
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MA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,CAAC;IACD,OAAO,GAAG,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;AAClC,CAAC","sourcesContent":["// Generated by redwood. Do not edit by hand.\n\nimport { HttpClient } from './core/http.js';\nimport type { Logger, LogLevel } from './core/http.js';\nimport { Webhooks } from './webhooks.js';\nimport { Accounts } from './resources/accounts.js';\nimport { ApiKeys } from './resources/api-keys.js';\nimport { WorkspaceAdmin } from './resources/workspace-admin.js';\nimport { Profiles } from './resources/profiles.js';\nimport { Workspaces } from './resources/workspaces.js';\nimport { Agents } from './resources/agents.js';\nimport { AiProviderKeys } from './resources/ai-provider-keys.js';\nimport { Models } from './resources/models.js';\nimport { MemoryLayers } from './resources/memory-layers.js';\nimport { Objectives } from './resources/objectives.js';\nimport { ToolSearch } from './resources/tool-search.js';\nimport { Tenants } from './resources/tenants.js';\nimport { ToolSets } from './resources/tool-sets.js';\nimport { Uploads } from './resources/uploads.js';\nimport { WidgetSessions } from './resources/widget-sessions.js';\nimport { Widgets } from './resources/widgets.js';\nimport { WorkspaceSecrets } from './resources/workspace-secrets.js';\n\nexport interface ClientOptions {\n /** API key. Defaults to the CADENYA_API_KEY environment variable. */\n apiKey?: string;\n /** Override the API base URL. Defaults to https://api.cadenya.com. */\n baseURL?: string;\n /** Max automatic retries for retryable failures. Defaults to 0. */\n maxRetries?: number;\n /**\n * Deadline for ordinary (non-streaming) requests in milliseconds; override\n * per request with `options.timeout`. Streams bound only response-header\n * acquisition — body lifetime stays under the caller's AbortSignal.\n * Defaults to 60000; a non-finite or <= 0 value disables the deadline.\n */\n timeout?: number;\n /** Headers sent with every request. */\n defaultHeaders?: Record<string, string>;\n /** Custom fetch implementation. */\n fetch?: typeof fetch;\n /** Destination for SDK logs. Defaults to `console`. */\n logger?: Logger;\n /** 'debug' | 'warn' (default) | 'off'. Never logs headers or bodies. */\n logLevel?: LogLevel;\n /** Default `workspaceId` for every call that takes one. Defaults to the CADENYA_WORKSPACE_ID environment variable. */\n workspaceId?: string;\n /** Secret for webhook signature verification. Defaults to the CADENYA_WEBHOOK_SECRET environment variable. */\n webhookSecret?: string;\n}\n\nexport class Cadenya {\n readonly accounts: Accounts;\n readonly apiKeys: ApiKeys;\n readonly workspaceAdmin: WorkspaceAdmin;\n readonly profiles: Profiles;\n readonly workspaces: Workspaces;\n readonly agents: Agents;\n readonly aiProviderKeys: AiProviderKeys;\n readonly models: Models;\n readonly memoryLayers: MemoryLayers;\n readonly objectives: Objectives;\n readonly toolSearch: ToolSearch;\n readonly tenants: Tenants;\n readonly toolSets: ToolSets;\n readonly uploads: Uploads;\n readonly widgetSessions: WidgetSessions;\n readonly widgets: Widgets;\n readonly workspaceSecrets: WorkspaceSecrets;\n readonly webhooks: Webhooks;\n\n private readonly _client: HttpClient;\n\n constructor(options: ClientOptions = {}) {\n // Presence is not validity: empty strings from options or environment\n // are configuration mistakes, not credentials.\n const apiKey = resolveOption('apiKey', options.apiKey, readEnv('CADENYA_API_KEY'));\n if (!apiKey) {\n throw new Error(\n \"Missing API key. Pass it with `new Cadenya({ apiKey })` or set the CADENYA_API_KEY environment variable.\",\n );\n }\n this._client = new HttpClient({\n baseURL: resolveOption('baseURL', options.baseURL, readEnv('CADENYA_BASE_URL')) ?? 'https://api.cadenya.com',\n authHeader: () => ({ Authorization: `Bearer ${apiKey}` }),\n maxRetries: options.maxRetries ?? 0,\n timeout: options.timeout,\n defaultHeaders: { 'User-Agent': 'cadenya-typescript/1.0.2 (api 1.0)', ...options.defaultHeaders },\n fetch: options.fetch,\n logger: options.logger,\n logLevel: options.logLevel,\n defaults: { workspaceId: resolveOption('workspaceId', options.workspaceId, readEnv('CADENYA_WORKSPACE_ID')) },\n });\n this.webhooks = new Webhooks(resolveOption('webhookSecret', options.webhookSecret, readEnv('CADENYA_WEBHOOK_SECRET')));\n this.accounts = new Accounts(this._client);\n this.apiKeys = new ApiKeys(this._client);\n this.workspaceAdmin = new WorkspaceAdmin(this._client);\n this.profiles = new Profiles(this._client);\n this.workspaces = new Workspaces(this._client);\n this.agents = new Agents(this._client);\n this.aiProviderKeys = new AiProviderKeys(this._client);\n this.models = new Models(this._client);\n this.memoryLayers = new MemoryLayers(this._client);\n this.objectives = new Objectives(this._client);\n this.toolSearch = new ToolSearch(this._client);\n this.tenants = new Tenants(this._client);\n this.toolSets = new ToolSets(this._client);\n this.uploads = new Uploads(this._client);\n this.widgetSessions = new WidgetSessions(this._client);\n this.widgets = new Widgets(this._client);\n this.workspaceSecrets = new WorkspaceSecrets(this._client);\n }\n}\n\nfunction readEnv(name: string): string | undefined {\n const env = (globalThis as { process?: { env?: Record<string, string | undefined> } })\n .process?.env;\n return env?.[name];\n}\n\n// Presence is not validity: an explicitly provided option must be usable —\n// a blank value is a configuration mistake and never silently falls back to\n// the environment or a default. Only an OMITTED option reads the env.\nfunction resolveOption(\n label: string,\n explicit: string | undefined,\n env: string | undefined,\n): string | undefined {\n if (explicit !== undefined) {\n const value = explicit.trim();\n if (!value) {\n throw new Error(\n `${label} must not be blank when provided explicitly; omit it to use the environment instead.`,\n );\n }\n return value;\n }\n return env?.trim() || undefined;\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM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,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,sFAAsF,CAC/F,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,GAAG,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;AAClC,CAAC","sourcesContent":["// Generated by redwood. Do not edit by hand.\n\nimport { HttpClient } from './core/http.js';\nimport type { Logger, LogLevel } from './core/http.js';\nimport { Webhooks } from './webhooks.js';\nimport { Accounts } from './resources/accounts.js';\nimport { ApiKeys } from './resources/api-keys.js';\nimport { WorkspaceAdmin } from './resources/workspace-admin.js';\nimport { Profiles } from './resources/profiles.js';\nimport { Workspaces } from './resources/workspaces.js';\nimport { Agents } from './resources/agents.js';\nimport { AiProviderKeys } from './resources/ai-provider-keys.js';\nimport { Models } from './resources/models.js';\nimport { MemoryLayers } from './resources/memory-layers.js';\nimport { Objectives } from './resources/objectives.js';\nimport { ToolSearch } from './resources/tool-search.js';\nimport { Tenants } from './resources/tenants.js';\nimport { ToolSets } from './resources/tool-sets.js';\nimport { Uploads } from './resources/uploads.js';\nimport { WidgetSessions } from './resources/widget-sessions.js';\nimport { Widgets } from './resources/widgets.js';\nimport { WorkspaceSecrets } from './resources/workspace-secrets.js';\n\nexport interface ClientOptions {\n /** API key. Defaults to the CADENYA_API_KEY environment variable. */\n apiKey?: string;\n /** Override the API base URL. Defaults to https://api.cadenya.com. */\n baseURL?: string;\n /** Max automatic retries for retryable failures. Defaults to 0. */\n maxRetries?: number;\n /**\n * Deadline for ordinary (non-streaming) requests in milliseconds; override\n * per request with `options.timeout`. Streams bound only response-header\n * acquisition — body lifetime stays under the caller's AbortSignal.\n * Defaults to 60000; a non-finite or <= 0 value disables the deadline.\n */\n timeout?: number;\n /** Headers sent with every request. */\n defaultHeaders?: Record<string, string>;\n /** Custom fetch implementation. */\n fetch?: typeof fetch;\n /** Destination for SDK logs. Defaults to `console`. */\n logger?: Logger;\n /** 'debug' | 'warn' (default) | 'off'. Never logs headers or bodies. */\n logLevel?: LogLevel;\n /** Default `workspaceId` for every call that takes one. Defaults to the CADENYA_WORKSPACE_ID environment variable. */\n workspaceId?: string;\n /** Secret for webhook signature verification. Defaults to the CADENYA_WEBHOOK_SECRET environment variable. */\n webhookSecret?: string;\n}\n\nexport class Cadenya {\n readonly accounts: Accounts;\n readonly apiKeys: ApiKeys;\n readonly workspaceAdmin: WorkspaceAdmin;\n readonly profiles: Profiles;\n readonly workspaces: Workspaces;\n readonly agents: Agents;\n readonly aiProviderKeys: AiProviderKeys;\n readonly models: Models;\n readonly memoryLayers: MemoryLayers;\n readonly objectives: Objectives;\n readonly toolSearch: ToolSearch;\n readonly tenants: Tenants;\n readonly toolSets: ToolSets;\n readonly uploads: Uploads;\n readonly widgetSessions: WidgetSessions;\n readonly widgets: Widgets;\n readonly workspaceSecrets: WorkspaceSecrets;\n readonly webhooks: Webhooks;\n\n private readonly _client: HttpClient;\n\n constructor(options: ClientOptions = {}) {\n // Presence is not validity: empty strings from options or environment\n // are configuration mistakes, not credentials.\n const apiKey = resolveOption('apiKey', options.apiKey, readEnv('CADENYA_API_KEY'));\n if (!apiKey) {\n throw new Error(\n \"Missing API key. Pass it with `new Cadenya({ apiKey })` or set the CADENYA_API_KEY environment variable.\",\n );\n }\n this._client = new HttpClient({\n baseURL: resolveOption('baseURL', options.baseURL, readEnv('CADENYA_BASE_URL')) ?? 'https://api.cadenya.com',\n authHeader: () => ({ Authorization: `Bearer ${apiKey}` }),\n maxRetries: options.maxRetries ?? 0,\n timeout: options.timeout,\n defaultHeaders: { 'User-Agent': 'cadenya-typescript/1.2.0 (api 1.0)', ...options.defaultHeaders },\n fetch: options.fetch,\n logger: options.logger,\n logLevel: options.logLevel,\n defaults: { workspaceId: resolveOption('workspaceId', options.workspaceId, readEnv('CADENYA_WORKSPACE_ID')) },\n });\n this.webhooks = new Webhooks(resolveOption('webhookSecret', options.webhookSecret, readEnv('CADENYA_WEBHOOK_SECRET')));\n this.accounts = new Accounts(this._client);\n this.apiKeys = new ApiKeys(this._client);\n this.workspaceAdmin = new WorkspaceAdmin(this._client);\n this.profiles = new Profiles(this._client);\n this.workspaces = new Workspaces(this._client);\n this.agents = new Agents(this._client);\n this.aiProviderKeys = new AiProviderKeys(this._client);\n this.models = new Models(this._client);\n this.memoryLayers = new MemoryLayers(this._client);\n this.objectives = new Objectives(this._client);\n this.toolSearch = new ToolSearch(this._client);\n this.tenants = new Tenants(this._client);\n this.toolSets = new ToolSets(this._client);\n this.uploads = new Uploads(this._client);\n this.widgetSessions = new WidgetSessions(this._client);\n this.widgets = new Widgets(this._client);\n this.workspaceSecrets = new WorkspaceSecrets(this._client);\n }\n}\n\nfunction readEnv(name: string): string | undefined {\n const env = (globalThis as { process?: { env?: Record<string, string | undefined> } })\n .process?.env;\n return env?.[name];\n}\n\n// Presence is not validity: an explicitly provided option must be usable —\n// a blank value is a configuration mistake and never silently falls back to\n// the environment or a default. Only an OMITTED option reads the env.\nfunction resolveOption(\n label: string,\n explicit: string | undefined,\n env: string | undefined,\n): string | undefined {\n if (explicit !== undefined) {\n const value = explicit.trim();\n if (!value) {\n throw new Error(\n `${label} must not be blank when provided explicitly; omit it to use the environment instead.`,\n );\n }\n return value;\n }\n return env?.trim() || undefined;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, RequestOptions, APIPromise } from '../core/http.js';
2
2
  import { Page } from '../core/pagination.js';
3
- import type { AddAgentVariationAssignmentRequestParam, AgentVariation, AgentVariationSpec, CreateResourceMetadata, UpdateResourceMetadata, VariationAssignment, VariationMemoryLayerAssignment } from '../types.js';
3
+ import type { AddAgentVariationAssignmentRequestParam, AgentVariation, AgentVariationSpec, CreateResourceMetadata, RemoveAgentVariationAssignmentRequestParam, UpdateResourceMetadata } from '../types.js';
4
4
  export interface AgentVariationListParams {
5
5
  /**
6
6
  * Workspace ID.
@@ -68,30 +68,24 @@ export interface AgentVariationUpdateParams {
68
68
  metadata?: UpdateResourceMetadata;
69
69
  spec?: AgentVariationSpec;
70
70
  /**
71
- * Fields to update
71
+ * Fields to update. Assignment lists are replaced as a whole, never merged.
72
+ * Select spec.assignments or spec.memory_layer_assignments to replace/clear
73
+ * one list. Selecting spec replaces the entire spec (including omitted lists);
74
+ * * replaces all mutable fields. Element/index paths are not supported.
75
+ * Without a mask, infer paths from non-empty fields: non-empty assignment
76
+ * lists replace existing lists, while omitted/empty lists remain unchanged.
77
+ * To clear a list, explicitly include its path in the mask.
72
78
  */
73
79
  updateMask?: string;
74
80
  }
75
- export interface AgentVariationAddAssignmentParams {
76
- /**
77
- * The request body, sent as-is.
78
- */
79
- body: AddAgentVariationAssignmentRequestParam;
80
- /**
81
- * Workspace ID.
82
- *
83
- * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
84
- */
85
- workspaceId?: string;
86
- }
87
- export interface AgentVariationRemoveAssignmentParams {
81
+ export type AgentVariationAddAssignmentParams = AddAgentVariationAssignmentRequestParam & {
88
82
  /**
89
83
  * Workspace ID.
90
84
  *
91
85
  * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
92
86
  */
93
87
  workspaceId?: string;
94
- }
88
+ };
95
89
  export interface AgentVariationAddMemoryLayerParams {
96
90
  /**
97
91
  * Layer to attach. Accepts the canonical `memlyr_…` form or the `external_id:<value>` form.
@@ -110,25 +104,41 @@ export interface AgentVariationAddMemoryLayerParams {
110
104
  */
111
105
  position?: number;
112
106
  }
113
- export interface AgentVariationRemoveMemoryLayerParams {
107
+ export type AgentVariationRemoveAssignmentParams = RemoveAgentVariationAssignmentRequestParam & {
114
108
  /**
115
109
  * Workspace ID.
116
110
  *
117
111
  * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
118
112
  */
119
113
  workspaceId?: string;
120
- }
121
- export interface AgentVariationUpdateMemoryLayerParams {
114
+ };
115
+ export interface AgentVariationRemoveMemoryLayerParams {
116
+ /**
117
+ * Layer to detach. Accepts memlyr_… or external_id:<value>.
118
+ */
119
+ memoryLayerId: string;
122
120
  /**
123
121
  * Workspace ID.
124
122
  *
125
123
  * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
126
124
  */
127
125
  workspaceId?: string;
126
+ }
127
+ export interface AgentVariationUpdateMemoryLayerParams {
128
+ /**
129
+ * Layer to reposition. Accepts memlyr_… or external_id:<value>.
130
+ */
131
+ memoryLayerId: string;
128
132
  /**
129
133
  * New position. Only field currently updatable on an assignment.
130
134
  */
131
- position?: number;
135
+ position: number;
136
+ /**
137
+ * Workspace ID.
138
+ *
139
+ * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
140
+ */
141
+ workspaceId?: string;
132
142
  }
133
143
  export declare class AgentVariations {
134
144
  private readonly _client;
@@ -186,45 +196,45 @@ export declare class AgentVariations {
186
196
  *
187
197
  * @example
188
198
  * ```ts
189
- * const variationAssignment = await client.agents.variations.addAssignment('agent_123', 'variation_123', { body: { toolId: 'sample', type: 'toolId' } });
199
+ * const agentVariation = await client.agents.variations.addAssignment('agent_123', 'variation_123', { toolId: 'sample', type: 'toolId' });
190
200
  * ```
191
201
  */
192
- addAssignment(agentId: string, variationId: string, params: AgentVariationAddAssignmentParams, options?: RequestOptions): APIPromise<VariationAssignment>;
202
+ addAssignment(agentId: string, variationId: string, params: AgentVariationAddAssignmentParams, options?: RequestOptions): APIPromise<AgentVariation>;
193
203
  /**
194
- * Remove an assignment from a variation
204
+ * Attach a memory layer to a variation
195
205
  *
196
206
  * @example
197
207
  * ```ts
198
- * await client.agents.variations.removeAssignment('agent_123', 'variation_123', '_123');
208
+ * const agentVariation = await client.agents.variations.addMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample' });
199
209
  * ```
200
210
  */
201
- removeAssignment(agentId: string, variationId: string, id: string, params?: AgentVariationRemoveAssignmentParams, options?: RequestOptions): APIPromise<void>;
211
+ addMemoryLayer(agentId: string, variationId: string, params: AgentVariationAddMemoryLayerParams, options?: RequestOptions): APIPromise<AgentVariation>;
202
212
  /**
203
- * Attach a memory layer to a variation
213
+ * Remove an assignment from a variation
204
214
  *
205
215
  * @example
206
216
  * ```ts
207
- * const variationMemoryLayerAssignment = await client.agents.variations.addMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample' });
217
+ * const agentVariation = await client.agents.variations.removeAssignment('agent_123', 'variation_123', { toolId: 'sample', type: 'toolId' });
208
218
  * ```
209
219
  */
210
- addMemoryLayer(agentId: string, variationId: string, params: AgentVariationAddMemoryLayerParams, options?: RequestOptions): APIPromise<VariationMemoryLayerAssignment>;
220
+ removeAssignment(agentId: string, variationId: string, params: AgentVariationRemoveAssignmentParams, options?: RequestOptions): APIPromise<AgentVariation>;
211
221
  /**
212
222
  * Remove a memory layer assignment from a variation
213
223
  *
214
224
  * @example
215
225
  * ```ts
216
- * await client.agents.variations.removeMemoryLayer('agent_123', 'variation_123', '_123');
226
+ * const agentVariation = await client.agents.variations.removeMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample' });
217
227
  * ```
218
228
  */
219
- removeMemoryLayer(agentId: string, variationId: string, id: string, params?: AgentVariationRemoveMemoryLayerParams, options?: RequestOptions): APIPromise<void>;
229
+ removeMemoryLayer(agentId: string, variationId: string, params: AgentVariationRemoveMemoryLayerParams, options?: RequestOptions): APIPromise<AgentVariation>;
220
230
  /**
221
231
  * Update a variation's memory layer assignment
222
232
  *
223
233
  * @example
224
234
  * ```ts
225
- * const variationMemoryLayerAssignment = await client.agents.variations.updateMemoryLayer('agent_123', 'variation_123', '_123');
235
+ * const agentVariation = await client.agents.variations.updateMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample', position: 1 });
226
236
  * ```
227
237
  */
228
- updateMemoryLayer(agentId: string, variationId: string, id: string, params?: AgentVariationUpdateMemoryLayerParams, options?: RequestOptions): APIPromise<VariationMemoryLayerAssignment>;
238
+ updateMemoryLayer(agentId: string, variationId: string, params: AgentVariationUpdateMemoryLayerParams, options?: RequestOptions): APIPromise<AgentVariation>;
229
239
  }
230
240
  //# sourceMappingURL=agent-variations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-variations.d.ts","sourceRoot":"","sources":["../../src/resources/agent-variations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAA+B,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,EAAE,uCAAuC,EAAE,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,EAA+B,sBAAsB,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAGjP,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,IAAI,EAAE,kBAAkB,CAAC;IACzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B;;OAEG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AU,CAAC,8BAA8B,CAAC;CAO1L"}
1
+ {"version":3,"file":"agent-variations.d.ts","sourceRoot":"","sources":["../../src/resources/agent-variations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAA+B,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,EAAE,uCAAuC,EAAE,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,EAA+B,0CAA0C,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGxO,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,IAAI,EAAE,kBAAkB,CAAC;IACzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MA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// Generated by redwood. Do not edit by hand.
2
2
  import { pathSegment, snapshotParams } from '../core/http.js';
3
3
  import { Page } from '../core/pagination.js';
4
- import { wireAddAgentVariationAssignmentRequest } from '../types.js';
4
+ import { wireAddAgentVariationAssignmentRequest, wireRemoveAgentVariationAssignmentRequest } from '../types.js';
5
5
  export class AgentVariations {
6
6
  _client;
7
7
  constructor(_client) {
@@ -95,47 +95,49 @@ export class AgentVariations {
95
95
  *
96
96
  * @example
97
97
  * ```ts
98
- * const variationAssignment = await client.agents.variations.addAssignment('agent_123', 'variation_123', { body: { toolId: 'sample', type: 'toolId' } });
98
+ * const agentVariation = await client.agents.variations.addAssignment('agent_123', 'variation_123', { toolId: 'sample', type: 'toolId' });
99
99
  * ```
100
100
  */
101
101
  addAssignment(agentId, variationId, params, options) {
102
102
  return this._client.requestAPI(() => {
103
+ const { workspaceId: _bodyParam0, ..._body } = params;
103
104
  const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
104
105
  if (workspaceId === undefined)
105
106
  throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
106
- return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}/assignments`, body: wireAddAgentVariationAssignmentRequest(params.body) };
107
+ return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}:addAssignment`, body: wireAddAgentVariationAssignmentRequest(_body) };
107
108
  }, options);
108
109
  }
109
110
  /**
110
- * Remove an assignment from a variation
111
+ * Attach a memory layer to a variation
111
112
  *
112
113
  * @example
113
114
  * ```ts
114
- * await client.agents.variations.removeAssignment('agent_123', 'variation_123', '_123');
115
+ * const agentVariation = await client.agents.variations.addMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample' });
115
116
  * ```
116
117
  */
117
- removeAssignment(agentId, variationId, id, params, options) {
118
+ addMemoryLayer(agentId, variationId, params, options) {
118
119
  return this._client.requestAPI(() => {
119
- const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
120
+ const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
120
121
  if (workspaceId === undefined)
121
122
  throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
122
- return { method: 'DELETE', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}/assignments/${pathSegment('id', id)}`, void: true };
123
+ return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}:addMemoryLayer`, body: { memoryLayerId: params.memoryLayerId, position: params.position } };
123
124
  }, options);
124
125
  }
125
126
  /**
126
- * Attach a memory layer to a variation
127
+ * Remove an assignment from a variation
127
128
  *
128
129
  * @example
129
130
  * ```ts
130
- * const variationMemoryLayerAssignment = await client.agents.variations.addMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample' });
131
+ * const agentVariation = await client.agents.variations.removeAssignment('agent_123', 'variation_123', { toolId: 'sample', type: 'toolId' });
131
132
  * ```
132
133
  */
133
- addMemoryLayer(agentId, variationId, params, options) {
134
+ removeAssignment(agentId, variationId, params, options) {
134
135
  return this._client.requestAPI(() => {
136
+ const { workspaceId: _bodyParam0, ..._body } = params;
135
137
  const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
136
138
  if (workspaceId === undefined)
137
139
  throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
138
- return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}/memory_layer_assignments`, body: { memoryLayerId: params.memoryLayerId, position: params.position } };
140
+ return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}:removeAssignment`, body: wireRemoveAgentVariationAssignmentRequest(_body) };
139
141
  }, options);
140
142
  }
141
143
  /**
@@ -143,15 +145,15 @@ export class AgentVariations {
143
145
  *
144
146
  * @example
145
147
  * ```ts
146
- * await client.agents.variations.removeMemoryLayer('agent_123', 'variation_123', '_123');
148
+ * const agentVariation = await client.agents.variations.removeMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample' });
147
149
  * ```
148
150
  */
149
- removeMemoryLayer(agentId, variationId, id, params, options) {
151
+ removeMemoryLayer(agentId, variationId, params, options) {
150
152
  return this._client.requestAPI(() => {
151
- const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
153
+ const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
152
154
  if (workspaceId === undefined)
153
155
  throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
154
- return { method: 'DELETE', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}/memory_layer_assignments/${pathSegment('id', id)}`, void: true };
156
+ return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}:removeMemoryLayer`, body: { memoryLayerId: params.memoryLayerId } };
155
157
  }, options);
156
158
  }
157
159
  /**
@@ -159,15 +161,15 @@ export class AgentVariations {
159
161
  *
160
162
  * @example
161
163
  * ```ts
162
- * const variationMemoryLayerAssignment = await client.agents.variations.updateMemoryLayer('agent_123', 'variation_123', '_123');
164
+ * const agentVariation = await client.agents.variations.updateMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample', position: 1 });
163
165
  * ```
164
166
  */
165
- updateMemoryLayer(agentId, variationId, id, params, options) {
167
+ updateMemoryLayer(agentId, variationId, params, options) {
166
168
  return this._client.requestAPI(() => {
167
- const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
169
+ const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
168
170
  if (workspaceId === undefined)
169
171
  throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
170
- return { method: 'PATCH', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}/memory_layer_assignments/${pathSegment('id', id)}`, body: { position: params?.position } };
172
+ return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}:updateMemoryLayer`, body: { memoryLayerId: params.memoryLayerId, position: params.position } };
171
173
  }, options);
172
174
  }
173
175
  }
@@ -1 +1 @@
1
- {"version":3,"file":"agent-variations.js","sourceRoot":"","sources":["../../src/resources/agent-variations.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,OAAO,EAA0C,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,sCAAsC,EAAE,MAAM,aAAa,CAAC;AA6IrE,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD;;;;;;;;;;OAUG;IACH,KAAK,CAAC,IAAI,CAAC,OAAe,EAAE,MAAiC,EAAE,OAAwB;QACrF,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,IAAI,IAAI,CAAC,OAAO,CAA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AS;gBAAE,MAAM,IAAI,KAAK,CAAC,uHAAuH,CAAC,CAAC;YACxK,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,kBAAkB,WAAW,CAAC,aAAa,EAAE,WAAW,CAAC,WAAW,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,eAAe,WAAW,CAAC,aAAa,EAAE,WAAW,CAAC,6BAA6B,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC/P,CAAC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,iBAAiB,CAAC,OAAe,EAAE,WAAmB,EAAE,EAAU,EAAE,MAA8C,EAAE,OAAwB;QAC1I,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAiC,GAAG,EAAE;YAClE,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,SAAS,CAAC;YAClH,IAAI,WAAW,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,uHAAuH,CAAC,CAAC;YACxK,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,kBAAkB,WAAW,CAAC,aAAa,EAAE,WAAW,CAAC,WAAW,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,eAAe,WAAW,CAAC,aAAa,EAAE,WAAW,CAAC,6BAA6B,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC;QACxR,CAAC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC;CACF","sourcesContent":["// Generated by redwood. Do not edit by hand.\n\nimport { HttpClient, RequestOptions, APIPromise, pathSegment, snapshotParams } from '../core/http.js';\nimport { Page } from '../core/pagination.js';\nimport type { AddAgentVariationAssignmentRequestParam, AgentVariation, AgentVariationSpec, CreateResourceMetadata, ListAgentVariationsResponse, UpdateResourceMetadata, VariationAssignment, VariationMemoryLayerAssignment } from '../types.js';\nimport { wireAddAgentVariationAssignmentRequest } from '../types.js';\n\nexport interface AgentVariationListParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n /**\n * Maximum number of results to return\n */\n limit?: number;\n /**\n * Pagination cursor from previous response\n */\n cursor?: string;\n /**\n * Sort order for results (asc or desc by creation time)\n */\n sortOrder?: string;\n /**\n * When true, the `info` field on each returned variation is populated.\n * Requests with this flag count more against your rate limit.\n */\n includeInfo?: boolean;\n /**\n * Filters by metadata labels. Comma-separated key=value pairs,\n * e.g. \"env=prod,team=ai\". A resource matches only if every pair\n * matches exactly (AND semantics).\n */\n labels?: string;\n}\n\nexport interface AgentVariationCreateParams {\n metadata: CreateResourceMetadata;\n spec: AgentVariationSpec;\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentVariationRetrieveParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentVariationDeleteParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentVariationUpdateParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n metadata?: UpdateResourceMetadata;\n spec?: AgentVariationSpec;\n /**\n * Fields to update\n */\n updateMask?: string;\n}\n\nexport interface AgentVariationAddAssignmentParams {\n /**\n * The request body, sent as-is.\n */\n body: AddAgentVariationAssignmentRequestParam;\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentVariationRemoveAssignmentParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentVariationAddMemoryLayerParams {\n /**\n * Layer to attach. Accepts the canonical `memlyr_…` form or the `external_id:<value>` form.\n */\n memoryLayerId: string;\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n /**\n * Position in the baseline cascade (lower = more specific). If\n * omitted, the server appends at the most general end (max existing\n * position + 1).\n */\n position?: number;\n}\n\nexport interface AgentVariationRemoveMemoryLayerParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentVariationUpdateMemoryLayerParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n /**\n * New position. Only field currently updatable on an assignment.\n */\n position?: number;\n}\n\nexport class AgentVariations {\n constructor(private readonly _client: HttpClient) {}\n\n /**\n * List variations\n * \n * @example\n * ```ts\n * const page = await client.agents.variations.list('agent_123');\n * for await (const item of page) {\n * // auto-fetches every page\n * }\n * ```\n */\n async list(agentId: string, params?: AgentVariationListParams, options?: RequestOptions): Promise<Page<AgentVariation>> {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n const _base = snapshotParams(params);\n const response = await this._client.request<ListAgentVariationsResponse>({ method: 'GET', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations`, query: { limit: params?.limit, cursor: params?.cursor, sortOrder: params?.sortOrder, includeInfo: params?.includeInfo, labels: params?.labels } }, options);\n return new Page(response.items ?? [], response.pagination?.nextCursor, (cursor) => this.list(agentId, { ..._base, cursor: cursor }, options));\n }\n\n /**\n * Create a new variation\n * \n * @example\n * ```ts\n * const agentVariation = await client.agents.variations.create('agent_123', { metadata: { name: 'sample' }, spec: { } });\n * ```\n */\n create(agentId: string, params: AgentVariationCreateParams, options?: RequestOptions): APIPromise<AgentVariation> {\n return this._client.requestAPI<AgentVariation>(() => {\n const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations`, body: { metadata: params.metadata, spec: params.spec } };\n }, options);\n }\n\n /**\n * Get a variation by ID\n * \n * @example\n * ```ts\n * const agentVariation = await client.agents.variations.retrieve('agent_123', '_123');\n * ```\n */\n retrieve(agentId: string, id: string, params?: AgentVariationRetrieveParams, options?: RequestOptions): APIPromise<AgentVariation> {\n return this._client.requestAPI<AgentVariation>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'GET', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('id', id)}` };\n }, options);\n }\n\n /**\n * Delete a variation\n * \n * @example\n * ```ts\n * await client.agents.variations.delete('agent_123', '_123');\n * ```\n */\n delete(agentId: string, id: string, params?: AgentVariationDeleteParams, options?: RequestOptions): APIPromise<void> {\n return this._client.requestAPI<void>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'DELETE', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('id', id)}`, void: true };\n }, options);\n }\n\n /**\n * Update a variation\n * \n * @example\n * ```ts\n * const agentVariation = await client.agents.variations.update('agent_123', '_123');\n * ```\n */\n update(agentId: string, id: string, params?: AgentVariationUpdateParams, options?: RequestOptions): APIPromise<AgentVariation> {\n return this._client.requestAPI<AgentVariation>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'PATCH', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('id', id)}`, body: { metadata: params?.metadata, spec: params?.spec, updateMask: params?.updateMask } };\n }, options);\n }\n\n /**\n * Add an assignment to a variation\n * \n * @example\n * ```ts\n * const variationAssignment = await client.agents.variations.addAssignment('agent_123', 'variation_123', { body: { toolId: 'sample', type: 'toolId' } });\n * ```\n */\n addAssignment(agentId: string, variationId: string, params: AgentVariationAddAssignmentParams, options?: RequestOptions): APIPromise<VariationAssignment> {\n return this._client.requestAPI<VariationAssignment>(() => {\n const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}/assignments`, body: wireAddAgentVariationAssignmentRequest(params.body) };\n }, options);\n }\n\n /**\n * Remove an assignment from a variation\n * \n * @example\n * ```ts\n * await client.agents.variations.removeAssignment('agent_123', 'variation_123', '_123');\n * ```\n */\n removeAssignment(agentId: string, variationId: string, id: string, params?: AgentVariationRemoveAssignmentParams, options?: RequestOptions): APIPromise<void> {\n return this._client.requestAPI<void>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'DELETE', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}/assignments/${pathSegment('id', id)}`, void: true };\n }, options);\n }\n\n /**\n * Attach a memory layer to a variation\n * \n * @example\n * ```ts\n * const variationMemoryLayerAssignment = await client.agents.variations.addMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample' });\n * ```\n */\n addMemoryLayer(agentId: string, variationId: string, params: AgentVariationAddMemoryLayerParams, options?: RequestOptions): APIPromise<VariationMemoryLayerAssignment> {\n return this._client.requestAPI<VariationMemoryLayerAssignment>(() => {\n const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}/memory_layer_assignments`, body: { memoryLayerId: params.memoryLayerId, position: params.position } };\n }, options);\n }\n\n /**\n * Remove a memory layer assignment from a variation\n * \n * @example\n * ```ts\n * await client.agents.variations.removeMemoryLayer('agent_123', 'variation_123', '_123');\n * ```\n */\n removeMemoryLayer(agentId: string, variationId: string, id: string, params?: AgentVariationRemoveMemoryLayerParams, options?: RequestOptions): APIPromise<void> {\n return this._client.requestAPI<void>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'DELETE', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}/memory_layer_assignments/${pathSegment('id', id)}`, void: true };\n }, options);\n }\n\n /**\n * Update a variation's memory layer assignment\n * \n * @example\n * ```ts\n * const variationMemoryLayerAssignment = await client.agents.variations.updateMemoryLayer('agent_123', 'variation_123', '_123');\n * ```\n */\n updateMemoryLayer(agentId: string, variationId: string, id: string, params?: AgentVariationUpdateMemoryLayerParams, options?: RequestOptions): APIPromise<VariationMemoryLayerAssignment> {\n return this._client.requestAPI<VariationMemoryLayerAssignment>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'PATCH', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}/memory_layer_assignments/${pathSegment('id', id)}`, body: { position: params?.position } };\n }, options);\n }\n}\n"]}
1
+ {"version":3,"file":"agent-variations.js","sourceRoot":"","sources":["../../src/resources/agent-variations.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,OAAO,EAA0C,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,sCAAsC,EAAE,yCAAyC,EAAE,MAAM,aAAa,CAAC;AAuJhH,MAAM,OAAO,eAAe;IACG;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AC,eAAe,WAAW,CAAC,aAAa,EAAE,WAAW,CAAC,oBAAoB,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC3R,CAAC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC;CACF","sourcesContent":["// Generated by redwood. Do not edit by hand.\n\nimport { HttpClient, RequestOptions, APIPromise, pathSegment, snapshotParams } from '../core/http.js';\nimport { Page } from '../core/pagination.js';\nimport type { AddAgentVariationAssignmentRequestParam, AgentVariation, AgentVariationSpec, CreateResourceMetadata, ListAgentVariationsResponse, RemoveAgentVariationAssignmentRequestParam, UpdateResourceMetadata } from '../types.js';\nimport { wireAddAgentVariationAssignmentRequest, wireRemoveAgentVariationAssignmentRequest } from '../types.js';\n\nexport interface AgentVariationListParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n /**\n * Maximum number of results to return\n */\n limit?: number;\n /**\n * Pagination cursor from previous response\n */\n cursor?: string;\n /**\n * Sort order for results (asc or desc by creation time)\n */\n sortOrder?: string;\n /**\n * When true, the `info` field on each returned variation is populated.\n * Requests with this flag count more against your rate limit.\n */\n includeInfo?: boolean;\n /**\n * Filters by metadata labels. Comma-separated key=value pairs,\n * e.g. \"env=prod,team=ai\". A resource matches only if every pair\n * matches exactly (AND semantics).\n */\n labels?: string;\n}\n\nexport interface AgentVariationCreateParams {\n metadata: CreateResourceMetadata;\n spec: AgentVariationSpec;\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentVariationRetrieveParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentVariationDeleteParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentVariationUpdateParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n metadata?: UpdateResourceMetadata;\n spec?: AgentVariationSpec;\n /**\n * Fields to update. Assignment lists are replaced as a whole, never merged.\n * Select spec.assignments or spec.memory_layer_assignments to replace/clear\n * one list. Selecting spec replaces the entire spec (including omitted lists);\n * * replaces all mutable fields. Element/index paths are not supported.\n * Without a mask, infer paths from non-empty fields: non-empty assignment\n * lists replace existing lists, while omitted/empty lists remain unchanged.\n * To clear a list, explicitly include its path in the mask.\n */\n updateMask?: string;\n}\n\nexport type AgentVariationAddAssignmentParams = AddAgentVariationAssignmentRequestParam & {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n};\n\nexport interface AgentVariationAddMemoryLayerParams {\n /**\n * Layer to attach. Accepts the canonical `memlyr_…` form or the `external_id:<value>` form.\n */\n memoryLayerId: string;\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n /**\n * Position in the baseline cascade (lower = more specific). If\n * omitted, the server appends at the most general end (max existing\n * position + 1).\n */\n position?: number;\n}\n\nexport type AgentVariationRemoveAssignmentParams = RemoveAgentVariationAssignmentRequestParam & {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n};\n\nexport interface AgentVariationRemoveMemoryLayerParams {\n /**\n * Layer to detach. Accepts memlyr_… or external_id:<value>.\n */\n memoryLayerId: string;\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentVariationUpdateMemoryLayerParams {\n /**\n * Layer to reposition. Accepts memlyr_… or external_id:<value>.\n */\n memoryLayerId: string;\n /**\n * New position. Only field currently updatable on an assignment.\n */\n position: number;\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport class AgentVariations {\n constructor(private readonly _client: HttpClient) {}\n\n /**\n * List variations\n * \n * @example\n * ```ts\n * const page = await client.agents.variations.list('agent_123');\n * for await (const item of page) {\n * // auto-fetches every page\n * }\n * ```\n */\n async list(agentId: string, params?: AgentVariationListParams, options?: RequestOptions): Promise<Page<AgentVariation>> {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n const _base = snapshotParams(params);\n const response = await this._client.request<ListAgentVariationsResponse>({ method: 'GET', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations`, query: { limit: params?.limit, cursor: params?.cursor, sortOrder: params?.sortOrder, includeInfo: params?.includeInfo, labels: params?.labels } }, options);\n return new Page(response.items ?? [], response.pagination?.nextCursor, (cursor) => this.list(agentId, { ..._base, cursor: cursor }, options));\n }\n\n /**\n * Create a new variation\n * \n * @example\n * ```ts\n * const agentVariation = await client.agents.variations.create('agent_123', { metadata: { name: 'sample' }, spec: { } });\n * ```\n */\n create(agentId: string, params: AgentVariationCreateParams, options?: RequestOptions): APIPromise<AgentVariation> {\n return this._client.requestAPI<AgentVariation>(() => {\n const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations`, body: { metadata: params.metadata, spec: params.spec } };\n }, options);\n }\n\n /**\n * Get a variation by ID\n * \n * @example\n * ```ts\n * const agentVariation = await client.agents.variations.retrieve('agent_123', '_123');\n * ```\n */\n retrieve(agentId: string, id: string, params?: AgentVariationRetrieveParams, options?: RequestOptions): APIPromise<AgentVariation> {\n return this._client.requestAPI<AgentVariation>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'GET', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('id', id)}` };\n }, options);\n }\n\n /**\n * Delete a variation\n * \n * @example\n * ```ts\n * await client.agents.variations.delete('agent_123', '_123');\n * ```\n */\n delete(agentId: string, id: string, params?: AgentVariationDeleteParams, options?: RequestOptions): APIPromise<void> {\n return this._client.requestAPI<void>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'DELETE', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('id', id)}`, void: true };\n }, options);\n }\n\n /**\n * Update a variation\n * \n * @example\n * ```ts\n * const agentVariation = await client.agents.variations.update('agent_123', '_123');\n * ```\n */\n update(agentId: string, id: string, params?: AgentVariationUpdateParams, options?: RequestOptions): APIPromise<AgentVariation> {\n return this._client.requestAPI<AgentVariation>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'PATCH', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('id', id)}`, body: { metadata: params?.metadata, spec: params?.spec, updateMask: params?.updateMask } };\n }, options);\n }\n\n /**\n * Add an assignment to a variation\n * \n * @example\n * ```ts\n * const agentVariation = await client.agents.variations.addAssignment('agent_123', 'variation_123', { toolId: 'sample', type: 'toolId' });\n * ```\n */\n addAssignment(agentId: string, variationId: string, params: AgentVariationAddAssignmentParams, options?: RequestOptions): APIPromise<AgentVariation> {\n return this._client.requestAPI<AgentVariation>(() => {\n const { workspaceId: _bodyParam0, ..._body } = params;\n const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}:addAssignment`, body: wireAddAgentVariationAssignmentRequest(_body) };\n }, options);\n }\n\n /**\n * Attach a memory layer to a variation\n * \n * @example\n * ```ts\n * const agentVariation = await client.agents.variations.addMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample' });\n * ```\n */\n addMemoryLayer(agentId: string, variationId: string, params: AgentVariationAddMemoryLayerParams, options?: RequestOptions): APIPromise<AgentVariation> {\n return this._client.requestAPI<AgentVariation>(() => {\n const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}:addMemoryLayer`, body: { memoryLayerId: params.memoryLayerId, position: params.position } };\n }, options);\n }\n\n /**\n * Remove an assignment from a variation\n * \n * @example\n * ```ts\n * const agentVariation = await client.agents.variations.removeAssignment('agent_123', 'variation_123', { toolId: 'sample', type: 'toolId' });\n * ```\n */\n removeAssignment(agentId: string, variationId: string, params: AgentVariationRemoveAssignmentParams, options?: RequestOptions): APIPromise<AgentVariation> {\n return this._client.requestAPI<AgentVariation>(() => {\n const { workspaceId: _bodyParam0, ..._body } = params;\n const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}:removeAssignment`, body: wireRemoveAgentVariationAssignmentRequest(_body) };\n }, options);\n }\n\n /**\n * Remove a memory layer assignment from a variation\n * \n * @example\n * ```ts\n * const agentVariation = await client.agents.variations.removeMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample' });\n * ```\n */\n removeMemoryLayer(agentId: string, variationId: string, params: AgentVariationRemoveMemoryLayerParams, options?: RequestOptions): APIPromise<AgentVariation> {\n return this._client.requestAPI<AgentVariation>(() => {\n const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}:removeMemoryLayer`, body: { memoryLayerId: params.memoryLayerId } };\n }, options);\n }\n\n /**\n * Update a variation's memory layer assignment\n * \n * @example\n * ```ts\n * const agentVariation = await client.agents.variations.updateMemoryLayer('agent_123', 'variation_123', { memoryLayerId: 'sample', position: 1 });\n * ```\n */\n updateMemoryLayer(agentId: string, variationId: string, params: AgentVariationUpdateMemoryLayerParams, options?: RequestOptions): APIPromise<AgentVariation> {\n return this._client.requestAPI<AgentVariation>(() => {\n const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agents/${pathSegment('agentId', agentId)}/variations/${pathSegment('variationId', variationId)}:updateMemoryLayer`, body: { memoryLayerId: params.memoryLayerId, position: params.position } };\n }, options);\n }\n}\n"]}
@@ -60,7 +60,9 @@ export interface AgentCreateParams {
60
60
  */
61
61
  workspaceId?: string;
62
62
  /**
63
- * Optional default variation to add to the agent on create
63
+ * Optional default variation to add to the agent on create. Its spec accepts
64
+ * assignments and memory_layer_assignments using the same atomic validation
65
+ * as CreateAgentVariation. Failure rejects the entire agent creation.
64
66
  */
65
67
  defaultVariation?: CreateAgentVariationRequestParam;
66
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/resources/agents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAA+B,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,sCAAsC,EAAE,+CAA+C,EAAE,2BAA2B,EAAE,4CAA4C,EAAE,SAAS,EAAE,gCAAgC,EAAE,sBAAsB,EAAqF,iBAAiB,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGja,MAAM,WAAW,eAAe;IAC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