@dreamboard-games/sdk 0.5.0-alpha.2 → 0.5.0-alpha.4

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 (151) hide show
  1. package/README.md +186 -45
  2. package/dist/board-target-B0QG6OYx.d.ts +8 -0
  3. package/dist/chunk-3JXUL4VN.js +139 -0
  4. package/dist/chunk-3JXUL4VN.js.map +1 -0
  5. package/dist/{chunk-S2JEDVWH.js → chunk-C77SYIVT.js} +6102 -6505
  6. package/dist/chunk-C77SYIVT.js.map +1 -0
  7. package/dist/chunk-DMFVAZI2.js +16 -0
  8. package/dist/chunk-DMFVAZI2.js.map +1 -0
  9. package/dist/chunk-OOFMBCFF.js +1338 -0
  10. package/dist/chunk-OOFMBCFF.js.map +1 -0
  11. package/dist/chunk-UG2Q4NLG.js +590 -0
  12. package/dist/chunk-UG2Q4NLG.js.map +1 -0
  13. package/dist/chunk-XU6WJW6K.js +847 -0
  14. package/dist/chunk-XU6WJW6K.js.map +1 -0
  15. package/dist/diagnostics-B8d5aLad.d.ts +65 -0
  16. package/dist/extract-gVKcB8Og.d.ts +4736 -0
  17. package/dist/index.d.ts +3782 -1
  18. package/dist/index.js +1096 -6
  19. package/dist/index.js.map +1 -1
  20. package/dist/model-vdpLHrxh.d.ts +432 -0
  21. package/dist/react.d.ts +60 -0
  22. package/dist/react.js +208 -0
  23. package/dist/react.js.map +1 -0
  24. package/dist/reducer.d.ts +1244 -78
  25. package/dist/reducer.js +4204 -121
  26. package/dist/reducer.js.map +1 -1
  27. package/dist/testing.d.ts +520 -564
  28. package/dist/testing.js +2451 -915
  29. package/dist/testing.js.map +1 -1
  30. package/dist/types-Bj5ZLTUV.d.ts +114 -0
  31. package/package.json +40 -142
  32. package/dist/HandView-Bi2lxzQP.d.ts +0 -79
  33. package/dist/ResourceCounter-BFxJknqp.d.ts +0 -98
  34. package/dist/ThemeProvider-CElaL2ik.d.ts +0 -99
  35. package/dist/attributes-DbvyMbXw.d.ts +0 -68
  36. package/dist/browser-interaction.d.ts +0 -910
  37. package/dist/browser-interaction.js +0 -119
  38. package/dist/browser-interaction.js.map +0 -1
  39. package/dist/chunk-32PFKDV7.js +0 -11705
  40. package/dist/chunk-32PFKDV7.js.map +0 -1
  41. package/dist/chunk-3BAD4VC2.js +0 -263
  42. package/dist/chunk-3BAD4VC2.js.map +0 -1
  43. package/dist/chunk-3SKDNDPG.js +0 -104
  44. package/dist/chunk-3SKDNDPG.js.map +0 -1
  45. package/dist/chunk-5YV2WHJ4.js +0 -25
  46. package/dist/chunk-5YV2WHJ4.js.map +0 -1
  47. package/dist/chunk-ANRB4XKA.js +0 -90
  48. package/dist/chunk-ANRB4XKA.js.map +0 -1
  49. package/dist/chunk-BI4G3PM2.js +0 -1864
  50. package/dist/chunk-BI4G3PM2.js.map +0 -1
  51. package/dist/chunk-EVCLTY4Q.js +0 -935
  52. package/dist/chunk-EVCLTY4Q.js.map +0 -1
  53. package/dist/chunk-GDPKTBUR.js +0 -564
  54. package/dist/chunk-GDPKTBUR.js.map +0 -1
  55. package/dist/chunk-H6VDGFL5.js +0 -2903
  56. package/dist/chunk-H6VDGFL5.js.map +0 -1
  57. package/dist/chunk-LR3ZTWQF.js +0 -5960
  58. package/dist/chunk-LR3ZTWQF.js.map +0 -1
  59. package/dist/chunk-PF7L4BMG.js +0 -117
  60. package/dist/chunk-PF7L4BMG.js.map +0 -1
  61. package/dist/chunk-PN5O6GG2.js +0 -32
  62. package/dist/chunk-PN5O6GG2.js.map +0 -1
  63. package/dist/chunk-PZ5AY32C.js +0 -10
  64. package/dist/chunk-PZ5AY32C.js.map +0 -1
  65. package/dist/chunk-S2JEDVWH.js.map +0 -1
  66. package/dist/chunk-T3ZKNUZ7.js +0 -1
  67. package/dist/chunk-T3ZKNUZ7.js.map +0 -1
  68. package/dist/chunk-UGH54WZ2.js +0 -223
  69. package/dist/chunk-UGH54WZ2.js.map +0 -1
  70. package/dist/chunk-VCDWP5VL.js +0 -746
  71. package/dist/chunk-VCDWP5VL.js.map +0 -1
  72. package/dist/chunk-VDXOF4FW.js +0 -69
  73. package/dist/chunk-VDXOF4FW.js.map +0 -1
  74. package/dist/chunk-WHR5UW3F.js +0 -1988
  75. package/dist/chunk-WHR5UW3F.js.map +0 -1
  76. package/dist/chunk-Y75CFE77.js +0 -17
  77. package/dist/chunk-Y75CFE77.js.map +0 -1
  78. package/dist/chunk-Z7QCREWI.js +0 -3435
  79. package/dist/chunk-Z7QCREWI.js.map +0 -1
  80. package/dist/chunk-ZZGN2ATS.js +0 -1941
  81. package/dist/chunk-ZZGN2ATS.js.map +0 -1
  82. package/dist/components-gAbIz7hK.d.ts +0 -1284
  83. package/dist/definitions-BgmV_GhC.d.ts +0 -300
  84. package/dist/diagnostics-DIi3ina7.d.ts +0 -50
  85. package/dist/digest.d.ts +0 -8
  86. package/dist/game-CsZScpcn.d.ts +0 -763
  87. package/dist/hex-board-view-aKkblDp6.d.ts +0 -1228
  88. package/dist/index-CcT9Q7N7.d.ts +0 -193
  89. package/dist/index.d-DjzoK7zn.d.ts +0 -2101
  90. package/dist/package-set.d.ts +0 -13
  91. package/dist/package-set.js +0 -12
  92. package/dist/package-set.js.map +0 -1
  93. package/dist/player-state-Cqpyeql0.d.ts +0 -371
  94. package/dist/plugin-runtime-contract.d.ts +0 -17
  95. package/dist/plugin-runtime-contract.js +0 -92
  96. package/dist/plugin-runtime-contract.js.map +0 -1
  97. package/dist/primitive-props-BNHDkgd7.d.ts +0 -16
  98. package/dist/protocol-dYgafTYY.d.ts +0 -314
  99. package/dist/reducer/advanced.d.ts +0 -82
  100. package/dist/reducer/advanced.js +0 -51
  101. package/dist/reducer/advanced.js.map +0 -1
  102. package/dist/reducer-contract.d.ts +0 -11
  103. package/dist/reducer-contract.js +0 -16
  104. package/dist/reducer-contract.js.map +0 -1
  105. package/dist/reference-games/index.d.ts +0 -31
  106. package/dist/reference-games/index.js +0 -48
  107. package/dist/reference-games/index.js.map +0 -1
  108. package/dist/runtime/primitives.d.ts +0 -250
  109. package/dist/runtime/primitives.js +0 -189
  110. package/dist/runtime/primitives.js.map +0 -1
  111. package/dist/runtime/runtime-api.d.ts +0 -2
  112. package/dist/runtime/runtime-api.js +0 -1
  113. package/dist/runtime/runtime-api.js.map +0 -1
  114. package/dist/runtime/workspace-contract.d.ts +0 -392
  115. package/dist/runtime/workspace-contract.js +0 -28
  116. package/dist/runtime/workspace-contract.js.map +0 -1
  117. package/dist/runtime-RJ5orDJU.d.ts +0 -1699
  118. package/dist/runtime-api-Bz5pwNU_.d.ts +0 -296
  119. package/dist/runtime-json-CQ9QbLZ5.d.ts +0 -5
  120. package/dist/runtime.d.ts +0 -83
  121. package/dist/runtime.js +0 -242
  122. package/dist/runtime.js.map +0 -1
  123. package/dist/schema.d.ts +0 -379
  124. package/dist/stale-contract-artifact-error-XLaweZtF.d.ts +0 -18
  125. package/dist/testing-compiler.d.ts +0 -37
  126. package/dist/testing-compiler.js +0 -272
  127. package/dist/testing-compiler.js.map +0 -1
  128. package/dist/testing-runtime.d.ts +0 -119
  129. package/dist/testing-runtime.js +0 -212
  130. package/dist/testing-runtime.js.map +0 -1
  131. package/dist/types-DJj5MJkl.d.ts +0 -256
  132. package/dist/types-DR7DoB1x.d.ts +0 -28
  133. package/dist/types-JWCYHmu7.d.ts +0 -122
  134. package/dist/types.d.ts +0 -1958
  135. package/dist/types.js +0 -14
  136. package/dist/types.js.map +0 -1
  137. package/dist/ui/components.d.ts +0 -17
  138. package/dist/ui/components.js +0 -216
  139. package/dist/ui/components.js.map +0 -1
  140. package/dist/ui/defaults.d.ts +0 -19
  141. package/dist/ui/defaults.js +0 -104
  142. package/dist/ui/defaults.js.map +0 -1
  143. package/dist/ui/player-state.d.ts +0 -2
  144. package/dist/ui/player-state.js +0 -1
  145. package/dist/ui/player-state.js.map +0 -1
  146. package/dist/ui/plugin-styles.css +0 -2
  147. package/dist/ui-contract-GTUPkf8z.d.ts +0 -1168
  148. package/dist/ui.d.ts +0 -317
  149. package/dist/ui.js +0 -277
  150. package/dist/ui.js.map +0 -1
  151. package/dist/views-BpuWcOyN.d.ts +0 -1641
