dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DSH 常驻插件(非动态沙箱包):在聊天输入框右上角(conversation.input.right)注册「普通模式 / ✨ 优化模式」切换。优化模式下基于当前会话上下文、复用当前会话选择的模型优化输入框草稿,结果回填后仍可继续编辑。
本包是可注册的正式插件:通过 profile 的 dsh.profile.bundles 安装,进程重启后依然生效;而动态插件(cordis_define)只在当前进程内存活。
通信机制升级为 Connection RPC 通道(/prompt-optimizer):宿主 handler 收到真实 AbortSignal,取消会传播到 LLM 适配器底层传输(动态版只能协作式 break)。
| 路径 | 职责 |
|---|---|
src/index.ts | Host 半:注册 /prompt-optimizer RPC 通道(optimize / cancel),读取会话表面作上下文,经 ctx.llm.stream 流式生成,AbortController 汇聚传输信号与显式取消。 |
src/client/index.ts | Client 半:conversation.input.right 槽位 UI(切换/优化/加载/取消/错误/截断提示/成功渐隐)、Alt+O(IME/表单控件/defaultPrevented 防护)、setDraft 回填。 |
scripts/build-client.mjs | esbuild 把 client 源码打成 ModuleLoader closure-factory bundle(lib/client.js),react 外部化。 |
cordis.patch.yml | bundle patch:把插件 insert 进 profile 组合。 |
# 在 profile 目录(C:\Users\<user>\.dsh\profiles\web):
# 1. 添加依赖(file: 指向本包)
# package.json → dependencies 加 "dsh-prompt-optimizer": "file:D:/developRelevant/product/dshp/dsh-sen-message/dsh-prompt-optimizer"
# dsh.profile.bundles 加 "dsh-prompt-optimizer"
pnpm install
# 2. 构建本包(在包目录)
npm install # devDependencies(esbuild/tsc/类型包)
npm run build # 产出 lib/index.js + lib/client.js
# 3. 重启 dsh web(或 dsh plugin 命令管理)
dsh plugin --profile web -- add "file:..." 也可以管理安装(它转发 pnpm)。
modelSelection 的 next ?? lastUsed;provider/model 只传其一时视为整体未提供,回退 agent 默认模型。max-tokens 截断返回 truncated 并提示;重复 token 拒绝;消息 id 每请求唯一;上下文最近 10 条、每条 800 字符、总量 6000 字符。