@surfishs/dsh-prompt-enhance 0.0.1 → 0.0.2
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 +7 -1
- package/package.json +1 -1
- package/src/client/settings-page.tsx +13 -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
|
|
package/lib/client.js
CHANGED
|
@@ -1917,8 +1917,10 @@ var SEPARATOR_STYLE = {
|
|
|
1917
1917
|
borderTop: "0.5px solid var(--dsw-alias-border-l2, rgba(128, 128, 128, 0.24))"
|
|
1918
1918
|
};
|
|
1919
1919
|
var REPOSITORY_URL = "https://github.com/surfishs/dsh-prompt-enhance";
|
|
1920
|
+
var NPM_URL = "https://www.npmjs.com/package/@surfishs/dsh-prompt-enhance";
|
|
1920
1921
|
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";
|
|
1921
|
-
var
|
|
1922
|
+
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";
|
|
1923
|
+
var PLUGIN_VERSION = true ? "0.0.2" : "0.0.0";
|
|
1922
1924
|
var HEADER_STYLE = { display: "flex", flexDirection: "column", gap: 12, padding: "2px 0" };
|
|
1923
1925
|
var HEADER_ROW_STYLE = { display: "flex", alignItems: "center", gap: 10, flexWrap: "wrap" };
|
|
1924
1926
|
var HEADER_TITLE_STYLE = {
|
|
@@ -1971,6 +1973,10 @@ function PageHeader(props) {
|
|
|
1971
1973
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { width: 11, height: 11, viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { fill: "currentColor", d: GITHUB_MARK }) }),
|
|
1972
1974
|
"GitHub"
|
|
1973
1975
|
] }),
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("a", { href: NPM_URL, target: "_blank", rel: "noreferrer", style: HEADER_LINK_STYLE, children: [
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { width: 11, height: 11, viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { fill: "currentColor", d: NPM_MARK }) }),
|
|
1978
|
+
"npm"
|
|
1979
|
+
] }),
|
|
1974
1980
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: HEADER_VERSION_STYLE, children: [
|
|
1975
1981
|
"v",
|
|
1976
1982
|
props.version
|
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.
|
|
4
|
+
"version": "0.0.2",
|
|
5
5
|
"author": "surfishs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -410,10 +410,17 @@ const SEPARATOR_STYLE: CSSProperties = {
|
|
|
410
410
|
/** Public repository behind this build, linked from the page header. */
|
|
411
411
|
const REPOSITORY_URL = 'https://github.com/surfishs/dsh-prompt-enhance'
|
|
412
412
|
|
|
413
|
+
/** Public npm package page, linked from the page header next to the repository. */
|
|
414
|
+
const NPM_URL = 'https://www.npmjs.com/package/@surfishs/dsh-prompt-enhance'
|
|
415
|
+
|
|
413
416
|
/** The GitHub mark (16×16), painted with the current text color. */
|
|
414
417
|
const GITHUB_MARK =
|
|
415
418
|
'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'
|
|
416
419
|
|
|
420
|
+
/** The npm mark (24×24), painted with the current text color. */
|
|
421
|
+
const NPM_MARK =
|
|
422
|
+
'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'
|
|
423
|
+
|
|
417
424
|
/** The version this bundle was built from; guarded for environments without the define. */
|
|
418
425
|
const PLUGIN_VERSION = typeof __PLUGIN_VERSION__ === 'string' ? __PLUGIN_VERSION__ : '0.0.0'
|
|
419
426
|
|
|
@@ -480,6 +487,12 @@ function PageHeader(props: { title: string; description: string; version: string
|
|
|
480
487
|
</svg>
|
|
481
488
|
GitHub
|
|
482
489
|
</a>
|
|
490
|
+
<a href={NPM_URL} target="_blank" rel="noreferrer" style={HEADER_LINK_STYLE}>
|
|
491
|
+
<svg width={11} height={11} viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
|
492
|
+
<path fill="currentColor" d={NPM_MARK} />
|
|
493
|
+
</svg>
|
|
494
|
+
npm
|
|
495
|
+
</a>
|
|
483
496
|
<span style={HEADER_VERSION_STYLE}>v{props.version}</span>
|
|
484
497
|
</div>
|
|
485
498
|
<p style={HEADER_DESCRIPTION_STYLE}>{props.description}</p>
|