@dxos/plugin-chess 0.7.5-staging.b81e783 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/lib/browser/{artifact-definition-AEIQ7Z36.mjs → artifact-definition-D2SD45UX.mjs} +27 -21
  2. package/dist/lib/browser/artifact-definition-D2SD45UX.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-GKM6RRDX.mjs → chunk-NNA3W3LX.mjs} +3 -3
  4. package/dist/lib/browser/index.mjs +4 -4
  5. package/dist/lib/browser/{intent-resolver-VPK5QRXH.mjs → intent-resolver-KBIH2KYC.mjs} +2 -2
  6. package/dist/lib/browser/meta.json +1 -1
  7. package/dist/lib/browser/{react-surface-ITP4OMBZ.mjs → react-surface-2PI2KNSU.mjs} +2 -2
  8. package/dist/lib/browser/types/index.mjs +1 -1
  9. package/dist/lib/node/{artifact-definition-ZM5VDOVN.cjs → artifact-definition-YDPYM4NV.cjs} +35 -30
  10. package/dist/lib/node/artifact-definition-YDPYM4NV.cjs.map +7 -0
  11. package/dist/lib/node/{chunk-3TTH3HKL.cjs → chunk-VXYRI6VA.cjs} +4 -4
  12. package/dist/lib/node/index.cjs +19 -19
  13. package/dist/lib/node/{intent-resolver-PUM2BVGU.cjs → intent-resolver-TZFKPQOV.cjs} +7 -7
  14. package/dist/lib/node/meta.json +1 -1
  15. package/dist/lib/node/{react-surface-4G4PW5RU.cjs → react-surface-OHQIPHSN.cjs} +8 -8
  16. package/dist/lib/node/types/index.cjs +5 -5
  17. package/dist/lib/node/types/index.cjs.map +1 -1
  18. package/dist/lib/node-esm/{artifact-definition-NGQEQHJT.mjs → artifact-definition-LHQK5BBZ.mjs} +27 -21
  19. package/dist/lib/node-esm/artifact-definition-LHQK5BBZ.mjs.map +7 -0
  20. package/dist/lib/node-esm/{chunk-GQA2DRUZ.mjs → chunk-IP66EHSW.mjs} +3 -3
  21. package/dist/lib/node-esm/index.mjs +4 -4
  22. package/dist/lib/node-esm/{intent-resolver-IR3YUZIG.mjs → intent-resolver-WBUS64KC.mjs} +2 -2
  23. package/dist/lib/node-esm/meta.json +1 -1
  24. package/dist/lib/node-esm/{react-surface-AEMVDP4R.mjs → react-surface-XX4VFNRS.mjs} +2 -2
  25. package/dist/lib/node-esm/types/index.mjs +1 -1
  26. package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
  27. package/dist/types/src/capabilities/index.d.ts +1 -1
  28. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  29. package/dist/types/src/types/schema.d.ts +1 -1
  30. package/package.json +20 -20
  31. package/src/capabilities/artifact-definition.ts +16 -10
  32. package/dist/lib/browser/artifact-definition-AEIQ7Z36.mjs.map +0 -7
  33. package/dist/lib/node/artifact-definition-ZM5VDOVN.cjs.map +0 -7
  34. package/dist/lib/node-esm/artifact-definition-NGQEQHJT.mjs.map +0 -7
  35. /package/dist/lib/browser/{chunk-GKM6RRDX.mjs.map → chunk-NNA3W3LX.mjs.map} +0 -0
  36. /package/dist/lib/browser/{intent-resolver-VPK5QRXH.mjs.map → intent-resolver-KBIH2KYC.mjs.map} +0 -0
  37. /package/dist/lib/browser/{react-surface-ITP4OMBZ.mjs.map → react-surface-2PI2KNSU.mjs.map} +0 -0
  38. /package/dist/lib/node/{chunk-3TTH3HKL.cjs.map → chunk-VXYRI6VA.cjs.map} +0 -0
  39. /package/dist/lib/node/{intent-resolver-PUM2BVGU.cjs.map → intent-resolver-TZFKPQOV.cjs.map} +0 -0
  40. /package/dist/lib/node/{react-surface-4G4PW5RU.cjs.map → react-surface-OHQIPHSN.cjs.map} +0 -0
  41. /package/dist/lib/node-esm/{chunk-GQA2DRUZ.mjs.map → chunk-IP66EHSW.mjs.map} +0 -0
  42. /package/dist/lib/node-esm/{intent-resolver-IR3YUZIG.mjs.map → intent-resolver-WBUS64KC.mjs.map} +0 -0
  43. /package/dist/lib/node-esm/{react-surface-AEMVDP4R.mjs.map → react-surface-XX4VFNRS.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2700,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2089,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":3051,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":586,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytes":17463,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":2748,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytes":4522,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytes":8761,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":3335,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":908,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":3926,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"../components/ChessComponent"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1365,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","kind":"dynamic-import","original":"./artifact-definition"},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1825,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":7895,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":790,"imports":[{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5065},"packages/plugins/plugin-chess/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-B72CIN6T.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GQA2DRUZ.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-NGQEQHJT.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-IR3YUZIG.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-AEMVDP4R.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","ChessComponent","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":273},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1623},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":325}},"bytes":2917},"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-GQA2DRUZ.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-NGQEQHJT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7597},"packages/plugins/plugin-chess/dist/lib/node-esm/artifact-definition-NGQEQHJT.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GQA2DRUZ.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytesInOutput":5487}},"bytes":5831},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-IR3YUZIG.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1375},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-IR3YUZIG.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GQA2DRUZ.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-S76WNBWN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6189},"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-S76WNBWN.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":811},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":3564},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-AEMVDP4R.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1851},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-AEMVDP4R.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-B72CIN6T.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GQA2DRUZ.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-B72CIN6T.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":404},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-B72CIN6T.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-S76WNBWN.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-GQA2DRUZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3769},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-GQA2DRUZ.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}}}
