@a-t-h-i/bot-lobby 0.7.7 → 0.7.9
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 +73 -48
- package/package.json +3 -2
- package/prompts/global.md +12 -0
- package/prompts/planner.md +1 -0
- package/src/index.ts +0 -2
- package/src/lobby/feed.ts +0 -17
- package/src/lobby/prompts.ts +2 -1
- package/src/lobby/service.ts +8 -6
- package/src/lobby/session-files.ts +1 -3
- package/src/pi/auto-compaction.ts +2 -7
- package/src/pi/events.ts +2 -4
- package/src/pi/start-task-tool.ts +2 -2
- package/src/pi/start-task.ts +0 -3
- package/src/schemas/configuration.ts +2 -4
- package/src/webui/dev/fake-service.ts +1 -0
- package/src/webui/uploads.ts +4 -1
- package/webui/dist/assets/{CodeSurface-Bdwcvvjq.js → CodeSurface-BXKTcTX4.js} +3 -3
- package/webui/dist/assets/{TerminalView-C_s6eMHt.js → TerminalView-G0U6azdh.js} +2 -2
- package/webui/dist/assets/abnfDiagram-WEYOIA3C-CQfUv7tM.js +1 -0
- package/webui/dist/assets/architecture-WOLXFQ4H-CBUDmRkZ.js +1 -0
- package/webui/dist/assets/architectureDiagram-ZHVYKT53-3iqQiZUb.js +36 -0
- package/webui/dist/assets/{astro-p42oEArs.js → astro-uzna3x9Z.js} +1 -1
- package/webui/dist/assets/blockDiagram-RJAE7QA3-1mrw9txr.js +140 -0
- package/webui/dist/assets/c4Diagram-XDPPPE54-GZX2Pj4O.js +38 -0
- package/webui/dist/assets/{ccount-DQxSH8e6.js → ccount-BNWSQYgZ.js} +1 -1
- package/webui/dist/assets/channel-Cazmyqkd.js +1 -0
- package/webui/dist/assets/chunk-2E7WHVMD-Ckcfmn2X.js +88 -0
- package/webui/dist/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/webui/dist/assets/chunk-4EMNKR2T-Bid3Vhb0.js +1 -0
- package/webui/dist/assets/chunk-55XCU76K-DDQEIeDL.js +1 -0
- package/webui/dist/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/webui/dist/assets/chunk-7S6XSTFO-DOTZgLib.js +2 -0
- package/webui/dist/assets/chunk-AQDTSKZB-BTnoxm9G.js +72 -0
- package/webui/dist/assets/chunk-DSNLSHJZ-DR5vMcU3.js +129 -0
- package/webui/dist/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
- package/webui/dist/assets/chunk-HAGFOTED-CfuDcCGk.js +62 -0
- package/webui/dist/assets/chunk-HNE4Q36P-dbbEe03H.js +1 -0
- package/webui/dist/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
- package/webui/dist/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/webui/dist/assets/chunk-NGNAAXSQ-DqoPQk1a.js +136 -0
- package/webui/dist/assets/chunk-NQOKRVIF-HEDkgMZO.js +213 -0
- package/webui/dist/assets/chunk-UHW7PFBP-cpfwtf_y.js +1 -0
- package/webui/dist/assets/chunk-VQ5W62QI-D0Z4cL9v.js +1 -0
- package/webui/dist/assets/chunk-WQQL4CDK-D8fyjSMI.js +10 -0
- package/webui/dist/assets/chunk-XXDRQBXY-xL-zOTs1.js +1 -0
- package/webui/dist/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/webui/dist/assets/chunk-YZO67HFG-9_EURdb9.js +1 -0
- package/webui/dist/assets/chunk-ZAUX2LTX-DEYBt1LH.js +1 -0
- package/webui/dist/assets/chunk-ZCHMQSOR-DqJDVE3V.js +2 -0
- package/webui/dist/assets/classDiagram-v2-4MYWR3UA-BikaVYDw.js +217 -0
- package/webui/dist/assets/cose-bilkent-JH36ORCC-8ARP9UzL.js +1 -0
- package/webui/dist/assets/cynefin-EF2NZ3EQ-C5gVCNYs.js +1 -0
- package/webui/dist/assets/cynefinDiagram-WF24UDRP-Km8vvYV4.js +62 -0
- package/webui/dist/assets/cytoscape.esm-ZKjJ8woK.js +321 -0
- package/webui/dist/assets/d3-scale-lXtN6-Od.js +1 -0
- package/webui/dist/assets/d3-selection-CVV6NVH0.js +1 -0
- package/webui/dist/assets/dagre-NK4GIZVX-D-pbPIWH.js +4 -0
- package/webui/dist/assets/diagram-CBK3MWTC-BEq3Rl3Q.js +24 -0
- package/webui/dist/assets/diagram-I5XIIV2D-BE06Euj9.js +24 -0
- package/webui/dist/assets/diagram-ODIL2UCW-CRDWuxY1.js +30 -0
- package/webui/dist/assets/diagram-PFBEJUXE-oQ5_hzyZ.js +3 -0
- package/webui/dist/assets/diagram-RJA3I4VV-7rP9gMdO.js +41 -0
- package/webui/dist/assets/diagram-TYUNFSNR-VoDAzp17.js +200 -0
- package/webui/dist/assets/dist-niafR-rj.js +1 -0
- package/webui/dist/assets/ebnfDiagram-V4P3TTPT-D5O4cio9.js +1 -0
- package/webui/dist/assets/elk-QONTBCTQ-DyuKZPfr.js +27 -0
- package/webui/dist/assets/erDiagram-KYQIGQAA-D_oY5CqK.js +99 -0
- package/webui/dist/assets/eventmodeling-K75KTNOO-DMksVX5f.js +1 -0
- package/webui/dist/assets/flowDiagram-IUGLLWBU-CxrqOxSt.js +1 -0
- package/webui/dist/assets/ganttDiagram-R7GPNTJY-VgTwTWO_.js +292 -0
- package/webui/dist/assets/gitGraph-VSP46ZUC-B9yFvx8R.js +1 -0
- package/webui/dist/assets/gitGraphDiagram-PDYL7XHY-Cf5fOMDg.js +106 -0
- package/webui/dist/assets/graphlib-DS17s2tU.js +1 -0
- package/webui/dist/assets/{graphql-AVu4aKQX.js → graphql-Dq_Q6ac9.js} +1 -1
- package/webui/dist/assets/index-CYLwFdIb.css +2 -0
- package/webui/dist/assets/{index-CaiRu5B-.js → index-CZxOM0me.js} +35 -29
- package/webui/dist/assets/info-OHQRW6UA-BGbdAFK4.js +1 -0
- package/webui/dist/assets/infoDiagram-MVDRKAX5-CjhZsDTY.js +2 -0
- package/webui/dist/assets/ishikawaDiagram-HPEHV2GE-DlFL4TOg.js +70 -0
- package/webui/dist/assets/{java-DdHNQ9hk.js → java-D7h0NA_A.js} +1 -1
- package/webui/dist/assets/journeyDiagram-BOSHW7O7-DhRduHbx.js +139 -0
- package/webui/dist/assets/{jsx-gTgmArGx.js → jsx-BUUYi3qs.js} +1 -1
- package/webui/dist/assets/kanban-definition-FNSA4HC5-BhwgmH6x.js +89 -0
- package/webui/dist/assets/katex-BXIx1Jgr.js +257 -0
- package/webui/dist/assets/mermaid-parser.core-P9u-eurS.js +7 -0
- package/webui/dist/assets/mermaid.core-C5MgBA3Z.js +44 -0
- package/webui/dist/assets/mindmap-definition-6OY57UG3-BwaUq1Ie.js +98 -0
- package/webui/dist/assets/packet-JDAUHWVQ-Wky7HHl9.js +1 -0
- package/webui/dist/assets/pegDiagram-ECIUJNBX-B7V4rTNg.js +1 -0
- package/webui/dist/assets/{php-C6PDnbTe.js → php-lW4PUsGw.js} +1 -1
- package/webui/dist/assets/pie-XZMESJXO-C5hQ3mq7.js +1 -0
- package/webui/dist/assets/pieDiagram-GNMPY74T-BcHc2Ha9.js +39 -0
- package/webui/dist/assets/quadrantDiagram-D57K4MC3-CEIxAWHV.js +7 -0
- package/webui/dist/assets/radar-ABXABTNO-TmScQcyf.js +1 -0
- package/webui/dist/assets/railroad-I3PHUGI6-BPcOBH5E.js +1 -0
- package/webui/dist/assets/railroad-abnf-LNEFI6M7-BNZDB5i-.js +1 -0
- package/webui/dist/assets/railroad-ebnf-DWYD2UWJ-gSMHjx4R.js +1 -0
- package/webui/dist/assets/railroad-peg-JR7BVNR7-D1a37S4d.js +1 -0
- package/webui/dist/assets/railroadDiagram-Y72NRBL7-C4v5Gnnf.js +1 -0
- package/webui/dist/assets/requirementDiagram-EQYSW5RA-B2fvPiXr.js +84 -0
- package/webui/dist/assets/{rolldown-runtime-hePW80VL.js → rolldown-runtime-Dd_uD5pT.js} +1 -1
- package/webui/dist/assets/rough.esm-Dy-Kn_BL.js +1 -0
- package/webui/dist/assets/{ruby-CPL7DL0w.js → ruby-DDU-xGaZ.js} +1 -1
- package/webui/dist/assets/sankeyDiagram-SY24JHO5-BIFti2Z0.js +40 -0
- package/webui/dist/assets/sequenceDiagram-BLEHNHQU-BBJIc0_a.js +169 -0
- package/webui/dist/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
- package/webui/dist/assets/stateDiagram-v2-A6IESKWZ-Df02feyE.js +291 -0
- package/webui/dist/assets/{svelte-DKhxH1PN.js → svelte-BwxZAPCy.js} +1 -1
- package/webui/dist/assets/swimlanes-B3ENRKFQ-D2TlHhuO.js +1 -0
- package/webui/dist/assets/swimlanesDiagram-AYQRV4AK-rDRGaRKR.js +8 -0
- package/webui/dist/assets/timeline-definition-JXYKGLGB-CA-nQFYZ.js +120 -0
- package/webui/dist/assets/treeView-D4JQ5SDB-BEwiN4Ac.js +1 -0
- package/webui/dist/assets/treemap-SAJKECNS-BhLeisJJ.js +1 -0
- package/webui/dist/assets/{tsx-CUOciP0b.js → tsx-DvWhG4dC.js} +1 -1
- package/webui/dist/assets/{typescript-BydbNFcO.js → typescript-BTGs5etX.js} +1 -1
- package/webui/dist/assets/usecaseDiagram-WPOLBNNX-Dxi6OA4_.js +328 -0
- package/webui/dist/assets/vennDiagram-Q3Y3IDCW-CFhp5_Tq.js +34 -0
- package/webui/dist/assets/{vue-kBwcnTZb.js → vue-B-rnT8WY.js} +1 -1
- package/webui/dist/assets/wardley-7MLQ67FV-BT_BVSUx.js +1 -0
- package/webui/dist/assets/wardleyDiagram-IVAIDKWA-C4J7EEnb.js +78 -0
- package/webui/dist/assets/{xml-CeXJrFlG.js → xml-BsprbK0m.js} +1 -1
- package/webui/dist/assets/xychartDiagram-4URNHDU4-DYpsaMf8.js +7 -0
- package/webui/dist/build.json +19 -11
- package/webui/dist/index.html +4 -4
- package/src/pi/fresh-context.ts +0 -136
- package/webui/dist/assets/index-Cixi6slz.css +0 -2
package/README.md
CHANGED
|
@@ -3,6 +3,10 @@ Bot-lobby is a determenistic agentic coding engine. You can come up with a vague
|
|
|
3
3
|
|
|
4
4
|
I came up with the name bot-lobby from my 6+ years worth of experience in playing online FPS games. The name is normally used as a joke or to mock the other players by stating that you're playing in a bot lobby (playing with robots) because of how incompetent they appear to be. The contrary is true for the bots in bot-lobby though, they are quite smart and capable... Well, depending on the models you choose of course.
|
|
5
5
|
|
|
6
|
+
<img src="https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/media/questionnaire-hero.gif" alt="An agent asks a question with two clickable UI mockups; the user expands one, picks an option, answers the next question, and a toast confirms it was sent" width="100%">
|
|
7
|
+
|
|
8
|
+
<sub>Agents ask with real mockups. Expand one, pick it, move on.</sub>
|
|
9
|
+
|
|
6
10
|
AI written wall of text below:
|
|
7
11
|
## Install
|
|
8
12
|
|
|
@@ -11,66 +15,87 @@ pi install npm:@a-t-h-i/bot-lobby
|
|
|
11
15
|
```
|
|
12
16
|
|
|
13
17
|
Try it first with `pi -e npm:@a-t-h-i/bot-lobby`, or from a checkout with `pi -e ./src/index.ts`.
|
|
14
|
-
The questionnaire and web tools are built in, so don't also
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## Use
|
|
18
|
-
|
|
19
|
-
1. In Pi, run `/bot-lobby` to open the lobby in your browser. `Ctrl+Shift+M` or `/bot-lobby on|off`
|
|
20
|
-
switches bot-lobby on or off; a new Pi session starts with it off.
|
|
21
|
-
2. Chat with the team in **Lobby**. Questions, code changes and small fixes happen right there: the
|
|
22
|
-
classifier hands each message to the agent whose area it is (a styling question to DESIGN, a
|
|
23
|
-
library question to RESEARCH, "where is this?" to a scout), and every reply is labelled with who
|
|
24
|
-
wrote it. Start a message with `@design`, `@dev`, `@qa`, `@research`, `@scout` or `@master` to pick
|
|
25
|
-
who answers yourself.
|
|
26
|
-
3. Type `/plan <idea>` to plan it with the panel in **Plan**, or `/task <request>` to start it as a
|
|
27
|
-
task for the team. Follow the agents in **Lobby** and **Tasks**; their steps fold into one line in
|
|
28
|
-
the conversation and open in place.
|
|
29
|
-
4. Type `/` to browse Pi commands, installed `/skill:name` skills, extension commands and prompt
|
|
30
|
-
templates. `/compact [instructions]` compacts this session directly (stop active work first).
|
|
31
|
-
Other native Pi commands are prepared in Pi’s terminal: press Enter there to run them. The
|
|
32
|
-
handoff preserves terminal drafts; sessions without a terminal show an explicit notice instead.
|
|
18
|
+
Needs **Pi 1.4.x** (1.4.0 or later). The questionnaire and web tools are built in, so don't also
|
|
19
|
+
install extensions with the same tool names.
|
|
33
20
|
|
|
34
|
-
`/bot-lobby
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
Then run `/bot-lobby` in Pi to open the lobby. `Ctrl+Shift+M` or `/bot-lobby on|off` turns it on or
|
|
22
|
+
off; a new Pi session starts with it off.
|
|
23
|
+
|
|
24
|
+
## What it does
|
|
25
|
+
|
|
26
|
+
### Chat with the whole team
|
|
27
|
+
|
|
28
|
+
Type `/` for commands: `/plan` to plan an idea with the panel, `/task` to hand it straight to the
|
|
29
|
+
team, plus Pi commands, your `/skill:name` skills and prompt templates.
|
|
30
|
+
|
|
31
|
+
<img src="https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/media/slash-commands-light.gif" alt="Typing / opens a list of commands; the user picks /plan and types an idea" width="100%">
|
|
32
|
+
|
|
33
|
+
Start a message with `@` to choose who answers. Otherwise a classifier hands each message to the
|
|
34
|
+
agent whose area it is, and every reply carries its agent's name.
|
|
35
|
+
|
|
36
|
+
<img src="https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/media/mentions-light.gif" alt="Typing @ opens the agent list; the user picks Design, sends a request, and Design replies" width="100%">
|
|
37
|
+
|
|
38
|
+
### Watch agents think and work
|
|
39
|
+
|
|
40
|
+
Each run of agent steps folds into one line in the chat. Open it to see every step, or open
|
|
41
|
+
**Thinking** to read what each agent is reasoning about, live.
|
|
42
|
+
|
|
43
|
+
<img src="https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/media/thinking-light.gif" alt="Expanding the Worked line shows each agent's steps; expanding Thinking shows live reasoning cards per agent" width="100%">
|
|
44
|
+
|
|
45
|
+
### Plan in rounds
|
|
37
46
|
|
|
38
|
-
|
|
47
|
+
On **Plan**, a panel of agents asks what it needs to know, round by round. **View plan** (`V`)
|
|
48
|
+
opens the draft, and any line takes a comment that goes into the next round.
|
|
39
49
|
|
|
40
|
-
-
|
|
41
|
-
name; each run of agent steps shows inline, and **Thinking** holds their reasoning. Typing `@` or
|
|
42
|
-
`/` at the start of a message opens a list of agents or commands to pick from.
|
|
43
|
-
- **Plan**: plan with a panel of agents. **View plan** (`V`) opens the draft in a slide-out, where
|
|
44
|
-
any line takes a comment.
|
|
45
|
-
- **Tasks**: every task across sessions as a list or a board, with its steps, timings and **Resume**.
|
|
46
|
-
- **Knowledge**: what each agent has learned about the project, which you can edit, annotate or ask
|
|
47
|
-
about.
|
|
50
|
+
<img src="https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/media/planning-light.gif" alt="The Plan tab shows the panel's questions; the draft plan slides out and the user comments on one line" width="100%">
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
(`P`) opens any folder on the machine running bot-lobby. Background sessions still run tasks;
|
|
51
|
-
follow their progress and use **Resume** in **Tasks**, without a separate Sessions conversation page.
|
|
52
|
+
### Follow every task
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
or external boards.
|
|
54
|
+
**Tasks** lists every task across sessions with its steps, timings, approvals and blockers.
|
|
55
|
+
**Resume** carries a stopped task on in the background, and a toast tells you it happened.
|
|
56
56
|
|
|
57
|
-
The
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
<img src="https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/media/tasks-toast-light.gif" alt="The Tasks tab: opening a running task with its steps and sub-agents, then resuming a stopped task and a toast rising from the composer" width="100%">
|
|
58
|
+
|
|
59
|
+
### Read the changes, run commands
|
|
60
|
+
|
|
61
|
+
The code viewer shows what the agents changed, as a diff or side by side, and opens any file.
|
|
62
|
+
|
|
63
|
+
<img src="https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/media/code-viewer-light.gif" alt="The code viewer lists a changed file, shows its diff, switches to side by side, then to the full file" width="100%">
|
|
64
|
+
|
|
65
|
+
The terminal drawer is a real shell in your project, one click away.
|
|
66
|
+
|
|
67
|
+
<img src="https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/media/terminal-light.gif" alt="The terminal drawer opens under the chat and runs git commands" width="100%">
|
|
68
|
+
|
|
69
|
+
### Tune each agent
|
|
70
|
+
|
|
71
|
+
Pick each agent's model and effort, run agents on other coding tools (Codex CLI, Claude Code and
|
|
72
|
+
more), narrow their MCP tools and skills, and set the workflow and lint gate. Changes save as you
|
|
73
|
+
make them.
|
|
74
|
+
|
|
75
|
+
<img src="https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/media/settings-light.gif" alt="Settings: changing an agent's effort and model, toggling auto-compact with a Settings saved toast, then the Harnesses, Tools and skills, and Workflow tabs" width="100%">
|
|
76
|
+
|
|
77
|
+
## The agents
|
|
61
78
|
|
|
62
79
|
| Agent | Does |
|
|
63
80
|
| --- | --- |
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
| QA | The final quality gate,
|
|
68
|
-
|
|
|
81
|
+
| Orchestrator | Your Pi session: questions, plan, delegation and approvals |
|
|
82
|
+
| Design | UI, frontend logic, styling and accessibility |
|
|
83
|
+
| Dev | Backend, APIs, data, security and integrations |
|
|
84
|
+
| QA | The final quality gate, as deep as the change's risk calls for |
|
|
85
|
+
| Research | Outside facts, with sources |
|
|
86
|
+
| Scout | Reads the code and explains how something works |
|
|
87
|
+
|
|
88
|
+
`/bot-lobby <request>` in Pi also starts a task. `--fast` / `--full` picks the workflow, and
|
|
89
|
+
`--branch` / `--worktree` isolates it in git. Workers never commit: the orchestrator commits only
|
|
90
|
+
the files the task changed, after the project's linter and a QA pass sized to the change's risk.
|
|
91
|
+
|
|
92
|
+
**Knowledge** holds what each agent has learned about your project, which you can edit, annotate
|
|
93
|
+
or ask about. The project switcher (`P`) opens any folder on the machine running bot-lobby.
|
|
69
94
|
|
|
70
95
|
## Keys
|
|
71
96
|
|
|
72
|
-
Every
|
|
73
|
-
|
|
97
|
+
Every button shows its key. `Alt+1`…`Alt+9` switch tabs, `j` / `k` move through lists, `/` focuses
|
|
98
|
+
search or the message box, `p` switches project, `d` flips the theme and `?` lists every key.
|
|
74
99
|
|
|
75
100
|
## Configuration
|
|
76
101
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a-t-h-i/bot-lobby",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.9",
|
|
4
4
|
"description": "Structured multi-agent software engineering orchestrator for Pi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"extensions": [
|
|
38
38
|
"./src/index.ts"
|
|
39
39
|
],
|
|
40
|
-
"image": "https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main
|
|
40
|
+
"image": "https://raw.githubusercontent.com/a-t-h-i/bot-lobby/main/docs/media/lobby.png"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"typecheck": "tsc --noEmit && tsc -p webui --noEmit",
|
|
@@ -90,6 +90,7 @@
|
|
|
90
90
|
"class-variance-authority": "0.7.1",
|
|
91
91
|
"clsx": "2.1.1",
|
|
92
92
|
"lucide-react": "1.49.0",
|
|
93
|
+
"mermaid": "12.2.0",
|
|
93
94
|
"motion": "14.0.0",
|
|
94
95
|
"radix-ui": "1.6.7",
|
|
95
96
|
"react": "19.3.0",
|
package/prompts/global.md
CHANGED
|
@@ -28,6 +28,18 @@ Write to the user the way a person would in chat: short, direct, plain words.
|
|
|
28
28
|
make, a risk or something that failed. Then say what you need from them.
|
|
29
29
|
- Required report formats still apply; keep each section brief within them.
|
|
30
30
|
|
|
31
|
+
## Visuals
|
|
32
|
+
|
|
33
|
+
When a picture explains better than words, draw one in your reply; the chat
|
|
34
|
+
renders it and the user can expand it.
|
|
35
|
+
|
|
36
|
+
- Flows, UML (class, sequence, state), ER, timelines: a fenced `mermaid` block.
|
|
37
|
+
- Screens and layouts: a fenced `mockup` block of static HTML with one
|
|
38
|
+
`<style>` (no scripts, images, fonts, links or `url()`), laid out about
|
|
39
|
+
1200px wide, in the project's own design language.
|
|
40
|
+
- Before a full visual design, ask the user about style first (look, sizes,
|
|
41
|
+
elements, motion). A quick sketch to explain something needs no asking.
|
|
42
|
+
|
|
31
43
|
## Following your brief
|
|
32
44
|
|
|
33
45
|
The Master that instructs you plans the work and knows the whole task; you may
|
package/prompts/planner.md
CHANGED
|
@@ -59,6 +59,7 @@ below.
|
|
|
59
59
|
30,000 characters. Show the real content and proportions of the thing being
|
|
60
60
|
decided, not grey boxes. The user
|
|
61
61
|
expands the mockups and scrolls through the options side by side.
|
|
62
|
+
A flow or structure can go in your prose as a fenced `mermaid` diagram.
|
|
62
63
|
- The conversation may carry an **Already settled with the user** list:
|
|
63
64
|
questions the user answered (or left for you to decide). They are closed in
|
|
64
65
|
any wording, so never ask one again, not even rephrased; fold the answer
|
package/src/index.ts
CHANGED
|
@@ -18,7 +18,6 @@ import { registerLobbyEvents } from "./lobby/runtime.ts";
|
|
|
18
18
|
import { registerOwner } from "./pi/owner.ts";
|
|
19
19
|
import { registerClassifier } from "./classifier/instance.ts";
|
|
20
20
|
import { registerClassifierTools } from "./classifier/tools.ts";
|
|
21
|
-
import { registerFreshContext } from "./pi/fresh-context.ts";
|
|
22
21
|
import { registerAskTool } from "./ask/tool.ts";
|
|
23
22
|
import { registerWebTools } from "./web/tools.ts";
|
|
24
23
|
import { registerToolBudget } from "./pi/tool-budget.ts";
|
|
@@ -36,7 +35,6 @@ export default function (pi: ExtensionAPI): void {
|
|
|
36
35
|
// First, so every session_start handler below finds the classifier bound to this session's keys.
|
|
37
36
|
registerClassifier(pi, CONFIG_DIR_NAME);
|
|
38
37
|
// Before the lifecycle, so a task that ended while the oracle was idle is closed before it builds the next turn's prompt.
|
|
39
|
-
registerFreshContext(pi, CONFIG_DIR_NAME);
|
|
40
38
|
registerLifecycle(pi, CONFIG_DIR_NAME);
|
|
41
39
|
// After the lifecycle, so the lobby opens over a task the status already knows.
|
|
42
40
|
registerLobbyEvents(pi, CONFIG_DIR_NAME);
|
package/src/lobby/feed.ts
CHANGED
|
@@ -380,18 +380,6 @@ export function chatText(role: "user" | "assistant", text: string): Array<{ role
|
|
|
380
380
|
/** What the conversation shows where auto mode kept the oracle going. */
|
|
381
381
|
export const AUTO_NOTE = "auto mode";
|
|
382
382
|
|
|
383
|
-
/** The session entry bot-lobby leaves where the oracle's context starts over (see pi/fresh-context.ts). */
|
|
384
|
-
export const CONTEXT_MARK = "bot-lobby-context";
|
|
385
|
-
|
|
386
|
-
/** What the conversation shows where a task's end cleared the oracle's context. */
|
|
387
|
-
export const CLEARED_NOTE = "context cleared · the next request starts fresh";
|
|
388
|
-
|
|
389
|
-
/** Whether a session entry is where a finished task cleared the oracle's context. */
|
|
390
|
-
export function isClearedMark(entry: unknown): boolean {
|
|
391
|
-
const record = entry as { type?: string; customType?: string; data?: { kind?: unknown } } | undefined;
|
|
392
|
-
return record?.type === "custom" && record.customType === CONTEXT_MARK && record.data?.kind === "end";
|
|
393
|
-
}
|
|
394
|
-
|
|
395
383
|
/** The session entry that keeps one line of the lobby chat an agent other than the oracle took part in. */
|
|
396
384
|
export const CHAT_MARK = "bot-lobby-chat";
|
|
397
385
|
|
|
@@ -422,11 +410,6 @@ export function chatFromEntries(entries: readonly unknown[], max = MAX_CHAT): Ch
|
|
|
422
410
|
const chat: ChatLine[] = [];
|
|
423
411
|
for (const entry of entries) {
|
|
424
412
|
const record = entry as { type?: string; timestamp?: string; message?: { role?: string; content?: unknown } };
|
|
425
|
-
if (isClearedMark(entry)) {
|
|
426
|
-
const at = record.timestamp ? Date.parse(record.timestamp) : Number.NaN;
|
|
427
|
-
chat.push({ role: "note", text: CLEARED_NOTE, ...(Number.isFinite(at) ? { at } : {}) });
|
|
428
|
-
continue;
|
|
429
|
-
}
|
|
430
413
|
const marked = chatMarkLine(entry);
|
|
431
414
|
if (marked) {
|
|
432
415
|
const at = record.timestamp ? Date.parse(record.timestamp) : Number.NaN;
|
package/src/lobby/prompts.ts
CHANGED
|
@@ -59,10 +59,11 @@ export function parseMention(text: string): { agent: ChatAgent; rest: string } |
|
|
|
59
59
|
return agent ? { agent, rest: text.slice(match[0].length) } : undefined;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
/** The lobby's slash commands: the chat does the work until you ask for a plan or a task. */
|
|
62
|
+
/** The lobby's slash commands: the chat does the work until you ask for a plan or a task, and keeps its context until you /clear it. */
|
|
63
63
|
export const LOBBY_COMMANDS = [
|
|
64
64
|
{ name: "plan", args: "what to plan", hint: "Plan it with the panel on the Plan tab" },
|
|
65
65
|
{ name: "task", args: "what to do", hint: "Start it as a task for the team" },
|
|
66
|
+
{ name: "clear", args: "", hint: "Clear the context: start a new session" },
|
|
66
67
|
] as const;
|
|
67
68
|
export type LobbyCommand = (typeof LOBBY_COMMANDS)[number]["name"];
|
|
68
69
|
|
package/src/lobby/service.ts
CHANGED
|
@@ -37,7 +37,7 @@ import { modelLookup } from "../pi/tools.ts";
|
|
|
37
37
|
import { startPlannedTask, startTask } from "../pi/start-task.ts";
|
|
38
38
|
import { deliverComments, pauseOwner, setAuto } from "../pi/owner.ts";
|
|
39
39
|
import { switchLanded, switchPending } from "../pi/switch-pending.ts";
|
|
40
|
-
import { CHAT_MARK, chatFromEntries, chatMarkContent,
|
|
40
|
+
import { CHAT_MARK, chatFromEntries, chatMarkContent, lobbyFeed, type ChatEntry, type ChatMarkDetails } from "./feed.ts";
|
|
41
41
|
import { CHAT_AGENT_SOURCES, parseLobbyCommand, parseMention, type LobbyCommand } from "./prompts.ts";
|
|
42
42
|
import type { ChatJob, ChatWorker } from "./chat-agents.ts";
|
|
43
43
|
import { routeChatMessage } from "../classifier/lobby.ts";
|
|
@@ -197,11 +197,9 @@ function chatLine(entry: ChatEntry): string {
|
|
|
197
197
|
return `${entry.agent ?? "MASTER"}: ${entry.text}`;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
/** The conversation
|
|
200
|
+
/** The lobby conversation, as lines. */
|
|
201
201
|
export function chatHistoryLines(): string[] {
|
|
202
|
-
|
|
203
|
-
const cleared = chat.map((entry) => entry.text).lastIndexOf(CLEARED_NOTE);
|
|
204
|
-
return chat.slice(cleared + 1).map(chatLine);
|
|
202
|
+
return lobbyFeed.chat.map(chatLine);
|
|
205
203
|
}
|
|
206
204
|
|
|
207
205
|
/** Who answers a message nobody was named in: the classifier's pick when it is sure, else the Master. */
|
|
@@ -270,8 +268,12 @@ function fromConversation(): string | undefined {
|
|
|
270
268
|
return `From the lobby chat:\n\n${lines.slice(-12).join("\n\n")}`;
|
|
271
269
|
}
|
|
272
270
|
|
|
273
|
-
/** `/plan` and `/task`: plan the work with the panel on the Plan tab, or start it as a task. */
|
|
271
|
+
/** `/plan` and `/task`: plan the work with the panel on the Plan tab, or start it as a task. `/clear`: a new session, the only way the orchestrator's context is cleared. */
|
|
274
272
|
function lobbyCommand(state: Runtime, command: LobbyCommand, rest: string): LobbySendResult {
|
|
273
|
+
if (command === "clear") {
|
|
274
|
+
const result = newSession(state);
|
|
275
|
+
return result.notice ?? (result.opened ? undefined : "nothing to clear: this session is already empty");
|
|
276
|
+
}
|
|
275
277
|
const request = rest.trim() || fromConversation();
|
|
276
278
|
if (!request) return `type what to ${command === "plan" ? "plan" : "do"} after /${command}`;
|
|
277
279
|
if (command === "task") {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* parent, and the text of user and assistant messages (never tool output).
|
|
8
8
|
*/
|
|
9
9
|
import { closeSync, openSync, readSync, statSync } from "node:fs";
|
|
10
|
-
import { chatMarkLine, chatText,
|
|
10
|
+
import { chatMarkLine, chatText, MAX_CHAT, textOf, type ChatEntry } from "./feed.ts";
|
|
11
11
|
|
|
12
12
|
/** What a session log keeps of one entry: its parent, and its conversation lines if it is a message. */
|
|
13
13
|
interface LogNode {
|
|
@@ -94,8 +94,6 @@ export class SessionLog {
|
|
|
94
94
|
if (entry.type === "message" && (role === "user" || role === "assistant")) {
|
|
95
95
|
const chat = chatText(role, textOf(entry.message?.content)).map((part) => ({ id: ++logIds, at, role: part.role, text: part.text }));
|
|
96
96
|
if (chat.length > 0) node.chat = chat;
|
|
97
|
-
} else if (isClearedMark(entry)) {
|
|
98
|
-
node.chat = [{ id: ++logIds, at, role: "note", text: CLEARED_NOTE }];
|
|
99
97
|
} else {
|
|
100
98
|
const marked = chatMarkLine(entry);
|
|
101
99
|
if (marked) node.chat = [{ ...marked, id: ++logIds, at }];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { compact, CONFIG_DIR_NAME, DEFAULT_COMPACTION_SETTINGS, estimateTokens, findCutPoint, type ExtensionAPI, type ExtensionContext, type TurnEndEvent } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { contextMarks, freshContextOn, staleCompaction } from "./fresh-context.ts";
|
|
3
2
|
import { AUTO_COMPACT_ENV, COMPACT_AT_ENV, isSubagentProcess } from "./quiet.ts";
|
|
4
3
|
import { dataRoot, detectProjectRoot, loadConfig } from "../state/project.ts";
|
|
5
4
|
import { normalizeCompactAt } from "../schemas/configuration.ts";
|
|
@@ -75,11 +74,7 @@ export function registerAutoCompaction(pi: ExtensionAPI, summarize: typeof compa
|
|
|
75
74
|
const estimate = event.context.contextMessages.reduce((total, message) => total + estimateTokens(message), 0) + Math.ceil(ctx.getSystemPrompt().length / 4);
|
|
76
75
|
const usage = ctx.getContextUsage();
|
|
77
76
|
if (Math.max(estimate, usage?.tokens ?? 0) < threshold) return;
|
|
78
|
-
|
|
79
|
-
if (!isSubagentProcess() && freshContextOn()) {
|
|
80
|
-
const boundary = contextMarks(ctx.sessionManager.getBranch()).at(-1)?.at;
|
|
81
|
-
if (boundary !== undefined) entries = entries.filter((entry) => Date.parse(entry.timestamp) >= boundary);
|
|
82
|
-
}
|
|
77
|
+
const entries = ctx.sessionManager.buildContextEntries();
|
|
83
78
|
if (entries.length < 2) return;
|
|
84
79
|
const keepRecentTokens = Math.min(16_000, override?.keepRecentTokens ?? configured?.keepRecentTokens ?? DEFAULT_COMPACTION_SETTINGS.keepRecentTokens, Math.floor(threshold / 4));
|
|
85
80
|
const cut = findCutPoint(entries, 0, entries.length, keepRecentTokens);
|
|
@@ -118,7 +113,7 @@ export function registerAutoCompaction(pi: ExtensionAPI, summarize: typeof compa
|
|
|
118
113
|
// pi's own compactions (its context threshold, overflow recovery, /compact) write the same checkpoint from pi's
|
|
119
114
|
// preparation, so every summary an agent continues from has the same shape and the oracle's still feeds knowledge.
|
|
120
115
|
pi.on("session_before_compact", async (event, ctx) => {
|
|
121
|
-
if (
|
|
116
|
+
if (!ctx.model) return undefined;
|
|
122
117
|
try {
|
|
123
118
|
const compaction = await checkpoint(event.preparation, ctx, event.signal, event.customInstructions);
|
|
124
119
|
learn(compaction.summary, ctx);
|
package/src/pi/events.ts
CHANGED
|
@@ -22,7 +22,6 @@ import { requestBesidePlan } from "../state/backlog.ts";
|
|
|
22
22
|
import { isAutoMode } from "../state/auto.ts";
|
|
23
23
|
import { triageContext } from "../classifier/triage.ts";
|
|
24
24
|
import { qaStillDue, rosterWords } from "../workflow/track.ts";
|
|
25
|
-
import { previousTaskNote } from "./fresh-context.ts";
|
|
26
25
|
import { skippedStepsNote } from "./plan-checklist.ts";
|
|
27
26
|
import { clockTask, pauseClocks, resumeClocks, startClock, stopClocks, turnStarted } from "../state/work-clock.ts";
|
|
28
27
|
|
|
@@ -67,6 +66,7 @@ export const LOBBY_CHAT_NOTE = [
|
|
|
67
66
|
"You are the orchestrator, so judge each request before you act. Questions, explanations and small, clear changes (a few files in one area) you do yourself, right here.",
|
|
68
67
|
"Work that is large, risky or spans several areas (a new feature, frontend and backend together, an architecture change, anything that needs tests and review) goes to the team: call start_task with the request written in full, say in one line that you started a task, and end your turn. Effort decides its track, and the task's kickoff follows. Do not ask first.",
|
|
69
68
|
"If the request is unclear, ask one short question before starting a task. The user can also type /plan (plan it with the panel) or /task (start a task) themselves.",
|
|
69
|
+
"This conversation carries on across tasks: finished tasks stay in your context, and the user may keep chatting or start more tasks here. It is cleared only when the user starts a new session or compacts it.",
|
|
70
70
|
].join("\n");
|
|
71
71
|
|
|
72
72
|
/**
|
|
@@ -155,10 +155,8 @@ export function registerLifecycle(pi: ExtensionAPI, configDir: string): void {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
if (!task) {
|
|
158
|
-
// The lobby chat, and after a task ended and cleared the context, a line on where its record is, in case the user refers back to it.
|
|
159
|
-
const previous = hidden ? undefined : previousTaskNote(ctx, configDir);
|
|
160
158
|
if (isSubagentProcess() || hidden) delete event.systemPromptOptions.sections["bot-lobby"];
|
|
161
|
-
else event.systemPromptOptions.sections["bot-lobby"] =
|
|
159
|
+
else event.systemPromptOptions.sections["bot-lobby"] = LOBBY_CHAT_NOTE;
|
|
162
160
|
return;
|
|
163
161
|
}
|
|
164
162
|
const dataRoots = readDataRoots(root, configDir);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* does itself; work that is large, risky or spans several areas it hands to
|
|
5
5
|
* the team by starting a task here, the same as the user typing `/task`.
|
|
6
6
|
* The task's track (fast or full) still comes from the effort and triage
|
|
7
|
-
* reads, and the kickoff follows the current turn
|
|
7
|
+
* reads, and the kickoff follows the current turn in this same conversation.
|
|
8
8
|
* While it drives a task, a message that is separate work starts its task in
|
|
9
9
|
* a new background session instead, and the current task carries on.
|
|
10
10
|
*/
|
|
@@ -24,7 +24,7 @@ import type { TrackPath } from "../schemas/task.ts";
|
|
|
24
24
|
export const START_TASK_TOOL = "start_task";
|
|
25
25
|
|
|
26
26
|
const Params = Type.Object({
|
|
27
|
-
request: Type.String({ minLength: 1, maxLength: 8000, description: "The work, written in full for the team: what the user wants, the files or areas you already know it touches, and any constraint they gave. The
|
|
27
|
+
request: Type.String({ minLength: 1, maxLength: 8000, description: "The work, written in full for the team: what the user wants, the files or areas you already know it touches, and any constraint they gave. The team's agents do not see this chat, so this must stand on its own." }),
|
|
28
28
|
title: Type.Optional(Type.String({ maxLength: 80, description: "A short title (3-8 words); derived from the request when absent." })),
|
|
29
29
|
track: Type.Optional(Type.Union([Type.Literal("fast"), Type.Literal("full")], { description: "Only when you are sure: fast (small and clear, straight to the agents) or full (scouts, proposal, QA). Left out, the effort read picks." })),
|
|
30
30
|
auto: Type.Optional(Type.Boolean({ description: "true only when the user asked for it to run without them (no proposal approval or questions)." })),
|
package/src/pi/start-task.ts
CHANGED
|
@@ -21,7 +21,6 @@ import { applyMasterModel } from "./model-settings.ts";
|
|
|
21
21
|
import { setAutoMode } from "../state/auto.ts";
|
|
22
22
|
import { listPlannedTasks, loadPlannedTask, markPlannedTaskStarted, plannedTaskRequest, type PlannedTask } from "../state/backlog.ts";
|
|
23
23
|
import { triageFor } from "../classifier/instance.ts";
|
|
24
|
-
import { freshContextOn, markContext } from "./fresh-context.ts";
|
|
25
24
|
import { createWorkspace, gitLine, taskCwd } from "../execution/workspace.ts";
|
|
26
25
|
import { draftAssignments, draftAssignmentsNote } from "../workflow/draft-assignments.ts";
|
|
27
26
|
import type { GitIsolation } from "../schemas/configuration.ts";
|
|
@@ -181,8 +180,6 @@ export async function startTask(pi: ExtensionAPI, ctx: ExtensionContext, configD
|
|
|
181
180
|
applyStatus(ctx, root, configDir);
|
|
182
181
|
await applyMasterModel(pi, ctx, loadConfig());
|
|
183
182
|
ctx.ui.notify(`bot-lobby ${task.id} started`, "info");
|
|
184
|
-
// The oracle takes the task on with a clean context: nothing said before the kickoff is sent to its model.
|
|
185
|
-
if (freshContextOn()) markContext(pi, { kind: "start", taskId: task.id, at: Date.now() });
|
|
186
183
|
// The full workflow scouts first: start it now, so the findings are on their way while the orchestrator reads the request.
|
|
187
184
|
// It is only a head start: anything that stops it leaves the oracle to scout as before.
|
|
188
185
|
let scouting: Domain[] = [];
|
|
@@ -87,8 +87,6 @@ export interface WorkflowConfig {
|
|
|
87
87
|
toolStallTimeoutMs: number;
|
|
88
88
|
/** Workers that may run at once when the Master delegates several domains together. */
|
|
89
89
|
maxParallelWorkers: number;
|
|
90
|
-
/** The oracle starts each task with a clean context: its model is sent only the conversation since the task started, or since the last one ended. */
|
|
91
|
-
freshContext: boolean;
|
|
92
90
|
/** Small, clear, low-risk requests take the fast track (no scouts, proposal or plan; QA only when tests are needed); false puts every task on the full workflow. */
|
|
93
91
|
fastTrack: boolean;
|
|
94
92
|
/** A delegation that names nothing concrete, or is long without done criteria, is sent back to the oracle once for a fuller brief (sending it again unchanged goes through). */
|
|
@@ -282,7 +280,6 @@ export const DEFAULT_CONFIG: BotLobbyConfig = {
|
|
|
282
280
|
stallTimeoutMs: 5 * 60 * 1000,
|
|
283
281
|
toolStallTimeoutMs: 10 * 60 * 1000,
|
|
284
282
|
maxParallelWorkers: 3,
|
|
285
|
-
freshContext: true,
|
|
286
283
|
fastTrack: true,
|
|
287
284
|
briefCheck: true,
|
|
288
285
|
gitIsolation: "off",
|
|
@@ -521,7 +518,8 @@ function normalizeClassifier(value: unknown): ClassifierConfig {
|
|
|
521
518
|
export function resolveConfig(partial: unknown): BotLobbyConfig {
|
|
522
519
|
const src = (partial ?? {}) as Record<string, unknown>;
|
|
523
520
|
const workflow = { ...DEFAULT_CONFIG.workflow, ...(src.workflow as Partial<WorkflowConfig> | undefined) };
|
|
524
|
-
|
|
521
|
+
// Retired: the oracle no longer clears its own context when a task starts or ends.
|
|
522
|
+
delete (workflow as Partial<WorkflowConfig> & { freshContext?: unknown }).freshContext;
|
|
525
523
|
workflow.fastTrack = workflow.fastTrack !== false;
|
|
526
524
|
workflow.briefCheck = workflow.briefCheck !== false;
|
|
527
525
|
workflow.repoMap = workflow.repoMap !== false;
|
|
@@ -299,6 +299,7 @@ export function createFixtureService(name: string, feed = new LobbyFeed()): Lobb
|
|
|
299
299
|
toOracle: (text: string) => {
|
|
300
300
|
const command = parseLobbyCommand(text);
|
|
301
301
|
if (command?.command === "plan") return { notice: "planning on the Plan tab", open: "plan" as const };
|
|
302
|
+
if (command?.command === "clear") return "started a new session";
|
|
302
303
|
if (command) return "starting a task — the orchestrator takes it from here";
|
|
303
304
|
const mention = parseMention(text);
|
|
304
305
|
if (mention && mention.agent !== "master") {
|
package/src/webui/uploads.ts
CHANGED
|
@@ -34,9 +34,12 @@ function safeName(name: string): string {
|
|
|
34
34
|
return trimmed || "file";
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/** Plain text the agents read as it is, such as a long paste the composer sent as a `.txt` file. */
|
|
38
|
+
const TEXT_TYPES: Record<string, string> = { ".txt": "text/plain", ".md": "text/markdown" };
|
|
39
|
+
|
|
37
40
|
function mimeOf(name: string, claimed: string): string {
|
|
38
41
|
const ext = extname(name).toLowerCase();
|
|
39
|
-
return IMAGE_TYPES[ext] ?? (ext === ".pdf" ? "application/pdf" : claimed.trim() && /^[\w.+-]+\/[\w.+-]+$/.test(claimed.trim()) ? claimed.trim() : "application/octet-stream");
|
|
42
|
+
return IMAGE_TYPES[ext] ?? TEXT_TYPES[ext] ?? (ext === ".pdf" ? "application/pdf" : claimed.trim() && /^[\w.+-]+\/[\w.+-]+$/.test(claimed.trim()) ? claimed.trim() : "application/octet-stream");
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
function kindOf(mime: string): UploadKind {
|