@dxos/plugin-chess 0.8.4-main.72ec0f3 → 0.8.4-main.7996785055
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/dist/lib/browser/ChessArticle-JTNMZK6P.mjs +59 -0
- package/dist/lib/browser/ChessArticle-JTNMZK6P.mjs.map +7 -0
- package/dist/lib/browser/ChessCard-HVD4LK2C.mjs +21 -0
- package/dist/lib/browser/ChessCard-HVD4LK2C.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-SH2HLKBU.mjs +20 -0
- package/dist/lib/browser/blueprint-definition-SH2HLKBU.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +14 -0
- package/dist/lib/browser/chunk-2TJN26DN.mjs +67 -0
- package/dist/lib/browser/chunk-2TJN26DN.mjs.map +7 -0
- package/dist/lib/browser/chunk-GPFHUDFY.mjs +110 -0
- package/dist/lib/browser/chunk-GPFHUDFY.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-JKW2ZYHP.mjs +28 -0
- package/dist/lib/browser/chunk-JKW2ZYHP.mjs.map +7 -0
- package/dist/lib/browser/chunk-OT2LMRRV.mjs +42 -0
- package/dist/lib/browser/chunk-OT2LMRRV.mjs.map +7 -0
- package/dist/lib/browser/chunk-OUFKVTXQ.mjs +278 -0
- package/dist/lib/browser/chunk-OUFKVTXQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DUO4WTAM.mjs → chunk-RGHZ5CDO.mjs} +2 -9
- package/dist/lib/browser/chunk-RGHZ5CDO.mjs.map +7 -0
- package/dist/lib/browser/chunk-WYUTI2K4.mjs +1 -0
- package/dist/lib/browser/chunk-WYUTI2K4.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +38 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/create-UJ656WLM.mjs +24 -0
- package/dist/lib/browser/create-UJ656WLM.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +70 -78
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/move-QCJSXFHW.mjs +36 -0
- package/dist/lib/browser/move-QCJSXFHW.mjs.map +7 -0
- package/dist/lib/browser/operation-handler-NKF7GNU2.mjs +17 -0
- package/dist/lib/browser/operation-handler-NKF7GNU2.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +19 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/play-YEOTE6KO.mjs +45 -0
- package/dist/lib/browser/play-YEOTE6KO.mjs.map +7 -0
- package/dist/lib/browser/print-LUCG4CIR.mjs +30 -0
- package/dist/lib/browser/print-LUCG4CIR.mjs.map +7 -0
- package/dist/lib/browser/react-surface-2VBZOUX2.mjs +50 -0
- package/dist/lib/browser/react-surface-2VBZOUX2.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -5
- package/dist/lib/node-esm/ChessArticle-677BPBLL.mjs +60 -0
- package/dist/lib/node-esm/ChessArticle-677BPBLL.mjs.map +7 -0
- package/dist/lib/node-esm/ChessCard-4WOJ225W.mjs +22 -0
- package/dist/lib/node-esm/ChessCard-4WOJ225W.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-5UIG6VEF.mjs +21 -0
- package/dist/lib/node-esm/blueprint-definition-5UIG6VEF.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +15 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7XDEO6IJ.mjs +2 -0
- package/dist/lib/node-esm/chunk-7XDEO6IJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-D72ZBXX6.mjs +29 -0
- package/dist/lib/node-esm/chunk-D72ZBXX6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-KNOOJFIR.mjs → chunk-FYPVCMP4.mjs} +2 -8
- package/dist/lib/node-esm/chunk-FYPVCMP4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSVQ3553.mjs +43 -0
- package/dist/lib/node-esm/chunk-HSVQ3553.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LPVPGURE.mjs +111 -0
- package/dist/lib/node-esm/chunk-LPVPGURE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MP3A3AGA.mjs → chunk-OIRJVY2R.mjs} +21 -38
- package/dist/lib/node-esm/chunk-OIRJVY2R.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-S22QSSUJ.mjs +279 -0
- package/dist/lib/node-esm/chunk-S22QSSUJ.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +39 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/create-KINGWZOM.mjs +25 -0
- package/dist/lib/node-esm/create-KINGWZOM.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +70 -78
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/move-JDR3KQ5G.mjs +37 -0
- package/dist/lib/node-esm/move-JDR3KQ5G.mjs.map +7 -0
- package/dist/lib/node-esm/operation-handler-U7XD2D3B.mjs +18 -0
- package/dist/lib/node-esm/operation-handler-U7XD2D3B.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +20 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/play-KIWAE5LA.mjs +46 -0
- package/dist/lib/node-esm/play-KIWAE5LA.mjs.map +7 -0
- package/dist/lib/node-esm/print-QHFZDMWC.mjs +31 -0
- package/dist/lib/node-esm/print-QHFZDMWC.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-2HD5V4SH.mjs +51 -0
- package/dist/lib/node-esm/react-surface-2HD5V4SH.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +3 -5
- package/dist/types/src/ChessPlugin.d.ts +2 -1
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/chess-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +3 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +12 -0
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +2 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +3 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/components/{Chessboard.d.ts → Chessboard/Chessboard.d.ts} +4 -8
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -0
- package/dist/types/src/components/{Info.d.ts → Chessboard/Info.d.ts} +1 -1
- package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/index.d.ts +2 -0
- package/dist/types/src/components/Chessboard/index.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/types.d.ts +8 -0
- package/dist/types/src/components/Chessboard/types.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +6 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
- package/dist/types/src/{components/Chessboard.stories.d.ts → containers/ChessArticle/ChessArticle.stories.d.ts} +9 -6
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts +3 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts +6 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -0
- package/dist/types/src/{components/Card.stories.d.ts → containers/ChessCard/ChessCard.stories.d.ts} +2 -9
- package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/index.d.ts +3 -0
- package/dist/types/src/containers/ChessCard/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +51 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/move.d.ts +5 -0
- package/dist/types/src/operations/move.d.ts.map +1 -0
- package/dist/types/src/operations/play.d.ts +5 -0
- package/dist/types/src/operations/play.d.ts.map +1 -0
- package/dist/types/src/operations/print.d.ts +5 -0
- package/dist/types/src/operations/print.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts +18 -18
- package/dist/types/src/types/Chess.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +65 -43
- package/src/ChessPlugin.tsx +39 -52
- package/src/blueprints/chess-blueprint.ts +35 -0
- package/src/blueprints/index.ts +6 -0
- package/src/capabilities/artifact-definition/artifact-definition.ts +135 -0
- package/src/capabilities/artifact-definition/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +17 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/index.ts +2 -6
- package/src/capabilities/operation-handler/index.ts +9 -0
- package/src/capabilities/operation-handler/operation-handler.ts +14 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +33 -0
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +37 -0
- package/src/components/{Chessboard.tsx → Chessboard/Chessboard.tsx} +32 -29
- package/src/components/{Info.tsx → Chessboard/Info.tsx} +35 -18
- package/src/components/Chessboard/index.ts +5 -0
- package/src/components/Chessboard/types.ts +18 -0
- package/src/components/index.ts +1 -5
- package/src/containers/ChessArticle/ChessArticle.stories.tsx +53 -0
- package/src/containers/ChessArticle/ChessArticle.tsx +73 -0
- package/src/containers/ChessArticle/index.ts +7 -0
- package/src/containers/ChessCard/ChessCard.stories.tsx +42 -0
- package/src/containers/ChessCard/ChessCard.tsx +22 -0
- package/src/containers/ChessCard/index.ts +7 -0
- package/src/containers/index.ts +8 -0
- package/src/index.ts +2 -2
- package/src/meta.ts +3 -3
- package/src/operations/create.ts +22 -0
- package/src/operations/definitions.ts +109 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/move.ts +37 -0
- package/src/operations/play.ts +46 -0
- package/src/operations/print.ts +28 -0
- package/src/translations.ts +2 -0
- package/src/types/Chess.ts +14 -12
- package/src/types/index.ts +0 -1
- package/dist/lib/browser/ChessboardContainer-5YXEM4VR.mjs +0 -96
- package/dist/lib/browser/ChessboardContainer-5YXEM4VR.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-FD4TL5EE.mjs +0 -11
- package/dist/lib/browser/chunk-5DOZV3PW.mjs +0 -294
- package/dist/lib/browser/chunk-5DOZV3PW.mjs.map +0 -7
- package/dist/lib/browser/chunk-DUO4WTAM.mjs.map +0 -7
- package/dist/lib/browser/chunk-FBLAVAMY.mjs +0 -84
- package/dist/lib/browser/chunk-FBLAVAMY.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q5TZCIH7.mjs +0 -8
- package/dist/lib/browser/chunk-Q5TZCIH7.mjs.map +0 -7
- package/dist/lib/browser/chunk-TIIGNOGK.mjs +0 -169
- package/dist/lib/browser/chunk-TIIGNOGK.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-GXZN2EBT.mjs +0 -25
- package/dist/lib/browser/intent-resolver-GXZN2EBT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-KTTAUHAA.mjs +0 -38
- package/dist/lib/browser/react-surface-KTTAUHAA.mjs.map +0 -7
- package/dist/lib/node-esm/ChessboardContainer-7OQ6TOKB.mjs +0 -97
- package/dist/lib/node-esm/ChessboardContainer-7OQ6TOKB.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-O7ZM3HUF.mjs +0 -12
- package/dist/lib/node-esm/chunk-F4C2HVZL.mjs +0 -295
- package/dist/lib/node-esm/chunk-F4C2HVZL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KNOOJFIR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MP3A3AGA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RTCAAOLF.mjs +0 -170
- package/dist/lib/node-esm/chunk-RTCAAOLF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VVXTAVIS.mjs +0 -10
- package/dist/lib/node-esm/chunk-VVXTAVIS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HK5L6P6Z.mjs +0 -26
- package/dist/lib/node-esm/intent-resolver-HK5L6P6Z.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-VO4PSY6O.mjs +0 -39
- package/dist/lib/node-esm/react-surface-VO4PSY6O.mjs.map +0 -7
- package/dist/types/src/capabilities/artifact-definition.d.ts +0 -11
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -6
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/Card.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardArticle.d.ts +0 -7
- package/dist/types/src/components/ChessboardArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardContainer.d.ts +0 -9
- package/dist/types/src/components/ChessboardContainer.d.ts.map +0 -1
- package/dist/types/src/components/Info.d.ts.map +0 -1
- package/dist/types/src/functions/create.d.ts +0 -14
- package/dist/types/src/functions/create.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/move.d.ts +0 -8
- package/dist/types/src/functions/move.d.ts.map +0 -1
- package/dist/types/src/functions/play.d.ts +0 -9
- package/dist/types/src/functions/play.d.ts.map +0 -1
- package/dist/types/src/types/ChessAction.d.ts +0 -24
- package/dist/types/src/types/ChessAction.d.ts.map +0 -1
- package/src/capabilities/artifact-definition.ts +0 -129
- package/src/capabilities/blueprint-definition.ts +0 -36
- package/src/capabilities/intent-resolver.ts +0 -22
- package/src/capabilities/react-surface.tsx +0 -23
- package/src/components/Card.stories.tsx +0 -66
- package/src/components/Chessboard.stories.tsx +0 -49
- package/src/components/ChessboardArticle.tsx +0 -68
- package/src/components/ChessboardContainer.tsx +0 -44
- package/src/functions/create.ts +0 -32
- package/src/functions/index.ts +0 -7
- package/src/functions/move.ts +0 -45
- package/src/functions/play.ts +0 -55
- package/src/types/ChessAction.ts +0 -19
- /package/dist/lib/browser/{blueprint-definition-FD4TL5EE.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-O7ZM3HUF.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import "./chunk-7XDEO6IJ.mjs";
|
|
3
|
+
import {
|
|
4
|
+
Chessboard
|
|
5
|
+
} from "./chunk-S22QSSUJ.mjs";
|
|
6
|
+
import "./chunk-FYPVCMP4.mjs";
|
|
7
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
8
|
+
|
|
9
|
+
// src/containers/ChessCard/ChessCard.tsx
|
|
10
|
+
import React from "react";
|
|
11
|
+
var ChessCard = ({ subject: game }) => {
|
|
12
|
+
return /* @__PURE__ */ React.createElement(Chessboard.Root, {
|
|
13
|
+
game
|
|
14
|
+
}, /* @__PURE__ */ React.createElement(Chessboard.Content, null, /* @__PURE__ */ React.createElement(Chessboard.Board, null)));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// src/containers/ChessCard/index.ts
|
|
18
|
+
var ChessCard_default = ChessCard;
|
|
19
|
+
export {
|
|
20
|
+
ChessCard_default as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=ChessCard-4WOJ225W.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/ChessCard/ChessCard.tsx", "../../../src/containers/ChessCard/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\n\nimport { Chessboard } from '../../components';\nimport { type Chess } from '../../types';\n\nexport type ChessCardProps = SurfaceComponentProps<Chess.Game>;\n\nexport const ChessCard = ({ subject: game }: ChessCardProps) => {\n return (\n <Chessboard.Root game={game}>\n <Chessboard.Content>\n <Chessboard.Board />\n </Chessboard.Content>\n </Chessboard.Root>\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { ChessCard } from './ChessCard';\n\nexport default ChessCard;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,OAAOA,WAAW;AASX,IAAMC,YAAY,CAAC,EAAEC,SAASC,KAAI,MAAkB;AACzD,SACE,sBAAA,cAACC,WAAWC,MAAI;IAACF;KACf,sBAAA,cAACC,WAAWE,SAAO,MACjB,sBAAA,cAACF,WAAWG,OAAK,IAAA,CAAA,CAAA;AAIzB;;;ACfA,IAAA,oBAAeC;",
|
|
6
|
+
"names": ["React", "ChessCard", "subject", "game", "Chessboard", "Root", "Content", "Board", "ChessCard"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
chess_blueprint_default
|
|
4
|
+
} from "./chunk-HSVQ3553.mjs";
|
|
5
|
+
import "./chunk-D72ZBXX6.mjs";
|
|
6
|
+
import "./chunk-LPVPGURE.mjs";
|
|
7
|
+
import "./chunk-OIRJVY2R.mjs";
|
|
8
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
9
|
+
|
|
10
|
+
// src/capabilities/blueprint-definition/blueprint-definition.ts
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import { Capability } from "@dxos/app-framework";
|
|
13
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
14
|
+
var blueprintDefinition = Capability.makeModule(() => Effect.succeed([
|
|
15
|
+
Capability.contributes(AppCapabilities.BlueprintDefinition, chess_blueprint_default)
|
|
16
|
+
]));
|
|
17
|
+
var blueprint_definition_default = blueprintDefinition;
|
|
18
|
+
export {
|
|
19
|
+
blueprint_definition_default as default
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=blueprint-definition-5UIG6VEF.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/blueprint-definition/blueprint-definition.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\n\nimport { ChessBlueprint } from '../../blueprints';\n\nconst blueprintDefinition = Capability.makeModule<\n [],\n Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]\n>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, ChessBlueprint)]));\n\nexport default blueprintDefinition;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAIhC,IAAMC,sBAAsBC,WAAWC,WAGrC,MAAaC,eAAQ;EAACF,WAAWG,YAAYC,gBAAgBC,qBAAqBC,uBAAAA;CAAgB,CAAA;AAEpG,IAAA,+BAAeP;",
|
|
6
|
+
"names": ["Effect", "Capability", "AppCapabilities", "blueprintDefinition", "Capability", "makeModule", "succeed", "contributes", "AppCapabilities", "BlueprintDefinition", "ChessBlueprint"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
chess_blueprint_default
|
|
4
|
+
} from "../chunk-HSVQ3553.mjs";
|
|
5
|
+
import {
|
|
6
|
+
operations_exports
|
|
7
|
+
} from "../chunk-D72ZBXX6.mjs";
|
|
8
|
+
import "../chunk-LPVPGURE.mjs";
|
|
9
|
+
import "../chunk-OIRJVY2R.mjs";
|
|
10
|
+
import "../chunk-HSLMI22Q.mjs";
|
|
11
|
+
export {
|
|
12
|
+
chess_blueprint_default as ChessBlueprint,
|
|
13
|
+
operations_exports as ChessFunctions
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
Create,
|
|
4
|
+
Move,
|
|
5
|
+
Play,
|
|
6
|
+
Print
|
|
7
|
+
} from "./chunk-LPVPGURE.mjs";
|
|
8
|
+
import {
|
|
9
|
+
__export
|
|
10
|
+
} from "./chunk-HSLMI22Q.mjs";
|
|
11
|
+
|
|
12
|
+
// src/operations/index.ts
|
|
13
|
+
var operations_exports = {};
|
|
14
|
+
__export(operations_exports, {
|
|
15
|
+
ChessHandlers: () => ChessHandlers,
|
|
16
|
+
Create: () => Create,
|
|
17
|
+
Move: () => Move,
|
|
18
|
+
Play: () => Play,
|
|
19
|
+
Print: () => Print
|
|
20
|
+
});
|
|
21
|
+
import { OperationHandlerSet } from "@dxos/operation";
|
|
22
|
+
var Handlers = OperationHandlerSet.lazy(() => import("./create-KINGWZOM.mjs"), () => import("./move-JDR3KQ5G.mjs"), () => import("./play-KIWAE5LA.mjs"), () => import("./print-QHFZDMWC.mjs"));
|
|
23
|
+
var ChessHandlers = Handlers;
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
ChessHandlers,
|
|
27
|
+
operations_exports
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-D72ZBXX6.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/operation';\n\nconst Handlers = OperationHandlerSet.lazy(\n () => import('./create'),\n () => import('./move'),\n () => import('./play'),\n () => import('./print'),\n);\n\nexport { Create, Move, Play, Print } from './definitions';\n\nexport const ChessHandlers = Handlers;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAAA;;;;;;;;AAIA,SAASA,2BAA2B;AAEpC,IAAMC,WAAWC,oBAAoBC,KACnC,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,sBAAA,CAAA;AAKR,IAAMC,gBAAgBH;",
|
|
6
|
+
"names": ["OperationHandlerSet", "Handlers", "OperationHandlerSet", "lazy", "ChessHandlers"]
|
|
7
|
+
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __export = (target, all) => {
|
|
4
|
-
for (var name in all)
|
|
5
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
-
};
|
|
7
2
|
|
|
8
3
|
// src/meta.ts
|
|
9
4
|
import { trim } from "@dxos/util";
|
|
10
5
|
var meta = {
|
|
11
|
-
id: "dxos.
|
|
6
|
+
id: "org.dxos.plugin.chess",
|
|
12
7
|
name: "Chess",
|
|
13
8
|
description: trim`
|
|
14
9
|
Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.
|
|
@@ -23,7 +18,6 @@ var meta = {
|
|
|
23
18
|
};
|
|
24
19
|
|
|
25
20
|
export {
|
|
26
|
-
__export,
|
|
27
21
|
meta
|
|
28
22
|
};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-FYPVCMP4.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.chess',\n name: 'Chess',\n description: trim`\n Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.\n Track game history and analyze moves in real-time.\n `,\n icon: 'ph--shield-chevron--regular',\n iconHue: 'amber',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',\n screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],\n};\n"],
|
|
5
|
+
"mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,aAAa;IAAC;;AAChB;",
|
|
6
|
+
"names": ["trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source", "screenshots"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
__export
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=chunk-HSLMI22Q.mjs.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
Create,
|
|
4
|
+
Move,
|
|
5
|
+
Play,
|
|
6
|
+
Print
|
|
7
|
+
} from "./chunk-LPVPGURE.mjs";
|
|
8
|
+
|
|
9
|
+
// src/blueprints/chess-blueprint.ts
|
|
10
|
+
import { Blueprint, Template } from "@dxos/blueprints";
|
|
11
|
+
import { trim } from "@dxos/util";
|
|
12
|
+
var BLUEPRINT_KEY = "org.dxos.blueprint.chess";
|
|
13
|
+
var operations = [
|
|
14
|
+
Create,
|
|
15
|
+
Move,
|
|
16
|
+
Play,
|
|
17
|
+
Print
|
|
18
|
+
];
|
|
19
|
+
var make = () => Blueprint.make({
|
|
20
|
+
key: BLUEPRINT_KEY,
|
|
21
|
+
name: "Chess",
|
|
22
|
+
tools: Blueprint.toolDefinitions({
|
|
23
|
+
operations
|
|
24
|
+
}),
|
|
25
|
+
instructions: Template.make({
|
|
26
|
+
source: trim`
|
|
27
|
+
You are an expert chess player.
|
|
28
|
+
To analyze a game you can access the "pgn" property by loading the context object that represents the current game.
|
|
29
|
+
You could suggest a good next move or offer to play a move.
|
|
30
|
+
Don't actually make a move unless you are asked to.
|
|
31
|
+
`
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
var blueprint = {
|
|
35
|
+
key: BLUEPRINT_KEY,
|
|
36
|
+
make
|
|
37
|
+
};
|
|
38
|
+
var chess_blueprint_default = blueprint;
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
chess_blueprint_default
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=chunk-HSVQ3553.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/chess-blueprint.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type AppCapabilities } from '@dxos/app-toolkit';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { trim } from '@dxos/util';\n\nimport { Create, Move, Play, Print } from '../operations';\n\nconst BLUEPRINT_KEY = 'org.dxos.blueprint.chess';\n\nconst operations = [Create, Move, Play, Print];\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Chess',\n tools: Blueprint.toolDefinitions({ operations }),\n instructions: Template.make({\n source: trim`\n You are an expert chess player.\n To analyze a game you can access the \"pgn\" property by loading the context object that represents the current game.\n You could suggest a good next move or offer to play a move.\n Don't actually make a move unless you are asked to.\n `,\n }),\n });\n\nconst blueprint: AppCapabilities.BlueprintDefinition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAKA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAIrB,IAAMC,gBAAgB;AAEtB,IAAMC,aAAa;EAACC;EAAQC;EAAMC;EAAMC;;AAExC,IAAMC,OAAO,MACXC,UAAUD,KAAK;EACbE,KAAKR;EACLS,MAAM;EACNC,OAAOH,UAAUI,gBAAgB;IAAEV;EAAW,CAAA;EAC9CW,cAAcC,SAASP,KAAK;IAC1BQ,QAAQC;;;;;;EAMV,CAAA;AACF,CAAA;AAEF,IAAMC,YAAiD;EACrDR,KAAKR;EACLM;AACF;AAEA,IAAA,0BAAeU;",
|
|
6
|
+
"names": ["Blueprint", "Template", "trim", "BLUEPRINT_KEY", "operations", "Create", "Move", "Play", "Print", "make", "Blueprint", "key", "name", "tools", "toolDefinitions", "instructions", "Template", "source", "trim", "blueprint"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
Chess_exports
|
|
4
|
+
} from "./chunk-OIRJVY2R.mjs";
|
|
5
|
+
|
|
6
|
+
// src/operations/definitions.ts
|
|
7
|
+
import { Operation } from "@dxos/operation";
|
|
8
|
+
import * as Schema from "effect/Schema";
|
|
9
|
+
import { Database, Ref } from "@dxos/echo";
|
|
10
|
+
var Create = Operation.make({
|
|
11
|
+
meta: {
|
|
12
|
+
key: "org.dxos.function.chess.create",
|
|
13
|
+
name: "Create Chess",
|
|
14
|
+
description: "Creates a new chess game."
|
|
15
|
+
},
|
|
16
|
+
input: Schema.Struct({
|
|
17
|
+
name: Schema.optional(Schema.String.annotations({
|
|
18
|
+
description: "Name of the game."
|
|
19
|
+
})),
|
|
20
|
+
pgn: Schema.optional(Schema.String.annotations({
|
|
21
|
+
description: "Portable Game Notation."
|
|
22
|
+
})),
|
|
23
|
+
fen: Schema.optional(Schema.String.annotations({
|
|
24
|
+
description: "Forsyth-Edwards Notation."
|
|
25
|
+
}))
|
|
26
|
+
}),
|
|
27
|
+
output: Chess_exports.Game,
|
|
28
|
+
services: [
|
|
29
|
+
Database.Service
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
var Move = Operation.make({
|
|
33
|
+
meta: {
|
|
34
|
+
key: "org.dxos.function.chess.move",
|
|
35
|
+
name: "Move",
|
|
36
|
+
description: "Makes a move in the given chess game."
|
|
37
|
+
},
|
|
38
|
+
input: Schema.Struct({
|
|
39
|
+
game: Ref.Ref(Chess_exports.Game).annotations({
|
|
40
|
+
description: "The ID of the chess object."
|
|
41
|
+
}),
|
|
42
|
+
move: Schema.String.annotations({
|
|
43
|
+
description: "The move to make in the chess game.",
|
|
44
|
+
examples: [
|
|
45
|
+
"e4",
|
|
46
|
+
"Bf3"
|
|
47
|
+
]
|
|
48
|
+
})
|
|
49
|
+
}),
|
|
50
|
+
output: Schema.Struct({
|
|
51
|
+
pgn: Schema.String.annotations({
|
|
52
|
+
description: "The PGN of the game after the move was played."
|
|
53
|
+
})
|
|
54
|
+
}),
|
|
55
|
+
services: [
|
|
56
|
+
Database.Service
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
var Play = Operation.make({
|
|
60
|
+
meta: {
|
|
61
|
+
key: "org.dxos.function.chess.play",
|
|
62
|
+
name: "Play",
|
|
63
|
+
description: "Uses the chess engine to play the next move."
|
|
64
|
+
},
|
|
65
|
+
input: Schema.Struct({
|
|
66
|
+
game: Ref.Ref(Chess_exports.Game).annotations({
|
|
67
|
+
description: "The ID of the chess object."
|
|
68
|
+
}),
|
|
69
|
+
side: Schema.optional(Schema.Literal("white", "black", "any")).annotations({
|
|
70
|
+
description: "The side to play.",
|
|
71
|
+
defaultValue: "any"
|
|
72
|
+
})
|
|
73
|
+
}),
|
|
74
|
+
output: Schema.Struct({
|
|
75
|
+
pgn: Schema.String.annotations({
|
|
76
|
+
description: "The PGN of the game after the move was played."
|
|
77
|
+
}),
|
|
78
|
+
move: Schema.optional(Schema.String).annotations({
|
|
79
|
+
description: "The move that was played."
|
|
80
|
+
})
|
|
81
|
+
}),
|
|
82
|
+
services: [
|
|
83
|
+
Database.Service
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
var Print = Operation.make({
|
|
87
|
+
meta: {
|
|
88
|
+
key: "org.dxos.function.chess.print",
|
|
89
|
+
name: "Print game",
|
|
90
|
+
description: "Prints the chess game to ASCII."
|
|
91
|
+
},
|
|
92
|
+
input: Schema.Struct({
|
|
93
|
+
pgn: Schema.optional(Schema.String.annotations({
|
|
94
|
+
description: "Portable Game Notation."
|
|
95
|
+
})),
|
|
96
|
+
fen: Schema.optional(Schema.String.annotations({
|
|
97
|
+
description: "Forsyth-Edwards Notation."
|
|
98
|
+
}))
|
|
99
|
+
}),
|
|
100
|
+
output: Schema.Struct({
|
|
101
|
+
ascii: Schema.String
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export {
|
|
106
|
+
Create,
|
|
107
|
+
Move,
|
|
108
|
+
Play,
|
|
109
|
+
Print
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=chunk-LPVPGURE.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Operation } from '@dxos/operation';\nimport * as Schema from 'effect/Schema';\n\nimport { Database, Ref } from '@dxos/echo';\n\nimport { Chess } from '../types';\n\nexport const Create = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.create',\n name: 'Create Chess',\n description: 'Creates a new chess game.',\n },\n input: Schema.Struct({\n name: Schema.optional(\n Schema.String.annotations({\n description: 'Name of the game.',\n }),\n ),\n pgn: Schema.optional(\n Schema.String.annotations({\n description: 'Portable Game Notation.',\n }),\n ),\n fen: Schema.optional(\n Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }),\n ),\n }),\n output: Chess.Game,\n services: [Database.Service],\n});\n\nexport const Move = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.move',\n name: 'Move',\n description: 'Makes a move in the given chess game.',\n },\n input: Schema.Struct({\n game: Ref.Ref(Chess.Game).annotations({\n description: 'The ID of the chess object.',\n }),\n move: Schema.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n output: Schema.Struct({\n pgn: Schema.String.annotations({\n description: 'The PGN of the game after the move was played.',\n }),\n }),\n services: [Database.Service],\n});\n\nexport const Play = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.play',\n name: 'Play',\n description: 'Uses the chess engine to play the next move.',\n },\n input: Schema.Struct({\n game: Ref.Ref(Chess.Game).annotations({\n description: 'The ID of the chess object.',\n }),\n side: Schema.optional(Schema.Literal('white', 'black', 'any')).annotations({\n description: 'The side to play.',\n defaultValue: 'any',\n }),\n }),\n output: Schema.Struct({\n pgn: Schema.String.annotations({\n description: 'The PGN of the game after the move was played.',\n }),\n move: Schema.optional(Schema.String).annotations({\n description: 'The move that was played.',\n }),\n }),\n services: [Database.Service],\n});\n\nexport const Print = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.print',\n name: 'Print game',\n description: 'Prints the chess game to ASCII.',\n },\n input: Schema.Struct({\n pgn: Schema.optional(\n Schema.String.annotations({\n description: 'Portable Game Notation.',\n }),\n ),\n fen: Schema.optional(\n Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }),\n ),\n }),\n output: Schema.Struct({\n ascii: Schema.String,\n }),\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,iBAAiB;AAC1B,YAAYC,YAAY;AAExB,SAASC,UAAUC,WAAW;AAIvB,IAAMC,SAASC,UAAUC,KAAK;EACnCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBH,MAAaI,gBACJC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFM,KAAYH,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFO,KAAYJ,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA;EACAQ,QAAQC,cAAMC;EACdC,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMC,OAAOnB,UAAUC,KAAK;EACjCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBa,MAAMC,IAAIA,IAAIP,cAAMC,IAAI,EAAEL,YAAY;MACpCL,aAAa;IACf,CAAA;IACAiB,MAAab,cAAOC,YAAY;MAC9BL,aAAa;MACbkB,UAAU;QAAC;QAAM;;IACnB,CAAA;EACF,CAAA;EACAV,QAAeN,cAAO;IACpBI,KAAYF,cAAOC,YAAY;MAC7BL,aAAa;IACf,CAAA;EACF,CAAA;EACAW,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMM,OAAOxB,UAAUC,KAAK;EACjCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBa,MAAMC,IAAIA,IAAIP,cAAMC,IAAI,EAAEL,YAAY;MACpCL,aAAa;IACf,CAAA;IACAoB,MAAajB,gBAAgBkB,eAAQ,SAAS,SAAS,KAAA,CAAA,EAAQhB,YAAY;MACzEL,aAAa;MACbsB,cAAc;IAChB,CAAA;EACF,CAAA;EACAd,QAAeN,cAAO;IACpBI,KAAYF,cAAOC,YAAY;MAC7BL,aAAa;IACf,CAAA;IACAiB,MAAad,gBAAgBC,aAAM,EAAEC,YAAY;MAC/CL,aAAa;IACf,CAAA;EACF,CAAA;EACAW,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMU,QAAQ5B,UAAUC,KAAK;EAClCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBI,KAAYH,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFO,KAAYJ,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA;EACAQ,QAAeN,cAAO;IACpBsB,OAAcpB;EAChB,CAAA;AACF,CAAA;",
|
|
6
|
+
"names": ["Operation", "Schema", "Database", "Ref", "Create", "Operation", "make", "meta", "key", "name", "description", "input", "Struct", "optional", "String", "annotations", "pgn", "fen", "output", "Chess", "Game", "services", "Database", "Service", "Move", "game", "Ref", "move", "examples", "Play", "side", "Literal", "defaultValue", "Print", "ascii"]
|
|
7
|
+
}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
__export
|
|
4
|
-
|
|
5
|
-
} from "./chunk-KNOOJFIR.mjs";
|
|
3
|
+
__export
|
|
4
|
+
} from "./chunk-HSLMI22Q.mjs";
|
|
6
5
|
|
|
7
6
|
// src/types/Chess.ts
|
|
8
7
|
var Chess_exports = {};
|
|
9
8
|
__export(Chess_exports, {
|
|
10
9
|
Game: () => Game,
|
|
11
|
-
|
|
10
|
+
make: () => make
|
|
12
11
|
});
|
|
13
12
|
import { Chess as ChessJS } from "chess.js";
|
|
14
13
|
import * as Schema from "effect/Schema";
|
|
15
|
-
import { Obj, Type } from "@dxos/echo";
|
|
16
|
-
import {
|
|
14
|
+
import { Annotation, Obj, Type } from "@dxos/echo";
|
|
15
|
+
import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/internal";
|
|
17
16
|
import { log } from "@dxos/log";
|
|
18
|
-
import { ItemAnnotation } from "@dxos/schema";
|
|
19
17
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-chess/src/types/Chess.ts";
|
|
20
18
|
var Game = Schema.Struct({
|
|
21
19
|
name: Schema.optional(Schema.String),
|
|
@@ -26,20 +24,23 @@ var Game = Schema.Struct({
|
|
|
26
24
|
black: Schema.optional(Schema.String.annotations({
|
|
27
25
|
description: "DID of black player"
|
|
28
26
|
}))
|
|
29
|
-
}).pipe(
|
|
27
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
30
28
|
pgn: Schema.String.annotations({
|
|
31
29
|
description: "Portable Game Notation."
|
|
32
|
-
}).pipe(
|
|
30
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
33
31
|
fen: Schema.String.annotations({
|
|
34
32
|
description: "Forsyth-Edwards Notation."
|
|
35
|
-
}).pipe(
|
|
36
|
-
}).pipe(Type.
|
|
37
|
-
typename: "dxos.
|
|
38
|
-
version: "0.
|
|
33
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional)
|
|
34
|
+
}).pipe(Type.object({
|
|
35
|
+
typename: "org.dxos.type.chess",
|
|
36
|
+
version: "0.1.0"
|
|
39
37
|
}), LabelAnnotation.set([
|
|
40
38
|
"name"
|
|
41
|
-
]),
|
|
42
|
-
|
|
39
|
+
]), Annotation.IconAnnotation.set({
|
|
40
|
+
icon: "ph--shield-chevron--regular",
|
|
41
|
+
hue: "amber"
|
|
42
|
+
}));
|
|
43
|
+
var make = ({ name, pgn, fen } = {}) => {
|
|
43
44
|
const chess = new ChessJS();
|
|
44
45
|
if (pgn) {
|
|
45
46
|
try {
|
|
@@ -47,7 +48,7 @@ var makeGame = ({ name, pgn, fen } = {}) => {
|
|
|
47
48
|
} catch {
|
|
48
49
|
log.warn(pgn, void 0, {
|
|
49
50
|
F: __dxlog_file,
|
|
50
|
-
L:
|
|
51
|
+
L: 52,
|
|
51
52
|
S: void 0,
|
|
52
53
|
C: (f, a) => f(...a)
|
|
53
54
|
});
|
|
@@ -55,31 +56,13 @@ var makeGame = ({ name, pgn, fen } = {}) => {
|
|
|
55
56
|
}
|
|
56
57
|
return Obj.make(Game, {
|
|
57
58
|
name,
|
|
58
|
-
players: {},
|
|
59
59
|
pgn,
|
|
60
|
-
fen
|
|
60
|
+
fen,
|
|
61
|
+
players: {}
|
|
61
62
|
});
|
|
62
63
|
};
|
|
63
64
|
|
|
64
|
-
// src/types/ChessAction.ts
|
|
65
|
-
var ChessAction_exports = {};
|
|
66
|
-
__export(ChessAction_exports, {
|
|
67
|
-
Create: () => Create
|
|
68
|
-
});
|
|
69
|
-
import * as Schema2 from "effect/Schema";
|
|
70
|
-
var Create = class extends Schema2.TaggedClass()(`${meta.id}/action/create`, {
|
|
71
|
-
input: Schema2.Struct({
|
|
72
|
-
name: Schema2.optional(Schema2.String),
|
|
73
|
-
pgn: Schema2.optional(Schema2.String)
|
|
74
|
-
}),
|
|
75
|
-
output: Schema2.Struct({
|
|
76
|
-
object: Game
|
|
77
|
-
})
|
|
78
|
-
}) {
|
|
79
|
-
};
|
|
80
|
-
|
|
81
65
|
export {
|
|
82
|
-
Chess_exports
|
|
83
|
-
ChessAction_exports
|
|
66
|
+
Chess_exports
|
|
84
67
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
68
|
+
//# sourceMappingURL=chunk-OIRJVY2R.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/Chess.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Type } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { log } from '@dxos/log';\n\nexport const Game = Schema.Struct({\n name: Schema.optional(Schema.String),\n players: Schema.Struct({\n white: Schema.optional(\n Schema.String.annotations({\n description: 'DID of white player',\n }),\n ),\n black: Schema.optional(\n Schema.String.annotations({\n description: 'DID of black player',\n }),\n ),\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n pgn: Schema.String.annotations({\n description: 'Portable Game Notation.',\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n fen: Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.chess',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--shield-chevron--regular',\n hue: 'amber',\n }),\n);\n\nexport interface Game extends Schema.Schema.Type<typeof Game> {}\n\nexport const make = ({ name, pgn, fen }: { name?: string; pgn?: string; fen?: string } = {}) => {\n const chess = new ChessJS();\n if (pgn) {\n try {\n chess.loadPgn(pgn);\n } catch {\n log.warn(pgn);\n }\n }\n\n return Obj.make(Game, {\n name,\n pgn,\n fen,\n players: {},\n });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAAA;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,YAAYC,KAAKC,YAAY;AACtC,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,WAAW;;AAEb,IAAMC,OAAcC,cAAO;EAChCC,MAAaC,gBAAgBC,aAAM;EACnCC,SAAgBJ,cAAO;IACrBK,OAAcH,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;IAEFC,OAAcN,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA,EAAGE,KAAKb,oBAAoBc,IAAI,KAAA,GAAeR,eAAQ;EACvDS,KAAYR,cAAOG,YAAY;IAC7BC,aAAa;EACf,CAAA,EAAGE,KAAKb,oBAAoBc,IAAI,KAAA,GAAeR,eAAQ;EACvDU,KAAYT,cAAOG,YAAY;IAC7BC,aAAa;EACf,CAAA,EAAGE,KAAKb,oBAAoBc,IAAI,KAAA,GAAeR,eAAQ;AACzD,CAAA,EAAGO,KACDd,KAAKkB,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAlB,gBAAgBa,IAAI;EAAC;CAAO,GAC5BjB,WAAWuB,eAAeN,IAAI;EAC5BO,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAKK,IAAMC,OAAO,CAAC,EAAElB,MAAMU,KAAKC,IAAG,IAAoD,CAAC,MAAC;AACzF,QAAMQ,QAAQ,IAAI7B,QAAAA;AAClB,MAAIoB,KAAK;AACP,QAAI;AACFS,YAAMC,QAAQV,GAAAA;IAChB,QAAQ;AACNb,UAAIwB,KAAKX,KAAAA,QAAAA;;;;;;IACX;EACF;AAEA,SAAOjB,IAAIyB,KAAKpB,MAAM;IACpBE;IACAU;IACAC;IACAR,SAAS,CAAC;EACZ,CAAA;AACF;",
|
|
6
|
+
"names": ["Chess", "ChessJS", "Schema", "Annotation", "Obj", "Type", "FormInputAnnotation", "LabelAnnotation", "log", "Game", "Struct", "name", "optional", "String", "players", "white", "annotations", "description", "black", "pipe", "set", "pgn", "fen", "object", "typename", "version", "IconAnnotation", "icon", "hue", "make", "chess", "loadPgn", "warn"]
|
|
7
|
+
}
|