@dxos/plugin-chess 0.8.2-main.f11618f → 0.8.2-staging.42af850

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 (83) hide show
  1. package/dist/lib/browser/ChessContainer-S72CLKGK.mjs +101 -0
  2. package/dist/lib/{node-esm/ChessContainer-MAXLUGKY.mjs.map → browser/ChessContainer-S72CLKGK.mjs.map} +1 -1
  3. package/dist/lib/browser/{artifact-definition-HTXW3AKR.mjs → artifact-definition-QYGM7HNY.mjs} +27 -30
  4. package/dist/lib/browser/artifact-definition-QYGM7HNY.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-5QBQW62M.mjs +8 -0
  6. package/dist/lib/browser/chunk-6XPI4FTK.mjs +61 -0
  7. package/dist/lib/browser/chunk-6XPI4FTK.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-EIRRN4WP.mjs → chunk-77TLTU3X.mjs} +23 -21
  9. package/dist/lib/browser/chunk-77TLTU3X.mjs.map +7 -0
  10. package/dist/lib/browser/index.mjs +6 -6
  11. package/dist/lib/browser/{intent-resolver-QECLUB7C.mjs → intent-resolver-FLV47FUV.mjs} +2 -2
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/browser/{react-surface-CMUAPVQA.mjs → react-surface-QW2WGAAJ.mjs} +4 -4
  14. package/dist/lib/browser/types/index.mjs +1 -1
  15. package/dist/lib/node/ChessContainer-EQUVXDJC.cjs +123 -0
  16. package/dist/lib/node/{ChessContainer-BZMTO4FZ.cjs.map → ChessContainer-EQUVXDJC.cjs.map} +1 -1
  17. package/dist/lib/node/{artifact-definition-XRVEXVXI.cjs → artifact-definition-FRBMG5FU.cjs} +39 -42
  18. package/dist/lib/node/artifact-definition-FRBMG5FU.cjs.map +7 -0
  19. package/dist/lib/node/{chunk-SVNVQAMR.cjs → chunk-33WBRZI6.cjs} +22 -20
  20. package/dist/lib/node/chunk-33WBRZI6.cjs.map +7 -0
  21. package/dist/lib/node/{chunk-CSRNUKOH.cjs → chunk-OTMP6HPY.cjs} +50 -31
  22. package/dist/lib/node/chunk-OTMP6HPY.cjs.map +7 -0
  23. package/dist/lib/node/{chunk-WKOWLRXP.cjs → chunk-R6JAL3RE.cjs} +5 -5
  24. package/dist/lib/node/index.cjs +22 -22
  25. package/dist/lib/node/{intent-resolver-JMO3PEBA.cjs → intent-resolver-AKAIXSZF.cjs} +7 -7
  26. package/dist/lib/node/meta.json +1 -1
  27. package/dist/lib/node/{react-surface-GSLVN4KN.cjs → react-surface-7G7NV4FY.cjs} +12 -12
  28. package/dist/lib/node/types/index.cjs +5 -5
  29. package/dist/lib/node/types/index.cjs.map +1 -1
  30. package/dist/lib/node-esm/ChessContainer-KSLGJHPW.mjs +102 -0
  31. package/dist/lib/{browser/ChessContainer-6JIE36JW.mjs.map → node-esm/ChessContainer-KSLGJHPW.mjs.map} +1 -1
  32. package/dist/lib/node-esm/{artifact-definition-VPB2TSLQ.mjs → artifact-definition-YKVCYZQ7.mjs} +27 -30
  33. package/dist/lib/node-esm/artifact-definition-YKVCYZQ7.mjs.map +7 -0
  34. package/dist/lib/node-esm/{chunk-YFCRXSGH.mjs → chunk-KHMDMPR2.mjs} +2 -2
  35. package/dist/lib/node-esm/chunk-MVMMCPHE.mjs +63 -0
  36. package/dist/lib/node-esm/chunk-MVMMCPHE.mjs.map +7 -0
  37. package/dist/lib/node-esm/{chunk-WDC3FJ53.mjs → chunk-WPCT7LRN.mjs} +23 -21
  38. package/dist/lib/node-esm/chunk-WPCT7LRN.mjs.map +7 -0
  39. package/dist/lib/node-esm/index.mjs +6 -6
  40. package/dist/lib/node-esm/{intent-resolver-BDI3HVPZ.mjs → intent-resolver-VK3EDUMM.mjs} +2 -2
  41. package/dist/lib/node-esm/meta.json +1 -1
  42. package/dist/lib/node-esm/{react-surface-L5YMO5FM.mjs → react-surface-Y54QUEUA.mjs} +4 -4
  43. package/dist/lib/node-esm/types/index.mjs +1 -1
  44. package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
  45. package/dist/types/src/components/ChessComponent.d.ts.map +1 -1
  46. package/dist/types/src/components/ChessContainer.d.ts.map +1 -1
  47. package/dist/types/src/components/PlayerSelector.d.ts.map +1 -1
  48. package/dist/types/src/translations.d.ts +2 -8
  49. package/dist/types/src/translations.d.ts.map +1 -1
  50. package/dist/types/src/types/schema.d.ts +15 -15
  51. package/dist/types/src/types/schema.d.ts.map +1 -1
  52. package/dist/types/src/types/types.d.ts +7 -7
  53. package/dist/types/src/types/types.d.ts.map +1 -1
  54. package/dist/types/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +26 -22
  56. package/src/capabilities/artifact-definition.ts +17 -16
  57. package/src/components/ChessComponent.tsx +6 -1
  58. package/src/types/schema.ts +15 -13
  59. package/src/types/types.ts +8 -6
  60. package/dist/lib/browser/ChessContainer-6JIE36JW.mjs +0 -84
  61. package/dist/lib/browser/artifact-definition-HTXW3AKR.mjs.map +0 -7
  62. package/dist/lib/browser/chunk-7SPN7XYA.mjs +0 -8
  63. package/dist/lib/browser/chunk-EIRRN4WP.mjs.map +0 -7
  64. package/dist/lib/browser/chunk-VRWXC5L2.mjs +0 -42
  65. package/dist/lib/browser/chunk-VRWXC5L2.mjs.map +0 -7
  66. package/dist/lib/node/ChessContainer-BZMTO4FZ.cjs +0 -106
  67. package/dist/lib/node/artifact-definition-XRVEXVXI.cjs.map +0 -7
  68. package/dist/lib/node/chunk-CSRNUKOH.cjs.map +0 -7
  69. package/dist/lib/node/chunk-SVNVQAMR.cjs.map +0 -7
  70. package/dist/lib/node-esm/ChessContainer-MAXLUGKY.mjs +0 -85
  71. package/dist/lib/node-esm/artifact-definition-VPB2TSLQ.mjs.map +0 -7
  72. package/dist/lib/node-esm/chunk-6SEDGO5G.mjs +0 -44
  73. package/dist/lib/node-esm/chunk-6SEDGO5G.mjs.map +0 -7
  74. package/dist/lib/node-esm/chunk-WDC3FJ53.mjs.map +0 -7
  75. /package/dist/lib/browser/{chunk-7SPN7XYA.mjs.map → chunk-5QBQW62M.mjs.map} +0 -0
  76. /package/dist/lib/browser/{intent-resolver-QECLUB7C.mjs.map → intent-resolver-FLV47FUV.mjs.map} +0 -0
  77. /package/dist/lib/browser/{react-surface-CMUAPVQA.mjs.map → react-surface-QW2WGAAJ.mjs.map} +0 -0
  78. /package/dist/lib/node/{chunk-WKOWLRXP.cjs.map → chunk-R6JAL3RE.cjs.map} +0 -0
  79. /package/dist/lib/node/{intent-resolver-JMO3PEBA.cjs.map → intent-resolver-AKAIXSZF.cjs.map} +0 -0
  80. /package/dist/lib/node/{react-surface-GSLVN4KN.cjs.map → react-surface-7G7NV4FY.cjs.map} +0 -0
  81. /package/dist/lib/node-esm/{chunk-YFCRXSGH.mjs.map → chunk-KHMDMPR2.mjs.map} +0 -0
  82. /package/dist/lib/node-esm/{intent-resolver-BDI3HVPZ.mjs.map → intent-resolver-VK3EDUMM.mjs.map} +0 -0
  83. /package/dist/lib/node-esm/{react-surface-L5YMO5FM.mjs.map → react-surface-Y54QUEUA.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2077,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2700,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":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/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4837},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-HTXW3AKR.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-QECLUB7C.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-CMUAPVQA.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","ChessComponent","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":273},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1500},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":282}},"bytes":2659},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs","kind":"import-statement"}],"exports":["ChessAction","ChessType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":194},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-HTXW3AKR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8373},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-HTXW3AKR.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.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":6200},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-QECLUB7C.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1366},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-QECLUB7C.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":507}},"bytes":747},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-6JIE36JW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6150},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-6JIE36JW.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":791},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":3452},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-CMUAPVQA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1850},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-CMUAPVQA.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytesInOutput":745}},"bytes":1107},"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-6JIE36JW.mjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":235},"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3741},"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.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":1958},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2436},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs":{"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"exports":["ChessComponent"],"inputs":{"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytesInOutput":990}},"bytes":1131}}}
