Pular para o conteúdo principal
X

dsh-composer-predictions

xuhuawork/dsh-composer-predictions

Context-aware next-step prompt chips above the composer with hover full-prompt previews, Option/Alt+1..4 shortcuts, editable-only draft fill, a 5s overwrite guard, fast-model routing, and zero prompt-cache drift.

Instalar

dsh plugin --profile web add github:xuhuawork/dsh-composer-predictions

README

dsh-composer-predictions · DeepSeek Harness 输入预测插件

Architected from Shen Xuhua's official Hermes Composer Predictions prompt-prediction engine — natively re-engineered for DeepSeek Harness Desktop & Web.
源自沈序桦(Shen Xuhua)研发并合入 Hermes 官方目录的 Hermes Composer Predictions 提示词预测架构,面向 DeepSeek Harness 双端微内核深度重构的原生二次开发插件。

Built as the DeepSeek Harness counterpart to Shen Xuhua's Hermes Composer Predictions (merged into the official Hermes Plugin Catalog, PR #157436). Inherits the same I✦ visual grammar, four-intent prompt choreography (ask / refine / action / verify), and 0-byte Prompt Cache drift sidecar discipline—rebuilt cleanly on Cordis and Typert RPC.
沿用沈序桦在 Hermes 官方目录插件中确立的统一 I✦ 视觉符号语言、四维意图提示词工程(追问 / 精修 / 执行 / 验证)与 0B 主会话缓存零损耗旁路架构,基于 DeepSeek Harness 原生 Cordis 与 Typert RPC 体系重构落地。

GitHub Stars dsh.so risk DSH Hub Verified Hermes Official Plugin Feedback & Issues

DeepSeek Harness Composer Predictions interactive demo (shimmer → hover tooltip → click-to-draft → 5s overwrite guard → refresh)

4 intent pill chips · Frameless native 60fps motion · Editable draft only (never auto-sends) · 5s overwrite lock · 0B prompt-cache drift · Cold+Hot sessions · Zero external runtime deps
4 枚全圆角意图胶囊 · 无框原生 60fps 流畅动效 · 仅填可编辑草稿(绝不自动发送)· 5 秒防误覆盖锁 · 0B 主会话缓存损耗 · 支持冷/热会话 · 零外部运行时依赖

Static Dark & Light theme screenshots · 暗色 / 亮色静态高清预览

DeepSeek Harness Composer Predictions bar above the composer (Dark) DeepSeek Harness Composer Predictions bar above the composer (Light / 中文)


Quick Install · 快速安装

git clone https://github.com/xuhuawork/dsh-composer-predictions.git
cd dsh-composer-predictions

# Optional dry-run check (touches nothing)
node scripts/install.mjs --profile desktop --dry-run

# Install into DeepSeek Harness Desktop profile (creates automatic timestamped backup)
node scripts/install.mjs --profile desktop

# Uninstall cleanly anytime
node scripts/install.mjs --profile desktop --uninstall

Also works with any custom dsh Web profile (--profile <name>). Never modifies DeepSeek Harness.app or app.asar. Restart DeepSeek Harness after install/uninstall to activate.


Features · 核心特性

  • Short intent chips, full-prompt hover preview (短标签选方向,悬停看全文)
    After each assistant reply settles, up to four untruncated short chips appear cleanly above the composer (conversation.input.dock), spanning ask, refine, action, and verify. Hover any chip to read the full ready-to-send prompt.
  • Editable draft only + 5s overwrite guard (仅填草稿不抢发 + 5 秒防误覆盖锁)
    Clicking a chip calls inputActions.setDraft(...) and never calls submit(). When the composer already holds a different unsent draft, the first click intercepts with an inline warning; a second click on the same chip within 5 seconds confirms replacement.
  • 0-byte Prompt Cache drift (0B 主会话历史与缓存损耗)
    The host Cordis service (ComposerPredictionsService) reads at most the latest 6 nonempty visible user/assistant messages (12,000 char cap) strictly read-only, runs a single stateless ctx.llm.prepareCall(...) at the model's fastest reasoning effort, and never calls session.append(...). Hidden reasoning/CoT blocks, tool calls, and system/developer prompts are never sent.
  • Automatic language matching & zero-flicker refresh (语言自动跟随 & 换一组零闪烁)
    Language strictly follows your latest human message (Chinese or English). Clicking ↻ New suggestions / ↻ 换一组 keeps previous chips visible while fetching and swaps cleanly (60ms / 80ms, skipped under prefers-reduced-motion). Revisiting an unchanged turn reuses the validated in-memory cache with zero extra LLM calls.
  • Keyboard shortcuts (纯键盘快捷键)
    • Empty composer (Tab / ← / → / Esc): matches Hermes Desktop's keyboard flow — press Tab or ← to cycle suggestions with live full-prompt preview, → to accept into the editable draft (never auto-sends), and Esc to dismiss. Never intercepts Shift+Tab, IME composition, non-empty drafts, or slash/mention menus.
    • Direct jump (Option/Alt + 1..4 & Option/Alt + R): insert any suggestion immediately (protected by the 5s overwrite guard), or refresh suggestions hands-free.
  • Dedicated fast-model routing (独立轻量小模型路由)
    When your main conversation uses a slower flagship model, optionally pin a fast sidecar route in your profile cordis.patch.yml (or DSH plugin config):
    - id: composer-predictions
      config:
        provider: deepseek-account
        model: deepseek-flash
    
  • One-click pause & instant cached resume (I✦ 随时开关 · 秒回流畅动效)
    Click the frameless I✦ toggle on the left to pause predictions anytime (persisted in localStorage; zero requests while paused) and click again to cascade already-generated chips back immediately with zero extra LLM call. Cold loading renders equal-height shimmer pill skeletons to eliminate vertical layout shift.

Architecture · 架构说明

LayerFileResponsibility
Pure Corelib/core.jsRead-only session extraction (<=6 msgs, <=12,000 chars), language detection, prompt builder, JSON parser/clipper, 5s overwrite guard
Host Cordis Servicelib/index.jsTypertRemoteService (composerPredictions/generate), stateless ctx.llm.prepareCall, LRU turn cache, abort & disposal cleanup
Typert Contractslib/typert.host.js, lib/typert.remote-client.jsStrict Zod RPC schemas auto-discovered by @deepseek-ai/dsh-typert-loader
Browser Client UIlib/client.jswindow.__ModuleLoader__.load bundle mounted into conversation.input.dock (order: 30) using native DeepSeek Harness CSS design tokens
Bundle Patchcordis.patch.ymlDeclarative Cordis bundle mount (maxMessages, maxInputChars, maxOutputTokens, timeoutMs)

Local Verification · 本地测试与校验

npm run check

License

MIT.

Plugins relacionados