@dreamboard-games/sdk 0.4.0-alpha.7 → 0.4.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/REFERENCE.md +1292 -287
  2. package/dist/authoring/index.d.ts +4 -9
  3. package/dist/authoring/index.js +11 -547
  4. package/dist/authoring/index.js.map +1 -1
  5. package/dist/authoring-compiler.d.ts +27 -0
  6. package/dist/authoring-compiler.js +12 -0
  7. package/dist/authoring-compiler.js.map +1 -0
  8. package/dist/authoring-materialize-cli.d.ts +1 -0
  9. package/dist/authoring-materialize-cli.js +46 -0
  10. package/dist/authoring-materialize-cli.js.map +1 -0
  11. package/dist/browser-interaction.d.ts +1 -1
  12. package/dist/{chunk-TGMXBRKY.js → chunk-3PFDHTR7.js} +19 -7
  13. package/dist/chunk-3PFDHTR7.js.map +1 -0
  14. package/dist/chunk-45P5CEGH.js +176 -0
  15. package/dist/chunk-45P5CEGH.js.map +1 -0
  16. package/dist/chunk-5XTAQ4EQ.js +32 -0
  17. package/dist/chunk-5XTAQ4EQ.js.map +1 -0
  18. package/dist/chunk-7ADPYKFT.js +532 -0
  19. package/dist/chunk-7ADPYKFT.js.map +1 -0
  20. package/dist/{chunk-RKGJ64UN.js → chunk-BUOODBVO.js} +2 -2
  21. package/dist/{chunk-VLG4YST5.js → chunk-GMOBG7Y7.js} +4 -4
  22. package/dist/{chunk-Q322XCY2.js → chunk-JRGP6W4V.js} +3 -3
  23. package/dist/chunk-L3W2FPRQ.js +1793 -0
  24. package/dist/chunk-L3W2FPRQ.js.map +1 -0
  25. package/dist/{chunk-3QIZKXJ2.js → chunk-NGYFBNBP.js} +3 -3
  26. package/dist/chunk-P6IJ5YVY.js +154 -0
  27. package/dist/chunk-P6IJ5YVY.js.map +1 -0
  28. package/dist/{chunk-5IHU5CUK.js → chunk-QQNL4WTX.js} +25 -22
  29. package/dist/chunk-QQNL4WTX.js.map +1 -0
  30. package/dist/{chunk-52DH7VQF.js → chunk-SACZWUA6.js} +143 -47
  31. package/dist/chunk-SACZWUA6.js.map +1 -0
  32. package/dist/{chunk-KYEWGZ2Y.js → chunk-SFOAY5H4.js} +2 -2
  33. package/dist/{chunk-KYEWGZ2Y.js.map → chunk-SFOAY5H4.js.map} +1 -1
  34. package/dist/chunk-UNVCT5Z7.js +73 -0
  35. package/dist/chunk-UNVCT5Z7.js.map +1 -0
  36. package/dist/{chunk-NO537WSS.js → chunk-WDR7SKBM.js} +2 -2
  37. package/dist/chunk-XDGRC6OR.js +7039 -0
  38. package/dist/chunk-XDGRC6OR.js.map +1 -0
  39. package/dist/chunk-XLHLFTLI.js +399 -0
  40. package/dist/chunk-XLHLFTLI.js.map +1 -0
  41. package/dist/{chunk-B2YBS3SG.js → chunk-YNW3KBDE.js} +41 -13
  42. package/dist/chunk-YNW3KBDE.js.map +1 -0
  43. package/dist/codegen.js +1 -1
  44. package/dist/{components-BTwSIjXj.d.ts → components-BPzsSRs8.d.ts} +1 -1
  45. package/dist/definitions-0kjPV9wh.d.ts +294 -0
  46. package/dist/{diagnostics-1BWjRo6-.d.ts → diagnostics-DIi3ina7.d.ts} +2 -1
  47. package/dist/{index-CFTjJIXd.d.ts → index-CWzWpQzM.d.ts} +1 -1
  48. package/dist/{index.d-DMASeF6M.d.ts → index.d-C7Ztirg6.d.ts} +234 -5
  49. package/dist/index.js +2 -2
  50. package/dist/package-set.d.ts +2 -2
  51. package/dist/package-set.js +2 -2
  52. package/dist/{protocol-835hEGne.d.ts → protocol-B2LWcqB4.d.ts} +14 -0
  53. package/dist/reducer/advanced.d.ts +4 -4
  54. package/dist/reducer/advanced.js +7 -26
  55. package/dist/reducer/advanced.js.map +1 -1
  56. package/dist/reducer-contract.d.ts +1 -1
  57. package/dist/reducer-contract.js +2 -2
  58. package/dist/reducer.d.ts +37 -28
  59. package/dist/reducer.js +43 -6018
  60. package/dist/reducer.js.map +1 -1
  61. package/dist/reference-game-compiler.d.ts +45 -0
  62. package/dist/reference-game-compiler.js +25 -0
  63. package/dist/reference-game-compiler.js.map +1 -0
  64. package/dist/reference-game-source-manifest-cli.d.ts +1 -0
  65. package/dist/reference-game-source-manifest-cli.js +84 -0
  66. package/dist/reference-game-source-manifest-cli.js.map +1 -0
  67. package/dist/reference-games/index.d.ts +7 -217
  68. package/dist/reference-games/index.js +28 -208
  69. package/dist/reference-games/index.js.map +1 -1
  70. package/dist/runtime/primitives.d.ts +3 -3
  71. package/dist/runtime/primitives.js +3 -3
  72. package/dist/runtime/runtime-api.d.ts +1 -1
  73. package/dist/runtime/workspace-contract.d.ts +4 -4
  74. package/dist/runtime/workspace-contract.js +4 -4
  75. package/dist/{runtime-Dkfm1x2r.d.ts → runtime-B_w9AO2n.d.ts} +60 -5
  76. package/dist/{runtime-api-C6aWo9c0.d.ts → runtime-api-xCWLMQRT.d.ts} +2 -0
  77. package/dist/runtime.d.ts +7 -7
  78. package/dist/runtime.js +13 -13
  79. package/dist/schema-9jZzlEWZ.d.ts +220 -0
  80. package/dist/{stale-contract-artifact-error-C5AaZPJ8.d.ts → stale-contract-artifact-error-XLaweZtF.d.ts} +1 -1
  81. package/dist/testing-compiler.d.ts +36 -0
  82. package/dist/testing-compiler.js +236 -0
  83. package/dist/testing-compiler.js.map +1 -0
  84. package/dist/testing-runtime.d.ts +97 -21
  85. package/dist/testing-runtime.js +154 -95
  86. package/dist/testing-runtime.js.map +1 -1
  87. package/dist/testing.d.ts +178 -60
  88. package/dist/testing.js +641 -26
  89. package/dist/testing.js.map +1 -1
  90. package/dist/types-Bvptkukh.d.ts +122 -0
  91. package/dist/{types-aI4V9CWe.d.ts → types-_zfC_7CD.d.ts} +1 -1
  92. package/dist/types.d.ts +4 -0
  93. package/dist/ui/components.d.ts +2 -2
  94. package/dist/ui/plugin-styles.css +1 -1
  95. package/dist/{ui-contract-Ue6SywvO.d.ts → ui-contract-CUC7Lyoc.d.ts} +1 -1
  96. package/dist/ui.d.ts +3 -3
  97. package/dist/{views-32rSsfeU.d.ts → views-DE2eZxPz.d.ts} +42 -13
  98. package/package.json +22 -3
  99. package/dist/chunk-3OZMHZK3.js +0 -40
  100. package/dist/chunk-3OZMHZK3.js.map +0 -1
  101. package/dist/chunk-52DH7VQF.js.map +0 -1
  102. package/dist/chunk-5IHU5CUK.js.map +0 -1
  103. package/dist/chunk-B2YBS3SG.js.map +0 -1
  104. package/dist/chunk-IU6KGPY7.js +0 -659
  105. package/dist/chunk-IU6KGPY7.js.map +0 -1
  106. package/dist/chunk-TGMXBRKY.js.map +0 -1
  107. package/dist/types-DcADVHe9.d.ts +0 -192
  108. /package/dist/{chunk-RKGJ64UN.js.map → chunk-BUOODBVO.js.map} +0 -0
  109. /package/dist/{chunk-VLG4YST5.js.map → chunk-GMOBG7Y7.js.map} +0 -0
  110. /package/dist/{chunk-Q322XCY2.js.map → chunk-JRGP6W4V.js.map} +0 -0
  111. /package/dist/{chunk-3QIZKXJ2.js.map → chunk-NGYFBNBP.js.map} +0 -0
  112. /package/dist/{chunk-NO537WSS.js.map → chunk-WDR7SKBM.js.map} +0 -0
