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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/README.md +127 -0
  2. package/dist/browser-interaction.d.ts +22 -22
  3. package/dist/{chunk-VRRR6QZT.js → chunk-32PFKDV7.js} +170 -406
  4. package/dist/chunk-32PFKDV7.js.map +1 -0
  5. package/dist/{chunk-N33CGX2F.js → chunk-3BAD4VC2.js} +3 -3
  6. package/dist/{chunk-LMHCGCA6.js → chunk-3SKDNDPG.js} +2 -2
  7. package/dist/chunk-5YV2WHJ4.js +25 -0
  8. package/dist/chunk-5YV2WHJ4.js.map +1 -0
  9. package/dist/{chunk-VWTKGIYF.js → chunk-ANRB4XKA.js} +1 -1
  10. package/dist/chunk-ANRB4XKA.js.map +1 -0
  11. package/dist/{chunk-EOEA3I64.js → chunk-BI4G3PM2.js} +7 -7
  12. package/dist/chunk-BI4G3PM2.js.map +1 -0
  13. package/dist/{chunk-KRJPRYEA.js → chunk-EVCLTY4Q.js} +21 -8
  14. package/dist/chunk-EVCLTY4Q.js.map +1 -0
  15. package/dist/{chunk-DQS2EG5E.js → chunk-GDPKTBUR.js} +2 -2
  16. package/dist/{chunk-FL67RDID.js → chunk-H6VDGFL5.js} +128 -128
  17. package/dist/chunk-H6VDGFL5.js.map +1 -0
  18. package/dist/{chunk-6LMESVGT.js → chunk-LR3ZTWQF.js} +3 -3
  19. package/dist/chunk-LR3ZTWQF.js.map +1 -0
  20. package/dist/{chunk-TXELBVTG.js → chunk-PN5O6GG2.js} +2 -2
  21. package/dist/{chunk-533O7C4L.js → chunk-S2JEDVWH.js} +500 -430
  22. package/dist/chunk-S2JEDVWH.js.map +1 -0
  23. package/dist/{chunk-2GQIALJL.js → chunk-UGH54WZ2.js} +6 -2
  24. package/dist/chunk-UGH54WZ2.js.map +1 -0
  25. package/dist/chunk-VCDWP5VL.js +746 -0
  26. package/dist/chunk-VCDWP5VL.js.map +1 -0
  27. package/dist/{chunk-ZSTCUJKZ.js → chunk-Y75CFE77.js} +2 -6
  28. package/dist/chunk-Y75CFE77.js.map +1 -0
  29. package/dist/chunk-Z7QCREWI.js +3435 -0
  30. package/dist/chunk-Z7QCREWI.js.map +1 -0
  31. package/dist/chunk-ZZGN2ATS.js +1941 -0
  32. package/dist/chunk-ZZGN2ATS.js.map +1 -0
  33. package/dist/{components-CNAt5J1p.d.ts → components-gAbIz7hK.d.ts} +2 -18
  34. package/dist/{definitions-bZSBaPjj.d.ts → definitions-BgmV_GhC.d.ts} +3 -3
  35. package/dist/digest.d.ts +2 -2
  36. package/dist/game-CsZScpcn.d.ts +763 -0
  37. package/dist/{index-CR69MyWr.d.ts → index-CcT9Q7N7.d.ts} +1 -1
  38. package/dist/{index.d-Bw8AOcgp.d.ts → index.d-DjzoK7zn.d.ts} +67 -2
  39. package/dist/index.js +1 -2
  40. package/dist/package-set.js +1 -2
  41. package/dist/plugin-runtime-contract.d.ts +4 -4
  42. package/dist/plugin-runtime-contract.js +13 -15
  43. package/dist/{protocol-CVaSqPgX.d.ts → protocol-dYgafTYY.d.ts} +1 -7
  44. package/dist/reducer/advanced.d.ts +12 -11
  45. package/dist/reducer/advanced.js +10 -4
  46. package/dist/reducer-contract.d.ts +10 -2
  47. package/dist/reducer-contract.js +4 -4
  48. package/dist/reducer.d.ts +12 -689
  49. package/dist/reducer.js +19 -1293
  50. package/dist/reducer.js.map +1 -1
  51. package/dist/runtime/primitives.d.ts +4 -4
  52. package/dist/runtime/primitives.js +5 -5
  53. package/dist/runtime/runtime-api.d.ts +2 -2
  54. package/dist/runtime/workspace-contract.d.ts +50 -17
  55. package/dist/runtime/workspace-contract.js +15 -10
  56. package/dist/{runtime-C7Z2acNU.d.ts → runtime-RJ5orDJU.d.ts} +23 -30
  57. package/dist/{plugin-state-BRH3UiUp.d.ts → runtime-api-Bz5pwNU_.d.ts} +86 -4
  58. package/dist/runtime.d.ts +8 -8
  59. package/dist/runtime.js +19 -17
  60. package/dist/runtime.js.map +1 -1
  61. package/dist/schema.d.ts +2 -28
  62. package/dist/testing-compiler.d.ts +4 -4
  63. package/dist/testing-runtime.d.ts +7 -7
  64. package/dist/testing-runtime.js +6 -6
  65. package/dist/testing.d.ts +17 -17
  66. package/dist/testing.js +14 -14
  67. package/dist/{types-q1Guidm5.d.ts → types-DR7DoB1x.d.ts} +1 -1
  68. package/dist/{types-DN4O7kH_.d.ts → types-JWCYHmu7.d.ts} +2 -2
  69. package/dist/types.js +6 -18
  70. package/dist/types.js.map +1 -1
  71. package/dist/ui/components.d.ts +3 -4
  72. package/dist/ui/components.js +1 -5
  73. package/dist/{ui-contract-BC4JpysE.d.ts → ui-contract-GTUPkf8z.d.ts} +175 -176
  74. package/dist/ui.d.ts +4 -5
  75. package/dist/ui.js +2 -6
  76. package/dist/{views-D2Cfzr3h.d.ts → views-BpuWcOyN.d.ts} +101 -48
  77. package/package.json +3 -22
  78. package/dist/authoring/index.d.ts +0 -59
  79. package/dist/authoring/index.js +0 -24
  80. package/dist/authoring/index.js.map +0 -1
  81. package/dist/authoring-compiler.d.ts +0 -27
  82. package/dist/authoring-compiler.js +0 -11
  83. package/dist/authoring-compiler.js.map +0 -1
  84. package/dist/authoring-materialize-cli.d.ts +0 -1
  85. package/dist/authoring-materialize-cli.js +0 -45
  86. package/dist/authoring-materialize-cli.js.map +0 -1
  87. package/dist/chunk-2GQIALJL.js.map +0 -1
  88. package/dist/chunk-533O7C4L.js.map +0 -1
  89. package/dist/chunk-6LMESVGT.js.map +0 -1
  90. package/dist/chunk-EOEA3I64.js.map +0 -1
  91. package/dist/chunk-FL67RDID.js.map +0 -1
  92. package/dist/chunk-HIH6Y4FA.js +0 -7802
  93. package/dist/chunk-HIH6Y4FA.js.map +0 -1
  94. package/dist/chunk-HUK4234C.js +0 -166
  95. package/dist/chunk-HUK4234C.js.map +0 -1
  96. package/dist/chunk-KGV2EUNN.js +0 -532
  97. package/dist/chunk-KGV2EUNN.js.map +0 -1
  98. package/dist/chunk-KRJPRYEA.js.map +0 -1
  99. package/dist/chunk-KWHOFBDM.js +0 -9
  100. package/dist/chunk-KWHOFBDM.js.map +0 -1
  101. package/dist/chunk-VRRR6QZT.js.map +0 -1
  102. package/dist/chunk-VWTKGIYF.js.map +0 -1
  103. package/dist/chunk-XFMSLL3P.js +0 -637
  104. package/dist/chunk-XFMSLL3P.js.map +0 -1
  105. package/dist/chunk-ZSTCUJKZ.js.map +0 -1
  106. package/dist/codegen.d.ts +0 -941
  107. package/dist/codegen.js +0 -44
  108. package/dist/codegen.js.map +0 -1
  109. package/dist/runtime-api-CgPuEVeF.d.ts +0 -86
  110. /package/dist/{chunk-N33CGX2F.js.map → chunk-3BAD4VC2.js.map} +0 -0
  111. /package/dist/{chunk-LMHCGCA6.js.map → chunk-3SKDNDPG.js.map} +0 -0
  112. /package/dist/{chunk-DQS2EG5E.js.map → chunk-GDPKTBUR.js.map} +0 -0
  113. /package/dist/{chunk-TXELBVTG.js.map → chunk-PN5O6GG2.js.map} +0 -0
