feat: 多语言任务、WebUI 增强与 Agent MCP 集成

重构 lib 为扁平模块并支持 Windows schtasks;新增 JS/Bash/PowerShell 模板、WebUI 调度编辑,以及 Cursor Skill 与 MCP 工具供 Agent 管理定时任务。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-24 21:45:25 +08:00
parent 6c2db2dfa3
commit c10cacd5c6
59 changed files with 3989 additions and 800 deletions

22
_template-bash/README.md Normal file
View File

@@ -0,0 +1,22 @@
# Bash 定时任务模板
Bash hello world 示例。业务逻辑写在 `run.sh`disable / 锁 / 日志由 cronctl 负责。
## 依赖
- Python 3cronctl
- BashLinux 自带Windows 需 Git Bash 或 WSL
## 新建任务
```bash
TASK_ID="smallmengya-my-bash-task"
CRON_ROOT="/shumengya/project/agent/sproutclaw-cron"
cp -a "$CRON_ROOT/_template-bash" "$CRON_ROOT/$TASK_ID"
sed -i "s/_template-bash/$TASK_ID/g" "$CRON_ROOT/$TASK_ID/schedule.cron"
chmod +x "$CRON_ROOT/$TASK_ID/run.sh"
```
## 其他语言模板
`_template-javascript/README.md` 中的对照表。

2
_template-bash/run.sh Normal file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
echo "hello world"

View File

@@ -0,0 +1,8 @@
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOME=/root
CRON_MAIL_ENABLED=1
# 每天 08:00 Bash hello world 示例
# 开关python3 /shumengya/project/agent/sproutclaw-cron/cronctl.py enable|disable|toggle _template-bash
0 8 * * * root /usr/bin/python3 /shumengya/project/agent/sproutclaw-cron/cronctl.py run _template-bash >/dev/null 2>&1

8
_template-bash/task.json Normal file
View File

@@ -0,0 +1,8 @@
{
"runtime": "bash",
"entry": "run.sh",
"tags": [
"Bash",
"模板"
]
}