@cadenya/cadenya 0.82.0 → 0.85.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 (177) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +8 -17
  3. package/client.d.mts +15 -12
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +15 -12
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -0
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/account.d.mts +1 -1
  13. package/resources/account.d.mts.map +1 -1
  14. package/resources/account.d.ts +1 -1
  15. package/resources/account.d.ts.map +1 -1
  16. package/resources/account.js +1 -1
  17. package/resources/account.js.map +1 -1
  18. package/resources/account.mjs +1 -1
  19. package/resources/account.mjs.map +1 -1
  20. package/resources/agents/agents.d.mts +55 -9
  21. package/resources/agents/agents.d.mts.map +1 -1
  22. package/resources/agents/agents.d.ts +55 -9
  23. package/resources/agents/agents.d.ts.map +1 -1
  24. package/resources/agents/agents.js +38 -0
  25. package/resources/agents/agents.js.map +1 -1
  26. package/resources/agents/agents.mjs +38 -0
  27. package/resources/agents/agents.mjs.map +1 -1
  28. package/resources/agents/index.d.mts +2 -2
  29. package/resources/agents/index.d.mts.map +1 -1
  30. package/resources/agents/index.d.ts +2 -2
  31. package/resources/agents/index.d.ts.map +1 -1
  32. package/resources/agents/index.js.map +1 -1
  33. package/resources/agents/index.mjs.map +1 -1
  34. package/resources/agents/schedules.d.mts +57 -6
  35. package/resources/agents/schedules.d.mts.map +1 -1
  36. package/resources/agents/schedules.d.ts +57 -6
  37. package/resources/agents/schedules.d.ts.map +1 -1
  38. package/resources/agents/schedules.js +34 -0
  39. package/resources/agents/schedules.js.map +1 -1
  40. package/resources/agents/schedules.mjs +34 -0
  41. package/resources/agents/schedules.mjs.map +1 -1
  42. package/resources/ai-provider-keys.d.mts +142 -0
  43. package/resources/ai-provider-keys.d.mts.map +1 -0
  44. package/resources/ai-provider-keys.d.ts +142 -0
  45. package/resources/ai-provider-keys.d.ts.map +1 -0
  46. package/resources/ai-provider-keys.js +51 -0
  47. package/resources/ai-provider-keys.js.map +1 -0
  48. package/resources/ai-provider-keys.mjs +47 -0
  49. package/resources/ai-provider-keys.mjs.map +1 -0
  50. package/resources/api-keys/api-keys.d.mts +4 -2
  51. package/resources/api-keys/api-keys.d.mts.map +1 -1
  52. package/resources/api-keys/api-keys.d.ts +4 -2
  53. package/resources/api-keys/api-keys.d.ts.map +1 -1
  54. package/resources/api-keys/api-keys.js +2 -2
  55. package/resources/api-keys/api-keys.js.map +1 -1
  56. package/resources/api-keys/api-keys.mjs +2 -2
  57. package/resources/api-keys/api-keys.mjs.map +1 -1
  58. package/resources/api-keys/index.d.mts +1 -1
  59. package/resources/api-keys/index.d.mts.map +1 -1
  60. package/resources/api-keys/index.d.ts +1 -1
  61. package/resources/api-keys/index.d.ts.map +1 -1
  62. package/resources/api-keys/index.js.map +1 -1
  63. package/resources/api-keys/index.mjs.map +1 -1
  64. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts +23 -7
  65. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts.map +1 -1
  66. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts +23 -7
  67. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts.map +1 -1
  68. package/resources/bulk-workspace-resources/bulk-workspace-resources.js.map +1 -1
  69. package/resources/bulk-workspace-resources/bulk-workspace-resources.mjs.map +1 -1
  70. package/resources/index.d.mts +7 -6
  71. package/resources/index.d.mts.map +1 -1
  72. package/resources/index.d.ts +7 -6
  73. package/resources/index.d.ts.map +1 -1
  74. package/resources/index.js +3 -1
  75. package/resources/index.js.map +1 -1
  76. package/resources/index.mjs +1 -0
  77. package/resources/index.mjs.map +1 -1
  78. package/resources/models.d.mts +84 -13
  79. package/resources/models.d.mts.map +1 -1
  80. package/resources/models.d.ts +84 -13
  81. package/resources/models.d.ts.map +1 -1
  82. package/resources/models.js +22 -3
  83. package/resources/models.js.map +1 -1
  84. package/resources/models.mjs +22 -3
  85. package/resources/models.mjs.map +1 -1
  86. package/resources/objectives/index.d.mts +1 -1
  87. package/resources/objectives/index.d.mts.map +1 -1
  88. package/resources/objectives/index.d.ts +1 -1
  89. package/resources/objectives/index.d.ts.map +1 -1
  90. package/resources/objectives/index.js.map +1 -1
  91. package/resources/objectives/index.mjs.map +1 -1
  92. package/resources/objectives/objectives.d.mts +149 -98
  93. package/resources/objectives/objectives.d.mts.map +1 -1
  94. package/resources/objectives/objectives.d.ts +149 -98
  95. package/resources/objectives/objectives.d.ts.map +1 -1
  96. package/resources/objectives/objectives.js +3 -3
  97. package/resources/objectives/objectives.js.map +1 -1
  98. package/resources/objectives/objectives.mjs +3 -3
  99. package/resources/objectives/objectives.mjs.map +1 -1
  100. package/resources/objectives/tool-calls.d.mts +1 -1
  101. package/resources/objectives/tool-calls.d.mts.map +1 -1
  102. package/resources/objectives/tool-calls.d.ts +1 -1
  103. package/resources/objectives/tool-calls.d.ts.map +1 -1
  104. package/resources/objectives/tool-calls.js +2 -2
  105. package/resources/objectives/tool-calls.js.map +1 -1
  106. package/resources/objectives/tool-calls.mjs +2 -2
  107. package/resources/objectives/tool-calls.mjs.map +1 -1
  108. package/resources/shared.d.mts +4 -0
  109. package/resources/shared.d.mts.map +1 -1
  110. package/resources/shared.d.ts +4 -0
  111. package/resources/shared.d.ts.map +1 -1
  112. package/resources/tool-sets/index.d.mts +2 -2
  113. package/resources/tool-sets/index.d.mts.map +1 -1
  114. package/resources/tool-sets/index.d.ts +2 -2
  115. package/resources/tool-sets/index.d.ts.map +1 -1
  116. package/resources/tool-sets/index.js.map +1 -1
  117. package/resources/tool-sets/index.mjs.map +1 -1
  118. package/resources/tool-sets/tool-sets.d.mts +40 -3
  119. package/resources/tool-sets/tool-sets.d.mts.map +1 -1
  120. package/resources/tool-sets/tool-sets.d.ts +40 -3
  121. package/resources/tool-sets/tool-sets.d.ts.map +1 -1
  122. package/resources/tool-sets/tool-sets.js +27 -1
  123. package/resources/tool-sets/tool-sets.js.map +1 -1
  124. package/resources/tool-sets/tool-sets.mjs +27 -1
  125. package/resources/tool-sets/tool-sets.mjs.map +1 -1
  126. package/resources/tool-sets/tools.d.mts +39 -5
  127. package/resources/tool-sets/tools.d.mts.map +1 -1
  128. package/resources/tool-sets/tools.d.ts +39 -5
  129. package/resources/tool-sets/tools.d.ts.map +1 -1
  130. package/resources/tool-sets/tools.js +23 -1
  131. package/resources/tool-sets/tools.js.map +1 -1
  132. package/resources/tool-sets/tools.mjs +23 -1
  133. package/resources/tool-sets/tools.mjs.map +1 -1
  134. package/resources/workspace-admin/index.d.mts +1 -1
  135. package/resources/workspace-admin/index.d.mts.map +1 -1
  136. package/resources/workspace-admin/index.d.ts +1 -1
  137. package/resources/workspace-admin/index.d.ts.map +1 -1
  138. package/resources/workspace-admin/index.js.map +1 -1
  139. package/resources/workspace-admin/index.mjs.map +1 -1
  140. package/resources/workspace-admin/profiles.d.mts +1 -6
  141. package/resources/workspace-admin/profiles.d.mts.map +1 -1
  142. package/resources/workspace-admin/profiles.d.ts +1 -6
  143. package/resources/workspace-admin/profiles.d.ts.map +1 -1
  144. package/resources/workspace-admin/workspace-admin.d.mts +43 -1
  145. package/resources/workspace-admin/workspace-admin.d.mts.map +1 -1
  146. package/resources/workspace-admin/workspace-admin.d.ts +43 -1
  147. package/resources/workspace-admin/workspace-admin.d.ts.map +1 -1
  148. package/resources/workspace-admin/workspace-admin.js +6 -0
  149. package/resources/workspace-admin/workspace-admin.js.map +1 -1
  150. package/resources/workspace-admin/workspace-admin.mjs +6 -0
  151. package/resources/workspace-admin/workspace-admin.mjs.map +1 -1
  152. package/src/client.ts +53 -8
  153. package/src/resources/account.ts +2 -2
  154. package/src/resources/agents/agents.ts +89 -15
  155. package/src/resources/agents/index.ts +7 -0
  156. package/src/resources/agents/schedules.ts +87 -10
  157. package/src/resources/ai-provider-keys.ts +216 -0
  158. package/src/resources/api-keys/api-keys.ts +5 -2
  159. package/src/resources/api-keys/index.ts +1 -0
  160. package/src/resources/bulk-workspace-resources/bulk-workspace-resources.ts +26 -7
  161. package/src/resources/index.ts +25 -4
  162. package/src/resources/models.ts +109 -15
  163. package/src/resources/objectives/index.ts +2 -3
  164. package/src/resources/objectives/objectives.ts +171 -120
  165. package/src/resources/objectives/tool-calls.ts +11 -11
  166. package/src/resources/shared.ts +5 -0
  167. package/src/resources/tool-sets/index.ts +4 -0
  168. package/src/resources/tool-sets/tool-sets.ts +62 -1
  169. package/src/resources/tool-sets/tools.ts +60 -12
  170. package/src/resources/workspace-admin/index.ts +1 -0
  171. package/src/resources/workspace-admin/profiles.ts +1 -7
  172. package/src/resources/workspace-admin/workspace-admin.ts +54 -0
  173. package/src/version.ts +1 -1
  174. package/version.d.mts +1 -1
  175. package/version.d.ts +1 -1
  176. package/version.js +1 -1
  177. package/version.mjs +1 -1
