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

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.
@@ -11,7 +11,7 @@ function requireLookup(value, kind, id) {
11
11
  }
12
12
 
13
13
  // src/shared/board-target.ts
14
- import { z } from "zod";
14
+ import * as z from "zod";
15
15
  var PlayerBoardSpaceTargetSchema = z.strictObject({
16
16
  boardId: z.string(),
17
17
  playerId: z.string(),
@@ -136,4 +136,4 @@ export {
136
136
  inputTargetInDomain,
137
137
  inputValueKey
138
138
  };
139
- //# sourceMappingURL=chunk-3JXUL4VN.js.map
139
+ //# sourceMappingURL=chunk-DPRHGA2C.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/shared/lookup.ts","../src/shared/board-target.ts","../src/shared/input-domain.ts"],"sourcesContent":["/** Assert presence at a mutable table or projected-snapshot lookup boundary. */\nexport function requireLookup<T>(\n value: T | undefined,\n kind: string,\n id: string,\n): T {\n if (value === undefined) throw new Error(`${kind} \"${id}\" is not present.`);\n return value;\n}\n","import * as z from \"zod\";\n\n/** A space on one player's board; boardId is the base manifest board ID. */\nexport type PlayerBoardSpaceTarget<\n BoardId extends string = string,\n SpaceId extends string = string,\n PlayerId extends string = string,\n> = {\n readonly boardId: BoardId;\n readonly playerId: PlayerId;\n readonly spaceId: SpaceId;\n};\n\nexport const PlayerBoardSpaceTargetSchema = z.strictObject({\n boardId: z.string(),\n playerId: z.string(),\n spaceId: z.string(),\n});\n\nexport function isPlayerBoardSpaceTarget(\n value: unknown,\n): value is PlayerBoardSpaceTarget {\n return (\n typeof value === \"object\" &&\n value !== null &&\n Object.keys(value).length === 3 &&\n \"boardId\" in value &&\n typeof value.boardId === \"string\" &&\n \"playerId\" in value &&\n typeof value.playerId === \"string\" &&\n \"spaceId\" in value &&\n typeof value.spaceId === \"string\"\n );\n}\n\nexport function samePlayerBoardSpaceTarget(\n left: PlayerBoardSpaceTarget,\n right: PlayerBoardSpaceTarget,\n): boolean {\n return (\n left.boardId === right.boardId &&\n left.playerId === right.playerId &&\n left.spaceId === right.spaceId\n );\n}\n","import {\n isPlayerBoardSpaceTarget,\n samePlayerBoardSpaceTarget,\n} from \"./board-target\";\nimport type {\n InputDomainDescriptor,\n InputSelectionDescriptor,\n} from \"../reducer/model/spec/inputs\";\n\n/** Projected domain rules only; schemas and authored target checks remain server-owned. */\nexport function inputDomainErrors(\n domain: InputDomainDescriptor,\n value: unknown,\n selection?: InputSelectionDescriptor,\n options: { ignoreMinimum?: boolean } = {},\n): string[] {\n if (selection?.mode === \"many\") {\n if (!Array.isArray(value)) return [\"Expected a list of values.\"];\n const errors = cardinalityErrors(\n value,\n selection.min,\n selection.max,\n \"value\",\n options.ignoreMinimum,\n );\n if (\n selection.distinct &&\n new Set(value.map(inputValueKey)).size !== value.length\n )\n errors.push(\"Choose each value only once.\");\n if (\n value.some(\n (item) =>\n inputDomainErrors(domain, item, undefined, options).length > 0,\n )\n )\n errors.push(ineligibleMessage(domain));\n return errors;\n }\n switch (domain.type) {\n case \"choice\":\n return inputTargetInDomain(domain, value)\n ? []\n : [ineligibleMessage(domain)];\n case \"choiceList\": {\n if (!Array.isArray(value)) return [\"Expected a list of choices.\"];\n const errors = cardinalityErrors(\n value,\n domain.min ?? 0,\n domain.max ?? domain.choices.length,\n \"option\",\n options.ignoreMinimum,\n );\n if (value.some((item) => !inputTargetInDomain(domain, item)))\n errors.push(ineligibleMessage(domain));\n return errors;\n }\n case \"cardTarget\":\n case \"boardTarget\":\n return inputTargetInDomain(domain, value)\n ? []\n : [ineligibleMessage(domain)];\n case \"boundedNumber\":\n return typeof value === \"number\" &&\n value >= domain.min &&\n value <= domain.max &&\n Math.abs(\n (value - domain.min) / (domain.step ?? 1) -\n Math.round((value - domain.min) / (domain.step ?? 1)),\n ) < 1e-9\n ? []\n : [\"Value is outside the current input domain.\"];\n case \"resourceMap\":\n return typeof value === \"object\" &&\n value !== null &&\n !Array.isArray(value) &&\n Object.keys(value).every((key) =>\n domain.resources.some((entry) => entry.resourceId === key),\n ) &&\n domain.resources.every((entry) => {\n const amount =\n (value as Record<string, unknown>)[entry.resourceId] ?? 0;\n return (\n typeof amount === \"number\" &&\n Number.isInteger(amount) &&\n amount >= (entry.min ?? 0) &&\n amount <= (entry.max ?? Infinity)\n );\n })\n ? []\n : [\"Value is outside the current input domain.\"];\n }\n}\n\nexport function inputValueInDomain(\n domain: InputDomainDescriptor,\n value: unknown,\n selection?: InputSelectionDescriptor,\n options: { ignoreMinimum?: boolean } = {},\n): boolean {\n return inputDomainErrors(domain, value, selection, options).length === 0;\n}\n\n/** One selectable option, including an option within a choiceList or many input. */\nexport function inputTargetInDomain(\n domain: InputDomainDescriptor,\n value: unknown,\n): boolean {\n switch (domain.type) {\n case \"choice\":\n case \"choiceList\":\n return domain.choices.some(\n (choice) => !choice.disabled && Object.is(choice.value, value),\n );\n case \"cardTarget\":\n return (\n typeof value === \"string\" && domain.eligibleTargets.includes(value)\n );\n case \"boardTarget\":\n return domain.valueKind === \"player-board-space\"\n ? isPlayerBoardSpaceTarget(value) &&\n domain.eligibleTargets.some((candidate) =>\n samePlayerBoardSpaceTarget(candidate, value),\n )\n : typeof value === \"string\" && domain.eligibleTargets.includes(value);\n default:\n return inputValueInDomain(domain, value);\n }\n}\n\nfunction cardinalityErrors(\n value: readonly unknown[],\n min: number,\n max: number | undefined,\n unit: string,\n ignoreMinimum = false,\n): string[] {\n const errors: string[] = [];\n if (!ignoreMinimum && value.length < min)\n errors.push(`Choose at least ${min} ${pluralize(unit, min)}.`);\n if (max !== undefined && value.length > max)\n errors.push(`Choose at most ${max} ${pluralize(unit, max)}.`);\n return errors;\n}\n\nfunction ineligibleMessage(domain: InputDomainDescriptor): string {\n return domain.type === \"choice\" || domain.type === \"choiceList\"\n ? \"Selected choice is not eligible.\"\n : domain.type === \"cardTarget\" || domain.type === \"boardTarget\"\n ? \"Selected target is not eligible.\"\n : \"Value is outside the current input domain.\";\n}\n\n/** Matches the reducer's JSON value identity for projected distinct selections. */\nexport function inputValueKey(value: unknown): string {\n if (value === null) return \"null\";\n if (isPlayerBoardSpaceTarget(value))\n return `player-board-space:${JSON.stringify([value.boardId, value.playerId, value.spaceId])}`;\n switch (typeof value) {\n case \"string\":\n return `string:${value}`;\n case \"number\":\n case \"boolean\":\n case \"undefined\":\n return `${typeof value}:${String(value)}`;\n default:\n return `json:${JSON.stringify(value)}`;\n }\n}\n\nfunction pluralize(word: string, count: number): string {\n return count === 1 ? word : `${word}s`;\n}\n"],"mappings":";;;;;;;AACO,SAAS,cACd,OACA,MACA,IACG;AACH,MAAI,UAAU,OAAW,OAAM,IAAI,MAAM,GAAG,IAAI,KAAK,EAAE,mBAAmB;AAC1E,SAAO;AACT;;;ACRA,YAAY,OAAO;AAaZ,IAAM,+BAAiC,eAAa;AAAA,EACzD,SAAW,SAAO;AAAA,EAClB,UAAY,SAAO;AAAA,EACnB,SAAW,SAAO;AACpB,CAAC;AAEM,SAAS,yBACd,OACiC;AACjC,SACE,OAAO,UAAU,YACjB,UAAU,QACV,OAAO,KAAK,KAAK,EAAE,WAAW,KAC9B,aAAa,SACb,OAAO,MAAM,YAAY,YACzB,cAAc,SACd,OAAO,MAAM,aAAa,YAC1B,aAAa,SACb,OAAO,MAAM,YAAY;AAE7B;AAEO,SAAS,2BACd,MACA,OACS;AACT,SACE,KAAK,YAAY,MAAM,WACvB,KAAK,aAAa,MAAM,YACxB,KAAK,YAAY,MAAM;AAE3B;;;AClCO,SAAS,kBACd,QACA,OACA,WACA,UAAuC,CAAC,GAC9B;AACV,MAAI,WAAW,SAAS,QAAQ;AAC9B,QAAI,CAAC,MAAM,QAAQ,KAAK,EAAG,QAAO,CAAC,4BAA4B;AAC/D,UAAM,SAAS;AAAA,MACb;AAAA,MACA,UAAU;AAAA,MACV,UAAU;AAAA,MACV;AAAA,MACA,QAAQ;AAAA,IACV;AACA,QACE,UAAU,YACV,IAAI,IAAI,MAAM,IAAI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SAAS,YAAY,OAAO,SAAS,eAC/C,qCACA,OAAO,SAAS,gBAAgB,OAAO,SAAS,gBAC9C,qCACA;AACR;AAGO,SAAS,cAAc,OAAwB;AACpD,MAAI,UAAU,KAAM,QAAO;AAC3B,MAAI,yBAAyB,KAAK;AAChC,WAAO,sBAAsB,KAAK,UAAU,CAAC,MAAM,SAAS,MAAM,UAAU,MAAM,OAAO,CAAC,CAAC;AAC7F,UAAQ,OAAO,OAAO;AAAA,IACpB,KAAK;AACH,aAAO,UAAU,KAAK;AAAA,IACxB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO,GAAG,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC;AAAA,IACzC;AACE,aAAO,QAAQ,KAAK,UAAU,KAAK,CAAC;AAAA,EACxC;AACF;AAEA,SAAS,UAAU,MAAc,OAAuB;AACtD,SAAO,UAAU,IAAI,OAAO,GAAG,IAAI;AACrC;","names":[]}
@@ -7,7 +7,7 @@ import {
7
7
  inputValueInDomain,
8
8
  inputValueKey,
9
9
  requireLookup
10
- } from "./chunk-3JXUL4VN.js";
10
+ } from "./chunk-DPRHGA2C.js";
11
11
 
12
12
  // src/headless/runtime-features.ts
13
13
  var runtimeFeatures = /* @__PURE__ */ Symbol("runtimeFeatures");
@@ -1528,4 +1528,4 @@ export {
1528
1528
  GESTURE_THRESHOLDS,
1529
1529
  createGestureRecognizer
1530
1530
  };
1531
- //# sourceMappingURL=chunk-HZPKKBEG.js.map
1531
+ //# sourceMappingURL=chunk-EQ4BAJSB.js.map
@@ -13,14 +13,14 @@ import {
13
13
  SystemActionEventSchema,
14
14
  canonicalizePluginRuntimeJson,
15
15
  digestPluginRuntimeJson
16
- } from "./chunk-K75F5UIJ.js";
16
+ } from "./chunk-4H4TAIV7.js";
17
17
 
