@dreamboard-games/api-client 0.1.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 (87) hide show
  1. package/LICENSE +89 -0
  2. package/NOTICE +1 -0
  3. package/dist/@tanstack/react-query.gen.d.ts +1037 -0
  4. package/dist/@tanstack/react-query.gen.d.ts.map +1 -0
  5. package/dist/@tanstack/react-query.gen.js +1016 -0
  6. package/dist/client/client.gen.d.ts +3 -0
  7. package/dist/client/client.gen.d.ts.map +1 -0
  8. package/dist/client/client.gen.js +235 -0
  9. package/dist/client/index.d.ts +9 -0
  10. package/dist/client/index.d.ts.map +1 -0
  11. package/dist/client/index.js +6 -0
  12. package/dist/client/types.gen.d.ts +118 -0
  13. package/dist/client/types.gen.d.ts.map +1 -0
  14. package/dist/client/types.gen.js +2 -0
  15. package/dist/client/utils.gen.d.ts +34 -0
  16. package/dist/client/utils.gen.d.ts.map +1 -0
  17. package/dist/client/utils.gen.js +233 -0
  18. package/dist/client.gen.d.ts +13 -0
  19. package/dist/client.gen.d.ts.map +1 -0
  20. package/dist/client.gen.js +3 -0
  21. package/dist/core/auth.gen.d.ts +19 -0
  22. package/dist/core/auth.gen.d.ts.map +1 -0
  23. package/dist/core/auth.gen.js +14 -0
  24. package/dist/core/bodySerializer.gen.d.ts +26 -0
  25. package/dist/core/bodySerializer.gen.d.ts.map +1 -0
  26. package/dist/core/bodySerializer.gen.js +57 -0
  27. package/dist/core/params.gen.d.ts +44 -0
  28. package/dist/core/params.gen.d.ts.map +1 -0
  29. package/dist/core/params.gen.js +100 -0
  30. package/dist/core/pathSerializer.gen.d.ts +34 -0
  31. package/dist/core/pathSerializer.gen.d.ts.map +1 -0
  32. package/dist/core/pathSerializer.gen.js +114 -0
  33. package/dist/core/queryKeySerializer.gen.d.ts +19 -0
  34. package/dist/core/queryKeySerializer.gen.d.ts.map +1 -0
  35. package/dist/core/queryKeySerializer.gen.js +99 -0
  36. package/dist/core/serverSentEvents.gen.d.ts +72 -0
  37. package/dist/core/serverSentEvents.gen.d.ts.map +1 -0
  38. package/dist/core/serverSentEvents.gen.js +136 -0
  39. package/dist/core/types.gen.d.ts +79 -0
  40. package/dist/core/types.gen.d.ts.map +1 -0
  41. package/dist/core/types.gen.js +2 -0
  42. package/dist/core/utils.gen.d.ts +20 -0
  43. package/dist/core/utils.gen.d.ts.map +1 -0
  44. package/dist/core/utils.gen.js +87 -0
  45. package/dist/generated/problem-types.gen.d.ts +26 -0
  46. package/dist/generated/problem-types.gen.d.ts.map +1 -0
  47. package/dist/generated/problem-types.gen.js +23 -0
  48. package/dist/index.d.ts +5 -0
  49. package/dist/index.d.ts.map +1 -0
  50. package/dist/index.js +4 -0
  51. package/dist/sdk.gen.d.ts +364 -0
  52. package/dist/sdk.gen.d.ts.map +1 -0
  53. package/dist/sdk.gen.js +634 -0
  54. package/dist/source-revisions.d.ts +27 -0
  55. package/dist/source-revisions.d.ts.map +1 -0
  56. package/dist/source-revisions.js +174 -0
  57. package/dist/storage-paths.d.ts +17 -0
  58. package/dist/storage-paths.d.ts.map +1 -0
  59. package/dist/storage-paths.js +16 -0
  60. package/dist/types.gen.d.ts +5007 -0
  61. package/dist/types.gen.d.ts.map +1 -0
  62. package/dist/types.gen.js +2 -0
  63. package/dist/zod.gen.d.ts +37398 -0
  64. package/dist/zod.gen.d.ts.map +1 -0
  65. package/dist/zod.gen.js +2396 -0
  66. package/package.json +105 -0
  67. package/src/@tanstack/react-query.gen.ts +1114 -0
  68. package/src/client/client.gen.ts +311 -0
  69. package/src/client/index.ts +25 -0
  70. package/src/client/types.gen.ts +241 -0
  71. package/src/client/utils.gen.ts +332 -0
  72. package/src/client.gen.ts +16 -0
  73. package/src/core/auth.gen.ts +42 -0
  74. package/src/core/bodySerializer.gen.ts +100 -0
  75. package/src/core/params.gen.ts +176 -0
  76. package/src/core/pathSerializer.gen.ts +181 -0
  77. package/src/core/queryKeySerializer.gen.ts +136 -0
  78. package/src/core/serverSentEvents.gen.ts +265 -0
  79. package/src/core/types.gen.ts +118 -0
  80. package/src/core/utils.gen.ts +143 -0
  81. package/src/generated/problem-types.gen.ts +35 -0
  82. package/src/index.ts +7 -0
  83. package/src/sdk.gen.ts +709 -0
  84. package/src/source-revisions.ts +283 -0
  85. package/src/storage-paths.ts +19 -0
  86. package/src/types.gen.ts +5486 -0
  87. package/src/zod.gen.ts +2705 -0
