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

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 (235) hide show
  1. package/dist/lib/browser/blueprints/index.mjs +43 -0
  2. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-2DFOUJBD.mjs +28 -0
  4. package/dist/lib/browser/chunk-2DFOUJBD.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-IN3LZ2OO.mjs +62 -0
  6. package/dist/lib/browser/chunk-IN3LZ2OO.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  8. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-OBKYFOJA.mjs +110 -0
  10. package/dist/lib/browser/chunk-OBKYFOJA.mjs.map +7 -0
  11. package/dist/lib/browser/cli/index.mjs +34 -0
  12. package/dist/lib/browser/cli/index.mjs.map +7 -0
  13. package/dist/lib/browser/create-2ME3FNBX.mjs +24 -0
  14. package/dist/lib/browser/create-2ME3FNBX.mjs.map +7 -0
  15. package/dist/lib/browser/index.mjs +330 -104
  16. package/dist/lib/browser/index.mjs.map +4 -4
  17. package/dist/lib/browser/meta.json +1 -1
  18. package/dist/lib/browser/move-TTMIPD5J.mjs +36 -0
  19. package/dist/lib/browser/move-TTMIPD5J.mjs.map +7 -0
  20. package/dist/lib/browser/operations/index.mjs +19 -0
  21. package/dist/lib/browser/operations/index.mjs.map +7 -0
  22. package/dist/lib/browser/play-GHXPV2T2.mjs +45 -0
  23. package/dist/lib/browser/play-GHXPV2T2.mjs.map +7 -0
  24. package/dist/lib/browser/print-RNAGAOM7.mjs +30 -0
  25. package/dist/lib/browser/print-RNAGAOM7.mjs.map +7 -0
  26. package/dist/lib/browser/translations.mjs +38 -0
  27. package/dist/lib/browser/translations.mjs.map +7 -0
  28. package/dist/lib/browser/types/index.mjs +3 -5
  29. package/dist/lib/node-esm/blueprints/index.mjs +44 -0
  30. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  31. package/dist/lib/node-esm/chunk-G2EHRXHX.mjs +111 -0
  32. package/dist/lib/node-esm/chunk-G2EHRXHX.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-OHBKSL2Q.mjs +63 -0
  36. package/dist/lib/node-esm/chunk-OHBKSL2Q.mjs.map +7 -0
  37. package/dist/lib/node-esm/chunk-V4FN2DZR.mjs +29 -0
  38. package/dist/lib/node-esm/chunk-V4FN2DZR.mjs.map +7 -0
  39. package/dist/lib/node-esm/cli/index.mjs +35 -0
  40. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  41. package/dist/lib/node-esm/create-CC2P7GPT.mjs +25 -0
  42. package/dist/lib/node-esm/create-CC2P7GPT.mjs.map +7 -0
  43. package/dist/lib/node-esm/index.mjs +330 -104
  44. package/dist/lib/node-esm/index.mjs.map +4 -4
  45. package/dist/lib/node-esm/meta.json +1 -1
  46. package/dist/lib/node-esm/move-CYHXWHHM.mjs +37 -0
  47. package/dist/lib/node-esm/move-CYHXWHHM.mjs.map +7 -0
  48. package/dist/lib/node-esm/operations/index.mjs +20 -0
  49. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  50. package/dist/lib/node-esm/play-KTNK2PBL.mjs +46 -0
  51. package/dist/lib/node-esm/play-KTNK2PBL.mjs.map +7 -0
  52. package/dist/lib/node-esm/print-P23VKVNU.mjs +31 -0
  53. package/dist/lib/node-esm/print-P23VKVNU.mjs.map +7 -0
  54. package/dist/lib/node-esm/translations.mjs +39 -0
  55. package/dist/lib/node-esm/translations.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 +4 -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 +38 -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 +65 -0
  82. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -0
  83. package/dist/types/src/components/Chessboard/Info.d.ts +20 -0
  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 +64 -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 +1 -4
  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 +40 -20
  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 +80 -43
  129. package/src/ChessPlugin.test.ts +51 -0
  130. package/src/ChessPlugin.tsx +42 -54
  131. package/src/blueprints/chess-blueprint.ts +34 -0
  132. package/src/blueprints/index.ts +6 -0
  133. package/src/capabilities/artifact-definition.ts +100 -93
  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 +1 -4
  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 +0 -80
  193. package/dist/lib/node-esm/chunk-LCCUF5X5.mjs.map +0 -7
  194. package/dist/lib/node-esm/chunk-QAGOXJGH.mjs +0 -258
  195. package/dist/lib/node-esm/chunk-QAGOXJGH.mjs.map +0 -7
  196. package/dist/lib/node-esm/intent-resolver-G6XJAW6C.mjs +0 -26
  197. package/dist/lib/node-esm/intent-resolver-G6XJAW6C.mjs.map +0 -7
  198. package/dist/lib/node-esm/react-surface-GGRDWZJT.mjs +0 -39
  199. package/dist/lib/node-esm/react-surface-GGRDWZJT.mjs.map +0 -7
  200. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  201. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  202. package/dist/types/src/components/Card.stories.d.ts +0 -49
  203. package/dist/types/src/components/Card.stories.d.ts.map +0 -1
  204. package/dist/types/src/components/Chessboard.d.ts +0 -32
  205. package/dist/types/src/components/Chessboard.d.ts.map +0 -1
  206. package/dist/types/src/components/Chessboard.stories.d.ts +0 -42
  207. package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
  208. package/dist/types/src/components/ChessboardArticle.d.ts +0 -6
  209. package/dist/types/src/components/ChessboardArticle.d.ts.map +0 -1
  210. package/dist/types/src/components/ChessboardContainer.d.ts +0 -9
  211. package/dist/types/src/components/ChessboardContainer.d.ts.map +0 -1
  212. package/dist/types/src/components/ChessboardInfo.d.ts +0 -20
  213. package/dist/types/src/components/ChessboardInfo.d.ts.map +0 -1
  214. package/dist/types/src/components/ChessboardPlayers.d.ts +0 -8
  215. package/dist/types/src/components/ChessboardPlayers.d.ts.map +0 -1
  216. package/dist/types/src/functions/index.d.ts +0 -3
  217. package/dist/types/src/functions/index.d.ts.map +0 -1
  218. package/dist/types/src/functions/move.d.ts +0 -6
  219. package/dist/types/src/functions/move.d.ts.map +0 -1
  220. package/dist/types/src/functions/play.d.ts +0 -8
  221. package/dist/types/src/functions/play.d.ts.map +0 -1
  222. package/dist/types/src/types/ChessAction.d.ts +0 -23
  223. package/dist/types/src/types/ChessAction.d.ts.map +0 -1
  224. package/src/capabilities/intent-resolver.ts +0 -22
  225. package/src/components/Card.stories.tsx +0 -68
  226. package/src/components/Chessboard.stories.tsx +0 -50
  227. package/src/components/Chessboard.tsx +0 -101
  228. package/src/components/ChessboardArticle.tsx +0 -57
  229. package/src/components/ChessboardContainer.tsx +0 -44
  230. package/src/components/ChessboardInfo.tsx +0 -140
  231. package/src/components/ChessboardPlayers.tsx +0 -97
  232. package/src/functions/index.ts +0 -6
  233. package/src/functions/move.ts +0 -43
  234. package/src/functions/play.ts +0 -45
  235. package/src/types/ChessAction.ts +0 -19