@@ -5,6 +5,7 @@ import * as ObjectivesAPI from './objectives';
5
5
  import * as AccountAPI from '../account';
6
6
  import * as Shared from '../shared';
7
7
  import * as AgentsAPI from '../agents/agents';
8
+ import * as SchedulesAPI from '../agents/schedules';
8
9
  import * as VariationsAPI from '../agents/variations';
9
10
  import * as FeedbackAPI from './feedback';
10
11
  import {
@@ -89,7 +90,7 @@ export class Objectives extends APIResource {
89
90
  options?: RequestOptions,
90
91
  ): APIPromise<Objective> {
91
92
  const { workspaceId, ...body } = params;
92
- return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/cancel`, {
93
+ return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}:cancel`, {
93
94
  body,
94
95
  ...options,
95
96
  });
@@ -105,7 +106,7 @@ export class Objectives extends APIResource {
105
106
  options?: RequestOptions,
106
107
  ): APIPromise<ObjectiveCompactResponse> {
107
108
  const { workspaceId, ...body } = params;
108
- return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/compact`, {
109
+ return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}:compact`, {
109
110
  body,
110
111
  ...options,
111
112
  });
@@ -120,7 +121,7 @@ export class Objectives extends APIResource {
120
121
  options?: RequestOptions,
121
122
  ): APIPromise<ObjectiveContinueResponse> {
122
123
  const { workspaceId, ...body } = params;
123
- return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}/continue`, {
124
+ return this._client.post(path`/v1/workspaces/${workspaceId}/objectives/${objectiveID}:continue`, {
124
125
  body,
125
126
  ...options,
126
127
  });
@@ -276,8 +277,23 @@ export interface MemoryReference {
276
277
  memoryLayerId?: string;
277
278
  }
278
279
 
280
+ /**
281
+ * Objective is the data for an objective. It contains the snapshotted fields for
282
+ * the selected agent and variation. Secrets are returned only with their names,
283
+ * and the output definition is copied from the agent's configuration.
284
+ */
279
285
  export interface Objective {
280
- data: ObjectiveData;
286
+ /**
287
+ * ObjectiveConfigSnapshot is the point-in-time snapshot of the agent, variation,
288
+ * and (when applicable) schedule that an objective was started with.
289
+ */
290
+ configSnapshot: ObjectiveConfigSnapshot;
291
+
292
+ /**
293
+ * The initial message sent to the agent. This becomes the first user message in
294
+ * the LLM chat history.
295
+ */
296
+ initialMessage: string;
281
297
 
282
298
  /**
283
299
  * Metadata for ephemeral operations and activities (e.g., objectives, executions,
@@ -285,7 +301,27 @@ export interface Objective {
285
301
  */
286
302
  metadata: Shared.OperationMetadata;
287
303
 
288
- status: ObjectiveStatus;
304
+ /**
305
+ * The current lifecycle state of the objective.
306
+ */
307
+ state:
308
+ | 'STATE_UNSPECIFIED'
309
+ | 'STATE_PENDING'
310
+ | 'STATE_RUNNING'
311
+ | 'STATE_WAITING'
312
+ | 'STATE_FAILED'
313
+ | 'STATE_CANCELLED'
314
+ | 'STATE_FINALIZED';
315
+
316
+ /**
317
+ * system_prompt is read-only, derived from the selected variation's prompt
318
+ */
319
+ systemPrompt: string;
320
+
321
+ /**
322
+ * Arbitrary data for the objective
323
+ */
324
+ data?: { [key: string]: unknown };
289
325
 
290
326
  /**
291
327
  * ObjectiveInfo provides read-only aggregated statistics about an objective's
@@ -294,11 +330,69 @@ export interface Objective {
294
330
  info?: ObjectiveInfo;
295
331
 
296
332
  /**
297
- * Read-only list of the last five windows of execution for this objective, ordered
298
- * by most recent first. Is only included in singular RPC calls (GetObjective, for
299
- * example).
333
+ * Memory layers/entries to push onto this objective's memory stack on top of the
334
+ * baseline stack inherited from the selected variation.
335
+ *
336
+ * Array order is push order: the first element sits lower in the objective's
337
+ * contribution to the stack; the LAST element ends up on top of the effective
338
+ * stack. Entries pinned via memory_entry_id behave as single-entry layers at their
339
+ * position.
340
+ *
341
+ * System-managed layers (e.g., episodic) cannot be referenced here; they attach
342
+ * themselves automatically based on episodic_key.
343
+ *
344
+ * Stack size cap: the TOTAL effective stack (variation's memory layers
345
+ *
346
+ * - this field) must not exceed 10 entries. A request that would produce an
347
+ * effective stack larger than 10 is rejected with InvalidArgument.
348
+ */
349
+ memoryStack?: Array<MemoryReference>;
350
+
351
+ /**
352
+ * The output of the objective, populated when the objective completes. Will match
353
+ * the schema of output_json_schema or output_json_inferred. This will only be set
354
+ * if the state of the objective is set to STATE_FINALIZED
355
+ */
356
+ output?: { [key: string]: unknown };
357
+
358
+ /**
359
+ * A parent objective means the objective was spawned off using a separate agent to
360
+ * complete an objective
361
+ */
362
+ parentObjectiveId?: string;
363
+
364
+ /**
365
+ * Secrets that can be used in the headers for tool calls using the secret
366
+ * interpolation format.
367
+ */
368
+ secrets?: Array<ObjectiveSecret>;
369
+
370
+ /**
371
+ * Optional human-readable detail about the current state (e.g. a failure reason).
372
+ */
373
+ stateMessage?: string;
374
+ }
375
+
376
+ /**
377
+ * ObjectiveConfigSnapshot is the point-in-time snapshot of the agent, variation,
378
+ * and (when applicable) schedule that an objective was started with.
379
+ */
380
+ export interface ObjectiveConfigSnapshot {
381
+ /**
382
+ * Agent resource
383
+ */
384
+ agent?: AgentsAPI.Agent;
385
+
386
+ /**
387
+ * AgentSchedule resource — a recurring trigger attached to an agent that creates
388
+ * objectives on its cadence.
389
+ */
390
+ agentSchedule?: SchedulesAPI.AgentSchedule;
391
+
392
+ /**
393
+ * AgentVariation resource
300
394
  */
301
- lastFiveWindows?: Array<ObjectiveContextWindow>;
395
+ agentVariation?: VariationsAPI.AgentVariation;
302
396
  }
303
397
 
304
398
  /**
@@ -367,91 +461,6 @@ export interface ObjectiveContextWindowData {
367
461
  sequence?: number;
368
462
  }
369
463
 
370
- export interface ObjectiveData {
371
- /**
372
- * Agent resource
373
- */
374
- agent?: AgentsAPI.Agent;
375
-
376
- /**
377
- * Represents a dynamically typed value which can be either null, a number, a
378
- * string, a boolean, a recursive struct value, or a list of values.
379
- */
380
- data?: unknown;
381
-
382
- /**
383
- * The initial message sent to the agent. This becomes the first user message in
384
- * the LLM chat history.
385
- */
386
- initialMessage?: string;
387
-
388
- /**
389
- * Memory layers/entries to push onto this objective's memory stack on top of the
390
- * baseline stack inherited from the selected variation.
391
- *
392
- * Array order is push order: the first element sits lower in the objective's
393
- * contribution to the stack; the LAST element ends up on top of the effective
394
- * stack. Entries pinned via memory_entry_id behave as single-entry layers at their
395
- * position.
396
- *
397
- * System-managed layers (e.g., episodic) cannot be referenced here; they attach
398
- * themselves automatically based on episodic_key.
399
- *
400
- * Stack size cap: the TOTAL effective stack (variation's memory layers
401
- *
402
- * - this field) must not exceed 10 entries. A request that would produce an
403
- * effective stack larger than 10 is rejected with InvalidArgument.
404
- */
405
- memoryStack?: Array<MemoryReference>;
406
-
407
- /**
408
- * The output of the objective, populated when the objective completes. Will match
409
- * the schema of output_json_schema or output_json_inferred.
410
- */
411
- output?: { [key: string]: unknown };
412
-
413
- /**
414
- * Snapshot of the agent spec's output_definition at objective creation time. When
415
- * present, the objective will run an extraction step after the LLM finishes.
416
- */
417
- outputDefinition?: { [key: string]: unknown };
418
-
419
- /**
420
- * A parent objective means the objective was spawned off using a separate agent to
421
- * complete an objective
422
- */
423
- parentObjectiveId?: string;
424
-
425
- /**
426
- * Secrets that can be used in the headers for tool calls using the secret
427
- * interpolation format.
428
- */
429
- secrets?: Array<ObjectiveDataSecret>;
430
-
431
- /**
432
- * ID of the AgentSchedule that produced this objective, when applicable. Populated
433
- * when the objective is created from a schedule fire; empty when the objective was
434
- * created via CreateObjective directly.
435
- */
436
- sourceScheduleId?: string;
437
-
438
- /**
439
- * system_prompt is read-only, derived from the selected variation's prompt
440
- */
441
- systemPrompt?: string;
442
-
443
- /**
444
- * AgentVariation resource
445
- */
446
- variation?: VariationsAPI.AgentVariation;
447
- }
448
-
449
- export interface ObjectiveDataSecret {
450
- name?: string;
451
-
452
- value?: string;
453
- }
454
-
455
464
  export interface ObjectiveError {
456
465
  message?: string;
457
466
 
@@ -622,67 +631,66 @@ export interface ObjectiveInfo {
622
631
  /**
623
632
  * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
624
633
  */
625
- agent?: Shared.ResourceMetadata;
634
+ agent: Shared.ResourceMetadata;
626
635
 
627
636
  /**
628
637
  * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
629
638
  */
630
- agentVariation?: Shared.ResourceMetadata;
639
+ agentVariation: Shared.ResourceMetadata;
631
640
 
632
641
  /**
633
642
  * A profile identifies a user or non-human principal (such as an API key) at the
634
643
  * account level. Profiles are account-scoped and can be granted access to multiple
635
644
  * workspaces.
636
645
  */
637
- createdBy?: AccountAPI.Profile;
646
+ createdBy: AccountAPI.Profile;
647
+
648
+ /**
649
+ * ID of the objective's current (most recent) context window. Hydrated on demand;
650
+ * empty when the objective has not yet produced a context window.
651
+ */
652
+ currentContextWindowId: string;
638
653
 
639
654
  /**
640
655
  * The effective memory stack at objective creation time, flattened from the
641
- * variation's baseline plus ObjectiveData.memory_stack. Order is push order (last
642
- * = top). Returned on reads so clients can see exactly what stack the objective is
656
+ * variation's baseline plus Objective.memory_stack. Order is push order (last =
657
+ * top). Returned on reads so clients can see exactly what stack the objective is
643
658
  * using without having to re-join variation state.
644
659
  */
645
- effectiveMemoryStack?: Array<MemoryReference>;
660
+ effectiveMemoryStack: Array<MemoryReference>;
646
661
 
647
662
  /**
648
663
  * Total number of context windows that this objective has generated
649
664
  */
650
- totalContextWindows?: number;
665
+ totalContextWindows: number;
651
666
 
652
667
  /**
653
668
  * Total number of events generated during this objective's execution
654
669
  */
655
- totalEvents?: number;
670
+ totalEvents: number;
656
671
 
657
672
  /**
658
673
  * Total input tokens consumed across all LLM completions across all context
659
674
  * windows
660
675
  */
661
- totalInputTokens?: number;
676
+ totalInputTokens: number;
677
+
678
+ totalIterations: number;
662
679
 
663
680
  /**
664
681
  * Total output tokens generated across all LLM completions across all context
665
682
  * windows
666
683
  */
667
- totalOutputTokens?: number;
684
+ totalOutputTokens: number;
668
685
 
669
686
  /**
670
687
  * Total number of tool calls made during execution
671
688
  */
672
- totalToolCalls?: number;
689
+ totalToolCalls: number;
673
690
  }
674
691
 
675
- export interface ObjectiveStatus {
676
- state:
677
- | 'STATE_UNSPECIFIED'
678
- | 'STATE_PENDING'
679
- | 'STATE_RUNNING'
680
- | 'STATE_WAITING'
681
- | 'STATE_FAILED'
682
- | 'STATE_CANCELLED'
683
- | 'STATE_FINALIZED';
684
-
685
- message?: string;
692
+ export interface ObjectiveSecret {
693
+ name?: string;
686
694
  }
687
695
 
688
696
  export interface SubAgentSpawned {
@@ -830,7 +838,37 @@ export interface ObjectiveListEventsResponse {
830
838
  export interface ObjectiveCreateParams {
831
839
  agentId: string;
832
840
 
833
- data: ObjectiveData;
841
+ /**
842
+ * Arbitrary data for the objective. May be used in liquid templates for prompts
843
+ * configured on the agent variation
844
+ */
845
+ data: { [key: string]: unknown };
846
+
847
+ /**
848
+ * Optional override for initial message sent to the agent. This becomes the first
849
+ * user message in the LLM chat history. The agent variation is used to set this if
850
+ * not present.
851
+ */
852
+ initialMessage?: string;
853
+
854
+ /**
855
+ * Memory layers/entries to push onto this objective's memory stack on top of the
856
+ * baseline stack inherited from the selected variation.
857
+ *
858
+ * Array order is push order: the first element sits lower in the objective's
859
+ * contribution to the stack; the LAST element ends up on top of the effective
860
+ * stack. Entries pinned via memory_entry_id behave as single-entry layers at their
861
+ * position.
862
+ *
863
+ * System-managed layers (e.g., episodic) cannot be referenced here; they attach
864
+ * themselves automatically based on episodic_key.
865
+ *
866
+ * Stack size cap: the TOTAL effective stack (variation's memory layers
867
+ *
868
+ * - this field) must not exceed 10 entries. A request that would produce an
869
+ * effective stack larger than 10 is rejected with InvalidArgument.
870
+ */
871
+ memoryStack?: Array<MemoryReference>;
834
872
 
835
873
  /**
836
874
  * CreateOperationMetadata contains the user-provided fields for creating an
@@ -839,6 +877,12 @@ export interface ObjectiveCreateParams {
839
877
  */
840
878
  metadata?: Shared.CreateOperationMetadata;
841
879
 
880
+ /**
881
+ * Secrets that can be used in the headers for tool calls using the secret
882
+ * interpolation format.
883
+ */
884
+ secrets?: Array<ObjectiveCreateParams.Secret>;
885
+
842
886
  /**
843
887
  * Optional explicit variation selection. Overrides the agent's
844
888
  * variation_selection_mode.
@@ -846,6 +890,14 @@ export interface ObjectiveCreateParams {
846
890
  variationId?: string;
847
891
  }
848
892
 
893
+ export namespace ObjectiveCreateParams {
894
+ export interface Secret {
895
+ name?: string;
896
+
897
+ value?: string;
898
+ }
899
+ }
900
+
849
901
  export interface ObjectiveRetrieveParams {
850
902
  workspaceId: string;
851
903
  }
@@ -1004,16 +1056,15 @@ export declare namespace Objectives {
1004
1056
  type MemoryRead as MemoryRead,
1005
1057
  type MemoryReference as MemoryReference,
1006
1058
  type Objective as Objective,
1059
+ type ObjectiveConfigSnapshot as ObjectiveConfigSnapshot,
1007
1060
  type ObjectiveContextWindow as ObjectiveContextWindow,
1008
1061
  type ObjectiveContextWindowData as ObjectiveContextWindowData,
1009
- type ObjectiveData as ObjectiveData,
1010
- type ObjectiveDataSecret as ObjectiveDataSecret,
1011
1062
  type ObjectiveError as ObjectiveError,
1012
1063
  type ObjectiveEventData as ObjectiveEventData,
1013
1064
  type ObjectiveEventInfo as ObjectiveEventInfo,
1014
1065
  type ObjectiveEventWebhookData as ObjectiveEventWebhookData,
1015
1066
  type ObjectiveInfo as ObjectiveInfo,
1016
- type ObjectiveStatus as ObjectiveStatus,
1067
+ type ObjectiveSecret as ObjectiveSecret,
1017
1068
  type SubAgentSpawned as SubAgentSpawned,
1018
1069
  type SubAgentUpdated as SubAgentUpdated,
1019
1070
  type ToolApprovalRequested as ToolApprovalRequested,
@@ -36,8 +36,8 @@ export class ToolCalls extends APIResource {
36
36
  options?: RequestOptions,
37
37
  ): APIPromise<ObjectiveToolCall> {
38
38
  const { workspaceId, objectiveId, ...body } = params;
39
- return this._client.put(
40
- path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}/approve`,
39
+ return this._client.post(
40
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}:approve`,
41
41
  { body, ...options },
42
42
  );
43
43
  }
@@ -53,8 +53,8 @@ export class ToolCalls extends APIResource {
53
53
  options?: RequestOptions,
54
54
  ): APIPromise<ObjectiveToolCall> {
55
55
  const { workspaceId, objectiveId, ...body } = params;
56
- return this._client.put(
57
- path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}/deny`,
56
+ return this._client.post(
57
+ path`/v1/workspaces/${workspaceId}/objectives/${objectiveId}/tool_calls/${toolCallID}:deny`,
58
58
  { body, ...options },
59
59
  );
60
60
  }
