@dxos/plugin-chess 0.7.5-main.ff8607b → 0.7.5-staging.b81e783
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.
- package/dist/lib/browser/{ChessContainer-LPMACR6Y.mjs → ChessContainer-XERPODLK.mjs} +10 -30
- package/dist/lib/browser/ChessContainer-XERPODLK.mjs.map +7 -0
- package/dist/lib/browser/artifact-definition-AEIQ7Z36.mjs +174 -0
- package/dist/lib/browser/artifact-definition-AEIQ7Z36.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KC36U5TF.mjs → chunk-GKM6RRDX.mjs} +11 -8
- package/dist/lib/browser/chunk-GKM6RRDX.mjs.map +7 -0
- package/dist/lib/browser/chunk-R26FYVUS.mjs +8 -0
- package/dist/lib/browser/chunk-R26FYVUS.mjs.map +7 -0
- package/dist/lib/browser/chunk-VRWXC5L2.mjs +42 -0
- package/dist/lib/browser/chunk-VRWXC5L2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +36 -17
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-5CPSAZSA.mjs → intent-resolver-VPK5QRXH.mjs} +16 -10
- package/dist/lib/browser/intent-resolver-VPK5QRXH.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-ITP4OMBZ.mjs +42 -0
- package/dist/lib/browser/react-surface-ITP4OMBZ.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -3
- package/dist/lib/node/{ChessContainer-ZFOCAXZL.cjs → ChessContainer-LEPLNICP.cjs} +9 -32
- package/dist/lib/node/ChessContainer-LEPLNICP.cjs.map +7 -0
- package/dist/lib/node/artifact-definition-ZM5VDOVN.cjs +189 -0
- package/dist/lib/node/artifact-definition-ZM5VDOVN.cjs.map +7 -0
- package/dist/lib/node/{chunk-BEZSGC5V.cjs → chunk-3TTH3HKL.cjs} +14 -11
- package/dist/lib/node/chunk-3TTH3HKL.cjs.map +7 -0
- package/dist/lib/node/chunk-CSRNUKOH.cjs +74 -0
- package/dist/lib/node/chunk-CSRNUKOH.cjs.map +7 -0
- package/dist/lib/node/{react-surface-IOAB5AXZ.cjs → chunk-ITDMCBQQ.cjs} +11 -22
- package/dist/lib/node/chunk-ITDMCBQQ.cjs.map +7 -0
- package/dist/lib/node/index.cjs +51 -31
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/{intent-resolver-2YYMQ2H5.cjs → intent-resolver-PUM2BVGU.cjs} +19 -13
- package/dist/lib/node/intent-resolver-PUM2BVGU.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-surface-4G4PW5RU.cjs +62 -0
- package/dist/lib/node/react-surface-4G4PW5RU.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +6 -6
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{ChessContainer-DF6IFM2R.mjs → ChessContainer-S76WNBWN.mjs} +9 -30
- package/dist/lib/node-esm/ChessContainer-S76WNBWN.mjs.map +7 -0
- package/dist/lib/node-esm/artifact-definition-NGQEQHJT.mjs +175 -0
- package/dist/lib/node-esm/artifact-definition-NGQEQHJT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6SEDGO5G.mjs +44 -0
- package/dist/lib/node-esm/chunk-6SEDGO5G.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-B72CIN6T.mjs +10 -0
- package/dist/lib/node-esm/chunk-B72CIN6T.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-A6KO5IFZ.mjs → chunk-GQA2DRUZ.mjs} +11 -8
- package/dist/lib/node-esm/chunk-GQA2DRUZ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +36 -17
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-XCT7HZ43.mjs → intent-resolver-IR3YUZIG.mjs} +16 -10
- package/dist/lib/node-esm/intent-resolver-IR3YUZIG.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-AEMVDP4R.mjs +43 -0
- package/dist/lib/node-esm/react-surface-AEMVDP4R.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +3 -3
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts +11 -0
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +1 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/ChessComponent.d.ts +5 -0
- package/dist/types/src/components/ChessComponent.d.ts.map +1 -0
- package/dist/types/src/components/ChessContainer.d.ts +3 -4
- package/dist/types/src/components/ChessContainer.d.ts.map +1 -1
- package/dist/types/src/components/PlayerSelector.d.ts +4 -5
- package/dist/types/src/components/PlayerSelector.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +4 -2
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +4 -3
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +22 -18
- package/src/ChessPlugin.tsx +22 -9
- package/src/capabilities/artifact-definition.ts +109 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +11 -6
- package/src/capabilities/react-surface.tsx +12 -5
- package/src/components/ChessComponent.tsx +49 -0
- package/src/components/ChessContainer.tsx +5 -32
- package/src/components/PlayerSelector.tsx +2 -2
- package/src/components/index.ts +2 -0
- package/src/index.ts +4 -1
- package/src/translations.ts +2 -2
- package/src/types/schema.ts +3 -1
- package/src/types/types.ts +6 -5
- package/dist/lib/browser/ChessContainer-LPMACR6Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-KC36U5TF.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5CPSAZSA.mjs.map +0 -7
- package/dist/lib/browser/react-surface-6J2N3V5R.mjs +0 -30
- package/dist/lib/browser/react-surface-6J2N3V5R.mjs.map +0 -7
- package/dist/lib/node/ChessContainer-ZFOCAXZL.cjs.map +0 -7
- package/dist/lib/node/chunk-BEZSGC5V.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-2YYMQ2H5.cjs.map +0 -7
- package/dist/lib/node/react-surface-IOAB5AXZ.cjs.map +0 -7
- package/dist/lib/node-esm/ChessContainer-DF6IFM2R.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-A6KO5IFZ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-XCT7HZ43.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-47I77M7F.mjs +0 -31
- package/dist/lib/node-esm/react-surface-47I77M7F.mjs.map +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2461,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2089,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":2799,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":586,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":2167,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytes":8757,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":6004,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":798,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":2649,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1080,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1819,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":6685,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":592,"imports":[{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4298},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-5CPSAZSA.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-6J2N3V5R.mjs","kind":"dynamic-import"}],"exports":["CHESS_PLUGIN","ChessPlugin","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1336},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":190},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":324},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0}},"bytes":2247},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs","kind":"import-statement"}],"exports":["ChessAction","GameType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":192},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-5CPSAZSA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1071},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-5CPSAZSA.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":360}},"bytes":599},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-LPMACR6Y.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7737},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-LPMACR6Y.mjs":{"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":1501},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":4104},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-6J2N3V5R.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1559},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-6J2N3V5R.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-LPMACR6Y.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytesInOutput":434},"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":900},"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3507},"packages/plugins/plugin-chess/dist/lib/browser/chunk-KC36U5TF.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","GameType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":430},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":558},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":1839}}}
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2700,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2089,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":3051,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":586,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytes":17463,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":2748,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytes":4522,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytes":8761,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":3335,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":908,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":3926,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"../components/ChessComponent"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1365,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","kind":"dynamic-import","original":"./artifact-definition"},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1825,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":7895,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":790,"imports":[{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5064},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-R26FYVUS.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-AEIQ7Z36.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-VPK5QRXH.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-ITP4OMBZ.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","ChessComponent","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":273},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1623},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":325}},"bytes":2825},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.mjs","kind":"import-statement"}],"exports":["ChessAction","ChessType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":194},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-AEIQ7Z36.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7596},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-AEIQ7Z36.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytesInOutput":5487}},"bytes":5739},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-VPK5QRXH.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1374},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-VPK5QRXH.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":511}},"bytes":751},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-XERPODLK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6188},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-XERPODLK.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":811},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":3472},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-ITP4OMBZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1850},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-ITP4OMBZ.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-R26FYVUS.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytesInOutput":745}},"bytes":1107},"packages/plugins/plugin-chess/dist/lib/browser/chunk-R26FYVUS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/browser/chunk-R26FYVUS.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-XERPODLK.mjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":235},"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3767},"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","ChessType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":501},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":613},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":1966},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2436},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs":{"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"exports":["ChessComponent"],"inputs":{"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytesInOutput":990}},"bytes":1131}}}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChessContainer
|
|
3
|
+
} from "./chunk-R26FYVUS.mjs";
|
|
4
|
+
import {
|
|
5
|
+
CHESS_PLUGIN,
|
|
6
|
+
ChessType,
|
|
7
|
+
isObject
|
|
8
|
+
} from "./chunk-GKM6RRDX.mjs";
|
|
9
|
+
import {
|
|
10
|
+
ChessComponent
|
|
11
|
+
} from "./chunk-VRWXC5L2.mjs";
|
|
12
|
+
|
|
13
|
+
// packages/plugins/plugin-chess/src/capabilities/react-surface.tsx
|
|
14
|
+
import React from "react";
|
|
15
|
+
import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
|
|
16
|
+
import { isInstanceOf } from "@dxos/echo-schema";
|
|
17
|
+
var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
18
|
+
createSurface({
|
|
19
|
+
id: CHESS_PLUGIN,
|
|
20
|
+
role: [
|
|
21
|
+
"article",
|
|
22
|
+
"section"
|
|
23
|
+
],
|
|
24
|
+
filter: (data) => isObject(data.subject),
|
|
25
|
+
component: ({ data, role }) => /* @__PURE__ */ React.createElement(ChessContainer, {
|
|
26
|
+
game: data.subject,
|
|
27
|
+
role
|
|
28
|
+
})
|
|
29
|
+
}),
|
|
30
|
+
createSurface({
|
|
31
|
+
id: "plugin-chess",
|
|
32
|
+
role: "canvas-node",
|
|
33
|
+
filter: (data) => isInstanceOf(ChessType, data),
|
|
34
|
+
component: ({ data }) => /* @__PURE__ */ React.createElement(ChessComponent, {
|
|
35
|
+
game: data
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
]);
|
|
39
|
+
export {
|
|
40
|
+
react_surface_default as default
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=react-surface-ITP4OMBZ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { isInstanceOf } from '@dxos/echo-schema';\n\nimport { ChessContainer } from '../components';\nimport { ChessComponent } from '../components/ChessComponent';\nimport { CHESS_PLUGIN } from '../meta';\nimport { ChessType, isObject } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: CHESS_PLUGIN,\n role: ['article', 'section'],\n filter: (data): data is { subject: ChessType } => isObject(data.subject),\n component: ({ data, role }) => <ChessContainer game={data.subject} role={role} />,\n }),\n createSurface({\n id: 'plugin-chess',\n role: 'canvas-node',\n filter: (data): data is any => isInstanceOf(ChessType, data),\n component: ({ data }) => <ChessComponent game={data} />,\n }),\n ]);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,oBAAoB;AAO7B,IAAA,wBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAIC;IACJC,MAAM;MAAC;MAAW;;IAClBC,QAAQ,CAACC,SAAyCC,SAASD,KAAKE,OAAO;IACvEC,WAAW,CAAC,EAAEH,MAAMF,KAAI,MAAO,sBAAA,cAACM,gBAAAA;MAAeC,MAAML,KAAKE;MAASJ;;EACrE,CAAA;EACAH,cAAc;IACZC,IAAI;IACJE,MAAM;IACNC,QAAQ,CAACC,SAAsBM,aAAaC,WAAWP,IAAAA;IACvDG,WAAW,CAAC,EAAEH,KAAI,MAAO,sBAAA,cAACQ,gBAAAA;MAAeH,MAAML;;EACjD,CAAA;CACD;",
|
|
6
|
+
"names": ["React", "Capabilities", "contributes", "createSurface", "isInstanceOf", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "CHESS_PLUGIN", "role", "filter", "data", "isObject", "subject", "component", "ChessContainer", "game", "isInstanceOf", "ChessType", "ChessComponent"]
|
|
7
|
+
}
|
|
@@ -26,15 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var ChessContainer_LEPLNICP_exports = {};
|
|
30
|
+
__export(ChessContainer_LEPLNICP_exports, {
|
|
31
31
|
default: () => ChessContainer_default
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(ChessContainer_LEPLNICP_exports);
|
|
34
|
+
var import_chunk_CSRNUKOH = require("./chunk-CSRNUKOH.cjs");
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_echo = require("@dxos/react-client/echo");
|
|
37
|
-
var import_react_ui_gameboard = require("@dxos/react-ui-gameboard");
|
|
38
37
|
var import_react_ui_stack = require("@dxos/react-ui-stack");
|
|
39
38
|
var import_react2 = require("@phosphor-icons/react");
|
|
40
39
|
var import_react3 = __toESM(require("react"));
|
|
@@ -42,7 +41,7 @@ var import_display_name = require("@dxos/display-name");
|
|
|
42
41
|
var import_echo2 = require("@dxos/react-client/echo");
|
|
43
42
|
var import_react_ui = require("@dxos/react-ui");
|
|
44
43
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
45
|
-
var PlayerSelector = ({
|
|
44
|
+
var PlayerSelector = ({ space, game }) => {
|
|
46
45
|
const members = (0, import_echo2.useMembers)(space.key);
|
|
47
46
|
return /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
48
47
|
role: "none",
|
|
@@ -87,31 +86,10 @@ var PlayerSelect = ({ side, value, onValueChange, members }) => {
|
|
|
87
86
|
}))))));
|
|
88
87
|
};
|
|
89
88
|
var ChessContainer = ({ game }) => {
|
|
90
|
-
const model = (0, import_react.useMemo)(() => new import_react_ui_gameboard.ChessModel(), []);
|
|
91
|
-
(0, import_react.useEffect)(() => {
|
|
92
|
-
if (!model || game.pgn !== model?.game.pgn()) {
|
|
93
|
-
const chess = new import_chess.Chess();
|
|
94
|
-
if (game.pgn) {
|
|
95
|
-
chess.loadPgn(game.pgn);
|
|
96
|
-
}
|
|
97
|
-
model.initialize(chess.fen());
|
|
98
|
-
}
|
|
99
|
-
}, [
|
|
100
|
-
game.pgn
|
|
101
|
-
]);
|
|
102
89
|
const space = (0, import_echo.getSpace)(game);
|
|
103
90
|
if (!space) {
|
|
104
91
|
return null;
|
|
105
92
|
}
|
|
106
|
-
const handleDrop = (0, import_react.useCallback)((move) => {
|
|
107
|
-
if (model.makeMove(move)) {
|
|
108
|
-
game.pgn = model.game.pgn();
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
return false;
|
|
112
|
-
}, [
|
|
113
|
-
model
|
|
114
|
-
]);
|
|
115
93
|
return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
|
|
116
94
|
toolbar: false
|
|
117
95
|
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
@@ -119,13 +97,12 @@ var ChessContainer = ({ game }) => {
|
|
|
119
97
|
className: "grid grid-rows-[60px_1fr_60px] grow overflow-hidden"
|
|
120
98
|
}, /* @__PURE__ */ import_react.default.createElement("div", null), /* @__PURE__ */ import_react.default.createElement("div", {
|
|
121
99
|
className: "flex m-4 overflow-hidden"
|
|
122
|
-
}, /* @__PURE__ */ import_react.default.createElement(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_react_ui_gameboard.Chessboard, null))), /* @__PURE__ */ import_react.default.createElement(PlayerSelector, {
|
|
100
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_chunk_CSRNUKOH.ChessComponent, {
|
|
101
|
+
game
|
|
102
|
+
})), /* @__PURE__ */ import_react.default.createElement(PlayerSelector, {
|
|
126
103
|
space,
|
|
127
104
|
game
|
|
128
105
|
})));
|
|
129
106
|
};
|
|
130
107
|
var ChessContainer_default = ChessContainer;
|
|
131
|
-
//# sourceMappingURL=ChessContainer-
|
|
108
|
+
//# sourceMappingURL=ChessContainer-LEPLNICP.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/ChessContainer.tsx", "../../../src/components/PlayerSelector.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { ChessComponent } from './ChessComponent';\nimport { PlayerSelector } from './PlayerSelector';\nimport { type ChessType } from '../types';\n\nconst ChessContainer = ({ game }: { game: ChessType; role?: string }) => {\n const space = getSpace(game);\n if (!space) {\n return null;\n }\n\n return (\n <StackItem.Content toolbar={false}>\n <div role='none' className='grid grid-rows-[60px_1fr_60px] grow overflow-hidden'>\n <div />\n\n <div className='flex m-4 overflow-hidden'>\n <ChessComponent game={game} />\n </div>\n\n <PlayerSelector space={space} game={game} />\n </div>\n </StackItem.Content>\n );\n};\n\nexport default ChessContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { CrownCross } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { generateName } from '@dxos/display-name';\nimport { useMembers, type Space, type SpaceMember } from '@dxos/react-client/echo';\nimport { Input, Select, useThemeContext } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\n\nimport { type ChessType } from '../types';\n\nexport const PlayerSelector = ({ space, game }: { space: Space; game: ChessType }) => {\n const members = useMembers(space.key);\n\n return (\n <div role='none' className='grid grid-cols-2 gap-8'>\n <div role='none' className='flex flex-row-reverse items-center gap-2'>\n <PlayerSelect\n side='white'\n value={game.playerWhite}\n onValueChange={(player) => (game.playerWhite = player)}\n members={members}\n />\n </div>\n <div role='none' className='flex flex-row items-center gap-2'>\n <PlayerSelect\n side='black'\n value={game.playerBlack}\n onValueChange={(player) => (game.playerBlack = player)}\n members={members}\n />\n </div>\n </div>\n );\n};\n\nconst PlayerSelect = ({\n side,\n value,\n onValueChange,\n members,\n}: {\n side: 'white' | 'black';\n value: string | undefined;\n onValueChange: (player: string) => void;\n members: SpaceMember[];\n}) => {\n const { themeMode } = useThemeContext();\n const iconFillMode =\n (side === 'black' && themeMode === 'light') || (side === 'white' && themeMode === 'dark') ? 'fill' : undefined;\n\n return (\n <Input.Root>\n <Input.Label>\n <CrownCross className={mx(getSize(6))} weight={iconFillMode} aria-label={`Chess icon for side ${side}`} />\n </Input.Label>\n <Select.Root value={value} onValueChange={onValueChange}>\n <Select.TriggerButton placeholder={'Select player'} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {members.map((member) => {\n const memberKey = member.identity.identityKey.toHex();\n const displayName = member.identity?.profile?.displayName || generateName(memberKey);\n return (\n <Select.Option key={memberKey} value={memberKey}>\n {displayName}\n </Select.Option>\n );\n })}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </Input.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,kBAAyB;AACzB,4BAA0B;ACH1B,IAAAA,gBAA2B;AAC3B,IAAAA,gBAAkB;AAElB,0BAA6B;AAC7B,IAAAC,eAAyD;AACzD,sBAA+C;AAC/C,4BAA4B;AAIrB,IAAMC,iBAAiB,CAAC,EAAEC,OAAOC,KAAI,MAAqC;AAC/E,QAAMC,cAAUC,yBAAWH,MAAMI,GAAG;AAEpC,SACE,8BAAAC,QAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,8BAAAH,QAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,8BAAAH,QAAA,cAACI,cAAAA;IACCC,MAAK;IACLC,OAAOV,KAAKW;IACZC,eAAe,CAACC,WAAYb,KAAKW,cAAcE;IAC/CZ;OAGJ,8BAAAG,QAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,8BAAAH,QAAA,cAACI,cAAAA;IACCC,MAAK;IACLC,OAAOV,KAAKc;IACZF,eAAe,CAACC,WAAYb,KAAKc,cAAcD;IAC/CZ;;AAKV;AAEA,IAAMO,eAAe,CAAC,EACpBC,MACAC,OACAE,eACAX,QAAO,MAMR;AACC,QAAM,EAAEc,UAAS,QAAKC,iCAAAA;AACtB,QAAMC,eACHR,SAAS,WAAWM,cAAc,WAAaN,SAAS,WAAWM,cAAc,SAAU,SAASG;AAEvG,SACE,8BAAAd,QAAA,cAACe,sBAAMC,MAAI,MACT,8BAAAhB,QAAA,cAACe,sBAAME,OAAK,MACV,8BAAAjB,QAAA,cAACkB,0BAAAA;IAAWf,eAAWgB,8BAAGC,+BAAQ,CAAA,CAAA;IAAKC,QAAQR;IAAcS,cAAY,uBAAuBjB,IAAAA;OAElG,8BAAAL,QAAA,cAACuB,uBAAOP,MAAI;IAACV;IAAcE;KACzB,8BAAAR,QAAA,cAACuB,uBAAOC,eAAa;IAACC,aAAa;MACnC,8BAAAzB,QAAA,cAACuB,uBAAOG,QAAM,MACZ,8BAAA1B,QAAA,cAACuB,uBAAOI,SAAO,MACb,8BAAA3B,QAAA,cAACuB,uBAAOK,UAAQ,MACb/B,QAAQgC,IAAI,CAACC,WAAAA;AACZ,UAAMC,YAAYD,OAAOE,SAASC,YAAYC,MAAK;AACnD,UAAMC,cAAcL,OAAOE,UAAUI,SAASD,mBAAeE,kCAAaN,SAAAA;AAC1E,WACE,8BAAA/B,QAAA,cAACuB,uBAAOe,QAAM;MAACvC,KAAKgC;MAAWzB,OAAOyB;OACnCI,WAAAA;EAGP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAOd;ADlEA,IAAMI,iBAAiB,CAAC,EAAE3C,KAAI,MAAsC;AAClE,QAAMD,YAAQ6C,sBAAS5C,IAAAA;AACvB,MAAI,CAACD,OAAO;AACV,WAAO;EACT;AAEA,SACEK,6BAAAA,QAAA,cAACyC,gCAAUd,SAAO;IAACe,SAAS;KAC1B1C,6BAAAA,QAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzBH,6BAAAA,QAAA,cAACC,OAAAA,IAAAA,GAEDD,6BAAAA,QAAA,cAACC,OAAAA;IAAIE,WAAU;KACbH,6BAAAA,QAAA,cAAC2C,sCAAAA;IAAe/C;OAGlBI,6BAAAA,QAAA,cAACN,gBAAAA;IAAeC;IAAcC;;AAItC;AAEA,IAAA,yBAAe2C;",
|
|
6
|
+
"names": ["import_react", "import_echo", "PlayerSelector", "space", "game", "members", "useMembers", "key", "React", "div", "role", "className", "PlayerSelect", "side", "value", "playerWhite", "onValueChange", "player", "playerBlack", "themeMode", "useThemeContext", "iconFillMode", "undefined", "Input", "Root", "Label", "CrownCross", "mx", "getSize", "weight", "aria-label", "Select", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "map", "member", "memberKey", "identity", "identityKey", "toHex", "displayName", "profile", "generateName", "Option", "ChessContainer", "getSpace", "StackItem", "toolbar", "ChessComponent"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var artifact_definition_ZM5VDOVN_exports = {};
|
|
20
|
+
__export(artifact_definition_ZM5VDOVN_exports, {
|
|
21
|
+
default: () => artifact_definition_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(artifact_definition_ZM5VDOVN_exports);
|
|
24
|
+
var import_chunk_3TTH3HKL = require("./chunk-3TTH3HKL.cjs");
|
|
25
|
+
var import_chess = require("chess.js");
|
|
26
|
+
var import_effect = require("effect");
|
|
27
|
+
var import_app_framework = require("@dxos/app-framework");
|
|
28
|
+
var import_artifact = require("@dxos/artifact");
|
|
29
|
+
var import_assistant = require("@dxos/assistant");
|
|
30
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
31
|
+
var import_invariant = require("@dxos/invariant");
|
|
32
|
+
var import_types = require("@dxos/plugin-space/types");
|
|
33
|
+
var import_echo = require("@dxos/react-client/echo");
|
|
34
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts";
|
|
35
|
+
var artifact_definition_default = () => {
|
|
36
|
+
const definition = (0, import_artifact.defineArtifact)({
|
|
37
|
+
id: "plugin-chess",
|
|
38
|
+
instructions: `
|
|
39
|
+
Chess:
|
|
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
|
+
`,
|
|
42
|
+
schema: import_chunk_3TTH3HKL.ChessType,
|
|
43
|
+
tools: [
|
|
44
|
+
(0, import_artifact.defineTool)({
|
|
45
|
+
name: "chess_new",
|
|
46
|
+
description: "Create a new chess game. Returns the artifact definition for the game.",
|
|
47
|
+
schema: import_echo_schema.S.Struct({
|
|
48
|
+
fen: import_echo_schema.S.String.annotations({
|
|
49
|
+
description: "The state of the chess game in the FEN format."
|
|
50
|
+
})
|
|
51
|
+
}),
|
|
52
|
+
execute: async ({ fen }, { extensions }) => {
|
|
53
|
+
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
54
|
+
F: __dxlog_file,
|
|
55
|
+
L: 42,
|
|
56
|
+
S: void 0,
|
|
57
|
+
A: [
|
|
58
|
+
"extensions?.space",
|
|
59
|
+
"'No space'"
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
(0, import_invariant.invariant)(extensions?.dispatch, "No intent dispatcher", {
|
|
63
|
+
F: __dxlog_file,
|
|
64
|
+
L: 43,
|
|
65
|
+
S: void 0,
|
|
66
|
+
A: [
|
|
67
|
+
"extensions?.dispatch",
|
|
68
|
+
"'No intent dispatcher'"
|
|
69
|
+
]
|
|
70
|
+
});
|
|
71
|
+
const intent = (0, import_effect.pipe)((0, import_app_framework.createIntent)(import_chunk_3TTH3HKL.ChessAction.Create, {
|
|
72
|
+
fen
|
|
73
|
+
}), (0, import_app_framework.chain)(import_types.SpaceAction.AddObject, {
|
|
74
|
+
target: extensions.space
|
|
75
|
+
}));
|
|
76
|
+
const { data, error } = await extensions.dispatch(intent);
|
|
77
|
+
if (!data || error) {
|
|
78
|
+
return import_artifact.ToolResult.Error(error?.message ?? "Failed to create chess game");
|
|
79
|
+
}
|
|
80
|
+
return import_artifact.ToolResult.Success((0, import_assistant.createArtifactElement)(data.id));
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
83
|
+
(0, import_artifact.defineTool)({
|
|
84
|
+
name: "chess_query",
|
|
85
|
+
description: "Query all active chess games.",
|
|
86
|
+
schema: import_echo_schema.S.Struct({}),
|
|
87
|
+
execute: async (_, { extensions }) => {
|
|
88
|
+
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
89
|
+
F: __dxlog_file,
|
|
90
|
+
L: 61,
|
|
91
|
+
S: void 0,
|
|
92
|
+
A: [
|
|
93
|
+
"extensions?.space",
|
|
94
|
+
"'No space'"
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(import_chunk_3TTH3HKL.ChessType)).run();
|
|
98
|
+
(0, import_invariant.invariant)(games.length > 0, "No chess games found", {
|
|
99
|
+
F: __dxlog_file,
|
|
100
|
+
L: 63,
|
|
101
|
+
S: void 0,
|
|
102
|
+
A: [
|
|
103
|
+
"games.length > 0",
|
|
104
|
+
"'No chess games found'"
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
return import_artifact.ToolResult.Success(games);
|
|
108
|
+
}
|
|
109
|
+
}),
|
|
110
|
+
(0, import_artifact.defineTool)({
|
|
111
|
+
name: "chess_inspect",
|
|
112
|
+
description: "Get the current state of the chess game.",
|
|
113
|
+
schema: import_echo_schema.S.Struct({
|
|
114
|
+
id: import_echo_schema.ObjectId
|
|
115
|
+
}),
|
|
116
|
+
execute: async ({ id }, { extensions }) => {
|
|
117
|
+
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
118
|
+
F: __dxlog_file,
|
|
119
|
+
L: 72,
|
|
120
|
+
S: void 0,
|
|
121
|
+
A: [
|
|
122
|
+
"extensions?.space",
|
|
123
|
+
"'No space'"
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(import_chunk_3TTH3HKL.ChessType)).run();
|
|
127
|
+
const game = games.find((game2) => game2.id === id);
|
|
128
|
+
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_3TTH3HKL.ChessType, game), void 0, {
|
|
129
|
+
F: __dxlog_file,
|
|
130
|
+
L: 75,
|
|
131
|
+
S: void 0,
|
|
132
|
+
A: [
|
|
133
|
+
"isInstanceOf(ChessType, game)",
|
|
134
|
+
""
|
|
135
|
+
]
|
|
136
|
+
});
|
|
137
|
+
return import_artifact.ToolResult.Success(game.fen);
|
|
138
|
+
}
|
|
139
|
+
}),
|
|
140
|
+
(0, import_artifact.defineTool)({
|
|
141
|
+
name: "chess_move",
|
|
142
|
+
description: "Make a move in the chess game.",
|
|
143
|
+
schema: import_echo_schema.S.Struct({
|
|
144
|
+
id: import_echo_schema.ObjectId,
|
|
145
|
+
move: import_echo_schema.S.String.annotations({
|
|
146
|
+
description: "The move to make in the chess game.",
|
|
147
|
+
examples: [
|
|
148
|
+
"e4",
|
|
149
|
+
"Bf3"
|
|
150
|
+
]
|
|
151
|
+
})
|
|
152
|
+
}),
|
|
153
|
+
execute: async ({ id, move }, { extensions }) => {
|
|
154
|
+
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
155
|
+
F: __dxlog_file,
|
|
156
|
+
L: 90,
|
|
157
|
+
S: void 0,
|
|
158
|
+
A: [
|
|
159
|
+
"extensions?.space",
|
|
160
|
+
"'No space'"
|
|
161
|
+
]
|
|
162
|
+
});
|
|
163
|
+
const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(import_chunk_3TTH3HKL.ChessType)).run();
|
|
164
|
+
const game = games.find((game2) => game2.id === id);
|
|
165
|
+
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_3TTH3HKL.ChessType, game), void 0, {
|
|
166
|
+
F: __dxlog_file,
|
|
167
|
+
L: 93,
|
|
168
|
+
S: void 0,
|
|
169
|
+
A: [
|
|
170
|
+
"isInstanceOf(ChessType, game)",
|
|
171
|
+
""
|
|
172
|
+
]
|
|
173
|
+
});
|
|
174
|
+
const board = new import_chess.Chess(game.fen);
|
|
175
|
+
try {
|
|
176
|
+
board.move(move);
|
|
177
|
+
} catch (error) {
|
|
178
|
+
return import_artifact.ToolResult.Error(error.message);
|
|
179
|
+
}
|
|
180
|
+
game.pgn = board.pgn();
|
|
181
|
+
game.fen = board.fen();
|
|
182
|
+
return import_artifact.ToolResult.Success(game.fen);
|
|
183
|
+
}
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
});
|
|
187
|
+
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.ArtifactDefinition, definition);
|
|
188
|
+
};
|
|
189
|
+
//# sourceMappingURL=artifact-definition-ZM5VDOVN.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/artifact-definition.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess } from 'chess.js';\nimport { pipe } from 'effect';\n\nimport { Capabilities, chain, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement } from '@dxos/assistant';\nimport { isInstanceOf, ObjectId, S } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter, type Space } from '@dxos/react-client/echo';\n\nimport { ChessAction, ChessType } from '../types';\n\n// TODO(burdon): Factor out.\ndeclare global {\n interface ToolContextExtensions {\n space?: Space;\n dispatch?: PromiseIntentDispatcher;\n }\n}\n\nexport default () => {\n const definition = defineArtifact({\n id: 'plugin-chess',\n instructions: `\n Chess:\n - 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.\n `,\n schema: ChessType,\n tools: [\n defineTool({\n name: 'chess_new',\n description: 'Create a new chess game. Returns the artifact definition for the game.',\n schema: S.Struct({\n fen: S.String.annotations({ description: 'The state of the chess game in the FEN format.' }),\n }),\n execute: async ({ fen }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n const intent = pipe(\n createIntent(ChessAction.Create, { fen }),\n chain(SpaceAction.AddObject, { target: extensions.space }),\n );\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create chess game');\n }\n\n return ToolResult.Success(createArtifactElement(data.id));\n },\n }),\n defineTool({\n name: 'chess_query',\n description: 'Query all active chess games.',\n schema: S.Struct({}),\n execute: async (_, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n invariant(games.length > 0, 'No chess games found');\n return ToolResult.Success(games);\n },\n }),\n defineTool({\n name: 'chess_inspect',\n description: 'Get the current state of the chess game.',\n schema: S.Struct({ id: ObjectId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n return ToolResult.Success(game.fen);\n },\n }),\n defineTool({\n name: 'chess_move',\n description: 'Make a move in the chess game.',\n schema: S.Struct({\n id: ObjectId,\n move: S.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n execute: async ({ id, move }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n const board = new Chess(game.fen);\n try {\n board.move(move);\n } catch (error: any) {\n return ToolResult.Error(error.message);\n }\n game.pgn = board.pgn();\n game.fen = board.fen();\n return ToolResult.Success(game.fen);\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAsB;AACtB,oBAAqB;AAErB,2BAA6F;AAC7F,sBAAuD;AACvD,uBAAsC;AACtC,yBAA0C;AAC1C,uBAA0B;AAC1B,mBAA4B;AAC5B,kBAAmC;;AAYnC,IAAA,8BAAe,MAAA;AACb,QAAMA,iBAAaC,gCAAe;IAChCC,IAAI;IACJC,cAAc;;;;IAIdC,QAAQC;IACRC,OAAO;UACLC,4BAAW;QACTC,MAAM;QACNC,aAAa;QACbL,QAAQM,qBAAEC,OAAO;UACfC,KAAKF,qBAAEG,OAAOC,YAAY;YAAEL,aAAa;UAAiD,CAAA;QAC5F,CAAA;QACAM,SAAS,OAAO,EAAEH,IAAG,GAAI,EAAEI,WAAU,MAAE;AACrCC,0CAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7BD,0CAAUD,YAAYG,UAAU,wBAAA;;;;;;;;;AAChC,gBAAMC,aAASC,wBACbC,mCAAaC,kCAAYC,QAAQ;YAAEZ;UAAI,CAAA,OACvCa,4BAAMC,yBAAYC,WAAW;YAAEC,QAAQZ,WAAWE;UAAM,CAAA,CAAA;AAE1D,gBAAM,EAAEW,MAAMC,MAAK,IAAK,MAAMd,WAAWG,SAASC,MAAAA;AAClD,cAAI,CAACS,QAAQC,OAAO;AAClB,mBAAOC,2BAAWC,MAAMF,OAAOG,WAAW,6BAAA;UAC5C;AAEA,iBAAOF,2BAAWG,YAAQC,wCAAsBN,KAAK3B,EAAE,CAAA;QACzD;MACF,CAAA;UACAK,4BAAW;QACTC,MAAM;QACNC,aAAa;QACbL,QAAQM,qBAAEC,OAAO,CAAC,CAAA;QAClBI,SAAS,OAAOqB,GAAG,EAAEpB,WAAU,MAAE;AAC/BC,0CAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7B,gBAAM,EAAEmB,SAASC,MAAK,IAAK,MAAMtB,WAAWE,MAAMqB,GAAGC,MAAMC,mBAAOrC,OAAOC,+BAAAA,CAAAA,EAAYqC,IAAG;AACxFzB,0CAAUqB,MAAMK,SAAS,GAAG,wBAAA;;;;;;;;;AAC5B,iBAAOZ,2BAAWG,QAAQI,KAAAA;QAC5B;MACF,CAAA;UACA/B,4BAAW;QACTC,MAAM;QACNC,aAAa;QACbL,QAAQM,qBAAEC,OAAO;UAAET,IAAI0C;QAAS,CAAA;QAChC7B,SAAS,OAAO,EAAEb,GAAE,GAAI,EAAEc,WAAU,MAAE;AACpCC,0CAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7B,gBAAM,EAAEmB,SAASC,MAAK,IAAK,MAAMtB,WAAWE,MAAMqB,GAAGC,MAAMC,mBAAOrC,OAAOC,+BAAAA,CAAAA,EAAYqC,IAAG;AACxF,gBAAMG,OAAOP,MAAMQ,KAAK,CAACD,UAASA,MAAK3C,OAAOA,EAAAA;AAC9Ce,8CAAU8B,iCAAa1C,iCAAWwC,IAAAA,GAAAA,QAAAA;;;;;;;;;AAClC,iBAAOd,2BAAWG,QAAQW,KAAKjC,GAAG;QACpC;MACF,CAAA;UACAL,4BAAW;QACTC,MAAM;QACNC,aAAa;QACbL,QAAQM,qBAAEC,OAAO;UACfT,IAAI0C;UACJI,MAAMtC,qBAAEG,OAAOC,YAAY;YACzBL,aAAa;YACbwC,UAAU;cAAC;cAAM;;UACnB,CAAA;QACF,CAAA;QACAlC,SAAS,OAAO,EAAEb,IAAI8C,KAAI,GAAI,EAAEhC,WAAU,MAAE;AAC1CC,0CAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7B,gBAAM,EAAEmB,SAASC,MAAK,IAAK,MAAMtB,WAAWE,MAAMqB,GAAGC,MAAMC,mBAAOrC,OAAOC,+BAAAA,CAAAA,EAAYqC,IAAG;AACxF,gBAAMG,OAAOP,MAAMQ,KAAK,CAACD,UAASA,MAAK3C,OAAOA,EAAAA;AAC9Ce,8CAAU8B,iCAAa1C,iCAAWwC,IAAAA,GAAAA,QAAAA;;;;;;;;;AAClC,gBAAMK,QAAQ,IAAIC,mBAAMN,KAAKjC,GAAG;AAChC,cAAI;AACFsC,kBAAMF,KAAKA,IAAAA;UACb,SAASlB,OAAY;AACnB,mBAAOC,2BAAWC,MAAMF,MAAMG,OAAO;UACvC;AACAY,eAAKO,MAAMF,MAAME,IAAG;AACpBP,eAAKjC,MAAMsC,MAAMtC,IAAG;AACpB,iBAAOmB,2BAAWG,QAAQW,KAAKjC,GAAG;QACpC;MACF,CAAA;;EAEJ,CAAA;AAEA,aAAOyC,kCAAYC,kCAAaC,oBAAoBvD,UAAAA;AACtD;",
|
|
6
|
+
"names": ["definition", "defineArtifact", "id", "instructions", "schema", "ChessType", "tools", "defineTool", "name", "description", "S", "Struct", "fen", "String", "annotations", "execute", "extensions", "invariant", "space", "dispatch", "intent", "pipe", "createIntent", "ChessAction", "Create", "chain", "SpaceAction", "AddObject", "target", "data", "error", "ToolResult", "Error", "message", "Success", "createArtifactElement", "_", "objects", "games", "db", "query", "Filter", "run", "length", "ObjectId", "game", "find", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
+
}
|
|
@@ -16,16 +16,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_3TTH3HKL_exports = {};
|
|
20
|
+
__export(chunk_3TTH3HKL_exports, {
|
|
21
21
|
CHESS_PLUGIN: () => CHESS_PLUGIN,
|
|
22
22
|
ChessAction: () => ChessAction,
|
|
23
|
-
|
|
23
|
+
ChessType: () => ChessType,
|
|
24
24
|
MoveSchema: () => MoveSchema,
|
|
25
25
|
isObject: () => isObject,
|
|
26
26
|
meta: () => meta
|
|
27
27
|
});
|
|
28
|
-
module.exports = __toCommonJS(
|
|
28
|
+
module.exports = __toCommonJS(chunk_3TTH3HKL_exports);
|
|
29
29
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
30
30
|
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
31
31
|
var import_live_object = require("@dxos/live-object");
|
|
@@ -34,7 +34,7 @@ var MoveSchema = import_echo_schema.S.mutable(import_echo_schema.S.partial(impor
|
|
|
34
34
|
target: import_echo_schema.S.String,
|
|
35
35
|
piece: import_echo_schema.S.String
|
|
36
36
|
})));
|
|
37
|
-
var
|
|
37
|
+
var ChessType = class extends (0, import_echo_schema.TypedObject)({
|
|
38
38
|
typename: "dxos.org/type/Chess",
|
|
39
39
|
version: "0.1.0"
|
|
40
40
|
})({
|
|
@@ -42,7 +42,9 @@ var GameType = class extends (0, import_echo_schema.TypedObject)({
|
|
|
42
42
|
playerWhite: import_echo_schema.S.String,
|
|
43
43
|
playerBlack: import_echo_schema.S.String,
|
|
44
44
|
moves: import_echo_schema.S.mutable(import_echo_schema.S.Array(import_echo_schema.S.String)),
|
|
45
|
-
|
|
45
|
+
// TODO(wittjosiah): Remove. Redundant with moves.
|
|
46
|
+
pgn: import_echo_schema.S.String,
|
|
47
|
+
fen: import_echo_schema.S.String
|
|
46
48
|
}, {
|
|
47
49
|
partial: true
|
|
48
50
|
}) {
|
|
@@ -63,25 +65,26 @@ var ChessAction;
|
|
|
63
65
|
const CHESS_ACTION = `${CHESS_PLUGIN}/action`;
|
|
64
66
|
class Create extends import_echo_schema2.S.TaggedClass()(`${CHESS_ACTION}/create`, {
|
|
65
67
|
input: import_echo_schema2.S.Struct({
|
|
66
|
-
name: import_echo_schema2.S.optional(import_echo_schema2.S.String)
|
|
68
|
+
name: import_echo_schema2.S.optional(import_echo_schema2.S.String),
|
|
69
|
+
fen: import_echo_schema2.S.optional(import_echo_schema2.S.String)
|
|
67
70
|
}),
|
|
68
71
|
output: import_echo_schema2.S.Struct({
|
|
69
|
-
object:
|
|
72
|
+
object: ChessType
|
|
70
73
|
})
|
|
71
74
|
}) {
|
|
72
75
|
}
|
|
73
76
|
ChessAction2.Create = Create;
|
|
74
77
|
})(ChessAction || (ChessAction = {}));
|
|
75
78
|
var isObject = (object) => {
|
|
76
|
-
return (0, import_live_object.isReactiveObject)(object) &&
|
|
79
|
+
return (0, import_live_object.isReactiveObject)(object) && (0, import_echo_schema2.isInstanceOf)(ChessType, object);
|
|
77
80
|
};
|
|
78
81
|
// Annotate the CommonJS export names for ESM import in node:
|
|
79
82
|
0 && (module.exports = {
|
|
80
83
|
CHESS_PLUGIN,
|
|
81
84
|
ChessAction,
|
|
82
|
-
|
|
85
|
+
ChessType,
|
|
83
86
|
MoveSchema,
|
|
84
87
|
isObject,
|
|
85
88
|
meta
|
|
86
89
|
});
|
|
87
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-3TTH3HKL.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts", "../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\nexport const MoveSchema = S.mutable(\n S.partial(\n S.Struct({\n source: S.String,\n target: S.String,\n piece: S.String,\n }),\n ),\n);\n\nexport class ChessType extends TypedObject({ typename: 'dxos.org/type/Chess', version: '0.1.0' })(\n {\n name: S.optional(S.String),\n playerWhite: S.String,\n playerBlack: S.String,\n moves: S.mutable(S.Array(S.String)),\n // TODO(wittjosiah): Remove. Redundant with moves.\n pgn: S.String,\n fen: S.String,\n },\n { partial: true },\n) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { isInstanceOf, S } from '@dxos/echo-schema';\nimport { isReactiveObject } from '@dxos/live-object';\n\nimport { ChessType } from './schema';\nimport { CHESS_PLUGIN } from '../meta';\n\nexport namespace ChessAction {\n const CHESS_ACTION = `${CHESS_PLUGIN}/action`;\n\n export class Create extends S.TaggedClass<Create>()(`${CHESS_ACTION}/create`, {\n input: S.Struct({\n name: S.optional(S.String),\n fen: S.optional(S.String),\n }),\n output: S.Struct({\n object: ChessType,\n }),\n }) {}\n}\n\nexport const isObject = (object: unknown): object is typeof ChessType => {\n return isReactiveObject(object) && isInstanceOf(ChessType, object);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const CHESS_PLUGIN = 'dxos.org/plugin/chess';\n\nexport const meta = {\n id: CHESS_PLUGIN,\n name: 'Chess',\n description:\n 'Chess is a simple plugin which allows you to render an interactive chessboard inside of a plank. This chessboard can be used for collaborative chess games, or for practice experiments with the LLM. ',\n icon: 'ph--shield-chevron--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',\n screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],\n} satisfies PluginMeta;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAA+B;ACA/B,IAAAA,sBAAgC;AAChC,yBAAiC;ADC1B,IAAMC,aAAaC,qBAAEC,QAC1BD,qBAAEE,QACAF,qBAAEG,OAAO;EACPC,QAAQJ,qBAAEK;EACVC,QAAQN,qBAAEK;EACVE,OAAOP,qBAAEK;AACX,CAAA,CAAA,CAAA;AAIG,IAAMG,YAAN,kBAAwBC,gCAAY;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,EAC7F;EACEC,MAAMZ,qBAAEa,SAASb,qBAAEK,MAAM;EACzBS,aAAad,qBAAEK;EACfU,aAAaf,qBAAEK;EACfW,OAAOhB,qBAAEC,QAAQD,qBAAEiB,MAAMjB,qBAAEK,MAAM,CAAA;;EAEjCa,KAAKlB,qBAAEK;EACPc,KAAKnB,qBAAEK;AACT,GACA;EAAEH,SAAS;AAAK,CAAA,EAAA;AACf;AErBI,IAAMkB,eAAe;AAErB,IAAMC,OAAO;EAClBC,IAAIF;EACJR,MAAM;EACNW,aACE;EACFC,MAAM;EACNpB,QAAQ;EACRqB,aAAa;IAAC;;AAChB;;UDNiBC,cAAAA;AACf,QAAMC,eAAe,GAAGP,YAAAA;EAEjB,MAAMQ,eAAe5B,oBAAAA,EAAE6B,YAAW,EAAW,GAAGF,YAAAA,WAAuB;IAC5EG,OAAO9B,oBAAAA,EAAEG,OAAO;MACdS,MAAMZ,oBAAAA,EAAEa,SAASb,oBAAAA,EAAEK,MAAM;MACzBc,KAAKnB,oBAAAA,EAAEa,SAASb,oBAAAA,EAAEK,MAAM;IAC1B,CAAA;IACA0B,QAAQ/B,oBAAAA,EAAEG,OAAO;MACf6B,QAAQxB;IACV,CAAA;EACF,CAAA,EAAA;EAAI;eARSoB,SAAAA;AASf,GAZiBF,gBAAAA,cAAAA,CAAAA,EAAAA;AAcV,IAAMO,WAAW,CAACD,WAAAA;AACvB,aAAOE,qCAAiBF,MAAAA,SAAWG,kCAAa3B,WAAWwB,MAAAA;AAC7D;",
|
|
6
|
+
"names": ["import_echo_schema", "MoveSchema", "S", "mutable", "partial", "Struct", "source", "String", "target", "piece", "ChessType", "TypedObject", "typename", "version", "name", "optional", "playerWhite", "playerBlack", "moves", "Array", "pgn", "fen", "CHESS_PLUGIN", "meta", "id", "description", "icon", "screenshots", "ChessAction", "CHESS_ACTION", "Create", "TaggedClass", "input", "output", "object", "isObject", "isReactiveObject", "isInstanceOf"]
|
|
7
|
+
}
|