@dxos/plugin-chess 0.8.4-main.1068cf700f → 0.8.4-main.1c7ec43d41

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 (229) hide show
  1. package/dist/lib/browser/blueprints/index.mjs +9 -6
  2. package/dist/lib/browser/chunk-5FHUZILG.mjs +63 -0
  3. package/dist/lib/browser/chunk-5FHUZILG.mjs.map +7 -0
  4. package/dist/lib/browser/chunk-BCTL5GYK.mjs +88 -0
  5. package/dist/lib/browser/chunk-BCTL5GYK.mjs.map +7 -0
  6. package/dist/lib/browser/chunk-ORLWKOYE.mjs +26 -0
  7. package/dist/lib/browser/chunk-ORLWKOYE.mjs.map +7 -0
  8. package/dist/lib/browser/chunk-YER5TC5N.mjs +35 -0
  9. package/dist/lib/browser/chunk-YER5TC5N.mjs.map +7 -0
  10. package/dist/lib/browser/index.mjs +27 -85
  11. package/dist/lib/browser/index.mjs.map +4 -4
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/browser/move-BH3WZUJH.mjs +39 -0
  14. package/dist/lib/browser/move-BH3WZUJH.mjs.map +7 -0
  15. package/dist/lib/browser/operations/index.mjs +17 -0
  16. package/dist/lib/browser/operations/index.mjs.map +7 -0
  17. package/dist/lib/browser/play-IM4BDFSY.mjs +48 -0
  18. package/dist/lib/browser/play-IM4BDFSY.mjs.map +7 -0
  19. package/dist/lib/browser/print-M3ZO2XZT.mjs +30 -0
  20. package/dist/lib/browser/print-M3ZO2XZT.mjs.map +7 -0
  21. package/dist/lib/browser/translations.mjs +34 -0
  22. package/dist/lib/browser/translations.mjs.map +7 -0
  23. package/dist/lib/browser/types/index.mjs +1 -1
  24. package/dist/lib/node-esm/blueprints/index.mjs +9 -6
  25. package/dist/lib/node-esm/chunk-A3P4HC7O.mjs +89 -0
  26. package/dist/lib/node-esm/chunk-A3P4HC7O.mjs.map +7 -0
  27. package/dist/lib/node-esm/chunk-B42KRPBJ.mjs +37 -0
  28. package/dist/lib/node-esm/chunk-B42KRPBJ.mjs.map +7 -0
  29. package/dist/lib/node-esm/chunk-WSHXDK3W.mjs +27 -0
  30. package/dist/lib/node-esm/chunk-WSHXDK3W.mjs.map +7 -0
  31. package/dist/lib/node-esm/chunk-YRW4LYGF.mjs +64 -0
  32. package/dist/lib/node-esm/chunk-YRW4LYGF.mjs.map +7 -0
  33. package/dist/lib/node-esm/index.mjs +27 -85
  34. package/dist/lib/node-esm/index.mjs.map +4 -4
  35. package/dist/lib/node-esm/meta.json +1 -1
  36. package/dist/lib/node-esm/move-53HLCSAL.mjs +40 -0
  37. package/dist/lib/node-esm/move-53HLCSAL.mjs.map +7 -0
  38. package/dist/lib/node-esm/operations/index.mjs +18 -0
  39. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  40. package/dist/lib/node-esm/play-YXXPG5SO.mjs +49 -0
  41. package/dist/lib/node-esm/play-YXXPG5SO.mjs.map +7 -0
  42. package/dist/lib/node-esm/print-L2LUM3IW.mjs +31 -0
  43. package/dist/lib/node-esm/print-L2LUM3IW.mjs.map +7 -0
  44. package/dist/lib/node-esm/translations.mjs +35 -0
  45. package/dist/lib/node-esm/translations.mjs.map +7 -0
  46. package/dist/lib/node-esm/types/index.mjs +1 -1
  47. package/dist/types/src/ChessPlugin.d.ts +1 -0
  48. package/dist/types/src/ChessPlugin.d.ts.map +1 -1
  49. package/dist/types/src/ChessPlugin.node.d.ts +8 -0
  50. package/dist/types/src/ChessPlugin.node.d.ts.map +1 -0
  51. package/dist/types/src/ChessPlugin.test.d.ts +2 -0
  52. package/dist/types/src/ChessPlugin.test.d.ts.map +1 -0
  53. package/dist/types/src/blueprints/chess-blueprint.d.ts +3 -20
  54. package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -1
  55. package/dist/types/src/blueprints/index.d.ts +2 -2
  56. package/dist/types/src/blueprints/index.d.ts.map +1 -1
  57. package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
  58. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  59. package/dist/types/src/capabilities/game-variant.d.ts +6 -0
  60. package/dist/types/src/capabilities/game-variant.d.ts.map +1 -0
  61. package/dist/types/src/capabilities/index.d.ts +5 -2
  62. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  63. package/dist/types/src/capabilities/node.d.ts +10 -0
  64. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  65. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  66. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  67. package/dist/types/src/components/{Chessboard.d.ts → Chessboard/Chessboard.d.ts} +10 -11
  68. package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -0
  69. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +57 -0
  70. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -0
  71. package/dist/types/src/components/{Info.d.ts → Chessboard/Info.d.ts} +5 -6
  72. package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -0
  73. package/dist/types/src/components/Chessboard/index.d.ts +2 -0
  74. package/dist/types/src/components/Chessboard/index.d.ts.map +1 -0
  75. package/dist/types/src/components/Chessboard/types.d.ts +8 -0
  76. package/dist/types/src/components/Chessboard/types.d.ts.map +1 -0
  77. package/dist/types/src/components/index.d.ts +0 -1
  78. package/dist/types/src/components/index.d.ts.map +1 -1
  79. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +5 -0
  80. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
  81. package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +56 -0
  82. package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -0
  83. package/dist/types/src/containers/ChessArticle/index.d.ts +2 -0
  84. package/dist/types/src/containers/ChessArticle/index.d.ts.map +1 -0
  85. package/dist/types/src/containers/ChessCard/ChessCard.d.ts +5 -0
  86. package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -0
  87. package/dist/types/src/{components/Card.stories.d.ts → containers/ChessCard/ChessCard.stories.d.ts} +1 -1
  88. package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -0
  89. package/dist/types/src/containers/ChessCard/index.d.ts +2 -0
  90. package/dist/types/src/containers/ChessCard/index.d.ts.map +1 -0
  91. package/dist/types/src/containers/index.d.ts +4 -0
  92. package/dist/types/src/containers/index.d.ts.map +1 -0
  93. package/dist/types/src/index.d.ts +2 -3
  94. package/dist/types/src/index.d.ts.map +1 -1
  95. package/dist/types/src/operations/definitions.d.ts +24 -0
  96. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  97. package/dist/types/src/operations/index.d.ts +4 -0
  98. package/dist/types/src/operations/index.d.ts.map +1 -0
  99. package/dist/types/src/operations/move.d.ts +5 -0
  100. package/dist/types/src/operations/move.d.ts.map +1 -0
  101. package/dist/types/src/operations/play.d.ts +5 -0
  102. package/dist/types/src/operations/play.d.ts.map +1 -0
  103. package/dist/types/src/operations/print.d.ts +5 -0
  104. package/dist/types/src/operations/print.d.ts.map +1 -0
  105. package/dist/types/src/translations.d.ts +32 -23
  106. package/dist/types/src/translations.d.ts.map +1 -1
  107. package/dist/types/src/types/Chess.d.ts +10 -19
  108. package/dist/types/src/types/Chess.d.ts.map +1 -1
  109. package/dist/types/tsconfig.tsbuildinfo +1 -1
  110. package/package.json +66 -48
  111. package/src/ChessPlugin.node.ts +23 -0
  112. package/src/ChessPlugin.test.ts +49 -0
  113. package/src/ChessPlugin.tsx +14 -23
  114. package/src/blueprints/chess-blueprint.ts +14 -9
  115. package/src/blueprints/index.ts +2 -2
  116. package/src/capabilities/blueprint-definition.ts +19 -0
  117. package/src/capabilities/game-variant.ts +42 -0
  118. package/src/capabilities/index.ts +10 -2
  119. package/src/capabilities/node.ts +18 -0
  120. package/src/capabilities/operation-handler.ts +14 -0
  121. package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
  122. package/src/components/{Chessboard.tsx → Chessboard/Chessboard.tsx} +21 -31
  123. package/src/components/{Info.tsx → Chessboard/Info.tsx} +24 -77
  124. package/src/components/Chessboard/index.ts +5 -0
  125. package/src/components/Chessboard/types.ts +18 -0
  126. package/src/components/index.ts +1 -5
  127. package/src/{components/Chessboard.stories.tsx → containers/ChessArticle/ChessArticle.stories.tsx} +16 -10
  128. package/src/containers/ChessArticle/ChessArticle.tsx +108 -0
  129. package/src/containers/ChessArticle/index.ts +5 -0
  130. package/src/containers/ChessCard/ChessCard.stories.tsx +47 -0
  131. package/src/containers/ChessCard/ChessCard.tsx +27 -0
  132. package/src/containers/ChessCard/index.ts +5 -0
  133. package/src/containers/index.ts +8 -0
  134. package/src/index.ts +5 -3
  135. package/src/meta.ts +1 -1
  136. package/src/operations/definitions.ts +83 -0
  137. package/src/operations/index.ts +15 -0
  138. package/src/operations/move.ts +37 -0
  139. package/src/operations/play.ts +46 -0
  140. package/src/operations/print.ts +28 -0
  141. package/src/translations.ts +18 -21
  142. package/src/types/Chess.ts +25 -24
  143. package/dist/lib/browser/ChessboardContainer-GNSIZKY7.mjs +0 -80
  144. package/dist/lib/browser/ChessboardContainer-GNSIZKY7.mjs.map +0 -7
  145. package/dist/lib/browser/blueprint-definition-YUKJZPOL.mjs +0 -19
  146. package/dist/lib/browser/blueprint-definition-YUKJZPOL.mjs.map +0 -7
  147. package/dist/lib/browser/chunk-66H3V2YV.mjs +0 -64
  148. package/dist/lib/browser/chunk-66H3V2YV.mjs.map +0 -7
  149. package/dist/lib/browser/chunk-H3NUMCQ6.mjs +0 -21
  150. package/dist/lib/browser/chunk-H3NUMCQ6.mjs.map +0 -7
  151. package/dist/lib/browser/chunk-MABHE5SS.mjs +0 -277
  152. package/dist/lib/browser/chunk-MABHE5SS.mjs.map +0 -7
  153. package/dist/lib/browser/chunk-PBRN5Q4R.mjs +0 -227
  154. package/dist/lib/browser/chunk-PBRN5Q4R.mjs.map +0 -7
  155. package/dist/lib/browser/chunk-QGVMZ4PK.mjs +0 -8
  156. package/dist/lib/browser/chunk-QGVMZ4PK.mjs.map +0 -7
  157. package/dist/lib/browser/cli/index.mjs +0 -29
  158. package/dist/lib/browser/cli/index.mjs.map +0 -7
  159. package/dist/lib/browser/react-surface-C52R6BRL.mjs +0 -38
  160. package/dist/lib/browser/react-surface-C52R6BRL.mjs.map +0 -7
  161. package/dist/lib/node-esm/ChessboardContainer-5OVYZMIW.mjs +0 -81
  162. package/dist/lib/node-esm/ChessboardContainer-5OVYZMIW.mjs.map +0 -7
  163. package/dist/lib/node-esm/blueprint-definition-4HZ2HWWC.mjs +0 -20
  164. package/dist/lib/node-esm/blueprint-definition-4HZ2HWWC.mjs.map +0 -7
  165. package/dist/lib/node-esm/chunk-3MAU6WHB.mjs +0 -228
  166. package/dist/lib/node-esm/chunk-3MAU6WHB.mjs.map +0 -7
  167. package/dist/lib/node-esm/chunk-F5OMIM4F.mjs +0 -23
  168. package/dist/lib/node-esm/chunk-F5OMIM4F.mjs.map +0 -7
  169. package/dist/lib/node-esm/chunk-IFK6UAKF.mjs +0 -10
  170. package/dist/lib/node-esm/chunk-IFK6UAKF.mjs.map +0 -7
  171. package/dist/lib/node-esm/chunk-OUNGNJFP.mjs +0 -65
  172. package/dist/lib/node-esm/chunk-OUNGNJFP.mjs.map +0 -7
  173. package/dist/lib/node-esm/chunk-V6MKXXPO.mjs +0 -278
  174. package/dist/lib/node-esm/chunk-V6MKXXPO.mjs.map +0 -7
  175. package/dist/lib/node-esm/cli/index.mjs +0 -30
  176. package/dist/lib/node-esm/cli/index.mjs.map +0 -7
  177. package/dist/lib/node-esm/react-surface-NW33JZ6J.mjs +0 -39
  178. package/dist/lib/node-esm/react-surface-NW33JZ6J.mjs.map +0 -7
  179. package/dist/types/src/blueprints/functions/create.d.ts +0 -15
  180. package/dist/types/src/blueprints/functions/create.d.ts.map +0 -1
  181. package/dist/types/src/blueprints/functions/index.d.ts +0 -5
  182. package/dist/types/src/blueprints/functions/index.d.ts.map +0 -1
  183. package/dist/types/src/blueprints/functions/move.d.ts +0 -16
  184. package/dist/types/src/blueprints/functions/move.d.ts.map +0 -1
  185. package/dist/types/src/blueprints/functions/play.d.ts +0 -17
  186. package/dist/types/src/blueprints/functions/play.d.ts.map +0 -1
  187. package/dist/types/src/blueprints/functions/print.d.ts +0 -8
  188. package/dist/types/src/blueprints/functions/print.d.ts.map +0 -1
  189. package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +0 -12
  190. package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +0 -1
  191. package/dist/types/src/capabilities/artifact-definition/index.d.ts +0 -3
  192. package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +0 -1
  193. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -10
  194. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
  195. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
  196. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
  197. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  198. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  199. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  200. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  201. package/dist/types/src/cli/index.d.ts +0 -2
  202. package/dist/types/src/cli/index.d.ts.map +0 -1
  203. package/dist/types/src/cli/plugin.d.ts +0 -3
  204. package/dist/types/src/cli/plugin.d.ts.map +0 -1
  205. package/dist/types/src/components/Card.stories.d.ts.map +0 -1
  206. package/dist/types/src/components/Chessboard.d.ts.map +0 -1
  207. package/dist/types/src/components/Chessboard.stories.d.ts +0 -46
  208. package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
  209. package/dist/types/src/components/ChessboardArticle.d.ts +0 -6
  210. package/dist/types/src/components/ChessboardArticle.d.ts.map +0 -1
  211. package/dist/types/src/components/ChessboardContainer.d.ts +0 -7
  212. package/dist/types/src/components/ChessboardContainer.d.ts.map +0 -1
  213. package/dist/types/src/components/Info.d.ts.map +0 -1
  214. package/src/blueprints/functions/create.ts +0 -38
  215. package/src/blueprints/functions/index.ts +0 -8
  216. package/src/blueprints/functions/move.ts +0 -48
  217. package/src/blueprints/functions/play.ts +0 -58
  218. package/src/blueprints/functions/print.ts +0 -42
  219. package/src/capabilities/artifact-definition/artifact-definition.ts +0 -135
  220. package/src/capabilities/artifact-definition/index.ts +0 -7
  221. package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -24
  222. package/src/capabilities/blueprint-definition/index.ts +0 -7
  223. package/src/capabilities/react-surface/index.ts +0 -7
  224. package/src/capabilities/react-surface/react-surface.tsx +0 -28
  225. package/src/cli/index.ts +0 -5
  226. package/src/cli/plugin.ts +0 -27
  227. package/src/components/Card.stories.tsx +0 -47
  228. package/src/components/ChessboardArticle.tsx +0 -70
  229. package/src/components/ChessboardContainer.tsx +0 -40
