Heyflyingpig/long-draft-input 预览 preview

Heyflyingpig/long-draft-input

Deepseek Harness 插件:用于聚合发送框长文本

项目介绍Project Overview

长草稿输入是面向 DeepSeek Harness 0.1.0-rc.5 的 Web UI 插件。当输入草稿超过默认 2,000 字符阈值时,将发送框向上扩展并显示附件式摘要卡片,展示首行预览、字符数与行数;下方保留独立补充输入区,文字会追加到完整长文本后通过原发送按钮提交。完整文本仍保存在 DSH 的 input.draft 中,插件不改草稿状态、消息格式或发送路径。需注意:当前版本折叠态无法阻止原 InputBar.tsx 内部继续构造 backdrop 与 mirror 节点。

Long Draft Input is a web UI plugin for DeepSeek Harness 0.1.0-rc.5. When an input draft exceeds a default 2,000-character threshold, the composer expands upward and renders an attachment-style summary card showing the first-line preview, character count, and line count; a separate supplement input below appends text to the full draft and submits via the original send button. The complete text remains in DSH's input.draft, and the plugin does not alter draft state, message format, or send paths. Caveat: in collapsed mode it cannot prevent the original InputBar.tsx from constructing its private backdrop and mirror nodes.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile demo add github: Heyflyingpig/long-draft-input

Heyflyingpig/long-draft-input 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

long-draft-input

一个面向 DeepSeek Harness 0.1.0-rc.5 的独立插件:当输入框草稿超过阈值时,将发送框向上扩展并显示附件式摘要卡片,但不改变 DSH 原有的草稿状态、消息格式或发送路径。

预览

alt text

行为

  • 长文本仍完整保存在 DSH 的 input.draft 中。
  • 摘要卡片展示首行预览、字符数和行数。
  • 摘要卡片作为原发送框内部的正常布局子项,像附件一样将发送框向上撑高;折叠态隐藏原 textarea 的完整文本,保留原工具栏和发送按钮。
  • 卡片下方保留独立的补充输入区;补充文字会追加到完整长文本后,继续通过原发送按钮提交。
  • 点击“在文本框中显示”后恢复原 textarea,并将焦点交还给它。
  • 点击 × 移除聚合的长文本;如果卡片下方已经输入补充正文,只保留这部分正文。
  • 原 InputBar 的发送按钮仍调用原有 inputActions.submit();插件不定义附件协议,也不改服务端消息格式。
  • 未超过阈值的小文本不渲染插件 UI,因此保持原行为。

默认阈值为 2,000 个 JavaScript 字符,首行预览为 120 个 Unicode code point。可在 profile 的后续 patch 层覆盖;由于 patch 会替换整行配置,覆盖时请同时写出两个字段:

- id: long-draft-input
  config:
    threshold: 20000
    previewChars: 160

安装

在本地目录中执行

dsh plugin --profile demo add github: Heyflyingpig/long-draft-input
dsh --profile web

GitHub 安装会执行 prepare 构建 TypeScript 和浏览器 bundle。pnpm 10+ 可能要求 profile 的 pnpm-workspace.yaml 显式允许该包的构建脚本;也可以发布 npm 包或 pnpm pack tarball,直接携带已构建的 lib/,减少安装时的构建权限。

在 项目源码 checkout 中本地验证:

pnpm dsh plugin --profile demo add /absolute/path/to/long-draft-input
pnpm dsh --profile demo --dump-config
pnpm dsh --profile demo

开发和验证

pnpm install
pnpm test
pnpm run test:unit
pnpm pack:check

真实 Web 组合测试需要先在一个已安装本插件的 DSH profile 中启动 Web:

DSH_WEB_URL=http://127.0.0.1:3080 pnpm run test:web

当前版本限制

这个插件使用公开的 conversation.input.dock 扩展点承载生命周期,再通过 React Portal 把摘要卡片放入原 [data-composer-card],使卡片真正参与发送框内部排版,而不是在对话区上方叠加独立层。折叠态通过 CSS 隐藏原 textarea 的可见文本层,但不会替换输入框的发送逻辑。公开扩展点无法控制 InputBar.tsx 内部的私有 React 渲染逻辑,因此它不能阻止原组件继续构造 backdrop 和 mirror 节点。

友情链接

https://linux.do

上一个 Prev dsh-session-cost 下一个 Next dsh-vault