1
+ {"inputs":{"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2033,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2921,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":3132,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":554,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytes":19066,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":2680,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytes":5508,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytes":9084,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":3431,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":872,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":3858,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"../components/ChessComponent"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1329,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","kind":"dynamic-import","original":"./artifact-definition"},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1642,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":7256,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":754,"imports":[{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4837},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-QYGM7HNY.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FLV47FUV.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-QW2WGAAJ.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","ChessComponent","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":273},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1500},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":282}},"bytes":2659},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"}],"exports":["ChessAction","ChessType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":194},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-QYGM7HNY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8482},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-QYGM7HNY.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytesInOutput":5964}},"bytes":6224},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FLV47FUV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1366},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FLV47FUV.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":507}},"bytes":747},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-S72CLKGK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6167},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-S72CLKGK.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":978},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2608}},"bytes":3948},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-QW2WGAAJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1850},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-QW2WGAAJ.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytesInOutput":745}},"bytes":1107},"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-S72CLKGK.mjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":235},"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3966},"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","ChessType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":606},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":675},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":2133},"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2588},"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"exports":["ChessComponent"],"inputs":{"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytesInOutput":1601}},"bytes":1742}}}
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  ChessContainer
3
- } from "./chunk-7SPN7XYA.mjs";
3
+ } from "./chunk-5QBQW62M.mjs";
4
4
  import {
5
5
  CHESS_PLUGIN,
6
6
  ChessType,
7
7
  isObject
8
- } from "./chunk-EIRRN4WP.mjs";
8
+ } from "./chunk-77TLTU3X.mjs";
9
9
  import {
10
10
  ChessComponent
11
- } from "./chunk-VRWXC5L2.mjs";
11
+ } from "./chunk-6XPI4FTK.mjs";
12
12
 
