@thegeem/protocol 0.1.25 → 0.1.27

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
@@ -113,6 +113,15 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
113
113
  import_zod.z.object({ t: import_zod.z.literal("setProfile"), name: DisplayName.optional(), avatar: Avatar.optional(), character: Character.optional() }),
114
114
  import_zod.z.object({ t: import_zod.z.literal("joinRoom"), code: RoomCode, name: DisplayName, avatar: Avatar.optional(), character: Character.optional(), pv: Pv, idToken: IdToken, platform: Platform }),
115
115
  import_zod.z.object({ t: import_zod.z.literal("resume"), code: RoomCode, token: import_zod.z.string().max(120), avatar: Avatar.optional(), character: Character.optional(), pv: Pv, idToken: IdToken, platform: Platform }),
116
+ // Participation (D-042): every person in a room is PLAYING or WATCHING, one model for every game.
117
+ // The badge means "I'm IN", NOT "I'm on the board" — the playing list is ORDERED and each game seats
118
+ // up to its own capacity (دامة 2; ارسمها/trivia everyone), so extras are WAITING rather than wearing a
119
+ // badge that lies. Omit `playerId` to change yourself. PERMISSIONS: the host may set anyone (and that
120
+ // seat is PINNED — a self-join can't displace it); a player may change only THEMSELVES, always allowed
121
+ // OUT (even if the host pinned them — nobody is forced to play) and back IN only if a seat is free.
122
+ // Lobby-only; the server re-broadcasts `lobby`. Everyone defaults to playing, so a normal room needs
123
+ // ZERO taps and behaves exactly as before.
124
+ import_zod.z.object({ t: import_zod.z.literal("setPlaying"), playerId: PlayerId.optional(), playing: import_zod.z.boolean() }),
116
125
  import_zod.z.object({ t: import_zod.z.literal("leaveRoom") }),
117
126
  import_zod.z.object({ t: import_zod.z.literal("approve"), playerId: PlayerId }),
118
127
  import_zod.z.object({ t: import_zod.z.literal("reject"), playerId: PlayerId }),
@@ -155,6 +164,13 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
155
164
  // false = the first two approved joiners take the board and the host WATCHES
156
165
  // (yourColor:null) while keeping every host power. Needs 2 approved joiners.
157
166
  hostPlays: import_zod.z.boolean().optional(),
167
+ // Name the seats explicitly instead of taking them by join order (gs#47 Ask 2, layered on per
168
+ // D-037). Exactly two DISTINCT ids, both approved members of the room (the host may be one):
169
+ // Order matters where a game seats a fixed number: دامة takes `players[0]` as black (moves first).
170
+ // Everyone not listed WATCHES. When present this OVERRIDES `hostPlays` and the lobby's playing list —
171
+ // an explicit seating beats an implicit one.
172
+ // Violations are rejected with `invalid_seat`. Consumed by دامة (the only fixed-seat game today).
173
+ players: import_zod.z.array(PlayerId).length(2).optional(),
158
174
  // PREFERRED: pick a mode from the registry (see MODES). The server maps it to the engine
159
175
  // rules. Send this and omit buzzerMode/noHost. Falls back to the legacy flags below if omitted.
160
176
  modeId: import_zod.z.enum(MODE_IDS).optional(),
package/dist/index.d.cts CHANGED
@@ -269,6 +269,18 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
269
269
  pv?: number | undefined;
270
270
  idToken?: string | undefined;
271
271
  platform?: "web" | "ios" | "android" | undefined;
