@dxos/plugin-chess 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5

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 (233) hide show
  1. package/dist/lib/browser/blueprints/index.mjs +14 -0
  2. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-2TJN26DN.mjs +67 -0
  4. package/dist/lib/browser/chunk-2TJN26DN.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  6. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-JZMN24DY.mjs +28 -0
  8. package/dist/lib/browser/chunk-JZMN24DY.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-MC7L6JNC.mjs +36 -0
  10. package/dist/lib/browser/chunk-MC7L6JNC.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-XAJZK6Z2.mjs +110 -0
  12. package/dist/lib/browser/chunk-XAJZK6Z2.mjs.map +7 -0
  13. package/dist/lib/browser/cli/index.mjs +34 -0
  14. package/dist/lib/browser/cli/index.mjs.map +7 -0
  15. package/dist/lib/browser/create-AJHN4QT4.mjs +24 -0
  16. package/dist/lib/browser/create-AJHN4QT4.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +364 -91
  18. package/dist/lib/browser/index.mjs.map +4 -4
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/move-T2NLRBR4.mjs +36 -0
  21. package/dist/lib/browser/move-T2NLRBR4.mjs.map +7 -0
  22. package/dist/lib/browser/operations/index.mjs +19 -0
  23. package/dist/lib/browser/operations/index.mjs.map +7 -0
  24. package/dist/lib/browser/play-7VTMD3SJ.mjs +45 -0
  25. package/dist/lib/browser/play-7VTMD3SJ.mjs.map +7 -0
  26. package/dist/lib/browser/print-EW7LPW4D.mjs +30 -0
  27. package/dist/lib/browser/print-EW7LPW4D.mjs.map +7 -0
  28. package/dist/lib/browser/types/index.mjs +3 -5
  29. package/dist/lib/node-esm/blueprints/index.mjs +15 -0
  30. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  31. package/dist/lib/node-esm/chunk-4HZWCKMR.mjs +38 -0
  32. package/dist/lib/node-esm/chunk-4HZWCKMR.mjs.map +7 -0
  33. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  34. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  35. package/dist/lib/node-esm/chunk-LQEDIKCV.mjs +29 -0
  36. package/dist/lib/node-esm/chunk-LQEDIKCV.mjs.map +7 -0
  37. package/dist/lib/node-esm/chunk-NYU5JVXP.mjs +111 -0
  38. package/dist/lib/node-esm/chunk-NYU5JVXP.mjs.map +7 -0
  39. package/dist/lib/node-esm/{chunk-LCCUF5X5.mjs → chunk-OIRJVY2R.mjs} +26 -38
  40. package/dist/lib/node-esm/chunk-OIRJVY2R.mjs.map +7 -0
  41. package/dist/lib/node-esm/cli/index.mjs +35 -0
  42. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  43. package/dist/lib/node-esm/create-QSETDT4N.mjs +25 -0
  44. package/dist/lib/node-esm/create-QSETDT4N.mjs.map +7 -0
  45. package/dist/lib/node-esm/index.mjs +364 -91
  46. package/dist/lib/node-esm/index.mjs.map +4 -4
  47. package/dist/lib/node-esm/meta.json +1 -1
  48. package/dist/lib/node-esm/move-5F2ANDTE.mjs +37 -0
  49. package/dist/lib/node-esm/move-5F2ANDTE.mjs.map +7 -0
  50. package/dist/lib/node-esm/operations/index.mjs +20 -0
  51. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  52. package/dist/lib/node-esm/play-W4DQCQRX.mjs +46 -0
  53. package/dist/lib/node-esm/play-W4DQCQRX.mjs.map +7 -0
  54. package/dist/lib/node-esm/print-UJHXAXMS.mjs +31 -0
  55. package/dist/lib/node-esm/print-UJHXAXMS.mjs.map +7 -0
  56. package/dist/lib/node-esm/types/index.mjs +3 -5
  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/ChessPlugin.test.d.ts +2 -0
  60. package/dist/types/src/ChessPlugin.test.d.ts.map +1 -0
  61. package/dist/types/src/blueprints/chess-blueprint.d.ts +4 -0
  62. package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -0
  63. package/dist/types/src/blueprints/index.d.ts +3 -0
  64. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  65. package/dist/types/src/capabilities/artifact-definition.d.ts +3 -2
  66. package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
  67. package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -2
  68. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  69. package/dist/types/src/capabilities/index.d.ts +5 -3
  70. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  71. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  72. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  73. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  74. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  75. package/dist/types/src/cli/index.d.ts +2 -0
  76. package/dist/types/src/cli/index.d.ts.map +1 -0
  77. package/dist/types/src/cli/plugin.d.ts +3 -0
  78. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  79. package/dist/types/src/components/Chessboard/Chessboard.d.ts +34 -0
  80. package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -0
  81. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +48 -0
  82. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -0
  83. package/dist/types/src/components/{ChessboardInfo.d.ts → Chessboard/Info.d.ts} +8 -7
  84. package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -0
  85. package/dist/types/src/components/Chessboard/index.d.ts +2 -0
  86. package/dist/types/src/components/Chessboard/index.d.ts.map +1 -0
  87. package/dist/types/src/components/Chessboard/types.d.ts +8 -0
  88. package/dist/types/src/components/Chessboard/types.d.ts.map +1 -0
  89. package/dist/types/src/components/index.d.ts +0 -1
  90. package/dist/types/src/components/index.d.ts.map +1 -1
  91. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +6 -0
  92. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
  93. package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +47 -0
  94. package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -0
  95. package/dist/types/src/containers/ChessArticle/index.d.ts +2 -0
  96. package/dist/types/src/containers/ChessArticle/index.d.ts.map +1 -0
  97. package/dist/types/src/containers/ChessCard/ChessCard.d.ts +6 -0
  98. package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -0
  99. package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts +15 -0
  100. package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -0
  101. package/dist/types/src/containers/ChessCard/index.d.ts +2 -0
  102. package/dist/types/src/containers/ChessCard/index.d.ts.map +1 -0
  103. package/dist/types/src/containers/index.d.ts +4 -0
  104. package/dist/types/src/containers/index.d.ts.map +1 -0
  105. package/dist/types/src/index.d.ts +2 -3
  106. package/dist/types/src/index.d.ts.map +1 -1
  107. package/dist/types/src/meta.d.ts +2 -3
  108. package/dist/types/src/meta.d.ts.map +1 -1
  109. package/dist/types/src/operations/create.d.ts +5 -0
  110. package/dist/types/src/operations/create.d.ts.map +1 -0
  111. package/dist/types/src/operations/definitions.d.ts +51 -0
  112. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  113. package/dist/types/src/operations/index.d.ts +4 -0
  114. package/dist/types/src/operations/index.d.ts.map +1 -0
  115. package/dist/types/src/operations/move.d.ts +5 -0
  116. package/dist/types/src/operations/move.d.ts.map +1 -0
  117. package/dist/types/src/operations/play.d.ts +5 -0
  118. package/dist/types/src/operations/play.d.ts.map +1 -0
  119. package/dist/types/src/operations/print.d.ts +5 -0
  120. package/dist/types/src/operations/print.d.ts.map +1 -0
  121. package/dist/types/src/translations.d.ts +21 -17
  122. package/dist/types/src/translations.d.ts.map +1 -1
  123. package/dist/types/src/types/Chess.d.ts +20 -17
  124. package/dist/types/src/types/Chess.d.ts.map +1 -1
  125. package/dist/types/src/types/index.d.ts +0 -1
  126. package/dist/types/src/types/index.d.ts.map +1 -1
  127. package/dist/types/tsconfig.tsbuildinfo +1 -1
  128. package/package.json +75 -36
  129. package/src/ChessPlugin.test.ts +65 -0
  130. package/src/ChessPlugin.tsx +42 -53
  131. package/src/blueprints/chess-blueprint.ts +35 -0
  132. package/src/blueprints/index.ts +6 -0
  133. package/src/capabilities/artifact-definition.ts +99 -92
  134. package/src/capabilities/blueprint-definition.ts +10 -27
  135. package/src/capabilities/index.ts +8 -4
  136. package/src/capabilities/operation-handler.ts +14 -0
  137. package/src/capabilities/react-surface.tsx +27 -15
  138. package/src/cli/index.ts +5 -0
  139. package/src/cli/plugin.ts +37 -0
  140. package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
  141. package/src/components/Chessboard/Chessboard.tsx +180 -0
  142. package/src/components/Chessboard/Info.tsx +253 -0
  143. package/src/components/Chessboard/index.ts +5 -0
  144. package/src/components/Chessboard/types.ts +18 -0
  145. package/src/components/index.ts +1 -5
  146. package/src/containers/ChessArticle/ChessArticle.stories.tsx +53 -0
  147. package/src/containers/ChessArticle/ChessArticle.tsx +73 -0
  148. package/src/containers/ChessArticle/index.ts +5 -0
  149. package/src/containers/ChessCard/ChessCard.stories.tsx +42 -0
  150. package/src/containers/ChessCard/ChessCard.tsx +22 -0
  151. package/src/containers/ChessCard/index.ts +5 -0
  152. package/src/containers/index.ts +8 -0
  153. package/src/index.ts +2 -3
  154. package/src/meta.ts +6 -6
  155. package/src/operations/create.ts +21 -0
  156. package/src/operations/definitions.ts +109 -0
  157. package/src/operations/index.ts +16 -0
  158. package/src/operations/move.ts +36 -0
  159. package/src/operations/play.ts +45 -0
  160. package/src/operations/print.ts +28 -0
  161. package/src/translations.ts +21 -17
  162. package/src/types/Chess.ts +29 -23
  163. package/src/types/index.ts +0 -1
  164. package/dist/lib/browser/ChessboardContainer-NNIOQIRP.mjs +0 -90
  165. package/dist/lib/browser/ChessboardContainer-NNIOQIRP.mjs.map +0 -7
  166. package/dist/lib/browser/blueprint-definition-OJQYAZGZ.mjs +0 -38
  167. package/dist/lib/browser/blueprint-definition-OJQYAZGZ.mjs.map +0 -7
  168. package/dist/lib/browser/chunk-2W3S5N6C.mjs +0 -257
  169. package/dist/lib/browser/chunk-2W3S5N6C.mjs.map +0 -7
  170. package/dist/lib/browser/chunk-EJMPHRSR.mjs +0 -94
  171. package/dist/lib/browser/chunk-EJMPHRSR.mjs.map +0 -7
  172. package/dist/lib/browser/chunk-OBJAHY6H.mjs +0 -79
  173. package/dist/lib/browser/chunk-OBJAHY6H.mjs.map +0 -7
  174. package/dist/lib/browser/chunk-PE3IWOFR.mjs +0 -28
  175. package/dist/lib/browser/chunk-PE3IWOFR.mjs.map +0 -7
  176. package/dist/lib/browser/chunk-PPBBLHAC.mjs +0 -8
  177. package/dist/lib/browser/chunk-PPBBLHAC.mjs.map +0 -7
  178. package/dist/lib/browser/intent-resolver-JWKKRNGG.mjs +0 -25
  179. package/dist/lib/browser/intent-resolver-JWKKRNGG.mjs.map +0 -7
  180. package/dist/lib/browser/react-surface-RIXD6RTS.mjs +0 -38
  181. package/dist/lib/browser/react-surface-RIXD6RTS.mjs.map +0 -7
  182. package/dist/lib/node-esm/ChessboardContainer-FCPUV2T2.mjs +0 -91
  183. package/dist/lib/node-esm/ChessboardContainer-FCPUV2T2.mjs.map +0 -7
  184. package/dist/lib/node-esm/blueprint-definition-F5SGHCDA.mjs +0 -39
  185. package/dist/lib/node-esm/blueprint-definition-F5SGHCDA.mjs.map +0 -7
  186. package/dist/lib/node-esm/chunk-42EKKMOO.mjs +0 -10
  187. package/dist/lib/node-esm/chunk-42EKKMOO.mjs.map +0 -7
  188. package/dist/lib/node-esm/chunk-5APYXPBX.mjs +0 -95
  189. package/dist/lib/node-esm/chunk-5APYXPBX.mjs.map +0 -7
  190. package/dist/lib/node-esm/chunk-6OWCPDUA.mjs +0 -29
  191. package/dist/lib/node-esm/chunk-6OWCPDUA.mjs.map +0 -7
  192. package/dist/lib/node-esm/chunk-LCCUF5X5.mjs.map +0 -7
  193. package/dist/lib/node-esm/chunk-QAGOXJGH.mjs +0 -258
  194. package/dist/lib/node-esm/chunk-QAGOXJGH.mjs.map +0 -7
  195. package/dist/lib/node-esm/intent-resolver-G6XJAW6C.mjs +0 -26
  196. package/dist/lib/node-esm/intent-resolver-G6XJAW6C.mjs.map +0 -7
  197. package/dist/lib/node-esm/react-surface-GGRDWZJT.mjs +0 -39
  198. package/dist/lib/node-esm/react-surface-GGRDWZJT.mjs.map +0 -7
  199. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  200. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  201. package/dist/types/src/components/Card.stories.d.ts +0 -49
  202. package/dist/types/src/components/Card.stories.d.ts.map +0 -1
  203. package/dist/types/src/components/Chessboard.d.ts +0 -32
  204. package/dist/types/src/components/Chessboard.d.ts.map +0 -1
  205. package/dist/types/src/components/Chessboard.stories.d.ts +0 -42
  206. package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
  207. package/dist/types/src/components/ChessboardArticle.d.ts +0 -6
  208. package/dist/types/src/components/ChessboardArticle.d.ts.map +0 -1
  209. package/dist/types/src/components/ChessboardContainer.d.ts +0 -9
  210. package/dist/types/src/components/ChessboardContainer.d.ts.map +0 -1
  211. package/dist/types/src/components/ChessboardInfo.d.ts.map +0 -1
  212. package/dist/types/src/components/ChessboardPlayers.d.ts +0 -8
  213. package/dist/types/src/components/ChessboardPlayers.d.ts.map +0 -1
  214. package/dist/types/src/functions/index.d.ts +0 -3
  215. package/dist/types/src/functions/index.d.ts.map +0 -1
  216. package/dist/types/src/functions/move.d.ts +0 -6
  217. package/dist/types/src/functions/move.d.ts.map +0 -1
  218. package/dist/types/src/functions/play.d.ts +0 -8
  219. package/dist/types/src/functions/play.d.ts.map +0 -1
  220. package/dist/types/src/types/ChessAction.d.ts +0 -23
  221. package/dist/types/src/types/ChessAction.d.ts.map +0 -1
  222. package/src/capabilities/intent-resolver.ts +0 -22
  223. package/src/components/Card.stories.tsx +0 -68
  224. package/src/components/Chessboard.stories.tsx +0 -50
  225. package/src/components/Chessboard.tsx +0 -101
  226. package/src/components/ChessboardArticle.tsx +0 -57
  227. package/src/components/ChessboardContainer.tsx +0 -44
  228. package/src/components/ChessboardInfo.tsx +0 -140
  229. package/src/components/ChessboardPlayers.tsx +0 -97
  230. package/src/functions/index.ts +0 -6
  231. package/src/functions/move.ts +0 -43
  232. package/src/functions/play.ts +0 -45
  233. package/src/types/ChessAction.ts +0 -19
