@dxos/plugin-chess 0.8.4-main.422d1c7879 → 0.8.4-main.4f23b4e393

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 (194) hide show
  1. package/dist/lib/neutral/ChessArticle-QLLKZGPH.mjs +88 -0
  2. package/dist/lib/neutral/ChessArticle-QLLKZGPH.mjs.map +7 -0
  3. package/dist/lib/neutral/ChessCard-I5RSZZIP.mjs +19 -0
  4. package/dist/lib/neutral/ChessCard-I5RSZZIP.mjs.map +7 -0
  5. package/dist/lib/neutral/ChessPlugin.mjs +30 -0
  6. package/dist/lib/neutral/ChessPlugin.mjs.map +7 -0
  7. package/dist/lib/neutral/ChessPlugin.node.mjs +23 -0
  8. package/dist/lib/neutral/ChessPlugin.node.mjs.map +7 -0
  9. package/dist/lib/neutral/blueprint-definition-PZXHAYLD.mjs +15 -0
  10. package/dist/lib/neutral/blueprint-definition-PZXHAYLD.mjs.map +7 -0
  11. package/dist/lib/neutral/blueprints/index.mjs +8 -0
  12. package/dist/lib/neutral/capabilities/index.mjs +13 -0
  13. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  14. package/dist/lib/neutral/chunk-5UOTTW6U.mjs +8 -0
  15. package/dist/lib/neutral/chunk-5UOTTW6U.mjs.map +7 -0
  16. package/dist/lib/neutral/chunk-E4LZPHAQ.mjs +148 -0
  17. package/dist/lib/neutral/chunk-E4LZPHAQ.mjs.map +7 -0
  18. package/dist/lib/neutral/chunk-FFXSIHW6.mjs +21 -0
  19. package/dist/lib/neutral/chunk-FFXSIHW6.mjs.map +7 -0
  20. package/dist/lib/{browser/chunk-MC7L6JNC.mjs → neutral/chunk-XWKNXG62.mjs} +8 -10
  21. package/dist/lib/neutral/chunk-XWKNXG62.mjs.map +7 -0
  22. package/dist/lib/{browser → neutral/components}/index.mjs +8 -158
  23. package/dist/lib/neutral/components/index.mjs.map +7 -0
  24. package/dist/lib/neutral/containers/index.mjs +11 -0
  25. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  26. package/dist/lib/neutral/game-variant-24UKIBRM.mjs +40 -0
  27. package/dist/lib/neutral/game-variant-24UKIBRM.mjs.map +7 -0
  28. package/dist/lib/neutral/index.mjs +18 -0
  29. package/dist/lib/neutral/meta.json +1 -0
  30. package/dist/lib/neutral/meta.mjs +8 -0
  31. package/dist/lib/neutral/move-RQZ7BJY3.mjs +37 -0
  32. package/dist/lib/neutral/move-RQZ7BJY3.mjs.map +7 -0
  33. package/dist/lib/neutral/operation-handler-EKZKFQUG.mjs +13 -0
  34. package/dist/lib/neutral/operation-handler-EKZKFQUG.mjs.map +7 -0
  35. package/dist/lib/{browser/types → neutral/operations}/index.mjs +3 -3
  36. package/dist/lib/neutral/play-GDGCEPQL.mjs +46 -0
  37. package/dist/lib/neutral/play-GDGCEPQL.mjs.map +7 -0
  38. package/dist/lib/neutral/plugin.mjs +16 -0
  39. package/dist/lib/neutral/plugin.mjs.map +7 -0
  40. package/dist/lib/{browser/print-EW7LPW4D.mjs → neutral/print-ZQA74KZI.mjs} +5 -6
  41. package/dist/lib/neutral/print-ZQA74KZI.mjs.map +7 -0
  42. package/dist/lib/neutral/translations.mjs +34 -0
  43. package/dist/lib/neutral/translations.mjs.map +7 -0
  44. package/dist/lib/neutral/types/index.mjs +10 -0
  45. package/dist/types/src/ChessPlugin.d.ts +1 -0
  46. package/dist/types/src/ChessPlugin.d.ts.map +1 -1
  47. package/dist/types/src/ChessPlugin.node.d.ts +8 -0
  48. package/dist/types/src/ChessPlugin.node.d.ts.map +1 -0
  49. package/dist/types/src/blueprints/chess-blueprint.d.ts +2 -2
  50. package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -1
  51. package/dist/types/src/blueprints/index.d.ts +0 -1
  52. package/dist/types/src/blueprints/index.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/blueprint-definition.d.ts +2 -2
  54. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/game-variant.d.ts +6 -0
  56. package/dist/types/src/capabilities/game-variant.d.ts.map +1 -0
  57. package/dist/types/src/capabilities/index.d.ts +3 -3
  58. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  59. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  60. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  61. package/dist/types/src/components/Chessboard/Chessboard.d.ts +6 -2
  62. package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -1
  63. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +32 -23
  64. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -1
  65. package/dist/types/src/components/Chessboard/Info.d.ts +4 -5
  66. package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -1
  67. package/dist/types/src/components/Chessboard/types.d.ts +2 -2
  68. package/dist/types/src/components/Chessboard/types.d.ts.map +1 -1
  69. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +3 -4
  70. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -1
  71. package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +32 -23
  72. package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -1
  73. package/dist/types/src/containers/ChessCard/ChessCard.d.ts +3 -4
  74. package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -1
  75. package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -1
  76. package/dist/types/src/index.d.ts +0 -2
  77. package/dist/types/src/index.d.ts.map +1 -1
  78. package/dist/types/src/operations/index.d.ts +2 -3
  79. package/dist/types/src/operations/index.d.ts.map +1 -1
  80. package/dist/types/src/operations/move.d.ts +3 -3
  81. package/dist/types/src/operations/move.d.ts.map +1 -1
  82. package/dist/types/src/operations/play.d.ts +3 -3
  83. package/dist/types/src/operations/play.d.ts.map +1 -1
  84. package/dist/types/src/operations/print.d.ts +3 -3
  85. package/dist/types/src/operations/print.d.ts.map +1 -1
  86. package/dist/types/src/{cli/plugin.d.ts → plugin.d.ts} +1 -0
  87. package/dist/types/src/plugin.d.ts.map +1 -0
  88. package/dist/types/src/translations.d.ts +32 -24
  89. package/dist/types/src/translations.d.ts.map +1 -1
  90. package/dist/types/src/types/Chess.d.ts +10 -19
  91. package/dist/types/src/types/Chess.d.ts.map +1 -1
  92. package/dist/types/src/types/ChessOperation.d.ts +24 -0
  93. package/dist/types/src/types/ChessOperation.d.ts.map +1 -0
  94. package/dist/types/src/types/index.d.ts +1 -0
  95. package/dist/types/src/types/index.d.ts.map +1 -1
  96. package/dist/types/tsconfig.tsbuildinfo +1 -1
  97. package/package.json +91 -68
  98. package/src/ChessPlugin.node.ts +23 -0
  99. package/src/ChessPlugin.test.ts +8 -10
  100. package/src/ChessPlugin.tsx +11 -34
  101. package/src/blueprints/chess-blueprint.ts +6 -9
  102. package/src/blueprints/index.ts +0 -1
  103. package/src/capabilities/blueprint-definition.ts +2 -0
  104. package/src/capabilities/game-variant.ts +42 -0
  105. package/src/capabilities/index.ts +3 -2
  106. package/src/capabilities/operation-handler.ts +3 -3
  107. package/src/components/Chessboard/Chessboard.stories.tsx +3 -3
  108. package/src/components/Chessboard/Chessboard.tsx +4 -4
  109. package/src/components/Chessboard/Info.tsx +3 -63
  110. package/src/components/Chessboard/types.ts +1 -1
  111. package/src/containers/ChessArticle/ChessArticle.stories.tsx +9 -3
  112. package/src/containers/ChessArticle/ChessArticle.tsx +45 -10
  113. package/src/containers/ChessCard/ChessCard.stories.tsx +7 -2
  114. package/src/containers/ChessCard/ChessCard.tsx +10 -5
  115. package/src/index.ts +0 -3
  116. package/src/operations/index.ts +2 -7
  117. package/src/operations/move.ts +13 -13
  118. package/src/operations/play.ts +14 -14
  119. package/src/operations/print.ts +3 -3
  120. package/src/plugin.ts +11 -0
  121. package/src/translations.ts +6 -10
  122. package/src/types/Chess.ts +19 -22
  123. package/src/{operations/definitions.ts → types/ChessOperation.ts} +10 -34
  124. package/src/types/index.ts +1 -0
  125. package/dist/lib/browser/blueprints/index.mjs +0 -14
  126. package/dist/lib/browser/chunk-2TJN26DN.mjs +0 -67
  127. package/dist/lib/browser/chunk-2TJN26DN.mjs.map +0 -7
  128. package/dist/lib/browser/chunk-JZMN24DY.mjs +0 -28
  129. package/dist/lib/browser/chunk-JZMN24DY.mjs.map +0 -7
  130. package/dist/lib/browser/chunk-MC7L6JNC.mjs.map +0 -7
  131. package/dist/lib/browser/chunk-XAJZK6Z2.mjs +0 -110
  132. package/dist/lib/browser/chunk-XAJZK6Z2.mjs.map +0 -7
  133. package/dist/lib/browser/cli/index.mjs +0 -34
  134. package/dist/lib/browser/cli/index.mjs.map +0 -7
  135. package/dist/lib/browser/create-AJHN4QT4.mjs +0 -24
  136. package/dist/lib/browser/create-AJHN4QT4.mjs.map +0 -7
  137. package/dist/lib/browser/index.mjs.map +0 -7
  138. package/dist/lib/browser/meta.json +0 -1
  139. package/dist/lib/browser/move-T2NLRBR4.mjs +0 -36
  140. package/dist/lib/browser/move-T2NLRBR4.mjs.map +0 -7
  141. package/dist/lib/browser/operations/index.mjs +0 -19
  142. package/dist/lib/browser/play-7VTMD3SJ.mjs +0 -45
  143. package/dist/lib/browser/play-7VTMD3SJ.mjs.map +0 -7
  144. package/dist/lib/browser/print-EW7LPW4D.mjs.map +0 -7
  145. package/dist/lib/node-esm/blueprints/index.mjs +0 -15
  146. package/dist/lib/node-esm/chunk-4HZWCKMR.mjs +0 -38
  147. package/dist/lib/node-esm/chunk-4HZWCKMR.mjs.map +0 -7
  148. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  149. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
  150. package/dist/lib/node-esm/chunk-LQEDIKCV.mjs +0 -29
  151. package/dist/lib/node-esm/chunk-LQEDIKCV.mjs.map +0 -7
  152. package/dist/lib/node-esm/chunk-NYU5JVXP.mjs +0 -111
  153. package/dist/lib/node-esm/chunk-NYU5JVXP.mjs.map +0 -7
  154. package/dist/lib/node-esm/chunk-OIRJVY2R.mjs +0 -68
  155. package/dist/lib/node-esm/chunk-OIRJVY2R.mjs.map +0 -7
  156. package/dist/lib/node-esm/cli/index.mjs +0 -35
  157. package/dist/lib/node-esm/cli/index.mjs.map +0 -7
  158. package/dist/lib/node-esm/create-QSETDT4N.mjs +0 -25
  159. package/dist/lib/node-esm/create-QSETDT4N.mjs.map +0 -7
  160. package/dist/lib/node-esm/index.mjs +0 -390
  161. package/dist/lib/node-esm/index.mjs.map +0 -7
  162. package/dist/lib/node-esm/meta.json +0 -1
  163. package/dist/lib/node-esm/move-5F2ANDTE.mjs +0 -37
  164. package/dist/lib/node-esm/move-5F2ANDTE.mjs.map +0 -7
  165. package/dist/lib/node-esm/operations/index.mjs +0 -20
  166. package/dist/lib/node-esm/play-W4DQCQRX.mjs +0 -46
  167. package/dist/lib/node-esm/play-W4DQCQRX.mjs.map +0 -7
  168. package/dist/lib/node-esm/print-UJHXAXMS.mjs +0 -31
  169. package/dist/lib/node-esm/print-UJHXAXMS.mjs.map +0 -7
  170. package/dist/lib/node-esm/types/index.mjs +0 -9
  171. package/dist/lib/node-esm/types/index.mjs.map +0 -7
  172. package/dist/types/src/capabilities/artifact-definition.d.ts +0 -12
  173. package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
  174. package/dist/types/src/capabilities/react-surface.d.ts +0 -5
  175. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  176. package/dist/types/src/cli/index.d.ts +0 -2
  177. package/dist/types/src/cli/index.d.ts.map +0 -1
  178. package/dist/types/src/cli/plugin.d.ts.map +0 -1
  179. package/dist/types/src/operations/create.d.ts +0 -5
  180. package/dist/types/src/operations/create.d.ts.map +0 -1
  181. package/dist/types/src/operations/definitions.d.ts +0 -51
  182. package/dist/types/src/operations/definitions.d.ts.map +0 -1
  183. package/src/capabilities/artifact-definition.ts +0 -135
  184. package/src/capabilities/react-surface.tsx +0 -35
  185. package/src/cli/index.ts +0 -5
  186. package/src/cli/plugin.ts +0 -37
  187. package/src/operations/create.ts +0 -21
  188. /package/dist/lib/{browser → neutral}/blueprints/index.mjs.map +0 -0
  189. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  190. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
  191. /package/dist/lib/{browser/operations → neutral}/index.mjs.map +0 -0
  192. /package/dist/lib/{browser/types/index.mjs.map → neutral/meta.mjs.map} +0 -0
  193. /package/dist/lib/{node-esm/blueprints → neutral/operations}/index.mjs.map +0 -0
  194. /package/dist/lib/{node-esm/operations → neutral/types}/index.mjs.map +0 -0
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/operation';\n\nconst Handlers = OperationHandlerSet.lazy(\n () => import('./create'),\n () => import('./move'),\n () => import('./play'),\n () => import('./print'),\n);\n\nexport { Create, Move, Play, Print } from './definitions';\n\nexport const ChessHandlers = Handlers;\n"],
5
- "mappings": ";;;;;;;;;;;;AAAA;;;;;;;;AAIA,SAASA,2BAA2B;AAEpC,IAAMC,WAAWC,oBAAoBC,KACnC,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,sBAAA,CAAA;AAKR,IAAMC,gBAAgBH;",
6
- "names": ["OperationHandlerSet", "Handlers", "OperationHandlerSet", "lazy", "ChessHandlers"]
7
- }
@@ -1,111 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- Chess_exports
4
- } from "./chunk-OIRJVY2R.mjs";
5
-
6
- // src/operations/definitions.ts
7
- import * as Schema from "effect/Schema";
8
- import { Database, Ref } from "@dxos/echo";
9
- import { Operation } from "@dxos/operation";
10
- var Create = Operation.make({
11
- meta: {
12
- key: "org.dxos.function.chess.create",
13
- name: "Create Chess",
14
- description: "Creates a new chess game."
15
- },
16
- input: Schema.Struct({
17
- name: Schema.optional(Schema.String.annotations({
18
- description: "Name of the game."
19
- })),
20
- pgn: Schema.optional(Schema.String.annotations({
21
- description: "Portable Game Notation."
22
- })),
23
- fen: Schema.optional(Schema.String.annotations({
24
- description: "Forsyth-Edwards Notation."
25
- }))
26
- }),
27
- output: Chess_exports.Game,
28
- services: [
29
- Database.Service
30
- ]
31
- });
32
- var Move = Operation.make({
33
- meta: {
34
- key: "org.dxos.function.chess.move",
35
- name: "Move",
36
- description: "Makes a move in the given chess game."
37
- },
38
- input: Schema.Struct({
39
- game: Ref.Ref(Chess_exports.Game).annotations({
40
- description: "The ID of the chess object."
41
- }),
42
- move: Schema.String.annotations({
43
- description: "The move to make in the chess game.",
44
- examples: [
45
- "e4",
46
- "Bf3"
47
- ]
48
- })
49
- }),
50
- output: Schema.Struct({
51
- pgn: Schema.String.annotations({
52
- description: "The PGN of the game after the move was played."
53
- })
54
- }),
55
- services: [
56
- Database.Service
57
- ]
58
- });
59
- var Play = Operation.make({
60
- meta: {
61
- key: "org.dxos.function.chess.play",
62
- name: "Play",
63
- description: "Uses the chess engine to play the next move."
64
- },
65
- input: Schema.Struct({
66
- game: Ref.Ref(Chess_exports.Game).annotations({
67
- description: "The ID of the chess object."
68
- }),
69
- side: Schema.optional(Schema.Literal("white", "black", "any")).annotations({
70
- description: "The side to play.",
71
- defaultValue: "any"
72
- })
73
- }),
74
- output: Schema.Struct({
75
- pgn: Schema.String.annotations({
76
- description: "The PGN of the game after the move was played."
77
- }),
78
- move: Schema.optional(Schema.String).annotations({
79
- description: "The move that was played."
80
- })
81
- }),
82
- services: [
83
- Database.Service
84
- ]
85
- });
86
- var Print = Operation.make({
87
- meta: {
88
- key: "org.dxos.function.chess.print",
89
- name: "Print game",
90
- description: "Prints the chess game to ASCII."
91
- },
92
- input: Schema.Struct({
93
- pgn: Schema.optional(Schema.String.annotations({
94
- description: "Portable Game Notation."
95
- })),
96
- fen: Schema.optional(Schema.String.annotations({
97
- description: "Forsyth-Edwards Notation."
98
- }))
99
- }),
100
- output: Schema.Struct({
101
- ascii: Schema.String
102
- })
103
- });
104
-
105
- export {
106
- Create,
107
- Move,
108
- Play,
109
- Print
110
- };
111
- //# sourceMappingURL=chunk-NYU5JVXP.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/definitions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Database, Ref } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\n\nimport { Chess } from '../types';\n\nexport const Create = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.create',\n name: 'Create Chess',\n description: 'Creates a new chess game.',\n },\n input: Schema.Struct({\n name: Schema.optional(\n Schema.String.annotations({\n description: 'Name of the game.',\n }),\n ),\n pgn: Schema.optional(\n Schema.String.annotations({\n description: 'Portable Game Notation.',\n }),\n ),\n fen: Schema.optional(\n Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }),\n ),\n }),\n output: Chess.Game,\n services: [Database.Service],\n});\n\nexport const Move = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.move',\n name: 'Move',\n description: 'Makes a move in the given chess game.',\n },\n input: Schema.Struct({\n game: Ref.Ref(Chess.Game).annotations({\n description: 'The ID of the chess object.',\n }),\n move: Schema.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n output: Schema.Struct({\n pgn: Schema.String.annotations({\n description: 'The PGN of the game after the move was played.',\n }),\n }),\n services: [Database.Service],\n});\n\nexport const Play = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.play',\n name: 'Play',\n description: 'Uses the chess engine to play the next move.',\n },\n input: Schema.Struct({\n game: Ref.Ref(Chess.Game).annotations({\n description: 'The ID of the chess object.',\n }),\n side: Schema.optional(Schema.Literal('white', 'black', 'any')).annotations({\n description: 'The side to play.',\n defaultValue: 'any',\n }),\n }),\n output: Schema.Struct({\n pgn: Schema.String.annotations({\n description: 'The PGN of the game after the move was played.',\n }),\n move: Schema.optional(Schema.String).annotations({\n description: 'The move that was played.',\n }),\n }),\n services: [Database.Service],\n});\n\nexport const Print = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.print',\n name: 'Print game',\n description: 'Prints the chess game to ASCII.',\n },\n input: Schema.Struct({\n pgn: Schema.optional(\n Schema.String.annotations({\n description: 'Portable Game Notation.',\n }),\n ),\n fen: Schema.optional(\n Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }),\n ),\n }),\n output: Schema.Struct({\n ascii: Schema.String,\n }),\n});\n"],
5
- "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,UAAUC,WAAW;AAC9B,SAASC,iBAAiB;AAInB,IAAMC,SAASC,UAAUC,KAAK;EACnCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBH,MAAaI,gBACJC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFM,KAAYH,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFO,KAAYJ,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA;EACAQ,QAAQC,cAAMC;EACdC,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMC,OAAOnB,UAAUC,KAAK;EACjCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBa,MAAMC,IAAIA,IAAIP,cAAMC,IAAI,EAAEL,YAAY;MACpCL,aAAa;IACf,CAAA;IACAiB,MAAab,cAAOC,YAAY;MAC9BL,aAAa;MACbkB,UAAU;QAAC;QAAM;;IACnB,CAAA;EACF,CAAA;EACAV,QAAeN,cAAO;IACpBI,KAAYF,cAAOC,YAAY;MAC7BL,aAAa;IACf,CAAA;EACF,CAAA;EACAW,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMM,OAAOxB,UAAUC,KAAK;EACjCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBa,MAAMC,IAAIA,IAAIP,cAAMC,IAAI,EAAEL,YAAY;MACpCL,aAAa;IACf,CAAA;IACAoB,MAAajB,gBAAgBkB,eAAQ,SAAS,SAAS,KAAA,CAAA,EAAQhB,YAAY;MACzEL,aAAa;MACbsB,cAAc;IAChB,CAAA;EACF,CAAA;EACAd,QAAeN,cAAO;IACpBI,KAAYF,cAAOC,YAAY;MAC7BL,aAAa;IACf,CAAA;IACAiB,MAAad,gBAAgBC,aAAM,EAAEC,YAAY;MAC/CL,aAAa;IACf,CAAA;EACF,CAAA;EACAW,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMU,QAAQ5B,UAAUC,KAAK;EAClCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBI,KAAYH,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFO,KAAYJ,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA;EACAQ,QAAeN,cAAO;IACpBsB,OAAcpB;EAChB,CAAA;AACF,CAAA;",
6
- "names": ["Schema", "Database", "Ref", "Operation", "Create", "Operation", "make", "meta", "key", "name", "description", "input", "Struct", "optional", "String", "annotations", "pgn", "fen", "output", "Chess", "Game", "services", "Database", "Service", "Move", "game", "Ref", "move", "examples", "Play", "side", "Literal", "defaultValue", "Print", "ascii"]
7
- }
@@ -1,68 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- __export
4
- } from "./chunk-HSLMI22Q.mjs";
5
-
6
- // src/types/Chess.ts
7
- var Chess_exports = {};
8
- __export(Chess_exports, {
9
- Game: () => Game,
10
- make: () => make
11
- });
12
- import { Chess as ChessJS } from "chess.js";
13
- import * as Schema from "effect/Schema";
14
- import { Annotation, Obj, Type } from "@dxos/echo";
15
- import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/internal";
16
- import { log } from "@dxos/log";
17
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-chess/src/types/Chess.ts";
18
- var Game = Schema.Struct({
19
- name: Schema.optional(Schema.String),
20
- players: Schema.Struct({
21
- white: Schema.optional(Schema.String.annotations({
22
- description: "DID of white player"
23
- })),
24
- black: Schema.optional(Schema.String.annotations({
25
- description: "DID of black player"
26
- }))
27
- }).pipe(FormInputAnnotation.set(false), Schema.optional),
28
- pgn: Schema.String.annotations({
29
- description: "Portable Game Notation."
30
- }).pipe(FormInputAnnotation.set(false), Schema.optional),
31
- fen: Schema.String.annotations({
32
- description: "Forsyth-Edwards Notation."
33
- }).pipe(FormInputAnnotation.set(false), Schema.optional)
34
- }).pipe(Type.object({
35
- typename: "org.dxos.type.chess",
36
- version: "0.1.0"
37
- }), LabelAnnotation.set([
38
- "name"
39
- ]), Annotation.IconAnnotation.set({
40
- icon: "ph--shield-chevron--regular",
41
- hue: "amber"
42
- }));
43
- var make = ({ name, pgn, fen } = {}) => {
44
- const chess = new ChessJS();
45
- if (pgn) {
46
- try {
47
- chess.loadPgn(pgn);
48
- } catch {
49
- log.warn(pgn, void 0, {
50
- F: __dxlog_file,
51
- L: 52,
52
- S: void 0,
53
- C: (f, a) => f(...a)
54
- });
55
- }
56
- }
57
- return Obj.make(Game, {
58
- name,
59
- pgn,
60
- fen,
61
- players: {}
62
- });
63
- };
64
-
65
- export {
66
- Chess_exports
67
- };
68
- //# sourceMappingURL=chunk-OIRJVY2R.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/Chess.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Type } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { log } from '@dxos/log';\n\nexport const Game = Schema.Struct({\n name: Schema.optional(Schema.String),\n players: Schema.Struct({\n white: Schema.optional(\n Schema.String.annotations({\n description: 'DID of white player',\n }),\n ),\n black: Schema.optional(\n Schema.String.annotations({\n description: 'DID of black player',\n }),\n ),\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n pgn: Schema.String.annotations({\n description: 'Portable Game Notation.',\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n fen: Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.chess',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--shield-chevron--regular',\n hue: 'amber',\n }),\n);\n\nexport interface Game extends Schema.Schema.Type<typeof Game> {}\n\nexport const make = ({ name, pgn, fen }: { name?: string; pgn?: string; fen?: string } = {}) => {\n const chess = new ChessJS();\n if (pgn) {\n try {\n chess.loadPgn(pgn);\n } catch {\n log.warn(pgn);\n }\n }\n\n return Obj.make(Game, {\n name,\n pgn,\n fen,\n players: {},\n });\n};\n"],
5
- "mappings": ";;;;;;AAAA;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,YAAYC,KAAKC,YAAY;AACtC,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,WAAW;;AAEb,IAAMC,OAAcC,cAAO;EAChCC,MAAaC,gBAAgBC,aAAM;EACnCC,SAAgBJ,cAAO;IACrBK,OAAcH,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;IAEFC,OAAcN,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA,EAAGE,KAAKb,oBAAoBc,IAAI,KAAA,GAAeR,eAAQ;EACvDS,KAAYR,cAAOG,YAAY;IAC7BC,aAAa;EACf,CAAA,EAAGE,KAAKb,oBAAoBc,IAAI,KAAA,GAAeR,eAAQ;EACvDU,KAAYT,cAAOG,YAAY;IAC7BC,aAAa;EACf,CAAA,EAAGE,KAAKb,oBAAoBc,IAAI,KAAA,GAAeR,eAAQ;AACzD,CAAA,EAAGO,KACDd,KAAKkB,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAlB,gBAAgBa,IAAI;EAAC;CAAO,GAC5BjB,WAAWuB,eAAeN,IAAI;EAC5BO,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAKK,IAAMC,OAAO,CAAC,EAAElB,MAAMU,KAAKC,IAAG,IAAoD,CAAC,MAAC;AACzF,QAAMQ,QAAQ,IAAI7B,QAAAA;AAClB,MAAIoB,KAAK;AACP,QAAI;AACFS,YAAMC,QAAQV,GAAAA;IAChB,QAAQ;AACNb,UAAIwB,KAAKX,KAAAA,QAAAA;;;;;;IACX;EACF;AAEA,SAAOjB,IAAIyB,KAAKpB,MAAM;IACpBE;IACAU;IACAC;IACAR,SAAS,CAAC;EACZ,CAAA;AACF;",
6
- "names": ["Chess", "ChessJS", "Schema", "Annotation", "Obj", "Type", "FormInputAnnotation", "LabelAnnotation", "log", "Game", "Struct", "name", "optional", "String", "players", "white", "annotations", "description", "black", "pipe", "set", "pgn", "fen", "object", "typename", "version", "IconAnnotation", "icon", "hue", "make", "chess", "loadPgn", "warn"]
7
- }
@@ -1,35 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import "../chunk-HSLMI22Q.mjs";
3
-
4
- // src/cli/plugin.ts
5
- import * as Effect from "effect/Effect";
6
- import { Plugin } from "@dxos/app-framework";
7
- import { AppPlugin } from "@dxos/app-toolkit";
8
- import { Operation } from "@dxos/operation";
9
- import { SpaceOperation } from "@dxos/plugin-space/operations";
10
- import { meta } from "#meta";
11
- import { Chess } from "#types";
12
- var ChessPlugin = Plugin.define(meta).pipe(AppPlugin.addMetadataModule({
13
- metadata: {
14
- id: Chess.Game.typename,
15
- metadata: {
16
- createObject: (props, options) => Effect.gen(function* () {
17
- const object = Chess.make(props);
18
- return yield* Operation.invoke(SpaceOperation.AddObject, {
19
- object,
20
- target: options.target,
21
- hidden: true,
22
- targetNodeId: options.targetNodeId
23
- });
24
- })
25
- }
26
- }
27
- }), AppPlugin.addSchemaModule({
28
- schema: [
29
- Chess.Game
30
- ]
31
- }), Plugin.make);
32
- export {
33
- ChessPlugin
34
- };
35
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/cli/plugin.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\nimport { SpaceOperation } from '@dxos/plugin-space/operations';\nimport { type CreateObject } from '@dxos/plugin-space/types';\n\nimport { meta } from '#meta';\nimport { Chess } from '#types';\n\n// TODO(wittjosiah): Factor out shared modules.\nexport const ChessPlugin = Plugin.define(meta).pipe(\n AppPlugin.addMetadataModule({\n metadata: {\n id: Chess.Game.typename,\n metadata: {\n createObject: ((props, options) =>\n Effect.gen(function* () {\n const object = Chess.make(props);\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n hidden: true,\n targetNodeId: options.targetNodeId,\n });\n })) satisfies CreateObject,\n },\n },\n }),\n AppPlugin.addSchemaModule({ schema: [Chess.Game] }),\n Plugin.make,\n);\n"],
5
- "mappings": ";;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB;AAG/B,SAASC,YAAY;AACrB,SAASC,aAAa;AAGf,IAAMC,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CC,UAAUC,kBAAkB;EAC1BC,UAAU;IACRC,IAAIC,MAAMC,KAAKC;IACfJ,UAAU;MACRK,cAAe,CAACC,OAAOC,YACdC,WAAI,aAAA;AACT,cAAMC,SAASP,MAAMQ,KAAKJ,KAAAA;AAC1B,eAAO,OAAOK,UAAUC,OAAOC,eAAeC,WAAW;UACvDL;UACAM,QAAQR,QAAQQ;UAChBC,QAAQ;UACRC,cAAcV,QAAQU;QACxB,CAAA;MACF,CAAA;IACJ;EACF;AACF,CAAA,GACAnB,UAAUoB,gBAAgB;EAAEC,QAAQ;IAACjB,MAAMC;;AAAM,CAAA,GACjDT,OAAOgB,IAAI;",
6
- "names": ["Effect", "Plugin", "AppPlugin", "Operation", "SpaceOperation", "meta", "Chess", "ChessPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addMetadataModule", "metadata", "id", "Chess", "Game", "typename", "createObject", "props", "options", "gen", "object", "make", "Operation", "invoke", "SpaceOperation", "AddObject", "target", "hidden", "targetNodeId", "addSchemaModule", "schema"]
7
- }
@@ -1,25 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- Create
4
- } from "./chunk-NYU5JVXP.mjs";
5
- import {
6
- Chess_exports
7
- } from "./chunk-OIRJVY2R.mjs";
8
- import "./chunk-HSLMI22Q.mjs";
9
-
10
- // src/operations/create.ts
11
- import * as Effect from "effect/Effect";
12
- import { Database } from "@dxos/echo";
13
- import { Operation } from "@dxos/operation";
14
- var handler = Create.pipe(Operation.withHandler(Effect.fn(function* ({ name, pgn, fen }) {
15
- return yield* Database.add(Chess_exports.make({
16
- name,
17
- pgn,
18
- fen
19
- }));
20
- })));
21
- var create_default = handler;
22
- export {
23
- create_default as default
24
- };
25
- //# sourceMappingURL=create-QSETDT4N.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/create.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Database } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\n\nimport { Chess } from '../types';\nimport { Create } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Create> = Create.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ name, pgn, fen }) {\n return yield* Database.add(Chess.make({ name, pgn, fen }));\n }),\n ),\n);\n\nexport default handler;\n"],
5
- "mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAK1B,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,UAAG,WAAW,EAAEC,MAAMC,KAAKC,IAAG,GAAE;AACrC,SAAO,OAAOC,SAASC,IAAIC,cAAMC,KAAK;IAAEN;IAAMC;IAAKC;EAAI,CAAA,CAAA;AACzD,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAeR;",
6
- "names": ["Effect", "Database", "Operation", "handler", "Create", "pipe", "Operation", "withHandler", "fn", "name", "pgn", "fen", "Database", "add", "Chess", "make"]
7
- }