1
+ {"inputs":{"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2089,"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":18402,"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":3335,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":908,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":3926,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"../components/ChessComponent"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1365,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","kind":"dynamic-import","original":"./artifact-definition"},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1825,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":7895,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":790,"imports":[{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5065},"packages/plugins/plugin-chess/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-B72CIN6T.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-IP66EHSW.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-LHQK5BBZ.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-WBUS64KC.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-XX4VFNRS.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","ChessComponent","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":273},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1623},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":325}},"bytes":2917},"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-IP66EHSW.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-LHQK5BBZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8016},"packages/plugins/plugin-chess/dist/lib/node-esm/artifact-definition-LHQK5BBZ.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-IP66EHSW.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":5714}},"bytes":6066},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-WBUS64KC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1375},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-WBUS64KC.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-IP66EHSW.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-S76WNBWN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6189},"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-S76WNBWN.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":811},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":3564},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-XX4VFNRS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1851},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-XX4VFNRS.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-B72CIN6T.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-IP66EHSW.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-B72CIN6T.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":404},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-B72CIN6T.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-S76WNBWN.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-IP66EHSW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3769},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-IP66EHSW.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-GQA2DRUZ.mjs";
9
+ } from "./chunk-IP66EHSW.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-AEMVDP4R.mjs.map
43
+ //# sourceMappingURL=react-surface-XX4VFNRS.mjs.map
@@ -4,7 +4,7 @@ import {
4
4
  ChessType,
5
5
  MoveSchema,
6
6
  isObject
7
- } from "../chunk-GQA2DRUZ.mjs";
7
+ } from "../chunk-IP66EHSW.mjs";
8
8
  export {
9
9
  ChessAction,
10
10
  ChessType,
@@ -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;AAK7D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,QAAQ,CAAC,EAAE,uBAAuB,CAAC;KACpC;CACF;;AAED,wBAmFE"}
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,wBAwFE"}
@@ -1,4 +1,4 @@
1
- export declare const ArtifactDefinition: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("packages/experimental/artifact/dist/types/src").ArtifactDefinition> | import("@dxos/app-framework").AnyCapability[]>>;
1
+ export declare const ArtifactDefinition: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/artifact").ArtifactDefinition> | import("@dxos/app-framework").AnyCapability[]>>;
2
2
  export declare const IntentResolver: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.IntentResolver> | import("@dxos/app-framework").AnyCapability[]>>;
3
3
  export declare const ReactSurface: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.ReactSurface> | import("@dxos/app-framework").AnyCapability[]>>;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,mNAA8C,CAAC;AAC9E,eAAO,MAAM,cAAc,kMAA0C,CAAC;AACtE,eAAO,MAAM,YAAY,gMAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,oLAA8C,CAAC;AAC9E,eAAO,MAAM,cAAc,kMAA0C,CAAC;AACtE,eAAO,MAAM,YAAY,gMAAwC,CAAC"}
@@ -8,7 +8,7 @@ export declare const MoveSchema: S.mutable<S.SchemaClass<{
8
8
  readonly target?: string | undefined;
9
9
  readonly piece?: string | undefined;
10
10
  }, never>>;
11
- declare const ChessType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
11
+ declare const ChessType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
12
12
  name: S.optional<typeof S.String>;
13
13
  playerWhite: typeof S.String;
14
14
  playerBlack: typeof S.String;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-chess",
3
- "version": "0.7.5-staging.b81e783",
3
+ "version": "0.8.0",
4
4
  "description": "Chess for new plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -37,20 +37,20 @@
37
37
  "@preact/signals-core": "^1.6.0",
38
38
  "chess.js": "^1.0.0",
39
39
  "effect": "^3.12.3",
40
- "@dxos/app-framework": "0.7.5-staging.b81e783",
41
- "@dxos/assistant": "0.7.5-staging.b81e783",
42
- "@dxos/artifact": "0.7.5-staging.b81e783",
43
- "@dxos/async": "0.7.5-staging.b81e783",
44
- "@dxos/display-name": "0.7.5-staging.b81e783",
45
- "@dxos/echo-schema": "0.7.5-staging.b81e783",
46
- "@dxos/invariant": "0.7.5-staging.b81e783",
47
- "@dxos/live-object": "0.7.5-staging.b81e783",
48
- "@dxos/plugin-client": "0.7.5-staging.b81e783",
49
- "@dxos/plugin-graph": "0.7.5-staging.b81e783",
50
- "@dxos/plugin-space": "0.7.5-staging.b81e783",
51
- "@dxos/react-client": "0.7.5-staging.b81e783",
52
- "@dxos/react-ui-gameboard": "0.7.5-staging.b81e783",
53
- "@dxos/react-ui-stack": "0.7.5-staging.b81e783"
40
+ "@dxos/artifact": "0.8.0",
41
+ "@dxos/app-framework": "0.8.0",
42
+ "@dxos/async": "0.8.0",
43
+ "@dxos/display-name": "0.8.0",
44
+ "@dxos/echo-schema": "0.8.0",
45
+ "@dxos/live-object": "0.8.0",
46
+ "@dxos/assistant": "0.8.0",
47
+ "@dxos/invariant": "0.8.0",
48
+ "@dxos/plugin-client": "0.8.0",
49
+ "@dxos/plugin-space": "0.8.0",
50
+ "@dxos/react-client": "0.8.0",
51
+ "@dxos/plugin-graph": "0.8.0",
52
+ "@dxos/react-ui-gameboard": "0.8.0",
53
+ "@dxos/react-ui-stack": "0.8.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@phosphor-icons/react": "^2.1.5",
@@ -59,16 +59,16 @@
59
59
  "react": "~18.2.0",
60
60
  "react-dom": "~18.2.0",
61
61
  "vite": "5.4.7",
62
- "@dxos/react-ui-theme": "0.7.5-staging.b81e783",
63
- "@dxos/react-ui": "0.7.5-staging.b81e783",
64
- "@dxos/storybook-utils": "0.7.5-staging.b81e783"
62
+ "@dxos/react-ui": "0.8.0",
63
+ "@dxos/react-ui-theme": "0.8.0",
64
+ "@dxos/storybook-utils": "0.8.0"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "@phosphor-icons/react": "^2.1.5",
68
68
  "react": "~18.2.0",
69
69
  "react-dom": "~18.2.0",
70
- "@dxos/react-ui": "0.7.5-staging.b81e783",
71
- "@dxos/react-ui-theme": "0.7.5-staging.b81e783"
70
+ "@dxos/react-ui": "0.8.0",
71
+ "@dxos/react-ui-theme": "0.8.0"
72
72
  },
73
73
  "publishConfig": {
74
74
  "access": "public"
@@ -13,6 +13,7 @@ import { invariant } from '@dxos/invariant';
13
13
  import { SpaceAction } from '@dxos/plugin-space/types';
14
14
  import { Filter, type Space } from '@dxos/react-client/echo';
15
15
 
16
+ import { meta } from '../meta';
16
17
  import { ChessAction, ChessType } from '../types';
17
18
 
18
19
  // TODO(burdon): Factor out.
@@ -25,16 +26,18 @@ declare global {
25
26
 
26
27
  export default () => {
27
28
  const definition = defineArtifact({
28
- id: 'plugin-chess',
29
+ id: meta.id,
30
+ name: meta.name,
31
+ description: 'Provides a simple chess engine.',
29
32
  instructions: `
30
- Chess:
31
33
  - 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.
32
34
  `,
33
35
  schema: ChessType,
34
36
  tools: [
35
- defineTool({
36
- name: 'chess_new',
37
+ defineTool(meta.id, {
38
+ name: 'create',
37
39
  description: 'Create a new chess game. Returns the artifact definition for the game.',
40
+ caption: 'Creating chess game...',
38
41
  schema: S.Struct({
39
42
  fen: S.String.annotations({ description: 'The state of the chess game in the FEN format.' }),
40
43
  }),
@@ -53,9 +56,10 @@ export default () => {
53
56
  return ToolResult.Success(createArtifactElement(data.id));
54
57
  },
55
58
  }),
56
- defineTool({
57
- name: 'chess_query',
59
+ defineTool(meta.id, {
60
+ name: 'list',
58
61
  description: 'Query all active chess games.',
62
+ caption: 'Getting games...',
59
63
  schema: S.Struct({}),
60
64
  execute: async (_, { extensions }) => {
61
65
  invariant(extensions?.space, 'No space');
@@ -64,9 +68,10 @@ export default () => {
64
68
  return ToolResult.Success(games);
65
69
  },
66
70
  }),
67
- defineTool({
68
- name: 'chess_inspect',
71
+ defineTool(meta.id, {
72
+ name: 'inspect',
69
73
  description: 'Get the current state of the chess game.',
74
+ caption: 'Inspecting game...',
70
75
  schema: S.Struct({ id: ObjectId }),
71
76
  execute: async ({ id }, { extensions }) => {
72
77
  invariant(extensions?.space, 'No space');
@@ -76,9 +81,10 @@ export default () => {
76
81
  return ToolResult.Success(game.fen);
77
82
  },
78
83
  }),
79
- defineTool({
80
- name: 'chess_move',
84
+ defineTool(meta.id, {
85
+ name: 'move',
81
86
  description: 'Make a move in the chess game.',
87
+ caption: 'Making chess move...',
82
88
  schema: S.Struct({
83
89
  id: ObjectId,
84
90
  move: S.String.annotations({
@@ -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 { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement } from '@dxos/assistant';\nimport { isInstanceOf, ObjectId, S } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter, type Space } from '@dxos/react-client/echo';\n\nimport { ChessAction, ChessType } from '../types';\n\n// TODO(burdon): Factor out.\ndeclare global {\n interface ToolContextExtensions {\n space?: Space;\n dispatch?: PromiseIntentDispatcher;\n }\n}\n\nexport default () => {\n const definition = defineArtifact({\n id: 'plugin-chess',\n instructions: `\n Chess:\n - If the user's message relates to a chess game, you must return the chess game inside the artifact tag as a valid FEN string with no additional text.\n `,\n schema: ChessType,\n tools: [\n defineTool({\n name: 'chess_new',\n description: 'Create a new chess game. Returns the artifact definition for the game.',\n schema: S.Struct({\n fen: S.String.annotations({ description: 'The state of the chess game in the FEN format.' }),\n }),\n execute: async ({ fen }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n const intent = pipe(\n createIntent(ChessAction.Create, { fen }),\n chain(SpaceAction.AddObject, { target: extensions.space }),\n );\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create chess game');\n }\n\n return ToolResult.Success(createArtifactElement(data.id));\n },\n }),\n defineTool({\n name: 'chess_query',\n description: 'Query all active chess games.',\n schema: S.Struct({}),\n execute: async (_, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n invariant(games.length > 0, 'No chess games found');\n return ToolResult.Success(games);\n },\n }),\n defineTool({\n name: 'chess_inspect',\n description: 'Get the current state of the chess game.',\n schema: S.Struct({ id: ObjectId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n return ToolResult.Success(game.fen);\n },\n }),\n defineTool({\n name: 'chess_move',\n description: 'Make a move in the chess game.',\n schema: S.Struct({\n id: ObjectId,\n move: S.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n execute: async ({ id, move }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n const board = new Chess(game.fen);\n try {\n board.move(move);\n } catch (error: any) {\n return ToolResult.Error(error.message);\n }\n game.pgn = board.pgn();\n game.fen = board.fen();\n return ToolResult.Success(game.fen);\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
5
- "mappings": "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",
6
- "names": ["Chess", "pipe", "Capabilities", "chain", "contributes", "createIntent", "defineArtifact", "defineTool", "ToolResult", "createArtifactElement", "isInstanceOf", "ObjectId", "S", "invariant", "SpaceAction", "Filter", "definition", "defineArtifact", "id", "instructions", "schema", "ChessType", "tools", "defineTool", "name", "description", "S", "Struct", "fen", "String", "annotations", "execute", "extensions", "invariant", "space", "dispatch", "intent", "pipe", "createIntent", "ChessAction", "Create", "chain", "SpaceAction", "AddObject", "target", "data", "error", "ToolResult", "Error", "message", "Success", "createArtifactElement", "_", "objects", "games", "db", "query", "Filter", "run", "length", "ObjectId", "game", "find", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
7
- }
@@ -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 { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement } from '@dxos/assistant';\nimport { isInstanceOf, ObjectId, S } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter, type Space } from '@dxos/react-client/echo';\n\nimport { ChessAction, ChessType } from '../types';\n\n// TODO(burdon): Factor out.\ndeclare global {\n interface ToolContextExtensions {\n space?: Space;\n dispatch?: PromiseIntentDispatcher;\n }\n}\n\nexport default () => {\n const definition = defineArtifact({\n id: 'plugin-chess',\n instructions: `\n Chess:\n - If the user's message relates to a chess game, you must return the chess game inside the artifact tag as a valid FEN string with no additional text.\n `,\n schema: ChessType,\n tools: [\n defineTool({\n name: 'chess_new',\n description: 'Create a new chess game. Returns the artifact definition for the game.',\n schema: S.Struct({\n fen: S.String.annotations({ description: 'The state of the chess game in the FEN format.' }),\n }),\n execute: async ({ fen }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n const intent = pipe(\n createIntent(ChessAction.Create, { fen }),\n chain(SpaceAction.AddObject, { target: extensions.space }),\n );\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create chess game');\n }\n\n return ToolResult.Success(createArtifactElement(data.id));\n },\n }),\n defineTool({\n name: 'chess_query',\n description: 'Query all active chess games.',\n schema: S.Struct({}),\n execute: async (_, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n invariant(games.length > 0, 'No chess games found');\n return ToolResult.Success(games);\n },\n }),\n defineTool({\n name: 'chess_inspect',\n description: 'Get the current state of the chess game.',\n schema: S.Struct({ id: ObjectId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n return ToolResult.Success(game.fen);\n },\n }),\n defineTool({\n name: 'chess_move',\n description: 'Make a move in the chess game.',\n schema: S.Struct({\n id: ObjectId,\n move: S.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n execute: async ({ id, move }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n const board = new Chess(game.fen);\n try {\n board.move(move);\n } catch (error: any) {\n return ToolResult.Error(error.message);\n }\n game.pgn = board.pgn();\n game.fen = board.fen();\n return ToolResult.Success(game.fen);\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
5
- "mappings": "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",
6
- "names": ["definition", "defineArtifact", "id", "instructions", "schema", "ChessType", "tools", "defineTool", "name", "description", "S", "Struct", "fen", "String", "annotations", "execute", "extensions", "invariant", "space", "dispatch", "intent", "pipe", "createIntent", "ChessAction", "Create", "chain", "SpaceAction", "AddObject", "target", "data", "error", "ToolResult", "Error", "message", "Success", "createArtifactElement", "_", "objects", "games", "db", "query", "Filter", "run", "length", "ObjectId", "game", "find", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
7
- }
@@ -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 { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement } from '@dxos/assistant';\nimport { isInstanceOf, ObjectId, S } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter, type Space } from '@dxos/react-client/echo';\n\nimport { ChessAction, ChessType } from '../types';\n\n// TODO(burdon): Factor out.\ndeclare global {\n interface ToolContextExtensions {\n space?: Space;\n dispatch?: PromiseIntentDispatcher;\n }\n}\n\nexport default () => {\n const definition = defineArtifact({\n id: 'plugin-chess',\n instructions: `\n Chess:\n - If the user's message relates to a chess game, you must return the chess game inside the artifact tag as a valid FEN string with no additional text.\n `,\n schema: ChessType,\n tools: [\n defineTool({\n name: 'chess_new',\n description: 'Create a new chess game. Returns the artifact definition for the game.',\n schema: S.Struct({\n fen: S.String.annotations({ description: 'The state of the chess game in the FEN format.' }),\n }),\n execute: async ({ fen }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n const intent = pipe(\n createIntent(ChessAction.Create, { fen }),\n chain(SpaceAction.AddObject, { target: extensions.space }),\n );\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create chess game');\n }\n\n return ToolResult.Success(createArtifactElement(data.id));\n },\n }),\n defineTool({\n name: 'chess_query',\n description: 'Query all active chess games.',\n schema: S.Struct({}),\n execute: async (_, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n invariant(games.length > 0, 'No chess games found');\n return ToolResult.Success(games);\n },\n }),\n defineTool({\n name: 'chess_inspect',\n description: 'Get the current state of the chess game.',\n schema: S.Struct({ id: ObjectId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n return ToolResult.Success(game.fen);\n },\n }),\n defineTool({\n name: 'chess_move',\n description: 'Make a move in the chess game.',\n schema: S.Struct({\n id: ObjectId,\n move: S.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n execute: async ({ id, move }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n const board = new Chess(game.fen);\n try {\n board.move(move);\n } catch (error: any) {\n return ToolResult.Error(error.message);\n }\n game.pgn = board.pgn();\n game.fen = board.fen();\n return ToolResult.Success(game.fen);\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
5
- "mappings": "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",
6
- "names": ["Chess", "pipe", "Capabilities", "chain", "contributes", "createIntent", "defineArtifact", "defineTool", "ToolResult", "createArtifactElement", "isInstanceOf", "ObjectId", "S", "invariant", "SpaceAction", "Filter", "definition", "defineArtifact", "id", "instructions", "schema", "ChessType", "tools", "defineTool", "name", "description", "S", "Struct", "fen", "String", "annotations", "execute", "extensions", "invariant", "space", "dispatch", "intent", "pipe", "createIntent", "ChessAction", "Create", "chain", "SpaceAction", "AddObject", "target", "data", "error", "ToolResult", "Error", "message", "Success", "createArtifactElement", "_", "objects", "games", "db", "query", "Filter", "run", "length", "ObjectId", "game", "find", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
7
- }