dsh-plugin-labels 0.9.1 → 0.9.2
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 -4
- package/lib/index.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
给 DSH(DeepSeek Harness)**已安装插件**配「中文名 + 一句话说明」:官方「插件」页的已安装插件行、插件包卡片与详情页都会**原地显示中文名与中文描述**(由 host 覆盖显示元数据);新装插件会在启动后自动翻译。同时给 **skills(技能)** 补中文说明:`/` 技能菜单里每条技能显示「英文原描述 |中文:<作用>;用法:<怎么用>」。**本插件没有任何 UI 入口**(没有 tab、没有设置项),管理通过 loopback HTTP API 或让 AI 代改。
|
|
9
9
|
|
|
10
|
-
- 当前版本:**0.9.
|
|
10
|
+
- 当前版本:**0.9.2**(本仓库即源码目录;通过 `plugin_manager install_bundle` 从 GitHub 或 npm 安装到 DSH profile)
|
|
11
11
|
- 只支持 DSH 桌面版 Web GUI(开发验证版本 0.2.1-rc.2 / rc.3)
|
|
12
12
|
|
|
13
13
|
## 功能
|
|
@@ -65,7 +65,7 @@ host 启动约 **4 秒**后会自动补一次缺失标签:
|
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
- **实现**:host 包装 `skills` 服务的 `snapshot`/`list`,命中缓存才加前缀,未命中保持原样(`/` 菜单走 `skills.list`,模型侧技能目录走同一份 description)。
|
|
68
|
-
- **缓存**:`<DSH_HOME>/plugin-labels-skills.json`(独立于插件标签缓存,`version: 1`,UTF-8 无 BOM、原子写);每条 `{zh ≤
|
|
68
|
+
- **缓存**:`<DSH_HOME>/plugin-labels-skills.json`(独立于插件标签缓存,`version: 1`,UTF-8 无 BOM、原子写);每条 `{zh ≤22 字, usage ≤18 字, source: "ai" | "manual", at}`。菜单只显示一行并截断,所以中文必须短。
|
|
69
69
|
- **API**(见「使用」):`GET /api/plugin-labels/skills`、`POST /api/plugin-labels/skills/translate`、`POST /api/plugin-labels/skills/label`。
|
|
70
70
|
- **自动翻译**:启动后约 4 秒的自动任务在补完插件标签后,会再补最多 **10** 条技能说明(`MAX_SKILLS_PER_AUTO`);只补空缺、不覆盖手改;`DSH_PLUGIN_LABELS_AUTO_TRANSLATE=0` 同时关闭插件与技能自动翻译。
|
|
71
71
|
- **限制**:只翻译/解释技能的目录描述,**技能正文仍是英文**;模型侧技能目录会把 description 截断到 500 字,中文在前意味着模型看到的是中文说明,英文原文可能被截断;技能服务(`ctx.get("skills")`)不可用时静默跳过,不影响其它功能。
|
|
@@ -76,7 +76,7 @@ host 启动约 **4 秒**后会自动补一次缺失标签:
|
|
|
76
76
|
### 方式一:npm 包(推荐,`npm publish` 后)
|
|
77
77
|
|
|
78
78
|
在 DSH 插件页 → 添加插件 → 填包名 `dsh-plugin-labels`;或在创造模式会话里 `plugin_manager` → `install_bundle` → `target: "dsh-plugin-labels"`。发布后 profile 依赖形如
|
|
79
|
-
`"dsh-plugin-labels": "dsh-plugin-labels@^0.9.
|
|
79
|
+
`"dsh-plugin-labels": "dsh-plugin-labels@^0.9.2"`。
|
|
80
80
|
|
|
81
81
|
### 方式二:从 Git 仓库安装
|
|
82
82
|
|
|
@@ -92,7 +92,7 @@ host 启动约 **4 秒**后会自动补一次缺失标签:
|
|
|
92
92
|
|
|
93
93
|
## 使用
|
|
94
94
|
|
|
95
|
-
v0.9.
|
|
95
|
+
v0.9.2 起没有 UI 入口,全部通过 7 个 loopback HTTP API 操作(也可以让 AI/脚本代改):
|
|
96
96
|
|
|
97
97
|
```powershell
|
|
98
98
|
# 查看已装插件 + 标签 + 诊断字段(officialMeta)
|
package/lib/index.js
CHANGED
|
@@ -75,8 +75,8 @@ const MAX_BODY_BYTES = 65536;
|
|
|
75
75
|
const TRANSLATE_TIMEOUT_MS = 120000;
|
|
76
76
|
|
|
77
77
|
const SKILL_CACHE_VERSION = 1;
|
|
78
|
-
const MAX_SKILL_ZH =
|
|
79
|
-
const MAX_SKILL_USAGE =
|
|
78
|
+
const MAX_SKILL_ZH = 22;
|
|
79
|
+
const MAX_SKILL_USAGE = 18;
|
|
80
80
|
const MAX_SKILL_DESCRIPTION = 600;
|
|
81
81
|
const MAX_SKILLS_PER_AUTO = 10;
|
|
82
82
|
|
|
@@ -96,8 +96,8 @@ const SYSTEM_PROMPT = [
|
|
|
96
96
|
const SKILL_SYSTEM_PROMPT = [
|
|
97
97
|
"You translate DeepSeek Harness (DSH) skill descriptions for a Chinese-speaking user who cannot read English.",
|
|
98
98
|
"For every skill you receive, produce:",
|
|
99
|
-
"1. zh: a Chinese name plus
|
|
100
|
-
"2. usage: how and when to use it, at most
|
|
99
|
+
"1. zh: a short Chinese name plus purpose, at most 22 Chinese characters (prefer 10-16). The skill menu shows only one truncated line, so brevity matters.",
|
|
100
|
+
"2. usage: how and when to use it, at most 18 Chinese characters (prefer 8-14), for example 对 AI 说\"用 X\" or 输入 /<name>. Never invent a command that the description does not imply.",
|
|
101
101
|
"Answer with strict JSON only, no prose, no markdown fences:",
|
|
102
102
|
'{"items":[{"name":"<exact skill name>","zh":"...","usage":"..."}]}',
|
|
103
103
|
].join("\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-labels",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Chinese names and one-line explanations for installed DSH plugins; automatic translation and in-place display on the official Plugins page.",
|