@surfishs/dsh-prompt-enhance 0.0.8 → 0.0.9

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
@@ -12,29 +12,32 @@
12
12
 
13
13
  ---
14
14
 
15
- ## Features
16
-
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.
23
- - **`/enhance <text>`**: rewrite any text from the slash menu; the result never enters model history.
24
- - **Model routing**: pinned settings pair → current session model → harness default, in that order.
25
- - **Context aware**: uses recent conversation to resolve references; can be turned off.
26
- - **Live settings**: changes apply to the next call, no restart.
15
+ ## Feature overview
16
+
17
+ | Feature | What it does |
18
+ |---|---|
19
+ | 🐋 **One-click enhance** | The composer toolbar button (the DeepSeek whale mark whose upper-left corner carries a sparkle); the shortcut is off by default and can be set in the settings |
20
+ | 🖼️ **Docked result card** | The result appears above the composer without covering the conversation, with the model, timing and `token` usage; a truncated result is marked as possibly incomplete |
21
+ | ↩️ **Apply, copy and undo** | Undo right after applying; once the card is closed, the undo bar remains above the composer |
22
+ | 🔄 **Regenerate** | Requests another version from the current composer text; after applying, it regenerates the enhanced draft as well |
23
+ | 💬 **`/enhance` command** | Rewrites any text from the slash menu; the result never enters model history |
24
+ | 🧭 **Model routing** | A pinned `provider` + `model` pair wins; otherwise it follows the current session model, then the global default model |
25
+ | 🧩 **Context aware** | With `contextAware` on, recent turns resolve references such as "it" or "that"; it can be turned off |
26
+ | 🔑 **Zero credentials** | Calls go through the harness LLM service and its credential store; the plugin neither reads nor stores keys |
27
+ | 🛡️ **Draft safety** | Empty, attachment-only, over-length and command-or-reference drafts are blocked locally before any request; upstream failures map to readable messages; a failure never touches the draft |
28
+ | ⚙️ **Live settings** | Fields save automatically, common rows come first and the rest fold into Advanced settings; changes apply to the next call with no restart |
27
29
 
28
30
  ## Requirements
29
31
 
30
- | | |
32
+ | Item | Requirement |
31
33
  |---|---|
32
- | dsh | `>= 0.1.1-rc.2 < 0.3.0` |
34
+ | dsh | `>= 0.1.1-rc.2 < 0.3.0`, verified on `0.2.2-rc.3` |
33
35
  | Node (source builds only) | `^22.19.0 \|\| >=24.0.0` |
34
- | Plugin | `0.0.x` |
35
36
 
36
37
  ## Install
37
38
 
39
+ Check the package name first. `dsh-prompt-enhance` on npm (no scope) is the upstream project and this plugin is a rewrite of it; this plugin is `@surfishs/dsh-prompt-enhance`. Install from this repository (`surfishs/dsh-prompt-enhance`) or its entry in the plugin market. **Do not** run `dsh plugin add dsh-prompt-enhance`.
40
+
38
41
  ### Let an agent install it
39
42
 
40
43
  No command line needed. Send the block below to an agent that can run commands on your machine (DSH desktop or web):
@@ -56,14 +59,14 @@ dsh plugin --profile <profile> add @surfishs/dsh-prompt-enhance
56
59
  # restart dsh
57
60
  ```
58
61
 
62
+ > Replace `<profile>` with your profile name: usually `desktop` for the desktop app and `web` for the web build.
63
+
59
64
  From GitHub (the built `lib/` is committed, so no local build happens):
60
65
 
61
66
  ```bash
62
67
  dsh plugin --profile <profile> add github:surfishs/dsh-prompt-enhance
63
68
  ```
64
69
 
65
- Replace `<profile>` with your profile name: usually `desktop` for the desktop app and `web` for the web build.
66
-
67
70
  From a local checkout (development):
68
71
 
69
72
  ```bash
@@ -88,7 +91,7 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
88
91
  3. **Undo**: after applying, click Undo to restore; after closing the card, the undo bar remains above the composer.
89
92
  4. **Close**: sending the draft closes the card automatically; Escape also closes it.
90
93
 
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.
94
+ An empty or attachment-only draft dims the button and makes it unclickable; over-length drafts and drafts containing commands or file references are rejected locally. A result that hits the token cap is marked as possibly incomplete.
92
95
 
