Skip to content

API reference

See the generated API reference for the SDK exported from @fungi.computer/vishnu.

Thrown by authoring factories and defineCartridge; carries every problem.

  • Error

new CartridgeError(diagnostics): CartridgeError

readonly Diagnostic[]

CartridgeError

Error.constructor

readonly diagnostics: readonly Diagnostic[]

readonly x: number

readonly y: number

readonly z: number


readonly x: number

Vec3.x

readonly y: number

Vec3.y

readonly z: number

Vec3.z

readonly frame: EntityId | null


readonly actor: EntityId

readonly target: MoveDestination

readonly optional excavationTarget?: readonly [number, number, number]

Native excavation contact must be possible from the proposed approach.


readonly actor: EntityId

readonly targets: readonly MoveDestination[]

readonly optional excavationTarget?: readonly [number, number, number]

Native excavation contact must be possible from the selected approach.


readonly version: 1

readonly containers: readonly object[]

readonly lots: readonly object[]


readonly position: Vec3

readonly facing: number


readonly x: number

Vec3.x

readonly y: number

Vec3.y

readonly z: number

Vec3.z

readonly facing: number


readonly minX: number

readonly maxX: number

readonly minZ: number

readonly maxZ: number

readonly height: number


readonly id: EntityId

readonly local: WorldPosition

readonly world: WorldPosition

readonly support: EntityId | null

readonly surface: SupportSurface | null


T extends object

readonly id: `${string}.${string}`

readonly version: number

readonly fields: Readonly<Record<keyof T & string, FieldType>>>>

readonly optional targetField?: keyof T & string

The single entity field targeted by this registered relation, when present.

readonly optional sourceRequires?: readonly `${string}.${string}`[]

Capability IDs required on the source and target relation endpoints.

readonly optional targetRequires?: readonly `${string}.${string}`[]

readonly optional onTargetRemoved?: RelationRemovalPolicy

readonly optional allowSelf?: boolean

readonly validate: (value) => value is T

T | JsonValue

value is T


View-only selection of an art binding from one committed authored field.

readonly visual: string

readonly component: ComponentDefinition<any>>

readonly field: string

readonly cases: Readonly<Record<string, string>>>>


readonly id: EntityId

readonly components: Readonly<Record<ComponentId, ComponentValues>>>>


T extends object = object

readonly components: readonly ComponentDefinition<any>>[]

readonly optional __value?: T


_T extends object = object

readonly id: EntityId

readonly get: <V>>(definition) => V

V extends object

ComponentDefinition<V>

V


readonly key: string

readonly after: string | null

readonly operation: JobOperation

readonly optional continuation?: JobContinuation


readonly definition: string

readonly definitionVersion: number

readonly steps: readonly JobStep[]


readonly accepted: boolean

readonly optional reason?: string | null

readonly optional projectileId?: EntityId

readonly optional launchPoint?: Vec3

readonly optional entityId?: EntityId

readonly revision: number

readonly optional attempt?: WorkAttemptKey


readonly id: string

readonly sequence: number

readonly optional projectileId?: EntityId

readonly sourceId: EntityId

readonly targetId: EntityId

readonly time: number

readonly point: Vec3

readonly normal: Vec3

readonly velocity: Vec3


readonly revision: number

readonly results: readonly ActionResult[]

readonly impacts: readonly Impact[]


readonly action: ActionRequest

readonly result: ActionResult


readonly task: EntityId

readonly generation: number


readonly continuationOwner: "external" | "native"

readonly key: WorkAttemptKey

readonly worker: EntityId

readonly execution: WorkExecution

readonly phase: WorkAttemptPhase


readonly now: number

readonly delta: number

readonly tick: number


readonly definition: string

readonly version: number

readonly stationCatalog: string

readonly inputs: readonly object[]

readonly stages: readonly object[]

readonly phase: "blocked" | "complete" | "working" | "waiting"


next(): number

number


readonly clock: SimulationClock

readonly outcomes: readonly ActionOutcome[]

readonly random: RandomSource

readonly impacts: readonly Impact[]

readonly optional workAttempts?: (taskIds) => readonly WorkAttempt[]

readonly EntityId[]

readonly WorkAttempt[]

readonly workAttemptForWorker: (worker) => WorkAttempt | null

EntityId

WorkAttempt | null

readonly processRequirements: (definition, station) => ProcessRequirements

string

EntityId

ProcessRequirements

readonly floorOperations: (requests) => readonly FloorOperation[]

readonly FloorOperationRequest[]

readonly FloorOperation[]

flowFields(geometry): FlowNavigation

Session-owned shared navigation, derived from declared world geometry.

FlowGeometry

FlowNavigation

query<T>>(spec): readonly QueryRow<T>>[]

T extends object

QuerySpec<T>

readonly QueryRow<T>[]

workMaterialFacts(): WorkMaterialFacts

One committed physical projection shared by all work phases in a step.

WorkMaterialFacts

worldPoses(entities): readonly WorldPose[]

readonly EntityId[]

readonly WorldPose[]

routeCosts(requests): readonly RouteCostResult[]

readonly RouteCostRequest[]

readonly RouteCostResult[]

routeToAny(request): RouteToAnyResult

RouteToAnyRequest

RouteToAnyResult

transferContacts(request): { kind: "ready"; targets: readonly MoveDestination[]; } | { kind: "blocked"; reason: "sealed" | "unavailable-frame" | "no-contact"; }

EntityId

EntityId

{ kind: "ready"; targets: readonly MoveDestination[]; } | { kind: "blocked"; reason: "sealed" | "unavailable-frame" | "no-contact"; }

physicalContacts(cells): readonly PhysicalContact[]

readonly [number, number, number][]

readonly PhysicalContact[]

environmentFacts(): object

object

terrainRevision: number

placementRevision: number

totalKg: number

residualKg: number

initialTotalKg: number

boundaryKg: number

cells: object[]

emissions: object[]

atmosphereSamples(cells): AtmosphereSamples

Returns modeled atmosphere at each cell; null means the receiver is unmodeled, not clean air.

readonly [number, number, number][]

AtmosphereSamples

constructionReadiness(sites): readonly ConstructionReadiness[]

readonly EntityId[]

readonly ConstructionReadiness[]

constructionAccess(sites): readonly ConstructionAccess[]

Ordered structural, material, and work-contact facts for construction allocation.

readonly EntityId[]

readonly ConstructionAccess[]

deconstructionAccess(sites): readonly DeconstructionAccess[]

readonly EntityId[]

readonly DeconstructionAccess[]

terrainMaterials(cells): readonly number[]

readonly [number, number, number][]

readonly number[]

terrainSurfaces(columns): readonly (Readonly<{ cell: readonly [number, number, number]; material: number; generatedTop: number; cover?: Readonly<{ kind: string; condition: string; height: string; }>; }> | null)[]

readonly [number, number][]

readonly (Readonly<{ cell: readonly [number, number, number]; material: number; generatedTop: number; cover?: Readonly<{ kind: string; condition: string; height: string; }>; }> | null)[]

structureSurfaces(columns): readonly readonly StructureSurface[][]

readonly [number, number][]

readonly readonly StructureSurface[][]

waterContacts(centers): readonly object[]

readonly [number, number, number][]

readonly object[]


readonly scope: ActionScope

readonly request: ActionRequest


readonly scope: ActionScope

readonly record: EntityRecord


readonly scope: ActionScope

readonly entity: EntityId


Ground-plane crowd destination, advanced by the native simulation phase.

readonly entity: EntityId

readonly x: number

readonly z: number

readonly speed: number


readonly clock: SimulationClock

ReadContext.clock

readonly outcomes: readonly ActionOutcome[]

ReadContext.outcomes

readonly random: RandomSource

ReadContext.random

readonly impacts: readonly Impact[]

ReadContext.impacts

readonly optional workAttempts?: (taskIds) => readonly WorkAttempt[]

readonly EntityId[]

readonly WorkAttempt[]

ReadContext.workAttempts

readonly workAttemptForWorker: (worker) => WorkAttempt | null

EntityId

WorkAttempt | null

ReadContext.workAttemptForWorker

readonly processRequirements: (definition, station) => ProcessRequirements

string

EntityId

ProcessRequirements

ReadContext.processRequirements

readonly floorOperations: (requests) => readonly FloorOperation[]

readonly FloorOperationRequest[]

readonly FloorOperation[]

ReadContext.floorOperations

flowFields(geometry): FlowNavigation

Session-owned shared navigation, derived from declared world geometry.

FlowGeometry

FlowNavigation

ReadContext.flowFields

query<T>>(spec): readonly QueryRow<T>>[]

T extends object

QuerySpec<T>

readonly QueryRow<T>[]

ReadContext.query

workMaterialFacts(): WorkMaterialFacts

One committed physical projection shared by all work phases in a step.

WorkMaterialFacts

ReadContext.workMaterialFacts

worldPoses(entities): readonly WorldPose[]

readonly EntityId[]

readonly WorldPose[]

ReadContext.worldPoses

routeCosts(requests): readonly RouteCostResult[]

readonly RouteCostRequest[]

readonly RouteCostResult[]

ReadContext.routeCosts

routeToAny(request): RouteToAnyResult

RouteToAnyRequest

RouteToAnyResult

ReadContext.routeToAny

transferContacts(request): { kind: "ready"; targets: readonly MoveDestination[]; } | { kind: "blocked"; reason: "sealed" | "unavailable-frame" | "no-contact"; }

EntityId

EntityId

{ kind: "ready"; targets: readonly MoveDestination[]; } | { kind: "blocked"; reason: "sealed" | "unavailable-frame" | "no-contact"; }

ReadContext.transferContacts

physicalContacts(cells): readonly PhysicalContact[]

readonly [number, number, number][]

readonly PhysicalContact[]

ReadContext.physicalContacts

environmentFacts(): object

object

terrainRevision: number

placementRevision: number

totalKg: number

residualKg: number

initialTotalKg: number

boundaryKg: number

cells: object[]

emissions: object[]

ReadContext.environmentFacts

atmosphereSamples(cells): AtmosphereSamples

Returns modeled atmosphere at each cell; null means the receiver is unmodeled, not clean air.

readonly [number, number, number][]

AtmosphereSamples

ReadContext.atmosphereSamples

constructionReadiness(sites): readonly ConstructionReadiness[]

readonly EntityId[]

readonly ConstructionReadiness[]

ReadContext.constructionReadiness

constructionAccess(sites): readonly ConstructionAccess[]

Ordered structural, material, and work-contact facts for construction allocation.

readonly EntityId[]

readonly ConstructionAccess[]

ReadContext.constructionAccess

deconstructionAccess(sites): readonly DeconstructionAccess[]

readonly EntityId[]

readonly DeconstructionAccess[]

ReadContext.deconstructionAccess

terrainMaterials(cells): readonly number[]

readonly [number, number, number][]

readonly number[]

ReadContext.terrainMaterials

terrainSurfaces(columns): readonly (Readonly<{ cell: readonly [number, number, number]; material: number; generatedTop: number; cover?: Readonly<{ kind: string; condition: string; height: string; }>; }> | null)[]

readonly [number, number][]

readonly (Readonly<{ cell: readonly [number, number, number]; material: number; generatedTop: number; cover?: Readonly<{ kind: string; condition: string; height: string; }>; }> | null)[]

ReadContext.terrainSurfaces

structureSurfaces(columns): readonly readonly StructureSurface[][]

readonly [number, number][]

readonly readonly StructureSurface[][]

ReadContext.structureSurfaces

waterContacts(centers): readonly object[]

readonly [number, number, number][]

readonly object[]

ReadContext.waterContacts

checkpoint(name): void

Ask the host to retain this committed simulation state for retry.

string

void

write<T>>(definition, entity, value): void

T extends object

ComponentDefinition<T>

EntityId

T

void

action(request, scope?): void

ActionRequest

ActionScope

void

createAuthoredEntity(record, scope?): void

EntityRecord

ActionScope

void

removeAuthoredEntity(id): void

EntityId

void

retireActor(id): void

Retire a physical actor in this committed step. Rules only.

EntityId

void

cue(cue): void

Author a bounded, presentation-only feedback cue for this committed step. Never changes simulation state; only surfaces when the game opts into presentation.feedback.

AuthoredFeedbackCue

void


readonly id: `${string}.${string}`

readonly version: number

readonly reads: readonly ComponentDefinition<any>>[]

readonly writes: readonly ComponentDefinition<any>>[]

readonly optional every?: number

readonly optional consumesImpacts?: boolean

readonly run: (context) => void

WriteContext

void


readonly origin: Vec3

readonly muzzle: Vec3

readonly inheritedVelocity: Vec3

readonly radius: number

readonly gravity: number

readonly penetration: number

readonly maxRange: number

readonly maxLifetime: number

readonly speed: number


readonly id: EntityId

readonly origin: Vec3

readonly velocity: Vec3

readonly geometry: "ball" | "cuboid"

readonly radius: number

readonly halfX: number

readonly halfY: number

readonly halfZ: number

readonly yaw: number

readonly offsetX: number

readonly offsetY: number

readonly offsetZ: number

readonly material: object

readonly response: "stop" | "pierce" | "ground"

readonly resistance: number

readonly restitution: number

readonly friction: number

readonly embedSpeed: number


readonly optional activity?: { kind: "dig" | "build" | "chop"; target: [number, number]; progress?: number; } | { kind: "delivery"; phase: "fetching" | "pickup" | "carrying" | "putting-down"; material: string; target: [number, number]; progress?: number; }

readonly optional movement?: { baseSpeed: number; effectiveSpeed: number; routed: boolean; } | null

Native movement speed selected for the current route; base speed survives the order.

readonly optional view?: object

readonly optional pickable?: boolean

readonly optional cutawayTop?: number

readonly optional aim?: ProjectileAim | null

readonly optional collision?: CollisionFact | null

readonly optional projectile?: { velocity: Vec3; gravity: number; state: "flying" | "rolling" | "resting" | "embedded"; embedDepth: number; rollNormal: Vec3; penetration: number; } | null

readonly id: EntityId

readonly optional pose?: Pose

Resolved world pose, including any moving or rotated support.

readonly optional local?: Pose

Native local pose; for supported entities this is relative to frame.

readonly optional support?: EntityId | null

readonly optional frame?: EntityId

Observation frame for a supported entity; local is measured in this frame.

readonly optional surface?: SupportSurface | null

readonly optional visual?: string | null

readonly optional appearance?: object

A rigged actor’s paper doll (vishnu.biped.v1): body profile, wardrobe slot → item, palette channel → swatch, and the cuts it has lost. Drawn instead of visual when present.

readonly profile: string

readonly slots: Readonly<Partial<Record<string, string>>>>>>

readonly palette: Readonly<Partial<Record<string, string>>>>>>

readonly severed: readonly string[]

readonly optional limb?: string

A loose limb: the cut it came off at (drawn from its severed bake).

readonly optional gaze?: readonly [number, number]

Where the actor aims or looks, as a ground point [x, z]: its body faces it even while walking (the game’s presentation gazes).

readonly optional act?: object

A one-shot state the actor is in (the game’s presentation acts).

readonly state: string

readonly since: number

readonly seconds: number

readonly optional label?: string | null

readonly optional placement?: VisualPlacement

readonly optional selected?: boolean

readonly optional hands?: object

What the actor holds in its hands, from the native hands slot only. Held props and carry poses derive from this, never from inventory, job intent or a route.

readonly lot: EntityId

readonly kind: string

readonly quantity: number

readonly optional container?: object

readonly capacity: number

readonly contents: object

readonly items: readonly object[]

readonly optional overflow?: boolean

readonly optional inventory?: object

readonly items: readonly object[]

readonly optional overflow?: boolean

readonly optional direct?: { stream: string; lastQueued: number; lastProcessed: number; speed: number; blocked: readonly [number, number, number][]; closedFaces: readonly object[]; bounds: { min_x: number; max_x: number; min_z: number; max_z: number; } | null; } | null


readonly kind: "delivery"

readonly phase: DeliveryActivityPhase

readonly material: string

readonly target: readonly [number, number]


readonly actor: EntityId

readonly kind: "dig" | "build" | "chop"

readonly target: readonly [number, number]

readonly optional progress?: number


readonly volumeId: string

readonly temperatureC: number

readonly smokeKgM3: number


readonly revision: number

readonly geometryRevision: number

readonly samples: readonly (AtmosphereSample | null)[]


readonly site: EntityId

readonly status: ConstructionReadinessStatus

readonly optional reason?: "missingStructuralSupport"


readonly site: EntityId

readonly catalog: string

readonly target: ConstructionTarget


readonly site: EntityId

readonly status: "ready" | "rejected"

readonly optional reason?: string


readonly revision: number

readonly placementRevision: number

readonly decisions: readonly PlacementDecision[]


readonly site: EntityId

