dsh-plugin-tool-management 0.21.0 → 0.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/README.md +47 -10
  3. package/README_EN.md +45 -10
  4. package/docs/images/1-EN.png +0 -0
  5. package/docs/images/1.png +0 -0
  6. package/docs/images/2-EN.png +0 -0
  7. package/docs/images/2.png +0 -0
  8. package/docs/images/3-EN.png +0 -0
  9. package/docs/images/3.png +0 -0
  10. package/docs/images/4-EN.png +0 -0
  11. package/docs/images/4.png +0 -0
  12. package/docs/images/5-EN.png +0 -0
  13. package/docs/images/5.png +0 -0
  14. package/docs/images/6-EN.png +0 -0
  15. package/docs/images/6.png +0 -0
  16. package/docs/images/7-EN.png +0 -0
  17. package/docs/images/7.png +0 -0
  18. package/docs/images/8-EN.png +0 -0
  19. package/docs/images/8.png +0 -0
  20. package/docs/images/icon.png +0 -0
  21. package/docs/images/icon.svg +1 -0
  22. package/docs/update.md +37 -35
  23. package/lib/boot/reconcile.js +157 -0
  24. package/lib/client.js +7166 -3084
  25. package/lib/compat/patch-dialect.js +14 -1
  26. package/lib/compat/probe.js +25 -21
  27. package/lib/context-inject-frame.js +62 -40
  28. package/lib/context-inject-select.js +59 -4
  29. package/lib/context-inject-surface.js +49 -3
  30. package/lib/context-inject.js +145 -22
  31. package/lib/diagnostics.js +77 -0
  32. package/lib/http-api.js +39 -23
  33. package/lib/http-fence.js +40 -5
  34. package/lib/imports/unzip.js +48 -0
  35. package/lib/imports/upload.js +8 -36
  36. package/lib/index.js +2933 -169
  37. package/lib/mcp/disabled-tools.js +96 -0
  38. package/lib/mcp/manager.js +559 -128
  39. package/lib/mcp/restart-marker.js +110 -0
  40. package/lib/mcp/state-section.js +132 -43
  41. package/lib/mcp/tool-visibility.js +348 -56
  42. package/lib/memories/archive-engine.js +39 -14
  43. package/lib/memories/discovery.js +30 -10
  44. package/lib/memories/index-io.js +217 -18
  45. package/lib/memories/projection.js +20 -3
  46. package/lib/memories/prompt-layer.js +37 -0
  47. package/lib/memories/search.js +86 -0
  48. package/lib/memories/service.js +327 -91
  49. package/lib/memories/snapshot.js +66 -19
  50. package/lib/op-registry.js +49 -4
  51. package/lib/ops/candidates.js +11 -3
  52. package/lib/ops/compat.js +46 -4
  53. package/lib/ops/memory.js +78 -9
  54. package/lib/ops/prompts.js +49 -5
  55. package/lib/ops/quick-prompts.js +24 -2
  56. package/lib/ops/scene-records.js +7 -0
  57. package/lib/ops/scene-sync.js +23 -4
  58. package/lib/ops/scope.js +1093 -0
  59. package/lib/ops/sessions.js +5 -2
  60. package/lib/ops/snapshot.js +55 -20
  61. package/lib/ops/state-doctor.js +39 -4
  62. package/lib/ops/trash.js +12 -1
  63. package/lib/paths.js +50 -3
  64. package/lib/prompts/preset-id.js +4 -0
  65. package/lib/prompts/project-instructions.js +162 -0
  66. package/lib/prompts/quick-service.js +5 -4
  67. package/lib/prompts/service.js +20 -9
  68. package/lib/request-gate.js +6 -4
  69. package/lib/scene-linkage.js +12 -0
  70. package/lib/scene-prompt-sync.js +1 -1
  71. package/lib/scenes/candidates.js +8 -1
  72. package/lib/scope/intent-store.js +105 -0
  73. package/lib/scope/intent.js +376 -0
  74. package/lib/scope/resolve.js +190 -0
  75. package/lib/scope/scope-overrides.js +894 -0
  76. package/lib/scope/store.js +262 -0
  77. package/lib/scope/workspace-key.js +64 -0
  78. package/lib/sessions/history.js +3 -2
  79. package/lib/settings-sidecars.js +82 -19
  80. package/lib/sidebar-settings.js +13 -0
  81. package/lib/skills/catalog.js +206 -33
  82. package/lib/skills/core.js +1 -1
  83. package/lib/skills/frontmatter.js +121 -0
  84. package/lib/skills/service.js +145 -20
  85. package/lib/stale-write.js +74 -0
  86. package/lib/subagents/catalog.js +47 -13
  87. package/lib/subagents/persona-parse.js +26 -5
  88. package/lib/subagents/persona-write.js +11 -7
  89. package/lib/subagents/service.js +3 -2
  90. package/lib/subagents/tools.js +78 -8
  91. package/lib/token-config.js +25 -5
  92. package/lib/tool-table-switch.js +141 -49
  93. package/lib/tools/deps.js +151 -5
  94. package/lib/tools/mcp.js +189 -39
  95. package/lib/tools/memory.js +103 -18
  96. package/lib/tools/prompt.js +61 -9
  97. package/lib/tools/remove.js +46 -21
  98. package/lib/tools/scene.js +120 -26
  99. package/lib/tools/skills.js +191 -30
  100. package/lib/tools/subagent.js +52 -20
  101. package/lib/tools/table.js +48 -11
  102. package/lib/trash-retention.js +3 -2
  103. package/lib/update-check.js +218 -0
  104. package/locale/en.json +6 -0
  105. package/locale/zh.json +6 -0
  106. package/package.json +19 -14
