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