@@ -0,0 +1,847 @@
1
+ import {
2
+ PlayerBoardSpaceTargetSchema,
3
+ __export
4
+ } from "./chunk-3JXUL4VN.js";
5
+
6
+ // src/shared/runtime-json.ts
7
+ import { z } from "zod";
8
+ var RuntimeJsonSchema = z.json();
9
+
10
+ // 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()
15
+ ]);
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()
23
+ }).strict()
24
+ ]);
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()
33
+ }).strict();
34
+ 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()),
42
+ ...selection
43
+ }),
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()),
52
+ ...selection
53
+ }),
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),
61
+ ...selection
62
+ })
63
+ ]),
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()
73
+ })
74
+ ),
75
+ ...selection
76
+ }),
77
+ z2.strictObject({
78
+ type: z2.literal("boundedNumber"),
79
+ min: z2.number(),
80
+ max: z2.number(),
81
+ step: z2.number().optional(),
82
+ ...selection
83
+ }),
84
+ z2.strictObject({
85
+ type: z2.literal("choice"),
86
+ choices: z2.array(InteractionChoiceOptionSchema),
87
+ ...selection
88
+ }),
89
+ z2.strictObject({
90
+ type: z2.literal("choiceList"),
91
+ choices: z2.array(
92
+ InteractionChoiceOptionSchema.extend({ value: z2.string() })
93
+ ),
94
+ min: z2.number().int().optional(),
95
+ max: z2.number().int().optional(),
96
+ ...selection
97
+ })
98
+ ]);
99
+ var InteractionInputDescriptorSchema = z2.object({
100
+ key: z2.string().min(1),
101
+ kind: z2.enum([
102
+ "form",
103
+ "board-vertex",
104
+ "board-edge",
105
+ "board-tile",
106
+ "board-space",
107
+ "card",
108
+ "rng"
109
+ ]),
110
+ domain: InputDomainSchema,
111
+ defaultValue: RuntimeJsonSchema.optional()
112
+ }).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()
120
+ }).strict()
121
+ ]);
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(),
130
+ 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()
140
+ }).strict().optional(),
141
+ availability: InteractionAvailabilitySchema,
142
+ reasons: z2.array(
143
+ z2.object({
144
+ ruleId: z2.string(),
145
+ errorCode: z2.string()
146
+ }).strict()
147
+ ).optional()
148
+ }).strict();
149
+ var InteractionDescriptorSchema = InteractionBaseSchema.extend({
150
+ kind: z2.literal("action")
151
+ }).strict();
152
+ var ZoneInteractionRefsSchema = z2.strictObject({
153
+ cardIds: z2.array(z2.string()),
154
+ cardViewsById: z2.record(z2.string(), z2.string()),
155
+ playableByCardId: z2.record(z2.string(), z2.array(z2.string()))
156
+ });
157
+
158
+ // src/shared/runtime-schema.ts
159
+ var runtime_schema_exports = {};
160
+ __export(runtime_schema_exports, {
161
+ AuthoredViewSchema: () => AuthoredViewSchema,
162
+ BoardStaticProjectionSchema: () => BoardStaticProjectionSchema,
163
+ DispatchRequestSchema: () => DispatchRequestSchema,
164
+ DispatchResultAcceptSchema: () => DispatchResultAcceptSchema,
165
+ DispatchResultRejectSchema: () => DispatchResultRejectSchema,
166
+ DispatchResultSchema: () => DispatchResultSchema,
167
+ DispatchTraceAcceptedClientInputSchema: () => DispatchTraceAcceptedClientInputSchema,
168
+ DispatchTracePhaseEnteredSchema: () => DispatchTracePhaseEnteredSchema,
169
+ DispatchTraceRngConsumptionSchema: () => DispatchTraceRngConsumptionSchema,
170
+ DispatchTraceSchema: () => DispatchTraceSchema,
171
+ GameEventDetailSchema: () => GameEventDetailSchema,
172
+ GameEventSchema: () => GameEventSchema,
173
+ GameInputCancelSchema: () => GameInputCancelSchema,
174
+ GameInputInteractionSchema: () => GameInputInteractionSchema,
175
+ GameInputSchema: () => GameInputSchema,
176
+ GameOutcomeReasonSchema: () => GameOutcomeReasonSchema,
177
+ GameOutcomeSchema: () => GameOutcomeSchema,
178
+ InitializeRequestSchema: () => InitializeRequestSchema,
179
+ InitializeResultSchema: () => InitializeResultSchema,
180
+ OutcomeResultSchema: () => OutcomeResultSchema,
181
+ OutcomeScoreComponentSchema: () => OutcomeScoreComponentSchema,
182
+ OutcomeStandingSchema: () => OutcomeStandingSchema,
183
+ OutcomeTieBreakSchema: () => OutcomeTieBreakSchema,
184
+ ProjectRequestSchema: () => ProjectRequestSchema,
185
+ ProjectionTimingMetadataSchema: () => ProjectionTimingMetadataSchema,
186
+ ReducerContractVersionSchema: () => ReducerContractVersionSchema,
187
+ ReducerDomainStateSchema: () => ReducerDomainStateSchema,
188
+ ReducerFlowStateSchema: () => ReducerFlowStateSchema,
189
+ ReducerRuntimeLogEntryAcceptedClientInputSchema: () => ReducerRuntimeLogEntryAcceptedClientInputSchema,
190
+ ReducerRuntimeLogEntryPhaseEnteredSchema: () => ReducerRuntimeLogEntryPhaseEnteredSchema,
191
+ ReducerRuntimeLogEntryRngConsumptionSchema: () => ReducerRuntimeLogEntryRngConsumptionSchema,
192
+ ReducerRuntimeLogEntrySchema: () => ReducerRuntimeLogEntrySchema,
193
+ ReducerRuntimeLogEntryStateCommitSchema: () => ReducerRuntimeLogEntryStateCommitSchema,
194
+ ReducerRuntimeStateSchema: () => ReducerRuntimeStateSchema,
195
+ ReducerSessionStateSchema: () => ReducerSessionStateSchema,
196
+ RngDrawSchema: () => RngDrawSchema,
197
+ RngOperationParameterSchema: () => RngOperationParameterSchema,
198
+ RngOperationSchema: () => RngOperationSchema,
199
+ RngStateSchema: () => RngStateSchema,
200
+ RuntimePendingInteractionSchema: () => RuntimePendingInteractionSchema,
201
+ RuntimeSimultaneousCurrentSchema: () => RuntimeSimultaneousCurrentSchema,
202
+ RuntimeSimultaneousStateSchema: () => RuntimeSimultaneousStateSchema,
203
+ RuntimeSimultaneousSubmissionSchema: () => RuntimeSimultaneousSubmissionSchema,
204
+ SchedulerContinuationDependencySchema: () => SchedulerContinuationDependencySchema,
205
+ SchedulerFlowAuthorityProjectionSchema: () => SchedulerFlowAuthorityProjectionSchema,
206
+ SeatProjectionBundleSchema: () => SeatProjectionBundleSchema,
207
+ SeatProjectionSchema: () => SeatProjectionSchema,
208
+ SimultaneousPhaseProjectionSchema: () => SimultaneousPhaseProjectionSchema,
209
+ SystemActionEventSchema: () => SystemActionEventSchema,
210
+ TransitionRecordSchema: () => TransitionRecordSchema
211
+ });
212
+ import { z as z3 } from "zod";
213
+ var ReducerContractVersionSchema = z3.string().regex(new RegExp("^[0-9]+\\.[0-9]+\\.[0-9]+$"));
214
+ var RngOperationParameterSchema = z3.union([
215
+ z3.string(),
216
+ z3.number().finite(),
217
+ z3.boolean()
218
+ ]);
219
+ var RngOperationSchema = z3.strictObject({
220
+ kind: z3.string().min(1),
221
+ parameters: z3.record(z3.string(), RngOperationParameterSchema)
222
+ });
223
+ var RngDrawSchema = z3.strictObject({
224
+ index: z3.number().int().gte(0),
225
+ cursorBefore: z3.number().int().gte(0),
226
+ cursorAfter: z3.number().int().gte(0),
227
+ operation: RngOperationSchema
228
+ });
229
+ var RngStateSchema = z3.strictObject({
230
+ seed: z3.union([
231
+ z3.number().refine(Number.isInteger, { message: "Expected integer" }),
232
+ z3.null()
233
+ ]),
234
+ cursor: z3.number().int(),
235
+ trace: z3.array(z3.string()),
236
+ draws: z3.array(RngDrawSchema).optional()
237
+ });
238
+ var ReducerFlowStateSchema = z3.strictObject({
239
+ currentPhase: z3.string().min(1),
240
+ turn: z3.number().int(),
241
+ round: z3.number().int(),
242
+ activePlayers: z3.array(z3.string().min(1))
243
+ });
244
+ var RuntimeSimultaneousSubmissionSchema = z3.strictObject({
245
+ interactionId: z3.string().min(1),
246
+ params: RuntimeJsonSchema
247
+ });
248
+ var RuntimeSimultaneousCurrentSchema = z3.strictObject({
249
+ phaseName: z3.string().min(1),
250
+ actors: z3.array(z3.string().min(1)),
251
+ submissions: z3.record(z3.string(), RuntimeSimultaneousSubmissionSchema)
252
+ });
253
+ var RuntimeSimultaneousStateSchema = z3.strictObject({
254
+ current: z3.union([RuntimeSimultaneousCurrentSchema, z3.null()])
255
+ });
256
+ var TransitionRecordSchema = z3.strictObject({
257
+ from: z3.string().min(1),
258
+ to: z3.string().min(1)
259
+ });
260
+ var RuntimePendingInteractionSchema = z3.strictObject({
261
+ phaseName: z3.string().min(1),
262
+ interactionId: z3.string().min(1),
263
+ values: z3.array(RuntimeJsonSchema).min(1)
264
+ });
265
+ var GameEventDetailSchema = z3.strictObject({
266
+ label: z3.string().min(1),
267
+ value: z3.union([z3.string(), z3.number().finite(), z3.boolean()])
268
+ });
269
+ var SystemActionEventSchema = z3.strictObject({
270
+ kind: z3.literal("systemAction"),
271
+ procedureId: z3.string().min(1),
272
+ title: z3.string().min(1),
273
+ summary: z3.string().min(1).optional(),
274
+ details: z3.array(GameEventDetailSchema).max(16).optional()
275
+ });
276
+ var GameEventSchema = z3.discriminatedUnion("kind", [
277
+ SystemActionEventSchema
278
+ ]);
279
+ var ReducerRuntimeStateSchema = z3.strictObject({
280
+ events: z3.array(GameEventSchema).max(32),
281
+ rng: RngStateSchema,
282
+ pending: z3.record(z3.string(), RuntimePendingInteractionSchema),
283
+ simultaneous: RuntimeSimultaneousStateSchema,
284
+ lastTransition: z3.union([TransitionRecordSchema, z3.null()]),
285
+ options: z3.record(z3.string(), RuntimeJsonSchema)
286
+ });
287
+ var ReducerDomainStateSchema = z3.strictObject({
288
+ table: RuntimeJsonSchema,
289
+ publicState: RuntimeJsonSchema,
290
+ privateState: z3.record(z3.string(), RuntimeJsonSchema),
291
+ hiddenState: RuntimeJsonSchema,
292
+ flow: ReducerFlowStateSchema,
293
+ phase: RuntimeJsonSchema
294
+ });
295
+ var ReducerSessionStateSchema = z3.strictObject({
296
+ domain: ReducerDomainStateSchema,
297
+ runtime: ReducerRuntimeStateSchema
298
+ });
299
+ var GameInputInteractionSchema = z3.strictObject({
300
+ kind: z3.literal("interaction"),
301
+ playerId: z3.string().min(1),
302
+ interactionId: z3.string().min(1),
303
+ params: RuntimeJsonSchema
304
+ });
305
+ var GameInputCancelSchema = z3.strictObject({
306
+ kind: z3.literal("interaction.cancel"),
307
+ playerId: z3.string().min(1),
308
+ interactionId: z3.string().min(1)
309
+ });
310
+ var GameInputSchema = z3.discriminatedUnion("kind", [
311
+ GameInputInteractionSchema,
312
+ GameInputCancelSchema
313
+ ]);
314
+ var GameOutcomeReasonSchema = z3.strictObject({
315
+ code: z3.string().min(1),
316
+ message: z3.string().min(1).optional()
317
+ });
318
+ var OutcomeResultSchema = z3.enum([
319
+ "win",
320
+ "draw",
321
+ "loss",
322
+ "eliminated"
323
+ ]);
324
+ var OutcomeScoreComponentSchema = z3.strictObject({
325
+ id: z3.string().min(1),
326
+ label: z3.string().min(1),
327
+ value: z3.number().finite()
328
+ });
329
+ var OutcomeTieBreakSchema = z3.strictObject({
330
+ id: z3.string().min(1),
331
+ label: z3.string().min(1),
332
+ value: z3.union([z3.number().finite(), z3.string()])
333
+ });
334
+ var OutcomeStandingSchema = z3.strictObject({
335
+ playerId: z3.string().min(1),
336
+ rank: z3.number().int().gte(1),
337
+ result: OutcomeResultSchema,
338
+ score: z3.number().finite().optional(),
339
+ scoreBreakdown: z3.array(OutcomeScoreComponentSchema).optional(),
340
+ tieBreaks: z3.array(OutcomeTieBreakSchema).optional()
341
+ });
342
+ var GameOutcomeSchema = z3.strictObject({
343
+ reason: GameOutcomeReasonSchema,
344
+ standings: z3.array(OutcomeStandingSchema).min(1)
345
+ });
346
+ var InitializeResultSchema = z3.strictObject({
347
+ state: ReducerSessionStateSchema,
348
+ terminal: GameOutcomeSchema.optional(),
349
+ events: z3.array(GameEventSchema).optional()
350
+ });
351
+ var InitializeRequestSchema = z3.strictObject({
352
+ table: RuntimeJsonSchema,
353
+ playerIds: z3.array(z3.string().min(1)),
354
+ rngSeed: z3.union([
355
+ z3.number().refine(Number.isInteger, { message: "Expected integer" }),
356
+ z3.null()
357
+ ]).optional(),
358
+ options: z3.record(z3.string(), RuntimeJsonSchema).optional()
359
+ });
360
+ var DispatchRequestSchema = z3.strictObject({
361
+ state: ReducerSessionStateSchema,
362
+ input: GameInputSchema
363
+ });
364
+ var DispatchTraceAcceptedClientInputSchema = z3.strictObject({
365
+ kind: z3.literal("acceptedClientInput"),
366
+ input: GameInputSchema
367
+ });
368
+ var DispatchTracePhaseEnteredSchema = z3.strictObject({
369
+ kind: z3.literal("phaseEntered"),
370
+ from: z3.string(),
371
+ to: z3.string()
372
+ });
373
+ var DispatchTraceRngConsumptionSchema = z3.strictObject({
374
+ kind: z3.literal("rngConsumption"),
375
+ version: z3.literal(2),
376
+ operation: z3.string().min(1),
377
+ drawIndex: z3.number().int().gte(0),
378
+ traceEntry: z3.string()
379
+ });
380
+ var DispatchTraceSchema = z3.discriminatedUnion("kind", [
381
+ DispatchTraceAcceptedClientInputSchema,
382
+ DispatchTracePhaseEnteredSchema,
383
+ DispatchTraceRngConsumptionSchema
384
+ ]);
385
+ var DispatchResultRejectSchema = z3.strictObject({
386
+ kind: z3.literal("reject"),
387
+ errorCode: z3.string().min(1),
388
+ message: z3.string().optional()
389
+ });
390
+ var DispatchResultAcceptSchema = z3.strictObject({
391
+ kind: z3.literal("accept"),
392
+ state: ReducerSessionStateSchema,
393
+ terminal: GameOutcomeSchema.optional(),
394
+ trace: z3.array(DispatchTraceSchema),
395
+ events: z3.array(GameEventSchema).max(32)
396
+ });
397
+ var DispatchResultSchema = z3.discriminatedUnion("kind", [
398
+ DispatchResultRejectSchema,
399
+ DispatchResultAcceptSchema
400
+ ]);
401
+ var ReducerRuntimeLogEntryAcceptedClientInputSchema = z3.strictObject({
402
+ kind: z3.literal("acceptedClientInput"),
403
+ version: z3.number().int(),
404
+ input: GameInputSchema
405
+ });
406
+ var ReducerRuntimeLogEntryPhaseEnteredSchema = z3.strictObject({
407
+ kind: z3.literal("phaseEntered"),
408
+ from: z3.string(),
409
+ to: z3.string(),
410
+ version: z3.number().int()
411
+ });
412
+ var ReducerRuntimeLogEntryRngConsumptionSchema = z3.strictObject({
413
+ kind: z3.literal("rngConsumption"),
414
+ version: z3.number().int(),
415
+ operation: z3.string().min(1),
416
+ drawIndex: z3.number().int().gte(0).optional(),
417
+ traceEntry: z3.string()
418
+ });
419
+ var ReducerRuntimeLogEntryStateCommitSchema = z3.strictObject({
420
+ kind: z3.literal("stateCommit"),
421
+ version: z3.number().int(),
422
+ state: ReducerSessionStateSchema
423
+ });
424
+ var ReducerRuntimeLogEntrySchema = z3.discriminatedUnion("kind", [
425
+ ReducerRuntimeLogEntryAcceptedClientInputSchema,
426
+ ReducerRuntimeLogEntryPhaseEnteredSchema,
427
+ ReducerRuntimeLogEntryRngConsumptionSchema,
428
+ ReducerRuntimeLogEntryStateCommitSchema
429
+ ]);
430
+ var AuthoredViewSchema = z3.object({
431
+ boards: z3.never({
432
+ error: "The view field 'boards' is reserved for manifest geometry."
433
+ }).optional()
434
+ }).catchall(RuntimeJsonSchema);
435
+ var SeatProjectionSchema = z3.strictObject({
436
+ view: AuthoredViewSchema.nullable().optional(),
437
+ availableInteractionRefs: z3.array(z3.string()).optional(),
438
+ zones: z3.record(z3.string(), ZoneInteractionRefsSchema).optional(),
439
+ /** Resource balances by player that this seat may see. */
440
+ resources: z3.record(z3.string(), z3.record(z3.string(), z3.number().int())).optional()
441
+ });
442
+ var SimultaneousPhaseProjectionSchema = z3.strictObject({
443
+ phaseName: z3.string().min(1),
444
+ interactionId: z3.string().min(1),
445
+ actorIds: z3.array(z3.string().min(1)),
446
+ sealedPlayerIds: z3.array(z3.string().min(1)),
447
+ pendingPlayerIds: z3.array(z3.string().min(1))
448
+ });
449
+ var SchedulerContinuationDependencySchema = z3.strictObject({
450
+ waiterPlayerId: z3.string().min(1),
451
+ blockerPlayerIds: z3.array(z3.string().min(1))
452
+ });
453
+ var SchedulerFlowAuthorityProjectionSchema = z3.strictObject({
454
+ version: z3.literal(1),
455
+ activePlayerIds: z3.array(z3.string().min(1)),
456
+ pendingPlayerIds: z3.array(z3.string().min(1)),
457
+ continuationDependencies: z3.array(SchedulerContinuationDependencySchema)
458
+ });
459
+ var ProjectionTimingMetadataSchema = z3.strictObject({
460
+ resolveAvailableInteractionsMs: z3.number().finite().gte(0),
461
+ resolveViewMs: z3.number().finite().gte(0),
462
+ resolveZoneHandlesMs: z3.number().finite().gte(0),
463
+ descriptorHashMs: z3.number().finite().gte(0)
464
+ });
465
+ var SeatProjectionBundleSchema = z3.strictObject({
466
+ events: z3.array(GameEventSchema).max(32),
467
+ simultaneousPhase: z3.union([SimultaneousPhaseProjectionSchema, z3.null()]).optional(),
468
+ schedulerFlow: SchedulerFlowAuthorityProjectionSchema.optional(),
469
+ interactionsByRef: z3.record(z3.string(), InteractionDescriptorSchema).optional(),
470
+ seats: z3.record(z3.string(), SeatProjectionSchema),
471
+ timing: ProjectionTimingMetadataSchema.optional()
472
+ });
473
+ var ProjectRequestSchema = z3.strictObject({
474
+ state: ReducerSessionStateSchema,
475
+ playerIds: z3.array(z3.string().min(1))
476
+ });
477
+ var BoardStaticProjectionSchema = z3.strictObject({
478
+ view: z3.record(z3.string(), RuntimeJsonSchema),
479
+ hash: z3.string().min(1),
480
+ manifestVersion: z3.string()
481
+ });
482
+
483
+ // src/shared/hex-board.ts
484
+ import {
485
+ defineHex,
486
+ Grid,
487
+ Orientation,
488
+ fromCoordinates as coordinatesTraversal,
489
+ rectangle as rectangleTraversal,
490
+ ring as ringTraversal,
491
+ spiral as spiralTraversal,
492
+ line as lineTraversal
493
+ } from "honeycomb-grid";
494
+ var hexagon = (options) => ({ kind: "hexagon", ...options });
495
+ var spiral = (options) => ({ kind: "spiral", ...options });
496
+ var ring = (options) => ({ kind: "ring", ...options });
497
+ var rectangle = (options) => ({ kind: "rectangle", ...options });
498
+ var fromCoordinates = (coordinates) => ({ kind: "coordinates", coordinates });
499
+ var coordinateKey = ({ q, r }) => `${q},${r}`;
500
+ var pointKey = ({ x, y }) => `${Math.round(x * 1e9)},${Math.round(y * 1e9)}`;
501
+ var compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
502
+ function hexClass(orientation, dimensions = 1) {
503
+ return defineHex({
504
+ dimensions,
505
+ orientation: orientation === "flat" ? Orientation.FLAT : Orientation.POINTY,
506
+ origin: { x: 0, y: 0 }
507
+ });
508
+ }
509
+ function hexShapeCoordinates(shape, orientation = "pointy") {
510
+ const integer = (value, name, minimum) => {
511
+ if (!Number.isSafeInteger(value) || value < minimum)
512
+ throw new Error(`${name} must be a safe integer >= ${minimum}.`);
513
+ };
514
+ const coordinate = (value) => {
515
+ integer(value.q, "q", Number.MIN_SAFE_INTEGER);
516
+ integer(value.r, "r", Number.MIN_SAFE_INTEGER);
517
+ };
518
+ if (shape.kind === "coordinates") {
519
+ shape.coordinates.forEach(coordinate);
520
+ if (new Set(shape.coordinates.map(coordinateKey)).size !== shape.coordinates.length)
521
+ throw new Error("Hex shape contains duplicate coordinates.");
522
+ } else if (shape.kind === "rectangle") {
523
+ integer(shape.width, "width", 1);
524
+ integer(shape.height, "height", 1);
525
+ if (shape.start) coordinate(shape.start);
526
+ } else {
527
+ integer(shape.radius, "radius", 0);
528
+ if (shape.center) coordinate(shape.center);
529
+ }
530
+ const Tile = hexClass(orientation);
531
+ const traversal = shape.kind === "coordinates" ? coordinatesTraversal(...shape.coordinates) : shape.kind === "rectangle" ? rectangleTraversal(shape) : shape.kind === "ring" ? ringTraversal({
532
+ radius: shape.radius,
533
+ center: shape.center ?? { q: 0, r: 0 }
534
+ }) : spiralTraversal({ radius: shape.radius, start: shape.center });
535
+ return new Grid(Tile, traversal).toArray().map(({ q, r }) => ({ q, r }));
536
+ }
537
+ function createHexBoardGeometry(board) {
538
+ const spaces = board.spaces.map(({ id, q, r }) => ({ id, q, r })).sort((a, b) => compare(a.id, b.id));
539
+ const orientation = board.orientation ?? "pointy";
540
+ const grid = new Grid(hexClass(orientation), spaces);
541
+ const spacesById = new Map(spaces.map((space) => [space.id, space]));
542
+ if (spacesById.size !== spaces.length || grid.size !== spaces.length)
543
+ throw new Error(
544
+ `Hex board '${board.id}' contains duplicate space IDs or coordinates.`
545
+ );
546
+ const spacesByCoordinate = new Map(
547
+ spaces.map((space) => [coordinateKey(space), space])
548
+ );
549
+ const cornerOwners = /* @__PURE__ */ new Map();
550
+ const edgeOwners = /* @__PURE__ */ new Map();
551
+ const cornersBySpace = /* @__PURE__ */ new Map();
552
+ const edgesBySpace = /* @__PURE__ */ new Map();
553
+ for (const space of spaces) {
554
+ const corners = grid.getHex(space).corners;
555
+ const cornerKeys = corners.map(pointKey);
556
+ cornersBySpace.set(space.id, cornerKeys);
557
+ const edgeKeys = [];
558
+ corners.forEach((point, corner) => {
559
+ const key = cornerKeys[corner];
560
+ const vertex = cornerOwners.get(key) ?? { point, owners: [] };
561
+ vertex.owners.push({ id: space.id, corner });
562
+ cornerOwners.set(key, vertex);
563
+ const pair = [key, cornerKeys[(corner + 1) % 6]];
564
+ const edgeKey = [...pair].sort(compare).join("|");
565
+ const edge = edgeOwners.get(edgeKey) ?? { corners: pair, owners: [] };
566
+ edge.owners.push({ id: space.id, side: corner });
567
+ edgeOwners.set(edgeKey, edge);
568
+ edgeKeys.push(edgeKey);
569
+ });
570
+ edgesBySpace.set(space.id, edgeKeys);
571
+ }
572
+ const vertexIds = new Map(
573
+ [...cornerOwners].map(([key, vertex]) => {
574
+ const owners = [...vertex.owners].sort((a, b) => compare(a.id, b.id));
575
+ return [
576
+ key,
577
+ `${board.id}:vertex:${owners.map((owner) => encodeURIComponent(owner.id)).join("|")}${owners.length < 3 ? `:${owners[0].corner}` : ""}`
578
+ ];
579
+ })
580
+ );
581
+ const edgeIds = new Map(
582
+ [...edgeOwners].map(([key, edge]) => {
583
+ const owners = [...edge.owners].sort((a, b) => compare(a.id, b.id));
584
+ return [
585
+ key,
586
+ `${board.id}:edge:${owners.map((owner) => encodeURIComponent(owner.id)).join("|")}${owners.length === 1 ? `:${owners[0].side}` : ""}`
587
+ ];
588
+ })
589
+ );
590
+ const edges = [...edgeOwners].map(([key, edge]) => ({
591
+ id: edgeIds.get(key),
592
+ spaceIds: edge.owners.map((owner) => owner.id).sort(compare),
593
+ vertexIds: edge.corners.map((key2) => vertexIds.get(key2)).sort(compare)
594
+ })).sort((a, b) => compare(a.id, b.id));
595
+ const vertices = [...cornerOwners].map(([key, vertex]) => ({
596
+ id: vertexIds.get(key),
597
+ spaceIds: vertex.owners.map((owner) => owner.id).sort(compare),
598
+ edgeIds: edges.filter((edge) => edge.vertexIds.includes(vertexIds.get(key))).map((edge) => edge.id)
599
+ })).sort((a, b) => compare(a.id, b.id));
600
+ const requireSpace = (id) => {
601
+ const space = spacesById.get(id);
602
+ if (!space)
603
+ throw new Error(`Unknown space '${id}' on board '${board.id}'.`);
604
+ return space;
605
+ };
606
+ const selectedIds = (coordinates) => Array.from(coordinates).flatMap((coordinate) => {
607
+ const space = spacesByCoordinate.get(coordinateKey(coordinate));
608
+ return space ? [space.id] : [];
609
+ });
610
+ return {
611
+ edges,
612
+ vertices,
613
+ neighbors(id) {
614
+ requireSpace(id);
615
+ return edges.filter((edge) => edge.spaceIds.includes(id)).flatMap(
616
+ (edge) => edge.spaceIds.filter((other) => other !== id)
617
+ );
618
+ },
619
+ distance(from, to) {
620
+ return grid.distance(requireSpace(from), requireSpace(to));
621
+ },
622
+ ring(id, radius) {
623
+ return selectedIds(
624
+ new Grid(
625
+ hexClass(orientation),
626
+ ringTraversal({ center: requireSpace(id), radius })
627
+ )
628
+ );
629
+ },
630
+ line(from, to) {
631
+ return selectedIds(
632
+ new Grid(
633
+ hexClass(orientation),
634
+ lineTraversal({ start: requireSpace(from), stop: requireSpace(to) })
635
+ )
636
+ );
637
+ },
638
+ edgesOf(id) {
639
+ requireSpace(id);
640
+ return edgesBySpace.get(id).map((key) => edgeIds.get(key));
641
+ },
642
+ verticesOf(id) {
643
+ requireSpace(id);
644
+ return cornersBySpace.get(id).map((key) => vertexIds.get(key));
645
+ },
646
+ edgeAt(id, side) {
647
+ requireSpace(id);
648
+ const key = edgesBySpace.get(id)[side];
649
+ if (!key)
650
+ throw new Error("Hex side must be an integer from 0 through 5.");
651
+ return edgeIds.get(key);
652
+ },
653
+ vertexAt(id, corner) {
654
+ requireSpace(id);
655
+ const key = cornersBySpace.get(id)[corner];
656
+ if (!key)
657
+ throw new Error("Hex corner must be an integer from 0 through 5.");
658
+ return vertexIds.get(key);
659
+ },
660
+ edge(a, b) {
661
+ requireSpace(a);
662
+ requireSpace(b);
663
+ const edge = edges.find(
664
+ (edge2) => edge2.spaceIds.length === 2 && edge2.spaceIds.includes(a) && edge2.spaceIds.includes(b)
665
+ );
666
+ if (!edge || a === b)
667
+ throw new Error(`Spaces '${a}' and '${b}' do not share an edge.`);
668
+ return edge.id;
669
+ },
670
+ vertex(a, b, c) {
671
+ requireSpace(a);
672
+ requireSpace(b);
673
+ requireSpace(c);
674
+ const vertex = vertices.find(
675
+ (vertex2) => vertex2.spaceIds.length === 3 && [a, b, c].every((id) => vertex2.spaceIds.includes(id))
676
+ );
677
+ if (!vertex || (/* @__PURE__ */ new Set([a, b, c])).size !== 3)
678
+ throw new Error("Spaces do not share exactly one vertex.");
679
+ return vertex.id;
680
+ },
681
+ incidentEdges(vertexId) {
682
+ const vertex = vertices.find((vertex2) => vertex2.id === vertexId);
683
+ if (!vertex) throw new Error(`Unknown vertex '${vertexId}'.`);
684
+ return vertex.edgeIds;
685
+ },
686
+ incidentVertices(edgeId) {
687
+ const edge = edges.find((edge2) => edge2.id === edgeId);
688
+ if (!edge) throw new Error(`Unknown edge '${edgeId}'.`);
689
+ return edge.vertexIds;
690
+ },
691
+ spacesAt(vertexId) {
692
+ const vertex = vertices.find((vertex2) => vertex2.id === vertexId);
693
+ if (!vertex) throw new Error(`Unknown vertex '${vertexId}'.`);
694
+ return vertex.spaceIds;
695
+ },
696
+ spacesAlong(edgeId) {
697
+ const edge = edges.find((edge2) => edge2.id === edgeId);
698
+ if (!edge) throw new Error(`Unknown edge '${edgeId}'.`);
699
+ return edge.spaceIds;
700
+ },
701
+ getLayout({
702
+ hexSize,
703
+ origin = { x: 0, y: 0 }
704
+ }) {
705
+ if (!Number.isFinite(hexSize) || hexSize <= 0)
706
+ throw new Error("hexSize must be positive and finite.");
707
+ const scaled = new Grid(hexClass(orientation, hexSize), spaces);
708
+ const layoutSpaces = spaces.map((space) => {
709
+ const hex = scaled.getHex(space);
710
+ return {
711
+ id: space.id,
712
+ center: { x: hex.x + origin.x, y: hex.y + origin.y },
713
+ corners: hex.corners.map((point) => ({
714
+ x: point.x + origin.x,
715
+ y: point.y + origin.y
716
+ }))
717
+ };
718
+ });
719
+ const points = layoutSpaces.flatMap((space) => space.corners);
720
+ const minX = points.length ? Math.min(...points.map((point) => point.x)) : 0;
721
+ const minY = points.length ? Math.min(...points.map((point) => point.y)) : 0;
722
+ const maxX = points.length ? Math.max(...points.map((point) => point.x)) : 0;
723
+ const maxY = points.length ? Math.max(...points.map((point) => point.y)) : 0;
724
+ const vertexPoints = new Map(
725
+ [...cornerOwners].map(([key, vertex]) => [
726
+ vertexIds.get(key),
727
+ {
728
+ x: vertex.point.x * hexSize + origin.x,
729
+ y: vertex.point.y * hexSize + origin.y
730
+ }
731
+ ])
732
+ );
733
+ return {
734
+ viewBox: { x: minX, y: minY, width: maxX - minX, height: maxY - minY },
735
+ spaces: layoutSpaces,
736
+ edges: edges.map((edge) => ({
737
+ id: edge.id,
738
+ from: vertexPoints.get(edge.vertexIds[0]),
739
+ to: vertexPoints.get(edge.vertexIds[1])
740
+ })),
741
+ vertices: vertices.map((vertex) => ({
742
+ id: vertex.id,
743
+ center: vertexPoints.get(vertex.id)
744
+ })),
745
+ pointToSpace(point) {
746
+ const hex = scaled.pointToHex(
747
+ { x: point.x - origin.x, y: point.y - origin.y },
748
+ { allowOutside: false }
749
+ );
750
+ return hex ? spacesByCoordinate.get(coordinateKey(hex))?.id : void 0;
751
+ }
752
+ };
753
+ }
754
+ };
755
+ }
756
+ function resolveHexSpaces(board) {
757
+ const excluded = new Set((board.exclude ?? []).map(coordinateKey));
758
+ const coordinates = hexShapeCoordinates(
759
+ board.shape,
760
+ board.orientation
761
+ ).filter((coordinate) => !excluded.has(coordinateKey(coordinate)));
762
+ const known = new Set(coordinates.map(coordinateKey));
763
+ for (const key of Object.keys(board.spaces ?? {})) {
764
+ if (!known.has(key))
765
+ throw new Error(
766
+ `Hex board '${board.id}' overrides coordinate '${key}' outside its shape.`
767
+ );
768
+ }
769
+ return coordinates.map((coordinate) => {
770
+ const key = coordinateKey(coordinate);
771
+ return {
772
+ ...coordinate,
773
+ ...board.spaces?.[key],
774
+ id: board.spaces?.[key]?.id ?? key
775
+ };
776
+ }).sort((a, b) => compare(a.id, b.id));
777
+ }
778
+
779
+ // src/shared/protocol/json.ts
780
+ import { sha256 } from "@noble/hashes/sha2.js";
781
+ import { bytesToHex, utf8ToBytes } from "@noble/hashes/utils.js";
782
+ function canonicalizePluginRuntimeJson(value) {
783
+ return canonicalizeJson(
784
+ RuntimeJsonSchema.parse(omitOptionalProperties(value))
785
+ );
786
+ }
787
+ function encodeCanonicalPluginRuntimeJson(value) {
788
+ return JSON.stringify(canonicalizePluginRuntimeJson(value));
789
+ }
790
+ function digestPluginRuntimeJson(value) {
791
+ return `sha256:${sha256Hex(encodeCanonicalPluginRuntimeJson(value))}`;
792
+ }
793
+ function canonicalizeJson(value) {
794
+ if (value === null || typeof value === "boolean" || typeof value === "string") {
795
+ return value;
796
+ }
797
+ if (typeof value === "number") return value;
798
+ if (Array.isArray(value)) {
799
+ return value.map((item) => canonicalizeJson(item));
800
+ }
801
+ return Object.fromEntries(
802
+ Object.entries(value).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([key, item]) => [key, canonicalizeJson(item)])
803
+ );
804
+ }
805
+ function omitOptionalProperties(value) {
806
+ if (Array.isArray(value)) return value.map(omitOptionalProperties);
807
+ if (value !== null && typeof value === "object" && (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null)) {
808
+ return Object.fromEntries(
809
+ Object.entries(value).filter(([, item]) => item !== void 0).map(([key, item]) => [key, omitOptionalProperties(item)])
810
+ );
811
+ }
812
+ return value;
813
+ }
814
+ function sha256Hex(input) {
815
+ return bytesToHex(sha256(utf8ToBytes(input)));
816
+ }
817
+
818
+ export {
819
+ RuntimeJsonSchema,
820
+ InteractionCommitPolicySchema,
821
+ InputDomainSchema,
822
+ InteractionInputDescriptorSchema,
823
+ InteractionAvailabilitySchema,
824
+ InteractionDescriptorSchema,
825
+ RngDrawSchema,
826
+ GameEventDetailSchema,
827
+ SystemActionEventSchema,
828
+ GameEventSchema,
829
+ ReducerSessionStateSchema,
830
+ GameInputSchema,
831
+ GameOutcomeSchema,
832
+ SimultaneousPhaseProjectionSchema,
833
+ SeatProjectionBundleSchema,
834
+ BoardStaticProjectionSchema,
835
+ runtime_schema_exports,
836
+ hexagon,
837
+ spiral,
838
+ ring,
839
+ rectangle,
840
+ fromCoordinates,
841
+ createHexBoardGeometry,
842
+ resolveHexSpaces,
843
+ canonicalizePluginRuntimeJson,
844
+ encodeCanonicalPluginRuntimeJson,
845
+ digestPluginRuntimeJson
846
+ };
847
+ //# sourceMappingURL=chunk-XU6WJW6K.js.map