@joystyk/rooms 0.0.0 → 0.2.0

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +147 -2
  3. package/dist/canonical.d.ts +10 -0
  4. package/dist/canonical.js +30 -0
  5. package/dist/canonical.js.map +1 -0
  6. package/dist/core.d.ts +3 -0
  7. package/dist/core.js +1879 -0
  8. package/dist/core.js.map +1 -0
  9. package/dist/index.d.ts +6 -0
  10. package/dist/index.js +7 -0
  11. package/dist/names.d.ts +19 -0
  12. package/dist/names.js +28 -0
  13. package/dist/names.js.map +1 -0
  14. package/dist/node/host.d.ts +67 -0
  15. package/dist/node/host.js +323 -0
  16. package/dist/node/host.js.map +1 -0
  17. package/dist/node/index.d.ts +6 -0
  18. package/dist/node/index.js +7 -0
  19. package/dist/node/jobs.d.ts +48 -0
  20. package/dist/node/jobs.js +176 -0
  21. package/dist/node/jobs.js.map +1 -0
  22. package/dist/node/registry.d.ts +32 -0
  23. package/dist/node/registry.js +43 -0
  24. package/dist/node/registry.js.map +1 -0
  25. package/dist/node/server.d.ts +59 -0
  26. package/dist/node/server.js +577 -0
  27. package/dist/node/server.js.map +1 -0
  28. package/dist/node/store.d.ts +53 -0
  29. package/dist/node/store.js +245 -0
  30. package/dist/node/store.js.map +1 -0
  31. package/dist/node/support.d.ts +67 -0
  32. package/dist/node/support.js +126 -0
  33. package/dist/node/support.js.map +1 -0
  34. package/dist/policy.d.ts +15 -0
  35. package/dist/policy.js +41 -0
  36. package/dist/policy.js.map +1 -0
  37. package/dist/protocol/index.d.ts +43 -0
  38. package/dist/protocol/index.js +48 -0
  39. package/dist/protocol/index.js.map +1 -0
  40. package/dist/protocol/schemas.d.ts +792 -0
  41. package/dist/protocol/schemas.js +332 -0
  42. package/dist/protocol/schemas.js.map +1 -0
  43. package/dist/protocol/types.d.ts +279 -0
  44. package/dist/protocol/types.js +1 -0
  45. package/dist/record.d.ts +173 -0
  46. package/dist/record.js +181 -0
  47. package/dist/record.js.map +1 -0
  48. package/dist/types.d.ts +374 -0
  49. package/dist/types.js +15 -0
  50. package/dist/types.js.map +1 -0
  51. package/package.json +56 -11
