@cadenya/cadenya 0.55.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +0 -3
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +0 -3
  5. package/client.d.ts.map +1 -1
  6. package/client.js +0 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +0 -3
  9. package/client.mjs.map +1 -1
  10. package/internal/qs/formats.d.mts +7 -0
  11. package/internal/qs/formats.d.mts.map +1 -0
  12. package/internal/qs/formats.d.ts +7 -0
  13. package/internal/qs/formats.d.ts.map +1 -0
  14. package/internal/qs/formats.js +13 -0
  15. package/internal/qs/formats.js.map +1 -0
  16. package/internal/qs/formats.mjs +9 -0
  17. package/internal/qs/formats.mjs.map +1 -0
  18. package/internal/qs/index.d.mts +10 -0
  19. package/internal/qs/index.d.mts.map +1 -0
  20. package/internal/qs/index.d.ts +10 -0
  21. package/internal/qs/index.d.ts.map +1 -0
  22. package/internal/qs/index.js +14 -0
  23. package/internal/qs/index.js.map +1 -0
  24. package/internal/qs/index.mjs +10 -0
  25. package/internal/qs/index.mjs.map +1 -0
  26. package/internal/qs/stringify.d.mts +3 -0
  27. package/internal/qs/stringify.d.mts.map +1 -0
  28. package/internal/qs/stringify.d.ts +3 -0
  29. package/internal/qs/stringify.d.ts.map +1 -0
  30. package/internal/qs/stringify.js +277 -0
  31. package/internal/qs/stringify.js.map +1 -0
  32. package/internal/qs/stringify.mjs +274 -0
  33. package/internal/qs/stringify.mjs.map +1 -0
  34. package/internal/qs/types.d.mts +57 -0
  35. package/internal/qs/types.d.mts.map +1 -0
  36. package/internal/qs/types.d.ts +57 -0
  37. package/internal/qs/types.d.ts.map +1 -0
  38. package/internal/qs/types.js +3 -0
  39. package/internal/qs/types.js.map +1 -0
  40. package/internal/qs/types.mjs +2 -0
  41. package/internal/qs/types.mjs.map +1 -0
  42. package/internal/qs/utils.d.mts +15 -0
  43. package/internal/qs/utils.d.mts.map +1 -0
  44. package/internal/qs/utils.d.ts +15 -0
  45. package/internal/qs/utils.d.ts.map +1 -0
  46. package/internal/qs/utils.js +230 -0
  47. package/internal/qs/utils.js.map +1 -0
  48. package/internal/qs/utils.mjs +217 -0
  49. package/internal/qs/utils.mjs.map +1 -0
  50. package/internal/tslib.js +17 -17
  51. package/internal/utils/query.d.mts +0 -3
  52. package/internal/utils/query.d.mts.map +1 -1
  53. package/internal/utils/query.d.ts +0 -3
  54. package/internal/utils/query.d.ts.map +1 -1
  55. package/internal/utils/query.js +3 -16
  56. package/internal/utils/query.js.map +1 -1
  57. package/internal/utils/query.mjs +2 -16
  58. package/internal/utils/query.mjs.map +1 -1
  59. package/package.json +1 -1
  60. package/resources/agents/agents.d.mts +4 -0
  61. package/resources/agents/agents.d.mts.map +1 -1
  62. package/resources/agents/agents.d.ts +4 -0
  63. package/resources/agents/agents.d.ts.map +1 -1
  64. package/resources/agents/agents.js +4 -0
  65. package/resources/agents/agents.js.map +1 -1
  66. package/resources/agents/agents.mjs +4 -0
  67. package/resources/agents/agents.mjs.map +1 -1
  68. package/resources/agents/index.d.mts +1 -0
  69. package/resources/agents/index.d.mts.map +1 -1
  70. package/resources/agents/index.d.ts +1 -0
  71. package/resources/agents/index.d.ts.map +1 -1
  72. package/resources/agents/index.js +3 -1
  73. package/resources/agents/index.js.map +1 -1
  74. package/resources/agents/index.mjs +1 -0
  75. package/resources/agents/index.mjs.map +1 -1
  76. package/resources/agents/schedules.d.mts +252 -0
  77. package/resources/agents/schedules.d.mts.map +1 -0
  78. package/resources/agents/schedules.d.ts +252 -0
  79. package/resources/agents/schedules.d.ts.map +1 -0
  80. package/resources/agents/schedules.js +59 -0
  81. package/resources/agents/schedules.js.map +1 -0
  82. package/resources/agents/schedules.mjs +55 -0
  83. package/resources/agents/schedules.mjs.map +1 -0
  84. package/resources/objectives/objectives.d.mts +7 -0
  85. package/resources/objectives/objectives.d.mts.map +1 -1
  86. package/resources/objectives/objectives.d.ts +7 -0
  87. package/resources/objectives/objectives.d.ts.map +1 -1
  88. package/resources/objectives/objectives.js.map +1 -1
  89. package/resources/objectives/objectives.mjs.map +1 -1
  90. package/resources/tool-sets/tools.d.mts +9 -1
  91. package/resources/tool-sets/tools.d.mts.map +1 -1
  92. package/resources/tool-sets/tools.d.ts +9 -1
  93. package/resources/tool-sets/tools.d.ts.map +1 -1
  94. package/src/client.ts +0 -3
  95. package/src/internal/qs/LICENSE.md +13 -0
  96. package/src/internal/qs/README.md +3 -0
  97. package/src/internal/qs/formats.ts +10 -0
  98. package/src/internal/qs/index.ts +13 -0
  99. package/src/internal/qs/stringify.ts +385 -0
  100. package/src/internal/qs/types.ts +71 -0
  101. package/src/internal/qs/utils.ts +265 -0
  102. package/src/internal/utils/query.ts +2 -18
  103. package/src/resources/agents/agents.ts +36 -0
  104. package/src/resources/agents/index.ts +16 -0
  105. package/src/resources/agents/schedules.ts +346 -0
  106. package/src/resources/objectives/objectives.ts +8 -0
  107. package/src/resources/tool-sets/tools.ts +13 -1
  108. package/src/version.ts +1 -1
  109. package/version.d.mts +1 -1
  110. package/version.d.ts +1 -1
  111. package/version.js +1 -1
  112. 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
  */
