dsh-session-reference-copy
Agent 与会话 活跃维护

dsh-session-reference-copy

shaomingbo/dsh-session-reference-copy

轻量级辅助工具,可直接从Web会话请求头中提取并复制规范的跨会话引用内容,操作简单无需额外配置,能帮助开发者快速获取标准引用数据,适配开发调试需求。

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

dsh-session-reference-copy

A small DeepSeek Harness Web client plugin that copies the current Session as a canonical cross-session reference.

Why

Harness can reference another Session with @, but finding a specific Session by title or ID is inconvenient when moving between implementation and review conversations. This plugin adds a copy button to the current Session header and puts the exact structured mention on the clipboard:

@[Readable session title](https://github.com/shaomingbo/dsh-session-reference-copy/blob/main/dsh-session:<encoded-session-id>)

Paste that text into another Session and send it. Harness resolves the opaque identity and captures the source Session through its existing session-reference snapshot mechanism.

Behavior

  • Uses the current Session's display title as the readable label.
  • Falls back to the Session ID when no summary is available.
  • Encodes the ID with Harness's canonical dsh-session: JSON/UTF-8/base64url format.
  • Escapes ] and backslashes in labels.
  • Shows a check icon for one second after a successful clipboard write.
  • Reports clipboard failures through the current conversation notice surface.
  • Adds no Host RPC, persistence, or model prompt behavior of its own.

The pasted mention may remain plain canonical text in the composer instead of becoming a visual chip. This does not change the reference semantics after submission.

Session references are snapshots captured when the target message enters the model step. They are not live links to future source-Session changes.

Installation

Install the tagged release into the Web profile:

dsh plugin --profile web add github:shaomingbo/dsh-session-reference-copy#v0.1.0

Restart dsh web, then hard-refresh the existing browser page. To update or remove it later:

dsh plugin --profile web update dsh-session-reference-copy
dsh plugin --profile web remove dsh-session-reference-copy

For local development, add the package as a linked dependency and bundle in ~/.dsh/profiles/web/package.json:

{
  "dependencies": {
    "dsh-session-reference-copy": "link:/absolute/path/to/dsh-session-reference-copy"
  },
  "dsh": {
    "profile": {
      "bundles": [
        "dsh-session-reference-copy"
      ]
    }
  }
}

Then install the profile dependencies:

cd ~/.dsh/profiles/web
pnpm install --ignore-scripts

Restart DSH and hard-refresh the existing Web page so the new client bundle enters the boot graph.

Development

npm run check

The client module is a self-contained DSH window.__ModuleLoader__ bundle. Tests execute it with a small module-loader fixture and verify canonical encoding, title fallback, slot registration, successful copying, and clipboard refusal.

License

MIT