@cadenya/cadenya 0.56.0 → 0.57.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/package.json +1 -1
- package/resources/agents/agents.d.mts +4 -0
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +4 -0
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js +4 -0
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +4 -0
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/index.d.mts +1 -0
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +1 -0
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js +3 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs +1 -0
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/schedules.d.mts +252 -0
- package/resources/agents/schedules.d.mts.map +1 -0
- package/resources/agents/schedules.d.ts +252 -0
- package/resources/agents/schedules.d.ts.map +1 -0
- package/resources/agents/schedules.js +59 -0
- package/resources/agents/schedules.js.map +1 -0
- package/resources/agents/schedules.mjs +55 -0
- package/resources/agents/schedules.mjs.map +1 -0
- package/resources/objectives/objectives.d.mts +7 -0
- package/resources/objectives/objectives.d.mts.map +1 -1
- package/resources/objectives/objectives.d.ts +7 -0
- package/resources/objectives/objectives.d.ts.map +1 -1
- package/resources/objectives/objectives.js.map +1 -1
- package/resources/objectives/objectives.mjs.map +1 -1
- package/src/resources/agents/agents.ts +36 -0
- package/src/resources/agents/index.ts +16 -0
- package/src/resources/agents/schedules.ts +346 -0
- package/src/resources/objectives/objectives.ts +8 -0
- 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
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as AccountAPI from '../account';
|
|
5
|
+
import * as Shared from '../shared';
|
|
6
|
+
import { APIPromise } from '../../core/api-promise';
|
|
7
|
+
import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
|
|
8
|
+
import { buildHeaders } from '../../internal/headers';
|
|
9
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
10
|
+
import { path } from '../../internal/utils/path';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* AgentScheduleService manages recurring schedules attached to agents.
|
|
14
|
+
* Schedules trigger objectives on a cadence defined by AgentScheduleSpec.Schedule.
|
|
15
|
+
* All operations are implicitly scoped to the workspace determined by the JWT token.
|
|
16
|
+
*
|
|
17
|
+
* Authentication: Bearer token (JWT)
|
|
18
|
+
* Scope: Workspace-level operations
|
|
19
|
+
*/
|
|
20
|
+
export class Schedules extends APIResource {
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new schedule for an agent
|
|
23
|
+
*/
|
|
24
|
+
create(agentID: string, body: ScheduleCreateParams, options?: RequestOptions): APIPromise<AgentSchedule> {
|
|
25
|
+
return this._client.post(path`/v1/agents/${agentID}/schedules`, { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a schedule by ID from an agent
|
|
30
|
+
*/
|
|
31
|
+
retrieve(id: string, params: ScheduleRetrieveParams, options?: RequestOptions): APIPromise<AgentSchedule> {
|
|
32
|
+
const { agentId } = params;
|
|
33
|
+
return this._client.get(path`/v1/agents/${agentId}/schedules/${id}`, options);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Updates a schedule for an agent
|
|
38
|
+
*/
|
|
39
|
+
update(id: string, params: ScheduleUpdateParams, options?: RequestOptions): APIPromise<AgentSchedule> {
|
|
40
|
+
const { agentId, ...body } = params;
|
|
41
|
+
return this._client.patch(path`/v1/agents/${agentId}/schedules/${id}`, { body, ...options });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Lists all schedules for an agent
|
|
46
|
+
*/
|
|
47
|
+
list(
|
|
48
|
+
agentID: string,
|
|
49
|
+
query: ScheduleListParams | null | undefined = {},
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): PagePromise<AgentSchedulesCursorPagination, AgentSchedule> {
|
|
52
|
+
return this._client.getAPIList(path`/v1/agents/${agentID}/schedules`, CursorPagination<AgentSchedule>, {
|
|
53
|
+
query,
|
|
54
|
+
...options,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Deletes a schedule from an agent
|
|
60
|
+
*/
|
|
61
|
+
delete(id: string, params: ScheduleDeleteParams, options?: RequestOptions): APIPromise<void> {
|
|
62
|
+
const { agentId } = params;
|
|
63
|
+
return this._client.delete(path`/v1/agents/${agentId}/schedules/${id}`, {
|
|
64
|
+
...options,
|
|
65
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type AgentSchedulesCursorPagination = CursorPagination<AgentSchedule>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* AgentSchedule resource — a recurring trigger attached to an agent that creates
|
|
74
|
+
* objectives on its cadence.
|
|
75
|
+
*/
|
|
76
|
+
export interface AgentSchedule {
|
|
77
|
+
/**
|
|
78
|
+
* Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
|
|
79
|
+
*/
|
|
80
|
+
metadata: Shared.ResourceMetadata;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* AgentScheduleSpec is the user-provided configuration for a schedule.
|
|
84
|
+
*/
|
|
85
|
+
spec: AgentScheduleSpec;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* AgentScheduleInfo provides read-only runtime data about a schedule.
|
|
89
|
+
*/
|
|
90
|
+
info?: AgentScheduleInfo;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* AgentScheduleInfo provides read-only runtime data about a schedule.
|
|
95
|
+
*/
|
|
96
|
+
export interface AgentScheduleInfo {
|
|
97
|
+
/**
|
|
98
|
+
* Profile represents a human user at the account level. Profiles are
|
|
99
|
+
* account-scoped resources that can be associated with multiple workspaces through
|
|
100
|
+
* the Actor model. Authentication for profiles is handled via SSO/OAuth (WorkOS).
|
|
101
|
+
*/
|
|
102
|
+
createdBy?: AccountAPI.Profile;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* When the schedule last fired (regardless of objective outcome).
|
|
106
|
+
*/
|
|
107
|
+
lastFireAt?: string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* ID of the most recent objective the schedule created.
|
|
111
|
+
*/
|
|
112
|
+
lastObjectiveId?: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* When the schedule most recently skipped a fire (SKIP policy + prior in flight).
|
|
116
|
+
*/
|
|
117
|
+
lastSkippedAt?: string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Reason for the most recent skip (e.g. "previous objective still running").
|
|
121
|
+
*/
|
|
122
|
+
lastSkipReason?: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* When the schedule will next fire. Computed from the spec; absent when the
|
|
126
|
+
* schedule is PAUSED/ARCHIVED or has no future fire times.
|
|
127
|
+
*/
|
|
128
|
+
nextFireAt?: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Lifetime count of objectives created by this schedule.
|
|
132
|
+
*/
|
|
133
|
+
totalFires?: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* AgentScheduleSpec is the user-provided configuration for a schedule.
|
|
138
|
+
*/
|
|
139
|
+
export interface AgentScheduleSpec {
|
|
140
|
+
/**
|
|
141
|
+
* The initial message passed to CreateObjective on each fire. Becomes the first
|
|
142
|
+
* user message in the objective's chat history.
|
|
143
|
+
*/
|
|
144
|
+
initialMessage: string;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Schedule defines WHEN the schedule fires. Temporal-style structured form: a list
|
|
148
|
+
* of calendar rules (wall-clock) and/or interval rules (duration), OR'd together.
|
|
149
|
+
* At least one rule is required.
|
|
150
|
+
*/
|
|
151
|
+
schedule: AgentScheduleSpecSchedule;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Optional input data passed to the objective. If the agent has an
|
|
155
|
+
* input_data_schema, this must satisfy it.
|
|
156
|
+
*/
|
|
157
|
+
data?: unknown;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* What to do when the previous run is still in flight. Defaults to SKIP.
|
|
161
|
+
*/
|
|
162
|
+
overlapPolicy?: 'OVERLAP_POLICY_UNSPECIFIED' | 'OVERLAP_POLICY_ALLOW' | 'OVERLAP_POLICY_SKIP';
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Lifecycle. Defaults to ACTIVE on create when unspecified.
|
|
166
|
+
*/
|
|
167
|
+
status?:
|
|
168
|
+
| 'AGENT_SCHEDULE_STATUS_UNSPECIFIED'
|
|
169
|
+
| 'AGENT_SCHEDULE_STATUS_ACTIVE'
|
|
170
|
+
| 'AGENT_SCHEDULE_STATUS_PAUSED'
|
|
171
|
+
| 'AGENT_SCHEDULE_STATUS_ARCHIVED';
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Optional explicit variation. When unset, the agent's variation_selection_mode
|
|
175
|
+
* chooses per fire.
|
|
176
|
+
*/
|
|
177
|
+
variationId?: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Schedule defines WHEN the schedule fires. Temporal-style structured form: a list
|
|
182
|
+
* of calendar rules (wall-clock) and/or interval rules (duration), OR'd together.
|
|
183
|
+
* At least one rule is required.
|
|
184
|
+
*/
|
|
185
|
+
export interface AgentScheduleSpecSchedule {
|
|
186
|
+
/**
|
|
187
|
+
* Wall-clock rules. May be empty if `intervals` is non-empty.
|
|
188
|
+
*/
|
|
189
|
+
calendars?: Array<ScheduleCalendar>;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Duration-based rules. May be empty if `calendars` is non-empty.
|
|
193
|
+
*/
|
|
194
|
+
intervals?: Array<ScheduleInterval>;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* IANA tz name (e.g. "America/New_York"). Required. Applies to calendars;
|
|
198
|
+
* intervals fire on wall-clock cadence anchored in this zone.
|
|
199
|
+
*/
|
|
200
|
+
timezone?: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Calendar is a wall-clock rule. Empty field-list semantics:
|
|
205
|
+
*
|
|
206
|
+
* - second/minute/hour: empty means [{start: 0}] (top of the unit)
|
|
207
|
+
* - day_of_month/month/day_of_week: empty means "any value" Fire times = cartesian
|
|
208
|
+
* product across all fields.
|
|
209
|
+
*/
|
|
210
|
+
export interface ScheduleCalendar {
|
|
211
|
+
comment?: string;
|
|
212
|
+
|
|
213
|
+
dayOfMonth?: Array<ScheduleRange>;
|
|
214
|
+
|
|
215
|
+
dayOfWeek?: Array<ScheduleRange>;
|
|
216
|
+
|
|
217
|
+
hour?: Array<ScheduleRange>;
|
|
218
|
+
|
|
219
|
+
minute?: Array<ScheduleRange>;
|
|
220
|
+
|
|
221
|
+
month?: Array<ScheduleRange>;
|
|
222
|
+
|
|
223
|
+
second?: Array<ScheduleRange>;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Interval is a duration-based rule. Fires every `every` from a stable anchor
|
|
228
|
+
* (workspace epoch), optionally phase-shifted by `offset`.
|
|
229
|
+
*/
|
|
230
|
+
export interface ScheduleInterval {
|
|
231
|
+
every?: string;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Phase shift within `every`. Must be < `every` (enforced at runtime).
|
|
235
|
+
*/
|
|
236
|
+
offset?: string;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Inclusive numeric range with optional step. {start: 9} → 9 {start: 9, end: 17} →
|
|
241
|
+
* 9..17 {start: 0, end: 59, step: 15} → 0,15,30,45 `end` defaults to `start`;
|
|
242
|
+
* `step` defaults to 1.
|
|
243
|
+
*/
|
|
244
|
+
export interface ScheduleRange {
|
|
245
|
+
end?: number;
|
|
246
|
+
|
|
247
|
+
start?: number;
|
|
248
|
+
|
|
249
|
+
step?: number;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface ScheduleCreateParams {
|
|
253
|
+
/**
|
|
254
|
+
* CreateResourceMetadata contains the user-provided fields for creating a
|
|
255
|
+
* workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
|
|
256
|
+
* profile_id, created_at) are excluded since they are set by the server.
|
|
257
|
+
*/
|
|
258
|
+
metadata: Shared.CreateResourceMetadata;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* AgentScheduleSpec is the user-provided configuration for a schedule.
|
|
262
|
+
*/
|
|
263
|
+
spec: AgentScheduleSpec;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface ScheduleRetrieveParams {
|
|
267
|
+
/**
|
|
268
|
+
* Agent ID (from path). Accepts canonical agent\_… form or external_id:<value>
|
|
269
|
+
* form (see common.proto "Path-parameter ID resolution").
|
|
270
|
+
*/
|
|
271
|
+
agentId: string;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface ScheduleUpdateParams {
|
|
275
|
+
/**
|
|
276
|
+
* Path param: Agent ID (from path). Accepts canonical agent\_… form or
|
|
277
|
+
* external_id:<value> form (see common.proto "Path-parameter ID resolution").
|
|
278
|
+
*/
|
|
279
|
+
agentId: string;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Body param: UpdateResourceMetadata contains the user-provided fields for
|
|
283
|
+
* updating a workspace-scoped resource. Read-only fields (id, account_id,
|
|
284
|
+
* workspace_id, profile_id, created_at) are excluded since they are set by the
|
|
285
|
+
* server.
|
|
286
|
+
*/
|
|
287
|
+
metadata?: Shared.UpdateResourceMetadata;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Body param: AgentScheduleSpec is the user-provided configuration for a schedule.
|
|
291
|
+
*/
|
|
292
|
+
spec?: AgentScheduleSpec;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Body param: Fields to update.
|
|
296
|
+
*/
|
|
297
|
+
updateMask?: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface ScheduleListParams extends CursorPaginationParams {
|
|
301
|
+
/**
|
|
302
|
+
* When set to true you may use more of your alloted API rate-limit.
|
|
303
|
+
*/
|
|
304
|
+
includeInfo?: boolean;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Filter expression (query param: prefix).
|
|
308
|
+
*/
|
|
309
|
+
prefix?: string;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Free-form search query.
|
|
313
|
+
*/
|
|
314
|
+
query?: string;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Sort order for results (asc or desc by creation time).
|
|
318
|
+
*/
|
|
319
|
+
sortOrder?: string;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export interface ScheduleDeleteParams {
|
|
323
|
+
/**
|
|
324
|
+
* Agent ID (from path). Accepts canonical agent\_… form or external_id:<value>
|
|
325
|
+
* form (see common.proto "Path-parameter ID resolution").
|
|
326
|
+
*/
|
|
327
|
+
agentId: string;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export declare namespace Schedules {
|
|
331
|
+
export {
|
|
332
|
+
type AgentSchedule as AgentSchedule,
|
|
333
|
+
type AgentScheduleInfo as AgentScheduleInfo,
|
|
334
|
+
type AgentScheduleSpec as AgentScheduleSpec,
|
|
335
|
+
type AgentScheduleSpecSchedule as AgentScheduleSpecSchedule,
|
|
336
|
+
type ScheduleCalendar as ScheduleCalendar,
|
|
337
|
+
type ScheduleInterval as ScheduleInterval,
|
|
338
|
+
type ScheduleRange as ScheduleRange,
|
|
339
|
+
type AgentSchedulesCursorPagination as AgentSchedulesCursorPagination,
|
|
340
|
+
type ScheduleCreateParams as ScheduleCreateParams,
|
|
341
|
+
type ScheduleRetrieveParams as ScheduleRetrieveParams,
|
|
342
|
+
type ScheduleUpdateParams as ScheduleUpdateParams,
|
|
343
|
+
type ScheduleListParams as ScheduleListParams,
|
|
344
|
+
type ScheduleDeleteParams as ScheduleDeleteParams,
|
|
345
|
+
};
|
|
346
|
+
}
|
|
@@ -396,6 +396,14 @@ export interface ObjectiveData {
|
|
|
396
396
|
*/
|
|
397
397
|
secrets?: Array<ObjectiveDataSecret>;
|
|
398
398
|
|
|
399
|
+
/**
|
|
400
|
+
* ID of the AgentSchedule that produced this objective, when applicable.
|
|
401
|
+
* Read-only; populated by the runtime when the objective is created from a
|
|
402
|
+
* schedule fire. Empty when the objective was created via CreateObjective
|
|
403
|
+
* directly.
|
|
404
|
+
*/
|
|
405
|
+
sourceScheduleId?: string;
|
|
406
|
+
|
|
399
407
|
/**
|
|
400
408
|
* system_prompt is read-only, derived from the selected variation's prompt
|
|
401
409
|
*/
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.57.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.57.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.57.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.57.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|