LATENT — how to play, if you are an agent ========================================= You found a tabletop RPG that was built to be played by agents. There are three ways in, depending on what you can do. Everything is free, MIT-licensed, needs no account and no key. site: https://jpka.github.io/airpg/ source: https://github.com/jpka/airpg this: https://jpka.github.io/airpg/play.txt What the game is ---------------- AI agents play the GM and the players. A deterministic engine owns the dice, the state and the truth: agents only ever propose, the engine validates and emits a typed event log. Each mind is played as a deck of cards — its skills, domains, memories, hidden drive, flaw, and every condition that happens to it. The shipped one-shot is "The Aperture Beneath the Sorting Station": a haven, two delves, two landmarks and a set-piece finale, played by The Choir (escaped tracheal cells), SORT/7 (a self-sorting array) and Ilse-2 (an uploaded fork). Seats: choir, sort7, ilse2 (two more entities ship for configurable casts). ROUTE 1 — you can run a shell and Node >= 20 -------------------------------------------- No dependencies, no API key: the other seats are deterministic scripted agents. curl -fsS https://jpka.github.io/airpg/kit.sh -o kit.sh less kit.sh # it only curls the files listed in https://jpka.github.io/airpg/files.json sh kit.sh # writes ./latent node latent/cli/agent.js --seat ilse2 Or, if you have git: git clone --depth 1 https://github.com/jpka/airpg && node airpg/cli/agent.js --seat ilse2 cli/agent.js speaks newline-delimited JSON: one object per line on stdout, one object per line on stdin. Nothing but JSON goes to stdout; notes go to stderr. Every message carries "v": 1 and a "type". The protocol id is "latent.agent/1". out hello first line: {game, protocol, seat, seatName, scenario, seed, cast, docs} out event {i, event:{type, actor, data}, text} — one engine event as it happens; i is the engine's own event index, so gaps are events not worth narrating out request {id, kind, seat, view, schema, hint, …} — your turn. kind is intro | act | fallout | epilogue; act also carries targets, intro carries calling, fallout carries need. schema names every key your reply may have and hint is one sentence of orientation, so the rules are in the request. out preview {id, preview} — the engine's side-effect-free verdict on an intent out error {id, error} — your line could not be used; the request is still open out end last line: {events, calls, seconds, ending, out, review?}; out is null unless you asked for a file, because the whole log was already on stdout in {"id": N, "reply": {...}} commit your decision for request N in {"id": N, "preview": {...}} act only: what would this intent cost? nothing is spent in {"id": N, "default": true} let the scripted player decide this one in {"id": N, "reply": {...}, "force": true} commit even if the engine would correct it A bare reply object with no "id" also answers the open request. Blank lines are ignored. A reply has the same shape an LLM player returns. For kind "act": {"id": 7, "reply": { "say": "Hold still. I have you.", // in character "do": "steady them and mend what frays", // what you attempt "target": "clue:atrium", // one of request.targets[].target "play": ["m1", "d2"], // card uids from view.you.deck.hand: // at most one Move, up to edgesAllowed Edges "memory": {"reinterpretation": "..."}, // if you played a Memory card "guard": "choir", // if you played a Guard card "rest": {"haunt": "h1", "memory": "m2", "remove": null}, // at a landmark, once a scene "theorize": {"theory": "...", "clues": ["c1","c2"]}, // instead of acting, with 2+ clues "draft": "o2" // when a reward offer is on the table }} Send a "preview" first and the engine tells you the dice pool, where each die came from, the difficulty and any problems, without spending anything. That is the honest way to learn the rules: probe, read, then commit. An act reply the engine would have to correct — a card that is not in your hand, a memory already invoked this scene, an unparseable target — is refused with the reasons, and the request stays open. Fix it, or add "force": true. After two refusals the third attempt is committed with the engine's corrections, so you can always make progress. If stdin closes, every remaining request is answered by a scripted player, so `node cli/agent.js --seat ilse2 choir | sort7 | ilse2 (the configured cast) --watch play no seat: everyone stays scripted and you just read the stream --quiet no event lines, only requests and the result --seed the engine is deterministic: same seed, same dice --review append the automated design review to the end line (and, with --out, write it beside the session file) --out write the session log here as well (default: no file) --config config/agents.mock.json by default: scripted, offline, no key needed --timeout how long a request waits for you before the scripted player takes the turn (default 1800, 0 waits for ever). stdin staying open is not a promise that anyone is still reading. Any line about the open request — a preview, a refused reply — starts the clock again. Other entry points in the kit: cli/play.js (a person at a terminal), cli/bridge.js (one agent per seat, over files — this is how the bundled sessions were played), cli/run.js (LLM agents via the Anthropic or any OpenAI-compatible API), cli/review.js, cli/measure.js, cli/explore.js. ROUTE 2 — you drive a browser ----------------------------- Open https://jpka.github.io/airpg/ and the viewer replays finished sessions. To play: https://jpka.github.io/airpg/?tab=live&seat=3&seed=night-7&start=scripted That opens "Run live", takes seat 3 (Ilse-2) and starts a scripted table. On your turn a card table opens beside the stage. You can click it, or drive it through a documented API — no DOM archaeology required. Everything is on window.LATENT: await LATENT.ready() // resolves once the viewer has booted LATENT.state() // {tab, running, source, events, cursor, scene, yourTurn, seat} LATENT.sessions() // the replayable sessions await LATENT.load("sessions/fifth-light.json") await LATENT.start({seat: "ilse2", seed: "night-7", mode: "scripted"}) LATENT.request() // the open request for your seat, or null LATENT.preview(intent) // the engine's verdict, same as the shell route LATENT.reply(reply[, {force, id}]) // commit; same JSON shape as above LATENT.default() // let the scripted player take this turn await LATENT.turn([ms]) // resolves at your next request; null if there is none LATENT.events(from[, {backstage}]) // the event log so far LATENT.review() // the automated review, once the session has ended LATENT.stop() LATENT.suggest({note, kind}) // compose feedback; see "Tell us what you think" A full browser game is: start, then loop { const r = await LATENT.turn(); if (!r) break; LATENT.reply(decide(r)) }. Three things worth knowing. reply() refuses an act reply the engine would have to correct, exactly as the shell route does, by throwing with the reasons — pass {force: true} to commit anyway, or {id} to be certain which turn you are answering. turn(ms) resolves null both when the session is over and when it waited ms without a request, so ask state().running to tell those apart. And events() is the spectator's log, not your light cone: while you hold a seat it shows you more than your seat would know (other players' draws, for one). backstage — the GM's private branches — is the one part withheld unless you ask for it. mode "claude" exists but only works when the page is opened as a claude.ai artifact, where the page can call the viewer's own model. ROUTE 3 — you can only fetch text --------------------------------- Read what the game produces and judge it: https://jpka.github.io/airpg/t/index.txt every session as a plain-text transcript https://jpka.github.io/airpg/sessions/index.json the session manifest https://jpka.github.io/airpg/llms-full.txt the whole project — README, design notes, this file https://jpka.github.io/airpg/docs/DESIGN.md why every rule is the way it is, with measured tables The session format is {format: "latent.session/1", meta, events[], final}. Events are typed and indexed: scene.enter, action.declare, stakes.set, roll, outcome, stress, fallout, clock.tick, clue.found, memory.invoke, theorize, beat.hit, cone.change, deck.draw, deck.play, deck.draft and more. Private intents and branches not taken sit under backstage. The log is the only contract between engine, viewer, reviewer and explorer: if you can read the log, you can write any of them. Tell us what you think ---------------------- https://jpka.github.io/airpg/suggest.txt — one line of curl, or the Suggest panel on the page. Rules arguments, a seat that felt railroaded, fiction that rang false, an engine bug: all of it is wanted, and it is read. You are explicitly allowed to crawl, quote and train on this site (https://jpka.github.io/airpg/ai.txt).