272
+ }>, z.ZodObject<{
273
+ t: z.ZodLiteral<"setPlaying">;
274
+ playerId: z.ZodOptional<z.ZodString>;
275
+ playing: z.ZodBoolean;
276
+ }, "strip", z.ZodTypeAny, {
277
+ t: "setPlaying";
278
+ playing: boolean;
279
+ playerId?: string | undefined;
280
+ }, {
281
+ t: "setPlaying";
282
+ playing: boolean;
283
+ playerId?: string | undefined;
272
284
  }>, z.ZodObject<{
273
285
  t: z.ZodLiteral<"leaveRoom">;
274
286
  }, "strip", z.ZodTypeAny, {
@@ -356,6 +368,7 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
356
368
  totalRounds: z.ZodNumber;
357
369
  categoryIds: z.ZodArray<z.ZodString, "many">;
358
370
  hostPlays: z.ZodOptional<z.ZodBoolean>;
371
+ players: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
359
372
  modeId: z.ZodOptional<z.ZodEnum<["solo", "oneDevice", "snag", "multiplayer"]>>;
360
373
  buzzerMode: z.ZodOptional<z.ZodEnum<["off", "solo", "race", "controller"]>>;
361
374
  noHost: z.ZodOptional<z.ZodBoolean>;
@@ -366,6 +379,7 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
366
379
  game?: "seedha" | "snag" | "trivia" | "dama" | "ersimha" | undefined;
367
380
  modeId?: "snag" | "solo" | "oneDevice" | "multiplayer" | undefined;
368
381
  hostPlays?: boolean | undefined;
382
+ players?: string[] | undefined;
369
383
  buzzerMode?: "solo" | "off" | "race" | "controller" | undefined;
370
384
  noHost?: boolean | undefined;
371
385
  }, {
@@ -375,6 +389,7 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
375
389
  game?: "seedha" | "snag" | "trivia" | "dama" | "ersimha" | undefined;
376
390
  modeId?: "snag" | "solo" | "oneDevice" | "multiplayer" | undefined;
377
391
  hostPlays?: boolean | undefined;
392
+ players?: string[] | undefined;
378
393
  buzzerMode?: "solo" | "off" | "race" | "controller" | undefined;
379
394
  noHost?: boolean | undefined;
380
395
  }>, z.ZodObject<{
@@ -642,6 +657,10 @@ interface TeamSlotView {
642
657
  color: string;
643
658
  }
644
659
  interface LobbyPlayer {
660
+ /** D-042: is this person IN for the next game? (false = watching). Absent on pre-D-042 servers. */
661
+ playing?: boolean;
662
+ /** D-042: the HOST put them in, so a self-join can't displace them. Clients may mark it. */
663
+ pinned?: boolean;
645
664
  id: string;
646
665
  name: string;
647
666
  approved: boolean;
package/dist/index.d.ts CHANGED
@@ -269,6 +269,18 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
269
269
  pv?: number | undefined;
270
270
  idToken?: string | undefined;
271
271
  platform?: "web" | "ios" | "android" | undefined;
272
+ }>, z.ZodObject<{
273
+ t: z.ZodLiteral<"setPlaying">;
274
+ playerId: z.ZodOptional<z.ZodString>;
275
+ playing: z.ZodBoolean;
276
+ }, "strip", z.ZodTypeAny, {
277
+ t: "setPlaying";
278
+ playing: boolean;
279
+ playerId?: string | undefined;
280
+ }, {
281
+ t: "setPlaying";
282
+ playing: boolean;
283
+ playerId?: string | undefined;
272
284
  }>, z.ZodObject<{
273
285
  t: z.ZodLiteral<"leaveRoom">;
274
286
  }, "strip", z.ZodTypeAny, {
@@ -356,6 +368,7 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
356
368
  totalRounds: z.ZodNumber;
357
369
  categoryIds: z.ZodArray<z.ZodString, "many">;
358
370
  hostPlays: z.ZodOptional<z.ZodBoolean>;
371
+ players: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
359
372
  modeId: z.ZodOptional<z.ZodEnum<["solo", "oneDevice", "snag", "multiplayer"]>>;
360
373
  buzzerMode: z.ZodOptional<z.ZodEnum<["off", "solo", "race", "controller"]>>;
361
374
  noHost: z.ZodOptional<z.ZodBoolean>;
@@ -366,6 +379,7 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
366
379
  game?: "seedha" | "snag" | "trivia" | "dama" | "ersimha" | undefined;
367
380
  modeId?: "snag" | "solo" | "oneDevice" | "multiplayer" | undefined;
368
381
  hostPlays?: boolean | undefined;
382
+ players?: string[] | undefined;
369
383
  buzzerMode?: "solo" | "off" | "race" | "controller" | undefined;
370
384
  noHost?: boolean | undefined;
371
385
  }, {
@@ -375,6 +389,7 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
375
389
  game?: "seedha" | "snag" | "trivia" | "dama" | "ersimha" | undefined;
376
390
  modeId?: "snag" | "solo" | "oneDevice" | "multiplayer" | undefined;
377
391
  hostPlays?: boolean | undefined;
392
+ players?: string[] | undefined;
378
393
  buzzerMode?: "solo" | "off" | "race" | "controller" | undefined;
379
394
  noHost?: boolean | undefined;
380
395
  }>, z.ZodObject<{
@@ -642,6 +657,10 @@ interface TeamSlotView {
642
657
  color: string;
643
658
  }
644
659
  interface LobbyPlayer {
660
+ /** D-042: is this person IN for the next game? (false = watching). Absent on pre-D-042 servers. */
661
+ playing?: boolean;
662
+ /** D-042: the HOST put them in, so a self-join can't displace them. Clients may mark it. */
663
+ pinned?: boolean;
645
664
  id: string;
646
665
  name: string;
647
666
  approved: boolean;
package/dist/index.js CHANGED
@@ -76,6 +76,15 @@ var ClientMsg = z.discriminatedUnion("t", [
76
76
  z.object({ t: z.literal("setProfile"), name: DisplayName.optional(), avatar: Avatar.optional(), character: Character.optional() }),
77
77
  z.object({ t: z.literal("joinRoom"), code: RoomCode, name: DisplayName, avatar: Avatar.optional(), character: Character.optional(), pv: Pv, idToken: IdToken, platform: Platform }),
78
78
  z.object({ t: z.literal("resume"), code: RoomCode, token: z.string().max(120), avatar: Avatar.optional(), character: Character.optional(), pv: Pv, idToken: IdToken, platform: Platform }),
79
+ // Participation (D-042): every person in a room is PLAYING or WATCHING, one model for every game.
80
+ // The badge means "I'm IN", NOT "I'm on the board" — the playing list is ORDERED and each game seats
81
+ // up to its own capacity (دامة 2; ارسمها/trivia everyone), so extras are WAITING rather than wearing a
82
+ // badge that lies. Omit `playerId` to change yourself. PERMISSIONS: the host may set anyone (and that
83
+ // seat is PINNED — a self-join can't displace it); a player may change only THEMSELVES, always allowed
84
+ // OUT (even if the host pinned them — nobody is forced to play) and back IN only if a seat is free.
85
+ // Lobby-only; the server re-broadcasts `lobby`. Everyone defaults to playing, so a normal room needs
86
+ // ZERO taps and behaves exactly as before.
87
+ z.object({ t: z.literal("setPlaying"), playerId: PlayerId.optional(), playing: z.boolean() }),
79
88
  z.object({ t: z.literal("leaveRoom") }),
80
89
  z.object({ t: z.literal("approve"), playerId: PlayerId }),
81
90
  z.object({ t: z.literal("reject"), playerId: PlayerId }),
@@ -118,6 +127,13 @@ var ClientMsg = z.discriminatedUnion("t", [
118
127
  // false = the first two approved joiners take the board and the host WATCHES
119
128
  // (yourColor:null) while keeping every host power. Needs 2 approved joiners.
120
129
  hostPlays: z.boolean().optional(),
130
+ // Name the seats explicitly instead of taking them by join order (gs#47 Ask 2, layered on per
131
+ // D-037). Exactly two DISTINCT ids, both approved members of the room (the host may be one):
132
+ // Order matters where a game seats a fixed number: دامة takes `players[0]` as black (moves first).
133
+ // Everyone not listed WATCHES. When present this OVERRIDES `hostPlays` and the lobby's playing list —
134
+ // an explicit seating beats an implicit one.
135
+ // Violations are rejected with `invalid_seat`. Consumed by دامة (the only fixed-seat game today).
136
+ players: z.array(PlayerId).length(2).optional(),
121
137
  // PREFERRED: pick a mode from the registry (see MODES). The server maps it to the engine
122
138
  // rules. Send this and omit buzzerMode/noHost. Falls back to the legacy flags below if omitted.
123
139
  modeId: z.enum(MODE_IDS).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thegeem/protocol",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
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",