/** * Engine wire registry — the client mirror of the server's * `crowdy-game-kit-core::wire` (the single source of truth for the actor * pose layout and flag-bit registry used by compute-module game engines). * Parity with the Rust crate is checked by the kit unit suite: any change * here must land in kit-core first. * * 48-byte little-endian pose: pos f32 x3 (0..11), yaw/pitch f32 (12..19), * velocity f32 x3 (20..31), flags u8 (32), held u8 (33), 34-35 reserved, * updated_at f64 ms (36..43), 44-47 reserved. Payloads may append opaque * UTF-8 suffix bytes (engines put the entity's container id there). */ import type { StateCodec } from '../stores/codec.js'; export declare const POSE_BYTES = 48; /** Flag-bit registry. Bits 0-3 are platform-reserved; games may use 4-7. */ export declare const FLAG_GROUNDED = 1; export declare const FLAG_MOB = 2; export declare const FLAG_NPC = 4; export declare const FLAG_RESERVED3 = 8; /** The decoded engine pose (plus the payload suffix, when present). */ export interface EnginePose { x: number; y: number; z: number; yaw: number; pitch: number; velX: number; velY: number; velZ: number; flags: number; held: number; updatedAtMs: number; /** UTF-8 payload suffix after the 48-byte pose (container id), if any. */ suffix: string | null; } /** Encode a pose (suffix appended when set). */ export declare function encodeEnginePose(pose: Partial): Uint8Array; /** * Decode the leading 48 bytes (tolerates longer payloads — the suffix is * extracted). Returns null for short or non-finite payloads. */ export declare function decodeEnginePose(bytes: Uint8Array): EnginePose | null; /** The UTF-8 suffix after the pose (engine container ids), if any. */ export declare function poseSuffix(bytes: Uint8Array): string | null; /** * A {@link StateCodec} for engine poses over the base64 wire form — plug it * into `attachRemoteActors` / `createWorldSession` actor config. Undecodable * payloads yield a zeroed pose with `flags: 0` (they land in the players * lane predicate's care, same as unknown custom states). */ export declare const enginePoseCodec: StateCodec; /** * Ready-made lane predicates for `createWorldSession` when the world runs * compute-module engines: `players` (no engine flag), `mobs` (FLAG_MOB) and * `npcs` (FLAG_NPC) — what Blocks with Friends hand-wired in its Phase 9 * adoption. Spread extra lanes on top as needed. */ export declare function engineLanes(): Record boolean>; /** Contact damage decided by a mob/combat engine (kit-play referee). */ export declare const EVENT_CONTACT_DAMAGE = 77; /** Weather/season transition from a world engine (kit-sim weather). */ export declare const EVENT_WEATHER = 90; /** Turn changed (kit-play turns; match engines). */ export declare const EVENT_TURN = 91; /** Score / match summary (kit-play score). */ export declare const EVENT_SCORE = 92; /** Match proposal (matchmaking → matches handoff). */ export declare const EVENT_PROPOSAL = 93; /** Ability cast/impact (kit-play abilities). */ export declare const EVENT_ABILITY = 94; /** Movement-envelope violation (movement-warden, observe/flag). */ export declare const EVENT_MOVEMENT_VIOLATION = 95; /** Control-point state change (territory). */ export declare const EVENT_CONTROL_POINT = 96; /** Race timing: checkpoint/lap/finish (kit-play timing). */ export declare const EVENT_RACE_TIMING = 97; /** Zone change: shrinking circles, event areas (kit-sim zones). */ export declare const EVENT_ZONE_CHANGE = 98; /** Split an engine server-event payload into its type + JSON body. */ export declare function parseEngineEvent(bytes: Uint8Array): { eventType: number; body: Record; } | null; /** A parsed type-77 contact-damage event. */ export interface ContactDamageEvent { targetUuid: string; damage: number; mobId: string; mobName: string; } /** Parse a contact-damage event; null when the payload is another type. */ export declare function parseContactDamage(bytes: Uint8Array): ContactDamageEvent | null; /** A parsed type-90 weather transition event. */ export interface WeatherEvent { weather: string; sinceMs: number; untilMs: number; /** Extra fields engines add (dayPhase, isNight, remainingMs, ...). */ body: Record; } /** Parse a weather event; null when the payload is another type. */ export declare function parseWeatherEvent(bytes: Uint8Array): WeatherEvent | null; /** A parsed type-91 turn-changed event (match engines). */ export interface TurnEvent { actorId: string; round: number; turnInRound: number; body: Record; } /** Parse a turn event; null when the payload is another type. */ export declare function parseTurnEvent(bytes: Uint8Array): TurnEvent | null; /** A parsed type-92 score/summary event (match engines). */ export interface ScoreEvent { /** Per-actor standings when present. */ standings: Array<{ actorId: string; score: number; rank: number; }>; winnerId: string | null; body: Record; } /** Parse a score event; null when the payload is another type. */ export declare function parseScoreEvent(bytes: Uint8Array): ScoreEvent | null; /** A parsed type-93 match-proposal event (matchmaking handoff). */ export interface ProposalEvent { proposalId: string; mode: string; players: string[]; body: Record; } /** Parse a proposal event; null when the payload is another type. */ export declare function parseProposalEvent(bytes: Uint8Array): ProposalEvent | null; /** A parsed type-94 ability cast/impact event. */ export interface AbilityEvent { /** `'cast'` or `'impact'`. */ kind: string; abilityId: string; casterId: string; victimId: string | null; damage: number; body: Record; } /** Parse an ability event; null when the payload is another type. */ export declare function parseAbilityEvent(bytes: Uint8Array): AbilityEvent | null; /** A parsed type-95 movement-violation event (observe/flag posture). */ export interface MovementViolationEvent { /** `'speed'`, `'teleport'`, or `'bounds'`. */ kind: string; userId: string; detail: string; body: Record; } /** Parse a movement-violation event; null when the payload is another type. */ export declare function parseMovementViolation(bytes: Uint8Array): MovementViolationEvent | null; /** A parsed type-96 control-point state event (territory flips). */ export interface ControlPointEvent { pointId: string; owner: string; previousOwner: string; body: Record; } /** Parse a control-point event; null when the payload is another type. */ export declare function parseControlPointEvent(bytes: Uint8Array): ControlPointEvent | null; /** A parsed type-97 race-timing event (checkpoint/lap/finish). */ export interface RaceTimingEvent { /** `'started'`, `'checkpoint'`, `'lap'`, or `'finished'`. */ kind: string; courseId: string; userId: string; body: Record; } /** Parse a race-timing event; null when the payload is another type. */ export declare function parseRaceTimingEvent(bytes: Uint8Array): RaceTimingEvent | null; //# sourceMappingURL=wire.d.ts.map