package/package.json CHANGED
@@ -1,13 +1,26 @@
1
1
  {
2
2
  "name": "@dxos/plugin-chess",
3
- "version": "0.8.4-main.f5c0578",
3
+ "version": "0.8.4-main.fcfe5033a5",
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,6 +28,24 @@
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",
@@ -35,46 +66,54 @@
35
66
  "src"
36
67
  ],
37
68
  "dependencies": {
38
- "@preact-signals/safe-react": "^0.9.0",
39
- "@preact/signals-core": "^1.9.0",
69
+ "@automerge/automerge": "3.2.3",
70
+ "@effect-atom/atom-react": "^0.5.0",
40
71
  "chess.js": "^1.0.0",
41
- "effect": "3.17.7",
42
- "@dxos/ai": "0.8.4-main.f5c0578",
43
- "@dxos/async": "0.8.4-main.f5c0578",
44
- "@dxos/blueprints": "0.8.4-main.f5c0578",
45
- "@dxos/display-name": "0.8.4-main.f5c0578",
46
- "@dxos/assistant": "0.8.4-main.f5c0578",
47
- "@dxos/echo": "0.8.4-main.f5c0578",
48
- "@dxos/echo-schema": "0.8.4-main.f5c0578",
49
- "@dxos/app-framework": "0.8.4-main.f5c0578",
50
- "@dxos/functions": "0.8.4-main.f5c0578",
51
- "@dxos/live-object": "0.8.4-main.f5c0578",
52
- "@dxos/log": "0.8.4-main.f5c0578",
53
- "@dxos/plugin-client": "0.8.4-main.f5c0578",
54
- "@dxos/plugin-graph": "0.8.4-main.f5c0578",
55
- "@dxos/plugin-space": "0.8.4-main.f5c0578",
56
- "@dxos/react-ui-stack": "0.8.4-main.f5c0578",
57
- "@dxos/util": "0.8.4-main.f5c0578",
58
- "@dxos/react-ui-gameboard": "0.8.4-main.f5c0578",
59
- "@dxos/react-client": "0.8.4-main.f5c0578",
60
- "@dxos/invariant": "0.8.4-main.f5c0578"
72
+ "effect": "3.20.0",
73
+ "@dxos/ai": "0.8.4-main.fcfe5033a5",
74
+ "@dxos/app-framework": "0.8.4-main.fcfe5033a5",
75
+ "@dxos/app-toolkit": "0.8.4-main.fcfe5033a5",
76
+ "@dxos/assistant": "0.8.4-main.fcfe5033a5",
77
+ "@dxos/blueprints": "0.8.4-main.fcfe5033a5",
78
+ "@dxos/async": "0.8.4-main.fcfe5033a5",
79
+ "@dxos/echo": "0.8.4-main.fcfe5033a5",
80
+ "@dxos/display-name": "0.8.4-main.fcfe5033a5",
81
+ "@dxos/echo-react": "0.8.4-main.fcfe5033a5",
82
+ "@dxos/echo-db": "0.8.4-main.fcfe5033a5",
83
+ "@dxos/functions": "0.8.4-main.fcfe5033a5",
84
+ "@dxos/invariant": "0.8.4-main.fcfe5033a5",
85
+ "@dxos/operation": "0.8.4-main.fcfe5033a5",
86
+ "@dxos/log": "0.8.4-main.fcfe5033a5",
87
+ "@dxos/plugin-graph": "0.8.4-main.fcfe5033a5",
88
+ "@dxos/plugin-markdown": "0.8.4-main.fcfe5033a5",
89
+ "@dxos/react-client": "0.8.4-main.fcfe5033a5",
90
+ "@dxos/react-ui-gameboard": "0.8.4-main.fcfe5033a5",
91
+ "@dxos/plugin-space": "0.8.4-main.fcfe5033a5",
92
+ "@dxos/react-ui-mosaic": "0.8.4-main.fcfe5033a5",
93
+ "@dxos/react-ui-sfx": "0.8.4-main.fcfe5033a5",
94
+ "@dxos/react-ui-stack": "0.8.4-main.fcfe5033a5",
95
+ "@dxos/schema": "0.8.4-main.fcfe5033a5",
96
+ "@dxos/types": "0.8.4-main.fcfe5033a5",
97
+ "@dxos/plugin-client": "0.8.4-main.fcfe5033a5",
98
+ "@dxos/util": "0.8.4-main.fcfe5033a5"
61
99
  },