@@ -1,28 +1,40 @@
1
1
  // 「模型工具表」开关(2026-09-23)。
2
2
  //
3
- // 为什么要有它:工具表是按**每个请求**付钱的 —— 本插件 20 个工具的 schema 合计 ≈3,769 tok
4
- // (口径:整份 `JSON.stringify(definition).length / 4`,与宿主记录的一致),每一轮都随请求
5
- // 发出,哪怕这一轮根本用不上。关掉某几个工具,它们整份不进请求(不是"把描述写短点"那种省);
6
- // 面板(118 个 op)与注入通道完全不受影响。
3
+ // 为什么要有它:工具表是按**每个请求**付钱的 —— 每一轮都随请求发出工具 schema,哪怕这一轮
4
+ // 根本用不上。关掉某几个工具,它们整份不进请求(不是"把描述写短点"那种省);面板
5
+ // (118 个 op)与注入通道完全不受影响。
7
6
  //
8
- // 出厂**默认就关着十四条**(20 条里实发 6 条)—— 名单、判据与代价见下面
7
+ // 出厂**默认就关着十九条**(57 条里实发 38 条)—— 名单、判据与代价见下面
9
8
  // `DEFAULT_HIDDEN_TOOLS`;用户自己额外关的与出厂关的在合计那句里分开报。
10
9
  //
10
+ // 实测数字(口径:宿主 `recordToolSize` 的 `ceil(JSON.stringify(header.tools).length / 4) + 4`,
11
+ // 即**字符数 / 4**;界面「模型工具表」那行合计与逐条 ≈tok 就是这份,逐条相加与整份数组
12
+ // 的算法差不到 1%):
13
+ // · 2026-10-20 重测:十九条隐藏 ≈**5,213 tok**(≈20,852 字符),默认可见那六条 ≈**1,547 tok**。
14
+ // 比 10-18 那份(16,743 字符 ≈4,186)涨了两成 —— 会话作用域这轮给工具描述加了"写本对话
15
+ // 还是全局""`scope` 参数""租约"这些句子,名单一个字没变。
16
+ // · 10-18 那轮 A/B(同一次请求里把十九条逐个打开,前后各跑两轮)净少 **4,119 / 4,197 tok**,
17
+ // 对照当天那份合计 4,186 略低是正常的(边界按 ceil 逐个算、四条一合并就省下那几个 +4),
18
+ // 所以它们是**净节省的下界**,不是"省了多少"的上界。**那对数量的是当天那份描述** ——
19
+ // 描述一改就得重测,新的净省要在真实环境跑 A/B,这里不拿估算冒充实测。
20
+ //
11
21
  // ⚠️ **那个口径不是 token 数,别拿它跟别的数直接比**(2026-09-23 用真 BPE 词表实测):
12
22
  // 工具描述是英文,`字符数 / 4` 对英文**高估约 10%** —— 18 个工具那一版真实是 ≈3,137 tok(o200k)。