93
96
  `/enhance <text>`: rewrite any text from the slash menu; the result is copyable and never enters model history.
94
97
 
package/README.md CHANGED
@@ -12,29 +12,32 @@
12
12
 
13
13
  ---
14
14
 
15
- ## 功能
16
-
17
- - **一键增强**:输入框工具栏的增强按钮(DeepSeek 鱼形标识 + 星芒);快捷键默认关闭,可在设置中指定。原文保留,失败不改草稿。
18
- - **停靠结果卡**:结果显示在输入框上方,不遮挡对话;附模型、耗时与 token 用量,可回填、复制、重新生成或撤销;发送消息时自动收起,`Esc` 关闭。
19
- - **回填与撤销**:回填后结果卡保持打开并显示「已替换」,可直接撤销;关闭后输入框上方仍保留撤销条。
20
- - **重新生成**:按当前输入框内容重新请求;回填后也可对增强稿再生成。
21
- - **空输入灰态**:没有文字或只有附件时图标变浅,点击和快捷键都不发起请求。
22
- - **截断提示**:输出达到 Token 上限时保留已生成内容,并提示结果可能不完整。
23
- - **`/enhance <文本>`**:从斜杠面板改写任意文本,结果不进入模型历史。
24
- - **模型路由**:设置成对覆盖 → 当前会话模型 → 全局默认模型,逐级回退。
25
- - **上下文感知**:参考当前会话近况消解指代;可关闭。
26
- - **配置热生效**:改完即用于下一次调用,无需重启。
15
+ ## 功能一览
16
+
17
+ | 功能 | 说明 |
18
+ |---|---|
19
+ | 🐋 **一键增强** | 输入框工具栏按钮(左上角带星芒的 DeepSeek 鲸鱼标识);快捷键默认关闭,可在设置中指定 |
20
+ | 🖼️ **停靠结果卡** | 结果显示在输入框上方,不遮挡对话;附模型、耗时与 `token` 用量,超限时提示结果可能不完整 |
21
+ | ↩️ **回填、复制与撤销** | 回填后可直接撤销;关闭卡片后,输入框上方仍保留撤销条 |
22
+ | 🔄 **重新生成** | 按当前输入框内容再请求一版;回填后也可对增强稿继续生成 |
23
+ | 💬 **`/enhance` 命令** | 斜杠面板直接改写任意文本;结果不进入模型历史 |
24
+ | 🧭 **模型路由** | 设置中同时指定 `provider` 与 `model` 时优先;否则依次跟随当前会话模型、全局默认模型 |
25
+ | 🧩 **上下文感知** | `contextAware` 开启时参考最近几轮对话补全「它 / 这个」这类指代,可随时关闭 |
26
+ | 🔑 **零凭据配置** | 调用走 harness LLM 服务,密钥来自 harness 凭据存储;插件不读取也不保存 |
27
+ | 🛡️ **草稿安全** | 空输入、仅附件、超长、含命令或文件引用都在本地拦截,不发请求;上游失败映射为可读提示;失败绝不改动草稿 |
28
+ | ⚙️ **配置热生效** | 字段改完自动保存,常用项在前、其余收进「高级设置」;改动对下一次调用立即生效,无需重启 |
27
29
 
28
30
  ## 环境要求
29
31
 
30
- | | |
32
+ | 项目 | 要求 |
31
33
  |---|---|
32
- | dsh | `>= 0.1.1-rc.2 < 0.3.0` |
34
+ | dsh | `>= 0.1.1-rc.2 < 0.3.0`,已在 `0.2.2-rc.3` 验证 |
33
35
  | Node(仅源码构建) | `^22.19.0 \|\| >=24.0.0` |
34
- | 插件 | `0.0.x` |
35
36
 
36
37
  ## 安装
37
38
 
39
+ 装之前请确认包名。npm 上的 `dsh-prompt-enhance`(无 scope)是上游原项目,本插件是它的重写分支,包名是 `@surfishs/dsh-prompt-enhance`。本插件的安装源是本仓库 `surfishs/dsh-prompt-enhance` 或它在插件市场里的条目。**不要**执行 `dsh plugin add dsh-prompt-enhance`。
40
+
38
41
  ### 让 Agent 帮你安装
