Development
Repository layout¶
| Path | Contents |
|---|---|
orchestrator/main.py | FastAPI app: web UI, HTTP API, MCP server, terminal websocket |
orchestrator/agents.py | the Goober roster and how each CLI is run (terminals, sessions, auth, health) |
orchestrator/protocol.py | the swarm: queues, leads, subtasks, UCP-1, on/off, demos, conversations |
orchestrator/db.py | SQLite persistence |
orchestrator/git_fs.py | sandboxed workspace file access and git |
orchestrator/browser.py, shot.js | @SHOT / @FETCH: the VM's headless Chrome via puppeteer-core |
orchestrator/static/index.html | the web app (single file, no build step) |
scripts/provision.sh | everything installed into the base image |
packer/ | Packer template and cloud-init |
scripts/appimage/, scripts/build_appimage.sh | the AppImage launcher and its build |
.github/workflows/appimage.yml | builds the AppImage and publishes it as the only release |
docs-src/ | prose for these docs (the reference parts are read from the code) |
docs-src/ | the hand-written parts of these docs |
Hot reload¶
The host's orchestrator/ folder is mounted into the VM; the service runs uvicorn with --reload (polling, because 9p mounts don't deliver file events). Save a file on the host and the orchestrator restarts within a few seconds. Running tasks carry on by themselves, but the turn that was running is redone, so save in batches while the swarm is busy.
Logs: ssh -p 2222 aiuser@127.0.0.1 journalctl -u ai-orchestrator -f
Adding a Goober¶
- Install its CLI in
scripts/provision.sh(and in the running VM). - Add an
AgentConfigtoROSTERinorchestrator/agents.py.{prompt}and{model}in commands are substituted. - Optionally add it to
LEAD_ORDERinorchestrator/protocol.py. - Regenerate the docs.
AgentConfig fields:
| Field | Type | Default | Meaning |
|---|---|---|---|
name | str | required | |
provider | str | required | |
cmd | List[str] | required | "{prompt}" and "{model}" are substituted |
auth_cmd | List[str] | required | |
talents | str | required | |
model | str | '' | default model; override per agent with <NAME>_MODEL in .env |
auth_hint | str | '' | |
max_turns | int | 16 | |
session_cmd | Optional[List[str]] | None | Long-lived stream-json process: one conversation across all swarm turns (resumed with `resume_flag <id>`) |
tui_cmd | Optional[List[str]] | None | interactive UI on the same conversation |
resume_flag | str | '-r' | |
auth_group | str | '' | agents sharing one login: verifying after auth covers the whole group |
oc_session | bool | False | opencode: keep one session per agent (`run --format json -s <id>`) |
requires_env | str | '' | e.g. OPENROUTER_API_KEY: not routable until that key is saved |
logs_prompts | bool | False | stealth/eval model: provider logs prompts; don't send secrets |
auto_answers | List[Tuple[str, str]] | field(default_factory=list) | (prompt text, reply) pairs answered automatically in interactive sessions, e.g. keychain fallbacks |
image_args | List[str] | field(default_factory=list) | Empty: the image path goes into the prompt text and the agent opens it with its own viewer, if it can. |
The AppImage¶
scripts/build_appimage.sh packs the git-tracked scripts (no VM images) with a launcher (scripts/appimage/AppRun) into dist/GooberSwarm-x86_64.AppImage. It downloads appimagetool into .tools/ the first time. The launcher copies the scripts to ~/.local/share/goober-swarm, runs ./vm.sh deps and ./vm.sh build in a terminal window when needed, starts the VM with GOOBER_HEADLESS=1 ./vm.sh up, opens the app in Chrome/Chromium --app mode with its own profile (falling back to the default browser), and stops the VM when that window closes. --down stops the VM, --dir prints the data folder.
Releasing: push a tag (git tag v2.1.0 && git push origin v2.1.0) or run the AppImage release workflow by hand. It builds the AppImage, publishes it, and deletes every older release, so releases/latest/download/GooberSwarm-x86_64.AppImage always points at the newest one.
Regenerating these docs¶
The website lives in its own repo, goober-swarm.github.io, served from its docs/ folder: the landing page (docs/index.html) is written by hand there; these docs (docs/docs/) and the landing page's Goober gallery are generated from this repo's code and docs-src/. The site repo regenerates them by itself every 30 minutes and on demand (its .github/workflows/docs.yml: Actions → docs → Run workflow). To do it by hand:
git clone https://github.com/goober-swarm/goober-swarm.github.io ../goober-swarm.github.io
python3 scripts/gen_docs.py # write the site's docs/docs/ and gallery
python3 scripts/gen_docs.py --check # fail if they're out of date
GOOBER_SITE=/path/to/site/docs points it elsewhere. The generator uses only the Python standard library. Reference sections (roster, API, MCP tools, tags, limits, commands, ports, keys) are read from the code; prose comes from docs-src/*.md.