@thegeem/protocol 0.1.3 → 0.1.5
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 +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +8 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -77,7 +77,14 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
|
|
|
77
77
|
game: import_zod.z.enum(GAME_IDS).optional(),
|
|
78
78
|
// which game to play; defaults to 'trivia'
|
|
79
79
|
totalRounds: import_zod.z.number().int().min(1).max(50),
|
|
80
|
-
categoryIds: import_zod.z.array(import_zod.z.string().max(60)).min(1).max(12)
|
|
80
|
+
categoryIds: import_zod.z.array(import_zod.z.string().max(60)).min(1).max(12),
|
|
81
|
+
// How to play (maps to the engine). Omit → controller (each player answers from
|
|
82
|
+
// their own device). 'off' = one device drives (Me-Controller); pair with noHost.
|
|
83
|
+
// solo=Solo · race=Snag/buzz · controller=each-player-from-device · off=Me-Controller
|
|
84
|
+
buzzerMode: import_zod.z.enum(["off", "solo", "race", "controller"]).optional(),
|
|
85
|
+
// Only meaningful for 'off' (Me-Controller): false = a referee drives & sees answers
|
|
86
|
+
// (classic); true = the driver is a player, answers stay hidden + auto-reveal (noHost).
|
|
87
|
+
noHost: import_zod.z.boolean().optional()
|
|
81
88
|
}),
|
|
82
89
|
import_zod.z.object({ t: import_zod.z.literal("pickLevel"), categoryId: import_zod.z.string().max(60), level: import_zod.z.number().int().min(1).max(6) }),
|
|
83
90
|
import_zod.z.object({ t: import_zod.z.literal("nextTurn") }),
|
package/dist/index.d.cts
CHANGED
|
@@ -201,16 +201,22 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
201
201
|
game: z.ZodOptional<z.ZodEnum<["trivia"]>>;
|
|
202
202
|
totalRounds: z.ZodNumber;
|
|
203
203
|
categoryIds: z.ZodArray<z.ZodString, "many">;
|
|
204
|
+
buzzerMode: z.ZodOptional<z.ZodEnum<["off", "solo", "race", "controller"]>>;
|
|
205
|
+
noHost: z.ZodOptional<z.ZodBoolean>;
|
|
204
206
|
}, "strip", z.ZodTypeAny, {
|
|
205
207
|
t: "startGame";
|
|
206
208
|
categoryIds: string[];
|
|
207
209
|
totalRounds: number;
|
|
208
210
|
game?: "trivia" | undefined;
|
|
211
|
+
buzzerMode?: "off" | "solo" | "race" | "controller" | undefined;
|
|
212
|
+
noHost?: boolean | undefined;
|
|
209
213
|
}, {
|
|
210
214
|
t: "startGame";
|
|
211
215
|
categoryIds: string[];
|
|
212
216
|
totalRounds: number;
|
|
213
217
|
game?: "trivia" | undefined;
|
|
218
|
+
buzzerMode?: "off" | "solo" | "race" | "controller" | undefined;
|
|
219
|
+
noHost?: boolean | undefined;
|
|
214
220
|
}>, z.ZodObject<{
|
|
215
221
|
t: z.ZodLiteral<"pickLevel">;
|
|
216
222
|
categoryId: z.ZodString;
|
|
@@ -387,6 +393,11 @@ interface GameStateView {
|
|
|
387
393
|
usedLevels: {
|
|
388
394
|
[categoryId: string]: number[];
|
|
389
395
|
};
|
|
396
|
+
/** Live question countdown: ms remaining while the timer is **ticking** (relay-
|
|
397
|
+
* enriched from the server-authoritative timer). Absent between questions, while
|
|
398
|
+
* paused (e.g. steal intro), or after time-up. Present ⇒ animate a countdown from
|
|
399
|
+
* it; the server remains the authority on actual time-up. */
|
|
400
|
+
timerRemainingMs?: number;
|
|
390
401
|
}
|
|
391
402
|
/** Transient presentation effects the relay emits; clients play them once. */
|
|
392
403
|
type Effect = {
|
package/dist/index.d.ts
CHANGED
|
@@ -201,16 +201,22 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
201
201
|
game: z.ZodOptional<z.ZodEnum<["trivia"]>>;
|
|
202
202
|
totalRounds: z.ZodNumber;
|
|
203
203
|
categoryIds: z.ZodArray<z.ZodString, "many">;
|
|
204
|
+
buzzerMode: z.ZodOptional<z.ZodEnum<["off", "solo", "race", "controller"]>>;
|
|
205
|
+
noHost: z.ZodOptional<z.ZodBoolean>;
|
|
204
206
|
}, "strip", z.ZodTypeAny, {
|
|
205
207
|
t: "startGame";
|
|
206
208
|
categoryIds: string[];
|
|
207
209
|
totalRounds: number;
|
|
208
210
|
game?: "trivia" | undefined;
|
|
211
|
+
buzzerMode?: "off" | "solo" | "race" | "controller" | undefined;
|
|
212
|
+
noHost?: boolean | undefined;
|
|
209
213
|
}, {
|
|
210
214
|
t: "startGame";
|
|
211
215
|
categoryIds: string[];
|
|
212
216
|
totalRounds: number;
|
|
213
217
|
game?: "trivia" | undefined;
|
|
218
|
+
buzzerMode?: "off" | "solo" | "race" | "controller" | undefined;
|
|
219
|
+
noHost?: boolean | undefined;
|
|
214
220
|
}>, z.ZodObject<{
|
|
215
221
|
t: z.ZodLiteral<"pickLevel">;
|
|
216
222
|
categoryId: z.ZodString;
|
|
@@ -387,6 +393,11 @@ interface GameStateView {
|
|
|
387
393
|
usedLevels: {
|
|
388
394
|
[categoryId: string]: number[];
|
|
389
395
|
};
|
|
396
|
+
/** Live question countdown: ms remaining while the timer is **ticking** (relay-
|
|
397
|
+
* enriched from the server-authoritative timer). Absent between questions, while
|
|
398
|
+
* paused (e.g. steal intro), or after time-up. Present ⇒ animate a countdown from
|
|
399
|
+
* it; the server remains the authority on actual time-up. */
|
|
400
|
+
timerRemainingMs?: number;
|
|
390
401
|
}
|
|
391
402
|
/** Transient presentation effects the relay emits; clients play them once. */
|
|
392
403
|
type Effect = {
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,14 @@ var ClientMsg = z.discriminatedUnion("t", [
|
|
|
49
49
|
game: z.enum(GAME_IDS).optional(),
|
|
50
50
|
// which game to play; defaults to 'trivia'
|
|
51
51
|
totalRounds: z.number().int().min(1).max(50),
|
|
52
|
-
categoryIds: z.array(z.string().max(60)).min(1).max(12)
|
|
52
|
+
categoryIds: z.array(z.string().max(60)).min(1).max(12),
|
|
53
|
+
// How to play (maps to the engine). Omit → controller (each player answers from
|
|
54
|
+
// their own device). 'off' = one device drives (Me-Controller); pair with noHost.
|
|
55
|
+
// solo=Solo · race=Snag/buzz · controller=each-player-from-device · off=Me-Controller
|
|
56
|
+
buzzerMode: z.enum(["off", "solo", "race", "controller"]).optional(),
|
|
57
|
+
// Only meaningful for 'off' (Me-Controller): false = a referee drives & sees answers
|
|
58
|
+
// (classic); true = the driver is a player, answers stay hidden + auto-reveal (noHost).
|
|
59
|
+
noHost: z.boolean().optional()
|
|
53
60
|
}),
|
|
54
61
|
z.object({ t: z.literal("pickLevel"), categoryId: z.string().max(60), level: z.number().int().min(1).max(6) }),
|
|
55
62
|
z.object({ t: z.literal("nextTurn") }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thegeem/protocol",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
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",
|