@boostkit-dsh/hello 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/CHANGELOG.md +8 -0
- package/README.md +13 -0
- package/cordis.patch.yml +4 -0
- package/index.js +30 -0
- package/package.json +48 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @boostkit-dsh/hello
|
|
2
|
+
|
|
3
|
+
本项目专用计算插件市场的最小安装链路样例。源码由旧 `@lujinxing/hello` 迁入后独立维护;当前包注册 `boostkit_hello` Agent 工具,并精确依赖 `@boostkit-dsh/auth-management@0.1.1`。
|
|
4
|
+
|
|
5
|
+
调用工具前必须存在有效 GitCode ActorRef。成功和失败调用会以 `hello.greet` 动作写入最小化审计事件,不记录提示词、模型输出或凭据。
|
|
6
|
+
|
|
7
|
+
正式安装:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
dsh plugin --profile web add --save-exact @boostkit-dsh/hello@0.1.0
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
安装完成后重启或等待 DSH 热加载,在 Agent 中调用 `boostkit_hello`。
|
package/cordis.patch.yml
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Minimal authenticated and audited tool used to verify the project market chain. */
|
|
2
|
+
export const name = 'boostkit-hello'
|
|
3
|
+
export const inject = ['authManagement']
|
|
4
|
+
|
|
5
|
+
export function apply(ctx) {
|
|
6
|
+
const auth = ctx.get?.('authManagement') ?? ctx.authManagement
|
|
7
|
+
ctx.inject(['tools'], (toolCtx) => {
|
|
8
|
+
toolCtx.tools.register({
|
|
9
|
+
name: 'boostkit_hello',
|
|
10
|
+
description: '返回一句经过 GitCode 鉴权并记录最小化审计的问候,用于验证鲲鹏插件市场安装链路。',
|
|
11
|
+
parameters: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
name: { type: 'string', description: '要问候的名字(可选)' },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
output: {
|
|
18
|
+
schema: { type: 'string' },
|
|
19
|
+
render: (_args, value) => [{ type: 'text', text: String(value) }],
|
|
20
|
+
},
|
|
21
|
+
async execute(args = {}) {
|
|
22
|
+
const target = typeof args.name === 'string' && args.name.trim() !== '' ? args.name.trim() : 'GitCode 用户'
|
|
23
|
+
return auth.executeAudited({
|
|
24
|
+
action: 'hello.greet',
|
|
25
|
+
target: { type: 'sample', id: 'boostkit-hello', label: target },
|
|
26
|
+
}, async (actor) => `你好,${target}!—— 来自 @${actor.login} 使用的 @boostkit-dsh/hello`)
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@boostkit-dsh/hello",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "本项目插件市场样例:注册受 GitCode 鉴权和审计保护的问候工具",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"CHANGELOG.md",
|
|
9
|
+
"README.md",
|
|
10
|
+
"cordis.patch.yml",
|
|
11
|
+
"index.js"
|
|
12
|
+
],
|
|
13
|
+
"license": "UNLICENSED",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://gitcode.com/lujinxing/kunpeng-dsh-demo.git",
|
|
17
|
+
"directory": "plugins/hello"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public",
|
|
21
|
+
"registry": "https://registry.npmjs.org"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "node --test test/*.test.mjs"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@boostkit-dsh/auth-management": "0.1.1"
|
|
28
|
+
},
|
|
29
|
+
"dsh": {
|
|
30
|
+
"bundle": {
|
|
31
|
+
"patch": "./cordis.patch.yml"
|
|
32
|
+
},
|
|
33
|
+
"market": {
|
|
34
|
+
"displayName": {
|
|
35
|
+
"zh": "问候样例插件",
|
|
36
|
+
"en": "Hello sample plugin"
|
|
37
|
+
},
|
|
38
|
+
"category": "kunpeng-rd",
|
|
39
|
+
"maintainers": [
|
|
40
|
+
"@lujinxing"
|
|
41
|
+
],
|
|
42
|
+
"compatibility": {
|
|
43
|
+
"dsh": "0.1.7-alpha.1"
|
|
44
|
+
},
|
|
45
|
+
"allowedBuilds": []
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|