13
13
  // packages/plugins/plugin-chess/src/capabilities/react-surface.tsx
14
14
  import React from "react";
@@ -39,4 +39,4 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, [
39
39
  export {
40
40
  react_surface_default as default
41
41
  };
42
- //# sourceMappingURL=react-surface-CMUAPVQA.mjs.map
42
+ //# sourceMappingURL=react-surface-QW2WGAAJ.mjs.map
@@ -3,7 +3,7 @@ import {
3
3
  ChessType,
4
4
  MoveSchema,
5
5
  isObject
6
- } from "../chunk-EIRRN4WP.mjs";
6
+ } from "../chunk-77TLTU3X.mjs";
7
7
  export {
8
8
  ChessAction,
9
9
  ChessType,
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var ChessContainer_EQUVXDJC_exports = {};
30
+ __export(ChessContainer_EQUVXDJC_exports, {
31
+ default: () => ChessContainer_default
32
+ });
33
+ module.exports = __toCommonJS(ChessContainer_EQUVXDJC_exports);
34
+ var import_chunk_OTMP6HPY = require("./chunk-OTMP6HPY.cjs");
35
+ var import_tracking = require("@preact-signals/safe-react/tracking");
36
+ var import_react = __toESM(require("react"));
37
+ var import_echo = require("@dxos/react-client/echo");
38
+ var import_react_ui_stack = require("@dxos/react-ui-stack");
39
+ var import_tracking2 = require("@preact-signals/safe-react/tracking");
40
+ var import_react2 = require("@phosphor-icons/react");
41
+ var import_react3 = __toESM(require("react"));
42
+ var import_display_name = require("@dxos/display-name");
43
+ var import_echo2 = require("@dxos/react-client/echo");
44
+ var import_react_ui = require("@dxos/react-ui");
45
+ var import_react_ui_theme = require("@dxos/react-ui-theme");
46
+ var PlayerSelector = ({ space, game }) => {
47
+ var _effect = (0, import_tracking2.useSignals)();
48
+ try {
49
+ const members = (0, import_echo2.useMembers)(space.key);
50
+ return /* @__PURE__ */ import_react3.default.createElement("div", {
51
+ role: "none",
52
+ className: "grid grid-cols-2 gap-8"
53
+ }, /* @__PURE__ */ import_react3.default.createElement("div", {
54
+ role: "none",
55
+ className: "flex flex-row-reverse items-center gap-2"
56
+ }, /* @__PURE__ */ import_react3.default.createElement(PlayerSelect, {
57
+ side: "white",
58
+ value: game.playerWhite,
59
+ onValueChange: (player) => game.playerWhite = player,
60
+ members
61
+ })), /* @__PURE__ */ import_react3.default.createElement("div", {
62
+ role: "none",
63
+ className: "flex flex-row items-center gap-2"
64
+ }, /* @__PURE__ */ import_react3.default.createElement(PlayerSelect, {
65
+ side: "black",
66
+ value: game.playerBlack,
67
+ onValueChange: (player) => game.playerBlack = player,
68
+ members
69
+ })));
70
+ } finally {
71
+ _effect.f();
72
+ }
73
+ };
74
+ var PlayerSelect = ({ side, value, onValueChange, members }) => {
75
+ var _effect = (0, import_tracking2.useSignals)();
76
+ try {
77
+ const { themeMode } = (0, import_react_ui.useThemeContext)();
78
+ const iconFillMode = side === "black" && themeMode === "light" || side === "white" && themeMode === "dark" ? "fill" : void 0;
79
+ return /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Input.Root, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Input.Label, null, /* @__PURE__ */ import_react3.default.createElement(import_react2.CrownCross, {
80
+ className: (0, import_react_ui_theme.mx)((0, import_react_ui_theme.getSize)(6)),
81
+ weight: iconFillMode,
82
+ "aria-label": `Chess icon for side ${side}`
83
+ })), /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Root, {
84
+ value,
85
+ onValueChange
86
+ }, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.TriggerButton, {
87
+ placeholder: "Select player"
88
+ }), /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Portal, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Content, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Viewport, null, members.map((member) => {
89
+ const memberKey = member.identity.identityKey.toHex();
90
+ const displayName = member.identity?.profile?.displayName || (0, import_display_name.generateName)(memberKey);
91
+ return /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Select.Option, {
92
+ key: memberKey,
93
+ value: memberKey
94
+ }, displayName);
95
+ }))))));
96
+ } finally {
97
+ _effect.f();
98
+ }
99
+ };
100
+ var ChessContainer = ({ game }) => {
101
+ var _effect = (0, import_tracking.useSignals)();
102
+ try {
103
+ const space = (0, import_echo.getSpace)(game);
104
+ if (!space) {
105
+ return null;
106
+ }
107
+ return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, null, /* @__PURE__ */ import_react.default.createElement("div", {
108
+ role: "none",
109
+ className: "grid grid-rows-[60px_1fr_60px] grow overflow-hidden"
110
+ }, /* @__PURE__ */ import_react.default.createElement("div", null), /* @__PURE__ */ import_react.default.createElement("div", {
111
+ className: "flex m-4 overflow-hidden"
112
+ }, /* @__PURE__ */ import_react.default.createElement(import_chunk_OTMP6HPY.ChessComponent, {
113
+ game
114
+ })), /* @__PURE__ */ import_react.default.createElement(PlayerSelector, {
115
+ space,
116
+ game
117
+ })));
118
+ } finally {
119
+ _effect.f();
120
+ }
121
+ };
122
+ var ChessContainer_default = ChessContainer;
123
+ //# sourceMappingURL=ChessContainer-EQUVXDJC.cjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/ChessContainer.tsx", "../../../src/components/PlayerSelector.tsx"],
4
4
  "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { ChessComponent } from './ChessComponent';\nimport { PlayerSelector } from './PlayerSelector';\nimport { type ChessType } from '../types';\n\nconst ChessContainer = ({ game }: { game: ChessType; role?: string }) => {\n const space = getSpace(game);\n if (!space) {\n return null;\n }\n\n return (\n <StackItem.Content>\n <div role='none' className='grid grid-rows-[60px_1fr_60px] grow overflow-hidden'>\n <div />\n\n <div className='flex m-4 overflow-hidden'>\n <ChessComponent game={game} />\n </div>\n\n <PlayerSelector space={space} game={game} />\n </div>\n </StackItem.Content>\n );\n};\n\nexport default ChessContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { CrownCross } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { generateName } from '@dxos/display-name';\nimport { useMembers, type Space, type SpaceMember } from '@dxos/react-client/echo';\nimport { Input, Select, useThemeContext } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\n\nimport { type ChessType } from '../types';\n\nexport const PlayerSelector = ({ space, game }: { space: Space; game: ChessType }) => {\n const members = useMembers(space.key);\n\n return (\n <div role='none' className='grid grid-cols-2 gap-8'>\n <div role='none' className='flex flex-row-reverse items-center gap-2'>\n <PlayerSelect\n side='white'\n value={game.playerWhite}\n onValueChange={(player) => (game.playerWhite = player)}\n members={members}\n />\n </div>\n <div role='none' className='flex flex-row items-center gap-2'>\n <PlayerSelect\n side='black'\n value={game.playerBlack}\n onValueChange={(player) => (game.playerBlack = player)}\n members={members}\n />\n </div>\n </div>\n );\n};\n\nconst PlayerSelect = ({\n side,\n value,\n onValueChange,\n members,\n}: {\n side: 'white' | 'black';\n value: string | undefined;\n onValueChange: (player: string) => void;\n members: SpaceMember[];\n}) => {\n const { themeMode } = useThemeContext();\n const iconFillMode =\n (side === 'black' && themeMode === 'light') || (side === 'white' && themeMode === 'dark') ? 'fill' : undefined;\n\n return (\n <Input.Root>\n <Input.Label>\n <CrownCross className={mx(getSize(6))} weight={iconFillMode} aria-label={`Chess icon for side ${side}`} />\n </Input.Label>\n <Select.Root value={value} onValueChange={onValueChange}>\n <Select.TriggerButton placeholder={'Select player'} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {members.map((member) => {\n const memberKey = member.identity.identityKey.toHex();\n const displayName = member.identity?.profile?.displayName || generateName(memberKey);\n return (\n <Select.Option key={memberKey} value={memberKey}>\n {displayName}\n </Select.Option>\n );\n })}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </Input.Root>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,kBAAyB;AACzB,4BAA0B;ACH1B,IAAAA,gBAA2B;AAC3B,IAAAA,gBAAkB;AAElB,0BAA6B;AAC7B,IAAAC,eAAyD;AACzD,sBAA+C;AAC/C,4BAA4B;AAIrB,IAAMC,iBAAiB,CAAC,EAAEC,OAAOC,KAAI,MAAqC;AAC/E,QAAMC,cAAUC,yBAAWH,MAAMI,GAAG;AAEpC,SACE,8BAAAC,QAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,8BAAAH,QAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,8BAAAH,QAAA,cAACI,cAAAA;I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;SAGlBI,6BAAAA,QAAA,cAACN,gBAAAA;MAAeC;MAAcC;;;;;AAItC;AAEA,IAAA,yBAAe2C;",
