@dreamboard-games/sdk 0.5.0-alpha.7 → 0.5.0-alpha.9

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.
@@ -1,104 +1,120 @@
1
1
  import {
2
2
  PlayerBoardSpaceTargetSchema,
3
3
  __export
4
- } from "./chunk-3JXUL4VN.js";
4
+ } from "./chunk-DPRHGA2C.js";
5
5
 
6
6
  // src/shared/runtime-json.ts
7
- import { z } from "zod";
7
+ import * as z from "zod";
8
+ import { en } from "zod/locales";
9
+ z.config(en());
8
10
  var RuntimeJsonSchema = z.json();
9
11
 
12
+ // src/shared/domain/cards.ts
13
+ import * as z2 from "zod";
14
+ var ViewCardSchema = z2.strictObject({
15
+ id: z2.string(),
16
+ cardType: z2.string(),
17
+ name: z2.string().optional(),
18
+ text: z2.string().optional(),
19
+ /** Manifest asset path; game UIs receive a loadable URL. */
20
+ frontImage: z2.string().optional(),
21
+ /** Manifest asset path; game UIs receive a loadable URL. */
22
+ backImage: z2.string().optional(),
23
+ properties: z2.record(z2.string(), RuntimeJsonSchema)
24
+ });
25
+
10
26
  // src/shared/interaction-schema.ts