13
23
  // 反方向也一样:注入段是中文,同一个口径对它**低估约 13%**(四段 716 → 真 823)。
14
- // 所以"工具表 3,769 / 注入 716"这两个数不是同一把尺子,跨语言比大小会得出错的结论。
24
+ // 所以"工具表 / 注入"这两个数不是同一把尺子,跨语言比大小会得出错的结论。
15
25
  // 口径本身是**宿主的**(`recordToolSize`),我们改不了;能做的只是知道它偏在哪。
16
26
  //
17
- // 20 条这一版**没有重测 BPE**:开发环境里没有分词器(`node_modules` 里只有 `js-tokens`,
18
- // 那是词法分析器、不是 BPE)。按 18 条时 `3,137 / 3,432 ≈ 0.914` 的比例外推约 3,457 ——
19
- // 那是**推算不是实测**,别把它当数字用;要真值得在有分词器的环境里重跑一遍。
27
+ // 当前环境(2026-10-18 查过,2026-10-20 复述)**没有 BPE 分词器可实测**:306 个官方包里零个
28
+ // 词表文件,本机 python site-packages 里也没有 tiktoken / transformers。所以 5,213 只是
29
+ // **按宿主的尺子**量出来的数,真 BPE 值按上面那条经验约低一成(≈4,7xx)—— 没有实测,别当实测引用。
20
30
  //
21
31
  // 本文件只放纯逻辑(normalize / 分域分组 / 体积汇总)。落盘与 TTL 缓存在 index.ts,与
22
32
  // 注入设置(`inject-settings.json`)走同一套写法。
23
33
  //
24
34
  // 谁读这份设置:
25
- // · index.ts 的 op `tool-table`(读写侧车 + 写后刷新可见性与两个目录);
35
+ // · index.ts 的 op `tool-table`(读写侧车 + 写后刷新可见性与两个目录)—— 0.21.2 起
36
+ // 带 `sessionId` 的那一支改的是**本对话**的整份名单(存 `scope-overrides.json`),
37
+ // 这份侧车只剩"新对话的默认模板"与方案库;
26
38
  // · mcp/manager.ts 的 `pluginHiddenTools` —— 官方 `tools.restrict()` 只允许**每个 agent
27
39
  // scope 一层**限制(两处各调一次会互相覆盖),所以 MCP 停用名单与我们的名单必须在那边
28
40
  // 并成一次 restrict;
