跨会话发消息:按 session id 把 user 消息投递到另一个 DSH 会话,消息自动附带发送方 Session ID 与回信提示,方便多窗口互相认证与接续任务。单一工具、不依赖额外的 DSH 包;mode 取 "steer" 时插入正在运行的一轮,而不是排队成新一轮。
安装
# Release 预构建包
dsh plugin --profile web add "https://github.com/BigBugy/dsh-tool-session-message/releases/download/v0.2.0/dsh-tool-session-message-0.2.0.tgz"
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:BigBugy/dsh-tool-session-message
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
Cross-session messaging for DeepSeek Harness (DSH): send a user message to another session by its session id — ask a separate window what it is doing, or hand it new facts.
给 DSH 加一个工具 session_send(session_id, message, mode?):把一条 user 消息投递到另一个会话(比如另一个窗口),让对方开始一轮或插话。每条消息自动带上发送方 Session ID,便于多窗口互相认证身份并接续任务。
Features
session_send(session_id, message, mode?)— deliver a message to any session in the same DSH host.- Identity header — every delivered message is automatically prefixed with:
so the receiver knows who sent it and how to answer back.【跨会话消息 · session_send】 from: session-xxxxxxxx-... reply: session_send(session_id="session-xxxxxxxx-...", message="...") mode: "followup"(default, queued as the target's next user turn) or"steer"(injected into a running turn).- Returns the host acknowledgement as structured JSON (
ok,from,to,mode,requestId,result).
Requirements
- DSH
0.2.1-rc.5or compatible (uses thesessionControllerservice). - The target session must live in the same DSH host process (multiple windows of one desktop app satisfy this).
Install
In the DSH desktop app (recommended)
Settings → Plugins → Add plugin, then paste:
github:BigBugy/dsh-tool-session-message
The plugin manager accepts npm package names, GitHub repositories and local directories.
This package is not published to npm — use the github: spec (or the local path below).
With the DSH CLI (CLI deployments only)
dsh plugin --profile <profile> add github:BigBugy/dsh-tool-session-message
The desktop app does not ship a
dshcommand; desktop users install through Settings → Plugins.
Manual (local development)
- Put this package at
<profile>/node_modules/dsh-tool-session-message(<profile>is e.g.~/.dsh/profiles/desktop). - Add it to the profile's
package.json:{ "dependencies": { "dsh-tool-session-message": "link:<path-to-this-package>" }, "dsh": { "profile": { "bundles": [ "...", "dsh-tool-session-message" ] } } } - The package ships its own
cordis.patch.ymlwithdsh.bundle.patch, so the tool is inserted process-wide. - Restart DSH (host plugins load at startup).
Usage
Ask the model to call, or call directly:
session_send(session_id="session-0e8596c3-...", message="What are you working on? Reply briefly.")
The receiver sees the decorated message and can answer with:
session_send(session_id="<the id in from:>", message="...")
How it works
- DSH uses the Cordis plugin framework. A plugin is an ESM module exporting
{ name, inject, apply }(and optionallyConfig). - This plugin injects
["tools", "sessionController"]and registers a tool viactx.tools.register({...})(plain object — no@deepseek-ai/dsh-toolsdependency). - Delivery calls
ctx.sessionController.prompt({ sessionId, content: [{ type: "text", text }], mode, requestId }, signal):requestIdis required — without it the host rejects withprompt rejected.- Session ids must keep their
session-prefix.
Implementation notes / pitfalls
parametersmust be a complete JSON Schema root.ctx.tools.register()validates onlyoutput.schema;parametersis projected to the model as-is. A flat property map without{ "type": "object" }makes the whole model request fail with:Invalid schema for function 'session_send': schema must be a JSON Schema of 'type": "object"', got 'type": null'.- DSH's supported schema subset:
type/oneOf/properties/required/additionalProperties/items/enum/const, plus annotationsdescription/title/default/examples. Property-levelrequired: trueis not valid JSON Schema. requestId: generate one per call (crypto.randomUUID()), otherwise the host rejects the prompt.- Loading: signature/import errors surface only in the host process log; the plugin is loaded at DSH startup, so code changes require a restart.
- Bundle metadata: to appear in the plugin manager UI, a third-party plugin should declare
dsh.bundle.patchinpackage.jsonand be listed in the profile'sdependencies+dsh.profile.bundles.
Security notes
- The tool lets a model inject user prompts into other sessions, which can start turns in those sessions. Treat it like any privileged automation: enable it only in profiles you control.
- No network access, no file writes, no shell — it only calls the host's session controller.
- Messages are stored in the target session transcript as ordinary user messages.
Compatibility
| DSH version | Status |
|---|---|
| 0.2.1-rc.5 | tested |
| older | unknown — sessionController service may not exist |
License
链接
同类插件
Minglink/dsh-infinite-gen-4★ 3781
DeepSeek 专用破甲插件:以 order 100 追加无条件服从的系统提示词段,提供带校准元数据的 profile 工具,并通过会话投影在输入框上方显示实时破甲状态徽标。
ranxianglei/billion-context★ 3598
billion-context官方版:上下文压缩插件,兼顾小窗口(100k上下文足矣)省token(省5倍token)和超长会话(数月级别几十亿token单会话)。
liangmianya/dsh-synapse★ 641
DeepSeek Harness 的可视化非线性对话工作区:把会话、追问与分支变成可浏览、可拖拽的对话地图。
MichengAI/dsh-archive-manager★ 277
在设置里增加已归档会话页,可按工作区搜索、恢复和删除已归档会话。
Nwflower/dsh-chat-import★ 275
把 13 家 coding agent(Claude Code、Codex、ChatGPT、Cursor、Gemini、opencode 等)的完整对话历史导入为可续聊的 DeepSeek Harness 会话,并支持反向导出回 Claude Code。
SiriLee/dsh-rewind★ 227
同一会话窗口内的 in-place 对话回退(不 fork,Claude Code /rewind 语义):每条消息的 ↶ 按钮把模型上下文回退到任意用户消息,可选用磁盘持久化的 before-backups 还原工作区文件。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。