Skip to content
quest'n'click

EngineReferenceFor authors, contributorsApplies from 4.4.0

Public API

Cette page en françaisThis page on the GitHub wiki

What a game, a host page and a game's own tests may import from the engine: five entry modules and the quest-n-click command. Their names are the contract; everything else under src/engine is internal. The Signatures part at the end is generated from the sources.

The contract

Since 4.0 a game, a host page and a game's tests use the entry modules and the quest-n-click command. Their names are the contract: tests/api-surface.json lists them, tests/api-surface.test.ts fails when one changes without the documentation, and start.stability.md says how a change is made (announced in the CHANGELOG, then removed at the next major version). Everything else under src/engine is internal and may change in any release; the @engine/* alias still reaches it, without that promise.

  • In a created project the entries are quest-n-click/content, quest-n-click/player, quest-n-click/minigames, quest-n-click/testing and, since 4.1.1, quest-n-click/reality (the package's exports).
  • In the engine repository the same names resolve to src/engine/api/.
  • The old names web-scumm/content and the others (before 4.2.5, decision D47) resolved through 4.2.x and are removed in 4.3.0: quest-n-click migrate renames them.
  • The save envelope's web-scumm-save and the other format strings of the files are format identifiers from web-scumm, kept so existing saves and files still load.

Each exported name carries one stability tag on its declaration: @public (a name a game or a host calls or reads) or @extension (a contract a game or a host implements, such as a Presenter, a save store or a minigame: a member added to it is a breaking change too). The Signatures tables show it, and list every export: the tables below group the main names by what they are for, and leave some out (the IR and fingerprint helpers such as compileIR, fingerprintGame and the Ir* types, ObjectiveDef, the minigame transcripts, WorldSignalV2).

quest-n-click/content: writing a game

NameWhat
defineGamedeclares the game (GameDef); with schemaVersion: 3, compiled and frozen
defineRoomdeclares a room (RoomDef)
compileGamethe compiled, frozen game a host or a tool runs (defineGame already calls it for schema 3)
GameSource · CompiledGamea game as written, and as compiled
EMPTY_LAYOUT · FLOOR · NEARthe layout of a room nobody placed yet, the default floor line, the default "near" distance
GameDefthe whole game: verbs, characters, items, rooms, rules, audio, skin, budgets, migrations, texts
RoomDefa room: backdrop or stage, props, hotspots, actors, exits, reactions, hints, scripts
Id · Value · Pointan id, a flag's value, a point of the 640 × 400 scene
Conda condition ('flag', '!flag', { has }, { flag, eq }, { not }, { all }, { any }…)
Cmda command of a reaction or a script (say, set, gain, goto, minigame…)
Who · WalkTarget · ListLinewho speaks, where to walk, a line of a list the engine draws from
Choice · TalkTopica dialogue choice, a conversation topic
VerbId · VerbDefa verb's id, a verb as the interface shows it
Rule · KindRule · EventRulea written reaction, a reaction by kind, a listener on an emitted event
Actiona player action: verb, a, b
CharacterDef · SpriteSet · MouthSeta character, its poses, its mouths
ItemDefan inventory item
PropDef · PropAnim · ActorDef · HotspotDef · ExitDefwhat a room holds (each may name the defaultVerb of a double tap, 4.0)
HintDef · ScriptDefa room's hints, a script of the world
StageDef · StageLayer · LightDef · EmitterDef · TransitionKindthe staged room (layers, lights, particles, transitions)
MapDef · MapRegion · PlaceDefthe travel map
GameRulesrules shared by every room
AudioDef · ScoreDef · ScoreStatemusic, sounds, voices; a score's stems and which sound when
EndingDefthe sealed ending
RealityDef · SignalDef · RealityState · ExternalEntrysignals from the world outside through a Reality Bridge (4.1.1, bridge.signals-manifest.md): what a game declares, what a save keeps of the link, a signal as a session entry
RevealDefdeprecated (4.0): the old name of EndingDef; removed in 5.0
SkinDef · UiTextsthe interface's images and sounds, its texts
Migrationone step of save migration (renames, drops)
Layouta room's geometry, written by the placement editor
GameState · Session · SessionEntrythe state a save holds, a replayable session and its inputs (Session.seed, 4.1.14: the run's seed when a host chose it)
SpeedrunManifest · SpeedrunCategory · SpeedrunSplit · SpeedrunTrigger · SemanticTrigger(4.1.14, create.speedrun.md) GameDef.speedrun: categories (timing, start and finish triggers, saves, pauses, hints, reload, Reality policy, fingerprint components, inputs, seed), splits on semantic events, the rules' version
CustomCommand · CustomCommands · CustomContexta game's own commands ({ custom }), the escape hatch, and what they receive
VariationManifest · VariationMode · VariationDimension · VariationConstraint · AnchorDef · AnchorRef · CoupledPair · RemixText · parseManifest · variantFlag · REMIX_ALGORITHM_VERSION(4.1.15, ADR 0018) what may vary between two games of one (GameDef.remix, RoomDef.anchors, create.remix.md), its schema, the reserved flag a dimension writes, the generator's version
compileManifest · CompiledManifest · RemixWorld · catalogue · CATALOGUE_MAX · RemixManifestError(4.1.15) a manifest compiled against the game (domains, constraints, anchors), a catalogue mode's every world, the build error that lists why a manifest cannot make a world
compileVariant · storyVariant · loadVariant · WorldVariant(4.1.15) the world a seed makes (GameIR + VariationManifest + seed + algorithmVersion), the story's, a stored one checked and kept as it is
applyVariant · applyStory · ApplyOptions · compileGameManifest · remixWorld(4.1.15) the game as a world makes it: reserved flags, actors' starts, codes and hints in every text, presentation values
normalizeSeed · encodeSeedCode · isSeed · newSeedCode · STORY_SEED · RemixSeedError(4.1.15) seed codes WS-XXXX-XXXX (Crockford base32 and a check symbol), the story's seed, an explicit error for a malformed one
generateWheel · checkWheel · wheelProblems · wheelTable · CodeWheel · CodeWheelParams · CodeWheelMode · WheelItem · WheelRecord · CODE_WHEEL_VERSION(4.1.15, §11.13) the code wheel a seed draws (the copy-protection stream), its single solution, its table, what a played wheel records

quest-n-click/player: starting the game in a page

NameWhat
bootGamestarts the game in the page (BootOptions: the game module, the root element, the service worker)
BootOptions · SwModuleits options, the service worker's registration module
Locales · pickLanguagethe translations a game ships, which one a visit gets
openStore · StoreOpenerthe save store a page opens (IndexedDB, else localStorage), and how to supply another
SaveStore · SlotStorethe autosave store and the manual slots a host may provide
Presenterwhat the engine asks of a front end (a line said, a choice, a walk, a minigame)
AssetManifestassets.gen.json: the images, their sizes, the audio files
SceneRendererthe painter contract (the DOM and canvas painters implement it)
SpriteSpec · LayerSpec · OccluderSpec · LightSpec · EmitterSpec · StageSpecwhat a painter is given to draw
SceneFrame · Renderer · Intent(4.1.11) an immutable picture of a room with its precomputed hit polygons, the contract of whatever draws one, and the intentions it answers with: the only thing a renderer sends back (D21)

quest-n-click/minigames: minigames as plugins

NameWhat
Minigamethe contract: run(ctx), and what the validator reads (required, textParams, bindings)
MinigameCtxwhat a minigame is given: its zone, images, sounds, parameters, labels, an abort signal
minigamesthe built-in ones (pipes, stroke, pick, hide, runner, scratch, cables), each loaded when it starts
MINIGAME_CSStheir shared style

A game adds its own in its module's minigames (same contract): that is the plugin format.

How to write one: create.custom-minigame.md.

quest-n-click/testing: a game's own tests

NameWhat
Enginethe engine without a page (its members marked @internal are read by the modules of core/ since 4.1.0: not part of the contract). Since 4.1.4: destroy() ends it (loops stopped, waiters released, nothing called back); onError(error, where) hears a script that threw (stopped, scripts[id].off) or a custom command that changed more than it declared; beforeSave(state) shapes what the store writes, onLoad.before/after frame a load; clock is the only time it knows (started, the trace, a session's date)
FakePresenter · MemoryStorea front end that answers by script, a save store in memory
solve · SolveOptions · SolveResultthe solver: a way to the end, softlocks with prove
parseSave · saveEnvelope · SaveEnvelopeV3a save's envelope: write it, read it back (migrations applied)
SaveEnvelopeV4 · upgradeEnvelope · SaveWorldMismatch · savedWorld(4.1.15) the save envelope with its world, the v3 → v4 migration (the story world), the error that names the world a save belongs to, the world a raw save names
worldVerdict · MYSTERY_START_WINDOW_MS · leaderboardKey · REMIX_CATEGORIES · RemixCategoryRules · SpeedrunSeedPolicy · WorldEvidence · seedCommitment · logicalKey(4.1.15, D26) a run's world checked against its category (Story, Fixed, Random, Mystery, Daily), the leaderboard it goes to, a Mystery commitment, the key a proof certificate is filed under
SemanticEvent · SemanticJournal(4.1.11) Engine.journal: what happened in the game, in ids, numbered (rooms, items with the player who lost or acquired them, flags, null for a flag removed, a player switch, the ending, loads and saves), emitted by the core alone and the same on a replay
RunClock(4.1.14, ADR 0016) Engine.runClock: RTA (monotonicNow, never an authority), logicalSteps and logicalTime (bigints, microticks): it observes the core, never writes the state
verifyRun · VerifyContext · SpeedrunVerifyResult · SpeedrunVerdict · isRankable(4.1.14, ADR 0017) a .wsrun replayed against the approved game: one verdict, a code, a reason, the trust it grants; only valid ranks, inconclusive never does
SpeedrunEnvelope · TrustLevel(4.1.14) a run's proof (chunks chained from H0, final state hash, final proof, bigints as decimal strings) and how far it is believed (local → replay-valid → server-witnessed → moderator-verified)

quest-n-click/reality: signals from the world outside (4.1.1)

The signed signal and its verification, the client and its HTTP transport, the simulator, the manifest. A game with its own transport implements WorldSignalPort. What a game declares and how a Bridge checks it: bridge.signals-manifest.md.

NameWhat
verifySignal · SignalExpectation · VerifyResult · RefusalCodea signed signal checked before it is read: size, algorithm, key, signature, then game, player, manifest, expiry; a refusal has a code
signSignal · importBridgeKey · BridgeKey · Keyringsigning as a Bridge does (tests, simulators); a Bridge's public key and the set the player trusts
WorldSignalV1 · WorldSignalV1Schema · SignedWorldSignalV1 · MAX_SIGNAL_CHARSthe payload and its schema, the compact JWS that carries it, its size limit
WorldSignalPortwhere signals come from: a Bridge's transport, the simulator, a game's own
RealityClient · RealityClientOptionsverify, apply, wait for the durable save, acknowledge
httpPort · HttpPortOptionsthe transport to a Bridge: Server-Sent Events read with fetch, or a fetch by cursor
SignalSimulator · Fault · SimulatedDeliverya Bridge in the browser for the Studio and the tests: delays, duplicates, order, bad signatures, expiry, cuts
realityManifest · manifestHash · RealityManifestthe signals a game declares, as the Bridge checks them, and the hash its configuration keeps
verifyDayToken · verifyCommitment · revealMatches · DayToken · CommitToken · TokenResult(4.1.15, D26) the daily challenge's signed seed and a Mystery commitment, checked offline with the key of the game's manifest, and a reveal against its commitment

Beside the modules

  • Authoring schema: schemaVersion: 3 in defineGame; quest-n-click migrate (in a created project) brings an older game to it.
  • Saves: the envelope web-scumm-save schema 3; every save of the 3.x line loads in 4.x (tests/save-v3.test.ts keeps one per release).
  • Studio and MCP: the tools of npm run mcp are described by their schemas (studio.mcp-tools.md); their names and their required and optional arguments are in tests/api-surface.json (mcp): a tool removed or a required argument added is an API change like any other.
  • Command line: quest-n-click <command> and its options (reference.cli.md).

Signatures

One table per entry, one line per export, read from the sources with the TypeScript compiler (tools/api-doc.ts): the signature (a wider one is cut at 160 characters: the page is a map, the source is the territory), the declared stability, and the first sentence of the declaration's doc comment, in English as the source writes it. To regenerate it, in the engine repository, from its root folder:

# in the engine repository
npm run wiki -- generate engine.api

npm run wiki -- check fails when it is behind the code, or when an export has no description or no stability. npx tsx tools/api-doc.ts (--check to only check) writes it again, as npm run wiki -- generate engine.api does, and tests/api-doc.test.ts checks it.

Generated from the engine's own data

quest-n-click/content

NameSignatureStabilityDoc
Actioninterface { verb, a, b }publicA player action: VERB a (with/to b). a can be an inventory item, b is always a target.
ActorDefinterface { defaultVerb, char, interactive, pose, facing, visible, … 1 more }publicA character standing in a room: which one, its pose and facing, and when it shows.
AnchorDefinterface { at, visible, reachableBy, capacity, phase }publicA tagged spot of a room where an item can be placed (RoomDef.anchors): the prop or hotspot it stands on (at), when it shows, what it tak
AnchorRefinterface { room, anchor }publicAn anchor named from anywhere: its room and its id in RoomDef.anchors.
ApplyOptionsinterface { lang }publicOptions of applyVariant: the language the texts are in.
applyStory(game: GameDef, o?: ApplyOptions): GameDefpublicThe game's story world applied (codes and hints at their story values): what a game without a chosen seed plays.
applyVariant(game: GameDef, variant: WorldVariant, o?: ApplyOptions): GameDefpublicThe game as the world variant makes it: a copy, the reserved flags in start.flags, actors' starting rooms, codes and hints in every text
AudioDefinterface { music, sfx, voices, voicesByLang, scores, maxDecodedMB, … 1 more }publicThe game's music, sounds and voice clips by id, its scores in stems and the transitions between them.
canonicalJson(v: unknown): stringpublicThe canonical JSON text of plain data (objects, arrays, strings, numbers, booleans, null, bigints): NFC strings, sorted keys, no -0, big i
catalogue(c: CompiledManifest, modeId: string): Record<string, unknown>[]publicEvery logical world of a catalogue mode, in a fixed order (the product of its dimensions' domains, the others at their story value, filtered
CATALOGUE_MAXnumberpublicThe largest catalogue a mode may enumerate (D25): beyond it, the mode is a generator with a published sample.
CharacterDefinterface { name, description, color, height, sprites, portrait, … 11 more }publicA character: its name, dialogue colour, poses, mouths and portrait, its kinds, and the variants its state selects.
checkWheel(w: CodeWheel): string[]publicThe wheel's solution, checked the way a player reads it (turn, then read): a solution exists, it is unique (one rotation aligns the pair), a
Choiceinterface { id, text, if, once, img, do }publicOne answer the player may pick in a { choice } command: its text, when it is offered, what it runs.
Cmdtype Cmd = union of 56publicA command. A plain string = the hero says this line. Command lists run in order, each one waiting for the previous one to finish.
CODE_WHEEL_VERSIONnumberpublicThe wheel's layout version: a stored record of another version is replayed as it is, never regenerated.
CodeWheelinterface { version, seed, n, outer, track, inner, … 3 more }publicA wheel as a seed makes it: the order of each disc, the windows' offsets, the question and its answer.
CodeWheelModetype CodeWheelMode = 'parody' | 'story' | 'strict' | 'cosmetic' | 'disabled' | 'daily'publicHow the check behaves (§11.13): parody (the default) lets the player through after a few funny refusals.
CodeWheelParamsinterface { actors, symbols, answers, mode, tries, seed }publicWhat an author writes in { minigame: 'code-wheel', params }.
CodeWheelTranscriptinterface { v, wheel, answers, end }publicWhat a minigame records so its result can be computed again (4.1.17, D31, ADR 0020): the code wheel's answers, by their place in the list it
CompiledGametype CompiledGame = Readonly<GameDef>publicA game as compileGame returns it: normalised and, for schema 3, frozen.
CompiledManifestinterface { manifest, hash, dims, order, anchors, modes }publicA manifest compiled once: its hash, its dimensions with their domains, its modes.
compileGame(source: GameSource): CompiledGamepublicCompiles authoring data once into the single normalised representation consumed by the engine and tools. The source is never mutated; genera
compileGameManifest(game: GameDef): CompiledManifestpublicThe game's manifest compiled (an empty one for a game without remix). Throws RemixManifestError.
compileIR(game: CompiledGame, o: CompileIROptions): GameIRpublicThe IR of a compiled game (ADR 0013): pure and deterministic. Rules without an id (v2 content) are named by their position, as the puzzle gr
CompileIROptionsinterface { extensions, engine, sources }publicOptions of compileIR: the extensions, the engine's version, and the sources for the provenance.
compileManifest(manifest: VariationManifest, world: RemixWorld): CompiledManifestpublicCompiles a manifest against the game's world: every reason it cannot produce a world is collected and thrown together (RemixManifestError)
compileVariant(world: RemixWorld | CompiledManifest, manifest: VariationManifest, seed: string, algorithmVersion?: number, modeId?: string): WorldVariantpublicThe world of a seed: GameIR + VariationManifest + seed + algorithmVersion → WorldVariant (ADR 0018). story (the seed or the mode) gives
completionGoal(game: GameDef): Cond[]publicThe solver's 100% goal (npm run solve -- --goal=100%): the done of every objective that is not optional, all holding at once in one stat
Condtype Cond = union of 13publicA condition.
CoupledPairinterface { hint, answer }publicOne coupled pair: the hint the player reads and the answer the content accepts, chosen together or not at all.
CustomCommandinterface { effects, pure, run }extensionA command a game defines in code: its effects on the state as plain commands, and its browser-only run.
CustomCommandstype CustomCommands = Record<string, CustomCommand>extensionA game's custom commands by name, as games/<id>/index.ts exports them.
CustomContextinterface { game, state, room, args, ui, scene, … 1 more }extensionWhat a custom command's run receives: the game, its state, the room, the arguments, the presenter and the scene element.
defineGame(game: GameDef): GameDefpublicDeclares the full game.
defineRoom(room: RoomDef): RoomDefpublicDeclares a room. Does nothing but type it: autocomplete guides the writing.
EmitterDefinterface { id, kind, image, color, rate, visible }publicA particle source of the staged room (dust, rain, snow, sparks, smoke, leaves) and its rate.
EMPTY_LAYOUTLayoutpublicEmpty layout, when the room hasn't been placed in the editor yet.
encodeSeedCode(v: number): stringpublicA 35-bit value (0 ≤ v < 2^35) as its WS-XXXX-XXXX code.
EndingDefinterface { file, password, guess, scratch, card }publicSealed ending (ending module): encrypted content, decrypted at the end of the game and shown on a card.
EventRuleinterface { id, on, if, once, do }publicA listener: when on is emitted ({ emit }) and the condition holds, do runs. once: only the first time.
ExitDefinterface { defaultVerb, name, to, entry, if, locked, … 6 more }publicA way out of the room, declared rather than written as a hotspot plus a rule. The engine turns it into exactly that (core/define.ts `normali
ExtensionHashesinterface { trusted, commands, minigames, plugins }publicWhat compileIR is told of the trusted code: its hash (hashSources over the extension files, given by the build or a tool; '' when unknow
ExternalEntryinterface { id, sequence, signal, source, receivedAt, playerId, … 2 more }publicWhat a session keeps of a signal from outside (4.1.1): its id and sequence on the Bridge, the signal, the source and when it arrived. Never
FLOORnumberpublicDefault floor bottom (logical y), when the layout doesn't give floor.
GameDefinterface { schemaVersion, id, title, lang, saveVersion, renderer, … 37 more }publicThe whole game as written: verbs, characters, items, rooms, rules, audio, skin, budgets, migrations and texts.
GameIRinterface { schema, engine, gameId, world, rooms, entities, … 7 more }publicThe intermediate representation of a game (schema 1): its logic as plain data, the provenance of its ids, the trusted extensions by name, an
GameRulesinterface { fallbacks, kinds, on }publicThe rules shared by every room: fallback responses per verb, reactions by kind, rules valid everywhere.
GameSourcetype GameSource = GameDefpublicA game as its sources write it: a GameDef before compilation.
GameStateinterface { v, room, inventory, flags, props, actors, … 15 more }publicThe state of a game in progress, serialised as-is in a save: room, inventory, flags, props, actors, counters, scripts.
generateWheel(p: CodeWheelParams, seed: string, id?: string): CodeWheelpublicThe wheel of a seed (the copy-protection stream of <seed>|code-wheel|<id>). Throws on parameters wheelProblems refuses.
HintDefinterface { id, until, lines }publicA hint the hint item gives while its until condition is false, as lines said in order.
HotspotDefinterface { defaultVerb, name, kind, visible, exit, onTap }publicA named zone of the room the player can act on; its geometry lives in the layout.
Idtype Id = stringpublicAn identifier in the content (a room, an item, a flag, a character, a prop…): a plain string the game chooses.
IrEntityinterface { key, kind, id, room, name, kinds, … 12 more }publicA thing of the game: a prop, an actor or a hotspot of a room, an item, a character.
IrExtensionsinterface { trusted, commands, minigames, plugins }publicThe trusted code a game names (ADR 0002): custom commands with their declared effects, minigames, plugins.
IrObjectiveinterface { id, title, done, optional, parent }publicAn objective (ADR 0014): its title, the condition that completes it, whether 100% needs it, its parent.
IrRealityPoliciestype IrRealityPolicies = Omit<RealityDef, 'bridge'>publicWhat the game declares of the world outside, its Bridge's address left out (deployment, not logic).
IrRoominterface { id, name, hero, look, hints, exits, … 3 more }publicA room as logic: its name, looks, hints, exits and the conditions of its walk links; its entities by key.
IrRuletype IrRule = union of 5publicA reaction of the game: a written rule, a topic, a listener, a reaction by kind or a verb's fallback lines.
IrScriptinterface { id, scope, trigger, while, loop, do, … 1 more }publicA sequence of commands that runs without a player's action: a world script, a room's arrival, the intro.
IrSourceinterface { file, line }publicWhere an id is written: a file relative to the working directory, and its line (from 1).
IrVariantSlotinterface { mode, id, manifest, variant }publicA world variant of the story (4.1.15 "Remix", ADR 0018): filled when the game was compiled from an instance (applyVariant): id is the va
IrWorldinterface { schemaVersion, saveVersion, hero, players, hintItem, hintVoice, … 8 more }publicThe game's world: its hero and players, verbs, start, map, checkpoints, invariants, saves.
isSeed(input: string): booleanpublicWhether a string is a well-formed seed (a code with its check symbol, or story).
ItemDefinterface { name, icon, look, kind }publicAn inventory item: its name, its icon, its look lines and its kinds.
KindRuleinterface { id, verb, kind, target, item, say }publicReaction by "kind": applies to anything with this kind (e.g. person, cat), before fallback responses. target targets a specific id (
Layoutinterface { width, floor, walk, scale, entries, hotspots, … 8 more }publicA room's geometry, written by the placement editor: walk areas, entries, and where every hotspot, prop, actor, layer and light stands.
LightDefinterface { id, kind, color, intensity, blend, visible }publicA light of the staged room: a radial pool at its layout position, or an ambient colour over the whole room.
ListLinetype ListLine = string | { id: Id; text: string; }publicOne line of a list the engine draws from (a look list, a hint, the fallback answers): a plain string, keyed by its position in translations,
loadVariant(c: CompiledManifest, input: unknown): { variant: WorldVariant; stale: boolean; }publicA stored variant (a save's, a session's, a speedrun's) checked and kept as it is: its hash must match its content; it is never regenerated,
logicView(ir: GameIR): Omit<GameIR, "engine" | "provenance">publicThe part of the IR the fingerprint's logic hashes: everything but the engine's version, the provenance (a line added above a rule moves no
MapDefinterface { regions, start, places, music, vehicles }publicThe travel map: its regions, its places and the region shown first.
MapRegioninterface { name, image, parent, frame }publicA region of the travel map: its image, its parent region and its frame on it.
Migrationinterface { from, renameFlag, renameItem, renameRoom, renameProp, renameActor, … 12 more }publicOne step of save migration: from version from to from + 1. Keys are old ids, values new ones.
MinigameOutcomeinterface { result, transcript }publicA minigame's result and, when it can prove it, its transcript (4.1.17).
MinigameResulttype MinigameResult = 'won' | 'passed' | 'skipped' | 'failed' | 'disabled'publicHow a minigame that says so ended (4.1.16): won, let through (passed, a parody's mercy), skipped, lost (failed, the story goes on with i
MinigameTranscripttype MinigameTranscript = CodeWheelTranscriptpublicA minigame's transcript (4.1.17: the code wheel's only).
MouthSetinterface { closed, open, blink, smile }publicMouth images for a pose: the body doesn't move while speaking, only the mouth changes. closed replaces the idle pose's image (t1), open
NEARnumberpublicDistance (logical units) beyond which a saved approach point is considered stale and recomputed.
newSeedCode(): stringpublicA fresh code from WebCrypto (the Remix button). No WebCrypto: an error, never a guessable draw.
normalizeSeed(input: string): stringpublicThe canonical form of a typed code (ws-abcd-efgh, WSABCDEFGH, with I/L/O read as digits), or a RemixSeedError that says what is
ObjectiveDefinterface { title, done, optional, parent }publicAn objective of the game (4.1.12, ADR 0014): its title in the quest journal, the condition that completes it, whether 100% needs it, and the
parseManifest(input: unknown): VariationManifestpublicA manifest checked against its schema (a malformed one is an error naming the path).
PlaceDefinterface { name, room, region, pos, portrait, joins, … 2 more }publicA place on the travel map: the room it opens, its region and position, its vehicle and its news marker.
Pointtype Point = [number, number]publicLogical coordinates of a backdrop: 640 × 400, origin top-left.
PropAniminterface { frames, fps, loop, at }publicA prop animation: images in order at fps (default 8); at = commands run when a frame is reached (index).
PropDefinterface { defaultVerb, img, states, anims, initial, name, … 2 more }publicA prop in the scenery, with states (e.g. amp off/on). Its position comes from the layout.
provenanceOf(ir: GameIR, sources: Readonly<Record<string, string>>): Record<string, IrSource>publicWhere each id of the IR is written in the sources (path → text), read from their object-literal keys (core/source-keys.ts: strings and comme
RealityDefinterface { signals, bridge, connectors }publicThe game's link to the world outside: the signals it declares and the Reality Bridge it pairs with.
RealityStateinterface { playerId, cursor, applied }publicWhat a save keeps of the link (GameState.reality): no token, no email, no payload.
REMIX_ALGORITHM_VERSIONnumberpublicThe generator's version: bumped when a single assignment of a given seed would change (ADR 0018).
RemixManifestErrorclass RemixManifestErrorpublicA manifest that cannot produce a world: a build error, with every reason.
RemixSeedErrorclass RemixSeedErrorpublicA seed refused: malformed, a wrong check symbol, an unknown algorithm version.
RemixTexttype RemixText = string | Readonly<Record<string, string>>publicA text in the game's language, or one per language ({ en, fr }): what a coupled hint shows.
remixWorld(game: GameDef): RemixWorldpublicWhat the compiler reads of a game definition: its rooms' anchors and every rule with an id.
RemixWorldinterface { rooms, rules }publicWhat the compiler reads of the game: its rooms' anchors and its rules (a GameIR is one).
RevealDeftype RevealDef = EndingDefpublic (deprecated)The old name of EndingDef.
RoomDefinterface { id, name, decor, description, furniture, music, … 15 more }publicA room: its backdrop or stage, props, actors, hotspots, exits, look lines, reactions, topics, hints and scripts.
Ruleinterface { id, verb, a, b, if, do, … 1 more }publicA written reaction: "when VERB is done on A (with/to B), if CONDITION, then …". a and b accept a list: the rule works with any of them.
ScoreDefinterface { stems, bpm, beatsPerBar, loop, states, quantize, … 4 more }publicA score in stems: its files, its tempo and loop, and which stems sound in each game state.
ScoreStateinterface { if, stems }publicWhich stems sound in a given state: the first entry whose condition holds wins (if absent: always).
ScriptDefinterface { id, while, loop, do, stepIds }publicA script of the world: it runs on its own, without a player action, one command at a time, in the gaps between the player's actions (never d
SemanticTriggerinterface { event, room, item, flag, value, objective, … 3 more }publicA semantic trigger: the first event of this kind (and these fields, when given) in the run's journal. A room entered, an item acquired or lo
Sessioninterface { v, start, base, log, at, seed, … 1 more }publicA player's inputs since the game started or a save was loaded, with the state they started from: enough to replay them.
SessionEntrytype SessionEntry = union of 9publicOne input of a session (Engine.session). The answers given while it ran (picks, maps, rnd) are what makes it replayable; ran lists
SignalDefinterface { id, source, availability, replay, once, fallback }publicA signal the game may receive from the world outside: its id, source, availability, replay mode and fallback.
SkinDefinterface { icons, sounds, fonts, heights, callPoses, pixelArt }publicUI skin: everything the engine shows or plays without the content referencing it. Image ids come from the manifest; sounds are ids from `aud
SpeedrunCategoryinterface { id, name, timing, start, finish, allowSaves, … 8 more }publicA speedrun category: what counts as a run, how it is timed, what it may do. timing names the time it is ranked on: rta (the wall clock,
SpeedrunManifestinterface { categories, splits, rulesVersion }publicThe game's speedrun manifest (GameDef.speedrun): categories, splits, and the version of the rules (a change never silently requalifies an
SpeedrunSplitinterface { id, name, at, parent }publicA split: a semantic trigger, a name, and the split it is a step of.
SpeedrunTriggertype SpeedrunTrigger = SemanticTriggerpublicA category's start or finish: a semantic trigger.
SpeedrunWorldPolicyinterface { policy, mode, fixedSeed, codeWheel }publicWhich world a category's runs are played in (4.1.16, D29, ADR 0019): story (no logical variation), fixed (the published fixedSeed), `r
SpriteSettype SpriteSet = Record<string, Id[]>publicA set of images for a character: pose → list of images (looped).
StageDefinterface { layers, lights, emitters, transition, links }publicWhat a room shows beyond its backdrop: layers, lights, particles, its transition and the logic of its walk links.
StageLayerinterface { id, image, role, visible }publicA picture of the room: backdrop behind everything, scenery among the characters (depth from its layout z), foreground in front of th
STORY_SEEDstringpublicThe seed of the author's world: no variation, every dimension at its story value.
storyVariant(manifest: VariationManifest | undefined, world: RemixWorld): WorldVariantpublicThe story world of a game: every dimension at its story value (an empty manifest gives an empty assignment).
TalkTopicinterface { id, topic, if, do }publicA conversation topic offered when talking to an actor: its line, when it is offered, what it runs.
TransitionKindtype TransitionKind = 'cut' | 'fade' | 'wipe'publicHow a room appears when entered: a cut, a fade or a wipe.
UiTextsinterface { walkTo, newGame, continue, confirmErase, yes, no, … 84 more }publicEvery text the interface shows (menus, confirmations, settings), so a game speaks its own language.
Valuetype Value = boolean | number | stringpublicWhat a flag holds: a boolean, a number or a string.
variantFlag(dimension: string, group?: string): stringpublicThe reserved flag a logical dimension writes (remix.<id>; a puzzle order writes remix.<id>.<group>).
VariationConstrainttype VariationConstraint = union of 3publicA constraint between dimensions: exclusive (no two of them take the same value), requires (a and b are <dimension>=<value>: when `
VariationDimensiontype VariationDimension = union of 6publicA dimension: what varies and its finite domain. Logical dimensions are in the solver's space (each instance is proved); presentation ones
VariationManifestinterface { schema, algorithm, modes, dimensions, constraints, daily }publicWhat a game lets vary (GameDef.remix), schema 1, algorithm web-scumm-remix-1. daily names the Bridge key a daily challenge is signed w
VariationModeinterface { id, strategy, dimensions, mask }publicA mode of play: which dimensions vary (the others keep their story value) and the strategy that backs it (D25): catalogue (every instance
VerbDefinterface { id, label, color, join, key }publicA verb as the interface shows it: its id, its label, its colour and the joining word of a two-term sentence.
VerbIdtype VerbId = stringpublicVerb id, free-form: the game's own verbs declare them. Four ids have meaning to the engine: look ("Look" text for rooms and items), `tal
WalkTargettype WalkTarget = Id | PointpublicTarget of a move: a hotspot, an actor or a prop in the room (its approach point), or a point.
WheelIteminterface { id, label, img }publicOne item of a disc: its id, its name (said to a screen reader, printed), its image (a sprite, a portrait).
wheelProblems(p: Partial<CodeWheelParams>): string[]publicEverything wrong with a wheel's parameters (the validator's check); empty when it can be built.
WheelRecordinterface { seed, version, wheel, mode, rotations, answers, … 2 more }publicWhat a played wheel records for a replay and a speedrun (§11.13).
wheelTable(w: CodeWheel): { actor: string; symbol: string; answer: string; }[]publicThe full table the wheel encodes: for each actor and symbol, the answer (the accessible list, the booklet).
Whotype Who = IdpublicWho speaks or acts. 'hero' always designates the hero, whatever their id.
WorldVariantinterface { seed, algorithm, algorithmVersion, manifestHash, mode, assignments, … 1 more }publicOne world instance: the seed it came from, the algorithm and its version, the manifest's hash, the mode, one value per dimension, and the ha

quest-n-click/player

NameSignatureStabilityDoc
AssetManifestinterface { images, audio, videos }publicCatalogue of images and sounds prepared by npm run assets.
bootGame(o: BootOptions): Promise<App>publicBoots the game in the page and returns the App (after the title screen is shown, or the dev tools started).
BootOptionsinterface { game, layouts, manifest, minigames, commands, locales, … 9 more }publicWhat bootGame starts the game with: the game, its layouts and manifest, minigames, commands, locales, root, store, service worker, and the
EmitterSpecinterface { id, kind, url, color, rate, area, … 1 more }extensionA particle source, resolved for the painter: its kind, image, colour, rate and area.
Intenttype Intent = union of 5extensionWhat a renderer sends the engine's side: the only thing it may (D21). A tap on a target with the verb the player chose (act, with item w
LayerSpecinterface { id, url, role, x, y, w, … 6 more }extensionA stage layer, resolved: its image, its box in the room (logical units, before parallax), its depth and look.
LightSpecinterface { id, kind, color, intensity, blend, at, … 2 more }extensionA light, resolved for the painter: its kind, colour, intensity and blend, and for a radial one its centre and radius.
Localestype Locales = Record<string, Record<string, string>>publicThe translations a game ships, by language then by text path (locales/<lang>.json).
OccluderSpecinterface { id, z, polygon, mask, layer, feather, … 1 more }extensionWhat hides a character deeper than z: the backdrop's pixels (or a layer's) inside a polygon, a mask image or a layer's alpha.
openStore(game: GameDef, open?: StoreOpener): Promise<{ store?: SaveStore; attach: (app: App) => void; }>publicOpens the verified store and keeps its early errors and warnings until an App can show them. Without IndexedDB the App's verified localStora
pickLanguage(_written: GameDef, locales: Locales | undefined, o?: { query?: string | null; stored?: string | null; navigatorLang?: string; }): string | undefinedpublic?lang=, then the player's saved choice, then the browser's language when the game ships it.
Presenterinterface { enterRoom, say, walk, face, pose, anim, … 21 more }extensionWhat the core asks the display for. The DOM renderer implements it for the browser, FakePresenter implements it for node (tests, solver). Al
Rendererinterface { mount, render, onIntent, unmount }extensionA renderer: mounted in an element, given frames, it tells its intentions. The DOM and Canvas painters are wrapped as one (dom/frame-renderer
SaveStoreinterface { load, save, clear, whenIdle }extensionThe autosave store a host provides: load, save, clear, and when the latest write is durable.
SceneFrameinterface { hash, room, camera, layers, actors, hotspots, … 2 more }extensionA room as it is to be drawn: immutable, in logical units. hash digests the rest: a renderer skips a frame equal to the last one.
SceneRendererinterface { el, reset, sprite, camera, resize, stage, … 1 more }extensionThe painter contract: a surface, sprites and a stage to draw, a camera to follow; the DOM and canvas painters implement it.
SlotStoreinterface { listSlots, getSlot, putSlot, clearSlot }extensionManual save slots (GameDef.saves.slots), durable and verified like the autosave. Numbered from 1.
SpriteSpecinterface { id, url, fx, fy, w, h, … 9 more }extensionOne thing drawn in the scene, in logical units. fx, fy: its feet (bottom centre), the pivot of rotations.
StageSpecinterface { backdrop, layers, occluders, lights, emitters, reduceMotion }extensionEverything a room shows besides its sprites (RoomDef.stage, normalized by stageOf, conditions evaluated by the model).
StoreOpenertype StoreOpener = (game: GameDef, fail: (e: Error) => void, warn: (m: string) => void) => Promise<SaveStore>extensionHow a host supplies the save store openStore opens, in place of the verified IndexedDB one.
SwModuleinterface { registerSW }extensionregisterSW of virtual:pwa-register (vite-plugin-pwa), injected so the engine never imports a virtual module.

quest-n-click/minigames

NameSignatureStabilityDoc
Minigameinterface { run, required, textParams, bindings }extensionA minigame: run(ctx) until it is won or skipped, and what the validator reads of its params.
MINIGAME_CSSstringpublicThe shared styles of the minigames, injected once by the host.
MinigameCtxinterface { root, u, img, size, sfx, instruct, … 5 more }extensionWhat the host hands a minigame: its zone, the unit scale, images and sounds, parameters, labels and an abort signal.
minigamesRecord<string, Minigame>publicMinigames provided by the engine. A game can add others with the same interface. What tools read (required, textParams, bindings) is h

quest-n-click/testing

NameSignatureStabilityDoc
categoryWorld(cat: Pick<SpeedrunCategory, "seed" | "world">): { world: SpeedrunWorldPolicy; deprecated: boolean; }publicThe world of a category (4.1.16, D29): its world, else what a 4.1.15 seed meant (daily, mystery: that mode's worlds), else the story
Engineclass EnginepublicThe engine without a page: it runs a game against a Presenter and a SaveStore, in the browser, in node tests and in the solver.
FakePresenterclass FakePresenterpublicSilent presenter for node: everything finishes immediately, and everything is logged to log.
fingerprint(ir: GameIR, o: { presentation: unknown; engine: string; }): Promise<GameFingerprint>publicThe fingerprint of a game from its IR, its presentation (presentationOf) and its engine's version.
fingerprintGame(game: GameDef, o: { manifest?: unknown; extensions: ExtensionHashes; engine: string; }): Promise<GameFingerprint>publicA game's fingerprint from its sources as written (before a translation): compiled, its IR made, its presentation read with the manifest. Wha
GameFingerprintinterface { logic, trustedExtensions, presentation, engine }publicA game's fingerprint: SHA-256 in hex of its logic, its trusted extensions, its presentation and its engine (an empty trustedExtensions whe
hashSources(files: Readonly<Record<string, string>>): Promise<string>publicSHA-256 of a set of source files (path → text) through their canonical text: the trusted extensions' hash.
isRankable(v: SpeedrunVerdict): booleanpublicWhether a verdict may be ranked on a leaderboard.
leaderboardKey(categoryId: string, rules: RemixCategoryRules | SpeedrunWorldPolicy, v: WorldVariant): stringpublicThe leaderboard a run goes to: its category, and for a Fixed or a Daily its seed (a Daily's seed names its day). Random and Mystery rank eve
logicalKey(c: CompiledManifest, v: WorldVariant): stringpublicA key for proofs: two variants with the same logical world share a proof certificate.
MemoryStoreclass MemoryStorepublicA save store in memory, for the tests and the solver: nothing survives the process.
MYSTERY_START_WINDOW_MSnumberpublicHow long a Mystery run may start after its seed was first revealed (D26, after the second reading): the client must build the world to play
parseSave(game: GameDef, input: unknown, opts?: ParseSaveOptions): GameStatepublicParses an envelope (or a legacy raw state). Structural corruption and references needed to resume (the current room and active player) are r
presentationOf(game: CompiledGame | GameDef, manifest?: unknown): unknownpublicWhat the fingerprint's presentation hashes: the asset manifest, and every field core/ir-fields.ts classes as presentation (whole) or both
REMIX_CATEGORIESReadonly<Record<string, RemixCategoryRules>>publicThe five categories a Remix game offers by default.
RemixCategoryRulesinterface { seed, mode, fixedSeed, codeWheel }publicWhat a speedrun category says of the world, as 4.1.15 wrote it (seed for the policy). Kept for the frozen surface (D28); `SpeedrunWorldPol
RunClockinterface { monotonicNow, logicalSteps, logicalTime }publicA run's three clocks: monotonicNow the host's monotonic milliseconds (RTA: never reproducible, never an authority), logicalSteps one per
runSeedPolicy(cat: Pick<SpeedrunCategory, "seed">): "fixed" | "random"publicThe run's generator (D29): fixed only when the category says so; anything else is a fresh seed per run.
savedWorld(input: unknown): WorldVariant | undefinedpublicThe world a raw save names (a v4 envelope, a slot record holding one), or undefined (v3, a raw state).
saveEnvelope(game: GameDef, state: GameState, now?: number): SaveEnvelopeV4publicWraps a state in the save envelope a store writes (v4: format, schema, game id and save version, date, and the world the game is played in).
SaveEnvelopeV3interface { format, schema, gameId, gameSaveVersion, savedAt, state }publicA save as written until 4.1.14: the state with the format, the schema, the game's id and save version and the date.
SaveEnvelopeV4interface { format, schema, gameId, gameSaveVersion, savedAt, state, … 1 more }publicA save as written since 4.1.15 (ADR 0018): the v3 envelope and the WorldVariant the game was played in, so that a load rebuilds the same w
SaveWorldMismatchclass SaveWorldMismatchpublicA save made in another world than the game it is loaded into (another seed, another mode): the caller rebuilds the game with `applyVariant(g
seedCommitment(seed: string, nonce: string): stringpublicThe commitment to a Mystery seed (D26): SHA-256 of the seed and a nonce, published (signed) before the start.
SemanticEventtype SemanticEvent = union of 8publicOne thing that happened in the game, numbered (seq, from 1, contiguous). An item handed between players (transfer) is lost by one and ac
SemanticJournalinterface { seq, subscribe, since }publicWhat a host reads of the journal (Engine.journal): the last sequence number, a subscription, the events after a sequence (within the windo
sha256Hex(text: string): Promise<string>publicSHA-256 of a text's UTF-8 bytes, in hex, with WebCrypto.
shortFingerprint(f: GameFingerprint): stringpublicThe short form the pause menu shows: the first eight hex digits of each component (???????? for an unknown one).
solve(gameIn: GameDef, layouts: Record<string, Layout>, opts?: SolveOptions): Promise<SolveResult>publicSearches the game for a way to its ending (witness), or explores every reachable state for softlocks (prove).
SolveOptionsinterface { reality, maxStates, mode, start, goal, commands, … 21 more }publicWhat a search is told: its mode, where it starts and stops, the custom commands, the world's signals and its budgets.
SolveResultinterface { status, exit, headline, mode, reality, finished, … 20 more }publicThe verdict of a search: its status, exit code and headline, the path found, the softlocks and the search's statistics.
SpeedrunEnvelopetype SpeedrunEnvelope = SpeedrunEnvelopeV1 | SpeedrunEnvelopeV2publicA .wsrun file: the proof of one speedrun (schema 1 read, schema 2 written).
SpeedrunEnvelopeV1interface { schema, seed, format, gameId, fingerprint, engineVersion, … 14 more }publicA .wsrun file of 4.1.14 and 4.1.15 (schema 1): its seed is the run's, its world the story world.
SpeedrunEnvelopeV2interface { schema, runSeed, variant, worldEvidence, format, gameId, … 16 more }publicA .wsrun file since 4.1.16 (schema 2, ADR 0019): the run's generator seed and the exact world it was played in, with what that world rests
SpeedrunSeedPolicytype SpeedrunSeedPolicy = SpeedrunWorldPolicy['policy']publicHow a category picks its world.
SpeedrunVerdicttype SpeedrunVerdict = union of 8publicA verifier's verdict (ADR 0017). Only valid ranks; inconclusive is never valid.
SpeedrunVerifyResultinterface { verdict, code, reason, trust, world, recomputed }publicWhat a verifier answers: the verdict, a stable code, one sentence, and the trust it grants.
SpeedrunWorldEvidencetype SpeedrunWorldEvidence = { kind: 'daily'; token: string; } | { kind: 'mystery'; commitmentToken: string; revealToken: string; startedAt: number; }publicWhat a Daily or a Mystery world rests on (4.1.16, ADR 0019): the Bridge's signed tokens, as received. A Daily run carries the day's token; a
TrustLeveltype TrustLevel = 'local' | 'replay-valid' | 'server-witnessed' | 'moderator-verified'publicHow far a run is believed (ADR 0017): raised only by someone other than the player's client.
upgradeEnvelope(game: GameDef, env: SaveEnvelopeV3 | SaveEnvelopeV4): SaveEnvelopeV4publicA v3 envelope as a v4 one (the save migration of 4.1.15): every save made before Remix was played in the story world, so it receives the gam
VerifyContextinterface { game, layouts, commands, fingerprint, engineVersion, keyring, … 3 more }publicThe approved game a run is checked against: its content, layouts, fingerprint, engine, the Bridge's keys.
verifyRun(input: unknown, ctx: VerifyContext): Promise<SpeedrunVerifyResult>publicVerifies a run (.wsrun text or object) against the approved game: never throws, every failure is a verdict.
WorldEvidenceinterface { dailySeed, commitment, reveal, revealedAt, runStartedAt }publicWhat a run's world must match, given the category and what the Bridge published (the day's seed, a commitment).
worldVerdict(rules: RemixCategoryRules | SpeedrunWorldPolicy, v: WorldVariant, e?: WorldEvidence): string[]publicWhether a run's world is the one its category allows: empty when it is, else the reasons (a verifier refuses the run with them). The world i

quest-n-click/reality

NameSignatureStabilityDoc
BridgeKeyinterface { kid, key, notBefore, notAfter, tenantId, environment, … 1 more }publicOne verification key of the Bridge: its id, the key, and when it may sign (epoch ms; rotation overlaps).
CommitTokentype CommitToken = { format, v, id, gameId, mode, commitment, … 1 more }publicWhat a Mystery commitment says.
DayTokentype DayToken = { format, v, gameId, date, seed, mode, … 3 more }publicWhat a day token says.
Faultinterface { delayMs, duplicate, badSignature, expired }publicWhat the simulator does wrong on purpose with one delivery: a delay, a duplicate, a bad signature, an expiry.
httpPort(o: HttpPortOptions): WorldSignalPortpublicThe transport to a Bridge, as a WorldSignalPort: Server-Sent Events read with fetch, or a fetch by cursor.
HttpPortOptionsinterface { url, capability, fetch, retryMs, mode, onStatus, … 3 more }publicHow httpPort reaches a Bridge: its URL, the pairing's capability, the fetch to use, the retry delay and the mode.
importBridgeKey(kid: string, raw: string, window?: Omit<BridgeKey, "kid" | "key">): Promise<BridgeKey>publicAn Ed25519 public key from its 32 raw bytes in base64url (a manifest's or a Bridge's configuration).
Keyringtype Keyring = BridgeKey[]publicThe Bridge's verification keys the player trusts (several during a rotation).
manifestHash(m: RealityManifest): Promise<string>publicThe manifest's hash: SHA-256 of its JSON (keys in this fixed order), hex.
MAX_SIGNAL_CHARSnumberpublicThe largest signed signal accepted, in characters: a signal is an identifier, not a document.
RealityClientclass RealityClientpublicThe player's side of the Reality Bridge: reads signed signals from a port, verifies each, hands it to the engine, waits for the durable save
RealityClientOptionsinterface { engine, store, port, keyring, refreshKeys, playerId, … 7 more }publicWhat a RealityClient is built with: the engine, the store, the port, the keyring, and how it refreshes keys and reports.
realityManifest(game: GameDef): RealityManifest | nullpublicThe manifest of a game that declares reality, null otherwise.
RealityManifestinterface { format, schema, gameId, signals, connectors }publicA game's Reality manifest: the signals it declares, with no secret, as the Bridge checks them.
RefusalCodetype RefusalCode = union of 14publicWhy a signal was refused, as a code (the conformance corpus and the Rust cross-check compare codes) and a sentence.
revealMatches(c: CommitToken, reveal: { seed: string; nonce: string; }): booleanpublicWhether a reveal (seed, nonce) is the one a verified commitment hid.
SignalEnvironmenttype SignalEnvironment = 'prod' | 'staging' | 'dev'publicWhere a Bridge runs, as a signal names it (4.1.10): a signal of one environment is refused by another.
SignalExpectationinterface { gameId, playerId, signals, now, versions, tenantId, … 3 more }publicWhat a signal must match besides its signature.
SignalSimulatorclass SignalSimulatorpublicA Bridge in the browser, for the Studio and the tests: signs and delivers a game's signals, with faults on demand.
SignedWorldSignalV1type SignedWorldSignalV1 = stringpublicA signed signal as it travels: the compact JWS string.
signSignal(payload: WorldSignal, key: CryptoKey, kid: string): Promise<SignedWorldSignalV1>publicSigns a payload as the Bridge does (the Bridge, the tests, the Studio's simulator).
SimulatedDeliveryinterface { sequence, signal, fault, at }publicOne delivery the simulator made: its sequence, its signal, its fault and when.
TokenResulttype TokenResult = { ok: true; token: T; } | { ok: false; reason: string; }publicA verified token, or why it is refused.
verifyCommitment(jws: string, key: BridgeKey, gameId: string): Promise<TokenResult<CommitToken>>publicChecks a Mystery commitment's signature and game.
verifyDayToken(jws: string, key: BridgeKey, gameId: string, now: number | null): Promise<TokenResult<DayToken>>publicChecks a day token offline: the signature (the game's daily key), the game, the window (24 hours), a well-formed seed. now in epoch ms; `n
VerifyResulttype VerifyResult = { ok: true; signal: WorldSignal; } | { ok: false; code: RefusalCode; reason: string; }publicThe outcome of verifySignal: the signal it accepted, or the refusal's code and reason.
verifySignal(jws: unknown, keyring: Keyring, expect: SignalExpectation): Promise<VerifyResult>publicChecks a signed signal, then what it says. The reason of a refusal is a short sentence (logged, never shown raw).
WorldSignaltype WorldSignal = WorldSignalV1 | WorldSignalV2publicEither version of the signed payload.
WorldSignalPortinterface { connect, acknowledge, close }extensionWhere signals from the world outside come from (4.1.1, Reality Bridge): the Bridge's transport (Server-Sent Events, a fetch by cursor), or t
WorldSignalV1type WorldSignalV1 = { schema, format, id, sequence, gameId, playerId, … 8 more }publicThe signed payload, as WorldSignalV1Schema types it.
WorldSignalV1Schemaz.ZodMiniObject<{ schema: z.ZodMiniLiteral<1>; format: z.ZodMiniLiteral<"web-scumm-world-signal">; id: z.ZodMiniString<string>; sequence: z.ZodMiniInt; gameId: publicThe payload the Bridge signs: one accepted fact from outside, as a finite identifier (§4.1).
WorldSignalV2type WorldSignalV2 = { schema, tenantId, environment, audience, sessionId, keyId, … 13 more }publicThe signed payload of 4.1.10, as WorldSignalV2Schema types it.
WorldSignalV2Schemaz.ZodMiniObject<{ schema: z.ZodMiniLiteral<2>; tenantId: z.ZodMiniString<string>; environment: z.ZodMiniEnum<{ prod: "prod"; staging: "staging"; dev: "dev"; }>;publicThe payload of 4.1.10 (ADR 0010): V1's fields and the context it was signed for, so a signal of one tenant, one environment, one origin, one