package/src/zod.gen.ts ADDED
@@ -0,0 +1,2705 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import { z } from 'zod';
4
+
5
+ /**
6
+ * Backend runtime version metadata used by local development hosts.
7
+ */
8
+ export const zApiVersionResponse = z.object({
9
+ backendRevision: z.string(),
10
+ uiSdkVersion: z.string()
11
+ });
12
+
13
+ export const zGameMetadata = z.object({
14
+ coverImage: z.optional(z.url()),
15
+ playTime: z.optional(z.enum([
16
+ '15-30 minutes',
17
+ '30-60 minutes',
18
+ '1-2 hours',
19
+ '2-3 hours',
20
+ '3+ hours'
21
+ ])),
22
+ ageRange: z.optional(z.enum([
23
+ '3+',
24
+ '6+',
25
+ '8+',
26
+ '10+',
27
+ '12+',
28
+ '14+',
29
+ '16+',
30
+ '18+'
31
+ ])),
32
+ gameCategory: z.optional(z.enum([
33
+ 'Abstract',
34
+ 'Strategy',
35
+ 'Eurogame',
36
+ 'Ameritrash',
37
+ 'Card Game',
38
+ 'Dice Game',
39
+ 'Party Game',
40
+ 'Cooperative',
41
+ 'Competitive',
42
+ 'Solo',
43
+ 'Family Game',
44
+ 'Wargame',
45
+ 'Tile-Placement',
46
+ 'Worker Placement',
47
+ 'Deck Builder'
48
+ ])),
49
+ keyMechanics: z.optional(z.enum([
50
+ 'Area Control',
51
+ 'Set Collection',
52
+ 'Hand Management',
53
+ 'Dice Rolling',
54
+ 'Route Building',
55
+ 'Pick-up and Deliver',
56
+ 'Auction/Bidding',
57
+ 'Hidden Roles',
58
+ 'Bluffing',
59
+ 'Push Your Luck'
60
+ ]))
61
+ });
62
+
63
+ /**
64
+ * Tracks which steps have been completed for a game
65
+ */
66
+ export const zCompletedSteps = z.object({
67
+ ruleSaved: z.optional(z.boolean()).default(false),
68
+ manifestGenerated: z.optional(z.boolean()).default(false),
69
+ appBuilt: z.optional(z.boolean()).default(false),
70
+ uiBuilt: z.optional(z.boolean()).default(false)
71
+ });
72
+
73
+ /**
74
+ * Development status light shown in the dashboard
75
+ */
76
+ export const zStepLightStatus = z.enum([
77
+ 'yellow',
78
+ 'green',
79
+ 'red'
80
+ ]);
81
+
82
+ /**
83
+ * Per-area development lights shown for a game
84
+ */
85
+ export const zGameCompletionLights = z.object({
86
+ rules: zStepLightStatus,
87
+ manifest: zStepLightStatus,
88
+ phases: zStepLightStatus,
89
+ ui: zStepLightStatus
90
+ });
91
+
92
+ export const zGame = z.object({
93
+ id: z.uuid(),
94
+ slug: z.string(),
95
+ name: z.string().min(1).max(255),
96
+ description: z.optional(z.string()),
97
+ ruleText: z.optional(z.string()),
98
+ public: z.boolean().default(false),
99
+ createdAt: z.iso.datetime(),
100
+ updatedAt: z.iso.datetime(),
101
+ scriptId: z.optional(z.string()),
102
+ metadata: z.optional(zGameMetadata),
103
+ completedSteps: zCompletedSteps,
104
+ completionLights: zGameCompletionLights,
105
+ readyToPlay: z.boolean().default(false),
106
+ initialized: z.boolean().default(false)
107
+ });
108
+
109
+ /**
110
+ * Stable machine-readable problem identifier
111
+ */
112
+ export const zProblemType = z.enum([
113
+ 'urn:dreamboard:problem:action-rejected',
114
+ 'urn:dreamboard:problem:active-job-conflict',
115
+ 'urn:dreamboard:problem:authoring-state-base-missing',
116
+ 'urn:dreamboard:problem:authoring-state-drift',
117
+ 'urn:dreamboard:problem:forbidden',
118
+ 'urn:dreamboard:problem:game-slug-conflict',
119
+ 'urn:dreamboard:problem:internal-error',
120
+ 'urn:dreamboard:problem:resource-not-found',
121
+ 'urn:dreamboard:problem:source-revision-base-missing',
122
+ 'urn:dreamboard:problem:source-revision-drift',
123
+ 'urn:dreamboard:problem:source-revision-not-found',
124
+ 'urn:dreamboard:problem:state-conflict',
125
+ 'urn:dreamboard:problem:too-many-requests',
126
+ 'urn:dreamboard:problem:unauthorized',
127
+ 'urn:dreamboard:problem:validation-failed'
128
+ ]);
129
+
130
+ export const zProblemViolation = z.object({
131
+ field: z.optional(z.string()),
132
+ code: z.optional(z.string()),
133
+ message: z.string()
134
+ });
135
+
136
+ export const zProblemDetails = z.object({
137
+ type: zProblemType,
138
+ title: z.string(),
139
+ status: z.int(),
140
+ detail: z.string(),
141
+ instance: z.optional(z.string()),
142
+ requestId: z.optional(z.string()),
143
+ retryable: z.optional(z.boolean()),
144
+ context: z.optional(z.record(z.string(), z.string())),
145
+ violations: z.optional(z.array(zProblemViolation)),
146
+ timestamp: z.optional(z.iso.datetime())
147
+ });
148
+
149
+ /**
150
+ * Request to create a new game
151
+ */
152
+ export const zCreateGameRequest = z.object({
153
+ slug: z.optional(z.string()),
154
+ name: z.optional(z.string().max(200)),
155
+ description: z.optional(z.string().max(1000)),
156
+ ruleText: z.optional(z.string().max(50000)),
157
+ enhanceRule: z.optional(z.boolean()).default(false)
158
+ });
159
+
160
+ /**
161
+ * Request to extract a structured game spec from rule text.
162
+ */
163
+ export const zExtractGameSpecRequest = z.object({
164
+ ruleText: z.string().min(1).max(50000)
165
+ });
166
+
167
+ /**
168
+ * Supported player count range for a generated game.
169
+ */
170
+ export const zGameSpecPlayers = z.object({
171
+ min: z.int().gte(1).lte(20),
172
+ max: z.int().gte(1).lte(20)
173
+ });
174
+
175
+ /**
176
+ * Component family expected in the generated game.
177
+ */
178
+ export const zGameSpecComponent = z.enum([
179
+ 'deck',
180
+ 'dice',
181
+ 'board',
182
+ 'resource',
183
+ 'token',
184
+ 'tracker'
185
+ ]);
186
+
187
+ /**
188
+ * A single component instance in the generated game. Multiple instances of
189
+ * the same `kind` are allowed (e.g. two decks). `name` is a short label and
190
+ * `notes` is freeform detail the agent will expand into manifest entries.
191
+ *
192
+ */
193
+ export const zGameSpecComponentSpec = z.object({
194
+ kind: zGameSpecComponent,
195
+ name: z.string().min(1).max(100),
196
+ notes: z.optional(z.string().max(500))
197
+ });
198
+
199
+ /**
200
+ * Structured game specification submitted by the new-game flow.
201
+ */
202
+ export const zGameSpecForm = z.object({
203
+ name: z.string().min(1).max(200),
204
+ players: zGameSpecPlayers,
205
+ components: z.array(zGameSpecComponentSpec).max(50),
206
+ winCondition: z.string().max(2000),
207
+ additionalRules: z.string().min(1).max(50000)
208
+ });
209
+
210
+ /**
211
+ * Structured game spec extracted from rule text.
212
+ */
213
+ export const zExtractGameSpecResponse = z.object({
214
+ gameSpec: zGameSpecForm
215
+ });
216
+
217
+ /**
218
+ * Supported player-count metadata for the game
219
+ */
220
+ export const zPlayersDefinition = z.object({
221
+ minPlayers: z.int().gte(1).lte(10),
222
+ maxPlayers: z.int().gte(1).lte(10),
223
+ optimalPlayers: z.optional(z.int().gte(1).lte(10))
224
+ });
225
+
226
+ export const zPresetCardSetDefinition = z.object({
227
+ id: z.string().min(1),
228
+ presetId: z.string().min(1),
229
+ name: z.string().min(1),
230
+ type: z.enum(['preset'])
231
+ });
232
+
233
+ /**
234
+ * Arbitrary authored JSON value.
235
+ */
236
+ export const zJsonValue = z.union([
237
+ z.string(),
238
+ z.int(),
239
+ z.number(),
240
+ z.boolean(),
241
+ z.null(),
242
+ z.array(z.lazy((): any => zJsonValue)),
243
+ z.record(z.string(), z.lazy((): any => zJsonValue))
244
+ ]);
245
+
246
+ export const zPropertySchema = z.object({
247
+ type: z.enum([
248
+ 'string',
249
+ 'integer',
250
+ 'number',
251
+ 'boolean',
252
+ 'zoneId',
253
+ 'cardId',
254
+ 'playerId',
255
+ 'boardId',
256
+ 'edgeId',
257
+ 'vertexId',
258
+ 'spaceId',
259
+ 'pieceId',
260
+ 'dieId',
261
+ 'resourceId',
262
+ 'array',
263
+ 'object',
264
+ 'record',
265
+ 'enum'
266
+ ]),
267
+ description: z.optional(z.string()),
268
+ optional: z.optional(z.boolean()).default(false),
269
+ nullable: z.optional(z.boolean()).default(false),
270
+ default: z.optional(zJsonValue),
271
+ get items() {
272
+ return z.optional(z.lazy((): any => zPropertySchema));
273
+ },
274
+ get properties() {
275
+ return z.optional(z.record(z.string(), z.lazy((): any => zPropertySchema)));
276
+ },
277
+ enums: z.optional(z.array(z.string())),
278
+ get values() {
279
+ return z.optional(z.lazy((): any => zPropertySchema));
280
+ }
281
+ });
282
+
283
+ export const zObjectSchema = z.object({
284
+ properties: z.record(z.string(), zPropertySchema)
285
+ });
286
+
287
+ export const zCardPropertySchemaVariants = z.object({
288
+ shared: z.optional(z.record(z.string(), zPropertySchema)),
289
+ variants: z.record(z.string(), zObjectSchema)
290
+ });
291
+
292
+ export const zCardPropertySchema = z.union([
293
+ zObjectSchema,
294
+ zCardPropertySchemaVariants
295
+ ]);
296
+
297
+ export const zDetachedHomeSpec = z.object({
298
+ type: z.enum(['detached'])
299
+ });
300
+
301
+ export const zZoneHomeSpec = z.object({
302
+ type: z.enum(['zone']),
303
+ zoneId: z.string()
304
+ });
305
+
306
+ export const zSpaceHomeSpec = z.object({
307
+ type: z.enum(['space']),
308
+ boardId: z.string(),
309
+ spaceId: z.string()
310
+ });
311
+
312
+ export const zContainerHomeSpec = z.object({
313
+ type: z.enum(['container']),
314
+ boardId: z.string(),
315
+ containerId: z.string()
316
+ });
317
+
318
+ /**
319
+ * Tiled board edge identified by the spaces that border it
320
+ */
321
+ export const zBoardEdgeRef = z.object({
322
+ spaces: z.array(z.string()).min(1).max(2)
323
+ });
324
+
325
+ export const zEdgeHomeSpec = z.object({
326
+ type: z.enum(['edge']),
327
+ boardId: z.string(),
328
+ ref: zBoardEdgeRef
329
+ });
330
+
331
+ /**
332
+ * Tiled board vertex identified by the spaces that touch it
333
+ */
334
+ export const zBoardVertexRef = z.object({
335
+ spaces: z.array(z.string()).min(1).max(4)
336
+ });
337
+
338
+ export const zVertexHomeSpec = z.object({
339
+ type: z.enum(['vertex']),
340
+ boardId: z.string(),
341
+ ref: zBoardVertexRef
342
+ });
343
+
344
+ export const zPieceSlotHostRef = z.object({
345
+ kind: z.enum(['piece']),
346
+ id: z.string()
347
+ });
348
+
349
+ export const zDieSlotHostRef = z.object({
350
+ kind: z.enum(['die']),
351
+ id: z.string()
352
+ });
353
+
354
+ export const zSlotHostRef = z.union([
355
+ z.object({
356
+ kind: z.literal('piece')
357
+ }).and(zPieceSlotHostRef),
358
+ z.object({
359
+ kind: z.literal('die')
360
+ }).and(zDieSlotHostRef)
361
+ ]);
362
+
363
+ export const zSlotHomeSpec = z.object({
364
+ type: z.enum(['slot']),
365
+ host: zSlotHostRef,
366
+ slotId: z.string()
367
+ });
368
+
369
+ export const zComponentHomeSpec = z.union([
370
+ z.object({
371
+ type: z.literal('detached')
372
+ }).and(zDetachedHomeSpec),
373
+ z.object({
374
+ type: z.literal('zone')
375
+ }).and(zZoneHomeSpec),
376
+ z.object({
377
+ type: z.literal('space')
378
+ }).and(zSpaceHomeSpec),
379
+ z.object({
380
+ type: z.literal('container')
381
+ }).and(zContainerHomeSpec),
382
+ z.object({
383
+ type: z.literal('edge')
384
+ }).and(zEdgeHomeSpec),
385
+ z.object({
386
+ type: z.literal('vertex')
387
+ }).and(zVertexHomeSpec),
388
+ z.object({
389
+ type: z.literal('slot')
390
+ }).and(zSlotHomeSpec)
391
+ ]);
392
+
393
+ /**
394
+ * Default authored visibility for a component instance
395
+ */
396
+ export const zComponentVisibilitySpec = z.object({
397
+ faceUp: z.optional(z.boolean()).default(true),
398
+ visibleTo: z.optional(z.array(z.string()))
399
+ });
400
+
401
+ export const zBoardCard = z.object({
402
+ type: z.string(),
403
+ name: z.string(),
404
+ imageUrl: z.optional(z.string()),
405
+ text: z.optional(z.string()),
406
+ count: z.int().gte(1).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
407
+ cardType: z.optional(z.string()),
408
+ home: z.optional(zComponentHomeSpec),
409
+ visibility: z.optional(zComponentVisibilitySpec),
410
+ properties: z.record(z.string(), zJsonValue)
411
+ });
412
+
413
+ export const zManualCardSetDefinition = z.object({
414
+ id: z.string().min(1),
415
+ name: z.string().min(1),
416
+ type: z.enum(['manual']),
417
+ cardSchema: zCardPropertySchema,
418
+ cards: z.array(zBoardCard).min(0)
419
+ });
420
+
421
+ export const zCardSetDefinition = z.union([
422
+ z.object({
423
+ type: z.literal('preset')
424
+ }).and(zPresetCardSetDefinition),
425
+ z.object({
426
+ type: z.literal('manual')
427
+ }).and(zManualCardSetDefinition)
428
+ ]);
429
+
430
+ /**
431
+ * Whether authored topology exists once for the table or once per player
432
+ */
433
+ export const zTopologyScope = z.enum(['shared', 'perPlayer']);
434
+
435
+ /**
436
+ * Default topology visibility for a zone or slot
437
+ */
438
+ export const zZoneVisibility = z.enum([
439
+ 'ownerOnly',
440
+ 'public',
441
+ 'hidden'
442
+ ]);
443
+
444
+ /**
445
+ * Generic authored container that can hold cards, pieces, or dice
446
+ */
447
+ export const zZoneSpec = z.object({
448
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
449
+ name: z.string(),
450
+ scope: zTopologyScope,
451
+ allowedCardSetIds: z.optional(z.array(z.string())),
452
+ visibility: z.optional(zZoneVisibility).default('public')
453
+ });
454
+
455
+ /**
456
+ * Stable authored board space or slot anchor
457
+ */
458
+ export const zBoardSpaceSpec = z.object({
459
+ id: z.string(),
460
+ name: z.optional(z.string()),
461
+ typeId: z.optional(z.string()),
462
+ fields: z.optional(z.record(z.string(), zJsonValue))
463
+ });
464
+
465
+ /**
466
+ * Named relation between two authored spaces
467
+ */
468
+ export const zBoardRelationSpec = z.object({
469
+ id: z.optional(z.string()),
470
+ typeId: z.string(),
471
+ fromSpaceId: z.string(),
472
+ toSpaceId: z.string(),
473
+ directed: z.optional(z.boolean()).default(false),
474
+ fields: z.optional(z.record(z.string(), zJsonValue))
475
+ });
476
+
477
+ export const zBoardHostSpec = z.object({
478
+ type: z.enum(['board'])
479
+ });
480
+
481
+ export const zSpaceHostSpec = z.object({
482
+ type: z.enum(['space']),
483
+ spaceId: z.string()
484
+ });
485
+
486
+ export const zBoardContainerHostSpec = z.union([
487
+ z.object({
488
+ type: z.literal('board')
489
+ }).and(zBoardHostSpec),
490
+ z.object({
491
+ type: z.literal('space')
492
+ }).and(zSpaceHostSpec)
493
+ ]);
494
+
495
+ /**
496
+ * Authored board-attached or space-attached container/slot
497
+ */
498
+ export const zBoardContainerSpec = z.object({
499
+ id: z.string(),
500
+ name: z.string(),
501
+ host: zBoardContainerHostSpec,
502
+ allowedCardSetIds: z.optional(z.array(z.string())),
503
+ fields: z.optional(z.record(z.string(), zJsonValue))
504
+ });
505
+
506
+ /**
507
+ * Reusable authored board topology template
508
+ */
509
+ export const zGenericBoardTemplateSpec = z.object({
510
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
511
+ name: z.string(),
512
+ layout: z.enum(['generic']),
513
+ typeId: z.optional(z.string()),
514
+ boardFieldsSchema: z.optional(zObjectSchema),
515
+ spaceFieldsSchema: z.optional(zObjectSchema),
516
+ relationFieldsSchema: z.optional(zObjectSchema),
517
+ containerFieldsSchema: z.optional(zObjectSchema),
518
+ spaces: z.optional(z.array(zBoardSpaceSpec)).default([]),
519
+ relations: z.optional(z.array(zBoardRelationSpec)).default([]),
520
+ containers: z.optional(z.array(zBoardContainerSpec)).default([])
521
+ });
522
+
523
+ /**
524
+ * Visual orientation for authored hex coordinates
525
+ */
526
+ export const zHexOrientation = z.enum(['pointy-top', 'flat-top']);
527
+
528
+ /**
529
+ * One authored hex space in axial coordinates
530
+ */
531
+ export const zHexSpaceSpec = z.object({
532
+ id: z.string(),
533
+ q: z.int().min(-2147483648, { error: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
534
+ r: z.int().min(-2147483648, { error: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
535
+ typeId: z.optional(z.string()),
536
+ label: z.optional(z.string()),
537
+ fields: z.optional(z.record(z.string(), zJsonValue))
538
+ });
539
+
540
+ /**
541
+ * Hex edge identified by two adjacent hex spaces
542
+ */
543
+ export const zHexEdgeRef = z.object({
544
+ spaces: z.tuple([z.string(), z.string()])
545
+ });
546
+
547
+ /**
548
+ * Authored metadata attached to one derived hex edge
549
+ */
550
+ export const zHexEdgeSpec = z.object({
551
+ ref: zHexEdgeRef,
552
+ typeId: z.optional(z.string()),
553
+ label: z.optional(z.string()),
554
+ tags: z.optional(z.array(z.string())),
555
+ fields: z.optional(z.record(z.string(), zJsonValue))
556
+ });
557
+
558
+ /**
559
+ * Hex vertex identified by three touching hex spaces
560
+ */
561
+ export const zHexVertexRef = z.object({
562
+ spaces: z.tuple([
563
+ z.string(),
564
+ z.string(),
565
+ z.string()
566
+ ])
567
+ });
568
+
569
+ /**
570
+ * Authored metadata attached to one derived hex vertex
571
+ */
572
+ export const zHexVertexSpec = z.object({
573
+ ref: zHexVertexRef,
574
+ typeId: z.optional(z.string()),
575
+ label: z.optional(z.string()),
576
+ tags: z.optional(z.array(z.string())),
577
+ fields: z.optional(z.record(z.string(), zJsonValue))
578
+ });
579
+
580
+ /**
581
+ * Reusable authored hex board topology template
582
+ */
583
+ export const zHexBoardTemplateSpec = z.object({
584
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
585
+ name: z.string(),
586
+ layout: z.enum(['hex']),
587
+ typeId: z.optional(z.string()),
588
+ orientation: z.optional(zHexOrientation).default('pointy-top'),
589
+ boardFieldsSchema: z.optional(zObjectSchema),
590
+ spaceFieldsSchema: z.optional(zObjectSchema),
591
+ edgeFieldsSchema: z.optional(zObjectSchema),
592
+ vertexFieldsSchema: z.optional(zObjectSchema),
593
+ spaces: z.optional(z.array(zHexSpaceSpec)).default([]),
594
+ edges: z.optional(z.array(zHexEdgeSpec)).default([]),
595
+ vertices: z.optional(z.array(zHexVertexSpec)).default([])
596
+ });
597
+
598
+ /**
599
+ * One authored square space in row/column coordinates
600
+ */
601
+ export const zSquareSpaceSpec = z.object({
602
+ id: z.string(),
603
+ row: z.int().min(-2147483648, { error: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
604
+ col: z.int().min(-2147483648, { error: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
605
+ typeId: z.optional(z.string()),
606
+ label: z.optional(z.string()),
607
+ fields: z.optional(z.record(z.string(), zJsonValue))
608
+ });
609
+
610
+ /**
611
+ * Authored metadata attached to one derived square edge
612
+ */
613
+ export const zSquareEdgeSpec = z.object({
614
+ ref: zBoardEdgeRef,
615
+ typeId: z.optional(z.string()),
616
+ label: z.optional(z.string()),
617
+ tags: z.optional(z.array(z.string())),
618
+ fields: z.optional(z.record(z.string(), zJsonValue))
619
+ });
620
+
621
+ /**
622
+ * Authored metadata attached to one derived square vertex
623
+ */
624
+ export const zSquareVertexSpec = z.object({
625
+ ref: zBoardVertexRef,
626
+ typeId: z.optional(z.string()),
627
+ label: z.optional(z.string()),
628
+ tags: z.optional(z.array(z.string())),
629
+ fields: z.optional(z.record(z.string(), zJsonValue))
630
+ });
631
+
632
+ /**
633
+ * Reusable authored square board topology template
634
+ */
635
+ export const zSquareBoardTemplateSpec = z.object({
636
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
637
+ name: z.string(),
638
+ layout: z.enum(['square']),
639
+ typeId: z.optional(z.string()),
640
+ boardFieldsSchema: z.optional(zObjectSchema),
641
+ spaceFieldsSchema: z.optional(zObjectSchema),
642
+ relationFieldsSchema: z.optional(zObjectSchema),
643
+ containerFieldsSchema: z.optional(zObjectSchema),
644
+ edgeFieldsSchema: z.optional(zObjectSchema),
645
+ vertexFieldsSchema: z.optional(zObjectSchema),
646
+ spaces: z.optional(z.array(zSquareSpaceSpec)).default([]),
647
+ relations: z.optional(z.array(zBoardRelationSpec)).default([]),
648
+ containers: z.optional(z.array(zBoardContainerSpec)).default([]),
649
+ edges: z.optional(z.array(zSquareEdgeSpec)).default([]),
650
+ vertices: z.optional(z.array(zSquareVertexSpec)).default([])
651
+ });
652
+
653
+ export const zBoardTemplateSpec = z.union([
654
+ z.object({
655
+ layout: z.literal('generic')
656
+ }).and(zGenericBoardTemplateSpec),
657
+ z.object({
658
+ layout: z.literal('hex')
659
+ }).and(zHexBoardTemplateSpec),
660
+ z.object({
661
+ layout: z.literal('square')
662
+ }).and(zSquareBoardTemplateSpec)
663
+ ]);
664
+
665
+ /**
666
+ * Shared or per-player authored board instance shell
667
+ */
668
+ export const zGenericBoardSpec = z.object({
669
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
670
+ name: z.string(),
671
+ layout: z.enum(['generic']),
672
+ typeId: z.optional(z.string()),
673
+ scope: zTopologyScope,
674
+ templateId: z.optional(z.string()),
675
+ boardFieldsSchema: z.optional(zObjectSchema),
676
+ spaceFieldsSchema: z.optional(zObjectSchema),
677
+ relationFieldsSchema: z.optional(zObjectSchema),
678
+ containerFieldsSchema: z.optional(zObjectSchema),
679
+ fields: z.optional(z.record(z.string(), zJsonValue)),
680
+ spaces: z.optional(z.array(zBoardSpaceSpec)).default([]),
681
+ relations: z.optional(z.array(zBoardRelationSpec)).default([]),
682
+ containers: z.optional(z.array(zBoardContainerSpec)).default([])
683
+ });
684
+
685
+ /**
686
+ * Shared or per-player authored hex board instance shell
687
+ */
688
+ export const zHexBoardSpec = z.object({
689
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
690
+ name: z.string(),
691
+ layout: z.enum(['hex']),
692
+ typeId: z.optional(z.string()),
693
+ scope: zTopologyScope,
694
+ templateId: z.optional(z.string()),
695
+ orientation: z.optional(zHexOrientation),
696
+ boardFieldsSchema: z.optional(zObjectSchema),
697
+ spaceFieldsSchema: z.optional(zObjectSchema),
698
+ edgeFieldsSchema: z.optional(zObjectSchema),
699
+ vertexFieldsSchema: z.optional(zObjectSchema),
700
+ fields: z.optional(z.record(z.string(), zJsonValue)),
701
+ spaces: z.optional(z.array(zHexSpaceSpec)).default([]),
702
+ edges: z.optional(z.array(zHexEdgeSpec)).default([]),
703
+ vertices: z.optional(z.array(zHexVertexSpec)).default([])
704
+ });
705
+
706
+ /**
707
+ * Shared or per-player authored square board instance shell
708
+ */
709
+ export const zSquareBoardSpec = z.object({
710
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
711
+ name: z.string(),
712
+ layout: z.enum(['square']),
713
+ typeId: z.optional(z.string()),
714
+ scope: zTopologyScope,
715
+ templateId: z.optional(z.string()),
716
+ boardFieldsSchema: z.optional(zObjectSchema),
717
+ spaceFieldsSchema: z.optional(zObjectSchema),
718
+ relationFieldsSchema: z.optional(zObjectSchema),
719
+ containerFieldsSchema: z.optional(zObjectSchema),
720
+ edgeFieldsSchema: z.optional(zObjectSchema),
721
+ vertexFieldsSchema: z.optional(zObjectSchema),
722
+ fields: z.optional(z.record(z.string(), zJsonValue)),
723
+ spaces: z.optional(z.array(zSquareSpaceSpec)).default([]),
724
+ relations: z.optional(z.array(zBoardRelationSpec)).default([]),
725
+ containers: z.optional(z.array(zBoardContainerSpec)).default([]),
726
+ edges: z.optional(z.array(zSquareEdgeSpec)).default([]),
727
+ vertices: z.optional(z.array(zSquareVertexSpec)).default([])
728
+ });
729
+
730
+ export const zBoardSpec = z.union([
731
+ z.object({
732
+ layout: z.literal('generic')
733
+ }).and(zGenericBoardSpec),
734
+ z.object({
735
+ layout: z.literal('hex')
736
+ }).and(zHexBoardSpec),
737
+ z.object({
738
+ layout: z.literal('square')
739
+ }).and(zSquareBoardSpec)
740
+ ]);
741
+
742
+ /**
743
+ * Named authored slot exposed by a piece or die type
744
+ */
745
+ export const zComponentSlotSpec = z.object({
746
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
747
+ name: z.optional(z.string())
748
+ });
749
+
750
+ /**
751
+ * Reusable authored piece type
752
+ */
753
+ export const zPieceTypeSpec = z.object({
754
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
755
+ name: z.string(),
756
+ fieldsSchema: z.optional(zObjectSchema),
757
+ slots: z.optional(z.array(zComponentSlotSpec))
758
+ });
759
+
760
+ /**
761
+ * Authored seeded piece inventory or supply definition
762
+ */
763
+ export const zPieceSeedSpec = z.object({
764
+ id: z.optional(z.string()),
765
+ name: z.optional(z.string()),
766
+ typeId: z.string(),
767
+ count: z.optional(z.int().gte(1).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' })).default(1),
768
+ ownerId: z.optional(z.string()),
769
+ home: z.optional(zComponentHomeSpec),
770
+ visibility: z.optional(zComponentVisibilitySpec),
771
+ fields: z.optional(z.record(z.string(), zJsonValue))
772
+ });
773
+
774
+ /**
775
+ * Reusable authored die type
776
+ */
777
+ export const zDieTypeSpec = z.object({
778
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
779
+ name: z.string(),
780
+ sides: z.optional(z.int().gte(2).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' })).default(6),
781
+ fieldsSchema: z.optional(zObjectSchema),
782
+ slots: z.optional(z.array(zComponentSlotSpec))
783
+ });
784
+
785
+ /**
786
+ * Authored seeded die inventory or supply definition
787
+ */
788
+ export const zDieSeedSpec = z.object({
789
+ id: z.optional(z.string()),
790
+ name: z.optional(z.string()),
791
+ typeId: z.string(),
792
+ count: z.optional(z.int().gte(1).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' })).default(1),
793
+ ownerId: z.optional(z.string()),
794
+ home: z.optional(zComponentHomeSpec),
795
+ visibility: z.optional(zComponentVisibilitySpec),
796
+ fields: z.optional(z.record(z.string(), zJsonValue))
797
+ });
798
+
799
+ /**
800
+ * Definition of a game resource type
801
+ */
802
+ export const zResourceDefinition = z.object({
803
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
804
+ name: z.string(),
805
+ icon: z.optional(z.string())
806
+ });
807
+
808
+ /**
809
+ * One authored setup option choice
810
+ */
811
+ export const zSetupOptionChoiceSpec = z.object({
812
+ id: z.string(),
813
+ label: z.string(),
814
+ description: z.optional(z.string())
815
+ });
816
+
817
+ /**
818
+ * Authored setup module/variant axis metadata
819
+ */
820
+ export const zSetupOptionSpec = z.object({
821
+ id: z.string(),
822
+ name: z.string(),
823
+ description: z.optional(z.string()),
824
+ choices: z.optional(z.array(zSetupOptionChoiceSpec)).default([])
825
+ });
826
+
827
+ /**
828
+ * Reducer-consumed authored setup profile, recipe, or loadout metadata
829
+ */
830
+ export const zSetupProfileSpec = z.object({
831
+ id: z.string(),
832
+ name: z.string(),
833
+ description: z.optional(z.string()),
834
+ optionValues: z.optional(z.record(z.string(), z.string()))
835
+ });
836
+
837
+ /**
838
+ * Authoritative topology manifest for reducer-native games
839
+ */
840
+ export const zGameTopologyManifest = z.object({
841
+ players: zPlayersDefinition,
842
+ cardSets: z.array(zCardSetDefinition),
843
+ zones: z.optional(z.array(zZoneSpec)).default([]),
844
+ boardTemplates: z.optional(z.array(zBoardTemplateSpec)).default([]),
845
+ boards: z.optional(z.array(zBoardSpec)).default([]),
846
+ pieceTypes: z.optional(z.array(zPieceTypeSpec)).default([]),
847
+ pieceSeeds: z.optional(z.array(zPieceSeedSpec)).default([]),
848
+ dieTypes: z.optional(z.array(zDieTypeSpec)).default([]),
849
+ dieSeeds: z.optional(z.array(zDieSeedSpec)).default([]),
850
+ resources: z.optional(z.array(zResourceDefinition)).default([]),
851
+ setupOptions: z.optional(z.array(zSetupOptionSpec)).default([]),
852
+ setupProfiles: z.optional(z.array(zSetupProfileSpec)).default([])
853
+ });
854
+
855
+ export const zUpdateGameRequest = z.object({
856
+ name: z.optional(z.string().min(1).max(255)),
857
+ description: z.optional(z.string()),
858
+ rule: z.optional(z.string()),
859
+ public: z.optional(z.boolean()),
860
+ manifest: z.optional(zGameTopologyManifest),
861
+ metadata: z.optional(zGameMetadata)
862
+ });
863
+
864
+ export const zDeleteGameResponse = z.object({
865
+ deleted: z.boolean()
866
+ });
867
+
868
+ export const zWorkshopRuleTextResponse = z.object({
869
+ ruleText: z.string()
870
+ });
871
+
872
+ export const zGameManifestSummaryDto = z.object({
873
+ manifestId: z.uuid(),
874
+ gameId: z.uuid(),
875
+ userId: z.uuid(),
876
+ jobId: z.optional(z.uuid()),
877
+ ruleId: z.uuid(),
878
+ version: z.int(),
879
+ current: z.boolean(),
880
+ createdAt: z.iso.datetime()
881
+ });
882
+
883
+ export const zFindManifestsResponse = z.object({
884
+ manifests: z.array(zGameManifestSummaryDto),
885
+ currentManifestId: z.optional(z.uuid())
886
+ });
887
+
888
+ export const zSaveManifestRequest = z.object({
889
+ manifest: zGameTopologyManifest,
890
+ jobId: z.optional(z.uuid()),
891
+ ruleId: z.uuid()
892
+ });
893
+
894
+ export const zSaveManifestResponse = z.object({
895
+ manifestId: z.uuid(),
896
+ version: z.int(),
897
+ gameId: z.uuid(),
898
+ contentHash: z.string()
899
+ });
900
+
901
+ export const zGameManifestDto = z.object({
902
+ manifestId: z.uuid(),
903
+ gameId: z.uuid(),
904
+ userId: z.uuid(),
905
+ jobId: z.optional(z.uuid()),
906
+ ruleId: z.uuid(),
907
+ manifest: zGameTopologyManifest,
908
+ version: z.int(),
909
+ createdAt: z.iso.datetime(),
910
+ contentHash: z.string()
911
+ });
912
+
913
+ /**
914
+ * Diagnostic severity level
915
+ */
916
+ export const zCompilationDiagnosticSeverity = z.enum(['error', 'warning']);
917
+
918
+ /**
919
+ * Diagnostic tied to a specific project file and source location
920
+ */
921
+ export const zFileCompilationDiagnostic = z.object({
922
+ type: z.enum(['file']),
923
+ file: z.string(),
924
+ line: z.int().gte(1),
925
+ column: z.int().gte(1),
926
+ message: z.string(),
927
+ severity: zCompilationDiagnosticSeverity,
928
+ code: z.optional(z.string())
929
+ });
930
+
931
+ /**
932
+ * Category of a project-level compilation diagnostic
933
+ */
934
+ export const zProjectCompilationDiagnosticCategory = z.enum([
935
+ 'configuration',
936
+ 'module_resolution',
937
+ 'project',
938
+ 'system',
939
+ 'source_validation'
940
+ ]);
941
+
942
+ /**
943
+ * Additional structured context for a project-level diagnostic
944
+ */
945
+ export const zProjectCompilationDiagnosticContext = z.object({
946
+ file: z.optional(z.string()),
947
+ details: z.optional(z.string()),
948
+ moduleName: z.optional(z.string()),
949
+ affectedPaths: z.optional(z.array(z.string())),
950
+ expectedSdkVersion: z.optional(z.string()),
951
+ actualSdkVersion: z.optional(z.string())
952
+ });
953
+
954
+ /**
955
+ * Diagnostic that applies to the project as a whole rather than a specific source location
956
+ */
957
+ export const zProjectCompilationDiagnostic = z.object({
958
+ type: z.enum(['project']),
959
+ category: zProjectCompilationDiagnosticCategory,
960
+ message: z.string(),
961
+ severity: zCompilationDiagnosticSeverity,
962
+ code: z.optional(z.string()),
963
+ context: z.optional(zProjectCompilationDiagnosticContext)
964
+ });
965
+
966
+ export const zCompilationDiagnostic = z.union([
967
+ z.object({
968
+ type: z.literal('file')
969
+ }).and(zFileCompilationDiagnostic),
970
+ z.object({
971
+ type: z.literal('project')
972
+ }).and(zProjectCompilationDiagnostic)
973
+ ]);
974
+
975
+ /**
976
+ * Storage backend type for compiled game artifacts
977
+ */
978
+ export const zCompiledResultStorageType = z.enum(['local', 'supabase']);
979
+
980
+ /**
981
+ * Unified compiled result containing both APP and UI outputs from a single source
982
+ */
983
+ export const zCompiledResult = z.object({
984
+ id: z.uuid(),
985
+ gameId: z.uuid(),
986
+ userId: z.uuid(),
987
+ authoringStateId: z.uuid(),
988
+ manifestId: z.uuid(),
989
+ ruleId: z.uuid(),
990
+ compilationRequestId: z.optional(z.string()),
991
+ parentResultId: z.optional(z.uuid()),
992
+ lineageRootId: z.optional(z.uuid()),
993
+ success: z.boolean().default(true),
994
+ diagnostics: z.optional(z.array(zCompilationDiagnostic)),
995
+ appStorageType: zCompiledResultStorageType,
996
+ appStorageKey: z.optional(z.string()),
997
+ uiStorageType: zCompiledResultStorageType,
998
+ uiStorageKey: z.optional(z.string()),
999
+ appFingerprint: z.optional(z.string()),
1000
+ uiFingerprint: z.optional(z.string()),
1001
+ sourceRevisionId: z.uuid(),
1002
+ sdkVersion: z.optional(z.string()),
1003
+ createdAt: z.iso.datetime(),
1004
+ lastModifiedAt: z.iso.datetime()
1005
+ });
1006
+
1007
+ /**
1008
+ * Response containing a list of compiled results for a game
1009
+ */
1010
+ export const zListCompiledResultsResponse = z.object({
1011
+ results: z.array(zCompiledResult)
1012
+ });
1013
+
1014
+ export const zQueueCompiledResultJobRequest = z.object({
1015
+ authoringStateId: z.uuid()
1016
+ });
1017
+
1018
+ /**
1019
+ * Accepted compile request response. The compilation continues asynchronously and can be tracked via the returned job ID.
1020
+ */
1021
+ export const zQueueCompiledResultJobResponse = z.object({
1022
+ jobId: z.uuid()
1023
+ });
1024
+
1025
+ /**
1026
+ * How the submitted change set should be applied against the base source revision.
1027
+ */
1028
+ export const zSourceChangeMode = z.enum(['incremental', 'replace']);
1029
+
1030
+ /**
1031
+ * Upsert a file in the authored source tree.
1032
+ */
1033
+ export const zSourceFileUpsert = z.object({
1034
+ kind: z.enum(['upsert']),
1035
+ path: z.string(),
1036
+ contentHash: z.string(),
1037
+ byteSize: z.int().gte(0).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' })
1038
+ });
1039
+
1040
+ /**
1041
+ * Delete a file from the authored source tree.
1042
+ */
1043
+ export const zSourcePathDelete = z.object({
1044
+ kind: z.enum(['delete']),
1045
+ path: z.string()
1046
+ });
1047
+
1048
+ export const zSourceChangeOperation = z.union([
1049
+ z.object({
1050
+ kind: z.literal('upsert')
1051
+ }).and(zSourceFileUpsert),
1052
+ z.object({
1053
+ kind: z.literal('delete')
1054
+ }).and(zSourcePathDelete)
1055
+ ]);
1056
+
1057
+ /**
1058
+ * Request to create a new authored source revision from a change set.
1059
+ */
1060
+ export const zCreateSourceRevisionRequest = z.object({
1061
+ baseSourceRevisionId: z.optional(z.uuid()),
1062
+ mode: zSourceChangeMode,
1063
+ changes: z.array(zSourceChangeOperation)
1064
+ });
1065
+
1066
+ /**
1067
+ * Request to reuse or create a private dev compilation for an exact local workspace fingerprint.
1068
+ */
1069
+ export const zEnsureDevCompileRequest = z.object({
1070
+ devFingerprint: z.string(),
1071
+ env: z.string(),
1072
+ sourceRevision: zCreateSourceRevisionRequest,
1073
+ ruleText: z.string(),
1074
+ manifest: zGameTopologyManifest
1075
+ });
1076
+
1077
+ /**
1078
+ * Response for a fingerprint-backed dev compile ensure request.
1079
+ */
1080
+ export const zEnsureDevCompileResponse = z.object({
1081
+ reused: z.boolean(),
1082
+ compiledResult: z.optional(zCompiledResult),
1083
+ jobId: z.optional(z.uuid()),
1084
+ authoringStateId: z.optional(z.uuid())
1085
+ });
1086
+
1087
+ /**
1088
+ * Response containing authored source files resolved through an authoring state.
1089
+ */
1090
+ export const zGameSourcesResponse = z.object({
1091
+ authoringStateId: z.uuid(),
1092
+ files: z.record(z.string(), z.string()),
1093
+ sourceRevisionId: z.uuid(),
1094
+ treeHash: z.string(),
1095
+ manifestId: z.optional(z.uuid()),
1096
+ manifestContentHash: z.optional(z.string()),
1097
+ manifest: z.optional(zGameTopologyManifest),
1098
+ ruleId: z.optional(z.uuid()),
1099
+ ruleText: z.optional(z.string())
1100
+ });
1101
+
1102
+ /**
1103
+ * Immutable authored source revision for a game.
1104
+ */
1105
+ export const zSourceRevision = z.object({
1106
+ id: z.uuid(),
1107
+ gameId: z.uuid(),
1108
+ userId: z.uuid(),
1109
+ parentSourceRevisionId: z.optional(z.uuid()),
1110
+ treeHash: z.string(),
1111
+ fileCount: z.int().min(-2147483648, { error: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
1112
+ createdAt: z.iso.datetime()
1113
+ });
1114
+
1115
+ /**
1116
+ * Metadata describing a blob the client may need to upload before finalizing a source revision.
1117
+ */
1118
+ export const zSourceBlobUploadDescriptor = z.object({
1119
+ contentHash: z.string(),
1120
+ byteSize: z.int().gte(0).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' })
1121
+ });
1122
+
1123
+ /**
1124
+ * Request upload targets for one or more source blobs.
1125
+ */
1126
+ export const zCreateSourceBlobUploadSessionRequest = z.object({
1127
+ blobs: z.array(zSourceBlobUploadDescriptor)
1128
+ });
1129
+
1130
+ /**
1131
+ * Provider-agnostic direct-upload target for a source blob.
1132
+ */
1133
+ export const zSourceBlobUploadTarget = z.object({
1134
+ method: z.string(),
1135
+ url: z.url(),
1136
+ headers: z.record(z.string(), z.string())
1137
+ });
1138
+
1139
+ /**
1140
+ * Upload instructions for a single source blob.
1141
+ */
1142
+ export const zSourceBlobUploadSessionEntry = z.object({
1143
+ contentHash: z.string(),
1144
+ status: z.enum(['exists', 'upload_required']),
1145
+ uploadTarget: z.optional(zSourceBlobUploadTarget)
1146
+ });
1147
+
1148
+ /**
1149
+ * Direct-upload session for source blobs needed by a source revision.
1150
+ */
1151
+ export const zSourceBlobUploadSession = z.object({
1152
+ sessionId: z.string(),
1153
+ expiresAt: z.iso.datetime(),
1154
+ uploads: z.array(zSourceBlobUploadSessionEntry)
1155
+ });
1156
+
1157
+ /**
1158
+ * Immutable authored workspace checkpoint tying together rule, manifest, and source revision.
1159
+ */
1160
+ export const zAuthoringState = z.object({
1161
+ authoringStateId: z.uuid(),
1162
+ gameId: z.uuid(),
1163
+ userId: z.uuid(),
1164
+ parentAuthoringStateId: z.optional(z.uuid()),
1165
+ sourceRevisionId: z.uuid(),
1166
+ sourceTreeHash: z.string(),
1167
+ manifestId: z.uuid(),
1168
+ manifestContentHash: z.string(),
1169
+ ruleId: z.uuid(),
1170
+ createdAt: z.iso.datetime()
1171
+ });
1172
+
1173
+ /**
1174
+ * Advance the current authoring head to a new immutable state.
1175
+ */
1176
+ export const zCreateAuthoringStateRequest = z.object({
1177
+ baseAuthoringStateId: z.optional(z.uuid()),
1178
+ sourceRevisionId: z.uuid(),
1179
+ sourceTreeHash: z.string(),
1180
+ manifestId: z.uuid(),
1181
+ manifestContentHash: z.string(),
1182
+ ruleId: z.uuid()
1183
+ });
1184
+
1185
+ export const zGameScriptsResponse = z.object({
1186
+ appScripts: z.array(zCompiledResult),
1187
+ uiScripts: z.array(zCompiledResult)
1188
+ });
1189
+
1190
+ /**
1191
+ * Type of async backend job
1192
+ */
1193
+ export const zJobKind = z.enum(['GAME_BUILD', 'COMPILE']);
1194
+
1195
+ /**
1196
+ * Status of an async backend job
1197
+ */
1198
+ export const zJobStatus = z.enum([
1199
+ 'PENDING',
1200
+ 'RUNNING',
1201
+ 'COMPLETED',
1202
+ 'FAILED',
1203
+ 'CANCELLED',
1204
+ 'INTERRUPTED'
1205
+ ]);
1206
+
1207
+ /**
1208
+ * Summary information about an async backend job
1209
+ */
1210
+ export const zJobSummary = z.object({
1211
+ jobId: z.uuid(),
1212
+ gameId: z.uuid(),
1213
+ kind: zJobKind,
1214
+ status: zJobStatus,
1215
+ title: z.string(),
1216
+ createdAt: z.iso.datetime(),
1217
+ startedAt: z.optional(z.iso.datetime())
1218
+ });
1219
+
1220
+ /**
1221
+ * Response containing the active job for a game, if any
1222
+ */
1223
+ export const zActiveJobResponse = z.object({
1224
+ activeJob: z.optional(zJobSummary),
1225
+ hasActiveJob: z.boolean()
1226
+ });
1227
+
1228
+ /**
1229
+ * Cache result for a specific compile target.
1230
+ */
1231
+ export const zCompileJobCacheStatus = z.enum(['hit', 'miss']);
1232
+
1233
+ /**
1234
+ * Cache reuse summary for an async compile job.
1235
+ */
1236
+ export const zCompileJobCacheSummary = z.object({
1237
+ app: z.optional(zCompileJobCacheStatus),
1238
+ ui: z.optional(zCompileJobCacheStatus)
1239
+ });
1240
+
1241
+ /**
1242
+ * Arbitrary numeric metrics recorded for a job. Keys are implementation-defined.
1243
+ */
1244
+ export const zJobNumericMetrics = z.record(z.string(), z.coerce.bigint().min(BigInt('-9223372036854775808'), { error: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }));
1245
+
1246
+ /**
1247
+ * Status of a user-facing job task
1248
+ */
1249
+ export const zJobTaskStatus = z.enum([
1250
+ 'PENDING',
1251
+ 'RUNNING',
1252
+ 'COMPLETED',
1253
+ 'FAILED'
1254
+ ]);
1255
+
1256
+ /**
1257
+ * User-facing task progress for an async job
1258
+ */
1259
+ export const zJobTaskSummary = z.object({
1260
+ taskKey: z.string(),
1261
+ title: z.string(),
1262
+ status: zJobTaskStatus,
1263
+ latestStatus: z.optional(z.string()),
1264
+ orderIndex: z.int().min(-2147483648, { error: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' }),
1265
+ startedAt: z.optional(z.iso.datetime()),
1266
+ completedAt: z.optional(z.iso.datetime())
1267
+ });
1268
+
1269
+ /**
1270
+ * Detailed information for an async backend job
1271
+ */
1272
+ export const zJobDetailResponse = z.object({
1273
+ jobId: z.uuid(),
1274
+ gameId: z.uuid(),
1275
+ kind: zJobKind,
1276
+ status: zJobStatus,
1277
+ title: z.string(),
1278
+ errorMessage: z.optional(z.string()),
1279
+ createdAt: z.iso.datetime(),
1280
+ startedAt: z.optional(z.iso.datetime()),
1281
+ completedAt: z.optional(z.iso.datetime()),
1282
+ phase: z.optional(z.string()),
1283
+ queuePosition: z.optional(z.int().min(-2147483648, { error: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { error: 'Invalid value: Expected int32 to be <= 2147483647' })),
1284
+ cache: z.optional(zCompileJobCacheSummary),
1285
+ message: z.optional(z.string()),
1286
+ timings: z.optional(zJobNumericMetrics),
1287
+ memory: z.optional(zJobNumericMetrics),
1288
+ tasks: z.array(zJobTaskSummary),
1289
+ createdRuleId: z.optional(z.uuid()),
1290
+ createdManifestId: z.optional(z.uuid()),
1291
+ createdAppScriptId: z.optional(z.uuid()),
1292
+ createdCompiledResultId: z.optional(z.uuid())
1293
+ });
1294
+
1295
+ /**
1296
+ * Request to create a Cursor Cloud game build run.
1297
+ */
1298
+ export const zCreateGameRunRequest = z.object({
1299
+ gameSpec: zGameSpecForm,
1300
+ ruleText: z.optional(z.string().max(50000)),
1301
+ parentJobId: z.optional(z.uuid())
1302
+ });
1303
+
1304
+ /**
1305
+ * Response for an accepted game build run.
1306
+ */
1307
+ export const zCreateGameRunResponse = z.object({
1308
+ jobId: z.uuid(),
1309
+ gameId: z.uuid()
1310
+ });
1311
+
1312
+ export const zGameRuleSummaryDto = z.object({
1313
+ ruleId: z.uuid(),
1314
+ gameId: z.uuid(),
1315
+ userId: z.uuid(),
1316
+ version: z.int(),
1317
+ createdAt: z.iso.datetime(),
1318
+ preview: z.optional(z.string())
1319
+ });
1320
+
1321
+ export const zListGameRulesResponse = z.object({
1322
+ rules: z.array(zGameRuleSummaryDto)
1323
+ });
1324
+
1325
+ export const zCreateGameRuleRequest = z.object({
1326
+ ruleText: z.string().min(1)
1327
+ });
1328
+
1329
+ export const zCreateGameRuleResponse = z.object({
1330
+ ruleId: z.uuid(),
1331
+ version: z.int(),
1332
+ gameId: z.uuid()
1333
+ });
1334
+
1335
+ export const zGameRule = z.object({
1336
+ ruleId: z.uuid(),
1337
+ gameId: z.uuid(),
1338
+ userId: z.uuid(),
1339
+ ruleText: z.string(),
1340
+ version: z.int(),
1341
+ createdAt: z.iso.datetime()
1342
+ });
1343
+
1344
+ export const zCreateSessionRequest = z.object({
1345
+ compiledResultId: z.optional(z.uuid()),
1346
+ seed: z.optional(z.coerce.bigint().min(BigInt('-9223372036854775808'), { error: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' })),
1347
+ playerCount: z.optional(z.int()),
1348
+ autoAssignSeats: z.optional(z.boolean()),
1349
+ setupProfileId: z.optional(z.string())
1350
+ });
1351
+
1352
+ /**
1353
+ * Authenticated Supabase user acting in a session.
1354
+ */
1355
+ export const zSessionActorAuthUser = z.object({
1356
+ kind: z.enum(['AUTH_USER']),
1357
+ id: z.uuid()
1358
+ });
1359
+
1360
+ /**
1361
+ * Anonymous demo principal for one demo_sessions row (shared across tabs).
1362
+ */
1363
+ export const zSessionActorDemoGuest = z.object({
1364
+ kind: z.enum(['DEMO_GUEST']),
1365
+ demoActorSessionId: z.uuid()
1366
+ });
1367
+
1368
+ export const zSessionActor = z.union([
1369
+ z.object({
1370
+ kind: z.literal('AUTH_USER')
1371
+ }).and(zSessionActorAuthUser),
1372
+ z.object({
1373
+ kind: z.literal('DEMO_GUEST')
1374
+ }).and(zSessionActorDemoGuest)
1375
+ ]);
1376
+
1377
+ export const zSessionGameSourceUserCompiled = z.object({
1378
+ kind: z.enum(['USER_COMPILED']),
1379
+ ownerUserId: z.uuid(),
1380
+ gameId: z.uuid(),
1381
+ compiledResultId: z.uuid()
1382
+ });
1383
+
1384
+ export const zSessionGameSourceDemoRevision = z.object({
1385
+ kind: z.enum(['DEMO_REVISION']),
1386
+ slug: z.string(),
1387
+ revisionId: z.uuid()
1388
+ });
1389
+
1390
+ export const zSessionGameSource = z.union([
1391
+ z.object({
1392
+ kind: z.literal('USER_COMPILED')
1393
+ }).and(zSessionGameSourceUserCompiled),
1394
+ z.object({
1395
+ kind: z.literal('DEMO_REVISION')
1396
+ }).and(zSessionGameSourceDemoRevision)
1397
+ ]);
1398
+
1399
+ export const zCreateSessionResponse = z.object({
1400
+ sessionId: z.uuid(),
1401
+ shortCode: z.string(),
1402
+ hostActor: zSessionActor,
1403
+ gameSource: zSessionGameSource
1404
+ });
1405
+
1406
+ /**
1407
+ * Request to create a gameplay session by restoring a reducer-native snapshot produced by the CLI scenario harness.
1408
+ */
1409
+ export const zCreateSessionFromReducerSnapshotRequest = z.object({
1410
+ compiledResultId: z.uuid(),
1411
+ seed: z.coerce.bigint().min(BigInt('-9223372036854775808'), { error: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }),
1412
+ playerCount: z.int(),
1413
+ setupProfileId: z.optional(z.string()),
1414
+ baseId: z.string(),
1415
+ scenarioId: z.string(),
1416
+ reducerState: z.record(z.string(), z.unknown()),
1417
+ reducerStateVersion: z.int(),
1418
+ fingerprintMetadata: z.optional(z.record(z.string(), z.string()))
1419
+ });
1420
+
1421
+ export const zSessionSnapshotPhase = z.enum([
1422
+ 'lobby',
1423
+ 'gameplay',
1424
+ 'ended'
1425
+ ]);
1426
+
1427
+ export const zHostSessionStatus = z.enum(['active', 'ended']);
1428
+
1429
+ /**
1430
+ * Summary of a game state history entry.
1431
+ */
1432
+ export const zHistoryEntrySummary = z.object({
1433
+ id: z.string(),
1434
+ version: z.int(),
1435
+ timestamp: z.iso.datetime(),
1436
+ description: z.string(),
1437
+ playerId: z.optional(z.string()),
1438
+ actionType: z.optional(z.string()),
1439
+ isCurrent: z.boolean()
1440
+ });
1441
+
1442
+ export const zSessionSnapshotHistory = z.object({
1443
+ entries: z.array(zHistoryEntrySummary),
1444
+ currentIndex: z.int(),
1445
+ canGoBack: z.boolean(),
1446
+ canGoForward: z.boolean()
1447
+ });
1448
+
1449
+ export const zHostSessionContext = z.object({
1450
+ sessionId: z.uuid(),
1451
+ shortCode: z.string(),
1452
+ phase: zSessionSnapshotPhase,
1453
+ status: zHostSessionStatus,
1454
+ hostActor: zSessionActor,
1455
+ gameSource: zSessionGameSource,
1456
+ setupProfileId: z.optional(z.string()),
1457
+ switchablePlayerIds: z.array(z.string()),
1458
+ history: z.optional(zSessionSnapshotHistory)
1459
+ });
1460
+
1461
+ export const zSeatAssignment = z.object({
1462
+ playerId: z.string(),
1463
+ controllerActor: z.optional(zSessionActor),
1464
+ displayName: z.string(),
1465
+ playerColor: z.optional(z.string()),
1466
+ isHost: z.optional(z.boolean()).default(false)
1467
+ });
1468
+
1469
+ export const zHostLobbyView = z.object({
1470
+ seats: z.array(zSeatAssignment),
1471
+ canStart: z.boolean(),
1472
+ hostActor: zSessionActor,
1473
+ setupProfileId: z.optional(z.string())
1474
+ });
1475
+
1476
+ export const zHostLobbySessionSnapshot = z.object({
1477
+ type: z.enum(['lobby']),
1478
+ context: zHostSessionContext,
1479
+ lobby: zHostLobbyView
1480
+ });
1481
+
1482
+ export const zSimultaneousPhaseSnapshot = z.object({
1483
+ phaseName: z.string(),
1484
+ interactionId: z.string(),
1485
+ actorIds: z.array(z.string()),
1486
+ sealedPlayerIds: z.array(z.string()),
1487
+ pendingPlayerIds: z.array(z.string())
1488
+ });
1489
+
1490
+ /**
1491
+ * Draft commit policy consumed by default UI surfaces.
1492
+ */
1493
+ export const zInteractionCommitPolicy = z.object({
1494
+ mode: z.enum(['manual', 'autoWhenReady'])
1495
+ });
1496
+
1497
+ export const zResourceMapDomainEntry = z.object({
1498
+ resourceId: z.string(),
1499
+ label: z.optional(z.string()),
1500
+ icon: z.optional(z.string()),
1501
+ min: z.int(),
1502
+ max: z.int()
1503
+ });
1504
+
1505
+ export const zChoiceDomainOption = z.object({
1506
+ value: z.string(),
1507
+ label: z.string(),
1508
+ icon: z.optional(z.string()),
1509
+ badge: z.optional(z.string()),
1510
+ description: z.optional(z.string()),
1511
+ disabled: z.optional(z.boolean()),
1512
+ disabledReason: z.optional(z.string())
1513
+ });
1514
+
1515
+ /**
1516
+ * Selection cardinality for an input domain.
1517
+ */
1518
+ export const zInputSelection = z.object({
1519
+ mode: z.enum(['single', 'many']),
1520
+ min: z.optional(z.int()),
1521
+ max: z.optional(z.int()),
1522
+ distinct: z.optional(z.boolean())
1523
+ });
1524
+
1525
+ export const zInputDomain = z.object({
1526
+ type: z.enum([
1527
+ 'target',
1528
+ 'resourceMap',
1529
+ 'boundedNumber',
1530
+ 'choice',
1531
+ 'choiceList'
1532
+ ]),
1533
+ targetKind: z.optional(z.string()),
1534
+ boardId: z.optional(z.string()),
1535
+ zoneId: z.optional(z.string()),
1536
+ zoneIds: z.optional(z.array(z.string())),
1537
+ eligibleTargets: z.optional(z.array(z.string())),
1538
+ resources: z.optional(z.array(zResourceMapDomainEntry)),
1539
+ min: z.optional(z.number()),
1540
+ max: z.optional(z.number()),
1541
+ step: z.optional(z.number()),
1542
+ choices: z.optional(z.array(zChoiceDomainOption)),
1543
+ selection: z.optional(zInputSelection)
1544
+ });
1545
+
1546
+ /**
1547
+ * Canonical descriptor for one interaction input collector.
1548
+ */
1549
+ export const zInteractionInputDescriptor = z.object({
1550
+ key: z.string(),
1551
+ kind: z.string(),
1552
+ domain: zInputDomain,
1553
+ defaultValue: z.optional(zJsonValue)
1554
+ });
1555
+
1556
+ export const zInteractionContextOption = z.object({
1557
+ id: z.string(),
1558
+ label: z.string()
1559
+ });
1560
+
1561
+ export const zInteractionContext = z.object({
1562
+ to: z.string(),
1563
+ title: z.optional(z.string()),
1564
+ payload: z.optional(z.record(z.string(), zJsonValue)),
1565
+ options: z.optional(z.array(zInteractionContextOption))
1566
+ });
1567
+
1568
+ /**
1569
+ * Authoritative interaction descriptor resolved by the trusted bundle.
1570
+ */
1571
+ export const zInteractionDescriptor = z.object({
1572
+ phaseName: z.string(),
1573
+ interactionKey: z.string(),
1574
+ interactionId: z.string(),
1575
+ kind: z.enum(['action', 'prompt']),
1576
+ zoneId: z.optional(z.string()),
1577
+ commit: zInteractionCommitPolicy,
1578
+ inputs: z.array(zInteractionInputDescriptor),
1579
+ cost: z.optional(z.record(z.string(), zJsonValue)),
1580
+ currentResources: z.optional(z.record(z.string(), zJsonValue)),
1581
+ missingResources: z.optional(z.record(z.string(), z.int())),
1582
+ available: z.boolean(),
1583
+ unavailableReason: z.optional(z.string()),
1584
+ context: z.optional(zInteractionContext)
1585
+ });
1586
+
1587
+ export const zZoneHandles = z.object({
1588
+ cardIds: z.array(z.string()),
1589
+ cardsById: z.record(z.string(), z.string()),
1590
+ playableByCardId: z.record(z.string(), z.array(zInteractionDescriptor))
1591
+ });
1592
+
1593
+ export const zHostPlayerGameplayView = z.object({
1594
+ version: z.int(),
1595
+ actionSetVersion: z.string(),
1596
+ playerId: z.string(),
1597
+ activePlayers: z.array(z.string()),
1598
+ currentPhase: z.string(),
1599
+ currentStage: z.string(),
1600
+ stageSeats: z.array(z.string()),
1601
+ simultaneousPhase: z.optional(zSimultaneousPhaseSnapshot),
1602
+ view: z.string(),
1603
+ availableInteractions: z.array(zInteractionDescriptor),
1604
+ zones: z.record(z.string(), zZoneHandles),
1605
+ boardStatic: z.optional(z.string()),
1606
+ boardStaticHash: z.optional(z.string())
1607
+ });
1608
+
1609
+ export const zHostGameplaySessionSnapshot = z.object({
1610
+ type: z.enum(['gameplay']),
1611
+ context: zHostSessionContext,
1612
+ lobby: zHostLobbyView,
1613
+ gameplay: zHostPlayerGameplayView
1614
+ });
1615
+
1616
+ export const zHostEndedSessionSnapshot = z.object({
1617
+ type: z.enum(['ended']),
1618
+ context: zHostSessionContext,
1619
+ lobby: zHostLobbyView
1620
+ });
1621
+
1622
+ export const zHostSessionSnapshot = z.union([
1623
+ z.object({
1624
+ type: z.literal('lobby')
1625
+ }).and(zHostLobbySessionSnapshot),
1626
+ z.object({
1627
+ type: z.literal('gameplay')
1628
+ }).and(zHostGameplaySessionSnapshot),
1629
+ z.object({
1630
+ type: z.literal('ended')
1631
+ }).and(zHostEndedSessionSnapshot)
1632
+ ]);
1633
+
1634
+ export const zHostSessionSnapshotReason = z.enum([
1635
+ 'load',
1636
+ 'start',
1637
+ 'switch-player',
1638
+ 'resync'
1639
+ ]);
1640
+
1641
+ export const zHostSessionSnapshotEvent = z.object({
1642
+ type: z.enum(['session.snapshot']),
1643
+ reason: zHostSessionSnapshotReason,
1644
+ snapshot: zHostSessionSnapshot
1645
+ });
1646
+
1647
+ export const zHostSessionLobbyUpdatedEvent = z.object({
1648
+ type: z.enum(['session.lobbyUpdated']),
1649
+ context: zHostSessionContext,
1650
+ lobby: zHostLobbyView
1651
+ });
1652
+
1653
+ export const zHostSessionEventCausation = z.object({
1654
+ clientActionId: z.optional(z.string())
1655
+ });
1656
+
1657
+ export const zHostSessionGameplayUpdatedEvent = z.object({
1658
+ type: z.enum(['session.gameplayUpdated']),
1659
+ context: zHostSessionContext,
1660
+ gameplay: zHostPlayerGameplayView,
1661
+ causation: z.optional(zHostSessionEventCausation)
1662
+ });
1663
+
1664
+ export const zHostSessionHistoryUpdatedEvent = z.object({
1665
+ type: z.enum(['session.historyUpdated']),
1666
+ context: zHostSessionContext
1667
+ });
1668
+
1669
+ export const zHostSessionEndedEvent = z.object({
1670
+ type: z.enum(['session.ended']),
1671
+ context: zHostSessionContext,
1672
+ lobby: zHostLobbyView
1673
+ });
1674
+
1675
+ export const zHostSessionErrorEvent = z.object({
1676
+ type: z.enum(['session.error']),
1677
+ sessionId: z.uuid(),
1678
+ code: z.optional(z.string()),
1679
+ message: z.string(),
1680
+ recoverable: z.boolean()
1681
+ });
1682
+
1683
+ export const zHostSessionEvent = z.union([
1684
+ z.object({
1685
+ type: z.literal('session.snapshot')
1686
+ }).and(zHostSessionSnapshotEvent),
1687
+ z.object({
1688
+ type: z.literal('session.lobbyUpdated')
1689
+ }).and(zHostSessionLobbyUpdatedEvent),
1690
+ z.object({
1691
+ type: z.literal('session.gameplayUpdated')
1692
+ }).and(zHostSessionGameplayUpdatedEvent),
1693
+ z.object({
1694
+ type: z.literal('session.historyUpdated')
1695
+ }).and(zHostSessionHistoryUpdatedEvent),
1696
+ z.object({
1697
+ type: z.literal('session.ended')
1698
+ }).and(zHostSessionEndedEvent),
1699
+ z.object({
1700
+ type: z.literal('session.error')
1701
+ }).and(zHostSessionErrorEvent)
1702
+ ]);
1703
+
1704
+ /**
1705
+ * Log entry from the game engine console output
1706
+ */
1707
+ export const zLogMessageDto = z.object({
1708
+ id: z.coerce.bigint().min(BigInt('-9223372036854775808'), { error: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }),
1709
+ type: z.string(),
1710
+ message: z.string(),
1711
+ timestamp: z.iso.datetime()
1712
+ });
1713
+
1714
+ export const zPlayerActionsResponse = z.object({
1715
+ version: z.int(),
1716
+ actionSetVersion: z.string(),
1717
+ actions: z.array(zInteractionDescriptor)
1718
+ });
1719
+
1720
+ export const zPlayerActionResponse = z.object({
1721
+ version: z.int(),
1722
+ actionSetVersion: z.string(),
1723
+ action: zInteractionDescriptor
1724
+ });
1725
+
1726
+ export const zPlayerActionTargetsResponse = z.object({
1727
+ version: z.int(),
1728
+ actionSetVersion: z.string(),
1729
+ interactionId: z.string(),
1730
+ inputKey: z.string(),
1731
+ domain: zInputDomain,
1732
+ zoneCardsById: z.optional(z.record(z.string(), z.string()))
1733
+ });
1734
+
1735
+ export const zPlayerActionRequest = z.object({
1736
+ expectedVersion: z.int(),
1737
+ actionSetVersion: z.string(),
1738
+ inputs: z.record(z.string(), zJsonValue)
1739
+ });
1740
+
1741
+ export const zPlayerActionValidateResponse = z.object({
1742
+ valid: z.boolean(),
1743
+ version: z.int(),
1744
+ actionSetVersion: z.string(),
1745
+ errorCode: z.optional(z.string()),
1746
+ message: z.optional(z.string()),
1747
+ fieldErrors: z.optional(z.record(z.string(), z.string()))
1748
+ });
1749
+
1750
+ export const zHostActionSubmitResponse = z.object({
1751
+ success: z.boolean(),
1752
+ version: z.int(),
1753
+ actionSetVersion: z.string(),
1754
+ accepted: z.optional(z.boolean()),
1755
+ errorCode: z.optional(z.string()),
1756
+ message: z.optional(z.string()),
1757
+ event: z.optional(zHostSessionEvent)
1758
+ });
1759
+
1760
+ /**
1761
+ * Request to update seat settings (display name and/or player color)
1762
+ */
1763
+ export const zUpdateSeatRequest = z.object({
1764
+ displayName: z.optional(z.string().min(1).max(30)),
1765
+ playerColor: z.optional(z.string().regex(/^#[0-9A-Fa-f]{6}$/))
1766
+ });
1767
+
1768
+ /**
1769
+ * Request to restore game state to a previous history point.
1770
+ */
1771
+ export const zRestoreHistoryRequest = z.object({
1772
+ entryId: z.string()
1773
+ });
1774
+
1775
+ export const zRestoreHistoryResponse = z.object({
1776
+ success: z.boolean(),
1777
+ restoredToVersion: z.int(),
1778
+ message: z.optional(z.string())
1779
+ });
1780
+
1781
+ /**
1782
+ * Public demo game summary.
1783
+ */
1784
+ export const zDemoGameSummary = z.object({
1785
+ slug: z.string(),
1786
+ name: z.string(),
1787
+ description: z.optional(z.string()),
1788
+ overview: z.optional(z.string()),
1789
+ thumbnailUrl: z.optional(z.string()),
1790
+ creator: z.optional(z.string()),
1791
+ minPlayers: z.optional(z.int().gte(1)),
1792
+ maxPlayers: z.optional(z.int().gte(1)),
1793
+ playTimeMinMinutes: z.optional(z.int().gte(1)),
1794
+ playTimeMaxMinutes: z.optional(z.int().gte(1)),
1795
+ difficulty: z.optional(z.int().gte(1).lte(5)),
1796
+ mechanics: z.optional(z.array(z.string())),
1797
+ categories: z.optional(z.array(z.string())),
1798
+ heroImageUrl: z.optional(z.string()),
1799
+ estimatedMinutes: z.optional(z.int().gte(1)),
1800
+ demoPlayerCount: z.int().gte(1),
1801
+ registrationStatus: z.enum([
1802
+ 'PENDING',
1803
+ 'REGISTERING',
1804
+ 'REGISTERED',
1805
+ 'FAILED'
1806
+ ]),
1807
+ playable: z.boolean()
1808
+ });
1809
+
1810
+ export const zDemoGameDetails = zDemoGameSummary.and(z.object({
1811
+ activeRevisionId: z.optional(z.uuid()),
1812
+ bundleFingerprint: z.optional(z.string()),
1813
+ error: z.optional(z.string())
1814
+ }));
1815
+
1816
+ /**
1817
+ * Guest-play session created for a public demo game.
1818
+ */
1819
+ export const zDemoSessionResponse = z.object({
1820
+ sessionId: z.uuid(),
1821
+ shortCode: z.string(),
1822
+ demoActorSessionId: z.uuid(),
1823
+ guestSessionSecret: z.string(),
1824
+ seed: z.coerce.bigint().min(BigInt('-9223372036854775808'), { error: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }),
1825
+ selectedPlayerId: z.optional(z.string()),
1826
+ gameSource: zSessionGameSource
1827
+ });
1828
+
1829
+ export const zHistoryUpdatedEvent = z.object({
1830
+ type: z.enum(['history.updated']),
1831
+ history: zSessionSnapshotHistory
1832
+ });
1833
+
1834
+ /**
1835
+ * Type of parameter accepted by a runtime action
1836
+ */
1837
+ export const zParameterType = z.enum([
1838
+ 'cardId',
1839
+ 'cardType',
1840
+ 'playerId',
1841
+ 'string',
1842
+ 'number',
1843
+ 'boolean',
1844
+ 'zoneId',
1845
+ 'pieceId',
1846
+ 'dieId',
1847
+ 'boardId',
1848
+ 'edgeId',
1849
+ 'vertexId',
1850
+ 'spaceId',
1851
+ 'resourceId'
1852
+ ]);
1853
+
1854
+ /**
1855
+ * Defines a parameter for an action
1856
+ */
1857
+ export const zActionParameterDefinition = z.object({
1858
+ name: z.string(),
1859
+ type: zParameterType,
1860
+ required: z.optional(z.boolean()).default(true),
1861
+ array: z.optional(z.boolean()).default(false),
1862
+ minLength: z.optional(z.int().gte(0)),
1863
+ maxLength: z.optional(z.int().gte(0)),
1864
+ cardSetId: z.optional(z.string()),
1865
+ description: z.optional(z.string())
1866
+ });
1867
+
1868
+ /**
1869
+ * Defines an available player action with metadata and parameter definitions
1870
+ */
1871
+ export const zActionDefinition = z.object({
1872
+ actionType: z.string(),
1873
+ displayName: z.string(),
1874
+ description: z.optional(z.string()),
1875
+ parameters: z.array(zActionParameterDefinition),
1876
+ errorCodes: z.optional(z.array(z.string()))
1877
+ });
1878
+
1879
+ /**
1880
+ * Type of source for the card set
1881
+ */
1882
+ export const zCardSetSourceType = z.enum([
1883
+ 'preset',
1884
+ 'csv',
1885
+ 'manual'
1886
+ ]);
1887
+
1888
+ /**
1889
+ * Engine-level structural board layout discriminator
1890
+ */
1891
+ export const zBoardLayout = z.enum([
1892
+ 'generic',
1893
+ 'hex',
1894
+ 'square'
1895
+ ]);
1896
+
1897
+ export const zGameManifestResponse = z.object({
1898
+ manifestId: z.uuid(),
1899
+ gameId: z.uuid(),
1900
+ userId: z.uuid(),
1901
+ jobId: z.optional(z.uuid()),
1902
+ manifest: zGameTopologyManifest,
1903
+ version: z.int(),
1904
+ createdAt: z.iso.datetime()
1905
+ });
1906
+
1907
+ /**
1908
+ * Unique identifier for the game
1909
+ */
1910
+ export const zGameId = z.uuid();
1911
+
1912
+ /**
1913
+ * URL-safe game slug
1914
+ */
1915
+ export const zGameSlug = z.string();
1916
+
1917
+ /**
1918
+ * Unique identifier for the game session
1919
+ */
1920
+ export const zSessionId = z.uuid();
1921
+
1922
+ /**
1923
+ * Unique identifier for the player (e.g., 'player-1')
1924
+ */
1925
+ export const zPlayerId = z.string();
1926
+
1927
+ export const zHealthCheckData = z.object({
1928
+ body: z.optional(z.never()),
1929
+ path: z.optional(z.never()),
1930
+ query: z.optional(z.never())
1931
+ });
1932
+
1933
+ /**
1934
+ * Service is healthy
1935
+ */
1936
+ export const zHealthCheckResponse = z.string();
1937
+
1938
+ export const zGetApiVersionData = z.object({
1939
+ body: z.optional(z.never()),
1940
+ path: z.optional(z.never()),
1941
+ query: z.optional(z.never())
1942
+ });
1943
+
1944
+ /**
1945
+ * Successfully retrieved backend version metadata
1946
+ */
1947
+ export const zGetApiVersionResponse = zApiVersionResponse;
1948
+
1949
+ export const zListGamesData = z.object({
1950
+ body: z.optional(z.never()),
1951
+ path: z.optional(z.never()),
1952
+ query: z.optional(z.object({
1953
+ includeNotInitialized: z.optional(z.boolean()).default(false)
1954
+ }))
1955
+ });
1956
+
1957
+ /**
1958
+ * Successfully retrieved games list
1959
+ */
1960
+ export const zListGamesResponse = z.array(zGame);
1961
+
1962
+ export const zCreateGameData = z.object({
1963
+ body: zCreateGameRequest,
1964
+ path: z.optional(z.never()),
1965
+ query: z.optional(z.never())
1966
+ });
1967
+
1968
+ /**
1969
+ * Game created successfully
1970
+ */
1971
+ export const zCreateGameResponse = zGame;
1972
+
1973
+ export const zExtractGameSpecData = z.object({
1974
+ body: zExtractGameSpecRequest,
1975
+ path: z.optional(z.never()),
1976
+ query: z.optional(z.never())
1977
+ });
1978
+
1979
+ /**
1980
+ * Structured game spec extracted
1981
+ */
1982
+ export const zExtractGameSpecResponse2 = zExtractGameSpecResponse;
1983
+
1984
+ export const zDeleteGameData = z.object({
1985
+ body: z.optional(z.never()),
1986
+ path: z.object({
1987
+ gameId: z.uuid()
1988
+ }),
1989
+ query: z.optional(z.never())
1990
+ });
1991
+
1992
+ /**
1993
+ * Game deleted successfully
1994
+ */
1995
+ export const zDeleteGameResponse2 = zDeleteGameResponse;
1996
+
1997
+ export const zGetGameData = z.object({
1998
+ body: z.optional(z.never()),
1999
+ path: z.object({
2000
+ gameId: z.uuid()
2001
+ }),
2002
+ query: z.optional(z.never())
2003
+ });
2004
+
2005
+ /**
2006
+ * Successfully retrieved game
2007
+ */
2008
+ export const zGetGameResponse = zGame;
2009
+
2010
+ export const zUpdateGameData = z.object({
2011
+ body: zUpdateGameRequest,
2012
+ path: z.object({
2013
+ gameId: z.uuid()
2014
+ }),
2015
+ query: z.optional(z.never())
2016
+ });
2017
+
2018
+ /**
2019
+ * Success message
2020
+ */
2021
+ export const zUpdateGameResponse = z.string();
2022
+
2023
+ export const zGetGameBySlugData = z.object({
2024
+ body: z.optional(z.never()),
2025
+ path: z.object({
2026
+ slug: z.string()
2027
+ }),
2028
+ query: z.optional(z.object({
2029
+ includeDeleted: z.optional(z.boolean()).default(false)
2030
+ }))
2031
+ });
2032
+
2033
+ /**
2034
+ * Successfully retrieved game
2035
+ */
2036
+ export const zGetGameBySlugResponse = zGame;
2037
+
2038
+ export const zQueryWorkshopRulebookData = z.object({
2039
+ body: z.optional(z.never()),
2040
+ path: z.optional(z.never()),
2041
+ query: z.object({
2042
+ title: z.string().min(1)
2043
+ })
2044
+ });
2045
+
2046
+ /**
2047
+ * Extracted rulebook text for the first valid candidate.
2048
+ */
2049
+ export const zQueryWorkshopRulebookResponse = zWorkshopRuleTextResponse;
2050
+
2051
+ export const zFindManifestsData = z.object({
2052
+ body: z.optional(z.never()),
2053
+ path: z.object({
2054
+ gameId: z.uuid()
2055
+ }),
2056
+ query: z.object({
2057
+ limit: z.optional(z.int().gte(1).lte(100)).default(10),
2058
+ ruleId: z.uuid()
2059
+ })
2060
+ });
2061
+
2062
+ /**
2063
+ * Manifests retrieved successfully
2064
+ */
2065
+ export const zFindManifestsResponse2 = zFindManifestsResponse;
2066
+
2067
+ export const zSaveManifestData = z.object({
2068
+ body: zSaveManifestRequest,
2069
+ path: z.object({
2070
+ gameId: z.uuid()
2071
+ }),
2072
+ query: z.optional(z.never())
2073
+ });
2074
+
2075
+ /**
2076
+ * Manifest saved successfully
2077
+ */
2078
+ export const zSaveManifestResponse2 = zSaveManifestResponse;
2079
+
2080
+ export const zGetManifestData = z.object({
2081
+ body: z.optional(z.never()),
2082
+ path: z.object({
2083
+ manifestId: z.uuid()
2084
+ }),
2085
+ query: z.optional(z.never())
2086
+ });
2087
+
2088
+ /**
2089
+ * Manifest retrieved successfully
2090
+ */
2091
+ export const zGetManifestResponse = zGameManifestDto;
2092
+
2093
+ export const zGetLatestCompiledResultData = z.object({
2094
+ body: z.optional(z.never()),
2095
+ path: z.object({
2096
+ gameId: z.uuid()
2097
+ }),
2098
+ query: z.optional(z.object({
2099
+ successOnly: z.optional(z.boolean()).default(false)
2100
+ }))
2101
+ });
2102
+
2103
+ /**
2104
+ * Latest compiled result found
2105
+ */
2106
+ export const zGetLatestCompiledResultResponse = zCompiledResult;
2107
+
2108
+ export const zListCompiledResultsData = z.object({
2109
+ body: z.optional(z.never()),
2110
+ path: z.object({
2111
+ gameId: z.uuid()
2112
+ }),
2113
+ query: z.optional(z.object({
2114
+ limit: z.optional(z.int().gte(1).lte(100)).default(10),
2115
+ authoringStateId: z.optional(z.uuid())
2116
+ }))
2117
+ });
2118
+
2119
+ /**
2120
+ * Compiled results retrieved successfully
2121
+ */
2122
+ export const zListCompiledResultsResponse2 = zListCompiledResultsResponse;
2123
+
2124
+ export const zQueueCompiledResultJobData = z.object({
2125
+ body: zQueueCompiledResultJobRequest,
2126
+ path: z.object({
2127
+ gameId: z.uuid()
2128
+ }),
2129
+ query: z.optional(z.never())
2130
+ });
2131
+
2132
+ /**
2133
+ * Compile job accepted
2134
+ */
2135
+ export const zQueueCompiledResultJobResponse2 = zQueueCompiledResultJobResponse;
2136
+
2137
+ export const zEnsureDevCompileData = z.object({
2138
+ body: zEnsureDevCompileRequest,
2139
+ path: z.object({
2140
+ gameId: z.uuid()
2141
+ }),
2142
+ query: z.optional(z.never())
2143
+ });
2144
+
2145
+ /**
2146
+ * Existing dev compile reused or cache miss reported
2147
+ */
2148
+ export const zEnsureDevCompileResponse2 = zEnsureDevCompileResponse;
2149
+
2150
+ export const zGetCompiledResultData = z.object({
2151
+ body: z.optional(z.never()),
2152
+ path: z.object({
2153
+ gameId: z.uuid(),
2154
+ compiledResultId: z.uuid()
2155
+ }),
2156
+ query: z.optional(z.never())
2157
+ });
2158
+
2159
+ /**
2160
+ * Compiled result found
2161
+ */
2162
+ export const zGetCompiledResultResponse = zCompiledResult;
2163
+
2164
+ export const zDownloadGameSourcesData = z.object({
2165
+ body: z.optional(z.never()),
2166
+ path: z.object({
2167
+ gameId: z.uuid()
2168
+ }),
2169
+ query: z.optional(z.never())
2170
+ });
2171
+
2172
+ /**
2173
+ * ZIP archive containing source files
2174
+ */
2175
+ export const zDownloadGameSourcesResponse = z.string();
2176
+
2177
+ export const zGetGameSourcesData = z.object({
2178
+ body: z.optional(z.never()),
2179
+ path: z.object({
2180
+ gameId: z.uuid()
2181
+ }),
2182
+ query: z.optional(z.object({
2183
+ authoringStateId: z.optional(z.uuid())
2184
+ }))
2185
+ });
2186
+
2187
+ /**
2188
+ * Source files retrieved successfully
2189
+ */
2190
+ export const zGetGameSourcesResponse = zGameSourcesResponse;
2191
+
2192
+ export const zCreateSourceRevisionData = z.object({
2193
+ body: zCreateSourceRevisionRequest,
2194
+ path: z.object({
2195
+ gameId: z.uuid()
2196
+ }),
2197
+ query: z.optional(z.never())
2198
+ });
2199
+
2200
+ /**
2201
+ * Source revision created
2202
+ */
2203
+ export const zCreateSourceRevisionResponse = zSourceRevision;
2204
+
2205
+ export const zCreateSourceBlobUploadSessionData = z.object({
2206
+ body: zCreateSourceBlobUploadSessionRequest,
2207
+ path: z.object({
2208
+ gameId: z.uuid()
2209
+ }),
2210
+ query: z.optional(z.never())
2211
+ });
2212
+
2213
+ /**
2214
+ * Upload session created
2215
+ */
2216
+ export const zCreateSourceBlobUploadSessionResponse = zSourceBlobUploadSession;
2217
+
2218
+ export const zGetAuthoringHeadData = z.object({
2219
+ body: z.optional(z.never()),
2220
+ path: z.object({
2221
+ gameId: z.uuid()
2222
+ }),
2223
+ query: z.optional(z.never())
2224
+ });
2225
+
2226
+ /**
2227
+ * Current authoring head found
2228
+ */
2229
+ export const zGetAuthoringHeadResponse = zAuthoringState;
2230
+
2231
+ export const zCreateAuthoringStateData = z.object({
2232
+ body: zCreateAuthoringStateRequest,
2233
+ path: z.object({
2234
+ gameId: z.uuid()
2235
+ }),
2236
+ query: z.optional(z.never())
2237
+ });
2238
+
2239
+ /**
2240
+ * Authoring state created and promoted to head
2241
+ */
2242
+ export const zCreateAuthoringStateResponse = zAuthoringState;
2243
+
2244
+ export const zGetGameScriptsData = z.object({
2245
+ body: z.optional(z.never()),
2246
+ path: z.object({
2247
+ gameId: z.uuid()
2248
+ }),
2249
+ query: z.object({
2250
+ manifestId: z.uuid()
2251
+ })
2252
+ });
2253
+
2254
+ /**
2255
+ * Game scripts retrieved successfully
2256
+ */
2257
+ export const zGetGameScriptsResponse = zGameScriptsResponse;
2258
+
2259
+ export const zGetActiveJobData = z.object({
2260
+ body: z.optional(z.never()),
2261
+ path: z.object({
2262
+ gameId: z.uuid()
2263
+ }),
2264
+ query: z.optional(z.never())
2265
+ });
2266
+
2267
+ /**
2268
+ * Active job status (null if no active job)
2269
+ */
2270
+ export const zGetActiveJobResponse = zActiveJobResponse;
2271
+
2272
+ export const zGetJobData = z.object({
2273
+ body: z.optional(z.never()),
2274
+ path: z.object({
2275
+ jobId: z.uuid()
2276
+ }),
2277
+ query: z.optional(z.never())
2278
+ });
2279
+
2280
+ /**
2281
+ * Job details
2282
+ */
2283
+ export const zGetJobResponse = zJobDetailResponse;
2284
+
2285
+ export const zSubscribeToJobEventsData = z.object({
2286
+ body: z.optional(z.never()),
2287
+ path: z.object({
2288
+ jobId: z.uuid()
2289
+ }),
2290
+ query: z.optional(z.never())
2291
+ });
2292
+
2293
+ /**
2294
+ * SSE connection established
2295
+ */
2296
+ export const zSubscribeToJobEventsResponse = zJobDetailResponse;
2297
+
2298
+ export const zCreateGameRunData = z.object({
2299
+ body: zCreateGameRunRequest,
2300
+ path: z.optional(z.never()),
2301
+ query: z.optional(z.never())
2302
+ });
2303
+
2304
+ /**
2305
+ * Game build run accepted
2306
+ */
2307
+ export const zCreateGameRunResponse2 = zCreateGameRunResponse;
2308
+
2309
+ export const zCancelGameRunData = z.object({
2310
+ body: z.optional(z.never()),
2311
+ path: z.object({
2312
+ jobId: z.uuid()
2313
+ }),
2314
+ query: z.optional(z.never())
2315
+ });
2316
+
2317
+ export const zListGameRulesData = z.object({
2318
+ body: z.optional(z.never()),
2319
+ path: z.object({
2320
+ gameId: z.uuid()
2321
+ }),
2322
+ query: z.optional(z.object({
2323
+ limit: z.optional(z.int().gte(1).lte(100)).default(10)
2324
+ }))
2325
+ });
2326
+
2327
+ /**
2328
+ * Game rules retrieved successfully
2329
+ */
2330
+ export const zListGameRulesResponse2 = zListGameRulesResponse;
2331
+
2332
+ export const zCreateGameRuleData = z.object({
2333
+ body: zCreateGameRuleRequest,
2334
+ path: z.object({
2335
+ gameId: z.uuid()
2336
+ }),
2337
+ query: z.optional(z.never())
2338
+ });
2339
+
2340
+ /**
2341
+ * Game rule created successfully
2342
+ */
2343
+ export const zCreateGameRuleResponse2 = zCreateGameRuleResponse;
2344
+
2345
+ export const zGetLatestGameRuleData = z.object({
2346
+ body: z.optional(z.never()),
2347
+ path: z.object({
2348
+ gameId: z.uuid()
2349
+ }),
2350
+ query: z.optional(z.never())
2351
+ });
2352
+
2353
+ /**
2354
+ * Latest game rule retrieved successfully
2355
+ */
2356
+ export const zGetLatestGameRuleResponse = zGameRule;
2357
+
2358
+ export const zGetGameRuleData = z.object({
2359
+ body: z.optional(z.never()),
2360
+ path: z.object({
2361
+ ruleId: z.uuid()
2362
+ }),
2363
+ query: z.optional(z.never())
2364
+ });
2365
+
2366
+ /**
2367
+ * Game rule retrieved successfully
2368
+ */
2369
+ export const zGetGameRuleResponse = zGameRule;
2370
+
2371
+ export const zCreateSessionData = z.object({
2372
+ body: zCreateSessionRequest,
2373
+ path: z.object({
2374
+ gameId: z.uuid()
2375
+ }),
2376
+ query: z.optional(z.never())
2377
+ });
2378
+
2379
+ /**
2380
+ * Session created successfully
2381
+ */
2382
+ export const zCreateSessionResponse2 = zCreateSessionResponse;
2383
+
2384
+ export const zCreateSessionFromReducerSnapshotData = z.object({
2385
+ body: zCreateSessionFromReducerSnapshotRequest,
2386
+ path: z.object({
2387
+ gameId: z.uuid()
2388
+ }),
2389
+ query: z.optional(z.never())
2390
+ });
2391
+
2392
+ /**
2393
+ * Session materialized successfully
2394
+ */
2395
+ export const zCreateSessionFromReducerSnapshotResponse = zHostSessionSnapshot;
2396
+
2397
+ export const zGetSessionByShortCodeData = z.object({
2398
+ body: z.optional(z.never()),
2399
+ path: z.object({
2400
+ shortCode: z.string()
2401
+ }),
2402
+ query: z.optional(z.object({
2403
+ playerId: z.optional(z.string())
2404
+ }))
2405
+ });
2406
+
2407
+ /**
2408
+ * Session found successfully
2409
+ */
2410
+ export const zGetSessionByShortCodeResponse = zHostSessionSnapshot;
2411
+
2412
+ export const zGetSessionSnapshotData = z.object({
2413
+ body: z.optional(z.never()),
2414
+ path: z.object({
2415
+ sessionId: z.uuid()
2416
+ }),
2417
+ query: z.optional(z.object({
2418
+ playerId: z.optional(z.string())
2419
+ }))
2420
+ });
2421
+
2422
+ /**
2423
+ * Session snapshot retrieved successfully
2424
+ */
2425
+ export const zGetSessionSnapshotResponse = zHostSessionSnapshot;
2426
+
2427
+ export const zSubscribeToSessionEventsData = z.object({
2428
+ body: z.optional(z.never()),
2429
+ path: z.object({
2430
+ sessionId: z.uuid()
2431
+ }),
2432
+ query: z.object({
2433
+ clientId: z.string(),
2434
+ connectionAttemptId: z.string(),
2435
+ clientSource: z.optional(z.string()),
2436
+ playerId: z.optional(z.string())
2437
+ })
2438
+ });
2439
+
2440
+ /**
2441
+ * Server-Sent Events stream. Each event contains a JSON-serialized HostSessionEvent.
2442
+ *
2443
+ */
2444
+ export const zSubscribeToSessionEventsResponse = zHostSessionEvent;
2445
+
2446
+ export const zDisconnectSessionEventsData = z.object({
2447
+ body: z.optional(z.never()),
2448
+ path: z.object({
2449
+ sessionId: z.uuid()
2450
+ }),
2451
+ query: z.object({
2452
+ clientId: z.string(),
2453
+ connectionAttemptId: z.string(),
2454
+ playerId: z.optional(z.string())
2455
+ })
2456
+ });
2457
+
2458
+ export const zSubscribeToGameLogsData = z.object({
2459
+ body: z.optional(z.never()),
2460
+ path: z.object({
2461
+ sessionId: z.uuid()
2462
+ }),
2463
+ query: z.optional(z.object({
2464
+ lastLogId: z.optional(z.coerce.bigint().min(BigInt('-9223372036854775808'), { error: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }))
2465
+ }))
2466
+ });
2467
+
2468
+ /**
2469
+ * SSE connection established
2470
+ */
2471
+ export const zSubscribeToGameLogsResponse = zLogMessageDto;
2472
+
2473
+ export const zStartGameData = z.object({
2474
+ body: z.optional(z.never()),
2475
+ path: z.object({
2476
+ sessionId: z.uuid()
2477
+ }),
2478
+ query: z.optional(z.never())
2479
+ });
2480
+
2481
+ /**
2482
+ * Game started successfully
2483
+ */
2484
+ export const zStartGameResponse = zHostSessionSnapshot;
2485
+
2486
+ export const zListPlayerActionsData = z.object({
2487
+ body: z.optional(z.never()),
2488
+ path: z.object({
2489
+ sessionId: z.uuid(),
2490
+ playerId: z.string()
2491
+ }),
2492
+ query: z.optional(z.never())
2493
+ });
2494
+
2495
+ /**
2496
+ * Current actions returned successfully
2497
+ */
2498
+ export const zListPlayerActionsResponse = zPlayerActionsResponse;
2499
+
2500
+ export const zDescribePlayerActionData = z.object({
2501
+ body: z.optional(z.never()),
2502
+ path: z.object({
2503
+ sessionId: z.uuid(),
2504
+ playerId: z.string(),
2505
+ interactionId: z.string()
2506
+ }),
2507
+ query: z.optional(z.never())
2508
+ });
2509
+
2510
+ /**
2511
+ * Action descriptor returned successfully
2512
+ */
2513
+ export const zDescribePlayerActionResponse = zPlayerActionResponse;
2514
+
2515
+ export const zGetPlayerActionTargetsData = z.object({
2516
+ body: z.optional(z.never()),
2517
+ path: z.object({
2518
+ sessionId: z.uuid(),
2519
+ playerId: z.string(),
2520
+ interactionId: z.string(),
2521
+ inputKey: z.string()
2522
+ }),
2523
+ query: z.optional(z.never())
2524
+ });
2525
+
2526
+ /**
2527
+ * Input domain returned successfully
2528
+ */
2529
+ export const zGetPlayerActionTargetsResponse = zPlayerActionTargetsResponse;
2530
+
2531
+ export const zValidatePlayerActionData = z.object({
2532
+ body: zPlayerActionRequest,
2533
+ path: z.object({
2534
+ sessionId: z.uuid(),
2535
+ playerId: z.string(),
2536
+ interactionId: z.string()
2537
+ }),
2538
+ query: z.optional(z.never())
2539
+ });
2540
+
2541
+ /**
2542
+ * Validation result returned successfully
2543
+ */
2544
+ export const zValidatePlayerActionResponse = zPlayerActionValidateResponse;
2545
+
2546
+ export const zSubmitPlayerActionData = z.object({
2547
+ body: zPlayerActionRequest,
2548
+ path: z.object({
2549
+ sessionId: z.uuid(),
2550
+ playerId: z.string(),
2551
+ interactionId: z.string()
2552
+ }),
2553
+ query: z.optional(z.never())
2554
+ });
2555
+
2556
+ /**
2557
+ * Submission result returned successfully
2558
+ */
2559
+ export const zSubmitPlayerActionResponse = zHostActionSubmitResponse;
2560
+
2561
+ export const zAddSeatData = z.object({
2562
+ body: z.optional(z.never()),
2563
+ path: z.object({
2564
+ sessionId: z.uuid()
2565
+ }),
2566
+ query: z.optional(z.never())
2567
+ });
2568
+
2569
+ /**
2570
+ * Seat added successfully
2571
+ */
2572
+ export const zAddSeatResponse = zSeatAssignment;
2573
+
2574
+ export const zRemoveSeatData = z.object({
2575
+ body: z.optional(z.never()),
2576
+ path: z.object({
2577
+ sessionId: z.uuid(),
2578
+ playerId: z.string()
2579
+ }),
2580
+ query: z.optional(z.never())
2581
+ });
2582
+
2583
+ /**
2584
+ * Seat removed successfully
2585
+ */
2586
+ export const zRemoveSeatResponse = z.void();
2587
+
2588
+ export const zUpdateSeatData = z.object({
2589
+ body: zUpdateSeatRequest,
2590
+ path: z.object({
2591
+ sessionId: z.uuid(),
2592
+ playerId: z.string()
2593
+ }),
2594
+ query: z.optional(z.never())
2595
+ });
2596
+
2597
+ /**
2598
+ * Seat updated successfully
2599
+ */
2600
+ export const zUpdateSeatResponse = zSeatAssignment;
2601
+
2602
+ export const zAssignSeatData = z.object({
2603
+ body: z.optional(z.never()),
2604
+ path: z.object({
2605
+ sessionId: z.uuid(),
2606
+ playerId: z.string()
2607
+ }),
2608
+ query: z.optional(z.never())
2609
+ });
2610
+
2611
+ /**
2612
+ * Seat assigned successfully
2613
+ */
2614
+ export const zAssignSeatResponse = z.void();
2615
+
2616
+ export const zRestoreHistoryData = z.object({
2617
+ body: zRestoreHistoryRequest,
2618
+ path: z.object({
2619
+ sessionId: z.uuid()
2620
+ }),
2621
+ query: z.optional(z.never())
2622
+ });
2623
+
2624
+ /**
2625
+ * Game state restored successfully
2626
+ */
2627
+ export const zRestoreHistoryResponse2 = zRestoreHistoryResponse;
2628
+
2629
+ export const zUnassignSeatData = z.object({
2630
+ body: z.optional(z.never()),
2631
+ path: z.object({
2632
+ sessionId: z.uuid(),
2633
+ playerId: z.string()
2634
+ }),
2635
+ query: z.optional(z.never())
2636
+ });
2637
+
2638
+ /**
2639
+ * Seat unassigned successfully
2640
+ */
2641
+ export const zUnassignSeatResponse = z.void();
2642
+
2643
+ export const zFetchUiBundleData = z.object({
2644
+ body: z.optional(z.never()),
2645
+ path: z.optional(z.never()),
2646
+ query: z.optional(z.object({
2647
+ gameId: z.optional(z.uuid()),
2648
+ sessionId: z.optional(z.uuid())
2649
+ }))
2650
+ });
2651
+
2652
+ /**
2653
+ * HTML content of the UI bundle
2654
+ */
2655
+ export const zFetchUiBundleResponse = z.string();
2656
+
2657
+ export const zListDemoGamesData = z.object({
2658
+ body: z.optional(z.never()),
2659
+ path: z.optional(z.never()),
2660
+ query: z.optional(z.never())
2661
+ });
2662
+
2663
+ /**
2664
+ * Successfully retrieved demo games
2665
+ */
2666
+ export const zListDemoGamesResponse = z.array(zDemoGameSummary);
2667
+
2668
+ export const zGetDemoGameData = z.object({
2669
+ body: z.optional(z.never()),
2670
+ path: z.object({
2671
+ slug: z.string()
2672
+ }),
2673
+ query: z.optional(z.never())
2674
+ });
2675
+
2676
+ /**
2677
+ * Successfully retrieved demo game metadata
2678
+ */
2679
+ export const zGetDemoGameResponse = zDemoGameDetails;
2680
+
2681
+ export const zGetDemoGameThumbnailData = z.object({
2682
+ body: z.optional(z.never()),
2683
+ path: z.object({
2684
+ slug: z.string()
2685
+ }),
2686
+ query: z.optional(z.never())
2687
+ });
2688
+
2689
+ /**
2690
+ * Successfully retrieved demo thumbnail
2691
+ */
2692
+ export const zGetDemoGameThumbnailResponse = z.string();
2693
+
2694
+ export const zCreateDemoGameSessionData = z.object({
2695
+ body: z.optional(z.never()),
2696
+ path: z.object({
2697
+ slug: z.string()
2698
+ }),
2699
+ query: z.optional(z.never())
2700
+ });
2701
+
2702
+ /**
2703
+ * Demo session created successfully
2704
+ */
2705
+ export const zCreateDemoGameSessionResponse = zDemoSessionResponse;