dsh-plugin-tool-management 0.22.7 → 0.22.8

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
@@ -9,6 +9,29 @@
9
9
 
10
10
  ---
11
11
 
12
+ ## [0.22.8] - 2026-11-12
13
+
14
+ > **适配宿主 0.2.2-rc.2**
15
+
16
+ ### 变更
17
+
18
+ - **自主记忆的否决与删除直接进统一回收站**:正文移入回收站后原件从独立库删除,恢复与永久删除都在回收站完成;否决不写墓碑,删除仍写墓碑。
19
+ - **自主记忆卡只保留「全局」与「工作区」**:移除「已归档」分组、恢复按钮与归档统计,停用的条目不再留在卡片上。
20
+ - **升级时迁移已归档的自主记忆**:用户停用的 archived 条目移入统一回收站并从独立库删除;维护扫描产生的归档保留在原地,工作区目录回来时仍可恢复。
21
+ - **新建记忆的类型行改配比**:层级下拉(全局 / 工作区 / 场景)收窄成固定宽度,场景名与工作区名下拉变宽,长名字不再被截断。
22
+ - **记忆页头统计格按内容分配宽度**:记忆域预算那格按文字自然宽度占位,不再与另两格等分,满值时也不被截断。
23
+ - **记忆族工具统一为 `memory_manager_*`**:`memory_manager_get` / `_switch` / `_remember` / `_note`,旧名自动迁移。
24
+ - **控制面工具改名为 `tool_manager_switch`**:`list` / `enable` / `disable` / `repair` 四个动作不变。
25
+ - **删除与回收站工具改名为 `plugin_manager_trash`**:`trash` / `restore` / `list` 三个动作不变。
26
+ - **人设文件的 `tools` / `toolsDeny` 读取时翻译旧工具名**:改名后旧的 deny 名单不会静默失效。
27
+ - **工具表表外那行写明工具名与体积**:改为 `memory_manager_note(≈N)随自主记忆开启`;关闭自主记忆时整行不显示。
28
+
29
+ ### 修复
30
+
31
+ - **回收站永久删除残留索引与状态**:删除后同步清掉启停索引、catalog 与 state 条目,不会留下「删了又回来」的空壳。
32
+ - **工具重名不再中断整个装配**:与别的插件注册同名工具时只跳过那一条,其余工具与面板 API 照常可用。
33
+ - **兼容页的记忆域标签显示内部键名**:工具表组头改为「记忆」,注入实况按「全局记忆 / 工作区记忆」分行,不再出现 `compat.inject.domain.memoryGlobal`。
34
+
12
35
  ## [0.22.7] - 2026-11-12
13
36
 
14
37
  > **适配宿主 0.2.2-rc.2**
package/README.md CHANGED
@@ -101,22 +101,22 @@ dsh plugin --profile desktop add dsh-plugin-tool-management@latest # 桌面版
101
101
 
102
102
  - **两个独立开关**:全局 / 本工作区各自开关,可都开或只开一层;学习与注入都跟随它们,只开一层时卡片只列那一层。记忆页把自主记忆收在一张卡里:卡内先列全局一节,再按工作区分节;开关只决定哪几层注入。
103
103
  - **每次学习都问一次**:新条目一律弹卡,由你选「加入全局记忆」「加入本工作区」或「不加入」;只有两种例外不弹 —— 打开「自动确认」后交给 agent 决定(层也由它选,包含全局层),以及合并进一条已生效的记忆(层已经定了,不必再问)。普通任务中 agent 不扫描对话,重要信息由宿主压缩时的复习兜底。
