@dxos/plugin-chess 0.8.3-staging.0fa589b → 0.8.4-main.3f58842

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 (104) hide show
  1. package/dist/lib/browser/{ChessContainer-S72CLKGK.mjs → ChessContainer-SC4ZV6XZ.mjs} +53 -25
  2. package/dist/lib/browser/ChessContainer-SC4ZV6XZ.mjs.map +7 -0
  3. package/dist/lib/browser/{artifact-definition-NLIDMZ42.mjs → artifact-definition-A2FSM255.mjs} +6 -6
  4. package/dist/lib/browser/artifact-definition-A2FSM255.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-KA3H3Z76.mjs → chunk-A3WEUKPK.mjs} +6 -10
  6. package/dist/lib/browser/chunk-A3WEUKPK.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-KDADGLPC.mjs +8 -0
  8. package/dist/lib/browser/{chunk-5QBQW62M.mjs.map → chunk-KDADGLPC.mjs.map} +1 -1
  9. package/dist/lib/browser/{chunk-6XPI4FTK.mjs → chunk-ZXH3N4NA.mjs} +15 -10
  10. package/dist/lib/browser/chunk-ZXH3N4NA.mjs.map +7 -0
  11. package/dist/lib/browser/index.mjs +19 -18
  12. package/dist/lib/browser/index.mjs.map +3 -3
  13. package/dist/lib/browser/{intent-resolver-65W3KVTW.mjs → intent-resolver-KQYYX44R.mjs} +3 -3
  14. package/dist/lib/browser/meta.json +1 -1
  15. package/dist/lib/browser/react-surface-PLUCWIYP.mjs +36 -0
  16. package/dist/lib/browser/react-surface-PLUCWIYP.mjs.map +7 -0
  17. package/dist/lib/browser/types/index.mjs +3 -5
  18. package/dist/lib/node-esm/{ChessContainer-KSLGJHPW.mjs → ChessContainer-7GLY5KLY.mjs} +53 -25
  19. package/dist/lib/node-esm/ChessContainer-7GLY5KLY.mjs.map +7 -0
  20. package/dist/lib/node-esm/{artifact-definition-CZGGG56Q.mjs → artifact-definition-2H7OUBZO.mjs} +6 -6
  21. package/dist/lib/node-esm/artifact-definition-2H7OUBZO.mjs.map +7 -0
  22. package/dist/lib/node-esm/{chunk-MVMMCPHE.mjs → chunk-27D3JA3K.mjs} +15 -10
  23. package/dist/lib/node-esm/chunk-27D3JA3K.mjs.map +7 -0
  24. package/dist/lib/node-esm/{chunk-4V3WNUDH.mjs → chunk-IS3Y25PL.mjs} +6 -10
  25. package/dist/lib/node-esm/chunk-IS3Y25PL.mjs.map +7 -0
  26. package/dist/lib/node-esm/chunk-QFINI7CC.mjs +10 -0
  27. package/dist/lib/node-esm/{chunk-KHMDMPR2.mjs.map → chunk-QFINI7CC.mjs.map} +1 -1
  28. package/dist/lib/node-esm/index.mjs +19 -18
  29. package/dist/lib/node-esm/index.mjs.map +3 -3
  30. package/dist/lib/node-esm/{intent-resolver-6TYVNVEU.mjs → intent-resolver-GXK2JROQ.mjs} +3 -3
  31. package/dist/lib/node-esm/meta.json +1 -1
  32. package/dist/lib/node-esm/{react-surface-LRFYFOFF.mjs → react-surface-NGLNIWN3.mjs} +14 -20
  33. package/dist/lib/node-esm/react-surface-NGLNIWN3.mjs.map +7 -0
  34. package/dist/lib/node-esm/types/index.mjs +3 -5
  35. package/dist/types/src/capabilities/artifact-definition.d.ts +1 -1
  36. package/dist/types/src/capabilities/index.d.ts +1 -1
  37. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  39. package/dist/types/src/components/Chess.d.ts +14 -0
  40. package/dist/types/src/components/Chess.d.ts.map +1 -0
  41. package/dist/types/src/components/ChessContainer.d.ts +1 -1
  42. package/dist/types/src/components/ChessContainer.d.ts.map +1 -1
  43. package/dist/types/src/components/ChessContainer.stories.d.ts +23 -0
  44. package/dist/types/src/components/ChessContainer.stories.d.ts.map +1 -0
  45. package/dist/types/src/components/ChessPanel.d.ts.map +1 -1
  46. package/dist/types/src/components/Chessboard.stories.d.ts +1 -1
  47. package/dist/types/src/components/Chessboard.stories.d.ts.map +1 -1
  48. package/dist/types/src/components/PlayerSelector.d.ts.map +1 -1
  49. package/dist/types/src/components/index.d.ts +2 -2
  50. package/dist/types/src/components/index.d.ts.map +1 -1
  51. package/dist/types/src/translations.d.ts +16 -23
  52. package/dist/types/src/translations.d.ts.map +1 -1
  53. package/dist/types/src/types/types.d.ts +2 -10
  54. package/dist/types/src/types/types.d.ts.map +1 -1
  55. package/dist/types/tsconfig.tsbuildinfo +1 -1
  56. package/package.json +25 -26
  57. package/src/ChessPlugin.tsx +1 -1
  58. package/src/capabilities/artifact-definition.ts +2 -2
  59. package/src/capabilities/react-surface.tsx +6 -12
  60. package/src/components/{ChessComponent.tsx → Chess.tsx} +15 -9
  61. package/src/components/ChessContainer.stories.tsx +110 -0
  62. package/src/components/ChessContainer.tsx +49 -13
  63. package/src/components/ChessPanel.tsx +7 -7
  64. package/src/components/Chessboard.stories.tsx +7 -5
  65. package/src/components/PlayerSelector.tsx +6 -4
  66. package/src/components/index.ts +1 -1
  67. package/src/translations.ts +8 -6
  68. package/src/types/types.ts +2 -8
  69. package/dist/lib/browser/ChessContainer-S72CLKGK.mjs.map +0 -7
  70. package/dist/lib/browser/artifact-definition-NLIDMZ42.mjs.map +0 -7
  71. package/dist/lib/browser/chunk-5QBQW62M.mjs +0 -8
  72. package/dist/lib/browser/chunk-6XPI4FTK.mjs.map +0 -7
  73. package/dist/lib/browser/chunk-KA3H3Z76.mjs.map +0 -7
  74. package/dist/lib/browser/react-surface-GYE5E74A.mjs +0 -42
  75. package/dist/lib/browser/react-surface-GYE5E74A.mjs.map +0 -7
  76. package/dist/lib/node/ChessContainer-EQUVXDJC.cjs +0 -123
  77. package/dist/lib/node/ChessContainer-EQUVXDJC.cjs.map +0 -7
  78. package/dist/lib/node/artifact-definition-VHJ54X2P.cjs +0 -196
  79. package/dist/lib/node/artifact-definition-VHJ54X2P.cjs.map +0 -7
  80. package/dist/lib/node/chunk-OTMP6HPY.cjs +0 -93
  81. package/dist/lib/node/chunk-OTMP6HPY.cjs.map +0 -7
  82. package/dist/lib/node/chunk-R6JAL3RE.cjs +0 -40
  83. package/dist/lib/node/chunk-R6JAL3RE.cjs.map +0 -7
  84. package/dist/lib/node/chunk-THN2FKB3.cjs +0 -86
  85. package/dist/lib/node/chunk-THN2FKB3.cjs.map +0 -7
  86. package/dist/lib/node/index.cjs +0 -121
  87. package/dist/lib/node/index.cjs.map +0 -7
  88. package/dist/lib/node/intent-resolver-BQGAQM27.cjs +0 -43
  89. package/dist/lib/node/intent-resolver-BQGAQM27.cjs.map +0 -7
  90. package/dist/lib/node/meta.json +0 -1
  91. package/dist/lib/node/react-surface-TZDWBTEY.cjs +0 -62
  92. package/dist/lib/node/react-surface-TZDWBTEY.cjs.map +0 -7
  93. package/dist/lib/node/types/index.cjs +0 -35
  94. package/dist/lib/node/types/index.cjs.map +0 -7
  95. package/dist/lib/node-esm/ChessContainer-KSLGJHPW.mjs.map +0 -7
  96. package/dist/lib/node-esm/artifact-definition-CZGGG56Q.mjs.map +0 -7
  97. package/dist/lib/node-esm/chunk-4V3WNUDH.mjs.map +0 -7
  98. package/dist/lib/node-esm/chunk-KHMDMPR2.mjs +0 -10
  99. package/dist/lib/node-esm/chunk-MVMMCPHE.mjs.map +0 -7
  100. package/dist/lib/node-esm/react-surface-LRFYFOFF.mjs.map +0 -7
  101. package/dist/types/src/components/ChessComponent.d.ts +0 -6
  102. package/dist/types/src/components/ChessComponent.d.ts.map +0 -1
  103. /package/dist/lib/browser/{intent-resolver-65W3KVTW.mjs.map → intent-resolver-KQYYX44R.mjs.map} +0 -0
  104. /package/dist/lib/node-esm/{intent-resolver-6TYVNVEU.mjs.map → intent-resolver-GXK2JROQ.mjs.map} +0 -0