18
18
  // src/shared/protocol/protocol.ts
19
19
  var DREAMBOARD_PLUGIN_PROTOCOL = "dreamboard-plugin";
20
20
  var DREAMBOARD_PLUGIN_PROTOCOL_VERSION = 7;
21
21
 
22
22
  // src/shared/protocol/schema.ts
23
- import { z } from "zod";
23
+ import * as z from "zod";
24
24
  var BoardStaticProjectionSchema2 = BoardStaticProjectionSchema;
25
25
  var GameEventDetailSchema2 = GameEventDetailSchema;
26
26
  var SystemActionEventSchema2 = SystemActionEventSchema;
@@ -147,7 +147,7 @@ function parsePluginToHostEnvelope(value) {
147
147
 
148
148
  // src/headless/sources/static.ts
149
149
  import { createStore } from "@tanstack/store";
150
- import { z as z2 } from "zod";
150
+ import * as z2 from "zod";
151
151
  var SourceSnapshotSchema = z2.object({
152
152
  me: z2.string().min(1),
153
153
  players: z2.array(PluginPlayerSummarySchema),
@@ -282,7 +282,7 @@ function hydrateInteractionRefs(registry, value, path) {
282
282
 
283
283
  // src/headless/sources/lifecycle.ts
284
284
  import { createStore as createStore2 } from "@tanstack/store";
285
- import { z as z3 } from "zod";
285
+ import * as z3 from "zod";
286
286
  var CardImageViewSchema = z3.looseObject({
287
287
  frontImage: z3.string().optional(),
288
288
  backImage: z3.string().optional()
@@ -595,4 +595,4 @@ export {
595
595
  digestPluginCommandRequest,
596
596
  materializePluginGameplayFrame
597
597
  };
598
- //# sourceMappingURL=chunk-N37D7NPB.js.map
598
+ //# sourceMappingURL=chunk-GZVYEVXY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/shared/protocol/protocol.ts","../src/shared/protocol/schema.ts","../src/headless/sources/static.ts","../src/shared/protocol/digest.ts","../src/shared/protocol/projection.ts","../src/headless/sources/lifecycle.ts"],"sourcesContent":["import type {\n GameplayBasis,\n InteractionDescriptor,\n PluginGameplayFrame,\n PluginSessionDescriptor,\n} from \"./frame.js\";\nimport type { RuntimeJson } from \"../runtime-json.js\";\n\nexport const DREAMBOARD_PLUGIN_PROTOCOL = \"dreamboard-plugin\" as const;\nexport const DREAMBOARD_PLUGIN_PROTOCOL_VERSION = 7 as const;\n\nexport type InteractionResult =\n | {\n readonly type: \"interaction.result\";\n readonly clientActionId: string;\n readonly accepted: true;\n }\n | {\n readonly type: \"interaction.result\";\n readonly clientActionId: string;\n readonly accepted: false;\n readonly errorCode: string;\n readonly message?: string;\n };\n\nexport interface SubmitInteractionCommand {\n readonly type: \"interaction.submit\";\n readonly clientActionId: string;\n readonly basis: GameplayBasis;\n readonly interactionId: string;\n readonly params: RuntimeJson;\n}\n\nexport interface CancelInteractionCommand {\n readonly type: \"interaction.cancel\";\n readonly clientActionId: string;\n readonly basis: GameplayBasis;\n readonly interactionId: string;\n}\n\nexport type HostToPluginPayload =\n | {\n readonly type: \"runtime.init\";\n readonly session: PluginSessionDescriptor;\n }\n | {\n readonly type: \"gameplay.frame\";\n readonly frame: PluginGameplayFrame;\n }\n | InteractionResult;\n\nexport type PluginToHostPayload =\n | { readonly type: \"runtime.ready\" }\n | { readonly type: \"runtime.resume\" }\n | {\n readonly type: \"runtime.ack\";\n /** Echoes the host envelope sequence. It is delivery order only. */\n readonly sequence: number;\n readonly clientReceivedAtMs?: number;\n readonly clientRenderedAtMs?: number;\n }\n | SubmitInteractionCommand\n | CancelInteractionCommand\n | {\n readonly type: \"runtime.error\";\n readonly message: string;\n readonly code?: string;\n };\n\nexport interface PluginProtocolEnvelope<Payload> {\n readonly protocol: typeof DREAMBOARD_PLUGIN_PROTOCOL;\n readonly version: typeof DREAMBOARD_PLUGIN_PROTOCOL_VERSION;\n readonly channelId: string;\n /** Delivery order only. It is not a game revision. */\n readonly sequence: number;\n readonly payload: Payload;\n}\n\nexport type HostToPluginEnvelope = PluginProtocolEnvelope<HostToPluginPayload>;\nexport type PluginToHostEnvelope = PluginProtocolEnvelope<PluginToHostPayload>;\n\nexport type ActionSetVersionInput = {\n readonly version: number;\n readonly availableInteractions: readonly InteractionDescriptor[];\n};\n","import * as ReducerWireZod from \"../runtime-schema\";\nimport * as z from \"zod\";\nimport {\n DREAMBOARD_PLUGIN_PROTOCOL,\n DREAMBOARD_PLUGIN_PROTOCOL_VERSION,\n} from \"./protocol.js\";\nimport { RuntimeJsonSchema } from \"../runtime-json.js\";\nimport type {\n GameOutcome,\n GameplayBasis,\n PluginGameplayFrame,\n PluginSessionDescriptor,\n ZoneHandlesSnapshot,\n} from \"./frame.js\";\nimport type {\n HostToPluginPayload,\n InteractionResult,\n PluginProtocolEnvelope,\n PluginToHostPayload,\n} from \"./protocol.js\";\n\nexport const BoardStaticProjectionSchema =\n ReducerWireZod.BoardStaticProjectionSchema;\nexport const GameEventDetailSchema = ReducerWireZod.GameEventDetailSchema;\nexport const SystemActionEventSchema = ReducerWireZod.SystemActionEventSchema;\nexport const GameEventSchema = ReducerWireZod.GameEventSchema;\nexport const SeatProjectionBundleSchema =\n ReducerWireZod.SeatProjectionBundleSchema;\n\nexport const PlayerIdSchema = z.string().min(1);\n\nexport const PluginPlayerSummarySchema = z\n .object({\n playerId: PlayerIdSchema,\n displayName: z.string(),\n color: z.string().optional(),\n })\n .strict();\n\nexport const PluginSessionDescriptorSchema = z\n .object({\n sessionId: z.string().min(1),\n players: z.array(PluginPlayerSummarySchema),\n assets: z.record(z.string(), z.instanceof(Blob)).optional(),\n })\n .strict() satisfies z.ZodType<PluginSessionDescriptor>;\n\nexport {\n InteractionCommitPolicySchema,\n InputSelectionSchema,\n InputDomainSchema,\n InteractionChoiceOptionSchema,\n InteractionInputDescriptorSchema,\n InteractionAvailabilitySchema,\n InteractionDescriptorSchema,\n} from \"../interaction-schema.js\";\nimport { InteractionDescriptorSchema } from \"../interaction-schema.js\";\n\nexport const ZoneHandlesSnapshotSchema = z\n .object({\n cardIds: z.array(z.string()),\n cardViewsById: z.record(z.string(), z.string()),\n cardBacksById: z.record(z.string(), z.string()),\n playableByCardId: z.record(\n z.string(),\n z.array(InteractionDescriptorSchema),\n ),\n })\n .strict() satisfies z.ZodType<ZoneHandlesSnapshot>;\n\nexport const SimultaneousPhaseSnapshotSchema =\n ReducerWireZod.SimultaneousPhaseProjectionSchema;\n\nexport const GameplayBasisSchema = z\n .object({\n version: z.number().int().nonnegative(),\n actionSetVersion: z.string().min(1),\n perspectivePlayerId: PlayerIdSchema,\n })\n .strict() satisfies z.ZodType<GameplayBasis>;\n\nexport const GameOutcomeSchema =\n ReducerWireZod.GameOutcomeSchema satisfies z.ZodType<GameOutcome>;\n\nexport const SeatFrameSchema = z\n .object({\n events: z.array(GameEventSchema).max(32),\n view: z.record(z.string(), RuntimeJsonSchema).nullable(),\n flow: z\n .object({\n currentPhase: z.string().nullable(),\n activePlayers: z.array(PlayerIdSchema),\n simultaneousPhase: SimultaneousPhaseSnapshotSchema.nullable(),\n })\n .strict(),\n availableInteractions: z.array(InteractionDescriptorSchema),\n zones: z.record(z.string(), ZoneHandlesSnapshotSchema),\n })\n .strict();\n\nexport const PluginGameplayFrameSchema = SeatFrameSchema.extend({\n basis: GameplayBasisSchema,\n}) satisfies z.ZodType<PluginGameplayFrame>;\n\nexport const InteractionResultSchema = z.discriminatedUnion(\"accepted\", [\n z\n .object({\n type: z.literal(\"interaction.result\"),\n clientActionId: z.string().min(1),\n accepted: z.literal(true),\n })\n .strict(),\n z\n .object({\n type: z.literal(\"interaction.result\"),\n clientActionId: z.string().min(1),\n accepted: z.literal(false),\n errorCode: z.string().min(1),\n message: z.string().optional(),\n })\n .strict(),\n]) satisfies z.ZodType<InteractionResult>;\n\nexport const SubmitInteractionCommandSchema = z\n .object({\n type: z.literal(\"interaction.submit\"),\n clientActionId: z.string().min(1),\n basis: GameplayBasisSchema,\n interactionId: z.string().min(1),\n params: RuntimeJsonSchema,\n })\n .strict();\n\nexport const CancelInteractionCommandSchema =\n SubmitInteractionCommandSchema.omit({ params: true })\n .extend({ type: z.literal(\"interaction.cancel\") })\n .strict();\n\nexport const HostToPluginPayloadSchema = z.discriminatedUnion(\"type\", [\n z\n .object({\n type: z.literal(\"runtime.init\"),\n session: PluginSessionDescriptorSchema,\n })\n .strict(),\n z\n .object({\n type: z.literal(\"gameplay.frame\"),\n frame: PluginGameplayFrameSchema,\n })\n .strict(),\n InteractionResultSchema,\n]) satisfies z.ZodType<HostToPluginPayload>;\n\nexport const PluginToHostPayloadSchema = z.discriminatedUnion(\"type\", [\n z.object({ type: z.literal(\"runtime.ready\") }).strict(),\n z.object({ type: z.literal(\"runtime.resume\") }).strict(),\n z\n .object({\n type: z.literal(\"runtime.ack\"),\n sequence: z.number().int().nonnegative(),\n clientReceivedAtMs: z.number().finite().optional(),\n clientRenderedAtMs: z.number().finite().optional(),\n })\n .strict(),\n SubmitInteractionCommandSchema,\n CancelInteractionCommandSchema,\n z\n .object({\n type: z.literal(\"runtime.error\"),\n message: z.string(),\n code: z.string().optional(),\n })\n .strict(),\n]) satisfies z.ZodType<PluginToHostPayload>;\n\nexport function createPluginProtocolEnvelopeSchema<Payload>(\n payloadSchema: z.ZodType<Payload>,\n): z.ZodType<PluginProtocolEnvelope<Payload>> {\n return z\n .object({\n protocol: z.literal(DREAMBOARD_PLUGIN_PROTOCOL),\n version: z.literal(DREAMBOARD_PLUGIN_PROTOCOL_VERSION),\n channelId: z.string().min(1),\n sequence: z.number().int().nonnegative(),\n payload: payloadSchema,\n })\n .strict();\n}\n\nexport const HostToPluginEnvelopeSchema = createPluginProtocolEnvelopeSchema(\n HostToPluginPayloadSchema,\n);\n\nexport const PluginToHostEnvelopeSchema = createPluginProtocolEnvelopeSchema(\n PluginToHostPayloadSchema,\n);\n\nexport function parsePluginSessionDescriptor(\n value: unknown,\n): PluginSessionDescriptor {\n return PluginSessionDescriptorSchema.parse(value);\n}\n\nexport function parsePluginGameplayFrame(value: unknown): PluginGameplayFrame {\n return PluginGameplayFrameSchema.parse(value);\n}\n\nexport function parseHostToPluginEnvelope(\n value: unknown,\n): PluginProtocolEnvelope<HostToPluginPayload> {\n return HostToPluginEnvelopeSchema.parse(value);\n}\n\nexport function parsePluginToHostEnvelope(\n value: unknown,\n): PluginProtocolEnvelope<PluginToHostPayload> {\n return PluginToHostEnvelopeSchema.parse(value);\n}\n","import { createStore } from \"@tanstack/store\";\nimport * as z from \"zod\";\nimport {\n SeatFrameSchema,\n PluginPlayerSummarySchema,\n} from \"../../shared/protocol/schema.js\";\nimport { immutableCopy } from \"./immutable.js\";\nimport type { GameSource, SourceSnapshot, SourceState } from \"./types.js\";\n\nexport const SourceSnapshotSchema = z\n .object({\n me: z.string().min(1),\n players: z.array(PluginPlayerSummarySchema),\n frame: SeatFrameSchema,\n version: z.number().int().nonnegative(),\n })\n .strict();\n\n/** A read-only fixture source accepts the public seat snapshot, never wire basis. */\nexport function staticSource(input: SourceSnapshot): GameSource {\n const snapshot = immutableCopy(SourceSnapshotSchema.parse(input));\n if (!snapshot.players.some((player) => player.playerId === snapshot.me))\n throw new Error(\"Gameplay seat is absent from session.\");\n const store = createStore<SourceState>(\n Object.freeze({\n snapshot,\n connection: \"ready\",\n request: null,\n failure: null,\n }),\n );\n return {\n store: {\n get: () => store.get(),\n subscribe: (listener) => store.subscribe(listener),\n },\n dispose() {\n store.setState((state) =>\n Object.freeze({\n snapshot: state.snapshot,\n connection: \"closed\",\n request: null,\n failure: null,\n }),\n );\n },\n };\n}\n","import type { PluginGameplayFrame } from \"./frame.js\";\nimport {\n type ActionSetVersionInput,\n type SubmitInteractionCommand,\n type CancelInteractionCommand,\n} from \"./protocol.js\";\nimport {\n canonicalizePluginRuntimeJson,\n digestPluginRuntimeJson,\n encodeCanonicalPluginRuntimeJson,\n} from \"./json.js\";\n\nexport {\n canonicalizePluginRuntimeJson,\n digestPluginRuntimeJson,\n encodeCanonicalPluginRuntimeJson,\n};\n\nexport function computePluginActionSetVersion(\n input: ActionSetVersionInput,\n): string {\n return digestPluginRuntimeJson({\n digestVersion: \"plugin-action-set@5\",\n version: input.version,\n availableInteractions: input.availableInteractions,\n });\n}\n\nexport function digestPluginGameplayFrame(frame: PluginGameplayFrame): string {\n return digestPluginRuntimeJson({\n digestVersion: \"plugin-gameplay-frame@5\",\n frame,\n });\n}\n\nexport function digestPluginCommandRequest(\n command: SubmitInteractionCommand | CancelInteractionCommand,\n): string {\n return digestPluginRuntimeJson({\n digestVersion: \"plugin-command-request@5\",\n command,\n });\n}\n","import { canonicalizePluginRuntimeJson } from \"./json\";\nimport {\n BoardStaticProjectionSchema,\n PluginGameplayFrameSchema,\n SeatProjectionBundleSchema,\n} from \"./schema.js\";\nimport type {\n InteractionDescriptor,\n PlayerId,\n PluginGameplayFrame,\n ReducerBoardStaticProjection,\n ReducerSeatProjectionBundle,\n ZoneHandlesSnapshot,\n} from \"./frame.js\";\nimport type { RuntimeJson } from \"../runtime-json.js\";\n\nexport interface MaterializePluginGameplayFrameInput {\n readonly currentPhase: string | null;\n readonly activePlayers: readonly PlayerId[];\n readonly dynamicProjection: ReducerSeatProjectionBundle;\n readonly staticProjection?: ReducerBoardStaticProjection | null;\n readonly perspectivePlayerId: PlayerId;\n\n readonly version: number;\n readonly actionSetVersion: string;\n}\n\nexport function materializePluginGameplayFrame(\n input: MaterializePluginGameplayFrameInput,\n): PluginGameplayFrame {\n const dynamicProjection = SeatProjectionBundleSchema.parse(\n canonicalizePluginRuntimeJson(input.dynamicProjection),\n );\n const staticProjection =\n input.staticProjection == null\n ? null\n : BoardStaticProjectionSchema.parse(\n canonicalizePluginRuntimeJson(input.staticProjection),\n );\n\n const registry = dynamicProjection.interactionsByRef ?? {};\n const seat = dynamicProjection.seats[input.perspectivePlayerId] ?? null;\n\n const availableInteractions =\n seat == null\n ? []\n : hydrateInteractionRefs(\n registry,\n seat.availableInteractionRefs ?? [],\n \"availableInteractionRefs\",\n );\n const zones =\n seat?.zones == null ? {} : hydrateZones(registry, seat.zones, \"zones\");\n\n const frame = {\n events: dynamicProjection.events,\n basis: {\n version: input.version,\n actionSetVersion: input.actionSetVersion,\n perspectivePlayerId: input.perspectivePlayerId,\n },\n view: materializeView(staticProjection, seat?.view),\n flow: {\n currentPhase: input.currentPhase,\n activePlayers: [...input.activePlayers],\n simultaneousPhase: dynamicProjection.simultaneousPhase ?? null,\n },\n availableInteractions,\n zones,\n } satisfies PluginGameplayFrame;\n\n return PluginGameplayFrameSchema.parse(frame);\n}\n\nfunction materializeView(\n staticProjection: ReducerBoardStaticProjection | null,\n seatView: unknown,\n): RuntimeJson | null {\n const parts = [staticProjection?.view, seatView].filter(\n (part) => part !== undefined && part !== null,\n );\n if (parts.length === 0) return null;\n // Admitting schemas guarantee records and reject authored `boards` fields.\n return Object.assign({}, ...parts) as Record<string, RuntimeJson>;\n}\n\nfunction hydrateZones(\n registry: Readonly<Record<string, InteractionDescriptor>>,\n value: NonNullable<ReducerSeatProjectionBundle[\"seats\"][string][\"zones\"]>,\n path: string,\n): Record<string, ZoneHandlesSnapshot> {\n return Object.fromEntries(\n Object.entries(value).map(([zoneId, zone]) => [\n zoneId,\n {\n cardIds: zone.cardIds,\n cardViewsById: zone.cardViewsById,\n cardBacksById: zone.cardBacksById,\n playableByCardId: Object.fromEntries(\n Object.entries(zone.playableByCardId).map(([cardId, refs]) => [\n cardId,\n hydrateInteractionRefs(\n registry,\n refs,\n `${path}.${zoneId}.playableByCardId.${cardId}`,\n ),\n ]),\n ),\n },\n ]),\n );\n}\n\nfunction hydrateInteractionRefs(\n registry: Readonly<Record<string, InteractionDescriptor>>,\n value: readonly string[],\n path: string,\n): InteractionDescriptor[] {\n return value.map((ref, index) => {\n const descriptor = registry[ref];\n if (!descriptor) {\n throw new Error(\n `Seat projection ${path}[${index}] references '${ref}', which is missing from interactionsByRef.`,\n );\n }\n return descriptor;\n });\n}\n","import { createStore } from \"@tanstack/store\";\nimport * as z from \"zod\";\nimport type { ViewCard } from \"../../shared/domain/cards.js\";\nimport {\n PluginGameplayFrameSchema,\n PluginSessionDescriptorSchema,\n InteractionResultSchema,\n PluginToHostPayloadSchema,\n} from \"../../shared/protocol/schema.js\";\nimport type {\n GameplayBasis,\n PluginGameplayFrame,\n PluginSessionDescriptor,\n} from \"../../shared/protocol/frame.js\";\nimport { immutableCopy } from \"./immutable.js\";\nimport type {\n CommandSource,\n SourceCommand,\n SourceContext,\n SourceState,\n SubmitResult,\n} from \"./types.js\";\n\ninterface Pending {\n readonly command: SourceCommand;\n readonly resolve: (result: SubmitResult) => void;\n readonly reject: (error: Error) => void;\n accepted: boolean;\n}\n\nconst CardImageViewSchema = z.looseObject({\n frontImage: z.string().optional(),\n backImage: z.string().optional(),\n}) satisfies z.ZodType<Pick<ViewCard, \"frontImage\" | \"backImage\">>;\n\n/** Adapter-private lifecycle. Transport callbacks must belong to this lifetime. */\nexport function createSourceLifecycle(options: {\n context?: SourceContext;\n send(command: SourceCommand): void;\n recover(): void;\n close(): void;\n timeoutMs?: number;\n}) {\n let context = options.context ? immutableCopy(options.context) : null;\n const store = createStore<SourceState>(\n Object.freeze({\n snapshot: null,\n connection: \"connecting\",\n request: null,\n failure: null,\n }),\n );\n let session: Omit<PluginSessionDescriptor, \"assets\"> | null = null;\n let assetUrls: Readonly<Record<string, string>> | null = null;\n let basis: GameplayBasis | null = null;\n let pending: Pending | null = null;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let recovered = false;\n let closed = false;\n const clearTimer = () => {\n clearTimeout(timer);\n timer = undefined;\n };\n const publish = (state: SourceState) => {\n if (state.request) Object.freeze(state.request);\n store.setState(() => Object.freeze(state));\n };\n const recovering = () => {\n if (closed) return;\n publish({ ...store.get(), connection: \"recovering\", failure: null });\n };\n const close = (failure: Error | null) => {\n if (closed) return;\n closed = true;\n clearTimer();\n for (const url of Object.values(assetUrls ?? {})) URL.revokeObjectURL(url);\n pending?.reject(failure ?? new Error(\"Gameplay source disposed.\"));\n pending = null;\n options.close();\n const snapshot = store.get().snapshot;\n publish(\n failure\n ? {\n connection: \"failed\",\n snapshot,\n request: null,\n failure: Object.freeze(failure),\n }\n : { connection: \"closed\", snapshot, request: null, failure: null },\n );\n };\n const fail = (error: Error) => close(error);\n const arm = () => {\n clearTimer();\n timer = setTimeout(() => {\n if (recovered) {\n fail(new Error(\"Gameplay source recovery timed out.\"));\n return;\n }\n recovered = true;\n recovering();\n try {\n options.recover();\n if (pending && !pending.accepted) options.send(pending.command);\n arm();\n } catch (error) {\n fail(asError(error));\n }\n }, options.timeoutMs ?? 10_000);\n };\n const finishBarrier = () => {\n if (!pending?.accepted) return;\n const frame = store.get().snapshot;\n if (!frame || frame.version <= pending.command.basis.version) return;\n clearTimer();\n pending = null;\n publish({\n snapshot: frame,\n request: null,\n connection: \"ready\",\n failure: null,\n });\n };\n const start = async (\n operation: \"submit\" | \"cancel\",\n interactionId: string,\n params?: unknown,\n ) => {\n const state = store.get();\n if (closed || state.connection !== \"ready\" || !basis)\n return Promise.reject(new Error(\"Gameplay source is not open.\"));\n if (pending)\n return Promise.reject(\n new Error(\"A gameplay interaction is already pending.\"),\n );\n const command = immutableCopy(\n PluginToHostPayloadSchema.parse({\n type:\n operation === \"cancel\" ? \"interaction.cancel\" : \"interaction.submit\",\n clientActionId: crypto.randomUUID(),\n basis,\n interactionId,\n ...(operation === \"cancel\" ? {} : { params }),\n }) as SourceCommand,\n );\n recovered = false;\n const promise = new Promise<SubmitResult>((resolve, reject) => {\n pending = { command, resolve, reject, accepted: false };\n });\n publish({\n ...state,\n request: {\n interactionId,\n operation,\n phase: \"awaiting-result\",\n },\n });\n arm();\n try {\n options.send(command);\n } catch (error) {\n fail(asError(error));\n }\n return promise;\n };\n const source: CommandSource = {\n store: {\n get: () => store.get(),\n subscribe: (listener) => store.subscribe(listener),\n },\n submit: (interactionId, params) => start(\"submit\", interactionId, params),\n cancel: (interactionId) => start(\"cancel\", interactionId),\n dispose: () => close(null),\n };\n return {\n source,\n retry() {\n if (closed || !pending) return;\n try {\n if (pending.accepted) options.recover();\n else options.send(pending.command);\n } catch (error) {\n fail(asError(error));\n }\n },\n fail,\n recovering,\n session(value: unknown) {\n if (closed) return;\n const { assets, ...parsed } = PluginSessionDescriptorSchema.parse(value);\n if (\n (context?.sessionId ?? session?.sessionId) &&\n parsed.sessionId !== (context?.sessionId ?? session?.sessionId)\n ) {\n fail(new Error(\"Gameplay session changed.\"));\n return;\n }\n if (\n context &&\n !parsed.players.some((player) => player.playerId === context!.playerId)\n ) {\n fail(new Error(\"Gameplay seat is absent from session.\"));\n return;\n }\n session = immutableCopy(parsed);\n // Hosts repeat initialization until ready; the first delivery wins.\n assetUrls ??= Object.fromEntries(\n Object.entries(assets ?? {}).map(([path, blob]) => [\n path,\n URL.createObjectURL(blob),\n ]),\n );\n },\n frame(value: unknown) {\n if (closed) return;\n const parsed = PluginGameplayFrameSchema.parse(value);\n if (!session) {\n fail(new Error(\"Gameplay frame arrived before session metadata.\"));\n return;\n }\n context ??= {\n sessionId: session.sessionId,\n playerId: parsed.basis.perspectivePlayerId,\n };\n if (parsed.basis.perspectivePlayerId !== context.playerId) {\n fail(new Error(\"Gameplay perspective changed.\"));\n return;\n }\n if (\n !session.players.some((player) => player.playerId === context!.playerId)\n ) {\n fail(new Error(\"Gameplay seat is absent from session.\"));\n return;\n }\n if (basis && parsed.basis.version < basis.version) return;\n const { basis: nextBasis, ...frame } = immutableCopy(\n withCardImageUrls(parsed, assetUrls),\n );\n basis = nextBasis;\n publish({\n failure: null,\n request: store.get().request,\n snapshot: Object.freeze({\n me: context.playerId,\n players: session.players,\n frame: Object.freeze(frame),\n version: basis.version,\n }),\n connection: \"ready\",\n });\n finishBarrier();\n },\n result(value: unknown) {\n if (closed) return;\n const result = InteractionResultSchema.parse(value);\n if (\n !pending ||\n result.clientActionId !== pending.command.clientActionId ||\n pending.accepted\n )\n return;\n pending.resolve(\n immutableCopy(\n result.accepted\n ? { accepted: true }\n : {\n accepted: false,\n errorCode: result.errorCode,\n ...(result.message === undefined\n ? {}\n : { message: result.message }),\n },\n ),\n );\n if (!result.accepted) {\n clearTimer();\n pending = null;\n publish({\n snapshot: store.get().snapshot!,\n request: null,\n connection: \"ready\",\n failure: null,\n });\n return;\n }\n pending.accepted = true;\n recovered = false;\n const state = store.get();\n // A pending command was submitted from ready, so its snapshot exists.\n publish({\n connection: state.connection === \"recovering\" ? \"recovering\" : \"ready\",\n snapshot: state.snapshot!,\n failure: null,\n request: { ...state.request!, phase: \"awaiting-frame\" },\n });\n arm();\n finishBarrier();\n },\n };\n}\nfunction asError(error: unknown): Error {\n return error instanceof Error ? error : new Error(String(error));\n}\n\n/** Replaces card image paths in card views and hidden card backs with delivered URLs. */\nfunction withCardImageUrls(\n frame: PluginGameplayFrame,\n urls: Readonly<Record<string, string>> | null,\n): PluginGameplayFrame {\n if (urls === null || Object.keys(urls).length === 0) return frame;\n const resolve = (encoded: string) => {\n const card = CardImageViewSchema.parse(JSON.parse(encoded) as unknown);\n for (const key of [\"frontImage\", \"backImage\"] as const) {\n const path = card[key];\n const url = path === undefined ? undefined : urls[path];\n if (url !== undefined) card[key] = url;\n }\n return JSON.stringify(card);\n };\n return {\n ...frame,\n zones: Object.fromEntries(\n Object.entries(frame.zones).map(([zoneId, zone]) => [\n zoneId,\n {\n ...zone,\n cardViewsById: Object.fromEntries(\n Object.entries(zone.cardViewsById).map(([cardId, encoded]) => [\n cardId,\n resolve(encoded),\n ]),\n ),\n cardBacksById: Object.fromEntries(\n Object.entries(zone.cardBacksById).map(([cardId, path]) => [\n cardId,\n urls[path] ?? path,\n ]),\n ),\n },\n ]),\n ),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAQO,IAAM,6BAA6B;AACnC,IAAM,qCAAqC;;;ACRlD,YAAY,OAAO;AAoBZ,IAAMA,+BACI;AACV,IAAMC,yBAAuC;AAC7C,IAAMC,2BAAyC;AAC/C,IAAMC,mBAAiC;AACvC,IAAMC,8BACI;AAEV,IAAM,iBAAmB,SAAO,EAAE,IAAI,CAAC;AAEvC,IAAM,4BACV,SAAO;AAAA,EACN,UAAU;AAAA,EACV,aAAe,SAAO;AAAA,EACtB,OAAS,SAAO,EAAE,SAAS;AAC7B,CAAC,EACA,OAAO;AAEH,IAAM,gCACV,SAAO;AAAA,EACN,WAAa,SAAO,EAAE,IAAI,CAAC;AAAA,EAC3B,SAAW,QAAM,yBAAyB;AAAA,EAC1C,QAAU,SAAS,SAAO,GAAK,aAAW,IAAI,CAAC,EAAE,SAAS;AAC5D,CAAC,EACA,OAAO;A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K,IAAI;AACtD,UAAI,QAAQ,OAAW,MAAK,GAAG,IAAI;AAAA,IACrC;AACA,WAAO,KAAK,UAAU,IAAI;AAAA,EAC5B;AACA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,OAAO,OAAO;AAAA,MACZ,OAAO,QAAQ,MAAM,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,IAAI,MAAM;AAAA,QAClD;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,eAAe,OAAO;AAAA,YACpB,OAAO,QAAQ,KAAK,aAAa,EAAE,IAAI,CAAC,CAAC,QAAQ,OAAO,MAAM;AAAA,cAC5D;AAAA,cACA,QAAQ,OAAO;AAAA,YACjB,CAAC;AAAA,UACH;AAAA,UACA,eAAe,OAAO;AAAA,YACpB,OAAO,QAAQ,KAAK,aAAa,EAAE,IAAI,CAAC,CAAC,QAAQ,IAAI,MAAM;AAAA,cACzD;AAAA,cACA,KAAK,IAAI,KAAK;AAAA,YAChB,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":["BoardStaticProjectionSchema","GameEventDetailSchema","SystemActionEventSchema","GameEventSchema","SeatProjectionBundleSchema","GameOutcomeSchema","z","SeatProjectionBundleSchema","BoardStaticProjectionSchema","createStore","z","createStore"]}
@@ -1,4 +1,4 @@
1
- import { am as ReducerContractVersion, J as InitializeRequest, K as InitializeResult, p as DispatchRequest, q as DispatchResult, e as BoardStaticProjection, aj as ProjectRequest, aS as SeatProjectionBundle } from './extract-Bjuw_gdF.js';
1
+ import { am as ReducerContractVersion, J as InitializeRequest, K as InitializeResult, p as DispatchRequest, q as DispatchResult, e as BoardStaticProjection, aj as ProjectRequest, aS as SeatProjectionBundle } from './extract-CoLo4qhk.js';
2
2
 
3
3
  /** Exact worker ABI version; hosts must reject mismatched bundles. */
4
4
  declare const REDUCER_CONTRACT_VERSION: "0.8.0";
@@ -1,4 +1,5 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod';
2
+ import { z as z$1 } from 'zod';
2
3
  import { Point } from 'honeycomb-grid';
3
4
 
4
5
  /** JSON values shared by protocol and game-owned runtime state. */
@@ -1582,56 +1583,56 @@ declare namespace runtimeSchema {
1582
1583
  export { runtimeSchema_AuthoredViewSchema as AuthoredViewSchema, runtimeSchema_BoardStaticProjectionSchema as BoardStaticProjectionSchema, runtimeSchema_DispatchRequestSchema as DispatchRequestSchema, runtimeSchema_DispatchResultAcceptSchema as DispatchResultAcceptSchema, runtimeSchema_DispatchResultRejectSchema as DispatchResultRejectSchema, runtimeSchema_DispatchResultSchema as DispatchResultSchema, runtimeSchema_DispatchTraceAcceptedClientInputSchema as DispatchTraceAcceptedClientInputSchema, runtimeSchema_DispatchTracePhaseEnteredSchema as DispatchTracePhaseEnteredSchema, runtimeSchema_DispatchTraceRngConsumptionSchema as DispatchTraceRngConsumptionSchema, runtimeSchema_DispatchTraceSchema as DispatchTraceSchema, runtimeSchema_GameEventDetailSchema as GameEventDetailSchema, runtimeSchema_GameEventSchema as GameEventSchema, runtimeSchema_GameInputCancelSchema as GameInputCancelSchema, runtimeSchema_GameInputInteractionSchema as GameInputInteractionSchema, runtimeSchema_GameInputSchema as GameInputSchema, runtimeSchema_GameOutcomeReasonSchema as GameOutcomeReasonSchema, runtimeSchema_GameOutcomeSchema as GameOutcomeSchema, runtimeSchema_InitializeRequestSchema as InitializeRequestSchema, runtimeSchema_InitializeResultSchema as InitializeResultSchema, runtimeSchema_OutcomeResultSchema as OutcomeResultSchema, runtimeSchema_OutcomeScoreComponentSchema as OutcomeScoreComponentSchema, runtimeSchema_OutcomeStandingSchema as OutcomeStandingSchema, runtimeSchema_OutcomeTieBreakSchema as OutcomeTieBreakSchema, runtimeSchema_ProjectRequestSchema as ProjectRequestSchema, runtimeSchema_ProjectionTimingMetadataSchema as ProjectionTimingMetadataSchema, runtimeSchema_ReducerContractVersionSchema as ReducerContractVersionSchema, runtimeSchema_ReducerDomainStateSchema as ReducerDomainStateSchema, runtimeSchema_ReducerFlowStateSchema as ReducerFlowStateSchema, runtimeSchema_ReducerRuntimeLogEntryAcceptedClientInputSchema as ReducerRuntimeLogEntryAcceptedClientInputSchema, runtimeSchema_ReducerRuntimeLogEntryPhaseEnteredSchema as ReducerRuntimeLogEntryPhaseEnteredSchema, runtimeSchema_ReducerRuntimeLogEntryRngConsumptionSchema as ReducerRuntimeLogEntryRngConsumptionSchema, runtimeSchema_ReducerRuntimeLogEntrySchema as ReducerRuntimeLogEntrySchema, runtimeSchema_ReducerRuntimeLogEntryStateCommitSchema as ReducerRuntimeLogEntryStateCommitSchema, runtimeSchema_ReducerRuntimeStateSchema as ReducerRuntimeStateSchema, runtimeSchema_ReducerSessionStateSchema as ReducerSessionStateSchema, runtimeSchema_RngDrawSchema as RngDrawSchema, runtimeSchema_RngOperationParameterSchema as RngOperationParameterSchema, runtimeSchema_RngOperationSchema as RngOperationSchema, runtimeSchema_RngStateSchema as RngStateSchema, runtimeSchema_RuntimePendingInteractionSchema as RuntimePendingInteractionSchema, runtimeSchema_RuntimeSimultaneousCurrentSchema as RuntimeSimultaneousCurrentSchema, runtimeSchema_RuntimeSimultaneousStateSchema as RuntimeSimultaneousStateSchema, runtimeSchema_RuntimeSimultaneousSubmissionSchema as RuntimeSimultaneousSubmissionSchema, runtimeSchema_SchedulerContinuationDependencySchema as SchedulerContinuationDependencySchema, runtimeSchema_SchedulerFlowAuthorityProjectionSchema as SchedulerFlowAuthorityProjectionSchema, runtimeSchema_SeatProjectionBundleSchema as SeatProjectionBundleSchema, runtimeSchema_SeatProjectionSchema as SeatProjectionSchema, runtimeSchema_SimultaneousPhaseProjectionSchema as SimultaneousPhaseProjectionSchema, runtimeSchema_SystemActionEventSchema as SystemActionEventSchema, runtimeSchema_TransitionRecordSchema as TransitionRecordSchema };
1583
1584
  }
1584
1585
 
1585
- type ReducerContractVersion = z.infer<typeof ReducerContractVersionSchema>;
1586
- type RngOperationParameter = z.infer<typeof RngOperationParameterSchema>;
1587
- type RngOperation = z.infer<typeof RngOperationSchema>;
1588
- type RngDraw = z.infer<typeof RngDrawSchema>;
1589
- type RngState = z.infer<typeof RngStateSchema>;
1590
- type ReducerFlowState = z.infer<typeof ReducerFlowStateSchema>;
1591
- type RuntimeSimultaneousSubmission$1 = z.infer<typeof RuntimeSimultaneousSubmissionSchema>;
1592
- type RuntimeSimultaneousCurrent = z.infer<typeof RuntimeSimultaneousCurrentSchema>;
1593
- type RuntimeSimultaneousState$1 = z.infer<typeof RuntimeSimultaneousStateSchema>;
1594
- type TransitionRecord = z.infer<typeof TransitionRecordSchema>;
1595
- type ReducerRuntimeState = z.infer<typeof ReducerRuntimeStateSchema>;
1596
- type ReducerDomainState = z.infer<typeof ReducerDomainStateSchema>;
1597
- type ReducerSessionState = z.infer<typeof ReducerSessionStateSchema>;
1598
- type GameInputInteraction = z.infer<typeof GameInputInteractionSchema>;
1599
- type GameInput = z.infer<typeof GameInputSchema>;
1600
- type GameOutcomeReason = z.infer<typeof GameOutcomeReasonSchema>;
1601
- type OutcomeResult$1 = z.infer<typeof OutcomeResultSchema>;
1602
- type OutcomeScoreComponent$1 = z.infer<typeof OutcomeScoreComponentSchema>;
1603
- type OutcomeTieBreak$1 = z.infer<typeof OutcomeTieBreakSchema>;
1604
- type OutcomeStanding$1 = z.infer<typeof OutcomeStandingSchema>;
1605
- type GameOutcome$1 = z.infer<typeof GameOutcomeSchema>;
1606
- type GameEventDetail$1 = z.infer<typeof GameEventDetailSchema>;
1607
- type SystemActionEvent$1 = z.infer<typeof SystemActionEventSchema>;
1608
- type GameEvent$1 = z.infer<typeof GameEventSchema>;
1609
- type InitializeResult = z.infer<typeof InitializeResultSchema>;
1610
- type InitializeRequest = z.infer<typeof InitializeRequestSchema>;
1611
- type DispatchRequest = z.infer<typeof DispatchRequestSchema>;
1612
- type DispatchTraceAcceptedClientInput = z.infer<typeof DispatchTraceAcceptedClientInputSchema>;
1613
- type DispatchTracePhaseEntered = z.infer<typeof DispatchTracePhaseEnteredSchema>;
1614
- type DispatchTraceRngConsumption = z.infer<typeof DispatchTraceRngConsumptionSchema>;
1615
- type DispatchTrace = z.infer<typeof DispatchTraceSchema>;
1616
- type DispatchResultReject = z.infer<typeof DispatchResultRejectSchema>;
1617
- type DispatchResultAccept = z.infer<typeof DispatchResultAcceptSchema>;
1618
- type DispatchResult = z.infer<typeof DispatchResultSchema>;
1619
- type ReducerRuntimeLogEntryAcceptedClientInput = z.infer<typeof ReducerRuntimeLogEntryAcceptedClientInputSchema>;
1620
- type ReducerRuntimeLogEntryPhaseEntered = z.infer<typeof ReducerRuntimeLogEntryPhaseEnteredSchema>;
1621
- type ReducerRuntimeLogEntryRngConsumption = z.infer<typeof ReducerRuntimeLogEntryRngConsumptionSchema>;
1622
- type ReducerRuntimeLogEntryStateCommit = z.infer<typeof ReducerRuntimeLogEntryStateCommitSchema>;
1623
- type ReducerRuntimeLogEntry = z.infer<typeof ReducerRuntimeLogEntrySchema>;
1624
- type SeatProjection = z.infer<typeof SeatProjectionSchema>;
1625
- type SimultaneousPhaseProjection = z.infer<typeof SimultaneousPhaseProjectionSchema>;
1626
- type SchedulerContinuationDependency = z.infer<typeof SchedulerContinuationDependencySchema>;
1627
- type SchedulerFlowAuthorityProjection = z.infer<typeof SchedulerFlowAuthorityProjectionSchema>;
1628
- type ProjectionTimingMetadata = z.infer<typeof ProjectionTimingMetadataSchema>;
1629
- type SeatProjectionBundle = z.infer<typeof SeatProjectionBundleSchema>;
1630
- type ProjectRequest = z.infer<typeof ProjectRequestSchema>;
1631
- type BoardStaticProjection = z.infer<typeof BoardStaticProjectionSchema>;
1632
- type RuntimePendingInteraction = z.infer<typeof RuntimePendingInteractionSchema>;
1633
- type GameInputCancel = z.infer<typeof GameInputCancelSchema>;
1634
- type AuthoredView = z.infer<typeof AuthoredViewSchema>;
1586
+ type ReducerContractVersion = z$1.infer<typeof ReducerContractVersionSchema>;
1587
+ type RngOperationParameter = z$1.infer<typeof RngOperationParameterSchema>;
1588
+ type RngOperation = z$1.infer<typeof RngOperationSchema>;
1589
+ type RngDraw = z$1.infer<typeof RngDrawSchema>;
1590
+ type RngState = z$1.infer<typeof RngStateSchema>;
1591
+ type ReducerFlowState = z$1.infer<typeof ReducerFlowStateSchema>;
1592
+ type RuntimeSimultaneousSubmission$1 = z$1.infer<typeof RuntimeSimultaneousSubmissionSchema>;
1593
+ type RuntimeSimultaneousCurrent = z$1.infer<typeof RuntimeSimultaneousCurrentSchema>;
1594
+ type RuntimeSimultaneousState$1 = z$1.infer<typeof RuntimeSimultaneousStateSchema>;
1595
+ type TransitionRecord = z$1.infer<typeof TransitionRecordSchema>;
1596
+ type ReducerRuntimeState = z$1.infer<typeof ReducerRuntimeStateSchema>;
1597
+ type ReducerDomainState = z$1.infer<typeof ReducerDomainStateSchema>;
1598
+ type ReducerSessionState = z$1.infer<typeof ReducerSessionStateSchema>;
1599
+ type GameInputInteraction = z$1.infer<typeof GameInputInteractionSchema>;
1600
+ type GameInput = z$1.infer<typeof GameInputSchema>;
1601
+ type GameOutcomeReason = z$1.infer<typeof GameOutcomeReasonSchema>;
1602
+ type OutcomeResult$1 = z$1.infer<typeof OutcomeResultSchema>;
1603
+ type OutcomeScoreComponent$1 = z$1.infer<typeof OutcomeScoreComponentSchema>;
1604
+ type OutcomeTieBreak$1 = z$1.infer<typeof OutcomeTieBreakSchema>;
1605
+ type OutcomeStanding$1 = z$1.infer<typeof OutcomeStandingSchema>;
1606
+ type GameOutcome$1 = z$1.infer<typeof GameOutcomeSchema>;
1607
+ type GameEventDetail$1 = z$1.infer<typeof GameEventDetailSchema>;
1608
+ type SystemActionEvent$1 = z$1.infer<typeof SystemActionEventSchema>;
1609
+ type GameEvent$1 = z$1.infer<typeof GameEventSchema>;
1610
+ type InitializeResult = z$1.infer<typeof InitializeResultSchema>;
1611
+ type InitializeRequest = z$1.infer<typeof InitializeRequestSchema>;
1612
+ type DispatchRequest = z$1.infer<typeof DispatchRequestSchema>;
1613
+ type DispatchTraceAcceptedClientInput = z$1.infer<typeof DispatchTraceAcceptedClientInputSchema>;
1614
+ type DispatchTracePhaseEntered = z$1.infer<typeof DispatchTracePhaseEnteredSchema>;
1615
+ type DispatchTraceRngConsumption = z$1.infer<typeof DispatchTraceRngConsumptionSchema>;
1616
+ type DispatchTrace = z$1.infer<typeof DispatchTraceSchema>;
1617
+ type DispatchResultReject = z$1.infer<typeof DispatchResultRejectSchema>;
1618
+ type DispatchResultAccept = z$1.infer<typeof DispatchResultAcceptSchema>;
1619
+ type DispatchResult = z$1.infer<typeof DispatchResultSchema>;
1620
+ type ReducerRuntimeLogEntryAcceptedClientInput = z$1.infer<typeof ReducerRuntimeLogEntryAcceptedClientInputSchema>;
1621
+ type ReducerRuntimeLogEntryPhaseEntered = z$1.infer<typeof ReducerRuntimeLogEntryPhaseEnteredSchema>;
1622
+ type ReducerRuntimeLogEntryRngConsumption = z$1.infer<typeof ReducerRuntimeLogEntryRngConsumptionSchema>;
1623
+ type ReducerRuntimeLogEntryStateCommit = z$1.infer<typeof ReducerRuntimeLogEntryStateCommitSchema>;
1624
+ type ReducerRuntimeLogEntry = z$1.infer<typeof ReducerRuntimeLogEntrySchema>;
1625
+ type SeatProjection = z$1.infer<typeof SeatProjectionSchema>;
1626
+ type SimultaneousPhaseProjection = z$1.infer<typeof SimultaneousPhaseProjectionSchema>;
1627
+ type SchedulerContinuationDependency = z$1.infer<typeof SchedulerContinuationDependencySchema>;
1628
+ type SchedulerFlowAuthorityProjection = z$1.infer<typeof SchedulerFlowAuthorityProjectionSchema>;
1629
+ type ProjectionTimingMetadata = z$1.infer<typeof ProjectionTimingMetadataSchema>;
1630
+ type SeatProjectionBundle = z$1.infer<typeof SeatProjectionBundleSchema>;
1631
+ type ProjectRequest = z$1.infer<typeof ProjectRequestSchema>;
1632
+ type BoardStaticProjection = z$1.infer<typeof BoardStaticProjectionSchema>;
1633
+ type RuntimePendingInteraction = z$1.infer<typeof RuntimePendingInteractionSchema>;
1634
+ type GameInputCancel = z$1.infer<typeof GameInputCancelSchema>;
1635
+ type AuthoredView = z$1.infer<typeof AuthoredViewSchema>;
1635
1636
 
1636
1637
  type runtimeTypes_AuthoredView = AuthoredView;
1637
1638
  type runtimeTypes_BoardStaticProjection = BoardStaticProjection;
@@ -3664,7 +3665,7 @@ type CollectorValueWitness<Value> = {
3664
3665
  type CollectorValueOf<Collector> = Collector extends CollectorValueWitness<infer Value> ? Value : Collector extends {
3665
3666
  readonly schema: SchemaLike<infer Value>;
3666
3667
  } ? Value : never;
3667
- type InputCollectorBase<Schema extends SchemaLike<unknown> = SchemaLike<unknown>, State extends CollectorState = CollectorState, Kind extends InputCollectorKind = InputCollectorKind, Value = z.infer<Schema>> = CollectorValueWitness<Value> & {
3668
+ type InputCollectorBase<Schema extends SchemaLike<unknown> = SchemaLike<unknown>, State extends CollectorState = CollectorState, Kind extends InputCollectorKind = InputCollectorKind, Value = z$1.infer<Schema>> = CollectorValueWitness<Value> & {
3668
3669
  readonly kind: Kind;
3669
3670
  readonly schema: Schema;
3670
3671
  readonly defaultValue?: Value;
@@ -3679,7 +3680,7 @@ type InputCollectorBase<Schema extends SchemaLike<unknown> = SchemaLike<unknown>
3679
3680
  } : {
3680
3681
  readonly domain?: DomainProjector<InputDomainForCollectorKind<Kind>>;
3681
3682
  }) & InputCollectorMetaSlot<Kind>;
3682
- type InputCollector<Schema extends SchemaLike<unknown> = SchemaLike<unknown>, State extends CollectorState = CollectorState, Kind extends InputCollectorKind = InputCollectorKind, Value = z.infer<Schema>> = Kind extends InputCollectorKind ? InputCollectorBase<Schema, State, Kind, Value> : never;
3683
+ type InputCollector<Schema extends SchemaLike<unknown> = SchemaLike<unknown>, State extends CollectorState = CollectorState, Kind extends InputCollectorKind = InputCollectorKind, Value = z$1.infer<Schema>> = Kind extends InputCollectorKind ? InputCollectorBase<Schema, State, Kind, Value> : never;
3683
3684
  type ParamsOf<Collectors extends Record<string, InputCollector>> = {
3684
3685
  [K in keyof Collectors]: CollectorValueOf<Collectors[K]>;
3685
3686
  };
@@ -3702,7 +3703,7 @@ type ClientParamsOf<Collectors extends Record<string, InputCollector>> = ClientP
3702
3703
  }>;
3703
3704
  /** Parsed client syntax, before authoritative target membership is checked. */
3704
3705
  type ClientSyntaxParamsOf<Collectors extends Record<string, InputCollector>> = ClientParamRecord<{
3705
- [Key in ClientCollectorKeys<Collectors>]: z.infer<Collectors[Key]["schema"]>;
3706
+ [Key in ClientCollectorKeys<Collectors>]: z$1.infer<Collectors[Key]["schema"]>;
3706
3707
  }>;
3707
3708
 
3708
3709
  type StepCollector = Exclude<InputCollector, {
@@ -3931,8 +3932,8 @@ type PhaseDefinitionCommon<PhaseStateSchema extends SchemaLike<object>, State ex
3931
3932
  state: State;
3932
3933
  playerIds: PlayerIdOfState<State>[];
3933
3934
  options: Options;
3934
- }) => z.infer<PhaseStateSchema>;
3935
- enter?: BivariantCallback<PhaseEnterArgs<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest, ErrorCode>, ReducerResult<ScopedPhaseState<State, z.infer<PhaseStateSchema>>> | void>;
3935
+ }) => z$1.infer<PhaseStateSchema>;
3936
+ enter?: BivariantCallback<PhaseEnterArgs<ScopedPhaseState<State, z$1.infer<PhaseStateSchema>>, Manifest, ErrorCode>, ReducerResult<ScopedPhaseState<State, z$1.infer<PhaseStateSchema>>> | void>;
3936
3937
  };
3937
3938
  type AutoPhaseDefinition<PhaseStateSchema extends SchemaLike<object>, State extends {
3938
3939
  table: RuntimeTableRecord;
@@ -3955,14 +3956,14 @@ type PlayerPhaseDefinition<PhaseStateSchema extends SchemaLike<object>, State ex
3955
3956
  currentPhase: string;
3956
3957
  };
3957
3958
  phase: object;
3958
- }, Manifest extends ManifestContract<TableOfState<State>>, Interactions extends InteractionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Options extends RuntimeRecord = RuntimeRecord, ErrorCode extends string = string> = PhaseDefinitionCommon<PhaseStateSchema, State, Manifest, ErrorCode, Options> & {
3959
+ }, Manifest extends ManifestContract<TableOfState<State>>, Interactions extends InteractionMap<ScopedPhaseState<State, z$1.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Options extends RuntimeRecord = RuntimeRecord, ErrorCode extends string = string> = PhaseDefinitionCommon<PhaseStateSchema, State, Manifest, ErrorCode, Options> & {
3959
3960
  kind: "player";
3960
3961
  /**
3961
3962
  * Default actor selector for interactions in this phase. When omitted the
3962
3963
  * runtime falls back to `flow.activePlayers`, preserving the existing turn
3963
3964
  * ownership model. Returning multiple players models simultaneous actors.
3964
3965
  */
3965
- actor?: ActorSelector<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest>;
3966
+ actor?: ActorSelector<ScopedPhaseState<State, z$1.infer<PhaseStateSchema>>, Manifest>;
3966
3967
  actors?: never;
3967
3968
  submit?: never;
3968
3969
  canResubmit?: never;
@@ -3975,20 +3976,20 @@ type SimultaneousPlayerPhaseDefinition<PhaseStateSchema extends SchemaLike<objec
3975
3976
  currentPhase: string;
3976
3977
  };
3977
3978
  phase: object;
3978
- }, Manifest extends ManifestContract<TableOfState<State>>, SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Interactions extends InteractionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Options extends RuntimeRecord = RuntimeRecord, ErrorCode extends string = string> = PhaseDefinitionCommon<PhaseStateSchema, State, Manifest, ErrorCode, Options> & {
3979
+ }, Manifest extends ManifestContract<TableOfState<State>>, SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Interactions extends InteractionMap<ScopedPhaseState<State, z$1.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Options extends RuntimeRecord = RuntimeRecord, ErrorCode extends string = string> = PhaseDefinitionCommon<PhaseStateSchema, State, Manifest, ErrorCode, Options> & {
3979
3980
  kind: "simultaneousPlayer";
3980
3981
  actor?: never;
3981
3982
  /**
3982
3983
  * Actor selector for `kind: "simultaneousPlayer"` phases. This is an alias
3983
3984
  * of `actor` with wording that matches simultaneous submission semantics.
3984
3985
  */
3985
- actors: ActorSelector<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest>;
3986
+ actors: ActorSelector<ScopedPhaseState<State, z$1.infer<PhaseStateSchema>>, Manifest>;
3986
3987
  /**
3987
3988
  * Canonical sealed submission interaction for simultaneous phases. It is
3988
3989
  * projected like a normal interaction, but the trusted runtime stores the
3989
3990
  * parsed params until every actor has submitted, then calls `resolve`.
3990
3991
  */
3991
- submit: SimultaneousSubmitSpec<SubmitCollectors, ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest>;
3992
+ submit: SimultaneousSubmitSpec<SubmitCollectors, ScopedPhaseState<State, z$1.infer<PhaseStateSchema>>, Manifest>;
3992
3993
  /**
3993
3994
  * When false or omitted, each actor can submit once per simultaneous
3994
3995
  * barrier. Set true to allow replacing the sealed submission before every
@@ -4000,7 +4001,7 @@ type SimultaneousPlayerPhaseDefinition<PhaseStateSchema extends SchemaLike<objec
4000
4001
  * submitted params are passed together so game state mutates from one
4001
4002
  * deterministic base state instead of one player at a time.
4002
4003
  */
4003
- resolve: BivariantCallback<SimultaneousResolveArgs<SubmitCollectors, ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest, ErrorCode>, ReducerResult<ScopedPhaseState<State, z.infer<PhaseStateSchema>>> | void>;
4004
+ resolve: BivariantCallback<SimultaneousResolveArgs<SubmitCollectors, ScopedPhaseState<State, z$1.infer<PhaseStateSchema>>, Manifest, ErrorCode>, ReducerResult<ScopedPhaseState<State, z$1.infer<PhaseStateSchema>>> | void>;
4004
4005
  interactions?: Interactions;
4005
4006
  };
