@daweifu/capability-menu 0.1.3 → 0.1.5
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/README.en.md +74 -79
- package/README.md +76 -81
- package/cordis.patch.yml +7 -0
- package/lib/client.d.ts +43 -3
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +1172 -499
- package/lib/invoke.js +72 -2
- package/lib/invoke.js.map +1 -1
- package/lib/locations.js +168 -5
- package/lib/locations.js.map +1 -1
- package/lib/patch-file.js +33 -3
- package/lib/patch-file.js.map +1 -1
- package/lib/policy.js +33 -6
- package/lib/policy.js.map +1 -1
- package/lib/registry.js +75 -13
- package/lib/registry.js.map +1 -1
- package/lib/search.js +4 -4
- package/lib/search.js.map +1 -1
- package/lib/server/remote.js +34 -0
- package/lib/server/remote.js.map +1 -1
- package/lib/types/invoke.d.ts.map +1 -1
- package/lib/types/locations.d.ts +2 -0
- package/lib/types/locations.d.ts.map +1 -1
- package/lib/types/patch-file.d.ts.map +1 -1
- package/lib/types/policy.d.ts +8 -0
- package/lib/types/policy.d.ts.map +1 -1
- package/lib/types/registry.d.ts +23 -0
- package/lib/types/registry.d.ts.map +1 -1
- package/lib/types/search.d.ts +2 -2
- package/lib/types/server/remote.d.ts +20 -0
- package/lib/types/server/remote.d.ts.map +1 -1
- package/package.json +37 -21
package/lib/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ window.__ModuleLoader__.load({ id: "@daweifu/capability-menu", factory: (require
|
|
|
2
2
|
var module = { exports: {} };
|
|
3
3
|
var exports = module.exports;
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
6
6
|
import { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
|
|
7
7
|
//#region src/client/remote.d.ts
|
|
8
8
|
/** Read-only row: one capability's Resident/On-demand/Disabled classification. */
|
|
@@ -13,6 +13,12 @@ interface CapabilityRow {
|
|
|
13
13
|
readonly server?: string;
|
|
14
14
|
/** Skill source root label (`project-dsh`/`user-agents`/…), present only for skills. */
|
|
15
15
|
readonly source?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Agent preset id, present only for skills that live in a preset's own layer.
|
|
18
|
+
* The source label is `custom` for these as well, so this is what tells a
|
|
19
|
+
* preset skill apart from one in a user-configured `customSkillDirs` root.
|
|
20
|
+
*/
|
|
21
|
+
readonly preset?: string;
|
|
16
22
|
/** The skill's own directory on disk, present only for skills whose provider has one. */
|
|
17
23
|
readonly path?: string;
|
|
18
24
|
readonly class: 'resident' | 'on-demand' | 'disabled';
|
|
@@ -51,6 +57,7 @@ interface ToolDetail {
|
|
|
51
57
|
readonly serverName?: string;
|
|
52
58
|
readonly path?: string;
|
|
53
59
|
readonly source?: string;
|
|
60
|
+
readonly preset?: string;
|
|
54
61
|
};
|
|
55
62
|
readonly tags: readonly string[];
|
|
56
63
|
readonly stats: {
|
|
@@ -111,6 +118,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
111
118
|
updateConfig: (partial: Record<string, unknown>) => Promise<RemoteResult<void>>;
|
|
112
119
|
classifyAll: () => Promise<RemoteResult<CapabilityRow[]>>;
|
|
113
120
|
refresh: () => Promise<RemoteResult<void>>;
|
|
121
|
+
catalogVersion: () => Promise<RemoteResult<number>>;
|
|
114
122
|
listSkillDir: (id: string, relPath?: string) => Promise<RemoteResult<SkillFileEntry[] | undefined>>;
|
|
115
123
|
readSkillFile: (id: string, relPath: string) => Promise<RemoteResult<string | undefined>>;
|
|
116
124
|
getDetail: (id: string) => Promise<RemoteResult<ToolDetail | undefined>>;
|
|
@@ -121,6 +129,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
121
129
|
updateLocation: (id: string, input: McpUpdateInput) => Promise<RemoteResult<boolean>>;
|
|
122
130
|
listSkillLocations: () => Promise<RemoteResult<SkillLocation[]>>;
|
|
123
131
|
addSkillLocation: (dir: string, projectPath?: string) => Promise<RemoteResult<string>>;
|
|
132
|
+
importSkillFromGitHub: (url: string, projectPath?: string) => Promise<RemoteResult<string>>;
|
|
124
133
|
removeSkillLocation: (name: string, entryDir?: string) => Promise<RemoteResult<boolean>>;
|
|
125
134
|
adoptSkillLocation: (name: string) => Promise<RemoteResult<string>>;
|
|
126
135
|
updateSkillLocation: (name: string, dir: string, entryDir?: string) => Promise<RemoteResult<boolean>>;
|
|
@@ -130,6 +139,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
130
139
|
'capabilityPolicy/updateConfig': (partial: Record<string, unknown>) => Promise<RemoteResult<void>>;
|
|
131
140
|
'capabilityPolicy/classifyAll': () => Promise<RemoteResult<CapabilityRow[]>>;
|
|
132
141
|
'capabilityPolicy/refresh': () => Promise<RemoteResult<void>>;
|
|
142
|
+
'capabilityPolicy/catalogVersion': () => Promise<RemoteResult<number>>;
|
|
133
143
|
'capabilityPolicy/listSkillDir': (id: string, relPath?: string) => Promise<RemoteResult<SkillFileEntry[] | undefined>>;
|
|
134
144
|
'capabilityPolicy/readSkillFile': (id: string, relPath: string) => Promise<RemoteResult<string | undefined>>;
|
|
135
145
|
'capabilityPolicy/getDetail': (id: string) => Promise<RemoteResult<ToolDetail | undefined>>;
|
|
@@ -140,6 +150,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
140
150
|
'capabilityPolicy/updateLocation': (id: string, input: McpUpdateInput) => Promise<RemoteResult<boolean>>;
|
|
141
151
|
'capabilityPolicy/listSkillLocations': () => Promise<RemoteResult<SkillLocation[]>>;
|
|
142
152
|
'capabilityPolicy/addSkillLocation': (dir: string, projectPath?: string) => Promise<RemoteResult<string>>;
|
|
153
|
+
'capabilityPolicy/importSkillFromGitHub': (url: string, projectPath?: string) => Promise<RemoteResult<string>>;
|
|
143
154
|
'capabilityPolicy/removeSkillLocation': (name: string, entryDir?: string) => Promise<RemoteResult<boolean>>;
|
|
144
155
|
'capabilityPolicy/adoptSkillLocation': (name: string) => Promise<RemoteResult<string>>;
|
|
145
156
|
'capabilityPolicy/updateSkillLocation': (name: string, dir: string, entryDir?: string) => Promise<RemoteResult<boolean>>;
|
|
@@ -196,6 +207,17 @@ interface CapabilityPolicyRemote {
|
|
|
196
207
|
message: string;
|
|
197
208
|
};
|
|
198
209
|
}>;
|
|
210
|
+
/** One number naming the host's current catalog state; see the registry's `version()`. */
|
|
211
|
+
catalogVersion(): Promise<{
|
|
212
|
+
ok: true;
|
|
213
|
+
value: number;
|
|
214
|
+
} | {
|
|
215
|
+
ok: false;
|
|
216
|
+
error: {
|
|
217
|
+
code: string;
|
|
218
|
+
message: string;
|
|
219
|
+
};
|
|
220
|
+
}>;
|
|
199
221
|
listSkillDir(id: string, relPath?: string): Promise<{
|
|
200
222
|
ok: true;
|
|
201
223
|
value: SkillFileEntry[] | undefined;
|
|
@@ -296,6 +318,16 @@ interface CapabilityPolicyRemote {
|
|
|
296
318
|
message: string;
|
|
297
319
|
};
|
|
298
320
|
}>;
|
|
321
|
+
importSkillFromGitHub(url: string, projectPath?: string): Promise<{
|
|
322
|
+
ok: true;
|
|
323
|
+
value: string;
|
|
324
|
+
} | {
|
|
325
|
+
ok: false;
|
|
326
|
+
error: {
|
|
327
|
+
code: string;
|
|
328
|
+
message: string;
|
|
329
|
+
};
|
|
330
|
+
}>;
|
|
299
331
|
removeSkillLocation(name: string, entryDir?: string): Promise<{
|
|
300
332
|
ok: true;
|
|
301
333
|
value: boolean;
|
|
@@ -335,9 +367,17 @@ interface CapabilitySectionInjected {
|
|
|
335
367
|
t(key: CapabilityKey, params?: Record<string, unknown>): string;
|
|
336
368
|
/** Diagnostic: `$mount` failure surfaced instead of crashing the section. */
|
|
337
369
|
mountError?: string;
|
|
370
|
+
/**
|
|
371
|
+
* Subscribe to signals that the host catalog may have moved without this page
|
|
372
|
+
* asking: a settings document edit (registering a source, editing a
|
|
373
|
+
* composition file outside the browser) or a carrier reconnect. Returns a
|
|
374
|
+
* disposer. Optional so the section still mounts on a runtime that predates
|
|
375
|
+
* the forwarded-event API — it then falls back to the version poll alone.
|
|
376
|
+
*/
|
|
377
|
+
subscribeSignals?: (listener: () => void) => () => void;
|
|
338
378
|
}
|
|
339
379
|
type CapabilitySectionProps = CapabilitySectionInjected;
|
|
340
|
-
type CapabilityKey = 'nav' | 'title' | 'desc' | 'resident' | 'on-demand' | 'disabled' | 'tool' | 'skill' | 'mandatory' | 'toolsGroup' | 'skillsGroup' | 'builtInGroup' | 'globalSkills' | 'projectSkills' | 'emptyTools' | 'emptySkills' | 'emptyGlobalSkills' | 'emptyProjectSkills' | 'toolCount' | 'residentShort' | 'onDemandShort' | 'disabledShort' | 'cycleHint' | 'notPreviewable' | 'previewClose' | 'detailNotFound' | 'cycleOverridden' | '
|
|
380
|
+
type CapabilityKey = 'nav' | 'title' | 'packageName' | 'desc' | 'resident' | 'on-demand' | 'disabled' | 'tool' | 'skill' | 'mandatory' | 'toolsGroup' | 'skillsGroup' | 'builtInGroup' | 'globalSkills' | 'projectSkills' | 'presetSkills' | 'emptyTools' | 'emptySkills' | 'emptyGlobalSkills' | 'emptyProjectSkills' | 'emptyPresetSkills' | 'filterByName' | 'filterHint' | 'filterNoMatch' | 'toolCount' | 'residentShort' | 'onDemandShort' | 'disabledShort' | 'cycleHint' | 'notPreviewable' | 'previewClose' | 'markdownCode' | 'markdownWrap' | 'markdownUnwrap' | 'markdownCopy' | 'markdownCopied' | 'markdownFootnotes' | 'detailNotFound' | 'cycleOverridden' | 'refreshFailed' | 'mcpToolsPending' | 'feedback' | 'retry' | 'carrierFailureHint' | 'registerCapability' | 'editMcp' | 'editSkillNamed' | 'edit' | 'save' | 'remove' | 'cancel' | 'confirmRemove' | 'confirmRemoveMcp' | 'confirmRemoveSkillLink' | 'confirmRemoveSkillDir' | 'confirmSaveAnyway' | 'saveConfirmRealDir' | 'register' | 'notEditable' | 'entryNotFound' | 'mcpServers' | 'skillDirs' | 'skillDirPath' | 'skillDirHint' | 'skillRoot' | 'skillRootUser' | 'skillRootProject' | 'skillRootHintUser' | 'skillRootHintProject' | 'skillProjectPath' | 'skillProjectPathHint' | 'skillRegisteredAt' | 'skillRepointed' | 'skillAdopted' | 'skillSource' | 'skillSourceHint' | 'skillFromPreset' | 'skillFromPresetHint' | 'githubImporting' | 'importing' | 'skillUnmanaged' | 'adoptSkill' | 'adoptSkillHint' | 'adoptSkillTitle' | 'sourceCustom' | 'sourceBundled' | 'serverName' | 'serverNameImmutable' | 'transport' | 'transportStdio' | 'transportHttp' | 'transportHintStdio' | 'transportHintHttp' | 'command' | 'args' | 'cwd' | 'env' | 'url' | 'headers' | 'headersHint' | 'timeout' | 'timeoutInvalid' | 'viewCatalog' | 'catalogPolicy' | 'catalogOnDemand' | 'catalogPolicyNote' | 'catalogDisabled' | 'catalogUnreadable';
|
|
341
381
|
//#endregion
|
|
342
382
|
//#region src/client/index.d.ts
|
|
343
383
|
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
@@ -352,7 +392,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
352
392
|
* which resolves the mounted namespace service without the inject gate. */
|
|
353
393
|
declare const inject: string[];
|
|
354
394
|
/** Register the 能力菜单 section once `settings.section` is on the ledger. */
|
|
355
|
-
declare function apply(ctx:
|
|
395
|
+
declare function apply(ctx: Context): Promise<() => void>;
|
|
356
396
|
//#endregion
|
|
357
397
|
export { type CapabilityKey, type CapabilityPolicyRemote, type CapabilityRow, type CapabilitySectionInjected, type CapabilitySectionProps, type CapabilitySnapshot, apply, inject };
|
|
358
398
|
|
package/lib/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","names":[],"sources":["../src/client/remote.ts","../src/client/store.ts","../src/client/CapabilitySection.tsx","../src/client/index.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../src/client/remote.ts","../src/client/store.ts","../src/client/CapabilitySection.tsx","../src/client/index.ts"],"mappings":";;;;;;;;UA0BiB;WACN;WACA;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