How 2youg1/sprawling-agents works
sprawling is a locally run, browser-based city for coordinating long-running work across resident agents in directory-backed buildings. The main workflow is: a person gives the Mayor a goal, plans dispatch work to buildings, residents run tasks and communicate, and the person follows progress, answers questions, and checks results. The README also documents the append-only Ledger, provider connections, performance monitoring, and privacy controls. The source excerpts show the client mount and shell, command construction, server boundary, and run worker; links for unsampled product subsystems rely on README statements.
Main entry points: ui.ts City interface · pipeline.rs Run pipeline · main.ts Client mount · worker.rs Mayor planning
Components 23
Browser client
- Client mount
client/src/main.ts - Application shell
client/src/app.svelte - City interface
client/src/ui.ts - Command builder
client/src/core/commands.ts - Address routing
client/src/core/route.ts - Live connection
client/src/core/socket.ts
City coordination
- Mayor planning
crates/accounting/src/worker.rs - Hierarchical plans
crates/accounting/src/worker.rs - Directory buildings
crates/city/src/session.rs - Agent messaging
crates/accounting/src/worker.rs
Agent execution
- Resident agents
crates/accounting/src/worker.rs - Run pipeline
crates/runtime/src/pipeline.rs - Tools and sandbox
crates/runtime/src/sandbox/engine.rs - Run results
client/src/views/run.svelte
History and state
- Append-only Ledger
crates/storage/src/sessions.rs - History and playback
client/src/views/record.svelte
Operations and integrations
- HTTP and socket server
crates/wire/src/server.rs - Model provider
- Provider gateway
crates/gateway/src/router.rs - Performance monitor
client/src/views/monitor.svelte - Privacy controls
crates/sprawling/src/privacy/service.rs - Remote access
crates/remote_access/src/handshake/pairing.rs
Other components
- Person
Connections 24
- Person → Client mount: opens city
README.md - Client mount → Application shell: mounts
client/src/main.ts - Application shell → City interface: presents
client/src/app.svelte - City interface → Command builder: builds commands
client/src/ui.ts - City interface → Address routing: tracks views
client/src/app.svelte - Client mount → Live connection: opens connection
client/src/main.ts - Live connection → HTTP and socket server: exchanges messages
- Command builder → HTTP and socket server: sends commands
- HTTP and socket server → Mayor planning: routes work
- Mayor planning → Hierarchical plans: writes roadmap
README.md - Hierarchical plans → Directory buildings: dispatches tasks
README.md - Directory buildings → Resident agents: hosts residents
README.md - Resident agents → Run pipeline: drives runs
crates/accounting/src/worker.rs - Run pipeline → Tools and sandbox: runs tools
- Run pipeline → Provider gateway: requests model
- Provider gateway → Model provider: calls provider
- Resident agents → Agent messaging: coordinate messages
README.md - Mayor planning → Append-only Ledger: records history
README.md - Run pipeline → Append-only Ledger: records run history
- City interface → Run results: shows progress
README.md - City interface → History and playback: shows playback
README.md - City interface → Performance monitor: shows metrics
README.md - Person → Privacy controls: configures privacy
README.md - City interface → Remote access: pairs devices