verifyCheckpoint(checkpoint, computedStateRoot, predecessor = null)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/integrity/Checkpoint.js — compaction + fast restoration (spec §13). A checkpoint summarizes history without pretending it never existed: it links to the previous checkpoint and the event range it covers, and pins the canonical state root, unspent output root, and policy/schema/validator versions. A restored system must verify its state root before accepting new commits (spec rule 64). Checkpoints carry an optional authority signature. Functions Build a checkpoint record. Parameters: (object) — No description in source JSDoc. (string) — prior checkpoint id (null for first) (string) — event log head hash at this point (string) — canonical state root (string) — root over unspent outputs (number) — first covered event seq (number) — last covered event seq (string) — No description in source JSDoc. (string) — No description in source JSDoc. (string) — No description in source JSDoc. (string null) — authority signature over the checkpoint id Returns: frozen checkpoint with a stable Verify a checkpoint's stateRoot matches a freshly computed root, and (if a predecessor is provided) that the chain links correctly (spec rule 60,64). Returns: } <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/integrity/EventLog.js
Classes
class EventLog
Re-exports
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/integrity/EventLog.js — append only commit stream (spec §13). Committed changes are appended to an immutable, hash chained event log. Materialized views can be rebuilt without altering history (event sourcing). Each entry links to the previous entry's hash, so any tampering with earlier history changes every subsequent link — a lightweight Merkle chain. The hash is the fast tagged id of the canonical entry (hot path); authority signatures live on the witness receipts the entries reference. Classes Method Signature Summary Append an event. Returns the frozen entry (with its chained hash). Entry at a sequence index, or null. All entries (frozen shallow copy). Verify the hash chain is intact end to end. Re exports <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/integrity/GarbageCollector.js
Classes
class GarbageCollector
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/integrity/GarbageCollector.js — Integrity plane garbage collection (spec §3 plane 8, rule 61; liveness "GC never removes pinned authoritative state"). GC reclaims storage by collecting objects that are no longer reachable from a set of SIGNED ROOTS (latest checkpoint, unspent outputs, retained branches) and not protected by a retention policy. It is mark and sweep over the reference graph: anything reachable from a root — or explicitly pinned — is retained; everything else is eligible. The hard invariant is that GC can NEVER remove pinned authoritative state, even if it looks unreferenced. Classes Method Signature Summary Register an object and the ids it references. Add/remove a signed root (checkpoint, unspent set, retained branch tip). Pin authoritative state so GC can never collect it (rule 61 invariant). Mark: ids reachable from any root, transitively (cycle safe). Objects eligible for collection: unreachable AND not pinned. Sweep: remove collectable objects. Pinned and root reachable objects are always retained. Returns the ids actually collected. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/integrity/Retention.js
Classes
class RetentionManager
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/integrity/Retention.js — Integrity plane encryption & retention manager (spec §13 "Privacy and deletion", rule 62). Append only logs conflict with deletion requirements. The resolution: store sensitive payloads ENCRYPTED under a scoped key, leaving only minimal, non sensitive audit metadata in the permanent record. Destroying the scope key renders the encrypted payload infeasible to recover — NIST "cryptographic erase" — so the audit trail survives while the sensitive bytes are irrecoverable. The cipher here is a deterministic keyed stream (model grade, not production crypto): the point is the KEY LIFECYCLE invariant, i.e. erase the key ⇒ payload unrecoverable, metadata retained. Classes Method Signature Summary Create a scope with fresh key material; returns the scope id. Seal a sensitive payload under a scope. Returns an envelope carrying the ciphertext plus NON sensitive audit metadata that is always retained. Open an envelope — returns plaintext, or null if the key was crypto erased. Cryptographic erase: destroy a scope's key so every payload sealed under it becomes irrecoverable, while audit metadata in already issued envelopes (and the permanent log) remains intact (rule 62). <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


async aeadSeal(key, plaintext, aad = '')

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/integrity/SecureCrypto.js — production grade authenticated encryption (spec §13 privacy, §17 deterministic core boundary). Real AEAD via Web Crypto AES 256 GCM. Used by SecureRetention for sensitive payloads so that destroying the key (cryptographic erase) renders ciphertext infeasible to recover, and any tampering with ciphertext/AAD fails the GCM authentication tag. This is the production swap in for the model grade keyed stream used elsewhere. All operations are async (SubtleCrypto); callers that need a sync path keep the deterministic fallback in RetentionManager. Functions Generate a fresh AES 256 GCM key (extractable, for raw export/erase tests). AEAD seal a plaintext string. (additional authenticated data) binds the ciphertext to a context (e.g. the scope id) without encrypting it. Returns: } AEAD open an envelope. Returns plaintext, or null if the key is wrong/erased or the ciphertext/AAD was tampered with (GCM tag check fails). <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/integrity/SecureRetention.js
Classes
class SecureRetentionManager
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/integrity/SecureRetention.js — production AES 256 GCM retention manager (spec §13, rule 62). The cryptographic counterpart of RetentionManager. Sensitive payloads are sealed under a per scope AES GCM key held only in memory as a non extractable by policy CryptoKey reference. Cryptographic erase drops that reference, after which the ciphertext is infeasible to recover (NIST crypto erase), while non sensitive audit metadata on the envelope survives. GCM's authentication tag also makes any tampering with the ciphertext or the scope bound AAD fail closed (open → null). Classes Method Signature Summary Create a scope backed by a fresh AES 256 GCM key. AEAD seal a payload under a scope. The scope id is the AAD, binding the ciphertext to its scope. Audit metadata is retained in the clear. AEAD open an envelope; null if key erased or ciphertext/AAD tampered. Cryptographic erase: drop the scope key; ciphertext becomes unrecoverable. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


computeStateRoot({ facts = [], unspent = [], entityHeads = [] } = {})

