@dxos/plugin-chess 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae

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 (226) hide show
  1. package/dist/lib/browser/ChessArticle-RI2DYAO4.mjs +59 -0
  2. package/dist/lib/browser/ChessArticle-RI2DYAO4.mjs.map +7 -0
  3. package/dist/lib/browser/ChessCard-AUMESHHE.mjs +21 -0
  4. package/dist/lib/browser/ChessCard-AUMESHHE.mjs.map +7 -0
  5. package/dist/lib/browser/blueprint-definition-RLA7PQBB.mjs +18 -0
  6. package/dist/lib/browser/blueprint-definition-RLA7PQBB.mjs.map +7 -0
  7. package/dist/lib/browser/blueprints/index.mjs +11 -0
  8. package/dist/lib/browser/{chunk-M63HYNXU.mjs → chunk-66H3V2YV.mjs} +18 -38
  9. package/dist/lib/browser/chunk-66H3V2YV.mjs.map +7 -0
  10. package/dist/lib/browser/chunk-AWDLDU43.mjs +231 -0
  11. package/dist/lib/browser/chunk-AWDLDU43.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-WSUUPPDK.mjs → chunk-H3NUMCQ6.mjs} +4 -9
  13. package/dist/lib/browser/chunk-H3NUMCQ6.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  15. package/dist/lib/browser/chunk-KE4FN77G.mjs +276 -0
  16. package/dist/lib/browser/chunk-KE4FN77G.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/cli/index.mjs +29 -0
  20. package/dist/lib/browser/cli/index.mjs.map +7 -0
  21. package/dist/lib/browser/index.mjs +47 -76
  22. package/dist/lib/browser/index.mjs.map +4 -4
  23. package/dist/lib/browser/meta.json +1 -1
  24. package/dist/lib/browser/react-surface-7KUFGD7C.mjs +50 -0
  25. package/dist/lib/browser/react-surface-7KUFGD7C.mjs.map +7 -0
  26. package/dist/lib/browser/types/index.mjs +3 -5
  27. package/dist/lib/node-esm/ChessArticle-6QNVYEZV.mjs +60 -0
  28. package/dist/lib/node-esm/ChessArticle-6QNVYEZV.mjs.map +7 -0
  29. package/dist/lib/node-esm/ChessCard-QK3ZMYLT.mjs +22 -0
  30. package/dist/lib/node-esm/ChessCard-QK3ZMYLT.mjs.map +7 -0
  31. package/dist/lib/node-esm/blueprint-definition-A2FFH3Z2.mjs +19 -0
  32. package/dist/lib/node-esm/blueprint-definition-A2FFH3Z2.mjs.map +7 -0
  33. package/dist/lib/node-esm/blueprints/index.mjs +12 -0
  34. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  35. package/dist/lib/node-esm/chunk-7XDEO6IJ.mjs +2 -0
  36. package/dist/lib/node-esm/chunk-7XDEO6IJ.mjs.map +7 -0
  37. package/dist/lib/node-esm/{chunk-5C2OYL2B.mjs → chunk-F5OMIM4F.mjs} +4 -8
  38. package/dist/lib/node-esm/chunk-F5OMIM4F.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  40. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  41. package/dist/lib/node-esm/{chunk-7YK5RFHY.mjs → chunk-OUNGNJFP.mjs} +18 -38
  42. package/dist/lib/node-esm/chunk-OUNGNJFP.mjs.map +7 -0
  43. package/dist/lib/node-esm/chunk-R7FXSQ2P.mjs +232 -0
  44. package/dist/lib/node-esm/chunk-R7FXSQ2P.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-RNPP75JE.mjs +277 -0
  46. package/dist/lib/node-esm/chunk-RNPP75JE.mjs.map +7 -0
  47. package/dist/lib/node-esm/cli/index.mjs +30 -0
  48. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  49. package/dist/lib/node-esm/index.mjs +47 -76
  50. package/dist/lib/node-esm/index.mjs.map +4 -4
  51. package/dist/lib/node-esm/meta.json +1 -1
  52. package/dist/lib/node-esm/react-surface-U3HGYR5T.mjs +51 -0
  53. package/dist/lib/node-esm/react-surface-U3HGYR5T.mjs.map +7 -0
  54. package/dist/lib/node-esm/types/index.mjs +3 -5
  55. package/dist/types/src/ChessPlugin.d.ts +2 -1
  56. package/dist/types/src/ChessPlugin.d.ts.map +1 -1
  57. package/dist/types/src/blueprints/chess-blueprint.d.ts +4 -0
  58. package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -0
  59. package/dist/types/src/blueprints/functions/create.d.ts +15 -0
  60. package/dist/types/src/blueprints/functions/create.d.ts.map +1 -0
  61. package/dist/types/src/blueprints/functions/index.d.ts +56 -0
  62. package/dist/types/src/blueprints/functions/index.d.ts.map +1 -0
  63. package/dist/types/src/blueprints/functions/move.d.ts +16 -0
  64. package/dist/types/src/blueprints/functions/move.d.ts.map +1 -0
  65. package/dist/types/src/blueprints/functions/play.d.ts +17 -0
  66. package/dist/types/src/blueprints/functions/play.d.ts.map +1 -0
  67. package/dist/types/src/blueprints/functions/print.d.ts +8 -0
  68. package/dist/types/src/blueprints/functions/print.d.ts.map +1 -0
  69. package/dist/types/src/blueprints/index.d.ts +3 -0
  70. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  71. package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +12 -0
  72. package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +1 -0
  73. package/dist/types/src/capabilities/artifact-definition/index.d.ts +3 -0
  74. package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +1 -0
  75. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +6 -0
  76. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
  78. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/index.d.ts +1 -3
  80. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  81. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  82. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  83. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  84. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  85. package/dist/types/src/cli/index.d.ts +2 -0
  86. package/dist/types/src/cli/index.d.ts.map +1 -0
  87. package/dist/types/src/cli/plugin.d.ts +3 -0
  88. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  89. package/dist/types/src/components/{Chessboard.d.ts → Chessboard/Chessboard.d.ts} +3 -7
  90. package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -0
  91. package/dist/types/src/components/{Info.d.ts → Chessboard/Info.d.ts} +1 -1
  92. package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -0
  93. package/dist/types/src/components/Chessboard/index.d.ts +2 -0
  94. package/dist/types/src/components/Chessboard/index.d.ts.map +1 -0
  95. package/dist/types/src/components/Chessboard/types.d.ts +8 -0
  96. package/dist/types/src/components/Chessboard/types.d.ts.map +1 -0
  97. package/dist/types/src/components/index.d.ts +0 -1
  98. package/dist/types/src/components/index.d.ts.map +1 -1
  99. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +6 -0
  100. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
  101. package/dist/types/src/{components/Chessboard.stories.d.ts → containers/ChessArticle/ChessArticle.stories.d.ts} +8 -6
  102. package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -0
  103. package/dist/types/src/containers/ChessArticle/index.d.ts +3 -0
  104. package/dist/types/src/containers/ChessArticle/index.d.ts.map +1 -0
  105. package/dist/types/src/containers/ChessCard/ChessCard.d.ts +6 -0
  106. package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -0
  107. package/dist/types/src/{components/Card.stories.d.ts → containers/ChessCard/ChessCard.stories.d.ts} +2 -9
  108. package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -0
  109. package/dist/types/src/containers/ChessCard/index.d.ts +3 -0
  110. package/dist/types/src/containers/ChessCard/index.d.ts.map +1 -0
  111. package/dist/types/src/containers/index.d.ts +4 -0
  112. package/dist/types/src/containers/index.d.ts.map +1 -0
  113. package/dist/types/src/index.d.ts +2 -2
  114. package/dist/types/src/index.d.ts.map +1 -1
  115. package/dist/types/src/meta.d.ts +2 -2
  116. package/dist/types/src/meta.d.ts.map +1 -1
  117. package/dist/types/src/translations.d.ts +1 -0
  118. package/dist/types/src/translations.d.ts.map +1 -1
  119. package/dist/types/src/types/Chess.d.ts +18 -18
  120. package/dist/types/src/types/Chess.d.ts.map +1 -1
  121. package/dist/types/src/types/index.d.ts +0 -1
  122. package/dist/types/src/types/index.d.ts.map +1 -1
  123. package/dist/types/tsconfig.tsbuildinfo +1 -1
  124. package/package.json +59 -43
  125. package/src/ChessPlugin.tsx +26 -51
  126. package/src/blueprints/chess-blueprint.ts +36 -0
  127. package/src/{functions → blueprints/functions}/create.ts +10 -4
  128. package/src/blueprints/functions/index.ts +17 -0
  129. package/src/{functions → blueprints/functions}/move.ts +15 -12
  130. package/src/{functions → blueprints/functions}/play.ts +11 -8
  131. package/src/blueprints/functions/print.ts +42 -0
  132. package/src/blueprints/index.ts +6 -0
  133. package/src/capabilities/artifact-definition/artifact-definition.ts +135 -0
  134. package/src/capabilities/artifact-definition/index.ts +7 -0
  135. package/src/capabilities/blueprint-definition/blueprint-definition.ts +17 -0
  136. package/src/capabilities/blueprint-definition/index.ts +7 -0
  137. package/src/capabilities/index.ts +1 -6
  138. package/src/capabilities/react-surface/index.ts +7 -0
  139. package/src/capabilities/react-surface/react-surface.tsx +33 -0
  140. package/src/cli/index.ts +5 -0
  141. package/src/cli/plugin.ts +27 -0
  142. package/src/components/{Chessboard.tsx → Chessboard/Chessboard.tsx} +35 -26
  143. package/src/components/{Info.tsx → Chessboard/Info.tsx} +27 -17
  144. package/src/components/Chessboard/index.ts +5 -0
  145. package/src/components/Chessboard/types.ts +18 -0
  146. package/src/components/index.ts +1 -5
  147. package/src/containers/ChessArticle/ChessArticle.stories.tsx +53 -0
  148. package/src/containers/ChessArticle/ChessArticle.tsx +72 -0
  149. package/src/containers/ChessArticle/index.ts +7 -0
  150. package/src/containers/ChessCard/ChessCard.stories.tsx +42 -0
  151. package/src/containers/ChessCard/ChessCard.tsx +22 -0
  152. package/src/containers/ChessCard/index.ts +7 -0
  153. package/src/containers/index.ts +8 -0
  154. package/src/index.ts +2 -2
  155. package/src/meta.ts +5 -3
  156. package/src/translations.ts +1 -0
  157. package/src/types/Chess.ts +22 -30
  158. package/src/types/index.ts +0 -1
  159. package/dist/lib/browser/ChessboardContainer-OX6TILWD.mjs +0 -96
  160. package/dist/lib/browser/ChessboardContainer-OX6TILWD.mjs.map +0 -7
  161. package/dist/lib/browser/blueprint-definition-UVRFUJYE.mjs +0 -11
  162. package/dist/lib/browser/chunk-E5NQWXQ7.mjs +0 -306
  163. package/dist/lib/browser/chunk-E5NQWXQ7.mjs.map +0 -7
  164. package/dist/lib/browser/chunk-KQOVCG7Z.mjs +0 -8
  165. package/dist/lib/browser/chunk-KQOVCG7Z.mjs.map +0 -7
  166. package/dist/lib/browser/chunk-M63HYNXU.mjs.map +0 -7
  167. package/dist/lib/browser/chunk-VA5TW6SD.mjs +0 -169
  168. package/dist/lib/browser/chunk-VA5TW6SD.mjs.map +0 -7
  169. package/dist/lib/browser/chunk-WSUUPPDK.mjs.map +0 -7
  170. package/dist/lib/browser/intent-resolver-OQPSVFOB.mjs +0 -25
  171. package/dist/lib/browser/intent-resolver-OQPSVFOB.mjs.map +0 -7
  172. package/dist/lib/browser/react-surface-OLAZCU2E.mjs +0 -38
  173. package/dist/lib/browser/react-surface-OLAZCU2E.mjs.map +0 -7
  174. package/dist/lib/node-esm/ChessboardContainer-PGDHBG6F.mjs +0 -97
  175. package/dist/lib/node-esm/ChessboardContainer-PGDHBG6F.mjs.map +0 -7
  176. package/dist/lib/node-esm/blueprint-definition-Z47C4EEX.mjs +0 -12
  177. package/dist/lib/node-esm/chunk-5C2OYL2B.mjs.map +0 -7
  178. package/dist/lib/node-esm/chunk-7YK5RFHY.mjs.map +0 -7
  179. package/dist/lib/node-esm/chunk-C55L2OCJ.mjs +0 -10
  180. package/dist/lib/node-esm/chunk-C55L2OCJ.mjs.map +0 -7
  181. package/dist/lib/node-esm/chunk-DWGG7IGH.mjs +0 -307
  182. package/dist/lib/node-esm/chunk-DWGG7IGH.mjs.map +0 -7
  183. package/dist/lib/node-esm/chunk-SW5N5XNV.mjs +0 -170
  184. package/dist/lib/node-esm/chunk-SW5N5XNV.mjs.map +0 -7
  185. package/dist/lib/node-esm/intent-resolver-KVGTUDXJ.mjs +0 -26
  186. package/dist/lib/node-esm/intent-resolver-KVGTUDXJ.mjs.map +0 -7
  187. package/dist/lib/node-esm/react-surface-FIKCDZ5L.mjs +0 -39
  188. package/dist/lib/node-esm/react-surface-FIKCDZ5L.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/blueprint-definition.d.ts +0 -6
  192. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
  193. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  194. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  195. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  196. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  197. package/dist/types/src/components/Card.stories.d.ts.map +0 -1
  198. package/dist/types/src/components/Chessboard.d.ts.map +0 -1
  199. package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
  200. package/dist/types/src/components/ChessboardArticle.d.ts +0 -7
  201. package/dist/types/src/components/ChessboardArticle.d.ts.map +0 -1
  202. package/dist/types/src/components/ChessboardContainer.d.ts +0 -9
  203. package/dist/types/src/components/ChessboardContainer.d.ts.map +0 -1
  204. package/dist/types/src/components/Info.d.ts.map +0 -1
  205. package/dist/types/src/functions/create.d.ts +0 -14
  206. package/dist/types/src/functions/create.d.ts.map +0 -1
  207. package/dist/types/src/functions/index.d.ts +0 -4
  208. package/dist/types/src/functions/index.d.ts.map +0 -1
  209. package/dist/types/src/functions/move.d.ts +0 -8
  210. package/dist/types/src/functions/move.d.ts.map +0 -1
  211. package/dist/types/src/functions/play.d.ts +0 -9
  212. package/dist/types/src/functions/play.d.ts.map +0 -1
  213. package/dist/types/src/types/ChessAction.d.ts +0 -24
  214. package/dist/types/src/types/ChessAction.d.ts.map +0 -1
  215. package/src/capabilities/artifact-definition.ts +0 -129
  216. package/src/capabilities/blueprint-definition.ts +0 -36
  217. package/src/capabilities/intent-resolver.ts +0 -22
  218. package/src/capabilities/react-surface.tsx +0 -23
  219. package/src/components/Card.stories.tsx +0 -66
  220. package/src/components/Chessboard.stories.tsx +0 -49
  221. package/src/components/ChessboardArticle.tsx +0 -69
  222. package/src/components/ChessboardContainer.tsx +0 -44
  223. package/src/functions/index.ts +0 -7
  224. package/src/types/ChessAction.ts +0 -19
  225. /package/dist/lib/browser/{blueprint-definition-UVRFUJYE.mjs.map → blueprints/index.mjs.map} +0 -0
  226. /package/dist/lib/{node-esm/blueprint-definition-Z47C4EEX.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@dxos/plugin-chess",
3
- "version": "0.8.4-main.c4373fc",
3
+ "version": "0.8.4-main.c85a9c8dae",
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,
@@ -15,17 +19,23 @@
15
19
  "browser": "./dist/lib/browser/index.mjs",
16
20
  "node": "./dist/lib/node-esm/index.mjs"
17
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"
33
+ },
18
34
  "./types": {
19
35
  "source": "./src/types/index.ts",
20
36
  "types": "./dist/types/src/types/index.d.ts",
21
37
  "browser": "./dist/lib/browser/types/index.mjs",
22
38
  "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
39
  }
