DSH Plugins Marketplace

DSH Plugins

Plugins

/

DSH-Prompt-Optimizer

N

DSH-Prompt-Optimizer

Manifest valid

DSH Plugin / DSH Bundle: Rewrites the composer draft into a structured prompt (role/task/input/output/examples/steps) and writes it back in place without sending. Breath light strip, button icons, and keyboard shortcuts are all configurable.

UI (client)hasBundlePatchMachine translated

DSH-Prompt Optimizer

English — A DeepSeek Harness (DSH) bundle that adds an Optimize button to the chat composer. It rewrites the current draft into a structured, ready-to-use prompt (role / task / input / output / examples / steps) and writes the result back into the input box without sending it. Ships a breathing progress bar above or below the composer, selectable button icons, a Ctrl+right-click shortcut, and a settings page. client.js is prebuilt, so no build step is needed: install this directory through Plugins → Add plugin.

一个 DeepSeek Harness(DSH)的本地 bundle 插件:在聊天输入框工具条上加一个「优化」按钮,把当前草稿改写成一份结构化、可直接执行的提示词,并写回输入框继续编辑。

本仓库是插件的源码与可安装产物(client.js 为已构建文件)。插件只安装在当前电脑的 DSH profile 里,不随账号同步。

功能

  • 输入框工具条上的圆形按钮,点一下就把草稿交给模型改写;结果整段回填输入框,不发出去。
  • 改写目标是结构化提示词:角色 / 任务 / 输入 / 输出 / 示例 / 步骤,保留原始事实、路径与约束,不编造信息。
  • 支持 Ctrl+右键快捷触发(可关闭)。
  • 工作时在输入框上方或下方显示一条呼吸光带,可三选一:上侧 / 下侧 / 关闭;光带只画在布局原本留出的空隙里,pointer-events: none,不遮挡输入与按钮。
  • 按钮图标可选:灯泡 / 魔杖 / 闪电 / 星星 / 小人;加载动效可选圆圈旋转 / 图标预设。
  • 设置页「提示词功能设置」里调整上述选项,配置保存在 localStorage,刷新后保留。

安装

前提:DSH Desktop 或 Web(本插件在 0.2.2-rc.x 上开发与验证)。

  1. 把本目录放到一个长期保留的位置,例如: C:\Users\<用户名>\Documents\dsh-plugins\prompt-optimizer (安装会把 profile 链接到这个目录,之后不要移动或删除它。)
  2. 在 DSH 里安装:插件页 → 从本地目录安装,选第 1 步的目录;或让 agent 执行 plugin_manager 的 install_bundle,target 填该目录的绝对路径。
  3. 刷新页面(F5)。输入框工具条上、模型选择器与发送键之间会出现插件按钮。

详细安装说明见 INSTALL.md。

工作原理

半文件职责
Hostindex.js注册认证路由 /api/prompt-optimizer/optimize,用 ctx.llm.stream() 与 profile 默认模型完成改写
Clientclient.js工具条按钮、光带与加载态、错误气泡、inputActions.setDraft 回填、设置页
清单package.jsondsh.bundle.patch + dsh.client(web、立即加载)
层cordis.patch.yml往 profile 插入 Host 行 composer-prompt-optimizer

改写不写会话日志:草稿在发送前不是模型可见消息,插件只做 UI 侧变换。

兼容性

  • 需要同代 DSH:插件在 0.2.1-rc.5 上开发与验证(见 INSTALL.md),当前已在 0.2.2-rc.3 上加载运行。
  • 依赖宿主提供:客户端槽位 conversation.input.activity、inputActions.setDraft、认证 /api 精确 Fetch 路由、Host 的 ctx.llm 与 ctx.agentDefaultModel。
  • 使用 profile 的默认模型,不额外配置 provider。

目录

