@surfishs/dsh-prompt-enhance 0.0.1 → 0.0.3
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 +16 -12
- package/README.md +18 -14
- package/lib/client.js +676 -443
- package/lib/index.js +9 -2
- package/lib/index.js.map +2 -2
- package/package.json +1 -1
- package/src/client/ActionIcons.tsx +61 -0
- package/src/client/EnhanceButton.tsx +24 -56
- package/src/client/ResultDock.tsx +261 -0
- package/src/client/ResultPanel.tsx +149 -177
- package/src/client/SparkleFishIcon.tsx +41 -0
- package/src/client/SparkleIcon.tsx +33 -0
- package/src/client/UndoBar.tsx +4 -0
- package/src/client/index.tsx +16 -0
- package/src/client/locales.ts +18 -4
- package/src/client/settings-page.tsx +13 -0
- package/src/client/styles.ts +75 -48
- package/src/client/ui-state.ts +7 -2
- package/src/enhancer.ts +11 -2
- package/src/shared/protocol.ts +2 -0
package/README.en.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# dsh-prompt-enhance
|
|
2
2
|
|
|
3
3
|
[](https://github.com/surfishs/dsh-prompt-enhance/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@surfishs/dsh-prompt-enhance)
|
|
4
5
|
[](./LICENSE)
|
|
5
6
|
|
|
6
7
|
**Prompt enhancement for the DeepSeek Harness web GUI** — turn a composer draft into a structured prompt (role and goal, executable steps, output format, acceptance criteria, edge cases) in one click. The original draft is preserved, and a failure never touches it.
|
|
@@ -66,23 +67,26 @@ Leave a draft in the composer, then click ✨ (or your configured shortcut). Emp
|
|
|
66
67
|
|
|
67
68
|
## Configuration
|
|
68
69
|
|
|
69
|
-
Edit in **Settings → dsh-prompt-enhance** (or Plugins → `dsh-prompt-enhance` → **Configure**).
|
|
70
|
+
Edit in **Settings → dsh-prompt-enhance** (or Plugins → `dsh-prompt-enhance` → **Configure**). All fields:
|
|
70
71
|
|
|
71
72
|
| Field | Default | Notes |
|
|
72
73
|
|---|---|---|
|
|
73
|
-
| `enabled` | `true` | Master switch |
|
|
74
|
-
| `provider` + `model` | empty | Pick from the DSH-registered LLM providers and their models; the model can switch to “Custom…” to type an id;
|
|
75
|
-
| `temperature` | `0.3` |
|
|
76
|
-
| `reasoningEffort` |
|
|
77
|
-
| `maxOutputTokens` | `8192` | Output token
|
|
74
|
+
| `enabled` | `true` | Master switch; off hides the composer button and disables the command and shortcut |
|
|
75
|
+
| `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 (none). With only one filled, the save falls back to follow-session |
|
|
76
|
+
| `temperature` | `0.3` | Sampling temperature `0~1` (step 0.05); lower stays closer to the original |
|
|
77
|
+
| `reasoningEffort` | `off` | Tiers come from what the configured provider/model declares (DeepSeek: `off` / `low` / `high` / `max`). A route that declares no tiers omits the field (follows the provider default); `inherit` means the field is not sent |
|
|
78
|
+
| `maxOutputTokens` | `8192` | Output token cap per call |
|
|
78
79
|
| `maxInputChars` | `12000` | Input character cap; over-limit is rejected, never truncated |
|
|
79
80
|
| `timeoutMs` | `60000` | End-to-end timeout per call (ms) |
|
|
80
|
-
| `systemPrompt`
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
| `systemPrompt` | empty | Custom system prompt; empty uses the built-in strategy |
|
|
82
|
+
| `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 |
|
|
83
|
+
| `shortcut` | empty (disabled) | Trigger shortcut; e.g. `ctrl+alt+shift+e`. Needs at least one of ctrl/alt/meta; shift is optional |
|
|
84
|
+
| `streaming` | `true` | Show the result as it is written; display only, the final result is unchanged |
|
|
85
|
+
| `contextAware` | `true` | Read recent conversation to resolve references; turn it off for sensitive sessions |
|
|
86
|
+
| `contextMaxMessages` | `8` | Number of recent messages considered; `0` disables |
|
|
87
|
+
| `contextMaxChars` | `4000` | Character budget of the history snippet; `0` disables |
|
|
88
|
+
| `maxConcurrent` | `2` | Concurrent enhancement limit; a new request past the limit is told to retry later |
|
|
89
|
+
| `rateLimitPerMinute` | `10` | Successful enhancements per minute (sliding window); past the limit the request is told to retry later |
|
|
86
90
|
|
|
87
91
|
## Security
|
|
88
92
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# dsh-prompt-enhance
|
|
2
2
|
|
|
3
3
|
[](https://github.com/surfishs/dsh-prompt-enhance/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@surfishs/dsh-prompt-enhance)
|
|
4
5
|
[](./LICENSE)
|
|
5
6
|
|
|
6
7
|
**DeepSeek Harness Web GUI 的「提示词增强」插件** —— 一键把输入框草稿改写为结构化提示词(角色与目标、可执行步骤、输出格式、验收标准、边界条件)。原文保留,失败不改草稿。
|
|
@@ -66,23 +67,26 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
|
|
|
66
67
|
|
|
67
68
|
## 配置
|
|
68
69
|
|
|
69
|
-
在 **设置 → 提示词增强**(或 插件面板 → `dsh-prompt-enhance` →
|
|
70
|
+
在 **设置 → 提示词增强**(或 插件面板 → `dsh-prompt-enhance` → **配置**)编辑。全部字段:
|
|
70
71
|
|
|
71
72
|
| 字段 | 默认 | 说明 |
|
|
72
73
|
|---|---|---|
|
|
73
|
-
| `enabled` | `true` |
|
|
74
|
-
| `provider` + `model` | 空 | 从 DSH 已注册的 LLM provider
|
|
75
|
-
| `temperature` | `0.3` |
|
|
76
|
-
| `reasoningEffort` |
|
|
77
|
-
| `maxOutputTokens` | `8192` | 单次调用的输出 token
|
|
78
|
-
| `maxInputChars` | `12000` |
|
|
79
|
-
| `timeoutMs` | `60000` |
|
|
80
|
-
| `systemPrompt`
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
| `enabled` | `true` | 总开关;关闭后隐藏输入框按钮,并停用命令与快捷键 |
|
|
75
|
+
| `provider` + `model` | 空 | 从 DSH 已注册的 LLM provider 及模型中选择;模型可选「自定义…」手填 ID;未配置的 provider 置灰、需先在 DSH 模型服务中配置;留空表示跟随当前会话模型(不指定)。只填一个时保存后按跟随会话处理 |
|
|
76
|
+
| `temperature` | `0.3` | 采样温度 `0~1`(步进 0.05),越低越忠实原文 |
|
|
77
|
+
| `reasoningEffort` | `off` | 档位由当前 provider/model 的声明决定;DeepSeek 为 `off` / `low` / `high` / `max`。未声明档位的路由会自动省略该字段(即跟随提供方默认);`inherit` 表示不传该字段 |
|
|
78
|
+
| `maxOutputTokens` | `8192` | 单次调用的输出 token 上限 |
|
|
79
|
+
| `maxInputChars` | `12000` | 输入字符上限;超限拒绝,不截断 |
|
|
80
|
+
| `timeoutMs` | `60000` | 单次调用端到端超时(毫秒) |
|
|
81
|
+
| `systemPrompt` | 空 | 自定义系统提示词;留空使用内置增强策略 |
|
|
82
|
+
| `strategyMode` | `replace-default` | `replace-default` 整体替换内置策略(仍保留最小输出契约);`extend-default` 把自定义策略追加在内置策略之后 |
|
|
83
|
+
| `shortcut` | 空(禁用) | 触发快捷键;例 `ctrl+alt+shift+e`。须包含 ctrl/alt/meta 中至少一个修饰键,shift 可选 |
|
|
84
|
+
| `streaming` | `true` | 边写边显示;仅影响显示节奏,最终结果不变 |
|
|
85
|
+
| `contextAware` | `true` | 读取最近对话以消解指代;含敏感内容的会话建议关闭 |
|
|
86
|
+
| `contextMaxMessages` | `8` | 参考的最近消息条数;`0` 表示不参考 |
|
|
87
|
+
| `contextMaxChars` | `4000` | 历史片段的字符预算;`0` 表示不参考 |
|
|
88
|
+
| `maxConcurrent` | `2` | 同时进行的增强上限;达到上限时新请求会提示稍后再试 |
|
|
89
|
+
| `rateLimitPerMinute` | `10` | 每分钟增强次数上限(滑动窗口);超限时提示稍后再试 |
|
|
86
90
|
|
|
87
91
|
## 安全
|
|
88
92
|
|