@series-inc/rundot-game-sdk 5.24.0-beta.2 → 5.24.0-beta.4
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 +4 -4
- package/dist/{AdsApi-CDJtVB3I.d.ts → AdsApi-CUkS1Vn7.d.ts} +172 -8
- package/dist/{LeaderboardApi-CrWxakrr.d.ts → LeaderboardApi-Bp1wndvJ.d.ts} +1 -1
- package/dist/{MultiplayerApi-nnrGTTcO.d.ts → MultiplayerApi-TQr01JT7.d.ts} +9 -1
- package/dist/{SyncplayRoomTransport-BZFFN-il.d.ts → SyncplayRoomTransport-DCrXJ4QQ.d.ts} +136 -5
- package/dist/{callRemoteFunction-NBIrdLoa.d.ts → callRemoteFunction-DeGLqhjj.d.ts} +17 -1
- package/dist/{chunk-YSK7K2OH.js → chunk-2RSDZJHS.js} +244 -14
- package/dist/chunk-2RSDZJHS.js.map +1 -0
- package/dist/chunk-4J2RDAOR.js +12 -0
- package/dist/chunk-4J2RDAOR.js.map +1 -0
- package/dist/{chunk-WFRNUODW.js → chunk-56UNQZIB.js} +4 -30
- package/dist/chunk-56UNQZIB.js.map +1 -0
- package/dist/{chunk-7RIEVFDA.js → chunk-A6Y5KGQZ.js} +237 -67
- package/dist/chunk-A6Y5KGQZ.js.map +1 -0
- package/dist/{chunk-3GKY3LY5.js → chunk-C5APEUTZ.js} +2 -2
- package/dist/chunk-C5APEUTZ.js.map +1 -0
- package/dist/{chunk-RNEWXNDL.js → chunk-NU24WCLE.js} +51 -15
- package/dist/chunk-NU24WCLE.js.map +1 -0
- package/dist/{chunk-3MDWJBCR.js → chunk-OSKQDUTI.js} +272 -146
- package/dist/chunk-OSKQDUTI.js.map +1 -0
- package/dist/{chunk-USEBN3PO.js → chunk-Q6SGGAIV.js} +35 -10
- package/dist/chunk-Q6SGGAIV.js.map +1 -0
- package/dist/{chunk-YQEDG3Z2.js → chunk-SFJILJFQ.js} +29 -3
- package/dist/chunk-SFJILJFQ.js.map +1 -0
- package/dist/{chunk-N5MASNTK.js → chunk-WHDTRIDW.js} +890 -85
- package/dist/chunk-WHDTRIDW.js.map +1 -0
- package/dist/{chunk-DMKR7SVQ.js → chunk-WZFHBFH7.js} +3 -3
- package/dist/{chunk-DMKR7SVQ.js.map → chunk-WZFHBFH7.js.map} +1 -1
- package/dist/core-7QSNRRMV.js +3 -0
- package/dist/{core-6DQFSOBL.js.map → core-7QSNRRMV.js.map} +1 -1
- package/dist/host-http.d.ts +4 -20
- package/dist/host-http.js +2 -2
- package/dist/{index-BrvMOxG0.d.ts → index-B_PIWjhp.d.ts} +10 -1
- package/dist/index.d.ts +88 -14
- package/dist/index.js +6 -6
- package/dist/mp-server/index.d.ts +38 -1
- package/dist/{multiplayer-service-BPEWIL4F.d.ts → multiplayer-service-C0k76UQR.d.ts} +5 -1
- package/dist/playground/index.js +30 -10
- package/dist/playground/index.js.map +1 -1
- package/dist/rundot-game-api/index.d.ts +5 -5
- package/dist/rundot-game-api/index.js +7 -7
- package/dist/rundot-game-api/index.js.map +1 -1
- package/dist/secret-protocol-DY332qWW.d.ts +169 -0
- package/dist/{session-promotion-BMoIRgKe.d.ts → session-promotion-DC2gPFKv.d.ts} +1 -1
- package/dist/{static-checker-nclHCa43.d.ts → static-checker-BshYHV5c.d.ts} +6 -1
- package/dist/syncplay/browser.d.ts +189 -10
- package/dist/syncplay/browser.js +2840 -121
- package/dist/syncplay/browser.js.map +1 -1
- package/dist/syncplay/creator.d.ts +5 -4
- package/dist/syncplay/creator.js +2 -2
- package/dist/syncplay/index.d.ts +3 -2
- package/dist/syncplay/index.js +2 -2
- package/dist/syncplay/node.d.ts +10 -4
- package/dist/syncplay/node.js +13 -10
- package/dist/syncplay/node.js.map +1 -1
- package/dist/syncplay/testing.d.ts +471 -4
- package/dist/syncplay/testing.js +2103 -27
- package/dist/syncplay/testing.js.map +1 -1
- package/dist/syncplay/tools.d.ts +2 -2
- package/dist/syncplay/tools.js +2 -2
- package/dist/{types-BV8uchSD.d.ts → types-ChJ9TO_o.d.ts} +4 -0
- package/dist/vite/{dev-server-V3IZP5XX.js → dev-server-SGPFGDDA.js} +1362 -18
- package/dist/vite/dev-server-SGPFGDDA.js.map +1 -0
- package/dist/vite/index.d.ts +3 -3
- package/dist/vite/index.js +40 -5
- package/dist/vite/index.js.map +1 -1
- package/dist/webview/index.js +1 -1
- package/docs/README.md +4 -4
- package/docs/SUMMARY.md +3 -3
- package/docs/agents-index.txt +1 -1
- package/docs/rundot-developer-platform/api/ACCESS_GATE.md +3 -4
- package/docs/rundot-developer-platform/api/AI.md +37 -7
- package/docs/rundot-developer-platform/api/ANALYTICS.md +2 -0
- package/docs/rundot-developer-platform/api/ASSETS.md +3 -3
- package/docs/rundot-developer-platform/api/AVATAR_3D.md +3 -3
- package/docs/rundot-developer-platform/api/CLIPS.md +1 -1
- package/docs/rundot-developer-platform/api/CREDITS.md +22 -0
- package/docs/rundot-developer-platform/api/EMBEDDED_LIBRARIES.md +2 -2
- package/docs/rundot-developer-platform/api/ENVIRONMENT.md +1 -1
- package/docs/rundot-developer-platform/api/HAPTICS.md +1 -1
- package/docs/rundot-developer-platform/api/LIVEOPS.md +121 -3
- package/docs/rundot-developer-platform/api/LOGGING.md +1 -1
- package/docs/rundot-developer-platform/api/MULTIPLAYER.md +1 -1
- package/docs/rundot-developer-platform/api/PRELOADER.md +3 -3
- package/docs/rundot-developer-platform/api/PURCHASES.md +30 -1
- package/docs/rundot-developer-platform/api/RATE_LIMITS.md +10 -11
- package/docs/rundot-developer-platform/api/RELEASE_NOTES.md +1 -1
- package/docs/rundot-developer-platform/api/SERVER_AUTHORITATIVE.md +3 -3
- package/docs/rundot-developer-platform/api/STORAGE.md +22 -9
- package/docs/rundot-developer-platform/api/SYNCPLAY-MOVEMENT.md +12 -1
- package/docs/rundot-developer-platform/api/SYNCPLAY-PHYSICS.md +219 -19
- package/docs/rundot-developer-platform/api/SYNCPLAY-SECRETS.md +187 -0
- package/docs/rundot-developer-platform/api/SYNCPLAY.md +125 -28
- package/docs/rundot-developer-platform/api/UGC.md +1 -1
- package/docs/rundot-developer-platform/cli-reference.md +15 -2
- package/docs/rundot-developer-platform/deploying-your-game.md +12 -12
- package/docs/rundot-developer-platform/error-handling.md +9 -1
- package/docs/rundot-developer-platform/getting-started.md +8 -8
- package/docs/rundot-developer-platform/initializing-your-game.md +1 -1
- package/docs/rundot-developer-platform/marketing-your-game.md +17 -17
- package/docs/rundot-developer-platform/playground.md +26 -10
- package/docs/rundot-developer-platform/runtime-environment.md +3 -3
- package/docs/rundot-developer-platform/setting-your-game-thumbnail.md +1 -1
- package/docs/rundot-developer-platform/troubleshooting.md +2 -2
- package/package.json +3 -3
- package/scripts/install-hint.mjs +1 -1
- package/scripts/setup.mjs +5 -5
- package/dist/chunk-2WRAWLP3.js +0 -12
- package/dist/chunk-2WRAWLP3.js.map +0 -1
- package/dist/chunk-3GKY3LY5.js.map +0 -1
- package/dist/chunk-3MDWJBCR.js.map +0 -1
- package/dist/chunk-7RIEVFDA.js.map +0 -1
- package/dist/chunk-N5MASNTK.js.map +0 -1
- package/dist/chunk-RNEWXNDL.js.map +0 -1
- package/dist/chunk-USEBN3PO.js.map +0 -1
- package/dist/chunk-WFRNUODW.js.map +0 -1
- package/dist/chunk-YQEDG3Z2.js.map +0 -1
- package/dist/chunk-YSK7K2OH.js.map +0 -1
- package/dist/core-6DQFSOBL.js +0 -3
- package/dist/vite/dev-server-V3IZP5XX.js.map +0 -1
- package/docs/rundot-developer-platform/api/EXPERIMENTS.md +0 -118
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# RUN.
|
|
1
|
+
# RUN.world SDK API
|
|
2
2
|
|
|
3
|
-
Build connected HTML5 games that integrate deeply with the RUN.
|
|
3
|
+
Build connected HTML5 games that integrate deeply with the RUN.world platform. This package provides the client SDK used by hosted games as well as the local mock environment for development.
|
|
4
4
|
|
|
5
5
|
## Highlights
|
|
6
6
|
|
|
7
|
-
- Typed APIs for RUN.
|
|
7
|
+
- Typed APIs for RUN.world platform services (simulation, rooms, analytics, ads, and more)
|
|
8
8
|
- Host-aware tooling including lifecycle hooks, safe-area utilities, and asset loading helpers
|
|
9
9
|
|
|
10
10
|
## Quick Start
|
|
@@ -37,7 +37,7 @@ await RundotGameAPI.initializeAsync()
|
|
|
37
37
|
|
|
38
38
|
## Documentation
|
|
39
39
|
|
|
40
|
-
The complete RUN.
|
|
40
|
+
The complete RUN.world SDK manuals live on [RUN.world Docs](https://series-1.gitbook.io/rundot-docs). Start there for setup guides, API references, tutorials, and best practices.
|
|
41
41
|
|
|
42
42
|
## Support & Links
|
|
43
43
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as ProviderErrorDetail, M as LeaderboardApi, I as ImageGenApi, A as AudioGenApi, V as VideoGenApi, q as SpriteGenApi, T as ThreeDGenApi } from './LeaderboardApi-
|
|
2
|
-
import { M as MultiplayerApi } from './MultiplayerApi-
|
|
1
|
+
import { $ as ProviderErrorDetail, M as LeaderboardApi, I as ImageGenApi, A as AudioGenApi, V as VideoGenApi, q as SpriteGenApi, T as ThreeDGenApi } from './LeaderboardApi-Bp1wndvJ.js';
|
|
2
|
+
import { M as MultiplayerApi } from './MultiplayerApi-TQr01JT7.js';
|
|
3
3
|
|
|
4
4
|
interface StorageApi {
|
|
5
5
|
key(index: number): Promise<string | null>;
|
|
@@ -37,6 +37,8 @@ interface RpcResponse {
|
|
|
37
37
|
detail?: string;
|
|
38
38
|
/** Structured provider rejection detail, when available. */
|
|
39
39
|
errorDetail?: ProviderErrorDetail;
|
|
40
|
+
/** Milliseconds the caller should wait before retrying a rate-limited request. */
|
|
41
|
+
retryAfterMs?: number;
|
|
40
42
|
stack?: string;
|
|
41
43
|
};
|
|
42
44
|
}
|
|
@@ -791,7 +793,7 @@ interface AiMessage {
|
|
|
791
793
|
content: string | AiContentBlock[];
|
|
792
794
|
}
|
|
793
795
|
type AiChatCompletionRequest = {
|
|
794
|
-
/** Model identifier (e.g., 'gpt-
|
|
796
|
+
/** Model identifier (e.g., 'gpt-5.6-luna', 'claude-sonnet-4-6') */
|
|
795
797
|
model: string;
|
|
796
798
|
/** Array of message objects in OpenAI chat format */
|
|
797
799
|
messages: Array<AiMessage>;
|
|
@@ -829,6 +831,29 @@ type AiChatCompletionRequest = {
|
|
|
829
831
|
maxTokens?: number;
|
|
830
832
|
/** Upper bound for tokens generated, including visible output and reasoning tokens */
|
|
831
833
|
maxCompletionTokens?: number;
|
|
834
|
+
/**
|
|
835
|
+
* Requested reasoning (thinking) effort for reasoning-capable models.
|
|
836
|
+
*
|
|
837
|
+
* Per-provider support:
|
|
838
|
+
* - **OpenAI** (`gpt-5` family): all levels, passed through natively as
|
|
839
|
+
* `reasoning_effort`.
|
|
840
|
+
* - **Gemini**: all levels, translated to the model generation's thinking
|
|
841
|
+
* config (thinking level on Gemini 3.x, thinking budget on Gemini 2.5).
|
|
842
|
+
* - **Anthropic** (`claude-*`) and **DeepSeek**: not yet supported — a
|
|
843
|
+
* request carrying this field is rejected with HTTP 400.
|
|
844
|
+
*
|
|
845
|
+
* `'none'` requests minimal/disabled reasoning where the model allows it;
|
|
846
|
+
* models that cannot fully disable thinking (e.g. `gemini-2.5-pro`,
|
|
847
|
+
* Gemini 3.x) clamp to their minimum instead.
|
|
848
|
+
*
|
|
849
|
+
* Reasoning tokens are billed as OUTPUT tokens, so higher efforts increase
|
|
850
|
+
* completion-token usage and cost. When the model reasons, the response's
|
|
851
|
+
* `usage.reasoning_tokens` reports how many of the completion tokens were
|
|
852
|
+
* spent on reasoning.
|
|
853
|
+
*
|
|
854
|
+
* Older backends that predate this field silently ignore it.
|
|
855
|
+
*/
|
|
856
|
+
reasoningEffort?: 'none' | 'low' | 'medium' | 'high';
|
|
832
857
|
/** Sampling temperature (0.0 to 2.0) */
|
|
833
858
|
temperature?: number;
|
|
834
859
|
/** Nucleus sampling parameter (0.0 to 1.0) */
|
|
@@ -1190,6 +1215,11 @@ interface Experiment {
|
|
|
1190
1215
|
readonly groupName: string | null;
|
|
1191
1216
|
}
|
|
1192
1217
|
interface FeaturesApi {
|
|
1218
|
+
/**
|
|
1219
|
+
* @deprecated Platform-managed (1p-only) experiments. For your own A/B
|
|
1220
|
+
* tests use LiveOps experiments: `liveops.getConfigAsync()` → `assignments`.
|
|
1221
|
+
* Slated for removal once remaining 1p callers migrate.
|
|
1222
|
+
*/
|
|
1193
1223
|
getExperiment(experimentName: string): Promise<Experiment | null>;
|
|
1194
1224
|
getFeatureFlag(flagName: string): Promise<boolean>;
|
|
1195
1225
|
getFeatureGate(gateName: string): Promise<boolean>;
|
|
@@ -1201,29 +1231,75 @@ interface LiveOpsOverride {
|
|
|
1201
1231
|
expiresAt?: string;
|
|
1202
1232
|
values: Record<string, unknown>;
|
|
1203
1233
|
}
|
|
1234
|
+
interface LiveOpsVariant {
|
|
1235
|
+
id: string;
|
|
1236
|
+
weight: number;
|
|
1237
|
+
values: Record<string, unknown>;
|
|
1238
|
+
}
|
|
1239
|
+
interface LiveOpsExperiment {
|
|
1240
|
+
id: string;
|
|
1241
|
+
salt?: string;
|
|
1242
|
+
activeAt?: string;
|
|
1243
|
+
expiresAt?: string;
|
|
1244
|
+
variants: LiveOpsVariant[];
|
|
1245
|
+
/** Mock-mode only: short-circuits hashing. Rejected by push-time validators. */
|
|
1246
|
+
forceVariant?: string;
|
|
1247
|
+
}
|
|
1248
|
+
interface ExperimentAssignment {
|
|
1249
|
+
experimentId: string;
|
|
1250
|
+
variantId: string;
|
|
1251
|
+
/** Configured weights, forwarded into the exposure event so the warehouse can
|
|
1252
|
+
* compare the observed split against the intended one (sample-ratio check). */
|
|
1253
|
+
variantWeight: number;
|
|
1254
|
+
totalWeight: number;
|
|
1255
|
+
}
|
|
1256
|
+
/** assignVariant's return: the winning variant plus the weight sum it won under. */
|
|
1257
|
+
interface AssignedVariant {
|
|
1258
|
+
variant: LiveOpsVariant;
|
|
1259
|
+
totalWeight: number;
|
|
1260
|
+
}
|
|
1204
1261
|
interface LiveOpsSection {
|
|
1205
1262
|
values?: Record<string, unknown>;
|
|
1206
1263
|
overrides?: LiveOpsOverride[];
|
|
1264
|
+
experiments?: LiveOpsExperiment[];
|
|
1207
1265
|
}
|
|
1208
1266
|
interface ResolvedLiveOps {
|
|
1209
1267
|
values: Record<string, unknown>;
|
|
1210
1268
|
activeOverrideIds: string[];
|
|
1269
|
+
assignments: ExperimentAssignment[];
|
|
1211
1270
|
/** Epoch-ms of the next window boundary that changes the active set, or null. */
|
|
1212
1271
|
nextChangeAt: number | null;
|
|
1213
1272
|
}
|
|
1273
|
+
/** FNV-1a 32-bit. Stable, portable; do not change without re-shuffling every live experiment. */
|
|
1274
|
+
declare function fnv1a32(input: string): number;
|
|
1275
|
+
declare const BUCKET_COUNT = 10000;
|
|
1276
|
+
/** Double-hash into [0, BUCKET_COUNT). The double pass is load-bearing: bit 0 of a
|
|
1277
|
+
* single fnv1a32 is a parity function of the input chars (odd-char XOR flips it,
|
|
1278
|
+
* odd-prime multiply preserves it), so `hash % 2` gave every 50/50 experiment the
|
|
1279
|
+
* same global player split (verified: 0%/100% cross-experiment agreement). Hashing
|
|
1280
|
+
* the first hash's decimal string breaks that structure (cf. GrowthBook hashVersion 2).
|
|
1281
|
+
* Do not change without re-shuffling every live experiment. */
|
|
1282
|
+
declare function assignmentBucket(seed: string, unitId: string): number;
|
|
1283
|
+
/** Pure deterministic assignment; null on malformed input (degrade-not-throw).
|
|
1284
|
+
* Variants own contiguous bucket ranges in array order, boundaries scaled to
|
|
1285
|
+
* BUCKET_COUNT, so a constant-total weight edit moves only the boundaries,
|
|
1286
|
+
* which is what makes the documented ramp recipe safe. */
|
|
1287
|
+
declare function assignVariant(experiment: LiveOpsExperiment, unitId: string): AssignedVariant | null;
|
|
1214
1288
|
/**
|
|
1215
1289
|
* Resolve a LiveOps `client` section against a caller-supplied clock. Pure: never
|
|
1216
1290
|
* reads an ambient clock (`nowMs` is server-anchored in the SDK real paths,
|
|
1217
1291
|
* `Date.now()` in Mock, UTC now in the CLI preview). Purity is load-bearing — the
|
|
1218
1292
|
* MP authority resolves once at match start with a frozen timestamp.
|
|
1219
1293
|
*/
|
|
1220
|
-
declare function resolveLiveOpsSection(section: LiveOpsSection | undefined, nowMs: number): ResolvedLiveOps;
|
|
1294
|
+
declare function resolveLiveOpsSection(section: LiveOpsSection | undefined, nowMs: number, unitId?: string): ResolvedLiveOps;
|
|
1221
1295
|
|
|
1222
1296
|
/** Resolved config — the foot-gun-free default. */
|
|
1223
1297
|
interface LiveOpsConfigResult {
|
|
1224
|
-
/** Resolved client-visible values (base +
|
|
1298
|
+
/** Resolved client-visible values (base + active overrides + assigned variants). */
|
|
1225
1299
|
values: Record<string, unknown>;
|
|
1226
1300
|
activeOverrideIds: string[];
|
|
1301
|
+
/** Deterministic experiment assignments for the current profile (empty pre-identity). */
|
|
1302
|
+
assignments: ExperimentAssignment[];
|
|
1227
1303
|
/** Server config snapshot id the rules came from — quote it in bug reports. */
|
|
1228
1304
|
configVersion: string;
|
|
1229
1305
|
/** Epoch-ms (server clock) of the next schedule flip, or null. Re-call at/after it. */
|
|
@@ -1233,6 +1309,7 @@ interface LiveOpsConfigResult {
|
|
|
1233
1309
|
interface LiveOpsRawConfig {
|
|
1234
1310
|
values: Record<string, unknown>;
|
|
1235
1311
|
overrides: LiveOpsOverride[];
|
|
1312
|
+
experiments: LiveOpsExperiment[];
|
|
1236
1313
|
configVersion: string;
|
|
1237
1314
|
/** Authoritative server clock at fetch, for callers doing their own resolution. */
|
|
1238
1315
|
serverTimeMs: number;
|
|
@@ -1806,6 +1883,7 @@ interface RundotGameMessage {
|
|
|
1806
1883
|
data?: any;
|
|
1807
1884
|
error?: string;
|
|
1808
1885
|
errorCode?: string;
|
|
1886
|
+
retryAfterMs?: number;
|
|
1809
1887
|
/** Legacy flattened provider detail STRING — the field name is wire-frozen. */
|
|
1810
1888
|
errorDetail?: string;
|
|
1811
1889
|
/** Structured provider rejection detail (new wire field; see errors.ts). */
|
|
@@ -1910,6 +1988,17 @@ declare class RpcSharedAssetsApi implements SharedAssetsApi {
|
|
|
1910
1988
|
private readonly rpcClient;
|
|
1911
1989
|
constructor(rpcClient: RpcClient, rundotGameApi: RundotGameAPI);
|
|
1912
1990
|
loadAssetsBundle(game: string, bundleKey: string, fileType?: string): Promise<ArrayBuffer>;
|
|
1991
|
+
/**
|
|
1992
|
+
* Pull the asset from the host in chunks. Only a host that predates the
|
|
1993
|
+
* chunk protocol (BEGIN rejected with "Unsupported message type") falls
|
|
1994
|
+
* back to the legacy single-shot RPC. A failure DURING the chunked
|
|
1995
|
+
* transfer must NOT fall back to single-shot: pushing the whole asset
|
|
1996
|
+
* through the bridge in one message is the exact Android wedge this
|
|
1997
|
+
* protocol exists to avoid (venus issue #2749). Those errors propagate to
|
|
1998
|
+
* the caller's CDN fallback instead.
|
|
1999
|
+
*/
|
|
2000
|
+
private loadViaHostRpc;
|
|
2001
|
+
private loadSingleShot;
|
|
1913
2002
|
}
|
|
1914
2003
|
interface LoadEmbeddedAssetsRequest {
|
|
1915
2004
|
assetKey: string;
|
|
@@ -1917,6 +2006,21 @@ interface LoadEmbeddedAssetsRequest {
|
|
|
1917
2006
|
interface LoadEmbeddedAssetsResponse {
|
|
1918
2007
|
base64Data: string;
|
|
1919
2008
|
}
|
|
2009
|
+
interface LoadEmbeddedAssetBeginRequest {
|
|
2010
|
+
assetKey: string;
|
|
2011
|
+
}
|
|
2012
|
+
interface LoadEmbeddedAssetBeginResponse {
|
|
2013
|
+
totalBytes: number;
|
|
2014
|
+
maxChunkBytes: number;
|
|
2015
|
+
}
|
|
2016
|
+
interface LoadEmbeddedAssetChunkRequest {
|
|
2017
|
+
assetKey: string;
|
|
2018
|
+
position: number;
|
|
2019
|
+
length: number;
|
|
2020
|
+
}
|
|
2021
|
+
interface LoadEmbeddedAssetChunkResponse {
|
|
2022
|
+
base64Data: string;
|
|
2023
|
+
}
|
|
1920
2024
|
|
|
1921
2025
|
/** the different subscription tiers RUN offers. LITE is lowest, ULTIMATE is highest */
|
|
1922
2026
|
type SubscriptionTier = 'LITE' | 'CORE' | 'PLUS' | 'PRIME' | 'ULTIMATE';
|
|
@@ -2004,6 +2108,30 @@ interface OpenStoreResult {
|
|
|
2004
2108
|
/** The updated balance after the store closed (saves a refetch) */
|
|
2005
2109
|
newBalance: number;
|
|
2006
2110
|
}
|
|
2111
|
+
type DirectPurchaseGrantKind = 'consumable' | 'durable';
|
|
2112
|
+
type DirectPurchaseStorePlatform = 'web' | 'ios' | 'android' | 'steam' | 'telegram';
|
|
2113
|
+
interface DirectPurchaseStorePrice {
|
|
2114
|
+
platform: DirectPurchaseStorePlatform;
|
|
2115
|
+
displayPrice?: string;
|
|
2116
|
+
appStoreProductId?: string;
|
|
2117
|
+
playProductId?: string;
|
|
2118
|
+
stripePriceIds?: Record<string, string>;
|
|
2119
|
+
taxBehavior?: 'inclusive' | 'exclusive';
|
|
2120
|
+
amountByCurrency?: Record<string, number>;
|
|
2121
|
+
stars?: number;
|
|
2122
|
+
}
|
|
2123
|
+
interface DirectPurchaseSku {
|
|
2124
|
+
sku: string;
|
|
2125
|
+
gameId: string;
|
|
2126
|
+
tierId: string;
|
|
2127
|
+
nominalUsd: number;
|
|
2128
|
+
storePrices: DirectPurchaseStorePrice[];
|
|
2129
|
+
grant: {
|
|
2130
|
+
entitlementId: string;
|
|
2131
|
+
quantity: number;
|
|
2132
|
+
kind: DirectPurchaseGrantKind;
|
|
2133
|
+
};
|
|
2134
|
+
}
|
|
2007
2135
|
interface IapApi {
|
|
2008
2136
|
getHardCurrencyBalance(): Promise<number>;
|
|
2009
2137
|
spendCurrency(productId: string, amount: number, options?: SpendCurrencyOptions): Promise<SpendCurrencyResult>;
|
|
@@ -2013,6 +2141,7 @@ interface IapApi {
|
|
|
2013
2141
|
purchaseSubscription(tier: SubscriptionTier, interval: SubscriptionInterval): Promise<PurchaseSubscriptionResponse>;
|
|
2014
2142
|
isUserSubscribed(tier: SubscriptionTier): Promise<boolean>;
|
|
2015
2143
|
hasUserMadePurchase(): Promise<boolean>;
|
|
2144
|
+
listDirectPurchaseSkus(gameId: string): Promise<DirectPurchaseSku[]>;
|
|
2016
2145
|
}
|
|
2017
2146
|
|
|
2018
2147
|
/**
|
|
@@ -2089,6 +2218,35 @@ interface CreditsPurchaseResult {
|
|
|
2089
2218
|
/** Refreshed balance after the paywall closed, or `null` if it couldn't be read. */
|
|
2090
2219
|
balance: CreditBalance | null;
|
|
2091
2220
|
}
|
|
2221
|
+
type GenerationCostEstimateKind = 'image' | 'music' | 'sfx' | 'video' | 'sprite' | 'animate-sprite' | 'sprite-character-animate' | 'tts' | 'text';
|
|
2222
|
+
interface GenerationCostEstimateRequest {
|
|
2223
|
+
kind: GenerationCostEstimateKind;
|
|
2224
|
+
model?: string;
|
|
2225
|
+
provider?: string;
|
|
2226
|
+
mode?: string;
|
|
2227
|
+
durationSeconds?: number;
|
|
2228
|
+
imageSize?: string;
|
|
2229
|
+
removeBackground?: boolean;
|
|
2230
|
+
bgRemovalModel?: string;
|
|
2231
|
+
generateAudio?: boolean;
|
|
2232
|
+
resolution?: string;
|
|
2233
|
+
text?: string;
|
|
2234
|
+
messages?: AiMessage[];
|
|
2235
|
+
system?: string | AiTextContent[];
|
|
2236
|
+
maxTokens?: number;
|
|
2237
|
+
maxCompletionTokens?: number;
|
|
2238
|
+
quantity?: number;
|
|
2239
|
+
}
|
|
2240
|
+
interface GenerationCostEstimate {
|
|
2241
|
+
kind: GenerationCostEstimateKind;
|
|
2242
|
+
credits: number;
|
|
2243
|
+
lowCredits: number;
|
|
2244
|
+
highCredits: number;
|
|
2245
|
+
lowerPercent: number;
|
|
2246
|
+
upperPercent: number;
|
|
2247
|
+
exact: boolean;
|
|
2248
|
+
reason: string;
|
|
2249
|
+
}
|
|
2092
2250
|
/** Construction payload for {@link CreditsExhaustedError}. */
|
|
2093
2251
|
interface CreditsExhaustedErrorInfo {
|
|
2094
2252
|
billedTo: CreditsBilledTo;
|
|
@@ -2134,6 +2292,7 @@ interface CreditsApi {
|
|
|
2134
2292
|
getBalance(): Promise<CreditBalance>;
|
|
2135
2293
|
getSubscription(): Promise<CreditSubscription>;
|
|
2136
2294
|
getPlans(): Promise<CreditPlansCatalog>;
|
|
2295
|
+
estimateGenerationCost(request: GenerationCostEstimateRequest): Promise<GenerationCostEstimate>;
|
|
2137
2296
|
/**
|
|
2138
2297
|
* Open the host's combined paywall (plan upgrade now; top-up packs in a later
|
|
2139
2298
|
* release). Resolves once the player closes it. Reuses the same host UI the
|
|
@@ -4290,9 +4449,9 @@ declare class MockAvatarApi implements Avatar3dApi {
|
|
|
4290
4449
|
/**
|
|
4291
4450
|
* DEFINITIVE TypeScript definitions for Rundot Game API
|
|
4292
4451
|
*
|
|
4293
|
-
* This is the single source of truth for all RUN.
|
|
4452
|
+
* This is the single source of truth for all RUN.world games.
|
|
4294
4453
|
*
|
|
4295
|
-
* Usage in RUN.
|
|
4454
|
+
* Usage in RUN.world games:
|
|
4296
4455
|
* ```typescript
|
|
4297
4456
|
* import type { RundotGameAPI } from '../../rundot-game-api/types';
|
|
4298
4457
|
* declare const RundotGameAPI: RundotGameAPI;
|
|
@@ -4510,6 +4669,11 @@ interface RundotGameAPI {
|
|
|
4510
4669
|
eventName: string;
|
|
4511
4670
|
params?: Record<string, any>;
|
|
4512
4671
|
}): Promise<void>;
|
|
4672
|
+
/**
|
|
4673
|
+
* @deprecated Platform-managed (1p-only) experiments. For your own A/B
|
|
4674
|
+
* tests use LiveOps experiments: `liveops.getConfigAsync()` → `assignments`.
|
|
4675
|
+
* Slated for removal once remaining 1p callers migrate.
|
|
4676
|
+
*/
|
|
4513
4677
|
getExperiment(options: {
|
|
4514
4678
|
experimentName: string;
|
|
4515
4679
|
}): Promise<any>;
|
|
@@ -4719,4 +4883,4 @@ interface AdsApi {
|
|
|
4719
4883
|
showInterstitialAd(options?: ShowInterstitialAdOptions): Promise<boolean>;
|
|
4720
4884
|
}
|
|
4721
4885
|
|
|
4722
|
-
export { type DeviceInfo as $, type AnalyticsApi as A, type BatchRecipeRequirementsResult as B, type NotificationsApi as C, type ScheduleLocalNotification as D, type SubmitMessageInput as E, type SubmitMessageResult as F, type ScheduleNotificationOptions as G, type Host as H, type RCSAvailabilityStatus as I, type ScheduleRCSInput as J, type ScheduleRCSResult as K, type RequestRCSOptInInput as L, type RequestRCSOptInResult as M, type NavigationApi as N, type PopupsApi as O, type Profile as P, type QuitOptions as Q, type RundotGameAPI as R, type SimulationActiveRunsUpdate as S, type ShowToastOptions as T, type LikeDialogResult as U, type CommentsPanelResult as V, type LikeStateResult as W, type ShowInterstitialAdOptions as X, type ShowRewardedAdOptions as Y, type ProfileApi as Z, type DeviceApi as _, type RecipeRequirementQuery as a, type RoomMessageEvent as a$, type EnvironmentApi as a0, type EnvironmentInfo as a1, type SystemApi as a2, type SafeArea as a3, type AddToHomeScreenResult as a4, type CdnApi as a5, type FetchFromCdnOptions as a6, type AssetUrlResult as a7, type TimeApi as a8, type ServerTimeData as a9, type BackButtonCallback as aA, type IdentityChangedCallback as aB, type IdentityChangedEvent as aC, type SimulationApi as aD, type SimulationSlotValidationResult as aE, type SimulationBatchOperation as aF, type SimulationBatchOperationsResult as aG, type SimulationAvailableItem as aH, type SimulationPowerPreview as aI, type SimulationSlotMutationResult as aJ, type SimulationSlotContainer as aK, type SimulationAssignment as aL, type SimulationState as aM, type ExecuteRecipeOptions as aN, type ExecuteRecipeResponse as aO, type CollectRecipeResult as aP, type ResetStateOptions as aQ, type ResetStateResult as aR, type GetActiveRunsOptions as aS, type ExecuteScopedRecipeOptions as aT, type ExecuteScopedRecipeResult as aU, type GetAvailableRecipesOptions as aV, type GetAvailableRecipesResult as aW, type Recipe as aX, type GetBatchRecipeRequirements as aY, type TriggerRecipeChainOptions as aZ, type RoomDataUpdate as a_, type GetFutureTimeOptions as aa, type AiApi as ab, type AiChatCompletionRequest as ac, type AiChatCompletionData as ad, type PromptCompletionRequest as ae, type AiChatCompletionStreamOptions as af, type AiChatCompletionStreamChunk as ag, type HapticsApi as ah, HapticFeedbackStyle as ai, type GamepadSnapshot as aj, type GamepadConnectionEvent as ak, type Subscription as al, type GamepadApi as am, type GamepadLatencyStats as an, type FeaturesApi as ao, type Experiment as ap, type LiveOpsApi as aq, type LiveOpsConfigResult as ar, type LiveOpsRawConfig as as, type LiveOpsSection as at, type LifecycleApi as au, type SleepCallback as av, type AwakeCallback as aw, type PauseCallback as ax, type ResumeCallback as ay, type QuitCallback as az, type RecipeRequirementResult as b, type UgcApi as b$, type ProposedMoveEvent as b0, RundotGameTransport as b1, type RoomsApi as b2, type CreateRoomOptions as b3, type JoinOrCreateRoomOptions as b4, type JoinOrCreateResult as b5, type ListRoomsOptions as b6, type UpdateRoomDataOptions as b7, type RoomMessageRequest as b8, type StartRoomGameOptions as b9, 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 ComposeSocialPostOptions as bI, type ComposeSocialPostResult as bJ, type EntitlementApi as bK, type Entitlement as bL, type LedgerEntry as bM, type StatsApi as bN, type GrantInfo as bO, type CollectiblesApi as bP, type CollectibleCard as bQ, type VipClaimResult as bR, type ShopApi as bS, type StorefrontResponse as bT, type StorefrontItem as bU, type ShopPurchaseResponse as bV, type ShopOrderHistoryResponse as bW, type PromptLoginResult as bX, type AccessTier as bY, type AccessGateApi as bZ, type TextGenApi as b_, type ProposeMoveRequest as ba, type ProposeMoveResult as bb, type ValidateMoveVerdict as bc, type ValidateMoveResult as bd, type RoomSubscriptionOptions as be, type LoggingApi as bf, type IapApi as bg, type SpendCurrencyOptions as bh, type SpendCurrencyResult as bi, type SubscriptionTier as bj, type RunSubscriptionsResponse as bk, type SubscriptionInterval as bl, type PurchaseSubscriptionResponse as bm, type OpenStoreResult as bn, type LoadEmbeddedAssetsResponse as bo, type SharedAssetsApi as bp, type CreditsApi as bq, type CreditsBillingContext as br, type CreditBalance as bs, type CreditSubscription as bt, type CreditPlansCatalog as bu, type OpenPaywallOptions as bv, type CreditsPurchaseResult as bw, type Unsubscribe as bx, type PreloaderApi as by, type SocialApi as bz, type RundotGameAvailableRecipe as c, type AdminThreeDGenListReportsParams as c$, type VideoApi as c0, type AppApi as c1, type AdminUgcApi as c2, type AdminImageGenApi as c3, type AdminVideoGenApi as c4, type AdminSpriteGenApi as c5, type AdminAudioGenApi as c6, type AdminThreeDGenApi as c7, type AppRole as c8, type ResolveLaunchIntentOptions as c9, type FilesApi as cA, type ClipsApi as cB, type AttributionApi as cC, type InitializationContext as cD, type InitializationOptions as cE, type CaptureConsent as cF, type StartClipRecordingOptions as cG, type ClipBlob as cH, type ClipsSupport as cI, type ClipPersistOptions as cJ, type ClipResult as cK, type UgcEntry as cL, type CaptureConsentStatus as cM, AccessDeniedError as cN, type AdminGenApi as cO, type AdminImageGenBrowseParams as cP, type AdminImageGenBrowseResponse as cQ, type AdminImageGenListReportsParams as cR, type AdminImageGenListReportsResponse as cS, type AdminImageGenResolveAction as cT, type AdminSpriteGenBrowseParams as cU, type AdminSpriteGenBrowseResponse as cV, type AdminSpriteGenListReportsParams as cW, type AdminSpriteGenListReportsResponse as cX, type AdminSpriteGenResolveAction as cY, type AdminThreeDGenBrowseParams as cZ, type AdminThreeDGenBrowseResponse as c_, type LaunchIntent as ca, type ReleaseNote as cb, type AdminUgcBrowseParams as cc, type AdminUgcBrowseResponse as cd, type AdminUgcListReportsParams as ce, type AdminUgcListReportsResponse as cf, type AdminUgcResolveAction as cg, type AdminGenBrowseParams as ch, type AdminGenBrowseResponse as ci, type ImageGenEntry as cj, type AdminGenListReportsParams as ck, type AdminGenListReportsResponse as cl, type ImageGenReport as cm, type AdminGenResolveAction as cn, type SpriteGenEntry as co, type SpriteGenReport as cp, type ThreeDGenEntry as cq, type ThreeDGenReport as cr, type Avatar3dApi as cs, type AssetManifest as ct, type Avatar3dConfig as cu, type ShowEditorOptions as cv, type Avatar3dEdits as cw, type AdsApi as cx, type RawEnvironmentInfo as cy, type SharedStorageHostApi as cz, type RundotGameCollectRecipeResult as d, type RCSAvailabilityReason as d$, type AdminThreeDGenListReportsResponse as d0, type AdminThreeDGenResolveAction as d1, type AdminUgcEntry as d2, type AdminVideoGenBrowseParams as d3, type AdminVideoGenBrowseResponse as d4, type AdminVideoGenListReportsParams as d5, type AdminVideoGenListReportsResponse as d6, type AdminVideoGenResolveAction as d7, type AiContentBlock as d8, type AiImageContent as d9, type CreditsExhaustedErrorInfo as dA, type CreditsPurchaseOutcome as dB, GAMEPAD_BUTTON_NAMES as dC, type GamepadAxes as dD, type GamepadButtonName as dE, type GamepadButtonState as dF, type GamepadSource as dG, type GetSubscriptionsForTierRequest as dH, type HudInsets as dI, type IdentityChangeReason as dJ, type InboundForKeyEntry as dK, type InboundMethodIds as dL, type InboundStorageApi as dM, type IsPlayerSubscribedRequest as dN, type JoinOrCreateRoomEnvelopeResponse as dO, type JoinRoomMatchCriteria as dP, type LaunchIntentKind as dQ, type LiveOpsOverride as dR, type LoadEmbeddedAssetsRequest as dS, MockAvatarApi as dT, type NotificationTriggerInput as dU, type OnNotificationCallback as dV, type OnRequestCallback as dW, type OnResponseCallback as dX, type PlatformCapabilities as dY, type ProposedMovePayload as dZ, type PurchaseSubscriptionRequest as d_, type AiImageUrlContent as da, type AiMessage as db, type AiResponseFormat as dc, type AiTextContent as dd, type AiToolResultContent as de, type AiToolUseContent as df, type Asset as dg, type AudioGenEntry as dh, type AudioGenReport as di, CLIP_CONTENT_TYPE as dj, COMPOSE_POST_MAX_TEXT_LENGTH as dk, COMPOSE_POST_MAX_TITLE_LENGTH as dl, COMPOSE_POST_SUBREDDIT_PATTERN as dm, CREDITS_EXHAUSTED_CODE as dn, type Category as dp, type ClipAudioOptions as dq, type ClipCameraOptions as dr, type ClipPipLayout as ds, type ClipPipPosition as dt, type ComposeSocialPostMedia as du, type CreditFreeDailyInfo as dv, type CreditPlan as dw, type CreditTopUpPack as dx, type CreditsBilledTo as dy, CreditsExhaustedError as dz, type RundotGameExecuteRecipeOptions as e, type RCSOptInStatus as e0, ROOM_GAME_PHASES as e1, type RecipeInfo as e2, type ReleaseType as e3, type ResolvedLiveOps as e4, type RoomEnvelopeResponse as e5, type RoomGamePhase as e6, type RoomMessageEventType as e7, type RoomMessagePayload as e8, type RoomsEnvelopeResponse as e9, type SubmitMessageResultChannel as eA, TIER_SUPPORTED_INTERVALS as eB, type Tool as eC, type ToolChoice as eD, type ToolUse as eE, type TimeIntervalTriggerInput as eF, type UgcReport as eG, type VideoGenEntry as eH, type VideoGenReport as eI, asCreditsExhaustedError as eJ, assertTierSupportsInterval as eK, createHost as eL, isCreditsExhaustedError as eM, mapCreditsExhaustion as eN, resolveCollectionItemPrice as eO, resolveLiveOpsSection as eP, toPromptWireRequest as eQ, RpcInboundStorageApi as ea, RpcSharedAssetsApi as eb, type RpcTransport as ec, type RunSubscription as ed, type RundotGameRoomCustomMetadata as ee, type RundotGameRoomPayload as ef, type RundotGameRoomRules as eg, type RundotGameRoomRulesGameState as eh, SHARE_FILE_ALLOWED_MIME_TYPES as ei, SHARE_FILE_MAX_SIZE_BYTES as ej, SOCIAL_COMPOSE_PLATFORMS as ek, type ScheduleRCSStatus as el, type ShareFileMimeType as em, type ShopOrder as en, type SimulationBatchOperationAssign as eo, type SimulationBatchOperationRemove as ep, type SimulationBatchOperationResult as eq, type SimulationPersonalState as er, type SimulationRoomActiveRecipe as es, type SimulationRoomState as et, type SocialComposePlatform as eu, type StorefrontCollection as ev, type StorefrontCollectionItem as ew, type SubPath as ex, type SubmitMessageChannel as ey, type SubmitMessageChannelResult as ez, type RundotGameExecuteRecipeResult as f, type RundotGameExecuteScopedRecipeOptions as g, RundotGameRoom as h, type RundotGameSimulationConfig as i, type RundotGameSimulationEffect as j, type RundotGameSimulationRecipe as k, type RundotGameSimulationStateResponse as l, type SimulationEntityUpdate as m, type SimulationRunSummary as n, type SimulationSnapshotUpdate as o, type SimulationSubscribeOptions as p, type SimulationUpdateData as q, type SimulationUpdateType as r, type RpcRequest as s, type RpcResponse as t, type RpcNotification as u, RpcClient as v, type StorageApi as w, type NavigationStackInfo as x, type PushAppOptions as y, type NavigateToGameOptions as z };
|
|
4886
|
+
export { type DeviceInfo as $, type AnalyticsApi as A, type BatchRecipeRequirementsResult as B, type NotificationsApi as C, type ScheduleLocalNotification as D, type SubmitMessageInput as E, type SubmitMessageResult as F, type ScheduleNotificationOptions as G, type Host as H, type RCSAvailabilityStatus as I, type ScheduleRCSInput as J, type ScheduleRCSResult as K, type RequestRCSOptInInput as L, type RequestRCSOptInResult as M, type NavigationApi as N, type PopupsApi as O, type Profile as P, type QuitOptions as Q, type RundotGameAPI as R, type SimulationActiveRunsUpdate as S, type ShowToastOptions as T, type LikeDialogResult as U, type CommentsPanelResult as V, type LikeStateResult as W, type ShowInterstitialAdOptions as X, type ShowRewardedAdOptions as Y, type ProfileApi as Z, type DeviceApi as _, type RecipeRequirementQuery as a, type RoomDataUpdate as a$, type EnvironmentApi as a0, type EnvironmentInfo as a1, type SystemApi as a2, type SafeArea as a3, type AddToHomeScreenResult as a4, type CdnApi as a5, type FetchFromCdnOptions as a6, type AssetUrlResult as a7, type TimeApi as a8, type ServerTimeData as a9, type QuitCallback as aA, type BackButtonCallback as aB, type IdentityChangedCallback as aC, type IdentityChangedEvent as aD, type SimulationApi as aE, type SimulationSlotValidationResult as aF, type SimulationBatchOperation as aG, type SimulationBatchOperationsResult as aH, type SimulationAvailableItem as aI, type SimulationPowerPreview as aJ, type SimulationSlotMutationResult as aK, type SimulationSlotContainer as aL, type SimulationAssignment as aM, type SimulationState as aN, type ExecuteRecipeOptions as aO, type ExecuteRecipeResponse as aP, type CollectRecipeResult as aQ, type ResetStateOptions as aR, type ResetStateResult as aS, type GetActiveRunsOptions as aT, type ExecuteScopedRecipeOptions as aU, type ExecuteScopedRecipeResult as aV, type GetAvailableRecipesOptions as aW, type GetAvailableRecipesResult as aX, type Recipe as aY, type GetBatchRecipeRequirements as aZ, type TriggerRecipeChainOptions as a_, type GetFutureTimeOptions as aa, type AiApi as ab, type AiChatCompletionRequest as ac, type AiChatCompletionData as ad, type PromptCompletionRequest as ae, type AiChatCompletionStreamOptions as af, type AiChatCompletionStreamChunk as ag, type HapticsApi as ah, HapticFeedbackStyle as ai, type GamepadSnapshot as aj, type GamepadConnectionEvent as ak, type Subscription as al, type GamepadApi as am, type GamepadLatencyStats as an, type FeaturesApi as ao, type Experiment as ap, type ExperimentAssignment as aq, type LiveOpsApi as ar, type LiveOpsConfigResult as as, type LiveOpsRawConfig as at, type LiveOpsSection as au, type LifecycleApi as av, type SleepCallback as aw, type AwakeCallback as ax, type PauseCallback as ay, type ResumeCallback as az, type RecipeRequirementResult as b, type PromptLoginResult as b$, type RoomMessageEvent as b0, type ProposedMoveEvent as b1, RundotGameTransport as b2, type RoomsApi as b3, type CreateRoomOptions as b4, type JoinOrCreateRoomOptions as b5, type JoinOrCreateResult as b6, type ListRoomsOptions as b7, type UpdateRoomDataOptions as b8, type RoomMessageRequest as b9, type CreditsPurchaseResult as bA, type Unsubscribe as bB, type PreloaderApi as bC, type SocialApi as bD, type ShareMetadata as bE, type ShareLinkResult as bF, type SocialQRCodeOptions as bG, type QRCodeResult as bH, type ShareClickData as bI, type ShareFileOptions as bJ, type ShareFileResult as bK, type CanShareFileResult as bL, type ComposeSocialPostOptions as bM, type ComposeSocialPostResult as bN, type EntitlementApi as bO, type Entitlement as bP, type LedgerEntry as bQ, type StatsApi as bR, type GrantInfo as bS, type CollectiblesApi as bT, type CollectibleCard as bU, type VipClaimResult as bV, type ShopApi as bW, type StorefrontResponse as bX, type StorefrontItem as bY, type ShopPurchaseResponse as bZ, type ShopOrderHistoryResponse as b_, type StartRoomGameOptions as ba, type ProposeMoveRequest as bb, type ProposeMoveResult as bc, type ValidateMoveVerdict as bd, type ValidateMoveResult as be, type RoomSubscriptionOptions as bf, type LoggingApi as bg, type IapApi as bh, type SpendCurrencyOptions as bi, type SpendCurrencyResult as bj, type SubscriptionTier as bk, type RunSubscriptionsResponse as bl, type SubscriptionInterval as bm, type PurchaseSubscriptionResponse as bn, type OpenStoreResult as bo, type LoadEmbeddedAssetsResponse as bp, type DirectPurchaseSku as bq, type SharedAssetsApi as br, type CreditsApi as bs, type CreditsBillingContext as bt, type CreditBalance as bu, type CreditSubscription as bv, type CreditPlansCatalog as bw, type GenerationCostEstimateRequest as bx, type GenerationCostEstimate as by, type OpenPaywallOptions as bz, type RundotGameAvailableRecipe as c, type AdminSpriteGenListReportsResponse as c$, type AccessTier as c0, type AccessGateApi as c1, type TextGenApi as c2, type UgcApi as c3, type VideoApi as c4, type AppApi as c5, type AdminUgcApi as c6, type AdminImageGenApi as c7, type AdminVideoGenApi as c8, type AdminSpriteGenApi as c9, type Avatar3dEdits as cA, type AdsApi as cB, type RawEnvironmentInfo as cC, type SharedStorageHostApi as cD, type FilesApi as cE, type ClipsApi as cF, type AttributionApi as cG, type InitializationContext as cH, type InitializationOptions as cI, type CaptureConsent as cJ, type StartClipRecordingOptions as cK, type ClipBlob as cL, type ClipsSupport as cM, type ClipPersistOptions as cN, type ClipResult as cO, type UgcEntry as cP, type CaptureConsentStatus as cQ, AccessDeniedError as cR, type AdminGenApi as cS, type AdminImageGenBrowseParams as cT, type AdminImageGenBrowseResponse as cU, type AdminImageGenListReportsParams as cV, type AdminImageGenListReportsResponse as cW, type AdminImageGenResolveAction as cX, type AdminSpriteGenBrowseParams as cY, type AdminSpriteGenBrowseResponse as cZ, type AdminSpriteGenListReportsParams as c_, type AdminAudioGenApi as ca, type AdminThreeDGenApi as cb, type AppRole as cc, type ResolveLaunchIntentOptions as cd, type LaunchIntent as ce, type ReleaseNote as cf, type AdminUgcBrowseParams as cg, type AdminUgcBrowseResponse as ch, type AdminUgcListReportsParams as ci, type AdminUgcListReportsResponse as cj, type AdminUgcResolveAction as ck, type AdminGenBrowseParams as cl, type AdminGenBrowseResponse as cm, type ImageGenEntry as cn, type AdminGenListReportsParams as co, type AdminGenListReportsResponse as cp, type ImageGenReport as cq, type AdminGenResolveAction as cr, type SpriteGenEntry as cs, type SpriteGenReport as ct, type ThreeDGenEntry as cu, type ThreeDGenReport as cv, type Avatar3dApi as cw, type AssetManifest as cx, type Avatar3dConfig as cy, type ShowEditorOptions as cz, type RundotGameCollectRecipeResult as d, type LiveOpsExperiment as d$, type AdminSpriteGenResolveAction as d0, type AdminThreeDGenBrowseParams as d1, type AdminThreeDGenBrowseResponse as d2, type AdminThreeDGenListReportsParams as d3, type AdminThreeDGenListReportsResponse as d4, type AdminThreeDGenResolveAction as d5, type AdminUgcEntry as d6, type AdminVideoGenBrowseParams as d7, type AdminVideoGenBrowseResponse as d8, type AdminVideoGenListReportsParams as d9, type ComposeSocialPostMedia as dA, type CreditFreeDailyInfo as dB, type CreditPlan as dC, type CreditTopUpPack as dD, type CreditsBilledTo as dE, CreditsExhaustedError as dF, type CreditsExhaustedErrorInfo as dG, type CreditsPurchaseOutcome as dH, type DirectPurchaseGrantKind as dI, type DirectPurchaseStorePlatform as dJ, type DirectPurchaseStorePrice as dK, GAMEPAD_BUTTON_NAMES as dL, type GamepadAxes as dM, type GamepadButtonName as dN, type GamepadButtonState as dO, type GamepadSource as dP, type GenerationCostEstimateKind as dQ, type GetSubscriptionsForTierRequest as dR, type HudInsets as dS, type IdentityChangeReason as dT, type InboundForKeyEntry as dU, type InboundMethodIds as dV, type InboundStorageApi as dW, type IsPlayerSubscribedRequest as dX, type JoinOrCreateRoomEnvelopeResponse as dY, type JoinRoomMatchCriteria as dZ, type LaunchIntentKind as d_, type AdminVideoGenListReportsResponse as da, type AdminVideoGenResolveAction as db, type AiContentBlock as dc, type AiImageContent as dd, type AiImageUrlContent as de, type AiMessage as df, type AiResponseFormat as dg, type AiTextContent as dh, type AiToolResultContent as di, type AiToolUseContent as dj, type Asset as dk, type AssignedVariant as dl, type AudioGenEntry as dm, type AudioGenReport as dn, BUCKET_COUNT as dp, CLIP_CONTENT_TYPE as dq, COMPOSE_POST_MAX_TEXT_LENGTH as dr, COMPOSE_POST_MAX_TITLE_LENGTH as ds, COMPOSE_POST_SUBREDDIT_PATTERN as dt, CREDITS_EXHAUSTED_CODE as du, type Category as dv, type ClipAudioOptions as dw, type ClipCameraOptions as dx, type ClipPipLayout as dy, type ClipPipPosition as dz, type RundotGameExecuteRecipeOptions as e, assignVariant as e$, type LiveOpsOverride as e0, type LiveOpsVariant as e1, type LoadEmbeddedAssetBeginRequest as e2, type LoadEmbeddedAssetBeginResponse as e3, type LoadEmbeddedAssetChunkRequest as e4, type LoadEmbeddedAssetChunkResponse as e5, type LoadEmbeddedAssetsRequest as e6, MockAvatarApi as e7, type NotificationTriggerInput as e8, type OnNotificationCallback as e9, SOCIAL_COMPOSE_PLATFORMS as eA, type ScheduleRCSStatus as eB, type ShareFileMimeType as eC, type ShopOrder as eD, type SimulationBatchOperationAssign as eE, type SimulationBatchOperationRemove as eF, type SimulationBatchOperationResult as eG, type SimulationPersonalState as eH, type SimulationRoomActiveRecipe as eI, type SimulationRoomState as eJ, type SocialComposePlatform as eK, type StorefrontCollection as eL, type StorefrontCollectionItem as eM, type SubPath as eN, type SubmitMessageChannel as eO, type SubmitMessageChannelResult as eP, type SubmitMessageResultChannel as eQ, TIER_SUPPORTED_INTERVALS as eR, type Tool as eS, type ToolChoice as eT, type ToolUse as eU, type TimeIntervalTriggerInput as eV, type UgcReport as eW, type VideoGenEntry as eX, type VideoGenReport as eY, asCreditsExhaustedError as eZ, assertTierSupportsInterval as e_, type OnRequestCallback as ea, type OnResponseCallback as eb, type PlatformCapabilities as ec, type ProposedMovePayload as ed, type PurchaseSubscriptionRequest as ee, type RCSAvailabilityReason as ef, type RCSOptInStatus as eg, ROOM_GAME_PHASES as eh, type RecipeInfo as ei, type ReleaseType as ej, type ResolvedLiveOps as ek, type RoomEnvelopeResponse as el, type RoomGamePhase as em, type RoomMessageEventType as en, type RoomMessagePayload as eo, type RoomsEnvelopeResponse as ep, RpcInboundStorageApi as eq, RpcSharedAssetsApi as er, type RpcTransport as es, type RunSubscription as et, type RundotGameRoomCustomMetadata as eu, type RundotGameRoomPayload as ev, type RundotGameRoomRules as ew, type RundotGameRoomRulesGameState as ex, SHARE_FILE_ALLOWED_MIME_TYPES as ey, SHARE_FILE_MAX_SIZE_BYTES as ez, type RundotGameExecuteRecipeResult as f, assignmentBucket as f0, createHost as f1, fnv1a32 as f2, isCreditsExhaustedError as f3, mapCreditsExhaustion as f4, resolveCollectionItemPrice as f5, resolveLiveOpsSection as f6, toPromptWireRequest as f7, 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
|
-
import { h as ReplayFile } from './types-
|
|
1
|
+
import { h as ReplayFile } from './types-ChJ9TO_o.js';
|
|
2
2
|
|
|
3
3
|
type ImageGenModel = 'gemini-3.1-flash-image-preview' | 'gemini-3-pro-image-preview' | 'gpt-image-1' | 'gpt-image-2';
|
|
4
4
|
type BgRemovalModel = 'bria' | 'birefnet';
|
|
@@ -77,6 +77,12 @@ interface ServerRoom<P extends Protocol> {
|
|
|
77
77
|
readonly playerId: string;
|
|
78
78
|
/** Whether the room is locked */
|
|
79
79
|
readonly locked: boolean;
|
|
80
|
+
/** Authoritative current room roster. */
|
|
81
|
+
readonly players: readonly ServerPlayer[];
|
|
82
|
+
/** Effective server-enforced capacity. */
|
|
83
|
+
readonly maxPlayers: number;
|
|
84
|
+
/** Whether this player created the room. */
|
|
85
|
+
readonly isCreator: boolean;
|
|
80
86
|
/** Current latency in ms (round-trip / 2) */
|
|
81
87
|
readonly latency: number;
|
|
82
88
|
/** Connection state */
|
|
@@ -85,6 +91,8 @@ interface ServerRoom<P extends Protocol> {
|
|
|
85
91
|
on(events: RoomEvents<P>): void;
|
|
86
92
|
/** Send a typed message to the server room. */
|
|
87
93
|
send(message: P): void;
|
|
94
|
+
/** Open or close the room to new seats. Only the room creator is authorized. */
|
|
95
|
+
setSeatingOpen(open: boolean): void;
|
|
88
96
|
/**
|
|
89
97
|
* Send an opaque payload under `msgType` without the typed-message envelope
|
|
90
98
|
* transform. `data` is delivered verbatim (a raw string stays a string), so
|
|
@@ -193,4 +201,4 @@ type MatchmakeOptions = Pick<RoomOptions, 'criteria'> & {
|
|
|
193
201
|
pollIntervalMs?: number;
|
|
194
202
|
};
|
|
195
203
|
|
|
196
|
-
export type { ChatMessageData as C, JoinTicketRequest as J, ListUserRoomsOptions as L, MultiplayerApi as M, Protocol as P, RealtimeRoomSummary as R,
|
|
204
|
+
export type { ChatMessageData as C, JoinTicketRequest as J, ListUserRoomsOptions as L, MultiplayerApi as M, Protocol as P, RealtimeRoomSummary as R, ServerPlayer as S, RoomOptions as a, ServerRoom as b, MatchmakeOptions as c, ConnectionState as d, RoomEvents as e };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { C as CanonicalValue, h as ReplayFile, O as OfflineSession } from './types-
|
|
2
|
-
import {
|
|
1
|
+
import { C as CanonicalValue, c as DeterministicStepContext, h as ReplayFile, O as OfflineSession } from './types-ChJ9TO_o.js';
|
|
2
|
+
import { S as SyncplaySignedReceipt } from './secret-protocol-DY332qWW.js';
|
|
3
|
+
import { S as ServerPlayer, M as MultiplayerApi } from './MultiplayerApi-TQr01JT7.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Game-agnostic input authority (server orders inputs, clients simulate — §2 Option 1).
|
|
@@ -20,6 +21,10 @@ interface ConfirmedInputFrame {
|
|
|
20
21
|
readonly inputs: readonly EncodedInput[];
|
|
21
22
|
/** Slots whose input was substituted (repeated) because it never arrived in time. */
|
|
22
23
|
readonly substitutedSlots: readonly number[];
|
|
24
|
+
/** Human-occupied slots at this authority tick. Omitted by legacy authorities. */
|
|
25
|
+
readonly occupiedSlots?: readonly number[];
|
|
26
|
+
/** Immutable authority-owned consequences applied immediately before this tick's simulation step. */
|
|
27
|
+
readonly commands?: readonly CanonicalValue[];
|
|
23
28
|
readonly checksum: string;
|
|
24
29
|
}
|
|
25
30
|
interface InputAuthorityConfig {
|
|
@@ -63,6 +68,8 @@ interface InputAuthority {
|
|
|
63
68
|
/** Lowest confirmed tick still retained, or -1 when nothing is confirmed yet. */
|
|
64
69
|
readonly earliestRetainedTick: number;
|
|
65
70
|
receiveInput(slot: number, tick: number, input: EncodedInput): InputSubmissionResult;
|
|
71
|
+
recordOccupiedSlots(tick: number, slots: readonly number[]): void;
|
|
72
|
+
queueCommand(tick: number, command: CanonicalValue): void;
|
|
66
73
|
/** Confirm every tick that can be confirmed up to and including `now`. Returns the new frames in order. */
|
|
67
74
|
advance(now: number): readonly ConfirmedInputFrame[];
|
|
68
75
|
/** A confirmed frame still inside the retained window, for redundant re-broadcast. */
|
|
@@ -172,6 +179,107 @@ type DeterministicSessionDecodeResult = {
|
|
|
172
179
|
declare function encodeDeterministicSessionMessage(message: DeterministicSessionMessage): string;
|
|
173
180
|
declare function decodeDeterministicSessionMessage(text: string): DeterministicSessionDecodeResult;
|
|
174
181
|
|
|
182
|
+
interface SyncplaySecretAuthorityCrypto {
|
|
183
|
+
readonly kid: string;
|
|
184
|
+
readonly publicKeySpki: string;
|
|
185
|
+
randomBytes(length: number): Uint8Array;
|
|
186
|
+
sha256(bytes: Uint8Array): Uint8Array;
|
|
187
|
+
sign(bytes: Uint8Array): Uint8Array;
|
|
188
|
+
}
|
|
189
|
+
interface SyncplaySecretBrowserCrypto {
|
|
190
|
+
randomBytes(length: number): Uint8Array;
|
|
191
|
+
sha256(bytes: Uint8Array): Promise<Uint8Array>;
|
|
192
|
+
verify(publicKeySpki: string, bytes: Uint8Array, signature: Uint8Array): Promise<boolean>;
|
|
193
|
+
}
|
|
194
|
+
declare function createBrowserSyncplaySecretCrypto(): SyncplaySecretBrowserCrypto;
|
|
195
|
+
declare function verifySyncplaySignedReceipt(receipt: SyncplaySignedReceipt, publicKeySpki: string, cryptoProvider?: SyncplaySecretBrowserCrypto): Promise<boolean>;
|
|
196
|
+
|
|
197
|
+
interface SyncplaySecretClientTransport {
|
|
198
|
+
sendSecret?(text: string): void;
|
|
199
|
+
onSecretMessage?(handler: (text: string) => void): void;
|
|
200
|
+
}
|
|
201
|
+
interface SyncplaySecretConnectionIdentity {
|
|
202
|
+
readonly playerId?: string;
|
|
203
|
+
readonly slot: number;
|
|
204
|
+
readonly role: 'player' | 'spectator';
|
|
205
|
+
}
|
|
206
|
+
interface SyncplayOwnedSecret<T> {
|
|
207
|
+
readonly tokenId: string;
|
|
208
|
+
readonly systemId: string;
|
|
209
|
+
readonly ownerSlot: number;
|
|
210
|
+
readonly value: T;
|
|
211
|
+
}
|
|
212
|
+
interface SyncplayChoiceResolvedEvent<T> {
|
|
213
|
+
readonly systemId: string;
|
|
214
|
+
readonly requestId: string;
|
|
215
|
+
readonly roundId: string;
|
|
216
|
+
readonly reveals: Readonly<Record<number, T>>;
|
|
217
|
+
readonly missingSlots: readonly number[];
|
|
218
|
+
readonly missingReveal: 'omit' | 'forfeit';
|
|
219
|
+
}
|
|
220
|
+
interface SyncplayRandomDrawnEvent {
|
|
221
|
+
readonly systemId: string;
|
|
222
|
+
readonly requestId: string;
|
|
223
|
+
readonly drawIndex: number;
|
|
224
|
+
readonly value: number;
|
|
225
|
+
}
|
|
226
|
+
interface SyncplayCollectionRevealedEvent<T> {
|
|
227
|
+
readonly systemId: string;
|
|
228
|
+
readonly requestId: string;
|
|
229
|
+
readonly ownerSlot: number;
|
|
230
|
+
readonly tokenId: string;
|
|
231
|
+
readonly action: 'reveal' | 'play';
|
|
232
|
+
readonly value: T;
|
|
233
|
+
}
|
|
234
|
+
interface SyncplayRoleRevealedEvent<T> {
|
|
235
|
+
readonly systemId: string;
|
|
236
|
+
readonly requestId: string;
|
|
237
|
+
readonly slot: number;
|
|
238
|
+
readonly tokenId: string;
|
|
239
|
+
readonly value: T;
|
|
240
|
+
}
|
|
241
|
+
interface SyncplayChoiceClient<T> {
|
|
242
|
+
commit(roundId: string, value: T): Promise<SyncplaySignedReceipt>;
|
|
243
|
+
reveal(roundId: string): Promise<SyncplaySignedReceipt>;
|
|
244
|
+
resolved(roundId: string): Promise<SyncplayChoiceResolvedEvent<T>>;
|
|
245
|
+
}
|
|
246
|
+
interface SyncplayRandomClient {
|
|
247
|
+
draw(): Promise<SyncplayRandomDrawnEvent>;
|
|
248
|
+
}
|
|
249
|
+
interface SyncplayCollectionClient<T> {
|
|
250
|
+
draw(count?: number): Promise<readonly SyncplayOwnedSecret<T>[]>;
|
|
251
|
+
hand(): readonly SyncplayOwnedSecret<T>[];
|
|
252
|
+
reveal(tokenId: string): Promise<SyncplayCollectionRevealedEvent<T>>;
|
|
253
|
+
play(tokenId: string): Promise<SyncplayCollectionRevealedEvent<T>>;
|
|
254
|
+
}
|
|
255
|
+
interface SyncplayRoleClient<T> {
|
|
256
|
+
current(): SyncplayOwnedSecret<T> | undefined;
|
|
257
|
+
whenAssigned(): Promise<SyncplayOwnedSecret<T>>;
|
|
258
|
+
reveal(): Promise<SyncplayRoleRevealedEvent<T>>;
|
|
259
|
+
}
|
|
260
|
+
interface SyncplaySecretsClient {
|
|
261
|
+
whenReady(): Promise<void>;
|
|
262
|
+
choice<T>(systemId: string): SyncplayChoiceClient<T>;
|
|
263
|
+
random(systemId: string): SyncplayRandomClient;
|
|
264
|
+
deck<T>(systemId: string): SyncplayCollectionClient<T>;
|
|
265
|
+
bag<T>(systemId: string): SyncplayCollectionClient<T>;
|
|
266
|
+
role<T>(systemId: string): SyncplayRoleClient<T>;
|
|
267
|
+
acceptConfirmedCommands(commands: readonly CanonicalValue[]): Promise<void>;
|
|
268
|
+
}
|
|
269
|
+
interface CreateSyncplaySecretsClientOptions {
|
|
270
|
+
readonly transport: SyncplaySecretClientTransport;
|
|
271
|
+
readonly connection: () => SyncplaySecretConnectionIdentity;
|
|
272
|
+
readonly crypto?: SyncplaySecretBrowserCrypto;
|
|
273
|
+
}
|
|
274
|
+
declare function createSyncplaySecretsClient(options: CreateSyncplaySecretsClientOptions): SyncplaySecretsClient;
|
|
275
|
+
interface SyncplaySecretEventReader {
|
|
276
|
+
choiceResolved<T>(systemId: string): readonly SyncplayChoiceResolvedEvent<T>[];
|
|
277
|
+
randomDrawn(systemId: string): readonly SyncplayRandomDrawnEvent[];
|
|
278
|
+
collectionRevealed<T>(systemId: string): readonly SyncplayCollectionRevealedEvent<T>[];
|
|
279
|
+
roleRevealed<T>(systemId: string): readonly SyncplayRoleRevealedEvent<T>[];
|
|
280
|
+
}
|
|
281
|
+
declare function createSyncplaySecretEventReader(ctx: Pick<DeterministicStepContext, 'commands'>): SyncplaySecretEventReader;
|
|
282
|
+
|
|
175
283
|
/**
|
|
176
284
|
* Reusable client transport for game-agnostic deterministic multiplayer (§6 M4).
|
|
177
285
|
*
|
|
@@ -185,6 +293,9 @@ declare function decodeDeterministicSessionMessage(text: string): DeterministicS
|
|
|
185
293
|
interface NetworkedClientTransport {
|
|
186
294
|
send(text: string): void;
|
|
187
295
|
onMessage(handler: (text: string) => void): void;
|
|
296
|
+
sendSecret?(text: string): void;
|
|
297
|
+
onSecretMessage?(handler: (text: string) => void): void;
|
|
298
|
+
readonly playerId?: string;
|
|
188
299
|
}
|
|
189
300
|
interface NetworkedSyncplayClientOptions<State, Input> {
|
|
190
301
|
readonly transport: NetworkedClientTransport;
|
|
@@ -233,6 +344,8 @@ interface NetworkedSyncplayClientOptions<State, Input> {
|
|
|
233
344
|
readonly inputDelay?: NetworkedSyncplayClientInputDelayOptions;
|
|
234
345
|
/** Monotonic-enough clock for RTT measurement. Default Date.now. NEVER used by the sim. */
|
|
235
346
|
readonly now?: () => number;
|
|
347
|
+
readonly playerId?: string;
|
|
348
|
+
readonly secretCrypto?: SyncplaySecretBrowserCrypto;
|
|
236
349
|
}
|
|
237
350
|
interface NetworkedSyncplayClientPacingOptions {
|
|
238
351
|
/** Interval between time-sync pings while pumpPaced is driven. Default 1000. */
|
|
@@ -263,6 +376,7 @@ interface NetworkedSyncplayClientNetStats {
|
|
|
263
376
|
readonly rollbacks: number;
|
|
264
377
|
readonly maxRollbackDepth: number;
|
|
265
378
|
}
|
|
379
|
+
type NetworkedSyncplaySlotPresence = 'human' | 'substituted' | 'empty' | 'unknown';
|
|
266
380
|
interface NetworkedSyncplayClient {
|
|
267
381
|
readonly slot: number;
|
|
268
382
|
/** 'player' (holds a slot) or 'spectator' (read-only follower, slot -1). From session-start. */
|
|
@@ -271,8 +385,11 @@ interface NetworkedSyncplayClient {
|
|
|
271
385
|
readonly predictedThrough: number;
|
|
272
386
|
readonly appliedThrough: number;
|
|
273
387
|
readonly rollbacks: number;
|
|
388
|
+
/** Human occupancy at the latest contiguous authority-confirmed frame. */
|
|
389
|
+
readonly confirmedPlayerPresence: readonly NetworkedSyncplaySlotPresence[];
|
|
274
390
|
/** Live local netcode telemetry (RTT, timescale, delay, rollback depth). */
|
|
275
391
|
readonly netStats: NetworkedSyncplayClientNetStats;
|
|
392
|
+
readonly secrets: SyncplaySecretsClient;
|
|
276
393
|
/** Resolves once `session-start` has been received. */
|
|
277
394
|
whenReady(): Promise<void>;
|
|
278
395
|
/** Predict and submit local input up to the prediction budget. */
|
|
@@ -318,11 +435,23 @@ type SyncplayConnectionEvent = {
|
|
|
318
435
|
} | {
|
|
319
436
|
readonly kind: 'reconnecting';
|
|
320
437
|
};
|
|
438
|
+
interface SyncplayRoomOptions {
|
|
439
|
+
readonly maxPlayers?: number;
|
|
440
|
+
}
|
|
441
|
+
interface SyncplayOccupancySnapshot {
|
|
442
|
+
readonly players: readonly ServerPlayer[];
|
|
443
|
+
readonly occupied: number;
|
|
444
|
+
readonly maxPlayers: number;
|
|
445
|
+
readonly full: boolean;
|
|
446
|
+
readonly locked: boolean;
|
|
447
|
+
}
|
|
321
448
|
interface SyncplayRoomTransport extends NetworkedClientTransport {
|
|
322
449
|
/** The shareable room code (e.g. "HX9KWR"). */
|
|
323
450
|
readonly roomCode: string;
|
|
324
451
|
/** This client's player id, as assigned by the server on join. */
|
|
325
452
|
readonly playerId: string;
|
|
453
|
+
readonly occupancy: SyncplayOccupancySnapshot;
|
|
454
|
+
readonly isCreator: boolean;
|
|
326
455
|
/** Leave the deterministic room and close the underlying connection. */
|
|
327
456
|
close(): void;
|
|
328
457
|
/**
|
|
@@ -333,6 +462,8 @@ interface SyncplayRoomTransport extends NetworkedClientTransport {
|
|
|
333
462
|
* the match down.
|
|
334
463
|
*/
|
|
335
464
|
onConnectionEvent(handler: (event: SyncplayConnectionEvent) => void): void;
|
|
465
|
+
onOccupancyChange(handler: (snapshot: SyncplayOccupancySnapshot) => void): () => void;
|
|
466
|
+
setSeatingOpen(open: boolean): void;
|
|
336
467
|
}
|
|
337
468
|
/**
|
|
338
469
|
* Join an existing deterministic room by its 6-char code and return a transport
|
|
@@ -340,7 +471,7 @@ interface SyncplayRoomTransport extends NetworkedClientTransport {
|
|
|
340
471
|
*/
|
|
341
472
|
declare function joinSyncplayRoomByCode(api: MultiplayerApi, code: string): Promise<SyncplayRoomTransport>;
|
|
342
473
|
/** Options for {@link quickMatchSyncplayRoom}. */
|
|
343
|
-
interface QuickMatchSyncplayOptions {
|
|
474
|
+
interface QuickMatchSyncplayOptions extends SyncplayRoomOptions {
|
|
344
475
|
/**
|
|
345
476
|
* Auto-inject a coarse `region` criterion (default true). See
|
|
346
477
|
* {@link quickMatchSyncplayRoom} for the semantics and the tradeoff.
|
|
@@ -374,6 +505,6 @@ declare function quickMatchSyncplayRoom(api: MultiplayerApi, criteria?: Record<s
|
|
|
374
505
|
* (Caller-chosen codes are not supported on create — when the platform grows
|
|
375
506
|
* that path, this signature gains a typed parameter rather than a dead one.)
|
|
376
507
|
*/
|
|
377
|
-
declare function createSyncplayRoom(api: MultiplayerApi): Promise<SyncplayRoomTransport>;
|
|
508
|
+
declare function createSyncplayRoom(api: MultiplayerApi, options?: SyncplayRoomOptions): Promise<SyncplayRoomTransport>;
|
|
378
509
|
|
|
379
|
-
export { type ConfirmedInputFrame as C, type DeterministicSessionDecodeRejection as D, type EncodedInput as E, type InputAuthority as I, type NetworkedClientTransport as N, type QuickMatchSyncplayOptions as Q, type
|
|
510
|
+
export { type SyncplayRoomTransport as A, type SyncplaySecretEventReader as B, type ConfirmedInputFrame as C, type DeterministicSessionDecodeRejection as D, type EncodedInput as E, type SyncplaySecretsClient as F, createBrowserSyncplaySecretCrypto as G, createInputAuthority as H, type InputAuthority as I, createNetworkedSyncplayClient as J, createSyncplayRoom as K, createSyncplaySecretEventReader as L, createSyncplaySecretsClient as M, type NetworkedClientTransport as N, decodeDeterministicSessionMessage as O, deterministicSessionWireVersion as P, type QuickMatchSyncplayOptions as Q, encodeDeterministicSessionMessage as R, type SyncplaySecretAuthorityCrypto as S, joinSyncplayRoomByCode as T, quickMatchSyncplayRoom as U, verifySyncplaySignedReceipt as V, type DeterministicSessionDecodeResult as a, type DeterministicSessionMessage as b, type DeterministicSessionMessageKind as c, type DeterministicSessionRole as d, type InputAuthorityConfig as e, type InputAuthorityRestoreState as f, type InputAuthorityStats as g, type InputRejectionReason as h, type InputSubmissionResult as i, type NetworkedSyncplayClient as j, type NetworkedSyncplayClientInputDelayOptions as k, type NetworkedSyncplayClientNetStats as l, type NetworkedSyncplayClientOptions as m, type NetworkedSyncplayClientPacingOptions as n, type NetworkedSyncplaySlotPresence as o, type SyncplayChoiceClient as p, type SyncplayChoiceResolvedEvent as q, type SyncplayCollectionClient as r, type SyncplayCollectionRevealedEvent as s, type SyncplayOccupancySnapshot as t, type SyncplayOwnedSecret as u, type SyncplayRandomClient as v, type SyncplayRandomDrawnEvent as w, type SyncplayRoleClient as x, type SyncplayRoleRevealedEvent as y, type SyncplayRoomOptions as z };
|