readonly support: ConstructionReadinessStatus

readonly materialsReady: boolean

readonly blockedActors: readonly EntityId[]

readonly contacts: readonly ConstructionAccessContact[]


readonly cell: readonly [number, number, number]

readonly groundwaterHead: number


readonly materials: readonly object[]

Content-owned art family for each physical material slot.

readonly optional generatedCover?: (input) => Readonly<{ kind: string; condition: string; height: string; }> | null

Pure fresh-world cover projection. Later physical cover mutations override it.

readonly [number, number, number]

number

number

string

string

Readonly<{ kind: string; condition: string; height: string; }> | null


readonly partyJoinIdentity: (bindingId) => PartyJoinIdentity

string

PartyJoinIdentity

readonly floorOperations: (requests) => readonly FloorOperation[]

readonly FloorOperationRequest[]

readonly FloorOperation[]

readonly transferContacts: (request) => { kind: "ready"; targets: readonly MoveDestination[]; } | { kind: "blocked"; reason: "sealed" | "unavailable-frame" | "no-contact"; }

EntityId

EntityId

{ kind: "ready"; targets: readonly MoveDestination[]; } | { kind: "blocked"; reason: "sealed" | "unavailable-frame" | "no-contact"; }

readonly physicalContacts: (cells) => readonly PhysicalContact[]

readonly [number, number, number][]

readonly PhysicalContact[]

readonly routeCosts: (requests) => readonly RouteCostResult[]

readonly RouteCostRequest[]

readonly RouteCostResult[]

readonly routeToAny: (request) => RouteToAnyResult

RouteToAnyRequest

RouteToAnyResult

readonly dispose: () => void

void

readonly load: (definition) => void

Uint8Array

void

readonly loadEnvironment: (definition) => void

Uint8Array

void

readonly environmentFacts: () => object

object

terrainRevision: number

placementRevision: number

totalKg: number

residualKg: number

initialTotalKg: number

boundaryKg: number

cells: object[]

emissions: object[]

readonly atmosphereSamples: (cells) => AtmosphereSamples

readonly [number, number, number][]

AtmosphereSamples

readonly constructionReadiness: (sites) => readonly ConstructionReadiness[]

Read-only support projection for pending construction, resolved in one native batch.

readonly EntityId[]

readonly ConstructionReadiness[]

readonly placementDecisions: (party, candidates) => PlacementDecisionResponse

Advisory native geometry decision; command admission always rechecks.

EntityId

readonly PlacementCandidate[]

PlacementDecisionResponse

readonly constructionAccess: (sites) => readonly ConstructionAccess[]

readonly EntityId[]

readonly ConstructionAccess[]

readonly deconstructionAccess: (sites) => readonly DeconstructionAccess[]

readonly EntityId[]

readonly DeconstructionAccess[]

readonly terrainMaterials: (cells) => readonly number[]

readonly [number, number, number][]

readonly number[]

readonly terrainSurfaces: (columns) => readonly (Readonly<{ cell: readonly [number, number, number]; material: number; generatedTop: number; cover?: Readonly<{ kind: string; condition: string; height: string; }>; }> | null)[]

readonly [number, number][]

readonly (Readonly<{ cell: readonly [number, number, number]; material: number; generatedTop: number; cover?: Readonly<{ kind: string; condition: string; height: string; }>; }> | null)[]

readonly surfaceWaterTable: (columns) => readonly (SurfaceWaterContact | null)[]

readonly [number, number][]

readonly (SurfaceWaterContact | null)[]

readonly waterContacts: (centers) => readonly object[]

readonly [number, number, number][]

readonly object[]

readonly terrainChanges: (sinceRevision) => TerrainChangeSet

number

TerrainChangeSet

readonly structureSurfaces: (columns) => readonly readonly StructureSurface[][]

readonly [number, number][]

readonly readonly StructureSurface[][]

readonly query: <T>>(spec) => readonly QueryRow<T>>[]

T extends object

QuerySpec<T>

readonly QueryRow<T>[]

readonly workMaterialFacts: () => WorkMaterialFacts

Compact native owner projection for shared work/material planning.

WorkMaterialFacts

readonly workAttempts: (taskIds) => readonly WorkAttempt[]

readonly EntityId[]

readonly WorkAttempt[]

readonly workAttemptForWorker: (worker) => WorkAttempt | null

EntityId

WorkAttempt | null

readonly processRequirements: (definition, station) => ProcessRequirements

string

EntityId

ProcessRequirements

readonly entityMembership: (ids) => readonly boolean[]

readonly EntityId[]

readonly boolean[]

readonly advanceCandidate: (delta, writes, actions, options?) => AdvanceResult

Region-owned disposable attempt only: an error requires discarding the candidate.

number

readonly WriteIntent[]

readonly ScopedAction[]

readonly ScopedCreate[]

readonly ScopedRemove[]

readonly EntityId[]

readonly CrowdMotion[]

AdvanceResult

readonly advance: (delta, writes, actions, options?) => AdvanceResult

number

readonly WriteIntent[]

readonly ScopedAction[]

readonly ScopedCreate[]

readonly ScopedRemove[]

readonly EntityId[]

readonly CrowdMotion[]

AdvanceResult

readonly snapshot: () => KernelRecordSnapshot

KernelRecordSnapshot

readonly capture: () => KernelRecordCaptureResult

Resident-only capture; do not mutate or expose its borrowed record bytes.

KernelRecordCaptureResult

readonly acceptCapture: () => void

Called only after the Region transaction accepted the captured state.

void

readonly restore: (snapshot) => void

KernelRecordSnapshot

void

readonly renderFacts: (limit?) => readonly RenderFact[]

number

readonly RenderFact[]

readonly worldPoses: (entities) => readonly WorldPose[]

readonly EntityId[]

readonly WorldPose[]


readonly id: string

readonly version: number

readonly optional localScope?: CommandScope

readonly optional localPartyBinding?: string

The instantiate-actors binding that seats the local player’s party (from players.local.bootstrap): the local “party” event and a per-viewer directControl: { person } resolve from it.

readonly optional interest?: object

A player viewer’s observation carries only render facts, presentation facts and cues within this many metres (xz distance) of an actor that viewer owns (see sdk/party ownedActorIds). Unset: unfiltered, as today. Mirrors page.interest.

readonly radius: number

readonly definition: Uint8Array

readonly optional environmentDefinition?: Uint8Array<ArrayBufferLike>>

readonly optional presentationWindow?: object

readonly minX: number

readonly maxX: number

readonly minZ: number

readonly maxZ: number

readonly optional terrainPresentation?: TerrainPresentationDefinition

Game-authored terrain vocabulary. The engine owns no grass or biome IDs.

readonly components: readonly ComponentDefinition<any>>[]

readonly optional visualVariants?: readonly VisualVariantRule[]

Resolved into render facts; never written to the kernel or its digest.

readonly optional actors?: readonly ActorDefinition[]

Prepared content templates; native lifecycle owns their instantiation.

readonly systems: readonly SystemDefinition[]

readonly optional horde?: HordeSimulation

readonly optional presentation?: GamePresentation

readonly optional bootstrapActions?: readonly ActionRequest[]

Fresh-world setup that must commit before the first player command.

readonly optional opening?: object

A fresh local world’s story start, played only when the session opts in: host actions (spawned scenery, say), then the local player’s commands (a pre-marked tree).

readonly actions: readonly ActionRequest[]

readonly commands: readonly object[]

readonly optional initialActions?: readonly ActionRequest[]

readonly optional scenarios?: Readonly<Record<string, GameScenario>>>>

Dev and test scenarios: a fresh local world started with one of these ids plays its host actions after the initial actions, then queues its commands. Worlds started without a scenario never see them.

readonly optional partyJoin?: Readonly<{ footprint: readonly readonly [number, number][]; prepare: (spawn) => ActorInstantiationPlan; }>

readonly optional commands?: Readonly<Record<string, GameCommandDefinition>>>>

Heterogeneous command inputs are erased at the pack registry boundary.

readonly optional persistentCharacters?: (context) => number

Persistent characters living in this world right now (a player’s, or an AI stand-in’s), read from committed state. The hosted engine keeps an always-ticking world’s clock self-renewing while this is greater than zero, so offline characters stay in danger; at zero the world may rest after an idle grace window. A pack that omits this never keeps a world ticking on character count alone.

Pick<ReadContext, "query">

number


A named dev/test setup for a fresh world (see GamePack.scenarios).

readonly actions: readonly ActionRequest[]

readonly commands: readonly object[]


readonly actions: readonly ActionRequest[]

readonly writes: readonly WriteIntent[]

readonly optional creates?: readonly EntityRecord[]

readonly optional removes?: readonly EntityId[]


readonly input: ZodType

The sole parser for input entering this command.

readonly title: string

Semantic metadata shared by human and agent projections.

readonly category: string

readonly description: string

readonly optional localPresentation?: object

Client-local acquisition metadata for the existing Vishnu gestures.

readonly bindings: readonly Readonly<{ id: string; label: string; detail?: string; selection?: "entities" | Readonly<{ field: string; cardinality: "one"; }>; target?: "actor" | "terrain-cell" | "terrain-area" | "world-surface" | "world-edge"; component?: `${string}.${string}`; designation?: readonly ("entities" | "point" | "line" | "rectangle" | "edge-line")[]; footprint?: readonly readonly [number, number][]; placement?: "action-bar"; key?: string; preset?: JsonValue; }>[]

readonly optional availability?: (context) => GameCommandAvailability

Host-owned discoverability state, evaluated against the committed world.

Pick<ReadContext, "query">

GameCommandAvailability

readonly optional subjects?: (context) => readonly EntityId[]

Stable subjects for contextual UI projection, evaluated from authoritative state.

Pick<ReadContext, "query">

readonly EntityId[]

readonly optional lifecycle?: readonly ComponentDefinition<any>>[]

Authored record creation/removal only; does not grant progress writes.

readonly optional reads?: readonly ComponentDefinition<any>>[]

readonly writes: readonly ComponentDefinition<any>>[]

readonly invoke: (context, input) => GameCommandResult

Erased invocation closes over the parsed handler input in the authoring factory.

GameCommandContext

JsonValue | undefined

GameCommandResult


readonly id: string

readonly version: number

readonly definition: Uint8Array


A weapon trail on the world plane. Direction is normalized at intake; angle is the full sweep in radians and height is above the cue’s anchor. This draws contact intent; collision and damage remain simulation-owned.

readonly direction: object

readonly x: number

readonly z: number

readonly radius: number

readonly angle: number

readonly height: number

readonly ms: number

readonly color: string


id: `${string}.${string}`

version: number

optional reads?: readonly ComponentDefinition<any>>[]

optional writes?: readonly ComponentDefinition<any>>[]

optional every?: number

optional consumesImpacts?: boolean

run: (context) => void

WriteContext

void


readonly component: ComponentDefinition<any>>

readonly optional initial?: object


Authoring-only capability compiled by an owning engine module.

T extends object

readonly kind: "actor-definition-capability"

readonly id: `${string}.${string}`

readonly schema: ZodType<T>>

The sole parser for this capability’s authored value.

readonly optional externalCreation?: boolean

Another owner creates this actor; omit it from direct spawn templates.


readonly capability: ActorDefinitionCapability<any>>

readonly value: object


readonly kind: "actor-input"

readonly name: string

readonly type: FieldType | "actor-reference"


readonly id: string

readonly version: number

readonly capabilities: readonly ActorCapability[]

readonly definitionCapabilities: readonly ActorDefinitionCapabilityValue[]

readonly behaviors: readonly BehaviorDefinition[]

with<T>>(component, initial?): ActorDefinition

T extends object

ComponentDefinition<T>

ActorInitial<T>

ActorDefinition

ActorBuilder.with

with<T>>(capability, value): ActorDefinition

T extends object

ActorDefinitionCapability<T>

T

ActorDefinition

ActorBuilder.with

behaves(…behaviors): ActorDefinition

…readonly BehaviorDefinition[]

ActorDefinition

ActorBuilder.behaves


A named, deterministic question used by an authored behavior branch.

readonly id: `${string}.${string}`

readonly reads: readonly ComponentDefinition<any>>[]

readonly facts: readonly NativeFact[]

readonly test: (subject, context) => boolean

QueryRow

ReadContext

boolean


A named proposal producer. The existing system/session owners commit its work.

readonly id: `${string}.${string}`

readonly reads: readonly ComponentDefinition<any>>[]

readonly writes: readonly ComponentDefinition<any>>[]

readonly facts: readonly NativeFact[]

readonly optional exclusive?: string

readonly run: (subject, context) => void

QueryRow

WriteContext

void


A prepared actor behavior. It is not a system: pack preparation installs it once for every actor that attaches it (installActorBehaviors).

readonly kind: "behavior"

readonly id: `${string}.${string}`

readonly version: number

readonly optional every?: number

readonly optional consumesImpacts?: true

Whether its predicates and actions read the step’s projectile impacts.

readonly subjects: readonly ComponentDefinition<any>>[]

Components every attaching actor must carry.


where(…predicates): BehaviorSelection

…readonly PredicateDefinition[]

BehaviorSelection

do(action): void

BehaviorActionDefinition

void


find(…subjects): BehaviorSelection

…readonly ComponentDefinition<any>[]

BehaviorSelection


readonly optional version?: number

readonly optional every?: number

Run every n-th step instead of every step.

readonly optional consumesImpacts?: boolean

Let its predicates and actions read context.impacts: the projectile impacts committed since this behavior last ran (a round hitting a body, a ball striking a hull). Each impact reaches the behavior once. Off by default, so a behavior that never asks sees no impacts.


with<T>>(component, initial?): ActorDefinition

T extends object

ComponentDefinition<T>

ActorInitial<T>

ActorDefinition

with<T>>(capability, value): ActorDefinition

T extends object

ActorDefinitionCapability<T>

T

ActorDefinition

behaves(…behaviors): ActorDefinition

…readonly BehaviorDefinition[]

ActorDefinition


One opening on a module’s side; at counts cells along that side. style names the game’s own variant of it (a barred cell door), over the side’s style.

readonly side: BlueprintSide

readonly at: number

readonly kind: BlueprintOpeningKind

readonly optional style?: string


One room: size is [width along x, depth along z] in cells.

readonly id: string

readonly size: readonly [number, number]

readonly openings: readonly BlueprintOpening[]

readonly slots: Readonly<Record<string, readonly [number, number]>>

Named cells inside the room ([x, z] from its north-west corner) a game fills with containers, fixtures or actors.

readonly tags: readonly string[]

readonly sides: Readonly<Partial<Record<BlueprintSide, string>>>>>>

A style for every piece on a side (bars along a cell’s front): the game maps each style to its own buildables (compileBlueprint).


A module placed in a recipe: its north-west corner at at, then turned rotate quarter turns clockwise and mirrored east-west if asked.

readonly module: BlueprintModule

readonly at: readonly [number, number]

readonly optional rotate?: 0 | 1 | 2 | 3

readonly optional mirror?: boolean


readonly modules: readonly BlueprintPlacement[]


One wall, door or window: the face after cell along axis, in the style a room gave it (absent: the plain piece).

readonly kind: "wall" | "window" | "door"

readonly cell: readonly [number, number]

readonly axis: "x" | "z"

readonly optional style?: string


One room cell covered by the kit’s floor buildable.

readonly kind: "floor"

readonly cell: readonly [number, number]


readonly index: number

Index into the recipe’s modules.

readonly module: string

readonly tags: readonly string[]

readonly cells: readonly readonly [number, number][]

Its cells in the world, sorted.


readonly room: number

readonly module: string

readonly name: string

readonly at: readonly [number, number]


An assembled building: its pieces, rooms and slots, in a fixed order.

readonly pieces: readonly BlueprintPiece[]

readonly rooms: readonly BlueprintRoom[]

readonly slots: readonly BlueprintSlot[]


readonly buildables: readonly ActorDefinition[]

Buildable actors, in build-bar order.

readonly verticalMetres: number

Metres per vertical cell of the world these structures stand in.

readonly namespace: string

Id prefix for construction sites and floor replacements.

readonly party: (context) => EntityId

The party a player’s build command plans for.

Pick<GameCommandContext, "query" | "scope">

EntityId

readonly optional restyle?: (context) => ReadonlyMap<EntityId, string>>

State-dependent art for particular sites (a lit hearth, say).

Pick<ReadContext, "query" | "environmentFacts">

ReadonlyMap<EntityId, string>


One staged construction sprite, ready for the visual projection.

readonly id: EntityId

readonly cutawayTop: number

readonly visual: string

readonly label: string

readonly pickable: true

readonly optional placement?: { kind: "edge"; edge: { cell: readonly [number, number, number]; axis: "x" | "z"; }; } | NonNullable<PlacementDatum | undefined> & { readonly orientation: CardinalOrientation; }