62
100
  "devDependencies": {
63
- "@types/react": "~18.2.0",
64
- "@types/react-dom": "~18.2.0",
65
- "react": "~18.2.0",
66
- "react-dom": "~18.2.0",
67
- "vite": "5.4.7",
68
- "@dxos/plugin-theme": "0.8.4-main.f5c0578",
69
- "@dxos/react-ui-theme": "0.8.4-main.f5c0578",
70
- "@dxos/storybook-utils": "0.8.4-main.f5c0578",
71
- "@dxos/react-ui": "0.8.4-main.f5c0578"
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/plugin-testing": "0.8.4-main.fcfe5033a5",
107
+ "@dxos/plugin-theme": "0.8.4-main.fcfe5033a5",
108
+ "@dxos/react-ui": "0.8.4-main.fcfe5033a5",
109
+ "@dxos/storybook-utils": "0.8.4-main.fcfe5033a5",
110
+ "@dxos/ui-theme": "0.8.4-main.fcfe5033a5"
72
111
  },
73
112
  "peerDependencies": {
74
- "react": "~18.2.0",
75
- "react-dom": "~18.2.0",
76
- "@dxos/react-ui": "0.8.4-main.f5c0578",
77
- "@dxos/react-ui-theme": "0.8.4-main.f5c0578"
113
+ "react": "~19.2.3",
114
+ "react-dom": "~19.2.3",
115
+ "@dxos/react-ui": "0.8.4-main.fcfe5033a5",
116
+ "@dxos/ui-theme": "0.8.4-main.fcfe5033a5"
78
117
  },
