Skip to content

Architecture

HyperToken separates the game pieces and document, action dispatch, and player interfaces. The source entry point is core/index.ts, published as dist/core/index.js; it re-exports the core primitives and Engine.

Area Source responsibility
core/ Game document (Chronicle), immutable tokens, containers, events, sync manager, and storage contracts.
engine/ Dispatch, actions, rules, policies, agents, game loop, history, persistence, fork/merge, and network coordination.
network/ WebSocket/WebRTC peer transports, relay and authoritative server implementations, and message encoding.
core/storage/ Memory, filesystem, and IndexedDB adapters.
core/browser/ esbuild browser bundling, shims, and Automerge WASM packaging.
ai/ Gym- and PettingZoo-style interfaces, ONNX inference, WebSocket bridge, and Python package.
mcp/ Blackjack and Cuttle game adapters for the stdio server in cli/commands/mcp.ts.
examples/ Seven games with terminal, browser, MCP, or RL entry points depending on the example.