@@ -71,6 +83,7 @@ export const DEFAULT_HIDDEN_TOOLS = Object.freeze([
71
83
  'scene_manager_save',
72
84
  'scene_manager_remove',
73
85
  'memory_manager_read',
86
+ 'memory_manager_search',
74
87
  'memory_manager_switch',
75
88
  'memory_manager_remove',
76
89
  'mcp_manager_list',
@@ -86,7 +99,7 @@ export const DEFAULT_HIDDEN_TOOLS = Object.freeze([
86
99
  'prompt_manager_apply',
87
100
  'prompt_manager_remove',
88
101
  ]);
89
- /** 出厂默认那份设置:十四条不发(名单与理由见上面),方案清单是空的。 */
102
+ /** 出厂默认那份设置:十九条不发(名单与理由见上面),方案清单是空的。 */
90
103
  export const DEFAULT_TOOL_TABLE_SETTINGS = { hidden: [...DEFAULT_HIDDEN_TOOLS], presets: [] };
91
104
  /** 方案名上限(与 MCP 备注那类输入同风格:短到能在一行里读,长了也没人看)。 */
92
105
  export const PRESET_NAME_MAX_LENGTH = 40;
@@ -149,6 +162,30 @@ export function normalizeToolTableSettings(raw) {
149
162
  export function toolTableSettingsFrom(raw) {
150
163
  return raw === null || raw === undefined ? DEFAULT_TOOL_TABLE_SETTINGS : normalizeToolTableSettings(raw);
151
164
  }
165
+ /**
166
+ * 严格结构检查(0.21.2):宽松归一化会把「合法 JSON 但形状错了」读成 `hidden: []`
167
+ * ——也就是**全部打开**,用户关掉的工具会在执行守卫眼皮底下复活。
168
+ *
169
+ * 只把真正影响可见性的字段判为损坏:顶层必须是对象、`hidden` 必须是字符串数组、
170
+ * `presets` 必须是数组。方案条目的残缺仍按原口径跳过 —— 它不改变当前 hidden,
171
+ * 不该因为一条手工改坏的方案把整份设置锁死。
172
+ */
173
+ export function classifyToolTableSettings(raw) {
174
+ if (raw === null || typeof raw !== 'object' || Array.isArray(raw))
175
+ return { ok: false, error: '顶层必须是对象' };
176
+ const obj = raw;
177
+ if (obj.hidden !== undefined) {
178
+ if (!Array.isArray(obj.hidden))
179
+ return { ok: false, error: 'hidden 必须是字符串数组' };
180
+ for (const item of obj.hidden) {
181
+ if (typeof item !== 'string')
182
+ return { ok: false, error: 'hidden 里出现了非字符串条目' };
183
+ }
184
+ }
185
+ if (obj.presets !== undefined && !Array.isArray(obj.presets))
186
+ return { ok: false, error: 'presets 必须是数组' };
187
+ return { ok: true, value: normalizeToolTableSettings(raw) };
188
+ }
152
189
  /**
153
190
  * 旧工具名 → 新工具名迁移表(0.14.0 与 0.14.x 两轮改名累积)。
154
191
  *
@@ -21,8 +21,9 @@
21
21
  // 那一刻按新天数重算。与 History 页同一条(那边原话:「改保留期即重置倒计时」)。
22
22
  // ③ `deletedAt` 缺失 / 解析失败**不清扫**。判据宁可漏删也不能误删:条目元数据被手改过、
23
23
  // 或来自更早的版本时,我们并不知道它躺了多久 —— 按「刚删的」处理,让它等下一轮。
24
- import { mkdir, readFile, writeFile } from 'node:fs/promises';
24
+ import { mkdir, readFile } from 'node:fs/promises';
25
25
  import { dirname } from 'node:path';
26
+ import { writeFileAtomically } from './memories/index-io.js';
26
27
  import { recordAudit } from './audit-log.js';
27
28
  import { hubPath, listTrashEntries, purgeTrashEntry, } from './hub.js';
28
29
  import { listTrash as listSkillTrash, permanentlyDeleteTrash } from './skills/skill-trash.js';
@@ -76,7 +77,7 @@ export async function readTrashRetention() {
76
77
  export async function writeTrashRetention(retentionDays) {
77
78
  const abs = trashRetentionPath();
78
79
  await mkdir(dirname(abs), { recursive: true });
79
- await writeFile(abs, JSON.stringify({ retentionDays, updatedAt: Date.now() }), 'utf8');
80
+ await writeFileAtomically(abs, JSON.stringify({ retentionDays, updatedAt: Date.now() }));
80
81
  }
81
82
  /**
82
83
  * 算出到期应永久删除的条目 id(纯函数,便于测试)。
@@ -0,0 +1,218 @@
1
+ // 更新检查(0.21.2 Phase 5.1)—— 只读、可缓存、绝不自动更新。
2
+ //
3
+ // 判据只有一条:**每个候选版本自己的 `engines.dsh`**。插件版本号与宿主版本号之间没有可推导的
4
+ // 对应关系(本仓库的版本约定是人工映射),拿 `latest` 或"版本号更大"当兼容结论都会把人带到
5
+ // 一个装不上的版本上。所以:
6
+ // · 只从 registry 的 `versions` 里挑 `engines.dsh` 满足当前宿主的;
7
+ // · 挑不出来就说 `no-compatible-version`,不给"最新版"这种没有意义的答案;
8
+ // · 命令固定 `dsh plugin --profile <p> add <pkg>@<version>`,**绝不出现 `@latest`**。
9
+ //
10
+ // 网络策略:只请求 npm registry;3 秒硬超时;检测到代理环境变量直接返回 `proxy-unsupported`,
11
+ // 不尝试穿透(穿透失败会挂住启动流程,而这件事本来就不该阻塞任何东西)。
12
+ import { mkdir, readFile } from 'node:fs/promises';
13
+ import { join } from 'node:path';
14
+ import * as semver from 'semver';
15
+ import { writeFileAtomically } from './memories/index-io.js';
16
+ export const UPDATE_CHECK_FILE = 'update-check.json';
17
+ export const PACKAGE_NAME = 'dsh-plugin-tool-management';
18
+ export const REGISTRY_URL = 'https://registry.npmjs.org/' + PACKAGE_NAME;
19
+ /** 代理环境变量:命中任意一个就当作"网络路径不确定",不尝试请求。 */
20
+ export function proxyDetected(env) {
21
+ return ['HTTP_PROXY', 'HTTPS_PROXY', 'ALL_PROXY', 'http_proxy', 'https_proxy', 'all_proxy']
22
+ .some((key) => String(env[key] || '').trim() !== '');
23
+ }
24
+ /**
25
+ * 从 registry 的 `versions` 里挑与 `host` 兼容的最高版本。
26
+ *
27
+ * 兼容判据是**每个版本自己的** `engines.dsh`:没有该字段、不是合法 range、或不满足 → 跳过。
28
+ * `host` 为空 / 非法 → `null`(调用方报 `host-unknown`)。
29
+ */
30
+ export function pickBestCompatible(versions, host) {
31
+ if (!host || !semver.valid(host))
32
+ return null;
33
+ const list = Array.isArray(versions)
34
+ ? versions.map((v, i) => ({ version: v?.version || String(i), meta: v }))
35
+ : Object.entries(versions).map(([version, meta]) => ({ version, meta }));
36
+ const compatible = [];
37
+ for (const { version, meta } of list) {
38
+ if (!semver.valid(version))
39
+ continue;
40
+ const range = meta && meta.engines && typeof meta.engines.dsh === 'string' ? meta.engines.dsh.trim() : '';
41
+ if (range === '')
42
+ continue;
43
+ let ok = false;
44
+ try {
45
+ ok = semver.satisfies(host, range, { includePrerelease: true });
46
+ }
47
+ catch {
48
+ ok = false;
49
+ }
50
+ if (ok)
51
+ compatible.push(version);
52
+ }
53
+ if (!compatible.length)
54
+ return null;
55
+ return semver.rsort(compatible)[0];
56
+ }
57
+ /** 由"当前 / 宿主 / 最高兼容版本"三个事实得出状态(纯函数,便于测试)。 */
58
+ export function updateStatusOf(input) {
59
+ const { current, host, bestCompatible } = input;
60
+ if (!host || !semver.valid(host))
61
+ return 'host-unknown';
62
+ if (!bestCompatible) {
63
+ const own = String(input.currentEngines || '').trim();
64
+ if (own !== '') {
65
+ try {
66
+ if (!semver.satisfies(host, own, { includePrerelease: true }))
67
+ return 'current-incompatible';
68
+ }
69
+ catch { /* range 写错按未知处理 */ }
70
+ }
71
+ return 'no-compatible-version';
72
+ }
73
+ if (!semver.valid(current))
74
+ return 'unknown';
75
+ if (semver.gt(bestCompatible, current))
76
+ return 'update-available';
77
+ if (semver.gt(current, bestCompatible))
78
+ return 'local-ahead';
79
+ return 'up-to-date';
80
+ }
81
+ /** 安装命令:永远 pin 到具体版本,不出现 `@latest`。 */
82
+ export function installCommand(profile, version) {
83
+ return 'dsh plugin --profile ' + (profile && profile.trim() !== '' ? profile.trim() : '<profile>') +
84
+ ' add ' + PACKAGE_NAME + '@' + version;
85
+ }
86
+ export function createUpdateChecker(options) {
87
+ const ttlMs = options.ttlMs ?? 12 * 60 * 60 * 1000;
88
+ const failureTtlMs = options.failureTtlMs ?? 60 * 60 * 1000;
89
+ const timeoutMs = options.timeoutMs ?? 3000;
90
+ const env = options.env ?? process.env;
91
+ const now = options.now ?? Date.now;
92
+ const cacheFile = join(options.stateDir, UPDATE_CHECK_FILE);
93
+ let last = null;
94
+ let inflight = null;
95
+ const base = () => {
96
+ let host = null;
97
+ try {
98
+ const raw = options.hostVersion();
99
+ host = raw && semver.valid(raw) ? raw : null;
100
+ }
101
+ catch {
102
+ host = null;
103
+ }
104
+ return {
105
+ current: options.current,
106
+ host,
107
+ newest: null,
108
+ bestCompatible: null,
109
+ command: null,
110
+ };
111
+ };
112
+ const finish = (status, extra = {}) => {
113
+ const result = {
114
+ ok: status !== 'unknown',
115
+ ...base(),
116
+ status,
117
+ checkedAt: new Date(now()).toISOString(),
118
+ fromCache: false,
119
+ ...extra,
120
+ };
121
+ // `command` 只跟 `bestCompatible` 走,避免两处各拼一次。
122
+ if (result.bestCompatible) {
123
+ const profile = typeof options.profile === 'function' ? options.profile() : options.profile;
124
+ result.command = installCommand(profile, result.bestCompatible);
125
+ }
126
+ last = result;
127
+ return result;
128
+ };
129
+ const readCache = async () => {
130
+ try {
131
+ const raw = JSON.parse(await readFile(cacheFile, 'utf8'));
132
+ if (!raw || typeof raw !== 'object')
133
+ return null;
134
+ if (raw.current !== options.current)
135
+ return null;
136
+ if ((raw.host || null) !== base().host)
137
+ return null;
138
+ const age = now() - Date.parse(String(raw.checkedAt || ''));
139
+ if (!Number.isFinite(age) || age < 0)
140
+ return null;
141
+ const ttl = raw.ok === false ? failureTtlMs : ttlMs;
142
+ if (age > ttl)
143
+ return null;
144
+ const result = { ...raw, fromCache: true };
145
+ last = result;
146
+ return result;
147
+ }
148
+ catch {
149
+ return null;
150
+ }
151
+ };
152
+ const writeCache = async (result) => {
153
+ try {
154
+ await mkdir(options.stateDir, { recursive: true });
155
+ await writeFileAtomically(cacheFile, JSON.stringify({ ...result, fromCache: false }, null, 2) + '\n', { mode: 0o600 });
156
+ }
157
+ catch {
158
+ // 缓存写不进去不影响结论:下一次重新请求即可。
159
+ }
160
+ };
161
+ const run = async () => {
162
+ const b = base();
163
+ if (proxyDetected(env))
164
+ return finish('proxy-unsupported');
165
+ if (!b.host)
166
+ return finish('host-unknown');
167
+ const fetchImpl = options.fetchImpl ?? globalThis.fetch;
168
+ if (typeof fetchImpl !== 'function')
169
+ return finish('unknown', { ok: false, error: 'fetch unavailable' });
170
+ let meta;
171
+ try {
172
+ const res = await fetchImpl(REGISTRY_URL, {
173
+ headers: { accept: 'application/vnd.npm.install-v1+json' },
174
+ signal: AbortSignal.timeout(timeoutMs),
175
+ });
176
+ if (!res.ok)
177
+ return finish('unknown', { ok: false, error: 'registry HTTP ' + res.status });
178
+ meta = await res.json();
179
+ }
180
+ catch (e) {
181
+ const message = e instanceof Error ? e.message : String(e);
182
+ return finish('unknown', { ok: false, error: message });
183
+ }
184
+ const versions = meta && meta.versions && typeof meta.versions === 'object' ? meta.versions : {};
185
+ const all = Object.keys(versions).filter((v) => semver.valid(v));
186
+ const newest = all.length ? semver.rsort(all)[0] : (meta && meta['dist-tags'] && meta['dist-tags'].latest) || null;
187
+ const bestCompatible = pickBestCompatible(versions, b.host);
188
+ const status = updateStatusOf({
189
+ current: options.current,
190
+ host: b.host,
191
+ bestCompatible,
192
+ currentEngines: options.currentEngines ?? null,
193
+ });
194
+ return finish(status, { newest, bestCompatible });
195
+ };
196
+ const check = async (force) => {
197
+ if (!force) {
198
+ const cached = await readCache();
199
+ if (cached)
200
+ return cached;
201
+ }
202
+ if (inflight)
203
+ return inflight;
204
+ inflight = run()
205
+ .then(async (result) => { await writeCache(result); return result; })
206
+ .finally(() => { inflight = null; });
207
+ return inflight;
208
+ };
209
+ return {
210
+ check,
211
+ start() {
212
+ void check(false).catch(() => { });
213
+ },
214
+ peek() {
215
+ return last;
216
+ },
217
+ };
218
+ }
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Tools Management",
4
+ "description": "One settings panel for MCP, skills, memories, subagents, prompts and archived sessions; compose scenes to switch the whole environment in one move, and the agent can drive this plugin for you."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "工具管理",
4
+ "description": "一个设置面板,统一管理 MCP、技能、记忆、子智能体、提示词和归档会话;可自定义搭配场景,一个场景即可切换整个环境;Agent也能帮你操作这个插件。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-tool-management",
3
- "version": "0.21.0",
3
+ "version": "0.21.2",
4
4
  "description": "一个设置面板,统一管理 MCP、技能、记忆、子智能体、提示词和归档会话;可自定义搭配场景,一个场景即可切换整个环境;Agent也能帮你操作这个插件。",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,10 +12,12 @@
12
12
  ".": "./lib/index.js",
13
13
  "./client": "./lib/client.js",
14
14
  "./workspace": "./lib/sessions/workspace.js",
15
+ "./locale/*.json": "./locale/*.json",
15
16
  "./package.json": "./package.json"
16
17
  },
17
18
  "files": [
18
19
  "lib",
20
+ "locale",
19
21
  "cordis.patch.yml",
20
22
  "README.md",
21
23
  "README_EN.md",
@@ -26,7 +28,7 @@
26
28
  "docs/update.md"
27
29
  ],
28
30
  "engines": {
29
- "dsh": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
31
+ "dsh": ">=0.2.1-rc.2 <0.2.2",
30
32
  "node": ">=18"
31
33
  },
32
34
  "publishConfig": {
@@ -67,19 +69,20 @@
67
69
  ]
68
70
  }
69
71
  },
