teamroom 0.1.0 → 0.2.0

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.
Files changed (70) hide show
  1. package/README.md +86 -63
  2. package/dist/cli/index.js +199 -104
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/client/agents-md.d.ts +14 -0
  5. package/dist/client/agents-md.js +53 -0
  6. package/dist/client/agents-md.js.map +1 -0
  7. package/dist/client/backend.d.ts +60 -0
  8. package/dist/client/backend.js +103 -0
  9. package/dist/client/backend.js.map +1 -0
  10. package/dist/client/claude-events.d.ts +18 -0
  11. package/dist/client/claude-events.js +176 -0
  12. package/dist/client/claude-events.js.map +1 -0
  13. package/dist/client/claude-hook.d.ts +19 -12
  14. package/dist/client/claude-hook.js +90 -48
  15. package/dist/client/claude-hook.js.map +1 -1
  16. package/dist/client/config.d.ts +13 -4
  17. package/dist/client/config.js +25 -6
  18. package/dist/client/config.js.map +1 -1
  19. package/dist/client/doctor.js +60 -7
  20. package/dist/client/doctor.js.map +1 -1
  21. package/dist/client/git.d.ts +0 -2
  22. package/dist/client/git.js +0 -5
  23. package/dist/client/git.js.map +1 -1
  24. package/dist/client/ignore.d.ts +12 -0
  25. package/dist/client/ignore.js +96 -0
  26. package/dist/client/ignore.js.map +1 -0
  27. package/dist/client/invite-link.d.ts +3 -1
  28. package/dist/client/invite-link.js +19 -4
  29. package/dist/client/invite-link.js.map +1 -1
  30. package/dist/client/mcp-config.d.ts +39 -6
  31. package/dist/client/mcp-config.js +81 -26
  32. package/dist/client/mcp-config.js.map +1 -1
  33. package/dist/client/workspace.d.ts +27 -7
  34. package/dist/client/workspace.js +67 -39
  35. package/dist/client/workspace.js.map +1 -1
  36. package/dist/core/overlap.d.ts +3 -2
  37. package/dist/core/overlap.js +36 -8
  38. package/dist/core/overlap.js.map +1 -1
  39. package/dist/core/room.d.ts +2 -0
  40. package/dist/core/room.js +2 -0
  41. package/dist/core/room.js.map +1 -1
  42. package/dist/core/schemas.d.ts +1 -0
  43. package/dist/core/schemas.js +1 -0
  44. package/dist/core/schemas.js.map +1 -1
  45. package/dist/core/types.d.ts +2 -0
  46. package/dist/dashboard/Dashboard.d.ts +2 -1
  47. package/dist/dashboard/Dashboard.js +3 -3
  48. package/dist/dashboard/Dashboard.js.map +1 -1
  49. package/dist/dashboard/model.d.ts +5 -2
  50. package/dist/dashboard/model.js +6 -3
  51. package/dist/dashboard/model.js.map +1 -1
  52. package/dist/dashboard/run.js +2 -2
  53. package/dist/dashboard/run.js.map +1 -1
  54. package/dist/mcp/auto-report.d.ts +32 -0
  55. package/dist/mcp/auto-report.js +83 -0
  56. package/dist/mcp/auto-report.js.map +1 -0
  57. package/dist/mcp/server.d.ts +16 -4
  58. package/dist/mcp/server.js +33 -26
  59. package/dist/mcp/server.js.map +1 -1
  60. package/dist/server/app.js +7 -9
  61. package/dist/server/app.js.map +1 -1
  62. package/dist/server/serve.d.ts +8 -1
  63. package/dist/server/serve.js +33 -1
  64. package/dist/server/serve.js.map +1 -1
  65. package/dist/store/file-store.js +1 -1
  66. package/dist/store/file-store.js.map +1 -1
  67. package/dist/version.d.ts +1 -0
  68. package/dist/version.js +6 -0
  69. package/dist/version.js.map +1 -0
  70. package/package.json +9 -2
package/README.md CHANGED
@@ -1,104 +1,118 @@
1
1
  # teamroom
2
2
 
3
- Know what your teammates (and their coding agents) are touching before the merge conflict does.
3
+ Run coding agents in parallel without them stepping on each other's files.
4
4
 
5
- Each checkout shares a snapshot of the files it is changing: commits on its branch that are not merged yet, uncommitted edits and untracked files. Before editing, you or your agent ask "is anyone else in these files?" and get an answer in milliseconds.
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
- Pushed branches are only part of the picture. Teamroom also sees work that is still local, and intent that is not code yet ("about to rename the User model").
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
- ## How it works
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.
15
-
16
- ## Requirements
12
+ ## Quick start
17
13
 
18
- - Node.js 22 or newer (24 LTS recommended)
19
- - git
14
+ Requires Node.js 22 or newer and git.
20
15
 