@@ -1,46 +0,0 @@
1
- import { type StoryObj } from '@storybook/react-vite';
2
- import React from 'react';
3
- import { Chess } from '../types';
4
- type StoryProps = {
5
- pgn?: string;
6
- };
7
- declare const meta: {
8
- title: string;
9
- component: ({ pgn }: StoryProps) => React.JSX.Element;
10
- decorators: import("@storybook/react").Decorator[];
11
- parameters: {
12
- layout: string;
13
- translations: [{
14
- readonly 'en-US': {
15
- readonly [Chess.Game.typename]: {
16
- readonly 'typename label': "Game";
17
- readonly 'typename label_zero': "Games";
18
- readonly 'typename label_one': "Game";
19
- readonly 'typename label_other': "Games";
20
- readonly 'object name placeholder': "New game";
21
- readonly 'rename object label': "Rename game";
22
- readonly 'delete object label': "Delete game";
23
- readonly 'object deleted label': "Game deleted";
24
- };
25
- readonly [meta.id]: {
26
- readonly 'plugin name': "Chess";
27
- readonly 'delete game label': "Delete";
28
- readonly 'game.checkmate label': "Checkmate";
29
- readonly 'game.stalemate label': "Stalemate";
30
- readonly 'game.draw label': "Draw";
31
- readonly 'game.check label': "Check";
32
- readonly 'select player button': "Select player";
33
- readonly 'toggle info button': "Toggle info";
34
- readonly 'close info button': "Close info";
35
- readonly 'flip board button': "Flip board";
36
- };
37
- };
38
- }];
39
- };
40
- };
41
- export default meta;
42
- type Story = StoryObj<typeof meta>;
43
- export declare const Default: Story;
44
- export declare const EndGame: Story;
45
- export declare const Promption: Story;
46
- //# sourceMappingURL=Chessboard.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Chessboard.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Chessboard.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAkB,MAAM,OAAO,CAAC;AAMvC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,KAAK,UAAU,GAAG;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAOF,QAAA,MAAM,IAAI;;yBALqB,UAAU;;;;;;yBAZc,CAAQ,KAC5D,CAAC,IAAI,CAAC,QAAQ,CAAC;;;;;;;;;;yBAaN,CAAQ,IAAI,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;CAWS,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC"}
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
3
- import { type Chess } from '../types';
4
- export type ChessboardArticleProps = SurfaceComponentProps<Chess.Game>;
5
- export declare const ChessboardArticle: ({ role, subject: game }: ChessboardArticleProps) => React.JSX.Element;
6
- //# sourceMappingURL=ChessboardArticle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChessboardArticle.d.ts","sourceRoot":"","sources":["../../../../src/components/ChessboardArticle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAMlE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAItC,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAEvE,eAAO,MAAM,iBAAiB,GAAI,yBAAyB,sBAAsB,sBAmDhF,CAAC"}
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
3
- import { type Chess } from '../types';
4
- export type ChessboardContainerProps = SurfaceComponentProps<Chess.Game>;
5
- export declare const ChessboardContainer: ({ role, subject: game }: ChessboardContainerProps) => React.JSX.Element | null;
6
- export default ChessboardContainer;
7
- //# sourceMappingURL=ChessboardContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChessboardContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ChessboardContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAKtC,MAAM,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAEzE,eAAO,MAAM,mBAAmB,GAAI,yBAAyB,wBAAwB,6BAqBpF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Info.d.ts","sourceRoot":"","sources":["../../../../src/components/Info.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,KAAK,GAAG,EAAsD,MAAM,OAAO,CAAC;AAK5F,OAAO,EAA4B,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,KAAK,MAAM,EAAuB,MAAM,0BAA0B,CAAC;AAK5E,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAIvD,MAAM,MAAM,SAAS,GAAG,eAAe,CACrC;IACE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,GAAG,IAAI,CAAC,YAAY,EAAE,KAAK,GAAG,KAAK,GAAG,UAAU,CAAC,CACnD,CAAC;AAEF,eAAO,MAAM,IAAI;0EAAmF,SAAS;;CA+D5G,CAAC;AAQF,KAAK,YAAY,GAAG,eAAe,CAAC;IAClC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC,CAAC"}
@@ -1,38 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
- import * as Schema from 'effect/Schema';
7
-
8
- import { Database } from '@dxos/echo';
9
- import { defineFunction } from '@dxos/functions';
10
-
11
- import { Chess } from '../../types';
12
-
13
- export default defineFunction({
14
- key: 'dxos.org/function/chess/create',
15
- name: 'Create Chess',
16
- description: 'Creates a new chess game.',
17
- inputSchema: Schema.Struct({
18
- name: Schema.optional(
19
- Schema.String.annotations({
20
- description: 'Name of the game.',
21
- }),
22
- ),
23
- pgn: Schema.optional(
24
- Schema.String.annotations({
25
- description: 'Portable Game Notation.',
26
- }),
27
- ),
28
- fen: Schema.optional(
29
- Schema.String.annotations({
30
- description: 'Forsyth-Edwards Notation.',
31
- }),
32
- ),
33
- }),
34
- outputSchema: Chess.Game,
35
- handler: Effect.fn(function* ({ data: { name, pgn, fen } }) {
36
- return yield* Database.add(Chess.make({ name, pgn, fen }));
37
- }),
38
- });
@@ -1,8 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- export { default as create } from './create';
6
- export { default as move } from './move';
7
- export { default as play } from './play';
8
- export { default as print } from './print';
@@ -1,48 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Chess as ChessJS } from 'chess.js';
6
- import * as Effect from 'effect/Effect';
7
- import * as Schema from 'effect/Schema';
8
-
9
- import { Database, Obj, Type } from '@dxos/echo';
10
- import { defineFunction } from '@dxos/functions';
11
-
12
- import { Chess } from '../../types';
13
-
14
- export default defineFunction({
15
- key: 'dxos.org/function/chess/move',
16
- name: 'Move',
17
- description: 'Makes a move in the given chess game.',
18
- inputSchema: Schema.Struct({
19
- game: Type.Ref(Chess.Game).annotations({
20
- description: 'The ID of the chess object.',
21
- }),
22
- move: Schema.String.annotations({
23
- description: 'The move to make in the chess game.',
24
- examples: ['e4', 'Bf3'],
25
- }),
26
- }),
27
- outputSchema: Schema.Struct({
28
- pgn: Schema.String.annotations({
29
- description: 'The PGN of the game after the move was played.',
30
- }),
31
- }),
32
- handler: Effect.fn(function* ({ data: { game, move } }) {
33
- const object = yield* Database.load(game);
34
- const chess = new ChessJS();
35
- if (object.pgn) {
36
- chess.loadPgn(object.pgn);
37
- } else if (object.fen) {
38
- chess.load(object.fen);
39
- }
40
-
41
- chess.move(move, { strict: false });
42
- const pgn = chess.pgn();
43
- Obj.change(object, (o) => {
44
- o.pgn = pgn;
45
- });
46
- return { pgn };
47
- }),
48
- });
@@ -1,58 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Chess as ChessJS } from 'chess.js';
6
- import * as Effect from 'effect/Effect';
7
- import * as Schema from 'effect/Schema';
8
-
9
- import { Database, Obj, Type } from '@dxos/echo';
10
- import { defineFunction } from '@dxos/functions';
11
-
12
- import { Chess } from '../../types';
13
-
14
- export default defineFunction({
15
- key: 'dxos.org/function/chess/play',
16
- name: 'Play',
17
- description: 'Uses the chess engine to play the next move.',
18
- inputSchema: Schema.Struct({
19
- game: Type.Ref(Chess.Game).annotations({
20
- description: 'The ID of the chess object.',
21
- }),
22
- side: Schema.optional(Schema.Literal('white', 'black', 'any')).annotations({
23
- description: 'The side to play.',
24
- defaultValue: 'any',
25
- }),
26
- }),
27
- outputSchema: Schema.Struct({
28
- pgn: Schema.String.annotations({
29
- description: 'The PGN of the game after the move was played.',
30
- }),
31
- move: Schema.optional(Schema.String).annotations({
32
- description: 'The move that was played.',
33
- }),
34
- }),
35
- handler: Effect.fn(function* ({ data: { game, side = 'any' } }) {
36
- const object = yield* Database.load(game);
37
- const chess = new ChessJS();
38
- if (object.pgn) {
39
- chess.loadPgn(object.pgn);
40
- } else if (object.fen) {
41
- chess.load(object.fen);
42
- }
43
-
44
- if (!(side === 'any' || (chess.turn() === 'w' && side === 'white') || (chess.turn() === 'b' && side === 'black'))) {
45
- return { move: undefined, pgn: object.pgn! };
46
- }
47
-
48
- const moves = chess.moves();
49
- const move = moves[Math.floor(Math.random() * moves.length)];
50
-
51
- chess.move(move, { strict: false });
52
- const pgn = chess.pgn();
53
- Obj.change(object, (o) => {
54
- o.pgn = pgn;
55
- });
56
- return { move, pgn };
57
- }),
58
- });
@@ -1,42 +0,0 @@
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
- });
@@ -1,135 +0,0 @@
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
- );
@@ -1,7 +0,0 @@
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'));
@@ -1,24 +0,0 @@
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
- export type BlueprintCapabilities = [
13
- Capability.Capability<typeof AppCapabilities.Functions>,
14
- Capability.Capability<typeof AppCapabilities.BlueprintDefinition>,
15
- ];
16
-
17
- const blueprintDefinition = Capability.makeModule<[], BlueprintCapabilities>(() =>
18
- Effect.succeed([
19
- Capability.contributes(AppCapabilities.Functions, ChessBlueprint.functions),
20
- Capability.contributes(AppCapabilities.BlueprintDefinition, ChessBlueprint.make()),
21
- ]),
22
- );
23
-
24
- export default blueprintDefinition;
@@ -1,7 +0,0 @@
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'));
@@ -1,7 +0,0 @@
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'));
@@ -1,28 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
- import React from 'react';
7
-
8
- import { Capabilities, Capability } from '@dxos/app-framework';
9
- import { Surface } from '@dxos/app-framework/ui';
10
- import { Obj } from '@dxos/echo';
11
-
12
- import { ChessboardContainer } from '../../components';
13
- import { meta } from '../../meta';
14
- import { Chess } from '../../types';
15
-
16
- export default Capability.makeModule(() =>
17
- Effect.succeed(
18
- Capability.contributes(Capabilities.ReactSurface, [
19
- Surface.create({
20
- id: meta.id,
21
- role: ['article', 'section', 'card--content'],
22
- // TODO(burdon): Could this be standardized so that we don't require a subject property.
23
- filter: (data): data is { subject: Chess.Game } => Obj.instanceOf(Chess.Game, data.subject),
24
- component: ({ data, role }) => <ChessboardContainer role={role} subject={data.subject} />,
25
- }),
26
- ]),
27
- ),
28
- );
package/src/cli/index.ts DELETED
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export * from './plugin';
package/src/cli/plugin.ts DELETED
@@ -1,27 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
-
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 { meta } from '../meta';
12
- import { Chess } from '../types';
13
-
14
- // TODO(wittjosiah): Factor out shared modules.
15
- export const ChessPlugin = Plugin.define(meta).pipe(
16
- AppPlugin.addMetadataModule({
17
- metadata: {
18
- id: Chess.Game.typename,
19
- metadata: {
20
- createObject: ((props) => Effect.sync(() => Chess.make(props))) satisfies CreateObject,
21
- addToCollectionOnCreate: true,
22
- },
23
- },
24
- }),
25
- AppPlugin.addSchemaModule({ schema: [Chess.Game] }),
26
- Plugin.make,
27
- );
@@ -1,47 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React, { useMemo } from 'react';
7
-
8
- import { withTheme } from '@dxos/react-ui/testing';
9
- import { CardContainer } from '@dxos/react-ui-mosaic/testing';
10
-
11
- import { meta as pluginMeta } from '../meta';
12
- import { Chess } from '../types';
13
-
14
- import { Chessboard } from './Chessboard';
15
-
16
- const SAMPLE_PGN =
17
- '1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 d5 8. exd5 Nxd5 9. O-O Be6 10. Qb3 Na5 11. Qa4+ c6 12. Bxd5 Bxc3 13. Bxe6 fxe6 14. d5 Qg5 15. dxe6 Qg4 16. e7 Kf7 17. bxc3 Kg6 *';
18
-
19
- // TODO(wittjosiah): ECHO objects don't work when passed via Storybook args.
20
- const CardStory = () => {
21
- const game = useMemo(() => Chess.make({ pgn: SAMPLE_PGN }), []);
22
- return (
23
- <CardContainer icon={pluginMeta.icon}>
24
- <Chessboard.Root game={game}>
25
- <Chessboard.Content>
26
- <Chessboard.Board />
27
- </Chessboard.Content>
28
- </Chessboard.Root>
29
- </CardContainer>
30
- );
31
- };
32
-
33
- const meta = {
34
- title: 'plugins/plugin-chess/Card',
35
- render: () => <CardStory />,
36
- decorators: [withTheme()],
37
- parameters: {
38
- layout: 'centered',
39
- },
40
- tags: ['cards'],
41
- } satisfies Meta;
42
-
43
- export default meta;
44
-
45
- type Story = StoryObj<typeof meta>;
46
-
47
- export const Popover: Story = {};
@@ -1,70 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import React, { useCallback, useRef, useState } from 'react';
6
-
7
- import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
8
- import { Layout, Toolbar, useTranslation } from '@dxos/react-ui';
9
- import { type Player } from '@dxos/react-ui-gameboard';
10
- import { mx } from '@dxos/ui-theme';
11
-
12
- import { meta } from '../meta';
13
- import { type Chess } from '../types';
14
-
15
- import { Chessboard, type ChessboardController, type ChessboardInfoProps } from './Chessboard';
16
-
17
- export type ChessboardArticleProps = SurfaceComponentProps<Chess.Game>;
18
-
19
- export const ChessboardArticle = ({ role, subject: game }: ChessboardArticleProps) => {
20
- const { t } = useTranslation(meta.id);
21
- const [orientation, setOrientation] = useState<Player>('white');
22
- const [open, setOpen] = useState(true);
23
- const controller = useRef<ChessboardController>(null);
24
-
25
- // TODO(burdon): Keyboard handler.
26
- const handleSelect = useCallback<NonNullable<ChessboardInfoProps['onSelect']>>((index) => {
27
- controller.current?.setMoveNumber(index);
28
- }, []);
29
-
30
- return (
31
- <Layout.Main toolbar classNames='@container'>
32
- <Chessboard.Root game={game} ref={controller}>
33
- <Toolbar.Root>
34
- <Toolbar.IconButton
35
- icon='ph--info--regular'
36
- iconOnly
37
- label={t('toggle info button')}
38
- disabled={open}
39
- classNames={mx('invisible @3xl:visible')}
40
- onClick={() => setOpen((open) => !open)}
41
- />
42
- </Toolbar.Root>
43
- <div
44
- className={mx(
45
- 'grid bs-full is-full gap-2',
46
- open && '@3xl:grid-cols-[1fr_320px]',
47
- role === 'section' && 'aspect-square',
48
- role === 'section' && open && '@3xl:aspect-auto',
49
- )}
50
- >
51
- <Chessboard.Content>
52
- <Chessboard.Board classNames='m-4 rounded-sm overflow-hidden' orientation={orientation} />
53
- </Chessboard.Content>
54
- {open && (
55
- <div className='hidden @3xl:flex flex-col p-8 justify-center items-center overflow-hidden'>
56
- <Chessboard.Info
57
- orientation={orientation}
58
- min={8}
59
- max={8}
60
- onOrientationChange={setOrientation}
61
- onClose={() => setOpen(false)}
62
- onSelect={handleSelect}
63
- />
64
- </div>
65
- )}
66
- </div>
67
- </Chessboard.Root>
68
- </Layout.Main>
69
- );
70
- };