@thegeem/protocol 0.1.23 → 0.1.24

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/dist/index.cjs CHANGED
@@ -123,7 +123,14 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
123
123
  // Host's IN-PROGRESS mode selection in the lobby — a live preview so waiting players see which mode
124
124
  // is coming before start. Distinct from startGame.modeId (which commits it); the relay defaults
125
125
  // startGame to this when modeId is omitted. Re-broadcasts the lobby.
126
- import_zod.z.object({ t: import_zod.z.literal("setMode"), modeId: import_zod.z.enum(MODE_IDS) }),
126
+ // The room's "what's next" announcement (gs#49) — host-only, LOBBY-only. In a room-first قعدة the
127
+ // room outlives each game, so this is how joiners learn what they're about to play instead of
128
+ // finding out when the board appears. Carries the GAME (tile) and/or the trivia MODE; the server
129
+ // re-broadcasts `lobby` so everyone — including someone who joins later — sees `gameId`/`modeId`.
130
+ // `modeId` alone still works (pre-gs#49 clients); `game` is what lets a host announce a tile with
131
+ // no modes (dama/ersimha), which `modeId` could never express. An incoherent pair (a mode that
132
+ // doesn't belong to the game) is rejected with `bad_mode` rather than silently resolved.
133
+ import_zod.z.object({ t: import_zod.z.literal("setMode"), game: import_zod.z.enum(GAME_IDS).optional(), modeId: import_zod.z.enum(MODE_IDS).optional() }),
127
134
  // Host signals it's busy configuring the game (categories/rounds/mode) so waiting players can show
128
135
  // a "host is setting up…" state instead of a frozen-looking lobby. 'idle' when the settings close.
129
136
  import_zod.z.object({ t: import_zod.z.literal("hostActivity"), activity: import_zod.z.enum(["configuring", "idle"]) }),
package/dist/index.d.cts CHANGED
@@ -301,13 +301,16 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
301
301
  teamIndex: number;
302
302
  }>, z.ZodObject<{
303
303
  t: z.ZodLiteral<"setMode">;
304
- modeId: z.ZodEnum<["solo", "oneDevice", "snag", "multiplayer"]>;
304
+ game: z.ZodOptional<z.ZodEnum<["seedha", "snag", "trivia", "dama", "ersimha"]>>;
305
+ modeId: z.ZodOptional<z.ZodEnum<["solo", "oneDevice", "snag", "multiplayer"]>>;
305
306
  }, "strip", z.ZodTypeAny, {
306
307
  t: "setMode";
307
- modeId: "snag" | "solo" | "oneDevice" | "multiplayer";
308
+ game?: "seedha" | "snag" | "trivia" | "dama" | "ersimha" | undefined;
309
+ modeId?: "snag" | "solo" | "oneDevice" | "multiplayer" | undefined;
308
310
  }, {
309
311
  t: "setMode";
310
- modeId: "snag" | "solo" | "oneDevice" | "multiplayer";
312
+ game?: "seedha" | "snag" | "trivia" | "dama" | "ersimha" | undefined;
313
+ modeId?: "snag" | "solo" | "oneDevice" | "multiplayer" | undefined;
311
314
  }>, z.ZodObject<{
312
315
  t: z.ZodLiteral<"hostActivity">;
313
316
  activity: z.ZodEnum<["configuring", "idle"]>;
package/dist/index.d.ts CHANGED
@@ -301,13 +301,16 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
301
301
  teamIndex: number;
302
302
  }>, z.ZodObject<{
303
303
  t: z.ZodLiteral<"setMode">;
304
- modeId: z.ZodEnum<["solo", "oneDevice", "snag", "multiplayer"]>;
304
+ game: z.ZodOptional<z.ZodEnum<["seedha", "snag", "trivia", "dama", "ersimha"]>>;
305
+ modeId: z.ZodOptional<z.ZodEnum<["solo", "oneDevice", "snag", "multiplayer"]>>;
305
306
  }, "strip", z.ZodTypeAny, {
306
307
  t: "setMode";
307
- modeId: "snag" | "solo" | "oneDevice" | "multiplayer";
308
+ game?: "seedha" | "snag" | "trivia" | "dama" | "ersimha" | undefined;
309
+ modeId?: "snag" | "solo" | "oneDevice" | "multiplayer" | undefined;
308
310
  }, {
309
311
  t: "setMode";
310
- modeId: "snag" | "solo" | "oneDevice" | "multiplayer";
312
+ game?: "seedha" | "snag" | "trivia" | "dama" | "ersimha" | undefined;
313
+ modeId?: "snag" | "solo" | "oneDevice" | "multiplayer" | undefined;
311
314
  }>, z.ZodObject<{
312
315
  t: z.ZodLiteral<"hostActivity">;
313
316
  activity: z.ZodEnum<["configuring", "idle"]>;
package/dist/index.js CHANGED
@@ -88,7 +88,14 @@ var ClientMsg = z.discriminatedUnion("t", [
88
88
  // Host's IN-PROGRESS mode selection in the lobby — a live preview so waiting players see which mode
89
89
  // is coming before start. Distinct from startGame.modeId (which commits it); the relay defaults
90
90
  // startGame to this when modeId is omitted. Re-broadcasts the lobby.
91
- z.object({ t: z.literal("setMode"), modeId: z.enum(MODE_IDS) }),
91
+ // The room's "what's next" announcement (gs#49) — host-only, LOBBY-only. In a room-first قعدة the
92
+ // room outlives each game, so this is how joiners learn what they're about to play instead of
93
+ // finding out when the board appears. Carries the GAME (tile) and/or the trivia MODE; the server
94
+ // re-broadcasts `lobby` so everyone — including someone who joins later — sees `gameId`/`modeId`.
95
+ // `modeId` alone still works (pre-gs#49 clients); `game` is what lets a host announce a tile with
96
+ // no modes (dama/ersimha), which `modeId` could never express. An incoherent pair (a mode that
97
+ // doesn't belong to the game) is rejected with `bad_mode` rather than silently resolved.
98
+ z.object({ t: z.literal("setMode"), game: z.enum(GAME_IDS).optional(), modeId: z.enum(MODE_IDS).optional() }),
92
99
  // Host signals it's busy configuring the game (categories/rounds/mode) so waiting players can show
93
100
  // a "host is setting up…" state instead of a frozen-looking lobby. 'idle' when the settings close.
94
101
  z.object({ t: z.literal("hostActivity"), activity: z.enum(["configuring", "idle"]) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thegeem/protocol",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Geem's wire protocol — shared zod schemas + TypeScript types for talking to the Geem game server over Socket.IO. The source of truth all clients implement against.",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://geem.tv",