package/package.json CHANGED
@@ -1,13 +1,27 @@
1
1
  {
2
2
  "name": "@dxos/plugin-chess",
3
- "version": "0.8.4-main.f5c0578",
3
+ "version": "0.8.4-main.fcc0d83b33",
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
+ "#translations": "./src/translations.ts",
23
+ "#types": "./src/types/index.ts"
24
+ },
11
25
  "exports": {
12
26
  ".": {
13
27
  "source": "./src/index.ts",
@@ -15,6 +29,30 @@
15
29
  "browser": "./dist/lib/browser/index.mjs",
16
30
  "node": "./dist/lib/node-esm/index.mjs"
17
31
  },
32
+ "./blueprints": {
33
+ "source": "./src/blueprints/index.ts",
34
+ "types": "./dist/types/src/blueprints/index.d.ts",
35
+ "browser": "./dist/lib/browser/blueprints/index.mjs",
36
+ "node": "./dist/lib/node-esm/blueprints/index.mjs"
37
+ },
38
+ "./cli": {
39
+ "source": "./src/cli/index.ts",
40
+ "types": "./dist/types/src/cli/index.d.ts",
41
+ "browser": "./dist/lib/browser/cli/index.mjs",
42
+ "node": "./dist/lib/node-esm/cli/index.mjs"
43
+ },
44
+ "./operations": {
45
+ "source": "./src/operations/index.ts",
46
+ "types": "./dist/types/src/operations/index.d.ts",
47
+ "browser": "./dist/lib/browser/operations/index.mjs",
48
+ "node": "./dist/lib/node-esm/operations/index.mjs"
49
+ },
50
+ "./translations": {
51
+ "source": "./src/translations.ts",
52
+ "types": "./dist/types/src/translations.d.ts",
53
+ "browser": "./dist/lib/browser/translations.mjs",
54
+ "node": "./dist/lib/node-esm/translations.mjs"
55
+ },
18
56
  "./types": {
19
57
  "source": "./src/types/index.ts",
20
58
  "types": "./dist/types/src/types/index.d.ts",
@@ -23,58 +61,57 @@
23
61
  }
24
62
  },
