@hhuangpanda/dsh-automation 0.0.0-stage → 0.3.34
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/LICENSE +22 -0
- package/README.md +133 -2
- package/README.zh.md +134 -0
- package/cordis.patch.yml +3 -0
- package/docs/images/automation-overview-en.png +0 -0
- package/docs/images/automation-overview-zh.png +0 -0
- package/docs/reference.md +55 -0
- package/docs/reference.zh.md +55 -0
- package/lib/agent-configuration.d.ts +27 -0
- package/lib/agent-configuration.js +217 -0
- package/lib/api.d.ts +5 -0
- package/lib/api.js +253 -0
- package/lib/client/AutomationPanel.d.ts +9 -0
- package/lib/client/EmptyState.d.ts +10 -0
- package/lib/client/ModelSelection.d.ts +17 -0
- package/lib/client/ScheduleSection.d.ts +32 -0
- package/lib/client/SchedulerHealth.d.ts +10 -0
- package/lib/client/SkillPicker.d.ts +15 -0
- package/lib/client/TaskDetail.d.ts +34 -0
- package/lib/client/TaskEditor.d.ts +38 -0
- package/lib/client/TaskRow.d.ts +12 -0
- package/lib/client/editor-layout.d.ts +20 -0
- package/lib/client/i18n.d.ts +15 -0
- package/lib/client/icons.d.ts +30 -0
- package/lib/client/index.d.ts +6 -0
- package/lib/client/locales.d.ts +260 -0
- package/lib/client/rrule-editor.d.ts +15 -0
- package/lib/client/session-selection.d.ts +4 -0
- package/lib/client/shared.d.ts +77 -0
- package/lib/client/store.d.ts +40 -0
- package/lib/client.js +3014 -0
- package/lib/controller.d.ts +36 -0
- package/lib/controller.js +154 -0
- package/lib/domain.d.ts +44 -0
- package/lib/domain.js +473 -0
- package/lib/errors.d.ts +14 -0
- package/lib/errors.js +16 -0
- package/lib/im-delivery.d.ts +30 -0
- package/lib/im-delivery.js +69 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.js +92 -0
- package/lib/recurrence.d.ts +14 -0
- package/lib/recurrence.js +203 -0
- package/lib/runner.d.ts +27 -0
- package/lib/runner.js +295 -0
- package/lib/runtime-marker.d.ts +3 -0
- package/lib/runtime-marker.js +2 -0
- package/lib/scheduler.d.ts +58 -0
- package/lib/scheduler.js +287 -0
- package/lib/store.d.ts +14 -0
- package/lib/store.js +108 -0
- package/lib/tool-configuration.d.ts +8 -0
- package/lib/tool-configuration.js +220 -0
- package/lib/tool-support.d.ts +67 -0
- package/lib/tool-support.js +47 -0
- package/lib/tools.d.ts +6 -0
- package/lib/tools.js +140 -0
- package/lib/types.d.ts +465 -0
- package/lib/types.js +99 -0
- package/lib/validation.d.ts +34 -0
- package/lib/validation.js +99 -0
- package/package.json +163 -4
- package/screenshots.json +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 alpacachen
|
|
4
|
+
Copyright (c) 2026 hhuangpanda
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,134 @@
|
|
|
1
|
-
|
|
1
|
+
> **A fork of [alpacachen/dsh-automation](https://github.com/alpacachen/dsh-automation) that adds support for DSH 0.2.0-rc.2.**
|
|
2
|
+
>
|
|
3
|
+
> If you used the original plugin, disable it before installing this one, or tasks will run twice.
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="docs/images/automation-overview-en.png" alt="dsh-automation: natural-language schedules, session continuity, models and skills, permissions, message delivery, and failure protection" width="100%">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
|
|
11
|
+
<p>
|
|
12
|
+
<strong>English</strong> · <a href="README.zh.md">简体中文</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p>
|
|
16
|
+
<a href="https://www.npmjs.com/package/@hhuangpanda/dsh-automation"><img alt="npm version" src="https://img.shields.io/npm/v/@hhuangpanda/dsh-automation?color=5b8def&label=npm"></a>
|
|
17
|
+
<a href="https://github.com/hhuangpanda/dsh-automation/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/hhuangpanda/dsh-automation/actions/workflows/ci.yml/badge.svg"></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p>
|
|
21
|
+
<a href="#get-started">Get started</a> / <a href="#demo">Demo</a> / <a href="docs/reference.md">Reference</a> / <a href="https://github.com/hhuangpanda/dsh-automation/issues">Report an issue</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p>Release checks. Dependency reviews. Daily handoffs.<br>Set the schedule. Let your Agent take it from there.</p>
|
|
25
|
+
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<table>
|
|
29
|
+
<tr>
|
|
30
|
+
<td width="33%" valign="top">
|
|
31
|
+
<h3>🗓 Work on a schedule</h3>
|
|
32
|
+
<p>One-time or recurring, across time zones.<br>Set dates, intervals, and limits visually.</p>
|
|
33
|
+
</td>
|
|
34
|
+
<td width="33%" valign="top">
|
|
35
|
+
<h3>💬 Keep the conversation</h3>
|
|
36
|
+
<p>Start fresh by default, or confirm<br>an existing session to keep its context.</p>
|
|
37
|
+
</td>
|
|
38
|
+
<td width="33%" valign="top">
|
|
39
|
+
<h3>🧩 Choose the capabilities</h3>
|
|
40
|
+
<p>Pick an Agent, model, and skills per task.<br>You set permissions and confirm changes.</p>
|
|
41
|
+
</td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr>
|
|
44
|
+
<td width="33%" valign="top">
|
|
45
|
+
<h3>🔎 Follow every run</h3>
|
|
46
|
+
<p>See summaries, duration, and errors.<br>Open past sessions to review the work.</p>
|
|
47
|
+
</td>
|
|
48
|
+
<td width="33%" valign="top">
|
|
49
|
+
<h3>📨 Bring results to chat</h3>
|
|
50
|
+
<p>Optionally deliver through <a href="https://github.com/xmanrui/dsh-im">dsh-im</a>.<br>Sidebar alerts for failures or every run.</p>
|
|
51
|
+
</td>
|
|
52
|
+
<td width="33%" valign="top">
|
|
53
|
+
<h3>⏸ Stay in control</h3>
|
|
54
|
+
<p>Run now, pause, resume, or stop.<br>Optionally auto-pause after 3 failures.</p>
|
|
55
|
+
</td>
|
|
56
|
+
</tr>
|
|
57
|
+
</table>
|
|
58
|
+
|
|
59
|
+
## Get started
|
|
60
|
+
|
|
61
|
+
Targets DSH **0.1.7-rc.2**, **0.2.0-rc.1**, and **0.2.0-rc.2**. Tested only on 0.2.0-rc.2.
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
dsh plugin --profile web add @hhuangpanda/dsh-automation
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Restart `dsh web`, open a workspace, and make your first request:
|
|
68
|
+
|
|
69
|
+
> Every weekday at 6 PM in Asia/Shanghai, summarize today's changes, next actions, and blockers. Read only; don't change files. Show me the configuration before creating it.
|
|
70
|
+
|
|
71
|
+
The Agent previews the schedule, permissions, and other settings. **It creates the task only after you confirm.** Or choose New automation in the sidebar and start from a built-in template.
|
|
72
|
+
|
|
73
|
+
Plans change: just say “Move the daily handoff to 7 PM.” To receive results in chat, select a bot and saved target under Edit → Message delivery. [Set up message delivery ↗](https://github.com/xmanrui/dsh-im/blob/main/PROACTIVE_DELIVERY.en.md)
|
|
74
|
+
|
|
75
|
+
> **Keep DSH running** for scheduled tasks. Runs have a 1-hour limit by default, and interactive approvals are never granted automatically. [How execution works →](docs/reference.md)
|
|
76
|
+
|
|
77
|
+
## Demo
|
|
78
|
+
|
|
79
|
+
Copy an example to your Agent and adjust the time or scope. **Every task requires a configuration preview and your confirmation before creation.** Fill in missing essentials, such as log paths, before saving the task.
|
|
80
|
+
|
|
81
|
+
<table>
|
|
82
|
+
<tr>
|
|
83
|
+
<td width="100%" valign="top">
|
|
84
|
+
<h3>🌙 A handoff before you log off</h3>
|
|
85
|
+
<p><sub>Recurring · Read only · Notify after each run</sub></p>
|
|
86
|
+
<blockquote>Create a daily handoff for weekdays at 18:00 in Asia/Shanghai. Read today's commits and uncommitted workspace changes. Report completed work, next actions, and blockers with evidence; say so if nothing changed. Do not modify files. Notify me after each run.</blockquote>
|
|
87
|
+
</td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td width="100%" valign="top">
|
|
91
|
+
<h3>🚀 A check before the release</h3>
|
|
92
|
+
<p><sub>One-time · A verdict with evidence</sub></p>
|
|
93
|
+
<blockquote>Create a one-time release check for tomorrow at 09:00 in Asia/Shanghai. Read the workspace's version configuration, release docs, and uncommitted changes. Report Ready or Blocked with evidence, and list anything not verified. Do not modify files or publish anything.</blockquote>
|
|
94
|
+
</td>
|
|
95
|
+
</tr>
|
|
96
|
+
<tr>
|
|
97
|
+
<td width="100%" valign="top">
|
|
98
|
+
<h3>📦 A Monday dependency review</h3>
|
|
99
|
+
<p><sub>Recurring · Choose models and skills</sub></p>
|
|
100
|
+
<blockquote>Create a dependency review for Mondays at 09:30 in Asia/Shanghai. First list the available models and skills for me to choose. Inspect manifests and lockfiles, consult accessible official release notes, and report upgrade priorities, compatibility risks, and sources. Do not install or upgrade anything.</blockquote>
|
|
101
|
+
</td>
|
|
102
|
+
</tr>
|
|
103
|
+
<tr>
|
|
104
|
+
<td width="100%" valign="top">
|
|
105
|
+
<h3>💬 Keep an investigation moving</h3>
|
|
106
|
+
<p><sub>Pinned session · Retain context</sub></p>
|
|
107
|
+
<blockquote>Create an investigation follow-up for weekdays at 10:00 in Asia/Shanghai, pinned to our investigation session in this workspace. Show me the target session for confirmation first. Read the logs I specify, build on our existing conclusions, and report new evidence and next steps. Do not repeat the entire history or modify files.</blockquote>
|
|
108
|
+
</td>
|
|
109
|
+
</tr>
|
|
110
|
+
<tr>
|
|
111
|
+
<td width="100%" valign="top">
|
|
112
|
+
<h3>📨 A weekly report delivered to chat</h3>
|
|
113
|
+
<p><sub>Recurring · Optional dsh-im delivery</sub></p>
|
|
114
|
+
<blockquote>Create a weekly report for Fridays at 17:00 in Asia/Shanghai. Read this week's workspace commits and project docs. Produce a short chat-ready briefing: completed work, unresolved issues, and suggested next steps. Do not modify files or invent progress; flag missing evidence.</blockquote>
|
|
115
|
+
</td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td width="100%" valign="top">
|
|
119
|
+
<h3>📝 Keep project docs up to date</h3>
|
|
120
|
+
<p><sub>Recurring · Controlled file changes</sub></p>
|
|
121
|
+
<blockquote>Create a docs-maintenance task for the first day of each month at 10:00 in Asia/Shanghai. Check README commands against the current package.json and update only outdated command instructions. Do not change application code, commit, or push. Let me confirm the model, skills, and workspace-write permissions before creation. Summarize the edits after each run.</blockquote>
|
|
122
|
+
</td>
|
|
123
|
+
</tr>
|
|
124
|
+
</table>
|
|
125
|
+
|
|
126
|
+
Dependency reviews need working web tools on the Host. For report delivery, configure dsh-im on the same Host, then select and confirm a bot and saved target under Edit → Message delivery; creating the task alone does not enable delivery. Docs maintenance requires write permissions.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
<p align="center">
|
|
131
|
+
<a href="docs/reference.md">Execution rules & tool reference</a> ·
|
|
132
|
+
<a href="https://github.com/hhuangpanda/dsh-automation/issues">Feedback & ideas</a> ·
|
|
133
|
+
<a href="LICENSE">MIT License</a>
|
|
134
|
+
</p>
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
> **这是 [alpacachen/dsh-automation](https://github.com/alpacachen/dsh-automation) 的 fork,新增对 DSH 0.2.0-rc.2 的支持。**
|
|
2
|
+
>
|
|
3
|
+
> 如果你用过原版插件,请先停用它再安装本插件,否则任务会重复执行。
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="docs/images/automation-overview-zh.png" alt="dsh-automation:自然语言调度、会话延续、模型与技能、权限控制、消息投递、失败保护" width="100%">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
|
|
11
|
+
<p>
|
|
12
|
+
<strong>简体中文</strong> · <a href="README.md">English</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p>
|
|
16
|
+
<a href="https://www.npmjs.com/package/@hhuangpanda/dsh-automation"><img alt="npm version" src="https://img.shields.io/npm/v/@hhuangpanda/dsh-automation?color=5b8def&label=npm"></a>
|
|
17
|
+
<a href="https://github.com/hhuangpanda/dsh-automation/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/hhuangpanda/dsh-automation/actions/workflows/ci.yml/badge.svg"></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p>
|
|
21
|
+
<a href="#开始使用">开始使用</a> / <a href="#demo">Demo</a> / <a href="docs/reference.zh.md">使用参考</a> / <a href="https://github.com/hhuangpanda/dsh-automation/issues">反馈问题</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p>发布检查、依赖巡检、每日交接。<br>安排一次,让 Agent 按计划接手。</p>
|
|
25
|
+
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<table>
|
|
29
|
+
<tr>
|
|
30
|
+
<td width="33%" valign="top">
|
|
31
|
+
<h3>🗓 按时开工</h3>
|
|
32
|
+
<p>单次或周期,跨时区安排。<br>日期、间隔和次数,可视化设置。</p>
|
|
33
|
+
</td>
|
|
34
|
+
<td width="33%" valign="top">
|
|
35
|
+
<h3>💬 接着上次聊</h3>
|
|
36
|
+
<p>默认新建会话,也可确认绑定<br>已有对话,延续工作区上下文。</p>
|
|
37
|
+
</td>
|
|
38
|
+
<td width="33%" valign="top">
|
|
39
|
+
<h3>🧩 配好再出发</h3>
|
|
40
|
+
<p>Agent、模型、技能按任务选择。<br>权限由你设定,变更需确认。</p>
|
|
41
|
+
</td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr>
|
|
44
|
+
<td width="33%" valign="top">
|
|
45
|
+
<h3>🔎 每次都有据可查</h3>
|
|
46
|
+
<p>摘要、耗时、错误一眼查看。<br>打开历史会话,回看执行过程。</p>
|
|
47
|
+
</td>
|
|
48
|
+
<td width="33%" valign="top">
|
|
49
|
+
<h3>📨 结果送到你手边</h3>
|
|
50
|
+
<p>可选接入 <a href="https://github.com/xmanrui/dsh-im">dsh-im</a>,投递到聊天工具。<br>侧边栏通知可选仅失败或每次完成。</p>
|
|
51
|
+
</td>
|
|
52
|
+
<td width="33%" valign="top">
|
|
53
|
+
<h3>⏸ 随时接手</h3>
|
|
54
|
+
<p>立即运行、暂停、恢复或停止。<br>可选连续失败 3 次后自动暂停。</p>
|
|
55
|
+
</td>
|
|
56
|
+
</tr>
|
|
57
|
+
</table>
|
|
58
|
+
|
|
59
|
+
## 开始使用
|
|
60
|
+
|
|
61
|
+
适配 DSH **0.1.7-rc.2**、**0.2.0-rc.1** 和 **0.2.0-rc.2**,仅在 0.2.0-rc.2 上测试过。
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
dsh plugin --profile web add @hhuangpanda/dsh-automation
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
重启 `dsh web`,在工作区里发出第一条安排:
|
|
68
|
+
|
|
69
|
+
> 每个工作日 18:00(Asia/Shanghai)整理今天的改动、待办和阻塞项。只读,不改文件。创建前先让我确认配置。
|
|
70
|
+
|
|
71
|
+
Agent 会预览计划、权限等配置,**你确认后才创建**。也可以在侧边栏「自动化任务」点「新建自动化」,从内置模板开始。
|
|
72
|
+
|
|
73
|
+
计划有变,继续说「把每日交接改到晚上 7 点」;想发到聊天工具,在「编辑 → 消息投递」选好机器人和已保存目标即可。[设置消息投递 ↗](https://github.com/xmanrui/dsh-im/blob/main/PROACTIVE_DELIVERY.md)
|
|
74
|
+
|
|
75
|
+
> **保持 DSH 在线**,任务才能按计划执行。每次运行默认最多 1 小时,交互批准不会自动通过。[了解运行规则 →](docs/reference.zh.md)
|
|
76
|
+
|
|
77
|
+
## Demo
|
|
78
|
+
|
|
79
|
+
复制一个例子给 Agent,按需改时间和范围。**所有任务都先预览配置、经你确认后创建**;没有明确指定的日志路径或其他必要信息,先补齐再创建。
|
|
80
|
+
|
|
81
|
+
<table>
|
|
82
|
+
<tr>
|
|
83
|
+
<td width="100%" valign="top">
|
|
84
|
+
<h3>🌙 下班前,交接已经写好</h3>
|
|
85
|
+
<p><sub>周期任务 · 只读 · 每次完成通知</sub></p>
|
|
86
|
+
<blockquote>创建一个每个工作日 18:00(Asia/Shanghai)的每日交接任务。只读检查工作区当天的提交和未提交改动,输出已完成、待办、阻塞项,并注明依据;没有改动就如实说明。每次完成后通知我。</blockquote>
|
|
87
|
+
</td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td width="100%" valign="top">
|
|
91
|
+
<h3>🚀 发布前,先过一遍清单</h3>
|
|
92
|
+
<p><sub>单次任务 · 有结论、有依据</sub></p>
|
|
93
|
+
<blockquote>创建一个明天 09:00(Asia/Shanghai)执行一次的发布检查。只读检查当前工作区的版本配置、发布文档和未提交改动,给出“可发布”或“存在阻塞”及依据;未验证的项单列,不要替我发布。</blockquote>
|
|
94
|
+
</td>
|
|
95
|
+
</tr>
|
|
96
|
+
<tr>
|
|
97
|
+
<td width="100%" valign="top">
|
|
98
|
+
<h3>📦 周一,看看依赖该不该动</h3>
|
|
99
|
+
<p><sub>周期任务 · 模型 / 技能选择</sub></p>
|
|
100
|
+
<blockquote>创建一个每周一 09:30(Asia/Shanghai)的依赖巡检任务。先列出当前可用模型和技能供我选择。运行时检查依赖清单与锁文件,结合可访问的官方更新说明给出升级优先级、兼容风险和来源;只报告,不安装或升级。</blockquote>
|
|
101
|
+
</td>
|
|
102
|
+
</tr>
|
|
103
|
+
<tr>
|
|
104
|
+
<td width="100%" valign="top">
|
|
105
|
+
<h3>💬 排障有后续,接着原来的线索查</h3>
|
|
106
|
+
<p><sub>固定会话 · 延续上下文</sub></p>
|
|
107
|
+
<blockquote>创建一个每个工作日 10:00(Asia/Shanghai)的排障跟进任务,绑定当前工作区中我们这次排障的会话。先展示目标会话让我确认。每次只读检查我指定的日志,结合已有结论列出新增证据和下一步,不重复输出整段历史。</blockquote>
|
|
108
|
+
</td>
|
|
109
|
+
</tr>
|
|
110
|
+
<tr>
|
|
111
|
+
<td width="100%" valign="top">
|
|
112
|
+
<h3>📨 周五,把周报送到聊天工具</h3>
|
|
113
|
+
<p><sub>周期任务 · 可选 dsh-im 投递</sub></p>
|
|
114
|
+
<blockquote>创建一个每周五 17:00(Asia/Shanghai)的周报任务。只读整理工作区本周的提交和项目文档,输出适合发到聊天工具的简报:本周完成、遗留问题、下周建议。不要编造进展,缺少依据时明确说明。</blockquote>
|
|
115
|
+
</td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td width="100%" valign="top">
|
|
119
|
+
<h3>📝 每月,让项目文档跟上代码</h3>
|
|
120
|
+
<p><sub>周期任务 · 受控文件修改</sub></p>
|
|
121
|
+
<blockquote>创建一个每月 1 日 10:00(Asia/Shanghai)的文档维护任务。核对 README 与当前 package.json 的命令,只更新 README 中已过时的命令说明,不改业务代码、不提交、不推送。创建前让我确认模型、技能及允许写入工作区的权限;完成后给出修改摘要。</blockquote>
|
|
122
|
+
</td>
|
|
123
|
+
</tr>
|
|
124
|
+
</table>
|
|
125
|
+
|
|
126
|
+
依赖巡检需要 Host 上有可用的联网工具。周报推送需先配置同 Host 的 dsh-im,再在任务的「编辑 → 消息投递」选择机器人和已保存目标并确认;创建任务本身不会开启投递。文档维护需要允许写入的权限。
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
<p align="center">
|
|
131
|
+
<a href="docs/reference.zh.md">运行规则与工具参考</a> ·
|
|
132
|
+
<a href="https://github.com/hhuangpanda/dsh-automation/issues">问题与建议</a> ·
|
|
133
|
+
<a href="LICENSE">MIT License</a>
|
|
134
|
+
</p>
|
package/cordis.patch.yml
ADDED
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Automation reference
|
|
2
|
+
|
|
3
|
+
[Back to overview](../README.md) · [简体中文](reference.zh.md)
|
|
4
|
+
|
|
5
|
+
## A few things to know before running tasks
|
|
6
|
+
|
|
7
|
+
- DSH must be running to execute tasks. After a restart, each eligible task catches up with only its latest missed occurrence; paused occurrences are skipped.
|
|
8
|
+
- Each plugin instance runs one automation at a time. Runs have a 1-hour limit by default, configurable through `maxRunDurationMs`.
|
|
9
|
+
- Pausing affects future scheduling; a started run continues. Stopping the current run, running now, or choosing Resume & run leaves the original schedule unchanged.
|
|
10
|
+
- Interactive approvals are never granted automatically. Unattended runs may wait until timeout.
|
|
11
|
+
- Pinned sessions keep their context and Agent/model configuration, apply task permissions, and do not reload skills. Changing the binding after creation requires the UI. A busy or unavailable target fails the run without creating a replacement session.
|
|
12
|
+
- Failed runs can be retried manually. Optional auto-pause counts failures and timeouts; success resets the count. A run whose outcome was not recorded before an unexpected restart becomes outcome unknown and is not automatically rerun.
|
|
13
|
+
- Message delivery has its own status. Failed sends never rerun tasks or automatically resend; an interrupted send becomes unknown. Manual cancellation and Host shutdown interruptions do not trigger reports. Platform acceptance does not guarantee receipt on the recipient's device.
|
|
14
|
+
|
|
15
|
+
## Reasoning effort
|
|
16
|
+
|
|
17
|
+
For fresh sessions, open **Edit → Agent execution**, choose a provider, then use the combined model menu to select **Model** or **Reasoning effort**. This uses the Host Menu primitive without changing the chat session's model selection. Choices come from that model's Host metadata, not a fixed low/medium/high list. **Default (no override)** preserves the normal Agent/model default; it does not turn reasoning off. Existing tasks keep their prior behavior. Switching models in the editor resets this choice to default.
|
|
18
|
+
|
|
19
|
+
For Agent tools, query `automation_options` with the candidate `provider` and `model` (or an existing task `id`) before using `reasoning_effort`. An explicit level requires a concrete provider/model pair and is validated by the Host before saving and running. Omit it on creation for the default, omit it on update to preserve the saved value, or pass `null` on update to clear it. HTTP updates use `execution.reasoningEffort`. When changing models through tools/API, also clear or replace an incompatible level. Pinned sessions always use their own reasoning configuration; task-level overrides apply only to fresh sessions.
|
|
20
|
+
|
|
21
|
+
## Manually delete run records
|
|
22
|
+
|
|
23
|
+
Expand a record in **Run history**, choose **Delete record**, and confirm. This removes only that record and its summary, error, and delivery status. It does not delete the session, recall messages, or change the task schedule, consecutive failure count, or paused state. Deletion cannot be undone.
|
|
24
|
+
|
|
25
|
+
Queued or running records and records whose messages are still sending cannot be deleted. Other finished records remain deletable while the task is running. Deleting the latest record makes the overview show the latest remaining result; deleting every record shows **No run records**.
|
|
26
|
+
|
|
27
|
+
## State storage
|
|
28
|
+
|
|
29
|
+
Run history is retained without a count limit by default. An explicit plugin `maxRunHistory` setting still limits retention. Previously pruned records cannot be restored by changing this setting.
|
|
30
|
+
|
|
31
|
+
State is written to a temporary file in the same directory, flushed, and atomically renamed over the previous file. Windows skips directory fsync; other platforms attempt it after the rename. If that post-commit step fails, the Host logs `AUTOMATION_DIRECTORY_SYNC_FAILED`: the operation is already committed and memory follows the new file, but persistence across a system crash or power loss is not guaranteed. Investigate the filesystem warning rather than retrying the operation. Failures before the rename still reject the operation and leave the previous state unchanged.
|
|
32
|
+
|
|
33
|
+
## Agent tools and schedule parameter reference
|
|
34
|
+
|
|
35
|
+
| Tool | Purpose |
|
|
36
|
+
| -------------------- | ---------------------------------------------------------------------------- |
|
|
37
|
+
| `automation_options` | Query current Host Agent, model, skill, and permission options. |
|
|
38
|
+
| `automation_create` | Create a task after the user confirms its complete configuration. |
|
|
39
|
+
| `automation_update` | Update task and execution settings; permission changes require confirmation. |
|
|
40
|
+
| `automation_list` | List tasks and run state. |
|
|
41
|
+
| `automation_run` | Queue one immediate run without changing the schedule. |
|
|
42
|
+
| `automation_pause` | Pause future scheduling. |
|
|
43
|
+
| `automation_resume` | Resume, optionally with one immediate run. |
|
|
44
|
+
| `automation_delete` | Delete the task and future scheduling, preserving existing sessions. |
|
|
45
|
+
|
|
46
|
+
Create and update support `agent_preset`, `provider` / `model`, `reasoning_effort`, and ordered `skills`; updates can clear execution overrides or replace the skill list. Creation also accepts `execution_mode: pinned-session`, `target_session_id`, and `session_target_confirmed: true` after user confirmation. Changing the target after creation and configuring message delivery require the UI.
|
|
47
|
+
|
|
48
|
+
| Type | Parameter | Format / example |
|
|
49
|
+
| --------- | ----------- | -------------------------------------------------------------------------- |
|
|
50
|
+
| One-time | `once_at` | RFC 3339 UTC instant, such as `2027-01-04T01:00:00.000Z`. |
|
|
51
|
+
| Recurring | `rrule` | One RFC 5545 rule without `DTSTART`, such as `FREQ=WEEKLY;BYDAY=MO,WE,FR`. |
|
|
52
|
+
| Recurring | `time_zone` | IANA zone, such as `Asia/Shanghai`. |
|
|
53
|
+
| Recurring | `start_at` | Local wall-clock time in `YYYY-MM-DDTHH:mm:ss` format. |
|
|
54
|
+
|
|
55
|
+
Recurring schedules require `rrule`, `time_zone`, and `start_at` together.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Automation 使用参考
|
|
2
|
+
|
|
3
|
+
[返回介绍](../README.zh.md) · [English](reference.md)
|
|
4
|
+
|
|
5
|
+
## 运行前,了解这几个边界
|
|
6
|
+
|
|
7
|
+
- 运行时需保持 DSH 在线;重启后,每个符合条件的任务只补跑最近错过的一次,暂停期间的周期会被跳过。
|
|
8
|
+
- 同一插件实例一次执行一个自动化任务。默认运行上限为 1 小时,可通过 `maxRunDurationMs` 调整。
|
|
9
|
+
- 暂停影响未来调度,已开始的运行会继续;停止当前运行、立即运行或「恢复并运行」都不改变原计划。
|
|
10
|
+
- 要求交互批准的权限不会被自动批准,无人值守任务可能等待到超时。
|
|
11
|
+
- 固定会话沿用其上下文及 Agent/模型配置,应用任务权限,不重新加载技能。创建后更换绑定需在界面中操作;目标忙碌或不可用时直接失败,不另建替代会话。
|
|
12
|
+
- 失败运行可手动重试;可选自动暂停将失败和超时计入连续次数,成功后清零。意外重启时未完成记录的运行标为「结果未知」,不会自动重跑。
|
|
13
|
+
- 消息投递单独记录状态;发送失败不重跑任务、不自动重发,发送中重启标为结果未知。手动取消或 Host 关闭导致的中断不触发报告;平台接受消息不等于终端已收到。
|
|
14
|
+
|
|
15
|
+
## 推理等级
|
|
16
|
+
|
|
17
|
+
新建会话模式下,进入「编辑 → Agent 执行配置」,选择具体的提供商,在合并的模型下拉菜单中选择「模型」或「推理等级」。界面复用 Host 原生 Menu,不会改动聊天会话的模型设置。选项来自该模型的 Host 元数据,不固定为低/中/高。「默认(不覆盖)」沿用正常的 Agent/模型默认行为,不代表关闭推理;旧任务行为不变。在编辑器切换模型会将该项重置为默认。
|
|
18
|
+
|
|
19
|
+
使用 Agent 工具时,先向 `automation_options` 传入候选 `provider` 和 `model`(或已有任务 `id`)查询,再设置 `reasoning_effort`。显式等级要求具体的提供商/模型组合,保存和运行前由 Host 校验。创建时省略使用默认,更新时省略保留原值,更新传 `null` 清除覆盖。HTTP 更新字段为 `execution.reasoningEffort`。通过工具/API 更换模型时,也应清除或替换不兼容的等级。固定会话始终沿用会话自身的推理配置;任务级覆盖仅对新建会话生效。
|
|
20
|
+
|
|
21
|
+
## 手动删除运行记录
|
|
22
|
+
|
|
23
|
+
在「运行历史」展开一条记录,点击「删除记录」并确认。仅移除该条记录及其摘要、错误和投递状态,不删除对应会话、不撤回消息,也不改变任务计划、连续失败计数或暂停状态。删除后不可恢复。
|
|
24
|
+
|
|
25
|
+
排队中、运行中或消息仍在发送的记录不可删除;同一任务正在执行时,仍可删除其他已结束记录。删除最新记录后,概览显示剩余记录中的最新结果;全部删除后显示「暂无运行记录」。
|
|
26
|
+
|
|
27
|
+
## 状态保存
|
|
28
|
+
|
|
29
|
+
运行历史默认不限制保留条数;只有显式配置插件的 `maxRunHistory` 时才按该上限保留。此前已被裁剪的记录不会因修改设置而恢复。
|
|
30
|
+
|
|
31
|
+
状态先写入同目录临时文件并同步,再通过原子重命名替换旧文件。Windows 跳过目录 fsync,其他平台在重命名后尝试目录同步。如果这一步失败,Host 会记录 `AUTOMATION_DIRECTORY_SYNC_FAILED` 告警:操作已经提交,内存与新文件保持一致,但不能保证系统崩溃或断电后仍保留该次更新。此时应排查文件系统告警,而不是重试操作。重命名前的失败仍会拒绝操作,保留原有状态。
|
|
32
|
+
|
|
33
|
+
## Agent 工具与调度参数参考
|
|
34
|
+
|
|
35
|
+
| 工具 | 用途 |
|
|
36
|
+
| -------------------- | ---------------------------------------------- |
|
|
37
|
+
| `automation_options` | 查询 Host 当前的 Agent、模型、技能和权限选项。 |
|
|
38
|
+
| `automation_create` | 用户确认完整配置后创建任务。 |
|
|
39
|
+
| `automation_update` | 更新任务及执行配置;权限变更需要确认。 |
|
|
40
|
+
| `automation_list` | 查看任务和运行状态。 |
|
|
41
|
+
| `automation_run` | 立即运行一次,不改变原计划。 |
|
|
42
|
+
| `automation_pause` | 暂停未来调度。 |
|
|
43
|
+
| `automation_resume` | 恢复任务,可同时立即运行一次。 |
|
|
44
|
+
| `automation_delete` | 删除任务及未来调度,保留已有会话。 |
|
|
45
|
+
|
|
46
|
+
创建与更新支持 `agent_preset`、`provider` / `model`、`reasoning_effort` 和有序 `skills`;更新可清除执行覆盖或替换技能列表。创建时还可传入 `execution_mode: pinned-session`、`target_session_id` 和经用户确认的 `session_target_confirmed: true`。创建后更换目标会话,以及配置消息投递,需在界面中操作。
|
|
47
|
+
|
|
48
|
+
| 类型 | 参数 | 格式 / 示例 |
|
|
49
|
+
| ---- | ----------- | ----------------------------------------------------------------------- |
|
|
50
|
+
| 单次 | `once_at` | RFC 3339 UTC 时间,例如 `2027-01-04T01:00:00.000Z`。 |
|
|
51
|
+
| 周期 | `rrule` | 单行 RFC 5545 规则,不含 `DTSTART`,例如 `FREQ=WEEKLY;BYDAY=MO,WE,FR`。 |
|
|
52
|
+
| 周期 | `time_zone` | IANA 时区,例如 `Asia/Shanghai`。 |
|
|
53
|
+
| 周期 | `start_at` | 本地时间,格式 `YYYY-MM-DDTHH:mm:ss`。 |
|
|
54
|
+
|
|
55
|
+
周期任务需同时提供 `rrule`、`time_zone`、`start_at`。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { AgentConfigurationOptions, AutomationExecution, AutomationTask } from './types.js';
|
|
4
|
+
import '@deepseek-ai/dsh-agent-preset-registry';
|
|
5
|
+
import '@deepseek-ai/dsh-llm';
|
|
6
|
+
import '@deepseek-ai/dsh-permission-presets';
|
|
7
|
+
import '@deepseek-ai/dsh-skill';
|
|
8
|
+
export declare class AgentConfiguration {
|
|
9
|
+
readonly ctx: Context;
|
|
10
|
+
constructor(ctx: Context);
|
|
11
|
+
options(cwd: string, agentPreset?: string, provider?: string, model?: string): Promise<AgentConfigurationOptions>;
|
|
12
|
+
permissionName(permissionPreset: string): string | undefined;
|
|
13
|
+
validate(execution: Omit<AutomationExecution, 'target'> & {
|
|
14
|
+
target?: AutomationExecution['target'];
|
|
15
|
+
}, permissionPreset: string, options?: {
|
|
16
|
+
readonly allowLegacyPartialModel?: boolean;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
loadSelectedSkills(agent: Agent, task: AutomationTask): Promise<readonly {
|
|
19
|
+
text: string;
|
|
20
|
+
source: {
|
|
21
|
+
kind: 'skill-invocation';
|
|
22
|
+
name: string;
|
|
23
|
+
form: 'instructions';
|
|
24
|
+
};
|
|
25
|
+
}[]>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=agent-configuration.d.ts.map
|