39
42
 
40
43
  不用自己敲命令。把下面整段发给能操作本机终端的 Agent(DSH 桌面版、Web 版都可以):
@@ -56,14 +59,14 @@ dsh plugin --profile <profile> add @surfishs/dsh-prompt-enhance
56
59
  # 重启 dsh
57
60
  ```
58
61
 
62
+ > `<profile>` 换成你的 profile 名:桌面版通常是 `desktop`,Web 版通常是 `web`。
63
+
59
64
  从 GitHub 安装(`lib/` 已随仓库提交,无需本地构建):
60
65
 
61
66
  ```bash
62
67
  dsh plugin --profile <profile> add github:surfishs/dsh-prompt-enhance
63
68
  ```
64
69
 
65
- `<profile>` 换成你的 profile 名:桌面版通常是 `desktop`,Web 版通常是 `web`。
66
-
67
70
  从本地检出(开发用):
68
71
 
69
72
  ```bash
@@ -88,7 +91,7 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
88
91
  3. **撤销**:回填后点「撤销」恢复;关闭卡片后,输入框上方仍保留撤销条。
89
92
  4. **关闭**:发送消息时卡片自动收起,按 `Esc` 也可以关闭。
90
93
 
91
- 输入为空或只有附件时,按钮会变灰、不可点;超长或含引用块会被本地拒绝。输出达到 Token 上限时,会提示结果可能不完整。
94
+ 输入为空或只有附件时,按钮会变灰、不可点;超长或含命令或文件引用会被本地拒绝。输出达到 Token 上限时,会提示结果可能不完整。
92
95
 
93
96
  `/enhance <文本>`:从斜杠面板改写任意文本,结果可复制,不进入模型历史。
94
97
 