rootFromStores({ factStore = null, usoRegistry = null, entityRegistry = null } = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/integrity/StateRoot.js — Merkle style canonical state root (spec §13,§19). A state root is the hash of the canonical, ORDER INDEPENDENT summary of the authoritative state: the live fact set, the unspent output id set, and the entity head version ids. The committed state root must exactly match the committed outputs (safety invariant). A hash proves exact content only — not correctness — so the root is used for integrity/restoration, never as a semantic truth or authority claim (spec rule 52). Functions Compute a state root from the authoritative components. Any iterable is accepted; members are sorted for order independence. Parameters: (object) — No description in source JSDoc. (Iterable<string ) — live fact strings (Iterable<string ) — unspent USO ids (Iterable<string ) — entity head version ids Returns: tagged state root id Convenience: derive a state root from live engine registries. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/observer/Projection.js
Functions
projectSequence(store, links = [])
chooseBranch(branches, selector = ()
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/observer/Projection.js — the observer creates EXPERIENCED order. Core truth may be unordered or branched. An observer sees one path, but that is only a projection: render order is not truth, UI order is not truth, debug order is not truth. Only committed facts are canonical — so every projection here carries and a witness. Turning a projection into truth requires a CommitGate. Functions Project one experienced sequence from a fact store. Independent facts stay deterministically ordered (reproducible), causal links force precedence. Returns: } Choose one branch for an observer to experience. Does NOT commit — the other branches remain possible (recorded as "rejected/not observed" in the witness) until a CommitGate finalizes one as canonical. Parameters: (FactStore[]) — No description in source JSDoc. ((branches:FactStore[])= number) — returns chosen index Returns: } <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/perception/ResonanceIndex.js
Classes
class ResonanceIndex
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/perception/ResonanceIndex.js — the Resonance/Perception extension reattached as an OPTIONAL indexing layer (spec §16, rules 52–56). This is where the codebook / resonance / spatial layers belong: approximate retrieval, never the trusted authority path. The discipline is strict and one directional: approximate similarity → retrieves CANDIDATES (cosine over feature vectors) exact identity (hash) → verifies BYTES (cryptographic/fast hash) semantic constraints → verify MEANING (predicate over content) commit logic → establishes TRUTH (elsewhere; not here) A near match is only ever a suggestion. This module will NEVER return a similar but not byte identical item as a verified match — similarity suggests candidates; it never establishes identity (rule 53). Nearest neighbour search may repair a visual cache or rank suggestions, but must never silently repair inventory, permissions, ownership, or other authoritative semantic state. Classes Method Signature Summary Add an item: a feature for approximate retrieval plus its exact (the bytes that identity is verified against). Approximate retrieval: top candidates ranked by cosine similarity. These are SUGGESTIONS only — never treat the top hit as an identity. Exact identity check: do the stored bytes hash match the supplied bytes? The full §16 pipeline: retrieve candidates by similarity, then return the first that EXACTLY matches by hash AND passes the optional semantic predicate. Returns if no candidate is byte identical — a merely similar candidate is never accepted. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/replication/ByzantineAdapter.js
Classes
class ByzantineAdapter
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/replication/ByzantineAdapter.js — optional Byzantine fault tolerant authority (spec §8 hostile peer to peer profile, rule 38). This is the explicitly separate hostile P2P profile, NOT implied by the default crash fault deployment. It tolerates up to f Byzantine (arbitrary / malicious) nodes given n ≥ 3f+1 members, committing a value only when at least a 2f+1 quorum cast MATCHING votes for it. Two safety mechanisms: • Equivocation detection — a node that votes for two different values in the same round is provably faulty; it is marked Byzantine and ALL its votes are discarded, so a double voter cannot help two values reach quorum. • 2f+1 quorum — with n ≥ 3f+1 and ≤ f faulty nodes, any value with 2f+1 votes has ≥ f+1 honest votes, so two conflicting values can never both commit (their honest supporters would have to overlap). Votes are expected to be signed; an optional verifier rejects unsigned/forged votes. Membership/Sybil control is a deployment policy declared separately. Classes Method Signature Summary Votes required to commit a value (Byzantine quorum). Cast a (signed) vote for in by . Count of HONEST (non Byzantine) votes for a value in a round. True if reached a Byzantine quorum (2f+1 honest matching votes). The committed value for a round, or null if none reached quorum. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/replication/CheckpointQuorum.js
Classes
class CheckpointQuorum
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/replication/CheckpointQuorum.js — quorum signed checkpoint proofs (spec §13 checkpoints + §8 replication, rule 64). A checkpoint summarizes history with a canonical state root. In a replicated deployment a checkpoint becomes authoritative only when a QUORUM of members attest to the SAME state root — this is the proof a restored node verifies before accepting commits (rule 64). Members that attest a different root are recorded as DIVERGENT and never counted toward the quorum, so a minority of faulty/forked replicas cannot finalize a bad checkpoint. Classes Method Signature Summary Propose a checkpoint (must expose and ). A member attests to a state root for a proposed checkpoint. Only members may attest, and only one (latest) attestation per member counts. Members whose attestation matches the proposed root. Members whose attestation diverges from the proposed root. Finalized iff a quorum of members agree on the proposed root. The quorum proof for a checkpoint. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/replication/CrossShardCoordinator.js — cross domain atomic commit (spec §10, rule 40). Cross domain atomicity is the most expensive operation, so it is used only when true all or nothing behavior is required. This coordinator implements two phase commit with the §10 hardening: • locks are acquired in CANONICAL order (sorted shard/key) to avoid deadlock; • a durable PREPARED record is written so a coordinator that crashes after prepare can be recovered and the commit completed (classic 2PC blocks on coordinator failure; the prepared record makes it recoverable); • for operations that do NOT need atomicity, a SAGA fallback is offered instead, since compensation is cheaper than distributed commit. Classes Method Signature Summary Current committed value of a key on a shard. Phase 1 — PREPARE. Acquire all locks in canonical order; record a durable prepared entry. Returns failure (releasing any partial locks) on conflict. Phase 2 — COMMIT. Apply all prepared ops atomically and release locks. Abort a prepared transaction: discard the record and release its locks. True if a tx is prepared but not yet committed (the in doubt window). Recover an in doubt transaction after a coordinator crash by completing the commit from its durable prepared record — 2PC's blocking failure mode made recoverable. SAGA fallback for cross shard work that does NOT require atomicity: run a sequence of local steps with compensation instead of a distributed commit. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/replication/RaftAdapter.js
Classes
class RaftAdapter
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/replication/RaftAdapter.js — crash fault replicated authority (spec §8 Replication, rules 37–39). An in memory Raft cluster used where authority is genuinely SHARED. It manages leader election (with the Raft up to date restriction so a leader never lacks a committed entry) and quorum commit: a command is committed only once it lives on a majority of the cluster, so it survives any minority of crashes. The failure model is explicitly CRASH FAULT (not Byzantine), and progress requires a quorum — when too many nodes are down the cluster correctly STALLS rather than risking divergence (rule 38/39: declare the failure model; partitions force an availability/consistency choice). Classes Method Signature Summary Majority needed for election and commit. Elect a leader. Succeeds only with a live quorum, and only a node whose log is at least as up to date as a voting majority can win (Raft restriction). Propose a command. The leader appends it, replicates to live followers, and commits iff a quorum holds the entry. Returns committed:false (not an error) when the entry replicated but lacks quorum. Bring a follower's log into agreement with the leader (Raft backtracking). Committed commands as seen by a node. True if the entry at is committed on a quorum at the leader's term. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/replication/ReplicatedLog.js
Classes
class ReplicatedLog
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/replication/ReplicatedLog.js — a single replica's replicated commit log (spec §8 "Replication", §11 consensus backed commit record). Implements the Raft log model: each entry is { index, term, command }. The LOG MATCHING property is enforced on replication — an AppendEntries is rejected unless the follower's entry at prevIndex has prevTerm; conflicting suffixes are truncated before appending. Consequently, if two logs hold an entry with the same index and term, the logs are identical up to that index. only advances over entries known durable on a quorum (the RaftAdapter drives that), so a committed entry is never lost under the declared crash fault model. Classes Method Signature Summary Entry at a 1 based index, or null. Committed commands in order (the applied state machine input). Leader side: append a new command under the current term. Follower side AppendEntries with the Raft log matching check. Directly set commit index (leader, after quorum); clamped to length. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/replication/ShardRouter.js
Classes
class ShardRouter
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/replication/ShardRouter.js — deterministic key→shard routing and commit domain boundaries (spec §10, rule 1 of cross domain preference order). A shard is a commit domain: state strongly related to an invariant should land in ONE shard so its commit is local and atomic. The router maps a logical key to a shard deterministically (same key → same shard on every node) using the engine's canonical fast hash, so routing needs no coordination. Transactions touching more than one shard are flagged as cross shard (handled by the CrossShardCoordinator) — the router never silently spans domains. Classes Method Signature Summary Deterministically route a logical key to its shard (commit domain). True if two keys live in the same commit domain (single shard atomic commit). The distinct set of shards a set of keys touches. Classify a transaction's footprint. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


nearestAttractor(vec, attractors, { metric = 'cosine' } = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/resonance/ResonanceVector.js — build + compare resonance signatures and snap to the nearest attractor by SIMILARITY. Layer law: "resonance suggests". This module reports closeness; it never decides identity (hash) or meaning (symbolicSig) or truth (commit). Two patterns can be near in resonance yet mean opposites (potion vs poison) — callers must still check symbolicSig / hash / constraints before trusting. Functions Resonance vector for a tiny 3x3 pattern (Walsh/Hadamard; integer exact). Resonance vector for an NxN visual block (DCT II). Cosine similarity in [ 1, 1] (1 = identical direction). 0 if either is null. Euclidean (L2) distance between two equal length vectors. Nearest attractor by similarity. metric 'cosine' (higher score = closer) or 'l2' (score = negative distance so higher is always closer). Returns: null} <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/resonance/Transforms.js — Phase 3 transforms. Walsh/Hadamard tiny binary patterns (3x3, 4x4) [new] DCT II small visual blocks (8x8, 16x16) Scale routing (per the plan): Walsh for tiny binary, DCT for small visual, wavelets for 32x32+/3D (added later). These produce the "resonance vector": a compressed signature of what a pattern RESEMBLES — never its identity. Functions In place style fast WHT. Integer input → integer output. Length must be a power of two. WHT(WHT(v)) === n v (involutive up to the length scale). Parameters: (ArrayLike<number ) — No description in source JSDoc. Map a packed 3x3 pattern to a length 16 bipolar vector ({0,1} → { 1,+1}, zero padded to the next power of two) ready for the WHT. 1 D DCT II (orthonormal). 1 D inverse DCT II (orthonormal). 2 D DCT II of an NxN block (row major Float array of length N N). 2 D inverse DCT II. Quantize a coefficient vector to integers by step (lossy resonance). <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/sim/WorldDynamics.js
Classes
class WorldDynamics
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/sim/WorldDynamics.js — deterministic stepped world dynamics over simulation time (spec §17 CPU deterministic core, rules 66/68 deterministic replay). World dynamics advance simulated state one tick at a time. To keep canonical state reproducible (and replayable for verification), any randomness comes from a SEEDED deterministic PRNG — never Math.random or wall clock. Running the same dynamics from the same seed and inputs always yields byte identical results, which deterministic replay and fault injection testing depend on. Classes Method Signature Summary Advance for ticks on , deterministically. Never mutates the input. The PRNG is re seeded from the configured seed on every run, so is referentially transparent for the same arguments. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