21
- ## Setup
16
+ ```sh
17
+ npm install --global teamroom
18
+ cd your-repo
19
+ teamroom init
20
+ git add .mcp.json AGENTS.md && git commit -m "chore: coordinate parallel agents with teamroom"
21
+ ```
22
22
 
23
- Run a server somewhere your team can reach:
23
+ Then give each agent its own worktree and start them:
24
24
 
25
25
  ```sh
26
- npx teamroom serve --host 0.0.0.0 --port 8787 --data-dir /var/lib/teamroom
26
+ git worktree add ../app-auth -b feat/auth && (cd ../app-auth && claude)
27
+ git worktree add ../app-billing -b feat/billing && (cd ../app-billing && codex)
28
+ teamroom watch # live view: every session, its agent, and files in more than one place
27
29
  ```
28
30
 
29
- The server binds to `127.0.0.1` by default. Put it behind HTTPS (a reverse proxy) before exposing it, and pass `--trust-proxy` only when that proxy sets `X-Forwarded-For`.
31
+ `teamroom doctor` checks every piece and prints the command that fixes each problem.
30
32
 
31
- To host it for a team (Fly.io, Docker, the environment variables it reads, and how to restrict who can create rooms), see [docs/hosting.md](docs/hosting.md).
33
+ ## What `init` sets up
32
34
 
33
- In your repo, one person creates the room:
35
+ | Piece | Works with | What it does |
36
+ | --- | --- | --- |
37
+ | 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. |
38
+ | 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. |
39
+ | `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. |
40
+ | Claude Code hooks | Claude Code | Briefs each new session on what the others are changing. **Pauses an edit once** when another session is in that file, with who and why; the retry goes through. Shares every edit the moment it happens. Worktrees created later get these hooks automatically, and teamroom's own tools are pre-approved so they run without a prompt. |
34
41
 
35
- ```sh
36
- npm install --global teamroom
37
- teamroom create --server https://teamroom.example.com
38
- git add .mcp.json && git commit -m "chore: add teamroom for coding agents"
39
- ```
42
+ 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:
40
43
 
41
- `create` names the room after the repo folder and you after your git `user.name` (override with `--room-name` and `--name`). It also installs the git hooks and writes `.mcp.json` so Claude Code picks up the tools. It prints an invite link:
44
+ ```toml
45
+ # Codex, ~/.codex/config.toml (a project .codex/config.toml only loads in trusted projects)
46
+ [mcp_servers.teamroom]
47
+ command = "teamroom"
48
+ args = ["mcp"]
42
49
 
43
- ```
44
- https://teamroom.example.com/join/room_...#tri_...
50
+ # Mistral Vibe, ~/.vibe/config.toml
51
+ [[mcp_servers]]
52
+ name = "teamroom"
53
+ transport = "stdio"
54
+ command = "teamroom"
55
+ args = ["mcp"]
45
56
  ```
46
57
 
47
- Anyone who has the link can join, so share it privately. Teammates run, inside their clone:
58
+ 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.
48
59
 
49
- ```sh
50
- teamroom join 'https://teamroom.example.com/join/room_...#tri_...'
51
- ```
60
+ ## How it works
52
61
 
53
- That's it. If something doesn't work, `teamroom doctor` checks every piece (repo, hooks, agent config, server, token) and prints the command that fixes each problem.
62
+ - **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.
63
+ - **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.
64
+ - **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.
65
+ - **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.
54
66
 
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.
67
+ ## MCP tools
56
68
 
57
- To try it alone first, run `teamroom serve` in one terminal and `teamroom create --server localhost:8787` in your repo.
69
+ | Tool | What it does |
70
+ | --- | --- |
71
+ | `teamroom_post_note` | Announce a plan and the files it will touch, before editing |
72
+ | `teamroom_check_overlap` | Who else is changing these files (default: everything this checkout changed) |
73
+ | `teamroom_report_work` | Share this checkout's changes now, with an optional one-line note |
74
+ | `teamroom_recent_activity` | What other sessions and agents did recently |
75
+
76
+ Activity is labeled with the agent that sent it, from the name it gives in the MCP handshake.
58
77
 
59
78
  ## Daily use
60
79
 
61
80
  ```sh
62
- teamroom check # who else is touching the files you changed
81
+ teamroom watch # live dashboard
82
+ teamroom check # who else is changing the files you changed
63
83
  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
84
+ teamroom note "renaming User to Account" --files src/user.ts,src/db/schema.ts
85
+ teamroom report # share your changes now (hooks do this on commit and checkout)
86
+ teamroom status # recent activity
68
87
  ```
69
88
 
70
- ## Coding agents (MCP)
89
+ ## Team mode
71
90
 
