@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.
- package/README.md +127 -0
- package/dist/browser-interaction.d.ts +22 -22
- package/dist/{chunk-VRRR6QZT.js → chunk-32PFKDV7.js} +170 -406
- package/dist/chunk-32PFKDV7.js.map +1 -0
- package/dist/{chunk-N33CGX2F.js → chunk-3BAD4VC2.js} +3 -3
- package/dist/{chunk-LMHCGCA6.js → chunk-3SKDNDPG.js} +2 -2
- package/dist/chunk-5YV2WHJ4.js +25 -0
- package/dist/chunk-5YV2WHJ4.js.map +1 -0
- package/dist/{chunk-VWTKGIYF.js → chunk-ANRB4XKA.js} +1 -1
- package/dist/chunk-ANRB4XKA.js.map +1 -0
- package/dist/{chunk-EOEA3I64.js → chunk-BI4G3PM2.js} +7 -7
- package/dist/chunk-BI4G3PM2.js.map +1 -0
- package/dist/{chunk-KRJPRYEA.js → chunk-EVCLTY4Q.js} +21 -8
- package/dist/chunk-EVCLTY4Q.js.map +1 -0
- package/dist/{chunk-DQS2EG5E.js → chunk-GDPKTBUR.js} +2 -2
- package/dist/{chunk-FL67RDID.js → chunk-H6VDGFL5.js} +128 -128
- package/dist/chunk-H6VDGFL5.js.map +1 -0
- package/dist/{chunk-6LMESVGT.js → chunk-LR3ZTWQF.js} +3 -3
- package/dist/chunk-LR3ZTWQF.js.map +1 -0
- package/dist/{chunk-TXELBVTG.js → chunk-PN5O6GG2.js} +2 -2
- package/dist/{chunk-533O7C4L.js → chunk-S2JEDVWH.js} +500 -430
- package/dist/chunk-S2JEDVWH.js.map +1 -0
- package/dist/{chunk-2GQIALJL.js → chunk-UGH54WZ2.js} +6 -2
- package/dist/chunk-UGH54WZ2.js.map +1 -0
- package/dist/chunk-VCDWP5VL.js +746 -0
- package/dist/chunk-VCDWP5VL.js.map +1 -0
- package/dist/{chunk-ZSTCUJKZ.js → chunk-Y75CFE77.js} +2 -6
- package/dist/chunk-Y75CFE77.js.map +1 -0
- package/dist/chunk-Z7QCREWI.js +3435 -0
- package/dist/chunk-Z7QCREWI.js.map +1 -0
- package/dist/chunk-ZZGN2ATS.js +1941 -0
- package/dist/chunk-ZZGN2ATS.js.map +1 -0
- package/dist/{components-CNAt5J1p.d.ts → components-gAbIz7hK.d.ts} +2 -18
- package/dist/{definitions-bZSBaPjj.d.ts → definitions-BgmV_GhC.d.ts} +3 -3
- package/dist/digest.d.ts +2 -2
- package/dist/game-CsZScpcn.d.ts +763 -0
- package/dist/{index-CR69MyWr.d.ts → index-CcT9Q7N7.d.ts} +1 -1
- package/dist/{index.d-Bw8AOcgp.d.ts → index.d-DjzoK7zn.d.ts} +67 -2
- package/dist/index.js +1 -2
- package/dist/package-set.js +1 -2
- package/dist/plugin-runtime-contract.d.ts +4 -4
- package/dist/plugin-runtime-contract.js +13 -15
- package/dist/{protocol-CVaSqPgX.d.ts → protocol-dYgafTYY.d.ts} +1 -7
- package/dist/reducer/advanced.d.ts +12 -11
- package/dist/reducer/advanced.js +10 -4
- package/dist/reducer-contract.d.ts +10 -2
- package/dist/reducer-contract.js +4 -4
- package/dist/reducer.d.ts +12 -689
- package/dist/reducer.js +19 -1293
- package/dist/reducer.js.map +1 -1
- package/dist/runtime/primitives.d.ts +4 -4
- package/dist/runtime/primitives.js +5 -5
- package/dist/runtime/runtime-api.d.ts +2 -2
- package/dist/runtime/workspace-contract.d.ts +50 -17
- package/dist/runtime/workspace-contract.js +15 -10
- package/dist/{runtime-C7Z2acNU.d.ts → runtime-RJ5orDJU.d.ts} +23 -30
- package/dist/{plugin-state-BRH3UiUp.d.ts → runtime-api-Bz5pwNU_.d.ts} +86 -4
- package/dist/runtime.d.ts +8 -8
- package/dist/runtime.js +19 -17
- package/dist/runtime.js.map +1 -1
- package/dist/schema.d.ts +2 -28
- package/dist/testing-compiler.d.ts +4 -4
- package/dist/testing-runtime.d.ts +7 -7
- package/dist/testing-runtime.js +6 -6
- package/dist/testing.d.ts +17 -17
- package/dist/testing.js +14 -14
- package/dist/{types-q1Guidm5.d.ts → types-DR7DoB1x.d.ts} +1 -1
- package/dist/{types-DN4O7kH_.d.ts → types-JWCYHmu7.d.ts} +2 -2
- package/dist/types.js +6 -18
- package/dist/types.js.map +1 -1
- package/dist/ui/components.d.ts +3 -4
- package/dist/ui/components.js +1 -5
- package/dist/{ui-contract-BC4JpysE.d.ts → ui-contract-GTUPkf8z.d.ts} +175 -176
- package/dist/ui.d.ts +4 -5
- package/dist/ui.js +2 -6
- package/dist/{views-D2Cfzr3h.d.ts → views-BpuWcOyN.d.ts} +101 -48
- package/package.json +3 -22
- package/dist/authoring/index.d.ts +0 -59
- package/dist/authoring/index.js +0 -24
- package/dist/authoring/index.js.map +0 -1
- package/dist/authoring-compiler.d.ts +0 -27
- package/dist/authoring-compiler.js +0 -11
- package/dist/authoring-compiler.js.map +0 -1
- package/dist/authoring-materialize-cli.d.ts +0 -1
- package/dist/authoring-materialize-cli.js +0 -45
- package/dist/authoring-materialize-cli.js.map +0 -1
- package/dist/chunk-2GQIALJL.js.map +0 -1
- package/dist/chunk-533O7C4L.js.map +0 -1
- package/dist/chunk-6LMESVGT.js.map +0 -1
- package/dist/chunk-EOEA3I64.js.map +0 -1
- package/dist/chunk-FL67RDID.js.map +0 -1
- package/dist/chunk-HIH6Y4FA.js +0 -7802
- package/dist/chunk-HIH6Y4FA.js.map +0 -1
- package/dist/chunk-HUK4234C.js +0 -166
- package/dist/chunk-HUK4234C.js.map +0 -1
- package/dist/chunk-KGV2EUNN.js +0 -532
- package/dist/chunk-KGV2EUNN.js.map +0 -1
- package/dist/chunk-KRJPRYEA.js.map +0 -1
- package/dist/chunk-KWHOFBDM.js +0 -9
- package/dist/chunk-KWHOFBDM.js.map +0 -1
- package/dist/chunk-VRRR6QZT.js.map +0 -1
- package/dist/chunk-VWTKGIYF.js.map +0 -1
- package/dist/chunk-XFMSLL3P.js +0 -637
- package/dist/chunk-XFMSLL3P.js.map +0 -1
- package/dist/chunk-ZSTCUJKZ.js.map +0 -1
- package/dist/codegen.d.ts +0 -941
- package/dist/codegen.js +0 -44
- package/dist/codegen.js.map +0 -1
- package/dist/runtime-api-CgPuEVeF.d.ts +0 -86
- /package/dist/{chunk-N33CGX2F.js.map → chunk-3BAD4VC2.js.map} +0 -0
- /package/dist/{chunk-LMHCGCA6.js.map → chunk-3SKDNDPG.js.map} +0 -0
- /package/dist/{chunk-DQS2EG5E.js.map → chunk-GDPKTBUR.js.map} +0 -0
- /package/dist/{chunk-TXELBVTG.js.map → chunk-PN5O6GG2.js.map} +0 -0
package/dist/ui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as ActionButton, a as ActionButtonProps, b as ActionGroup, c as ActionGroupProps, d as ActionHelp, e as ActionHelpProps, f as ActionPanel, g as ActionPanelProps, B as ButtonSize, h as ButtonVariant, C as CardDragSurface, i as CardDragSurfaceContextValue, j as CardDragSurfaceController, k as CardDragSurfaceProps, l as CardDropTargetView, m as CardDropTargetViewProps, n as CardFace, o as CardFaceProps, p as CardPositionProps, q as CardSize, r as ChromeSuppressionProvider, s as CostDisplay, t as CostDisplayProps, D as DefaultEmptySlot, u as DefaultEmptySlotProps, v as DefaultNetworkEdge, w as DefaultNetworkEdgeProps, x as DefaultNetworkNode, y as DefaultNetworkNodeProps, z as DefaultNetworkPiece, E as DefaultNetworkPieceProps, F as DefaultSlotItem, G as DefaultSlotItemProps, H as DefaultSlotOccupant, I as DefaultSlotOccupantProps, J as DefaultTrackConnection, K as DefaultTrackConnectionProps, L as DefaultTrackJump, M as DefaultTrackJumpProps, N as DefaultTrackPiece, O as DefaultTrackPieceProps, P as DefaultTrackSpace, Q as DefaultTrackSpaceProps, R as DefaultZone, S as DefaultZonePiece, T as DefaultZonePieceProps, U as DefaultZonePieces, V as DefaultZonePiecesProps, W as DefaultZoneProps, X as Dialog, Y as DialogClose, Z as DialogContent, _ as DialogDescription, $ as DialogFooter, a0 as DialogHeader, a1 as DialogOverlay, a2 as DialogPortal, a3 as DialogTitle, a4 as DialogTrigger, a5 as DiceRoller, a6 as DiceRollerProps, a7 as DragPhase, a8 as Drawer, a9 as DrawerClose, aa as DrawerContent, ab as DrawerDescription, ac as DrawerFooter, ad as DrawerHeader, ae as DrawerOverlay, af as DrawerPortal, ag as DrawerTitle, ah as DrawerTrigger, ai as ErrorBoundary, aj as ErrorBoundaryProps, ak as
|
|
1
|
+
import { bw as TrackSpace, bv as TrackPiece } from './components-gAbIz7hK.js';
|
|
2
|
+
export { A as ActionButton, a as ActionButtonProps, b as ActionGroup, c as ActionGroupProps, d as ActionHelp, e as ActionHelpProps, f as ActionPanel, g as ActionPanelProps, B as ButtonSize, h as ButtonVariant, C as CardDragSurface, i as CardDragSurfaceContextValue, j as CardDragSurfaceController, k as CardDragSurfaceProps, l as CardDropTargetView, m as CardDropTargetViewProps, n as CardFace, o as CardFaceProps, p as CardPositionProps, q as CardSize, r as ChromeSuppressionProvider, s as CostDisplay, t as CostDisplayProps, D as DefaultEmptySlot, u as DefaultEmptySlotProps, v as DefaultNetworkEdge, w as DefaultNetworkEdgeProps, x as DefaultNetworkNode, y as DefaultNetworkNodeProps, z as DefaultNetworkPiece, E as DefaultNetworkPieceProps, F as DefaultSlotItem, G as DefaultSlotItemProps, H as DefaultSlotOccupant, I as DefaultSlotOccupantProps, J as DefaultTrackConnection, K as DefaultTrackConnectionProps, L as DefaultTrackJump, M as DefaultTrackJumpProps, N as DefaultTrackPiece, O as DefaultTrackPieceProps, P as DefaultTrackSpace, Q as DefaultTrackSpaceProps, R as DefaultZone, S as DefaultZonePiece, T as DefaultZonePieceProps, U as DefaultZonePieces, V as DefaultZonePiecesProps, W as DefaultZoneProps, X as Dialog, Y as DialogClose, Z as DialogContent, _ as DialogDescription, $ as DialogFooter, a0 as DialogHeader, a1 as DialogOverlay, a2 as DialogPortal, a3 as DialogTitle, a4 as DialogTrigger, a5 as DiceRoller, a6 as DiceRollerProps, a7 as DragPhase, a8 as Drawer, a9 as DrawerClose, aa as DrawerContent, ab as DrawerDescription, ac as DrawerFooter, ad as DrawerHeader, ae as DrawerOverlay, af as DrawerPortal, ag as DrawerTitle, ah as DrawerTrigger, ai as ErrorBoundary, aj as ErrorBoundaryProps, ak as GameSkeleton, al as GameSkeletonProps, am as GuidanceAction, an as GuidancePanel, ao as GuidancePanelProps, ap as GuidancePhase, aq as GuidanceSetupStep, ar as Hand, as as HandDock, at as HandDockMode, au as HandDockPlacement, av as HandDockPresentation, aw as HandDockProps, ax as HandDockToggleContext, ay as HandLayout, az as HandProps, aA as Input, aB as Label, aC as MoreActions, aD as MoreActionsProps, aE as NetworkEdge, aF as NetworkGraph, aG as NetworkGraphProps, aH as NetworkNode, aI as NetworkPiece, aJ as OutcomeDialog, aK as OutcomeDialogProps, aL as Panel, aM as PanelActions, aN as PanelBody, aO as PanelDescription, aP as PanelDescriptionProps, aQ as PanelHeader, aR as PanelPartProps, aS as PanelRoot, aT as PanelRootProps, aU as PanelTitle, aV as PanelTitleProps, aW as PanelTone, aX as PhaseIndicator, aY as PhaseIndicatorProps, aZ as PlayArea, a_ as PlayAreaProps, a$ as PrimaryActionAttention, b0 as PrimaryActionButton, b1 as PrimaryActionButtonProps, b2 as PrimaryButton, b3 as PrimaryButtonProps, b4 as ResourceDefinition, b5 as Select, b6 as SelectContent, b7 as SelectItem, b8 as SelectTrigger, b9 as SetupChecklist, ba as SetupChecklistProps, bb as SetupGuidance, bc as SlotDefinition, bd as SlotOccupant, be as SlotSystem, bf as SlotSystemProps, bg as StagingZone, bh as StagingZoneProps, bi as StandingsTable, bj as StandingsTableProps, bk as ThemedButton, bl as ThemedButtonProps, bm as Toast, bn as ToastActions, bo as ToastActionsProps, bp as ToastActionsValue, bq as ToastNotification, br as ToastProvider, bs as ToastType, bt as TrackBoard, bu as TrackBoardProps, bx as UseHandLayoutOptions, by as UseHandLayoutReturn, bz as ZoneDefinition, bA as ZoneHighlightType, bB as ZoneMap, bC as ZoneMapProps, bD as ZonePiece, bE as ZoneShape, bF as buttonStyle, bG as chipStyle, bH as intentForVariant, bI as motionDuration, bJ as playerColor, bK as surfaceStyle, bL as useCardDragSurface, bM as useChromeSuppression } from './components-gAbIz7hK.js';
|
|
3
3
|
import { ag as Theme } from './hex-board-view-aKkblDp6.js';
|
|
4
4
|
export { A as AnyHexBoardInput, a as AnySquareBoardInput, b as AuthoredHexBoardInput, c as AuthoredSquareBoardInput, B as BoardEdgeIdOf, d as BoardSpaceIdOf, e as BoardVertexIdOf, C as CardDropTargetVisualState, f as CardIntent, g as ColorRamp, h as ComponentTokens, D as DefaultChessPiece, i as DefaultChessPieceProps, j as DefaultGridCell, k as DefaultGridCellProps, l as DefaultGridPiece, m as DefaultGridPieceProps, n as DefaultHexEdge, o as DefaultHexEdgeProps, p as DefaultHexTile, q as DefaultHexTileProps, r as DefaultHexVertex, s as DefaultHexVertexProps, E as EdgePosition, t as Elevation, F as FoundationColor, G as GeneratedHexBoardInput, u as GeneratedHexSpaceStateLike, v as GeneratedSquareBoardInput, w as GeneratedSquareSpaceStateLike, x as GeneratedTiledEdgeStateLike, y as GeneratedTiledVertexStateLike, H as HexBoardInput, z as HexBoardView, I as HexBoardViewTile, J as HexGrid, K as HexGridBoardProps, L as HexGridProps, M as HexOrientation, N as HexTileGeometry, O as IntentColor, P as InteractionVisualState, Q as InteractiveHexEdge, R as InteractiveHexVertex, S as InteractiveSquareEdge, T as InteractiveSquareVertex, U as InteractiveTargetLayer, V as InteractiveTargetRenderState, X as Motion, Y as NormalizedHexBoard, Z as NormalizedHexEdgeOf, _ as NormalizedHexTileOf, $ as NormalizedHexVertexOf, a0 as NormalizedSquareBoard, a1 as NormalizedSquareCellOf, a2 as NormalizedSquareEdgeOf, a3 as NormalizedSquarePieceOf, a4 as NormalizedSquareVertexOf, a5 as PlayerColor, a6 as Radius, a7 as SemanticColor, a8 as Space, a9 as SquareBoardInput, aa as SquareEdgePosition, ab as SquareGrid, ac as SquareGridBoardProps, ad as SquareGridProps, ae as SquareVertexPosition, af as TargetIntent, ah as ThemeMeta, ai as ThemeOverride, aj as Typography, ak as createHexBoardView, al as dropTargetVisualStateDataAttributes, am as hexUtils, an as mergeTheme, ao as normalizeHexBoardInput, ap as normalizeSquareBoardInput, aq as toAlgebraic, ar as toNumeric, as as visualStateDataAttributes } from './hex-board-view-aKkblDp6.js';
|
|
5
5
|
export { T as ThemeContextValue, a as ThemePresetId, b as ThemeProvider, c as ThemeProviderProps, g as getThemePreset, r as resolveTheme, u as useTheme, d as useThemeCssVars } from './ThemeProvider-CElaL2ik.js';
|
|
@@ -8,16 +8,15 @@ export { H as HandInteractionPolicy, a as HandLayoutKind, b as HandLayoutPolicy,
|
|
|
8
8
|
export { B as BoundResourceCounterRootProps, H as HandRole, M as MobileHandRegistration, a as MobileHandTrayProvider, R as ResourceCounter, b as ResourceCounterComponents, c as ResourceCounterCount, d as ResourceCounterIcon, e as ResourceCounterItem, f as ResourceCounterItemState, g as ResourceCounterLabel, h as ResourceCounterPartProps, i as ResourceCounterProps, j as ResourceCounterRoot, k as ResourceCounterRootProps, l as ResourceDisplayConfig, m as ResourceIconProps, n as createResourceCounter, u as useOverlayInsets, o as useRegisterBottomOverlayInset, p as useRegisterMobileHand } from './ResourceCounter-BFxJknqp.js';
|
|
9
9
|
export { B as BoardBaseId, a as BoardId, b as BoardKindStates, c as BoardRef, d as BoardStates, C as CardId, e as CardIdsByDeckId, f as CardProperties, D as DeckId, g as DiceStates, h as DieId, i as DieState, E as EdgeTypeId, G as GameState, H as HexBoardState, j as HexColor, k as HexEdgeState, l as HexTileState, m as HexVertexState, N as NetworkBoardState, n as NetworkEdgeState, o as NetworkNodeState, p as NetworkPieceState, P as PerPlayer, q as PerPlayerBoardRef, r as PieceId, s as PieceTypeId, t as Player, u as PlayerId, S as SharedBoardRef, v as SpaceId, w as SpaceTypeId, x as SquareBoardState, y as SquareCellState, z as SquareEdgeState, A as SquarePieceState, F as SquareVertexState, T as TrackBoardState, I as TrackPieceState, J as TrackSpaceState, V as VertexTypeId, K as hexColor, L as isHexColor, M as parseHexColor } from './player-state-Cqpyeql0.js';
|
|
10
10
|
export { CardCollection, ViewCard, ViewSlotOccupant } from './types.js';
|
|
11
|
-
export { P as ProjectedGameEvent, S as SystemActionEvent } from './plugin-state-BRH3UiUp.js';
|
|
12
11
|
import 'react/jsx-runtime';
|
|
13
12
|
import 'framer-motion';
|
|
14
13
|
import 'vaul';
|
|
15
14
|
import '@radix-ui/react-dialog';
|
|
16
15
|
import '@radix-ui/react-label';
|
|
17
16
|
import '@radix-ui/react-select';
|
|
18
|
-
import './runtime-
|
|
17
|
+
import './runtime-RJ5orDJU.js';
|
|
19
18
|
import 'zod';
|
|
20
|
-
import './protocol-
|
|
19
|
+
import './protocol-dYgafTYY.js';
|
|
21
20
|
import './primitive-props-BNHDkgd7.js';
|
|
22
21
|
|
|
23
22
|
/**
|
package/dist/ui.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
parseHexColor,
|
|
6
6
|
toTrackBoardData,
|
|
7
7
|
useBoardTheme
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3SKDNDPG.js";
|
|
9
9
|
import {
|
|
10
10
|
ActionButton,
|
|
11
11
|
ActionGroup,
|
|
@@ -57,7 +57,6 @@ import {
|
|
|
57
57
|
DrawerTitle,
|
|
58
58
|
DrawerTrigger,
|
|
59
59
|
ErrorBoundary,
|
|
60
|
-
GameEventLog,
|
|
61
60
|
GameSkeleton,
|
|
62
61
|
GuidancePanel,
|
|
63
62
|
Hand,
|
|
@@ -96,7 +95,6 @@ import {
|
|
|
96
95
|
SquareGrid,
|
|
97
96
|
StagingZone,
|
|
98
97
|
StandingsTable,
|
|
99
|
-
SystemActionSummary,
|
|
100
98
|
ThemeProvider,
|
|
101
99
|
ThemedButton,
|
|
102
100
|
Toast,
|
|
@@ -137,7 +135,7 @@ import {
|
|
|
137
135
|
useTheme,
|
|
138
136
|
useThemeCssVars,
|
|
139
137
|
visualStateDataAttributes
|
|
140
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-32PFKDV7.js";
|
|
141
139
|
import "./chunk-VDXOF4FW.js";
|
|
142
140
|
import "./chunk-PZ5AY32C.js";
|
|
143
141
|
export {
|
|
@@ -191,7 +189,6 @@ export {
|
|
|
191
189
|
DrawerTitle,
|
|
192
190
|
DrawerTrigger,
|
|
193
191
|
ErrorBoundary,
|
|
194
|
-
GameEventLog,
|
|
195
192
|
GameSkeleton,
|
|
196
193
|
GuidancePanel,
|
|
197
194
|
Hand,
|
|
@@ -230,7 +227,6 @@ export {
|
|
|
230
227
|
SquareGrid,
|
|
231
228
|
StagingZone,
|
|
232
229
|
StandingsTable,
|
|
233
|
-
SystemActionSummary,
|
|
234
230
|
ThemeProvider,
|
|
235
231
|
ThemedButton,
|
|
236
232
|
Toast,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bW as RuntimeTableRecord, aF as PlayerIdOfState, aA as PhaseStateOfState, aN as PublicStateOfState, a7 as HiddenStateOfState, aL as PrivateStateOfState, co as SharedZoneIdOfTable, cJ as TableOfState, F as DeckCardsOfTable, aG as PlayerIdOfTable, H as DeckIdOfTable, aJ as PlayerZoneIdOfTable, u as CompatibleCardIdForTwoPlayerZones, t as CompatibleCardIdForHandAndDeck, v as CompatibleHandIdForDeck, X as HandIdOfTable, p as CardIdOfTable, e as BoardIdOfTable, cq as SpaceIdOfTable, x as ComponentIdOfTable, c as BoardContainerIdOfTable, cM as TiledBoardIdOfTable, cO as TiledEdgeIdOfTable, cU as TiledVertexIdOfTable, b7 as ResourceAmountsOfTable, bc as ResourceIdOfTable, S as GameEvent, by as RuntimeInstructionForState, L as EffectSpecLike, K as EffectInvokeOptions, aO as ReducerAccept, aw as PhaseNameOfState, U as GameOutcome, aU as ReducerReject, cL as TableQueriesOfState, aR as ReducerGameState, cI as TableOfManifest, ab as ManifestContractOf, aM as PublicSchemaOfContract, aK as PrivateSchemaOfContract, a6 as HiddenSchemaOfContract, az as PhaseStateMapOfContract, au as PhaseNameOfContract, c2 as SchemaLike, cD as StateDefinition, a8 as InitContext, ai as ManifestOf, O as ExactManifestContractOf, cg as SetupProfileDefinition, aS as ReducerManifestContract, aX as ReducerSessionState, bL as RuntimeSetupSelection, bC as RuntimePhaseState, aa as ManifestContract, aW as ReducerRuntimeStateForState, ck as SetupSelectionOfManifest, cG as StringKeyOf, a as AnySchema, E as ContinuationToken, aV as ReducerResult, A as AnyContinuationToken, aH as PlayerZoneIdOfManifest, q as CardTypeOfState, o as CardIdOfState } from './runtime-RJ5orDJU.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -61,10 +61,14 @@ type ReducerStateBase = {
|
|
|
61
61
|
};
|
|
62
62
|
type PipeTable<State extends ReducerStateBase> = TableOfState<State>;
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
64
|
+
* Shallow patch or functional updater for one state slice. The updater is a
|
|
65
|
+
* method-style callable so a transaction over a phase-scoped state stays
|
|
66
|
+
* assignable to one over the base game state; a plain function type would be
|
|
67
|
+
* invariant in `T` under `strictFunctionTypes`.
|
|
66
68
|
*/
|
|
67
|
-
type StatePatch<T> = Partial<T> |
|
|
69
|
+
type StatePatch<T> = Partial<T> | {
|
|
70
|
+
update(prev: T): T;
|
|
71
|
+
}["update"];
|
|
68
72
|
/**
|
|
69
73
|
* Curried writer namespace for a specific game state type.
|
|
70
74
|
*
|
|
@@ -306,6 +310,18 @@ interface ReducerOps<State extends ReducerStateBase> {
|
|
|
306
310
|
*/
|
|
307
311
|
declare function createReducerOps<State extends ReducerStateBase>(): ReducerOps<State>;
|
|
308
312
|
|
|
313
|
+
type IsAny<Value> = 0 extends 1 & Value ? true : false;
|
|
314
|
+
type WithFlow<State> = State extends {
|
|
315
|
+
flow: {
|
|
316
|
+
currentPhase: string;
|
|
317
|
+
};
|
|
318
|
+
} ? State : State & {
|
|
319
|
+
flow: {
|
|
320
|
+
currentPhase: string;
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
/** Phase names a transaction may transition to; `string` when state is erased. */
|
|
324
|
+
type TransitionTarget<State> = IsAny<State> extends true ? string : PhaseNameOfState<State>;
|
|
309
325
|
type RotatePlayerZoneArgs<State extends {
|
|
310
326
|
table: RuntimeTableRecord;
|
|
311
327
|
}, ZoneId extends PlayerZoneIdOfTable<TableOfState<State>> = PlayerZoneIdOfTable<TableOfState<State>>, PlayerId extends PlayerIdOfTable<TableOfState<State>> = PlayerIdOfTable<TableOfState<State>>> = {
|
|
@@ -315,10 +331,19 @@ type RotatePlayerZoneArgs<State extends {
|
|
|
315
331
|
cardIdsByPlayer?: Partial<Record<PlayerId, readonly CardIdOfTable<TableOfState<State>>[]>>;
|
|
316
332
|
position?: "top" | "bottom";
|
|
317
333
|
};
|
|
334
|
+
/**
|
|
335
|
+
* Method-style callable. Method parameters are compared bivariantly, so a
|
|
336
|
+
* transaction over a phase-scoped state stays assignable to one over the base
|
|
337
|
+
* game state (and vice versa for engine-erased states). Function-typed
|
|
338
|
+
* properties would be invariant under `strictFunctionTypes`.
|
|
339
|
+
*/
|
|
340
|
+
type BivariantMethod<Args extends readonly unknown[], Result> = {
|
|
341
|
+
method(...args: Args): Result;
|
|
342
|
+
}["method"];
|
|
318
343
|
type TransactionMethods<State extends {
|
|
319
344
|
table: RuntimeTableRecord;
|
|
320
345
|
}> = {
|
|
321
|
-
[Key in Exclude<keyof ReducerOps<State>, "moveComponentToSpace">]: ReducerOps<State>[Key] extends (...args: infer Args) => Op<State> ?
|
|
346
|
+
[Key in Exclude<keyof ReducerOps<State>, "moveComponentToSpace">]: ReducerOps<State>[Key] extends (...args: infer Args) => Op<State> ? BivariantMethod<Args, State> : never;
|
|
322
347
|
} & {
|
|
323
348
|
moveComponentToSpace<BoardId extends BoardIdOfTable<TableOfState<State>>, SpaceId extends SpaceIdOfTable<TableOfState<State>, BoardId>, ComponentId extends ComponentIdOfTable<TableOfState<State>>>(args: {
|
|
324
349
|
componentId: ComponentId;
|
|
@@ -326,23 +351,41 @@ type TransactionMethods<State extends {
|
|
|
326
351
|
spaceId: SpaceId;
|
|
327
352
|
}): State;
|
|
328
353
|
};
|
|
354
|
+
/**
|
|
355
|
+
* Result builders on the transaction. A mutation callback ends with one of
|
|
356
|
+
* these or with a bare `return` (accept the transaction as it stands).
|
|
357
|
+
*/
|
|
358
|
+
type ReducerTransactionOutcome<State extends {
|
|
359
|
+
table: RuntimeTableRecord;
|
|
360
|
+
}, ErrorCode extends string = string> = {
|
|
361
|
+
/** Record events on the eventual accept result. */
|
|
362
|
+
emit(...events: GameEvent[]): void;
|
|
363
|
+
/** Queue runtime instructions on the eventual accept result. */
|
|
364
|
+
schedule(...instructions: RuntimeInstructionForState<State>[]): void;
|
|
365
|
+
/** Queue an engine effect authored with `defineEffect`. */
|
|
366
|
+
effect<Effect extends EffectSpecLike>(effect: Effect, options: EffectInvokeOptions<Effect, WithFlow<State>>): void;
|
|
367
|
+
/** Accept with the current transaction state. Same as a bare `return`. */
|
|
368
|
+
accept(): ReducerAccept<State>;
|
|
369
|
+
/** Accept and move the flow to another declared phase. */
|
|
370
|
+
transition<To extends TransitionTarget<State>>(to: To): ReducerAccept<State>;
|
|
371
|
+
/**
|
|
372
|
+
* Accept and end the game with a terminal outcome. Pass `transition` to
|
|
373
|
+
* also move the flow to a terminal phase in the same result.
|
|
374
|
+
*/
|
|
375
|
+
endGame(outcome: GameOutcome<PlayerIdOfState<State>>, options?: {
|
|
376
|
+
transition?: TransitionTarget<State>;
|
|
377
|
+
}): ReducerAccept<State>;
|
|
378
|
+
/** Reject with a declared error code. The transaction is discarded. */
|
|
379
|
+
reject(errorCode: ErrorCode, message?: string): ReducerReject;
|
|
380
|
+
};
|
|
329
381
|
type ReducerTransaction<State extends {
|
|
330
382
|
table: RuntimeTableRecord;
|
|
331
|
-
}> = TransactionMethods<State> & {
|
|
383
|
+
}, ErrorCode extends string = string> = TransactionMethods<State> & ReducerTransactionOutcome<State, ErrorCode> & {
|
|
332
384
|
readonly state: State;
|
|
333
385
|
readonly q: TableQueriesOfState<State>;
|
|
334
386
|
apply(op: Op<State>): State;
|
|
335
387
|
rotatePlayerZone<ZoneId extends PlayerZoneIdOfTable<TableOfState<State>>, PlayerId extends PlayerIdOfTable<TableOfState<State>>>(args: RotatePlayerZoneArgs<State, ZoneId, PlayerId>): State;
|
|
336
388
|
};
|
|
337
|
-
type ReducerEdit<State extends {
|
|
338
|
-
table: RuntimeTableRecord;
|
|
339
|
-
}> = <DraftState extends State>(state: DraftState) => ReducerTransaction<DraftState>;
|
|
340
|
-
declare function createReducerTransaction<State extends {
|
|
341
|
-
table: RuntimeTableRecord;
|
|
342
|
-
}>(initialState: State, ops?: ReducerOps<State>): ReducerTransaction<State>;
|
|
343
|
-
declare function createReducerEdit<State extends {
|
|
344
|
-
table: RuntimeTableRecord;
|
|
345
|
-
}>(ops?: ReducerOps<State>): ReducerEdit<State>;
|
|
346
389
|
|
|
347
390
|
type ReducerGameContract<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> = {
|
|
348
391
|
manifest: Manifest;
|
|
@@ -557,7 +600,7 @@ type ParamsOfInteractionOfDefinition<Definition, PhaseName extends PhaseNamesOfD
|
|
|
557
600
|
*
|
|
558
601
|
* This is the type that drives `submit(playerId, id, params)`,
|
|
559
602
|
* `handle.submit(params)`, and the generated `InteractionParams` surface
|
|
560
|
-
*
|
|
603
|
+
* through `createGameUi(game)`. The `reduce`-input counterpart is
|
|
561
604
|
* {@link ParamsOfInteractionOfDefinition}, which includes every field
|
|
562
605
|
* because the engine has already filled the sampled ones by then.
|
|
563
606
|
*/
|
|
@@ -721,18 +764,16 @@ type ValidationIssue<ErrorCode extends string = string> = {
|
|
|
721
764
|
errorCode: ErrorCode;
|
|
722
765
|
message?: string;
|
|
723
766
|
};
|
|
724
|
-
|
|
767
|
+
/**
|
|
768
|
+
* Read-only helpers available to every callback, including views, actor
|
|
769
|
+
* selectors, and interaction rules.
|
|
770
|
+
*/
|
|
771
|
+
type ReadHelpers<State extends {
|
|
725
772
|
table: RuntimeTableRecord;
|
|
726
773
|
flow: {
|
|
727
774
|
currentPhase: string;
|
|
728
775
|
};
|
|
729
|
-
}
|
|
730
|
-
accept(state: State, options?: ReducerAcceptOptions<State>): ReducerAccept<State>;
|
|
731
|
-
endGame(state: State, outcome: GameOutcome<PlayerIdOfState<State>>, options?: ReducerAcceptOptions<State>): ReducerAccept<State>;
|
|
732
|
-
reject: (errorCode: ErrorCode, message?: string) => ReducerReject;
|
|
733
|
-
fx: ReducerFx<State>;
|
|
734
|
-
ops: ReducerOps<State>;
|
|
735
|
-
edit<DraftState extends State>(state: DraftState): ReducerTransaction<DraftState>;
|
|
776
|
+
}> = {
|
|
736
777
|
q: TableQueriesOfState<State>;
|
|
737
778
|
derived: DerivedResolver;
|
|
738
779
|
};
|
|
@@ -746,7 +787,19 @@ type RandomHelpers = {
|
|
|
746
787
|
count: number;
|
|
747
788
|
}): readonly Values[number][];
|
|
748
789
|
};
|
|
749
|
-
|
|
790
|
+
/**
|
|
791
|
+
* Helpers available only to mutation callbacks (`enter`, `reduce`, `resolve`,
|
|
792
|
+
* continuations). `tx` is the open transaction: mutate through it and end the
|
|
793
|
+
* callback with a bare `return`, `tx.transition(...)`, `tx.endGame(...)`, or
|
|
794
|
+
* `tx.reject(...)`.
|
|
795
|
+
*/
|
|
796
|
+
type MutationHelpers<State extends {
|
|
797
|
+
table: RuntimeTableRecord;
|
|
798
|
+
flow: {
|
|
799
|
+
currentPhase: string;
|
|
800
|
+
};
|
|
801
|
+
}, ErrorCode extends string = string> = {
|
|
802
|
+
tx: ReducerTransaction<State, ErrorCode>;
|
|
750
803
|
random: RandomHelpers;
|
|
751
804
|
};
|
|
752
805
|
type PhaseEnterArgs<State extends {
|
|
@@ -754,7 +807,7 @@ type PhaseEnterArgs<State extends {
|
|
|
754
807
|
flow: {
|
|
755
808
|
currentPhase: string;
|
|
756
809
|
};
|
|
757
|
-
}, Manifest extends ManifestContract<TableOfState<State
|
|
810
|
+
}, Manifest extends ManifestContract<TableOfState<State>>, ErrorCode extends string = string> = ActionContext<State, Manifest> & ReadHelpers<State> & MutationHelpers<State, ErrorCode> & PhaseEnterContext & {
|
|
758
811
|
state: State;
|
|
759
812
|
};
|
|
760
813
|
type ActorSelectorArgs<State extends {
|
|
@@ -762,7 +815,7 @@ type ActorSelectorArgs<State extends {
|
|
|
762
815
|
flow: {
|
|
763
816
|
currentPhase: string;
|
|
764
817
|
};
|
|
765
|
-
}, Manifest extends ManifestContract<TableOfState<State>>> = ActionContext<State, Manifest> &
|
|
818
|
+
}, Manifest extends ManifestContract<TableOfState<State>>> = ActionContext<State, Manifest> & ReadHelpers<State> & {
|
|
766
819
|
state: State;
|
|
767
820
|
};
|
|
768
821
|
type ActorSelection<State extends {
|
|
@@ -782,7 +835,7 @@ type ContinuationReduceArgs<DataSchema extends AnySchema, State extends {
|
|
|
782
835
|
flow: {
|
|
783
836
|
currentPhase: string;
|
|
784
837
|
};
|
|
785
|
-
}, Manifest extends ManifestContract<TableOfState<State>>, EffectType extends ResumableEffectKind = ResumableEffectKind> = ActionContext<State, Manifest> &
|
|
838
|
+
}, Manifest extends ManifestContract<TableOfState<State>>, EffectType extends ResumableEffectKind = ResumableEffectKind> = ActionContext<State, Manifest> & ReadHelpers<State> & MutationHelpers<State> & {
|
|
786
839
|
state: State;
|
|
787
840
|
input: ContinuationInputForSource<DataSchema, EffectType>;
|
|
788
841
|
};
|
|
@@ -1136,7 +1189,7 @@ type InteractionValidateArgs<Collectors extends Record<string, InputCollector>,
|
|
|
1136
1189
|
flow: {
|
|
1137
1190
|
currentPhase: string;
|
|
1138
1191
|
};
|
|
1139
|
-
}, Manifest extends ManifestContract<TableOfState<State
|
|
1192
|
+
}, Manifest extends ManifestContract<TableOfState<State>>> = ActionContext<State, Manifest> & ReadHelpers<State> & {
|
|
1140
1193
|
state: State;
|
|
1141
1194
|
input: InteractionReduceInput<Collectors, State>;
|
|
1142
1195
|
};
|
|
@@ -1145,13 +1198,13 @@ type InteractionReduceArgs<Collectors extends Record<string, InputCollector>, St
|
|
|
1145
1198
|
flow: {
|
|
1146
1199
|
currentPhase: string;
|
|
1147
1200
|
};
|
|
1148
|
-
}, Manifest extends ManifestContract<TableOfState<State>>, ErrorCode extends string = string> = InteractionValidateArgs<Collectors, State, Manifest
|
|
1201
|
+
}, Manifest extends ManifestContract<TableOfState<State>>, ErrorCode extends string = string> = InteractionValidateArgs<Collectors, State, Manifest> & MutationHelpers<State, ErrorCode>;
|
|
1149
1202
|
type InteractionAvailabilityArgs<State extends {
|
|
1150
1203
|
table: RuntimeTableRecord;
|
|
1151
1204
|
flow: {
|
|
1152
1205
|
currentPhase: string;
|
|
1153
1206
|
};
|
|
1154
|
-
}, Manifest extends ManifestContract<TableOfState<State>>> = ActionContext<State, Manifest> &
|
|
1207
|
+
}, Manifest extends ManifestContract<TableOfState<State>>> = ActionContext<State, Manifest> & ReadHelpers<State> & {
|
|
1155
1208
|
state: State;
|
|
1156
1209
|
input: {
|
|
1157
1210
|
playerId: PlayerIdOfState<State>;
|
|
@@ -1190,7 +1243,7 @@ type InteractionRule<Collectors extends Record<string, InputCollector> = Record<
|
|
|
1190
1243
|
* Submit-time rule. Runs with parsed params and may return false, a concrete
|
|
1191
1244
|
* ValidationIssue, null, or undefined.
|
|
1192
1245
|
*/
|
|
1193
|
-
validate?: BivariantCallback<InteractionValidateArgs<Collectors, State, Manifest
|
|
1246
|
+
validate?: BivariantCallback<InteractionValidateArgs<Collectors, State, Manifest>, InteractionRuleValidationResult<ErrorCode>>;
|
|
1194
1247
|
};
|
|
1195
1248
|
type InteractionCommitPolicy = {
|
|
1196
1249
|
mode: "manual";
|
|
@@ -1280,9 +1333,9 @@ type InteractionSpec<Collectors extends Record<string, InputCollector> = Record<
|
|
|
1280
1333
|
*/
|
|
1281
1334
|
visibility?: "all" | "actorsOnly";
|
|
1282
1335
|
errorCodes?: readonly ErrorCode[];
|
|
1283
|
-
cost?: BivariantCallback<InteractionValidateArgs<Collectors, State, Manifest
|
|
1336
|
+
cost?: BivariantCallback<InteractionValidateArgs<Collectors, State, Manifest>, Readonly<Record<string, number>>>;
|
|
1284
1337
|
rules?: readonly InteractionRule<NoInfer<Collectors>, State, Manifest, ErrorCode>[];
|
|
1285
|
-
reduce: BivariantCallback<InteractionReduceArgs<Collectors, State, Manifest, ErrorCode>, ReducerResult<State
|
|
1338
|
+
reduce: BivariantCallback<InteractionReduceArgs<Collectors, State, Manifest, ErrorCode>, ReducerResult<State> | void>;
|
|
1286
1339
|
};
|
|
1287
1340
|
type CardActionSpec<Collectors extends Record<string, InputCollector> = Record<string, InputCollector>, State extends {
|
|
1288
1341
|
table: RuntimeTableRecord;
|
|
@@ -1314,7 +1367,7 @@ type CardActionSpec<Collectors extends Record<string, InputCollector> = Record<s
|
|
|
1314
1367
|
errorCodes?: readonly ErrorCode[];
|
|
1315
1368
|
cost?: BivariantCallback<InteractionValidateArgs<Collectors & {
|
|
1316
1369
|
cardId: InputCollector<SchemaLike<CardIdOfState<State>>>;
|
|
1317
|
-
}, State, Manifest
|
|
1370
|
+
}, State, Manifest>, Readonly<Record<string, number>>>;
|
|
1318
1371
|
rules?: readonly InteractionRule<NoInfer<Collectors & {
|
|
1319
1372
|
cardId: InputCollector<SchemaLike<CardIdOfState<State>>>;
|
|
1320
1373
|
}>, State, Manifest, ErrorCode>[];
|
|
@@ -1335,7 +1388,7 @@ type AnyCardActionSpec<State extends {
|
|
|
1335
1388
|
actor?: BivariantCallback<any, any>;
|
|
1336
1389
|
cost?: BivariantCallback<any, Readonly<Record<string, number>>>;
|
|
1337
1390
|
rules?: readonly AnyInteractionRule[];
|
|
1338
|
-
reduce: BivariantCallback<any, ReducerResult<any
|
|
1391
|
+
reduce: BivariantCallback<any, ReducerResult<any> | void>;
|
|
1339
1392
|
};
|
|
1340
1393
|
type CardActionMap<State extends {
|
|
1341
1394
|
table: RuntimeTableRecord;
|
|
@@ -1358,7 +1411,7 @@ type AnyInteractionSpec<State extends {
|
|
|
1358
1411
|
actor?: BivariantCallback<any, any>;
|
|
1359
1412
|
cost?: BivariantCallback<any, Readonly<Record<string, number>>>;
|
|
1360
1413
|
rules?: readonly AnyInteractionRule[];
|
|
1361
|
-
reduce: BivariantCallback<any, ReducerResult<any
|
|
1414
|
+
reduce: BivariantCallback<any, ReducerResult<any> | void>;
|
|
1362
1415
|
to?: BivariantCallback<any, any>;
|
|
1363
1416
|
};
|
|
1364
1417
|
type InteractionMap<State extends {
|
|
@@ -1402,7 +1455,7 @@ type SimultaneousResolveArgs<Collectors extends Record<string, InputCollector>,
|
|
|
1402
1455
|
flow: {
|
|
1403
1456
|
currentPhase: string;
|
|
1404
1457
|
};
|
|
1405
|
-
}, Manifest extends ManifestContract<TableOfState<State
|
|
1458
|
+
}, Manifest extends ManifestContract<TableOfState<State>>, ErrorCode extends string = string> = ActionContext<State, Manifest> & ReadHelpers<State> & MutationHelpers<State, ErrorCode> & {
|
|
1406
1459
|
state: State;
|
|
1407
1460
|
submissions: Record<PlayerIdOfState<State>, SimultaneousSubmission<Collectors, State>>;
|
|
1408
1461
|
submittedPlayerIds: PlayerIdOfState<State>[];
|
|
@@ -1438,7 +1491,7 @@ type PhaseDefinitionCommon<PhaseStateSchema extends SchemaLike<object>, State ex
|
|
|
1438
1491
|
currentPhase: string;
|
|
1439
1492
|
};
|
|
1440
1493
|
phase: object;
|
|
1441
|
-
}, Manifest extends ManifestContract<TableOfState<State
|
|
1494
|
+
}, Manifest extends ManifestContract<TableOfState<State>>, ErrorCode extends string = string> = {
|
|
1442
1495
|
name?: string;
|
|
1443
1496
|
guidance?: PhaseGuidance;
|
|
1444
1497
|
state: PhaseStateSchema;
|
|
@@ -1448,7 +1501,7 @@ type PhaseDefinitionCommon<PhaseStateSchema extends SchemaLike<object>, State ex
|
|
|
1448
1501
|
playerIds: PlayerIdOfState<State>[];
|
|
1449
1502
|
setup: SetupSelectionOfManifest<Manifest> | null;
|
|
1450
1503
|
}) => z.infer<PhaseStateSchema>;
|
|
1451
|
-
enter?: BivariantCallback<PhaseEnterArgs<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest>, ReducerResult<ScopedPhaseState<State, z.infer<PhaseStateSchema>>> | void>;
|
|
1504
|
+
enter?: BivariantCallback<PhaseEnterArgs<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest, ErrorCode>, ReducerResult<ScopedPhaseState<State, z.infer<PhaseStateSchema>>> | void>;
|
|
1452
1505
|
};
|
|
1453
1506
|
type AutoPhaseDefinition<PhaseStateSchema extends SchemaLike<object>, State extends {
|
|
1454
1507
|
table: RuntimeTableRecord;
|
|
@@ -1456,7 +1509,7 @@ type AutoPhaseDefinition<PhaseStateSchema extends SchemaLike<object>, State exte
|
|
|
1456
1509
|
currentPhase: string;
|
|
1457
1510
|
};
|
|
1458
1511
|
phase: object;
|
|
1459
|
-
}, Manifest extends ManifestContract<TableOfState<State
|
|
1512
|
+
}, Manifest extends ManifestContract<TableOfState<State>>, ErrorCode extends string = string> = PhaseDefinitionCommon<PhaseStateSchema, State, Manifest, ErrorCode> & {
|
|
1460
1513
|
kind: "auto";
|
|
1461
1514
|
actor?: never;
|
|
1462
1515
|
actors?: never;
|
|
@@ -1475,7 +1528,7 @@ type PlayerPhaseDefinition<PhaseStateSchema extends SchemaLike<object>, State ex
|
|
|
1475
1528
|
currentPhase: string;
|
|
1476
1529
|
};
|
|
1477
1530
|
phase: object;
|
|
1478
|
-
}, Manifest extends ManifestContract<TableOfState<State>>, Effects extends EffectMap<State, Manifest> = Record<string, never>, Interactions extends InteractionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Stages extends StageMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Zones extends PhaseZoneList<Manifest> = readonly [], CardActions extends CardActionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never
|
|
1531
|
+
}, Manifest extends ManifestContract<TableOfState<State>>, Effects extends EffectMap<State, Manifest> = Record<string, never>, Interactions extends InteractionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Stages extends StageMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Zones extends PhaseZoneList<Manifest> = readonly [], CardActions extends CardActionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, ErrorCode extends string = string> = PhaseDefinitionCommon<PhaseStateSchema, State, Manifest, ErrorCode> & {
|
|
1479
1532
|
kind: "player";
|
|
1480
1533
|
/**
|
|
1481
1534
|
* Default actor selector for interactions in this phase. When omitted the
|
|
@@ -1499,7 +1552,7 @@ type SimultaneousPlayerPhaseDefinition<PhaseStateSchema extends SchemaLike<objec
|
|
|
1499
1552
|
currentPhase: string;
|
|
1500
1553
|
};
|
|
1501
1554
|
phase: object;
|
|
1502
|
-
}, Manifest extends ManifestContract<TableOfState<State>>, SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Effects extends EffectMap<State, Manifest> = Record<string, never>, Interactions extends InteractionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Stages extends StageMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Zones extends PhaseZoneList<Manifest> = readonly [], CardActions extends CardActionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never
|
|
1555
|
+
}, Manifest extends ManifestContract<TableOfState<State>>, SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Effects extends EffectMap<State, Manifest> = Record<string, never>, Interactions extends InteractionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Stages extends StageMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Zones extends PhaseZoneList<Manifest> = readonly [], CardActions extends CardActionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, ErrorCode extends string = string> = PhaseDefinitionCommon<PhaseStateSchema, State, Manifest, ErrorCode> & {
|
|
1503
1556
|
kind: "simultaneousPlayer";
|
|
1504
1557
|
actor?: never;
|
|
1505
1558
|
/**
|
|
@@ -1524,7 +1577,7 @@ type SimultaneousPlayerPhaseDefinition<PhaseStateSchema extends SchemaLike<objec
|
|
|
1524
1577
|
* submitted params are passed together so game state mutates from one
|
|
1525
1578
|
* deterministic base state instead of one player at a time.
|
|
1526
1579
|
*/
|
|
1527
|
-
resolve: BivariantCallback<SimultaneousResolveArgs<SubmitCollectors, ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest>, ReducerResult<ScopedPhaseState<State, z.infer<PhaseStateSchema
|
|
1580
|
+
resolve: BivariantCallback<SimultaneousResolveArgs<SubmitCollectors, ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest, ErrorCode>, ReducerResult<ScopedPhaseState<State, z.infer<PhaseStateSchema>>> | void>;
|
|
1528
1581
|
effects?: Effects;
|
|
1529
1582
|
interactions?: Interactions;
|
|
1530
1583
|
stages?: Stages;
|
|
@@ -1537,7 +1590,7 @@ type PhaseDefinition<PhaseStateSchema extends SchemaLike<object>, State extends
|
|
|
1537
1590
|
currentPhase: string;
|
|
1538
1591
|
};
|
|
1539
1592
|
phase: object;
|
|
1540
|
-
}, Manifest extends ManifestContract<TableOfState<State>>, SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Effects extends EffectMap<State, Manifest> = Record<string, never>, Interactions extends InteractionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Stages extends StageMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Zones extends PhaseZoneList<Manifest> = readonly [], CardActions extends CardActionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never
|
|
1593
|
+
}, Manifest extends ManifestContract<TableOfState<State>>, SubmitCollectors extends Record<string, InputCollector> = Record<string, InputCollector>, Effects extends EffectMap<State, Manifest> = Record<string, never>, Interactions extends InteractionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Stages extends StageMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, Zones extends PhaseZoneList<Manifest> = readonly [], CardActions extends CardActionMap<ScopedPhaseState<State, z.infer<PhaseStateSchema>>, Manifest> = Record<string, never>, ErrorCode extends string = string> = AutoPhaseDefinition<PhaseStateSchema, State, Manifest, ErrorCode> | PlayerPhaseDefinition<PhaseStateSchema, State, Manifest, Effects, Interactions, Stages, Zones, CardActions, ErrorCode> | SimultaneousPlayerPhaseDefinition<PhaseStateSchema, State, Manifest, SubmitCollectors, Effects, Interactions, Stages, Zones, CardActions, ErrorCode>;
|
|
1541
1594
|
|
|
1542
1595
|
type SharedViewDefinition<State extends {
|
|
1543
1596
|
table: RuntimeTableRecord;
|
|
@@ -1545,7 +1598,7 @@ type SharedViewDefinition<State extends {
|
|
|
1545
1598
|
currentPhase: string;
|
|
1546
1599
|
};
|
|
1547
1600
|
}, Manifest extends ManifestContract<TableOfState<State>>, Projection = unknown> = {
|
|
1548
|
-
project: (args: ActionContext<State, Manifest> &
|
|
1601
|
+
project: (args: ActionContext<State, Manifest> & ReadHelpers<State> & {
|
|
1549
1602
|
state: State;
|
|
1550
1603
|
}) => Projection;
|
|
1551
1604
|
};
|
|
@@ -1555,7 +1608,7 @@ type PlayerViewDefinition<State extends {
|
|
|
1555
1608
|
currentPhase: string;
|
|
1556
1609
|
};
|
|
1557
1610
|
}, Manifest extends ManifestContract<TableOfState<State>>, SharedProjection = unknown, Projection = unknown> = {
|
|
1558
|
-
project: (args: ActionContext<State, Manifest> &
|
|
1611
|
+
project: (args: ActionContext<State, Manifest> & ReadHelpers<State> & {
|
|
1559
1612
|
state: State;
|
|
1560
1613
|
playerId: PlayerIdOfState<State>;
|
|
1561
1614
|
shared: SharedProjection;
|
|
@@ -1585,4 +1638,4 @@ type StaticViewDefinition<Manifest extends ManifestContract<RuntimeTableRecord>,
|
|
|
1585
1638
|
}) => Projection;
|
|
1586
1639
|
};
|
|
1587
1640
|
|
|
1588
|
-
export { type InputCollectorMetaForKind as $, type ActionContext as A, type BaseGameSessionOfContract as B, type CardActionMap as C, type ContinuationInput as D, type ContinuationInputForSource as E, type ContinuationKind as F, type ContinuationReduceArgs as G, type ContinuationSourceKind as H, type DefaultedClientParamKeysOfInteractionOfDefinition as I, type DerivedDefinition as J, type DerivedResolver as K, type EagerInputDomainDependencies as L, type EffectContinuationCallable as M, type EffectContinuationInput as N, type EffectContinuationResponse as O, type EffectDefinition as P, type EffectIdsOfDefinition as Q, type EffectMap as R, type EffectRegistryOfPhase as S, type EffectRollDieDefinition as T, type EffectShuffleDefinition as U, type EffectShufflePlayerZoneDefinition as V, type EmptyViewDefinition as W, type GameStateOf as X, type InitialStateCallbacks as Y, type InputCollector as Z, type InputCollectorKind as _, type ActorSelection as a, type ShuffleSharedZoneContinuationResponse as a$, type InputDomainDependencyCase as a0, type InputDomainDescriptor as a1, type InputDomainResolverDescriptor as a2, type InputKeysWithCollectorKindOfDefinition as a3, type InputSelectionDescriptor as a4, type InteractionAvailabilityArgs as a5, type InteractionCommitPolicy as a6, type InteractionIdOfDefinition as a7, type InteractionIdOfDefinitionPhase as a8, type InteractionKind as a9, type PlayerPhaseDefinition as aA, type PlayerViewDefinition as aB, type PromptInputCollectorMeta as aC, type PromptInteractionKeyOfDefinition as aD, type RandomHelpers as aE, type
|
|
1641
|
+
export { type InputCollectorMetaForKind as $, type ActionContext as A, type BaseGameSessionOfContract as B, type CardActionMap as C, type ContinuationInput as D, type ContinuationInputForSource as E, type ContinuationKind as F, type ContinuationReduceArgs as G, type ContinuationSourceKind as H, type DefaultedClientParamKeysOfInteractionOfDefinition as I, type DerivedDefinition as J, type DerivedResolver as K, type EagerInputDomainDependencies as L, type EffectContinuationCallable as M, type EffectContinuationInput as N, type EffectContinuationResponse as O, type EffectDefinition as P, type EffectIdsOfDefinition as Q, type EffectMap as R, type EffectRegistryOfPhase as S, type EffectRollDieDefinition as T, type EffectShuffleDefinition as U, type EffectShufflePlayerZoneDefinition as V, type EmptyViewDefinition as W, type GameStateOf as X, type InitialStateCallbacks as Y, type InputCollector as Z, type InputCollectorKind as _, type ActorSelection as a, type ShuffleSharedZoneContinuationResponse as a$, type InputDomainDependencyCase as a0, type InputDomainDescriptor as a1, type InputDomainResolverDescriptor as a2, type InputKeysWithCollectorKindOfDefinition as a3, type InputSelectionDescriptor as a4, type InteractionAvailabilityArgs as a5, type InteractionCommitPolicy as a6, type InteractionIdOfDefinition as a7, type InteractionIdOfDefinitionPhase as a8, type InteractionKind as a9, type PlayerPhaseDefinition as aA, type PlayerViewDefinition as aB, type PromptInputCollectorMeta as aC, type PromptInteractionKeyOfDefinition as aD, type RandomHelpers as aE, type ReadHelpers as aF, type ReducerGameContract as aG, type ReducerGameContractLike as aH, type ReducerGameDefinition as aI, type ReducerOps as aJ, type ReducerSessionForConfig as aK, type ReducerStateBase as aL, type ReducerStateForConfig as aM, type ReducerTransaction as aN, type ReducerTransactionOutcome as aO, type ResolvedBoardTargetDomainDescriptor as aP, type ResolvedCardTargetDomainDescriptor as aQ, type ResolvedGameSessionOf as aR, type ResolvedGameStateOf as aS, type ResourceMapDomainDescriptor as aT, type ResumableEffectKind as aU, type RngInputCollectorMeta as aV, type RollDieContinuationResponse as aW, type RotatePlayerZoneArgs as aX, type ScopedPhaseState as aY, type SharedViewDefinition as aZ, type ShufflePlayerZoneContinuationResponse as a_, type InteractionMap as aa, type InteractionReduceArgs as ab, type InteractionReduceInput as ac, type InteractionRule as ad, type InteractionRuleValidationResult as ae, type InteractionSpec as af, type InteractionSpecByNameOfDefinitionPhase as ag, type InteractionToArgs as ah, type InteractionValidateArgs as ai, type LazyBoardTargetDomainDescriptor as aj, type LazyCardTargetDomainDescriptor as ak, type LazyInputDomainDependencies as al, type MutationHelpers as am, type Op as an, type ParamsOf as ao, type ParamsOfInteractionOfDefinition as ap, type PhaseDefinition as aq, type PhaseDefinitionByName as ar, type PhaseEnterArgs as as, type PhaseEnterContext as at, type PhaseMapOf as au, type PhaseNamesOfDefinition as av, type PhaseStateMapOfDefinitions as aw, type PhaseStateOfDefinitions as ax, type PhaseZoneList as ay, type PlayableInteractionsOfZoneOfDefinition as az, type ActorSelector as b, type SimultaneousPlayerPhaseDefinition as b0, type SimultaneousResolveArgs as b1, type SimultaneousSubmission as b2, type SimultaneousSubmitSpec as b3, type StageMap as b4, type StageNamesOfDefinitionPhase as b5, type StageSpec as b6, type StaticViewDefinition as b7, type StaticViewQueries as b8, type TargetKind as b9, type ValidationIssue as ba, type ViewDefinitionByName as bb, type ViewMapOf as bc, type ViewNamesOfDefinition as bd, type ViewOfDefinition as be, type ViewsOfDefinition as bf, type ZoneIdsOfDefinition as bg, createDerivedResolver as bh, createReducerOps as bi, defineDerived as bj, pipe as bk, type ActorSelectorArgs as c, type AnyCardActionSpec as d, type AnyContinuationCallable as e, type AnyInteractionSpec as f, type AnyPhaseDefinitionForContract as g, type AnyReducerGameDefinition as h, type AutoPhaseDefinition as i, type BaseGameStateOfContract as j, type BoardInputCollectorKind as k, type BoardInputCollectorMeta as l, type BoardInteractionKeyOfDefinition as m, type BoardTargetDomainDescriptor as n, type BoundedNumberDomainDescriptor as o, type CardActionSpec as p, type CardInputCollectorMeta as q, type CardInputZoneIdsOfDefinition as r, type CardInteractionKeyOfDefinition as s, type CardTargetDomainDescriptor as t, type ChoiceDomainDescriptor as u, type ChoiceListDomainDescriptor as v, type ClientParamsOf as w, type ClientParamsOfInteractionOfDefinition as x, type CollectorState as y, type ContinuationCallable as z };
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamboard-games/sdk",
|
|
3
|
-
"version": "0.5.0-alpha.
|
|
3
|
+
"version": "0.5.0-alpha.2",
|
|
4
4
|
"description": "Dreamboard SDK package set metadata and public facade",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
-
"bin": {
|
|
9
|
-
"dreamboard-sdk-materialize": "./dist/authoring-materialize-cli.js"
|
|
10
|
-
},
|
|
11
8
|
"exports": {
|
|
12
9
|
".": {
|
|
13
10
|
"types": "./dist/index.d.ts",
|
|
@@ -87,16 +84,6 @@
|
|
|
87
84
|
"import": "./dist/runtime/runtime-api.js",
|
|
88
85
|
"default": "./dist/runtime/runtime-api.js"
|
|
89
86
|
},
|
|
90
|
-
"./codegen": {
|
|
91
|
-
"types": "./dist/codegen.d.ts",
|
|
92
|
-
"import": "./dist/codegen.js",
|
|
93
|
-
"default": "./dist/codegen.js"
|
|
94
|
-
},
|
|
95
|
-
"./authoring": {
|
|
96
|
-
"types": "./dist/authoring/index.d.ts",
|
|
97
|
-
"import": "./dist/authoring/index.js",
|
|
98
|
-
"default": "./dist/authoring/index.js"
|
|
99
|
-
},
|
|
100
87
|
"./reducer-contract": {
|
|
101
88
|
"types": "./dist/reducer-contract.d.ts",
|
|
102
89
|
"import": "./dist/reducer-contract.js",
|
|
@@ -117,11 +104,6 @@
|
|
|
117
104
|
"import": "./dist/testing-compiler.js",
|
|
118
105
|
"default": "./dist/testing-compiler.js"
|
|
119
106
|
},
|
|
120
|
-
"./authoring-compiler": {
|
|
121
|
-
"types": "./dist/authoring-compiler.d.ts",
|
|
122
|
-
"import": "./dist/authoring-compiler.js",
|
|
123
|
-
"default": "./dist/authoring-compiler.js"
|
|
124
|
-
},
|
|
125
107
|
"./browser-interaction": {
|
|
126
108
|
"types": "./dist/browser-interaction.d.ts",
|
|
127
109
|
"import": "./dist/browser-interaction.js",
|
|
@@ -179,10 +161,9 @@
|
|
|
179
161
|
"vitest": "4.1.10",
|
|
180
162
|
"wait-on": "^8.0.1",
|
|
181
163
|
"zod": "4.4.3",
|
|
182
|
-
"@dreamboard-games/reducer-contract": "0.5.0",
|
|
183
|
-
"@dreamboard-games/sdk-types": "0.2.0",
|
|
184
164
|
"@dreamboard-games/plugin-runtime-contract": "0.1.0",
|
|
185
|
-
"@dreamboard-games/
|
|
165
|
+
"@dreamboard-games/sdk-types": "0.2.0",
|
|
166
|
+
"@dreamboard-games/reducer-contract": "0.5.0"
|
|
186
167
|
},
|
|
187
168
|
"peerDependencies": {
|
|
188
169
|
"framer-motion": "^11.0.0 || ^12.0.0",
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { JsonValue } from '../types.js';
|
|
2
|
-
|
|
3
|
-
type AuthoringMetadataV1 = {
|
|
4
|
-
sdkVersion: string;
|
|
5
|
-
};
|
|
6
|
-
type AuthoringValidationResultV1 = {
|
|
7
|
-
valid: boolean;
|
|
8
|
-
errors: readonly string[];
|
|
9
|
-
warnings: readonly string[];
|
|
10
|
-
};
|
|
11
|
-
type GeneratedArtifactV1 = {
|
|
12
|
-
path: string;
|
|
13
|
-
ownership: "authoritative" | "seed";
|
|
14
|
-
content: string;
|
|
15
|
-
contentSha256: string;
|
|
16
|
-
};
|
|
17
|
-
type GeneratedPathPatternV1 = {
|
|
18
|
-
prefix: string;
|
|
19
|
-
suffix: string;
|
|
20
|
-
};
|
|
21
|
-
type AuthoringManifestConformanceCaseV1 = {
|
|
22
|
-
id: string;
|
|
23
|
-
manifest: JsonValue;
|
|
24
|
-
expected: {
|
|
25
|
-
valid: true;
|
|
26
|
-
transportValid: true;
|
|
27
|
-
materializedSha256: string;
|
|
28
|
-
} | {
|
|
29
|
-
valid: false;
|
|
30
|
-
transportValid: boolean;
|
|
31
|
-
diagnosticCodes: readonly string[];
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
type ProjectAuthoringAdapterV1 = {
|
|
35
|
-
protocolVersion: 1;
|
|
36
|
-
metadata: AuthoringMetadataV1;
|
|
37
|
-
generatedPaths: readonly string[];
|
|
38
|
-
generatedPathPatterns: readonly GeneratedPathPatternV1[];
|
|
39
|
-
manifestConformanceCases: readonly AuthoringManifestConformanceCaseV1[];
|
|
40
|
-
validateManifest(manifest: unknown): AuthoringValidationResultV1;
|
|
41
|
-
materializeManifest(manifest: unknown): JsonValue;
|
|
42
|
-
generateWorkspaceArtifacts(manifest: unknown): readonly GeneratedArtifactV1[];
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
declare function diagnosticCodesForValidationErrors(errors: readonly string[]): readonly string[];
|
|
46
|
-
|
|
47
|
-
declare function validateManifest(manifest: unknown): AuthoringValidationResultV1;
|
|
48
|
-
declare function materializeManifest(manifest: unknown): JsonValue;
|
|
49
|
-
declare function generateWorkspaceArtifacts(manifest: unknown): readonly GeneratedArtifactV1[];
|
|
50
|
-
declare const GENERATED_WORKSPACE_PATHS: readonly string[];
|
|
51
|
-
type GeneratedWorkspacePathPattern = {
|
|
52
|
-
readonly prefix: string;
|
|
53
|
-
readonly suffix: string;
|
|
54
|
-
};
|
|
55
|
-
declare const GENERATED_WORKSPACE_PATH_PATTERNS: readonly GeneratedWorkspacePathPattern[];
|
|
56
|
-
declare const MANIFEST_CONFORMANCE_CASES: readonly AuthoringManifestConformanceCaseV1[];
|
|
57
|
-
declare const projectAuthoringAdapter: ProjectAuthoringAdapterV1;
|
|
58
|
-
|
|
59
|
-
export { type AuthoringManifestConformanceCaseV1, type AuthoringMetadataV1, type AuthoringValidationResultV1, GENERATED_WORKSPACE_PATHS, GENERATED_WORKSPACE_PATH_PATTERNS, type GeneratedArtifactV1, type GeneratedPathPatternV1, MANIFEST_CONFORMANCE_CASES, type ProjectAuthoringAdapterV1, diagnosticCodesForValidationErrors, generateWorkspaceArtifacts, materializeManifest, projectAuthoringAdapter, validateManifest };
|
package/dist/authoring/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GENERATED_WORKSPACE_PATHS,
|
|
3
|
-
GENERATED_WORKSPACE_PATH_PATTERNS,
|
|
4
|
-
MANIFEST_CONFORMANCE_CASES,
|
|
5
|
-
diagnosticCodesForValidationErrors,
|
|
6
|
-
generateWorkspaceArtifacts,
|
|
7
|
-
materializeManifest,
|
|
8
|
-
projectAuthoringAdapter,
|
|
9
|
-
validateManifest
|
|
10
|
-
} from "../chunk-KGV2EUNN.js";
|
|
11
|
-
import "../chunk-KWHOFBDM.js";
|
|
12
|
-
import "../chunk-HIH6Y4FA.js";
|
|
13
|
-
import "../chunk-PZ5AY32C.js";
|
|
14
|
-
export {
|
|
15
|
-
GENERATED_WORKSPACE_PATHS,
|
|
16
|
-
GENERATED_WORKSPACE_PATH_PATTERNS,
|
|
17
|
-
MANIFEST_CONFORMANCE_CASES,
|
|
18
|
-
diagnosticCodesForValidationErrors,
|
|
19
|
-
generateWorkspaceArtifacts,
|
|
20
|
-
materializeManifest,
|
|
21
|
-
projectAuthoringAdapter,
|
|
22
|
-
validateManifest
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|