@yolk_vat-y/dsh-project-memory 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.4 (2026-09-06)
4
+
5
+ ### Added
6
+ - **Task data/UI store separation**: `task-data-store.ts` (server-synced data + BroadcastChannel cross-tab sync) and `task-ui-store.ts` (local UI state + localStorage) completely decoupled
7
+ - **Explicit panel open**: panel only opens on `/tasks`, `/task` (list form), or model calling `show_task_panel` tool
8
+ - **Cross-tab data sync**: BroadcastChannel broadcasts only tasks/archivedCount; UI state (closed/minimized/position) stays per-tab
9
+ - **Model tool `show_task_panel`**: model can now explicitly summon the panel via event bus
10
+
11
+ ### Fixed
12
+ - **Default hidden on startup**: `closed: true` forced, ignores localStorage residue
13
+ - **No auto-open on page refresh**: UI `closed` state not persisted, refresh = hidden
14
+ - **No auto-open on session switch**: only data syncs in background; panel closed = no `/tasks` command
15
+ - **MiniBar collapse crash**: fixed `useTaskDrag` hook called in event handler (React hooks rule violation) causing "任务面板(点击重试)" error boundary
16
+ - **Command node side effects**: `TaskCommandNode` now only syncs data; list commands explicitly call `open()`
17
+
18
+ ### Refactored
19
+ - Removed legacy `task-store.ts` (232 lines)
20
+ - Split into 4 single-responsibility modules:
21
+ - `task-data-store.ts` — server data + cross-tab sync (~180 lines)
22
+ - `task-ui-store.ts` — local UI state + localStorage (~120 lines)
23
+ - `task-hooks.ts` — `useTaskDrag` / `useTaskEdit` (~150 lines)
24
+ - `TaskComponents.tsx` — `MiniBar` / `TaskCard` presentational (~330 lines)
25
+ - `TaskPanel.tsx` slimmed to container (~380 lines): data fetching, command bridging, event listening
26
+
27
+ ### Tested
28
+ - Unit tests: 166 passed
29
+ - TaskBridge integration: 11 passed
30
+ - Client build: ✅
31
+ - Full harness build: ✅
32
+
33
+ ## 0.4.3 (2026-09-04)
34
+ ### 修复
35
+ - **CI 依赖解析**:锁定 devDependencies 版本,新增 package-lock.json
36
+
3
37
  ## 0.4.2 (2026-09-04)
4
38
 
5
39
  ### Task Panel 重构:真实 dsh web 契约 + 任务清单双向同步
package/README.md CHANGED
@@ -4,12 +4,27 @@
4
4
 
5
5
  [![ci](https://github.com/00080000/dsh-project-memory/actions/workflows/ci.yml/badge.svg)](https://github.com/00080000/dsh-project-memory/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![npm](https://img.shields.io/npm/v/@yolk_vat-y/dsh-project-memory)](https://www.npmjs.com/package/@yolk_vat-y/dsh-project-memory) [![Listed on dsh-plugin.org](https://dsh-plugin.org/badges/listed.svg)](https://dsh-plugin.org/plugins/00080000/dsh-project-memory) [![Awesome](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
6
6
 
7
- A persistent **project memory** for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) agents. Built for software development: the agent's task list (todo_write) and file reads are continuously consolidated into durable cross-session task records, solving context loss. Documents (PDF/Markdown/txt) and code symbols are indexed into a per-workspace store with doc↔symbol cross-links. Experience notes (problem → solution) are deduplicated automatically. All data stored per-project on disk, survives session compaction, recalls with `path:line` citations for verification. Zero external dependencies (only `pdfjs-dist` for PDF text), no vector DB, no native builds.
7
+
8
+ A persistent **project development memory** for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) agents. Built specifically for project development, natively integrated with dsh's task system: task lists and files read during a session are automatically persisted as cross-session task records, with tasks ↔ files linked — workflows can be switched and resumed, no need to re-scope the whole project, solving context loss. Documents (PDF/Markdown/txt) and code symbols are stored separately per workspace; documents are automatically cross-linked to the code symbols they mention. Experience notes (problem → solution) are automatically deduplicated, preventing repeated mistakes. All data is stored per project on disk, survives session compaction and handover; recalls include `path:line` citations for source verification. Only one dependency, no vector DB, no native builds.
8
9
 