104
- - **证据分三档,模型不能自报**:逐字命中你的原话 / 你看过原文点过确认 / agent 自己推断 —— 排序与页面标签用这三档,`memory_note` 没有「我很有把握」这种参数可填;已经在用户记忆里说过的事不再另记一份。
104
+ - **证据分三档,模型不能自报**:逐字命中你的原话 / 你看过原文点过确认 / agent 自己推断 —— 排序与页面标签用这三档,`memory_manager_note` 没有「我很有把握」这种参数可填;已经在用户记忆里说过的事不再另记一份。
105
105
  - **卡片按正文语言显示,可改措辞**:卡片只用记忆正文的语言;在卡片里写下自己的想法,会退回模型按你的话重写并重新弹卡确认。没有交互界面时(后台复习 / headless)先进「待确认」,可在记忆页逐条处理。
106
106
  - **类型决定保质期,判错可以自己改**:每条记忆带一个类型(偏好 / 事实 / 纠正 / 做法)。事实与做法 30 天后提醒复核,偏好与纠正不过期 —— 复核卡片与编辑弹窗都会写明当前类型与它意味着什么。模型判错时在编辑弹窗里改类型,保质期跟着重算。
107
107
  - **两条注入消息,预算按域独立**:全局自动记忆并进「常驻记忆」那段,本工作区自动记忆与手写的工作区记忆合成「工作区记忆」那段;新增一条只重发对应那一段。记忆域 256 KiB,手写记忆与自主记忆在该域内共用;技能 / MCP / 子智能体按条目数、提示词 64 KiB 各自独立。记忆域超限时按「工作区自主 → 全局自主 → 工作区记忆 → 场景记忆 → 全局记忆」整条让位,段尾列出未注入的条目,页头预算转红。
108
- - **停用、归档、删除是三件事**:行内开关只拨「暂不注入」,条目留在列表里随时拨回;⋯ 菜单的「否决」把它归档(不再注入、列表里收起、随时可恢复,文件不动);「删除」才进回收站并写墓碑,可恢复或永久删除。⋯ 菜单也可改正文。
108
+ - **停用、否决、删除是三件事**:行内开关只拨「暂不注入」,条目留在列表里随时拨回;⋯ 菜单的「否决」把正文移进统一回收站(不再注入,可在回收站恢复,不写墓碑);「删除」也进回收站并写墓碑,30 天内同义内容学不回来。两者都能从回收站恢复或永久删除,⋯ 菜单也可改正文。
109
109
  - **后台复习与维护**:宿主压缩上下文时复习一次那份提炼结果,没压缩就不复习;失败有重试入口;维护扫描每天最多一次,归档 / 失效只改状态、不删记忆正文;30 天前的 episode 文件会被清理。正文与状态在 `evolution/notes/`,工具不出现在模型工具表里、也不随场景切换。
110
110
 
111
111
  ## 让 Agent 管这个插件
112
112
 
113
- 六个操作域共 **23 条模型工具**:列清单、读正文、新建、修改、删除、启停、进出场景、应用提示词、派子智能体。其中 22 条可在工具表逐条开关,`memory_note` 跟随自主记忆总开关。
113
+ 六个操作域共 **23 条模型工具**:列清单、读正文、新建、修改、删除、启停、进出场景、应用提示词、派子智能体。其中 22 条可在工具表逐条开关,`memory_manager_note` 跟随自主记忆总开关。
114
114
 
115
- - **默认只发 5 条**(`tool_manager_tools` / `memory_get` / `memory_remember` / `skill_manager_read` / `subagent_manager_run`),17 条手动开关默认关着;`memory_note` 另跟随总开关,关闭时 5 条、打开时 6 条。关掉不是藏起来,是**根本没进 schema**——模型看不到,也调不到。
115
+ - **默认只发 5 条**(`tool_manager_switch` / `memory_manager_get` / `memory_manager_remember` / `skill_manager_read` / `subagent_manager_run`),17 条手动开关默认关着;`memory_manager_note` 另跟随总开关,关闭时 5 条、打开时 6 条。关掉不是藏起来,是**根本没进 schema**——模型看不到,也调不到。
116
116
  - **按层生效**:模型默认只改当前这一层,回执会说清写的是哪一层;带 `scope: "global"` 才动全局。