neighbors2D(x, y, { diagonal = false } = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/spatial/SpatialCode.js — Phase 2: a pattern knows WHERE it belongs. Layer law: "Morton = hot runtime, Hilbert = cold storage / large chunk packing". We reuse the engine's deterministic MathBits curves rather than re deriving them; this module only adds chunk addressing + neighbor lookup and the URC contract that spatialID is "where", never "what" or "truth". Functions 2D Morton/Z order spatial id (16 bits per axis). Inverse of spatialId2D → [x, y]. 3D Morton spatial id (10 bits per axis). Inverse of spatialId3D → [x, y, z]. Hilbert distance for (x,y) on a 2^k grid of side . Inverse of hilbertId2D → [x, y]. World coords → chunk coords for a square chunk grid. Stable chunk id (Morton of chunk coords) for GPU buffer packing + cache locality. Spatial ids of a cell's neighbors (non negative coords only). Returns: } <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/time/Fencing.js
Classes
class FencingDomain
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/time/Fencing.js — monotonic fencing tokens (spec §9, rule 12). A lease optimizes liveness; it is NOT final authority. A paused client may resume after its lease expired. Correctness critical resources therefore require a monotonically increasing fencing token that the PROTECTED RESOURCE itself verifies: a stale token can never mutate protected state (safety invariant, spec §19). Each commit domain issues strictly increasing tokens; the domain rejects any token <= the last one it accepted. Classes Method Signature Summary Issue the next strictly increasing fencing token. The highest token accepted by the protected resource so far. Validate a token against the protected resource WITHOUT accepting it. Accept a token (called only after a successful commit). Monotonic. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/time/SimulationClock.js
Classes
class SimulationClock
class SimulationClockSet
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/time/SimulationClock.js — simulation time (spec §9 "Simulation time"). Simulation time is a domain specific relationship between simulated changes (physics steps, biological cycles, world epochs, oscillator phases). There may be MANY simulation clocks and NO universal model clock — each advances independently. Simulation clocks are distinct from causal time (dependencies) and operational time (deadlines/leases); they never establish authority. Advancing is deterministic: the same sequence of steps yields the same tick, which is required for deterministic replay (rule 66/68). Classes Method Signature Summary Advance the clock by steps (deterministic). Returns the new tick. A set of independent simulation clocks. Each domain advances on its own; there is deliberately no method to advance them all in lockstep to a global time. Method Signature Summary Create or fetch a clock for a domain. Snapshot of every clock's current tick — clocks may differ; that's expected. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/time/TimeModel.js
Functions
createTimeSource(mode = TIMEMODES.NONE)
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/time/TimeModel.js — time is NOT a counter. A state only has "time" if it subscribes to a time source. Real time = change + comparison + memory + causality + irreversible direction. Different sources express different truths; a state can be timeless (NONE) while an observer experiences progression. Functions Create a time source. advances per mode and returns the new value; the engine never does globally. CAUSAL input.causalSteps CLOCKED input.dt (oscillator phase) ENTROPIC input.irreversibleChange (abs — monotonic) OBSERVER input.observed (boolean) MEMORY input.stateDistance ( = 0) HYBRID any combination of the above Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/transaction/CommitCoordinator.js
Functions
createCommitCoordinator(cfg = {})
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/transaction/CommitCoordinator.js — the atomic commit protocol (spec §7). No authoritative state change happens outside this pipeline (spec rule 19). It runs the 14 step protocol over a sealed transaction envelope and a set of canonical registries, then either commits atomically and returns a signed witness receipt, or rejects with a receipt explaining what failed. The pipeline enforces the CSE safety invariants: single spend USOs, expected versions, valid + non revoked authority, fencing token freshness, predicate and invariant checks, idempotent replay, and a post state root that matches the committed outputs. Functions Create a commit coordinator bound to a set of canonical registries. Parameters: (object) — No description in source JSDoc. (import('../uso/USORegistry.js').USORegistry) — No description in source JSDoc. (import('./Idempotency.js').IdempotencyRegistry) — No description in source JSDoc. (import('../causal/CausalParents.js').CausalGraph) — No description in source JSDoc. (import('../authority/CapabilityRegistry.js').CapabilityRegistry) — No description in source JSDoc. (import('../entity/EntityRegistry.js').EntityRegistry) — No description in source JSDoc. (import('../time/Fencing.js').FencingDomain) — No description in source JSDoc. (import('../integrity/EventLog.js').EventLog) — No description in source JSDoc. (Object<string,(ctx:object)= boolean ) — named predicates (Array) — commit strength constraints over live facts ((env:object)= Promise<boolean ) — authority signature check (string) — authority label embedded in receipts (string) — No description in source JSDoc. (string) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples No hand


label embedded in receipts (string) — No description in source JSDoc. (string) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/transaction/Idempotency.js
Classes
class IdempotencyRegistry
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/transaction/Idempotency.js — replay protection (spec rule 21). Every potentially duplicated operation carries an idempotency key ( ). The default registry preserves canonical at most once receipts without eviction for CommitCoordinator and other durable callers. A bounded TTL/LRU policy is available only by explicit opt in for process local replay caches whose mutation safety lives in canonical state or a separate durable dispatch fence. Classes Method Signature Summary Has this idempotency key already been committed? Recorded result for a key, or null. Record the first result for a key. No op (returns existing) if already set. Default registries retain that replay indefinitely; explicitly bounded registries guarantee it only inside their configured replay window. Remove every expired settled receipt and return the number removed. Content free cache diagnostics. Keys and receipts are never projected. Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/transaction/ProposalPool.js
Classes
class ProposalPool
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/transaction/ProposalPool.js — Transaction plane proposal pool (spec §3 plane 5, rules 27–28). Before a transaction reaches the CommitCoordinator it is a PROPOSAL: a candidate that has not yet won its conflict domain. Two proposals that consume the same USO conflict — they must COMPETE, never silently overwrite (rule 27). The pool groups proposals by the exclusive inputs they contend for, picks at most one winner per conflict set (deterministically), and marks the losers as so they re observe and re plan (rule 28). The pool decides only candidacy; the commit gate still establishes truth. Classes Method Signature Summary Submit a proposal envelope (must carry transactionID + consumeSet). Pending proposals grouped by each exclusive input they contend for. Resolve contention: for every contended input, choose one winner by the priority order and mark the rest superseded. A proposal wins only if it wins EVERY input it touches (so it can actually commit atomically). Returns the winners that are clear to hand to the CommitCoordinator. Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


async sealTransaction(env, signer = null)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/transaction/Transaction.js — the one canonical transaction envelope. Every authoritative state change flows through this envelope (spec §6). A transaction must STATE everything whose correctness depends on current state: read set (expected versions), predicates, consumed inputs (USOs), created outputs, capabilities and external effect intents. Checking only written objects is insufficient — predicate/write skew anomalies require the read+predicate sets to be declared up front (spec rule 20). The envelope is a plain, canonicalizable object; its transactionID is the secure hash of its canonical bytes (signature excluded), so the id is stable and tamper evident. Functions Build a canonical transaction envelope. Missing fields default to safe empty values so the shape is always complete (no partial transactions). Parameters: (object) — No description in source JSDoc. (string) — principal proposing the change (string) — (deduplication) (string[]) — ids this tx causally depends on (string[]) — named predicates that must hold (string[]) — USO ids consumed (each at most once) (string[]) — USO/version ids created (Array) — CRDT merge ops (Phase 4) (string[]) — capability ids authorizing the change (Array) — outbox intents (Phase 3) (string) — No description in source JSDoc. (string) — No description in source JSDoc. (number) — proposal expiry (operational time) (string) — No description in source JSDoc. Returns: a frozen envelope WITHOUT id/signature (see sealTransaction) Canonical bytes of an envelope EXCLUDING id + signature (the signed body). Attach a synchronous (fast) transactionID. Use for runtime/non critical transactions where a 32 bit identity is enough. Returns: frozen