readonly pose: object

readonly position: object

readonly x: number

readonly y: number

readonly z: number

readonly facing: number


Everything the Construction extension derives from its buildables.

readonly buildables: readonly ActorDefinition[]

readonly catalog: ReadonlyMap<string, CompiledBuildable>>

readonly placement: Readonly<Record<string, PlacementPresentation>>>>

Placement ghost art and facing per catalog id.

readonly candidates: (input) => readonly PlacementCandidate[]

string = ...

"north" | "east" | "south" | "west" = ...

{ cell: [number, number, number]; } | { area: { start: [number, number, number]; end: [number, number, number]; }; } | { edges: object[]; } = ...

readonly PlacementCandidate[]

readonly build: GameCommandDefinition

readonly visuals: (context) => readonly ConstructionVisual[]

Staged art from the site’s catalog and phase alone.

Pick<ReadContext, "query">

readonly ConstructionVisual[]

readonly presented: (context) => readonly ConstructionVisual[]

Staged art with the cartridge’s state-dependent restyling applied.

Pick<ReadContext, "query" | "environmentFacts">

readonly ConstructionVisual[]

readonly environment: (base) => EnvironmentDefinition

Add the buildables to a world’s structure catalog.

EnvironmentDefinition

EnvironmentDefinition


One sprite id’s art: a static art-bank frame, a bank figure, or a rigged paper doll. Data only; the client checks it when it draws.

readonly kind: "static" | "figure" | "doll"

readonly worldRole: "actor" | "floor" | "item" | "structure"

readonly optional variants?: Readonly<{ component: ComponentDefinition<any>>; field: string; cases: Readonly<Record<string, string>>>>; }>

Select another declared sprite from one committed authored field. An absent or unmapped value keeps this binding.

readonly optional path?: BankPath

Static: the bank path, per-turn view paths, frames and anchor.

readonly optional viewPaths?: readonly BankPath[]

readonly optional frames?: boolean

readonly optional frameMs?: number

Static frames: milliseconds per frame (default: the shared idle rate).

readonly optional facing?: boolean

readonly optional anchor?: "pawnAnchor" | "propAnchor" | "vehicleAnchor"

readonly optional drawsUpright?: boolean

Order as an upright body rather than by its footprint.

readonly optional key?: string

Figure: the bank figure key.

readonly optional dollPoses?: Readonly<Record<string, Readonly<{ clip: string; held?: string; last?: boolean; }>>>

Doll: each pose’s paper-doll clip, and the item it holds meanwhile. walk and idle choose the gait clips (default: the clips of those names), so a cast can shamble or crawl. last holds the clip’s last frame instead of playing it (a body that has fallen and lies still).

readonly optional motion?: Readonly<{ kind: string; stride: number; localOffset?: Readonly<{ x: number; y: number; z: number; }>; }>

readonly optional workPoses?: Readonly<Record<string, string>>>>

readonly optional gaitStride?: number

Doll: metres per gait step, so a walk or run cycle follows the ground covered (no foot sliding at any speed). Defaults to motion.stride.

readonly optional actPoses?: Readonly<Record<string, Readonly<{ clip: string; held?: string; }>>>

Doll: the clip for each one-shot act state (the presentation’s acts, such as a swing or a shot), played once over any gait.

readonly optional deliveryPoses?: Readonly<Record<string, string>>>>

readonly optional luminous?: Readonly<{ path: BankPath; }>

Static: self-lit art (flames, sparks, smoke) at path, drawn with the same facing, frames and anchor above the graded world, so a night mood never darkens or requantizes it. View only.

readonly optional light?: Readonly<{ radius: number; color: number; flicker: number; }>

A view-only point light centered on this visual; never enters world state.

readonly optional carryPoses?: Readonly<Record<string, string | Readonly<{ contentKind: string; empty: string; partial: string; full: string; }>>>

readonly optional reactions?: Readonly<Record<string, Readonly<{ path: BankPath; duration: number; }>>>

readonly optional edgeWall?: Readonly<{ kind: "segment"; stage: string; axis: "x" | "z"; junction: string; }>

A wall-like edge segment and the junction art its corners use.


One checked cartridge art pack’s files, as bundler-resolved URLs (a build renames every file, so the pack names each page’s URL).

readonly manifestUrl: string

readonly pageUrls: Readonly<Record<string, string>>>>


How the hub shelf lists a cartridge. Presentation only.

readonly order: number

Lower numbers appear first. Games own their position, not the engine.

readonly genre: string

readonly blurb: string

readonly cover: object

readonly src: string

readonly alt: string


A selected object whose visual starts with visualPrefix gets its own named card in the selection panel.

readonly visualPrefix: string

readonly heading: string

readonly optional note?: string


Aiming on the page, twin-stick style. pointer: a plain click on the world sends command with { at: { x, z } } (the clicked actor, or the ground at the direct-control actor’s height). arrows: a held arrow key sends { toward: { x, z } } (up is north) at once, then every repeatSeconds (default 0.25) while held, and arrows stop moving the direct-control actor. A gamepad’s right stick aims the same way, and its left stick drives the direct-control actor. hold: a held aim is a lease the game keeps firing on at its own cadence: each send is { toward: { x, z }, held: true }, and letting go sends { release: true }. The command decides what each one does.

readonly command: string

readonly optional pointer?: boolean

readonly optional arrows?: boolean

readonly optional repeatSeconds?: number

readonly optional hold?: boolean


What the player shell shows around the world. Read-only presentation.

readonly subtitle: string

readonly camera: CartridgeCameraPolicy

readonly optional directControl?: CartridgeDirectControl

readonly optional aim?: CartridgeAim

readonly optional accent?: "moss" | "ember" | "tide"

The game’s accent over the shared game theme (default “moss”).

readonly optional controlHelp?: string

readonly optional dockKeys?: boolean

Show the persistent dock keys. Palettes and keyboard commands remain available.

readonly optional audioBank?: Readonly<{ samples: Readonly<Record<string, Readonly<{ urls: readonly string[]; gain: number; priority: number; }>>>; maxVoices?: number; }>

Sampled sounds under the shared audio owner, selected by feedback name.

readonly optional lighting?: Readonly<{ sources?: readonly Readonly<{ visual: string; moods?: readonly ("day" | "dusk" | "night")[]; light: Readonly<{ radius: number; color: number; intensity: number; height: number; kind: "point"; }> | Readonly<{ radius: number; color: number; intensity: number; height: number; kind: "cone"; angle: number; }>; }>[]; occluders?: readonly Readonly<{ visual: string; height: number; }>[]; pulses?: readonly Readonly<{ cue: string; light: Readonly<{ radius: number; color: number; intensity: number; height: number; kind: "point"; }> | Readonly<{ radius: number; color: number; intensity: number; height: number; kind: "cone"; angle: number; }>; ms: number; }>[]; }>

Declared, view-only world lights and opaque construction states.

readonly optional developerControls?: boolean

Show the engine’s pixel-quality, voxel-layer and cutaway tools (default true). A finished game turns them off.

readonly optional emptyDrag?: "pan" | "select"

What a plain left drag that starts on empty ground does: box-select (the default) or pan the camera. Shift+drag always box-selects.

readonly optional orderCommand?: string

The command a drafted selection’s secondary click issues.

readonly optional selectionShortcuts?: readonly object[]

readonly windows: readonly CartridgeWindow[]

Declared game windows, opened by ui:<id> commands.

readonly optional source?: string

Where the page links “View TypeScript source”.

readonly optional visuals?: Readonly<Record<string, VisualBinding>>>>

The art for this cartridge’s sprite ids, merged over the engine’s.

readonly optional artPacks?: readonly CartridgeArtPackFiles[]

Its own checked art packs (each the pack.ts module the art baker, scripts/export-cartridge-art.mjs, writes); its visuals point into them by root.

readonly optional icons?: Readonly<Record<string, string>>>>

The page’s UI icons by key (inventory item art, say): window blocks name an icon by key, and the browser resolves it here, so a hosted world’s server never sends a file path.

readonly optional effectArt?: object

The art pack feedback cues draw from (splats, flashes, casings, bits, words): a cue names frames of it by bank path (art), and each frame lands on its world point by the pack’s anchors (the manifest’s anchors, or a separate anchorsUrl in the same contract). Without it, cues draw the view’s own placeholders.

readonly pack: CartridgeArtPackFiles

readonly optional anchorsUrl?: string

readonly optional dolls?: Readonly<Record<string, URL>>>>

Its cast’s paper-doll pack: the pack.ts module the doll baker (scripts/export-paper-doll-art.mjs) writes beside the pack’s files.

readonly optional spectator3d?: () => Promise<{ cast: Cast; heads: Readonly<Record<string, HeadBuilder>>>>; propScene?: (visual) => Scene<Object3DEventMap> > | null; }>

Loads authored live rig geometry only for an opted-in 3D spectator.

Promise<{ cast: Cast; heads: Readonly<Record<string, HeadBuilder>>; propScene?: (visual) => Scene<Object3DEventMap> | null; }>

readonly optional shelf?: CartridgeShelf

readonly optional selectionCards?: readonly SelectionCard[]

readonly optional gainFeedbackFactPrefixes?: readonly string[]

Inventory owners whose item gains are player-facing. Other stock changes (such as a ship’s ammunition locker) never produce floating gain labels.

readonly optional sharedWorlds?: boolean

The hosted engine serves invitation-shared worlds for this cartridge.

readonly optional clock?: "always"

How a hosted world’s clock runs. "always": while the world is open it keeps ticking with nobody connected (offline characters stay in danger, the town keeps living). Default: it rests shortly after the last player leaves.

readonly optional sharedClock?: "owner"

Who may pause and step a shared hosted world’s clock. "owner": the world’s owner (the principal who created its invitation) may pause and steer it; other participants cannot. Unset: nobody in a shared world may control the clock (it runs on its own schedule). Ignored outside a shared world (sharedWorlds); a personal hosted world’s own player always controls its clock regardless of this field.

readonly optional interest?: object

The first distance-based interest cut: a player viewer’s observation carries only render facts, presentation facts and cues within radius metres (xz distance) of their own actors. A player with no drawn actor (dead, or not yet spawned) sees around where their actors last stood, else their spawn marker, else nothing: never the whole world, which a waiting player could scout and relay to friends. Only the host and a granted spectator (spectators) see everything. Terrain, whistle and windows are unaffected.

readonly radius: number

readonly optional spectators?: true

The world grants a spectator role: players may mint read-only spectator links, and spectators see the whole world. Unset, a hosted world has no spectators at all.

readonly optional placementVisuals?: Readonly<Record<string, PlacementPresentation>>>>

Placement ghosts and candidates for build gestures, derived from the cartridge’s construction extension.

readonly optional placementCandidates?: (input) => readonly PlacementCandidate[]

string = ...

"north" | "east" | "south" | "west" = ...

{ cell: [number, number, number]; } | { area: { start: [number, number, number]; end: [number, number, number]; }; } | { edges: object[]; } = ...

readonly PlacementCandidate[]

readonly look: Look

The checked look: full colour, or a palette the view constrains to.

readonly optional terrainLandform?: EnvironmentPlateau

Authored floating plateau shape for the smooth terrain view.

readonly optional terrainSea?: Readonly<{ bounds: EnvironmentBounds; seaLevel: number; shore: EnvironmentPlateau; }>

Admitted sea extent and shore for the terrain’s visual water surface.


readonly id: string

Kebab-case identity; also the namespace for saves and URLs.

readonly title: string

readonly version: number

Bump when saved worlds can no longer restore with this content.

readonly optional actors?: readonly ActorDefinition[]

Spawnable templates. Their .behaves() attachments are installed once.

readonly optional components?: readonly ComponentDefinition<any>>[]

Components used by commands, rules or the world. Authored components on the actors are collected automatically.

readonly world: object

readonly materials: readonly object[]

readonly optional stockpileProfiles?: readonly object[]

readonly optional terrain?: TerrainChoice

readonly optional presentationWindow?: object

readonly minX: number

readonly maxX: number

readonly minZ: number

readonly maxZ: number

readonly optional characters?: Characters

Rigged characters: appearance, wardrobe commands, dismemberment.

readonly optional horde?: HordeSimulation

Batched autonomous movement, independent of player action admission.

readonly optional construction?: Construction

Buildables: adds their structures, the build command and placement.

readonly optional scene?: readonly Placement[]

The fresh world: actors placed on the ground. Placed actors are also spawnable templates.

readonly optional rules?: readonly SystemDefinition[]

World-level systems. Actor behavior belongs on .behaves().

readonly optional commands?: Readonly<Record<string, GameCommandDefinition>>>>

readonly optional seats?: SeatDefinition

Goals, command grants and world view available to any authorized seat.

readonly optional presentation?: GamePresentation

readonly optional persistentCharacters?: (context) => number

Persistent characters living in this world right now (a player’s, or an AI stand-in’s), read from committed state. Declare this for a page.clock "always" cartridge so its hosted world’s clock keeps self-renewing while a character is present, and can rest once none remain.

Pick<ReadContext, "query">

number

readonly optional initialActions?: readonly ActionRequest[]

Fresh-world setup (host spawns, say), committed when the world is born, before its first step, so a world waiting on its title shows its start. Every action must be accepted.

readonly optional scenarios?: Readonly<Record<string, { actions?: readonly ActionRequest[]; commands?: readonly object[]; }>>

Dev and test scenarios, by id: a fresh local world opened with ?scenario=<id> plays the scenario’s host actions after the initial actions, then its commands, as if the player gave them. A proof uses one to stage a moment (a zombie at the door) without the game checking for tests. Worlds started without a scenario never see them.

readonly optional players?: object

readonly join: PartyJoinCapability

readonly optional shared?: object

A hosted shared world’s own setup, after initialActions and never in browser-local play (seats that stand-ins fill while players are missing, say).

readonly optional initialActions?: readonly ActionRequest[]

readonly optional features?: Readonly<Partial<Record<"minded-seats", readonly ActionRequest[]>>>

Setups the host adds to a new shared world only while one of its engine features is switched on (minded-seats: players may hand their character to something that plays it for them while they are away; a host switch), after initialActions.

readonly local: object

Browser-local play: the local player’s scope and fresh-world setup.

readonly scope: CommandScope

readonly bootstrap: readonly ActionRequest[]

readonly optional opening?: object

A fresh player world’s story start: host actions (spawned scenery), then commands the player “has already given”.

readonly optional actions?: readonly ActionRequest[]

readonly optional commands?: readonly object[]

readonly page: Omit<CartridgePage, "placementVisuals" | "placementCandidates" | "windows" | "look">>

readonly optional ui?: object

Small game windows (Mosaico frames styled by Caps), each with a Whistle command.

readonly optional windows?: readonly CartridgeWindow[]

readonly optional mood?: (world) => "day" | "dusk" | "night"

The light the world is shown in, read from committed state on every presentation (a game clock that is not simulation time, say). When given it replaces look.moods; it never changes the simulation.

WindowWorld

"day" | "dusk" | "night"

readonly optional look?: LookSpec

An optional palette constraint and mood. Omit it for full colour.


The checked, compiled cartridge. The only thing the Worker, page and host accept.

readonly id: string

readonly title: string

readonly version: number

readonly pack: GamePack

Browser-local pack: the local player joins at world start.

readonly hostPack: GamePack

Shared-world pack for the hosted engine: players join by command.

readonly page: CartridgePage

readonly optional seats?: SeatDefinition

readonly optional sharedFeatures?: Readonly<Partial<Record<"minded-seats", readonly ActionRequest[]>>>

A shared world’s feature-gated setups (players.shared.features).

readonly optional dismemberment?: object

Which cuts can come off and how the stump looks, when characters are on.

severable: string[]

gore: "moss" | "classic" | "off"

readonly optional cast?: Cast

The cartridge’s own cast, when characters are on; its paper-doll pack is page.dolls. The engine’s cast tools find a cast only here.


readonly id: EntityId

readonly components: Readonly<Record<string, ComponentFields>>>>


readonly definition: EnvironmentStructureDefinition

readonly placement: object

alignment: "fixed" | "stroke"

optional facing?: object

north: number

east: number

south: number

west: number

readonly name: string

readonly sprites: string

readonly optional key?: string

readonly optional palette?: false

Set when players may not plan it (the definition’s palette).


readonly party: EntityId

readonly definition: EnvironmentStructureDefinition

readonly candidates: readonly PlacementCandidate[]

readonly existingSites: readonly EntityId[]

readonly floorOperations: (requests) => readonly FloorOperation[]

readonly object[]

readonly FloorOperation[]

readonly replacementGenerations: ReadonlyMap<EntityId, number>>

readonly replacementId: (floor, generation) => EntityId

EntityId

number

EntityId


catalog: string

targetKind: "cell" | "edge"

targetX: number

targetY: number

