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:
27
_template-powershell/README.md
Normal file
27
_template-powershell/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# PowerShell 定时任务模板
|
||||
|
||||
PowerShell hello world 示例。业务逻辑写在 `run.ps1`;disable / 锁 / 日志由 cronctl 负责。
|
||||
|
||||
## 依赖
|
||||
|
||||
- Python 3(cronctl)
|
||||
- PowerShell(`pwsh` 或 Windows 自带 `powershell`)
|
||||
|
||||
## 新建任务
|
||||
|
||||
```bash
|
||||
TASK_ID="smallmengya-my-ps-task"
|
||||
CRON_ROOT="/shumengya/project/agent/sproutclaw-cron"
|
||||
cp -a "$CRON_ROOT/_template-powershell" "$CRON_ROOT/$TASK_ID"
|
||||
sed -i "s/_template-powershell/$TASK_ID/g" "$CRON_ROOT/$TASK_ID/schedule.cron"
|
||||
```
|
||||
|
||||
Windows 上可直接:
|
||||
|
||||
```powershell
|
||||
python D:\SmyProjects\AI\sproutclaw-cron\cronctl.py run _template-powershell
|
||||
```
|
||||
|
||||
## 其他语言模板
|
||||
|
||||
见 `_template-javascript/README.md` 中的对照表。
|
||||
2
_template-powershell/run.ps1
Normal file
2
_template-powershell/run.ps1
Normal file
@@ -0,0 +1,2 @@
|
||||
Write-Output "hello world"
|
||||
exit 0
|
||||
8
_template-powershell/schedule.cron
Normal file
8
_template-powershell/schedule.cron
Normal 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 PowerShell hello world 示例
|
||||
# 开关:python3 /shumengya/project/agent/sproutclaw-cron/cronctl.py enable|disable|toggle _template-powershell
|
||||
0 8 * * * root /usr/bin/python3 /shumengya/project/agent/sproutclaw-cron/cronctl.py run _template-powershell >/dev/null 2>&1
|
||||
8
_template-powershell/task.json
Normal file
8
_template-powershell/task.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"runtime": "powershell",
|
||||
"entry": "run.ps1",
|
||||
"tags": [
|
||||
"PowerShell",
|
||||
"模板"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user