Versioned, validated wire and save schemas.
Interfaces
AccountStatusWho the server believes is asking — the answer at ACCOUNTPATH.GuideErrorEvery refused or failed guide request answers with one sentence.GuideSessionCreatedWhat the Worker answers with a session created.GuideSessionRequestWhat the browser posts to GUIDESESSIONSPATH.RailsEpochThe shape simulation's RailsEpoch has, declared here because protocol and simulation are the same layer and neither may import the other.SaveCharacterStateThe portable character controller record; simulation owns its behavior.SaveEntitySaveGameSaveMutationSaveSurfacePlacementPortable authored placement; protocol and simulation meet in persistence.SaveThrusterProfileA maneuvering entity's drive, as the save carries it.ServerHealthWhat a server says about itself.SubjectBriefTourCandidateTourContextTourFactTourManifestTourSourceTourWorldQueryUniverseVersionsWhat a build claims about the universe it derives.VersionDriftOne key on which two manifests disagree.VersionsWhat either side of the handshake claims about itself.WireFrameStateWireRailsEpochThe epoch a coasting entity is propagated from (ADR-0025), in its frame.WorkerCancelWorkerFailureWorkerReadyWorkerRequestWorkerSuccessWorkerTimingHow much of itself the worker should describe on its own timeline.
Types
DecodedWhat a Shape decodes to: each field, at the type its decoder yields.DecoderGuideCallGuideClientEventEvery event the browser may send, by shape.GuideClientEventTypeGuideConversationItemWhat the browser adds to the conversation: a message, or a tool's answer.GuideRefusalGuideStopStatusThe answers that end a stop.GuideToolNameGuideToolOutputWhat every tool answers with.GuideVerdictThe Worker's answer at GUIDEVERDICTPATH, for whoever asked: granted with the voices it may speak in, or refused with a reason.GuideVoiceJobIdSaveMutationKindShapeA field-by-field description of an object to decode.TourCameraMotionWireQuatWireUniverseVector[sectorX, sectorY, sectorZ, offsetX, offsetY, offsetZ]WireVec3WorkerInboundWorkerOutbound
Functions
decodedecodeArraydecodeEnumdecodeGuideCalldecodeJsondecodeLiteraldecodeNullabledecodeNumberTupledecodeObjectdecodeOptionaldecodeRecorddescribeDriftencodeFrameStateencodeQuatencodeRailsEpochencodeUniverseVectorencodeVec3endsStopincompatibilityisGuideCameraToolisGuideClientEventisGuideVoiceisWorkerCancelisWorkerTimingmediaPathrefinetourMessageBytesutf8BytesversionDriftwithinTourBytes
Constants
ACCOUNT_PATHAPI_PREFIXPaths, in one place, because four things have to agree on them: the client, the Worker's router, runWorkerFirst in cloudflare.config.ts, and the service worker's cache bypass.decodeAccountStatusdecodeBooleandecodeFrameIddecodeFrameStatedecodeGuideErrordecodeGuideSessionCreateddecodeGuideSessionRequestdecodeGuideVerdictThe verdict, if it is one; a proxy's error page or a stale shape is not.decodeIntegerdecodeNumberdecodeNumberRecorddecodeQuatdecodeRailsEpochdecodeSaveCharacterdecodeSaveEntitydecodeSaveGameDecode a save of the current schema version.decodeSaveMutationdecodeSaveSurfacePlacementdecodeSaveThrusterProfiledecodeServerHealthdecodeStringdecodeStringRecorddecodeSubjectBriefdecodeTourCandidatedecodeTourContextdecodeTourFactdecodeTourManifestdecodeUniverseVectordecodeVec3decodeWireFrameStatedecodeWireQuatdecodeWireRailsEpochdecodeWireVec3decodeWorkerRequestValidate an inbound request envelope.GUIDE_CAMERA_TOOLSThe tools that move the camera or the picture time.GUIDE_CLIENT_EVENTSExactly the tool loop, the scene, the greeting, mute, and close.GUIDE_LIMITSGUIDE_LIST_SCOPESGUIDE_MOTIONSGUIDE_PREFIXThe guide's routes, under APIPREFIX.GUIDE_REFUSAL_SENTENCESGUIDE_REFUSALSWhy the guide is refused.GUIDE_SESSION_LIMITSThe bounds of a session request, both in UTF-8 bytes: the request goes to the provider as an encoded body, so bytes are what the adapter holds it to.GUIDE_SESSIONS_PATHGUIDE_STAR_CLASSESGUIDE_TIME_MODESGUIDE_TOOL_NAMESGUIDE_TOOLSThe inventory as the backend model receives it.GUIDE_VERDICT_PATHGUIDE_VOICESEvery voice the Live reference lists that the panel offers.GUIDE_WORLD_KINDSHEALTH_PATHMEDIA_PREFIXFiles the site serves but does not carry — object storage, not the bundle.NET_PROTOCOL_VERSIONBumped when the shape of anything on the wire changes incompatibly.SAVE_MUTATION_KINDSSAVE_SCHEMA_VERSIONSOCKET_PATHTOUR_LIMITSTOUR_PROTOCOL_VERSION