@thegeem/protocol 0.1.26 → 0.1.27
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 +13 -3
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +13 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -113,6 +113,15 @@ 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
|
+
// Participation (D-042): every person in a room is PLAYING or WATCHING, one model for every game.
|
|
117
|
+
// The badge means "I'm IN", NOT "I'm on the board" — the playing list is ORDERED and each game seats
|
|
118
|
+
// up to its own capacity (دامة 2; ارسمها/trivia everyone), so extras are WAITING rather than wearing a
|
|
119
|
+
// badge that lies. Omit `playerId` to change yourself. PERMISSIONS: the host may set anyone (and that
|
|
120
|
+
// seat is PINNED — a self-join can't displace it); a player may change only THEMSELVES, always allowed
|
|
121
|
+
// OUT (even if the host pinned them — nobody is forced to play) and back IN only if a seat is free.
|
|
122
|
+
// Lobby-only; the server re-broadcasts `lobby`. Everyone defaults to playing, so a normal room needs
|
|
123
|
+
// ZERO taps and behaves exactly as before.
|
|
124
|
+
import_zod.z.object({ t: import_zod.z.literal("setPlaying"), playerId: PlayerId.optional(), playing: import_zod.z.boolean() }),
|
|
116
125
|
import_zod.z.object({ t: import_zod.z.literal("leaveRoom") }),
|
|
117
126
|
import_zod.z.object({ t: import_zod.z.literal("approve"), playerId: PlayerId }),
|
|
118
127
|
import_zod.z.object({ t: import_zod.z.literal("reject"), playerId: PlayerId }),
|
|
@@ -157,9 +166,10 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
|
|
|
157
166
|
hostPlays: import_zod.z.boolean().optional(),
|
|
158
167
|
// Name the seats explicitly instead of taking them by join order (gs#47 Ask 2, layered on per
|
|
159
168
|
// D-037). Exactly two DISTINCT ids, both approved members of the room (the host may be one):
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
//
|
|
169
|
+
// Order matters where a game seats a fixed number: دامة takes `players[0]` as black (moves first).
|
|
170
|
+
// Everyone not listed WATCHES. When present this OVERRIDES `hostPlays` and the lobby's playing list —
|
|
171
|
+
// an explicit seating beats an implicit one.
|
|
172
|
+
// Violations are rejected with `invalid_seat`. Consumed by دامة (the only fixed-seat game today).
|
|
163
173
|
players: import_zod.z.array(PlayerId).length(2).optional(),
|
|
164
174
|
// PREFERRED: pick a mode from the registry (see MODES). The server maps it to the engine
|
|
165
175
|
// 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;
|
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;
|
package/dist/index.js
CHANGED
|
@@ -76,6 +76,15 @@ 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
|
+
// Participation (D-042): every person in a room is PLAYING or WATCHING, one model for every game.
|
|
80
|
+
// The badge means "I'm IN", NOT "I'm on the board" — the playing list is ORDERED and each game seats
|
|
81
|
+
// up to its own capacity (دامة 2; ارسمها/trivia everyone), so extras are WAITING rather than wearing a
|
|
82
|
+
// badge that lies. Omit `playerId` to change yourself. PERMISSIONS: the host may set anyone (and that
|
|
83
|
+
// seat is PINNED — a self-join can't displace it); a player may change only THEMSELVES, always allowed
|
|
84
|
+
// OUT (even if the host pinned them — nobody is forced to play) and back IN only if a seat is free.
|
|
85
|
+
// Lobby-only; the server re-broadcasts `lobby`. Everyone defaults to playing, so a normal room needs
|
|
86
|
+
// ZERO taps and behaves exactly as before.
|
|
87
|
+
z.object({ t: z.literal("setPlaying"), playerId: PlayerId.optional(), playing: z.boolean() }),
|
|
79
88
|
z.object({ t: z.literal("leaveRoom") }),
|
|
80
89
|
z.object({ t: z.literal("approve"), playerId: PlayerId }),
|
|
81
90
|
z.object({ t: z.literal("reject"), playerId: PlayerId }),
|
|
@@ -120,9 +129,10 @@ var ClientMsg = z.discriminatedUnion("t", [
|
|
|
120
129
|
hostPlays: z.boolean().optional(),
|
|
121
130
|
// Name the seats explicitly instead of taking them by join order (gs#47 Ask 2, layered on per
|
|
122
131
|
// D-037). Exactly two DISTINCT ids, both approved members of the room (the host may be one):
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
//
|
|
132
|
+
// Order matters where a game seats a fixed number: دامة takes `players[0]` as black (moves first).
|
|
133
|
+
// Everyone not listed WATCHES. When present this OVERRIDES `hostPlays` and the lobby's playing list —
|
|
134
|
+
// an explicit seating beats an implicit one.
|
|
135
|
+
// Violations are rejected with `invalid_seat`. Consumed by دامة (the only fixed-seat game today).
|
|
126
136
|
players: z.array(PlayerId).length(2).optional(),
|
|
127
137
|
// PREFERRED: pick a mode from the registry (see MODES). The server maps it to the engine
|
|
128
138
|
// 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.27",
|
|
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",
|