oz-agent-sdk 1.0.0-alpha.7
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 +145 -0
- package/LICENSE +201 -0
- package/README.md +422 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +179 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +179 -0
- package/client.d.ts.map +1 -0
- package/client.js +454 -0
- package/client.js.map +1 -0
- package/client.mjs +450 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +137 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/agent/agent.d.mts +336 -0
- package/resources/agent/agent.d.mts.map +1 -0
- package/resources/agent/agent.d.ts +336 -0
- package/resources/agent/agent.d.ts.map +1 -0
- package/resources/agent/agent.js +47 -0
- package/resources/agent/agent.js.map +1 -0
- package/resources/agent/agent.mjs +42 -0
- package/resources/agent/agent.mjs.map +1 -0
- package/resources/agent/index.d.mts +4 -0
- package/resources/agent/index.d.mts.map +1 -0
- package/resources/agent/index.d.ts +4 -0
- package/resources/agent/index.d.ts.map +1 -0
- package/resources/agent/index.js +11 -0
- package/resources/agent/index.js.map +1 -0
- package/resources/agent/index.mjs +5 -0
- package/resources/agent/index.mjs.map +1 -0
- package/resources/agent/runs.d.mts +381 -0
- package/resources/agent/runs.d.mts.map +1 -0
- package/resources/agent/runs.d.ts +381 -0
- package/resources/agent/runs.d.ts.map +1 -0
- package/resources/agent/runs.js +46 -0
- package/resources/agent/runs.js.map +1 -0
- package/resources/agent/runs.mjs +42 -0
- package/resources/agent/runs.mjs.map +1 -0
- package/resources/agent/schedules.d.mts +240 -0
- package/resources/agent/schedules.d.mts.map +1 -0
- package/resources/agent/schedules.d.ts +240 -0
- package/resources/agent/schedules.d.ts.map +1 -0
- package/resources/agent/schedules.js +111 -0
- package/resources/agent/schedules.js.map +1 -0
- package/resources/agent/schedules.mjs +107 -0
- package/resources/agent/schedules.mjs.map +1 -0
- package/resources/agent.d.mts +2 -0
- package/resources/agent.d.mts.map +1 -0
- package/resources/agent.d.ts +2 -0
- package/resources/agent.d.ts.map +1 -0
- package/resources/agent.js +6 -0
- package/resources/agent.js.map +1 -0
- package/resources/agent.mjs +3 -0
- package/resources/agent.mjs.map +1 -0
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +7 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +741 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +56 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/agent/agent.ts +443 -0
- package/src/resources/agent/index.ts +32 -0
- package/src/resources/agent/runs.ts +478 -0
- package/src/resources/agent/schedules.ts +305 -0
- package/src/resources/agent.ts +3 -0
- package/src/resources/index.ts +14 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as AgentAPI from "./agent.mjs";
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
5
|
+
export declare class Schedules extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Create a new scheduled agent that runs on a cron schedule. The agent will be
|
|
8
|
+
* triggered automatically based on the cron expression.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const scheduledAgentItem =
|
|
13
|
+
* await client.agent.schedules.create({
|
|
14
|
+
* cron_schedule: '0 9 * * *',
|
|
15
|
+
* name: 'Daily Code Review',
|
|
16
|
+
* prompt:
|
|
17
|
+
* 'Review open pull requests and provide feedback',
|
|
18
|
+
* enabled: true,
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
create(body: ScheduleCreateParams, options?: RequestOptions): APIPromise<ScheduledAgentItem>;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve detailed information about a specific scheduled agent, including its
|
|
25
|
+
* configuration, history, and next scheduled run time.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const scheduledAgentItem =
|
|
30
|
+
* await client.agent.schedules.retrieve('scheduleId');
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
retrieve(scheduleID: string, options?: RequestOptions): APIPromise<ScheduledAgentItem>;
|
|
34
|
+
/**
|
|
35
|
+
* Update an existing scheduled agent's configuration. All fields except
|
|
36
|
+
* agent_config are required.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const scheduledAgentItem =
|
|
41
|
+
* await client.agent.schedules.update('scheduleId', {
|
|
42
|
+
* cron_schedule: 'cron_schedule',
|
|
43
|
+
* enabled: true,
|
|
44
|
+
* name: 'name',
|
|
45
|
+
* prompt: 'prompt',
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
update(scheduleID: string, body: ScheduleUpdateParams, options?: RequestOptions): APIPromise<ScheduledAgentItem>;
|
|
50
|
+
/**
|
|
51
|
+
* Retrieve all scheduled agents accessible to the authenticated user. Results are
|
|
52
|
+
* sorted alphabetically by name.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const schedules = await client.agent.schedules.list();
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
list(options?: RequestOptions): APIPromise<ScheduleListResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Delete a scheduled agent. This will stop all future scheduled runs.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const schedule = await client.agent.schedules.delete(
|
|
66
|
+
* 'scheduleId',
|
|
67
|
+
* );
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
delete(scheduleID: string, options?: RequestOptions): APIPromise<ScheduleDeleteResponse>;
|
|
71
|
+
/**
|
|
72
|
+
* Pause a scheduled agent. The agent will not run until resumed. This sets the
|
|
73
|
+
* enabled flag to false.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const scheduledAgentItem =
|
|
78
|
+
* await client.agent.schedules.pause('scheduleId');
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
pause(scheduleID: string, options?: RequestOptions): APIPromise<ScheduledAgentItem>;
|
|
82
|
+
/**
|
|
83
|
+
* Resume a paused scheduled agent. The agent will start running according to its
|
|
84
|
+
* cron schedule. This sets the enabled flag to true.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const scheduledAgentItem =
|
|
89
|
+
* await client.agent.schedules.resume('scheduleId');
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
resume(scheduleID: string, options?: RequestOptions): APIPromise<ScheduledAgentItem>;
|
|
93
|
+
}
|
|
94
|
+
export interface ScheduledAgentItem {
|
|
95
|
+
/**
|
|
96
|
+
* Unique identifier for the scheduled agent
|
|
97
|
+
*/
|
|
98
|
+
id: string;
|
|
99
|
+
/**
|
|
100
|
+
* Timestamp when the schedule was created (RFC3339)
|
|
101
|
+
*/
|
|
102
|
+
created_at: string;
|
|
103
|
+
/**
|
|
104
|
+
* Cron expression defining when the agent runs (e.g., "0 9 \* \* \*" for daily at
|
|
105
|
+
* 9am UTC)
|
|
106
|
+
*/
|
|
107
|
+
cron_schedule: string;
|
|
108
|
+
/**
|
|
109
|
+
* Whether the schedule is currently active
|
|
110
|
+
*/
|
|
111
|
+
enabled: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Human-readable name for the schedule
|
|
114
|
+
*/
|
|
115
|
+
name: string;
|
|
116
|
+
/**
|
|
117
|
+
* The prompt/instruction for the agent to execute
|
|
118
|
+
*/
|
|
119
|
+
prompt: string;
|
|
120
|
+
/**
|
|
121
|
+
* Timestamp when the schedule was last updated (RFC3339)
|
|
122
|
+
*/
|
|
123
|
+
updated_at: string;
|
|
124
|
+
/**
|
|
125
|
+
* Configuration for an cloud agent run
|
|
126
|
+
*/
|
|
127
|
+
agent_config?: AgentAPI.AmbientAgentConfig;
|
|
128
|
+
created_by?: AgentAPI.UserProfile;
|
|
129
|
+
/**
|
|
130
|
+
* Configuration for a cloud environment used by scheduled agents
|
|
131
|
+
*/
|
|
132
|
+
environment?: AgentAPI.CloudEnvironmentConfig;
|
|
133
|
+
/**
|
|
134
|
+
* Scheduler-derived history metadata for a scheduled agent
|
|
135
|
+
*/
|
|
136
|
+
history?: ScheduledAgentItem.History;
|
|
137
|
+
/**
|
|
138
|
+
* Error message from the last failed spawn attempt, if any
|
|
139
|
+
*/
|
|
140
|
+
last_spawn_error?: string | null;
|
|
141
|
+
/**
|
|
142
|
+
* Ownership scope for a resource (team or personal)
|
|
143
|
+
*/
|
|
144
|
+
scope?: ScheduledAgentItem.Scope;
|
|
145
|
+
updated_by?: AgentAPI.UserProfile;
|
|
146
|
+
}
|
|
147
|
+
export declare namespace ScheduledAgentItem {
|
|
148
|
+
/**
|
|
149
|
+
* Scheduler-derived history metadata for a scheduled agent
|
|
150
|
+
*/
|
|
151
|
+
interface History {
|
|
152
|
+
/**
|
|
153
|
+
* Timestamp of the last successful run (RFC3339)
|
|
154
|
+
*/
|
|
155
|
+
last_ran?: string | null;
|
|
156
|
+
/**
|
|
157
|
+
* Timestamp of the next scheduled run (RFC3339)
|
|
158
|
+
*/
|
|
159
|
+
next_run?: string | null;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Ownership scope for a resource (team or personal)
|
|
163
|
+
*/
|
|
164
|
+
interface Scope {
|
|
165
|
+
/**
|
|
166
|
+
* Type of ownership ("User" for personal, "Team" for team-owned)
|
|
167
|
+
*/
|
|
168
|
+
type: 'User' | 'Team';
|
|
169
|
+
/**
|
|
170
|
+
* UID of the owning user or team
|
|
171
|
+
*/
|
|
172
|
+
uid?: string;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
export interface ScheduleListResponse {
|
|
176
|
+
/**
|
|
177
|
+
* List of scheduled agents
|
|
178
|
+
*/
|
|
179
|
+
schedules: Array<ScheduledAgentItem>;
|
|
180
|
+
}
|
|
181
|
+
export interface ScheduleDeleteResponse {
|
|
182
|
+
/**
|
|
183
|
+
* Whether the deletion was successful
|
|
184
|
+
*/
|
|
185
|
+
success: boolean;
|
|
186
|
+
}
|
|
187
|
+
export interface ScheduleCreateParams {
|
|
188
|
+
/**
|
|
189
|
+
* Cron expression defining when the agent runs (e.g., "0 9 \* \* \*" for daily at
|
|
190
|
+
* 9am UTC)
|
|
191
|
+
*/
|
|
192
|
+
cron_schedule: string;
|
|
193
|
+
/**
|
|
194
|
+
* Human-readable name for the schedule
|
|
195
|
+
*/
|
|
196
|
+
name: string;
|
|
197
|
+
/**
|
|
198
|
+
* The prompt/instruction for the agent to execute
|
|
199
|
+
*/
|
|
200
|
+
prompt: string;
|
|
201
|
+
/**
|
|
202
|
+
* Configuration for an cloud agent run
|
|
203
|
+
*/
|
|
204
|
+
agent_config?: AgentAPI.AmbientAgentConfig;
|
|
205
|
+
/**
|
|
206
|
+
* Whether the schedule should be active immediately
|
|
207
|
+
*/
|
|
208
|
+
enabled?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Whether to create a team-owned schedule. Defaults to true for users on a single
|
|
211
|
+
* team.
|
|
212
|
+
*/
|
|
213
|
+
team?: boolean;
|
|
214
|
+
}
|
|
215
|
+
export interface ScheduleUpdateParams {
|
|
216
|
+
/**
|
|
217
|
+
* Cron expression defining when the agent runs
|
|
218
|
+
*/
|
|
219
|
+
cron_schedule: string;
|
|
220
|
+
/**
|
|
221
|
+
* Whether the schedule should be active
|
|
222
|
+
*/
|
|
223
|
+
enabled: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Human-readable name for the schedule
|
|
226
|
+
*/
|
|
227
|
+
name: string;
|
|
228
|
+
/**
|
|
229
|
+
* The prompt/instruction for the agent to execute
|
|
230
|
+
*/
|
|
231
|
+
prompt: string;
|
|
232
|
+
/**
|
|
233
|
+
* Configuration for an cloud agent run
|
|
234
|
+
*/
|
|
235
|
+
agent_config?: AgentAPI.AmbientAgentConfig;
|
|
236
|
+
}
|
|
237
|
+
export declare namespace Schedules {
|
|
238
|
+
export { type ScheduledAgentItem as ScheduledAgentItem, type ScheduleListResponse as ScheduleListResponse, type ScheduleDeleteResponse as ScheduleDeleteResponse, type ScheduleCreateParams as ScheduleCreateParams, type ScheduleUpdateParams as ScheduleUpdateParams, };
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=schedules.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules.d.mts","sourceRoot":"","sources":["../../src/resources/agent/schedules.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAI5F;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,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,CAAC;CAC5C;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as AgentAPI from "./agent.js";
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
|
+
export declare class Schedules extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Create a new scheduled agent that runs on a cron schedule. The agent will be
|
|
8
|
+
* triggered automatically based on the cron expression.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const scheduledAgentItem =
|
|
13
|
+
* await client.agent.schedules.create({
|
|
14
|
+
* cron_schedule: '0 9 * * *',
|
|
15
|
+
* name: 'Daily Code Review',
|
|
16
|
+
* prompt:
|
|
17
|
+
* 'Review open pull requests and provide feedback',
|
|
18
|
+
* enabled: true,
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
create(body: ScheduleCreateParams, options?: RequestOptions): APIPromise<ScheduledAgentItem>;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve detailed information about a specific scheduled agent, including its
|
|
25
|
+
* configuration, history, and next scheduled run time.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const scheduledAgentItem =
|
|
30
|
+
* await client.agent.schedules.retrieve('scheduleId');
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
retrieve(scheduleID: string, options?: RequestOptions): APIPromise<ScheduledAgentItem>;
|
|
34
|
+
/**
|
|
35
|
+
* Update an existing scheduled agent's configuration. All fields except
|
|
36
|
+
* agent_config are required.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const scheduledAgentItem =
|
|
41
|
+
* await client.agent.schedules.update('scheduleId', {
|
|
42
|
+
* cron_schedule: 'cron_schedule',
|
|
43
|
+
* enabled: true,
|
|
44
|
+
* name: 'name',
|
|
45
|
+
* prompt: 'prompt',
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
update(scheduleID: string, body: ScheduleUpdateParams, options?: RequestOptions): APIPromise<ScheduledAgentItem>;
|
|
50
|
+
/**
|
|
51
|
+
* Retrieve all scheduled agents accessible to the authenticated user. Results are
|
|
52
|
+
* sorted alphabetically by name.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const schedules = await client.agent.schedules.list();
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
list(options?: RequestOptions): APIPromise<ScheduleListResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Delete a scheduled agent. This will stop all future scheduled runs.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const schedule = await client.agent.schedules.delete(
|
|
66
|
+
* 'scheduleId',
|
|
67
|
+
* );
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
delete(scheduleID: string, options?: RequestOptions): APIPromise<ScheduleDeleteResponse>;
|
|
71
|
+
/**
|
|
72
|
+
* Pause a scheduled agent. The agent will not run until resumed. This sets the
|
|
73
|
+
* enabled flag to false.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const scheduledAgentItem =
|
|
78
|
+
* await client.agent.schedules.pause('scheduleId');
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
pause(scheduleID: string, options?: RequestOptions): APIPromise<ScheduledAgentItem>;
|
|
82
|
+
/**
|
|
83
|
+
* Resume a paused scheduled agent. The agent will start running according to its
|
|
84
|
+
* cron schedule. This sets the enabled flag to true.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const scheduledAgentItem =
|
|
89
|
+
* await client.agent.schedules.resume('scheduleId');
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
resume(scheduleID: string, options?: RequestOptions): APIPromise<ScheduledAgentItem>;
|
|
93
|
+
}
|
|
94
|
+
export interface ScheduledAgentItem {
|
|
95
|
+
/**
|
|
96
|
+
* Unique identifier for the scheduled agent
|
|
97
|
+
*/
|
|
98
|
+
id: string;
|
|
99
|
+
/**
|
|
100
|
+
* Timestamp when the schedule was created (RFC3339)
|
|
101
|
+
*/
|
|
102
|
+
created_at: string;
|
|
103
|
+
/**
|
|
104
|
+
* Cron expression defining when the agent runs (e.g., "0 9 \* \* \*" for daily at
|
|
105
|
+
* 9am UTC)
|
|
106
|
+
*/
|
|
107
|
+
cron_schedule: string;
|
|
108
|
+
/**
|
|
109
|
+
* Whether the schedule is currently active
|
|
110
|
+
*/
|
|
111
|
+
enabled: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Human-readable name for the schedule
|
|
114
|
+
*/
|
|
115
|
+
name: string;
|
|
116
|
+
/**
|
|
117
|
+
* The prompt/instruction for the agent to execute
|
|
118
|
+
*/
|
|
119
|
+
prompt: string;
|
|
120
|
+
/**
|
|
121
|
+
* Timestamp when the schedule was last updated (RFC3339)
|
|
122
|
+
*/
|
|
123
|
+
updated_at: string;
|
|
124
|
+
/**
|
|
125
|
+
* Configuration for an cloud agent run
|
|
126
|
+
*/
|
|
127
|
+
agent_config?: AgentAPI.AmbientAgentConfig;
|
|
128
|
+
created_by?: AgentAPI.UserProfile;
|
|
129
|
+
/**
|
|
130
|
+
* Configuration for a cloud environment used by scheduled agents
|
|
131
|
+
*/
|
|
132
|
+
environment?: AgentAPI.CloudEnvironmentConfig;
|
|
133
|
+
/**
|
|
134
|
+
* Scheduler-derived history metadata for a scheduled agent
|
|
135
|
+
*/
|
|
136
|
+
history?: ScheduledAgentItem.History;
|
|
137
|
+
/**
|
|
138
|
+
* Error message from the last failed spawn attempt, if any
|
|
139
|
+
*/
|
|
140
|
+
last_spawn_error?: string | null;
|
|
141
|
+
/**
|
|
142
|
+
* Ownership scope for a resource (team or personal)
|
|
143
|
+
*/
|
|
144
|
+
scope?: ScheduledAgentItem.Scope;
|
|
145
|
+
updated_by?: AgentAPI.UserProfile;
|
|
146
|
+
}
|
|
147
|
+
export declare namespace ScheduledAgentItem {
|
|
148
|
+
/**
|
|
149
|
+
* Scheduler-derived history metadata for a scheduled agent
|
|
150
|
+
*/
|
|
151
|
+
interface History {
|
|
152
|
+
/**
|
|
153
|
+
* Timestamp of the last successful run (RFC3339)
|
|
154
|
+
*/
|
|
155
|
+
last_ran?: string | null;
|
|
156
|
+
/**
|
|
157
|
+
* Timestamp of the next scheduled run (RFC3339)
|
|
158
|
+
*/
|
|
159
|
+
next_run?: string | null;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Ownership scope for a resource (team or personal)
|
|
163
|
+
*/
|
|
164
|
+
interface Scope {
|
|
165
|
+
/**
|
|
166
|
+
* Type of ownership ("User" for personal, "Team" for team-owned)
|
|
167
|
+
*/
|
|
168
|
+
type: 'User' | 'Team';
|
|
169
|
+
/**
|
|
170
|
+
* UID of the owning user or team
|
|
171
|
+
*/
|
|
172
|
+
uid?: string;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
export interface ScheduleListResponse {
|
|
176
|
+
/**
|
|
177
|
+
* List of scheduled agents
|
|
178
|
+
*/
|
|
179
|
+
schedules: Array<ScheduledAgentItem>;
|
|
180
|
+
}
|
|
181
|
+
export interface ScheduleDeleteResponse {
|
|
182
|
+
/**
|
|
183
|
+
* Whether the deletion was successful
|
|
184
|
+
*/
|
|
185
|
+
success: boolean;
|
|
186
|
+
}
|
|
187
|
+
export interface ScheduleCreateParams {
|
|
188
|
+
/**
|
|
189
|
+
* Cron expression defining when the agent runs (e.g., "0 9 \* \* \*" for daily at
|
|
190
|
+
* 9am UTC)
|
|
191
|
+
*/
|
|
192
|
+
cron_schedule: string;
|
|
193
|
+
/**
|
|
194
|
+
* Human-readable name for the schedule
|
|
195
|
+
*/
|
|
196
|
+
name: string;
|
|
197
|
+
/**
|
|
198
|
+
* The prompt/instruction for the agent to execute
|
|
199
|
+
*/
|
|
200
|
+
prompt: string;
|
|
201
|
+
/**
|
|
202
|
+
* Configuration for an cloud agent run
|
|
203
|
+
*/
|
|
204
|
+
agent_config?: AgentAPI.AmbientAgentConfig;
|
|
205
|
+
/**
|
|
206
|
+
* Whether the schedule should be active immediately
|
|
207
|
+
*/
|
|
208
|
+
enabled?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Whether to create a team-owned schedule. Defaults to true for users on a single
|
|
211
|
+
* team.
|
|
212
|
+
*/
|
|
213
|
+
team?: boolean;
|
|
214
|
+
}
|
|
215
|
+
export interface ScheduleUpdateParams {
|
|
216
|
+
/**
|
|
217
|
+
* Cron expression defining when the agent runs
|
|
218
|
+
*/
|
|
219
|
+
cron_schedule: string;
|
|
220
|
+
/**
|
|
221
|
+
* Whether the schedule should be active
|
|
222
|
+
*/
|
|
223
|
+
enabled: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Human-readable name for the schedule
|
|
226
|
+
*/
|
|
227
|
+
name: string;
|
|
228
|
+
/**
|
|
229
|
+
* The prompt/instruction for the agent to execute
|
|
230
|
+
*/
|
|
231
|
+
prompt: string;
|
|
232
|
+
/**
|
|
233
|
+
* Configuration for an cloud agent run
|
|
234
|
+
*/
|
|
235
|
+
agent_config?: AgentAPI.AmbientAgentConfig;
|
|
236
|
+
}
|
|
237
|
+
export declare namespace Schedules {
|
|
238
|
+
export { type ScheduledAgentItem as ScheduledAgentItem, type ScheduleListResponse as ScheduleListResponse, type ScheduleDeleteResponse as ScheduleDeleteResponse, type ScheduleCreateParams as ScheduleCreateParams, type ScheduleUpdateParams as ScheduleUpdateParams, };
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=schedules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/resources/agent/schedules.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAI5F;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAItF;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,kBAAkB,CAAC;IAIjC;;;;;;;;OAQG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAIhE;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAIxF;;;;;;;;;OASG;IACH,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAInF;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;CAGrF;AAED,MAAM,WAAW,kBAA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ED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC;IAE3C;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC;CAC5C;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Schedules = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
7
|
+
class Schedules extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create a new scheduled agent that runs on a cron schedule. The agent will be
|
|
10
|
+
* triggered automatically based on the cron expression.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const scheduledAgentItem =
|
|
15
|
+
* await client.agent.schedules.create({
|
|
16
|
+
* cron_schedule: '0 9 * * *',
|
|
17
|
+
* name: 'Daily Code Review',
|
|
18
|
+
* prompt:
|
|
19
|
+
* 'Review open pull requests and provide feedback',
|
|
20
|
+
* enabled: true,
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
create(body, options) {
|
|
25
|
+
return this._client.post('/agent/schedules', { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve detailed information about a specific scheduled agent, including its
|
|
29
|
+
* configuration, history, and next scheduled run time.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const scheduledAgentItem =
|
|
34
|
+
* await client.agent.schedules.retrieve('scheduleId');
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
retrieve(scheduleID, options) {
|
|
38
|
+
return this._client.get((0, path_1.path) `/agent/schedules/${scheduleID}`, options);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Update an existing scheduled agent's configuration. All fields except
|
|
42
|
+
* agent_config are required.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const scheduledAgentItem =
|
|
47
|
+
* await client.agent.schedules.update('scheduleId', {
|
|
48
|
+
* cron_schedule: 'cron_schedule',
|
|
49
|
+
* enabled: true,
|
|
50
|
+
* name: 'name',
|
|
51
|
+
* prompt: 'prompt',
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
update(scheduleID, body, options) {
|
|
56
|
+
return this._client.put((0, path_1.path) `/agent/schedules/${scheduleID}`, { body, ...options });
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Retrieve all scheduled agents accessible to the authenticated user. Results are
|
|
60
|
+
* sorted alphabetically by name.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const schedules = await client.agent.schedules.list();
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
list(options) {
|
|
68
|
+
return this._client.get('/agent/schedules', options);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Delete a scheduled agent. This will stop all future scheduled runs.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const schedule = await client.agent.schedules.delete(
|
|
76
|
+
* 'scheduleId',
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
delete(scheduleID, options) {
|
|
81
|
+
return this._client.delete((0, path_1.path) `/agent/schedules/${scheduleID}`, options);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Pause a scheduled agent. The agent will not run until resumed. This sets the
|
|
85
|
+
* enabled flag to false.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const scheduledAgentItem =
|
|
90
|
+
* await client.agent.schedules.pause('scheduleId');
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
pause(scheduleID, options) {
|
|
94
|
+
return this._client.post((0, path_1.path) `/agent/schedules/${scheduleID}/pause`, options);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Resume a paused scheduled agent. The agent will start running according to its
|
|
98
|
+
* cron schedule. This sets the enabled flag to true.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* const scheduledAgentItem =
|
|
103
|
+
* await client.agent.schedules.resume('scheduleId');
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
resume(scheduleID, options) {
|
|
107
|
+
return this._client.post((0, path_1.path) `/agent/schedules/${scheduleID}/resume`, options);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.Schedules = Schedules;
|
|
111
|
+
//# sourceMappingURL=sched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