@nick.du/dsh-plugin-hello 0.0.0-stage → 0.1.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.md +29 -2
- package/cordis.patch.yml +8 -0
- package/docs/DETAIL.md +39 -0
- package/icon.svg +18 -0
- package/lib/greeting.d.ts +3 -0
- package/lib/greeting.d.ts.map +1 -0
- package/lib/greeting.js +5 -0
- package/lib/greeting.js.map +1 -0
- package/lib/index.d.ts +28 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +46 -0
- package/lib/index.js.map +1 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +58 -4
package/README.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nick.du/dsh-plugin-hello
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Adds a `hello_greet` tool that greets someone by name.
|
|
4
|
+
|
|
5
|
+
- **Tool:** `hello_greet`
|
|
6
|
+
- **Config:** `greeting`(默认 `Hello`)
|
|
7
|
+
- **npm:** [@nick.du/dsh-plugin-hello](https://www.npmjs.com/package/@nick.du/dsh-plugin-hello)
|
|
8
|
+
|
|
9
|
+
## 开发
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm install # 仓库根目录
|
|
13
|
+
pnpm --filter @nick.du/dsh-plugin-hello typecheck
|
|
14
|
+
pnpm --filter @nick.du/dsh-plugin-hello build
|
|
15
|
+
pnpm test # 仓库根目录运行全部插件测试
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
源码在 `src/`,构建产物在 `lib/`(不提交)。相对导入使用 `.js` 扩展名。
|
|
19
|
+
|
|
20
|
+
## 安装
|
|
21
|
+
|
|
22
|
+
- **npm(发布后)**:DeepSeek Harness → 插件 → 添加插件 → 输入 `@nick.du/dsh-plugin-hello`
|
|
23
|
+
- **本地开发**:
|
|
24
|
+
1. `pnpm --filter @nick.du/dsh-plugin-hello build`
|
|
25
|
+
2. 插件 → 添加插件 → 选择本目录
|
|
26
|
+
3. 在新会话中调用 `hello_greet` 验证
|
|
27
|
+
|
|
28
|
+
## 限制
|
|
29
|
+
|
|
30
|
+
- 只返回文本,不访问其它服务。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Plugin row for this bundle. `id` matches the directory, `name` matches the package name.
|
|
2
|
+
# Ordinary configuration (`greeting`) can be changed here or in the profile's own patch layer;
|
|
3
|
+
# the plugin re-applies without a restart.
|
|
4
|
+
- insert:
|
|
5
|
+
- id: hello
|
|
6
|
+
name: '@nick.du/dsh-plugin-hello'
|
|
7
|
+
config:
|
|
8
|
+
greeting: Hello
|
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Hello
|
|
2
|
+
|
|
3
|
+
Adds a `hello_greet` tool that greets someone by name.
|
|
4
|
+
|
|
5
|
+
## 功能
|
|
6
|
+
|
|
7
|
+
- 注册 Agent 工具 `hello_greet`,参数 `name`(必填)。
|
|
8
|
+
- 返回拼好的问候语,例如 `Hello, DSH!`。
|
|
9
|
+
- 问候语前缀由插件配置提供,默认 `Hello`。
|
|
10
|
+
|
|
11
|
+
## 配置
|
|
12
|
+
|
|
13
|
+
| 键 | 类型 | 默认值 | 说明 |
|
|
14
|
+
| ---------- | ------ | ------- | ------------ |
|
|
15
|
+
| `greeting` | string | `Hello` | 问候语前缀。 |
|
|
16
|
+
|
|
17
|
+
在 profile 的 patch 层中修改,例如:
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
- id: hello
|
|
21
|
+
name: '@nick.du/dsh-plugin-hello'
|
|
22
|
+
config:
|
|
23
|
+
greeting: 你好
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
保存后插件自动重新应用,无需重启。
|
|
27
|
+
|
|
28
|
+
## 安装
|
|
29
|
+
|
|
30
|
+
1. 构建:`pnpm --filter @nick.du/dsh-plugin-hello build`
|
|
31
|
+
2. 在 DeepSeek Harness 中打开「插件」页面,选择「添加插件」:
|
|
32
|
+
- 已发布到 npm 时,直接输入 `@nick.du/dsh-plugin-hello`;
|
|
33
|
+
- 本地开发时,选中本插件目录。
|
|
34
|
+
3. 在**新会话**中让模型调用 `hello_greet` 验证。
|
|
35
|
+
|
|
36
|
+
## 限制
|
|
37
|
+
|
|
38
|
+
- 只返回文本,不访问文件、网络或其它服务。
|
|
39
|
+
- 工具对当前 profile 内的 Agent 可见;如需按 Agent 限制,请在上层使用工具策略。
|
package/icon.svg
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="Hello">
|
|
2
|
+
<!-- Replace with plugin-specific artwork while keeping it original or properly licensed. -->
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="dsh-plugin-icon-bg" x1="0" y1="0" x2="1" y2="1">
|
|
5
|
+
<stop offset="0" stop-color="#2563eb" />
|
|
6
|
+
<stop offset="1" stop-color="#0ea5e9" />
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
<rect x="4" y="4" width="56" height="56" rx="14" fill="url(#dsh-plugin-icon-bg)" />
|
|
10
|
+
<path
|
|
11
|
+
d="M18 21h28a4 4 0 0 1 4 4v15a4 4 0 0 1-4 4H32l-8 7v-7h-6a4 4 0 0 1-4-4V25a4 4 0 0 1 4-4z"
|
|
12
|
+
fill="#ffffff"
|
|
13
|
+
fill-opacity="0.95"
|
|
14
|
+
/>
|
|
15
|
+
<circle cx="26" cy="33" r="2.5" fill="#2563eb" />
|
|
16
|
+
<circle cx="32" cy="33" r="2.5" fill="#2563eb" />
|
|
17
|
+
<circle cx="38" cy="33" r="2.5" fill="#2563eb" />
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greeting.d.ts","sourceRoot":"","sources":["../src/greeting.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,wBAAgB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5D"}
|
package/lib/greeting.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greeting.js","sourceRoot":"","sources":["../src/greeting.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,UAAU,KAAK,CAAC,QAAgB,EAAE,IAAY;IAClD,OAAO,GAAG,QAAQ,KAAK,IAAI,GAAG,CAAA;AAChC,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hello — adds a `hello_greet` Agent tool that greets someone by name.
|
|
3
|
+
*
|
|
4
|
+
* The greeting prefix is ordinary plugin configuration, so users can change it
|
|
5
|
+
* in `cordis.patch.yml` or in the profile's patch layer without editing code.
|
|
6
|
+
*
|
|
7
|
+
* @module dsh-plugin-hello
|
|
8
|
+
*/
|
|
9
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
10
|
+
import z from '@deepseek-ai/schemastery';
|
|
11
|
+
/** Stable Loader identity; matches the package name suffix and the patch id. */
|
|
12
|
+
export declare const name = "hello";
|
|
13
|
+
/** Services this plugin needs before it activates. */
|
|
14
|
+
export declare const inject: string[];
|
|
15
|
+
/** Values users can change from `cordis.patch.yml` or the profile patch layer. */
|
|
16
|
+
export interface Config {
|
|
17
|
+
/** Text placed before the name in the greeting. */
|
|
18
|
+
greeting: string;
|
|
19
|
+
}
|
|
20
|
+
/** Validation and defaults for {@link Config}. */
|
|
21
|
+
export declare const Config: z<Config>;
|
|
22
|
+
/**
|
|
23
|
+
* Register the plugin with the running Harness.
|
|
24
|
+
* @param ctx - owning Cordis context.
|
|
25
|
+
* @param config - validated plugin configuration.
|
|
26
|
+
*/
|
|
27
|
+
export declare function apply(ctx: Context, config: Config): void;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAGxC,gFAAgF;AAChF,eAAO,MAAM,IAAI,UAAU,CAAA;AAE3B,sDAAsD;AACtD,eAAO,MAAM,MAAM,UAAY,CAAA;AAE/B,kFAAkF;AAClF,MAAM,WAAW,MAAM;IACrB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,kDAAkD;AAClD,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAE3B,CAAA;AAEF;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAqBxD"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hello — adds a `hello_greet` Agent tool that greets someone by name.
|
|
3
|
+
*
|
|
4
|
+
* The greeting prefix is ordinary plugin configuration, so users can change it
|
|
5
|
+
* in `cordis.patch.yml` or in the profile's patch layer without editing code.
|
|
6
|
+
*
|
|
7
|
+
* @module dsh-plugin-hello
|
|
8
|
+
*/
|
|
9
|
+
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
10
|
+
import z from '@deepseek-ai/schemastery';
|
|
11
|
+
import { greet } from './greeting.js';
|
|
12
|
+
/** Stable Loader identity; matches the package name suffix and the patch id. */
|
|
13
|
+
export const name = 'hello';
|
|
14
|
+
/** Services this plugin needs before it activates. */
|
|
15
|
+
export const inject = ['tools'];
|
|
16
|
+
/** Validation and defaults for {@link Config}. */
|
|
17
|
+
export const Config = z.object({
|
|
18
|
+
greeting: z.string().default('Hello'),
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Register the plugin with the running Harness.
|
|
22
|
+
* @param ctx - owning Cordis context.
|
|
23
|
+
* @param config - validated plugin configuration.
|
|
24
|
+
*/
|
|
25
|
+
export function apply(ctx, config) {
|
|
26
|
+
const tool = defineTool({
|
|
27
|
+
name: 'hello_greet',
|
|
28
|
+
description: 'Greet a person by name and return the greeting text.',
|
|
29
|
+
parameters: {
|
|
30
|
+
name: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
required: true,
|
|
33
|
+
description: 'Name of the person to greet.',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
output: {
|
|
37
|
+
schema: { type: 'string' },
|
|
38
|
+
render: (_args, value) => [{ type: 'text', text: value }],
|
|
39
|
+
},
|
|
40
|
+
async execute(args) {
|
|
41
|
+
return greet(config.greeting, args.name);
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
ctx.effect(() => ctx.tools.register(tool));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAErC,gFAAgF;AAChF,MAAM,CAAC,MAAM,IAAI,GAAG,OAAO,CAAA;AAE3B,sDAAsD;AACtD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,CAAA;AAQ/B,kDAAkD;AAClD,MAAM,CAAC,MAAM,MAAM,GAAc,CAAC,CAAC,MAAM,CAAC;IACxC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;CACtC,CAAC,CAAA;AAEF;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,GAAY,EAAE,MAAc;IAChD,MAAM,IAAI,GAAG,UAAU,CAAC;QACtB,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,sDAAsD;QACnE,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,8BAA8B;aAC5C;SACF;QACD,MAAM,EAAE;YACN,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;SAC1D;QACD,KAAK,CAAC,OAAO,CAAC,IAAI;YAChB,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1C,CAAC;KACF,CAAC,CAAA;IAEF,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;AAC5C,CAAC"}
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nick.du/dsh-plugin-hello",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Adds a hello_greet tool that greets someone by name.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"dsh",
|
|
9
|
+
"deepseek-harness",
|
|
10
|
+
"dsh-plugin"
|
|
11
|
+
],
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=24.9.0",
|
|
14
|
+
"dsh": ">=0.2.2-rc.5 <0.3.0"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/nickdu2009/dsh-plugin.git",
|
|
22
|
+
"directory": "plugins/hello"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/nickdu2009/dsh-plugin/tree/main/plugins/hello#readme",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/nickdu2009/dsh-plugin/issues"
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./lib/index.d.ts",
|
|
31
|
+
"default": "./lib/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./locale/*.json": "./locale/*.json",
|
|
34
|
+
"./icon": "./icon.svg"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"lib",
|
|
38
|
+
"cordis.patch.yml",
|
|
39
|
+
"locale",
|
|
40
|
+
"docs",
|
|
41
|
+
"icon.svg",
|
|
42
|
+
"README.md"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc -p tsconfig.build.json",
|
|
46
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.5",
|
|
50
|
+
"@deepseek-ai/schemastery": "3.19.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@deepseek-ai/cordis": "4.1.0"
|
|
54
|
+
},
|
|
55
|
+
"dsh": {
|
|
56
|
+
"bundle": {
|
|
57
|
+
"patch": "./cordis.patch.yml"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|