@amaster.ai/pi-task-scheduler 0.1.2-beta.4 → 0.1.2-beta.40
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 +95 -28
- package/dist/extension.d.ts +5 -2
- package/dist/extension.d.ts.map +1 -1
- package/dist/extension.js +140 -235
- package/dist/extension.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -6
- package/dist/index.js.map +1 -1
- package/dist/json-file.d.ts +3 -0
- package/dist/json-file.d.ts.map +1 -0
- package/dist/json-file.js +48 -0
- package/dist/json-file.js.map +1 -0
- package/dist/stores.d.ts +26 -0
- package/dist/stores.d.ts.map +1 -0
- package/dist/stores.js +148 -0
- package/dist/stores.js.map +1 -0
- package/dist/tools.d.ts +4 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +174 -0
- package/dist/tools.js.map +1 -0
- package/package.json +15 -10
- package/preview.png +0 -0
package/dist/tools.js
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { Type } from 'typebox';
|
|
2
|
+
import { resolveScheduledTaskDefinition, } from './index.js';
|
|
3
|
+
function textResult(text) {
|
|
4
|
+
return { content: [{ type: 'text', text }], details: undefined };
|
|
5
|
+
}
|
|
6
|
+
function formatTaskSummary(task) {
|
|
7
|
+
return {
|
|
8
|
+
id: task.id,
|
|
9
|
+
name: task.name,
|
|
10
|
+
type: task.type,
|
|
11
|
+
schedule: task.schedule,
|
|
12
|
+
enabled: task.enabled,
|
|
13
|
+
lastStatus: task.lastStatus ?? 'pending',
|
|
14
|
+
nextRunAt: task.nextRunAt,
|
|
15
|
+
runCount: task.runCount,
|
|
16
|
+
prompt: task.prompt.length > 100 ? `${task.prompt.slice(0, 100)}…` : task.prompt,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const taskTypeSchema = Type.Union([
|
|
20
|
+
Type.Literal('cron'),
|
|
21
|
+
Type.Literal('once'),
|
|
22
|
+
Type.Literal('interval'),
|
|
23
|
+
]);
|
|
24
|
+
export function createSchedulerTools(scheduler) {
|
|
25
|
+
return [
|
|
26
|
+
{
|
|
27
|
+
name: 'scheduler_create',
|
|
28
|
+
label: 'Scheduler',
|
|
29
|
+
description: 'Schedule a prompt to be executed automatically at a future time or on a recurring basis. Supports cron expressions, one-time (ISO timestamp or relative like "+10m"), and interval (e.g. "30s", "5m", "1h"). Use this when the user wants something to run later, repeatedly, or on a timer.',
|
|
30
|
+
promptSnippet: 'Schedule prompts to run automatically via cron, one-time delay, or fixed interval.',
|
|
31
|
+
parameters: Type.Object({
|
|
32
|
+
type: taskTypeSchema,
|
|
33
|
+
schedule: Type.String({
|
|
34
|
+
description: 'Schedule expression. Cron: "0 9 * * 1-5"; Once: ISO timestamp or "+10m"; Interval: "30s", "5m", "1h".',
|
|
35
|
+
}),
|
|
36
|
+
prompt: Type.String({ description: 'The prompt to execute when triggered.' }),
|
|
37
|
+
name: Type.Optional(Type.String({ description: 'Human-readable name for this scheduled prompt.' })),
|
|
38
|
+
description: Type.Optional(Type.String({ description: 'Description of this scheduled prompt.' })),
|
|
39
|
+
enabled: Type.Optional(Type.Boolean({ description: 'Whether this scheduled prompt is enabled. Default true.' })),
|
|
40
|
+
timeoutMs: Type.Optional(Type.Number({
|
|
41
|
+
description: 'Maximum execution time in milliseconds. Defaults to 30 minutes.',
|
|
42
|
+
})),
|
|
43
|
+
}),
|
|
44
|
+
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
45
|
+
try {
|
|
46
|
+
const definition = resolveScheduledTaskDefinition({
|
|
47
|
+
type: params.type,
|
|
48
|
+
schedule: params.schedule,
|
|
49
|
+
});
|
|
50
|
+
const input = {
|
|
51
|
+
...definition,
|
|
52
|
+
prompt: params.prompt,
|
|
53
|
+
sessionId: ctx.sessionManager?.getSessionId?.() ?? 'unknown',
|
|
54
|
+
model: {
|
|
55
|
+
provider: ctx.model?.provider ?? 'anthropic',
|
|
56
|
+
model: ctx.model?.id ?? 'unknown',
|
|
57
|
+
},
|
|
58
|
+
toolPolicyProfile: 'workspace-write',
|
|
59
|
+
enabled: params.enabled !== false,
|
|
60
|
+
...(params.name ? { name: params.name } : {}),
|
|
61
|
+
...(params.description ? { description: params.description } : {}),
|
|
62
|
+
...(typeof params.timeoutMs === 'number'
|
|
63
|
+
? { timeoutMs: params.timeoutMs }
|
|
64
|
+
: {}),
|
|
65
|
+
};
|
|
66
|
+
const task = await scheduler.create(input);
|
|
67
|
+
return textResult(JSON.stringify(formatTaskSummary(task), null, 2));
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return textResult(`Failed to create task: ${error instanceof Error ? error.message : String(error)}`);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'scheduler_list',
|
|
76
|
+
label: 'Scheduler',
|
|
77
|
+
description: 'List all scheduled prompts with their status and next run time.',
|
|
78
|
+
promptSnippet: 'List all scheduled prompts.',
|
|
79
|
+
parameters: Type.Object({}),
|
|
80
|
+
async execute() {
|
|
81
|
+
const tasks = await scheduler.list();
|
|
82
|
+
if (tasks.length === 0) {
|
|
83
|
+
return textResult('No scheduled tasks.');
|
|
84
|
+
}
|
|
85
|
+
const summary = tasks.map(formatTaskSummary);
|
|
86
|
+
return textResult(JSON.stringify(summary, null, 2));
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'scheduler_get',
|
|
91
|
+
label: 'Scheduler',
|
|
92
|
+
description: 'Get detailed information about a scheduled prompt, including its schedule and run history.',
|
|
93
|
+
parameters: Type.Object({
|
|
94
|
+
taskId: Type.String({ description: 'The scheduled-prompt ID to query.' }),
|
|
95
|
+
}),
|
|
96
|
+
async execute(_toolCallId, params) {
|
|
97
|
+
const task = await scheduler.get(params.taskId);
|
|
98
|
+
if (!task) {
|
|
99
|
+
return textResult(`Task not found: ${params.taskId}`);
|
|
100
|
+
}
|
|
101
|
+
return textResult(JSON.stringify(task, null, 2));
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'scheduler_update',
|
|
106
|
+
label: 'Scheduler',
|
|
107
|
+
description: 'Update a scheduled prompt. Can change schedule, prompt text, name, or enable/disable.',
|
|
108
|
+
parameters: Type.Object({
|
|
109
|
+
taskId: Type.String({ description: 'The scheduled-prompt ID to update.' }),
|
|
110
|
+
type: Type.Optional(taskTypeSchema),
|
|
111
|
+
schedule: Type.Optional(Type.String({ description: 'New schedule expression.' })),
|
|
112
|
+
prompt: Type.Optional(Type.String({ description: 'New prompt.' })),
|
|
113
|
+
name: Type.Optional(Type.String({ description: 'New name.' })),
|
|
114
|
+
description: Type.Optional(Type.String({ description: 'New description.' })),
|
|
115
|
+
enabled: Type.Optional(Type.Boolean({ description: 'Enable or disable.' })),
|
|
116
|
+
}),
|
|
117
|
+
async execute(_toolCallId, params) {
|
|
118
|
+
const { taskId, type, schedule, ...rest } = params;
|
|
119
|
+
const update = { ...rest };
|
|
120
|
+
if (type !== undefined || schedule !== undefined) {
|
|
121
|
+
try {
|
|
122
|
+
const existing = await scheduler.get(taskId);
|
|
123
|
+
if (!existing) {
|
|
124
|
+
return textResult(`Task not found: ${taskId}`);
|
|
125
|
+
}
|
|
126
|
+
const definition = resolveScheduledTaskDefinition({
|
|
127
|
+
type: (type ?? existing.type),
|
|
128
|
+
schedule: schedule ?? existing.schedule,
|
|
129
|
+
});
|
|
130
|
+
Object.assign(update, definition);
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
return textResult(`Invalid schedule: ${error instanceof Error ? error.message : String(error)}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const task = await scheduler.update(taskId, update);
|
|
137
|
+
if (!task) {
|
|
138
|
+
return textResult(`Task not found: ${taskId}`);
|
|
139
|
+
}
|
|
140
|
+
return textResult(JSON.stringify(formatTaskSummary(task), null, 2));
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'scheduler_delete',
|
|
145
|
+
label: 'Scheduler',
|
|
146
|
+
description: 'Delete a scheduled prompt.',
|
|
147
|
+
parameters: Type.Object({
|
|
148
|
+
taskId: Type.String({ description: 'The scheduled-prompt ID to delete.' }),
|
|
149
|
+
}),
|
|
150
|
+
async execute(_toolCallId, params) {
|
|
151
|
+
const taskId = params.taskId;
|
|
152
|
+
const deleted = await scheduler.delete(taskId);
|
|
153
|
+
return textResult(deleted ? `Deleted task: ${taskId}` : `Task not found: ${taskId}`);
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'scheduler_run_now',
|
|
158
|
+
label: 'Scheduler',
|
|
159
|
+
description: 'Trigger immediate execution of a scheduled prompt, ignoring its schedule.',
|
|
160
|
+
parameters: Type.Object({
|
|
161
|
+
taskId: Type.String({ description: 'The scheduled-prompt ID to run immediately.' }),
|
|
162
|
+
}),
|
|
163
|
+
async execute(_toolCallId, params) {
|
|
164
|
+
const taskId = params.taskId;
|
|
165
|
+
const task = await scheduler.runNow(taskId);
|
|
166
|
+
if (!task) {
|
|
167
|
+
return textResult(`Task not found: ${taskId}`);
|
|
168
|
+
}
|
|
169
|
+
return textResult(`Triggered: ${task.name ?? task.id}`);
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EACL,8BAA8B,GAK/B,MAAM,YAAY,CAAC;AAEpB,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAA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I,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1D,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amaster.ai/pi-task-scheduler",
|
|
3
|
-
"version": "0.1.2-beta.
|
|
3
|
+
"version": "0.1.2-beta.40",
|
|
4
4
|
"description": "Pi extension for cron-based scheduled task management with LLM-callable tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -20,21 +20,31 @@
|
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
21
21
|
"default": "./dist/index.js"
|
|
22
22
|
},
|
|
23
|
+
"./stores": {
|
|
24
|
+
"types": "./dist/stores.d.ts",
|
|
25
|
+
"default": "./dist/stores.js"
|
|
26
|
+
},
|
|
23
27
|
"./extension": {
|
|
24
28
|
"types": "./dist/extension.d.ts",
|
|
25
29
|
"default": "./dist/extension.js"
|
|
26
30
|
},
|
|
31
|
+
"./tools": {
|
|
32
|
+
"types": "./dist/tools.d.ts",
|
|
33
|
+
"default": "./dist/tools.js"
|
|
34
|
+
},
|
|
27
35
|
"./package.json": {
|
|
28
36
|
"default": "./package.json"
|
|
29
37
|
}
|
|
30
38
|
},
|
|
31
39
|
"pi": {
|
|
40
|
+
"image": "https://raw.githubusercontent.com/TGYD-helige/pi/master/packages/pi-task-scheduler/preview.png",
|
|
32
41
|
"extensions": [
|
|
33
42
|
"./dist/index.js"
|
|
34
43
|
]
|
|
35
44
|
},
|
|
36
45
|
"files": [
|
|
37
46
|
"dist",
|
|
47
|
+
"preview.png",
|
|
38
48
|
"README.md"
|
|
39
49
|
],
|
|
40
50
|
"publishConfig": {
|
|
@@ -47,29 +57,24 @@
|
|
|
47
57
|
},
|
|
48
58
|
"dependencies": {
|
|
49
59
|
"croner": "^10.0.1",
|
|
50
|
-
"@amaster.ai/pi-shared": "0.1.2-beta.
|
|
60
|
+
"@amaster.ai/pi-shared": "0.1.2-beta.40"
|
|
51
61
|
},
|
|
52
62
|
"peerDependencies": {
|
|
53
63
|
"@earendil-works/pi-coding-agent": ">=0.74.0",
|
|
54
|
-
"typebox": "*"
|
|
55
|
-
"@amaster.ai/pi-storage": "0.1.2-beta.4"
|
|
64
|
+
"typebox": "*"
|
|
56
65
|
},
|
|
57
66
|
"peerDependenciesMeta": {
|
|
58
67
|
"@earendil-works/pi-coding-agent": {
|
|
59
68
|
"optional": true
|
|
60
69
|
},
|
|
61
|
-
"@amaster.ai/pi-storage": {
|
|
62
|
-
"optional": true
|
|
63
|
-
},
|
|
64
70
|
"typebox": {
|
|
65
71
|
"optional": true
|
|
66
72
|
}
|
|
67
73
|
},
|
|
68
74
|
"devDependencies": {
|
|
69
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
75
|
+
"@earendil-works/pi-coding-agent": "0.80.3",
|
|
70
76
|
"typebox": "*",
|
|
71
|
-
"vitest": "^4.0.0"
|
|
72
|
-
"@amaster.ai/pi-storage": "0.1.2-beta.4"
|
|
77
|
+
"vitest": "^4.0.0"
|
|
73
78
|
},
|
|
74
79
|
"scripts": {
|
|
75
80
|
"build": "tsc -b",
|
package/preview.png
ADDED
|
Binary file
|