@daweifu/capability-menu 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/search.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAGxC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGnD,MAAM,CAAC,MAAM,IAAI,GAAG,wBAAwB,CAAA;AAC5C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;AAQvD,mDAAmD;AACnD,MAAM,CAAC,MAAM,MAAM,GAAc,CAAC,CAAC,MAAM,CAAC;IACxC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACnC,CAAC,CAAA;AAmBF;;;;;;;;;GASG;AACH,MAAM,UAAU,KAAK,CAAC,GAAY,EAAE,SAAiB,EAAE;IACrD,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAA;IAC1C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;IAC1D,CAAC;IAED,MAAM,IAAI,GAAG,UAAU,CAAC;QACtB,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,iVAAiV;QAC9V,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gEAAgE,EAAE;YACxG,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6GAA6G,EAAE;YAClJ,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,yFAAy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OAAO,EAAE,OAAiC;gBAC1C,IAAI,EAAE,WAAW,KAAK,SAAS;oBAC7B,CAAC,CAAC,mCAAmC,WAAW,kHAAkH;oBAClK,CAAC,CAAC,mFAAmF;aACxF,CAAA;QACH,CAAC;QACD,WAAW,CAAC,IAAI;YACd,OAAO;gBACL,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,sBAAsB,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,sBAAsB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC5H,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE;aACtC,CAAA;QACH,CAAC;KACF,CAAC,CAAA;IAEF,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AAC1B,CAAC"}
@@ -36,8 +36,11 @@ import { TypertRemoteService, Remote } from '@deepseek-ai/dsh-typert-protocol';
36
36
  import { readFile } from 'node:fs/promises';
37
37
  import yaml from 'js-yaml';
38
38
  import { BUILT_IN_SERVER } from "../registry.js";
