@linxin666/dsh-client-ui-task-board 0.4.21 → 0.4.23

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.
Files changed (51) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +7 -6
  3. package/README.zh.md +7 -6
  4. package/lib/client.js +452 -95
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +84 -47
  7. package/lib/types/client/TaskBoardSettingsCard.d.ts +1 -1
  8. package/lib/types/client/board/AttachmentField.d.ts +3 -1
  9. package/lib/types/client/board/NewTaskModal.d.ts +4 -2
  10. package/lib/types/client/board/TaskBoard.d.ts +16 -1
  11. package/lib/types/client/board/model-options.d.ts +2 -2
  12. package/lib/types/client/index.d.ts +1 -1
  13. package/lib/types/client/locales.d.ts +4 -0
  14. package/lib/types/client/native-panel.d.ts +19 -1
  15. package/lib/types/client/session-activity.d.ts +36 -0
  16. package/lib/types/client/user-message-action.d.ts +46 -0
  17. package/lib/types/core/controller.d.ts +16 -0
  18. package/lib/types/core/model-catalog.d.ts +1 -1
  19. package/lib/types/core/tasks.d.ts +9 -0
  20. package/lib/types/core/use-cases/task-update.d.ts +25 -17
  21. package/lib/types/dsh-home.d.ts +13 -3
  22. package/lib/types/host-routes.d.ts +2 -6
  23. package/lib/types/tool-surface.d.ts +6 -2
  24. package/package.json +33 -33
  25. package/src/client/TaskBoardSettingsCard.tsx +2 -2
  26. package/src/client/board/AttachmentField.tsx +6 -1
  27. package/src/client/board/EditTaskModal.tsx +4 -1
  28. package/src/client/board/NewTaskModal.tsx +8 -6
  29. package/src/client/board/TaskBoard.tsx +59 -13
  30. package/src/client/board/TaskDetail.tsx +16 -11
  31. package/src/client/board/model-options.ts +18 -8
  32. package/src/client/board.module.css +32 -0
  33. package/src/client/index.ts +31 -19
  34. package/src/client/locales.ts +8 -0
  35. package/src/client/native-panel.tsx +85 -5
  36. package/src/client/session-activity.tsx +163 -0
  37. package/src/client/user-message-action.tsx +211 -0
  38. package/src/core/controller.ts +30 -0
  39. package/src/core/model-catalog.ts +1 -1
  40. package/src/core/store.ts +2 -0
  41. package/src/core/tasks.ts +13 -0
  42. package/src/core/use-cases/task-update.ts +29 -19
  43. package/src/dsh-home.ts +35 -12
  44. package/src/host/agent-tools.ts +8 -0
  45. package/src/host-ledger.ts +11 -5
  46. package/src/host-routes.ts +7 -16
  47. package/src/host-runner.ts +4 -4
  48. package/src/host-service.ts +6 -1
  49. package/src/index.ts +2 -3
  50. package/src/protocol.ts +4 -0
  51. package/src/tool-surface.ts +17 -2
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # node scripts/verify-docs.mjs --write <dir>
5
- README.md: e335ca2a8d9afd14d772c1de343aa8bbb4274e3d
6
- README.zh.md: 9e08d8a35c12a540bf92568a9fa99b12b725a708
5
+ README.md: 4debf1dc8285e028343ecc2673428e49ee2b6c7f
6
+ README.zh.md: 7e859368fec2cecc0aba5bbc577332dc1220dfe9
package/README.md CHANGED
@@ -3,9 +3,9 @@
3
3
  English | [中文](README.zh.md)
4
4
 
5
5
  <p align="center">
6
- <img src="https://img.shields.io/npm/v/@linxin666/dsh-task-board?style=flat-square" alt="Version">
6
+ <img src="https://img.shields.io/npm/v/@linxin666/dsh-client-ui-task-board?style=flat-square" alt="Version">
7
7
  &nbsp;
