DeepSeek Harness 插件

dsh-prompt-optimize-peterliu

DeepSeek Harness web plugin: rewrite a composer draft through an auxiliary LLM call without sending a message(英文原文)

跳到安装方式

来源信息

GitHub 仓库
peterliucius/dsh-prompt-optimize
最近更新
2026年8月17日
分类
工具与能力
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/peterliucius/dsh-prompt-optimize
插件名:dsh-prompt-optimize-peterliu
作者:peterliucius

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-prompt-optimize

DeepSeek Harness web plugin: rewrite the current composer draft through an auxiliary LLM call. Click replaces the draft only; it never sends a message or starts a turn.

Install

dsh plugin --profile web add github:peterliucius/dsh-prompt-optimize

Git-hosted plugins build on install through prepare. pnpm ≥10 blocks that script until you allow it. The first add fails and prints the key; copy it into the profile's pnpm-workspace.yaml:

allowBuilds:
  dsh-prompt-optimize: true

Then re-run the same add. Only allow packages whose source you trust. Pin a commit (github:peterliucius/dsh-prompt-optimize#<sha>) if you do not want a later push to change what runs.

A local checkout that already has lib/ does not need allowBuilds:

dsh plugin --profile web add /path/to/dsh-prompt-optimize

Start the web profile:

dsh --profile web

The patch inserts one row named dsh-prompt-optimize (maxInputBytes: 32768, maxOutputTokens: 4096, timeoutMs: 60000). The same package's dsh.client declaration occupies conversation.input.right. Default web-app does not mount this plugin.

Behavior

The sparkle button is always visible. It disables when the draft is empty after trim, contains a composer reference chip (U+FFFC), the session is removed, or the input machine is not in the plain phase.

Click captures the current draft, calls ctx.promptOptimize.optimize over the promptOptimize Typert Remote, and overwrites the composer through inputActions.setDraft only when the live draft still equals that capture. Failures toast; a moved draft toasts and is not replaced.

The auxiliary request frames the draft as JSON, uses a fixed rewrite instruction, enforces the configured byte and token budgets, composes timeout with caller cancellation, and sets reasoningEffort: 'off'. It never enqueues a user message or appends a durable session event.

Route resolution uses plugin provider/model when both are set, else the session's latest request/header config, else ctx.get('agentDefaultModel')?.currentSelection().

Configuration

Every field is required except the paired route override; there are no library defaults. The bundle row supplies the values below.

KeyContract
maxInputBytesPositive UTF-8 byte ceiling for the final JSON-framed user prompt.
maxOutputTokensPositive auxiliary generation token cap.
timeoutMsPositive end-to-end deadline within the runtime timer limit.
provider, modelOptional explicit route; both or neither.

Override them in the profile's cordis.patch.yml by restating the whole row config.

Develop against a local harness

Tests resolve @deepseek-ai/dsh-* peers through a sibling deepseek-harness checkout at ../dsharness. Without that checkout, pnpm test skips.

pnpm install
pnpm test
pnpm build

Regenerate Typert host + remote-client artifacts after changing @Remote methods (requires the sibling checkout):

pnpm exec tsx scripts/generate-typert.ts

License

MIT