25
63
  "types": "dist/types/src/index.d.ts",
26
- "typesVersions": {
27
- "*": {
28
- "types": [
29
- "dist/types/src/types/index.d.ts"
30
- ]
31
- }
32
- },
33
64
  "files": [
34
65
  "dist",
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/app-framework": "0.8.4-main.fcc0d83b33",
74
+ "@dxos/app-toolkit": "0.8.4-main.fcc0d83b33",
75
+ "@dxos/assistant": "0.8.4-main.fcc0d83b33",
76
+ "@dxos/async": "0.8.4-main.fcc0d83b33",
77
+ "@dxos/compute": "0.8.4-main.fcc0d83b33",
78
+ "@dxos/ai": "0.8.4-main.fcc0d83b33",
79
+ "@dxos/display-name": "0.8.4-main.fcc0d83b33",
80
+ "@dxos/echo": "0.8.4-main.fcc0d83b33",
81
+ "@dxos/echo-react": "0.8.4-main.fcc0d83b33",
82
+ "@dxos/echo-db": "0.8.4-main.fcc0d83b33",
83
+ "@dxos/invariant": "0.8.4-main.fcc0d83b33",
84
+ "@dxos/log": "0.8.4-main.fcc0d83b33",
85
+ "@dxos/plugin-client": "0.8.4-main.fcc0d83b33",
86
+ "@dxos/plugin-graph": "0.8.4-main.fcc0d83b33",
87
+ "@dxos/plugin-markdown": "0.8.4-main.fcc0d83b33",
88
+ "@dxos/react-client": "0.8.4-main.fcc0d83b33",
89
+ "@dxos/react-ui-gameboard": "0.8.4-main.fcc0d83b33",
90
+ "@dxos/react-ui-mosaic": "0.8.4-main.fcc0d83b33",
91
+ "@dxos/plugin-space": "0.8.4-main.fcc0d83b33",
92
+ "@dxos/react-ui-sfx": "0.8.4-main.fcc0d83b33",
93
+ "@dxos/types": "0.8.4-main.fcc0d83b33",
94
+ "@dxos/schema": "0.8.4-main.fcc0d83b33",
95
+ "@dxos/util": "0.8.4-main.fcc0d83b33",
96
+ "@dxos/react-ui-stack": "0.8.4-main.fcc0d83b33"
61
97
  },
62
98
  "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"
99
+ "@types/react": "~19.2.7",
100
+ "@types/react-dom": "~19.2.3",
101
+ "react": "~19.2.3",
102
+ "react-dom": "~19.2.3",
103
+ "vite": "^8.0.10",
104
+ "@dxos/plugin-theme": "0.8.4-main.fcc0d83b33",
105
+ "@dxos/plugin-testing": "0.8.4-main.fcc0d83b33",
106
+ "@dxos/react-ui": "0.8.4-main.fcc0d83b33",
107
+ "@dxos/storybook-utils": "0.8.4-main.fcc0d83b33",
108
+ "@dxos/ui-theme": "0.8.4-main.fcc0d83b33"
72
109
  },
73
110
  "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"
111
+ "react": "~19.2.3",
112
+ "react-dom": "~19.2.3",
113
+ "@dxos/react-ui": "0.8.4-main.fcc0d83b33",
114
+ "@dxos/ui-theme": "0.8.4-main.fcc0d83b33"
78
115
  },
