@air-jam/sdk 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/protocol.cjs CHANGED
@@ -67,6 +67,14 @@ var hostJoinAsChildSchema = zod.z.object({
67
67
  roomId: roomCodeSchema,
68
68
  joinToken: zod.z.string()
69
69
  });
70
+ var hostCreateRoomSchema = zod.z.object({
71
+ maxPlayers: zod.z.number().int().min(1).max(16).default(8),
72
+ apiKey: zod.z.string().optional()
73
+ });
74
+ var hostReconnectSchema = zod.z.object({
75
+ roomId: roomCodeSchema,
76
+ apiKey: zod.z.string().optional()
77
+ });
70
78
  var AIRJAM_PROXY_PREFIX = "AIRJAM_";
71
79
 
72
80
  exports.AIRJAM_PROXY_PREFIX = AIRJAM_PROXY_PREFIX;
@@ -76,7 +84,9 @@ exports.controllerJoinSchema = controllerJoinSchema;
76
84
  exports.controllerLeaveSchema = controllerLeaveSchema;
77
85
  exports.controllerStateSchema = controllerStateSchema;
78
86
  exports.controllerSystemSchema = controllerSystemSchema;
87
+ exports.hostCreateRoomSchema = hostCreateRoomSchema;
79
88
  exports.hostJoinAsChildSchema = hostJoinAsChildSchema;
89
+ exports.hostReconnectSchema = hostReconnectSchema;
80
90
  exports.hostRegisterSystemSchema = hostRegisterSystemSchema;
81
91
  exports.hostRegistrationSchema = hostRegistrationSchema;
