@thegeem/protocol 0.1.6 → 0.1.8
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 +8 -1
- package/dist/index.d.cts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +8 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -75,6 +75,9 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
|
|
|
75
75
|
import_zod.z.object({ t: import_zod.z.literal("setTeams"), teams: import_zod.z.array(DisplayName).min(1).max(LIMITS.MAX_PLAYERS) }),
|
|
76
76
|
// A player joins team slot `teamIndex` (0-based, into the host's `setTeams` list).
|
|
77
77
|
import_zod.z.object({ t: import_zod.z.literal("pickTeam"), teamIndex: import_zod.z.number().int().min(0).max(LIMITS.MAX_PLAYERS - 1) }),
|
|
78
|
+
// Host signals it's busy configuring the game (categories/rounds/mode) so waiting players can show
|
|
79
|
+
// a "host is setting up…" state instead of a frozen-looking lobby. 'idle' when the settings close.
|
|
80
|
+
import_zod.z.object({ t: import_zod.z.literal("hostActivity"), activity: import_zod.z.enum(["configuring", "idle"]) }),
|
|
78
81
|
// host game actions
|
|
79
82
|
import_zod.z.object({
|
|
80
83
|
t: import_zod.z.literal("startGame"),
|
|
@@ -105,8 +108,12 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
|
|
|
105
108
|
// trivia is 4-option (0–3)
|
|
106
109
|
import_zod.z.object({ t: import_zod.z.literal("useHelp"), helpType: HelpType }),
|
|
107
110
|
// sabotage a rival (active team only): spend a sabotage help to debuff targetTeam's next question
|
|
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) })
|
|
111
|
+
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) }),
|
|
109
112
|
// 0-based team index
|
|
113
|
+
// moderation
|
|
114
|
+
// Report another player in the room (App Store 1.2 UGC — display names). Available in lobby or
|
|
115
|
+
// game. The server records reporter/reported/room context; `reason` is an optional free-text note.
|
|
116
|
+
import_zod.z.object({ t: import_zod.z.literal("report"), playerId: PlayerId, reason: import_zod.z.string().max(500).optional() })
|
|
110
117
|
]);
|
|
111
118
|
// Annotate the CommonJS export names for ESM import in node:
|
|
112
119
|
0 && (module.exports = {
|
package/dist/index.d.cts
CHANGED
|
@@ -214,6 +214,15 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
214
214
|
}, {
|
|
215
215
|
t: "pickTeam";
|
|
216
216
|
teamIndex: number;
|
|
217
|
+
}>, z.ZodObject<{
|
|
218
|
+
t: z.ZodLiteral<"hostActivity">;
|
|
219
|
+
activity: z.ZodEnum<["configuring", "idle"]>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
t: "hostActivity";
|
|
222
|
+
activity: "configuring" | "idle";
|
|
223
|
+
}, {
|
|
224
|
+
t: "hostActivity";
|
|
225
|
+
activity: "configuring" | "idle";
|
|
217
226
|
}>, z.ZodObject<{
|
|
218
227
|
t: z.ZodLiteral<"startGame">;
|
|
219
228
|
game: z.ZodOptional<z.ZodEnum<["trivia"]>>;
|
|
@@ -325,6 +334,18 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
325
334
|
t: "sabotage";
|
|
326
335
|
helpType: "removeTwoAnswers" | "changeQuestion" | "extraTime" | "doublePoints" | "stealPoints" | "restPlayer" | "tripLevel";
|
|
327
336
|
targetTeam: number;
|
|
337
|
+
}>, z.ZodObject<{
|
|
338
|
+
t: z.ZodLiteral<"report">;
|
|
339
|
+
playerId: z.ZodString;
|
|
340
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
341
|
+
}, "strip", z.ZodTypeAny, {
|
|
342
|
+
t: "report";
|
|
343
|
+
playerId: string;
|
|
344
|
+
reason?: string | undefined;
|
|
345
|
+
}, {
|
|
346
|
+
t: "report";
|
|
347
|
+
playerId: string;
|
|
348
|
+
reason?: string | undefined;
|
|
328
349
|
}>]>;
|
|
329
350
|
type ClientMsg = z.infer<typeof ClientMsg>;
|
|
330
351
|
/** A player's privacy-safe avatar (emoji + circle color) for in-room display. */
|
|
@@ -500,6 +521,7 @@ type ServerMsg = {
|
|
|
500
521
|
categories: CategoryView[];
|
|
501
522
|
selectedCategoryIds: string[];
|
|
502
523
|
teams: TeamSlotView[];
|
|
524
|
+
hostActivity: 'configuring' | 'idle';
|
|
503
525
|
you: YouContext;
|
|
504
526
|
} | {
|
|
505
527
|
t: 'state';
|
|
@@ -510,6 +532,8 @@ type ServerMsg = {
|
|
|
510
532
|
} | {
|
|
511
533
|
t: 'fx';
|
|
512
534
|
effects: Effect[];
|
|
535
|
+
} | {
|
|
536
|
+
t: 'reported';
|
|
513
537
|
} | {
|
|
514
538
|
t: 'error';
|
|
515
539
|
code: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -214,6 +214,15 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
214
214
|
}, {
|
|
215
215
|
t: "pickTeam";
|
|
216
216
|
teamIndex: number;
|
|
217
|
+
}>, z.ZodObject<{
|
|
218
|
+
t: z.ZodLiteral<"hostActivity">;
|
|
219
|
+
activity: z.ZodEnum<["configuring", "idle"]>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
t: "hostActivity";
|
|
222
|
+
activity: "configuring" | "idle";
|
|
223
|
+
}, {
|
|
224
|
+
t: "hostActivity";
|
|
225
|
+
activity: "configuring" | "idle";
|
|
217
226
|
}>, z.ZodObject<{
|
|
218
227
|
t: z.ZodLiteral<"startGame">;
|
|
219
228
|
game: z.ZodOptional<z.ZodEnum<["trivia"]>>;
|
|
@@ -325,6 +334,18 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
325
334
|
t: "sabotage";
|
|
326
335
|
helpType: "removeTwoAnswers" | "changeQuestion" | "extraTime" | "doublePoints" | "stealPoints" | "restPlayer" | "tripLevel";
|
|
327
336
|
targetTeam: number;
|
|
337
|
+
}>, z.ZodObject<{
|
|
338
|
+
t: z.ZodLiteral<"report">;
|
|
339
|
+
playerId: z.ZodString;
|
|
340
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
341
|
+
}, "strip", z.ZodTypeAny, {
|
|
342
|
+
t: "report";
|
|
343
|
+
playerId: string;
|
|
344
|
+
reason?: string | undefined;
|
|
345
|
+
}, {
|
|
346
|
+
t: "report";
|
|
347
|
+
playerId: string;
|
|
348
|
+
reason?: string | undefined;
|
|
328
349
|
}>]>;
|
|
329
350
|
type ClientMsg = z.infer<typeof ClientMsg>;
|
|
330
351
|
/** A player's privacy-safe avatar (emoji + circle color) for in-room display. */
|
|
@@ -500,6 +521,7 @@ type ServerMsg = {
|
|
|
500
521
|
categories: CategoryView[];
|
|
501
522
|
selectedCategoryIds: string[];
|
|
502
523
|
teams: TeamSlotView[];
|
|
524
|
+
hostActivity: 'configuring' | 'idle';
|
|
503
525
|
you: YouContext;
|
|
504
526
|
} | {
|
|
505
527
|
t: 'state';
|
|
@@ -510,6 +532,8 @@ type ServerMsg = {
|
|
|
510
532
|
} | {
|
|
511
533
|
t: 'fx';
|
|
512
534
|
effects: Effect[];
|
|
535
|
+
} | {
|
|
536
|
+
t: 'reported';
|
|
513
537
|
} | {
|
|
514
538
|
t: 'error';
|
|
515
539
|
code: string;
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,9 @@ var ClientMsg = z.discriminatedUnion("t", [
|
|
|
47
47
|
z.object({ t: z.literal("setTeams"), teams: z.array(DisplayName).min(1).max(LIMITS.MAX_PLAYERS) }),
|
|
48
48
|
// A player joins team slot `teamIndex` (0-based, into the host's `setTeams` list).
|
|
49
49
|
z.object({ t: z.literal("pickTeam"), teamIndex: z.number().int().min(0).max(LIMITS.MAX_PLAYERS - 1) }),
|
|
50
|
+
// Host signals it's busy configuring the game (categories/rounds/mode) so waiting players can show
|
|
51
|
+
// a "host is setting up…" state instead of a frozen-looking lobby. 'idle' when the settings close.
|
|
52
|
+
z.object({ t: z.literal("hostActivity"), activity: z.enum(["configuring", "idle"]) }),
|
|
50
53
|
// host game actions
|
|
51
54
|
z.object({
|
|
52
55
|
t: z.literal("startGame"),
|
|
@@ -77,8 +80,12 @@ var ClientMsg = z.discriminatedUnion("t", [
|
|
|
77
80
|
// trivia is 4-option (0–3)
|
|
78
81
|
z.object({ t: z.literal("useHelp"), helpType: HelpType }),
|
|
79
82
|
// sabotage a rival (active team only): spend a sabotage help to debuff targetTeam's next question
|
|
80
|
-
z.object({ t: z.literal("sabotage"), helpType: HelpType, targetTeam: z.number().int().min(0).max(LIMITS.MAX_PLAYERS - 1) })
|
|
83
|
+
z.object({ t: z.literal("sabotage"), helpType: HelpType, targetTeam: z.number().int().min(0).max(LIMITS.MAX_PLAYERS - 1) }),
|
|
81
84
|
// 0-based team index
|
|
85
|
+
// moderation
|
|
86
|
+
// Report another player in the room (App Store 1.2 UGC — display names). Available in lobby or
|
|
87
|
+
// game. The server records reporter/reported/room context; `reason` is an optional free-text note.
|
|
88
|
+
z.object({ t: z.literal("report"), playerId: PlayerId, reason: z.string().max(500).optional() })
|
|
82
89
|
]);
|
|
83
90
|
export {
|
|
84
91
|
ClientMsg,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thegeem/protocol",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
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",
|