@surfishs/dsh-prompt-enhance 0.0.2 → 0.0.4

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,13 +8,18 @@
8
8
 
9
9
  [简体中文](./README.md) | English
10
10
 
11
+ ![Prompt Enhance: the docked result card above the composer](./docs/images/panel.png)
12
+
11
13
  ---
12
14
 
13
15
  ## Features
14
16
 
15
- - **One-click enhance**: the ✨ button beside send; the shortcut is off by default and can be set in the settings.
16
- - **Side-by-side preview**: original and result together, with model and timing; apply, copy, or cancel.
17
- - **One-click undo**: an undo bar appears under the composer after applying.
17
+ - **One-click enhance**: the enhance button in the composer toolbar (DeepSeek fish mark with a sparkle); the shortcut is off by default and can be set in the settings. The original draft is preserved, and a failure never touches it.
18
+ - **Docked result card**: the result appears above the composer without covering the conversation, with model, timing and token usage. Apply, copy, regenerate or undo; sending the draft closes it automatically, Escape closes it too.
19
+ - **Apply and undo**: after applying, the card stays open with a Replaced chip and an undo action; once closed, the undo bar remains above the composer.
20
+ - **Regenerate**: re-runs the current composer text; after applying, it can regenerate the enhanced draft as well.
21
+ - **Empty-draft dimming**: with no text (or attachments only), the icon dims and neither clicks nor the shortcut start a request.
22
+ - **Truncation warning**: when the output hits the token cap, the partial result is kept and marked as possibly incomplete.
18
23
  - **`/enhance <text>`**: rewrite any text from the slash menu; the result never enters model history.
19
24
  - **Model routing**: pinned settings pair → current session model → harness default, in that order.
20
25
  - **Context aware**: uses recent conversation to resolve references; can be turned off.
@@ -61,7 +66,7 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
61
66
 
62
67
  ## Usage
63
68
 
64
- Leave a draft in the composer, then click ✨ (or your configured shortcut). Empty, over-length, images-only, and command/reference drafts are rejected locally (over-length is never truncated). A valid draft opens the preview; Apply writes it back and raises the undo bar, Copy puts it on the clipboard, `Esc` cancels, and a poor result can be retried.
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.
65
70
 
66
71
  `/enhance <text>` rewrites any text from the slash menu; the result is copyable and never enters model history.
67
72
 
@@ -88,6 +93,8 @@ Edit in **Settings → dsh-prompt-enhance** (or Plugins → `dsh-prompt-enhance`
88
93
  | `maxConcurrent` | `2` | Concurrent enhancement limit; a new request past the limit is told to retry later |
89
94
  | `rateLimitPerMinute` | `10` | Successful enhancements per minute (sliding window); past the limit the request is told to retry later |
90
95
 
96
+ An empty or attachment-only draft dims the button and starts no request; raise `maxOutputTokens` when a result is truncated.
97
+
91
98
  ## Security
92
99
 
93
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.
@@ -95,6 +102,8 @@ The enhance route is served by your own local dsh host and accepts loopback addr
95
102
  ## Troubleshooting
96
103
 
97
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`.
98
107
  - "No model resolved for the enhancement": set `provider` / `model` as a pair, or send a message in the current session first.
99
108
  - Authentication failed: check the provider's API key in the harness.
100
109
 
package/README.md CHANGED
@@ -8,13 +8,18 @@
8
8
 
9
9
  简体中文 | [English](./README.en.md)
10
10
 
11
+ ![提示词增强:输入框上方的停靠结果卡](./docs/images/panel.png)
12
+
11
13
  ---
12
14
 
13
15
  ## 功能
14
16
 
15
- - **一键增强**:发送键旁的 ✨ 按钮;快捷键默认关闭,可在设置中自行指定。
16
- - **对比预览**:原文与结果并排,附模型与耗时;可回填、复制或取消。
17
- - **一键撤销**:回填后输入框上方出现撤销条。
17
+ - **一键增强**:输入框工具栏的增强按钮(DeepSeek 鱼形标识 + 星芒);快捷键默认关闭,可在设置中指定。原文保留,失败不改草稿。
18
+ - **停靠结果卡**:结果显示在输入框上方,不遮挡对话;附模型、耗时与 token 用量,可回填、复制、重新生成或撤销;发送消息时自动收起,`Esc` 关闭。
19
+ - **回填与撤销**:回填后结果卡保持打开并显示「已替换」,可直接撤销;关闭后输入框上方仍保留撤销条。
20
+ - **重新生成**:按当前输入框内容重新请求;回填后也可对增强稿再生成。
21
+ - **空输入灰态**:没有文字或只有附件时图标变浅,点击和快捷键都不发起请求。
22
+ - **截断提示**:输出达到 Token 上限时保留已生成内容,并提示结果可能不完整。
18
23
  - **`/enhance <文本>`**:从斜杠面板改写任意文本,结果不进入模型历史。
19
24
  - **模型路由**:设置成对覆盖 → 当前会话模型 → 全局默认模型,逐级回退。
20
25
  - **上下文感知**:参考当前会话近况消解指代;可关闭。
@@ -61,7 +66,7 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
61
66
 
62
67
  ## 使用
63
68
 
64
- 在输入框留下草稿,点 ✨(或你设置的快捷键)。空草稿、超长草稿、仅图片、含命令或引用块的草稿会被本地拒绝(超长不截断);通过后打开预览,回填写回输入框并升起撤销条,复制进剪贴板,`Esc` 取消。结果不满意可重试。
69
+ 在输入框留下草稿,点输入框工具栏的增强按钮(或你设置的快捷键)。输入为空或只有附件时按钮灰掉、不可点;超长或含引用块会被本地拒绝。结果出现在输入框上方的停靠卡里:可回填、复制、重新生成或关闭;回填后卡片保持打开并显示「已替换」,可直接撤销;发送消息时自动收起,`Esc` 关闭。输出达到 Token 上限时会提示结果可能不完整。
65
70
 
66
71
  `/enhance <文本>` 从斜杠面板改写任意文本,结果可复制,不进入模型历史。
67
72
 
@@ -88,6 +93,8 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
88
93
  | `maxConcurrent` | `2` | 同时进行的增强上限;达到上限时新请求会提示稍后再试 |
89
94
  | `rateLimitPerMinute` | `10` | 每分钟增强次数上限(滑动窗口);超限时提示稍后再试 |
90
95
 
96
+ 输入为空或只有附件时按钮灰掉,不发起请求;结果被截断时调高 `maxOutputTokens`。
97
+
91
98
  ## 安全
92
99
 
93
100
  增强路由只由本机 dsh 宿主提供,仅接受回环地址与本地 `Host` / `Origin`。`contextAware` 开启时,会话历史会随草稿发给当前配置的模型服务商——不要把敏感会话的上下文外发。
@@ -95,6 +102,8 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
95
102
  ## 故障排查
96
103
 
97
104
  - 按钮不出现:确认 `enabled` 为 `true`,且安装后重启了 `dsh web`。
105
+ - 按钮是灰的:输入框为空或只有附件;输入文字后恢复。
106
+ - 结果不完整:查看截断提示,并调高 `maxOutputTokens`。
98
107
  - 「尚未确定增强用的模型」:成对填写 `provider` / `model`,或先在当前会话发一条消息。
99
108
  - 鉴权失败:检查对应 provider 在 harness 中的 API Key。
100
109
 
Binary file