82
92
  exports.roomCodeSchema = roomCodeSchema;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/protocol.ts"],"names":["z","ErrorCode"],"mappings":";;;;;AAiBO,IAAM,iBAAiBA,KAAA,CAC3B,MAAA,EAAO,CACP,IAAA,GACA,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,CAAC,CAAA,CACL,KAAA,CAAM,eAAe,EAAE,OAAA,EAAS,0CAA0C;AAEtE,IAAM,qBAAA,GAAwBA,MAAE,MAAA,CAAO;AAAA,EAC5C,MAAA,EAAQ,cAAA;AAAA,EACR,YAAA,E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AAA,CAAE,MAAA,EAAO,CAAE,QAAA;AACrB,CAAC;AAMM,IAAM,sBAAA,GAAyBA,MAAE,MAAA,CAAO;AAAA,EAC7C,MAAA,EAAQ,cAAA;AAAA,EACR,MAAA,EAAQA,MAAE,MAAA,EAAO;AAAA,EACjB,OAAA,EAASA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AACtB,CAAC;AAIM,IAAM,qBAAA,GAAwBA,MAAE,MAAA,CAAO;AAAA,EAC5C,MAAA,EAAQ,cAAA;AAAA,EACR,SAAA,EAAWA,MAAE,MAAA;AACf,CAAC;AA6GM,IAAM,mBAAA,GAAsB","file":"protocol.cjs","sourcesContent":["import { z } from \"zod\";\n\nexport type RoomCode = string;\n\nexport type ConnectionRole = \"host\" | \"controller\";\n\nexport type ConnectionStatus =\n | \"idle\"\n | \"connecting\"\n | \"connected\"\n | \"disconnected\"\n | \"reconnecting\";\n\nexport type RunMode = \"standalone\" | \"platform\";\n\nexport type GameState = \"paused\" | \"playing\";\n\nexport const roomCodeSchema = z\n .string()\n .trim()\n .min(4)\n .max(8)\n .regex(/^[A-Z0-9]+$/, { message: \"room code must contain only A-Z or 0-9\" });\n\nexport const controllerInputSchema = z.object({\n roomId: roomCodeSchema,\n controllerId: z.string().min(3),\n input: z.record(z.string(), z.unknown()), // Arbitrary JSON object - developers define their own structure\n});\n\nexport type ControllerInputPayload = Record<string, unknown>;\n\nexport interface ControllerInputEvent {\n roomId: RoomCode;\n controllerId: string;\n input: ControllerInputPayload;\n}\n\nexport const controllerStateSchema = z.object({\n roomId: roomCodeSchema,\n state: z.object({\n orientation: z.enum([\"portrait\", \"landscape\"]).optional(),\n message: z.string().optional(),\n gameState: z.enum([\"paused\", \"playing\"]).optional(),\n }),\n});\n\nexport type ControllerStateMessage = z.infer<typeof controllerStateSchema>;\n\nexport type ControllerStatePayload = z.infer<\n typeof controllerStateSchema\n>[\"state\"];\n\nexport const hostRegistrationSchema = z.object({\n roomId: roomCodeSchema,\n maxPlayers: z.number().int().min(1).max(16).default(8),\n apiKey: z.string().optional(),\n mode: z.enum([\"master\", \"child\"]).default(\"child\"),\n controllerUrl: z.string().url().optional(),\n});\n\nexport type HostRegistrationPayload = z.infer<typeof hostRegistrationSchema>;\n\nexport const controllerJoinSchema = z.object({\n roomId: roomCodeSchema,\n controllerId: z.string().min(3),\n nickname: z.string().trim().min(1).max(24).optional(),\n});\n\nexport type ControllerJoinPayload = z.infer<typeof controllerJoinSchema>;\n\nexport const controllerLeaveSchema = z.object({\n roomId: roomCodeSchema,\n controllerId: z.string().min(3),\n});\n\nexport type ControllerLeavePayload = z.infer<typeof controllerLeaveSchema>;\n\nexport interface PlayerProfile {\n id: string;\n label: string;\n color?: string;\n}\n\nexport interface HostRegistrationAck {\n ok: boolean;\n roomId?: RoomCode;\n message?: string;\n code?: ErrorCode | string;\n}\n\nexport interface ControllerJoinAck {\n ok: boolean;\n controllerId?: string;\n roomId?: RoomCode;\n message?: string;\n code?: ErrorCode | string;\n}\n\nexport const controllerSystemSchema = z.object({\n roomId: roomCodeSchema,\n command: z.enum([\"exit\", \"ready\", \"toggle_pause\"]),\n});\n\nexport type ControllerSystemPayload = z.infer<typeof controllerSystemSchema>;\n\n/**\n * Standard error codes for Air Jam\n */\nexport enum ErrorCode {\n // Room errors\n ROOM_NOT_FOUND = \"ROOM_NOT_FOUND\",\n ROOM_FULL = \"ROOM_FULL\",\n\n // Auth errors\n INVALID_API_KEY = \"INVALID_API_KEY\",\n UNAUTHORIZED = \"UNAUTHORIZED\",\n\n // Token errors\n INVALID_TOKEN = \"INVALID_TOKEN\",\n TOKEN_EXPIRED = \"TOKEN_EXPIRED\",\n\n // Connection errors\n CONNECTION_FAILED = \"CONNECTION_FAILED\",\n ALREADY_CONNECTED = \"ALREADY_CONNECTED\",\n\n // Validation errors\n INVALID_PAYLOAD = \"INVALID_PAYLOAD\",\n INVALID_ROOM_CODE = \"INVALID_ROOM_CODE\",\n\n // Server errors\n INTERNAL_SERVER_ERROR = \"INTERNAL_SERVER_ERROR\",\n SERVICE_UNAVAILABLE = \"SERVICE_UNAVAILABLE\",\n\n // Generic\n UNKNOWN_ERROR = \"UNKNOWN_ERROR\",\n}\n\n/**\n * Standardized error payload\n */\nexport interface ServerErrorPayload {\n code: ErrorCode | string; // Allow custom codes\n message: string;\n details?: unknown;\n}\n\nexport interface ControllerWelcomePayload {\n controllerId: string;\n roomId: RoomCode;\n player?: PlayerProfile;\n}\n\nexport interface ControllerJoinedNotice {\n controllerId: string;\n nickname?: string;\n player?: PlayerProfile;\n}\n\nexport interface ControllerLeftNotice {\n controllerId: string;\n}\n\nexport interface RoomReadyNotice {\n roomId: RoomCode;\n}\n\nexport interface HostLeftNotice {\n roomId: RoomCode;\n reason: string;\n}\n\nexport type SignalType = \"HAPTIC\" | \"TOAST\";\n\nexport interface HapticSignalPayload {\n pattern: \"light\" | \"medium\" | \"heavy\" | \"success\" | \"failure\" | \"custom\";\n sequence?: number | number[];\n}\n\nexport interface ToastSignalPayload {\n message: string;\n color?: string;\n duration?: number;\n}\n\nexport type SignalPayload =\n | {\n targetId?: string;\n type: \"HAPTIC\";\n payload: HapticSignalPayload;\n }\n | {\n targetId?: string;\n type: \"TOAST\";\n payload: ToastSignalPayload;\n };\n\nexport interface PlaySoundEventPayload {\n roomId: string;\n targetControllerId?: string; // If null, broadcast to all\n soundId: string;\n volume?: number;\n loop?: boolean;\n}\n\nexport const hostRegisterSystemSchema = z.object({\n roomId: roomCodeSchema,\n apiKey: z.string().optional(),\n});\n\nexport type HostRegisterSystemPayload = z.infer<\n typeof hostRegisterSystemSchema\n>;\n\nexport const systemLaunchGameSchema = z.object({\n roomId: roomCodeSchema,\n gameId: z.string(),\n gameUrl: z.string().url(),\n});\n\nexport type SystemLaunchGamePayload = z.infer<typeof systemLaunchGameSchema>;\n\nexport const hostJoinAsChildSchema = z.object({\n roomId: roomCodeSchema,\n joinToken: z.string(),\n});\n\nexport type HostJoinAsChildPayload = z.infer<typeof hostJoinAsChildSchema>;\n\nexport interface SystemLaunchGameAck {\n ok: boolean;\n joinToken?: string;\n message?: string;\n code?: ErrorCode | string;\n}\n\nexport interface ClientLoadUiPayload {\n url: string;\n}\n\nexport interface HostStateSyncPayload {\n roomId: string;\n data: Record<string, unknown>;\n}\n\nexport interface ControllerActionRpcPayload {\n roomId: string;\n actionName: string;\n args: unknown[];\n controllerId: string;\n}\n\nexport interface AirJamStateSyncPayload {\n roomId: string;\n data: Record<string, unknown>;\n}\n\nexport interface AirJamActionRpcPayload {\n actionName: string;\n args: unknown[];\n controllerId: string;\n}\n\nexport interface ClientToServerEvents {\n \"host:register\": (\n payload: z.infer<typeof hostRegistrationSchema>,\n callback: (ack: HostRegistrationAck) => void,\n ) => void;\n \"host:registerSystem\": (\n payload: HostRegisterSystemPayload,\n callback: (ack: HostRegistrationAck) => void,\n ) => void;\n \"system:launchGame\": (\n payload: SystemLaunchGamePayload,\n callback: (ack: SystemLaunchGameAck) => void,\n ) => void;\n \"host:joinAsChild\": (\n payload: HostJoinAsChildPayload,\n callback: (ack: HostRegistrationAck) => void,\n ) => void;\n \"system:closeGame\": (payload: { roomId: string }) => void;\n \"host:state\": (payload: z.infer<typeof controllerStateSchema>) => void;\n \"controller:join\": (\n payload: z.infer<typeof controllerJoinSchema>,\n callback: (ack: ControllerJoinAck) => void,\n ) => void;\n \"controller:leave\": (payload: z.infer<typeof controllerLeaveSchema>) => void;\n \"controller:input\": (payload: z.infer<typeof controllerInputSchema>) => void;\n \"controller:system\": (\n payload: z.infer<typeof controllerSystemSchema>,\n ) => void;\n \"host:system\": (payload: z.infer<typeof controllerSystemSchema>) => void;\n \"host:signal\": (payload: SignalPayload) => void;\n \"host:play_sound\": (payload: PlaySoundEventPayload) => void;\n \"controller:play_sound\": (payload: PlaySoundEventPayload) => void;\n \"host:state_sync\": (payload: HostStateSyncPayload) => void;\n \"controller:action_rpc\": (payload: ControllerActionRpcPayload) => void;\n}\n\nexport interface PlaySoundPayload {\n id: string;\n volume?: number;\n loop?: boolean;\n}\n\nexport interface ServerToClientEvents {\n \"server:roomReady\": (payload: RoomReadyNotice) => void;\n \"server:controllerJoined\": (payload: ControllerJoinedNotice) => void;\n \"server:controllerLeft\": (payload: ControllerLeftNotice) => void;\n \"server:input\": (payload: ControllerInputEvent) => void;\n \"server:error\": (payload: ServerErrorPayload) => void;\n \"server:state\": (payload: z.infer<typeof controllerStateSchema>) => void;\n \"server:welcome\": (payload: ControllerWelcomePayload) => void;\n \"server:hostLeft\": (payload: HostLeftNotice) => void;\n \"server:signal\": (payload: SignalPayload) => void;\n \"server:playSound\": (payload: PlaySoundPayload) => void;\n \"server:redirect\": (url: string) => void;\n \"server:closeChild\": () => void;\n \"client:loadUi\": (payload: ClientLoadUiPayload) => void;\n \"client:unloadUi\": () => void;\n \"airjam:state_sync\": (payload: AirJamStateSyncPayload) => void;\n \"airjam:action_rpc\": (payload: AirJamActionRpcPayload) => void;\n}\n\nexport interface InterServerEvents {\n ping: () => void;\n}\n\nexport type SocketData = Record<string, unknown>;\n\n// --- Proxy Protocol (iframe <-> parent) ---\n// Note: Proxy protocol is largely deprecated in favor of Direct Connect (airjam_force_connect=true),\n// but might still be used for UI coordination (e.g. hiding headers).\n\nexport const AIRJAM_PROXY_PREFIX = \"AIRJAM_\";\n\nexport interface ProxyMessageBase {\n type: string;\n}\n\nexport interface ProxyReadyMessage extends ProxyMessageBase {\n type: \"AIRJAM_READY\";\n}\n\nexport interface ProxyInputMessage extends ProxyMessageBase {\n type: \"AIRJAM_INPUT\";\n payload: ControllerInputPayload;\n}\n\nexport interface ProxyStateMessage extends ProxyMessageBase {\n type: \"AIRJAM_STATE\";\n payload: ControllerStatePayload;\n}\n\nexport type AirJamProxyMessage =\n | ProxyReadyMessage\n | ProxyInputMessage\n | ProxyStateMessage;\n"]}
