dsh-plugin-guide 0.1.2 → 0.2.0
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.es.md +54 -3
- package/README.hi.md +54 -3
- package/README.md +55 -4
- package/README.pt.md +54 -3
- package/README.zh.md +55 -4
- package/SKILL.md +11 -1
- package/bin/dsh-plugin-dev.js +6 -0
- package/cordis.patch.yml +5 -0
- package/dist/dsh-plugin-dev.js +1623 -0
- package/package.json +39 -3
- package/scripts/verify-artifacts.mjs +70 -0
- package/templates/js/LICENSE +15 -0
- package/templates/js/README.es.md +42 -0
- package/templates/js/README.hi.md +42 -0
- package/templates/js/README.md +42 -0
- package/templates/js/README.pt.md +42 -0
- package/templates/js/README.zh.md +42 -0
- package/templates/js/cordis.patch.yml +10 -0
- package/templates/js/index.js +38 -0
- package/templates/js/package.json +35 -0
- package/templates/js/tests/index.test.js +12 -0
- package/templates/ts/LICENSE +15 -0
- package/templates/ts/README.es.md +44 -0
- package/templates/ts/README.hi.md +44 -0
- package/templates/ts/README.md +44 -0
- package/templates/ts/README.pt.md +44 -0
- package/templates/ts/README.zh.md +44 -0
- package/templates/ts/cordis.patch.yml +10 -0
- package/templates/ts/package.json +44 -0
- package/templates/ts/src/config.ts +12 -0
- package/templates/ts/src/index.ts +36 -0
- package/templates/ts/tests/index.test.ts +12 -0
- package/templates/ts/tsconfig.json +17 -0
- package/templates/ts/tsdown.config.mjs +15 -0
- package/templates/ts/vitest.config.ts +8 -0
package/package.json
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-guide",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "The dsh-plugin-guide knowledge base
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "The dsh-plugin-guide knowledge base plus the dsh-plugin-dev CLI toolchain: official docs, Cordis primer, community deep-dives, and battle-tested pitfalls registered as an on-demand agent skill, with a scaffolder, static checker, and pack verifier for building DSH plugins.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"dsh-plugin-dev": "./bin/dsh-plugin-dev.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./index.js",
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
7
14
|
"files": [
|
|
8
15
|
"index.js",
|
|
16
|
+
"bin",
|
|
17
|
+
"dist",
|
|
18
|
+
"templates",
|
|
9
19
|
"cordis.patch.yml",
|
|
10
20
|
"SKILL.md",
|
|
11
21
|
"guide",
|
|
@@ -26,13 +36,35 @@
|
|
|
26
36
|
"cordis",
|
|
27
37
|
"agent-skill",
|
|
28
38
|
"plugin-development",
|
|
29
|
-
"knowledge-base"
|
|
39
|
+
"knowledge-base",
|
|
40
|
+
"cli",
|
|
41
|
+
"scaffold",
|
|
42
|
+
"checker"
|
|
30
43
|
],
|
|
31
44
|
"license": "Apache-2.0",
|
|
32
45
|
"repository": {
|
|
33
46
|
"type": "git",
|
|
34
47
|
"url": "git+https://github.com/PerryLink/dsh-plugin-guide.git"
|
|
35
48
|
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsdown",
|
|
51
|
+
"typecheck": "tsc --noEmit",
|
|
52
|
+
"typecheck:ci": "tsc --noEmit --pretty false",
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"check:kit": "pwsh -File scripts/verify-kit.ps1",
|
|
55
|
+
"verify:artifacts": "node scripts/verify-artifacts.mjs",
|
|
56
|
+
"verify:self-contained": "pnpm run build && node dist/dsh-plugin-dev.js verify",
|
|
57
|
+
"prepare": "tsdown",
|
|
58
|
+
"prepack": "tsdown"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"tsdown": "^0.22.14",
|
|
62
|
+
"typescript": "^5.9.3"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@types/node": "^22.20.1",
|
|
66
|
+
"vitest": "^3.2.7"
|
|
67
|
+
},
|
|
36
68
|
"peerDependencies": {
|
|
37
69
|
"@deepseek-ai/dsh": ">=0.1.0-rc.8 <0.2.0"
|
|
38
70
|
},
|
|
@@ -46,6 +78,10 @@
|
|
|
46
78
|
"patch": "./cordis.patch.yml"
|
|
47
79
|
}
|
|
48
80
|
},
|
|
81
|
+
"engines": {
|
|
82
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
83
|
+
},
|
|
84
|
+
"packageManager": "pnpm@11.7.0",
|
|
49
85
|
"dshWorkshop": {
|
|
50
86
|
"schema": "omdsh-workshop-package/v1",
|
|
51
87
|
"type": "plugin",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Artifact gate for the dsh-plugin-guide CLI. Runs after `pnpm run build` and
|
|
2
|
+
// verifies the shipped surfaces without any network access:
|
|
3
|
+
// 1. the built CLI, bin shim, and template trees exist;
|
|
4
|
+
// 2. the CLI self-checks this repo (dogfood) and reports `ok: true`;
|
|
5
|
+
// 3. the scaffolder produces TS and JS skeletons inside a mkdtemp sandbox
|
|
6
|
+
// (never touching a real home directory), which are then removed.
|
|
7
|
+
import { spawnSync } from 'node:child_process'
|
|
8
|
+
import { existsSync, mkdtempSync, rmSync, readdirSync } from 'node:fs'
|
|
9
|
+
import { tmpdir } from 'node:os'
|
|
10
|
+
import { dirname, join, resolve } from 'node:path'
|
|
11
|
+
import { fileURLToPath } from 'node:url'
|
|
12
|
+
|
|
13
|
+
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
|
14
|
+
const failures = []
|
|
15
|
+
|
|
16
|
+
function check(condition, message) {
|
|
17
|
+
if (condition) {
|
|
18
|
+
console.log(`ok - ${message}`)
|
|
19
|
+
} else {
|
|
20
|
+
failures.push(message)
|
|
21
|
+
console.error(`FAIL - ${message}`)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function runNode(args, options = {}) {
|
|
26
|
+
return spawnSync(process.execPath, args, { cwd: root, encoding: 'utf8', ...options })
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 1. Shipped surfaces.
|
|
30
|
+
check(existsSync(join(root, 'dist', 'dsh-plugin-dev.js')), 'dist/dsh-plugin-dev.js exists (run pnpm run build first)')
|
|
31
|
+
check(existsSync(join(root, 'bin', 'dsh-plugin-dev.js')), 'bin/dsh-plugin-dev.js exists')
|
|
32
|
+
check(existsSync(join(root, 'templates', 'ts')), 'templates/ts exists')
|
|
33
|
+
check(existsSync(join(root, 'templates', 'js')), 'templates/js exists')
|
|
34
|
+
|
|
35
|
+
// 2. Version + dogfood self-check.
|
|
36
|
+
const version = runNode(['dist/dsh-plugin-dev.js', '--version'])
|
|
37
|
+
check(version.status === 0 && /\d+\.\d+\.\d+/.test(version.stdout.trim()), `--version prints a semver (${version.stdout.trim()})`)
|
|
38
|
+
|
|
39
|
+
const selfCheck = runNode(['dist/dsh-plugin-dev.js', 'check', '--json'], { stdio: ['ignore', 'pipe', 'pipe'] })
|
|
40
|
+
let ok = false
|
|
41
|
+
if (selfCheck.status === 0) {
|
|
42
|
+
try {
|
|
43
|
+
ok = JSON.parse(selfCheck.stdout).ok === true
|
|
44
|
+
} catch {
|
|
45
|
+
ok = false
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
check(selfCheck.status === 0 && ok, `self-check (dogfood) reports ok (exit ${selfCheck.status})`)
|
|
49
|
+
|
|
50
|
+
// 3. Scaffold smoke in a mkdtemp sandbox.
|
|
51
|
+
const sandbox = mkdtempSync(join(tmpdir(), 'dsh-pd-artifacts-'))
|
|
52
|
+
try {
|
|
53
|
+
for (const lang of ['ts', 'js']) {
|
|
54
|
+
const target = join(sandbox, lang, 'demo-plugin')
|
|
55
|
+
const result = runNode(['dist/dsh-plugin-dev.js', 'new', 'demo-plugin', '--lang', lang, '--dir', target])
|
|
56
|
+
const hasEntry = lang === 'ts' ? existsSync(join(target, 'src', 'index.ts')) : existsSync(join(target, 'index.js'))
|
|
57
|
+
const hasPatch = existsSync(join(target, 'cordis.patch.yml'))
|
|
58
|
+
const readmeCount = readdirSync(target).filter((f) => /^README(\.\w{2})?\.md$/.test(f)).length
|
|
59
|
+
check(result.status === 0 && hasEntry && hasPatch, `${lang} scaffold produces entry + cordis.patch.yml (exit ${result.status})`)
|
|
60
|
+
check(readmeCount === 5, `${lang} scaffold produces 5 README languages (${readmeCount})`)
|
|
61
|
+
}
|
|
62
|
+
} finally {
|
|
63
|
+
rmSync(sandbox, { recursive: true, force: true })
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (failures.length > 0) {
|
|
67
|
+
console.error(`\nverify:artifacts FAILED (${failures.length})`)
|
|
68
|
+
process.exit(1)
|
|
69
|
+
}
|
|
70
|
+
console.log('\nverify:artifacts OK')
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Apache License 2.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) {{year}} {{pkgName}} contributors
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# {{pkgName}}
|
|
2
|
+
|
|
3
|
+
Un plugin de DeepSeek Harness (DSH) generado con [`dsh-plugin-dev new`](https://github.com/PerryLink/dsh-plugin-guide).
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
| Superficie | Estado |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
10
|
+
| Node | `^22.19.0 || >=24.0.0` |
|
|
11
|
+
| Plataformas | Todas (ESM puro; sin código nativo, sin red) |
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
Registra la herramienta `{{name}}_echo`. Al llamarla responde `<greeting>: <text>`, donde `<greeting>` proviene de la configuración del plugin y `<text>` es el argumento.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm pack
|
|
21
|
+
dsh plugin --profile <name> add ./{{pkgName}}-{{version}}.tgz
|
|
22
|
+
dsh --profile <name> --dump-config | grep '{{pkgName}}'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
| Clave | Tipo | Valor por defecto | Descripción |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `greeting` | string | `Hello` | Prefijo de la respuesta echo |
|
|
30
|
+
|
|
31
|
+
La configuración se valida con el esquema Schemastery `Config` de `index.js`; ningún ajuste está codificado de forma fija.
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpm install
|
|
37
|
+
pnpm test
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
[Apache License 2.0](LICENSE) © {{year}} {{pkgName}} contributors.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# {{pkgName}}
|
|
2
|
+
|
|
3
|
+
[`dsh-plugin-dev new`](https://github.com/PerryLink/dsh-plugin-guide) से बनाया गया एक DeepSeek Harness (DSH) प्लगइन।
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
| सतह | स्थिति |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
10
|
+
| Node | `^22.19.0 || >=24.0.0` |
|
|
11
|
+
| प्लेटफ़ॉर्म | सभी (शुद्ध ESM; कोई नेटिव कोड नहीं, कोई नेटवर्क नहीं) |
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
`{{name}}_echo` टूल पंजीकृत करता है। इसे बुलाने पर `<greeting>: <text>` लौटाता है, जहाँ `<greeting>` प्लगइन कॉन्फ़िग से आता है और `<text>` आर्गुमेंट है।
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm pack
|
|
21
|
+
dsh plugin --profile <name> add ./{{pkgName}}-{{version}}.tgz
|
|
22
|
+
dsh --profile <name> --dump-config | grep '{{pkgName}}'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
| कुंजी | प्रकार | डिफ़ॉल्ट | विवरण |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `greeting` | string | `Hello` | echo उत्तर का उपसर्ग |
|
|
30
|
+
|
|
31
|
+
कॉन्फ़िगरेशन `index.js` में Schemastery `Config` स्कीमा से मान्य होता है; कोई भी सेटिंग हार्डकोडेड नहीं है।
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpm install
|
|
37
|
+
pnpm test
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
[Apache License 2.0](LICENSE) © {{year}} {{pkgName}} contributors.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# {{pkgName}}
|
|
2
|
+
|
|
3
|
+
A DeepSeek Harness (DSH) plugin scaffolded by [`dsh-plugin-dev new`](https://github.com/PerryLink/dsh-plugin-guide).
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
| Surface | Status |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
10
|
+
| Node | `^22.19.0 || >=24.0.0` |
|
|
11
|
+
| Platforms | All (plain ESM; no native code, no network) |
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
Registers the `{{name}}_echo` tool. Calling it replies with `<greeting>: <text>`, where `<greeting>` comes from the plugin config and `<text>` is the argument.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm pack
|
|
21
|
+
dsh plugin --profile <name> add ./{{pkgName}}-{{version}}.tgz
|
|
22
|
+
dsh --profile <name> --dump-config | grep '{{pkgName}}'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
| Key | Type | Default | Description |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `greeting` | string | `Hello` | Prefix for the echo reply |
|
|
30
|
+
|
|
31
|
+
Configuration is validated by the Schemastery `Config` schema in `index.js`; no tunable is hardcoded.
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpm install
|
|
37
|
+
pnpm test
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
[Apache License 2.0](LICENSE) © {{year}} {{pkgName}} contributors.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# {{pkgName}}
|
|
2
|
+
|
|
3
|
+
Um plugin do DeepSeek Harness (DSH) gerado com [`dsh-plugin-dev new`](https://github.com/PerryLink/dsh-plugin-guide).
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
| Superfície | Estado |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
10
|
+
| Node | `^22.19.0 || >=24.0.0` |
|
|
11
|
+
| Plataformas | Todas (ESM puro; sem código nativo, sem rede) |
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
Registra a ferramenta `{{name}}_echo`. Ao chamá-la, responde `<greeting>: <text>`, em que `<greeting>` vem da configuração do plugin e `<text>` é o argumento.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm pack
|
|
21
|
+
dsh plugin --profile <name> add ./{{pkgName}}-{{version}}.tgz
|
|
22
|
+
dsh --profile <name> --dump-config | grep '{{pkgName}}'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
| Chave | Tipo | Padrão | Descrição |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `greeting` | string | `Hello` | Prefixo da resposta echo |
|
|
30
|
+
|
|
31
|
+
A configuração é validada pelo schema Schemastery `Config` em `index.js`; nenhum ajuste fica fixo no código.
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpm install
|
|
37
|
+
pnpm test
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
[Apache License 2.0](LICENSE) © {{year}} {{pkgName}} contributors.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# {{pkgName}}
|
|
2
|
+
|
|
3
|
+
由 [`dsh-plugin-dev new`](https://github.com/PerryLink/dsh-plugin-guide) 脚手架生成的 DeepSeek Harness(DSH)插件。
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
| 项目 | 状态 |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
10
|
+
| Node | `^22.19.0 || >=24.0.0` |
|
|
11
|
+
| 平台 | 全部(纯 ESM;无原生代码、无网络) |
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
注册 `{{name}}_echo` 工具。调用它时返回 `<greeting>: <text>`,其中 `<greeting>` 来自插件配置,`<text>` 是入参。
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm pack
|
|
21
|
+
dsh plugin --profile <name> add ./{{pkgName}}-{{version}}.tgz
|
|
22
|
+
dsh --profile <name> --dump-config | grep '{{pkgName}}'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
| 键 | 类型 | 默认值 | 说明 |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `greeting` | string | `Hello` | echo 回复的前缀 |
|
|
30
|
+
|
|
31
|
+
配置由 `index.js` 中的 Schemastery `Config` 模式校验;没有任何硬编码可调参数。
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpm install
|
|
37
|
+
pnpm test
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
[Apache License 2.0](LICENSE) © {{year}} {{pkgName}} contributors.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# {{pkgName}} bundle layer: register the scaffolded plugin as a bundle row.
|
|
2
|
+
# This file is the `dsh.bundle.patch` layer (see package.json#dsh.bundle.patch).
|
|
3
|
+
# Layer semantics: a YAML array of row verbs; `insert` adds plugin rows to the
|
|
4
|
+
# composed config. A row's `id` must be unique within the layer stack; `name`
|
|
5
|
+
# resolves the plugin module through the installed package (package.json#main).
|
|
6
|
+
- insert:
|
|
7
|
+
# `id`: stable row identifier used by later layers to override this row.
|
|
8
|
+
- id: {{pkgName}}
|
|
9
|
+
# `name`: the module the loader imports; resolves to this package entry.
|
|
10
|
+
name: {{pkgName}}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineTool } from '@deepseek-ai/dsh-tools'
|
|
2
|
+
import Schema from '@deepseek-ai/schemastery'
|
|
3
|
+
|
|
4
|
+
export const name = '{{pkgName}}'
|
|
5
|
+
export const inject = ['tools']
|
|
6
|
+
|
|
7
|
+
// Tunable configuration must be a Schemastery Schema, never a plain object:
|
|
8
|
+
// the harness validates it at load time and fails loud on invalid values, and
|
|
9
|
+
// every key can be changed from cordis.yml without editing code (guide §3.6).
|
|
10
|
+
export const Config = Schema.object({
|
|
11
|
+
greeting: Schema.string().default('Hello').description('Greeting prefix for the echo tool.'),
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
/** Pure greeting builder kept separate from the tool so tests stay keyless. */
|
|
15
|
+
export function buildGreeting(greeting, text) {
|
|
16
|
+
return `${greeting}: ${text}`
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Every registration is an effect: `ctx.tools.register` returns the disposer that
|
|
20
|
+
// removes the tool on unload, so the plugin stays hot-reloadable (guide §3.3).
|
|
21
|
+
export function apply(ctx, config) {
|
|
22
|
+
ctx.tools.register(
|
|
23
|
+
defineTool({
|
|
24
|
+
name: '{{name}}_echo',
|
|
25
|
+
description: 'Echo a greeting back to the caller.',
|
|
26
|
+
parameters: {
|
|
27
|
+
text: { type: 'string', required: true, description: 'Text to echo.' },
|
|
28
|
+
},
|
|
29
|
+
output: {
|
|
30
|
+
schema: { type: 'string' },
|
|
31
|
+
render: (_args, value) => [{ type: 'text', text: value }],
|
|
32
|
+
},
|
|
33
|
+
async execute(args) {
|
|
34
|
+
return buildGreeting(config.greeting, args.text)
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{pkgName}}",
|
|
3
|
+
"version": "{{version}}",
|
|
4
|
+
"description": "A DeepSeek Harness (DSH) plugin scaffolded by dsh-plugin-dev.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.js",
|
|
9
|
+
"cordis.patch.yml"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"test": "vitest run"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
16
|
+
"@deepseek-ai/dsh-tools": ">=0.1.0-rc.8 <0.2.0",
|
|
17
|
+
"@deepseek-ai/schemastery": "^3.18.0",
|
|
18
|
+
"vitest": "^3.2.7"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
22
|
+
"@deepseek-ai/dsh-tools": ">=0.1.0-rc.8 <0.2.0",
|
|
23
|
+
"@deepseek-ai/schemastery": "^3.18.0"
|
|
24
|
+
},
|
|
25
|
+
"dsh": {
|
|
26
|
+
"bundle": {
|
|
27
|
+
"patch": "./cordis.patch.yml"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
32
|
+
},
|
|
33
|
+
"packageManager": "pnpm@11.7.0",
|
|
34
|
+
"license": "Apache-2.0"
|
|
35
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { buildGreeting } from '../index.js'
|
|
3
|
+
|
|
4
|
+
describe('{{pkgName}}', () => {
|
|
5
|
+
it('builds a greeting from the configured prefix', () => {
|
|
6
|
+
expect(buildGreeting('Hello', 'world')).toBe('Hello: world')
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
it('keeps the text verbatim after the prefix', () => {
|
|
10
|
+
expect(buildGreeting('Hi', 'a b:c')).toBe('Hi: a b:c')
|
|
11
|
+
})
|
|
12
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Apache License 2.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) {{year}} {{pkgName}} contributors
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# {{pkgName}}
|
|
2
|
+
|
|
3
|
+
Un plugin de DeepSeek Harness (DSH) generado con [`dsh-plugin-dev new`](https://github.com/PerryLink/dsh-plugin-guide).
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
| Superficie | Estado |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
10
|
+
| Node | `^22.19.0 || >=24.0.0` |
|
|
11
|
+
| Plataformas | Todas (ESM puro; sin código nativo, sin red) |
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
Registra la herramienta `{{name}}_echo`. Al llamarla responde `<greeting>: <text>`, donde `<greeting>` proviene de la configuración del plugin y `<text>` es el argumento.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm pack
|
|
21
|
+
dsh plugin --profile <name> add ./{{pkgName}}-{{version}}.tgz
|
|
22
|
+
dsh --profile <name> --dump-config | grep '{{pkgName}}'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
| Clave | Tipo | Valor por defecto | Descripción |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `greeting` | string | `Hello` | Prefijo de la respuesta echo |
|
|
30
|
+
|
|
31
|
+
La configuración se valida con el esquema Schemastery `Config` de `src/config.ts`; ningún ajuste está codificado de forma fija.
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpm install
|
|
37
|
+
pnpm run typecheck
|
|
38
|
+
pnpm test
|
|
39
|
+
pnpm run build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
[Apache License 2.0](LICENSE) © {{year}} {{pkgName}} contributors.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# {{pkgName}}
|
|
2
|
+
|
|
3
|
+
[`dsh-plugin-dev new`](https://github.com/PerryLink/dsh-plugin-guide) से बनाया गया एक DeepSeek Harness (DSH) प्लगइन।
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
| सतह | स्थिति |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
10
|
+
| Node | `^22.19.0 || >=24.0.0` |
|
|
11
|
+
| प्लेटफ़ॉर्म | सभी (शुद्ध ESM; कोई नेटिव कोड नहीं, कोई नेटवर्क नहीं) |
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
`{{name}}_echo` टूल पंजीकृत करता है। इसे बुलाने पर `<greeting>: <text>` लौटाता है, जहाँ `<greeting>` प्लगइन कॉन्फ़िग से आता है और `<text>` आर्गुमेंट है।
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm pack
|
|
21
|
+
dsh plugin --profile <name> add ./{{pkgName}}-{{version}}.tgz
|
|
22
|
+
dsh --profile <name> --dump-config | grep '{{pkgName}}'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
| कुंजी | प्रकार | डिफ़ॉल्ट | विवरण |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `greeting` | string | `Hello` | echo उत्तर का उपसर्ग |
|
|
30
|
+
|
|
31
|
+
कॉन्फ़िगरेशन `src/config.ts` में Schemastery `Config` स्कीमा से मान्य होता है; कोई भी सेटिंग हार्डकोडेड नहीं है।
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpm install
|
|
37
|
+
pnpm run typecheck
|
|
38
|
+
pnpm test
|
|
39
|
+
pnpm run build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
[Apache License 2.0](LICENSE) © {{year}} {{pkgName}} contributors.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# {{pkgName}}
|
|
2
|
+
|
|
3
|
+
A DeepSeek Harness (DSH) plugin scaffolded by [`dsh-plugin-dev new`](https://github.com/PerryLink/dsh-plugin-guide).
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
| Surface | Status |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
10
|
+
| Node | `^22.19.0 || >=24.0.0` |
|
|
11
|
+
| Platforms | All (plain ESM; no native code, no network) |
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
Registers the `{{name}}_echo` tool. Calling it replies with `<greeting>: <text>`, where `<greeting>` comes from the plugin config and `<text>` is the argument.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm pack
|
|
21
|
+
dsh plugin --profile <name> add ./{{pkgName}}-{{version}}.tgz
|
|
22
|
+
dsh --profile <name> --dump-config | grep '{{pkgName}}'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
| Key | Type | Default | Description |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `greeting` | string | `Hello` | Prefix for the echo reply |
|
|
30
|
+
|
|
31
|
+
Configuration is validated by the Schemastery `Config` schema in `src/config.ts`; no tunable is hardcoded.
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpm install
|
|
37
|
+
pnpm run typecheck
|
|
38
|
+
pnpm test
|
|
39
|
+
pnpm run build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
[Apache License 2.0](LICENSE) © {{year}} {{pkgName}} contributors.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# {{pkgName}}
|
|
2
|
+
|
|
3
|
+
Um plugin do DeepSeek Harness (DSH) gerado com [`dsh-plugin-dev new`](https://github.com/PerryLink/dsh-plugin-guide).
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
| Superfície | Estado |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
10
|
+
| Node | `^22.19.0 || >=24.0.0` |
|
|
11
|
+
| Plataformas | Todas (ESM puro; sem código nativo, sem rede) |
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
Registra a ferramenta `{{name}}_echo`. Ao chamá-la, responde `<greeting>: <text>`, em que `<greeting>` vem da configuração do plugin e `<text>` é o argumento.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm pack
|
|
21
|
+
dsh plugin --profile <name> add ./{{pkgName}}-{{version}}.tgz
|
|
22
|
+
dsh --profile <name> --dump-config | grep '{{pkgName}}'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
| Chave | Tipo | Padrão | Descrição |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `greeting` | string | `Hello` | Prefixo da resposta echo |
|
|
30
|
+
|
|
31
|
+
A configuração é validada pelo schema Schemastery `Config` em `src/config.ts`; nenhum ajuste fica fixo no código.
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpm install
|
|
37
|
+
pnpm run typecheck
|
|
38
|
+
pnpm test
|
|
39
|
+
pnpm run build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
[Apache License 2.0](LICENSE) © {{year}} {{pkgName}} contributors.
|