@cadenya/cadenya 0.84.0 → 0.86.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 (125) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +8 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/account.js +1 -1
  10. package/resources/account.js.map +1 -1
  11. package/resources/account.mjs +1 -1
  12. package/resources/account.mjs.map +1 -1
  13. package/resources/agents/agents.d.mts +55 -9
  14. package/resources/agents/agents.d.mts.map +1 -1
  15. package/resources/agents/agents.d.ts +55 -9
  16. package/resources/agents/agents.d.ts.map +1 -1
  17. package/resources/agents/agents.js +38 -0
  18. package/resources/agents/agents.js.map +1 -1
  19. package/resources/agents/agents.mjs +38 -0
  20. package/resources/agents/agents.mjs.map +1 -1
  21. package/resources/agents/index.d.mts +2 -2
  22. package/resources/agents/index.d.mts.map +1 -1
  23. package/resources/agents/index.d.ts +2 -2
  24. package/resources/agents/index.d.ts.map +1 -1
  25. package/resources/agents/index.js.map +1 -1
  26. package/resources/agents/index.mjs.map +1 -1
  27. package/resources/agents/schedules.d.mts +67 -9
  28. package/resources/agents/schedules.d.mts.map +1 -1
  29. package/resources/agents/schedules.d.ts +67 -9
  30. package/resources/agents/schedules.d.ts.map +1 -1
  31. package/resources/agents/schedules.js +34 -0
  32. package/resources/agents/schedules.js.map +1 -1
  33. package/resources/agents/schedules.mjs +34 -0
  34. package/resources/agents/schedules.mjs.map +1 -1
  35. package/resources/agents/variations.d.mts +11 -2
  36. package/resources/agents/variations.d.mts.map +1 -1
  37. package/resources/agents/variations.d.ts +11 -2
  38. package/resources/agents/variations.d.ts.map +1 -1
  39. package/resources/api-keys/api-keys.d.mts +4 -2
  40. package/resources/api-keys/api-keys.d.mts.map +1 -1
  41. package/resources/api-keys/api-keys.d.ts +4 -2
  42. package/resources/api-keys/api-keys.d.ts.map +1 -1
  43. package/resources/api-keys/api-keys.js +2 -2
  44. package/resources/api-keys/api-keys.js.map +1 -1
  45. package/resources/api-keys/api-keys.mjs +2 -2
  46. package/resources/api-keys/api-keys.mjs.map +1 -1
  47. package/resources/api-keys/index.d.mts +1 -1
  48. package/resources/api-keys/index.d.mts.map +1 -1
  49. package/resources/api-keys/index.d.ts +1 -1
  50. package/resources/api-keys/index.d.ts.map +1 -1
  51. package/resources/api-keys/index.js.map +1 -1
  52. package/resources/api-keys/index.mjs.map +1 -1
  53. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts +23 -7
  54. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts.map +1 -1
  55. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts +23 -7
  56. package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts.map +1 -1
  57. package/resources/bulk-workspace-resources/bulk-workspace-resources.js.map +1 -1
  58. package/resources/bulk-workspace-resources/bulk-workspace-resources.mjs.map +1 -1
  59. package/resources/index.d.mts +4 -4
  60. package/resources/index.d.mts.map +1 -1
  61. package/resources/index.d.ts +4 -4
  62. package/resources/index.d.ts.map +1 -1
  63. package/resources/index.js.map +1 -1
  64. package/resources/index.mjs.map +1 -1
  65. package/resources/models.d.mts +22 -13
  66. package/resources/models.d.mts.map +1 -1
  67. package/resources/models.d.ts +22 -13
  68. package/resources/models.d.ts.map +1 -1
  69. package/resources/models.js +12 -3
  70. package/resources/models.js.map +1 -1
  71. package/resources/models.mjs +12 -3
  72. package/resources/models.mjs.map +1 -1
  73. package/resources/objectives/objectives.d.mts +19 -3
  74. package/resources/objectives/objectives.d.mts.map +1 -1
  75. package/resources/objectives/objectives.d.ts +19 -3
  76. package/resources/objectives/objectives.d.ts.map +1 -1
  77. package/resources/objectives/objectives.js.map +1 -1
  78. package/resources/objectives/objectives.mjs.map +1 -1
  79. package/resources/shared.d.mts +4 -0
  80. package/resources/shared.d.mts.map +1 -1
  81. package/resources/shared.d.ts +4 -0
  82. package/resources/shared.d.ts.map +1 -1
  83. package/resources/tool-sets/index.d.mts +2 -2
  84. package/resources/tool-sets/index.d.mts.map +1 -1
  85. package/resources/tool-sets/index.d.ts +2 -2
  86. package/resources/tool-sets/index.d.ts.map +1 -1
  87. package/resources/tool-sets/index.js.map +1 -1
  88. package/resources/tool-sets/index.mjs.map +1 -1
  89. package/resources/tool-sets/tool-sets.d.mts +40 -3
  90. package/resources/tool-sets/tool-sets.d.mts.map +1 -1
  91. package/resources/tool-sets/tool-sets.d.ts +40 -3
  92. package/resources/tool-sets/tool-sets.d.ts.map +1 -1
  93. package/resources/tool-sets/tool-sets.js +27 -1
  94. package/resources/tool-sets/tool-sets.js.map +1 -1
  95. package/resources/tool-sets/tool-sets.mjs +27 -1
  96. package/resources/tool-sets/tool-sets.mjs.map +1 -1
  97. package/resources/tool-sets/tools.d.mts +39 -5
  98. package/resources/tool-sets/tools.d.mts.map +1 -1
  99. package/resources/tool-sets/tools.d.ts +39 -5
  100. package/resources/tool-sets/tools.d.ts.map +1 -1
  101. package/resources/tool-sets/tools.js +23 -1
  102. package/resources/tool-sets/tools.js.map +1 -1
  103. package/resources/tool-sets/tools.mjs +23 -1
  104. package/resources/tool-sets/tools.mjs.map +1 -1
  105. package/src/client.ts +18 -2
  106. package/src/resources/account.ts +1 -1
  107. package/src/resources/agents/agents.ts +89 -15
  108. package/src/resources/agents/index.ts +7 -0
  109. package/src/resources/agents/schedules.ts +98 -13
  110. package/src/resources/agents/variations.ts +12 -2
  111. package/src/resources/api-keys/api-keys.ts +5 -2
  112. package/src/resources/api-keys/index.ts +1 -0
  113. package/src/resources/bulk-workspace-resources/bulk-workspace-resources.ts +26 -7
  114. package/src/resources/index.ts +9 -1
  115. package/src/resources/models.ts +29 -15
  116. package/src/resources/objectives/objectives.ts +17 -3
  117. package/src/resources/shared.ts +5 -0
  118. package/src/resources/tool-sets/index.ts +4 -0
  119. package/src/resources/tool-sets/tool-sets.ts +62 -1
  120. package/src/resources/tool-sets/tools.ts +60 -12
  121. package/src/version.ts +1 -1
  122. package/version.d.mts +1 -1
  123. package/version.d.ts +1 -1
  124. package/version.js +1 -1
  125. package/version.mjs +1 -1
