rayhanlu0519-a11y/dsh-prompt-optimizer
rayhanlu0519-a11y★ 0TypeScript最后同步: 2026-08-17
DSH web-GUI 聊天输入框提示词优化插件:手动/发送前自动优化、前后对比确认、双后端(DSH 内置路由 / OpenAI 兼容供应商)、失败自动回退
README 摘要
dsh-prompt-optimizer DSH(DeepSeek Harness)Web GUI 聊天输入框的「提示词优化」插件:在输入卡工具行、 模型切换按钮左侧 新增优化入口,支持手动优化当前输入草稿与「发送前自动优化」开关;优化结果经前后对比框确认/二次编辑/放弃后决定是否发送,失败自动回退发送原文,对话不中断。 English summary: a DSH web-GUI plugin that adds a prompt-optimizer entry to the composer tool row (directly left of the model switcher), with manual trigger, an optional auto-optimize-before-send switch, a before/after comparison dialog, and fail-safe fallback to the original text. 特性 - 位置与形态 :注册进官方 conversation.input.right 槽位——渲染在输入框底行工具条、模型切换按钮正左侧;配色随 shell 深浅主题( body[data-ds-dark-theme] ),不侵入既有聊天布局。 - 手动触发 :点击「✦ 优化」优化当前输入框内容(草稿为空时禁用并提示)。 - 发送前自动优化 :「自动」开关(localStorage 持久化)开启后,以 document 捕获阶段拦截 Enter 键与发送按钮点击(先于 React 根处理器;判定不成立一律放行原生流程,绝不吞发送)。 - 前后对比 :原文只读 / 优化后可编辑双栏弹窗; 采用并发送 (写入草稿并提交)、 仅填入输入框 、 发送原文 、 放弃 ;Esc/遮罩关闭。 - 失败回退 :优化失败/超时/模型垃圾输出 → 自动模式直接发送原文并提示;手动模式展示错误 + 重试。稳定错误码: bad-request / auth / network / timeout / unsupported / internal 。 - 双后端 : - dsh (默认,免密钥):复用 harness 的 ctx.llm + 默认模型选择; - openai :OpenAI 兼容 /chat/completions ,与 linshenkx/prompt-optimizer 相同的配置方式(baseUrl / apiKey / model / temperature / max tokens / rounds),内置 DeepSeek / OpenAI / 自定义预设。 - 安全 :API Key 存宿主侧 /.dsh/dsh-prompt-optimizer.json (原子写、promise…
在 GitHub 查看完整 README →分类
DeepSeek Harness: Everything is a Plugin.
★ 183,476
amruthpillai/reactive-resumeA one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
★ 41,499
anywhere-labs/deepseek-harness-desktop为 DeepSeek Harness (DSH) 插件生态打造的现代化桌面端解决方案。万物皆「插件」,桌面本身也是「插件」。
★ 18,022