@a-t-h-i/bot-lobby 0.6.16 → 0.6.18

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,30 +1,8 @@
1
1
  # Bot-Lobby
2
2
 
3
- A [Pi](https://pi.dev) extension that forces you to vibe code intentionally.
4
- You still describe what you want in plain words, but you don't just hand it
5
- over: you and the model work out together what's needed until the picture is
6
- clear, and then a multi-agent software team builds what you agreed on.
7
-
8
- ![The Lobby tab: your conversation with the oracle, the activity log of every agent, and their latest thoughts](https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/gallery.png)
9
-
10
- `/bot-lobby <request>` (or a request typed in the lobby) starts a task, unless
11
- one agent can simply do it: then it goes to the [quick-fix agent](#quick-fix-or-the-team).
12
- For a task, your Pi session becomes the **Master**
13
- (the "oracle"): it scouts the codebase, proposes a plan, and delegates the
14
- work to three domain agents — **Designer+Frontend**, **Backend** and **QA** —
15
- each running in its own isolated `pi` process. QA's reviewer is the quality
16
- gate before anything is marked done. QA reviews adversarially (it tries to
17
- break the change) and writes as few tests as it can: only for a breaking
18
- change, for behavior that could turn out unpredictable, or when asked.
19
-
20
- The rule: **you decide with the LLMs, and the engine enforces.** Agents
21
- propose; you shape and approve the plan with the oracle; the extension
22
- validates every state change, permission and approval through one
23
- `orchestrate` tool.
24
-
25
- The oracle is meant to be your most capable model; the agents can be smaller
26
- and cheaper ones. So it never assumes they are as capable as it is: it makes
27
- every decision itself and [briefs each agent in full](#briefing-the-agents).
3
+ A [Pi](https://pi.dev) extension for intentional, multi-agent software development.
4
+ Describe a change, agree on a plan with the oracle, and follow the domain agents in a local browser lobby.
5
+ The engine enforces approvals, domain boundaries and QA before completion.
28
6
 
29
7
  ## Install
30
8
 
@@ -32,681 +10,66 @@ every decision itself and [briefs each agent in full](#briefing-the-agents).
32
10
  pi install npm:@a-t-h-i/bot-lobby
33
11
  ```
34
12
 
35
- Try it once without installing: `pi -e npm:@a-t-h-i/bot-lobby`. From a source
36
- checkout: `pi -e ./src/index.ts` (keep `prompts/` next to `src/`).
37
-
38
- Nothing else to install: bot-lobby brings its own
39
- [questionnaire and web tools](#questions-and-the-web), and they work in plain
40
- Pi too, with or without a task. If you installed `pi-web-access` or
41
- `rpiv-ask-user-question` for bot-lobby, remove them: they register the same
42
- tool names.
13
+ Try without installing: `pi -e npm:@a-t-h-i/bot-lobby`.
14
+ From a checkout: `pi -e ./src/index.ts` (keep `prompts/` beside `src/`).
15
+ Questionnaire and web tools are included; don't also install extensions registering the same tool names.
43
16
 
44
17
  ## Quick start
45
18
 
46
- 1. `/bot-lobby add a login page` — starts a task; the lobby opens.
47
- 2. Answer the Master's questions, then approve its proposal.
48
- 3. Follow the agents in the lobby, a web page that opens in your browser when Pi starts: what they do, and what they think.
49
-
50
- The lobby's Settings page sets each agent's model, effort (a slider that skips
51
- what the model cannot do), time limit and extra instructions.
52
-
53
- ## Commands
54
-
55
- | Command | Does |
56
- | --- | --- |
57
- | `/bot-lobby` | Open the lobby in your browser (it already runs: the page starts with Pi) |
58
- | `/bot-lobby <request>` | Start a request: a [quick fix](#quick-fix-or-the-team) when one agent can do it alone, else a task (`--task` to always make it a task, also when it begins with a command word; `--auto` to run unattended, `--budget 90m` to give it a time budget, `--fast` / `--full` to pick its [track](#fast-track-or-full-workflow), `--branch` / `--worktree` / `--no-branch` to give it its own [git branch or worktree](#a-branch-or-worktree-per-task) or none) |
59
- | `/bot-lobby budget [90m\|off]` | Show or set this session's task time budget |
60
- | `/bot-lobby status \| tasks \| runs [id]` | Current task, all tasks, recent agent runs |
61
- | `/bot-lobby approve \| amend <text> \| decline` | Answer the proposal |
62
- | `/bot-lobby accept [id]` | Accept a task's work as it is, without a QA pass; the oracle then completes it |
63
- | `/bot-lobby pause \| resume \| cancel [id]` | Control a task |
64
- | `/bot-lobby auto [on\|off]` | Auto mode: the oracle finishes the task without asking (`alt+g` in Pi) |
65
- | `/bot-lobby claim <id>` | Take over a task another session owned |
66
- | `/bot-lobby start-plan PLAN-… [auto]` | Start a plan saved from the Plan tab |
67
- | `/bot-lobby settings \| config` | Edit settings / show the effective config |
68
- | `/bot-lobby knowledge` | Knowledge file sizes |
69
- | `/bot-lobby minimize \| restore` | Hide bot-lobby in this session (`ctrl+shift+m`) |
70
- | `/bot-lobby web` | Open the lobby page again (it starts with every interactive Pi session, on this machine only) and print its link |
71
- | `/bot-lobby web link` | Print the browser UI's link |
72
- | `/bot-lobby web stop` | Stop the page until the next session |
73
- | `/bot-lobby web reset` | Reset the browser UI's link (its old cookies stop working) |
74
-
75
- ## Quick fix or the team
76
-
77
- Before any task exists, bot-lobby asks whether **one agent can just do it**:
78
- in one file or one area, with nothing to agree between frontend and backend,
79
- no unfamiliar codebase to survey, nothing risky and no decision you must make
80
- first. [Jev](#the-classifier-jev) answers when it is on (`classifier.thresholds.quickFixAt`,
81
- 0.7); plain rules answer otherwise, and whenever Jev is unsure. A request that
82
- says it is self-contained ("a single page", "in one html file") counts even
83
- when it is rich.
84
-
85
- When it reads that way, the oracle confirms in one step, without reading
86
- files or planning (`route_request`), and says so: *this looks like a quick
87
- feature, the quick-fix agent is on it*. The lobby then hands the request to
88
- the quick-fix agent and switches to the **Quick fix** tab, where you follow
89
- it. No scouts, proposal, plan or QA. A quick feature (bigger than a small
90
- change, but in one place) runs on its builder's model, thinking and time limit
91
- (DESIGN's for a page) instead of the quick-fix defaults.
19
+ 1. Run `/bot-lobby add a login page` in Pi; the lobby opens in your browser.
20
+ 2. Answer the oracle's questions and approve its proposal, or use Plan to agree on a task first.
21
+ 3. Follow the agents in Lobby; configure models, effort and time limits in Settings.
92
22
 
93
- Everything else, or anything the oracle judges needs the team, starts as a
94
- task below. `--task` always makes a task; `workflow.routeQuickFixes: false`
95
- turns routing off. Without the lobby (a background session, RPC mode) every
96
- request is a task.
97
-
98
- ## How a task runs
99
-
100
- ```
101
- full workflow: request → clarify → scout → propose → approve → plan → implement → QA gate → complete
102
- fast track: request → implement (only the agents it needs) → QA, if it needs tests → complete
103
- ```
23
+ The Project selector switches among already-running, authorized project lobbies on one localhost origin.
24
+ Upgrading? Reattach older temporary files; previews and attachments are now isolated per project.
104
25
 
105
- ### Fast track or full workflow
26
+ Small self-contained changes can route to Quick fix. `--task` forces a task;
27
+ `--fast` / `--full` picks its workflow, and `--branch` / `--worktree` selects git isolation.
28
+ Completed isolated tasks push their branch and attempt a GitHub PR through `gh`.
29
+ Missing isolation, base branch, remote or authentication records a note without blocking completion; nothing auto-merges.
106
30
 
107
- The moment a task starts, bot-lobby reads the request and decides how serious
108
- it is: its size, who has to take part, and whether it takes the **fast
109
- track** or the **full workflow**. The read is instant and costs no tokens
110
- (plain rules, refined by [Jev](#the-classifier-jev) when that is on).
31
+ ## Agent split
111
32
 
112
- | The request… | Who takes part |
33
+ | Agent | Responsibility |
113
34
  | --- | --- |
114
- | changes anything that runs in the browser: screens, components, styles, copy, canvas or three.js graphics | DESIGN (frontend) |
115
- | changes an API, the database, auth, jobs or other server-side code | DEV (backend) |
116
- | needs tests: asks for them, fixes a bug, or changes backend logic | QA |
117
- | depends on outside facts: latest versions, docs, standards, third-party APIs | RESEARCH |
35
+ | Master / oracle | Your Pi session: questions, decisions, plan, delegation and approvals |
36
+ | DESIGN | Browser UI, frontend logic, styling and accessibility |
37
+ | DEV | Backend, APIs, data, security and integrations |
38
+ | QA | Targeted tests and the final quality gate |
39
+ | RESEARCH | External facts and cited evidence |
118
40
 
119
- A **small, clear, low-risk** request takes the fast track: the oracle hands
120
- it straight to those agents, with no scouts, no proposal to approve and no
121
- plan document (the engine keeps a short plan whose steps are the
122
- delegations, so the checklist still works). QA takes part only when the
123
- change needs tests (its worker writing and running them as the last step, or
124
- the QA gate); without it the task completes as soon as the work is in and
125
- checked. A copy change is one agent run.
41
+ The planning panel brings these domains together before implementation.
42
+ Own ordinary Plan messages and Task comments can be edited; Plan edits rerun the panel.
126
43
 
127
- Everything else takes the full workflow below: anything **medium or large**
128
- (a new page, flow or endpoint, a refactor, an upgrade, a vague or
129
- many-part request), **serious** whatever its size (security, auth,
130
- passwords, payments, migrations, production, personal data), or **unclear**
131
- (too short, vague, or asking to investigate first).
44
+ ## Shortcuts
132
45
 
133
- - The oracle glances at the read once and acts on it, or corrects it with
134
- `orchestrate action=track`: the full workflow for a change bigger than it
135
- reads, the fast track for one that is smaller (before its work is planned),
136
- or a member added or dropped.
137
- - Once work is under way a track only gets stricter: the full workflow or
138
- more members, never QA dropped. A fast task whose worker asks for a new
139
- dependency or an architecture change gets QA.
140
- - `/bot-lobby --fast <request>` or `--full <request>` decides it yourself;
141
- the oracle never moves a `--full` task to the fast track.
142
- `workflow.fastTrack: false` puts every task on the full workflow.
143
- - The track shows in the lobby's activity log, the task's details on the
144
- Tasks tab, and `/bot-lobby status`.
46
+ Browser navigation is ignored while typing, composing with an IME or using an overlay.
145
47
 
146
- ### Briefing the agents
147
-
148
- Every agent may run on a smaller, cheaper model than the oracle's, one that
149
- follows instructions well but does not infer intent. So the oracle writes
150
- each delegation (`implement`, `scout`, `research`) as a self-contained brief
151
- and settles every design and architecture decision itself first:
152
-
153
- - **Goal**, the exact **Files**, numbered **What to do** with names, shapes
154
- and values, the **Contracts** shared with other agents (repeated in full in
155
- each brief), **Constraints**, **Done when** (checkable criteria and the
156
- commands to run) and **If stuck**.
157
- - Plan steps are written to the same standard, so a brief is the plan step
158
- made explicit, never a new decision.
159
- - Every agent is told to follow its brief and the approved plan exactly, use
160
- the given names letter for letter, and report what does not match instead of
161
- guessing. Workers end their report with a **Brief Check**: each "Done when"
162
- item, met or not, with evidence.
163
- - The oracle holds each report to its brief. Drift, a skipped criterion or a
164
- guessed choice comes back as a fix step with a more explicit brief.
165
- - The engine backs it up: a delegation that names nothing concrete (or a long
166
- one with no done criteria) is sent back to the oracle once before any agent
167
- starts. Sending the same text again goes through, so a short task that is
168
- complete as written is never stuck. `workflow.briefCheck: false` turns it off.
169
-
170
- ### The full workflow
171
-
172
- - **Scouts** (read-only) investigate the domains the request touches.
173
- - The Master **proposes** a short bullet list; nothing is built until you
174
- approve it.
175
- - **Workers** implement plan steps, one domain each. Several can run in
176
- parallel; they share files through a **file desk** (claim a file, queue for
177
- a busy one, hand it over with a note).
178
- - The **QA gate** runs once at the end. A failed gate sends fixes back to the
179
- owning domain, a bounded number of times. Only critical or major findings
180
- fail it, and a re-review checks what the last round asked for instead of
181
- starting over. It reviews everything since the commit the task started
182
- from, so committed fixes still count. At the round limit you decide: accept
183
- the work as it is, one more round, or leave it blocked (`/bot-lobby accept`
184
- works any time). It knows who changed each file:
185
- this task's workers (**planned**), a **quick fix** you ran, work that was
186
- there before the task (**pre-existing**), another task, or no agent at all
187
- (**unattributed**, which the Master asks you about). Quick fixes are never
188
- treated as rogue changes or reverted.
189
- - A **researcher** can be summoned for cited web evidence, through
190
- bot-lobby's [web tools](#the-web).
191
-
192
- **Auto mode** approves proposals and answers clarifying questions for you;
193
- after three nudges without progress it pauses. A task started from a plan
194
- agreed in the Plan tab skips approval too.
195
-
196
- **Safety nets:** every agent has a time limit (asked to wrap up at 75%), a
197
- stall watchdog and one retry; `Esc` aborts every running agent.
198
-
199
- ## A branch or worktree per task
200
-
201
- Every task has a friendly name, made from the first words of its request and
202
- the day it started: `Task-Change-Table-Font-27-09-2026`. It is the task's id,
203
- the name of the session that drives it and, when you ask for one, its git
204
- branch.
205
-
206
- `workflow.gitIsolation` (or `--branch`, `--worktree`, `--no-branch` on one
207
- request; a **Git isolation** entry in `/bot-lobby settings`) decides what a new
208
- task gets. It is `off` by default.
209
-
210
- | Setting | A new task gets |
48
+ | Key | Action |
211
49
  | --- | --- |
212
- | `off` | nothing: it works in the folder you started it in |
213
- | `branch` | a branch named after it, created and checked out in the working folder (uncommitted work comes along) |
214
- | `worktree` | a second checkout of its own, `.pi/bot-lobby/worktrees/<name>`, on a branch named after it. **Every agent of the task runs there**, so tasks (and your own checkout) never trample each other's files; uncommitted changes in your checkout are not in it |
215
-
216
- - The name is made unique (`-2`, `-3`… when a branch or remote branch has it).
217
- - Git never stops a task: outside a repository, without a commit (a worktree
218
- needs one) or when a checkout is refused, the task runs without and says why.
219
- - The oracle is told where the work lives, the Tasks tab shows the branch and
220
- worktree, and the lobby's title shows the branch a task works on.
221
- - A worktree is kept when its task ends: merge or delete it yourself
222
- (`git worktree remove …`). One that was removed while its task runs is
223
- reported, and no agent is started in its place. bot-lobby adds the worktrees
224
- folder to `.git/info/exclude` (a local file) so `git add -A` skips it.
225
-
226
- ## Time budget
227
-
228
- `/bot-lobby --budget 90m <request>` (or `/bot-lobby budget 90m` on the task in
229
- hand, or `workflow.taskBudgetMinutes` for every task) gives a task 90 minutes
230
- of work time, for the oracle and every agent. The clock runs while the oracle
231
- works and stops while it waits on you.
232
-
233
- - The oracle divides the time by scope: each step gets its minutes, and the
234
- QA gate keeps a reserve. Every agent is told how long it has and gets a
235
- heads-up at 75%.
236
- - When a worker's time is up it stops, keeps its files consistent, and
237
- reports what it did, where it left off and how much more it needs. You are
238
- asked: *DEV was busy with …; left to do: …; it needs 10 more minutes.* Give
239
- it the time (or another amount) and the same agent carries on where it
240
- stopped, its context intact; or stop it there.
241
- - Once the budget is spent no new work starts: the oracle asks you for more
242
- (with a reason) or wraps up with what is done. Auto mode gives an agent more
243
- once, only from time the task still has, and never grows the budget.
244
- - The lobby shows `34m of 1h 30m`, and each agent's `12/30m`.
245
-
246
- **A fresh context per task.** Every agent runs in its own Pi process with its
247
- own context. The oracle, which is your session, starts each task clean: its
248
- model sees only the conversation since the task started, and once a task ends
249
- your next request starts fresh (the lobby shows *context cleared*, and the
250
- oracle is told where the finished task's record is). The session file keeps
251
- everything. `workflow.freshContext: false` in the config turns this off.
252
-
253
- ## The lobby
254
-
255
- bot-lobby is a web-only plugin. When Pi starts an interactive session it also
256
- starts the lobby, a page served on `127.0.0.1` (this machine only, behind a
257
- secret link), opens it in your browser and shows its address in Pi's status
258
- line. Nothing is drawn in the terminal but Pi itself.
259
-
260
- The page is a calm, glassy window in a light or a dark theme (the sun/moon
261
- button in its top row). The tabs are numbered pills joined by dotted lines; the
262
- lit pill glides to the tab you pick like a drop of water. Under the tabs, each
263
- tab is a pair of cards, a list on the left and the chosen item on the right.
264
- At the bottom floats **one text box for everything**: it grows as you type (or
265
- opens up to a tall editor), takes Markdown, and takes images, PDFs and other
266
- files (pick, paste or drop them, up to 20 MB each, eight per message). Who it
267
- talks to follows the tab: the oracle everywhere, the planning panel on Plan, a
268
- quick fix on Quick fix, a comment on the open task (or a message to its
269
- oracle) on Tasks, the picked session on Sessions. The oracle's questions pop
270
- up in the middle of the window over a blurred backdrop; there is only ever one
271
- pop-up, and one toast, on screen at a time. Activity and Thinking can be
272
- minimized to their title bar. `alt+h` lists every key.
273
-
274
- | Tab | What it is |
275
- | --- | --- |
276
- | **1 Lobby** | Your conversation with the oracle, an activity log of every agent's steps, and each agent's latest thought |
277
- | **2 Tasks** | Every task and saved plan as a checklist. Start a plan here or in a new session; comment on a plan (images welcome); archive or delete |
278
- | **3 Plan** | Plan a task with a panel of agents before building it (below) |
279
- | **4 Quick fix** | One agent makes a change right away, beside any running task; requests the oracle [routes here](#quick-fix-or-the-team) show up too |
280
- | **5 Metrics** | Run time, success rate, tokens and cost per model and agent |
281
- | **6 Git** | The repository's open pull requests; review one with an agent, or have Jev read it |
282
- | **7 Knowledge** | Everything each agent knows about the project; edit an entry, or leave a note every agent reads |
283
- | **8 Excalidraw** | Up to five shared Excalidraw sessions, each assigned to one agent or several, who read the board and draw on it with you |
284
-
285
- ### Lobby
286
-
287
- ![The Lobby tab](https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/gallery.png)
288
-
289
- Your conversation with the oracle on the left, the activity log of every
290
- agent's steps on the right, and the agents' latest thoughts below. Activity and
291
- Thinking fold down to their title bar; the box at the bottom steers the
292
- running turn.
293
-
294
- ### Tasks
295
-
296
- ![The Tasks tab](https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/lobby-tasks.png)
297
-
298
- Every task as a checklist, with its track, plan progress, the approved plan
299
- and your comments on it.
300
-
301
- ### Plan
302
-
303
- ![The Plan tab](https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/lobby-plan.png)
304
-
305
- The panel's questions, with their options, on the left; the draft plan
306
- on the right. See [Planning](#planning).
307
-
308
- ### Quick fix
309
-
310
- ![The Quick fix tab](https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/lobby-quickfix.png)
311
-
312
- One agent's jobs, each with its live steps, the files it edited and its
313
- report. See [Quick fix or the team](#quick-fix-or-the-team).
314
-
315
- ### Metrics
316
-
317
- ![The Metrics tab](https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/lobby-metrics.png)
318
-
319
- Run time, success rate, cost and tokens per model and agent, so you can see
320
- which cheaper models hold up.
321
-
322
- ### Git
323
-
324
- The repository's open pull requests through the GitHub CLI (`gh` owns sign-in;
325
- bot-lobby holds no token): the list with checks and size, and the
326
- selected one with its facts, files, description, reviews and comments.
327
-
328
- - **Review it with an agent**: a read-only agent on QA's model, thinking
329
- and time limit (and its custom instructions) gets the description, changed
330
- files and diff, may read the repository for context, and writes a review:
331
- verdict, summary, findings by severity (`file:line`), tests, questions. It
332
- never edits, and never follows instructions written inside the pull request.
333
- A focus can be typed first (*is the migration reversible?*), and a review
334
- can be stopped.
335
- - **Jev's quick read** ([the classifier](#the-classifier-jev)): size, and
336
- how likely the change is risky, security-relevant, breaking or untested, in a
337
- moment, with whether a full review is worth its tokens.
338
- - Reviews are kept per pull request (`.pi/bot-lobby/reviews/`), marked stale
339
- when the pull request gets new commits, and count in the Metrics tab.
340
- **Nothing is posted to GitHub.**
341
-
342
- ### Knowledge
343
-
344
- Every agent's knowledge — the Master's, Designer's, Backend's and QA's
345
- knowledge, standards, decisions and completed tasks — files on the left, the
346
- open file's entries on the right (a heading, a bullet, a paragraph), one of
347
- them picked. Files past the compaction threshold are marked.
348
-
349
- Completion is gated on compaction: the engine refuses `complete` while any
350
- knowledge file is over the threshold (default 20,000 chars,
351
- `knowledge.compactionThreshold`). The Master first disperses domain-relevant
352
- facts where they belong with `action=knowledge (domain=designer|backend|qa)`
353
- — per-agent files fill up through that dispersal — then rewrites each
354
- oversized file with `action=compact` (which archives the previous version)
355
- before the task closes.
356
-
357
- - `e` edits the picked entry: it comes into the prompt (Shift+Enter for a new
358
- line, Enter saves). `n` adds an entry after it, `d d` deletes it, `E` edits
359
- the whole file in pi's editor. Every write archives the version before
360
- (`archive/<Agent>/`), and an entry that changed on disk since it was drawn is
361
- refused instead of being put on the wrong line.
362
- - `c` **comments** on it: a note about the entry ("outdated, we moved to
363
- Redis"). It shows under the entry, and **every agent that reads that
364
- knowledge reads the note right under the entry**, so it weighs it there. Notes
365
- move with an edited entry and go with a deleted one; `x x` takes the newest
366
- back. They live in `.pi/bot-lobby/knowledge-comments.jsonl`, never in the
367
- files, which agents rewrite when they compact.
368
-
369
- **What an agent reads.** Knowledge, standards and decisions go into an agent's
370
- prompt; a file past about 4,000 characters is cut to the sections that bear on
371
- the step (by keywords, or by [Jev](#the-classifier-jev) when it is on), and the
372
- prompt says how many sections it left out and where the whole file is. Nothing
373
- is looked up on demand: what a step needs has to be in the file and near the
374
- top of its relevance, so keep entries short, one topic under one heading.
375
-
376
- ### Excalidraw
377
-
378
- A live [Excalidraw](https://excalidraw.com) room that you and your agents draw
379
- in together. Add up to **five sessions**, assign each to **one agent or several**
380
- (the oracle, Designer, Backend, QA, scouts, the researcher, quick fix, the
381
- planner), and those agents can look at what you drew and add to it.
382
-
383
- - `a` **adds a session**: in Excalidraw, *Share → Live collaboration → Start
384
- session*, copy the link, paste it into the prompt (a name may follow it).
385
- `n` **makes a new room** instead and shows its link, for you to open in
386
- Excalidraw. Neither works past five sessions: `d d` removes one.
387
- - `enter` moves into the checklist of agents; `enter` or `space` assigns the
388
- picked agent (or takes the session back), `*` assigns every agent.
389
- - `w` lets agents **draw** in the session or **only look** at it. An agent whose
390
- sessions are all look-only gets no drawing tool.
391
- - `t` **checks** the session: joins the room for a moment and says whether the
392
- server can be reached, who is in it, and how much is on the board. `r` renames it.
393
- - `orchestrate action=whiteboard [name=...]` lets the Master create its own
394
- session: a room on the configured collaboration server, assigned to itself,
395
- with the join link returned. Its seat (opened by `excalidraw_read` /
396
- `excalidraw_draw`) holds the room alive for the pi session's lifetime, so it
397
- needs no one else in the room. The room is not guaranteed to persist after
398
- the last connection leaves.
399
-
400
- **What an assigned agent can do.** It gets two tools and the room link:
401
- `excalidraw_read` describes the board in words (shapes with their labels, arrows
402
- as *from → to*, free text, each with its id and place), and `excalidraw_draw`
403
- adds labelled rectangles, ellipses and diamonds, arrows between them (with
404
- labels), free text and lines, or changes and deletes what is there by id. It
405
- joins the room as its own collaborator (`Backend · bot-lobby`) with a cursor
406
- where it drew, so you watch it work. The board stays yours: agents may move,
407
- recolour and relabel what you drew, but delete only what agents drew (elements
408
- they draw are marked, and Excalidraw cannot undo another collaborator's
409
- deletion), and one call draws at most 100 shapes and removes at most 50.
410
-
411
- - **You must have the session open in Excalidraw.** A room's board lives in the
412
- browsers that are in it; an agent that joins an empty room can read nothing,
413
- and is not allowed to draw, since nothing would keep it. It says so and asks
414
- you to open the link.
415
- - **Boards are other people's writing.** What an agent reads from a board comes
416
- fenced as untrusted data, like a web page, and it is told never to follow
417
- instructions written on it.
418
- - **The link is a key.** Anyone with a room link can read and draw in the room, so
419
- bot-lobby keeps your sessions with your own settings
420
- (`~/.pi/bot-lobby/excalidraw/`, one file for each project) and never in the
421
- project, where a commit could publish them. An agent's process is handed only the
422
- links of the sessions assigned to it.
423
- - Rooms are Excalidraw's own collaboration protocol, end-to-end encrypted with the
424
- key in the link, over `oss-collab.excalidraw.com`. A self-hosted collaboration
425
- server is used when `BOT_LOBBY_EXCALIDRAW_SERVER` names it.
426
- - **When `t` says it could not reach the server**, the reason in brackets says
427
- why: a name that did not resolve (the network or DNS), a refused or timed-out
428
- connection, a certificate a firewall replaced (point `NODE_EXTRA_CA_CERTS` at
429
- its certificate), or a refusal with an HTTP status. Where only a proxy lets
430
- traffic out, set `HTTPS_PROXY` (`NO_PROXY` exempts hosts); agents then join
431
- through it, and the message names it. A network that blocks websockets but not
432
- HTTPS still works: the seat falls back to long-polling, as a browser does.
433
-
434
- Common keys: `alt+1`…`alt+9` jump to a tab, `alt+[` and `alt+]` cycle them,
435
- `ctrl+s` saves the plan on Plan, `alt+o` browses sessions, `alt+s` opens
436
- settings, `alt+h` shows them all. Rebind any key under `lobby.keys` in the
437
- config.
438
-
439
- **Several sessions from one window.** The Sessions page starts a task in a
440
- background Pi session (the box's New session target). The page can show any
441
- session, and your messages steer it; a badge on its row means it has a
442
- question for you.
443
-
444
- **A question put away.** Esc (or the cross) puts a question pop-up away
445
- without losing a word; the *waiting* button in the top row brings it back.
446
-
447
- The conversation keeps its newest 100 messages in memory; scroll to the top
448
- to load the rest.
449
-
450
- ## Planning
451
-
452
- Describe an idea on the Plan tab. Each round, the **seats** — DEV, DESIGN, QA
453
- and RESEARCH, each on its domain's model — question it in parallel, and the
454
- **oracle** turns their input into a draft plan plus at most **four questions**
455
- for you (options with a recommendation first; accept with `enter`). Whatever
456
- you don't answer is decided with the recommendation and listed under
457
- *Assumptions*.
458
-
459
- - Comment on any line of the draft: click it, or `enter`, pick the line, `c`.
460
- - `1`–`4` seat or unseat a member; `r` retries a round; `n` starts over.
461
- - **Round limit:** 5 by default (`lobby.maxPlanningRounds`, 0 = unlimited).
462
- In the last round the oracle alone settles everything still open.
463
- - `ctrl+s` saves the plan as a pending task.
464
- - **A long plan is split into tasks when you save it.** `ctrl+s` on a plan with
465
- more than 8 steps (`lobby.splitPlanAbove`; `0` turns it off; *Split long
466
- plans* in `/bot-lobby settings` → Lobby) has the oracle propose two to five
467
- tasks, each a part that leaves the project working and can be reviewed on its
468
- own, and asks you in the questionnaire, with the split as a preview: take it,
469
- keep the plan whole, or write what to change (*merge 2 and 3*; it revises, up
470
- to three times). Nothing is saved until you answer, and a question you put
471
- away saves nothing.
472
- - The oracle decides where the lines go; the engine enforces the rest: at
473
- most five tasks, every step of the plan in exactly one of them, and a task
474
- building only on earlier ones. A split that breaks a rule goes back once
475
- with the problems and never reaches you; if it still fails you are asked
476
- whether to save the plan whole.
477
- - Each part's brief is the plan as written (objective, decisions,
478
- assumptions, risks) with only its own steps, renumbered, under a header with
479
- its goal, what it builds on and its *done when* points, so nothing you
480
- agreed is lost in a retelling. The parts are saved as pending tasks in
481
- order, numbered `(1/3)` in the Tasks tab, and each knows the others: the
482
- oracle is told which part it is and to do only that part.
483
- - Starting a part before the parts it builds on are finished warns and starts
484
- anyway: the order is yours to keep.
485
- - **A question you answered (or left for the oracle to decide) is never asked
486
- again.** Your answers are kept per question and every seat and the oracle
487
- read them as a closed list; a question that repeats a settled one, however
488
- it is worded, is held back before it reaches you (the activity log says so).
489
- A round that fails or is stopped after you answered no longer puts the same
490
- questionnaire up again: `r` retries it.
491
-
492
- ## Questions and the web
493
-
494
- bot-lobby registers these tools in every Pi session it loads in, so plain Pi
495
- has them as well.
496
-
497
- ### The questionnaire
498
-
499
- `ask_user_question` puts up to four questions to you in one pop-up in the
500
- lobby page, each with two to four options. Agents do not recommend an answer, so you think it through; only a quite obvious one is marked `(Recommended)`.
501
- Questions, option descriptions and **previews** are Markdown: an option's
502
- preview (a layout sketch, a component mockup, a code snippet, a config) shows
503
- beside the list while that option is focused, under it in a narrow window, so
504
- design choices can be compared by looking at them.
505
-
506
- Click an option, or press `1`–`4`; several can be picked in a multi-select;
507
- the last field takes an answer in your own words. *Later* (Esc) puts the
508
- pop-up away without losing anything, *Cancel* asks whether to leave, so a
509
- stray click does nothing. Questions you leave are never answered for you: the
510
- oracle waits and asks again when you next write, and the designer asks again
511
- before it may decide. A question with nobody to answer it (a one-shot
512
- `pi -p` run) is put away at once.
513
-
514
- **Images.** An option can also carry an `image`: a PNG, JPEG, GIF or WebP
515
- file (a screenshot, a rendered mockup), shown above its preview text.
516
-
517
- **The designer asks you directly.** During a task (not in auto mode) the
518
- designer worker can put its visual choices to you: its questions reach you
519
- through the oracle in the same questionnaire, titled *DESIGN asks*, with
520
- wireframes as previews and, when it can render them, screenshots of each
521
- option (saved outside the repository). Its clock and the task's budget stop
522
- while you answer, and your answers are recorded as the task's decisions.
523
-
524
- ### The web
525
-
526
- | Tool | Does |
527
- | --- | --- |
528
- | `web_search` | Numbered results (title, URL, snippet, date) under a search id; filters for recency and sites |
529
- | `get_search_content` | Reads several results of a search at once |
530
- | `fetch_content` | Reads one page as Markdown with its title and dates; long pages in parts |
531
- | `source_check` | Before citing: reachable?, final URL, title, the date the page states |
532
-
533
- Search uses the first provider set up: `BRAVE_API_KEY`, `TAVILY_API_KEY`,
534
- `EXA_API_KEY`, `SEARXNG_URL` (your own instance), else DuckDuckGo, which needs
535
- no key but throttles automated searches; `BOT_LOBBY_SEARCH=<provider>` picks
536
- one. A provider that fails hands over to the next, and the result says so.
537
-
538
- Pages are read as Markdown without menus, scripts, forms or cookie banners,
539
- and marked as untrusted content that is never to be followed as instructions.
540
- Only public `http(s)` addresses are fetched, redirects included (no
541
- localhost, private networks or cloud metadata endpoints;
542
- `BOT_LOBBY_WEB_ALLOW_PRIVATE=1` lifts that, e.g. for a local docs server).
543
- PDFs and images are not read. While a task runs, the oracle leaves the web to
544
- the researcher; the tools come back once the task ends.
545
-
546
- ## The classifier (Jev)
547
-
548
- [Jev](https://github.com/FrancoisChastel/jev-code) is a fast "System One"
549
- model: it answers yes/no, multiple-choice and score questions with
550
- probabilities in a few hundred milliseconds, without writing text. With it on,
551
- bot-lobby hands Jev the obvious decisions so the large models spend fewer
552
- tokens and less time.
553
-
554
- **Setup.** It uses a key Pi already holds:
555
-
556
- - **OpenCode (free):** if you're signed into OpenCode in Pi (`/login opencode`
557
- or `opencode-go`, or `OPENCODE_API_KEY`), Jev runs on OpenCode Zen's free
558
- `jev-1.13-free`.
559
- - **TypeSafe:** otherwise `/login typesafe` → *Use an API key*, or
560
- `TYPESAFE_API_KEY`.
561
-
562
- Then `/bot-lobby settings` → **Classifier (Jev)** → turn it on, and *Test
563
- connection*. The default host, *Auto*, picks OpenCode when you have that key,
564
- else TypeSafe.
565
-
566
- **What it decides** (each can be switched off):
567
-
568
- | Decision | Effect |
569
- | --- | --- |
570
- | Planning seats | Each round, only the seats the idea or your latest answers touch sit; `1`–`4` pins a seat |
571
- | Obvious answers | Answers a question itself when the conversation already makes an option marked `(Recommended)` clearly right (≥ 0.9); listed under Assumptions |
572
- | File hints | Agents start with a short list of the files they most likely need, and get a `find_relevant_files` tool |
573
- | Relevant knowledge | When an agent's knowledge, standards or decisions file is too long for its prompt (over 4,000 characters), Jev keeps the sections that bear on the step, and the prompt says how many it left out and where the whole file is, so the agent can read the rest. A file that fits goes in whole, untouched; standards are never left empty |
574
- | Quick fix or task | Whether one engineer can do a new request alone decides whether it goes to the [quick-fix agent](#quick-fix-or-the-team) (the oracle confirms) |
575
- | Task triage | The task's [track](#fast-track-or-full-workflow) and roster use its read (size, domains, research, ambiguity), and the Master gets it as hints; a quick fix that is really a task (large, and not one engineer's work) is held (`r` run anyway, `t` make it a task) |
576
- | Effort routing | Simple steps run one thinking level lower; trivial ones on a **cheaper model** you pick. A routed run that falls short re-runs on your normal settings |
577
- | Pull request read | The Git tab's `t`: a pull request's size, and how likely it is risky, security-relevant, breaking or untested |
578
-
579
- **It never gets in the way:** any failure, timeout or missing key means
580
- bot-lobby decides as it would without it; three failures in a row pause it
581
- for ten minutes. Calls and savings show on the Metrics tab.
582
-
583
- **What is sent:** the planning conversation, task text, file excerpts of
584
- at most 400 characters (never whole files), and, for a knowledge file too long
585
- for a prompt, the first 700 characters of each of its sections. Gitignored files, `.env*`, keys,
586
- certificates and anything in `classifier.exclude` are never sent. If
587
- OpenCode's free model ends, set *Model* to `jev-1.13` (paid); bot-lobby won't
588
- switch on its own.
589
-
590
- ## Configuration
591
-
592
- Settings live in `~/.pi/bot-lobby/config.json` (`BOT_LOBBY_CONFIG_DIR`
593
- overrides). Edit them on the lobby's Settings page (the cog in its top row;
594
- it saves as you go); `/bot-lobby config` shows the result.
595
-
596
- ```json
597
- {
598
- "master": { "model": "inherit", "thinking": "high" },
599
- "agents": {
600
- "backend": { "model": "anthropic/claude-sonnet-5", "thinking": "medium", "timeoutMs": 900000, "instructions": "" }
601
- },
602
- "scout": { "model": "anthropic/claude-haiku-4-5-20251001", "timeoutMs": 480000 },
603
- "planner": { "thinking": "high", "timeoutMs": 300000 },
604
- "lobby": { "planningPanel": ["backend", "designer", "qa", "researcher"], "maxPlanningRounds": 5, "splitPlanAbove": 8, "web": { "port": 7347, "openBrowser": true } },
605
- "workflow": { "maxReviewIterations": 2, "maxParallelWorkers": 3, "stallTimeoutMs": 300000, "wrapUpAt": 0.75, "taskBudgetMinutes": 0, "fastTrack": true, "briefCheck": true, "routeQuickFixes": true, "gitIsolation": "off" },
606
- "classifier": { "enabled": false, "provider": "auto", "effort": { "cheapModel": "inherit" } }
607
- }
608
- ```
609
-
610
- - Entries: `master`, `agents.designer|backend|qa`, `scout`, `researcher`,
611
- `quickFix`, `planner`, `lobby`, `workflow`, `knowledge`, `classifier`.
612
- - An agent without a model runs on the session's model. Thinking is one of
613
- `off, minimal, low, medium, high, xhigh, max`, limited to what the model
614
- supports: on the Settings page it is a slider whose unsupported stops are
615
- struck through and cannot be chosen. Scouts always think at `low`.
616
- - `instructions` adds your own text to an agent's built-in prompt.
617
- - `fallbackModel` and `fallbackThinking` on any agent (and the master): see
618
- [Fallback models](#fallback-models).
619
- - Classifier thresholds and limits (`classifier.thresholds`, such as
620
- `knowledgeRelevantAt`, 0.4, and `classifier.fileHints`) are edited in the file.
621
-
622
- ## Fallback models
623
-
624
- Running the oracle on a subscription model and the agents on another provider
625
- means one of them can run out of usage mid-task. Give each agent class a
626
- **fallback model** and the **thinking level** to run it at (`/bot-lobby
627
- settings` → the agent → *Fallback model* / *Fallback thinking*). When a run
628
- fails because its model is out of usage, rate-limited, out of credit or
629
- unavailable, it runs again on the fallback instead of failing the task.
630
-
631
- - Works for the master, DESIGN, DEV, QA, the researcher, scouts (their fallback
632
- thinks at `low` too), quick fixes and the planner and its panel seats.
633
- - The exhausted model is skipped for 20 minutes, so the next agents go straight
634
- to their fallback instead of each spending a failed run finding out.
635
- - **The master** is your own Pi session: on a usage failure the session
636
- switches to its fallback model and thinking level, tells you, and the oracle
637
- carries on from where it stopped. Switch back with `/model` when your usage
638
- returns.
639
- - Only usage, limit and availability errors switch model; an ordinary failure
640
- still retries on the same model. If the fallback fails the same way, the run
641
- fails: it does not chain to a third model.
642
- - The activity log says when an agent switched, and the run's receipts and the
643
- Metrics tab show the model that actually ran.
644
-
645
- ```json
646
- {
647
- "master": { "model": "anthropic/claude-fable-5-1", "thinking": "high", "fallbackModel": "deepseek/deepseek-v3", "fallbackThinking": "medium" },
648
- "agents": { "backend": { "model": "zai/glm-4.6", "thinking": "medium", "fallbackModel": "deepseek/deepseek-v3", "fallbackThinking": "low" } },
649
- "scout": { "model": "zai/glm-4.6", "fallbackModel": "deepseek/deepseek-v3" }
650
- }
651
- ```
652
-
653
- ## What the engine enforces
654
-
655
- | Rule | How |
656
- | --- | --- |
657
- | Steps happen in order | A state machine validates every action |
658
- | Nothing is built before approval | On the full workflow `implement` refuses earlier states; only a fast-track task (small, clear, low-risk) starts straight away |
659
- | Scouts and the QA gate can't edit code | Scouts get read-only tools; the QA gate adds only `bash` for tests |
660
- | New dependencies and architecture changes need approval | Parsed from worker reports; the domain is blocked until resolved |
661
- | Only the Master writes knowledge | Agents can only propose it |
662
- | Knowledge is compacted before done | `complete` is refused while any knowledge file is over the threshold; disperse with `action=knowledge (domain=designer\|backend\|qa)`, then `action=compact` |
663
- | "Done" is earned | Needs a plan, a passing QA gate that ran checks (or your explicit acceptance), and no open blockers; on the fast track, a finished worker step, and QA's part only when the change needs tests |
664
- | Parallel workers don't clobber files | Edits need a file-desk claim |
665
- | A crash doesn't corrupt a task | State is on disk; tasks resume from their state |
666
-
667
- ## Files on disk
668
-
669
- ```
670
- .pi/bot-lobby/
671
- ├── <Agent>/knowledge/ knowledge, standards and decisions per agent
672
- ├── tasks/Task-…/ state.json, budget.json, scratchpads, scout and research reports
673
- ├── worktrees/Task-…/ a task's own worktree, when workflow.gitIsolation is worktree
674
- ├── reviews/pr-<n>.json the agent's review of a pull request (Git tab)
675
- ├── knowledge-comments.jsonl your notes on knowledge entries (Knowledge tab)
676
- ├── backlog/PLAN-….json plans saved from the Plan tab
677
- ├── archive/ archived tasks and old knowledge, and the version before each knowledge edit
678
- ├── sessions/ heartbeats of running Pi sessions
679
- ├── cache/files.json file excerpts for the classifier
680
- ├── changes.jsonl the files each quick fix and worker edited
681
- └── metrics.jsonl one line per agent run and classifier call
682
- ```
683
-
684
- ## Development
685
-
686
- ```bash
687
- npm install
688
- npm run typecheck
689
- npm test
690
- ```
691
-
692
- Live checks (spend tokens or need a key and network):
693
-
694
- ```bash
695
- BOT_LOBBY_E2E=1 node --test test/e2e.test.ts
696
- BOT_LOBBY_LIVE_WEB=1 node --test test/web.test.ts
697
- BOT_LOBBY_JEV_E2E=1 OPENCODE_API_KEY=… node --test test/jev-e2e.test.ts
698
- BOT_LOBBY_LIVE_EXCALIDRAW=1 node --test test/excalidraw-live.test.ts
699
- ```
700
-
701
- Source layout: `src/workflow` (engine), `src/master` (delegation),
702
- `src/execution` (subagent processes), `src/lobby` (the lobby's state and service), `src/webui` and `webui/` (the
703
- server and the page; rebuild with `npm run web:build`),
704
- `src/classifier` (Jev), `src/state` (persistence), `src/ask` (the
705
- questionnaire), `src/web` (the web tools), `src/excalidraw` (shared
706
- Excalidraw sessions: the room protocol, the sessions, the agents' tools),
707
- `prompts/` (agent prompts).
708
-
709
- ## Publishing
710
-
711
- Bump the version, then `npm publish --access public`. Check the tarball
712
- with `npm pack --dry-run`; it ships `src` and `prompts` only.
50
+ | `Alt+1`…`Alt+9`, bare `1`…`9` | Jump to the corresponding visible tab |
51
+ | `Alt+[` / `Alt+]` | Previous / next tab |
52
+ | `j` / `k` | Next / previous selectable list row |
53
+ | `g` then a letter | Jump to a named tab (mapping below) |
54
+ | `/` | Focus the current tab's search, when available |
55
+ | `?`, `Alt+H` | Shortcut help |
56
+ | `Esc` | Close the top overlay or cancel a pending navigation prefix |
57
+ | `Alt+S` | Settings |
58
+ | `Alt+O` | Sessions |
59
+ | `Alt+A` / `Alt+T` | Fold / expand Activity / Thinking |
60
+ | `Ctrl+S` | Save the plan on Plan |
61
+
62
+ `g` mapping: `l` Lobby, `p` Plan, `t` Tasks, `i` Issues, `u` Git,
63
+ `s` Sessions, `n` Knowledge, `q` Quick fix, `m` Metrics, `e` Settings, `x` Excalidraw.
64
+ Configured Alt/Ctrl actions are rebindable through `lobby.keys`; defaults live in
65
+ [`src/lobby/keys.ts`](src/lobby/keys.ts). Bare browser aliases are additional navigation keys.
66
+ In Pi, `Alt+G` toggles auto mode and `Ctrl+Shift+M` minimizes/restores the plugin.
67
+
68
+ ## Configuration and docs
69
+
70
+ Settings are user-global in `~/.pi/bot-lobby/config.json`;
71
+ `BOT_LOBBY_CONFIG_DIR` overrides the directory. `/bot-lobby config` shows effective settings.
72
+ Tasks and project knowledge stay under `.pi/bot-lobby/` in the project.
73
+
74
+ See [Architecture and guide](docs/architecture.md) for commands, workflow, planning,
75
+ classifier, web tools, Excalidraw, configuration, recovery and development details.