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