@@ -11,6 +11,10 @@ export {
11
11
  type AgentUpdateParams,
12
12
  type AgentListParams,
13
13
  type AgentDeleteParams,
14
+ type AgentArchiveParams,
15
+ type AgentPublishParams,
16
+ type AgentUnarchiveParams,
17
+ type AgentUnpublishParams,
14
18
  type AgentsCursorPagination,
15
19
  } from './agents';
16
20
  export { Feedback, type FeedbackListParams } from './feedback';
@@ -28,6 +32,9 @@ export {
28
32
  type ScheduleUpdateParams,
29
33
  type ScheduleListParams,
30
34
  type ScheduleDeleteParams,
35
+ type ScheduleArchiveParams,
36
+ type SchedulePauseParams,
37
+ type ScheduleResumeParams,
31
38
  type AgentSchedulesCursorPagination,
32
39
  } from './schedules';
33
40
  export {
@@ -70,6 +70,43 @@ export class Schedules extends APIResource {
70
70
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
71
71
  });
72
72
  }
73
+
74
+ /**
75
+ * Transitions a schedule to STATE_ARCHIVED and removes its underlying timer.
76
+ * Archiving is terminal: archived schedules never fire and cannot be reactivated;
77
+ * create a new schedule instead.
78
+ */
79
+ archive(id: string, params: ScheduleArchiveParams, options?: RequestOptions): APIPromise<AgentSchedule> {
80
+ const { workspaceId, agentId, ...body } = params;
81
+ return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${agentId}/schedules/${id}:archive`, {
82
+ body,
83
+ ...options,
84
+ });
85
+ }
86
+
87
+ /**
88
+ * Transitions a schedule to STATE_PAUSED. Paused schedules retain history but do
89
+ * not fire.
90
+ */
91
+ pause(id: string, params: SchedulePauseParams, options?: RequestOptions): APIPromise<AgentSchedule> {
92
+ const { workspaceId, agentId, ...body } = params;
93
+ return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${agentId}/schedules/${id}:pause`, {
94
+ body,
95
+ ...options,
96
+ });
97
+ }
98
+
99
+ /**
100
+ * Transitions a paused schedule back to STATE_ACTIVE so it fires on its cadence
101
+ * again. Archived schedules cannot be resumed.
102
+ */
103
+ resume(id: string, params: ScheduleResumeParams, options?: RequestOptions): APIPromise<AgentSchedule> {
104
+ const { workspaceId, agentId, ...body } = params;
105
+ return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${agentId}/schedules/${id}:resume`, {
106
+ body,
107
+ ...options,
108
+ });
109
+ }
73
110
  }
74
111
 
75
112
  export type AgentSchedulesCursorPagination = CursorPagination<AgentSchedule>;
@@ -89,6 +126,13 @@ export interface AgentSchedule {
89
126
  */
90
127
  spec: AgentScheduleSpec;
91
128
 
129
+ /**
130
+ * The current lifecycle state of the schedule. Output only. Schedules are created
131
+ * STATE_ACTIVE; use the :pause, :resume, and :archive actions to transition
132
+ * between states.
133
+ */
134
+ state: 'STATE_UNSPECIFIED' | 'STATE_ACTIVE' | 'STATE_PAUSED' | 'STATE_ARCHIVED';
135
+
92
136
  /**
93
137
  * AgentScheduleInfo provides read-only runtime data about a schedule.
94
138
  */
@@ -128,7 +172,7 @@ export interface AgentScheduleInfo {
128
172
 
129
173
  /**
130
174
  * When the schedule will next fire. Computed from the spec; absent when the
131
- * schedule is PAUSED/ARCHIVED or has no future fire times.
175
+ * schedule is STATE_PAUSED/STATE_ARCHIVED or has no future fire times.
132
176
  */
133
177
  nextFireAt?: string;
134
178
 
@@ -142,12 +186,6 @@ export interface AgentScheduleInfo {
142
186
  * AgentScheduleSpec is the user-provided configuration for a schedule.
143
187
  */
144
188
  export interface AgentScheduleSpec {
145
- /**
146
- * The initial message passed to CreateObjective on each fire. Becomes the first
147
- * user message in the objective's chat history.
148
- */
149
- initialMessage: string;
150
-
151
189
  /**
152
190
  * Schedule defines WHEN the schedule fires. Temporal-style structured form: a list
153
191
  * of calendar rules (wall-clock) and/or interval rules (duration), OR'd together.
@@ -161,19 +199,24 @@ export interface AgentScheduleSpec {
161
199
  */
162
200
  data?: unknown;
163
201
 
202
+ /**
203
+ * Optional initial message passed to CreateObjective on each fire. Becomes the
204
+ * first user message in the objective's chat history. When unset, the fired
205
+ * objective defers to the selected variation's user_message_template.
206
+ */
207
+ initialMessage?: string;
208
+
164
209
  /**
165
210
  * What to do when the previous run is still in flight. Defaults to SKIP.
166
211
  */
167
212
  overlapPolicy?: 'OVERLAP_POLICY_UNSPECIFIED' | 'OVERLAP_POLICY_ALLOW' | 'OVERLAP_POLICY_SKIP';
168
213
 
169
214
  /**
170
- * Lifecycle. Defaults to ACTIVE on create when unspecified.
215
+ * Optional data rendered into the variation's user_message_template when each
216
+ * fired objective is created. Separate from `data`, which renders the system
217
+ * prompt template.
171
218
  */
172
- status?:
173
- | 'AGENT_SCHEDULE_STATUS_UNSPECIFIED'
174
- | 'AGENT_SCHEDULE_STATUS_ACTIVE'
175
- | 'AGENT_SCHEDULE_STATUS_PAUSED'
176
- | 'AGENT_SCHEDULE_STATUS_ARCHIVED';
219
+ userData?: unknown;
177
220
 
178
221
  /**
179
222
  * Optional explicit variation. When unset, the agent's variation_selection_mode
@@ -364,6 +407,45 @@ export interface ScheduleDeleteParams {
364
407
  agentId: string;
365
408
  }
366
409
 
410
+ export interface ScheduleArchiveParams {
411
+ /**
412
+ * Workspace ID.
413
+ */
414
+ workspaceId: string;
415
+
416
+ /**
417
+ * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
418
+ * form.
419
+ */
420
+ agentId: string;
421
+ }
422
+
423
+ export interface SchedulePauseParams {
424
+ /**
425
+ * Workspace ID.
426
+ */
427
+ workspaceId: string;
428
+
429
+ /**
430
+ * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
431
+ * form.
432
+ */
433
+ agentId: string;
434
+ }
435
+
436
+ export interface ScheduleResumeParams {
437
+ /**
438
+ * Workspace ID.
439
+ */
440
+ workspaceId: string;
441
+
442
+ /**
443
+ * Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
444
+ * form.
445
+ */
446
+ agentId: string;
447
+ }
448
+
367
449
  export declare namespace Schedules {
368
450
  export {
369
451
  type AgentSchedule as AgentSchedule,
@@ -379,5 +461,8 @@ export declare namespace Schedules {
379
461
  type ScheduleUpdateParams as ScheduleUpdateParams,
380
462
  type ScheduleListParams as ScheduleListParams,
381
463
  type ScheduleDeleteParams as ScheduleDeleteParams,
464
+ type ScheduleArchiveParams as ScheduleArchiveParams,
465
+ type SchedulePauseParams as SchedulePauseParams,
466
+ type ScheduleResumeParams as ScheduleResumeParams,
382
467
  };
383
468
  }
@@ -291,9 +291,19 @@ export interface AgentVariationSpec {
291
291
  progressiveDiscovery?: AgentVariationSpecProgressiveDiscovery;
292
292
 
293
293
  /**
294
- * The system prompt for this variation
294
+ * Liquid template for the system prompt of objectives using this variation.
295
+ * Rendered with CreateObjectiveRequest.data into Objective.system_prompt.
295
296
  */
296
- prompt?: string;
297
+ systemPromptTemplate?: string;
298
+
299
+ /**
300
+ * Liquid template for the initial user message of objectives using this variation.
301
+ * Rendered with CreateObjectiveRequest.user_data and becomes the first user
302
+ * message in the LLM chat history. CreateObjectiveRequest.initial_message, when
303
+ * set, overrides the rendered result. If neither this template nor initial_message
304
+ * is present, objective creation is rejected with InvalidArgument.
305
+ */
306
+ userMessageTemplate?: string;
297
307
 
298
308
  /**
299
309
  * Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
@@ -64,8 +64,8 @@ export class APIKeys extends APIResource {
64
64
  * Rotates an API key and returns a new token. All previous tokens for this key are
65
65
  * invalidated.
66
66
  */
67
- rotate(id: string, options?: RequestOptions): APIPromise<APIKey> {
68
- return this._client.put(path`/v1/account/api_keys/${id}/rotate`, options);
67
+ rotate(id: string, body: APIKeyRotateParams, options?: RequestOptions): APIPromise<APIKey> {
68
+ return this._client.post(path`/v1/account/api_keys/${id}:rotate`, { body, ...options });
69
69
  }
70
70
  }
71
71
 
@@ -260,6 +260,8 @@ export interface APIKeyListParams extends CursorPaginationParams {
260
260
  sortOrder?: string;
261
261
  }
262
262
 
263
+ export interface APIKeyRotateParams {}
264
+
263
265
  APIKeys.Access = Access;
264
266
 
265
267
  export declare namespace APIKeys {
@@ -271,6 +273,7 @@ export declare namespace APIKeys {
271
273
  type APIKeyCreateParams as APIKeyCreateParams,
272
274
  type APIKeyUpdateParams as APIKeyUpdateParams,
273
275
  type APIKeyListParams as APIKeyListParams,
276
+ type APIKeyRotateParams as APIKeyRotateParams,
274
277
  };
275
278
 
276
279
  export {
@@ -8,6 +8,7 @@ export {
8
8
  type APIKeyCreateParams,
9
9
  type APIKeyUpdateParams,
10
10
  type APIKeyListParams,
11
+ type APIKeyRotateParams,
11
12
  type APIKeysCursorPagination,
12
13
  } from './api-keys';
13
14
  export { Access, type AccessListParams, type AccessAddParams, type AccessRemoveParams } from './access';
@@ -99,6 +99,13 @@ export interface AgentEntry {
99
99
  */
100
100
  schedules?: { [key: string]: AgentScheduleEntry };
101
101
 
102
+ /**
103
+ * Desired lifecycle state for the agent. Defaults to STATE_DRAFT when unspecified.
104
+ * STATE_PUBLISHED publishes the agent once its variations exist; see also
105
+ * BulkWorkspaceApplyData.automatically_publish_agents.
106
+ */
107
+ state?: 'STATE_UNSPECIFIED' | 'STATE_DRAFT' | 'STATE_PUBLISHED' | 'STATE_ARCHIVED';
108
+
102
109
  /**
103
110
  * Variations under this agent, keyed by external_id.
104
111
  */
@@ -114,6 +121,13 @@ export interface AgentScheduleEntry {
114
121
  spec: SchedulesAPI.AgentScheduleSpec;
115
122
 
116
123
  labels?: { [key: string]: string };
124
+
125
+ /**
126
+ * Desired lifecycle state for the schedule. Defaults to STATE_ACTIVE when
127
+ * unspecified. Declare STATE_PAUSED to provision a schedule without it firing.
128
+ * STATE_ARCHIVED is rejected here.
129
+ */
130
+ state?: 'STATE_UNSPECIFIED' | 'STATE_ACTIVE' | 'STATE_PAUSED' | 'STATE_ARCHIVED';
117
131
  }
118
132
 
119
133
  export interface AgentVariationEntry {
@@ -172,14 +186,13 @@ export interface BulkWorkspaceApplyData {
172
186
  agents?: { [key: string]: AgentEntry };
173
187
 
174
188
  /**
175
- * When true, every agent created or updated by this Apply has its status forced to
176
- * AGENT_STATUS_PUBLISHED, regardless of the status declared in the agent's
177
- * AgentSpec. Useful when the bundle represents a production configuration and you
178
- * want all of its agents live without setting status: AGENT_STATUS_PUBLISHED on
179
- * each entry.
189
+ * When true, every agent created or updated by this Apply has its state forced to
190
+ * STATE_PUBLISHED, regardless of the state declared on the agent's entry. Useful
191
+ * when the bundle represents a production configuration and you want all of its
192
+ * agents live without setting state: STATE_PUBLISHED on each entry.
180
193
  *
181
- * Default false: each agent's AgentSpec.status controls (which is
182
- * AGENT_STATUS_DRAFT on create when unspecified).
194
+ * Default false: each agent entry's `state` controls (which is STATE_DRAFT on
195
+ * create when unspecified).
183
196
  */
184
197
  automaticallyPublishAgents?: boolean;
185
198
 
@@ -327,6 +340,12 @@ export interface ToolEntry {
327
340
  spec: ToolsAPI.ToolSpec;
328
341
 
329
342
  labels?: { [key: string]: string };
343
+
344
+ /**
345
+ * Desired lifecycle state for the tool. Defaults to STATE_AVAILABLE when
346
+ * unspecified. STATE_ARCHIVED is server-managed and is rejected here.
347
+ */
348
+ state?: 'STATE_UNSPECIFIED' | 'STATE_AVAILABLE' | 'STATE_OMITTED' | 'STATE_ARCHIVED';
330
349
  }
331
350
 
332
351
  export interface ToolSetEntry {
@@ -20,6 +20,7 @@ export {
20
20
  type APIKeyCreateParams,
21
21
  type APIKeyUpdateParams,
22
22
  type APIKeyListParams,
23
+ type APIKeyRotateParams,
23
24
  type APIKeysCursorPagination,
24
25
  } from './api-keys/api-keys';
25
26
  export {
@@ -43,6 +44,10 @@ export {
43
44
  type AgentUpdateParams,
44
45
  type AgentListParams,
45
46
  type AgentDeleteParams,
47
+ type AgentArchiveParams,
48
+ type AgentPublishParams,
49
+ type AgentUnarchiveParams,
50
+ type AgentUnpublishParams,
46
51
  type AgentsCursorPagination,
47
52
  } from './agents/agents';
48
53
  export {
@@ -84,7 +89,8 @@ export {
84
89
  type ModelSwapResponse,
85
90
  type ModelRetrieveParams,
86
91
  type ModelListParams,
87
- type ModelSetStatusParams,
92
+ type ModelDisableParams,
93
+ type ModelEnableParams,
88
94
  type ModelSwapParams,
89
95
  type ModelsCursorPagination,
90
96
  } from './models';
@@ -159,8 +165,10 @@ export {
159
165
  type ToolSetUpdateParams,
160
166
  type ToolSetListParams,
161
167
  type ToolSetDeleteParams,
168
+ type ToolSetArchiveParams,
162
169
  type ToolSetGetOpenAPISpecParams,
163
170
  type ToolSetListEventsParams,
171
+ type ToolSetUnarchiveParams,
164
172
  type ToolSetsCursorPagination,
165
173
  type ToolSetEventsCursorPagination,
166
174
  } from './tool-sets/tool-sets';
@@ -36,11 +36,21 @@ export class Models extends APIResource {
36
36
  }
37
37
 
38
38
  /**
39
- * Enables or disables a model in the workspace
39
+ * Transitions a model to STATE_DISABLED. Fails while agent variations are still
40
+ * provisioned on the model; use :swapModelOnVariations to move them first.
40
41
  */
41
- setStatus(id: string, params: ModelSetStatusParams, options?: RequestOptions): APIPromise<Model> {
42
+ disable(id: string, params: ModelDisableParams, options?: RequestOptions): APIPromise<Model> {
42
43
  const { workspaceId, ...body } = params;
43
- return this._client.put(path`/v1/workspaces/${workspaceId}/models/${id}/status`, { body, ...options });
44
+ return this._client.post(path`/v1/workspaces/${workspaceId}/models/${id}:disable`, { body, ...options });
45
+ }
46
+
47
+ /**
48
+ * Transitions a model to STATE_ENABLED, making it available for agent variations
49
+ * in the workspace
50
+ */
51
+ enable(id: string, params: ModelEnableParams, options?: RequestOptions): APIPromise<Model> {
52
+ const { workspaceId, ...body } = params;
53
+ return this._client.post(path`/v1/workspaces/${workspaceId}/models/${id}:enable`, { body, ...options });
44
54
  }
45
55
 
46
56
  /**
@@ -68,6 +78,12 @@ export interface Model {
68
78
  */
69
79
  spec: ModelSpec;
70
80
 
81
+ /**
82
+ * Whether the model is usable in this workspace. Output only. Use the :enable and
83
+ * :disable actions to transition.
84
+ */
85
+ state: 'STATE_UNSPECIFIED' | 'STATE_ENABLED' | 'STATE_DISABLED';
86
+
71
87
  /**
72
88
  * ModelInfo carries server-derived, read-only details about a model.
73
89
  */
@@ -127,11 +143,6 @@ export interface ModelSpec {
127
143
  * The model provider (e.g., "anthropic", "openai", "google")
128
144
  */
129
145
  provider?: string;
130
-
131
- /**
132
- * The status of the model in the workspace
133
- */
134
- status?: 'MODEL_STATUS_UNSPECIFIED' | 'MODEL_STATUS_ENABLED' | 'MODEL_STATUS_DISABLED';
135
146
  }
136
147
 
137
148
  /**
@@ -181,21 +192,23 @@ export interface ModelListParams extends CursorPaginationParams {
181
192
  sortOrder?: string;
182
193
 
183
194
  /**
184
- * Filter by model status
195
+ * Filter by model state
185
196
  */
186
- status?: 'MODEL_STATUS_UNSPECIFIED' | 'MODEL_STATUS_ENABLED' | 'MODEL_STATUS_DISABLED';
197
+ state?: 'STATE_UNSPECIFIED' | 'STATE_ENABLED' | 'STATE_DISABLED';
187
198
  }
188
199
 
189
- export interface ModelSetStatusParams {
200
+ export interface ModelDisableParams {
190
201
  /**
191
- * Path param: Workspace ID.
202
+ * Workspace ID.
192
203
  */
193
204
  workspaceId: string;
205
+ }
194
206
 
207
+ export interface ModelEnableParams {
195
208
  /**
196
- * Body param: The new status for the model
209
+ * Workspace ID.
197
210
  */
198
- status?: 'MODEL_STATUS_UNSPECIFIED' | 'MODEL_STATUS_ENABLED' | 'MODEL_STATUS_DISABLED';
211
+ workspaceId: string;
199
212
  }
200
213
 
201
214
  export interface ModelSwapParams {
@@ -227,7 +240,8 @@ export declare namespace Models {
227
240
  type ModelsCursorPagination as ModelsCursorPagination,
228
241
  type ModelRetrieveParams as ModelRetrieveParams,
229
242
  type ModelListParams as ModelListParams,
230
- type ModelSetStatusParams as ModelSetStatusParams,
243
+ type ModelDisableParams as ModelDisableParams,
244
+ type ModelEnableParams as ModelEnableParams,
231
245
  type ModelSwapParams as ModelSwapParams,
232
246
  };
233
247
  }
@@ -371,6 +371,11 @@ export interface Objective {
371
371
  * Optional human-readable detail about the current state (e.g. a failure reason).
372
372
  */
373
373
  stateMessage?: string;
374
+
375
+ /**
376
+ * Arbitrary data used to render the variation's user_message_template
377
+ */
378
+ userData?: { [key: string]: unknown };
374
379
  }
375
380
 
376
381
  /**
@@ -845,9 +850,11 @@ export interface ObjectiveCreateParams {
845
850
  data: { [key: string]: unknown };
846
851
 
847
852
  /**
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.
853
+ * Optional override for the initial message sent to the agent. This becomes the
854
+ * first user message in the LLM chat history. When not set, the selected
855
+ * variation's user_message_template is rendered with user_data instead. If neither
856
+ * this field nor a user_message_template is present, the request is rejected with
857
+ * InvalidArgument.
851
858
  */
852
859
  initialMessage?: string;
853
860
 
@@ -883,6 +890,13 @@ export interface ObjectiveCreateParams {
883
890
  */
884
891
  secrets?: Array<ObjectiveCreateParams.Secret>;
885
892
 
893
+ /**
894
+ * Arbitrary data rendered into the selected variation's user_message_template
895
+ * (liquid) to produce the initial user message. Separate from `data`, which
896
+ * renders the system prompt template.
897
+ */
898
+ userData?: { [key: string]: unknown };
899
+
886
900
  /**
887
901
  * Optional explicit variation selection. Overrides the agent's
888
902
  * variation_selection_mode.
@@ -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
  }