package/dist/reducer.d.ts CHANGED
@@ -1,520 +1,18 @@
1
+ import { c2 as SchemaLike, a as AnySchema, cH as SystemActionEvent, bW as RuntimeTableRecord, cL as TableQueriesOfState, cK as TableQueries, e as BoardIdOfTable, c as BoardContainerIdOfTable, aF as PlayerIdOfState } from './runtime-RJ5orDJU.js';
2
+ export { h as BoardRef, R as FrameworkErrorCodes, S as GameEvent, T as GameEventDetail, U as GameOutcome, ak as OutcomeResult, al as OutcomeScoreComponent, am as OutcomeStanding, an as OutcomeTieBreak, ao as PerPlayer, ap as PerPlayerBoardRef, aq as PerPlayerSchemaOptions, aD as PlayerId, aO as ReducerAccept, aU as ReducerReject, aV as ReducerResult, aY as ReducerValidationResult, cl as SharedBoardRef, cZ as asPlayerId, c$ as boardRef, d0 as boardRefKey, d1 as boardRefSchema, d7 as isPerPlayer, d8 as isPerPlayerBoardRef, d9 as isPlayerId, da as isSharedBoardRef, dd as parseBoardRefKey, de as perPlayer, df as perPlayerBoardRef, dg as perPlayerEntries, dh as perPlayerGet, di as perPlayerHas, dj as perPlayerKeys, dk as perPlayerMap, dl as perPlayerRequire, dm as perPlayerSchema, dn as perPlayerSet, dp as perPlayerSize, dq as perPlayerValues, ds as sharedBoardRef } from './runtime-RJ5orDJU.js';
3
+ import { y as CollectorState, Z as InputCollector, a4 as InputSelectionDescriptor, z as ContinuationCallable, T as EffectRollDieDefinition, U as EffectShuffleDefinition, V as EffectShufflePlayerZoneDefinition, aH as ReducerGameContractLike, au as PhaseMapOf, bc as ViewMapOf, aI as ReducerGameDefinition } from './views-BpuWcOyN.js';
4
+ export { J as DerivedDefinition, K as DerivedResolver, ad as InteractionRule, an as Op, aJ as ReducerOps, aL as ReducerStateBase, aN as ReducerTransaction, aO as ReducerTransactionOutcome, aX as RotatePlayerZoneArgs, ba as ValidationIssue, bh as createDerivedResolver, bi as createReducerOps, bj as defineDerived, bk as pipe } from './views-BpuWcOyN.js';
5
+ import { o as TargetPredicate, A as AnyReducerGameContract, i as ContractState, h as ContractManifest, a as AuthoredManifest, g as CompiledManifest } from './game-CsZScpcn.js';
6
+ export { B as BoardTargetPredicate, b as BoundInputBuilders, c as BoundTargetPredicate, d as BoundViewBuilders, C as ChoiceOptionsFactory, e as ChoiceTargetOption, f as ChoiceTargetPredicate, j as ContractTypes, D as DefinedInputs, k as DependencyValues, G as GameAuthoring, I as InputFieldRef, M as ManifestIdsOf, l as ManifestTable, P as PhaseAuthoring, m as PhaseTypes, n as PlayerBoardSpaceTarget, T as TargetContext, p as TargetPredicateArgs, q as createGame, s as defineInputs } from './game-CsZScpcn.js';
1
7
  import { z } from 'zod';
2
- import { V as GeneratedManifestContractLike, bV as RuntimeTableRecord, cC as StateDefinition, c1 as SchemaLike, ac as ManifestContractOf, N as ErrorCodeOfContract, af as ManifestIdSchema, aT as ReducerManifestContract, aG as PlayerIdOfState, cL as TableQueriesOfState, o as CardIdOfState, ab as ManifestContract, cJ as TableOfState, cj as SetupSelectionOfManifest, cU as TiledVertexIdOfTable, cI as TableOfManifest, cM as TiledBoardIdOfTable, cO as TiledEdgeIdOfTable, cS as TiledSpaceIdOfTable, n as CardIdOfManifest, O as ExactManifestContractOf, av as PhaseNameOfContract, aI as PlayerZoneIdOfManifest, az as PhaseSchemasOfContract, a as AnySchema, cH as SystemActionEvent, cK as TableQueries, e as BoardIdOfTable, c as BoardContainerIdOfTable } from './runtime-C7Z2acNU.js';
3
- export { h as BoardRef, R as FrameworkErrorCodes, S as GameEvent, T as GameEventDetail, U as GameOutcome, al as OutcomeResult, am as OutcomeScoreComponent, an as OutcomeStanding, ao as OutcomeTieBreak, ap as PerPlayer, aq as PerPlayerBoardRef, ar as PerPlayerSchemaOptions, aE as PlayerId, aP as ReducerAccept, aQ as ReducerAcceptOptions, aU as ReducerReject, aV as ReducerResult, aY as ReducerValidationResult, ck as SharedBoardRef, cZ as asPlayerId, c$ as boardRef, d0 as boardRefKey, d1 as boardRefSchema, d7 as isPerPlayer, d8 as isPerPlayerBoardRef, d9 as isPlayerId, da as isSharedBoardRef, dd as parseBoardRefKey, de as perPlayer, df as perPlayerBoardRef, dg as perPlayerEntries, dh as perPlayerGet, di as perPlayerHas, dj as perPlayerKeys, dk as perPlayerMap, dl as perPlayerRequire, dm as perPlayerSchema, dn as perPlayerSet, dp as perPlayerSize, dq as perPlayerValues, ds as sharedBoardRef } from './runtime-C7Z2acNU.js';
4
- import { j as BaseGameStateOfContract, aq as PhaseDefinition, aB as PlayerViewDefinition, aZ as SharedViewDefinition, aG as ReducerGameContract, Z as InputCollector, y as CollectorState, K as DerivedResolver, ba as ValidationIssue, b9 as TargetKind, a4 as InputSelectionDescriptor, a1 as InputDomainDescriptor, n as BoardTargetDomainDescriptor, l as BoardInputCollectorMeta, f as AnyInteractionSpec, d as AnyCardActionSpec, R as EffectMap, aY as ScopedPhaseState, b4 as StageMap, ay as PhaseZoneList, C as CardActionMap, au as PhaseMapOf, bc as ViewMapOf, aI as ReducerGameDefinition, W as EmptyViewDefinition, b7 as StaticViewDefinition, af as InteractionSpec, p as CardActionSpec, ad as InteractionRule, aa as InteractionMap, z as ContinuationCallable, T as EffectRollDieDefinition, U as EffectShuffleDefinition, V as EffectShufflePlayerZoneDefinition, b6 as StageSpec, aH as ReducerGameContractLike } from './views-D2Cfzr3h.js';
5
- export { J as DerivedDefinition, X as GameStateOf, Y as InitialStateCallbacks, an as Op, aF as ReducerEdit, aJ as ReducerOps, aL as ReducerStateBase, aN as ReducerTransaction, aW as RotatePlayerZoneArgs, bh as createDerivedResolver, bi as createReducerEdit, bj as createReducerOps, bk as createReducerTransaction, bl as defineDerived, bm as pipe } from './views-D2Cfzr3h.js';
6
- import { a as ReducerBundleContract } from './index.d-Bw8AOcgp.js';
8
+ import { a as ReducerBundleContract } from './index.d-DjzoK7zn.js';
7
9
  import { a as ReducerDiagnosticsSink } from './diagnostics-DIi3ina7.js';
8
10
  export { D as DispatchTraceSummaryEntry, R as ReducerDiagnosticEvent, n as noopDiagnosticsSink } from './diagnostics-DIi3ina7.js';
9
11
  export { S as StaleContractArtifactError, a as StaleContractArtifactErrorOptions, b as StaleContractArtifactKind, i as isStaleContractArtifactError } from './stale-contract-artifact-error-XLaweZtF.js';
10
12
  import './types.js';
