@daweifu/capability-menu 0.1.1 → 0.1.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.
Files changed (44) hide show
  1. package/README.en.md +238 -0
  2. package/README.md +127 -63
  3. package/cordis.patch.yml +37 -46
  4. package/lib/client.d.ts +224 -19
  5. package/lib/client.d.ts.map +1 -1
  6. package/lib/client.js +1796 -226
  7. package/lib/constants.js +33 -0
  8. package/lib/constants.js.map +1 -0
  9. package/lib/index.js +1 -1
  10. package/lib/invoke.js +68 -96
  11. package/lib/invoke.js.map +1 -1
  12. package/lib/locations.js +541 -0
  13. package/lib/locations.js.map +1 -0
  14. package/lib/patch-file.js +192 -0
  15. package/lib/patch-file.js.map +1 -0
  16. package/lib/policy.js +422 -94
  17. package/lib/policy.js.map +1 -1
  18. package/lib/registry.js +410 -152
  19. package/lib/registry.js.map +1 -1
  20. package/lib/search.js +26 -9
  21. package/lib/search.js.map +1 -1
  22. package/lib/server/remote.js +219 -3
  23. package/lib/server/remote.js.map +1 -1
  24. package/lib/types/constants.d.ts +33 -0
  25. package/lib/types/constants.d.ts.map +1 -0
  26. package/lib/types/index.d.ts +1 -1
  27. package/lib/types/invoke.d.ts +7 -13
  28. package/lib/types/invoke.d.ts.map +1 -1
  29. package/lib/types/locations.d.ts +142 -0
  30. package/lib/types/locations.d.ts.map +1 -0
  31. package/lib/types/patch-file.d.ts +46 -0
  32. package/lib/types/patch-file.d.ts.map +1 -0
  33. package/lib/types/policy.d.ts +115 -53
  34. package/lib/types/policy.d.ts.map +1 -1
  35. package/lib/types/registry.d.ts +94 -25
  36. package/lib/types/registry.d.ts.map +1 -1
  37. package/lib/types/search.d.ts.map +1 -1
  38. package/lib/types/server/remote.d.ts +68 -2
  39. package/lib/types/server/remote.d.ts.map +1 -1
  40. package/package.json +23 -26
  41. package/lib/invariant.js +0 -22
  42. package/lib/invariant.js.map +0 -1
  43. package/lib/types/invariant.d.ts +0 -16
  44. package/lib/types/invariant.d.ts.map +0 -1
@@ -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":"","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
+ 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"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Exposed / Progressive / Blocked capability projection policy for the DeepSeek
2
+ * Resident / On-demand / Disabled capability projection policy for the DeepSeek
3
3
  * Harness.
4
4
  *
5
5
  * @module @daweifu/capability-menu (policy plugin)
@@ -8,22 +8,23 @@ 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
  *
14
- * - `exposed`: the capability is on the dsh-native exposure surface — tools in
15
+ * - `resident`: the capability is on the dsh-native exposure surface — tools in
15
16
  * `assembly.tools` (the request `tools` payload), skills in the
16
17
  * `<available_skills>` catalog — so the model can call/load it single-hop.
17
- * - `progressive`: absent from the native surface but discoverable in the
18
+ * - `on-demand`: absent from the native surface but discoverable in the
18
19
  * persistent meta registry; the model reaches it via `meta_search` then
19
20
  * `meta_invoke` (catalog-resident, load/execute on demand).
20
- * - `blocked`: neither exposed nor discoverable nor executable.
21
+ * - `disabled`: neither resident nor discoverable nor executable.
21
22
  */
22
- export type CapabilityClass = 'exposed' | 'progressive' | 'blocked';
23
+ export type CapabilityClass = 'resident' | 'on-demand' | 'disabled';
23
24
  /**
24
25
  * A single classify rule: an exact name or a `*`-glob pattern.
25
- * A pattern matches a capability id (`mcp__<server>__<raw>` / `skill:<name>`)
26
- * or a server name (`server:<name>`).
26
+ * A pattern matches a capability id (`mcp__<server>__<raw>`, a native tool
27
+ * name, or a bare skill name) or a server name (`server:<name>`).
27
28
  */