@@ -70,6 +70,13 @@ export type ObjectiveToolCallsCursorPagination = CursorPagination<ObjectiveToolC
70
70
  export interface ObjectiveToolCall {
71
71
  data: ObjectiveToolCallData;
72
72
 
73
+ executionStatus:
74
+ | 'TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED'
75
+ | 'TOOL_CALL_EXECUTION_STATUS_PENDING'
76
+ | 'TOOL_CALL_EXECUTION_STATUS_RUNNING'
77
+ | 'TOOL_CALL_EXECUTION_STATUS_COMPLETED'
78
+ | 'TOOL_CALL_EXECUTION_STATUS_ERRORED';
79
+
73
80
  /**
74
81
  * Metadata for ephemeral operations and activities (e.g., objectives, executions,
75
82
  * runs)
@@ -86,13 +93,6 @@ export interface ObjectiveToolCall {
86
93
  | 'TOOL_CALL_STATUS_APPROVED'
87
94
  | 'TOOL_CALL_STATUS_DENIED';
88
95
 
89
- executionStatus?:
90
- | 'TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED'
91
- | 'TOOL_CALL_EXECUTION_STATUS_PENDING'
92
- | 'TOOL_CALL_EXECUTION_STATUS_RUNNING'
93
- | 'TOOL_CALL_EXECUTION_STATUS_COMPLETED'
94
- | 'TOOL_CALL_EXECUTION_STATUS_ERRORED';
95
-
96
96
  info?: ObjectiveToolCallInfo;
97
97
  }
98
98
 
@@ -197,6 +197,11 @@ export interface ResourceMetadata {
197
197
  * {"environment": "production", "team": "platform", "version": "v2"}
198
198
  */
199
199
  labels?: { [key: string]: string };
200
+
201
+ /**
202
+ * Timestamp when this resource was last updated
203
+ */
204
+ updatedAt?: string;
200
205
  }