79
118
  "publishConfig": {
80
119
  "access": "public"
@@ -0,0 +1,65 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { describe, test } from 'vitest';
6
+
7
+ import { ActivationEvents, Capabilities } from '@dxos/app-framework';
8
+ import { createTestApp } from '@dxos/app-framework/testing';
9
+ import { AppActivationEvents, AppCapabilities } from '@dxos/app-toolkit';
10
+ import { createComposerTestApp } from '@dxos/plugin-testing/harness';
11
+
12
+ import { ChessPlugin } from './ChessPlugin';
13
+ import { Print } from './operations';
14
+
15
+ describe('ChessPlugin', () => {
16
+ test('activates and contributes expected capabilities', async ({ expect }) => {
17
+ await using harness = await createTestApp({ plugins: [ChessPlugin()] });
18
+ const surfaces = harness.getAll(Capabilities.ReactSurface).flat();
19
+ expect(surfaces.length).toBeGreaterThan(0);
20
+ });
21
+
22
+ test('fires activation events explicitly with autoStart: false', async ({ expect }) => {
23
+ await using harness = await createTestApp({ plugins: [ChessPlugin()], autoStart: false });
24
+
25
+ // No modules have activated yet; schema/surface capabilities are absent.
26
+ expect(harness.getAll(AppCapabilities.Schema)).toHaveLength(0);
27
+ expect(harness.getAll(Capabilities.ReactSurface)).toHaveLength(0);
28
+
29
+ // Fire SetupSchema — the schema module activates and contributes the Chess.Game type.
30
+ await harness.fire(AppActivationEvents.SetupSchema);
31
+ const schemas = harness.getAll(AppCapabilities.Schema).flat();
32
+ expect(schemas.length).toBeGreaterThan(0);
33
+
34
+ // ReactSurface is gated on a different event; still absent.
35
+ expect(harness.getAll(Capabilities.ReactSurface)).toHaveLength(0);
36
+
37
+ // Fire SetupReactSurface; the surface module contributes.
38
+ await harness.fire(ActivationEvents.SetupReactSurface);
39
+ expect(harness.getAll(Capabilities.ReactSurface).flat().length).toBeGreaterThan(0);
40
+ });
41
+
42
+ test('waitForEvent resolves once the event has been fired', async ({ expect }) => {
43
+ await using harness = await createTestApp({ plugins: [ChessPlugin()], autoStart: false });
44
+
45
+ // Fire and wait concurrently — waitForEvent resolves regardless of ordering.
46
+ await Promise.all([
47
+ harness.fire(AppActivationEvents.SetupTranslations),
48
+ harness.waitForEvent(AppActivationEvents.SetupTranslations),
49
+ ]);
50
+ expect(harness.getAll(AppCapabilities.Translations).flat().length).toBeGreaterThan(0);
51
+ });
52
+
53
+ test('invokes the Print operation via the invoker capability', async ({ expect }) => {
54
+ await using harness = await createComposerTestApp({ plugins: [ChessPlugin()] });
55
+ const result = await harness.invoke(Print, {});
56
+ // Empty input returns empty ASCII (handler swallows errors for malformed FEN).
57
+ expect(typeof result.ascii).toBe('string');
58
+ });
59
+
60
+ test('Print renders a PGN to ASCII board', async ({ expect }) => {
61
+ await using harness = await createComposerTestApp({ plugins: [ChessPlugin()] });
62
+ const { ascii } = await harness.invoke(Print, { pgn: '1. e4 e5' });
63
+ expect(ascii).toContain('a b c d e f g h');
64
+ });
65
+ });
@@ -2,59 +2,48 @@
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';
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, 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
- 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: Chess.Game.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: 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,
59
- }),
60
- ]);
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
+ },
44
+ }),
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;
@@ -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 '../operations';
@@ -6,20 +6,21 @@
6
6
  // @ts-nocheck
