@surfishs/dsh-prompt-enhance 0.0.4 → 0.0.6

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.en.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  [简体中文](./README.md) | English
10
10
 
11
- ![Prompt Enhance: the docked result card above the composer](./docs/images/panel.png)
11
+ ![Prompt Enhance: the docked result card above the composer](./docs/images/panel-en-915.png)
12
12
 
13
13
  ---
14
14
 
@@ -35,6 +35,20 @@
35
35
 
36
36
  ## Install
37
37
 
38
+ ### Let an agent install it
39
+
40
+ No command line needed. Send the block below to an agent that can run commands on your machine (DSH desktop or web):
41
+
42
+ ```text
43
+ Install the DeepSeek Harness plugin @surfishs/dsh-prompt-enhance.
44
+
45
+ 1. First confirm my DSH profile name: usually desktop for the desktop app and web for the web build; ask me if unsure.
46
+ 2. Run: dsh plugin --profile <profile> add @surfishs/dsh-prompt-enhance
47
+ 3. If the npm install fails, use: dsh plugin --profile <profile> add github:surfishs/dsh-prompt-enhance
48
+ 4. After installing, ask me to restart DSH and confirm the plugin appears in the plugin list.
49
+ 5. Do not change my other plugins or DSH configuration.
50
+ ```
51
+
38
52
  From npm:
39
53
 
40
54
  ```bash
@@ -66,9 +80,17 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
66
80
 
67
81
  ## Usage
68
82
 
69
- Leave a draft in the composer, then click the enhance button in the toolbar (or your configured shortcut). An empty or attachment-only draft dims the button and cannot be clicked; over-length or reference-chip drafts are rejected locally. The result appears in a card docked above the composer: apply, copy, regenerate or close it; after applying, the card stays open with a Replaced chip and an undo action; sending the draft closes it automatically, and Escape closes it too. A result that hit the token cap is marked as possibly incomplete.
83
+ 1. **Start**: leave a draft in the composer and click the enhance button in the toolbar (or your configured shortcut).
84
+ 2. **Review**: the result appears in a card docked above the composer. You can:
85
+ - **Apply**: write it back; the card stays open with a Replaced chip;
86
+ - **Copy**: copy the result;
87
+ - **Regenerate**: run the current draft again.
88
+ 3. **Undo**: after applying, click Undo to restore; after closing the card, the undo bar remains above the composer.
89
+ 4. **Close**: sending the draft closes the card automatically; Escape also closes it.
70
90
 
71
- `/enhance <text>` rewrites any text from the slash menu; the result is copyable and never enters model history.
91
+ An empty or attachment-only draft dims the button and makes it unclickable; over-length or reference-chip drafts are rejected locally. A result that hits the token cap is marked as possibly incomplete.
92
+
93
+ `/enhance <text>`: rewrite any text from the slash menu; the result is copyable and never enters model history.
72
94
 
73
95
  ## Configuration
74
96
 
@@ -97,15 +119,20 @@ An empty or attachment-only draft dims the button and starts no request; raise `
97
119
 
98
120
  ## Security
99
121
 
100
- The enhance route is served by your own local dsh host and accepts loopback addresses with a local `Host` / `Origin` only. With `contextAware` on, recent conversation history is sent with the draft to the configured model provider — do not send context from sensitive sessions.
122
+ - **Local access only**: the enhance route is served by the local DSH host and accepts only loopback addresses and local `Host` / `Origin` values, not external origins.
123
+ - **No model keys stored**: the plugin does not read or store model API keys; calls use the host's existing LLM configuration.
124
+ - **Context sent only when enabled**: with `contextAware` on, the most recent user/assistant text and the current draft are sent to the configured model provider (default: up to 8 messages and 4,000 characters); system messages, reasoning, tool results and attachments are excluded. With it off, only the draft is sent.
125
+ - **Sensitive conversations**: if the content must not leave the machine, turn off `contextAware` or use a local/private model route you trust.
101
126
 
102
127
  ## Troubleshooting
103
128
 
104
- - No button: make sure `enabled` is `true` and `dsh web` was restarted after installing.
105
- - The button is dimmed: the composer is empty or has attachments only; type some text to restore it.
106
- - Incomplete result: check the truncation warning and raise `maxOutputTokens`.
107
- - "No model resolved for the enhancement": set `provider` / `model` as a pair, or send a message in the current session first.
108
- - Authentication failed: check the provider's API key in the harness.
129
+ | Symptom | Check / fix |
130
+ |---|---|
131
+ | No enhance button in the toolbar | Confirm `enabled` is `true`; restart DSH (desktop app or `dsh web`) after installing; confirm the active profile. |
132
+ | Button is greyed out | The composer is empty or has attachments only; type text to enable it. |
133
+ | Truncated result | Check the truncation warning and raise `maxOutputTokens` in settings. |
134
+ | "No model resolved for enhancement" | Set both `provider` and `model` in settings, or send a message in the current session so the plugin can follow the session route. |
135
+ | Authentication failure | Check the provider credentials/API key configured in DSH. |
109
136
 
110
137
  ## Development
111
138
 
@@ -120,4 +147,8 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md).
120
147
 
121
148
  ## License
122
149
 