201
206
 
202
207
  /**
@@ -24,8 +24,10 @@ export {
24
24
  type ToolSetUpdateParams,
25
25
  type ToolSetListParams,
26
26
  type ToolSetDeleteParams,
27
+ type ToolSetArchiveParams,
27
28
  type ToolSetGetOpenAPISpecParams,
28
29
  type ToolSetListEventsParams,
30
+ type ToolSetUnarchiveParams,
29
31
  type ToolSetsCursorPagination,
30
32
  type ToolSetEventsCursorPagination,
31
33
  } from './tool-sets';
@@ -43,5 +45,7 @@ export {
43
45
  type ToolUpdateParams,
44
46
  type ToolListParams,
45
47
  type ToolDeleteParams,
48
+ type ToolOmitParams,
49
+ type ToolRestoreParams,
46
50
  type ToolsCursorPagination,
47
51
  } from './tools';
@@ -13,6 +13,8 @@ import {
13
13
  ToolDeleteParams,
14
14
  ToolInfo,
15
15
  ToolListParams,
16
+ ToolOmitParams,
17
+ ToolRestoreParams,
16
18
  ToolRetrieveParams,
17
19
  ToolSpec,
18
20
  ToolSpecConfig,
@@ -56,7 +58,7 @@ export class ToolSets extends APIResource {
56
58
  */