targetZ: number

targetDirection: "x" | "z" | CardinalOrientation

seconds: number

phase: "working" | "planned" | "finished"


readonly code: "VD001" | "VD002" | "VD003" | "VD004" | "VD005" | "VD006" | "VD007" | "VD008" | "VD009" | "VD010" | "VD011" | "VD012" | "VD013" | "VD014" | "VD015" | "VD016" | "VD017" | "VD020" | "VD021" | "VD022" | "VD023" | "VD024" | "VD025" | "VD030" | "VD031" | "VD032" | "VD033" | "VD034" | "VD040" | "VD041" | "VD050" | "VD051" | "VD052" | "VD060" | "VD061" | "VD070" | "VD071" | "VD072" | "VD073" | "VD074" | "VD080" | "VD083" | "VD082" | "VD081"

readonly message: string

One sentence naming the author’s ids, never engine internals.

readonly hint: string

The fix, as an instruction.

readonly path: readonly (string | number)[]

Where in the cartridge spec, when known: ["scene", 3].


T extends object

readonly component: ComponentDefinition<T & object>>

The record component (add it to the producing behavior’s writes).

emit(context, key, value, at): void

Record one effect at world time at; key (unique among one step’s records) and the time make its id.

Pick<WriteContext, "createAuthoredEntity">

string

T

number

void

all(context): T & object[]

Every live record, oldest first.

Pick<ReadContext, "query">

T & object[]

since(context, seen): T & object[]

Records newer than seen (a consumer’s marker), oldest first.

Pick<ReadContext, "query">

number

T & object[]

sweep(context, now, keep): void

Remove records older than keep seconds (the producer only).

Pick<ReadContext, "query"> & Pick<WriteContext, "removeAuthoredEntity">

number

number

void


A bounded response to contact strength; no simulation clock or RNG.

readonly base: number

readonly optional perDamage?: number

readonly optional damageDivisor?: number

readonly optional killBonus?: number

readonly min: number

readonly max: number


readonly height: number

readonly cue: AuthoredFeedbackCue


readonly height: number

AnchoredFeedback.height

readonly cue: AuthoredFeedbackCue

AnchoredFeedback.cue

readonly forward: number

readonly recoil: number

readonly optional muzzleArt?: readonly FeedbackArtPath[]


readonly cue: AuthoredFeedbackCue

readonly radius: number

readonly angle: number

readonly height: number

readonly ms: number

readonly color: string


readonly height: number

readonly heavyDamage: number

readonly ranged: AuthoredFeedbackCue

readonly melee: AuthoredFeedbackCue

readonly heavy: AuthoredFeedbackCue

readonly kill: AuthoredFeedbackCue

readonly headKill: AuthoredFeedbackCue

readonly hitstop: FeedbackStrength

readonly shake: FeedbackStrength

readonly slowMotion: object

readonly scale: number

readonly killMs: number

readonly headMs: number

readonly bits: object

readonly regular: FeedbackBitsKind

readonly gore: FeedbackBitsKind

readonly optional art?: readonly FeedbackArtPath[]

readonly count: FeedbackStrength

readonly spread: FeedbackStrength

readonly rumble: object

readonly strong: FeedbackStrength

readonly weak: number

readonly hitMs: number

readonly killMs: number


readonly cue: AuthoredFeedbackCue

readonly size: FeedbackStrength

readonly minSize: number

readonly maxSize: number

readonly art: readonly object[]

Ordered size bands, each with shape variants and their quarter turns.

readonly seed: object

readonly x: number

readonly z: number


Weapon extends string = string

Simple extends string = string

Swing extends string = string

readonly optional contact?: ContactFeedback

readonly optional shots?: Readonly<Record<Weapon, ShotFeedback>>>>

readonly optional swings?: Readonly<Record<Swing, SwingFeedback>>>>

readonly optional splat?: SplatFeedback

readonly optional wound?: object

readonly height: number

readonly bites: readonly AuthoredFeedbackCue[]

readonly claw: AuthoredFeedbackCue

readonly optional simple?: Readonly<Record<Simple, AnchoredFeedback>>>>


A structure standing across a face, and how much it would take.

readonly site: string

readonly cost: number


Navigation facts: blocked cells and weighted breakable edges are game data.

readonly profile: string

readonly radius: number

readonly terrainRevision: number

Change when terrain heights/passability change. Static worlds use zero.

readonly blocked: ReadonlySet<string>>

readonly occupied: ReadonlySet<string>>

readonly edges: ReadonlyMap<string, FlowBarrier>>


height(cell): number | undefined

FlowCell

number | undefined

crossing(from, to): FlowBarrier | "corner" | null

FlowCell

FlowCell

FlowBarrier | "corner" | null

next(goal, from): { to: FlowCell; barrier: FlowBarrier | null; } | null

FlowCell

FlowCell

{ to: FlowCell; barrier: FlowBarrier | null; } | null


readonly id: string

readonly x: number

readonly z: number

readonly reach: number


readonly id: EntityId

readonly x: number

readonly z: number

readonly eligible: readonly string[]


readonly slot: HordeSlot

readonly arrived: boolean


How a cartridge looks. Everything is optional: a cartridge without a palette renders in full colour, exactly as the engine always has.

look: { palette: "glomzy-07" } // a built-in palette
look: { palette: { id: "two-tone", name: "Two Tone", colors: ["#0f380f", "#cadc9f"] } }
look: { palette: parseLospecPalette("sweetie-16", hexFileText), mood: "dusk" }

readonly optional palette?: string | Palette

A built-in palette id, or a palette (see parseLospecPalette in @fungi.computer/vishnu-pixel for Lospec exports).

readonly optional dither?: Partial<PaletteDither>>

Ordered dithering between palette neighbours; omit for the default.

readonly optional mood?: "day" | "dusk" | "night"

The mood a fresh world is shown in (default day).

readonly optional moods?: readonly MoodStop[]

Moods by committed world time: from each stop’s at (simulation seconds) the view shows its mood, before the first stop mood. Stops rise strictly. Presentation only: the simulation never reads it. moods: [{ at: 20, mood: "night" }, { at: 100, mood: "day" }]

readonly optional ambientLight?: Readonly<Record<"day" | "dusk" | "night", number>>>>

View-only brightness levels keyed by the world’s chosen mood.

readonly optional ambientTint?: Readonly<Record<"day" | "dusk" | "night", readonly [number, number, number]>>

View-only RGB light multipliers (0..1), independent of palette mapping.

readonly optional terrain?: "voxel" | "smooth"

Render voxel cells as authored faces or a sculpted surface net.

readonly optional backdrop?: "ocean"

Presentation-only horizon behind a bounded sea world.


From at simulation seconds on, the view shows mood.

readonly at: number

readonly mood: "day" | "dusk" | "night"


Phase extends string

readonly phase: Phase

readonly cycle: number

readonly phaseAt: number


Phase extends string

readonly phase: Phase

PhaseClock.phase

readonly cycle: number

PhaseClock.cycle

readonly phaseAt: number

PhaseClock.phaseAt

readonly completed: ReadonlyMap<Phase, number>>

Completed phases since the supplied clock, including skipped cycles.


One actor in the fresh world. Compiled by defineCartridge, never spawned.

readonly actor: ActorDefinition

readonly id: EntityId

readonly at: Cell2

readonly params: ActorParams

readonly optional surface?: "sea"


The fresh world compiled from a scene.

readonly initial: readonly SceneEntity[]

readonly placements: readonly InitialSurfacePlacement[]


readonly relation: EntityRelation

readonly kind: string

readonly glyph: string

readonly optional state?: string

readonly optional designated?: boolean

readonly optional job?: EntityId


The same named world view is available to every authorized seat.

readonly sightRadius: number

readonly verticalMetres: number

readonly optional environment?: Pick<EnvironmentDefinition, "processes" | "resourceSites">>

optional ownActors(reads, scope): ReadonlyMap<EntityId, Omit<EntityClass, "relation">>>>

SeatReads

CommandScope | undefined

ReadonlyMap<EntityId, Omit<EntityClass, "relation">>

terrainClass(surface): TerrainClass

TerrainSurface

TerrainClass

classify(reads): ReadonlyMap<EntityId, EntityClass>>

SeatReads

ReadonlyMap<EntityId, EntityClass>

buildableTitle(catalog): string

string

string


A cartridge-authored challenge and its committed-state scoring rule.

F extends SeatFacts = SeatFacts

readonly id: string

readonly title: string

readonly cartridge: string

readonly setting: string

readonly seeds: readonly number[]

readonly turnBudget: number

readonly spendCapUsd: number

readonly maxSimSeconds: number

readonly goal: string

facts(reads): F

SeatReads

F

outcome(start, end): SeatOutcome<F>>

F

F

SeatOutcome<F>


readonly view: SeatView

readonly grants: Readonly<Record<string, readonly string[]>>

readonly goals: readonly SeatGoal<Readonly<Record<string, number>>>>>>[]


readonly kind: "voxel"

readonly environment: EnvironmentDefinition

readonly art: TerrainPresentationDefinition


readonly kind: "sea"

readonly environment: EnvironmentDefinition

readonly art: TerrainPresentationDefinition


  • WindowDeclaration

readonly kind: "window"

readonly body: WindowBody

id: string

WindowDeclaration.id

title: string

WindowDeclaration.title

surface: "paper" | "chrome"

WindowDeclaration.surface

role: "end" | "goal" | "minimap" | "letter" | "context" | "panel" | "hud" | "actions"

WindowDeclaration.role

optional end?: object

pause: "local" | "none"

treatment: "plain" | "tape"

closeLabel: string

restartLabel: string

WindowDeclaration.end

optional key?: string

WindowDeclaration.key

opens: { on: "start"; } | { on: "command"; } | { on: "content"; repeat?: boolean; } | { on: "time"; seconds: number; }

WindowDeclaration.opens

size: object

width: number

height: number

WindowDeclaration.size


What a cartridge’s world needs; meadow() fills it in.

readonly materials: readonly object[]

readonly terrain: TerrainChoice

EntityId = string & object

Public boundary between authored TypeScript and the authoritative kernel.

readonly __entityId: unique symbol


ComponentId = `${string}.${string}`


GameId = string


RouteCostResult = { actor: EntityId; status: "reachable"; cost: number; } | { actor: EntityId; status: "unavailable"; reason: string; }


RouteToAnyResult = { actor: EntityId; status: "reachable"; targetIndex: number; cost: number; } | { actor: EntityId; status: "unavailable"; reason: string; }


FieldType = "number" | "boolean" | "string" | "nullable-string" | "entity" | "nullable-entity"


RelationRemovalPolicy = "detach" | "restrict"


ComponentValue<T> > = object

T

readonly id: EntityId

readonly value: T


WriteIntent = object

readonly component: ComponentId

readonly entity: EntityId

readonly value: JsonValue


JobEntityBinding = { kind: "exact"; value: EntityId; } | { kind: "result"; value: { step: string; slot: string; }; }


JobOperation = { kind: "finiteToItem"; source: JobEntityBinding; inputKind: string; inputQuantity: number; outputKind: string; outputQuantity: number; workSeconds: number; resultSlot: string; } | { kind: "itemToItems"; source: JobEntityBinding; inputKind: string; inputQuantity: number; outputKind: string; outputQuantity: number; workSeconds: number; resultSlot: string; }


JobContinuation = "any-eligible" | "prefer-starter" | "bind-on-first-progress" | { assigned-actor: EntityId; }


CardinalOrientation = "north" | "east" | "south" | "west"


EdgeTarget = object

readonly cell: readonly [number, number, number]

readonly axis: "x" | "z"


ConstructionTarget = { kind: "cell"; cell: Vec3; orientation: CardinalOrientation; } | { kind: "edge"; edge: { cell: Vec3; axis: "x" | "z"; }; }


ActionRequest = { kind: "instantiate-actors"; bindingId: string; expectedSequence: number; plan: ActorInstantiationPlan; } | { kind: "spawn-actor"; receipt: EntityId; definition: string; cause: string; arguments: Readonly<Record<string, SpawnArgument>>>>; surfaceColumn?: readonly [number, number]; } | { kind: "set-relation"; relation: ComponentId; source: EntityId; target: EntityId; } | { kind: "clear-relation"; relation: ComponentId; source: EntityId; } | { kind: "begin-work-attempt"; task: EntityId; worker: EntityId; operation: WorkActivityRef; } | { kind: "retarget-work-attempt"; task: EntityId; generation: number; sequence: number; destination: MoveDestination; } | { kind: "interrupt-work-attempt"; task: EntityId; generation: number; sequence: number; cause: WorkInterruptCause; } | { kind: "acknowledge-work-attempt"; task: EntityId; generation: number; sequence: number; } | { kind: "continue-work-attempt"; task: EntityId; generation: number; sequence: number; nextActivity: WorkActivityRef; } | { kind: "create-job"; id: EntityId; pool: EntityId; plan: JobPlan; } | { kind: "resume-job"; id: EntityId; pool: EntityId; plan: JobPlan; } | { kind: "cancel-job"; id: EntityId; } | { kind: "establish-resource-site"; operation: string; worker: EntityId; site: EntityId; definition: string; x: number; y: number; z: number; } | { kind: "tend-resource-site"; operation: string; worker: EntityId; site: EntityId; vessel: EntityId; } | { kind: "designate-resource"; order: EntityId; party: EntityId; definition: string; x: number; y: number; z: number; } | { kind: "request-field-water"; party: EntityId; material: string; portions: number; } | { kind: "request-process"; definition: string; station: EntityId; } | { kind: "admit-process"; process: EntityId; definition: string; station: EntityId; } | { kind: "designate-stockpile"; party: EntityId; zone: EntityId; cells: readonly object[]; } | { kind: "update-stockpile"; party: EntityId; zone: EntityId; filterProfile: string; priority: number; } | { kind: "clear-stockpile"; party: EntityId; zone: EntityId; cells: readonly object[]; } | { kind: "set-structure-open"; worker: EntityId; site: EntityId; open: boolean; } | { kind: "deconstruct"; worker: EntityId; site: EntityId; } | { kind: "break-structure"; site: EntityId; } | { kind: "plan-deconstruction"; site: EntityId; party: EntityId; } | { kind: "plan-constructions"; party: EntityId; plans: readonly PlacementCandidate[]; } | { kind: "prebuild-structures"; party: EntityId; plans: readonly PlacementCandidate[]; } | { kind: "plan-excavation"; party: EntityId; prefix: string; start: readonly [number, number, number]; end: readonly [number, number, number]; } | { kind: "cancel-excavation"; party: EntityId; area: { start: readonly [number, number, number]; end: readonly [number, number, number]; } | null; workers: readonly EntityId[]; } | { kind: "replace-floor"; orderId: EntityId; existingFloorId: EntityId; desiredCatalog: string; } | { kind: "bind-construction-stage"; site: EntityId; contact: Vec3 & object; } | { kind: "cancel-work"; entity: EntityId; } | { kind: "begin-direct"; entity: EntityId; stream: string; } | { kind: "begin-emission"; worker: EntityId; station: EntityId; } | { kind: "exchange-field-water"; operation: string; worker: EntityId; vessel: EntityId; x: number; y: number; z: number; direction: "withdraw" | "deposit"; portions: number; } | { kind: "direct-input"; entity: EntityId; stream: string; inputs: readonly object[]; } | { kind: "launch"; launcher: EntityId; ammunition: EntityId; velocity: Vec3; } | { kind: "displace"; entity: EntityId; delta: Vec3; } | { kind: "move"; entity: EntityId; destination: MoveDestination; facing?: number; speed?: number; } | { kind: "drop-lot"; entity: EntityId; lot: EntityId; } | { kind: "transfer"; lot: EntityId; from: EntityId; to: EntityId; quantity: number; } | { kind: "request-delivery"; source: EntityId; destination: EntityId; material: string; quantity: number; party: EntityId; } | { kind: "consume"; entity: EntityId; lot: EntityId; quantity: number; } | { kind: "extract-resource"; operation: string; worker: EntityId; source: EntityId; }

{ kind: "instantiate-actors"; bindingId: string; expectedSequence: number; plan: ActorInstantiationPlan; }


{ kind: "spawn-actor"; receipt: EntityId; definition: string; cause: string; arguments: Readonly<Record<string, SpawnArgument>>; surfaceColumn?: readonly [number, number]; }

readonly kind: "spawn-actor"

Ordinary spawn of one template outside party join. The receipt is the new entity’s id: replaying the same request is a no-op, a different request under a used receipt is refused. Host scope only.

readonly receipt: EntityId

readonly definition: string

readonly cause: string

readonly arguments: Readonly<Record<string, SpawnArgument>>>>

readonly optional surfaceColumn?: readonly [number, number]


{ kind: "set-relation"; relation: ComponentId; source: EntityId; target: EntityId; }


