@cadenya/cadenya 0.41.0 → 0.43.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 (120) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +4 -4
  3. package/client.d.mts +17 -5
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +17 -5
  6. package/client.d.ts.map +1 -1
  7. package/client.js +11 -1
  8. package/client.js.map +1 -1
  9. package/client.mjs +12 -2
  10. package/client.mjs.map +1 -1
  11. package/internal/utils/env.js +2 -2
  12. package/internal/utils/env.js.map +1 -1
  13. package/internal/utils/env.mjs +2 -2
  14. package/internal/utils/env.mjs.map +1 -1
  15. package/package.json +4 -2
  16. package/resources/account.d.mts +38 -1
  17. package/resources/account.d.mts.map +1 -1
  18. package/resources/account.d.ts +38 -1
  19. package/resources/account.d.ts.map +1 -1
  20. package/resources/account.js +6 -0
  21. package/resources/account.js.map +1 -1
  22. package/resources/account.mjs +6 -0
  23. package/resources/account.mjs.map +1 -1
  24. package/resources/{agents/variations.d.ts → agent-variations.d.mts} +124 -49
  25. package/resources/agent-variations.d.mts.map +1 -0
  26. package/resources/{agents/variations.d.mts → agent-variations.d.ts} +124 -49
  27. package/resources/agent-variations.d.ts.map +1 -0
  28. package/resources/{agents/variations.js → agent-variations.js} +29 -8
  29. package/resources/agent-variations.js.map +1 -0
  30. package/resources/{agents/variations.mjs → agent-variations.mjs} +27 -6
  31. package/resources/agent-variations.mjs.map +1 -0
  32. package/resources/agents/agents.d.mts +2 -11
  33. package/resources/agents/agents.d.mts.map +1 -1
  34. package/resources/agents/agents.d.ts +2 -11
  35. package/resources/agents/agents.d.ts.map +1 -1
  36. package/resources/agents/agents.js +0 -4
  37. package/resources/agents/agents.js.map +1 -1
  38. package/resources/agents/agents.mjs +0 -4
  39. package/resources/agents/agents.mjs.map +1 -1
  40. package/resources/agents/index.d.mts +0 -1
  41. package/resources/agents/index.d.mts.map +1 -1
  42. package/resources/agents/index.d.ts +0 -1
  43. package/resources/agents/index.d.ts.map +1 -1
  44. package/resources/agents/index.js +1 -3
  45. package/resources/agents/index.js.map +1 -1
  46. package/resources/agents/index.mjs +0 -1
  47. package/resources/agents/index.mjs.map +1 -1
  48. package/resources/agents/webhook-deliveries.d.mts +2 -2
  49. package/resources/agents/webhook-deliveries.d.mts.map +1 -1
  50. package/resources/agents/webhook-deliveries.d.ts +2 -2
  51. package/resources/agents/webhook-deliveries.d.ts.map +1 -1
  52. package/resources/index.d.mts +4 -2
  53. package/resources/index.d.mts.map +1 -1
  54. package/resources/index.d.ts +4 -2
  55. package/resources/index.d.ts.map +1 -1
  56. package/resources/index.js +5 -1
  57. package/resources/index.js.map +1 -1
  58. package/resources/index.mjs +3 -1
  59. package/resources/index.mjs.map +1 -1
  60. package/resources/objectives/feedback.d.mts +6 -6
  61. package/resources/objectives/feedback.d.ts +6 -6
  62. package/resources/objectives/index.d.mts +1 -1
  63. package/resources/objectives/index.d.mts.map +1 -1
  64. package/resources/objectives/index.d.ts +1 -1
  65. package/resources/objectives/index.d.ts.map +1 -1
  66. package/resources/objectives/index.js.map +1 -1
  67. package/resources/objectives/index.mjs.map +1 -1
  68. package/resources/objectives/objectives.d.mts +43 -3
  69. package/resources/objectives/objectives.d.mts.map +1 -1
  70. package/resources/objectives/objectives.d.ts +43 -3
  71. package/resources/objectives/objectives.d.ts.map +1 -1
  72. package/resources/objectives/objectives.js +7 -0
  73. package/resources/objectives/objectives.js.map +1 -1
  74. package/resources/objectives/objectives.mjs +7 -0
  75. package/resources/objectives/objectives.mjs.map +1 -1
  76. package/resources/objectives/tasks.d.mts +6 -6
  77. package/resources/objectives/tasks.d.ts +6 -6
  78. package/resources/objectives/tool-calls.d.mts +1 -0
  79. package/resources/objectives/tool-calls.d.mts.map +1 -1
  80. package/resources/objectives/tool-calls.d.ts +1 -0
  81. package/resources/objectives/tool-calls.d.ts.map +1 -1
  82. package/resources/objectives/tools.d.mts +6 -6
  83. package/resources/objectives/tools.d.ts +6 -6
  84. package/resources/shared.d.mts +13 -7
  85. package/resources/shared.d.mts.map +1 -1
  86. package/resources/shared.d.ts +13 -7
  87. package/resources/shared.d.ts.map +1 -1
  88. package/resources/webhooks.d.mts +116 -0
  89. package/resources/webhooks.d.mts.map +1 -0
  90. package/resources/webhooks.d.ts +116 -0
  91. package/resources/webhooks.d.ts.map +1 -0
  92. package/resources/webhooks.js +23 -0
  93. package/resources/webhooks.js.map +1 -0
  94. package/resources/webhooks.mjs +19 -0
  95. package/resources/webhooks.mjs.map +1 -0
  96. package/src/client.ts +84 -1
  97. package/src/internal/utils/env.ts +2 -2
  98. package/src/resources/account.ts +44 -0
  99. package/src/resources/{agents/variations.ts → agent-variations.ts} +175 -64
  100. package/src/resources/agents/agents.ts +2 -50
  101. package/src/resources/agents/index.ts +0 -19
  102. package/src/resources/agents/webhook-deliveries.ts +4 -2
  103. package/src/resources/index.ts +35 -1
  104. package/src/resources/objectives/feedback.ts +6 -6
  105. package/src/resources/objectives/index.ts +3 -0
  106. package/src/resources/objectives/objectives.ts +59 -2
  107. package/src/resources/objectives/tasks.ts +6 -6
  108. package/src/resources/objectives/tool-calls.ts +7 -0
  109. package/src/resources/objectives/tools.ts +6 -6
  110. package/src/resources/shared.ts +14 -7
  111. package/src/resources/webhooks.ts +156 -0
  112. package/src/version.ts +1 -1
  113. package/version.d.mts +1 -1
  114. package/version.d.ts +1 -1
  115. package/version.js +1 -1
  116. package/version.mjs +1 -1
  117. package/resources/agents/variations.d.mts.map +0 -1
  118. package/resources/agents/variations.d.ts.map +0 -1
  119. package/resources/agents/variations.js.map +0 -1
  120. package/resources/agents/variations.mjs.map +0 -1