11
- import './protocol-CVaSqPgX.js';
12
-
13
- type AnyReducerGameContract = {
14
- manifest: GeneratedManifestContractLike<RuntimeTableRecord>;
15
- state: StateDefinition<SchemaLike<object>, SchemaLike<object>, SchemaLike<object>>;
16
- };
17
- type PhaseStateInput = SchemaLike<object> | object;
18
- type InferPhaseState<Input extends PhaseStateInput> = Input extends SchemaLike<infer Output> ? Output extends object ? Output : object : Input extends object ? Input : object;
19
- type ContractState<Contract extends AnyReducerGameContract> = BaseGameStateOfContract<Contract>;
20
- type ContractManifest<Contract extends AnyReducerGameContract> = ManifestContractOf<Contract>;
21
- type ContractErrorCode<Contract extends AnyReducerGameContract> = ErrorCodeOfContract<Contract>;
22
- type ReducerPhaseDefinition<Contract extends AnyReducerGameContract, PhaseStateSchema extends SchemaLike<object>> = PhaseDefinition<PhaseStateSchema, ContractState<Contract>, ContractManifest<Contract>>;
23
- type ReducerSharedViewDefinition<Contract extends AnyReducerGameContract, Projection = unknown> = SharedViewDefinition<ContractState<Contract>, ContractManifest<Contract>, Projection>;
24
- type ReducerPlayerViewDefinition<Contract extends AnyReducerGameContract, SharedProjection = unknown, Projection = unknown> = PlayerViewDefinition<ContractState<Contract>, ContractManifest<Contract>, SharedProjection, Projection>;
25
-
26
- type ManifestIdSchemasOf<Ids extends Record<string, SchemaLike<unknown>>> = {
27
- readonly [Key in keyof Ids]: Ids[Key] extends SchemaLike<infer Output> ? Ids[Key] & ManifestIdSchema<Output> : Ids[Key];
28
- };
29
-
30
- /**
31
- * Narrows a manifest's `literals.phaseNames` and `ids.phaseName` to the
32
- * author-supplied phase-name tuple. Lets `defineGameContract` override the
33
- * codegen-emitted `phaseNames: readonly string[]` / `phaseName: z.string()`
34
- * placeholders so `PhaseNameOfContract<Contract>` resolves to a literal
35
- * union and flows through `fx.transition`, `PhaseMapOf`, and the flow
36
- * state's `currentPhase`.
37
- */
38
- type NarrowManifestPhaseNames<Manifest, PhaseNames extends readonly string[]> = Manifest & {
39
- literals: Manifest extends {
40
- literals: infer L;
41
- } ? Omit<L, "phaseNames"> & {
42
- phaseNames: PhaseNames;
43
- } : {
44
- phaseNames: PhaseNames;
45
- };
46
- ids: Manifest extends {
47
- ids: infer I;
48
- } ? Omit<I, "phaseName"> & {
49
- phaseName: z.ZodType<PhaseNames[number]>;
50
- } : {
51
- phaseName: z.ZodType<PhaseNames[number]>;
52
- };
53
- };
54
- type ReducerGameContractInput<Table extends RuntimeTableRecord, Manifest extends ReducerManifestContract<Table, string, string, string, string, string>, PublicSchema extends SchemaLike<object>, PrivateSchema extends SchemaLike<object>, HiddenSchema extends SchemaLike<object>, Phases extends Record<string, SchemaLike<object>>, Errors extends Record<string, string> | undefined = undefined> = {
55
- manifest: Manifest;
56
- state: StateDefinition<PublicSchema, PrivateSchema, HiddenSchema>;
57
- phases: Phases;
58
- errors?: Errors;
59
- };
60
- declare function defineGameContract<Table extends RuntimeTableRecord, const Manifest extends ReducerManifestContract<Table, string, string, string, string, string>, PublicSchema extends SchemaLike<object>, PrivateSchema extends SchemaLike<object>, HiddenSchema extends SchemaLike<object>, const Phases extends Record<string, SchemaLike<object>>, const Errors extends Record<string, string> | undefined = undefined>(definition: ReducerGameContractInput<Table, Manifest, PublicSchema, PrivateSchema, HiddenSchema, Phases, Errors>): ReducerGameContract<Table, NarrowManifestPhaseNames<Manifest, readonly (keyof Phases & string)[]>, PublicSchema, PrivateSchema, HiddenSchema, Phases, Errors> & {
61
- readonly phases: Phases;
62
- readonly errors: Errors;
63
- readonly phaseNames: readonly (keyof Phases & string)[];
64
- /**
65
- * Ergonomic shortcut to the manifest-backed Zod id schemas. Equivalent to
66
- * `definition.manifest.ids`. Prefer `gameContract.schemas.playerId` etc.
67
- * over re-importing the generated `ids` namespace so that every authored
68
- * schema is anchored to the same SDK-guided source.
69
- */
70
- readonly schemas: ManifestIdSchemasOf<NarrowManifestPhaseNames<Manifest, readonly (keyof Phases & string)[]>["ids"]>;
71
- };
72
-
73
- type InputFieldRef<Key extends string = string, Value = unknown, Collector extends InputCollector = InputCollector> = {
74
- readonly key: Key;
75
- readonly collector: Collector;
76
- readonly __value?: Value;
77
- };
78
- type RefValue<Ref> = Ref extends InputFieldRef<string, infer Value, InputCollector> ? Value : never;
79
- type CollectorOfRef<Ref> = Ref extends InputFieldRef<string, unknown, infer Collector> ? Collector : never;
80
- type CollectorValue<Collector> = Collector extends InputCollector<infer Schema> ? z.infer<Schema> : never;
81
- type DependencyValues<Dependencies extends readonly InputFieldRef<string, unknown, InputCollector>[]> = {
82
- readonly [Ref in Dependencies[number] as Ref["key"]]: RefValue<Ref>;
83
- };
84
- type DefinedInputRefs = Record<string, InputFieldRef<string, unknown, InputCollector>>;
85
- type DefinedInputs<Refs extends DefinedInputRefs> = {
86
- readonly [Key in keyof Refs]: CollectorOfRef<Refs[Key]>;
87
- };
88
- declare class InputBuilder {
89
- add<const Key extends string, Collector extends InputCollector<SchemaLike<unknown>>>(key: Key, collector: Collector): InputFieldRef<Key, CollectorValue<Collector>, Collector>;
90
- }
91
- /**
92
- * Define an interaction's inputs with typed field references. Field refs can be
93
- * passed to dependent input domains, and the returned collector map preserves
94
- * the original key/value types for interaction params.
95
- */
96
- declare function defineInputs<const Refs extends DefinedInputRefs>(define: (input: InputBuilder) => Refs): DefinedInputs<Refs>;
97
-
98
- type DomainContext<State extends CollectorState, Values extends Readonly<Record<string, unknown>> = Record<string, never>> = {
99
- state: State;
100
- playerId: PlayerIdOfState<State>;
101
- q: TableQueriesOfState<State>;
102
- derived: DerivedResolver;
103
- values: Values;
104
- };
105
- type ManifestFormInputSchema = ManifestIdSchema<unknown> | z.ZodOptional<ManifestIdSchema<unknown>> | z.ZodNullable<ManifestIdSchema<unknown>>;
106
- type DomainNumber<State extends CollectorState> = number | ((context: DomainContext<State>) => number);
107
- type ResourceMapInputOptions<State extends CollectorState> = {
108
- resources: ReadonlyArray<{
109
- resourceId: string;
110
- label?: string;
111
- icon?: string;
112
- min?: DomainNumber<State>;
113
- max: DomainNumber<State>;
114
- }>;
115
- };
116
- type ChoiceValue = string | null;
117
- type DomainChoice<Value extends ChoiceValue> = {
118
- value: Value;
119
- label: string;
120
- icon?: string;
121
- badge?: string;
122
- description?: string;
123
- disabled?: boolean;
124
- disabledReason?: string;
125
- };
126
- type DomainChoicePresentation = {
127
- badge?: string;
128
- description?: string;
129
- disabled?: boolean;
130
- disabledReason?: string;
131
- };
132
- type ResourceMapChoiceDecorator<State extends CollectorState> = (context: DomainContext<State> & {
133
- resourceId: string;
134
- label: string;
135
- icon?: string;
136
- }) => DomainChoicePresentation | null | undefined;
137
- type ResourceMapChoiceSource<State extends CollectorState> = "resourceMap" | {
138
- source: "resourceMap";
139
- decorate?: ResourceMapChoiceDecorator<State>;
140
- };
141
- type DomainChoices<Value extends ChoiceValue, State extends CollectorState> = ReadonlyArray<DomainChoice<Value>> | ResourceMapChoiceSource<State> | ((context: DomainContext<State>) => ReadonlyArray<DomainChoice<Value>>);
142
- type DependentDomainChoices<Value extends ChoiceValue, State extends CollectorState, Dependencies extends readonly InputFieldRef<string, unknown>[]> = ReadonlyArray<DomainChoice<Value>> | ((context: DomainContext<State, DependencyValues<Dependencies>>) => ReadonlyArray<DomainChoice<Value>>);
143
- type ChoiceListDefaultValue<Value extends string, State extends CollectorState> = Value[] | "all" | ((context: DomainContext<State> & {
144
- choices: ReadonlyArray<DomainChoice<Value>>;
145
- }) => Value[]);
146
- type ChoiceDefaultResolver<Value extends ChoiceValue, State extends CollectorState, Values extends Readonly<Record<string, unknown>> = Record<string, never>> = (context: DomainContext<State, Values> & {
147
- choices: ReadonlyArray<DomainChoice<Value>>;
148
- }) => Value | undefined;
149
- declare function baseFormInput<Schema extends ManifestFormInputSchema & SchemaLike<unknown>, State extends CollectorState = CollectorState>(schema: Schema): InputCollector<Schema, State, "form">;
150
- declare function baseFormInput<Schema extends ManifestFormInputSchema & SchemaLike<unknown>, State extends CollectorState = CollectorState>(schema: Schema, options: {
151
- defaultValue: z.infer<Schema>;
152
- }): InputCollector<Schema, State, "form"> & {
153
- readonly defaultValue: z.infer<Schema>;
154
- };
155
- declare function resourceMapInput<State extends CollectorState = CollectorState>(options: ResourceMapInputOptions<State>): InputCollector<z.ZodRecord<z.ZodString, z.ZodNumber>, State, "form">;
156
- declare function resourceMapInput<State extends CollectorState = CollectorState>(options: ResourceMapInputOptions<State> & {
157
- defaultValue: Record<string, number>;
158
- }): InputCollector<z.ZodRecord<z.ZodString, z.ZodNumber>, State, "form"> & {
159
- readonly defaultValue: Record<string, number>;
160
- };
161
- declare function numberInput<State extends CollectorState = CollectorState>(options: {
162
- min: DomainNumber<State>;
163
- max: DomainNumber<State>;
164
- step?: DomainNumber<State>;
165
- }): InputCollector<z.ZodNumber, State, "form">;
166
- declare function numberInput<State extends CollectorState = CollectorState>(options: {
167
- min: DomainNumber<State>;
168
- max: DomainNumber<State>;
169
- step?: DomainNumber<State>;
170
- defaultValue: number;
171
- }): InputCollector<z.ZodNumber, State, "form"> & {
172
- readonly defaultValue: number;
173
- };
174
- declare function choiceInput<const Dependencies extends readonly InputFieldRef<string, unknown>[], Value extends ChoiceValue = string, State extends CollectorState = CollectorState>(options: {
175
- dependsOn: Dependencies;
176
- choices: DependentDomainChoices<Value, State, Dependencies>;
177
- defaultValue: Value;
178
- }): InputCollector<SchemaLike<Value>, State, "form"> & {
179
- readonly defaultValue: Value;
180
- };
181
- declare function choiceInput<const Dependencies extends readonly InputFieldRef<string, unknown>[], Value extends ChoiceValue = string, State extends CollectorState = CollectorState>(options: {
182
- dependsOn: Dependencies;
183
- choices: DependentDomainChoices<Value, State, Dependencies>;
184
- defaultValue: ChoiceDefaultResolver<Value, State, DependencyValues<Dependencies>>;
185
- }): InputCollector<SchemaLike<Value>, State, "form">;
186
- declare function choiceInput<Value extends ChoiceValue, State extends CollectorState = CollectorState>(options: {
187
- choices: DomainChoices<Value, State>;
188
- defaultValue: Value;
189
- }): InputCollector<SchemaLike<Value>, State, "form"> & {
190
- readonly defaultValue: Value;
191
- };
192
- declare function choiceInput<Value extends ChoiceValue, State extends CollectorState = CollectorState>(options: {
193
- choices: DomainChoices<Value, State>;
194
- defaultValue: ChoiceDefaultResolver<Value, State>;
195
- }): InputCollector<SchemaLike<Value>, State, "form">;
196
- declare function choiceInput<Value extends ChoiceValue, State extends CollectorState = CollectorState, const Dependencies extends readonly InputFieldRef<string, unknown>[] = readonly InputFieldRef<string, unknown>[]>(options: {
197
- dependsOn: Dependencies;
198
- choices: DependentDomainChoices<Value, State, Dependencies>;
199
- defaultValue: Value;
200
- }): InputCollector<SchemaLike<Value>, State, "form"> & {
201
- readonly defaultValue: Value;
202
- };
203
- declare function choiceInput<Value extends ChoiceValue, State extends CollectorState = CollectorState, const Dependencies extends readonly InputFieldRef<string, unknown>[] = readonly InputFieldRef<string, unknown>[]>(options: {
204
- dependsOn: Dependencies;
205
- choices: DependentDomainChoices<Value, State, Dependencies>;
206
- defaultValue: ChoiceDefaultResolver<Value, State, DependencyValues<Dependencies>>;
207
- }): InputCollector<SchemaLike<Value>, State, "form">;
208
- declare function choiceListInput<Value extends string, State extends CollectorState = CollectorState>(options: {
209
- choices: DomainChoices<Value, State>;
210
- min?: DomainNumber<State>;
211
- max?: DomainNumber<State>;
212
- defaultValue: Value[];
213
- }): InputCollector<SchemaLike<Value[]>, State, "form"> & {
214
- readonly defaultValue: Value[];
215
- };
216
- declare function choiceListInput<Value extends string, State extends CollectorState = CollectorState>(options: {
217
- choices: DomainChoices<Value, State>;
218
- min?: DomainNumber<State>;
219
- max?: DomainNumber<State>;
220
- defaultValue?: ChoiceListDefaultValue<Value, State>;
221
- }): InputCollector<SchemaLike<Value[]>, State, "form">;
222
- type FormInputForState<State extends CollectorState> = {
223
- <Schema extends ManifestFormInputSchema & SchemaLike<unknown>>(schema: Schema): InputCollector<Schema, State, "form">;
224
- <Schema extends ManifestFormInputSchema & SchemaLike<unknown>>(schema: Schema, options: {
225
- defaultValue: z.infer<Schema>;
226
- }): InputCollector<Schema, State, "form"> & {
227
- readonly defaultValue: z.infer<Schema>;
228
- };
229
- resourceMap(options: ResourceMapInputOptions<State>): InputCollector<z.ZodRecord<z.ZodString, z.ZodNumber>, State, "form">;
230
- resourceMap(options: ResourceMapInputOptions<State> & {
231
- defaultValue: Record<string, number>;
232
- }): InputCollector<z.ZodRecord<z.ZodString, z.ZodNumber>, State, "form"> & {
233
- readonly defaultValue: Record<string, number>;
234
- };
235
- resourceChoices(options?: {
236
- decorate?: ResourceMapChoiceDecorator<State>;
237
- }): ResourceMapChoiceSource<State>;
238
- number(options: Parameters<typeof numberInput<State>>[0]): ReturnType<typeof numberInput<State>>;
239
- choice<Value extends ChoiceValue, const Dependencies extends readonly InputFieldRef<string, unknown>[]>(options: {
240
- dependsOn: Dependencies;
241
- choices: DependentDomainChoices<Value, State, Dependencies>;
242
- defaultValue: Value;
243
- }): InputCollector<SchemaLike<Value>, State, "form"> & {
244
- readonly defaultValue: Value;
245
- };
246
- choice<Value extends ChoiceValue, const Dependencies extends readonly InputFieldRef<string, unknown>[]>(options: {
247
- dependsOn: Dependencies;
248
- choices: DependentDomainChoices<Value, State, Dependencies>;
249
- defaultValue: ChoiceDefaultResolver<Value, State, DependencyValues<Dependencies>>;
250
- }): InputCollector<SchemaLike<Value>, State, "form">;
251
- choice<Value extends ChoiceValue>(options: {
252
- choices: DomainChoices<Value, State>;
253
- defaultValue: Value;
254
- }): InputCollector<SchemaLike<Value>, State, "form"> & {
255
- readonly defaultValue: Value;
256
- };
257
- choice<Value extends ChoiceValue>(options: {
258
- choices: DomainChoices<Value, State>;
259
- defaultValue: ChoiceDefaultResolver<Value, State>;
260
- }): InputCollector<SchemaLike<Value>, State, "form">;
261
- choiceList<Value extends string>(options: {
262
- choices: DomainChoices<Value, State>;
263
- min?: DomainNumber<State>;
264
- max?: DomainNumber<State>;
265
- defaultValue: Value[];
266
- }): InputCollector<SchemaLike<Value[]>, State, "form"> & {
267
- readonly defaultValue: Value[];
268
- };
269
- choiceList<Value extends string>(options: {
270
- choices: DomainChoices<Value, State>;
271
- min?: DomainNumber<State>;
272
- max?: DomainNumber<State>;
273
- defaultValue?: ChoiceListDefaultValue<Value, State>;
274
- }): InputCollector<SchemaLike<Value[]>, State, "form">;
275
- };
276
- declare function formInputForState<State extends CollectorState>(): FormInputForState<State>;
277
- /**
278
- * Manifest-backed id input. Free-form Zod schemas are intentionally explicit:
279
- * if the runtime cannot disclose valid values or numeric bounds through a
280
- * manifest id or domain helper, use a custom interaction surface with an
281
- * explicit `paramsSchema` instead of the default form renderer.
282
- */
283
- declare const formInput: typeof baseFormInput & {
284
- resourceMap: typeof resourceMapInput;
285
- resourceChoices: <State extends CollectorState = CollectorState>(options?: {
286
- decorate?: ResourceMapChoiceDecorator<State>;
287
- }) => ResourceMapChoiceSource<State>;
288
- number: typeof numberInput;
289
- choice: typeof choiceInput;
290
- choiceList: typeof choiceListInput;
291
- forState: typeof formInputForState;
292
- };
293
-
294
- type TargetContext<State extends CollectorState> = {
295
- state: State;
296
- playerId: PlayerIdOfState<State>;
297
- q: TableQueriesOfState<State>;
298
- values?: Readonly<Record<string, unknown>>;
299
- };
300
- type TargetPredicateArgs<State extends CollectorState, Target> = TargetContext<State> & {
301
- targetId: Target;
302
- target: Target;
303
- };
304
- type TargetPredicate<State extends CollectorState, Target> = {
305
- id: string;
306
- errorCode: string;
307
- message?: string;
308
- test: (args: TargetPredicateArgs<State, Target>) => boolean;
309
- };
310
- type BoundTargetRule<Target> = {
311
- readonly eligible: () => readonly Target[];
312
- readonly validate: (target: Target) => ValidationIssue | null;
313
- readonly isEligible: (target: Target) => boolean;
314
- };
315
- type TargetRule<State extends CollectorState, Target> = {
316
- readonly eligible: (ctx: TargetContext<State>) => readonly Target[];
317
- readonly validate: (ctx: TargetContext<State>, target: Target) => ValidationIssue | null;
318
- readonly isEligible: (ctx: TargetContext<State>, target: Target) => boolean;
319
- readonly bind: (ctx: TargetContext<State>) => BoundTargetRule<Target>;
320
- };
321
- type TargetRuleBuilder<State extends CollectorState, Target, Rule extends TargetRule<State, Target>> = {
322
- readonly where: (predicate: TargetPredicate<State, Target>) => TargetRuleBuilder<State, Target, Rule>;
323
- readonly build: () => Rule;
324
- };
325
-
326
- type BoardTargetPredicate<State extends CollectorState, Target> = TargetPredicate<State, Target>;
327
- type BoardTargetRule<State extends CollectorState, Target> = TargetRule<State, Target> & {
328
- readonly boardId: string;
329
- readonly targetKind: TargetKind;
330
- readonly valueKind: "board-id" | "player-board-space";
331
- };
332
- type BoardTargetBuilder<State extends CollectorState, Target> = TargetRuleBuilder<State, Target, BoardTargetRule<State, Target>>;
333
- type PlayerBoardSpaceTarget<BoardId extends string, SpaceId extends string, PlayerId extends string> = {
334
- readonly boardId: BoardId;
335
- readonly playerId: PlayerId;
336
- readonly spaceId: SpaceId;
337
- };
338
- declare const boardTarget: {
339
- edge: <State extends CollectorState, Id extends string>(boardId: string) => BoardTargetBuilder<State, Id>;
340
- vertex: <State extends CollectorState, Id extends string>(boardId: string) => BoardTargetBuilder<State, Id>;
341
- space: <State extends CollectorState, Id extends string>(boardId: string) => BoardTargetBuilder<State, Id>;
342
- tile: <State extends CollectorState, Id extends string>(boardId: string) => BoardTargetBuilder<State, Id>;
343
- playerSpace<State extends CollectorState, BoardId extends string, SpaceId extends string>(boardId: BoardId): BoardTargetBuilder<State, PlayerBoardSpaceTarget<BoardId, SpaceId, PlayerIdOfState<State>>>;
344
- };
345
-
346
- type PlayerSpaceInputSchema<BoardId extends string, SpaceId extends string, PlayerId extends string> = z.ZodObject<{
347
- boardId: z.ZodLiteral<BoardId>;
348
- playerId: ManifestIdSchema<PlayerId, "playerId">;
349
- spaceId: z.ZodType<SpaceId>;
350
- }>;
351
- declare function playerSpaceInput<State extends CollectorState = CollectorState, BoardId extends string = string, SpaceId extends string = string, PlayerId extends string = string>(options: {
352
- target: BoardTargetRule<State, PlayerBoardSpaceTarget<BoardId, SpaceId, PlayerId>>;
353
- dependsOn?: readonly InputFieldRef<string, unknown>[];
354
- }): InputCollector<PlayerSpaceInputSchema<BoardId, SpaceId, PlayerId>, State, "board-space">;
355
- declare const boardInput: {
356
- vertex: <State extends CollectorState = CollectorState, Id extends string = string>(options: {
357
- target: BoardTargetRule<State, Id>;
358
- dependsOn?: readonly InputFieldRef<string, unknown>[];
359
- }) => {
360
- readonly kind: "board-vertex";
361
- readonly schema: z.ZodType<Id, unknown, z.core.$ZodTypeInternals<Id, unknown>>;
362
- readonly defaultValue?: Id | undefined;
363
- readonly selection?: InputSelectionDescriptor;
364
- readonly eligibleTargets?: (state: CollectorState, playerId: string, q: unknown, values?: Readonly<Record<string, unknown>>) => ReadonlyArray<unknown>;
365
- readonly validateTarget?: (state: CollectorState, playerId: string, q: unknown, targetId: unknown, values?: Readonly<Record<string, unknown>>) => ValidationIssue | null | undefined;
366
- readonly dependsOn?: readonly string[];
367
- readonly resolveDefaultValue?: ((state: CollectorState, playerId: string, q: unknown, derived: DerivedResolver, domain: InputDomainDescriptor) => Id | undefined) | undefined;
368
- } & {
369
- readonly domain: (state: CollectorState, playerId: string, q: unknown, derived: DerivedResolver, values?: Readonly<Record<string, unknown>>) => BoardTargetDomainDescriptor;
370
- } & {
371
- readonly meta: BoardInputCollectorMeta;
372
- };
373
- edge: <State extends CollectorState = CollectorState, Id extends string = string>(options: {
374
- target: BoardTargetRule<State, Id>;
375
- dependsOn?: readonly InputFieldRef<string, unknown>[];
376
- }) => {
377
- readonly kind: "board-edge";
378
- readonly schema: z.ZodType<Id, unknown, z.core.$ZodTypeInternals<Id, unknown>>;
379
- readonly defaultValue?: Id | undefined;
380
- readonly selection?: InputSelectionDescriptor;
381
- readonly eligibleTargets?: (state: CollectorState, playerId: string, q: unknown, values?: Readonly<Record<string, unknown>>) => ReadonlyArray<unknown>;
382
- readonly validateTarget?: (state: CollectorState, playerId: string, q: unknown, targetId: unknown, values?: Readonly<Record<string, unknown>>) => ValidationIssue | null | undefined;
383
- readonly dependsOn?: readonly string[];
384
- readonly resolveDefaultValue?: ((state: CollectorState, playerId: string, q: unknown, derived: DerivedResolver, domain: InputDomainDescriptor) => Id | undefined) | undefined;
385
- } & {
386
- readonly domain: (state: CollectorState, playerId: string, q: unknown, derived: DerivedResolver, values?: Readonly<Record<string, unknown>>) => BoardTargetDomainDescriptor;
387
- } & {
388
- readonly meta: BoardInputCollectorMeta;
389
- };
390
- tile: <State extends CollectorState = CollectorState, Id extends string = string>(options: {
391
- target: BoardTargetRule<State, Id>;
392
- dependsOn?: readonly InputFieldRef<string, unknown>[];
393
- }) => {
394
- readonly kind: "board-tile";
395
- readonly schema: z.ZodType<Id, unknown, z.core.$ZodTypeInternals<Id, unknown>>;
396
- readonly defaultValue?: Id | undefined;
397
- readonly selection?: InputSelectionDescriptor;
398
- readonly eligibleTargets?: (state: CollectorState, playerId: string, q: unknown, values?: Readonly<Record<string, unknown>>) => ReadonlyArray<unknown>;
399
- readonly validateTarget?: (state: CollectorState, playerId: string, q: unknown, targetId: unknown, values?: Readonly<Record<string, unknown>>) => ValidationIssue | null | undefined;
400
- readonly dependsOn?: readonly string[];
401
- readonly resolveDefaultValue?: ((state: CollectorState, playerId: string, q: unknown, derived: DerivedResolver, domain: InputDomainDescriptor) => Id | undefined) | undefined;
402
- } & {
403
- readonly domain: (state: CollectorState, playerId: string, q: unknown, derived: DerivedResolver, values?: Readonly<Record<string, unknown>>) => BoardTargetDomainDescriptor;
404
- } & {
405
- readonly meta: BoardInputCollectorMeta;
406
- };
407
- space: <State extends CollectorState = CollectorState, Id extends string = string>(options: {
408
- target: BoardTargetRule<State, Id>;
409
- dependsOn?: readonly InputFieldRef<string, unknown>[];
410
- }) => {
411
- readonly kind: "board-space";
412
- readonly schema: z.ZodType<Id, unknown, z.core.$ZodTypeInternals<Id, unknown>>;
413
- readonly defaultValue?: Id | undefined;
414
- readonly selection?: InputSelectionDescriptor;
415
- readonly eligibleTargets?: (state: CollectorState, playerId: string, q: unknown, values?: Readonly<Record<string, unknown>>) => ReadonlyArray<unknown>;
416
- readonly validateTarget?: (state: CollectorState, playerId: string, q: unknown, targetId: unknown, values?: Readonly<Record<string, unknown>>) => ValidationIssue | null | undefined;
417
- readonly dependsOn?: readonly string[];
418
- readonly resolveDefaultValue?: ((state: CollectorState, playerId: string, q: unknown, derived: DerivedResolver, domain: InputDomainDescriptor) => Id | undefined) | undefined;
419
- } & {
420
- readonly domain: (state: CollectorState, playerId: string, q: unknown, derived: DerivedResolver, values?: Readonly<Record<string, unknown>>) => BoardTargetDomainDescriptor;
421
- } & {
422
- readonly meta: BoardInputCollectorMeta;
423
- };
424
- playerSpace: typeof playerSpaceInput;
425
- };
13
+ import './protocol-dYgafTYY.js';
426
14
 