client.js          # 浏览器半(已构建,window.__ModuleLoader__.load 形式)
index.js           # Host 半:/api 路由 + 模型调用
cordis.patch.yml   # Host 行插入
package.json       # bundle 清单
locale/en.json     # 插件名与描述(en)
locale/zh.json     # 插件名与描述(zh)
icon.svg           # 插件图标
INSTALL.md         # 安装与设置说明(中文)

开发说明

client.js 是构建产物,DSH 运行时不做打包;修改后需重新构建再刷新页面。index.js 是普通 ESM 模块,改动后由 DSH 的 HMR 重载 Host 插件。

包里没有构建脚本与依赖:客户端通过宿主的模块加载器 require('react'),不额外引入第三方包。

已知限制

  • 改写结果是整段替换草稿;草稿里的 @文件 引用芯片会被一并替换(宿主未暴露只替换文本的接口)。
  • 输入框高度由宿主自适应,插件不改宿主布局;光带只读取输入卡片的尺寸来定位,不写宿主样式。
  • 已发布为 npm 包 @noobcg/dsh-prompt-optimizer;从目录安装与本仓库链接安装等价。

版本

1.0.0 — 首个正式版本:图标可选、光带统一为原地呼吸、光带设置合并为三选一、旧配置自动迁移。

Comments

Loading…

Similar plugins

dsh-prompt-enhance

by surfishs

DSH Web GUI 的提示词增强插件:一键把输入框草稿改写为结构化提示词,支持停靠结果卡、回填、复制、重新生成与撤销。 | Prompt enhancement plugin for the DSH web GUI: turn a composer draft into a structured prompt with a docked result card, apply, copy, re

Development & InfrastructureManifest valid

★ 4

↓ 1.5k/wk

Apache-2.0

TypeScript

Nov 19, 2026

dsh plugin --profile web add @surfishs/dsh-prompt-enhance

by xdr531955724

DSH(DeepSeek Harness)提示词管理器:按标签分组管理提示词,一键写进输入框;并用大模型优化输入框里正在写的东西。A DSH bundle: tag-grouped prompt library + AI prompt optimizer for the composer.

Manifest valid

★ 0

MIT

JavaScript

Nov 4, 2026

dsh plugin --profile web add @local/dsh-prompt-manager

by kee0012

DSH 提示词优化插件:输入框工具栏一键 ✨ 优化(直接写回可还原),风格/上下文/还原等设置收纳进 ▾ 弹出层。

Development & InfrastructureManifest valid

★ 2

↓ 356/wk

MIT

JavaScript

Oct 13, 2026

dsh plugin --profile web add dsh-prompt-optimizer

by master1Sun

DSH(DeepSeek Harness)Web 插件:在 composer 工具栏注入一个「提示词库」按钮,管理可复用的 prompt 片段,点击即可插入当前输入框。支持自动学习:输入复杂 prompt 文案时,插件会自动识别并保存到提示词库。

UI & ExperienceManifest valid

★ 17

↓ 715/wk

MIT

TypeScript

Nov 18, 2026

dsh plugin --profile web add @sunjuntao/dsh-prompt-library

by Lphehe

DSH 输入框助手:预测下一句、补全草稿、按需润色。建议按会话保留,Tab 只填入草稿、不自动发送。源码可见,修改须事先书面许可。

UI & ExperienceDevelopment & InfrastructureManifest valid

★ 18

↓ 217/wk

NOASSERTION

JavaScript

Nov 3, 2026

dsh plugin --profile web add dsh-composer-assist

by ruiyukirin

DSH 输入框一键提示词增强按钮 | One-click prompt enhancement for the DeepSeek Harness composer: rewrite the unsent draft into a clearer, more specific prompt, restore the original with one click. Ported from Tencent WorkBuddy's EnhancePrompt design; independent model call that never touches the session log.

UI & ExperienceSessions & MessagesManifest valid

★ 1

MIT

JavaScript

Oct 25, 2026

dsh plugin --profile web add dsh-prompt-optimization-master