zwarm 3.2.0__py3-none-any.whl → 3.3.0__py3-none-any.whl

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.
@@ -1,310 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: zwarm
3
- Version: 3.2.0
4
- Summary: Multi-Agent CLI Orchestration Research Platform
5
- Requires-Python: <3.14,>=3.13
6
- Requires-Dist: prompt-toolkit>=3.0.52
7
- Requires-Dist: python-dotenv>=1.0.0
8
- Requires-Dist: pyyaml>=6.0
9
- Requires-Dist: rich>=13.0.0
10
- Requires-Dist: typer>=0.9.0
11
- Requires-Dist: wbal>=0.5.8
12
- Description-Content-Type: text/markdown
13
-
14
- # zwarm
15
-
16
- Multi-agent CLI for orchestrating coding agents. Spawn, manage, and converse with multiple Codex sessions in parallel.
17
-
18
- ## Installation
19
-
20
- ```bash
21
- # From the workspace
22
- cd /path/to/labs
23
- uv sync
24
-
25
- # Or install directly
26
- uv pip install -e ./zwarm
27
- ```
28
-
29
- **Requirements:**
30
- - Python 3.13+
31
- - `codex` CLI installed and authenticated
32
-
33
- **Environment:**
34
- ```bash
35
- export OPENAI_API_KEY="sk-..." # Required for Codex
36
- export WEAVE_PROJECT="entity/zwarm" # Optional: Weave tracing
37
- ```
38
-
39
- ## Two Modes
40
-
41
- zwarm has two ways to orchestrate coding agents:
42
-
43
- | Mode | Who's in charge | Use case |
44
- |------|-----------------|----------|
45
- | `zwarm interactive` | **You** | Manual control, experimentation |
46
- | `zwarm orchestrate` | **LLM** | Autonomous task execution |
47
-
48
- Both use the **same underlying session manager** - the orchestrator LLM has access to the exact same tools you do.
49
-
50
- ---
51
-
52
- ## Interactive Mode
53
-
54
- **You are the orchestrator.** Spawn sessions, check on them, continue conversations.
55
-
56
- ```bash
57
- zwarm interactive
58
- ```
59
-
60
- ### Commands
61
-
62
- | Command | Description |
63
- |---------|-------------|
64
- | `spawn "task"` | Start a session (waits for completion) |
65
- | `spawn --async "task"` | Start async (returns immediately) |
66
- | `spawn -d /path "task"` | Start in specific directory |
67
- | `ls` | List all sessions |
68
- | `? <id>` | Quick peek: status + latest message |
69
- | `show <id>` | Full details: all messages, tokens, etc. |
70
- | `c <id> "msg"` | Continue conversation (waits) |
71
- | `ca <id> "msg"` | Continue async (returns immediately) |
72
- | `kill <id>` | Stop a running session |
73
- | `rm <id>` | Delete session entirely |
74
- | `killall` | Stop all running sessions |
75
- | `clean` | Remove sessions older than 7 days |
76
- | `q` | Quit |
77
-
78
- ### Example Session
79
-
80
- ```
81
- $ zwarm interactive
82
-
83
- > spawn "Add a login function to auth.py"
84
- ✓ Started session a1b2c3d4, waiting...
85
- [a1b2c3d4] codex (completed) - 32s
86
- Response: I've added a login function with JWT support...
87
-
88
- > spawn --async "Fix the type errors in utils.py"
89
- ✓ Session: b2c3d4e5 (running in background)
90
-
91
- > spawn --async "Add unit tests for auth.py"
92
- ✓ Session: c3d4e5f6 (running in background)
93
-
94
- > ls
95
- 1 running | 2 done
96
-
97
- ID │ │ T │ Task │ Updated │ Last Message
98
- a1b2c3d4 │ ✓ │ 1 │ Add a login function... │ 2m │ I've added a login function...
99
- b2c3d4e5 │ ✓ │ 1 │ Fix the type errors... │ 30s ★ │ Fixed 3 type errors in...
100
- c3d4e5f6 │ ● │ 1 │ Add unit tests... │ 5s │ (working...)
101
-
102
- > ? b2c3d4e5
103
- ✓ b2c3d4e5 Fixed 3 type errors: Optional[str] -> str | None, added missing...
104
-
105
- > c a1b2c3d4 "Now add password hashing with bcrypt"
106
- Continuing session a1b2c3d4...
107
- [a1b2c3d4] codex (completed) - 28s
108
- Response: Done! I've updated the login function to use bcrypt...
109
-
110
- > rm b2c3d4e5
111
- ✓ Deleted session b2c3d4e5
112
-
113
- > q
114
- ```
115
-
116
- ### Session Status Icons
117
-
118
- | Icon | Status |
119
- |------|--------|
120
- | `●` | Running |
121
- | `✓` | Completed |
122
- | `✗` | Failed |
123
- | `○` | Killed |
124
- | `★` | Recently completed (< 60s) |
125
-
126
- ---
127
-
128
- ## Orchestrate Mode
129
-
130
- **An LLM is the orchestrator.** Give it a task and it delegates to coding agents.
131
-
132
- ```bash
133
- zwarm orchestrate --task "Build a REST API with authentication"
134
- ```
135
-
136
- The orchestrator LLM uses the same tools available in interactive mode:
137
-
138
- | Tool | Description |
139
- |------|-------------|
140
- | `delegate(task, ...)` | Start a new session |
141
- | `converse(id, msg)` | Continue a conversation |
142
- | `peek_session(id)` | Quick status check |
143
- | `check_session(id)` | Full session details |
144
- | `list_sessions()` | List all sessions with `needs_attention` flags |
145
- | `end_session(id, delete=False)` | Kill/delete a session |
146
-
147
- ### Task Input
148
-
149
- ```bash
150
- # Direct
151
- zwarm orchestrate --task "Build a REST API"
152
-
153
- # From file
154
- zwarm orchestrate --task-file task.md
155
-
156
- # From stdin
157
- echo "Fix the bug in auth.py" | zwarm orchestrate
158
- ```
159
-
160
- ---
161
-
162
- ## Configuration
163
-
164
- zwarm looks for config in this order:
165
- 1. `--config` flag
166
- 2. `.zwarm/config.toml`
167
- 3. `config.toml` in working directory
168
-
169
- ### Minimal Config
170
-
171
- ```toml
172
- [weave]
173
- enabled = true
174
- project = "your-entity/zwarm"
175
-
176
- [executor]
177
- adapter = "codex_mcp"
178
- model = "gpt-5.1-codex-mini"
179
- ```
180
-
181
- ### Full Config Reference
182
-
183
- ```toml
184
- [orchestrator]
185
- lm = "gpt-5-mini"
186
- max_steps = 100
187
-
188
- [orchestrator.compaction]
189
- enabled = true
190
- max_tokens = 100000
191
- threshold_pct = 0.85
192
- target_pct = 0.7
193
-
194
- [executor]
195
- adapter = "codex_mcp"
196
- model = "gpt-5.1-codex-mini"
197
- sandbox = "workspace-write"
198
- timeout = 300
199
-
200
- [weave]
201
- enabled = true
202
- project = "your-entity/zwarm"
203
-
204
- [watchers]
205
- enabled = true
206
- watchers = [
207
- { name = "progress" },
208
- { name = "budget", config = { max_steps = 50, max_sessions = 10 } },
209
- { name = "delegation_reminder", config = { threshold = 10 } },
210
- ]
211
- ```
212
-
213
- ---
214
-
215
- ## Session Management
216
-
217
- Sessions are the core abstraction. Each session is a conversation with a Codex agent.
218
-
219
- ### Lifecycle
220
-
221
- ```
222
- spawn → running → completed/failed
223
-
224
- continue → running → completed
225
-
226
- continue → ...
227
- ```
228
-
229
- ### Storage
230
-
231
- ```
232
- .zwarm/sessions/<uuid>/
233
- ├── meta.json # Status, task, model, messages, tokens
234
- └── turns/
235
- ├── turn_1.jsonl # Raw codex output for turn 1
236
- ├── turn_2.jsonl # Output after first continue
237
- └── ...
238
- ```
239
-
240
- ### Sync vs Async
241
-
242
- | Mode | Spawn | Continue | Use case |
243
- |------|-------|----------|----------|
244
- | **Sync** | `spawn "task"` | `c id "msg"` | Sequential work, immediate feedback |
245
- | **Async** | `spawn --async "task"` | `ca id "msg"` | Parallel work, batch processing |
246
-
247
- Async sessions return immediately. Poll with `ls` or `?` to check status.
248
-
249
- ---
250
-
251
- ## Watchers
252
-
253
- Watchers monitor agent behavior and intervene when needed.
254
-
255
- | Watcher | Purpose |
256
- |---------|---------|
257
- | `progress` | Detects stuck/spinning agents |
258
- | `budget` | Enforces step/session limits |
259
- | `scope` | Detects scope creep |
260
- | `delegation_reminder` | Nudges orchestrator to delegate |
261
-
262
- Configure in `config.toml`:
263
-
264
- ```toml
265
- [watchers]
266
- enabled = true
267
- watchers = [
268
- { name = "progress" },
269
- { name = "budget", config = { max_steps = 50 } },
270
- ]
271
- ```
272
-
273
- ---
274
-
275
- ## CLI Reference
276
-
277
- ```bash
278
- zwarm init # Initialize .zwarm/ in current directory
279
- zwarm interactive # Start interactive REPL
280
- zwarm orchestrate # Start LLM orchestrator
281
- zwarm exec # Run single executor directly (testing)
282
- zwarm status # Show current state
283
- zwarm history # Show event history
284
- zwarm clean # Remove old sessions
285
- ```
286
-
287
- ---
288
-
289
- ## Project Structure
290
-
291
- ```
292
- zwarm/
293
- ├── src/zwarm/
294
- │ ├── sessions/ # Session management (core)
295
- │ │ ├── manager.py # CodexSessionManager
296
- │ │ └── __init__.py
297
- │ ├── tools/
298
- │ │ └── delegation.py # Orchestrator tools (delegate, converse, etc.)
299
- │ ├── cli/
300
- │ │ └── main.py # CLI commands and interactive REPL
301
- │ ├── core/
302
- │ │ ├── config.py # Configuration loading
303
- │ │ ├── compact.py # Context window management
304
- │ │ └── state.py # State persistence
305
- │ ├── watchers/ # Trajectory alignment
306
- │ └── orchestrator.py # Orchestrator agent
307
- ├── docs/
308
- │ └── INTERNALS.md # Technical architecture
309
- └── README.md
310
- ```
File without changes