@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
@@ -7,9 +7,12 @@ import type { Context } from '@deepseek-ai/cordis';
7
7
  import z from '@deepseek-ai/schemastery';
8
8
  import type { ScopeKey } from '@deepseek-ai/dsh-scope';
9
9
  import type { JsonSchemaNode } from '@deepseek-ai/dsh-tools';
10
+ import { BUILT_IN_SERVER, MCP_ID_PREFIX } from './constants.ts';
11
+ export { BUILT_IN_SERVER, MCP_ID_PREFIX };
10
12
  /**
11
13
  * Kinds of capability the catalog can hold.
12
- * - `tool`: action capability — executes a concrete action (an MCP tool).
14
+ * - `tool`: action capability — executes a concrete action (an MCP tool or a
15
+ * harness-native tool cataloged under the reserved `built-in` server).
13
16
  * - `skill`: action capability — loads the method/instructions for a task.
14
17
  */
15
18
  export type CapabilityKind = 'tool' | 'skill';
@@ -17,21 +20,32 @@ export type CapabilityKind = 'tool' | 'skill';
17
20
  * Stable invocation actions a capability can declare. Each kind maps to one
18
21
  * canonical action; a new kind only deserves a new value here when it
19
22
  * introduces a new action (not a new flavor of an existing one).
20
- * `execute` = run the concrete action (an MCP tool, via `ctx.tools.execute`);
23
+ * `execute` = run the concrete action (a tool — MCP or native — via `ctx.tools.execute`);
21
24
  * `load` = load the method/instructions (a skill).
22
25
  */
23
26
  export type CapabilityAction = 'execute' | 'load';
24
- /** Stable identifier prefixes: MCP tools keep `mcp__...`, skills use `skill:<name>`. */
25
- export declare const SKILL_ID_PREFIX = "skill:";
26
- export declare const MCP_ID_PREFIX = "mcp__";
27
+ /**
28
+ * Tool names that never enter the capability catalog: this plugin's own
29
+ * control plane (`meta_search`/`meta_invoke`, always Resident) and the
30
+ * reserved Code Mode presentation transport (`run_code`).
31
+ *
32
+ * Tool ids (the key everything else uses) are the REAL registered tool name:
33
+ * MCP tools are registered as `mcp__<server>__<raw>` by the harness MCP client
34
+ * and natives keep their bare name (`bash`/`read`/…). Skills have no
35
+ * name-level namespace: a skill's id IS its bare name and `kind` disambiguates
36
+ * it from a same-named tool.
37
+ */
38
+ export declare const CATALOG_EXCLUDED_TOOLS: ReadonlySet<string>;
27
39
  /** Capability-stable origin metadata used by search filters and detail views. */
28
40
  export interface CapabilityOrigin {
29
- /** Human/namespace label, e.g. `gongfeng` or `filesystem`. */
41
+ /** Human/namespace label: an MCP server name, the reserved `built-in` for native tools, or a skill provider. */
30
42
  readonly provider: string;
31
- /** MCP server name, present only for `kind: 'tool'`. */
43
+ /** Server namespace, present only for `kind: 'tool'` (`built-in` for native tools). */
32
44
  readonly serverName?: string;
33
45
  /** Local skill path, present only for `kind: 'skill'`. */
34
46
  readonly path?: string;
47
+ /** Skill source root label (`project-dsh`/`user-agents`/…), present only for skills. */
48
+ readonly source?: string;
35
49
  }
36
50
  /** Objective and subjective usage statistics, written back from `tools/result`. */