{ kind: "clear-relation"; relation: ComponentId; source: EntityId; }


{ kind: "begin-work-attempt"; task: EntityId; worker: EntityId; operation: WorkActivityRef; }


{ kind: "retarget-work-attempt"; task: EntityId; generation: number; sequence: number; destination: MoveDestination; }


{ kind: "interrupt-work-attempt"; task: EntityId; generation: number; sequence: number; cause: WorkInterruptCause; }


{ kind: "acknowledge-work-attempt"; task: EntityId; generation: number; sequence: number; }


{ kind: "continue-work-attempt"; task: EntityId; generation: number; sequence: number; nextActivity: WorkActivityRef; }


{ kind: "create-job"; id: EntityId; pool: EntityId; plan: JobPlan; }


{ kind: "resume-job"; id: EntityId; pool: EntityId; plan: JobPlan; }


{ kind: "cancel-job"; id: EntityId; }


{ kind: "establish-resource-site"; operation: string; worker: EntityId; site: EntityId; definition: string; x: number; y: number; z: number; }


{ kind: "tend-resource-site"; operation: string; worker: EntityId; site: EntityId; vessel: EntityId; }


{ kind: "designate-resource"; order: EntityId; party: EntityId; definition: string; x: number; y: number; z: number; }


{ kind: "request-field-water"; party: EntityId; material: string; portions: number; }


{ kind: "request-process"; definition: string; station: EntityId; }


{ kind: "admit-process"; process: EntityId; definition: string; station: EntityId; }


{ kind: "designate-stockpile"; party: EntityId; zone: EntityId; cells: readonly object[]; }


{ kind: "update-stockpile"; party: EntityId; zone: EntityId; filterProfile: string; priority: number; }


{ kind: "clear-stockpile"; party: EntityId; zone: EntityId; cells: readonly object[]; }


{ kind: "set-structure-open"; worker: EntityId; site: EntityId; open: boolean; }


{ kind: "deconstruct"; worker: EntityId; site: EntityId; }


{ kind: "break-structure"; site: EntityId; }

readonly kind: "break-structure"

Tear down a finished structure with no worker: it was broken.

readonly site: EntityId


{ kind: "plan-deconstruction"; site: EntityId; party: EntityId; }


{ kind: "plan-constructions"; party: EntityId; plans: readonly PlacementCandidate[]; }


{ kind: "prebuild-structures"; party: EntityId; plans: readonly PlacementCandidate[]; }

readonly kind: "prebuild-structures"

Plan structures and finish them at once: a fresh world’s buildings.

readonly party: EntityId

readonly plans: readonly PlacementCandidate[]


{ kind: "plan-excavation"; party: EntityId; prefix: string; start: readonly [number, number, number]; end: readonly [number, number, number]; }


{ kind: "cancel-excavation"; party: EntityId; area: { start: readonly [number, number, number]; end: readonly [number, number, number]; } | null; workers: readonly EntityId[]; }


{ kind: "replace-floor"; orderId: EntityId; existingFloorId: EntityId; desiredCatalog: string; }


{ kind: "bind-construction-stage"; site: EntityId; contact: Vec3 & object; }


{ kind: "cancel-work"; entity: EntityId; }


{ kind: "begin-direct"; entity: EntityId; stream: string; }


{ kind: "begin-emission"; worker: EntityId; station: EntityId; }


{ kind: "exchange-field-water"; operation: string; worker: EntityId; vessel: EntityId; x: number; y: number; z: number; direction: "withdraw" | "deposit"; portions: number; }


{ kind: "direct-input"; entity: EntityId; stream: string; inputs: readonly object[]; }


{ kind: "launch"; launcher: EntityId; ammunition: EntityId; velocity: Vec3; }


{ kind: "displace"; entity: EntityId; delta: Vec3; }


{ kind: "move"; entity: EntityId; destination: MoveDestination; facing?: number; speed?: number; }


{ kind: "drop-lot"; entity: EntityId; lot: EntityId; }


{ kind: "transfer"; lot: EntityId; from: EntityId; to: EntityId; quantity: number; }


{ kind: "request-delivery"; source: EntityId; destination: EntityId; material: string; quantity: number; party: EntityId; }


{ kind: "consume"; entity: EntityId; lot: EntityId; quantity: number; }


{ kind: "extract-resource"; operation: string; worker: EntityId; source: EntityId; }


WorkActivityRef = { kind: "route"; destination: MoveDestination; } | { kind: "construction"; site: EntityId; contact: Vec3 & object; mode: "bind" | "work"; } | { kind: "excavation"; cell: readonly [number, number, number]; expectedMaterial: number; replacementMaterial: number; } | { kind: "deconstruction"; site: EntityId; contact: Vec3 & object; } | { kind: "process-attendance"; process: EntityId; } | { kind: "material-transfer"; lot: EntityId; from: EntityId; to: EntityId; quantity: number; } | { kind: "material-drop"; lot: EntityId; } | { kind: "resource-establish"; site: EntityId; definition: string; cell: readonly [number, number, number]; } | { kind: "resource-tend"; site: EntityId; vessel: EntityId; } | { kind: "resource-extract"; source: EntityId; } | { kind: "field-water"; vessel: EntityId; cell: readonly [number, number, number]; direction: "withdraw" | "deposit"; portions: number; } | { kind: "job-transform"; task: EntityId; contact: MoveDestination; }


WorkInterruptCause = "drafted" | "cancelled" | "workerUnavailable" | "accessLost"


WorkBlockReason = "accessLost" | "missingInputs" | "capacityUnavailable" | "unsupportedStructure" | "workerUnavailable"


WorkOutcome = { kind: "completed"; } | { kind: "blocked"; reason: WorkBlockReason; } | { kind: "interrupted"; cause: WorkInterruptCause; }


WorkAttemptPhase = { kind: "ready"; } | { kind: "executing"; operation: { attempt: WorkAttemptKey; sequence: number; }; activity: WorkActivityRef; } | { kind: "outcome"; operation: { attempt: WorkAttemptKey; sequence: number; }; activity: WorkActivityRef; result: WorkOutcome; } | { kind: "settling"; operation: { attempt: WorkAttemptKey; sequence: number; }; cause: WorkInterruptCause; }


ProcessInputPolicy = "portion" | "whole-lot"


ProcessInputDisposition = "consume" | "retain" | "emission-source"


NativeFact = Exclude<keyof ReadContext, "clock" | "outcomes" | "random" | "impacts" | "query">>

Native read doors available to authored decisions beyond ECS/query state.


CommandScope = { kind: "host"; } | { kind: "player"; player: string; }


PartyJoinIdentity = Readonly<{ status: "existing" | "available"; sequence: number; player: string; party: EntityId; people: readonly EntityId[]; }>


SpawnArgument = Extract<ActorArgument, { kind: "value"; } | { kind: "existing"; }>

Spawn arguments bind values or existing entities; slots and joining players belong to party join.


ActorArgument = { kind: "value"; value: string | number | boolean | null; } | { kind: "spawned"; slot: string; } | { kind: "existing"; id: EntityId; } | { kind: "joining-player"; }


ActorInstantiationPlan = Readonly<{ actors: readonly Readonly<{ slot: string; definition: string; arguments: Readonly<Record<string, ActorArgument>>>>; surfaceColumn?: readonly [number, number]; }>[]; initialMaterials: readonly Readonly<{ container: ActorArgument; kind: string; quantity: number; actorDefinition?: string; arguments?: Readonly<Record<string, ActorArgument>>>>; }>[]; partySlot: string; peopleSlots: readonly string[]; }>


PartyJoinCapability = Readonly<{ footprint: readonly readonly [number, number][]; prepare: (spawn) => ActorInstantiationPlan; }>


ActionScope = { kind: "host"; } | { kind: "player"; player: string; }


GameCommandContext = Pick<ReadContext, "query" | "physicalContacts" | "terrainMaterials" | "terrainSurfaces" | "structureSurfaces" | "transferContacts"> > & object

readonly scope: CommandScope

readonly workAttempts: (taskIds) => readonly WorkAttempt[]

readonly EntityId[]

readonly WorkAttempt[]

readonly workAttemptForWorker: (worker) => WorkAttempt | null

EntityId

WorkAttempt | null

readonly floorOperations: (requests) => readonly FloorOperation[]

readonly FloorOperationRequest[]

readonly FloorOperation[]


VisualPlacement = { kind: "edge"; edge: EdgeTarget; } | { kind: "footprint"; footprint: readonly readonly [number, number][]; orientation: CardinalOrientation; } | { kind: "stair"; entrance: readonly [number, number, number]; landing: readonly [number, number, number]; orientation: CardinalOrientation; }


DeliveryActivityPhase = "fetching" | "pickup" | "carrying" | "putting-down"

fetching: walking to the source with empty hands; pickup: the tick custody moved into the hands; carrying: walking with the held load; putting-down: the tick the load left the hands.


ActivityKind = "dig" | "build" | "chop" | "delivery"


KernelSnapshot = KernelRecordSnapshot


ConstructionReadinessStatus = "ready" | "waitingForSupport" | "unknown"


ConstructionAccessContact = Vec3 & object

readonly frame: null

readonly kind: "origin" | "landing"


DeconstructionAccess = object

readonly site: EntityId

readonly status: "ready" | "occupiedPort" | "structuralDependency" | "invalidGeometry"

readonly contacts: readonly ConstructionAccessContact[]

readonly salvageQuantity: number

readonly workSeconds: number


PhysicalContact = object

readonly solid: boolean

readonly sealedTop: boolean

readonly outside: boolean


TerrainSurface = z.infer<typeof terrainSurfaceSchema>>


TerrainSurfaceCover = NonNullable<TerrainSurface["cover"]>


StructureSurface = object

readonly cell: readonly [number, number, number]


FloorOperation = { kind: "build"; } | { kind: "unchanged"; floor: EntityId; } | { kind: "replace"; floor: EntityId; } | { kind: "conflict"; floor: EntityId; } | { kind: "waiting-for-support"; } | { kind: "invalid"; reason: string; }


FloorOperationRequest = object

readonly cell: readonly [number, number, number]

readonly desiredCatalog: string


TerrainChangeSet = { kind: "changed-columns"; revision: number; columns: readonly readonly [number, number][]; } | { kind: "full-reset"; revision: number; reason: "history" | "restored" | "stale"; }


GameLocalBinding = Readonly<{ id: string; label: string; detail?: string; selection?: "entities" | Readonly<{ field: string; cardinality: "one"; }>; target?: "terrain-cell" | "terrain-area" | "world-surface" | "world-edge" | "actor"; component?: ComponentId; designation?: readonly ("point" | "line" | "rectangle" | "edge-line" | "entities")[]; footprint?: readonly readonly [number, number][]; placement?: "action-bar"; key?: string; preset?: JsonValue; }>


JsonValue = null | boolean | number | string | readonly JsonValue[] | {[key: string]: JsonValue; }


ComponentValues = Readonly<Record<string, JsonValue>>>>


GameCommandAvailability = { status: "available"; } | { status: "unavailable"; reason: string; }


EnvironmentFacts = z.infer<typeof environmentFactsSchema>>


AuthoredFeedbackCue = Omit<FeedbackPresentationCue, "sequence" | "time" | "kind">>

What WriteContext.cue() accepts: a feedback cue before the session stamps its sequence and commit time.


CartridgeAudio = z.infer<typeof cartridgeAudioSchema>>


BlueprintSide = "north" | "south" | "east" | "west"

A side of a module: north is -z, south +z, west -x, east +x.


BlueprintOpeningKind = "door" | "window" | "doorway"

What an opening in a side is: a door, a window, or a doorway (an open gap into the room next door, which must be there).


CameraFollowPolicy = z.infer<typeof cameraFollowSchema>>


CartridgeCameraPolicy = z.infer<typeof cartridgeCameraSchema>>


VisualBindings = Readonly<Record<string, VisualBinding>>>>


StaticVisualBinding = VisualBinding & object

A static frame by its path in the art (the bank’s, or a cartridge pack’s under its root).

readonly kind: "static"

readonly worldRole: "floor" | "structure" | "item"

readonly path: BankPath

readonly facing: boolean

The path ends in one frame per view turn (0 to 3).

readonly optional frames?: true

The path (after its view) ends in an animation’s frames.

readonly anchor: "propAnchor" | "vehicleAnchor"


CartridgeDirectControl = { entity: string; } | { person: number; }

A cartridge-owned actor driven directly by the player’s movement keys. The world moves it in fixed steps. A walker with Traversal keeps its feet on the ground: it climbs or drops at most its step height, never steps onto no floor, and never passes a finished wall, a closed door or a filled cell. An open door lets it through. Moving it by route later starts from wherever it stands, even between cells.

{ entity: string; }

One fixed actor, the same for every viewer.


{ person: number; }

Each viewer drives their own: this index into the people of the party the viewer joined with (players.join), or the local party.


HostFeature = typeof HOST_FEATURES[number]


ComponentFields = Readonly<Record<string, JsonValue>>>>

One component’s field values as they cross into the kernel.


BuildableDefinition = z.infer<typeof buildableDefinitionSchema>>


ConstructionProposalInput = z.infer<typeof constructionProposalInput>>


DiagnosticCode = keyof typeof DIAGNOSTICS


EffectFields<T> > = Readonly<Record<keyof T & string | "at" | "seq", "number" | "string" | "boolean">>>>

Fields declared by an effect, including its world time and step order.

T extends object


FlowCell = readonly [number, number]


PresentationLight = z.infer<typeof presentationLightSchema>>


CartridgeLighting = z.infer<typeof cartridgeLightingSchema>>


Mood = typeof MOODS[number]


TerrainLook = z.infer<typeof terrainLookSchema>>


Look = { palette: null; ambientLight?: Readonly<Record<Mood, number>>>>; ambientTint?: Readonly<Record<Mood, readonly [number, number, number]>>; terrain: TerrainLook; backdrop?: "ocean"; } | { palette: Palette; dither: PaletteDither; mood: Mood; moods?: readonly MoodStop[]; ambientLight?: Readonly<Record<Mood, number>>>>; ambientTint?: Readonly<Record<Mood, readonly [number, number, number]>>; terrain: TerrainLook; backdrop?: "ocean"; }

A checked look: either full colour, or a palette with its dither and mood.

{ palette: null; ambientLight?: Readonly<Record<Mood, number>>; ambientTint?: Readonly<Record<Mood, readonly [number, number, number]>>; terrain: TerrainLook; backdrop?: "ocean"; }

readonly palette: null

readonly optional ambientLight?: Readonly<Record<Mood, number>>>>

readonly optional ambientTint?: Readonly<Record<Mood, readonly [number, number, number]>>

View-only RGB light multipliers (0..1), independent of palette mapping.

readonly terrain: TerrainLook

readonly optional backdrop?: "ocean"


{ palette: Palette; dither: PaletteDither; mood: Mood; moods?: readonly MoodStop[]; ambientLight?: Readonly<Record<Mood, number>>; ambientTint?: Readonly<Record<Mood, readonly [number, number, number]>>; terrain: TerrainLook; backdrop?: "ocean"; }

readonly palette: Palette

readonly dither: PaletteDither

readonly mood: Mood

readonly optional moods?: readonly MoodStop[]

The checked schedule, when the cartridge gives one.

readonly optional ambientLight?: Readonly<Record<Mood, number>>>>

readonly optional ambientTint?: Readonly<Record<Mood, readonly [number, number, number]>>

View-only RGB light multipliers (0..1), independent of palette mapping.

readonly terrain: TerrainLook

readonly optional backdrop?: "ocean"


Cell2 = readonly [number, number]

A ground cell: [x, z]. The actor settles onto the surface there.


ActorParams = Readonly<Record<string, string | number | boolean | null>>>>

Values for an actor’s declared inputs, by input name.


SeatFacts = Readonly<Record<string, number>>>>


TerrainChoice = VoxelTerrainChoice | SeaTerrainChoice


WindowSurface = "paper" | "chrome"

The two UI languages. paper is a window about the world (field-guide theme: inspector, letters, goals); chrome is the cartridge shell (plastic theme: menus, settings). Caps components and themes do all the styling.


WindowWorld = Pick<ReadContext, "query" | "atmosphereSamples" | "constructionReadiness"> > & PresentationViewer

What a window body reads: the committed world, through typed queries, and who is looking. Each viewer gets their own pass: a player sees { kind: "player", player }, a host or spectator { kind: "host" }.


RunCommand = (command, input?) => void

The single command door: "garden:plantSeeds" or "ui:garden.goals".

string

JsonValue

void


WindowBody = (world) => readonly WindowBlock[]

Pure: world in, blocks out. It runs where the world lives (the Worker or the host) on every presentation, so only data crosses to the page.

WindowWorld

readonly WindowBlock[]


WindowBlock = z.infer<typeof windowBlockSchema>>

