@dxos/plugin-chess 0.8.4-main.67995b8 → 0.8.4-main.6fa680abb7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/dist/lib/browser/ChessArticle-UDSL3OJ4.mjs +59 -0
  2. package/dist/lib/browser/ChessArticle-UDSL3OJ4.mjs.map +7 -0
  3. package/dist/lib/browser/ChessCard-OIRFQMOJ.mjs +21 -0
  4. package/dist/lib/browser/ChessCard-OIRFQMOJ.mjs.map +7 -0
  5. package/dist/lib/browser/blueprint-definition-LWRZPLQL.mjs +18 -0
  6. package/dist/lib/browser/blueprint-definition-LWRZPLQL.mjs.map +7 -0
  7. package/dist/lib/browser/blueprints/index.mjs +11 -0
  8. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  10. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-JP6G6VR6.mjs +276 -0
  12. package/dist/lib/browser/chunk-JP6G6VR6.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-RGHZ5CDO.mjs +21 -0
  14. package/dist/lib/browser/chunk-RGHZ5CDO.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-VK2W2UDJ.mjs +231 -0
  16. package/dist/lib/browser/chunk-VK2W2UDJ.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-WYUTI2K4.mjs +1 -0
  18. package/dist/lib/browser/chunk-WYUTI2K4.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-YJ2NLHEY.mjs +64 -0
  20. package/dist/lib/browser/chunk-YJ2NLHEY.mjs.map +7 -0
  21. package/dist/lib/browser/cli/index.mjs +28 -0
  22. package/dist/lib/browser/cli/index.mjs.map +7 -0
  23. package/dist/lib/browser/index.mjs +62 -66
  24. package/dist/lib/browser/index.mjs.map +4 -4
  25. package/dist/lib/browser/meta.json +1 -1
  26. package/dist/lib/browser/react-surface-M7QMAFTB.mjs +50 -0
  27. package/dist/lib/browser/react-surface-M7QMAFTB.mjs.map +7 -0
  28. package/dist/lib/browser/types/index.mjs +4 -7
  29. package/dist/lib/node-esm/ChessArticle-76MOXLJM.mjs +60 -0
  30. package/dist/lib/node-esm/ChessArticle-76MOXLJM.mjs.map +7 -0
  31. package/dist/lib/node-esm/ChessCard-TKNQP6IO.mjs +22 -0
  32. package/dist/lib/node-esm/ChessCard-TKNQP6IO.mjs.map +7 -0
  33. package/dist/lib/node-esm/blueprint-definition-CJZXRDEQ.mjs +19 -0
  34. package/dist/lib/node-esm/blueprint-definition-CJZXRDEQ.mjs.map +7 -0
  35. package/dist/lib/node-esm/blueprints/index.mjs +12 -0
  36. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  37. package/dist/lib/node-esm/chunk-7XDEO6IJ.mjs +2 -0
  38. package/dist/lib/node-esm/chunk-7XDEO6IJ.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-FK7NVSOG.mjs +277 -0
  40. package/dist/lib/node-esm/chunk-FK7NVSOG.mjs.map +7 -0
  41. package/dist/lib/node-esm/chunk-FYPVCMP4.mjs +23 -0
  42. package/dist/lib/node-esm/chunk-FYPVCMP4.mjs.map +7 -0
  43. package/dist/lib/node-esm/chunk-G3QQRYZC.mjs +232 -0
  44. package/dist/lib/node-esm/chunk-G3QQRYZC.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  46. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  47. package/dist/lib/node-esm/chunk-J6AJLY2O.mjs +65 -0
  48. package/dist/lib/node-esm/chunk-J6AJLY2O.mjs.map +7 -0
  49. package/dist/lib/node-esm/cli/index.mjs +29 -0
  50. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  51. package/dist/lib/node-esm/index.mjs +62 -66
  52. package/dist/lib/node-esm/index.mjs.map +4 -4
  53. package/dist/lib/node-esm/meta.json +1 -1
  54. package/dist/lib/node-esm/react-surface-DKM6ICBU.mjs +51 -0
  55. package/dist/lib/node-esm/react-surface-DKM6ICBU.mjs.map +7 -0
  56. package/dist/lib/node-esm/types/index.mjs +4 -7
  57. package/dist/types/src/ChessPlugin.d.ts +2 -1
  58. package/dist/types/src/ChessPlugin.d.ts.map +1 -1
  59. package/dist/types/src/blueprints/chess-blueprint.d.ts +4 -0
  60. package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -0
  61. package/dist/types/src/blueprints/functions/create.d.ts +15 -0
  62. package/dist/types/src/blueprints/functions/create.d.ts.map +1 -0
  63. package/dist/types/src/blueprints/functions/index.d.ts +56 -0
  64. package/dist/types/src/blueprints/functions/index.d.ts.map +1 -0
  65. package/dist/types/src/blueprints/functions/move.d.ts +16 -0
  66. package/dist/types/src/blueprints/functions/move.d.ts.map +1 -0
  67. package/dist/types/src/blueprints/functions/play.d.ts +17 -0
  68. package/dist/types/src/blueprints/functions/play.d.ts.map +1 -0
  69. package/dist/types/src/blueprints/functions/print.d.ts +8 -0
  70. package/dist/types/src/blueprints/functions/print.d.ts.map +1 -0
  71. package/dist/types/src/blueprints/index.d.ts +3 -0
  72. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  73. package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +12 -0
  74. package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +1 -0
  75. package/dist/types/src/capabilities/artifact-definition/index.d.ts +3 -0
  76. package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +6 -0
  78. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
  80. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/index.d.ts +2 -3
  82. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  83. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  84. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  85. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  86. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  87. package/dist/types/src/cli/index.d.ts +2 -0
  88. package/dist/types/src/cli/index.d.ts.map +1 -0
  89. package/dist/types/src/cli/plugin.d.ts +3 -0
  90. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  91. package/dist/types/src/components/Chessboard/Chessboard.d.ts +34 -0
  92. package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -0
  93. package/dist/types/src/components/Chessboard/Info.d.ts +21 -0
  94. package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -0
  95. package/dist/types/src/components/Chessboard/index.d.ts +2 -0
  96. package/dist/types/src/components/Chessboard/index.d.ts.map +1 -0
  97. package/dist/types/src/components/Chessboard/types.d.ts +8 -0
  98. package/dist/types/src/components/Chessboard/types.d.ts.map +1 -0
  99. package/dist/types/src/components/index.d.ts +1 -5
  100. package/dist/types/src/components/index.d.ts.map +1 -1
  101. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +6 -0
  102. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
  103. package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +47 -0
  104. package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -0
  105. package/dist/types/src/containers/ChessArticle/index.d.ts +3 -0
  106. package/dist/types/src/containers/ChessArticle/index.d.ts.map +1 -0
  107. package/dist/types/src/containers/ChessCard/ChessCard.d.ts +6 -0
  108. package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -0
  109. package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts +15 -0
  110. package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -0
  111. package/dist/types/src/containers/ChessCard/index.d.ts +3 -0
  112. package/dist/types/src/containers/ChessCard/index.d.ts.map +1 -0
  113. package/dist/types/src/containers/index.d.ts +4 -0
  114. package/dist/types/src/containers/index.d.ts.map +1 -0
  115. package/dist/types/src/index.d.ts +3 -1
  116. package/dist/types/src/index.d.ts.map +1 -1
  117. package/dist/types/src/meta.d.ts +2 -3
  118. package/dist/types/src/meta.d.ts.map +1 -1
  119. package/dist/types/src/translations.d.ts +12 -2
  120. package/dist/types/src/translations.d.ts.map +1 -1
  121. package/dist/types/src/types/Chess.d.ts +27 -0
  122. package/dist/types/src/types/Chess.d.ts.map +1 -0
  123. package/dist/types/src/types/index.d.ts +1 -2
  124. package/dist/types/src/types/index.d.ts.map +1 -1
  125. package/dist/types/tsconfig.tsbuildinfo +1 -1
  126. package/package.json +63 -38
  127. package/src/ChessPlugin.tsx +26 -52
  128. package/src/blueprints/chess-blueprint.ts +36 -0
  129. package/src/blueprints/functions/create.ts +38 -0
  130. package/src/blueprints/functions/index.ts +17 -0
  131. package/src/blueprints/functions/move.ts +48 -0
  132. package/src/blueprints/functions/play.ts +58 -0
  133. package/src/blueprints/functions/print.ts +42 -0
  134. package/src/blueprints/index.ts +6 -0
  135. package/src/capabilities/artifact-definition/artifact-definition.ts +135 -0
  136. package/src/capabilities/artifact-definition/index.ts +7 -0
  137. package/src/capabilities/blueprint-definition/blueprint-definition.ts +17 -0
  138. package/src/capabilities/blueprint-definition/index.ts +7 -0
  139. package/src/capabilities/index.ts +2 -5
  140. package/src/capabilities/react-surface/index.ts +7 -0
  141. package/src/capabilities/react-surface/react-surface.tsx +33 -0
  142. package/src/cli/index.ts +5 -0
  143. package/src/cli/plugin.ts +26 -0
  144. package/src/components/Chessboard/Chessboard.tsx +186 -0
  145. package/src/components/Chessboard/Info.tsx +246 -0
  146. package/src/components/Chessboard/index.ts +5 -0
  147. package/src/components/Chessboard/types.ts +18 -0
  148. package/src/components/index.ts +2 -6
  149. package/src/containers/ChessArticle/ChessArticle.stories.tsx +53 -0
  150. package/src/containers/ChessArticle/ChessArticle.tsx +72 -0
  151. package/src/containers/ChessArticle/index.ts +7 -0
  152. package/src/containers/ChessCard/ChessCard.stories.tsx +42 -0
  153. package/src/containers/ChessCard/ChessCard.tsx +22 -0
  154. package/src/containers/ChessCard/index.ts +7 -0
  155. package/src/containers/index.ts +8 -0
  156. package/src/index.ts +3 -1
  157. package/src/meta.ts +9 -7
  158. package/src/translations.ts +12 -2
  159. package/src/types/Chess.ts +58 -0
  160. package/src/types/index.ts +1 -2
  161. package/dist/lib/browser/ChessContainer-SC4ZV6XZ.mjs +0 -129
  162. package/dist/lib/browser/ChessContainer-SC4ZV6XZ.mjs.map +0 -7
  163. package/dist/lib/browser/artifact-definition-A2FSM255.mjs +0 -182
  164. package/dist/lib/browser/artifact-definition-A2FSM255.mjs.map +0 -7
  165. package/dist/lib/browser/chunk-A3WEUKPK.mjs +0 -61
  166. package/dist/lib/browser/chunk-A3WEUKPK.mjs.map +0 -7
  167. package/dist/lib/browser/chunk-KDADGLPC.mjs +0 -8
  168. package/dist/lib/browser/chunk-KDADGLPC.mjs.map +0 -7
  169. package/dist/lib/browser/chunk-ZXH3N4NA.mjs +0 -66
  170. package/dist/lib/browser/chunk-ZXH3N4NA.mjs.map +0 -7
  171. package/dist/lib/browser/intent-resolver-KQYYX44R.mjs +0 -28
  172. package/dist/lib/browser/intent-resolver-KQYYX44R.mjs.map +0 -7
  173. package/dist/lib/browser/react-surface-PLUCWIYP.mjs +0 -36
  174. package/dist/lib/browser/react-surface-PLUCWIYP.mjs.map +0 -7
  175. package/dist/lib/node-esm/ChessContainer-7GLY5KLY.mjs +0 -130
  176. package/dist/lib/node-esm/ChessContainer-7GLY5KLY.mjs.map +0 -7
  177. package/dist/lib/node-esm/artifact-definition-2H7OUBZO.mjs +0 -183
  178. package/dist/lib/node-esm/artifact-definition-2H7OUBZO.mjs.map +0 -7
  179. package/dist/lib/node-esm/chunk-27D3JA3K.mjs +0 -68
  180. package/dist/lib/node-esm/chunk-27D3JA3K.mjs.map +0 -7
  181. package/dist/lib/node-esm/chunk-IS3Y25PL.mjs +0 -63
  182. package/dist/lib/node-esm/chunk-IS3Y25PL.mjs.map +0 -7
  183. package/dist/lib/node-esm/chunk-QFINI7CC.mjs +0 -10
  184. package/dist/lib/node-esm/chunk-QFINI7CC.mjs.map +0 -7
  185. package/dist/lib/node-esm/intent-resolver-GXK2JROQ.mjs +0 -29
  186. package/dist/lib/node-esm/intent-resolver-GXK2JROQ.mjs.map +0 -7
  187. package/dist/lib/node-esm/react-surface-NGLNIWN3.mjs +0 -37
  188. package/dist/lib/node-esm/react-surface-NGLNIWN3.mjs.map +0 -7
  189. package/dist/types/src/capabilities/artifact-definition.d.ts +0 -11
  190. package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
  191. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  192. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  193. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  194. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  195. package/dist/types/src/components/Chess.d.ts +0 -14
  196. package/dist/types/src/components/Chess.d.ts.map +0 -1
  197. package/dist/types/src/components/ChessContainer.d.ts +0 -8
  198. package/dist/types/src/components/ChessContainer.d.ts.map +0 -1
  199. package/dist/types/src/components/ChessContainer.stories.d.ts +0 -23
  200. package/dist/types/src/components/ChessContainer.stories.d.ts.map +0 -1
  201. package/dist/types/src/components/ChessPanel.d.ts +0 -11
  202. package/dist/types/src/components/ChessPanel.d.ts.map +0 -1
  203. package/dist/types/src/components/Chessboard.stories.d.ts +0 -8
  204. package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
  205. package/dist/types/src/components/PlayerSelector.d.ts +0 -8
  206. package/dist/types/src/components/PlayerSelector.d.ts.map +0 -1
  207. package/dist/types/src/types/schema.d.ts +0 -29
  208. package/dist/types/src/types/schema.d.ts.map +0 -1
  209. package/dist/types/src/types/types.d.ts +0 -32
  210. package/dist/types/src/types/types.d.ts.map +0 -1
  211. package/src/capabilities/artifact-definition.ts +0 -124
  212. package/src/capabilities/intent-resolver.ts +0 -26
  213. package/src/capabilities/react-surface.tsx +0 -23
  214. package/src/components/Chess.tsx +0 -60
  215. package/src/components/ChessContainer.stories.tsx +0 -110
  216. package/src/components/ChessContainer.tsx +0 -71
  217. package/src/components/ChessPanel.tsx +0 -67
  218. package/src/components/Chessboard.stories.tsx +0 -41
  219. package/src/components/PlayerSelector.tsx +0 -82
  220. package/src/types/schema.ts +0 -34
  221. package/src/types/types.ts +0 -20