427
15
  type CardTargetPredicate<State extends CollectorState, Id extends string> = TargetPredicate<State, Id>;
428
- type CardTargetRule<State extends CollectorState, Id extends string, ZoneIds extends readonly string[] = readonly string[]> = TargetRule<State, Id> & {
429
- readonly zoneIds: ZoneIds;
430
- readonly zoneId: ZoneIds[number];
431
- readonly targetKind: "card";
432
- };
433
- type CardTargetBuilder<State extends CollectorState, Id extends string, ZoneIds extends readonly string[] = readonly string[]> = TargetRuleBuilder<State, Id, CardTargetRule<State, Id, ZoneIds>>;
434
- declare const cardTarget: {
435
- zones<State extends CollectorState, Id extends string = CardIdOfState<State>, const ZoneIds extends readonly string[] = readonly string[]>(zoneIds: ZoneIds): CardTargetBuilder<State, Id, ZoneIds>;
436
- };
437
-
438
- type ChoiceTargetOption<Id extends string> = {
439
- id: Id;
440
- label?: string;
441
- };
442
- type ChoiceOptionsFactory<State extends CollectorState, Id extends string> = (state: State, playerId: PlayerIdOfState<State>, q: TableQueriesOfState<State>) => ReadonlyArray<ChoiceTargetOption<Id>>;
443
- type ChoiceTargetPredicate<State extends CollectorState, Id extends string> = TargetPredicate<State, Id>;
444
- type ChoiceTargetRule<State extends CollectorState, Id extends string> = TargetRule<State, Id> & {
445
- readonly targetKind: "choice";
446
- readonly options: (ctx: TargetContext<State>) => ReadonlyArray<ChoiceTargetOption<Id>>;
447
- readonly eligibleOptions: (ctx: TargetContext<State>) => ReadonlyArray<ChoiceTargetOption<Id>>;
448
- };
449
- type ChoiceTargetBuilder<State extends CollectorState, Id extends string> = TargetRuleBuilder<State, Id, ChoiceTargetRule<State, Id>>;
450
- declare const choiceTarget: {
451
- options<State extends CollectorState, Id extends string>(options: ReadonlyArray<ChoiceTargetOption<Id>> | ChoiceOptionsFactory<State, Id>): ChoiceTargetBuilder<State, Id>;
452
- };
453
-
454
- /**
455
- * `cardInput` produces a collector backed by one built `cardTarget` rule.
456
- * The submitted value is a manifest-branded card id.
457
- *
458
- * The target rule feeds server-authoritative eligible-card projection, submit
459
- * validation, and tests through its `bind({ state, playerId, q })` helper.
460
- */
461
- declare function cardInput<State extends CollectorState = CollectorState, Id extends string = CardIdOfState<State>, const ZoneIds extends readonly string[] = readonly string[]>(options: {
462
- target: CardTargetRule<State, Id, ZoneIds>;
463
- dependsOn?: readonly InputFieldRef<string, unknown>[];
464
- }): InputCollector<z.ZodType<Id>, State, "card"> & {
465
- readonly meta: {
466
- readonly zoneId: ZoneIds[number];
467
- readonly zoneIds: ZoneIds;
468
- readonly targetKind: "card";
469
- };
470
- };
471
-
472
- type SchemaStringValue<Schema extends SchemaLike<unknown>> = Extract<Schema extends z.ZodType<infer V> ? V : never, string>;
473
- /**
474
- * `promptInput` marks an interaction as a prompt delivered to a player's
475
- * inbox. The submitted value is validated by the supplied Zod schema.
476
- *
477
- * Static or free-form prompts need only `schema`. Finite dynamic choices use
478
- * a built `choiceTarget.options(...).build()` rule so projected options and
479
- * submit validation share one source of truth.
480
- */
481
- declare function promptInput<Schema extends SchemaLike<unknown>, State extends CollectorState = CollectorState>(options: {
482
- schema: Schema;
483
- target?: ChoiceTargetRule<State, SchemaStringValue<Schema>>;
484
- }): InputCollector<Schema, State, "prompt">;
485
-
486
- /**
487
- * `rngInput.*` helpers produce collectors whose value is *sampled by the
488
- * engine on submit* rather than supplied by the client. The schema pins
489
- * the exact output shape so `ParamsOf<Collectors>` sees precisely typed
490
- * results.
491
- *
492
- * Determinism:
493
- * Sampling happens inside `submitInteraction` only, never inside
494
- * reducer validation. This lets clients check a submission without
495
- * burning RNG state.
496
- */
497
- type DieRoll = z.ZodObject<{
498
- values: z.ZodArray<z.ZodNumber>;
499
- }>;
500
- type CoinFlip = z.ZodObject<{
501
- value: z.ZodEnum<{
502
- heads: "heads";
503
- tails: "tails";
504
- }>;
505
- }>;
506
- type RngCollector<Schema extends DieRoll | CoinFlip, State extends CollectorState> = InputCollector<Schema, State, "rng">;
507
- /**
508
- * Roll `count` d6s. The submitted value is `{ values: number[] }` with
509
- * `values.length === count` and each face `1..6`.
510
- */
511
- declare function d6<State extends CollectorState = CollectorState>(count?: number): RngCollector<DieRoll, State>;
512
- /** Flip a coin. The submitted value is `{ value: "heads" | "tails" }`. */
513
- declare function coin<State extends CollectorState = CollectorState>(): RngCollector<CoinFlip, State>;
514
- declare const rngInput: {
515
- d6: typeof d6;
516
- coin: typeof coin;
517
- };
518
16
 
