teamroom 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +149 -70
- package/dist/cli/index.js +202 -106
- package/dist/cli/index.js.map +1 -1
- package/dist/client/agents-md.d.ts +14 -0
- package/dist/client/agents-md.js +53 -0
- package/dist/client/agents-md.js.map +1 -0
- package/dist/client/api-client.d.ts +4 -0
- package/dist/client/backend.d.ts +60 -0
- package/dist/client/backend.js +103 -0
- package/dist/client/backend.js.map +1 -0
- package/dist/client/claude-events.d.ts +18 -0
- package/dist/client/claude-events.js +172 -0
- package/dist/client/claude-events.js.map +1 -0
- package/dist/client/claude-hook.d.ts +19 -12
- package/dist/client/claude-hook.js +90 -48
- package/dist/client/claude-hook.js.map +1 -1
- package/dist/client/config.d.ts +13 -4
- package/dist/client/config.js +25 -6
- package/dist/client/config.js.map +1 -1
- package/dist/client/doctor.js +60 -7
- package/dist/client/doctor.js.map +1 -1
- package/dist/client/git.d.ts +0 -2
- package/dist/client/git.js +2 -6
- package/dist/client/git.js.map +1 -1
- package/dist/client/ignore.d.ts +12 -0
- package/dist/client/ignore.js +96 -0
- package/dist/client/ignore.js.map +1 -0
- package/dist/client/invite-link.d.ts +3 -1
- package/dist/client/invite-link.js +19 -4
- package/dist/client/invite-link.js.map +1 -1
- package/dist/client/mcp-config.d.ts +39 -6
- package/dist/client/mcp-config.js +81 -26
- package/dist/client/mcp-config.js.map +1 -1
- package/dist/client/workspace.d.ts +34 -7
- package/dist/client/workspace.js +81 -39
- package/dist/client/workspace.js.map +1 -1
- package/dist/core/agents.d.ts +6 -0
- package/dist/core/agents.js +7 -0
- package/dist/core/agents.js.map +1 -1
- package/dist/core/overlap.d.ts +12 -3
- package/dist/core/overlap.js +51 -8
- package/dist/core/overlap.js.map +1 -1
- package/dist/core/room.d.ts +3 -1
- package/dist/core/room.js +37 -1
- package/dist/core/room.js.map +1 -1
- package/dist/core/schemas.d.ts +9 -0
- package/dist/core/schemas.js +10 -2
- package/dist/core/schemas.js.map +1 -1
- package/dist/core/types.d.ts +7 -1
- package/dist/dashboard/Dashboard.d.ts +2 -1
- package/dist/dashboard/Dashboard.js +3 -3
- package/dist/dashboard/Dashboard.js.map +1 -1
- package/dist/dashboard/model.d.ts +10 -3
- package/dist/dashboard/model.js +38 -7
- package/dist/dashboard/model.js.map +1 -1
- package/dist/dashboard/run.js +2 -2
- package/dist/dashboard/run.js.map +1 -1
- package/dist/mcp/auto-report.d.ts +43 -0
- package/dist/mcp/auto-report.js +118 -0
- package/dist/mcp/auto-report.js.map +1 -0
- package/dist/mcp/server.d.ts +18 -4
- package/dist/mcp/server.js +44 -29
- package/dist/mcp/server.js.map +1 -1
- package/dist/server/app.js +7 -9
- package/dist/server/app.js.map +1 -1
- package/dist/store/file-store.js +1 -1
- package/dist/store/file-store.js.map +1 -1
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -1,104 +1,178 @@
|
|
|
1
1
|
# teamroom
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Run coding agents in parallel without them stepping on each other's files.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
You have Claude Code refactoring auth in one worktree, Codex building a feature in another, and Gemini CLI fixing tests in a third. Nothing tells them they are about to change the same file, until you merge. teamroom does: every session shares what it is changing, and each agent learns who else is in a file before it edits it.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- **Any agent.** Claude Code, Codex, Cursor, Gemini CLI, Mistral Vibe, or anything else that speaks MCP.
|
|
8
|
+
- **One command, no server.** `teamroom init` and you are done. Worktrees on one machine share a file in `.git`.
|
|
9
|
+
- **Sees work that is not pushed yet.** Uncommitted edits, untracked files, and plans that are not code yet ("renaming User to Account").
|
|
10
|
+
- **Optional team mode.** Point the repo at a small server and teammates' agents join the same room.
|
|
8
11
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
- **Sessions, not people.** Every checkout (worktree, clone, agent box) is its own session. Two agents of the same developer in two worktrees warn each other.
|
|
12
|
-
- **Snapshots replace each other.** A session's newest `wip` snapshot replaces its previous one, so once you merge, revert or switch branches, the warnings go away.
|
|
13
|
-
- **Merged commits are ignored.** Commit entries already in the default branch are filtered out on your machine using your local git.
|
|
14
|
-
- **Nothing blocks git.** Hooks run in the background and never fail a commit, even when the server is down.
|
|
12
|
+
## What it looks like
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
A Claude Code session in `app-login` tries to edit `src/auth.ts` while another session in `app-auth` is changing it. teamroom pauses the edit once and tells the agent who and why:
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
```text
|
|
17
|
+
teamroom: src/auth.ts is also being changed in another checkout:
|
|
18
|
+
src/auth.ts
|
|
19
|
+
- Vasiliki (app-auth on feat/auth), wip just now: Changing 1 file on feat/auth. Plan: moving auth to sessions
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
This edit was paused once so you can decide. If it is still the right move, retry the same edit and it will go through.
|
|
22
|
+
Otherwise tell the user who else is in this file, or do other parts of the task first.
|
|
23
|
+
```
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
Agents without hooks (Codex, Cursor, Gemini CLI) get the same news through the MCP server. The next teamroom tool result starts with:
|
|
24
26
|
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
+
```text
|
|
28
|
+
Heads up: another session just started changing files you are changing. Tell the user before you go further.
|
|
27
29
|
```
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
And you can always ask from the shell:
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
```console
|
|
34
|
+
$ teamroom check src/auth.ts
|
|
35
|
+
src/auth.ts
|
|
36
|
+
- Vasiliki (app-auth on feat/auth), wip just now: Changing 1 file on feat/auth. Plan: moving auth to sessions
|
|
37
|
+
```
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
## Quick start
|
|
40
|
+
|
|
41
|
+
Requires Node.js 22 or newer and git.
|
|
34
42
|
|
|
35
43
|
```sh
|
|
36
44
|
npm install --global teamroom
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
cd your-repo
|
|
46
|
+
teamroom init
|
|
47
|
+
git add .mcp.json AGENTS.md && git commit -m "chore: coordinate parallel agents with teamroom"
|
|
39
48
|
```
|
|
40
49
|
|
|
41
|
-
|
|
50
|
+
Then give each agent its own worktree and start them:
|
|
42
51
|
|
|
43
|
-
```
|
|
44
|
-
|
|
52
|
+
```sh
|
|
53
|
+
git worktree add ../app-auth -b feat/auth && (cd ../app-auth && claude)
|
|
54
|
+
git worktree add ../app-billing -b feat/billing && (cd ../app-billing && codex)
|
|
55
|
+
teamroom watch # live view: every session, its agent, and files in more than one place
|
|
45
56
|
```
|
|
46
57
|
|
|
47
|
-
|
|
58
|
+
`teamroom doctor` checks every piece and prints the command that fixes each problem.
|
|
59
|
+
|
|
60
|
+
## Try it in two minutes
|
|
61
|
+
|
|
62
|
+
No agent needed. After `teamroom init`, make two worktrees and change the same file in both:
|
|
48
63
|
|
|
49
64
|
```sh
|
|
50
|
-
|
|
65
|
+
git worktree add ../try-a -b try-a
|
|
66
|
+
git worktree add ../try-b -b try-b
|
|
67
|
+
|
|
68
|
+
cd ../try-a
|
|
69
|
+
echo "// a" >> README.md
|
|
70
|
+
teamroom note "trying teamroom" --files README.md
|
|
71
|
+
teamroom report
|
|
72
|
+
|
|
73
|
+
cd ../try-b
|
|
74
|
+
echo "// b" >> README.md
|
|
75
|
+
teamroom report
|
|
76
|
+
teamroom check README.md # lists try-a and its plan, exits 3
|
|
51
77
|
```
|
|
52
78
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Membership is saved to `.git/teamroom.json` (mode `600`, never committed). Every worktree of the repo shares it. The invite code sits after the `#`, which browsers never send, so it stays out of server logs even if someone opens the link.
|
|
79
|
+
Clean up from the main checkout with `git worktree remove --force ../try-a && git worktree remove --force ../try-b && git branch -D try-a try-b`. The warnings disappear on their own once a session's newest snapshot no longer includes the file.
|
|
56
80
|
|
|
57
|
-
|
|
81
|
+
## How it works
|
|
58
82
|
|
|
59
|
-
|
|
83
|
+
- **Sessions, not people.** Every checkout (worktree, clone, agent box) is its own session. Two agents of the same developer in two worktrees warn each other.
|
|
84
|
+
- **Snapshots replace each other.** A session's newest snapshot replaces its previous one and the agent edits before it, so once you merge, revert or switch branches, the warnings go away.
|
|
85
|
+
- **Hooks are enforced, tools are a request.** The git hooks, the MCP server's background reports and the Claude Code hooks run whatever the model decides, so the room stays accurate even when an agent ignores its instructions.
|
|
86
|
+
- **Noise stays out.** Lockfiles never count as overlap. Add your own patterns (generated code, snapshots) to a `.teamroomignore` at the repo root, gitignore style, with `!` to re-include.
|
|
87
|
+
- **Nothing blocks git, and nothing blocks an agent for good.** A paused Claude edit goes through on retry; hooks exit cleanly when the room cannot be read.
|
|
60
88
|
|
|
61
|
-
|
|
62
|
-
teamroom check # who else is touching the files you changed
|
|
63
|
-
teamroom check src/auth.ts # or specific files; exits 3 when there is overlap
|
|
64
|
-
teamroom note "about to rename User" --files src/user.ts,src/db/schema.ts
|
|
65
|
-
teamroom report # share your snapshot now (hooks do this on commit, checkout, merge, rebase)
|
|
66
|
-
teamroom status # members and recent activity
|
|
67
|
-
teamroom watch # live dashboard: who is working, their agents, files in more than one place
|
|
68
|
-
```
|
|
89
|
+
## What `init` sets up
|
|
69
90
|
|
|
70
|
-
|
|
91
|
+
| Piece | Works with | What it does |
|
|
92
|
+
| --- | --- | --- |
|
|
93
|
+
| Git hooks | everything | After each commit, checkout, merge and rebase, shares the files this checkout changed compared with `main`, including uncommitted and untracked ones. Runs in the background and never fails a commit. |
|
|
94
|
+
| MCP server | any MCP agent | Runs for as long as the agent does. Shares the checkout's changes every few seconds without being asked, and puts a **heads-up** in front of the next tool result when another session starts changing a file this one is changing. Also gives the agent tools to announce a plan and check before editing. |
|
|
95
|
+
| `AGENTS.md` block | Codex, Cursor, and most agents | Tells the agent to announce its plan with `teamroom_post_note` and to call `teamroom_check_overlap` before editing. |
|
|
96
|
+
| Claude Code hooks | Claude Code | See the list below. |
|
|
71
97
|
|
|
72
|
-
|
|
98
|
+
The Claude Code hooks go in `.claude/settings.local.json`, which Claude Code does not commit:
|
|
73
99
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
| `teamroom_post_note` | Announce an intent before acting on it |
|
|
79
|
-
| `teamroom_recent_activity` | Recent activity in the room |
|
|
100
|
+
- **Session start:** briefs each new session on what the others are changing.
|
|
101
|
+
- **Before an edit:** pauses the edit once when another session is in that file, with who and why. The retry goes through.
|
|
102
|
+
- **After an edit:** shares the edited file the moment it changes.
|
|
103
|
+
- **New worktrees** get these hooks automatically, and teamroom's own tools are pre-approved so they run without a prompt.
|
|
80
104
|
|
|
81
|
-
|
|
105
|
+
MCP config is written for Claude Code (`.mcp.json`) always, and for Cursor (`.cursor/mcp.json`), Gemini CLI (`.gemini/settings.json`) and Codex (`.codex/config.toml`) when the repo already has that folder. Force one with `teamroom init --agents codex,gemini`. For anything else, add a stdio MCP server with command `teamroom` and args `["mcp"]`. Examples:
|
|
82
106
|
|
|
83
107
|
```toml
|
|
108
|
+
# Codex, ~/.codex/config.toml (a project .codex/config.toml only loads in trusted projects)
|
|
84
109
|
[mcp_servers.teamroom]
|
|
85
110
|
command = "teamroom"
|
|
86
111
|
args = ["mcp"]
|
|
112
|
+
|
|
113
|
+
# Mistral Vibe, ~/.vibe/config.toml
|
|
114
|
+
[[mcp_servers]]
|
|
115
|
+
name = "teamroom"
|
|
116
|
+
transport = "stdio"
|
|
117
|
+
command = "teamroom"
|
|
118
|
+
args = ["mcp"]
|
|
87
119
|
```
|
|
88
120
|
|
|
89
|
-
|
|
121
|
+
## MCP tools
|
|
122
|
+
|
|
123
|
+
| Tool | What it does |
|
|
124
|
+
| --- | --- |
|
|
125
|
+
| `teamroom_post_note` | Announce a plan and the files it will touch, before editing |
|
|
126
|
+
| `teamroom_check_overlap` | Who else is changing these files (default: everything this checkout changed) |
|
|
127
|
+
| `teamroom_report_work` | Share this checkout's changes now, with an optional one-line note |
|
|
128
|
+
| `teamroom_recent_activity` | What other sessions and agents did recently |
|
|
129
|
+
|
|
130
|
+
Activity is labeled with the agent that sent it, from the name it gives in the MCP handshake.
|
|
131
|
+
|
|
132
|
+
## Daily use
|
|
133
|
+
|
|
134
|
+
```sh
|
|
135
|
+
teamroom watch # live dashboard
|
|
136
|
+
teamroom check # who else is changing the files you changed
|
|
137
|
+
teamroom check src/auth.ts # or specific files
|
|
138
|
+
teamroom note "renaming User to Account" --files src/user.ts,src/db/schema.ts
|
|
139
|
+
teamroom report # share your changes now (hooks do this on commit and checkout)
|
|
140
|
+
teamroom status # recent activity
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`teamroom check` exits `3` when someone else is changing one of the files, so scripts and CI can act on it:
|
|
144
|
+
|
|
145
|
+
```sh
|
|
146
|
+
teamroom check || echo "someone else is in these files"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Team mode
|
|
150
|
+
|
|
151
|
+
Local mode covers every worktree on one machine. To include teammates and their agents on other machines, run a server somewhere your team can reach:
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
npx teamroom serve --host 0.0.0.0 --port 8787 --data-dir /var/lib/teamroom
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Put it behind HTTPS, and pass `--trust-proxy` only when that proxy sets `X-Forwarded-For`. [docs/hosting.md](docs/hosting.md) covers Fly.io, Docker, the environment variables, and how to restrict who can create rooms.
|
|
158
|
+
|
|
159
|
+
In your repo, one person creates the room:
|
|
90
160
|
|
|
91
161
|
```sh
|
|
92
|
-
teamroom
|
|
162
|
+
teamroom create --server https://teamroom.example.com
|
|
93
163
|
```
|
|
94
164
|
|
|
95
|
-
|
|
165
|
+
It names the room after the repo folder and you after your git `user.name` (override with `--room-name` and `--name`), sets up the repo like `init`, and prints an invite link. Anyone who has the link can join, so share it privately. Teammates run, inside their clone:
|
|
96
166
|
|
|
97
|
-
|
|
167
|
+
```sh
|
|
168
|
+
teamroom join 'https://teamroom.example.com/join/room_...#tri_...'
|
|
169
|
+
```
|
|
98
170
|
|
|
99
|
-
|
|
171
|
+
Membership is saved to `.git/teamroom.json` (mode `600`, never committed) and every worktree shares it. The invite code sits after the `#`, which browsers never send, so it stays out of server logs. Without a scheme, `--server` defaults to `https://` (and `http://` for localhost).
|
|
100
172
|
|
|
101
|
-
|
|
173
|
+
`teamroom leave` removes you from the room and returns the repo to local mode.
|
|
174
|
+
|
|
175
|
+
Room admin:
|
|
102
176
|
|
|
103
177
|
```sh
|
|
104
178
|
teamroom invite rotate # owner only; the old invite stops working
|
|
@@ -106,38 +180,43 @@ teamroom member remove bo # owner only, or yourself; revokes the token
|
|
|
106
180
|
teamroom token rotate # replace your own token, for example after a leak
|
|
107
181
|
```
|
|
108
182
|
|
|
183
|
+
## How it compares
|
|
184
|
+
|
|
185
|
+
- **Worktree orchestrators** give each agent its own checkout, which stops agents from overwriting each other's files but leaves the conflict for merge time. teamroom adds the missing warning on top of worktrees.
|
|
186
|
+
- **Claim and intent protocols** such as [Foremerge](https://github.com/naw103/foremerge) and [agent-claim-mcp](https://github.com/vk0dev/agent-claim-mcp) work when agents declare what they will change. Foremerge in particular reasons about symbols and plans, not just files. teamroom instead watches what agents actually change, through git and Claude Code hooks, so an agent that forgets to declare still shows up. It also works across machines. The two approaches combine well.
|
|
187
|
+
- **Editor tools for people** such as [GitLive](https://git.live) show teammates' changes in your editor. teamroom is built for agents: it speaks MCP, and it can pause an agent's edit before the conflict happens.
|
|
188
|
+
|
|
189
|
+
## What is shared
|
|
190
|
+
|
|
191
|
+
File paths, branch names, commit ids, short notes, member and agent names. Never file contents. In local mode nothing leaves your machine: the room is `.git/teamroom/`, readable only by you. On a server, tokens and invite codes are stored as SHA-256 hashes.
|
|
192
|
+
|
|
109
193
|
## Environment variables
|
|
110
194
|
|
|
111
195
|
| Variable | Purpose |
|
|
112
196
|
| --- | --- |
|
|
113
|
-
| `TEAMROOM_SERVER`, `TEAMROOM_ROOM`, `TEAMROOM_MEMBER`, `TEAMROOM_TOKEN` | Override `.git/teamroom.json`, for CI or shared agent machines |
|
|
114
197
|
| `TEAMROOM_SESSION` | Name this checkout's session (default: folder name plus a short hash of its path) |
|
|
198
|
+
| `TEAMROOM_MEMBER` | Your name (default: git `user.name`) |
|
|
199
|
+
| `TEAMROOM_AUTO_REPORT=0` | Stop `teamroom mcp` from sharing changes in the background |
|
|
200
|
+
| `TEAMROOM_SERVER`, `TEAMROOM_ROOM`, `TEAMROOM_TOKEN` | Override `.git/teamroom.json`, for CI or shared agent machines |
|
|
115
201
|
|
|
116
202
|
## Limits
|
|
117
203
|
|
|
118
|
-
-
|
|
204
|
+
- The room keeps the latest 1000 entries. Overlap looks back 72 hours by default (`--since-hours`, up to 90 days).
|
|
119
205
|
- A snapshot holds up to 200 files. Larger change sets are truncated and the CLI says so.
|
|
120
|
-
-
|
|
121
|
-
- Rooms are stored as one JSON file each. That is fine for teams, not for thousands of active rooms.
|
|
122
|
-
|
|
123
|
-
## Development
|
|
206
|
+
- On a server, rate limits are kept in memory per process, and rooms are stored as one JSON file each. That is fine for teams, not for thousands of active rooms.
|
|
124
207
|
|
|
125
|
-
|
|
208
|
+
## Uninstall
|
|
126
209
|
|
|
127
210
|
```sh
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
npm run check # typecheck, lint and tests, the same as CI
|
|
131
|
-
npm run format # fix formatting and import order
|
|
211
|
+
teamroom leave # team mode only: leave the room first
|
|
212
|
+
teamroom hooks uninstall # removes the git hooks and the Claude Code hooks
|
|
132
213
|
```
|
|
133
214
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
Tooling: TypeScript 7 for type checking and builds, Vitest for tests, and Biome for linting and formatting (one dependency instead of ESLint plus Prettier).
|
|
215
|
+
Then remove what `init` wrote to tracked files: the `teamroom` entry in `.mcp.json` (and in `.cursor/mcp.json`, `.gemini/settings.json` or `.codex/config.toml` if it added one), and the block between `<!-- teamroom:start -->` and `<!-- teamroom:end -->` in `AGENTS.md`. Delete `.git/teamroom/` to drop the local room.
|
|
137
216
|
|
|
138
|
-
##
|
|
217
|
+
## Contributing
|
|
139
218
|
|
|
140
|
-
|
|
219
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and releases.
|
|
141
220
|
|
|
142
221
|
## License
|
|
143
222
|
|