@@ -7,7 +7,7 @@ import { b as InteractionDescriptor, Z as ZoneHandlesSnapshot, I as InputDomain,
7
7
  import { ViewCard } from './types.js';
8
8
  import { P as PrimitiveCommonProps } from './primitive-props-BNHDkgd7.js';
9
9
  import { a as BrowserInteractionAttributeMap } from './attributes-DbvyMbXw.js';
10
- import { a as PluginSessionState, P as PlayerId } from './runtime-api-C6aWo9c0.js';
10
+ import { a as PluginSessionState, P as PlayerId } from './runtime-api-xCWLMQRT.js';
11
11
  import { t as Player, j as HexColor } from './player-state-Cqpyeql0.js';
12
12
 
13
13
  interface UIRootProps {
package/dist/ui.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { bA as TrackSpace, bz as TrackPiece } from './components-BTwSIjXj.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 GameEventLog, al as GameEventLogProps, am as GameSkeleton, an as GameSkeletonProps, ao as GuidanceAction, ap as GuidancePanel, aq as GuidancePanelProps, ar as GuidancePhase, as as GuidanceSetupStep, at as Hand, au as HandDock, av as HandDockMode, aw as HandDockPlacement, ax as HandDockPresentation, ay as HandDockProps, az as HandDockToggleContext, aA as HandLayout, aB as HandProps, aC as Input, aD as Label, aE as MoreActions, aF as MoreActionsProps, aG as NetworkEdge, aH as NetworkGraph, aI as NetworkGraphProps, aJ as NetworkNode, aK as NetworkPiece, aL as OutcomeDialog, aM as OutcomeDialogProps, aN as Panel, aO as PanelActions, aP as PanelBody, aQ as PanelDescription, aR as PanelDescriptionProps, aS as PanelHeader, aT as PanelPartProps, aU as PanelRoot, aV as PanelRootProps, aW as PanelTitle, aX as PanelTitleProps, aY as PanelTone, aZ as PhaseIndicator, a_ as PhaseIndicatorProps, a$ as PlayArea, b0 as PlayAreaProps, b1 as PrimaryActionAttention, b2 as PrimaryActionButton, b3 as PrimaryActionButtonProps, b4 as PrimaryButton, b5 as PrimaryButtonProps, b6 as ResourceDefinition, b7 as Select, b8 as SelectContent, b9 as SelectItem, ba as SelectTrigger, bb as SetupChecklist, bc as SetupChecklistProps, bd as SetupGuidance, be as SlotDefinition, bf as SlotOccupant, bg as SlotSystem, bh as SlotSystemProps, bi as StagingZone, bj as StagingZoneProps, bk as StandingsTable, bl as StandingsTableProps, bm as SystemActionSummary, bn as SystemActionSummaryProps, bo as ThemedButton, bp as ThemedButtonProps, bq as Toast, br as ToastActions, bs as ToastActionsProps, bt as ToastActionsValue, bu as ToastNotification, bv as ToastProvider, bw as ToastType, bx as TrackBoard, by as TrackBoardProps, bB as UseHandLayoutOptions, bC as UseHandLayoutReturn, bD as ZoneDefinition, bE as ZoneHighlightType, bF as ZoneMap, bG as ZoneMapProps, bH as ZonePiece, bI as ZoneShape, bJ as buttonStyle, bK as chipStyle, bL as intentForVariant, bM as motionDuration, bN as playerColor, bO as surfaceStyle, bP as useCardDragSurface, bQ as useChromeSuppression } from './components-BTwSIjXj.js';
1
+ import { bA as TrackSpace, bz as TrackPiece } from './components-BPzsSRs8.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 GameEventLog, al as GameEventLogProps, am as GameSkeleton, an as GameSkeletonProps, ao as GuidanceAction, ap as GuidancePanel, aq as GuidancePanelProps, ar as GuidancePhase, as as GuidanceSetupStep, at as Hand, au as HandDock, av as HandDockMode, aw as HandDockPlacement, ax as HandDockPresentation, ay as HandDockProps, az as HandDockToggleContext, aA as HandLayout, aB as HandProps, aC as Input, aD as Label, aE as MoreActions, aF as MoreActionsProps, aG as NetworkEdge, aH as NetworkGraph, aI as NetworkGraphProps, aJ as NetworkNode, aK as NetworkPiece, aL as OutcomeDialog, aM as OutcomeDialogProps, aN as Panel, aO as PanelActions, aP as PanelBody, aQ as PanelDescription, aR as PanelDescriptionProps, aS as PanelHeader, aT as PanelPartProps, aU as PanelRoot, aV as PanelRootProps, aW as PanelTitle, aX as PanelTitleProps, aY as PanelTone, aZ as PhaseIndicator, a_ as PhaseIndicatorProps, a$ as PlayArea, b0 as PlayAreaProps, b1 as PrimaryActionAttention, b2 as PrimaryActionButton, b3 as PrimaryActionButtonProps, b4 as PrimaryButton, b5 as PrimaryButtonProps, b6 as ResourceDefinition, b7 as Select, b8 as SelectContent, b9 as SelectItem, ba as SelectTrigger, bb as SetupChecklist, bc as SetupChecklistProps, bd as SetupGuidance, be as SlotDefinition, bf as SlotOccupant, bg as SlotSystem, bh as SlotSystemProps, bi as StagingZone, bj as StagingZoneProps, bk as StandingsTable, bl as StandingsTableProps, bm as SystemActionSummary, bn as SystemActionSummaryProps, bo as ThemedButton, bp as ThemedButtonProps, bq as Toast, br as ToastActions, bs as ToastActionsProps, bt as ToastActionsValue, bu as ToastNotification, bv as ToastProvider, bw as ToastType, bx as TrackBoard, by as TrackBoardProps, bB as UseHandLayoutOptions, bC as UseHandLayoutReturn, bD as ZoneDefinition, bE as ZoneHighlightType, bF as ZoneMap, bG as ZoneMapProps, bH as ZonePiece, bI as ZoneShape, bJ as buttonStyle, bK as chipStyle, bL as intentForVariant, bM as motionDuration, bN as playerColor, bO as surfaceStyle, bP as useCardDragSurface, bQ as useChromeSuppression } from './components-BPzsSRs8.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';
@@ -15,7 +15,7 @@ import 'vaul';
15
15
  import '@radix-ui/react-dialog';
16
16
  import '@radix-ui/react-label';
17
17
  import '@radix-ui/react-select';
18
- import './runtime-Dkfm1x2r.js';
18
+ import './runtime-B_w9AO2n.js';
19
19
  import 'zod';
20
20
  import './primitive-props-BNHDkgd7.js';
21
21
 
@@ -1,4 +1,4 @@
1
- import { bQ as RuntimeTableRecord, aE as PlayerIdOfState, az as PhaseStateOfState, aM as PublicStateOfState, a8 as HiddenStateOfState, aK as PrivateStateOfState, ci as SharedZoneIdOfTable, cE as TableOfState, F as DeckCardsOfTable, aF as PlayerIdOfTable, H as DeckIdOfTable, aI as PlayerZoneIdOfTable, u as CompatibleCardIdForTwoPlayerZones, t as CompatibleCardIdForHandAndDeck, v as CompatibleHandIdForDeck, Y as HandIdOfTable, p as CardIdOfTable, e as BoardIdOfTable, ck as SpaceIdOfTable, x as ComponentIdOfTable, c as BoardContainerIdOfTable, cH as TiledBoardIdOfTable, cJ as TiledEdgeIdOfTable, cP as TiledVertexIdOfTable, b5 as ResourceAmountsOfTable, ba as ResourceIdOfTable, cG as TableQueriesOfState, aQ as ReducerGameState, cD as TableOfManifest, ac as ManifestContractOf, aL as PublicSchemaOfContract, aJ as PrivateSchemaOfContract, a7 as HiddenSchemaOfContract, ay as PhaseStateMapOfContract, at as PhaseNameOfContract, bY as SchemaLike, cx as StateDefinition, a9 as InitContext, ah as ManifestOf, O as ExactManifestContractOf, ca as SetupProfileDefinition, aR as ReducerManifestContract, aV as ReducerSessionState, bF as RuntimeSetupSelection, bz as RuntimePhaseState, a as AnySchema, ab as ManifestContract, E as ContinuationToken, av as PhaseNameOfState, aU as ReducerRuntimeStateForState, ce as SetupSelectionOfManifest, aO as ReducerAcceptOptions, aN as ReducerAccept, U as GameOutcome, aS as ReducerReject, aP as ReducerFx, aT as ReducerResult, cB as StringKeyOf, A as AnyContinuationToken, aG as PlayerZoneIdOfManifest, q as CardTypeOfState, o as CardIdOfState } from './runtime-Dkfm1x2r.js';
1
+ import { bV as RuntimeTableRecord, aG as PlayerIdOfState, aB as PhaseStateOfState, aO as PublicStateOfState, a8 as HiddenStateOfState, aM as PrivateStateOfState, cn as SharedZoneIdOfTable, cJ as TableOfState, F as DeckCardsOfTable, aH as PlayerIdOfTable, H as DeckIdOfTable, aK as PlayerZoneIdOfTable, u as CompatibleCardIdForTwoPlayerZones, t as CompatibleCardIdForHandAndDeck, v as CompatibleHandIdForDeck, Y as HandIdOfTable, p as CardIdOfTable, e as BoardIdOfTable, cp as SpaceIdOfTable, x as ComponentIdOfTable, c as BoardContainerIdOfTable, cM as TiledBoardIdOfTable, cO as TiledEdgeIdOfTable, cU as TiledVertexIdOfTable, b7 as ResourceAmountsOfTable, bc as ResourceIdOfTable, cL as TableQueriesOfState, aS as ReducerGameState, cI as TableOfManifest, ac as ManifestContractOf, aN as PublicSchemaOfContract, aL as PrivateSchemaOfContract, a7 as HiddenSchemaOfContract, aA as PhaseStateMapOfContract, av as PhaseNameOfContract, c1 as SchemaLike, cC as StateDefinition, a9 as InitContext, aj as ManifestOf, O as ExactManifestContractOf, cf as SetupProfileDefinition, aT as ReducerManifestContract, aX as ReducerSessionState, bK as RuntimeSetupSelection, bB as RuntimePhaseState, a as AnySchema, ab as ManifestContract, E as ContinuationToken, ax as PhaseNameOfState, aW as ReducerRuntimeStateForState, cj as SetupSelectionOfManifest, aQ as ReducerAcceptOptions, aP as ReducerAccept, U as GameOutcome, aU as ReducerReject, aR as ReducerFx, aV as ReducerResult, cG as StringKeyOf, A as AnyContinuationToken, aI as PlayerZoneIdOfManifest, q as CardTypeOfState, o as CardIdOfState } from './runtime-B_w9AO2n.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  /**
@@ -396,13 +396,16 @@ type ResolvedGameStateOf<Contract, Definitions extends PhaseMapOf<Contract>> = {
396
396
  };
397
397
  }[keyof Definitions & string];
398
398
  type ResolvedGameSessionOf<Contract, Definitions extends PhaseMapOf<Contract>> = ReducerSessionState<ResolvedGameStateOf<Contract, Definitions>, RuntimeSetupSelection<ManifestContractOf<Contract>>>;
399
- type ViewMapOf<Contract> = Record<string, ViewDefinition<BaseGameStateOfContract<Contract>, ManifestContractOf<Contract>, unknown>>;
399
+ type ViewMapOf<Contract, SharedProjection = unknown, PlayerProjection = unknown> = {
400
+ shared: SharedViewDefinition<BaseGameStateOfContract<Contract>, ManifestContractOf<Contract>, SharedProjection>;
401
+ player: PlayerViewDefinition<BaseGameStateOfContract<Contract>, ManifestContractOf<Contract>, SharedProjection, PlayerProjection>;
402
+ };
400
403
  type PhasesOfDefinition<Definition> = Definition extends {
401
404
  phases: infer Definitions extends Record<string, unknown>;
402
405
  } ? Definitions : never;
403
406
  type ViewsOfDefinition<Definition> = Definition extends {
404
- views?: infer Views;
405
- } ? NonNullable<Views> : never;
407
+ views: infer Views;
408
+ } ? Views : never;
406
409
  type NonNeverKeys<Registry> = {
407
410
  [Key in keyof Registry]-?: [Registry[Key]] extends [never] ? never : Key;
408
411
  }[keyof Registry];
