@series-inc/rundot-game-sdk 5.22.0-beta.1 → 5.22.0-beta.3

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 (36) hide show
  1. package/dist/{AdsApi-CVQ9dhho.d.ts → AdsApi-BT2-dh42.d.ts} +172 -4
  2. package/dist/{LeaderboardApi-CBSE1wBb.d.ts → LeaderboardApi-UEZaRvg5.d.ts} +10 -1
  3. package/dist/{chunk-4YOCLVRI.js → chunk-BJGV6WIK.js} +4 -3
  4. package/dist/chunk-BJGV6WIK.js.map +1 -0
  5. package/dist/{chunk-CCLP6JOH.js → chunk-O3DF3FUB.js} +369 -53
  6. package/dist/chunk-O3DF3FUB.js.map +1 -0
  7. package/dist/{chunk-UIABXHUI.js → chunk-URUSACYP.js} +42 -27
  8. package/dist/chunk-URUSACYP.js.map +1 -0
  9. package/dist/host-http.d.ts +1 -1
  10. package/dist/host-http.js +1 -1
  11. package/dist/index.d.ts +124 -6
  12. package/dist/index.js +2 -2
  13. package/dist/mp-server/index.d.ts +3 -1
  14. package/dist/mp-server/index.js +1 -1
  15. package/dist/mp-server/index.js.map +1 -1
  16. package/dist/rundot-game-api/index.d.ts +3 -3
  17. package/dist/rundot-game-api/index.js +4 -2
  18. package/dist/rundot-game-api/index.js.map +1 -1
  19. package/dist/sandbox/index.js +13 -6
  20. package/dist/sandbox/index.js.map +1 -1
  21. package/dist/vite/chunk-G6GRSBMV.js +42 -0
  22. package/dist/vite/chunk-G6GRSBMV.js.map +1 -0
  23. package/dist/vite/{dev-server-BQFML2D4.js → dev-server-GV5N4RH3.js} +394 -82
  24. package/dist/vite/dev-server-GV5N4RH3.js.map +1 -0
  25. package/dist/vite/{esbuild-validate-DO5ES37N.js → esbuild-validate-IXG2OBFH.js} +4 -4
  26. package/dist/vite/{esbuild-validate-DO5ES37N.js.map → esbuild-validate-IXG2OBFH.js.map} +1 -1
  27. package/dist/vite/index.d.ts +50 -3
  28. package/dist/vite/index.js +40 -25
  29. package/dist/vite/index.js.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/chunk-4YOCLVRI.js.map +0 -1
  32. package/dist/chunk-CCLP6JOH.js.map +0 -1
  33. package/dist/chunk-UIABXHUI.js.map +0 -1
  34. package/dist/vite/chunk-RDFEWAG5.js +0 -14
  35. package/dist/vite/chunk-RDFEWAG5.js.map +0 -1
  36. package/dist/vite/dev-server-BQFML2D4.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { H as LeaderboardApi, I as ImageGenApi, A as AudioGenApi, V as VideoGenApi, q as SpriteGenApi, T as ThreeDGenApi } from './LeaderboardApi-CBSE1wBb.js';
1
+ import { H as LeaderboardApi, I as ImageGenApi, A as AudioGenApi, V as VideoGenApi, q as SpriteGenApi, T as ThreeDGenApi } from './LeaderboardApi-UEZaRvg5.js';
2
2
 