30
40
  },
31
41
  "types": "dist/types/src/index.d.ts",
@@ -41,47 +51,53 @@
41
51
  "src"
42
52
  ],
43
53
  "dependencies": {
44
- "@preact-signals/safe-react": "^0.9.0",
45
- "@preact/signals-core": "^1.12.1",
54
+ "@automerge/automerge": "3.2.3",
55
+ "@effect-atom/atom-react": "^0.5.0",
46
56
  "chess.js": "^1.0.0",
47
- "effect": "3.18.3",
48
- "@dxos/ai": "0.8.4-main.c4373fc",
49
- "@dxos/app-framework": "0.8.4-main.c4373fc",
50
- "@dxos/blueprints": "0.8.4-main.c4373fc",
51
- "@dxos/assistant": "0.8.4-main.c4373fc",
52
- "@dxos/async": "0.8.4-main.c4373fc",
53
- "@dxos/display-name": "0.8.4-main.c4373fc",
54
- "@dxos/echo": "0.8.4-main.c4373fc",
55
- "@dxos/functions": "0.8.4-main.c4373fc",
56
- "@dxos/live-object": "0.8.4-main.c4373fc",
57
- "@dxos/invariant": "0.8.4-main.c4373fc",
58
- "@dxos/plugin-client": "0.8.4-main.c4373fc",
59
- "@dxos/plugin-graph": "0.8.4-main.c4373fc",
60
- "@dxos/plugin-space": "0.8.4-main.c4373fc",
61
- "@dxos/react-client": "0.8.4-main.c4373fc",
62
- "@dxos/log": "0.8.4-main.c4373fc",
63
- "@dxos/react-ui-gameboard": "0.8.4-main.c4373fc",
64
- "@dxos/react-ui-sfx": "0.8.4-main.c4373fc",
65
- "@dxos/react-ui-stack": "0.8.4-main.c4373fc",
66
- "@dxos/schema": "0.8.4-main.c4373fc",
67
- "@dxos/util": "0.8.4-main.c4373fc"
57
+ "effect": "3.19.16",
58
+ "@dxos/ai": "0.8.4-main.c85a9c8dae",
59
+ "@dxos/app-framework": "0.8.4-main.c85a9c8dae",
60
+ "@dxos/app-toolkit": "0.8.4-main.c85a9c8dae",
61
+ "@dxos/async": "0.8.4-main.c85a9c8dae",
62
+ "@dxos/blueprints": "0.8.4-main.c85a9c8dae",
63
+ "@dxos/assistant": "0.8.4-main.c85a9c8dae",
64
+ "@dxos/display-name": "0.8.4-main.c85a9c8dae",
65
+ "@dxos/echo-db": "0.8.4-main.c85a9c8dae",
66
+ "@dxos/echo": "0.8.4-main.c85a9c8dae",
67
+ "@dxos/echo-react": "0.8.4-main.c85a9c8dae",
68
+ "@dxos/functions": "0.8.4-main.c85a9c8dae",
69
+ "@dxos/invariant": "0.8.4-main.c85a9c8dae",
70
+ "@dxos/operation": "0.8.4-main.c85a9c8dae",
71
+ "@dxos/log": "0.8.4-main.c85a9c8dae",
72
+ "@dxos/plugin-graph": "0.8.4-main.c85a9c8dae",
73
+ "@dxos/plugin-markdown": "0.8.4-main.c85a9c8dae",
74
+ "@dxos/react-client": "0.8.4-main.c85a9c8dae",
75
+ "@dxos/react-ui-gameboard": "0.8.4-main.c85a9c8dae",
76
+ "@dxos/plugin-space": "0.8.4-main.c85a9c8dae",
77
+ "@dxos/react-ui-mosaic": "0.8.4-main.c85a9c8dae",
78
+ "@dxos/react-ui-sfx": "0.8.4-main.c85a9c8dae",
79
+ "@dxos/react-ui-stack": "0.8.4-main.c85a9c8dae",
80
+ "@dxos/schema": "0.8.4-main.c85a9c8dae",
81
+ "@dxos/types": "0.8.4-main.c85a9c8dae",
82
+ "@dxos/util": "0.8.4-main.c85a9c8dae",
83
+ "@dxos/plugin-client": "0.8.4-main.c85a9c8dae"
68
84
  },