9
10
  > The plugin keeps a compact project **memory** on disk, with every entry pointing to a concrete file and line — the agent can reorient quickly instead of re-reading the whole project. Tasks and experience persist across session compactions and handovers.
10
11
 
12
+ ![alt text](docs/images/image.png)
13
+ The workflow panel is collapsible, automatically adapts to dsh and theme plugin styles, and offers four card style options to switch between.
14
+ ![alt text](docs/images/image-4.png)
11
15
  ## Features
12
16
 
17
+ - **TaskBridge: cross-session development tasks** — the plugin watches each session's live todo list (`todo_write` events) and file reads (`tool/call`): progress snapshots (`steps`) and touched files sync into durable per-project task entities. An unbound session that writes a todo auto-creates a task. New sessions continue by `list_tasks` → `select_task` (bind / rename / unarchive); `query_memory` gains `type: 'task'` and appends a task-count hint to `type: 'all'` results. The user-side `/tasks` command shows the task stack, step progress, involved files, and the current session binding. Titles are chosen by the model via `select_task(title=…)` (fallback: the part of your message after the last colon). Capacity is project-size adaptive (`fileCount/20`, clamped 5–100). Storage: `.dsh-project-memory/tasks.json` + `binding.json`. Auto-sync requires a dsh build with session events + `todo_write` (verified on 0.1.2-alpha.x); on older hosts the task tools still work as a plain record list.
18
+ - **Task Panel (v0.4.2+): Floating task panel in dsh web** — built on the real dsh web 0.1.2-rc.1 client plugin contract (cordis inject + apply, registered into host `shell.overlay` slot). Draggable cards show steps/files (click to copy path); collapse to a draggable mini-bar; hide completely (summon with `/task` / `/tasks`). Render errors have error boundaries — panel crash no longer takes down the host.
19
+ - **Task Panel Behavior** —
20
+ - **Default hidden**: panel does not show on dsh web startup
21
+ - **Explicit summon**: type `/tasks` or `/task` (list form) to open; model calls `show_task_panel` tool to open
22
+ - **Session switch**: only syncs data in background, **does not** auto-open panel
23
+ - **Page refresh**: panel stays hidden (UI state `closed` not persisted)
24
+ - **Manual close**: click × to fully hide (no mini-bar); reopen requires explicit summon
25
+ - **Collapse to mini-bar**: click ↓ to keep draggable top bar; click bar to expand
26
+ - **Bidirectional task-list sync (host ↔ plugin tasks, v0.4.2+)** — `select_task` or `/task switch` pushes task steps to host `todo/write` so dsh's rendered task list mirrors the plugin's task entity. Config `tasklist.syncHostOnAdopt` (default on) to toggle. Empty `todo/write` means "clear": unbound session clears list without creating junk tasks; bound session clears that task's steps (task retained). Panel edits (step text/status) = write back bound task + push host list, sharing one code path with model `todo_write`. `/task` subcommands: `switch`, `archive`, `unbind`, `rename`, `todos` (invoked by panel buttons/clicks, not the model); `unbind` also clears the host task list above the input.
27
+ - **Panel editing & themes (v0.4.2+)** — bound cards: double-click title/step for inline edit (input auto-grows); click step status icon to cycle todo→in-progress→done. Non-bound cards read-only. **Four visual themes** (click folder icon left of title, persisted locally): Native / Glassmorphism / Brutalist / Terminal monospace — only material, geometry, typeface, density change; colors always use dsw alias tokens, follow host light/dark and theme plugins.
13
28
  - **Document memorization** — PDF, Markdown, and plain text files are chunked and summarized by the LLM; each entry carries a `path:line` citation back to the source.
14
29
  - **Code symbol memory** — function, class, and method names with full type signatures (generics, parameters, return types, overloads) are extracted by a dependency-free source scanner (string/comment masking, multi-line signature joining, indentation-aware Python, class-method context), without LLM token usage.
15
30
  - **L1 Enhanced Regex** — zero-dep regex scanner now extracts generics, parameter/return types, overloads, interfaces, and type aliases for all supported languages, producing one-line identity signatures `fn(a: A, b: B): R — file.ts:42`.