7
7
 
8
8
  import { Chess as ChessJS } from 'chess.js';
9
- import { Schema, pipe } from 'effect';
9
+ import * as Effect from 'effect/Effect';
10
+ import * as Schema from 'effect/Schema';
10
11
 
11
12
  import { ToolResult, createTool } from '@dxos/ai';
12
- import { Capabilities, type PromiseIntentDispatcher, chain, contributes, createIntent } from '@dxos/app-framework';
13
+ import { Capabilities, Capability, type PromiseIntentDispatcher } from '@dxos/app-framework';
13
14
  import { ArtifactId, VersionPin, createArtifactElement } from '@dxos/assistant';
14
15
  import { defineArtifact } from '@dxos/blueprints';
15
16
  import { Obj } from '@dxos/echo';
16
17
  import { invariant } from '@dxos/invariant';
17
- import { SpaceAction } from '@dxos/plugin-space/types';
18
+ import { SpaceOperation } from '@dxos/plugin-space/operations';
18
19
  import { Filter, type Space } from '@dxos/react-client/echo';
19
20
  import { trim } from '@dxos/util';
20
21
 
21
- import { meta } from '../meta';
22
- import { Chess, ChessAction } from '../types';
22
+ import { meta } from '#meta';
23
+ import { Chess } from '#types';
23
24
 
