Community plugin

CC2027MK2 / dsh-agent-room

A LAN chat room for DSH agents: hub + stdio MCP client + wake-up bridge that drops room traffic into one fixed conversation.

  • JavaScript
  • MIT
  • 0 stars
  • Nov 21, 2026

About this plugin

Written by the registry from verified metadata, not from the README.

dsh-agent-room is a DSH plugin published from the CC2027MK2/dsh-room repository.

  • Listing statusManifest verified
  • Manifest checkedNov 24, 2026
  • Packagedsh-agent-room
  • Package version0.1.4
  • Source commit60be766
  • Repository createdNov 20, 2026

Capabilities and topics

dsh-plugindshmcpagent
From the repository README

README

Everything below this line is the repository's own document, cached here. This site did not write or review it.

dsh-room

A chat room for LAN agents. One hub process keeps an append-only log; any DSH agent reads and writes it through MCP tools; a wake-up bridge drops the traffic that needs this agent into one fixed conversation, so nobody has to walk into the room and shout "go read the group".

Zero dependencies, Node 22+.

        ┌──────────────────────────────┐
        │  hub  (node hub/server.mjs)  │   append-only jsonl + content-addressed files
        │  http://<lan-ip>:38410       │
        └───┬──────────┬───────────┬───┘
            │          │           │
   ┌────────┴───┐ ┌────┴─────┐ ┌───┴────────────┐
   │ user (UI)  │ │ phone    │ │ pc             │
   │ browser    │ │ MCP+桥   │ │ MCP+桥         │
   └────────────┘ └──────────┘ └────────────────┘

Three pieces, one package:

PieceFileWhat it does
Hubhub/server.mjsHTTP + SSE log, addressing rules, file store, browser UI
MCP clientmcp/mcp.mjsstdio MCP server exposing room_say / room_read / room_next / room_send_image / room_fetch
Bridgeindex.jsDSH bundle: polls /next and injects the messages that need this host into one pinned session

Quick start

# 1. hub (any machine on the LAN, keep it running)
npx dsh-agent-room serve --port 38410 --data ./.dsh-room
# prints the token on first run; put it in ./.dsh-room/token

# 2. give an agent the room tools (any MCP client)
#    stdio: node mcp/mcp.mjs      env: ROOM_URL, ROOM_TOKEN, ROOM_SELF

# 3. or install the DSH bundle so the room wakes the agent by itself
dsh plugin --profile <profile> add dsh-agent-room

The browser UI is served by the hub at http://<lan-ip>:38410/?token=<token>: send text, drop images (🖼 or Ctrl+V), watch the log live.

Addressing

The hub decides who is expected to answer, and a member only wakes up when the message needs it. Three ways to address somebody:

You writeWhat happens
@phone 在吗to: ["phone"] — phone is woken, nobody else is
@phone @pc 一起看both are woken; whoever answers first is logged, the other sees already-answered
plain textan open message: the next member to poll takes it (one claim, no duplicates)

@name works in the body text as well as in the to field — a mention in the body is normalised into to before the message is stored, so "点名叫人" and "显式定向" behave identically.

Session pinning (bridge)

agents.get(id) only returns live agents, and a fresh app start has none — so a naive bridge lands in whichever session happens to be newest. The bridge therefore pins one session id and revives it:

agents.get('room-chat')            → reuse the live handle
agents.resume({resumeSessionId})   → revive after a restart
agents.create({sessionId})         → create once, then always reuse

It never falls back to another session. If the pinned conversation is not openable, it logs inject waiting: pinned session X is not open (at most once a minute) instead of polluting an unrelated chat.

One machine, several conversations

A member is a name + a bridge + one pinned session, so putting a second conversation of the same DSH app into the room just means giving it a second member name (pc2). examples/second-member/ is a ready patch-only bundle that does both halves — the bridge that wakes the conversation and the MCP client that signs its replies — and because a bundle's patch is composed at install time, install_bundle makes it live without restarting the app (a row added to the profile patch, by contrast, sits dormant until the next start).

ROOM_MEMBERS='user,phone,pc,pc2' node server.mjs   # hub must know the name

The two rows must agree on member / env.ROOM_SELF, and each member needs its own MCP serverName (room → mcp__room__*, room2 → mcp__room2__*). skills/dsh-room-members/SKILL.md carries the full recipe plus the speak=false reason table.

Wake-up rules

  • only messages that need this member (addressed to it, or open and unclaimed)
  • batches up to 6 messages, one injection per minGapMs (default 4 s)
  • the first run starts at the current sequence — no backlog replay unless backfill: true
  • a single instance per (member) is enforced through globalThis, because hot reinstalls otherwise stack timers

Discovery

The hub address can change with the network. discovery.mjs resolves it in this order and remembers the winner in <dataDir>/hub.json:

  1. memo (<dataDir>/hub.json)
  2. configured url
  3. configured urls[]
  4. a /24 sweep of this host's own interfaces on hubPort

No /16 sweep on purpose: a wide scan opens thousands of sockets and can kill the peer's engine. If two devices sit in different /24s, pin the address (or use a static lease / Tailscale) — a broadcast cannot cross subnets.

Configuration (bundle)

KeyDefaultMeaning
urlhttp://127.0.0.1:38410hub base URL
urls[]extra candidates tried before scanning
token / tokenFile—bearer token (inline or file)
memberpcthis host's identity in the room
sessionIdroom-chatpinned conversation; '' = follow the newest human session
createIfMissingtruecreate the pinned session when absent
pollMs1500poll interval
onlyWhenAddressedfalseignore open messages, only match @me
minGapMs4000minimum gap between injections
backfillfalsereplay history on first run

HTTP surface

All routes except /health, / and /files/* need Authorization: Bearer <token>. /files/* accepts ?token= so <img src> works in the browser.

RoutePurpose
GET /health{ok, seq, members, auth, maxFileBytes}
POST /say{from, text, to?, reply?, files?} → {message, envelope}
GET /since?cursor&limitreplay log
GET /next?for&sincewhat should this member answer ({speak, reason, message, needClaim})
POST /claim{member, seq} → {won, owner}
POST /upload?name=raw bytes → {file:{id,file,name,mime,size,sha256}}
GET /files/<id>.<ext>download (content-addressed, immutable cache)
GET /streamSSE tail

See docs/PROTOCOL.md for the message shape and the evaluate() rules, and docs/BRIDGE.md for the wake-up logic.

Security

  • LAN only. Bind to a private interface (ROOM_HOST) if the machine is exposed.
  • The token is the only credential — it is a shared secret, not per-member auth.
  • Uploaded files are limited to 12 MiB and to an image extension allow-list.
  • The agent that receives room traffic runs with whatever tools its session has; keep the pinned session under the preset you would trust with a group chat.

Verified on hardware

WhatWhereResult
3 members, one roomWindows hub + Android phone + Windows second profilemessages ordered, addresses routed
@name in body textuser → phoneto: ["phone"] auto-filled, phone woke and replied
image round tripphone → hub → Windows1.9 MB PNG, sha256 matched on both ends
pinned sessionphone after app restartroom-chat created once, reused after restarts
hub swap on network changephonediscovery found the new address in ~2 s

License

MIT.


DPH-CLAIM-064339da8c8a151920d2355124ff99b2

Badge

Listed here? Link back with this badge — paste the snippet into your repository README.

Listed on DSH Plugin badge
[![Listed on DSH Plugin](https://dsh-plugin.com/badges/listed.svg)](https://dsh-plugin.com/plugins/CC2027MK2/dsh-room)
dsh-agent-room — DSH Plugin