4006
4007
  type PhaseDefinition<PhaseStateSchema extends SchemaLike<object>, State extends {
@@ -4009,7 +4010,7 @@ type PhaseDefinition<PhaseStateSchema extends SchemaLike<object>, State extends
4009
4010
  currentPhase: string;
4010
4011
  };
4011
4012
  phase: object;
4012
- }, Manifest extends ManifestContract<TableOfState<State>>, SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Interactions extends InteractionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Options extends RuntimeRecord = RuntimeRecord, ErrorCode extends string = string> = AutoPhaseDefinition<PhaseStateSchema, State, Manifest, ErrorCode, Options> | PlayerPhaseDefinition<PhaseStateSchema, State, Manifest, Interactions, Options, ErrorCode> | SimultaneousPlayerPhaseDefinition<PhaseStateSchema, State, Manifest, SubmitCollectors, Interactions, Options, ErrorCode>;
4013
+ }, Manifest extends ManifestContract<TableOfState<State>>, SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Interactions extends InteractionMap<ScopedPhaseState<State, z$1.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Options extends RuntimeRecord = RuntimeRecord, ErrorCode extends string = string> = AutoPhaseDefinition<PhaseStateSchema, State, Manifest, ErrorCode, Options> | PlayerPhaseDefinition<PhaseStateSchema, State, Manifest, Interactions, Options, ErrorCode> | SimultaneousPlayerPhaseDefinition<PhaseStateSchema, State, Manifest, SubmitCollectors, Interactions, Options, ErrorCode>;
4013
4014
 