57
59
  update(id: string, params: ToolSetUpdateParams, options?: RequestOptions): APIPromise<ToolSet> {
58
60
  const { workspaceId, ...body } = params;
59
- return this._client.put(path`/v1/workspaces/${workspaceId}/tool_sets/${id}`, { body, ...options });
61
+ return this._client.patch(path`/v1/workspaces/${workspaceId}/tool_sets/${id}`, { body, ...options });
60
62
  }
61
63
 
62
64
  /**
@@ -84,6 +86,21 @@ export class ToolSets extends APIResource {
84
86
  });
85
87
  }
86
88
 
89
+ /**
90
+ * Transitions a tool set to STATE_ARCHIVED. Syncing stops, the tool set is hidden
91
+ * from list results, its tools are no longer offered to objectives, and new
92
+ * variation assignments are rejected. Existing assignments are retained, and
93
+ * history is preserved — unlike delete, archiving works while the tool set is
94
+ * still assigned to agent variations.
95
+ */
96
+ archive(id: string, params: ToolSetArchiveParams, options?: RequestOptions): APIPromise<ToolSet> {
97
+ const { workspaceId, ...body } = params;
98
+ return this._client.post(path`/v1/workspaces/${workspaceId}/tool_sets/${id}:archive`, {
99
+ body,
100
+ ...options,
101
+ });
102
+ }
103
+
87
104
  /**
88
105
  * Retrieves the current OpenAPI specification JSON that has been consumed by the
89
106
  * tool set. Only applicable to tool sets using the OpenAPI adapter.
@@ -112,6 +129,19 @@ export class ToolSets extends APIResource {
112
129
  { query, ...options },
113
130
  );
114
131
  }
132
+
133
+ /**
134
+ * Transitions an archived tool set back to STATE_ACTIVE. Managed tool sets resume
135
+ * syncing on their next cycle and their tools become available to objectives
136
+ * again.
137
+ */
138
+ unarchive(id: string, params: ToolSetUnarchiveParams, options?: RequestOptions): APIPromise<ToolSet> {
139
+ const { workspaceId, ...body } = params;
140
+ return this._client.post(path`/v1/workspaces/${workspaceId}/tool_sets/${id}:unarchive`, {
141
+ body,
142
+ ...options,
143
+ });
144
+ }
115
145
  }
