@dxos/plugin-chess 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0
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 +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-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-MC7L6JNC.mjs +36 -0
- package/dist/lib/browser/chunk-MC7L6JNC.mjs.map +7 -0
- package/dist/lib/browser/chunk-SBRUTOHG.mjs +28 -0
- package/dist/lib/browser/chunk-SBRUTOHG.mjs.map +7 -0
- package/dist/lib/browser/chunk-XAJZK6Z2.mjs +110 -0
- package/dist/lib/browser/chunk-XAJZK6Z2.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +34 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/create-AJHN4QT4.mjs +24 -0
- package/dist/lib/browser/create-AJHN4QT4.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +364 -99
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/move-CN7BGBOR.mjs +36 -0
- package/dist/lib/browser/move-CN7BGBOR.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-YRKSZF5U.mjs +45 -0
- package/dist/lib/browser/play-YRKSZF5U.mjs.map +7 -0
- package/dist/lib/browser/print-EW7LPW4D.mjs +30 -0
- package/dist/lib/browser/print-EW7LPW4D.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -5
- 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-4HZWCKMR.mjs +38 -0
- package/dist/lib/node-esm/chunk-4HZWCKMR.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7W2LXAM5.mjs +29 -0
- package/dist/lib/node-esm/chunk-7W2LXAM5.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-NYU5JVXP.mjs +111 -0
- package/dist/lib/node-esm/chunk-NYU5JVXP.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/cli/index.mjs +35 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/create-QSETDT4N.mjs +25 -0
- package/dist/lib/node-esm/create-QSETDT4N.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +364 -99
- 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-OTEYBHVI.mjs +37 -0
- package/dist/lib/node-esm/move-OTEYBHVI.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-ZLDAXADK.mjs +46 -0
- package/dist/lib/node-esm/play-ZLDAXADK.mjs.map +7 -0
- package/dist/lib/node-esm/print-UJHXAXMS.mjs +31 -0
- package/dist/lib/node-esm/print-UJHXAXMS.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.d.ts +3 -2
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -5
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +5 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- 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/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- 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/Chessboard/Chessboard.stories.d.ts +48 -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} +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/containers/ChessArticle/ChessArticle.stories.d.ts +47 -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 +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 +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/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 +21 -19
- 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 +74 -43
- package/src/ChessPlugin.tsx +41 -53
- package/src/blueprints/chess-blueprint.ts +35 -0
- package/src/blueprints/index.ts +6 -0
- package/src/capabilities/artifact-definition.ts +98 -92
- package/src/capabilities/blueprint-definition.ts +9 -28
- package/src/capabilities/index.ts +8 -6
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/capabilities/react-surface.tsx +27 -15
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +37 -0
- package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
- package/src/components/{Chessboard.tsx → Chessboard/Chessboard.tsx} +32 -29
- package/src/components/{Info.tsx → Chessboard/Info.tsx} +41 -24
- 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 +5 -0
- package/src/containers/ChessCard/ChessCard.stories.tsx +42 -0
- package/src/containers/ChessCard/ChessCard.tsx +22 -0
- package/src/containers/ChessCard/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/index.ts +2 -3
- package/src/meta.ts +3 -3
- package/src/operations/create.ts +21 -0
- package/src/operations/definitions.ts +109 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/move.ts +36 -0
- package/src/operations/play.ts +45 -0
- package/src/operations/print.ts +28 -0
- package/src/translations.ts +21 -19
- 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 +0 -28
- 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 +0 -29
- 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/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.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 -44
- 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/intent-resolver.ts +0 -22
- 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
package/package.json
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-chess",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.74a063c4e0",
|
|
4
4
|
"description": "Chess for new plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"sideEffects": true,
|
|
10
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#blueprints": "./src/blueprints/index.ts",
|
|
17
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
18
|
+
"#components": "./src/components/index.ts",
|
|
19
|
+
"#containers": "./src/containers/index.ts",
|
|
20
|
+
"#meta": "./src/meta.ts",
|
|
21
|
+
"#operations": "./src/operations/index.ts",
|
|
22
|
+
"#types": "./src/types/index.ts"
|
|
23
|
+
},
|
|
11
24
|
"exports": {
|
|
12
25
|
".": {
|
|
13
26
|
"source": "./src/index.ts",
|
|
@@ -15,17 +28,29 @@
|
|
|
15
28
|
"browser": "./dist/lib/browser/index.mjs",
|
|
16
29
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
17
30
|
},
|
|
31
|
+
"./blueprints": {
|
|
32
|
+
"source": "./src/blueprints/index.ts",
|
|
33
|
+
"types": "./dist/types/src/blueprints/index.d.ts",
|
|
34
|
+
"browser": "./dist/lib/browser/blueprints/index.mjs",
|
|
35
|
+
"node": "./dist/lib/node-esm/blueprints/index.mjs"
|
|
36
|
+
},
|
|
37
|
+
"./cli": {
|
|
38
|
+
"source": "./src/cli/index.ts",
|
|
39
|
+
"types": "./dist/types/src/cli/index.d.ts",
|
|
40
|
+
"browser": "./dist/lib/browser/cli/index.mjs",
|
|
41
|
+
"node": "./dist/lib/node-esm/cli/index.mjs"
|
|
42
|
+
},
|
|
43
|
+
"./operations": {
|
|
44
|
+
"source": "./src/operations/index.ts",
|
|
45
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
46
|
+
"browser": "./dist/lib/browser/operations/index.mjs",
|
|
47
|
+
"node": "./dist/lib/node-esm/operations/index.mjs"
|
|
48
|
+
},
|
|
18
49
|
"./types": {
|
|
19
50
|
"source": "./src/types/index.ts",
|
|
20
51
|
"types": "./dist/types/src/types/index.d.ts",
|
|
21
52
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
22
53
|
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
23
|
-
},
|
|
24
|
-
"./functions": {
|
|
25
|
-
"source": "./src/functions/index.ts",
|
|
26
|
-
"types": "./dist/types/src/functions/index.d.ts",
|
|
27
|
-
"browser": "./dist/lib/browser/functions/index.mjs",
|
|
28
|
-
"node": "./dist/lib/node-esm/functions/index.mjs"
|
|
29
54
|
}
|
|
30
55
|
},
|
|
31
56
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -41,47 +66,53 @@
|
|
|
41
66
|
"src"
|
|
42
67
|
],
|
|
43
68
|
"dependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
69
|
+
"@automerge/automerge": "3.2.3",
|
|
70
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
46
71
|
"chess.js": "^1.0.0",
|
|
47
|
-
"effect": "3.
|
|
48
|
-
"@dxos/ai": "0.8.4-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/echo": "0.8.4-main.
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/functions": "0.8.4-main.
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/react-ui-gameboard": "0.8.4-main.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
72
|
+
"effect": "3.20.0",
|
|
73
|
+
"@dxos/ai": "0.8.4-main.74a063c4e0",
|
|
74
|
+
"@dxos/assistant": "0.8.4-main.74a063c4e0",
|
|
75
|
+
"@dxos/app-toolkit": "0.8.4-main.74a063c4e0",
|
|
76
|
+
"@dxos/async": "0.8.4-main.74a063c4e0",
|
|
77
|
+
"@dxos/blueprints": "0.8.4-main.74a063c4e0",
|
|
78
|
+
"@dxos/display-name": "0.8.4-main.74a063c4e0",
|
|
79
|
+
"@dxos/echo": "0.8.4-main.74a063c4e0",
|
|
80
|
+
"@dxos/echo-db": "0.8.4-main.74a063c4e0",
|
|
81
|
+
"@dxos/functions": "0.8.4-main.74a063c4e0",
|
|
82
|
+
"@dxos/echo-react": "0.8.4-main.74a063c4e0",
|
|
83
|
+
"@dxos/invariant": "0.8.4-main.74a063c4e0",
|
|
84
|
+
"@dxos/log": "0.8.4-main.74a063c4e0",
|
|
85
|
+
"@dxos/plugin-client": "0.8.4-main.74a063c4e0",
|
|
86
|
+
"@dxos/plugin-graph": "0.8.4-main.74a063c4e0",
|
|
87
|
+
"@dxos/plugin-markdown": "0.8.4-main.74a063c4e0",
|
|
88
|
+
"@dxos/plugin-space": "0.8.4-main.74a063c4e0",
|
|
89
|
+
"@dxos/react-ui-gameboard": "0.8.4-main.74a063c4e0",
|
|
90
|
+
"@dxos/operation": "0.8.4-main.74a063c4e0",
|
|
91
|
+
"@dxos/app-framework": "0.8.4-main.74a063c4e0",
|
|
92
|
+
"@dxos/react-client": "0.8.4-main.74a063c4e0",
|
|
93
|
+
"@dxos/react-ui-sfx": "0.8.4-main.74a063c4e0",
|
|
94
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.74a063c4e0",
|
|
95
|
+
"@dxos/react-ui-stack": "0.8.4-main.74a063c4e0",
|
|
96
|
+
"@dxos/schema": "0.8.4-main.74a063c4e0",
|
|
97
|
+
"@dxos/types": "0.8.4-main.74a063c4e0",
|
|
98
|
+
"@dxos/util": "0.8.4-main.74a063c4e0"
|
|
68
99
|
},
|
|
69
100
|
"devDependencies": {
|
|
70
|
-
"@types/react": "~19.2.
|
|
71
|
-
"@types/react-dom": "~19.2.
|
|
72
|
-
"react": "~19.2.
|
|
73
|
-
"react-dom": "~19.2.
|
|
74
|
-
"vite": "7.1.
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
101
|
+
"@types/react": "~19.2.7",
|
|
102
|
+
"@types/react-dom": "~19.2.3",
|
|
103
|
+
"react": "~19.2.3",
|
|
104
|
+
"react-dom": "~19.2.3",
|
|
105
|
+
"vite": "^7.1.11",
|
|
106
|
+
"@dxos/storybook-utils": "0.8.4-main.74a063c4e0",
|
|
107
|
+
"@dxos/plugin-theme": "0.8.4-main.74a063c4e0",
|
|
108
|
+
"@dxos/react-ui": "0.8.4-main.74a063c4e0",
|
|
109
|
+
"@dxos/ui-theme": "0.8.4-main.74a063c4e0"
|
|
79
110
|
},
|
|
80
111
|
"peerDependencies": {
|
|
81
|
-
"react": "
|
|
82
|
-
"react-dom": "
|
|
83
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
84
|
-
"@dxos/
|
|
112
|
+
"react": "~19.2.3",
|
|
113
|
+
"react-dom": "~19.2.3",
|
|
114
|
+
"@dxos/react-ui": "0.8.4-main.74a063c4e0",
|
|
115
|
+
"@dxos/ui-theme": "0.8.4-main.74a063c4e0"
|
|
85
116
|
},
|
|
86
117
|
"publishConfig": {
|
|
87
118
|
"access": "public"
|
package/src/ChessPlugin.tsx
CHANGED
|
@@ -2,60 +2,48 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import {
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
7
|
+
|
|
8
|
+
import { Plugin } from '@dxos/app-framework';
|
|
9
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
10
|
+
import { Annotation } from '@dxos/echo';
|
|
11
|
+
import { Operation } from '@dxos/operation';
|
|
12
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
13
|
+
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
14
|
+
|
|
15
|
+
import { ChessBlueprint } from '#blueprints';
|
|
16
|
+
import { BlueprintDefinition, OperationHandler, ReactSurface } from '#capabilities';
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
import { Chess } from '#types';
|
|
9
19
|
|
|
10
|
-
import { BlueprintDefinition, CHESS_BLUEPRINT_KEY, IntentResolver, ReactSurface } from './capabilities';
|
|
11
|
-
import { meta } from './meta';
|
|
12
20
|
import { translations } from './translations';
|
|
13
|
-
import { Chess, ChessAction } from './types';
|
|
14
21
|
|
|
15
|
-
export const ChessPlugin =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
activate: () =>
|
|
38
|
-
contributes(
|
|
39
|
-
SpaceCapabilities.ObjectForm,
|
|
40
|
-
defineObjectForm({
|
|
41
|
-
objectSchema: Chess.Game,
|
|
42
|
-
getIntent: () => createIntent(ChessAction.Create),
|
|
43
|
-
}),
|
|
44
|
-
),
|
|
45
|
-
}),
|
|
46
|
-
defineModule({
|
|
47
|
-
id: `${meta.id}/module/react-surface`,
|
|
48
|
-
activatesOn: Events.SetupReactSurface,
|
|
49
|
-
activate: ReactSurface,
|
|
50
|
-
}),
|
|
51
|
-
defineModule({
|
|
52
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
53
|
-
activatesOn: Events.SetupIntentResolver,
|
|
54
|
-
activate: IntentResolver,
|
|
55
|
-
}),
|
|
56
|
-
defineModule({
|
|
57
|
-
id: `${meta.id}/module/blueprint`,
|
|
58
|
-
activatesOn: Events.SetupArtifactDefinition,
|
|
59
|
-
activate: BlueprintDefinition,
|
|
22
|
+
export const ChessPlugin = Plugin.define(meta).pipe(
|
|
23
|
+
AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),
|
|
24
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
25
|
+
AppPlugin.addMetadataModule({
|
|
26
|
+
metadata: {
|
|
27
|
+
id: Chess.Game.typename,
|
|
28
|
+
metadata: {
|
|
29
|
+
icon: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).icon,
|
|
30
|
+
iconHue: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).hue ?? 'white',
|
|
31
|
+
blueprints: [ChessBlueprint.key],
|
|
32
|
+
createObject: ((props, options) =>
|
|
33
|
+
Effect.gen(function* () {
|
|
34
|
+
const object = Chess.make(props);
|
|
35
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
36
|
+
object,
|
|
37
|
+
target: options.target,
|
|
38
|
+
hidden: true,
|
|
39
|
+
targetNodeId: options.targetNodeId,
|
|
40
|
+
});
|
|
41
|
+
})) satisfies CreateObject,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
60
44
|
}),
|
|
61
|
-
])
|
|
45
|
+
AppPlugin.addSchemaModule({ schema: [Chess.Game] }),
|
|
46
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
47
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
48
|
+
Plugin.make,
|
|
49
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
6
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
7
|
+
import { trim } from '@dxos/util';
|
|
8
|
+
|
|
9
|
+
import { Create, Move, Play, Print } from '#operations';
|
|
10
|
+
|
|
11
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.chess';
|
|
12
|
+
|
|
13
|
+
const operations = [Create, Move, Play, Print];
|
|
14
|
+
|
|
15
|
+
const make = () =>
|
|
16
|
+
Blueprint.make({
|
|
17
|
+
key: BLUEPRINT_KEY,
|
|
18
|
+
name: 'Chess',
|
|
19
|
+
tools: Blueprint.toolDefinitions({ operations }),
|
|
20
|
+
instructions: Template.make({
|
|
21
|
+
source: trim`
|
|
22
|
+
You are an expert chess player.
|
|
23
|
+
To analyze a game you can access the "pgn" property by loading the context object that represents the current game.
|
|
24
|
+
You could suggest a good next move or offer to play a move.
|
|
25
|
+
Don't actually make a move unless you are asked to.
|
|
26
|
+
`,
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
31
|
+
key: BLUEPRINT_KEY,
|
|
32
|
+
make,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default blueprint;
|
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
|
|
8
8
|
import { Chess as ChessJS } from 'chess.js';
|
|
9
|
-
import * as
|
|
9
|
+
import * as Effect from 'effect/Effect';
|
|
10
10
|
import * as Schema from 'effect/Schema';
|
|
11
11
|
|
|
12
12
|
import { ToolResult, createTool } from '@dxos/ai';
|
|
13
|
-
import { Capabilities, type PromiseIntentDispatcher
|
|
13
|
+
import { Capabilities, Capability, type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
14
14
|
import { ArtifactId, VersionPin, createArtifactElement } from '@dxos/assistant';
|
|
15
15
|
import { defineArtifact } from '@dxos/blueprints';
|
|
16
16
|
import { Obj } from '@dxos/echo';
|
|
17
17
|
import { invariant } from '@dxos/invariant';
|
|
18
|
-
import {
|
|
18
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
19
19
|
import { Filter, type Space } from '@dxos/react-client/echo';
|
|
20
20
|
import { trim } from '@dxos/util';
|
|
21
21
|
|
|
22
|
-
import { meta } from '
|
|
23
|
-
import { Chess
|
|
22
|
+
import { meta } from '#meta';
|
|
23
|
+
import { Chess } from '#types';
|
|
24
24
|
|
|
25
25
|
// TODO(burdon): Factor out.
|
|
26
26
|
declare global {
|
|
@@ -30,100 +30,106 @@ declare global {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export default () =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
export default Capability.makeModule(() =>
|
|
34
|
+
Effect.sync(() => {
|
|
35
|
+
const definition = defineArtifact({
|
|
36
|
+
id: `artifact:${meta.id}`,
|
|
37
|
+
name: meta.name,
|
|
38
|
+
description: 'Provides a simple chess engine.',
|
|
39
|
+
instructions: trim`
|
|
39
40
|
- If the user's message relates to a chess game, you must return the chess game inside the artifact tag as a valid FEN string with no additional text.
|
|
40
41
|
- Always inspect the chess game at the start of every prompt realting to a chess game, as it might have changed since the interaction.
|
|
41
42
|
`,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const intent = Function.pipe(
|
|
55
|
-
createIntent(ChessAction.Create, { pgn }),
|
|
56
|
-
chain(SpaceAction.AddObject, { target: extensions.space }),
|
|
57
|
-
);
|
|
58
|
-
const { data, error } = await extensions.dispatch(intent);
|
|
59
|
-
if (!data || error) {
|
|
60
|
-
return ToolResult.Error(error?.message ?? 'Failed to create chess game');
|
|
61
|
-
}
|
|
43
|
+
schema: Chess.Game,
|
|
44
|
+
tools: [
|
|
45
|
+
createTool(meta.id, {
|
|
46
|
+
name: 'create',
|
|
47
|
+
description: 'Create a new chess game. Returns the artifact definition for the game.',
|
|
48
|
+
caption: 'Creating chess game...',
|
|
49
|
+
schema: Schema.Struct({
|
|
50
|
+
pgn: Schema.String.annotations({ description: 'The state of the chess game in the PGN format.' }),
|
|
51
|
+
}),
|
|
52
|
+
execute: async ({ pgn }, { extensions }) => {
|
|
53
|
+
invariant(extensions?.space, 'No space');
|
|
54
|
+
invariant(extensions?.invoke, 'No operation invoker');
|
|
62
55
|
|
|
63
|
-
|
|
64
|
-
VersionPin.createBlock(VersionPin.fromObject(data.object)),
|
|
65
|
-
]);
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
|
-
createTool(meta.id, {
|
|
69
|
-
name: 'list',
|
|
70
|
-
description: 'Query all active chess games.',
|
|
71
|
-
caption: 'Getting games...',
|
|
72
|
-
schema: Schema.Struct({}),
|
|
73
|
-
execute: async (_, { extensions }) => {
|
|
74
|
-
invariant(extensions?.space, 'No space');
|
|
75
|
-
const { objects: games } = await extensions.space.db.query(Filter.type(Chess.Game)).run();
|
|
76
|
-
invariant(games.length > 0, 'No chess games found');
|
|
56
|
+
const game = Chess.make({ pgn });
|
|
77
57
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
schema: Schema.Struct({ id: ArtifactId }),
|
|
86
|
-
execute: async ({ id }, { extensions }) => {
|
|
87
|
-
invariant(extensions?.space, 'No space');
|
|
88
|
-
const game = await extensions.space.db
|
|
89
|
-
.query(Filter.ids(ArtifactId.toDXN(id, extensions.space.id).toString()))
|
|
90
|
-
.first();
|
|
91
|
-
invariant(Obj.instanceOf(Chess.Game, game));
|
|
58
|
+
const { data, error } = await extensions.invoke(SpaceOperation.AddObject, {
|
|
59
|
+
target: extensions.space,
|
|
60
|
+
object: game,
|
|
61
|
+
});
|
|
62
|
+
if (error) {
|
|
63
|
+
return ToolResult.Error(error?.message ?? 'Failed to add chess game to space');
|
|
64
|
+
}
|
|
92
65
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
name: 'move',
|
|
98
|
-
description: 'Make a move in the chess game.',
|
|
99
|
-
caption: 'Making chess move...',
|
|
100
|
-
schema: Schema.Struct({
|
|
101
|
-
id: ArtifactId,
|
|
102
|
-
move: Schema.String.annotations({
|
|
103
|
-
description: 'The move to make in the chess game.',
|
|
104
|
-
examples: ['e4', 'Bf3'],
|
|
105
|
-
}),
|
|
66
|
+
return ToolResult.Success(createArtifactElement(game.id), [
|
|
67
|
+
VersionPin.createBlock(VersionPin.fromObject(game)),
|
|
68
|
+
]);
|
|
69
|
+
},
|
|
106
70
|
}),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
71
|
+
createTool(meta.id, {
|
|
72
|
+
name: 'list',
|
|
73
|
+
description: 'Query all active chess games.',
|
|
74
|
+
caption: 'Getting games...',
|
|
75
|
+
schema: Schema.Struct({}),
|
|
76
|
+
execute: async (_, { extensions }) => {
|
|
77
|
+
invariant(extensions?.space, 'No space');
|
|
78
|
+
const { objects: games } = await extensions.space.db.query(Filter.type(Chess.Game)).run();
|
|
79
|
+
invariant(games.length > 0, 'No chess games found');
|
|
113
80
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
81
|
+
return ToolResult.Success(games);
|
|
82
|
+
},
|
|
83
|
+
}),
|
|
84
|
+
createTool(meta.id, {
|
|
85
|
+
name: 'inspect',
|
|
86
|
+
description: 'Get the current state of the chess game.',
|
|
87
|
+
caption: 'Inspecting game...',
|
|
88
|
+
schema: Schema.Struct({ id: ArtifactId }),
|
|
89
|
+
execute: async ({ id }, { extensions }) => {
|
|
90
|
+
invariant(extensions?.space, 'No space');
|
|
91
|
+
const game = await extensions.space.db
|
|
92
|
+
.query(Filter.id(ArtifactId.toDXN(id, extensions.space.id).toString()))
|
|
93
|
+
.first();
|
|
94
|
+
invariant(Obj.instanceOf(Chess.Game, game));
|
|
120
95
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
96
|
+
return ToolResult.Success(game.pgn);
|
|
97
|
+
},
|
|
98
|
+
}),
|
|
99
|
+
createTool(meta.id, {
|
|
100
|
+
name: 'move',
|
|
101
|
+
description: 'Make a move in the chess game.',
|
|
102
|
+
caption: 'Making chess move...',
|
|
103
|
+
schema: Schema.Struct({
|
|
104
|
+
id: ArtifactId,
|
|
105
|
+
move: Schema.String.annotations({
|
|
106
|
+
description: 'The move to make in the chess game.',
|
|
107
|
+
examples: ['e4', 'Bf3'],
|
|
108
|
+
}),
|
|
109
|
+
}),
|
|
110
|
+
execute: async ({ id, move }, { extensions }) => {
|
|
111
|
+
invariant(extensions?.space, 'No space');
|
|
112
|
+
const game = await extensions.space.db
|
|
113
|
+
.query(Filter.id(ArtifactId.toDXN(id, extensions.space.id).toString()))
|
|
114
|
+
.first();
|
|
115
|
+
invariant(Obj.instanceOf(Chess.Game, game));
|
|
116
|
+
|
|
117
|
+
const chess = new ChessJS(game.pgn);
|
|
118
|
+
try {
|
|
119
|
+
chess.move(move);
|
|
120
|
+
} catch (error: any) {
|
|
121
|
+
return ToolResult.Error(error.message);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
Obj.change(game, (obj) => {
|
|
125
|
+
obj.pgn = chess.pgn();
|
|
126
|
+
});
|
|
127
|
+
return ToolResult.Success(game.pgn);
|
|
128
|
+
},
|
|
129
|
+
}),
|
|
130
|
+
],
|
|
131
|
+
});
|
|
127
132
|
|
|
128
|
-
|
|
129
|
-
}
|
|
133
|
+
return Capability.contributes(Capabilities.ArtifactDefinition, definition);
|
|
134
|
+
}),
|
|
135
|
+
);
|
|
@@ -2,35 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { Blueprint, Template } from '@dxos/blueprints';
|
|
7
|
-
import { type FunctionDefinition } from '@dxos/functions';
|
|
8
|
-
import { trim } from '@dxos/util';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
9
6
|
|
|
10
|
-
import {
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
import { ChessBlueprint } from '#blueprints';
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
const blueprintDefinition = Capability.makeModule<
|
|
13
|
+
[],
|
|
14
|
+
Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
|
|
15
|
+
>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, ChessBlueprint)]));
|
|
15
16
|
|
|
16
|
-
export default
|
|
17
|
-
return [
|
|
18
|
-
contributes(Capabilities.Functions, functions),
|
|
19
|
-
contributes(
|
|
20
|
-
Capabilities.BlueprintDefinition,
|
|
21
|
-
Blueprint.make({
|
|
22
|
-
key: CHESS_BLUEPRINT_KEY,
|
|
23
|
-
name: 'Chess',
|
|
24
|
-
tools: Blueprint.toolDefinitions({ functions }),
|
|
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
|
-
),
|
|
35
|
-
];
|
|
36
|
-
};
|
|
17
|
+
export default blueprintDefinition;
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
6
7
|
|
|
7
|
-
export const BlueprintDefinition = lazy(() => import('./blueprint-definition'));
|
|
8
|
-
export const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
9
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
10
|
+
'OperationHandler',
|
|
11
|
+
() => import('./operation-handler'),
|
|
12
|
+
);
|
|
13
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
@@ -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/operation';
|
|
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
|
+
);
|