@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
@@ -0,0 +1,216 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as Shared from './shared';
5
+ import { APIPromise } from '../core/api-promise';
6
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from '../core/pagination';
7
+ import { buildHeaders } from '../internal/headers';
8
+ import { RequestOptions } from '../internal/request-options';
9
+ import { path } from '../internal/utils/path';
10
+
11
+ export class AIProviderKeys extends APIResource {
12
+ /**
13
+ * Creates a new customer-provided AI provider key in the workspace
14
+ */
15
+ create(
16
+ workspaceID: string,
17
+ body: AIProviderKeyCreateParams,
18
+ options?: RequestOptions,
19
+ ): APIPromise<AIProviderKey> {
20
+ return this._client.post(path`/v1/workspaces/${workspaceID}/ai_provider_keys`, { body, ...options });
21
+ }
22
+
23
+ /**
24
+ * Retrieves an AI provider key by ID from the workspace
25
+ */
26
+ retrieve(
27
+ id: string,
28
+ params: AIProviderKeyRetrieveParams,
29
+ options?: RequestOptions,
30
+ ): APIPromise<AIProviderKey> {
31
+ const { workspaceId } = params;
32
+ return this._client.get(path`/v1/workspaces/${workspaceId}/ai_provider_keys/${id}`, options);
33
+ }
34
+
35
+ /**
36
+ * Updates an AI provider key's name or key value in the workspace
37
+ */
38
+ update(id: string, params: AIProviderKeyUpdateParams, options?: RequestOptions): APIPromise<AIProviderKey> {
39
+ const { workspaceId, ...body } = params;
40
+ return this._client.patch(path`/v1/workspaces/${workspaceId}/ai_provider_keys/${id}`, {
41
+ body,
42
+ ...options,
43
+ });
44
+ }
45
+
46
+ /**
47
+ * Lists all customer-provided AI provider keys in the workspace
48
+ */
49
+ list(
50
+ workspaceID: string,
51
+ query: AIProviderKeyListParams | null | undefined = {},
52
+ options?: RequestOptions,
53
+ ): PagePromise<AIProviderKeysCursorPagination, AIProviderKey> {
54
+ return this._client.getAPIList(
55
+ path`/v1/workspaces/${workspaceID}/ai_provider_keys`,
56
+ CursorPagination<AIProviderKey>,
57
+ { query, ...options },
58
+ );
59
+ }
60
+
61
+ /**
62
+ * Deletes an AI provider key from the workspace
63
+ */
64
+ delete(id: string, params: AIProviderKeyDeleteParams, options?: RequestOptions): APIPromise<void> {
65
+ const { workspaceId } = params;
66
+ return this._client.delete(path`/v1/workspaces/${workspaceId}/ai_provider_keys/${id}`, {
67
+ ...options,
68
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
69
+ });
70
+ }
71
+ }
72
+
73
+ export type AIProviderKeysCursorPagination = CursorPagination<AIProviderKey>;
74
+
75
+ /**
76
+ * AIProviderKey is a customer-provided (BYOK) credential for an AI provider,
77
+ * scoped to a workspace. The secret value is never returned in responses.
78
+ */
79
+ export interface AIProviderKey {
80
+ /**
81
+ * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
82
+ */
83
+ metadata: Shared.ResourceMetadata;
84
+
85
+ spec: AIProviderKeySpec;
86
+
87
+ /**
88
+ * AIProviderKeyInfo carries server-derived, read-only details about a key, for AI
89
+ * provider management UIs.
90
+ */
91
+ info?: AIProviderKey.Info;
92
+ }
93
+
94
+ export namespace AIProviderKey {
95
+ /**
96
+ * AIProviderKeyInfo carries server-derived, read-only details about a key, for AI
97
+ * provider management UIs.
98
+ */
99
+ export interface Info {
100
+ /**
101
+ * Number of disabled models provisioned on this key.
102
+ */
103
+ disabledModelCount?: number;
104
+
105
+ /**
106
+ * Number of enabled models provisioned on this key.
107
+ */
108
+ enabledModelCount?: number;
109
+ }
110
+ }
111
+
112
+ export interface AIProviderKeySpec {
113
+ /**
114
+ * The provider credential. Accepted on create/update; never populated in responses
115
+ * (the server returns an empty value to avoid leaking it).
116
+ */
117
+ apiKey?: string;
118
+
119
+ /**
120
+ * OpenRouterConfig holds OpenRouter-specific settings. Empty for now; it exists as
121
+ * the oneof seam so provider-specific options (region, base URL, etc.) can be
122
+ * added later without restructuring the spec.
123
+ */
124
+ openrouter?: unknown;
125
+
126
+ /**
127
+ * The AI provider this key authenticates against.
128
+ */
129
+ provider?: 'AI_PROVIDER_UNSPECIFIED' | 'AI_PROVIDER_OPENROUTER';
130
+ }
131
+
132
+ export interface AIProviderKeyCreateParams {
133
+ /**
134
+ * CreateResourceMetadata contains the user-provided fields for creating a
135
+ * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
136
+ * profile_id, created_at) are excluded since they are set by the server.
137
+ */
138
+ metadata: Shared.CreateResourceMetadata;
139
+
140
+ spec: AIProviderKeySpec;
141
+ }
142
+
143
+ export interface AIProviderKeyRetrieveParams {
144
+ /**
145
+ * The workspace the key belongs to.
146
+ */
147
+ workspaceId: string;
148
+ }
149
+
150
+ export interface AIProviderKeyUpdateParams {
151
+ /**
152
+ * Path param: The workspace the key belongs to.
153
+ */
154
+ workspaceId: string;
155
+
156
+ /**
157
+ * Body param: UpdateResourceMetadata contains the user-provided fields for
158
+ * updating a workspace-scoped resource. Read-only fields (id, account_id,
159
+ * workspace_id, profile_id, created_at) are excluded since they are set by the
160
+ * server.
161
+ */
162
+ metadata?: Shared.UpdateResourceMetadata;
163
+
164
+ /**
165
+ * Body param
166
+ */
167
+ spec?: AIProviderKeySpec;
168
+
169
+ /**
170
+ * Body param: Fields to update.
171
+ */
172
+ updateMask?: string;
173
+ }
174
+
175
+ export interface AIProviderKeyListParams extends CursorPaginationParams {
176
+ /**
177
+ * When true, populate each item's info (model counts), at the cost of extra
178
+ * lookups.
179
+ */
180
+ includeInfo?: boolean;
181
+
182
+ /**
183
+ * Filter expression (query param: prefix)
184
+ */
185
+ prefix?: string;
186
+
187
+ /**
188
+ * Free-form search query
189
+ */
190
+ query?: string;
191
+
192
+ /**
193
+ * Sort order for results (asc or desc by creation time)
194
+ */
195
+ sortOrder?: string;
196
+ }
197
+
198
+ export interface AIProviderKeyDeleteParams {
199
+ /**
200
+ * The workspace the key belongs to.
201
+ */
202
+ workspaceId: string;
203
+ }
204
+
205
+ export declare namespace AIProviderKeys {
206
+ export {
207
+ type AIProviderKey as AIProviderKey,
208
+ type AIProviderKeySpec as AIProviderKeySpec,
209
+ type AIProviderKeysCursorPagination as AIProviderKeysCursorPagination,
210
+ type AIProviderKeyCreateParams as AIProviderKeyCreateParams,
211
+ type AIProviderKeyRetrieveParams as AIProviderKeyRetrieveParams,
212
+ type AIProviderKeyUpdateParams as AIProviderKeyUpdateParams,
213
+ type AIProviderKeyListParams as AIProviderKeyListParams,
214
+ type AIProviderKeyDeleteParams as AIProviderKeyDeleteParams,
215
+ };
216
+ }
@@ -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 {
@@ -1,6 +1,17 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  export * from './shared';
4
+ export {
5
+ AIProviderKeys,
6
+ type AIProviderKey,
7
+ type AIProviderKeySpec,
8
+ type AIProviderKeyCreateParams,
9
+ type AIProviderKeyRetrieveParams,
10
+ type AIProviderKeyUpdateParams,
11
+ type AIProviderKeyListParams,
12
+ type AIProviderKeyDeleteParams,
13
+ type AIProviderKeysCursorPagination,
14
+ } from './ai-provider-keys';
4
15
  export {
5
16
  APIKeys,
6
17
  type APIKey,
@@ -9,6 +20,7 @@ export {
9
20
  type APIKeyCreateParams,
10
21
  type APIKeyUpdateParams,
11
22
  type APIKeyListParams,
23
+ type APIKeyRotateParams,
12
24
  type APIKeysCursorPagination,
13
25
  } from './api-keys/api-keys';
14
26
  export {
@@ -32,6 +44,10 @@ export {
32
44
  type AgentUpdateParams,
33
45
  type AgentListParams,
34
46
  type AgentDeleteParams,
47
+ type AgentArchiveParams,
48
+ type AgentPublishParams,
49
+ type AgentUnarchiveParams,
50
+ type AgentUnpublishParams,
35
51
  type AgentsCursorPagination,
36
52
  } from './agents/agents';
37
53
  export {
@@ -70,9 +86,12 @@ export {
70
86
  Models,
71
87
  type Model,
72
88
  type ModelSpec,
89
+ type ModelSwapResponse,
73
90
  type ModelRetrieveParams,
74
91
  type ModelListParams,
75
- type ModelSetStatusParams,
92
+ type ModelDisableParams,
93
+ type ModelEnableParams,
94
+ type ModelSwapParams,
76
95
  type ModelsCursorPagination,
77
96
  } from './models';
78
97
  export {
@@ -84,16 +103,15 @@ export {
84
103
  type MemoryRead,
85
104
  type MemoryReference,
86
105
  type Objective,
106
+ type ObjectiveConfigSnapshot,
87
107
  type ObjectiveContextWindow,
88
108
  type ObjectiveContextWindowData,
89
- type ObjectiveData,
90
- type ObjectiveDataSecret,
91
109
  type ObjectiveError,
92
110
  type ObjectiveEventData,
93
111
  type ObjectiveEventInfo,
94
112
  type ObjectiveEventWebhookData,
95
113
  type ObjectiveInfo,
96
- type ObjectiveStatus,
114
+ type ObjectiveSecret,
97
115
  type SubAgentSpawned,
98
116
  type SubAgentUpdated,
99
117
  type ToolApprovalRequested,
@@ -147,8 +165,10 @@ export {
147
165
  type ToolSetUpdateParams,
148
166
  type ToolSetListParams,
149
167
  type ToolSetDeleteParams,
168
+ type ToolSetArchiveParams,
150
169
  type ToolSetGetOpenAPISpecParams,
151
170
  type ToolSetListEventsParams,
171
+ type ToolSetUnarchiveParams,
152
172
  type ToolSetsCursorPagination,
153
173
  type ToolSetEventsCursorPagination,
154
174
  } from './tool-sets/tool-sets';
@@ -165,6 +185,7 @@ export {
165
185
  WorkspaceAdmin,
166
186
  type WorkspaceMember,
167
187
  type WorkspaceAdminCreateParams,
188
+ type WorkspaceAdminUpdateParams,
168
189
  type WorkspaceAdminListParams,
169
190
  type WorkspaceMembersCursorPagination,
170
191
  } from './workspace-admin/workspace-admin';
@@ -36,11 +36,32 @@ 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 });
54
+ }
55
+
56
+ /**
57
+ * Reassigns agent variations from one model to another in bulk. Runs
58
+ * asynchronously and returns immediately.
59
+ */
60
+ swap(workspaceID: string, body: ModelSwapParams, options?: RequestOptions): APIPromise<unknown> {
61
+ return this._client.post(path`/v1/workspaces/${workspaceID}/models:swapModelOnVariations`, {
62
+ body,
63
+ ...options,
64
+ });
44
65
  }
45
66
  }
46
67
 
@@ -56,6 +77,40 @@ export interface Model {
56
77
  * Model specification
57
78
  */
58
79
  spec: ModelSpec;
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
+
87
+ /**
88
+ * ModelInfo carries server-derived, read-only details about a model.
89
+ */
90
+ info?: Model.Info;
91
+ }
92
+
93
+ export namespace Model {
94
+ /**
95
+ * ModelInfo carries server-derived, read-only details about a model.
96
+ */
97
+ export interface Info {
98
+ /**
99
+ * Number of agent variations currently provisioned on this model. Useful for
100
+ * previewing how many variations a swap would affect.
101
+ */
102
+ agentVariationCount?: number;
103
+
104
+ /**
105
+ * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
106
+ */
107
+ aiProviderKey?: Shared.ResourceMetadata;
108
+
109
+ /**
110
+ * The AI provider this model routes through (via its provider key).
111
+ */
112
+ provider?: 'AI_PROVIDER_UNSPECIFIED' | 'AI_PROVIDER_OPENROUTER';
113
+ }
59
114
  }
60
115
 
61
116
  export interface ModelSpec {
@@ -88,13 +143,14 @@ export interface ModelSpec {
88
143
  * The model provider (e.g., "anthropic", "openai", "google")
89
144
  */
90
145
  provider?: string;
91
-
92
- /**
93
- * The status of the model in the workspace
94
- */
95
- status?: 'MODEL_STATUS_UNSPECIFIED' | 'MODEL_STATUS_ENABLED' | 'MODEL_STATUS_DISABLED';
96
146
  }
97
147
 
148
+ /**
149
+ * Swap model on variations response. Empty: the work runs asynchronously, so no
150
+ * counts are returned (a large data set would make the call slow).
151
+ */
152
+ export type ModelSwapResponse = unknown;
153
+
98
154
  export interface ModelRetrieveParams {
99
155
  /**
100
156
  * Workspace ID.
@@ -103,11 +159,23 @@ export interface ModelRetrieveParams {
103
159
  }
104
160
 
105
161
  export interface ModelListParams extends CursorPaginationParams {
162
+ /**
163
+ * Filter to models provisioned on a specific AI provider key. Accepts the key's id
164
+ * or an "external_id:"-prefixed slug.
165
+ */
166
+ aiProviderKeyId?: string;
167
+
106
168
  /**
107
169
  * Filter by bundle_key — return only resources owned by this bundle.
108
170
  */
109
171
  bundleKey?: string;
110
172
 
173
+ /**
174
+ * When true, populate each item's info (e.g. the AI provider), at the cost of
175
+ * extra lookups.
176
+ */
177
+ includeInfo?: boolean;
178
+
111
179
  /**
112
180
  * Filter by name prefix
113
181
  */
@@ -124,30 +192,56 @@ export interface ModelListParams extends CursorPaginationParams {
124
192
  sortOrder?: string;
125
193
 
126
194
  /**
127
- * Filter by model status
195
+ * Filter by model state
128
196
  */
129
- status?: 'MODEL_STATUS_UNSPECIFIED' | 'MODEL_STATUS_ENABLED' | 'MODEL_STATUS_DISABLED';
197
+ state?: 'STATE_UNSPECIFIED' | 'STATE_ENABLED' | 'STATE_DISABLED';
130
198
  }
131
199
 
132
- export interface ModelSetStatusParams {
200
+ export interface ModelDisableParams {
133
201
  /**
134
- * Path param: Workspace ID.
202
+ * Workspace ID.
135
203
  */
136
204
  workspaceId: string;
205
+ }
137
206
 
207
+ export interface ModelEnableParams {
138
208
  /**
139
- * Body param: The new status for the model
209
+ * Workspace ID.
140
210
  */
141
- status?: 'MODEL_STATUS_UNSPECIFIED' | 'MODEL_STATUS_ENABLED' | 'MODEL_STATUS_DISABLED';
211
+ workspaceId: string;
212
+ }
213
+
214
+ export interface ModelSwapParams {
215
+ /**
216
+ * The swaps to perform.
217
+ */
218
+ modelSwaps?: Array<ModelSwapParams.ModelSwap>;
219
+ }
220
+
221
+ export namespace ModelSwapParams {
222
+ export interface ModelSwap {
223
+ /**
224
+ * The model variations are currently on. Accepts an id or "external_id:" slug.
225
+ */
226
+ currentModelId?: string;
227
+
228
+ /**
229
+ * The model to move variations to. Accepts an id or "external_id:" slug.
230
+ */
231
+ nextModelId?: string;
232
+ }
142
233
  }
143
234
 
144
235
  export declare namespace Models {
145
236
  export {
146
237
  type Model as Model,
147
238
  type ModelSpec as ModelSpec,
239
+ type ModelSwapResponse as ModelSwapResponse,
148
240
  type ModelsCursorPagination as ModelsCursorPagination,
149
241
  type ModelRetrieveParams as ModelRetrieveParams,
150
242
  type ModelListParams as ModelListParams,
151
- type ModelSetStatusParams as ModelSetStatusParams,
243
+ type ModelDisableParams as ModelDisableParams,
244
+ type ModelEnableParams as ModelEnableParams,
245
+ type ModelSwapParams as ModelSwapParams,
152
246
  };
153
247
  }
@@ -18,16 +18,15 @@ export {
18
18
  type MemoryRead,
19
19
  type MemoryReference,
20
20
  type Objective,
21
+ type ObjectiveConfigSnapshot,
21
22
  type ObjectiveContextWindow,
22
23
  type ObjectiveContextWindowData,
23
- type ObjectiveData,
24
- type ObjectiveDataSecret,
25
24
  type ObjectiveError,
26
25
  type ObjectiveEventData,
27
26
  type ObjectiveEventInfo,
28
27
  type ObjectiveEventWebhookData,
29
28
  type ObjectiveInfo,
30
- type ObjectiveStatus,
29
+ type ObjectiveSecret,
31
30
  type SubAgentSpawned,
32
31
  type SubAgentUpdated,
33
32
  type ToolApprovalRequested,