dsh-scratchpad
其他 活跃维护

dsh-scratchpad

joao-paulo-santos/dsh-scratchpad

提供一块屏幕中央的共享悬浮文本画布,其他插件可通过客户端服务调用该画布完成内容展示、编辑操作,轻量无冗余设计,可无缝嵌入各类工具插件的工作流,无需额外配置即可快速调用。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
20 KB
仓库大小
25 天前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:joao-paulo-santos/dsh-scratchpad
git clone https://github.com/joao-paulo-santos/dsh-scratchpad.git
git clone git@github.com:joao-paulo-santos/dsh-scratchpad.git
README.md main

dsh-scratchpad

A DeepSeek Harness (DSH)
plugin: one shared floating text surface in the middle of the screen that
any plugin can open, for reading big text or editing it in place.

There is no UI of its own to visit. Other plugins open the pad through the
client service scratchpad:

// consumer client half, inject: ['scratchpad', 'slots', …]
ctx.scratchpad.open({
  title: 'Section preview',        // optional header text
  text: bigText,                   // required string
  editable: true,                  // false (default): read-only viewer
  onSave: (text) => { … },         // edit mode: the ONLY channel back
})

Modes

  • Read: text is not editable, there is no Save, Close is the only
    action; a backdrop click also closes. Selecting and copying work
    (readOnly, never disabled).
  • Edit: Save + Cancel. Save calls onSave(editedText) and closes. A
    backdrop click does not close (no stray-click data loss). Editable
    without onSave is allowed: a draft pad, where Close discards.
  • Escape closes (discarding edits in edit mode); Ctrl/Cmd+Enter saves.

Contract

  • open replaces whatever the pad shows (one pad per tab).
  • Validation: text must be a string of at most 2 MB; onSave without
    editable: true throws. Fail loud at the door.
  • No return value; no persistence. A throwing onSave keeps the pad open
    with the error surfaced in the footer.
  • Pad state survives session switches (module scope) but not page reloads.

How to install

Requires a DeepSeek Harness checkout and a profile, here web. The plugin
has no dependencies:

mkdir -p ~/dsh-plugins && cd ~/dsh-plugins
git clone https://github.com/joao-paulo-santos/dsh-scratchpad.git

# from the harness checkout
pnpm dsh plugin --profile web add ~/dsh-plugins/dsh-scratchpad

# verify the profile still composes
pnpm dsh --profile web --dump-config

Restart the harness. Plugins that inject the scratchpad service can now
open the pad.

Dependencies

  • dsh-diff-view renders mode: 'diff' pads (optional; without it a diff pad degrades to a plain before/after view)

Plugins dependent on this

  • dsh-granular-prompt opens the pad for full-text viewing, section replacement, and diff review