(the signed body). Attach a synchronous (fast) transactionID. Use for runtime/non critical transactions where a 32 bit identity is enough. Returns: frozen envelope with Attach a secure (SHA 256) transactionID and an optional signature produced by an authority signer. The signature covers the transactionID. Parameters: (object) — No description in source JSDoc. Returns: frozen sealed envelope Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


objectVersionOutput(entity, versionId, payload = null)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/uso/USO.js — Unspent State Output: the single spend primitive (spec §5). Adapted from Bitcoin's UTXO model: an exclusive, consumable, finalizable, or scarce resource. A transaction consumes inputs and creates replacement outputs; a consumed output can never be accepted again. Spendability (defined here) is separate from which conflicting spend wins (decided by the commit coordinator), exactly as Bitcoin separates outputs from consensus. Use USOs for: exclusive ownership, scarce inventory, single winner decisions, object mutation rights, permission use, branch finalization, irreversible commits. Do NOT use them for hover/particles/observations/debug notes. Functions Create an unspent state output. The id is derived from kind + entity + a discriminator (e.g. version) so distinct outputs get distinct ids and equal ones collapse. Payload is opaque domain data. Parameters: (object) — No description in source JSDoc. (string) — one of USO KIND (string) — logical entity this output belongs to (string number) — version / serial / denomination ( ) — opaque domain data (quantity, owner, etc.) Returns: frozen USO with a stable Convenience: an object version output (the common mutable object case). True if a value looks like a USO (has a string id and a kind). Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/uso/USORegistry.js
Classes
class USORegistry
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/uso/USORegistry.js — the unspent output set + double commit detector. Tracks which outputs currently exist (unspent) and which have been consumed (spent). Enforces the core safety invariant: an output is never committed as spent twice (spec §19). A spend transaction's inputs must ALL be currently unspent; on commit they move to the spent set and the new outputs are created atomically by the caller (CommitCoordinator). Classes Method Signature Summary Number of currently unspent outputs. Register a freshly created output as unspent. Throws on id reuse. True if the output id is currently unspent (available to consume). True if the output id has already been consumed. Get an unspent output by id, or null. Double commit detector: validate that EVERY id in is currently unspent and that there are no duplicate ids in the request itself. Returns the conflict reason instead of throwing so the coordinator can emit a witness either way. Atomically consume inputs and create outputs. Validates spendability first; if any input is unspendable, NOTHING changes. Returns the result so the coordinator can record a witness. Snapshot the unspent output id set (for state roots / debugging). <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


canonicalBytes(value, { domain = DOMAINSEPARATOR, schemaVersion = '' } = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/util/canonical.js — deterministic serialization + self describing, algorithm tagged hash IDs (CSE Integrity plane, spec §13). Equivalent data MUST produce byte identical bytes before hashing or signing (spec rule 58). We implement an RFC 8785 style canonical JSON: object keys are sorted by UTF 16 code unit, arrays keep order, no insignificant whitespace, and non finite numbers are rejected. Hash IDs are multihash style ( ) so the algorithm can migrate later (spec rule 59). Two tiers, matching the engine's hybrid integrity policy: • hot path id — synchronous 32 bit FNV (runtime identity / state roots). • authority id — async Web Crypto SHA 256 (capabilities, receipts, checkpoints) where security matters. Functions Produce a deterministic canonical JSON string for any JSON compatible value. Object keys are sorted; Maps and Sets are normalized; arrays preserve order. Parameters: ( ) — No description in source JSDoc. Domain separated canonical bytes string used as hash/sign input (spec §13). Synchronous hot path id: 32 bit FNV over canonical bytes. Tagged so it is self describing and migratable. Fast, NOT collision resistant — identity for runtime state, never a security claim (spec rule 52). Returns: Async authority id: Web Crypto SHA 256 over canonical bytes. Use for capabilities, witness receipts, checkpoints, and signed transactions. Throws if SubtleCrypto is unavailable (callers degrade explicitly). Returns: Parse a tagged hash id into or null. True when two tagged hash ids are byte equal (same algorithm + digest). Constants — Domain separator prefix so hashes of different structures never collide. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes


Constants — Domain separator prefix so hashes of different structures never collide. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/util/hashing.js
Functions
hashFactString(value)
hashU32Sequence(values)
canonicalSetHash(facts)
hexId(value)
hashIdTailUint32(hashId, fallback = 0)
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/util/hashing.js — canonical, order independent identity hashing for the URC fact/state layers. Reuses the engine's deterministic ChecksumMath rather than rolling new hashes (layer law: "hash = identity", nothing more). Functions Deterministic 32 bit hash of a single string fact. Deterministic 32 bit hash of an ordered sequence of uint32 (e.g. a packed pattern). Canonical, ORDER INDEPENDENT hash of a set of facts. Facts are stringified, de duplicated and sorted so that {A,B} and {B,A} collapse to the same id — this is what makes sequence free. Parameters: (Iterable<string ) — No description in source JSDoc. Returns: unsigned 32 bit state id Stable hex fingerprint for an unsigned 32 bit value (cold path display/keys). Parse a tagged hash id's low 32 bit hex tail for deterministic bucketing/seeding. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/verify/ModelCheck.js
Functions
exploreCommitMachine(cfg = {})
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/verify/ModelCheck.js — browser runnable bounded model checker for the CSE commit state machine (spec §19, rule 66: model check the core protocol). This is the executable companion to verify/cse core.tla. Where TLC would exhaustively explore the TLA+ model, this performs the SAME exhaustive exploration in JavaScript so it runs inside the verify.html harness with no external tooling. It enumerates every reachable state under all interleavings of commit actions and checks the core safety invariants on each: • NoDoubleSpend — an output is never simultaneously unspent and spent. • SingleSpend — no output is consumed by two committed transactions. • EveryCommitWitnessed — every committed transaction has a witness. A transaction is enabled iff it is uncommitted and all of its inputs are still unspent; applying it consumes inputs, creates outputs, and records a witness. Functions Exhaustively explore the commit state machine. Parameters: (object) — No description in source JSDoc. (string[]) — ids initially unspent (string[]) — transaction ids (Object<string,string[] ) — inputs each tx consumes (Object<string,string[] ) — outputs each tx creates (number) — safety cap on explored states Returns: } <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/version.js

state/version.js
Functions
urcVersionStamp()
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ============================================================ Universal Resonance State Engine (URC) — version source. ============================================================ Order on demand state engine: unordered facts, a resonance codebook, causal order only when forced, branches when order matters, and commit gates that decide final truth. The machine runs in order; the MODEL does not assume order unless forced. Versions are facts too: migration rules reference these stamps, e.g. "URC v1 dense 88 maps to URC v2 dense 402 iff hashID and symbolicSig match". ============================================================ Functions Version stamp embedded on every State/CodeEntry/Receipt for migration + audit. Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/witness/Witness.js
Functions
makeWitness(w = {})
makeReceipt(r = {})
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/witness/Witness.js — debug proof for every projection / commit. Replaces "1 happened, 2 happened, 3 happened" timelines with: these facts existed · these rules fired · these branches were possible · this projection was shown · this commit was chosen. Functions Parameters: (object) — No description in source JSDoc. (string[]) — No description in source JSDoc. (string[]) — No description in source JSDoc. (string[]) — No description in source JSDoc. ( ) — No description in source JSDoc. (string null) — No description in source JSDoc. (Array<number string ) — No description in source JSDoc. Build a full CSE witness receipt for a transaction commit decision (spec §7). The receipt proves WHAT was checked and WHAT the engine decided — it does not claim the input observations were objectively true. Every committed transition has exactly one receipt (safety invariant, spec §19). Parameters: (object) — No description in source JSDoc. ('committed' 'rejected') — No description in source JSDoc. (string) — No description in source JSDoc. (string) — authority that decided (string) — No description in source JSDoc. (string) — No description in source JSDoc. (string[]) — USO ids consumed (string[]) — USO ids created (string[]) — No description in source JSDoc. (string) — No description in source JSDoc. (string) — No description in source JSDoc. (string[]) — No description in source JSDoc. (string[]) — No description in source JSDoc. (string) — reason when decision === 'rejected' (Array) — No description in source JSDoc. (string null) — authority signature over the receipt id <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API


