Introduction¶
When pasting large logs, configurations, or documents directly into DSH chat, the content fills up the input box and is unfavorable for attachment upload and model-side file context. A common practice is to manually save as .txt and then upload, which involves multiple steps and disrupts the conversation flow. This article introduces the Web client plugin paste-as-text-attachment maintained by community developer zhanghui6666: it listens for paste events in the input box, and when text length exceeds a configurable threshold, automatically converts it to an in-memory .txt file and hands it to DSH’s native attachment flow. Short pastes and regular typing remain unaffected.
What Is This¶
paste-as-text-attachment is a Web Client plugin (category: client-side) for DeepSeek Harness (DSH). Repository: https://github.com/zhanghui6666/paste-as-text-attachment; catalog page: https://www.skillhub.cn/plugins/zhanghui6666/paste-as-text-attachment. SkillHub and other community catalogs are independent sites with no official affiliation to DeepSeek or High-Flyer.
The plugin extends chat input behavior in DSH’s “everything is a plugin” manner. It does not replace the built-in attachment bar but uses the conversation.input.overlay slot to observe paste events and triggers DSH’s existing file intake path when conditions are met.
Core Features¶
Verified capabilities (consistent with the repository README):
- Only handles paste: Listens only for
pasteevents in the currently focused DSH chat input box; does not intercept manual input. - Convert by length: Only converts to
.txtattachment when the pasted text’s JavaScript string length is greater than the configured character threshold. The threshold comparison usesString.length(UTF-16 code units), not UTF-8 byte count. - Uses native attachment flow: Creates a synthesized
ClipboardEventcontaining only the file, allowing DSH’s editor to perform normal attachment intake, preserving the built-in attachment bar and upload UI. - Other behavior unchanged: Short text pastes, pastes outside the input box, and regular typing remain as before.
- In-memory file creation: Text files are constructed in browser memory; the plugin itself does not write pasted content to local disk. After acceptance, DSH’s regular attachment/upload pipeline handles them.
- Configuration page: Provides Chinese and English configuration interfaces in the DSH plugin view.
Configuration Options¶
In DSH, open Plugins → Installed → paste-as-text-attachment and adjust in the bundle details page:
| Setting | Default | Description |
|---|---|---|
| Automatic conversion | Enabled | Can disable automatic conversion of long pastes |
| Character threshold | 10,000 | Integer range 1–10,000,000; only pastes exceeding this value are converted |
Settings are stored in the localStorage of the browser used by the current DSH Web GUI, persist after page refresh, but are not synced across profiles, browsers, or devices.
Installation and Activation¶
In DSH’s Plugins → Add Plugin page, enter the repository’s Git address (must match the README exactly):
https://github.com/zhanghui6666/paste-as-text-attachment.git
After installation, if the interface prompts to enable the bundle, follow the prompt. The plugin is injected into the Web Client with immediately: true, depending on @deepseek-ai/dsh-client-ui-conversation and @deepseek-ai/dsh-client-ui-plugin-manager.
Typical Usage¶
- Install and enable the plugin; confirm “Automatic conversion” is enabled in the details page, and adjust the character threshold as needed (default 10,000).
- With the DSH chat input box focused, paste a plain text longer than the threshold (e.g., a very long log).
- If the current DSH version correctly handles synthesized file pastes, the original text paste will be cancelled, a
.txtattachment will appear on the input box side, and subsequent sending and upload behavior will be consistent with manually adding attachments. - When pasting text shorter than or equal to the threshold, behavior is the same as without the plugin; content still goes directly into the input box.
Repository note: Automated tests use mock implementations for editor file reception behavior; before relying on this plugin to handle important logs, perform an end-to-end verification on the target DSH version.
How It Works (Brief)¶
The plugin observes the conversation.input.overlay list slot and does not occupy the single-slot conversation.input.attachments used by DSH’s built-in attachment bar. Eligible long pastes generate an in-memory text File and dispatch a synthesized paste event to the focused editor; only when the host handles the file event does the original text paste get cancelled.
Use Cases and Notes¶
Suitable for: DSH Web users who frequently paste large texts in conversations and want them uniformly handled as .txt attachments rather than filling up the input box; users needing a lightweight client-side enhancement with toggleable and adjustable thresholds.
Environment and permissions:
- Requires DSH Web Client to provide
conversation.input.overlayand the editor’s paste path to support file items. - Requires browser support for
File,DataTransfer,ClipboardEvent,localStorage. - The plugin runs in the current DSH Web process / browser context; review the source code and MIT license before installation to confirm compliance with your security and compliance requirements.
Development verification: The maintainer uses Node’s built-in test runner locally to cover slot registration, configuration persistence, threshold and disabled mode logic, without additional test dependencies:
node --test client.test.js
Conclusion¶
paste-as-text-attachment collapses “ultra-long paste → manually save file → upload” into a single step within the input box while preserving DSH’s native attachment experience. For installation addresses, configuration instructions, and implementation details, refer to the GitHub README; community indexes are available at the SkillHub catalog page and the repository link above.