@series-inc/rundot-game-sdk 5.23.0-beta.4 → 5.23.0-beta.6

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.
Files changed (76) hide show
  1. package/dist/{AdsApi-DLwbxmoJ.d.ts → AdsApi-DGVpDGIb.d.ts} +3 -182
  2. package/dist/{LeaderboardApi-UEZaRvg5.d.ts → LeaderboardApi-DoKIAAHN.d.ts} +100 -6
  3. package/dist/MultiplayerApi-nnrGTTcO.d.ts +196 -0
  4. package/dist/SyncplayRoomTransport-ByIm59Ie.d.ts +351 -0
  5. package/dist/{chunk-HG6QN3Q3.js → chunk-7T3Q22DD.js} +11 -668
  6. package/dist/chunk-7T3Q22DD.js.map +1 -0
  7. package/dist/chunk-G7TYQYHC.js +3439 -0
  8. package/dist/chunk-G7TYQYHC.js.map +1 -0
  9. package/dist/{chunk-57DREBKB.js → chunk-L2CCQONI.js} +50 -33
  10. package/dist/chunk-L2CCQONI.js.map +1 -0
  11. package/dist/{chunk-4VFWSW5V.js → chunk-MCVCZ7W3.js} +46 -4
  12. package/dist/chunk-MCVCZ7W3.js.map +1 -0
  13. package/dist/chunk-RNEWXNDL.js +1400 -0
  14. package/dist/chunk-RNEWXNDL.js.map +1 -0
  15. package/dist/chunk-USEBN3PO.js +737 -0
  16. package/dist/chunk-USEBN3PO.js.map +1 -0
  17. package/dist/chunk-VZLX7S73.js +131 -0
  18. package/dist/chunk-VZLX7S73.js.map +1 -0
  19. package/dist/host-http.d.ts +10 -1
  20. package/dist/host-http.js +1 -1
  21. package/dist/index-UMslJhz5.d.ts +323 -0
  22. package/dist/index.d.ts +51 -8
  23. package/dist/index.js +4 -3
  24. package/dist/mp-server/index.d.ts +16 -2
  25. package/dist/playground/index.js +141 -8
  26. package/dist/playground/index.js.map +1 -1
  27. package/dist/rundot-game-api/index.d.ts +4 -3
  28. package/dist/rundot-game-api/index.js +4 -3
  29. package/dist/rundot-game-api/index.js.map +1 -1
  30. package/dist/session-promotion-DgrVQE2y.d.ts +136 -0
  31. package/dist/static-checker-nclHCa43.d.ts +32 -0
  32. package/dist/syncplay/browser.d.ts +4027 -0
  33. package/dist/syncplay/browser.js +23417 -0
  34. package/dist/syncplay/browser.js.map +1 -0
  35. package/dist/syncplay/creator.d.ts +36 -0
  36. package/dist/syncplay/creator.js +4 -0
  37. package/dist/syncplay/creator.js.map +1 -0
  38. package/dist/syncplay/index.d.ts +2 -0
  39. package/dist/syncplay/index.js +4 -0
  40. package/dist/syncplay/index.js.map +1 -0
  41. package/dist/syncplay/node.d.ts +1217 -0
  42. package/dist/syncplay/node.js +36329 -0
  43. package/dist/syncplay/node.js.map +1 -0
  44. package/dist/syncplay/tools.d.ts +81 -0
  45. package/dist/syncplay/tools.js +241 -0
  46. package/dist/syncplay/tools.js.map +1 -0
  47. package/dist/types-DbhOvOdx.d.ts +216 -0
  48. package/dist/vite/dev-server-V3IZP5XX.js +2682 -0
  49. package/dist/vite/dev-server-V3IZP5XX.js.map +1 -0
  50. package/dist/vite/{esbuild-validate-IXG2OBFH.js → esbuild-validate-3ISKFZOW.js} +5 -2
  51. package/dist/vite/esbuild-validate-3ISKFZOW.js.map +1 -0
  52. package/dist/vite/index.js +30 -32
  53. package/dist/vite/index.js.map +1 -1
  54. package/docs/SUMMARY.md +7 -0
  55. package/docs/agents-index.txt +1 -1
  56. package/docs/rundot-developer-platform/api/NOTIFICATIONS.md +1 -1
  57. package/docs/rundot-developer-platform/api/SPRITE_GEN.md +148 -1
  58. package/docs/rundot-developer-platform/api/SYNCPLAY-ANIMATION.md +147 -0
  59. package/docs/rundot-developer-platform/api/SYNCPLAY-BOTS.md +318 -0
  60. package/docs/rundot-developer-platform/api/SYNCPLAY-LAG-COMPENSATION.md +150 -0
  61. package/docs/rundot-developer-platform/api/SYNCPLAY-MOVEMENT.md +183 -0
  62. package/docs/rundot-developer-platform/api/SYNCPLAY-PATHFINDING.md +225 -0
  63. package/docs/rundot-developer-platform/api/SYNCPLAY-PHYSICS.md +253 -0
  64. package/docs/rundot-developer-platform/api/SYNCPLAY.md +714 -0
  65. package/docs/rundot-developer-platform/getting-started.md +2 -0
  66. package/docs/rundot-developer-platform/runtime-environment.md +22 -0
  67. package/docs/rundot-developer-platform/troubleshooting.md +8 -0
  68. package/package.json +30 -1
  69. package/scripts/copy-docs.mjs +4 -2
  70. package/scripts/setup.mjs +0 -0
  71. package/dist/chunk-4VFWSW5V.js.map +0 -1
  72. package/dist/chunk-57DREBKB.js.map +0 -1
  73. package/dist/chunk-HG6QN3Q3.js.map +0 -1
  74. package/dist/vite/dev-server-4TS6JS4G.js +0 -1008
  75. package/dist/vite/dev-server-4TS6JS4G.js.map +0 -1
  76. package/dist/vite/esbuild-validate-IXG2OBFH.js.map +0 -1
@@ -1,4 +1,5 @@
1
- import { H as LeaderboardApi, I as ImageGenApi, A as AudioGenApi, V as VideoGenApi, q as SpriteGenApi, T as ThreeDGenApi } from './LeaderboardApi-UEZaRvg5.js';
1
+ import { M as LeaderboardApi, I as ImageGenApi, A as AudioGenApi, V as VideoGenApi, q as SpriteGenApi, T as ThreeDGenApi } from './LeaderboardApi-DoKIAAHN.js';
2
+ import { M as MultiplayerApi } from './MultiplayerApi-nnrGTTcO.js';
2
3
 
