dsh-plugin-labels 0.7.0 → 0.8.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 +11 -3
- package/lib/index.js +14 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
给 DSH(DeepSeek Harness)**已安装插件**配「中文名 + 一句话说明」:官方「插件」页的已安装插件行、插件包卡片与详情页都会**原地显示中文名与中文描述**(由 host 覆盖显示元数据);新装插件会在启动后自动翻译。**本插件没有任何 UI 入口**(没有 tab、没有设置项),管理通过 loopback HTTP API 或让 AI 代改。
|
|
7
7
|
|
|
8
|
-
- 当前版本:**0.
|
|
8
|
+
- 当前版本:**0.8.0**(本仓库即源码目录;通过 `plugin_manager install_bundle` 从 GitHub 或 npm 安装到 DSH profile)
|
|
9
9
|
- 只支持 DSH 桌面版 Web GUI(开发验证版本 0.2.1-rc.2)
|
|
10
10
|
|
|
11
11
|
## 功能
|
|
12
12
|
|
|
13
|
-
- **中文名 + 一句话说明**:每个插件一条中文名(≤
|
|
13
|
+
- **中文名 + 一句话说明**:每个插件一条中文名(≤10 字)和一句说明(≤80 字);说明必须写清**怎么用**,不只是“是什么”(见下方「标签格式」)。
|
|
14
14
|
- **官方页原地中文**:官方「插件」页的已安装插件行、点开的详情页,以及插件包卡片(`listBundles`)都会直接显示中文名与中文描述;未翻译的插件回退英文。默认开启。
|
|
15
15
|
- **自动翻译新插件**:host 启动约 4 秒后自动补一次缺失标签(每次最多 20 条,只补空缺、不覆盖手改),不用点任何按钮;可用 `DSH_PLUGIN_LABELS_AUTO_TRANSLATE=0` 关闭。
|
|
16
16
|
- **手改优先**:手动设置的标签不会被自动翻译覆盖;显式“重翻”才会覆盖。
|
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
- **导出 / 导入 API**:导出带 `source`(`ai` / `manual`)的 JSON,导入时保留来源,只接受已安装插件名(≤64KB)。
|
|
19
19
|
- **缓存 v2**:标签缓存在 `<DSH_HOME>/plugin-labels.json`,UTF-8 无 BOM、原子写,旧 v1 数据可迁移读取。
|
|
20
20
|
|
|
21
|
+
### 标签格式
|
|
22
|
+
|
|
23
|
+
- **中文名**:≤10 个汉字,命名它“做什么”,不直译包名、不用营销词。
|
|
24
|
+
- **一句话说明**:≤80 字,必须同时回答:①这插件解决什么问题;②在 DSH 里从哪里进入 / 怎么操作(例如:设置 → 某个分区、侧栏 → 某个页面、在对话里下指令、装好自动生效);③必要时给一句可执行的第一步。
|
|
25
|
+
- 模型无法从包名/描述判断入口时,会被要求写「**入口以界面为准**」并给出用户能做的第一步;**不会编造不存在的菜单或按钮**。
|
|
26
|
+
|
|
21
27
|
## 界面
|
|
22
28
|
|
|
23
29
|
官方「插件」页的已安装插件行、插件包卡片与详情页直接显示中文名与中文描述(v0.6.0+,v0.7.0 起补上包级卡片):
|
|
@@ -52,7 +58,7 @@ host 启动约 **4 秒**后会自动补一次缺失标签:
|
|
|
52
58
|
### 方式一:npm 包(推荐,`npm publish` 后)
|
|
53
59
|
|
|
54
60
|
在 DSH 插件页 → 添加插件 → 填包名 `dsh-plugin-labels`;或在创造模式会话里 `plugin_manager` → `install_bundle` → `target: "dsh-plugin-labels"`。发布后 profile 依赖形如
|
|
55
|
-
`"dsh-plugin-labels": "dsh-plugin-labels@^0.
|
|
61
|
+
`"dsh-plugin-labels": "dsh-plugin-labels@^0.8.0"`。
|
|
56
62
|
|
|
57
63
|
### 方式二:从 Git 仓库安装
|
|
58
64
|
|
|
@@ -164,6 +170,8 @@ MIT,见 [LICENSE](LICENSE)。Copyright (c) 2026 qyy2005
|
|
|
164
170
|
|
|
165
171
|
`dsh-plugin-labels` is a DSH (DeepSeek Harness) plugin that gives every installed plugin a Chinese name and a one-line explanation. The labels are shown **in place** on the official Plugins page: the installed-plugin rows, the detail pages and the plugin package cards (`pluginManager.listBundles`) all display the Chinese name and description, falling back to English for plugins without a label. **The plugin has no UI entry point** (no tab, no settings item): labels are managed through four loopback HTTP routes (or by an AI/script calling them), and results are cached under `<DSH_HOME>/plugin-labels.json` with manual edits never overwritten by automatic translation.
|
|
166
172
|
|
|
173
|
+
Each label is a Chinese name (≤10 characters) plus a one-line explanation (≤80 characters) that must explain **how to use** the plugin: the problem it solves, where in DSH the user enters or operates it, and a concrete first step. When the entry point cannot be inferred, the model is instructed to write 入口以界面为准 instead of inventing menus.
|
|
174
|
+
|
|
167
175
|
Newly installed plugins are translated automatically: about 4 seconds after host startup one pass fills up to 20 missing labels (set `DSH_PLUGIN_LABELS_AUTO_TRANSLATE=0` and restart DSH to disable it). The display overrides can be disabled together with `DSH_PLUGIN_LABELS_OFFICIAL_META=0`; `GET /api/plugin-labels/list` reports `officialMeta: {enabled, patched, service, bundles}` for diagnostics. Both overrides require one DSH restart after installation.
|
|
168
176
|
|
|
169
177
|
The client half is a hand-written `__ModuleLoader__` bundle with no build step that only requires `react` (v0.7.0: locale registration only, no UI); the host half is an ESM plugin exposing four loopback-only HTTP routes plus the display overrides and the startup auto-translate. Verified on DSH desktop 0.2.1-rc.2. MIT licensed.
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* dsh-plugin-labels — host half (v0.
|
|
2
|
+
* dsh-plugin-labels — host half (v0.8.0: labels explain how to use a plugin).
|
|
3
3
|
*
|
|
4
4
|
* Four loopback-only endpoints (kept for scripts/AI even though the client no
|
|
5
5
|
* longer renders a tab):
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
* rename). Manual labels carry source:"manual" and are never overwritten by a
|
|
16
16
|
* later translate run; translating only fills missing entries.
|
|
17
17
|
*
|
|
18
|
+
* Label format (v0.8.0): `title` is a short Chinese name (at most 10 Chinese
|
|
19
|
+
* characters); `oneLine` (at most 80 characters) must explain HOW TO USE the
|
|
20
|
+
* plugin — what problem it solves, where in DSH the user enters or operates it,
|
|
21
|
+
* and a concrete first step when useful. The model is told never to invent
|
|
22
|
+
* menus: when the entry point cannot be inferred it must write 入口以界面为准.
|
|
23
|
+
*
|
|
18
24
|
* Display overrides (all failure-safe; marker-detected because Cordis hands out
|
|
19
25
|
* traceable Proxies whose method references differ on every read):
|
|
20
26
|
* - `installOfficialMeta` wraps `pluginPackages.metaOf()` so the official
|
|
@@ -50,16 +56,19 @@ const CACHE_VERSION = 2;
|
|
|
50
56
|
const LEGACY_CACHE_VERSION = 1;
|
|
51
57
|
const MAX_PENDING_PER_CALL = 20;
|
|
52
58
|
const MAX_TITLE = 40;
|
|
53
|
-
const MAX_ONE_LINE =
|
|
59
|
+
const MAX_ONE_LINE = 80;
|
|
54
60
|
const MAX_BODY_BYTES = 65536;
|
|
55
61
|
const TRANSLATE_TIMEOUT_MS = 120000;
|
|
56
62
|
|
|
57
63
|
const SYSTEM_PROMPT = [
|
|
58
64
|
"You label DeepSeek Harness (DSH) plugins for a Chinese-speaking user.",
|
|
59
65
|
"For every plugin you receive, produce:",
|
|
60
|
-
"1. title: a short Chinese name
|
|
61
|
-
"2. oneLine:
|
|
62
|
-
"
|
|
66
|
+
"1. title: a short Chinese name of at most 10 Chinese characters, naming what it does (do not translate the package name literally, do not use marketing words).",
|
|
67
|
+
"2. oneLine: ONE Chinese sentence of at most 80 characters that MUST explain HOW TO USE the plugin, not just what it is. It must cover:",
|
|
68
|
+
" a) the problem the plugin solves (what it is for);",
|
|
69
|
+
" b) where in DSH the user enters or operates it, for example: 设置 → 某个分区, 侧栏 → 某个页面, 在对话里下指令, or 装好后自动生效;",
|
|
70
|
+
" c) when useful, one concrete first step the user can take right now.",
|
|
71
|
+
"Style: concrete, prefer starting with a verb; no filler, no marketing words. If the package name and description do not make the entry point clear, write 入口以界面为准 and still give a first step the user can take. NEVER invent menus, buttons, pages or settings that the description does not imply.",
|
|
63
72
|
"Answer with strict JSON only, no prose, no markdown fences:",
|
|
64
73
|
'{"items":[{"name":"<exact package name>","title":"...","oneLine":"..."}]}',
|
|
65
74
|
].join("\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-labels",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
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.",
|