69
85
  "devDependencies": {
70
- "@types/react": "~19.2.2",
71
- "@types/react-dom": "~19.2.1",
72
- "react": "~19.2.0",
73
- "react-dom": "~19.2.0",
74
- "vite": "7.1.9",
75
- "@dxos/plugin-theme": "0.8.4-main.c4373fc",
76
- "@dxos/react-ui": "0.8.4-main.c4373fc",
77
- "@dxos/react-ui-theme": "0.8.4-main.c4373fc",
78
- "@dxos/storybook-utils": "0.8.4-main.c4373fc"
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.c85a9c8dae",
92
+ "@dxos/react-ui": "0.8.4-main.c85a9c8dae",
93
+ "@dxos/storybook-utils": "0.8.4-main.c85a9c8dae",
94
+ "@dxos/ui-theme": "0.8.4-main.c85a9c8dae"
79
95
  },
80
96
  "peerDependencies": {
81
- "react": "^19.0.0",
82
- "react-dom": "^19.0.0",
83
- "@dxos/react-ui": "0.8.4-main.c4373fc",
84
- "@dxos/react-ui-theme": "0.8.4-main.c4373fc"
97
+ "react": "~19.2.3",
98
+ "react-dom": "~19.2.3",
99
+ "@dxos/react-ui": "0.8.4-main.c85a9c8dae",
100
+ "@dxos/ui-theme": "0.8.4-main.c85a9c8dae"
85
101
  },