@@ -1,30 +1,40 @@
1
- import { APIResource } from "../../core/resource.js";
2
- import * as AccountAPI from "../account.js";
3
- import * as Shared from "../shared.js";
4
- import { APIPromise } from "../../core/api-promise.js";
5
- import { CursorPagination, type CursorPaginationParams, PagePromise } from "../../core/pagination.js";
6
- import { RequestOptions } from "../../internal/request-options.js";
7
- export declare class Variations extends APIResource {
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import * as AccountAPI from "./account.mjs";
3
+ import * as Shared from "./shared.mjs";
4
+ import { APIPromise } from "../core/api-promise.mjs";
5
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from "../core/pagination.mjs";
6
+ import { RequestOptions } from "../internal/request-options.mjs";
7
+ export declare class AgentVariations extends APIResource {
8
8
  /**
9
9
  * Creates a new variation for an agent
10
10
  */
11
- create(agentID: string, body: VariationCreateParams, options?: RequestOptions): APIPromise<AgentVariation>;
11
+ create(agentID: string, body: AgentVariationCreateParams, options?: RequestOptions): APIPromise<AgentVariation>;
12
12
  /**
13
13
  * Retrieves a variation by ID from an agent
14
14
  */
15
- retrieve(id: string, params: VariationRetrieveParams, options?: RequestOptions): APIPromise<AgentVariation>;
15
+ retrieve(id: string, params: AgentVariationRetrieveParams, options?: RequestOptions): APIPromise<AgentVariation>;
16
16
  /**
17
17
  * Updates a variation for an agent
18
18
  */
19
- update(id: string, params: VariationUpdateParams, options?: RequestOptions): APIPromise<AgentVariation>;
19
+ update(id: string, params: AgentVariationUpdateParams, options?: RequestOptions): APIPromise<AgentVariation>;
20
20
  /**
21
21
  * Lists all variations for an agent
22
22
  */
23
- list(agentID: string, query?: VariationListParams | null | undefined, options?: RequestOptions): PagePromise<AgentVariationsCursorPagination, AgentVariation>;
23
+ list(agentID: string, query?: AgentVariationListParams | null | undefined, options?: RequestOptions): PagePromise<AgentVariationsCursorPagination, AgentVariation>;
24
24
  /**
25
25
  * Deletes a variation from an agent
26
26
  */
27
- delete(id: string, params: VariationDeleteParams, options?: RequestOptions): APIPromise<void>;
27
+ delete(id: string, params: AgentVariationDeleteParams, options?: RequestOptions): APIPromise<void>;
28
+ /**
29
+ * Assigns a tool, tool set, or sub-agent to a variation. Exactly one target ID
30
+ * must be set.
31
+ */
32
+ addAssignment(agentVariationID: string, body: AgentVariationAddAssignmentParams, options?: RequestOptions): APIPromise<VariationAssignment>;
33
+ /**
34
+ * Detaches an assignment from a variation, identified by the assignment ID
35
+ * returned when it was added.
36
+ */
37
+ removeAssignment(id: string, params: AgentVariationRemoveAssignmentParams, options?: RequestOptions): APIPromise<void>;
28
38
  }
29
39
  export type AgentVariationsCursorPagination = CursorPagination<AgentVariation>;
30
40
  /**
@@ -48,6 +58,12 @@ export interface AgentVariation {
48
58
  * AgentVariationInfo provides read-only summary information about a variation
49
59
  */
50
60
  export interface AgentVariationInfo {
61
+ /**
62
+ * All tools, tool sets, and sub-agents assigned to this variation. Populated on
63
+ * reads so clients can render a variation's full assignment list without calling
64
+ * the add/remove endpoints just to enumerate.
65
+ */
66
+ assignments?: Array<VariationAssignment>;
51
67
  /**
52
68
  * Profile represents a human user at the account level. Profiles are
53
69
  * account-scoped resources that can be associated with multiple workspaces through
@@ -85,14 +101,10 @@ export interface AgentVariationInfo {
85
101
  */
86
102
  export interface AgentVariationSpec {
87
103
  /**
88
- * Documents assigned to this variation. Can include individual documents or entire
89
- * document namespaces (which include all documents in the namespace).
90
- */
91
- agentDocuments?: Array<AgentVariationSpecAgentDocument>;
92
- /**
93
- * Tools assigned to this variation
104
+ * CompactionConfig defines how context window compaction behaves for objectives
105
+ * using this variation.
94
106
  */
95
- agentTools?: Array<AgentVariationSpecAgentTool>;
107
+ compactionConfig?: AgentVariationSpecCompactionConfig;
96
108
  /**
97
109
  * Execution constraints
98
110
  */
@@ -134,34 +146,26 @@ export interface AgentVariationSpec {
134
146
  */
135
147
  weight?: number;
136
148
  }
137
- export interface AgentVariationSpecAgentDocument {
138
- documentId?: string;
139
- /**
140
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
141
- */
142
- documentMetadata?: Shared.ResourceMetadata;
143
- documentNamespaceId?: string;
149
+ /**
150
+ * CompactionConfig defines how context window compaction behaves for objectives
151
+ * using this variation.
152
+ */
153
+ export interface AgentVariationSpecCompactionConfig {
144
154
  /**
145
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
155
+ * SummarizationStrategy configures LLM-powered summarization of older conversation
156
+ * turns.
146
157
  */
147
- documentNamespaceMetadata?: Shared.ResourceMetadata;
148
- }
149
- export interface AgentVariationSpecAgentTool {
150
- agentId?: string;
158
+ summarization?: CompactionConfigSummarizationStrategy;
151
159
  /**
152
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
160
+ * ToolResultClearingStrategy configures clearing of older tool result content.
153
161
  */
154
- agentMetadata?: Shared.ResourceMetadata;
155
- toolId?: string;
162
+ toolResultClearing?: CompactionConfigToolResultClearingStrategy;
156
163
  /**
157
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
164
+ * Trigger threshold as a percentage of the model's context window (0.0 to 1.0).
165
+ * When input tokens reach this percentage of the model's limit, compaction
166
+ * triggers. Default: 0.75 (75%)
158
167
  */
159
- toolMetadata?: Shared.ResourceMetadata;
160
- toolSetId?: string;
161
- /**
162
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
163
- */
164
- toolSetMetadata?: Shared.ResourceMetadata;
168
+ triggerThreshold?: number;
165
169
  }
166
170
  export interface AgentVariationSpecConstraints {
167
171
  /**
@@ -204,6 +208,29 @@ export interface AgentVariationSpecToolSelection {
204
208
  */
205
209
  autoDiscovery?: ToolSelectionAutoDiscovery;
206
210
  }
211
+ /**
212
+ * SummarizationStrategy configures LLM-powered summarization of older conversation
213
+ * turns.
214
+ */
215
+ export interface CompactionConfigSummarizationStrategy {
216
+ /**
217
+ * Custom instructions that guide what the summarizer preserves. Replaces the
218
+ * default summarization prompt entirely. Example: "Preserve all code snippets,
219
+ * variable names, and technical decisions."
220
+ */
221
+ instructions?: string;
222
+ }
223
+ /**
224
+ * ToolResultClearingStrategy configures clearing of older tool result content.
225
+ */
226
+ export interface CompactionConfigToolResultClearingStrategy {
227
+ /**
228
+ * Number of most recent tool call results to keep intact. Older tool results have
229
+ * their content replaced with "[result cleared]" while preserving the assistant
230
+ * tool call message (function name, arguments). Default: 2
231
+ */
232
+ preserveRecentResults?: number;
233
+ }
207
234
  /**
208
235
  * AssignedTools is used to indicate that the agent should only use the tools/tool
209
236
  * sets that are explicitly assigned to it. Allow discovery is used when the agent
@@ -223,7 +250,47 @@ export interface ToolSelectionAutoDiscovery {
223
250
  hints?: Array<string>;
224
251
  maxTools?: number;
225
252
  }
226
- export interface VariationCreateParams {
253
+ /**
254
+ * VariationAssignment is a read-only reference to a single tool, tool set, or
255
+ * sub-agent attached to a variation. Clients read the full set of assignments via
256
+ * `AgentVariationInfo.assignments`; mutations go through the dedicated add/remove
257
+ * assignment endpoints under /v1/agent_variations/{id}/assignments.
258
+ *
259
+ * The `id` identifies the assignment row itself (not the referenced resource) and
260
+ * is the handle used to remove the assignment. It is returned by the add endpoint
261
+ * and present on every entry in AgentVariationInfo.assignments.
262
+ */
263
+ export interface VariationAssignment {
264
+ id?: string;
265
+ /**
266
+ * BareMetadata contains the minimal metadata for a resource: the ID and an
267
+ * optional human-readable name. These are used for reference fields where the full
268
+ * metadata (account scoping, timestamps, labels, external IDs) is not needed —
269
+ * e.g., the tool references inside an agent variation spec or the tools assigned
270
+ * to an objective. Both fields are server-populated; clients provide IDs through
271
+ * sibling fields rather than by constructing a BareMetadata themselves.
272
+ */
273
+ agent?: Shared.BareMetadata;
274
+ /**
275
+ * BareMetadata contains the minimal metadata for a resource: the ID and an
276
+ * optional human-readable name. These are used for reference fields where the full
277
+ * metadata (account scoping, timestamps, labels, external IDs) is not needed —
278
+ * e.g., the tool references inside an agent variation spec or the tools assigned
279
+ * to an objective. Both fields are server-populated; clients provide IDs through
280
+ * sibling fields rather than by constructing a BareMetadata themselves.
281
+ */
282
+ tool?: Shared.BareMetadata;
283
+ /**
284
+ * BareMetadata contains the minimal metadata for a resource: the ID and an
285
+ * optional human-readable name. These are used for reference fields where the full
286
+ * metadata (account scoping, timestamps, labels, external IDs) is not needed —
287
+ * e.g., the tool references inside an agent variation spec or the tools assigned
288
+ * to an objective. Both fields are server-populated; clients provide IDs through
289
+ * sibling fields rather than by constructing a BareMetadata themselves.
290
+ */
291
+ toolSet?: Shared.BareMetadata;
292
+ }
293
+ export interface AgentVariationCreateParams {
227
294
  /**
228
295
  * CreateResourceMetadata contains the user-provided fields for creating a
229
296
  * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
@@ -235,13 +302,13 @@ export interface VariationCreateParams {
235
302
  */
236
303
  spec: AgentVariationSpec;
237
304
  }
238
- export interface VariationRetrieveParams {
305
+ export interface AgentVariationRetrieveParams {
239
306
  /**
240
307
  * Agent ID (from path)
241
308
  */
242
309
  agentId: string;
243
310
  }
244
- export interface VariationUpdateParams {
311
+ export interface AgentVariationUpdateParams {
245
312
  /**
246
313
  * Path param: Agent ID (from path)
247
314
  */
@@ -263,7 +330,7 @@ export interface VariationUpdateParams {
263
330
  */
264
331
  updateMask?: string;
265
332
  }
266
- export interface VariationListParams extends CursorPaginationParams {
333
+ export interface AgentVariationListParams extends CursorPaginationParams {
267
334
  /**
268
335
  * When set to true you may use more of your alloted API rate-limit
269
336
  */
@@ -273,13 +340,21 @@ export interface VariationListParams extends CursorPaginationParams {
273
340
  */
274
341
  sortOrder?: string;
275
342
  }
276
- export interface VariationDeleteParams {
343
+ export interface AgentVariationDeleteParams {
277
344
  /**
278
345
  * Agent ID (from path)
279
346
  */
280
347
  agentId: string;
281
348
  }
282
- export declare namespace Variations {
283
- export { type AgentVariation as AgentVariation, type AgentVariationInfo as AgentVariationInfo, type AgentVariationSpec as AgentVariationSpec, type AgentVariationSpecAgentDocument as AgentVariationSpecAgentDocument, type AgentVariationSpecAgentTool as AgentVariationSpecAgentTool, type AgentVariationSpecConstraints as AgentVariationSpecConstraints, type AgentVariationSpecModelConfig as AgentVariationSpecModelConfig, type AgentVariationSpecToolSelection as AgentVariationSpecToolSelection, type ToolSelectionAssignedTools as ToolSelectionAssignedTools, type ToolSelectionAutoDiscovery as ToolSelectionAutoDiscovery, type AgentVariationsCursorPagination as AgentVariationsCursorPagination, type VariationCreateParams as VariationCreateParams, type VariationRetrieveParams as VariationRetrieveParams, type VariationUpdateParams as VariationUpdateParams, type VariationListParams as VariationListParams, type VariationDeleteParams as VariationDeleteParams, };
349
+ export interface AgentVariationAddAssignmentParams {
350
+ subAgentId?: string;
351
+ toolId?: string;
352
+ toolSetId?: string;
353
+ }
354
+ export interface AgentVariationRemoveAssignmentParams {
355
+ agentVariationId: string;
356
+ }
357
+ export declare namespace AgentVariations {
358
+ export { type AgentVariation as AgentVariation, type AgentVariationInfo as AgentVariationInfo, type AgentVariationSpec as AgentVariationSpec, type AgentVariationSpecCompactionConfig as AgentVariationSpecCompactionConfig, type AgentVariationSpecConstraints as AgentVariationSpecConstraints, type AgentVariationSpecModelConfig as AgentVariationSpecModelConfig, type AgentVariationSpecToolSelection as AgentVariationSpecToolSelection, type CompactionConfigSummarizationStrategy as CompactionConfigSummarizationStrategy, type CompactionConfigToolResultClearingStrategy as CompactionConfigToolResultClearingStrategy, type ToolSelectionAssignedTools as ToolSelectionAssignedTools, type ToolSelectionAutoDiscovery as ToolSelectionAutoDiscovery, type VariationAssignment as VariationAssignment, type AgentVariationsCursorPagination as AgentVariationsCursorPagination, type AgentVariationCreateParams as AgentVariationCreateParams, type AgentVariationRetrieveParams as AgentVariationRetrieveParams, type AgentVariationUpdateParams as AgentVariationUpdateParams, type AgentVariationListParams as AgentVariationListParams, type AgentVariationDeleteParams as AgentVariationDeleteParams, type AgentVariationAddAssignmentParams as AgentVariationAddAssignmentParams, type AgentVariationRemoveAssignmentParams as AgentVariationRemoveAssignmentParams, };
284
359
  }
285
- //# sourceMappingURL=variations.d.ts.map
360
+ //# sourceMappingURL=agent-variations.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-variations.d.mts","sourceRoot":"","sources":["../src/resources/agent-variations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,E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AI,0BAA0B,EAC7D,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,oCAAoC,IAAI,oCAAoC,GAClF,CAAC;CACH"}
@@ -1,30 +1,40 @@
1
- import { APIResource } from "../../core/resource.mjs";
2
- import * as AccountAPI from "../account.mjs";
3
- import * as Shared from "../shared.mjs";
4
- import { APIPromise } from "../../core/api-promise.mjs";
5
- import { CursorPagination, type CursorPaginationParams, PagePromise } from "../../core/pagination.mjs";
6
- import { RequestOptions } from "../../internal/request-options.mjs";
7
- export declare class Variations extends APIResource {
1
+ import { APIResource } from "../core/resource.js";
2
+ import * as AccountAPI from "./account.js";
3
+ import * as Shared from "./shared.js";
4
+ import { APIPromise } from "../core/api-promise.js";
5
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from "../core/pagination.js";
6
+ import { RequestOptions } from "../internal/request-options.js";
7
+ export declare class AgentVariations extends APIResource {
8
8
  /**
9
9
  * Creates a new variation for an agent
10
10
  */
11
- create(agentID: string, body: VariationCreateParams, options?: RequestOptions): APIPromise<AgentVariation>;
11
+ create(agentID: string, body: AgentVariationCreateParams, options?: RequestOptions): APIPromise<AgentVariation>;
12
12
  /**
13
13
  * Retrieves a variation by ID from an agent
14
14
  */
15
- retrieve(id: string, params: VariationRetrieveParams, options?: RequestOptions): APIPromise<AgentVariation>;
15
+ retrieve(id: string, params: AgentVariationRetrieveParams, options?: RequestOptions): APIPromise<AgentVariation>;
16
16
  /**
17
17
  * Updates a variation for an agent
18
18
  */
19
- update(id: string, params: VariationUpdateParams, options?: RequestOptions): APIPromise<AgentVariation>;
19
+ update(id: string, params: AgentVariationUpdateParams, options?: RequestOptions): APIPromise<AgentVariation>;
20
20
  /**
21
21
  * Lists all variations for an agent
22
22
  */
23
- list(agentID: string, query?: VariationListParams | null | undefined, options?: RequestOptions): PagePromise<AgentVariationsCursorPagination, AgentVariation>;
23
+ list(agentID: string, query?: AgentVariationListParams | null | undefined, options?: RequestOptions): PagePromise<AgentVariationsCursorPagination, AgentVariation>;
24
24
  /**
25
25
  * Deletes a variation from an agent
26
26
  */
27
- delete(id: string, params: VariationDeleteParams, options?: RequestOptions): APIPromise<void>;
27
+ delete(id: string, params: AgentVariationDeleteParams, options?: RequestOptions): APIPromise<void>;
28
+ /**
29
+ * Assigns a tool, tool set, or sub-agent to a variation. Exactly one target ID
30
+ * must be set.
31
+ */
32
+ addAssignment(agentVariationID: string, body: AgentVariationAddAssignmentParams, options?: RequestOptions): APIPromise<VariationAssignment>;
33
+ /**
34
+ * Detaches an assignment from a variation, identified by the assignment ID
35
+ * returned when it was added.
36
+ */
37
+ removeAssignment(id: string, params: AgentVariationRemoveAssignmentParams, options?: RequestOptions): APIPromise<void>;
28
38
  }
29
39
  export type AgentVariationsCursorPagination = CursorPagination<AgentVariation>;
30
40
  /**
@@ -48,6 +58,12 @@ export interface AgentVariation {
48
58
  * AgentVariationInfo provides read-only summary information about a variation
49
59
  */
50
60
  export interface AgentVariationInfo {
61
+ /**
62
+ * All tools, tool sets, and sub-agents assigned to this variation. Populated on
63
+ * reads so clients can render a variation's full assignment list without calling
64
+ * the add/remove endpoints just to enumerate.
65
+ */
66
+ assignments?: Array<VariationAssignment>;
51
67
  /**
52
68
  * Profile represents a human user at the account level. Profiles are
53
69
  * account-scoped resources that can be associated with multiple workspaces through
@@ -85,14 +101,10 @@ export interface AgentVariationInfo {
85
101
  */
86
102
  export interface AgentVariationSpec {
87
103
  /**
88
- * Documents assigned to this variation. Can include individual documents or entire
89
- * document namespaces (which include all documents in the namespace).
90
- */
91
- agentDocuments?: Array<AgentVariationSpecAgentDocument>;
92
- /**
93
- * Tools assigned to this variation
104
+ * CompactionConfig defines how context window compaction behaves for objectives
105
+ * using this variation.
94
106
  */
95
- agentTools?: Array<AgentVariationSpecAgentTool>;
107
+ compactionConfig?: AgentVariationSpecCompactionConfig;
96
108
  /**
97
109
  * Execution constraints
98
110
  */
@@ -134,34 +146,26 @@ export interface AgentVariationSpec {
134
146
  */
135
147
  weight?: number;
136
148
  }
137
- export interface AgentVariationSpecAgentDocument {
138
- documentId?: string;
139
- /**
140
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
141
- */
142
- documentMetadata?: Shared.ResourceMetadata;
143
- documentNamespaceId?: string;
149
+ /**
150
+ * CompactionConfig defines how context window compaction behaves for objectives
151
+ * using this variation.
152
+ */
153
+ export interface AgentVariationSpecCompactionConfig {
144
154
  /**
145
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
155
+ * SummarizationStrategy configures LLM-powered summarization of older conversation
156
+ * turns.
146
157
  */
147
- documentNamespaceMetadata?: Shared.ResourceMetadata;
148
- }
149
- export interface AgentVariationSpecAgentTool {
150
- agentId?: string;
158
+ summarization?: CompactionConfigSummarizationStrategy;
151
159
  /**
152
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
160
+ * ToolResultClearingStrategy configures clearing of older tool result content.
153
161
  */
154
- agentMetadata?: Shared.ResourceMetadata;
155
- toolId?: string;
162
+ toolResultClearing?: CompactionConfigToolResultClearingStrategy;
156
163
  /**
157
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
164
+ * Trigger threshold as a percentage of the model's context window (0.0 to 1.0).
165
+ * When input tokens reach this percentage of the model's limit, compaction
166
+ * triggers. Default: 0.75 (75%)
158
167
  */
159
- toolMetadata?: Shared.ResourceMetadata;
160
- toolSetId?: string;
161
- /**
162
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
163
- */
164
- toolSetMetadata?: Shared.ResourceMetadata;
168
+ triggerThreshold?: number;
165
169
  }
166
170
  export interface AgentVariationSpecConstraints {
167
171
  /**
@@ -204,6 +208,29 @@ export interface AgentVariationSpecToolSelection {
204
208
  */
205
209
  autoDiscovery?: ToolSelectionAutoDiscovery;
206
210
  }
211
+ /**
212
+ * SummarizationStrategy configures LLM-powered summarization of older conversation
213
+ * turns.
214
+ */
215
+ export interface CompactionConfigSummarizationStrategy {
216
+ /**
217
+ * Custom instructions that guide what the summarizer preserves. Replaces the
218
+ * default summarization prompt entirely. Example: "Preserve all code snippets,
219
+ * variable names, and technical decisions."
220
+ */
221
+ instructions?: string;
222
+ }
223
+ /**
224
+ * ToolResultClearingStrategy configures clearing of older tool result content.
225
+ */
226
+ export interface CompactionConfigToolResultClearingStrategy {
227
+ /**
228
+ * Number of most recent tool call results to keep intact. Older tool results have
229
+ * their content replaced with "[result cleared]" while preserving the assistant
230
+ * tool call message (function name, arguments). Default: 2
231
+ */
232
+ preserveRecentResults?: number;
233
+ }
207
234
  /**
208
235
  * AssignedTools is used to indicate that the agent should only use the tools/tool
209
236
  * sets that are explicitly assigned to it. Allow discovery is used when the agent
@@ -223,7 +250,47 @@ export interface ToolSelectionAutoDiscovery {
223
250
  hints?: Array<string>;
224
251
  maxTools?: number;
225
252
  }
226
- export interface VariationCreateParams {
253
+ /**
254
+ * VariationAssignment is a read-only reference to a single tool, tool set, or
255
+ * sub-agent attached to a variation. Clients read the full set of assignments via
256
+ * `AgentVariationInfo.assignments`; mutations go through the dedicated add/remove
257
+ * assignment endpoints under /v1/agent_variations/{id}/assignments.
258
+ *
259
+ * The `id` identifies the assignment row itself (not the referenced resource) and
260
+ * is the handle used to remove the assignment. It is returned by the add endpoint
261
+ * and present on every entry in AgentVariationInfo.assignments.
262
+ */
263
+ export interface VariationAssignment {
264
+ id?: string;
265
+ /**
266
+ * BareMetadata contains the minimal metadata for a resource: the ID and an
267
+ * optional human-readable name. These are used for reference fields where the full
268
+ * metadata (account scoping, timestamps, labels, external IDs) is not needed —
269
+ * e.g., the tool references inside an agent variation spec or the tools assigned
270
+ * to an objective. Both fields are server-populated; clients provide IDs through
271
+ * sibling fields rather than by constructing a BareMetadata themselves.
272
+ */
273
+ agent?: Shared.BareMetadata;
274
+ /**
275
+ * BareMetadata contains the minimal metadata for a resource: the ID and an
276
+ * optional human-readable name. These are used for reference fields where the full
277
+ * metadata (account scoping, timestamps, labels, external IDs) is not needed —
278
+ * e.g., the tool references inside an agent variation spec or the tools assigned
279
+ * to an objective. Both fields are server-populated; clients provide IDs through
280
+ * sibling fields rather than by constructing a BareMetadata themselves.
281
+ */
282
+ tool?: Shared.BareMetadata;
283
+ /**
284
+ * BareMetadata contains the minimal metadata for a resource: the ID and an
285
+ * optional human-readable name. These are used for reference fields where the full
286
+ * metadata (account scoping, timestamps, labels, external IDs) is not needed —
287
+ * e.g., the tool references inside an agent variation spec or the tools assigned
288
+ * to an objective. Both fields are server-populated; clients provide IDs through
289
+ * sibling fields rather than by constructing a BareMetadata themselves.
290
+ */
291
+ toolSet?: Shared.BareMetadata;
292
+ }
293
+ export interface AgentVariationCreateParams {
227
294
  /**
228
295
  * CreateResourceMetadata contains the user-provided fields for creating a
229
296
  * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
@@ -235,13 +302,13 @@ export interface VariationCreateParams {
235
302
  */
236
303
  spec: AgentVariationSpec;
237
304
  }
238
- export interface VariationRetrieveParams {
305
+ export interface AgentVariationRetrieveParams {
239
306
  /**
240
307
  * Agent ID (from path)
241
308
  */
242
309
  agentId: string;
243
310
  }
244
- export interface VariationUpdateParams {
311
+ export interface AgentVariationUpdateParams {
245
312
  /**
246
313
  * Path param: Agent ID (from path)
247
314
  */
@@ -263,7 +330,7 @@ export interface VariationUpdateParams {
263
330
  */
264
331
  updateMask?: string;
265
332
  }
266
- export interface VariationListParams extends CursorPaginationParams {
333
+ export interface AgentVariationListParams extends CursorPaginationParams {
267
334
  /**
268
335
  * When set to true you may use more of your alloted API rate-limit
269
336
  */
@@ -273,13 +340,21 @@ export interface VariationListParams extends CursorPaginationParams {
273
340
  */
274
341
  sortOrder?: string;
275
342
  }
276
- export interface VariationDeleteParams {
343
+ export interface AgentVariationDeleteParams {
277
344
  /**
278
345
  * Agent ID (from path)
279
346
  */
280
347
  agentId: string;
281
348
  }
282
- export declare namespace Variations {
283
- export { type AgentVariation as AgentVariation, type AgentVariationInfo as AgentVariationInfo, type AgentVariationSpec as AgentVariationSpec, type AgentVariationSpecAgentDocument as AgentVariationSpecAgentDocument, type AgentVariationSpecAgentTool as AgentVariationSpecAgentTool, type AgentVariationSpecConstraints as AgentVariationSpecConstraints, type AgentVariationSpecModelConfig as AgentVariationSpecModelConfig, type AgentVariationSpecToolSelection as AgentVariationSpecToolSelection, type ToolSelectionAssignedTools as ToolSelectionAssignedTools, type ToolSelectionAutoDiscovery as ToolSelectionAutoDiscovery, type AgentVariationsCursorPagination as AgentVariationsCursorPagination, type VariationCreateParams as VariationCreateParams, type VariationRetrieveParams as VariationRetrieveParams, type VariationUpdateParams as VariationUpdateParams, type VariationListParams as VariationListParams, type VariationDeleteParams as VariationDeleteParams, };
349
+ export interface AgentVariationAddAssignmentParams {
350
+ subAgentId?: string;
351
+ toolId?: string;
352
+ toolSetId?: string;
353
+ }
354
+ export interface AgentVariationRemoveAssignmentParams {
355
+ agentVariationId: string;
356
+ }
357
+ export declare namespace AgentVariations {
358
+ export { type AgentVariation as AgentVariation, type AgentVariationInfo as AgentVariationInfo, type AgentVariationSpec as AgentVariationSpec, type AgentVariationSpecCompactionConfig as AgentVariationSpecCompactionConfig, type AgentVariationSpecConstraints as AgentVariationSpecConstraints, type AgentVariationSpecModelConfig as AgentVariationSpecModelConfig, type AgentVariationSpecToolSelection as AgentVariationSpecToolSelection, type CompactionConfigSummarizationStrategy as CompactionConfigSummarizationStrategy, type CompactionConfigToolResultClearingStrategy as CompactionConfigToolResultClearingStrategy, type ToolSelectionAssignedTools as ToolSelectionAssignedTools, type ToolSelectionAutoDiscovery as ToolSelectionAutoDiscovery, type VariationAssignment as VariationAssignment, type AgentVariationsCursorPagination as AgentVariationsCursorPagination, type AgentVariationCreateParams as AgentVariationCreateParams, type AgentVariationRetrieveParams as AgentVariationRetrieveParams, type AgentVariationUpdateParams as AgentVariationUpdateParams, type AgentVariationListParams as AgentVariationListParams, type AgentVariationDeleteParams as AgentVariationDeleteParams, type AgentVariationAddAssignmentParams as AgentVariationAddAssignmentParams, type AgentVariationRemoveAssignmentParams as AgentVariationRemoveAssignmentParams, };
284
359
  }
285
- //# sourceMappingURL=variations.d.mts.map
360
+ //# sourceMappingURL=agent-variations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-variations.d.ts","sourceRoot":"","sources":["../src/resources/agent-variations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE;OAE9D,EAAE,cAAc,EAAE;AAGzB,qBAAa,eAAgB,SAAQ,WAAW;IAC9C;;OAEG;IACH,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,cAAc,CAAC;IAI7B;;OAEG;IACH,QAAQ,CACN,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,4BAA4B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,cAAc,CAAC;IAK7B;;OAEG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,0BAA0B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,cAAc,CAAC;IAK7B;;OAEG;IACH,IAAI,CACF,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,wBAAwB,GAAG,IAAI,GAAG,SAAc,EACvD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,+BAA+B,EAAE,cAAc,CAAC;IAO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M,WAAW,iCAAiC;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oCAAoC;IACnD,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,WAAW,eAAe,CAAC;IACvC,OAAO,EACL,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,qCAAqC,IAAI,qCAAqC,EACnF,KAAK,0CAA0C,IAAI,0CAA0C,EAC7F,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,oCAAoC,IAAI,oCAAoC,GAClF,CAAC;CACH"}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Variations = void 0;
5
- const resource_1 = require("../../core/resource.js");
6
- const pagination_1 = require("../../core/pagination.js");
7
- const headers_1 = require("../../internal/headers.js");
8
- const path_1 = require("../../internal/utils/path.js");
9
- class Variations extends resource_1.APIResource {
4
+ exports.AgentVariations = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const pagination_1 = require("../core/pagination.js");
7
+ const headers_1 = require("../internal/headers.js");
8
+ const path_1 = require("../internal/utils/path.js");
9
+ class AgentVariations extends resource_1.APIResource {
10
10
  /**
11
11
  * Creates a new variation for an agent
12
12
  */
@@ -46,6 +46,27 @@ class Variations extends resource_1.APIResource {
46
46
  headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
47
47
  });
48
48
  }
49
+ /**
50
+ * Assigns a tool, tool set, or sub-agent to a variation. Exactly one target ID
51
+ * must be set.
52
+ */
53
+ addAssignment(agentVariationID, body, options) {
54
+ return this._client.post((0, path_1.path) `/v1/agent_variations/${agentVariationID}/assignments`, {
55
+ body,
56
+ ...options,
57
+ });
58
+ }
59
+ /**
60
+ * Detaches an assignment from a variation, identified by the assignment ID
61
+ * returned when it was added.
62
+ */
63
+ removeAssignment(id, params, options) {
64
+ const { agentVariationId } = params;
65
+ return this._client.delete((0, path_1.path) `/v1/agent_variations/${agentVariationId}/assignments/${id}`, {
66
+ ...options,
67
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
68
+ });
69
+ }
49
70
  }
50
- exports.Variations = Variations;
51
- //# sourceMappingURL=variations.js.map
71
+ exports.AgentVariations = AgentVariations;
72
+ //# sourceMappingURL=agent-variations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-variations.js","sourceRoot":"","sources":["../src/resources/agent-variations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,sDAAgG;AAChG,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,eAAgB,SAAQ,sBAAW;IAC9C;;OAEG;IACH,MAAM,CACJ,OAAe,EACf,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,cAAc,OAAO,aAAa,EAAE,E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wB,EACxB,IAAuC,EACvC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,wBAAwB,gBAAgB,cAAc,EAAE;YACnF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,gBAAgB,CACd,EAAU,EACV,MAA4C,EAC5C,OAAwB;QAExB,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,wBAAwB,gBAAgB,gBAAgB,EAAE,EAAE,EAAE;YAC3F,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AA3FD,0CA2FC"}
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../core/resource.mjs";
3
- import { CursorPagination } from "../../core/pagination.mjs";
4
- import { buildHeaders } from "../../internal/headers.mjs";
5
- import { path } from "../../internal/utils/path.mjs";
6
- export class Variations extends APIResource {
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { CursorPagination } from "../core/pagination.mjs";
4
+ import { buildHeaders } from "../internal/headers.mjs";
5
+ import { path } from "../internal/utils/path.mjs";
6
+ export class AgentVariations extends APIResource {
7
7
  /**
8
8
  * Creates a new variation for an agent
9
9
  */
@@ -43,5 +43,26 @@ export class Variations extends APIResource {
43
43
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
44
44
  });
45
45
  }
46
+ /**
47
+ * Assigns a tool, tool set, or sub-agent to a variation. Exactly one target ID
48
+ * must be set.
49
+ */
50
+ addAssignment(agentVariationID, body, options) {
51
+ return this._client.post(path `/v1/agent_variations/${agentVariationID}/assignments`, {
52
+ body,
53
+ ...options,
54
+ });
55
+ }
56
+ /**
57
+ * Detaches an assignment from a variation, identified by the assignment ID
58
+ * returned when it was added.
59
+ */
60
+ removeAssignment(id, params, options) {
61
+ const { agentVariationId } = params;
62
+ return this._client.delete(path `/v1/agent_variations/${agentVariationId}/assignments/${id}`, {
63
+ ...options,
64
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
65
+ });
66
+ }
46
67
  }
47
- //# sourceMappingURL=variations.mjs.map
68
+ //# sourceMappingURL=agent-variations.mjs.map