116
146
 
117
147
  export type ToolSetsCursorPagination = CursorPagination<ToolSet>;
@@ -222,6 +252,13 @@ export interface ToolSet {
222
252
 
223
253
  spec: ToolSetSpec;
224
254
 
255
+ /**
256
+ * The current lifecycle state of the tool set. Output only. Tool sets are created
257
+ * STATE_ACTIVE; use the :archive and :unarchive actions to transition between
258
+ * states.
259
+ */
260
+ state: 'STATE_UNSPECIFIED' | 'STATE_ACTIVE' | 'STATE_ARCHIVED';
261
+
225
262
  /**
226
263
  * Tool set information
227
264
  */
@@ -470,6 +507,12 @@ export interface ToolSetListParams extends CursorPaginationParams {
470
507
  * Sort order for results (asc or desc by creation time)
471
508
  */
472
509
  sortOrder?: string;
510
+
511
+ /**
512
+ * Filter by tool set lifecycle state. Defaults to STATE_ACTIVE when unspecified;
513
+ * pass STATE_ARCHIVED to list archived tool sets.
514
+ */
515
+ state?: 'STATE_UNSPECIFIED' | 'STATE_ACTIVE' | 'STATE_ARCHIVED';
473
516
  }
474
517
 
475
518
  export interface ToolSetDeleteParams {
@@ -479,6 +522,13 @@ export interface ToolSetDeleteParams {
479
522
  workspaceId: string;
480
523
  }
481
524
 
525
+ export interface ToolSetArchiveParams {
526
+ /**
527
+ * Workspace ID.
528
+ */
529
+ workspaceId: string;
530
+ }
531
+
482
532
  export interface ToolSetGetOpenAPISpecParams {
483
533
  /**
484
534
  * Workspace ID.
@@ -503,6 +553,13 @@ export interface ToolSetListEventsParams extends CursorPaginationParams {
503
553
  sortOrder?: string;
504
554
  }
505
555
 
556
+ export interface ToolSetUnarchiveParams {
557
+ /**
558
+ * Workspace ID.
559
+ */
560
+ workspaceId: string;
561
+ }
562
+
506
563
  ToolSets.Tools = Tools;
507
564
 
508
565
  export declare namespace ToolSets {
@@ -531,8 +588,10 @@ export declare namespace ToolSets {
531
588
  type ToolSetUpdateParams as ToolSetUpdateParams,
532
589
  type ToolSetListParams as ToolSetListParams,
533
590
  type ToolSetDeleteParams as ToolSetDeleteParams,
591
+ type ToolSetArchiveParams as ToolSetArchiveParams,
534
592
  type ToolSetGetOpenAPISpecParams as ToolSetGetOpenAPISpecParams,
535
593
  type ToolSetListEventsParams as ToolSetListEventsParams,
594
+ type ToolSetUnarchiveParams as ToolSetUnarchiveParams,
536
595
  };
537
596
 
538
597
  export {
@@ -550,5 +609,7 @@ export declare namespace ToolSets {
550
609
  type ToolUpdateParams as ToolUpdateParams,
551
610
  type ToolListParams as ToolListParams,
552
611
  type ToolDeleteParams as ToolDeleteParams,
612
+ type ToolOmitParams as ToolOmitParams,
613
+ type ToolRestoreParams as ToolRestoreParams,
553
614
  };
554
615
  }