@@ -22,7 +37,6 @@ A persistent **project memory** for [DeepSeek Harness](https://github.com/deepse
22
37
  - **Experience notes** — problems → solutions; similar problems supersede instead of duplicating, and notes are returned only when a search matches. The note store is bounded: capacity scales with project size (clamped to 100–2000), and the oldest notes are pruned when the limit is exceeded. **Supersede tightened to bidirectional 0.7 overlap** (was 0.6); **experience `problem` field now participates in CJK phrase boost** for long-tail query recall.
23
38
  - **Streaming TF + IDF caching** — query path caches IDF (term inverse frequency) per store version; on cache hit, single-pass streaming scores 20k entries in ~8 ms (5k files) / ~1 ms (1k files) with zero intermediate objects; write path is O(1) version bump.
24
39
  - **Lock-free sync transactions** — all writes (index / watch / remember / forget / watch_repo) go through synchronous transactions `store.commit(fn)`; fn succeeds then atomic write; JS single-threaded event loop guarantees no interleaving; `remember`/`forget` never blocked by watch re-indexing.
25
- - **TaskBridge: cross-session development tasks** — the plugin watches each session's live todo list (`todo_write` events) and file reads (`tool/call`): progress snapshots (`steps`) and touched files sync into durable per-project task entities. An unbound session that writes a todo auto-creates a task. New sessions continue by `list_tasks` → `select_task` (bind / rename / unarchive); `query_memory` gains `type: 'task'` and appends a task-count hint to `type: 'all'` results. The user-side `/tasks` command shows the task stack, step progress, involved files, and the current session binding. Titles are chosen by the model via `select_task(title=…)` (fallback: the part of your message after the last colon). Capacity is project-size adaptive (`fileCount/20`, clamped 5–100). Storage: `.dsh-project-memory/tasks.json` + `binding.json`. Auto-sync requires a dsh build with session events + `todo_write` (verified on 0.1.2-alpha.x); on older hosts the task tools still work as a plain record list.
26
40
  - **Minimal dependencies** — pure JavaScript; the only runtime dependency is `pdfjs-dist` (PDF text extraction), no native builds required.
27
41
  - **Negligible overhead** — pure in-process operation; cold start <100 ms (5k files), typical project query median 2–3 ms (p99 < 7 ms); bottleneck is LLM summarization and PDF parsing, not the plugin.
28
42
 
@@ -103,7 +117,9 @@ The tools below are **invoked by the agent**, not typed by the user. In the chat
103
117
  | `list_tasks` | List task records for the project (archived marked). Call first in a new session before continuing work. |
104
118
  | `select_task` | Bind the session to a task so its todo list and file reads sync into it. Exact `taskId`, or exact `title` (multiple matches return candidates; no match creates a new task). Pass `title` with `taskId` to rename. Auto-unarchives. |
105
119
  | `archive_task` | Archive a task (hide from default views, exclude from capacity, stop syncing). `select_task` restores it. |
120
+ | `show_task_panel` | Show the task panel in the UI. Call when the user asks to see the task list or when you want to display the panel. |
106
121
  | `/tasks` (typed by the user, not the model) | Shows the task stack: title, step progress, involved files, and which task the current session is bound to. |
122
+ | `/task` (typed by the user, not the model) | Task panel subcommands: `switch` / `archive` / `unbind` / `rename` / `todos`. Invoked by panel buttons/clicks; does not go through the model. |
107
123
  | `remember problem solution` | Save an experience note. Similar problems supersede instead of duplicating. |
108
124
  | `forget id_or_query` | Delete stale experience notes. |
109
125
 
@@ -113,9 +129,11 @@ The tools below are **invoked by the agent**, not typed by the user. In the chat
113
129
  .dsh-project-memory/
114
130
  format.json layout marker (v2, sharded)
115
131
  shards/ one self-describing JSON per indexed source file
116
- ({ relPath, record, entries }) — writes touch only dirty shards
132
+ ({ relPath, record, entries }) — writes touch only dirty shards
117
133
  experience.json problem → solution notes (retrieval-only)
118
134
  watch.json watched roots
135
+ tasks.json TaskBridge task entities (cross-session)
136
+ binding.json current session ↔ task binding
119
137
  ```
120
138
 
121
139
  Stores created before v0.2.0 (single `entries.json` / `index.json`) migrate automatically and idempotently on first load. Within one dsh process, all tool calls share a single in-memory store per project, so hot-path indexing writes only the shard that changed.
@@ -125,6 +143,16 @@ Stores created before v0.2.0 (single `entries.json` / `index.json`) migrate auto
125
143
  - **Query expansion** — when `llmQueryExpansion` is on, `query_memory` asks `ctx.llm` to rewrite the query into several variants (synonyms, EN/CN, identifier guesses) and merges BM25 scores across variants; when off, queries never touch the LLM. Cross-language recall (a Chinese question hitting English content) comes from index time instead: doc keywords are required to cover the document's own language AND English, and doc↔symbol links surface English symbol names from Chinese hits.
126
144
  - **Consistency** — the fact layer follows the codebase (hash re-extract / remove-on-delete); the experience layer is retrieval-only with supersede and `forget`. Store writes are serialized per memory directory; the lock is in-process, so avoid running multiple dsh instances against the same project store concurrently.
127
145
 
146
+ ## Architecture (Task Panel)
147
+
148
+ ```
149
+ TaskPanel (Container)
150
+ ├── task-data-store (server data, cross-tab sync via BroadcastChannel)
151
+ ├── task-ui-store (local UI state, localStorage)
152
+ ├── task-hooks (useTaskDrag, useTaskEdit)
153
+ └── TaskComponents (MiniBar, TaskCard — presentational only)
154
+ ```
155
+
128
156
  ## Design tradeoffs
129
157
 
130
158
  These are deliberate scope choices.
@@ -219,6 +247,7 @@ These are deliberate scope choices.
219
247
  | `maxFileSizeMb` | 50 | skip documents (incl. PDF) and code files larger than this (MB) |
220
248
  | `maxOutputChars` | 8000 | cap for `query_memory` result text (chars) |
221
249
  | `tasklist.enabled` | true | enable TaskBridge auto-sync (task entities from the session todo list and file reads) |
250
+ | `tasklist.syncHostOnAdopt` | true | when `select_task`/`/task switch` binds a task, push its steps to host `todo/write` so dsh's task list mirrors the task |
222
251
  | `maxPdfPages` | 1000 | PDF page cap when pages are not otherwise limited |
223
252
  | `llmQueryExpansion` | false | expand queries via `ctx.llm` before BM25 (off by default to save tokens) |
224
253
  | `expansionCount` | 6 | max expansion variants |
@@ -263,7 +292,7 @@ These commands are for **maintaining the plugin code** — regular users do not
263
292
 
264
293
  ```bash
265
294
  npm install
266
- npm test # 166 tests (v0.4.0) + TaskBridge suite (node test/taskbridge.test.mjs, 5)
295
+ npm test # 177 tests (166 core + 11 TaskBridge)
267
296
  ```
268
297
 
269
298
  ## License
package/README.zh-CN.md CHANGED
@@ -4,12 +4,28 @@
4
4
 
5
5
  [![ci](https://github.com/00080000/dsh-project-memory/actions/workflows/ci.yml/badge.svg)](https://github.com/00080000/dsh-project-memory/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![npm](https://img.shields.io/npm/v/@yolk_vat-y/dsh-project-memory)](https://www.npmjs.com/package/@yolk_vat-y/dsh-project-memory) [![Listed on dsh-plugin.org](https://dsh-plugin.org/badges/listed.svg)](https://dsh-plugin.org/plugins/00080000/dsh-project-memory) [![Awesome](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
6
6
 
7
- 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)agent 提供持久化的 **项目开发记忆**。针对项目开发,任务清单与读过的文件自动沉淀为跨会话的任务记录,解决上下文失效;文档(PDF/Markdown/txt)与代码符号写入工作区独立存储,文档自动交叉链接至所提及的代码符号;经验笔记(问题 → 方案)自动去重,避免重复踩坑。所有数据按项目落盘,跨会话压缩与交接保留,召回附带 `路径:行号` 可回源核实。零外部依赖(仅 `pdfjs-dist` 提取 PDF 文本),无向量数据库,无原生构建。
7
+ 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)agent 提供持久化的 **项目开发记忆**。专门针对项目开发,原生融合 dsh 任务系统,会话内任务清单与读过的文件自动沉淀为跨会话任务记录,任务↔文件自动关联——开发工作流可切换、可续接,无需重复梳理整个项目,解决上下文失效;文档(PDF/Markdown/txt)与代码符号写入工作区独立存储,文档自动交叉链接至所提及的代码符号;经验笔记(问题 → 方案)自动去重,避免重复踩坑。所有数据按项目落盘,跨会话压缩与交接保留,召回附带 `路径:行号` 可回源核实。单依赖,无向量数据库,无原生构建。
8
+
8
9
 
9
10
  > 插件在磁盘上维护一份精简的项目**记忆**,每条记录指向具体的文件与行号;agent 需要快速了解项目时先查**记忆**,无需重读整个项目。任务与经验跨会话压缩与交接保持。
11
+ ![alt text](docs/images/image.png)
12
+
13
+ 工作流卡片可收起,自动适应dsh及主题插件风格,提供四种卡片风格切换。
10
14
 
15
+ ![alt text](docs/images/image-4.png)
11
16
  ## 特性
12
17
 
18
+ - **TaskBridge:跨会话开发任务** — 监听会话内宿主 `todo_write` 维护的任务清单与 `tool/call` 读文件:进度快照(steps)与触碰文件自动同步进跨会话的任务实体。未绑定会话写 todo 时自动建档。新会话通过 `list_tasks` → `select_task`(绑定/改名/解归档)续接;`query_memory` 新增 `type:'task'`,`type:'all'` 结果尾部附任务计数提示。用户侧 `/tasks` 命令展示任务栈、步骤进度、涉及文件与当前会话绑定。标题由模型经 `select_task(title=…)` 命名(回退:取消息最后一个「:」后的任务段)。容量随项目体积自适应(fileCount/20,clamp 5–100)。存储:`.dsh-project-memory/tasks.json` + `binding.json`。自动同步需含会话事件与 `todo_write` 的 dsh(0.1.2-alpha.x 实测);旧宿主下降级为纯记录。
19
+ - **Task Panel(v0.4.2+):dsh web 浮动任务面板** — 按 dsh web 0.1.2-rc.1 真实 client 插件契约落地(cordis inject + apply,注册进宿主 `shell.overlay` 槽)。卡片可拖拽、展开查看步骤/文件(点击复制路径);折叠为可拖拽顶部迷你条;可彻底隐藏(输入 `/task` / `/tasks` 唤起)。渲染错误有边界兜底,面板崩溃不再拖垮宿主。
20
+ - **任务面板行为** —
21
+ - **默认隐藏**:dsh web 启动时面板不显示
22
+ - **显式唤起**:输入 `/tasks` 或 `/task`(列表形式)打开;模型调用 `show_task_panel` 工具打开
23
+ - **会话切换**:仅后台同步数据,**不**自动打开面板
24
+ - **刷新页面**:面板保持隐藏(UI 状态 `closed` 不持久化)
25
+ - **手动关闭**:点击 × 彻底隐藏(无迷你条);重新打开需显式唤起
26
+ - **折叠迷你条**:点击 ↓ 仅保留顶部可拖拽迷你条;点击迷你条展开
27
+ - **任务清单双向同步(宿主 ↔ 插件任务,v0.4.2+)** — `select_task` 或 `/task switch` 绑定任务时,将任务 steps 推给宿主 `todo/write`,dsh 渲染的任务清单跟随我们维护的任务实体。配置 `tasklist.syncHostOnAdopt`(默认开)可关。空 `todo/write` 语义定为「清空」:未绑定会话清空清单不再误建垃圾任务;已绑定则清空该任务 steps(任务保留)。面板编辑(改步骤文本/状态)= 写回绑定任务并推宿主清单,与模型 `todo_write` 共用一套逻辑,无第二套同步。`/task` 新增 `switch` / `archive` / `unbind` / `rename` / `todos`(均由面板按钮/双击调用,不经模型);`unbind` 同时清掉输入框上方的宿主任务清单。
28
+ - **面板编辑与风格(v0.4.2+)** — 绑定卡片:双击标题/步骤行内编辑(输入框随内容自动增高),点步骤状态图标循环 待办→进行中→已完成;非绑定卡片只读。**四档外观风格**(点标题左侧文件夹图标切换,本地记忆):原生 / 玻璃拟态 / 粗野主义 / 终端等宽——只改材质、几何、字型与密度,颜色始终取自 dsw 别名令牌,跟随宿主明暗与主题插件。
13
29
  - **文档记忆** — PDF、Markdown、纯文本按块切分并由 LLM 生成摘要,每条记忆携带 `路径:行号` 引用回源文件。
14
30
  - **代码符号记忆** — 通过零依赖的源码扫描器提取函数、类与方法名及完整类型签名(泛型、参数类型、返回类型、重载签名),包含字符串/注释掩码、多行签名续行、Python 缩进感知、类方法上下文,不使用 LLM token。
15
31
  - **L1 增强正则** — 零依赖正则扫描器现可提取泛型、参数/返回类型、重载、接口、类型别名,产出单行身份签名 `fn(a: A, b: B): R — file.ts:42`。
@@ -22,7 +38,6 @@
22
38
  - **经验笔记** — 记录问题 → 方案;相似问题覆盖而非重复;笔记仅在检索命中时返回。笔记数量有界:容量随项目规模伸缩(钳制在 100–2000),超限时淘汰最旧的笔记。**覆盖阈值收紧为双向 0.7 重叠**(原 0.6);**经验 `problem` 字段现参与 CJK 短语加分**,提升长尾问句召回。
23
39
  - **流式 TF + IDF 缓存** — 查询路径按存储版本缓存 IDF(词逆频率);命中时单次流式遍历 20k 条目仅需 ~8 ms(5k 文件) / ~1 ms(1k 文件),零中间对象;写入路径仅 O(1) 版本号递增。
24
40
  - **无锁同步事务** — 不采用锁:所有写入(index / watch / remember / forget / watch_repo)统一走同步事务 `store.commit(fn)`,fn 成功后才一次落盘;JS 单线程事件循环保证事务间不交错,`remember`/`forget` 不会被 watch 重索引阻塞排队。多实例并发写入同一项目存储时,得益于 CAS 幂等更新与原子提交,自然具备幂等性,无数据损坏风险。
25
- - **TaskBridge:跨会话开发任务** — 监听会话内宿主 `todo_write` 维护的任务清单与 `tool/call` 读文件:进度快照(steps)与触碰文件自动同步进跨会话的任务实体。未绑定会话写 todo 时自动建档。新会话通过 `list_tasks` → `select_task`(绑定/改名/解归档)续接;`query_memory` 新增 `type:'task'`,`type:'all'` 结果尾部附任务计数提示。用户侧 `/tasks` 命令展示任务栈、步骤进度、涉及文件与当前会话绑定。标题由模型经 `select_task(title=…)` 命名(回退:取消息最后一个「:」后的任务段)。容量随项目体积自适应(fileCount/20,clamp 5–100)。存储:`.dsh-project-memory/tasks.json` + `binding.json`。自动同步需含会话事件与 `todo_write` 的 dsh(0.1.2-alpha.x 实测);旧宿主下降级为纯记录。
26
41
  - **依赖极简** — 纯 JavaScript;唯一运行时依赖是 `pdfjs-dist`(PDF 文本提取),无需原生构建。
27
42
  - **开销可忽略** — 纯进程内操作;冷启动 <100 ms(5k 文件),典型项目查询中位数 2–3 ms(p99 < 7 ms);瓶颈在 LLM 摘要与 PDF 解析,插件本身不阻塞。
28
43
 
@@ -103,7 +118,9 @@ dsh plugin --profile web add /path/to/dsh-project-memory.tgz
103
118
  | `list_tasks` | 列出本项目任务记录(含归档,带标记)。新会话/续接前先调用。 |
104
119
  | `select_task` | 将会话绑定到某任务(此后 todo 清单与读文件同步进该任务)。按 `taskId` 精确绑定,或按 `title` 完全匹配(多个同名返回候选;无则新建)。带 title 可改名;自动解归档。 |
105
120
  | `archive_task` | 归档任务(隐藏默认视图、不占容量、停止同步)。`select_task` 可恢复。 |
121
+ | `show_task_panel` | 在 UI 中打开任务面板。用户要求查看任务列表或你想展示面板时调用。 |
106
122
  | `/tasks`(用户输入,不经模型) | 展示任务栈:标题、步骤进度、涉及文件、当前会话绑定哪套任务。 |
123
+ | `/task`(用户输入,不经模型) | 任务面板子命令:`switch` / `archive` / `unbind` / `rename` / `todos`(面板按钮/点击触发,不经模型)。 |
107
124
  | `remember problem solution` | 保存经验笔记。相似问题覆盖而非重复。 |
108
125
  | `forget id_or_query` | 删除过期经验笔记。 |
109
126
 
@@ -113,9 +130,11 @@ dsh plugin --profile web add /path/to/dsh-project-memory.tgz
113
130
  .dsh-project-memory/
114
131
  format.json 布局标记(v2,分片式)
115
132
  shards/ 每个被索引源文件一个自描述 JSON
116
- ({ relPath, record, entries })——写入只落脏分片
133
+ ({ relPath, record, entries })——写入只落脏分片
117
134
  experience.json 问题 → 方案笔记(仅检索)
118
135
  watch.json 被监听根目录
136
+ tasks.json TaskBridge 任务实体(跨会话)
137
+ binding.json 当前会话 ↔ 任务绑定
119
138
  ```
120
139
 
121
140
  v0.2.0 之前创建的库(单文件 `entries.json` / `index.json`)在首次加载时自动幂等迁移。同一个 dsh 进程内,所有工具调用共享每个项目的单一内存 store 实例,热路径索引只写发生变化的那一个分片。
@@ -125,9 +144,17 @@ v0.2.0 之前创建的库(单文件 `entries.json` / `index.json`)在首次
125
144
  - **查询扩展** — `llmQueryExpansion` 开启时,`query_memory` 让 `ctx.llm` 将查询改写为多个变体(同义词、中英、符号名猜测),再跨变体合并 BM25 分数;关闭时查询完全不碰 LLM。跨语种召回(中文问题命中英文内容)改由索引时承担:文档 keywords 要求同时覆盖文档语言与英文,doc↔symbol 链接也会从中文命中带出英文符号名。
126
145
  - **一致性** — 事实层跟随代码库(哈希重抽 / 删除即移除);经验层仅检索,配合覆盖与 `forget` 机制。每个记忆目录的写入走同步事务 `store.commit(fn)`:fn 内完成校验与变更、成功后才原子落盘,单进程内天然串行;请避免多个 dsh 实例同时写同一项目存储。
127
146
 
128
- ## 设计取舍
147
+ ## 架构(任务面板)
129
148
 
130
- 以下是刻意的范围选择。
149
+ ```
150
+ TaskPanel (Container)
151
+ ├── task-data-store (服务端数据,跨标签页 BroadcastChannel 同步)
152
+ ├── task-ui-store (本地 UI 状态,localStorage)
153
+ ├── task-hooks (useTaskDrag, useTaskEdit)
154
+ └── TaskComponents (MiniBar, TaskCard — 纯展示组件)
155
+ ```
156
+
157
+ ## 设计取舍
131
158
 
132
159
  ### 1. 同步无锁事务,而非异步锁
133
160
 
@@ -219,6 +246,7 @@ v0.2.0 之前创建的库(单文件 `entries.json` / `index.json`)在首次
219
246
  | `maxFileSizeMb` | 50 | 大于该值(MB)的文档(含 PDF)/代码文件跳过 |
220
247
  | `maxOutputChars` | 8000 | `query_memory` 返回文本上限(字符) |
221
248
  | `tasklist.enabled` | true | 启用 TaskBridge 自动同步(由会话 todo 清单与文件读取沉淀任务实体) |
249
+ | `tasklist.syncHostOnAdopt` | true | `select_task`/`/task switch` 绑定任务时,将其 steps 推给宿主 `todo/write`,使 dsh 任务清单镜像任务实体 |
222
250
  | `maxPdfPages` | 1000 | 未另行限制时 PDF 的页数上限 |
223
251
  | `llmQueryExpansion` | false | BM25 检索前通过 `ctx.llm` 扩展查询(默认关闭,节省 token) |
224
252
  | `expansionCount` | 6 | 扩展变体上限 |
@@ -263,7 +291,7 @@ dsh web --patch ./config.yml
263
291
 
264
292
  ```bash
265
293
  npm install
266
- npm test # 166 tests (v0.4.0) + TaskBridge 套件(node test/taskbridge.test.mjs,5 项)
294
+ npm test # 177 项测试(核心 166 + TaskBridge 11)
267
295
  ```
268
296
 
269
297
  ## 许可证