@surfishs/dsh-prompt-enhance 0.0.5 → 0.0.7
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 +17 -8
- package/README.md +16 -7
- package/docs/images/panel-en-915.png +0 -0
- package/docs/images/panel.png +0 -0
- package/lib/client.js +351 -31
- package/package.json +1 -1
- package/src/client/locales.ts +10 -4
- package/src/client/settings-page.tsx +295 -43
- package/src/client/styles.ts +99 -0
package/README.en.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
[简体中文](./README.md) | English
|
|
10
10
|
|
|
11
|
-

|
|
11
|
+

|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -119,15 +119,20 @@ An empty or attachment-only draft dims the button and starts no request; raise `
|
|
|
119
119
|
|
|
120
120
|
## Security
|
|
121
121
|
|
|
122
|
-
|
|
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.
|
|
123
126
|
|
|
124
127
|
## Troubleshooting
|
|
125
128
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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. |
|
|
131
136
|
|
|
132
137
|
## Development
|
|
133
138
|
|
|
@@ -142,4 +147,8 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
|
|
142
147
|
|
|
143
148
|
## License
|
|
144
149
|
|
|
145
|
-
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
|
@@ -119,15 +119,20 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
|
|
|
119
119
|
|
|
120
120
|
## 安全
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
- **仅本机可访问**:增强路由由本机 DSH 宿主提供,只接受回环地址和本地 `Host` / `Origin`,不接受外部来源。
|
|
123
|
+
- **不保存模型密钥**:插件不读取或存储模型 API key,调用走宿主已有的 LLM 配置。
|
|
124
|
+
- **上下文按需发送**:`contextAware` 开启时,最近几轮 user/assistant 文本和当前草稿会发给当前配置的模型服务商(默认最多 8 条消息、4000 字符);system、reasoning、工具结果和附件不会进入上下文。关闭后只发送草稿。
|
|
125
|
+
- **敏感会话**:如果内容不能外发,请关闭 `contextAware`,或改用你信任的本地/私有模型服务。
|
|
123
126
|
|
|
124
127
|
## 故障排查
|
|
125
128
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
| 现象 | 检查与处理 |
|
|
130
|
+
|---|---|
|
|
131
|
+
| 工具栏没有增强按钮 | 确认 `enabled` 为 `true`;安装后重启 DSH(桌面版或 `dsh web`);确认当前 profile 正确。 |
|
|
132
|
+
| 按钮是灰的 | 输入框为空或只有附件;输入文字后恢复。 |
|
|
133
|
+
| 结果不完整 | 查看截断提示,并在设置中调高 `maxOutputTokens`。 |
|
|
134
|
+
| 提示「尚未确定增强用的模型」 | 在设置中成对填写 `provider` / `model`;或先在当前会话发一条消息,让插件跟随会话模型。 |
|
|
135
|
+
| 鉴权失败 | 检查对应 provider 在 DSH 中的凭据/API Key 是否有效。 |
|
|
131
136
|
|
|
132
137
|
## 开发
|
|
133
138
|
|
|
@@ -142,4 +147,8 @@ npm run build
|
|
|
142
147
|
|
|
143
148
|
## 许可证
|
|
144
149
|
|
|
145
|
-
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
|
package/docs/images/panel.png
CHANGED
|
Binary file
|