@cadenya/cadenya 0.84.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.
- package/CHANGELOG.md +8 -0
- package/client.d.mts +8 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -8
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/account.js +1 -1
- package/resources/account.js.map +1 -1
- package/resources/account.mjs +1 -1
- package/resources/account.mjs.map +1 -1
- package/resources/agents/agents.d.mts +55 -9
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +55 -9
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js +38 -0
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +38 -0
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/index.d.mts +2 -2
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +2 -2
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/schedules.d.mts +57 -6
- package/resources/agents/schedules.d.mts.map +1 -1
- package/resources/agents/schedules.d.ts +57 -6
- package/resources/agents/schedules.d.ts.map +1 -1
- package/resources/agents/schedules.js +34 -0
- package/resources/agents/schedules.js.map +1 -1
- package/resources/agents/schedules.mjs +34 -0
- package/resources/agents/schedules.mjs.map +1 -1
- package/resources/api-keys/api-keys.d.mts +4 -2
- package/resources/api-keys/api-keys.d.mts.map +1 -1
- package/resources/api-keys/api-keys.d.ts +4 -2
- package/resources/api-keys/api-keys.d.ts.map +1 -1
- package/resources/api-keys/api-keys.js +2 -2
- package/resources/api-keys/api-keys.js.map +1 -1
- package/resources/api-keys/api-keys.mjs +2 -2
- package/resources/api-keys/api-keys.mjs.map +1 -1
- package/resources/api-keys/index.d.mts +1 -1
- package/resources/api-keys/index.d.mts.map +1 -1
- package/resources/api-keys/index.d.ts +1 -1
- package/resources/api-keys/index.d.ts.map +1 -1
- package/resources/api-keys/index.js.map +1 -1
- package/resources/api-keys/index.mjs.map +1 -1
- package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts +23 -7
- package/resources/bulk-workspace-resources/bulk-workspace-resources.d.mts.map +1 -1
- package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts +23 -7
- package/resources/bulk-workspace-resources/bulk-workspace-resources.d.ts.map +1 -1
- package/resources/bulk-workspace-resources/bulk-workspace-resources.js.map +1 -1
- package/resources/bulk-workspace-resources/bulk-workspace-resources.mjs.map +1 -1
- package/resources/index.d.mts +4 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/models.d.mts +22 -13
- package/resources/models.d.mts.map +1 -1
- package/resources/models.d.ts +22 -13
- package/resources/models.d.ts.map +1 -1
- package/resources/models.js +12 -3
- package/resources/models.js.map +1 -1
- package/resources/models.mjs +12 -3
- package/resources/models.mjs.map +1 -1
- package/resources/shared.d.mts +4 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +4 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/tool-sets/index.d.mts +2 -2
- package/resources/tool-sets/index.d.mts.map +1 -1
- package/resources/tool-sets/index.d.ts +2 -2
- package/resources/tool-sets/index.d.ts.map +1 -1
- package/resources/tool-sets/index.js.map +1 -1
- package/resources/tool-sets/index.mjs.map +1 -1
- package/resources/tool-sets/tool-sets.d.mts +40 -3
- package/resources/tool-sets/tool-sets.d.mts.map +1 -1
- package/resources/tool-sets/tool-sets.d.ts +40 -3
- package/resources/tool-sets/tool-sets.d.ts.map +1 -1
- package/resources/tool-sets/tool-sets.js +27 -1
- package/resources/tool-sets/tool-sets.js.map +1 -1
- package/resources/tool-sets/tool-sets.mjs +27 -1
- package/resources/tool-sets/tool-sets.mjs.map +1 -1
- package/resources/tool-sets/tools.d.mts +39 -5
- package/resources/tool-sets/tools.d.mts.map +1 -1
- package/resources/tool-sets/tools.d.ts +39 -5
- package/resources/tool-sets/tools.d.ts.map +1 -1
- package/resources/tool-sets/tools.js +23 -1
- package/resources/tool-sets/tools.js.map +1 -1
- package/resources/tool-sets/tools.mjs +23 -1
- package/resources/tool-sets/tools.mjs.map +1 -1
- package/src/client.ts +18 -2
- package/src/resources/account.ts +1 -1
- package/src/resources/agents/agents.ts +89 -15
- package/src/resources/agents/index.ts +7 -0
- package/src/resources/agents/schedules.ts +87 -10
- package/src/resources/api-keys/api-keys.ts +5 -2
- package/src/resources/api-keys/index.ts +1 -0
- package/src/resources/bulk-workspace-resources/bulk-workspace-resources.ts +26 -7
- package/src/resources/index.ts +9 -1
- package/src/resources/models.ts +29 -15
- package/src/resources/shared.ts +5 -0
- package/src/resources/tool-sets/index.ts +4 -0
- package/src/resources/tool-sets/tool-sets.ts +62 -1
- package/src/resources/tool-sets/tools.ts +60 -12
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/client.ts
CHANGED
|
@@ -41,9 +41,10 @@ import {
|
|
|
41
41
|
} from './resources/ai-provider-keys';
|
|
42
42
|
import {
|
|
43
43
|
Model,
|
|
44
|
+
ModelDisableParams,
|
|
45
|
+
ModelEnableParams,
|
|
44
46
|
ModelListParams,
|
|
45
47
|
ModelRetrieveParams,
|
|
46
|
-
ModelSetStatusParams,
|
|
47
48
|
ModelSpec,
|
|
48
49
|
ModelSwapParams,
|
|
49
50
|
ModelSwapResponse,
|
|
@@ -85,12 +86,16 @@ import {
|
|
|
85
86
|
} from './resources/workspaces';
|
|
86
87
|
import {
|
|
87
88
|
Agent,
|
|
89
|
+
AgentArchiveParams,
|
|
88
90
|
AgentCreateParams,
|
|
89
91
|
AgentDeleteParams,
|
|
90
92
|
AgentInfo,
|
|
91
93
|
AgentListParams,
|
|
94
|
+
AgentPublishParams,
|
|
92
95
|
AgentRetrieveParams,
|
|
93
96
|
AgentSpec,
|
|
97
|
+
AgentUnarchiveParams,
|
|
98
|
+
AgentUnpublishParams,
|
|
94
99
|
AgentUpdateParams,
|
|
95
100
|
Agents,
|
|
96
101
|
AgentsCursorPagination,
|
|
@@ -101,6 +106,7 @@ import {
|
|
|
101
106
|
APIKeyCreateParams,
|
|
102
107
|
APIKeyInfo,
|
|
103
108
|
APIKeyListParams,
|
|
109
|
+
APIKeyRotateParams,
|
|
104
110
|
APIKeySpec,
|
|
105
111
|
APIKeyUpdateParams,
|
|
106
112
|
APIKeys,
|
|
@@ -193,6 +199,7 @@ import {
|
|
|
193
199
|
ToolSetAdapterHTTP,
|
|
194
200
|
ToolSetAdapterMcp,
|
|
195
201
|
ToolSetAdapterOpenAPI,
|
|
202
|
+
ToolSetArchiveParams,
|
|
196
203
|
ToolSetCreateParams,
|
|
197
204
|
ToolSetDeleteParams,
|
|
198
205
|
ToolSetEvent,
|
|
@@ -205,6 +212,7 @@ import {
|
|
|
205
212
|
ToolSetListParams,
|
|
206
213
|
ToolSetRetrieveParams,
|
|
207
214
|
ToolSetSpec,
|
|
215
|
+
ToolSetUnarchiveParams,
|
|
208
216
|
ToolSetUpdateParams,
|
|
209
217
|
ToolSets,
|
|
210
218
|
ToolSetsCursorPagination,
|
|
@@ -1091,6 +1099,10 @@ export declare namespace Cadenya {
|
|
|
1091
1099
|
type AgentUpdateParams as AgentUpdateParams,
|
|
1092
1100
|
type AgentListParams as AgentListParams,
|
|
1093
1101
|
type AgentDeleteParams as AgentDeleteParams,
|
|
1102
|
+
type AgentArchiveParams as AgentArchiveParams,
|
|
1103
|
+
type AgentPublishParams as AgentPublishParams,
|
|
1104
|
+
type AgentUnarchiveParams as AgentUnarchiveParams,
|
|
1105
|
+
type AgentUnpublishParams as AgentUnpublishParams,
|
|
1094
1106
|
};
|
|
1095
1107
|
|
|
1096
1108
|
export {
|
|
@@ -1166,7 +1178,8 @@ export declare namespace Cadenya {
|
|
|
1166
1178
|
type ModelsCursorPagination as ModelsCursorPagination,
|
|
1167
1179
|
type ModelRetrieveParams as ModelRetrieveParams,
|
|
1168
1180
|
type ModelListParams as ModelListParams,
|
|
1169
|
-
type
|
|
1181
|
+
type ModelDisableParams as ModelDisableParams,
|
|
1182
|
+
type ModelEnableParams as ModelEnableParams,
|
|
1170
1183
|
type ModelSwapParams as ModelSwapParams,
|
|
1171
1184
|
};
|
|
1172
1185
|
|
|
@@ -1202,8 +1215,10 @@ export declare namespace Cadenya {
|
|
|
1202
1215
|
type ToolSetUpdateParams as ToolSetUpdateParams,
|
|
1203
1216
|
type ToolSetListParams as ToolSetListParams,
|
|
1204
1217
|
type ToolSetDeleteParams as ToolSetDeleteParams,
|
|
1218
|
+
type ToolSetArchiveParams as ToolSetArchiveParams,
|
|
1205
1219
|
type ToolSetGetOpenAPISpecParams as ToolSetGetOpenAPISpecParams,
|
|
1206
1220
|
type ToolSetListEventsParams as ToolSetListEventsParams,
|
|
1221
|
+
type ToolSetUnarchiveParams as ToolSetUnarchiveParams,
|
|
1207
1222
|
};
|
|
1208
1223
|
|
|
1209
1224
|
export {
|
|
@@ -1215,6 +1230,7 @@ export declare namespace Cadenya {
|
|
|
1215
1230
|
type APIKeyCreateParams as APIKeyCreateParams,
|
|
1216
1231
|
type APIKeyUpdateParams as APIKeyUpdateParams,
|
|
1217
1232
|
type APIKeyListParams as APIKeyListParams,
|
|
1233
|
+
type APIKeyRotateParams as APIKeyRotateParams,
|
|
1218
1234
|
};
|
|
1219
1235
|
|
|
1220
1236
|
export {
|
package/src/resources/account.ts
CHANGED
|
@@ -25,7 +25,7 @@ export class AccountResource extends APIResource {
|
|
|
25
25
|
* Rotates the webhook signing key for the account. Returns only the new key.
|
|
26
26
|
*/
|
|
27
27
|
rotateWebhookSigningKey(options?: RequestOptions): APIPromise<RotateWebhookSigningKeyResponse> {
|
|
28
|
-
return this._client.post('/v1/account
|
|
28
|
+
return this._client.post('/v1/account:rotateWebhookSigningKey', options);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -12,12 +12,15 @@ import {
|
|
|
12
12
|
AgentScheduleSpec,
|
|
13
13
|
AgentScheduleSpecSchedule,
|
|
14
14
|
AgentSchedulesCursorPagination,
|
|
15
|
+
ScheduleArchiveParams,
|
|
15
16
|
ScheduleCalendar,
|
|
16
17
|
ScheduleCreateParams,
|
|
17
18
|
ScheduleDeleteParams,
|
|
18
19
|
ScheduleInterval,
|
|
19
20
|
ScheduleListParams,
|
|
21
|
+
SchedulePauseParams,
|
|
20
22
|
ScheduleRange,
|
|
23
|
+
ScheduleResumeParams,
|
|
21
24
|
ScheduleRetrieveParams,
|
|
22
25
|
ScheduleUpdateParams,
|
|
23
26
|
Schedules,
|
|
@@ -120,6 +123,48 @@ export class Agents extends APIResource {
|
|
|
120
123
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
121
124
|
});
|
|
122
125
|
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Transitions an agent to STATE_ARCHIVED. Archived agents are hidden from list
|
|
129
|
+
* results and cannot be used for objectives; active schedules are paused.
|
|
130
|
+
*/
|
|
131
|
+
archive(id: string, params: AgentArchiveParams, options?: RequestOptions): APIPromise<Agent> {
|
|
132
|
+
const { workspaceId, ...body } = params;
|
|
133
|
+
return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${id}:archive`, { body, ...options });
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Transitions an agent to STATE_PUBLISHED, making it available for objectives. The
|
|
138
|
+
* agent must have at least one variation.
|
|
139
|
+
*/
|
|
140
|
+
publish(id: string, params: AgentPublishParams, options?: RequestOptions): APIPromise<Agent> {
|
|
141
|
+
const { workspaceId, ...body } = params;
|
|
142
|
+
return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${id}:publish`, { body, ...options });
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Transitions an archived agent back to STATE_DRAFT. Publish the agent again to
|
|
147
|
+
* make it available for objectives.
|
|
148
|
+
*/
|
|
149
|
+
unarchive(id: string, params: AgentUnarchiveParams, options?: RequestOptions): APIPromise<Agent> {
|
|
150
|
+
const { workspaceId, ...body } = params;
|
|
151
|
+
return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${id}:unarchive`, {
|
|
152
|
+
body,
|
|
153
|
+
...options,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Transitions a published agent back to STATE_DRAFT. Active schedules for the
|
|
159
|
+
* agent are paused until it is published again.
|
|
160
|
+
*/
|
|
161
|
+
unpublish(id: string, params: AgentUnpublishParams, options?: RequestOptions): APIPromise<Agent> {
|
|
162
|
+
const { workspaceId, ...body } = params;
|
|
163
|
+
return this._client.post(path`/v1/workspaces/${workspaceId}/agents/${id}:unpublish`, {
|
|
164
|
+
body,
|
|
165
|
+
...options,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
123
168
|
}
|
|
124
169
|
|
|
125
170
|
export type AgentsCursorPagination = CursorPagination<Agent>;
|
|
@@ -138,6 +183,13 @@ export interface Agent {
|
|
|
138
183
|
*/
|
|
139
184
|
spec: AgentSpec;
|
|
140
185
|
|
|
186
|
+
/**
|
|
187
|
+
* The current lifecycle state of the agent. Output only. Agents are created in
|
|
188
|
+
* STATE_DRAFT; use the :publish, :unpublish, :archive, and :unarchive actions to
|
|
189
|
+
* transition between states.
|
|
190
|
+
*/
|
|
191
|
+
state: 'STATE_UNSPECIFIED' | 'STATE_DRAFT' | 'STATE_PUBLISHED' | 'STATE_ARCHIVED';
|
|
192
|
+
|
|
141
193
|
/**
|
|
142
194
|
* AgentInfo contains simple information about an agent for display or quick
|
|
143
195
|
* reference
|
|
@@ -164,15 +216,6 @@ export interface AgentInfo {
|
|
|
164
216
|
* Agent specification (user-provided configuration)
|
|
165
217
|
*/
|
|
166
218
|
export interface AgentSpec {
|
|
167
|
-
/**
|
|
168
|
-
* Status of the agent
|
|
169
|
-
*/
|
|
170
|
-
status:
|
|
171
|
-
| 'AGENT_STATUS_UNSPECIFIED'
|
|
172
|
-
| 'AGENT_STATUS_DRAFT'
|
|
173
|
-
| 'AGENT_STATUS_PUBLISHED'
|
|
174
|
-
| 'AGENT_STATUS_ARCHIVED';
|
|
175
|
-
|
|
176
219
|
/**
|
|
177
220
|
* Controls how variations are automatically selected when creating objectives
|
|
178
221
|
* Defaults to RANDOM when unspecified
|
|
@@ -314,13 +357,9 @@ export interface AgentListParams extends CursorPaginationParams {
|
|
|
314
357
|
sortOrder?: string;
|
|
315
358
|
|
|
316
359
|
/**
|
|
317
|
-
* Filter by agent
|
|
360
|
+
* Filter by agent lifecycle state
|
|
318
361
|
*/
|
|
319
|
-
|
|
320
|
-
| 'AGENT_STATUS_UNSPECIFIED'
|
|
321
|
-
| 'AGENT_STATUS_DRAFT'
|
|
322
|
-
| 'AGENT_STATUS_PUBLISHED'
|
|
323
|
-
| 'AGENT_STATUS_ARCHIVED';
|
|
362
|
+
state?: 'STATE_UNSPECIFIED' | 'STATE_DRAFT' | 'STATE_PUBLISHED' | 'STATE_ARCHIVED';
|
|
324
363
|
|
|
325
364
|
/**
|
|
326
365
|
* Filter by variation selection mode
|
|
@@ -338,6 +377,34 @@ export interface AgentDeleteParams {
|
|
|
338
377
|
workspaceId: string;
|
|
339
378
|
}
|
|
340
379
|
|
|
380
|
+
export interface AgentArchiveParams {
|
|
381
|
+
/**
|
|
382
|
+
* Workspace ID.
|
|
383
|
+
*/
|
|
384
|
+
workspaceId: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export interface AgentPublishParams {
|
|
388
|
+
/**
|
|
389
|
+
* Workspace ID.
|
|
390
|
+
*/
|
|
391
|
+
workspaceId: string;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export interface AgentUnarchiveParams {
|
|
395
|
+
/**
|
|
396
|
+
* Workspace ID.
|
|
397
|
+
*/
|
|
398
|
+
workspaceId: string;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export interface AgentUnpublishParams {
|
|
402
|
+
/**
|
|
403
|
+
* Workspace ID.
|
|
404
|
+
*/
|
|
405
|
+
workspaceId: string;
|
|
406
|
+
}
|
|
407
|
+
|
|
341
408
|
Agents.Feedback = Feedback;
|
|
342
409
|
Agents.WebhookDeliveries = WebhookDeliveries;
|
|
343
410
|
Agents.Variations = Variations;
|
|
@@ -355,6 +422,10 @@ export declare namespace Agents {
|
|
|
355
422
|
type AgentUpdateParams as AgentUpdateParams,
|
|
356
423
|
type AgentListParams as AgentListParams,
|
|
357
424
|
type AgentDeleteParams as AgentDeleteParams,
|
|
425
|
+
type AgentArchiveParams as AgentArchiveParams,
|
|
426
|
+
type AgentPublishParams as AgentPublishParams,
|
|
427
|
+
type AgentUnarchiveParams as AgentUnarchiveParams,
|
|
428
|
+
type AgentUnpublishParams as AgentUnpublishParams,
|
|
358
429
|
};
|
|
359
430
|
|
|
360
431
|
export { Feedback as Feedback, type FeedbackListParams as FeedbackListParams };
|
|
@@ -408,5 +479,8 @@ export declare namespace Agents {
|
|
|
408
479
|
type ScheduleUpdateParams as ScheduleUpdateParams,
|
|
409
480
|
type ScheduleListParams as ScheduleListParams,
|
|
410
481
|
type ScheduleDeleteParams as ScheduleDeleteParams,
|
|
482
|
+
type ScheduleArchiveParams as ScheduleArchiveParams,
|
|
483
|
+
type SchedulePauseParams as SchedulePauseParams,
|
|
484
|
+
type ScheduleResumeParams as ScheduleResumeParams,
|
|
411
485
|
};
|
|
412
486
|
}
|
|
@@ -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
|
|
175
|
+
* schedule is STATE_PAUSED/STATE_ARCHIVED or has no future fire times.
|
|
132
176
|
*/
|
|
133
177
|
nextFireAt?: string;
|
|
134
178
|
|
|
@@ -166,15 +210,6 @@ export interface AgentScheduleSpec {
|
|
|
166
210
|
*/
|
|
167
211
|
overlapPolicy?: 'OVERLAP_POLICY_UNSPECIFIED' | 'OVERLAP_POLICY_ALLOW' | 'OVERLAP_POLICY_SKIP';
|
|
168
212
|
|
|
169
|
-
/**
|
|
170
|
-
* Lifecycle. Defaults to ACTIVE on create when unspecified.
|
|
171
|
-
*/
|
|
172
|
-
status?:
|
|
173
|
-
| 'AGENT_SCHEDULE_STATUS_UNSPECIFIED'
|
|
174
|
-
| 'AGENT_SCHEDULE_STATUS_ACTIVE'
|
|
175
|
-
| 'AGENT_SCHEDULE_STATUS_PAUSED'
|
|
176
|
-
| 'AGENT_SCHEDULE_STATUS_ARCHIVED';
|
|
177
|
-
|
|
178
213
|
/**
|
|
179
214
|
* Optional explicit variation. When unset, the agent's variation_selection_mode
|
|
180
215
|
* chooses per fire.
|
|
@@ -364,6 +399,45 @@ export interface ScheduleDeleteParams {
|
|
|
364
399
|
agentId: string;
|
|
365
400
|
}
|
|
366
401
|
|
|
402
|
+
export interface ScheduleArchiveParams {
|
|
403
|
+
/**
|
|
404
|
+
* Workspace ID.
|
|
405
|
+
*/
|
|
406
|
+
workspaceId: string;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
|
|
410
|
+
* form.
|
|
411
|
+
*/
|
|
412
|
+
agentId: string;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export interface SchedulePauseParams {
|
|
416
|
+
/**
|
|
417
|
+
* Workspace ID.
|
|
418
|
+
*/
|
|
419
|
+
workspaceId: string;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
|
|
423
|
+
* form.
|
|
424
|
+
*/
|
|
425
|
+
agentId: string;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export interface ScheduleResumeParams {
|
|
429
|
+
/**
|
|
430
|
+
* Workspace ID.
|
|
431
|
+
*/
|
|
432
|
+
workspaceId: string;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
|
|
436
|
+
* form.
|
|
437
|
+
*/
|
|
438
|
+
agentId: string;
|
|
439
|
+
}
|
|
440
|
+
|
|
367
441
|
export declare namespace Schedules {
|
|
368
442
|
export {
|
|
369
443
|
type AgentSchedule as AgentSchedule,
|
|
@@ -379,5 +453,8 @@ export declare namespace Schedules {
|
|
|
379
453
|
type ScheduleUpdateParams as ScheduleUpdateParams,
|
|
380
454
|
type ScheduleListParams as ScheduleListParams,
|
|
381
455
|
type ScheduleDeleteParams as ScheduleDeleteParams,
|
|
456
|
+
type ScheduleArchiveParams as ScheduleArchiveParams,
|
|
457
|
+
type SchedulePauseParams as SchedulePauseParams,
|
|
458
|
+
type ScheduleResumeParams as ScheduleResumeParams,
|
|
382
459
|
};
|
|
383
460
|
}
|
|
@@ -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.
|
|
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
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
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
|
|
182
|
-
*
|
|
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 {
|
package/src/resources/index.ts
CHANGED
|
@@ -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
|
|
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';
|
package/src/resources/models.ts
CHANGED
|
@@ -36,11 +36,21 @@ export class Models extends APIResource {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
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
|
-
|
|
42
|
+
disable(id: string, params: ModelDisableParams, options?: RequestOptions): APIPromise<Model> {
|
|
42
43
|
const { workspaceId, ...body } = params;
|
|
43
|
-
return this._client.
|
|
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
|
|
195
|
+
* Filter by model state
|
|
185
196
|
*/
|
|
186
|
-
|
|
197
|
+
state?: 'STATE_UNSPECIFIED' | 'STATE_ENABLED' | 'STATE_DISABLED';
|
|
187
198
|
}
|
|
188
199
|
|
|
189
|
-
export interface
|
|
200
|
+
export interface ModelDisableParams {
|
|
190
201
|
/**
|
|
191
|
-
*
|
|
202
|
+
* Workspace ID.
|
|
192
203
|
*/
|
|
193
204
|
workspaceId: string;
|
|
205
|
+
}
|
|
194
206
|
|
|
207
|
+
export interface ModelEnableParams {
|
|
195
208
|
/**
|
|
196
|
-
*
|
|
209
|
+
* Workspace ID.
|
|
197
210
|
*/
|
|
198
|
-
|
|
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
|
|
243
|
+
type ModelDisableParams as ModelDisableParams,
|
|
244
|
+
type ModelEnableParams as ModelEnableParams,
|
|
231
245
|
type ModelSwapParams as ModelSwapParams,
|
|
232
246
|
};
|
|
233
247
|
}
|
package/src/resources/shared.ts
CHANGED
|
@@ -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';
|