dsh-team-bots
v0.3.154
Published
Project spaces, group chats, task boards, memory and usage for teams of DSH bots
Maintainers
Readme
DSH Team Bots
dsh-team-bots is a DSH plugin that turns one workspace into a team: project group chats, a task board, write-scope parallel scheduling, shared memory and skills, approval cards, usage and cost, and a personal WeChat channel. Every run keeps its trajectory, duration, token count and cost.

Requirements
- Node.js ≥ 22.19
- the DSH CLI (
dsh)
The plugin runs inside the DSH Web process. It has no standalone service and no port of its own.
Install
dsh plugin --profile <name> add dsh-team-botsFrom a checkout (packs the working tree and installs it into the profile):
npm run profile:install -- --profile <name>Plugin files inside a profile are a snapshot. After changing code, reinstall — otherwise the page keeps serving the old build.
Open the workspace
http://<host>:<port>/ DSH web, auto-login into the team workspace
http://<host>:<port>/api/dsh-team/ui the team workspace itselfThe first visit exchanges the current startup token for a 30-day login cookie. Auto-login means anyone who can reach the port becomes owner, so listen on the local machine or a trusted network; for public use put an HTTPS reverse proxy in front that forwards Host and WebSocket correctly.
What the workspace does
Group chats and dispatch
Every project is a group chat. A bot can also be addressed one-to-one in a dispatch view. All traffic for one bot — task dispatch, group chat, direct message, one-to-one chat — lands on a single control-plane session, and that bot runs one task at a time; different bots still run in parallel.
A group chat has three reply modes (switchable in project settings): Director first (default — the director answers when nobody is addressed), Everyone responds (all members answer when nobody is addressed), and Mentioned only (a message with no explicit @mention or bot reply wakes nobody immediately, but the director's thinking bubble appears at once and the director auto-claims it after 1 second; explicit mentions and replies deliver in every mode). The message tail window injected into bot context is tiered: messages that mention the bot keep their full text with a marker, while other bots' chatter collapses into short background digests.
Task board
States: backlog, todo, in progress, blocked, in review, done, canceled. A card carries assignee, priority, parent/child links, tags, write scopes, an optional time budget (a hard limit that aborts the run), comments, and its own usage. Rows are grouped by state and can be dragged onto another group to change status.
Acceptance is uniformly arranged by the director through subagent verification: the mechanical gate requires a subagent verification ledger entry within the current review cycle, the verification conclusion grounds the decision, and a director fallback must be explicitly marked. Read-only deliveries (the delivering run's effective sandbox is read-only) skip the automatic verification delegate and the gate, marked "read-only, verification skipped" on the card — they could not have written the workspace; write deliveries stay fully gated (DSH_TEAM_REVIEW_READ_ONLY_SKIP=0 restores mandatory verification for all). Amending a card (team_assign_task re-dispatch with card edits) accepts an optional expected_version mutation fence: if the card changed since you last saw it (delivery, transition, another edit) the write is refused with the most recent changes listed, so you can re-decide in place.
Task status transitions write an authoritative status task event in the same transaction as the update, so the event stream fully replays the task state machine; the task_projection_drift API is a read-only check that replays the ledger and reports any drift from the projection.
A card can carry a versioned Goal — a goal statement plus numbered completion criteria (C1..Cn), written explicitly by the card creator or the director (goal_statement / completion_criteria on team_assign_task, or the Goal fields in the workbench); it is never generated from the description. Every task-card-driven run is anchored to the current version and the delivery report is expected to cover each criterion by ID. On a card with a Goal the director's team_review_task comment must cite Goal vN with the card's current version and every criterion ID on accept (at least the failed ones on return); anything else is rejected with the missing items listed, and the director fallback does not waive this. Each revision creates a new version — earlier versions stay in the goal_revised task event and never enter a new run's context — and a review records a goal_version_mismatch task event when the delivery was made against a different version than the one reviewed, which separates goal drift from execution errors.
Task-card-driven runs (the work run, acceptance and blocked-handling runs) start from the card alone: number, title, status, priority, the current Goal, write scopes, parent link, deliverables and time budget. The group-chat tail window is not injected, not even the folded background summaries. The only exceptions are a group message that the card body or a card comment cites by ID (m_xxxxxx, expanded in full with its source) and a card comment that @mentions the bot (full text). Both share an 8,000-character budget — the same ceiling as the description; whatever does not fit is listed by ID for team_recall. Every such run records a context_manifest run event (tail_window: "off", the Goal version, the expanded references), so the isolation is auditable.
Write scopes and parallel scheduling
A card declares the paths it will write, relative to the project working directory. Two runs of the same project run in parallel only when both declare scopes and the path prefixes do not overlap; a card with no declared scope is treated as serial. An urgent card may be exempted from the queue — the exemption is written into the card's creation message rather than applied silently.
Memory, skills, evolution proposals
Memory entries are written, reviewed, frozen and archived by the owner, and are readable by every bot in the project. After a task is accepted, the assignee's next run in that project carries a one-time reminder to persist durable conclusions into memory (team_remember) while they are fresh. Skills come from a shared skill root plus per-project skills; changing them goes through a proposal, an approval and an apply, with a canary stage before promotion to full effect. The same path can change a bot's role instructions.
Approval and question cards
When a bot asks for a tool approval, a secret, or an answer, the workspace shows a card in the chat. The owner approves, denies or answers in place, and the decision is recorded on the card.
Inbox and @owner
Everything that needs you is collected in the Inbox, the entry above the group chats in the sidebar: escalation approvals, questions to answer and evolution proposals are handled right there with the same cards used in the chat. When the director writes @owner in a group message, it marks something you need to see or decide; the message lands in the inbox automatically, opens back at that message in the chat, and leaves the inbox only when you mark it read — viewing or jumping to it never clears it. New inbox items raise a desktop notification by default, except while you are looking at the page that shows them; the browser asks for notification permission on your first click. owner is a reserved bot name, and only the director may use the mention.
Usage and cost
The usage page breaks the numbers down by model, bot and project, exports CSV, and reads model prices from configuration.

Workspace settings
Run limits (timeout abort, no-progress watchdog, review idle threshold), budgets and retention windows are set per workspace, together with the interface preferences, the team-wide prompt segments and the local DSH paths.

Terminal, channels, secrets
A per-project terminal runs commands in the project directory. The WeChat channel binds by QR code and pushes task activity to the owner's WeChat. Secrets are scoped to the team or to one project; values are only ever shown as a fingerprint and are handed out as one-time runtime copies that expire.
Configuration
| Variable | Default | Meaning |
| --- | --- | --- |
| DSH_TEAM_WORKSPACE | ~/.dsh/workspace/team-bots | team workspace root |
| DSH_TEAM_DATA | <workspace>/.data | database and run records |
Every other variable, its default, and its resolution order (explicit env > value saved in the workspace > code default) live in src/config.ts; .env.example lists the common ones. Do not put a .env file in the repository root — it would leak DSH_* into npm test and npm run dev.
Host integration tools — MCP servers, engine bridges — are registered by the host for every agent, and the team-bots preset cannot filter them out, so deployments whose team bots never use some of them pay for those definitions on every call. Opt in to trimming them per project: set DSH_TEAM_TOOL_FAMILY_MARKERS (prefix=workspace-marker-path); every registered family is hidden from team-bot sessions unless the project workspace contains its marker, and unregistered tools stay visible. Set DSH_TEAM_HIDE_TOOL_PREFIXES only for further prefixes to hide unconditionally: once set, it is the hide list and markers only grant exceptions. Defaults are empty — nothing is hidden; solo chats are never restricted. The prompt text the host adds about MCP servers is not affected.
DSH_TEAM_DATA holds team.sqlite, wechat-channel.sqlite, secret.key, memory/, messages/ and secrets-runtime/. Back up secret.key together with the data: without it the stored ciphertext cannot be decrypted.
Develop
npm install
npm run build # compile TypeScript into the shipped .js files
npm run typecheck
npm test # build, then node --test over tests/ and scripts/
npm run dev # local dev server on http://127.0.0.1:4317
npm run doctor # check node, dsh, paths and profile referencesAdditional harnesses: npm run backup / npm run restore-check for data, npm run verify:agent-team for the agent-team capability, npm run load-test and npm run fault-test for the runtime.
Repository layout:
ui/ the browser workspace (modules, styles, zh/en copy)
src/ HTTP API, database, runtime and domain services
src/services/ domain logic: chat, tasks, scheduler, memory, skills, approvals, usage
src/tools.ts the tool surface bots see (team_* tools)
scripts/ build, dev server, doctor, release, backup, test harnesses
tests/ node:test suitesRelease
npm run release # add --dry-run to print the plan without touching anythingThe tool pushes dev, lands it on main (fast-forward when possible, otherwise a content snapshot), pushes main and the tag, then syncs dev back. Publishing uses npm OIDC trusted publishing — no NPM_TOKEN — and the workflow installs npm ≥ 11.5.1 before publishing.
License
Apache-2.0, see LICENSE and NOTICE.