One block of a game window: plain data a person or a model can write.


WindowRole = z.infer<typeof windowRoleSchema>>

Where the shell shows a window.


WindowOpening = z.infer<typeof windowOpeningSchema>>

When a window first opens on its own.

const RESERVED_COMPONENTS: readonly ["vishnu.party", "vishnu.owned-by", "vishnu.party-member", "vishnu.owned-by-party", "vishnu.stockpile-cell", "vishnu.storage-provider", "vishnu.position", "vishnu.body", "vishnu.traversal", "vishnu.container", "vishnu.sealed-container", "vishnu.ground-stock", "vishnu.construction-site", "vishnu.floor-replacement", "vishnu.lot", "vishnu.lot-water", "vishnu.hands", "vishnu.process-binding", "vishnu.finite-resource", "vishnu.resource-site", "vishnu.resource-order", "vishnu.excavation-work", "vishnu.excavation-order", "vishnu.deconstruction-work", "vishnu.supply-allocation", "vishnu.delivery-request", "vishnu.field-water-work", "vishnu.vessel-capability", "vishnu.work-policy", "vishnu.work-execution", "vishnu.work-schedule", "vishnu.job-task-work", "vishnu.destination", "vishnu.support", "vishnu.surface", "vishnu.obstacle", "vishnu.visual", "vishnu.collider", "vishnu.launcher", "vishnu.emitter", "vishnu.projectile", "vishnu.impact-material", "vishnu.owned-by-party", "vishnu.party-member"]


const sampledSoundSchema: ZodReadonly<ZodObject<{ urls: ZodReadonly<ZodArray<ZodString>>>>; gain: ZodNumber; priority: ZodNumber; }, $strict>>>>

A sampled replacement for one existing feedback sound name. URLs are resolved by the cartridge bundler; variants cycle without simulation RNG.


const cartridgeAudioSchema: ZodReadonly<ZodObject<{ samples: ZodReadonly<ZodRecord<ZodString, ZodReadonly<ZodObject<{ urls: ZodReadonly<ZodArray<ZodString>>>>; gain: ZodNumber; priority: ZodNumber; }, $strict>>>>>>>>; maxVoices: ZodOptional<ZodNumber>>; }, $strict>>>>

View-only audio bank. Omission preserves the engine’s procedural recipes. Named samples replace that recipe; a failed sample stays silent.


const actorInput: Readonly<{ number: (name) => ActorInput; boolean: (name) => ActorInput; string: (name) => ActorInput; reference: (name) => ActorInput; optionalReference: (name) => ActorInput; }>

Declared instance inputs; templates bind these to checked component fields.


const actorInputSchema: ZodObject<{ kind: ZodLiteral<"actor-input">>; name: ZodString; type: ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; nullable-string: "nullable-string"; entity: "entity"; nullable-entity: "nullable-entity"; actor-reference: "actor-reference"; }>; }, $strict>>

Parses an actor input placeholder inside an initial component value.


const ActorKind: ComponentDefinition<{ definition: string; }>

Membership marker for actors that attach behaviors. Pack preparation adds it to every attaching template, so an installed behavior runs only for entities created from an actor that attached it, never for look-alikes.


const cameraFollowSchema: ZodReadonly<ZodObject<{ deadZone: ZodOptional<ZodNumber>>; halfLife: ZodOptional<ZodNumber>>; lookAhead: ZodOptional<ZodNumber>>; lookAheadSource: ZodOptional<ZodEnum<{ movement: "movement"; aim: "aim"; }>>; resumeDistance: ZodOptional<ZodNumber>>; }, $strict>>>>

Presentation tuning only; following never changes actor movement or aim.


const cartridgeCameraSchema: ZodReadonly<ZodObject<{ pan: ZodBoolean; rotate: ZodBoolean; follow: ZodOptional<ZodReadonly<ZodObject<{ deadZone: ZodOptional<ZodNumber>>; halfLife: ZodOptional<ZodNumber>>; lookAhead: ZodOptional<ZodNumber>>; lookAheadSource: ZodOptional<ZodEnum<{ movement: "movement"; aim: "aim"; }>>; resumeDistance: ZodOptional<ZodNumber>>; }, $strict>>>>>>; initialZoom: ZodOptional<ZodUnion<readonly [ZodLiteral<1>>, ZodLiteral<2>>, ZodLiteral<3>>, ZodLiteral<4>>]>>; cutaway: ZodOptional<ZodLiteral<"auto">>>>; }, $strict>>>>

Camera policy shared by cartridge authoring and the remote player boundary. Follow is opt-in for a direct-control actor; manual pan suspends it until movement resumes. Unset zoom preserves the engine’s desktop/phone defaults. Whole zoom levels keep pixel art crisp; the wheel remains player-controlled.


const HOST_FEATURES: readonly ["minded-seats"]

Engine features a host switches on for the shared worlds it opens.


const Collider: ComponentDefinition<{ geometry: "ball" | "cuboid"; radius: number; halfX: number; halfY: number; halfZ: number; yaw: number; offsetX: number; offsetY: number; offsetZ: number; }>

Physical collision dimensions are independent of a sprite’s bounds.


const Launcher: ComponentDefinition<{ ammoKind: string; muzzleX: number; muzzleY: number; muzzleZ: number; maxSpeed: number; projectileRadius: number; maxRange: number; maxLifetime: number; projectileSprite: string; projectileLabel: string; gravity: number; penetration: number; }>


const ImpactMaterial: ComponentDefinition<{ response: "stop" | "pierce" | "ground"; resistance: number; restitution: number; friction: number; embedSpeed: number; }>

Contact policy supplied by a game; collision geometry remains independent.


const Body: ComponentDefinition<{ speed: number; }>

Native movement capability; game systems may query it but cannot write it.


const Emitter: ComponentDefinition<{ catalog: string; }>

Native finite-emission capability; catalog admission remains native-owned.


const Container: ComponentDefinition<{ capacity: number; }>

Native carrying capacity; authored systems may query but cannot write it.


const Traversal: ComponentDefinition<{ clearanceCells: number; maxStepCells: number; }>

Authored walking geometry; native routing owns its interpretation and state.


const Position: ComponentDefinition<{ x: number; y: number; z: number; facing: number; }>


const Visual: ComponentDefinition<{ sprite: string; label: string; }>

Native authored sprite identity. Presentation projections must not replace it.


const Support: ComponentDefinition<{ entity: EntityId; }>


const Surface: ComponentDefinition<{ minX: number; maxX: number; minZ: number; maxZ: number; height: number; }>


const MaterialLot: ComponentDefinition<{ quantity: number; kind: string; container: EntityId; }>


const Hands: ComponentDefinition<{ lot: EntityId; }>

Native hands slot: the one lot an actor holds and carries. Separate from the actor’s container (inventory); filled only by a pickup and emptied only by a deposit, drop or transfer of that lot. Absent means empty hands.


const VesselCapability: ComponentDefinition<{ acceptsWater: boolean; }>

Native vessel eligibility; physical capability is authored as content and consumed by the native field-water planner.


const LotWater: ComponentDefinition<{ waterKg: number; }>


const SupplyAllocation: ComponentDefinition<{ requirementOwner: EntityId; requirementRole: string; requirementGeneration: number; party: EntityId; material: string; portion: EntityId; destination: EntityId; quantity: number; state: "reserved" | "delivered" | "cancelled"; }>

Native reservation for one exact material portion. Physical custody remains in MaterialLot; this record exposes the durable planner obligation.


const DeliveryRequest: ComponentDefinition<{ source: EntityId; destination: EntityId; party: EntityId; material: string; quantity: number; deliveredQuantity: number; }>

Durable intent submitted with requestDelivery; native allocation rows expose reserved and delivered portions without authored worker choreography.


const FiniteResource: ComponentDefinition<{ kind: string; quantity: number; }>


const JobTaskWork: ComponentDefinition<{ seconds: number; }>

Native durable effort for a generic job task; authored code may query it for progress presentation but cannot write it.


const ResourceSite: ComponentDefinition<{ definition: string; stage: number; nextDue: number; }>


const Destination: ComponentDefinition<{ x: number; y: number; z: number; facing: number; frame: EntityId | null; }>


const placedAt: Readonly<{ x: "at-x"; z: "at-z"; }>

A Position declared without values is bound where the actor is placed or spawned: these are the inputs the compiled template exposes for it.


const ExcavationWork: ComponentDefinition<{ x: number; y: number; z: number; expected: number; replacement: number; seconds: number; }>

Native progress is observable but cannot be written by authored systems.


const ExcavationOrder: ComponentDefinition<{ cellX: number; cellY: number; cellZ: number; expected: number; status: "queued" | "blocked" | "cancelling"; reason: string; }>


const Buildable: ActorDefinitionCapability<{ name: string; sprites: string; geometry: { kind: "fixture"; footprint: [number, number][]; } | { kind: "aperture"; height: number; openingBottom: number; openingHeight: number; closed?: boolean; } | { kind: "floor"; } | { kind: "cover"; } | { kind: "wall"; height: number; } | { kind: "stair"; run: number; rise: number; }; materials: object[]; workSeconds: number; workReachBelowCells: number; placement?: { alignment: "fixed" | "stroke"; facing?: { north: number; east: number; south: number; west: number; }; }; ports?: object[]; onRemove?: { salvage?: object[]; emptyPorts?: string[]; }; palette?: boolean; key?: string; }>

A structure actor is created by native construction, on its existing site identity.


const constructionProposalInput: ZodObject<{ catalog: ZodString; orientation: ZodOptional<ZodEnum<{ north: "north"; east: "east"; south: "south"; west: "west"; }>>; target: ZodUnion<readonly [ZodObject<{ cell: ZodTuple<[ZodNumber, ZodNumber, ZodNumber], null>>; }, $strict>>, ZodObject<{ area: ZodObject<{ start: ZodTuple<[ZodNumber, ZodNumber, ZodNumber], null>>; end: ZodTuple<[ZodNumber, ZodNumber, ZodNumber], null>>; }, $strict>>; }, $strict>>, ZodObject<{ edges: ZodArray<ZodObject<{ cell: ZodTuple<[…, …, …], null>>; axis: ZodEnum<{ x: …; z: …; }>; }, $strict>>>>; }, $strict>>]>; }, $strict>>

Friendly gesture input. Physical admission remains native and transactional.


const SealedContainer: ComponentDefinition<Record<string, never>>>>

Native custody is observable; authored writes cannot lock or unlock goods.


const ConstructionSite: ComponentDefinition<ConstructionSiteState>>

The site owns earned effort; active worker ownership lives in WorkAttempt.


const FloorReplacement: ComponentDefinition<{ version: number; targetFloor: EntityId; expectedCatalog: string; desiredCatalog: string; supportX: number; supportY: number; supportZ: number; phase: "cancelled" | "queued" | "working" | "completed"; }>


const DeconstructionOrder: ComponentDefinition<{ site: string; contactX: number; contactY: number; contactZ: number; salvageQuantity: number; workSeconds: number; status: "queued" | "blocked" | "complete"; reason: string; retryKey: string; }>

Native-owned teardown intent projected for game UI and save inspection.


const DIAGNOSTICS: object

The stable catalog. A code never changes meaning once published.

readonly VD001: "cartridge header is invalid" = "cartridge header is invalid"

readonly VD002: "a system is installed twice" = "a system is installed twice"

readonly VD003: "two components share an id" = "two components share an id"

readonly VD004: "a buildable is listed as an ordinary actor" = "a buildable is listed as an ordinary actor"

readonly VD005: "a build command is defined next to construction()" = "a build command is defined next to construction()"

readonly VD006: "buildables have no world to stand in" = "buildables have no world to stand in"

readonly VD007: "buildables need voxel terrain" = "buildables need voxel terrain"

readonly VD008: "terrain kind is unknown" = "terrain kind is unknown"

readonly VD009: "shelf presentation is invalid" = "shelf presentation is invalid"

readonly VD010: "an actor id is invalid" = "an actor id is invalid"

readonly VD011: "an actor has a component twice" = "an actor has a component twice"

readonly VD012: "an actor's initial value does not fit its component" = "an actor's initial value does not fit its component"

readonly VD013: "a behavior needs components its actor lacks" = "a behavior needs components its actor lacks"

readonly VD014: "an actor attaches a behavior twice" = "an actor attaches a behavior twice"

readonly VD015: "two different behaviors share an id" = "two different behaviors share an id"

readonly VD016: "an actor is defined twice in one cartridge" = "an actor is defined twice in one cartridge"

readonly VD017: "membership is set by hand" = "membership is set by hand"

readonly VD020: "a placed actor is missing a param" = "a placed actor is missing a param"

readonly VD021: "a placed actor is given an unknown param" = "a placed actor is given an unknown param"

readonly VD022: "the scene places one id twice" = "the scene places one id twice"

readonly VD023: "a placed actor has a component without values" = "a placed actor has a component without values"

readonly VD024: "a placed actor has no position" = "a placed actor has no position"

readonly VD025: "two placed actors have the same target cell" = "two placed actors have the same target cell"

readonly VD030: "a window id is not namespaced" = "a window id is not namespaced"

readonly VD031: "a window is declared twice" = "a window is declared twice"

readonly VD032: "two windows share a key" = "two windows share a key"

readonly VD033: "a control key is not one lowercase letter or digit" = "a control key is not one lowercase letter or digit"

readonly VD034: "two controls, windows or shell keys share a key" = "two controls, windows or shell keys share a key"

readonly VD040: "an actor given to construction() is not buildable" = "an actor given to construction() is not buildable"

readonly VD041: "a buildable is declared twice" = "a buildable is declared twice"

readonly VD050: "dismemberment settings are invalid" = "dismemberment settings are invalid"

readonly VD051: "a cast has no look of that name" = "a cast has no look of that name"

readonly VD052: "a cast is invalid" = "a cast is invalid"

readonly VD060: "a cartridge's look is invalid" = "a cartridge's look is invalid"

readonly VD061: "a game window's options are invalid" = "a game window's options are invalid"

readonly VD070: "a blueprint module is invalid" = "a blueprint module is invalid"

readonly VD071: "two blueprint rooms overlap" = "two blueprint rooms overlap"

readonly VD072: "a blueprint doorway leads outside" = "a blueprint doorway leads outside"

readonly VD073: "two blueprint rooms disagree about a shared wall" = "two blueprint rooms disagree about a shared wall"

readonly VD074: "a styled blueprint piece has no buildable" = "a styled blueprint piece has no buildable"

readonly VD080: "local play seats more than one party" = "local play seats more than one party"

readonly VD083: "world lighting presentation is invalid" = "world lighting presentation is invalid"

readonly VD082: "camera presentation is invalid" = "camera presentation is invalid"

readonly VD081: "page interest radius is invalid" = "page interest radius is invalid"


const FLOW_NEIGHBOURS: readonly [readonly [0, 1], readonly [1, 0], readonly [0, -1], readonly [-1, 0], readonly [1, 1], readonly [1, -1], readonly [-1, 1], readonly [-1, -1]]


const HordeTarget: ComponentDefinition<{ x: number; z: number; speed: number; active: boolean; profile: string; }>

Saved autonomous intent. An empty profile is a direct local destination.


const presentationLightSchema: ZodDiscriminatedUnion<[ZodReadonly<ZodObject<{ radius: ZodNumber; color: ZodNumber; intensity: ZodNumber; height: ZodNumber; kind: ZodLiteral<"point">>; }, $strict>>>>, ZodReadonly<ZodObject<{ radius: ZodNumber; color: ZodNumber; intensity: ZodNumber; height: ZodNumber; kind: ZodLiteral<"cone">>; angle: ZodNumber; }, $strict>>>>], "kind">>

Presentation lights never participate in simulation sight or noise.


const cartridgeLightingSchema: ZodReadonly<ZodObject<{ sources: ZodOptional<ZodReadonly<ZodArray<ZodReadonly<ZodObject<{ visual: ZodString; moods: ZodOptional<ZodReadonly<…>>; light: ZodDiscriminatedUnion<[…, …], "kind">>; }, $strict>>>>>>>>>>; occluders: ZodOptional<ZodReadonly<ZodArray<ZodReadonly<ZodObject<{ visual: ZodString; height: ZodNumber; }, $strict>>>>>>>>>>; pulses: ZodOptional<ZodReadonly<ZodArray<ZodReadonly<ZodObject<{ cue: ZodString; light: ZodDiscriminatedUnion<[…, …], "kind">>; ms: ZodNumber; }, $strict>>>>>>>>>>; }, $strict>>>>

Small, bounded authoring data; select committed visuals, not game callbacks.


const MOODS: readonly ["day", "dusk", "night"]

The light a world is shown in. Every mood’s sky and light come from the declared palette.


const moodSchema: ZodEnum<{ day: "day"; dusk: "dusk"; night: "night"; }>

