@daweifu/capability-menu 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +217 -0
- package/README.md +104 -61
- package/cordis.patch.yml +31 -31
- package/lib/client.d.ts +33 -7
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +315 -97
- package/lib/index.js +2 -2
- package/lib/invoke.js +68 -96
- package/lib/invoke.js.map +1 -1
- package/lib/policy.js +224 -80
- package/lib/policy.js.map +1 -1
- package/lib/registry.js +183 -143
- package/lib/registry.js.map +1 -1
- package/lib/search.js +17 -8
- package/lib/search.js.map +1 -1
- package/lib/server/remote.js +87 -4
- package/lib/server/remote.js.map +1 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/types/invoke.d.ts +7 -13
- package/lib/types/invoke.d.ts.map +1 -1
- package/lib/types/policy.d.ts +78 -55
- package/lib/types/policy.d.ts.map +1 -1
- package/lib/types/registry.d.ts +60 -23
- package/lib/types/registry.d.ts.map +1 -1
- package/lib/types/search.d.ts.map +1 -1
- package/lib/types/server/remote.d.ts +24 -3
- package/lib/types/server/remote.d.ts.map +1 -1
- package/package.json +19 -23
- package/lib/invariant.js +0 -22
- package/lib/invariant.js.map +0 -1
- package/lib/types/invariant.d.ts +0 -16
- package/lib/types/invariant.d.ts.map +0 -1
package/lib/client.d.ts
CHANGED
|
@@ -7,20 +7,23 @@ import { ClientContext } from "@deepseek-ai/dsh-client-runtime/client";
|
|
|
7
7
|
/**
|
|
8
8
|
* ⚠️ VERIFIED AGAINST REAL rc.8 CLIENT API.
|
|
9
9
|
*
|
|
10
|
-
* Types + small helpers for the
|
|
10
|
+
* Types + small helpers for the 能力管理 (Capability Management) settings
|
|
11
11
|
* section. The component reads/writes the Host `ctx.capabilityPolicy` through
|
|
12
12
|
* the generated `remote.capabilityPolicy` face (see `./remote.ts`), mirroring
|
|
13
13
|
* how `dsh-client-ui-settings-plugin-inventory` consumes
|
|
14
14
|
* `ctx.remote.pluginInventory`.
|
|
15
15
|
*/
|
|
16
|
-
/** One capability's
|
|
16
|
+
/** One capability's Resident/On-demand/Disabled row, as surfaced by the server. */
|
|
17
17
|
interface CapabilityRow {
|
|
18
18
|
readonly id: string;
|
|
19
19
|
readonly kind: 'tool' | 'skill';
|
|
20
20
|
readonly name: string;
|
|
21
|
+
/** Server namespace for tools (`built-in` groups harness-native tools); undefined for skills. */
|
|
21
22
|
readonly server?: string;
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
/** Skill source root label (`project-dsh`/`user-agents`/…), present only for skills. */
|
|
24
|
+
readonly source?: string;
|
|
25
|
+
readonly class: 'resident' | 'on-demand' | 'disabled';
|
|
26
|
+
/** Human-friendly display: `Resident · 常驻(直接调用)` / `On-demand · 按需(目录渐进加载)` / `Disabled · 禁用`. */
|
|
24
27
|
readonly classLabel?: string;
|
|
25
28
|
readonly mandatory: boolean;
|
|
26
29
|
}
|
|
@@ -47,6 +50,7 @@ interface ToolDetail {
|
|
|
47
50
|
readonly provider: string;
|
|
48
51
|
readonly serverName?: string;
|
|
49
52
|
readonly path?: string;
|
|
53
|
+
readonly source?: string;
|
|
50
54
|
};
|
|
51
55
|
readonly tags: readonly string[];
|
|
52
56
|
readonly stats: {
|
|
@@ -57,6 +61,18 @@ interface ToolDetail {
|
|
|
57
61
|
readonly lastUsedAt?: number;
|
|
58
62
|
};
|
|
59
63
|
}
|
|
64
|
+
/** 能力目录查看负载:两份只读「文件」+ 缺失原因。 */
|
|
65
|
+
interface CatalogDocs {
|
|
66
|
+
/** 当前生效的三档策略配置 YAML。 */
|
|
67
|
+
readonly policyYaml: string;
|
|
68
|
+
/** 按需能力目录物化文件(path + content)。 */
|
|
69
|
+
readonly catalog?: {
|
|
70
|
+
readonly path: string;
|
|
71
|
+
readonly content: string;
|
|
72
|
+
};
|
|
73
|
+
/** catalog 不可用原因:'disabled' = 物化未启用;'read-failed' = 读盘失败。 */
|
|
74
|
+
readonly catalogMissing?: 'disabled' | 'read-failed';
|
|
75
|
+
}
|
|
60
76
|
/** The Host `capabilityPolicy` remote face (generated contribution). */
|
|
61
77
|
interface CapabilityPolicyRemote {
|
|
62
78
|
getConfig(): Promise<{
|
|
@@ -119,6 +135,16 @@ interface CapabilityPolicyRemote {
|
|
|
119
135
|
message: string;
|
|
120
136
|
};
|
|
121
137
|
}>;
|
|
138
|
+
getCatalogDocs(): Promise<{
|
|
139
|
+
ok: true;
|
|
140
|
+
value: CatalogDocs;
|
|
141
|
+
} | {
|
|
142
|
+
ok: false;
|
|
143
|
+
error: {
|
|
144
|
+
code: string;
|
|
145
|
+
message: string;
|
|
146
|
+
};
|
|
147
|
+
}>;
|
|
122
148
|
}
|
|
123
149
|
//#endregion
|
|
124
150
|
//#region src/client/CapabilitySection.d.ts
|
|
@@ -132,12 +158,12 @@ interface CapabilitySectionInjected {
|
|
|
132
158
|
remoteKeys?: string;
|
|
133
159
|
}
|
|
134
160
|
type CapabilitySectionProps = CapabilitySectionInjected;
|
|
135
|
-
type CapabilityKey = 'nav' | 'title' | 'desc' | '
|
|
161
|
+
type CapabilityKey = 'nav' | 'title' | 'desc' | 'resident' | 'on-demand' | 'disabled' | 'kind' | 'class' | 'tool' | 'skill' | 'mandatory' | 'rules' | 'toolsGroup' | 'skillsGroup' | 'builtInGroup' | 'globalSkills' | 'projectSkills' | 'emptyTools' | 'emptySkills' | 'emptyGlobalSkills' | 'emptyProjectSkills' | 'toolCount' | 'residentShort' | 'onDemandShort' | 'disabledShort' | 'cycleHint' | 'notPreviewable' | 'previewClose' | 'detailNotFound' | 'cycleOverridden' | 'viewCatalog' | 'catalogPolicy' | 'catalogOnDemand' | 'catalogPolicyNote' | 'catalogDisabled' | 'catalogUnreadable';
|
|
136
162
|
//#endregion
|
|
137
163
|
//#region src/client/index.d.ts
|
|
138
164
|
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
139
165
|
interface LocaleNamespaceMap {
|
|
140
|
-
/**
|
|
166
|
+
/** 能力管理 tab copy. */
|
|
141
167
|
'settings.capability': Record<CapabilityKey, string>;
|
|
142
168
|
}
|
|
143
169
|
}
|
|
@@ -146,7 +172,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
146
172
|
* ("waiting for service"). Access it via `ctx.get('remote.capabilityPolicy')`,
|
|
147
173
|
* which resolves the mounted namespace service without the inject gate. */
|
|
148
174
|
declare const inject: string[];
|
|
149
|
-
/** Register the
|
|
175
|
+
/** Register the 能力管理 section once `settings.section` is on the ledger. */
|
|
150
176
|
declare function apply(ctx: ClientContext): Promise<() => void>;
|
|
151
177
|
//#endregion
|
|
152
178
|
export { type CapabilityKey, type CapabilityPolicyRemote, type CapabilityRow, type CapabilitySectionInjected, type CapabilitySectionProps, type CapabilitySnapshot, apply, inject };
|
package/lib/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","names":[],"sources":["../src/client/store.ts","../src/client/CapabilitySection.tsx","../src/client/index.ts"],"mappings":";;;;;;;;;;;;;;;;UAWiB;WACN;WACA;WACA;WACA
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../src/client/store.ts","../src/client/CapabilitySection.tsx","../src/client/index.ts"],"mappings":";;;;;;;;;;;;;;;;UAWiB;WACN;WACA;WACA;;WAEA;;WAEA;WACA;;WAEA;WACA;;;UAIM;WACN,eAAe;;;UAIT;WACN;WACA;;;UAIM;WACN;WACA;WACA;WACA;WACA;WACA;WACA,YAAY;WACZ,SAAS;WACT;aAAmB;aAA2B;aAA8B;aAAwB;;WACpG;WACA;aACE;aACA;aACA;aACA;aACA;;;;UAKI;;WAEN;;WAEA;aAAqB;aAAuB;;;WAE5C;;;UAIM;EACf,aAAa;IAAU;IAAU,OAAO;;IAA8B;IAAW;MAAS;MAAc;;;EACxG,aAAa,SAAS,0BAA0B;IAAU;IAAU;;IAAkB;IAAW;MAAS;MAAc;;;EACxH,eAAe;IAAU;IAAU,OAAO;;IAAsB;IAAW;MAAS;MAAc;;;EAClG,aAAa,YAAY,mBAAmB;IAAU;IAAU,OAAO;;IAAmC;IAAW;MAAS;MAAc;;;EAC5I,cAAc,YAAY,kBAAkB;IAAU;IAAU;;IAAgC;IAAW;MAAS;MAAc;;;EAClI,UAAU,aAAa;IAAU;IAAU,OAAO;;IAA6B;IAAW;MAAS;MAAc;;;EACjH,kBAAkB;IAAU;IAAU,OAAO;;IAAkB;IAAW;MAAS;MAAc;;;;;;;UChDlF;EACf,QAAQ;EACR,EAAE,KAAK,eAAe,SAAS;;EAE/B;;EAEA;;KAGU,yBAAyB;KAEzB;;;;YCdA;;IAER,uBAAuB,OAAO;;;;;;;cAQrB;;iBAGS,MAAM,KAAK,gBAAgB"}
|