79
116
  "publishConfig": {
80
117
  "access": "public"
@@ -0,0 +1,51 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { describe, test } from 'vitest';
6
+
7
+ import { ActivationEvents } from '@dxos/app-framework';
8
+ import { AppActivationEvents } from '@dxos/app-toolkit';
9
+ // Use the CLI variant — the main ClientPlugin references capabilities that resolve to undefined under Node.
10
+ import { ClientPlugin } from '@dxos/plugin-client/cli';
11
+ import { createComposerTestApp } from '@dxos/plugin-testing/harness';
12
+
13
+ import { ChessPlugin } from './ChessPlugin';
14
+ import { meta } from './meta';
15
+ import { Print } from './operations';
16
+
17
+ const moduleId = (name: string) => `${meta.id}.module.${name}`;
18
+
19
+ describe('ChessPlugin', () => {
20
+ test('modules activate on the expected events', async ({ expect }) => {
21
+ await using harness = await createComposerTestApp({
22
+ plugins: [ClientPlugin({}), ChessPlugin()],
23
+ });
24
+
25
+ // Modules expected to be active after a normal startup.
26
+ expect(harness.manager.getActive()).toEqual(
27
+ expect.arrayContaining([moduleId('metadata'), moduleId('schema'), moduleId('ReactSurface')]),
28
+ );
29
+
30
+ // SetupArtifactDefinition is fired by AssistantPlugin, which can't be included here due to a workspace cycle.
31
+ await harness.fire(AppActivationEvents.SetupArtifactDefinition);
32
+ expect(harness.manager.getActive()).toContain(moduleId('BlueprintDefinition'));
33
+
34
+ // Operation handlers are not loaded on startup — SetupOperationHandler fires lazily when an operation is invoked.
35
+ await harness.fire(ActivationEvents.SetupOperationHandler);
36
+ expect(harness.manager.getActive()).toContain(moduleId('OperationHandler'));
37
+ });
38
+
39
+ test('invokes the Print operation via the invoker capability', async ({ expect }) => {
40
+ await using harness = await createComposerTestApp({ plugins: [ChessPlugin()] });
41
+ const result = await harness.invoke(Print, {});
42
+ // Empty input returns empty ASCII (handler swallows errors for malformed FEN).
43
+ expect(typeof result.ascii).toBe('string');
44
+ });
45
+
46
+ test('Print renders a PGN to ASCII board', async ({ expect }) => {
47
+ await using harness = await createComposerTestApp({ plugins: [ChessPlugin()] });
48
+ const { ascii } = await harness.invoke(Print, { pgn: '1. e4 e5' });
49
+ expect(ascii).toContain('a b c d e f g h');
50
+ });
51
+ });
@@ -2,59 +2,47 @@
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';
9
7
 
10
- import { BlueprintDefinition, IntentResolver, ReactSurface } from './capabilities';
11
- import { meta } from './meta';
12
- import { translations } from './translations';
13
- import { Chess, ChessAction } from './types';
8
+ import { Plugin } from '@dxos/app-framework';
9
+ import { AppPlugin } from '@dxos/app-toolkit';
10
+ import { Operation } from '@dxos/compute';
11
+ import { Annotation } from '@dxos/echo';
12
+ import { SpaceOperation } from '@dxos/plugin-space/operations';
13
+ import { type CreateObject } from '@dxos/plugin-space/types';
14
14
 
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
- ]);
15
+ import { ChessBlueprint } from '#blueprints';
16
+ import { BlueprintDefinition, OperationHandler, ReactSurface } from '#capabilities';
17
+ import { meta } from '#meta';
18
+ import { translations } from '#translations';
19
+ import { Chess } from '#types';
20
+
21
+ export const ChessPlugin = Plugin.define(meta).pipe(
22
+ AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),
23
+ AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
24
+ AppPlugin.addMetadataModule({
25
+ metadata: {
26
+ id: Chess.Game.typename,
27
+ metadata: {
28
+ icon: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).icon,
29
+ iconHue: Annotation.IconAnnotation.get(Chess.Game).pipe(Option.getOrThrow).hue ?? 'white',
30
+ blueprints: [ChessBlueprint.key],
31
+ createObject: ((props, options) =>
32
+ Effect.gen(function* () {
33
+ const object = Chess.make(props);
34
+ return yield* Operation.invoke(SpaceOperation.AddObject, {
35
+ object,
36
+ target: options.target,
37
+ hidden: true,
38
+ targetNodeId: options.targetNodeId,
39
+ });
40
+ })) satisfies CreateObject,
41
+ },
42
+ },
43
+ }),
44
+ AppPlugin.addSchemaModule({ schema: [Chess.Game] }),
45
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
46
+ AppPlugin.addTranslationsModule({ translations }),
47
+ Plugin.make,
48
+ );
@@ -0,0 +1,34 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Blueprint, Template } from '@dxos/compute';
6
+ import { trim } from '@dxos/util';
7
+
8
+ import { Create, Move, Play, Print } from '#operations';
9
+
10
+ const BLUEPRINT_KEY = 'org.dxos.blueprint.chess';
11
+
12
+ const operations = [Create, Move, Play, Print];
13
+
14
+ const make = () =>
15
+ Blueprint.make({
16
+ key: BLUEPRINT_KEY,
17
+ name: 'Chess',
18
+ tools: Blueprint.toolDefinitions({ operations }),
19
+ instructions: Template.make({
20
+ source: trim`
21
+ You are an expert chess player.
22
+ To analyze a game you can access the "pgn" property by loading the context object that represents the current game.
23
+ You could suggest a good next move or offer to play a move.
24
+ Don't actually make a move unless you are asked to.
25
+ `,
26
+ }),
27
+ });
28
+
29
+ const blueprint: Blueprint.Definition = {
30
+ key: BLUEPRINT_KEY,
31
+ make,
32
+ };
33
+
34
+ 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
- import { defineArtifact } from '@dxos/blueprints';
15
+ import { defineArtifact } from '@dxos/compute';
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.update(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/compute';
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'));