@yolk_vat-y/dsh-project-memory 0.7.1 → 0.7.3
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 +19 -0
- package/LICENSE +0 -0
- package/README.md +9 -9
- package/README.zh-CN.md +8 -8
- package/client/client.js +139 -43
- package/client/client.js.map +1 -1
- package/cordis.patch.yml +0 -0
- package/package.json +2 -2
- package/scripts/bench-edits.mjs +0 -0
- package/scripts/bench-store.mjs +0 -0
- package/skills/project-memory/SKILL.md +38 -10
- package/src/audit.js +2 -2
- package/src/auto-inject.js +10 -5
- package/src/client/MemoryView.tsx +5 -14
- package/src/client/TaskComponents.tsx +109 -99
- package/src/client/TaskPanel.module.css +10 -4
- package/src/client/TaskPanel.tsx +49 -2
- package/src/client/locales.ts +2 -0
- package/src/client/task-data-store.ts +2 -0
- package/src/client/task-window.js +33 -0
- package/src/commands/insight-actions.js +43 -41
- package/src/commands/task-actions.js +42 -21
- package/src/commands/tasks.js +24 -10
- package/src/index-pipeline.js +5 -3
- package/src/inject-visible.js +16 -18
- package/src/insight-store.js +90 -72
- package/src/readiness.js +2 -2
- package/src/setup/taskbridge.js +51 -5
- package/src/setup/team-task.js +220 -0
- package/src/store.js +105 -82
- package/src/symbols.js +0 -0
- package/src/tools/forget.js +9 -1
- package/src/tools/index-doc.js +37 -41
- package/src/tools/lesson-tools.js +119 -22
- package/src/tools/query-memory.js +115 -14
- package/src/tools/task-tools.js +83 -16
- package/src/util/fs.js +57 -17
- package/src/util/hash.js +12 -0
- package/src/util/insight-fields.js +56 -1
- package/src/util/merge-by-id.js +56 -0
- package/src/util/persist.js +2 -1
- package/src/util/session-cache.js +4 -3
- package/src/util/task-view.js +18 -0
- package/src/vector-index.js +6 -5
- package/src/watch.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## 0.7.3 (2026-12-01)
|
|
2
|
+
|
|
3
|
+
**兼容**:无新增配置键,无 store 格式变更,`client/` 产物不变,直接覆盖升级。
|
|
4
|
+
|
|
5
|
+
- **任务级记忆按 id 直接读写**:`query_memory` 与 `save_lesson` 都接受 `task_id`(本地任务或宿主团队任务 `task-<n>`),不绑定会话也能读写该任务的记忆;团队任务首次写入时自动建锚点。
|
|
6
|
+
- **归属校验**:未知、别的团队或已删除的团队任务直接报错;`list_tasks`、面板、按 id 更新/删除也只暴露本会话可见的任务;已归档任务不参与召回。
|
|
7
|
+
- **空锚点回收**:超过 30 天没有活动、没有任务级记忆也没有会话绑定的团队锚点自动回收;写盘合并后才删,不会删掉另一进程刚写进去的记忆。
|
|
8
|
+
- **参数冲突显式报错**:`task_id` 与 `type: 'task'` 同时给出时会说明两者区别,显式 `scope` 优先。
|
|
9
|
+
- **内部**:跨进程按 id 合并收敛到同一实现,无行为变化。
|
|
10
|
+
- **工具描述瘦身**:`save_lesson` 的 trigger 细则与 `query_memory` 的用法移进 `project-memory` skill,常驻 schema 变小。
|
|
11
|
+
|
|
12
|
+
## 0.7.2 (2026-11-24)
|
|
13
|
+
|
|
14
|
+
**兼容**:无新增配置键,记忆库格式不变;`client/` 产物已重建,直接覆盖升级。
|
|
15
|
+
|
|
16
|
+
- **团队任务可作记忆作用域**:选中宿主团队任务后,队友 claim 同一任务即可读到任务级记忆,不必先提升到项目级。
|
|
17
|
+
- **团队任务同步**:状态、负责人与写域跟随宿主变化;完成不归档,删除才归档并解绑;团队任务卡不显示本地步骤。
|
|
18
|
+
- **任务面板**:按最近活跃排序;列表可滚动,展开不挤压其他任务;任务多时只渲染首屏,往下滚再加载。
|
|
19
|
+
|
|
1
20
|
## 0.7.1 (2026-11-18)
|
|
2
21
|
|
|
3
22
|
**兼容**:无新增配置键,无 store 格式变更,`client/` 产物已重建,直接覆盖升级。开发依赖从 dsh `0.2.2-rc.3` 对齐到 `0.2.2-rc.5`(运行时依赖未变;rc.4/rc.5 是宿主侧的模型异常响应、LiveShare 与服务端搜索修复,不涉及本插件使用的接口)。
|
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -15,8 +15,8 @@ A persistent **project development memory** for [DeepSeek Harness](https://githu
|
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
18
|
-
- **TaskBridge: cross-session development tasks** — the session's todo list and the files it touches are persisted as per-project task entities, so a workflow can be switched and resumed without re-scoping the project. Associated files stay in recency-weighted order (a read never outranks a written file), so a resumed session sees where to look first. New sessions continue with `list_tasks` → `select_task`. Work delegated to subagents creates no task. On hosts without session events the task tools still work as a plain record list.
|
|
19
|
-
- **Task panel and editing** — draggable cards show a task's steps and files, and can collapse to a mini-bar or be hidden. Title, steps and status can be edited inline, writing back through the same path as model updates; four visual themes change material, geometry, typeface and density only, and colours follow the host. The panel stays hidden until summoned, syncs in the background on session switch, never reopens itself after a refresh, and a render failure cannot take down the host.
|
|
18
|
+
- **TaskBridge: cross-session development tasks** — the session's todo list and the files it touches are persisted as per-project task entities, so a workflow can be switched and resumed without re-scoping the project. Associated files stay in recency-weighted order (a read never outranks a written file), so a resumed session sees where to look first. New sessions continue with `list_tasks` → `select_task`. Work delegated to subagents creates no task (a teammate can still bind a host team task to share its memory, or read/write that task's memory directly by `task_id` without binding). On hosts without session events the task tools still work as a plain record list.
|
|
19
|
+
- **Task panel and editing** — draggable cards show a task's steps and files, and can collapse to a mini-bar or be hidden. Title, steps and status can be edited inline, writing back through the same path as model updates; four visual themes change material, geometry, typeface and density only, and colours follow the host. The panel stays hidden until summoned, syncs in the background on session switch, never reopens itself after a refresh, and a render failure cannot take down the host. Tasks are listed most recently active first; the list scrolls, keeps its height when a card expands, and renders more cards as you reach the bottom.
|
|
20
20
|
- **Document memory** — PDF, Markdown and plain text are chunked and summarized without a model call. Each entry keeps a short summary for injection, a bounded term set for recall, and a citation back to the source.
|
|
21
21
|
- **Code symbol memory** — a dependency-free scanner extracts functions, classes, methods, interfaces and type aliases with signatures; covered languages are JavaScript/TypeScript, Python, Go, Rust, C/C++/C#, Java and shell. Where `typescript` is installed, an optional second layer adds inferred return types, generics and interface shapes; it runs in the background and never blocks indexing.
|
|
22
22
|
- **Automatic, read-time memorization** — with lazy indexing (default), a file is memorized the moment the model reads it, so memory grows as a byproduct of normal work rather than an upfront scan. `index_repo` or a watched root can cover the rest of the tree; a background poll only re-indexes files that changed.
|
|
@@ -24,7 +24,7 @@ A persistent **project development memory** for [DeepSeek Harness](https://githu
|
|
|
24
24
|
- **Hybrid recall** — ranked search over documents, symbols, experience notes and insights, with optional LLM query expansion. The experience/insight layers are re-ordered by cosine when `leanvec` is present — installed by default, absent ⇒ pure lexical. Tuned for CJK: phrase boost, a synonym table, and CJK-aware boundaries for doc↔symbol linking.
|
|
25
25
|
Russian (Cyrillic) is supported too: word splitting, a stopword list and Snowball stemming, so Russian queries hit Russian notes and take part in dedup.
|
|
26
26
|
- **Experience notes** — problems → solutions, deduplicated by overlap rather than repeated, bounded by project size, and surfaced both by search and by the same injection path as lessons.
|
|
27
|
-
- **Tiered insight memory (lessons / decisions / procedures)** — one entity across task, project and global scope. Near-duplicates merge or reinforce, and promotion moves an entry between scopes instead of copying it. Use is recorded, so decay and capacity rank by activity rather than age alone. The panel exposes a per-scope view for reviewing and editing entries. That list is ordered newest-first and
|
|
27
|
+
- **Tiered insight memory (lessons / decisions / procedures)** — one entity across task, project and global scope. Near-duplicates merge or reinforce, and promotion moves an entry between scopes instead of copying it. Use is recorded, so decay and capacity rank by activity rather than age alone. The panel exposes a per-scope view for reviewing and editing entries. That list is ordered newest-first and loads incrementally as you scroll.
|
|
28
28
|
- **Triggered injection** — an insight may carry an authored trigger: only `when` triggers, `guard` narrows it, and `prevents` records what breaks without the entry. Corpus text can never trigger an injection; the statistical channel is gated separately and silent by default. **Evidence is graded by source**: only host facts (structured tool calls, `fs`/`todo` events) and irreversible actions named by the human (commit / publish / release / push / deploy / go public) can inject full text; prose mentions of delete / clean up / render / benchmark only feed the hint channel, and subagent prompts plus notice-shaped messages never count as actions.
|
|
29
29
|
- **Usage is a skill too** — it registers `project-memory` into the host `skills` registry (a directory bundle with `scripts/pm-digest.mjs`, `resourceBase` pointing inside the package). The model loads the query/write workflow on demand instead of carrying it in every prompt; hosts without a `skills` service skip it silently.
|
|
30
30
|
|
|
@@ -56,15 +56,15 @@ The tools below are **invoked by the agent**, not typed by the user. In the chat
|
|
|
56
56
|
| `index_repo root` | Index a whole project: documents get deterministic summaries, code files get a token-free symbol table. Incremental and self-healing: the store follows the file listing, so deleted, ignored or moved files are dropped (an entry created by an explicit `index_doc` is kept while its file still exists), and documents are cross-linked to symbols. A non-existent or excluded root is rejected before anything is written. |
|
|
57
57
|
| `watch_repo root` | Enable automatic refresh: a background poll detects new and changed files and re-indexes only those. A watched root is recorded in that project's store, so it resumes when dsh starts there; a non-existent or excluded root is refused, roots that disappear are dropped rather than re-created. |
|
|
58
58
|
| `pm_stats root` | Show what the store contains: totals, last index time, and the per-file list sorted by recency. Background index failures (watch or lazy, per root, most recent 50) are reported alongside, so a file that never made it into the corpus stays visible. |
|
|
59
|
-
| `query_memory query` | Ranked search over documents, symbols, experience and insights, optionally query-expanded by the LLM. `type` selects a layer (`all` / `doc` / `symbol` / `experience` / `insight` / `task`). Returns hits with relative scores, sources or insight ids, and doc→symbol references. |
|
|
60
|
-
| `list_tasks` | List task records
|
|
61
|
-
| `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. |
|
|
59
|
+
| `query_memory query` | Ranked search over documents, symbols, experience and insights, optionally query-expanded by the LLM. `type` selects a layer (`all` / `doc` / `symbol` / `experience` / `insight` / `task`). Returns hits with relative scores, sources or insight ids, and doc→symbol references. `task_id` (local id or host team `task-<n>`) exposes that task's task-level memory for this call without binding the session. |
|
|
60
|
+
| `list_tasks` | List the task records visible to this session (archived marked; another team's task anchors stay hidden). Call first in a new session before continuing work. |
|
|
61
|
+
| `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. On team-enabled hosts a host team task id (`task-<n>`) also works: teammates selecting the same team task share its task-scoped memory. |
|
|
62
62
|
| `archive_task` | Archive a task (hide from default views, exclude from capacity, stop syncing, unbind the sessions that had it selected; archived tasks are also skipped by injection and recall). `select_task` restores it. |
|
|
63
63
|
| `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. |
|
|
64
|
-
| `/tasks` (typed by the user, not the model) | The only user command: shows the task stack and drives the workflow card. Every other action is a **sub-verb** invoked by card buttons: `switch` / `archive` / `unbind` / `rename` / `todos …` / `step` / `step-move` / `step-text` for tasks, `insight list [scope] [offset] [limit]` / `confirm` / `promote` / `demote` / `archive` / `restore` / `delete` / `save` / `edit` for memory. |
|
|
64
|
+
| `/tasks` (typed by the user, not the model) | The only user command: shows the task stack and drives the workflow card (tasks bound to a host team task are labeled with it). Every other action is a **sub-verb** invoked by card buttons: `switch` / `archive` / `unbind` / `rename` / `todos …` / `step` / `step-move` / `step-text` for tasks, `insight list [scope] [offset] [limit]` / `confirm` / `promote` / `demote` / `archive` / `restore` / `delete` / `save` / `edit` for memory. |
|
|
65
65
|
| `remember problem solution` | Save an experience note. It is a `kind: 'experience'` insight — same store, same dedup and same delete path as lessons / decisions / procedures. Similar problems merge or overwrite instead of duplicating. |
|
|
66
66
|
| `forget id_or_query` | Delete memories — lessons / decisions / procedures and experience notes alike, across task / project / global in one call, without knowing which layer the entry lives in. An exact id deletes that one entry; keywords match by **query-side coverage** (matched query terms ÷ query terms). Real deletion, no undo; when keywords match more than the cap (default 10) it deletes nothing and only lists the candidates. The **5** most recently deleted entries are kept as full entries in that layer's `deleted.json` next to its store (`<root>/.dsh-project-memory/deleted.json` for the project layer, beside the global file for global), and the deletion result prints that path — read it and save again to recover a mis-delete. |
|
|
67
|
-
| `save_lesson` | Save a lesson / decision / procedure at task, project or global scope; passing `id` **overwrites that entry in place** (only the fields you pass, the previous values stay in `prev` — write them back with the same id). Before writing it compares against existing memory: cosine ≥ 0.9 auto-overwrites that entry, ≥ 0.7 reports the nearest id in the result; without `leanvec` it falls back to lexical overlap ≥ 0.7 merge / 0.65–0.7 reinforce. Two tasks hitting the same insight promote it task → project, three or more → global. Key params: `id`, `title`, `kind`, `scope`, the content (`pattern`/`fix`, `choice`/`reason` or `steps`), and `trigger` (`when` is the only trigger surface, `guard` narrows it, `prevents` records what breaks without it). |
|
|
67
|
+
| `save_lesson` | Save a lesson / decision / procedure at task, project or global scope; passing `id` **overwrites that entry in place** (only the fields you pass, the previous values stay in `prev` — write them back with the same id). Before writing it compares against existing memory: cosine ≥ 0.9 auto-overwrites that entry, ≥ 0.7 reports the nearest id in the result; without `leanvec` it falls back to lexical overlap ≥ 0.7 merge / 0.65–0.7 reinforce. Two tasks hitting the same insight promote it task → project, three or more → global. Key params: `id`, `title`, `kind`, `scope`, the content (`pattern`/`fix`, `choice`/`reason` or `steps`), and `trigger` (`when` is the only trigger surface, `guard` narrows it, `prevents` records what breaks without it). `task_id` (local id or host team `task-<n>`) selects that task for task-scope writes; an explicit `scope` wins, and dedup may still merge/promote the entry to project or global. A team task's memory anchor is created on first task-scope write, so no `select_task` is needed. |
|
|
68
68
|
|
|
69
69
|
`/tasks` appears in the web `/` menu inside an icon-bearing **Workflow** group, with three view entries — Tasks / Project Memory / Global Memory (labelled in the UI language). It is the plugin's only registered command; every other action rides it as a sub-verb driven by card buttons.
|
|
70
70
|
|
|
@@ -194,7 +194,7 @@ These commands are for **maintaining the plugin code** — regular users do not
|
|
|
194
194
|
|
|
195
195
|
```bash
|
|
196
196
|
npm install
|
|
197
|
-
npm test #
|
|
197
|
+
npm test # 1149 tests
|
|
198
198
|
npm run eval:injection # synthetic pool P/R: precision 0.93 / recall 1.00, + a 3-scenario hint-only group
|
|
199
199
|
npm run eval:injection -- --store .dsh-project-memory/insights.json # replay on YOUR store; control group is a hard gate
|
|
200
200
|
npm run selfcheck:triggers # which entries can still push, which declarations are dead (reads your local store)
|
package/README.zh-CN.md
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
## 特性
|
|
16
16
|
|
|
17
|
-
- **TaskBridge:跨会话开发任务** — 会话内的任务清单与触碰过的文件持久化为项目任务实体,工作流可以随时切走再续接,不必重新界定项目范围。关联文件按最近活跃排序(读取永远不越过写过的文件),续接时一眼看到该先看哪些。新会话通过 `list_tasks` → `select_task`
|
|
18
|
-
- **任务面板与编辑** —
|
|
17
|
+
- **TaskBridge:跨会话开发任务** — 会话内的任务清单与触碰过的文件持久化为项目任务实体,工作流可以随时切走再续接,不必重新界定项目范围。关联文件按最近活跃排序(读取永远不越过写过的文件),续接时一眼看到该先看哪些。新会话通过 `list_tasks` → `select_task` 续接。委派给子代理的工作不会建档(队友可显式绑定宿主团队任务来共享其记忆,也可以直接用 `task_id` 读写该任务的记忆,不必绑定)。宿主不提供会话事件时,任务工具仍可作为普通记录列表使用。
|
|
18
|
+
- **任务面板与编辑** — 卡片可拖拽,展示任务步骤与涉及文件,可折叠为迷你条或彻底隐藏;标题、步骤与状态支持行内编辑,与模型更新走同一条写回路径;四档外观风格只改材质、几何、字型与密度,颜色跟随宿主。面板默认隐藏,仅在显式唤起后出现;会话切换只后台同步,刷新页面不会自行打开;渲染错误有边界兜底,面板崩溃不会拖垮宿主。任务按最近活跃排序(最新的在前);列表可滚动,卡片展开不会被压扁,滚到底部继续渲染后面的卡。
|
|
19
19
|
- **文档记忆** — PDF、Markdown 与纯文本按块切分并生成摘要,索引期不调用模型。每条保留一段简短摘要供注入、一个有界的检索词集合,以及回源引用。
|
|
20
20
|
- **代码符号记忆** — 零依赖扫描器提取函数、类、方法、接口与类型别名及其签名,覆盖 JavaScript/TypeScript、Python、Go、Rust、C/C++/C#、Java 与 shell。项目装了 `typescript` 时,可选第二层补推导返回类型、泛型与接口,后台执行、不阻塞索引。
|
|
21
21
|
- **读到即记忆、变更即刷新** — 默认开启懒索引:文件在模型实际读取的瞬间被记忆,记忆是正常工作的副产品,而不是额外的一次全量扫描。`index_repo` 或监听根目录可以覆盖其余文件;后台轮询只重记变更过的文件。
|
|
@@ -54,15 +54,15 @@ dsh plugin --profile web add @yolk_vat-y/dsh-project-memory -w
|
|
|
54
54
|
| `index_repo root` | 索引整个项目:文档生成确定性摘要,代码文件生成零 token 符号表。增量更新,store 跟随文件清单:已删除、被忽略或移走的文件会被清理(显式 `index_doc` 的条目只要文件还在就保留);文档与符号交叉链接。根目录不存在或在排除名单上时,会在写入任何内容前拒绝。 |
|
|
55
55
|
| `watch_repo root` | 启用自动刷新:后台轮询检测新增/变更文件,仅重抽这些文件。监听根会记在该项目的 store 里,在该项目下启动 dsh 时恢复监听;不存在或在排除名单上的根目录会被拒绝,已消失的根目录会被丢弃而不是被重新创建。 |
|
|
56
56
|
| `pm_stats root` | 查看记忆库内容:总量、最近索引时间,以及按时间排序的逐文件清单。后台索引失败(watch / 懒索引,按根记账、最多 50 条)也会一并报出,让「文件一直没进语料」可见。 |
|
|
57
|
-
| `query_memory query` | 对文档、符号、经验与 insight 执行排序检索,可选 LLM 查询扩展。`type` 选择层(`all` / `doc` / `symbol` / `experience` / `insight` / `task`)。返回带相对分数、引用或 insight id
|
|
58
|
-
| `list_tasks` |
|
|
59
|
-
| `select_task` | 将会话绑定到某任务(此后 todo 清单与读文件同步进该任务)。按 `taskId` 精确绑定,或按 `title` 完全匹配(多个同名返回候选;无则新建)。带 title
|
|
57
|
+
| `query_memory query` | 对文档、符号、经验与 insight 执行排序检索,可选 LLM 查询扩展。`type` 选择层(`all` / `doc` / `symbol` / `experience` / `insight` / `task`)。返回带相对分数、引用或 insight id、以及文档→符号链接的结果。`task_id`(本地 id 或宿主团队 `task-<n>`)可在不绑定会话的情况下读取该任务的任务级记忆(仅本次调用)。 |
|
|
58
|
+
| `list_tasks` | 列出本会话可见的任务记录(含归档,带标记;别队的团队任务锚点不出现)。新会话/续接前先调用。 |
|
|
59
|
+
| `select_task` | 将会话绑定到某任务(此后 todo 清单与读文件同步进该任务)。按 `taskId` 精确绑定,或按 `title` 完全匹配(多个同名返回候选;无则新建)。带 title 可改名;自动解归档。启用团队的宿主上还接受团队任务 id(`task-<n>`):队友选中同一个团队任务即可共享它的任务级记忆。 |
|
|
60
60
|
| `archive_task` | 归档任务(隐藏默认视图、不占容量、停止同步、清掉选中它的会话绑定;归档任务也不再参与注入与召回)。`select_task` 可恢复。 |
|
|
61
61
|
| `show_task_panel` | 在 UI 中打开任务面板。用户要求查看任务列表或你想展示面板时调用。 |
|
|
62
|
-
| `/tasks`(用户输入,不经模型) |
|
|
62
|
+
| `/tasks`(用户输入,不经模型) | 唯一的用户命令:展示任务栈并驱动工作流卡片(绑定宿主团队任务的会标出 `task-<n>`)。其余动作是它的**子动词**,由卡片按钮调用:`switch` / `archive` / `unbind` / `rename` / `todos …` / `step` / `step-move` / `step-text` 为任务动作,`insight list [scope] [offset] [limit]` / `confirm` / `promote` / `demote` / `archive` / `restore` / `delete` / `save` / `edit` 为记忆动作。 |
|
|
63
63
|
| `remember problem solution` | 保存经验笔记。它就是 `kind: 'experience'` 的 insight——与教训 / 决策 / 流程同库、同去重、同删除入口。相似问题合并或覆盖而非重复。 |
|
|
64
64
|
| `forget id_or_query` | 删除记忆——教训 / 决策 / 流程与经验笔记一视同仁,task / project / global 全层一次搞定,不必先知道它在哪一层。精确 id 删那一条;关键词按**查询侧覆盖率**匹配(命中词 ÷ 查询词数)。真删、无撤销;关键词命中超过上限(默认 10)时**一条都不删**,只列出候选。最近删除的 **5 条**会以完整条目留在该层 store 同目录的 `deleted.json`(项目层 `<root>/.dsh-project-memory/deleted.json`,global 层在 global 文件旁),删除回报里给出真实路径——删错时读它、重新保存一次即可找回。 |
|
|
65
|
-
| `save_lesson` | 在 task/project/global 任一作用域保存教训 / 决策 / 流程;带 `id` 就是**就地覆盖**既有条目(只改本次显式传的字段,旧值留在 `prev`,用同一个 id 再写一次即可写回)。写入前与既有记忆比对:余弦 ≥ 0.9 自动覆盖那一条,≥ 0.7 在返回里提示近邻 id;`leanvec` 不在时退回词法 overlap ≥ 0.7 合并、0.65–0.7 强化。同一 insight 被 2+ 任务命中自动 task→project、3+ → global。主要参数:`id`、`title`、`kind`、`scope`、正文(`pattern`/`fix`、`choice`/`reason` 或 `steps`)、`trigger`(`when` 是唯一触发面,`guard` 只能收窄,`prevents`
|
|
65
|
+
| `save_lesson` | 在 task/project/global 任一作用域保存教训 / 决策 / 流程;带 `id` 就是**就地覆盖**既有条目(只改本次显式传的字段,旧值留在 `prev`,用同一个 id 再写一次即可写回)。写入前与既有记忆比对:余弦 ≥ 0.9 自动覆盖那一条,≥ 0.7 在返回里提示近邻 id;`leanvec` 不在时退回词法 overlap ≥ 0.7 合并、0.65–0.7 强化。同一 insight 被 2+ 任务命中自动 task→project、3+ → global。主要参数:`id`、`title`、`kind`、`scope`、正文(`pattern`/`fix`、`choice`/`reason` 或 `steps`)、`trigger`(`when` 是唯一触发面,`guard` 只能收窄,`prevents` 记下没有它会坏在哪),以及 `task_id`(本地 id 或宿主团队 `task-<n>`):为任务级写入指定任务;显式 `scope` 优先,去重仍可能把条目合并/提升到 project 或 global。团队任务首次任务级写入时自动建记忆锚点,不必先 `select_task`。 |
|
|
66
66
|
|
|
67
67
|
`/tasks` 在 web 的 `/` 菜单里以带图标的**「工作流」**组呈现 —— 三个视图入口:任务 / 项目记忆 / 全局记忆(标题随界面语言切换)。它是插件唯一注册的命令,其余动作全部作为它的子动词由卡片按钮驱动。
|
|
68
68
|
|
|
@@ -192,7 +192,7 @@ node scripts/bench.mjs /你的/项目路径 [--json] [--samples 100] [--no-pdf]
|
|
|
192
192
|
|
|
193
193
|
```bash
|
|
194
194
|
npm install
|
|
195
|
-
npm test #
|
|
195
|
+
npm test # 1149 项测试
|
|
196
196
|
npm run eval:injection # 合成池 P/R:精确率 0.93 / 召回率 1.00,另有 3 个 hint-only 场景
|
|
197
197
|
npm run eval:injection -- --store .dsh-project-memory/insights.json # 用你自己的 store 重放;对照组是硬闸门
|
|
198
198
|
npm run selfcheck:triggers # 哪些条目还推得动、哪些声明是死的(读你本地的 store)
|
package/client/client.js
CHANGED
|
@@ -97,6 +97,7 @@ window.__ModuleLoader__.load({
|
|
|
97
97
|
"style.brutal": "粗野",
|
|
98
98
|
"style.mono": "终端",
|
|
99
99
|
"panel.syncing": "同步中…",
|
|
100
|
+
"panel.loadMore": "加载更多",
|
|
100
101
|
"panel.sync-failed": "同步失败",
|
|
101
102
|
"panel.hints-on": "显示提示信息",
|
|
102
103
|
"panel.hints-off": "隐藏提示信息",
|
|
@@ -197,6 +198,7 @@ window.__ModuleLoader__.load({
|
|
|
197
198
|
"style.brutal": "Brutal",
|
|
198
199
|
"style.mono": "Mono",
|
|
199
200
|
"panel.syncing": "Syncing…",
|
|
201
|
+
"panel.loadMore": "Load more",
|
|
200
202
|
"panel.sync-failed": "Sync failed",
|
|
201
203
|
"panel.hints-on": "Show hints",
|
|
202
204
|
"panel.hints-off": "Hide hints",
|
|
@@ -1090,7 +1092,7 @@ window.__ModuleLoader__.load({
|
|
|
1090
1092
|
return `${Math.floor(h / 24)}天前`;
|
|
1091
1093
|
}
|
|
1092
1094
|
// \0dsh-css:src/client/TaskPanel.module.css.mjs
|
|
1093
|
-
const css$2 = ".i54Wjq_panel{pointer-events:auto;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l2,#7f7f7f4d);border-radius:14px;flex-direction:column;width:380px;max-width:calc(100vw - 24px);max-height:min(70vh,640px);font-family:inherit;animation:.18s ease-out i54Wjq_panelIn;display:flex;position:fixed;overflow:hidden;box-shadow:0 12px 32px #00000029,0 2px 8px #00000014}@keyframes i54Wjq_panelIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}.i54Wjq_dragHandle{cursor:grab;z-index:1;justify-content:center;align-items:center;height:12px;display:flex;position:absolute;top:0;left:0;right:0}.i54Wjq_dragHandle:active{cursor:grabbing}.i54Wjq_handleGrip{background:var(--dsw-alias-separator-primary,#7f7f7f59);opacity:.8;border-radius:2px;width:32px;height:3px}.i54Wjq_header{border-bottom:1px solid var(--dsw-alias-border-l1,#7f7f7f2e);-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;gap:8px;padding:10px 10px 8px 14px;display:flex}.i54Wjq_headerLeft{align-items:center;gap:6px;min-width:0;display:flex}.i54Wjq_headerIcon{color:var(--dsw-alias-label-secondary);flex:none}.i54Wjq_headerTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;margin:0;font-size:13px;font-weight:600;line-height:20px}.i54Wjq_headerRight{align-items:center;gap:2px;margin-left:auto;display:flex}.i54Wjq_hintsOff{opacity:.45}.i54Wjq_hintsOff:hover{opacity:.75}.i54Wjq_counts{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-right:4px;font-size:11px;line-height:16px}.i54Wjq_boundBadge{color:var(--dsw-alias-label-primary-foreground,#fff);background:var(--dsw-alias-button-primary-fill,#3a6ef5);white-space:nowrap;border-radius:7px;flex:none;padding:0 6px;font-size:10px;line-height:14px}.i54Wjq_notice{color:var(--dsw-alias-state-warn-label,#b7791f);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);word-break:break-all;border-radius:8px;margin:8px 12px 0;padding:6px 10px;font-size:12px;line-height:18px}.i54Wjq_taskList{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2,transparent) transparent;flex-direction:column;gap:6px;padding:8px;display:flex;overflow-y:auto}.i54Wjq_emptyState{text-align:center;color:var(--dsw-alias-label-secondary);padding:36px 24px 30px}.i54Wjq_emptyTitle{color:var(--dsw-alias-label-primary);margin:0 0 6px;font-size:13px;font-weight:600}.i54Wjq_emptyDesc{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:20px}.i54Wjq_syncHint{color:var(--dsw-alias-label-dimmed);justify-content:center;align-items:center;gap:6px;margin:10px 0 0;font-size:11px;display:flex}.i54Wjq_card{border:1px solid var(--dsw-alias-border-l1,#7f7f7f29);background:var(--dsw-alias-bg-base,transparent);content-visibility:auto;contain-intrinsic-size:auto 140px;border-radius:10px;transition:border-color .15s;overflow:hidden}.i54Wjq_cardBound{border-color:var(--dsw-alias-border-l3,#7f7f7f59);box-shadow:inset 0 0 0 .5px var(--dsw-alias-border-l3,transparent)}.i54Wjq_cardHead{cursor:pointer;text-align:left;background:0 0;border:none;justify-content:space-between;align-items:center;gap:8px;width:100%;padding:8px 10px 7px;display:flex}.i54Wjq_cardHead:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_cardTitleRow{align-items:center;gap:6px;min-width:0;display:flex}.i54Wjq_cardTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.i54Wjq_cardMeta{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:8px;display:flex}.i54Wjq_progressText{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}.i54Wjq_updated{color:var(--dsw-alias-label-dimmed);font-size:10px;line-height:14px}.i54Wjq_chevron{color:var(--dsw-alias-label-tertiary);display:inline-flex}.i54Wjq_track{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f);border-radius:1px;height:2px;margin:0 10px 6px;overflow:hidden}.i54Wjq_trackFill{background:var(--dsw-alias-label-primary-bluish,var(--dsw-alias-button-primary-fill,#3a6ef5));border-radius:1px;height:100%;transition:width .2s}.i54Wjq_cardBody{border-top:1px solid var(--dsw-alias-border-l1,#7f7f7f24);overscroll-behavior:contain;max-height:300px;padding:8px 10px 10px;overflow-y:auto}.i54Wjq_section{margin-bottom:8px}.i54Wjq_section:last-child{margin-bottom:0}.i54Wjq_sectionLabel{color:var(--dsw-alias-label-secondary);align-items:center;gap:6px;margin-bottom:4px;font-size:11px;line-height:16px;display:flex}.i54Wjq_sectionCount{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);color:var(--dsw-alias-label-tertiary);border-radius:6px;padding:0 5px;font-size:10px;line-height:14px}.i54Wjq_stepsList{flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;display:flex}.i54Wjq_stepRow{align-items:flex-start;gap:7px;padding:3px 2px;display:flex}.i54Wjq_stepRow>svg{flex:none;margin-top:2px}.i54Wjq_stepDone{color:var(--dsw-alias-label-dimmed)}.i54Wjq_stepRun{color:var(--dsw-alias-label-primary-bluish,#3a6ef5)}.i54Wjq_stepPending{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:8px;height:8px;margin:5px 3px}.i54Wjq_stepContent{color:var(--dsw-alias-label-secondary);word-break:break-word;white-space:pre-wrap;font-size:12px;line-height:20px}.i54Wjq_stepContentDone{color:var(--dsw-alias-label-dimmed);text-decoration:line-through}.i54Wjq_stepContentRun{color:var(--dsw-alias-label-primary)}.i54Wjq_muted{color:var(--dsw-alias-label-dimmed);font-size:11px;line-height:18px}.i54Wjq_filesList{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.i54Wjq_fileRow{cursor:pointer;text-align:left;background:0 0;border:none;border-radius:6px;align-items:center;gap:6px;width:100%;padding:3px 4px;display:flex}.i54Wjq_fileRow:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_fileDot{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:5px;height:5px}.i54Wjq_filePath{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;text-align:left;direction:rtl;font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace;font-size:11px;line-height:18px;overflow:hidden}.i54Wjq_fileLine{color:var(--dsw-alias-label-dimmed);flex:none;font-size:10px;line-height:18px}.i54Wjq_cardFooter{gap:6px;margin-top:8px;display:flex}@media (prefers-reduced-motion:reduce){.i54Wjq_panel{animation:none}.i54Wjq_trackFill,.i54Wjq_card{transition:none}}.i54Wjq_miniBar{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));max-width:min(46vw,340px);height:34px;color:var(--dsw-alias-label-primary);cursor:grab;-webkit-user-select:none;user-select:none;pointer-events:auto;border-radius:999px;align-items:center;gap:7px;padding:0 12px;font-size:12px;line-height:18px;transition:background .15s,border-color .15s;display:inline-flex;position:fixed;box-shadow:0 6px 20px #00000024,0 1px 4px #00000014}.i54Wjq_miniBar:active{cursor:grabbing}.i54Wjq_miniBar:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_miniIcon{color:var(--dsw-alias-label-secondary);flex:none}.i54Wjq_miniText{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.i54Wjq_miniChevron{color:var(--dsw-alias-label-tertiary);flex:none}.i54Wjq_taskList{flex:auto;min-height:0}.i54Wjq_card{flex-direction:column;display:flex}.i54Wjq_boundaryFallback{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,#fff);color:var(--dsw-alias-label-secondary);cursor:pointer;pointer-events:auto;border-radius:999px;padding:4px 10px;font-size:12px;line-height:18px;position:fixed;top:64px;right:16px}.i54Wjq_stepToggle{cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;align-items:center;margin-top:2px;padding:0;display:inline-flex}.i54Wjq_stepToggle:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.i54Wjq_stepToggle:disabled{cursor:default;opacity:.5}.i54Wjq_stepEditable{cursor:text;border-radius:3px}.i54Wjq_stepEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.i54Wjq_stepInput{box-sizing:border-box;width:auto;min-width:0;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);border-radius:5px;flex:auto;padding:0 5px;font-size:12px;line-height:20px}.i54Wjq_editorArea{box-sizing:border-box;min-width:0;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);resize:none;vertical-align:middle;cursor:text;white-space:pre-wrap;word-break:break-word;border-radius:5px;flex:1;margin:0;padding:2px 5px;font-family:inherit;font-size:12px;line-height:20px;overflow:hidden}.i54Wjq_editorArea:focus{border-color:var(--dsw-alias-border-l3,#7f7f7f99);outline:none}.i54Wjq_stepDragging{opacity:.3;background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_cardTitleEditable{cursor:text;border-radius:3px}.i54Wjq_cardTitleEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.i54Wjq_panel[data-theme=glass],.i54Wjq_miniBar[data-theme=glass]{background:color-mix(in srgb, var(--dsw-alias-bg-layer-2,#fff) 90%, transparent);-webkit-backdrop-filter:blur(18px)saturate(1.2);border:1px solid color-mix(in srgb, var(--dsw-alias-border-l2,#7f7f7f4d) 80%, transparent)}.i54Wjq_panel[data-theme=glass] .i54Wjq_card{background:color-mix(in srgb, var(--dsw-alias-bg-base,transparent) 84%, transparent);border-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f29) 60%, transparent)}.i54Wjq_panel[data-theme=glass] .i54Wjq_cardBody{border-top-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f24) 60%, transparent)}@media (prefers-reduced-transparency:reduce){.i54Wjq_panel[data-theme=glass],.i54Wjq_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff);-webkit-backdrop-filter:none;backdrop-filter:none}.i54Wjq_panel[data-theme=glass] .i54Wjq_card{background:var(--dsw-alias-bg-base,transparent)}}@supports not ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){.i54Wjq_panel[data-theme=glass],.i54Wjq_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff)}}.i54Wjq_panel[data-theme=brutal]{box-shadow:none;border-width:1px;border-radius:6px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_card{border:1px solid var(--dsw-alias-border-l3,#7f7f7f6b);background:var(--dsw-alias-bg-base,transparent);box-shadow:none;border-radius:3px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_cardHead{padding:7px 10px 6px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_cardTitle{letter-spacing:.01em;font-weight:650}.i54Wjq_panel[data-theme=brutal] .i54Wjq_headerTitle{letter-spacing:.03em}.i54Wjq_panel[data-theme=brutal] .i54Wjq_boundBadge{border-radius:2px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_track{border-radius:0;height:3px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_trackFill{border-radius:0}.i54Wjq_panel[data-theme=brutal] .i54Wjq_cardBody{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f3d)}.i54Wjq_panel[data-theme=mono] .i54Wjq_headerTitle,.i54Wjq_panel[data-theme=mono] .i54Wjq_counts,.i54Wjq_panel[data-theme=mono] .i54Wjq_cardTitle,.i54Wjq_panel[data-theme=mono] .i54Wjq_progressText,.i54Wjq_panel[data-theme=mono] .i54Wjq_stepContent,.i54Wjq_panel[data-theme=mono] .i54Wjq_filePath{font-family:ui-monospace,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.i54Wjq_panel[data-theme=mono] .i54Wjq_cardTitle{font-size:12px}.i54Wjq_panel[data-theme=mono] .i54Wjq_stepContent{font-size:11.5px}.i54Wjq_panel[data-theme=mono] .i54Wjq_card{border-radius:5px}.i54Wjq_panel[data-theme=mono] .i54Wjq_trackFill{border-radius:0}.i54Wjq_panel[data-theme=mono] .i54Wjq_stepPending{border-radius:1px}.i54Wjq_panel[data-theme=mono] .i54Wjq_updated{letter-spacing:.02em}.i54Wjq_headerIconBtn{color:inherit;cursor:pointer;background:0 0;border:none;border-radius:0;flex:none;justify-content:center;align-items:center;margin:0;padding:0;display:inline-flex}.i54Wjq_headerIcon{color:var(--dsw-alias-label-secondary);flex:none;display:block}.i54Wjq_headerLeft{min-width:0}.i54Wjq_headerTitle{text-overflow:ellipsis;flex:0 auto;min-width:0;overflow:hidden}.i54Wjq_headerRight{min-width:0}.i54Wjq_counts{text-overflow:ellipsis;flex:none;max-width:45%;margin-left:auto;overflow:hidden}.i54Wjq_dragGhost{pointer-events:none;z-index:9999;transition:left 50ms,top 50ms;position:fixed;transform:translate(-50%,-50%)}.i54Wjq_dragGhostCard{background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l3,#7f7f7f59);color:var(--dsw-alias-label-primary);white-space:nowrap;border-radius:8px;align-items:center;gap:8px;max-width:280px;padding:8px 12px;font-size:12px;line-height:20px;display:inline-flex;transform:scale(.9);box-shadow:0 8px 24px #0000002e,0 2px 8px #0000001a}.i54Wjq_dragGhostContent{text-overflow:ellipsis;word-break:break-word;flex:1;min-width:0;overflow:hidden}.i54Wjq_dragGhostClose{width:20px;height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;opacity:.6;background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;margin-left:8px;font-size:16px;line-height:1;transition:opacity .15s,background .15s,color .15s;display:inline-flex}.i54Wjq_dragGhostClose:hover{opacity:1;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.i54Wjq_dropTargetBefore{position:relative}.i54Wjq_dropTargetBefore:before{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite i54Wjq_dropPulse;position:absolute;top:-1px;left:0;right:0}.i54Wjq_dropTargetAfter{position:relative}.i54Wjq_dropTargetAfter:after{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite i54Wjq_dropPulse;position:absolute;bottom:-1px;left:0;right:0}@keyframes i54Wjq_dropPulse{0%,to{opacity:.6}50%{opacity:1}}.i54Wjq_memoryPane{flex-direction:column;gap:6px;max-height:480px;padding:8px 10px 10px;display:flex;overflow:auto}.i54Wjq_memToolbar{justify-content:space-between;align-items:center;gap:8px;display:flex}.i54Wjq_memCount{opacity:.75;font-size:12px;font-weight:600}.i54Wjq_memList{flex-direction:column;gap:6px;display:flex}.i54Wjq_memSentinel{flex:none;height:1px}.i54Wjq_memFooter{flex-direction:column;align-items:center;gap:4px;padding:6px 0 2px;font-size:12px;display:flex}.i54Wjq_memRow{border:1px solid var(--dsw-border-weak,#80808040);background:color-mix(in srgb, var(--dsw-bg-secondary,#f5f5f5) 45%, transparent);content-visibility:auto;contain-intrinsic-size:auto 76px;border-radius:6px;flex-direction:column;gap:4px;padding:6px 8px;display:flex}.i54Wjq_memRowArchived{opacity:.55}.i54Wjq_memRowMain{flex-direction:column;gap:2px;display:flex}.i54Wjq_memTitle{word-break:break-word;align-items:flex-start;gap:6px;font-size:13px;line-height:1.35;display:flex}.i54Wjq_kindBadge{background:var(--dsw-accent-soft,#5078ff26);color:var(--dsw-accent,#4d6bfe);border-radius:4px;flex:none;padding:0 5px;font-size:11px;line-height:1.5}.i54Wjq_memMeta{flex-wrap:wrap;align-items:center;gap:4px;display:flex}.i54Wjq_badge{background:color-mix(in srgb, var(--dsw-fg,#222) 8%, transparent);border-radius:4px;padding:0 5px;font-size:11px;line-height:1.5}.i54Wjq_badgeDraft{color:#b26a00;background:#ffb40029}.i54Wjq_badgeArchived{opacity:.8}.i54Wjq_memBody{opacity:.8;word-break:break-word;font-size:12px}.i54Wjq_memActs{flex-wrap:wrap;gap:4px;display:flex}.i54Wjq_memToolbarActs{align-items:center;gap:6px;display:flex}.i54Wjq_memNew{border:1px solid var(--dsw-border-weak,#80808040);border-radius:6px;flex-direction:column;gap:6px;padding:8px;display:flex}.i54Wjq_memNewRow{align-items:center;gap:8px;display:flex}.i54Wjq_memLabel{opacity:.8;align-items:center;gap:6px;font-size:12px;display:inline-flex}.i54Wjq_memNew select,.i54Wjq_memNew textarea{box-sizing:border-box;width:100%}";
|
|
1095
|
+
const css$2 = ".i54Wjq_panel{pointer-events:auto;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l2,#7f7f7f4d);border-radius:14px;flex-direction:column;width:380px;max-width:calc(100vw - 24px);max-height:min(70vh,640px);font-family:inherit;animation:.18s ease-out i54Wjq_panelIn;display:flex;position:fixed;overflow:hidden;box-shadow:0 12px 32px #00000029,0 2px 8px #00000014}@keyframes i54Wjq_panelIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}.i54Wjq_dragHandle{cursor:grab;z-index:1;justify-content:center;align-items:center;height:12px;display:flex;position:absolute;top:0;left:0;right:0}.i54Wjq_dragHandle:active{cursor:grabbing}.i54Wjq_handleGrip{background:var(--dsw-alias-separator-primary,#7f7f7f59);opacity:.8;border-radius:2px;width:32px;height:3px}.i54Wjq_header{border-bottom:1px solid var(--dsw-alias-border-l1,#7f7f7f2e);-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;gap:8px;padding:10px 10px 8px 14px;display:flex}.i54Wjq_headerLeft{align-items:center;gap:6px;min-width:0;display:flex}.i54Wjq_headerIcon{color:var(--dsw-alias-label-secondary);flex:none}.i54Wjq_headerTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;margin:0;font-size:13px;font-weight:600;line-height:20px}.i54Wjq_headerRight{align-items:center;gap:2px;margin-left:auto;display:flex}.i54Wjq_hintsOff{opacity:.45}.i54Wjq_hintsOff:hover{opacity:.75}.i54Wjq_counts{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-right:4px;font-size:11px;line-height:16px}.i54Wjq_boundBadge{color:var(--dsw-alias-label-primary-foreground,#fff);background:var(--dsw-alias-button-primary-fill,#3a6ef5);white-space:nowrap;border-radius:7px;flex:none;padding:0 6px;font-size:10px;line-height:14px}.i54Wjq_notice{color:var(--dsw-alias-state-warn-label,#b7791f);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);word-break:break-all;border-radius:8px;margin:8px 12px 0;padding:6px 10px;font-size:12px;line-height:18px}.i54Wjq_taskList{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2,transparent) transparent;flex-direction:column;gap:6px;padding:8px;display:flex;overflow-y:auto}.i54Wjq_emptyState{text-align:center;color:var(--dsw-alias-label-secondary);padding:36px 24px 30px}.i54Wjq_emptyTitle{color:var(--dsw-alias-label-primary);margin:0 0 6px;font-size:13px;font-weight:600}.i54Wjq_emptyDesc{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:20px}.i54Wjq_syncHint{color:var(--dsw-alias-label-dimmed);justify-content:center;align-items:center;gap:6px;margin:10px 0 0;font-size:11px;display:flex}.i54Wjq_card{border:1px solid var(--dsw-alias-border-l1,#7f7f7f29);background:var(--dsw-alias-bg-base,transparent);border-radius:10px;transition:border-color .15s;overflow:hidden}.i54Wjq_cardBound{border-color:var(--dsw-alias-border-l3,#7f7f7f59);box-shadow:inset 0 0 0 .5px var(--dsw-alias-border-l3,transparent)}.i54Wjq_cardHead{cursor:pointer;text-align:left;background:0 0;border:none;justify-content:space-between;align-items:center;gap:8px;width:100%;padding:8px 10px 7px;display:flex}.i54Wjq_cardHead:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_cardTitleRow{align-items:center;gap:6px;min-width:0;display:flex}.i54Wjq_cardTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.i54Wjq_cardMeta{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:8px;display:flex}.i54Wjq_progressText{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}.i54Wjq_updated{color:var(--dsw-alias-label-dimmed);font-size:10px;line-height:14px}.i54Wjq_chevron{color:var(--dsw-alias-label-tertiary);display:inline-flex}.i54Wjq_track{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f);border-radius:1px;height:2px;margin:0 10px 6px;overflow:hidden}.i54Wjq_trackFill{background:var(--dsw-alias-label-primary-bluish,var(--dsw-alias-button-primary-fill,#3a6ef5));border-radius:1px;height:100%;transition:width .2s}.i54Wjq_cardBody{border-top:1px solid var(--dsw-alias-border-l1,#7f7f7f24);overscroll-behavior:contain;max-height:300px;padding:8px 10px 10px;overflow-y:auto}.i54Wjq_section{margin-bottom:8px}.i54Wjq_section:last-child{margin-bottom:0}.i54Wjq_sectionLabel{color:var(--dsw-alias-label-secondary);align-items:center;gap:6px;margin-bottom:4px;font-size:11px;line-height:16px;display:flex}.i54Wjq_sectionCount{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);color:var(--dsw-alias-label-tertiary);border-radius:6px;padding:0 5px;font-size:10px;line-height:14px}.i54Wjq_stepsList{flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;display:flex}.i54Wjq_stepRow{align-items:flex-start;gap:7px;padding:3px 2px;display:flex}.i54Wjq_stepRow>svg{flex:none;margin-top:2px}.i54Wjq_stepDone{color:var(--dsw-alias-label-dimmed)}.i54Wjq_stepRun{color:var(--dsw-alias-label-primary-bluish,#3a6ef5)}.i54Wjq_stepPending{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:8px;height:8px;margin:5px 3px}.i54Wjq_stepContent{color:var(--dsw-alias-label-secondary);word-break:break-word;white-space:pre-wrap;font-size:12px;line-height:20px}.i54Wjq_stepContentDone{color:var(--dsw-alias-label-dimmed);text-decoration:line-through}.i54Wjq_stepContentRun{color:var(--dsw-alias-label-primary)}.i54Wjq_muted{color:var(--dsw-alias-label-dimmed);font-size:11px;line-height:18px}.i54Wjq_filesList{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.i54Wjq_fileRow{cursor:pointer;text-align:left;background:0 0;border:none;border-radius:6px;align-items:center;gap:6px;width:100%;padding:3px 4px;display:flex}.i54Wjq_fileRow:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_fileDot{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:5px;height:5px}.i54Wjq_filePath{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;text-align:left;direction:rtl;font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace;font-size:11px;line-height:18px;overflow:hidden}.i54Wjq_fileLine{color:var(--dsw-alias-label-dimmed);flex:none;font-size:10px;line-height:18px}.i54Wjq_cardFooter{gap:6px;margin-top:8px;display:flex}@media (prefers-reduced-motion:reduce){.i54Wjq_panel{animation:none}.i54Wjq_trackFill,.i54Wjq_card{transition:none}}.i54Wjq_miniBar{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));max-width:min(46vw,340px);height:34px;color:var(--dsw-alias-label-primary);cursor:grab;-webkit-user-select:none;user-select:none;pointer-events:auto;border-radius:999px;align-items:center;gap:7px;padding:0 12px;font-size:12px;line-height:18px;transition:background .15s,border-color .15s;display:inline-flex;position:fixed;box-shadow:0 6px 20px #00000024,0 1px 4px #00000014}.i54Wjq_miniBar:active{cursor:grabbing}.i54Wjq_miniBar:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_miniIcon{color:var(--dsw-alias-label-secondary);flex:none}.i54Wjq_miniText{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.i54Wjq_miniChevron{color:var(--dsw-alias-label-tertiary);flex:none}.i54Wjq_taskList{flex:auto;min-height:0;max-height:min(480px,56vh)}.i54Wjq_card{flex-direction:column;flex:none;display:flex}.i54Wjq_boundaryFallback{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,#fff);color:var(--dsw-alias-label-secondary);cursor:pointer;pointer-events:auto;border-radius:999px;padding:4px 10px;font-size:12px;line-height:18px;position:fixed;top:64px;right:16px}.i54Wjq_stepToggle{cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;align-items:center;margin-top:2px;padding:0;display:inline-flex}.i54Wjq_stepToggle:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.i54Wjq_stepToggle:disabled{cursor:default;opacity:.5}.i54Wjq_stepEditable{cursor:text;border-radius:3px}.i54Wjq_stepEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.i54Wjq_stepInput{box-sizing:border-box;width:auto;min-width:0;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);border-radius:5px;flex:auto;padding:0 5px;font-size:12px;line-height:20px}.i54Wjq_editorArea{box-sizing:border-box;min-width:0;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);resize:none;vertical-align:middle;cursor:text;white-space:pre-wrap;word-break:break-word;border-radius:5px;flex:1;margin:0;padding:2px 5px;font-family:inherit;font-size:12px;line-height:20px;overflow:hidden}.i54Wjq_editorArea:focus{border-color:var(--dsw-alias-border-l3,#7f7f7f99);outline:none}.i54Wjq_stepDragging{opacity:.3;background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_cardTitleEditable{cursor:text;border-radius:3px}.i54Wjq_cardTitleEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.i54Wjq_panel[data-theme=glass],.i54Wjq_miniBar[data-theme=glass]{background:color-mix(in srgb, var(--dsw-alias-bg-layer-2,#fff) 90%, transparent);-webkit-backdrop-filter:blur(18px)saturate(1.2);border:1px solid color-mix(in srgb, var(--dsw-alias-border-l2,#7f7f7f4d) 80%, transparent)}.i54Wjq_panel[data-theme=glass] .i54Wjq_card{background:color-mix(in srgb, var(--dsw-alias-bg-base,transparent) 84%, transparent);border-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f29) 60%, transparent)}.i54Wjq_panel[data-theme=glass] .i54Wjq_cardBody{border-top-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f24) 60%, transparent)}@media (prefers-reduced-transparency:reduce){.i54Wjq_panel[data-theme=glass],.i54Wjq_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff);-webkit-backdrop-filter:none;backdrop-filter:none}.i54Wjq_panel[data-theme=glass] .i54Wjq_card{background:var(--dsw-alias-bg-base,transparent)}}@supports not ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){.i54Wjq_panel[data-theme=glass],.i54Wjq_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff)}}.i54Wjq_panel[data-theme=brutal]{box-shadow:none;border-width:1px;border-radius:6px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_card{border:1px solid var(--dsw-alias-border-l3,#7f7f7f6b);background:var(--dsw-alias-bg-base,transparent);box-shadow:none;border-radius:3px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_cardHead{padding:7px 10px 6px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_cardTitle{letter-spacing:.01em;font-weight:650}.i54Wjq_panel[data-theme=brutal] .i54Wjq_headerTitle{letter-spacing:.03em}.i54Wjq_panel[data-theme=brutal] .i54Wjq_boundBadge{border-radius:2px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_track{border-radius:0;height:3px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_trackFill{border-radius:0}.i54Wjq_panel[data-theme=brutal] .i54Wjq_cardBody{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f3d)}.i54Wjq_panel[data-theme=mono] .i54Wjq_headerTitle,.i54Wjq_panel[data-theme=mono] .i54Wjq_counts,.i54Wjq_panel[data-theme=mono] .i54Wjq_cardTitle,.i54Wjq_panel[data-theme=mono] .i54Wjq_progressText,.i54Wjq_panel[data-theme=mono] .i54Wjq_stepContent,.i54Wjq_panel[data-theme=mono] .i54Wjq_filePath{font-family:ui-monospace,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.i54Wjq_panel[data-theme=mono] .i54Wjq_cardTitle{font-size:12px}.i54Wjq_panel[data-theme=mono] .i54Wjq_stepContent{font-size:11.5px}.i54Wjq_panel[data-theme=mono] .i54Wjq_card{border-radius:5px}.i54Wjq_panel[data-theme=mono] .i54Wjq_trackFill{border-radius:0}.i54Wjq_panel[data-theme=mono] .i54Wjq_stepPending{border-radius:1px}.i54Wjq_panel[data-theme=mono] .i54Wjq_updated{letter-spacing:.02em}.i54Wjq_headerIconBtn{color:inherit;cursor:pointer;background:0 0;border:none;border-radius:0;flex:none;justify-content:center;align-items:center;margin:0;padding:0;display:inline-flex}.i54Wjq_headerIcon{color:var(--dsw-alias-label-secondary);flex:none;display:block}.i54Wjq_headerLeft{min-width:0}.i54Wjq_headerTitle{text-overflow:ellipsis;flex:0 auto;min-width:0;overflow:hidden}.i54Wjq_headerRight{min-width:0}.i54Wjq_counts{text-overflow:ellipsis;flex:none;max-width:45%;margin-left:auto;overflow:hidden}.i54Wjq_dragGhost{pointer-events:none;z-index:9999;transition:left 50ms,top 50ms;position:fixed;transform:translate(-50%,-50%)}.i54Wjq_dragGhostCard{background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l3,#7f7f7f59);color:var(--dsw-alias-label-primary);white-space:nowrap;border-radius:8px;align-items:center;gap:8px;max-width:280px;padding:8px 12px;font-size:12px;line-height:20px;display:inline-flex;transform:scale(.9);box-shadow:0 8px 24px #0000002e,0 2px 8px #0000001a}.i54Wjq_dragGhostContent{text-overflow:ellipsis;word-break:break-word;flex:1;min-width:0;overflow:hidden}.i54Wjq_dragGhostClose{width:20px;height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;opacity:.6;background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;margin-left:8px;font-size:16px;line-height:1;transition:opacity .15s,background .15s,color .15s;display:inline-flex}.i54Wjq_dragGhostClose:hover{opacity:1;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.i54Wjq_dropTargetBefore{position:relative}.i54Wjq_dropTargetBefore:before{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite i54Wjq_dropPulse;position:absolute;top:-1px;left:0;right:0}.i54Wjq_dropTargetAfter{position:relative}.i54Wjq_dropTargetAfter:after{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite i54Wjq_dropPulse;position:absolute;bottom:-1px;left:0;right:0}@keyframes i54Wjq_dropPulse{0%,to{opacity:.6}50%{opacity:1}}.i54Wjq_memoryPane{flex-direction:column;gap:6px;max-height:480px;padding:8px 10px 10px;display:flex;overflow:auto}.i54Wjq_memToolbar{justify-content:space-between;align-items:center;gap:8px;display:flex}.i54Wjq_memCount{opacity:.75;font-size:12px;font-weight:600}.i54Wjq_memList{flex-direction:column;gap:6px;display:flex}.i54Wjq_memSentinel{flex:none;height:1px}.i54Wjq_memFooter{flex-direction:column;align-items:center;gap:4px;padding:6px 0 2px;font-size:12px;display:flex}.i54Wjq_memRow{border:1px solid var(--dsw-border-weak,#80808040);background:color-mix(in srgb, var(--dsw-bg-secondary,#f5f5f5) 45%, transparent);content-visibility:auto;contain-intrinsic-size:auto 76px;border-radius:6px;flex-direction:column;gap:4px;padding:6px 8px;display:flex}.i54Wjq_memRowArchived{opacity:.55}.i54Wjq_memRowMain{flex-direction:column;gap:2px;display:flex}.i54Wjq_memTitle{word-break:break-word;align-items:flex-start;gap:6px;font-size:13px;line-height:1.35;display:flex}.i54Wjq_kindBadge{background:var(--dsw-accent-soft,#5078ff26);color:var(--dsw-accent,#4d6bfe);border-radius:4px;flex:none;padding:0 5px;font-size:11px;line-height:1.5}.i54Wjq_memMeta{flex-wrap:wrap;align-items:center;gap:4px;display:flex}.i54Wjq_badge{background:color-mix(in srgb, var(--dsw-fg,#222) 8%, transparent);border-radius:4px;padding:0 5px;font-size:11px;line-height:1.5}.i54Wjq_badgeDraft{color:#b26a00;background:#ffb40029}.i54Wjq_badgeArchived{opacity:.8}.i54Wjq_memBody{opacity:.8;word-break:break-word;font-size:12px}.i54Wjq_memActs{flex-wrap:wrap;gap:4px;display:flex}.i54Wjq_memToolbarActs{align-items:center;gap:6px;display:flex}.i54Wjq_memNew{border:1px solid var(--dsw-border-weak,#80808040);border-radius:6px;flex-direction:column;gap:6px;padding:8px;display:flex}.i54Wjq_memNewRow{align-items:center;gap:8px;display:flex}.i54Wjq_memLabel{opacity:.8;align-items:center;gap:6px;font-size:12px;display:inline-flex}.i54Wjq_memNew select,.i54Wjq_memNew textarea{box-sizing:border-box;width:100%}";
|
|
1094
1096
|
const tagId$2 = "@yolk_vat-y/dsh-project-memory/TaskPanel.module.css";
|
|
1095
1097
|
if (typeof document !== "undefined") {
|
|
1096
1098
|
const selector = "style[data-plugin-css=" + JSON.stringify(tagId$2) + "]";
|
|
@@ -1324,6 +1326,11 @@ window.__ModuleLoader__.load({
|
|
|
1324
1326
|
const [titleEdit, setTitleEdit] = (0, react.useState)(null);
|
|
1325
1327
|
const done = steps.filter((s) => s.status === "completed").length;
|
|
1326
1328
|
const pct = steps.length > 0 ? Math.round(done / steps.length * 100) : 0;
|
|
1329
|
+
const showStepsSection = !(task.teamTaskId && steps.length === 0);
|
|
1330
|
+
const showFilesSection = (task.files?.length ?? 0) > 0;
|
|
1331
|
+
const insights = Array.isArray(task.insights) ? task.insights : [];
|
|
1332
|
+
const showInsightsSection = Boolean(onInsightAction) && insights.length > 0;
|
|
1333
|
+
const hasBody = showStepsSection || showFilesSection || showInsightsSection;
|
|
1327
1334
|
const commitStepEdit = (index) => {
|
|
1328
1335
|
if (!stepEdit || stepEdit.index !== index) return;
|
|
1329
1336
|
if (syncing) return;
|
|
@@ -1422,7 +1429,7 @@ window.__ModuleLoader__.load({
|
|
|
1422
1429
|
className: TaskPanel_module_css_default.updated,
|
|
1423
1430
|
children: timeAgo(task.updatedAt || task.lastActiveAt, "")
|
|
1424
1431
|
}),
|
|
1425
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1432
|
+
hasBody && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1426
1433
|
className: TaskPanel_module_css_default.chevron,
|
|
1427
1434
|
children: expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronUpOutline14, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutline14, {})
|
|
1428
1435
|
})
|
|
@@ -1436,10 +1443,10 @@ window.__ModuleLoader__.load({
|
|
|
1436
1443
|
style: { width: `${pct}%` }
|
|
1437
1444
|
})
|
|
1438
1445
|
}),
|
|
1439
|
-
expanded && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1446
|
+
expanded && hasBody && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1440
1447
|
className: TaskPanel_module_css_default.cardBody,
|
|
1441
1448
|
children: [
|
|
1442
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1449
|
+
showStepsSection && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1443
1450
|
className: TaskPanel_module_css_default.section,
|
|
1444
1451
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1445
1452
|
className: TaskPanel_module_css_default.sectionLabel,
|
|
@@ -1527,7 +1534,7 @@ window.__ModuleLoader__.load({
|
|
|
1527
1534
|
children: t("panel.empty-desc")
|
|
1528
1535
|
})]
|
|
1529
1536
|
}),
|
|
1530
|
-
|
|
1537
|
+
showFilesSection && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1531
1538
|
className: TaskPanel_module_css_default.section,
|
|
1532
1539
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1533
1540
|
className: TaskPanel_module_css_default.sectionLabel,
|
|
@@ -1562,17 +1569,17 @@ window.__ModuleLoader__.load({
|
|
|
1562
1569
|
})]
|
|
1563
1570
|
})]
|
|
1564
1571
|
}),
|
|
1565
|
-
onInsightAction &&
|
|
1572
|
+
onInsightAction && showInsightsSection && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1566
1573
|
className: TaskPanel_module_css_default.section,
|
|
1567
1574
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1568
1575
|
className: TaskPanel_module_css_default.sectionLabel,
|
|
1569
1576
|
children: [t("mem.section-label"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1570
1577
|
className: TaskPanel_module_css_default.sectionCount,
|
|
1571
|
-
children:
|
|
1578
|
+
children: insights.length
|
|
1572
1579
|
})]
|
|
1573
1580
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
1574
1581
|
className: TaskPanel_module_css_default.memList,
|
|
1575
|
-
children:
|
|
1582
|
+
children: insights.map((ins) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
1576
1583
|
className: TaskPanel_module_css_default.memRow,
|
|
1577
1584
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1578
1585
|
className: TaskPanel_module_css_default.memTitle,
|
|
@@ -1648,6 +1655,46 @@ window.__ModuleLoader__.load({
|
|
|
1648
1655
|
]
|
|
1649
1656
|
});
|
|
1650
1657
|
}
|
|
1658
|
+
// src/util/insight-fields.js
|
|
1659
|
+
/**
|
|
1660
|
+
* 每个 kind 的「解答」字段(写侧 / 列表摘要侧的唯一一份映射)。
|
|
1661
|
+
*
|
|
1662
|
+
* 由来:面板把 textarea 的正文提交到哪个字段(MemoryView.submitNew)、编辑时从哪个字段
|
|
1663
|
+
* 预填(MemoryView.rowToForm)、记忆列表的合成摘要取哪个字段当正文(insight-actions.insSummary)
|
|
1664
|
+
* 原先各写一份 if/else 链,三处必须对同一 kind 指向同一字段,抄漏一处就是"编辑后正文搬了家"。
|
|
1665
|
+
* 映射依据 KIND_CONTENT 的配对:每种 kind 是 [症状, 解答],解答即正文;
|
|
1666
|
+
* procedure 的正文是 steps(没有单字段正文),未知 kind 落到通用 body。
|
|
1667
|
+
*
|
|
1668
|
+
* 查表用 `Object.hasOwn` 而不是 `map[kind] || 'body'`:kind 是外来字符串(脏 JSON / 手改
|
|
1669
|
+
* store),`__proto__` / `constructor` 会命中原型成员,返回函数就不是字段名了。
|
|
1670
|
+
*/
|
|
1671
|
+
const BODY_FIELD = {
|
|
1672
|
+
lesson: "fix",
|
|
1673
|
+
decision: "reason",
|
|
1674
|
+
experience: "solution"
|
|
1675
|
+
};
|
|
1676
|
+
/**
|
|
1677
|
+
* kind → 正文所在字段名。
|
|
1678
|
+
* @param {unknown} kind - 记忆条目的 kind(可能是缺失/脏值)。
|
|
1679
|
+
* @returns {'fix'|'reason'|'solution'|'body'} 字段名;procedure 与未知 kind 都是 `body`。
|
|
1680
|
+
*/
|
|
1681
|
+
function bodyFieldOf(kind) {
|
|
1682
|
+
return typeof kind === "string" && Object.hasOwn(BODY_FIELD, kind) ? BODY_FIELD[kind] : "body";
|
|
1683
|
+
}
|
|
1684
|
+
/** 与正文配对的「症状」字段:新建条目时用标题镜像它(KIND_CONTENT 的另一半)。 */
|
|
1685
|
+
const TITLE_FIELD = {
|
|
1686
|
+
lesson: "pattern",
|
|
1687
|
+
decision: "choice",
|
|
1688
|
+
experience: "problem"
|
|
1689
|
+
};
|
|
1690
|
+
/**
|
|
1691
|
+
* kind → 新建时用标题镜像的字段名。
|
|
1692
|
+
* @param {unknown} kind - 记忆条目的 kind(可能是缺失/脏值)。
|
|
1693
|
+
* @returns {'pattern'|'choice'|'problem'|null} 字段名;procedure 与未知 kind 没有对应字段。
|
|
1694
|
+
*/
|
|
1695
|
+
function titleFieldOf(kind) {
|
|
1696
|
+
return typeof kind === "string" && Object.hasOwn(TITLE_FIELD, kind) ? TITLE_FIELD[kind] : null;
|
|
1697
|
+
}
|
|
1651
1698
|
// src/client/paging.js
|
|
1652
1699
|
/** 预取提前量:哨兵进入视口**下方 600px** 就开始取下一页,数据在滚到底之前到位。 */
|
|
1653
1700
|
const PREFETCH_MARGIN = "600px 0px";
|
|
@@ -2047,7 +2094,7 @@ window.__ModuleLoader__.load({
|
|
|
2047
2094
|
}
|
|
2048
2095
|
};
|
|
2049
2096
|
const rowToForm = (row) => {
|
|
2050
|
-
const main = row.kind === "
|
|
2097
|
+
const main = row.kind === "procedure" ? "" : row[bodyFieldOf(row.kind)];
|
|
2051
2098
|
const body = main && main !== row.title ? main : "";
|
|
2052
2099
|
return {
|
|
2053
2100
|
title: row.title || "",
|
|
@@ -2104,17 +2151,10 @@ window.__ModuleLoader__.load({
|
|
|
2104
2151
|
kind: form.kind
|
|
2105
2152
|
};
|
|
2106
2153
|
if (!editingId) {
|
|
2107
|
-
|
|
2108
|
-
if (
|
|
2109
|
-
if (form.kind === "experience") fields.problem = title;
|
|
2110
|
-
}
|
|
2111
|
-
if (form.kind !== "procedure" && (editingId || form.body.trim())) {
|
|
2112
|
-
const body = form.body.trim();
|
|
2113
|
-
if (form.kind === "lesson") fields.fix = body;
|
|
2114
|
-
else if (form.kind === "decision") fields.reason = body;
|
|
2115
|
-
else if (form.kind === "experience") fields.solution = body;
|
|
2116
|
-
else fields.body = body;
|
|
2154
|
+
const titleField = titleFieldOf(form.kind);
|
|
2155
|
+
if (titleField) fields[titleField] = title;
|
|
2117
2156
|
}
|
|
2157
|
+
if (form.kind !== "procedure" && (editingId || form.body.trim())) fields[bodyFieldOf(form.kind)] = form.body.trim();
|
|
2118
2158
|
const editingRow = editingId ? rows.find((r) => r.id === editingId) : null;
|
|
2119
2159
|
const stepsTruncated = Boolean(editingId && (editingRow?.stepsTotal ?? 0) > 50);
|
|
2120
2160
|
if (form.kind === "procedure" && (editingId || form.steps.trim()) && !stepsTruncated) fields.steps = form.steps.split("\n").map((s) => s.trim()).filter(Boolean);
|
|
@@ -2433,6 +2473,19 @@ window.__ModuleLoader__.load({
|
|
|
2433
2473
|
]
|
|
2434
2474
|
});
|
|
2435
2475
|
}
|
|
2476
|
+
/**
|
|
2477
|
+
* 再放一批之后渲染到第几张。
|
|
2478
|
+
* @param {number} current - 当前渲染上限。
|
|
2479
|
+
* @param {number} total - 当前活跃任务总数。
|
|
2480
|
+
* @param {number} [step] - 每批张数,默认 TASK_PAGE_SIZE。
|
|
2481
|
+
* @returns {number} 新的渲染上限:不超过 total,也不比 current 小(非法输入按 0 起算)。
|
|
2482
|
+
*/
|
|
2483
|
+
function nextTaskCount(current, total, step = 12) {
|
|
2484
|
+
const t = Number.isFinite(total) && total > 0 ? Math.floor(total) : 0;
|
|
2485
|
+
if (t === 0) return 0;
|
|
2486
|
+
const s = Number.isFinite(step) && step > 0 ? Math.floor(step) : 12;
|
|
2487
|
+
return Math.min(t, (Number.isFinite(current) && current > 0 ? Math.floor(current) : 0) + s);
|
|
2488
|
+
}
|
|
2436
2489
|
// src/client/session-id.js
|
|
2437
2490
|
/**
|
|
2438
2491
|
* 会话列表快照 → 当前会话 id(宿主版本兼容层)。
|
|
@@ -2579,6 +2632,10 @@ window.__ModuleLoader__.load({
|
|
|
2579
2632
|
const tasks = Array.isArray(data.tasks) ? data.tasks : [];
|
|
2580
2633
|
const activeTasks = tasks.filter((task) => !task.archived);
|
|
2581
2634
|
const boundTask = data.boundTaskId ? tasks.find((task) => task.id === data.boundTaskId) ?? null : null;
|
|
2635
|
+
const [shownCount, setShownCount] = (0, react.useState)(12);
|
|
2636
|
+
const listRef = (0, react.useRef)(null);
|
|
2637
|
+
const sentinelRef = (0, react.useRef)(null);
|
|
2638
|
+
const visibleTasks = activeTasks.slice(0, Math.min(shownCount, activeTasks.length));
|
|
2582
2639
|
const applyPayload = (text, requestSessionId) => {
|
|
2583
2640
|
if (requestSessionId !== sessionIdRef.current) return false;
|
|
2584
2641
|
const parsed = parseTaskPayloadText(text);
|
|
@@ -2744,6 +2801,28 @@ window.__ModuleLoader__.load({
|
|
|
2744
2801
|
ui.view,
|
|
2745
2802
|
sessionId
|
|
2746
2803
|
]);
|
|
2804
|
+
(0, react.useEffect)(() => {
|
|
2805
|
+
setShownCount(12);
|
|
2806
|
+
}, [sessionId]);
|
|
2807
|
+
(0, react.useEffect)(() => {
|
|
2808
|
+
if (ui.closed || ui.minimized || view !== "task" || shownCount >= activeTasks.length) return;
|
|
2809
|
+
const sentinel = sentinelRef.current;
|
|
2810
|
+
if (!sentinel || typeof IntersectionObserver === "undefined") return;
|
|
2811
|
+
const observer = new IntersectionObserver((entries) => {
|
|
2812
|
+
if (entries.some((e) => e.isIntersecting)) setShownCount((n) => nextTaskCount(n, activeTasks.length));
|
|
2813
|
+
}, {
|
|
2814
|
+
root: listRef.current ?? null,
|
|
2815
|
+
rootMargin: "0px"
|
|
2816
|
+
});
|
|
2817
|
+
observer.observe(sentinel);
|
|
2818
|
+
return () => observer.disconnect();
|
|
2819
|
+
}, [
|
|
2820
|
+
ui.closed,
|
|
2821
|
+
ui.minimized,
|
|
2822
|
+
view,
|
|
2823
|
+
shownCount,
|
|
2824
|
+
activeTasks.length
|
|
2825
|
+
]);
|
|
2747
2826
|
if (ui.closed) return null;
|
|
2748
2827
|
if (ui.minimized) {
|
|
2749
2828
|
const label = boundTask ? `${t("minibar.current")}: ${boundTask.title}` : activeTasks.length > 0 ? `${t("minibar.current")}: ${activeTasks.length} ${t("minibar.tasks")}` : t("minibar.no-task");
|
|
@@ -2905,31 +2984,48 @@ window.__ModuleLoader__.load({
|
|
|
2905
2984
|
})
|
|
2906
2985
|
]
|
|
2907
2986
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2987
|
+
ref: listRef,
|
|
2908
2988
|
className: TaskPanel_module_css_default.taskList,
|
|
2909
|
-
children: [
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2989
|
+
children: [
|
|
2990
|
+
visibleTasks.map((task) => {
|
|
2991
|
+
const expanded = ui.expandedTaskIds.includes(task.id);
|
|
2992
|
+
const isBound = data.boundTaskId === task.id;
|
|
2993
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaskCard, {
|
|
2994
|
+
task,
|
|
2995
|
+
isBound,
|
|
2996
|
+
expanded,
|
|
2997
|
+
onToggleExpand: () => uiActions.toggleTaskExpanded(task.id),
|
|
2998
|
+
onSwitch: () => handleAction("switch", task.id),
|
|
2999
|
+
onUnbind: () => runLine("/tasks unbind"),
|
|
3000
|
+
onArchive: () => handleAction("archive", task.id),
|
|
3001
|
+
onRename: (value) => commitTitle(task.id, value),
|
|
3002
|
+
onEditStep: (index, value) => commitStepText(task.id, index, value),
|
|
3003
|
+
onCycleStatus: (index) => cycleStatus(task.id, index),
|
|
3004
|
+
onReorderSteps: (from, to) => reorderSteps(task.id, from, to),
|
|
3005
|
+
onInsightAction: (action, id) => void handleInsightTask(action, id),
|
|
3006
|
+
showHints,
|
|
3007
|
+
syncing,
|
|
3008
|
+
t
|
|
3009
|
+
}, task.id);
|
|
3010
|
+
}),
|
|
3011
|
+
syncing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3012
|
+
className: TaskPanel_module_css_default.syncHint,
|
|
3013
|
+
children: t("panel.syncing")
|
|
3014
|
+
}),
|
|
3015
|
+
shownCount < activeTasks.length && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3016
|
+
ref: sentinelRef,
|
|
3017
|
+
className: TaskPanel_module_css_default.memSentinel,
|
|
3018
|
+
"aria-hidden": "true"
|
|
3019
|
+
}), typeof IntersectionObserver === "undefined" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3020
|
+
className: TaskPanel_module_css_default.memFooter,
|
|
3021
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
3022
|
+
variant: "outline",
|
|
3023
|
+
size: "sm",
|
|
3024
|
+
onClick: () => setShownCount((n) => nextTaskCount(n, activeTasks.length)),
|
|
3025
|
+
children: t("panel.loadMore")
|
|
3026
|
+
})
|
|
3027
|
+
})] })
|
|
3028
|
+
]
|
|
2933
3029
|
})
|
|
2934
3030
|
]
|
|
2935
3031
|
});
|