package/package.json CHANGED
@@ -1,25 +1,41 @@
1
1
  {
2
2
  "name": "@dxos/plugin-chess",
3
- "version": "0.8.4-main.67995b8",
3
+ "version": "0.8.4-main.6fa680abb7",
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",
11
15
  "exports": {
12
16
  ".": {
17
+ "source": "./src/index.ts",
13
18
  "types": "./dist/types/src/index.d.ts",
14
19
  "browser": "./dist/lib/browser/index.mjs",
15
- "node": "./dist/lib/node-esm/index.mjs",
16
- "source": "./src/index.ts"
20
+ "node": "./dist/lib/node-esm/index.mjs"
21
+ },
22
+ "./blueprints": {
23
+ "source": "./src/blueprints/index.ts",
24
+ "types": "./dist/types/src/blueprints/index.d.ts",
25
+ "browser": "./dist/lib/browser/blueprints/index.mjs",
26
+ "node": "./dist/lib/node-esm/blueprints/index.mjs"
27
+ },
28
+ "./cli": {
29
+ "source": "./src/cli/index.ts",
30
+ "types": "./dist/types/src/cli/index.d.ts",
31
+ "browser": "./dist/lib/browser/cli/index.mjs",
32
+ "node": "./dist/lib/node-esm/cli/index.mjs"
17
33
  },
18
34
  "./types": {
35
+ "source": "./src/types/index.ts",
19
36
  "types": "./dist/types/src/types/index.d.ts",
20
37
  "browser": "./dist/lib/browser/types/index.mjs",
21
- "node": "./dist/lib/node-esm/types/index.mjs",
22
- "source": "./src/types/index.ts"
38
+ "node": "./dist/lib/node-esm/types/index.mjs"
23
39
  }
24
40
  },
25
41
  "types": "dist/types/src/index.d.ts",
@@ -35,44 +51,53 @@
35
51
  "src"
36
52
  ],