117
117
  - **写操作有确认卡**:停机、删除、开关落到机器级等都会先问一句;恢复动作(重启 / 还原 / 取消应用)不拦。会话处于「完全权限」审批策略(`never`)时不会弹卡,需要确认的写操作会被宿主直接拒绝;可恢复动作照常放行。
118
118
  - **逐条可开关**:兼容页的「模型工具表」按层调整,22 条全开约 6k token/轮;可以按任务存成不同方案,跟场景一起切。
119
- - **关掉的模型自己能开**:常驻的那条 `tool_manager_tools` 能列出这个对话关着的工具(名字 + 用途 + ≈token)并按需打开 —— 用户说「进入某个场景」而场景工具恰好关着时,模型有路走,不用回头找用户。
119
+ - **关掉的模型自己能开**:常驻的那条 `tool_manager_switch` 能列出这个对话关着的工具(名字 + 用途 + ≈token)并按需打开 —— 用户说「进入某个场景」而场景工具恰好关着时,模型有路走,不用回头找用户。
120
120
 
121
121
  ## 兼容页
122
122
 
@@ -127,7 +127,7 @@ dsh plugin --profile desktop add dsh-plugin-tool-management@latest # 桌面版
127
127
  - **访问令牌**:设置 / 关闭 / 修改 / 删除;写操作与明文密钥都走它。
128
128
  - **生效层级**:全部全局 / 按工作区 / 按会话,一键切。
129
129
  - **注入**:七个域的开关(全局记忆与工作区记忆在界面上合并为一颗)、极简模式兜底注入、技能 / MCP / 子智能体的目录上限(超出的折叠为一行,描述字符数也可配)、斜杠命令两段入口、侧栏入口。
130
- - **模型工具表**:22 条逐条可见性,另有 `memory_note` 跟随自主记忆总开关;按层保存方案。
130
+ - **模型工具表**:22 条逐条可见性,另有 `memory_manager_note` 跟随自主记忆总开关;按层保存方案。
131
131
  - **维护**:清理旧备份、功能总览、最近改动。
132
132
 
133
133
  <details>
@@ -159,7 +159,7 @@ dsh plugin --profile desktop add dsh-plugin-tool-management@latest # 桌面版
159
159
  | 现象 | 解决 |
160
160
  |:--------------------- |:------------------------------------------------------------------------------------------- |
161
161
  | 装完没有页面 | 硬刷新浏览器;还不行就重启 DSH。 |
162
- | 模型调不到某条工具 | 兼容页 →「模型工具表」,先选对当前对话 / 工作区(出厂默认关着 17 条手动开关;`memory_note` 另看自主记忆总开关)。面板和脚本不受影响。 |
162
+ | 模型调不到某条工具 | 兼容页 →「模型工具表」,先选对当前对话 / 工作区(出厂默认关着 17 条手动开关;`memory_manager_note` 另看自主记忆总开关)。面板和脚本不受影响。 |
163
163
  | 升级 DSH 后动作不可用 | 兼容页看降级原因;`node scripts/doctor.mjs`,再 `node scripts/host-deps.mjs --fix`。 |
164
164
  | 版本对不上 | 只适配 DSH **0.2.2**(`>=0.2.2-rc.2 <0.2.3`),跨代升级要等插件同步适配;`0.2.2-rc.1` 请装 0.22.5,更早宿主装 0.21.x。 |
165
165
  | 重复 MCP 页签 | 删掉 `cordis.patch.yml` 里的旧 loader 行,再重启。 |
package/README_EN.md CHANGED
@@ -104,19 +104,19 @@ Off by default. When on, the agent records preferences, facts and corrections wo
104
104
  - **Card language, rewording, and pending**: the card uses the language of the note body; type your own wording in the card and it goes back to the model to rewrite, then asks you again. Without an interactive card (background review, headless sessions) the note saves as pending and is handled on the Memory page; with auto-confirm on it goes active directly.
