@surfishs/dsh-prompt-enhance 0.1.6 → 0.1.8

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
@@ -11,7 +11,9 @@
11
11
 
12
12
  [简体中文](./README.md) | English
13
13
 
14
- **Prompt enhancement for the DeepSeek Harness web GUI** — turn a composer draft into a structured prompt in one click: role and goal, context and constraints, executable steps, output format, acceptance criteria, edge cases. It keeps your intent unchanged, invents no requirements, and writes a placeholder instead of guessing; the composer draft is never modified.
14
+ **Prompt enhancement for the DeepSeek Harness web GUI** — turn a composer draft into a structured prompt in one click: role and goal, context and constraints, executable steps, output format, acceptance criteria, edge cases.
15
+
16
+ The draft is the source of truth: intent unchanged, no invented requirements, a placeholder wherever information is missing — and it is never modified, not even when a call fails. The result appears in a card above the composer, is written back only when you apply it, and one click undoes that.
15
17
 
16
18
  ![Prompt Enhance: the docked result card above the composer](./docs/images/panel-en.png)
17
19
 
@@ -19,15 +21,21 @@
19
21
 
20
22
  ## Why you need it
21
23
 
22
- A good prompt spells out four things: who the model acts as, what it hands over, in what format, and what counts as correct — most drafts say none of this.
24
+ Users tend to open with a plea: "So… could you help me out?" — like a patient who says only "I don't feel well" and expects a prescription. The model gets nothing but that plea, so it has to guess; the guesses look plausible, but they are often not what you meant.
25
+
26
+ ![A photo captioned “So… could you help me out?”, with the plugin icon in the top-right corner](./docs/images/promo-enhance-en.png)
27
+
28
+ *“So… could you help me out?” — a pleading request like this is exactly what this plugin rewrites*
29
+
30
+ A good prompt spells out six things — who the model acts as and what it delivers, the context and constraints it works under, which steps it takes, in what format, what counts as correct, and where the boundaries are.
23
31
 
24
- The plugin adds a Prompt enhancement button to the composer toolbar: one click sends the draft to DSH's model service, which rewrites it around those four things as a structured prompt.
32
+ That is what the plugin fills in for you.
25
33
 
26
- The result appears in a card docked above the composer without covering the conversation; your draft is never replaced — apply it, copy it, regenerate it, or undo, and the original text can always be restored.
34
+ ## Button and result card
27
35
 
28
- With context awareness on, the plugin passes the most recent messages between you and the assistant to the model, helping it resolve references such as "it" or "that" and fill in task context the draft leaves out, so the rewrite stays closer to what you meant.
36
+ The plugin adds a Prompt enhancement button to the composer toolbar. One click sends your draft to DSH's model service, which rewrites it into a structured prompt.
29
37
 
30
- > **Note**: the context window is limited. If the draft depends on earlier messages, add the necessary background to the draft; otherwise the rewrite may drift from your intent.
38
+ The rewritten prompt appears in a card docked above the composer without covering the conversation. Your draft is never replaced: you can apply it, copy it, regenerate it, or undo — the draft you started from can always be restored.
31
39
 
32
40
  ## Feature overview
33
41
 
@@ -40,7 +48,7 @@ With context awareness on, the plugin passes the most recent messages between yo
40
48
  | 🔄 **Regenerate** | Request another version from the current text; an applied enhanced draft can be regenerated too |
41
49
  | 💬 **`/enhance` command** | Rewrite any text from the slash menu; the result never enters model history |
42
50
  | 🧭 **Model routing** | A pinned `provider` + `model` pair wins; otherwise it follows the session model, then the global default |
43
- | 🧩 **Context aware** | With `contextAware` on, recent messages between you and the assistant resolve references such as "it" or "that" and fill in task context the draft leaves out; you can turn it off at any time |
51
+ | 🧩 **Context aware** | With `contextAware` on, recent messages between you and the assistant resolve references such as "it" or "that" and fill in task context the draft leaves out; you can turn it off at any time.<br>*Note: the context window is limited — if the draft depends on earlier messages, add that background to the draft or the rewrite may drift from your intent* |
44
52
  | 🔑 **Zero credentials** | Calls use DSH's model service and credential store; the plugin never reads or stores keys |
45
53
  | 🛡️ **Draft safety** | Empty, attachment-only, over-length and command-or-reference drafts are blocked locally; upstream failures get a readable message and never touch the draft |
46
54
  | ⚙️ **Live settings** | Fields save automatically, common rows first and the rest under Advanced; changes apply on the next call |
@@ -127,7 +135,7 @@ Right-click or long-press the enhance button in the toolbar to open the quick se
127
135
 
128
136
  `/enhance <text>`: rewrite any text from the slash menu; the result is copyable and never enters model history.
129
137
 
130
- The ⓘ in the result-card footer reports the conversation messages and characters this enhancement actually referenced, e.g. `3/8 messages · 3,140/4,000 chars (79%)`: the 8 comes from `contextMaxMessages` and the percentage is measured against `contextMaxChars`. DSH-injected environment, skill, time and other messages are not counted.
138
+ The ⓘ in the result-card footer reports the conversation messages and characters this enhancement actually referenced, e.g. `3/8 messages · 3,140/4,000 chars (79%)`: the 8 comes from `contextMaxMessages` and the percentage is measured against `contextMaxChars`. DSH-injected environment, skill, time and other messages are not counted. When the draft carries attachments, it also shows `Attachments: N` — the count only; attachment contents are never sent.
131
139
 
132
140
  ## Configuration
133
141
 
