@thegeem/protocol 0.1.21 → 0.1.22
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 +17 -3
- package/dist/index.d.cts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +17 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -95,7 +95,17 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
|
|
|
95
95
|
import_zod.z.object({ t: import_zod.z.literal("createRoom"), name: DisplayName.optional(), avatar: Avatar.optional(), game: import_zod.z.enum(GAME_IDS).optional(), pv: Pv, idToken: IdToken, platform: Platform }),
|
|
96
96
|
// Host sets/changes their display name AFTER createRoom (for anonymous one-tap
|
|
97
97
|
// hosts who started nameless). Host-only; the relay re-broadcasts the lobby.
|
|
98
|
+
// SUPERSEDED by setProfile (kept working for shipped builds).
|
|
98
99
|
import_zod.z.object({ t: import_zod.z.literal("renameHost"), name: DisplayName }),
|
|
100
|
+
// ANY room member changes their OWN display identity mid-room (gs#48) — lobby or mid-game.
|
|
101
|
+
// One message for both fields because the client's picker edits them together: one atomic
|
|
102
|
+
// update, one re-broadcast, no half-changed roster. Send either field or both; sending
|
|
103
|
+
// neither is a no-op. SELF-ONLY by construction — the server always applies it to the
|
|
104
|
+
// SENDER's seat, so there is no playerId to spoof. Additive: no pv bump.
|
|
105
|
+
// Note: mid-game propagation depends on what the running game's state carries — trivia's
|
|
106
|
+
// view carries names+avatars so it updates live; dama/ersimha views are id-keyed (clients
|
|
107
|
+
// map ids→names from the lobby roster), so a change there lands on the next lobby.
|
|
108
|
+
import_zod.z.object({ t: import_zod.z.literal("setProfile"), name: DisplayName.optional(), avatar: Avatar.optional() }),
|
|
99
109
|
import_zod.z.object({ t: import_zod.z.literal("joinRoom"), code: RoomCode, name: DisplayName, avatar: Avatar.optional(), pv: Pv, idToken: IdToken, platform: Platform }),
|
|
100
110
|
import_zod.z.object({ t: import_zod.z.literal("resume"), code: RoomCode, token: import_zod.z.string().max(120), avatar: Avatar.optional(), pv: Pv, idToken: IdToken, platform: Platform }),
|
|
101
111
|
import_zod.z.object({ t: import_zod.z.literal("leaveRoom") }),
|
|
@@ -125,9 +135,13 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
|
|
|
125
135
|
totalRounds: import_zod.z.number().int().min(1).max(50),
|
|
126
136
|
categoryIds: import_zod.z.array(import_zod.z.string().max(60)).min(0).max(12),
|
|
127
137
|
// empty for games without categories (Dama); trivia rejects empty in-handler
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
//
|
|
138
|
+
// Is the HOST a participant, or just running the room on the TV? Additive, no pv bump.
|
|
139
|
+
// ⚠ The DEFAULT when omitted is PER-GAME (each game's shipped behavior is preserved):
|
|
140
|
+
// • ersimha (gs#45): omit/false = host stays the TV/spectator (D-030 MVP shape);
|
|
141
|
+
// true = host joins the drawer rotation as first drawer — a pair plays on 2 devices.
|
|
142
|
+
// • dama (gs#47, D-037): omit/true = host plays black (the original 1v1 shape);
|
|
143
|
+
// false = the first two approved joiners take the board and the host WATCHES
|
|
144
|
+
// (yourColor:null) while keeping every host power. Needs 2 approved joiners.
|
|
131
145
|
hostPlays: import_zod.z.boolean().optional(),
|
|
132
146
|
// PREFERRED: pick a mode from the registry (see MODES). The server maps it to the engine
|
|
133
147
|
// rules. Send this and omit buzzerMode/noHost. Falls back to the legacy flags below if omitted.
|
package/dist/index.d.cts
CHANGED
|
@@ -134,6 +134,33 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
134
134
|
}, {
|
|
135
135
|
t: "renameHost";
|
|
136
136
|
name: string;
|
|
137
|
+
}>, z.ZodObject<{
|
|
138
|
+
t: z.ZodLiteral<"setProfile">;
|
|
139
|
+
name: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
140
|
+
avatar: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
emoji: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
142
|
+
color: z.ZodString;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
emoji: string;
|
|
145
|
+
color: string;
|
|
146
|
+
}, {
|
|
147
|
+
emoji: string;
|
|
148
|
+
color: string;
|
|
149
|
+
}>>;
|
|
150
|
+
}, "strip", z.ZodTypeAny, {
|
|
151
|
+
t: "setProfile";
|
|
152
|
+
name?: string | undefined;
|
|
153
|
+
avatar?: {
|
|
154
|
+
emoji: string;
|
|
155
|
+
color: string;
|
|
156
|
+
} | undefined;
|
|
157
|
+
}, {
|
|
158
|
+
t: "setProfile";
|
|
159
|
+
name?: string | undefined;
|
|
160
|
+
avatar?: {
|
|
161
|
+
emoji: string;
|
|
162
|
+
color: string;
|
|
163
|
+
} | undefined;
|
|
137
164
|
}>, z.ZodObject<{
|
|
138
165
|
t: z.ZodLiteral<"joinRoom">;
|
|
139
166
|
code: z.ZodString;
|
package/dist/index.d.ts
CHANGED
|
@@ -134,6 +134,33 @@ declare const ClientMsg: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
|
|
|
134
134
|
}, {
|
|
135
135
|
t: "renameHost";
|
|
136
136
|
name: string;
|
|
137
|
+
}>, z.ZodObject<{
|
|
138
|
+
t: z.ZodLiteral<"setProfile">;
|
|
139
|
+
name: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
140
|
+
avatar: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
emoji: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
142
|
+
color: z.ZodString;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
emoji: string;
|
|
145
|
+
color: string;
|
|
146
|
+
}, {
|
|
147
|
+
emoji: string;
|
|
148
|
+
color: string;
|
|
149
|
+
}>>;
|
|
150
|
+
}, "strip", z.ZodTypeAny, {
|
|
151
|
+
t: "setProfile";
|
|
152
|
+
name?: string | undefined;
|
|
153
|
+
avatar?: {
|
|
154
|
+
emoji: string;
|
|
155
|
+
color: string;
|
|
156
|
+
} | undefined;
|
|
157
|
+
}, {
|
|
158
|
+
t: "setProfile";
|
|
159
|
+
name?: string | undefined;
|
|
160
|
+
avatar?: {
|
|
161
|
+
emoji: string;
|
|
162
|
+
color: string;
|
|
163
|
+
} | undefined;
|
|
137
164
|
}>, z.ZodObject<{
|
|
138
165
|
t: z.ZodLiteral<"joinRoom">;
|
|
139
166
|
code: z.ZodString;
|
package/dist/index.js
CHANGED
|
@@ -60,7 +60,17 @@ var ClientMsg = z.discriminatedUnion("t", [
|
|
|
60
60
|
z.object({ t: z.literal("createRoom"), name: DisplayName.optional(), avatar: Avatar.optional(), game: z.enum(GAME_IDS).optional(), pv: Pv, idToken: IdToken, platform: Platform }),
|
|
61
61
|
// Host sets/changes their display name AFTER createRoom (for anonymous one-tap
|
|
62
62
|
// hosts who started nameless). Host-only; the relay re-broadcasts the lobby.
|
|
63
|
+
// SUPERSEDED by setProfile (kept working for shipped builds).
|
|
63
64
|
z.object({ t: z.literal("renameHost"), name: DisplayName }),
|
|
65
|
+
// ANY room member changes their OWN display identity mid-room (gs#48) — lobby or mid-game.
|
|
66
|
+
// One message for both fields because the client's picker edits them together: one atomic
|
|
67
|
+
// update, one re-broadcast, no half-changed roster. Send either field or both; sending
|
|
68
|
+
// neither is a no-op. SELF-ONLY by construction — the server always applies it to the
|
|
69
|
+
// SENDER's seat, so there is no playerId to spoof. Additive: no pv bump.
|
|
70
|
+
// Note: mid-game propagation depends on what the running game's state carries — trivia's
|
|
71
|
+
// view carries names+avatars so it updates live; dama/ersimha views are id-keyed (clients
|
|
72
|
+
// map ids→names from the lobby roster), so a change there lands on the next lobby.
|
|
73
|
+
z.object({ t: z.literal("setProfile"), name: DisplayName.optional(), avatar: Avatar.optional() }),
|
|
64
74
|
z.object({ t: z.literal("joinRoom"), code: RoomCode, name: DisplayName, avatar: Avatar.optional(), pv: Pv, idToken: IdToken, platform: Platform }),
|
|
65
75
|
z.object({ t: z.literal("resume"), code: RoomCode, token: z.string().max(120), avatar: Avatar.optional(), pv: Pv, idToken: IdToken, platform: Platform }),
|
|
66
76
|
z.object({ t: z.literal("leaveRoom") }),
|
|
@@ -90,9 +100,13 @@ var ClientMsg = z.discriminatedUnion("t", [
|
|
|
90
100
|
totalRounds: z.number().int().min(1).max(50),
|
|
91
101
|
categoryIds: z.array(z.string().max(60)).min(0).max(12),
|
|
92
102
|
// empty for games without categories (Dama); trivia rejects empty in-handler
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
103
|
+
// Is the HOST a participant, or just running the room on the TV? Additive, no pv bump.
|
|
104
|
+
// ⚠ The DEFAULT when omitted is PER-GAME (each game's shipped behavior is preserved):
|
|
105
|
+
// • ersimha (gs#45): omit/false = host stays the TV/spectator (D-030 MVP shape);
|
|
106
|
+
// true = host joins the drawer rotation as first drawer — a pair plays on 2 devices.
|
|
107
|
+
// • dama (gs#47, D-037): omit/true = host plays black (the original 1v1 shape);
|
|
108
|
+
// false = the first two approved joiners take the board and the host WATCHES
|
|
109
|
+
// (yourColor:null) while keeping every host power. Needs 2 approved joiners.
|
|
96
110
|
hostPlays: z.boolean().optional(),
|
|
97
111
|
// PREFERRED: pick a mode from the registry (see MODES). The server maps it to the engine
|
|
98
112
|
// 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.22",
|
|
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",
|