@@ -144,7 +144,7 @@ export interface ToolSpec {
144
144
  status:
145
145
  | 'TOOL_STATUS_UNSPECIFIED'
146
146
  | 'TOOL_STATUS_AVAILABLE'
147
- | 'TOOL_STATUS_FILTERED'
147
+ | 'TOOL_STATUS_OMITTED'
148
148
  | 'TOOL_STATUS_ARCHIVED';
149
149
 
150
150
  requiresApproval?: boolean;
@@ -212,6 +212,11 @@ export interface ToolListParams extends CursorPaginationParams {
212
212
  */
213
213
  includeInfo?: boolean;
214
214
 
215
+ /**
216
+ * Filter by tool name (exact match). Multiple values are OR'd together.
217
+ */
218
+ names?: Array<string>;
219
+
215
220
  /**
216
221
  * Filter expression (query param: prefix)
217
222
  */
@@ -226,6 +231,13 @@ export interface ToolListParams extends CursorPaginationParams {
226
231
  * Sort order for results (asc or desc by creation time)
227
232
  */
228
233
  sortOrder?: string;
234
+
235
+ /**
236
+ * Filter by tool status. Multiple values are OR'd together.
237
+ */
238
+ statuses?: Array<
239
+ 'TOOL_STATUS_UNSPECIFIED' | 'TOOL_STATUS_AVAILABLE' | 'TOOL_STATUS_OMITTED' | 'TOOL_STATUS_ARCHIVED'
240
+ >;
229
241
  }
230
242
 
231
243
  export interface ToolDeleteParams {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.55.0'; // x-release-please-version
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.55.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.55.0";
1
+ export declare const VERSION = "0.57.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.55.0'; // x-release-please-version
4
+ exports.VERSION = '0.57.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.55.0'; // x-release-please-version
1
+ export const VERSION = '0.57.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map