@thegeem/protocol 0.1.26 → 0.1.28
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 +16 -3
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +16 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -113,6 +113,18 @@ 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
|
+
// `tally` (gs#46) = wins per PLAYER across every game this room has played tonight — «نتيجة الليلة».
|
|
117
|
+
// Keyed by playerId, NOT by team: team names are recycled each game, so a per-team count means nothing
|
|
118
|
+
// across a night. Survives playAgain. A One Device game credits nobody (its team slots hold no players).
|
|
119
|
+
// Participation (D-042): every person in a room is PLAYING or WATCHING, one model for every game.
|
|
120
|
+
// The badge means "I'm IN", NOT "I'm on the board" — the playing list is ORDERED and each game seats
|
|
121
|
+
// up to its own capacity (دامة 2; ارسمها/trivia everyone), so extras are WAITING rather than wearing a
|
|
122
|
+
// badge that lies. Omit `playerId` to change yourself. PERMISSIONS: the host may set anyone (and that
|
|
123
|
+
// seat is PINNED — a self-join can't displace it); a player may change only THEMSELVES, always allowed
|
|
124
|
+
// OUT (even if the host pinned them — nobody is forced to play) and back IN only if a seat is free.
|
|
125
|
+
// Lobby-only; the server re-broadcasts `lobby`. Everyone defaults to playing, so a normal room needs
|
|
126
|
+
// ZERO taps and behaves exactly as before.
|
|
127
|
+
import_zod.z.object({ t: import_zod.z.literal("setPlaying"), playerId: PlayerId.optional(), playing: import_zod.z.boolean() }),
|
|
116
128
|
import_zod.z.object({ t: import_zod.z.literal("leaveRoom") }),
|
|
117
129
|
import_zod.z.object({ t: import_zod.z.literal("approve"), playerId: PlayerId }),
|
|
118
130
|
import_zod.z.object({ t: import_zod.z.literal("reject"), playerId: PlayerId }),
|
|
@@ -157,9 +169,10 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
|
|
|
157
169
|
hostPlays: import_zod.z.boolean().optional(),
|
|
158
170
|
// Name the seats explicitly instead of taking them by join order (gs#47 Ask 2, layered on per
|
|
159
171
|
// D-037). Exactly two DISTINCT ids, both approved members of the room (the host may be one):
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
//
|
|
172
|
+
// Order matters where a game seats a fixed number: دامة takes `players[0]` as black (moves first).
|
|
173
|
+
// Everyone not listed WATCHES. When present this OVERRIDES `hostPlays` and the lobby's playing list —
|
|
174
|
+
// an explicit seating beats an implicit one.
|
|
175
|
+
// Violations are rejected with `invalid_seat`. Consumed by دامة (the only fixed-seat game today).
|
|
163
176
|
players: import_zod.z.array(PlayerId).length(2).optional(),
|
|
164
177
|
// PREFERRED: pick a mode from the registry (see MODES). The server maps it to the engine
|
|
165
178
|
// rules. Send this and omit buzzerMode/noHost. Falls back to the legacy flags below if omitted.
|
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, {
|
|
@@ -645,6 +657,10 @@ interface TeamSlotView {
|
|
|
645
657
|
color: string;
|
|
646
658
|
}
|
|
647
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;
|
|
648
664
|
id: string;
|
|
649
665
|
name: string;
|
|
650
666
|
approved: boolean;
|
|
@@ -886,6 +902,7 @@ type ServerMsg = {
|
|
|
886
902
|
selectedCategoryIds: string[];
|
|
887
903
|
teams: TeamSlotView[];
|
|
888
904
|
hostActivity: 'configuring' | 'idle';
|
|
905
|
+
tally?: Record<string, number>;
|
|
889
906
|
modeId: ModeId | null;
|
|
890
907
|
you: YouContext;
|
|
891
908
|
} | {
|
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, {
|
|
@@ -645,6 +657,10 @@ interface TeamSlotView {
|
|
|
645
657
|
color: string;
|
|
646
658
|
}
|
|
647
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;
|
|
648
664
|
id: string;
|
|
649
665
|
name: string;
|
|
650
666
|
approved: boolean;
|
|
@@ -886,6 +902,7 @@ type ServerMsg = {
|
|
|
886
902
|
selectedCategoryIds: string[];
|
|
887
903
|
teams: TeamSlotView[];
|
|
888
904
|
hostActivity: 'configuring' | 'idle';
|
|
905
|
+
tally?: Record<string, number>;
|
|
889
906
|
modeId: ModeId | null;
|
|
890
907
|
you: YouContext;
|
|
891
908
|
} | {
|
package/dist/index.js
CHANGED
|
@@ -76,6 +76,18 @@ 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
|
+
// `tally` (gs#46) = wins per PLAYER across every game this room has played tonight — «نتيجة الليلة».
|
|
80
|
+
// Keyed by playerId, NOT by team: team names are recycled each game, so a per-team count means nothing
|
|
81
|
+
// across a night. Survives playAgain. A One Device game credits nobody (its team slots hold no players).
|
|
82
|
+
// Participation (D-042): every person in a room is PLAYING or WATCHING, one model for every game.
|
|
83
|
+
// The badge means "I'm IN", NOT "I'm on the board" — the playing list is ORDERED and each game seats
|
|
84
|
+
// up to its own capacity (دامة 2; ارسمها/trivia everyone), so extras are WAITING rather than wearing a
|
|
85
|
+
// badge that lies. Omit `playerId` to change yourself. PERMISSIONS: the host may set anyone (and that
|
|
86
|
+
// seat is PINNED — a self-join can't displace it); a player may change only THEMSELVES, always allowed
|
|
87
|
+
// OUT (even if the host pinned them — nobody is forced to play) and back IN only if a seat is free.
|
|
88
|
+
// Lobby-only; the server re-broadcasts `lobby`. Everyone defaults to playing, so a normal room needs
|
|
89
|
+
// ZERO taps and behaves exactly as before.
|
|
90
|
+
z.object({ t: z.literal("setPlaying"), playerId: PlayerId.optional(), playing: z.boolean() }),
|
|
79
91
|
z.object({ t: z.literal("leaveRoom") }),
|
|
80
92
|
z.object({ t: z.literal("approve"), playerId: PlayerId }),
|
|
81
93
|
z.object({ t: z.literal("reject"), playerId: PlayerId }),
|
|
@@ -120,9 +132,10 @@ var ClientMsg = z.discriminatedUnion("t", [
|
|
|
120
132
|
hostPlays: z.boolean().optional(),
|
|
121
133
|
// Name the seats explicitly instead of taking them by join order (gs#47 Ask 2, layered on per
|
|
122
134
|
// D-037). Exactly two DISTINCT ids, both approved members of the room (the host may be one):
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
//
|
|
135
|
+
// Order matters where a game seats a fixed number: دامة takes `players[0]` as black (moves first).
|
|
136
|
+
// Everyone not listed WATCHES. When present this OVERRIDES `hostPlays` and the lobby's playing list —
|
|
137
|
+
// an explicit seating beats an implicit one.
|
|
138
|
+
// Violations are rejected with `invalid_seat`. Consumed by دامة (the only fixed-seat game today).
|
|
126
139
|
players: z.array(PlayerId).length(2).optional(),
|
|
127
140
|
// PREFERRED: pick a mode from the registry (see MODES). The server maps it to the engine
|
|
128
141
|
// rules. Send this and omit buzzerMode/noHost. Falls back to the legacy flags below if omitted.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thegeem/protocol",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
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",
|