39
+ import { describeSkillEntry, isProjectSkillsDir } from "../locations.js";
40
+ import { ADOPTABLE_SKILL_SOURCES, PROJECT_SKILL_SOURCES } from "../constants.js";
41
+ import { basename, dirname, resolve } from 'node:path';
39
42
  /**
40
- * Host-side remote face for the 能力管理 tab. Every method delegates to the
43
+ * Host-side remote face for the 能力菜单 tab. Every method delegates to the
41
44
  * policy service installed by `@daweifu/capability-menu/policy`; the registry
42
45
  * sibling (`capability`) must be mounted for `classifyAll` to return anything.
43
46
  *
@@ -53,27 +56,60 @@ let CapabilityPolicyGateway = (() => {
53
56
  let _getConfig_decorators;
54
57
  let _updateConfig_decorators;
55
58
  let _classifyAll_decorators;
59
+ let _refresh_decorators;
56
60
  let _getDetail_decorators;
57
61
  let _listSkillDir_decorators;
58
62
  let _readSkillFile_decorators;
59
63
  let _getCatalogDocs_decorators;
64
+ let _listLocations_decorators;
65
+ let _addLocation_decorators;
66
+ let _removeLocation_decorators;
67
+ let _updateLocation_decorators;
68
+ let _listSkillLocations_decorators;
69
+ let _addSkillLocation_decorators;
70
+ let _adoptSkillLocation_decorators;
71
+ let _removeSkillLocation_decorators;
72
+ let _updateSkillLocation_decorators;
73
+ let _catalogVersion_decorators;
60
74
  return class CapabilityPolicyGateway extends _classSuper {
61
75
  static {
62
76
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
63
77
  _getConfig_decorators = [Remote('getConfig')];
64
78
  _updateConfig_decorators = [Remote('updateConfig')];
65
79
  _classifyAll_decorators = [Remote('classifyAll')];
80
+ _refresh_decorators = [Remote('refresh')];
66
81
  _getDetail_decorators = [Remote('getDetail')];
67
82
  _listSkillDir_decorators = [Remote('listSkillDir')];
68
83
  _readSkillFile_decorators = [Remote('readSkillFile')];
69
84
  _getCatalogDocs_decorators = [Remote('getCatalogDocs')];
85
+ _listLocations_decorators = [Remote('listLocations')];
86
+ _addLocation_decorators = [Remote('addLocation')];
87
+ _removeLocation_decorators = [Remote('removeLocation')];
88
+ _updateLocation_decorators = [Remote('updateLocation')];
89
+ _listSkillLocations_decorators = [Remote('listSkillLocations')];
90
+ _addSkillLocation_decorators = [Remote('addSkillLocation')];
91
+ _adoptSkillLocation_decorators = [Remote('adoptSkillLocation')];
92
+ _removeSkillLocation_decorators = [Remote('removeSkillLocation')];
93
+ _updateSkillLocation_decorators = [Remote('updateSkillLocation')];
94
+ _catalogVersion_decorators = [Remote('catalogVersion')];
70
95
  __esDecorate(this, null, _getConfig_decorators, { kind: "method", name: "getConfig", static: false, private: false, access: { has: obj => "getConfig" in obj, get: obj => obj.getConfig }, metadata: _metadata }, null, _instanceExtraInitializers);
71
96
  __esDecorate(this, null, _updateConfig_decorators, { kind: "method", name: "updateConfig", static: false, private: false, access: { has: obj => "updateConfig" in obj, get: obj => obj.updateConfig }, metadata: _metadata }, null, _instanceExtraInitializers);
72
97
  __esDecorate(this, null, _classifyAll_decorators, { kind: "method", name: "classifyAll", static: false, private: false, access: { has: obj => "classifyAll" in obj, get: obj => obj.classifyAll }, metadata: _metadata }, null, _instanceExtraInitializers);
98
+ __esDecorate(this, null, _refresh_decorators, { kind: "method", name: "refresh", static: false, private: false, access: { has: obj => "refresh" in obj, get: obj => obj.refresh }, metadata: _metadata }, null, _instanceExtraInitializers);
73
99
  __esDecorate(this, null, _getDetail_decorators, { kind: "method", name: "getDetail", static: false, private: false, access: { has: obj => "getDetail" in obj, get: obj => obj.getDetail }, metadata: _metadata }, null, _instanceExtraInitializers);
74
100
  __esDecorate(this, null, _listSkillDir_decorators, { kind: "method", name: "listSkillDir", static: false, private: false, access: { has: obj => "listSkillDir" in obj, get: obj => obj.listSkillDir }, metadata: _metadata }, null, _instanceExtraInitializers);
75
101
  __esDecorate(this, null, _readSkillFile_decorators, { kind: "method", name: "readSkillFile", static: false, private: false, access: { has: obj => "readSkillFile" in obj, get: obj => obj.readSkillFile }, metadata: _metadata }, null, _instanceExtraInitializers);
76
102
  __esDecorate(this, null, _getCatalogDocs_decorators, { kind: "method", name: "getCatalogDocs", static: false, private: false, access: { has: obj => "getCatalogDocs" in obj, get: obj => obj.getCatalogDocs }, metadata: _metadata }, null, _instanceExtraInitializers);
103
+ __esDecorate(this, null, _listLocations_decorators, { kind: "method", name: "listLocations", static: false, private: false, access: { has: obj => "listLocations" in obj, get: obj => obj.listLocations }, metadata: _metadata }, null, _instanceExtraInitializers);
104
+ __esDecorate(this, null, _addLocation_decorators, { kind: "method", name: "addLocation", static: false, private: false, access: { has: obj => "addLocation" in obj, get: obj => obj.addLocation }, metadata: _metadata }, null, _instanceExtraInitializers);
105
+ __esDecorate(this, null, _removeLocation_decorators, { kind: "method", name: "removeLocation", static: false, private: false, access: { has: obj => "removeLocation" in obj, get: obj => obj.removeLocation }, metadata: _metadata }, null, _instanceExtraInitializers);
106
+ __esDecorate(this, null, _updateLocation_decorators, { kind: "method", name: "updateLocation", static: false, private: false, access: { has: obj => "updateLocation" in obj, get: obj => obj.updateLocation }, metadata: _metadata }, null, _instanceExtraInitializers);
107
+ __esDecorate(this, null, _listSkillLocations_decorators, { kind: "method", name: "listSkillLocations", static: false, private: false, access: { has: obj => "listSkillLocations" in obj, get: obj => obj.listSkillLocations }, metadata: _metadata }, null, _instanceExtraInitializers);
108
+ __esDecorate(this, null, _addSkillLocation_decorators, { kind: "method", name: "addSkillLocation", static: false, private: false, access: { has: obj => "addSkillLocation" in obj, get: obj => obj.addSkillLocation }, metadata: _metadata }, null, _instanceExtraInitializers);
109
+ __esDecorate(this, null, _adoptSkillLocation_decorators, { kind: "method", name: "adoptSkillLocation", static: false, private: false, access: { has: obj => "adoptSkillLocation" in obj, get: obj => obj.adoptSkillLocation }, metadata: _metadata }, null, _instanceExtraInitializers);
110
+ __esDecorate(this, null, _removeSkillLocation_decorators, { kind: "method", name: "removeSkillLocation", static: false, private: false, access: { has: obj => "removeSkillLocation" in obj, get: obj => obj.removeSkillLocation }, metadata: _metadata }, null, _instanceExtraInitializers);
111
+ __esDecorate(this, null, _updateSkillLocation_decorators, { kind: "method", name: "updateSkillLocation", static: false, private: false, access: { has: obj => "updateSkillLocation" in obj, get: obj => obj.updateSkillLocation }, metadata: _metadata }, null, _instanceExtraInitializers);
112
+ __esDecorate(this, null, _catalogVersion_decorators, { kind: "method", name: "catalogVersion", static: false, private: false, access: { has: obj => "catalogVersion" in obj, get: obj => obj.catalogVersion }, metadata: _metadata }, null, _instanceExtraInitializers);
77
113
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
78
114
  }
79
115
  static inject = ['capabilityPolicy', 'capability'];
@@ -93,6 +129,15 @@ let CapabilityPolicyGateway = (() => {
93
129
  classifyAll() {
94
130
  return [...this.ctx.capabilityPolicy.classifyAll()];
95
131
  }
132
+ /**
133
+ * Rebuild the capability catalog now and resolve once it has converged.
134
+ * The UI calls this after registering a new source (an MCP server or a
135
+ * skill directory) so the list reflects it without waiting for the
136
+ * scheduler's debounce window.
137
+ */
138
+ async refresh() {
139
+ await this.ctx.capability.refresh();
140
+ }
96
141
  /** Resolve one capability's full detail (schema, description; skill body optional). */