@@ -140,7 +148,6 @@ Edit in **Settings → Prompt enhance** (or Plugins → `dsh-prompt-enhance` →
140
148
  | `enabled` | `true` | Master switch; off hides the composer button and disables the command and shortcut |
141
149
  | `provider` + `model` | empty | Pick from the DSH-registered LLM providers and their models; the model can switch to “Custom…” to type an id; unconfigured providers are greyed out until set up in DSH model services; empty follows the session model (no pinned route). With only one filled, the save falls back to follow-session; switching the provider clears the chosen model so a stale pair cannot remain |
142
150
  | `reasoningEffort` | `off` | Tiers come from what the configured provider/model declares (DeepSeek: `off` / `low` / `high` / `max`). "Model default" sends no field, so the provider applies its default; switching to a model that does not declare the stored tier rewrites it to "Model default" |
143
- | `temperature` | `0.3` | Sampling temperature `0~1` (step 0.05); lower stays closer to the original |
144
151
  | `contextAware` | `true` | Read recent messages to resolve references; turn it off for sensitive sessions |
145
152
  | `streaming` | `true` | Show the result as it is written; display only, the final result is unchanged |
146
153
  | `systemPrompt` | empty | Custom system prompt; empty uses the built-in strategy |
@@ -153,6 +160,7 @@ Edit in **Settings → Prompt enhance** (or Plugins → `dsh-prompt-enhance` →
153
160
  | `foldAnimation` | `true` | Whether the card animates when it folds or expands; never animates when the system asks for reduced motion |
154
161
  | `autoFold` | `true` | Fold the card after applying and expand it again after undoing |
155
162
  | `strategyMode` | `replace-default` | `replace-default` replaces the built-in strategy (the minimal output contract still applies); `extend-default` appends the custom strategy after the built-in one |
163
+ | `temperature` | `0.3` | Sampling temperature `0~1` (step 0.05); lower stays closer to the original |
156
164
  | `maxInputChars` | `12000` | Input character cap; over-limit is rejected, never truncated |
157
165
  | `maxOutputTokens` | `8192` | Output token cap per call |
158
166
  | `timeoutMs` | `60000` | End-to-end timeout per call (ms) |
@@ -161,7 +169,11 @@ Edit in **Settings → Prompt enhance** (or Plugins → `dsh-prompt-enhance` →
161
169
  | `maxConcurrent` | `2` | Concurrent enhancement limit; a new request past the limit is told to retry later |
162
170
  | `rateLimitPerMinute` | `10` | Successful enhancements per minute, counted over any rolling 60 seconds; past the limit the request is told to retry later |
163
171
 
164
- An empty or attachment-only draft dims the button and starts no request; raise `maxOutputTokens` when a result is truncated.
172
+ ### About the default reasoning effort
173
+
174
+ This plugin defaults to `off`, and that default is usually the right one to keep. Prompt enhancement is normally a short, well-specified task — restating a draft more clearly — so no chain of reasoning is needed: on a simple task a thinking tier buys little, while costing several times the output tokens and a longer wait. A thinking tier is not without value — when the draft leans on involved context, or the task itself calls for weighing trade-offs, raising the tier clearly improves the rewrite, and you can do it for that one call. When you need more capability, a stronger model usually pays off more than a higher effort tier. Both the settings page and the right-click quick card switch the tier, so you can compare on the same draft.
175
+
176
+ Do not pick a model that is too weak for the job: the output is a task description handed to the downstream model, and a noticeably weaker model tends to make it vaguer, drop key constraints, or drift from what you meant — **a lower-quality prompt can be worse than no rewrite at all**. Do not route prompt optimisation through a model weaker than the one running the current session.
165
177
 
166
178
  ## Security
167
179
 
@@ -271,6 +283,48 @@ The table is organized by what you see; parameter meanings and defaults are in C
271
283
  | Message says no model is configured for the enhancement (no model route) | No pinned `provider`/`model` pair and no session model route | Set both `provider` and `model` in settings, or send a message in the current session so the plugin can follow the session model |
272
284
  | `/enhance` shows only the first line and cannot be expanded | A rendering limit of the DSH chat UI, not this plugin | Put the same text in the composer and use the enhance button; its card wraps and scrolls |
273
285
 
286
+ ## Known issues
287
+
288
+ The items below are known issues, numbered. Anything marked (no support planned) is a capability we do not currently provide, not a defect awaiting a fix.
289
+
290
+ ### 1. Reference preservation (no support planned)
291
+
292
+ This plugin **does not preserve references**. It does not offer "chip-preserving fill-back" or any equivalent that writes `@file` references, links, or commands back into the composer intact. A draft containing such references is rejected locally, before any request is sent. The plugin enhances the text you typed — turning a rough draft into a fuller, clearer prompt — and does not carry or rebuild reference structures.
293
+
294
+ #### Why it is out of scope
295
+
296
+ A rewrite has to reorganise the text. Once reference markers are allowed into that text, they restrict how much can be rewritten and pull the model's attention onto the markers themselves, at the cost of the body's completeness and readability. **Reference markers damaging the body text is an error we are not willing to accept**, so the draft is refused instead.
297
+
298
+ #### Breakage observed in testing
299
+
300
+ Evaluating the "chip-preserving fill-back" approach used by a comparable plugin reproduced three failure modes:
301
+
302
+ - **References lost**: the chip disappears, or degrades into ordinary text that merely looks like a reference;
303
+ - **References misplaced**: the chip survives but its position or target no longer matches the text;
304
+ - **Body text absorbed into a reference**: wording that belongs to the body ends up inside the reference range.
305
+
306
+ All three are visible in the result: the formatting is already broken by the time you read the enhanced prompt — a reference is gone, has turned into plain text, or no longer lines up with the body.
307
+
308
+ #### What to do with such a draft
309
+
310
+ - Drafts containing `@file` references, links, or commands are blocked locally and no request is sent (see "How it works");
311
+ - When a draft carries attachments, the model is told only how many there are — contents are never read or sent, and no attachment markers are inserted into the result;
312
+ - To enhance such a draft, remove the references first, put the necessary details in plain text, then insert the references back manually.
313
+
314
+ ### 2. Reading images and attachment contents (no support planned)
315
+
316
+ This plugin **does not read images, and does not read attachment contents**. When a draft carries attachments, it knows only how many there are, and the model is told it cannot see them: it may write a pointer such as "see the attachment", but must not describe, guess, or transcribe what is inside. The originals travel with your message to the downstream model, which reads them itself.
317
+
318
+ #### Why it is out of scope
319
+
320
+ What the enhancement delivers is better **text**. Let the enhancement model read an image or a document, and what it read becomes a transcription inside that text: a transcription can be wrong, while the originals reach the downstream model too — and which one wins when they disagree is not guaranteed. Images are the worst case: small print and chart values are costly to get wrong, and they are exactly what the downstream model reads most reliably from the original and what the enhancement model is most likely to misread.
321
+
322
+ The cost does not add up either: the same content is read twice, once during enhancement and once during execution, and images make that most obvious in tokens. Binary attachments (PDF, DOCX, and so on) add a further limit: on the host side their contents are never handed to the model — only a file handle is — so reading them would mean parsing them in the plugin, which is a different scale of work.
323
+
324
+ #### What to do instead
325
+
326
+ Put the details you actually need into the draft: the exact error, the numbers, the field names, the steps. That is what the enhancement can genuinely improve; leave the rest of the attachment to the downstream model, which has the original.
327
+
274
328
  ## Development
275
329
 
276
330
  **Common commands**
package/README.md CHANGED
@@ -12,7 +12,9 @@
12
12
 
13
13
  简体中文 | [English](./README.en.md)
14
14
 
15
- **DeepSeek Harness Web GUI 的「提示词增强」插件** —— 一键把输入框草稿改写为结构化提示词:角色与目标、上下文与约束、可执行步骤、输出格式、验收标准、边界条件。以原文为准,不改变原意、不凭空编造需求;信息不足时留占位,草稿不会被改动。
15
+ **DeepSeek Harness Web GUI 的「提示词增强」插件** —— 一键把输入框草稿改写为结构化提示词:角色与目标、上下文与约束、可执行步骤、输出格式、验收标准、边界条件。
16
+
17
+ 以原文为准:不改变原意、不凭空编造需求;信息不足时留占位。改写不改动你的草稿(出错时也不会):结果先出现在结果卡里,点「回填」才写回,回填后可一键撤销。
16
18
 
17
19
  ![提示词增强:输入框上方的停靠结果卡](./docs/images/panel.png)
18
20
 
@@ -20,15 +22,21 @@
20
22
 
21
23
  ## 为什么需要它
22
24
 
23
- 好的提示词会讲清四件事:让模型扮演谁、交付什么、以什么格式、怎样算合格——多数草稿没写这些。
25
+ 用户往往带着祈求的语气发问「那你能帮帮我吗?」——像病人只说一句「我不舒服」,就等着大夫开药。可模型拿到的只有这句求助,它只能自己猜;猜出来的部分看着合理,却常常不是你的原意。
26
+
27
+ ![配文「那你能帮帮我吗?」的照片,右上角是插件图标](./docs/images/promo-enhance.png)
28
+
29
+ *「那你能帮帮我吗?」——这样一句祈求式提问,正是本插件要改写的对象*
30
+
31
+ 一段好的提示词会讲清六件事——让模型扮演什么角色、交付什么结果,在什么上下文和约束下做,分哪几步,以什么格式输出,怎样算合格,边界在哪。
24
32
 
25
- 插件在输入框工具栏加了一个「提示词增强」按钮:点一下,草稿就会交给 DSH 的模型服务,按上面那四件事改写成结构化提示词。
33
+ 插件做的,就是把这几件事替你补齐。
26
34
 
27
- 结果出现在输入框上方的停靠卡里,不遮挡对话;草稿不会被直接替换——你可以回填、复制、重新生成或撤销,原文随时可恢复。
35
+ ## 按钮与结果卡
28
36
 
29
- 开启后,插件会参考最近几条你和助手的消息,帮模型理解「它」「这个」指什么,补全草稿省略的任务背景,让改写更贴近原意。
37
+ 插件在输入框工具栏加了一个「提示词增强」按钮。点一下,插件就会把你的草稿交给 DSH 的模型服务,把它改写成结构化提示词。
30
38
 
31
- > **注意**:上下文窗口有限;如果草稿依赖更早的消息,请把必要背景补进草稿,否则改写可能偏离你的原意。
39
+ 改写后的提示词会出现在输入框上方的结果卡里,不遮挡对话。草稿不会被直接替换:你可以回填、复制、重新生成或撤销,改写前的草稿随时可恢复。
32
40
 
33
41
  ## 功能一览
34
42
 
@@ -41,7 +49,7 @@
41
49
  | 🔄 **重新生成** | 按当前输入框内容再请求一版;回填后的增强稿也可继续生成 |
42
50
  | 💬 **`/enhance` 命令** | 斜杠面板直接改写任意文本;结果不进入模型历史 |
43
51
  | 🧭 **模型路由** | 设置中同时指定 `provider` 与 `model` 时优先;否则依次跟随当前会话模型、全局默认模型 |
44
- | 🧩 **上下文感知** | `contextAware` 开启时参考最近几条你与助手的消息,补全「它 / 这个」这类指代和草稿省略的任务背景;可随时关闭 |
52
+ | 🧩 **上下文感知** | `contextAware` 开启时参考最近几条你与助手的消息,补全「它 / 这个」这类指代和草稿省略的任务背景;可随时关闭。<br>*注意:上下文窗口有限,草稿依赖更早消息时请把必要背景补进草稿,否则改写可能偏离你的原意* |
45
53
  | 🔑 **零凭据配置** | 调用走 DSH 的模型服务,密钥来自 DSH 凭据存储;插件不读取也不保存 |
46
54
  | 🛡️ **草稿安全** | 空输入、仅附件、超长、含命令或文件引用都在本地拦截;上游失败给出可读提示,且不改动草稿 |
47
55
  | ⚙️ **配置热生效** | 字段改完自动保存,常用项在前、其余收进「高级设置」;下一次调用立即生效 |
@@ -105,7 +113,7 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
105
113
  ## 使用
106
114
 
107
115
  1. **开始**:在输入框写下草稿,点工具栏的增强按钮(或你设置的快捷键)。
108
- 2. **查看结果**:结果出现在输入框上方的停靠卡里,可以:
116
+ 2. **查看结果**:结果出现在输入框上方的结果卡里,可以:
109
117
  - **回填**:写回输入框,卡片默认自动折叠为标题行,底部按钮变为「撤销」;
110
118
  - **复制**:复制结果;
111
119
  - **重新生成**:按当前输入再生成一版。
@@ -128,7 +136,7 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
128
136
 
129
137
  `/enhance <文本>`:从斜杠面板改写任意文本,结果可复制,不进入模型历史。
130
138
 
131
- 结果卡页脚的 ⓘ 显示本次增强实际引用的对话消息条数与字符数,例如 `3/8 条 · 3,140/4,000 字(79%)`:8 来自 `contextMaxMessages`,百分比按 `contextMaxChars` 计算;DSH 注入的环境/技能/时间等消息不计入。
139
+ 结果卡页脚的 ⓘ 显示本次增强实际引用的对话消息条数与字符数,例如 `3/8 条 · 3,140/4,000 字(79%)`:8 来自 `contextMaxMessages`,百分比按 `contextMaxChars` 计算;DSH 注入的环境/技能/时间等消息不计入。草稿带附件时,还会显示 `附件:N 个`——只统计数量,附件内容不会发送。
132
140
 
133
141
  ## 配置
134
142
 
@@ -141,7 +149,6 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
141
149
  | `enabled` | `true` | 总开关;关闭后隐藏输入框按钮,并停用命令与快捷键 |
142
150
  | `provider` + `model` | 空 | 从 DSH 已注册的 LLM provider 及模型中选择;模型可选「自定义…」手填 ID;未配置的 provider 置灰、需先在 DSH 模型服务中配置;留空表示跟随当前会话模型(不固定路由)。只填一个时保存后按跟随会话处理;切换 provider 会清空已选 model,避免留下不匹配的旧值 |
143
151
  | `reasoningEffort` | `off` | 档位由当前 provider/model 的声明决定;DeepSeek 为 `off` / `low` / `high` / `max`。选「模型默认」时不发送该字段,由提供方使用默认档;切换到不声明当前档位的模型时,插件会自动改回「模型默认」 |
144
- | `temperature` | `0.3` | 采样温度 `0~1`(步进 0.05),越低越忠实原文 |
145
152
  | `contextAware` | `true` | 读取最近几条消息以消解指代;含敏感内容的会话建议关闭 |
146
153
  | `streaming` | `true` | 边写边显示;仅影响显示节奏,最终结果不变 |
147
154
  | `systemPrompt` | 空 | 自定义系统提示词;留空使用内置增强策略 |
@@ -154,6 +161,7 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
154
161
  | `foldAnimation` | `true` | 结果卡折叠/展开时是否播放动画;系统开启「减少动态效果」时始终不播放 |
155
162
  | `autoFold` | `true` | 回填后自动折叠结果卡,撤销后自动展开 |
156
163
  | `strategyMode` | `replace-default` | `replace-default` 整体替换内置策略(仍保留最小输出契约);`extend-default` 把自定义策略追加在内置策略之后 |
164
+ | `temperature` | `0.3` | 采样温度 `0~1`(步进 0.05),越低越忠实原文 |
157
165
  | `maxInputChars` | `12000` | 输入字符上限;超限拒绝,不截断 |
158
166
  | `maxOutputTokens` | `8192` | 单次调用的输出 token 上限 |
159
167
  | `timeoutMs` | `60000` | 单次调用端到端超时(毫秒) |
@@ -162,7 +170,11 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
162
170
  | `maxConcurrent` | `2` | 同时进行的增强上限;达到上限时新请求会提示稍后再试 |
163
171
  | `rateLimitPerMinute` | `10` | 每分钟成功增强次数上限,按任意连续 60 秒计算;超限时提示稍后再试 |
164
172
 
165
- 输入为空或只有附件时按钮变灰、不可点,不发起请求;结果被截断时调高 `maxOutputTokens`。
173
+ ### 关于默认的思考档位
174
+
175
+ 本插件默认使用 `off`,多数情况下保持这个默认即可。提示词增强通常是短、目标明确的任务——把草稿改写成更清楚的表述,不需要推理过程:在简单任务上,带思考的档位收益很小,代价却是几倍的输出 token 与更长的等待。带思考的档位并非没有价值——当草稿依赖较复杂的上下文、或任务本身需要权衡取舍时,提高档位能明显改善改写质量,可以针对那一次临时调高。需要更强能力时,换一个更好的模型通常比抬高思考档位更划算。设置页与右键快捷卡都能切换档位,方便你用同一份草稿自行对比。
176
+
177
+ 选模型时不要用能力过弱的模型:增强的产物是交给下游执行的任务描述,用明显更弱的模型改写,容易把话说得含糊、丢掉关键约束,甚至与你的原意产生偏差——**一份质量更低的提示词,可能比不改写更糟**。因此不要用比当前会话模型能力更低的模型来负责提示词优化。
166
178
 
167
179
  ## 安全
168
180
 
@@ -275,6 +287,48 @@ flowchart LR
275
287
  | 提示「还没确定用哪个模型」(缺模型路由) | 未固定 `provider`/`model`,且当前会话没有模型路由 | 在设置中成对填写 `provider` / `model`;或先在当前会话发一条消息,让插件跟随会话模型 |
276
288
  | `/enhance` 的结果只显示第一行、点不开 | DSH 聊天界面的渲染限制,与本插件无关 | 把同样的文本放进输入框,用增强按钮;结果卡会自动折行并可滚动 |
277
289
 
290
+ ## 已知问题
291
+
292
+ 下面列出目前已知的问题,按编号排列。标注「暂无支持计划」的条目,是当前不提供的能力,不是等待修复的缺陷。
293
+
294
+ ### 1. 引用保留类功能(暂无支持计划)
295
+
296
+ 本插件**不做引用保留**,也不提供「芯片保留式回填」这类把 `@文件` 引用、链接或命令原样写回输入框的能力。含这类引用的草稿会在本地被拒绝,不会发出请求。本插件只增强你敲下的文字:把草稿改写成更完整、更明确的提示词,不负责搬运或重建引用结构。
297
+
298
+ #### 为什么不做
299
+
300
+ 改写必然要重新组织正文。一旦允许引用标记参与这段正文,它们就会限制作改能动的范围,也会让模型把注意力分给标记本身,正文的完整性与可读性都要为此让步。**引用标记破坏正文,是我们不能接受的错误**,所以宁可拒绝,也不做这类保留。
301
+
302
+ #### 实测到的破坏类型
303
+
304
+ 参考同类插件的「芯片保留式回填」方案并实测,复现出三类问题:
305
+
306
+ - **引用失效**:引用芯片消失,或退化成一串看起来像引用的普通文字;
307
+ - **引用错误**:引用还在,但位置或指向变了,与正文对不上;
308
+ - **正文被并入引用**:本该属于正文的文字被吸附进了引用范围。
309
+
310
+ 这三类问题在结果里直接可见:拿到增强后的提示词时,就能看出格式已经被破坏——引用没了、变成了普通文字,或者位置与正文对不上。
311
+
312
+ #### 遇到这类草稿怎么办
313
+
314
+ - 含 `@文件` 引用、链接或命令的草稿会被本地拦截,不发请求(见「工作原理」);
315
+ - 草稿带附件时,只告诉模型附件的数量,不读取、不发送附件内容,也不在结果里插入附件标记;
316
+ - 需要增强这类草稿时,先把引用去掉、把必要信息写成纯文字,增强完成后再手动把引用插回去。
317
+
318
+ ### 2. 读取图片与附件内容(暂无支持计划)
319
+
320
+ 本插件**不读取图片,也不读取附件内容**。草稿带附件时,它只知道附件的数量,并被明确告知看不到附件:可以写「见附件」这类指代,但不能描述、猜测或转述附件里有什么。附件原件会随你的消息一起发送给下游模型,由下游自己查看。
321
+
322
+ #### 为什么不做
323
+
324
+ 增强要交付的是一段更好的**文字**。一旦让增强模型去读图或读附件,它读到的内容就会变成这段文字里的一段转写:转写可能出错,而原件同时也到达下游,两者对不上时以谁为准并没有保证。图片尤其如此——小字、图表数值这类细节误读代价高,而它们恰恰是下游对着原件看最可靠、增强模型最容易读错的部分。
325
+
326
+ 成本上也不划算:同一份内容会被读两次,一次在增强时、一次在执行时,图片在 token 上的体现尤其明显。二进制附件(PDF、DOCX 等)还有另一层限制:宿主侧不会把它的内容交给模型,只给出文件句柄,真要读正文得由插件自己解析,那是另一个量级的工作。
327
+
328
+ #### 替代做法
329
+
330
+ 把真正需要的信息直接写进草稿:确切的报错、数值、字段名、步骤。这些正是增强能改好的东西;附件里的其余部分,交给下游带着原件去看。
331
+
278
332
  ## 开发
279
333
 
280
334
  **常用命令**
Binary file
Binary file
package/lib/client.js CHANGED
@@ -1912,8 +1912,14 @@ function UndoBar(props) {
1912
1912
  (0, import_react8.useEffect)(() => {
1913
1913
  if (entry !== void 0 && entry.applied !== draft) popUndo(uiKey);
1914
1914
  }, [draft, entry, uiKey]);
1915
+ const phase = useInput((state) => {
1916
+ const value = state.phase;
1917
+ return typeof value === "string" ? value : "";
1918
+ });
1919
+ const composerIdle = phase === "" || phase === "plain";
1915
1920
  const panel = getPanel();
1916
- const visible = (panel === void 0 || panel.sessionId !== uiKey) && entry !== void 0 && entry.applied === draft;
1921
+ const cardGone = panel === void 0 || panel.sessionId !== uiKey;
1922
+ const visible = cardGone && composerIdle && entry !== void 0 && entry.applied === draft;
1917
1923
  const rootRef = useDockAlignment(visible, uiKey);
1918
1924
  if (!visible) return null;
1919
1925
  const undo = () => {
@@ -2024,7 +2030,8 @@ var zh = {
2024
2030
  "error.upstream.maxTokens": "\u7ED3\u679C\u8FBE\u5230\u4E86\u300C\u8F93\u51FA token \u4E0A\u9650\u300D\u3002\u8BF7\u8C03\u9AD8\u8BE5\u8BBE\u7F6E\uFF0C\u6216\u7CBE\u7B80\u539F\u6587\u540E\u91CD\u8BD5\u3002",
2025
2031
  "settings.summary": "\u6A21\u578B\u3001\u4E0A\u4E0B\u6587\u4E0E\u8D44\u6E90\u9650\u5236",
2026
2032
  "settings.title": "\u63D0\u793A\u8BCD\u589E\u5F3A",
2027
- "settings.description": "\u628A\u8F93\u5165\u6846\u8349\u7A3F\u6539\u5199\u4E3A\u7ED3\u6784\u5316\u63D0\u793A\u8BCD\uFF1A\u89D2\u8272\u4E0E\u76EE\u6807\u3001\u53EF\u6267\u884C\u6B65\u9AA4\u3001\u8F93\u51FA\u683C\u5F0F\u3001\u9A8C\u6536\u6807\u51C6\u3001\u8FB9\u754C\u6761\u4EF6\u3002\u539F\u6587\u4FDD\u7559\uFF0C\u5931\u8D25\u4E0D\u6539\u8349\u7A3F\uFF1B\u4FDD\u5B58\u540E\u4E0B\u4E00\u6B21\u8C03\u7528\u5373\u751F\u6548\u3002",
2033
+ "settings.description": "\u628A\u8F93\u5165\u6846\u8349\u7A3F\u6539\u5199\u6210\u7ED3\u6784\u5316\u63D0\u793A\u8BCD\uFF0C\u6309\u9700\u8865\u9F50\u89D2\u8272\u4E0E\u76EE\u6807\u3001\u4E0A\u4E0B\u6587\u4E0E\u7EA6\u675F\u3001\u53EF\u6267\u884C\u6B65\u9AA4\u3001\u8F93\u51FA\u683C\u5F0F\u3001\u9A8C\u6536\u6807\u51C6\u4E0E\u8FB9\u754C\u6761\u4EF6\u3002\u539F\u6587\u4FDD\u7559\uFF0C\u5931\u8D25\u65F6\u4E0D\u6539\u52A8\u8349\u7A3F\u3002",
2034
+ "settings.issue": "\u95EE\u9898\u53CD\u9988",
2028
2035
  "settings.save": "\u4FDD\u5B58",
2029
2036
  "settings.saving": "\u4FDD\u5B58\u4E2D\u2026",
2030
2037
  "settings.saved": "\u5DF2\u4FDD\u5B58",
@@ -2206,7 +2213,8 @@ var en = {
2206
2213
  "error.upstream.maxTokens": 'The result hit the "Output token budget" limit. Raise that setting, or shorten the draft and retry.',
2207
2214
  "settings.summary": "Model, context, and resource limits",
2208
2215
  "settings.title": "Prompt enhance",
2209
- "settings.description": "Turns a composer draft into a structured prompt: role and goal, executable steps, output format, acceptance criteria, edge cases. The draft is preserved, failures never touch it, and saved values apply to the next call.",
2216
+ "settings.description": "Turns a composer draft into a structured prompt, filling in role and goal, context and constraints, executable steps, output format, acceptance criteria, and edge cases as needed. The draft is preserved, and failures never touch it.",
2217
+ "settings.issue": "Feedback",
2210
2218
  "settings.save": "Save",
2211
2219
  "settings.saving": "Saving\u2026",
2212
2220
  "settings.saved": "Saved",
@@ -3110,6 +3118,36 @@ html[data-platform='darwin'] .dsh-pe-menu {
3110
3118
  }
3111
3119
  .dsh-pe-save-button:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12)); }
3112
3120
  .dsh-pe-save-button:disabled { opacity: 0.5; cursor: default; }
3121
+
3122
+ /* The settings header's GitHub / npm chips: the only links on that page, and
3123
+ the only place a <style> rule beats an inline object \u2014 :hover cannot be
3124
+ expressed inline, which is why these two had no feedback at all. */
3125
+ .dsh-pe-header-link {
3126
+ display: inline-flex;
3127
+ align-items: center;
3128
+ gap: 3px;
3129
+ height: 18px;
3130
+ padding: 0 7px;
3131
+ border: 1px solid var(--dsw-alias-border-l4, rgba(128, 128, 128, 0.35));
3132
+ border-radius: 999px;
3133
+ background: var(--dsw-alias-bg-layer-3, transparent);
3134
+ font-size: 10.5px;
3135
+ font-weight: 500;
3136
+ line-height: 1;
3137
+ color: var(--dsw-alias-label-secondary, inherit);
3138
+ text-decoration: none;
3139
+ transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
3140
+ }
3141
+ .dsh-pe-header-link:hover,
3142
+ .dsh-pe-header-link:focus-visible {
3143
+ background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12));
3144
+ border-color: var(--dsw-alias-border-l3, rgba(128, 128, 128, 0.55));
3145
+ color: var(--dsw-alias-label-primary, inherit);
3146
+ }
3147
+ .dsh-pe-header-link:focus-visible { outline: 2px solid var(--dsw-alias-border-l3, rgba(128, 128, 128, 0.55)); outline-offset: 2px; }
3148
+ @media (prefers-reduced-motion: reduce) {
3149
+ .dsh-pe-header-link { transition: none; }
3150
+ }
3113
3151
  `;
3114
3152
  function ensureStyles() {
3115
3153
  if (document.getElementById(STYLE_ID) !== null) return false;
@@ -3425,7 +3463,6 @@ var BASIC_ROWS = [
3425
3463
  { key: "provider", kind: "provider", label: "settings.row.provider.label", hint: "settings.row.provider.hint" },
3426
3464
  { key: "model", kind: "model", label: "settings.row.model.label", hint: "settings.row.model.hint" },
3427
3465
  { key: "reasoningEffort", kind: "reasoning", label: "settings.row.reasoningEffort.label", hint: "settings.row.reasoningEffort.hint" },
3428
- numberRow("temperature", "settings.row.temperature.label", "settings.row.temperature.hint", TEMPERATURE, false),
3429
3466
  { key: "contextAware", kind: "boolean", label: "settings.row.contextAware.label", hint: "settings.row.contextAware.hint" },
3430
3467
  { key: "streaming", kind: "boolean", label: "settings.row.streaming.label", hint: "settings.row.streaming.hint" },
3431
3468
  { key: "systemPrompt", kind: "text", label: "settings.row.systemPrompt.label", hint: "settings.row.systemPrompt.hint", placeholder: "settings.row.systemPrompt.placeholder" },
@@ -3444,6 +3481,9 @@ var ADVANCED_ROWS = [
3444
3481
  { key: "foldAnimation", kind: "boolean", label: "settings.row.foldAnimation.label", hint: "settings.row.foldAnimation.hint" },
3445
3482
  { key: "autoFold", kind: "boolean", label: "settings.row.autoFold.label", hint: "settings.row.autoFold.hint" },
3446
3483
  { key: "strategyMode", kind: "strategy", label: "settings.row.strategyMode.label", hint: "settings.row.strategyMode.hint" },
3484
+ // Set-once tuning, not a per-use switch: it sits next to the strategy row
3485
+ // because both shape how the rewrite is produced, not how often it runs.
3486
+ numberRow("temperature", "settings.row.temperature.label", "settings.row.temperature.hint", TEMPERATURE, false),
3447
3487
  numberRow("maxInputChars", "settings.row.maxInputChars.label", "settings.row.maxInputChars.hint", FIELD_LIMITS.maxInputChars),
3448
3488
  numberRow("maxOutputTokens", "settings.row.maxOutputTokens.label", "settings.row.maxOutputTokens.hint", FIELD_LIMITS.maxOutputTokens),
3449
3489
  numberRow("timeoutMs", "settings.row.timeoutMs.label", "settings.row.timeoutMs.hint", FIELD_LIMITS.timeoutMs),
@@ -3683,9 +3723,10 @@ var SEPARATOR_STYLE = {
3683
3723
  };
3684
3724
  var REPOSITORY_URL = "https://github.com/surfishs/dsh-prompt-enhance";
3685
3725
  var NPM_URL = "https://www.npmjs.com/package/@surfishs/dsh-prompt-enhance";
3726
+ var ISSUE_URL = "https://github.com/surfishs/dsh-prompt-enhance/issues";
3686
3727
  var GITHUB_MARK = "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.6 7.6 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z";
3687
3728
  var NPM_MARK = "M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z";
3688
- var PLUGIN_VERSION = true ? "0.1.6" : "0.0.0";
3729
+ var PLUGIN_VERSION = true ? "0.1.8" : "0.0.0";
3689
3730
  var HEADER_STYLE = { display: "flex", flexDirection: "column", gap: 12, padding: "2px 0" };
3690
3731
  var HEADER_ROW_STYLE = { display: "flex", alignItems: "center", gap: 10, flexWrap: "wrap" };
3691
3732
  var HEADER_TITLE_STYLE = {
@@ -3695,21 +3736,6 @@ var HEADER_TITLE_STYLE = {
3695
3736
  lineHeight: 1.3,
3696
3737
  color: "var(--dsw-alias-label-primary, inherit)"
3697
3738
  };
3698
- var HEADER_LINK_STYLE = {
3699
- display: "inline-flex",
3700
- alignItems: "center",
3701
- gap: 3,
3702
- height: 18,
3703
- padding: "0 7px",
3704
- border: "1px solid var(--dsw-alias-border-l4, rgba(128, 128, 128, 0.35))",
3705
- borderRadius: 999,
3706
- background: "var(--dsw-alias-bg-layer-3, transparent)",
3707
- fontSize: 10.5,
3708
- fontWeight: 500,
3709
- lineHeight: 1,
3710
- color: "var(--dsw-alias-label-secondary, inherit)",
3711
- textDecoration: "none"
3712
- };
3713
3739
  var HEADER_VERSION_STYLE = {
3714
3740
  display: "inline-flex",
3715
3741
  alignItems: "center",
@@ -4113,14 +4139,18 @@ function PageHeader(props) {
4113
4139
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: HEADER_STYLE, children: [
4114
4140
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: HEADER_ROW_STYLE, children: [
4115
4141
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: HEADER_TITLE_STYLE, children: props.title }),
4116
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("a", { href: REPOSITORY_URL, target: "_blank", rel: "noreferrer", style: HEADER_LINK_STYLE, children: [
4142
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("a", { href: REPOSITORY_URL, target: "_blank", rel: "noreferrer", className: "dsh-pe-header-link", children: [
4117
4143
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: 11, height: 11, viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { fill: "currentColor", d: GITHUB_MARK }) }),
4118
4144
  "GitHub"
4119
4145
  ] }),
4120
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("a", { href: NPM_URL, target: "_blank", rel: "noreferrer", style: HEADER_LINK_STYLE, children: [
4146
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("a", { href: NPM_URL, target: "_blank", rel: "noreferrer", className: "dsh-pe-header-link", children: [
4121
4147
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: 11, height: 11, viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { fill: "currentColor", d: NPM_MARK }) }),
4122
4148
  "npm"
4123
4149
  ] }),
4150
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("a", { href: ISSUE_URL, target: "_blank", rel: "noreferrer", className: "dsh-pe-header-link", children: [
4151
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: 11, height: 11, viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { fill: "none", stroke: "currentColor", strokeWidth: 1.3, strokeLinecap: "round", strokeLinejoin: "round", d: "M4 1.75h5l3.25 3.25v9.25H4zM9 1.75V5h3.25M6 8.25h4M6 10.75h4" }) }),
4152
+ props.issue
4153
+ ] }),
4124
4154
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { style: HEADER_VERSION_STYLE, children: [
4125
4155
  "v",
4126
4156
  props.version
@@ -4394,7 +4424,7 @@ function SettingsSection(props) {
4394
4424
  const resetField = props.resetField ?? (() => {
4395
4425
  });
4396
4426
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
4397
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PageHeader, { title: t("settings.title"), description: t("settings.description"), version: PLUGIN_VERSION }),
4427
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PageHeader, { title: t("settings.title"), description: t("settings.description"), issue: t("settings.issue"), version: PLUGIN_VERSION }),
4398
4428
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SettingsRows, { copy: sectionCopy(t, chinese), state, edit, resetField, save: props.save, discard: props.discard, writeField: props.writeField })
4399
4429
  ] });
4400
4430
  }
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "dsh-prompt-enhance",
4
- "description": "Prompt enhancement for the DeepSeek Harness web GUI: a Settings page and a plugin-page config, context-aware rewriting, streaming display and a reasoning budget."
4
+ "description": "“Can you help me?” is like “I don't feel well” — the plugin turns it into a complete prompt."
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
- "title": "dsh-prompt-enhance",
4
- "description": "DeepSeek Harness Web GUI 的提示词增强插件:设置页与插件页双配置入口,支持上下文感知、流式展示与推理预算。"
3
+ "title": "提示词增强",
4
+ "description": "「那你能帮帮我吗?」你只管这么问,像病人说「我不舒服」,插件就会替你补全提示词。"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@surfishs/dsh-prompt-enhance",
3
3
  "description": "Prompt enhancement for the dsh web GUI: rewrite the composer draft into a well-structured prompt through the harness LLM service, preview the before/after, then fill back, copy, or undo. Original draft is always preserved.",
4
- "version": "0.1.6",
4
+ "version": "0.1.8",
5
5
  "author": "surfishs",
6
6
  "type": "module",
7
7
  "engines": {
@@ -39,10 +39,23 @@ export function UndoBar(props: UndoBarProps): ReactNode {
39
39
  if (entry !== undefined && entry.applied !== draft) ui.popUndo(uiKey)
40
40
  }, [draft, entry, uiKey])
41
41
 
42
+ // The composer's own phase decides whether an undo makes sense. While it is
43
+ // mid-submit (sending / submitting / adjudicating) the draft is about to be
44
+ // consumed, so restoring the pre-apply text is not what the user asked for —
45
+ // and the single commit between "card closed" and "draft cleared" used to
46
+ // flash the bar for exactly that moment. A host that publishes no phase reads
47
+ // as idle here, keeping the shipped behaviour on those versions.
48
+ const phase = useInput((state) => {
49
+ const value = (state as { phase?: unknown }).phase
50
+ return typeof value === 'string' ? value : ''
51
+ })
52
+ const composerIdle = phase === '' || phase === 'plain'
53
+
42
54
  // The result card owns the undo affordance while it is open; the standalone
43
55
  // row takes over only after the card is closed.
44
56
  const panel = ui.getPanel()
45
- const visible = (panel === undefined || panel.sessionId !== uiKey) && entry !== undefined && entry.applied === draft
57
+ const cardGone = panel === undefined || panel.sessionId !== uiKey
58
+ const visible = cardGone && composerIdle && entry !== undefined && entry.applied === draft
46
59
  const rootRef = useDockAlignment(visible, uiKey)
47
60
  if (!visible) return null
48
61
 
@@ -94,7 +94,8 @@ export const zh = {
94
94
  'error.upstream.maxTokens': '结果达到了「输出 token 上限」。请调高该设置,或精简原文后重试。',
95
95
  'settings.summary': '模型、上下文与资源限制',
96
96
  'settings.title': '提示词增强',
97
- 'settings.description': '把输入框草稿改写为结构化提示词:角色与目标、可执行步骤、输出格式、验收标准、边界条件。原文保留,失败不改草稿;保存后下一次调用即生效。',
97
+ 'settings.description': '把输入框草稿改写成结构化提示词,按需补齐角色与目标、上下文与约束、可执行步骤、输出格式、验收标准与边界条件。原文保留,失败时不改动草稿。',
98
+ 'settings.issue': '问题反馈',
98
99
  'settings.save': '保存',
99
100
  'settings.saving': '保存中…',
100
101
  'settings.saved': '已保存',
@@ -283,7 +284,8 @@ export const en: Record<PromptEnhanceKey, string> = {
283
284
  'settings.summary': 'Model, context, and resource limits',
284
285
  'settings.title': 'Prompt enhance',
285
286
  'settings.description':
286
- 'Turns a composer draft into a structured prompt: role and goal, executable steps, output format, acceptance criteria, edge cases. The draft is preserved, failures never touch it, and saved values apply to the next call.',
287
+ 'Turns a composer draft into a structured prompt, filling in role and goal, context and constraints, executable steps, output format, acceptance criteria, and edge cases as needed. The draft is preserved, and failures never touch it.',
288
+ 'settings.issue': 'Feedback',
287
289
  'settings.save': 'Save',
288
290
  'settings.saving': 'Saving…',
289
291
  'settings.saved': 'Saved',
@@ -170,7 +170,6 @@ export const BASIC_ROWS: readonly Row[] = [
170
170
  { key: 'provider', kind: 'provider', label: 'settings.row.provider.label', hint: 'settings.row.provider.hint' },
171
171
  { key: 'model', kind: 'model', label: 'settings.row.model.label', hint: 'settings.row.model.hint' },
172
172
  { key: 'reasoningEffort', kind: 'reasoning', label: 'settings.row.reasoningEffort.label', hint: 'settings.row.reasoningEffort.hint' },
173
- numberRow('temperature', 'settings.row.temperature.label', 'settings.row.temperature.hint', TEMPERATURE, false),
174
173
  { key: 'contextAware', kind: 'boolean', label: 'settings.row.contextAware.label', hint: 'settings.row.contextAware.hint' },
175
174
  { key: 'streaming', kind: 'boolean', label: 'settings.row.streaming.label', hint: 'settings.row.streaming.hint' },
176
175
  { key: 'systemPrompt', kind: 'text', label: 'settings.row.systemPrompt.label', hint: 'settings.row.systemPrompt.hint', placeholder: 'settings.row.systemPrompt.placeholder' },
@@ -191,6 +190,9 @@ export const ADVANCED_ROWS: readonly Row[] = [
191
190
  { key: 'foldAnimation', kind: 'boolean', label: 'settings.row.foldAnimation.label', hint: 'settings.row.foldAnimation.hint' },
192
191
  { key: 'autoFold', kind: 'boolean', label: 'settings.row.autoFold.label', hint: 'settings.row.autoFold.hint' },
193
192
  { key: 'strategyMode', kind: 'strategy', label: 'settings.row.strategyMode.label', hint: 'settings.row.strategyMode.hint' },
193
+ // Set-once tuning, not a per-use switch: it sits next to the strategy row
194
+ // because both shape how the rewrite is produced, not how often it runs.
195
+ numberRow('temperature', 'settings.row.temperature.label', 'settings.row.temperature.hint', TEMPERATURE, false),
194
196
  numberRow('maxInputChars', 'settings.row.maxInputChars.label', 'settings.row.maxInputChars.hint', FIELD_LIMITS.maxInputChars),
195
197
  numberRow('maxOutputTokens', 'settings.row.maxOutputTokens.label', 'settings.row.maxOutputTokens.hint', FIELD_LIMITS.maxOutputTokens),
196
198
  numberRow('timeoutMs', 'settings.row.timeoutMs.label', 'settings.row.timeoutMs.hint', FIELD_LIMITS.timeoutMs),
@@ -155,6 +155,9 @@ export const REPOSITORY_URL = 'https://github.com/surfishs/dsh-prompt-enhance'
155
155
  /** Public npm package page, linked from the page header next to the repository. */
156
156
  export const NPM_URL = 'https://www.npmjs.com/package/@surfishs/dsh-prompt-enhance'
157
157
 
158
+ /** The tracker declared in `package.json` (`bugs.url`), so the chip cannot drift from it. */
159
+ export const ISSUE_URL = 'https://github.com/surfishs/dsh-prompt-enhance/issues'
160
+
158
161
  /** The GitHub mark (16×16), painted with the current text color. */
159
162
  export const GITHUB_MARK =
160
163
  'M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.6 7.6 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z'
@@ -176,21 +179,6 @@ export const HEADER_TITLE_STYLE: CSSProperties = {
176
179
  lineHeight: 1.3,
177
180
  color: 'var(--dsw-alias-label-primary, inherit)',
178
181
  }
179
- export const HEADER_LINK_STYLE: CSSProperties = {
180
- display: 'inline-flex',
181
- alignItems: 'center',
182
- gap: 3,
183
- height: 18,
184
- padding: '0 7px',
185
- border: '1px solid var(--dsw-alias-border-l4, rgba(128, 128, 128, 0.35))',
186
- borderRadius: 999,
187
- background: 'var(--dsw-alias-bg-layer-3, transparent)',
188
- fontSize: 10.5,
189
- fontWeight: 500,
190
- lineHeight: 1,
191
- color: 'var(--dsw-alias-label-secondary, inherit)',
192
- textDecoration: 'none',
193
- }
194
182
  export const HEADER_VERSION_STYLE: CSSProperties = {
195
183
  display: 'inline-flex',
196
184
  alignItems: 'center',
@@ -41,11 +41,11 @@ import type { RowCopy } from './settings-page-copy'
41
41
  import { BooleanRow, ChoiceRow, ModelRow, ProviderRow, ReasoningRow, ValueRow } from './settings-page-controls'
42
42
  import {
43
43
  HEADER_DESCRIPTION_STYLE,
44
- HEADER_LINK_STYLE,
45
44
  HEADER_ROW_STYLE,
46
45
  HEADER_STYLE,
47
46
  HEADER_TITLE_STYLE,
48
47
  HEADER_VERSION_STYLE,
48
+ ISSUE_URL,
49
49
  NPM_MARK,
50
50
  NPM_URL,
51
51
  PLUGIN_VERSION,
@@ -80,23 +80,29 @@ function sectionTitle(getLocale: (() => LocaleFaceLike | undefined) | undefined)
80
80
  * @param props - the localized title and description, plus the version.
81
81
  * @returns the header element.
82
82
  */
83
- function PageHeader(props: { title: string; description: string; version: string }): ReactElement {
83
+ function PageHeader(props: { title: string; description: string; issue: string; version: string }): ReactElement {
84
84
  return (
85
85
  <div style={HEADER_STYLE}>
86
86
  <div style={HEADER_ROW_STYLE}>
87
87
  <span style={HEADER_TITLE_STYLE}>{props.title}</span>
88
- <a href={REPOSITORY_URL} target="_blank" rel="noreferrer" style={HEADER_LINK_STYLE}>
88
+ <a href={REPOSITORY_URL} target="_blank" rel="noreferrer" className="dsh-pe-header-link">
89
89
  <svg width={11} height={11} viewBox="0 0 16 16" aria-hidden="true" focusable="false">
90
90
  <path fill="currentColor" d={GITHUB_MARK} />
91
91
  </svg>
92
92
  GitHub
93
93
  </a>
94
- <a href={NPM_URL} target="_blank" rel="noreferrer" style={HEADER_LINK_STYLE}>
94
+ <a href={NPM_URL} target="_blank" rel="noreferrer" className="dsh-pe-header-link">
95
95
  <svg width={11} height={11} viewBox="0 0 24 24" aria-hidden="true" focusable="false">
96
96
  <path fill="currentColor" d={NPM_MARK} />
97
97
  </svg>
98
98
  npm
99
99
  </a>
100
+ <a href={ISSUE_URL} target="_blank" rel="noreferrer" className="dsh-pe-header-link">
101
+ <svg width={11} height={11} viewBox="0 0 16 16" aria-hidden="true" focusable="false">
102
+ <path fill="none" stroke="currentColor" strokeWidth={1.3} strokeLinecap="round" strokeLinejoin="round" d="M4 1.75h5l3.25 3.25v9.25H4zM9 1.75V5h3.25M6 8.25h4M6 10.75h4" />
103
+ </svg>
104
+ {props.issue}
105
+ </a>
100
106
  <span style={HEADER_VERSION_STYLE}>v{props.version}</span>
101
107
  </div>
102
108
  <p style={HEADER_DESCRIPTION_STYLE}>{props.description}</p>
@@ -481,7 +487,7 @@ export function SettingsSection(props: SectionProps): unknown {
481
487
  const resetField = props.resetField ?? ((): void => {})
482
488
  return (
483
489
  <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
484
- <PageHeader title={t('settings.title')} description={t('settings.description')} version={PLUGIN_VERSION} />
490
+ <PageHeader title={t('settings.title')} description={t('settings.description')} issue={t('settings.issue')} version={PLUGIN_VERSION} />
485
491
  <SettingsRows copy={sectionCopy(t, chinese)} state={state} edit={edit} resetField={resetField} save={props.save} discard={props.discard} writeField={props.writeField} />
486
492
  </div>
487
493
  )
@@ -821,6 +821,36 @@ html[data-platform='darwin'] .dsh-pe-menu {
821
821
  }
822
822
  .dsh-pe-save-button:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12)); }
823
823
  .dsh-pe-save-button:disabled { opacity: 0.5; cursor: default; }
824
+
825
+ /* The settings header's GitHub / npm chips: the only links on that page, and
826
+ the only place a <style> rule beats an inline object — :hover cannot be
827
+ expressed inline, which is why these two had no feedback at all. */
828
+ .dsh-pe-header-link {
829
+ display: inline-flex;
830
+ align-items: center;
831
+ gap: 3px;
832
+ height: 18px;
833
+ padding: 0 7px;
834
+ border: 1px solid var(--dsw-alias-border-l4, rgba(128, 128, 128, 0.35));
835
+ border-radius: 999px;
836
+ background: var(--dsw-alias-bg-layer-3, transparent);
837
+ font-size: 10.5px;
838
+ font-weight: 500;
839
+ line-height: 1;
840
+ color: var(--dsw-alias-label-secondary, inherit);
841
+ text-decoration: none;
842
+ transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
843
+ }
844
+ .dsh-pe-header-link:hover,
845
+ .dsh-pe-header-link:focus-visible {
846
+ background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.12));
847
+ border-color: var(--dsw-alias-border-l3, rgba(128, 128, 128, 0.55));
848
+ color: var(--dsw-alias-label-primary, inherit);
849
+ }
850
+ .dsh-pe-header-link:focus-visible { outline: 2px solid var(--dsw-alias-border-l3, rgba(128, 128, 128, 0.55)); outline-offset: 2px; }
851
+ @media (prefers-reduced-motion: reduce) {
852
+ .dsh-pe-header-link { transition: none; }
853
+ }
824
854
  `
825
855
 
826
856
  /**