1847123733/dsh-prompt-optimize

插件Plugin ⭐ 6 MIT web-ui

DeepSeek Harness (DSH) Web 插件:提供 提示词优化、用户提问锚点,以及右下角的 DeepSeek API 悬浮用量卡片。

catalog 简介 / catalog descriptioncatalog description:DSH Web plugin: web ui

编辑导读Editor's Brief

## 核心特性
- Prompt 优化会读取当前草稿,在按钮上显示加载状态,使用默认 provider 和 model 生成改写结果,在按钮上方的气泡中预览结果,仅在选择 Apply 后写入输入框。
- 用户问题锚点会按对话顺序收集用户消息和已接受的追问,在右侧显示带问题数量的锚点面板,悬停或键盘聚焦时显示完整文本,并平滑滚动到所选用户消息。
- 悬浮的 DeepSeek API 用量胶囊显示在右下角,悬停或点击后展开,展示已配置的 key 名称、脱敏标识符、今天、昨天和最近七天的消耗,并单独显示账户余额。
- 用量数据复用 DSH 模型设置中存储的 DEEPSEEK_API_KEY,每 60 秒自动刷新或手动刷新,并且完整 API key 和平台 token 仅在 DSH host 端解析,不会返回给浏览器。

## 使用场景
- 在 DSH Web 聊天会话中发送前优化 prompt。
- 通过锚点面板定位此前的用户问题,在长对话中快速导航。
- 在使用 Web 界面时监控 DeepSeek API 余额和 key 级消耗。

## 技术细节
- 该插件通过 dsh plugin add 从 GitHub、本地路径或 npm 安装到 DSH web profile,并在安装或移除后需要重启 web profile。
- 运行时依赖包括 host 的 llm 和 webServer 服务、client slots 的 input-area 集成,以及 DSH 设置中可用的 LLM。
- Prompt 优化行为可通过 cordis.patch.yml 或 profile patch 设置修改 provider、model、最大输入字符数、最大输出 tokens 和 temperature。
- 账户余额从公开的 DeepSeek 用户余额 endpoint 获取,而单 key 成本使用通过 sensitive_id 和 tracking_id 匹配的平台用量 endpoint。

## 注意事项
- 单 key 用量展示依赖 DeepSeek 平台内部接口,当登录状态过期、WAF 拦截访问或接口变化时可能失效。
- 环境变量或 DSH credential provider 可以覆盖内置默认的 DEEPSEEK_PLATFORM_TOKEN,token 值可包含或省略 Bearer 前缀。
- 用量金额按 GMT+8 自然日计算,平台数据可能延迟约五分钟。

## Core Features
- Prompt optimization reads the current draft, shows a loading state on the button, generates a rewrite with the default provider and model, previews the result in a bubble above the button, and writes to the input box only after Apply is selected.
- User question anchors collect user messages and accepted follow-up questions in conversation order, display an anchor panel on the right with a question count, reveal full text on hover or keyboard focus, and scroll smoothly to the selected user message.
- The floating DeepSeek API usage capsule appears in the lower-right corner, expands on hover or click, and shows the configured key name, masked identifier, spending for today, yesterday, and the last seven days, with account balance displayed separately.
- Usage data reuses the DEEPSEEK_API_KEY stored in DSH model settings, refreshes automatically every 60 seconds or manually, and keeps full API keys and platform tokens parsed only on the DSH host side rather than returning them to the browser.

## Use Cases
- Optimizing a prompt before sending it in a DSH web chat session.
- Navigating long conversations by locating prior user questions through the anchor panel.
- Monitoring DeepSeek API balance and key-level spending while using the web interface.

## Technical Details
- The plugin is installed into the DSH web profile with dsh plugin add from GitHub, a local path, or npm, and requires restarting the web profile after installation or removal.
- Runtime dependencies include the host llm and webServer services, the client slots input-area integration, and an available LLM configured in DSH settings.
- Prompt optimization behavior can be changed through cordis.patch.yml or profile patch settings for provider, model, maximum input characters, maximum output tokens, and temperature.
- Account balance is fetched from the public DeepSeek user balance endpoint, while per-key cost uses a platform usage endpoint matched by sensitive_id and tracking_id.

## Notes
- The per-key usage display depends on an internal DeepSeek platform interface that may stop working when login state expires, a WAF blocks access, or the interface changes.
- Environment variables or the DSH credential provider can override the bundled default DEEPSEEK_PLATFORM_TOKEN, and the token value may include or omit the Bearer prefix.
- Usage amounts are calculated by GMT+8 calendar days, and platform data may be delayed by about five minutes.

安装Install

dsh plugin --profile web add dsh-prompt-optimize

1847123733/dsh-prompt-optimize 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

上一个 Prev dsh-plugin-tavily 下一个 Next dsh-plugin-manager