@thegeem/protocol 0.1.5 → 0.1.7
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 +9 -1
- package/dist/index.d.cts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +9 -1
- package/package.json +1 -1
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"),
|
|
@@ -101,8 +105,12 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
|
|
|
101
105
|
// trivia is 4-option (0–3)
|
|
102
106
|
import_zod.z.object({ t: import_zod.z.literal("useHelp"), helpType: HelpType }),
|
|
103
107
|
// sabotage a rival (active team only): spend a sabotage help to debuff targetTeam's next question
|
|
104
|
-
import_zod.z.object({ t: import_zod.z.literal("sabotage"), helpType: HelpType, targetTeam: import_zod.z.number().int().min(0).max(LIMITS.MAX_PLAYERS - 1) })
|
|
108
|
+
import_zod.z.object({ t: import_zod.z.literal("sabotage"), helpType: HelpType, targetTeam: import_zod.z.number().int().min(0).max(LIMITS.MAX_PLAYERS - 1) }),
|
|
105
109
|
// 0-based team index
|
|
110
|
+
// moderation
|
|
111
|
+
// Report another player in the room (App Store 1.2 UGC — display names). Available in lobby or
|
|
112
|
+
// game. The server records reporter/reported/room context; `reason` is an optional free-text note.
|
|
113
|
+
import_zod.z.object({ t: import_zod.z.literal("report"), playerId: PlayerId, reason: import_zod.z.string().max(500).optional() })
|
|
106
114
|
]);
|
|
107
115
|
// Annotate the CommonJS export names for ESM import in node:
|
|
108
116
|
0 && (module.exports = {
|
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"]>>;
|
|
@@ -307,6 +325,18 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
307
325
|
t: "sabotage";
|
|
308
326
|
helpType: "removeTwoAnswers" | "changeQuestion" | "extraTime" | "doublePoints" | "stealPoints" | "restPlayer" | "tripLevel";
|
|
309
327
|
targetTeam: number;
|
|
328
|
+
}>, z.ZodObject<{
|
|
329
|
+
t: z.ZodLiteral<"report">;
|
|
330
|
+
playerId: z.ZodString;
|
|
331
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
332
|
+
}, "strip", z.ZodTypeAny, {
|
|
333
|
+
t: "report";
|
|
334
|
+
playerId: string;
|
|
335
|
+
reason?: string | undefined;
|
|
336
|
+
}, {
|
|
337
|
+
t: "report";
|
|
338
|
+
playerId: string;
|
|
339
|
+
reason?: string | undefined;
|
|
310
340
|
}>]>;
|
|
311
341
|
type ClientMsg = z.infer<typeof ClientMsg>;
|
|
312
342
|
/** A player's privacy-safe avatar (emoji + circle color) for in-room display. */
|
|
@@ -314,6 +344,11 @@ interface AvatarView {
|
|
|
314
344
|
emoji: string;
|
|
315
345
|
color: string;
|
|
316
346
|
}
|
|
347
|
+
/** A lobby team slot players can join (`pickTeam` by its index in `lobby.teams`). */
|
|
348
|
+
interface TeamSlotView {
|
|
349
|
+
name: string;
|
|
350
|
+
color: string;
|
|
351
|
+
}
|
|
317
352
|
interface LobbyPlayer {
|
|
318
353
|
id: string;
|
|
319
354
|
name: string;
|
|
@@ -476,6 +511,7 @@ type ServerMsg = {
|
|
|
476
511
|
players: LobbyPlayer[];
|
|
477
512
|
categories: CategoryView[];
|
|
478
513
|
selectedCategoryIds: string[];
|
|
514
|
+
teams: TeamSlotView[];
|
|
479
515
|
you: YouContext;
|
|
480
516
|
} | {
|
|
481
517
|
t: 'state';
|
|
@@ -486,10 +522,12 @@ type ServerMsg = {
|
|
|
486
522
|
} | {
|
|
487
523
|
t: 'fx';
|
|
488
524
|
effects: Effect[];
|
|
525
|
+
} | {
|
|
526
|
+
t: 'reported';
|
|
489
527
|
} | {
|
|
490
528
|
t: 'error';
|
|
491
529
|
code: string;
|
|
492
530
|
message: string;
|
|
493
531
|
};
|
|
494
532
|
|
|
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 };
|
|
533
|
+
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"]>>;
|
|
@@ -307,6 +325,18 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
307
325
|
t: "sabotage";
|
|
308
326
|
helpType: "removeTwoAnswers" | "changeQuestion" | "extraTime" | "doublePoints" | "stealPoints" | "restPlayer" | "tripLevel";
|
|
309
327
|
targetTeam: number;
|
|
328
|
+
}>, z.ZodObject<{
|
|
329
|
+
t: z.ZodLiteral<"report">;
|
|
330
|
+
playerId: z.ZodString;
|
|
331
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
332
|
+
}, "strip", z.ZodTypeAny, {
|
|
333
|
+
t: "report";
|
|
334
|
+
playerId: string;
|
|
335
|
+
reason?: string | undefined;
|
|
336
|
+
}, {
|
|
337
|
+
t: "report";
|
|
338
|
+
playerId: string;
|
|
339
|
+
reason?: string | undefined;
|
|
310
340
|
}>]>;
|
|
311
341
|
type ClientMsg = z.infer<typeof ClientMsg>;
|
|
312
342
|
/** A player's privacy-safe avatar (emoji + circle color) for in-room display. */
|
|
@@ -314,6 +344,11 @@ interface AvatarView {
|
|
|
314
344
|
emoji: string;
|
|
315
345
|
color: string;
|
|
316
346
|
}
|
|
347
|
+
/** A lobby team slot players can join (`pickTeam` by its index in `lobby.teams`). */
|
|
348
|
+
interface TeamSlotView {
|
|
349
|
+
name: string;
|
|
350
|
+
color: string;
|
|
351
|
+
}
|
|
317
352
|
interface LobbyPlayer {
|
|
318
353
|
id: string;
|
|
319
354
|
name: string;
|
|
@@ -476,6 +511,7 @@ type ServerMsg = {
|
|
|
476
511
|
players: LobbyPlayer[];
|
|
477
512
|
categories: CategoryView[];
|
|
478
513
|
selectedCategoryIds: string[];
|
|
514
|
+
teams: TeamSlotView[];
|
|
479
515
|
you: YouContext;
|
|
480
516
|
} | {
|
|
481
517
|
t: 'state';
|
|
@@ -486,10 +522,12 @@ type ServerMsg = {
|
|
|
486
522
|
} | {
|
|
487
523
|
t: 'fx';
|
|
488
524
|
effects: Effect[];
|
|
525
|
+
} | {
|
|
526
|
+
t: 'reported';
|
|
489
527
|
} | {
|
|
490
528
|
t: 'error';
|
|
491
529
|
code: string;
|
|
492
530
|
message: string;
|
|
493
531
|
};
|
|
494
532
|
|
|
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 };
|
|
533
|
+
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"),
|
|
@@ -73,8 +77,12 @@ var ClientMsg = z.discriminatedUnion("t", [
|
|
|
73
77
|
// trivia is 4-option (0–3)
|
|
74
78
|
z.object({ t: z.literal("useHelp"), helpType: HelpType }),
|
|
75
79
|
// sabotage a rival (active team only): spend a sabotage help to debuff targetTeam's next question
|
|
76
|
-
z.object({ t: z.literal("sabotage"), helpType: HelpType, targetTeam: z.number().int().min(0).max(LIMITS.MAX_PLAYERS - 1) })
|
|
80
|
+
z.object({ t: z.literal("sabotage"), helpType: HelpType, targetTeam: z.number().int().min(0).max(LIMITS.MAX_PLAYERS - 1) }),
|
|
77
81
|
// 0-based team index
|
|
82
|
+
// moderation
|
|
83
|
+
// Report another player in the room (App Store 1.2 UGC — display names). Available in lobby or
|
|
84
|
+
// game. The server records reporter/reported/room context; `reason` is an optional free-text note.
|
|
85
|
+
z.object({ t: z.literal("report"), playerId: PlayerId, reason: z.string().max(500).optional() })
|
|
78
86
|
]);
|
|
79
87
|
export {
|
|
80
88
|
ClientMsg,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thegeem/protocol",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
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",
|