@series-inc/rundot-game-sdk 5.17.0 → 5.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,7 +26,7 @@ await RundotGameAPI.initializeAsync()
26
26
 
27
27
  ## Documentation
28
28
 
29
- The complete RUN.game SDK manuals live on [Run.game Docs](https://series-1.gitbook.io/getreel-docs). Start there for setup guides, API references, tutorials, and best practices.
29
+ The complete RUN.game SDK manuals live on [Run.game Docs](https://series-1.gitbook.io/rundot-docs). Start there for setup guides, API references, tutorials, and best practices.
30
30
 
31
31
  ## Support & Links
32
32
 
@@ -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--NKuV2tJ.js';
1
+ import { H as LeaderboardApi, I as ImageGenApi, A as AudioGenApi, V as VideoGenApi, q as SpriteGenApi, T as ThreeDGenApi } from './LeaderboardApi-CBSE1wBb.js';
2
2
 
3
3
  interface StorageApi {
4
4
  key(index: number): Promise<string | null>;
@@ -30,6 +30,10 @@ interface RpcResponse {
30
30
  result?: any;
31
31
  error?: {
32
32
  message: string;
33
+ /** Machine-readable error code (e.g. THREE_D_GEN_PROVIDER_REJECTED), when the host provides one. */
34
+ code?: string;
35
+ /** Human-readable cause from an upstream provider, when available. */
36
+ detail?: string;
33
37
  stack?: string;
34
38
  };
35
39
  }
@@ -216,7 +220,7 @@ interface ScheduleLocalNotification {
216
220
  payload?: Record<string, any>;
217
221
  trigger?: NotificationTriggerInput;
218
222
  }
219
- type RCSAvailabilityReason = 'not_subscribed' | 'no_phone' | 'feature_disabled' | 'unknown';
223
+ type RCSAvailabilityReason = 'needs_consent' | 'no_phone' | 'feature_disabled' | 'unknown';
220
224
  interface RCSAvailabilityStatus {
221
225
  available: boolean;
222
226
  reason?: RCSAvailabilityReason;
@@ -224,13 +228,66 @@ interface RCSAvailabilityStatus {
224
228
  interface ScheduleRCSInput {
225
229
  title: string;
226
230
  body: string;
231
+ /** Opaque continuation id; platform resolves to OneLink at send time. */
227
232
  ctaUrl?: string;
233
+ /** Hydrated into H5 notificationParams when the user taps the message CTA. */
234
+ continuationParams?: Record<string, string>;
228
235
  image?: string;
236
+ /** ISO8601 UTC; mutually exclusive with delaySeconds */
237
+ triggerAt?: string;
238
+ /** Seconds from now; mutually exclusive with triggerAt; max 7 days */
239
+ delaySeconds?: number;
229
240
  }
230
- type ScheduleRCSStatus = 'pending' | 'sent' | 'dry_run';
241
+ type ScheduleRCSStatus = 'pending' | 'sent' | 'dry_run' | 'failed';
231
242
  interface ScheduleRCSResult {
232
243
  scheduleId: string;
233
244
  status: ScheduleRCSStatus;
245
+ /**
246
+ * Reserved for a future schedule-status API. Not returned by
247
+ * `scheduleRCSAsync` in v1 (rate-cap deferral is handled internally at
248
+ * dispatch time).
249
+ */
250
+ estimatedSendAt?: string;
251
+ }
252
+ /**
253
+ * Optional inputs for `requestRCSOptInAsync`. The host modal interpolates
254
+ * `rewardCopy` into the heading shown to the user (e.g. "Get 100 gems —
255
+ * never miss a {{gameName}} update."). When omitted, the modal falls back
256
+ * to a generic copy.
257
+ */
258
+ interface RequestRCSOptInInput {
259
+ rewardCopy?: string;
260
+ }
261
+ /**
262
+ * Outcome of the opt-in flow as far as the game is concerned. The host
263
+ * resolves to one of these AFTER the user closes / completes the modal:
264
+ *
265
+ * - `subscribed` — user is now subscribed (newly opted-in OR
266
+ * previously confirmed) and reachable.
267
+ * - `already_subscribed` — user was already subscribed, no action taken.
268
+ * - `pending_confirmation` — user submitted; awaiting Braze double opt-in
269
+ * SMS reply ("Y"). Game should not assume the
270
+ * user is reachable yet — re-check with
271
+ * `getRCSAvailableAsync` later.
272
+ * - `declined` — user dismissed the modal ("Maybe later" /
273
+ * "I'll do it later"). No backend call made.
274
+ */
275
+ type RCSOptInStatus = 'already_subscribed' | 'subscribed' | 'declined' | 'pending_confirmation';
276
+ interface RequestRCSOptInResult {
277
+ status: RCSOptInStatus;
278
+ /**
279
+ * `true` only when this call completes with `status === 'subscribed'` because
280
+ * the user newly confirmed opt-in (typically: modal stayed open through the
281
+ * pending state until Braze double opt-in succeeded). Useful for one-shot
282
+ * rewards.
283
+ *
284
+ * `false` for `already_subscribed`, `pending_confirmation`, and `declined`.
285
+ * If the user dismisses while pending and replies "Y" later, a second call
286
+ * returns `already_subscribed` with `newlySubscribed: false` — games should
287
+ * not grant a reward in that case unless they track confirmation themselves
288
+ * (e.g. poll `getRCSAvailableAsync`).
289
+ */
290
+ newlySubscribed: boolean;
234
291
  }
235
292
  interface NotificationsApi {
236
293
  scheduleAsync(title: string, body: string, seconds: number, notificationId?: string, options?: ScheduleNotificationOptions): Promise<string | null>;
@@ -240,6 +297,13 @@ interface NotificationsApi {
240
297
  setLocalNotificationsEnabled(enabled: boolean): Promise<boolean>;
241
298
  getRCSAvailableAsync(): Promise<RCSAvailabilityStatus>;
242
299
  scheduleRCSAsync(input: ScheduleRCSInput): Promise<ScheduleRCSResult>;
300
+ /**
301
+ * Trigger the platform-owned RCS opt-in modal. The host shows one of the
302
+ * three modal states depending on whether the user has a phone on file and
303
+ * is already subscribed, then resolves with the outcome above. Games should
304
+ * call this in response to a user gesture (TCPA), not as a passive prompt.
305
+ */
306
+ requestRCSOptInAsync(input?: RequestRCSOptInInput): Promise<RequestRCSOptInResult>;
243
307
  }
244
308
 
245
309
  interface ShowToastOptions {
@@ -1312,6 +1376,8 @@ interface RundotGameMessage {
1312
1376
  value?: any;
1313
1377
  data?: any;
1314
1378
  error?: string;
1379
+ errorCode?: string;
1380
+ errorDetail?: string;
1315
1381
  script?: string;
1316
1382
  };
1317
1383
  instanceId: string;
@@ -1587,6 +1653,12 @@ interface UgcEntry {
1587
1653
  authorId: string;
1588
1654
  authorName: string;
1589
1655
  authorAvatarUrl: string | null;
1656
+ /**
1657
+ * Profile IDs permitted to edit this entry, in addition to authorId.
1658
+ * Member-scoped: populated in member reads (get-as-member, listMine, listShared)
1659
+ * and listCollaborators; discovery surfaces (browse, getMany) return [].
1660
+ */
1661
+ editorIds: string[];
1590
1662
  contentType: string;
1591
1663
  data: Record<string, unknown>;
1592
1664
  createdAt: number;
@@ -1633,7 +1705,7 @@ interface UgcRangeFilter {
1633
1705
  }
1634
1706
  type UgcFilterValue = string | number | UgcRangeFilter;
1635
1707
  interface UgcBrowseParams {
1636
- contentType?: string;
1708
+ contentType?: string | string[];
1637
1709
  authorId?: string;
1638
1710
  cursor?: string;
1639
1711
  limit?: number;
@@ -1650,7 +1722,7 @@ interface UgcGetManyResponse {
1650
1722
  }>;
1651
1723
  }
1652
1724
  interface UgcCountParams {
1653
- contentType?: string;
1725
+ contentType?: string | string[];
1654
1726
  filters?: Record<string, UgcFilterValue>;
1655
1727
  }
1656
1728
  interface UgcCrossAppBrowseParams extends UgcBrowseParams {
@@ -1668,6 +1740,16 @@ interface UgcListResponse {
1668
1740
  entries: UgcEntry[];
1669
1741
  nextCursor?: string;
1670
1742
  }
1743
+ interface UgcCollaboratorParams {
1744
+ /** Entry to manage collaborators on. */
1745
+ entryId: string;
1746
+ /** Profile ID of the collaborator to add/remove. */
1747
+ profileId: string;
1748
+ }
1749
+ interface UgcMembersResponse {
1750
+ authorId: string;
1751
+ editorIds: string[];
1752
+ }
1671
1753
  interface UgcBrowseResponse {
1672
1754
  entries: Array<UgcEntry & {
1673
1755
  isLikedByMe?: boolean;
@@ -1832,6 +1914,30 @@ interface UgcApi {
1832
1914
  * @returns Paginated list of entries with isLikedByMe status
1833
1915
  */
1834
1916
  browse(params?: UgcBrowseParams): Promise<UgcBrowseResponse>;
1917
+ /**
1918
+ * List entries shared with the current user (where they are an editor).
1919
+ * Mirrors listMine but for collaborator (not author) relationships.
1920
+ * @param params List parameters (optional filtering and pagination)
1921
+ * @returns Paginated list of entries
1922
+ */
1923
+ listShared(params?: UgcListParams): Promise<UgcListResponse>;
1924
+ /**
1925
+ * Add a collaborator (editor) to an entry. Author-only.
1926
+ * Idempotent; adding the author or an existing editor is a no-op.
1927
+ * @param params Entry ID and the collaborator's profile ID
1928
+ */
1929
+ addCollaborator(params: UgcCollaboratorParams): Promise<void>;
1930
+ /**
1931
+ * Remove a collaborator from an entry. Author-only, or self-leave.
1932
+ * @param params Entry ID and the collaborator's profile ID
1933
+ */
1934
+ removeCollaborator(params: UgcCollaboratorParams): Promise<void>;
1935
+ /**
1936
+ * List the author + editors of an entry. Readable by any member.
1937
+ * @param entryId Entry ID
1938
+ * @returns The author ID and editor profile IDs
1939
+ */
1940
+ listCollaborators(entryId: string): Promise<UgcMembersResponse>;
1835
1941
  /**
1836
1942
  * Like an entry
1837
1943
  * @param id Entry ID to like
@@ -2204,7 +2310,8 @@ interface StorageQuota {
2204
2310
  capBytes: number;
2205
2311
  availableBytes: number;
2206
2312
  maxFileBytes: number;
2207
- tier: number;
2313
+ /** Creator entitlement tier driving the storage cap. */
2314
+ tier: 'free' | 'creator' | 'plus' | 'pro' | 'power' | 'max';
2208
2315
  }
2209
2316
  type TransformParams = {
2210
2317
  op: 'concat';
@@ -2352,6 +2459,112 @@ interface FilesApi {
2352
2459
  getCompletedJobs(): Promise<FilesJobEvent[]>;
2353
2460
  }
2354
2461
 
2462
+ /** Canonical UGC contentType for recorded gameplay clips — the de-facto "clips collection". */
2463
+ declare const CLIP_CONTENT_TYPE = "clip";
2464
+ interface ClipAudioOptions {
2465
+ /** Capture the player's microphone. Default true. Gated by capture consent (T2 and below). */
2466
+ microphone?: boolean;
2467
+ /** Capture game audio (requires useGameAudio to have registered a node). Default true. */
2468
+ gameAudio?: boolean;
2469
+ }
2470
+ type ClipPipPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
2471
+ interface ClipPipLayout {
2472
+ position?: ClipPipPosition;
2473
+ widthFraction?: number;
2474
+ }
2475
+ interface ClipCameraOptions {
2476
+ facingMode?: 'user' | 'environment';
2477
+ pip?: ClipPipLayout;
2478
+ }
2479
+ interface StartClipRecordingOptions {
2480
+ /** The game canvas to record. Element, CSS selector, or omitted to auto-detect the first <canvas>. */
2481
+ canvas?: HTMLCanvasElement | string;
2482
+ fps?: number;
2483
+ /** Auto-stop after this many ms (default 60000). */
2484
+ maxDurationMs?: number;
2485
+ /** Audio knobs; both default on. Omit for game audio + mic. */
2486
+ audio?: ClipAudioOptions;
2487
+ /**
2488
+ * Enable webcam PiP overlay. `true` → front camera, bottom-right 25%.
2489
+ * Pass `ClipCameraOptions` for custom facing mode / layout.
2490
+ * Default `false` (no camera).
2491
+ */
2492
+ camera?: boolean | ClipCameraOptions;
2493
+ /** Called when camera was requested but getUserMedia rejects (recording continues without PiP). */
2494
+ onCameraUnavailable?: () => void;
2495
+ /**
2496
+ * 'auto' (default): the SDK samples the canvas continuously.
2497
+ * 'manual': the game drives frames by calling clips.captureFrame() in its render
2498
+ * loop (after world-render, before UI-render) so in-canvas UI is excluded.
2499
+ */
2500
+ captureMode?: 'auto' | 'manual';
2501
+ /** Force a specific MediaRecorder mime type (throws if unsupported). */
2502
+ mimeType?: string;
2503
+ videoBitsPerSecond?: number;
2504
+ /** Called when maxDurationMs caps capture; the caller should then call stopRecordingAsync(). */
2505
+ onAutoStop?: () => void;
2506
+ }
2507
+ interface ClipBlob {
2508
+ blob: Blob;
2509
+ mimeType: string;
2510
+ durationMs: number;
2511
+ width: number;
2512
+ height: number;
2513
+ sizeBytes: number;
2514
+ }
2515
+ interface ClipPersistOptions {
2516
+ /** 'ugc' (default) uploads + registers a private UGC entry; 'none' returns only the blob. */
2517
+ persist?: 'none' | 'ugc';
2518
+ title?: string;
2519
+ tags?: string[];
2520
+ /** Merge extra fields into the UGC data blob. */
2521
+ data?: Record<string, unknown>;
2522
+ }
2523
+ interface ClipResult extends ClipBlob {
2524
+ /** Present when persisted as UGC. */
2525
+ ugc?: UgcEntry;
2526
+ fileKey?: string;
2527
+ /** Signed, expiring URL for immediate playback only — not durable, not persisted. */
2528
+ fileUrl?: string;
2529
+ }
2530
+ interface ClipsSupport {
2531
+ canRecord: boolean;
2532
+ canUseMicrophone: boolean;
2533
+ canUseCamera: boolean;
2534
+ reason?: string;
2535
+ }
2536
+ type CaptureConsentStatus = 'granted' | 'denied' | 'undetermined';
2537
+ interface CaptureConsent {
2538
+ status: CaptureConsentStatus;
2539
+ canAskAgain: boolean;
2540
+ }
2541
+ interface ClipsApi {
2542
+ isSupportedAsync(): Promise<ClipsSupport>;
2543
+ /** Inspect the per-app capture consent without prompting. T1 apps always report granted. */
2544
+ getCaptureConsentAsync(): Promise<CaptureConsent>;
2545
+ /**
2546
+ * Pop the app-owned native consent harness (T2 and below) to collect/refresh consent.
2547
+ * Pass `includesCamera` when the upcoming recording uses the webcam so the correct
2548
+ * device permission (camera vs microphone) drives the single-opt-in decision.
2549
+ */
2550
+ requestCaptureConsentAsync(opts?: {
2551
+ includesCamera?: boolean;
2552
+ }): Promise<CaptureConsent>;
2553
+ /** Register the game's master Web Audio output node so clips can capture game audio. */
2554
+ useGameAudio(node: AudioNode): void;
2555
+ startRecordingAsync(options?: StartClipRecordingOptions): Promise<void>;
2556
+ /**
2557
+ * In captureMode 'manual', snapshot the current game canvas into the recording
2558
+ * surface (call once per render frame, after world-render and before UI-render,
2559
+ * to exclude in-canvas UI). No-op when not recording or in 'auto' mode.
2560
+ */
2561
+ captureFrame(): void;
2562
+ stopRecordingAsync(persist?: ClipPersistOptions): Promise<ClipResult>;
2563
+ cancelRecordingAsync(): Promise<void>;
2564
+ /** Promote a private clip UGC entry to shared (file + UGC visibility -> public). */
2565
+ publishClipAsync(ugcId: string): Promise<UgcEntry>;
2566
+ }
2567
+
2355
2568
  interface Entitlement {
2356
2569
  docId: string;
2357
2570
  userId: string;
@@ -2686,7 +2899,7 @@ interface AdminGenApi<TEntry, TReport> {
2686
2899
 
2687
2900
  type AppRole = 'owner' | 'editor' | 'none';
2688
2901
  interface AdminUgcBrowseParams {
2689
- contentType?: string;
2902
+ contentType?: string | string[];
2690
2903
  authorId?: string;
2691
2904
  cursor?: string;
2692
2905
  limit?: number;
@@ -3002,6 +3215,7 @@ interface Host {
3002
3215
  readonly audioGen: AudioGenApi;
3003
3216
  readonly videoGen: VideoGenApi;
3004
3217
  readonly files: FilesApi;
3218
+ readonly clips: ClipsApi;
3005
3219
  readonly spriteGen: SpriteGenApi;
3006
3220
  readonly threeDGen: ThreeDGenApi;
3007
3221
  readonly entitlements: EntitlementApi;
@@ -3497,6 +3711,7 @@ interface RundotGameAPI {
3497
3711
  audioGen: AudioGenApi;
3498
3712
  videoGen: VideoGenApi;
3499
3713
  files: FilesApi;
3714
+ clips: ClipsApi;
3500
3715
  spriteGen: SpriteGenApi;
3501
3716
  threeDGen: ThreeDGenApi;
3502
3717
  entitlements: EntitlementApi;
@@ -3523,4 +3738,4 @@ interface AdsApi {
3523
3738
  showInterstitialAd(options?: ShowInterstitialAdOptions): Promise<boolean>;
3524
3739
  }
3525
3740
 
3526
- export { type FetchFromCdnOptions 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 PopupsApi as J, type ShowToastOptions as K, type ShowInterstitialAdOptions as L, type ShowRewardedAdOptions as M, type NavigationApi as N, type ProfileApi as O, type Profile as P, type QuitOptions as Q, type RundotGameAPI as R, type SimulationActiveRunsUpdate as S, type DeviceApi as T, type DeviceInfo as U, type EnvironmentApi as V, type EnvironmentInfo as W, type SystemApi as X, type SafeArea as Y, type AddToHomeScreenResult as Z, type CdnApi as _, type RecipeRequirementQuery as a, type SpendCurrencyOptions as a$, type AssetUrlResult as a0, type TimeApi as a1, type ServerTimeData as a2, type GetFutureTimeOptions as a3, type AiApi as a4, type AiChatCompletionRequest as a5, type AiChatCompletionData as a6, type AiChatCompletionStreamOptions as a7, type AiChatCompletionStreamChunk as a8, type HapticsApi as a9, type GetActiveRunsOptions as aA, type ExecuteScopedRecipeOptions as aB, type ExecuteScopedRecipeResult as aC, type GetAvailableRecipesOptions as aD, type GetAvailableRecipesResult as aE, type Recipe as aF, type GetBatchRecipeRequirements as aG, type TriggerRecipeChainOptions as aH, type RoomDataUpdate as aI, type RoomMessageEvent as aJ, type ProposedMoveEvent as aK, RundotGameTransport as aL, type RoomsApi as aM, type CreateRoomOptions as aN, type JoinOrCreateRoomOptions as aO, type JoinOrCreateResult as aP, type ListRoomsOptions as aQ, type UpdateRoomDataOptions as aR, type RoomMessageRequest as aS, type StartRoomGameOptions as aT, type ProposeMoveRequest as aU, type ProposeMoveResult as aV, type ValidateMoveVerdict as aW, type ValidateMoveResult as aX, type RoomSubscriptionOptions as aY, type LoggingApi as aZ, type IapApi as a_, HapticFeedbackStyle as aa, type FeaturesApi as ab, type Experiment as ac, type LifecycleApi as ad, type SleepCallback as ae, type Subscription as af, type AwakeCallback as ag, type PauseCallback as ah, type ResumeCallback as ai, type QuitCallback as aj, type BackButtonCallback as ak, type SimulationApi as al, type SimulationSlotValidationResult as am, type SimulationBatchOperation as an, type SimulationBatchOperationsResult as ao, type SimulationAvailableItem as ap, type SimulationPowerPreview as aq, type SimulationSlotMutationResult as ar, type SimulationSlotContainer as as, type SimulationAssignment as at, type SimulationState as au, type ExecuteRecipeOptions as av, type ExecuteRecipeResponse as aw, type CollectRecipeResult as ax, type ResetStateOptions as ay, type ResetStateResult as az, type RecipeRequirementResult as b, type FilesApi as b$, type SpendCurrencyResult as b0, type SubscriptionTier as b1, type RunSubscriptionsResponse as b2, type SubscriptionInterval as b3, type PurchaseSubscriptionResponse as b4, type OpenStoreResult as b5, type LoadEmbeddedAssetsResponse as b6, type SharedAssetsApi as b7, type PreloaderApi as b8, type SocialApi as b9, type AdminSpriteGenApi as bA, type AdminAudioGenApi as bB, type AdminThreeDGenApi as bC, type AppRole as bD, type AdminUgcBrowseParams as bE, type AdminUgcBrowseResponse as bF, type AdminUgcListReportsParams as bG, type AdminUgcListReportsResponse as bH, type AdminUgcResolveAction as bI, type AdminGenBrowseParams as bJ, type AdminGenBrowseResponse as bK, type ImageGenEntry as bL, type AdminGenListReportsParams as bM, type AdminGenListReportsResponse as bN, type ImageGenReport as bO, type AdminGenResolveAction as bP, type SpriteGenEntry as bQ, type SpriteGenReport as bR, type ThreeDGenEntry as bS, type ThreeDGenReport as bT, type Avatar3dApi as bU, type AssetManifest as bV, type Avatar3dConfig as bW, type ShowEditorOptions as bX, type Avatar3dEdits as bY, type AdsApi as bZ, type SharedStorageHostApi as b_, type ShareMetadata as ba, type ShareLinkResult as bb, type SocialQRCodeOptions as bc, type QRCodeResult as bd, type ShareClickData as be, type ShareFileOptions as bf, type ShareFileResult as bg, type CanShareFileResult as bh, type EntitlementApi as bi, type Entitlement as bj, type LedgerEntry as bk, type ShopApi as bl, type StorefrontResponse as bm, type StorefrontItem as bn, type ShopPurchaseResponse as bo, type ShopOrderHistoryResponse as bp, type PromptLoginResult as bq, type AccessTier as br, type AccessGateApi as bs, type TextGenApi as bt, type UgcApi as bu, type VideoApi as bv, type AppApi as bw, type AdminUgcApi as bx, type AdminImageGenApi as by, type AdminVideoGenApi as bz, type RundotGameAvailableRecipe as c, type RoomMessageEventType as c$, type MultiplayerApi as c0, type AttributionApi as c1, type InitializationContext as c2, type InitializationOptions as c3, AccessDeniedError as c4, type AdminGenApi as c5, type AdminImageGenBrowseParams as c6, type AdminImageGenBrowseResponse as c7, type AdminImageGenListReportsParams as c8, type AdminImageGenListReportsResponse as c9, type AudioGenEntry as cA, type AudioGenReport as cB, type Category as cC, type ConnectionState as cD, type GetSubscriptionsForTierRequest as cE, type HudInsets as cF, type InboundForKeyEntry as cG, type InboundMethodIds as cH, type InboundStorageApi as cI, type IsPlayerSubscribedRequest as cJ, type JoinOrCreateRoomEnvelopeResponse as cK, type JoinRoomMatchCriteria as cL, type LoadEmbeddedAssetsRequest as cM, MockAvatarApi as cN, type NotificationTriggerInput as cO, type OnNotificationCallback as cP, type OnRequestCallback as cQ, type OnResponseCallback as cR, type ProposedMovePayload as cS, type Protocol as cT, type PurchaseSubscriptionRequest as cU, type RCSAvailabilityReason as cV, ROOM_GAME_PHASES as cW, type RecipeInfo as cX, type RoomEnvelopeResponse as cY, type RoomEvents as cZ, type RoomGamePhase as c_, type AdminImageGenResolveAction as ca, type AdminSpriteGenBrowseParams as cb, type AdminSpriteGenBrowseResponse as cc, type AdminSpriteGenListReportsParams as cd, type AdminSpriteGenListReportsResponse as ce, type AdminSpriteGenResolveAction as cf, type AdminThreeDGenBrowseParams as cg, type AdminThreeDGenBrowseResponse as ch, type AdminThreeDGenListReportsParams as ci, type AdminThreeDGenListReportsResponse as cj, type AdminThreeDGenResolveAction as ck, type AdminUgcEntry as cl, type AdminVideoGenBrowseParams as cm, type AdminVideoGenBrowseResponse as cn, type AdminVideoGenListReportsParams as co, type AdminVideoGenListReportsResponse as cp, type AdminVideoGenResolveAction as cq, type AiContentBlock as cr, type AiImageContent as cs, type AiImageUrlContent as ct, type AiMessage as cu, type AiResponseFormat as cv, type AiTextContent as cw, type AiToolResultContent as cx, type AiToolUseContent as cy, type Asset as cz, type RundotGameCollectRecipeResult as d, type RoomMessagePayload as d0, type RoomsEnvelopeResponse as d1, RpcInboundStorageApi as d2, RpcSharedAssetsApi as d3, type RpcTransport as d4, type RunSubscription as d5, type RundotGameRoomCustomMetadata as d6, type RundotGameRoomPayload as d7, type RundotGameRoomRules as d8, type RundotGameRoomRulesGameState as d9, SHARE_FILE_ALLOWED_MIME_TYPES as da, SHARE_FILE_MAX_SIZE_BYTES as db, type ScheduleRCSStatus as dc, type ServerPlayer as dd, type ServerRoom as de, type ShareFileMimeType as df, type ShopOrder as dg, type SimulationBatchOperationAssign as dh, type SimulationBatchOperationRemove as di, type SimulationBatchOperationResult as dj, type SimulationPersonalState as dk, type SimulationRoomActiveRecipe as dl, type SimulationRoomState as dm, type StorefrontCollection as dn, type StorefrontCollectionItem as dp, type SubPath as dq, type Tool as dr, type ToolChoice as ds, type ToolUse as dt, type TimeIntervalTriggerInput as du, type UgcReport as dv, type VideoGenEntry as dw, type VideoGenReport as dx, createHost as dy, resolveCollectionItemPrice as dz, type RundotGameExecuteRecipeOptions as e, 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 };
3741
+ 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 LoggingApi 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 ResetStateOptions as aA, type ResetStateResult as aB, type GetActiveRunsOptions as aC, type ExecuteScopedRecipeOptions as aD, type ExecuteScopedRecipeResult as aE, type GetAvailableRecipesOptions as aF, type GetAvailableRecipesResult as aG, type Recipe as aH, type GetBatchRecipeRequirements as aI, type TriggerRecipeChainOptions as aJ, type RoomDataUpdate as aK, type RoomMessageEvent as aL, type ProposedMoveEvent as aM, RundotGameTransport as aN, type RoomsApi as aO, type CreateRoomOptions as aP, type JoinOrCreateRoomOptions as aQ, type JoinOrCreateResult as aR, type ListRoomsOptions as aS, type UpdateRoomDataOptions as aT, type RoomMessageRequest as aU, type StartRoomGameOptions as aV, type ProposeMoveRequest as aW, type ProposeMoveResult as aX, type ValidateMoveVerdict as aY, type ValidateMoveResult as aZ, type RoomSubscriptionOptions as a_, type AiChatCompletionStreamChunk as aa, type HapticsApi as ab, HapticFeedbackStyle as ac, type FeaturesApi as ad, type Experiment as ae, type LifecycleApi as af, type SleepCallback as ag, type Subscription as ah, type AwakeCallback as ai, type PauseCallback as aj, type ResumeCallback as ak, type QuitCallback as al, type BackButtonCallback as am, type SimulationApi as an, type SimulationSlotValidationResult as ao, type SimulationBatchOperation as ap, type SimulationBatchOperationsResult as aq, type SimulationAvailableItem as ar, type SimulationPowerPreview as as, type SimulationSlotMutationResult as at, type SimulationSlotContainer as au, type SimulationAssignment as av, type SimulationState as aw, type ExecuteRecipeOptions as ax, type ExecuteRecipeResponse as ay, type CollectRecipeResult as az, type RecipeRequirementResult as b, type AdsApi as b$, type IapApi as b0, type SpendCurrencyOptions as b1, type SpendCurrencyResult as b2, type SubscriptionTier as b3, type RunSubscriptionsResponse as b4, type SubscriptionInterval as b5, type PurchaseSubscriptionResponse as b6, type OpenStoreResult as b7, type LoadEmbeddedAssetsResponse as b8, type SharedAssetsApi as b9, type AdminImageGenApi as bA, type AdminVideoGenApi as bB, type AdminSpriteGenApi as bC, type AdminAudioGenApi as bD, type AdminThreeDGenApi as bE, type AppRole as bF, type AdminUgcBrowseParams as bG, type AdminUgcBrowseResponse as bH, type AdminUgcListReportsParams as bI, type AdminUgcListReportsResponse as bJ, type AdminUgcResolveAction as bK, type AdminGenBrowseParams as bL, type AdminGenBrowseResponse as bM, type ImageGenEntry as bN, type AdminGenListReportsParams as bO, type AdminGenListReportsResponse as bP, type ImageGenReport as bQ, type AdminGenResolveAction as bR, type SpriteGenEntry as bS, type SpriteGenReport as bT, type ThreeDGenEntry as bU, type ThreeDGenReport as bV, type Avatar3dApi as bW, type AssetManifest as bX, type Avatar3dConfig as bY, type ShowEditorOptions as bZ, type Avatar3dEdits as b_, type PreloaderApi as ba, type SocialApi as bb, type ShareMetadata as bc, type ShareLinkResult as bd, type SocialQRCodeOptions as be, type QRCodeResult as bf, type ShareClickData as bg, type ShareFileOptions as bh, type ShareFileResult as bi, type CanShareFileResult as bj, type EntitlementApi as bk, type Entitlement as bl, type LedgerEntry as bm, type ShopApi as bn, type StorefrontResponse as bo, type StorefrontItem as bp, type ShopPurchaseResponse as bq, type ShopOrderHistoryResponse as br, type PromptLoginResult as bs, type AccessTier as bt, type AccessGateApi as bu, type TextGenApi as bv, type UgcApi as bw, type VideoApi as bx, type AppApi as by, type AdminUgcApi as bz, type RundotGameAvailableRecipe as c, type JoinRoomMatchCriteria as c$, type SharedStorageHostApi as c0, type FilesApi as c1, type ClipsApi as c2, type MultiplayerApi as c3, type AttributionApi as c4, type InitializationContext as c5, type InitializationOptions as c6, type CaptureConsent as c7, type StartClipRecordingOptions as c8, type ClipBlob as c9, type AdminVideoGenListReportsResponse as cA, type AdminVideoGenResolveAction as cB, type AiContentBlock as cC, type AiImageContent as cD, type AiImageUrlContent as cE, type AiMessage as cF, type AiResponseFormat as cG, type AiTextContent as cH, type AiToolResultContent as cI, type AiToolUseContent as cJ, type Asset as cK, type AudioGenEntry as cL, type AudioGenReport as cM, CLIP_CONTENT_TYPE as cN, type Category as cO, type ClipAudioOptions as cP, type ClipCameraOptions as cQ, type ClipPipLayout as cR, type ClipPipPosition as cS, type ConnectionState as cT, type GetSubscriptionsForTierRequest as cU, type HudInsets as cV, type InboundForKeyEntry as cW, type InboundMethodIds as cX, type InboundStorageApi as cY, type IsPlayerSubscribedRequest as cZ, type JoinOrCreateRoomEnvelopeResponse as c_, 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 RundotGameCollectRecipeResult as d, type LoadEmbeddedAssetsRequest as d0, MockAvatarApi as d1, type NotificationTriggerInput as d2, type OnNotificationCallback as d3, type OnRequestCallback as d4, type OnResponseCallback as d5, type ProposedMovePayload as d6, type Protocol as d7, type PurchaseSubscriptionRequest as d8, type RCSAvailabilityReason as d9, type SimulationBatchOperationRemove as dA, type SimulationBatchOperationResult as dB, type SimulationPersonalState as dC, type SimulationRoomActiveRecipe as dD, type SimulationRoomState as dE, type StorefrontCollection as dF, type StorefrontCollectionItem as dG, type SubPath as dH, type Tool as dI, type ToolChoice as dJ, type ToolUse as dK, type TimeIntervalTriggerInput as dL, type UgcReport as dM, type VideoGenEntry as dN, type VideoGenReport as dO, createHost as dP, resolveCollectionItemPrice as dQ, type RCSOptInStatus as da, ROOM_GAME_PHASES as db, type RecipeInfo as dc, type RoomEnvelopeResponse as dd, type RoomEvents as de, type RoomGamePhase as df, type RoomMessageEventType as dg, type RoomMessagePayload as dh, type RoomsEnvelopeResponse as di, RpcInboundStorageApi as dj, RpcSharedAssetsApi as dk, type RpcTransport as dl, type RunSubscription as dm, type RundotGameRoomCustomMetadata as dn, type RundotGameRoomPayload as dp, type RundotGameRoomRules as dq, type RundotGameRoomRulesGameState as dr, SHARE_FILE_ALLOWED_MIME_TYPES as ds, SHARE_FILE_MAX_SIZE_BYTES as dt, type ScheduleRCSStatus as du, type ServerPlayer as dv, type ServerRoom as dw, type ShareFileMimeType as dx, type ShopOrder as dy, type SimulationBatchOperationAssign as dz, type RundotGameExecuteRecipeOptions as e, 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 };
@@ -1,4 +1,4 @@
1
- type ImageGenModel = 'gemini-3.1-flash-image-preview' | 'gemini-3-pro-image-preview';
1
+ type ImageGenModel = 'gemini-3.1-flash-image-preview' | 'gemini-3-pro-image-preview' | 'gpt-image-1' | 'gpt-image-2';
2
2
  type BgRemovalModel = 'bria' | 'birefnet';
3
3
  type BiRefNetVariant = 'light' | 'heavy' | 'portrait';
4
4
  interface RemoveBackgroundOptions {
@@ -29,10 +29,22 @@ interface ImageGenParams {
29
29
  removeBackground?: boolean | RemoveBackgroundOptions;
30
30
  /** Model to use. Defaults to 'gemini-3.1-flash-image-preview' (Nano Banana 2). */
31
31
  model?: ImageGenModel;
32
+ /**
33
+ * Native output resolution. Only supported by 'gemini-3-pro-image-preview'
34
+ * (Nano Banana Pro); passing it with any other model is rejected. Defaults to
35
+ * '1K'. Use '2K' or '4K' for studio-quality output.
36
+ */
37
+ imageSize?: '1K' | '2K' | '4K';
32
38
  }
33
39
  interface ImageGenResult {
40
+ /** UUID assigned by the server for this generation. */
41
+ generationId: string;
34
42
  imageUrl: string;
35
43
  prompt: string;
44
+ /** Resolved model name (server may upgrade deprecated aliases). */
45
+ model: string;
46
+ /** Seed used (echoed back even when client did not specify one). */
47
+ seed: number;
36
48
  }
37
49
  interface ImageGenJobEvent {
38
50
  jobId: string;
@@ -107,13 +119,19 @@ interface AudioGenSFXParams {
107
119
  /** Opaque correlation ID echoed back in job events for client-side recovery. */
108
120
  clientRef?: string;
109
121
  }
122
+ type MusicModel = 'elevenlabs' | 'lyria3' | 'lyria3-pro' | 'minimax-music-2.6';
110
123
  interface AudioGenMusicParams {
111
124
  type: 'music';
112
125
  provider?: AudioGenProvider;
113
126
  /** Genre, tempo, instruments, mood — "orchestral victory fanfare, triumphant brass" */
114
127
  prompt: string;
115
- /** Duration in seconds (REQUIRED, 1–300). */
128
+ /**
129
+ * Duration in seconds (3–300). Required for ElevenLabs; ignored by FAL
130
+ * models which produce a fixed-length track.
131
+ */
116
132
  durationSec: number;
133
+ /** Music generation model. Default: 'elevenlabs'. */
134
+ model?: MusicModel;
117
135
  /** Opaque correlation ID echoed back in job events for client-side recovery. */
118
136
  clientRef?: string;
119
137
  }
@@ -303,6 +321,10 @@ interface SpriteGenParams {
303
321
  width?: number;
304
322
  height?: number;
305
323
  bgMode?: 'transparent' | 'white' | 'include';
324
+ /** Disable smart-crop (auto-crop to content bounds). Default true. Set false to get exact requested dimensions. */
325
+ smartCrop?: boolean;
326
+ /** Disable pixel-perfect grid alignment. Default true. Can alter output dimensions slightly. */
327
+ pixelPerfect?: boolean;
306
328
  theme?: string;
307
329
  style?: string;
308
330
  colors?: string[];
@@ -370,7 +392,7 @@ interface SpriteGenApi {
370
392
  getCompletedJobs(): Promise<SpriteGenJobEvent[]>;
371
393
  }
372
394
 
373
- type ThreeDGenProvider = 'pixal3d' | 'hunyuan3d-v3.1-pro' | 'trellis-2';
395
+ type ThreeDGenProvider = 'pixal3d' | 'hunyuan3d-v3.1-pro' | 'trellis-2' | 'meshy';
374
396
  type ThreeDGenMode = 'image-to-3d' | 'text-to-3d';
375
397
  type ThreeDGenQuality = 'draft' | 'standard' | 'high';
376
398
  interface ThreeDGenBase {
@@ -431,7 +453,25 @@ interface Trellis2ImageTo3DParams extends ThreeDGenBase {
431
453
  imageUrl: string;
432
454
  providerOptions?: Record<string, never>;
433
455
  }
434
- type ThreeDGenParams = Pixal3DImageTo3DParams | HunyuanImageTo3DParams | HunyuanTextTo3DParams | Trellis2ImageTo3DParams;
456
+ /** Meshy native generation provider options (texture + PBR controls). */
457
+ interface MeshyProviderOptions {
458
+ should_texture?: boolean;
459
+ enable_pbr?: boolean;
460
+ ai_model?: string;
461
+ }
462
+ interface MeshyImageTo3DParams extends ThreeDGenBase {
463
+ provider: 'meshy';
464
+ mode: 'image-to-3d';
465
+ imageUrl: string;
466
+ providerOptions?: MeshyProviderOptions;
467
+ }
468
+ interface MeshyTextTo3DParams extends ThreeDGenBase {
469
+ provider: 'meshy';
470
+ mode: 'text-to-3d';
471
+ prompt: string;
472
+ providerOptions?: MeshyProviderOptions;
473
+ }
474
+ type ThreeDGenParams = Pixal3DImageTo3DParams | HunyuanImageTo3DParams | HunyuanTextTo3DParams | Trellis2ImageTo3DParams | MeshyImageTo3DParams | MeshyTextTo3DParams;
435
475
  interface ThreeDGenResult {
436
476
  generationId: string;
437
477
  modelUrl: string;
@@ -461,7 +501,10 @@ interface RemeshResult {
461
501
  provider: 'meshy';
462
502
  }
463
503
  interface RigParams {
464
- modelUrl: string;
504
+ /** URL of the GLB model to rig. Provide this or `modelFileKey`. */
505
+ modelUrl?: string;
506
+ /** Resolve a Files SDK key as the source model (alternative to modelUrl) */
507
+ modelFileKey?: string;
465
508
  heightMeters?: number;
466
509
  clientRef?: string;
467
510
  }
@@ -1,4 +1,4 @@
1
- import { RateLimitedError, RundotApiError } from './chunk-V5C5VQM4.js';
1
+ import { RateLimitedError, RundotApiError } from './chunk-HVVCNDSV.js';
2
2
 
3
3
  // src/imageGen/HttpImageGenApi.ts
4
4
  var HttpImageGenApi = class {
@@ -276,13 +276,17 @@ var HttpThreeDGenApi = class {
276
276
  if (!response.ok) {
277
277
  const errorText = await response.text();
278
278
  let errorMessage = `3D generation failed (${response.status})`;
279
+ let errorCode = "UNKNOWN";
280
+ let detail;
279
281
  try {
280
282
  const errorJson = JSON.parse(errorText);
281
- errorMessage = errorJson.error || errorJson.message || errorMessage;
283
+ errorMessage = errorJson.error ?? errorJson.message ?? errorMessage;
284
+ if (typeof errorJson.code === "string") errorCode = errorJson.code;
285
+ if (typeof errorJson.detail === "string") detail = errorJson.detail;
282
286
  } catch {
283
287
  if (errorText) errorMessage = errorText;
284
288
  }
285
- throw new Error(errorMessage);
289
+ throw new RundotApiError(errorCode, errorMessage, response.status, detail);
286
290
  }
287
291
  return response.json();
288
292
  }
@@ -398,5 +402,5 @@ var HttpLeaderboardApi = class {
398
402
  };
399
403
 
400
404
  export { HttpAudioGenApi, HttpImageGenApi, HttpLeaderboardApi, HttpSpriteGenApi, HttpThreeDGenApi, HttpVideoGenApi };
401
- //# sourceMappingURL=chunk-CU3M4HTH.js.map
402
- //# sourceMappingURL=chunk-CU3M4HTH.js.map
405
+ //# sourceMappingURL=chunk-4YOCLVRI.js.map
406
+ //# sourceMappingURL=chunk-4YOCLVRI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/imageGen/HttpImageGenApi.ts","../src/audioGen/HttpAudioGenApi.ts","../src/videoGen/HttpVideoGenApi.ts","../src/spriteGen/HttpSpriteGenApi.ts","../src/threeDGen/HttpThreeDGenApi.ts","../src/leaderboard/normalizeScores.ts","../src/leaderboard/HttpLeaderboardApi.ts"],"names":[],"mappings":";;;AAOO,IAAM,kBAAN,MAA6C;AAAA,EACjC,KAAA;AAAA,EACA,IAAA;AAAA,EAEjB,WAAA,CAAY,OAAe,IAAA,EAAuB;AAChD,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,IAA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A,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-4YOCLVRI.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 },\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"]}