package/icon.svg ADDED
@@ -0,0 +1,14 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36">
2
+ <!-- DeepSeek whale with a four-point sparkle at its upper-left corner.
3
+ Arrangement: the whale and the star share one rigid shift, the star is
4
+ scaled to 0.72 and sits further out of the whale's silhouette. The pair is
5
+ drawn at 1.2027 of that arrangement and centred on its ink mass, so the
6
+ glyph fills 94% of this canvas and reads centred instead of drifting to
7
+ the lower right. The star tip keeps a 0.10-unit margin, which leaves the
8
+ mass 0.6 units right of dead centre - invisible at row size, and the
9
+ alternative would clip the tip.
10
+ src/client/SparkleFishIcon.tsx draws the composer mark in its own 26x20
11
+ glyph box; keep the two in sync when the mark changes. -->
12
+ <path d="M22.9168 1.43018C22.6713 1.31018 22.5658 1.53918 22.4223 1.65519C22.3733 1.69269 22.3318 1.74169 22.2903 1.78669C21.9317 2.1697 21.5127 2.42121 20.9657 2.39121C20.1657 2.34621 19.4827 2.59771 18.8787 3.20973C18.7502 2.45521 18.3236 2.0047 17.6746 1.71569C17.3351 1.56568 16.9916 1.41518 16.7536 1.08867C16.5876 0.856163 16.5421 0.597155 16.4591 0.341647C16.4061 0.187643 16.3536 0.0301382 16.1761 0.00363739C15.9836 -0.0263635 15.9081 0.135141 15.8326 0.270145C15.5306 0.822162 15.4136 1.43018 15.4251 2.0462C15.4516 3.43174 16.0366 4.53527 17.1991 5.3203C17.3311 5.4103 17.3651 5.5003 17.3236 5.63181C17.2441 5.90231 17.1501 6.16482 17.0671 6.43533C17.0141 6.60784 16.9351 6.64584 16.7501 6.57033C16.1121 6.30383 15.5611 5.90931 15.074 5.4328C14.2475 4.63328 13.5 3.75075 12.568 3.05973C12.349 2.89822 12.13 2.74822 11.9034 2.60522C10.9524 1.68169 12.028 0.923165 12.277 0.833162C12.5375 0.739159 12.3675 0.41615 11.5259 0.42015C10.6844 0.42365 9.91439 0.705658 8.93286 1.08117C8.78935 1.13767 8.63835 1.17867 8.48384 1.21267C7.59332 1.04367 6.66829 1.00617 5.70226 1.11517C3.88321 1.31768 2.43016 2.1777 1.36213 3.64575C0.0790928 5.4103 -0.222916 7.41536 0.146595 9.50642C0.535106 11.7105 1.66014 13.535 3.38869 14.9616C5.18125 16.4406 7.24581 17.1657 9.60138 17.0266C11.0319 16.9441 12.6245 16.7526 14.421 15.2321C14.874 15.4576 15.3496 15.5476 16.1381 15.6151C16.7456 15.6716 17.3306 15.5851 17.7836 15.4911C18.4931 15.3411 18.4441 14.6841 18.1876 14.5636C16.1081 13.595 16.5646 13.9891 16.1496 13.67C17.2061 12.42 18.8202 10.1979 19.3182 7.17235C19.3672 6.83834 19.4297 6.36783 19.4222 6.09732C19.4182 5.93231 19.4562 5.86831 19.6447 5.84931C20.1657 5.78931 20.6712 5.64681 21.1357 5.3913C22.4833 4.65528 23.0268 3.44624 23.1548 1.9972C23.1738 1.77569 23.1508 1.54668 22.9168 1.43018ZM11.1749 14.4736C9.15936 12.889 8.18184 12.3675 7.77832 12.39C7.40081 12.4125 7.46881 12.8445 7.55182 13.126C7.63882 13.404 7.75182 13.5955 7.91033 13.8396C8.01983 14.0011 8.09533 14.2411 7.80083 14.4216C7.15181 14.8231 6.02327 14.2866 5.97027 14.2601C4.65673 13.4865 3.5587 12.4655 2.78467 11.069C2.03715 9.72493 1.60314 8.28289 1.53164 6.74384C1.51264 6.37233 1.62214 6.24082 1.99215 6.17332C2.47916 6.08332 2.98118 6.06432 3.46769 6.13582C5.52476 6.43633 7.27581 7.35586 8.74385 8.8129C9.58188 9.64243 10.2159 10.634 10.8689 11.6025C11.5634 12.631 12.3105 13.611 13.262 14.4146C13.598 14.6961 13.866 14.9101 14.1225 15.0681C13.349 15.1546 12.058 15.1731 11.1749 14.4746L11.1749 14.4736ZM12.141 8.25988C12.141 8.09488 12.273 7.96338 12.439 7.96338C12.4765 7.96338 12.5105 7.97088 12.541 7.98188C12.5825 7.99688 12.6205 8.01938 12.6505 8.05338C12.7035 8.10588 12.7335 8.18088 12.7335 8.25988C12.7335 8.42489 12.6015 8.55639 12.4355 8.55639C12.2695 8.55639 12.141 8.42489 12.141 8.25988ZM15.1415 9.79893C14.949 9.87793 14.7565 9.94544 14.5715 9.95294C14.2845 9.96794 13.9715 9.85143 13.8015 9.70893C13.5375 9.48742 13.3485 9.36342 13.2695 8.97691C13.2355 8.8119 13.2545 8.55639 13.2845 8.40989C13.3525 8.09438 13.277 7.89187 13.0545 7.70787C12.8735 7.55786 12.643 7.51636 12.39 7.51636C12.2955 7.51636 12.209 7.47486 12.1445 7.44136C12.039 7.38886 11.9519 7.25735 12.035 7.09585C12.0615 7.04335 12.19 6.91584 12.22 6.89334C12.5635 6.69784 12.9595 6.76184 13.326 6.90834C13.6655 7.04735 13.9225 7.30236 14.292 7.66287C14.6695 8.09838 14.7375 8.21838 14.9525 8.54539C15.1225 8.8009 15.277 9.06341 15.3831 9.36392C15.4471 9.55142 15.3641 9.70493 15.1415 9.79893Z" transform="translate(7.7334 9.8278) scale(1.13114)" fill="#1C1E24"/>
13
+ <path d="M5.715 0 L7.2 4.2 L11.43 5.715 L7.2 7.2 L5.715 11.43 L4.2 7.2 L0 5.715 L4.2 4.2 Z" transform="translate(0.0921 4.7040) scale(0.86594)" fill="#1C1E24"/>
14
+ </svg>
package/lib/client.js CHANGED
@@ -249,11 +249,13 @@ async function requestEnhance(body, signal) {
249
249
  var import_jsx_runtime = require("react/jsx-runtime");
250
250
  var FISH_PATH = "M22.9168 1.43018C22.6713 1.31018 22.5658 1.53918 22.4223 1.65519C22.3733 1.69269 22.3318 1.74169 22.2903 1.78669C21.9317 2.1697 21.5127 2.42121 20.9657 2.39121C20.1657 2.34621 19.4827 2.59771 18.8787 3.20973C18.7502 2.45521 18.3236 2.0047 17.6746 1.71569C17.3351 1.56568 16.9916 1.41518 16.7536 1.08867C16.5876 0.856163 16.5421 0.597155 16.4591 0.341647C16.4061 0.187643 16.3536 0.0301382 16.1761 0.00363739C15.9836 -0.0263635 15.9081 0.135141 15.8326 0.270145C15.5306 0.822162 15.4136 1.43018 15.4251 2.0462C15.4516 3.43174 16.0366 4.53527 17.1991 5.3203C17.3311 5.4103 17.3651 5.5003 17.3236 5.63181C17.2441 5.90231 17.1501 6.16482 17.0671 6.43533C17.0141 6.60784 16.9351 6.64584 16.7501 6.57033C16.1121 6.30383 15.5611 5.90931 15.074 5.4328C14.2475 4.63328 13.5 3.75075 12.568 3.05973C12.349 2.89822 12.13 2.74822 11.9034 2.60522C10.9524 1.68169 12.028 0.923165 12.277 0.833162C12.5375 0.739159 12.3675 0.41615 11.5259 0.42015C10.6844 0.42365 9.91439 0.705658 8.93286 1.08117C8.78935 1.13767 8.63835 1.17867 8.48384 1.21267C7.59332 1.04367 6.66829 1.00617 5.70226 1.11517C3.88321 1.31768 2.43016 2.1777 1.36213 3.64575C0.0790928 5.4103 -0.222916 7.41536 0.146595 9.50642C0.535106 11.7105 1.66014 13.535 3.38869 14.9616C5.18125 16.4406 7.24581 17.1657 9.60138 17.0266C11.0319 16.9441 12.6245 16.7526 14.421 15.2321C14.874 15.4576 15.3496 15.5476 16.1381 15.6151C16.7456 15.6716 17.3306 15.5851 17.7836 15.4911C18.4931 15.3411 18.4441 14.6841 18.1876 14.5636C16.1081 13.595 16.5646 13.9891 16.1496 13.67C17.2061 12.42 18.8202 10.1979 19.3182 7.17235C19.3672 6.83834 19.4297 6.36783 19.4222 6.09732C19.4182 5.93231 19.4562 5.86831 19.6447 5.84931C20.1657 5.78931 20.6712 5.64681 21.1357 5.3913C22.4833 4.65528 23.0268 3.44624 23.1548 1.9972C23.1738 1.77569 23.1508 1.54668 22.9168 1.43018ZM11.1749 14.4736C9.15936 12.889 8.18184 12.3675 7.77832 12.39C7.40081 12.4125 7.46881 12.8445 7.55182 13.126C7.63882 13.404 7.75182 13.5955 7.91033 13.8396C8.01983 14.0011 8.09533 14.2411 7.80083 14.4216C7.15181 14.8231 6.02327 14.2866 5.97027 14.2601C4.65673 13.4865 3.5587 12.4655 2.78467 11.069C2.03715 9.72493 1.60314 8.28289 1.53164 6.74384C1.51264 6.37233 1.62214 6.24082 1.99215 6.17332C2.47916 6.08332 2.98118 6.06432 3.46769 6.13582C5.52476 6.43633 7.27581 7.35586 8.74385 8.8129C9.58188 9.64243 10.2159 10.634 10.8689 11.6025C11.5634 12.631 12.3105 13.611 13.262 14.4146C13.598 14.6961 13.866 14.9101 14.1225 15.0681C13.349 15.1546 12.058 15.1731 11.1749 14.4746L11.1749 14.4736ZM12.141 8.25988C12.141 8.09488 12.273 7.96338 12.439 7.96338C12.4765 7.96338 12.5105 7.97088 12.541 7.98188C12.5825 7.99688 12.6205 8.01938 12.6505 8.05338C12.7035 8.10588 12.7335 8.18088 12.7335 8.25988C12.7335 8.42489 12.6015 8.55639 12.4355 8.55639C12.2695 8.55639 12.141 8.42489 12.141 8.25988ZM15.1415 9.79893C14.949 9.87793 14.7565 9.94544 14.5715 9.95294C14.2845 9.96794 13.9715 9.85143 13.8015 9.70893C13.5375 9.48742 13.3485 9.36342 13.2695 8.97691C13.2355 8.8119 13.2545 8.55639 13.2845 8.40989C13.3525 8.09438 13.277 7.89187 13.0545 7.70787C12.8735 7.55786 12.643 7.51636 12.39 7.51636C12.2955 7.51636 12.209 7.47486 12.1445 7.44136C12.039 7.38886 11.9519 7.25735 12.035 7.09585C12.0615 7.04335 12.19 6.91584 12.22 6.89334C12.5635 6.69784 12.9595 6.76184 13.326 6.90834C13.6655 7.04735 13.9225 7.30236 14.292 7.66287C14.6695 8.09838 14.7375 8.21838 14.9525 8.54539C15.1225 8.8009 15.277 9.06341 15.3831 9.36392C15.4471 9.55142 15.3641 9.70493 15.1415 9.79893Z";
251
251
  var STAR_PATH = "M5.715 0 L7.2 4.2 L11.43 5.715 L7.2 7.2 L5.715 11.43 L4.2 7.2 L0 5.715 L4.2 4.2 Z";
252
+ var FISH_TRANSFORM = "translate(6.4976 4.3528) scale(0.78502)";
253
+ var STAR_TRANSFORM = "translate(1.1944 0.7969) scale(0.60097)";
252
254
  function SparkleFishIcon(props) {
253
255
  const size = props.size ?? 15;
254
256
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: size * 1.3, height: size, viewBox: "0 0 26 20", fill: "none", "aria-hidden": "true", focusable: "false", style: { display: "block", flexShrink: 0 }, children: [
255
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { transform: "translate(5,3) scale(0.85)", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: FISH_PATH, fill: "currentColor" }) }),
256
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: STAR_PATH, transform: "translate(1.2,0.8) scale(0.55)", fill: "currentColor" }),
257
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { transform: FISH_TRANSFORM, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: FISH_PATH, fill: "currentColor" }) }),
258
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: STAR_PATH, transform: STAR_TRANSFORM, fill: "currentColor" }),
257
259
  props.spinning === true ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("animate", { attributeName: "opacity", values: "1;0.35;1", dur: "1.1s", repeatCount: "indefinite" }) : null