519
17
  type ManyOptions = {
520
18
  count: number;
@@ -545,161 +43,6 @@ type ManyInputCollector<Schema extends SchemaLike<unknown> = SchemaLike<unknown>
545
43
  };
546
44
  declare function many<Collector extends NonRngCollector>(collector: Collector, options: ManyOptions): ManyInputCollector<CollectorSchema<Collector>, CollectorStateOf<Collector>, CollectorKindOf<Collector>> & Pick<Collector, "meta">;
547
45
 
548
- type StepPhaseState<PhaseStateSchema extends SchemaLike<object>, Steps extends readonly string[]> = z.infer<PhaseStateSchema> & {
549
- step: Steps[number];
550
- };
551
- type StepPhaseInteractionEntry<Step extends string, Interaction> = {
552
- steps: readonly Step[];
553
- interaction: Interaction;
554
- };
555
- type StepPhaseCardActionEntry<Step extends string, Action> = {
556
- steps: readonly Step[];
557
- action: Action;
558
- };
559
- type StepPhaseInteractionMap<Step extends string, State extends {
560
- table: RuntimeTableRecord;
561
- flow: {
562
- currentPhase: string;
563
- };
564
- }, Manifest extends ManifestContract<TableOfState<State>>> = Record<string, StepPhaseInteractionEntry<Step, AnyInteractionSpec<State, Manifest>>>;
565
- type StepPhaseCardActionMap<Step extends string, State extends {
566
- table: RuntimeTableRecord;
567
- flow: {
568
- currentPhase: string;
569
- };
570
- }, Manifest extends ManifestContract<TableOfState<State>>> = Record<string, StepPhaseCardActionEntry<Step, AnyCardActionSpec<State, Manifest>>>;
571
- type UnwrappedStepInteractions<State extends {
572
- table: RuntimeTableRecord;
573
- flow: {
574
- currentPhase: string;
575
- };
576
- }, Manifest extends ManifestContract<TableOfState<State>>, Interactions extends Record<string, StepPhaseInteractionEntry<string, AnyInteractionSpec<State, Manifest>>>> = {
577
- [Key in keyof Interactions]: Interactions[Key]["interaction"];
578
- };
579
- type UnwrappedStepCardActions<State extends {
580
- table: RuntimeTableRecord;
581
- flow: {
582
- currentPhase: string;
583
- };
584
- }, Manifest extends ManifestContract<TableOfState<State>>, CardActions extends Record<string, StepPhaseCardActionEntry<string, AnyCardActionSpec<State, Manifest>>>> = {
585
- [Key in keyof CardActions]: CardActions[Key]["action"];
586
- };
587
- declare function definePhase<Contract extends AnyReducerGameContract>(): <PhaseStateSchema extends SchemaLike<object>, SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Effects extends EffectMap<ContractState<Contract>, ContractManifest<Contract>> = Record<string, never>, Interactions extends Record<string, AnyInteractionSpec<ScopedPhaseState<ContractState<Contract>, z.infer<PhaseStateSchema>>, ContractManifest<Contract>>> = Record<string, never>, Stages extends StageMap<ScopedPhaseState<ContractState<Contract>, z.infer<PhaseStateSchema>>, ContractManifest<Contract>> = Record<string, never>, const Zones extends PhaseZoneList<ContractManifest<Contract>> = readonly [], CardActions extends CardActionMap<ScopedPhaseState<ContractState<Contract>, z.infer<PhaseStateSchema>>, ContractManifest<Contract>> = Record<string, never>>(definition: PhaseDefinition<PhaseStateSchema, ContractState<Contract>, ContractManifest<Contract>, SubmitCollectors, Effects, Interactions, Stages, Zones, CardActions>) => PhaseDefinition<PhaseStateSchema, ContractState<Contract>, ContractManifest<Contract>, SubmitCollectors, Effects, Interactions, Stages, Zones, CardActions>;
588
- declare function defineStepPhase<Contract extends AnyReducerGameContract>(): <const Steps extends readonly [string, ...string[]], PhaseStateSchema extends SchemaLike<object>, SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Effects extends EffectMap<ContractState<Contract>, ContractManifest<Contract>> = Record<string, never>, Interactions extends StepPhaseInteractionMap<Steps[number], ScopedPhaseState<ContractState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, ContractManifest<Contract>> = Record<string, never>, Stages extends StageMap<ScopedPhaseState<ContractState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, ContractManifest<Contract>> = Record<string, never>, const Zones extends PhaseZoneList<ContractManifest<Contract>> = readonly [], CardActions extends StepPhaseCardActionMap<Steps[number], ScopedPhaseState<ContractState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, ContractManifest<Contract>> = Record<string, never>>(definition: Omit<PhaseDefinition<PhaseStateSchema, ContractState<Contract>, ContractManifest<Contract>, SubmitCollectors, Effects, UnwrappedStepInteractions<ScopedPhaseState<ContractState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, ContractManifest<Contract>, Interactions>, Stages, Zones, UnwrappedStepCardActions<ScopedPhaseState<ContractState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, ContractManifest<Contract>, CardActions>>, "state" | "initialState" | "interactions" | "cardActions"> & {
589
- steps: Steps;
590
- state: PhaseStateSchema;
591
- initialState?: (ctx: {
592
- manifest: ContractManifest<Contract>;
593
- state: ContractState<Contract>;
594
- playerIds: PlayerIdOfState<ContractState<Contract>>[];
595
- setup: SetupSelectionOfManifest<ContractManifest<Contract>> | null;
596
- }) => z.infer<PhaseStateSchema>;
597
- interactions?: Interactions;
598
- cardActions?: CardActions;
599
- }) => PhaseDefinition<SchemaLike<StepPhaseState<PhaseStateSchema, Steps>>, ContractState<Contract>, ContractManifest<Contract>, SubmitCollectors, Effects, UnwrappedStepInteractions<ScopedPhaseState<ContractState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, ContractManifest<Contract>, Interactions>, Stages, Zones, UnwrappedStepCardActions<ScopedPhaseState<ContractState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, ContractManifest<Contract>, CardActions>>;
600
-
601
- type ContractWithPhases = AnyReducerGameContract & {
602
- readonly phases: Record<string, SchemaLike<object>>;
603
- };
604
- type BoundState<Contract extends ContractWithPhases> = ContractState<Contract>;
605
- type BoundManifest<Contract extends ContractWithPhases> = ContractManifest<Contract>;
606
- type BoundTable<Contract extends ContractWithPhases> = TableOfManifest<BoundManifest<Contract>>;
607
- type BoundPhaseState<Contract extends ContractWithPhases, PhaseStateSchema extends SchemaLike<object>> = ScopedPhaseState<BoundState<Contract>, z.infer<PhaseStateSchema>>;
608
- type BoundFormInputs<Contract extends ContractWithPhases> = ReturnType<typeof formInput.forState<BoundState<Contract>>>;
609
- type BoundBoardInputs<Contract extends ContractWithPhases> = {
610
- vertex<Id extends string = TiledVertexIdOfTable<BoundTable<Contract>, TiledBoardIdOfTable<BoundTable<Contract>>>>(options: {
611
- target: BoardTargetRule<BoundState<Contract>, Id>;
612
- dependsOn?: readonly InputFieldRef<string, unknown>[];
613
- }): InputCollector<z.ZodType<Id>, BoundState<Contract>, "board-vertex">;
614
- edge<Id extends string = TiledEdgeIdOfTable<BoundTable<Contract>, TiledBoardIdOfTable<BoundTable<Contract>>>>(options: {
615
- target: BoardTargetRule<BoundState<Contract>, Id>;
616
- dependsOn?: readonly InputFieldRef<string, unknown>[];
617
- }): InputCollector<z.ZodType<Id>, BoundState<Contract>, "board-edge">;
618
- tile<Id extends string = string>(options: {
619
- target: BoardTargetRule<BoundState<Contract>, Id>;
620
- dependsOn?: readonly InputFieldRef<string, unknown>[];
621
- }): InputCollector<z.ZodType<Id>, BoundState<Contract>, "board-tile">;
622
- space<Id extends string = TiledSpaceIdOfTable<BoundTable<Contract>, TiledBoardIdOfTable<BoundTable<Contract>>>>(options: {
623
- target: BoardTargetRule<BoundState<Contract>, Id>;
624
- dependsOn?: readonly InputFieldRef<string, unknown>[];
625
- }): InputCollector<z.ZodType<Id>, BoundState<Contract>, "board-space">;
626
- playerSpace<BoardId extends string = string, SpaceId extends string = string, PlayerId extends string = PlayerIdOfState<BoundState<Contract>>>(options: {
627
- target: BoardTargetRule<BoundState<Contract>, PlayerBoardSpaceTarget<BoardId, SpaceId, PlayerId>>;
628
- dependsOn?: readonly InputFieldRef<string, unknown>[];
629
- }): InputCollector<PlayerSpaceInputSchema<BoardId, SpaceId, PlayerId>, BoundState<Contract>, "board-space">;
630
- };
631
- type BoundCardInput<Contract extends ContractWithPhases> = <Id extends string = CardIdOfManifest<BoundManifest<Contract>>, const ZoneIds extends readonly string[] = readonly string[]>(options: {
632
- target: CardTargetRule<BoundState<Contract>, Id, ZoneIds>;
633
- dependsOn?: readonly InputFieldRef<string, unknown>[];
634
- }) => InputCollector<z.ZodType<Id>, BoundState<Contract>, "card"> & {
635
- readonly meta: {
636
- readonly zoneId: ZoneIds[number];
637
- readonly zoneIds: ZoneIds;
638
- readonly targetKind: "card";
639
- };
640
- };
641
- type BoundPromptInput<Contract extends ContractWithPhases> = <Schema extends SchemaLike<unknown>>(options: {
642
- schema: Schema;
643
- target?: ChoiceTargetRule<BoundState<Contract>, Extract<Schema extends z.ZodType<infer Value> ? Value : never, string>>;
644
- }) => InputCollector<Schema, BoundState<Contract>, "prompt">;
645
- type BoundRngInputs<Contract extends ContractWithPhases> = {
646
- d6(count?: number): ReturnType<typeof rngInput.d6<BoundState<Contract>>>;
647
- coin(): ReturnType<typeof rngInput.coin<BoundState<Contract>>>;
648
- };
649
- type BoundChoiceTarget<Contract extends ContractWithPhases> = {
650
- options<Id extends string>(options: ReadonlyArray<ChoiceTargetOption<Id>> | ChoiceOptionsFactory<BoundState<Contract>, Id>): ChoiceTargetBuilder<BoundState<Contract>, Id>;
651
- };
652
- type BoundBoardTarget<Contract extends ContractWithPhases> = {
653
- edge<Id extends string = string>(boardId: string): BoardTargetBuilder<BoundState<Contract>, Id>;
654
- vertex<Id extends string = string>(boardId: string): BoardTargetBuilder<BoundState<Contract>, Id>;
655
- space<Id extends string = string>(boardId: string): BoardTargetBuilder<BoundState<Contract>, Id>;
656
- tile<Id extends string = string>(boardId: string): BoardTargetBuilder<BoundState<Contract>, Id>;
657
- playerSpace<BoardId extends string, SpaceId extends string, PlayerId extends string = PlayerIdOfState<BoundState<Contract>>>(boardId: BoardId): BoardTargetBuilder<BoundState<Contract>, PlayerBoardSpaceTarget<BoardId, SpaceId, PlayerId>>;
658
- };
659
- type BoundCardTarget<Contract extends ContractWithPhases> = {
660
- zones<Id extends string = CardIdOfState<BoundState<Contract>>, const ZoneIds extends readonly string[] = readonly string[]>(zoneIds: ZoneIds): CardTargetBuilder<BoundState<Contract>, Id, ZoneIds>;
661
- };
662
- type BoundInputBuilders<Contract extends ContractWithPhases> = {
663
- readonly board: BoundBoardInputs<Contract>;
664
- readonly boardTarget: BoundBoardTarget<Contract>;
665
- readonly card: BoundCardInput<Contract>;
666
- readonly cardTarget: BoundCardTarget<Contract>;
667
- readonly choiceTarget: BoundChoiceTarget<Contract>;
668
- readonly form: BoundFormInputs<Contract>;
669
- readonly prompt: BoundPromptInput<Contract>;
670
- readonly rng: BoundRngInputs<Contract>;
671
- };
672
- type StepPhaseInput<Contract extends ContractWithPhases, PhaseStateSchema extends SchemaLike<object>, Steps extends readonly [string, ...string[]], SubmitCollectors extends Record<string, InputCollector>, Effects extends EffectMap<BoundState<Contract>, BoundManifest<Contract>>, Interactions extends StepPhaseInteractionMap<Steps[number], ScopedPhaseState<BoundState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, BoundManifest<Contract>>, Stages extends StageMap<ScopedPhaseState<BoundState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, BoundManifest<Contract>>, Zones extends PhaseZoneList<BoundManifest<Contract>>, CardActions extends StepPhaseCardActionMap<Steps[number], ScopedPhaseState<BoundState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, BoundManifest<Contract>>> = Omit<PhaseDefinition<PhaseStateSchema, BoundState<Contract>, BoundManifest<Contract>, SubmitCollectors, Effects, UnwrappedStepInteractions<ScopedPhaseState<BoundState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, BoundManifest<Contract>, Interactions>, Stages, Zones, UnwrappedStepCardActions<ScopedPhaseState<BoundState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, BoundManifest<Contract>, CardActions>>, "state" | "initialState" | "interactions" | "cardActions"> & {
673
- steps: Steps;
674
- state?: never;
675
- initialState?: (ctx: {
676
- manifest: BoundManifest<Contract>;
677
- state: BoundState<Contract>;
678
- playerIds: PlayerIdOfState<BoundState<Contract>>[];
679
- setup: SetupSelectionOfManifest<BoundManifest<Contract>> | null;
680
- }) => InferPhaseState<PhaseStateSchema>;
681
- interactions?: Interactions;
682
- cardActions?: CardActions;
683
- };
684
- type PhaseAuthoring<Contract extends ContractWithPhases, PhaseStateSchema extends SchemaLike<object>> = {
685
- interaction<Collectors extends Record<string, InputCollector>>(spec: InteractionSpec<Collectors, BoundPhaseState<Contract, PhaseStateSchema>, BoundManifest<Contract>, ContractErrorCode<Contract>>): InteractionSpec<Collectors, BoundPhaseState<Contract, PhaseStateSchema>, BoundManifest<Contract>, ContractErrorCode<Contract>>;
686
- cardAction<Collectors extends Record<string, InputCollector> = Record<string, never>, const PlayFrom extends PlayerZoneIdOfManifest<BoundManifest<Contract>> = PlayerZoneIdOfManifest<BoundManifest<Contract>>>(spec: CardActionSpec<Collectors, BoundPhaseState<Contract, PhaseStateSchema>, BoundManifest<Contract>, PlayFrom, ContractErrorCode<Contract>>): CardActionSpec<Collectors, BoundPhaseState<Contract, PhaseStateSchema>, BoundManifest<Contract>, PlayFrom, ContractErrorCode<Contract>>;
687
- rule<Collectors extends Record<string, InputCollector> = Record<string, InputCollector>>(rule: InteractionRule<Collectors, BoundPhaseState<Contract, PhaseStateSchema>, BoundManifest<Contract>, ContractErrorCode<Contract>>): InteractionRule<Collectors, BoundPhaseState<Contract, PhaseStateSchema>, BoundManifest<Contract>, ContractErrorCode<Contract>>;
688
- define<SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Effects extends EffectMap<BoundState<Contract>, BoundManifest<Contract>> = Record<string, never>, Interactions extends InteractionMap<BoundPhaseState<Contract, PhaseStateSchema>, BoundManifest<Contract>> = Record<string, never>, Stages extends StageMap<BoundPhaseState<Contract, PhaseStateSchema>, BoundManifest<Contract>> = Record<string, never>, const Zones extends PhaseZoneList<BoundManifest<Contract>> = readonly [], CardActions extends CardActionMap<BoundPhaseState<Contract, PhaseStateSchema>, BoundManifest<Contract>> = Record<string, never>>(definition: Omit<PhaseDefinition<PhaseStateSchema, BoundState<Contract>, BoundManifest<Contract>, SubmitCollectors, Effects, Interactions, Stages, Zones, CardActions>, "state">): PhaseDefinition<PhaseStateSchema, BoundState<Contract>, BoundManifest<Contract>, SubmitCollectors, Effects, Interactions, Stages, Zones, CardActions>;
689
- stepPhase<const Steps extends readonly [string, ...string[]], SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Effects extends EffectMap<BoundState<Contract>, BoundManifest<Contract>> = Record<string, never>, Interactions extends StepPhaseInteractionMap<Steps[number], ScopedPhaseState<BoundState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, BoundManifest<Contract>> = Record<string, never>, Stages extends StageMap<ScopedPhaseState<BoundState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, BoundManifest<Contract>> = Record<string, never>, const Zones extends PhaseZoneList<BoundManifest<Contract>> = readonly [], CardActions extends StepPhaseCardActionMap<Steps[number], ScopedPhaseState<BoundState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, BoundManifest<Contract>> = Record<string, never>>(definition: StepPhaseInput<Contract, PhaseStateSchema, Steps, SubmitCollectors, Effects, Interactions, Stages, Zones, CardActions>): PhaseDefinition<SchemaLike<StepPhaseState<PhaseStateSchema, Steps>>, BoundState<Contract>, BoundManifest<Contract>, SubmitCollectors, Effects, UnwrappedStepInteractions<ScopedPhaseState<BoundState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, BoundManifest<Contract>, Interactions>, Stages, Zones, UnwrappedStepCardActions<ScopedPhaseState<BoundState<Contract>, StepPhaseState<PhaseStateSchema, Steps>>, BoundManifest<Contract>, CardActions>>;
690
- readonly inputs: BoundInputBuilders<Contract>;
691
- };
692
- type ContractAuthoring<Contract extends ContractWithPhases> = {
693
- readonly contract: Contract;
694
- game<Definitions extends PhaseMapOf<Contract>, Views extends ViewMapOf<Contract>>(definition: Omit<ReducerGameDefinition<Contract, Definitions, Views>, "contract">): ReducerGameDefinition<Contract, Definitions, Views>;
695
- sharedView<Projection>(definition: SharedViewDefinition<BoundState<Contract>, BoundManifest<Contract>, Projection>): SharedViewDefinition<BoundState<Contract>, BoundManifest<Contract>, Projection>;
696
- playerView<SharedProjection = unknown, Projection = unknown>(definition: PlayerViewDefinition<BoundState<Contract>, BoundManifest<Contract>, SharedProjection, Projection>): PlayerViewDefinition<BoundState<Contract>, BoundManifest<Contract>, SharedProjection, Projection>;
697
- emptyView(): EmptyViewDefinition<BoundState<Contract>, BoundManifest<Contract>>;
698
- staticView<Projection>(definition: StaticViewDefinition<ExactManifestContractOf<Contract>, Projection>): StaticViewDefinition<ExactManifestContractOf<Contract>, Projection>;
699
- phase<Name extends PhaseNameOfContract<Contract>>(name: Name): PhaseAuthoring<Contract, PhaseSchemasOfContract<Contract>[Name]>;
700
- };
701
- declare function createContractAuthoring<const Contract extends ContractWithPhases>(contract: Contract): ContractAuthoring<Contract>;
702
-
703
46
  type EffectRollDieInput<Contract extends AnyReducerGameContract, Id extends string, ContextSchema extends AnySchema> = {
704
47
  type: "rollDie";
705
48
  id: Id;
@@ -724,29 +67,6 @@ declare function defineEffect<Contract extends AnyReducerGameContract>(): {
724
67
  <Id extends string, ContextSchema extends AnySchema = z.ZodObject<Record<string, never>, z.core.$strip>>(definition: EffectShufflePlayerZoneInput<Contract, Id, ContextSchema>): EffectShufflePlayerZoneDefinition<Id, ContextSchema, ContractState<Contract>, ContractManifest<Contract>>;
725
68
  };
726
69
 
727
- declare function defineGame<const Contract extends AnyReducerGameContract, Definitions extends PhaseMapOf<Contract>, Views extends ViewMapOf<Contract>>(definition: {
728
- contract: Contract;
729
- } & Omit<ReducerGameDefinition<NoInfer<Contract>, Definitions, Views>, "contract">): ReducerGameDefinition<Contract, Definitions, Views>;
730
-
731
- declare function defineInteraction<Contract extends AnyReducerGameContract, PhaseState extends PhaseStateInput = SchemaLike<object>>(): <Collectors extends Record<string, InputCollector>>(definition: InteractionSpec<Collectors, ScopedPhaseState<ContractState<Contract>, InferPhaseState<PhaseState>>, ContractManifest<Contract>, ContractErrorCode<Contract>>) => InteractionSpec<Collectors, ScopedPhaseState<ContractState<Contract>, InferPhaseState<PhaseState>>, ContractManifest<Contract>, ContractErrorCode<Contract>>;
732
- declare function defineInteractionRule<Contract extends AnyReducerGameContract, PhaseState extends PhaseStateInput = SchemaLike<object>>(): <Collectors extends Record<string, InputCollector> = Record<string, InputCollector>>(definition: InteractionRule<Collectors, ScopedPhaseState<ContractState<Contract>, InferPhaseState<PhaseState>>, ContractManifest<Contract>, ContractErrorCode<Contract>>) => InteractionRule<Collectors, ScopedPhaseState<ContractState<Contract>, InferPhaseState<PhaseState>>, ContractManifest<Contract>, ContractErrorCode<Contract>>;
733
- declare function defineCardAction<Contract extends AnyReducerGameContract, PhaseState extends PhaseStateInput>(): <Collectors extends Record<string, InputCollector> = Record<string, never>, const PlayFrom extends PlayerZoneIdOfManifest<ContractManifest<Contract>> = PlayerZoneIdOfManifest<ContractManifest<Contract>>>(definition: CardActionSpec<Collectors, ScopedPhaseState<ContractState<Contract>, InferPhaseState<PhaseState>>, ContractManifest<Contract>, PlayFrom, ContractErrorCode<Contract>>) => CardActionSpec<Collectors, ScopedPhaseState<ContractState<Contract>, InferPhaseState<PhaseState>>, ContractManifest<Contract>, PlayFrom, ContractErrorCode<Contract>>;
734
-
735
- declare function defineSharedView<Contract extends AnyReducerGameContract>(): <Projection>(definition: SharedViewDefinition<ContractState<Contract>, ContractManifest<Contract>, Projection>) => SharedViewDefinition<ContractState<Contract>, ContractManifest<Contract>, Projection>;
736
- declare function definePlayerView<Contract extends AnyReducerGameContract>(): <SharedProjection = unknown, Projection = unknown>(definition: PlayerViewDefinition<ContractState<Contract>, ContractManifest<Contract>, SharedProjection, Projection>) => PlayerViewDefinition<ContractState<Contract>, ContractManifest<Contract>, SharedProjection, Projection>;
737
- declare function defineEmptyView<Contract extends AnyReducerGameContract>(): EmptyViewDefinition<ContractState<Contract>, ContractManifest<Contract>>;
738
- /**
739
- * Factory for the session-scoped static view (see {@link StaticViewDefinition}).
740
- * Kept separate from dynamic view helpers because the argument shape is
741
- * structurally different: it exposes only the manifest and generated static
742
- * queries, with no `state`, `playerId`, `runtime`, `fx`, `ops`, or
743
- * `accept/reject`. That shape is what prevents authors from accidentally
744
- * projecting per-tick state into the once-per-session payload.
745
- */
746
- declare function defineStaticView<Contract extends AnyReducerGameContract>(): <Projection>(definition: StaticViewDefinition<ExactManifestContractOf<Contract>, Projection>) => StaticViewDefinition<ExactManifestContractOf<Contract>, Projection>;
747
- declare function defineStage<Contract extends AnyReducerGameContract>(): (definition: StageSpec<ContractState<Contract>, ContractManifest<Contract>>) => StageSpec<ContractState<Contract>, ContractManifest<Contract>>;
748
- declare function definePhaseStage<Contract extends AnyReducerGameContract, PhaseStateSchema extends SchemaLike<object>>(): (definition: StageSpec<ScopedPhaseState<ContractState<Contract>, z.infer<PhaseStateSchema>>, ContractManifest<Contract>>) => StageSpec<ScopedPhaseState<ContractState<Contract>, z.infer<PhaseStateSchema>>, ContractManifest<Contract>>;
749
-
750
70
  declare const gameEvent: {
751
71
  systemAction(event: Omit<SystemActionEvent, "kind">): SystemActionEvent;
752
72
  };
@@ -821,4 +141,7 @@ declare function setActivePlayers<State extends {
821
141
  };
822
142
  }>(state: State, activePlayers: PlayerIdOfState<State>[]): State;