105
105
  - **Type decides shelf life, and a wrong call is yours to fix**: every note carries a type (preference / fact / correction / procedure). Facts and procedures get a review reminder after 30 days; preferences and corrections never expire. The review card and the editor both state the current type and what it means; if the model got it wrong, change it in the editor and the shelf life is recomputed.
106
106
  - **Two injection messages, and budgets are per domain**: global learned notes join the always-on block, while workspace learned notes and hand-written workspace memories are merged into one “Workspace memories” block; adding one note re-sends only its block. The memory domain is 256 KiB, shared by hand-written and learned notes; skills / MCP / subagents are capped by entry count and prompts at 64 KiB, independently. Within the memory domain, over-limit entries step aside whole in the order workspace notes → global notes → workspace memories → scene memories → global memories; the ones left out are listed at the end and the page-header budget turns red.
107
- - **Evidence comes in three tiers and the model cannot claim one**: a verbatim match of your own words, your confirmation on a card that showed the text, or the agent's own inference — sorting and page labels use those tiers, and `memory_note` has no “I'm confident” parameter to fill in. Something already covered by your own memories is not written a second time.
108
- - **Disable, archive and delete are three different things**: the row switch only flips "not injected for now" — the note stays in the list and flips back any time. The ⋯ menu's reject archives it (no longer injected, folded away in the list, restorable at any time, file untouched). Only delete moves it to the recycle bin and writes a tombstone, so the wording cannot be re-learned for 30 days; restore or delete it permanently from there. The ⋯ menu also edits the body.
107
+ - **Evidence comes in three tiers and the model cannot claim one**: a verbatim match of your own words, your confirmation on a card that showed the text, or the agent's own inference — sorting and page labels use those tiers, and `memory_manager_note` has no “I'm confident” parameter to fill in. Something already covered by your own memories is not written a second time.
108
+ - **Disable, reject and delete are three different things**: the row switch only flips "not injected for now" — the note stays in the list and flips back any time. The ⋯ menu's reject moves the body into the unified recycle bin (no longer injected, restorable there, no tombstone). Delete also moves it to the recycle bin and writes a tombstone, so the wording cannot be re-learned for 30 days; either one can be restored or deleted permanently from the recycle bin. The ⋯ menu also edits the body.
109
109
  - **Background review and upkeep**: review runs only when the host compacts the context — no compaction, no review; failures retry with backoff and have a manual retry entry; maintenance runs at most once a day, archives / invalidates by changing status only (bodies are kept), and removes episode files older than 30 days. Note bodies and state live under `evolution/notes/`, and the tool never appears in the model tool table or follows scenes — only the two switches.
110
110
 
111
111
  ## Let the agent drive it
112
112
 
113
- Six operation domains, **23 model tools**: list, read, create, update, delete, toggle, enter or leave a scene, apply a prompt, run a persona. 22 of them can be toggled individually in the tool table; `memory_note` follows the autonomous-memory master switch.
113
+ Six operation domains, **23 model tools**: list, read, create, update, delete, toggle, enter or leave a scene, apply a prompt, run a persona. 22 of them can be toggled individually in the tool table; `memory_manager_note` follows the autonomous-memory master switch.
114
114
 
115
- - **Only 5 ship enabled** (`tool_manager_tools` / `memory_get` / `memory_remember` / `skill_manager_read` / `subagent_manager_run`); 17 manual toggles stay off by default. `memory_note` follows the master switch separately, so a request carries 5 tools when it is off and 6 when it is on. Off means **not in the schema at all** — the model cannot see them, let alone call them.
115
+ - **Only 5 ship enabled** (`tool_manager_switch` / `memory_manager_get` / `memory_manager_remember` / `skill_manager_read` / `subagent_manager_run`); 17 manual toggles stay off by default. `memory_manager_note` follows the master switch separately, so a request carries 5 tools when it is off and 6 when it is on. Off means **not in the schema at all** — the model cannot see them, let alone call them.
116
116
  - **Scoped writes**: the model writes to the current layer by default and the receipt says which one; `scope: "global"` is required to touch everything.
