Scheduled scripts
Poll something in the background without spending tokens.
What it does
- Runs a TypeScript script on an interval in the background, with no model calls while it stays quiet.
- Keeps state between runs, so a script can count, remember the last result, or stop itself.
- Wakes the agent only when the script returns a prompt, and delivers that prompt as a new message.
- Shows the schedule status in a timer button next to the prompt box.
- The agent writes and tests the script for you and asks for your confirmation before it schedules anything.
How to use
- Ask the agent for a recurring check, for example:
Check main CI every 5 minutes. Wake me only if it fails. - The agent writes a script (usually in
.agents/scripts/) and replies with the proposed schedule: script path, title, interval and initial state. - Read the script. It will run with your user permissions. Reply to confirm, or ask for changes.
- After you confirm, the agent test-runs the script once and, if that works, schedules it.
- Watch the timer button in the prompt toolbar. When the script returns a prompt, it appears as
[Scheduled Task: <script path>]followed by the text, and the agent responds.
The script exports a main function that receives state and sessionId and returns the next state, plus optionally prompt (wake the agent), error (warning, keep running) or stop (end the schedule).
Controls & gestures
Prompt toolbar
| Where | Gesture | Result |
|---|---|---|
| Timer button | hover | Tooltip: Schedule: <script> (<status> · <n> runs) |
Chat
| Where | Gesture | Result |
|---|---|---|
dsh-schedule-script command card | none | Shows the run summary; a warning or fatal error appears as a line under it |
Listing and stopping schedules
| Where | Gesture | Result |
|---|---|---|
| Automation tasks page, task | select, then Pause, Resume, Run now or Delete task in the actions menu | Pauses, resumes, runs once now, or removes the task; stopped script schedules do not run again |
| Chat | ask the agent | The agent can also pause or delete the schedule for you |
The status popover shows the script path, total runs, last duration, last run time, and any error. It is read only.
Settings you might change
None needed; defaults work. The minimum interval is 60 seconds and a script run times out after 30 seconds unless the schedule sets another limit. Details are in the package README.
Works with
- Requires the DSH schedule service; without it the plugin does not load and there is nothing to schedule.
- Needs a Node version that runs
.tsfiles natively. - Related: YAML workflows run multi-step routines you start yourself, this plugin runs checks on a timer.
Good to know
- Trust: scripts run as a normal child process with your user permissions, your environment and the session working directory. There is no sandbox. Read every script before you confirm it.
- One script schedule per session. A script that throws, has an invalid result or times out is stopped and its schedule deleted.
- The confirmation is a chat reply, not a dialog. The agent is told to propose the parameters and wait; the scheduling tools only become available on the turn after the skill loads.
- Model Experience: a skill catalog entry is always present and two tools appear once the skill loads. Quiet runs cost no tokens; a wake-up costs the prompt text.
Install
sh
dsh plugin --profile <web|desktop> add @lukstei/dsh-schedule-script