@@ -0,0 +1,792 @@
1
+ import { type Json } from '@joystyk/contracts';
2
+ import * as z from 'zod/mini';
3
+ /** The current wire protocol version. */
4
+ export declare const PROTOCOL_VERSION = 1;
5
+ /** Versions the server accepts: the current one and, once it exists, the previous one (Rule 4). */
6
+ export declare const SUPPORTED_PROTOCOLS: readonly number[];
7
+ /** Invite-code letters: no 0/O or 1/I. */
8
+ export declare const ROOM_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
9
+ export declare const ROOM_CODE_LENGTH = 6;
10
+ /** Any JSON value, checked with the contract's `isJson` (no NaN, Infinity or -0). */
11
+ export declare const JsonValue: z.ZodMiniCustom<Json, Json>;
12
+ export declare const RoomCode: z.ZodMiniString<string>;
13
+ /** A six-character invite code from `ROOM_ALPHABET`. */
14
+ export type RoomCode = string;
15
+ /** Generated by the client for each action: 8–40 URL-safe characters. */
16
+ export declare const ActionId: z.ZodMiniString<string>;
17
+ export type ActionId = string;
18
+ /** 24 random bytes, base64url. */
19
+ export declare const SeatToken: z.ZodMiniString<string>;
20
+ export declare const GameId: z.ZodMiniString<string>;
21
+ /**
22
+ * 1–24 characters, no control or format characters, no leading or trailing space. This schema
23
+ * is only the shape: the room core runs the identity package's name filter and replaces a
24
+ * refused name with a generated one (notice `name-replaced`).
25
+ */
26
+ export declare const DisplayName: z.ZodMiniString<string>;
27
+ export declare const Revision: z.ZodMiniInt;
28
+ export declare const SeatIdSchema: z.ZodMiniInt;
29
+ export declare const BuildId: z.ZodMiniString<string>;
30
+ /** A decision clock in milliseconds: 1 s to 24 h. */
31
+ export declare const DecisionMs: z.ZodMiniInt;
32
+ /** A time bank: 1 s to 24 h to start with, and up to 1 h added back per move. */
33
+ export declare const BankSettingSchema: z.ZodMiniObject<{
34
+ initialMs: z.ZodMiniInt;
35
+ incrementMs: z.ZodMiniInt;
36
+ }, z.core.$strict>;
37
+ export declare const GamePinSchema: z.ZodMiniObject<{
38
+ id: z.ZodMiniString<string>;
39
+ build: z.ZodMiniString<string>;
40
+ rulesVersion: z.ZodMiniInt;
41
+ saveVersion: z.ZodMiniInt;
42
+ }, z.core.$strip>;
43
+ export declare const RoomPhaseSchema: z.ZodMiniEnum<{
44
+ closed: "closed";
45
+ lobby: "lobby";
46
+ playing: "playing";
47
+ finished: "finished";
48
+ }>;
49
+ export declare const OfferKindSchema: z.ZodMiniEnum<{
50
+ rematch: "rematch";
51
+ end: "end";
52
+ }>;
53
+ export declare const RoomControlSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
54
+ kind: z.ZodMiniLiteral<"ready">;
55
+ ready: z.ZodMiniBoolean<boolean>;
56
+ }, z.core.$strict>, z.ZodMiniObject<{
57
+ kind: z.ZodMiniLiteral<"settings">;
58
+ decisionMs: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniInt>>;
59
+ bank: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
60
+ initialMs: z.ZodMiniInt;
61
+ incrementMs: z.ZodMiniInt;
62
+ }, z.core.$strict>>>;
63
+ config: z.ZodMiniOptional<z.ZodMiniCustom<Json, Json>>;
64
+ aiLevel: z.ZodMiniOptional<z.ZodMiniString<string>>;
65
+ }, z.core.$strict>, z.ZodMiniObject<{
66
+ kind: z.ZodMiniLiteral<"fill-with-ai">;
67
+ seat: z.ZodMiniInt;
68
+ }, z.core.$strict>, z.ZodMiniObject<{
69
+ kind: z.ZodMiniLiteral<"remove-seat">;
70
+ seat: z.ZodMiniInt;
71
+ }, z.core.$strict>, z.ZodMiniObject<{
72
+ kind: z.ZodMiniLiteral<"start">;
73
+ }, z.core.$strict>, z.ZodMiniObject<{
74
+ kind: z.ZodMiniLiteral<"offer">;
75
+ offer: z.ZodMiniEnum<{
76
+ rematch: "rematch";
77
+ end: "end";
78
+ }>;
79
+ }, z.core.$strict>, z.ZodMiniObject<{
80
+ kind: z.ZodMiniLiteral<"accept">;
81
+ offer: z.ZodMiniInt;
82
+ }, z.core.$strict>, z.ZodMiniObject<{
83
+ kind: z.ZodMiniLiteral<"decline">;
84
+ offer: z.ZodMiniInt;
85
+ }, z.core.$strict>, z.ZodMiniObject<{
86
+ kind: z.ZodMiniLiteral<"withdraw">;
87
+ offer: z.ZodMiniInt;
88
+ }, z.core.$strict>, z.ZodMiniObject<{
89
+ kind: z.ZodMiniLiteral<"leave-seat">;
90
+ }, z.core.$strict>, z.ZodMiniObject<{
91
+ kind: z.ZodMiniLiteral<"resign">;
92
+ }, z.core.$strict>], "kind">;
93
+ export declare const JoinMessageSchema: z.ZodMiniObject<{
94
+ v: z.ZodMiniInt;
95
+ t: z.ZodMiniLiteral<"join">;
96
+ room: z.ZodMiniString<string>;
97
+ game: z.ZodMiniString<string>;
98
+ name: z.ZodMiniString<string>;
99
+ token: z.ZodMiniOptional<z.ZodMiniString<string>>;
100
+ watch: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
101
+ build: z.ZodMiniString<string>;
102
+ }, z.core.$strict>;
103
+ export declare const ActMessageSchema: z.ZodMiniObject<{
104
+ v: z.ZodMiniInt;
105
+ t: z.ZodMiniLiteral<"act">;
106
+ id: z.ZodMiniString<string>;
107
+ rev: z.ZodMiniInt;
108
+ command: z.ZodMiniCustom<Json, Json>;
109
+ }, z.core.$strict>;
110
+ export declare const ControlMessageSchema: z.ZodMiniObject<{
111
+ v: z.ZodMiniInt;
112
+ t: z.ZodMiniLiteral<"control">;
113
+ id: z.ZodMiniString<string>;
114
+ rev: z.ZodMiniInt;
115
+ control: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
116
+ kind: z.ZodMiniLiteral<"ready">;
117
+ ready: z.ZodMiniBoolean<boolean>;
118
+ }, z.core.$strict>, z.ZodMiniObject<{
119
+ kind: z.ZodMiniLiteral<"settings">;
120
+ decisionMs: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniInt>>;
121
+ bank: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
122
+ initialMs: z.ZodMiniInt;
123
+ incrementMs: z.ZodMiniInt;
124
+ }, z.core.$strict>>>;
125
+ config: z.ZodMiniOptional<z.ZodMiniCustom<Json, Json>>;
126
+ aiLevel: z.ZodMiniOptional<z.ZodMiniString<string>>;
127
+ }, z.core.$strict>, z.ZodMiniObject<{
128
+ kind: z.ZodMiniLiteral<"fill-with-ai">;
129
+ seat: z.ZodMiniInt;
130
+ }, z.core.$strict>, z.ZodMiniObject<{
131
+ kind: z.ZodMiniLiteral<"remove-seat">;
132
+ seat: z.ZodMiniInt;
133
+ }, z.core.$strict>, z.ZodMiniObject<{
134
+ kind: z.ZodMiniLiteral<"start">;
135
+ }, z.core.$strict>, z.ZodMiniObject<{
136
+ kind: z.ZodMiniLiteral<"offer">;
137
+ offer: z.ZodMiniEnum<{
138
+ rematch: "rematch";
139
+ end: "end";
140
+ }>;
141
+ }, z.core.$strict>, z.ZodMiniObject<{
142
+ kind: z.ZodMiniLiteral<"accept">;
143
+ offer: z.ZodMiniInt;
144
+ }, z.core.$strict>, z.ZodMiniObject<{
145
+ kind: z.ZodMiniLiteral<"decline">;
146
+ offer: z.ZodMiniInt;
147
+ }, z.core.$strict>, z.ZodMiniObject<{
148
+ kind: z.ZodMiniLiteral<"withdraw">;
149
+ offer: z.ZodMiniInt;
150
+ }, z.core.$strict>, z.ZodMiniObject<{
151
+ kind: z.ZodMiniLiteral<"leave-seat">;
152
+ }, z.core.$strict>, z.ZodMiniObject<{
153
+ kind: z.ZodMiniLiteral<"resign">;
154
+ }, z.core.$strict>], "kind">;
155
+ }, z.core.$strict>;
156
+ export declare const ResyncMessageSchema: z.ZodMiniObject<{
157
+ v: z.ZodMiniInt;
158
+ t: z.ZodMiniLiteral<"resync">;
159
+ }, z.core.$strict>;
160
+ export declare const ClientMessageSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
161
+ v: z.ZodMiniInt;
162
+ t: z.ZodMiniLiteral<"join">;
163
+ room: z.ZodMiniString<string>;
164
+ game: z.ZodMiniString<string>;
165
+ name: z.ZodMiniString<string>;
166
+ token: z.ZodMiniOptional<z.ZodMiniString<string>>;
167
+ watch: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
168
+ build: z.ZodMiniString<string>;
169
+ }, z.core.$strict>, z.ZodMiniObject<{
170
+ v: z.ZodMiniInt;
171
+ t: z.ZodMiniLiteral<"act">;
172
+ id: z.ZodMiniString<string>;
173
+ rev: z.ZodMiniInt;
174
+ command: z.ZodMiniCustom<Json, Json>;
175
+ }, z.core.$strict>, z.ZodMiniObject<{
176
+ v: z.ZodMiniInt;
177
+ t: z.ZodMiniLiteral<"control">;
178
+ id: z.ZodMiniString<string>;
179
+ rev: z.ZodMiniInt;
180
+ control: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
181
+ kind: z.ZodMiniLiteral<"ready">;
182
+ ready: z.ZodMiniBoolean<boolean>;
183
+ }, z.core.$strict>, z.ZodMiniObject<{
184
+ kind: z.ZodMiniLiteral<"settings">;
185
+ decisionMs: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniInt>>;
186
+ bank: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
187
+ initialMs: z.ZodMiniInt;
188
+ incrementMs: z.ZodMiniInt;
189
+ }, z.core.$strict>>>;
190
+ config: z.ZodMiniOptional<z.ZodMiniCustom<Json, Json>>;
191
+ aiLevel: z.ZodMiniOptional<z.ZodMiniString<string>>;
192
+ }, z.core.$strict>, z.ZodMiniObject<{
193
+ kind: z.ZodMiniLiteral<"fill-with-ai">;
194
+ seat: z.ZodMiniInt;
195
+ }, z.core.$strict>, z.ZodMiniObject<{
196
+ kind: z.ZodMiniLiteral<"remove-seat">;
197
+ seat: z.ZodMiniInt;
198
+ }, z.core.$strict>, z.ZodMiniObject<{
199
+ kind: z.ZodMiniLiteral<"start">;
200
+ }, z.core.$strict>, z.ZodMiniObject<{
201
+ kind: z.ZodMiniLiteral<"offer">;
202
+ offer: z.ZodMiniEnum<{
203
+ rematch: "rematch";
204
+ end: "end";
205
+ }>;
206
+ }, z.core.$strict>, z.ZodMiniObject<{
207
+ kind: z.ZodMiniLiteral<"accept">;
208
+ offer: z.ZodMiniInt;
209
+ }, z.core.$strict>, z.ZodMiniObject<{
210
+ kind: z.ZodMiniLiteral<"decline">;
211
+ offer: z.ZodMiniInt;
212
+ }, z.core.$strict>, z.ZodMiniObject<{
213
+ kind: z.ZodMiniLiteral<"withdraw">;
214
+ offer: z.ZodMiniInt;
215
+ }, z.core.$strict>, z.ZodMiniObject<{
216
+ kind: z.ZodMiniLiteral<"leave-seat">;
217
+ }, z.core.$strict>, z.ZodMiniObject<{
218
+ kind: z.ZodMiniLiteral<"resign">;
219
+ }, z.core.$strict>], "kind">;
220
+ }, z.core.$strict>, z.ZodMiniObject<{
221
+ v: z.ZodMiniInt;
222
+ t: z.ZodMiniLiteral<"resync">;
223
+ }, z.core.$strict>], "t">;
224
+ export declare const RoomOfferSchema: z.ZodMiniObject<{
225
+ id: z.ZodMiniInt;
226
+ kind: z.ZodMiniEnum<{
227
+ rematch: "rematch";
228
+ end: "end";
229
+ }>;
230
+ by: z.ZodMiniInt;
231
+ status: z.ZodMiniEnum<{
232
+ open: "open";
233
+ declined: "declined";
234
+ withdrawn: "withdrawn";
235
+ }>;
236
+ accepted: z.ZodMiniArray<z.ZodMiniInt>;
237
+ declinedBy: z.ZodMiniNullable<z.ZodMiniInt>;
238
+ endsAt: z.ZodMiniNullable<z.ZodMiniNumber<number>>;
239
+ }, z.core.$strip>;
240
+ export declare const WelcomeMessageSchema: z.ZodMiniObject<{
241
+ v: z.ZodMiniInt;
242
+ t: z.ZodMiniLiteral<"welcome">;
243
+ room: z.ZodMiniString<string>;
244
+ seat: z.ZodMiniNullable<z.ZodMiniInt>;
245
+ token: z.ZodMiniOptional<z.ZodMiniString<string>>;
246
+ host: z.ZodMiniNullable<z.ZodMiniInt>;
247
+ game: z.ZodMiniObject<{
248
+ id: z.ZodMiniString<string>;
249
+ build: z.ZodMiniString<string>;
250
+ rulesVersion: z.ZodMiniInt;
251
+ saveVersion: z.ZodMiniInt;
252
+ }, z.core.$strip>;
253
+ protocol: z.ZodMiniInt;
254
+ }, z.core.$strip>;
255
+ export declare const SnapshotMessageSchema: z.ZodMiniObject<{
256
+ v: z.ZodMiniInt;
257
+ t: z.ZodMiniLiteral<"snapshot">;
258
+ epoch: z.ZodMiniInt;
259
+ revision: z.ZodMiniInt;
260
+ phase: z.ZodMiniEnum<{
261
+ closed: "closed";
262
+ lobby: "lobby";
263
+ playing: "playing";
264
+ finished: "finished";
265
+ }>;
266
+ seat: z.ZodMiniNullable<z.ZodMiniInt>;
267
+ seats: z.ZodMiniArray<z.ZodMiniObject<{
268
+ id: z.ZodMiniInt;
269
+ name: z.ZodMiniString<string>;
270
+ controller: z.ZodMiniEnum<{
271
+ human: "human";
272
+ ai: "ai";
273
+ }>;
274
+ aiLevel: z.ZodMiniNullable<z.ZodMiniString<string>>;
275
+ claimed: z.ZodMiniBoolean<boolean>;
276
+ ready: z.ZodMiniBoolean<boolean>;
277
+ }, z.core.$strip>>;
278
+ host: z.ZodMiniNullable<z.ZodMiniInt>;
279
+ game: z.ZodMiniObject<{
280
+ id: z.ZodMiniString<string>;
281
+ build: z.ZodMiniString<string>;
282
+ rulesVersion: z.ZodMiniInt;
283
+ saveVersion: z.ZodMiniInt;
284
+ }, z.core.$strip>;
285
+ settings: z.ZodMiniObject<{
286
+ decisionMs: z.ZodMiniNullable<z.ZodMiniInt>;
287
+ bank: z.ZodMiniNullable<z.ZodMiniObject<{
288
+ initialMs: z.ZodMiniInt;
289
+ incrementMs: z.ZodMiniInt;
290
+ }, z.core.$strip>>;
291
+ aiLevel: z.ZodMiniNullable<z.ZodMiniString<string>>;
292
+ }, z.core.$strip>;
293
+ view: z.ZodMiniNullable<z.ZodMiniCustom<Json, Json>>;
294
+ history: z.ZodMiniArray<z.ZodMiniCustom<Json, Json>>;
295
+ pending: z.ZodMiniArray<z.ZodMiniInt>;
296
+ outcome: z.ZodMiniNullable<z.ZodMiniObject<{
297
+ result: z.ZodMiniEnum<{
298
+ won: "won";
299
+ lost: "lost";
300
+ draw: "draw";
301
+ completed: "completed";
302
+ abandoned: "abandoned";
303
+ }>;
304
+ placements: z.ZodMiniArray<z.ZodMiniObject<{
305
+ seat: z.ZodMiniInt;
306
+ place: z.ZodMiniInt;
307
+ score: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
308
+ }, z.core.$strip>>;
309
+ summary: z.ZodMiniString<string>;
310
+ stats: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
311
+ elapsedMs: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
312
+ }, z.core.$strip>>;
313
+ presentation: z.ZodMiniNullable<z.ZodMiniCustom<Json, Json>>;
314
+ offer: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
315
+ id: z.ZodMiniInt;
316
+ kind: z.ZodMiniEnum<{
317
+ rematch: "rematch";
318
+ end: "end";
319
+ }>;
320
+ by: z.ZodMiniInt;
321
+ status: z.ZodMiniEnum<{
322
+ open: "open";
323
+ declined: "declined";
324
+ withdrawn: "withdrawn";
325
+ }>;
326
+ accepted: z.ZodMiniArray<z.ZodMiniInt>;
327
+ declinedBy: z.ZodMiniNullable<z.ZodMiniInt>;
328
+ endsAt: z.ZodMiniNullable<z.ZodMiniNumber<number>>;
329
+ }, z.core.$strip>>>;
330
+ presence: z.ZodMiniObject<{
331
+ connected: z.ZodMiniArray<z.ZodMiniBoolean<boolean>>;
332
+ clocks: z.ZodMiniArray<z.ZodMiniObject<{
333
+ seat: z.ZodMiniInt;
334
+ remainingMs: z.ZodMiniNumber<number>;
335
+ running: z.ZodMiniBoolean<boolean>;
336
+ paused: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
337
+ }, z.core.$strip>>;
338
+ paused: z.ZodMiniBoolean<boolean>;
339
+ spectators: z.ZodMiniInt;
340
+ }, z.core.$strip>;
341
+ serverTime: z.ZodMiniNumber<number>;
342
+ }, z.core.$strip>;
343
+ export declare const UpdateMessageSchema: z.ZodMiniObject<{
344
+ v: z.ZodMiniInt;
345
+ t: z.ZodMiniLiteral<"update">;
346
+ epoch: z.ZodMiniInt;
347
+ revision: z.ZodMiniInt;
348
+ from: z.ZodMiniInt;
349
+ phase: z.ZodMiniEnum<{
350
+ closed: "closed";
351
+ lobby: "lobby";
352
+ playing: "playing";
353
+ finished: "finished";
354
+ }>;
355
+ host: z.ZodMiniNullable<z.ZodMiniInt>;
356
+ seats: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
357
+ id: z.ZodMiniInt;
358
+ name: z.ZodMiniString<string>;
359
+ controller: z.ZodMiniEnum<{
360
+ human: "human";
361
+ ai: "ai";
362
+ }>;
363
+ aiLevel: z.ZodMiniNullable<z.ZodMiniString<string>>;
364
+ claimed: z.ZodMiniBoolean<boolean>;
365
+ ready: z.ZodMiniBoolean<boolean>;
366
+ }, z.core.$strip>>>;
367
+ settings: z.ZodMiniOptional<z.ZodMiniObject<{
368
+ decisionMs: z.ZodMiniNullable<z.ZodMiniInt>;
369
+ bank: z.ZodMiniNullable<z.ZodMiniObject<{
370
+ initialMs: z.ZodMiniInt;
371
+ incrementMs: z.ZodMiniInt;
372
+ }, z.core.$strip>>;
373
+ aiLevel: z.ZodMiniNullable<z.ZodMiniString<string>>;
374
+ }, z.core.$strip>>;
375
+ beats: z.ZodMiniArray<z.ZodMiniObject<{
376
+ event: z.ZodMiniCustom<Json, Json>;
377
+ view: z.ZodMiniOptional<z.ZodMiniCustom<Json, Json>>;
378
+ }, z.core.$strip>>;
379
+ view: z.ZodMiniNullable<z.ZodMiniCustom<Json, Json>>;
380
+ pending: z.ZodMiniArray<z.ZodMiniInt>;
381
+ outcome: z.ZodMiniNullable<z.ZodMiniObject<{
382
+ result: z.ZodMiniEnum<{
383
+ won: "won";
384
+ lost: "lost";
385
+ draw: "draw";
386
+ completed: "completed";
387
+ abandoned: "abandoned";
388
+ }>;
389
+ placements: z.ZodMiniArray<z.ZodMiniObject<{
390
+ seat: z.ZodMiniInt;
391
+ place: z.ZodMiniInt;
392
+ score: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
393
+ }, z.core.$strip>>;
394
+ summary: z.ZodMiniString<string>;
395
+ stats: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
396
+ elapsedMs: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
397
+ }, z.core.$strip>>;
398
+ presentation: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniCustom<Json, Json>>>;
399
+ offer: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
400
+ id: z.ZodMiniInt;
401
+ kind: z.ZodMiniEnum<{
402
+ rematch: "rematch";
403
+ end: "end";
404
+ }>;
405
+ by: z.ZodMiniInt;
406
+ status: z.ZodMiniEnum<{
407
+ open: "open";
408
+ declined: "declined";
409
+ withdrawn: "withdrawn";
410
+ }>;
411
+ accepted: z.ZodMiniArray<z.ZodMiniInt>;
412
+ declinedBy: z.ZodMiniNullable<z.ZodMiniInt>;
413
+ endsAt: z.ZodMiniNullable<z.ZodMiniNumber<number>>;
414
+ }, z.core.$strip>>>;
415
+ presence: z.ZodMiniObject<{
416
+ connected: z.ZodMiniArray<z.ZodMiniBoolean<boolean>>;
417
+ clocks: z.ZodMiniArray<z.ZodMiniObject<{
418
+ seat: z.ZodMiniInt;
419
+ remainingMs: z.ZodMiniNumber<number>;
420
+ running: z.ZodMiniBoolean<boolean>;
421
+ paused: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
422
+ }, z.core.$strip>>;
423
+ paused: z.ZodMiniBoolean<boolean>;
424
+ spectators: z.ZodMiniInt;
425
+ }, z.core.$strip>;
426
+ serverTime: z.ZodMiniNumber<number>;
427
+ }, z.core.$strip>;
428
+ /** Platform rejection codes, or a game's `GameError.code` with a `game:` prefix. */
429
+ export declare const RejectionCodeSchema: z.ZodMiniString<string>;
430
+ export declare const ReceiptMessageSchema: z.ZodMiniObject<{
431
+ v: z.ZodMiniInt;
432
+ t: z.ZodMiniLiteral<"receipt">;
433
+ id: z.ZodMiniString<string>;
434
+ result: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
435
+ status: z.ZodMiniLiteral<"accepted">;
436
+ revision: z.ZodMiniInt;
437
+ }, z.core.$strip>, z.ZodMiniObject<{
438
+ status: z.ZodMiniLiteral<"rejected">;
439
+ code: z.ZodMiniString<string>;
440
+ message: z.ZodMiniString<string>;
441
+ revision: z.ZodMiniInt;
442
+ }, z.core.$strip>], "status">;
443
+ }, z.core.$strip>;
444
+ export declare const PresenceMessageSchema: z.ZodMiniObject<{
445
+ v: z.ZodMiniInt;
446
+ t: z.ZodMiniLiteral<"presence">;
447
+ presence: z.ZodMiniObject<{
448
+ connected: z.ZodMiniArray<z.ZodMiniBoolean<boolean>>;
449
+ clocks: z.ZodMiniArray<z.ZodMiniObject<{
450
+ seat: z.ZodMiniInt;
451
+ remainingMs: z.ZodMiniNumber<number>;
452
+ running: z.ZodMiniBoolean<boolean>;
453
+ paused: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
454
+ }, z.core.$strip>>;
455
+ paused: z.ZodMiniBoolean<boolean>;
456
+ spectators: z.ZodMiniInt;
457
+ }, z.core.$strip>;
458
+ serverTime: z.ZodMiniNumber<number>;
459
+ }, z.core.$strip>;
460
+ export declare const NoticeCodeSchema: z.ZodMiniEnum<{
461
+ "bad-message": "bad-message";
462
+ "too-fast": "too-fast";
463
+ "no-such-room": "no-such-room";
464
+ "room-full": "room-full";
465
+ "protocol-unsupported": "protocol-unsupported";
466
+ "server-busy": "server-busy";
467
+ "name-replaced": "name-replaced";
468
+ }>;
469
+ export declare const NoticeMessageSchema: z.ZodMiniObject<{
470
+ v: z.ZodMiniInt;
471
+ t: z.ZodMiniLiteral<"notice">;
472
+ code: z.ZodMiniEnum<{
473
+ "bad-message": "bad-message";
474
+ "too-fast": "too-fast";
475
+ "no-such-room": "no-such-room";
476
+ "room-full": "room-full";
477
+ "protocol-unsupported": "protocol-unsupported";
478
+ "server-busy": "server-busy";
479
+ "name-replaced": "name-replaced";
480
+ }>;
481
+ message: z.ZodMiniString<string>;
482
+ }, z.core.$strip>;
483
+ export declare const ReplacedMessageSchema: z.ZodMiniObject<{
484
+ v: z.ZodMiniInt;
485
+ t: z.ZodMiniLiteral<"replaced">;
486
+ }, z.core.$strip>;
487
+ export declare const ClosingMessageSchema: z.ZodMiniObject<{
488
+ v: z.ZodMiniInt;
489
+ t: z.ZodMiniLiteral<"closing">;
490
+ reason: z.ZodMiniEnum<{
491
+ closed: "closed";
492
+ restart: "restart";
493
+ expired: "expired";
494
+ }>;
495
+ retryAfterMs: z.ZodMiniNullable<z.ZodMiniNumber<number>>;
496
+ }, z.core.$strip>;
497
+ export declare const ServerMessageSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
498
+ v: z.ZodMiniInt;
499
+ t: z.ZodMiniLiteral<"welcome">;
500
+ room: z.ZodMiniString<string>;
501
+ seat: z.ZodMiniNullable<z.ZodMiniInt>;
502
+ token: z.ZodMiniOptional<z.ZodMiniString<string>>;
503
+ host: z.ZodMiniNullable<z.ZodMiniInt>;
504
+ game: z.ZodMiniObject<{
505
+ id: z.ZodMiniString<string>;
506
+ build: z.ZodMiniString<string>;
507
+ rulesVersion: z.ZodMiniInt;
508
+ saveVersion: z.ZodMiniInt;
509
+ }, z.core.$strip>;
510
+ protocol: z.ZodMiniInt;
511
+ }, z.core.$strip>, z.ZodMiniObject<{
512
+ v: z.ZodMiniInt;
513
+ t: z.ZodMiniLiteral<"snapshot">;
514
+ epoch: z.ZodMiniInt;
515
+ revision: z.ZodMiniInt;
516
+ phase: z.ZodMiniEnum<{
517
+ closed: "closed";
518
+ lobby: "lobby";
519
+ playing: "playing";
520
+ finished: "finished";
521
+ }>;
522
+ seat: z.ZodMiniNullable<z.ZodMiniInt>;
523
+ seats: z.ZodMiniArray<z.ZodMiniObject<{
524
+ id: z.ZodMiniInt;
525
+ name: z.ZodMiniString<string>;
526
+ controller: z.ZodMiniEnum<{
527
+ human: "human";
528
+ ai: "ai";
529
+ }>;
530
+ aiLevel: z.ZodMiniNullable<z.ZodMiniString<string>>;
531
+ claimed: z.ZodMiniBoolean<boolean>;
532
+ ready: z.ZodMiniBoolean<boolean>;
533
+ }, z.core.$strip>>;
534
+ host: z.ZodMiniNullable<z.ZodMiniInt>;
535
+ game: z.ZodMiniObject<{
536
+ id: z.ZodMiniString<string>;
537
+ build: z.ZodMiniString<string>;
538
+ rulesVersion: z.ZodMiniInt;
539
+ saveVersion: z.ZodMiniInt;
540
+ }, z.core.$strip>;
541
+ settings: z.ZodMiniObject<{
542
+ decisionMs: z.ZodMiniNullable<z.ZodMiniInt>;
543
+ bank: z.ZodMiniNullable<z.ZodMiniObject<{
544
+ initialMs: z.ZodMiniInt;
545
+ incrementMs: z.ZodMiniInt;
546
+ }, z.core.$strip>>;
547
+ aiLevel: z.ZodMiniNullable<z.ZodMiniString<string>>;
548
+ }, z.core.$strip>;
549
+ view: z.ZodMiniNullable<z.ZodMiniCustom<Json, Json>>;
550
+ history: z.ZodMiniArray<z.ZodMiniCustom<Json, Json>>;
551
+ pending: z.ZodMiniArray<z.ZodMiniInt>;
552
+ outcome: z.ZodMiniNullable<z.ZodMiniObject<{
553
+ result: z.ZodMiniEnum<{
554
+ won: "won";
555
+ lost: "lost";
556
+ draw: "draw";
557
+ completed: "completed";
558
+ abandoned: "abandoned";
559
+ }>;
560
+ placements: z.ZodMiniArray<z.ZodMiniObject<{
561
+ seat: z.ZodMiniInt;
562
+ place: z.ZodMiniInt;
563
+ score: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
564
+ }, z.core.$strip>>;
565
+ summary: z.ZodMiniString<string>;
566
+ stats: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
567
+ elapsedMs: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
568
+ }, z.core.$strip>>;
569
+ presentation: z.ZodMiniNullable<z.ZodMiniCustom<Json, Json>>;
570
+ offer: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
571
+ id: z.ZodMiniInt;
572
+ kind: z.ZodMiniEnum<{
573
+ rematch: "rematch";
574
+ end: "end";
575
+ }>;
576
+ by: z.ZodMiniInt;
577
+ status: z.ZodMiniEnum<{
578
+ open: "open";
579
+ declined: "declined";
580
+ withdrawn: "withdrawn";
581
+ }>;
582
+ accepted: z.ZodMiniArray<z.ZodMiniInt>;
583
+ declinedBy: z.ZodMiniNullable<z.ZodMiniInt>;
584
+ endsAt: z.ZodMiniNullable<z.ZodMiniNumber<number>>;
585
+ }, z.core.$strip>>>;
586
+ presence: z.ZodMiniObject<{
587
+ connected: z.ZodMiniArray<z.ZodMiniBoolean<boolean>>;
588
+ clocks: z.ZodMiniArray<z.ZodMiniObject<{
589
+ seat: z.ZodMiniInt;
590
+ remainingMs: z.ZodMiniNumber<number>;
591
+ running: z.ZodMiniBoolean<boolean>;
592
+ paused: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
593
+ }, z.core.$strip>>;
594
+ paused: z.ZodMiniBoolean<boolean>;
595
+ spectators: z.ZodMiniInt;
596
+ }, z.core.$strip>;
597
+ serverTime: z.ZodMiniNumber<number>;
598
+ }, z.core.$strip>, z.ZodMiniObject<{
599
+ v: z.ZodMiniInt;
600
+ t: z.ZodMiniLiteral<"update">;
601
+ epoch: z.ZodMiniInt;
602
+ revision: z.ZodMiniInt;
603
+ from: z.ZodMiniInt;
604
+ phase: z.ZodMiniEnum<{
605
+ closed: "closed";
606
+ lobby: "lobby";
607
+ playing: "playing";
608
+ finished: "finished";
609
+ }>;
610
+ host: z.ZodMiniNullable<z.ZodMiniInt>;
611
+ seats: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
612
+ id: z.ZodMiniInt;
613
+ name: z.ZodMiniString<string>;
614
+ controller: z.ZodMiniEnum<{
615
+ human: "human";
616
+ ai: "ai";
617
+ }>;
618
+ aiLevel: z.ZodMiniNullable<z.ZodMiniString<string>>;
619
+ claimed: z.ZodMiniBoolean<boolean>;
620
+ ready: z.ZodMiniBoolean<boolean>;
621
+ }, z.core.$strip>>>;
622
+ settings: z.ZodMiniOptional<z.ZodMiniObject<{
623
+ decisionMs: z.ZodMiniNullable<z.ZodMiniInt>;
624
+ bank: z.ZodMiniNullable<z.ZodMiniObject<{
625
+ initialMs: z.ZodMiniInt;
626
+ incrementMs: z.ZodMiniInt;
627
+ }, z.core.$strip>>;
628
+ aiLevel: z.ZodMiniNullable<z.ZodMiniString<string>>;
629
+ }, z.core.$strip>>;
630
+ beats: z.ZodMiniArray<z.ZodMiniObject<{
631
+ event: z.ZodMiniCustom<Json, Json>;
632
+ view: z.ZodMiniOptional<z.ZodMiniCustom<Json, Json>>;
633
+ }, z.core.$strip>>;
634
+ view: z.ZodMiniNullable<z.ZodMiniCustom<Json, Json>>;
635
+ pending: z.ZodMiniArray<z.ZodMiniInt>;
636
+ outcome: z.ZodMiniNullable<z.ZodMiniObject<{
637
+ result: z.ZodMiniEnum<{
638
+ won: "won";
639
+ lost: "lost";
640
+ draw: "draw";
641
+ completed: "completed";
642
+ abandoned: "abandoned";
643
+ }>;
644
+ placements: z.ZodMiniArray<z.ZodMiniObject<{
645
+ seat: z.ZodMiniInt;
646
+ place: z.ZodMiniInt;
647
+ score: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
648
+ }, z.core.$strip>>;
649
+ summary: z.ZodMiniString<string>;
650
+ stats: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
651
+ elapsedMs: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
652
+ }, z.core.$strip>>;
653
+ presentation: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniCustom<Json, Json>>>;
654
+ offer: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
655
+ id: z.ZodMiniInt;
656
+ kind: z.ZodMiniEnum<{
657
+ rematch: "rematch";
658
+ end: "end";
659
+ }>;
660
+ by: z.ZodMiniInt;
661
+ status: z.ZodMiniEnum<{
662
+ open: "open";
663
+ declined: "declined";
664
+ withdrawn: "withdrawn";
665
+ }>;
666
+ accepted: z.ZodMiniArray<z.ZodMiniInt>;
667
+ declinedBy: z.ZodMiniNullable<z.ZodMiniInt>;
668
+ endsAt: z.ZodMiniNullable<z.ZodMiniNumber<number>>;
669
+ }, z.core.$strip>>>;
670
+ presence: z.ZodMiniObject<{
671
+ connected: z.ZodMiniArray<z.ZodMiniBoolean<boolean>>;
672
+ clocks: z.ZodMiniArray<z.ZodMiniObject<{
673
+ seat: z.ZodMiniInt;
674
+ remainingMs: z.ZodMiniNumber<number>;
675
+ running: z.ZodMiniBoolean<boolean>;
676
+ paused: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
677
+ }, z.core.$strip>>;
678
+ paused: z.ZodMiniBoolean<boolean>;
679
+ spectators: z.ZodMiniInt;
680
+ }, z.core.$strip>;
681
+ serverTime: z.ZodMiniNumber<number>;
682
+ }, z.core.$strip>, z.ZodMiniObject<{
683
+ v: z.ZodMiniInt;
684
+ t: z.ZodMiniLiteral<"receipt">;
685
+ id: z.ZodMiniString<string>;
686
+ result: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
687
+ status: z.ZodMiniLiteral<"accepted">;
688
+ revision: z.ZodMiniInt;
689
+ }, z.core.$strip>, z.ZodMiniObject<{
690
+ status: z.ZodMiniLiteral<"rejected">;
691
+ code: z.ZodMiniString<string>;
692
+ message: z.ZodMiniString<string>;
693
+ revision: z.ZodMiniInt;
694
+ }, z.core.$strip>], "status">;
695
+ }, z.core.$strip>, z.ZodMiniObject<{
696
+ v: z.ZodMiniInt;
697
+ t: z.ZodMiniLiteral<"presence">;
698
+ presence: z.ZodMiniObject<{
699
+ connected: z.ZodMiniArray<z.ZodMiniBoolean<boolean>>;
700
+ clocks: z.ZodMiniArray<z.ZodMiniObject<{
701
+ seat: z.ZodMiniInt;
702
+ remainingMs: z.ZodMiniNumber<number>;
703
+ running: z.ZodMiniBoolean<boolean>;
704
+ paused: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
705
+ }, z.core.$strip>>;
706
+ paused: z.ZodMiniBoolean<boolean>;
707
+ spectators: z.ZodMiniInt;
708
+ }, z.core.$strip>;
709
+ serverTime: z.ZodMiniNumber<number>;
710
+ }, z.core.$strip>, z.ZodMiniObject<{
711
+ v: z.ZodMiniInt;
712
+ t: z.ZodMiniLiteral<"notice">;
713
+ code: z.ZodMiniEnum<{
714
+ "bad-message": "bad-message";
715
+ "too-fast": "too-fast";
716
+ "no-such-room": "no-such-room";
717
+ "room-full": "room-full";
718
+ "protocol-unsupported": "protocol-unsupported";
719
+ "server-busy": "server-busy";
720
+ "name-replaced": "name-replaced";
721
+ }>;
722
+ message: z.ZodMiniString<string>;
723
+ }, z.core.$strip>, z.ZodMiniObject<{
724
+ v: z.ZodMiniInt;
725
+ t: z.ZodMiniLiteral<"replaced">;
726
+ }, z.core.$strip>, z.ZodMiniObject<{
727
+ v: z.ZodMiniInt;
728
+ t: z.ZodMiniLiteral<"closing">;
729
+ reason: z.ZodMiniEnum<{
730
+ closed: "closed";
731
+ restart: "restart";
732
+ expired: "expired";
733
+ }>;
734
+ retryAfterMs: z.ZodMiniNullable<z.ZodMiniNumber<number>>;
735
+ }, z.core.$strip>], "t">;
736
+ export declare const CreateRoomRequestSchema: z.ZodMiniObject<{
737
+ game: z.ZodMiniString<string>;
738
+ name: z.ZodMiniString<string>;
739
+ config: z.ZodMiniOptional<z.ZodMiniCustom<Json, Json>>;
740
+ settings: z.ZodMiniOptional<z.ZodMiniObject<{
741
+ decisionMs: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniInt>>;
742
+ bank: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
743
+ initialMs: z.ZodMiniInt;
744
+ incrementMs: z.ZodMiniInt;
745
+ }, z.core.$strict>>>;
746
+ }, z.core.$strict>>;
747
+ }, z.core.$strict>;
748
+ export declare const CreateRoomResponseSchema: z.ZodMiniObject<{
749
+ room: z.ZodMiniString<string>;
750
+ token: z.ZodMiniString<string>;
751
+ name: z.ZodMiniString<string>;
752
+ notice: z.ZodMiniOptional<z.ZodMiniObject<{
753
+ code: z.ZodMiniEnum<{
754
+ "bad-message": "bad-message";
755
+ "too-fast": "too-fast";
756
+ "no-such-room": "no-such-room";
757
+ "room-full": "room-full";
758
+ "protocol-unsupported": "protocol-unsupported";
759
+ "server-busy": "server-busy";
760
+ "name-replaced": "name-replaced";
761
+ }>;
762
+ message: z.ZodMiniString<string>;
763
+ }, z.core.$strip>>;
764
+ game: z.ZodMiniObject<{
765
+ id: z.ZodMiniString<string>;
766
+ build: z.ZodMiniString<string>;
767
+ rulesVersion: z.ZodMiniInt;
768
+ saveVersion: z.ZodMiniInt;
769
+ }, z.core.$strip>;
770
+ expiresAt: z.ZodMiniNumber<number>;
771
+ }, z.core.$strip>;
772
+ export declare const RoomInfoSchema: z.ZodMiniObject<{
773
+ game: z.ZodMiniObject<{
774
+ id: z.ZodMiniString<string>;
775
+ build: z.ZodMiniString<string>;
776
+ rulesVersion: z.ZodMiniInt;
777
+ saveVersion: z.ZodMiniInt;
778
+ }, z.core.$strip>;
779
+ phase: z.ZodMiniEnum<{
780
+ closed: "closed";
781
+ lobby: "lobby";
782
+ playing: "playing";
783
+ finished: "finished";
784
+ }>;
785
+ seatsOpen: z.ZodMiniInt;
786
+ spectatorsAllowed: z.ZodMiniBoolean<boolean>;
787
+ }, z.core.$strip>;
788
+ export declare const HostedGamesSchema: z.ZodMiniObject<{
789
+ protocol: z.ZodMiniInt;
790
+ protocols: z.ZodMiniArray<z.ZodMiniInt>;
791
+ games: z.ZodMiniArray<z.ZodMiniString<string>>;
792
+ }, z.core.$strip>;