37
53
  "dependencies": {
38
- "@preact-signals/safe-react": "^0.9.0",
39
- "@preact/signals-core": "^1.9.0",
54
+ "@automerge/automerge": "3.2.3",
55
+ "@effect-atom/atom-react": "^0.5.0",
40
56
  "chess.js": "^1.0.0",
41
- "effect": "3.17.0",
42
- "@dxos/ai": "0.8.4-main.67995b8",
43
- "@dxos/app-framework": "0.8.4-main.67995b8",
44
- "@dxos/async": "0.8.4-main.67995b8",
45
- "@dxos/assistant": "0.8.4-main.67995b8",
46
- "@dxos/display-name": "0.8.4-main.67995b8",
47
- "@dxos/blueprints": "0.8.4-main.67995b8",
48
- "@dxos/echo": "0.8.4-main.67995b8",
49
- "@dxos/invariant": "0.8.4-main.67995b8",
50
- "@dxos/echo-schema": "0.8.4-main.67995b8",
51
- "@dxos/live-object": "0.8.4-main.67995b8",
52
- "@dxos/log": "0.8.4-main.67995b8",
53
- "@dxos/plugin-client": "0.8.4-main.67995b8",
54
- "@dxos/plugin-graph": "0.8.4-main.67995b8",
55
- "@dxos/plugin-space": "0.8.4-main.67995b8",
56
- "@dxos/react-client": "0.8.4-main.67995b8",
57
- "@dxos/react-ui-gameboard": "0.8.4-main.67995b8",
58
- "@dxos/react-ui-stack": "0.8.4-main.67995b8"
57
+ "effect": "3.19.16",
58
+ "@dxos/ai": "0.8.4-main.6fa680abb7",
59
+ "@dxos/app-framework": "0.8.4-main.6fa680abb7",
60
+ "@dxos/assistant": "0.8.4-main.6fa680abb7",
61
+ "@dxos/app-toolkit": "0.8.4-main.6fa680abb7",
62
+ "@dxos/async": "0.8.4-main.6fa680abb7",
63
+ "@dxos/display-name": "0.8.4-main.6fa680abb7",
64
+ "@dxos/blueprints": "0.8.4-main.6fa680abb7",
65
+ "@dxos/echo": "0.8.4-main.6fa680abb7",
66
+ "@dxos/echo-db": "0.8.4-main.6fa680abb7",
67
+ "@dxos/functions": "0.8.4-main.6fa680abb7",
68
+ "@dxos/invariant": "0.8.4-main.6fa680abb7",
69
+ "@dxos/log": "0.8.4-main.6fa680abb7",
70
+ "@dxos/operation": "0.8.4-main.6fa680abb7",
71
+ "@dxos/echo-react": "0.8.4-main.6fa680abb7",
72
+ "@dxos/plugin-client": "0.8.4-main.6fa680abb7",
73
+ "@dxos/plugin-graph": "0.8.4-main.6fa680abb7",
74
+ "@dxos/plugin-space": "0.8.4-main.6fa680abb7",
75
+ "@dxos/plugin-markdown": "0.8.4-main.6fa680abb7",
76
+ "@dxos/react-ui-gameboard": "0.8.4-main.6fa680abb7",
77
+ "@dxos/react-ui-mosaic": "0.8.4-main.6fa680abb7",
78
+ "@dxos/react-client": "0.8.4-main.6fa680abb7",
79
+ "@dxos/react-ui-sfx": "0.8.4-main.6fa680abb7",
80
+ "@dxos/react-ui-stack": "0.8.4-main.6fa680abb7",
81
+ "@dxos/schema": "0.8.4-main.6fa680abb7",
82
+ "@dxos/util": "0.8.4-main.6fa680abb7",
83
+ "@dxos/types": "0.8.4-main.6fa680abb7"
59
84
  },