@@ -1,86 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_THN2FKB3_exports = {};
20
- __export(chunk_THN2FKB3_exports, {
21
- CHESS_PLUGIN: () => CHESS_PLUGIN,
22
- ChessAction: () => ChessAction,
23
- ChessType: () => ChessType,
24
- MoveSchema: () => MoveSchema,
25
- isObject: () => isObject,
26
- meta: () => meta
27
- });
28
- module.exports = __toCommonJS(chunk_THN2FKB3_exports);
29
- var import_effect = require("effect");
30
- var import_echo = require("@dxos/echo");
31
- var import_effect2 = require("effect");
32
- var import_echo2 = require("@dxos/echo");
33
- var MoveSchema = import_effect.Schema.mutable(import_effect.Schema.partial(import_effect.Schema.Struct({
34
- source: import_effect.Schema.String,
35
- target: import_effect.Schema.String,
36
- piece: import_effect.Schema.String
37
- })));
38
- var ChessType = import_effect.Schema.Struct({
39
- name: import_effect.Schema.optional(import_effect.Schema.String),
40
- playerWhite: import_effect.Schema.String,
41
- playerBlack: import_effect.Schema.String,
42
- moves: import_effect.Schema.mutable(import_effect.Schema.Array(import_effect.Schema.String)),
43
- // TODO(wittjosiah): Remove. Redundant with moves.
44
- pgn: import_effect.Schema.String,
45
- fen: import_effect.Schema.String
46
- }).pipe(import_effect.Schema.partial, import_echo.Type.Obj({
47
- typename: "dxos.org/type/Chess",
48
- version: "0.1.0"
49
- }));
50
- var CHESS_PLUGIN = "dxos.org/plugin/chess";
51
- var meta = {
52
- id: CHESS_PLUGIN,
53
- name: "Chess",
54
- description: "Chess is a simple plugin which allows you to render an interactive chessboard inside of a plank. This chessboard can be used for collaborative chess games, or for practice experiments with the LLM. ",
55
- icon: "ph--shield-chevron--regular",
56
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess",
57
- screenshots: [
58
- "https://dxos.network/plugin-details-chess-dark.png"
59
- ]
60
- };
61
- (function(ChessAction2) {
62
- const CHESS_ACTION = `${CHESS_PLUGIN}/action`;
63
- class Create extends import_effect2.Schema.TaggedClass()(`${CHESS_ACTION}/create`, {
64
- input: import_effect2.Schema.Struct({
65
- name: import_effect2.Schema.optional(import_effect2.Schema.String),
66
- fen: import_effect2.Schema.optional(import_effect2.Schema.String)
67
- }),
68
- output: import_effect2.Schema.Struct({
69
- object: ChessType
70
- })
71
- }) {
72
- }
73
- ChessAction2.Create = Create;
74
- })(ChessAction || (ChessAction = {}));
75
- var isObject = import_echo2.Obj.instanceOf(ChessType);
76
- var ChessAction;
77
- // Annotate the CommonJS export names for ESM import in node:
78
- 0 && (module.exports = {
79
- CHESS_PLUGIN,
80
- ChessAction,
81
- ChessType,
82
- MoveSchema,
83
- isObject,
84
- meta
85
- });
86
- //# sourceMappingURL=chunk-THN2FKB3.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts", "../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Type } from '@dxos/echo';\n\nexport const MoveSchema = Schema.mutable(\n Schema.partial(\n Schema.Struct({\n source: Schema.String,\n target: Schema.String,\n piece: Schema.String,\n }),\n ),\n);\n\nexport const ChessType = Schema.Struct({\n name: Schema.optional(Schema.String),\n playerWhite: Schema.String,\n playerBlack: Schema.String,\n moves: Schema.mutable(Schema.Array(Schema.String)),\n // TODO(wittjosiah): Remove. Redundant with moves.\n pgn: Schema.String,\n fen: Schema.String,\n}).pipe(\n Schema.partial,\n Type.Obj({\n typename: 'dxos.org/type/Chess',\n version: '0.1.0',\n }),\n);\nexport interface ChessType extends Schema.Schema.Type<typeof ChessType> {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Obj } from '@dxos/echo';\n\nimport { ChessType } from './schema';\nimport { CHESS_PLUGIN } from '../meta';\n\nexport namespace ChessAction {\n const CHESS_ACTION = `${CHESS_PLUGIN}/action`;\n\n export class Create extends Schema.TaggedClass<Create>()(`${CHESS_ACTION}/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n fen: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: ChessType,\n }),\n }) {}\n}\n\nexport const isObject = Obj.instanceOf(ChessType);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const CHESS_PLUGIN = 'dxos.org/plugin/chess';\n\nexport const meta: PluginMeta = {\n id: CHESS_PLUGIN,\n name: 'Chess',\n description:\n 'Chess is a simple plugin which allows you to render an interactive chessboard inside of a plank. This chessboard can be used for collaborative chess games, or for practice experiments with the LLM. ',\n icon: 'ph--shield-chevron--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',\n screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAAuB;AAEvB,kBAAqB;ACFrB,IAAAA,iBAAuB;AAEvB,IAAAC,eAAoB;ADEb,IAAMC,aAAaC,qBAAOC,QAC/BD,qBAAOE,QACLF,qBAAOG,OAAO;EACZC,QAAQJ,qBAAOK;EACfC,QAAQN,qBAAOK;EACfE,OAAOP,qBAAOK;AAChB,CAAA,CAAA,CAAA;AAIG,IAAMG,YAAYR,qBAAOG,OAAO;EACrCM,MAAMT,qBAAOU,SAASV,qBAAOK,MAAM;EACnCM,aAAaX,qBAAOK;EACpBO,aAAaZ,qBAAOK;EACpBQ,OAAOb,qBAAOC,QAAQD,qBAAOc,MAAMd,qBAAOK,MAAM,CAAA;;EAEhDU,KAAKf,qBAAOK;EACZW,KAAKhB,qBAAOK;AACd,CAAA,EAAGY,KACDjB,qBAAOE,SACPgB,iBAAKC,IAAI;EACPC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;AEzBK,IAAMC,eAAe;AAErB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJb,MAAM;EACNgB,aACE;EACFC,MAAM;EACNtB,QAAQ;EACRuB,aAAa;IAAC;;AAChB;UDLiBC,cAAAA;AACf,QAAMC,eAAe,GAAGP,YAAAA;EAEjB,MAAMQ,eAAe9B,eAAAA,OAAO+B,YAAW,EAAW,GAAGF,YAAAA,WAAuB;IACjFG,OAAOhC,eAAAA,OAAOG,OAAO;MACnBM,MAAMT,eAAAA,OAAOU,SAASV,eAAAA,OAAOK,MAAM;MACnCW,KAAKhB,eAAAA,OAAOU,SAASV,eAAAA,OAAOK,MAAM;IACpC,CAAA;IACA4B,QAAQjC,eAAAA,OAAOG,OAAO;MACpB+B,QAAQ1B;IACV,CAAA;EACF,CAAA,EAAA;EAAI;eARSsB,SAAAA;AASf,GAZiBF,gBAAAA,cAAAA,CAAAA,EAAAA;AAcV,IAAMO,WAAWhB,iBAAIiB,WAAW5B,SAAAA;;",
6
- "names": ["import_effect", "import_echo", "MoveSchema", "Schema", "mutable", "partial", "Struct", "source", "String", "target", "piece", "ChessType", "name", "optional", "playerWhite", "playerBlack", "moves", "Array", "pgn", "fen", "pipe", "Type", "Obj", "typename", "version", "CHESS_PLUGIN", "meta", "id", "description", "icon", "screenshots", "ChessAction", "CHESS_ACTION", "Create", "TaggedClass", "input", "output", "object", "isObject", "instanceOf"]
7
- }
@@ -1,121 +0,0 @@
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 node_exports = {};
30
- __export(node_exports, {
31
- ArtifactDefinition: () => ArtifactDefinition,
32
- CHESS_PLUGIN: () => import_chunk_THN2FKB3.CHESS_PLUGIN,
33
- ChessComponent: () => import_chunk_OTMP6HPY.ChessComponent,
34
- ChessContainer: () => import_chunk_R6JAL3RE.ChessContainer,
35
- ChessPlugin: () => ChessPlugin,
36
- IntentResolver: () => IntentResolver,
37
- ReactSurface: () => ReactSurface,
38
- meta: () => import_chunk_THN2FKB3.meta
39
- });
40
- module.exports = __toCommonJS(node_exports);
41
- var import_chunk_R6JAL3RE = require("./chunk-R6JAL3RE.cjs");
42
- var import_chunk_THN2FKB3 = require("./chunk-THN2FKB3.cjs");
43
- var import_chunk_OTMP6HPY = require("./chunk-OTMP6HPY.cjs");
44
- var import_app_framework = require("@dxos/app-framework");
45
- var import_app_framework2 = require("@dxos/app-framework");
46
- var import_plugin_client = require("@dxos/plugin-client");
47
- var import_plugin_space = require("@dxos/plugin-space");
48
- var import_types = require("@dxos/plugin-space/types");
49
- var import_echo = require("@dxos/echo");
50
- var ArtifactDefinition = (0, import_app_framework.lazy)(() => import("./artifact-definition-VHJ54X2P.cjs"));
51
- var IntentResolver = (0, import_app_framework.lazy)(() => import("./intent-resolver-BQGAQM27.cjs"));
52
- var ReactSurface = (0, import_app_framework.lazy)(() => import("./react-surface-TZDWBTEY.cjs"));
53
- var translations_default = [
54
- {
55
- "en-US": {
56
- [import_echo.Type.getTypename(import_chunk_THN2FKB3.ChessType)]: {
57
- "typename label": "Game",
58
- "typename label_zero": "Games",
59
- "typename label_one": "Game",
60
- "typename label_other": "Games",
61
- "object name placeholder": "New game"
62
- },
63
- [import_chunk_THN2FKB3.CHESS_PLUGIN]: {
64
- "plugin name": "Chess",
65
- "delete game label": "Delete"
66
- }
67
- }
68
- }
69
- ];
70
- var ChessPlugin = () => (0, import_app_framework2.definePlugin)(import_chunk_THN2FKB3.meta, [
71
- (0, import_app_framework2.defineModule)({
72
- id: `${import_chunk_THN2FKB3.meta.id}/module/translations`,
73
- activatesOn: import_app_framework2.Events.SetupTranslations,
74
- activate: () => (0, import_app_framework2.contributes)(import_app_framework2.Capabilities.Translations, translations_default)
75
- }),
76
- (0, import_app_framework2.defineModule)({
77
- id: `${import_chunk_THN2FKB3.meta.id}/module/metadata`,
78
- activatesOn: import_app_framework2.Events.SetupMetadata,
79
- activate: () => (0, import_app_framework2.contributes)(import_app_framework2.Capabilities.Metadata, {
80
- id: import_chunk_THN2FKB3.ChessType.typename,
81
- metadata: {
82
- icon: "ph--shield-chevron--regular"
83
- }
84
- })
85
- }),
86
- (0, import_app_framework2.defineModule)({
87
- id: `${import_chunk_THN2FKB3.meta.id}/module/object-form`,
88
- activatesOn: import_plugin_client.ClientEvents.SetupSchema,
89
- activate: () => (0, import_app_framework2.contributes)(import_plugin_space.SpaceCapabilities.ObjectForm, (0, import_types.defineObjectForm)({
90
- objectSchema: import_chunk_THN2FKB3.ChessType,
91
- getIntent: () => (0, import_app_framework2.createIntent)(import_chunk_THN2FKB3.ChessAction.Create)
92
- }))
93
- }),
94
- (0, import_app_framework2.defineModule)({
95
- id: `${import_chunk_THN2FKB3.meta.id}/module/react-surface`,
96
- activatesOn: import_app_framework2.Events.SetupReactSurface,
97
- activate: ReactSurface
98
- }),
99
- (0, import_app_framework2.defineModule)({
100
- id: `${import_chunk_THN2FKB3.meta.id}/module/intent-resolver`,
101
- activatesOn: import_app_framework2.Events.SetupIntentResolver,
102
- activate: IntentResolver
103
- }),
104
- (0, import_app_framework2.defineModule)({
105
- id: `${import_chunk_THN2FKB3.meta.id}/module/artifact-definition`,
106
- activatesOn: import_app_framework2.Events.SetupArtifactDefinition,
107
- activate: ArtifactDefinition
108
- })
109
- ]);
110
- // Annotate the CommonJS export names for ESM import in node:
111
- 0 && (module.exports = {
112
- ArtifactDefinition,
113
- CHESS_PLUGIN,
114
- ChessComponent,
115
- ChessContainer,
116
- ChessPlugin,
117
- IntentResolver,
118
- ReactSurface,
119
- meta
120
- });
121
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/index.ts", "../../../src/ChessPlugin.tsx", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const ArtifactDefinition = lazy(() => import('./artifact-definition'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { ClientEvents } from '@dxos/plugin-client';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { defineObjectForm } from '@dxos/plugin-space/types';\n\nimport { ArtifactDefinition, IntentResolver, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { ChessAction, ChessType } from './types';\n\nexport const ChessPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: ChessType.typename,\n metadata: {\n icon: 'ph--shield-chevron--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/object-form`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () =>\n contributes(\n SpaceCapabilities.ObjectForm,\n defineObjectForm({\n objectSchema: ChessType,\n getIntent: () => createIntent(ChessAction.Create),\n }),\n ),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n defineModule({\n id: `${meta.id}/module/artifact-definition`,\n activatesOn: Events.SetupArtifactDefinition,\n activate: ArtifactDefinition,\n }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Type } from '@dxos/echo';\n\nimport { CHESS_PLUGIN } from './meta';\nimport { ChessType } from './types';\n\nexport default [\n {\n 'en-US': {\n [Type.getTypename(ChessType)]: {\n 'typename label': 'Game',\n 'typename label_zero': 'Games',\n 'typename label_one': 'Game',\n 'typename label_other': 'Games',\n 'object name placeholder': 'New game',\n },\n [CHESS_PLUGIN]: {\n 'plugin name': 'Chess',\n 'delete game label': 'Delete',\n },\n },\n },\n];\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAqB;ACArB,IAAAA,wBAA4F;AAC5F,2BAA6B;AAC7B,0BAAkC;AAClC,mBAAiC;ACHjC,kBAAqB;AFEd,IAAMC,yBAAqBC,2BAAK,MAAM,OAAO,oCAAA,CAAA;AAC7C,IAAMC,qBAAiBD,2BAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAME,mBAAeF,2BAAK,MAAM,OAAO,8BAAA,CAAA;AEC9C,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACG,iBAAKC,YAAYC,+BAAAA,CAAAA,GAAa;QAC7B,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;MAC7B;MACA,CAACC,kCAAAA,GAAe;QACd,eAAe;QACf,qBAAqB;MACvB;IACF;EACF;;ADVK,IAAMC,cAAc,UACzBC,oCAAaC,4BAAM;MACjBC,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,6BAAOC;IACpBC,UAAU,UAAMC,mCAAYC,mCAAaC,cAAcC,oBAAAA;EACzD,CAAA;MACAT,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,6BAAOO;IACpBL,UAAU,UACRC,mCAAYC,mCAAaI,UAAU;MACjCV,IAAIN,gCAAUiB;MACdC,UAAU;QACRC,MAAM;MACR;IACF,CAAA;EACJ,CAAA;MACAd,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaa,kCAAaC;IAC1BX,UAAU,UACRC,mCACEW,sCAAkBC,gBAClBC,+BAAiB;MACfC,cAAczB;MACd0B,WAAW,UAAMC,oCAAaC,kCAAYC,MAAM;IAClD,CAAA,CAAA;EAEN,CAAA;MACAxB,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,6BAAOsB;IACpBpB,UAAUb;EACZ,CAAA;MACAQ,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,6BAAOuB;IACpBrB,UAAUd;EACZ,CAAA;MACAS,oCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,6BAAOwB;IACpBtB,UAAUhB;EACZ,CAAA;CACD;",
6
- "names": ["import_app_framework", "ArtifactDefinition", "lazy", "IntentResolver", "ReactSurface", "Type", "getTypename", "ChessType", "CHESS_PLUGIN", "ChessPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "Metadata", "typename", "metadata", "icon", "ClientEvents", "SetupSchema", "SpaceCapabilities", "ObjectForm", "defineObjectForm", "objectSchema", "getIntent", "createIntent", "ChessAction", "Create", "SetupReactSurface", "SetupIntentResolver", "SetupArtifactDefinition"]
7
- }
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var intent_resolver_BQGAQM27_exports = {};
20
- __export(intent_resolver_BQGAQM27_exports, {
21
- default: () => intent_resolver_default
22
- });
23
- module.exports = __toCommonJS(intent_resolver_BQGAQM27_exports);
24
- var import_chunk_THN2FKB3 = require("./chunk-THN2FKB3.cjs");
25
- var import_chess = require("chess.js");
26
- var import_app_framework = require("@dxos/app-framework");
27
- var import_echo = require("@dxos/echo");
28
- var intent_resolver_default = () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.IntentResolver, (0, import_app_framework.createResolver)({
29
- intent: import_chunk_THN2FKB3.ChessAction.Create,
30
- resolve: ({ name, fen }) => {
31
- const pgn = fen ? new import_chess.Chess(fen).pgn() : void 0;
32
- return {
33
- data: {
34
- object: import_echo.Obj.make(import_chunk_THN2FKB3.ChessType, {
35
- name,
36
- fen,
37
- pgn
38
- })
39
- }
40
- };
41
- }
42
- }));
43
- //# sourceMappingURL=intent-resolver-BQGAQM27.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess } from 'chess.js';\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { ChessAction, ChessType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ChessAction.Create,\n resolve: ({ name, fen }) => {\n const pgn = fen ? new Chess(fen).pgn() : undefined;\n return {\n data: {\n object: Obj.make(ChessType, { name, fen, pgn }),\n },\n };\n },\n }),\n );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAsB;AAEtB,2BAA0D;AAC1D,kBAAoB;AAIpB,IAAA,0BAAe,UACbA,kCACEC,kCAAaC,oBACbC,qCAAe;EACbC,QAAQC,kCAAYC;EACpBC,SAAS,CAAC,EAAEC,MAAMC,IAAG,MAAE;AACrB,UAAMC,MAAMD,MAAM,IAAIE,mBAAMF,GAAAA,EAAKC,IAAG,IAAKE;AACzC,WAAO;MACLC,MAAM;QACJC,QAAQC,gBAAIC,KAAKC,iCAAW;UAAET;UAAMC;UAAKC;QAAI,CAAA;MAC/C;IACF;EACF;AACF,CAAA,CAAA;",
6
- "names": ["contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ChessAction", "Create", "resolve", "name", "fen", "pgn", "Chess", "undefined", "data", "object", "Obj", "make", "ChessType"]
7
- }
@@ -1 +0,0 @@
1
- {"inputs":{"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2033,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":3044,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":2702,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","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":19082,"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","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":2692,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/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/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":3766,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","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":2169,"imports":[{"path":"@dxos/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/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/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5094},"packages/plugins/plugin-chess/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node/chunk-R6JAL3RE.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node/chunk-THN2FKB3.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node/chunk-OTMP6HPY.cjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node/artifact-definition-VHJ54X2P.cjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node/intent-resolver-BQGAQM27.cjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node/react-surface-TZDWBTEY.cjs","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},{"path":"@dxos/echo","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":445}},"bytes":2822},"packages/plugins/plugin-chess/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node/chunk-THN2FKB3.cjs","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/node/artifact-definition-VHJ54X2P.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8478},"packages/plugins/plugin-chess/dist/lib/node/artifact-definition-VHJ54X2P.cjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node/chunk-THN2FKB3.cjs","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","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":5956}},"bytes":6216},"packages/plugins/plugin-chess/dist/lib/node/intent-resolver-BQGAQM27.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1374},"packages/plugins/plugin-chess/dist/lib/node/intent-resolver-BQGAQM27.cjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node/chunk-THN2FKB3.cjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","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":503}},"bytes":743},"packages/plugins/plugin-chess/dist/lib/node/ChessContainer-EQUVXDJC.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6167},"packages/plugins/plugin-chess/dist/lib/node/ChessContainer-EQUVXDJC.cjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node/chunk-OTMP6HPY.cjs","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/node/react-surface-TZDWBTEY.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1789},"packages/plugins/plugin-chess/dist/lib/node/react-surface-TZDWBTEY.cjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node/chunk-R6JAL3RE.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node/chunk-THN2FKB3.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/node/chunk-OTMP6HPY.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","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":715}},"bytes":1077},"packages/plugins/plugin-chess/dist/lib/node/chunk-R6JAL3RE.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/node/chunk-R6JAL3RE.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node/ChessContainer-EQUVXDJC.cjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":235},"packages/plugins/plugin-chess/dist/lib/node/chunk-THN2FKB3.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3763},"packages/plugins/plugin-chess/dist/lib/node/chunk-THN2FKB3.cjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","ChessType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":586},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":553},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":1991},"packages/plugins/plugin-chess/dist/lib/node/chunk-OTMP6HPY.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2588},"packages/plugins/plugin-chess/dist/lib/node/chunk-OTMP6HPY.cjs":{"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,62 +0,0 @@
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 react_surface_TZDWBTEY_exports = {};
30
- __export(react_surface_TZDWBTEY_exports, {
31
- default: () => react_surface_default
32
- });
33
- module.exports = __toCommonJS(react_surface_TZDWBTEY_exports);
34
- var import_chunk_R6JAL3RE = require("./chunk-R6JAL3RE.cjs");
35
- var import_chunk_THN2FKB3 = require("./chunk-THN2FKB3.cjs");
36
- var import_chunk_OTMP6HPY = require("./chunk-OTMP6HPY.cjs");
37
- var import_react = __toESM(require("react"));
38
- var import_app_framework = require("@dxos/app-framework");
39
- var import_echo = require("@dxos/echo");
40
- var react_surface_default = () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactSurface, [
41
- (0, import_app_framework.createSurface)({
42
- id: import_chunk_THN2FKB3.CHESS_PLUGIN,
43
- role: [
44
- "article",
45
- "section"
46
- ],
47
- filter: (data) => (0, import_chunk_THN2FKB3.isObject)(data.subject),
48
- component: ({ data, role }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_R6JAL3RE.ChessContainer, {
49
- game: data.subject,
50
- role
51
- })
52
- }),
53
- (0, import_app_framework.createSurface)({
54
- id: "plugin-chess",
55
- role: "canvas-node",
56
- filter: import_echo.Obj.instanceOf(import_chunk_THN2FKB3.ChessType),
57
- component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_OTMP6HPY.ChessComponent, {
58
- game: data
59
- })
60
- })
61
- ]);
62
- //# sourceMappingURL=react-surface-TZDWBTEY.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { ChessContainer } from '../components';\nimport { ChessComponent } from '../components/ChessComponent';\nimport { CHESS_PLUGIN } from '../meta';\nimport { ChessType, isObject } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: CHESS_PLUGIN,\n role: ['article', 'section'],\n filter: (data): data is { subject: ChessType } => isObject(data.subject),\n component: ({ data, role }) => <ChessContainer game={data.subject} role={role} />,\n }),\n createSurface({\n id: 'plugin-chess',\n role: 'canvas-node',\n filter: Obj.instanceOf(ChessType),\n component: ({ data }) => <ChessComponent game={data} />,\n }),\n ]);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAAyD;AACzD,kBAAoB;AAOpB,IAAA,wBAAe,UACbA,kCAAYC,kCAAaC,cAAc;MACrCC,oCAAc;IACZC,IAAIC;IACJC,MAAM;MAAC;MAAW;;IAClBC,QAAQ,CAACC,aAAyCC,gCAASD,KAAKE,OAAO;IACvEC,WAAW,CAAC,EAAEH,MAAMF,KAAI,MAAO,6BAAAM,QAAA,cAACC,sCAAAA;MAAeC,MAAMN,KAAKE;MAASJ;;EACrE,CAAA;MACAH,oCAAc;IACZC,IAAI;IACJE,MAAM;IACNC,QAAQQ,gBAAIC,WAAWC,+BAAAA;IACvBN,WAAW,CAAC,EAAEH,KAAI,MAAO,6BAAAI,QAAA,cAACM,sCAAAA;MAAeJ,MAAMN;;EACjD,CAAA;CACD;",
6
- "names": ["contributes", "Capabilities", "ReactSurface", "createSurface", "id", "CHESS_PLUGIN", "role", "filter", "data", "isObject", "subject", "component", "React", "ChessContainer", "game", "Obj", "instanceOf", "ChessType", "ChessComponent"]
7
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var types_exports = {};
20
- __export(types_exports, {
21
- ChessAction: () => import_chunk_THN2FKB3.ChessAction,
22
- ChessType: () => import_chunk_THN2FKB3.ChessType,
23
- MoveSchema: () => import_chunk_THN2FKB3.MoveSchema,
24
- isObject: () => import_chunk_THN2FKB3.isObject
25
- });
26
- module.exports = __toCommonJS(types_exports);
27
- var import_chunk_THN2FKB3 = require("../chunk-THN2FKB3.cjs");
28
- // Annotate the CommonJS export names for ESM import in node:
29
- 0 && (module.exports = {
30
- ChessAction,
31
- ChessType,
32
- MoveSchema,
33
- isObject
34
- });
35
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["index.cjs"],
4
- "sourcesContent": ["import {\n ChessAction,\n ChessType,\n MoveSchema,\n isObject\n} from \"../chunk-THN2FKB3.cjs\";\nexport {\n ChessAction,\n ChessType,\n MoveSchema,\n isObject\n};\n//# sourceMappingURL=index.cjs.map\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAKO;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ChessContainer.tsx", "../../../src/components/PlayerSelector.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { ChessComponent } from './ChessComponent';\nimport { PlayerSelector } from './PlayerSelector';\nimport { type ChessType } from '../types';\n\nconst ChessContainer = ({ game }: { game: ChessType; role?: string }) => {\n const space = getSpace(game);\n if (!space) {\n return null;\n }\n\n return (\n <StackItem.Content>\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,OAAOA,YAAW;AAElB,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;;;;ACH1B,SAASC,kBAAkB;AAC3B,OAAOC,WAAW;AAElB,SAASC,oBAAoB;AAC7B,SAASC,kBAAgD;AACzD,SAASC,OAAOC,QAAQC,uBAAuB;AAC/C,SAASC,SAASC,UAAU;AAIrB,IAAMC,iBAAiB,CAAC,EAAEC,OAAOC,KAAI,MAAqC;;;AAC/E,UAAMC,UAAUC,WAAWH,MAAMI,GAAG;AAEpC,WACE,sBAAA,cAACC,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACzB,sBAAA,cAACF,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACzB,sBAAA,cAACC,cAAAA;MACCC,MAAK;MACLC,OAAOT,KAAKU;MACZC,eAAe,CAACC,WAAYZ,KAAKU,cAAcE;MAC/CX;SAGJ,sBAAA,cAACG,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACzB,sBAAA,cAACC,cAAAA;MACCC,MAAK;MACLC,OAAOT,KAAKa;MACZF,eAAe,CAACC,WAAYZ,KAAKa,cAAcD;MAC/CX;;;;;AAKV;AAEA,IAAMM,eAAe,CAAC,EACpBC,MACAC,OACAE,eACAV,QAAO,MAMR;;;AACC,UAAM,EAAEa,UAAS,IAAKC,gBAAAA;AACtB,UAAMC,eACHR,SAAS,WAAWM,cAAc,WAAaN,SAAS,WAAWM,cAAc,SAAU,SAASG;AAEvG,WACE,sBAAA,cAACC,MAAMC,MAAI,MACT,sBAAA,cAACD,MAAME,OAAK,MACV,sBAAA,cAACC,YAAAA;MAAWf,WAAWgB,GAAGC,QAAQ,CAAA,CAAA;MAAKC,QAAQR;MAAcS,cAAY,uBAAuBjB,IAAAA;SAElG,sBAAA,cAACkB,OAAOP,MAAI;MAACV;MAAcE;OACzB,sBAAA,cAACe,OAAOC,eAAa;MAACC,aAAa;QACnC,sBAAA,cAACF,OAAOG,QAAM,MACZ,sBAAA,cAACH,OAAOI,SAAO,MACb,sBAAA,cAACJ,OAAOK,UAAQ,MACb9B,QAAQ+B,IAAI,CAACC,WAAAA;AACZ,YAAMC,YAAYD,OAAOE,SAASC,YAAYC,MAAK;AACnD,YAAMC,cAAcL,OAAOE,UAAUI,SAASD,eAAeE,aAAaN,SAAAA;AAC1E,aACE,sBAAA,cAACR,OAAOe,QAAM;QAACtC,KAAK+B;QAAWzB,OAAOyB;SACnCI,WAAAA;IAGP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;;AAOd;;;ADlEA,IAAMI,iBAAiB,CAAC,EAAEC,KAAI,MAAsC;;;AAClE,UAAMC,QAAQC,SAASF,IAAAA;AACvB,QAAI,CAACC,OAAO;AACV,aAAO;IACT;AAEA,WACE,gBAAAE,OAAA,cAACC,UAAUC,SAAO,MAChB,gBAAAF,OAAA,cAACG,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACzB,gBAAAL,OAAA,cAACG,OAAAA,IAAAA,GAED,gBAAAH,OAAA,cAACG,OAAAA;MAAIE,WAAU;OACb,gBAAAL,OAAA,cAACM,gBAAAA;MAAeT;SAGlB,gBAAAG,OAAA,cAACO,gBAAAA;MAAeT;MAAcD;;;;;AAItC;AAEA,IAAA,yBAAeD;",
6
- "names": ["React", "getSpace", "StackItem", "CrownCross", "React", "generateName", "useMembers", "Input", "Select", "useThemeContext", "getSize", "mx", "PlayerSelector", "space", "game", "members", "useMembers", "key", "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", "game", "space", "getSpace", "React", "StackItem", "Content", "div", "role", "className", "ChessComponent", "PlayerSelector"]
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, 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 { Obj } from '@dxos/echo';\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\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(Obj.instanceOf(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(Obj.instanceOf(ChessType, game));\n\n const board = new Chess(game.fen);\n try {\n board.move(move);\n } catch (error: any) {\n return ToolResult.Error(error.message);\n }\n game.pgn = board.pgn();\n game.fen = board.fen();\n return ToolResult.Success(game.fen);\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
5
- "mappings": ";;;;;;;;AAIA,SAASA,aAAa;AACtB,SAASC,MAAMC,cAAc;AAE7B,SAASC,YAAYC,kBAAkB;AACvC,SAASC,cAAcC,OAAOC,aAAaC,oBAAkD;AAC7F,SAASC,YAAYC,sBAAsB;AAC3C,SAASC,uBAAuBC,kBAAkB;AAClD,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,cAA0B;;AAanC,IAAA,8BAAe,MAAA;AACb,QAAMC,aAAaC,eAAe;IAChCC,IAAI,YAAYC,KAAKD,EAAE;IACvBE,MAAMD,KAAKC;IACXC,aAAa;IACbC,cAAc;;;;IAIdC,QAAQC;IACRC,OAAO;MACLC,WAAWP,KAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,OAAOC,OAAO;UACpBC,KAAKF,OAAOG,OAAOC,YAAY;YAAEX,aAAa;UAAiD,CAAA;QACjG,CAAA;QACAY,SAAS,OAAO,EAAEH,IAAG,GAAI,EAAEI,WAAU,MAAE;AACrCC,oBAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7BD,oBAAUD,YAAYG,UAAU,wBAAA;;;;;;;;;AAChC,gBAAMC,SAASC,KACbC,aAAaC,YAAYC,QAAQ;YAAEZ;UAAI,CAAA,GACvCa,MAAMC,YAAYC,WAAW;YAAEC,QAAQZ,WAAWE;UAAM,CAAA,CAAA;AAE1D,gBAAM,EAAEW,MAAMC,MAAK,IAAK,MAAMd,WAAWG,SAASC,MAAAA;AAClD,cAAI,CAACS,QAAQC,OAAO;AAClB,mBAAOC,WAAWC,MAAMF,OAAOG,WAAW,6BAAA;UAC5C;AAEA,iBAAOF,WAAWG,QAAQC,sBAAsBN,KAAK7B,EAAE,GAAG;YACxDoC,WAAWC,YAAYD,WAAWE,WAAWT,KAAKU,MAAM,CAAA;WACzD;QACH;MACF,CAAA;MACA/B,WAAWP,KAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,OAAOC,OAAO,CAAC,CAAA;QACvBI,SAAS,OAAOyB,GAAG,EAAExB,WAAU,MAAE;AAC/BC,oBAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7B,gBAAM,EAAEuB,SAASC,MAAK,IAAK,MAAM1B,WAAWE,MAAMyB,GAAGC,MAAMC,OAAOC,KAAKxC,SAAAA,CAAAA,EAAYyC,IAAG;AACtF9B,oBAAUyB,MAAMM,SAAS,GAAG,wBAAA;;;;;;;;;AAE5B,iBAAOjB,WAAWG,QAAQQ,KAAAA;QAC5B;MACF,CAAA;MACAlC,WAAWP,KAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,OAAOC,OAAO;UAAEX,IAAIiD;QAAW,CAAA;QACvClC,SAAS,OAAO,EAAEf,GAAE,GAAI,EAAEgB,WAAU,MAAE;AACpCC,oBAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7B,gBAAMgC,OAAO,MAAMlC,WAAWE,MAAMyB,GACjCC,MAAMC,OAAOM,IAAIF,WAAWG,MAAMpD,IAAIgB,WAAWE,MAAMlB,EAAE,EAAEqD,SAAQ,CAAA,CAAA,EACnEC,MAAK;AACRrC,oBAAUsC,IAAIC,WAAWlD,WAAW4C,IAAAA,GAAAA,QAAAA;;;;;;;;;AAEpC,iBAAOnB,WAAWG,QAAQgB,KAAKtC,GAAG;QACpC;MACF,CAAA;MACAJ,WAAWP,KAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,OAAOC,OAAO;UACpBX,IAAIiD;UACJQ,MAAM/C,OAAOG,OAAOC,YAAY;YAC9BX,aAAa;YACbuD,UAAU;cAAC;cAAM;;UACnB,CAAA;QACF,CAAA;QACA3C,SAAS,OAAO,EAAEf,IAAIyD,KAAI,GAAI,EAAEzC,WAAU,MAAE;AAC1CC,oBAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAC7B,gBAAMgC,OAAO,MAAMlC,WAAWE,MAAMyB,GACjCC,MAAMC,OAAOM,IAAIF,WAAWG,MAAMpD,IAAIgB,WAAWE,MAAMlB,EAAE,EAAEqD,SAAQ,CAAA,CAAA,EACnEC,MAAK;AACRrC,oBAAUsC,IAAIC,WAAWlD,WAAW4C,IAAAA,GAAAA,QAAAA;;;;;;;;;AAEpC,gBAAMS,QAAQ,IAAIC,MAAMV,KAAKtC,GAAG;AAChC,cAAI;AACF+C,kBAAMF,KAAKA,IAAAA;UACb,SAAS3B,OAAY;AACnB,mBAAOC,WAAWC,MAAMF,MAAMG,OAAO;UACvC;AACAiB,eAAKW,MAAMF,MAAME,IAAG;AACpBX,eAAKtC,MAAM+C,MAAM/C,IAAG;AACpB,iBAAOmB,WAAWG,QAAQgB,KAAKtC,GAAG;QACpC;MACF,CAAA;;EAEJ,CAAA;AAEA,SAAOkD,YAAYC,aAAaC,oBAAoBlE,UAAAA;AACtD;",
6
- "names": ["Chess", "pipe", "Schema", "createTool", "ToolResult", "Capabilities", "chain", "contributes", "createIntent", "ArtifactId", "defineArtifact", "createArtifactElement", "VersionPin", "Obj", "invariant", "SpaceAction", "Filter", "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", "Obj", "instanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts", "../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Type } from '@dxos/echo';\n\nexport const MoveSchema = Schema.mutable(\n Schema.partial(\n Schema.Struct({\n source: Schema.String,\n target: Schema.String,\n piece: Schema.String,\n }),\n ),\n);\n\nexport const ChessType = Schema.Struct({\n name: Schema.optional(Schema.String),\n playerWhite: Schema.String,\n playerBlack: Schema.String,\n moves: Schema.mutable(Schema.Array(Schema.String)),\n // TODO(wittjosiah): Remove. Redundant with moves.\n pgn: Schema.String,\n fen: Schema.String,\n}).pipe(\n Schema.partial,\n Type.Obj({\n typename: 'dxos.org/type/Chess',\n version: '0.1.0',\n }),\n);\nexport interface ChessType extends Schema.Schema.Type<typeof ChessType> {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Obj } from '@dxos/echo';\n\nimport { ChessType } from './schema';\nimport { CHESS_PLUGIN } from '../meta';\n\nexport namespace ChessAction {\n const CHESS_ACTION = `${CHESS_PLUGIN}/action`;\n\n export class Create extends Schema.TaggedClass<Create>()(`${CHESS_ACTION}/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n fen: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: ChessType,\n }),\n }) {}\n}\n\nexport const isObject = Obj.instanceOf(ChessType);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const CHESS_PLUGIN = 'dxos.org/plugin/chess';\n\nexport const meta: PluginMeta = {\n id: CHESS_PLUGIN,\n name: 'Chess',\n description:\n 'Chess is a simple plugin which allows you to render an interactive chessboard inside of a plank. This chessboard can be used for collaborative chess games, or for practice experiments with the LLM. ',\n icon: 'ph--shield-chevron--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',\n screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],\n};\n"],
5
- "mappings": ";;;AAIA,SAASA,cAAc;AAEvB,SAASC,YAAY;AAEd,IAAMC,aAAaC,OAAOC,QAC/BD,OAAOE,QACLF,OAAOG,OAAO;EACZC,QAAQJ,OAAOK;EACfC,QAAQN,OAAOK;EACfE,OAAOP,OAAOK;AAChB,CAAA,CAAA,CAAA;AAIG,IAAMG,YAAYR,OAAOG,OAAO;EACrCM,MAAMT,OAAOU,SAASV,OAAOK,MAAM;EACnCM,aAAaX,OAAOK;EACpBO,aAAaZ,OAAOK;EACpBQ,OAAOb,OAAOC,QAAQD,OAAOc,MAAMd,OAAOK,MAAM,CAAA;;EAEhDU,KAAKf,OAAOK;EACZW,KAAKhB,OAAOK;AACd,CAAA,EAAGY,KACDjB,OAAOE,SACPgB,KAAKC,IAAI;EACPC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;;;AC3BF,SAASC,UAAAA,eAAc;AAEvB,SAASC,WAAW;;;ACAb,IAAMC,eAAe;AAErB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;EACRC,aAAa;IAAC;;AAChB;;;UDLiBC,cAAAA;AACf,QAAMC,eAAe,GAAGC,YAAAA;EAEjB,MAAMC,eAAeC,QAAOC,YAAW,EAAW,GAAGJ,YAAAA,WAAuB;IACjFK,OAAOF,QAAOG,OAAO;MACnBC,MAAMJ,QAAOK,SAASL,QAAOM,MAAM;MACnCC,KAAKP,QAAOK,SAASL,QAAOM,MAAM;IACpC,CAAA;IACAE,QAAQR,QAAOG,OAAO;MACpBM,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;eARSX,SAAAA;AASf,GAZiBH,gBAAAA,cAAAA,CAAAA,EAAAA;AAcV,IAAMe,WAAWC,IAAIC,WAAWH,SAAAA;;",
6
- "names": ["Schema", "Type", "MoveSchema", "Schema", "mutable", "partial", "Struct", "source", "String", "target", "piece", "ChessType", "name", "optional", "playerWhite", "playerBlack", "moves", "Array", "pgn", "fen", "pipe", "Type", "Obj", "typename", "version", "Schema", "Obj", "CHESS_PLUGIN", "meta", "id", "name", "description", "icon", "source", "screenshots", "ChessAction", "CHESS_ACTION", "CHESS_PLUGIN", "Create", "Schema", "TaggedClass", "input", "Struct", "name", "optional", "String", "fen", "output", "object", "ChessType", "isObject", "Obj", "instanceOf"]
7
- }
@@ -1,10 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // packages/plugins/plugin-chess/src/components/index.ts
4
- import { lazy } from "react";
5
- var ChessContainer = lazy(() => import("./ChessContainer-KSLGJHPW.mjs"));
6
-
7
- export {
8
- ChessContainer
9
- };
10
- //# sourceMappingURL=chunk-KHMDMPR2.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ChessComponent.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Chess } from 'chess.js';\nimport React, { useCallback, useEffect, useMemo } from 'react';\n\nimport { log } from '@dxos/log';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { ChessModel, Board, Chessboard, type BoardRootProps } from '@dxos/react-ui-gameboard';\n\nimport { type ChessType } from '../types';\n\nexport const ChessComponent = ({ game }: { game: ChessType }) => {\n const model = useMemo(() => new ChessModel(), []);\n useEffect(() => {\n if (!model || game.pgn !== model?.game.pgn()) {\n const chess = new Chess();\n if (game.pgn) {\n try {\n chess.loadPgn(game.pgn);\n } catch (err) {\n log.catch(err, { game });\n }\n }\n\n model.initialize(chess.fen());\n }\n }, [game.pgn]);\n\n const space = getSpace(game);\n if (!space) {\n return null;\n }\n\n const handleDrop = useCallback<NonNullable<BoardRootProps['onDrop']>>(\n (move) => {\n if (model.makeMove(move)) {\n game.pgn = model.game.pgn();\n game.fen = model.game.fen();\n return true;\n }\n\n return false;\n },\n [model],\n );\n\n return (\n <Board.Root model={model} onDrop={handleDrop}>\n <Chessboard />\n </Board.Root>\n );\n};\n"],
5
- "mappings": ";;;;AAIA,SAASA,aAAa;AACtB,OAAOC,SAASC,aAAaC,WAAWC,eAAe;AAEvD,SAASC,WAAW;AACpB,SAASC,gBAAgB;AACzB,SAASC,YAAYC,OAAOC,kBAAuC;;AAI5D,IAAMC,iBAAiB,CAAC,EAAEC,KAAI,MAAuB;;;AAC1D,UAAMC,QAAQR,QAAQ,MAAM,IAAIG,WAAAA,GAAc,CAAA,CAAE;AAChDJ,cAAU,MAAA;AACR,UAAI,CAACS,SAASD,KAAKE,QAAQD,OAAOD,KAAKE,IAAAA,GAAO;AAC5C,cAAMC,QAAQ,IAAId,MAAAA;AAClB,YAAIW,KAAKE,KAAK;AACZ,cAAI;AACFC,kBAAMC,QAAQJ,KAAKE,GAAG;UACxB,SAASG,KAAK;AACZX,gBAAIY,MAAMD,KAAK;cAAEL;YAAK,GAAA;;;;;;UACxB;QACF;AAEAC,cAAMM,WAAWJ,MAAMK,IAAG,CAAA;MAC5B;IACF,GAAG;MAACR,KAAKE;KAAI;AAEb,UAAMO,QAAQd,SAASK,IAAAA;AACvB,QAAI,CAACS,OAAO;AACV,aAAO;IACT;AAEA,UAAMC,aAAanB,YACjB,CAACoB,SAAAA;AACC,UAAIV,MAAMW,SAASD,IAAAA,GAAO;AACxBX,aAAKE,MAAMD,MAAMD,KAAKE,IAAG;AACzBF,aAAKQ,MAAMP,MAAMD,KAAKQ,IAAG;AACzB,eAAO;MACT;AAEA,aAAO;IACT,GACA;MAACP;KAAM;AAGT,WACE,sBAAA,cAACJ,MAAMgB,MAAI;MAACZ;MAAca,QAAQJ;OAChC,sBAAA,cAACZ,YAAAA,IAAAA,CAAAA;;;;AAGP;",
6
- "names": ["Chess", "React", "useCallback", "useEffect", "useMemo", "log", "getSpace", "ChessModel", "Board", "Chessboard", "ChessComponent", "game", "model", "pgn", "chess", "loadPgn", "err", "catch", "initialize", "fen", "space", "handleDrop", "move", "makeMove", "Root", "onDrop"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { ChessContainer } from '../components';\nimport { ChessComponent } from '../components/ChessComponent';\nimport { CHESS_PLUGIN } from '../meta';\nimport { ChessType, isObject } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: CHESS_PLUGIN,\n role: ['article', 'section'],\n filter: (data): data is { subject: ChessType } => isObject(data.subject),\n component: ({ data, role }) => <ChessContainer game={data.subject} role={role} />,\n }),\n createSurface({\n id: 'plugin-chess',\n role: 'canvas-node',\n filter: Obj.instanceOf(ChessType),\n component: ({ data }) => <ChessComponent game={data} />,\n }),\n ]);\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,WAAW;AAOpB,IAAA,wBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAIC;IACJC,MAAM;MAAC;MAAW;;IAClBC,QAAQ,CAACC,SAAyCC,SAASD,KAAKE,OAAO;IACvEC,WAAW,CAAC,EAAEH,MAAMF,KAAI,MAAO,sBAAA,cAACM,gBAAAA;MAAeC,MAAML,KAAKE;MAASJ;;EACrE,CAAA;EACAH,cAAc;IACZC,IAAI;IACJE,MAAM;IACNC,QAAQO,IAAIC,WAAWC,SAAAA;IACvBL,WAAW,CAAC,EAAEH,KAAI,MAAO,sBAAA,cAACS,gBAAAA;MAAeJ,MAAML;;EACjD,CAAA;CACD;",
6
- "names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "CHESS_PLUGIN", "role", "filter", "data", "isObject", "subject", "component", "ChessContainer", "game", "Obj", "instanceOf", "ChessType", "ChessComponent"]
7
- }
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { type ChessType } from '../types';
3
- export declare const ChessComponent: ({ game }: {
4
- game: ChessType;
5
- }) => React.JSX.Element | null;
6
- //# sourceMappingURL=ChessComponent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChessComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/ChessComponent.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,eAAO,MAAM,cAAc,GAAI,UAAU;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,6BAwC3D,CAAC"}