dsh-taskflow 0.1.1 → 0.1.2

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/README_en.md CHANGED
@@ -1,139 +1,139 @@
1
- # dsh-taskflow
2
-
3
- [简体中文](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/README.md) · [English](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/README_en.md)
4
-
5
- [![npm version](https://img.shields.io/npm/v/dsh-taskflow)](https://www.npmjs.com/package/dsh-taskflow)
6
- [![GitHub stars](https://img.shields.io/github/stars/Oak-liuhj/dsh-taskflow?style=social)](https://github.com/Oak-liuhj/dsh-taskflow)
7
-
8
- **A [DeepSeek Harness](https://www.deepseek.com/harness/) plugin for persistent task planning and nested session orchestration.**
9
-
10
- [`dsh-taskflow`](https://www.npmjs.com/package/dsh-taskflow) turns a goal in the main conversation into a lasting task tree, showing what needs doing, which session owns each task, and what has finished.
11
-
12
- - **Persistent checklist** — The model plans tasks according to request complexity. A separate ledger preserves the plan across conversation turns, page refreshes and host restarts.
13
- - **Selective nested delegation** — Simple tasks stay in their owner session. Independent complex tasks can spawn children, which may delegate further within depth and concurrency limits.
14
- - **Completion notifications** — Valid child results check off the task and notify its direct parent, without adding a parent review step.
15
- - **Incremental conversation updates** — Add work beneath the current task or explicitly name a parent in the main conversation; edit requirements, cancel work and reorder siblings.
16
- - **Hierarchical task navigation** — Inspect the task tree, progress, status and details in the right sidebar, then jump to the execution session.
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
-
19
- ![Task navigation and conversation](https://raw.githubusercontent.com/Oak-liuhj/dsh-taskflow/main/docs/screenshots/desktop.png)
20
-
21
- *Screenshots show the development acceptance shell with a deterministic model.*
22
-
23
- ## Install / Update
24
-
25
- ### In DeepSeek Harness Web or Desktop
26
-
27
- Open **Plugins** → **Add plugin** and search for `dsh-taskflow`. If a result points to `Oak-liuhj/dsh-taskflow`, install that entry. If it is not listed, use the CLI below to install by npm package name.
28
-
29
- 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
-
31
- ### Using the `dsh` CLI
32
-
33
- ```sh
34
- dsh plugin --profile web add dsh-taskflow@latest
35
- ```
36
-
37
- To pin the current version:
38
-
39
- ```sh
40
- dsh plugin --profile web add dsh-taskflow@0.1.1
41
- ```
42
-
43
- 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.
44
-
45
- ## Usage
46
-
47
- 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
-
49
- | Entry point | What you can do |
50
- | --- | --- |
51
- | **Task navigation** | Inspect progress and status; switch between the global plan and current session, filter, collapse and navigate tasks. |
52
- | **Main conversation** | Create a plan, adjust the overall requirements or identify the parent task for new work. |
53
- | **Child conversation** | Complete assigned work, create subtasks when needed and report to the direct parent. |
54
- | **Task details** | Read requirements, completion criteria and results; add, edit, resume, cancel and reorder tasks. |
55
- | **Tool area to the left** | Show actual tool pages or output when needed. Close it or switch between tools and chat on narrow screens. |
56
-
57
- ## ✅ Task navigation — one checklist across turns
58
-
59
- Click **任务导航 / Task navigation** in the session header, or select its right-sidebar entry. Tasks appear directly in their parent-child hierarchy, without extra planning or review categories.
60
-
61
- | Item | What it tells you |
62
- | --- | --- |
63
- | **Progress** | How much of the plan is complete. |
64
- | **Global plan / Current session** | The whole tree or the part owned by the current session. |
65
- | **Task status** | Pending, running, completed, paused, failed or cancelled work. |
66
- | **Stable task ID** | A precise reference to the same task in later messages. |
67
- | **Execution session** | Whether work stays in the owner session or runs in a child. |
68
- | **Details and activity** | Requirements, completion criteria, results and change history. |
69
-
70
- Click a task title to focus it or open its execution session. Collapse branches and filter longer plans.
71
-
72
- ## 🧩 Child sessions — delegate according to complexity
73
-
74
- For example, ask the main conversation:
75
-
76
- ```text
77
- Build a knowledge-base import module. Plan the work first and delegate independent complex parts to child sessions.
78
- ```
79
-
80
- 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
-
82
- A valid structured child result updates the task and notifies its direct parent. Requirement versions and execution IDs are checked so old results cannot overwrite changed requirements. The parent can then continue its remaining work.
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
- ![Task details and actions](https://raw.githubusercontent.com/Oak-liuhj/dsh-taskflow/main/docs/screenshots/task-detail.png)
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
- ![Tool view to the left of the conversation](https://raw.githubusercontent.com/Oak-liuhj/dsh-taskflow/main/docs/screenshots/desktop-tool.png)
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.1**, 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.
1
+ # dsh-taskflow
2
+
3
+ [简体中文](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/README.md) · [English](https://github.com/Oak-liuhj/dsh-taskflow/blob/main/README_en.md)
4
+
5
+ [![npm version](https://img.shields.io/npm/v/dsh-taskflow)](https://www.npmjs.com/package/dsh-taskflow)
6
+ [![GitHub stars](https://img.shields.io/github/stars/Oak-liuhj/dsh-taskflow?style=social)](https://github.com/Oak-liuhj/dsh-taskflow)
7
+
8
+ **A [DeepSeek Harness](https://www.deepseek.com/harness/) plugin for persistent task planning and nested session orchestration.**
9
+
10
+ [`dsh-taskflow`](https://www.npmjs.com/package/dsh-taskflow) turns a goal in the main conversation into a lasting task tree, showing what needs doing, which session owns each task, and what has finished.
11
+
12
+ - **Persistent checklist** — The model plans tasks according to request complexity. A separate ledger preserves the plan across conversation turns, page refreshes and host restarts.
13
+ - **Selective nested delegation** — Simple tasks stay in their owner session. Independent complex tasks can spawn children, which may delegate further within depth and concurrency limits.
14
+ - **Completion notifications** — Valid child results check off the task and notify its direct parent, without adding a parent review step.
15
+ - **Incremental conversation updates** — Add work beneath the current task or explicitly name a parent in the main conversation; edit requirements, cancel work and reorder siblings.
16
+ - **Hierarchical task navigation** — Inspect the task tree, progress, status and details in the right sidebar, then jump to the execution session.
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
+
19
+ ![Task navigation and conversation](https://raw.githubusercontent.com/Oak-liuhj/dsh-taskflow/main/docs/screenshots/desktop.png)
20
+
21
+ *Screenshots show the development acceptance shell with a deterministic model.*
22
+
23
+ ## Install / Update
24
+
25
+ ### In DeepSeek Harness Web or Desktop
26
+
27
+ Open **Plugins** → **Add plugin** and search for `dsh-taskflow`. If a result points to `Oak-liuhj/dsh-taskflow`, install that entry. If it is not listed, use the CLI below to install by npm package name.
28
+
29
+ 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
+
31
+ ### Using the `dsh` CLI
32
+
33
+ ```sh
34
+ dsh plugin --profile web add dsh-taskflow@latest
35
+ ```
36
+
37
+ To pin the current version:
38
+
39
+ ```sh
40
+ dsh plugin --profile web add dsh-taskflow@0.1.2
41
+ ```
42
+
43
+ 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.
44
+
45
+ ## Usage
46
+
47
+ 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
+
49
+ | Entry point | What you can do |
50
+ | --- | --- |
51
+ | **Task navigation** | Inspect progress and status; switch between the global plan and current session, filter, collapse and navigate tasks. |
52
+ | **Main conversation** | Create a plan, adjust the overall requirements or identify the parent task for new work. |
53
+ | **Child conversation** | Complete assigned work, create subtasks when needed and report to the direct parent. |
54
+ | **Task details** | Read requirements, completion criteria and results; add, edit, resume, cancel and reorder tasks. |
55
+ | **Tool area to the left** | Show actual tool pages or output when needed. Close it or switch between tools and chat on narrow screens. |
56
+
57
+ ## ✅ Task navigation — one checklist across turns
58
+
59
+ Click **✓ 任务 (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
+
61
+ | Item | What it tells you |
62
+ | --- | --- |
63
+ | **Progress** | How much of the plan is complete. |
64
+ | **Global plan / Current session** | The whole tree or the part owned by the current session. |
65
+ | **Task status** | Pending, running, completed, paused, failed or cancelled work. |
66
+ | **Stable task ID** | A precise reference to the same task in later messages. |
67
+ | **Execution session** | Whether work stays in the owner session or runs in a child. |
68
+ | **Details and activity** | Requirements, completion criteria, results and change history. |
69
+
70
+ Click a task title to focus it or open its execution session. Collapse branches and filter longer plans.
71
+
72
+ ## 🧩 Child sessions — delegate according to complexity
73
+
74
+ For example, ask the main conversation:
75
+
76
+ ```text
77
+ Build a knowledge-base import module. Plan the work first and delegate independent complex parts to child sessions.
78
+ ```
79
+
80
+ 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
+
82
+ A valid structured child result updates the task and notifies its direct parent. Requirement versions and execution IDs are checked so old results cannot overwrite changed requirements. The parent can then continue its remaining work.
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
+ ![Task details and actions](https://raw.githubusercontent.com/Oak-liuhj/dsh-taskflow/main/docs/screenshots/task-detail.png)
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
+ ![Tool view to the left of the conversation](https://raw.githubusercontent.com/Oak-liuhj/dsh-taskflow/main/docs/screenshots/desktop-tool.png)
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.
package/client.js CHANGED
@@ -50,21 +50,21 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
50
50
  ));
51
51
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
52
52
 
53
- // src/client/index.jsx
54
- var index_exports = {};
55
- __export(index_exports, {
53
+ // taskflow-source:src/client/index.jsx
54
+ var client_exports = {};
55
+ __export(client_exports, {
56
56
  apply: () => apply,
57
57
  createApi: () => createApi,
58
58
  inject: () => inject
59
59
  });
60
- module.exports = __toCommonJS(index_exports);
61
- var import_react6 = __toESM(require("react"), 1);
60
+ module.exports = __toCommonJS(client_exports);
61
+ var import_react6 = __toESM(require("react"));
62
62
  var import_react_dom2 = require("react-dom");
63
63
 
64
- // src/client/components/task-panel.jsx
65
- var import_react3 = __toESM(require("react"), 1);
64
+ // taskflow-source:src/client/components/task-panel.jsx
65
+ var import_react3 = __toESM(require("react"));
66
66
 
67
- // src/client/model.mjs
67
+ // taskflow-source:src/client/model.mjs
68
68
  var STATUS = { pending: "待执行", queued: "排队中", running: "执行中", awaiting_children: "等待下级", paused: "已暂停", blocked: "受阻", failed: "失败", completed: "已完成", cancelled: "已取消" };
69
69
  var TOOL_NAMES = { browser: "浏览器", editor: "编辑器", terminal: "终端", plugin: "插件", orchestration: "编排" };
70
70
  function visibleTree(plan, { filter = "all", scope = "global", sessionId } = {}) {
@@ -86,8 +86,8 @@ function progress(plan) {
86
86
  return { done, total: roots.length, percent: roots.length ? Math.round(done / roots.length * 100) : 0 };
87
87
  }
88
88
 
89
- // src/client/generated/icons.jsx
90
- var import_react = __toESM(require("react"), 1);
89
+ // taskflow-source:src/client/generated/icons.jsx
90
+ var import_react = __toESM(require("react"));
91
91
  var paths = { layers: "m12 3 9 5-9 5-9-5 9-5zm-9 9 9 5 9-5M3 16l9 5 9-5", chat: "M21 11.5a8.4 8.4 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.4 8.4 0 0 1-3.8-.9L3 21l1.9-5.7a8.4 8.4 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6A8.4 8.4 0 0 1 12.5 3h.5a8.5 8.5 0 0 1 8 8v.5z", check: "m5 12 4 4L19 6", chevron: "m9 5 7 7-7 7", arrow: "M5 12h14m-6-6 6 6-6 6", back: "M19 12H5m6-6-6 6 6 6", plus: "M12 5v14M5 12h14", search: "m21 21-4.3-4.3M19 10.5a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0", browser: "M3 8h18M5 4h14a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m1 2h.01M9 6h.01", code: "m8 6-6 6 6 6m8-12 6 6-6 6m-3-15-2 18", terminal: "m4 5 6 6-6 6m9 1h7", plugin: "M8 3v4H4v5h4v4h4v5h5v-5h4v-5h-4V7h-4V3H8z", settings: "M9 3h6l1 4 4 1 1 6-4 2-1 4H9l-1-4-4-1-1-6 4-2 2-4zm7 9a4 4 0 1 1-8 0 4 4 0 0 1 8 0", file: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zm0 0v6h6M8 13h8m-8 4h6", branch: "M6 3v12a3 3 0 0 0 3 3h9M6 8h8a4 4 0 0 0 4-4m-9 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0m12-15a3 3 0 1 1-6 0 3 3 0 0 1 6 0", clock: "M12 7v5l3 2m6-2a9 9 0 1 1-18 0 9 9 0 0 1 18 0", download: "M12 3v12m-5-5 5 5 5-5M4 16v4h16v-4", send: "m22 2-7 20-4-9-9-4 20-7zM22 2 11 13", close: "m6 6 12 12M6 18 18 6", upload: "M12 16V3M7 8l5-5 5 5M4 16v5h16v-5", refresh: "M20 7V3l-4 4a8 8 0 1 0 4 8M20 3h-5", lock: "M6 11h12v10H6zm3 0V7a3 3 0 0 1 6 0v4", expand: "M8 3H3v5m13-5h5v5M3 16v5h5m13-5v5h-5", eye: "M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm13 0a3 3 0 1 1-6 0 3 3 0 0 1 6 0", book: "M12 5s-4-3-9-2v16c5-1 9 2 9 2s4-3 9-2V3c-5-1-9 2-9 2zm0 0v16", info: "M12 11v6m0-10h.01m9 5a9 9 0 1 1-18 0 9 9 0 0 1 18 0", dots: "M5 12h.01M12 12h.01M19 12h.01" };
92
92
  paths.folder = "M3 7V5h6l2 2h10v13H3V7z";
93
93
  paths.panel = "M3 4h18v16H3zm7 0v16";
@@ -97,8 +97,8 @@ function Icon({ name, ...props }) {
97
97
  return /* @__PURE__ */ import_react.default.createElement("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", ...props }, /* @__PURE__ */ import_react.default.createElement("path", { d: paths[name] || paths.file }));
98
98
  }
99
99
 
100
- // src/client/components/task-dialog.jsx
101
- var import_react2 = __toESM(require("react"), 1);
100
+ // taskflow-source:src/client/components/task-dialog.jsx
101
+ var import_react2 = __toESM(require("react"));
102
102
  var import_react_dom = require("react-dom");
103
103
  function TaskDialog({ title, subtitle, children, actions, onClose, closeLabel = "关闭任务详情" }) {
104
104
  const ref = (0, import_react2.useRef)(null);
@@ -121,7 +121,7 @@ function TaskDialog({ title, subtitle, children, actions, onClose, closeLabel =
121
121
  } }, /* @__PURE__ */ import_react2.default.createElement("header", { className: "dialog-head" }, /* @__PURE__ */ import_react2.default.createElement("div", null, /* @__PURE__ */ import_react2.default.createElement("small", null, subtitle), /* @__PURE__ */ import_react2.default.createElement("h2", null, title)), /* @__PURE__ */ import_react2.default.createElement("button", { className: "iconbtn", "aria-label": closeLabel, onClick: onClose }, /* @__PURE__ */ import_react2.default.createElement(Icon, { name: "close" }))), /* @__PURE__ */ import_react2.default.createElement("div", { className: "dialog-body" }, children), actions && /* @__PURE__ */ import_react2.default.createElement("footer", { className: "dialog-actions" }, actions)), document.body);
122
122
  }
123
123
 
124
- // src/client/components/task-panel.jsx
124
+ // taskflow-source:src/client/components/task-panel.jsx
125
125
  function TaskPanel({ view, sessionId, action, navigate, augment, onError }) {
126
126
  const [filter, setFilter] = (0, import_react3.useState)("all"), [scope, setScope] = (0, import_react3.useState)("global"), [collapsed, setCollapsed] = (0, import_react3.useState)(/* @__PURE__ */ new Set()), [detail, setDetail] = (0, import_react3.useState)(null), [busy, setBusy] = (0, import_react3.useState)(false), [error, setError] = (0, import_react3.useState)("");
127
127
  (0, import_react3.useEffect)(() => {
@@ -156,18 +156,18 @@ function TaskPanel({ view, sessionId, action, navigate, augment, onError }) {
156
156
  return n;
157
157
  }) }, /* @__PURE__ */ import_react3.default.createElement(Icon, { name: "chevron", style: { transform: collapsed.has(t.id) ? "" : "rotate(90deg)" } })))), /* @__PURE__ */ import_react3.default.createElement("button", { className: "iconbtn", "aria-label": `查看 ${t.id} 详情`, onClick: () => setDetail(t.id) }, /* @__PURE__ */ import_react3.default.createElement(Icon, { name: "dots" }))), !["completed", "cancelled"].includes(t.status) && /* @__PURE__ */ import_react3.default.createElement("div", { className: "task-status" }, /* @__PURE__ */ import_react3.default.createElement("span", { className: `pill ${t.status === "running" ? "blue" : ""}` }, /* @__PURE__ */ import_react3.default.createElement("i", { className: `dot ${t.status}` }), STATUS[t.status]), ["pending", "paused", "blocked", "failed"].includes(t.status) && /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small outline", onClick: () => prompt(`继续执行 ${t.id},按当前要求完成任务。`) }, t.status === "pending" ? "开始" : "继续"))), !collapsed.has(t.id) && t.children.length > 0 && /* @__PURE__ */ import_react3.default.createElement("div", { className: "child-tasks" }, t.children.map(row)));
158
158
  const selected = p?.tasks[detail];
159
- return /* @__PURE__ */ import_react3.default.createElement("section", { className: "tf-panel", "aria-label": "任务导航" }, /* @__PURE__ */ import_react3.default.createElement("header", { className: "plan-tabs" }, /* @__PURE__ */ import_react3.default.createElement("span", { className: "tab" }, /* @__PURE__ */ import_react3.default.createElement(Icon, { name: "check" }), "任务导航"), /* @__PURE__ */ import_react3.default.createElement("span", { className: "pill", style: { fontSize: 10 } }, "持久计划"), /* @__PURE__ */ import_react3.default.createElement("button", { className: "iconbtn", "aria-label": "查看任务动态", onClick: () => setDetail("activity") }, /* @__PURE__ */ import_react3.default.createElement(Icon, { name: "dots" }))), view.loading ? /* @__PURE__ */ import_react3.default.createElement("p", { className: "empty" }, "正在加载任务…") : !p ? /* @__PURE__ */ import_react3.default.createElement("div", { className: "empty" }, /* @__PURE__ */ import_react3.default.createElement(Icon, { name: "check" }), /* @__PURE__ */ import_react3.default.createElement("p", null, "暂无任务计划"), /* @__PURE__ */ import_react3.default.createElement("p", null, "在会话中描述目标,模型将根据任务复杂度规划待办。")) : /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement("div", { className: "plan-heading" }, /* @__PURE__ */ import_react3.default.createElement("h2", null, p.title), /* @__PURE__ */ import_react3.default.createElement("div", { className: "progress-label" }, /* @__PURE__ */ import_react3.default.createElement("strong", null, pr.done, " / ", pr.total, " 项已完成"), /* @__PURE__ */ import_react3.default.createElement("span", null, "v", p.version, " · ", pr.percent, "%")), /* @__PURE__ */ import_react3.default.createElement("div", { className: "progress-track", role: "progressbar", "aria-label": "根任务完成进度", "aria-valuenow": pr.percent, "aria-valuemin": 0, "aria-valuemax": 100 }, /* @__PURE__ */ import_react3.default.createElement("span", { style: { width: `${pr.percent}%` } }))), /* @__PURE__ */ import_react3.default.createElement("div", { className: "plan-controls" }, /* @__PURE__ */ import_react3.default.createElement("div", { className: "segments" }, [["global", "全局计划"], ["local", "当前会话"]].map(([id, title]) => /* @__PURE__ */ import_react3.default.createElement("button", { key: id, className: scope === id ? "selected" : "", "aria-pressed": scope === id, onClick: () => setScope(id) }, title))), /* @__PURE__ */ import_react3.default.createElement("select", { "aria-label": "任务筛选", value: filter, onChange: (e) => setFilter(e.target.value) }, /* @__PURE__ */ import_react3.default.createElement("option", { value: "all" }, "全部事项"), /* @__PURE__ */ import_react3.default.createElement("option", { value: "active" }, "未完成"), /* @__PURE__ */ import_react3.default.createElement("option", { value: "completed" }, "已完成"), /* @__PURE__ */ import_react3.default.createElement("option", { value: "cancelled" }, "已取消"))), /* @__PURE__ */ import_react3.default.createElement("div", { className: "task-list" }, visibleTree(p, { filter, scope, sessionId }).map(row)), /* @__PURE__ */ import_react3.default.createElement("footer", { className: "plan-bottom" }, /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn outline", onClick: () => augment(view.currentTaskId ? `在 ${view.currentTaskId} 下新增一个` : "新增一个待办事项:") }, /* @__PURE__ */ import_react3.default.createElement(Icon, { name: "plus" }), view.currentTaskId ? "在当前任务下增补" : "在主任务下增补"), /* @__PURE__ */ import_react3.default.createElement("p", null, "稳定 ID · 跨轮保留 · 刷新恢复"))), (error || view.error) && /* @__PURE__ */ import_react3.default.createElement("p", { role: "alert", className: "tf-error" }, error || view.error), selected && /* @__PURE__ */ import_react3.default.createElement(TaskDialog, { title: selected.title, subtitle: `${selected.id} · 任务详情`, onClose: () => setDetail(null), actions: /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, ["pending", "paused", "blocked", "failed"].includes(selected.status) && /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small primary", onClick: () => prompt(`继续执行 ${selected.id},按当前要求完成任务。`) }, "在会话中继续"), selected.status !== "cancelled" && /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small outline", onClick: () => prompt(`在 ${selected.id} 下新增一个`) }, "增补下级事项"), /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small outline", onClick: () => prompt(`修改 ${selected.id} 的要求为:`) }, "修改要求")), !["cancelled", "completed"].includes(selected.status) && /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small danger", disabled: busy, onClick: () => void perform("cancel", { taskId: selected.id, version: selected.version }) }, "取消任务"), /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small", disabled: busy, onClick: () => void perform("reorder", { taskId: selected.id, direction: -1, expectedVersion: p.version }) }, "上移"), /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small", disabled: busy, onClick: () => void perform("reorder", { taskId: selected.id, direction: 1, expectedVersion: p.version }) }, "下移")) }, /* @__PURE__ */ import_react3.default.createElement("dl", { className: "detail-kv" }, /* @__PURE__ */ import_react3.default.createElement("dt", null, "状态"), /* @__PURE__ */ import_react3.default.createElement("dd", null, /* @__PURE__ */ import_react3.default.createElement("span", { className: "pill" }, STATUS[selected.status], " · v", selected.version)), /* @__PURE__ */ import_react3.default.createElement("dt", null, "执行方式"), /* @__PURE__ */ import_react3.default.createElement("dd", null, selected.mode === "delegate" ? "独立子会话" : "当前会话"), /* @__PURE__ */ import_react3.default.createElement("dt", null, "父级事项"), /* @__PURE__ */ import_react3.default.createElement("dd", null, selected.parentId || "主任务"), /* @__PURE__ */ import_react3.default.createElement("dt", null, "任务要求"), /* @__PURE__ */ import_react3.default.createElement("dd", null, selected.instructions || selected.title), /* @__PURE__ */ import_react3.default.createElement("dt", null, "完成标准"), /* @__PURE__ */ import_react3.default.createElement("dd", null, selected.criteria || "按当前任务要求完成")), selected.report && /* @__PURE__ */ import_react3.default.createElement("div", { className: "notice" }, /* @__PURE__ */ import_react3.default.createElement("strong", null, selected.report.version === selected.version ? "执行结果" : `历史结果 v${selected.report.version}(当前要求已变化)`), /* @__PURE__ */ import_react3.default.createElement("p", null, selected.report.summary)), error && /* @__PURE__ */ import_react3.default.createElement("p", { className: "tf-error", role: "alert" }, error)), detail === "activity" && p && /* @__PURE__ */ import_react3.default.createElement(TaskDialog, { title: "任务动态", subtitle: `持久计划 · v${p.version}`, closeLabel: "关闭任务动态", onClose: () => setDetail(null) }, [...p.events].reverse().map((e) => /* @__PURE__ */ import_react3.default.createElement("article", { className: "history", key: e.id }, /* @__PURE__ */ import_react3.default.createElement("time", null, e.at.replace("T", " ").slice(0, 19), " · ", e.taskId), e.detail))));
159
+ return /* @__PURE__ */ import_react3.default.createElement("section", { className: "tf-panel", "aria-label": "待办任务清单" }, /* @__PURE__ */ import_react3.default.createElement("header", { className: "plan-tabs" }, /* @__PURE__ */ import_react3.default.createElement("span", { className: "tab" }, /* @__PURE__ */ import_react3.default.createElement(Icon, { name: "check" }), "待办任务清单"), /* @__PURE__ */ import_react3.default.createElement("span", { className: "pill", style: { fontSize: 10 } }, "持久计划"), /* @__PURE__ */ import_react3.default.createElement("button", { className: "iconbtn", "aria-label": "查看任务动态", onClick: () => setDetail("activity") }, /* @__PURE__ */ import_react3.default.createElement(Icon, { name: "dots" }))), view.loading ? /* @__PURE__ */ import_react3.default.createElement("p", { className: "empty" }, "正在加载任务…") : !p ? /* @__PURE__ */ import_react3.default.createElement("div", { className: "empty" }, /* @__PURE__ */ import_react3.default.createElement(Icon, { name: "check" }), /* @__PURE__ */ import_react3.default.createElement("p", null, "暂无任务计划"), /* @__PURE__ */ import_react3.default.createElement("p", null, "在会话中描述目标,模型将根据任务复杂度规划待办。")) : /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement("div", { className: "plan-heading" }, /* @__PURE__ */ import_react3.default.createElement("h2", null, p.title), /* @__PURE__ */ import_react3.default.createElement("div", { className: "progress-label" }, /* @__PURE__ */ import_react3.default.createElement("strong", null, pr.done, " / ", pr.total, " 项已完成"), /* @__PURE__ */ import_react3.default.createElement("span", null, "v", p.version, " · ", pr.percent, "%")), /* @__PURE__ */ import_react3.default.createElement("div", { className: "progress-track", role: "progressbar", "aria-label": "根任务完成进度", "aria-valuenow": pr.percent, "aria-valuemin": 0, "aria-valuemax": 100 }, /* @__PURE__ */ import_react3.default.createElement("span", { style: { width: `${pr.percent}%` } }))), /* @__PURE__ */ import_react3.default.createElement("div", { className: "plan-controls" }, /* @__PURE__ */ import_react3.default.createElement("div", { className: "segments" }, [["global", "全局计划"], ["local", "当前会话"]].map(([id, title]) => /* @__PURE__ */ import_react3.default.createElement("button", { key: id, className: scope === id ? "selected" : "", "aria-pressed": scope === id, onClick: () => setScope(id) }, title))), /* @__PURE__ */ import_react3.default.createElement("select", { "aria-label": "任务筛选", value: filter, onChange: (e) => setFilter(e.target.value) }, /* @__PURE__ */ import_react3.default.createElement("option", { value: "all" }, "全部事项"), /* @__PURE__ */ import_react3.default.createElement("option", { value: "active" }, "未完成"), /* @__PURE__ */ import_react3.default.createElement("option", { value: "completed" }, "已完成"), /* @__PURE__ */ import_react3.default.createElement("option", { value: "cancelled" }, "已取消"))), /* @__PURE__ */ import_react3.default.createElement("div", { className: "task-list" }, visibleTree(p, { filter, scope, sessionId }).map(row)), /* @__PURE__ */ import_react3.default.createElement("footer", { className: "plan-bottom" }, /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn outline", onClick: () => augment(view.currentTaskId ? `在 ${view.currentTaskId} 下新增一个` : "新增一个待办事项:") }, /* @__PURE__ */ import_react3.default.createElement(Icon, { name: "plus" }), view.currentTaskId ? "在当前任务下增补" : "在主任务下增补"), /* @__PURE__ */ import_react3.default.createElement("p", null, "稳定 ID · 跨轮保留 · 刷新恢复"))), (error || view.error) && /* @__PURE__ */ import_react3.default.createElement("p", { role: "alert", className: "tf-error" }, error || view.error), selected && /* @__PURE__ */ import_react3.default.createElement(TaskDialog, { title: selected.title, subtitle: `${selected.id} · 任务详情`, onClose: () => setDetail(null), actions: /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, ["pending", "paused", "blocked", "failed"].includes(selected.status) && /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small primary", onClick: () => prompt(`继续执行 ${selected.id},按当前要求完成任务。`) }, "在会话中继续"), selected.status !== "cancelled" && /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small outline", onClick: () => prompt(`在 ${selected.id} 下新增一个`) }, "增补下级事项"), /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small outline", onClick: () => prompt(`修改 ${selected.id} 的要求为:`) }, "修改要求")), !["cancelled", "completed"].includes(selected.status) && /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small danger", disabled: busy, onClick: () => void perform("cancel", { taskId: selected.id, version: selected.version }) }, "取消任务"), /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small", disabled: busy, onClick: () => void perform("reorder", { taskId: selected.id, direction: -1, expectedVersion: p.version }) }, "上移"), /* @__PURE__ */ import_react3.default.createElement("button", { className: "btn small", disabled: busy, onClick: () => void perform("reorder", { taskId: selected.id, direction: 1, expectedVersion: p.version }) }, "下移")) }, /* @__PURE__ */ import_react3.default.createElement("dl", { className: "detail-kv" }, /* @__PURE__ */ import_react3.default.createElement("dt", null, "状态"), /* @__PURE__ */ import_react3.default.createElement("dd", null, /* @__PURE__ */ import_react3.default.createElement("span", { className: "pill" }, STATUS[selected.status], " · v", selected.version)), /* @__PURE__ */ import_react3.default.createElement("dt", null, "执行方式"), /* @__PURE__ */ import_react3.default.createElement("dd", null, selected.mode === "delegate" ? "独立子会话" : "当前会话"), /* @__PURE__ */ import_react3.default.createElement("dt", null, "父级事项"), /* @__PURE__ */ import_react3.default.createElement("dd", null, selected.parentId || "主任务"), /* @__PURE__ */ import_react3.default.createElement("dt", null, "任务要求"), /* @__PURE__ */ import_react3.default.createElement("dd", null, selected.instructions || selected.title), /* @__PURE__ */ import_react3.default.createElement("dt", null, "完成标准"), /* @__PURE__ */ import_react3.default.createElement("dd", null, selected.criteria || "按当前任务要求完成")), selected.report && /* @__PURE__ */ import_react3.default.createElement("div", { className: "notice" }, /* @__PURE__ */ import_react3.default.createElement("strong", null, selected.report.version === selected.version ? "执行结果" : `历史结果 v${selected.report.version}(当前要求已变化)`), /* @__PURE__ */ import_react3.default.createElement("p", null, selected.report.summary)), error && /* @__PURE__ */ import_react3.default.createElement("p", { className: "tf-error", role: "alert" }, error)), detail === "activity" && p && /* @__PURE__ */ import_react3.default.createElement(TaskDialog, { title: "任务动态", subtitle: `持久计划 · v${p.version}`, closeLabel: "关闭任务动态", onClose: () => setDetail(null) }, [...p.events].reverse().map((e) => /* @__PURE__ */ import_react3.default.createElement("article", { className: "history", key: e.id }, /* @__PURE__ */ import_react3.default.createElement("time", null, e.at.replace("T", " ").slice(0, 19), " · ", e.taskId), e.detail))));
160
160
  }
161
161
 
162
- // src/client/components/tool-panel.jsx
163
- var import_react4 = __toESM(require("react"), 1);
162
+ // taskflow-source:src/client/components/tool-panel.jsx
163
+ var import_react4 = __toESM(require("react"));
164
164
  function ToolPanel({ tool, onClose, renderer }) {
165
165
  const [reload, setReload] = (0, import_react4.useState)(0);
166
166
  if (!tool?.open) return null;
167
167
  return /* @__PURE__ */ import_react4.default.createElement("aside", { className: "tf-tool", "aria-label": `${TOOL_NAMES[tool.kind]}工具视图` }, /* @__PURE__ */ import_react4.default.createElement("header", { className: "tool-header" }, /* @__PURE__ */ import_react4.default.createElement(Icon, { name: tool.kind === "editor" ? "code" : tool.kind }), /* @__PURE__ */ import_react4.default.createElement("span", null, TOOL_NAMES[tool.kind]), /* @__PURE__ */ import_react4.default.createElement("span", { className: "binding" }, tool.taskId || tool.title), /* @__PURE__ */ import_react4.default.createElement("button", { className: "iconbtn", "aria-label": "收起工具视图", onClick: onClose }, /* @__PURE__ */ import_react4.default.createElement(Icon, { name: "close" }))), /* @__PURE__ */ import_react4.default.createElement("div", { className: "tool-context" }, /* @__PURE__ */ import_react4.default.createElement(Icon, { name: "branch" }), "模型调用触发展开 · 仅当前工具"), /* @__PURE__ */ import_react4.default.createElement("div", { className: "tool-content" }, renderer ? renderer(tool) : tool.kind === "browser" && tool.url ? /* @__PURE__ */ import_react4.default.createElement("div", { className: "browser-window" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "browser-toolbar" }, /* @__PURE__ */ import_react4.default.createElement("button", { className: "iconbtn", "aria-label": "刷新网页预览", onClick: () => setReload((r) => r + 1) }, /* @__PURE__ */ import_react4.default.createElement(Icon, { name: "refresh" })), /* @__PURE__ */ import_react4.default.createElement("div", { className: "address" }, /* @__PURE__ */ import_react4.default.createElement(Icon, { name: "lock" }), /* @__PURE__ */ import_react4.default.createElement("input", { readOnly: true, "aria-label": "工具页面地址", value: tool.url })), /* @__PURE__ */ import_react4.default.createElement("a", { className: "iconbtn", href: tool.url, target: "_blank", rel: "noopener noreferrer", "aria-label": "在新标签页打开" }, /* @__PURE__ */ import_react4.default.createElement(Icon, { name: "expand" }))), /* @__PURE__ */ import_react4.default.createElement("iframe", { key: reload, title: "网页预览", src: tool.url, sandbox: "allow-scripts allow-forms", referrerPolicy: "no-referrer" })) : tool.kind === "terminal" ? /* @__PURE__ */ import_react4.default.createElement("pre", { className: "terminal" }, tool.content) : /* @__PURE__ */ import_react4.default.createElement("div", { className: "code-window" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "file-tab" }, tool.title), /* @__PURE__ */ import_react4.default.createElement("pre", null, tool.content))), /* @__PURE__ */ import_react4.default.createElement("footer", { className: "tool-footer" }, "工具视图与当前会话绑定 · 收起后回到完整对话"));
168
168
  }