123
- Apache-2.0 (see [LICENSE](./LICENSE)). The code and design build on [rongxingda/dsh-prompt-enhance](https://github.com/rongxingda/dsh-prompt-enhance) (Apache-2.0).
150
+ Licensed under Apache-2.0; see [LICENSE](./LICENSE).
151
+
152
+ ## Credits
153
+
154
+ Thanks to [rongxingda/dsh-prompt-enhance](https://github.com/rongxingda/dsh-prompt-enhance): this project's code and design build on that project (Apache-2.0).
package/README.md CHANGED
@@ -35,6 +35,20 @@
35
35
 
36
36
  ## 安装
37
37
 
38
+ ### 让 Agent 帮你安装
39
+
40
+ 不用自己敲命令。把下面整段发给能操作本机终端的 Agent(DSH 桌面版、Web 版都可以):
41
+
42
+ ```text
43
+ 帮我安装 DeepSeek Harness 插件 @surfishs/dsh-prompt-enhance。
44
+
45
+ 1. 先确认我的 DSH profile 名:桌面版通常是 desktop,Web 版通常是 web;不确定就问我。
46
+ 2. 执行:dsh plugin --profile <profile> add @surfishs/dsh-prompt-enhance
47
+ 3. 如果 npm 安装失败,改用:dsh plugin --profile <profile> add github:surfishs/dsh-prompt-enhance
48
+ 4. 安装完成后提示我重启 DSH,并让我确认插件出现在插件列表中。
49
+ 5. 不要修改我的其他插件或 DSH 配置。
50
+ ```
51
+
38
52
  从 npm 安装:
39
53
 
40
54
  ```bash
@@ -66,9 +80,17 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
66
80
 
67
81
  ## 使用
68
82
 
69
- 在输入框留下草稿,点输入框工具栏的增强按钮(或你设置的快捷键)。输入为空或只有附件时按钮灰掉、不可点;超长或含引用块会被本地拒绝。结果出现在输入框上方的停靠卡里:可回填、复制、重新生成或关闭;回填后卡片保持打开并显示「已替换」,可直接撤销;发送消息时自动收起,`Esc` 关闭。输出达到 Token 上限时会提示结果可能不完整。
83
+ 1. **开始**:在输入框写下草稿,点工具栏的增强按钮(或你设置的快捷键)。
84
+ 2. **查看结果**:结果出现在输入框上方的停靠卡里,可以:
85
+ - **回填**:写回输入框,卡片保持打开并显示「已替换」;
86
+ - **复制**:复制结果;
87
+ - **重新生成**:按当前输入再生成一版。
88
+ 3. **撤销**:回填后点「撤销」恢复;关闭卡片后,输入框上方仍保留撤销条。
89
+ 4. **关闭**:发送消息时卡片自动收起,按 `Esc` 也可以关闭。
70
90
 
71
- `/enhance <文本>` 从斜杠面板改写任意文本,结果可复制,不进入模型历史。
91
+ 输入为空或只有附件时,按钮会变灰、不可点;超长或含引用块会被本地拒绝。输出达到 Token 上限时,会提示结果可能不完整。
92
+
93
+ `/enhance <文本>`:从斜杠面板改写任意文本,结果可复制,不进入模型历史。
72
94
 
73
95
  ## 配置
74
96
 
@@ -97,15 +119,20 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
97
119
 
98
120
  ## 安全
99
121
 
100
- 增强路由只由本机 dsh 宿主提供,仅接受回环地址与本地 `Host` / `Origin`。`contextAware` 开启时,会话历史会随草稿发给当前配置的模型服务商——不要把敏感会话的上下文外发。
122
+ - **仅本机可访问**:增强路由由本机 DSH 宿主提供,只接受回环地址和本地 `Host` / `Origin`,不接受外部来源。
123
+ - **不保存模型密钥**:插件不读取或存储模型 API key,调用走宿主已有的 LLM 配置。
124
+ - **上下文按需发送**:`contextAware` 开启时,最近几轮 user/assistant 文本和当前草稿会发给当前配置的模型服务商(默认最多 8 条消息、4000 字符);system、reasoning、工具结果和附件不会进入上下文。关闭后只发送草稿。
125
+ - **敏感会话**:如果内容不能外发,请关闭 `contextAware`,或改用你信任的本地/私有模型服务。
101
126
 
102
127
  ## 故障排查
103
128
 
104
- - 按钮不出现:确认 `enabled` 为 `true`,且安装后重启了 `dsh web`。
105
- - 按钮是灰的:输入框为空或只有附件;输入文字后恢复。
106
- - 结果不完整:查看截断提示,并调高 `maxOutputTokens`。
107
- - 「尚未确定增强用的模型」:成对填写 `provider` / `model`,或先在当前会话发一条消息。
108
- - 鉴权失败:检查对应 provider 在 harness 中的 API Key。
129
+ | 现象 | 检查与处理 |
130
+ |---|---|
131
+ | 工具栏没有增强按钮 | 确认 `enabled` 为 `true`;安装后重启 DSH(桌面版或 `dsh web`);确认当前 profile 正确。 |
132
+ | 按钮是灰的 | 输入框为空或只有附件;输入文字后恢复。 |
133
+ | 结果不完整 | 查看截断提示,并在设置中调高 `maxOutputTokens`。 |
134
+ | 提示「尚未确定增强用的模型」 | 在设置中成对填写 `provider` / `model`;或先在当前会话发一条消息,让插件跟随会话模型。 |
135
+ | 鉴权失败 | 检查对应 provider 在 DSH 中的凭据/API Key 是否有效。 |
109
136
 
110
137
  ## 开发
111
138
 
@@ -120,4 +147,8 @@ npm run build
120
147
 
121
148
  ## 许可证
122
149
 
123
- Apache-2.0(见 [LICENSE](./LICENSE))。代码与设计建立在 [rongxingda/dsh-prompt-enhance](https://github.com/rongxingda/dsh-prompt-enhance)(Apache-2.0)之上。
150
+ 本项目采用 Apache-2.0,见 [LICENSE](./LICENSE)。
151
+
152
+ ## 致敬
153
+
154
+ 感谢 [rongxingda/dsh-prompt-enhance](https://github.com/rongxingda/dsh-prompt-enhance):本项目的代码与设计建立在该项目(Apache-2.0)的基础之上。
Binary file
Binary file