@apify/actors-mcp-server 0.15.8-beta.1 → 0.15.8-beta.3
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/README.md +6 -1
- package/dist/const.d.ts +4 -0
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +4 -0
- package/dist/const.js.map +1 -1
- package/dist/index_internals.d.ts +4 -0
- package/dist/index_internals.d.ts.map +1 -1
- package/dist/test_kit/tsconfig.tsbuildinfo +1 -1
- package/dist/tools/registry.d.ts +1 -0
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +5 -0
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/runs/get_actor_run_list.d.ts +2 -1
- package/dist/tools/runs/get_actor_run_list.d.ts.map +1 -1
- package/dist/tools/runs/get_actor_run_list.js +25 -7
- package/dist/tools/runs/get_actor_run_list.js.map +1 -1
- package/dist/tools/schedules/create_schedule.d.ts +6 -0
- package/dist/tools/schedules/create_schedule.d.ts.map +1 -0
- package/dist/tools/schedules/create_schedule.js +85 -0
- package/dist/tools/schedules/create_schedule.js.map +1 -0
- package/dist/tools/schedules/delete_schedule.d.ts +6 -0
- package/dist/tools/schedules/delete_schedule.d.ts.map +1 -0
- package/dist/tools/schedules/delete_schedule.js +59 -0
- package/dist/tools/schedules/delete_schedule.js.map +1 -0
- package/dist/tools/schedules/get_schedule.d.ts +6 -0
- package/dist/tools/schedules/get_schedule.d.ts.map +1 -0
- package/dist/tools/schedules/get_schedule.js +61 -0
- package/dist/tools/schedules/get_schedule.js.map +1 -0
- package/dist/tools/schedules/schedule_helpers.d.ts +86 -0
- package/dist/tools/schedules/schedule_helpers.d.ts.map +1 -0
- package/dist/tools/schedules/schedule_helpers.js +238 -0
- package/dist/tools/schedules/schedule_helpers.js.map +1 -0
- package/dist/tools/schedules/update_schedule.d.ts +6 -0
- package/dist/tools/schedules/update_schedule.d.ts.map +1 -0
- package/dist/tools/schedules/update_schedule.js +91 -0
- package/dist/tools/schedules/update_schedule.js.map +1 -0
- package/dist/tools/structured_output_schemas.d.ts +111 -0
- package/dist/tools/structured_output_schemas.d.ts.map +1 -1
- package/dist/tools/structured_output_schemas.js +74 -0
- package/dist/tools/structured_output_schemas.js.map +1 -1
- package/dist/tools/tasks/task_helpers.d.ts +6 -3
- package/dist/tools/tasks/task_helpers.d.ts.map +1 -1
- package/dist/tools/tasks/task_helpers.js +12 -7
- package/dist/tools/tasks/task_helpers.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/ajv.d.ts.map +1 -1
- package/dist/utils/ajv.js +5 -1
- package/dist/utils/ajv.js.map +1 -1
- package/dist/utils/server-instructions/index.d.ts.map +1 -1
- package/dist/utils/server-instructions/index.js +8 -0
- package/dist/utils/server-instructions/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { ScheduleActions, } from 'apify-client';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { toIsoString } from '../actors/actor_run_response.js';
|
|
4
|
+
import { getResourceByIdOrName, getTaskByIdOrName } from '../tasks/task_helpers.js';
|
|
5
|
+
export const JSON_CONTENT_TYPE = 'application/json; charset=utf-8';
|
|
6
|
+
/**
|
|
7
|
+
* The API caps Actor actions and task actions separately, not as one total
|
|
8
|
+
* (`MAX_ACTORS_PER_SCHEDULER` / `MAX_TASKS_PER_SCHEDULER`), and answers an over-limit list with
|
|
9
|
+
* `too-many-values` (403). Checked here because a schedule is only rejected after every action's
|
|
10
|
+
* Actor or task name has been resolved, one API call each.
|
|
11
|
+
*/
|
|
12
|
+
export const MAX_ACTIONS_PER_TYPE = 10;
|
|
13
|
+
export const CRON_EXPRESSION_DESCRIPTION = 'When the schedule fires, as a standard 5-field cron expression "minute hour day-of-month month day-of-week" ' +
|
|
14
|
+
'evaluated in `timezone`. Examples: "0 9 * * *" daily at 09:00, "0 */6 * * *" every 6 hours, "0 9 * * 1" ' +
|
|
15
|
+
'Mondays at 09:00, "0 0 1 * *" on the 1st of each month. The shortcuts @hourly, @daily, @weekly, @monthly ' +
|
|
16
|
+
'and @yearly fire at a random offset inside their period (@daily somewhere between 00:05 and 06:00), so use ' +
|
|
17
|
+
'them only when the user names no time. An optional leading seconds field is accepted; the minimum interval ' +
|
|
18
|
+
'between runs is 10 seconds.';
|
|
19
|
+
export const cronExpressionSchema = z.string().min(1).max(100);
|
|
20
|
+
/**
|
|
21
|
+
* Only the length caps the API enforces. No `pattern`: the shared AJV instance removes that keyword
|
|
22
|
+
* as a ReDoS mitigation (`utils/ajv.ts`), so a regex here never gates the call — it only fires in the
|
|
23
|
+
* tool body's `parse()`, which throws a raw ZodError that reaches the client as serialised JSON with
|
|
24
|
+
* the pattern in it. The API rejects the same name with a far better message, and the field's
|
|
25
|
+
* `.describe()` text states the rule for the model.
|
|
26
|
+
*/
|
|
27
|
+
const scheduleNameSchema = z.string().min(3).max(63);
|
|
28
|
+
/**
|
|
29
|
+
* One flat action shape for Actor and task actions alike. `buildApiActions` turns it into the API's
|
|
30
|
+
* tagged `RUN_ACTOR` / `RUN_ACTOR_TASK` shape and `fromApiAction` turns it back, so a schedule read
|
|
31
|
+
* pastes into an update unchanged.
|
|
32
|
+
*
|
|
33
|
+
* Deliberately not a z.union: zod renders a union as `anyOf` branches with `additionalProperties:
|
|
34
|
+
* false`, and the shared AJV instance strips unknown properties (`removeAdditional` in utils/ajv.ts),
|
|
35
|
+
* so validating `{ taskId }` against the actorId branch would drop `taskId` before the taskId branch
|
|
36
|
+
* is tried. "Exactly one of actorId / taskId" is therefore checked in `buildApiActions`.
|
|
37
|
+
*/
|
|
38
|
+
export const scheduleActionSchema = z.object({
|
|
39
|
+
actorId: z
|
|
40
|
+
.string()
|
|
41
|
+
.min(1)
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Actor to run: its ID, its name (resolved against your own Actors), or "username/actor-name". Give either actorId or taskId, never both.'),
|
|
44
|
+
taskId: z
|
|
45
|
+
.string()
|
|
46
|
+
.min(1)
|
|
47
|
+
.optional()
|
|
48
|
+
.describe('Task to run: its ID, its name (resolved against your own tasks), or "username/task-name".'),
|
|
49
|
+
input: z
|
|
50
|
+
.looseObject({})
|
|
51
|
+
.optional()
|
|
52
|
+
.describe('For an Actor: the input JSON it runs with. For a task: top-level keys that override the stored task input for this run (shallow merge; a nested object replaces the stored one).'),
|
|
53
|
+
build: z.string().optional().describe('Actor actions only: build tag or number to run, e.g. "latest".'),
|
|
54
|
+
timeoutSecs: z
|
|
55
|
+
.number()
|
|
56
|
+
.int()
|
|
57
|
+
.min(0)
|
|
58
|
+
.optional()
|
|
59
|
+
.describe('Actor actions only: run timeout in seconds; 0 means no timeout.'),
|
|
60
|
+
memoryMbytes: z
|
|
61
|
+
.number()
|
|
62
|
+
.int()
|
|
63
|
+
.positive()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe('Actor actions only: memory limit for the run in megabytes.'),
|
|
66
|
+
restartOnError: z.boolean().optional().describe('Actor actions only: restart the run when it fails.'),
|
|
67
|
+
});
|
|
68
|
+
/** Every schedule field the tools write, all optional; the create tool tightens `cronExpression` and `isEnabled`. */
|
|
69
|
+
export const scheduleFieldsSchema = z.object({
|
|
70
|
+
name: scheduleNameSchema
|
|
71
|
+
.optional()
|
|
72
|
+
.describe('Name of the schedule, unique within the account: 3-63 characters, letters, digits and dashes only (e.g. "insta-daily"). Generated when omitted.'),
|
|
73
|
+
title: z
|
|
74
|
+
.string()
|
|
75
|
+
.max(40)
|
|
76
|
+
.optional()
|
|
77
|
+
.describe('Human-readable title, at most 40 characters. Generated from the name when omitted.'),
|
|
78
|
+
description: z.string().max(5000).optional().describe('What the schedule is for.'),
|
|
79
|
+
cronExpression: cronExpressionSchema.optional().describe(CRON_EXPRESSION_DESCRIPTION),
|
|
80
|
+
timezone: z
|
|
81
|
+
.string()
|
|
82
|
+
.min(1)
|
|
83
|
+
.optional()
|
|
84
|
+
.describe('IANA time zone the cron expression is evaluated in, e.g. "Europe/Prague", "America/New_York", "Asia/Tokyo". Default "UTC". Take it from the user\'s wording ("9am Prague time").'),
|
|
85
|
+
isEnabled: z
|
|
86
|
+
.boolean()
|
|
87
|
+
.optional()
|
|
88
|
+
.describe('Whether the schedule fires. false pauses it without losing its configuration.'),
|
|
89
|
+
isExclusive: z
|
|
90
|
+
.boolean()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe('If true (the default), an action is skipped while its previous scheduled run is still running.'),
|
|
93
|
+
});
|
|
94
|
+
/** Fetches a schedule by ID, name, or `username/name`. */
|
|
95
|
+
export async function getScheduleByIdOrName(client, idOrName) {
|
|
96
|
+
return getResourceByIdOrName(idOrName, async (safeId) => client.schedule(safeId).get());
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Resolves the Actor an action runs to its ID, which is all the schedule API accepts.
|
|
100
|
+
*
|
|
101
|
+
* Deliberately NOT `getActorDefinitionCached`: a bare name is caller-relative (`~name` means "my own
|
|
102
|
+
* Actor called name"), while `actorDefinitionCache` is process-wide and serves any cached public
|
|
103
|
+
* Actor to any caller. Keying it by `~name` let one tenant's public Actor answer another tenant's
|
|
104
|
+
* bare name — scheduling the wrong Actor, or succeeding where the answer is not-found. Every other
|
|
105
|
+
* caller of that cache passes an absolute key (an ID or `username/name`), so the fix is to keep
|
|
106
|
+
* caller-relative names out of it rather than to weaken the cache.
|
|
107
|
+
*
|
|
108
|
+
* That lookup is also the wrong shape for scheduling: it fetches the Actor's default build, and a
|
|
109
|
+
* never-built Actor schedules fine but has no build, so `defaultBuild()` raises `unknown-build-tag`
|
|
110
|
+
* (403). `getActorDefinition` maps only 404/400 to null, so that error surfaces to the user as a
|
|
111
|
+
* failed create. `actor(id).get()` resolves the ID without touching a build. Covered by
|
|
112
|
+
* `tests/unit/tools.schedule_actor_resolution.test.ts`.
|
|
113
|
+
*/
|
|
114
|
+
async function resolveActorId(client, idOrName) {
|
|
115
|
+
const actor = await getResourceByIdOrName(idOrName, async (safeId) => client.actor(safeId).get());
|
|
116
|
+
return actor === null || actor === void 0 ? void 0 : actor.id;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Converts the flat tool actions to the API shape. Actor and task references are resolved to IDs
|
|
120
|
+
* here because the API looks both up by ID only and would answer `schedule-actor-not-found` for a
|
|
121
|
+
* name. The first problem is returned as `{ error }` so the tool can answer before any write.
|
|
122
|
+
*/
|
|
123
|
+
export async function buildApiActions(client, actions) {
|
|
124
|
+
// Counted before resolving anything: an over-limit list costs one lookup per action otherwise.
|
|
125
|
+
// Actions naming both kinds or neither are counted in neither and reported by the loop below.
|
|
126
|
+
const taskActionCount = actions.filter((action) => action.taskId !== undefined).length;
|
|
127
|
+
const actorActionCount = actions.filter((action) => action.taskId === undefined && action.actorId !== undefined).length;
|
|
128
|
+
if (actorActionCount > MAX_ACTIONS_PER_TYPE) {
|
|
129
|
+
return { error: `A schedule runs at most ${MAX_ACTIONS_PER_TYPE} Actors; ${actorActionCount} were given.` };
|
|
130
|
+
}
|
|
131
|
+
if (taskActionCount > MAX_ACTIONS_PER_TYPE) {
|
|
132
|
+
return { error: `A schedule runs at most ${MAX_ACTIONS_PER_TYPE} tasks; ${taskActionCount} were given.` };
|
|
133
|
+
}
|
|
134
|
+
const apiActions = [];
|
|
135
|
+
for (const [index, { actorId, taskId, input, build, timeoutSecs, memoryMbytes, restartOnError },] of actions.entries()) {
|
|
136
|
+
if (taskId !== undefined) {
|
|
137
|
+
if (actorId !== undefined) {
|
|
138
|
+
return { error: `Action ${index + 1} names both an Actor and a task; give either actorId or taskId.` };
|
|
139
|
+
}
|
|
140
|
+
const task = await getTaskByIdOrName(client, taskId);
|
|
141
|
+
if (!task)
|
|
142
|
+
return { error: `Task ${taskId} was not found.` };
|
|
143
|
+
apiActions.push({
|
|
144
|
+
type: ScheduleActions.RunActorTask,
|
|
145
|
+
actorTaskId: task.id,
|
|
146
|
+
// apify-client types `input` as a string, but the API rejects a string and requires an object.
|
|
147
|
+
...(input && { input: input }),
|
|
148
|
+
});
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
if (actorId === undefined) {
|
|
152
|
+
return { error: `Action ${index + 1} names nothing to run; give actorId or taskId.` };
|
|
153
|
+
}
|
|
154
|
+
const resolvedActorId = await resolveActorId(client, actorId);
|
|
155
|
+
if (!resolvedActorId)
|
|
156
|
+
return { error: `Actor ${actorId} was not found.` };
|
|
157
|
+
const runOptions = {
|
|
158
|
+
...(build !== undefined && { build }),
|
|
159
|
+
...(timeoutSecs !== undefined && { timeoutSecs }),
|
|
160
|
+
...(memoryMbytes !== undefined && { memoryMbytes }),
|
|
161
|
+
...(restartOnError !== undefined && { restartOnError }),
|
|
162
|
+
};
|
|
163
|
+
apiActions.push({
|
|
164
|
+
type: ScheduleActions.RunActor,
|
|
165
|
+
actorId: resolvedActorId,
|
|
166
|
+
...(input && { runInput: { body: JSON.stringify(input), contentType: JSON_CONTENT_TYPE } }),
|
|
167
|
+
// apify-client types every run option as required; the API accepts any subset.
|
|
168
|
+
...(Object.keys(runOptions).length > 0 && { runOptions: runOptions }),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
return { actions: apiActions };
|
|
172
|
+
}
|
|
173
|
+
/** A JSON body comes back as the object the tool sent; anything else stays a string. */
|
|
174
|
+
function parseRunInputBody({ body, contentType }) {
|
|
175
|
+
if (!(contentType === null || contentType === void 0 ? void 0 : contentType.startsWith('application/json')))
|
|
176
|
+
return body;
|
|
177
|
+
try {
|
|
178
|
+
return JSON.parse(body);
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
return body;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/** Inverse of `buildApiActions`: the API's tagged action as the flat shape the tools accept. */
|
|
185
|
+
function fromApiAction(action) {
|
|
186
|
+
if (action.type === ScheduleActions.RunActorTask) {
|
|
187
|
+
// The API returns the stored task input parsed, despite the client's `string` type.
|
|
188
|
+
return {
|
|
189
|
+
taskId: action.actorTaskId,
|
|
190
|
+
...(action.input !== undefined && action.input !== null && { input: action.input }),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
const { runInput, runOptions } = action;
|
|
194
|
+
return {
|
|
195
|
+
actorId: action.actorId,
|
|
196
|
+
...((runInput === null || runInput === void 0 ? void 0 : runInput.body) !== undefined && { input: parseRunInputBody(runInput) }),
|
|
197
|
+
...((runOptions === null || runOptions === void 0 ? void 0 : runOptions.build) !== undefined && { build: runOptions.build }),
|
|
198
|
+
...((runOptions === null || runOptions === void 0 ? void 0 : runOptions.timeoutSecs) !== undefined && { timeoutSecs: runOptions.timeoutSecs }),
|
|
199
|
+
...((runOptions === null || runOptions === void 0 ? void 0 : runOptions.memoryMbytes) !== undefined && { memoryMbytes: runOptions.memoryMbytes }),
|
|
200
|
+
...((runOptions === null || runOptions === void 0 ? void 0 : runOptions.restartOnError) !== undefined && { restartOnError: runOptions.restartOnError }),
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
/** The schedule subset returned by the create, get and update tools. */
|
|
204
|
+
export function buildScheduleResult(schedule) {
|
|
205
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
206
|
+
return {
|
|
207
|
+
scheduleId: schedule.id,
|
|
208
|
+
name: schedule.name,
|
|
209
|
+
title: (_a = schedule.title) !== null && _a !== void 0 ? _a : null,
|
|
210
|
+
description: (_b = schedule.description) !== null && _b !== void 0 ? _b : null,
|
|
211
|
+
cronExpression: schedule.cronExpression,
|
|
212
|
+
timezone: schedule.timezone,
|
|
213
|
+
isEnabled: schedule.isEnabled,
|
|
214
|
+
isExclusive: schedule.isExclusive,
|
|
215
|
+
// The client turns every `*At` field into a Date although its types promise strings, and the
|
|
216
|
+
// declared output schema promises ISO strings. nextRunAt is null while the schedule is disabled.
|
|
217
|
+
nextRunAt: (_c = toIsoString(schedule.nextRunAt)) !== null && _c !== void 0 ? _c : null,
|
|
218
|
+
lastRunAt: (_d = toIsoString(schedule.lastRunAt)) !== null && _d !== void 0 ? _d : null,
|
|
219
|
+
createdAt: (_e = toIsoString(schedule.createdAt)) !== null && _e !== void 0 ? _e : null,
|
|
220
|
+
modifiedAt: (_f = toIsoString(schedule.modifiedAt)) !== null && _f !== void 0 ? _f : null,
|
|
221
|
+
actions: ((_g = schedule.actions) !== null && _g !== void 0 ? _g : []).map(fromApiAction),
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/** Cadence and state for a summary; a disabled schedule has no next run, so it never prints "null". */
|
|
225
|
+
export function formatScheduleState({ actions, cronExpression, timezone, isEnabled, nextRunAt, }) {
|
|
226
|
+
const count = `${actions.length} action${actions.length === 1 ? '' : 's'}`;
|
|
227
|
+
const state = isEnabled
|
|
228
|
+
? `enabled, next run at ${nextRunAt !== null && nextRunAt !== void 0 ? nextRunAt : 'unknown'}`
|
|
229
|
+
: 'disabled — it will not run until enabled';
|
|
230
|
+
return `${count} on "${cronExpression}" (${timezone}); ${state}`;
|
|
231
|
+
}
|
|
232
|
+
/** The Actor and task references exactly as the caller gave them, for the create and update summaries. */
|
|
233
|
+
export function formatRequestedActions(actions) {
|
|
234
|
+
return actions
|
|
235
|
+
.map(({ actorId, taskId }) => (taskId !== undefined ? `task ${taskId}` : `Actor ${actorId}`))
|
|
236
|
+
.join(', ');
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=schedule_helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule_helpers.js","sourceRoot":"","sources":["../../../src/tools/schedules/schedule_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,eAAe,GAIlB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAQpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,iCAAiC,CAAC;AAEnE;;;;;GAKG;AACH,MAAM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,CAAC,UAAU,CAAC,mCAAI,IAAI;QACpD,OAAO,EAAE,CAAC,MAAA,QAAQ,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC;KACvD,CAAC;AACN,CAAC;AAGD,uGAAuG;AACvG,MAAM,UAAU,mBAAmB,CAAC,EAChC,OAAO,EACP,cAAc,EACd,QAAQ,EACR,SAAS,EACT,SAAS,GACI;IACb,MAAM,KAAK,GAAG,GAAG,OAAO,CAAC,MAAM,UAAU,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IAC3E,MAAM,KAAK,GAAG,SAAS;QACnB,CAAC,CAAC,wBAAwB,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,SAAS,EAAE;QAClD,CAAC,CAAC,0CAA0C,CAAC;IACjD,OAAO,GAAG,KAAK,QAAQ,cAAc,MAAM,QAAQ,MAAM,KAAK,EAAE,CAAC;AACrE,CAAC;AAED,0GAA0G;AAC1G,MAAM,UAAU,sBAAsB,CAAC,OAA8B;IACjE,OAAO,OAAO;SACT,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;SAC5F,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update_schedule.d.ts","sourceRoot":"","sources":["../../../src/tools/schedules/update_schedule.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA4C,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AAwD3G;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,SAsDlB,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HELPER_TOOLS } from '../../const.js';
|
|
3
|
+
import { ALL_TOOLS_PRESENT, TOOL_TYPE } from '../../types.js';
|
|
4
|
+
import { compileSchema } from '../../utils/ajv.js';
|
|
5
|
+
import { respondOk, respondUserError } from '../../utils/mcp.js';
|
|
6
|
+
import { scheduleOutputSchema } from '../structured_output_schemas.js';
|
|
7
|
+
import { isAmbiguousResourceId, toSafeResourceId } from '../tasks/task_helpers.js';
|
|
8
|
+
import { buildApiActions, buildScheduleResult, formatRequestedActions, formatScheduleState, getScheduleByIdOrName, MAX_ACTIONS_PER_TYPE, scheduleActionSchema, scheduleFieldsSchema, } from './schedule_helpers.js';
|
|
9
|
+
const updateScheduleArgs = z.object({
|
|
10
|
+
scheduleId: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1)
|
|
13
|
+
.describe('The schedule to update: its ID, its name (resolved against your own schedules), or "username/schedule-name" for a schedule owned by someone else.'),
|
|
14
|
+
...scheduleFieldsSchema.shape,
|
|
15
|
+
actions: z
|
|
16
|
+
.array(scheduleActionSchema)
|
|
17
|
+
.min(1)
|
|
18
|
+
.max(20)
|
|
19
|
+
.optional()
|
|
20
|
+
.describe(`Replaces ALL stored actions, Actor and task actions alike: send every action to keep, the ones left out are deleted. Omit to leave the actions unchanged. At most ${MAX_ACTIONS_PER_TYPE} Actor entries and ${MAX_ACTIONS_PER_TYPE} task entries, counted separately.`),
|
|
21
|
+
});
|
|
22
|
+
function buildDescription({ hasTool }) {
|
|
23
|
+
return `Update a schedule: its cron expression or time zone, enable or disable it, rename it, or replace its actions.
|
|
24
|
+
Fields you omit keep their stored value. "Pause", "stop" or "turn off" mean \`isEnabled: false\`; "resume" or
|
|
25
|
+
"turn on" mean \`isEnabled: true\` — never delete a schedule to pause it.
|
|
26
|
+
\`actions\` replaces all stored actions, Actor and task actions alike: to add or remove one, ${hasTool(HELPER_TOOLS.SCHEDULE_GET)
|
|
27
|
+
? `read the schedule with ${HELPER_TOOLS.SCHEDULE_GET}`
|
|
28
|
+
: 'read the schedule first'}, copy its \`actions\`, edit the copy, and send the whole array. Replacing actions restarts exclusivity tracking,
|
|
29
|
+
so a run already in progress is not counted.
|
|
30
|
+
|
|
31
|
+
USAGE:
|
|
32
|
+
- Use to change when a schedule fires, to pause or resume it, or to change what it runs.
|
|
33
|
+
|
|
34
|
+
USAGE EXAMPLES:
|
|
35
|
+
- user_input: Pause my schedule insta-daily
|
|
36
|
+
- user_input: Change schedule insta-daily to run every 6 hours
|
|
37
|
+
- user_input: Add my task weekly-report to schedule insta-daily`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* https://docs.apify.com/api/v2/schedule-put
|
|
41
|
+
*/
|
|
42
|
+
export const updateSchedule = Object.freeze({
|
|
43
|
+
type: TOOL_TYPE.INTERNAL,
|
|
44
|
+
name: HELPER_TOOLS.SCHEDULE_UPDATE,
|
|
45
|
+
title: 'Update schedule',
|
|
46
|
+
description: buildDescription(ALL_TOOLS_PRESENT),
|
|
47
|
+
buildDescription,
|
|
48
|
+
inputSchema: z.toJSONSchema(updateScheduleArgs),
|
|
49
|
+
outputSchema: scheduleOutputSchema,
|
|
50
|
+
ajvValidate: compileSchema(z.toJSONSchema(updateScheduleArgs)),
|
|
51
|
+
annotations: {
|
|
52
|
+
title: 'Update schedule',
|
|
53
|
+
readOnlyHint: false,
|
|
54
|
+
destructiveHint: false,
|
|
55
|
+
idempotentHint: true,
|
|
56
|
+
openWorldHint: false,
|
|
57
|
+
},
|
|
58
|
+
call: async (toolArgs) => {
|
|
59
|
+
const { args, apifyClient: client } = toolArgs;
|
|
60
|
+
const { scheduleId, actions, name, title, description, cronExpression, timezone, isEnabled, isExclusive } = updateScheduleArgs.parse(args);
|
|
61
|
+
// The API merges the fields it receives, so no pre-read is needed to keep the rest — only an
|
|
62
|
+
// ambiguous scheduleId (an ID-shaped name) has to be pinned to the real ID by lookup.
|
|
63
|
+
let resolvedScheduleId = toSafeResourceId(scheduleId);
|
|
64
|
+
if (isAmbiguousResourceId(scheduleId)) {
|
|
65
|
+
const stored = await getScheduleByIdOrName(client, scheduleId);
|
|
66
|
+
if (!stored)
|
|
67
|
+
return respondUserError(`Schedule ${scheduleId} was not found.`);
|
|
68
|
+
resolvedScheduleId = stored.id;
|
|
69
|
+
}
|
|
70
|
+
const built = actions ? await buildApiActions(client, actions) : undefined;
|
|
71
|
+
if (built && 'error' in built)
|
|
72
|
+
return respondUserError(built.error);
|
|
73
|
+
const update = {
|
|
74
|
+
...(name && { name }),
|
|
75
|
+
...(title !== undefined && { title }),
|
|
76
|
+
...(description !== undefined && { description }),
|
|
77
|
+
...(cronExpression && { cronExpression }),
|
|
78
|
+
// The client's `Timezone` union has no runtime list to validate against; the API validates the name.
|
|
79
|
+
...(timezone && { timezone: timezone }),
|
|
80
|
+
...(isEnabled !== undefined && { isEnabled }),
|
|
81
|
+
...(isExclusive !== undefined && { isExclusive }),
|
|
82
|
+
...(built && { actions: built.actions }),
|
|
83
|
+
};
|
|
84
|
+
const schedule = await client.schedule(resolvedScheduleId).update(update);
|
|
85
|
+
const result = buildScheduleResult(schedule);
|
|
86
|
+
const replaced = actions ? `, now running ${formatRequestedActions(actions)}` : '';
|
|
87
|
+
const summary = `Updated schedule "${result.name}" (ID: ${result.scheduleId})${replaced}: ${formatScheduleState(result)}.`;
|
|
88
|
+
return respondOk([JSON.stringify(result), summary], { structuredContent: result });
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=update_schedule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update_schedule.js","sourceRoot":"","sources":["../../../src/tools/schedules/update_schedule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MA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,CAAC;YACrB,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC;YACrC,GAAG,CAAC,WAAW,KAAK,SAAS,IAAI,EAAE,WAAW,EAAE,CAAC;YACjD,GAAG,CAAC,cAAc,IAAI,EAAE,cAAc,EAAE,CAAC;YACzC,qGAAqG;YACrG,GAAG,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,QAA4B,EAAE,CAAC;YAC3D,GAAG,CAAC,SAAS,KAAK,SAAS,IAAI,EAAE,SAAS,EAAE,CAAC;YAC7C,GAAG,CAAC,WAAW,KAAK,SAAS,IAAI,EAAE,WAAW,EAAE,CAAC;YACjD,GAAG,CAAC,KAAK,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;SAC3C,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAE1E,MAAM,MAAM,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAiB,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnF,MAAM,OAAO,GAAG,qBAAqB,MAAM,CAAC,IAAI,UAAU,MAAM,CAAC,UAAU,IAAI,QAAQ,KAAK,mBAAmB,CAC3G,MAAM,CACT,GAAG,CAAC;QACL,OAAO,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC,CAAC;IACvF,CAAC;CACK,CAAC,CAAC"}
|
|
@@ -1257,6 +1257,117 @@ export declare const actorTaskOutputSchema: {
|
|
|
1257
1257
|
};
|
|
1258
1258
|
required: string[];
|
|
1259
1259
|
};
|
|
1260
|
+
/** Schema shared by the schedule create, get and update tools. */
|
|
1261
|
+
export declare const scheduleOutputSchema: {
|
|
1262
|
+
type: "object";
|
|
1263
|
+
properties: {
|
|
1264
|
+
scheduleId: {
|
|
1265
|
+
type: string;
|
|
1266
|
+
description: string;
|
|
1267
|
+
};
|
|
1268
|
+
name: {
|
|
1269
|
+
type: string;
|
|
1270
|
+
description: string;
|
|
1271
|
+
};
|
|
1272
|
+
title: {
|
|
1273
|
+
type: string[];
|
|
1274
|
+
description: string;
|
|
1275
|
+
};
|
|
1276
|
+
description: {
|
|
1277
|
+
type: string[];
|
|
1278
|
+
description: string;
|
|
1279
|
+
};
|
|
1280
|
+
cronExpression: {
|
|
1281
|
+
type: string;
|
|
1282
|
+
description: string;
|
|
1283
|
+
};
|
|
1284
|
+
timezone: {
|
|
1285
|
+
type: string;
|
|
1286
|
+
description: string;
|
|
1287
|
+
};
|
|
1288
|
+
isEnabled: {
|
|
1289
|
+
type: string;
|
|
1290
|
+
description: string;
|
|
1291
|
+
};
|
|
1292
|
+
isExclusive: {
|
|
1293
|
+
type: string;
|
|
1294
|
+
description: string;
|
|
1295
|
+
};
|
|
1296
|
+
nextRunAt: {
|
|
1297
|
+
type: string[];
|
|
1298
|
+
description: string;
|
|
1299
|
+
};
|
|
1300
|
+
lastRunAt: {
|
|
1301
|
+
type: string[];
|
|
1302
|
+
description: string;
|
|
1303
|
+
};
|
|
1304
|
+
createdAt: {
|
|
1305
|
+
type: string[];
|
|
1306
|
+
description: string;
|
|
1307
|
+
};
|
|
1308
|
+
modifiedAt: {
|
|
1309
|
+
type: string[];
|
|
1310
|
+
description: string;
|
|
1311
|
+
};
|
|
1312
|
+
actions: {
|
|
1313
|
+
type: string;
|
|
1314
|
+
items: {
|
|
1315
|
+
type: "object";
|
|
1316
|
+
properties: {
|
|
1317
|
+
actorId: {
|
|
1318
|
+
type: string;
|
|
1319
|
+
description: string;
|
|
1320
|
+
};
|
|
1321
|
+
taskId: {
|
|
1322
|
+
type: string;
|
|
1323
|
+
description: string;
|
|
1324
|
+
};
|
|
1325
|
+
input: {
|
|
1326
|
+
type: string[];
|
|
1327
|
+
description: string;
|
|
1328
|
+
};
|
|
1329
|
+
build: {
|
|
1330
|
+
type: string;
|
|
1331
|
+
description: string;
|
|
1332
|
+
};
|
|
1333
|
+
timeoutSecs: {
|
|
1334
|
+
type: string;
|
|
1335
|
+
description: string;
|
|
1336
|
+
};
|
|
1337
|
+
memoryMbytes: {
|
|
1338
|
+
type: string;
|
|
1339
|
+
description: string;
|
|
1340
|
+
};
|
|
1341
|
+
restartOnError: {
|
|
1342
|
+
type: string;
|
|
1343
|
+
description: string;
|
|
1344
|
+
};
|
|
1345
|
+
};
|
|
1346
|
+
};
|
|
1347
|
+
description: string;
|
|
1348
|
+
};
|
|
1349
|
+
};
|
|
1350
|
+
required: string[];
|
|
1351
|
+
};
|
|
1352
|
+
/** Schema for delete-schedule. */
|
|
1353
|
+
export declare const scheduleDeleteOutputSchema: {
|
|
1354
|
+
type: "object";
|
|
1355
|
+
properties: {
|
|
1356
|
+
scheduleId: {
|
|
1357
|
+
type: string;
|
|
1358
|
+
description: string;
|
|
1359
|
+
};
|
|
1360
|
+
name: {
|
|
1361
|
+
type: string;
|
|
1362
|
+
description: string;
|
|
1363
|
+
};
|
|
1364
|
+
deleted: {
|
|
1365
|
+
type: string;
|
|
1366
|
+
description: string;
|
|
1367
|
+
};
|
|
1368
|
+
};
|
|
1369
|
+
required: string[];
|
|
1370
|
+
};
|
|
1260
1371
|
/**
|
|
1261
1372
|
* Schema for get-actor-run-log. The log API returns plain text, so the schema wraps it in a single field.
|
|
1262
1373
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured_output_schemas.d.ts","sourceRoot":"","sources":["../../src/tools/structured_output_schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA6DH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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}
|
|
@@ -362,6 +362,80 @@ export const actorTaskOutputSchema = {
|
|
|
362
362
|
},
|
|
363
363
|
required: ['taskId', 'actorId', 'name', 'title', 'description', 'publishedAt', 'publicConfig', 'input'],
|
|
364
364
|
};
|
|
365
|
+
/** One schedule action, in the same flat shape the schedule tools accept as input. */
|
|
366
|
+
const scheduleActionOutputSchema = {
|
|
367
|
+
type: 'object',
|
|
368
|
+
properties: {
|
|
369
|
+
actorId: { type: 'string', description: 'ID of the Actor this action runs (Actor actions only)' },
|
|
370
|
+
taskId: { type: 'string', description: 'ID of the task this action runs (task actions only)' },
|
|
371
|
+
input: {
|
|
372
|
+
type: ['object', 'array', 'string', 'number', 'boolean', 'null'],
|
|
373
|
+
description: 'The Actor input, or the overrides applied on top of the stored task input; secret fields are ' +
|
|
374
|
+
'encrypted placeholders. A non-JSON Actor input body is returned as a string.',
|
|
375
|
+
},
|
|
376
|
+
build: { type: 'string', description: 'Actor build tag or number (Actor actions only)' },
|
|
377
|
+
timeoutSecs: { type: 'number', description: 'Run timeout in seconds (Actor actions only)' },
|
|
378
|
+
memoryMbytes: { type: 'number', description: 'Run memory limit in megabytes (Actor actions only)' },
|
|
379
|
+
restartOnError: { type: 'boolean', description: 'Restart the run when it fails (Actor actions only)' },
|
|
380
|
+
},
|
|
381
|
+
};
|
|
382
|
+
/** Schema shared by the schedule create, get and update tools. */
|
|
383
|
+
export const scheduleOutputSchema = {
|
|
384
|
+
type: 'object',
|
|
385
|
+
properties: {
|
|
386
|
+
scheduleId: { type: 'string', description: 'ID of the schedule' },
|
|
387
|
+
name: { type: 'string', description: 'Name of the schedule' },
|
|
388
|
+
title: { type: ['string', 'null'], description: 'Human-readable title of the schedule' },
|
|
389
|
+
description: { type: ['string', 'null'], description: 'Description of the schedule' },
|
|
390
|
+
cronExpression: { type: 'string', description: 'When the schedule fires, as a cron expression' },
|
|
391
|
+
timezone: { type: 'string', description: 'Time zone the cron expression is evaluated in' },
|
|
392
|
+
isEnabled: { type: 'boolean', description: 'Whether the schedule fires' },
|
|
393
|
+
isExclusive: {
|
|
394
|
+
type: 'boolean',
|
|
395
|
+
description: 'Whether an action is skipped while its previous scheduled run is still running',
|
|
396
|
+
},
|
|
397
|
+
nextRunAt: {
|
|
398
|
+
type: ['string', 'null'],
|
|
399
|
+
description: 'Next firing time (ISO 8601); null while the schedule is disabled',
|
|
400
|
+
},
|
|
401
|
+
lastRunAt: {
|
|
402
|
+
type: ['string', 'null'],
|
|
403
|
+
description: 'Last firing time (ISO 8601); null when the schedule has not fired yet',
|
|
404
|
+
},
|
|
405
|
+
createdAt: { type: ['string', 'null'], description: 'When the schedule was created (ISO 8601)' },
|
|
406
|
+
modifiedAt: { type: ['string', 'null'], description: 'When the schedule was last changed (ISO 8601)' },
|
|
407
|
+
actions: {
|
|
408
|
+
type: 'array',
|
|
409
|
+
items: scheduleActionOutputSchema,
|
|
410
|
+
description: 'What the schedule runs, in the same shape the schedule tools accept as input',
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
required: [
|
|
414
|
+
'scheduleId',
|
|
415
|
+
'name',
|
|
416
|
+
'title',
|
|
417
|
+
'description',
|
|
418
|
+
'cronExpression',
|
|
419
|
+
'timezone',
|
|
420
|
+
'isEnabled',
|
|
421
|
+
'isExclusive',
|
|
422
|
+
'nextRunAt',
|
|
423
|
+
'lastRunAt',
|
|
424
|
+
'createdAt',
|
|
425
|
+
'modifiedAt',
|
|
426
|
+
'actions',
|
|
427
|
+
],
|
|
428
|
+
};
|
|
429
|
+
/** Schema for delete-schedule. */
|
|
430
|
+
export const scheduleDeleteOutputSchema = {
|
|
431
|
+
type: 'object',
|
|
432
|
+
properties: {
|
|
433
|
+
scheduleId: { type: 'string', description: 'ID of the deleted schedule' },
|
|
434
|
+
name: { type: 'string', description: 'Name of the deleted schedule' },
|
|
435
|
+
deleted: { type: 'boolean', description: 'Always true; the schedule no longer exists' },
|
|
436
|
+
},
|
|
437
|
+
required: ['scheduleId', 'name', 'deleted'],
|
|
438
|
+
};
|
|
365
439
|
/**
|
|
366
440
|
* Schema for get-actor-run-log. The log API returns plain text, so the schema wraps it in a single field.
|
|
367
441
|
*/
|