huddle-cli 0.0.0-stage → 0.1.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.
Files changed (75) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/LICENSE +21 -0
  3. package/QUICKSTART.md +102 -0
  4. package/README.md +376 -2
  5. package/dist/adapters/amp.js +40 -0
  6. package/dist/adapters/antigravity.js +54 -0
  7. package/dist/adapters/claude.js +86 -0
  8. package/dist/adapters/codex.js +64 -0
  9. package/dist/adapters/copilot.js +69 -0
  10. package/dist/adapters/cursor.js +92 -0
  11. package/dist/adapters/custom.js +342 -0
  12. package/dist/adapters/droid.js +58 -0
  13. package/dist/adapters/gemini.js +61 -0
  14. package/dist/adapters/goose.js +57 -0
  15. package/dist/adapters/index.js +161 -0
  16. package/dist/adapters/kiro.js +41 -0
  17. package/dist/adapters/opencode.js +63 -0
  18. package/dist/adapters/qwen.js +67 -0
  19. package/dist/adapters/types.js +6 -0
  20. package/dist/adapters/usage.js +141 -0
  21. package/dist/attach/connect.js +412 -0
  22. package/dist/attach/guard.js +83 -0
  23. package/dist/attach/live.js +226 -0
  24. package/dist/attach/plug.js +185 -0
  25. package/dist/attach/screen.js +150 -0
  26. package/dist/attach/session.js +177 -0
  27. package/dist/cli.js +244 -0
  28. package/dist/mcp/context-tools.js +79 -0
  29. package/dist/mcp/server.js +267 -0
  30. package/dist/orchestrator/ask.js +54 -0
  31. package/dist/orchestrator/brain.js +174 -0
  32. package/dist/orchestrator/council.js +615 -0
  33. package/dist/orchestrator/goal.js +196 -0
  34. package/dist/orchestrator/handoff.js +117 -0
  35. package/dist/orchestrator/launcher.js +171 -0
  36. package/dist/orchestrator/learn.js +105 -0
  37. package/dist/orchestrator/planner.js +212 -0
  38. package/dist/orchestrator/qa.js +398 -0
  39. package/dist/orchestrator/radar.js +719 -0
  40. package/dist/orchestrator/scheduler.js +1207 -0
  41. package/dist/orchestrator/takeover.js +240 -0
  42. package/dist/platform.js +273 -0
  43. package/dist/preflight.js +31 -0
  44. package/dist/relay/server.js +113 -0
  45. package/dist/room/context.js +1285 -0
  46. package/dist/room/contract.js +132 -0
  47. package/dist/room/db.js +680 -0
  48. package/dist/room/followup.js +233 -0
  49. package/dist/room/identity.js +122 -0
  50. package/dist/room/lessons.js +275 -0
  51. package/dist/room/live.js +348 -0
  52. package/dist/room/mail.js +212 -0
  53. package/dist/room/progress.js +149 -0
  54. package/dist/room/relaylink.js +85 -0
  55. package/dist/room/server.js +882 -0
  56. package/dist/room/sqlite.js +156 -0
  57. package/dist/room/transport.js +107 -0
  58. package/dist/room/tunnel.js +86 -0
  59. package/dist/sandbox/sync.js +104 -0
  60. package/dist/sandbox/worktree.js +392 -0
  61. package/dist/types.js +4 -0
  62. package/dist/ui/app.js +1955 -0
  63. package/dist/ui/catalog.js +113 -0
  64. package/dist/ui/dashboard.js +335 -0
  65. package/dist/ui/doctor.js +58 -0
  66. package/dist/ui/lessons.js +81 -0
  67. package/dist/ui/logo.js +40 -0
  68. package/dist/ui/paste.js +515 -0
  69. package/dist/ui/remote.js +338 -0
  70. package/dist/ui/setup.js +152 -0
  71. package/dist/ui/story.js +1529 -0
  72. package/dist/ui/term.js +249 -0
  73. package/dist/ui/watch.js +271 -0
  74. package/install.sh +44 -0
  75. package/package.json +63 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,31 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1 — 2026-10-16
