@thegeem/protocol 0.1.27 → 0.1.29
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 +7 -2
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -113,6 +113,9 @@ 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).
|
|
116
119
|
// Participation (D-042): every person in a room is PLAYING or WATCHING, one model for every game.
|
|
117
120
|
// The badge means "I'm IN", NOT "I'm on the board" — the playing list is ORDERED and each game seats
|
|
118
121
|
// up to its own capacity (دامة 2; ارسمها/trivia everyone), so extras are WAITING rather than wearing a
|
|
@@ -165,12 +168,14 @@ var ClientMsg = import_zod.z.discriminatedUnion("t", [
|
|
|
165
168
|
// (yourColor:null) while keeping every host power. Needs 2 approved joiners.
|
|
166
169
|
hostPlays: import_zod.z.boolean().optional(),
|
|
167
170
|
// Name the seats explicitly instead of taking them by join order (gs#47 Ask 2, layered on per
|
|
168
|
-
// D-037).
|
|
171
|
+
// D-037). DISTINCT ids, all approved members of the room (the host may be one). ARITY is the
|
|
172
|
+
// GAME's rule, not the wire's: each driver checks the list against its own capacity (دامة needs
|
|
173
|
+
// exactly 2; ارسمها/trivia take any number), so a new game never needs a protocol change here.
|
|
169
174
|
// Order matters where a game seats a fixed number: دامة takes `players[0]` as black (moves first).
|
|
170
175
|
// Everyone not listed WATCHES. When present this OVERRIDES `hostPlays` and the lobby's playing list —
|
|
171
176
|
// an explicit seating beats an implicit one.
|
|
172
177
|
// Violations are rejected with `invalid_seat`. Consumed by دامة (the only fixed-seat game today).
|
|
173
|
-
players: import_zod.z.array(PlayerId).
|
|
178
|
+
players: import_zod.z.array(PlayerId).min(1).max(LIMITS.MAX_PLAYERS).optional(),
|
|
174
179
|
// PREFERRED: pick a mode from the registry (see MODES). The server maps it to the engine
|
|
175
180
|
// rules. Send this and omit buzzerMode/noHost. Falls back to the legacy flags below if omitted.
|
|
176
181
|
modeId: import_zod.z.enum(MODE_IDS).optional(),
|
package/dist/index.d.cts
CHANGED
|
@@ -832,6 +832,8 @@ interface DamaStateView {
|
|
|
832
832
|
yourColor: 'black' | 'white' | null;
|
|
833
833
|
legalMoves: DamaMoveView[];
|
|
834
834
|
moveCount: number;
|
|
835
|
+
black?: string;
|
|
836
|
+
white?: string;
|
|
835
837
|
}
|
|
836
838
|
/**
|
|
837
839
|
* The authoritative Ersimha round state. Anti-cheat boundary (D-030): `word` is set ONLY in the
|
|
@@ -902,6 +904,7 @@ type ServerMsg = {
|
|
|
902
904
|
selectedCategoryIds: string[];
|
|
903
905
|
teams: TeamSlotView[];
|
|
904
906
|
hostActivity: 'configuring' | 'idle';
|
|
907
|
+
tally?: Record<string, number>;
|
|
905
908
|
modeId: ModeId | null;
|
|
906
909
|
you: YouContext;
|
|
907
910
|
} | {
|
package/dist/index.d.ts
CHANGED
|
@@ -832,6 +832,8 @@ interface DamaStateView {
|
|
|
832
832
|
yourColor: 'black' | 'white' | null;
|
|
833
833
|
legalMoves: DamaMoveView[];
|
|
834
834
|
moveCount: number;
|
|
835
|
+
black?: string;
|
|
836
|
+
white?: string;
|
|
835
837
|
}
|
|
836
838
|
/**
|
|
837
839
|
* The authoritative Ersimha round state. Anti-cheat boundary (D-030): `word` is set ONLY in the
|
|
@@ -902,6 +904,7 @@ type ServerMsg = {
|
|
|
902
904
|
selectedCategoryIds: string[];
|
|
903
905
|
teams: TeamSlotView[];
|
|
904
906
|
hostActivity: 'configuring' | 'idle';
|
|
907
|
+
tally?: Record<string, number>;
|
|
905
908
|
modeId: ModeId | null;
|
|
906
909
|
you: YouContext;
|
|
907
910
|
} | {
|
package/dist/index.js
CHANGED
|
@@ -76,6 +76,9 @@ 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).
|
|
79
82
|
// Participation (D-042): every person in a room is PLAYING or WATCHING, one model for every game.
|
|
80
83
|
// The badge means "I'm IN", NOT "I'm on the board" — the playing list is ORDERED and each game seats
|
|
81
84
|
// up to its own capacity (دامة 2; ارسمها/trivia everyone), so extras are WAITING rather than wearing a
|
|
@@ -128,12 +131,14 @@ var ClientMsg = z.discriminatedUnion("t", [
|
|
|
128
131
|
// (yourColor:null) while keeping every host power. Needs 2 approved joiners.
|
|
129
132
|
hostPlays: z.boolean().optional(),
|
|
130
133
|
// Name the seats explicitly instead of taking them by join order (gs#47 Ask 2, layered on per
|
|
131
|
-
// D-037).
|
|
134
|
+
// D-037). DISTINCT ids, all approved members of the room (the host may be one). ARITY is the
|
|
135
|
+
// GAME's rule, not the wire's: each driver checks the list against its own capacity (دامة needs
|
|
136
|
+
// exactly 2; ارسمها/trivia take any number), so a new game never needs a protocol change here.
|
|
132
137
|
// Order matters where a game seats a fixed number: دامة takes `players[0]` as black (moves first).
|
|
133
138
|
// Everyone not listed WATCHES. When present this OVERRIDES `hostPlays` and the lobby's playing list —
|
|
134
139
|
// an explicit seating beats an implicit one.
|
|
135
140
|
// Violations are rejected with `invalid_seat`. Consumed by دامة (the only fixed-seat game today).
|
|
136
|
-
players: z.array(PlayerId).
|
|
141
|
+
players: z.array(PlayerId).min(1).max(LIMITS.MAX_PLAYERS).optional(),
|
|
137
142
|
// PREFERRED: pick a mode from the registry (see MODES). The server maps it to the engine
|
|
138
143
|
// rules. Send this and omit buzzerMode/noHost. Falls back to the legacy flags below if omitted.
|
|
139
144
|
modeId: z.enum(MODE_IDS).optional(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thegeem/protocol",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.29",
|
|
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",
|