dsh-plugin-guide 0.1.2 → 0.3.1
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 +89 -20
- package/README.hi.md +89 -20
- package/README.md +92 -21
- package/README.pt.md +89 -20
- package/README.zh.md +92 -21
- 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/guide/plugin-dev-guide.md +1 -1
- package/guide/quick-reference.es.md +1 -1
- package/guide/quick-reference.hi.md +1 -1
- package/guide/quick-reference.md +1 -1
- package/guide/quick-reference.pt.md +1 -1
- package/guide/quick-reference.zh-CN.md +1 -1
- package/package.json +50 -5
- package/references/harness-repo.md +1 -1
- package/references/official-docs/AGENTS.md +1 -1
- package/references/official-docs/docs/persistence-catalog.md +1 -12
- package/references/official-docs/docs/persistence-catalog.zh.md +1 -12
- package/references/official-docs/docs/subsystems/persistence.md +1 -1
- package/references/official-docs/docs/subsystems/persistence.zh.md +1 -1
- package/references/official-docs/docs/subsystems/session.md +0 -11
- package/references/official-docs/docs/subsystems/session.zh.md +0 -11
- package/scripts/check-docs-drift.ps1 +55 -0
- package/scripts/check-readme-sync.mjs +91 -0
- 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
|
@@ -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.
|
|
@@ -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,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,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{pkgName}}",
|
|
3
|
+
"version": "{{version}}",
|
|
4
|
+
"description": "A DeepSeek Harness (DSH) plugin scaffolded by dsh-plugin-dev.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib",
|
|
10
|
+
"cordis.patch.yml"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsdown",
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
15
|
+
"test": "vitest run",
|
|
16
|
+
"prepare": "tsdown"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"tsdown": "^0.22.14",
|
|
20
|
+
"typescript": "^5.9.3"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
24
|
+
"@deepseek-ai/dsh-tools": ">=0.1.0-rc.8 <0.2.0",
|
|
25
|
+
"@deepseek-ai/schemastery": "^3.18.0",
|
|
26
|
+
"@types/node": "^22.20.1",
|
|
27
|
+
"vitest": "^3.2.7"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
31
|
+
"@deepseek-ai/dsh-tools": ">=0.1.0-rc.8 <0.2.0",
|
|
32
|
+
"@deepseek-ai/schemastery": "^3.18.0"
|
|
33
|
+
},
|
|
34
|
+
"dsh": {
|
|
35
|
+
"bundle": {
|
|
36
|
+
"patch": "./cordis.patch.yml"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
41
|
+
},
|
|
42
|
+
"packageManager": "pnpm@11.7.0",
|
|
43
|
+
"license": "Apache-2.0"
|
|
44
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Schema from '@deepseek-ai/schemastery'
|
|
2
|
+
|
|
3
|
+
// Tunable configuration must be a Schemastery Schema, never a plain object:
|
|
4
|
+
// the harness validates it at load time and fails loud on invalid values, and
|
|
5
|
+
// every key can be changed from cordis.yml without editing code (guide §3.6).
|
|
6
|
+
export interface Config {
|
|
7
|
+
greeting: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Config: Schema<Config> = Schema.object({
|
|
11
|
+
greeting: Schema.string().default('Hello').description('Greeting prefix for the echo tool.'),
|
|
12
|
+
})
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis'
|
|
2
|
+
import { defineTool } from '@deepseek-ai/dsh-tools'
|
|
3
|
+
import { Config } from './config'
|
|
4
|
+
import type { Config as ConfigShape } from './config'
|
|
5
|
+
|
|
6
|
+
export const name = '{{pkgName}}'
|
|
7
|
+
export const inject = ['tools']
|
|
8
|
+
|
|
9
|
+
// Re-export the schema so the loader can validate this plugin's config.
|
|
10
|
+
export { Config }
|
|
11
|
+
|
|
12
|
+
/** Pure greeting builder kept separate from the tool so tests stay keyless. */
|
|
13
|
+
export function buildGreeting(greeting: string, text: string): string {
|
|
14
|
+
return `${greeting}: ${text}`
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Every registration is an effect: `ctx.tools.register` returns the disposer that
|
|
18
|
+
// removes the tool on unload, so the plugin stays hot-reloadable (guide §3.3).
|
|
19
|
+
export function apply(ctx: Context, config: ConfigShape): void {
|
|
20
|
+
ctx.tools.register(
|
|
21
|
+
defineTool({
|
|
22
|
+
name: '{{name}}_echo',
|
|
23
|
+
description: 'Echo a greeting back to the caller.',
|
|
24
|
+
parameters: {
|
|
25
|
+
text: { type: 'string', required: true, description: 'Text to echo.' },
|
|
26
|
+
},
|
|
27
|
+
output: {
|
|
28
|
+
schema: { type: 'string' },
|
|
29
|
+
render: (_args, value) => [{ type: 'text', text: value }],
|
|
30
|
+
},
|
|
31
|
+
async execute(args) {
|
|
32
|
+
return buildGreeting(config.greeting, args.text)
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { buildGreeting } from '../src/index'
|
|
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,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"lib": ["ES2022"],
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noImplicitAny": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src", "tests"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from 'tsdown'
|
|
2
|
+
|
|
3
|
+
// tsdown bundles src/index.ts into lib/index.js (ESM) and emits lib/index.d.ts.
|
|
4
|
+
// It is also the self-contained `prepare` script for git installs: no project
|
|
5
|
+
// references, no type checking (see guide §7.1 "build-script catch").
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
entry: { index: 'src/index.ts' },
|
|
8
|
+
format: ['esm'],
|
|
9
|
+
platform: 'node',
|
|
10
|
+
target: 'node22',
|
|
11
|
+
dts: true,
|
|
12
|
+
clean: true,
|
|
13
|
+
sourcemap: false,
|
|
14
|
+
outDir: 'lib',
|
|
15
|
+
})
|