4014
4015
  /** Authored fields retain their domain types; wire admission validates JSON. */
4015
4016
  type ViewData = Record<string, unknown> & {
@@ -4056,7 +4057,7 @@ type ReducerGameContract<Table extends RuntimeTableRecord, Manifest extends Redu
4056
4057
  /** Derived from `phases`; retained as an internal runtime convenience. */
4057
4058
  phaseNames: readonly string[];
4058
4059
  };
4059
- type BaseGameStateOfContract<Contract> = ReducerGameState<TableOfManifest<ManifestContractOf<Contract>>, z.infer<PublicSchemaOfContract<Contract>>, z.infer<PrivateSchemaOfContract<Contract>>, z.infer<HiddenSchemaOfContract<Contract>>, PhaseStateMapOfContract<Contract>[PhaseNameOfContract<Contract>], PhaseNameOfContract<Contract>, PhaseStateMapOfContract<Contract>>;
4060
+ type BaseGameStateOfContract<Contract> = ReducerGameState<TableOfManifest<ManifestContractOf<Contract>>, z$1.infer<PublicSchemaOfContract<Contract>>, z$1.infer<PrivateSchemaOfContract<Contract>>, z$1.infer<HiddenSchemaOfContract<Contract>>, PhaseStateMapOfContract<Contract>[PhaseNameOfContract<Contract>], PhaseNameOfContract<Contract>, PhaseStateMapOfContract<Contract>>;
4060
4061
  /**
4061
4062
  * Heterogeneous phase map for a contract. Each phase carries its own local
4062
4063
  * `PhaseStateSchema` plus authoring-time Actions/Flows/Interactions/
@@ -4070,13 +4071,13 @@ type PhaseMapOf<Contract> = {
4070
4071
  type PhaseStateOfDefinitions<Definitions extends Record<string, PhaseDefinition<SchemaLike<object>, any, any, Record<string, InputCollector>, InteractionMap<any, any>, any>>> = {
4071
4072
  [Name in keyof Definitions & string]: Definitions[Name] extends {
4072
4073
  state: infer PhaseStateSchema extends SchemaLike<object>;
4073
- } ? z.infer<PhaseStateSchema> : never;
4074
+ } ? z$1.infer<PhaseStateSchema> : never;
4074
4075
  }[keyof Definitions & string];
4075
4076
  type ResolvedGameStateOf<Contract, Definitions extends PhaseMapOf<Contract>> = {
4076
- [Name in keyof Definitions & string]: ReducerGameState<TableOfManifest<ManifestContractOf<Contract>>, z.infer<PublicSchemaOfContract<Contract>>, z.infer<PrivateSchemaOfContract<Contract>>, z.infer<HiddenSchemaOfContract<Contract>>, Definitions[Name] extends {
4077
+ [Name in keyof Definitions & string]: ReducerGameState<TableOfManifest<ManifestContractOf<Contract>>, z$1.infer<PublicSchemaOfContract<Contract>>, z$1.infer<PrivateSchemaOfContract<Contract>>, z$1.infer<HiddenSchemaOfContract<Contract>>, Definitions[Name] extends {
4077
4078
  state: infer PhaseStateSchema extends SchemaLike<object>;
4078
- } ? z.infer<PhaseStateSchema> : never, PhaseNameOfContract<Contract>> & {
4079
- flow: ReducerGameState<TableOfManifest<ManifestContractOf<Contract>>, z.infer<PublicSchemaOfContract<Contract>>, z.infer<PrivateSchemaOfContract<Contract>>, z.infer<HiddenSchemaOfContract<Contract>>, PhaseStateOfDefinitions<Definitions>, PhaseNameOfContract<Contract>>["flow"] & {
4079
+ } ? z$1.infer<PhaseStateSchema> : never, PhaseNameOfContract<Contract>> & {
4080
+ flow: ReducerGameState<TableOfManifest<ManifestContractOf<Contract>>, z$1.infer<PublicSchemaOfContract<Contract>>, z$1.infer<PrivateSchemaOfContract<Contract>>, z$1.infer<HiddenSchemaOfContract<Contract>>, PhaseStateOfDefinitions<Definitions>, PhaseNameOfContract<Contract>>["flow"] & {
4080
4081
  currentPhase: Name;
4081
4082
  };
4082
4083
  };
@@ -4105,11 +4106,11 @@ type ReducerGameContractLike = {
4105
4106
  };
4106
4107
  type InitialStateContextOf<Contract extends ReducerGameContractLike> = InitContext<TableOfManifest<ManifestOf<Contract>>, ExactManifestContractOf<Contract>, OptionsOfContract<Contract>>;
4107
4108
  type InitialStateCallbacks<Contract extends ReducerGameContractLike> = {
4108
- public?: (ctx: InitialStateContextOf<Contract>) => z.infer<PublicSchemaOfContract<Contract>>;
4109
+ public?: (ctx: InitialStateContextOf<Contract>) => z$1.infer<PublicSchemaOfContract<Contract>>;
4109
4110
  private?: (ctx: InitialStateContextOf<Contract> & {
4110
4111
  playerId: PlayerIdOfTable<TableOfManifest<ManifestOf<Contract>>>;
4111
- }) => z.infer<PrivateSchemaOfContract<Contract>>;
4112
- hidden?: (ctx: InitialStateContextOf<Contract>) => z.infer<HiddenSchemaOfContract<Contract>>;
4112
+ }) => z$1.infer<PrivateSchemaOfContract<Contract>>;
4113
+ hidden?: (ctx: InitialStateContextOf<Contract>) => z$1.infer<HiddenSchemaOfContract<Contract>>;
4113
4114
  };
4114
4115
  declare const validatedReducerDefinition: unique symbol;
4115
4116
  /** Authored input to game.assemble; no runtime contract or validation marker. */
