dsh-skills-studio 0.1.2 → 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.
- package/CONTRACT.md +10 -10
- package/README.md +16 -16
- package/client.js +4 -4
- package/cordis.patch.yml +1 -1
- package/index.js +8 -8
- package/package.json +4 -4
- package/src/api.js +4 -4
- package/src/config.js +1 -1
- package/src/frontmatter.js +1 -1
- package/src/mutate.js +1 -1
- package/src/roots.js +1 -1
- package/src/scan.js +1 -1
- package/src/validate.js +1 -1
package/CONTRACT.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# dsh-skills-
|
|
1
|
+
# dsh-skills-studio — build contract (v1)
|
|
2
2
|
|
|
3
3
|
A DSH bundle that adds a **Skills** page to Settings: install/edit skills on disk, see
|
|
4
4
|
what agents can actually load, and block conflicting saves before they happen.
|
|
@@ -28,7 +28,7 @@ No server-side model calls, no shell execution, no network.
|
|
|
28
28
|
## Package layout and ownership
|
|
29
29
|
|
|
30
30
|
```
|
|
31
|
-
dsh-skills-
|
|
31
|
+
dsh-skills-studio/
|
|
32
32
|
package.json Lead
|
|
33
33
|
cordis.patch.yml Lead
|
|
34
34
|
icon.svg Lead
|
|
@@ -58,7 +58,7 @@ api-dev's. The Lead owns the manifest files and integration.
|
|
|
58
58
|
- Client services: `ctx.get('slots')` (required-ish), `ctx.get('locale')` (optional),
|
|
59
59
|
`ctx.get('sessions')` (optional). Reading a service not listed in `inject` throws, so use
|
|
60
60
|
`ctx.get()` for everything optional and never `ctx.locale` directly.
|
|
61
|
-
- Host web routes: `ctx.webServer.register({ kind: 'prefix', path: '/skills-
|
|
61
|
+
- Host web routes: `ctx.webServer.register({ kind: 'prefix', path: '/skills-studio', handler(req, res) })`
|
|
62
62
|
inside `ctx.effect(() => …)`.
|
|
63
63
|
- Host plugin entry: named `export const name`, `export const inject = ['webServer']`,
|
|
64
64
|
`export function apply(ctx, config = {})`. Read optional services with `ctx.get('skills')`.
|
|
@@ -115,12 +115,12 @@ when missing). Project roots need a `cwd`; without one, skip them.
|
|
|
115
115
|
|
|
116
116
|
## HTTP API
|
|
117
117
|
|
|
118
|
-
Prefix `/skills-
|
|
118
|
+
Prefix `/skills-studio`, JSON only, `cache-control: no-store`, body cap 1 MiB.
|
|
119
119
|
Success envelope `{ ok: true, ... }`. Failure:
|
|
120
120
|
`{ ok: false, error: { code, message, details? } }` with status 400/404/405/413/422/409/500.
|
|
121
121
|
Validation responses additionally carry `{ errors, conflicts, warnings }` (see below).
|
|
122
122
|
|
|
123
|
-
### GET `/skills-
|
|
123
|
+
### GET `/skills-studio/api/state?cwd=<abs path>`
|
|
124
124
|
|
|
125
125
|
```json
|
|
126
126
|
{
|
|
@@ -201,12 +201,12 @@ Rules:
|
|
|
201
201
|
alphanumeric words length > 2 minus stop words. Jaccard ≥ 0.5 against another skill →
|
|
202
202
|
warning carrying `sharedWords`. Deduplicate per pair; cap at 5 warnings.
|
|
203
203
|
|
|
204
|
-
### GET `/skills-
|
|
204
|
+
### GET `/skills-studio/api/skill?rootId=<id>&relPath=<path>`
|
|
205
205
|
|
|
206
206
|
→ `{ ok: true, root: Root, skill: { …entry, content: "full file text" } }`.
|
|
207
207
|
404 `not-found` when `rootId`/`relPath` does not name a scanned entry.
|
|
208
208
|
|
|
209
|
-
### POST `/skills-
|
|
209
|
+
### POST `/skills-studio/api/validate` and `POST /skills-studio/api/save`
|
|
210
210
|
|
|
211
211
|
Body (action `create`):
|
|
212
212
|
|
|
@@ -269,7 +269,7 @@ user-invocable: false # only when userInvocable === false
|
|
|
269
269
|
<body trimmed of trailing whitespace>
|
|
270
270
|
```
|
|
271
271
|
|
|
272
|
-
### POST `/skills-
|
|
272
|
+
### POST `/skills-studio/api/delete`
|
|
273
273
|
|
|
274
274
|
`{ "rootId": "user-agents", "relPath": "my-skill/SKILL.md", "expectedSha256": "…" }`
|
|
275
275
|
→ `{ ok:true, removed: { rootId, relPath, name }, registry: { checked, visible:false, catalogCount, waitedMs } }`.
|
|
@@ -279,7 +279,7 @@ is a symlink, or when the bundle directory contains something other than `SKILL.
|
|
|
279
279
|
regular resource files under the bundle (still allowed: `references/`, `scripts/`, `assets/`,
|
|
280
280
|
any regular files/dirs inside that bundle — just never outside it).
|
|
281
281
|
|
|
282
|
-
### POST `/skills-
|
|
282
|
+
### POST `/skills-studio/api/install`
|
|
283
283
|
|
|
284
284
|
`{ "libraryId": "deepseek-stack", "relPath": "ds-plan-loop/SKILL.md", "overwrite": false,
|
|
285
285
|
"expectedSha256": "…", "force": false }`
|
|
@@ -312,7 +312,7 @@ any regular files/dirs inside that bundle — just never outside it).
|
|
|
312
312
|
("Skills"), locale namespace `settings.skills` when `ctx.get('locale')` exists.
|
|
313
313
|
- `inject = ['slots']`; everything else via `ctx.get()`. Never throw from `apply` or from a
|
|
314
314
|
render when an optional service is missing.
|
|
315
|
-
- Fetch `GET /skills-
|
|
315
|
+
- Fetch `GET /skills-studio/api/state` on mount, after every mutation, and on manual
|
|
316
316
|
refresh. Same-origin `fetch(url, { credentials: 'same-origin' })`.
|
|
317
317
|
- Layout (translated from the active moodboard language into the DSH settings shell):
|
|
318
318
|
a compact hero row (title from the shell already; use a one-line subtitle), a stat strip
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# dsh-skills-
|
|
1
|
+
# dsh-skills-studio
|
|
2
2
|
|
|
3
|
-
[](https://github.com/Stijnus/dsh-skills-studio/actions/workflows/test.yml) [](https://www.npmjs.com/package/dsh-skills-studio)
|
|
4
4
|
|
|
5
|
-
A **Skills** page for DeepSeek Harness Settings: see every installed agent skill, see what
|
|
5
|
+
A **Skills** page for DeepSeek Harness Settings (formerly known as `dsh-skills-manager`; GitHub redirects): see every installed agent skill, see what
|
|
6
6
|
the registry actually serves to agents, add or edit skills on disk, and block conflicting
|
|
7
7
|
saves before they happen.
|
|
8
8
|
|
|
@@ -66,19 +66,19 @@ directory; the raw evidence and harnesses are described in
|
|
|
66
66
|
dsh plugin --profile <profile> add dsh-skills-studio
|
|
67
67
|
|
|
68
68
|
# pin a version
|
|
69
|
-
dsh plugin --profile <profile> add dsh-skills-studio@0.1.
|
|
69
|
+
dsh plugin --profile <profile> add dsh-skills-studio@0.1.3
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
The project is called **dsh-skills-
|
|
73
|
-
the unscoped `dsh-skills-
|
|
72
|
+
The project is called **dsh-skills-studio**, but its npm package is **`dsh-skills-studio`**:
|
|
73
|
+
the unscoped `dsh-skills-studio` name belongs to an unrelated third-party plugin, and the
|
|
74
74
|
previous `@stijnus/...` scope has been retired. GitHub and local-link installs remain
|
|
75
75
|
available below.
|
|
76
76
|
|
|
77
77
|
### Local development (web profile, isolated)
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
|
-
git clone https://github.com/Stijnus/dsh-skills-
|
|
81
|
-
cd dsh-skills-
|
|
80
|
+
git clone https://github.com/Stijnus/dsh-skills-studio.git
|
|
81
|
+
cd dsh-skills-studio
|
|
82
82
|
DSH_HOME=/tmp/dsh-skills-dev dsh plugin --profile web add link:$PWD
|
|
83
83
|
DSH_HOME=/tmp/dsh-skills-dev dsh --profile web --port 53999 --no-open
|
|
84
84
|
```
|
|
@@ -87,23 +87,23 @@ Or install straight from this repository into an existing profile:
|
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
89
|
# latest main
|
|
90
|
-
dsh plugin --profile <profile> add github:Stijnus/dsh-skills-
|
|
90
|
+
dsh plugin --profile <profile> add github:Stijnus/dsh-skills-studio
|
|
91
91
|
|
|
92
92
|
# pin a released version (recommended for stable installs) — see the Releases page
|
|
93
|
-
dsh plugin --profile <profile> add github:Stijnus/dsh-skills-
|
|
93
|
+
dsh plugin --profile <profile> add github:Stijnus/dsh-skills-studio#v0.1.3
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
Releases are tagged `vX.Y.Z` ([Releases](https://github.com/Stijnus/dsh-skills-
|
|
96
|
+
Releases are tagged `vX.Y.Z` ([Releases](https://github.com/Stijnus/dsh-skills-studio/releases)). To upgrade, install the newer tag the same way; a profile reload applies it (HMR picks it up when enabled).
|
|
97
97
|
|
|
98
98
|
> **npm name note:** the package is published as `dsh-skills-studio` because the plain
|
|
99
|
-
> `dsh-skills-
|
|
99
|
+
> `dsh-skills-studio` name on npm belongs to an unrelated third-party plugin. The GitHub/link
|
|
100
100
|
> forms above are fallbacks for development checkouts.
|
|
101
101
|
|
|
102
102
|
Overlay config for an isolated run (agents home, writable root and libraries):
|
|
103
103
|
|
|
104
104
|
```yaml
|
|
105
|
-
# skills-
|
|
106
|
-
- id: skills-
|
|
105
|
+
# skills-studio.overlay.yml — pass with --patch
|
|
106
|
+
- id: skills-studio
|
|
107
107
|
config:
|
|
108
108
|
agentsHome: /tmp/dsh-skills-dev/agents
|
|
109
109
|
writableRoot: /tmp/dsh-skills-dev/managed-skills
|
|
@@ -124,7 +124,7 @@ shell performs the package operation and recomposes the app). After installation
|
|
|
124
124
|
reports `restart-required`.
|
|
125
125
|
|
|
126
126
|
The current live install on this machine uses the hand-managed profile path instead: a
|
|
127
|
-
`node_modules/dsh-skills-
|
|
127
|
+
`node_modules/dsh-skills-studio` symlink plus a profile-patch row (see
|
|
128
128
|
[SKILLS-VERIFICATION.md](SKILLS-VERIFICATION.md) §4). DSH's profile HMR loads both halves
|
|
129
129
|
into the running app without a restart. Durability caveat: because the profile
|
|
130
130
|
`package.json` does not declare the package, a later plugin-manager / pnpm operation can
|
|
@@ -155,7 +155,7 @@ separate library entry.
|
|
|
155
155
|
|
|
156
156
|
## HTTP API (host half, same origin)
|
|
157
157
|
|
|
158
|
-
Prefix `/skills-
|
|
158
|
+
Prefix `/skills-studio/api`, JSON, `cache-control: no-store`.
|
|
159
159
|
|
|
160
160
|
| Method + path | Purpose |
|
|
161
161
|
|---|---|
|
package/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// dsh-skills-
|
|
1
|
+
// dsh-skills-studio browser client half — hand-written in the DeepSeek Harness
|
|
2
2
|
// ModuleLoader format (no bundler needed). Declared via package.json `dsh.client`
|
|
3
3
|
// and exported as `./client`; the harness serves this file and registers it.
|
|
4
4
|
//
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// - One <style> element injected via ctx.effect (classes prefixed dsm-, all
|
|
20
20
|
// selectors scoped under .dsm-root). Host theme tokens only; light and dark
|
|
21
21
|
// are both served by the tokens.
|
|
22
|
-
// - The API is same-origin fetch against `/skills-
|
|
22
|
+
// - The API is same-origin fetch against `/skills-studio` with
|
|
23
23
|
// credentials: 'same-origin'. Non-2xx JSON envelopes are parsed regardless of
|
|
24
24
|
// response.ok so validation errors/conflicts reach the form.
|
|
25
25
|
// - All visible copy (including aria labels) comes from the en/zh dictionaries.
|
|
@@ -32,12 +32,12 @@ window.__ModuleLoader__.load({
|
|
|
32
32
|
var React = require('react')
|
|
33
33
|
var h = React.createElement
|
|
34
34
|
|
|
35
|
-
var name = 'skills-
|
|
35
|
+
var name = 'skills-studio-client'
|
|
36
36
|
var inject = ['slots']
|
|
37
37
|
// The settings locale namespace. Declared on the slot registration only when
|
|
38
38
|
// the host installed a locale face; the dictionaries are registered there too.
|
|
39
39
|
var NS = 'settings.skills'
|
|
40
|
-
var API_BASE = '/skills-
|
|
40
|
+
var API_BASE = '/skills-studio'
|
|
41
41
|
var STYLE_ID = 'dsm-styles'
|
|
42
42
|
var VALIDATE_DEBOUNCE_MS = 350
|
|
43
43
|
var NAME_MAX = 64
|
package/cordis.patch.yml
CHANGED
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* dsh-skills-
|
|
2
|
+
* dsh-skills-studio — host plugin entry.
|
|
3
3
|
*
|
|
4
|
-
* Registers one `webServer` prefix route (`/skills-
|
|
4
|
+
* Registers one `webServer` prefix route (`/skills-studio`) that backs the
|
|
5
5
|
* Skills settings page: scan the local skill roots, validate drafts, write
|
|
6
6
|
* `SKILL.md` files atomically under the configured writable root, and report
|
|
7
7
|
* whether the live registry now serves the skill.
|
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
* request time, so the plugin also works in profiles without a skill registry
|
|
11
11
|
* (the page then shows the catalog as unavailable instead of failing).
|
|
12
12
|
*
|
|
13
|
-
* @module dsh-skills-
|
|
13
|
+
* @module dsh-skills-studio
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { createApi, API_PREFIX } from './src/api.js'
|
|
17
17
|
import { normalizeConfig } from './src/config.js'
|
|
18
18
|
|
|
19
19
|
/** Cordis plugin name. */
|
|
20
|
-
export const name = 'skills-
|
|
20
|
+
export const name = 'skills-studio'
|
|
21
21
|
|
|
22
22
|
/** The web server is the one required service; anything else is read optionally. */
|
|
23
23
|
export const inject = ['webServer']
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Register the `/skills-
|
|
26
|
+
* Register the `/skills-studio` route. Config is validated here, at load time,
|
|
27
27
|
* so a malformed plugin row fails loudly instead of at the first request.
|
|
28
28
|
*
|
|
29
29
|
* @param {object} ctx host context exposing `webServer` (required) plus
|
|
@@ -37,7 +37,7 @@ export function apply(ctx, config = {}) {
|
|
|
37
37
|
|
|
38
38
|
if (ctx === undefined || ctx === null || ctx.webServer === undefined || typeof ctx.webServer.register !== 'function') {
|
|
39
39
|
throw new TypeError(
|
|
40
|
-
'skills-
|
|
40
|
+
'skills-studio: ctx.webServer is unavailable; mount @deepseek-ai/dsh-host-webserver in this profile.',
|
|
41
41
|
)
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -49,14 +49,14 @@ export function apply(ctx, config = {}) {
|
|
|
49
49
|
if (typeof ctx.effect === 'function') {
|
|
50
50
|
// Route ownership lives with this plugin's fiber: disposing the plugin
|
|
51
51
|
// removes the route through the returned disposer.
|
|
52
|
-
ctx.effect(register, 'skills-
|
|
52
|
+
ctx.effect(register, 'skills-studio: /skills-studio routes')
|
|
53
53
|
} else {
|
|
54
54
|
register()
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
try {
|
|
58
58
|
ctx.logger?.info?.(
|
|
59
|
-
`skills-
|
|
59
|
+
`skills-studio: /skills-studio routes registered; writable root ${normalized.writableRoot}`,
|
|
60
60
|
)
|
|
61
61
|
} catch {
|
|
62
62
|
// A throwing logger must not take the plugin down.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-skills-studio",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Skills settings for DeepSeek Harness: install, add, edit, and validate agent skills on disk, see what the registry actually serves to agents, and block conflicting saves.",
|
|
6
6
|
"main": "index.js",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"author": "Stijnus",
|
|
54
54
|
"repository": {
|
|
55
55
|
"type": "git",
|
|
56
|
-
"url": "git+https://github.com/Stijnus/dsh-skills-
|
|
56
|
+
"url": "git+https://github.com/Stijnus/dsh-skills-studio.git"
|
|
57
57
|
},
|
|
58
|
-
"homepage": "https://github.com/Stijnus/dsh-skills-
|
|
58
|
+
"homepage": "https://github.com/Stijnus/dsh-skills-studio#readme",
|
|
59
59
|
"bugs": {
|
|
60
|
-
"url": "https://github.com/Stijnus/dsh-skills-
|
|
60
|
+
"url": "https://github.com/Stijnus/dsh-skills-studio/issues"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"test": "node --test",
|
package/src/api.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* HTTP API for the Skills manager: JSON envelope, route dispatch, body cap,
|
|
3
3
|
* optimistic-sha mutations, and the post-write registry visibility probe.
|
|
4
4
|
*
|
|
5
|
-
* Routes are mounted under the `/skills-
|
|
5
|
+
* Routes are mounted under the `/skills-studio` prefix registered by
|
|
6
6
|
* `index.js`; the paths below are absolute so the handler can also be driven
|
|
7
7
|
* directly in tests. The handler never throws: every failure becomes an
|
|
8
8
|
* `{ ok:false, error:{ code, message } }` envelope.
|
|
9
9
|
*
|
|
10
|
-
* @module dsh-skills-
|
|
10
|
+
* @module dsh-skills-studio/api
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { readFile } from 'node:fs/promises'
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
} from './validate.js'
|
|
40
40
|
|
|
41
41
|
/** URL prefix owned by this plugin (registered through `ctx.webServer`). */
|
|
42
|
-
export const API_PREFIX = '/skills-
|
|
42
|
+
export const API_PREFIX = '/skills-studio'
|
|
43
43
|
|
|
44
44
|
/** Request body cap; also the largest JSON body the handler will buffer. */
|
|
45
45
|
export const BODY_LIMIT_BYTES = 1024 * 1024
|
|
@@ -717,7 +717,7 @@ export function createApi(options) {
|
|
|
717
717
|
status: 200,
|
|
718
718
|
payload: {
|
|
719
719
|
ok: true,
|
|
720
|
-
name: 'dsh-skills-
|
|
720
|
+
name: 'dsh-skills-studio',
|
|
721
721
|
version: STATE_VERSION,
|
|
722
722
|
generatedAt: new Date().toISOString(),
|
|
723
723
|
writableRoot: config.writableRoot,
|
package/src/config.js
CHANGED
package/src/frontmatter.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* strings for text fields, invocation booleans only when disabled, and no
|
|
13
13
|
* empty `whenToUse` key.
|
|
14
14
|
*
|
|
15
|
-
* @module dsh-skills-
|
|
15
|
+
* @module dsh-skills-studio/frontmatter
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
/** Raised for malformed or unsupported frontmatter. Message names the line. */
|
package/src/mutate.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* crash leaves either the old or the new file. All functions throw a
|
|
9
9
|
* `MutationError` with a stable `code` that the HTTP layer maps to a status.
|
|
10
10
|
*
|
|
11
|
-
* @module dsh-skills-
|
|
11
|
+
* @module dsh-skills-studio/mutate
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { randomBytes } from 'node:crypto'
|
package/src/roots.js
CHANGED
package/src/scan.js
CHANGED
package/src/validate.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* the conflicts a save would create. `detectConflicts` is the same name/alias/
|
|
8
8
|
* overlap analysis applied to the already-scanned installed set.
|
|
9
9
|
*
|
|
10
|
-
* @module dsh-skills-
|
|
10
|
+
* @module dsh-skills-studio/validate
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { lstat } from 'node:fs/promises'
|