teamroom 0.1.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.
- package/LICENSE +21 -0
- package/README.md +140 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +420 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/client/api-client.d.ts +122 -0
- package/dist/client/api-client.js +185 -0
- package/dist/client/api-client.js.map +1 -0
- package/dist/client/claude-hook.d.ts +40 -0
- package/dist/client/claude-hook.js +121 -0
- package/dist/client/claude-hook.js.map +1 -0
- package/dist/client/config.d.ts +25 -0
- package/dist/client/config.js +71 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/doctor.d.ts +20 -0
- package/dist/client/doctor.js +129 -0
- package/dist/client/doctor.js.map +1 -0
- package/dist/client/errors.d.ts +26 -0
- package/dist/client/errors.js +49 -0
- package/dist/client/errors.js.map +1 -0
- package/dist/client/git.d.ts +42 -0
- package/dist/client/git.js +126 -0
- package/dist/client/git.js.map +1 -0
- package/dist/client/hooks.d.ts +21 -0
- package/dist/client/hooks.js +100 -0
- package/dist/client/hooks.js.map +1 -0
- package/dist/client/invite-link.d.ts +16 -0
- package/dist/client/invite-link.js +51 -0
- package/dist/client/invite-link.js.map +1 -0
- package/dist/client/mcp-config.d.ts +12 -0
- package/dist/client/mcp-config.js +52 -0
- package/dist/client/mcp-config.js.map +1 -0
- package/dist/client/workspace.d.ts +58 -0
- package/dist/client/workspace.js +157 -0
- package/dist/client/workspace.js.map +1 -0
- package/dist/core/agents.d.ts +6 -0
- package/dist/core/agents.js +34 -0
- package/dist/core/agents.js.map +1 -0
- package/dist/core/overlap.d.ts +21 -0
- package/dist/core/overlap.js +75 -0
- package/dist/core/overlap.js.map +1 -0
- package/dist/core/room.d.ts +34 -0
- package/dist/core/room.js +105 -0
- package/dist/core/room.js.map +1 -0
- package/dist/core/schemas.d.ts +136 -0
- package/dist/core/schemas.js +98 -0
- package/dist/core/schemas.js.map +1 -0
- package/dist/core/secrets.d.ts +5 -0
- package/dist/core/secrets.js +23 -0
- package/dist/core/secrets.js.map +1 -0
- package/dist/core/types.d.ts +69 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/dashboard/Dashboard.d.ts +9 -0
- package/dist/dashboard/Dashboard.js +53 -0
- package/dist/dashboard/Dashboard.js.map +1 -0
- package/dist/dashboard/Header.d.ts +6 -0
- package/dist/dashboard/Header.js +22 -0
- package/dist/dashboard/Header.js.map +1 -0
- package/dist/dashboard/HotFiles.d.ts +6 -0
- package/dist/dashboard/HotFiles.js +11 -0
- package/dist/dashboard/HotFiles.js.map +1 -0
- package/dist/dashboard/MemberList.d.ts +9 -0
- package/dist/dashboard/MemberList.js +30 -0
- package/dist/dashboard/MemberList.js.map +1 -0
- package/dist/dashboard/RecentActivity.d.ts +7 -0
- package/dist/dashboard/RecentActivity.js +11 -0
- package/dist/dashboard/RecentActivity.js.map +1 -0
- package/dist/dashboard/SessionDetail.d.ts +8 -0
- package/dist/dashboard/SessionDetail.js +20 -0
- package/dist/dashboard/SessionDetail.js.map +1 -0
- package/dist/dashboard/StatusBar.d.ts +7 -0
- package/dist/dashboard/StatusBar.js +8 -0
- package/dist/dashboard/StatusBar.js.map +1 -0
- package/dist/dashboard/model.d.ts +69 -0
- package/dist/dashboard/model.js +136 -0
- package/dist/dashboard/model.js.map +1 -0
- package/dist/dashboard/run.d.ts +2 -0
- package/dist/dashboard/run.js +15 -0
- package/dist/dashboard/run.js.map +1 -0
- package/dist/dashboard/theme.d.ts +14 -0
- package/dist/dashboard/theme.js +15 -0
- package/dist/dashboard/theme.js.map +1 -0
- package/dist/dashboard/useRoomPolling.d.ts +18 -0
- package/dist/dashboard/useRoomPolling.js +48 -0
- package/dist/dashboard/useRoomPolling.js.map +1 -0
- package/dist/mcp/server.d.ts +34 -0
- package/dist/mcp/server.js +215 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/server/app.d.ts +37 -0
- package/dist/server/app.js +285 -0
- package/dist/server/app.js.map +1 -0
- package/dist/server/logger.d.ts +5 -0
- package/dist/server/logger.js +6 -0
- package/dist/server/logger.js.map +1 -0
- package/dist/server/rate-limit.d.ts +18 -0
- package/dist/server/rate-limit.js +40 -0
- package/dist/server/rate-limit.js.map +1 -0
- package/dist/server/serve.d.ts +39 -0
- package/dist/server/serve.js +87 -0
- package/dist/server/serve.js.map +1 -0
- package/dist/store/file-store.d.ts +21 -0
- package/dist/store/file-store.js +122 -0
- package/dist/store/file-store.js.map +1 -0
- package/dist/store/memory-store.d.ts +9 -0
- package/dist/store/memory-store.js +23 -0
- package/dist/store/memory-store.js.map +1 -0
- package/dist/store/store.d.ts +22 -0
- package/dist/store/store.js +25 -0
- package/dist/store/store.js.map +1 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vasiliki Doropoulou
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# teamroom
|
|
2
|
+
|
|
3
|
+
Know what your teammates (and their coding agents) are touching before the merge conflict does.
|
|
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.
|
|
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").
|
|
8
|
+
|
|
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
|
|
17
|
+
|
|
18
|
+
- Node.js 22 or newer (24 LTS recommended)
|
|
19
|
+
- git
|
|
20
|
+
|
|
21
|
+
## Setup
|
|
22
|
+
|
|
23
|
+
Run a server somewhere your team can reach:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npx teamroom serve --host 0.0.0.0 --port 8787 --data-dir /var/lib/teamroom
|
|
27
|
+
```
|
|
28
|
+
|
|
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`.
|
|
30
|
+
|
|
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).
|
|
32
|
+
|
|
33
|
+
In your repo, one person creates the room:
|
|
34
|
+
|
|
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
|
+
```
|
|
40
|
+
|
|
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:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
https://teamroom.example.com/join/room_...#tri_...
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Anyone who has the link can join, so share it privately. Teammates run, inside their clone:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
teamroom join 'https://teamroom.example.com/join/room_...#tri_...'
|
|
51
|
+
```
|
|
52
|
+
|
|
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.
|
|
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.
|
|
56
|
+
|
|
57
|
+
To try it alone first, run `teamroom serve` in one terminal and `teamroom create --server localhost:8787` in your repo.
|
|
58
|
+
|
|
59
|
+
## Daily use
|
|
60
|
+
|
|
61
|
+
```sh
|
|
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
|
+
```
|
|
69
|
+
|
|
70
|
+
## Coding agents (MCP)
|
|
71
|
+
|
|
72
|
+
`teamroom mcp` runs a stdio MCP server with four tools:
|
|
73
|
+
|
|
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 |
|
|
80
|
+
|
|
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`:
|
|
82
|
+
|
|
83
|
+
```toml
|
|
84
|
+
[mcp_servers.teamroom]
|
|
85
|
+
command = "teamroom"
|
|
86
|
+
args = ["mcp"]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Git hooks only see changes when you commit or switch branches. To share each file Claude Code edits as it happens, run:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
teamroom hooks install --claude
|
|
93
|
+
```
|
|
94
|
+
|
|
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`:
|
|
98
|
+
|
|
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.
|
|
100
|
+
|
|
101
|
+
## Room admin
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
teamroom invite rotate # owner only; the old invite stops working
|
|
105
|
+
teamroom member remove bo # owner only, or yourself; revokes the token
|
|
106
|
+
teamroom token rotate # replace your own token, for example after a leak
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Environment variables
|
|
110
|
+
|
|
111
|
+
| Variable | Purpose |
|
|
112
|
+
| --- | --- |
|
|
113
|
+
| `TEAMROOM_SERVER`, `TEAMROOM_ROOM`, `TEAMROOM_MEMBER`, `TEAMROOM_TOKEN` | Override `.git/teamroom.json`, for CI or shared agent machines |
|
|
114
|
+
| `TEAMROOM_SESSION` | Name this checkout's session (default: folder name plus a short hash of its path) |
|
|
115
|
+
|
|
116
|
+
## Limits
|
|
117
|
+
|
|
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).
|
|
119
|
+
- 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.
|
|
122
|
+
|
|
123
|
+
## Development
|
|
124
|
+
|
|
125
|
+
Requires Node 22+ (`nvm use` picks the version in `.nvmrc`).
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
npm install
|
|
129
|
+
npm run dev # rebuild on change and restart a local server on :8787
|
|
130
|
+
npm run check # typecheck, lint and tests, the same as CI
|
|
131
|
+
npm run format # fix formatting and import order
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Other scripts: `build`, `typecheck`, `lint`, `test`, `test:watch`. CI runs `check` and `build` on Node 22 and 24 for every pull request.
|
|
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).
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
MIT
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { promises as fs } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { parseArgs } from "node:util";
|
|
5
|
+
import { ApiClient } from "../client/api-client.js";
|
|
6
|
+
import { installClaudeHook, parseClaudeEdit, uninstallClaudeHook } from "../client/claude-hook.js";
|
|
7
|
+
import { ENV, saveConfig } from "../client/config.js";
|
|
8
|
+
import { formatDoctor, runDoctor } from "../client/doctor.js";
|
|
9
|
+
import { describeError, UsageError } from "../client/errors.js";
|
|
10
|
+
import { Git } from "../client/git.js";
|
|
11
|
+
import { installHooks, uninstallHooks } from "../client/hooks.js";
|
|
12
|
+
import { formatInviteLink, normalizeServerUrl, parseInviteLink } from "../client/invite-link.js";
|
|
13
|
+
import { AGENT_INSTRUCTION, CODEX_SNIPPET, installMcpConfig, mcpConfigHasTeamroom } from "../client/mcp-config.js";
|
|
14
|
+
import { checkOverlap, formatAge, formatOverlaps, openWorkspace, postNote, reportEdit, reportWork, } from "../client/workspace.js";
|
|
15
|
+
import { MAX_NAME_LENGTH } from "../core/schemas.js";
|
|
16
|
+
import { runMcpServer } from "../mcp/server.js";
|
|
17
|
+
import { DEFAULT_DATA_DIR, DEFAULT_HOST, DEFAULT_PORT, resolveServeOptions, SERVE_ENV, ServeConfigError, startServer, } from "../server/serve.js";
|
|
18
|
+
const EXIT_OK = 0;
|
|
19
|
+
const EXIT_FAILURE = 1;
|
|
20
|
+
const EXIT_USAGE = 2;
|
|
21
|
+
/** `teamroom check` exits with this when it finds overlap, so scripts can react to it. */
|
|
22
|
+
const EXIT_OVERLAP_FOUND = 3;
|
|
23
|
+
const DEFAULT_STATUS_LIMIT = 20;
|
|
24
|
+
const ACTIVITY_SOURCES = ["human", "hook", "agent"];
|
|
25
|
+
const HELP = `teamroom: know what your teammates (and their agents) are touching before the merge conflict does.
|
|
26
|
+
|
|
27
|
+
Setup
|
|
28
|
+
teamroom serve [--port ${DEFAULT_PORT}] [--host ${DEFAULT_HOST}] [--data-dir ${DEFAULT_DATA_DIR}] [--trust-proxy]
|
|
29
|
+
teamroom create --server <url> [--room-name <name>] [--name <you>] [--create-key <key>]
|
|
30
|
+
teamroom join '<invite link>' [--name <you>]
|
|
31
|
+
teamroom agents install Let Claude Code and Codex use teamroom in this repo
|
|
32
|
+
teamroom hooks install | uninstall [--claude] --claude also reports each file Claude Code edits
|
|
33
|
+
teamroom doctor Check the setup and say how to fix what is missing
|
|
34
|
+
|
|
35
|
+
Daily use
|
|
36
|
+
teamroom check [files...] Who else is touching these files (default: your pending changes)
|
|
37
|
+
teamroom report [--note <text>] Share the files this checkout is changing
|
|
38
|
+
teamroom note <text> [--files a,b]
|
|
39
|
+
teamroom status [--limit ${DEFAULT_STATUS_LIMIT}]
|
|
40
|
+
teamroom watch [--interval 3] Live dashboard: teammates, their agents, and what each is doing
|
|
41
|
+
teamroom mcp Run the MCP server for coding agents (stdio)
|
|
42
|
+
|
|
43
|
+
Room admin
|
|
44
|
+
teamroom invite rotate Owner only. The old invite code stops working
|
|
45
|
+
teamroom member remove <name> Owner only, or yourself
|
|
46
|
+
teamroom token rotate Replace your token, for example after a leak
|
|
47
|
+
|
|
48
|
+
Names default to your git user.name, the room name to the repo folder. create and join
|
|
49
|
+
install the git hooks unless you pass --skip-hooks.
|
|
50
|
+
|
|
51
|
+
Server environment: PORT, HOST, TEAMROOM_DATA_DIR, TEAMROOM_TRUST_PROXY, and TEAMROOM_CREATE_KEY
|
|
52
|
+
(when set, creating a room needs that key; joining with an invite link does not).
|
|
53
|
+
|
|
54
|
+
Environment: TEAMROOM_SERVER, TEAMROOM_ROOM, TEAMROOM_MEMBER, TEAMROOM_TOKEN override the
|
|
55
|
+
repo config. TEAMROOM_SESSION names this checkout (default: derived from its path).`;
|
|
56
|
+
const commands = {
|
|
57
|
+
serve: async (args) => {
|
|
58
|
+
const { values } = parseArgs({
|
|
59
|
+
args,
|
|
60
|
+
options: {
|
|
61
|
+
port: { type: "string" },
|
|
62
|
+
host: { type: "string" },
|
|
63
|
+
"data-dir": { type: "string" },
|
|
64
|
+
"trust-proxy": { type: "boolean" },
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
let options;
|
|
68
|
+
try {
|
|
69
|
+
options = resolveServeOptions({
|
|
70
|
+
port: values.port,
|
|
71
|
+
host: values.host,
|
|
72
|
+
dataDir: values["data-dir"],
|
|
73
|
+
trustProxy: values["trust-proxy"],
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
if (error instanceof ServeConfigError)
|
|
78
|
+
throw new UsageError(error.message);
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
startServer(options);
|
|
82
|
+
// Keep the process alive until the server shuts itself down on a signal.
|
|
83
|
+
await new Promise(() => undefined);
|
|
84
|
+
return EXIT_OK;
|
|
85
|
+
},
|
|
86
|
+
create: async (args) => {
|
|
87
|
+
const { values } = parseArgs({
|
|
88
|
+
args,
|
|
89
|
+
options: {
|
|
90
|
+
server: { type: "string" },
|
|
91
|
+
"room-name": { type: "string" },
|
|
92
|
+
name: { type: "string" },
|
|
93
|
+
"skip-hooks": { type: "boolean", default: false },
|
|
94
|
+
"skip-agents": { type: "boolean", default: false },
|
|
95
|
+
"create-key": { type: "string" },
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
const serverInput = values.server ?? process.env[ENV.server];
|
|
99
|
+
if (!serverInput) {
|
|
100
|
+
throw new UsageError(`--server is required. To try teamroom locally, run \`teamroom serve\` in another terminal and pass --server http://${DEFAULT_HOST}:${DEFAULT_PORT}.`);
|
|
101
|
+
}
|
|
102
|
+
const server = normalizeServerUrl(serverInput);
|
|
103
|
+
const git = new Git(process.cwd());
|
|
104
|
+
const [repoRoot, commonDir] = await Promise.all([git.repoRoot(), git.commonDir()]);
|
|
105
|
+
const name = await memberName(values.name, git);
|
|
106
|
+
const roomName = values["room-name"]?.trim() || path.basename(repoRoot);
|
|
107
|
+
const createKey = values["create-key"] ?? process.env[SERVE_ENV.createKey];
|
|
108
|
+
const created = await new ApiClient({ server }).createRoom(roomName, name, createKey);
|
|
109
|
+
await saveConfig(commonDir, { server, roomId: created.room.id, member: created.me, token: created.token });
|
|
110
|
+
print(`Created room "${created.room.name}". You are ${created.me}, the owner.`);
|
|
111
|
+
await finishSetup(git, repoRoot, { hooks: !values["skip-hooks"], agents: !values["skip-agents"] });
|
|
112
|
+
const link = formatInviteLink({ server, roomId: created.room.id, inviteCode: created.inviteCode });
|
|
113
|
+
print("\nInvite teammates with this link. Anyone who has it can join, so share it privately:");
|
|
114
|
+
print(` ${link}`);
|
|
115
|
+
print("\nThey run, inside their clone of this repo:");
|
|
116
|
+
print(` teamroom join '${link}'`);
|
|
117
|
+
return EXIT_OK;
|
|
118
|
+
},
|
|
119
|
+
join: async (args) => {
|
|
120
|
+
const { values, positionals } = parseArgs({
|
|
121
|
+
args,
|
|
122
|
+
allowPositionals: true,
|
|
123
|
+
options: {
|
|
124
|
+
server: { type: "string" },
|
|
125
|
+
room: { type: "string" },
|
|
126
|
+
invite: { type: "string" },
|
|
127
|
+
name: { type: "string" },
|
|
128
|
+
"skip-hooks": { type: "boolean", default: false },
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
const [link] = positionals;
|
|
132
|
+
const invite = link
|
|
133
|
+
? parseInviteLink(link)
|
|
134
|
+
: {
|
|
135
|
+
server: normalizeServerUrl(requireOption(values.server, "--server (or pass the invite link)")),
|
|
136
|
+
roomId: requireOption(values.room, "--room"),
|
|
137
|
+
inviteCode: requireOption(values.invite, "--invite"),
|
|
138
|
+
};
|
|
139
|
+
const git = new Git(process.cwd());
|
|
140
|
+
const [repoRoot, commonDir] = await Promise.all([git.repoRoot(), git.commonDir()]);
|
|
141
|
+
const name = await memberName(values.name, git);
|
|
142
|
+
const joined = await new ApiClient({ server: invite.server }).joinRoom(invite.roomId, name, invite.inviteCode);
|
|
143
|
+
await saveConfig(commonDir, {
|
|
144
|
+
server: invite.server,
|
|
145
|
+
roomId: joined.room.id,
|
|
146
|
+
member: joined.me,
|
|
147
|
+
token: joined.token,
|
|
148
|
+
});
|
|
149
|
+
print(`Joined "${joined.room.name}" as ${joined.me}.`);
|
|
150
|
+
// .mcp.json is committed by whoever created the room, so joiners normally get it with the repo.
|
|
151
|
+
await finishSetup(git, repoRoot, { hooks: !values["skip-hooks"], agents: false });
|
|
152
|
+
if (!(await mcpConfigHasTeamroom(repoRoot).catch(() => false))) {
|
|
153
|
+
print("Tip: `teamroom agents install` lets Claude Code and Codex check overlap before they edit.");
|
|
154
|
+
}
|
|
155
|
+
return EXIT_OK;
|
|
156
|
+
},
|
|
157
|
+
agents: async (args) => {
|
|
158
|
+
if (args[0] !== "install")
|
|
159
|
+
throw new UsageError("Use `teamroom agents install`.");
|
|
160
|
+
const repoRoot = await new Git(process.cwd()).repoRoot();
|
|
161
|
+
await setUpAgents(repoRoot);
|
|
162
|
+
return EXIT_OK;
|
|
163
|
+
},
|
|
164
|
+
doctor: async () => {
|
|
165
|
+
const checks = await runDoctor(process.cwd());
|
|
166
|
+
print(formatDoctor(checks));
|
|
167
|
+
return checks.some((check) => check.status === "fail") ? EXIT_FAILURE : EXIT_OK;
|
|
168
|
+
},
|
|
169
|
+
hooks: async (args) => {
|
|
170
|
+
const { values, positionals } = parseArgs({
|
|
171
|
+
args,
|
|
172
|
+
options: { claude: { type: "boolean", default: false } },
|
|
173
|
+
allowPositionals: true,
|
|
174
|
+
});
|
|
175
|
+
const [action] = positionals;
|
|
176
|
+
if (action !== "install" && action !== "uninstall")
|
|
177
|
+
throw new UsageError("Use `teamroom hooks install` or `uninstall`.");
|
|
178
|
+
const git = new Git(process.cwd());
|
|
179
|
+
const hooksDir = await git.hooksDir();
|
|
180
|
+
const changes = action === "install" ? await installHooks(hooksDir, await currentCli()) : await uninstallHooks(hooksDir);
|
|
181
|
+
for (const [hook, change] of Object.entries(changes))
|
|
182
|
+
print(`${hook}: ${change}`);
|
|
183
|
+
if (values.claude) {
|
|
184
|
+
const repoRoot = await git.repoRoot();
|
|
185
|
+
const claude = action === "install"
|
|
186
|
+
? await installClaudeHook(repoRoot, await currentCli())
|
|
187
|
+
: await uninstallClaudeHook(repoRoot);
|
|
188
|
+
print(`Claude Code PostToolUse: ${claude.change} (${path.relative(repoRoot, claude.file)})`);
|
|
189
|
+
if (action === "install" && claude.change === "installed")
|
|
190
|
+
print("Restart Claude Code sessions in this repo to pick it up.");
|
|
191
|
+
}
|
|
192
|
+
return EXIT_OK;
|
|
193
|
+
},
|
|
194
|
+
// Called by Claude Code after each file edit. Silent and always succeeds: it must never get in Claude's way.
|
|
195
|
+
"claude-hook": async () => {
|
|
196
|
+
try {
|
|
197
|
+
const edit = parseClaudeEdit(await readStdin(CLAUDE_HOOK_STDIN_TIMEOUT_MS));
|
|
198
|
+
if (!edit)
|
|
199
|
+
return EXIT_OK;
|
|
200
|
+
const workspace = await openWorkspace(edit.cwd ?? process.cwd());
|
|
201
|
+
await reportEdit(workspace, { file: edit.file, agent: "claude-code" });
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
// Not in a room, server down, or a file outside the repo: nothing to report.
|
|
205
|
+
}
|
|
206
|
+
return EXIT_OK;
|
|
207
|
+
},
|
|
208
|
+
check: async (args) => {
|
|
209
|
+
const { values, positionals } = parseArgs({
|
|
210
|
+
args,
|
|
211
|
+
options: { "since-hours": { type: "string" } },
|
|
212
|
+
allowPositionals: true,
|
|
213
|
+
});
|
|
214
|
+
const workspace = await openWorkspace(process.cwd());
|
|
215
|
+
const check = await checkOverlap(workspace, {
|
|
216
|
+
files: positionals,
|
|
217
|
+
sinceHours: parseOptionalInt(values["since-hours"], "--since-hours"),
|
|
218
|
+
});
|
|
219
|
+
if (check.files.length === 0) {
|
|
220
|
+
print("Nothing to check: no files given and no pending changes.");
|
|
221
|
+
return EXIT_OK;
|
|
222
|
+
}
|
|
223
|
+
print(formatOverlaps(check.overlaps));
|
|
224
|
+
return check.overlaps.length > 0 ? EXIT_OVERLAP_FOUND : EXIT_OK;
|
|
225
|
+
},
|
|
226
|
+
report: async (args) => {
|
|
227
|
+
const { values } = parseArgs({
|
|
228
|
+
args,
|
|
229
|
+
options: {
|
|
230
|
+
note: { type: "string" },
|
|
231
|
+
source: { type: "string", default: "human" },
|
|
232
|
+
quiet: { type: "boolean", default: false },
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
const source = ACTIVITY_SOURCES.find((candidate) => candidate === values.source);
|
|
236
|
+
if (!source)
|
|
237
|
+
throw new UsageError(`--source must be one of ${ACTIVITY_SOURCES.join(", ")}.`);
|
|
238
|
+
const workspace = await openWorkspace(process.cwd());
|
|
239
|
+
const { activity, omittedFiles } = await reportWork(workspace, { source, note: values.note });
|
|
240
|
+
if (!values.quiet) {
|
|
241
|
+
const omitted = omittedFiles > 0 ? `, ${omittedFiles} left out (over the limit)` : "";
|
|
242
|
+
print(`Reported ${activity.files.length} file(s)${omitted} as session ${workspace.session}.`);
|
|
243
|
+
}
|
|
244
|
+
return EXIT_OK;
|
|
245
|
+
},
|
|
246
|
+
note: async (args) => {
|
|
247
|
+
const { values, positionals } = parseArgs({ args, options: { files: { type: "string" } }, allowPositionals: true });
|
|
248
|
+
const text = positionals.join(" ").trim();
|
|
249
|
+
if (!text)
|
|
250
|
+
throw new UsageError('Usage: teamroom note "about to refactor auth" [--files src/auth.ts,src/user.ts]');
|
|
251
|
+
const files = values.files
|
|
252
|
+
?.split(",")
|
|
253
|
+
.map((file) => file.trim())
|
|
254
|
+
.filter(Boolean);
|
|
255
|
+
const workspace = await openWorkspace(process.cwd());
|
|
256
|
+
await postNote(workspace, { text, files, source: "human" });
|
|
257
|
+
print("Note posted.");
|
|
258
|
+
return EXIT_OK;
|
|
259
|
+
},
|
|
260
|
+
status: async (args) => {
|
|
261
|
+
const { values } = parseArgs({ args, options: { limit: { type: "string" } } });
|
|
262
|
+
const limit = parseOptionalInt(values.limit, "--limit") ?? DEFAULT_STATUS_LIMIT;
|
|
263
|
+
const workspace = await openWorkspace(process.cwd());
|
|
264
|
+
const { room, me } = await workspace.client.getRoom(workspace.config.roomId, limit);
|
|
265
|
+
print(`${room.name} (${room.id}), you are ${me}, session ${workspace.session}`);
|
|
266
|
+
print(`Members: ${room.members.map((member) => (member.role === "owner" ? `${member.name} (owner)` : member.name)).join(", ")}`);
|
|
267
|
+
if (room.activity.length === 0) {
|
|
268
|
+
print("\nNo activity yet.");
|
|
269
|
+
return EXIT_OK;
|
|
270
|
+
}
|
|
271
|
+
print("");
|
|
272
|
+
for (const entry of [...room.activity].reverse()) {
|
|
273
|
+
const files = entry.files.length > 0 ? ` [${entry.files.length} file(s)]` : "";
|
|
274
|
+
print(`${formatAge(entry.createdAt).padEnd(9)} ${entry.member} ${entry.kind}: ${entry.text}${files}`);
|
|
275
|
+
}
|
|
276
|
+
return EXIT_OK;
|
|
277
|
+
},
|
|
278
|
+
watch: async (args) => {
|
|
279
|
+
const { values } = parseArgs({ args, options: { interval: { type: "string" } } });
|
|
280
|
+
const intervalSeconds = parseOptionalInt(values.interval, "--interval");
|
|
281
|
+
const workspace = await openWorkspace(process.cwd());
|
|
282
|
+
// Loaded on demand so hooks and scripts never pay for React and Ink.
|
|
283
|
+
const { runDashboard } = await import("../dashboard/run.js");
|
|
284
|
+
await runDashboard(workspace, intervalSeconds === undefined ? undefined : intervalSeconds * 1000);
|
|
285
|
+
return EXIT_OK;
|
|
286
|
+
},
|
|
287
|
+
mcp: async () => {
|
|
288
|
+
await runMcpServer(() => openWorkspace(process.cwd()));
|
|
289
|
+
return EXIT_OK;
|
|
290
|
+
},
|
|
291
|
+
invite: async (args) => {
|
|
292
|
+
if (args[0] !== "rotate")
|
|
293
|
+
throw new UsageError("Use `teamroom invite rotate`.");
|
|
294
|
+
const workspace = await openWorkspace(process.cwd());
|
|
295
|
+
const inviteCode = await workspace.client.rotateInvite(workspace.config.roomId);
|
|
296
|
+
const link = formatInviteLink({ server: workspace.config.server, roomId: workspace.config.roomId, inviteCode });
|
|
297
|
+
print("The old invite link no longer works. New one:");
|
|
298
|
+
print(` ${link}`);
|
|
299
|
+
return EXIT_OK;
|
|
300
|
+
},
|
|
301
|
+
member: async (args) => {
|
|
302
|
+
const [action, name] = args;
|
|
303
|
+
if (action !== "remove" || !name)
|
|
304
|
+
throw new UsageError("Use `teamroom member remove <name>`.");
|
|
305
|
+
const workspace = await openWorkspace(process.cwd());
|
|
306
|
+
await workspace.client.removeMember(workspace.config.roomId, name);
|
|
307
|
+
print(`${name} was removed and their token revoked.`);
|
|
308
|
+
return EXIT_OK;
|
|
309
|
+
},
|
|
310
|
+
token: async (args) => {
|
|
311
|
+
if (args[0] !== "rotate")
|
|
312
|
+
throw new UsageError("Use `teamroom token rotate`.");
|
|
313
|
+
const git = new Git(process.cwd());
|
|
314
|
+
const [workspace, commonDir] = await Promise.all([openWorkspace(process.cwd()), git.commonDir()]);
|
|
315
|
+
const token = await workspace.client.rotateToken(workspace.config.roomId);
|
|
316
|
+
const file = await saveConfig(commonDir, { ...workspace.config, token });
|
|
317
|
+
print(`Token replaced and saved to ${file}. Update TEAMROOM_TOKEN anywhere you set it by hand.`);
|
|
318
|
+
return EXIT_OK;
|
|
319
|
+
},
|
|
320
|
+
};
|
|
321
|
+
async function finishSetup(git, repoRoot, steps) {
|
|
322
|
+
if (steps.hooks) {
|
|
323
|
+
await installHooks(await git.hooksDir(), await currentCli());
|
|
324
|
+
print("Installed git hooks: commits, checkouts, merges and rebases are now shared automatically.");
|
|
325
|
+
}
|
|
326
|
+
if (steps.agents)
|
|
327
|
+
await setUpAgents(repoRoot);
|
|
328
|
+
}
|
|
329
|
+
async function setUpAgents(repoRoot) {
|
|
330
|
+
const { file, change } = await installMcpConfig(repoRoot);
|
|
331
|
+
const relative = path.relative(process.cwd(), file) || file;
|
|
332
|
+
if (change === "unchanged") {
|
|
333
|
+
print(`${relative} already lists the teamroom MCP server.`);
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
const verb = change === "created" ? "Created" : "Updated";
|
|
337
|
+
print(`${verb} ${relative} for Claude Code. Commit it so teammates get it too.`);
|
|
338
|
+
}
|
|
339
|
+
print("\nCodex: add this to ~/.codex/config.toml");
|
|
340
|
+
print(indent(CODEX_SNIPPET));
|
|
341
|
+
print("\nTell your agents to use it, in AGENTS.md or CLAUDE.md:");
|
|
342
|
+
print(indent(AGENT_INSTRUCTION));
|
|
343
|
+
}
|
|
344
|
+
/** Falls back to git's user.name, so most people never type --name. */
|
|
345
|
+
async function memberName(explicit, git) {
|
|
346
|
+
const fromGit = (await git.userName())?.replace(/@/g, "").trim().slice(0, MAX_NAME_LENGTH);
|
|
347
|
+
const candidate = explicit?.trim() || fromGit;
|
|
348
|
+
if (!candidate)
|
|
349
|
+
throw new UsageError("--name is required (git has no user.name set).");
|
|
350
|
+
return candidate;
|
|
351
|
+
}
|
|
352
|
+
function indent(text) {
|
|
353
|
+
return text
|
|
354
|
+
.split("\n")
|
|
355
|
+
.map((line) => ` ${line}`)
|
|
356
|
+
.join("\n");
|
|
357
|
+
}
|
|
358
|
+
/** npx runs from a throwaway cache, so pinning its path would break once the cache is cleared. */
|
|
359
|
+
const CLAUDE_HOOK_STDIN_TIMEOUT_MS = 2_000;
|
|
360
|
+
/** Reads all of stdin, giving up after `timeoutMs` so a hook never hangs when nothing is piped in. */
|
|
361
|
+
async function readStdin(timeoutMs) {
|
|
362
|
+
if (process.stdin.isTTY)
|
|
363
|
+
return "";
|
|
364
|
+
const chunks = [];
|
|
365
|
+
const read = (async () => {
|
|
366
|
+
for await (const chunk of process.stdin)
|
|
367
|
+
chunks.push(Buffer.from(chunk));
|
|
368
|
+
})();
|
|
369
|
+
const timeout = new Promise((resolve) => setTimeout(resolve, timeoutMs).unref());
|
|
370
|
+
await Promise.race([read, timeout]);
|
|
371
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
372
|
+
}
|
|
373
|
+
async function currentCli() {
|
|
374
|
+
const script = process.argv[1];
|
|
375
|
+
if (!script)
|
|
376
|
+
return undefined;
|
|
377
|
+
const resolved = await fs.realpath(script);
|
|
378
|
+
return resolved.includes(`${path.sep}_npx${path.sep}`) ? undefined : { node: process.execPath, script: resolved };
|
|
379
|
+
}
|
|
380
|
+
function requireOption(value, flag) {
|
|
381
|
+
if (!value?.trim())
|
|
382
|
+
throw new UsageError(`${flag} is required.`);
|
|
383
|
+
return value.trim();
|
|
384
|
+
}
|
|
385
|
+
function parseOptionalInt(value, flag) {
|
|
386
|
+
if (value === undefined)
|
|
387
|
+
return undefined;
|
|
388
|
+
const parsed = Number(value);
|
|
389
|
+
if (!Number.isInteger(parsed) || parsed < 1)
|
|
390
|
+
throw new UsageError(`${flag} must be a positive integer.`);
|
|
391
|
+
return parsed;
|
|
392
|
+
}
|
|
393
|
+
function isParseArgsError(error) {
|
|
394
|
+
const code = error?.code;
|
|
395
|
+
return typeof code === "string" && code.startsWith("ERR_PARSE_ARGS");
|
|
396
|
+
}
|
|
397
|
+
function print(line) {
|
|
398
|
+
process.stdout.write(`${line}\n`);
|
|
399
|
+
}
|
|
400
|
+
async function main(argv) {
|
|
401
|
+
const [name, ...rest] = argv;
|
|
402
|
+
if (!name || name === "help" || name === "--help" || name === "-h") {
|
|
403
|
+
print(HELP);
|
|
404
|
+
return name ? EXIT_OK : EXIT_USAGE;
|
|
405
|
+
}
|
|
406
|
+
const command = commands[name];
|
|
407
|
+
if (!command) {
|
|
408
|
+
process.stderr.write(`Unknown command "${name}". Run \`teamroom --help\`.\n`);
|
|
409
|
+
return EXIT_USAGE;
|
|
410
|
+
}
|
|
411
|
+
try {
|
|
412
|
+
return await command(rest);
|
|
413
|
+
}
|
|
414
|
+
catch (error) {
|
|
415
|
+
process.stderr.write(`teamroom: ${describeError(error)}\n`);
|
|
416
|
+
return error instanceof UsageError || isParseArgsError(error) ? EXIT_USAGE : EXIT_FAILURE;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
process.exitCode = await main(process.argv.slice(2));
|
|
420
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC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