@dxos/plugin-chess 0.8.4-main.1068cf700f → 0.8.4-main.1c7ec43d41
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/blueprints/index.mjs +9 -6
- package/dist/lib/browser/chunk-5FHUZILG.mjs +63 -0
- package/dist/lib/browser/chunk-5FHUZILG.mjs.map +7 -0
- package/dist/lib/browser/chunk-BCTL5GYK.mjs +88 -0
- package/dist/lib/browser/chunk-BCTL5GYK.mjs.map +7 -0
- package/dist/lib/browser/chunk-ORLWKOYE.mjs +26 -0
- package/dist/lib/browser/chunk-ORLWKOYE.mjs.map +7 -0
- package/dist/lib/browser/chunk-YER5TC5N.mjs +35 -0
- package/dist/lib/browser/chunk-YER5TC5N.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +27 -85
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/move-BH3WZUJH.mjs +39 -0
- package/dist/lib/browser/move-BH3WZUJH.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +17 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/play-IM4BDFSY.mjs +48 -0
- package/dist/lib/browser/play-IM4BDFSY.mjs.map +7 -0
- package/dist/lib/browser/print-M3ZO2XZT.mjs +30 -0
- package/dist/lib/browser/print-M3ZO2XZT.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +34 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/blueprints/index.mjs +9 -6
- package/dist/lib/node-esm/chunk-A3P4HC7O.mjs +89 -0
- package/dist/lib/node-esm/chunk-A3P4HC7O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-B42KRPBJ.mjs +37 -0
- package/dist/lib/node-esm/chunk-B42KRPBJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WSHXDK3W.mjs +27 -0
- package/dist/lib/node-esm/chunk-WSHXDK3W.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YRW4LYGF.mjs +64 -0
- package/dist/lib/node-esm/chunk-YRW4LYGF.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +27 -85
- 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-53HLCSAL.mjs +40 -0
- package/dist/lib/node-esm/move-53HLCSAL.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +18 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/play-YXXPG5SO.mjs +49 -0
- package/dist/lib/node-esm/play-YXXPG5SO.mjs.map +7 -0
- package/dist/lib/node-esm/print-L2LUM3IW.mjs +31 -0
- package/dist/lib/node-esm/print-L2LUM3IW.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +35 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/ChessPlugin.d.ts +1 -0
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- package/dist/types/src/ChessPlugin.node.d.ts +8 -0
- package/dist/types/src/ChessPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ChessPlugin.test.d.ts +2 -0
- package/dist/types/src/ChessPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/chess-blueprint.d.ts +3 -20
- package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -2
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/game-variant.d.ts +6 -0
- package/dist/types/src/capabilities/game-variant.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +10 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/components/{Chessboard.d.ts → Chessboard/Chessboard.d.ts} +10 -11
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +57 -0
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Info.d.ts → Chessboard/Info.d.ts} +5 -6
- 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 +5 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +56 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts +5 -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} +1 -1
- package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/index.d.ts +2 -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 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +24 -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 +32 -23
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts +10 -19
- package/dist/types/src/types/Chess.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +66 -48
- package/src/ChessPlugin.node.ts +23 -0
- package/src/ChessPlugin.test.ts +49 -0
- package/src/ChessPlugin.tsx +14 -23
- package/src/blueprints/chess-blueprint.ts +14 -9
- package/src/blueprints/index.ts +2 -2
- package/src/capabilities/blueprint-definition.ts +19 -0
- package/src/capabilities/game-variant.ts +42 -0
- package/src/capabilities/index.ts +10 -2
- package/src/capabilities/node.ts +18 -0
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
- package/src/components/{Chessboard.tsx → Chessboard/Chessboard.tsx} +21 -31
- package/src/components/{Info.tsx → Chessboard/Info.tsx} +24 -77
- 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/{components/Chessboard.stories.tsx → containers/ChessArticle/ChessArticle.stories.tsx} +16 -10
- package/src/containers/ChessArticle/ChessArticle.tsx +108 -0
- package/src/containers/ChessArticle/index.ts +5 -0
- package/src/containers/ChessCard/ChessCard.stories.tsx +47 -0
- package/src/containers/ChessCard/ChessCard.tsx +27 -0
- package/src/containers/ChessCard/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/index.ts +5 -3
- package/src/meta.ts +1 -1
- package/src/operations/definitions.ts +83 -0
- package/src/operations/index.ts +15 -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 +18 -21
- package/src/types/Chess.ts +25 -24
- package/dist/lib/browser/ChessboardContainer-GNSIZKY7.mjs +0 -80
- package/dist/lib/browser/ChessboardContainer-GNSIZKY7.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-YUKJZPOL.mjs +0 -19
- package/dist/lib/browser/blueprint-definition-YUKJZPOL.mjs.map +0 -7
- package/dist/lib/browser/chunk-66H3V2YV.mjs +0 -64
- package/dist/lib/browser/chunk-66H3V2YV.mjs.map +0 -7
- package/dist/lib/browser/chunk-H3NUMCQ6.mjs +0 -21
- package/dist/lib/browser/chunk-H3NUMCQ6.mjs.map +0 -7
- package/dist/lib/browser/chunk-MABHE5SS.mjs +0 -277
- package/dist/lib/browser/chunk-MABHE5SS.mjs.map +0 -7
- package/dist/lib/browser/chunk-PBRN5Q4R.mjs +0 -227
- package/dist/lib/browser/chunk-PBRN5Q4R.mjs.map +0 -7
- package/dist/lib/browser/chunk-QGVMZ4PK.mjs +0 -8
- package/dist/lib/browser/chunk-QGVMZ4PK.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -29
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/react-surface-C52R6BRL.mjs +0 -38
- package/dist/lib/browser/react-surface-C52R6BRL.mjs.map +0 -7
- package/dist/lib/node-esm/ChessboardContainer-5OVYZMIW.mjs +0 -81
- package/dist/lib/node-esm/ChessboardContainer-5OVYZMIW.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-4HZ2HWWC.mjs +0 -20
- package/dist/lib/node-esm/blueprint-definition-4HZ2HWWC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3MAU6WHB.mjs +0 -228
- package/dist/lib/node-esm/chunk-3MAU6WHB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F5OMIM4F.mjs +0 -23
- package/dist/lib/node-esm/chunk-F5OMIM4F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IFK6UAKF.mjs +0 -10
- package/dist/lib/node-esm/chunk-IFK6UAKF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OUNGNJFP.mjs +0 -65
- package/dist/lib/node-esm/chunk-OUNGNJFP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V6MKXXPO.mjs +0 -278
- package/dist/lib/node-esm/chunk-V6MKXXPO.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -30
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-NW33JZ6J.mjs +0 -39
- package/dist/lib/node-esm/react-surface-NW33JZ6J.mjs.map +0 -7
- package/dist/types/src/blueprints/functions/create.d.ts +0 -15
- package/dist/types/src/blueprints/functions/create.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/index.d.ts +0 -5
- package/dist/types/src/blueprints/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/move.d.ts +0 -16
- package/dist/types/src/blueprints/functions/move.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/play.d.ts +0 -17
- package/dist/types/src/blueprints/functions/play.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/print.d.ts +0 -8
- package/dist/types/src/blueprints/functions/print.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +0 -12
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -10
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts +0 -3
- package/dist/types/src/cli/plugin.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 +0 -46
- package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardArticle.d.ts +0 -6
- package/dist/types/src/components/ChessboardArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardContainer.d.ts +0 -7
- package/dist/types/src/components/ChessboardContainer.d.ts.map +0 -1
- package/dist/types/src/components/Info.d.ts.map +0 -1
- package/src/blueprints/functions/create.ts +0 -38
- package/src/blueprints/functions/index.ts +0 -8
- package/src/blueprints/functions/move.ts +0 -48
- package/src/blueprints/functions/play.ts +0 -58
- package/src/blueprints/functions/print.ts +0 -42
- package/src/capabilities/artifact-definition/artifact-definition.ts +0 -135
- package/src/capabilities/artifact-definition/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -24
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -28
- package/src/cli/index.ts +0 -5
- package/src/cli/plugin.ts +0 -27
- package/src/components/Card.stories.tsx +0 -47
- package/src/components/ChessboardArticle.tsx +0 -70
- package/src/components/ChessboardContainer.tsx +0 -40
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-chess",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.1c7ec43d41",
|
|
4
4
|
"description": "Chess for new plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,25 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#blueprints": "./src/blueprints/index.ts",
|
|
17
|
+
"#capabilities": {
|
|
18
|
+
"browser": "./src/capabilities/index.ts",
|
|
19
|
+
"node": "./src/capabilities/node.ts",
|
|
20
|
+
"default": "./src/capabilities/index.ts"
|
|
21
|
+
},
|
|
22
|
+
"#components": "./src/components/index.ts",
|
|
23
|
+
"#containers": "./src/containers/index.ts",
|
|
24
|
+
"#meta": "./src/meta.ts",
|
|
25
|
+
"#operations": "./src/operations/index.ts",
|
|
26
|
+
"#translations": "./src/translations.ts",
|
|
27
|
+
"#plugin": {
|
|
28
|
+
"browser": "./src/ChessPlugin.tsx",
|
|
29
|
+
"node": "./src/ChessPlugin.node.ts",
|
|
30
|
+
"default": "./src/ChessPlugin.tsx"
|
|
31
|
+
},
|
|
32
|
+
"#types": "./src/types/index.ts"
|
|
33
|
+
},
|
|
15
34
|
"exports": {
|
|
16
35
|
".": {
|
|
17
36
|
"source": "./src/index.ts",
|
|
@@ -25,11 +44,17 @@
|
|
|
25
44
|
"browser": "./dist/lib/browser/blueprints/index.mjs",
|
|
26
45
|
"node": "./dist/lib/node-esm/blueprints/index.mjs"
|
|
27
46
|
},
|
|
28
|
-
"./
|
|
29
|
-
"source": "./src/
|
|
30
|
-
"types": "./dist/types/src/
|
|
31
|
-
"browser": "./dist/lib/browser/
|
|
32
|
-
"node": "./dist/lib/node-esm/
|
|
47
|
+
"./operations": {
|
|
48
|
+
"source": "./src/operations/index.ts",
|
|
49
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
50
|
+
"browser": "./dist/lib/browser/operations/index.mjs",
|
|
51
|
+
"node": "./dist/lib/node-esm/operations/index.mjs"
|
|
52
|
+
},
|
|
53
|
+
"./translations": {
|
|
54
|
+
"source": "./src/translations.ts",
|
|
55
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
56
|
+
"browser": "./dist/lib/browser/translations.mjs",
|
|
57
|
+
"node": "./dist/lib/node-esm/translations.mjs"
|
|
33
58
|
},
|
|
34
59
|
"./types": {
|
|
35
60
|
"source": "./src/types/index.ts",
|
|
@@ -39,65 +64,58 @@
|
|
|
39
64
|
}
|
|
40
65
|
},
|
|
41
66
|
"types": "dist/types/src/index.d.ts",
|
|
42
|
-
"typesVersions": {
|
|
43
|
-
"*": {
|
|
44
|
-
"types": [
|
|
45
|
-
"dist/types/src/types/index.d.ts"
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
67
|
"files": [
|
|
50
68
|
"dist",
|
|
51
69
|
"src"
|
|
52
70
|
],
|
|
53
71
|
"dependencies": {
|
|
54
|
-
"@automerge/automerge": "3.2.
|
|
72
|
+
"@automerge/automerge": "3.2.6",
|
|
55
73
|
"@effect-atom/atom-react": "^0.5.0",
|
|
56
74
|
"chess.js": "^1.0.0",
|
|
57
|
-
"effect": "3.
|
|
58
|
-
"@dxos/ai": "0.8.4-main.
|
|
59
|
-
"@dxos/app-toolkit": "0.8.4-main.
|
|
60
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
61
|
-
"@dxos/assistant": "0.8.4-main.
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/echo-
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/plugin-
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/plugin-
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/react-ui-
|
|
78
|
-
"@dxos/react-ui-
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
81
|
-
"@dxos/util": "0.8.4-main.
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/types": "0.8.4-main.1068cf700f"
|
|
75
|
+
"effect": "3.20.0",
|
|
76
|
+
"@dxos/ai": "0.8.4-main.1c7ec43d41",
|
|
77
|
+
"@dxos/app-toolkit": "0.8.4-main.1c7ec43d41",
|
|
78
|
+
"@dxos/app-framework": "0.8.4-main.1c7ec43d41",
|
|
79
|
+
"@dxos/assistant": "0.8.4-main.1c7ec43d41",
|
|
80
|
+
"@dxos/async": "0.8.4-main.1c7ec43d41",
|
|
81
|
+
"@dxos/compute": "0.8.4-main.1c7ec43d41",
|
|
82
|
+
"@dxos/echo": "0.8.4-main.1c7ec43d41",
|
|
83
|
+
"@dxos/display-name": "0.8.4-main.1c7ec43d41",
|
|
84
|
+
"@dxos/echo-db": "0.8.4-main.1c7ec43d41",
|
|
85
|
+
"@dxos/echo-react": "0.8.4-main.1c7ec43d41",
|
|
86
|
+
"@dxos/log": "0.8.4-main.1c7ec43d41",
|
|
87
|
+
"@dxos/plugin-client": "0.8.4-main.1c7ec43d41",
|
|
88
|
+
"@dxos/invariant": "0.8.4-main.1c7ec43d41",
|
|
89
|
+
"@dxos/plugin-graph": "0.8.4-main.1c7ec43d41",
|
|
90
|
+
"@dxos/plugin-space": "0.8.4-main.1c7ec43d41",
|
|
91
|
+
"@dxos/plugin-game": "0.8.4-main.1c7ec43d41",
|
|
92
|
+
"@dxos/react-client": "0.8.4-main.1c7ec43d41",
|
|
93
|
+
"@dxos/plugin-markdown": "0.8.4-main.1c7ec43d41",
|
|
94
|
+
"@dxos/react-ui-gameboard": "0.8.4-main.1c7ec43d41",
|
|
95
|
+
"@dxos/react-ui-sfx": "0.8.4-main.1c7ec43d41",
|
|
96
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.1c7ec43d41",
|
|
97
|
+
"@dxos/schema": "0.8.4-main.1c7ec43d41",
|
|
98
|
+
"@dxos/react-ui-stack": "0.8.4-main.1c7ec43d41",
|
|
99
|
+
"@dxos/util": "0.8.4-main.1c7ec43d41",
|
|
100
|
+
"@dxos/types": "0.8.4-main.1c7ec43d41"
|
|
84
101
|
},
|
|
85
102
|
"devDependencies": {
|
|
86
103
|
"@types/react": "~19.2.7",
|
|
87
104
|
"@types/react-dom": "~19.2.3",
|
|
88
105
|
"react": "~19.2.3",
|
|
89
106
|
"react-dom": "~19.2.3",
|
|
90
|
-
"vite": "
|
|
91
|
-
"@dxos/plugin-
|
|
92
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
93
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
94
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
107
|
+
"vite": "^8.0.10",
|
|
108
|
+
"@dxos/plugin-testing": "0.8.4-main.1c7ec43d41",
|
|
109
|
+
"@dxos/react-ui": "0.8.4-main.1c7ec43d41",
|
|
110
|
+
"@dxos/storybook-utils": "0.8.4-main.1c7ec43d41",
|
|
111
|
+
"@dxos/ui-theme": "0.8.4-main.1c7ec43d41",
|
|
112
|
+
"@dxos/plugin-theme": "0.8.4-main.1c7ec43d41"
|
|
95
113
|
},
|
|
96
114
|
"peerDependencies": {
|
|
97
115
|
"react": "~19.2.3",
|
|
98
116
|
"react-dom": "~19.2.3",
|
|
99
|
-
"@dxos/
|
|
100
|
-
"@dxos/ui
|
|
117
|
+
"@dxos/ui-theme": "0.8.4-main.1c7ec43d41",
|
|
118
|
+
"@dxos/react-ui": "0.8.4-main.1c7ec43d41"
|
|
101
119
|
},
|
|
102
120
|
"publishConfig": {
|
|
103
121
|
"access": "public"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
|
|
8
|
+
import { BlueprintDefinition, OperationHandler } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { Chess } from '#types';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Headless variant of ChessPlugin (no React surfaces / GameVariant).
|
|
14
|
+
* Used in node contexts (CLI, agents) where rendering is unavailable.
|
|
15
|
+
*/
|
|
16
|
+
export const ChessPlugin = Plugin.define(meta).pipe(
|
|
17
|
+
AppPlugin.addSchemaModule({ schema: [Chess.State] }),
|
|
18
|
+
AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),
|
|
19
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
20
|
+
Plugin.make,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export default ChessPlugin;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { ActivationEvents } from '@dxos/app-framework';
|
|
8
|
+
import { AppActivationEvents } from '@dxos/app-toolkit/events';
|
|
9
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
10
|
+
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
11
|
+
|
|
12
|
+
import { ChessPlugin } from '#plugin';
|
|
13
|
+
|
|
14
|
+
import { meta } from './meta';
|
|
15
|
+
import { Print } from './operations';
|
|
16
|
+
|
|
17
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
18
|
+
|
|
19
|
+
describe('ChessPlugin', () => {
|
|
20
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
21
|
+
await using harness = await createComposerTestApp({
|
|
22
|
+
plugins: [ClientPlugin({}), ChessPlugin()],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Modules expected to be active after a normal startup (headless/node variant).
|
|
26
|
+
expect(harness.manager.getActive()).toEqual(expect.arrayContaining([moduleId('schema')]));
|
|
27
|
+
|
|
28
|
+
// SetupArtifactDefinition is fired by AssistantPlugin, which can't be included here due to a workspace cycle.
|
|
29
|
+
await harness.fire(AppActivationEvents.SetupArtifactDefinition);
|
|
30
|
+
expect(harness.manager.getActive()).toContain(moduleId('BlueprintDefinition'));
|
|
31
|
+
|
|
32
|
+
// Operation handlers are not loaded on startup — SetupOperationHandler fires lazily when an operation is invoked.
|
|
33
|
+
await harness.fire(ActivationEvents.SetupOperationHandler);
|
|
34
|
+
expect(harness.manager.getActive()).toContain(moduleId('OperationHandler'));
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('invokes the Print operation via the invoker capability', async ({ expect }) => {
|
|
38
|
+
await using harness = await createComposerTestApp({ plugins: [ChessPlugin()] });
|
|
39
|
+
const result = await harness.invoke(Print, {});
|
|
40
|
+
// Empty input returns empty ASCII (handler swallows errors for malformed FEN).
|
|
41
|
+
expect(typeof result.ascii).toBe('string');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('Print renders a PGN to ASCII board', async ({ expect }) => {
|
|
45
|
+
await using harness = await createComposerTestApp({ plugins: [ChessPlugin()] });
|
|
46
|
+
const { ascii } = await harness.invoke(Print, { pgn: '1. e4 e5' });
|
|
47
|
+
expect(ascii).toContain('a b c d e f g h');
|
|
48
|
+
});
|
|
49
|
+
});
|
package/src/ChessPlugin.tsx
CHANGED
|
@@ -2,34 +2,25 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
5
|
import { Plugin } from '@dxos/app-framework';
|
|
8
|
-
import { AppPlugin } from '@dxos/app-toolkit';
|
|
9
|
-
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
6
|
+
import { AppPlugin, AppActivationEvents } from '@dxos/app-toolkit';
|
|
10
7
|
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { Chess } from './types';
|
|
8
|
+
import { BlueprintDefinition, GameVariant, OperationHandler } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { translations } from '#translations';
|
|
11
|
+
import { Chess } from '#types';
|
|
16
12
|
|
|
17
13
|
export const ChessPlugin = Plugin.define(meta).pipe(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
metadata: {
|
|
23
|
-
icon: 'ph--shield-chevron--regular',
|
|
24
|
-
iconHue: 'amber',
|
|
25
|
-
blueprints: [ChessBlueprint.Key],
|
|
26
|
-
createObject: ((props) => Effect.sync(() => Chess.make(props))) satisfies CreateObject,
|
|
27
|
-
addToCollectionOnCreate: true,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
14
|
+
Plugin.addModule({
|
|
15
|
+
id: 'game-variant',
|
|
16
|
+
activatesOn: AppActivationEvents.SetupSchema,
|
|
17
|
+
activate: GameVariant,
|
|
30
18
|
}),
|
|
31
|
-
AppPlugin.
|
|
32
|
-
AppPlugin.
|
|
19
|
+
AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),
|
|
20
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
21
|
+
AppPlugin.addSchemaModule({ schema: [Chess.State] }),
|
|
33
22
|
AppPlugin.addTranslationsModule({ translations }),
|
|
34
23
|
Plugin.make,
|
|
35
24
|
);
|
|
25
|
+
|
|
26
|
+
export default ChessPlugin;
|
|
@@ -2,21 +2,19 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Blueprint, Template } from '@dxos/
|
|
6
|
-
import { type FunctionDefinition } from '@dxos/functions';
|
|
5
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
7
6
|
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
|
-
import {
|
|
8
|
+
import { Move, Play, Print } from '#operations';
|
|
9
|
+
import { Chess } from '#types';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const operations = [Move, Play, Print];
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export const make = () =>
|
|
13
|
+
const make = () =>
|
|
16
14
|
Blueprint.make({
|
|
17
|
-
key:
|
|
15
|
+
key: Chess.BLUEPRINT_KEY,
|
|
18
16
|
name: 'Chess',
|
|
19
|
-
tools: Blueprint.toolDefinitions({
|
|
17
|
+
tools: Blueprint.toolDefinitions({ operations }),
|
|
20
18
|
instructions: Template.make({
|
|
21
19
|
source: trim`
|
|
22
20
|
You are an expert chess player.
|
|
@@ -26,3 +24,10 @@ export const make = () =>
|
|
|
26
24
|
`,
|
|
27
25
|
}),
|
|
28
26
|
});
|
|
27
|
+
|
|
28
|
+
const blueprint: Blueprint.Definition = {
|
|
29
|
+
key: Chess.BLUEPRINT_KEY,
|
|
30
|
+
make,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default blueprint;
|
package/src/blueprints/index.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
10
|
+
import type { Blueprint } from '@dxos/compute';
|
|
11
|
+
|
|
12
|
+
import { ChessBlueprint } from '#blueprints';
|
|
13
|
+
|
|
14
|
+
const blueprintDefinition = Capability.makeModule<
|
|
15
|
+
[],
|
|
16
|
+
Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
|
|
17
|
+
>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, ChessBlueprint)]));
|
|
18
|
+
|
|
19
|
+
export default blueprintDefinition;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
7
|
+
|
|
8
|
+
import { Capability } from '@dxos/app-framework';
|
|
9
|
+
import { GameCapabilities, type GameVariant } from '@dxos/plugin-game/types';
|
|
10
|
+
|
|
11
|
+
import { ChessArticle, ChessCard } from '#containers';
|
|
12
|
+
import { Chess } from '#types';
|
|
13
|
+
|
|
14
|
+
const CreateChessInput = Schema.Struct({
|
|
15
|
+
name: Schema.optional(
|
|
16
|
+
Schema.String.annotations({
|
|
17
|
+
title: 'Name',
|
|
18
|
+
description: 'Optional name for the game.',
|
|
19
|
+
}),
|
|
20
|
+
),
|
|
21
|
+
pgn: Schema.optional(
|
|
22
|
+
Schema.String.annotations({
|
|
23
|
+
title: 'PGN',
|
|
24
|
+
description: 'Optional Portable Game Notation to start from.',
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const variant: GameVariant = {
|
|
30
|
+
id: Chess.State.typename,
|
|
31
|
+
label: 'Chess',
|
|
32
|
+
icon: 'ph--shield-chevron--regular',
|
|
33
|
+
variantSchema: Chess.State,
|
|
34
|
+
inputSchema: CreateChessInput,
|
|
35
|
+
roles: ['white', 'black'] as const,
|
|
36
|
+
createVariant: (input) =>
|
|
37
|
+
Effect.sync(() => Chess.make({ pgn: typeof input.pgn === 'string' ? input.pgn : undefined })),
|
|
38
|
+
card: ChessCard,
|
|
39
|
+
article: ChessArticle,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default Capability.makeModule(() => Effect.succeed(Capability.contributes(GameCapabilities.Variant, variant)));
|
|
@@ -2,5 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
7
|
+
import type { Blueprint, OperationHandlerSet } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
10
|
+
export const GameVariant = Capability.lazy('GameVariant', () => import('./game-variant'));
|
|
11
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
12
|
+
'OperationHandler',
|
|
13
|
+
() => import('./operation-handler'),
|
|
14
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
7
|
+
import type { Blueprint, OperationHandlerSet } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Node-only capability exports. Excludes React/Solid-touching modules
|
|
11
|
+
* (game-variant pulls in container components) so the headless CLI build
|
|
12
|
+
* doesn't drag UI code through bun's JSX transform.
|
|
13
|
+
*/
|
|
14
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
15
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
16
|
+
'OperationHandler',
|
|
17
|
+
() => import('./operation-handler'),
|
|
18
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
6
|
+
import type { OperationHandlerSet } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
import { ChessHandlers } from '#operations';
|
|
9
|
+
|
|
10
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
11
|
+
Effect.fnUntraced(function* () {
|
|
12
|
+
return Capability.contributes(Capabilities.OperationHandler, ChessHandlers);
|
|
13
|
+
}),
|
|
14
|
+
);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { withClientProvider } from '@dxos/react-client/testing';
|
|
9
|
+
import { type Player } from '@dxos/react-ui-gameboard';
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
|
+
|
|
12
|
+
import { translations } from '#translations';
|
|
13
|
+
import { Chess } from '#types';
|
|
14
|
+
|
|
15
|
+
import { Chessboard, type ChessboardController, type ChessboardInfoProps } from './Chessboard';
|
|
16
|
+
|
|
17
|
+
const SAMPLE_PGN =
|
|
18
|
+
'1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 d5 8. exd5 Nxd5 9. O-O Be6 10. Qb3 Na5 11. Qa4+ c6 12. Bxd5 Bxc3 13. Bxe6 fxe6 *';
|
|
19
|
+
|
|
20
|
+
const PROMOTION_PGN =
|
|
21
|
+
'1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 d5 8. exd5 Nxd5 9. O-O Be6 10. Qb3 Na5 11. Qa4+ c6 12. Bxd5 Bxc3 13. Bxe6 fxe6 14. d5 Qg5 15. dxe6 Kf8 16. e7+ Kg8 *';
|
|
22
|
+
|
|
23
|
+
type DefaultStoryProps = {
|
|
24
|
+
pgn?: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const DefaultStory = ({ pgn }: DefaultStoryProps) => {
|
|
28
|
+
const state = useMemo(() => Chess.make(pgn ? { pgn } : undefined), [pgn]);
|
|
29
|
+
const [orientation, setOrientation] = useState<Player>('white');
|
|
30
|
+
const [showInfo, setShowInfo] = useState(true);
|
|
31
|
+
const controller = useRef<ChessboardController>(null);
|
|
32
|
+
|
|
33
|
+
const handleSelect = useCallback<NonNullable<ChessboardInfoProps['onSelect']>>((index) => {
|
|
34
|
+
controller.current?.setMoveNumber(index);
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Chessboard.Root state={state} ref={controller}>
|
|
39
|
+
<div className='flex h-full w-full gap-4 p-4 overflow-hidden'>
|
|
40
|
+
<Chessboard.Content classNames='grow'>
|
|
41
|
+
<Chessboard.Board classNames='border rounded-xs' orientation={orientation} />
|
|
42
|
+
</Chessboard.Content>
|
|
43
|
+
{showInfo && (
|
|
44
|
+
<div className='flex flex-col justify-center items-center overflow-hidden'>
|
|
45
|
+
<Chessboard.Info
|
|
46
|
+
orientation={orientation}
|
|
47
|
+
min={8}
|
|
48
|
+
max={8}
|
|
49
|
+
onOrientationChange={setOrientation}
|
|
50
|
+
onClose={() => setShowInfo(false)}
|
|
51
|
+
onSelect={handleSelect}
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
)}
|
|
55
|
+
</div>
|
|
56
|
+
</Chessboard.Root>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const meta = {
|
|
61
|
+
title: 'plugins/plugin-chess/components/Chessboard',
|
|
62
|
+
component: DefaultStory,
|
|
63
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' }), withClientProvider({ createIdentity: true })],
|
|
64
|
+
parameters: {
|
|
65
|
+
layout: 'fullscreen',
|
|
66
|
+
translations,
|
|
67
|
+
},
|
|
68
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
69
|
+
|
|
70
|
+
export default meta;
|
|
71
|
+
|
|
72
|
+
type Story = StoryObj<typeof meta>;
|
|
73
|
+
|
|
74
|
+
export const Default: Story = {
|
|
75
|
+
args: {},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const WithPgn: Story = {
|
|
79
|
+
args: {
|
|
80
|
+
pgn: SAMPLE_PGN,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const Promotion: Story = {
|
|
85
|
+
args: {
|
|
86
|
+
pgn: PROMOTION_PGN,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const NewGame: Story = {
|
|
91
|
+
args: {
|
|
92
|
+
pgn: undefined,
|
|
93
|
+
},
|
|
94
|
+
};
|