Tessera Engine
The heart of Tessera. Compiles each module's TypeScript to JVM bytecode (via TesseraCompiler), invokes its main() entry point, and dispatches triggers by invoking the named exported function through a cached MethodHandle. No V8, no JNI on the dispatch path.
Minecraft-free on purpose, so the whole pipeline can be exercised from a plain JVM test.
Properties
Receives every console line (chat, Tessera.log, errors). The console window registers here.
Invoked (on the JS/render thread) after modules load or reload, so the client can re-register script commands with brigadier (commands from post-startup loads are otherwise "unknown").
Callbacks run on reload/shutdown so MC-side state (e.g. HUD displays) can be cleared.
Class loader scripts compile against (so import { ChatLib } from 'ratph6.tessera.api' resolves).
Functions
Dispatch from any thread (e.g. a mixin on the netty/packet thread): marshalled onto the JS thread, so it's observe-only (the originating call has already proceeded — no inline cancel). Cheaply skips work when no script listens for type, so high-volume sources (packets) are free until something registers.
Run a client command registered by a script (by name), passing the raw args array.
Run a one-off TypeScript snippet (used by /te eval) on GraalJS, so it gets real ECMAScript (arrays, closures, let, JSON). The Tessera API objects (Tessera, Event, ChatLib, ...) are bound as globals by GraalRuntime, so no import line is needed.
Invoke a TS-mixin callback (called from MixinHooks on whatever thread the target method runs).
Root directory holding every module's folder (.minecraft/tessera/modules), or null pre-boot.
A snapshot of recent console lines (for replay when the console opens).
Record a script error from a string detail (origin already known).
Record a script error from a Throwable, capturing the full cause chain and stack trace.