169
169
 
170
- // src/client/hooks/use-taskflow.mjs
170
+ // taskflow-source:src/client/hooks/use-taskflow.mjs
171
171
  var import_react5 = require("react");
172
172
  function useTaskflow(api, sessionId) {
173
173
  const [state, setState] = (0, import_react5.useState)({ plan: null, loading: true });
@@ -199,21 +199,21 @@ function useTaskflow(api, sessionId) {
199
199
  return state;
200
200
  }
201
201
 
202
- // src/client/styles.css
202
+ // taskflow-source:src/client/styles.css
203
203
  var styles_default = "/* Host-only adaptations. Component declarations are synced from the PRD. */\n.tf-panel,.tf-tool,.tf-dialog{--ink:var(--dsw-alias-label-primary,#262626);--secondary:var(--dsw-alias-label-secondary,#666);--muted:var(--dsw-alias-label-tertiary,#999);--line:var(--dsw-alias-border-l2,#eee);--surface:var(--dsw-alias-bg-base,#fff);--hover:var(--dsw-alias-interactive-bg-hover,#f5f5f5);--blue:var(--dsw-alias-state-business-primary,#4d6bfe);--hairline:1px;box-sizing:border-box;color:var(--ink);font:14px var(--dsw-font-family,system-ui,sans-serif);-webkit-font-smoothing:antialiased}\n.tf-panel *,.tf-tool *,.tf-dialog *{box-sizing:border-box}:where(.tf-panel,.tf-tool,.tf-dialog) button{font-family:inherit;color:inherit;cursor:pointer;border:0;background:none}:where(.tf-panel,.tf-tool,.tf-dialog) button:hover{background:var(--hover)}.tf-panel button:disabled,.tf-dialog button:disabled{opacity:.4;cursor:default}.tf-panel button:focus-visible,.tf-tool button:focus-visible,.tf-dialog button:focus-visible{outline:2px solid var(--blue);outline-offset:2px}.tf-panel svg,.tf-tool svg,.tf-dialog svg,.tf-entry svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle;flex-shrink:0}\n.tf-panel.tf-panel{height:100%;border:0;overflow:hidden}.tf-panel .tf-task{text-align:left;padding:0;display:block;width:100%;overflow-wrap:anywhere;border-radius:0}.tf-panel .tf-task:hover{background:none}.tf-fold{padding:0;display:inline-grid;place-items:center}.tf-panel .tf-fold svg{width:11px;height:11px}.tf-error{font-size:12px;color:#d33;overflow-wrap:anywhere;padding:8px 16px}.tf-dialog dd{white-space:pre-wrap}.tf-tool.tf-tool{height:100%;width:100%;max-width:none;min-width:0}.tf-tool iframe{display:block;border:0;width:100%;height:430px;background:white}.tf-tool .tool-header>span:first-of-type{white-space:nowrap}.tf-tool .tool-header .iconbtn{margin-left:0}\n.tf-tool-layout{display:grid!important;grid-template-columns:clamp(300px,48%,650px) minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr)!important}.tf-tool-layout>[data-conversation-content]{grid-column:2;grid-row:2;min-width:0}.tf-tool-layout>:not([data-conversation-content]):not(.tf-tool-mount){grid-column:1/-1}.tf-tool-mount{grid-column:1;grid-row:2;min-height:0;min-width:0}.tf-tool-layout.tf-tool-body{grid-template-rows:minmax(0,1fr)!important}.tf-tool-body>[data-conversation-content],.tf-tool-body>.tf-tool-mount{grid-row:1!important}.tf-entry{font:inherit;background:none;border:0;border-radius:8px;padding:5px 8px;color:inherit;cursor:pointer;display:inline-flex;align-items:center;gap:4px}.tf-entry svg{width:14px;height:14px}.tf-mobile-view{display:none}\n@media(max-width:1250px){.tf-tool-layout{grid-template-columns:minmax(245px,50%) minmax(0,1fr)!important}.tf-tool-layout .messages{padding:23px 16px}.tf-tool-layout .composer{padding:12px 14px 7px}.tf-tool-layout .suggestions{display:none}.tf-tool-layout .composer-controls .model{display:none}}\n@media(max-width:1080px){.tf-tool-layout{grid-template-columns:minmax(0,1fr)!important}.tf-tool-layout>.tf-tool-mount{grid-row:2;grid-column:1;display:none}.tf-tool-layout>[data-conversation-content]{grid-row:2;grid-column:1}.tf-tool-layout.tf-tool-show-tool>.tf-tool-mount{display:block}.tf-tool-layout.tf-tool-show-tool>[data-conversation-content]{display:none}.tf-mobile-view{display:flex;gap:2px}.tf-mobile-view button{font:inherit;font-size:11px;border:0;padding:4px 6px;border-radius:6px;background:transparent;color:inherit;white-space:nowrap;cursor:pointer}.tf-mobile-view button[aria-pressed=true]{background:var(--dsw-alias-interactive-bg-hover,#f4f5f7)}}\n\n\n@media(max-width:790px){.tf-tool-layout .tf-tool .tool-content{padding:18px 14px}}\n";
204
204
 
205
- // src/client/generated/prototype.css
205
+ // taskflow-source:src/client/generated/prototype.css
206
206
  var prototype_default = '/* Generated from docs/prototype/dsh-taskflow-prd.html.\n * Original DeepSeek UI styles: MIT; see licenses/DeepSeek-MIT.txt.\n * Run npm run build to resync. */\n:where(.tf-panel,.tf-tool,.tf-dialog) .iconbtn{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:8px;color:var(--secondary);padding:0;flex-shrink:0}\n:where(.tf-panel,.tf-tool,.tf-dialog) .iconbtn svg{width:16px;height:16px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .btn{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:36px;border:0;border-radius:12px;padding:0 14px;background:transparent;color:var(--ink);font-size:14px;line-height:22px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .btn.small{min-height:28px;height:auto;padding:4px 10px;border-radius:8px;font-size:12px;line-height:18px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .btn.outline{box-shadow:inset 0 0 0 var(--hairline) var(--dsw-alias-border-l3)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .btn.primary{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .btn.primary:hover{background:var(--dsw-alias-button-primary-hover)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .btn.blue{color:var(--blue);background:var(--dsw-specific-bubble)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .btn.danger{color:var(--dsw-alias-state-danger-primary,#ec1313)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .btn svg{width:16px;height:16px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .subtle{color:var(--muted)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .pill{display:inline-flex;align-items:center;gap:5px;background:var(--hover);color:var(--secondary);font-size:11px;line-height:18px;padding:2px 7px;border-radius:6px;white-space:nowrap}\n:where(.tf-panel,.tf-tool,.tf-dialog) .pill.blue{color:var(--blue);background:var(--dsw-specific-bubble)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .pill.success{color:var(--dsw-alias-state-success-primary,#168349);background:var(--dsw-static-green-500-a08)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dot{width:6px;height:6px;border-radius:50%;background:var(--muted);display:inline-block;flex-shrink:0}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dot.running{background:var(--blue)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dot.completed{background:var(--dsw-static-green-500)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dot.awaiting_children{background:var(--dsw-static-amber-500)}\n.tf-tool{display:flex;flex-direction:column;flex:0 0 48%;max-width:650px;min-width:300px;min-height:0;border-right:1px solid var(--dsw-alias-border-l3);background:var(--surface);order:-1}\n:where(.tf-panel,.tf-tool,.tf-dialog) .tool-header{height:38px;flex-shrink:0;display:flex;align-items:center;gap:7px;padding:0 10px;font-size:12px;border-bottom:1px solid var(--line)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .tool-header svg{width:15px;height:15px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .tool-header .binding{font-size:11px;color:var(--muted);margin-left:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n:where(.tf-panel,.tf-tool,.tf-dialog) .tool-context{height:38px;flex-shrink:0;display:flex;align-items:center;gap:6px;padding:0 12px;font-size:11px;color:var(--muted);border-bottom:1px solid var(--line)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .tool-content{flex:1;min-height:0;overflow:auto;padding:20px 16px;background:var(--dsw-specific-sidebar-fill);scrollbar-width:thin}\n:where(.tf-panel,.tf-tool,.tf-dialog) .tool-footer{padding:8px 12px;font-size:10px;color:var(--muted);border-top:1px solid var(--line);line-height:1.7}\n:where(.tf-panel,.tf-tool,.tf-dialog) .browser-window{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--surface)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .browser-toolbar{height:42px;display:flex;align-items:center;gap:5px;border-bottom:1px solid var(--line);padding:0 8px;background:var(--dsw-specific-sidebar-fill)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .browser-toolbar .iconbtn{width:22px;height:25px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .browser-toolbar .iconbtn svg{width:13px;height:13px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .address{border:1px solid var(--line);border-radius:8px;background:var(--surface);height:26px;display:flex;align-items:center;gap:5px;flex:1;min-width:0;padding:0 8px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .address svg{width:11px;height:11px;color:var(--muted)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .address input{font-size:10px;background:none;border:0;outline:0;min-width:0;width:100%;color:var(--secondary)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .code-window{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--surface)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .file-tab{background:var(--dsw-specific-sidebar-fill);padding:11px 12px;font-size:11px;border-bottom:1px solid var(--line)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .code-window pre{font:12px/2 Consolas,var(--dsw-font-family);white-space:pre-wrap;margin:0;padding:18px 14px;color:var(--secondary)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .terminal{background:var(--dsw-static-neutral-bluish-950);color:var(--dsw-static-neutral-bluish-100);padding:18px 15px;border-radius:8px;min-height:250px;font:11px/2 Consolas,var(--dsw-font-family);white-space:pre-wrap}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plugin-card{border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:18px;margin-bottom:15px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plugin-card h3{font-size:15px;margin:12px 0;font-weight:500}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plugin-card p{font-size:12px;line-height:1.9;color:var(--secondary)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .tool-caption{font-size:10px;line-height:1.8;color:var(--muted);margin:12px 0}\n.tf-panel{grid-column:3;grid-row:2;display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--surface);border-left:1px solid var(--dsw-alias-border-l3)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-tabs{display:flex;align-items:center;gap:7px;min-height:38px;height:38px;padding:0 10px;border-bottom:1px solid var(--line);font-size:12px;flex-shrink:0}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-tabs .tab{display:flex;align-items:center;gap:5px;border-bottom:2px solid var(--ink);height:38px;padding:0 6px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-tabs .tab svg{width:14px;height:14px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-tabs .iconbtn{margin-left:auto}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-heading{padding:16px 18px 14px;flex-shrink:0}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-heading h2{font-size:15px;font-weight:500;line-height:1.5;margin:0 0 8px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-heading p{font-size:12px;color:var(--muted);margin:0;line-height:1.8}\n:where(.tf-panel,.tf-tool,.tf-dialog) .progress-label{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--muted);margin-top:12px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .progress-label strong{font-weight:400;color:var(--secondary)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .progress-track{height:3px;background:var(--hover);border-radius:3px;overflow:hidden;margin-top:9px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .progress-track span{background:var(--blue);height:100%;display:block;transition:width .2s}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-controls{padding:0 16px 12px;display:flex;align-items:center;gap:7px;border-bottom:1px solid var(--line);flex-shrink:0}\n:where(.tf-panel,.tf-tool,.tf-dialog) .segments{display:flex;flex:1;padding:3px;border-radius:8px;background:var(--hover)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .segments button{flex:1;padding:4px 5px;border-radius:6px;color:var(--muted);font-size:11px;white-space:nowrap}\n:where(.tf-panel,.tf-tool,.tf-dialog) .segments button.selected{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px #00000008}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-controls select{font-size:11px;width:72px;padding:6px 2px;border:0;background:transparent;color:var(--secondary);border-radius:6px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-list{overflow:auto;flex:1;min-height:0;padding:10px 10px 16px;scrollbar-width:thin}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-row{margin:2px 0;border-radius:8px;padding:11px 8px;cursor:pointer;border:1px solid transparent}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-row:hover{background:var(--hover)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-row.focused{background:var(--dsw-specific-bubble);border-color:var(--dsw-static-deepseek-100)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-row.cancelled{opacity:.55}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-row.context-only{background:transparent}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-row.context-only .task-title{color:var(--muted)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-line{display:flex;gap:8px;align-items:flex-start}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-box{width:15px;height:15px;display:grid;place-items:center;border:1px solid var(--dsw-alias-border-l4);border-radius:4px;flex-shrink:0;margin-top:3px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-box svg{width:11px;height:11px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-box.completed{background:var(--blue);border-color:var(--blue);color:var(--dsw-static-neutral-00)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-box.running{border-color:var(--blue)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-box.running:before{content:"";width:5px;height:5px;border-radius:50%;background:var(--blue)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-copy{flex:1;min-width:0}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-title{font-size:13px;line-height:1.7;font-weight:400}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-row.completed .task-title{color:var(--muted);text-decoration:line-through;text-decoration-color:var(--dsw-alias-border-l4)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-meta{font-size:10px;color:var(--muted);display:flex;align-items:center;gap:5px;margin-top:4px;flex-wrap:wrap}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-meta code{font:10px Consolas,var(--dsw-font-family)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-row .iconbtn{height:22px;width:20px;margin-right:-3px;color:var(--muted)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-row .iconbtn svg{width:14px;height:14px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-status{display:flex;align-items:center;gap:7px;margin:8px 0 0 23px;font-size:11px;color:var(--muted);flex-wrap:wrap}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-status .pill{font-size:10px;padding:1px 5px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-status .btn{font-size:10px;min-height:23px;padding:2px 7px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .child-tasks{border-left:1px solid var(--line);margin-left:15px;padding-left:5px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-bottom{padding:12px 16px;border-top:1px solid var(--line);flex-shrink:0}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-bottom .btn{width:100%;font-size:12px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-bottom p{text-align:center;font-size:10px;color:var(--muted);margin:9px 0 0;line-height:1.8}\n:where(.tf-panel,.tf-tool,.tf-dialog) .empty{padding:35px 18px;color:var(--muted);font-size:13px;line-height:1.9;text-align:center}\n:where(.tf-panel,.tf-tool,.tf-dialog) .empty svg{width:24px;height:24px;margin-bottom:10px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .saved:before{content:"";width:5px;height:5px;border-radius:50%;background:var(--dsw-static-green-500);display:inline-block;vertical-align:2px;margin-right:5px}\n.tf-dialog{width:min(590px,calc(100vw - 28px));max-height:88dvh;padding:0;border:1px solid var(--line);border-radius:20px;background:var(--surface);color:var(--ink);box-shadow:0 10px 45px #00000020}\n.tf-dialog::backdrop{background:#00000040;backdrop-filter:blur(2px)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dialog-head{padding:21px 24px 17px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);gap:12px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dialog-head h2{font-size:17px;line-height:1.6;font-weight:500;margin:0}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dialog-head small{display:block;font-size:10px;color:var(--muted);margin-bottom:5px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dialog-body{padding:7px 24px 20px;max-height:calc(88dvh - 145px);overflow:auto;scrollbar-width:thin}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dialog-actions{border-top:1px solid var(--line);display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:7px;padding:13px 24px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .notice{background:var(--hover);border-radius:12px;padding:12px 14px;margin:15px 0;font-size:12px;line-height:1.9;color:var(--secondary)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .notice.blue{background:var(--dsw-specific-bubble);color:var(--blue)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .notice.warn{background:var(--dsw-static-amber-100);color:#9a6c25}\nbody[data-ds-dark-theme] :where(.tf-panel,.tf-tool,.tf-dialog) .notice.warn{background:var(--dsw-static-amber-900);color:var(--dsw-static-amber-400)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .field{display:block;color:var(--secondary);font-size:12px;margin:17px 0}\n:where(.tf-panel,.tf-tool,.tf-dialog) .field input,:where(.tf-panel,.tf-tool,.tf-dialog) .field textarea,:where(.tf-panel,.tf-tool,.tf-dialog) .field select{display:block;width:100%;border:1px solid var(--dsw-alias-border-l3);border-radius:8px;background:var(--surface);color:var(--ink);font-size:13px;line-height:1.8;padding:8px 10px;margin-top:7px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .field textarea{resize:vertical;min-height:85px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .field small{display:block;color:var(--muted);font-size:11px;line-height:1.8;margin-top:6px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .detail-kv{display:grid;grid-template-columns:86px 1fr;gap:12px;font-size:12px;line-height:1.9;margin:21px 0}\n:where(.tf-panel,.tf-tool,.tf-dialog) .detail-kv dt{color:var(--muted)}\n:where(.tf-panel,.tf-tool,.tf-dialog) .detail-kv dd{margin:0;overflow-wrap:anywhere}\n:where(.tf-panel,.tf-tool,.tf-dialog) .history{padding:12px 0;border-top:1px solid var(--line);font-size:12px;line-height:1.9}\n:where(.tf-panel,.tf-tool,.tf-dialog) .history time{display:block;font-size:10px;color:var(--muted);margin-bottom:4px}\n@media(min-width:1700px){.tf-tool{flex-basis:49%}\n}\n@media(max-width:1250px){:where(.tf-panel,.tf-tool,.tf-dialog) .tool-content{padding:14px 10px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-title{font-size:12px}\n}\n@media(max-width:1080px){:where(.tf-panel,.tf-tool,.tf-dialog) .plan-heading{padding:15px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-controls{padding:0 12px 12px}\n}\n@media(max-width:790px){.tf-tool{min-width:0;max-width:none;flex:1}\n:where(.tf-panel,.tf-tool,.tf-dialog) .tool-header .binding{font-size:10px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-heading{padding:20px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-controls{padding:0 18px 14px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-list{padding:0 16px 16px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-title{font-size:13px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-meta{font-size:11px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .task-row{padding:12px 10px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .plan-bottom{padding:12px 20px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dialog-head{padding:18px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dialog-body{padding:5px 18px 20px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dialog-actions{padding:12px 18px}\n:where(.tf-panel,.tf-tool,.tf-dialog) .dialog-actions .btn{font-size:12px;padding:0 10px}\n}\n';
207
207
 
208
- // src/client/index.jsx
208
+ // taskflow-source:src/client/index.jsx
209
209
  var inject = ["slots", "sessions", "connection"];
210
210
  function createApi(connection) {
211
211
  const call = async (method, data) => {
212
- const result = await connection.rpc.call("/api", method, data);
212
+ const result = await connection.rpc.call("/taskflow", method, data);
213
213
  if (!result.ok) throw new Error(result.error.message);
214
214
  return result.value;
215
215
  };
216
- return { view: (sessionId) => call("taskflow/view", { sessionId }), action: (sessionId, action, data) => call("taskflow/action", { sessionId, action, ...data }) };
216
+ return { view: (sessionId) => call("view", { sessionId }), action: (sessionId, action, data) => call("action", { sessionId, action, ...data }) };
217
217
  }
218
218
  function apply(ctx) {
219
219
  const api = createApi(ctx.connection), renderers = /* @__PURE__ */ new Map();
@@ -231,7 +231,7 @@ function apply(ctx) {
231
231
  return () => style.remove();
232
232
  });
233
233
  ctx.inject(["sidebarRightTabs", "sidebarRight", "uiWorkspace"], (scope) => {
234
- scope.effect(() => scope.sidebarRightTabs.register({ id: "dsh-taskflow", kind: "taskflow", priority: "extension", keepMounted: true, title: () => "任务导航", guide: [{ id: "taskflow", order: 0, title: () => "任务导航", description: () => "持久层级待办" }] }));
234
+ scope.effect(() => scope.sidebarRightTabs.register({ id: "dsh-taskflow", kind: "taskflow", priority: "extension", keepMounted: true, title: () => "待办任务清单", guide: [{ id: "taskflow", order: 0, title: () => "待办任务清单", description: () => "持久层级待办" }] }));
235
235
  const register = (slot, options, Component) => scope.effect(() => scope.slots.inject(slot, () => scope.slots.register({ name: slot, ...options }, Component)));
236
236
  const augment = (props, value) => {
237
237
  const binding = ctx.sessions.binding(props.sessionId);
@@ -304,7 +304,7 @@ function apply(ctx) {
304
304
  };
305
305
  }, [view.tool?.open, props.sessionId]);
306
306
  const Renderer = renderers.get(view.tool?.kind);
307
- return /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, /* @__PURE__ */ import_react6.default.createElement("button", { className: "tf-entry", onClick: () => scope.sidebarRight.openTab("taskflow") }, /* @__PURE__ */ import_react6.default.createElement(Icon, { name: "check" }), "任务导航"), view.tool?.open && /* @__PURE__ */ import_react6.default.createElement("span", { className: "tf-mobile-view" }, /* @__PURE__ */ import_react6.default.createElement("button", { "aria-pressed": !showTool, onClick: () => setShowTool(false) }, "看对话"), /* @__PURE__ */ import_react6.default.createElement("button", { "aria-pressed": showTool, onClick: () => setShowTool(true) }, "看工具")), mount && (0, import_react_dom2.createPortal)(/* @__PURE__ */ import_react6.default.createElement(ToolPanel, { tool: view.tool, onClose: () => void api.action(props.sessionId, "close-view", {}), renderer: Renderer ? (tool) => /* @__PURE__ */ import_react6.default.createElement(Renderer, { tool, sessionId: props.sessionId }) : null }), mount));
307
+ return /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, /* @__PURE__ */ import_react6.default.createElement("button", { className: "tf-entry", onClick: () => scope.sidebarRight.openTab("taskflow") }, /* @__PURE__ */ import_react6.default.createElement(Icon, { name: "check" }), "任务"), view.tool?.open && /* @__PURE__ */ import_react6.default.createElement("span", { className: "tf-mobile-view" }, /* @__PURE__ */ import_react6.default.createElement("button", { "aria-pressed": !showTool, onClick: () => setShowTool(false) }, "看对话"), /* @__PURE__ */ import_react6.default.createElement("button", { "aria-pressed": showTool, onClick: () => setShowTool(true) }, "看工具")), mount && (0, import_react_dom2.createPortal)(/* @__PURE__ */ import_react6.default.createElement(ToolPanel, { tool: view.tool, onClose: () => void api.action(props.sessionId, "close-view", {}), renderer: Renderer ? (tool) => /* @__PURE__ */ import_react6.default.createElement(Renderer, { tool, sessionId: props.sessionId }) : null }), mount));
308
308
  }