@@ -4583,7 +4584,7 @@ type TableOfState<State> = State extends {
4583
4584
  table: infer Table;
4584
4585
  } ? Table : never;
4585
4586
  type TableOfManifest<Manifest> = Manifest extends {
4586
- tableSchema: z.ZodType<infer Table extends RuntimeTableRecord>;
4587
+ tableSchema: z$1.ZodType<infer Table extends RuntimeTableRecord>;
4587
4588
  } ? Table : Manifest extends ReducerManifestContractLike<infer Table> ? Table : never;
4588
4589
  type PhaseNameOfState<State> = State extends {
4589
4590
  flow: {
@@ -4714,7 +4715,7 @@ type PhaseSchemasOfContract<Contract> = Contract extends {
4714
4715
  phases: infer Phases extends Record<string, SchemaLike<object>>;
4715
4716
  } ? Phases : Record<PhaseNameOfManifest<ManifestOf<Contract>>, SchemaLike<object>>;
4716
4717
  type PhaseStateMapOfContract<Contract> = {
4717
- [Name in keyof PhaseSchemasOfContract<Contract> & string]: z.infer<PhaseSchemasOfContract<Contract>[Name]>;
4718
+ [Name in keyof PhaseSchemasOfContract<Contract> & string]: z$1.infer<PhaseSchemasOfContract<Contract>[Name]>;
4718
4719
  };
4719
4720
  type PublicSchemaOfContract<Contract> = StateDefinitionOfContract<Contract> extends StateDefinition<infer PublicSchema, SchemaLike<object>, SchemaLike<object>> ? PublicSchema : never;
4720
4721
  type PrivateSchemaOfContract<Contract> = StateDefinitionOfContract<Contract> extends StateDefinition<SchemaLike<object>, infer PrivateSchema, SchemaLike<object>> ? PrivateSchema : never;
@@ -4739,7 +4740,7 @@ type CompatibleCardIdForTwoPlayerZones<Table, FromZoneId extends HandIdOfTable<T
4739
4740
  type OptionsSchemaOfContract<Contract> = Contract extends {
4740
4741
  options: infer Schema extends SchemaLike<RuntimeRecord>;
4741
4742
  } ? Schema : SchemaLike<Record<string, never>>;
4742
- type OptionsOfContract<Contract> = z.infer<OptionsSchemaOfContract<Contract>>;
4743
+ type OptionsOfContract<Contract> = z$1.infer<OptionsSchemaOfContract<Contract>>;
4743
4744
  /** Slot hosts share the canonical piece and die inventories. */
4744
4745
  type SlotHostOfTable<Table extends RuntimeTableRecord> = {
4745
4746
  kind: "piece";
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { q as Features, E as InstanceOptions, n as CoreInstance, p as FeatureContext, G as GameInstance, C as Card, a8 as Zone, a2 as SeatCardId, d as BoardCollection, h as BoardSpaceCollection, c as BoardBase, _ as RuntimeFeatureContext, Y as RuntimeCollection, V as RuntimeBoard, U as ReadonlyData, a1 as RuntimeTargetOptions, A as ActionProps, g as BoardSpace, a5 as TargetOptions, o as DropTarget, I as IdOf } from './model-D2Z9j0Yi.js';
2
- export { a as AnyInput, b as AnyInteraction, B as Board, e as BoardDataOf, f as BoardDropTarget, i as BoardSpaceData, j as BoardSpaceId, k as BoardTarget, l as CardBase, m as CardDataOf, D as Drafts, F as Feature, r as GameSnapshot, H as Hook, s as Input, t as InputBase, u as InputControl, v as InputDomainOf, w as InputKey, x as InputKind, y as InputTarget, z as InputTargetOption, J as Interaction, K as InteractionBase, L as InteractionDropTarget, M as InteractionKey, N as InteractionParams, O as LocalState, P as NativeEvent, Q as Phase, R as PhaseName, S as Player, T as ReadModel, W as RuntimeBoardDropTarget, X as RuntimeBoardTarget, Z as RuntimeDropTarget, $ as RuntimeInteractionDropTarget, a0 as RuntimeSelectionTarget, a3 as SelectionTarget, a4 as TableOfGame, a6 as Turn, a7 as ViewOf, a9 as ZoneBase } from './model-D2Z9j0Yi.js';
3
- import { I as InteractionDescriptor, b as GameplayBasis, e as PluginSessionDescriptor, c as PluginGameplayFrame, G as GameSource, h as SourceSnapshot, C as CommandSource, P as PlayerId, f as ReducerSeatProjectionBundle, R as ReducerBoardStaticProjection } from './types-B3kIhBWb.js';
4
- export { A as ActionInteractionDescriptor, a as ApplySource, d as PluginPlayerSummary, S as SimultaneousPhaseSnapshot, g as SourceRequest, i as SourceState, j as SubmitResult, Z as ZoneHandlesSnapshot } from './types-B3kIhBWb.js';
5
- import { z } from 'zod';
6
- import { aJ as RuntimeJson, aC as RuntimeBoardSpaceState } from './extract-Bjuw_gdF.js';
7
- export { G as GameEvent, r as GameEventDetail, t as GameOutcome, I as HiddenCardId, N as InputDomain, O as InputDomainSchema, P as InputSelection, R as InteractionAvailability, S as InteractionAvailabilitySchema, T as InteractionChoiceOption, U as InteractionCommitPolicy, V as InteractionCommitPolicySchema, X as InteractionDescriptorSchema, Y as InteractionDiagnosticReason, _ as InteractionInputDescriptor, $ as InteractionInputDescriptorSchema, aa as OutcomeResult, ab as OutcomeScoreComponent, ac as OutcomeStanding, ad as OutcomeTieBreak, aK as RuntimeJsonSchema, aX as SystemActionEvent, b4 as ViewCard } from './extract-Bjuw_gdF.js';
1
+ import { q as Features, E as InstanceOptions, n as CoreInstance, p as FeatureContext, G as GameInstance, C as Card, a8 as Zone, a2 as SeatCardId, d as BoardCollection, h as BoardSpaceCollection, c as BoardBase, _ as RuntimeFeatureContext, Y as RuntimeCollection, V as RuntimeBoard, U as ReadonlyData, a1 as RuntimeTargetOptions, A as ActionProps, g as BoardSpace, a5 as TargetOptions, o as DropTarget, I as IdOf } from './model-Cvfxwq2n.js';
2
+ export { a as AnyInput, b as AnyInteraction, B as Board, e as BoardDataOf, f as BoardDropTarget, i as BoardSpaceData, j as BoardSpaceId, k as BoardTarget, l as CardBase, m as CardDataOf, D as Drafts, F as Feature, r as GameSnapshot, H as Hook, s as Input, t as InputBase, u as InputControl, v as InputDomainOf, w as InputKey, x as InputKind, y as InputTarget, z as InputTargetOption, J as Interaction, K as InteractionBase, L as InteractionDropTarget, M as InteractionKey, N as InteractionParams, O as LocalState, P as NativeEvent, Q as Phase, R as PhaseName, S as Player, T as ReadModel, W as RuntimeBoardDropTarget, X as RuntimeBoardTarget, Z as RuntimeDropTarget, $ as RuntimeInteractionDropTarget, a0 as RuntimeSelectionTarget, a3 as SelectionTarget, a4 as TableOfGame, a6 as Turn, a7 as ViewOf, a9 as ZoneBase } from './model-Cvfxwq2n.js';
3
+ import { I as InteractionDescriptor, b as GameplayBasis, e as PluginSessionDescriptor, c as PluginGameplayFrame, G as GameSource, h as SourceSnapshot, C as CommandSource, P as PlayerId, f as ReducerSeatProjectionBundle, R as ReducerBoardStaticProjection } from './types-DPamTmUF.js';
4
+ export { A as ActionInteractionDescriptor, a as ApplySource, d as PluginPlayerSummary, S as SimultaneousPhaseSnapshot, g as SourceRequest, i as SourceState, j as SubmitResult, Z as ZoneHandlesSnapshot } from './types-DPamTmUF.js';
5
+ import * as z from 'zod';
6
+ import { aJ as RuntimeJson, aC as RuntimeBoardSpaceState } from './extract-CoLo4qhk.js';
7
+ export { G as GameEvent, r as GameEventDetail, t as GameOutcome, I as HiddenCardId, N as InputDomain, O as InputDomainSchema, P as InputSelection, R as InteractionAvailability, S as InteractionAvailabilitySchema, T as InteractionChoiceOption, U as InteractionCommitPolicy, V as InteractionCommitPolicySchema, X as InteractionDescriptorSchema, Y as InteractionDiagnosticReason, _ as InteractionInputDescriptor, $ as InteractionInputDescriptorSchema, aa as OutcomeResult, ab as OutcomeScoreComponent, ac as OutcomeStanding, ad as OutcomeTieBreak, aK as RuntimeJsonSchema, aX as SystemActionEvent, b4 as ViewCard } from './extract-CoLo4qhk.js';
8
8
  import './board-target-B0QG6OYx.js';
9
9
  import '@tanstack/store';
10
10
  import 'honeycomb-grid';
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  createGestureRecognizer,
6
6
  isSameDropTarget,
7
7
  runtimeFeatures
8
- } from "./chunk-HZPKKBEG.js";
8
+ } from "./chunk-EQ4BAJSB.js";
9
9
  import {
10
10
  BoardStaticProjectionSchema,
11
11
  CancelInteractionCommandSchema,
@@ -40,7 +40,7 @@ import {
40
40
  parsePluginSessionDescriptor,
41
41
  parsePluginToHostEnvelope,
42
42
  staticSource
43
- } from "./chunk-N37D7NPB.js";
43
+ } from "./chunk-GZVYEVXY.js";
44
44
  import "./chunk-DMFVAZI2.js";
45
45
  import {
46
46
  InputDomainSchema,
@@ -53,13 +53,13 @@ import {
53
53
  createHexBoardGeometry,
54
54
  digestPluginRuntimeJson,
55
55
  encodeCanonicalPluginRuntimeJson
56
- } from "./chunk-K75F5UIJ.js";
56
+ } from "./chunk-4H4TAIV7.js";
57
57
  import {
58
58
  requireLookup
59
- } from "./chunk-3JXUL4VN.js";
59
+ } from "./chunk-DPRHGA2C.js";
60
60
 
61
61
  // src/package-set.ts
62
- var DREAMBOARD_SDK_VERSION = true ? "0.5.0-alpha.7" : "0.0.0-development";
62
+ var DREAMBOARD_SDK_VERSION = true ? "0.5.0-alpha.8" : "0.0.0-development";
63
63
  var DREAMBOARD_SDK_PACKAGES = {
64
64
  "@dreamboard-games/sdk": DREAMBOARD_SDK_VERSION
65
65
  };
@@ -139,7 +139,7 @@ function iframeSource(options = {}) {
139
139
  }
140
140
 
141
141
  // src/shared/protocol/gameplay-wire.ts
142
- import { z } from "zod";
142
+ import * as z from "zod";
143
143
  var GameplayCloseCode = {
144
144
  GoingAway: 1001,
145
145
  CredentialExpired: 4e3,