| # AgentConsole β Swift front end for Perplexity Macro VM | |
| Super-clean Swift (Tokamak/SwiftWasm) + GitHub Pages static console. VM owns control flow, `RQ` requests capabilities, `ResearchBroker` returns typed TLV + CRC16, LiveView streams `TraceHub`. | |
| ``` | |
| PHOENIX LIVEVIEW (Agent Console) | |
| instruction β PLAN β EXECUTE β OBSERVE VM Trace | Memory | Tools | Python | |
| β | |
| AGENT RUNTIME (instruction model Β· planner Β· dispatcher) | |
| β | |
| βββββββββββββββΌβββββββββββββββ | |
| βΌ βΌ βΌ | |
| Macro VM WASM Box Tool Broker | |
| 16-bit Python search/fetch/browser/code/local_model/wikipedia/mathematica/dictionary | |
| ROM/RAM IPython + 14 Sovereign Tool API (slc/ere/quantum/worm/swarm/...) | |
| Pyodide (sovereign-tool-api.mjs:220) | |
| ``` | |
| ## Swift package | |
| ```bash | |
| swift build | |
| swift run AgentConsoleApp | |
| swift test | |
| # SwiftWasm (GitHub Pages): | |
| # carton build --product AgentConsole --deployment-target browser | |
| ``` | |
| ## GitHub Pages | |
| Static console at `docs/agent-console/` β no server. Phoenix LiveView WS optional (`ws://localhost:4000/socket/websocket`). Pyodide loaded from CDN, Web Worker-friendly. | |
| ## Sandbox | |
| `python.execute / inspect / reset / install / export` β **no direct net/fs**. `tools.search(...)` inside Python is mediated β Capability Router β policy check β ResearchBroker β typed result β Python. | |
| ## Tools (22) | |
| VM caps `0x01-0x08` (sensitive `browser/code/wikipedia/mathematica` require `CONFIRM 0x2A` + expiring token): search, fetch, browser, code, local_model, wikipedia, mathematica, dictionary. Sovereign Tool API: slc.evaluate, slc.gate, ere.score, quantum.temp, quantum.entropy, worm.seal, worm.verify, metatron.phi, metatron.cube, swarm.run, regex.match, agent.call, corpus.score, colosseum.judge. Sandbox: python.*, macrogrok.infer4, tavily.search. | |
| ## VM Contract | |
| Word 16-bit, ROM $0000-$1FFF RAM $2000-$DFFF MMIO $E000, regs A,B,C,D PC SP=0xDFFF, fuel 128, transcript_hash. Mailbox $00 phase $01 fuel $02 cap $03 status, TLV @$46 CRC16 @$C6 (lib/perplexity_macro/rom.ex). | |
| ## References | |
| - `perplexity-macro-vm/lib/perplexity_macro/rom.ex`, `capability.ex`, `research/broker.ex`, `vm/state.ex` | |
| - `bob-orchestrator/bridges/sovereign-tool-api.mjs` (14 tools) | |
| - Pyodide https://pyodide.org/en/stable/usage/index.html | |