72
- `teamroom mcp` runs a stdio MCP server with four tools:
91
+ 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:
73
92
 
74
- | Tool | What it does |
75
- | --- | --- |
76
- | `teamroom_check_overlap` | Who else is changing these files (default: everything this checkout changed) |
77
- | `teamroom_report_work` | Share this checkout's snapshot, with an optional one-line note |
78
- | `teamroom_post_note` | Announce an intent before acting on it |
79
- | `teamroom_recent_activity` | Recent activity in the room |
93
+ ```sh
94
+ npx teamroom serve --host 0.0.0.0 --port 8787 --data-dir /var/lib/teamroom
95
+ ```
80
96
 
81
- `teamroom create` (or `teamroom agents install`) adds the server to `.mcp.json`, which Claude Code reads for the whole team. For Codex, add this to `~/.codex/config.toml`:
97
+ 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.
82
98
 
83
- ```toml
84
- [mcp_servers.teamroom]
85
- command = "teamroom"
86
- args = ["mcp"]
99
+ In your repo, one person creates the room:
100
+
101
+ ```sh
102
+ teamroom create --server https://teamroom.example.com
87
103
  ```
88
104
 
89
- Git hooks only see changes when you commit or switch branches. To share each file Claude Code edits as it happens, run:
105
+ 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:
90
106
 
91
107
  ```sh
92
- teamroom hooks install --claude
108
+ teamroom join 'https://teamroom.example.com/join/room_...#tri_...'
93
109
  ```
94
110
 
95
- This adds a `PostToolUse` hook to `.claude/settings.local.json` (local to you, not committed). Activity from agents is labeled with the agent that posted it, such as Claude Code or Codex.
96
-
97
- Tell agents to use it, for example in `AGENTS.md` or `CLAUDE.md`:
111
+ 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).
98
112
 
99
- > Before editing files, call `teamroom_check_overlap` with the files you plan to change. If someone else is in them, tell me before continuing.
113
+ `teamroom leave` removes you from the room and returns the repo to local mode.
100
114
 
101
- ## Room admin
115
+ Room admin:
102
116
 
103
117
  ```sh
104
118
  teamroom invite rotate # owner only; the old invite stops working
@@ -106,19 +120,24 @@ teamroom member remove bo # owner only, or yourself; revokes the token
106
120
  teamroom token rotate # replace your own token, for example after a leak
107
121
  ```
108
122
 
123
+ ## What is shared
124
+
125
+ 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.
126
+
109
127
  ## Environment variables
110
128
 
111
129
  | Variable | Purpose |
112
130
  | --- | --- |
113
- | `TEAMROOM_SERVER`, `TEAMROOM_ROOM`, `TEAMROOM_MEMBER`, `TEAMROOM_TOKEN` | Override `.git/teamroom.json`, for CI or shared agent machines |
114
131
  | `TEAMROOM_SESSION` | Name this checkout's session (default: folder name plus a short hash of its path) |
132
+ | `TEAMROOM_MEMBER` | Your name (default: git `user.name`) |
133
+ | `TEAMROOM_AUTO_REPORT=0` | Stop `teamroom mcp` from sharing changes in the background |
134
+ | `TEAMROOM_SERVER`, `TEAMROOM_ROOM`, `TEAMROOM_TOKEN` | Override `.git/teamroom.json`, for CI or shared agent machines |
115
135
 
116
136
  ## Limits
117
137
 
118
- - Activity is kept per room up to the latest 1000 entries. Overlap looks back 72 hours by default (`--since-hours`, up to 90 days).
138
+ - The room keeps the latest 1000 entries. Overlap looks back 72 hours by default (`--since-hours`, up to 90 days).
119
139
  - A snapshot holds up to 200 files. Larger change sets are truncated and the CLI says so.
120
- - Rate limits are kept in memory per server process. If you run several processes over one data directory, each enforces its own limits.
121
- - Rooms are stored as one JSON file each. That is fine for teams, not for thousands of active rooms.
140
+ - 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.
122
141
 
123
142
  ## Development
124
143
 
@@ -135,6 +154,10 @@ Other scripts: `build`, `typecheck`, `lint`, `test`, `test:watch`. CI runs `chec
135
154
 
136
155
  Tooling: TypeScript 7 for type checking and builds, Vitest for tests, and Biome for linting and formatting (one dependency instead of ESLint plus Prettier).
137
156
 
157
+ ## Releasing
158
+
159
+ Publish a GitHub release with a tag like `v0.1.2` (Releases, then Draft a new release). The `Release` workflow sets the package version from the tag, runs the full check, and publishes to npm with provenance. npm trusts the workflow directly (trusted publishing), so no token or 2FA code is involved. The version in `package.json` is only a placeholder between releases.
160
+
138
161
  ## License
139
162
 
140
163
  MIT