@surfishs/dsh-prompt-enhance 0.0.9 → 0.1.1

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,6 +12,16 @@
12
12
 
13
13
  ---
14
14
 
15
+ ## Why you need it
16
+
17
+ A prompt is rarely the hard part; shaping it for a model to execute is: the role (who the assistant plays), the deliverable (what it must hand over), the output format (structure, language, length, style), and the acceptance criteria (how to tell the result is right).
18
+
19
+ This plugin adds a Prompt enhance button to the composer; clicking it calls your harness LLM service to produce a properly structured prompt.
20
+
21
+ The enhanced result appears above the composer without covering the conversation; it does not replace the original text by itself — fill it back, copy it, regenerate it, or undo it, and the original stays safe.
22
+
23
+ With context awareness on, it also reads the last few turns to resolve pronouns and works out what you need on its own.
24
+
15
25
  ## Feature overview
16
26
 
17
27
  | Feature | What it does |
@@ -36,7 +46,7 @@
36
46
 
37
47
  ## Install
38
48
 
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`.
49
+ 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`). **Do not** run `dsh plugin add dsh-prompt-enhance`.
40
50
 
41
51
  ### Let an agent install it
42
52
 
@@ -126,7 +136,7 @@ An empty or attachment-only draft dims the button and starts no request; raise `
126
136
  - **No model keys stored**: the plugin does not read or store model API keys; calls use the host's existing LLM configuration.
127
137
  - **Context sent only when enabled**: with `contextAware` on, the most recent user/assistant text and the current draft are sent to the configured model provider (default: up to 8 messages and 4,000 characters); system messages, reasoning, tool results and attachments are excluded. With it off, only the draft is sent.
128
138
  - **Sensitive conversations**: if the content must not leave the machine, turn off `contextAware` or use a local/private model route you trust.
129
- - **Local tier cache**: the plugin caches "which reasoning tiers does this route declare" in `$DSH_HOME/dsh-prompt-enhance/reasoning-efforts.json` (`~/.dsh/…` when `DSH_HOME` is unset). The file holds only the provider, the model and the tier metadata — no API key, draft or conversation text. The cache has no expiry; refresh it from the settings page's tier-refresh control, or delete the file.
139
+ - **Local tier cache**: the plugin caches "which reasoning tiers does this route declare" per provider/model under `$DSH_HOME/dsh-prompt-enhance/reasoning-efforts/` (`~/.dsh/…` when `DSH_HOME` is unset), and each entry expires and is re-probed after 30 days. The files hold only the provider, the model and the tier metadata — no API key, draft or conversation text. Refresh them from the settings page's tier-refresh control, or delete the directory.
130
140
 
131
141
  ## Troubleshooting
132
142
 
@@ -137,6 +147,7 @@ An empty or attachment-only draft dims the button and starts no request; raise `
137
147
  | Truncated result | Check the truncation warning and raise `maxOutputTokens` in settings. |
138
148
  | "No model resolved for enhancement" | Set both `provider` and `model` in settings, or send a message in the current session so the plugin can follow the session route. |
139
149
  | Authentication failure | Check the provider credentials/API key configured in DSH. |
150
+ | `/enhance` shows only the first line and cannot be expanded | A rendering limit of the DSH chat UI, not this plugin: as of `@deepseek-ai/dsh-client-ui-chat` 0.2.2-rc.3, only results containing a newline get an expand control, so a single-line result is ellipsized with no way to open it. To read the whole result, put the same text in the composer and use the enhance button — the button's card wraps and scrolls. |
140
151
 
141
152
  ## Development
142
153
 
package/README.md CHANGED
@@ -12,6 +12,16 @@
12
12
 
13
13
  ---
14
14
 