3
4
  interface StorageApi {
4
5
  key(index: number): Promise<string | null>;
@@ -1721,186 +1722,6 @@ declare class RundotGameTransport implements RpcTransport {
1721
1722
  private notifyRundotGameMessageReceived;
1722
1723
  }
1723
1724
 
1724
- /** Constraint for user-defined message unions shared between client and server. */
1725
- type Protocol = {
1726
- type: string;
1727
- };
1728
- interface JoinTicketRequest {
1729
- roomType: string;
1730
- roomCode?: string;
1731
- action: 'create' | 'joinOrCreate' | 'joinByCode' | 'matchmake';
1732
- /**
1733
- * Equality constraints for matchmaking. A candidate room matches iff every
1734
- * key here exists on the room's stored criteria with a strictly-equal value.
1735
- * Omitted (or `{}`) imposes no constraint — preserving pre-WS6 behavior.
1736
- */
1737
- criteria?: Record<string, string | number>;
1738
- /** Options applied only when this ticket creates a new room. */
1739
- createOptions?: {
1740
- maxPlayers?: number;
1741
- isPrivate?: boolean;
1742
- metadata?: Record<string, unknown>;
1743
- };
1744
- /**
1745
- * Stable key for a persistent room type (e.g. the current season's globe id),
1746
- * resolved by the host from the platform `SeasonSchedule`. Routes the join to
1747
- * the deterministic, version-independent persistent room (Phase 1 + Phase 13).
1748
- */
1749
- persistentKey?: string;
1750
- }
1751
- /**
1752
- * Optional matchmaking/create knobs threaded through the client room APIs.
1753
- * All fields optional, so an omitted `RoomOptions` is the pre-WS6 path by
1754
- * construction — no runtime "did the caller pass options" guard is needed.
1755
- */
1756
- type RoomOptions = Pick<JoinTicketRequest, 'criteria' | 'createOptions' | 'persistentKey'>;
1757
- /** Summary of a realtime room, as listed by `multiplayer.getUserRooms()`. */
1758
- interface RealtimeRoomSummary {
1759
- roomId: string;
1760
- roomCode: string;
1761
- roomType: string;
1762
- appId: string;
1763
- players: string[];
1764
- maxPlayers: number;
1765
- isPrivate: boolean;
1766
- status: 'active' | 'disposed';
1767
- createdAt: number;
1768
- updatedAt: number;
1769
- }
1770
- interface ListUserRoomsOptions {
1771
- appId?: string;
1772
- includeDisposed?: boolean;
1773
- }
1774
-
1775
- /** A persisted room chat message (Req 20). Mirrors the server's ChatMessage. */
1776
- interface ChatMessageData {
1777
- id: string;
1778
- roomId: string;
1779
- senderId: string;
1780
- senderName?: string;
1781
- text: string;
1782
- ts: number;
1783
- }
1784
-
1785
- /**
1786
- * Server-authoritative room types used by the client multiplayer layer.
1787
- */
1788
-
1789
- type ConnectionState = 'connecting' | 'connected' | 'reconnecting' | 'disconnected';
1790
- interface ServerPlayer {
1791
- id: string;
1792
- username: string;
1793
- avatarUrl?: string | null;
1794
- }
1795
- /** Public interface for a server-authoritative room. */
1796
- interface ServerRoom<P extends Protocol> {
1797
- /** The shareable room code (e.g. "HX9KWR") */
1798
- readonly roomCode: string;
1799
- /** The current player's ID */
1800
- readonly playerId: string;
1801
- /** Whether the room is locked */
1802
- readonly locked: boolean;
1803
- /** Current latency in ms (round-trip / 2) */
1804
- readonly latency: number;
1805
- /** Connection state */
1806
- readonly connectionState: ConnectionState;
1807
- /** Register event handlers. */
1808
- on(events: RoomEvents<P>): void;
1809
- /** Send a typed message to the server room. */
1810
- send(message: P): void;
1811
- /**
1812
- * Send a room chat message (Req 20). The server authorizes it against the live
1813
- * roster, persists it, and delivers it to all members (incl. you) as `onChat`.
1814
- */
1815
- sendChat(text: string): void;
1816
- /** Request recent chat history; the reply arrives via `onChatHistory`. */
1817
- fetchChatHistory(limit?: number): void;
1818
- /** Leave the room and close the connection. */
1819
- leave(): void;
1820
- /** Get estimated server time (local time + offset). */
1821
- getServerTime(): number;
1822
- }
1823
- interface RoomEvents<P extends Protocol> {
1824
- /** Called when a broadcast message is received from the server */
1825
- onMessage?: (message: P) => void;
1826
- /** Called when a targeted message is received */
1827
- onPrivateMessage?: (message: P) => void;
1828
- /**
1829
- * Called for an authoritative world delta (Req 7). Convenience wrapper over the
1830
- * `world:delta` broadcast so games don't match on the msgType string.
1831
- */
1832
- onDelta?: (delta: unknown) => void;
1833
- /**
1834
- * Called when the server asks the client to resync (a delta exceeded the WS
1835
- * frame cap, or state diverged). The client should refetch full state.
1836
- */
1837
- onResync?: (reason: string) => void;
1838
- /** Called when a room chat message is delivered (Req 20). */
1839
- onChat?: (message: ChatMessageData) => void;
1840
- /** Called with the reply to {@link ServerRoom.fetchChatHistory}. */
1841
- onChatHistory?: (messages: ChatMessageData[]) => void;
1842
- /** Called when a player joins the room */
1843
- onPlayerJoined?: (player: ServerPlayer) => void;
1844
- /** Called when a player leaves the room */
1845
- onPlayerLeft?: (playerId: string) => void;
1846
- /** Called when the room is locked */
1847
- onLock?: () => void;
1848
- /** Called when the room is unlocked */
1849
- onUnlock?: () => void;
1850
- /** Called on connection error */
1851
- onError?: (error: string) => void;
1852
- /** Called when disconnected */
1853
- onDisconnect?: () => void;
1854
- /** Called when reconnecting */
1855
- onReconnecting?: () => void;
1856
- /** Called when reconnected */
1857
- onReconnected?: () => void;
1858
- /**
1859
- * Called when the server moved this player to another room (move_player /
1860
- * Req 19). The socket stays open and now serves `roomId`; the game should
1861
- * refetch state for the new room. {@link ServerRoom.roomCode} updates to match.
1862
- */
1863
- onMoved?: (roomId: string) => void;
1864
- }
1865
-
1866
- /**
1867
- * Client-side Multiplayer API interface.
1868
- * All host implementations (RPC, WS, Mock) implement this interface.
1869
- */
1870
-
1871
- interface MultiplayerApi {
1872
- /**
1873
- * Create a new room of the given type.
1874
- */
1875
- createRoom<P extends Protocol>(roomType: string, opts?: RoomOptions): Promise<ServerRoom<P>>;
1876
- /**
1877
- * Join a room by its 6-char code.
1878
- */
1879
- joinRoomByCode<P extends Protocol>(code: string): Promise<ServerRoom<P>>;
1880
- /**
1881
- * Join an existing room or create a new one (matchmaking by room type).
1882
- */
1883
- joinOrCreateRoom<P extends Protocol>(roomType: string, opts?: RoomOptions): Promise<ServerRoom<P>>;
1884
- /**
1885
- * Server-authoritative PvP matchmaking (Req 18): request a match under
1886
- * `opts.criteria`. Resolves once the platform pairs you with another player —
1887
- * even if you land on different server instances — and joins you into the
1888
- * shared room. The returned promise stays pending while waiting for an
1889
- * opponent (up to `opts.matchmakeTimeoutMs`).
1890
- */
1891
- matchmakeRoom<P extends Protocol>(roomType: string, opts?: MatchmakeOptions): Promise<ServerRoom<P>>;
1892
- /**
1893
- * List the realtime rooms the current user is a member of.
1894
- */
1895
- getUserRooms(options?: ListUserRoomsOptions): Promise<RealtimeRoomSummary[]>;
1896
- }
1897
- type MatchmakeOptions = Pick<RoomOptions, 'criteria'> & {
1898
- /** How long to wait for an opponent before rejecting (default 120s). */
1899
- matchmakeTimeoutMs?: number;
1900
- /** How often to poll the pool while waiting (default 1s). */
1901
- pollIntervalMs?: number;
1902
- };
1903
-
1904
1725
  interface LoggingApi {
1905
1726
  logDebug(message: string, ...args: any[]): void;
1906
1727
  logError(message: string, ...args: any[]): void;
@@ -4602,4 +4423,4 @@ interface AdsApi {
4602
4423
  showInterstitialAd(options?: ShowInterstitialAdOptions): Promise<boolean>;
4603
4424
  }
4604
4425
 
4605
- export { type EnvironmentInfo as $, type AnalyticsApi as A, type BatchRecipeRequirementsResult as B, type NotificationsApi as C, type ScheduleLocalNotification as D, type ScheduleNotificationOptions as E, type RCSAvailabilityStatus as F, type ScheduleRCSInput as G, type Host as H, type ScheduleRCSResult as I, type RequestRCSOptInInput as J, type RequestRCSOptInResult as K, type PopupsApi as L, type ShowToastOptions as M, type NavigationApi as N, type LikeDialogResult as O, type Profile as P, type QuitOptions as Q, type RundotGameAPI as R, type SimulationActiveRunsUpdate as S, type CommentsPanelResult as T, type LikeStateResult as U, type ShowInterstitialAdOptions as V, type ShowRewardedAdOptions as W, type ProfileApi as X, type DeviceApi as Y, type DeviceInfo as Z, type EnvironmentApi as _, type RecipeRequirementQuery as a, type ListRoomsOptions as a$, type SystemApi as a0, type SafeArea as a1, type AddToHomeScreenResult as a2, type CdnApi as a3, type FetchFromCdnOptions as a4, type AssetUrlResult as a5, type TimeApi as a6, type ServerTimeData as a7, type GetFutureTimeOptions as a8, type AiApi as a9, type SimulationAvailableItem as aA, type SimulationPowerPreview as aB, type SimulationSlotMutationResult as aC, type SimulationSlotContainer as aD, type SimulationAssignment as aE, type SimulationState as aF, type ExecuteRecipeOptions as aG, type ExecuteRecipeResponse as aH, type CollectRecipeResult as aI, type ResetStateOptions as aJ, type ResetStateResult as aK, type GetActiveRunsOptions as aL, type ExecuteScopedRecipeOptions as aM, type ExecuteScopedRecipeResult as aN, type GetAvailableRecipesOptions as aO, type GetAvailableRecipesResult as aP, type Recipe as aQ, type GetBatchRecipeRequirements as aR, type TriggerRecipeChainOptions as aS, type RoomDataUpdate as aT, type RoomMessageEvent as aU, type ProposedMoveEvent as aV, RundotGameTransport as aW, type RoomsApi as aX, type CreateRoomOptions as aY, type JoinOrCreateRoomOptions as aZ, type JoinOrCreateResult as a_, type AiChatCompletionRequest as aa, type AiChatCompletionData as ab, type AiChatCompletionStreamOptions as ac, type AiChatCompletionStreamChunk as ad, type HapticsApi as ae, HapticFeedbackStyle as af, type GamepadSnapshot as ag, type GamepadConnectionEvent as ah, type Subscription as ai, type GamepadApi as aj, type GamepadLatencyStats as ak, type FeaturesApi as al, type Experiment as am, type LifecycleApi as an, type SleepCallback as ao, type AwakeCallback as ap, type PauseCallback as aq, type ResumeCallback as ar, type QuitCallback as as, type BackButtonCallback as at, type IdentityChangedCallback as au, type IdentityChangedEvent as av, type SimulationApi as aw, type SimulationSlotValidationResult as ax, type SimulationBatchOperation as ay, type SimulationBatchOperationsResult as az, type RecipeRequirementResult as b, type AdminThreeDGenApi as b$, type UpdateRoomDataOptions as b0, type RoomMessageRequest as b1, type StartRoomGameOptions as b2, type ProposeMoveRequest as b3, type ProposeMoveResult as b4, type ValidateMoveVerdict as b5, type ValidateMoveResult as b6, type RoomSubscriptionOptions as b7, type LoggingApi as b8, type IapApi as b9, type CanShareFileResult as bA, type EntitlementApi as bB, type Entitlement as bC, type LedgerEntry as bD, type StatsApi as bE, type GrantInfo as bF, type CollectiblesApi as bG, type CollectibleCard as bH, type VipClaimResult as bI, type ShopApi as bJ, type StorefrontResponse as bK, type StorefrontItem as bL, type ShopPurchaseResponse as bM, type ShopOrderHistoryResponse as bN, type PromptLoginResult as bO, type AccessTier as bP, type AccessGateApi as bQ, type TextGenApi as bR, type UgcApi as bS, type MultiplayerApi as bT, type VideoApi as bU, type AppApi as bV, type AdminUgcApi as bW, type AdminImageGenApi as bX, type AdminVideoGenApi as bY, type AdminSpriteGenApi as bZ, type AdminAudioGenApi as b_, type SpendCurrencyOptions as ba, type SpendCurrencyResult as bb, type SubscriptionTier as bc, type RunSubscriptionsResponse as bd, type SubscriptionInterval as be, type PurchaseSubscriptionResponse as bf, type OpenStoreResult as bg, type LoadEmbeddedAssetsResponse as bh, type SharedAssetsApi as bi, type CreditsApi as bj, type CreditsBillingContext as bk, type CreditBalance as bl, type CreditSubscription as bm, type CreditPlansCatalog as bn, type OpenPaywallOptions as bo, type CreditsPurchaseResult as bp, type Unsubscribe as bq, type PreloaderApi as br, type SocialApi as bs, type ShareMetadata as bt, type ShareLinkResult as bu, type SocialQRCodeOptions as bv, type QRCodeResult as bw, type ShareClickData as bx, type ShareFileOptions as by, type ShareFileResult as bz, type RundotGameAvailableRecipe as c, type AdminVideoGenResolveAction as c$, type AppRole as c0, type ResolveLaunchIntentOptions as c1, type LaunchIntent as c2, type ReleaseNote as c3, type AdminUgcBrowseParams as c4, type AdminUgcBrowseResponse as c5, type AdminUgcListReportsParams as c6, type AdminUgcListReportsResponse as c7, type AdminUgcResolveAction as c8, type AdminGenBrowseParams as c9, type ClipsSupport as cA, type ClipPersistOptions as cB, type ClipResult as cC, type UgcEntry as cD, type CaptureConsentStatus as cE, AccessDeniedError as cF, type AdminGenApi as cG, type AdminImageGenBrowseParams as cH, type AdminImageGenBrowseResponse as cI, type AdminImageGenListReportsParams as cJ, type AdminImageGenListReportsResponse as cK, type AdminImageGenResolveAction as cL, type AdminSpriteGenBrowseParams as cM, type AdminSpriteGenBrowseResponse as cN, type AdminSpriteGenListReportsParams as cO, type AdminSpriteGenListReportsResponse as cP, type AdminSpriteGenResolveAction as cQ, type AdminThreeDGenBrowseParams as cR, type AdminThreeDGenBrowseResponse as cS, type AdminThreeDGenListReportsParams as cT, type AdminThreeDGenListReportsResponse as cU, type AdminThreeDGenResolveAction as cV, type AdminUgcEntry as cW, type AdminVideoGenBrowseParams as cX, type AdminVideoGenBrowseResponse as cY, type AdminVideoGenListReportsParams as cZ, type AdminVideoGenListReportsResponse as c_, type AdminGenBrowseResponse as ca, type ImageGenEntry as cb, type AdminGenListReportsParams as cc, type AdminGenListReportsResponse as cd, type ImageGenReport as ce, type AdminGenResolveAction as cf, type SpriteGenEntry as cg, type SpriteGenReport as ch, type ThreeDGenEntry as ci, type ThreeDGenReport as cj, type Avatar3dApi as ck, type AssetManifest as cl, type Avatar3dConfig as cm, type ShowEditorOptions as cn, type Avatar3dEdits as co, type AdsApi as cp, type RawEnvironmentInfo as cq, type SharedStorageHostApi as cr, type FilesApi as cs, type ClipsApi as ct, type AttributionApi as cu, type InitializationContext as cv, type InitializationOptions as cw, type CaptureConsent as cx, type StartClipRecordingOptions as cy, type ClipBlob as cz, type RundotGameCollectRecipeResult as d, type RoomGamePhase as d$, type AiContentBlock as d0, type AiImageContent as d1, type AiImageUrlContent as d2, type AiMessage as d3, type AiResponseFormat as d4, type AiTextContent as d5, type AiToolResultContent as d6, type AiToolUseContent as d7, type Asset as d8, type AudioGenEntry as d9, type InboundForKeyEntry as dA, type InboundMethodIds as dB, type InboundStorageApi as dC, type IsPlayerSubscribedRequest as dD, type JoinOrCreateRoomEnvelopeResponse as dE, type JoinRoomMatchCriteria as dF, type LaunchIntentKind as dG, type ListUserRoomsOptions as dH, type LoadEmbeddedAssetsRequest as dI, type MatchmakeOptions as dJ, MockAvatarApi as dK, type NotificationTriggerInput as dL, type OnNotificationCallback as dM, type OnRequestCallback as dN, type OnResponseCallback as dO, type PlatformCapabilities as dP, type ProposedMovePayload as dQ, type Protocol as dR, type PurchaseSubscriptionRequest as dS, type RCSAvailabilityReason as dT, type RCSOptInStatus as dU, ROOM_GAME_PHASES as dV, type RealtimeRoomSummary as dW, type RecipeInfo as dX, type ReleaseType as dY, type RoomEnvelopeResponse as dZ, type RoomEvents as d_, type AudioGenReport as da, CLIP_CONTENT_TYPE as db, CREDITS_EXHAUSTED_CODE as dc, type Category as dd, type ChatMessageData as de, type ClipAudioOptions as df, type ClipCameraOptions as dg, type ClipPipLayout as dh, type ClipPipPosition as di, type ConnectionState as dj, type CreditFreeDailyInfo as dk, type CreditPlan as dl, type CreditTopUpPack as dm, type CreditsBilledTo as dn, CreditsExhaustedError as dp, type CreditsExhaustedErrorInfo as dq, type CreditsPurchaseOutcome as dr, GAMEPAD_BUTTON_NAMES as ds, type GamepadAxes as dt, type GamepadButtonName as du, type GamepadButtonState as dv, type GamepadSource as dw, type GetSubscriptionsForTierRequest as dx, type HudInsets as dy, type IdentityChangeReason as dz, type RundotGameExecuteRecipeOptions as e, type RoomMessageEventType as e0, type RoomMessagePayload as e1, type RoomsEnvelopeResponse as e2, RpcInboundStorageApi as e3, RpcSharedAssetsApi as e4, type RpcTransport as e5, type RunSubscription as e6, type RundotGameRoomCustomMetadata as e7, type RundotGameRoomPayload as e8, type RundotGameRoomRules as e9, assertTierSupportsInterval as eA, createHost as eB, isCreditsExhaustedError as eC, mapCreditsExhaustion as eD, resolveCollectionItemPrice as eE, type RundotGameRoomRulesGameState as ea, SHARE_FILE_ALLOWED_MIME_TYPES as eb, SHARE_FILE_MAX_SIZE_BYTES as ec, type ScheduleRCSStatus as ed, type ServerPlayer as ee, type ServerRoom as ef, type ShareFileMimeType as eg, type ShopOrder as eh, type SimulationBatchOperationAssign as ei, type SimulationBatchOperationRemove as ej, type SimulationBatchOperationResult as ek, type SimulationPersonalState as el, type SimulationRoomActiveRecipe as em, type SimulationRoomState as en, type StorefrontCollection as eo, type StorefrontCollectionItem as ep, type SubPath as eq, TIER_SUPPORTED_INTERVALS as er, type Tool as es, type ToolChoice as et, type ToolUse as eu, type TimeIntervalTriggerInput as ev, type UgcReport as ew, type VideoGenEntry as ex, type VideoGenReport as ey, asCreditsExhaustedError as ez, type RundotGameExecuteRecipeResult as f, type RundotGameExecuteScopedRecipeOptions as g, RundotGameRoom as h, type RundotGameSimulationConfig as i, type RundotGameSimulationEffect as j, type RundotGameSimulationRecipe as k, type RundotGameSimulationStateResponse as l, type SimulationEntityUpdate as m, type SimulationRunSummary as n, type SimulationSnapshotUpdate as o, type SimulationSubscribeOptions as p, type SimulationUpdateData as q, type SimulationUpdateType as r, type RpcRequest as s, type RpcResponse as t, type RpcNotification as u, RpcClient as v, type StorageApi as w, type NavigationStackInfo as x, type PushAppOptions as y, type NavigateToGameOptions as z };
4426
+ export { type EnvironmentInfo as $, type AnalyticsApi as A, type BatchRecipeRequirementsResult as B, type NotificationsApi as C, type ScheduleLocalNotification as D, type ScheduleNotificationOptions as E, type RCSAvailabilityStatus as F, type ScheduleRCSInput as G, type Host as H, type ScheduleRCSResult as I, type RequestRCSOptInInput as J, type RequestRCSOptInResult as K, type PopupsApi as L, type ShowToastOptions as M, type NavigationApi as N, type LikeDialogResult as O, type Profile as P, type QuitOptions as Q, type RundotGameAPI as R, type SimulationActiveRunsUpdate as S, type CommentsPanelResult as T, type LikeStateResult as U, type ShowInterstitialAdOptions as V, type ShowRewardedAdOptions as W, type ProfileApi as X, type DeviceApi as Y, type DeviceInfo as Z, type EnvironmentApi as _, type RecipeRequirementQuery as a, type ListRoomsOptions as a$, type SystemApi as a0, type SafeArea as a1, type AddToHomeScreenResult as a2, type CdnApi as a3, type FetchFromCdnOptions as a4, type AssetUrlResult as a5, type TimeApi as a6, type ServerTimeData as a7, type GetFutureTimeOptions as a8, type AiApi as a9, type SimulationAvailableItem as aA, type SimulationPowerPreview as aB, type SimulationSlotMutationResult as aC, type SimulationSlotContainer as aD, type SimulationAssignment as aE, type SimulationState as aF, type ExecuteRecipeOptions as aG, type ExecuteRecipeResponse as aH, type CollectRecipeResult as aI, type ResetStateOptions as aJ, type ResetStateResult as aK, type GetActiveRunsOptions as aL, type ExecuteScopedRecipeOptions as aM, type ExecuteScopedRecipeResult as aN, type GetAvailableRecipesOptions as aO, type GetAvailableRecipesResult as aP, type Recipe as aQ, type GetBatchRecipeRequirements as aR, type TriggerRecipeChainOptions as aS, type RoomDataUpdate as aT, type RoomMessageEvent as aU, type ProposedMoveEvent as aV, RundotGameTransport as aW, type RoomsApi as aX, type CreateRoomOptions as aY, type JoinOrCreateRoomOptions as aZ, type JoinOrCreateResult as a_, type AiChatCompletionRequest as aa, type AiChatCompletionData as ab, type AiChatCompletionStreamOptions as ac, type AiChatCompletionStreamChunk as ad, type HapticsApi as ae, HapticFeedbackStyle as af, type GamepadSnapshot as ag, type GamepadConnectionEvent as ah, type Subscription as ai, type GamepadApi as aj, type GamepadLatencyStats as ak, type FeaturesApi as al, type Experiment as am, type LifecycleApi as an, type SleepCallback as ao, type AwakeCallback as ap, type PauseCallback as aq, type ResumeCallback as ar, type QuitCallback as as, type BackButtonCallback as at, type IdentityChangedCallback as au, type IdentityChangedEvent as av, type SimulationApi as aw, type SimulationSlotValidationResult as ax, type SimulationBatchOperation as ay, type SimulationBatchOperationsResult as az, type RecipeRequirementResult as b, type AppRole as b$, type UpdateRoomDataOptions as b0, type RoomMessageRequest as b1, type StartRoomGameOptions as b2, type ProposeMoveRequest as b3, type ProposeMoveResult as b4, type ValidateMoveVerdict as b5, type ValidateMoveResult as b6, type RoomSubscriptionOptions as b7, type LoggingApi as b8, type IapApi as b9, type CanShareFileResult as bA, type EntitlementApi as bB, type Entitlement as bC, type LedgerEntry as bD, type StatsApi as bE, type GrantInfo as bF, type CollectiblesApi as bG, type CollectibleCard as bH, type VipClaimResult as bI, type ShopApi as bJ, type StorefrontResponse as bK, type StorefrontItem as bL, type ShopPurchaseResponse as bM, type ShopOrderHistoryResponse as bN, type PromptLoginResult as bO, type AccessTier as bP, type AccessGateApi as bQ, type TextGenApi as bR, type UgcApi as bS, type VideoApi as bT, type AppApi as bU, type AdminUgcApi as bV, type AdminImageGenApi as bW, type AdminVideoGenApi as bX, type AdminSpriteGenApi as bY, type AdminAudioGenApi as bZ, type AdminThreeDGenApi as b_, type SpendCurrencyOptions as ba, type SpendCurrencyResult as bb, type SubscriptionTier as bc, type RunSubscriptionsResponse as bd, type SubscriptionInterval as be, type PurchaseSubscriptionResponse as bf, type OpenStoreResult as bg, type LoadEmbeddedAssetsResponse as bh, type SharedAssetsApi as bi, type CreditsApi as bj, type CreditsBillingContext as bk, type CreditBalance as bl, type CreditSubscription as bm, type CreditPlansCatalog as bn, type OpenPaywallOptions as bo, type CreditsPurchaseResult as bp, type Unsubscribe as bq, type PreloaderApi as br, type SocialApi as bs, type ShareMetadata as bt, type ShareLinkResult as bu, type SocialQRCodeOptions as bv, type QRCodeResult as bw, type ShareClickData as bx, type ShareFileOptions as by, type ShareFileResult as bz, type RundotGameAvailableRecipe as c, type AiContentBlock as c$, type ResolveLaunchIntentOptions as c0, type LaunchIntent as c1, type ReleaseNote as c2, type AdminUgcBrowseParams as c3, type AdminUgcBrowseResponse as c4, type AdminUgcListReportsParams as c5, type AdminUgcListReportsResponse as c6, type AdminUgcResolveAction as c7, type AdminGenBrowseParams as c8, type AdminGenBrowseResponse as c9, type ClipPersistOptions as cA, type ClipResult as cB, type UgcEntry as cC, type CaptureConsentStatus as cD, AccessDeniedError as cE, type AdminGenApi as cF, type AdminImageGenBrowseParams as cG, type AdminImageGenBrowseResponse as cH, type AdminImageGenListReportsParams as cI, type AdminImageGenListReportsResponse as cJ, type AdminImageGenResolveAction as cK, type AdminSpriteGenBrowseParams as cL, type AdminSpriteGenBrowseResponse as cM, type AdminSpriteGenListReportsParams as cN, type AdminSpriteGenListReportsResponse as cO, type AdminSpriteGenResolveAction as cP, type AdminThreeDGenBrowseParams as cQ, type AdminThreeDGenBrowseResponse as cR, type AdminThreeDGenListReportsParams as cS, type AdminThreeDGenListReportsResponse as cT, type AdminThreeDGenResolveAction as cU, type AdminUgcEntry as cV, type AdminVideoGenBrowseParams as cW, type AdminVideoGenBrowseResponse as cX, type AdminVideoGenListReportsParams as cY, type AdminVideoGenListReportsResponse as cZ, type AdminVideoGenResolveAction as c_, type ImageGenEntry as ca, type AdminGenListReportsParams as cb, type AdminGenListReportsResponse as cc, type ImageGenReport as cd, type AdminGenResolveAction as ce, type SpriteGenEntry as cf, type SpriteGenReport as cg, type ThreeDGenEntry as ch, type ThreeDGenReport as ci, type Avatar3dApi as cj, type AssetManifest as ck, type Avatar3dConfig as cl, type ShowEditorOptions as cm, type Avatar3dEdits as cn, type AdsApi as co, type RawEnvironmentInfo as cp, type SharedStorageHostApi as cq, type FilesApi as cr, type ClipsApi as cs, type AttributionApi as ct, type InitializationContext as cu, type InitializationOptions as cv, type CaptureConsent as cw, type StartClipRecordingOptions as cx, type ClipBlob as cy, type ClipsSupport as cz, type RundotGameCollectRecipeResult as d, type RundotGameRoomCustomMetadata as d$, type AiImageContent as d0, type AiImageUrlContent as d1, type AiMessage as d2, type AiResponseFormat as d3, type AiTextContent as d4, type AiToolResultContent as d5, type AiToolUseContent as d6, type Asset as d7, type AudioGenEntry as d8, type AudioGenReport as d9, type IsPlayerSubscribedRequest as dA, type JoinOrCreateRoomEnvelopeResponse as dB, type JoinRoomMatchCriteria as dC, type LaunchIntentKind as dD, type LoadEmbeddedAssetsRequest as dE, MockAvatarApi as dF, type NotificationTriggerInput as dG, type OnNotificationCallback as dH, type OnRequestCallback as dI, type OnResponseCallback as dJ, type PlatformCapabilities as dK, type ProposedMovePayload as dL, type PurchaseSubscriptionRequest as dM, type RCSAvailabilityReason as dN, type RCSOptInStatus as dO, ROOM_GAME_PHASES as dP, type RecipeInfo as dQ, type ReleaseType as dR, type RoomEnvelopeResponse as dS, type RoomGamePhase as dT, type RoomMessageEventType as dU, type RoomMessagePayload as dV, type RoomsEnvelopeResponse as dW, RpcInboundStorageApi as dX, RpcSharedAssetsApi as dY, type RpcTransport as dZ, type RunSubscription as d_, CLIP_CONTENT_TYPE as da, CREDITS_EXHAUSTED_CODE as db, type Category as dc, type ClipAudioOptions as dd, type ClipCameraOptions as de, type ClipPipLayout as df, type ClipPipPosition as dg, type CreditFreeDailyInfo as dh, type CreditPlan as di, type CreditTopUpPack as dj, type CreditsBilledTo as dk, CreditsExhaustedError as dl, type CreditsExhaustedErrorInfo as dm, type CreditsPurchaseOutcome as dn, GAMEPAD_BUTTON_NAMES as dp, type GamepadAxes as dq, type GamepadButtonName as dr, type GamepadButtonState as ds, type GamepadSource as dt, type GetSubscriptionsForTierRequest as du, type HudInsets as dv, type IdentityChangeReason as dw, type InboundForKeyEntry as dx, type InboundMethodIds as dy, type InboundStorageApi as dz, type RundotGameExecuteRecipeOptions as e, type RundotGameRoomPayload as e0, type RundotGameRoomRules as e1, type RundotGameRoomRulesGameState as e2, SHARE_FILE_ALLOWED_MIME_TYPES as e3, SHARE_FILE_MAX_SIZE_BYTES as e4, type ScheduleRCSStatus as e5, type ShareFileMimeType as e6, type ShopOrder as e7, type SimulationBatchOperationAssign as e8, type SimulationBatchOperationRemove as e9, type SimulationBatchOperationResult as ea, type SimulationPersonalState as eb, type SimulationRoomActiveRecipe as ec, type SimulationRoomState as ed, type StorefrontCollection as ee, type StorefrontCollectionItem as ef, type SubPath as eg, TIER_SUPPORTED_INTERVALS as eh, type Tool as ei, type ToolChoice as ej, type ToolUse as ek, type TimeIntervalTriggerInput as el, type UgcReport as em, type VideoGenEntry as en, type VideoGenReport as eo, asCreditsExhaustedError as ep, assertTierSupportsInterval as eq, createHost as er, isCreditsExhaustedError as es, mapCreditsExhaustion as et, resolveCollectionItemPrice as eu, type RundotGameExecuteRecipeResult as f, type RundotGameExecuteScopedRecipeOptions as g, RundotGameRoom as h, type RundotGameSimulationConfig as i, type RundotGameSimulationEffect as j, type RundotGameSimulationRecipe as k, type RundotGameSimulationStateResponse as l, type SimulationEntityUpdate as m, type SimulationRunSummary as n, type SimulationSnapshotUpdate as o, type SimulationSubscribeOptions as p, type SimulationUpdateData as q, type SimulationUpdateType as r, type RpcRequest as s, type RpcResponse as t, type RpcNotification as u, RpcClient as v, type StorageApi as w, type NavigationStackInfo as x, type PushAppOptions as y, type NavigateToGameOptions as z };
@@ -337,6 +337,22 @@ interface SpriteGenParams {
337
337
  /** Creator-storage file key to import and use as edit anchor (resolved server-side). */
338
338
  editFileKey?: string;
339
339
  model?: SpriteGenModel;
340
+ /** Candidate images per call (1-4). When set, the result carries an `assets` array; one billed call covers all candidates. */
341
+ variations?: number;
342
+ /** Generation mode. 'texture' yields seamless/tileable output; 'ui' for interface elements. Default 'assets'. */
343
+ mode?: 'assets' | 'texture' | 'ui';
344
+ resolution?: '1K' | '2K' | '4K';
345
+ quality?: 'low' | 'medium' | 'high';
346
+ aspectRatio?: '1:1' | '16:9' | '9:16';
347
+ }
348
+ /** One generated candidate. Mirrors the top-level single-asset fields of SpriteGenResult. */
349
+ interface SpriteGenGeneratedAsset {
350
+ generationId: string;
351
+ imageUrl: string;
352
+ spriteCookAssetId: string;
353
+ width: number;
354
+ height: number;
355
+ creditsUsed?: number;
340
356
  }
341
357
  interface SpriteGenResult {
342
358
  generationId: string;
@@ -350,6 +366,13 @@ interface SpriteGenResult {
350
366
  referenceImportAssetId?: string;
351
367
  /** SpriteCook asset_id of an imported editFileKey, when an import occurred. Reuse via editAssetId to skip re-import. */
352
368
  editImportAssetId?: string;
369
+ /** Echo of the effective generation dials, when set on the request. */
370
+ mode?: 'assets' | 'texture' | 'ui';
371
+ resolution?: '1K' | '2K' | '4K';
372
+ quality?: 'low' | 'medium' | 'high';
373
+ aspectRatio?: '1:1' | '16:9' | '9:16';
374
+ /** All candidates (including the primary one above). Present only when the request set `variations`. */
375
+ assets?: SpriteGenGeneratedAsset[];
353
376
  }
354
377
  interface AnimateSpriteParams {
355
378
  /** generationId from a prior spriteGen.generate() call. */
@@ -366,6 +389,10 @@ interface AnimateSpriteParams {
366
389
  outputFormat?: 'spritesheet' | 'gif' | 'webp';
367
390
  /** Background removal mode. Default 'Basic'. */
368
391
  removeBg?: 'None' | 'Basic' | 'Pro';
392
+ /** Generative steering — what the animation should avoid. */
393
+ negativePrompt?: string;
394
+ /** #RRGGBB hex color the provider mattes alpha against during animation/removebg (provider default #808080). */
395
+ matteColor?: string;
369
396
  }
370
397
  interface AnimateSpriteResult {
371
398
  generationId: string;
@@ -375,20 +402,87 @@ interface AnimateSpriteResult {
375
402
  frameHeight: number;
376
403
  prompt: string;
377
404
  }
405
+ interface CharacterAnimateParams {
406
+ /** generationId from a prior spriteGen.generate() call. */
407
+ sourceGenerationId?: string;
408
+ /** Or: a creator-storage file key to animate (imported to SpriteCook on the fly). */
409
+ sourceFileKey?: string;
410
+ /** Or: an HTTPS URL to import and animate. */
411
+ sourceImageUrl?: string;
412
+ /** Character description. Defaults to the source generation's prompt when available. */
413
+ prompt?: string;
414
+ /** Animation preset names, e.g. ["idle", "walk"]. */
415
+ animations: string[];
416
+ /** Output format. Default 'spritesheet'. */
417
+ outputFormat?: 'spritesheet' | 'gif' | 'webp';
418
+ /** Background removal mode. Default 'Basic'. */
419
+ removeBg?: 'None' | 'Basic' | 'Pro';
420
+ /** Frame count per animation. */
421
+ frameCount?: number;
422
+ /** SpriteCook workflow ID (from listCharacterWorkflows). */
423
+ workflowId?: string;
424
+ }
425
+ interface CharacterAnimateResult {
426
+ jobId: string;
427
+ characterId: string;
428
+ status: 'completed' | 'partial' | 'failed';
429
+ animations: CharacterAnimationOutput[];
430
+ }
431
+ interface CharacterAnimationOutput {
432
+ name: string;
433
+ status: 'completed' | 'failed';
434
+ generationId?: string;
435
+ spriteSheetUrl?: string;
436
+ frameCount?: number;
437
+ frameWidth?: number;
438
+ frameHeight?: number;
439
+ error?: string;
440
+ }
441
+ interface CharacterWorkflow {
442
+ id: string;
443
+ name: string;
444
+ description: string;
445
+ animations: string[];
446
+ }
378
447
  interface SpriteGenJobEvent {
379
448
  jobId: string;
380
449
  status: 'completed' | 'failed';
381
- /** Firestore job type — always 'spriteGen'. Use params.operation to distinguish generate vs animate. */
450
+ /** Firestore job type — always 'spriteGen'. Use params.operation to distinguish generate vs animate vs characterAnimate. */
382
451
  type: string;
383
- params: (SpriteGenParams | AnimateSpriteParams) & {
384
- operation: 'generate' | 'animate';
452
+ params: (SpriteGenParams | AnimateSpriteParams | CharacterAnimateParams) & {
453
+ operation: 'generate' | 'animate' | 'characterAnimate';
454
+ };
455
+ result?: SpriteGenResult | AnimateSpriteResult | CharacterAnimateResult;
456
+ /** A failed job's error. cloud-run persists a structured object ({ code, message, ... }); some paths use a bare string. */
457
+ error?: string | {
458
+ code: string;
459
+ message: string;
460
+ detail?: string;
461
+ };
462
+ }
463
+ /** Per-operation credit costs, for preflighting batch cost without a billed call. */
464
+ interface SpriteGenCosts {
465
+ currency: 'credits';
466
+ operations: {
467
+ /** Per generate call (each variation bills as one). */
468
+ generate: number;
469
+ /** Per animate-sprite call. */
470
+ animate: number;
471
+ /** Per animation in a character-animate run (only completed animations bill). */
472
+ characterAnimatePerAnimation: number;
385
473
  };
386
- result?: SpriteGenResult | AnimateSpriteResult;
387
- error?: string;
388
474
  }
389
475
  interface SpriteGenApi {
390
476
  generate(params: SpriteGenParams): Promise<SpriteGenResult>;
391
477
  animate(params: AnimateSpriteParams): Promise<AnimateSpriteResult>;
478
+ characterAnimate(params: CharacterAnimateParams): Promise<{
479
+ jobId: string;
480
+ }>;
481
+ listCharacterWorkflows(): Promise<CharacterWorkflow[]>;
482
+ /** Raw passthrough of the provider's model roster + per-call credit pricing (unbilled). The shape is vendor-owned. */
483
+ listModels(): Promise<unknown>;
484
+ /** Static per-operation credit costs (unbilled). */
485
+ getCosts(): Promise<SpriteGenCosts>;
392
486
  getCompletedJobs(): Promise<SpriteGenJobEvent[]>;
393
487
  }
394
488
 
@@ -693,4 +787,4 @@ interface LeaderboardApi {
693
787
  getPodiumScores(options?: GetPodiumScoresOptions): Promise<PodiumScoresResponse>;
694
788
  }
695
789
 
696
- export type { LeaderboardAntiCheatConfig as $, AudioGenApi as A, RigParams as B, RigResult as C, DepthEstimationParams as D, AnimateParams as E, AnimateResult as F, ThreeDGenJobEvent as G, LeaderboardApi as H, ImageGenApi as I, ScoreToken as J, SubmitScoreParams as K, ListVoicesResult as L, SubmitScoreResult as M, GetPagedScoresOptions as N, PlayerRankOptions as O, PagedScoresResponse as P, PlayerRankResult as Q, RemoveBackgroundParams as R, SaveDesignedVoiceParams as S, ThreeDGenApi as T, UpscaleImageParams as U, VideoGenApi as V, GetPodiumScoresOptions as W, PodiumScoresResponse as X, BgRemovalModel as Y, BiRefNetVariant as Z, ImageGenModel as _, ImageGenParams as a, LeaderboardConfig as a0, LeaderboardDisplaySettings as a1, LeaderboardEntry as a2, LeaderboardModeConfig as a3, LeaderboardPeriodConfig as a4, LeaderboardPeriodType as a5, PodiumScoresContext as a6, RemoveBackgroundOptions as a7, SpriteGenModel as a8, SubmitScoreFailureReason as a9, UpscaleImageModel as aa, ImageGenResult as b, DepthEstimationResult as c, RemoveBackgroundResult as d, UpscaleImageResult as e, ImageGenJobEvent as f, AudioGenParams as g, AudioGenResult as h, AudioGenJobEvent as i, DesignVoicesParams as j, DesignVoicesResult as k, SaveDesignedVoiceResult as l, VideoGenParams as m, VideoGenResult as n, VideoGenJobEvent as o, VideoGenJobStartedEvent as p, SpriteGenApi as q, SpriteGenParams as r, SpriteGenResult as s, AnimateSpriteParams as t, AnimateSpriteResult as u, SpriteGenJobEvent as v, ThreeDGenParams as w, ThreeDGenResult as x, RemeshParams as y, RemeshResult as z };
790
+ export type { BgRemovalModel as $, AudioGenApi as A, RemeshParams as B, CharacterAnimateParams as C, DepthEstimationParams as D, RemeshResult as E, RigParams as F, RigResult as G, AnimateParams as H, ImageGenApi as I, AnimateResult as J, ThreeDGenJobEvent as K, ListVoicesResult as L, LeaderboardApi as M, ScoreToken as N, SubmitScoreParams as O, SubmitScoreResult as P, GetPagedScoresOptions as Q, RemoveBackgroundParams as R, SaveDesignedVoiceParams as S, ThreeDGenApi as T, UpscaleImageParams as U, VideoGenApi as V, PagedScoresResponse as W, PlayerRankOptions as X, PlayerRankResult as Y, GetPodiumScoresOptions as Z, PodiumScoresResponse as _, ImageGenParams as a, BiRefNetVariant as a0, CharacterAnimateResult as a1, CharacterAnimationOutput as a2, ImageGenModel as a3, LeaderboardAntiCheatConfig as a4, LeaderboardConfig as a5, LeaderboardDisplaySettings as a6, LeaderboardEntry as a7, LeaderboardModeConfig as a8, LeaderboardPeriodConfig as a9, LeaderboardPeriodType as aa, PodiumScoresContext as ab, RemoveBackgroundOptions as ac, SpriteGenGeneratedAsset as ad, SpriteGenModel as ae, SubmitScoreFailureReason as af, UpscaleImageModel as ag, ImageGenResult as b, DepthEstimationResult as c, RemoveBackgroundResult as d, UpscaleImageResult as e, ImageGenJobEvent as f, AudioGenParams as g, AudioGenResult as h, AudioGenJobEvent as i, DesignVoicesParams as j, DesignVoicesResult as k, SaveDesignedVoiceResult as l, VideoGenParams as m, VideoGenResult as n, VideoGenJobEvent as o, VideoGenJobStartedEvent as p, SpriteGenApi as q, SpriteGenParams as r, SpriteGenResult as s, AnimateSpriteParams as t, AnimateSpriteResult as u, CharacterWorkflow as v, SpriteGenCosts as w, SpriteGenJobEvent as x, ThreeDGenParams as y, ThreeDGenResult as z };
@@ -0,0 +1,196 @@
1
+ /** Constraint for user-defined message unions shared between client and server. */
2
+ type Protocol = {
3
+ type: string;
4
+ };
5
+ interface JoinTicketRequest {
6
+ roomType: string;
7
+ roomCode?: string;
8
+ action: 'create' | 'joinOrCreate' | 'joinByCode' | 'matchmake';
9
+ /**
10
+ * Equality constraints for matchmaking. A candidate room matches iff every
11
+ * key here exists on the room's stored criteria with a strictly-equal value.
12
+ * Omitted (or `{}`) imposes no constraint — preserving pre-WS6 behavior.
13
+ */
14
+ criteria?: Record<string, string | number>;
15
+ /** Options applied only when this ticket creates a new room. */
16
+ createOptions?: {
17
+ maxPlayers?: number;
18
+ isPrivate?: boolean;
19
+ metadata?: Record<string, unknown>;
20
+ };
21
+ /**
22
+ * Stable key for a persistent room type (e.g. the current season's globe id),
23
+ * resolved by the host from the platform `SeasonSchedule`. Routes the join to
24
+ * the deterministic, version-independent persistent room (Phase 1 + Phase 13).
25
+ */
26
+ persistentKey?: string;
27
+ }
28
+ /**
29
+ * Optional matchmaking/create knobs threaded through the client room APIs.
30
+ * All fields optional, so an omitted `RoomOptions` is the pre-WS6 path by
31
+ * construction — no runtime "did the caller pass options" guard is needed.
32
+ */
33
+ type RoomOptions = Pick<JoinTicketRequest, 'criteria' | 'createOptions' | 'persistentKey'>;
34
+ /** Summary of a realtime room, as listed by `multiplayer.getUserRooms()`. */
35
+ interface RealtimeRoomSummary {
36
+ roomId: string;
37
+ roomCode: string;
38
+ roomType: string;
39
+ appId: string;
40
+ players: string[];
41
+ maxPlayers: number;
42
+ isPrivate: boolean;
43
+ status: 'active' | 'disposed';
44
+ createdAt: number;
45
+ updatedAt: number;
46
+ }
47
+ interface ListUserRoomsOptions {
48
+ appId?: string;
49
+ includeDisposed?: boolean;
50
+ }
51
+
52
+ /** A persisted room chat message (Req 20). Mirrors the server's ChatMessage. */
53
+ interface ChatMessageData {
54
+ id: string;
55
+ roomId: string;
56
+ senderId: string;
57
+ senderName?: string;
58
+ text: string;
59
+ ts: number;
60
+ }
61
+
62
+ /**
63
+ * Server-authoritative room types used by the client multiplayer layer.
64
+ */
65
+
66
+ type ConnectionState = 'connecting' | 'connected' | 'reconnecting' | 'disconnected';
67
+ interface ServerPlayer {
68
+ id: string;
69
+ username: string;
70
+ avatarUrl?: string | null;
71
+ }
72
+ /** Public interface for a server-authoritative room. */
73
+ interface ServerRoom<P extends Protocol> {
74
+ /** The shareable room code (e.g. "HX9KWR") */
75
+ readonly roomCode: string;
76
+ /** The current player's ID */
77
+ readonly playerId: string;
78
+ /** Whether the room is locked */
79
+ readonly locked: boolean;
80
+ /** Current latency in ms (round-trip / 2) */
81
+ readonly latency: number;
82
+ /** Connection state */
83
+ readonly connectionState: ConnectionState;
84
+ /** Register event handlers. */
85
+ on(events: RoomEvents<P>): void;
86
+ /** Send a typed message to the server room. */
87
+ send(message: P): void;
88
+ /**
89
+ * Send an opaque payload under `msgType` without the typed-message envelope
90
+ * transform. `data` is delivered verbatim (a raw string stays a string), so
91
+ * this is the correct channel for pass-through protocols — e.g. the
92
+ * Syncplay session envelope carried under `rdm`.
93
+ */
94
+ sendRaw(msgType: string, data: unknown): void;
95
+ /**
96
+ * Register a raw handler for `msgType`. Broadcast/sendTo messages with a matching
97
+ * `msgType` are delivered here with their payload untouched (bypassing the
98
+ * {@link RoomEvents.onMessage} spread that would corrupt a raw string). Payloads
99
+ * that arrived before this call — e.g. a server push emitted during join, in the
100
+ * window before the handler attaches — are buffered and flushed on registration.
101
+ */
102
+ onRaw(msgType: string, handler: (data: unknown) => void): void;
103
+ /**
104
+ * Send a room chat message (Req 20). The server authorizes it against the live
105
+ * roster, persists it, and delivers it to all members (incl. you) as `onChat`.
106
+ */
107
+ sendChat(text: string): void;
108
+ /** Request recent chat history; the reply arrives via `onChatHistory`. */
109
+ fetchChatHistory(limit?: number): void;
110
+ /** Leave the room and close the connection. */
111
+ leave(): void;
112
+ /** Get estimated server time (local time + offset). */
113
+ getServerTime(): number;
114
+ }
115
+ interface RoomEvents<P extends Protocol> {
116
+ /** Called when a broadcast message is received from the server */
117
+ onMessage?: (message: P) => void;
118
+ /** Called when a targeted message is received */
119
+ onPrivateMessage?: (message: P) => void;
120
+ /**
121
+ * Called for an authoritative world delta (Req 7). Convenience wrapper over the
122
+ * `world:delta` broadcast so games don't match on the msgType string.
123
+ */
124
+ onDelta?: (delta: unknown) => void;
125
+ /**
126
+ * Called when the server asks the client to resync (a delta exceeded the WS
127
+ * frame cap, or state diverged). The client should refetch full state.
128
+ */
129
+ onResync?: (reason: string) => void;
130
+ /** Called when a room chat message is delivered (Req 20). */
131
+ onChat?: (message: ChatMessageData) => void;
132
+ /** Called with the reply to {@link ServerRoom.fetchChatHistory}. */
133
+ onChatHistory?: (messages: ChatMessageData[]) => void;
134
+ /** Called when a player joins the room */
135
+ onPlayerJoined?: (player: ServerPlayer) => void;
136
+ /** Called when a player leaves the room */
137
+ onPlayerLeft?: (playerId: string) => void;
138
+ /** Called when the room is locked */
139
+ onLock?: () => void;
140
+ /** Called when the room is unlocked */
141
+ onUnlock?: () => void;
142
+ /** Called on connection error */
143
+ onError?: (error: string) => void;
144
+ /** Called when disconnected */
145
+ onDisconnect?: () => void;
146
+ /** Called when reconnecting */
147
+ onReconnecting?: () => void;
148
+ /** Called when reconnected */
149
+ onReconnected?: () => void;
150
+ /**
151
+ * Called when the server moved this player to another room (move_player /
152
+ * Req 19). The socket stays open and now serves `roomId`; the game should
153
+ * refetch state for the new room. {@link ServerRoom.roomCode} updates to match.
154
+ */
155
+ onMoved?: (roomId: string) => void;
156
+ }
157
+
158
+ /**
159
+ * Client-side Multiplayer API interface.
160
+ * All host implementations (RPC, WS, Mock) implement this interface.
161
+ */
162
+
163
+ interface MultiplayerApi {
164
+ /**
165
+ * Create a new room of the given type.
166
+ */
167
+ createRoom<P extends Protocol>(roomType: string, opts?: RoomOptions): Promise<ServerRoom<P>>;
168
+ /**
169
+ * Join a room by its 6-char code.
170
+ */
171
+ joinRoomByCode<P extends Protocol>(code: string): Promise<ServerRoom<P>>;
172
+ /**
173
+ * Join an existing room or create a new one (matchmaking by room type).
174
+ */
175
+ joinOrCreateRoom<P extends Protocol>(roomType: string, opts?: RoomOptions): Promise<ServerRoom<P>>;
176
+ /**
177
+ * Server-authoritative PvP matchmaking (Req 18): request a match under
178
+ * `opts.criteria`. Resolves once the platform pairs you with another player —
179
+ * even if you land on different server instances — and joins you into the
180
+ * shared room. The returned promise stays pending while waiting for an
181
+ * opponent (up to `opts.matchmakeTimeoutMs`).
182
+ */
183
+ matchmakeRoom<P extends Protocol>(roomType: string, opts?: MatchmakeOptions): Promise<ServerRoom<P>>;
184
+ /**
185
+ * List the realtime rooms the current user is a member of.
186
+ */
187
+ getUserRooms(options?: ListUserRoomsOptions): Promise<RealtimeRoomSummary[]>;
188
+ }
189
+ type MatchmakeOptions = Pick<RoomOptions, 'criteria'> & {
190
+ /** How long to wait for an opponent before rejecting (default 120s). */
191
+ matchmakeTimeoutMs?: number;
192
+ /** How often to poll the pool while waiting (default 1s). */
193
+ pollIntervalMs?: number;
194
+ };
195
+
196
+ export type { ChatMessageData as C, JoinTicketRequest as J, ListUserRoomsOptions as L, MultiplayerApi as M, Protocol as P, RealtimeRoomSummary as R, ServerRoom as S, RoomOptions as a, MatchmakeOptions as b, ConnectionState as c, RoomEvents as d, ServerPlayer as e };