pomelo-ccc/dsh-pi-composer ↗★ 0

dsh-pi-composer

PI-Desktop style composer controls for DeepSeek Harness: a searchable two-pane model picker with a reasoning-effort slider, ArrowUp prompt-history recall, and a prompt-rewrite button. 适合需要便捷切换模型、调节推理强度和回溯历史提示词的用户。

패키지
dsh-pi-composer
호환성
미검증
버전
1.1.2
라이선스
LGPL-3.0
최근 업데이트
2026. 10. 1.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:pomelo-ccc/dsh-pi-composer

dsh-pi-composer

把 PI-Desktop 的输入框控件搬进 DeepSeek Harness 的 composer:模型选择、推理强度、提示词历史回溯与提示词改写。

中文 | English

模型菜单:当前模型与推理强度滑块

功能

插件在 composer 上占用三个插槽,各自独立工作。

1. 模型选择座位 — conversation.input.model

以 priority: -20 注册,覆盖内置的模型控件(数值越低越优先渲染),因此输入框里看到的是这个 chip。

  • chip 显示当前模型与推理等级(DeepSeek V4 Pro · high)。
  • 菜单有两栏:根面板是当前模型单元格加推理强度滑块;点进模型面板是搜索框加按 provider 分组的模型列表。
  • 列表每行右侧显示上下文窗口(1M、262.1K、128K),支持推理与图片输入的模型带徽标。
  • 选中一行会向模型目录提交 { provider, model },然后退回根面板。
  • 搜索同时匹配模型 id、名称与 provider 名称。
  • 目录不可用或会话是子代理时,chip 变成惰性状态而不是消失;渲染异常会写进 slots 台账而不是让整个座位被撤下。

2. 提示词历史回溯 — conversation.input.left

不渲染任何控件,只接管键盘:草稿为空时按 ↑ 从最近一条已发送提示往回走(最多 40 条),↓ 往前走并在越界时清空草稿;一旦手动编辑草稿,回溯立即结束。

3. 提示词改写 — conversation.input.right

一个 Sparkles 按钮,落在 composer 工具栏的 right 座位(宿主把它渲染在模型 chip 左侧,见下方截图)。

  • 点击后立即出现撤销按钮;改写失败或返回空内容时撤销按钮仍保留,点撤销即恢复原文。以 / 开头的草稿不改写。
  • 若 localStorage 键 pi_composer_custom_providers_v1 里有可用的自定义 Provider,草稿会 POST 到它的 OpenAI 兼容 /v1/chat/completions(7 秒超时,草稿会离开本机)。
  • 没有可用配置时改用内置的启发式改写模板(把草稿补全为「任务目标 + 交付要求」形态),只在本地完成,不发起网络请求。
  • 注意:本插件目前没有任何界面会写入该键——模型面板底部的「添加模型服务」入口在样式里是 display: none,Provider Studio 面板没有接线。要用自定义 Provider,得自己往 localStorage 写这个键。

主题与语言

  • 颜色令牌只声明在 :root,跟随宿主的深色标记 body[data-ds-dark-theme](DSH 主题包写入的就是这个标记),也支持 prefers-color-scheme: dark。
  • 注册 zh / en 两套字典,键集完全一致,跟随宿主 locale;改写按钮的 title / aria 文案目前是硬编码中文,英文界面下也会显示中文。

安装

插件市场(收录后):设置 → 插件市场,搜索 dsh-pi-composer 一键安装。

命令行(自管 profile):

dsh plugin --profile 
 add https://github.com/pomelo-ccc/dsh-pi-composer/releases/download/v1.1.2/dsh-pi-composer-1.1.2.tgz

这条 URL 钉住了 tag 与文件名,发下一个版本时换成新的 tag / 文件名即可(latest/download/ 虽然看起来更省事,但 pnpm 会按 URL 缓存解析结果,URL 背后内容一变,重新安装就会报 ERR_PNPM_MISSING_TARBALL_INTEGRITY;实测如此)。

Desktop 应用的 desktop profile 由 Electron 应用独占管理,CLI 会拒绝写入,请在插件市场里安装。

手动接入:把仓库目录作为 link: 依赖加入 profile 的 package.json,并在 dsh.profile.bundles 里列出本包。

截图

四张截图都用本仓库的 client.js 在无头 Chromium 中挂载真实组件渲染,模型目录使用示例数据(DeepSeek 账号 / DeepSeek / 阿里百炼 三组,共 4 个模型),深浅色分别用宿主的 body[data-ds-dark-theme] 标记切换。

根面板(浅色)模型面板(浅色)模型面板(深色)根面板(深色)
根面板浅色模型面板浅色模型面板深色根面板深色

兼容性

  • engines.dsh:`>=0.1.0-rc.1 =0.2.0-rc.1 ,同为 LGPL-3.0)部分实现的移植;移植了哪些文件、哪些是本仓库原创,见 NOTICE。

English

Composer controls for DeepSeek Harness, ported from PI-Desktop.

  • Model seat (conversation.input.model, priority -20, shadows the built-in control): a chip showing model · effort, a two-pane menu (root pane: current model cell + reasoning-effort slider; model pane: search plus provider-grouped model list with context-window formatting and reasoning/vision badges), and selection that submits { provider, model } to the model directory.
  • Prompt history (conversation.input.left): no visible control; an empty draft plus ↑ walks back through up to 40 accepted prompts, ↓ walks forward, and editing the draft ends the browse.
  • Prompt rewrite (conversation.input.right): a Sparkles button with undo, sitting left of the model chip. With a usable custom provider in localStorage key pi_composer_custom_providers_v1 the draft is POSTed to its OpenAI-compatible /v1/chat/completions (7s timeout); otherwise a built-in heuristic template rewrites it locally with no network request. No UI in this plugin writes that key yet.
  • Theming: colour tokens live on :root only and follow the host's dark marker body[data-ds-dark-theme], plus prefers-color-scheme: dark. Dictionaries ship in zh and en (the rewrite button's titles are still hardcoded Chinese).

Install via the plugin market, or:

dsh plugin --profile 
 add https://github.com/pomelo-ccc/dsh-pi-composer/releases/download/v1.1.2/dsh-pi-composer-1.1.2.tgz

Screenshots are rendered from this repository's real client.js in headless Chromium against a sample model directory; dark shots use the host's body[data-ds-dark-theme] marker.

LGPL-3.0 (SPDX LGPL-3.0-only) — see LICENSE and NOTICE for the ported scope.