15
+ ## 为什么需要它
16
+
17
+ 写提示词最费劲的往往不是想法,而是补成适合模型执行的样子:角色(助手扮演谁)、交付物(最终交付什么)、输出格式(结构、语言、长度与风格)、合格标准(怎样判断结果正确)。
18
+
19
+ 本插件在输入框加入「提示词增强」按钮,点击即调用 harness LLM 服务生成规范提示词。
20
+
21
+ 增强结果展示在对话框上方且不遮挡对话;不直接替换原文,可回填、复制、重新生成或撤销,原文安全。
22
+
23
+ 开启上下文感知后参照最近几轮对话消解指代,自主理解任务需求。
24
+
15
25
  ## 功能一览
16
26
 
17
27
  | 功能 | 说明 |
@@ -36,7 +46,7 @@
36
46
 
37
47
  ## 安装
38
48
 
39
- 装之前请确认包名。npm 上的 `dsh-prompt-enhance`(无 scope)是上游原项目,本插件是它的重写分支,包名是 `@surfishs/dsh-prompt-enhance`。本插件的安装源是本仓库 `surfishs/dsh-prompt-enhance` 或它在插件市场里的条目。**不要**执行 `dsh plugin add dsh-prompt-enhance`。
49
+ 装之前请确认包名。npm 上的 `dsh-prompt-enhance`(无 scope)是上游原项目,本插件是它的重写分支,包名是 `@surfishs/dsh-prompt-enhance`。本插件的安装源是本仓库 `surfishs/dsh-prompt-enhance`。**不要**执行 `dsh plugin add dsh-prompt-enhance`。
40
50
 
41
51
  ### 让 Agent 帮你安装
42
52
 
@@ -126,7 +136,7 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
126
136
  - **不保存模型密钥**:插件不读取或存储模型 API key,调用走宿主已有的 LLM 配置。
127
137
  - **上下文按需发送**:`contextAware` 开启时,最近几轮 user/assistant 文本和当前草稿会发给当前配置的模型服务商(默认最多 8 条消息、4000 字符);system、reasoning、工具结果和附件不会进入上下文。关闭后只发送草稿。
128
138
  - **敏感会话**:如果内容不能外发,请关闭 `contextAware`,或改用你信任的本地/私有模型服务。
129
- - **本机档位缓存**:插件会把「当前路由声明了哪些推理档位」的查询结果缓存到 `$DSH_HOME/dsh-prompt-enhance/reasoning-efforts.json`(未设置 `DSH_HOME` 时为 `~/.dsh/…`)。文件内容只有 provider、model 与档位信息,不含 API key、草稿或对话内容;缓存没有过期时间,可在设置页点「重新获取档位」刷新,或直接删除该文件。
139
+ - **本机档位缓存**:插件会把「当前路由声明了哪些推理档位」的查询结果按 provider/model 分别缓存到 `$DSH_HOME/dsh-prompt-enhance/reasoning-efforts/` 目录(未设置 `DSH_HOME` 时为 `~/.dsh/…`),每条缓存 30 天后自动失效并重新探测。文件内容只有 provider、model 与档位信息,不含 API key、草稿或对话内容;也可在设置页点「重新获取档位」立即刷新,或直接删除该目录。
130
140
 
131
141
  ## 故障排查
132
142
 
@@ -137,6 +147,7 @@ dsh plugin --profile <profile> remove @surfishs/dsh-prompt-enhance
137
147
  | 结果不完整 | 查看截断提示,并在设置中调高 `maxOutputTokens`。 |
138
148
  | 提示「尚未确定增强用的模型」 | 在设置中成对填写 `provider` / `model`;或先在当前会话发一条消息,让插件跟随会话模型。 |
139
149
  | 鉴权失败 | 检查对应 provider 在 DSH 中的凭据/API Key 是否有效。 |
150
+ | `/enhance` 的结果只显示第一行、点不开 | 这是 DSH 聊天界面的渲染限制,与本插件无关:截至 `@deepseek-ai/dsh-client-ui-chat` 0.2.2-rc.3,只有含换行的结果才提供展开,单行结果会被省略号截断且没有入口。要看全文,把同样的文本放进输入框、用增强按钮——按钮的结果卡会自动折行并可滚动。 |
140
151
 
141
152
  ## 开发
142
153
 
Binary file
Binary file