dsh-project-tasks 0.1.5 → 0.1.6

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.md CHANGED
@@ -17,6 +17,8 @@ board share.
17
17
  - **Agent round-trip**: `task_board_list` → `task_board_claim` →
18
18
  `task_board_complete` (→ review), plus `task_board_update` for out-of-band moves.
19
19
  A system-prompt section teaches the model the flow.
20
+ - **Session strategy**: each task runs in a new session, or reuses a chosen existing
21
+ one; the picker lists only unarchived sessions of that project, labeled by title.
20
22
  - **Auto-dispatch**: an optional poller claims `ready` tasks and dispatches a real
21
23
  agent session to execute each one.
22
24
  - **Archive**: done tasks can be archived (hidden from the board, restorable); the
@@ -45,23 +47,31 @@ board share.
45
47
  ## Install
46
48
 
47
49
  ```sh
50
+ # web
48
51
  dsh plugin --profile web add dsh-project-tasks
52
+ # desktop
53
+ dsh plugin --profile desktop add dsh-project-tasks
49
54
  ```
50
55
 
51
- Restart `dsh web` (or reopen the GUI) and refresh the page: a **Task board** entry
52
- appears in the sidebar. It is a **bundle** (`dsh.bundle`), so `dsh plugin add`
53
- inserts its loader row automatically.
56
+ Restart `dsh web` and refresh the page (web), or reopen the client (desktop): a
57
+ **Task board** entry appears in the sidebar. It is a **bundle** (`dsh.bundle`), so
58
+ `dsh plugin add` inserts its loader row automatically.
54
59
 
55
60
  ## Using it
56
61
 
57
62
  - **Create a task**: header **New task** → project (workspace), title, optional
