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