Parses a mood from untrusted input (a URL parameter, a tool call).


const terrainLookSchema: ZodEnum<{ voxel: "voxel"; smooth: "smooth"; }>


const FULL_COLOUR: Look

Full colour: no palette constraint.


const Party: ComponentDefinition<Record<string, never>>>>

Gameplay group identity. Membership and ownership are separate facts.


const OwnedBy: ComponentDefinition<{ player: string; }>

Stable player property. Access rules decide which operations it permits.


const PartyMember: ComponentDefinition<{ party: EntityId; }>

A person belongs to this party without duplicating their physical identity.


const OwnedByParty: ComponentDefinition<{ party: EntityId; }>

Party ownership for property and stationary stores.


const StagedProcess: ComponentDefinition<{ version: number; definition: string; definitionVersion: number; station: EntityId; stageIndex: number; progressSeconds: number; enteredTick: number; phase: "blocked" | "complete" | "working" | "waiting"; blockedReason: string; }>


const FieldWaterWork: ComponentDefinition<{ process: EntityId; role: string; generation: number; party: EntityId; destination: EntityId; material: string; retainInVessel: boolean; portions: number; vessel: EntityId | null; cellX: number; cellY: number; cellZ: number; lot: EntityId | null; }>

Native durable field-water acquisition intent. Once its lot is withdrawn, the native owner replaces this record with SupplyAllocation.


const ResourceOrder: ComponentDefinition<{ definition: string; cellX: number; cellY: number; cellZ: number; status: ResourceOrderStatus; progressSeconds: number; reason: string; }>

Engine-owned durable intent for one tended resource lifecycle.


const Spawned: ComponentDefinition<{ cause: string; digest: string; }>

Where the kernel keeps a spawned entity’s cause and request digest.


const terrainChoiceSchema: ZodDiscriminatedUnion<[ZodObject<{ kind: ZodLiteral<"voxel">>; environment: ZodCustom<EnvironmentDefinition, EnvironmentDefinition>>; art: ZodCustom<TerrainPresentationDefinition, TerrainPresentationDefinition>>; }, $strip>>, ZodObject<{ kind: ZodLiteral<"sea">>; environment: ZodCustom<EnvironmentDefinition, EnvironmentDefinition>>; art: ZodCustom<TerrainPresentationDefinition, TerrainPresentationDefinition>>; }, $strip>>], "kind">>


const block: Readonly<{ heading: (text) => object; text: (text) => object; check: (label, done) => object; stat: (label, value, glyph?) => object; meter: (label, value, max, tone, glyph?) => object; items: (label, grid, items) => object; action: (label, command, input?) => object; keyAction: (label, shortcut, command, input?) => object; clock: (label, options) => object; portrait: (name, status, mood?) => object; minimap: (label, grid, marks) => object; offer: (label, price, command, options) => object; recipe: (label, inputs, output, command, input?) => object; notice: (text, tone?) => object; group: (id, label, blocks, initiallyOpen) => { kind: "heading"; text: string; } | { kind: "text"; text: string; } | { kind: "check"; label: string; done: boolean; } | { kind: "stat"; label: string; value: string | number; glyph?: string; } | { kind: "meter"; label: string; value: number; max: number; tone?: "success" | "error" | "info" | "warning"; glyph?: string; } | { kind: "items"; label: string; columns: number; rows: number; items: object[]; } | { kind: "action"; label: string; command: string; input?: JSONType; shortcut?: string; } | { kind: "clock"; label: string; detail?: string; phase?: "day" | "dusk" | "night" | "dawn"; time?: boolean; } | { kind: "portrait"; name: string; status: string; mood?: "ok" | "warn" | "bad"; } | { kind: "minimap"; label: string; columns: number; rows: number; marks: object[]; } | { kind: "offer"; label: string; price: string; detail?: string; act?: string; command: string; input?: JSONType; } | { kind: "recipe"; label: string; inputs: object[]; output: { label: string; glyph: string; have?: number; need?: number; quantity?: number; }; command: string; input?: JSONType; } | { kind: "notice"; text: string; tone?: "success" | "error" | "info" | "warning"; } | { kind: "group"; id: string; label: string; initiallyOpen: boolean; blocks: ({ kind: "heading"; text: string; } | { kind: "text"; text: string; } | { kind: "check"; label: string; done: boolean; } | { kind: "stat"; label: string; value: string | number; glyph?: string; } | { kind: "meter"; label: string; value: number; max: number; tone?: "success" | "error" | "info" | "warning"; glyph?: string; } | { kind: "items"; label: string; columns: number; rows: number; items: object[]; } | { kind: "action"; label: string; command: string; input?: JSONType; shortcut?: string; } | { kind: "clock"; label: string; detail?: string; phase?: "day" | "dusk" | "night" | "dawn"; time?: boolean; } | { kind: "portrait"; name: string; status: string; mood?: "ok" | "warn" | "bad"; } | { kind: "minimap"; label: string; columns: number; rows: number; marks: object[]; } | { kind: "offer"; label: string; price: string; detail?: string; act?: string; command: string; input?: JSONType; } | { kind: "recipe"; label: string; inputs: object[]; output: { label: string; glyph: string; have?: number; need?: number; quantity?: number; }; command: string; input?: JSONType; } | { kind: "notice"; text: string; tone?: "success" | "error" | "info" | "warning"; })[]; }; }>


const SHELL_KEYS: ReadonlyMap<string, string>>

Keys the player shell already owns: the dock (Build, Orders, Zones) and the camera turn. A cartridge key may not shadow them.


const WorkParticipation: ComponentDefinition<{ automatic: boolean; }>

Player participation policy for the shared automatic work owner.


const WorkPolicy: ComponentDefinition<{ pool: string; priority: number; enabled: boolean; }>


const WorkExecution: ComponentDefinition<{ pool: string; initiatingPlayer: string | null; policyId: string; }>


const WorkSchedule: ComponentDefinition<{ nextReviewTick: number; lastConsidered: number; }>


const MEADOW_VERTICAL_METRES: 0.54 = 0.54

Metres per vertical terrain cell in the library worlds.

isReservedComponent(id): boolean

string

boolean


isNativeComponentSchema(id): boolean

Native registration and mutation authority are distinct. These schemas are installed by the kernel even when a pack does not use them. Some accept scoped authored policy/intent, so they must not become reserved writes.

string

boolean


component<T>>(id, options): ComponentDefinition<T>>

T extends object

`${string}.${string}`

number

Readonly<Record<keyof T & string, FieldType>>

keyof T & string

readonly `${string}.${string}`[]

readonly `${string}.${string}`[]

RelationRemovalPolicy

boolean

ComponentDefinition<T>


relation<T>>(id, options): ComponentDefinition<T>>

Register a one-target relation through the same component definition path.

T extends object

`${string}.${string}`

number

Readonly<Record<keyof T & string, FieldType>>

keyof T & string

readonly CapabilityReference[]

readonly CapabilityReference[]

RelationRemovalPolicy

boolean

ComponentDefinition<T>


setRelation<T>>(definition, source, target): ActionRequest

T extends object

ComponentDefinition<T>

EntityId

EntityId

ActionRequest


clearRelation<T>>(definition, source): ActionRequest

T extends object

ComponentDefinition<T>

EntityId

ActionRequest


query<T>>(…components): QuerySpec<T>>

T extends object

…readonly ComponentDefinition<any>[]

QuerySpec<T>


system(options): SystemDefinition

SystemOptions

SystemDefinition


command<TInput>>(options): GameCommandDefinition

TInput

Omit<GameCommandDefinition, "input" | "title" | "description" | "subjects" | "invoke" | "category" | "availability"> & object

GameCommandDefinition


entity(id): EntityId

string

EntityId


definitionCapability<T>>(id, options): ActorDefinitionCapability<T>>

T extends object

`${string}.${string}`

ZodType<T>

boolean

ActorDefinitionCapability<T>


predicate(id, options): PredicateDefinition

`${string}.${string}`

readonly ComponentDefinition<any>[]

readonly NativeFact[]

(subject, context) => boolean

PredicateDefinition


action(id, options): BehaviorActionDefinition

`${string}.${string}`

readonly ComponentDefinition<any>[]

readonly ComponentDefinition<any>[]

readonly NativeFact[]

string

(subject, context) => void

BehaviorActionDefinition


behavior(id, define, options?): BehaviorDefinition

Prepare friendly behavior syntax into the existing checked system runtime. The callback records branches once; it never reads or mutates a live world.

`${string}.${string}`

(scene) => void

BehaviorOptions = {}

BehaviorDefinition


installActorBehaviors(actors): readonly SystemDefinition[]

Pack preparation: install every attached behavior exactly once, with its subject membership compiled from the actors that attached it. Distinct behaviors sharing one id fail here, before any world starts.

readonly ActorDefinition[]

readonly SystemDefinition[]


actor(id, options?): ActorDefinition

Compose an immutable actor definition; spawning remains an admitted world operation.

string

number

ActorDefinition


blueprintModule(id, spec): BlueprintModule

Declare one room. Openings and slots are checked against its size.

string

readonly [number, number]

readonly BlueprintOpening[]

Readonly<Record<string, readonly [number, number]>>

readonly string[]

Readonly<Partial<Record<BlueprintSide, string>>>

BlueprintModule


assembleBlueprint(recipe): Blueprint

Join a recipe’s rooms into one building. Rooms may not overlap; a wall two rooms share becomes one piece; a doorway must open into another room, and two rooms must agree on what fills a shared wall.

BlueprintRecipe

Blueprint


compileBlueprint(blueprint, kit): object

A blueprint’s pieces as placement plans for a game’s own buildables. pieces names the buildable for each kind, and styles for each kind in a style (a styled piece with no buildable of its own is an error, never the plain one); groundAt gives the ground height (the support cell’s y) at a column. floor optionally names a buildable covering every room cell, emitted before the edge pieces. A piece over a column with no ground is left out and listed in unplaced.

Blueprint

Pick<Construction, "candidates">

Readonly<Record<BlueprintPiece["kind"], string>>

string

Readonly<Record<string, Readonly<Partial<Record<"wall" | "window" | "door", string>>>>>

(x, z) => number | undefined

object

readonly plans: readonly PlacementCandidate[]

readonly unplaced: readonly (BlueprintPiece | BlueprintFloor)[]


prebuildBatches(party, plans): readonly ActionRequest[]

Plans split into prebuild actions of at most 256 structures each.

EntityId

readonly PlacementCandidate[]

readonly ActionRequest[]


buildable(id, definition): ActorDefinition

Declare a buildable once. Its structure catalog entry, build-bar binding, placement ghost and staged art all derive from this one definition.

string

string = ...

The player-facing noun: “Build wall”, “stair north”.

string = ...

Sprite family; stages derive as ${sprites}.stakes|frame|finished (cells) or ${sprites}.segment.${stage}.${axis} (edges).

{ kind: "fixture"; footprint: [number, number][]; } | { kind: "aperture"; height: number; openingBottom: number; openingHeight: number; closed?: boolean; } | { kind: "floor"; } | { kind: "cover"; } | { kind: "wall"; height: number; } | { kind: "stair"; run: number; rise: number; } = environmentStructureGeometrySchema

object[] = ...

number = ...

number = ...

{ alignment: "fixed" | "stroke"; facing?: { north: number; east: number; south: number; west: number; }; } = ...

Optional gesture override. Omitted, the ghost, gesture and facing all derive from the geometry: boundaries stroke along a drag, everything else is fixed and turns through the four cardinal facings. Nobody authors a placement ghost; it is always the buildable’s own finished art.

"fixed" | "stroke" = ...

{ north: number; east: number; south: number; west: number; } = ...

number = ...

number = ...

number = ...

number = ...

object[] = ...

{ salvage?: object[]; emptyPorts?: string[]; } = ...

object[] = ...

string[] = ...

boolean = ...

False: only a founding or a blueprint stands it (a cell’s bars, a police station’s cell door); players never plan one, so it has no build binding and the build command refuses it.

string = ...

A key that picks this buildable while the build palette applies.

ActorDefinition


buildBindingDetail(compiled, orientation?): string

Compact build-bar copy: cost, size, gesture and facing.

CompiledBuildable

string

string


construction(options): Construction

The Construction extension: compile buildables once, derive every view. Its build command keeps at most 128 plans open (not yet finished) at once. Finished structures do not count toward that limit; the kernel’s caps on structure instances and cells bound how many a world can hold.

ConstructionOptions

Construction


defineCartridge(spec): Cartridge

Compile one cartridge: install attached behaviors, collect components, encode the definition and environment, and derive the host variant. Every failure is thrown here, before any world starts.

CartridgeSpec

Cartridge


launch(launcher, ammunition, velocity): ActionRequest

Velocity is in world axes, relative to the launcher’s motion.

EntityId

EntityId

Vec3

ActionRequest


displace(entity, delta): ActionRequest

Bounded grounded knockback; the native owner checks obstacles and supports. A terrain walker (an actor with Traversal) is pushed as it would walk: the push stops at a wall, a closed door, a filled cell, a ledge past its step height or no floor, and the actor can be routed again from where it lands.

EntityId

Vec3

ActionRequest


beginEmission(worker, station): ActionRequest

EntityId

EntityId

ActionRequest


exchangeFieldWater(operation, worker, vessel, cell, portions?): ActionRequest

string

EntityId

EntityId

number

number

number

number = 1

ActionRequest


move(entity, destination, facing?, speed?): ActionRequest

EntityId

MoveDestination

number = 0

number

ActionRequest


dropLot(entity, lot): ActionRequest

EntityId

EntityId

ActionRequest


transfer(lot, from, to, quantity): ActionRequest

EntityId

EntityId

EntityId

number

ActionRequest


requestDelivery(request): ActionRequest

EntityId

EntityId

string

number

EntityId

ActionRequest


consume(entity, lot, quantity): ActionRequest

EntityId

EntityId

number

ActionRequest


extractResource(operation, worker, source): ActionRequest

string

EntityId

EntityId

ActionRequest


establishResourceSite(operation, worker, site, definition, cell): ActionRequest

string

EntityId

EntityId

string

number

number

number

ActionRequest


tendResourceSite(operation, worker, site, vessel): ActionRequest

string

EntityId

EntityId

EntityId

ActionRequest


encodeDefinition(game, components, initial?, materialCatalog, stockpileProfiles?, actors?): Uint8Array<ArrayBuffer>>

string

readonly ComponentDefinition<any>[]

readonly SceneEntity[] = []

readonly object[]

readonly object[] = []

readonly ActorDefinition[] = []

Uint8Array<ArrayBuffer>


cancelWork(entity): ActionRequest

EntityId

ActionRequest


compileBuildable(actor): CompiledBuildable | null

Compile one actor capability set into the existing native structure owner.

ActorDefinition

CompiledBuildable | null


compileBuildableEnvironment(environment, actors): EnvironmentDefinition

Add actor-authored structures to one environment and run its full validator.

EnvironmentDefinition

readonly ActorDefinition[]

EnvironmentDefinition


constructionCandidates(definition, alignment, raw, namespace): readonly PlacementCandidate[]

Compile a creator gesture into canonical physical proposals. The definition owns geometry; this layer owns normalization; native placement owns permission.

EnvironmentStructureDefinition

PlacementAlignment

string = ...

"north" | "east" | "south" | "west" = ...

{ cell: [number, number, number]; } | { area: { start: [number, number, number]; end: [number, number, number]; }; } | { edges: object[]; } = ...

string

readonly PlacementCandidate[]


constructionPlanActions(options): readonly ActionRequest[]

Turn checked proposals into ordinary engine actions. This resolves existing floors and duplicate sites; native action admission still rechecks all laws.

ConstructionPlanOptions

readonly ActionRequest[]


constructionTarget(site): ConstructionTarget

Decode the native flat component wire into its exhaustive physical target.

ConstructionSiteState

ConstructionTarget


constructionCell(site): Vec3

ConstructionSiteState

Vec3


replaceFloor(orderId, existingFloorId, desiredCatalog): ActionRequest

EntityId

EntityId

string

ActionRequest


planConstructions(party, plans): ActionRequest

EntityId

readonly PlacementCandidate[]

ActionRequest


prebuildStructures(party, plans): ActionRequest

Stand structures up at once, finished, with no work and no materials: the buildings a fresh world starts with (a town, a harbour, a starter base). They are ordinary finished sites afterwards: workers deconstruct them, rules break them. Issue it once (a starting rule with a saved flag, or the world’s opening actions); a restored world already has them. All the plans stand, or none do.

EntityId

readonly PlacementCandidate[]

ActionRequest


bindConstructionStage(site, contact): ActionRequest

EntityId

Vec3

ActionRequest


setStructureOpen(worker, site, open): ActionRequest

Request a desired aperture state; native contact and physical admission decide.

EntityId

