/** * Type-only cross-core compatibility shims. `WorldCompat` / `RoomCompat` / * `ICompatRuntime` widen `serverId` / `messageServerId` so the plugin * typechecks across core versions; there is no runtime proxy. */ import type { ChannelType, Entity, IAgentRuntime, Metadata, Room, UUID, World, } from "@elizaos/core"; export type WorldCompat = Omit & { serverId?: string; messageServerId?: UUID; }; export type RoomCompat = Omit & { serverId?: string; messageServerId?: UUID; }; export interface EnsureConnectionParams { entityId: UUID; roomId: UUID; roomName?: string; userName?: string; name?: string; worldName?: string; source?: string; channelId?: string; serverId?: string; messageServerId?: UUID; type?: ChannelType | string; worldId?: UUID; userId?: UUID; metadata?: Metadata; } export interface ICompatRuntime extends Omit< IAgentRuntime, | "ensureWorldExists" | "ensureRoomExists" | "ensureConnection" | "ensureConnections" > { ensureWorldExists(world: WorldCompat): Promise; ensureRoomExists(room: RoomCompat): Promise; ensureConnection(params: EnsureConnectionParams): Promise; ensureConnections( entities: Entity[], rooms: RoomCompat[], source: string, world: WorldCompat, ): Promise; }