import { d as PropSchema, jt as Node } from "./behavior-B_245qRy.js"; import { t as DiagnosticSink } from "./diagnostics-Cu85N3tL.js"; import { a as NetworkManagerOptions, c as LocalGameServer, d as ServerClass, f as createLocalGameServer, g as Unsubscribe, h as NetworkTransport, i as NetworkManager, l as LocalGameServerOptions, m as LoopbackTransport, n as SplitScreenPlayer, o as applySyncPatch, p as LoopbackHub, r as createSplitScreen, s as CollectionOptions, t as SplitScreenOptions, u as LocalGameServerTransport } from "./split-screen-CiLJf2-C.js"; //#region src/net/agent8.d.ts /** * The real transport: wraps `@agent8/gameserver`'s framework-free GameServer * class via a DEEP dynamic import (the package index re-exports React hooks * and zustand stores we must never pull in). The SDK is an optional peer dep — * games without multiplayer never load (or need) it. * * Adapter responsibilities beyond pass-through: * 1. allUserStates shape conversion: v2 delivers a fully delta-merged ARRAY of * `{...state, account, __updated}` (left users already removed from it). We * convert that to incanto's account-keyed Record, stripping the v2-internal * `account`/`__updated`/`__leaved` markers, and emit it as a full snapshot. * 2. collection shape conversion: v2 delivers `{items: [{__id, …}], changes}`; * we convert the merged `items` array to incanto's `__id`-keyed Record. * 3. Reconnect: the SDK clears pending subscriptions on disconnect and never * restores them — we re-issue every active subscription after reconnect. */ declare function createAgent8Server(config?: { verse?: string; account?: string; auth?: string; }, diagnostics?: DiagnosticSink | null): Promise; //#endregion //#region src/net/nodes/network-spawner.d.ts /** * Materializes a registered scene per remote player or collection entity: * * - `source: 'users'` — one instance per OTHER account in the room * (self is skipped; the local player is your own owned node) * - `source: 'collection:'` — one instance per entity (bullets, pickups…) * * Replicated flat `{sync: {...}}` patches apply onto each instance's root; * `position` lerps toward its target when `interpolate` is on. Emits * `spawned(node, key)` / `despawned(node, key)`. */ declare class NetworkSpawner extends Node { static override readonly typeName: string; static override readonly signals: readonly string[]; static readonly props: PropSchema; source: string; /** Key registered via `manager.registerScene(key, json)`. */ scene: string; interpolate: boolean; private readonly spawned; private readonly positionTargets; private readonly failedKeys; private readonly reported; /** Seconds spent looking for a NetworkManager — see the report in `update`. */ private waited; override update(dt: number): void; private currentEntries; /** * The replicated fields of one entry. * * A USER state carries them under `sync` (that is what the owner node sends). * A COLLECTION entity is written by your SERVER, which has no reason to know * that convention — `addCollectionItem('coins', { position: [x, y] })` is the * obvious thing to write, and it used to apply nothing at all. Both work: * `sync` when present, otherwise the entity minus the platform's own keys. */ private patchOf; /** Say it ONCE per message — a per-frame repeat would drown the log. */ private report; private setProp; /** * What the NETWORK last said this node's position is — not where it is drawn. * * A remote copy renders slightly in the past, chasing its target at * ~12.5%/frame. That is the right way to draw one and the wrong way to * COMPARE one: `incanto-multiplay`'s `agrees` rung read the rendered * position, so a late joiner whose interpolation had not converged was * reported as disagreeing with the owner — * * ✗ late has p1's `position` as [-3.3465…], not [-3.3989…] * * — on both SHIPPED 2D multiplayer examples, which exit 1 today on the plain * documented command. The size of the "disagreement" is the player's speed * times the chase lag, so a faster game fails harder while replicating * perfectly. * * `undefined` when this spawner has no target for that node: it is not one of * ours, or `interpolate` is off, in which case the drawn value IS the * received one. */ replicatedPosition(node: Node): number[] | undefined; private stepInterpolation; } //#endregion //#region src/net/register.d.ts /** * Register the networking node types (and the core nodes). Call once in your * game entry before loading a multiplayer scene. Explicit — never a side effect. */ declare function registerNodesNet(): void; //#endregion export { type CollectionOptions, LocalGameServer, type LocalGameServerOptions, LocalGameServerTransport, LoopbackHub, LoopbackTransport, NetworkManager, type NetworkManagerOptions, NetworkSpawner, type NetworkTransport, type ServerClass, type SplitScreenOptions, type SplitScreenPlayer, type Unsubscribe, applySyncPatch, createAgent8Server, createLocalGameServer, createSplitScreen, registerNodesNet };