← 返回列表
D

@huanlin/dsh-plugin-spur

v0.1.0 · 4 天前发布

A braided whip (辫子) hanging in the chat-flow — grab the tip and swing to send "go work!" to the agent.

dsh-plugin

README

dsh-spur

小鲸鱼不听话?抽就完了。

一根悬挂在 DSH 聊天流中的辫子(皮鞭)。抓住辫梢甩动——速度足够快时,向 agent 发送一条 go work! 消息,鞭策它去干活。

功能

  • Verlet 物理引擎渲染的辫子,作为 position: fixed 的 SVG 叠层,锚定在视口右上角,垂入聊天区域。

  • 辫梢圆点是唯一可抓取的元素(在整体 pointer-events: none 的叠层上设为 pointer-events: auto)。

  • 鼠标按下 → 辫梢锁定到光标;鼠标移动 → 跟踪速度(指数移动平均);鼠标释放 → 带末速度释放。

  • 释放速度超过阈值(2.0 px/ms)时:

  • 1. 保存当前输入草稿。
    2. inputActions.setDraft('go work!')
    3. inputActions.submit()
    4. 提交事务完成后(phase 回到 plain)恢复原草稿。
  • 释放后辫子继续摆动,阻尼振荡直至静止。
  • 架构

    单 bundle 双入口(host . + 浏览器 ./client + invariant ./invariant),仿照 yet-another-subagent

  • 宿主半边src/index.ts):空 apply——纯客户端插件。

  • 浏览器半边src/client/index.ts):注册 conversation.composer.dock list slot(id dsh-spur,order 50)。dock 是编辑器卡片下方的条带;辫子本身是 position: fixed 的 SVG 叠层,通过 createPortal 挂载到 `document.
  • 版本兼容矩阵

    DSH 版本状态说明
    dsh@0.1.0-rc.6 ✅ 兼容 cordis patch ✅
    dsh@0.1.0 ✅ 兼容 标准 patch ✅
    dsh@0.2.0 ⚠️ 待验证 待实测(API 可能在变)
    dsh@0.3.0+ ❓ 未知 尚未发布

    💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正

    元数据

    License
    AGPL-3.0
    npm
    @huanlin/dsh-plugin-spur
    Repo
    Engines
    {"node":">=22.0.0"}
    Weekly DL
    0
    Monthly DL
    0
    dsh.bundle
    {"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-slots","@deepseek-ai/dsh-client-ui-primitives","@deepseek-ai/dsh-client-ui-conversation"],"platform":"web"}}