deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
为 DeepSeek Harness 开发的「建议提示词」插件:每个 agent 回合完成后,通过一次有界的辅助 LLM 调用,在会话日志中写入一条建议的下一条提示词;Web 输入框在草稿为空时把它渲染成浅灰色幽灵文本,按 Tab(默认)即可采纳进草稿(与 Claude Code 一致)。
本仓库是这两个包的权威源码(source of record),由两个包构成:
| 包 | 作用 |
|---|---|
@studyzy/dsh-suggest-prompt |
宿主插件:在 turn/end(reason=completed)时生成建议,发布 suggestPrompt 会话投影。 |
@studyzy/dsh-client-ui-suggest-prompt |
浏览器插件:读取投影,把建议推入输入框的幽灵装饰(InputActions.setGhost),按配置的快捷键填入草稿。 |
deepseek-official / deepseek-v4-flash;通过 provider / model 可换成任意路由(例如本地 OpenAI 兼容网关)。maxRecentTurns 默认为 1),中间的工具调用 / 推理过程一律不发送。acceptKey 配置,默认 Tab。^22.19 或 >=24、pnpm。InputActions.setGhost);请确认所用 harness 版本已内置该输入机能力。注意:
@studyzy/dsh-suggest-prompt与@studyzy/dsh-client-ui-suggest-prompt的完整依赖链尚未全部发布到 npm(上游@deepseek-ai/dsh-compact、@deepseek-ai/dsh-environment等仍缺失)。等 registry 补齐后:
npm install @studyzy/dsh-suggest-prompt @studyzy/dsh-client-ui-suggest-prompt
然后在 profile 的 cordis.yml / 补丁层挂上两行(见下「配置」示例)。
把这两个包放进 harness 工作区(或通过 file: 依赖引用本仓库),并在 profile 补丁层插入两行。例如 ~/.dsh/profiles/web/cordis.patch.yml:
- id: suggest-prompt
name: '@studyzy/dsh-suggest-prompt'
config:
maxInputBytes: 4096
maxOutputTokens: 512
timeoutMs: 60000
maxRecentTurns: 1
maxTranscriptChars: 12000
maxSuggestionChars: 240
provider: ccr
model: ttswitch/deepseek-v4-flash-ioa
acceptKey: Tab
- id: ui-suggest-prompt
name: '@studyzy/dsh-client-ui-suggest-prompt'
provider / model 同时省略时,会继承当前主请求最近一次记录的路由,无需为建议单独配置模型。
| 字段 | 含义 | 默认 |
|---|---|---|
maxInputBytes |
最终框架化用户提示的最大 UTF-8 字节数 | 必填 |
maxOutputTokens |
建议生成输出令牌上限 | 必填 |
timeoutMs |
辅助请求端到端截止时间(毫秒) | 必填 |
maxRecentTurns |
转录尾部保留的最近完成回合数 | 1(只取最后一轮的用户输入 + AI 最终回答) |
maxTranscriptChars |
转录字符预算 | 必填 |
maxSuggestionChars |
建议的可见字符上限 | 必填 |
provider / model |
显式路由对;同时省略则继承主请求路由 | 继承 |
acceptKey |
采纳建议的输入框快捷键 | Tab(可写 Alt+Slash、Ctrl+Enter 等) |
maxOutputTokens提示:如果建议模型是推理模型(回答前会「思考」),思考会消耗输出预算;maxOutputTokens偏小时,流会在输出建议文本之前就以max-tokens结束。给推理模型留足预算(例如512)。
turn/end(reason=completed)时触发生成;按会话 + 回合去重,下一个完成回合会中止上一个在途生成。suggest-prompt/suggested 事件,suggestPrompt 投影把它暴露给 Web 端。acceptKey(默认 Tab)把建议填入草稿(可编辑后再发送);焦点不在输入框或处于 IME 组合输入时不触发,Tab 也只在显示幽灵时才被拦截(否则保持默认焦点行为)。简体中文,否则 English)。[User Message] / [Assistant Response] 带标签块(已脱敏、受 maxTranscriptChars 约束)。suggest-prompt/request 事件,满足「模型可见 ⟺ 日志可重建」。maxInputBytes / maxOutputTokens 约束;主 agent 请求不增加任何 token。AKIA…、OpenAI sk-…、GitHub ghp_/gho_/ghu_、Slack xox-…、JWT、Stripe rk_… 等密钥形状在发送前被掩蔽为占位标签。maxSuggestionChars。suggest-prompt/suggested 事件,投影保持 null,也不记录警告。maxOutputTokens。pnpm install
pnpm build # host tsc + client tsdown bundle
pnpm test # vitest
pnpm typecheck
安装说明:本仓库依赖已发布的
@deepseek-ai/*包(deepseek-harness 工作区)。上游少量内部包(@deepseek-ai/dsh-compact、@deepseek-ai/dsh-environment)尚未出现在 npm registry,pnpm install可能失败,直到 harness 的 registry 补齐。完整测试矩阵在 harness monorepo 内运行;本仓库是两个包的权威源码副本。
MIT
Suggested-next-prompt plugin for the DeepSeek Harness. After every completed agent turn, a bounded auxiliary LLM call writes one suggested next prompt into the session log; the web composer renders it as ghost text in the empty input — press Tab (default) to adopt it into the draft (the Claude Code behavior).
This repository is the authoritative source of record for the two packages:
| Package | Role |
|---|---|
@studyzy/dsh-suggest-prompt |
Host plugin: generates the suggestion on turn/end (reason completed) and publishes the suggestPrompt session projection. |
@studyzy/dsh-client-ui-suggest-prompt |
Browser plugin: reads the projection, pushes the suggestion into the composer's ghost decoration (InputActions.setGhost), and fills the draft on the configured shortcut. |
deepseek-official / deepseek-v4-flash; set provider / model to route anywhere (for example a local OpenAI-compatible gateway).maxRecentTurns defaults to 1); intermediate tool calls / reasoning are never included.acceptKey, default Tab.^22.19 or >=24, pnpm.InputActions.setGhost); verify your harness version ships that input-machine seam.Note: the full dependency chain of
@studyzy/dsh-suggest-promptand@studyzy/dsh-client-ui-suggest-promptis not fully on the npm registry yet (upstream@deepseek-ai/dsh-compact,@deepseek-ai/dsh-environment, etc. are still missing). Once the registry is complete:
npm install @studyzy/dsh-suggest-prompt @studyzy/dsh-client-ui-suggest-prompt
Then mount the two rows in your profile's cordis.yml / patch layer (see the config example below).
Put the two packages into the harness workspace (or reference this repo via a file: dependency), and insert the two rows in your profile patch layer. For example ~/.dsh/profiles/web/cordis.patch.yml:
- id: suggest-prompt
name: '@studyzy/dsh-suggest-prompt'
config:
maxInputBytes: 4096
maxOutputTokens: 512
timeoutMs: 60000
maxRecentTurns: 1
maxTranscriptChars: 12000
maxSuggestionChars: 240
provider: ccr
model: ttswitch/deepseek-v4-flash-ioa
acceptKey: Tab
- id: ui-suggest-prompt
name: '@studyzy/dsh-client-ui-suggest-prompt'
Omit both provider and model to inherit the route of the most recently logged main request — no need to configure a model just for suggestions.
| Field | Meaning | Default |
|---|---|---|
maxInputBytes |
Maximum UTF-8 bytes in the final framed user prompt | required |
maxOutputTokens |
Suggestion output-token cap | required |
timeoutMs |
End-to-end auxiliary request deadline (ms) | required |
maxRecentTurns |
Transcript tail keeps at most this many recent completed turns | 1 (only the last turn's user input + assistant final answer) |
maxTranscriptChars |
Transcript character budget | required |
maxSuggestionChars |
Visible-character cap for the suggestion | required |
provider / model |
Explicit route pair; omit both to inherit the main request route | inherited |
acceptKey |
Composer shortcut that adopts a displayed suggestion | Tab (Alt+Slash, Ctrl+Enter, ...) |
On
maxOutputTokens: if the suggestion model reasons before answering, thinking consumes the output budget. A smallmaxOutputTokensends the stream withmax-tokensbefore any suggestion text is produced — leave a generous budget (e.g.512) for reasoning models.
turn/end (reason completed), deduplicated per session and turn; the next completed turn aborts the in-flight generation.suggest-prompt/suggested event, and the suggestPrompt projection exposes it to the web side.acceptKey (default Tab) fills the draft (editable, not sent). It is ignored while focus is outside the composer or during IME composition; Tab is intercepted only while a ghost is displayed (otherwise it keeps its default focus behavior).简体中文 when the last user message contains CJK, otherwise English).[User Message] / [Assistant Response] blocks (redacted, bounded by maxTranscriptChars).suggest-prompt/request event before dispatch, satisfying the model-visible ⟺ logged invariant.maxInputBytes / maxOutputTokens; the main agent request gains zero tokens.AKIA…, OpenAI sk-…, GitHub ghp_/gho_/ghu_, Slack xox-…, JWTs, and Stripe rk_… secret shapes are masked before the transcript reaches the model.maxSuggestionChars.suggest-prompt/suggested event is written, the projection stays null, and no warning is logged.maxOutputTokens.pnpm install
pnpm build # host tsc + client tsdown bundle
pnpm test # vitest
pnpm typecheck
Install caveat: this repo depends on the published
@deepseek-ai/*packages (the DeepSeek Harness workspace). A small number of internal packages referenced by the publisheddsh-*releases are not yet on the npm registry (@deepseek-ai/dsh-compact,@deepseek-ai/dsh-environment), sopnpm installmay fail until the harness registry is complete. The full test matrix runs inside the harness monorepo; this repo is the source-of-record copy for the two packages.
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。