@rydr/game-sdk 1.7.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 +220 -0
- package/dist/client/HardwareStore.d.ts +40 -0
- package/dist/client/HardwareStore.d.ts.map +1 -0
- package/dist/client/HardwareStore.js +36 -0
- package/dist/client/HardwareStore.js.map +1 -0
- package/dist/client/PlatformClient.d.ts +182 -0
- package/dist/client/PlatformClient.d.ts.map +1 -0
- package/dist/client/PlatformClient.js +374 -0
- package/dist/client/PlatformClient.js.map +1 -0
- package/dist/client/Room.d.ts +127 -0
- package/dist/client/Room.d.ts.map +1 -0
- package/dist/client/Room.js +235 -0
- package/dist/client/Room.js.map +1 -0
- package/dist/client/adminContent.d.ts +65 -0
- package/dist/client/adminContent.d.ts.map +1 -0
- package/dist/client/adminContent.js +75 -0
- package/dist/client/adminContent.js.map +1 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +7 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/replayCodec.d.ts +27 -0
- package/dist/client/replayCodec.d.ts.map +1 -0
- package/dist/client/replayCodec.js +74 -0
- package/dist/client/replayCodec.js.map +1 -0
- package/dist/host/PlatformHost.d.ts +169 -0
- package/dist/host/PlatformHost.d.ts.map +1 -0
- package/dist/host/PlatformHost.js +248 -0
- package/dist/host/PlatformHost.js.map +1 -0
- package/dist/host/index.d.ts +3 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +3 -0
- package/dist/host/index.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/protocol/boards.d.ts +61 -0
- package/dist/protocol/boards.d.ts.map +1 -0
- package/dist/protocol/boards.js +53 -0
- package/dist/protocol/boards.js.map +1 -0
- package/dist/protocol/buttons.d.ts +13 -0
- package/dist/protocol/buttons.d.ts.map +1 -0
- package/dist/protocol/buttons.js +2 -0
- package/dist/protocol/buttons.js.map +1 -0
- package/dist/protocol/capabilities.d.ts +23 -0
- package/dist/protocol/capabilities.d.ts.map +1 -0
- package/dist/protocol/capabilities.js +10 -0
- package/dist/protocol/capabilities.js.map +1 -0
- package/dist/protocol/gamedata.d.ts +23 -0
- package/dist/protocol/gamedata.d.ts.map +1 -0
- package/dist/protocol/gamedata.js +2 -0
- package/dist/protocol/gamedata.js.map +1 -0
- package/dist/protocol/guards.d.ts +15 -0
- package/dist/protocol/guards.d.ts.map +1 -0
- package/dist/protocol/guards.js +45 -0
- package/dist/protocol/guards.js.map +1 -0
- package/dist/protocol/identity.d.ts +21 -0
- package/dist/protocol/identity.d.ts.map +1 -0
- package/dist/protocol/identity.js +2 -0
- package/dist/protocol/identity.js.map +1 -0
- package/dist/protocol/index.d.ts +12 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/index.js +12 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/messages.d.ts +407 -0
- package/dist/protocol/messages.d.ts.map +1 -0
- package/dist/protocol/messages.js +2 -0
- package/dist/protocol/messages.js.map +1 -0
- package/dist/protocol/replays.d.ts +67 -0
- package/dist/protocol/replays.d.ts.map +1 -0
- package/dist/protocol/replays.js +14 -0
- package/dist/protocol/replays.js.map +1 -0
- package/dist/protocol/room.d.ts +55 -0
- package/dist/protocol/room.d.ts.map +1 -0
- package/dist/protocol/room.js +13 -0
- package/dist/protocol/room.js.map +1 -0
- package/dist/protocol/version.d.ts +12 -0
- package/dist/protocol/version.d.ts.map +1 -0
- package/dist/protocol/version.js +12 -0
- package/dist/protocol/version.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttons.d.ts","sourceRoot":"","sources":["../../src/protocol/buttons.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5E,uEAAuE;AACvE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttons.js","sourceRoot":"","sources":["../../src/protocol/buttons.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capabilities a game may request from the platform.
|
|
3
|
+
*
|
|
4
|
+
* The game declares the minimum it needs in its handshake; the shell grants a
|
|
5
|
+
* subset (least-privilege). The shell only streams data for granted
|
|
6
|
+
* capabilities, so a game that never asked for `heartRate` never receives it.
|
|
7
|
+
*/
|
|
8
|
+
export type Capability =
|
|
9
|
+
/** Trainer power in watts (`hw.power`). */
|
|
10
|
+
"power"
|
|
11
|
+
/** Pedalling cadence in rpm (`hw.cadence`). */
|
|
12
|
+
| "cadence"
|
|
13
|
+
/** Heart rate in bpm from a paired HRM (`hw.heartRate`). */
|
|
14
|
+
| "heartRate"
|
|
15
|
+
/** Trainer-reported speed in m/s (`hw.speed`). */
|
|
16
|
+
| "speed"
|
|
17
|
+
/** Canonical controller buttons (`input.button`). */
|
|
18
|
+
| "buttons"
|
|
19
|
+
/** Scoped player identity (stable id, display name, physics metrics). */
|
|
20
|
+
| "identity";
|
|
21
|
+
/** Every capability the protocol defines. Useful for dev harnesses. */
|
|
22
|
+
export declare const ALL_CAPABILITIES: readonly Capability[];
|
|
23
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/protocol/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,UAAU;AACpB,2CAA2C;AACzC,OAAO;AACT,+CAA+C;GAC7C,SAAS;AACX,4DAA4D;GAC1D,WAAW;AACb,kDAAkD;GAChD,OAAO;AACT,qDAAqD;GACnD,SAAS;AACX,yEAAyE;GACvE,UAAU,CAAC;AAEf,uEAAuE;AACvE,eAAO,MAAM,gBAAgB,EAAE,SAAS,UAAU,EAOjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/protocol/capabilities.ts"],"names":[],"mappings":"AAqBA,uEAAuE;AACvE,MAAM,CAAC,MAAM,gBAAgB,GAA0B;IACrD,OAAO;IACP,SAAS;IACT,WAAW;IACX,OAAO;IACP,SAAS;IACT,UAAU;CACX,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic game-data store types — the opaque document/KV primitive any game uses
|
|
3
|
+
* to persist content/config/saves with no backend of its own. Mirrors the
|
|
4
|
+
* `boards`/`runs` philosophy: gameId-namespaced, payload opaque to the platform.
|
|
5
|
+
*
|
|
6
|
+
* Three scopes by access pattern:
|
|
7
|
+
* - `shared` — dev-authored content (tracks, waves, songs). Admin-written, public-read.
|
|
8
|
+
* - `player` — per-player owned data (saves, progress). Owner-only read+write.
|
|
9
|
+
* - `public` — player-authored, world-readable (UGC). Owner-write, public-read.
|
|
10
|
+
*/
|
|
11
|
+
export type GameDataScope = "shared" | "player" | "public";
|
|
12
|
+
/** A stored document. `data` is opaque (the game owns its shape). */
|
|
13
|
+
export interface GameDoc {
|
|
14
|
+
id: string;
|
|
15
|
+
data: unknown;
|
|
16
|
+
/** ms timestamp of the last write. */
|
|
17
|
+
updatedAt: number;
|
|
18
|
+
/** Owner playerId — present for `public` (UGC) docs. */
|
|
19
|
+
ownerId?: string;
|
|
20
|
+
/** `shared` drafts are admin-only until published. */
|
|
21
|
+
draft?: boolean;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=gamedata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gamedata.d.ts","sourceRoot":"","sources":["../../src/protocol/gamedata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3D,qEAAqE;AACrE,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;IACd,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gamedata.js","sourceRoot":"","sources":["../../src/protocol/gamedata.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime type guards for the wire protocol.
|
|
3
|
+
*
|
|
4
|
+
* A game iframe and the platform shell both receive `postMessage` traffic from
|
|
5
|
+
* many sources (devtools, analytics, frameworks). These guards filter to genuine
|
|
6
|
+
* SDK messages and discriminate direction, so handlers never act on foreign frames.
|
|
7
|
+
*/
|
|
8
|
+
import type { RydrMessage, GameToPlatformMessage, PlatformToGameMessage } from "./messages";
|
|
9
|
+
/** True if `x` is any SDK protocol message. */
|
|
10
|
+
export declare function isRydrMessage(x: unknown): x is RydrMessage;
|
|
11
|
+
/** True if `x` is a message the platform sends to the game (consume on the game side). */
|
|
12
|
+
export declare function isPlatformToGameMessage(x: unknown): x is PlatformToGameMessage;
|
|
13
|
+
/** True if `x` is a message the game sends to the platform (consume on the platform side). */
|
|
14
|
+
export declare function isGameToPlatformMessage(x: unknown): x is GameToPlatformMessage;
|
|
15
|
+
//# sourceMappingURL=guards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/protocol/guards.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAgCpB,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,WAAW,CAI1D;AAED,0FAA0F;AAC1F,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,qBAAqB,CAE9E;AAED,8FAA8F;AAC9F,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,qBAAqB,CAE9E"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Type strings the platform sends to the game. Kept in sync with {@link PlatformToGameMessage}. */
|
|
2
|
+
const PLATFORM_TO_GAME_TYPES = new Set([
|
|
3
|
+
"rydr/welcome",
|
|
4
|
+
"rydr/reject",
|
|
5
|
+
"rydr/hw.power",
|
|
6
|
+
"rydr/hw.cadence",
|
|
7
|
+
"rydr/hw.heartRate",
|
|
8
|
+
"rydr/hw.speed",
|
|
9
|
+
"rydr/hw.powerBuffer",
|
|
10
|
+
"rydr/input.button",
|
|
11
|
+
"rydr/identity.update",
|
|
12
|
+
"rydr/trainer.status",
|
|
13
|
+
"rydr/lifecycle.pause",
|
|
14
|
+
"rydr/lifecycle.resume",
|
|
15
|
+
"rydr/ping",
|
|
16
|
+
"rydr/leaderboard.submitResult",
|
|
17
|
+
"rydr/leaderboard.queryResult",
|
|
18
|
+
"rydr/gamedata.result",
|
|
19
|
+
"rydr/asset.uploadUrlResult",
|
|
20
|
+
"rydr/replay.result",
|
|
21
|
+
"rydr/run.result",
|
|
22
|
+
"rydr/room.opened",
|
|
23
|
+
"rydr/room.closed",
|
|
24
|
+
"rydr/room.presence",
|
|
25
|
+
"rydr/room.state",
|
|
26
|
+
"rydr/room.message",
|
|
27
|
+
"rydr/room.telemetry",
|
|
28
|
+
"rydr/room.event",
|
|
29
|
+
]);
|
|
30
|
+
/** True if `x` is any SDK protocol message. */
|
|
31
|
+
export function isRydrMessage(x) {
|
|
32
|
+
if (!x || typeof x !== "object")
|
|
33
|
+
return false;
|
|
34
|
+
const m = x;
|
|
35
|
+
return m.rydr === true && typeof m.type === "string" && m.type.startsWith("rydr/");
|
|
36
|
+
}
|
|
37
|
+
/** True if `x` is a message the platform sends to the game (consume on the game side). */
|
|
38
|
+
export function isPlatformToGameMessage(x) {
|
|
39
|
+
return isRydrMessage(x) && PLATFORM_TO_GAME_TYPES.has(x.type);
|
|
40
|
+
}
|
|
41
|
+
/** True if `x` is a message the game sends to the platform (consume on the platform side). */
|
|
42
|
+
export function isGameToPlatformMessage(x) {
|
|
43
|
+
return isRydrMessage(x) && !PLATFORM_TO_GAME_TYPES.has(x.type);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/protocol/guards.ts"],"names":[],"mappings":"AAaA,oGAAoG;AACpG,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC;IAC1D,cAAc;IACd,aAAa;IACb,eAAe;IACf,iBAAiB;IACjB,mBAAmB;IACnB,eAAe;IACf,qBAAqB;IACrB,mBAAmB;IACnB,sBAAsB;IACtB,qBAAqB;IACrB,sBAAsB;IACtB,uBAAuB;IACvB,WAAW;IACX,+BAA+B;IAC/B,8BAA8B;IAC9B,sBAAsB;IACtB,4BAA4B;IAC5B,oBAAoB;IACpB,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,oBAAoB;IACpB,iBAAiB;IACjB,mBAAmB;IACnB,qBAAqB;IACrB,iBAAiB;CAClB,CAAC,CAAC;AAEH,+CAA+C;AAC/C,MAAM,UAAU,aAAa,CAAC,CAAU;IACtC,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9C,MAAM,CAAC,GAAG,CAAuC,CAAC;IAClD,OAAO,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACrF,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,uBAAuB,CAAC,CAAU;IAChD,OAAO,aAAa,CAAC,CAAC,CAAC,IAAI,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAChE,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,uBAAuB,CAAC,CAAU;IAChD,OAAO,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The scoped identity a game receives — deliberately NOT the full player profile.
|
|
3
|
+
*
|
|
4
|
+
* The platform holds PII (real name, gender, year of birth, exact weight). A
|
|
5
|
+
* game only ever receives this redacted view: a stable opaque id, a display
|
|
6
|
+
* name, and the physics metrics it explicitly requested. This is the privacy
|
|
7
|
+
* boundary that makes third-party games safe.
|
|
8
|
+
*/
|
|
9
|
+
export interface ScopedIdentity {
|
|
10
|
+
/** Stable, opaque per-player id. Safe to use as a key; reveals no PII. */
|
|
11
|
+
playerId: string;
|
|
12
|
+
/** Display name chosen for public surfaces (leaderboards, lobbies). */
|
|
13
|
+
displayName: string;
|
|
14
|
+
/** Optional avatar URL. */
|
|
15
|
+
avatarUrl?: string;
|
|
16
|
+
/** Rider weight in kg — present only if `identity` capability granted with physics scope. */
|
|
17
|
+
weightKg?: number;
|
|
18
|
+
/** Functional threshold power in watts — present only if granted. */
|
|
19
|
+
ftp?: number;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/protocol/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/protocol/identity.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The platform↔game wire protocol — the public contract between the RYDR platform and a game. */
|
|
2
|
+
export * from "./version";
|
|
3
|
+
export * from "./capabilities";
|
|
4
|
+
export * from "./identity";
|
|
5
|
+
export * from "./buttons";
|
|
6
|
+
export * from "./boards";
|
|
7
|
+
export * from "./gamedata";
|
|
8
|
+
export * from "./replays";
|
|
9
|
+
export * from "./room";
|
|
10
|
+
export * from "./messages";
|
|
11
|
+
export * from "./guards";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The platform↔game wire protocol — the public contract between the RYDR platform and a game. */
|
|
2
|
+
export * from "./version";
|
|
3
|
+
export * from "./capabilities";
|
|
4
|
+
export * from "./identity";
|
|
5
|
+
export * from "./buttons";
|
|
6
|
+
export * from "./boards";
|
|
7
|
+
export * from "./gamedata";
|
|
8
|
+
export * from "./replays";
|
|
9
|
+
export * from "./room";
|
|
10
|
+
export * from "./messages";
|
|
11
|
+
export * from "./guards";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform↔game wire protocol — the public contract.
|
|
3
|
+
*
|
|
4
|
+
* Every message carries a `rydr: true` marker (so a frame can be told apart
|
|
5
|
+
* from unrelated `postMessage` traffic) and a `type` namespaced under `rydr/`
|
|
6
|
+
* (so it never collides with a game's private game↔engine protocol).
|
|
7
|
+
*
|
|
8
|
+
* This is ONLY the generic boundary: hardware data, scoped identity, lifecycle,
|
|
9
|
+
* and trainer-control commands. Game-specific payloads (tracks, ghosts, race
|
|
10
|
+
* state, workouts) are NOT here — they belong to a game's private inner
|
|
11
|
+
* protocol. Evolve this file ADDITIVELY; never change an existing shape.
|
|
12
|
+
*/
|
|
13
|
+
import type { Capability } from "./capabilities";
|
|
14
|
+
import type { ScopedIdentity } from "./identity";
|
|
15
|
+
import type { ButtonName, ButtonEdge } from "./buttons";
|
|
16
|
+
import type { BoardDefinition, BoardEntry, SubmitScoreResult } from "./boards";
|
|
17
|
+
import type { GameDataScope, GameDoc } from "./gamedata";
|
|
18
|
+
import type { ReplayMeta } from "./replays";
|
|
19
|
+
import type { RoomMember } from "./room";
|
|
20
|
+
/** Marker present on every SDK message. */
|
|
21
|
+
interface RydrTagged {
|
|
22
|
+
readonly rydr: true;
|
|
23
|
+
}
|
|
24
|
+
/** A single buffered power sample, used to back-fill after the platform tab was backgrounded. */
|
|
25
|
+
export interface PowerSample {
|
|
26
|
+
watts: number;
|
|
27
|
+
cadence?: number;
|
|
28
|
+
/** ms timestamp from the platform clock. */
|
|
29
|
+
t: number;
|
|
30
|
+
}
|
|
31
|
+
/** First message a game sends: declares who it is and what it needs. */
|
|
32
|
+
export interface HelloMessage extends RydrTagged {
|
|
33
|
+
type: "rydr/hello";
|
|
34
|
+
gameId: string;
|
|
35
|
+
sdkVersion: string;
|
|
36
|
+
protocolVersion: number;
|
|
37
|
+
capabilities: Capability[];
|
|
38
|
+
}
|
|
39
|
+
/** Game has finished loading and is ready to be shown/played. */
|
|
40
|
+
export interface ReadyMessage extends RydrTagged {
|
|
41
|
+
type: "rydr/ready";
|
|
42
|
+
}
|
|
43
|
+
/** Loading progress, 0–100, for the shell's loading affordance. */
|
|
44
|
+
export interface LoadProgressMessage extends RydrTagged {
|
|
45
|
+
type: "rydr/loadProgress";
|
|
46
|
+
progress: number;
|
|
47
|
+
}
|
|
48
|
+
/** Reply to a platform liveness `ping`. */
|
|
49
|
+
export interface PongMessage extends RydrTagged {
|
|
50
|
+
type: "rydr/pong";
|
|
51
|
+
nonce: number;
|
|
52
|
+
}
|
|
53
|
+
/** Request grade-based (simulation) resistance on the trainer. */
|
|
54
|
+
export interface TrainerSetSimulationMessage extends RydrTagged {
|
|
55
|
+
type: "rydr/trainer.setSimulation";
|
|
56
|
+
gradePercent: number;
|
|
57
|
+
}
|
|
58
|
+
/** Request power-based (ERG) resistance on the trainer. */
|
|
59
|
+
export interface TrainerSetTargetPowerMessage extends RydrTagged {
|
|
60
|
+
type: "rydr/trainer.setTargetPower";
|
|
61
|
+
watts: number;
|
|
62
|
+
}
|
|
63
|
+
/** Toggle ERG mode on/off. */
|
|
64
|
+
export interface TrainerSetErgModeMessage extends RydrTagged {
|
|
65
|
+
type: "rydr/trainer.setErgMode";
|
|
66
|
+
enabled: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** Game's internal route changed; the shell reflects it into the top-level URL. */
|
|
69
|
+
export interface RouteChangedMessage extends RydrTagged {
|
|
70
|
+
type: "rydr/route.changed";
|
|
71
|
+
path: string;
|
|
72
|
+
}
|
|
73
|
+
/** Game asks the shell to show/hide its chrome (e.g. hide the navbar during active play). */
|
|
74
|
+
export interface SetChromeMessage extends RydrTagged {
|
|
75
|
+
type: "rydr/ui.setChrome";
|
|
76
|
+
visible: boolean;
|
|
77
|
+
}
|
|
78
|
+
/** Game asks the shell to show/hide the trainerless power bar (e.g. hide it in an editor). */
|
|
79
|
+
export interface SetPowerBarMessage extends RydrTagged {
|
|
80
|
+
type: "rydr/ui.setPowerBar";
|
|
81
|
+
visible: boolean;
|
|
82
|
+
}
|
|
83
|
+
/** Game asks the shell to exit it (return to the launcher). */
|
|
84
|
+
export interface ExitRequestMessage extends RydrTagged {
|
|
85
|
+
type: "rydr/exitRequest";
|
|
86
|
+
}
|
|
87
|
+
/** Game asks the shell to surface its hardware (reconnect) UI. */
|
|
88
|
+
export interface RequestHardwareModalMessage extends RydrTagged {
|
|
89
|
+
type: "rydr/ui.requestHardwareModal";
|
|
90
|
+
}
|
|
91
|
+
/** Game reports a fatal error to the shell. */
|
|
92
|
+
export interface GameErrorMessage extends RydrTagged {
|
|
93
|
+
type: "rydr/error";
|
|
94
|
+
message: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Game submits a score to a leaderboard. The shell performs the authenticated
|
|
98
|
+
* write (stamping playerId + runId) and replies with {@link LeaderboardSubmitResultMessage}
|
|
99
|
+
* carrying the same `nonce`. `key` selects a parameterized board family member
|
|
100
|
+
* (e.g. per-track): board `{boardId}:{key}`.
|
|
101
|
+
*/
|
|
102
|
+
export interface LeaderboardSubmitMessage extends RydrTagged {
|
|
103
|
+
type: "rydr/leaderboard.submit";
|
|
104
|
+
nonce: number;
|
|
105
|
+
boardId: string;
|
|
106
|
+
value: number;
|
|
107
|
+
key?: string;
|
|
108
|
+
}
|
|
109
|
+
/** Game reads a leaderboard. The shell fetches and replies with {@link LeaderboardQueryResultMessage}. */
|
|
110
|
+
export interface LeaderboardQueryMessage extends RydrTagged {
|
|
111
|
+
type: "rydr/leaderboard.query";
|
|
112
|
+
nonce: number;
|
|
113
|
+
boardId: string;
|
|
114
|
+
key?: string;
|
|
115
|
+
limit?: number;
|
|
116
|
+
}
|
|
117
|
+
/** Game saves an opaque, game-specific run breakdown. Fire-and-forget; the shell stamps runId + playerId. */
|
|
118
|
+
export interface RunSaveMessage extends RydrTagged {
|
|
119
|
+
type: "rydr/run.save";
|
|
120
|
+
breakdown: unknown;
|
|
121
|
+
}
|
|
122
|
+
/** Read one doc from the generic game-data store. Reply: {@link GameDataResultMessage} (`doc`). */
|
|
123
|
+
export interface GameDataGetMessage extends RydrTagged {
|
|
124
|
+
type: "rydr/gamedata.get";
|
|
125
|
+
nonce: number;
|
|
126
|
+
scope: GameDataScope;
|
|
127
|
+
collection: string;
|
|
128
|
+
id: string;
|
|
129
|
+
}
|
|
130
|
+
/** List a collection. Reply: {@link GameDataResultMessage} (`docs`). */
|
|
131
|
+
export interface GameDataListMessage extends RydrTagged {
|
|
132
|
+
type: "rydr/gamedata.list";
|
|
133
|
+
nonce: number;
|
|
134
|
+
scope: GameDataScope;
|
|
135
|
+
collection: string;
|
|
136
|
+
}
|
|
137
|
+
/** Write a doc (scope `player` or `public` only — `shared` is admin-authored). Reply: `ok`. */
|
|
138
|
+
export interface GameDataSaveMessage extends RydrTagged {
|
|
139
|
+
type: "rydr/gamedata.save";
|
|
140
|
+
nonce: number;
|
|
141
|
+
scope: GameDataScope;
|
|
142
|
+
collection: string;
|
|
143
|
+
id: string;
|
|
144
|
+
data: unknown;
|
|
145
|
+
}
|
|
146
|
+
/** Delete an owned doc (scope `player` or `public`). Reply: `ok`. */
|
|
147
|
+
export interface GameDataDeleteMessage extends RydrTagged {
|
|
148
|
+
type: "rydr/gamedata.delete";
|
|
149
|
+
nonce: number;
|
|
150
|
+
scope: GameDataScope;
|
|
151
|
+
collection: string;
|
|
152
|
+
id: string;
|
|
153
|
+
}
|
|
154
|
+
/** Request a presigned upload URL for a binary asset (e.g. an MP3). Reply:
|
|
155
|
+
* {@link AssetUploadUrlResultMessage}. Authed by the per-game author allowlist. */
|
|
156
|
+
export interface AssetUploadUrlMessage extends RydrTagged {
|
|
157
|
+
type: "rydr/asset.uploadUrl";
|
|
158
|
+
nonce: number;
|
|
159
|
+
collection: string;
|
|
160
|
+
filename: string;
|
|
161
|
+
contentType?: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Save a replay/ghost keyed by `runId`: the `blob` is the game's compressed frame time-series
|
|
165
|
+
* (base64; opaque at this layer — the SDK encodes a `ReplayFrame[]` into it), and `meta` is the
|
|
166
|
+
* SDK-derived display summary persisted alongside it for ghost lists. The shell relays the
|
|
167
|
+
* authenticated write to the `replays` party (stamping playerId). A replay aligns to a leaderboard
|
|
168
|
+
* entry via the shared `runId`. Reply: {@link ReplayResultMessage} (`ok`).
|
|
169
|
+
*/
|
|
170
|
+
export interface ReplaySaveMessage extends RydrTagged {
|
|
171
|
+
type: "rydr/replay.save";
|
|
172
|
+
nonce: number;
|
|
173
|
+
runId: string;
|
|
174
|
+
/** base64 string of the game's compressed replay/ghost time-series. */
|
|
175
|
+
blob: string;
|
|
176
|
+
/** Derived display summary (duration + power) stored alongside the blob for ghost lists. */
|
|
177
|
+
meta: ReplayMeta;
|
|
178
|
+
}
|
|
179
|
+
/** Fetch a stored replay by `runId`. Reply: {@link ReplayResultMessage} (`blob`+`meta`, both `null` if absent). */
|
|
180
|
+
export interface ReplayGetMessage extends RydrTagged {
|
|
181
|
+
type: "rydr/replay.get";
|
|
182
|
+
nonce: number;
|
|
183
|
+
runId: string;
|
|
184
|
+
}
|
|
185
|
+
/** Read back an opaque run breakdown by `runId` (the one saved via {@link RunSaveMessage}).
|
|
186
|
+
* Reply: {@link RunGetResultMessage}. */
|
|
187
|
+
export interface RunGetMessage extends RydrTagged {
|
|
188
|
+
type: "rydr/run.get";
|
|
189
|
+
nonce: number;
|
|
190
|
+
runId: string;
|
|
191
|
+
}
|
|
192
|
+
/** Ask the shell to join (open) a room. The shell opens the socket and starts forwarding events. */
|
|
193
|
+
export interface RoomJoinMessage extends RydrTagged {
|
|
194
|
+
type: "rydr/room.join";
|
|
195
|
+
roomId: string;
|
|
196
|
+
}
|
|
197
|
+
/** Ask the shell to leave a room and close its socket. */
|
|
198
|
+
export interface RoomLeaveMessage extends RydrTagged {
|
|
199
|
+
type: "rydr/room.leave";
|
|
200
|
+
roomId: string;
|
|
201
|
+
}
|
|
202
|
+
/** Relay an opaque game message to the room's other members. */
|
|
203
|
+
export interface RoomSendMessage extends RydrTagged {
|
|
204
|
+
type: "rydr/room.send";
|
|
205
|
+
roomId: string;
|
|
206
|
+
data: unknown;
|
|
207
|
+
}
|
|
208
|
+
/** Merge an opaque patch into the room's shared state (last-write-wins) and broadcast it. */
|
|
209
|
+
export interface RoomSetStateMessage extends RydrTagged {
|
|
210
|
+
type: "rydr/room.setState";
|
|
211
|
+
roomId: string;
|
|
212
|
+
patch: Record<string, unknown>;
|
|
213
|
+
}
|
|
214
|
+
/** Schedule a server-stamped orchestration event (the "referee whistle"). `at` is optional —
|
|
215
|
+
* immediate if omitted, a future server-clock instant if given. See {@link RoomEvent}. */
|
|
216
|
+
export interface RoomScheduleEventMessage extends RydrTagged {
|
|
217
|
+
type: "rydr/room.scheduleEvent";
|
|
218
|
+
roomId: string;
|
|
219
|
+
name: string;
|
|
220
|
+
payload?: unknown;
|
|
221
|
+
at?: number;
|
|
222
|
+
}
|
|
223
|
+
export type GameToPlatformMessage = HelloMessage | ReadyMessage | LoadProgressMessage | PongMessage | TrainerSetSimulationMessage | TrainerSetTargetPowerMessage | TrainerSetErgModeMessage | RouteChangedMessage | SetChromeMessage | SetPowerBarMessage | ExitRequestMessage | RequestHardwareModalMessage | GameErrorMessage | LeaderboardSubmitMessage | LeaderboardQueryMessage | RunSaveMessage | GameDataGetMessage | GameDataListMessage | GameDataSaveMessage | GameDataDeleteMessage | AssetUploadUrlMessage | ReplaySaveMessage | ReplayGetMessage | RunGetMessage | RoomJoinMessage | RoomLeaveMessage | RoomSendMessage | RoomSetStateMessage | RoomScheduleEventMessage;
|
|
224
|
+
/** Accepts the handshake: grants capabilities and hands over the scoped identity. */
|
|
225
|
+
export interface WelcomeMessage extends RydrTagged {
|
|
226
|
+
type: "rydr/welcome";
|
|
227
|
+
protocolVersion: number;
|
|
228
|
+
grantedCapabilities: Capability[];
|
|
229
|
+
identity: ScopedIdentity;
|
|
230
|
+
/** Initial deep-link path the game should route to, if any. */
|
|
231
|
+
initialPath?: string;
|
|
232
|
+
/** The game's declared leaderboard boards (catalog), so the SDK can validate ids + format. */
|
|
233
|
+
boards?: BoardDefinition[];
|
|
234
|
+
/** The run this session is recorded under (links score/run to the shell's FIT activity). */
|
|
235
|
+
runId?: string;
|
|
236
|
+
/** The `rydr` backend host (e.g. `rydr.bdefrenne.partykit.dev`) — lets the SDK open a direct
|
|
237
|
+
* WebSocket for realtime rooms (`joinRoom`). HTTP data calls still go through the relay. */
|
|
238
|
+
dataHost?: string;
|
|
239
|
+
}
|
|
240
|
+
/** Rejects the handshake (e.g. unknown game, unsupported protocol, denied capabilities). */
|
|
241
|
+
export interface RejectMessage extends RydrTagged {
|
|
242
|
+
type: "rydr/reject";
|
|
243
|
+
reason: string;
|
|
244
|
+
}
|
|
245
|
+
/** Live trainer power. */
|
|
246
|
+
export interface PowerMessage extends RydrTagged {
|
|
247
|
+
type: "rydr/hw.power";
|
|
248
|
+
watts: number;
|
|
249
|
+
t: number;
|
|
250
|
+
}
|
|
251
|
+
/** Live pedalling cadence. */
|
|
252
|
+
export interface CadenceMessage extends RydrTagged {
|
|
253
|
+
type: "rydr/hw.cadence";
|
|
254
|
+
rpm: number;
|
|
255
|
+
t: number;
|
|
256
|
+
}
|
|
257
|
+
/** Live heart rate. */
|
|
258
|
+
export interface HeartRateMessage extends RydrTagged {
|
|
259
|
+
type: "rydr/hw.heartRate";
|
|
260
|
+
bpm: number;
|
|
261
|
+
t: number;
|
|
262
|
+
}
|
|
263
|
+
/** Live trainer-reported speed. */
|
|
264
|
+
export interface SpeedMessage extends RydrTagged {
|
|
265
|
+
type: "rydr/hw.speed";
|
|
266
|
+
mps: number;
|
|
267
|
+
t: number;
|
|
268
|
+
}
|
|
269
|
+
/** Back-fill of power samples missed while the platform tab was backgrounded. */
|
|
270
|
+
export interface PowerBufferMessage extends RydrTagged {
|
|
271
|
+
type: "rydr/hw.powerBuffer";
|
|
272
|
+
samples: PowerSample[];
|
|
273
|
+
}
|
|
274
|
+
/** A canonical controller button event. */
|
|
275
|
+
export interface InputButtonMessage extends RydrTagged {
|
|
276
|
+
type: "rydr/input.button";
|
|
277
|
+
name: ButtonName;
|
|
278
|
+
edge: ButtonEdge;
|
|
279
|
+
}
|
|
280
|
+
/** Scoped identity changed mid-session (e.g. profile edit in the shell). */
|
|
281
|
+
export interface IdentityUpdateMessage extends RydrTagged {
|
|
282
|
+
type: "rydr/identity.update";
|
|
283
|
+
identity: ScopedIdentity;
|
|
284
|
+
}
|
|
285
|
+
/** Trainer connection/capability status, so the game can show ERG availability etc. */
|
|
286
|
+
export interface TrainerStatusMessage extends RydrTagged {
|
|
287
|
+
type: "rydr/trainer.status";
|
|
288
|
+
connected: boolean;
|
|
289
|
+
ergSupported: boolean;
|
|
290
|
+
}
|
|
291
|
+
/** Shell asks the game to pause (e.g. shell-level modal opened). */
|
|
292
|
+
export interface LifecyclePauseMessage extends RydrTagged {
|
|
293
|
+
type: "rydr/lifecycle.pause";
|
|
294
|
+
}
|
|
295
|
+
/** Shell asks the game to resume. */
|
|
296
|
+
export interface LifecycleResumeMessage extends RydrTagged {
|
|
297
|
+
type: "rydr/lifecycle.resume";
|
|
298
|
+
}
|
|
299
|
+
/** Liveness probe; the game must reply with a `pong` carrying the same nonce. */
|
|
300
|
+
export interface PingMessage extends RydrTagged {
|
|
301
|
+
type: "rydr/ping";
|
|
302
|
+
nonce: number;
|
|
303
|
+
}
|
|
304
|
+
/** Reply to {@link LeaderboardSubmitMessage} (matched by `nonce`). */
|
|
305
|
+
export interface LeaderboardSubmitResultMessage extends RydrTagged {
|
|
306
|
+
type: "rydr/leaderboard.submitResult";
|
|
307
|
+
nonce: number;
|
|
308
|
+
result: SubmitScoreResult;
|
|
309
|
+
}
|
|
310
|
+
/** Reply to {@link LeaderboardQueryMessage} (matched by `nonce`). */
|
|
311
|
+
export interface LeaderboardQueryResultMessage extends RydrTagged {
|
|
312
|
+
type: "rydr/leaderboard.queryResult";
|
|
313
|
+
nonce: number;
|
|
314
|
+
entries: BoardEntry[];
|
|
315
|
+
you?: BoardEntry;
|
|
316
|
+
}
|
|
317
|
+
/** Reply to any `rydr/gamedata.*` request (matched by `nonce`). `get`→`doc`, `list`→`docs`,
|
|
318
|
+
* `save`/`delete`→`ok`. `error` set when the op was denied/failed. */
|
|
319
|
+
export interface GameDataResultMessage extends RydrTagged {
|
|
320
|
+
type: "rydr/gamedata.result";
|
|
321
|
+
nonce: number;
|
|
322
|
+
doc?: GameDoc | null;
|
|
323
|
+
docs?: GameDoc[];
|
|
324
|
+
ok?: boolean;
|
|
325
|
+
error?: string;
|
|
326
|
+
}
|
|
327
|
+
/** Reply to {@link AssetUploadUrlMessage}: a presigned PUT `uploadUrl` + the eventual public `url`. */
|
|
328
|
+
export interface AssetUploadUrlResultMessage extends RydrTagged {
|
|
329
|
+
type: "rydr/asset.uploadUrlResult";
|
|
330
|
+
nonce: number;
|
|
331
|
+
uploadUrl?: string;
|
|
332
|
+
url?: string;
|
|
333
|
+
error?: string;
|
|
334
|
+
}
|
|
335
|
+
/** Reply to {@link ReplaySaveMessage} / {@link ReplayGetMessage} (matched by `nonce`):
|
|
336
|
+
* save→`ok`; get→`blob`+`meta` (`null` when not found). `error` set on failure. */
|
|
337
|
+
export interface ReplayResultMessage extends RydrTagged {
|
|
338
|
+
type: "rydr/replay.result";
|
|
339
|
+
nonce: number;
|
|
340
|
+
ok?: boolean;
|
|
341
|
+
blob?: string | null;
|
|
342
|
+
/** Derived display summary returned with a fetched replay (`null`/absent when not found). */
|
|
343
|
+
meta?: ReplayMeta | null;
|
|
344
|
+
error?: string;
|
|
345
|
+
}
|
|
346
|
+
/** Reply to {@link RunGetMessage} (matched by `nonce`): the opaque `breakdown`, or `null` if absent. */
|
|
347
|
+
export interface RunGetResultMessage extends RydrTagged {
|
|
348
|
+
type: "rydr/run.result";
|
|
349
|
+
nonce: number;
|
|
350
|
+
breakdown?: unknown;
|
|
351
|
+
error?: string;
|
|
352
|
+
}
|
|
353
|
+
/** The room socket opened. */
|
|
354
|
+
export interface RoomOpenedMessage extends RydrTagged {
|
|
355
|
+
type: "rydr/room.opened";
|
|
356
|
+
roomId: string;
|
|
357
|
+
}
|
|
358
|
+
/** The room socket closed (left, dropped, or rejected because the room was full). */
|
|
359
|
+
export interface RoomClosedMessage extends RydrTagged {
|
|
360
|
+
type: "rydr/room.closed";
|
|
361
|
+
roomId: string;
|
|
362
|
+
}
|
|
363
|
+
/** Room membership changed (de-duped by playerId). */
|
|
364
|
+
export interface RoomPresenceMessage extends RydrTagged {
|
|
365
|
+
type: "rydr/room.presence";
|
|
366
|
+
roomId: string;
|
|
367
|
+
members: RoomMember[];
|
|
368
|
+
}
|
|
369
|
+
/** The room's shared opaque state changed. */
|
|
370
|
+
export interface RoomStateMessage extends RydrTagged {
|
|
371
|
+
type: "rydr/room.state";
|
|
372
|
+
roomId: string;
|
|
373
|
+
state: Record<string, unknown>;
|
|
374
|
+
}
|
|
375
|
+
/** A relayed opaque message from a peer in the room. */
|
|
376
|
+
export interface RoomMessageMessage extends RydrTagged {
|
|
377
|
+
type: "rydr/room.message";
|
|
378
|
+
roomId: string;
|
|
379
|
+
from: string;
|
|
380
|
+
data: unknown;
|
|
381
|
+
}
|
|
382
|
+
/** A trusted, shell-stamped telemetry reading for one room member (raw hardware; `from` is the
|
|
383
|
+
* member's playerId). Maps to {@link RoomTelemetry} on the SDK side. */
|
|
384
|
+
export interface RoomTelemetryMessage extends RydrTagged {
|
|
385
|
+
type: "rydr/room.telemetry";
|
|
386
|
+
roomId: string;
|
|
387
|
+
from: string;
|
|
388
|
+
power?: number;
|
|
389
|
+
cadence?: number;
|
|
390
|
+
heartRate?: number;
|
|
391
|
+
t: number;
|
|
392
|
+
}
|
|
393
|
+
/** A server-stamped orchestration event broadcast to the room. Maps to {@link RoomEvent} on the
|
|
394
|
+
* SDK side; `from` is the scheduler's playerId and `at` the shared-clock instant to act on. */
|
|
395
|
+
export interface RoomEventMessage extends RydrTagged {
|
|
396
|
+
type: "rydr/room.event";
|
|
397
|
+
roomId: string;
|
|
398
|
+
name: string;
|
|
399
|
+
payload: unknown;
|
|
400
|
+
at: number;
|
|
401
|
+
from: string;
|
|
402
|
+
}
|
|
403
|
+
export type PlatformToGameMessage = WelcomeMessage | RejectMessage | PowerMessage | CadenceMessage | HeartRateMessage | SpeedMessage | PowerBufferMessage | InputButtonMessage | IdentityUpdateMessage | TrainerStatusMessage | LifecyclePauseMessage | LifecycleResumeMessage | PingMessage | LeaderboardSubmitResultMessage | LeaderboardQueryResultMessage | GameDataResultMessage | AssetUploadUrlResultMessage | ReplayResultMessage | RunGetResultMessage | RoomOpenedMessage | RoomClosedMessage | RoomPresenceMessage | RoomStateMessage | RoomMessageMessage | RoomTelemetryMessage | RoomEventMessage;
|
|
404
|
+
/** Any message in the protocol. */
|
|
405
|
+
export type RydrMessage = GameToPlatformMessage | PlatformToGameMessage;
|
|
406
|
+
export {};
|
|
407
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","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