823
143
 
824
- export { type BoardTargetBuilder, type BoardTargetPredicate, type BoardTargetRule, type BoundInputBuilders, type BoundTargetRule, type CardTargetBuilder, type CardTargetPredicate, type CardTargetRule, type ChoiceOptionsFactory, type ChoiceTargetBuilder, type ChoiceTargetOption, type ChoiceTargetPredicate, type ChoiceTargetRule, type ContractAuthoring, type ContractFingerprint, type ContractWithPhases, type DefinedInputs, type DependencyValues, DerivedResolver, ErrorCodeOfContract, type InputFieldRef, InteractionRule, type ManyOptions, type PhaseAuthoring, PhaseMapOf, type PlayerBoardSpaceTarget, type ReducerBundle, type ReducerBundleOptions, ReducerDiagnosticsSink, ReducerGameContract, ReducerGameDefinition, type ReducerPhaseDefinition, type ReducerPlayerViewDefinition, type ReducerSharedViewDefinition, type SparseCounts, type SparseMap, SystemActionEvent, TableQueries, TableQueriesOfState, type TargetContext, type TargetPredicate, type TargetPredicateArgs, type TargetRule, type TargetRuleBuilder, ValidationIssue, assertCardAllowedInContainer, boardInput, boardTarget, cardInput, cardTarget, choiceTarget, contractFingerprint, createContractAuthoring, createReducerBundle, createStateQueries, createTableQueries, defineCardAction, defineEffect, defineEmptyView, defineGame, defineGameContract, defineInputs, defineInteraction, defineInteractionRule, definePhase, definePhaseStage, definePlayerView, defineSharedView, defineStage, defineStaticView, defineStepPhase, formInput, gameEvent, many, normalizeCommandParams, promptInput, rngInput, setActivePlayers, sparseCounts, sparseMap };
144
+ /** Compile authored topology once, in memory, with the same validation used by initialization. */
145
+ declare function compileManifest<const M extends AuthoredManifest>(manifest: M): CompiledManifest<M>;
146
+
147
+ export { AuthoredManifest, type CardTargetPredicate, CompiledManifest, type ContractFingerprint, type ManyOptions, type ReducerBundle, type ReducerBundleOptions, ReducerDiagnosticsSink, ReducerGameDefinition, type SparseCounts, type SparseMap, SystemActionEvent, TableQueries, TableQueriesOfState, TargetPredicate, assertCardAllowedInContainer, compileManifest, contractFingerprint, createReducerBundle, createStateQueries, createTableQueries, defineEffect, gameEvent, many, normalizeCommandParams, setActivePlayers, sparseCounts, sparseMap };