@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,19 +1,23 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../core/resource';
4
- import * as AccountAPI from '../account';
5
- import * as Shared from '../shared';
6
- import { APIPromise } from '../../core/api-promise';
7
- import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
8
- import { buildHeaders } from '../../internal/headers';
9
- import { RequestOptions } from '../../internal/request-options';
10
- import { path } from '../../internal/utils/path';
3
+ import { APIResource } from '../core/resource';
4
+ import * as AccountAPI from './account';
5
+ import * as Shared from './shared';
6
+ import { APIPromise } from '../core/api-promise';
7
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from '../core/pagination';
8
+ import { buildHeaders } from '../internal/headers';
9
+ import { RequestOptions } from '../internal/request-options';
10
+ import { path } from '../internal/utils/path';
11
11
 
12
- export class Variations extends APIResource {
12
+ export class AgentVariations extends APIResource {
13
13
  /**
14
14
  * Creates a new variation for an agent
15
15
  */
16
- create(agentID: string, body: VariationCreateParams, options?: RequestOptions): APIPromise<AgentVariation> {
16
+ create(
17
+ agentID: string,
18
+ body: AgentVariationCreateParams,
19
+ options?: RequestOptions,
20
+ ): APIPromise<AgentVariation> {
17
21
  return this._client.post(path`/v1/agents/${agentID}/variations`, { body, ...options });
18
22
  }
19
23
 
@@ -22,7 +26,7 @@ export class Variations extends APIResource {
22
26
  */
23
27
  retrieve(
24
28
  id: string,
25
- params: VariationRetrieveParams,
29
+ params: AgentVariationRetrieveParams,
26
30
  options?: RequestOptions,
27
31
  ): APIPromise<AgentVariation> {
28
32
  const { agentId } = params;
@@ -32,7 +36,11 @@ export class Variations extends APIResource {
32
36
  /**
33
37
  * Updates a variation for an agent
34
38
  */
35
- update(id: string, params: VariationUpdateParams, options?: RequestOptions): APIPromise<AgentVariation> {
39
+ update(
40
+ id: string,
41
+ params: AgentVariationUpdateParams,
42
+ options?: RequestOptions,
43
+ ): APIPromise<AgentVariation> {
36
44
  const { agentId, ...body } = params;
37
45
  return this._client.patch(path`/v1/agents/${agentId}/variations/${id}`, { body, ...options });
38
46
  }
@@ -42,7 +50,7 @@ export class Variations extends APIResource {
42
50
  */
43
51
  list(
44
52
  agentID: string,
45
- query: VariationListParams | null | undefined = {},
53
+ query: AgentVariationListParams | null | undefined = {},
46
54
  options?: RequestOptions,
47
55
  ): PagePromise<AgentVariationsCursorPagination, AgentVariation> {
48
56
  return this._client.getAPIList(path`/v1/agents/${agentID}/variations`, CursorPagination<AgentVariation>, {
@@ -54,13 +62,44 @@ export class Variations extends APIResource {
54
62
  /**
55
63
  * Deletes a variation from an agent
56
64
  */
57
- delete(id: string, params: VariationDeleteParams, options?: RequestOptions): APIPromise<void> {
65
+ delete(id: string, params: AgentVariationDeleteParams, options?: RequestOptions): APIPromise<void> {
58
66
  const { agentId } = params;
59
67
  return this._client.delete(path`/v1/agents/${agentId}/variations/${id}`, {
60
68
  ...options,
61
69
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
62
70
  });
63
71
  }
72
+
73
+ /**
74
+ * Assigns a tool, tool set, or sub-agent to a variation. Exactly one target ID
75
+ * must be set.
76
+ */
77
+ addAssignment(
78
+ agentVariationID: string,
79
+ body: AgentVariationAddAssignmentParams,
80
+ options?: RequestOptions,
81
+ ): APIPromise<VariationAssignment> {
82
+ return this._client.post(path`/v1/agent_variations/${agentVariationID}/assignments`, {
83
+ body,
84
+ ...options,
85
+ });
86
+ }
87
+
88
+ /**
89
+ * Detaches an assignment from a variation, identified by the assignment ID
90
+ * returned when it was added.
91
+ */
92
+ removeAssignment(
93
+ id: string,
94
+ params: AgentVariationRemoveAssignmentParams,
95
+ options?: RequestOptions,
96
+ ): APIPromise<void> {
97
+ const { agentVariationId } = params;
98
+ return this._client.delete(path`/v1/agent_variations/${agentVariationId}/assignments/${id}`, {
99
+ ...options,
100
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
101
+ });
102
+ }
64
103
  }
65
104
 
66
105
  export type AgentVariationsCursorPagination = CursorPagination<AgentVariation>;
@@ -89,6 +128,13 @@ export interface AgentVariation {
89
128
  * AgentVariationInfo provides read-only summary information about a variation
90
129
  */
91
130
  export interface AgentVariationInfo {
131
+ /**
132
+ * All tools, tool sets, and sub-agents assigned to this variation. Populated on
133
+ * reads so clients can render a variation's full assignment list without calling
134
+ * the add/remove endpoints just to enumerate.
135
+ */
136
+ assignments?: Array<VariationAssignment>;
137
+
92
138
  /**
93
139
  * Profile represents a human user at the account level. Profiles are
94
140
  * account-scoped resources that can be associated with multiple workspaces through
@@ -133,15 +179,10 @@ export interface AgentVariationInfo {
133
179
  */
134
180
  export interface AgentVariationSpec {
135
181
  /**
136
- * Documents assigned to this variation. Can include individual documents or entire
137
- * document namespaces (which include all documents in the namespace).
138
- */
139
- agentDocuments?: Array<AgentVariationSpecAgentDocument>;
140
-
141
- /**
142
- * Tools assigned to this variation
182
+ * CompactionConfig defines how context window compaction behaves for objectives
183
+ * using this variation.
143
184
  */
144
- agentTools?: Array<AgentVariationSpecAgentTool>;
185
+ compactionConfig?: AgentVariationSpecCompactionConfig;
145
186
 
146
187
  /**
147
188
  * Execution constraints
@@ -192,43 +233,28 @@ export interface AgentVariationSpec {
192
233
  weight?: number;
193
234
  }
194
235
 
195
- export interface AgentVariationSpecAgentDocument {
196
- documentId?: string;
197
-
198
- /**
199
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
200
- */
201
- documentMetadata?: Shared.ResourceMetadata;
202
-
203
- documentNamespaceId?: string;
204
-
205
- /**
206
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
207
- */
208
- documentNamespaceMetadata?: Shared.ResourceMetadata;
209
- }
210
-
211
- export interface AgentVariationSpecAgentTool {
212
- agentId?: string;
213
-
236
+ /**
237
+ * CompactionConfig defines how context window compaction behaves for objectives
238
+ * using this variation.
239
+ */
240
+ export interface AgentVariationSpecCompactionConfig {
214
241
  /**
215
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
242
+ * SummarizationStrategy configures LLM-powered summarization of older conversation
243
+ * turns.
216
244
  */
217
- agentMetadata?: Shared.ResourceMetadata;
218
-
219
- toolId?: string;
245
+ summarization?: CompactionConfigSummarizationStrategy;
220
246
 
221
247
  /**
222
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
248
+ * ToolResultClearingStrategy configures clearing of older tool result content.
223
249
  */
224
- toolMetadata?: Shared.ResourceMetadata;
225
-
226
- toolSetId?: string;
250
+ toolResultClearing?: CompactionConfigToolResultClearingStrategy;
227
251
 
228
252
  /**
229
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
253
+ * Trigger threshold as a percentage of the model's context window (0.0 to 1.0).
254
+ * When input tokens reach this percentage of the model's limit, compaction
255
+ * triggers. Default: 0.75 (75%)
230
256
  */
231
- toolSetMetadata?: Shared.ResourceMetadata;
257
+ triggerThreshold?: number;
232
258
  }
233
259
 
234
260
  export interface AgentVariationSpecConstraints {
@@ -278,6 +304,31 @@ export interface AgentVariationSpecToolSelection {
278
304
  autoDiscovery?: ToolSelectionAutoDiscovery;
279
305
  }
280
306
 
307
+ /**
308
+ * SummarizationStrategy configures LLM-powered summarization of older conversation
309
+ * turns.
310
+ */
311
+ export interface CompactionConfigSummarizationStrategy {
312
+ /**
313
+ * Custom instructions that guide what the summarizer preserves. Replaces the
314
+ * default summarization prompt entirely. Example: "Preserve all code snippets,
315
+ * variable names, and technical decisions."
316
+ */
317
+ instructions?: string;
318
+ }
319
+
320
+ /**
321
+ * ToolResultClearingStrategy configures clearing of older tool result content.
322
+ */
323
+ export interface CompactionConfigToolResultClearingStrategy {
324
+ /**
325
+ * Number of most recent tool call results to keep intact. Older tool results have
326
+ * their content replaced with "[result cleared]" while preserving the assistant
327
+ * tool call message (function name, arguments). Default: 2
328
+ */
329
+ preserveRecentResults?: number;
330
+ }
331
+
281
332
  /**
282
333
  * AssignedTools is used to indicate that the agent should only use the tools/tool
283
334
  * sets that are explicitly assigned to it. Allow discovery is used when the agent
@@ -300,7 +351,51 @@ export interface ToolSelectionAutoDiscovery {
300
351
  maxTools?: number;
301
352
  }
302
353
 
303
- export interface VariationCreateParams {
354
+ /**
355
+ * VariationAssignment is a read-only reference to a single tool, tool set, or
356
+ * sub-agent attached to a variation. Clients read the full set of assignments via
357
+ * `AgentVariationInfo.assignments`; mutations go through the dedicated add/remove
358
+ * assignment endpoints under /v1/agent_variations/{id}/assignments.
359
+ *
360
+ * The `id` identifies the assignment row itself (not the referenced resource) and
361
+ * is the handle used to remove the assignment. It is returned by the add endpoint
362
+ * and present on every entry in AgentVariationInfo.assignments.
363
+ */
364
+ export interface VariationAssignment {
365
+ id?: string;
366
+
367
+ /**
368
+ * BareMetadata contains the minimal metadata for a resource: the ID and an
369
+ * optional human-readable name. These are used for reference fields where the full
370
+ * metadata (account scoping, timestamps, labels, external IDs) is not needed —
371
+ * e.g., the tool references inside an agent variation spec or the tools assigned
372
+ * to an objective. Both fields are server-populated; clients provide IDs through
373
+ * sibling fields rather than by constructing a BareMetadata themselves.
374
+ */
375
+ agent?: Shared.BareMetadata;
376
+
377
+ /**
378
+ * BareMetadata contains the minimal metadata for a resource: the ID and an
379
+ * optional human-readable name. These are used for reference fields where the full
380
+ * metadata (account scoping, timestamps, labels, external IDs) is not needed —
381
+ * e.g., the tool references inside an agent variation spec or the tools assigned
382
+ * to an objective. Both fields are server-populated; clients provide IDs through
383
+ * sibling fields rather than by constructing a BareMetadata themselves.
384
+ */
385
+ tool?: Shared.BareMetadata;
386
+
387
+ /**
388
+ * BareMetadata contains the minimal metadata for a resource: the ID and an
389
+ * optional human-readable name. These are used for reference fields where the full
390
+ * metadata (account scoping, timestamps, labels, external IDs) is not needed —
391
+ * e.g., the tool references inside an agent variation spec or the tools assigned
392
+ * to an objective. Both fields are server-populated; clients provide IDs through
393
+ * sibling fields rather than by constructing a BareMetadata themselves.
394
+ */
395
+ toolSet?: Shared.BareMetadata;
396
+ }
397
+
398
+ export interface AgentVariationCreateParams {
304
399
  /**
305
400
  * CreateResourceMetadata contains the user-provided fields for creating a
306
401
  * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
@@ -314,14 +409,14 @@ export interface VariationCreateParams {
314
409
  spec: AgentVariationSpec;
315
410
  }
316
411
 
317
- export interface VariationRetrieveParams {
412
+ export interface AgentVariationRetrieveParams {
318
413
  /**
319
414
  * Agent ID (from path)
320
415
  */
321
416
  agentId: string;
322
417
  }
323
418
 
324
- export interface VariationUpdateParams {
419
+ export interface AgentVariationUpdateParams {
325
420
  /**
326
421
  * Path param: Agent ID (from path)
327
422
  */
@@ -347,7 +442,7 @@ export interface VariationUpdateParams {
347
442
  updateMask?: string;
348
443
  }
349
444
 
350
- export interface VariationListParams extends CursorPaginationParams {
445
+ export interface AgentVariationListParams extends CursorPaginationParams {
351
446
  /**
352
447
  * When set to true you may use more of your alloted API rate-limit
353
448
  */
@@ -359,30 +454,46 @@ export interface VariationListParams extends CursorPaginationParams {
359
454
  sortOrder?: string;
360
455
  }
361
456
 
362
- export interface VariationDeleteParams {
457
+ export interface AgentVariationDeleteParams {
363
458
  /**
364
459
  * Agent ID (from path)
365
460
  */
366
461
  agentId: string;
367
462
  }
368
463
 
369
- export declare namespace Variations {
464
+ export interface AgentVariationAddAssignmentParams {
465
+ subAgentId?: string;
466
+
467
+ toolId?: string;
468
+
469
+ toolSetId?: string;
470
+ }
471
+
472
+ export interface AgentVariationRemoveAssignmentParams {
473
+ agentVariationId: string;
474
+ }
475
+
476
+ export declare namespace AgentVariations {
370
477
  export {
371
478
  type AgentVariation as AgentVariation,
372
479
  type AgentVariationInfo as AgentVariationInfo,
373
480
  type AgentVariationSpec as AgentVariationSpec,
374
- type AgentVariationSpecAgentDocument as AgentVariationSpecAgentDocument,
375
- type AgentVariationSpecAgentTool as AgentVariationSpecAgentTool,
481
+ type AgentVariationSpecCompactionConfig as AgentVariationSpecCompactionConfig,
376
482
  type AgentVariationSpecConstraints as AgentVariationSpecConstraints,
377
483
  type AgentVariationSpecModelConfig as AgentVariationSpecModelConfig,
378
484
  type AgentVariationSpecToolSelection as AgentVariationSpecToolSelection,
485
+ type CompactionConfigSummarizationStrategy as CompactionConfigSummarizationStrategy,
486
+ type CompactionConfigToolResultClearingStrategy as CompactionConfigToolResultClearingStrategy,
379
487
  type ToolSelectionAssignedTools as ToolSelectionAssignedTools,
380
488
  type ToolSelectionAutoDiscovery as ToolSelectionAutoDiscovery,
489
+ type VariationAssignment as VariationAssignment,
381
490
  type AgentVariationsCursorPagination as AgentVariationsCursorPagination,
382
- type VariationCreateParams as VariationCreateParams,
383
- type VariationRetrieveParams as VariationRetrieveParams,
384
- type VariationUpdateParams as VariationUpdateParams,
385
- type VariationListParams as VariationListParams,
386
- type VariationDeleteParams as VariationDeleteParams,
491
+ type AgentVariationCreateParams as AgentVariationCreateParams,
492
+ type AgentVariationRetrieveParams as AgentVariationRetrieveParams,
493
+ type AgentVariationUpdateParams as AgentVariationUpdateParams,
494
+ type AgentVariationListParams as AgentVariationListParams,
495
+ type AgentVariationDeleteParams as AgentVariationDeleteParams,
496
+ type AgentVariationAddAssignmentParams as AgentVariationAddAssignmentParams,
497
+ type AgentVariationRemoveAssignmentParams as AgentVariationRemoveAssignmentParams,
387
498
  };
388
499
  }
@@ -2,27 +2,8 @@
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as AccountAPI from '../account';
5
+ import * as AgentVariationsAPI from '../agent-variations';
5
6
  import * as Shared from '../shared';
6
- import * as VariationsAPI from './variations';
7
- import {
8
- AgentVariation,
9
- AgentVariationInfo,
10
- AgentVariationSpec,
11
- AgentVariationSpecAgentDocument,
12
- AgentVariationSpecAgentTool,
13
- AgentVariationSpecConstraints,
14
- AgentVariationSpecModelConfig,
15
- AgentVariationSpecToolSelection,
16
- AgentVariationsCursorPagination,
17
- ToolSelectionAssignedTools,
18
- ToolSelectionAutoDiscovery,
19
- VariationCreateParams,
20
- VariationDeleteParams,
21
- VariationListParams,
22
- VariationRetrieveParams,
23
- VariationUpdateParams,
24
- Variations,
25
- } from './variations';
26
7
  import * as WebhookDeliveriesAPI from './webhook-deliveries';
27
8
  import {
28
9
  WebhookDeliveries,
@@ -46,7 +27,6 @@ import { path } from '../../internal/utils/path';
46
27
  * Scope: Workspace-level operations
47
28
  */
48
29
  export class Agents extends APIResource {
49
- variations: VariationsAPI.Variations = new VariationsAPI.Variations(this._client);
50
30
  webhookDeliveries: WebhookDeliveriesAPI.WebhookDeliveries = new WebhookDeliveriesAPI.WebhookDeliveries(
51
31
  this._client,
52
32
  );
@@ -158,13 +138,6 @@ export interface AgentSpec {
158
138
  */
159
139
  description?: string;
160
140
 
161
- /**
162
- * The generated secret that will sign all webhooks that are sent to your
163
- * configured Webhook URL. Formatted as "wh_asdf1234" per the
164
- * https://www.standardwebhooks.com/ format.
165
- */
166
- webhookEventsHmacSecret?: string;
167
-
168
141
  /**
169
142
  * The URL that Cadenya will send events for any objective assigned to the agent.
170
143
  */
@@ -211,7 +184,7 @@ export namespace AgentCreateParams {
211
184
  /**
212
185
  * AgentVariationSpec defines the operational configuration for a variation
213
186
  */
214
- spec: VariationsAPI.AgentVariationSpec;
187
+ spec: AgentVariationsAPI.AgentVariationSpec;
215
188
  }
216
189
  }
217
190
 
@@ -251,7 +224,6 @@ export interface AgentListParams extends CursorPaginationParams {
251
224
  sortOrder?: string;
252
225
  }
253
226
 
254
- Agents.Variations = Variations;
255
227
  Agents.WebhookDeliveries = WebhookDeliveries;
256
228
 
257
229
  export declare namespace Agents {
@@ -266,26 +238,6 @@ export declare namespace Agents {
266
238
  type AgentListParams as AgentListParams,
267
239
  };
268
240
 
269
- export {
270
- Variations as Variations,
271
- type AgentVariation as AgentVariation,
272
- type AgentVariationInfo as AgentVariationInfo,
273
- type AgentVariationSpec as AgentVariationSpec,
274
- type AgentVariationSpecAgentDocument as AgentVariationSpecAgentDocument,
275
- type AgentVariationSpecAgentTool as AgentVariationSpecAgentTool,
276
- type AgentVariationSpecConstraints as AgentVariationSpecConstraints,
277
- type AgentVariationSpecModelConfig as AgentVariationSpecModelConfig,
278
- type AgentVariationSpecToolSelection as AgentVariationSpecToolSelection,
279
- type ToolSelectionAssignedTools as ToolSelectionAssignedTools,
280
- type ToolSelectionAutoDiscovery as ToolSelectionAutoDiscovery,
281
- type AgentVariationsCursorPagination as AgentVariationsCursorPagination,
282
- type VariationCreateParams as VariationCreateParams,
283
- type VariationRetrieveParams as VariationRetrieveParams,
284
- type VariationUpdateParams as VariationUpdateParams,
285
- type VariationListParams as VariationListParams,
286
- type VariationDeleteParams as VariationDeleteParams,
287
- };
288
-
289
241
  export {
290
242
  WebhookDeliveries as WebhookDeliveries,
291
243
  type WebhookDelivery as WebhookDelivery,
@@ -11,25 +11,6 @@ export {
11
11
  type AgentListParams,
12
12
  type AgentsCursorPagination,
13
13
  } from './agents';
14
- export {
15
- Variations,
16
- type AgentVariation,
17
- type AgentVariationInfo,
18
- type AgentVariationSpec,
19
- type AgentVariationSpecAgentDocument,
20
- type AgentVariationSpecAgentTool,
21
- type AgentVariationSpecConstraints,
22
- type AgentVariationSpecModelConfig,
23
- type AgentVariationSpecToolSelection,
24
- type ToolSelectionAssignedTools,
25
- type ToolSelectionAutoDiscovery,
26
- type VariationCreateParams,
27
- type VariationRetrieveParams,
28
- type VariationUpdateParams,
29
- type VariationListParams,
30
- type VariationDeleteParams,
31
- type AgentVariationsCursorPagination,
32
- } from './variations';
33
14
  export {
34
15
  WebhookDeliveries,
35
16
  type WebhookDelivery,
@@ -68,7 +68,8 @@ export interface WebhookDeliveryData {
68
68
  | 'OBJECTIVE_EVENT_TYPE_ERROR'
69
69
  | 'OBJECTIVE_EVENT_TYPE_ASSISTANT_MESSAGE'
70
70
  | 'OBJECTIVE_EVENT_TYPE_TOOL_RESULT'
71
- | 'OBJECTIVE_EVENT_TYPE_TOOL_ERROR';
71
+ | 'OBJECTIVE_EVENT_TYPE_TOOL_ERROR'
72
+ | 'OBJECTIVE_EVENT_TYPE_CONTEXT_WINDOW_COMPACTED';
72
73
 
73
74
  /**
74
75
  * Response details (no response_body to avoid storing large payloads)
@@ -125,7 +126,8 @@ export interface WebhookDeliveryListParams extends CursorPaginationParams {
125
126
  | 'OBJECTIVE_EVENT_TYPE_ERROR'
126
127
  | 'OBJECTIVE_EVENT_TYPE_ASSISTANT_MESSAGE'
127
128
  | 'OBJECTIVE_EVENT_TYPE_TOOL_RESULT'
128
- | 'OBJECTIVE_EVENT_TYPE_TOOL_ERROR';
129
+ | 'OBJECTIVE_EVENT_TYPE_TOOL_ERROR'
130
+ | 'OBJECTIVE_EVENT_TYPE_CONTEXT_WINDOW_COMPACTED';
129
131
 
130
132
  /**
131
133
  * Optional filter by objective ID
@@ -11,7 +11,37 @@ export {
11
11
  type APIKeyListParams,
12
12
  type APIKeysCursorPagination,
13
13
  } from './api-keys';
14
- export { AccountResource, type Account, type AccountSpec, type Profile, type ProfileSpec } from './account';
14
+ export {
15
+ AccountResource,
16
+ type Account,
17
+ type AccountSpec,
18
+ type Profile,
19
+ type ProfileSpec,
20
+ type RotateWebhookSigningKeyResponse,
21
+ } from './account';
22
+ export {
23
+ AgentVariations,
24
+ type AgentVariation,
25
+ type AgentVariationInfo,
26
+ type AgentVariationSpec,
27
+ type AgentVariationSpecCompactionConfig,
28
+ type AgentVariationSpecConstraints,
29
+ type AgentVariationSpecModelConfig,
30
+ type AgentVariationSpecToolSelection,
31
+ type CompactionConfigSummarizationStrategy,
32
+ type CompactionConfigToolResultClearingStrategy,
33
+ type ToolSelectionAssignedTools,
34
+ type ToolSelectionAutoDiscovery,
35
+ type VariationAssignment,
36
+ type AgentVariationCreateParams,
37
+ type AgentVariationRetrieveParams,
38
+ type AgentVariationUpdateParams,
39
+ type AgentVariationListParams,
40
+ type AgentVariationDeleteParams,
41
+ type AgentVariationAddAssignmentParams,
42
+ type AgentVariationRemoveAssignmentParams,
43
+ type AgentVariationsCursorPagination,
44
+ } from './agent-variations';
15
45
  export {
16
46
  Agents,
17
47
  type Agent,
@@ -36,6 +66,7 @@ export {
36
66
  type AssistantMessage,
37
67
  type AssistantToolCall,
38
68
  type CallableTool,
69
+ type ContextWindowCompacted,
39
70
  type Objective,
40
71
  type ObjectiveContextWindow,
41
72
  type ObjectiveContextWindowData,
@@ -55,11 +86,13 @@ export {
55
86
  type ToolError,
56
87
  type ToolResult,
57
88
  type UserMessage,
89
+ type ObjectiveCompactResponse,
58
90
  type ObjectiveContinueResponse,
59
91
  type ObjectiveListEventsResponse,
60
92
  type ObjectiveCreateParams,
61
93
  type ObjectiveListParams,
62
94
  type ObjectiveCancelParams,
95
+ type ObjectiveCompactParams,
63
96
  type ObjectiveContinueParams,
64
97
  type ObjectiveListContextWindowsParams,
65
98
  type ObjectiveListEventsParams,
@@ -93,6 +126,7 @@ export {
93
126
  type ToolSetsCursorPagination,
94
127
  type ToolSetEventsCursorPagination,
95
128
  } from './tool-sets/tool-sets';
129
+ export { Webhooks, type UnsafeUnwrapWebhookEvent, type UnwrapWebhookEvent } from './webhooks';
96
130
  export {
97
131
  WorkspaceSecrets,
98
132
  type WorkspaceSecret,
@@ -48,12 +48,12 @@ export interface ObjectiveFeedback {
48
48
  data: ObjectiveFeedbackData;
49
49
 
50
50
  /**
51
- * BareMetadata contains the minimal metadata for a resource, including the ID.
52
- * These are used sparingly in Cadenya for resources where the full metadata is not
53
- * needed. You will come across them in list responses and other places where the
54
- * full metadata is not required like listing the tools that were assigned to an
55
- * objective. Because these types records are commonly created by other processes
56
- * in Cadenya, they do not have things like external IDs, labels, or names.
51
+ * BareMetadata contains the minimal metadata for a resource: the ID and an
52
+ * optional human-readable name. These are used for reference fields where the full
53
+ * metadata (account scoping, timestamps, labels, external IDs) is not needed
54
+ * e.g., the tool references inside an agent variation spec or the tools assigned
55
+ * to an objective. Both fields are server-populated; clients provide IDs through
56
+ * sibling fields rather than by constructing a BareMetadata themselves.
57
57
  */
58
58
  metadata: Shared.BareMetadata;
59
59
 
@@ -14,6 +14,7 @@ export {
14
14
  type AssistantMessage,
15
15
  type AssistantToolCall,
16
16
  type CallableTool,
17
+ type ContextWindowCompacted,
17
18
  type Objective,
18
19
  type ObjectiveContextWindow,
19
20
  type ObjectiveContextWindowData,
@@ -33,11 +34,13 @@ export {
33
34
  type ToolError,
34
35
  type ToolResult,
35
36
  type UserMessage,
37
+ type ObjectiveCompactResponse,
36
38
  type ObjectiveContinueResponse,
37
39
  type ObjectiveListEventsResponse,
38
40
  type ObjectiveCreateParams,
39
41
  type ObjectiveListParams,
40
42
  type ObjectiveCancelParams,
43
+ type ObjectiveCompactParams,
41
44
  type ObjectiveContinueParams,
42
45
  type ObjectiveListContextWindowsParams,
43
46
  type ObjectiveListEventsParams,