258
260
  ] });
259
261
  }
@@ -2338,7 +2340,7 @@ var REPOSITORY_URL = "https://github.com/surfishs/dsh-prompt-enhance";
2338
2340
  var NPM_URL = "https://www.npmjs.com/package/@surfishs/dsh-prompt-enhance";
2339
2341
  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";
2340
2342
  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";
2341
- var PLUGIN_VERSION = true ? "0.0.8" : "0.0.0";
2343
+ var PLUGIN_VERSION = true ? "0.0.9" : "0.0.0";
2342
2344
  var HEADER_STYLE = { display: "flex", flexDirection: "column", gap: 12, padding: "2px 0" };
2343
2345
  var HEADER_ROW_STYLE = { display: "flex", alignItems: "center", gap: 10, flexWrap: "wrap" };
2344
2346
  var HEADER_TITLE_STYLE = {
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.0.8",
4
+ "version": "0.0.9",
5
5
  "author": "surfishs",
6
6
  "type": "module",
7
7
  "engines": {
@@ -20,7 +20,8 @@
20
20
  "./package.json": "./package.json",
21
21
  "./locale/en.json": "./locale/en.json",
22
22
  "./locale/zh.json": "./locale/zh.json",
23
- "./locale/*.json": "./locale/*.json"
23
+ "./locale/*.json": "./locale/*.json",
24
+ "./icon": "./icon.svg"
24
25
  },
25
26
  "dsh": {
26
27
  "engines": {
@@ -85,6 +86,7 @@
85
86
  "src",
86
87
  "cordis.patch.yml",
87
88
  "locale/*.json",
89
+ "icon.svg",
88
90
  "docs/images/**",
89
91
  "README.md",
90
92
  "README.en.md"
@@ -1,9 +1,16 @@
1
1
  /**
2
- * The composer mark: the DeepSeek fish with the two-star sparkle tucked into
3
- * its upper-left corner. The fish is the brand path used by the Harness
4
- * bundles; the star is the NovelAI-style enhance mark. Both are painted with
5
- * currentColor so the icon follows the button's label color, and the busy
6
- * state pulses the whole mark instead of swapping glyphs.
2
+ * The composer mark: the DeepSeek fish with a four-point sparkle at its
3
+ * upper-left corner. The fish is the brand path used by the Harness bundles; the
4
+ * star is the NovelAI-style enhance mark. Both are painted with currentColor so
5
+ * the icon follows the button's label color, and the busy state pulses the whole
6
+ * mark instead of swapping glyphs.
7
+ *
8
+ * The arrangement is the one approved for the plugin icon: the star is larger and
9
+ * sits further outside the whale, so the two shapes stop crowding each other.
10
+ * `icon.svg` draws the same arrangement at 1.2027, bounding-box centred, so its
11
+ * ink fills 94% of that 36-unit canvas; here the pair is scaled to 0.835 and
12
+ * shifted so the glyph keeps the 26x20 footprint and margins it had before,
13
+ * which is what keeps the button the same size. Change one, change the other.
7
14
  * @module dsh-prompt-enhance/client/SparkleFishIcon
8
15
  */
9
16
 
@@ -16,15 +23,23 @@ const FISH_PATH =
16
23
  /** A four-point star, used at the fish's upper-left corner. */
17
24
  const STAR_PATH = 'M5.715 0 L7.2 4.2 L11.43 5.715 L7.2 7.2 L5.715 11.43 L4.2 7.2 L0 5.715 L4.2 4.2 Z'
18
25
 
26
+ /**
27
+ * Placement of the two paths inside the 26x20 glyph box, derived from the
28
+ * approved A+C arrangement by a single 0.834684 scale plus the offset that keeps
29
+ * the ink box at its previous 1.20..24.68 x 0.81..17.74 position.
30
+ */
31
+ const FISH_TRANSFORM = 'translate(6.4976 4.3528) scale(0.78502)'
32
+ const STAR_TRANSFORM = 'translate(1.1944 0.7969) scale(0.60097)'
33
+
19
34
  /** A fish-plus-sparkle mark sized to its container. */
20
35
  export function SparkleFishIcon(props: { size?: number; spinning?: boolean }): ReactElement {
21
36
  const size = props.size ?? 15
22
37
  return (
23
38
  <svg width={size * 1.3} height={size} viewBox="0 0 26 20" fill="none" aria-hidden="true" focusable="false" style={{ display: 'block', flexShrink: 0 }}>
24
- <g transform="translate(5,3) scale(0.85)">
39
+ <g transform={FISH_TRANSFORM}>
25
40
  <path d={FISH_PATH} fill="currentColor" />
26
41
  </g>
27
- <path d={STAR_PATH} transform="translate(1.2,0.8) scale(0.55)" fill="currentColor" />
42
+ <path d={STAR_PATH} transform={STAR_TRANSFORM} fill="currentColor" />
28
43
  {props.spinning === true ? <animate attributeName="opacity" values="1;0.35;1" dur="1.1s" repeatCount="indefinite" /> : null}
29
44
  </svg>
30
45
  )
@@ -1,23 +0,0 @@
1
- /**
2
- * The two-star sparkle used for the enhance action: one large four-point star
3
- * at the upper left and a smaller companion at the lower right. The path is
4
- * taken from the icon the user supplied from sharednai5.pro, which matches the
5
- * mark NovelAI's image toolbar uses for its enhance action.
6
- * @module dsh-prompt-enhance/client/SparkleIcon
7
- */
8
-
9
- import type { ReactElement } from 'react'
10
-
11
- /** A sparkle sized to its container, painted with the current text color. */
12
- export function SparkleIcon(props: { size?: number; spinning?: boolean }): ReactElement {
13
- const size = props.size ?? 15
14
- return (
15
- <svg width={size} height={size} viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false" style={{ display: 'block', flexShrink: 0 }}>
16
- <path
17
- d="M5.02692 11.2125C5.22842 11.3544 5.46898 11.4303 5.71542 11.4297C5.96186 11.429 6.20204 11.352 6.40284 11.2091C6.60626 11.0605 6.76053 10.8547 6.8451 10.617L7.35593 9.0477C7.4867 8.65418 7.70731 8.29654 8.00029 8.00312C8.29327 7.7097 8.65056 7.48856 9.04383 7.35724L10.6335 6.8429C10.8685 6.7578 11.0709 6.60108 11.2121 6.39484C11.3534 6.1886 11.4264 5.94323 11.4208 5.6933C11.4153 5.44337 11.3315 5.20148 11.1812 5.00172C11.0309 4.80196 10.8217 4.65439 10.5832 4.57981L9.01183 4.06776C8.61813 3.9372 8.26027 3.71665 7.96668 3.4236C7.67308 3.13056 7.45184 2.77309 7.3205 2.37959L6.80396 0.793139C6.72078 0.559416 6.56684 0.357433 6.36355 0.215288C6.16025 0.0731435 5.91772 -0.0020932 5.66968 4.43152e-05C5.42164 0.00218183 5.18044 0.0815873 4.97962 0.227214C4.77881 0.372841 4.62837 0.577448 4.54923 0.81257L4.02697 2.41273C3.89617 2.79564 3.68006 3.1438 3.39497 3.43091C3.10989 3.71803 2.76329 3.93657 2.38135 4.07005L0.792873 4.58096C0.559281 4.66432 0.357437 4.81836 0.215361 5.02168C0.0732858 5.225 -0.00197096 5.46752 3.92466e-05 5.71557C0.00204945 5.96362 0.0812268 6.20489 0.226579 6.40588C0.371931 6.60687 0.576246 6.75762 0.811157 6.83719L2.38135 7.34581C2.77671 7.47731 3.13575 7.69966 3.42967 7.99502C3.72359 8.29038 3.94421 8.65052 4.07383 9.04656L4.59037 10.6364C4.67265 10.8696 4.82579 11.0708 5.02692 11.2125ZM12.0402 15.8324C12.1571 15.9146 12.2915 15.9685 12.4328 15.9897C12.5742 16.011 12.7185 15.9991 12.8544 15.955C12.9903 15.9109 13.1141 15.8357 13.2159 15.7355C13.3178 15.6352 13.395 15.5127 13.4413 15.3775L13.7247 14.5065C13.7857 14.3259 13.8874 14.1617 14.0218 14.0265C14.1567 13.8893 14.3212 13.7888 14.5018 13.7293L15.384 13.4413C15.5661 13.3784 15.7237 13.2597 15.8342 13.102C15.9448 12.9443 16.0028 12.7557 16.0099 12.5631C15.997 12.3705 15.9333 12.1838 15.818 12.0295C15.7027 11.8752 15.5416 11.7613 15.3578 11.704L14.4847 11.4182C14.3039 11.3581 14.1397 11.2569 14.0048 11.1224C13.8699 10.9879 13.7682 10.8239 13.7076 10.6433L13.4196 9.75977C13.3577 9.57805 13.2403 9.42041 13.0839 9.30918C12.9275 9.19795 12.74 9.13877 12.5481 9.14003C12.3562 9.1413 12.1695 9.20294 12.0146 9.31622C11.8596 9.42951 11.7443 9.58869 11.6848 9.7712L11.4026 10.6421C11.3444 10.8214 11.2455 10.9847 11.1136 11.1194C10.9818 11.254 10.8206 11.3563 10.6426 11.4182L9.75922 11.7063C9.57745 11.7679 9.41968 11.8851 9.30827 12.0414C9.19685 12.1977 9.13744 12.3851 9.13845 12.5771C9.13946 12.769 9.20085 12.9558 9.3139 13.1109C9.42696 13.266 9.58596 13.3816 9.76836 13.4413L10.6403 13.7236C10.8232 13.7853 10.9877 13.8871 11.1226 14.0219C11.2586 14.1579 11.3591 14.3225 11.4174 14.5043L11.7065 15.3889C11.7691 15.5678 11.8857 15.7227 12.0402 15.8324Z"
18
- fill="currentColor"
19
- />
20
- {props.spinning === true ? <animate attributeName="opacity" values="1;0.35;1" dur="1.1s" repeatCount="indefinite" /> : null}
21
- </svg>
22
- )
23
- }