3
3
  interface StorageApi {
4
4
  key(index: number): Promise<string | null>;
@@ -714,6 +714,8 @@ type AiChatCompletionData = {
714
714
  message: {
715
715
  role: string;
716
716
  content: string;
717
+ /** Present only for reasoning models (e.g. deepseek-r1): the model's thinking, separate from the visible `content`. */
718
+ reasoning_content?: string;
717
719
  /** Present only when the model invoked one or more tools on this turn. */
718
720
  toolCalls?: ToolUse[];
719
721
  };
@@ -734,6 +736,11 @@ type AiChatCompletionData = {
734
736
  *
735
737
  * - `delta`: incremental assistant text. Concatenate `text` across all
736
738
  * `delta` events to reconstruct the final message.
739
+ * - `reasoning`: incremental reasoning / chain-of-thought text, emitted only
740
+ * by reasoning models (e.g. deepseek-r1). Concatenate `text` across all
741
+ * `reasoning` events (like `delta`) to reconstruct the full reasoning trace.
742
+ * Streamed on a distinct channel so consumers can render or ignore it
743
+ * independently of the answer; content-only consumers can skip it.
737
744
  * - `tool_call_chunk`: partial tool-call metadata. Providers stream tool
738
745
  * arguments as multiple chunks; buffer by `index` until `done`.
739
746
  * - `done`: terminal event for a successful stream. Carries `finishReason`
@@ -745,6 +752,9 @@ type AiChatCompletionData = {
745
752
  type AiChatCompletionStreamChunk = {
746
753
  type: 'delta';
747
754
  text: string;
755
+ } | {
756
+ type: 'reasoning';
757
+ text: string;
748
758
  } | {
749
759
  type: 'tool_call_chunk';
750
760
  index: number;
@@ -952,6 +962,23 @@ type ResumeCallback = () => void;
952
962
  type PauseCallback = () => void;
953
963
  type QuitCallback = () => void;
954
964
  type BackButtonCallback = () => void;
965
+ /**
966
+ * Why the player's identity changed mid-session:
967
+ * - `sign_in` — anonymous → authenticated, SAME profile.id (linkWithCredential)
968
+ * - `account_switch` — profile.id changed (signed into a different existing account)
969
+ * - `sign_out` — authenticated → anonymous
970
+ */
971
+ type IdentityChangeReason = 'sign_in' | 'account_switch' | 'sign_out';
972
+ interface IdentityChangedEvent {
973
+ /** Identity now in effect. After `sign_in`, `isAnonymous === false`. */
974
+ profile: Profile;
975
+ /** Identity in effect immediately before; `null` if unknown. */
976
+ previousProfile: Profile | null;
977
+ reason: IdentityChangeReason;
978
+ /** `previousProfile?.id !== profile.id` — game state keyed on the old id is now orphaned. */
979
+ idChanged: boolean;
980
+ }
981
+ type IdentityChangedCallback = (event: IdentityChangedEvent) => void;
955
982
  interface LifecycleApi {
956
983
  /**
957
984
  * Registers a callback for when the game transitions from "idle" to "active" state.
@@ -1017,6 +1044,19 @@ interface LifecycleApi {
1017
1044
  * @returns Subscription object that can be used to unsubscribe from the event
1018
1045
  */
1019
1046
  onBackButton(callback: BackButtonCallback): Subscription;
1047
+ /**
1048
+ * Registers a callback for when the player's identity changes mid-session
1049
+ * (e.g. an anonymous player signs in without the game reloading).
1050
+ *
1051
+ * The host preserves the running game; this event lets the game react —
1052
+ * re-render the avatar, refetch user-scoped state, or re-issue a request
1053
+ * that previously required authentication. By the time the callback fires,
1054
+ * `RundotGameAPI.profile` already reflects the new identity.
1055
+ *
1056
+ * @param callback - Function to execute when identity changes
1057
+ * @returns Subscription object that can be used to unsubscribe from the event
1058
+ */
1059
+ onIdentityChanged(callback: IdentityChangedCallback): Subscription;
1020
1060
  }
1021
1061
 
1022
1062
  interface ExecuteRecipeOptions {
@@ -1558,6 +1598,29 @@ declare class RundotGameTransport implements RpcTransport {
1558
1598
  type Protocol = {
1559
1599
  type: string;
1560
1600
  };
1601
+ interface JoinTicketRequest {
1602
+ roomType: string;
1603
+ roomCode?: string;
1604
+ action: 'create' | 'joinOrCreate' | 'joinByCode';
1605
+ /**
1606
+ * Equality constraints for matchmaking. A candidate room matches iff every
1607
+ * key here exists on the room's stored criteria with a strictly-equal value.
1608
+ * Omitted (or `{}`) imposes no constraint — preserving pre-WS6 behavior.
1609
+ */
1610
+ criteria?: Record<string, string | number>;
1611
+ /** Options applied only when this ticket creates a new room. */
1612
+ createOptions?: {
1613
+ maxPlayers?: number;
1614
+ isPrivate?: boolean;
1615
+ metadata?: Record<string, unknown>;
1616
+ };
1617
+ }
1618
+ /**
1619
+ * Optional matchmaking/create knobs threaded through the client room APIs.
1620
+ * Both fields optional, so an omitted `RoomOptions` is the pre-WS6 path by
1621
+ * construction — no runtime "did the caller pass options" guard is needed.
1622
+ */
1623
+ type RoomOptions = Pick<JoinTicketRequest, 'criteria' | 'createOptions'>;
1561
1624
  /** Summary of a realtime room, as listed by `multiplayer.getUserRooms()`. */
1562
1625
  interface RealtimeRoomSummary {
1563
1626
  roomId: string;
@@ -1639,7 +1702,7 @@ interface MultiplayerApi {
1639
1702
  /**
1640
1703
  * Create a new room of the given type.
1641
1704
  */
1642
- createRoom<P extends Protocol>(roomType: string): Promise<ServerRoom<P>>;
1705
+ createRoom<P extends Protocol>(roomType: string, opts?: RoomOptions): Promise<ServerRoom<P>>;
1643
1706
  /**
1644
1707
  * Join a room by its 6-char code.
1645
1708
  */
@@ -1647,7 +1710,7 @@ interface MultiplayerApi {
1647
1710
  /**
1648
1711
  * Join an existing room or create a new one (matchmaking by room type).
1649
1712
  */
1650
- joinOrCreateRoom<P extends Protocol>(roomType: string): Promise<ServerRoom<P>>;
1713
+ joinOrCreateRoom<P extends Protocol>(roomType: string, opts?: RoomOptions): Promise<ServerRoom<P>>;
1651
1714
  /**
1652
1715
  * List the realtime rooms the current user is a member of.
1653
1716
  */
@@ -2864,6 +2927,107 @@ interface EntitlementApi {
2864
2927
  getLedger(entitlementId?: string, limit?: number, startAfter?: number): Promise<LedgerEntry[]>;
2865
2928
  }
2866
2929
 
2930
+ /**
2931
+ * Information returned when a stat submission triggers one or more rule
2932
+ * evaluations server-side. Mirrors the cloud-run GrantInfo type in
2933
+ * server/cloud-run/src/types/collectibles.ts.
2934
+ *
2935
+ * Most submissions resolve with an empty `grants` array — only stats wired to
2936
+ * a collectible rule produce grants. RUN.tv consumers use `grants` to drive
2937
+ * the reveal overlay; fire-and-forget callers can ignore it.
2938
+ */
2939
+ interface GrantInfo {
2940
+ /** Card identifier (= entitlementId on the platform). */
2941
+ cardId: string;
2942
+ /** Rule that fired to produce this grant. */
2943
+ ruleId: string;
2944
+ /** Card type from the catalog. 'vip' and 'premium' grants do not flow
2945
+ * through stats.submit and so do not appear here. */
2946
+ type: 'free' | 'completion';
2947
+ /** Source of the trigger for analytics attribution. */
2948
+ source: 'watch' | 'completion_reward';
2949
+ }
2950
+ interface StatsApi {
2951
+ /**
2952
+ * Submit a stat value for the current user in this game. Schemaless — any
2953
+ * `(statId, value)` pair is accepted. The server stores last-write-wins.
2954
+ *
2955
+ * Resolves with `{ grants }` containing the cards granted by rule evaluation
2956
+ * for **this specific statId**. The array is empty for stats with no rules,
2957
+ * or when this stat's rules did not fire.
2958
+ *
2959
+ * Submits issued within the same synchronous tick coalesce into a single
2960
+ * round-trip (per-stat last-write-wins on `value`). Each caller's promise
2961
+ * resolves or rejects based on their own statId's outcome — callers do not
2962
+ * observe grants from other stats in the same batch, even if one is
2963
+ * submitted next to theirs.
2964
+ *
2965
+ * For most game use cases the result can be ignored — the platform records
2966
+ * grants server-side regardless and consumers (like RUN.tv's Profile)
2967
+ * refresh entitlements on a separate cadence. Consumers that drive a
2968
+ * reveal-overlay UX synchronous with the submit await the grants.
2969
+ */
2970
+ submit(statId: string, value: number): Promise<{
2971
+ grants: GrantInfo[];
2972
+ }>;
2973
+ /** Get the current value of a stat, or `null` if never submitted. */
2974
+ getValue(statId: string): Promise<number | null>;
2975
+ /** Get all stat values for the current user in this game as a flat map. */
2976
+ getAllValues(): Promise<Record<string, number>>;
2977
+ }
2978
+
2979
+ /**
2980
+ * Card catalog entry. Mirrors the cloud-run CollectibleCard shape — the same
2981
+ * data that gets authored in a game's `.rundot/collectibles.config.json`.
2982
+ *
2983
+ * The SDK does not interpret these fields; they are passed through to the
2984
+ * consumer for rendering. `artPath` / `thumbPath` are CDN-relative — resolve
2985
+ * them via `RundotGameAPI.cdn.resolveAssetUrl` before display.
2986
+ */
2987
+ interface CollectibleCard {
2988
+ cardId: string;
2989
+ storyId: string;
2990
+ episodeId?: string;
2991
+ type: 'free' | 'premium' | 'vip' | 'completion';
2992
+ rarity: 'common' | 'rare' | 'epic' | 'legendary';
2993
+ title: string;
2994
+ description: string;
2995
+ artPath: string;
2996
+ thumbPath: string;
2997
+ lockedArtPath?: string;
2998
+ priceRbOverride?: number;
2999
+ limitedTimeEnd?: string;
3000
+ }
3001
+ /** Result of a VIP card claim. */
3002
+ interface VipClaimResult {
3003
+ granted: boolean;
3004
+ cardId: string;
3005
+ }
3006
+ interface CollectiblesApi {
3007
+ /**
3008
+ * Fetch the deployed card catalog for the current game. Returns every card
3009
+ * authored in `.rundot/collectibles.config.json` — both owned and unowned
3010
+ * from the user's perspective. Pair with `RundotGameAPI.entitlements.*` to
3011
+ * decide which cards the player currently owns.
3012
+ *
3013
+ * Typically called once on game init and cached client-side; the catalog
3014
+ * only changes on the next `rundot deploy`.
3015
+ */
3016
+ listCards(): Promise<CollectibleCard[]>;
3017
+ /**
3018
+ * Claim a VIP card for the current user. The server validates that the
3019
+ * user is an active subscriber AND has completed the requested series (via
3020
+ * the `series_completed_{seriesId}` stat), then grants the matching card
3021
+ * entitlement directly — no rule engine, no client-writable trigger stat
3022
+ * in between.
3023
+ *
3024
+ * Rejects with an error when the server returns 403 (subscription required)
3025
+ * or 400 (series not completed / card mismatch / unknown card). Consumers
3026
+ * typically translate the error message into a toast.
3027
+ */
3028
+ claimVipCard(seriesId: string, cardId: string): Promise<VipClaimResult>;
3029
+ }
3030
+
2867
3031
  interface StorefrontItem {
2868
3032
  itemId: string;
2869
3033
  name: string;
@@ -3506,6 +3670,8 @@ interface Host {
3506
3670
  readonly spriteGen: SpriteGenApi;
3507
3671
  readonly threeDGen: ThreeDGenApi;
3508
3672
  readonly entitlements: EntitlementApi;
3673
+ readonly stats: StatsApi;
3674
+ readonly collectibles: CollectiblesApi;
3509
3675
  readonly shop: ShopApi;
3510
3676
  readonly accessGate: AccessGateApi;
3511
3677
  readonly multiplayer: MultiplayerApi;
@@ -4020,6 +4186,8 @@ interface RundotGameAPI {
4020
4186
  spriteGen: SpriteGenApi;
4021
4187
  threeDGen: ThreeDGenApi;
4022
4188
  entitlements: EntitlementApi;
4189
+ stats: StatsApi;
4190
+ collectibles: CollectiblesApi;
4023
4191
  shop: ShopApi;
4024
4192
  accessGate: AccessGateApi;
4025
4193
  video: VideoApi;
@@ -4048,4 +4216,4 @@ interface AdsApi {
4048
4216
  showInterstitialAd(options?: ShowInterstitialAdOptions): Promise<boolean>;
4049
4217
  }
4050
4218
 
4051
- export { type AddToHomeScreenResult 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 ShowInterstitialAdOptions as O, type Profile as P, type QuitOptions as Q, type RundotGameAPI as R, type SimulationActiveRunsUpdate as S, type ShowRewardedAdOptions as T, type ProfileApi as U, type DeviceApi as V, type DeviceInfo as W, type EnvironmentApi as X, type EnvironmentInfo as Y, type SystemApi as Z, type SafeArea as _, type RecipeRequirementQuery as a, type ProposeMoveResult as a$, type CdnApi as a0, type FetchFromCdnOptions as a1, type AssetUrlResult as a2, type TimeApi as a3, type ServerTimeData as a4, type GetFutureTimeOptions as a5, type AiApi as a6, type AiChatCompletionRequest as a7, type AiChatCompletionData as a8, type AiChatCompletionStreamOptions as a9, type SimulationState as aA, type ExecuteRecipeOptions as aB, type ExecuteRecipeResponse as aC, type CollectRecipeResult as aD, type ResetStateOptions as aE, type ResetStateResult as aF, type GetActiveRunsOptions as aG, type ExecuteScopedRecipeOptions as aH, type ExecuteScopedRecipeResult as aI, type GetAvailableRecipesOptions as aJ, type GetAvailableRecipesResult as aK, type Recipe as aL, type GetBatchRecipeRequirements as aM, type TriggerRecipeChainOptions as aN, type RoomDataUpdate as aO, type RoomMessageEvent as aP, type ProposedMoveEvent as aQ, RundotGameTransport as aR, type RoomsApi as aS, type CreateRoomOptions as aT, type JoinOrCreateRoomOptions as aU, type JoinOrCreateResult as aV, type ListRoomsOptions as aW, type UpdateRoomDataOptions as aX, type RoomMessageRequest as aY, type StartRoomGameOptions as aZ, type ProposeMoveRequest as a_, type AiChatCompletionStreamChunk as aa, type HapticsApi as ab, HapticFeedbackStyle as ac, type GamepadSnapshot as ad, type GamepadConnectionEvent as ae, type Subscription as af, type GamepadApi as ag, type GamepadLatencyStats as ah, type FeaturesApi as ai, type Experiment as aj, type LifecycleApi as ak, type SleepCallback as al, type AwakeCallback as am, type PauseCallback as an, type ResumeCallback as ao, type QuitCallback as ap, type BackButtonCallback as aq, type SimulationApi as ar, type SimulationSlotValidationResult as as, type SimulationBatchOperation as at, type SimulationBatchOperationsResult as au, type SimulationAvailableItem as av, type SimulationPowerPreview as aw, type SimulationSlotMutationResult as ax, type SimulationSlotContainer as ay, type SimulationAssignment as az, type RecipeRequirementResult as b, type ThreeDGenEntry as b$, type ValidateMoveVerdict as b0, type ValidateMoveResult as b1, type RoomSubscriptionOptions as b2, type LoggingApi as b3, type IapApi as b4, type SpendCurrencyOptions as b5, type SpendCurrencyResult as b6, type SubscriptionTier as b7, type RunSubscriptionsResponse as b8, type SubscriptionInterval as b9, type UgcApi as bA, type MultiplayerApi as bB, type VideoApi as bC, type AppApi as bD, type AdminUgcApi as bE, type AdminImageGenApi as bF, type AdminVideoGenApi as bG, type AdminSpriteGenApi as bH, type AdminAudioGenApi as bI, type AdminThreeDGenApi as bJ, type AppRole as bK, type ResolveLaunchIntentOptions as bL, type LaunchIntent as bM, type AdminUgcBrowseParams as bN, type AdminUgcBrowseResponse as bO, type AdminUgcListReportsParams as bP, type AdminUgcListReportsResponse as bQ, type AdminUgcResolveAction as bR, type AdminGenBrowseParams as bS, type AdminGenBrowseResponse as bT, type ImageGenEntry as bU, type AdminGenListReportsParams as bV, type AdminGenListReportsResponse as bW, type ImageGenReport as bX, type AdminGenResolveAction as bY, type SpriteGenEntry as bZ, type SpriteGenReport as b_, type PurchaseSubscriptionResponse as ba, type OpenStoreResult as bb, type LoadEmbeddedAssetsResponse as bc, type SharedAssetsApi as bd, type PreloaderApi as be, type SocialApi as bf, type ShareMetadata as bg, type ShareLinkResult as bh, type SocialQRCodeOptions as bi, type QRCodeResult as bj, type ShareClickData as bk, type ShareFileOptions as bl, type ShareFileResult as bm, type CanShareFileResult as bn, type EntitlementApi as bo, type Entitlement as bp, type LedgerEntry as bq, type ShopApi as br, type StorefrontResponse as bs, type StorefrontItem as bt, type ShopPurchaseResponse as bu, type ShopOrderHistoryResponse as bv, type PromptLoginResult as bw, type AccessTier as bx, type AccessGateApi as by, type TextGenApi as bz, type RundotGameAvailableRecipe as c, type GamepadAxes as c$, type ThreeDGenReport as c0, type Avatar3dApi as c1, type AssetManifest as c2, type Avatar3dConfig as c3, type ShowEditorOptions as c4, type Avatar3dEdits as c5, type AdsApi as c6, type SharedStorageHostApi as c7, type FilesApi as c8, type ClipsApi as c9, type AdminThreeDGenListReportsResponse as cA, type AdminThreeDGenResolveAction as cB, type AdminUgcEntry as cC, type AdminVideoGenBrowseParams as cD, type AdminVideoGenBrowseResponse as cE, type AdminVideoGenListReportsParams as cF, type AdminVideoGenListReportsResponse as cG, type AdminVideoGenResolveAction as cH, type AiContentBlock as cI, type AiImageContent as cJ, type AiImageUrlContent as cK, type AiMessage as cL, type AiResponseFormat as cM, type AiTextContent as cN, type AiToolResultContent as cO, type AiToolUseContent as cP, type Asset as cQ, type AudioGenEntry as cR, type AudioGenReport as cS, CLIP_CONTENT_TYPE as cT, type Category as cU, type ClipAudioOptions as cV, type ClipCameraOptions as cW, type ClipPipLayout as cX, type ClipPipPosition as cY, type ConnectionState as cZ, GAMEPAD_BUTTON_NAMES as c_, type AttributionApi as ca, type InitializationContext as cb, type InitializationOptions as cc, type CaptureConsent as cd, type StartClipRecordingOptions as ce, type ClipBlob as cf, type ClipsSupport as cg, type ClipPersistOptions as ch, type ClipResult as ci, type UgcEntry as cj, type CaptureConsentStatus as ck, AccessDeniedError as cl, type AdminGenApi as cm, type AdminImageGenBrowseParams as cn, type AdminImageGenBrowseResponse as co, type AdminImageGenListReportsParams as cp, type AdminImageGenListReportsResponse as cq, type AdminImageGenResolveAction as cr, type AdminSpriteGenBrowseParams as cs, type AdminSpriteGenBrowseResponse as ct, type AdminSpriteGenListReportsParams as cu, type AdminSpriteGenListReportsResponse as cv, type AdminSpriteGenResolveAction as cw, type AdminThreeDGenBrowseParams as cx, type AdminThreeDGenBrowseResponse as cy, type AdminThreeDGenListReportsParams as cz, type RundotGameCollectRecipeResult as d, type VideoGenEntry as d$, type GamepadButtonName as d0, type GamepadButtonState as d1, type GamepadSource as d2, type GetSubscriptionsForTierRequest as d3, type HudInsets as d4, type InboundForKeyEntry as d5, type InboundMethodIds as d6, type InboundStorageApi as d7, type IsPlayerSubscribedRequest as d8, type JoinOrCreateRoomEnvelopeResponse as d9, type RpcTransport as dA, type RunSubscription as dB, type RundotGameRoomCustomMetadata as dC, type RundotGameRoomPayload as dD, type RundotGameRoomRules as dE, type RundotGameRoomRulesGameState as dF, SHARE_FILE_ALLOWED_MIME_TYPES as dG, SHARE_FILE_MAX_SIZE_BYTES as dH, type ScheduleRCSStatus as dI, type ServerPlayer as dJ, type ServerRoom as dK, type ShareFileMimeType as dL, type ShopOrder as dM, type SimulationBatchOperationAssign as dN, type SimulationBatchOperationRemove as dO, type SimulationBatchOperationResult as dP, type SimulationPersonalState as dQ, type SimulationRoomActiveRecipe as dR, type SimulationRoomState as dS, type StorefrontCollection as dT, type StorefrontCollectionItem as dU, type SubPath as dV, type Tool as dW, type ToolChoice as dX, type ToolUse as dY, type TimeIntervalTriggerInput as dZ, type UgcReport as d_, type JoinRoomMatchCriteria as da, type LaunchIntentKind as db, type ListUserRoomsOptions as dc, type LoadEmbeddedAssetsRequest as dd, MockAvatarApi as de, type NotificationTriggerInput as df, type OnNotificationCallback as dg, type OnRequestCallback as dh, type OnResponseCallback as di, type ProposedMovePayload as dj, type Protocol as dk, type PurchaseSubscriptionRequest as dl, type RCSAvailabilityReason as dm, type RCSOptInStatus as dn, ROOM_GAME_PHASES as dp, type RealtimeRoomSummary as dq, type RecipeInfo as dr, type RoomEnvelopeResponse as ds, type RoomEvents as dt, type RoomGamePhase as du, type RoomMessageEventType as dv, type RoomMessagePayload as dw, type RoomsEnvelopeResponse as dx, RpcInboundStorageApi as dy, RpcSharedAssetsApi as dz, type RundotGameExecuteRecipeOptions as e, type VideoGenReport as e0, createHost as e1, resolveCollectionItemPrice as e2, 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 };
4219
+ export { type AddToHomeScreenResult 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 ShowInterstitialAdOptions as O, type Profile as P, type QuitOptions as Q, type RundotGameAPI as R, type SimulationActiveRunsUpdate as S, type ShowRewardedAdOptions as T, type ProfileApi as U, type DeviceApi as V, type DeviceInfo as W, type EnvironmentApi as X, type EnvironmentInfo as Y, type SystemApi as Z, type SafeArea as _, type RecipeRequirementQuery as a, type StartRoomGameOptions as a$, type CdnApi as a0, type FetchFromCdnOptions as a1, type AssetUrlResult as a2, type TimeApi as a3, type ServerTimeData as a4, type GetFutureTimeOptions as a5, type AiApi as a6, type AiChatCompletionRequest as a7, type AiChatCompletionData as a8, type AiChatCompletionStreamOptions as a9, type SimulationSlotContainer as aA, type SimulationAssignment as aB, type SimulationState as aC, type ExecuteRecipeOptions as aD, type ExecuteRecipeResponse as aE, type CollectRecipeResult as aF, type ResetStateOptions as aG, type ResetStateResult as aH, type GetActiveRunsOptions as aI, type ExecuteScopedRecipeOptions as aJ, type ExecuteScopedRecipeResult as aK, type GetAvailableRecipesOptions as aL, type GetAvailableRecipesResult as aM, type Recipe as aN, type GetBatchRecipeRequirements as aO, type TriggerRecipeChainOptions as aP, type RoomDataUpdate as aQ, type RoomMessageEvent as aR, type ProposedMoveEvent as aS, RundotGameTransport as aT, type RoomsApi as aU, type CreateRoomOptions as aV, type JoinOrCreateRoomOptions as aW, type JoinOrCreateResult as aX, type ListRoomsOptions as aY, type UpdateRoomDataOptions as aZ, type RoomMessageRequest as a_, type AiChatCompletionStreamChunk as aa, type HapticsApi as ab, HapticFeedbackStyle as ac, type GamepadSnapshot as ad, type GamepadConnectionEvent as ae, type Subscription as af, type GamepadApi as ag, type GamepadLatencyStats as ah, type FeaturesApi as ai, type Experiment as aj, type LifecycleApi as ak, type SleepCallback as al, type AwakeCallback as am, type PauseCallback as an, type ResumeCallback as ao, type QuitCallback as ap, type BackButtonCallback as aq, type IdentityChangedCallback as ar, type IdentityChangedEvent as as, type SimulationApi as at, type SimulationSlotValidationResult as au, type SimulationBatchOperation as av, type SimulationBatchOperationsResult as aw, type SimulationAvailableItem as ax, type SimulationPowerPreview as ay, type SimulationSlotMutationResult as az, type RecipeRequirementResult as b, type ImageGenEntry as b$, type ProposeMoveRequest as b0, type ProposeMoveResult as b1, type ValidateMoveVerdict as b2, type ValidateMoveResult as b3, type RoomSubscriptionOptions as b4, type LoggingApi as b5, type IapApi as b6, type SpendCurrencyOptions as b7, type SpendCurrencyResult as b8, type SubscriptionTier as b9, type StorefrontItem as bA, type ShopPurchaseResponse as bB, type ShopOrderHistoryResponse as bC, type PromptLoginResult as bD, type AccessTier as bE, type AccessGateApi as bF, type TextGenApi as bG, type UgcApi as bH, type MultiplayerApi as bI, type VideoApi as bJ, type AppApi as bK, type AdminUgcApi as bL, type AdminImageGenApi as bM, type AdminVideoGenApi as bN, type AdminSpriteGenApi as bO, type AdminAudioGenApi as bP, type AdminThreeDGenApi as bQ, type AppRole as bR, type ResolveLaunchIntentOptions as bS, type LaunchIntent as bT, type AdminUgcBrowseParams as bU, type AdminUgcBrowseResponse as bV, type AdminUgcListReportsParams as bW, type AdminUgcListReportsResponse as bX, type AdminUgcResolveAction as bY, type AdminGenBrowseParams as bZ, type AdminGenBrowseResponse as b_, type RunSubscriptionsResponse as ba, type SubscriptionInterval as bb, type PurchaseSubscriptionResponse as bc, type OpenStoreResult as bd, type LoadEmbeddedAssetsResponse as be, type SharedAssetsApi as bf, type PreloaderApi as bg, type SocialApi as bh, type ShareMetadata as bi, type ShareLinkResult as bj, type SocialQRCodeOptions as bk, type QRCodeResult as bl, type ShareClickData as bm, type ShareFileOptions as bn, type ShareFileResult as bo, type CanShareFileResult as bp, type EntitlementApi as bq, type Entitlement as br, type LedgerEntry as bs, type StatsApi as bt, type GrantInfo as bu, type CollectiblesApi as bv, type CollectibleCard as bw, type VipClaimResult as bx, type ShopApi as by, type StorefrontResponse as bz, type RundotGameAvailableRecipe as c, type Category as c$, type AdminGenListReportsParams as c0, type AdminGenListReportsResponse as c1, type ImageGenReport as c2, type AdminGenResolveAction as c3, type SpriteGenEntry as c4, type SpriteGenReport as c5, type ThreeDGenEntry as c6, type ThreeDGenReport as c7, type Avatar3dApi as c8, type AssetManifest as c9, type AdminSpriteGenBrowseResponse as cA, type AdminSpriteGenListReportsParams as cB, type AdminSpriteGenListReportsResponse as cC, type AdminSpriteGenResolveAction as cD, type AdminThreeDGenBrowseParams as cE, type AdminThreeDGenBrowseResponse as cF, type AdminThreeDGenListReportsParams as cG, type AdminThreeDGenListReportsResponse as cH, type AdminThreeDGenResolveAction as cI, type AdminUgcEntry as cJ, type AdminVideoGenBrowseParams as cK, type AdminVideoGenBrowseResponse as cL, type AdminVideoGenListReportsParams as cM, type AdminVideoGenListReportsResponse as cN, type AdminVideoGenResolveAction as cO, type AiContentBlock as cP, type AiImageContent as cQ, type AiImageUrlContent as cR, type AiMessage as cS, type AiResponseFormat as cT, type AiTextContent as cU, type AiToolResultContent as cV, type AiToolUseContent as cW, type Asset as cX, type AudioGenEntry as cY, type AudioGenReport as cZ, CLIP_CONTENT_TYPE as c_, type Avatar3dConfig as ca, type ShowEditorOptions as cb, type Avatar3dEdits as cc, type AdsApi as cd, type SharedStorageHostApi as ce, type FilesApi as cf, type ClipsApi as cg, type AttributionApi as ch, type InitializationContext as ci, type InitializationOptions as cj, type CaptureConsent as ck, type StartClipRecordingOptions as cl, type ClipBlob as cm, type ClipsSupport as cn, type ClipPersistOptions as co, type ClipResult as cp, type UgcEntry as cq, type CaptureConsentStatus as cr, AccessDeniedError as cs, type AdminGenApi as ct, type AdminImageGenBrowseParams as cu, type AdminImageGenBrowseResponse as cv, type AdminImageGenListReportsParams as cw, type AdminImageGenListReportsResponse as cx, type AdminImageGenResolveAction as cy, type AdminSpriteGenBrowseParams as cz, type RundotGameCollectRecipeResult as d, type StorefrontCollection as d$, type ClipAudioOptions as d0, type ClipCameraOptions as d1, type ClipPipLayout as d2, type ClipPipPosition as d3, type ConnectionState as d4, GAMEPAD_BUTTON_NAMES as d5, type GamepadAxes as d6, type GamepadButtonName as d7, type GamepadButtonState as d8, type GamepadSource as d9, type RoomEnvelopeResponse as dA, type RoomEvents as dB, type RoomGamePhase as dC, type RoomMessageEventType as dD, type RoomMessagePayload as dE, type RoomsEnvelopeResponse as dF, RpcInboundStorageApi as dG, RpcSharedAssetsApi as dH, type RpcTransport as dI, type RunSubscription as dJ, type RundotGameRoomCustomMetadata as dK, type RundotGameRoomPayload as dL, type RundotGameRoomRules as dM, type RundotGameRoomRulesGameState as dN, SHARE_FILE_ALLOWED_MIME_TYPES as dO, SHARE_FILE_MAX_SIZE_BYTES as dP, type ScheduleRCSStatus as dQ, type ServerPlayer as dR, type ServerRoom as dS, type ShareFileMimeType as dT, type ShopOrder as dU, type SimulationBatchOperationAssign as dV, type SimulationBatchOperationRemove as dW, type SimulationBatchOperationResult as dX, type SimulationPersonalState as dY, type SimulationRoomActiveRecipe as dZ, type SimulationRoomState as d_, type GetSubscriptionsForTierRequest as da, type HudInsets as db, type IdentityChangeReason as dc, type InboundForKeyEntry as dd, type InboundMethodIds as de, type InboundStorageApi as df, type IsPlayerSubscribedRequest as dg, type JoinOrCreateRoomEnvelopeResponse as dh, type JoinRoomMatchCriteria as di, type LaunchIntentKind as dj, type ListUserRoomsOptions as dk, type LoadEmbeddedAssetsRequest as dl, MockAvatarApi as dm, type NotificationTriggerInput as dn, type OnNotificationCallback as dp, type OnRequestCallback as dq, type OnResponseCallback as dr, type ProposedMovePayload as ds, type Protocol as dt, type PurchaseSubscriptionRequest as du, type RCSAvailabilityReason as dv, type RCSOptInStatus as dw, ROOM_GAME_PHASES as dx, type RealtimeRoomSummary as dy, type RecipeInfo as dz, type RundotGameExecuteRecipeOptions as e, type StorefrontCollectionItem as e0, type SubPath as e1, type Tool as e2, type ToolChoice as e3, type ToolUse as e4, type TimeIntervalTriggerInput as e5, type UgcReport as e6, type VideoGenEntry as e7, type VideoGenReport as e8, createHost as e9, resolveCollectionItemPrice as ea, 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 };
@@ -603,6 +603,13 @@ interface SubmitScoreParams {
603
603
  */
604
604
  hash?: string;
605
605
  }
606
+ /**
607
+ * Machine-readable reason a submit was not accepted.
608
+ * - `identity_changed`: the score token was minted under a different identity
609
+ * (the player signed into another account mid-session). Re-mint with
610
+ * `createScoreToken()` and resubmit under the new identity.
611
+ */
612
+ type SubmitScoreFailureReason = 'identity_changed';
606
613
  interface SubmitScoreResult {
607
614
  accepted: boolean;
608
615
  rank?: number | null;
@@ -610,6 +617,8 @@ interface SubmitScoreResult {
610
617
  isAnomaly?: boolean;
611
618
  /** Human-readable explanation when `accepted` is false (e.g., keep-best rejection). */
612
619
  reason?: string | null;
620
+ /** Machine-readable failure reason the game can branch on, when applicable. */
621
+ failureReason?: SubmitScoreFailureReason;
613
622
  }
614
623
  interface GetPagedScoresOptions {
615
624
  mode?: string;
@@ -684,4 +693,4 @@ interface LeaderboardApi {
684
693
  getPodiumScores(options?: GetPodiumScoresOptions): Promise<PodiumScoresResponse>;
685
694
  }
686
695
 
687
- 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, UpscaleImageModel as a9, 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 };
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 };
@@ -16,7 +16,8 @@ var HttpImageGenApi = class {
16
16
  method: "POST",
17
17
  headers: {
18
18
  "Content-Type": "application/json",
19
- "Authorization": `Bearer ${idToken}`
19
+ "Authorization": `Bearer ${idToken}`,
20
+ "x-consumer": "sdk"
20
21
  },
21
22
  body: JSON.stringify(body)
22
23
  });
@@ -402,5 +403,5 @@ var HttpLeaderboardApi = class {
402
403
  };
403
404
 
404
405
  export { HttpAudioGenApi, HttpImageGenApi, HttpLeaderboardApi, HttpSpriteGenApi, HttpThreeDGenApi, HttpVideoGenApi };
405
- //# sourceMappingURL=chunk-4YOCLVRI.js.map
406
- //# sourceMappingURL=chunk-4YOCLVRI.js.map
406
+ //# sourceMappingURL=chunk-BJGV6WIK.js.map
407
+ //# sourceMappingURL=chunk-BJGV6WIK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/imageGen/HttpImageGenApi.ts","../src/audioGen/HttpAudioGenApi.ts","../src/videoGen/HttpVideoGenApi.ts","../src/spriteGen/HttpSpriteGen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OAAA,EAAS,SAAS,OAAA,IAAW,UAAA;AAAA,MAC7B,UAAU,OAAA,EAAS,QAAA;AAAA,MACnB,cAAc,OAAA,EAAS,YAAA;AAAA,MACvB,eAAe,OAAA,EAAS;AAAA,KACzB,CAAA;AACD,IAAA,OAAO,wBAAwB,GAAG,CAAA;AAAA,EACpC;AAAA,EAEA,MAAM,UAAU,OAAA,EAAwD;AACtE,IAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,UAAA,CAA6B,cAAA,EAAgB;AAAA,MAClE,OAAO,IAAA,CAAK,KAAA;AAAA,MACZ,IAAA,EAAM,SAAS,IAAA,IAAQ,SAAA;AAAA,MACvB,MAAA,EAAQ,SAAS,MAAA,IAAU,SAAA;AAAA,MAC3B,YAAY,OAAA,EAAS;AAAA,KACtB,CAAA;AACD,IAAA,OAAO,wBAAwB,GAAG,CAAA;AAAA,EACpC;AAAA,EAEA,MAAM,gBAAgB,OAAA,EAAiE;AACrF,IAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,UAAA,CAAiC,oBAAA,EAAsB;AAAA,MAC5E,OAAO,IAAA,CAAK,KAAA;AAAA,MACZ,IAAA,EAAM,SAAS,IAAA,IAAQ,SAAA;AAAA,MACvB,MAAA,EAAQ,SAAS,MAAA,IAAU,SAAA;AAAA,MAC3B,YAAY,OAAA,EAAS,UAAA;AAAA,MACrB,UAAU,OAAA,EAAS,QAAA;AAAA,MACnB,cAAc,OAAA,EAAS,YAAA;AAAA,MACvB,eAAe,OAAA,EAAS;AAAA,KACzB,CAAA;AACD,IAAA,OAAO,wBAAwB,GAAG,CAAA;AAAA,EACpC;AACF","file":"chunk-BJGV6WIK.js","sourcesContent":["// Host-facing HTTP implementation of ImageGenApi. Firebase-free: auth + base URL\n// come from the injected BackendHttpDeps, so any host (SandboxHost, Telegram/Steam\n// shells) can construct it. Do NOT import from barrel exports (imageGen/index.ts).\n\nimport { ImageGenApi, ImageGenParams, ImageGenResult, ImageGenJobEvent, DepthEstimationParams, DepthEstimationResult, RemoveBackgroundParams, RemoveBackgroundResult, UpscaleImageParams, UpscaleImageResult } from './ImageGenApi';\nimport type { BackendHttpDeps } from '../http/backendHttpDeps';\n\nexport class HttpImageGenApi implements ImageGenApi {\n private readonly appId: string;\n private readonly deps: BackendHttpDeps;\n\n constructor(appId: string, deps: BackendHttpDeps) {\n this.appId = appId;\n this.deps = deps;\n }\n\n private async authedPost<T>(path: string, body: Record<string, unknown>): Promise<T> {\n const idToken = await this.deps.getIdToken();\n const baseUrl = this.deps.getCloudRunUrl();\n const url = `${baseUrl}/v1/imagegen/${this.appId}/${path}`;\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${idToken}`,\n 'x-consumer': 'sdk',\n },\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n const errorText = await response.text();\n let errorMessage = `Request failed (${response.status})`;\n try {\n const errorJson = JSON.parse(errorText);\n errorMessage = errorJson.error || errorJson.message || errorMessage;\n } catch {\n if (errorText) errorMessage = errorText;\n }\n throw new Error(errorMessage);\n }\n\n return response.json();\n }\n\n async generate(params: ImageGenParams): Promise<ImageGenResult> {\n return this.authedPost<ImageGenResult>('generate', params as unknown as Record<string, unknown>);\n }\n\n async estimateDepth(params: DepthEstimationParams): Promise<DepthEstimationResult> {\n return this.authedPost<DepthEstimationResult>('estimate-depth', params as unknown as Record<string, unknown>);\n }\n\n async removeBackground(params: RemoveBackgroundParams): Promise<RemoveBackgroundResult> {\n return this.authedPost<RemoveBackgroundResult>('remove-background', params as unknown as Record<string, unknown>);\n }\n\n async upscaleImage(params: UpscaleImageParams): Promise<UpscaleImageResult> {\n return this.authedPost<UpscaleImageResult>('upscale-image', params as unknown as Record<string, unknown>);\n }\n\n async getCompletedJobs(): Promise<ImageGenJobEvent[]> {\n return [];\n }\n}\n","// Host-facing HTTP implementation of AudioGenApi. Firebase-free: auth + base URL\n// come from the injected BackendHttpDeps. Do NOT import from barrel exports\n// (audioGen/index.ts).\n\nimport {\n AudioGenApi,\n AudioGenParams,\n AudioGenResult,\n AudioGenJobEvent,\n ListVoicesResult,\n DesignVoicesParams,\n DesignVoicesResult,\n SaveDesignedVoiceParams,\n SaveDesignedVoiceResult,\n} from './AudioGenApi';\nimport { RundotApiError, RateLimitedError } from '../errors';\nimport type { BackendHttpDeps } from '../http/backendHttpDeps';\n\nexport class HttpAudioGenApi implements AudioGenApi {\n private readonly appId: string;\n private readonly deps: BackendHttpDeps;\n\n constructor(appId: string, deps: BackendHttpDeps) {\n this.appId = appId;\n this.deps = deps;\n }\n\n private async authedFetch(path: string, method: string, body?: unknown): Promise<Response> {\n const idToken = await this.deps.getIdToken();\n const baseUrl = this.deps.getCloudRunUrl();\n const url = `${baseUrl}/v1/audiogen/${this.appId}/${path}`;\n\n const response = await fetch(url, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${idToken}`,\n },\n ...(body !== undefined ? { body: JSON.stringify(body) } : {}),\n });\n\n if (!response.ok) {\n if (response.status === 429) {\n const retryAfterSec = parseInt(response.headers.get('Retry-After') ?? '60', 10);\n throw new RateLimitedError(retryAfterSec * 1000);\n }\n const errorText = await response.text();\n let errorMessage = `Audio generation failed (${response.status})`;\n let errorCode = 'UNKNOWN';\n try {\n const errorJson = JSON.parse(errorText) as Record<string, unknown>;\n errorMessage = (errorJson.error ?? errorJson.message ?? errorMessage) as string;\n if (typeof errorJson.code === 'string') errorCode = errorJson.code;\n } catch {\n if (errorText) errorMessage = errorText;\n }\n throw new RundotApiError(errorCode, errorMessage, response.status);\n }\n\n return response;\n }\n\n async generate(params: AudioGenParams): Promise<AudioGenResult> {\n const response = await this.authedFetch('generate', 'POST', params);\n return response.json();\n }\n\n async getCompletedJobs(): Promise<AudioGenJobEvent[]> {\n return [];\n }\n\n async listVoices(): Promise<ListVoicesResult> {\n const response = await this.authedFetch('voices', 'GET');\n return response.json();\n }\n\n async designVoices(params: DesignVoicesParams): Promise<DesignVoicesResult> {\n const response = await this.authedFetch('voices/design', 'POST', params);\n return response.json();\n }\n\n async saveDesignedVoice(params: SaveDesignedVoiceParams): Promise<SaveDesignedVoiceResult> {\n const response = await this.authedFetch('voices/save', 'POST', params);\n return response.json();\n }\n}\n","// Host-facing HTTP implementation of VideoGenApi. Firebase-free: auth + base URL\n// come from the injected BackendHttpDeps. Do NOT import from barrel exports\n// (videoGen/index.ts).\n\nimport { VideoGenApi, VideoGenParams, VideoGenResult, VideoGenJobEvent, VideoGenJobStartedEvent } from './VideoGenApi'\nimport type { BackendHttpDeps } from '../http/backendHttpDeps'\n\nexport class HttpVideoGenApi implements VideoGenApi {\n private readonly appId: string\n private readonly deps: BackendHttpDeps\n\n constructor(appId: string, deps: BackendHttpDeps) {\n this.appId = appId\n this.deps = deps\n }\n\n async generate(params: VideoGenParams): Promise<VideoGenResult> {\n const idToken = await this.deps.getIdToken()\n const baseUrl = this.deps.getCloudRunUrl()\n const url = `${baseUrl}/v1/videogen/${this.appId}/sync-generate`\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${idToken}`,\n },\n body: JSON.stringify(params),\n })\n\n if (!response.ok) {\n const errorText = await response.text()\n let errorMessage = `Video generation failed (${response.status})`\n try {\n const errorJson = JSON.parse(errorText)\n errorMessage = errorJson.error || errorJson.message || errorMessage\n } catch {\n if (errorText) errorMessage = errorText\n }\n throw new Error(errorMessage)\n }\n\n return response.json()\n }\n\n async getCompletedJobs(): Promise<VideoGenJobEvent[]> {\n return []\n }\n\n async cancel(jobId: string): Promise<void> {\n const idToken = await this.deps.getIdToken()\n const baseUrl = this.deps.getCloudRunUrl()\n const url = `${baseUrl}/v1/jobs/${this.appId}/${jobId}/cancel`\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${idToken}`,\n },\n })\n\n if (!response.ok) {\n const errorText = await response.text()\n let errorMessage = `Job cancellation failed (${response.status})`\n try {\n const errorJson = JSON.parse(errorText)\n errorMessage = errorJson.error || errorJson.message || errorMessage\n } catch {\n if (errorText) errorMessage = errorText\n }\n throw new Error(errorMessage)\n }\n }\n\n onJobStarted(_callback: (event: VideoGenJobStartedEvent) => void): { unsubscribe: () => void } {\n return { unsubscribe: () => {} }\n }\n}\n","// Host-facing HTTP implementation of SpriteGenApi. Firebase-free: auth + base URL\n// come from the injected BackendHttpDeps.\n\nimport { SpriteGenApi, SpriteGenParams, SpriteGenResult, AnimateSpriteParams, AnimateSpriteResult, SpriteGenJobEvent } from './SpriteGenApi';\nimport type { BackendHttpDeps } from '../http/backendHttpDeps';\n\nexport class HttpSpriteGenApi implements SpriteGenApi {\n private readonly appId: string;\n private readonly deps: BackendHttpDeps;\n\n constructor(appId: string, deps: BackendHttpDeps) {\n this.appId = appId;\n this.deps = deps;\n }\n\n async generate(params: SpriteGenParams): Promise<SpriteGenResult> {\n const idToken = await this.deps.getIdToken();\n const baseUrl = this.deps.getCloudRunUrl();\n const url = `${baseUrl}/v1/spritegen/${this.appId}/generate`;\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${idToken}`,\n },\n body: JSON.stringify(params),\n });\n\n if (!response.ok) {\n const errorText = await response.text();\n let errorMessage = `Sprite generation failed (${response.status})`;\n try {\n const errorJson = JSON.parse(errorText);\n errorMessage = errorJson.error || errorJson.message || errorMessage;\n } catch {\n if (errorText) errorMessage = errorText;\n }\n throw new Error(errorMessage);\n }\n\n return response.json();\n }\n\n async animate(params: AnimateSpriteParams): Promise<AnimateSpriteResult> {\n const idToken = await this.deps.getIdToken();\n const baseUrl = this.deps.getCloudRunUrl();\n const url = `${baseUrl}/v1/spritegen/${this.appId}/animate`;\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${idToken}`,\n },\n body: JSON.stringify(params),\n });\n\n if (!response.ok) {\n const errorText = await response.text();\n let errorMessage = `Sprite animation failed (${response.status})`;\n try {\n const errorJson = JSON.parse(errorText);\n errorMessage = errorJson.error || errorJson.message || errorMessage;\n } catch {\n if (errorText) errorMessage = errorText;\n }\n throw new Error(errorMessage);\n }\n\n return response.json();\n }\n\n async getCompletedJobs(): Promise<SpriteGenJobEvent[]> {\n return [];\n }\n}\n","// Host-facing HTTP implementation of ThreeDGenApi. Firebase-free: auth + base URL\n// come from the injected BackendHttpDeps. Do NOT import from barrel exports\n// (threeDGen/index.ts).\n\nimport {\n ThreeDGenApi,\n ThreeDGenParams,\n ThreeDGenResult,\n RemeshParams,\n RemeshResult,\n RigParams,\n RigResult,\n AnimateParams,\n AnimateResult,\n ThreeDGenJobEvent,\n} from './ThreeDGenApi'\nimport { RundotApiError } from '../errors'\nimport type { BackendHttpDeps } from '../http/backendHttpDeps'\n\nexport class HttpThreeDGenApi implements ThreeDGenApi {\n private readonly appId: string\n private readonly deps: BackendHttpDeps\n\n constructor(appId: string, deps: BackendHttpDeps) {\n this.appId = appId\n this.deps = deps\n }\n\n async generate(params: ThreeDGenParams): Promise<ThreeDGenResult> {\n return this.post<ThreeDGenResult>('sync-generate', params)\n }\n\n async remesh(params: RemeshParams): Promise<RemeshResult> {\n return this.post<RemeshResult>('sync-remesh', params)\n }\n\n async rig(params: RigParams): Promise<RigResult> {\n return this.post<RigResult>('sync-rig', params)\n }\n\n async animate(params: AnimateParams): Promise<AnimateResult> {\n return this.post<AnimateResult>('sync-animate', params)\n }\n\n async getCompletedJobs(): Promise<ThreeDGenJobEvent[]> {\n return []\n }\n\n private async post<T>(endpoint: string, body: unknown): Promise<T> {\n const idToken = await this.deps.getIdToken()\n const baseUrl = this.deps.getCloudRunUrl()\n const url = `${baseUrl}/v1/threedgen/${this.appId}/${endpoint}`\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${idToken}`,\n },\n body: JSON.stringify(body),\n })\n\n if (!response.ok) {\n const errorText = await response.text()\n let errorMessage = `3D generation failed (${response.status})`\n let errorCode = 'UNKNOWN'\n let detail: string | undefined\n try {\n const errorJson = JSON.parse(errorText) as Record<string, unknown>\n errorMessage = (errorJson.error ?? errorJson.message ?? errorMessage) as string\n if (typeof errorJson.code === 'string') errorCode = errorJson.code\n if (typeof errorJson.detail === 'string') detail = errorJson.detail\n } catch {\n if (errorText) errorMessage = errorText\n }\n throw new RundotApiError(errorCode, errorMessage, response.status, detail)\n }\n\n return response.json()\n }\n}\n","/**\n * Idempotently convert Firestore-serialized timestamps to epoch millis on\n * leaderboard score responses. Leaderboard endpoints serialize Firestore\n * Timestamps as `{ seconds, nanoseconds }` (or `{ _seconds, _nanoseconds }`),\n * but `LeaderboardEntry` declares `submittedAt`/`expiresAt` as epoch millis.\n * Already-millis values pass through unchanged.\n */\nfunction toMillis(value: unknown): unknown {\n if (value && typeof value === 'object') {\n const v = value as Record<string, unknown>\n // Firestore Timestamp instance (defensive — survives only in-process, not\n // over HTTP/JSON, but keeps parity with the RN host's normalizer so this can\n // be the single source of truth when that migrates).\n if (typeof v.toMillis === 'function') {\n try {\n return (v.toMillis as () => number)()\n } catch {\n return value\n }\n }\n const seconds = (v.seconds ?? v._seconds) as number | undefined\n const nanos = (v.nanoseconds ?? v._nanoseconds) as number | undefined\n if (typeof seconds === 'number' && typeof nanos === 'number') {\n return seconds * 1000 + Math.floor(nanos / 1_000_000)\n }\n }\n return value\n}\n\nfunction normalizeEntry(entry: unknown): unknown {\n if (!entry || typeof entry !== 'object') return entry\n const e = entry as Record<string, unknown>\n return { ...e, submittedAt: toMillis(e.submittedAt), expiresAt: toMillis(e.expiresAt) }\n}\n\nexport function normalizeScoresResponse<T>(payload: T): T {\n if (!payload || typeof payload !== 'object') return payload\n const p = payload as Record<string, unknown>\n const result: Record<string, unknown> = { ...p }\n if (Array.isArray(p.entries)) result.entries = p.entries.map(normalizeEntry)\n if (p.context && typeof p.context === 'object') {\n const c = p.context as Record<string, unknown>\n result.context = {\n ...c,\n topEntries: Array.isArray(c.topEntries) ? c.topEntries.map(normalizeEntry) : c.topEntries,\n beforePlayer: Array.isArray(c.beforePlayer) ? c.beforePlayer.map(normalizeEntry) : c.beforePlayer,\n playerEntry: c.playerEntry ? normalizeEntry(c.playerEntry) : c.playerEntry,\n afterPlayer: Array.isArray(c.afterPlayer) ? c.afterPlayer.map(normalizeEntry) : c.afterPlayer,\n }\n }\n return result as T\n}\n","/**\n * HTTP-backed {@link LeaderboardApi} implementation usable by any host.\n *\n * Firebase-free: the caller injects `callRemote` (SandboxHost passes\n * `callRemoteFunction`; platform shells pass their own authenticated invoker),\n * so importing this file does NOT pull firebase into a host bundle. Do NOT\n * import from barrel exports (leaderboard/index.ts).\n */\nimport {\n LeaderboardApi,\n ScoreToken,\n SubmitScoreParams,\n SubmitScoreResult,\n GetPagedScoresOptions,\n PagedScoresResponse,\n PlayerRankOptions,\n PlayerRankResult,\n GetPodiumScoresOptions,\n PodiumScoresResponse,\n} from './LeaderboardApi'\nimport type { RemoteFunctionInvoker } from '../http/callRemoteFunction'\nimport { normalizeScoresResponse } from './normalizeScores'\n\n/**\n * HTTP-based implementation of LeaderboardApi.\n */\nexport class HttpLeaderboardApi implements LeaderboardApi {\n private readonly appId: string\n private readonly callRemote: RemoteFunctionInvoker\n\n constructor(\n appId: string,\n options: {\n callRemote: RemoteFunctionInvoker\n },\n ) {\n this.appId = appId\n this.callRemote = options.callRemote\n }\n\n async createScoreToken(mode?: string): Promise<ScoreToken> {\n return this.callRemote<ScoreToken>('apiCreateScoreToken', {\n appId: this.appId,\n mode: mode || 'default',\n })\n }\n\n async submitScore(params: SubmitScoreParams): Promise<SubmitScoreResult> {\n return this.callRemote<SubmitScoreResult>('apiSubmitScore', {\n appId: this.appId,\n token: params.token,\n score: params.score,\n duration: params.duration,\n mode: params.mode || 'default',\n period: params.period,\n telemetry: params.telemetry,\n metadata: params.metadata,\n // Score-sealing hash auto-computed by RpcLeaderboardApi; without it sealed\n // leaderboards reject the score.\n hash: params.hash,\n })\n }\n\n async getPagedScores(options?: GetPagedScoresOptions): Promise<PagedScoresResponse> {\n const res = await this.callRemote<PagedScoresResponse>('apiGetPagedScores', {\n appId: this.appId,\n mode: options?.mode || 'default',\n period: options?.period || 'alltime',\n periodDate: options?.periodDate,\n cursor: options?.cursor,\n limit: options?.limit,\n variant: options?.variant || 'standard',\n topCount: options?.topCount,\n contextAhead: options?.contextAhead,\n contextBehind: options?.contextBehind,\n })\n return normalizeScoresResponse(res)\n }\n\n async getMyRank(options?: PlayerRankOptions): Promise<PlayerRankResult> {\n const res = await this.callRemote<PlayerRankResult>('apiGetMyRank', {\n appId: this.appId,\n mode: options?.mode || 'default',\n period: options?.period || 'alltime',\n periodDate: options?.periodDate,\n })\n return normalizeScoresResponse(res)\n }\n\n async getPodiumScores(options?: GetPodiumScoresOptions): Promise<PodiumScoresResponse> {\n const res = await this.callRemote<PodiumScoresResponse>('apiGetPodiumScores', {\n appId: this.appId,\n mode: options?.mode || 'default',\n period: options?.period || 'alltime',\n periodDate: options?.periodDate,\n topCount: options?.topCount,\n contextAhead: options?.contextAhead,\n contextBehind: options?.contextBehind,\n })\n return normalizeScoresResponse(res)\n }\n}\n"]}