null) — authority signature over the receipt id <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/workflow/Inbox.js
Classes
class Inbox
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/workflow/Inbox.js — idempotent inbox / effect receiver (spec §11, rule 42). The outbox delivers at least once, so the receiving side MUST deduplicate by the stable effect id to make the end to end behavior effectively once. The inbox records the first result for each effect id; a redelivery returns the stored result and does NOT re run the handler (mirrors the transaction IdempotencyRegistry, but for inbound external effects). Classes Method Signature Summary Has this effect id already been processed? Stored result for an effect id, or null. Receive an effect exactly once. On first sight, runs and stores its result; on redelivery, returns the stored result without re running the handler. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/workflow/Outbox.js
Classes
class Outbox
Functions
makeEffectIntent(spec = {})
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/workflow/Outbox.js — transactional outbox (spec §11, rule 41). A canonical commit cannot atomically control an unrelated email server, payment processor, OS call, or device. CSE solves this dual write problem by writing an external effect INTENT into the same atomic transaction as the internal state change (the CommitCoordinator appends intents here on commit); a separate worker later delivers each intent and receivers deduplicate by a stable effect id (rule 42). This module owns the durable intent queue and its status lifecycle: pending → delivering → delivered → acked ↘ failed → (reconcile retry) Re recording the same effect id is a no op, so commit retries never enqueue an effect twice. Delivery is at least once; idempotent receivers (see Inbox.js) make the end to end behavior effectively once. Classes Method Signature Summary Record an intent (called atomically with the commit). Idempotent: an effect id already present is returned unchanged, so commit retries never duplicate the effect (rule 41/42). All entries currently awaiting delivery (pending or previously failed/retry). Entries needing manual/automated reconciliation (ambiguous outcomes). Status for an effect id, or null. Drain pending intents through a delivery function. The deliver fn returns on success, throws or returns on failure, or when the outcome is unknown (→ RECONCILE, never guessed, rule 43). Effects requiring approval are skipped until approved. Mark an effect acknowledged by the receiver (idempotent inbox confirmed). Functions Declare an external effect intent. Every effect must state its reversibility profile so the workflow plane knows whether it can be compensated, retried, or must pause for


external effect intent. Every effect must state its reversibility profile so the workflow plane knows whether it can be compensated, retried, or must pause for approval (spec §11). Parameters: (object) — No description in source JSDoc. (string) — e.g. 'email.send', 'file.write', 'tool.call' ( ) — opaque delivery data (string) — named reconciliation procedure (string) — stable effect id (auto derived if omitted) Returns: frozen intent with a stable Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/workflow/Reconciler.js
Classes
class Reconciler
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/workflow/Reconciler.js — external effect reconciler (spec §11, rule 43). When a delivery outcome is unknown (timeout, crash between send and ack, etc.) the effect is parked in the outbox as RECONCILE rather than guessed. The reconciler queries the external system's authoritative status for each parked effect and resolves it: confirm (it actually happened → ack), retry (it did not happen and is safe to resend → back to pending), or escalate (needs human authority attention). Ambiguity is resolved by EVIDENCE, never assumption. Classes Method Signature Summary Reconcile every effect currently parked in RECONCILE. Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/workflow/Saga.js
Classes
class Saga
Functions
sagaStep(s)
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/workflow/Saga.js — saga coordinator + compensation registry (spec §11). For multi step workflows that span commit domains or external systems, true distributed atomic commit is avoided where possible (rule 40). Instead a saga runs a sequence of LOCAL steps, each with a forward action and a compensating action. If a step fails, the already completed steps are compensated in reverse order. Compensation is a NEW action, not deletion of history (rule 44), and some effects cannot be perfectly undone — every saga declares a PIVOT step after which forward only recovery applies because compensation is no longer possible (rule 45, the irreversible pivot). Classes Method Signature Summary Run the saga. Returns a structured outcome; never throws for ordinary step failures (callers inspect ). Throws only on programmer error. Behavior: all forward steps succeed → COMPLETED. a step fails BEFORE the pivot → compensate completed steps in reverse → COMPENSATED. a step fails AT/AFTER the pivot → forward only; no rollback → FAILED PIVOTED (must be reconciled, not silently undone). Compensate completed steps in reverse order; returns names compensated. Functions Define a saga step. Parameters: (object) — No description in source JSDoc. (string) — No description in source JSDoc. ((ctx:object)= Promise< ) — forward action ((ctx:object, fwd: )= Promise< ) — undo action (boolean) — true → after this step, no rollback is possible Returns: frozen step Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/worldmodel/AffordanceRegistry.js
Classes
class AffordanceRegistry
Functions
makeAffordance(a = {})
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/worldmodel/AffordanceRegistry.js — declares LEGAL actions rather than letting the model invent tool syntax (spec §15 "Affordance registry", rule 34/50). Each affordance binds an action to an object type and declares: preconditions (named predicates evaluated against context), the capability required to do it, predicted effects, a risk level, and a rollback/compensation hint. The planner asks "what may I legally do to this object?" and the registry answers from explicit declarations. High risk / irreversible actions require explicit approval — the registry surfaces this but NEVER authorizes by itself (the capability + commit layer remains the authority). Classes Method Signature Summary Functions Parameters: (object) — No description in source JSDoc. (string) — No description in source JSDoc. (string) — No description in source JSDoc. (string[]) — named predicates that must hold (string) — No description in source JSDoc. (object) — No description in source JSDoc. (string) — one of RISK (string) — rollback / compensation hint (boolean) — No description in source JSDoc. Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/worldmodel/BeliefStore.js
Classes
class BeliefStore
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/worldmodel/BeliefStore.js — separates the AI's belief model from canonical state (spec §15, rules 46–48). The world model maintains five strictly separated worlds: CANONICAL — authoritative committed state (mirror, written ONLY by commit) OBSERVED — currently sensed / retrieved information BELIEF — inferences and uncertain interpretations PREDICTED — counterfactual futures from the model/sandbox PROPOSED — the branch an agent wants to commit Hard rule (47): a prediction or belief can NEVER become canonical directly. This store exposes NO method to write CANONICAL except , which represents the commit gate mirroring an already committed result back into the model. predict()/believe()/observe()/propose() can never touch it. Rule 48: uncertainty grows with prediction horizon unless new evidence reduces it — predict() decays confidence by horizon; observe() can restore it. Classes Method Signature Summary Read a belief record from a layer, or null. Current canonical value mirror (read only here). Mirror an already committed value into the canonical world. This is the ONLY path to CANONICAL and is meant to be called by the commit layer after a witnessed commit — never by inference or prediction. Record a direct observation (high confidence, resets/raises certainty). Record an inference (belief), optionally derived from other subjects. Record a model prediction at a given horizon. Confidence decays with the horizon (rule 48): further out predictions are less certain. Stage a proposed value (a commit candidate) — still NOT canonical. Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/worldmodel/CausalDynamics.js
Classes
class CausalDynamics
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/worldmodel/CausalDynamics.js — AI World Model causal dynamics model (spec §15 "Causal dynamics model", rules 47–49). Predicts how the world MAY change under an action: a registry of declared transition functions, each producing a predicted next state plus an effect summary the sandbox/planner can score. Predictions are hypotheses only — they never mutate canonical state (rule 47). An unknown action is reported as and leaves state unchanged rather than guessing. The model also learns from outcomes: feeding observed effects back adjusts a per action confidence so planning becomes calibrated (rule 49), pairing with ToolEffectModel's discrepancy tracking. Classes Method Signature Summary Declare the dynamics of an action. Predict the next state under an action. Never mutates (clones first) and never invents dynamics for an unknown action. Calibrate an action's confidence from an observed discrepancy in [0,1] (0 = perfect prediction). Confidence is the running mean accuracy. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/worldmodel/ObjectGraph.js
Classes
class ObjectGraph
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/worldmodel/ObjectGraph.js — object identity + relationship graph (spec §15 "Object identity graph" + "Spatial and relationship graph"). Tracks objects with STABLE logical ids (independent of their content version) and typed directed relations between them: inside, near, connected to, blocks, contains, reachable from, visible from, depends on. Relations support reachability queries (e.g. "is room A reachable from room B over ?") which the planner uses without ever asserting canonical truth. Classes Method Signature Summary Add or update an object by its stable logical id. Add a directed relation . Direct neighbors of over a relation. All relations involving as the source: { rel: [to,...] }. Is reachable from following edges (transitively)? BFS over the relation; cycle safe. Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/worldmodel/PredictionSandbox.js
Classes
class PredictionSandbox
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/worldmodel/PredictionSandbox.js — isolated counterfactual rollouts (spec §15 "Prediction sandbox", rules 18, 47, 48). The model proposes multiple futures WITHOUT modifying canonical state. Every produced state is a prediction ( , ) — it can only become real by being turned into a transaction and passing the commit gate. The sandbox enforces the §18 / §15 disciplines: short receding horizon rollouts, branch budgets (width × depth), and uncertainty that grows with the horizon. To guarantee non mutation it deep clones the state before every transition, so even a transition that mutates its argument cannot touch the caller's canonical snapshot. Classes Method Signature Summary Explore futures from by applying up to the horizon. Never mutates . Returns prediction branches; confidence decays with depth (rule 48). Stops when the node budget is exhausted (rule 18). Pick the best predicted branch by risk adjusted value (score × confidence). The winner is a PROPOSAL, not truth — committing it requires the commit gate. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/worldmodel/ToolEffectModel.js
Classes
class ToolEffectModel
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/worldmodel/ToolEffectModel.js — expected vs observed tool consequences and a discrepancy learner (spec §15 "Tool effect model" + "Discrepancy learner", rule 49/51). For each tool the model records what it EXPECTED to happen; after the action the actual result is observed and compared. The discrepancy updates a running calibration score so the planner learns which tools are reliable. World model quality is judged by action outcomes and calibration — not appearance (rule 51). The agent re observes after acting (rule 49); this is where that loop is closed. Classes Method Signature Summary Declare the expected effects of invoking a tool (before acting). Observe the actual effects after acting. Compares against the last declared expectation, updates calibration, and returns the discrepancy in [0,1]. Re observation (rule 49) — never assume the action did what was predicted. Calibration summary for a tool: trials, average error, last error. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