117
117
  - **Confirmation cards**: stopping servers, deleting, machine-wide toggles and similar writes ask first; recovery actions (restart, restore, undo apply) go straight through. With the host's `never` approval policy no card appears: writes that need confirmation are rejected by the host, while recovery actions still go through.
118
118
  - **Per-tool control**: the model-tool table on the Host page adjusts visibility per layer. All 22 on is ~6k tokens/turn; profiles can be saved per task and switched together with a scene.
119
- - **The model can switch tools back on**: the always-on `tool_manager_tools` lists the tools that are off in this conversation (name, purpose, ≈tokens) and turns them on as needed — when the user asks for a scene whose tools happen to be off, the model has a way forward instead of bouncing back to the user.
119
+ - **The model can switch tools back on**: the always-on `tool_manager_switch` lists the tools that are off in this conversation (name, purpose, ≈tokens) and turns them on as needed — when the user asks for a scene whose tools happen to be off, the model has a way forward instead of bouncing back to the user.
120
120
 
121
121
  ## The Host page
122
122
 
@@ -127,7 +127,7 @@ More than a version number:
127
127
  - **Access token**: set / disable / change / delete; writes and plaintext secrets go through it.
128
128
  - **Scope**: all global / per workspace / per conversation.
129
129
  - **Injection**: switches for seven domains (global and workspace memory share one switch in the UI), minimal-preset fallback, catalog caps for skills / MCP / subagents (overflow folds into a one-line count; per-entry description length is configurable too), the two slash-menu entries, sidebar entry.
130
- - **Model tools**: per-tool visibility for 22 tools, plus `memory_note` following the autonomous-memory master switch; saved per layer.
130
+ - **Model tools**: per-tool visibility for 22 tools, plus `memory_manager_note` following the autonomous-memory master switch; saved per layer.
131
131
  - **Maintenance**: old-backup cleanup, feature overview, recent changes.
132
132
 
133
133
  <details>
@@ -245,7 +245,7 @@ MCP 停用表不可读(<原因>):所有 mcp__* 工具已被拒绝调用;
245
245
  | `mcp-disabled-tools.json` | 所有 `mcp__*` 被拒(见上一节) | MCP 页「重置停用表」 |
246
246
  | `memories-index.json` | 记忆索引不可信 | 见下方「记忆索引隔离」 |
247
247
  | `memories-index.json.quarantine.json` | 这是**隔离标记**,不是坏文件;有它 = 记忆写入被拒 | 场景页「一键修复」会自动清除(见下方「记忆索引隔离」) |
248
- | `tool-table.json` | 模型工具表回落到默认名单,保存被拒 | 兼容页工具表那块出现「修复工具表文件」:确认后把损坏文件改名为 `.corrupt-<时间戳>` 留存,工具表按出厂名单继续;模型也可以调 `tool_manager_tools` 的 `repair`(`target: "tool-table"`) |
248
+ | `tool-table.json` | 模型工具表回落到默认名单,保存被拒 | 兼容页工具表那块出现「修复工具表文件」:确认后把损坏文件改名为 `.corrupt-<时间戳>` 留存,工具表按出厂名单继续;模型也可以调 `tool_manager_switch` 的 `repair`(`target: "tool-table"`) |
249
249
  | `scope-overrides.json` | 会话 / 工作区覆盖写入失败;读侧回落到全局 | 作用域条出现「修复作用域文件」:确认后把损坏文件改名为 `.corrupt-<时间戳>` 留存,覆盖表按空表继续 |
250
250
  | `scope-intent.json` | 全局意图写入失败;读侧等于「还没有意见」 | 同上;修复后下一次对账会从运行态反推意图 |
251
251
  | `inject-settings.json` 等四个界面设置 | 该页设置回默认 | 删掉那一个,重启 |