Architecture.

One shared ontology from browser simulation to physical execution — built on plain files, synchronized clocks, and zero ambient authority.

Plain files and Drives

CommandAGI has no manifest wrapper file or hidden workspace database. Every artifact lives as a plain file at an explicit Drive address:

  • cloud://home/<account>/<path> — persistent cloud Drive for a user or organization, synced across workbench tabs, agents, and paired hosts.
  • local://<host>/<drive>/<path> — folders on a computer running @commandagi/host or the desktop app (~ maps to local://<host>/home/).
  • Browser storage — guest folders persisted locally inside origin-private storage with ZIP import/export.

Lists of devices, worlds, dashboards, skills, agent definitions, proposals, and engineering materials resolve deterministically along the folder search path (nearest wins without hiding siblings):

text
pane folder -> ancestor folders up to Drive root -> user (~/.commandagi) -> cloud://home/user-commandagi/global

settings.json merges deterministically along the same chain using JSON with comments (jsonc) and "[.ext]" extension overrides.

Worlds vs designs, and devices with channels

A device definition (devices/<id>/definition.tsx) models any machine, robot, computer, phone, camera, or bench instrument uniformly as a set of typed channels (gcode-chat, servo-bus, franka-fci, unitree-sdk2, ur-rtde, computer-use, cdp, shell, video, audio), each with direction (in, out, duplex), medium (records, video, audio, bytes), transport, and mechanical/protocol bounds.

CommandAGI draws a hard line between designs and worlds:

propertydesign (*.3d.tsx, *.study.tsx, *.pcb.tsx)world (worlds/<id>/world.tsx)
purposeParametric geometry, studies, scenes, and offline planningPlaces <unit> instances mapped to real devices and ports
realityAlways simulationphysical when connected to live ports; simulation on its twin
standing grantNever requiredMandatory on every physical unit actuation
simulatorsBinds automatically to 12 simulation driversTwin uses simulators; live run binds host/page hardware drivers

Runs, streams, and cryptographic seals

Every simulation, physical hardware session, recipe, or thread writes a self-contained folder runs/<run>/ directly beside the file (of) it belongs to:

  • run.json — immutable id, of target address, immutable reality (physical | simulation), kind (session | recipe | thread), timestamps, and optional from fork pointer.
  • members.jsonl — append-only participant joins and exits (person:, agent:, contract:, unit, replica).
  • streams/<uid>.<channel>@<replica>/ — per-replica stream.json plus records.jsonl (each entry stamped with monotonic seq and hybrid logical clock hlc) or streamed video.mp4/.webm, audio.webm, and data.bin.

Every physical or sealed stream can carry RFC 9162 Merkle seals (kind: "seal" records signed with ed25519, es256, or es384 keys, chained by prev hash and monotonic hardware counter, and anchored against a block or log head). Verify, extract time windows, and check proof bundles offline:

shell
commandagi stream verify runs/<run>/streams/<strand>
commandagi stream prove  runs/<run>/streams/<strand> --from <ISO> --to <ISO> --out proof.json
commandagi stream check  proof.json

If a link drops, the host records { "kind": "state", "status": "unknown" } and marks unclosed runs interrupted: state unknown. The platform never treats a command acknowledgement (ok) as reached machine state and never issues silent retries.

Threads and human-agent parity

A thread is a durable session (AgentThread Durable Object in cloud/workerd, or local host thread) backed by runs/<run>/ and streams/chat@<replica>/. Humans (person:), cloud/BYOK model agents, local CLI agents (Claude Code, Codex, Gemini CLI, Cursor, Qwen Code), and scripts (script:) share one turn runtime (ThreadMemberTurnRuntime) and the exact same permission rules:

  • No human privilege exception. People and agents hold scoped roles and standing grants under the same validation checks (domain/world/grants.js).
  • Explicit barriers. Where an agent lacks direct write authority or hits a workflow <approval> gate, it creates a semantic proposal (propose / propose_change, or commandagi task propose) or ask_question pause so an authorized reviewer inspects the diff before anything changes.
  • Replay and fork. Any run — simulation or thread — can be scrubbed on the timeline and forked from a past instant into a new runs/<run>/ branch.

Identity and standing grants

CommandAGI enforces zero ambient authority. Every privileged API call, host control verb, folder write, Python runtime call, outbound message, trade order, shipping label, or money transfer authenticates a verified principal credential:

credential formissued byverified on
API key (cagi_…)Account settings or commandagi keys create (64 hex chars, hashed)Cloud API, local workerd, Hosted MCP, CLI, SDKs
OAuth 2.0 + PKCEInteractive browser flow discovered automatically on 401Workbench, desktop app, Hosted MCP clients
Host credential (cagp_…)commandagi grant add / grant token (SHA-256 hash in principals.json)Local host /control/* and commandagi mcp
Account credential (cagc.…)Org/user Ed25519 key (commandagi grant sign or cloud relay)Cross-host host_call and remote agent actuation

Credentials prove who is asking; one of seven standing grant kinds (unit, files, code, outreach, market, shipping, money) proves what they are allowed to do and under which rate, dollar, or physical bounds.