60
85
  "devDependencies": {
61
- "@types/react": "~18.2.0",
62
- "@types/react-dom": "~18.2.0",
63
- "react": "~18.2.0",
64
- "react-dom": "~18.2.0",
65
- "vite": "5.4.7",
66
- "@dxos/plugin-theme": "0.8.4-main.67995b8",
67
- "@dxos/react-ui": "0.8.4-main.67995b8",
68
- "@dxos/react-ui-theme": "0.8.4-main.67995b8",
69
- "@dxos/storybook-utils": "0.8.4-main.67995b8"
86
+ "@types/react": "~19.2.7",
87
+ "@types/react-dom": "~19.2.3",
88
+ "react": "~19.2.3",
89
+ "react-dom": "~19.2.3",
90
+ "vite": "^7.1.11",
91
+ "@dxos/plugin-theme": "0.8.4-main.6fa680abb7",
92
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
93
+ "@dxos/storybook-utils": "0.8.4-main.6fa680abb7",
94
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
70
95
  },
71
96
  "peerDependencies": {
72
- "react": "~18.2.0",
73
- "react-dom": "~18.2.0",
74
- "@dxos/react-ui": "0.8.4-main.67995b8",
75
- "@dxos/react-ui-theme": "0.8.4-main.67995b8"
97
+ "react": "~19.2.3",
98
+ "react-dom": "~19.2.3",
99
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
100
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
76
101
  },