state/worldmodel/UntrustedBoundary.js
Classes
class UntrustedBoundary
Functions
ingestUntrusted(content, meta = {})
canAuthorize(record)
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: state/worldmodel/UntrustedBoundary.js — the prompt injection boundary (spec §15 "Prompt injection boundary", rules 33, 50). All webpages, files, emails, tool outputs, other agents, and generated text are UNTRUSTED OBSERVATIONS — never authority instructions. This boundary is the single chokepoint where such content enters the world model: it wraps the content as an untrusted observation (CERTAINTY.UNTRUSTED) and makes it structurally impossible to treat as policy or to mint authority from it. The model MAY observe broadly, infer cautiously, propose actions, and simulate futures. It MAY NOT mint authority, bypass capabilities, declare its prediction canonical, or treat retrieved text as trusted policy. Authority decisions live OUTSIDE the model (capability + commit), so this module deliberately exposes no path from untrusted content to a capability or a canonical write. Classes Method Signature Summary Wrap and retain a piece of untrusted content; returns the observation. Attempt to derive a capability from untrusted content. This ALWAYS refuses — models/agents cannot mint their own authority (rule 33). Encoded as a method so the refusal is explicit and testable, not merely an absent feature. Convert untrusted content into a belief layer observation for the world model. It enters as an uncertain OBSERVATION the planner may reason about — never as policy or canonical state. Functions Ingest external/tool/model content as an untrusted observation. The returned record is explicitly non authoritative and carries untrusted provenance. Parameters: (string) — No description in source JSDoc. (object) — @param {string} [meta.source] @param {number} [meta.freshnessEpoch] Returns: frozen


Parameters: (string) — No description in source JSDoc. (object) — @param {string} [meta.source] @param {number} [meta.freshnessEpoch] Returns: frozen untrusted observation record True only for records that may carry authority. Untrusted records: always false. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


surfaces/CanvasSurface.js

surfaces/CanvasSurface.js
Functions
make2DCanvas(width, height)
createCanvasSurface(opts = {})
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/surfaces/CanvasSurface.js — the base pixel source: a 2D canvas drawn by a callback. CodeSurface and TerminalSurface build on it. A source exposes the contract SurfaceManager expects: , optional , , , , , . Functions Allocate a 2D canvas (OffscreenCanvas when available, else a DOM canvas). A generic canvas source. Parameters: (object) — { width, height, draw(ctx,info), onPointer, onKey, realtime } <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


surfaces/CodeSurface.js

surfaces/CodeSurface.js
Functions
createCodeSurface(opts = {})
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/surfaces/CodeSurface.js — an editable, syntax lite code view rendered to a canvas so it can live on a mesh. Supports typing, Backspace, Enter, arrow navigation, Home/End, and vertical scroll that follows the caret. Highlighting is intentionally lightweight (comments / strings / numbers / keywords) — enough to read code on a surface without pulling in a full language grammar. Functions Parameters: (object) — { width, height, text, fontSize, editable } <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


surfaces/MediaSurface.js

surfaces/MediaSurface.js
Functions
createImageSurface(opts = {})
createVideoSurface(opts = {})
async createCameraSurface(opts = {})
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: Browser media producers for RenderSurface. These sources only expose pixels that the caller explicitly supplies or requests; camera capture is never started implicitly and owned MediaStreams are always stopped on dispose. Functions Wrap an ImageBitmap, image element, canvas, or URL as a static pixel source. URL created images default to anonymous CORS and expose a promise. Wrap an HTMLVideoElement or create one from a URL/MediaStream. Request a camera only after an explicit caller action, then expose it as a video source. The returned source owns and stops every acquired track. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


surfaces/RenderSurface.js

surfaces/RenderSurface.js
Functions
createRenderSurface(init = {})
markSurfaceDirty(surface)
resizeSurface(surface, width, height)
surfaceNeedsUpload(surface, nowMs)
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/surfaces/RenderSurface.js — a RenderSurface is a live, drawable texture fed by a source (canvas / code / terminal / camera / webgpu / image / video) that can be mapped onto a mesh as baseColor/emissive and optionally receive pointer/keyboard input via UV hit testing. This module owns the schema + update policy (when a surface should re upload to the GPU) and is deliberately GPU free: SurfaceManager performs the upload, the source produces pixels, and RenderSurfaceMaterial binds it to a mesh. Keeping these concerns separate makes surfaces reusable across demos, editor, runtime. Functions Create a RenderSurface descriptor. Parameters: (object) — No description in source JSDoc. Returns: surface Flag a surface as needing a GPU re upload. Resize a surface (also resizes its source canvas) and flag it dirty. Decide whether a surface should upload to the GPU this tick. Pure (no side effects) so it is unit testable; SurfaceManager applies the result. Parameters: (object) — No description in source JSDoc. (number) — No description in source JSDoc. Constants — What feeds a surface's pixels. — Update cadence. only re uploads when the source flags a change; re uploads at most every intervalMs; every frame the surface is visible. uploads once. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


surfaces/RenderSurfaceMaterial.js