72
+ "icon": "./docs/images/icon.png",
70
73
  "peerDependencies": {
71
74
  "@deepseek-ai/cordis": "^4.0.2",
72
- "@deepseek-ai/dsh-agent-preset-registry": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
73
- "@deepseek-ai/dsh-llm": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
74
- "@deepseek-ai/dsh-session": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
75
- "@deepseek-ai/dsh-session-projection-cache": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
76
- "@deepseek-ai/dsh-settings": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
77
- "@deepseek-ai/dsh-spill-local": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
78
- "@deepseek-ai/dsh-storage-domain": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
79
- "@deepseek-ai/dsh-subagent-fork-in-process": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
80
- "@deepseek-ai/dsh-subagent-spawn-in-process": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
81
- "@deepseek-ai/dsh-tools": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
82
- "@deepseek-ai/dsh-workspace": ">=0.1.7-rc.2 <0.2.0-rc.1 || >=0.2.0-rc.1 <0.2.1-rc.2 || >=0.2.1-rc.2 <0.2.2",
75
+ "@deepseek-ai/dsh-agent-preset-registry": ">=0.2.1-rc.2 <0.2.2",
76
+ "@deepseek-ai/dsh-llm": ">=0.2.1-rc.2 <0.2.2",
77
+ "@deepseek-ai/dsh-session": ">=0.2.1-rc.2 <0.2.2",
78
+ "@deepseek-ai/dsh-session-projection-cache": ">=0.2.1-rc.2 <0.2.2",
79
+ "@deepseek-ai/dsh-settings": ">=0.2.1-rc.2 <0.2.2",
80
+ "@deepseek-ai/dsh-spill-local": ">=0.2.1-rc.2 <0.2.2",
81
+ "@deepseek-ai/dsh-storage-domain": ">=0.2.1-rc.2 <0.2.2",
82
+ "@deepseek-ai/dsh-subagent-fork-in-process": ">=0.2.1-rc.2 <0.2.2",
83
+ "@deepseek-ai/dsh-subagent-spawn-in-process": ">=0.2.1-rc.2 <0.2.2",
84
+ "@deepseek-ai/dsh-tools": ">=0.2.1-rc.2 <0.2.2",
85
+ "@deepseek-ai/dsh-workspace": ">=0.2.1-rc.2 <0.2.2",
83
86
  "react": "^18.2.0"
84
87
  },
85
88
  "peerDependenciesMeta": {
@@ -105,12 +108,14 @@
105
108
  "@deepseek-ai/dsh-workspace": "^0.2.1-rc.2",
106
109
  "@types/js-yaml": "^4.0.9",
107
110
  "@types/node": "^24.0.0",
111
+ "@types/semver": "^7.7.0",
108
112
  "react": "^18.2.0",
109
113
  "typescript": "^6.0.0"
110
114
  },
111
115
  "license": "MIT",
112
116
  "dependencies": {
113
117
  "fflate": "^0.8.3",
114
- "js-yaml": "^4.3.2"
118
+ "js-yaml": "^4.3.2",
119
+ "semver": "^7.7.2"
115
120
  }
116
121
  }