77
102
  "publishConfig": {
78
103
  "access": "public"
@@ -2,59 +2,33 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';
6
- import { ClientEvents } from '@dxos/plugin-client';
7
- import { SpaceCapabilities } from '@dxos/plugin-space';
8
- import { defineObjectForm } from '@dxos/plugin-space/types';
5
+ import * as Effect from 'effect/Effect';
9
6
 
10
- import { ArtifactDefinition, IntentResolver, ReactSurface } from './capabilities';
7
+ import { Plugin } from '@dxos/app-framework';
8
+ import { AppPlugin } from '@dxos/app-toolkit';
9
+ import { type CreateObject } from '@dxos/plugin-space/types';
10
+
11
+ import { ChessBlueprint } from './blueprints';
12
+ import { BlueprintDefinition, ReactSurface } from './capabilities';
11
13
  import { meta } from './meta';
12
14
  import { translations } from './translations';
13
- import { ChessAction, ChessType } from './types';
15
+ import { Chess } from './types';
14
16
 
15
- export const ChessPlugin = () =>
16
- definePlugin(meta, [
17
- defineModule({
18
- id: `${meta.id}/module/translations`,
19
- activatesOn: Events.SetupTranslations,
20
- activate: () => contributes(Capabilities.Translations, translations),
21
- }),
22
- defineModule({
23
- id: `${meta.id}/module/metadata`,
24
- activatesOn: Events.SetupMetadata,
25
- activate: () =>
26
- contributes(Capabilities.Metadata, {
27
- id: ChessType.typename,
28
- metadata: {
29
- icon: 'ph--shield-chevron--regular',
30
- },
31
- }),
32
- }),
33
- defineModule({
34
- id: `${meta.id}/module/object-form`,
35
- activatesOn: ClientEvents.SetupSchema,
36
- activate: () =>
37
- contributes(
38
- SpaceCapabilities.ObjectForm,
39
- defineObjectForm({
40
- objectSchema: ChessType,
41
- getIntent: () => createIntent(ChessAction.Create),
42
- }),
43
- ),
44
- }),
45
- defineModule({
46
- id: `${meta.id}/module/react-surface`,
47
- activatesOn: Events.SetupReactSurface,
48
- activate: ReactSurface,
49
- }),
50
- defineModule({
51
- id: `${meta.id}/module/intent-resolver`,
52
- activatesOn: Events.SetupIntentResolver,
53
- activate: IntentResolver,
54
- }),
55
- defineModule({
56
- id: `${meta.id}/module/artifact-definition`,
57
- activatesOn: Events.SetupArtifactDefinition,
58
- activate: ArtifactDefinition,
59
- }),
60
- ]);
17
+ export const ChessPlugin = Plugin.define(meta).pipe(
18
+ AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),
19
+ AppPlugin.addMetadataModule({
20
+ metadata: {
21
+ id: Chess.Game.typename,
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
+ },
28
+ },
29
+ }),
30
+ AppPlugin.addSchemaModule({ schema: [Chess.Game] }),
31
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
32
+ AppPlugin.addTranslationsModule({ translations }),
33
+ Plugin.make,
34
+ );
@@ -0,0 +1,36 @@
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 { ChessFunctions } from './functions';
10
+
11
+ const BLUEPRINT_KEY = 'org.dxos.blueprint.chess';
12
+
13
+ const functions = Object.values(ChessFunctions);
14
+
15
+ const make = () =>
16
+ Blueprint.make({
17
+ key: BLUEPRINT_KEY,
18
+ name: 'Chess',
19
+ tools: Blueprint.toolDefinitions({ functions }),
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
+ functions,
33
+ make,
34
+ };
35
+
36
+ export default blueprint;
@@ -0,0 +1,38 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import * as Schema from 'effect/Schema';
7
+
8
+ import { Database } from '@dxos/echo';
9
+ import { defineFunction } from '@dxos/functions';
10
+
11
+ import { Chess } from '../../types';
12
+
13
+ export default defineFunction({
14
+ key: 'org.dxos.function.chess.create',
15
+ name: 'Create Chess',
16
+ description: 'Creates a new chess game.',
17
+ inputSchema: Schema.Struct({
18
+ name: Schema.optional(
19
+ Schema.String.annotations({
20
+ description: 'Name of the game.',
21
+ }),
22
+ ),
23
+ pgn: Schema.optional(
24
+ Schema.String.annotations({
25
+ description: 'Portable Game Notation.',
26
+ }),
27
+ ),
28
+ fen: Schema.optional(
29
+ Schema.String.annotations({
30
+ description: 'Forsyth-Edwards Notation.',
31
+ }),
32
+ ),
33
+ }),
34
+ outputSchema: Chess.Game,
35
+ handler: Effect.fn(function* ({ data: { name, pgn, fen } }) {
36
+ return yield* Database.add(Chess.make({ name, pgn, fen }));
37
+ }),
38
+ });
@@ -0,0 +1,17 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import Create from './create';
6
+ import Move from './move';
7
+ import Play from './play';
8
+ import Print from './print';
9
+
10
+ export { Create, Move, Play, Print };
11
+
12
+ export const ChessFunctions = {
13
+ Create,
14
+ Move,
15
+ Play,
16
+ Print,
17
+ };
@@ -0,0 +1,48 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Chess as ChessJS } from 'chess.js';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Schema from 'effect/Schema';
8
+
9
+ import { Database, Obj, Ref } from '@dxos/echo';
10
+ import { defineFunction } from '@dxos/functions';
11
+
12
+ import { Chess } from '../../types';
13
+
14
+ export default defineFunction({
15
+ key: 'org.dxos.function.chess.move',
16
+ name: 'Move',
17
+ description: 'Makes a move in the given chess game.',
18
+ inputSchema: Schema.Struct({
19
+ game: Ref.Ref(Chess.Game).annotations({
20
+ description: 'The ID of the chess object.',
21
+ }),
22
+ move: Schema.String.annotations({
23
+ description: 'The move to make in the chess game.',
24
+ examples: ['e4', 'Bf3'],
25
+ }),
26
+ }),
27
+ outputSchema: Schema.Struct({
28
+ pgn: Schema.String.annotations({
29
+ description: 'The PGN of the game after the move was played.',
30
+ }),
31
+ }),
32
+ handler: Effect.fn(function* ({ data: { game, move } }) {
33
+ const obj = yield* Database.load(game);
34
+ const chess = new ChessJS();
35
+ if (obj.pgn) {
36
+ chess.loadPgn(obj.pgn);
37
+ } else if (obj.fen) {
38
+ chess.load(obj.fen);
39
+ }
40
+
41
+ chess.move(move, { strict: false });
42
+ const pgn = chess.pgn();
43
+ Obj.change(obj, (obj) => {
44
+ obj.pgn = pgn;
45
+ });
46
+ return { pgn };
47
+ }),
48
+ });
@@ -0,0 +1,58 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Chess as ChessJS } from 'chess.js';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Schema from 'effect/Schema';
8
+
9
+ import { Database, Obj, Ref } from '@dxos/echo';
10
+ import { defineFunction } from '@dxos/functions';
11
+
12
+ import { Chess } from '../../types';
13
+
14
+ export default defineFunction({
15
+ key: 'org.dxos.function.chess.play',
16
+ name: 'Play',
17
+ description: 'Uses the chess engine to play the next move.',
18
+ inputSchema: Schema.Struct({
19
+ game: Ref.Ref(Chess.Game).annotations({
20
+ description: 'The ID of the chess object.',
21
+ }),
22
+ side: Schema.optional(Schema.Literal('white', 'black', 'any')).annotations({
23
+ description: 'The side to play.',
24
+ defaultValue: 'any',
25
+ }),
26
+ }),
27
+ outputSchema: Schema.Struct({
28
+ pgn: Schema.String.annotations({
29
+ description: 'The PGN of the game after the move was played.',
30
+ }),
31
+ move: Schema.optional(Schema.String).annotations({
32
+ description: 'The move that was played.',
33
+ }),
34
+ }),
35
+ handler: Effect.fn(function* ({ data: { game, side = 'any' } }) {
36
+ const object = yield* Database.load(game);
37
+ const chess = new ChessJS();
38
+ if (object.pgn) {
39
+ chess.loadPgn(object.pgn);
40
+ } else if (object.fen) {
41
+ chess.load(object.fen);
42
+ }
43
+
44
+ if (!(side === 'any' || (chess.turn() === 'w' && side === 'white') || (chess.turn() === 'b' && side === 'black'))) {
45
+ return { move: undefined, pgn: object.pgn! };
46
+ }
47
+
48
+ const moves = chess.moves();
49
+ const move = moves[Math.floor(Math.random() * moves.length)];
50
+
51
+ chess.move(move, { strict: false });
52
+ const pgn = chess.pgn();
53
+ Obj.change(object, (o) => {
54
+ o.pgn = pgn;
55
+ });
56
+ return { move, pgn };
57
+ }),
58
+ });
@@ -0,0 +1,42 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Chess as ChessJS } from 'chess.js';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Schema from 'effect/Schema';
8
+
9
+ import { defineFunction } from '@dxos/functions';
10
+
11
+ export default defineFunction({
12
+ key: 'org.dxos.function.chess.print',
13
+ name: 'Print game',
14
+ description: 'Prints the chess game to ASCII.',
15
+ inputSchema: Schema.Struct({
16
+ pgn: Schema.optional(
17
+ Schema.String.annotations({
18
+ description: 'Portable Game Notation.',
19
+ }),
20
+ ),
21
+ fen: Schema.optional(
22
+ Schema.String.annotations({
23
+ description: 'Forsyth-Edwards Notation.',
24
+ }),
25
+ ),
26
+ }),
27
+ outputSchema: Schema.Struct({
28
+ ascii: Schema.String,
29
+ }),
30
+ handler: Effect.fn(function* ({ data: { pgn, fen } }) {
31
+ try {
32
+ const chess = new ChessJS(fen);
33
+ if (pgn) {
34
+ chess.loadPgn(pgn);
35
+ }
36
+ return { ascii: chess.ascii() };
37
+ } catch {
38
+ // TODO(burdon): Error handling?
39
+ return { ascii: '' };
40
+ }
41
+ }),
42
+ });
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { default as ChessBlueprint } from './chess-blueprint';
6
+ export * as ChessFunctions from './functions';
@@ -0,0 +1,135 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // ISSUE(burdon): defineArtifact
6
+ // @ts-nocheck
7
+
8
+ import { Chess as ChessJS } from 'chess.js';
9
+ import * as Effect from 'effect/Effect';
10
+ import * as Schema from 'effect/Schema';
11
+
12
+ import { ToolResult, createTool } from '@dxos/ai';
13
+ import { Capabilities, Capability, type PromiseIntentDispatcher } from '@dxos/app-framework';
14
+ import { ArtifactId, VersionPin, createArtifactElement } from '@dxos/assistant';
15
+ import { defineArtifact } from '@dxos/blueprints';
16
+ import { Obj } from '@dxos/echo';
17
+ import { invariant } from '@dxos/invariant';
18
+ import { SpaceOperation } from '@dxos/plugin-space/types';
19
+ import { Filter, type Space } from '@dxos/react-client/echo';
20
+ import { trim } from '@dxos/util';
21
+
22
+ import { meta } from '../../meta';
23
+ import { Chess } from '../../types';
24
+
25
+ // TODO(burdon): Factor out.
26
+ declare global {
27
+ interface ToolContextExtensions {
28
+ space?: Space;
29
+ dispatch?: PromiseIntentDispatcher;
30
+ }
31
+ }
32
+
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`
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.
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.
42
+ `,
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');
55
+
56
+ const game = Chess.make({ pgn });
57
+
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
+ }
65
+
66
+ return ToolResult.Success(createArtifactElement(game.id), [
67
+ VersionPin.createBlock(VersionPin.fromObject(game)),
68
+ ]);
69
+ },
70
+ }),
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');
80
+
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));
95
+
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, (g) => {
125
+ g.pgn = chess.pgn();
126
+ });
127
+ return ToolResult.Success(game.pgn);
128
+ },
129
+ }),
130
+ ],
131
+ });
132
+
133
+ return Capability.contributes(Capabilities.ArtifactDefinition, definition);
134
+ }),
135
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ArtifactDefinition = Capability.lazy('ArtifactDefinition', () => import('./artifact-definition'));
@@ -0,0 +1,17 @@
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
+
10
+ import { ChessBlueprint } from '../../blueprints';
11
+
12
+ const blueprintDefinition = Capability.makeModule<
13
+ [],
14
+ Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
15
+ >(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, ChessBlueprint)]));
16
+
17
+ export default blueprintDefinition;
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
@@ -2,8 +2,5 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
6
-
7
- export const ArtifactDefinition = lazy(() => import('./artifact-definition'));
8
- export const IntentResolver = lazy(() => import('./intent-resolver'));
9
- export const ReactSurface = lazy(() => import('./react-surface'));
5
+ export * from './blueprint-definition';
6
+ export * from './react-surface';
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));