dsh-taskflow 0.1.2 → 0.1.4
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/CHANGELOG.md +44 -0
- package/LICENSE +201 -201
- package/NOTICE +6 -1
- package/README.md +247 -43
- package/README_en.md +34 -61
- package/client.js +2428 -62
- package/docs/DETAIL.md +32 -5
- package/docs/DETAIL.zh-CN.md +13 -3
- package/licenses/Marked-MIT.txt +44 -0
- package/package.json +138 -134
- package/src/application/task-runtime.mjs +123 -114
- package/src/domain/task-service.mjs +247 -178
- package/src/domain/tool-view.mjs +11 -0
- package/src/server/config.mjs +1 -1
- package/src/server/index.mjs +18 -8
- package/src/server/inline-sessions.mjs +171 -0
- package/src/server/planning-check.mjs +105 -0
- package/src/server/prompts.mjs +12 -8
- package/src/server/quick-replies.mjs +88 -0
- package/src/server/rpc.mjs +43 -22
- package/src/server/session-context.mjs +11 -5
- package/src/server/task-actions.mjs +63 -0
- package/src/server/tool-schemas.mjs +33 -0
- package/src/server/tool-views.mjs +36 -8
- package/src/server/tools.mjs +20 -14
package/README.md
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
[`dsh-taskflow`](https://www.npmjs.com/package/dsh-taskflow) 将主会话的目标组织为持续保留的任务树,让你看到要做什么、由哪个会话执行,以及哪些事项已经完成。
|
|
11
11
|
|
|
12
|
+
详细操作见[使用指南](#使用指南),包括任务规划、子会话协作、清单调整、工具视图和中断恢复。
|
|
13
|
+
|
|
12
14
|
- **持久任务清单** — 模型根据请求复杂度规划事项,使用独立任务账本保存;对话换轮、页面刷新和宿主重启不会自动清空计划。
|
|
13
15
|
- **按需递归委派** — 简单事项在负责会话完成,复杂且独立的事项创建子会话;子会话可在深度与并发限制内继续拆分。
|
|
14
16
|
- **完成自动通知** — 子会话返回有效完成结果后,自动勾选对应事项并通知直接父会话,无需主会话再次核对。
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
|
|
19
21
|

|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
*历史开发验收截图(0.1.0-alpha.1),使用固定响应模型,用于说明布局;不是当前版本的完整宿主截图。当前版本功能与验证范围见下方指南及[验收记录](docs/acceptance.md)。*
|
|
22
24
|
|
|
23
25
|
## 安装 / 更新
|
|
24
26
|
|
|
@@ -28,84 +30,285 @@
|
|
|
28
30
|
|
|
29
31
|
安装后按宿主提示重载对应 profile。插件需要宿主提供模型、工具与 `spawn` 子会话能力;桌面端需提供相同的 Web 渲染层服务。
|
|
30
32
|
|
|
33
|
+
### 通过 dsh-market 发现
|
|
34
|
+
|
|
35
|
+
[dsh-market](https://github.com/dsh-market/dsh-market) 从 [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) 目录同步插件。收录申请、维护者合并和市场刷新是三个阶段,提交 PR 不代表已经可搜索;[投稿记录](marketplace/SUBMISSION.md) 单独记录状态。
|
|
36
|
+
|
|
37
|
+
目录收录并刷新后,在 **插件 → 插件市场** 搜索 `dsh-taskflow`,确认仓库为 `Oak-liuhj/dsh-taskflow`、npm 包名为 `dsh-taskflow`,并检查显示的 DSH 兼容要求后安装。若宿主使用 **发现 → 索引来源**,可添加市场提供的 `https://cdn.jsdelivr.net/npm/dsh-plugin-catalog/index.json`。搜索暂不可用时,已发布的 npm 包仍可直接安装。
|
|
38
|
+
|
|
31
39
|
### 使用 `dsh` CLI 安装或更新
|
|
32
40
|
|
|
33
41
|
```sh
|
|
34
42
|
dsh plugin --profile web add dsh-taskflow@latest
|
|
35
43
|
```
|
|
36
44
|
|
|
37
|
-
|
|
45
|
+
官方桌面版优先使用应用内插件管理器。只有确认当前桌面宿主实际使用 `desktop` profile 时,才使用以下命令:
|
|
38
46
|
|
|
39
47
|
```sh
|
|
40
|
-
dsh plugin --profile
|
|
48
|
+
dsh plugin --profile desktop add dsh-taskflow@latest
|
|
41
49
|
```
|
|
42
50
|
|
|
43
51
|
将 `web` 替换为实际 profile 名称。已通过 npm 包名安装的用户,也可在插件详情点击 **重新检查**,选择兼容版本后点击 **更新**,按宿主提示重启或重载。
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
### 安装指定版本或本地构建
|
|
46
54
|
|
|
47
|
-
|
|
55
|
+
本说明对应 **0.1.4**,包含自动规划、递归子会话、工具插件预览、清单拖宽、推荐回复加载提示,以及默认展开的分类执行记录。固定该版本时,执行 `dsh plugin --profile desktop add dsh-taskflow@0.1.4`。安装前可查询 registry 当前版本:
|
|
48
56
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
| **主会话** | 创建计划、调整整体要求,或明确指定在哪个子任务下增补事项。 |
|
|
53
|
-
| **子任务会话** | 执行负责的事项;必要时拆分下级任务,完成后向直接父会话报告。 |
|
|
54
|
-
| **任务详情** | 查看要求、完成标准和结果;增补、修改、继续执行、取消及调整同级顺序。 |
|
|
55
|
-
| **会话左侧工具区** | 按需展示实际工具页面或输出,支持关闭;窄屏可切换对话与工具。 |
|
|
57
|
+
```sh
|
|
58
|
+
npm view dsh-taskflow version dist-tags --json
|
|
59
|
+
```
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
已有 0.1.4 安装包 `.tgz` 时,在压缩包所在目录执行 `dsh plugin --profile desktop add ./dsh-taskflow-0.1.4.tgz`;安装后保存工作并重启 DSH。已经安装该版本的用户可直接进入下方使用指南。
|
|
58
62
|
|
|
59
|
-
|
|
63
|
+
需要自行打包时,在**包含上述修复的源码目录**执行:
|
|
60
64
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
```sh
|
|
66
|
+
npm ci
|
|
67
|
+
npm run build
|
|
68
|
+
npm run check
|
|
69
|
+
npm run check:package
|
|
70
|
+
dsh plugin --profile desktop add ./dist/dsh-taskflow-0.1.4.tgz
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
这些命令需要 Node.js ≥24.9.0;`check:package` 会生成并验证 `dist/dsh-taskflow-0.1.4.tgz`。`dsh` 指你当前宿主提供的 CLI;如果终端找不到该命令,请使用宿主 CLI 的实际路径。安装后保存工作并重启 DSH。网页版将 `desktop` 换成 `web`。本地安装不等于发布到 npm,也不会自动更新其他 profile。
|
|
74
|
+
|
|
75
|
+
## 使用指南
|
|
76
|
+
|
|
77
|
+
日常使用从主会话开始:描述目标,模型规划并执行持久任务;你通过右侧清单查看进度,通过对话调整要求,通过左侧子会话查看独立事项的执行过程。无需手动创建每个子会话,也无需手写工具调用参数。
|
|
78
|
+
|
|
79
|
+
### 1. 打开插件入口
|
|
80
|
+
|
|
81
|
+
确认插件安装并启用于当前 profile,安装或更新后按宿主提示重启、重载。DSH 需要配置可正常对话和调用工具的模型,并具备 `spawn` 子会话能力;文件、终端、浏览器等业务能力由宿主或对应插件提供。
|
|
82
|
+
|
|
83
|
+
进入主会话,在右上角点击 **清单图标 + 任务**,打开右侧的 **待办任务清单**。安装了任务进度插件时,入口位于其右侧;极窄窗口下可能仅显示图标。
|
|
84
|
+
|
|
85
|
+
首次打开时清单为空是正常情况。提交需要多步骤处理的目标后,模型才会建立具体事项;短问答通常无需清单。
|
|
86
|
+
|
|
87
|
+
### 2. 在主会话描述目标
|
|
88
|
+
|
|
89
|
+
直接说明要完成的事情、范围和完成标准。例如:
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
请为当前项目开发知识库文档导入功能。
|
|
93
|
+
支持 Markdown 和 TXT,能够校验文件、保存导入结果,并提示失败原因。
|
|
94
|
+
请先规划持久待办,再按依赖执行;复杂且独立的模块分配子会话,
|
|
95
|
+
必要时由子会话继续拆分下级。完成后提供实际修改和验证结果。
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
模型会根据实际复杂度生成任务树,而不是要求你先列出每一项。条数、层级、标题和执行方式由任务内容决定,不是固定模板。
|
|
69
99
|
|
|
70
|
-
|
|
100
|
+
- **需要执行**:正常描述目标即可;信息和工具齐备时,模型应在规划后继续推进。
|
|
101
|
+
- **只需要规划**:在目标后明确补充“本轮只规划,暂不执行”。之后可以通过对话或 **开始** 按钮启动。
|
|
102
|
+
- **已有计划**:继续在原主会话提出新要求,模型增量维护原清单,不因新一轮对话重建。
|
|
71
103
|
|
|
72
|
-
|
|
104
|
+
任务计划以右侧面板保存成功为准。聊天中的普通 Markdown 清单和 `todo_write` 不会代替 Taskflow 的持久账本。
|
|
73
105
|
|
|
74
|
-
|
|
106
|
+
### 3. 查看任务进度并启动执行
|
|
107
|
+
|
|
108
|
+
计划建立后,右侧展示计划标题、稳定任务 ID、父子层级、状态和完成进度。已有计划时面板会尝试自动打开,也可以随时点击右上角入口打开。
|
|
109
|
+
|
|
110
|
+

|
|
111
|
+
|
|
112
|
+
| 操作 | 用途 |
|
|
113
|
+
| --- | --- |
|
|
114
|
+
| **全局计划 / 当前会话** | 查看完整任务树,或聚焦当前会话负责的事项。 |
|
|
115
|
+
| **全部事项 / 未完成 / 已完成 / 已取消** | 按状态筛选;为保留层级,匹配事项的祖先也可能显示。 |
|
|
116
|
+
| 事项旁的折叠按钮 | 折叠或展开下级待办。 |
|
|
117
|
+
| 点击事项标题 | 打开对应执行会话,或在负责会话聚焦该事项。 |
|
|
118
|
+
| 事项右侧的详情菜单 | 查看要求、完成标准、父事项、执行说明和实际结果。 |
|
|
119
|
+
| **开始** | 将该事项的执行请求提交给主会话,按依赖和归属启动。 |
|
|
120
|
+
| **继续** | 请求恢复暂停、受阻或失败的事项。 |
|
|
121
|
+
| 面板标题右侧的动态菜单 | 查看任务增补、执行、修改和结果等历史变更。 |
|
|
122
|
+
|
|
123
|
+
也可以在主会话直接发送:
|
|
75
124
|
|
|
76
125
|
```text
|
|
77
|
-
|
|
126
|
+
按依赖执行现有计划,沿用原任务 ID,保留已完成结果。
|
|
78
127
|
```
|
|
79
128
|
|
|
80
|
-
|
|
129
|
+
**开始 / 继续** 会直接提交执行请求并显示反馈,不覆盖输入框中已有的草稿。模型需要先读取当前状态;有未运行的委派父任务时,先恢复父任务。提交成功表示请求已接收,不代表事项已经完成。
|
|
130
|
+
|
|
131
|
+
顶部完成进度按**未取消的根事项**统计。下级事项完成时,如果父事项还有剩余工作,顶部进度不一定立即增加。
|
|
132
|
+
|
|
133
|
+
### 4. 查看子会话与多层协作
|
|
134
|
+
|
|
135
|
+
插件根据复杂度和独立性选择执行方式:
|
|
136
|
+
|
|
137
|
+
| 任务情况 | 执行方式 |
|
|
138
|
+
| --- | --- |
|
|
139
|
+
| 简单事项,或必须共享当前上下文 | 在父会话内完成,同时创建只读事项子会话,保存实际过程和结果。 |
|
|
140
|
+
| 适合独立处理的复杂事项 | 委派真实子会话。高复杂度且独立的事项自动使用委派。 |
|
|
141
|
+
| 子会话内还有可独立处理的复杂部分 | 继续拆分下级,并在深度允许时创建孙会话。 |
|
|
142
|
+
| 达到最大委派深度 | 在负责会话内执行,在详情中说明原因。 |
|
|
143
|
+
|
|
144
|
+
左侧沿用原型的气泡图标、展开箭头、状态圆点、36px 行高、12px 圆角和层级连线;进行中的事项显示旋转图标。点击子会话可查看执行过程,右侧清单仍可切换到全局计划。会话记录创建后,左侧约每 1.2 秒同步。
|
|
81
145
|
|
|
82
|
-
|
|
146
|
+
**仅规划时只生成右侧清单,执行到哪项才创建哪项的子会话。** 行内事项在 `taskflow_start` 后创建记录子会话;委派事项获得执行名额后创建实际执行会话,不提前创建所有待办的会话。行内子项挂在对应父事项的记录下;实际操作仍由负责会话完成,记录不额外调用模型、不占用委派名额。旧版提前建立但尚未执行的记录会保留数据,并从插件侧栏隐藏,真正开始后再展示。
|
|
83
147
|
|
|
84
|
-
|
|
148
|
+
每层中高复杂度事项在执行前都由模型判断是否继续拆解;需要则保存下级事项,无需则保存直接执行的依据。已有主清单不会跳过子任务判断,子任务也能继续拆解孙任务。判断按任务版本保存;要求变化后重新判断。低复杂度动作可直接执行,深度与并发限制仍然生效。
|
|
85
149
|
|
|
86
|
-
|
|
150
|
+
左侧会话列表默认收起下级。点击主会话或某条子会话时,打开该会话;如果它有下级,则同时展开,已展开时再次点击会收起。没有下级时只打开会话。箭头可单独切换展开状态,层级连线表示直接父子关系。在子会话任务面板中,可通过路径或“返回父会话”回到上级。点击行内事项会打开其记录子会话;从记录面板增补要求时,自动回到负责会话预填,仍需你确认发送。
|
|
151
|
+
|
|
152
|
+
**执行先后不等于父子关系。** “勘察、设计、实现、接入、整体验证”通常是主目标下的同级阶段,通过前置依赖排序;只有某阶段的组成事项才挂在该阶段下面。中高复杂度、具有独立产物的设计、入口开发或验证事项应优先委派;共享项目文件、读取前序结果不意味着必须使用同一会话。简短操作或必须共享当前对话的事项仍可行内完成。
|
|
153
|
+
|
|
154
|
+
希望独立执行时,可在主会话明确说明:
|
|
87
155
|
|
|
88
156
|
```text
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
取消 T-006,保留历史。
|
|
93
|
-
继续执行 T-003。
|
|
157
|
+
将设计、入口开发和整体验证规划为主目标下的同级事项,按前置依赖执行。
|
|
158
|
+
每项使用独立子会话,读取前序任务保存的产物;任务内部再按实际复杂度拆分。
|
|
159
|
+
已完成的事项保留原记录,不要为了补建会话重复执行。
|
|
94
160
|
```
|
|
95
161
|
|
|
96
|
-
|
|
162
|
+
历史行内事项会补建真实的记录子会话,显示原任务要求和已保存的执行结果;历史过程仍在原父会话中,补建不会重跑任务或伪造缺失的过程。新执行的行内事项会持续保存实际工具过程。保存失败会在面板显示原因并自动重试,重启或重试不会重复创建同一记录。任务 ID、执行版本和完成结果保持不变。
|
|
163
|
+
|
|
164
|
+
默认 `maxDepth: 2`,主会话为深度 0,允许子会话和孙会话两层委派;默认 `maxConcurrent: 2`,全树最多两个委派名额同时执行。父任务等待下级时会释放名额,供下级继续执行。
|
|
165
|
+
|
|
166
|
+
子会话返回有效完成结果后,对应事项自动勾选,并通知**直接父会话**;父会话继续自己的剩余工作,无需主会话再次核对或批准。某个子项完成不代表整个父任务已完成。
|
|
167
|
+
|
|
168
|
+
#### 模型推荐的快捷回复
|
|
169
|
+
|
|
170
|
+
输入框上方会根据当前会话的最新对话、任务进度和阻塞原因,生成 **3–5 条推荐回复**。点击后将内容填入输入框;已有草稿和引用会保留,确认后由你发送。不会仅因点击推荐就执行任务。
|
|
171
|
+
|
|
172
|
+
推荐使用当前会话所选模型,属于额外的短请求,预留 4096 tokens(含模型推理),最多等待 60 秒。相同上下文共享缓存,轮询不会重复调用模型;对话或任务状态变化后更新。执行中暂不生成;失败显示连接、模型认证/额度、超时或输出格式等原因及重试入口,不循环重试,也不以固定文案冒充模型推荐。刚安装后若提示后端未加载,请重启 DSH;尚无对话或未选择模型时,需要先正常交流。可通过 `quickReplies: false` 关闭。
|
|
173
|
+
|
|
174
|
+
### 5. 在对话中增补、修改和取消事项
|
|
175
|
+
|
|
176
|
+
在主会话说明要调整哪个事项。下面的 ID 仅为示例,请替换成清单里的实际 ID;需要多项调整时,分条说明目标和要求。
|
|
177
|
+
|
|
178
|
+
| 需要做什么 | 对话示例 |
|
|
179
|
+
| --- | --- |
|
|
180
|
+
| 在当前事项下增补 | `在当前任务下新增一个移动端检查。` |
|
|
181
|
+
| 在指定事项下增补 | `在 T-003 下新增一个“导入失败时保留原数据”的验证事项。` |
|
|
182
|
+
| 修改任务要求 | `修改 T-003 的要求:增加重复文件检测,并明确错误提示。` |
|
|
183
|
+
| 调整执行顺序 | `将 T-005 移到同级事项的前面,保留原 ID。` |
|
|
184
|
+
| 取消任务 | `取消 T-006 及其下级,保留历史,不改变其他事项。` |
|
|
185
|
+
|
|
186
|
+
新增事项默认挂到当前正在执行或选中的事项下;主会话可用任务 ID 或唯一完整名称明确指定父任务。没有定位到当前事项时新增到根计划;名称重复或找不到目标时,需要进一步澄清。子会话只能维护自己负责的子树,跨事项调整请在主会话提出。
|
|
97
187
|
|
|
98
188
|

|
|
99
189
|
|
|
100
|
-
|
|
190
|
+
也可以通过界面操作:
|
|
191
|
+
|
|
192
|
+
- 面板底部的 **在当前任务下增补 / 在主任务下增补**,或详情中的 **增补下级事项**:预填输入框,补充内容后发送。
|
|
193
|
+
- **修改要求**:预填输入框,写明新要求后发送。
|
|
194
|
+
- **取消任务**:直接取消该事项及其下级,保留记录,取消不计为完成。
|
|
195
|
+
- **上移 / 下移**:直接调整同级顺序,保留任务 ID 和执行历史;依赖约束仍然生效。
|
|
196
|
+
|
|
197
|
+
修改要求后版本递增,旧执行结果不能完成新要求;受影响的未完成下级会暂停,之后按新要求继续。向已完成事项增补下级时,该事项及已完成祖先会重新打开,历史报告仍保留。
|
|
198
|
+
|
|
199
|
+
### 6. 使用工具视图、拖宽和悬浮
|
|
200
|
+
|
|
201
|
+
工具区默认关闭。模型实际调用浏览器、文件、命令或其他插件工具时,可在**调用工具的会话左侧**展示本次地址或输出;纯文字回复不会触发展开。工具展示需要该会话已经关联 Taskflow 计划。
|
|
202
|
+
|
|
203
|
+
例如在负责的会话中提出:
|
|
101
204
|
|
|
102
|
-
|
|
205
|
+
```text
|
|
206
|
+
读取当前模块已经修改的文件,在工具视图展示实际结果,并继续处理剩余工作。
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
或者在宿主具备浏览器能力时提出:
|
|
210
|
+
|
|
211
|
+
```text
|
|
212
|
+
使用浏览器打开项目的本地页面,检查导入交互,并展示实际页面地址。
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
工具由子会话调用时,切换到该子会话查看。视图按会话保存,不会将所有子会话的工具集中显示在主会话。
|
|
103
216
|
|
|
104
217
|

|
|
105
218
|
|
|
106
|
-
|
|
219
|
+
| 操作 | 效果 |
|
|
220
|
+
| --- | --- |
|
|
221
|
+
| 拖动工具区右边缘 | 左右调整工具区宽度;分隔条获得焦点后也可用左右方向键。 |
|
|
222
|
+
| 点击 **悬浮工具视图** | 将工具窗口悬浮在 DSH 界面上,对话恢复可用空间。 |
|
|
223
|
+
| 拖动悬浮标题栏 | 移动工具窗口。 |
|
|
224
|
+
| 拖动悬浮窗口右下角 | 调整悬浮窗口大小。 |
|
|
225
|
+
| 点击 **停靠工具视图** | 回到对话左侧。 |
|
|
226
|
+
| 点击 **收起工具视图** | 关闭当前视图;后续工具调用仍可再次展开。 |
|
|
227
|
+
| 窄屏点击 **看对话 / 看工具** | 切换显示区域。 |
|
|
228
|
+
|
|
229
|
+
布局偏好按会话保存在当前浏览器。工具视图会识别成功调用返回的实际文件路径,并按格式展示:
|
|
230
|
+
|
|
231
|
+
| 产物或操作 | 展示方式 |
|
|
232
|
+
| --- | --- |
|
|
233
|
+
| Markdown(`.md` / `.markdown`) | 自动使用宿主 Markdown 插件,在工具视图内预览,无需选择。 |
|
|
234
|
+
| Excel(`.xls` / `.xlsx` / `.csv` / `.tsv`) | 自动调用宿主文档预览插件,在工具视图内展示表格。 |
|
|
235
|
+
| Word、PPT(`.doc` / `.docx` / `.ppt` / `.pptx`) | 在工具视图内使用宿主对应文档插件预览;渲染服务由宿主提供。 |
|
|
236
|
+
| PDF | 在工具视图内使用宿主 PDF 插件预览。 |
|
|
237
|
+
| 浏览器操作 | 展示真实返回的地址,并自动调用宿主浏览器插件打开该地址。 |
|
|
238
|
+
| 多个文件 | 在工具视图内逐项展示插件预览,无需选择文件;滚动查看其他产物。 |
|
|
239
|
+
|
|
240
|
+
自动打开仅针对正在查看的任务会话,后台子会话不会抢占当前页面;切换到该子会话后可查看产物。轮询不会重复打开,同地址连续浏览器操作也不会反复新建页面。缺少预览或浏览器插件时显示具体原因,启用后点击对应的打开按钮重试。
|
|
241
|
+
|
|
242
|
+
文档预览随工具区调宽、悬浮、拖动和滚动;关闭工具区或切换会话时释放本次预览,不关闭用户自行打开的文档。右上角 **图标 + 任务** 点击展开清单,再次点击收起;正在显示其他右侧页面时会切换到任务清单。
|
|
243
|
+
|
|
244
|
+
子任务的执行过程和关键发现保留在当前子任务会话。模型通过 `taskflow_progress` 保存阶段进展:委派事项直接写入执行子会话,行内事项写入对应记录子会话。实际工具过程自动保存;迟到结果按原工具调用归属记录。最终结果先保存到子任务,再由完成通知告诉直接父任务,过程不逐条通知父任务。
|
|
245
|
+
|
|
246
|
+
**0.1.4** 将这些记录默认展开,显示步骤目标、实际操作、关键发现或验证结果、下一步及阻塞原因。行内记录自动区分模型调用、模型公开输出、工具调用参数与返回结果;原始记录提供模型、工具、耗时或失败状态时一并展示。内容支持 Markdown、表格和代码,可手动折叠。旧版“上下文注入 · taskflow · T-xxx 执行过程”记录也能直接阅读,无需重新执行任务;历史缺失的内容不会凭空补写。
|
|
247
|
+
|
|
248
|
+
文件来自工具的明确路径字段,不从命令或普通回复猜测。若通过终端脚本生成文档,要求模型随后调用 `taskflow_open_view`,传入 `kind: "editor"` 和真实 `filePath`(多文件用 `files`);不要只在回复里写路径。文档读取、权限检查、渲染和加载错误由宿主预览插件负责,Taskflow 不再直接读取文件。请启用宿主文档预览插件;缺失时显示原因,可在启用后点击“重试打开”。
|
|
249
|
+
|
|
250
|
+
浏览器自动化、终端和编辑仍由原工具或对应插件执行。宿主浏览器打开的是相同地址;第三方自动化插件的浏览器不一定与它共享登录、页面进度或标签页,打开视图不代表完成操作。识别到的文档统一交给宿主预览;其他工具可展示插件注册的专用视图。
|
|
107
251
|
|
|
108
|
-
|
|
252
|
+
其他客户端插件可通过 `taskflowViews.register(kind, Component)` 注册专用渲染器,见[架构说明](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/docs/architecture.md)。
|
|
253
|
+
|
|
254
|
+
右侧清单及左侧子会话中,实际 `running` 的事项显示 **进行中** 和旋转图标;完成后停止旋转并勾选。排队、等待下级、受阻、暂停分别显示自身状态,不会因点击会话就变成执行中。状态约每 1.2 秒同步,系统启用减少动画时保留静态进度图标。
|
|
255
|
+
|
|
256
|
+
工具视图仅保留紧凑标题栏,隐藏文件路径、重复打开和成功提示,文档预览填满剩余高度;多个文档纵向滚动查看。加载失败仍可重试。右侧待办清单在普通停靠模式默认300px,可拖动左边缘调整宽度并自动记住;窗口变窄时会自适应收窄,恢复后还原偏好。全屏、悬浮和其他插件页面继续使用宿主布局。推荐回复等待当前主任务结束或生成中时显示小型旋转图标和“正在推荐中...”,与推荐内容左边缘对齐;等待期间不会额外并发调用模型,完成或失败后停止。
|
|
257
|
+
|
|
258
|
+
### 7. 处理受阻、失败和继续执行
|
|
259
|
+
|
|
260
|
+
任务状态表示当前实际执行情况:
|
|
261
|
+
|
|
262
|
+
| 状态 | 含义与操作 |
|
|
263
|
+
| --- | --- |
|
|
264
|
+
| **待执行** | 尚未启动;可让模型继续计划,或点击开始。 |
|
|
265
|
+
| **排队中** | 等待调度或并发名额,无需重复提交。 |
|
|
266
|
+
| **执行中** | 负责会话正在处理事项。 |
|
|
267
|
+
| **等待下级** | 父任务等待下级结果,之后继续本层工作。 |
|
|
268
|
+
| **已暂停** | 例如宿主重启或要求变更后中断,需要明确继续。 |
|
|
269
|
+
| **受阻** | 缺少文件、访问方式、权限或必要确认;先补齐条件。 |
|
|
270
|
+
| **失败** | 本次执行出错;查看原因,解决后再继续。 |
|
|
271
|
+
| **已完成** | 已保存有效完成结果,通常无需再次执行。 |
|
|
272
|
+
| **已取消** | 已停止该事项及其下级,历史保留。 |
|
|
273
|
+
|
|
274
|
+
受阻或失败原因直接显示在事项下方,详情中可查看完整结果。排队中和等待下级是正常过程,不应直接当作故障。
|
|
275
|
+
|
|
276
|
+
处理受阻时,先在主会话补充信息并指定任务 ID,例如:
|
|
277
|
+
|
|
278
|
+
```text
|
|
279
|
+
T-003 需要的样例文件已放在项目 fixtures/sample.json,请沿用原任务继续验证,
|
|
280
|
+
保留已完成下级和现有结果,不要重新创建清单。
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
提供的路径应实际存在。如果事项尚未恢复,可以点击 **继续**,或发送 `继续执行 T-003。` 查看提交反馈及后续工具调用。外部条件仍未满足时,事项可能再次受阻,不会仅因点击继续就自动完成。
|
|
284
|
+
|
|
285
|
+
若委派父任务已结束,恢复时会创建新的负责会话;左侧保留历史执行会话及其父子关系。原子项的完成记录不会因重试而清空。
|
|
286
|
+
|
|
287
|
+
### 8. 跨轮、刷新和重启后继续工作
|
|
288
|
+
|
|
289
|
+
任务清单保存在独立账本中。后续对话、页面刷新以及切换会话不会清空原计划。需要查看进度时,在原主会话发送:
|
|
290
|
+
|
|
291
|
+
```text
|
|
292
|
+
汇报当前计划的进度、阻塞原因和下一步,不重建任务,不重复执行已完成事项。
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
重启 DSH 后,重新打开**原主会话**,即可查看已有任务、稳定 ID、层级、完成记录和历史。重启时仍在运行的事项恢复为 **已暂停**,需要明确继续,不会自动重跑。
|
|
296
|
+
|
|
297
|
+
同一目标的后续调整继续在原主会话处理;完全独立的新目标可以新建主会话。新主会话不会自动继承另一个主会话的计划。完整迁移还需要保留原生 DSH 会话数据,不能只复制任务账本。
|
|
298
|
+
|
|
299
|
+
### 常见使用问题
|
|
300
|
+
|
|
301
|
+
| 现象 | 检查与处理 |
|
|
302
|
+
| --- | --- |
|
|
303
|
+
| 看不到“任务”入口 | 检查安装和启用的是否为当前 profile,重启加载对应版本;极窄窗口下可能仅显示图标。 |
|
|
304
|
+
| 回答里有清单,右侧却为空 | 检查持久计划是否保存成功。可在主会话要求“将刚才的事项通过 taskflow_plan 保存为持久计划”;普通文本和 `todo_write` 不会写入账本。短问答也可能正常跳过规划。 |
|
|
305
|
+
| 自动规划提示停止重试 | 查看工具错误并补充必要信息,在新一轮要求修正参数后重新规划;模型最多收到两次补建提醒,最多四个规划步骤,不会无限重试。 |
|
|
306
|
+
| 有待办却没有子会话 | 行内事项保存计划后自动建记录,需等待宿主持久化及侧栏刷新;委派父会话未创建时先等待父级。失败原因显示为“子会话记录待同步”。独立委派仍需启动并满足依赖、深度、并发和宿主提供者限制。 |
|
|
307
|
+
| 看不到孙会话 | 确认下级确实被委派并已启动;默认最多两层委派,待办层级不等于会话深度。 |
|
|
308
|
+
| 点击继续后未立即变成执行中 | 先看提交反馈及主会话状态。请求需由模型处理,繁忙时可能排在后续轮次;按错误提示补齐条件。旧版按钮行为需要更新修复版本并重启。 |
|
|
309
|
+
| 工具区没有打开 | 确认正在查看实际调用工具的会话,且该会话已关联 Taskflow 计划;纯文字回复不会触发工具区。 |
|
|
310
|
+
| 面板报 HTTP 404 / 405 | 检查前后端是否加载同一修复版本及当前 profile,重启后重试;仍存在时记录具体接口路径、宿主版本和脱敏日志。 |
|
|
311
|
+
| 重启后任务变成暂停 | 这是中断恢复行为。确认原结果和剩余工作,再点继续,不需要删除重建计划。 |
|
|
109
312
|
|
|
110
313
|
## ⚙️ 设置
|
|
111
314
|
|
|
@@ -113,7 +316,8 @@ dsh plugin --profile web add dsh-taskflow@0.1.2
|
|
|
113
316
|
|
|
114
317
|
| 配置项 | 默认值 | 说明 |
|
|
115
318
|
| --- | --- | --- |
|
|
116
|
-
| `autoPlan` | `true` |
|
|
319
|
+
| `autoPlan` | `true` | 检查模型复杂度判断及计划落账;关闭后需明确要求创建计划。 |
|
|
320
|
+
| `quickReplies` | `true` | 在输入框上方展示模型生成的 3–5 条推荐;使用当前模型的额外短请求,并按上下文缓存。 |
|
|
117
321
|
| `maxDepth` | `2` | 最大委派深度,根会话为 0;可设 0–8。 |
|
|
118
322
|
| `maxConcurrent` | `2` | 全树同时执行的委派名额;父任务等待下级时释放名额;可设 1–16。 |
|
|
119
323
|
| `maxTasks` | `200` | 每份计划的事项上限;可设 1–2000。 |
|
|
@@ -122,10 +326,10 @@ dsh plugin --profile web add dsh-taskflow@0.1.2
|
|
|
122
326
|
|
|
123
327
|
## 注意事项
|
|
124
328
|
|
|
125
|
-
- **兼容性** — 当前版本 **0.1.
|
|
329
|
+
- **兼容性** — 当前版本 **0.1.4**,要求 Node.js **≥24.9.0**;DSH 兼容声明为 `>=0.2.1-rc.3 <1.0.0-0 || >=0.2.2-0 <1.0.0-0 || >=0.2.3-0 <1.0.0-0 || >=0.3.0-0 <1.0.0-0`。宿主需启用 `tools`、`agents`、`sessions`、`systemPrompt`、`subagents` 及相应客户端服务。
|
|
126
330
|
- **规划与执行** — 自动规划由模型提示引导,具体拆解和工具选择取决于宿主模型。任务账本独立于 `todo_write`,后续对话通过增量操作维护原计划。
|
|
127
331
|
- **数据与恢复** — 同一 `dataDir` 只允许一个活跃写入者。停止宿主后备份整个目录;完整迁移还需备份原生 DSH 会话。中断时仍在执行的任务恢复为暂停,从负责会话继续;卸载插件保留账本数据。
|
|
128
|
-
- **验证范围** —
|
|
332
|
+
- **验证范围** — 0.1.4 通过 71 项自动化测试、12 个版本边界检查,以及 `0.2.1-rc.3`、`0.2.2-rc.2`、`0.2.2-rc.3` 的固定响应模型集成测试;执行记录另经这三个版本的原生 SlotCore 与实际打包客户端 jsdom 回归,覆盖冷读取与重复启停。推荐请求此前经真实模型验证;完整原生界面、真实模型的任务拆解质量与第三方工具仍需验收,详见[验收记录](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/docs/acceptance.md)。
|
|
129
333
|
- **语言** — 插件说明提供简体中文和英文;任务导航界面当前以中文显示。
|
|
130
334
|
|
|
131
335
|
## 喜欢它?
|
package/README_en.md
CHANGED
|
@@ -16,9 +16,29 @@
|
|
|
16
16
|
- **Hierarchical task navigation** — Inspect the task tree, progress, status and details in the right sidebar, then jump to the execution session.
|
|
17
17
|
- **On-demand tool views** — Actual host tool calls can show a page or output to the left of the conversation. The tool area starts closed.
|
|
18
18
|
|
|
19
|
+
Markdown, Excel, Word, PowerPoint and PDF outputs automatically open through the
|
|
20
|
+
host's document preview plugins inside the tool view. Multiple files open without
|
|
21
|
+
a file or viewer selector. Taskflow does not read document content directly; the
|
|
22
|
+
host preview owns file access, rendering and authorization. Enable the host document
|
|
23
|
+
preview plugin to use this feature. Missing plugins offer a retry action. Automatic
|
|
24
|
+
opening is limited to the foreground task session and does not repeat on polling.
|
|
25
|
+
Terminal-generated files without structured output paths require
|
|
26
|
+
`taskflow_open_view` with the actual `filePath` or `files`.
|
|
27
|
+
|
|
28
|
+
Previews follow tool-panel resizing, floating and scrolling. Closing the tool view
|
|
29
|
+
releases its own previews and preserves documents opened by the user. The header's
|
|
30
|
+
Tasks button toggles the checklist; another active sidebar page switches to Tasks.
|
|
31
|
+
Version **0.1.4** expands Taskflow execution records by default, including existing saved records. Inline records distinguish model calls, public model output, tool inputs and results. Available source metadata supplies the model, tool, duration and failure status. Stage reports describe the goal, actual operations, key findings or validation, and next step or blocker, with Markdown tables and code when helpful. Historical records remain intact and missing history is never fabricated.
|
|
32
|
+
|
|
33
|
+
Execution progress and key findings stay in the current task's child session via
|
|
34
|
+
`taskflow_progress`. Inline work writes to its record session; delegated work writes
|
|
35
|
+
to its execution session. Final results are saved before notifying the direct parent.
|
|
36
|
+
|
|
37
|
+
The tool view keeps a compact header and fills its remaining height with document previews, without visible paths, reopen controls or success notices. Multiple documents scroll vertically; failures retain a retry action. The docked checklist starts at 300px; drag its left edge to resize, and the preference is remembered. Narrow windows temporarily constrain the width. Fullscreen, floating tabs and other plugin pages retain the host layout. Suggested replies show a small spinner and a left-aligned loading label while waiting for the current response or generating suggestions, until ready or failed. Waiting does not start another model call.
|
|
38
|
+
|
|
19
39
|

|
|
20
40
|
|
|
21
|
-
*
|
|
41
|
+
*Historical development-shell screenshots (0.1.0-alpha.1), using a deterministic model to illustrate the layout. These are not full-host screenshots of the current version. See the guide and [acceptance record](docs/acceptance.md) for the current behavior and validation scope.*
|
|
22
42
|
|
|
23
43
|
## Install / Update
|
|
24
44
|
|
|
@@ -28,6 +48,14 @@ Open **Plugins** → **Add plugin** and search for `dsh-taskflow`. If a result p
|
|
|
28
48
|
|
|
29
49
|
Reload the profile when the host requests it. The plugin uses the host's model, tools and `spawn` subagent provider. Desktop installations need the same Web renderer services.
|
|
30
50
|
|
|
51
|
+
### Discover through dsh-market
|
|
52
|
+
|
|
53
|
+
[dsh-market](https://github.com/dsh-market/dsh-market) consumes the [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) catalog. Submission, maintainer merge and market refresh are separate stages; a pull request does not establish searchability. The [submission record](marketplace/SUBMISSION.md) tracks that status.
|
|
54
|
+
|
|
55
|
+
After catalog inclusion and refresh, search for `dsh-taskflow` under **Plugins → Plugin Market**. Confirm the repository is `Oak-liuhj/dsh-taskflow`, the npm package is `dsh-taskflow`, and the host requirement is compatible. For the host's **Discover → Index sources**, the market provides `https://cdn.jsdelivr.net/npm/dsh-plugin-catalog/index.json`. The published npm package remains directly installable before the catalog refreshes.
|
|
56
|
+
|
|
57
|
+
On official Desktop, prefer the app's plugin manager. CLI installation must target the profile actually used by that app; installing into `web` does not install into Desktop.
|
|
58
|
+
|
|
31
59
|
### Using the `dsh` CLI
|
|
32
60
|
|
|
33
61
|
```sh
|
|
@@ -37,7 +65,7 @@ dsh plugin --profile web add dsh-taskflow@latest
|
|
|
37
65
|
To pin the current version:
|
|
38
66
|
|
|
39
67
|
```sh
|
|
40
|
-
dsh plugin --profile web add dsh-taskflow@0.1.
|
|
68
|
+
dsh plugin --profile web add dsh-taskflow@0.1.4
|
|
41
69
|
```
|
|
42
70
|
|
|
43
71
|
Replace `web` with your profile name. For an npm-based installation, you can also recheck versions in the plugin details, choose a compatible update and follow the host's reload or restart instructions.
|
|
@@ -46,6 +74,8 @@ Replace `web` with your profile name. For an npm-based installation, you can als
|
|
|
46
74
|
|
|
47
75
|
Describe your goal in the main conversation. The model plans requests that need several steps, tool operations or independent execution; short questions do not need a plan.
|
|
48
76
|
|
|
77
|
+
With automatic planning enabled, the model assesses whether a checklist is needed and saves it before executing work. If an answer or document is returned without a saved plan, the plugin sends at most two reminders. Planning stops after four unsuccessful steps and the panel shows the reason. Missing information can be clarified first; short questions may explicitly skip planning. Existing plans are updated incrementally.
|
|
78
|
+
|
|
49
79
|
| Entry point | What you can do |
|
|
50
80
|
| --- | --- |
|
|
51
81
|
| **Task navigation** | Inspect progress and status; switch between the global plan and current session, filter, collapse and navigate tasks. |
|
|
@@ -56,7 +86,7 @@ Describe your goal in the main conversation. The model plans requests that need
|
|
|
56
86
|
|
|
57
87
|
## ✅ Task navigation — one checklist across turns
|
|
58
88
|
|
|
59
|
-
Click
|
|
89
|
+
Click **Checklist icon + 任务 (Tasks)** in the session header to open the **待办任务清单 (To-do checklist)** panel on the right. Tasks appear directly in their parent-child hierarchy, without extra planning or review categories.
|
|
60
90
|
|
|
61
91
|
| Item | What it tells you |
|
|
62
92
|
| --- | --- |
|
|
@@ -79,61 +109,4 @@ Build a knowledge-base import module. Plan the work first and delegate independe
|
|
|
79
109
|
|
|
80
110
|
The model considers complexity and independence. Simple tasks or work requiring shared context stay in the owner session; suitable complex work can spawn a child. Children may split their work again, with inline execution used at the depth limit.
|
|
81
111
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
## ✏️ Add and edit — keep working on the same plan
|
|
85
|
-
|
|
86
|
-
Identify the task to change in your message:
|
|
87
|
-
|
|
88
|
-
```text
|
|
89
|
-
Add a mobile check under the current task.
|
|
90
|
-
Add a PDF import check under T-005.
|
|
91
|
-
Update T-003 to require retries and clear error messages.
|
|
92
|
-
Cancel T-006 and retain its history.
|
|
93
|
-
Continue T-003.
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
New work defaults to the currently running or selected task. The main conversation may name a parent ID or unique full title. If no current task is identified, work attaches to the root plan; ambiguous names need clarification.
|
|
97
|
-
|
|
98
|
-

|
|
99
|
-
|
|
100
|
-
**Add child**, **Edit requirements** and **Continue in conversation** prefill the conversation input; send the message for the model to act. Cancellation and sibling reordering are direct interface actions. Adding children to completed work reopens the task and completed ancestors while preserving historical reports.
|
|
101
|
-
|
|
102
|
-
## 🖥️ Tool views — show them when needed
|
|
103
|
-
|
|
104
|
-

|
|
105
|
-
|
|
106
|
-
The tool area starts closed. Actual browser, file, command or plugin tool calls can show their real address or output to the left of the conversation. Close the view when finished.
|
|
107
|
-
|
|
108
|
-
Execution remains with host tools or their plugins. The default page view is a restricted iframe; CSP, authentication or cross-origin rules may prevent embedding. Other client plugins can register dedicated renderers through `taskflowViews.register(kind, Component)`; see the [architecture guide](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/docs/architecture.md).
|
|
109
|
-
|
|
110
|
-
## ⚙️ Settings
|
|
111
|
-
|
|
112
|
-
Adjust the plugin configuration in the profile you use. Defaults are in [cordis.patch.yml](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/cordis.patch.yml).
|
|
113
|
-
|
|
114
|
-
| Setting | Default | Meaning |
|
|
115
|
-
| --- | --- | --- |
|
|
116
|
-
| `autoPlan` | `true` | Prompt the model to plan complex requests automatically; when disabled, request a plan explicitly. |
|
|
117
|
-
| `maxDepth` | `2` | Maximum delegation depth, with the root at 0; range 0–8. |
|
|
118
|
-
| `maxConcurrent` | `2` | Active delegation slots across the tree. Parents release their slot while waiting for children; range 1–16. |
|
|
119
|
-
| `maxTasks` | `200` | Task limit per plan; range 1–2000. |
|
|
120
|
-
| `provider` | `spawn` | Name of a registered host subagent provider. |
|
|
121
|
-
| `dataDir` | `${DSH_HOME}/taskflow` | Ledger directory; falls back to `~/.dsh/taskflow` when the environment variable is unset. |
|
|
122
|
-
|
|
123
|
-
## Notes
|
|
124
|
-
|
|
125
|
-
- **Compatibility** — Current version **0.1.2**, Node.js **≥24.9.0**. The declared DSH range is `>=0.2.1-rc.3 <1.0.0-0 || >=0.2.2-0 <1.0.0-0 || >=0.2.3-0 <1.0.0-0 || >=0.3.0-0 <1.0.0-0`. Enable `tools`, `agents`, `sessions`, `systemPrompt`, `subagents` and the corresponding client services.
|
|
126
|
-
- **Planning and execution** — Automatic planning is model-guided. Task decomposition and tool choices depend on the host model. The ledger is independent of `todo_write`; later messages update the same plan incrementally.
|
|
127
|
-
- **Data and recovery** — Use one active writer per `dataDir`. Back up the whole directory while the host is stopped, together with native DSH sessions for a complete migration. Interrupted tasks recover as paused and can be resumed in their owner conversation. Uninstalling the plugin preserves the ledger.
|
|
128
|
-
- **Validation** — 30 automated tests, 12 version boundaries and deterministic-model integrations with exact hosts `0.2.1-rc.3`, `0.2.2-rc.2` and `0.2.2-rc.3` have passed. Full native profiles, production models and third-party tools still need acceptance; see the [acceptance record](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/docs/acceptance.md).
|
|
129
|
-
- **Language** — Plugin documentation is available in Simplified Chinese and English. The task navigation interface currently uses Chinese labels.
|
|
130
|
-
|
|
131
|
-
## Like it?
|
|
132
|
-
|
|
133
|
-
Star the project on [GitHub](https://github.com/Oak-liuhj/dsh-taskflow), or open an [Issue](https://github.com/Oak-liuhj/dsh-taskflow/issues) / PR. Include plugin and DSH versions, profile type, reproduction steps and redacted logs when reporting a problem.
|
|
134
|
-
|
|
135
|
-
See the [development guide](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/docs/DEVELOPMENT.md) and [publishing guide](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/docs/PUBLISHING.md) for contributions.
|
|
136
|
-
|
|
137
|
-
## License
|
|
138
|
-
|
|
139
|
-
Original code is [Apache-2.0](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/LICENSE). Imported DeepSeek styles and icons retain their MIT license; see [NOTICE](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/NOTICE) and [DeepSeek-MIT.txt](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/licenses/DeepSeek-MIT.txt). The source PRD embeds an OFL-1.1 font; the font and complete PRD are excluded from the npm runtime package. This is a community plugin.
|
|
112
|
+
High-complexity independent work (`high` + `independent: true`) automatically delegates, subject to depth limits. Planning only creates the checklist. Inline records appear when their task starts; delegated execution sessions appear when admitted by the scheduler. Unstarted tasks do not create sidebar sessions. Existing prematurely created records are preserved but hidden until execution. Nested inline items attach to their parent task's record. Every running medium/high-complexity item, including child items, requires a model decision to split or execute directly; decisions persist per task version. Completed results and original attempt history are preserved.
|