1
+ {"version":3,"sources":["../src/protocol.ts"],"names":["z","ErrorCode"],"mappings":";;;;;AAiBO,IAAM,iBAAiBA,KAAA,CAC3B,MAAA,EAAO,CACP,IAAA,GACA,G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AAA,eAAA,CAAA,GAAgB,eAAA;AA1BN,EAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA;AAgGL,IAAM,wBAAA,GAA2BD,MAAE,MAAA,CAAO;AAAA,EAC/C,MAAA,EAAQ,cAAA;AAAA,EACR,MAAA,EAAQA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AACrB,CAAC;AAMM,IAAM,sBAAA,GAAyBA,MAAE,MAAA,CAAO;AAAA,EAC7C,MAAA,EAAQ,cAAA;AAAA,EACR,MAAA,EAAQA,MAAE,MAAA,EAAO;AAAA,EACjB,OAAA,EAASA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AACtB,CAAC;AAIM,IAAM,qBAAA,GAAwBA,MAAE,MAAA,CAAO;AAAA,EAC5C,MAAA,EAAQ,cAAA;AAAA,EACR,SAAA,EAAWA,MAAE,MAAA;AACf,CAAC;AAOM,IAAM,oBAAA,GAAuBA,MAAE,MAAA,CAAO;AAAA,EAC3C,UAAA,EAAYA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,EAAE,CAAA,CAAE,QAAQ,CAAC,CAAA;AAAA,EACrD,MAAA,EAAQA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AACrB,CAAC;AAOM,IAAM,mBAAA,GAAsBA,MAAE,MAAA,CAAO;AAAA,EAC1C,MAAA,EAAQ,cAAA;AAAA,EACR,MAAA,EAAQA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AACrB,CAAC;AAqHM,IAAM,mBAAA,GAAsB","file":"protocol.cjs","sourcesContent":["import { z } from \"zod\";\n\nexport type RoomCode = string;\n\nexport type ConnectionRole = \"host\" | \"controller\";\n\nexport type ConnectionStatus =\n | \"idle\"\n | \"connecting\"\n | \"connected\"\n | \"disconnected\"\n | \"reconnecting\";\n\nexport type RunMode = \"standalone\" | \"platform\";\n\nexport type GameState = \"paused\" | \"playing\";\n\nexport const roomCodeSchema = z\n .string()\n .trim()\n .min(4)\n .max(8)\n .regex(/^[A-Z0-9]+$/, { message: \"room code must contain only A-Z or 0-9\" });\n\nexport const controllerInputSchema = z.object({\n roomId: roomCodeSchema,\n controllerId: z.string().min(3),\n input: z.record(z.string(), z.unknown()), // Arbitrary JSON object - developers define their own structure\n});\n\nexport type ControllerInputPayload = Record<string, unknown>;\n\nexport interface ControllerInputEvent {\n roomId: RoomCode;\n controllerId: string;\n input: ControllerInputPayload;\n}\n\nexport const controllerStateSchema = z.object({\n roomId: roomCodeSchema,\n state: z.object({\n orientation: z.enum([\"portrait\", \"landscape\"]).optional(),\n message: z.string().optional(),\n gameState: z.enum([\"paused\", \"playing\"]).optional(),\n }),\n});\n\nexport type ControllerStateMessage = z.infer<typeof controllerStateSchema>;\n\nexport type ControllerStatePayload = z.infer<\n typeof controllerStateSchema\n>[\"state\"];\n\nexport const hostRegistrationSchema = z.object({\n roomId: roomCodeSchema,\n maxPlayers: z.number().int().min(1).max(16).default(8),\n apiKey: z.string().optional(),\n mode: z.enum([\"master\", \"child\"]).default(\"child\"),\n controllerUrl: z.string().url().optional(),\n});\n\nexport type HostRegistrationPayload = z.infer<typeof hostRegistrationSchema>;\n\nexport const controllerJoinSchema = z.object({\n roomId: roomCodeSchema,\n controllerId: z.string().min(3),\n nickname: z.string().trim().min(1).max(24).optional(),\n});\n\nexport type ControllerJoinPayload = z.infer<typeof controllerJoinSchema>;\n\nexport const controllerLeaveSchema = z.object({\n roomId: roomCodeSchema,\n controllerId: z.string().min(3),\n});\n\nexport type ControllerLeavePayload = z.infer<typeof controllerLeaveSchema>;\n\nexport interface PlayerProfile {\n id: string;\n label: string;\n color?: string;\n}\n\nexport interface HostRegistrationAck {\n ok: boolean;\n roomId?: RoomCode;\n message?: string;\n code?: ErrorCode | string;\n}\n\nexport interface ControllerJoinAck {\n ok: boolean;\n controllerId?: string;\n roomId?: RoomCode;\n message?: string;\n code?: ErrorCode | string;\n}\n\nexport const controllerSystemSchema = z.object({\n roomId: roomCodeSchema,\n command: z.enum([\"exit\", \"ready\", \"toggle_pause\"]),\n});\n\nexport type ControllerSystemPayload = z.infer<typeof controllerSystemSchema>;\n\n/**\n * Standard error codes for Air Jam\n */\nexport enum ErrorCode {\n // Room errors\n ROOM_NOT_FOUND = \"ROOM_NOT_FOUND\",\n ROOM_FULL = \"ROOM_FULL\",\n\n // Auth errors\n INVALID_API_KEY = \"INVALID_API_KEY\",\n UNAUTHORIZED = \"UNAUTHORIZED\",\n\n // Token errors\n INVALID_TOKEN = \"INVALID_TOKEN\",\n TOKEN_EXPIRED = \"TOKEN_EXPIRED\",\n\n // Connection errors\n CONNECTION_FAILED = \"CONNECTION_FAILED\",\n ALREADY_CONNECTED = \"ALREADY_CONNECTED\",\n\n // Validation errors\n INVALID_PAYLOAD = \"INVALID_PAYLOAD\",\n INVALID_ROOM_CODE = \"INVALID_ROOM_CODE\",\n\n // Server errors\n INTERNAL_SERVER_ERROR = \"INTERNAL_SERVER_ERROR\",\n SERVICE_UNAVAILABLE = \"SERVICE_UNAVAILABLE\",\n\n // Generic\n UNKNOWN_ERROR = \"UNKNOWN_ERROR\",\n}\n\n/**\n * Standardized error payload\n */\nexport interface ServerErrorPayload {\n code: ErrorCode | string; // Allow custom codes\n message: string;\n details?: unknown;\n}\n\nexport interface ControllerWelcomePayload {\n controllerId: string;\n roomId: RoomCode;\n player?: PlayerProfile;\n}\n\nexport interface ControllerJoinedNotice {\n controllerId: string;\n nickname?: string;\n player?: PlayerProfile;\n}\n\nexport interface ControllerLeftNotice {\n controllerId: string;\n}\n\nexport interface RoomReadyNotice {\n roomId: RoomCode;\n}\n\nexport interface HostLeftNotice {\n roomId: RoomCode;\n reason: string;\n}\n\nexport type SignalType = \"HAPTIC\" | \"TOAST\";\n\nexport interface HapticSignalPayload {\n pattern: \"light\" | \"medium\" | \"heavy\" | \"success\" | \"failure\" | \"custom\";\n sequence?: number | number[];\n}\n\nexport interface ToastSignalPayload {\n message: string;\n color?: string;\n duration?: number;\n}\n\nexport type SignalPayload =\n | {\n targetId?: string;\n type: \"HAPTIC\";\n payload: HapticSignalPayload;\n }\n | {\n targetId?: string;\n type: \"TOAST\";\n payload: ToastSignalPayload;\n };\n\nexport interface PlaySoundEventPayload {\n roomId: string;\n targetControllerId?: string; // If null, broadcast to all\n soundId: string;\n volume?: number;\n loop?: boolean;\n}\n\nexport const hostRegisterSystemSchema = z.object({\n roomId: roomCodeSchema,\n apiKey: z.string().optional(),\n});\n\nexport type HostRegisterSystemPayload = z.infer<\n typeof hostRegisterSystemSchema\n>;\n\nexport const systemLaunchGameSchema = z.object({\n roomId: roomCodeSchema,\n gameId: z.string(),\n gameUrl: z.string().url(),\n});\n\nexport type SystemLaunchGamePayload = z.infer<typeof systemLaunchGameSchema>;\n\nexport const hostJoinAsChildSchema = z.object({\n roomId: roomCodeSchema,\n joinToken: z.string(),\n});\n\nexport type HostJoinAsChildPayload = z.infer<typeof hostJoinAsChildSchema>;\n\n/**\n * Schema for creating a new room (server-issued room ID)\n */\nexport const hostCreateRoomSchema = z.object({\n maxPlayers: z.number().int().min(1).max(16).default(8),\n apiKey: z.string().optional(),\n});\n\nexport type HostCreateRoomPayload = z.infer<typeof hostCreateRoomSchema>;\n\n/**\n * Schema for reconnecting to an existing room\n */\nexport const hostReconnectSchema = z.object({\n roomId: roomCodeSchema,\n apiKey: z.string().optional(),\n});\n\nexport type HostReconnectPayload = z.infer<typeof hostReconnectSchema>;\n\nexport interface SystemLaunchGameAck {\n ok: boolean;\n joinToken?: string;\n message?: string;\n code?: ErrorCode | string;\n}\n\nexport interface ClientLoadUiPayload {\n url: string;\n}\n\nexport interface HostStateSyncPayload {\n roomId: string;\n data: Record<string, unknown>;\n}\n\nexport interface ControllerActionRpcPayload {\n roomId: string;\n actionName: string;\n args: unknown[];\n controllerId: string;\n}\n\nexport interface AirJamStateSyncPayload {\n roomId: string;\n data: Record<string, unknown>;\n}\n\nexport interface AirJamActionRpcPayload {\n actionName: string;\n args: unknown[];\n controllerId: string;\n}\n\nexport interface ClientToServerEvents {\n \"host:register\": (\n payload: z.infer<typeof hostRegistrationSchema>,\n callback: (ack: HostRegistrationAck) => void,\n ) => void;\n \"host:registerSystem\": (\n payload: HostRegisterSystemPayload,\n callback: (ack: HostRegistrationAck) => void,\n ) => void;\n \"host:createRoom\": (\n payload: HostCreateRoomPayload,\n callback: (ack: HostRegistrationAck) => void,\n ) => void;\n \"host:reconnect\": (\n payload: HostReconnectPayload,\n callback: (ack: HostRegistrationAck) => void,\n ) => void;\n \"system:launchGame\": (\n payload: SystemLaunchGamePayload,\n callback: (ack: SystemLaunchGameAck) => void,\n ) => void;\n \"host:joinAsChild\": (\n payload: HostJoinAsChildPayload,\n callback: (ack: HostRegistrationAck) => void,\n ) => void;\n \"system:closeGame\": (payload: { roomId: string }) => void;\n \"host:state\": (payload: z.infer<typeof controllerStateSchema>) => void;\n \"controller:join\": (\n payload: z.infer<typeof controllerJoinSchema>,\n callback: (ack: ControllerJoinAck) => void,\n ) => void;\n \"controller:leave\": (payload: z.infer<typeof controllerLeaveSchema>) => void;\n \"controller:input\": (payload: z.infer<typeof controllerInputSchema>) => void;\n \"controller:system\": (\n payload: z.infer<typeof controllerSystemSchema>,\n ) => void;\n \"host:system\": (payload: z.infer<typeof controllerSystemSchema>) => void;\n \"host:signal\": (payload: SignalPayload) => void;\n \"host:play_sound\": (payload: PlaySoundEventPayload) => void;\n \"controller:play_sound\": (payload: PlaySoundEventPayload) => void;\n \"host:state_sync\": (payload: HostStateSyncPayload) => void;\n \"controller:action_rpc\": (payload: ControllerActionRpcPayload) => void;\n}\n\nexport interface PlaySoundPayload {\n id: string;\n volume?: number;\n loop?: boolean;\n}\n\nexport interface ServerToClientEvents {\n \"server:roomReady\": (payload: RoomReadyNotice) => void;\n \"server:controllerJoined\": (payload: ControllerJoinedNotice) => void;\n \"server:controllerLeft\": (payload: ControllerLeftNotice) => void;\n \"server:input\": (payload: ControllerInputEvent) => void;\n \"server:error\": (payload: ServerErrorPayload) => void;\n \"server:state\": (payload: z.infer<typeof controllerStateSchema>) => void;\n \"server:welcome\": (payload: ControllerWelcomePayload) => void;\n \"server:hostLeft\": (payload: HostLeftNotice) => void;\n \"server:signal\": (payload: SignalPayload) => void;\n \"server:playSound\": (payload: PlaySoundPayload) => void;\n \"server:redirect\": (url: string) => void;\n \"server:closeChild\": () => void;\n \"client:loadUi\": (payload: ClientLoadUiPayload) => void;\n \"client:unloadUi\": () => void;\n \"airjam:state_sync\": (payload: AirJamStateSyncPayload) => void;\n \"airjam:action_rpc\": (payload: AirJamActionRpcPayload) => void;\n}\n\nexport interface InterServerEvents {\n ping: () => void;\n}\n\nexport type SocketData = Record<string, unknown>;\n\n// --- Proxy Protocol (iframe <-> parent) ---\n// Note: Proxy protocol is largely deprecated in favor of Direct Connect (airjam_force_connect=true),\n// but might still be used for UI coordination (e.g. hiding headers).\n\nexport const AIRJAM_PROXY_PREFIX = \"AIRJAM_\";\n\nexport interface ProxyMessageBase {\n type: string;\n}\n\nexport interface ProxyReadyMessage extends ProxyMessageBase {\n type: \"AIRJAM_READY\";\n}\n\nexport interface ProxyInputMessage extends ProxyMessageBase {\n type: \"AIRJAM_INPUT\";\n payload: ControllerInputPayload;\n}\n\nexport interface ProxyStateMessage extends ProxyMessageBase {\n type: \"AIRJAM_STATE\";\n payload: ControllerStatePayload;\n}\n\nexport type AirJamProxyMessage =\n | ProxyReadyMessage\n | ProxyInputMessage\n | ProxyStateMessage;\n"]}
@@ -170,6 +170,22 @@ declare const hostJoinAsChildSchema: z.ZodObject<{
170
170
  joinToken: z.ZodString;
171
171
  }, z.core.$strip>;