8
- <img src="https://img.shields.io/badge/DSH-%3E%3D0.2.2--rc.3-4c6ef5?style=flat-square&amp;labelColor=454a54" alt="DSH">
8
+ <img src="https://img.shields.io/badge/DSH-%3E%3D0.2.3--alpha.4-4c6ef5?style=flat-square&amp;labelColor=454a54" alt="DSH">
9
9
  &nbsp;
10
10
  <img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square" alt="License">
11
11
  </p>
@@ -38,6 +38,7 @@ Cards keep multi-line title and description previews with visible metadata. Prev
38
38
  - **Project partition (issue #1536)**: the board header offers a project row built from the deployment's DSH workspaces — "all projects" plus one entry per registered project. Selecting a project narrows the columns to the tasks pinned to it, and tasks with no pinned workspace stay visible under "all projects". Opening the new-task form while a project is open preselects that project as the task's workspace, and "new project…" registers a host directory through the same runtime call the GUI's own add-project uses. A root task created without a project choice — from the form or through the board's agent tool — inherits the workspace of the session that created it, and a card that still pins nothing runs in the deployment's most recently used workspace instead of the Host's own working directory.
39
39
  - **AI parse of pasted text (issue #1540)**: the new-task form takes text copied from anywhere and has a model turn it into the title, description, and run prompt. The model is one of the deployment's configured models (the same list the task's model pin uses, first entry preselected), and the call runs on the Host behind the board's usual loopback and same-origin fence, with a 45 s budget and a cancel affordance. The draft only fills the form: nothing is created until the task is submitted, and a failed parse leaves what you already typed untouched.
40
40
  - **Collapsible task form**: the create/duplicate/subtask dialog groups its configuration into collapsible regions — task content open by default, then labels, execution settings, run mode, handover, and scheduled runs — and every collapsed region keeps a one-line summary of the values it holds, so the dialog fits without a scrollbar (its body keeps an overflow fallback for very short windows). The agent-preset field is named "Agent preset" and lists the deployment's built-in presets under localized names plus any user preset, with an inherit default that names the preset a run without a pin actually uses.
41
+ - **Execution snapshots and post-run editing**: every execution freezes the prompt and title it was opened with onto its own record (`promptSnapshot`/`titleSnapshot`) at the moment the run starts, so a settled card's title, description and prompt stay editable between runs — an edit shapes only the next run, while execution history always answers from each record's own snapshot instead of the card's live text. Legacy records without these optional fields keep rendering as-is and are never backfilled with a guess. Attachments do not unlock: the execution record does not snapshot them, so they stay frozen after the first run — change them via Duplicate as new copy. A card mid-run and an archived card keep their content locked.
41
42
  - **Card attachments (issue #1979)**: a card may carry up to eight files and images. The create and edit forms accept them three ways — drag and drop, paste, and the file picker — and a picked file stays a LOCAL preview until the card is saved: the upload happens on save, so a card the user abandons leaves no stored object behind. The drop area is focusable and keyboard-operable, and the removal controls are disabled while a save is in flight. An image is stored as a raster image and travels with the execution as an image part of the prompt, placed after the text part; any other file is stored verbatim and reaches the execution session as a readable host path in a read-only attachment section of its own, separate from the handover references. The card keeps METADATA only — the kind, the stored identifier, the name, the size, the media type, the digest of the exact stored bytes, and the pixel size of an image — never the bytes, never base64, never a data URL. The display name is always one canonical line without any path part, so it can neither break the prompt nor point at a directory. Before the ledger commits an attachment, the Host proves the claim against the official attachment storage: an image is read back and compared, a file is streamed and its digest recomputed, and a reference the storage cannot prove refuses the whole action, so a spoofed client claim never becomes a stored fact. Every execution resolves the attachments afresh, and a route that declares it cannot read images refuses the run before the prompt is queued. The board's limits are eight attachments per card, 10 MiB per attachment and 32 MiB per card; a deployment whose own attachment storage is stricter — including its per-message image budget — lowers the published limit, and the Host enforces that budget both when it writes the card and when the execution resolves it. One stored object is claimed once: the same content never appears twice on a card.
42
43
  - **Host-authoritative ledger**: tasks, schedules, and execution records live in `$DSH_HOME/task-board/ledger-v2.json`; browser actions become confirmed Host transactions.
43
44
  - **Bounded execution history**: each task keeps the most recent 20 execution records; the oldest runs are trimmed when a new run starts, so ledger size and write cost stay bounded regardless of how often a task has run.
@@ -54,7 +55,7 @@ Cards keep multi-line title and description previews with visible metadata. Prev
54
55
  - **Agent tools**: every session gets eight model-facing tools (`task_board_list`, `task_board_get`, `task_board_create`, `task_board_update`, `task_board_set_parent`, `task_board_run`, `task_board_manage`, `task_board_schedule`) that drive the same Host ledger the browser drives, so an agent can list the board, create subtasks, link or detach them, start a run, move a card to any column (declaring it done, failed, or in progress without a run), archive/restore/delete it, settle a card the board can no longer observe, and arm its cron schedule from the conversation.
55
56
  - **External outcomes (issue #1826)**: work that is not executed by this Host — an agent outside DSH such as Codex or Claude Code, running its own model — can be recorded as a real run rather than a bare column edit. `task_board_manage(action: 'record-external-outcome', result: 'succeeded'|'failed', initiatedBy: <who>)` appends an execution record carrying the verdict, the caller and an optional summary, and the terminal column is derived from that same record by the same rule a Host settlement uses (`core/tasks.ts` `settledStatus`). The record is marked `external`, never carries a session, and is refused while the card still has an open execution (while this Host is running the card it stays the only authority) and on an archived card. `running` and `cancelled` cannot be recorded this way: those stay Host-only. A manual `move-done`/`move-failed` remains available and still writes only the column — the difference is that this one leaves a record behind, so the column and the run history can never disagree.
56
57
 
57
- - **External provider extensions**: the GitHub Issues extension (`@linxin666/dsh-client-ui-task-board-github`, enabled by default) synchronizes GitHub Issues into board cards. It is a provider of THIS board, so its configuration renders inside this plugin's own settings card — the section only appears while the extension is installed, and its repository/credential form only while the extension is on; see [its README](../dsh-task-board-github/README.md).
58
+ - **External provider extensions**: the board exposes a provider contract consumed by four official companion extensions—GitHub Issues sync (`@linxin666/dsh-client-ui-task-board-github`, enabled by default; see [its README](../dsh-task-board-github/README.md)), Cloud Team Hub collaboration (`@linxin666/dsh-client-ui-task-board-team`; see [its README](../dsh-task-board-team/README.md)), Mobile Remote surface (`@linxin666/dsh-task-board-remote`; see [its README](../dsh-task-board-remote/README.md)), and SSH Remote execution (`@linxin666/dsh-client-ui-task-board-ssh`; see [its README](../dsh-task-board-ssh/README.md)). Extensions with GUI settings render their own collapsible sections inside this plugin's settings card whenever installed.
58
59
 
59
60
  ## Architecture and protocol
60
61
 
@@ -96,14 +97,14 @@ For local development:
96
97
  ```sh
97
98
  git clone https://github.com/zhu1090093659/dsh-web.git
98
99
  cd dsh-web
99
- pnpm install
100
+ pnpm run deps:install
100
101
  pnpm build
101
102
  dsh plugin --profile web add link:$(pwd)/packages/dsh-task-board
102
103
  ```
103
104
 
104
105
  ## Configuration
105
106
 
106
- This plugin's settings card groups its options into collapsible sections — Basics, New-card defaults, and the section a provider extension contributes (the GitHub Issues integration). Every section starts collapsed. A change takes effect as it is made: a pick is written at once, and a typed value once typing pauses, on Enter, or when the field is left; Escape puts the stored value back.
107
+ This plugin's settings card groups its options into collapsible sections — Basics, New-card defaults, and any section contributed by installed provider extensions (such as GitHub Issues, Team Hub, and SSH remote execution). Every section starts collapsed. A change takes effect as it is made: a pick is written at once, and a typed value once typing pauses, on Enter, or when the field is left; Escape puts the stored value back.
107
108
 
108
109
  | Key | Default | Behavior |
109
110
  | --- | --- | --- |
@@ -161,7 +162,7 @@ On macOS the backend starts `/usr/bin/caffeinate -i -w <host-pid>` and never req
161
162
 
162
163
  ## Build and test
163
164
 
164
- Node 20 or newer and the official NPM SDK packages are required; no DSH source checkout is used.
165
+ Node ^24.22.3 || >= 26.13.1 and the official NPM SDK packages are required; no DSH source checkout is used.
165
166
 
166
167
  ```sh
167
168
  pnpm --filter @linxin666/dsh-client-ui-task-board typecheck
package/README.zh.md CHANGED
@@ -3,9 +3,9 @@
3
3
  [English](README.md) | 中文
4
4
 
5
5
  <p align="center">
6
- <img src="https://img.shields.io/npm/v/@linxin666/dsh-task-board?style=flat-square" alt="Version">
6
+ <img src="https://img.shields.io/npm/v/@linxin666/dsh-client-ui-task-board?style=flat-square" alt="Version">
7
7
  &nbsp;
8
- <img src="https://img.shields.io/badge/DSH-%3E%3D0.2.2--rc.3-4c6ef5?style=flat-square&amp;labelColor=454a54" alt="DSH">
8
+ <img src="https://img.shields.io/badge/DSH-%3E%3D0.2.3--alpha.4-4c6ef5?style=flat-square&amp;labelColor=454a54" alt="DSH">
9
9
  &nbsp;
10
10
  <img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square" alt="License">
11
11
  </p>
@@ -32,6 +32,7 @@
32
32
  - **交接包与权限确认门**:续接卡片可附交接包——钉住三元组(工作区/agent 预设/权限)加文档与脚本引用。执行时交接包三元组覆盖普通钉住字段,引用以交接前言随 Prompt 下发。有效权限高于部署权限基线——未钉住 `sessionDefaultPermission` 时即宿主自己的默认权限预设——的绑定处于待确认状态:手动执行被拒绝、cron 跳过该卡并滚动到下一触发点,任务详情中的确认按钮完成人工确认;此后任何权限或交接包变更都会重新武装确认门。
33
33
  - **领卡来源声明包裹与来源审计**:执行续接卡片(带冻结快照的卡片)时,任务指令被来源声明模板强制包裹——冻结时间、来源会话与未经人工审查提示,组合在交接前言之后,使接手 Agent 对卡片文本中的存储型提示注入保持警惕。create/update 动作的发起方会话织入快照(frozenBy,快照被替换时重新盖章),run/rerun 的发起方会话连同冻结来源的捕获副本一起落在执行记录(initiatedBy)上,两者均可在任务详情查看。发起方为客户端断言的审计元数据,不构成信任边界。
34
34
  - **任务标签(issue #1521)**:每个任务可带最多八个标签。标签在卡片上渲染为带色调的徽章——色调由标签名哈希得到,因此同一标签永远同色,也不需要存储颜色;看板顶栏据此提供多选标签筛选,候选项来自全账本在用的标签(含已归档任务),搜索也会匹配标签名。填了「执行提示」的标签会在每次执行前以 `标签提示` 段注入到执行 Prompt 之前;没填的标签只作展示与筛选,因此无标签任务的 Prompt 与加入该功能前逐字节一致。标签在首次执行后仍可编辑:它们给任务分类、塑造下一次运行,而不是「已经跑过什么」的凭证。筛选行的**管理标签**入口会打开标签管理器:列出每个在用标签及其任务数,重命名会写到所有卡片上(与已有同名标签合并,并保留该标签的执行提示),删除会从全部任务(含已归档)上移除。两者都是 Host 的整账本事务,因此多个窗口看同一块看板时状态一致。
35
+ - **执行快照与跑后编辑**:每次执行在开启瞬间把当时的执行 Prompt 与标题冻结为该执行记录的字段(`promptSnapshot`/`titleSnapshot`),因此已结算卡片的标题、描述与 Prompt 在两次运行之间保持可编辑——修改只影响下一次运行,执行历史永远从各自记录的快照作答,而不是卡片当前文本;没有这两个字段的旧执行记录照常展示,绝不回填伪造。附件不随此解锁:执行记录不快照附件,附件仍在首次执行后固定,改动请走「修改并新建副本」。运行中的卡片与归档卡片依旧锁定内容。
35
36
  - **标签清理**:标签管理器里的**清理**一行给出一个阈值输入框(默认 5,可填 1 到 99),用来清掉看板已经不再使用的标签。携带某个标签的任务数小于该阈值、且这些任务全部是已完成或已失败时,这个标签成为候选;已归档卡片按同一口径参与,所以归档后已结算的卡片会让它的标签放行,归档后仍未完成的卡片会把标签留住。清理先算出候选再动账本:没有候选时只说明这一点、不碰账本;有候选则打开确认框,逐个列出标签与携带它的任务数,确认后每个标签都走管理器的删除按钮所用的同一笔整账本删除。标签会从所有卡片(含已归档)上移除,执行提示随之一并消失,任务本身不受其他影响;删除不可撤销。
36
37
  - **子任务与父卡自治派发**:任务可以有子任务——在详情页新建子任务(表单以父任务的工作区、模式、权限和模型为起点,每一项都可覆盖),或把一个还没有父任务的现有任务关联为子任务;子任务不在运行中时也可以解除关联。父子关系的准入由 Host 判定:父任务必须存在且在看板上、任务不能挂到自己的后代之下、树的深度不得超过配置的 `maxSubtaskDepth`(默认 1 层,最大 3 层)。执行一张卡只为这张卡开一个会话,不为它的子任务开任何会话;直接点某张子卡执行也是同一件事:它自己就是这次运行的 root,即使它有父卡、自己也有子任务,也不会展开。已在「完成」列的子任务不在这次的派发集合里,因此把子任务逐个做完再执行父卡只花一个会话,而不是整棵树重来;需要重新派发就把它移回「待办」列。看板会标注父任务与子任务卡片,详情页列出直接子任务并说明一次执行会怎么做,顶栏提供一键隐藏子任务。
37
38
  - **父卡自治派发与子卡记账**:点击一张带未完成子任务的卡,只开这张卡自己的会话,别的都不开。这次执行强制使用 `packages/dsh-liangshen` 提供的 `liangshen` 派发预设,卡片自己存的 Agent 预设绝不被改写,session 复用被跳过、新开一个会话;部署没有注册 `liangshen` 预设时失败关闭,原因写在卡片上;运行 legacy Agent Teams 那一代的部署同样失败关闭——该预设在那里无法编排,只会停下来等人回复,而无人值守的运行等不到回复:这次执行在任何会话存在之前就被拒绝,卡片上写明出口。启动 Prompt 会列出每张未完成子卡的标题、任务 id 与状态,说明本次不为它们开会话,并要求这个会话用 `task_board_get` 读每张子卡、用 `subagent` 按依赖顺序派发(互不依赖的可以并发)、完工前用 `task_board_manage({action:'record-external-outcome'})` 把结论一次性写回。会话没有回填的结论由 Host 在父卡自身运行结束时补上:仍未回填的未完成子卡继承这次运行的判定,记为一条 external 记录,发起方写作 `parent-run:<父卡 id>`,原因说明本卡未单独开会话执行、结论继承自父卡运行。这次回填幂等,父卡判定为 cancelled 时不写。没有未完成子任务的卡不受影响。
@@ -54,7 +55,7 @@
54
55
  - **Agent 工具**:每个会话都可使用八个面向模型的工具(`task_board_list`、`task_board_get`、`task_board_create`、`task_board_update`、`task_board_set_parent`、`task_board_run`、`task_board_manage`、`task_board_schedule`),它们驱动与浏览器完全相同的 Host 账本,因此 agent 可以在对话里列出看板、创建子任务、关联或解除关联、执行一张卡片、把卡片移到任意列(含不经执行直接声明完成、失败或进行中)、归档/恢复/删除卡片、对看板已无法观察的卡片强制结算,以及为卡片配置 cron 计划。
55
56
  - **Host 之外完成的执行结果(issue #1826)**:不由本 Host 执行的工作——例如在 DSH 之外用各自模型工作的 Codex、Claude Code——可以登记成一次真实执行,而不是只改一列。`task_board_manage(action: 'record-external-outcome', result: 'succeeded'|'failed', initiatedBy: <完成者>)` 会追加一条 execution 记录,带上判定、完成者与可选摘要;终态列由这条记录推导,与 Host 结算走同一条规则(`core/tasks.ts` 的 `settledStatus`)。该记录带 `external` 标记、永远不带 session,并在卡片仍有未结算 execution 时被拒绝(本 Host 正在执行时它才是唯一权威),归档卡片同样拒绝。`running` 与 `cancelled` 不能这样登记:它们只属于 Host。手工 `move-done`/`move-failed` 仍然可用,也仍然只写列——区别在于这一条会留下记录,因此列与执行历史永远不会脱节。
56
57
 
57
- - **外部提供方扩展**:GitHub Issues 扩展(`@linxin666/dsh-client-ui-task-board-github`,默认开启)把 GitHub Issues 同步成看板卡片。它是本看板的提供方,因此其配置渲染在本插件自己的设置卡里——仅当扩展已安装时该区块才出现,且只有扩展开启时才显示仓库与凭据表单;见[扩展包 README](../dsh-task-board-github/README.zh.md)。
58
+ - **外部提供方扩展**:看板通过统一提供方契约挂载四个官方伴生扩展——GitHub Issues 同步(`@linxin666/dsh-client-ui-task-board-github`,默认开启,见[扩展包 README](../dsh-task-board-github/README.zh.md))、云端团队协作(`@linxin666/dsh-client-ui-task-board-team`,见[扩展包 README](../dsh-task-board-team/README.zh.md))、手机远端面(`@linxin666/dsh-task-board-remote`,见[扩展包 README](../dsh-task-board-remote/README.zh.md))与 SSH 远端执行(`@linxin666/dsh-client-ui-task-board-ssh`,见[扩展包 README](../dsh-task-board-ssh/README.zh.md))。带 GUI 设置的扩展在安装后将各自的配置区块渲染在本插件自己的设置卡内。
58
59
 
59
60
  ## 架构与协议
60
61
 
@@ -96,14 +97,14 @@ dsh plugin --profile web add @linxin666/dsh-client-ui-task-board@latest
96
97
  ```sh
97
98
  git clone https://github.com/zhu1090093659/dsh-web.git
98
99
  cd dsh-web
99
- pnpm install
100
+ pnpm run deps:install
100
101
  pnpm build
101
102
  dsh plugin --profile web add link:$(pwd)/packages/dsh-task-board
102
103
  ```
103
104
 
104
105
  ## 配置
105
106
 
106
- 本插件的设置卡把选项组织成可折叠的分区——基础、新建卡片默认值,以及提供方扩展(GitHub Issues 集成)贡献的分区。每个分区默认折叠。改动即时生效:点选的选项立刻写入,输入的值在停止输入、按 Enter 或离开输入框时写入;按 Escape 恢复已保存的值。
107
+ 本插件的设置卡把选项组织成可折叠的分区——基础、新建卡片默认值,以及已安装的提供方扩展贡献的分区(如 GitHub Issues、Team Hub 与 SSH 远端执行)。每个分区默认折叠。改动即时生效:点选的选项立刻写入,输入的值在停止输入、按 Enter 或离开输入框时写入;按 Escape 恢复已保存的值。
107
108
 
108
109
  | 键 | 默认值 | 行为 |
109
110
  | --- | --- | --- |
@@ -161,7 +162,7 @@ macOS 后端启动 `/usr/bin/caffeinate -i -w <host-pid>`,绝不请求 `-d`。
161
162
 
162
163
  ## 构建与测试
163
164
 
164
- 需要 Node 20 或更高版本及官方 NPM SDK 包;不使用 DSH 源码 checkout。
165
+ 需要 Node ^24.22.3 || >= 26.13.1 及官方 NPM SDK 包;不使用 DSH 源码 checkout。
165
166
 
166
167
  ```sh
167
168
  pnpm --filter @linxin666/dsh-client-ui-task-board typecheck