@thegeem/protocol 0.1.5 → 0.1.6

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
@@ -71,6 +71,10 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
71
71
  // Host's IN-PROGRESS category selection in the lobby — a live preview for waiting
72
72
  // players. Distinct from startGame.categoryIds, which COMMITS the board. Empty = cleared.
73
73
  import_zod.z.object({ t: import_zod.z.literal("setCategories"), categoryIds: import_zod.z.array(import_zod.z.string().max(60)).max(12) }),
74
+ // Host defines the lobby teams players can join (1–12). Resets picks that fall out of range.
75
+ import_zod.z.object({ t: import_zod.z.literal("setTeams"), teams: import_zod.z.array(DisplayName).min(1).max(LIMITS.MAX_PLAYERS) }),
76
+ // A player joins team slot `teamIndex` (0-based, into the host's `setTeams` list).
77
+ import_zod.z.object({ t: import_zod.z.literal("pickTeam"), teamIndex: import_zod.z.number().int().min(0).max(LIMITS.MAX_PLAYERS - 1) }),
74
78
  // host game actions
75
79
  import_zod.z.object({
76
80
  t: import_zod.z.literal("startGame"),
package/dist/index.d.cts CHANGED
@@ -196,6 +196,24 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
196
196
  }, {
197
197
  t: "setCategories";
198
198
  categoryIds: string[];
199
+ }>, z.ZodObject<{
200
+ t: z.ZodLiteral<"setTeams">;
201
+ teams: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">;
202
+ }, "strip", z.ZodTypeAny, {
203
+ t: "setTeams";
204
+ teams: string[];
205
+ }, {
206
+ t: "setTeams";
207
+ teams: string[];
208
+ }>, z.ZodObject<{
209
+ t: z.ZodLiteral<"pickTeam">;
210
+ teamIndex: z.ZodNumber;
211
+ }, "strip", z.ZodTypeAny, {
212
+ t: "pickTeam";
213
+ teamIndex: number;
214
+ }, {
215
+ t: "pickTeam";
216
+ teamIndex: number;
199
217
  }>, z.ZodObject<{
200
218
  t: z.ZodLiteral<"startGame">;
201
219
  game: z.ZodOptional<z.ZodEnum<["trivia"]>>;
@@ -314,6 +332,11 @@ interface AvatarView {
314
332
  emoji: string;
315
333
  color: string;
316
334
  }
335
+ /** A lobby team slot players can join (`pickTeam` by its index in `lobby.teams`). */
336
+ interface TeamSlotView {
337
+ name: string;
338
+ color: string;
339
+ }
317
340
  interface LobbyPlayer {
318
341
  id: string;
319
342
  name: string;
@@ -476,6 +499,7 @@ type ServerMsg = {
476
499
  players: LobbyPlayer[];
477
500
  categories: CategoryView[];
478
501
  selectedCategoryIds: string[];
502
+ teams: TeamSlotView[];
479
503
  you: YouContext;
480
504
  } | {
481
505
  t: 'state';
@@ -492,4 +516,4 @@ type ServerMsg = {
492
516
  message: string;
493
517
  };
494
518
 
495
- export { type AvatarView, type BuzzerGameMode, type CategoryView, ClientMsg, type Effect, GAME_IDS, type GameId, type GameStateView, type GameStatus, type GameplayFlow, type HelpName, LIMITS, type LobbyPlayer, PROTOCOL_VERSION, type QuestionView, ROOM_ALPHABET, type ServerMsg, type SoundName, type TeamView, type YouContext };
519
+ export { type AvatarView, type BuzzerGameMode, type CategoryView, ClientMsg, type Effect, GAME_IDS, type GameId, type GameStateView, type GameStatus, type GameplayFlow, type HelpName, LIMITS, type LobbyPlayer, PROTOCOL_VERSION, type QuestionView, ROOM_ALPHABET, type ServerMsg, type SoundName, type TeamSlotView, type TeamView, type YouContext };
package/dist/index.d.ts CHANGED
@@ -196,6 +196,24 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
196
196
  }, {
197
197
  t: "setCategories";
198
198
  categoryIds: string[];
199
+ }>, z.ZodObject<{
200
+ t: z.ZodLiteral<"setTeams">;
201
+ teams: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">;
202
+ }, "strip", z.ZodTypeAny, {
203
+ t: "setTeams";
204
+ teams: string[];
205
+ }, {
206
+ t: "setTeams";
207
+ teams: string[];
208
+ }>, z.ZodObject<{
209
+ t: z.ZodLiteral<"pickTeam">;
210
+ teamIndex: z.ZodNumber;
211
+ }, "strip", z.ZodTypeAny, {
212
+ t: "pickTeam";
213
+ teamIndex: number;
214
+ }, {
215
+ t: "pickTeam";
216
+ teamIndex: number;
199
217
  }>, z.ZodObject<{
200
218
  t: z.ZodLiteral<"startGame">;
201
219
  game: z.ZodOptional<z.ZodEnum<["trivia"]>>;
@@ -314,6 +332,11 @@ interface AvatarView {
314
332
  emoji: string;
315
333
  color: string;
316
334
  }
335
+ /** A lobby team slot players can join (`pickTeam` by its index in `lobby.teams`). */
336
+ interface TeamSlotView {
337
+ name: string;
338
+ color: string;
339
+ }
317
340
  interface LobbyPlayer {
318
341
  id: string;
319
342
  name: string;
@@ -476,6 +499,7 @@ type ServerMsg = {
476
499
  players: LobbyPlayer[];
477
500
  categories: CategoryView[];
478
501
  selectedCategoryIds: string[];
502
+ teams: TeamSlotView[];
479
503
  you: YouContext;
480
504
  } | {
481
505
  t: 'state';
@@ -492,4 +516,4 @@ type ServerMsg = {
492
516
  message: string;
493
517
  };
494
518
 
495
- export { type AvatarView, type BuzzerGameMode, type CategoryView, ClientMsg, type Effect, GAME_IDS, type GameId, type GameStateView, type GameStatus, type GameplayFlow, type HelpName, LIMITS, type LobbyPlayer, PROTOCOL_VERSION, type QuestionView, ROOM_ALPHABET, type ServerMsg, type SoundName, type TeamView, type YouContext };
519
+ export { type AvatarView, type BuzzerGameMode, type CategoryView, ClientMsg, type Effect, GAME_IDS, type GameId, type GameStateView, type GameStatus, type GameplayFlow, type HelpName, LIMITS, type LobbyPlayer, PROTOCOL_VERSION, type QuestionView, ROOM_ALPHABET, type ServerMsg, type SoundName, type TeamSlotView, type TeamView, type YouContext };
package/dist/index.js CHANGED
@@ -43,6 +43,10 @@ var ClientMsg = z.discriminatedUnion("t", [
43
43
  // Host's IN-PROGRESS category selection in the lobby — a live preview for waiting
44
44
  // players. Distinct from startGame.categoryIds, which COMMITS the board. Empty = cleared.
45
45
  z.object({ t: z.literal("setCategories"), categoryIds: z.array(z.string().max(60)).max(12) }),
46
+ // Host defines the lobby teams players can join (1–12). Resets picks that fall out of range.
47
+ z.object({ t: z.literal("setTeams"), teams: z.array(DisplayName).min(1).max(LIMITS.MAX_PLAYERS) }),
48
+ // A player joins team slot `teamIndex` (0-based, into the host's `setTeams` list).
49
+ z.object({ t: z.literal("pickTeam"), teamIndex: z.number().int().min(0).max(LIMITS.MAX_PLAYERS - 1) }),
46
50
  // host game actions
47
51
  z.object({
48
52
  t: z.literal("startGame"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thegeem/protocol",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
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",