@rydr/game-sdk 2.1.1 → 3.0.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.
@@ -1,23 +1,22 @@
1
1
  /**
2
2
  * Canonical, source-agnostic controller vocabulary.
3
3
  *
4
- * Every physical controller (phone, keyboard, Zwift Play) is normalised to
5
- * these names by the platform before it reaches a game. The game never learns
6
- * which device produced a pressonly the canonical name and edge. This keeps
7
- * games decoupled from hardware specifics and is the same vocabulary the
8
- * platform's input layer already uses.
4
+ * Every physical controller (Zwift Play, keyboard, phone) is normalised to these names by the
5
+ * platform before it reaches a game. The game never learns which device produced a press — only
6
+ * the canonical name and edgewhich keeps games decoupled from hardware specifics.
9
7
  *
10
- * The action buttons are intentionally neutral: `PRIMARY`/`SECONDARY` carry no
11
- * built-in meaning (confirm, back, reload, hide, …) each game assigns its own.
8
+ * - **Directions** `UP`/`DOWN`/`LEFT`/`RIGHT` (the D-pad / arrow keys).
9
+ * - **Face buttons** `A`/`B`/`Y`/`Z`, the four buttons on the controller (Zwift Play layout:
10
+ * A right, B bottom, Y top, Z left). They carry no built-in meaning — each game assigns its
11
+ * own — but the platform **house convention** is `A` = **confirm / primary action** and `Z` =
12
+ * **back / cancel**, with `B`/`Y` as contextual extras. Follow it so confirm/back stay
13
+ * consistent across the library, and show the actual button glyph (A/B/Y/Z, by colour) in
14
+ * on-screen prompts rather than a generic label.
12
15
  *
13
- * The four Zwift face buttons are streamed ADDITIVELY: each press emits BOTH its
14
- * raw hardware label (`A`/`B`/`Y`/`Z`, arranged right/bottom/top/left on the
15
- * controller — for games that want all four distinctly) AND the neutral collapse
16
- * (`A`/`B` → `PRIMARY`, `Y`/`Z` → `SECONDARY` — what most games listen for). A
17
- * game subscribes to whichever vocabulary it wants. Phone / keyboard emit
18
- * `PRIMARY`/`SECONDARY` for their two neutral action buttons.
16
+ * Devices with fewer than four face buttons (e.g. a phone) expose at least the `A`/`Z`
17
+ * confirm/back pair don't require `B`/`Y` for a flow that must work on every input.
19
18
  */
20
- export type ButtonName = "PRIMARY" | "SECONDARY" | "UP" | "DOWN" | "LEFT" | "RIGHT" | "A" | "B" | "Y" | "Z";
19
+ export type ButtonName = "UP" | "DOWN" | "LEFT" | "RIGHT" | "A" | "B" | "Y" | "Z";
21
20
  /** Press = "down", release = "up". A held button emits one of each. */
22
21
  export type ButtonEdge = "down" | "up";
23
22
  //# sourceMappingURL=buttons.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buttons.d.ts","sourceRoot":"","sources":["../../src/protocol/buttons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,WAAW,GACX,IAAI,GACJ,MAAM,GACN,MAAM,GACN,OAAO,GAEP,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAC;AAER,uEAAuE;AACvE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC"}
1
+ {"version":3,"file":"buttons.d.ts","sourceRoot":"","sources":["../../src/protocol/buttons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,UAAU,GAClB,IAAI,GACJ,MAAM,GACN,MAAM,GACN,OAAO,GAGP,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAC;AAER,uEAAuE;AACvE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC"}
@@ -6,8 +6,8 @@
6
6
  * built against an older protocol keeps working. Evolve the protocol
7
7
  * ADDITIVELY — never change or remove an existing message shape.
8
8
  */
9
- export declare const RYDR_PROTOCOL_VERSION: 10;
9
+ export declare const RYDR_PROTOCOL_VERSION: 11;
10
10
  /** Semver of this SDK build. Sent in the handshake for telemetry/debugging.
11
11
  * (Bumped to 2.0.0 by `npm version major` on release — see CHANGELOG [Unreleased].) */
12
- export declare const RYDR_SDK_VERSION = "2.1.1";
12
+ export declare const RYDR_SDK_VERSION = "3.0.0";
13
13
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiBH,eAAO,MAAM,qBAAqB,EAAG,EAAW,CAAC;AAEjD;wFACwF;AACxF,eAAO,MAAM,gBAAgB,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAqBH,eAAO,MAAM,qBAAqB,EAAG,EAAW,CAAC;AAEjD;wFACwF;AACxF,eAAO,MAAM,gBAAgB,UAAU,CAAC"}
@@ -22,8 +22,12 @@
22
22
  // Bumped 9 → 10: adds `rydr/leaderboard.rankQuery` so a game can ask where an arbitrary value would
23
23
  // rank WITHOUT submitting it — a read-only standing for an in-progress score (`getRank`). Additive —
24
24
  // older shells never reply, so the call rejects (timeout) and callers treat the rank as optional.
25
- export const RYDR_PROTOCOL_VERSION = 10;
25
+ // Bumped 10 11: button vocabulary dropped the neutral `PRIMARY`/`SECONDARY` pair (BREAKING — the
26
+ // `input.button` `name` values no longer include them). Every controller now normalises to the four
27
+ // raw face buttons `A`/`B`/`Y`/`Z` (+ `UP`/`DOWN`/`LEFT`/`RIGHT`), with the house convention
28
+ // A = confirm, Z = back. Migrate: `name === "PRIMARY"` → `"A"`, `name === "SECONDARY"` → `"Z"`.
29
+ export const RYDR_PROTOCOL_VERSION = 11;
26
30
  /** Semver of this SDK build. Sent in the handshake for telemetry/debugging.
27
31
  * (Bumped to 2.0.0 by `npm version major` on release — see CHANGELOG [Unreleased].) */
28
- export const RYDR_SDK_VERSION = "2.1.1";
32
+ export const RYDR_SDK_VERSION = "3.0.0";
29
33
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,8FAA8F;AAC9F,yDAAyD;AACzD,4FAA4F;AAC5F,oGAAoG;AACpG,kGAAkG;AAClG,6EAA6E;AAC7E,kGAAkG;AAClG,uGAAuG;AACvG,wFAAwF;AACxF,oGAAoG;AACpG,gGAAgG;AAChG,yFAAyF;AACzF,kHAAkH;AAClH,oGAAoG;AACpG,qGAAqG;AACrG,kGAAkG;AAClG,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAW,CAAC;AAEjD;wFACwF;AACxF,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,8FAA8F;AAC9F,yDAAyD;AACzD,4FAA4F;AAC5F,oGAAoG;AACpG,kGAAkG;AAClG,6EAA6E;AAC7E,kGAAkG;AAClG,uGAAuG;AACvG,wFAAwF;AACxF,oGAAoG;AACpG,gGAAgG;AAChG,yFAAyF;AACzF,kHAAkH;AAClH,oGAAoG;AACpG,qGAAqG;AACrG,kGAAkG;AAClG,mGAAmG;AACnG,oGAAoG;AACpG,6FAA6F;AAC7F,gGAAgG;AAChG,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAW,CAAC;AAEjD;wFACwF;AACxF,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rydr/game-sdk",
3
- "version": "2.1.1",
3
+ "version": "3.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/bdefrenne/rydr-game-sdk.git"