メインコンテンツへスキップ
C

dsh-paste-as-file

chfeizy/dsh-paste-as-file

Turn long pasted text in the chat input into a .txt attachment, DeepSeek Web style.

インストール

dsh plugin --profile web add github:chfeizy/dsh-paste-as-file

README

dsh-paste-as-file

Turn long pasted text in the chat input into a .txt attachment, like DeepSeek Web does. 把聊天输入框中的长文本粘贴自动转为 .txt 附件,行为对齐 DeepSeek 网页版。

English · 中文

What it does

  • Paste text longer than a threshold (default 1000 characters) into the chat composer → it is converted into a pasted-YYYYMMDD-HHMMSS.txt attachment instead of flooding the input.
  • Shift + paste always inserts plain text (escape hatch).
  • Pasting with files, or pasting into other inputs (sidebar, settings, dialogs), is untouched.
  • A short info note appears after conversion and auto-dismisses after 5 seconds.
  • No network access, no telemetry, no storage beyond two localStorage keys below.

Install

dsh plugin add dsh-paste-as-file
# or from source
dsh plugin add github:chfeizy/dsh-paste-as-file

Reload the web GUI afterwards.

Configure (optional)

Both keys live in the browser's localStorage of the DSH page:

KeyDefaultMeaning
dsh-paste-as-file.threshold1000Minimum pasted-text length (chars) to convert. Min 100.
dsh-paste-as-file.debugoffSet to 1 to log [paste-as-file] lines to the console.
localStorage.setItem('dsh-paste-as-file.threshold', '2000')

How it works

The bundle injects a headless component into the conversation.input.dock slot. The per-session inject face exposes the composer's attachment intake; the component registers a capture-phase paste listener on every [data-composer-card] editor and, when the threshold is hit, calls preventDefault() and routes the clipboard text through the same path as drag and drop (createDrafts → attachment card → automatic upload). Everything runs client-side.

Uninstall

dsh plugin remove dsh-paste-as-file

License

MIT

関連プラグイン