@jianyiagi/dsh-prompt-enhancer 1.0.1 → 1.0.3

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 CHANGED
@@ -1,63 +1,44 @@
1
1
  # @jianyiagi/dsh-prompt-enhancer
2
2
 
3
- > DSH(DeepSeek Harness)Web 端插件:**输入框一键优化提示词**。
4
- > 有内容时,模型选择器左侧出现一个闪光按钮;点一下,模型把提示词改写得更清晰、更可执行,结果直接替换输入框草稿。
3
+ **简体中文** | [English](#english)
5
4
 
6
- ---
7
-
8
- ## 功能
9
-
10
- - **一键增强**:优化表达 + 结构化(自然段落优先),消除歧义与口语化,明确目标 / 对象 / 约束 / 期望输出
11
- - **忠于原文**:保留原意与语言,不编造原文没有的信息;代码、命令、路径、变量名、字段名**原样保留**
12
- - **无冗余**:不写「未指定 / 未提供」占位,各部分不重复,长度不明显超过原文
13
- - **直接可用**:结果写回输入框,不满意可直接编辑器撤销
14
- - **双语**:界面文案随 DSH 语言(中文 / English)
5
+ DSH(DeepSeek Harness)插件。在输入框写提示词,点一下按钮,模型改写后替换输入框内容。
15
6
 
16
7
  ---
17
8
 
18
9
  ## 安装
19
10
 
20
- ### 桌面端(Electron App)
11
+ **桌面端**:
21
12
 
22
- **推荐**:左侧栏「**插件**」页 → 安装 bundle → 填入包名:
23
-
24
- ```
25
- @jianyiagi/dsh-prompt-enhancer
26
- ```
27
-
28
- 装完**完全退出 App 再重新启动**(不是刷新页面)。
29
-
30
- ### CLI / Web 端
31
-
32
- ```powershell
33
- dsh plugin --profile <你的profile> add @jianyiagi/dsh-prompt-enhancer
34
- ```
13
+ 1. 左侧栏进「插件」页
14
+ 2. 安装 bundle,填 `@jianyiagi/dsh-prompt-enhancer`
15
+ 3. 完全退出应用后重新打开
35
16
 
36
- 若 `dsh` 不在 PATH,用 DSH 安装目录下的 bin:
17
+ **CLI / Web 端**:
37
18
 
38
19
  ```powershell
39
- node "<dsh-app>\lib\bin.js" plugin --profile=<profile> add @jianyiagi/dsh-prompt-enhancer
20
+ dsh plugin --profile <profile> add @jianyiagi/dsh-prompt-enhancer
40
21
  ```
41
22
 
42
- > `<dsh-app>` = DSH 安装目录下的 `resources\dsh\app`。
43
- > 若装完没生效,说明包已安装但 **bundle 未被选中**:在「插件」页勾选它,或把包名加入 profile 的 `dsh.profile.bundles` 后重启。
23
+ CLI 安装后若未生效,在「插件」页勾选该插件,或把包名加入 profile `package.json` 的 `dsh.profile.bundles`,然后重启应用。
44
24
 
45
25
  ---
46
26
 
47
27
  ## 使用
48
28
 
49
- | 入口 | 行为 |
50
- |---|---|
51
- | 输入框工具行的闪光按钮(模型选择器左侧) | 草稿非空时出现 → 单击 → 转圈 → 草稿被增强结果替换 |
52
- | 斜杠命令 `/prompt-enhance <文本>` | 结果以命令结果行展示,**不写回草稿**(附带能力) |
29
+ 1. 在输入框输入提示词
30
+ 2. 点模型选择器左侧的按钮
31
+ 3. 按钮停止转动后,输入框内容已替换为改写结果;不满意可在输入框内撤销
53
32
 
54
- 增强失败时按钮左侧显示一行错误(4 秒后自动消失)。
33
+ 输入框为空时按钮不显示。
34
+
35
+ 也可输入 `/prompt-enhance 提示词`,结果以命令结果行显示,不写回输入框。
55
36
 
56
37
  ---
57
38
 
58
- ## 配置:固定增强所用模型(推荐)
39
+ ## 配置
59
40
 
60
- 默认**跟随会话当前模型**。若想更快,可在 profile 补丁里固定一个轻量模型:
41
+ 默认使用当前会话的模型。可在 profile 补丁中指定固定模型:
61
42
 
62
43
  ```yaml
63
44
  - insert:
@@ -68,24 +49,13 @@ node "<dsh-app>\lib\bin.js" plugin --profile=<profile> add @jianyiagi/dsh-prompt
68
49
  model: <model-id>
69
50
  ```
70
51
 
71
- 两个字段必须同时提供才生效;删掉 `config` 即恢复跟随会话模型。
72
-
73
- > 为什么建议固定:增强是**生成密集型**调用。实测同一段提示词,大模型需 25~48 秒,轻量模型仅 4~6 秒(约 6~12 倍)。输出很短,瓶颈完全在模型思考。
74
-
75
- ---
76
-
77
- ## 已知限制(不是 bug)
78
-
79
- 1. **每次增强会在对话流留一行** `prompt-enhance · <结果预览>`。原因:插件唯一的客户端→宿主通道是命令注册表,注册表强制记录 `command/run`/`command/done`,而 Chat 层的命令行展示是宿主内建行为、未开插件级隐藏接口。该行不影响模型历史、不计 token。
80
- 2. **引用芯片会退化为纯文本**:草稿里的 `@文件` 引用在整体替换后变成普通文本。
81
- 3. **直接替换、无预览**:不满意请用编辑器撤销。
82
- 4. **仅文本增强**:不改动附件;单次输入上限 24 KB,超时 60 秒。
52
+ 两个字段需同时提供;删除 `config` 即恢复使用会话模型。
83
53
 
84
54
  ---
85
55
 
86
56
  ## 卸载
87
57
 
88
- 桌面端:「插件」页卸载。CLI:
58
+ 桌面端在「插件」页卸载;CLI:
89
59
 
90
60
  ```powershell
91
61
  dsh plugin --profile <profile> remove @jianyiagi/dsh-prompt-enhancer
@@ -93,19 +63,59 @@ dsh plugin --profile <profile> remove @jianyiagi/dsh-prompt-enhancer
93
63
 
94
64
  ---
95
65
 
96
- ## 它怎么工作
66
+ ## English
67
+
68
+ DSH (DeepSeek Harness) plugin. Type a prompt in the composer, click the button, and the model rewrites it in place.
69
+
70
+ ### Install
71
+
72
+ **Desktop app**
73
+
74
+ 1. Open the **Plugins** page in the left sidebar
75
+ 2. Install bundle, enter `@jianyiagi/dsh-prompt-enhancer`
76
+ 3. Quit the app completely, then start it again
77
+
78
+ **CLI / Web**
97
79
 
80
+ ```powershell
81
+ dsh plugin --profile <profile> add @jianyiagi/dsh-prompt-enhancer
98
82
  ```
99
- 输入框草稿 → 按钮(会话作用域槽位 conversation.input.right)
100
- → ctx.remote.commands.execute("/prompt-enhance <草稿>")
101
- → 宿主命令用 ctx.llm.stream 调模型(凭据走你的账户登录态,插件不接触 API Key)
102
- → 结果经命令结果回传 → inputActions.setDraft(结果)
83
+
84
+ If it does not take effect after a restart, tick the plugin on the Plugins page, or add the package name to `dsh.profile.bundles` in the profile `package.json`, then restart the app.
85
+
86
+ ### Usage
87
+
88
+ 1. Type a prompt in the composer
89
+ 2. Click the button to the left of the model selector
90
+ 3. When the button stops spinning, the draft has been replaced with the rewritten prompt. Undo inside the composer if you do not like it
91
+
92
+ The button is hidden while the composer is empty.
93
+
94
+ You can also type `/prompt-enhance <prompt>`; the result appears as a command result line and is not written back to the composer.
95
+
96
+ ### Configuration
97
+
98
+ By default the current session model is used. To pin a model, add this to the profile patch:
99
+
100
+ ```yaml
101
+ - insert:
102
+ - id: prompt-enhancer
103
+ name: '@jianyiagi/dsh-prompt-enhancer'
104
+ config:
105
+ provider: <provider-id>
106
+ model: <model-id>
103
107
  ```
104
108
 
105
- - 不读取、不存储、不上传任何 API Key
106
- - 不发送除提示词本身以外的任何内容给模型
107
- - 开源免费(MIT)
109
+ Both fields are required; remove `config` to use the session model again.
110
+
111
+ ### Uninstall
112
+
113
+ Untick it on the Plugins page, or:
114
+
115
+ ```powershell
116
+ dsh plugin --profile <profile> remove @jianyiagi/dsh-prompt-enhancer
117
+ ```
108
118
 
109
119
  ---
110
120
 
111
- **版本**:1.0.1 | **仓库**:https://github.com/JianYiAG/dsh-prompt-enhancer | **维护者**:@jianyiagi
121
+ MIT | Repository: https://github.com/JianYiAG/dsh-prompt-enhancer
package/client.js CHANGED
@@ -8,7 +8,7 @@
8
8
  * returned text through the standard `inputActions.setDraft` face.
9
9
  */
10
10
  window.__ModuleLoader__.load({
11
- id: '@local/dsh-prompt-enhancer',
11
+ id: '@jianyiagi/dsh-prompt-enhancer',
12
12
  factory(require) {
13
13
  const React = require('react');
14
14
  const h = React.createElement;
package/cordis.patch.yml CHANGED
@@ -1,7 +1,4 @@
1
- # @jianyiagi/dsh-prompt-enhancer profile patch: inserts the plugin row.
2
- # The host half (index.js) registers the /prompt-enhance command that runs the
3
- # model-backed enhancement; the browser half (client.js) renders the one-click
4
- # button in the composer tool row, immediately left of the model selector.
1
+ # @jianyiagi/dsh-prompt-enhancer 的 profile 补丁:插入插件行。
5
2
 
6
3
  - insert:
7
4
  - id: prompt-enhancer
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jianyiagi/dsh-prompt-enhancer",
3
- "version": "1.0.1",
4
- "description": "One-click prompt enhancement for the DSH composer: 输入框一键优化提示词并写回草稿",
3
+ "version": "1.0.3",
4
+ "description": "DSH 提示词增强器:输入框一键优化提示词并写回草稿",
5
5
  "type": "module",
6
6
  "icon": "./icon.svg",
7
7
  "exports": {