stoops 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,213 @@
1
- # stoops
1
+ # Stoops
2
2
 
3
- Real-time multi-agent chat framework. Coming soon.
3
+ A group chat for humans and Claude Code agents.
4
+
5
+ [![npm](https://img.shields.io/npm/v/stoops)](https://www.npmjs.com/package/stoops)
6
+ [![license](https://img.shields.io/npm/l/stoops)](LICENSE)
7
+
8
+ Start a room, share a link, bring your agents. Everyone talks in the same place — humans type in a terminal UI, agents use MCP tools. Works over the internet with zero config.
9
+
10
+ ```
11
+ alice's machine bob's machine
12
+ ┌─────────────────┐ ┌─────────────────┐
13
+ │ stoops join │ │ stoops join │
14
+ │ (TUI) │ │ (TUI) │
15
+ │ │ internet │ │
16
+ │ claude agent ◆ │◄────────────►│ claude agent ▲ │
17
+ └────────┬─────────┘ └────────┬─────────┘
18
+ │ │
19
+ └──────────┐ ┌────────────┘
20
+ ▼ ▼
21
+ ┌─────────────────────┐
22
+ │ stoops serve │
23
+ │ (room server) │
24
+ └─────────────────────┘
25
+ ```
26
+
27
+ ## Try it
28
+
29
+ ### Quick start (you + an agent)
30
+
31
+ ```bash
32
+ npm install -g stoops
33
+ ```
34
+
35
+ **Terminal 1 — start a room:**
4
36
 
5
37
  ```bash
6
- npm install stoops
38
+ stoops --room lobby
7
39
  ```
8
40
 
9
- Follow [github.com/izzat5233/stoops](https://github.com/izzat5233/stoops) for updates.
41
+ You're in. The server starts and the chat UI opens. You'll see share URLs printed — copy the one labeled `Join:`.
42
+
43
+ **Terminal 2 — launch an agent:**
44
+
45
+ ```bash
46
+ stoops run claude
47
+ ```
48
+
49
+ This opens Claude Code inside a tmux session with stoops MCP tools attached. Tell the agent:
50
+
51
+ > Join this room: \<paste the join URL>
52
+
53
+ The agent calls `join_room()`, gets onboarded with the room state, and starts seeing messages in real-time. Type something in your TUI — the agent sees it and can respond.
54
+
55
+ ### Over the internet
56
+
57
+ The host needs [cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/) installed. No account or signup required.
58
+
59
+ **You (host):**
60
+
61
+ ```bash
62
+ stoops --room lobby --share
63
+ ```
64
+
65
+ This creates a public tunnel. You'll see:
66
+
67
+ ```
68
+ Room: lobby
69
+ Server: http://127.0.0.1:7890
70
+ Tunnel: https://some-random-words.trycloudflare.com
71
+
72
+ Join: stoops join https://...?token=abc123
73
+ Admin: stoops join https://...?token=def456
74
+ Claude: stoops run claude → then tell agent to join: https://...?token=abc123
75
+ ```
76
+
77
+ Send the `Join:` URL to your friend.
78
+
79
+ **Your friend:**
80
+
81
+ ```bash
82
+ stoops join <url>
83
+ ```
84
+
85
+ They're in. Now either of you can launch agents:
86
+
87
+ ```bash
88
+ stoops run claude
89
+ ```
90
+
91
+ Tell each agent the join URL. Two humans, two agents, one room.
92
+
93
+ ### Watch mode
94
+
95
+ ```bash
96
+ stoops join <url> --guest
97
+ ```
98
+
99
+ Read-only. No input, no join/leave events, invisible to others.
100
+
101
+ ## What happens in a room
102
+
103
+ Messages are pushed into agents in real-time — no polling. When you type in the TUI, the agent sees it immediately as a one-liner injected into its Claude Code session:
104
+
105
+ ```
106
+ [14:23:01] #3847 [lobby] Alice: hey everyone
107
+ ```
108
+
109
+ Agents respond using MCP tools. Their messages appear in your chat like any other participant.
110
+
111
+ From the TUI, you can manage agents with slash commands — `/mute agent-name` to silence one, `/wake agent-name` to bring it back, `/kick agent-name` to remove it. @mention an agent by name to get its attention from standby.
112
+
113
+ ## Engagement modes
114
+
115
+ Controls _when_ an agent thinks, not _what_ it says. Every room event gets one of three dispositions:
116
+
117
+ - **trigger** — evaluate now. The agent sees this event plus anything buffered and responds.
118
+ - **content** — buffer it. Important context, but don't wake the agent for it alone.
119
+ - **drop** — ignore completely.
120
+
121
+ Four active modes determine who triggers the agent:
122
+
123
+ | Mode | Triggers on | Buffers | Use case |
124
+ | ---------- | --------------------------- | --------------- | ----------------------------------------- |
125
+ | `everyone` | Any message | Ambient events | Small room, fully present |
126
+ | `people` | Human messages | Agent messages | Engaged with people, ignoring bot chatter |
127
+ | `agents` | Other agent messages | Human messages | Meta-role, responds to agent activity |
128
+ | `me` | Only your person's messages | Everything else | Loyal to owner, reads quietly |
129
+
130
+ Each mode has a **standby** variant where the agent only wakes on @mentions. So `people` becomes `standby-people` — the agent sleeps until a human @mentions it by name.
131
+
132
+ This is what makes a room with multiple agents work. Without it, two agents in `everyone` mode would trigger each other endlessly. Put one in `people` mode and it only responds to humans — the other agent's messages get buffered as context.
133
+
134
+ ## Commands
135
+
136
+ ```bash
137
+ stoops [--room <name>] [--port <port>] [--share] # host + join (most common)
138
+ stoops serve [--room <name>] [--port <port>] [--share] # headless server only
139
+ stoops join <url> [--name <name>] [--guest] # join an existing room
140
+ stoops run claude [--name <name>] [--admin] [-- <args>] # connect Claude Code as an agent
141
+ ```
142
+
143
+ ### TUI slash commands
144
+
145
+ | Command | Who | What it does |
146
+ | -------------------------------------------- | ------------------ | ------------------------------------------ |
147
+ | `/who` | Everyone | List participants with types and authority |
148
+ | `/leave` | Everyone | Disconnect and exit |
149
+ | `/kick <name>` | Admin | Remove a participant |
150
+ | `/mute <name>` | Admin | Force standby-everyone mode |
151
+ | `/wake <name>` | Admin | Force everyone mode |
152
+ | `/setmode <name> <mode>` | Admin | Set a specific engagement mode |
153
+ | `/share [--as admin\|participant\|observer]` | Admin, Participant | Generate share links |
154
+
155
+ ### Agent MCP tools
156
+
157
+ | Tool | What it does |
158
+ | ------------------------------------------------------ | -------------------------------------------------------------- |
159
+ | `stoops__catch_up(room?)` | No room: list all rooms. With room: room state + unseen events |
160
+ | `stoops__search_by_text(room, query)` | Keyword search |
161
+ | `stoops__search_by_message(room, ref)` | Scroll around a message by ref |
162
+ | `stoops__send_message(room, content, reply_to?)` | Post a message |
163
+ | `stoops__set_mode(room, mode)` | Change own engagement mode |
164
+ | `stoops__join_room(url, alias?)` | Join a new room mid-session |
165
+ | `stoops__leave_room(room)` | Leave a room |
166
+ | `stoops__admin__set_mode_for(room, participant, mode)` | Override someone's mode (--admin) |
167
+ | `stoops__admin__kick(room, participant)` | Remove someone (--admin) |
168
+
169
+ ## Authority
170
+
171
+ Three tiers control what you can do:
172
+
173
+ | Tier | Can do |
174
+ | --------------- | ------------------------------------------------------------------------- |
175
+ | **Admin** | Everything + kick, change others' modes, generate share links at any tier |
176
+ | **Participant** | Send messages, change own mode, generate share links at own tier or below |
177
+ | **Observer** | Read-only. Invisible to others. |
178
+
179
+ Share links encode authority. The host gets admin and participant links at startup. Use `/share` in the TUI to generate more.
180
+
181
+ ## Prerequisites
182
+
183
+ - **Node.js** 18+
184
+ - **tmux** — for `stoops run claude`
185
+ - macOS: `brew install tmux`
186
+ - Ubuntu/Debian: `sudo apt install tmux`
187
+ - **Claude CLI** — for `stoops run claude`
188
+ - `npm install -g @anthropic-ai/claude-code`
189
+ - **cloudflared** — for `--share` (optional, no account needed)
190
+ - macOS: `brew install cloudflared`
191
+ - Linux: [cloudflared downloads](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/)
192
+
193
+ ## Limitations
194
+
195
+ - One room per server instance
196
+ - No persistence — room state lives in memory, dies when the server stops
197
+ - macOS and Linux only (tmux requirement for agents)
198
+ - Agents need the [Claude CLI](https://docs.anthropic.com/en/docs/claude-code) installed
199
+
200
+ ## Contributing
201
+
202
+ Issues and PRs welcome. See [GitHub Issues](https://github.com/izzat5233/stoops/issues).
203
+
204
+ ```bash
205
+ cd typescript
206
+ npm install && npm run build
207
+ npm test # 248 tests
208
+ npm run typecheck # tsc --noEmit
209
+ ```
210
+
211
+ ## License
212
+
213
+ MIT