28
29
  export interface PolicyRule {
29
30
  /** Whether the rule is a literal exact name (`*` free) or a glob pattern. */
@@ -36,39 +37,68 @@ export interface PolicyRule {
36
37
  readonly target: 'id' | 'server';
37
38
  }
38
39
  /**
39
- * Per-kind explicit configuration. `exposed`/`progressive`/`blocked` are
40
+ * Per-kind explicit configuration. `resident`/`on-demand`/`disabled` are
40
41
  * ordered lists of exact-name / glob rules. Empty lists mean "nothing
41
- * explicitly classified", so the default (`exposed`) applies.
42
+ * explicitly classified", so the default (`resident`) applies.
42
43
  */
43
44
  export interface CapabilitySetConfig {
44
- /** Explicitly-Exposed rule list (exact name or glob). */
45
+ /** Explicitly-Resident rule list (exact name or glob). */
46
+ resident?: string[];
47
+ /** Explicitly-On-demand rule list (exact name or glob). */
48
+ 'on-demand'?: string[];
49
+ /** Explicitly-Disabled rule list (exact name or glob); wins over everything. */
50
+ disabled?: string[];
51
+ /**
52
+ * @deprecated pre-rename alias of `disabled`; accepted and mapped so legacy
53
+ * profiles written with the `blocked` key keep working without an on-disk
54
+ * rewrite.
55
+ */
56
+ blocked?: string[];
57
+ /**
58
+ * @deprecated pre-rename alias of `resident`; accepted and mapped so legacy
59
+ * profiles keep working without an on-disk rewrite.
60
+ */
45
61
  exposed?: string[];
46
- /** Explicitly-Progressive rule list (exact name or glob). */
62
+ /**
63
+ * @deprecated pre-rename alias of `on-demand`; accepted and mapped so legacy
64
+ * profiles keep working without an on-disk rewrite.
65
+ */
47
66
  progressive?: string[];
48
- /** Explicitly-Blocked rule list (exact name or glob); wins over everything. */
49
- blocked?: string[];
50
67
  }
51
- /** Exposed / Progressive / Blocked projection policy configuration. */
68
+ /** Resident / On-demand / Disabled projection policy configuration. */
52
69
  export interface Config {
53
- /** Tool classification: `tools.exposed` / `tools.progressive` / `tools.blocked`. */
70
+ /** Tool classification: `tools.resident` / `tools.on-demand` / `tools.disabled`. */
54
71
  tools?: CapabilitySetConfig;
55
- /** Skill classification: `skills.exposed` / `skills.progressive` / `skills.blocked`. */
72
+ /** Skill classification: `skills.resident` / `skills.on-demand` / `skills.disabled`. */
56
73
  skills?: CapabilitySetConfig;
57
74
  /**
58
- * Tool names that are ALWAYS kept exposed and can never be classified
59
- * Progressive or Blocked. Default `[meta_search, meta_invoke]`.
75
+ * Tool names that are ALWAYS kept resident and can never be classified
76
+ * On-demand or Disabled. Default `[meta_search, meta_invoke]`.
60
77
  */
61
78
  metaTools?: string[];
62
79
  /**
63
- * Optional path to a Progressive-skill catalog YAML (name + description +
64
- * path). Consumed by the registry as an additional skill index source (see
65
- * `@daweifu/capability-menu-registry` `progressiveSkillCatalog`).
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.
66
84
  */
67
- progressiveSkillCatalog?: string;
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;
68
90
  }
69
91
  /** Validate and default the policy configuration. */
70
92
  export declare const Config: z<Config>;
71
93
  export declare const DEFAULT_META_TOOLS: readonly ["meta_search", "meta_invoke"];
94
+ /**
95
+ * Map a legacy rule set (old keys `exposed`/`progressive`/`blocked`) onto the
96
+ * current key names (`resident`/`on-demand`/`disabled`), so already-deployed
97
+ * `cordis.patch.yml` profiles keep working without an on-disk rewrite. New
98
+ * keys win when they carry rules; a legacy key fills in when the matching new
99
+ * list is empty.
100
+ */
101
+ export declare function normalizeSetConfig(set: CapabilitySetConfig | undefined): CapabilitySetConfig | undefined;
72
102
  /**
73
103
  * Convert a user-facing rule string into a normalized {@link PolicyRule}.
74
104
  * - `server:<name>` → server-targeted rule (`target: 'server'`).
@@ -81,17 +111,17 @@ export declare function parseRule(rule: string): PolicyRule;
81
111
  export declare function compileGlob(pattern: string): RegExp;
82
112
  /** A compiled rule set for one capability kind. */
83
113
  export interface CompiledCapabilityRules {
84
- readonly exposed: readonly PolicyRule[];
85
- readonly progressive: readonly PolicyRule[];
86
- readonly blocked: readonly PolicyRule[];
114
+ readonly resident: readonly PolicyRule[];
115
+ readonly onDemand: readonly PolicyRule[];
116
+ readonly disabled: readonly PolicyRule[];
87
117
  }
88
118
  /** Compile a {@link CapabilitySetConfig} into fast-matchable rules. */
89
119
  export declare function compileSet(set?: CapabilitySetConfig): CompiledCapabilityRules;
90
120
  /** Candidate fields a rule is matched against. */
91
121
  export interface MatchTarget {
92
- /** Full capability id: `mcp__<server>__<raw>` or `skill:<name>`. */
122
+ /** Capability id: `mcp__<server>__<raw>`, a native tool name, or a bare skill name. */
93
123
  readonly id: string;
94
- /** Bare model-facing name (tool name or skill name without `skill:` prefix). */
124
+ /** Model-facing name (for skills it equals the id; for MCP tools the public `mcp__...` name). */
95
125
  readonly name: string;
96
126
  /** Server name for tools; undefined for skills. */
97
127
  readonly server?: string;
@@ -102,9 +132,13 @@ export interface MatchTarget {
102
132
  }
103
133
  /**
104
134
  * Classify a capability against compiled rules. Priority (hit stops the walk):
105
- * blocked-exact > blocked-wildcard > exposed-exact > exposed-wildcard >
106
- * progressive-exact > progressive-wildcard > default (exposed). `blocked`
107
- * is a control decision, so it beats an explicit `exposed` rule.
135
+ * disabled-exact > disabled-wildcard > resident-exact > on-demand-exact >
136
+ * resident-wildcard > on-demand-wildcard > default (resident). `disabled` is a
137
+ * control decision, so it beats an explicit `resident` rule. Within
138
+ * resident/on-demand an exact name beats a wildcard, so the management UI can
139
+ * pin a single capability to a class even when a broader wildcard rule says
140
+ * otherwise (e.g. `tools.resident: ['mcp__gongfeng__*']` must not silently win
141
+ * over an explicit per-tool `on-demand` rule).
108
142
  */
109
143
  export declare function classify(compiled: CompiledCapabilityRules, target: MatchTarget, metaTools?: ReadonlySet<string> | readonly string[]): CapabilityClass;
110
144
  /**
@@ -117,12 +151,20 @@ export interface CapabilityClassification {
117
151
  readonly kind: CapabilityKind;
118
152
  /** Model-facing name (tool name or skill bare name). */
119
153
  readonly name: string;
120
- /** MCP server for tools; undefined for skills. */
154
+ /** Server namespace for tools (`built-in` for harness-native tools); undefined for skills. */
121
155
  readonly server?: string;
156
+ /** Skill source root label, present only for skills. */
157
+ readonly source?: string;
158
+ /**
159
+ * The skill's own directory on disk, present only for skills whose provider
160
+ * has one. The 纳入管理 confirmation shows it so the operator sees which
161
+ * directory is about to be linked, not just the root it came from.
162
+ */
163
+ readonly path?: string;
122
164
  readonly class: CapabilityClass;
123
165
  /** Human-friendly display label for the classification. */
124
166
  readonly classLabel: string;
125
- /** True when this capability is a mandatory meta tool (always Exposed). */
167
+ /** True when this capability is a mandatory meta tool (always Resident). */
126
168
  readonly mandatory: boolean;
127
169
  }
128
170
  /**
@@ -133,36 +175,56 @@ export interface CapabilityPolicyService {
133
175
  classifyTool(name: string): CapabilityClass;
134
176
  /** Classify a skill by its bare name. */
135
177
  classifySkill(name: string): CapabilityClass;
136
- /** True when a tool is Exposed (or a mandatory meta tool). */
137
- isExposedTool(name: string): boolean;
138
- /** True when a skill is Exposed. */
139
- isExposedSkill(name: string): boolean;
140
- /** True when a tool is Progressive. */
141
- isProgressiveTool(name: string): boolean;
142
- /** True when a skill is Progressive. */
143
- isProgressiveSkill(name: string): boolean;
144
- /** True when a tool is Blocked. */
145
- isBlockedTool(name: string): boolean;
146
- /** True when a skill is Blocked. */
147
- isBlockedSkill(name: string): boolean;
148
- /** True when a capability id (`mcp__...` / `skill:...`) is Blocked. */
149
- isBlockedCapability(id: string): boolean;
150
- /** Tool names that are always kept Exposed. */
178
+ /** True when a tool is Resident (or a mandatory meta tool). */
179
+ isResidentTool(name: string): boolean;
180
+ /** True when a skill is Resident. */
181
+ isResidentSkill(name: string): boolean;
182
+ /** True when a tool is Disabled. */
183
+ isDisabledTool(name: string): boolean;
184
+ /** True when a skill is Disabled. */
185
+ isDisabledSkill(name: string): boolean;
186
+ /**
187
+ * True when a capability (by id and `kind`) is Disabled. `kind` disambiguates
188
+ * a bare name shared by a tool and a skill.
189
+ */
190
+ isDisabledCapability(id: string, kind?: CapabilityKind): boolean;
191
+ /** Tool names that are always kept Resident. */
151
192
  metaTools(): readonly string[];
152
- /** Resolve a capability's id (e.g. `skill:<name>`) to a class. */
153
- classifyCapability(id: string): CapabilityClass;
154
- /** Rules exposed for the registry/other consumers. */
193
+ /** Resolve a capability's id to a class; pass `kind` to disambiguate a bare name. */
194
+ classifyCapability(id: string, kind?: CapabilityKind): CapabilityClass;
195
+ /** Rules resident for the registry/other consumers. */
155
196
  toolRules(): CompiledCapabilityRules;
156
197
  skillRules(): CompiledCapabilityRules;
157
198
  /** Current (resolved) policy config. */
158
199
  getConfig(): Config;
159
200
  /** Replace a subset of the policy config and recompile rules immediately. */
160
- updateConfig(partial: Partial<Config>): void;
201
+ updateConfig(partial: Partial<Config>): Promise<void>;
161
202
  /**
162
203
  * Classify every capability currently indexed by `ctx.capability` (the
163
204
  * registry sibling). Returns an empty array when the registry is not mounted.
164
205
  */
165
206
  classifyAll(): readonly CapabilityClassification[];
207
+ /** MCP servers declared in the patch file, in file order. */
208
+ listLocations(): Promise<McpLocation[]>;
209
+ /** Declare a new MCP server. Rejects a duplicate `serverName`. */
210
+ addLocation(input: McpInput): Promise<string>;
211
+ /** Remove a declared MCP server. */
212
+ removeLocation(id: string): Promise<boolean>;
213
+ /** Replace a declared server's connection config (`serverName` is immutable). */
214
+ updateLocation(id: string, input: McpUpdateInput): Promise<boolean>;
215
+ /** Skill entries under the user root, plus project entries the skill index knows about. */
216
+ listSkillLocations(): Promise<SkillLocation[]>;
217
+ /**
218
+ * Register a skill directory by linking it into the user root, or into
219
+ * `<projectRoot>/.dsh/skills` when `projectPath` names a path inside a project
220
+ * (the project root is derived from it the way dsh derives it). Returns the
221
+ * entry path actually written.
222
+ */
223
+ addSkillLocation(dir: string, projectPath?: string): Promise<string>;
224
+ /** Unregister a skill entry; `entryDir` addresses a project entry, omit it for the user root. */
225
+ removeSkillLocation(name: string, entryDir?: string): Promise<boolean>;
226
+ /** Repoint a registered skill entry at a different directory. */
227
+ updateSkillLocation(name: string, dir: string, entryDir?: string): Promise<boolean>;
166
228
  }
167
229
  declare module '@deepseek-ai/cordis' {
168
230
  interface Context {
@@ -170,12 +232,12 @@ declare module '@deepseek-ai/cordis' {
170
232
  }
171
233
  }
172
234
  /**
173
- * Build the projection listener for one assembly: keep only Exposed tools plus
235
+ * Build the projection listener for one assembly: keep only Resident tools plus
174
236
  * the mandatory meta tools.
175
237
  */
176
238
  export declare function projectAssemblyTools(assembly: PromptAssembly, service: CapabilityPolicyService): PromptAssembly;
177
239
  /** Build the policy plugin. */
178
240
  export declare const name = "capability-menu-policy";
179
241
  export declare const inject: string[];
180
- export declare function apply(ctx: Context, config?: Config): void;
242
+ export declare function apply(ctx: Context, config?: Config): Promise<void>;
181
243
  //# sourceMappingURL=policy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/policy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC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