6
6
  "names": ["import_react", "import_echo", "PlayerSelector", "space", "game", "members", "useMembers", "key", "React", "div", "role", "className", "PlayerSelect", "side", "value", "playerWhite", "onValueChange", "player", "playerBlack", "themeMode", "useThemeContext", "iconFillMode", "undefined", "Input", "Root", "Label", "CrownCross", "mx", "getSize", "weight", "aria-label", "Select", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "map", "member", "memberKey", "identity", "identityKey", "toHex", "displayName", "profile", "generateName", "Option", "ChessContainer", "getSpace", "StackItem", "ChessComponent"]
7
7
  }
@@ -16,14 +16,15 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var artifact_definition_XRVEXVXI_exports = {};
20
- __export(artifact_definition_XRVEXVXI_exports, {
19
+ var artifact_definition_FRBMG5FU_exports = {};
20
+ __export(artifact_definition_FRBMG5FU_exports, {
21
21
  default: () => artifact_definition_default
22
22
  });
23
- module.exports = __toCommonJS(artifact_definition_XRVEXVXI_exports);
24
- var import_chunk_SVNVQAMR = require("./chunk-SVNVQAMR.cjs");
23
+ module.exports = __toCommonJS(artifact_definition_FRBMG5FU_exports);
24
+ var import_chunk_33WBRZI6 = require("./chunk-33WBRZI6.cjs");
25
25
  var import_chess = require("chess.js");
26
26
  var import_effect = require("effect");
27
+ var import_ai = require("@dxos/ai");
27
28
  var import_app_framework = require("@dxos/app-framework");
28
29
  var import_artifact = require("@dxos/artifact");
29
30
  var import_assistant = require("@dxos/assistant");
@@ -34,28 +35,28 @@ var import_echo = require("@dxos/react-client/echo");
34
35
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts";
35
36
  var artifact_definition_default = () => {
36
37
  const definition = (0, import_artifact.defineArtifact)({
37
- id: `artifact:${import_chunk_SVNVQAMR.meta.id}`,
38
- name: import_chunk_SVNVQAMR.meta.name,
38
+ id: `artifact:${import_chunk_33WBRZI6.meta.id}`,
39
+ name: import_chunk_33WBRZI6.meta.name,
39
40
  description: "Provides a simple chess engine.",
40
41
  instructions: `
41
42
  - If the user's message relates to a chess game, you must return the chess game inside the artifact tag as a valid FEN string with no additional text.
42
43
  - Always inspect the chess game at the start of every prompt realting to a chess game, as it might have changed since the interaction.
43
44
  `,
44
- schema: import_chunk_SVNVQAMR.ChessType,
45
+ schema: import_chunk_33WBRZI6.ChessType,
45
46
  tools: [
46
- (0, import_artifact.defineTool)(import_chunk_SVNVQAMR.meta.id, {
47
+ (0, import_ai.createTool)(import_chunk_33WBRZI6.meta.id, {
47
48
  name: "create",
48
49
  description: "Create a new chess game. Returns the artifact definition for the game.",
49
50
  caption: "Creating chess game...",
50
- schema: import_echo_schema.S.Struct({
51
- fen: import_echo_schema.S.String.annotations({
51
+ schema: import_effect.Schema.Struct({
52
+ fen: import_effect.Schema.String.annotations({
52
53
  description: "The state of the chess game in the FEN format."
53
54
  })
54
55
  }),
55
56
  execute: async ({ fen }, { extensions }) => {
56
57
  (0, import_invariant.invariant)(extensions?.space, "No space", {
57
58
  F: __dxlog_file,
58
- L: 46,
59
+ L: 47,
59
60
  S: void 0,
60
61
  A: [
61
62
  "extensions?.space",
@@ -64,94 +65,92 @@ var artifact_definition_default = () => {
64
65
  });
65
66
  (0, import_invariant.invariant)(extensions?.dispatch, "No intent dispatcher", {
66
67
  F: __dxlog_file,
67
- L: 47,
68
+ L: 48,
68
69
  S: void 0,
69
70
  A: [
70
71
  "extensions?.dispatch",
71
72
  "'No intent dispatcher'"
72
73
  ]
73
74
  });
74
- const intent = (0, import_effect.pipe)((0, import_app_framework.createIntent)(import_chunk_SVNVQAMR.ChessAction.Create, {
75
+ const intent = (0, import_effect.pipe)((0, import_app_framework.createIntent)(import_chunk_33WBRZI6.ChessAction.Create, {
75
76
  fen
76
77
  }), (0, import_app_framework.chain)(import_types.SpaceAction.AddObject, {
77
78
  target: extensions.space
78
79
  }));
79
80
  const { data, error } = await extensions.dispatch(intent);
80
81
  if (!data || error) {
81
- return import_artifact.ToolResult.Error(error?.message ?? "Failed to create chess game");
82
+ return import_ai.ToolResult.Error(error?.message ?? "Failed to create chess game");
82
83
  }
83
- return import_artifact.ToolResult.Success((0, import_assistant.createArtifactElement)(data.id), [
84
+ return import_ai.ToolResult.Success((0, import_assistant.createArtifactElement)(data.id), [
84
85
  import_assistant.VersionPin.createBlock(import_assistant.VersionPin.fromObject(data.object))
85
86
  ]);
86
87
  }
87
88
  }),
88
- (0, import_artifact.defineTool)(import_chunk_SVNVQAMR.meta.id, {
89
+ (0, import_ai.createTool)(import_chunk_33WBRZI6.meta.id, {
89
90
  name: "list",
90
91
  description: "Query all active chess games.",
91
92
  caption: "Getting games...",
92
- schema: import_echo_schema.S.Struct({}),
93
+ schema: import_effect.Schema.Struct({}),
93
94
  execute: async (_, { extensions }) => {
94
95
  (0, import_invariant.invariant)(extensions?.space, "No space", {
95
96
  F: __dxlog_file,
96
- L: 68,
97
+ L: 69,
97
98
  S: void 0,
98
99
  A: [
99
100
  "extensions?.space",
100
101
  "'No space'"
101
102
  ]
102
103
  });
103
- const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(import_chunk_SVNVQAMR.ChessType)).run();
104
+ const { objects: games } = await extensions.space.db.query(import_echo.Filter.type(import_chunk_33WBRZI6.ChessType)).run();
104
105
  (0, import_invariant.invariant)(games.length > 0, "No chess games found", {
105
106
  F: __dxlog_file,
106
- L: 70,
107
+ L: 71,
107
108
  S: void 0,
108
109
  A: [
109
110
  "games.length > 0",
110
111
  "'No chess games found'"
111
112
  ]
112
113
  });
113
- return import_artifact.ToolResult.Success(games);
114
+ return import_ai.ToolResult.Success(games);
114
115
  }
115
116
  }),
116
- (0, import_artifact.defineTool)(import_chunk_SVNVQAMR.meta.id, {
117
+ (0, import_ai.createTool)(import_chunk_33WBRZI6.meta.id, {
117
118
  name: "inspect",
118
119
  description: "Get the current state of the chess game.",
119
120
  caption: "Inspecting game...",
120
- schema: import_echo_schema.S.Struct({
121
+ schema: import_effect.Schema.Struct({
121
122
  id: import_artifact.ArtifactId
122
123
  }),
123
124
  execute: async ({ id }, { extensions }) => {
124
125
  (0, import_invariant.invariant)(extensions?.space, "No space", {
125
126
  F: __dxlog_file,
126
- L: 80,
127
+ L: 81,
127
128
  S: void 0,
128
129
  A: [
129
130
  "extensions?.space",
130
131
  "'No space'"
131
132
  ]
132
133
  });
133
- const game = await extensions.space.db.query({
134
- id: import_artifact.ArtifactId.toDXN(id, extensions.space.id).toString()
135
- }).first();
136
- (0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_SVNVQAMR.ChessType, game), void 0, {
134
+ const game = await extensions.space.db.query(import_echo.Filter.ids(import_artifact.ArtifactId.toDXN(id, extensions.space.id).toString())).first();
135
+ (0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_33WBRZI6.ChessType, game), void 0, {
137
136
  F: __dxlog_file,
138
- L: 84,
137
+ L: 85,
139
138
  S: void 0,
140
139
  A: [
141
140
  "isInstanceOf(ChessType, game)",
142
141
  ""
143
142
  ]
144
143
  });
145
- return import_artifact.ToolResult.Success(game.fen);
144
+ return import_ai.ToolResult.Success(game.fen);
146
145
  }
147
146
  }),
148
- (0, import_artifact.defineTool)(import_chunk_SVNVQAMR.meta.id, {
147
+ (0, import_ai.createTool)(import_chunk_33WBRZI6.meta.id, {
149
148
  name: "move",
150
149
  description: "Make a move in the chess game.",
151
150
  caption: "Making chess move...",
152
- schema: import_echo_schema.S.Struct({
151
+ schema: import_effect.Schema.Struct({
153
152
  id: import_artifact.ArtifactId,
154
- move: import_echo_schema.S.String.annotations({
153
+ move: import_effect.Schema.String.annotations({
155
154
  description: "The move to make in the chess game.",
156
155
  examples: [
157
156
  "e4",
@@ -162,19 +161,17 @@ var artifact_definition_default = () => {
162
161
  execute: async ({ id, move }, { extensions }) => {
163
162
  (0, import_invariant.invariant)(extensions?.space, "No space", {
164
163
  F: __dxlog_file,
165
- L: 101,
164
+ L: 102,
166
165
  S: void 0,
167
166
  A: [
168
167
  "extensions?.space",
169
168
  "'No space'"
170
169
  ]
171
170
  });
172
- const game = await extensions.space.db.query({
173
- id: import_artifact.ArtifactId.toDXN(id, extensions.space.id).toString()
174
- }).first();
175
- (0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_SVNVQAMR.ChessType, game), void 0, {
171
+ const game = await extensions.space.db.query(import_echo.Filter.ids(import_artifact.ArtifactId.toDXN(id, extensions.space.id).toString())).first();
172
+ (0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_33WBRZI6.ChessType, game), void 0, {
176
173
  F: __dxlog_file,
177
- L: 105,
174
+ L: 106,
178
175
  S: void 0,
179
176
  A: [
180
177
  "isInstanceOf(ChessType, game)",
@@ -185,15 +182,15 @@ var artifact_definition_default = () => {
185
182
  try {
186
183
  board.move(move);
187
184
  } catch (error) {
188
- return import_artifact.ToolResult.Error(error.message);
185
+ return import_ai.ToolResult.Error(error.message);
189
186
  }
190
187
  game.pgn = board.pgn();
191
188
  game.fen = board.fen();
192
- return import_artifact.ToolResult.Success(game.fen);
189
+ return import_ai.ToolResult.Success(game.fen);
193
190
  }
194
191
  })
195
192
  ]
196
193
  });
197
194
  return (0, import_app_framework.contributes)(import_app_framework.Capabilities.ArtifactDefinition, definition);
198
195
  };
199
- //# sourceMappingURL=artifact-definition-XRVEXVXI.cjs.map
196
+ //# sourceMappingURL=artifact-definition-FRBMG5FU.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/artifact-definition.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess } from 'chess.js';\nimport { pipe, Schema } from 'effect';\n\nimport { createTool, ToolResult } from '@dxos/ai';\nimport { Capabilities, chain, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { ArtifactId, defineArtifact } from '@dxos/artifact';\nimport { createArtifactElement, VersionPin } from '@dxos/assistant';\nimport { isInstanceOf } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter, type Space } from '@dxos/react-client/echo';\n\nimport { meta } from '../meta';\nimport { ChessAction, ChessType } from '../types';\n\n// TODO(burdon): Factor out.\ndeclare global {\n interface ToolContextExtensions {\n space?: Space;\n dispatch?: PromiseIntentDispatcher;\n }\n}\n\nexport default () => {\n const definition = defineArtifact({\n id: `artifact:${meta.id}`,\n name: meta.name,\n description: 'Provides a simple chess engine.',\n instructions: `\n - If the user's message relates to a chess game, you must return the chess game inside the artifact tag as a valid FEN string with no additional text.\n - Always inspect the chess game at the start of every prompt realting to a chess game, as it might have changed since the interaction.\n `,\n schema: ChessType,\n tools: [\n createTool(meta.id, {\n name: 'create',\n description: 'Create a new chess game. Returns the artifact definition for the game.',\n caption: 'Creating chess game...',\n schema: Schema.Struct({\n fen: Schema.String.annotations({ description: 'The state of the chess game in the FEN format.' }),\n }),\n execute: async ({ fen }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n const intent = pipe(\n createIntent(ChessAction.Create, { fen }),\n chain(SpaceAction.AddObject, { target: extensions.space }),\n );\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create chess game');\n }\n\n return ToolResult.Success(createArtifactElement(data.id), [\n VersionPin.createBlock(VersionPin.fromObject(data.object)),\n ]);\n },\n }),\n createTool(meta.id, {\n name: 'list',\n description: 'Query all active chess games.',\n caption: 'Getting games...',\n schema: Schema.Struct({}),\n execute: async (_, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.type(ChessType)).run();\n invariant(games.length > 0, 'No chess games found');\n return ToolResult.Success(games);\n },\n }),\n createTool(meta.id, {\n name: 'inspect',\n description: 'Get the current state of the chess game.',\n caption: 'Inspecting game...',\n schema: Schema.Struct({ id: ArtifactId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const game = await extensions.space.db\n .query(Filter.ids(ArtifactId.toDXN(id, extensions.space.id).toString()))\n .first();\n invariant(isInstanceOf(ChessType, game));\n\n return ToolResult.Success(game.fen);\n },\n }),\n createTool(meta.id, {\n name: 'move',\n description: 'Make a move in the chess game.',\n caption: 'Making chess move...',\n schema: Schema.Struct({\n id: ArtifactId,\n move: Schema.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n execute: async ({ id, move }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const game = await extensions.space.db\n .query(Filter.ids(ArtifactId.toDXN(id, extensions.space.id).toString()))\n .first();\n invariant(isInstanceOf(ChessType, game));\n\n const board = new Chess(game.fen);\n try {\n board.move(move);\n } catch (error: any) {\n return ToolResult.Error(error.message);\n }\n game.pgn = board.pgn();\n game.fen = board.fen();\n return ToolResult.Success(game.fen);\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAsB;AACtB,oBAA6B;AAE7B,gBAAuC;AACvC,2BAA6F;AAC7F,sBAA2C;AAC3C,uBAAkD;AAClD,yBAA6B;AAC7B,uBAA0B;AAC1B,mBAA4B;AAC5B,kBAAmC;;AAanC,IAAA,8BAAe,MAAA;AACb,QAAMA,iBAAaC,gCAAe;IAChCC,IAAI,YAAYC,2BAAKD,EAAE;IACvBE,MAAMD,2BAAKC;IACXC,aAAa;IACbC,cAAc;;;;IAIdC,QAAQC;IACRC,OAAO;UACLC,sBAAWP,2BAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,qBAAOC,OAAO;UACpBC,KAAKF,qBAAOG,OAAOC,YAA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EA,aAAOiD,kCAAYC,kCAAaC,oBAAoBjE,UAAAA;AACtD;",
6
+ "names": ["definition", "defineArtifact", "id", "meta", "name", "description", "instructions", "schema", "ChessType", "tools", "createTool", "caption", "Schema", "Struct", "fen", "String", "annotations", "execute", "extensions", "invariant", "space", "dispatch", "intent", "pipe", "createIntent", "ChessAction", "Create", "chain", "SpaceAction", "AddObject", "target", "data", "error", "ToolResult", "Error", "message", "Success", "createArtifactElement", "VersionPin", "createBlock", "fromObject", "object", "_", "objects", "games", "db", "query", "Filter", "type", "run", "length", "ArtifactId", "game", "ids", "toDXN", "toString", "first", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
7
+ }