97
142
  async getDetail(id) {
98
143
  return this.ctx.capability.getDetail(id);
@@ -111,7 +156,7 @@ let CapabilityPolicyGateway = (() => {
111
156
  * server → 工具短名 分级列出;skills 无 server 维度,resident 恒为 '*',
112
157
  * 例外为短名平铺。空例外不渲染 key,避免 []/{} 歧义。
113
158
  * 另返回按需能力目录物化文件(~/.dsh/capability-catalog.yaml)的路径和内容。
114
- * 两者都是只读视图——策略持久化入口仍是 cordis.patch.yml。
159
+ * 两者都是只读视图;改规则的入口是「能力菜单」的点选,改动会自动写回 cordis.patch.yml。
115
160
  */
116
161
  async getCatalogDocs() {
117
162
  const effective = [...this.ctx.capabilityPolicy.classifyAll()];
@@ -159,8 +204,10 @@ let CapabilityPolicyGateway = (() => {
159
204
  if (disabledSkills.length > 0)
160
205
  skills.disabled = disabledSkills;
161
206
  const policyYaml = [
162
- '# 能力管理 · 当前生效策略(只读;持久化入口:cordis.patch.yml)',
163
- '# 语义:默认全部能力常驻;下方 on-demand / disabled 为按 server → 工具名分级的例外。',
207
+ '# 能力菜单 · 当前生效策略(只读视图)',
208
+ '# 实时生成自内存中的规则;「能力菜单」里的点选会在停手后写回 cordis.patch.yml。',
209
+ '# 语义:未命中任何规则的能力默认常驻,下面只列例外——',
210
+ '# tools 按 server → 工具名分级;skills 无 server 维度,直接平铺技能名。',
164
211
  `# 生效:tools 常驻 ${count(toolRows, 'resident')} · 按需 ${count(toolRows, 'on-demand')} · 禁用 ${count(toolRows, 'disabled')};` +
165
212
  `skills 常驻 ${count(skillRows, 'resident')} · 按需 ${count(skillRows, 'on-demand')} · 禁用 ${count(skillRows, 'disabled')}`,
166
213
  yaml.dump({
@@ -182,6 +229,119 @@ let CapabilityPolicyGateway = (() => {
182
229
  return { policyYaml, catalogMissing: 'read-failed' };
183
230
  }
184
231
  }
232
+ // — 注册能力(MCP 服务器 / Skill 目录)—
233
+ //
234
+ // Every mutation edits the patch file and lets dsh hot-reload mount or
235
+ // unmount the source. The gateway never mounts anything itself.
236
+ /** MCP servers declared in the patch file. */
237
+ async listLocations() {
238
+ return this.ctx.capabilityPolicy.listLocations();
239
+ }
240
+ /** Declare a new MCP server. */
241
+ async addLocation(input) {
242
+ return this.ctx.capabilityPolicy.addLocation(input);
243
+ }
244
+ /** Remove a declared MCP server. */
245
+ async removeLocation(id) {
246
+ return this.ctx.capabilityPolicy.removeLocation(id);
247
+ }
248
+ /** Replace a declared MCP server's connection config. */
249
+ async updateLocation(id, input) {
250
+ return this.ctx.capabilityPolicy.updateLocation(id, input);
251
+ }
252
+ /**
253
+ * Skill entries the operator can manage: everything under the user root, plus
254
+ * the project-scoped entries the skill index knows about.
255
+ *
256
+ * dsh discovers a project's skills from `<projectRoot>/.dsh/skills` and
257
+ * `<projectRoot>/.agents/skills` for whichever project the *session* cwd sits
258
+ * in, so reading the user root alone cannot see them. The index records each
259
+ * skill's own directory, which is what lets these rows be edited and removed
260
+ * rather than merely listed.
261
+ */
262
+ async listSkillLocations() {
263
+ const rows = [...await this.ctx.capabilityPolicy.listSkillLocations()];
264
+ const seen = new Set(rows.map(row => `${row.entryDir}\u0000${row.name}`));
265
+ for (const entry of this.ctx.capability.skillDirs()) {
266
+ if (!PROJECT_SKILL_SOURCES.has(entry.source ?? ''))
267
+ continue;
268
+ const entryDir = dirname(entry.skillDir);
269
+ if (!isProjectSkillsDir(entryDir))
270
+ continue;
271
+ // `entry.name` is the skill's *declared* name, which need not match the
272
+ // directory dsh found it in. `describeSkillEntry` addresses the entry
273
+ // itself, so it has to be given the directory's own basename — passing the
274
+ // declared name made it look for a directory that does not exist and
275
+ // silently drop the row, leaving such a skill uneditable.
276
+ const entryName = basename(entry.skillDir);
277
+ const key = `${resolve(entryDir)}\u0000${entryName}`;
278
+ if (seen.has(key))
279
+ continue;
280
+ seen.add(key);
281
+ const row = await describeSkillEntry(entryDir, entryName, 'project');
282
+ if (row !== undefined)
283
+ rows.push(row);
284
+ }
285
+ return rows;
286
+ }
287
+ /**
288
+ * Register a skill directory: into the user root by default, or into a
289
+ * project's `.dsh/skills` when `projectPath` names a path inside that project.
290
+ * Returns the entry path actually written so the UI can report it.
291
+ */
292
+ async addSkillLocation(dir, projectPath) {
293
+ return this.ctx.capabilityPolicy.addSkillLocation(dir, projectPath);
294
+ }
295
+ /**
296
+ * Adopt a skill that already lives in a user-level root this plugin reads but
297
+ * does not manage (`~/.agents/skills`, custom dirs) by linking its own
298
+ * directory into the user root. The content is untouched — this is exactly how
299
+ * the entries already in `~/.dsh/skills` are set up — and the skill becomes
300
+ * editable afterwards. Returns the entry path written.
301
+ *
302
+ * A skill that ships inside an agent preset is refused: linking it into the
303
+ * user root would make it global, which is the opposite of what a preset
304
+ * skill is for. It is also the same check the UI applies (it hides the button),
305
+ * repeated here because the source label alone cannot tell a preset's
306
+ * `customSkillDirs` from a user's.
307
+ */
308
+ async adoptSkillLocation(name) {
309
+ const record = this.ctx.capability.get(name.trim(), 'skill');
310
+ const dir = record?.origin.path;
311
+ const source = record?.origin.source;
312
+ const preset = record?.origin.preset;
313
+ if (preset !== undefined) {
314
+ throw new Error(`该技能随预设 ${preset} 分发,不支持纳入管理(纳入管理会把它变成全局技能)`);
315
+ }
316
+ if (dir === undefined)
317
+ throw new Error(`该技能没有可链接的目录,无法纳入管理:${name}`);
318
+ if (source === undefined || !ADOPTABLE_SKILL_SOURCES.has(source)) {
319
+ throw new Error(`该技能来自 ${source ?? '未知来源'},不支持纳入管理`);
320
+ }
321
+ return this.ctx.capabilityPolicy.addSkillLocation(dir);
322
+ }
323
+ /** Unregister a skill entry; `entryDir` addresses a project entry. */
324
+ async removeSkillLocation(name, entryDir) {
325
+ return this.ctx.capabilityPolicy.removeSkillLocation(name, entryDir);
326
+ }
327
+ /** Repoint a registered skill entry at a different directory. */
328
+ async updateSkillLocation(name, dir, entryDir) {
329
+ return this.ctx.capabilityPolicy.updateSkillLocation(name, dir, entryDir);
330
+ }
331
+ /**
332
+ * The registry's catalog version — one number, cheap enough to poll. The
333
+ * management page uses it to notice changes the wire never announces (a file
334
+ * dropped into an already-registered skill directory reindexes the host via
335
+ * `skills/change`, which is not a forwarded event), and only re-reads
336
+ * `classifyAll` when the number actually moved.
337
+ *
338
+ * Appended at the end of the class on purpose: the client-side descriptors in
339
+ * `src/client/remote.ts` carry each method's `sourceLocation` line, and
340
+ * inserting here would shift every line below it.
341
+ */
342
+ catalogVersion() {
343
+ return this.ctx.capability.version();
344
+ }
185
345
  };
186
346
  })();
187
347
  export { CapabilityPolicyGateway };
@@ -1 +1 @@
1
- {"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/server/remote.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,IAAI,MAAM,SAAS,CAAA;AAO1B,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAsBhD;;;;;;;;;;GAUG;IACU,uBAAuB;sBAAS,mBAAmB;;;;;;;;;iBAAnD,uBAAwB,SAAQ,WAAmB;;;qCAQ7D,MAAM,CAAC,WAAW,CAAC;wCAMnB,MAAM,CAAC,cAAc,CAAC;uCAMtB,MAAM,CAAC,aAAa,CAAC;qCAMrB,MAAM,CAAC,WAAW,CAAC;wCAMnB,MAAM,CAAC,cAAc,CAAC;yCAMtB,MAAM,CAAC,eAAe,CAAC;0CAavB,MAAM,CAAC,gBAAgB,CAAC;YA1CzB,8KAAA,SAAS,6DAER;YAID,uLAAM,YAA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
3
+ *
4
+ * Kept in a dependency-free module so `src/client` can import them without
5
+ * pulling the registry's `node:fs` / `js-yaml` imports into the web bundle.
6
+ */
7
+ /** Prefix of every MCP tool's registered name: `mcp__<server>__<raw>`. */
8
+ export declare const MCP_ID_PREFIX = "mcp__";
9
+ /**
10
+ * Reserved pseudo-server that groups harness-native (non-MCP) tools in the
11
+ * management surface. Native tools (bash/read/write/…) are cataloged like MCP
12
+ * tools — same `server` dimension — so 能力菜单 can group them, classify them
13
+ * Resident/On-demand/Disabled, and `meta_invoke` can dispatch them.
14
+ */
15
+ export declare const BUILT_IN_SERVER = "built-in";
16
+ /**
17
+ * dsh's source labels for a project's own skill roots — the `project`-prefixed
18
+ * providers of `@deepseek-ai/dsh-skill-filesystem`, which scan
19
+ * `<projectRoot>/.dsh/skills` and `<projectRoot>/.agents/skills`. Every other
20
+ * label (`user-dsh`, `user-agents`, `bundled`, `custom`, `runtime`) is a
21
+ * user-level root. Shared so the server's location manager and the browser's
22
+ * 全局 / 项目 grouping agree on what "project scoped" means.
23
+ */
24
+ export declare const PROJECT_SKILL_SOURCES: ReadonlySet<string>;
25
+ /**
26
+ * Source labels for user-level skill roots whose entries this plugin can adopt:
27
+ * linking the skill's own directory into the user root (where the entry becomes
28
+ * editable) without touching its content. `user-dsh` is excluded because that
29
+ * root is already managed, and `bundled` because a packaged skill should not be
30
+ * shadowed by a user copy.
31
+ */
32
+ export declare const ADOPTABLE_SKILL_SOURCES: ReadonlySet<string>;
33
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,aAAa,UAAU,CAAA;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,aAAa,CAAA;AAEzC;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAA8C,CAAA;AAEpG;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAAsC,CAAA"}
@@ -11,7 +11,7 @@
11
11
  * - `policy` (P3): Resident/On-demand/Disabled projection policy + `ctx.capabilityPolicy`.
12
12
  * - the package root entry (`name` + `apply` below): mounts the Typert gateway
13
13
  * that exposes `ctx.capabilityPolicy` to the browser as the `capabilityPolicy`
14
- * remote namespace — the data source of the 能力管理 settings tab.
14
+ * remote namespace — the data source of the 能力菜单 settings tab.
15
15
  * - a browser bundle via the `./client` subpath (`src/client`), discovered by
16
16
  * `@deepseek-ai/dsh-client-modules` from this package's `dsh.client`
17
17
  * declaration and served as `/plugins/<id>/client.js`.
@@ -1 +1 @@
1
- {"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../src/invoke.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAIxD,OAAO,EAAwC,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAGrG,eAAO,MAAM,IAAI,2BAA2B,CAAA;AAC5C,eAAO,MAAM,MAAM,UAAoC,CAAA;AAEvD,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,CAAA;AAElD,gDAAgD;AAChD,MAAM,WAAW,MAAM;IACrB,sIAAsI;IACtI,WAAW,CAAC,EAAE,eAAe,CAAA;CAC9B;AAED,mDAAmD;AACnD,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAE3B,CAAA;AAEF,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,OAAO,EAA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C,IAAI,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,mBAAmB,CAAA;CAAE,GAClE;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,qBAAqB,CAAA;CAAE,GACtE;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAA;CAAE,CAAA;AAE9E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,MAAW,GAAG,IAAI,CA4Q7D"}
@@ -0,0 +1,142 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ /** Plugin name of the MCP bridge, as declared in patch rows. */
3
+ export declare const MCP_CLIENT_PLUGIN = "@deepseek-ai/dsh-mcp-client";
4
+ export interface LocationConfig {
5
+ /** Patch file holding the MCP rows. Defaults to the home-level layer. */
6
+ readonly patchFile: string;
7
+ /** Skill root that `skill-filesystem` discovers by default. */
8
+ readonly skillsDir: string;
9
+ }
10
+ export declare function defaultLocationConfig(): LocationConfig;
11
+ /** Default skill root: the user root `skill-filesystem` scans with no config. */
12
+ export declare function defaultSkillsDir(): string;
13
+ /** One MCP server, as declared in the patch file. */
14
+ export interface McpLocation {
15
+ /** Patch row id (e.g. `mcp-gongfeng`). */
16
+ readonly id: string;
17
+ readonly serverName: string;
18
+ readonly transport: 'stdio' | 'streamable-http';
19
+ readonly disabled: boolean;
20
+ /** stdio: executable, argv, extra environment, working directory. */
21
+ readonly command?: string;
22
+ readonly args?: readonly string[];
23
+ readonly env?: Readonly<Record<string, string>>;
24
+ readonly cwd?: string;
25
+ /** streamable-http: endpoint and extra request headers (auth lives here). */
26
+ readonly url?: string;
27
+ readonly headers?: Readonly<Record<string, string>>;
28
+ /** Per-tool-call timeout in milliseconds (`dsh-mcp-client` default 60000). */
29
+ readonly toolCallTimeoutMs?: number;
30
+ }
31
+ /** Which skill root an entry lives in. */
32
+ export type SkillRootKind = 'user' | 'project';
33
+ /** One skill entry under a managed skill root. */
34
+ export interface SkillLocation {
35
+ /**
36
+ * The entry's own name — the symlink or directory under `entryDir`. This is
37
+ * what remove and update address, and it is *not* necessarily the skill's
38
+ * name: `addSkill` derives the link name from the source directory's basename.
39
+ */
40
+ readonly name: string;
41
+ /**
42
+ * The name the skill declares in its own `SKILL.md` frontmatter. That is the
43
+ * identity dsh keys the skill by, and what the capability panel's rows are
44
+ * named, so it is the field to match a row against. Absent when the manifest
45
+ * cannot be read — there is no declared name to disagree with `name` then.
46
+ */
47
+ readonly skillName?: string;
48
+ /** The entry itself: `<entryDir>/<name>`, a symlink or a real directory. */
49
+ readonly path: string;
50
+ /** True when the entry is a symlink to a directory outside the skill root. */
51
+ readonly linked: boolean;
52
+ /**
53
+ * False when dsh would not load the entry: no `SKILL.md`, or a frontmatter
54
+ * that is not a YAML mapping with a kebab-case `name` and a `description`.
55
+ */
56
+ readonly valid: boolean;
57
+ /** `user` for the default root, `project` for a project's own skill root. */
58
+ readonly root: SkillRootKind;
59
+ /**
60
+ * The skills directory holding the entry (`…/.dsh/skills` or
61
+ * `…/.agents/skills`). Opaque to callers: pass it back to update or remove,
62
+ * rather than rebuilding it from parts.
63
+ */
64
+ readonly entryDir: string;
65
+ /** The directory the entry points at, with symlinks resolved. */
66
+ readonly target?: string;
67
+ }
68
+ /**
69
+ * Input for editing a declared MCP server. `serverName` is deliberately absent:
70
+ * it is the row's identity and is baked into every `mcp__<serverName>__<tool>`
71
+ * name, session history and permission rule, so editing must not change it.
72
+ */
73
+ export type McpUpdateInput = Omit<McpInput, 'serverName'>;
74
+ /** Input for registering a new MCP server. */
75
+ export interface McpInput {
76
+ readonly serverName: string;
77
+ readonly transport: 'stdio' | 'streamable-http';
78
+ readonly command?: string;
79
+ readonly args?: readonly string[];
80
+ readonly env?: Readonly<Record<string, string>>;
81
+ readonly cwd?: string;
82
+ readonly url?: string;
83
+ readonly headers?: Readonly<Record<string, string>>;
84
+ /** Per-tool-call timeout in milliseconds; omit to use the dsh default. */
85
+ readonly toolCallTimeoutMs?: number;
86
+ }
87
+ export declare class LocationRegistry {
88
+ private readonly ctx;
89
+ private readonly config;
90
+ constructor(ctx: Context, config: LocationConfig);
91
+ /** Every MCP server declared in the patch file, in file order. */
92
+ listMcp(): Promise<McpLocation[]>;
93
+ /** Declare a new MCP server row. Throws on invalid or duplicate input. */
94
+ addMcp(input: McpInput): Promise<string>;
95
+ /** Remove a declared MCP server. Returns false when the row is absent. */
96
+ removeMcp(id: string): Promise<boolean>;
97
+ /**
98
+ * Replace a declared server's connection config. The row id (and therefore
99
+ * `serverName`, which is baked into every `mcp__<serverName>__<tool>` tool
100
+ * name, session history and permission rule) is never changed here.
101
+ */
102
+ updateMcp(id: string, input: McpUpdateInput): Promise<boolean>;
103
+ private hasMcp;
104
+ /** Every entry under the default (user) skill root. */
105
+ listSkills(): Promise<SkillLocation[]>;
106
+ /**
107
+ * Which skills directory an operation targets.
108
+ *
109
+ * `entryDir` comes back from a listing and is taken as given, but validated —
110
+ * a caller must not be able to aim `remove` at an arbitrary tree. Otherwise,
111
+ * `projectPath` is a path *inside* a project and the project root is derived
112
+ * from it exactly the way dsh derives it; with neither, the user root.
113
+ */
114
+ private resolveSkillsDir;
115
+ /**
116
+ * Register a skill directory by symlinking it into a managed root — the user
117
+ * root by default, or a project's `.dsh/skills` when `projectPath` is given.
118
+ * Returns the entry path actually written, so the caller can report where the
119
+ * skill landed instead of leaving the operator to guess.
120
+ */
121
+ addSkill(dir: string, projectPath?: string): Promise<string>;
122
+ /**
123
+ * Unregister a skill entry. Only removes a symlink or a directory that
124
+ * actually carries a `SKILL.md` — never an arbitrary file.
125
+ */
126
+ removeSkill(name: string, entryDir?: string): Promise<boolean>;
127
+ /**
128
+ * Repoint a registered skill at a different directory: unlink the old entry
129
+ * and link the new one under the same name. The name is the skill's identity
130
+ * in `ctx.skills`, so a rename is a remove + add, not an update.
131
+ */
132
+ updateSkill(name: string, dir: string, entryDir?: string): Promise<boolean>;
133
+ }
134
+ /**
135
+ * Describe `<entryDir>/<name>` as a skill entry, or `undefined` when nothing
136
+ * there looks like one. Used both for listing the user root and for describing
137
+ * project entries that dsh discovered on its own.
138
+ */
139
+ export declare function describeSkillEntry(entryDir: string, name: string, root: SkillRootKind): Promise<SkillLocation | undefined>;
140
+ /** True when `dir` has the shape of a project skills root. */
141
+ export declare function isProjectSkillsDir(dir: string): boolean;
142
+ //# sourceMappingURL=locations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locations.d.ts","sourceRoot":"","sources":["../../src/locations.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD,gEAAgE;AAChE,eAAO,MAAM,iBAAiB,gCAAgC,CAAA;AAK9D,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED,wBAAgB,qBAAqB,IAAI,cAAc,CAKtD;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,IAAI,MAAM,CAIzC;AAED,qDAAqD;AACrD,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,iBAAiB,CAAA;IAC/C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAA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AE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAsBpE;;;;OAIG;IACG,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAqBlF;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAqBpC;AAED,8DAA8D;AAC9D,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGvD"}
@@ -0,0 +1,46 @@
1
+ import YAML from 'yaml';
2
+ /** One `- id: … / name: … / config: …` row in a patch file. */
3
+ export interface PatchEntry {
4
+ readonly id: string;
5
+ readonly name: string;
6
+ readonly disabled?: boolean;
7
+ readonly config?: Record<string, unknown>;
8
+ }
9
+ /** Default patch file: the home-level layer shared by every profile. */
10
+ export declare function defaultPatchFile(): string;
11
+ /** Find the entry row with `id`, if the file declares one. */
12
+ export declare function findEntry(doc: YAML.Document.Parsed, id: string): YAML.YAMLMap | undefined;
13
+ /** Read every declared entry as plain data (never mutates the file). */
14
+ export declare function readEntries(file: string): Promise<PatchEntry[]>;
15
+ /**
16
+ * Append a row to the document. Reuses the last `- insert:` block so new rows
17
+ * land next to the existing ones; creates one when the file has none.
18
+ */
19
+ export declare function addEntry(doc: YAML.Document.Parsed, entry: PatchEntry): void;
20
+ /**
21
+ * Append a bare, id-targeted override row (`- id: … / name: … / config: …`) at
22
+ * the top level — a patch that *finds* a row instead of adding one.
23
+ *
24
+ * Deliberately not {@link addEntry}: the row being configured is usually
25
+ * contributed by another layer. This plugin's own bundle patch inserts
26
+ * `capability-menu-policy`, and a profile's home layer is applied *after* that
27
+ * layer, so inserting a second row with the same id here leaves the composed
28
+ * tree with two rows sharing an id — which dsh refuses outright with
29
+ * `duplicate loader entry id`, taking the whole profile down.
30
+ */
31
+ export declare function addEntryOverride(doc: YAML.Document.Parsed, entry: PatchEntry): void;
32
+ /** Remove the row with `id`. Returns false when the file has no such row. */
33
+ export declare function removeEntry(doc: YAML.Document.Parsed, id: string): boolean;
34
+ /** Set or clear `disabled:` on the row with `id`. */
35
+ export declare function setEntryDisabled(doc: YAML.Document.Parsed, id: string, disabled: boolean): boolean;
36
+ /** Replace the row's `config:` (patch semantics replace the whole value). */
37
+ export declare function setEntryConfig(doc: YAML.Document.Parsed, id: string, config: Record<string, unknown>): boolean;
38
+ /**
39
+ * Load the patch file, apply `mutate`, and persist only when it reports a
40
+ * change. Returns whether a write happened (i.e. whether dsh will hot-reload).
41
+ *
42
+ * `mutate` must be pure apart from its edits to `doc`: it may be the only
43
+ * chance to change the file, and a thrown error leaves the file untouched.
44
+ */
45
+ export declare function mutatePatch(file: string, mutate: (doc: YAML.Document.Parsed) => boolean): Promise<boolean>;
46
+ //# sourceMappingURL=patch-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch-file.d.ts","sourceRoot":"","sources":["../../src/patch-file.ts"],"names":[],"mappings":"AAwBA,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,+DAA+D;AAC/D,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC1C;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,IAAI,MAAM,CAIzC;AAuBD,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,GAAG,SAAS,CAKzF;AAED,wEAAwE;AACxE,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAUrE;AAeD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAW3E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAMnF;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAO1E;AAED,qDAAqD;AACrD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAMlG;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAK9G;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,OAAO,GAC7C,OAAO,CAAC,OAAO,CAAC,CAwBlB"}
@@ -8,6 +8,7 @@ import type { Context } from '@deepseek-ai/cordis';
8
8
  import z from '@deepseek-ai/schemastery';
9
9
  import type { PromptAssembly } from '@deepseek-ai/dsh-system-prompt';
10
10
  import { type CapabilityKind } from './registry.ts';
11
+ import { type McpInput, type McpLocation, type McpUpdateInput, type SkillLocation } from './locations.ts';
11
12
  /**
12
13
  * Canonical policy classes, mirroring the registry's `CapabilityKind`.
13
14
  *
@@ -75,6 +76,17 @@ export interface Config {
75
76
  * On-demand or Disabled. Default `[meta_search, meta_invoke]`.
76
77
  */
77
78
  metaTools?: string[];
79
+ /**
80
+ * Patch file holding the MCP server rows the 能力菜单 UI manages. Defaults
81
+ * to the home-level layer (`~/.dsh/cordis.patch.yml`) — the same file as any
82
+ * hand-written `@deepseek-ai/dsh-mcp-client` rows, so both are managed in one
83
+ * place. dsh owns the mounting; this plugin only edits the file.
84
+ */
85
+ patchFile?: string;
86
+ /** Skill root that UI skill registration links into. Defaults to `~/.dsh/skills`. */
87
+ skillsDir?: string;
88
+ /** Milliseconds to coalesce tier changes before persisting them. */
89
+ persistDebounceMs?: number;
78
90
  }
79
91
  /** Validate and default the policy configuration. */
80
92
  export declare const Config: z<Config>;
@@ -143,6 +155,18 @@ export interface CapabilityClassification {
143
155
  readonly server?: string;
144
156
  /** Skill source root label, present only for skills. */
145
157
  readonly source?: string;
158
+ /**
159
+ * Agent preset this skill belongs to, present only for skills collected from
160
+ * a preset's standing scope. The management surface uses it to group preset
161
+ * skills and to keep "纳入管理" (which would globalise the skill) off them.
162
+ */
163
+ readonly preset?: string;
164
+ /**
165
+ * The skill's own directory on disk, present only for skills whose provider
166
+ * has one. The 纳入管理 confirmation shows it so the operator sees which
167
+ * directory is about to be linked, not just the root it came from.
168
+ */
169
+ readonly path?: string;
146
170
  readonly class: CapabilityClass;
147
171
  /** Human-friendly display label for the classification. */
148
172
  readonly classLabel: string;
@@ -186,6 +210,27 @@ export interface CapabilityPolicyService {
186
210
  * registry sibling). Returns an empty array when the registry is not mounted.
187
211
  */
188
212
  classifyAll(): readonly CapabilityClassification[];
213
+ /** MCP servers declared in the patch file, in file order. */
214
+ listLocations(): Promise<McpLocation[]>;
215
+ /** Declare a new MCP server. Rejects a duplicate `serverName`. */
216
+ addLocation(input: McpInput): Promise<string>;
217
+ /** Remove a declared MCP server. */
218
+ removeLocation(id: string): Promise<boolean>;
219
+ /** Replace a declared server's connection config (`serverName` is immutable). */
220
+ updateLocation(id: string, input: McpUpdateInput): Promise<boolean>;
221
+ /** Skill entries under the user root, plus project entries the skill index knows about. */
222
+ listSkillLocations(): Promise<SkillLocation[]>;
223
+ /**
224
+ * Register a skill directory by linking it into the user root, or into
225
+ * `<projectRoot>/.dsh/skills` when `projectPath` names a path inside a project
226
+ * (the project root is derived from it the way dsh derives it). Returns the
227
+ * entry path actually written.
228
+ */
229
+ addSkillLocation(dir: string, projectPath?: string): Promise<string>;
230
+ /** Unregister a skill entry; `entryDir` addresses a project entry, omit it for the user root. */
231
+ removeSkillLocation(name: string, entryDir?: string): Promise<boolean>;
232
+ /** Repoint a registered skill entry at a different directory. */
233
+ updateSkillLocation(name: string, dir: string, entryDir?: string): Promise<boolean>;
189
234
  }
190
235
  declare module '@deepseek-ai/cordis' {
191
236
  interface Context {