API overview¶
HyperToken exposes game pieces, containers, and the Engine. The public package
entrypoint is core/index.ts (published as dist/core/index.js).
The root export surface currently includes:
Token, Stack, Space, Source, Chronicle, ConsensusCore, the typed
SyncTransport port and SyncPeerRef, Emitter, mulberry32,
shuffleArray, parseTokenSetObject, loadTokenSetJSON, and Engine.
Storage adapters and network classes are not re-exported by core/index.ts; use
their documented deep module paths.
The most common path is:
- Create the game document (
Chronicle). - Attach a deck (
Stack), board (Space), or combined draw pool (Source) to that same document. - Construct an
Enginewith those components. - Mutate through
await engine.dispatch(type, payload). - Observe
state:changedon the Chronicle orstate:updatedon the Engine.
All containers are views over one Automerge document. Tokens are immutable values. Concurrent changes merge using Automerge CRDT semantics; this is not transactional last-command-wins gameplay.
See Engine API, Token API, and the storage and network pages for operational integrations.