dsh-plugin-capabilities 0.1.4 → 0.1.6
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.md +4 -2
- package/lib/client.js +119 -24
- package/lib/client.js.map +4 -4
- package/lib/index.js +11 -2
- package/lib/index.js.map +4 -4
- package/package.json +2 -1
- package/skills/find-skills/LICENSE +21 -0
- package/skills/find-skills/SKILL.md +141 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/SKILL.md +485 -0
- package/skills/skill-creator/agents/analyzer.md +274 -0
- package/skills/skill-creator/agents/comparator.md +202 -0
- package/skills/skill-creator/agents/grader.md +223 -0
- package/skills/skill-creator/assets/eval_review.html +146 -0
- package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/skill-creator/references/schemas.md +430 -0
- package/skills/skill-creator/scripts/__init__.py +0 -0
- package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/skill-creator/scripts/generate_report.py +326 -0
- package/skills/skill-creator/scripts/improve_description.py +247 -0
- package/skills/skill-creator/scripts/package_skill.py +136 -0
- package/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/skills/skill-creator/scripts/run_eval.py +310 -0
- package/skills/skill-creator/scripts/run_loop.py +328 -0
- package/skills/skill-creator/scripts/utils.py +47 -0
- package/src/client/CapabilitiesSection.tsx +102 -0
- package/src/client/McpTab.tsx +2 -0
- package/src/client/SkillsTab.tsx +2 -0
- package/src/client/css.ts +16 -2
- package/src/client/index.ts +15 -22
- package/src/client/locales.ts +2 -0
- package/src/index.ts +22 -6
- package/src/packaged-skills.test.ts +40 -0
- package/src/smoke.test.ts +8 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Guards for the vendored skills shipped in the package: every directory
|
|
2
|
+
* under skills/ must be a loadable skill for dsh's filesystem scanner —
|
|
3
|
+
* SKILL.md present, frontmatter name matching the directory (the scanner
|
|
4
|
+
* dedupes/keys by it), description non-empty, name grammar valid — and carry
|
|
5
|
+
* its license so redistribution stays compliant. */
|
|
6
|
+
|
|
7
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs'
|
|
8
|
+
import { join } from 'node:path'
|
|
9
|
+
import { describe, expect, it } from 'vitest'
|
|
10
|
+
import { parse } from 'yaml'
|
|
11
|
+
import { packagedSkillsDir } from './index.ts'
|
|
12
|
+
|
|
13
|
+
const SKILL_NAME = /^[a-z0-9]+(-[a-z0-9]+)*$/
|
|
14
|
+
|
|
15
|
+
function readFrontmatter(path: string): { name?: unknown; description?: unknown } {
|
|
16
|
+
const raw = readFileSync(path, 'utf8')
|
|
17
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---/.exec(raw)
|
|
18
|
+
expect(match, `${path} has YAML frontmatter`).toBeDefined()
|
|
19
|
+
return parse(match![1]!) as { name?: unknown; description?: unknown }
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
describe('packaged skills', () => {
|
|
23
|
+
it('ships the two vendored skills with licenses', () => {
|
|
24
|
+
expect(readdirSync(packagedSkillsDir(), { withFileTypes: true })
|
|
25
|
+
.filter(entry => entry.isDirectory()).map(entry => entry.name).sort())
|
|
26
|
+
.toEqual(['find-skills', 'skill-creator'])
|
|
27
|
+
expect(existsSync(join(packagedSkillsDir(), 'skill-creator', 'LICENSE.txt'))).toBe(true)
|
|
28
|
+
expect(existsSync(join(packagedSkillsDir(), 'find-skills', 'LICENSE'))).toBe(true)
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('keeps every skill directory loadable by the scanner', () => {
|
|
32
|
+
for (const name of ['find-skills', 'skill-creator']) {
|
|
33
|
+
const frontmatter = readFrontmatter(join(packagedSkillsDir(), name, 'SKILL.md'))
|
|
34
|
+
expect(frontmatter.name, `${name} frontmatter name`).toBe(name)
|
|
35
|
+
expect(SKILL_NAME.test(String(frontmatter.name)), `${name} name grammar`).toBe(true)
|
|
36
|
+
expect(typeof frontmatter.description).toBe('string')
|
|
37
|
+
expect(String(frontmatter.description).length).toBeGreaterThan(0)
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
})
|
package/src/smoke.test.ts
CHANGED
|
@@ -105,11 +105,18 @@ describe.skipIf(process.env.DSH_DESKTOP_PLUGIN_SMOKE !== '1' || !guard || !nodeO
|
|
|
105
105
|
const post = (path: string, body: unknown): Promise<Response> =>
|
|
106
106
|
fetch(base + path, { method: 'POST', headers: origin, body: JSON.stringify(body) })
|
|
107
107
|
|
|
108
|
-
// 3. Skills list serves the catalog with the editable flag
|
|
108
|
+
// 3. Skills list serves the catalog with the editable flag — including the
|
|
109
|
+
// package's vendored skills, which arrive read-only from the custom root.
|
|
109
110
|
const skillsResponse = await fetch(`${base}/dsh-plugin-capabilities/skills`)
|
|
110
111
|
expect(skillsResponse.status).toBe(200)
|
|
111
112
|
const skillsBody = await skillsResponse.json() as { skills?: Array<{ name: string; source: string; editable: boolean }> }
|
|
112
113
|
expect(Array.isArray(skillsBody.skills)).toBe(true)
|
|
114
|
+
for (const vendored of ['skill-creator', 'find-skills']) {
|
|
115
|
+
const row = skillsBody.skills?.find(skill => skill.name === vendored)
|
|
116
|
+
expect(row, `${vendored} in catalog`).toBeDefined()
|
|
117
|
+
expect(row?.editable).toBe(false)
|
|
118
|
+
expect(row?.source).toBe('custom')
|
|
119
|
+
}
|
|
113
120
|
|
|
114
121
|
// 4. Write a user skill; the watched root picks it up into the catalog.
|
|
115
122
|
const save = await post('/dsh-plugin-capabilities/skill/save', {
|