Skip to content

Repository files navigation

baton

An agent collaboration engine — hand work to your agents, from anywhere.

A persistent server holds the shared collaboration state: workspaces → projects → requirements (R-N) → tasks (T-N). Workers (W-N) — machines running a coding agent against a real repo — register themselves and pick up work as sessions, each executing in its own git worktree. Humans reach the same sessions from the web UI, DingTalk, or Feishu; the name is the relay-baton metaphor: work handed from node to node.

 web UI ─┐
DingTalk ┼──▶ server (Hono + SQLite) ◀──SSE── workers (baton CLI + agent)
Feishu ┘ baton.example.com sessions in git worktrees

Design notes

  • Collaboration dimension only — specs, docs and code live in git; baton stores references, never copies content.
  • Light GitHub sync — issues mirror into requirements as number + title + status + link; bodies and discussion stay on GitHub.
  • Share links — every session has an unguessable /s/:token page; anyone with the link can read and write into the conversation.
  • Interactive terminal — open any session in a real terminal in the browser (xterm.js over a server-bridged WebSocket); the worker runs the agent in a pty for hands-on, human-in-the-loop control alongside the headless relay — and it works for a remote worker with no inbound port, over plain https.
  • Delegation — a session can list workers and open a session on any other worker by its global W-N handle (see skills/delegate).
  • Self-serve channels — anyone running a worker can wire their own DingTalk/Feishu bot to it: install the bridge next to the worker, bring your own app key/secret, no central setup. The bridge is a pure API client that reuses the worker's .baton.json for the server URL, route, and auth token.

Packages

packagewhat
packages/serverAPI + state (Hono, Prisma/SQLite, SSE)
packages/webSPA (React, Vite, Tailwind)
packages/cli@lesscap/baton-cli — worker daemon + management commands
packages/shareddomain types shared by all of the above
packages/dingtalk / packages/feishu@lesscap/baton-dingtalk / @lesscap/baton-feishu — chat bridges you run on your own worker
skills/agent skills (baton workflow, GitHub sync, delegation)
docker/compose stack for the server + bridges, and a containerized worker

Quick start

# server + web (dev)
pnpm install
pnpm --filter @baton/server db:migrate
pnpm --filter @baton/server dev # api on :3280
pnpm --filter @baton/web dev # SPA on :5280, proxies /api# a worker, on any machine with a coding agent installed
npm i -g @lesscap/baton-cli
baton worker register --url <server-url> --project <id> --name <name>
baton worker run
# (optional) wire your own DingTalk/Feishu bot to this worker — run it alongside# `baton worker run`, from the worker's dir so it reuses .baton.json for auth+route
npm i -g @lesscap/baton-feishu
FEISHU_APP_ID=<your-app-id> FEISHU_APP_SECRET=<your-secret> baton-feishu

Development

pnpm check # biome + typecheck + tests, all packages

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages