@dxos/plugin-chess 0.8.2-main.f11618f → 0.8.2-staging.7ac8446
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/{artifact-definition-HTXW3AKR.mjs → artifact-definition-GHBVTO4Y.mjs} +12 -14
- package/dist/lib/browser/artifact-definition-GHBVTO4Y.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EIRRN4WP.mjs → chunk-4NJ4PMPW.mjs} +3 -3
- package/dist/lib/browser/{chunk-EIRRN4WP.mjs.map → chunk-4NJ4PMPW.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +4 -4
- package/dist/lib/browser/{intent-resolver-QECLUB7C.mjs → intent-resolver-JVLCHAJD.mjs} +4 -4
- package/dist/lib/browser/intent-resolver-JVLCHAJD.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-CMUAPVQA.mjs → react-surface-LZYVKHCU.mjs} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{artifact-definition-XRVEXVXI.cjs → artifact-definition-JDJAOTXF.cjs} +25 -27
- package/dist/lib/node/artifact-definition-JDJAOTXF.cjs.map +7 -0
- package/dist/lib/node/{chunk-SVNVQAMR.cjs → chunk-PQ64RGCS.cjs} +5 -5
- package/dist/lib/node/{chunk-SVNVQAMR.cjs.map → chunk-PQ64RGCS.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +18 -18
- package/dist/lib/node/{intent-resolver-JMO3PEBA.cjs → intent-resolver-IJXRCQA5.cjs} +7 -7
- package/dist/lib/node/intent-resolver-IJXRCQA5.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-GSLVN4KN.cjs → react-surface-JWVHHTQU.cjs} +8 -8
- package/dist/lib/node/types/index.cjs +5 -5
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{artifact-definition-VPB2TSLQ.mjs → artifact-definition-CSY4I334.mjs} +12 -14
- package/dist/lib/node-esm/artifact-definition-CSY4I334.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WDC3FJ53.mjs → chunk-GLBZ7ZZD.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-WDC3FJ53.mjs.map → chunk-GLBZ7ZZD.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +4 -4
- package/dist/lib/node-esm/{intent-resolver-BDI3HVPZ.mjs → intent-resolver-AWNZCS56.mjs} +4 -4
- package/dist/lib/node-esm/intent-resolver-AWNZCS56.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-L5YMO5FM.mjs → react-surface-TQKBCMJU.mjs} +2 -2
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/capabilities/artifact-definition.ts +4 -10
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/types/types.ts +2 -2
- package/dist/lib/browser/artifact-definition-HTXW3AKR.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-QECLUB7C.mjs.map +0 -7
- package/dist/lib/node/artifact-definition-XRVEXVXI.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-JMO3PEBA.cjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-VPB2TSLQ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-BDI3HVPZ.mjs.map +0 -7
- /package/dist/lib/browser/{react-surface-CMUAPVQA.mjs.map → react-surface-LZYVKHCU.mjs.map} +0 -0
- /package/dist/lib/node/{react-surface-GSLVN4KN.cjs.map → react-surface-JWVHHTQU.cjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-L5YMO5FM.mjs.map → react-surface-TQKBCMJU.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":3023,"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":19202,"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":2736,"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/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4838},"packages/plugins/plugin-chess/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-YFCRXSGH.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-WDC3FJ53.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-6SEDGO5G.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/artifact-definition-VPB2TSLQ.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-BDI3HVPZ.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-L5YMO5FM.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":2751},"packages/plugins/plugin-chess/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-WDC3FJ53.mjs","kind":"import-statement"}],"exports":["ChessAction","ChessType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":286},"packages/plugins/plugin-chess/dist/lib/node-esm/artifact-definition-VPB2TSLQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8374},"packages/plugins/plugin-chess/dist/lib/node-esm/artifact-definition-VPB2TSLQ.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-WDC3FJ53.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":5940}},"bytes":6292},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-BDI3HVPZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1367},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-BDI3HVPZ.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-WDC3FJ53.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":839},"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-MAXLUGKY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6151},"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-MAXLUGKY.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-6SEDGO5G.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":3544},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-L5YMO5FM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1851},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-L5YMO5FM.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-YFCRXSGH.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-WDC3FJ53.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-6SEDGO5G.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":1199},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-YFCRXSGH.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":404},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-YFCRXSGH.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-MAXLUGKY.mjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":328},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-WDC3FJ53.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3743},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-WDC3FJ53.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":605},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":2051},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-6SEDGO5G.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2438},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-6SEDGO5G.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":1224}}}
|
|
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/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4838},"packages/plugins/plugin-chess/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-YFCRXSGH.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GLBZ7ZZD.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-6SEDGO5G.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/artifact-definition-CSY4I334.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-AWNZCS56.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-TQKBCMJU.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":2751},"packages/plugins/plugin-chess/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GLBZ7ZZD.mjs","kind":"import-statement"}],"exports":["ChessAction","ChessType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":286},"packages/plugins/plugin-chess/dist/lib/node-esm/artifact-definition-CSY4I334.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8003},"packages/plugins/plugin-chess/dist/lib/node-esm/artifact-definition-CSY4I334.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GLBZ7ZZD.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":6150},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-AWNZCS56.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1375},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-AWNZCS56.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GLBZ7ZZD.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":843},"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-MAXLUGKY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6151},"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-MAXLUGKY.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-6SEDGO5G.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":3544},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-TQKBCMJU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1851},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-TQKBCMJU.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-YFCRXSGH.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GLBZ7ZZD.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-6SEDGO5G.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":1199},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-YFCRXSGH.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":404},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-YFCRXSGH.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-MAXLUGKY.mjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":328},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GLBZ7ZZD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3761},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GLBZ7ZZD.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":2059},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-6SEDGO5G.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2438},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-6SEDGO5G.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":1224}}}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
CHESS_PLUGIN,
|
|
7
7
|
ChessType,
|
|
8
8
|
isObject
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GLBZ7ZZD.mjs";
|
|
10
10
|
import {
|
|
11
11
|
ChessComponent
|
|
12
12
|
} from "./chunk-6SEDGO5G.mjs";
|
|
@@ -40,4 +40,4 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
|
40
40
|
export {
|
|
41
41
|
react_surface_default as default
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=react-surface-
|
|
43
|
+
//# sourceMappingURL=react-surface-TQKBCMJU.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-definition.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/artifact-definition.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkD,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAMnH,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAM7D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,QAAQ,CAAC,EAAE,uBAAuB,CAAC;KACpC;CACF;;AAED,
|
|
1
|
+
{"version":3,"file":"artifact-definition.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/artifact-definition.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkD,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAMnH,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAM7D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,QAAQ,CAAC,EAAE,uBAAuB,CAAC;KACpC;CACF;;AAED,wBAyFE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-chess",
|
|
3
|
-
"version": "0.8.2-
|
|
3
|
+
"version": "0.8.2-staging.7ac8446",
|
|
4
4
|
"description": "Chess for new plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
"@preact/signals-core": "^1.6.0",
|
|
37
37
|
"chess.js": "^1.0.0",
|
|
38
38
|
"effect": "3.13.3",
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/assistant": "0.8.2-
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/echo-schema": "0.8.2-
|
|
45
|
-
"@dxos/invariant": "0.8.2-
|
|
46
|
-
"@dxos/live-object": "0.8.2-
|
|
47
|
-
"@dxos/plugin-
|
|
48
|
-
"@dxos/plugin-
|
|
49
|
-
"@dxos/plugin-
|
|
50
|
-
"@dxos/react-client": "0.8.2-
|
|
51
|
-
"@dxos/react-ui-
|
|
52
|
-
"@dxos/react-ui-
|
|
39
|
+
"@dxos/app-framework": "0.8.2-staging.7ac8446",
|
|
40
|
+
"@dxos/assistant": "0.8.2-staging.7ac8446",
|
|
41
|
+
"@dxos/async": "0.8.2-staging.7ac8446",
|
|
42
|
+
"@dxos/display-name": "0.8.2-staging.7ac8446",
|
|
43
|
+
"@dxos/artifact": "0.8.2-staging.7ac8446",
|
|
44
|
+
"@dxos/echo-schema": "0.8.2-staging.7ac8446",
|
|
45
|
+
"@dxos/invariant": "0.8.2-staging.7ac8446",
|
|
46
|
+
"@dxos/live-object": "0.8.2-staging.7ac8446",
|
|
47
|
+
"@dxos/plugin-client": "0.8.2-staging.7ac8446",
|
|
48
|
+
"@dxos/plugin-graph": "0.8.2-staging.7ac8446",
|
|
49
|
+
"@dxos/plugin-space": "0.8.2-staging.7ac8446",
|
|
50
|
+
"@dxos/react-client": "0.8.2-staging.7ac8446",
|
|
51
|
+
"@dxos/react-ui-stack": "0.8.2-staging.7ac8446",
|
|
52
|
+
"@dxos/react-ui-gameboard": "0.8.2-staging.7ac8446"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -58,16 +58,16 @@
|
|
|
58
58
|
"react": "~18.2.0",
|
|
59
59
|
"react-dom": "~18.2.0",
|
|
60
60
|
"vite": "5.4.7",
|
|
61
|
-
"@dxos/react-ui": "0.8.2-
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
61
|
+
"@dxos/react-ui": "0.8.2-staging.7ac8446",
|
|
62
|
+
"@dxos/storybook-utils": "0.8.2-staging.7ac8446",
|
|
63
|
+
"@dxos/react-ui-theme": "0.8.2-staging.7ac8446"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@phosphor-icons/react": "^2.1.5",
|
|
67
67
|
"react": "~18.2.0",
|
|
68
68
|
"react-dom": "~18.2.0",
|
|
69
|
-
"@dxos/react-ui": "0.8.2-
|
|
70
|
-
"@dxos/react-ui-theme": "0.8.2-
|
|
69
|
+
"@dxos/react-ui": "0.8.2-staging.7ac8446",
|
|
70
|
+
"@dxos/react-ui-theme": "0.8.2-staging.7ac8446"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
|
@@ -7,7 +7,7 @@ import { pipe } from 'effect';
|
|
|
7
7
|
|
|
8
8
|
import { Capabilities, chain, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { ArtifactId, defineArtifact, defineTool, ToolResult } from '@dxos/artifact';
|
|
10
|
-
import { createArtifactElement
|
|
10
|
+
import { createArtifactElement } from '@dxos/assistant';
|
|
11
11
|
import { isInstanceOf, S } from '@dxos/echo-schema';
|
|
12
12
|
import { invariant } from '@dxos/invariant';
|
|
13
13
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
@@ -54,9 +54,7 @@ export default () => {
|
|
|
54
54
|
return ToolResult.Error(error?.message ?? 'Failed to create chess game');
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
return ToolResult.Success(createArtifactElement(data.id)
|
|
58
|
-
VersionPin.createBlock(VersionPin.fromObject(data.object)),
|
|
59
|
-
]);
|
|
57
|
+
return ToolResult.Success(createArtifactElement(data.id));
|
|
60
58
|
},
|
|
61
59
|
}),
|
|
62
60
|
defineTool(meta.id, {
|
|
@@ -78,9 +76,7 @@ export default () => {
|
|
|
78
76
|
schema: S.Struct({ id: ArtifactId }),
|
|
79
77
|
execute: async ({ id }, { extensions }) => {
|
|
80
78
|
invariant(extensions?.space, 'No space');
|
|
81
|
-
const game = await extensions.space.db
|
|
82
|
-
.query({ id: ArtifactId.toDXN(id, extensions.space.id).toString() })
|
|
83
|
-
.first();
|
|
79
|
+
const game = await extensions.space.db.query({ id: ArtifactId.toDXN(id).toString() }).first();
|
|
84
80
|
invariant(isInstanceOf(ChessType, game));
|
|
85
81
|
|
|
86
82
|
return ToolResult.Success(game.fen);
|
|
@@ -99,9 +95,7 @@ export default () => {
|
|
|
99
95
|
}),
|
|
100
96
|
execute: async ({ id, move }, { extensions }) => {
|
|
101
97
|
invariant(extensions?.space, 'No space');
|
|
102
|
-
const game = await extensions.space.db
|
|
103
|
-
.query({ id: ArtifactId.toDXN(id, extensions.space.id).toString() })
|
|
104
|
-
.first();
|
|
98
|
+
const game = await extensions.space.db.query({ id: ArtifactId.toDXN(id).toString() }).first();
|
|
105
99
|
invariant(isInstanceOf(ChessType, game));
|
|
106
100
|
|
|
107
101
|
const board = new Chess(game.fen);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Chess } from 'chess.js';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
8
|
+
import { create } from '@dxos/live-object';
|
|
9
9
|
|
|
10
10
|
import { ChessAction, ChessType } from '../types';
|
|
11
11
|
|
|
@@ -18,7 +18,7 @@ export default () =>
|
|
|
18
18
|
const pgn = fen ? new Chess(fen).pgn() : undefined;
|
|
19
19
|
return {
|
|
20
20
|
data: {
|
|
21
|
-
object:
|
|
21
|
+
object: create(ChessType, { name, fen, pgn }),
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
},
|
package/src/types/types.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { isInstanceOf, S } from '@dxos/echo-schema';
|
|
6
|
-
import {
|
|
6
|
+
import { isReactiveObject } from '@dxos/live-object';
|
|
7
7
|
|
|
8
8
|
import { ChessType } from './schema';
|
|
9
9
|
import { CHESS_PLUGIN } from '../meta';
|
|
@@ -23,5 +23,5 @@ export namespace ChessAction {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export const isObject = (object: unknown): object is typeof ChessType => {
|
|
26
|
-
return
|
|
26
|
+
return isReactiveObject(object) && isInstanceOf(ChessType, object);
|
|
27
27
|
};
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { ArtifactId, defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement, VersionPin } from '@dxos/assistant';\nimport { isInstanceOf, 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 { 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 defineTool(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: 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 VersionPin.createBlock(VersionPin.fromObject(data.object)),\n ]);\n },\n }),\n defineTool(meta.id, {\n name: 'list',\n description: 'Query all active chess games.',\n caption: 'Getting 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(meta.id, {\n name: 'inspect',\n description: 'Get the current state of the chess game.',\n caption: 'Inspecting game...',\n schema: S.Struct({ id: ArtifactId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const game = await extensions.space.db\n .query({ id: ArtifactId.toDXN(id, extensions.space.id).toString() })\n .first();\n invariant(isInstanceOf(ChessType, game));\n\n return ToolResult.Success(game.fen);\n },\n }),\n defineTool(meta.id, {\n name: 'move',\n description: 'Make a move in the chess game.',\n caption: 'Making chess move...',\n schema: S.Struct({\n id: ArtifactId,\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 game = await extensions.space.db\n .query({ id: 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,SAASA,aAAa;AACtB,SAASC,YAAY;AAErB,SAASC,cAAcC,OAAOC,aAAaC,oBAAkD;AAC7F,SAASC,YAAYC,gBAAgBC,YAAYC,kBAAkB;AACnE,SAASC,uBAAuBC,kBAAkB;AAClD,SAASC,cAAcC,SAAS;AAChC,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,cAA0B;;AAanC,IAAA,8BAAe,MAAA;AACb,QAAMC,aAAaC,eAAe;IAChCC,IAAI,YAAYC,KAAKD,EAAE;IACvBE,MAAMD,KAAKC;IACXC,aAAa;IACbC,cAAc;;;;IAIdC,QAAQC;IACRC,OAAO;MACLC,WAAWP,KAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,EAAEC,OAAO;UACfC,KAAKF,EAAEG,OAAOC,YAAY;YAAEX,aAAa;UAAiD,CAAA;QAC5F,CAAA;QACAY,SAAS,OAAO,EAAEH,IAAG,GAAI,EAAEI,WAAU,MAAE;AACrCC,oBAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7BD,oBAAUD,YAAYG,UAAU,wBAAA;;;;;;;;;AAChC,gBAAMC,SAASC,KACbC,aAAaC,YAAYC,QAAQ;YAAEZ;UAAI,CAAA,GACvCa,MAAMC,YAAYC,WAAW;YAAEC,QAAQZ,WAAWE;UAAM,CAAA,CAAA;AAE1D,gBAAM,EAAEW,MA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KAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,EAAEC,OAAO;UACfX,IAAIgD;UACJM,MAAM5C,EAAEG,OAAOC,YAAY;YACzBX,aAAa;YACboD,UAAU;cAAC;cAAM;;UACnB,CAAA;QACF,CAAA;QACAxC,SAAS,OAAO,EAAEf,IAAIsD,KAAI,GAAI,EAAEtC,WAAU,MAAE;AAC1CC,oBAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7B,gBAAM+B,OAAO,MAAMjC,WAAWE,MAAMyB,GACjCC,MAAM;YAAE5C,IAAIgD,WAAWE,MAAMlD,IAAIgB,WAAWE,MAAMlB,EAAE,EAAEmD,SAAQ;UAAG,CAAA,EACjEC,MAAK;AACRnC,oBAAUoC,aAAa/C,WAAW2C,IAAAA,GAAAA,QAAAA;;;;;;;;;AAElC,gBAAMO,QAAQ,IAAIC,MAAMR,KAAKrC,GAAG;AAChC,cAAI;AACF4C,kBAAMF,KAAKA,IAAAA;UACb,SAASxB,OAAY;AACnB,mBAAOC,WAAWC,MAAMF,MAAMG,OAAO;UACvC;AACAgB,eAAKS,MAAMF,MAAME,IAAG;AACpBT,eAAKrC,MAAM4C,MAAM5C,IAAG;AACpB,iBAAOmB,WAAWG,QAAQe,KAAKrC,GAAG;QACpC;MACF,CAAA;;EAEJ,CAAA;AAEA,SAAO+C,YAAYC,aAAaC,oBAAoB/D,UAAAA;AACtD;",
|
|
6
|
-
"names": ["Chess", "pipe", "Capabilities", "chain", "contributes", "createIntent", "ArtifactId", "defineArtifact", "defineTool", "ToolResult", "createArtifactElement", "VersionPin", "isInstanceOf", "S", "invariant", "SpaceAction", "Filter", "definition", "defineArtifact", "id", "meta", "name", "description", "instructions", "schema", "ChessType", "tools", "defineTool", "caption", "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", "VersionPin", "createBlock", "fromObject", "object", "_", "objects", "games", "db", "query", "Filter", "run", "length", "ArtifactId", "game", "toDXN", "toString", "first", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess } from 'chess.js';\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { live } from '@dxos/live-object';\n\nimport { ChessAction, ChessType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ChessAction.Create,\n resolve: ({ name, fen }) => {\n const pgn = fen ? new Chess(fen).pgn() : undefined;\n return {\n data: {\n object: live(ChessType, { name, fen, pgn }),\n },\n };\n },\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,aAAa;AAEtB,SAASC,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,YAAY;AAIrB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,YAAYC;EACpBC,SAAS,CAAC,EAAEC,MAAMC,IAAG,MAAE;AACrB,UAAMC,MAAMD,MAAM,IAAIE,MAAMF,GAAAA,EAAKC,IAAG,IAAKE;AACzC,WAAO;MACLC,MAAM;QACJC,QAAQC,KAAKC,WAAW;UAAER;UAAMC;UAAKC;QAAI,CAAA;MAC3C;IACF;EACF;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["Chess", "Capabilities", "contributes", "createResolver", "live", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ChessAction", "Create", "resolve", "name", "fen", "pgn", "Chess", "undefined", "data", "object", "live", "ChessType"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { ArtifactId, defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement, VersionPin } from '@dxos/assistant';\nimport { isInstanceOf, 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 { 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 defineTool(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: 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 VersionPin.createBlock(VersionPin.fromObject(data.object)),\n ]);\n },\n }),\n defineTool(meta.id, {\n name: 'list',\n description: 'Query all active chess games.',\n caption: 'Getting 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(meta.id, {\n name: 'inspect',\n description: 'Get the current state of the chess game.',\n caption: 'Inspecting game...',\n schema: S.Struct({ id: ArtifactId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const game = await extensions.space.db\n .query({ id: ArtifactId.toDXN(id, extensions.space.id).toString() })\n .first();\n invariant(isInstanceOf(ChessType, game));\n\n return ToolResult.Success(game.fen);\n },\n }),\n defineTool(meta.id, {\n name: 'move',\n description: 'Make a move in the chess game.',\n caption: 'Making chess move...',\n schema: S.Struct({\n id: ArtifactId,\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 game = await extensions.space.db\n .query({ id: 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,oBAAqB;AAErB,2BAA6F;AAC7F,sBAAmE;AACnE,uBAAkD;AAClD,yBAAgC;AAChC,uBAA0B;AAC1B,mBAA4B;AAC5B,kBAAmC;;AAanC,IAAA,8BAAe,MAAA;AACb,QAAMA,iBAAaC,gCAAe;IAChCC,IAAI,YAAYC,2BAAKD,EAAE;IACvBE,M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BAAOC,2BAAWC,MAAMF,MAAMG,OAAO;UACvC;AACAgB,eAAKS,MAAMF,MAAME,IAAG;AACpBT,eAAKrC,MAAM4C,MAAM5C,IAAG;AACpB,iBAAOmB,2BAAWG,QAAQe,KAAKrC,GAAG;QACpC;MACF,CAAA;;EAEJ,CAAA;AAEA,aAAO+C,kCAAYC,kCAAaC,oBAAoB/D,UAAAA;AACtD;",
|
|
6
|
-
"names": ["definition", "defineArtifact", "id", "meta", "name", "description", "instructions", "schema", "ChessType", "tools", "defineTool", "caption", "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", "VersionPin", "createBlock", "fromObject", "object", "_", "objects", "games", "db", "query", "Filter", "run", "length", "ArtifactId", "game", "toDXN", "toString", "first", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess } from 'chess.js';\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { live } from '@dxos/live-object';\n\nimport { ChessAction, ChessType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ChessAction.Create,\n resolve: ({ name, fen }) => {\n const pgn = fen ? new Chess(fen).pgn() : undefined;\n return {\n data: {\n object: live(ChessType, { name, fen, pgn }),\n },\n };\n },\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAsB;AAEtB,2BAA0D;AAC1D,yBAAqB;AAIrB,IAAA,0BAAe,UACbA,kCACEC,kCAAaC,oBACbC,qCAAe;EACbC,QAAQC,kCAAYC;EACpBC,SAAS,CAAC,EAAEC,MAAMC,IAAG,MAAE;AACrB,UAAMC,MAAMD,MAAM,IAAIE,mBAAMF,GAAAA,EAAKC,IAAG,IAAKE;AACzC,WAAO;MACLC,MAAM;QACJC,YAAQC,yBAAKC,iCAAW;UAAER;UAAMC;UAAKC;QAAI,CAAA;MAC3C;IACF;EACF;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ChessAction", "Create", "resolve", "name", "fen", "pgn", "Chess", "undefined", "data", "object", "live", "ChessType"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { ArtifactId, defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement, VersionPin } from '@dxos/assistant';\nimport { isInstanceOf, 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 { 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 defineTool(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: 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 VersionPin.createBlock(VersionPin.fromObject(data.object)),\n ]);\n },\n }),\n defineTool(meta.id, {\n name: 'list',\n description: 'Query all active chess games.',\n caption: 'Getting 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(meta.id, {\n name: 'inspect',\n description: 'Get the current state of the chess game.',\n caption: 'Inspecting game...',\n schema: S.Struct({ id: ArtifactId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const game = await extensions.space.db\n .query({ id: ArtifactId.toDXN(id, extensions.space.id).toString() })\n .first();\n invariant(isInstanceOf(ChessType, game));\n\n return ToolResult.Success(game.fen);\n },\n }),\n defineTool(meta.id, {\n name: 'move',\n description: 'Make a move in the chess game.',\n caption: 'Making chess move...',\n schema: S.Struct({\n id: ArtifactId,\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 game = await extensions.space.db\n .query({ id: 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,SAASA,aAAa;AACtB,SAASC,YAAY;AAErB,SAASC,cAAcC,OAAOC,aAAaC,oBAAkD;AAC7F,SAASC,YAAYC,gBAAgBC,YAAYC,kBAAkB;AACnE,SAASC,uBAAuBC,kBAAkB;AAClD,SAASC,cAAcC,SAAS;AAChC,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,cAA0B;;AAanC,IAAA,8BAAe,MAAA;AACb,QAAMC,aAAaC,eAAe;IAChCC,IAAI,YAAYC,KAAKD,EAAE;IACvBE,MAAMD,KAAKC;IACXC,aAAa;IACbC,cAAc;;;;IAIdC,QAAQC;IACRC,OAAO;MACLC,WAAWP,KAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,EAAEC,OAAO;UACfC,KAAKF,EAAEG,OAAOC,YAAY;YAAEX,aAAa;UAAiD,CAAA;QAC5F,CAAA;QACAY,SAAS,OAAO,EAAEH,IAAG,GAAI,EAAEI,WAAU,MAAE;AACrCC,oBAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7BD,oBAAUD,YAAYG,UAAU,wBAAA;;;;;;;;;AAChC,gBAAMC,SAASC,KACbC,aAAaC,YAAYC,QAAQ;YAAEZ;UAAI,CAAA,GACvCa,MAAMC,YAAYC,WAAW;YAAEC,QAAQZ,WAAWE;UAAM,CAAA,CAAA;AAE1D,gBAAM,EAAEW,MAAMC,MAAK,IAAK,MAAMd,WAAWG,SAASC,MAAAA;AAClD,cAAI,CAACS,QAAQC,OAAO;AAClB,mBAAOC,WAAWC,MAAMF,OAAOG,WAAW,6BAAA;UAC5C;AAEA,iBAAOF,WAAWG,QAAQC,sBAAsBN,KAA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AA;QACF,CAAA;QACAxC,SAAS,OAAO,EAAEf,IAAIsD,KAAI,GAAI,EAAEtC,WAAU,MAAE;AAC1CC,oBAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7B,gBAAM+B,OAAO,MAAMjC,WAAWE,MAAMyB,GACjCC,MAAM;YAAE5C,IAAIgD,WAAWE,MAAMlD,IAAIgB,WAAWE,MAAMlB,EAAE,EAAEmD,SAAQ;UAAG,CAAA,EACjEC,MAAK;AACRnC,oBAAUoC,aAAa/C,WAAW2C,IAAAA,GAAAA,QAAAA;;;;;;;;;AAElC,gBAAMO,QAAQ,IAAIC,MAAMR,KAAKrC,GAAG;AAChC,cAAI;AACF4C,kBAAMF,KAAKA,IAAAA;UACb,SAASxB,OAAY;AACnB,mBAAOC,WAAWC,MAAMF,MAAMG,OAAO;UACvC;AACAgB,eAAKS,MAAMF,MAAME,IAAG;AACpBT,eAAKrC,MAAM4C,MAAM5C,IAAG;AACpB,iBAAOmB,WAAWG,QAAQe,KAAKrC,GAAG;QACpC;MACF,CAAA;;EAEJ,CAAA;AAEA,SAAO+C,YAAYC,aAAaC,oBAAoB/D,UAAAA;AACtD;",
|
|
6
|
-
"names": ["Chess", "pipe", "Capabilities", "chain", "contributes", "createIntent", "ArtifactId", "defineArtifact", "defineTool", "ToolResult", "createArtifactElement", "VersionPin", "isInstanceOf", "S", "invariant", "SpaceAction", "Filter", "definition", "defineArtifact", "id", "meta", "name", "description", "instructions", "schema", "ChessType", "tools", "defineTool", "caption", "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", "VersionPin", "createBlock", "fromObject", "object", "_", "objects", "games", "db", "query", "Filter", "run", "length", "ArtifactId", "game", "toDXN", "toString", "first", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess } from 'chess.js';\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { live } from '@dxos/live-object';\n\nimport { ChessAction, ChessType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ChessAction.Create,\n resolve: ({ name, fen }) => {\n const pgn = fen ? new Chess(fen).pgn() : undefined;\n return {\n data: {\n object: live(ChessType, { name, fen, pgn }),\n },\n };\n },\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,SAASA,aAAa;AAEtB,SAASC,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,YAAY;AAIrB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,YAAYC;EACpBC,SAAS,CAAC,EAAEC,MAAMC,IAAG,MAAE;AACrB,UAAMC,MAAMD,MAAM,IAAIE,MAAMF,GAAAA,EAAKC,IAAG,IAAKE;AACzC,WAAO;MACLC,MAAM;QACJC,QAAQC,KAAKC,WAAW;UAAER;UAAMC;UAAKC;QAAI,CAAA;MAC3C;IACF;EACF;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["Chess", "Capabilities", "contributes", "createResolver", "live", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ChessAction", "Create", "resolve", "name", "fen", "pgn", "Chess", "undefined", "data", "object", "live", "ChessType"]
|
|
7
|
-
}
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/node-esm/{react-surface-L5YMO5FM.mjs.map → react-surface-TQKBCMJU.mjs.map}
RENAMED
|
File without changes
|