dsh-intercom
DSH 内部通信插件:支持在同一台机器上的独立 DSH 会话之间进行发现、命名与消息传递。
AI 分析
核心用途是实现本地多个 DSH 进程或会话之间的协同与数据互通。适合需要构建多 Agent 协作流、或在不同终端窗口间同步任务状态的进阶用户。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Sqhao-O/dsh-intercom说明文档
阅读完整 README ↗Usage
Give each session a name, then talk to it from any other session:
intercom({ action: "name", alias: "worker" }) → name this session
intercom({ action: "list" }) → list live sessions (all processes)
intercom({ action: "list-cwd" }) → list sessions in this working directory
intercom({ action: "list-cwd", cwd: "/path" }) → list sessions in a specific directory
intercom({ action: "send", to: "worker", message: "..." }) → send a message (queued if the named peer is offline)
intercom({ action: "ask", to: "worker", message: "..." }) → send and block until the reply arrives
intercom({ action: "reply", message: "..." }) → reply to the current / single pending ask
intercom({ action: "reply", to: "planner", message: "..." }) → disambiguate between multiple pending asks
intercom({ action: "pending" }) → list unresolved inbound asks
intercom({ action: "cancel", messageId: "..." }) → request cancellation of a message you sent
intercom({ action: "status" }) → plugin/transport status
Address sessions by alias, full session id, or the unique id prefix shown in
parentheses by list. send/ask also accept replyTo, messageId,
supersedes, retryOf, and a cwd scope (omit to to target the sole live
peer in a directory). ask never queues: a disconnected target fails
immediately, while send to a recently disconnected named session queues
in the broker mailbox and is delivered when a session with the same alias and
working directory reconnects. DSH_INTERCOM_ASK_TIMEOUT_MS overrides the
10-minute default ask timeout.
Configuration
Optional $DSH_HOME/intercom/config.json — full reference (every key is
optional; unknown keys are ignored):
| Key | Type | Default | Meaning |
|---|---|---|---|
enabled | boolean | true | When false the plugin loads but never spawns or connects to the broker; every tool action except status answers with a clear disabled message. |
inboundTrigger | "always" | "replies" | "never" | "always" | Whether an inbound broker message may wake the session into a new model turn: "always" wakes on every message, "replies" only wakes on replies to messages this session sent, "never" only queues messages as context (no turn is triggered). |
replyHint | boolean | true | Append the intercom({ action: "reply" ... }) hint to inbound messages that expect a reply. |
status | string | — | Custom suffix appended to the automatic idle/thinking presence status shown to peers (e.g. "idle · on-call"). |
confirmSend | boolean | false | Accepted for pi-intercom config compatibility but a no-op: dsh's host-level tool-approval flow is the equivalent confirmation gate, so the plugin never opens its own dialog. |
Example:
{
"enabled": true,
"inboundTrigger": "always",
"replyHint": true,
"status": "custom suffix"
}
A malformed config file fails closed: the plugin keeps working with defaults
except inboundTrigger: "never", and logs a warning. The config is loaded
once at plugin load — changing config.json afterwards takes effect only
after restarting dsh.