@dxos/plugin-chess 0.8.2-staging.7ac8446 → 0.8.2
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-S72CLKGK.mjs +101 -0
- package/dist/lib/{node-esm/ChessContainer-MAXLUGKY.mjs.map → browser/ChessContainer-S72CLKGK.mjs.map} +1 -1
- package/dist/lib/browser/{artifact-definition-GHBVTO4Y.mjs → artifact-definition-QYGM7HNY.mjs} +31 -32
- package/dist/lib/browser/artifact-definition-QYGM7HNY.mjs.map +7 -0
- package/dist/lib/browser/chunk-5QBQW62M.mjs +8 -0
- package/dist/lib/browser/chunk-6XPI4FTK.mjs +61 -0
- package/dist/lib/browser/chunk-6XPI4FTK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4NJ4PMPW.mjs → chunk-77TLTU3X.mjs} +25 -23
- package/dist/lib/browser/chunk-77TLTU3X.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -6
- package/dist/lib/browser/{intent-resolver-JVLCHAJD.mjs → intent-resolver-FLV47FUV.mjs} +4 -4
- package/dist/lib/browser/intent-resolver-FLV47FUV.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-LZYVKHCU.mjs → react-surface-QW2WGAAJ.mjs} +4 -4
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/ChessContainer-EQUVXDJC.cjs +123 -0
- package/dist/lib/node/{ChessContainer-BZMTO4FZ.cjs.map → ChessContainer-EQUVXDJC.cjs.map} +1 -1
- package/dist/lib/node/{artifact-definition-JDJAOTXF.cjs → artifact-definition-FRBMG5FU.cjs} +41 -42
- package/dist/lib/node/artifact-definition-FRBMG5FU.cjs.map +7 -0
- package/dist/lib/node/{chunk-PQ64RGCS.cjs → chunk-33WBRZI6.cjs} +23 -21
- package/dist/lib/node/chunk-33WBRZI6.cjs.map +7 -0
- package/dist/lib/node/{chunk-CSRNUKOH.cjs → chunk-OTMP6HPY.cjs} +50 -31
- package/dist/lib/node/chunk-OTMP6HPY.cjs.map +7 -0
- package/dist/lib/node/{chunk-WKOWLRXP.cjs → chunk-R6JAL3RE.cjs} +5 -5
- package/dist/lib/node/index.cjs +22 -22
- package/dist/lib/node/{intent-resolver-IJXRCQA5.cjs → intent-resolver-AKAIXSZF.cjs} +7 -7
- package/dist/lib/node/intent-resolver-AKAIXSZF.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-JWVHHTQU.cjs → react-surface-7G7NV4FY.cjs} +12 -12
- package/dist/lib/node/types/index.cjs +5 -5
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/ChessContainer-KSLGJHPW.mjs +102 -0
- package/dist/lib/{browser/ChessContainer-6JIE36JW.mjs.map → node-esm/ChessContainer-KSLGJHPW.mjs.map} +1 -1
- package/dist/lib/node-esm/{artifact-definition-CSY4I334.mjs → artifact-definition-YKVCYZQ7.mjs} +31 -32
- package/dist/lib/node-esm/artifact-definition-YKVCYZQ7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-YFCRXSGH.mjs → chunk-KHMDMPR2.mjs} +2 -2
- package/dist/lib/node-esm/chunk-MVMMCPHE.mjs +63 -0
- package/dist/lib/node-esm/chunk-MVMMCPHE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GLBZ7ZZD.mjs → chunk-WPCT7LRN.mjs} +25 -23
- package/dist/lib/node-esm/chunk-WPCT7LRN.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +6 -6
- package/dist/lib/node-esm/{intent-resolver-AWNZCS56.mjs → intent-resolver-VK3EDUMM.mjs} +4 -4
- package/dist/lib/node-esm/intent-resolver-VK3EDUMM.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-TQKBCMJU.mjs → react-surface-Y54QUEUA.mjs} +4 -4
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/components/ChessComponent.d.ts.map +1 -1
- package/dist/types/src/components/ChessContainer.d.ts.map +1 -1
- package/dist/types/src/components/PlayerSelector.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -8
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +15 -15
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +7 -7
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -22
- package/src/capabilities/artifact-definition.ts +25 -18
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/components/ChessComponent.tsx +6 -1
- package/src/types/schema.ts +15 -13
- package/src/types/types.ts +10 -8
- package/dist/lib/browser/ChessContainer-6JIE36JW.mjs +0 -84
- package/dist/lib/browser/artifact-definition-GHBVTO4Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-4NJ4PMPW.mjs.map +0 -7
- package/dist/lib/browser/chunk-7SPN7XYA.mjs +0 -8
- package/dist/lib/browser/chunk-VRWXC5L2.mjs +0 -42
- package/dist/lib/browser/chunk-VRWXC5L2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-JVLCHAJD.mjs.map +0 -7
- package/dist/lib/node/ChessContainer-BZMTO4FZ.cjs +0 -106
- package/dist/lib/node/artifact-definition-JDJAOTXF.cjs.map +0 -7
- package/dist/lib/node/chunk-CSRNUKOH.cjs.map +0 -7
- package/dist/lib/node/chunk-PQ64RGCS.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-IJXRCQA5.cjs.map +0 -7
- package/dist/lib/node-esm/ChessContainer-MAXLUGKY.mjs +0 -85
- package/dist/lib/node-esm/artifact-definition-CSY4I334.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6SEDGO5G.mjs +0 -44
- package/dist/lib/node-esm/chunk-6SEDGO5G.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GLBZ7ZZD.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-AWNZCS56.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-7SPN7XYA.mjs.map → chunk-5QBQW62M.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-LZYVKHCU.mjs.map → react-surface-QW2WGAAJ.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-WKOWLRXP.cjs.map → chunk-R6JAL3RE.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-JWVHHTQU.cjs.map → react-surface-7G7NV4FY.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-YFCRXSGH.mjs.map → chunk-KHMDMPR2.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-TQKBCMJU.mjs.map → react-surface-Y54QUEUA.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2077,"imports":[],"format":"esm"},"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/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":18514,"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/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/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":3257,"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":1694,"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":7388,"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":4837},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-4NJ4PMPW.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-GHBVTO4Y.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-JVLCHAJD.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-LZYVKHCU.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":1500},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":282}},"bytes":2659},"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-4NJ4PMPW.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-GHBVTO4Y.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8002},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-GHBVTO4Y.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-4NJ4PMPW.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":5798}},"bytes":6058},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-JVLCHAJD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1374},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-JVLCHAJD.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-4NJ4PMPW.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-6JIE36JW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6150},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-6JIE36JW.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":791},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":3452},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-LZYVKHCU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1850},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-LZYVKHCU.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-4NJ4PMPW.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-7SPN7XYA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-6JIE36JW.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-4NJ4PMPW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3759},"packages/plugins/plugin-chess/dist/lib/browser/chunk-4NJ4PMPW.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}}}
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2033,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2921,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":3132,"imports":[{"path":"effect","kind":"import-statement","external":true},{"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":554,"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":19066,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","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/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/intent-resolver.ts":{"bytes":2680,"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":5508,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","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":9084,"imports":[{"path":"@preact-signals/safe-react/tracking","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}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":3431,"imports":[{"path":"@preact-signals/safe-react/tracking","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-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":872,"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":3858,"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":1329,"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":1642,"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":7256,"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":754,"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":4837},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-QYGM7HNY.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FLV47FUV.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-QW2WGAAJ.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":1500},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":282}},"bytes":2659},"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-77TLTU3X.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-QYGM7HNY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8482},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-QYGM7HNY.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","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":5964}},"bytes":6224},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FLV47FUV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1366},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FLV47FUV.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.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":507}},"bytes":747},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-S72CLKGK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6167},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-S72CLKGK.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","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-stack","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","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":978},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2608}},"bytes":3948},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-QW2WGAAJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1850},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-QW2WGAAJ.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.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-5QBQW62M.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-S72CLKGK.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-77TLTU3X.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3966},"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"effect","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":606},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":675},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":2133},"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2588},"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","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":1601}},"bytes":1742}}}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChessContainer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5QBQW62M.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CHESS_PLUGIN,
|
|
6
6
|
ChessType,
|
|
7
7
|
isObject
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-77TLTU3X.mjs";
|
|
9
9
|
import {
|
|
10
10
|
ChessComponent
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6XPI4FTK.mjs";
|
|
12
12
|
|
|
13
13
|
// packages/plugins/plugin-chess/src/capabilities/react-surface.tsx
|
|
14
14
|
import React from "react";
|
|
@@ -39,4 +39,4 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
|
39
39
|
export {
|
|
40
40
|
react_surface_default as default
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=react-surface-
|
|
42
|
+
//# sourceMappingURL=react-surface-QW2WGAAJ.mjs.map
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var ChessContainer_EQUVXDJC_exports = {};
|
|
30
|
+
__export(ChessContainer_EQUVXDJC_exports, {
|
|
31
|
+
default: () => ChessContainer_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(ChessContainer_EQUVXDJC_exports);
|
|
34
|
+
var import_chunk_OTMP6HPY = require("./chunk-OTMP6HPY.cjs");
|
|
35
|
+
var import_tracking = require("@preact-signals/safe-react/tracking");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_echo = require("@dxos/react-client/echo");
|
|
38
|
+
var import_react_ui_stack = require("@dxos/react-ui-stack");
|
|
39
|
+
var import_tracking2 = require("@preact-signals/safe-react/tracking");
|
|
40
|
+
var import_react2 = require("@phosphor-icons/react");
|
|
41
|
+
var import_react3 = __toESM(require("react"));
|
|
42
|
+
var import_display_name = require("@dxos/display-name");
|
|
43
|
+
var import_echo2 = require("@dxos/react-client/echo");
|
|
44
|
+
var import_react_ui = require("@dxos/react-ui");
|
|
45
|
+
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
46
|
+
var PlayerSelector = ({ space, game }) => {
|
|
47
|
+
var _effect = (0, import_tracking2.useSignals)();
|
|
48
|
+
try {
|
|
49
|
+
const members = (0, import_echo2.useMembers)(space.key);
|
|
50
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
51
|
+
role: "none",
|
|
52
|
+
className: "grid grid-cols-2 gap-8"
|
|
53
|
+
}, /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
54
|
+
role: "none",
|
|
55
|
+
className: "flex flex-row-reverse items-center gap-2"
|
|
56
|
+
}, /* @__PURE__ */ import_react3.default.createElement(PlayerSelect, {
|
|
57
|
+
side: "white",
|
|
58
|
+
value: game.playerWhite,
|
|
59
|
+
onValueChange: (player) => game.playerWhite = player,
|
|
60
|
+
members
|
|
61
|
+
})), /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
62
|
+
role: "none",
|
|
63
|
+
className: "flex flex-row items-center gap-2"
|
|
64
|
+
}, /* @__PURE__ */ import_react3.default.createElement(PlayerSelect, {
|
|
65
|
+
side: "black",
|
|
66
|
+
value: game.playerBlack,
|
|
67
|
+
onValueChange: (player) => game.playerBlack = player,
|
|
68
|
+
members
|
|
69
|
+
})));
|
|
70
|
+
} finally {
|
|
71
|
+
_effect.f();
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var PlayerSelect = ({ side, value, onValueChange, members }) => {
|
|
75
|
+
var _effect = (0, import_tracking2.useSignals)();
|
|
76
|
+
try {
|
|
77
|
+
const { themeMode } = (0, import_react_ui.useThemeContext)();
|
|
78
|
+
const iconFillMode = side === "black" && themeMode === "light" || side === "white" && themeMode === "dark" ? "fill" : void 0;
|
|
79
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Input.Root, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Input.Label, null, /* @__PURE__ */ import_react3.default.createElement(import_react2.CrownCross, {
|
|
80
|
+
className: (0, import_react_ui_theme.mx)((0, import_react_ui_theme.getSize)(6)),
|
|
81
|
+
weight: iconFillMode,
|
|
82
|
+
"aria-label": `Chess icon for side ${side}`
|
|
83
|
+
})), /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Root, {
|
|
84
|
+
value,
|
|
85
|
+
onValueChange
|
|
86
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.TriggerButton, {
|
|
87
|
+
placeholder: "Select player"
|
|
88
|
+
}), /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Portal, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Content, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Viewport, null, members.map((member) => {
|
|
89
|
+
const memberKey = member.identity.identityKey.toHex();
|
|
90
|
+
const displayName = member.identity?.profile?.displayName || (0, import_display_name.generateName)(memberKey);
|
|
91
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Option, {
|
|
92
|
+
key: memberKey,
|
|
93
|
+
value: memberKey
|
|
94
|
+
}, displayName);
|
|
95
|
+
}))))));
|
|
96
|
+
} finally {
|
|
97
|
+
_effect.f();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var ChessContainer = ({ game }) => {
|
|
101
|
+
var _effect = (0, import_tracking.useSignals)();
|
|
102
|
+
try {
|
|
103
|
+
const space = (0, import_echo.getSpace)(game);
|
|
104
|
+
if (!space) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, null, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
108
|
+
role: "none",
|
|
109
|
+
className: "grid grid-rows-[60px_1fr_60px] grow overflow-hidden"
|
|
110
|
+
}, /* @__PURE__ */ import_react.default.createElement("div", null), /* @__PURE__ */ import_react.default.createElement("div", {
|
|
111
|
+
className: "flex m-4 overflow-hidden"
|
|
112
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_chunk_OTMP6HPY.ChessComponent, {
|
|
113
|
+
game
|
|
114
|
+
})), /* @__PURE__ */ import_react.default.createElement(PlayerSelector, {
|
|
115
|
+
space,
|
|
116
|
+
game
|
|
117
|
+
})));
|
|
118
|
+
} finally {
|
|
119
|
+
_effect.f();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
var ChessContainer_default = ChessContainer;
|
|
123
|
+
//# sourceMappingURL=ChessContainer-EQUVXDJC.cjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/ChessContainer.tsx", "../../../src/components/PlayerSelector.tsx"],
|
|
4
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>\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": "
|
|
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,UAAMC,cAAUC,yBAAWH,MAAMI,GAAG;AAEpC,WACE,8BAAAC,QAAA,cAACC,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACzB,8BAAAH,QAAA,cAACC,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACzB,8BAAAH,QAAA,cAACI,cAAAA;MACCC,MAAK;MACLC,OAAOV,KAAKW;MACZC,eAAe,CAACC,WAAYb,KAAKW,cAAcE;MAC/CZ;SAGJ,8BAAAG,QAAA,cAACC,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACzB,8BAAAH,QAAA,cAACI,cAAAA;MACCC,MAAK;MACLC,OAAOV,KAAKc;MACZF,eAAe,CAACC,WAAYb,KAAKc,cAAcD;MAC/CZ;;;;;AAKV;AAEA,IAAMO,eAAe,CAAC,EACpBC,MACAC,OACAE,eACAX,QAAO,MAMR;;;AACC,UAAM,EAAEc,UAAS,QAAKC,iCAAAA;AACtB,UAAMC,eACHR,SAAS,WAAWM,cAAc,WAAaN,SAAS,WAAWM,cAAc,SAAU,SAASG;AAEvG,WACE,8BAAAd,QAAA,cAACe,sBAAMC,MAAI,MACT,8BAAAhB,QAAA,cAACe,sBAAME,OAAK,MACV,8BAAAjB,QAAA,cAACkB,0BAAAA;MAAWf,eAAWgB,8BAAGC,+BAAQ,CAAA,CAAA;MAAKC,QAAQR;MAAcS,cAAY,uBAAuBjB,IAAAA;SAElG,8BAAAL,QAAA,cAACuB,uBAAOP,MAAI;MAACV;MAAcE;OACzB,8BAAAR,QAAA,cAACuB,uBAAOC,eAAa;MAACC,aAAa;QACnC,8BAAAzB,QAAA,cAACuB,uBAAOG,QAAM,MACZ,8BAAA1B,QAAA,cAACuB,uBAAOI,SAAO,MACb,8BAAA3B,QAAA,cAACuB,uBAAOK,UAAQ,MACb/B,QAAQgC,IAAI,CAACC,WAAAA;AACZ,YAAMC,YAAYD,OAAOE,SAASC,YAAYC,MAAK;AACnD,YAAMC,cAAcL,OAAOE,UAAUI,SAASD,mBAAeE,kCAAaN,SAAAA;AAC1E,aACE,8BAAA/B,QAAA,cAACuB,uBAAOe,QAAM;QAACvC,KAAKgC;QAAWzB,OAAOyB;SACnCI,WAAAA;IAGP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;;AAOd;ADlEA,IAAMI,iBAAiB,CAAC,EAAE3C,KAAI,MAAsC;;;AAClE,UAAMD,YAAQ6C,sBAAS5C,IAAAA;AACvB,QAAI,CAACD,OAAO;AACV,aAAO;IACT;AAEA,WACEK,6BAAAA,QAAA,cAACyC,gCAAUd,SAAO,MAChB3B,6BAAAA,QAAA,cAACC,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACzBH,6BAAAA,QAAA,cAACC,OAAAA,IAAAA,GAEDD,6BAAAA,QAAA,cAACC,OAAAA;MAAIE,WAAU;OACbH,6BAAAA,QAAA,cAAC0C,sCAAAA;MAAe9C;SAGlBI,6BAAAA,QAAA,cAACN,gBAAAA;MAAeC;MAAcC;;;;;AAItC;AAEA,IAAA,yBAAe2C;",
|
|
6
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", "ChessComponent"]
|
|
7
7
|
}
|
|
@@ -16,14 +16,15 @@ 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 artifact_definition_FRBMG5FU_exports = {};
|
|
20
|
+
__export(artifact_definition_FRBMG5FU_exports, {
|
|
21
21
|
default: () => artifact_definition_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(artifact_definition_FRBMG5FU_exports);
|
|
24
|
+
var import_chunk_33WBRZI6 = require("./chunk-33WBRZI6.cjs");
|
|
25
25
|
var import_chess = require("chess.js");
|
|
26
26
|
var import_effect = require("effect");
|
|
27
|
+
var import_ai = require("@dxos/ai");
|
|
27
28
|
var import_app_framework = require("@dxos/app-framework");
|
|
28
29
|
var import_artifact = require("@dxos/artifact");
|
|
29
30
|
var import_assistant = require("@dxos/assistant");
|
|
@@ -34,28 +35,28 @@ var import_echo = require("@dxos/react-client/echo");
|
|
|
34
35
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts";
|
|
35
36
|
var artifact_definition_default = () => {
|
|
36
37
|
const definition = (0, import_artifact.defineArtifact)({
|
|
37
|
-
id: `artifact:${
|
|
38
|
-
name:
|
|
38
|
+
id: `artifact:${import_chunk_33WBRZI6.meta.id}`,
|
|
39
|
+
name: import_chunk_33WBRZI6.meta.name,
|
|
39
40
|
description: "Provides a simple chess engine.",
|
|
40
41
|
instructions: `
|
|
41
42
|
- 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.
|
|
42
43
|
- Always inspect the chess game at the start of every prompt realting to a chess game, as it might have changed since the interaction.
|
|
43
44
|
`,
|
|
44
|
-
schema:
|
|
45
|
+
schema: import_chunk_33WBRZI6.ChessType,
|
|
45
46
|
tools: [
|
|
46
|
-
(0,
|
|
47
|
+
(0, import_ai.createTool)(import_chunk_33WBRZI6.meta.id, {
|
|
47
48
|
name: "create",
|
|
48
49
|
description: "Create a new chess game. Returns the artifact definition for the game.",
|
|
49
50
|
caption: "Creating chess game...",
|
|
50
|
-
schema:
|
|
51
|
-
fen:
|
|
51
|
+
schema: import_effect.Schema.Struct({
|
|
52
|
+
fen: import_effect.Schema.String.annotations({
|
|
52
53
|
description: "The state of the chess game in the FEN format."
|
|
53
54
|
})
|
|
54
55
|
}),
|
|
55
56
|
execute: async ({ fen }, { extensions }) => {
|
|
56
57
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
57
58
|
F: __dxlog_file,
|
|
58
|
-
L:
|
|
59
|
+
L: 47,
|
|
59
60
|
S: void 0,
|
|
60
61
|
A: [
|
|
61
62
|
"extensions?.space",
|
|
@@ -64,92 +65,92 @@ var artifact_definition_default = () => {
|
|
|
64
65
|
});
|
|
65
66
|
(0, import_invariant.invariant)(extensions?.dispatch, "No intent dispatcher", {
|
|
66
67
|
F: __dxlog_file,
|
|
67
|
-
L:
|
|
68
|
+
L: 48,
|
|
68
69
|
S: void 0,
|
|
69
70
|
A: [
|
|
70
71
|
"extensions?.dispatch",
|
|
71
72
|
"'No intent dispatcher'"
|
|
72
73
|
]
|
|
73
74
|
});
|
|
74
|
-
const intent = (0, import_effect.pipe)((0, import_app_framework.createIntent)(
|
|
75
|
+
const intent = (0, import_effect.pipe)((0, import_app_framework.createIntent)(import_chunk_33WBRZI6.ChessAction.Create, {
|
|
75
76
|
fen
|
|
76
77
|
}), (0, import_app_framework.chain)(import_types.SpaceAction.AddObject, {
|
|
77
78
|
target: extensions.space
|
|
78
79
|
}));
|
|
79
80
|
const { data, error } = await extensions.dispatch(intent);
|
|
80
81
|
if (!data || error) {
|
|
81
|
-
return
|
|
82
|
+
return import_ai.ToolResult.Error(error?.message ?? "Failed to create chess game");
|
|
82
83
|
}
|
|
83
|
-
return
|
|
84
|
+
return import_ai.ToolResult.Success((0, import_assistant.createArtifactElement)(data.id), [
|
|
85
|
+
import_assistant.VersionPin.createBlock(import_assistant.VersionPin.fromObject(data.object))
|
|
86
|
+
]);
|
|
84
87
|
}
|
|
85
88
|
}),
|
|
86
|
-
(0,
|
|
89
|
+
(0, import_ai.createTool)(import_chunk_33WBRZI6.meta.id, {
|
|
87
90
|
name: "list",
|
|
88
91
|
description: "Query all active chess games.",
|
|
89
92
|
caption: "Getting games...",
|
|
90
|
-
schema:
|
|
93
|
+
schema: import_effect.Schema.Struct({}),
|
|
91
94
|
execute: async (_, { extensions }) => {
|
|
92
95
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
93
96
|
F: __dxlog_file,
|
|
94
|
-
L:
|
|
97
|
+
L: 69,
|
|
95
98
|
S: void 0,
|
|
96
99
|
A: [
|
|
97
100
|
"extensions?.space",
|
|
98
101
|
"'No space'"
|
|
99
102
|
]
|
|
100
103
|
});
|
|
101
|
-
const { objects: games } = await extensions.space.db.query(import_echo.Filter.
|
|
104
|
+
const { objects: games } = await extensions.space.db.query(import_echo.Filter.type(import_chunk_33WBRZI6.ChessType)).run();
|
|
102
105
|
(0, import_invariant.invariant)(games.length > 0, "No chess games found", {
|
|
103
106
|
F: __dxlog_file,
|
|
104
|
-
L:
|
|
107
|
+
L: 71,
|
|
105
108
|
S: void 0,
|
|
106
109
|
A: [
|
|
107
110
|
"games.length > 0",
|
|
108
111
|
"'No chess games found'"
|
|
109
112
|
]
|
|
110
113
|
});
|
|
111
|
-
return
|
|
114
|
+
return import_ai.ToolResult.Success(games);
|
|
112
115
|
}
|
|
113
116
|
}),
|
|
114
|
-
(0,
|
|
117
|
+
(0, import_ai.createTool)(import_chunk_33WBRZI6.meta.id, {
|
|
115
118
|
name: "inspect",
|
|
116
119
|
description: "Get the current state of the chess game.",
|
|
117
120
|
caption: "Inspecting game...",
|
|
118
|
-
schema:
|
|
121
|
+
schema: import_effect.Schema.Struct({
|
|
119
122
|
id: import_artifact.ArtifactId
|
|
120
123
|
}),
|
|
121
124
|
execute: async ({ id }, { extensions }) => {
|
|
122
125
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
123
126
|
F: __dxlog_file,
|
|
124
|
-
L:
|
|
127
|
+
L: 81,
|
|
125
128
|
S: void 0,
|
|
126
129
|
A: [
|
|
127
130
|
"extensions?.space",
|
|
128
131
|
"'No space'"
|
|
129
132
|
]
|
|
130
133
|
});
|
|
131
|
-
const game = await extensions.space.db.query(
|
|
132
|
-
|
|
133
|
-
}).first();
|
|
134
|
-
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_PQ64RGCS.ChessType, game), void 0, {
|
|
134
|
+
const game = await extensions.space.db.query(import_echo.Filter.ids(import_artifact.ArtifactId.toDXN(id, extensions.space.id).toString())).first();
|
|
135
|
+
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_33WBRZI6.ChessType, game), void 0, {
|
|
135
136
|
F: __dxlog_file,
|
|
136
|
-
L:
|
|
137
|
+
L: 85,
|
|
137
138
|
S: void 0,
|
|
138
139
|
A: [
|
|
139
140
|
"isInstanceOf(ChessType, game)",
|
|
140
141
|
""
|
|
141
142
|
]
|
|
142
143
|
});
|
|
143
|
-
return
|
|
144
|
+
return import_ai.ToolResult.Success(game.fen);
|
|
144
145
|
}
|
|
145
146
|
}),
|
|
146
|
-
(0,
|
|
147
|
+
(0, import_ai.createTool)(import_chunk_33WBRZI6.meta.id, {
|
|
147
148
|
name: "move",
|
|
148
149
|
description: "Make a move in the chess game.",
|
|
149
150
|
caption: "Making chess move...",
|
|
150
|
-
schema:
|
|
151
|
+
schema: import_effect.Schema.Struct({
|
|
151
152
|
id: import_artifact.ArtifactId,
|
|
152
|
-
move:
|
|
153
|
+
move: import_effect.Schema.String.annotations({
|
|
153
154
|
description: "The move to make in the chess game.",
|
|
154
155
|
examples: [
|
|
155
156
|
"e4",
|
|
@@ -160,19 +161,17 @@ var artifact_definition_default = () => {
|
|
|
160
161
|
execute: async ({ id, move }, { extensions }) => {
|
|
161
162
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
162
163
|
F: __dxlog_file,
|
|
163
|
-
L:
|
|
164
|
+
L: 102,
|
|
164
165
|
S: void 0,
|
|
165
166
|
A: [
|
|
166
167
|
"extensions?.space",
|
|
167
168
|
"'No space'"
|
|
168
169
|
]
|
|
169
170
|
});
|
|
170
|
-
const game = await extensions.space.db.query(
|
|
171
|
-
|
|
172
|
-
}).first();
|
|
173
|
-
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_PQ64RGCS.ChessType, game), void 0, {
|
|
171
|
+
const game = await extensions.space.db.query(import_echo.Filter.ids(import_artifact.ArtifactId.toDXN(id, extensions.space.id).toString())).first();
|
|
172
|
+
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_33WBRZI6.ChessType, game), void 0, {
|
|
174
173
|
F: __dxlog_file,
|
|
175
|
-
L:
|
|
174
|
+
L: 106,
|
|
176
175
|
S: void 0,
|
|
177
176
|
A: [
|
|
178
177
|
"isInstanceOf(ChessType, game)",
|
|
@@ -183,15 +182,15 @@ var artifact_definition_default = () => {
|
|
|
183
182
|
try {
|
|
184
183
|
board.move(move);
|
|
185
184
|
} catch (error) {
|
|
186
|
-
return
|
|
185
|
+
return import_ai.ToolResult.Error(error.message);
|
|
187
186
|
}
|
|
188
187
|
game.pgn = board.pgn();
|
|
189
188
|
game.fen = board.fen();
|
|
190
|
-
return
|
|
189
|
+
return import_ai.ToolResult.Success(game.fen);
|
|
191
190
|
}
|
|
192
191
|
})
|
|
193
192
|
]
|
|
194
193
|
});
|
|
195
194
|
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.ArtifactDefinition, definition);
|
|
196
195
|
};
|
|
197
|
-
//# sourceMappingURL=artifact-definition-
|
|
196
|
+
//# sourceMappingURL=artifact-definition-FRBMG5FU.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, Schema } from 'effect';\n\nimport { createTool, ToolResult } from '@dxos/ai';\nimport { Capabilities, chain, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { ArtifactId, defineArtifact } from '@dxos/artifact';\nimport { createArtifactElement, VersionPin } from '@dxos/assistant';\nimport { isInstanceOf } 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 { meta } from '../meta';\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: `artifact:${meta.id}`,\n name: meta.name,\n description: 'Provides a simple chess engine.',\n instructions: `\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 - Always inspect the chess game at the start of every prompt realting to a chess game, as it might have changed since the interaction.\n `,\n schema: ChessType,\n tools: [\n createTool(meta.id, {\n name: 'create',\n description: 'Create a new chess game. Returns the artifact definition for the game.',\n caption: 'Creating chess game...',\n schema: Schema.Struct({\n fen: Schema.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 VersionPin.createBlock(VersionPin.fromObject(data.object)),\n ]);\n },\n }),\n createTool(meta.id, {\n name: 'list',\n description: 'Query all active chess games.',\n caption: 'Getting games...',\n schema: Schema.Struct({}),\n execute: async (_, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.type(ChessType)).run();\n invariant(games.length > 0, 'No chess games found');\n return ToolResult.Success(games);\n },\n }),\n createTool(meta.id, {\n name: 'inspect',\n description: 'Get the current state of the chess game.',\n caption: 'Inspecting game...',\n schema: Schema.Struct({ id: ArtifactId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const game = await extensions.space.db\n .query(Filter.ids(ArtifactId.toDXN(id, extensions.space.id).toString()))\n .first();\n invariant(isInstanceOf(ChessType, game));\n\n return ToolResult.Success(game.fen);\n },\n }),\n createTool(meta.id, {\n name: 'move',\n description: 'Make a move in the chess game.',\n caption: 'Making chess move...',\n schema: Schema.Struct({\n id: ArtifactId,\n move: Schema.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 game = await extensions.space.db\n .query(Filter.ids(ArtifactId.toDXN(id, extensions.space.id).toString()))\n .first();\n invariant(isInstanceOf(ChessType, game));\n\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,oBAA6B;AAE7B,gBAAuC;AACvC,2BAA6F;AAC7F,sBAA2C;AAC3C,uBAAkD;AAClD,yBAA6B;AAC7B,uBAA0B;AAC1B,mBAA4B;AAC5B,kBAAmC;;AAanC,IAAA,8BAAe,MAAA;AACb,QAAMA,iBAAaC,gCAAe;IAChCC,IAAI,YAAYC,2BAAKD,EAAE;IACvBE,MAAMD,2BAAKC;IACXC,aAAa;IACbC,cAAc;;;;IAIdC,QAAQC;IACRC,OAAO;UACLC,sBAAWP,2BAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,qBAAOC,OAAO;UACpBC,KAAKF,qBAAOG,OAAOC,YAAY;YAAEX,aAAa;UAAiD,CAAA;QACjG,CAAA;QACAY,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,qBAAWC,MAAMF,OAAOG,WAAW,6BAAA;UAC5C;AAEA,iBAAOF,qBAAWG,YAAQC,wCAAsBN,KAAK7B,EAAE,GAAG;YACxDoC,4BAAWC,YAAYD,4BAAWE,WAAWT,KAAKU,MAAM,CAAA;WACzD;QACH;MACF,CAAA;UACA/B,sBAAWP,2BAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,qBAAOC,OAAO,CAAC,CAAA;QACvBI,SAAS,OAAOyB,GAAG,EAAExB,WAAU,MAAE;AAC/BC,0CAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7B,gBAAM,EAAEuB,SAASC,MAAK,IAAK,MAAM1B,WAAWE,MAAMyB,GAAGC,MAAMC,mBAAOC,KAAKxC,+BAAAA,CAAAA,EAAYyC,IAAG;AACtF9B,0CAAUyB,MAAMM,SAAS,GAAG,wBAAA;;;;;;;;;AAC5B,iBAAOjB,qBAAWG,QAAQQ,KAAAA;QAC5B;MACF,CAAA;UACAlC,sBAAWP,2BAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,qBAAOC,OAAO;UAAEX,IAAIiD;QAAW,CAAA;QACvClC,SAAS,OAAO,EAAEf,GAAE,GAAI,EAAEgB,WAAU,MAAE;AACpCC,0CAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7B,gBAAMgC,OAAO,MAAMlC,WAAWE,MAAMyB,GACjCC,MAAMC,mBAAOM,IAAIF,2BAAWG,MAAMpD,IAAIgB,WAAWE,MAAMlB,EAAE,EAAEqD,SAAQ,CAAA,CAAA,EACnEC,MAAK;AACRrC,8CAAUsC,iCAAajD,iCAAW4C,IAAAA,GAAAA,QAAAA;;;;;;;;;AAElC,iBAAOnB,qBAAWG,QAAQgB,KAAKtC,GAAG;QACpC;MACF,CAAA;UACAJ,sBAAWP,2BAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,qBAAOC,OAAO;UACpBX,IAAIiD;UACJO,MAAM9C,qBAAOG,OAAOC,YAAY;YAC9BX,aAAa;YACbsD,UAAU;cAAC;cAAM;;UACnB,CAAA;QACF,CAAA;QACA1C,SAAS,OAAO,EAAEf,IAAIwD,KAAI,GAAI,EAAExC,WAAU,MAAE;AAC1CC,0CAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7B,gBAAMgC,OAAO,MAAMlC,WAAWE,MAAMyB,GACjCC,MAAMC,mBAAOM,IAAIF,2BAAWG,MAAMpD,IAAIgB,WAAWE,MAAMlB,EAAE,EAAEqD,SAAQ,CAAA,CAAA,EACnEC,MAAK;AACRrC,8CAAUsC,iCAAajD,iCAAW4C,IAAAA,GAAAA,QAAAA;;;;;;;;;AAElC,gBAAMQ,QAAQ,IAAIC,mBAAMT,KAAKtC,GAAG;AAChC,cAAI;AACF8C,kBAAMF,KAAKA,IAAAA;UACb,SAAS1B,OAAY;AACnB,mBAAOC,qBAAWC,MAAMF,MAAMG,OAAO;UACvC;AACAiB,eAAKU,MAAMF,MAAME,IAAG;AACpBV,eAAKtC,MAAM8C,MAAM9C,IAAG;AACpB,iBAAOmB,qBAAWG,QAAQgB,KAAKtC,GAAG;QACpC;MACF,CAAA;;EAEJ,CAAA;AAEA,aAAOiD,kCAAYC,kCAAaC,oBAAoBjE,UAAAA;AACtD;",
|
|
6
|
+
"names": ["definition", "defineArtifact", "id", "meta", "name", "description", "instructions", "schema", "ChessType", "tools", "createTool", "caption", "Schema", "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", "VersionPin", "createBlock", "fromObject", "object", "_", "objects", "games", "db", "query", "Filter", "type", "run", "length", "ArtifactId", "game", "ids", "toDXN", "toString", "first", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
+
}
|