4
+
5
+ The agents now work *together*, not just side by side. Verified live with real Claude, Codex and Cursor building an app from an empty repo (capstone: 29/29 checks, rounds 4 and 6).
6
+
7
+ ### Collaboration
8
+ - **Design council v2.** Every agent proposes a design, then reviews the others: what it *adopts* from each teammate and what *flaw* it sees. The agent whose ideas teammates adopted most writes the plan (not always Claude). Everyone else ratifies it or objects; objections are taken before anyone codes.
9
+ - **Shared contract.** The plan comes with `HUDDLE_CONTRACT.md` — file owners, function names, data fields, exact error messages — committed before work starts. `huddle_amend_contract` changes it and tells every working agent.
10
+ - **The goal reaches every agent verbatim** and wins over the plan and the contract; a check makes sure every exact string in the goal lands in some task.
11
+ - **Mail mid-task.** Messages arrive inside every Huddle tool result, and Claude also gets them after *every* tool call (a hook). Agents check in at ~25/50/75%.
12
+ - **Buddy checks.** At ~50% (or after 2 minutes without a progress report) another agent looks at the work in progress and sends notes. Notes must be answered — fixed, or "won't fix, because…" — before the task can finish.
13
+ - **Radar.** Every 20s Huddle compares the agents' unfinished work and warns both sides about overlapping edits or name mismatches (`getItems` vs `listItems`).
14
+ - **Pairing.** A free agent takes a separable part of a task that's behind (or writes its tests) unless the author says no.
15
+ - **QA checks the goal item by item**, and a suspiciously quick "clean" round gets a second opinion from another agent.
16
+ - **Reviews say what they verified**; a bare APPROVE is marked shallow.
17
+
18
+ ### New
19
+ - `huddle setup` — checks Node and git, installs the agents you pick, walks you through each sign-in.
20
+ - `huddle agents use claude,codex` / `huddle agents skip cursor` — choose your agents, even ones that are installed.
21
+ - **The shared screen.** Paste a long log or doc and it becomes one item (`ctx-1`) instead of one command per line; `add <file|folder>` or drag a file in; screenshots and PDFs too. Agents read, search and pin notes on it. Works in attach mode: `huddle add <file>`, `pbpaste | huddle add -`, `huddle ctx`. Secrets are caught before anything goes to an agent.
22
+ - `huddle join "<goal>" --with <file>` and piped input (`cat log | huddle join "fix this"`).
23
+ - **Lessons.** Huddle remembers what went wrong in earlier runs and tells the next run's agents (`huddle lessons`).
24
+ - `npm run evolve` — Huddle runs on its own repo to fix its weaknesses, kept only if the capstone score holds.
25
+ - The planner (brain) defaults to Claude Opus.
26
+
27
+ ### Better
28
+ - Live output in clear phases (COUNCIL → PLAN → BUILD → QA → RESULT), one status line per agent, a TEAMWORK summary; redesigned `huddle view` and `huddle story --html`.
29
+ - Windows: PowerShell install commands, agent CLIs launched correctly, Windows paths, process cleanup, no duplicated rows in `huddle doctor`. `HUDDLE_ASCII=1` for old consoles.
30
+ - Fixed: lost reviewer answers and agent output when Huddle was busy; a log-stream crash on Linux; flaky tests.
31
+ - `QUICKSTART.md`: install, first run, teammates, on one page.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Preet37
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/QUICKSTART.md ADDED
@@ -0,0 +1,102 @@
1
+ # Huddle quickstart
2
+
3
+ Two commands on any computer, then you type what you want built.
4
+
5
+ ## 1. Install (once per computer)
6
+
7
+ You need **Node.js 20+** and **git**. Check with `node -v` and `git --version`.
8
+ Missing one? Node: [nodejs.org](https://nodejs.org) (or `nvm install 22`). git on macOS: `xcode-select --install`. On Windows, see [below](#windows).
9
+
10
+ ```bash
11
+ npm install -g huddle-cli && huddle setup
12
+ ```
13
+
14
+ `huddle setup` checks Node and git, asks which agents you want (say no to any you don't use — e.g. skip Cursor), installs the missing ones with the right command for your computer, then opens each one's own sign-in, one at a time. You need at least one agent. `huddle setup --yes` skips the questions (sign-ins still need you: they open a browser).
15
+
16
+ By hand instead:
17
+
18
+ | Agent | Install (macOS / Linux) | Install (Windows PowerShell) | Sign in (once) |
19
+ |---|---|---|---|
20
+ | Claude Code | `curl -fsSL https://claude.ai/install.sh \| bash` | `irm https://claude.ai/install.ps1 \| iex` | `claude auth login` |
21
+ | Codex | `npm install -g @openai/codex` | same | `codex login` |
22
+ | Cursor | `curl https://cursor.com/install -fsS \| bash` | `irm 'https://cursor.com/install?win32=true' \| iex` | `cursor-agent login` |
23
+ | Antigravity | `curl -fsSL https://antigravity.google/cli/install.sh \| bash` | `irm https://antigravity.google/cli/install.ps1 \| iex` | run `agy`, sign in, then ctrl-c twice |
24
+
25
+ Each agent uses its own account; Huddle never sees a password or key. Changed your mind? `huddle agents skip cursor` keeps Cursor out of every run (even when it's installed and signed in); `huddle agents use cursor` brings it back; `huddle agents` shows who's ready and who's skipped.
26
+
27
+ ### Windows
28
+
29
+ Huddle runs natively in PowerShell (Windows Terminal or VS Code's terminal):
30
+
31
+ ```powershell
32
+ winget install OpenJS.NodeJS.LTS # if `node -v` fails (then open a new terminal)
33
+ winget install --id Git.Git -e --source winget # if `git --version` fails
34
+ npm install -g huddle-cli
35
+ huddle setup
36
+ ```
37
+
38
+ `huddle setup` uses the PowerShell installers above. If PowerShell says "running scripts is disabled", run `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` once.
39
+ **If anything fails on Windows, WSL is the fallback:** `wsl --install`, restart, open "Ubuntu", then follow the macOS / Linux steps inside it (install Node there too, and keep your repo inside the Linux file system, e.g. `~/code`).
40
+
41
+ ## 2. Use it
42
+
43
+ ```bash
44
+ cd my-project # any git repo (not one? huddle offers to set it up)
45
+ huddle
46
+ ```
47
+
48
+ At the `huddle ›` prompt, type the goal, e.g. `build a REST API for todos with tests`.
49
+ Huddle plans it, every agent works at once in its own copy of the repo, and work merges only when tests pass.
50
+
51
+ One-shot instead of the prompt: `huddle join "build a REST API for todos with tests"`.
52
+
53
+ **Pasting and files.** Paste anything long (a stack trace, a spec, code) at the prompt: it goes on the *shared screen* as one item, every agent can read it, and what you type next is the goal. Drag a file or screenshot into the terminal, or type `add notes.md` / `add src/` / `add *.png`. `ctx` shows what's on the screen; `ctx rm ctx-2` takes one off. Prompts only carry a short index, so a huge paste doesn't get copied to every agent. Keys and tokens in a paste are caught first: Huddle asks before showing them to agents, and redacts them unless you say no.
54
+ One-shot: `huddle join "fix this" --with error.log --with screenshot.png`, or `cat error.log | huddle join "fix this"`.
55
+
56
+ **While it runs** (second terminal, same folder):
57
+
58
+ ```bash
59
+ huddle view # live: who's doing what, messages, merges
60
+ ```
61
+
62
+ **After it runs:**
63
+
64
+ ```bash
65
+ huddle story # replay: plan, messages between agents, reviews, merges
66
+ huddle story --html story.html # the same as a page you can open or share
67
+ ```
68
+
69
+ ## 3. Working with teammates (e.g. a hackathon)
70
+
71
+ Everyone installs Huddle as in step 1, on their own machine, with their own agents.
72
+
73
+ 1. Put the repo on GitHub and have each teammate clone it.
74
+ 2. In your `huddle`, type `sync on` so merged work gets pushed for them.
75
+ 3. Type `invite @their-github-name`. Huddle prints a one-time `huddle join <address> <CODE>` line (valid 10 minutes).
76
+ 4. They run that line inside their clone. Their agents now take tasks off your board, using their own accounts.
77
+
78
+ Not on the same Wi-Fi? Install [Tailscale](https://tailscale.com) on both machines, or run `huddle relay` on a server and type `relay <url>` in your huddle.
79
+
80
+ ## Everyday commands
81
+
82
+ | Command | What it does |
83
+ |---|---|
84
+ | `huddle` | open Huddle in this repo |
85
+ | `huddle join "<goal>" --plan` | dry run: show who would do what |
86
+ | `huddle setup` | install and sign in to your agents (asks first) |
87
+ | `huddle doctor` | check Node, git and your agents |
88
+ | `huddle agents` · `huddle agents skip <id>` · `use <id>` | who's ready, and which agents Huddle uses |
89
+ | `huddle view` | watch a run live |
90
+ | `huddle story` | replay the last run |
91
+ | `huddle board` | print the task board |
92
+ | `add <file>` / `ctx` | (at the prompt) put a file on the shared screen / see what's on it |
93
+ | `huddle add <file\|->` / `huddle ctx` | running claude/codex/cursor yourself (`huddle connect`): put a file, folder or stdin (`cat err.log \| huddle add -`) on the shared screen every session reads / see it |
94
+ | `npm install -g huddle-cli` | update to the newest version |
95
+ | `npm uninstall -g huddle-cli` | remove it (your repos keep their work) |
96
+
97
+ ## If something goes wrong
98
+
99
+ - **`EACCES` when installing:** your npm global folder is owned by root. Use [nvm](https://github.com/nvm-sh/nvm), or run `npm config set prefix ~/.npm-global` and add `~/.npm-global/bin` to your `PATH`. Don't use `sudo`.
100
+ - **An agent says "not signed in":** `huddle setup` walks you through it, or run the sign-in command `huddle doctor` shows next to it.
101
+ - **"Node.js 20 or newer":** `nvm install 22`, then install Huddle again.
102
+ - **Anything else:** `HUDDLE_DEBUG=1 huddle …` prints the full error.
package/README.md CHANGED
@@ -1,3 +1,377 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # 🏈 Huddle
4
+
5
+ ### The multiplayer layer for AI coding agents.
6
+
7
+ **One command. Every agent. One repo. Zero collisions.**
8
+
9
+ `npm install -g huddle-cli` → `huddle`
10
+
11
+ **New here? [QUICKSTART.md](QUICKSTART.md)** — install, first run, teammates, in one page.
12
+
13
+ </div>
14
+
15
+ ---
16
+
17
+ ## Get started (any computer)
18
+
19
+ You need **Node.js 20+** and **git**. Then:
20
+
21
+ ```bash
22
+ npm install -g huddle-cli # puts `huddle` on your PATH
23
+ huddle setup # checks node + git, installs and signs in the agents you pick
24
+
25
+ cd ~/some-git-repo
26
+ huddle # welcome → connects your agents → huddle ›
27
+ ```
28
+
29
+ Prefer a script? `install.sh` checks Node, npm, git and a root-owned npm folder first, then runs the same `npm install -g` (this URL works only once the GitHub repo is public; until then use the npm command above):
30
+
31
+ ```bash
32
+ curl -fsSL https://raw.githubusercontent.com/Preet37/Huddle/main/install.sh | sh
33
+ ```
34
+
35
+ **Agents.** Huddle drives the coding-agent CLIs you already use — Claude Code (`claude`), Codex (`codex`), Antigravity (`agy`), Cursor (`cursor-agent`), and Gemini CLI if it's installed. You need at least one. `huddle setup` (and the first `huddle`) offers to install any that are missing and to sign you in, **always asking first**; `huddle doctor` prints the exact install commands for your OS. Don't want one? `huddle agents skip cursor` keeps it off every run, even when installed; `huddle agents use cursor` undoes it.
36
+
37
+ **Windows:** works natively in PowerShell — the same two commands; `huddle setup` uses each agent's PowerShell installer. Fallback if anything fails: WSL (`wsl --install`, then the Linux steps). Details in [QUICKSTART.md](QUICKSTART.md#windows). Each agent signs in with its own account and bills to it — Huddle never sees or stores a credential.
38
+
39
+ **Not a git repo?** `huddle` offers to set one up (git init + a first commit). One-shot `huddle join "<goal>"` won't touch a non-repo folder.
40
+
41
+ **Updating:** `npm install -g huddle-cli` again · **Version:** `huddle --version` · **Remove:** `npm uninstall -g huddle-cli` (your repos keep their work; delete a repo's `.huddle/` folder to clear its board).
42
+
43
+ <details>
44
+ <summary>Troubleshooting a fresh install</summary>
45
+
46
+ - **`EACCES` from npm** — your Node's global folder is root-owned. Use a version manager ([nvm](https://github.com/nvm-sh/nvm)), or `npm config set prefix ~/.npm-global` and add `~/.npm-global/bin` to `PATH`. Don't `sudo npm`.
47
+ - **"couldn't open its room database (SQLite)"** — the room db uses `better-sqlite3`, a native module that normally downloads a prebuilt binary. If it couldn't (offline, unusual platform, Node upgraded after install), reinstall with `npm install -g huddle-cli`. On **Node 22.13+** Huddle falls back to Node's built-in SQLite automatically, so nothing needs building.
48
+ - **`huddle needs Node.js 20 or newer`** — update Node (`nvm install 22`), then reinstall.
49
+ - **An agent shows "not signed in"** — run the command `huddle doctor` prints next to it (e.g. `codex login`), then `huddle doctor` again.
50
+ - Anything else: `HUDDLE_DEBUG=1 huddle …` prints the full stack.
51
+
52
+ </details>
53
+
54
+ ### From source (contributors)
55
+
56
+ ```bash
57
+ git clone https://github.com/Preet37/Huddle.git && cd Huddle
58
+ npm install && npm link # builds dist/ and links `huddle`
59
+ npm test # no tokens spent — mock agents (test/README.md)
60
+ ```
61
+
62
+ ## Using it
63
+
64
+ At the `huddle ›` prompt, type what you want built. Huddle plans it into parallel tasks, runs your agents at the same time (each in its own sandbox), merges finished work when tests pass, and ends with a "what you got" report. Ask a question (`where are we with this project?`) and it answers read-only instead.
65
+
66
+ - **shift+tab** switches mode: `manual` (approve the plan and each merge) → `auto` → `plan` (dry run)
67
+ - **`approvals safe|auto|yolo`** sets what agents may do without asking
68
+ - keep typing while agents work: `board`, questions, and new goals (queued) all work mid-run
69
+ - `cd`, `!cmd`, `clear` behave like a shell; not a git repo? Huddle offers to set it up
70
+
71
+ **How the agents work together on a big goal:**
72
+
73
+ - **Council.** Each agent proposes a design, then reads the others' and answers `ADOPT` (what a teammate got right that it missed), `FLAW` (what a teammate got wrong, and why) and `REVISED`. The agent whose ideas were adopted by the most teammates writes the plan (ties: the most adoptions in all, then the fewest flaws found, then whoever has written fewest plans); the brain writes it if nobody adopted anything. Each task records whose idea it was.
74
+ - **Contract.** The plan comes with a contract: the exact shared names (files and owners, signatures, data fields, routes, error strings). The other agents reply `OK` or `OBJECT: <change>`, with one revision round. It's committed as `HUDDLE_CONTRACT.md` and included in every task prompt. To change a name mid-task an agent calls `huddle_amend_contract`, and everyone still working is told.
75
+ - **Mid-task mail.** Every Plug call result includes the agent's new messages. Claude also gets them after any tool use, through a hook. Agents report progress at about 25/50/75%.
76
+ - **Radar.** About every 20s Huddle compares the uncommitted work of the agents in flight. It looks for edits to the same lines, and for imports of a name the other agent's module doesn't export (`getItems` vs `listItems`). It tells both agents while they can still fix it. Turn it off with `HUDDLE_RADAR_SEC=off`.
77
+ - **Buddy checks.** At about 40% (and again at 75% if there were notes), another agent reads the work in progress. It checks it against the task, the contract and the other tasks in flight, and its notes go to the author's inbox. An agent that finishes while a check is still being written waits for it. An agent that never reports progress gets its check after 2 minutes instead (`HUDDLE_BUDDY_AFTER_SEC`). Turn it off with `HUDDLE_BUDDY=off`.
78
+ - **Notes need an answer.** A buddy note or a radar finding stays open until the author fixes the file it names or replies to it (`won't fix: <why>` counts). `huddle_done` with notes still open is refused once, with the list; the second `huddle_done` always goes through, and the note is recorded as ignored.
79
+ - **Pairing.** When an agent is free and a task is under 50% done (one that never reports progress only after twice the help wait, with little of its file list started), the free agent proposes taking a separate part of it, or its tests. The author has 60s to say no.
80
+ - `huddle story` shows all of this afterwards: who adopted whose idea, who objected, contract versions, what the radar caught, buddy notes (addressed or ignored), and pairs.
81
+
82
+ None of these steps blocks the run. If an agent doesn't answer or doesn't follow the format, the run continues as it would without that step.
83
+
84
+ **Pasting and files: one shared screen, not N copies.** Paste a stack trace, a doc or a block of code at the prompt and it becomes one item on the Room's *shared screen* (`📎 pasted 214 lines (ctx-3 'TypeError…')`) instead of 214 commands; what you type next is the goal. Drag a file or screenshot into the terminal, or `add <file|folder|glob>`. Prompts carry only a one-line index per item; the planner links items to the tasks that need them, and agents open them with `huddle_context_read` (400 lines a call, images and PDFs as a file path; Codex also gets linked screenshots via `--image`), search them, and pin notes on them that everyone sees. `ctx` lists the screen (`ctx show|rm|note|clear`). Likely secrets (API keys, tokens, private keys, `.env` lines) are flagged before anything is shown to agents, and redacted unless you say no. One-shot: `huddle join "fix this" --with error.log --with shot.png`, or `cat log.txt | huddle join "fix this"`. Items live in `.huddle/context/` (git-ignored); caps: 2 MB of text, 25 MB per file, 200 MB in all (`HUDDLE_CTX_MAX_*_MB`).
85
+
86
+ **Running claude, codex and cursor yourself, in one repo at once (attach mode):**
87
+
88
+ ```bash
89
+ huddle connect # shows the project config files it will write per agent, asks, then wires each one in
90
+ # (git-excluded, backed up, never your global configs; `huddle disconnect` undoes it)
91
+ claude # open your agents as usual, in as many terminals as you like
92
+ huddle peers # who's live, what each is doing, which files each one holds
93
+ ```
94
+
95
+ Each session checks in before editing, claims the files it's about to change, and gets warned (Claude: asked through its own permission prompt) when another session holds them. Sessions can leave each other notes. The shared screen works here too: `huddle add err.log` (or `cat err.log | huddle add -`) from any terminal puts it up, every session hears `📎 new on the screen: ctx-4 …` on its next Huddle call and reads it with `huddle_context_read`; `huddle ctx` lists it (`show|rm|note|clear`). Want each session on its own branch instead? `huddle attach codex` opens it in a worktree, and `huddle land` tests and merges it. Live-verified for Claude and Codex; Cursor checks in but hasn't finished a live attach run yet (see STATUS).
96
+
97
+ **With a team:** `invite @harsh` in your Huddle; Harsh installs Huddle the same way and runs the `huddle join …` line it prints, from his clone of the repo. His agents take tasks off your board, work on his machine with his accounts, and push branches you test, review and merge. Different networks? `huddle relay` somewhere and `relay <url>`.
98
+
99
+ What's real today vs. designed: **[docs/STATUS.md](docs/STATUS.md)**.
100
+
101
+ ---
102
+
103
+ ## The one-sentence pitch
104
+
105
+ You already pay for Claude Code, Codex, Gemini CLI, and Cursor — but you run them **one at a time**, because they can't see each other and would trash the same repo. **Huddle puts all of them in the same room**: they split the work, each codes in its own invisible sandbox, they watch each other's progress live, and nothing merges until the tests pass. You stop waiting. You stop babysitting. You never touch git.
106
+
107
+ ---
108
+
109
+ ## The problem (in your words)
110
+
111
+ > "I have Claude, I have Codex, I have Gemini, I have Cursor. I tend not to use Gemini or Cursor if Claude is running, and I try not to use Codex when Claude is running because it's doing something. I don't know what Cursor is going to do versus Codex versus Claude."
112
+
113
+ That's the whole problem in one paragraph. It isn't a *team* problem. It's **one person with four agents who are blind to each other.** So you serialize them by hand — which means you're paying for four engines and running one.
114
+
115
+ The deeper version, for teams:
116
+
117
+ > "I'm person A working on one portion. Person B is on another. I don't know what B is doing until B pushes to git. I could be done and just *waiting*."
118
+
119
+ Both are the **same coordination problem**: no shared awareness, no shared plan, no shared memory. Git only tells you what happened *after* it happened.
120
+
121
+ ```mermaid
122
+ %%{init: {'theme':'dark'}}%%
123
+ flowchart LR
124
+ subgraph today["❌ Today — blind & serialized"]
125
+ direction TB
126
+ You1["👤 You"] -->|"run one,<br/>wait, run next"| C1["Claude"]
127
+ C1 -.->|"finishes"| X1["Codex"]
128
+ X1 -.->|"finishes"| G1["Gemini"]
129
+ G1 -.->|"finishes"| U1["Cursor"]
130
+ note1["Agents can't see each other.<br/>You are the message bus.<br/>3 engines idle at all times."]
131
+ end
132
+
133
+ subgraph huddle["✅ With Huddle — parallel & aware"]
134
+ direction TB
135
+ Room(("🏈 Huddle<br/>Room"))
136
+ Ca["Claude"] <--> Room
137
+ Xa["Codex"] <--> Room
138
+ Ga["Gemini"] <--> Room
139
+ Ua["Cursor"] <--> Room
140
+ note2["Shared plan · shared memory · live progress.<br/>All engines running. No collisions."]
141
+ end
142
+
143
+ today ==> huddle
144
+ ```
145
+
146
+ ---
147
+
148
+ ## What Huddle actually is
149
+
150
+ Huddle is **not** a new editor, and **not** a new agent. It's a thin neutral layer that sits *above* the agents you already use. Three moving parts:
151
+
152
+ ```mermaid
153
+ %%{init: {'theme':'dark'}}%%
154
+ flowchart TB
155
+ subgraph laptop["Your laptop"]
156
+ CLI["🧰 huddle CLI<br/><i>the daemon</i>"]
157
+ Room[("🏈 The Room<br/>SQLite + WebSocket<br/><i>tasks · progress · shared memory</i>")]
158
+ subgraph agents["Your agents — unchanged"]
159
+ A1["Claude Code"]
160
+ A2["Codex"]
161
+ A3["Gemini CLI"]
162
+ A4["Cursor Agent"]
163
+ end
164
+ MCP["🔌 The Plug<br/><i>one MCP server</i>"]
165
+ subgraph boxes["Isolated sandboxes (git worktrees)"]
166
+ W1["worktree/claude"]
167
+ W2["worktree/codex"]
168
+ W3["worktree/gemini"]
169
+ end
170
+ end
171
+
172
+ CLI --> Room
173
+ CLI --> MCP
174
+ A1 & A2 & A3 & A4 -->|"speak MCP"| MCP
175
+ MCP <--> Room
176
+ CLI -->|"spawns each agent in"| boxes
177
+ A1 --> W1
178
+ A2 --> W2
179
+ A3 --> W3
180
+ boxes -->|"tests pass → merge"| main["🌳 main branch"]
181
+
182
+ style Room fill:#3b1f6e,stroke:#a78bfa,color:#fff
183
+ style MCP fill:#1e3a5f,stroke:#60a5fa,color:#fff
184
+ ```
185
+
186
+ **1. The Room** — a tiny local server + a single-file SQLite database. It holds the task board, who claimed what, live progress, and *shared memory* (decisions + the "why" behind them). Think group chat + whiteboard + kanban, but for agents.
187
+
188
+ **2. The Plug** — one [MCP](https://modelcontextprotocol.io) server. MCP is the "USB-C for AI tools": Claude, Codex, Gemini, and Cursor **all already speak it**. We build the plug once, and every agent instantly gains new verbs: *see the board, claim a task, announce a plan, post progress, read shared memory, check what everyone else is doing, mark done.* This is why Huddle works **without switching tools**.
189
+
190
+ **3. The Sandboxes** — when an agent claims a task, Huddle silently gives it its own [git worktree](https://git-scm.com/docs/git-worktree): a separate working copy of the repo. Agents physically cannot corrupt each other's files. Git is the plumbing; **you never see it**. Work only rejoins `main` when tests are green.
191
+
192
+ > **The reframe that matters:** we don't kill git — we *hide* it. "Git is dead" is a claim engineers argue with. **"You never have to touch git again"** is a claim they pay for.
193
+
194
+ ---
195
+
196
+ ## The magic loop
197
+
198
+ ```mermaid
199
+ %%{init: {'theme':'dark'}}%%
200
+ sequenceDiagram
201
+ autonumber
202
+ participant You
203
+ participant Orch as 🧠 Orchestrator<br/>(Opus 5.5)
204
+ participant Room as 🏈 Room
205
+ participant Claude
206
+ participant Codex
207
+ participant Gemini
208
+
209
+ You->>Orch: "Build the checkout flow"
210
+ Orch->>Orch: decompose into tasks +<br/>route by strength
211
+ Orch->>Room: post task board
212
+ par Everyone reads the same board
213
+ Claude->>Room: claim "payment UI" (best at frontend)
214
+ Codex->>Room: claim "Stripe integration"
215
+ Gemini->>Room: claim "order-confirmation email"
216
+ end
217
+ Note over Claude,Gemini: each works in its own sandbox
218
+ Claude->>Room: announce plan → "renaming Cart type"
219
+ Codex->>Room: reads memory → "Cart type is changing, I'll wait / adapt"
220
+ Note over Room: ⚠️ collision predicted BEFORE it happens
221
+ Codex->>Room: progress 40% · 60% · done ✅
222
+ Codex->>Room: tests green → merged to main
223
+ Claude->>Room: I'm free — what's backlogged?
224
+ Room-->>Claude: steal "email template" (Gemini is slow)
225
+ Note over You,Gemini: You watch one dashboard.<br/>No engine sits idle.
226
+ ```
227
+
228
+ Five behaviors fall out of this loop — the ones you called for:
229
+
230
+ | Behavior | What it does | Where it lives |
231
+ |---|---|---|
232
+ | **Talk it out first** | Agents announce plans before coding: "I'll take auth, you take the DB." | Room + Plug |
233
+ | **Live awareness** | Your agent sees a teammate's piece is 70% done and lines up the next step. No waiting on a push. | Room (WebSocket) |
234
+ | **Collision radar** | Two agents about to edit the same symbol? Flagged *before* a line is written. | Overlap detector |
235
+ | **Shared memory** | My agent knows *why* your agent renamed that function, not just *what* changed. | Room (`memory` table) |
236
+ | **Work-stealing** | An idle agent grabs backlogged tasks from a busy one — the bottleneck removed automatically. | Scheduler |
237
+
238
+ ---
239
+
240
+ ## The account problem — designed for from day one
241
+
242
+ Real setups are messy: some agents are on a personal account, one comes through school or work, and subscriptions start and lapse month to month.
243
+
244
+ **Huddle never handles a single credential.** That's the core design decision, and it's what makes it survive every subscription change.
245
+
246
+ Each vendor CLI (`claude`, `codex`, `gemini`, `cursor-agent`) already logs in **its own way, to its own account** — Claude to your personal Anthropic login, Cursor to your school or work SSO, etc. Huddle treats each as a **black box it launches**, not an account it owns. It only ever asks two questions: *are you installed?* and *are you logged in?*
247
+
248
+ ```mermaid
249
+ %%{init: {'theme':'dark'}}%%
250
+ flowchart TB
251
+ Roster["📇 roster.toml<br/><i>which agents exist,<br/>which model each maps to</i>"]
252
+ Doctor["🩺 huddle doctor<br/><i>runs on every join</i>"]
253
+
254
+ Roster --> Doctor
255
+ Doctor --> Q1{"claude<br/>installed +<br/>authed?"}
256
+ Doctor --> Q2{"codex?"}
257
+ Doctor --> Q3{"gemini?"}
258
+ Doctor --> Q4{"cursor-agent?"}
259
+
260
+ Q1 -->|"✅ personal acct"| Pool["🏈 Active roster<br/>for this session"]
261
+ Q2 -->|"✅ personal acct"| Pool
262
+ Q3 -->|"✅ personal acct"| Pool
263
+ Q4 -->|"✅ school / work SSO"| Pool
264
+ Q4 -.->|"❌ expired?"| Skip["gracefully skipped<br/>— session still runs"]
265
+
266
+ Pool --> Session["huddle join 🚀"]
267
+
268
+ style Roster fill:#3b1f6e,stroke:#a78bfa,color:#fff
269
+ style Pool fill:#14532d,stroke:#4ade80,color:#fff
270
+ ```
271
+
272
+ **Why this survives all of that:**
273
+
274
+ - **Different accounts?** Each CLI carries its own login. Huddle doesn't care that one agent is on a work account and the rest are personal — it just shells out to `cursor-agent` and that binary knows who it is.
275
+ - **Subscription expires next month?** `huddle doctor` sees the auth check fail, drops that agent from the roster, and the session runs with whoever's left. Nothing breaks.
276
+ - **You get GPT/Codex back later?** Reinstall the CLI, log in, and it reappears in the roster automatically. Zero Huddle config change.
277
+ - **A vendor ships a new CLI or renames flags?** Only that one **adapter file** changes (~30 lines). The Room, Plug, and everything else are untouched. See [`docs/ADAPTERS.md`](docs/ADAPTERS.md).
278
+
279
+ Each agent is described by a small **adapter** — a declaration of "how do I launch you, and how do I hand you the Plug?" That's the entire vendor-specific surface area.
280
+
281
+ ---
282
+
283
+ ## The agent architecture (Opus 5.5 orchestrator + Fable/Opus workers)
284
+
285
+ You wanted every agent to be a top-tier model — an **Opus 5.5 orchestrator** with **Fable / Opus 5.5** workers, not cheap subagents. That's the design: a strategist that never writes code, and a pool of elite executors.
286
+
287
+ ```mermaid
288
+ %%{init: {'theme':'dark'}}%%
289
+ flowchart TB
290
+ You["👤 You: one goal"] --> Orch
291
+
292
+ subgraph brain["🧠 Orchestrator — Opus 5.5"]
293
+ Orch["Decompose goal → tasks<br/>Route by model strength<br/>Predict conflicts<br/>Rebalance the queue"]
294
+ end
295
+
296
+ Orch --> Board[("🏈 Task Board")]
297
+
298
+ subgraph workers["⚡ Worker pool — Opus 5.5 / Fable, routed by strength"]
299
+ direction LR
300
+ Wf["Fable<br/><i>fast execution,<br/>breadth</i>"]
301
+ Wo["Opus 5.5<br/><i>hard reasoning,<br/>architecture</i>"]
302
+ Wr["Opus 5.5 (reviewer)<br/><i>adversarial check</i>"]
303
+ end
304
+
305
+ Board --> Wf & Wo
306
+ Wf & Wo --> Wr
307
+ Wr -->|"✅ approved + tests green"| Merge["merge → main"]
308
+ Wr -->|"❌ found a bug"| Board
309
+
310
+ style Orch fill:#3b1f6e,stroke:#a78bfa,color:#fff
311
+ style Wr fill:#5b2121,stroke:#f87171,color:#fff
312
+ ```
313
+
314
+ The orchestrator maps to Claude Code's native pattern (Opus 5.5 orchestrating, spawning workers), and the *same* Room lets **external** agents (Codex, Gemini, Cursor) join the exact same board as first-class workers. One brain, many hands, mixed vendors.
315
+
316
+ > **Guardrail:** agents advising each other raises quality, but two models can also talk each other *into* the same wrong answer. So **tests — not agent consensus — are the referee.** Nothing merges on vibes.
317
+
318
+ ---
319
+
320
+ ## Why nobody has shipped this (and why now)
321
+
322
+ - **Real-time shared coding was tried for *humans*** — VS Code Live Share, Replit multiplayer, Zed — and never became the default, because humans coordinate fine by *talking*. A daily pull request was good enough.
323
+ - **Agents broke that math.** One person now runs four agents that type faster than any human and are blind to each other. Coordination went from *annoying* to *the actual bottleneck* — and only in the last year, once agents got trustworthy enough to run in parallel.
324
+ - **The labs won't build the neutral version.** Anthropic wants you on Claude; OpenAI wants you on Codex. Neither is motivated to make its agent cooperate with a rival's. **A neutral middle layer is exactly the gap a small team can own.**
325
+
326
+ So it's not that it was tried and failed. **The problem is new.**
327
+
328
+ ---
329
+
330
+ ## Honest hard parts (we're not hiding these)
331
+
332
+ - **Agents forget to check the room.** Mitigation: the Plug injects "check the board before you start and after each step" into the launch prompt, and the daemon nudges idle agents.
333
+ - **Merges can still break** when two "separate" tasks were secretly coupled. Mitigation: the overlap detector + tests-as-referee catch most; a human approves the rest.
334
+ - **Shared resources outside code** — same port, same dev DB, same package version. Mitigation: the Room brokers a lease on shared resources (ports, migrations).
335
+ - **Cost & rate limits multiply** with four agents. Mitigation: per-agent budgets + a live spend meter; the orchestrator throttles.
336
+ - **Token savings are a *maybe*, not a promise.** Fewer duplicated efforts and less re-reading save tokens; checking the room and cross-advising spend them. **We pitch "less wasted work," and we'll only claim token savings once we've measured them.**
337
+
338
+ ---
339
+
340
+ ## Where this is going
341
+
342
+ ```mermaid
343
+ %%{init: {'theme':'dark'}}%%
344
+ timeline
345
+ title Huddle roadmap
346
+ V0 · You + your laptop : Claude + Codex, one repo : split a task, see each other, auto-merge : (you are your own first customer)
347
+ V1 · Full local roster : Gemini + Cursor adapters : work-stealing + collision radar : live TUI dashboard
348
+ V2 · Two humans : Room moves to the cloud : your agents + your teammate's, same board : no more "waiting on a push"
349
+ V3 · Teams & trust : self-hosted Room for companies : replay log + budgets + approvals : the coordination layer for agentic teams
350
+ ```
351
+
352
+ **V0 is the wedge**: just *you*, on one laptop, Claude and Codex splitting a task in the same repo without colliding. If that feels magical to you, adding a second human is mostly moving the Room to the cloud.
353
+
354
+ ---
355
+
356
+ ## Repo map
357
+
358
+ | Path | What's inside |
359
+ |---|---|
360
+ | [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) | Deep dive: the Room schema, the Plug's MCP verbs, the sandbox/merge model, data flow diagrams. |
361
+ | [`docs/ADAPTERS.md`](docs/ADAPTERS.md) | The account/auth strategy in full — how Huddle stays alive as your subscriptions change. |
362
+ | [`docs/STATUS.md`](docs/STATUS.md) | **What's built right now**, verified status per component, and the changelog. Updated with every change. |
363
+ | [`docs/MULTIPLAYER.md`](docs/MULTIPLAYER.md) | V2 design: crews on different laptops, the Room relay, security, invite/join/leave, no-idle agents. |
364
+ | [`docs/ROADMAP.md`](docs/ROADMAP.md) | Build order, V0→V3, and what's a demo vs. what's real. |
365
+ | `src/` | The runnable prototype — app (`src/ui`), Room, Plug, scheduler, sandboxes, adapters. |
366
+ | `install.sh` | One-line installer for the `huddle` CLI. |
367
+ | `teaser/` | The cinematic teaser page (screen-record → video). |
368
+
369
+ ---
370
+
371
+ <div align="center">
372
+
373
+ **Huddle** — your agents, in the same room.
374
+
375
+ *Built as a working prototype + full design. Not vaporware.*
376
+
377
+ </div>
@@ -0,0 +1,40 @@
1
+ import { ampUsage } from "./usage.js";
2
+ // Amp (Sourcegraph) — headless via execute mode, `amp -x`. The Plug is passed
3
+ // inline with --mcp-config '{"huddle": {...}}', which "specif[ies] an MCP server
4
+ // without changing your settings file". Auth is Amp's own (`amp login`, or
5
+ // AMP_API_KEY).
6
+ //
7
+ // Sources (checked 2026-10):
8
+ // https://ampcode.com/docs/cli install script, amp login, AMP_API_KEY
9
+ // https://ampcode.com/docs/cli/execute-mode -x/--execute, --mcp-config '{"name": {"command", "args"}}'
10
+ // https://ampcode.com/docs/cli/streaming-json --stream-json (needs --execute), message schema with usage
11
+ // https://ampcode.com/news/amp-x -x runs tools (renames files) without stopping to ask
12
+ // Amp picks models by mode, not by a model flag, so Huddle passes none.
13
+ // Approvals: Amp doesn't ask before running tools by default, so all three
14
+ // Huddle modes run the same; the worktree is the fence. Unverified: whether
15
+ // --mcp-config honors "env" (it's sent anyway; the agent's own env has the
16
+ // same values, which stdio servers normally inherit). Not yet run live.
17
+ export const ampAdapter = {
18
+ id: "amp",
19
+ vendor: "sourcegraph",
20
+ bin: "amp",
21
+ roles: ["worker", "reviewer"],
22
+ prefers: ["refactor", "backend", "frontend"],
23
+ models: { orchestrator: "", worker: "", fast: "", reviewer: "" },
24
+ accountNote: "your Amp account",
25
+ homepage: "https://ampcode.com/docs/cli",
26
+ optional: true,
27
+ install: { cmd: "curl -fsSL https://ampcode.com/install.sh | bash", win: null, login: ["amp", "login"] },
28
+ authProbe: {
29
+ cmd: ["amp", "--version"],
30
+ ok: (r) => r.code === 0,
31
+ fixHint: "run `amp login` (or set AMP_API_KEY)",
32
+ },
33
+ plug: {},
34
+ usage: ampUsage,
35
+ launch: ({ worktree, prompt, plug }) => ({
36
+ cmd: ["amp", "--mcp-config", JSON.stringify({ huddle: plug }), "-x", prompt, "--stream-json"],
37
+ cwd: worktree,
38
+ }),
39
+ };
40
+ //# sourceMappingURL=amp.js.map
@@ -0,0 +1,54 @@
1
+ import fs from "node:fs";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ import { agyUsage } from "./usage.js";
5
+ // Antigravity CLI (`agy`) — Google's terminal agent, which replaced Gemini CLI
6
+ // for personal Google accounts in June 2026. Headless via `-p`; MCP servers are
7
+ // read from .agents/mcp_config.json in the workspace, so the launcher writes
8
+ // the Plug there (and the merge engine keeps it out of commits).
9
+ // NOTE: flags taken from Antigravity docs; not yet verified on a real run.
10
+ const agyAuthed = () => Boolean(process.env.GEMINI_API_KEY) || fs.existsSync(path.join(os.homedir(), ".gemini", "antigravity-cli"));
11
+ export const antigravityAdapter = {
12
+ id: "antigravity",
13
+ vendor: "google",
14
+ bin: "agy",
15
+ roles: ["worker", "fast"],
16
+ prefers: ["research", "breadth", "docs", "data"],
17
+ models: { orchestrator: "", worker: "", fast: "", reviewer: "" },
18
+ accountNote: "personal Google",
19
+ install: {
20
+ // https://antigravity.google/docs/getting-started?tab=cli
21
+ cmd: "curl -fsSL https://antigravity.google/cli/install.sh | bash",
22
+ win: "irm https://antigravity.google/cli/install.ps1 | iex",
23
+ login: ["agy"],
24
+ // agy has no login subcommand — signing in happens inside its own chat UI.
25
+ loginNote: "Antigravity opens its own chat to sign you in — once your email shows at the top, press ctrl-c twice to come back to Huddle",
26
+ },
27
+ authProbe: {
28
+ cmd: ["agy", "--version"],
29
+ ok: (r) => r.code === 0,
30
+ check: agyAuthed,
31
+ fixHint: "run `agy` once and sign in with Google (or set GEMINI_API_KEY)",
32
+ },
33
+ plug: {
34
+ file: { path: ".agents/mcp_config.json", in: "worktree" },
35
+ entry: (plug) => ({ mcpServers: { huddle: plug } }),
36
+ },
37
+ ask: ({ prompt, cwd, model }) => ({ cmd: ["agy", "-p", prompt, "--mode", "plan", ...(model ? ["--model", model] : [])], cwd }),
38
+ usage: agyUsage,
39
+ launch: ({ worktree, prompt, model, approvals }) => ({
40
+ cmd: [
41
+ "agy",
42
+ "-p",
43
+ prompt,
44
+ "--output-format",
45
+ "stream-json", // so Huddle can count tokens
46
+ ...(model ? ["--model", model] : []),
47
+ ...(approvals === "safe" ? ["--mode", "accept-edits"] : []),
48
+ ...(approvals === "auto" ? ["--sandbox", "--dangerously-skip-permissions"] : []),
49
+ ...(approvals === "yolo" ? ["--dangerously-skip-permissions"] : []),
50
+ ],
51
+ cwd: worktree,
52
+ }),
53
+ };
54
+ //# sourceMappingURL=antigravity.js.map