createSurfaceMaterial(surface, opts = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/surfaces/RenderSurfaceMaterial.js — bind a RenderSurface onto a mesh as baseColor or emissive, in world or screen space, reusing the EngineMaterial schema so surfaces flow through the same material/binding path as imported textures. The GPU resource accessor lets any renderer drop the surface's live texture into a bind group without knowing how it is produced. Functions Create an EngineMaterial that samples a RenderSurface. Screens usually want the UNLIT workflow + the EMISSIVE slot (they emit their own light) so they stay bright regardless of scene lighting. Parameters: (object) — RenderSurface (object) — { slot, space, unlit, emissiveStrength, name } Returns: EngineMaterial (with a binding block) Live GPU resource for a surface, for inserting into a bind group. Returns: null} null until first upload Is this material backed by a render surface? Returns its binding block or null. Map a virtual surface texture id ( ) back to the surface id. Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


surfaces/SurfaceInputMapper.js

surfaces/SurfaceInputMapper.js
Functions
uvToPixel(surface, u, v)
createSurfaceInputMapper(opts = {})
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/surfaces/SurfaceInputMapper.js — route input to a focused RenderSurface. Pointer events arrive as a UV hit (from the renderer's raycast against the mesh the surface is mapped to); this maps UV → surface pixel coords and dispatches to the surface's source. Keyboard events go to whichever surface is "focused" (typically the last one clicked). Only surfaces whose is true receive events — surfaces are inert by default. Functions Convert a UV hit (with v measured top down) to integer surface pixels. Create an input mapper over a set of surfaces (or a SurfaceManager). Parameters: (object) — { getSurface(id), surfaces:Map Array } <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


surfaces/SurfaceManager.js

surfaces/SurfaceManager.js
Functions
surfaceImageSource(surface)
surfaceImageReady(surface)
createSurfaceManager(device, opts = {})
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/surfaces/SurfaceManager.js — owns the GPU texture lifetime and the update scheduler for a set of RenderSurfaces. Each tick it asks the policy (surfaceNeedsUpload) which surfaces changed/are due/are realtime and visible, renders just those sources, and uploads them — so nothing touches the GPU unless it must (dirty only by default, interval capped, slept when off screen). The actual GPU calls are isolated behind an injectable , so the scheduling logic is testable headless (gates) without a WebGPU device. Functions The uploadable image source backing a surface (canvas / img / video). True when an external image source has decoded enough pixels to copy. Create a surface manager. Parameters: (GPUDevice null) — WebGPU device (may be null for headless tests if an uploader is supplied) (object) — { uploader?, sampler? } <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


surfaces/TerminalSurface.js

surfaces/TerminalSurface.js
Functions
createTerminalSurface(opts = {})
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/surfaces/TerminalSurface.js — an interactive terminal/REPL rendered to a canvas so it can live on a mesh. It keeps a scrollback buffer + an input line, echoes typing, and dispatches a command on Enter via . Safe by design: it only renders its OWN buffer — there is no shell, no eval, nothing external (the host wires whatever onCommand does). Functions Parameters: (object) — { width, height, fontSize, prompt, banner, maxLines, onCommand } <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


surfaces/WebGPUSurface.js

surfaces/WebGPUSurface.js
Functions
createWebGPUSurface(opts = {})
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/surfaces/WebGPUSurface.js — a surface source that ADOPTS an externally rendered GPU texture instead of uploading pixels from a canvas. The host renders into its own render target(s) and hands the current texture/view to the surface each frame via ; SurfaceManager then exposes it like any other surface (sampleable on a mesh) with zero copies. This backs feedback/mirror effects and "stream the screen onto a screen" use cases (SURFACE SOURCE.WEBGPU). Safety: it only ever adopts textures the host already owns — there is no capture of arbitrary external content. Functions Parameters: (object) — { width, height, texture?, view? } Returns: an external surface source <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


surfaces/index.js

surfaces/index.js
Re-exports
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/surfaces/index.js — Render Surfaces barrel (spec Phase 4). A RenderSurface turns a live source (canvas / code / terminal / camera / webgpu / image / video) into a GPU texture that can be mapped onto a mesh as baseColor or emissive and optionally receive pointer/keyboard input via UV hit testing. The SurfaceManager owns texture lifetime + an update scheduler so nothing touches the GPU unless it must (dirty only, interval capped, slept when off screen). Sources only ever render their OWN content (safety by design). Re exports , , , , , , , , , , , , , , , , , , , , , , , , <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


tools/IntegrationTests.js

tools/IntegrationTests.js
Classes
class TestResult
class TestSuite
class TestRunner
Functions
createVehicleMountingTests()
createMultiplayerSyncTests()
createMemoryLeakTests()
createFrameBudgetTests()
createCrossSystemTests()
async runIntegrationTests()
Constants
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes Test result Method Signature Summary Test suite for organizing tests Method Signature Summary Method Signature Summary Functions Constants — Test result status <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


getEntityWorldPosition(ecsWorld, entityId, heightOffset = 0)

computeAimBetweenEntities(ecsWorld, sourceEntityId, targetEntityId, options = {},)

computeAimFromEntityToPoint(ecsWorld, sourceEntityId, worldPoint, options = {},)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Get an entity's world position with an optional vertical offset. Returns null if the entity or Transform is missing. Compute an aim line from one entity to another. Returns { origin, target, direction, distance } or null if invalid. Compute an aim line from an entity to an arbitrary world space point. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


buildMixamoSkeletonFromFBX(fbx, opts = {})

sampleMixamoFBXAnimationClip(fbx, skeleton, opts = {})

computeClipLocalMatricesAtFrame(clip, skeleton, frameIndex, out = null)

computeClipGlobalMatricesAtFrame(clip, skeleton, frameIndex, out = null)

extractRootTranslationTrack(clip, skeleton, opts = {})

extractRootMotion(clip, skeleton, opts = {})

buildTeacherJointPositionDataset(clip, skeleton, opts = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


cameraFocusReport(camera, target, options = {})

cameraEntityFocusReport(camera, subjects, options = {})

focusThirdPersonCamera(camera, target, options = {})

focusThirdPersonCameraOnEntities(camera, subjects, options = {})

cameraFocusTransitionReport(camera, deltaSeconds, options = {})

updateCameraFull(camera, input, options = {})

cameraModeSwitchReport(camera, mode, options = {})

switchCameraMode(camera, mode, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: CameraController.js admitted state management around StandardCameraController. Functions Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


standardCameraMovementResponseReport(currentAxes, targetAxes, options = {})

standardCameraZoomReport(distance, options = {})

standardCameraBoomReport(target, desiredEye, hit = null, options = {})

standardCameraMovementIntentReport(keys, yaw, distance, movementAxes = [0, 0, 0], responseOptions = {},)

standardCameraSphereFitReport(radius, options = {})

standardCameraBoundsFocusReport(bounds, options = {})

standardCameraFocusReport(state, target, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


formatConsoleHookArguments(args, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Render console hook arguments without invoking getters or leaking common credential fields. Output is deliberately bounded so one diagnostic object cannot freeze the in OS console or flood a durable log. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


tools/gizmos/RopeGizmo.js
Classes
class RopeGizmo
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: RopeGizmo Visual handles for manipulating rope attachment points Features: Draggable spheres at start/end attachment points Catenary curve visualization between endpoints Entity snapping when dragging near entities Visual feedback for hover/drag states Based on common patterns from Unity/Unreal constraint gizmos: Anchor points shown as spherical handles Lines/curves connecting attachment points Snapping to nearby entities for easy attachment Classes Method Signature Summary Update line geometry with proper catenary curve based on rope length Hit test against rope handles Find nearest entity to snap to Render the rope gizmo <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


tools/gizmos/TransformGizmo.js
Classes
class TransformGizmo
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: TransformGizmo Visual handles for manipulating entity transforms Now powered by vGPU driver Classes Method Signature Summary <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


tools/gizmos/index.js
Re-exports
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: Gizmos Visual manipulation handles for editor and runtime Re exports , <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


standardInputActionMapReport(actionMap, options = {})

rebindStandardInputAction(ctrl, action, bindings, options = {})

standardGamepadMovementReport(gamepad, options = {})

standardGamepadButtonReport(button, options = {})

standardGamepadHapticEffectReport(gamepad, options = {})

async playStandardGamepadHaptics(gamepad, options = {})

standardGamepadInputReport(gamepad, options = {})

pollInputGamepad(ctrl, gamepads = undefined)

attachInputListeners(ctrl, callbacks = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Create an input controller state object. Attach input listeners to the controller. Returns a cleanup function to remove all listeners. Remove all input listeners. Reset mouse deltas after consuming them for camera update. Get current keyboard state. Get last mouse position. Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


initEntitiesInspectorPanel(doc, entitiesPanel, options = {})


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Re exports <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


createEntityInspectorModel(world, options = {})

setEntityComponentFromInspector(world, entityId, componentName, value)


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Create a standard inspector configuration. Parameters: (Object) — Configuration options (Object) — ECS state { world, lightEntity, selectedEntityId, inspectorApi } (Object) — Spawn state { pendingPosition, basePosition, ghostOffset, pendingType } (Object) — Render state { shaderMode, enableDiffuse, enableBounce, etc. } (Object) — Physics state { enabled, gravityScale, staticFriction, etc. } (Object) — Particle state { instanceCount, emitters } (Array) — Array of spawned entity objects (Function) — Spawn function (Function) — Particle spawn function (Function) — Delete function (Object) — Optional UI elements { brightnessSlider, brightnessValue } (Function) — Optional logger Returns: Inspector configuration <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


tools/inspector/InspectorPanel.js
Functions
attachInspectorPanel(options = {})
Notes & Examples


tools/inspector/NavInspector.js
Functions
createNavInspectorModel(world)
Notes & Examples


createWorldInspectorModel(world, options = {})


renderJsonComponentEditor(doc, container, editor, value)


async renderModelAnimationEditor(doc, container, options = {})


async renderModelMorphEditor(doc, container, options = {})


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Physical Material Component Editor — renders preset dropdown + property sliders for density, elasticity, hardness, brittleness, strength, friction, restitution, deformable/breakable flags, fracture pattern, and damage status. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: PhysicsRopeComponentEditor.js Rope Property Editor Renders rope specific properties in the entity inspector when a rope entity is selected. Uses shared ROPE INSPECTOR SCHEMA from RopeSchema.js for full consistency with RopeTool. Functions Render the PhysicsRope component editor using shared schema <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Inject shared inspector styles into the document. Safe to call multiple times will only inject once. Parameters: (Document) — Document to inject styles into (default: document) Apply standard inspector panel container styles to a DOM element. Parameters: (HTMLElement) — Element to style Check if inspector styles have been injected <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


initNavInspectorPanel(doc, navPanel, options = {})


initSpawnerInspectorPanel(doc, spawnerPanel, options = {})


initSpellBookPanel(container, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: Spell Book Inspector Panel Browse, manage, and organize saved spells. Integrates with SpellBook for persistence. Functions <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


initSpellBuilderPanel(container, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: Spell Builder Inspector Panel Real time spell effect editor integrated with the engine inspector. Allows creating, customizing, and previewing particle based spells. Functions <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


initWorldInspectorPanel(doc, worldPanel, options = {})


tools/inspector/panels/index.js
Re-exports
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Re exports , , , , , , , , , , , , , , , , , , , , <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


createElementLayers(doc, { elements, onChange })

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Re exports , <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


createEmitterInspectorCard(doc, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: EmitterInspectorCard.js Shared emitter property card component Modular emitter editor used by both Spawner and Entities inspector panels. Configurable sections: header, elements, physics, aim. Functions Create a modular emitter inspector card. Parameters: (Document) — The document to create elements in (Object) — Configuration options (Object) — Emitter config object with properties to edit (Object) — Optional spawner props for color sync (has .color array) (Object) — Which sections to show (default all true) (boolean) — =true] Show state badge + color preview (boolean) — =true] Show element toggles with power sliders (boolean) — =true] Show physics property grid (boolean) — =false] Show aim controls (requires setGhostOffset) (Function) — Ghost offset setter for aim controls (Function) — Callback when derived color changes Returns: } Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


createMatterProps(doc, { emitterCfg, onProfileChange })

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: Physics properties grid component Uses slider based controls with value readouts to match element styling. Functions Create the Matter / Substance section for the emitter inspector. Shows substance dropdown, temperature slider, charge slider, state badge, active physics badges, and conditional SPH params. Parameters: (Document) — No description in source JSDoc. Returns: } <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Re exports <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


tools/inspector/panels/spawner/index.js
Functions
getElementsForState(stateId)
Constants
Re-exports
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Deep copy element defaults for a state Constants — Default element configurations for each state of matter Re exports , , , , , , , , , , , <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: SpellBook.js — local stub for the external spell book persistence system. Functions <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: SpellConfig.js — local stub for the external spell configuration system. Functions Constants — SpellConfig.js — local stub for the external spell configuration system. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: SpellEffectFactory.js — local stub for the external spell particle effect factory. Functions SpellEffectFactory.js — local stub for the external spell particle effect factory. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


createThemedBox(doc, title, options = {})

createStatItem(doc, label, value, color)

createThemedCheckboxRow(doc, label, checked, onChange)

getSnapPoints(min, max, snapPoints, tickCount = 6)

formatSliderValue(value, formatter, precision = 2)

createCollapsibleSection(doc, container, titleText, startCollapsed = false)

addSelectRow(doc, section, labelText, items, getValue, setValue)

addVectorRow(doc, section, options = {})

renderInspectorSchema(doc, container, schema, ctx = {})

addNumberRow(doc, section, labelText, getValue, setValue, step)

showInspectorTextInputModal(doc, options = {})

showInspectorContextMenu(doc, options = {})

addSliderRow(doc, section, labelText, min, max, step, getValue, setValue, options = {},)

addCheckboxRow(doc, section, labelText, getValue, setValue)

addTextRow(doc, section, labelText, getValue, setValue)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Create a themed section box (card like container) Create a themed stat item (for performance stats, etc.) Create a themed checkbox row Create a themed slider with label and value display <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


createThemedButton(doc, text, variant = "primary", onClick)

createThemedSectionHeader(doc, text, icon = "")

createThemedTab(doc, text, isActive = false, onClick)

createThemedBadge(doc, text, color = "info")

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Apply theme styles to an element Parameters: (HTMLElement) — Element to style (Object) — Style object from theme Create a themed button Parameters: (Document) — Document (string) — Button text (string) — 'primary' or 'secondary' (Function) — Click handler Create a themed input Parameters: (Document) — Document (string) — Input type Create a themed label Parameters: (Document) — Document (string) — Label text Create a themed section header Parameters: (Document) — Document (string) — Header text (string) — Optional emoji icon Create a themed tab button Parameters: (Document) — Document (string) — Tab text (boolean) — Is tab active (Function) — Click handler Create a themed badge Parameters: (Document) — Document (string) — Badge text (string) — Color key from theme.colors.category or theme.colors.semantic Constants — InspectorTheme.js Unified theme system for all inspector panels Provides consistent colors, spacing, and styling across all inspector UI. <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


grabControllerTimingReport(distance, holdMs = 750)

startGrabCandidate(grabState, ecsWorld, entityId, distance, holdMs = 750)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: Hold to grab interaction for the engine's picking demo path. This controller intentionally suspends rigid body simulation while an entity follows a pick ray. Play mode force grabs remain owned by PhysicsGrab.js. Rotational handles, collision aware sweeps, constraints, and throw momentum remain explicit gaps rather than being approximated here. Functions Update a grabbed entity position along an admitted pick ray. Clear only grab state owned by a deleted entity. Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


resolvePickFovRadians(options = {}, camera = null, config = null)

getPickRayFromState(canvas, camera, clientX, clientY, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: RayPicking.js Unified, admitted camera and room/entity picking wrappers. Functions Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


pickRoomSurfaceFromRay(ray, options = {})

pickEntityFromRay(ray, ecsWorld, spawnedEntities, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Constants <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


screenPickInputReport(canvas, clientX, clientY, fovRadians = SCREENRAYLIMITS.defaultFovRadians)

getPickRayForCanvas(canvas, cameraState, clientX, clientY, options = {})


async transferSkinWeightsGPU(device, opts, limits = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes Method Signature Summary Functions <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


downloadScene(options, filename = "scene.json")

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Serialize spawned entities to JSON compatible object. Parameters: (Object) — Serialization options (Array) — Spawned entities array (Object) — ECS world (Object) — Physics state { enabled, baseGravity, gravityScale, staticFriction, dynamicFriction, restitution } (Object) — Render state { shaderMode, enableDiffuse, enableBounce, enableEmissive, enableSun, lightBrightness } Returns: Serialized scene data Export scene to JSON string. Parameters: (Object) — Serialization options Returns: JSON string Download scene as JSON file. Parameters: (Object) — Serialization options (string) — Download filename (default: "scene.json") Parse scene JSON data. Parameters: (string) — JSON string Returns: Parsed scene data or null on error Load scene from JSON and spawn entities. Parameters: (Object) — Load options (string) — JSON string (Function) — Function to spawn entity (Function) — Optional function to clear existing entities (Function) — Optional function to apply physics state (Function) — Optional function to apply render state (Function) — Optional logger Returns: Load result { entityCount, physics, render } Load scene from file input. Parameters: (File) — File object (Object) — Load options (spawnEntity, clearScene, logger) Returns: Number of entities loaded Create a file input for loading scenes. Parameters: (Object) — Load options Returns: File input element <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.


spawnPhysicsObjectAtPosition(ecsWorld, position, type = "cube", spawnerProps = null, logger = null,)


tools/spawn/SpawnManager.js
Functions
spawnEntity(options)
spawnParticleEmitter(options)
Notes & Examples

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Spawn a physics object with full render resource setup. Parameters: (Object) — Spawn options (Object) — ECS world (Array) — Spawn position [x, y, z] (string) — Object type (cube, sphere, etc.) (Object) — Optional spawner properties (Object) — GPU state with device (Object) — Render pipeline (Object) — Lights buffer (number) — Uniform buffer byte length (Object) — Mesh lookup { cubeMesh, sphereMesh, etc. } (Array) — Array to add spawned entity to (Map) — Map to store uniform buffer (Map) — Map to store bind group (Function) — Optional logger Returns: Spawn result or null Spawn a particle emitter at position. Parameters: (Object) — Spawn options (Array) — Spawn position (Object) — Spawner properties with color/scale (Object) — Particle state (Object) — Smoke state (for fluid sim trigger) (Function) — Callback for first emitter (starts fluid sim) (number) — Max emitters before removing old ones (default: 16) (Function) — Optional logger Returns: Created emitter or null <! HUMAN NOTES Notes & Examples No hand authored notes yet. Add page notes in or a reusable block in — see API Reference Standard.