Introduction¶
When using DeepSeek Harness (DSH), the input box draft might become very long. long-draft-input is an independent plugin for DSH 0.1.0-rc.5. It solves the problem: when the input box draft exceeds a threshold, it expands the send box upward and displays an attachment-style summary card, without changing DSH’s original draft state, message format, or send path.
Overview¶
The following introduces the positioning and boundaries of this plugin.
It is maintained by Heyflyingpig and is licensed under MIT. The plugin is used to handle long drafts in the DSH input box: after exceeding the threshold, the draft is folded into a summary card; if not exceeding the threshold, it maintains the original input box behavior. The plugin does not define the attachment protocol nor modify the server-side message format.
Core Features¶
Small text that has not exceeded the threshold does not render the plugin UI, maintaining original behavior.
When the input box draft exceeds the threshold:
- Long text is still completely saved in DSH’s
input.draft. - The summary card displays the first line preview, character count, and line count.
- The summary card acts as a child item in the original send box’s internal layout, pushing the send box upward like an attachment.
- The collapsed state hides the original textarea’s full text while preserving the original toolbar and send button.
- A separate supplementary input area is retained below the card. Supplementary text will be appended to the full long text and submitted via the original send button.
- After clicking “Show in text box”, the original textarea is restored and focus is returned to it.
- Clicking
×removes the aggregated long text; if supplementary text has already been entered below the card, only this supplementary text is retained. - The original send button in InputBar still calls the original
inputActions.submit().
Implementation-wise, it uses the public conversation.input.dock extension point to handle lifecycle, and then uses a React Portal to place the summary card into the original [data-composer-card].
Installation and Usage¶
Install to DSH Profile¶
First, install according to the command provided in the repository documentation, then run the specified profile.
dsh plugin --profile demo add github: Heyflyingpig/long-draft-input
dsh --profile web
Before installation, note that package.json declares node >= 22.19.0. GitHub installation will execute the prepare script to build TypeScript and the browser bundle. pnpm 10+ might require the profile’s pnpm-workspace.yaml to explicitly allow the package’s build scripts. You can also publish an npm package or a pnpm pack tarball, directly carrying the pre-built lib/, to reduce build permissions during installation.
Local Verification in Source Code Checkout¶
If verifying in a DSH project source code checkout, the following three commands are used respectively for adding a local path plugin, viewing the configuration, and starting.
pnpm dsh plugin --profile demo add /absolute/path/to/long-draft-input
pnpm dsh --profile demo --dump-config
pnpm dsh --profile demo
Typical Usage¶
Default Threshold¶
The default threshold is 2000 JavaScript characters, with the first line preview being 120 Unicode code points.
Overriding Configuration¶
Configuration can be overridden in the profile’s subsequent patch layers. Since the patch replaces the entire line of configuration, please include both the threshold and previewChars fields when overriding:
- id: long-draft-input
config:
threshold: 20000
previewChars: 160
Development and Verification¶
The development and verification commands are as follows:
pnpm install
pnpm test
pnpm run test:unit
pnpm pack:check
Real Web integration testing requires first starting Web in a DSH profile where this plugin is installed, and then executing:
DSH_WEB_URL=http://127.0.0.1:3080 pnpm run test:web
Suitable Scenarios and Notes¶
Suitable for scenarios where long drafts are frequently generated in the DSH input box, and the goal is to fold and display them without changing the submission path.
Please note when using:
- The plugin runs with the permissions of the current dsh process; check the source code and license before installation.
- The plugin does not change the draft state, message format, or send path; short text that has not exceeded the threshold will not trigger the plugin UI.
- The public extension point cannot control the private React rendering logic inside
InputBar.tsx, so it cannot prevent the original component from continuing to construct backdrop and mirror nodes. - Real Web integration testing relies on starting Web with a DSH profile that has this plugin installed.
Conclusion¶
The value of long-draft-input lies in the fact that long text is still saved in input.draft, the send button still follows the original inputActions.submit(), and only the draft exceeding the threshold is folded into an attachment-style summary card.
GitHub: Heyflyingpig/long-draft-input