309
309
  register("conversation.session.header.utilities", { id: "taskflow", order: -5 }, SessionEntry);
310
310
  });
package/docs/DETAIL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Taskflow
2
2
 
3
- A DeepSeek Harness plugin (0.1.1) for persistent task trees, selective nested
3
+ A DeepSeek Harness plugin (0.1.2) for persistent task trees, selective nested
4
4
  sessions and direct-parent completion notifications.
5
5
 
6
6
  ## Requirements
@@ -1,6 +1,6 @@
1
1
  # 智能任务编排
2
2
 
3
- 面向 DeepSeek Harness 的智能任务编排插件(0.1.1),提供持久层级任务计划、按需子会话与完成通知。
3
+ 面向 DeepSeek Harness 的智能任务编排插件(0.1.2),提供持久层级任务计划、按需子会话与完成通知。
4
4
 
5
5
  ## 环境要求
6
6
 
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
- "title": "Taskflow (dsh-taskflow)",
3
+ "title": "dsh-taskflow",
4
4
  "description": "Persistent task planning with selective nested sessions, incremental updates and direct-parent completion notifications.",
5
5
  "detail": "README_en.md"
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
- "title": "任务编排 (dsh-taskflow)",
3
+ "title": "dsh-taskflow",
4
4
  "description": "智能任务编排插件:根据任务复杂度规划持久清单,按需委派多层子会话,完成后自动勾选并通知父任务。",
5
5
  "detail": "README.md"
6
6
  }