EntityId

boolean

ActionRequest


breakStructure(site): ActionRequest

Break a finished structure: the native teardown deconstruction uses, but with no worker (a wall smashed, a door torn off, a dock blown apart). Any salvage the buildable declares lands as ground stock where it stood. The game decides when; the engine keeps no hit points of its own.

EntityId

ActionRequest


deconstruct(worker, site): ActionRequest

EntityId

EntityId

ActionRequest


formatDiagnostic(diagnostic): string

VD013 <message>\n hint: <hint> — the terminal and overlay rendering.

Diagnostic

string


fail(code, message, hint, path?): never

Throw one diagnostic.

"VD001" | "VD002" | "VD003" | "VD004" | "VD005" | "VD006" | "VD007" | "VD008" | "VD009" | "VD010" | "VD011" | "VD012" | "VD013" | "VD014" | "VD015" | "VD016" | "VD017" | "VD020" | "VD021" | "VD022" | "VD023" | "VD024" | "VD025" | "VD030" | "VD031" | "VD032" | "VD033" | "VD034" | "VD040" | "VD041" | "VD050" | "VD051" | "VD052" | "VD060" | "VD061" | "VD070" | "VD071" | "VD072" | "VD073" | "VD074" | "VD080" | "VD083" | "VD082" | "VD081"

string

string

readonly (string | number)[] = []

never


effect<T>>(id, fields): Effect<T>>

Declare an effect record kind. Its records live keep seconds after the producer’s sweep; a consumer that runs every step sees each one once.

T extends object

`${string}.${string}`

EffectFields<T>

Every field, at and seq included: { ..., at: "number", seq: "number" }.

Effect<T>


createFeedback<Weapon, Simple, Swing>>(profile): Readonly<{ swing: AuthoredFeedbackCue; hit: AuthoredFeedbackCue; shot: AuthoredFeedbackCue; splatSize: number; splat: AuthoredFeedbackCue; wound: AuthoredFeedbackCue; cue: AuthoredFeedbackCue; }>

The engine constructs cues; the cartridge supplies only words, assets and tuning.

Weapon extends string

Simple extends string

Swing extends string

FeedbackProfile<Weapon, Simple, Swing>

Readonly<{ swing: AuthoredFeedbackCue; hit: AuthoredFeedbackCue; shot: AuthoredFeedbackCue; splatSize: number; splat: AuthoredFeedbackCue; wound: AuthoredFeedbackCue; cue: AuthoredFeedbackCue; }>


felt(cue, by): readonly AuthoredFeedbackCue[]

One cue split for a shared world: what everyone near it sees (the word, the flash, the sound, the bits), and what only by, the actor who landed it, fired it or took it, feels (the freeze, the slow-mo, the kick, the rumble, the screen tint). Another viewer sees the shared contact without their own screen stopping. Both name by as subject, so the owner’s client can match them to what it already predicted.

AuthoredFeedbackCue

string

readonly AuthoredFeedbackCue[]


hordeMovement(options?): HordeSimulation

Geometry is projected once per phase; all bodies share fields and neighbour lookup.

{ reads: readonly `${string}.${string}`[]; project: readonly FlowGeometry[]; }

readonly `${string}.${string}`[]

{ radius?: number; separation?: number; alignment?: number; neighbours?: number; candidates?: number; }

number = ...

number = ...

number = ...

number = ...

number = ...

HordeSimulation


perceptionFrame(input, geometry?): object

Immutable, step-local sensor frame. Games supply emitters, targets and geometry.

object[] = ...

object[] = ...

number = ...

number = ...

FlowNavigation

FlowNavigation

object

targets: readonly object[]

observe(input): object

number = ...

number = ...

number = ...

number = ...

{ within: number; extra: number; } = ...

number = ...

number = ...

object

visible: { x: number; z: number; id: string; } | null

heard: { x: number; z: number; radius: number; at: number; } | null


assignHordeSlots(input): ReadonlyMap<EntityId, HordeSlotAssignment>>

Nearest eligible bodies fill interchangeable slots; one body and one occupant per slot.

readonly HordeSlot[]

readonly HordeSlotBody[]

ReadonlyMap<EntityId, HordeSlotAssignment>


localSteering(input): object

Stateless local steering. Native collision remains the final movement authority.

number = ...

number = ...

number = ...

number = ...

number = ...

object

advance(input): object

readonly SteeringBody[]

object

motions: CrowdMotion[]

neighbourChecks: number


resolveLook(spec): Look

Check a cartridge’s look. Throws a coded VD diagnostic on a bad look.

LookSpec | undefined

Look


ambientLightForMood(look, mood): number

Brightness follows the one mood chosen by the cartridge’s presentation.

Look

"day" | "dusk" | "night"

number


moodAt(look, seconds): "day" | "dusk" | "night"

The mood a look shows at committed world time seconds: the last stop at or before it, else the look’s own mood. Full colour is always day.

Look

number

"day" | "dusk" | "night"


instantiateActors(bindingId, expectedSequence, plan): ActionRequest

string

number

ActorInstantiationPlan

ActionRequest


partyMemberIds(read, viewer): ReadonlySet<EntityId>>

The people of a player viewer’s parties (PartyMember of a party whose OwnedBy names them): their characters, as distinct from other things they own (a party’s own bookkeeping marker, a stash).

<T>(spec) => readonly QueryRow<T>[]

CommandScope

ReadonlySet<EntityId>


ownedActorIds(read, viewer): ReadonlySet<EntityId>>

<T>(spec) => readonly QueryRow<T>[]

CommandScope

ReadonlySet<EntityId>


definePhaseCycle<Phase>>(definitions): object

A repeating, simulation-time schedule. Games declare phases; the engine owns boundary progression. Only the returned clock needs to be saved.

Phase extends string

readonly object[]

object

seconds: number

duration: (id) => number

Phase

number

advance(clock, now): PhaseAdvance<Phase>>

PhaseClock<Phase>

number

PhaseAdvance<Phase>


requestProcess(definition, station): object

string

EntityId

object

kind: "request-process"

definition: string

station: EntityId


admitProcess(process, definition, station): object

EntityId

string

EntityId

object

kind: "admit-process"

process: EntityId

definition: string

station: EntityId


place(actor, options): Placement

Put an actor in the starting scene. id defaults to ${actor.id}.${n} in placement order; give one when other content refers to the entity.

ActorDefinition

Cell2

string

Readonly<Record<string, string | number | boolean | null>>

"sea"

Placement


compileScene(scene): CompiledScene

Compile placements into the fresh world’s records and surface settling.

readonly Placement[]

CompiledScene


spawn(actor, options): ActionRequest

Spawn one actor into a running world (from a rule or a command). The receipt is the new entity’s id and makes the request idempotent.

ActorDefinition

string

string

Cell2

Readonly<Record<string, string | number | boolean | null>>

Readonly<Record<string, EntityId>>

ActionRequest


defineSeatGoal<F>>(goal): SeatGoal

Erase the goal’s fact shape after binding its scorer to that same shape.

F extends Readonly<Record<string, number>>

SeatGoal<F>

SeatGoal


voxel(input): VoxelTerrainChoice

EnvironmentDefinition

TerrainPresentationDefinition

VoxelTerrainChoice


seaTerrain(input): SeaTerrainChoice

A voxel environment whose wet columns are presented at the sea line.

EnvironmentDefinition

TerrainPresentationDefinition

SeaTerrainChoice


actorTarget(component): object

One actor target contract for the command parser, subject projection, and local click binding. Admission still belongs to the command’s run handler.

ComponentDefinition<any>

object

readonly input: ZodObject<{ entity: ZodString; }>

readonly subjects: (context) => readonly EntityId[]

Pick<ReadContext, "query">

readonly EntityId[]

readonly binding: Pick<GameLocalBinding, "target" | "component">>


gameWindow(id, spec): CartridgeWindow

Declare a game window as data. The game shell (@fungi.computer/vishnu-ui) draws it by its role with the shared kit (a floating Caps panel by default), and it gets a Whistle command ui:<id> so a key, the palette, a menu and a remote player all open it the same way.

string

object & object

CartridgeWindow


checkWindows(windows): readonly CartridgeWindow[]

Cartridge-wide checks: unique ids and non-conflicting keys.

readonly CartridgeWindow[]

readonly CartridgeWindow[]


checkKeys(windows, controls): void

Every single-key shortcut a cartridge declares (window keys and command control keys) is distinct and clear of the shell’s own keys.

readonly CartridgeWindow[]

readonly object[]

void


windowContents(windows): (world) => readonly Readonly<{ id: string; blocks: readonly ({ kind: "heading"; text: string; } | { kind: "text"; text: string; } | { kind: "check"; label: string; done: boolean; } | { kind: "stat"; label: string; value: string | number; glyph?: string; } | { kind: "meter"; label: string; value: number; max: number; tone?: "success" | "error" | "info" | "warning"; glyph?: string; } | { kind: "items"; label: string; columns: number; rows: number; items: object[]; } | { kind: "action"; label: string; command: string; input?: JSONType; shortcut?: string; } | { kind: "clock"; label: string; detail?: string; phase?: "day" | "dusk" | "night" | "dawn"; time?: boolean; } | { kind: "portrait"; name: string; status: string; mood?: "ok" | "warn" | "bad"; } | { kind: "minimap"; label: string; columns: number; rows: number; marks: object[]; } | { kind: "offer"; label: string; price: string; detail?: string; act?: string; command: string; input?: JSONType; } | { kind: "recipe"; label: string; inputs: object[]; output: { label: string; glyph: string; have?: number; need?: number; quantity?: number; }; command: string; input?: JSONType; } | { kind: "notice"; text: string; tone?: "success" | "error" | "info" | "warning"; } | { kind: "group"; id: string; label: string; initiallyOpen: boolean; blocks: ({ kind: "heading"; text: string; } | { kind: "text"; text: string; } | { kind: "check"; label: string; done: boolean; } | { kind: "stat"; label: string; value: … | …; glyph?: … | …; } | { kind: "meter"; label: string; value: number; max: number; tone?: … | … | … | … | …; glyph?: … | …; } | { kind: "items"; label: string; columns: number; rows: number; items: …[]; } | { kind: "action"; label: string; command: string; input?: … | …; shortcut?: … | …; } | { kind: "clock"; label: string; detail?: … | …; phase?: … | … | … | … | …; time?: … | … | …; } | { kind: "portrait"; name: string; status: string; mood?: … | … | … | …; } | { kind: "minimap"; label: string; columns: number; rows: number; marks: …[]; } | { kind: "offer"; label: string; price: string; detail?: … | …; act?: … | …; command: string; input?: … | …; } | { kind: "recipe"; label: string; inputs: …[]; output: { label: …; glyph: …; have?: …; need?: …; quantity?: …; }; command: string; input?: … | …; } | { kind: "notice"; text: string; tone?: … | … | … | … | …; })[]; })[]; }>[]

Compile window bodies into the presentation projection.

readonly CartridgeWindow[]

(world) => readonly Readonly<{ id: string; blocks: readonly ({ kind: "heading"; text: string; } | { kind: "text"; text: string; } | { kind: "check"; label: string; done: boolean; } | { kind: "stat"; label: string; value: string | number; glyph?: string; } | { kind: "meter"; label: string; value: number; max: number; tone?: "success" | "error" | "info" | "warning"; glyph?: string; } | { kind: "items"; label: string; columns: number; rows: number; items: object[]; } | { kind: "action"; label: string; command: string; input?: JSONType; shortcut?: string; } | { kind: "clock"; label: string; detail?: string; phase?: "day" | "dusk" | "night" | "dawn"; time?: boolean; } | { kind: "portrait"; name: string; status: string; mood?: "ok" | "warn" | "bad"; } | { kind: "minimap"; label: string; columns: number; rows: number; marks: object[]; } | { kind: "offer"; label: string; price: string; detail?: string; act?: string; command: string; input?: JSONType; } | { kind: "recipe"; label: string; inputs: object[]; output: { label: string; glyph: string; have?: number; need?: number; quantity?: number; }; command: string; input?: JSONType; } | { kind: "notice"; text: string; tone?: "success" | "error" | "info" | "warning"; } | { kind: "group"; id: string; label: string; initiallyOpen: boolean; blocks: ({ kind: "heading"; text: string; } | { kind: "text"; text: string; } | { kind: "check"; label: string; done: boolean; } | { kind: "stat"; label: string; value: … | …; glyph?: … | …; } | { kind: "meter"; label: string; value: number; max: number; tone?: … | … | … | … | …; glyph?: … | …; } | { kind: "items"; label: string; columns: number; rows: number; items: …[]; } | { kind: "action"; label: string; command: string; input?: … | …; shortcut?: … | …; } | { kind: "clock"; label: string; detail?: … | …; phase?: … | … | … | … | …; time?: … | … | …; } | { kind: "portrait"; name: string; status: string; mood?: … | … | … | …; } | { kind: "minimap"; label: string; columns: number; rows: number; marks: …[]; } | { kind: "offer"; label: string; price: string; detail?: … | …; act?: … | …; command: string; input?: … | …; } | { kind: "recipe"; label: string; inputs: …[]; output: { label: …; glyph: …; have?: …; need?: …; quantity?: …; }; command: string; input?: … | …; } | { kind: "notice"; text: string; tone?: … | … | … | … | …; })[]; })[]; }>[]


workAttemptsFor(context, tasks): readonly WorkAttempt[]

Query native attempt ownership without leaking the port’s non-empty batch contract.

Pick<ReadContext, "workAttempts">

readonly EntityId[]

readonly WorkAttempt[]


workAttempt(context, task): WorkAttempt | null

Read the one native attempt projection for a task.

Pick<ReadContext, "workAttempts">

EntityId

WorkAttempt | null


beginRouteWorkAttempt(context, task, worker, destination): void

Pick<WriteContext, "action">

EntityId

EntityId

MoveDestination

void


interruptWorkAttempt(context, attempt, operationSequence, cause): void

Pick<WriteContext, "action">

WorkAttemptKey

number

WorkInterruptCause

void


retargetRouteWorkAttempt(context, attempt, operationSequence, destination): void

Replace only the current route operation, preserving its attempt generation.

Pick<WriteContext, "action">

WorkAttemptKey

number

MoveDestination

void


continueRouteWorkAttempt(context, attempt, operationSequence, destination): void

Pick<WriteContext, "action"> & Pick<ReadContext, "workAttempts">

WorkAttemptKey

number

MoveDestination

void


acknowledgeWorkAttempt(context, attempt, operationSequence): void

Acknowledge only the currently projected terminal operation.

Pick<WriteContext, "action"> & Pick<ReadContext, "workAttempts">

WorkAttemptKey

number

void


continueDeconstructionWorkAttempt(context, attempt, operationSequence, site, contact): void

Pick<WriteContext, "action"> & Pick<ReadContext, "workAttempts">

WorkAttemptKey

number

EntityId

ConstructionAccessContact

void


continueResourceEstablishWorkAttempt(context, attempt, operationSequence, site, definition, cell): void

Pick<WriteContext, "action"> & Pick<ReadContext, "workAttempts">

WorkAttemptKey

number

EntityId

string

readonly [number, number, number]

void


continueResourceTendWorkAttempt(context, attempt, operationSequence, site, vessel): void

Pick<WriteContext, "action"> & Pick<ReadContext, "workAttempts">

WorkAttemptKey

number

EntityId

EntityId

void


continueResourceExtractWorkAttempt(context, attempt, operationSequence, source): void

Pick<WriteContext, "action"> & Pick<ReadContext, "workAttempts">

WorkAttemptKey

number

EntityId

void


continueFieldWaterWorkAttempt(context, attempt, operationSequence, vessel, cell, direction, portions): void

Pick<WriteContext, "action"> & Pick<ReadContext, "workAttempts">

WorkAttemptKey

number

EntityId

readonly [number, number, number]

"withdraw" | "deposit"

number

void


continueMaterialTransferAttempt(context, attempt, operationSequence, lot, from, to, quantity): void

Continue one admitted attempt through the native material transfer owner.

Pick<WriteContext, "action"> & Pick<ReadContext, "workAttempts">

WorkAttemptKey

number

EntityId

EntityId

EntityId

number

void


continueMaterialDropAttempt(context, attempt, operationSequence, lot): void

Continue an admitted attempt through the native ground-custody owner.

Pick<WriteContext, "action"> & Pick<ReadContext, "workAttempts">

WorkAttemptKey

number

EntityId

void


meadow(options?): WorldSpec

A generated grassy world: soil over stone, rolling from seed, radius cells out from the origin. Everything a cartridge’s world needs.

string

number

WorldSpec


sea(options): WorldSpec

A chart sea with a rectangular sand shore in native terrain.

string

number

{ minX: number; maxX: number; minZ: number; maxZ: number; }

number

number

number

number

WorldSpec