@@ -444,13 +447,13 @@ type InitialStateCallbacks<Contract extends ReducerGameContractLike> = {
444
447
  }) => z.infer<PrivateSchemaOfContract<Contract>>;
445
448
  hidden?: (ctx: InitialStateContextOf<Contract>) => z.infer<HiddenSchemaOfContract<Contract>>;
446
449
  };
447
- type ReducerGameDefinition<Contract extends ReducerGameContractLike, Definitions extends PhaseMapOf<Contract>, Views extends ViewMapOf<Contract> = Record<string, never>> = {
450
+ type ReducerGameDefinition<Contract extends ReducerGameContractLike, Definitions extends PhaseMapOf<Contract>, Views extends ViewMapOf<Contract>> = {
448
451
  contract: Contract;
449
452
  initial?: InitialStateCallbacks<NoInfer<Contract>>;
450
453
  initialPhase?: keyof Definitions & string;
451
454
  setupProfiles?: Record<string, SetupProfileDefinition<keyof Definitions & string, ExactManifestContractOf<Contract>>>;
452
455
  phases: Definitions;
453
- views?: Views;
456
+ views: Views;
454
457
  /**
455
458
  * Optional session-scoped static projection. Authored via
456
459
  * {@link StaticViewDefinition}; computed once per reducer session from the
@@ -734,6 +737,10 @@ type RuntimeHelpers<State extends {
734
737
  derived: DerivedResolver;
735
738
  };
736
739
  type RandomHelpers = {
740
+ integer(options: {
741
+ minInclusive: number;
742
+ maxInclusive: number;
743
+ }): number;
737
744
  subset<const Values extends readonly unknown[]>(options: {
738
745
  from: Values;
739
746
  count: number;
@@ -1052,7 +1059,8 @@ type CollectorState = {
1052
1059
  * `reduce({ input: { params } })` sees branded ids from `cardInput` /
1053
1060
  * `boardInput` without a second declaration.
1054
1061
  * - an optional `eligibleTargets(state, playerId, q)` hook that the runtime
1055
- * calls to enumerate server-authoritative valid values. The hook receives
1062
+ * calls to enumerate server-authoritative, submit-ready values accepted by
1063
+ * the collector schema. The hook receives
1056
1064
  * the same `q` table-queries helper that `validate` / `reduce` see, so
1057
1065
  * board/card/prompt collectors can reuse whatever board-graph or zone
1058
1066
  * lookups they already use for validation without rebuilding them from
@@ -1103,8 +1111,15 @@ type EngineSampledCollectorKeys<Collectors extends Record<string, InputCollector
1103
1111
  kind: "rng";
1104
1112
  } ? K : never;
1105
1113
  }[keyof Collectors];
1114
+ type ClientCollectorValue<Collector> = Collector extends InputCollector<infer S> ? S extends SchemaLike<infer V> ? V : never : never;
1115
+ type ClientCollectorKeys<Collectors extends Record<string, InputCollector>> = Exclude<keyof Collectors, EngineSampledCollectorKeys<Collectors>>;
1116
+ type OptionalClientCollectorKeys<Collectors extends Record<string, InputCollector>> = {
1117
+ [K in ClientCollectorKeys<Collectors>]: undefined extends ClientCollectorValue<Collectors[K]> ? K : never;
1118
+ }[ClientCollectorKeys<Collectors>];
1106
1119
  type ClientParamsOf<Collectors extends Record<string, InputCollector>> = {
1107
- [K in keyof Collectors as K extends EngineSampledCollectorKeys<Collectors> ? never : K]: Collectors[K] extends InputCollector<infer S> ? S extends SchemaLike<infer V> ? V : never : never;
1120
+ [K in Exclude<ClientCollectorKeys<Collectors>, OptionalClientCollectorKeys<Collectors>>]: ClientCollectorValue<Collectors[K]>;
1121
+ } & {
1122
+ [K in OptionalClientCollectorKeys<Collectors>]?: Exclude<ClientCollectorValue<Collectors[K]>, undefined>;
1108
1123
  };
1109
1124
 
1110
1125
  type InteractionReduceInput<Collectors extends Record<string, InputCollector>, State extends {
@@ -1524,20 +1539,34 @@ type PhaseDefinition<PhaseStateSchema extends SchemaLike<object>, State extends
1524
1539
  phase: object;
1525
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>> = AutoPhaseDefinition<PhaseStateSchema, State, Manifest> | PlayerPhaseDefinition<PhaseStateSchema, State, Manifest, Effects, Interactions, Stages, Zones, CardActions> | SimultaneousPlayerPhaseDefinition<PhaseStateSchema, State, Manifest, SubmitCollectors, Effects, Interactions, Stages, Zones, CardActions>;
1526
1541
 
1527
- type ViewDefinition<State extends {
1542
+ type SharedViewDefinition<State extends {
1528
1543
  table: RuntimeTableRecord;
1529
1544
  flow: {
1530
1545
  currentPhase: string;
1531
1546
  };
1532
1547
  }, Manifest extends ManifestContract<TableOfState<State>>, Projection = unknown> = {
1548
+ project: (args: ActionContext<State, Manifest> & RuntimeHelpers<State> & {
1549
+ state: State;
1550
+ }) => Projection;
1551
+ };
1552
+ type PlayerViewDefinition<State extends {
1553
+ table: RuntimeTableRecord;
1554
+ flow: {
1555
+ currentPhase: string;
1556
+ };
1557
+ }, Manifest extends ManifestContract<TableOfState<State>>, SharedProjection = unknown, Projection = unknown> = {
1533
1558
  project: (args: ActionContext<State, Manifest> & RuntimeHelpers<State> & {
1534
1559
  state: State;
1535
1560
  playerId: PlayerIdOfState<State>;
1536
- runtime: State extends {
1537
- runtime: infer RuntimeStateValue;
1538
- } ? RuntimeStateValue : never;
1561
+ shared: SharedProjection;
1539
1562
  }) => Projection;
1540
1563
  };
1564
+ type EmptyViewDefinition<State extends {
1565
+ table: RuntimeTableRecord;
1566
+ flow: {
1567
+ currentPhase: string;
1568
+ };
1569
+ }, Manifest extends ManifestContract<TableOfState<State>>> = SharedViewDefinition<State, Manifest, Record<string, never>> & PlayerViewDefinition<State, Manifest, unknown, Record<string, never>>;
1541
1570
  /**
1542
1571
  * Session-scoped, once-per-init view. The `project` callback receives only
1543
1572
  * the authored manifest — the mutable-state helpers (`state`, `playerId`,
@@ -1556,4 +1585,4 @@ type StaticViewDefinition<Manifest extends ManifestContract<RuntimeTableRecord>,
1556
1585
  }) => Projection;
1557
1586
  };
1558
1587
 
1559
- export { type InputDomainDependencyCase 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 GameStateOf as W, type InitialStateCallbacks as X, type InputCollector as Y, type InputCollectorKind as Z, type InputCollectorMetaForKind as _, type ActorSelection as a, type SimultaneousSubmission as a$, type InputDomainDescriptor as a0, type InputDomainResolverDescriptor as a1, type InputKeysWithCollectorKindOfDefinition as a2, type InputSelectionDescriptor as a3, type InteractionAvailabilityArgs as a4, type InteractionCommitPolicy as a5, type InteractionIdOfDefinition as a6, type InteractionIdOfDefinitionPhase as a7, type InteractionKind as a8, type InteractionMap as a9, type PromptInputCollectorMeta as aA, type PromptInteractionKeyOfDefinition as aB, type RandomHelpers as aC, type ReducerEdit as aD, type ReducerGameContract as aE, type ReducerGameContractLike as aF, type ReducerGameDefinition as aG, type ReducerOps as aH, type ReducerSessionForConfig as aI, type ReducerStateBase as aJ, type ReducerStateForConfig as aK, type ReducerTransaction as aL, type ResolvedBoardTargetDomainDescriptor as aM, type ResolvedCardTargetDomainDescriptor as aN, type ResolvedGameSessionOf as aO, type ResolvedGameStateOf as aP, type ResourceMapDomainDescriptor as aQ, type ResumableEffectKind as aR, type RngInputCollectorMeta as aS, type RollDieContinuationResponse as aT, type RotatePlayerZoneArgs as aU, type RuntimeHelpers as aV, type ScopedPhaseState as aW, type ShufflePlayerZoneContinuationResponse as aX, type ShuffleSharedZoneContinuationResponse as aY, type SimultaneousPlayerPhaseDefinition as aZ, type SimultaneousResolveArgs as a_, type InteractionReduceArgs as aa, type InteractionReduceInput as ab, type InteractionRule as ac, type InteractionRuleValidationResult as ad, type InteractionSpec as ae, type InteractionSpecByNameOfDefinitionPhase as af, type InteractionToArgs as ag, type InteractionValidateArgs as ah, type LazyBoardTargetDomainDescriptor as ai, type LazyCardTargetDomainDescriptor as aj, type LazyInputDomainDependencies as ak, type MutationRuntimeHelpers as al, type Op as am, type ParamsOf as an, type ParamsOfInteractionOfDefinition as ao, type PhaseDefinition as ap, type PhaseDefinitionByName as aq, type PhaseEnterArgs as ar, type PhaseEnterContext as as, type PhaseMapOf as at, type PhaseNamesOfDefinition as au, type PhaseStateMapOfDefinitions as av, type PhaseStateOfDefinitions as aw, type PhaseZoneList as ax, type PlayableInteractionsOfZoneOfDefinition as ay, type PlayerPhaseDefinition as az, type ActorSelector as b, type SimultaneousSubmitSpec as b0, type StageMap as b1, type StageNamesOfDefinitionPhase as b2, type StageSpec as b3, type StaticViewDefinition as b4, type StaticViewQueries as b5, type TargetKind as b6, type ValidationIssue as b7, type ViewDefinition as b8, type ViewDefinitionByName as b9, type ViewMapOf as ba, type ViewNamesOfDefinition as bb, type ViewOfDefinition as bc, type ViewsOfDefinition as bd, type ZoneIdsOfDefinition as be, createDerivedResolver as bf, createReducerEdit as bg, createReducerOps as bh, createReducerTransaction 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 };
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 ReducerEdit 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 ResolvedBoardTargetDomainDescriptor as aO, type ResolvedCardTargetDomainDescriptor as aP, type ResolvedGameSessionOf as aQ, type ResolvedGameStateOf as aR, type ResourceMapDomainDescriptor as aS, type ResumableEffectKind as aT, type RngInputCollectorMeta as aU, type RollDieContinuationResponse as aV, type RotatePlayerZoneArgs as aW, type RuntimeHelpers 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 MutationRuntimeHelpers 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, createReducerEdit as bi, createReducerOps as bj, createReducerTransaction as bk, defineDerived as bl, pipe as bm, 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,10 +1,14 @@
1
1
  {
2
2
  "name": "@dreamboard-games/sdk",
3
- "version": "0.4.0-alpha.7",
3
+ "version": "0.4.0-alpha.9",
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
+ "dreamboard-reference-games-source-manifest": "./dist/reference-game-source-manifest-cli.js"
11
+ },
8
12
  "exports": {
9
13
  ".": {
10
14
  "types": "./dist/index.d.ts",
@@ -104,8 +108,22 @@
104
108
  "import": "./dist/testing-runtime.js",
105
109
  "default": "./dist/testing-runtime.js"
106
110
  },
111
+ "./testing-compiler": {
112
+ "types": "./dist/testing-compiler.d.ts",
113
+ "import": "./dist/testing-compiler.js",
114
+ "default": "./dist/testing-compiler.js"
115
+ },
116
+ "./authoring-compiler": {
117
+ "types": "./dist/authoring-compiler.d.ts",
118
+ "import": "./dist/authoring-compiler.js",
119
+ "default": "./dist/authoring-compiler.js"
120
+ },
121
+ "./reference-game-compiler": {
122
+ "types": "./dist/reference-game-compiler.d.ts",
123
+ "import": "./dist/reference-game-compiler.js",
124
+ "default": "./dist/reference-game-compiler.js"
125
+ },
107
126
  "./browser-interaction": {
108
- "bun": "./src/browser-interaction.ts",
109
127
  "types": "./dist/browser-interaction.d.ts",
110
128
  "import": "./dist/browser-interaction.js",
111
129
  "default": "./dist/browser-interaction.js"
@@ -122,7 +140,7 @@
122
140
  ],
123
141
  "scripts": {
124
142
  "build": "pnpm --dir ../.. --filter @dreamboard-games/sdk-types build && pnpm --dir ../.. --filter @dreamboard-games/plugin-runtime-contract build && pnpm --dir ../.. authoring-metadata:generate && tsup && node ../../scripts/copy-sdk-private-dts.mjs && mkdir -p dist/ui && tailwindcss -i src/ui/plugin-styles.css -o dist/ui/plugin-styles.css --minify",
125
- "typecheck": "tsc --noEmit",
143
+ "typecheck": "tsc --noEmit && tsc -p tsconfig.testing-contract.json",
126
144
  "lint": "eslint 'src/**/*.{ts,tsx}'",
127
145
  "storybook": "storybook dev -p 6006 --host 127.0.0.1 --no-open",
128
146
  "storybook:build": "storybook build -o storybook-static",
@@ -141,6 +159,7 @@
141
159
  "@noble/hashes": "^2.2.0",
142
160
  "@use-gesture/react": "^10.3.1",
143
161
  "clsx": "^2.1.1",
162
+ "esbuild": "^0.28.1",
144
163
  "lucide-react": "^1.20.0",
145
164
  "vaul": "^1.1.2",
146
165
  "zustand": "^5.0.14"
@@ -1,40 +0,0 @@
1
- // src/reducer/stale-contract-artifact-error.ts
2
- var DEFAULT_REMEDY_BY_ARTIFACT = {
3
- "base-states": "run `dreamboard test generate`, then re-run the tests.",
4
- "session-state": "reset the dev session or run `dreamboard test generate`."
5
- };
6
- function artifactLabel(artifact) {
7
- return artifact === "base-states" ? "base states" : "session state";
8
- }
9
- function artifactVerb(artifact) {
10
- return artifact === "base-states" ? "were" : "was";
11
- }
12
- var StaleContractArtifactError = class extends Error {
13
- code = "STALE_CONTRACT_ARTIFACT";
14
- artifact;
15
- expected;
16
- found;
17
- remedy;
18
- constructor(options) {
19
- const remedy = options.remedy ?? DEFAULT_REMEDY_BY_ARTIFACT[options.artifact];
20
- super(
21
- `${artifactLabel(options.artifact)} ${artifactVerb(
22
- options.artifact
23
- )} generated for contract ${options.found} but the current contract is ${options.expected}. Your state or phase schemas changed since the artifact was created. Remedy: ${remedy}`
24
- );
25
- this.name = "StaleContractArtifactError";
26
- this.artifact = options.artifact;
27
- this.expected = options.expected;
28
- this.found = options.found;
29
- this.remedy = remedy;
30
- }
31
- };
32
- function isStaleContractArtifactError(error) {
33
- return error instanceof StaleContractArtifactError || typeof error === "object" && error !== null && error.code === "STALE_CONTRACT_ARTIFACT";
34
- }
35
-
36
- export {
37
- StaleContractArtifactError,
38
- isStaleContractArtifactError
39
- };
40
- //# sourceMappingURL=chunk-3OZMHZK3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/reducer/stale-contract-artifact-error.ts"],"sourcesContent":["export type StaleContractArtifactKind = \"base-states\" | \"session-state\";\n\nexport type StaleContractArtifactErrorOptions = {\n artifact: StaleContractArtifactKind;\n expected: string;\n found: string;\n remedy?: string;\n};\n\nconst DEFAULT_REMEDY_BY_ARTIFACT: Record<StaleContractArtifactKind, string> = {\n \"base-states\": \"run `dreamboard test generate`, then re-run the tests.\",\n \"session-state\": \"reset the dev session or run `dreamboard test generate`.\",\n};\n\nfunction artifactLabel(artifact: StaleContractArtifactKind): string {\n return artifact === \"base-states\" ? \"base states\" : \"session state\";\n}\n\nfunction artifactVerb(artifact: StaleContractArtifactKind): string {\n return artifact === \"base-states\" ? \"were\" : \"was\";\n}\n\nexport class StaleContractArtifactError extends Error {\n readonly code = \"STALE_CONTRACT_ARTIFACT\";\n readonly artifact: StaleContractArtifactKind;\n readonly expected: string;\n readonly found: string;\n readonly remedy: string;\n\n constructor(options: StaleContractArtifactErrorOptions) {\n const remedy =\n options.remedy ?? DEFAULT_REMEDY_BY_ARTIFACT[options.artifact];\n super(\n `${artifactLabel(options.artifact)} ${artifactVerb(\n options.artifact,\n )} generated for contract ${options.found} but the current contract is ${\n options.expected\n }. ` +\n `Your state or phase schemas changed since the artifact was created. ` +\n `Remedy: ${remedy}`,\n );\n this.name = \"StaleContractArtifactError\";\n this.artifact = options.artifact;\n this.expected = options.expected;\n this.found = options.found;\n this.remedy = remedy;\n }\n}\n\nexport function isStaleContractArtifactError(\n error: unknown,\n): error is StaleContractArtifactError {\n return (\n error instanceof StaleContractArtifactError ||\n (typeof error === \"object\" &&\n error !== null &&\n (error as { code?: unknown }).code === \"STALE_CONTRACT_ARTIFACT\")\n );\n}\n"],"mappings":";AASA,IAAM,6BAAwE;AAAA,EAC5E,eAAe;AAAA,EACf,iBAAiB;AACnB;AAEA,SAAS,cAAc,UAA6C;AAClE,SAAO,aAAa,gBAAgB,gBAAgB;AACtD;AAEA,SAAS,aAAa,UAA6C;AACjE,SAAO,aAAa,gBAAgB,SAAS;AAC/C;AAEO,IAAM,6BAAN,cAAyC,MAAM;AAAA,EAC3C,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,SAA4C;AACtD,UAAM,SACJ,QAAQ,UAAU,2BAA2B,QAAQ,QAAQ;AAC/D;AAAA,MACE,GAAG,cAAc,QAAQ,QAAQ,CAAC,IAAI;AAAA,QACpC,QAAQ;AAAA,MACV,CAAC,2BAA2B,QAAQ,KAAK,gCACvC,QAAQ,QACV,iFAEa,MAAM;AAAA,IACrB;AACA,SAAK,OAAO;AACZ,SAAK,WAAW,QAAQ;AACxB,SAAK,WAAW,QAAQ;AACxB,SAAK,QAAQ,QAAQ;AACrB,SAAK,SAAS;AAAA,EAChB;AACF;AAEO,SAAS,6BACd,OACqC;AACrC,SACE,iBAAiB,8BAChB,OAAO,UAAU,YAChB,UAAU,QACT,MAA6B,SAAS;AAE7C;","names":[]}