{
  "what": "boringtool",
  "workspaces": "every route below but /auth, /privacy, /terms, WS /rpc, /pair and /vault/callback is under /w/<workspace>/ — a name like acme, or ~<handle>: a person's Home, made with them the first time they call or sign in, they its member and admin. A workspace answers only who has an active principal there — its members, and the external members of its spaces; where a space is open to every person (person:*), whoever reaches the workspace with no principal there is given one at that first request, as an external member. To anyone else, as for a name the directory does not have, it is the same 404 before the door. Past it, a call is made in the spaces it names beside its input — `space` in a body or a frame, one id or a list, ?space= repeated on /codemode, /tools and an app's route, {space} from code — and answered only to the members of each, the tool acting there: a create makes its thing in the one it names, a call on a thing finds it only in one of them, and a list answers their things. One naming none is made at the workspace level, which holds only the workspace's governance — an admin's — a top-level space.create, the workspace's own lists, the calls about the caller itself, the links whose `from` lives in no space, and an app's page and the files it names (app.serve); anything else there is 400, naming `space`. space.locate {path} says where a thing lives to whoever could reach it. workspace.create makes one",
  "routes": {
    "POST /auth/start": "{ email } — a 6-digit sign-in code for that address, mailed, and { ok: true } whatever the address; where handles are taken on trust, { ok: true, code } and no mail, the code null when none is given",
    "POST /auth/verify": "{ email, code, handle? } — the person, and the session cookie, for 30 days; the first time, { handle_needed: true }, until a handle is sent with the code: it names the person and their Home",
    "GET /auth/email": "the email code's sign-in form, a static page — where the deployment signs in by another way and it does not answer, the way back for an address on its list",
    "POST /auth/logout": "{} — this browser's session ended, and its cookie cleared; WorkOS is asked to end the session it signed in, best effort",
    "GET /auth/workos/start": "?return_to= — where this deployment set WorkOS up, and 404 elsewhere: the browser is sent to WorkOS's hosted page to prove its email address now, by Google or a mailed code, and back to /auth/workos/callback",
    "GET /auth/workos/callback": "?code=&state= — where WorkOS sends the browser back: the session cookie and the address it was going to; the first time, a page that asks for a handle; a page that says why not, for an address that is not invited or a sign-in WorkOS did not finish",
    "POST /auth/workos/handle": "{ handle, proof } — the handle of a person whose address WorkOS proved in the last ten minutes: { name, return_to }, and the session cookie",
    "POST /auth/invite": "{ email } with Authorization: Bearer <the deployment's operator token>, never a session — the address may sign in through WorkOS, and WorkOS is asked to mail it an invitation: { invited, already, email_sent }, the two said apart; 404 where the deployment set no operator token",
    "POST /auth/uninvite": "{ email } with the operator token — the invitation taken back: { ok: true, was }, and every browser session it admitted answers nobody from then on. Not ended: a persona's token, a call under way, and the sessions of an address the deployment's own list holds",
    "GET /auth/invited": "with the operator token — { invited: [{ address, created_at, mailed, name }] }, name the handle of the person the address came to hold",
    "GET /w/:workspace/tools": "the catalog: builtin and installed, one shape — what can act in the spaces ?space=<id> names, repeated for several",
    "POST /w/:workspace/rpc": "{ tool, input, space?, secrets?, call_id?, effect? } — one tool call, made in that workspace, in the space `space` names — or the spaces, a list — or at the workspace level with none. Each `secrets` entry is { name, path }, naming a vault secret of a space you are in and where its {{secret:…}} sits in the input. `effect`, `read_only` or `idempotent`, says calling it again with the same input is harmless: a named call in flight when its leg died is performed again only with it, or with its tool's mark (tool.list), and otherwise answers `interrupted`. Answers { stage, output | error, call_id } — or 202 { stage: \"pending\", call_id, waiting } when it has not answered yet: send it again with that call_id to read the answer",
    "WS /rpc": "one connection per caller — ?principal=<handle>, ?token=<token>&workspace=<ws>, bound to that workspace, or the session cookie, for as long as the token or the session stands. { id, workspace, persona?, tool, input, space?, secrets?, call_id?, effect? } — a call made in the workspace the frame names, in the spaces its `space` names — one id or a list — or at the workspace level, under a persona of yours there if it names one; every answer comes back as { id, stage, status, … }, a call that waits answered later on the same id, and what a call says while it runs is in the log, not on the connection. { id, workspace, tool, input, follow: true } on a read whose changes can be watched (tool.list marks them followable) answers, then sends { id, changed: true } whenever the answer may have changed — read it again — until { id, stage: \"canceled\", status: 409, error }; { id, unfollow: true } stops one. \"ping\" answers \"pong\"",
    "POST /w/:workspace/codemode": "{ code | files, entry?, call?, input?, uses?, use_secrets?, durable_mode? } — the same tools, from code; a thin adapter over the `code.run` tool, made in the spaces ?space=<id> names, repeated for several — `code.run` is made in a space; its code is told them as bt.spaces, and each call it makes names its own ({space}). ?call_id=<uuid> makes it a put, as call_id does on /rpc",
    "GET|HEAD /w/:workspace/f/:token": "one file's bytes, for the principal a link was minted for (artifact.file.url) and nobody else — their session, or a token of theirs, under personas that cover the artifact's space; one `Range: bytes=a-b|a-|-n` is a 206, a whole read is checked against its hash; a link that does not open for you, expired or another's, is the same 404 as one that never was",
    "PUT /w/:workspace/upload/:upload_id/:n": "part n of an upload (blob.upload.begin), as the principal it was begun for: the body is exactly the part's length, every part but the last `part_size`; answers {part, etag}",
    "GET /w/:workspace/view/:artifact_id": "the file browser at the pinned version, read through the door as artifact.get — made in the artifact's space, which the route reads off its record, so answered to its members; ?version=<n> another version; ?preview=<label> runs a renderer the version's boringtool.json lists",
    "ANY /w/:workspace/app/:namespace/:name/*": "an installed application, the install <namespace>/<name>, answers — as itself, or as whoever is looking when the tool filling iapp.serve runs as its caller — in the spaces ?space=<id> names, repeated for several, where the install must be available; or with no ?space=, at the workspace level, where its page and the files it names by relative URL are served too, to whoever can see the install, since a browser asks for them with none; its page reads ?space= from its address to name its calls' spaces",
    "GET|POST /w/:workspace/git/:namespace/:name.git/*": "git's smart HTTP, protocol v0, for the install <namespace>/<name> filling igit — git clone, fetch and push its repository: GET info/refs?service=git-upload-pack | git-receive-pack, POST git-upload-pack, POST git-receive-pack. Each is the install's tool for igit.refs, igit.fetch or igit.push, called through the door as who is calling — a persona's token, as Bearer or as the password of Basic auth; naming nobody is 401 asking for Basic",
    "GET /pair/:socket_id/:token": "a peer dials into a socket it was registered for (websocket) — outside every workspace, as this banner is: a socket's id is global",
    "GET|HEAD /privacy": "the deployment's privacy policy, a public page with no session — outside every workspace, as this banner is: a provider's consent screen links to it. Its words are the deployment's (`PRIVACY_PAGE`); 404 where it sets none",
    "GET|HEAD /terms": "the deployment's terms of service, a public page with no session — outside every workspace, as this banner is. Its words are the deployment's (`TERMS_PAGE`); 404 where it sets none",
    "GET /vault/callback": "?state&code — where a provider sends a person's browser back after consent (vault.connect): one call of vault.connect.complete, as the person the session names, made in the space of the pending connect, outside every workspace as this banner is — its state names the workspace. Answers the secret's name and the account it is now connected to: a page to a browser, JSON to any other caller"
  },
  "identity": "Authorization: Bearer <token> — a persona's token, and nothing else with it; on a git route, also Basic with the token as the password. Or x-principal: <handle>, asserted, where handles are taken on trust; or the session cookie /auth/verify sets — either optionally with x-persona: <label | persona_id>. Naming nobody is 401",
  "peer_origin": null,
  "builtin_tools": [
    "tool.list",
    "artifact.local.create",
    "artifact.local.update",
    "artifact.remote.create",
    "artifact.remote.update",
    "artifact.remote.fetch",
    "artifact.pin",
    "artifact.get",
    "artifact.list",
    "artifact.read",
    "artifact.versions",
    "artifact.diff",
    "artifact.move",
    "artifact.withdraw",
    "artifact.run",
    "code.run",
    "interface.create",
    "interface.list",
    "interface.get",
    "integration.install",
    "integration.list",
    "integration.uninstall",
    "integration.config.get",
    "integration.config.put",
    "integration.version.put",
    "activation.put",
    "activation.get",
    "activation.list",
    "activation.delete",
    "authn.trust.put",
    "authn.trust.get",
    "authn.trust.list",
    "authn.trust.delete",
    "bucket.put",
    "bucket.get",
    "bucket.read",
    "bucket.list",
    "bucket.delete",
    "blob.put",
    "blob.read",
    "blob.stream",
    "blob.write",
    "artifact.file.url",
    "blob.upload.begin",
    "blob.upload.complete",
    "socket.register",
    "socket.attach",
    "socket.force_attach",
    "socket.pipe",
    "socket.force_pipe",
    "socket.join",
    "socket.listen",
    "socket.detach",
    "socket.authn.put",
    "socket.authn.delete",
    "socket.close",
    "socket.token.rotate",
    "socket.token.revoke",
    "socket.status",
    "socket.connected",
    "socket.gone",
    "socket.delivery_failed",
    "socket.list",
    "http.fetch",
    "ai.run",
    "ai.markdown",
    "app.serve",
    "app.authn.put",
    "app.authn.get",
    "app.authn.delete",
    "app.list",
    "agent.run.turn",
    "agent.run.cancel",
    "agent.run.delete",
    "agent.run.get",
    "agent.run.list",
    "agent.list",
    "workspace.create",
    "workspace.list",
    "workspace.get",
    "workspace.admin.put",
    "workspace.admin.delete",
    "workspace.admin.list",
    "workspace.member.put",
    "workspace.member.delete",
    "workspace.member.list",
    "workspace.reset",
    "workspace.delete",
    "space.create",
    "space.get",
    "space.list",
    "space.locate",
    "space.update",
    "space.archive",
    "space.unarchive",
    "space.delete",
    "space.member.put",
    "space.member.delete",
    "space.member.list",
    "space.change.list",
    "space.leave",
    "space.parent.put",
    "space.parent.delete",
    "space.lost.list",
    "space.recover",
    "core.reset",
    "conversation.create",
    "conversation.update",
    "conversation.move",
    "conversation.delete",
    "conversation.archive",
    "conversation.unarchive",
    "conversation.get",
    "conversation.list",
    "message.create",
    "message.update",
    "message.get",
    "message.list",
    "link.put",
    "link.delete",
    "link.list",
    "vault.put",
    "vault.get",
    "vault.list",
    "vault.clients",
    "vault.read",
    "vault.delete",
    "vault.revoke",
    "vault.mint",
    "vault.connect",
    "vault.connect.complete",
    "session.end",
    "event.list",
    "event.get",
    "event.read",
    "event.count",
    "event.wait",
    "trigger.event.create",
    "trigger.event.list",
    "trigger.event.delete",
    "trigger.schedule.create",
    "trigger.schedule.list",
    "trigger.schedule.get",
    "trigger.schedule.delete",
    "trigger.schedule.pause",
    "trigger.schedule.resume",
    "ask.create",
    "ask.answer",
    "ask.cancel",
    "ask.get",
    "ask.wait",
    "ask.list",
    "review.gate.put",
    "review.gate.list",
    "review.gate.delete",
    "tool.call.get",
    "tool.call.list",
    "tool.call.cancel",
    "persona.create",
    "persona.update",
    "persona.get",
    "persona.list",
    "persona.delete",
    "persona.token.register",
    "persona.token.list",
    "persona.token.revoke",
    "principal.get",
    "principal.list",
    "principal.persona.put",
    "principal.persona.delete",
    "integration.hook.put",
    "integration.hook.delete",
    "integration.hook.list",
    "space.hook.put",
    "space.hook.delete",
    "space.hook.list",
    "space.hook.require.put",
    "space.hook.require.delete",
    "space.hook.require.list",
    "workspace.hook.put",
    "workspace.hook.delete",
    "workspace.hook.list",
    "hook.list",
    "notification.handler.put",
    "notification.handler.get",
    "notification.handler.delete",
    "notification.read.put",
    "notification.read.list",
    "notification.push.get",
    "notification.device.put",
    "notification.device.list",
    "notification.device.delete",
    "notification.deliver"
  ]
}