86
102
  "publishConfig": {
87
103
  "access": "public"
@@ -2,59 +2,34 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } 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 { BLUEPRINT_KEY, BlueprintDefinition, 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 { Chess, ChessAction } from './types';
15
+ import { Chess } from './types';
14
16
 
15
- export const ChessPlugin = definePlugin(meta, () => [
16
- defineModule({
17
- id: `${meta.id}/module/translations`,
18
- activatesOn: Events.SetupTranslations,
19
- activate: () => contributes(Capabilities.Translations, translations),
20
- }),
21
- defineModule({
22
- id: `${meta.id}/module/metadata`,
23
- activatesOn: Events.SetupMetadata,
24
- activate: () =>
25
- contributes(Capabilities.Metadata, {
26
- id: Chess.Game.typename,
27
- metadata: {
28
- icon: 'ph--shield-chevron--regular',
29
- blueprints: [BLUEPRINT_KEY],
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: Chess.Game,
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/blueprint`,
57
- activatesOn: Events.SetupArtifactDefinition,
58
- activate: BlueprintDefinition,
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
+ addToCollectionOnCreate: true,
28
+ },
29
+ },
59
30
  }),
60
- ]);
31
+ AppPlugin.addSchemaModule({ schema: [Chess.Game] }),
32
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
33
+ AppPlugin.addTranslationsModule({ translations }),
34
+ Plugin.make,
35
+ );
@@ -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 = 'dxos.org/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;
@@ -5,15 +5,21 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
  import * as Schema from 'effect/Schema';
7
7
 
8
- import { DatabaseService, defineFunction } from '@dxos/functions';
8
+ import { Database } from '@dxos/echo';
9
+ import { defineFunction } from '@dxos/functions';
9
10
 
10
- import { Chess } from '../types';
11
+ import { Chess } from '../../types';
11
12
 
12
13
  export default defineFunction({
13
14
  key: 'dxos.org/function/chess/create',
14
15
  name: 'Create Chess',
15
16
  description: 'Creates a new chess game.',
16
17
  inputSchema: Schema.Struct({
18
+ name: Schema.optional(
19
+ Schema.String.annotations({
20
+ description: 'Name of the game.',
21
+ }),
22
+ ),
17
23
  pgn: Schema.optional(
18
24
  Schema.String.annotations({
19
25
  description: 'Portable Game Notation.',
@@ -26,7 +32,7 @@ export default defineFunction({
26
32
  ),
27
33
  }),
28
34
  outputSchema: Chess.Game,
29
- handler: Effect.fn(function* ({ data: { pgn, fen } }) {
30
- return yield* DatabaseService.add(Chess.makeGame({ pgn, fen }));
35
+ handler: Effect.fn(function* ({ data: { name, pgn, fen } }) {
36
+ return yield* Database.add(Chess.make({ name, pgn, fen }));
31
37
  }),
32
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
+ };
@@ -6,17 +6,17 @@ import { Chess as ChessJS } from 'chess.js';
6
6
  import * as Effect from 'effect/Effect';
7
7
  import * as Schema from 'effect/Schema';
8
8
 
9
- import { ArtifactId } from '@dxos/assistant';
10
- import { DatabaseService, defineFunction } from '@dxos/functions';
9
+ import { Database, Obj, Ref } from '@dxos/echo';
10
+ import { defineFunction } from '@dxos/functions';
11
11
 
12
- import { Chess } from '../types';
12
+ import { Chess } from '../../types';
13
13
 
14
14
  export default defineFunction({
15
15
  key: 'dxos.org/function/chess/move',
16
16
  name: 'Move',
17
17
  description: 'Makes a move in the given chess game.',
18
18
  inputSchema: Schema.Struct({
19
- id: ArtifactId.annotations({
19
+ game: Ref.Ref(Chess.Game).annotations({
20
20
  description: 'The ID of the chess object.',
21
21
  }),
22
22
  move: Schema.String.annotations({
@@ -29,17 +29,20 @@ export default defineFunction({
29
29
  description: 'The PGN of the game after the move was played.',
30
30
  }),
31
31
  }),
32
- handler: Effect.fn(function* ({ data: { id, move } }) {
33
- const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Chess.Game);
32
+ handler: Effect.fn(function* ({ data: { game, move } }) {
33
+ const obj = yield* Database.load(game);
34
34
  const chess = new ChessJS();
35
- if (object.pgn) {
36
- chess.loadPgn(object.pgn);
37
- } else if (object.fen) {
38
- chess.load(object.fen);
35
+ if (obj.pgn) {
36
+ chess.loadPgn(obj.pgn);
37
+ } else if (obj.fen) {
38
+ chess.load(obj.fen);
39
39
  }
40
40
 
41
41
  chess.move(move, { strict: false });
42
- object.pgn = chess.pgn();
43
- return { pgn: object.pgn };
42
+ const pgn = chess.pgn();
43
+ Obj.change(obj, (obj) => {
44
+ obj.pgn = pgn;
45
+ });
46
+ return { pgn };
44
47
  }),
45
48
  });
@@ -6,17 +6,17 @@ import { Chess as ChessJS } from 'chess.js';
6
6
  import * as Effect from 'effect/Effect';
7
7
  import * as Schema from 'effect/Schema';
8
8
 
9
- import { ArtifactId } from '@dxos/assistant';
10
- import { DatabaseService, defineFunction } from '@dxos/functions';
9
+ import { Database, Obj, Ref } from '@dxos/echo';
10
+ import { defineFunction } from '@dxos/functions';
11
11
 
12
- import { Chess } from '../types';
12
+ import { Chess } from '../../types';
13
13
 
14
14
  export default defineFunction({
15
15
  key: 'dxos.org/function/chess/play',
16
16
  name: 'Play',
17
17
  description: 'Uses the chess engine to play the next move.',
18
18
  inputSchema: Schema.Struct({
19
- id: ArtifactId.annotations({
19
+ game: Ref.Ref(Chess.Game).annotations({
20
20
  description: 'The ID of the chess object.',
21
21
  }),
22
22
  side: Schema.optional(Schema.Literal('white', 'black', 'any')).annotations({
@@ -32,8 +32,8 @@ export default defineFunction({
32
32
  description: 'The move that was played.',
33
33
  }),
34
34
  }),
35
- handler: Effect.fn(function* ({ data: { id, side = 'any' } }) {
36
- const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Chess.Game);
35
+ handler: Effect.fn(function* ({ data: { game, side = 'any' } }) {
36
+ const object = yield* Database.load(game);
37
37
  const chess = new ChessJS();
38
38
  if (object.pgn) {
39
39
  chess.loadPgn(object.pgn);
@@ -49,7 +49,10 @@ export default defineFunction({
49
49
  const move = moves[Math.floor(Math.random() * moves.length)];
50
50
 
51
51
  chess.move(move, { strict: false });
52
- object.pgn = chess.pgn();
53
- return { move, pgn: object.pgn };
52
+ const pgn = chess.pgn();
53
+ Obj.change(object, (o) => {
54
+ o.pgn = pgn;
55
+ });
56
+ return { move, pgn };
54
57
  }),
55
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: 'dxos.org/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,10 +2,5 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
6
-
7
- export const BlueprintDefinition = lazy(() => import('./blueprint-definition'));
8
- export const IntentResolver = lazy(() => import('./intent-resolver'));
9
- export const ReactSurface = lazy(() => import('./react-surface'));
10
-
11
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'));