/** * CRDTCAELBridge — Paper #3 * * Wires @holoscript/crdt-spatial merge operations as first-class CAEL * interaction events, committing every remote merge to the hash-chained * provenance trace. * * This fulfils the Interaction Truth layer requirement: CRDT convergence * is a reproducible intervention (a remote peer's state arriving) that * must be recorded alongside simulation steps, not outside them. * * Supported merge sources: * – SpatialCRDTBridge.importUpdate() → 'cael.crdt_merge/spatial' * – WorldState.import() / .merge() → 'cael.crdt_merge/world_state' * * Usage: * ```ts * const bridge = new CRDTCAELBridge({ spatial, world, recorder }); * bridge.mergeSpatial(remoteBytes, 'peer-42'); // merge + log * bridge.mergeWorld(remoteSnapshot, 'peer-42'); // merge + log * ``` */ import type { SpatialCRDTBridge } from '@holoscript/crdt-spatial'; import type { WorldState } from '@holoscript/crdt-spatial'; import type { CAELRecorder } from './CAELRecorder.js'; export interface CRDTCAELBridgeConfig { /** The SpatialCRDTBridge to intercept spatial merges on. */ spatial?: SpatialCRDTBridge; /** The WorldState to intercept world-state merges on. */ world?: WorldState; /** Recorder to commit merge events to the CAEL trace. */ recorder: CAELRecorder; /** * Local peer identifier stamped on every merge entry. * Defaults to 'local'. */ localPeerId?: string; } /** * CRDTCAELBridge intercepts CRDT merge operations and records them as * `cael.crdt_merge` interaction events in the CAEL hash-chain trace. * * This makes every remote state convergence a provenance-tracked, * replayable event — identical semantics to simulation steps and * physical agent actions. */ export declare class CRDTCAELBridge { private readonly spatial; private readonly world; private readonly recorder; readonly localPeerId: string; constructor(config: CRDTCAELBridgeConfig); /** * Merge a remote spatial update into the SpatialCRDTBridge and log * a `cael.crdt_merge/spatial` interaction event. * * @param bytes Raw Loro update bytes from a remote peer. * @param fromPeer Peer ID that produced the update. * @param extra Optional additional metadata to attach to the event. */ mergeSpatial(bytes: Uint8Array, fromPeer: string, extra?: Record): void; /** * Merge a remote WorldState snapshot/update into the local WorldState * and log a `cael.crdt_merge/world_state` interaction event. * * Accepts either raw Loro snapshot bytes or another WorldState instance. * * @param remote Raw Loro bytes OR a remote WorldState instance. * @param fromPeer Peer ID that produced the update. * @param extra Optional additional metadata to attach to the event. */ mergeWorld(remote: Uint8Array | WorldState, fromPeer: string, extra?: Record): void; } //# sourceMappingURL=CRDTCAELBridge.d.ts.map