37
51
  export interface CapabilityStats {
@@ -43,7 +57,7 @@ export interface CapabilityStats {
43
57
  }
44
58
  /** One indexed capability. */
45
59
  export interface CapabilityRecord {
46
- /** Stable identifier: `mcp__<server>__<raw>` or `skill:<name>`. */
60
+ /** Stable identifier: `mcp__<server>__<raw>`, a native tool name, or a bare skill name. */
47
61
  readonly id: string;
48
62
  readonly kind: CapabilityKind;
49
63
  /** The canonical invocation action(s) this capability exposes. */
@@ -72,6 +86,8 @@ export interface CapabilitySummary {
72
86
  readonly name: string;
73
87
  readonly summary: string;
74
88
  readonly server?: string;
89
+ /** Skill source root label, present only for `kind: 'skill'`. */
90
+ readonly source?: string;
75
91
  readonly tags: readonly string[];
76
92
  readonly success_rate?: number;
77
93
  readonly uses: number;
@@ -99,7 +115,7 @@ export interface MetaSearchOptions {
99
115
  readonly maxResults?: number;
100
116
  /**
101
117
  * Viewing scope. Retained for caller ergonomics and optional authorization
102
- * checks, but the policy does NOT use it to filter visibility — Progressive
118
+ * checks, but the policy does NOT use it to filter visibility — On-demand
103
119
  * capabilities must remain searchable regardless of the caller's projection.
104
120
  */
105
121
  readonly scope?: ScopeKey | undefined;
@@ -125,10 +141,17 @@ export interface SkillDirEntry {
125
141
  export interface CapabilityService {
126
142
  /** Enumerate the current catalog (optionally filtered). */
127
143
  search(options?: MetaSearchOptions): CapabilitySummary[];
128
- /** Resolve one record by id, or undefined. */
129
- get(id: string): CapabilityRecord | undefined;
130
- /** Resolve one record's full detail (schema, output; skill body optional). */
131
- getDetail(id: string, context?: MetaLookupContext): Promise<CapabilityDetail | undefined>;
144
+ /**
145
+ * Resolve one record by id, or undefined. Pass `kind` when the caller knows
146
+ * it (tools and skills may share a bare name, e.g. a skill named `bash`);
147
+ * without `kind` a same-name tool/skill pair resolves to undefined.
148
+ */
149
+ get(id: string, kind?: CapabilityKind): CapabilityRecord | undefined;
150
+ /**
151
+ * Resolve one record's full detail (schema, output; skill body optional).
152
+ * `kind` has the same disambiguation semantics as {@link get}.
153
+ */
154
+ getDetail(id: string, kind?: CapabilityKind, context?: MetaLookupContext): Promise<CapabilityDetail | undefined>;
132
155
  /**
133
156
  * List a skill's directory children (one level deep). The directory is
134
157
  * resolved from the skill's own provider path, never from caller input;
@@ -142,15 +165,50 @@ export interface CapabilityService {
142
165
  * (content containing NUL) return undefined.
143
166
  */
144
167
  readSkillFile(id: string, relPath: string): Promise<string | undefined>;
168
+ /**
169
+ * Indexed skills whose provider exposes a filesystem directory, as
170
+ * `{ name, skillDir }` where `skillDir` is `<entryDir>/<name>`.
171
+ */
172
+ skillDirs(): ReadonlyArray<{
173
+ readonly name: string;
174
+ readonly skillDir: string;
175
+ readonly source?: string;
176
+ }>;
145
177
  /** Return the current number of indexed capabilities. */
146
178
  size(): number;
179
+ /**
180
+ * Absolute path of the on-demand capability catalog YAML, when emission is
181
+ * enabled. The model can browse this file with grep/read instead of only
182
+ * reaching the catalog through `meta_search`.
183
+ */
184
+ catalogPath(): string | undefined;
185
+ /**
186
+ * Number of On-demand capabilities in the latest catalog emission. Used by
187
+ * the policy's assemble hook to skip the catalog pointer when there is
188
+ * nothing On-demand to browse.
189
+ */
190
+ onDemandCount(): number;
147
191
  /**
148
192
  * Rebuild the catalog from the current tool/skill registries; resolves when
149
193
  * done. In production the registry rebuilds automatically on `tools/change`
150
194
  * / `skills/change`; this public handle is for tests and external orchestrators
151
- * that want to force a rebuild (e.g. after a `progressiveSkillCatalog` change).
195
+ * that want to force a rebuild.
152
196
  */
153
197
  refresh(): Promise<void>;
198
+ /**
199
+ * Ask for a rebuild without waiting for it. The scheduler coalesces bursts,
200
+ * so a caller that changes something repeatedly (the management UI cycling
201
+ * a classification) triggers one rebuild, not one per call.
202
+ */
203
+ requestRefresh(): void;
204
+ /**
205
+ * Re-emit the materialized on-demand catalog from the index already in hand,
206
+ * without re-enumerating tools or skills. Moving a capability between tiers
207
+ * changes no inventory, so the only thing stale on disk is that file — and a
208
+ * full rebuild would re-scan the global skill layer plus every agent preset
209
+ * for no new information, which is what made a tier click stall.
210
+ */
211
+ rewriteCatalog(): Promise<void>;
154
212
  }
155
213
  declare module '@deepseek-ai/cordis' {
156
214
  interface Context {
@@ -163,18 +221,33 @@ export interface Config {
163
221
  summaryMaxChars?: number;
164
222
  /** Whether to include the skill body in `getDetail` results (default false). */
165
223
  detailIncludesBody?: boolean;
166
- /** Maximum search results returned (default 20, max 100). */
224
+ /**
225
+ * Maximum search results returned (default 20). No upper bound is enforced:
226
+ * callers that need the whole catalog (the policy's `classifyAll`) pass a
227
+ * very large value on purpose, so capping here would silently truncate the
228
+ * management surface.
229
+ */
167
230
  maxResults?: number;
168
231
  /** Experience-weighting intensity for ranking (0 disables, default 0.1). */
169
232
  weighting?: number;
170
233
  /**
171
- * Optional path to a Progressive-skill catalog YAML (see §7.2). Each entry
172
- * `{ name, description, whenToUse?, path? }` is indexed as a `skill`
173
- * CapabilityRecord so `meta_search(kind=skill)` can find Progressive skills
174
- * that are not otherwise registered in the session skill registry. The full
175
- * SKILL.md is loaded on demand by `meta_invoke` (see the invoke package).
234
+ * Optional path for the on-demand capability catalog emitted as a YAML file
235
+ * for model-side grep/read browsing. Defaults to
236
+ * `~/.dsh/capability-catalog.yaml`; set to an empty string to disable
237
+ * emission. Disabled capabilities are never written.
238
+ */
239
+ catalogFile?: string;
240
+ /**
241
+ * Debounce window (ms) applied to catalog rebuilds triggered by
242
+ * `tools/change` / `skills/change`. The skill/preset lifecycle emits these
243
+ * events in bursts, and a rebuild's own registry access can emit further
244
+ * ones, so rebuilding once per event produced an unbounded CPU storm. The
245
+ * scheduler runs at most one rebuild at a time and coalesces a burst into a
246
+ * single follow-up after this window. Set to `0` to disable debouncing
247
+ * (every event still gets at most one coalesced rebuild, never a concurrent
248
+ * one). Default 200.
176
249
  */
177
- progressiveSkillCatalog?: string;
250
+ refreshDebounceMs?: number;
178
251
  }
179
252
  /** Validate and default the registry configuration. */
180
253
  export declare const Config: z<Config>;
@@ -184,8 +257,4 @@ export declare const inject: string[];
184
257
  export declare function apply(ctx: Context, config?: Config): void;
185
258
  /** Derive the server namespace from an `mcp__<server>__<raw>` name. */
186
259
  export declare function serverNameOf(publicName: string): string;
187
- /** Build the stable skill identifier `skill:<name>`. */
188
- export declare function skillId(name: string): string;
189
- /** Strip the `skill:` prefix from a capability id. */
190
- export declare function skillNameOf(id: string): string;
191
260
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAsC,MAAM,wBAAwB,CAAA;AAMhG;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAA;AAE7C;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,CAAA;AAEjD,wFAAwF;AACxF,eAAO,MAAM,eAAe,WAAW,CAAA;AACvC,eAAO,MAAM,aAAa,UAAU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CAAA;AAEF,kCAAkC;AAClC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,iBAAiB,EAAE,CAAA;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,oCAAoC;AACpC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAA;CAClC;AAED,mDAAmD;AACnD,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,sBAAsB,CAAA;AAE5E;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,MAAW,GAAG,IAAI,CAsI7D"}
@@ -11,12 +11,25 @@ import type { Context } from '@deepseek-ai/cordis';
11
11
  import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
12
12
  import type { CapabilityClassification, CapabilityPolicyService, Config as CapabilityPolicyConfig } from '../policy.ts';
13
13
  import type { CapabilityDetail, SkillDirEntry, CapabilityService } from '../registry.ts';
14
+ import type { McpInput, McpLocation, McpUpdateInput, SkillLocation } from '../locations.ts';
14
15
  declare module '@deepseek-ai/cordis' {
15
16
  interface Context {
16
17
  capabilityPolicy: CapabilityPolicyService;
17
18
  capability: CapabilityService;
18
19
  }
19
20
  }
21
+ /** 能力目录查看负载:两份只读「文件」+ 缺失原因。 */
22
+ export interface CatalogDocs {
23
+ /** 当前生效的三档策略配置(getConfig() + metaTools()),YAML 文本。 */
24
+ readonly policyYaml: string;
25
+ /** 按需能力目录物化文件(capability.catalogPath())。 */
26
+ readonly catalog?: {
27
+ readonly path: string;
28
+ readonly content: string;
29
+ };
30
+ /** catalog 不可用原因:'disabled' = catalogFile 为空(未启用物化);'read-failed' = 读盘失败。 */
31
+ readonly catalogMissing?: 'disabled' | 'read-failed';
32
+ }
20
33
  /**
21
34
  * Host-side remote face for the 能力菜单 tab. Every method delegates to the
22
35
  * policy service installed by `@daweifu/capability-menu/policy`; the registry
@@ -33,16 +46,69 @@ export declare class CapabilityPolicyGateway extends TypertRemoteService {
33
46
  constructor(ctx: Context);
34
47
  /** Current (resolved) policy config. */
35
48
  getConfig(): CapabilityPolicyConfig;
36
- /** Replace a subset of the policy config (recompile rules). */
37
- updateConfig(partial: Partial<CapabilityPolicyConfig>): void;
49
+ /** Replace a subset of the policy config (recompile rules + rewrite catalog). */
50
+ updateConfig(partial: Partial<CapabilityPolicyConfig>): Promise<void>;
38
51
  /** Classify every capability currently indexed by `ctx.capability`. */
39
52
  classifyAll(): CapabilityClassification[];
53
+ /**
54
+ * Rebuild the capability catalog now and resolve once it has converged.
55
+ * The UI calls this after registering a new source (an MCP server or a
56
+ * skill directory) so the list reflects it without waiting for the
57
+ * scheduler's debounce window.
58
+ */
59
+ refresh(): Promise<void>;
40
60
  /** Resolve one capability's full detail (schema, description; skill body optional). */
41
61
  getDetail(id: string): Promise<CapabilityDetail | undefined>;
42
62
  /** List a skill's directory children (one level deep; optional subpath). */
43
63
  listSkillDir(id: string, relPath?: string): Promise<SkillDirEntry[] | undefined>;
44
64
  /** Read a text file inside a skill's directory. */
45
65
  readSkillFile(id: string, relPath: string): Promise<string | undefined>;
66
+ /**
67
+ * 能力目录查看:返回「三档策略配置」语义化视图——默认全部常驻,
68
+ * tools.resident 按 server 各显示 '*',例外(on-demand/disabled)按
69
+ * server → 工具短名 分级列出;skills 无 server 维度,resident 恒为 '*',
70
+ * 例外为短名平铺。空例外不渲染 key,避免 []/{} 歧义。
71
+ * 另返回按需能力目录物化文件(~/.dsh/capability-catalog.yaml)的路径和内容。
72
+ * 两者都是只读视图;改规则的入口是「能力菜单」的点选,改动会自动写回 cordis.patch.yml。
73
+ */
74
+ getCatalogDocs(): Promise<CatalogDocs>;
75
+ /** MCP servers declared in the patch file. */
76
+ listLocations(): Promise<McpLocation[]>;
77
+ /** Declare a new MCP server. */
78
+ addLocation(input: McpInput): Promise<string>;
79
+ /** Remove a declared MCP server. */
80
+ removeLocation(id: string): Promise<boolean>;
81
+ /** Replace a declared MCP server's connection config. */
82
+ updateLocation(id: string, input: McpUpdateInput): Promise<boolean>;
83
+ /**
84
+ * Skill entries the operator can manage: everything under the user root, plus
85
+ * the project-scoped entries the skill index knows about.
86
+ *
87
+ * dsh discovers a project's skills from `<projectRoot>/.dsh/skills` and
88
+ * `<projectRoot>/.agents/skills` for whichever project the *session* cwd sits
89
+ * in, so reading the user root alone cannot see them. The index records each
90
+ * skill's own directory, which is what lets these rows be edited and removed
91
+ * rather than merely listed.
92
+ */
93
+ listSkillLocations(): Promise<SkillLocation[]>;
94
+ /**
95
+ * Register a skill directory: into the user root by default, or into a
96
+ * project's `.dsh/skills` when `projectPath` names a path inside that project.
97
+ * Returns the entry path actually written so the UI can report it.
98
+ */
99
+ addSkillLocation(dir: string, projectPath?: string): Promise<string>;
100
+ /**
101
+ * Adopt a skill that already lives in a user-level root this plugin reads but
102
+ * does not manage (`~/.agents/skills`, custom dirs) by linking its own
103
+ * directory into the user root. The content is untouched — this is exactly how
104
+ * the entries already in `~/.dsh/skills` are set up — and the skill becomes
105
+ * editable afterwards. Returns the entry path written.
106
+ */
107
+ adoptSkillLocation(name: string): Promise<string>;
108
+ /** Unregister a skill entry; `entryDir` addresses a project entry. */
109
+ removeSkillLocation(name: string, entryDir?: string): Promise<boolean>;
110
+ /** Repoint a registered skill entry at a different directory. */
111
+ updateSkillLocation(name: string, dir: string, entryDir?: string): Promise<boolean>;
46
112
  }
47
113
  /** Register the remote gateway on a context. */
48
114
  export declare const name = "capability-menu-remote";
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../src/server/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD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,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAG1F;AAED,gDAAgD;AAChD,eAAO,MAAM,IAAI,2BAA2B,CAAA;AAC5C,eAAO,MAAM,MAAM,UAAqC,CAAA;AACxD,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAExC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@daweifu/capability-menu",
3
- "version": "0.1.1",
4
- "description": "Unified capability management for the DeepSeek Harness: catalog (ctx.capability) + meta_search/meta_invoke + Exposed/Progressive/Blocked projection policy + 能力菜单 settings tab, in one installable bundle (server + browser).",
3
+ "version": "0.1.3",
4
+ "description": "Unified capability management for the DeepSeek Harness: catalog (ctx.capability) + meta_search/meta_invoke + Resident/On-demand/Disabled projection policy + 能力菜单 settings tab, in one installable bundle (server + browser).",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -43,10 +43,6 @@
43
43
  "types": "./lib/types/policy.d.ts",
44
44
  "default": "./lib/policy.js"
45
45
  },
46
- "./invariant": {
47
- "types": "./lib/types/invariant.d.ts",
48
- "default": "./lib/invariant.js"
49
- },
50
46
  "./client": {
51
47
  "types": "./lib/client.d.ts",
52
48
  "default": "./lib/client.js"
@@ -78,40 +74,41 @@
78
74
  }
79
75
  },
80
76
  "peerDependencies": {
81
- "@deepseek-ai/cordis": "^4.0.1",
82
- "@deepseek-ai/dsh-agent": "^0.1.1-rc.1",
83
- "@deepseek-ai/dsh-invariants": "^0.1.1-rc.1",
84
- "@deepseek-ai/dsh-llm": "^0.1.1-rc.1",
85
- "@deepseek-ai/dsh-scope": "^0.1.1-rc.1",
86
- "@deepseek-ai/dsh-session": "^0.1.1-rc.1",
87
- "@deepseek-ai/dsh-skill": "^0.1.1-rc.1",
88
- "@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.1",
89
- "@deepseek-ai/dsh-tools": "^0.1.1-rc.1",
90
- "@deepseek-ai/dsh-api-remotes": "^0.1.1-rc.1",
91
- "@deepseek-ai/dsh-client-connection": "^0.1.1-rc.1",
92
- "@deepseek-ai/dsh-client-locale": "^0.1.1-rc.1",
77
+ "@deepseek-ai/cordis": "^4.0.2",
78
+ "@deepseek-ai/dsh-agent": "^0.1.5-rc.2",
79
+ "@deepseek-ai/dsh-llm": "^0.1.5-rc.2",
80
+ "@deepseek-ai/dsh-scope": "^0.1.5-rc.2",
81
+ "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
82
+ "@deepseek-ai/dsh-skill": "^0.1.5-rc.2",
83
+ "@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2",
84
+ "@deepseek-ai/dsh-tools": "^0.1.5-rc.2",
85
+ "@deepseek-ai/dsh-api-remotes": "^0.1.5-rc.2",
86
+ "@deepseek-ai/dsh-client-connection": "^0.1.5-rc.2",
87
+ "@deepseek-ai/dsh-client-locale": "^0.1.5-rc.2",
93
88
  "@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.1",
94
89
  "@deepseek-ai/dsh-client-schema-form": "^0.1.0-rc.7",
95
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
96
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.1-rc.1",
97
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
90
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-rc.2",
91
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.5-rc.2",
92
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.5-rc.2",
98
93
  "@deepseek-ai/dsh-client-web-react": "^0.1.0-rc.7",
99
- "@deepseek-ai/dsh-typert-protocol": "^0.1.1-rc.1",
100
- "@deepseek-ai/schemastery": "^3.18.1",
94
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.5-rc.2",
95
+ "@deepseek-ai/schemastery": "^3.18.2",
101
96
  "react": "^18.2.0"
102
97
  },
103
98
  "dependencies": {
104
- "@deepseek-ai/schemastery": "^3.18.1",
105
- "js-yaml": "^4.1.0"
99
+ "@deepseek-ai/schemastery": "^3.18.2",
100
+ "js-yaml": "^4.1.0",
101
+ "yaml": "^2.8.1"
106
102
  },
107
103
  "devDependencies": {
108
- "@deepseek-ai/dsh-skill-filesystem": "^0.1.1-rc.1",
104
+ "@deepseek-ai/dsh-skill-filesystem": "^0.1.5-rc.2",
109
105
  "@types/js-yaml": "^4.0.9",
110
106
  "@types/node": "^22.0.0",
111
107
  "@types/react": "^18.2.0",
112
108
  "tsdown": "^0.22.2",
113
109
  "typescript": "^6.0.3",
114
110
  "vitest": "^4.1.8",
111
+ "@deepseek-ai/dsh-util-values": "^0.1.5-rc.2",
115
112
  "zod": "^4.4.3"
116
113
  }
117
114
  }
package/lib/invariant.js DELETED
@@ -1,22 +0,0 @@
1
- /**
2
- * Package-owned invariant companion for `@daweifu/capability-menu`.
3
- * @module @daweifu/capability-menu/invariant
4
- */
5
- const PACKAGE_NAME = '@daweifu/capability-menu';
6
- /** Cordis companion plugin name. */
7
- export const name = 'capability-menu-invariant';
8
- /** Service required before the companion can reserve package ownership. */
9
- export const inject = ['invariants'];
10
- /**
11
- * No runtime invariant: the capability catalog has no independent lifecycle
12
- * stream; its index mirrors the tools/skills registries it observes.
13
- */
14
- const install = () => { };
15
- /**
16
- * Register this package's invariant companion.
17
- * @param ctx - Cordis context carrying the invariant service.
18
- * @returns the installed registration's disposer after setup succeeds.
19
- */
20
- export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
21
- /* jscpd:ignore-end */
22
- //# sourceMappingURL=invariant.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invariant.js","sourceRoot":"","sources":["../src/invariant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,YAAY,GAAG,0BAA0B,CAAA;AAE/C,oCAAoC;AACpC,MAAM,CAAC,MAAM,IAAI,GAAG,2BAA2B,CAAA;AAC/C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,YAAY,CAAC,CAAA;AAEpC;;;GAGG;AACH,MAAM,OAAO,GAAuB,GAAG,EAAE,GAAE,CAAC,CAAA;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAY,EAAuB,EAAE,CACzD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;AACjE,sBAAsB"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Package-owned invariant companion for `@daweifu/capability-menu`.
3
- * @module @daweifu/capability-menu/invariant
4
- */
5
- import type { Context } from '@deepseek-ai/cordis';
6
- /** Cordis companion plugin name. */
7
- export declare const name = "capability-menu-invariant";
8
- /** Service required before the companion can reserve package ownership. */
9
- export declare const inject: string[];
10
- /**
11
- * Register this package's invariant companion.
12
- * @param ctx - Cordis context carrying the invariant service.
13
- * @returns the installed registration's disposer after setup succeeds.
14
- */
15
- export declare const apply: (ctx: Context) => Promise<() => void>;
16
- //# sourceMappingURL=invariant.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../src/invariant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,oCAAoC;AACpC,eAAO,MAAM,IAAI,8BAA8B,CAAA;AAC/C,2EAA2E;AAC3E,eAAO,MAAM,MAAM,UAAiB,CAAA;AAQpC;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,OAAO,KAAG,OAAO,CAAC,MAAM,IAAI,CACU,CAAA"}