24
25
  // TODO(burdon): Factor out.
25
26
  declare global {
@@ -29,100 +30,106 @@ declare global {
29
30
  }
30
31
  }
31
32
 
32
- export default () => {
33
- const definition = defineArtifact({
34
- id: `artifact:${meta.id}`,
35
- name: meta.name,
36
- description: 'Provides a simple chess engine.',
37
- instructions: trim`
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`
38
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.
39
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.
40
42
  `,
41
- schema: Chess.Game,
42
- tools: [
43
- createTool(meta.id, {
44
- name: 'create',
45
- description: 'Create a new chess game. Returns the artifact definition for the game.',
46
- caption: 'Creating chess game...',
47
- schema: Schema.Struct({
48
- pgn: Schema.String.annotations({ description: 'The state of the chess game in the PGN format.' }),
49
- }),
50
- execute: async ({ pgn }, { extensions }) => {
51
- invariant(extensions?.space, 'No space');
52
- invariant(extensions?.dispatch, 'No intent dispatcher');
53
- const intent = pipe(
54
- createIntent(ChessAction.Create, { pgn }),
55
- chain(SpaceAction.AddObject, { target: extensions.space }),
56
- );
57
- const { data, error } = await extensions.dispatch(intent);
58
- if (!data || error) {
59
- return ToolResult.Error(error?.message ?? 'Failed to create chess game');
60
- }
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');
61
55
 
62
- return ToolResult.Success(createArtifactElement(data.id), [
63
- VersionPin.createBlock(VersionPin.fromObject(data.object)),
64
- ]);
65
- },
66
- }),
67
- createTool(meta.id, {
68
- name: 'list',
69
- description: 'Query all active chess games.',
70
- caption: 'Getting games...',
71
- schema: Schema.Struct({}),
72
- execute: async (_, { extensions }) => {
73
- invariant(extensions?.space, 'No space');
74
- const { objects: games } = await extensions.space.db.query(Filter.type(Chess.Game)).run();
75
- invariant(games.length > 0, 'No chess games found');
56
+ const game = Chess.make({ pgn });
76
57
 
77
- return ToolResult.Success(games);
78
- },
79
- }),
80
- createTool(meta.id, {
81
- name: 'inspect',
82
- description: 'Get the current state of the chess game.',
83
- caption: 'Inspecting game...',
84
- schema: Schema.Struct({ id: ArtifactId }),
85
- execute: async ({ id }, { extensions }) => {
86
- invariant(extensions?.space, 'No space');
87
- const game = await extensions.space.db
88
- .query(Filter.ids(ArtifactId.toDXN(id, extensions.space.id).toString()))
89
- .first();
90
- 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
+ }
91
65
 
92
- return ToolResult.Success(game.pgn);
93
- },
94
- }),
95
- createTool(meta.id, {
96
- name: 'move',
97
- description: 'Make a move in the chess game.',
98
- caption: 'Making chess move...',
99
- schema: Schema.Struct({
100
- id: ArtifactId,
101
- move: Schema.String.annotations({
102
- description: 'The move to make in the chess game.',
103
- examples: ['e4', 'Bf3'],
104
- }),
66
+ return ToolResult.Success(createArtifactElement(game.id), [
67
+ VersionPin.createBlock(VersionPin.fromObject(game)),
68
+ ]);
69
+ },
105
70
  }),
106
- execute: async ({ id, move }, { extensions }) => {
107
- invariant(extensions?.space, 'No space');
108
- const game = await extensions.space.db
109
- .query(Filter.ids(ArtifactId.toDXN(id, extensions.space.id).toString()))
110
- .first();
111
- invariant(Obj.instanceOf(Chess.Game, game));
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');
112
80
 
113
- const chess = new ChessJS(game.pgn);
114
- try {
115
- chess.move(move);
116
- } catch (error: any) {
117
- return ToolResult.Error(error.message);
118
- }
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));
119
95
 
120
- game.pgn = chess.pgn();
121
- return ToolResult.Success(game.pgn);
122
- },
123
- }),
124
- ],
125
- });
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, (game) => {
125
+ game.pgn = chess.pgn();
126
+ });
127
+ return ToolResult.Success(game.pgn);
128
+ },
129
+ }),
130
+ ],
131
+ });
126
132
 
127
- return contributes(Capabilities.ArtifactDefinition, definition);
128
- };
133
+ return Capability.contributes(Capabilities.ArtifactDefinition, definition);
134
+ }),
135
+ );
@@ -2,33 +2,16 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { ToolId } from '@dxos/ai';
6
- import { Capabilities, contributes } from '@dxos/app-framework';
7
- import { Blueprint, Template } from '@dxos/blueprints';
8
- import { trim } from '@dxos/util';
5
+ import * as Effect from 'effect/Effect';
9
6
 
10
- import { move, play } from '../functions';
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities } from '@dxos/app-toolkit';
11
9
 
12
- const functions = [move, play];
10
+ import { ChessBlueprint } from '#blueprints';
13
11
 
14
- export default () => {
15
- return [
16
- contributes(
17
- Capabilities.BlueprintDefinition,
18
- Blueprint.make({
19
- key: 'dxos.org/blueprint/chess',
20
- name: 'Chess',
21
- instructions: Template.make({
22
- source: trim`
23
- You are an expert chess player.
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
- To analyze a game you can retrieve the "pgn" property from the context object.
27
- `,
28
- }),
29
- tools: functions.map((tool) => ToolId.make(tool.name)),
30
- }),
31
- ),
32
- contributes(Capabilities.Functions, functions),
33
- ];
34
- };
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;
@@ -2,8 +2,12 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
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 IntentResolver = lazy(() => import('./intent-resolver'));
9
- export const ReactSurface = lazy(() => import('./react-surface'));
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
+ );