@sparkelf/dsh-client-ui-skill-center 0.2.0-rc.9
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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +71 -0
- package/README.zh.md +78 -0
- package/lib/client.js +613 -0
- package/lib/index.js +396 -0
- package/lib/types/client/SkillCenterPage.d.ts +23 -0
- package/lib/types/client/SkillCenterPanelIcon.d.ts +17 -0
- package/lib/types/client/api.d.ts +75 -0
- package/lib/types/client/index.d.ts +29 -0
- package/lib/types/client/locales.d.ts +43 -0
- package/lib/types/index.d.ts +155 -0
- package/package.json +65 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { WebRoute } from '@deepseek-ai/dsh-host-webserver';
|
|
3
|
+
import type { SkillSummary } from '@deepseek-ai/dsh-skill';
|
|
4
|
+
/** Stable cordis plugin name. */
|
|
5
|
+
export declare const name = "ui-skill-center";
|
|
6
|
+
/** Services required before the routes can mount. */
|
|
7
|
+
export declare const inject: string[];
|
|
8
|
+
/** Route paths, mirrored by the browser half. */
|
|
9
|
+
export declare const ROUTES: {
|
|
10
|
+
readonly list: "/api/dsh-skill-center/list";
|
|
11
|
+
readonly setEnabled: "/api/dsh-skill-center/set-enabled";
|
|
12
|
+
readonly create: "/api/dsh-skill-center/create";
|
|
13
|
+
readonly delete: "/api/dsh-skill-center/delete";
|
|
14
|
+
readonly health: "/api/dsh-skill-center/health";
|
|
15
|
+
};
|
|
16
|
+
/** Plugin configuration. */
|
|
17
|
+
export interface Config {
|
|
18
|
+
/** Extra custom skill root directories. */
|
|
19
|
+
customSkillDirs?: string[];
|
|
20
|
+
/** User dsh config root; defaults to `$DSH_HOME` or `~/.dsh`. */
|
|
21
|
+
dshHome?: string;
|
|
22
|
+
/** User agents config root; defaults to `$DSH_AGENTS_HOME` or `~/.agents`. */
|
|
23
|
+
agentsHome?: string;
|
|
24
|
+
}
|
|
25
|
+
/** A skill row as the panel receives it. */
|
|
26
|
+
export interface SkillEntry {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
whenToUse?: string;
|
|
30
|
+
provider?: string;
|
|
31
|
+
level: string;
|
|
32
|
+
path?: string;
|
|
33
|
+
/** True when the skill resolves through a symlink; deletion is refused. */
|
|
34
|
+
linked?: boolean;
|
|
35
|
+
modelInvocable: boolean;
|
|
36
|
+
userInvocable: boolean;
|
|
37
|
+
workspaceRoot?: string;
|
|
38
|
+
workspaceName?: string;
|
|
39
|
+
isActiveWorkspace?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** One rendered group. */
|
|
42
|
+
export interface GroupPayload {
|
|
43
|
+
key: string;
|
|
44
|
+
title: string;
|
|
45
|
+
hint: string;
|
|
46
|
+
skills: SkillEntry[];
|
|
47
|
+
}
|
|
48
|
+
/** One selectable workspace. */
|
|
49
|
+
export interface WorkspaceItem {
|
|
50
|
+
root: string;
|
|
51
|
+
name: string;
|
|
52
|
+
active: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** The list route's payload. */
|
|
55
|
+
export interface ListPayload {
|
|
56
|
+
cwd: string;
|
|
57
|
+
projectRoots: string[];
|
|
58
|
+
complete: boolean;
|
|
59
|
+
groups: GroupPayload[];
|
|
60
|
+
workspaces?: WorkspaceItem[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The user skill root convention.
|
|
64
|
+
* @param dshHome - the user's dsh config root, usually `~/.dsh`.
|
|
65
|
+
* @returns the directory holding user-level skills.
|
|
66
|
+
*/
|
|
67
|
+
export declare function userSkillRoot(dshHome: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* The project skill root convention.
|
|
70
|
+
* @param projectRoot - the project's root directory.
|
|
71
|
+
* @returns the directory holding that project's skills.
|
|
72
|
+
*/
|
|
73
|
+
export declare function projectSkillRoot(projectRoot: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* The nearest ancestor holding a `.git` entry.
|
|
76
|
+
* @param cwd - the directory to search upward from.
|
|
77
|
+
* @returns the project root, or `cwd` itself when no ancestor holds `.git`.
|
|
78
|
+
*/
|
|
79
|
+
export declare function findProjectRoot(cwd: string): string;
|
|
80
|
+
/**
|
|
81
|
+
* The display group a skill belongs to.
|
|
82
|
+
*
|
|
83
|
+
* The registry summary reports a discovery source rather than a file path, so
|
|
84
|
+
* grouping follows the source name the filesystem provider assigns to each root
|
|
85
|
+
* it scans. An unrecognized source falls through to the custom group.
|
|
86
|
+
* @param source - the registry's discovery source label.
|
|
87
|
+
* @param provider - the provider that owns the skill body.
|
|
88
|
+
* @returns the group key.
|
|
89
|
+
*/
|
|
90
|
+
export declare function levelOfSource(source: string, provider: string): string;
|
|
91
|
+
/**
|
|
92
|
+
* Read `disable-model-invocation` from a skill file.
|
|
93
|
+
* @param source - the skill file's content.
|
|
94
|
+
* @returns the flag when the frontmatter declares it, otherwise undefined.
|
|
95
|
+
*/
|
|
96
|
+
export declare function readDisabledFlag(source: string): boolean | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Rewrite `disable-model-invocation`, adding it when absent.
|
|
99
|
+
*
|
|
100
|
+
* The field is one YAML scalar in the leading frontmatter block, so this edits
|
|
101
|
+
* that line rather than re-serializing the document: comments, key order, and
|
|
102
|
+
* the body all survive unchanged.
|
|
103
|
+
* @param source - the skill file's current content.
|
|
104
|
+
* @param disabled - the value to write.
|
|
105
|
+
* @returns the new content.
|
|
106
|
+
*/
|
|
107
|
+
export declare function withDisabledFlag(source: string, disabled: boolean): string;
|
|
108
|
+
/**
|
|
109
|
+
* Build the SKILL.md a create writes.
|
|
110
|
+
* @param name - the skill's kebab-case name.
|
|
111
|
+
* @param description - the routing description.
|
|
112
|
+
* @param whenToUse - extra routing guidance, omitted when undefined.
|
|
113
|
+
* @param content - the instruction body; an empty value yields a heading.
|
|
114
|
+
* @returns the complete file content.
|
|
115
|
+
*/
|
|
116
|
+
export declare function buildSkillContent(name: string, description: string, whenToUse: string | undefined, content: string): string;
|
|
117
|
+
/** The routes' dependencies, injectable for tests. */
|
|
118
|
+
export interface SkillRoutesDeps {
|
|
119
|
+
dshHome: string;
|
|
120
|
+
agentsHome: string;
|
|
121
|
+
customSkillDirs: string[];
|
|
122
|
+
/** The official registry's summaries for a workspace, already bound to the viewing context. */
|
|
123
|
+
snapshotProject(cwd: string): Promise<{
|
|
124
|
+
skills: SkillSummary[];
|
|
125
|
+
complete: boolean;
|
|
126
|
+
}>;
|
|
127
|
+
/**
|
|
128
|
+
* One skill's absolute file path, or undefined when it has none.
|
|
129
|
+
*
|
|
130
|
+
* The registry's summaries deliberately omit the path — they are
|
|
131
|
+
* invocation-neutral metadata — so the write routes resolve it through
|
|
132
|
+
* `get()` when an action actually needs to touch a file. `collect()` caches
|
|
133
|
+
* the catalog these calls share, so the resolve is not a second scan.
|
|
134
|
+
*/
|
|
135
|
+
pathOf(name: string, cwd: string): Promise<string | undefined>;
|
|
136
|
+
activeSessionCwds(): string[];
|
|
137
|
+
logger: {
|
|
138
|
+
warn(error: unknown): void;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/** The registry summary this route family reads, re-exported for its callers. */
|
|
142
|
+
export type { SkillSummary };
|
|
143
|
+
/**
|
|
144
|
+
* Build the skill-center routes.
|
|
145
|
+
* @param deps - resolved roots, the registry snapshot, and the session list.
|
|
146
|
+
* @returns the routes for `ctx.webServer.register`.
|
|
147
|
+
*/
|
|
148
|
+
export declare function makeRoutes(deps: SkillRoutesDeps): WebRoute[];
|
|
149
|
+
/**
|
|
150
|
+
* Mount the skill-center routes.
|
|
151
|
+
* @param ctx - host context carrying `webServer`, `skills`, and `sessions`.
|
|
152
|
+
* @param config - resolved plugin config.
|
|
153
|
+
*/
|
|
154
|
+
export declare function apply(ctx: Context, config?: Config): void;
|
|
155
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Skill center for the dsh web client: browses loaded skills grouped by source, enables or disables model invocation, creates skills, and deletes them into a recoverable trash",
|
|
3
|
+
"devDependencies": {
|
|
4
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
5
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.6-alpha.1",
|
|
6
|
+
"@deepseek-ai/dsh-client-ui-layout": "^0.1.6-alpha.1",
|
|
7
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.6-alpha.1",
|
|
8
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.1",
|
|
9
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "^0.1.6-alpha.1",
|
|
10
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.1",
|
|
11
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.6-alpha.1",
|
|
12
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
|
|
13
|
+
"@deepseek-ai/dsh-skill": "^0.1.6-alpha.1",
|
|
14
|
+
"@types/react": "~18.3.1",
|
|
15
|
+
"@types/react-dom": "~18.3.0",
|
|
16
|
+
"react": "^18.2.0",
|
|
17
|
+
"react-dom": "^18.2.0"
|
|
18
|
+
},
|
|
19
|
+
"dsh": {
|
|
20
|
+
"client": {
|
|
21
|
+
"inject": [
|
|
22
|
+
"@deepseek-ai/dsh-client-locale",
|
|
23
|
+
"@deepseek-ai/dsh-client-ui-renderer"
|
|
24
|
+
],
|
|
25
|
+
"platform": "web"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"default": "./lib/index.js",
|
|
31
|
+
"types": "./lib/types/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./client": {
|
|
34
|
+
"default": "./lib/client.js",
|
|
35
|
+
"types": "./lib/types/client/index.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"lib/index.js",
|
|
41
|
+
"lib/client.js",
|
|
42
|
+
"lib/types/**/*.d.ts"
|
|
43
|
+
],
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"main": "lib/index.js",
|
|
46
|
+
"name": "@sparkelf/dsh-client-ui-skill-center",
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@deepseek-ai/cordis": ">=4.0.1"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"directory": "packages/plus/ui-skill-center",
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"bundle": "tsdown",
|
|
60
|
+
"watch": "tsdown --watch"
|
|
61
|
+
},
|
|
62
|
+
"type": "module",
|
|
63
|
+
"types": "lib/types/index.d.ts",
|
|
64
|
+
"version": "0.2.0-rc.9"
|
|
65
|
+
}
|