172
172
  type HostJoinAsChildPayload = z.infer<typeof hostJoinAsChildSchema>;
173
+ /**
174
+ * Schema for creating a new room (server-issued room ID)
175
+ */
176
+ declare const hostCreateRoomSchema: z.ZodObject<{
177
+ maxPlayers: z.ZodDefault<z.ZodNumber>;
178
+ apiKey: z.ZodOptional<z.ZodString>;
179
+ }, z.core.$strip>;
180
+ type HostCreateRoomPayload = z.infer<typeof hostCreateRoomSchema>;
181
+ /**
182
+ * Schema for reconnecting to an existing room
183
+ */
184
+ declare const hostReconnectSchema: z.ZodObject<{
185
+ roomId: z.ZodString;
186
+ apiKey: z.ZodOptional<z.ZodString>;
187
+ }, z.core.$strip>;
188
+ type HostReconnectPayload = z.infer<typeof hostReconnectSchema>;
173
189
  interface SystemLaunchGameAck {
174
190
  ok: boolean;
175
191
  joinToken?: string;
@@ -201,6 +217,8 @@ interface AirJamActionRpcPayload {
201
217
  interface ClientToServerEvents {
202
218
  "host:register": (payload: z.infer<typeof hostRegistrationSchema>, callback: (ack: HostRegistrationAck) => void) => void;
203
219
  "host:registerSystem": (payload: HostRegisterSystemPayload, callback: (ack: HostRegistrationAck) => void) => void;
220
+ "host:createRoom": (payload: HostCreateRoomPayload, callback: (ack: HostRegistrationAck) => void) => void;
221
+ "host:reconnect": (payload: HostReconnectPayload, callback: (ack: HostRegistrationAck) => void) => void;
204
222
  "system:launchGame": (payload: SystemLaunchGamePayload, callback: (ack: SystemLaunchGameAck) => void) => void;
205
223
  "host:joinAsChild": (payload: HostJoinAsChildPayload, callback: (ack: HostRegistrationAck) => void) => void;
206
224
  "system:closeGame": (payload: {
@@ -262,4 +280,4 @@ interface ProxyStateMessage extends ProxyMessageBase {
262
280
  }
263
281
  type AirJamProxyMessage = ProxyReadyMessage | ProxyInputMessage | ProxyStateMessage;
264
282
 
265
- export { AIRJAM_PROXY_PREFIX, type AirJamActionRpcPayload, type AirJamProxyMessage, type AirJamStateSyncPayload, type ClientLoadUiPayload, type ClientToServerEvents, type ConnectionRole, type ConnectionStatus, type ControllerActionRpcPayload, type ControllerInputEvent, type ControllerInputPayload, type ControllerJoinAck, type ControllerJoinPayload, type ControllerJoinedNotice, type ControllerLeavePayload, type ControllerLeftNotice, type ControllerStateMessage, type ControllerStatePayload, type ControllerSystemPayload, type ControllerWelcomePayload, ErrorCode, type GameState, type HapticSignalPayload, type HostJoinAsChildPayload, type HostLeftNotice, type HostRegisterSystemPayload, type HostRegistrationAck, type HostRegistrationPayload, type HostStateSyncPayload, type InterServerEvents, type PlaySoundEventPayload, type PlaySoundPayload, type PlayerProfile, type ProxyInputMessage, type ProxyMessageBase, type ProxyReadyMessage, type ProxyStateMessage, type RoomCode, type RoomReadyNotice, type RunMode, type ServerErrorPayload, type ServerToClientEvents, type SignalPayload, type SignalType, type SocketData, type SystemLaunchGameAck, type SystemLaunchGamePayload, type ToastSignalPayload, controllerInputSchema, controllerJoinSchema, controllerLeaveSchema, controllerStateSchema, controllerSystemSchema, hostJoinAsChildSchema, hostRegisterSystemSchema, hostRegistrationSchema, roomCodeSchema, systemLaunchGameSchema };
283
+ export { AIRJAM_PROXY_PREFIX, type AirJamActionRpcPayload, type AirJamProxyMessage, type AirJamStateSyncPayload, type ClientLoadUiPayload, type ClientToServerEvents, type ConnectionRole, type ConnectionStatus, type ControllerActionRpcPayload, type ControllerInputEvent, type ControllerInputPayload, type ControllerJoinAck, type ControllerJoinPayload, type ControllerJoinedNotice, type ControllerLeavePayload, type ControllerLeftNotice, type ControllerStateMessage, type ControllerStatePayload, type ControllerSystemPayload, type ControllerWelcomePayload, ErrorCode, type GameState, type HapticSignalPayload, type HostCreateRoomPayload, type HostJoinAsChildPayload, type HostLeftNotice, type HostReconnectPayload, type HostRegisterSystemPayload, type HostRegistrationAck, type HostRegistrationPayload, type HostStateSyncPayload, type InterServerEvents, type PlaySoundEventPayload, type PlaySoundPayload, type PlayerProfile, type ProxyInputMessage, type ProxyMessageBase, type ProxyReadyMessage, type ProxyStateMessage, type RoomCode, type RoomReadyNotice, type RunMode, type ServerErrorPayload, type ServerToClientEvents, type SignalPayload, type SignalType, type SocketData, type SystemLaunchGameAck, type SystemLaunchGamePayload, type ToastSignalPayload, controllerInputSchema, controllerJoinSchema, controllerLeaveSchema, controllerStateSchema, controllerSystemSchema, hostCreateRoomSchema, hostJoinAsChildSchema, hostReconnectSchema, hostRegisterSystemSchema, hostRegistrationSchema, roomCodeSchema, systemLaunchGameSchema };
@@ -170,6 +170,22 @@ declare const hostJoinAsChildSchema: z.ZodObject<{
170
170
  joinToken: z.ZodString;
171
171
  }, z.core.$strip>;
172
172
  type HostJoinAsChildPayload = z.infer<typeof hostJoinAsChildSchema>;
173
+ /**
174
+ * Schema for creating a new room (server-issued room ID)
175
+ */
176
+ declare const hostCreateRoomSchema: z.ZodObject<{
177
+ maxPlayers: z.ZodDefault<z.ZodNumber>;
178
+ apiKey: z.ZodOptional<z.ZodString>;
179
+ }, z.core.$strip>;
180
+ type HostCreateRoomPayload = z.infer<typeof hostCreateRoomSchema>;
181
+ /**
182
+ * Schema for reconnecting to an existing room
183
+ */
184
+ declare const hostReconnectSchema: z.ZodObject<{
185
+ roomId: z.ZodString;
186
+ apiKey: z.ZodOptional<z.ZodString>;
187
+ }, z.core.$strip>;
188
+ type HostReconnectPayload = z.infer<typeof hostReconnectSchema>;
173
189
  interface SystemLaunchGameAck {
174
190
  ok: boolean;
175
191
  joinToken?: string;
@@ -201,6 +217,8 @@ interface AirJamActionRpcPayload {
201
217
  interface ClientToServerEvents {
202
218
  "host:register": (payload: z.infer<typeof hostRegistrationSchema>, callback: (ack: HostRegistrationAck) => void) => void;
203
219
  "host:registerSystem": (payload: HostRegisterSystemPayload, callback: (ack: HostRegistrationAck) => void) => void;
220
+ "host:createRoom": (payload: HostCreateRoomPayload, callback: (ack: HostRegistrationAck) => void) => void;
221
+ "host:reconnect": (payload: HostReconnectPayload, callback: (ack: HostRegistrationAck) => void) => void;
204
222
  "system:launchGame": (payload: SystemLaunchGamePayload, callback: (ack: SystemLaunchGameAck) => void) => void;
205
223
  "host:joinAsChild": (payload: HostJoinAsChildPayload, callback: (ack: HostRegistrationAck) => void) => void;
206
224
  "system:closeGame": (payload: {
@@ -262,4 +280,4 @@ interface ProxyStateMessage extends ProxyMessageBase {
262
280
  }
263
281
  type AirJamProxyMessage = ProxyReadyMessage | ProxyInputMessage | ProxyStateMessage;
264
282
 
265
- export { AIRJAM_PROXY_PREFIX, type AirJamActionRpcPayload, type AirJamProxyMessage, type AirJamStateSyncPayload, type ClientLoadUiPayload, type ClientToServerEvents, type ConnectionRole, type ConnectionStatus, type ControllerActionRpcPayload, type ControllerInputEvent, type ControllerInputPayload, type ControllerJoinAck, type ControllerJoinPayload, type ControllerJoinedNotice, type ControllerLeavePayload, type ControllerLeftNotice, type ControllerStateMessage, type ControllerStatePayload, type ControllerSystemPayload, type ControllerWelcomePayload, ErrorCode, type GameState, type HapticSignalPayload, type HostJoinAsChildPayload, type HostLeftNotice, type HostRegisterSystemPayload, type HostRegistrationAck, type HostRegistrationPayload, type HostStateSyncPayload, type InterServerEvents, type PlaySoundEventPayload, type PlaySoundPayload, type PlayerProfile, type ProxyInputMessage, type ProxyMessageBase, type ProxyReadyMessage, type ProxyStateMessage, type RoomCode, type RoomReadyNotice, type RunMode, type ServerErrorPayload, type ServerToClientEvents, type SignalPayload, type SignalType, type SocketData, type SystemLaunchGameAck, type SystemLaunchGamePayload, type ToastSignalPayload, controllerInputSchema, controllerJoinSchema, controllerLeaveSchema, controllerStateSchema, controllerSystemSchema, hostJoinAsChildSchema, hostRegisterSystemSchema, hostRegistrationSchema, roomCodeSchema, systemLaunchGameSchema };
283
+ export { AIRJAM_PROXY_PREFIX, type AirJamActionRpcPayload, type AirJamProxyMessage, type AirJamStateSyncPayload, type ClientLoadUiPayload, type ClientToServerEvents, type ConnectionRole, type ConnectionStatus, type ControllerActionRpcPayload, type ControllerInputEvent, type ControllerInputPayload, type ControllerJoinAck, type ControllerJoinPayload, type ControllerJoinedNotice, type ControllerLeavePayload, type ControllerLeftNotice, type ControllerStateMessage, type ControllerStatePayload, type ControllerSystemPayload, type ControllerWelcomePayload, ErrorCode, type GameState, type HapticSignalPayload, type HostCreateRoomPayload, type HostJoinAsChildPayload, type HostLeftNotice, type HostReconnectPayload, type HostRegisterSystemPayload, type HostRegistrationAck, type HostRegistrationPayload, type HostStateSyncPayload, type InterServerEvents, type PlaySoundEventPayload, type PlaySoundPayload, type PlayerProfile, type ProxyInputMessage, type ProxyMessageBase, type ProxyReadyMessage, type ProxyStateMessage, type RoomCode, type RoomReadyNotice, type RunMode, type ServerErrorPayload, type ServerToClientEvents, type SignalPayload, type SignalType, type SocketData, type SystemLaunchGameAck, type SystemLaunchGamePayload, type ToastSignalPayload, controllerInputSchema, controllerJoinSchema, controllerLeaveSchema, controllerStateSchema, controllerSystemSchema, hostCreateRoomSchema, hostJoinAsChildSchema, hostReconnectSchema, hostRegisterSystemSchema, hostRegistrationSchema, roomCodeSchema, systemLaunchGameSchema };
package/dist/protocol.js CHANGED
@@ -1,3 +1,3 @@
1
- export { AIRJAM_PROXY_PREFIX, ErrorCode, controllerInputSchema, controllerJoinSchema, controllerLeaveSchema, controllerStateSchema, controllerSystemSchema, hostJoinAsChildSchema, hostRegisterSystemSchema, hostRegistrationSchema, roomCodeSchema, systemLaunchGameSchema } from './chunk-7M5D3Y3L.js';
1
+ export { AIRJAM_PROXY_PREFIX, ErrorCode, controllerInputSchema, controllerJoinSchema, controllerLeaveSchema, controllerStateSchema, controllerSystemSchema, hostCreateRoomSchema, hostJoinAsChildSchema, hostReconnectSchema, hostRegisterSystemSchema, hostRegistrationSchema, roomCodeSchema, systemLaunchGameSchema } from './chunk-B5DURUWT.js';
2
2
  //# sourceMappingURL=protocol.js.map
3
3
  //# sourceMappingURL=protocol.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@air-jam/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "The core SDK for building Air Jam games and controllers",
5
5
  "private": false,
6
6
  "type": "module",
@@ -11,6 +11,9 @@
11
11
  "directory": "packages/sdk"
12
12
  },
13
13
  "homepage": "https://github.com/vucinatim/air-jam#readme",
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
14
17
  "keywords": [
15
18
  "air-jam",
16
19
  "game",