58
- description, priority (low / normal / high), optional "mark ready now", and an
59
- optional **reuse idle session** toggle (off by default; when on, auto-dispatch
60
- continues in an idle session of the same project instead of creating a new one).
63
+ description, priority (low / normal / high), optional "mark ready now", a
64
+ **session strategy** (new session, or reuse a session you pick from that
65
+ project's unarchived sessions), and an optional **reuse idle session** toggle
66
+ (off by default, auto-dispatch only: continue in an idle session of the same
67
+ project instead of creating a new one). The strategy is stored per task; it wins
68
+ until the chosen session is archived or gone, in which case dispatch falls back
69
+ to a new session.
61
70
  - **Move**: each card has status-appropriate actions — Draft → **Confirm ready**;
62
71
  Ready → **▶ Start**; In progress → **Complete for review**; Review → **Accept** /
63
72
  **Reject**; any → **Block** / **Unblock**.
64
- - **Edit / delete**: the ✏️ button edits title, description, and priority inline;
73
+ - **Edit / delete**: the ✏️ button edits title, description, priority, and the
74
+ session strategy inline;
65
75
  the × button deletes (click twice to confirm).
66
76
  - **Prioritize**: tasks are ordered high → normal → low within each column; a
67
77
  priority filter narrows the board.
@@ -123,6 +133,10 @@ trusted at the server boundary (as the built-in HMR events route is). The write
123
133
  routes additionally refuse a cross-origin `Origin`. Run the GUI on loopback or behind
124
134
  a trusted reverse proxy, as you would the rest of DSH.
125
135
 
136
+ The API base is resolved against `document.baseURI`, so the board also works when
137
+ served under a **sub-path** (e.g. `https://host/dsh/`): after the proxy strips
138
+ `/dsh`, requests still hit `/taskboard/api/*` and `/taskboard/events`.
139
+
126
140
  ## Contact
127
141
 
128
142
  - Technical questions / bug reports: please open an [Issue](https://github.com/hyper-open/dsh-task-board/issues).
package/README.zh.md CHANGED
@@ -14,6 +14,8 @@ bundle 插件:增加一块 **任务看板**——多列看板,每个任务**
14
14
  - **agent 闭环**:`task_board_list` → `task_board_claim` → `task_board_complete`
15
15
  (→ 待验证),另有 `task_board_update` 处理其他移动。系统提示里附有使用指引。
16
16
  - **自动派发**:可选的轮询把「待处理」任务领取并**真的派发一个 agent 会话来执行**。
17
+ - **会话策略**:每个任务可选「新建会话」执行,或复用某个指定会话;选复用时的下拉只列
18
+ 该项目下未归档的会话,按对话标题显示,不是 session id。
17
19
  - **归档**:已完成任务可归档(从看板隐藏,可恢复);已完成列默认折叠,可展开。
18
20
  - **Host 权威、持久**:任务存于 Host(`storage-domain`);agent 干活时看板通过 SSE 实时刷新。
19
21
  - **零配置**:装上即用,侧边栏出现「任务看板」。
@@ -38,20 +40,25 @@ bundle 插件:增加一块 **任务看板**——多列看板,每个任务**
38
40
  ## 安装
39
41
 
40
42
  ```sh
43
+ # 网页版
41
44
  dsh plugin --profile web add dsh-project-tasks
45
+ # 桌面版
46
+ dsh plugin --profile desktop add dsh-project-tasks
42
47
  ```
43
48
 
44
- 重启 `dsh web`(或重开 GUI)并刷新页面,侧边栏出现 **任务看板** 入口。它是 **bundle**
45
- (`dsh.bundle`),`dsh plugin add` 会自动插入 Loader 行。
49
+ 网页版装完重启 `dsh web` 并刷新页面,桌面版装完重开客户端,侧边栏出现 **任务看板** 入口。
50
+ 它是 **bundle**(`dsh.bundle`),`dsh plugin add` 会自动插入 Loader 行。
46
51
 
47
52
  ## 使用
48
53
 
49
54
  - **建任务**:顶部 **新建任务** → 选项目(工作区)、标题、可选描述、优先级(低/中/高)、
50
- 可选「直接标记为待处理」,以及可选的 **复用空闲会话**(默认不勾:勾上后自动派发时,
51
- 若同项目有空闲会话就在其继续,而不是新建)。
55
+ 可选「直接标记为待处理」、**会话策略**(新建会话 / 复用会话——选复用后可挑一个该项目下
56
+ 未归档的会话),以及可选的 **复用空闲会话**(默认不勾,只作用于自动派发:勾上后若同项目
57
+ 有空闲会话就在其继续,而不是新建)。会话策略是**按任务**存的,两个开关互不覆盖:
58
+ 指定了复用就一直复用那个会话,除非它被归档或删除,此时回落到新建。
52
59
  - **推进**:卡片按状态给不同动作——待定 → **确认处理**;待处理 → **▶ 开始**;进行中 →
53
60
  **完成待验收**;待验证 → **验收通过** / **退回**;任意 → **阻断** / **解除阻断**。
54
- - **编辑 / 删除**:✏️ 按钮就地编辑标题、描述、优先级;× 按钮删除(点两次确认)。
61
+ - **编辑 / 删除**:✏️ 按钮就地编辑标题、描述、优先级、会话策略;× 按钮删除(点两次确认)。
55
62
  - **优先级**:每列内按 高 → 中 → 低 排序;顶部有优先级筛选。
56
63
  - **归档**:已完成卡有 **归档**;已完成列头有 **全部归档**;顶部 **归档** 开关进入归档视图
57
64
  (可恢复)。已完成列默认只显示最新 10 个,可展开。
@@ -101,6 +108,9 @@ DSH 只对 `/api` 做浏览器鉴权;`/taskboard` 这类自定义路由在服
101
108
  事件路由亦然)。写路由额外拒绝跨源 `Origin`。请像对待 DSH 其余部分一样,让 GUI 跑在
102
109
  loopback 或可信反向代理之后。
103
110
 
111
+ 接口前缀按 `document.baseURI` 解析,所以支持部署在**子路径**下(例如 `https://host/dsh/`):
112
+ 反向代理剥掉 `/dsh` 前缀后,请求仍然是 `/taskboard/api/*` 与 `/taskboard/events`,不会 404。
113
+
104
114
  ## 联系作者
105
115
 
106
116
  - 技术问题 / Bug 反馈:请提 [Issue](https://github.com/hyper-open/dsh-task-board/issues)。
package/lib/index.js CHANGED
@@ -11973,13 +11973,15 @@ async function dispatchTask(ctx, store, task) {
11973
11973
  const wanted = norm(task.project);
11974
11974
  try {
11975
11975
  let sessionId;
11976
- if (task.sessionMode === "reuse" && task.reuseSessionId !== void 0 && task.reuseSessionId !== "") try {
11977
- if ((await controller.list({}, new AbortController().signal)).items.some((item) => item.sessionId === task.reuseSessionId)) sessionId = task.reuseSessionId;
11978
- } catch {}
11979
- else if (task.reuseIdle === true) try {
11976
+ if (task.sessionMode === "reuse" && task.reuseSessionId !== void 0 && task.reuseSessionId !== "") {
11977
+ const target = (await controller.list({}, new AbortController().signal)).items.find((item) => item.sessionId === task.reuseSessionId);
11978
+ if (target === void 0) {} else if (target.running === true) return;
11979
+ else sessionId = task.reuseSessionId;
11980
+ } else if (task.reuseIdle === true) {
11980
11981
  const candidate = (await controller.list({}, new AbortController().signal)).items.filter((item) => item.blank !== true && item.running !== true && item.parentSessionId === void 0 && item.cwd !== void 0 && norm(item.cwd) === wanted).at(0);
11981
- if (candidate !== void 0) sessionId = candidate.sessionId;
11982
- } catch {}
11982
+ if (candidate === void 0) return;
11983
+ sessionId = candidate.sessionId;
11984
+ }
11983
11985
  if (sessionId === void 0) {
11984
11986
  const workspace = ctx.get("workspaceRegistry")?.list().find((ws) => norm(ws.path) === wanted);
11985
11987
  const created = await controller.create(workspace !== void 0 ? { workspaceId: workspace.id } : { cwd: task.project });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-project-tasks",
3
3
  "description": "Project task board for DSH: create tasks that belong to a project (workspace), let an agent pull a project's pending tasks, execute them, and mark them done — a three-column kanban (Todo / In progress / Done) with a host-authoritative task ledger and task_board_* agent tools.",
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "hyper",