11
- import { z as z2 } from "zod";
12
- var InteractionCommitPolicySchema = z2.discriminatedUnion("mode", [
13
- z2.object({ mode: z2.literal("manual") }).strict(),
14
- z2.object({ mode: z2.literal("autoWhenReady") }).strict()
27
+ import * as z3 from "zod";
28
+ var InteractionCommitPolicySchema = z3.discriminatedUnion("mode", [
29
+ z3.object({ mode: z3.literal("manual") }).strict(),
30
+ z3.object({ mode: z3.literal("autoWhenReady") }).strict()
15
31
  ]);
16
- var InputSelectionSchema = z2.discriminatedUnion("mode", [
17
- z2.object({ mode: z2.literal("single") }).strict(),
18
- z2.object({
19
- mode: z2.literal("many"),
20
- min: z2.number().int(),
21
- max: z2.number().int().optional(),
22
- distinct: z2.boolean().optional()
32
+ var InputSelectionSchema = z3.discriminatedUnion("mode", [
33
+ z3.object({ mode: z3.literal("single") }).strict(),
34
+ z3.object({
35
+ mode: z3.literal("many"),
36
+ min: z3.number().int(),
37
+ max: z3.number().int().optional(),
38
+ distinct: z3.boolean().optional()
23
39
  }).strict()
24
40
  ]);
25
- var InteractionChoiceOptionSchema = z2.object({
26
- value: z2.string().nullable(),
27
- label: z2.string(),
28
- icon: z2.string().optional(),
29
- badge: z2.string().optional(),
30
- description: z2.string().optional(),
31
- disabled: z2.boolean().optional(),
32
- disabledReason: z2.string().optional()
41
+ var InteractionChoiceOptionSchema = z3.object({
42
+ value: z3.string().nullable(),
43
+ label: z3.string(),
44
+ icon: z3.string().optional(),
45
+ badge: z3.string().optional(),
46
+ description: z3.string().optional(),
47
+ disabled: z3.boolean().optional(),
48
+ disabledReason: z3.string().optional()
33
49
  }).strict();
34
50
  var selection = { selection: InputSelectionSchema.optional() };
35
- var InputDomainSchema = z2.discriminatedUnion("type", [
36
- z2.strictObject({
37
- type: z2.literal("cardTarget"),
38
- projection: z2.literal("resolved"),
39
- targetKind: z2.literal("card"),
40
- zoneIds: z2.array(z2.string()),
41
- eligibleTargets: z2.array(z2.string()),
51
+ var InputDomainSchema = z3.discriminatedUnion("type", [
52
+ z3.strictObject({
53
+ type: z3.literal("cardTarget"),
54
+ projection: z3.literal("resolved"),
55
+ targetKind: z3.literal("card"),
56
+ zoneIds: z3.array(z3.string()),
57
+ eligibleTargets: z3.array(z3.string()),
42
58
  ...selection
43
59
  }),
44
- z2.discriminatedUnion("valueKind", [
45
- z2.strictObject({
46
- type: z2.literal("boardTarget"),
47
- projection: z2.literal("resolved"),
48
- targetKind: z2.enum(["edge", "vertex", "space", "tile"]),
49
- boardId: z2.string(),
50
- valueKind: z2.literal("board-id"),
51
- eligibleTargets: z2.array(z2.string()),
60
+ z3.discriminatedUnion("valueKind", [
61
+ z3.strictObject({
62
+ type: z3.literal("boardTarget"),
63
+ projection: z3.literal("resolved"),
64
+ targetKind: z3.enum(["edge", "vertex", "space", "tile"]),
65
+ boardId: z3.string(),
66
+ valueKind: z3.literal("board-id"),
67
+ eligibleTargets: z3.array(z3.string()),
52
68
  ...selection
53
69
  }),
54
- z2.strictObject({
55
- type: z2.literal("boardTarget"),
56
- projection: z2.literal("resolved"),
57
- targetKind: z2.literal("space"),
58
- boardId: z2.string(),
59
- valueKind: z2.literal("player-board-space"),
60
- eligibleTargets: z2.array(PlayerBoardSpaceTargetSchema),
70
+ z3.strictObject({
71
+ type: z3.literal("boardTarget"),
72
+ projection: z3.literal("resolved"),
73
+ targetKind: z3.literal("space"),
74
+ boardId: z3.string(),
75
+ valueKind: z3.literal("player-board-space"),
76
+ eligibleTargets: z3.array(PlayerBoardSpaceTargetSchema),
61
77
  ...selection
62
78
  })
63
79
  ]),
64
- z2.strictObject({
65
- type: z2.literal("resourceMap"),
66
- resources: z2.array(
67
- z2.strictObject({
68
- resourceId: z2.string(),
69
- label: z2.string().optional(),
70
- icon: z2.string().optional(),
71
- min: z2.number(),
72
- max: z2.number()
80
+ z3.strictObject({
81
+ type: z3.literal("resourceMap"),
82
+ resources: z3.array(
83
+ z3.strictObject({
84
+ resourceId: z3.string(),
85
+ label: z3.string().optional(),
86
+ icon: z3.string().optional(),
87
+ min: z3.number(),
88
+ max: z3.number()
73
89
  })
74
90
  ),
75
91
  ...selection
76
92
  }),
77
- z2.strictObject({
78
- type: z2.literal("boundedNumber"),
79
- min: z2.number(),
80
- max: z2.number(),
81
- step: z2.number().optional(),
93
+ z3.strictObject({
94
+ type: z3.literal("boundedNumber"),
95
+ min: z3.number(),
96
+ max: z3.number(),
97
+ step: z3.number().optional(),
82
98
  ...selection
83
99
  }),
84
- z2.strictObject({
85
- type: z2.literal("choice"),
86
- choices: z2.array(InteractionChoiceOptionSchema),
100
+ z3.strictObject({
101
+ type: z3.literal("choice"),
102
+ choices: z3.array(InteractionChoiceOptionSchema),
87
103
  ...selection
88
104
  }),
89
- z2.strictObject({
90
- type: z2.literal("choiceList"),
91
- choices: z2.array(
92
- InteractionChoiceOptionSchema.extend({ value: z2.string() })
105
+ z3.strictObject({
106
+ type: z3.literal("choiceList"),
107
+ choices: z3.array(
108
+ InteractionChoiceOptionSchema.extend({ value: z3.string() })
93
109
  ),
94
- min: z2.number().int().optional(),
95
- max: z2.number().int().optional(),
110
+ min: z3.number().int().optional(),
111
+ max: z3.number().int().optional(),
96
112
  ...selection
97
113
  })
98
114
  ]);
99
- var InteractionInputDescriptorSchema = z2.object({
100
- key: z2.string().min(1),
101
- kind: z2.enum([
115
+ var InteractionInputDescriptorSchema = z3.object({
116
+ key: z3.string().min(1),
117
+ kind: z3.enum([
102
118
  "form",
103
119
  "board-vertex",
104
120
  "board-edge",
@@ -110,50 +126,50 @@ var InteractionInputDescriptorSchema = z2.object({
110
126
  domain: InputDomainSchema,
111
127
  defaultValue: RuntimeJsonSchema.optional()
112
128
  }).strict();
113
- var InteractionAvailabilitySchema = z2.discriminatedUnion("status", [
114
- z2.object({ status: z2.literal("available") }).strict(),
115
- z2.object({ status: z2.literal("notYourTurn"), reason: z2.string() }).strict(),
116
- z2.object({
117
- status: z2.literal("blocked"),
118
- reason: z2.string(),
119
- code: z2.string().optional()
129
+ var InteractionAvailabilitySchema = z3.discriminatedUnion("status", [
130
+ z3.object({ status: z3.literal("available") }).strict(),
131
+ z3.object({ status: z3.literal("notYourTurn"), reason: z3.string() }).strict(),
132
+ z3.object({
133
+ status: z3.literal("blocked"),
134
+ reason: z3.string(),
135
+ code: z3.string().optional()
120
136
  }).strict()
121
137
  ]);
122
- var InteractionBaseSchema = z2.object({
123
- phaseName: z2.string().min(1),
124
- interactionKey: z2.string().min(1),
125
- interactionId: z2.string().min(1),
126
- label: z2.string().min(1),
127
- help: z2.string().optional(),
128
- zoneId: z2.string().optional(),
129
- zoneIds: z2.array(z2.string()).optional(),
138
+ var InteractionBaseSchema = z3.object({
139
+ phaseName: z3.string().min(1),
140
+ interactionKey: z3.string().min(1),
141
+ interactionId: z3.string().min(1),
142
+ label: z3.string().min(1),
143
+ help: z3.string().optional(),
144
+ zoneId: z3.string().optional(),
145
+ zoneIds: z3.array(z3.string()).optional(),
130
146
  commit: InteractionCommitPolicySchema,
131
- descriptorDigest: z2.string().optional(),
132
- actorSeat: z2.number().int().optional(),
133
- draftDigest: z2.string().optional(),
134
- inputs: z2.array(InteractionInputDescriptorSchema),
135
- step: z2.object({
136
- index: z2.number().int().nonnegative(),
137
- total: z2.number().int().positive(),
138
- selected: z2.record(z2.string(), RuntimeJsonSchema),
139
- canCancel: z2.boolean()
147
+ descriptorDigest: z3.string().optional(),
148
+ actorSeat: z3.number().int().optional(),
149
+ draftDigest: z3.string().optional(),
150
+ inputs: z3.array(InteractionInputDescriptorSchema),
151
+ step: z3.object({
152
+ index: z3.number().int().nonnegative(),
153
+ total: z3.number().int().positive(),
154
+ selected: z3.record(z3.string(), RuntimeJsonSchema),
155
+ canCancel: z3.boolean()
140
156
  }).strict().optional(),
141
157
  availability: InteractionAvailabilitySchema,
142
- reasons: z2.array(
143
- z2.object({
144
- ruleId: z2.string(),
145
- errorCode: z2.string()
158
+ reasons: z3.array(
159
+ z3.object({
160
+ ruleId: z3.string(),
161
+ errorCode: z3.string()
146
162
  }).strict()
147
163
  ).optional()
148
164
  }).strict();
149
165
  var InteractionDescriptorSchema = InteractionBaseSchema.extend({
150
- kind: z2.literal("action")
166
+ kind: z3.literal("action")
151
167
  }).strict();
152
- var ZoneInteractionRefsSchema = z2.strictObject({
153
- cardIds: z2.array(z2.string()),
154
- cardViewsById: z2.record(z2.string(), z2.string()),
155
- cardBacksById: z2.record(z2.string(), z2.string()),
156
- playableByCardId: z2.record(z2.string(), z2.array(z2.string()))
168
+ var ZoneInteractionRefsSchema = z3.strictObject({
169
+ cardIds: z3.array(z3.string()),
170
+ cardViewsById: z3.record(z3.string(), ViewCardSchema),
171
+ cardBacksById: z3.record(z3.string(), z3.string()),
172
+ playableByCardId: z3.record(z3.string(), z3.array(z3.string()))
157
173
  });
158
174
 
159
175
  // src/shared/runtime-schema.ts
@@ -210,275 +226,275 @@ __export(runtime_schema_exports, {
210
226
  SystemActionEventSchema: () => SystemActionEventSchema,
211
227
  TransitionRecordSchema: () => TransitionRecordSchema
212
228
  });
213
- import { z as z3 } from "zod";
214
- var ReducerContractVersionSchema = z3.string().regex(new RegExp("^[0-9]+\\.[0-9]+\\.[0-9]+$"));
215
- var RngOperationParameterSchema = z3.union([
216
- z3.string(),
217
- z3.number().finite(),
218
- z3.boolean()
229
+ import * as z4 from "zod";
230
+ var ReducerContractVersionSchema = z4.string().regex(new RegExp("^[0-9]+\\.[0-9]+\\.[0-9]+$"));
231
+ var RngOperationParameterSchema = z4.union([
232
+ z4.string(),
233
+ z4.number().finite(),
234
+ z4.boolean()
219
235
  ]);
220
- var RngOperationSchema = z3.strictObject({
221
- kind: z3.string().min(1),
222
- parameters: z3.record(z3.string(), RngOperationParameterSchema)
223
- });
224
- var RngDrawSchema = z3.strictObject({
225
- index: z3.number().int().gte(0),
226
- cursorBefore: z3.number().int().gte(0),
227
- cursorAfter: z3.number().int().gte(0),
236
+ var RngOperationSchema = z4.strictObject({
237
+ kind: z4.string().min(1),
238
+ parameters: z4.record(z4.string(), RngOperationParameterSchema)
239
+ });
240
+ var RngDrawSchema = z4.strictObject({
241
+ index: z4.number().int().gte(0),
242
+ cursorBefore: z4.number().int().gte(0),
243
+ cursorAfter: z4.number().int().gte(0),
228
244
  operation: RngOperationSchema
229
245
  });
230
- var RngStateSchema = z3.strictObject({
231
- seed: z3.union([
232
- z3.number().refine(Number.isInteger, { message: "Expected integer" }),
233
- z3.null()
246
+ var RngStateSchema = z4.strictObject({
247
+ seed: z4.union([
248
+ z4.number().refine(Number.isInteger, { message: "Expected integer" }),
249
+ z4.null()
234
250
  ]),
235
- cursor: z3.number().int(),
236
- trace: z3.array(z3.string()),
237
- draws: z3.array(RngDrawSchema).optional()
238
- });
239
- var ReducerFlowStateSchema = z3.strictObject({
240
- currentPhase: z3.string().min(1),
241
- turn: z3.number().int(),
242
- round: z3.number().int(),
243
- activePlayers: z3.array(z3.string().min(1))
244
- });
245
- var RuntimeSimultaneousSubmissionSchema = z3.strictObject({
246
- interactionId: z3.string().min(1),
251
+ cursor: z4.number().int(),
252
+ trace: z4.array(z4.string()),
253
+ draws: z4.array(RngDrawSchema).optional()
254
+ });
255
+ var ReducerFlowStateSchema = z4.strictObject({
256
+ currentPhase: z4.string().min(1),
257
+ turn: z4.number().int(),
258
+ round: z4.number().int(),
259
+ activePlayers: z4.array(z4.string().min(1))
260
+ });
261
+ var RuntimeSimultaneousSubmissionSchema = z4.strictObject({
262
+ interactionId: z4.string().min(1),
247
263
  params: RuntimeJsonSchema
248
264
  });
249
- var RuntimeSimultaneousCurrentSchema = z3.strictObject({
250
- phaseName: z3.string().min(1),
251
- actors: z3.array(z3.string().min(1)),
252
- submissions: z3.record(z3.string(), RuntimeSimultaneousSubmissionSchema)
265
+ var RuntimeSimultaneousCurrentSchema = z4.strictObject({
266
+ phaseName: z4.string().min(1),
267
+ actors: z4.array(z4.string().min(1)),
268
+ submissions: z4.record(z4.string(), RuntimeSimultaneousSubmissionSchema)
253
269
  });
254
- var RuntimeSimultaneousStateSchema = z3.strictObject({
255
- current: z3.union([RuntimeSimultaneousCurrentSchema, z3.null()])
270
+ var RuntimeSimultaneousStateSchema = z4.strictObject({
271
+ current: z4.union([RuntimeSimultaneousCurrentSchema, z4.null()])
256
272
  });
257
- var TransitionRecordSchema = z3.strictObject({
258
- from: z3.string().min(1),
259
- to: z3.string().min(1)
273
+ var TransitionRecordSchema = z4.strictObject({
274
+ from: z4.string().min(1),
275
+ to: z4.string().min(1)
260
276
  });
261
- var RuntimePendingInteractionSchema = z3.strictObject({
262
- phaseName: z3.string().min(1),
263
- interactionId: z3.string().min(1),
264
- values: z3.array(RuntimeJsonSchema).min(1)
277
+ var RuntimePendingInteractionSchema = z4.strictObject({
278
+ phaseName: z4.string().min(1),
279
+ interactionId: z4.string().min(1),
280
+ values: z4.array(RuntimeJsonSchema).min(1)
265
281
  });
266
- var GameEventDetailSchema = z3.strictObject({
267
- label: z3.string().min(1),
268
- value: z3.union([z3.string(), z3.number().finite(), z3.boolean()])
282
+ var GameEventDetailSchema = z4.strictObject({
283
+ label: z4.string().min(1),
284
+ value: z4.union([z4.string(), z4.number().finite(), z4.boolean()])
269
285
  });
270
- var SystemActionEventSchema = z3.strictObject({
271
- kind: z3.literal("systemAction"),
272
- procedureId: z3.string().min(1),
273
- title: z3.string().min(1),
274
- summary: z3.string().min(1).optional(),
275
- details: z3.array(GameEventDetailSchema).max(16).optional()
286
+ var SystemActionEventSchema = z4.strictObject({
287
+ kind: z4.literal("systemAction"),
288
+ procedureId: z4.string().min(1),
289
+ title: z4.string().min(1),
290
+ summary: z4.string().min(1).optional(),
291
+ details: z4.array(GameEventDetailSchema).max(16).optional()
276
292
  });
277
- var GameEventSchema = z3.discriminatedUnion("kind", [
293
+ var GameEventSchema = z4.discriminatedUnion("kind", [
278
294
  SystemActionEventSchema
279
295
  ]);
280
- var ReducerRuntimeStateSchema = z3.strictObject({
281
- events: z3.array(GameEventSchema).max(32),
296
+ var ReducerRuntimeStateSchema = z4.strictObject({
297
+ events: z4.array(GameEventSchema).max(32),
282
298
  rng: RngStateSchema,
283
- pending: z3.record(z3.string(), RuntimePendingInteractionSchema),
299
+ pending: z4.record(z4.string(), RuntimePendingInteractionSchema),
284
300
  simultaneous: RuntimeSimultaneousStateSchema,
285
- lastTransition: z3.union([TransitionRecordSchema, z3.null()]),
286
- options: z3.record(z3.string(), RuntimeJsonSchema)
301
+ lastTransition: z4.union([TransitionRecordSchema, z4.null()]),
302
+ options: z4.record(z4.string(), RuntimeJsonSchema)
287
303
  });
288
- var ReducerDomainStateSchema = z3.strictObject({
304
+ var ReducerDomainStateSchema = z4.strictObject({
289
305
  table: RuntimeJsonSchema,
290
306
  publicState: RuntimeJsonSchema,
291
- privateState: z3.record(z3.string(), RuntimeJsonSchema),
307
+ privateState: z4.record(z4.string(), RuntimeJsonSchema),
292
308
  hiddenState: RuntimeJsonSchema,
293
309
  flow: ReducerFlowStateSchema,
294
310
  phase: RuntimeJsonSchema
295
311
  });
296
- var ReducerSessionStateSchema = z3.strictObject({
312
+ var ReducerSessionStateSchema = z4.strictObject({
297
313
  domain: ReducerDomainStateSchema,
298
314
  runtime: ReducerRuntimeStateSchema
299
315
  });
300
- var GameInputInteractionSchema = z3.strictObject({
301
- kind: z3.literal("interaction"),
302
- playerId: z3.string().min(1),
303
- interactionId: z3.string().min(1),
316
+ var GameInputInteractionSchema = z4.strictObject({
317
+ kind: z4.literal("interaction"),
318
+ playerId: z4.string().min(1),
319
+ interactionId: z4.string().min(1),
304
320
  params: RuntimeJsonSchema
305
321
  });
306
- var GameInputCancelSchema = z3.strictObject({
307
- kind: z3.literal("interaction.cancel"),
308
- playerId: z3.string().min(1),
309
- interactionId: z3.string().min(1)
322
+ var GameInputCancelSchema = z4.strictObject({
323
+ kind: z4.literal("interaction.cancel"),
324
+ playerId: z4.string().min(1),
325
+ interactionId: z4.string().min(1)
310
326
  });
311
- var GameInputSchema = z3.discriminatedUnion("kind", [
327
+ var GameInputSchema = z4.discriminatedUnion("kind", [
312
328
  GameInputInteractionSchema,
313
329
  GameInputCancelSchema
314
330
  ]);
315
- var GameOutcomeReasonSchema = z3.strictObject({
316
- code: z3.string().min(1),
317
- message: z3.string().min(1).optional()
331
+ var GameOutcomeReasonSchema = z4.strictObject({
332
+ code: z4.string().min(1),
333
+ message: z4.string().min(1).optional()
318
334
  });
319
- var OutcomeResultSchema = z3.enum([
335
+ var OutcomeResultSchema = z4.enum([
320
336
  "win",
321
337
  "draw",
322
338
  "loss",
323
339
  "eliminated"
324
340
  ]);
325
- var OutcomeScoreComponentSchema = z3.strictObject({
326
- id: z3.string().min(1),
327
- label: z3.string().min(1),
328
- value: z3.number().finite()
329
- });
330
- var OutcomeTieBreakSchema = z3.strictObject({
331
- id: z3.string().min(1),
332
- label: z3.string().min(1),
333
- value: z3.union([z3.number().finite(), z3.string()])
334
- });
335
- var OutcomeStandingSchema = z3.strictObject({
336
- playerId: z3.string().min(1),
337
- rank: z3.number().int().gte(1),
341
+ var OutcomeScoreComponentSchema = z4.strictObject({
342
+ id: z4.string().min(1),
343
+ label: z4.string().min(1),
344
+ value: z4.number().finite()
345
+ });
346
+ var OutcomeTieBreakSchema = z4.strictObject({
347
+ id: z4.string().min(1),
348
+ label: z4.string().min(1),
349
+ value: z4.union([z4.number().finite(), z4.string()])
350
+ });
351
+ var OutcomeStandingSchema = z4.strictObject({
352
+ playerId: z4.string().min(1),
353
+ rank: z4.number().int().gte(1),
338
354
  result: OutcomeResultSchema,
339
- score: z3.number().finite().optional(),
340
- scoreBreakdown: z3.array(OutcomeScoreComponentSchema).optional(),
341
- tieBreaks: z3.array(OutcomeTieBreakSchema).optional()
355
+ score: z4.number().finite().optional(),
356
+ scoreBreakdown: z4.array(OutcomeScoreComponentSchema).optional(),
357
+ tieBreaks: z4.array(OutcomeTieBreakSchema).optional()
342
358
  });
343
- var GameOutcomeSchema = z3.strictObject({
359
+ var GameOutcomeSchema = z4.strictObject({
344
360
  reason: GameOutcomeReasonSchema,
345
- standings: z3.array(OutcomeStandingSchema).min(1)
361
+ standings: z4.array(OutcomeStandingSchema).min(1)
346
362
  });
347
- var InitializeResultSchema = z3.strictObject({
363
+ var InitializeResultSchema = z4.strictObject({
348
364
  state: ReducerSessionStateSchema,
349
365
  terminal: GameOutcomeSchema.optional(),
350
- events: z3.array(GameEventSchema).optional()
366
+ events: z4.array(GameEventSchema).optional()
351
367
  });
352
- var InitializeRequestSchema = z3.strictObject({
368
+ var InitializeRequestSchema = z4.strictObject({
353
369
  table: RuntimeJsonSchema,
354
- playerIds: z3.array(z3.string().min(1)),
355
- rngSeed: z3.union([
356
- z3.number().refine(Number.isInteger, { message: "Expected integer" }),
357
- z3.null()
370
+ playerIds: z4.array(z4.string().min(1)),
371
+ rngSeed: z4.union([
372
+ z4.number().refine(Number.isInteger, { message: "Expected integer" }),
373
+ z4.null()
358
374
  ]).optional(),
359
- options: z3.record(z3.string(), RuntimeJsonSchema).optional()
375
+ options: z4.record(z4.string(), RuntimeJsonSchema).optional()
360
376
  });
361
- var DispatchRequestSchema = z3.strictObject({
377
+ var DispatchRequestSchema = z4.strictObject({
362
378
  state: ReducerSessionStateSchema,
363
379
  input: GameInputSchema
364
380
  });
365
- var DispatchTraceAcceptedClientInputSchema = z3.strictObject({
366
- kind: z3.literal("acceptedClientInput"),
381
+ var DispatchTraceAcceptedClientInputSchema = z4.strictObject({
382
+ kind: z4.literal("acceptedClientInput"),
367
383
  input: GameInputSchema
368
384
  });
369
- var DispatchTracePhaseEnteredSchema = z3.strictObject({
370
- kind: z3.literal("phaseEntered"),
371
- from: z3.string(),
372
- to: z3.string()
385
+ var DispatchTracePhaseEnteredSchema = z4.strictObject({
386
+ kind: z4.literal("phaseEntered"),
387
+ from: z4.string(),
388
+ to: z4.string()
373
389
  });
374
- var DispatchTraceRngConsumptionSchema = z3.strictObject({
375
- kind: z3.literal("rngConsumption"),
376
- version: z3.literal(2),
377
- operation: z3.string().min(1),
378
- drawIndex: z3.number().int().gte(0),
379
- traceEntry: z3.string()
390
+ var DispatchTraceRngConsumptionSchema = z4.strictObject({
391
+ kind: z4.literal("rngConsumption"),
392
+ version: z4.literal(2),
393
+ operation: z4.string().min(1),
394
+ drawIndex: z4.number().int().gte(0),
395
+ traceEntry: z4.string()
380
396
  });
381
- var DispatchTraceSchema = z3.discriminatedUnion("kind", [
397
+ var DispatchTraceSchema = z4.discriminatedUnion("kind", [
382
398
  DispatchTraceAcceptedClientInputSchema,
383
399
  DispatchTracePhaseEnteredSchema,
384
400
  DispatchTraceRngConsumptionSchema
385
401
  ]);
386
- var DispatchResultRejectSchema = z3.strictObject({
387
- kind: z3.literal("reject"),
388
- errorCode: z3.string().min(1),
389
- message: z3.string().optional()
402
+ var DispatchResultRejectSchema = z4.strictObject({
403
+ kind: z4.literal("reject"),
404
+ errorCode: z4.string().min(1),
405
+ message: z4.string().optional()
390
406
  });
391
- var DispatchResultAcceptSchema = z3.strictObject({
392
- kind: z3.literal("accept"),
407
+ var DispatchResultAcceptSchema = z4.strictObject({
408
+ kind: z4.literal("accept"),
393
409
  state: ReducerSessionStateSchema,
394
410
  terminal: GameOutcomeSchema.optional(),
395
- trace: z3.array(DispatchTraceSchema),
396
- events: z3.array(GameEventSchema).max(32)
411
+ trace: z4.array(DispatchTraceSchema),
412
+ events: z4.array(GameEventSchema).max(32)
397
413
  });
398
- var DispatchResultSchema = z3.discriminatedUnion("kind", [
414
+ var DispatchResultSchema = z4.discriminatedUnion("kind", [
399
415
  DispatchResultRejectSchema,
400
416
  DispatchResultAcceptSchema
401
417
  ]);
402
- var ReducerRuntimeLogEntryAcceptedClientInputSchema = z3.strictObject({
403
- kind: z3.literal("acceptedClientInput"),
404
- version: z3.number().int(),
418
+ var ReducerRuntimeLogEntryAcceptedClientInputSchema = z4.strictObject({
419
+ kind: z4.literal("acceptedClientInput"),
420
+ version: z4.number().int(),
405
421
  input: GameInputSchema
406
422
  });
407
- var ReducerRuntimeLogEntryPhaseEnteredSchema = z3.strictObject({
408
- kind: z3.literal("phaseEntered"),
409
- from: z3.string(),
410
- to: z3.string(),
411
- version: z3.number().int()
412
- });
413
- var ReducerRuntimeLogEntryRngConsumptionSchema = z3.strictObject({
414
- kind: z3.literal("rngConsumption"),
415
- version: z3.number().int(),
416
- operation: z3.string().min(1),
417
- drawIndex: z3.number().int().gte(0).optional(),
418
- traceEntry: z3.string()
419
- });
420
- var ReducerRuntimeLogEntryStateCommitSchema = z3.strictObject({
421
- kind: z3.literal("stateCommit"),
422
- version: z3.number().int(),
423
+ var ReducerRuntimeLogEntryPhaseEnteredSchema = z4.strictObject({
424
+ kind: z4.literal("phaseEntered"),
425
+ from: z4.string(),
426
+ to: z4.string(),
427
+ version: z4.number().int()
428
+ });
429
+ var ReducerRuntimeLogEntryRngConsumptionSchema = z4.strictObject({
430
+ kind: z4.literal("rngConsumption"),
431
+ version: z4.number().int(),
432
+ operation: z4.string().min(1),
433
+ drawIndex: z4.number().int().gte(0).optional(),
434
+ traceEntry: z4.string()
435
+ });
436
+ var ReducerRuntimeLogEntryStateCommitSchema = z4.strictObject({
437
+ kind: z4.literal("stateCommit"),
438
+ version: z4.number().int(),
423
439
  state: ReducerSessionStateSchema
424
440
  });
425
- var ReducerRuntimeLogEntrySchema = z3.discriminatedUnion("kind", [
441
+ var ReducerRuntimeLogEntrySchema = z4.discriminatedUnion("kind", [
426
442
  ReducerRuntimeLogEntryAcceptedClientInputSchema,
427
443
  ReducerRuntimeLogEntryPhaseEnteredSchema,
428
444
  ReducerRuntimeLogEntryRngConsumptionSchema,
429
445
  ReducerRuntimeLogEntryStateCommitSchema
430
446
  ]);
431
- var AuthoredViewSchema = z3.object({
432
- boards: z3.never({
447
+ var AuthoredViewSchema = z4.object({
448
+ boards: z4.never({
433
449
  error: "The view field 'boards' is reserved for manifest geometry."
434
450
  }).optional()
435
451
  }).catchall(RuntimeJsonSchema);
436
- var SeatProjectionSchema = z3.strictObject({
452
+ var SeatProjectionSchema = z4.strictObject({
437
453
  view: AuthoredViewSchema.nullable().optional(),
438
- availableInteractionRefs: z3.array(z3.string()).optional(),
439
- zones: z3.record(z3.string(), ZoneInteractionRefsSchema).optional(),
454
+ availableInteractionRefs: z4.array(z4.string()).optional(),
455
+ zones: z4.record(z4.string(), ZoneInteractionRefsSchema).optional(),
440
456
  /** Resource balances by player that this seat may see. */
441
- resources: z3.record(z3.string(), z3.record(z3.string(), z3.number().int())).optional()
442
- });
443
- var SimultaneousPhaseProjectionSchema = z3.strictObject({
444
- phaseName: z3.string().min(1),
445
- interactionId: z3.string().min(1),
446
- actorIds: z3.array(z3.string().min(1)),
447
- sealedPlayerIds: z3.array(z3.string().min(1)),
448
- pendingPlayerIds: z3.array(z3.string().min(1))
449
- });
450
- var SchedulerContinuationDependencySchema = z3.strictObject({
451
- waiterPlayerId: z3.string().min(1),
452
- blockerPlayerIds: z3.array(z3.string().min(1))
453
- });
454
- var SchedulerFlowAuthorityProjectionSchema = z3.strictObject({
455
- version: z3.literal(1),
456
- activePlayerIds: z3.array(z3.string().min(1)),
457
- pendingPlayerIds: z3.array(z3.string().min(1)),
458
- continuationDependencies: z3.array(SchedulerContinuationDependencySchema)
459
- });
460
- var ProjectionTimingMetadataSchema = z3.strictObject({
461
- resolveAvailableInteractionsMs: z3.number().finite().gte(0),
462
- resolveViewMs: z3.number().finite().gte(0),
463
- resolveZoneHandlesMs: z3.number().finite().gte(0),
464
- descriptorHashMs: z3.number().finite().gte(0)
465
- });
466
- var SeatProjectionBundleSchema = z3.strictObject({
467
- events: z3.array(GameEventSchema).max(32),
468
- simultaneousPhase: z3.union([SimultaneousPhaseProjectionSchema, z3.null()]).optional(),
457
+ resources: z4.record(z4.string(), z4.record(z4.string(), z4.number().int())).optional()
458
+ });
459
+ var SimultaneousPhaseProjectionSchema = z4.strictObject({
460
+ phaseName: z4.string().min(1),
461
+ interactionId: z4.string().min(1),
462
+ actorIds: z4.array(z4.string().min(1)),
463
+ sealedPlayerIds: z4.array(z4.string().min(1)),
464
+ pendingPlayerIds: z4.array(z4.string().min(1))
465
+ });
466
+ var SchedulerContinuationDependencySchema = z4.strictObject({
467
+ waiterPlayerId: z4.string().min(1),
468
+ blockerPlayerIds: z4.array(z4.string().min(1))
469
+ });
470
+ var SchedulerFlowAuthorityProjectionSchema = z4.strictObject({
471
+ version: z4.literal(1),
472
+ activePlayerIds: z4.array(z4.string().min(1)),
473
+ pendingPlayerIds: z4.array(z4.string().min(1)),
474
+ continuationDependencies: z4.array(SchedulerContinuationDependencySchema)
475
+ });
476
+ var ProjectionTimingMetadataSchema = z4.strictObject({
477
+ resolveAvailableInteractionsMs: z4.number().finite().gte(0),
478
+ resolveViewMs: z4.number().finite().gte(0),
479
+ resolveZoneHandlesMs: z4.number().finite().gte(0),
480
+ descriptorHashMs: z4.number().finite().gte(0)
481
+ });
482
+ var SeatProjectionBundleSchema = z4.strictObject({
483
+ events: z4.array(GameEventSchema).max(32),
484
+ simultaneousPhase: z4.union([SimultaneousPhaseProjectionSchema, z4.null()]).optional(),
469
485
  schedulerFlow: SchedulerFlowAuthorityProjectionSchema.optional(),
470
- interactionsByRef: z3.record(z3.string(), InteractionDescriptorSchema).optional(),
471
- seats: z3.record(z3.string(), SeatProjectionSchema),
486
+ interactionsByRef: z4.record(z4.string(), InteractionDescriptorSchema).optional(),
487
+ seats: z4.record(z4.string(), SeatProjectionSchema),
472
488
  timing: ProjectionTimingMetadataSchema.optional()
473
489
  });
474
- var ProjectRequestSchema = z3.strictObject({
490
+ var ProjectRequestSchema = z4.strictObject({
475
491
  state: ReducerSessionStateSchema,
476
- playerIds: z3.array(z3.string().min(1))
492
+ playerIds: z4.array(z4.string().min(1))
477
493
  });
478
- var BoardStaticProjectionSchema = z3.strictObject({
479
- view: z3.record(z3.string(), RuntimeJsonSchema),
480
- hash: z3.string().min(1),
481
- manifestVersion: z3.string()
494
+ var BoardStaticProjectionSchema = z4.strictObject({
495
+ view: z4.record(z4.string(), RuntimeJsonSchema),
496
+ hash: z4.string().min(1),
497
+ manifestVersion: z4.string()
482
498
  });
483
499
 
484
500
  // src/shared/hex-board.ts
@@ -818,6 +834,7 @@ function sha256Hex(input) {
818
834
 
819
835
  export {
820
836
  RuntimeJsonSchema,
837
+ ViewCardSchema,
821
838
  InteractionCommitPolicySchema,
822
839
  InputDomainSchema,
823
840
  InteractionInputDescriptorSchema,
@@ -845,4 +862,4 @@ export {
845
862
  encodeCanonicalPluginRuntimeJson,
846
863
  digestPluginRuntimeJson
847
864
  };
848
- //# sourceMappingURL=chunk-K75F5UIJ.js.map
865
+ //# sourceMappingURL=chunk-FUYMFUXO.js.map