@dxos/plugin-chess 0.7.5-main.b19bfc8 → 0.7.5-main.c41020f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{artifact-definition-AEIQ7Z36.mjs → artifact-definition-D2SD45UX.mjs} +27 -21
- package/dist/lib/browser/artifact-definition-D2SD45UX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GKM6RRDX.mjs → chunk-NNA3W3LX.mjs} +3 -3
- package/dist/lib/browser/index.mjs +4 -4
- package/dist/lib/browser/{intent-resolver-VPK5QRXH.mjs → intent-resolver-KBIH2KYC.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-ITP4OMBZ.mjs → react-surface-2PI2KNSU.mjs} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{artifact-definition-ZM5VDOVN.cjs → artifact-definition-YDPYM4NV.cjs} +35 -30
- package/dist/lib/node/artifact-definition-YDPYM4NV.cjs.map +7 -0
- package/dist/lib/node/{chunk-3TTH3HKL.cjs → chunk-VXYRI6VA.cjs} +4 -4
- package/dist/lib/node/index.cjs +19 -19
- package/dist/lib/node/{intent-resolver-PUM2BVGU.cjs → intent-resolver-TZFKPQOV.cjs} +7 -7
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-4G4PW5RU.cjs → react-surface-OHQIPHSN.cjs} +8 -8
- package/dist/lib/node/types/index.cjs +5 -5
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{artifact-definition-NGQEQHJT.mjs → artifact-definition-LHQK5BBZ.mjs} +27 -21
- package/dist/lib/node-esm/artifact-definition-LHQK5BBZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GQA2DRUZ.mjs → chunk-IP66EHSW.mjs} +3 -3
- package/dist/lib/node-esm/index.mjs +4 -4
- package/dist/lib/node-esm/{intent-resolver-IR3YUZIG.mjs → intent-resolver-WBUS64KC.mjs} +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-AEMVDP4R.mjs → react-surface-XX4VFNRS.mjs} +2 -2
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/capabilities/artifact-definition.ts +16 -10
- package/dist/lib/browser/artifact-definition-AEIQ7Z36.mjs.map +0 -7
- package/dist/lib/node/artifact-definition-ZM5VDOVN.cjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-NGQEQHJT.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-GKM6RRDX.mjs.map → chunk-NNA3W3LX.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-VPK5QRXH.mjs.map → intent-resolver-KBIH2KYC.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-ITP4OMBZ.mjs.map → react-surface-2PI2KNSU.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-3TTH3HKL.cjs.map → chunk-VXYRI6VA.cjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-PUM2BVGU.cjs.map → intent-resolver-TZFKPQOV.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-4G4PW5RU.cjs.map → react-surface-OHQIPHSN.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-GQA2DRUZ.mjs.map → chunk-IP66EHSW.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-IR3YUZIG.mjs.map → intent-resolver-WBUS64KC.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-AEMVDP4R.mjs.map → react-surface-XX4VFNRS.mjs.map} +0 -0
package/dist/lib/browser/{artifact-definition-AEIQ7Z36.mjs → artifact-definition-D2SD45UX.mjs}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChessAction,
|
|
3
|
-
ChessType
|
|
4
|
-
|
|
3
|
+
ChessType,
|
|
4
|
+
meta
|
|
5
|
+
} from "./chunk-NNA3W3LX.mjs";
|
|
5
6
|
|
|
6
7
|
// packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts
|
|
7
8
|
import { Chess } from "chess.js";
|
|
@@ -16,16 +17,18 @@ import { Filter } from "@dxos/react-client/echo";
|
|
|
16
17
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts";
|
|
17
18
|
var artifact_definition_default = () => {
|
|
18
19
|
const definition = defineArtifact({
|
|
19
|
-
id:
|
|
20
|
+
id: meta.id,
|
|
21
|
+
name: meta.name,
|
|
22
|
+
description: "Provides a simple chess engine.",
|
|
20
23
|
instructions: `
|
|
21
|
-
Chess:
|
|
22
24
|
- 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.
|
|
23
25
|
`,
|
|
24
26
|
schema: ChessType,
|
|
25
27
|
tools: [
|
|
26
|
-
defineTool({
|
|
27
|
-
name: "
|
|
28
|
+
defineTool(meta.id, {
|
|
29
|
+
name: "create",
|
|
28
30
|
description: "Create a new chess game. Returns the artifact definition for the game.",
|
|
31
|
+
caption: "Creating chess game...",
|
|
29
32
|
schema: S.Struct({
|
|
30
33
|
fen: S.String.annotations({
|
|
31
34
|
description: "The state of the chess game in the FEN format."
|
|
@@ -34,7 +37,7 @@ var artifact_definition_default = () => {
|
|
|
34
37
|
execute: async ({ fen }, { extensions }) => {
|
|
35
38
|
invariant(extensions?.space, "No space", {
|
|
36
39
|
F: __dxlog_file,
|
|
37
|
-
L:
|
|
40
|
+
L: 45,
|
|
38
41
|
S: void 0,
|
|
39
42
|
A: [
|
|
40
43
|
"extensions?.space",
|
|
@@ -43,7 +46,7 @@ var artifact_definition_default = () => {
|
|
|
43
46
|
});
|
|
44
47
|
invariant(extensions?.dispatch, "No intent dispatcher", {
|
|
45
48
|
F: __dxlog_file,
|
|
46
|
-
L:
|
|
49
|
+
L: 46,
|
|
47
50
|
S: void 0,
|
|
48
51
|
A: [
|
|
49
52
|
"extensions?.dispatch",
|
|
@@ -62,14 +65,15 @@ var artifact_definition_default = () => {
|
|
|
62
65
|
return ToolResult.Success(createArtifactElement(data.id));
|
|
63
66
|
}
|
|
64
67
|
}),
|
|
65
|
-
defineTool({
|
|
66
|
-
name: "
|
|
68
|
+
defineTool(meta.id, {
|
|
69
|
+
name: "list",
|
|
67
70
|
description: "Query all active chess games.",
|
|
71
|
+
caption: "Getting games...",
|
|
68
72
|
schema: S.Struct({}),
|
|
69
73
|
execute: async (_, { extensions }) => {
|
|
70
74
|
invariant(extensions?.space, "No space", {
|
|
71
75
|
F: __dxlog_file,
|
|
72
|
-
L:
|
|
76
|
+
L: 65,
|
|
73
77
|
S: void 0,
|
|
74
78
|
A: [
|
|
75
79
|
"extensions?.space",
|
|
@@ -79,7 +83,7 @@ var artifact_definition_default = () => {
|
|
|
79
83
|
const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();
|
|
80
84
|
invariant(games.length > 0, "No chess games found", {
|
|
81
85
|
F: __dxlog_file,
|
|
82
|
-
L:
|
|
86
|
+
L: 67,
|
|
83
87
|
S: void 0,
|
|
84
88
|
A: [
|
|
85
89
|
"games.length > 0",
|
|
@@ -89,16 +93,17 @@ var artifact_definition_default = () => {
|
|
|
89
93
|
return ToolResult.Success(games);
|
|
90
94
|
}
|
|
91
95
|
}),
|
|
92
|
-
defineTool({
|
|
93
|
-
name: "
|
|
96
|
+
defineTool(meta.id, {
|
|
97
|
+
name: "inspect",
|
|
94
98
|
description: "Get the current state of the chess game.",
|
|
99
|
+
caption: "Inspecting game...",
|
|
95
100
|
schema: S.Struct({
|
|
96
101
|
id: ObjectId
|
|
97
102
|
}),
|
|
98
103
|
execute: async ({ id }, { extensions }) => {
|
|
99
104
|
invariant(extensions?.space, "No space", {
|
|
100
105
|
F: __dxlog_file,
|
|
101
|
-
L:
|
|
106
|
+
L: 77,
|
|
102
107
|
S: void 0,
|
|
103
108
|
A: [
|
|
104
109
|
"extensions?.space",
|
|
@@ -109,7 +114,7 @@ var artifact_definition_default = () => {
|
|
|
109
114
|
const game = games.find((game2) => game2.id === id);
|
|
110
115
|
invariant(isInstanceOf(ChessType, game), void 0, {
|
|
111
116
|
F: __dxlog_file,
|
|
112
|
-
L:
|
|
117
|
+
L: 80,
|
|
113
118
|
S: void 0,
|
|
114
119
|
A: [
|
|
115
120
|
"isInstanceOf(ChessType, game)",
|
|
@@ -119,9 +124,10 @@ var artifact_definition_default = () => {
|
|
|
119
124
|
return ToolResult.Success(game.fen);
|
|
120
125
|
}
|
|
121
126
|
}),
|
|
122
|
-
defineTool({
|
|
123
|
-
name: "
|
|
127
|
+
defineTool(meta.id, {
|
|
128
|
+
name: "move",
|
|
124
129
|
description: "Make a move in the chess game.",
|
|
130
|
+
caption: "Making chess move...",
|
|
125
131
|
schema: S.Struct({
|
|
126
132
|
id: ObjectId,
|
|
127
133
|
move: S.String.annotations({
|
|
@@ -135,7 +141,7 @@ var artifact_definition_default = () => {
|
|
|
135
141
|
execute: async ({ id, move }, { extensions }) => {
|
|
136
142
|
invariant(extensions?.space, "No space", {
|
|
137
143
|
F: __dxlog_file,
|
|
138
|
-
L:
|
|
144
|
+
L: 96,
|
|
139
145
|
S: void 0,
|
|
140
146
|
A: [
|
|
141
147
|
"extensions?.space",
|
|
@@ -146,7 +152,7 @@ var artifact_definition_default = () => {
|
|
|
146
152
|
const game = games.find((game2) => game2.id === id);
|
|
147
153
|
invariant(isInstanceOf(ChessType, game), void 0, {
|
|
148
154
|
F: __dxlog_file,
|
|
149
|
-
L:
|
|
155
|
+
L: 99,
|
|
150
156
|
S: void 0,
|
|
151
157
|
A: [
|
|
152
158
|
"isInstanceOf(ChessType, game)",
|
|
@@ -171,4 +177,4 @@ var artifact_definition_default = () => {
|
|
|
171
177
|
export {
|
|
172
178
|
artifact_definition_default as default
|
|
173
179
|
};
|
|
174
|
-
//# sourceMappingURL=artifact-definition-
|
|
180
|
+
//# sourceMappingURL=artifact-definition-D2SD45UX.mjs.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 } from 'effect';\n\nimport { Capabilities, chain, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement } from '@dxos/assistant';\nimport { isInstanceOf, ObjectId, S } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter, type Space } from '@dxos/react-client/echo';\n\nimport { 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: 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 `,\n schema: ChessType,\n tools: [\n defineTool(meta.id, {\n name: 'create',\n description: 'Create a new chess game. Returns the artifact definition for the game.',\n caption: 'Creating chess game...',\n schema: S.Struct({\n fen: S.String.annotations({ description: 'The state of the chess game in the FEN format.' }),\n }),\n execute: async ({ fen }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n const intent = pipe(\n createIntent(ChessAction.Create, { fen }),\n chain(SpaceAction.AddObject, { target: extensions.space }),\n );\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create chess game');\n }\n\n return ToolResult.Success(createArtifactElement(data.id));\n },\n }),\n defineTool(meta.id, {\n name: 'list',\n description: 'Query all active chess games.',\n caption: 'Getting games...',\n schema: S.Struct({}),\n execute: async (_, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n invariant(games.length > 0, 'No chess games found');\n return ToolResult.Success(games);\n },\n }),\n defineTool(meta.id, {\n name: 'inspect',\n description: 'Get the current state of the chess game.',\n caption: 'Inspecting game...',\n schema: S.Struct({ id: ObjectId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n return ToolResult.Success(game.fen);\n },\n }),\n defineTool(meta.id, {\n name: 'move',\n description: 'Make a move in the chess game.',\n caption: 'Making chess move...',\n schema: S.Struct({\n id: ObjectId,\n move: S.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n execute: async ({ id, move }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n const board = new Chess(game.fen);\n try {\n board.move(move);\n } catch (error: any) {\n return ToolResult.Error(error.message);\n }\n game.pgn = board.pgn();\n game.fen = board.fen();\n return ToolResult.Success(game.fen);\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,SAASA,aAAa;AACtB,SAASC,YAAY;AAErB,SAASC,cAAcC,OAAOC,aAAaC,oBAAkD;AAC7F,SAASC,gBAAgBC,YAAYC,kBAAkB;AACvD,SAASC,6BAA6B;AACtC,SAASC,cAAcC,UAAUC,SAAS;AAC1C,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,cAA0B;;AAanC,IAAA,8BAAe,MAAA;AACb,QAAMC,aAAaC,eAAe;IAChCC,IAAIC,KAAKD;IACTE,MAAMD,K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eAAKO,MAAMF,MAAME,IAAG;AACpBP,eAAKjC,MAAMsC,MAAMtC,IAAG;AACpB,iBAAOmB,WAAWG,QAAQW,KAAKjC,GAAG;QACpC;MACF,CAAA;;EAEJ,CAAA;AAEA,SAAOyC,YAAYC,aAAaC,oBAAoBzD,UAAAA;AACtD;",
|
|
6
|
+
"names": ["Chess", "pipe", "Capabilities", "chain", "contributes", "createIntent", "defineArtifact", "defineTool", "ToolResult", "createArtifactElement", "isInstanceOf", "ObjectId", "S", "invariant", "SpaceAction", "Filter", "definition", "defineArtifact", "id", "meta", "name", "description", "instructions", "schema", "ChessType", "tools", "defineTool", "caption", "S", "Struct", "fen", "String", "annotations", "execute", "extensions", "invariant", "space", "dispatch", "intent", "pipe", "createIntent", "ChessAction", "Create", "chain", "SpaceAction", "AddObject", "target", "data", "error", "ToolResult", "Error", "message", "Success", "createArtifactElement", "_", "objects", "games", "db", "query", "Filter", "run", "length", "ObjectId", "game", "find", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
+
}
|
|
@@ -59,11 +59,11 @@ var isObject = (object) => {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
export {
|
|
62
|
-
MoveSchema,
|
|
63
|
-
ChessType,
|
|
64
62
|
CHESS_PLUGIN,
|
|
65
63
|
meta,
|
|
64
|
+
MoveSchema,
|
|
65
|
+
ChessType,
|
|
66
66
|
ChessAction,
|
|
67
67
|
isObject
|
|
68
68
|
};
|
|
69
|
-
//# sourceMappingURL=chunk-
|
|
69
|
+
//# sourceMappingURL=chunk-NNA3W3LX.mjs.map
|
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
ChessAction,
|
|
7
7
|
ChessType,
|
|
8
8
|
meta
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NNA3W3LX.mjs";
|
|
10
10
|
import {
|
|
11
11
|
ChessComponent
|
|
12
12
|
} from "./chunk-VRWXC5L2.mjs";
|
|
13
13
|
|
|
14
14
|
// packages/plugins/plugin-chess/src/capabilities/index.ts
|
|
15
15
|
import { lazy } from "@dxos/app-framework";
|
|
16
|
-
var ArtifactDefinition = lazy(() => import("./artifact-definition-
|
|
17
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
18
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
16
|
+
var ArtifactDefinition = lazy(() => import("./artifact-definition-D2SD45UX.mjs"));
|
|
17
|
+
var IntentResolver = lazy(() => import("./intent-resolver-KBIH2KYC.mjs"));
|
|
18
|
+
var ReactSurface = lazy(() => import("./react-surface-2PI2KNSU.mjs"));
|
|
19
19
|
|
|
20
20
|
// packages/plugins/plugin-chess/src/ChessPlugin.tsx
|
|
21
21
|
import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from "@dxos/app-framework";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChessAction,
|
|
3
3
|
ChessType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NNA3W3LX.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts
|
|
7
7
|
import { Chess } from "chess.js";
|
|
@@ -25,4 +25,4 @@ var intent_resolver_default = () => contributes(Capabilities.IntentResolver, cre
|
|
|
25
25
|
export {
|
|
26
26
|
intent_resolver_default as default
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=intent-resolver-
|
|
28
|
+
//# sourceMappingURL=intent-resolver-KBIH2KYC.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2700,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2089,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":3051,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":586,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytes":17463,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":2748,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytes":4522,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytes":8761,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":3335,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":908,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":3926,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"../components/ChessComponent"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1365,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","kind":"dynamic-import","original":"./artifact-definition"},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1825,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":7895,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":790,"imports":[{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5064},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-R26FYVUS.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.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-AEIQ7Z36.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-VPK5QRXH.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-ITP4OMBZ.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","ChessComponent","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":273},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1623},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":325}},"bytes":2825},"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-GKM6RRDX.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-AEIQ7Z36.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7596},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-AEIQ7Z36.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytesInOutput":5487}},"bytes":5739},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-VPK5QRXH.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1374},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-VPK5QRXH.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":511}},"bytes":751},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-XERPODLK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6188},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-XERPODLK.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":811},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":3472},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-ITP4OMBZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1850},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-ITP4OMBZ.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-R26FYVUS.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.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-R26FYVUS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/browser/chunk-R26FYVUS.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-XERPODLK.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-GKM6RRDX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3767},"packages/plugins/plugin-chess/dist/lib/browser/chunk-GKM6RRDX.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","ChessType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":501},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":613},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":1966},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2436},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs":{"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"exports":["ChessComponent"],"inputs":{"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytesInOutput":990}},"bytes":1131}}}
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2089,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2700,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":3051,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":586,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytes":18402,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":2748,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytes":4522,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytes":8761,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":3335,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":908,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":3926,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"../components/ChessComponent"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1365,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","kind":"dynamic-import","original":"./artifact-definition"},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1825,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":7895,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":790,"imports":[{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5064},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-R26FYVUS.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-NNA3W3LX.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-D2SD45UX.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-KBIH2KYC.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-2PI2KNSU.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","ChessComponent","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":273},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1623},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":325}},"bytes":2825},"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-NNA3W3LX.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-D2SD45UX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8015},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-D2SD45UX.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-NNA3W3LX.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytesInOutput":5714}},"bytes":5974},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-KBIH2KYC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1374},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-KBIH2KYC.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-NNA3W3LX.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":511}},"bytes":751},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-XERPODLK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6188},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-XERPODLK.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":811},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":3472},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-2PI2KNSU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1850},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-2PI2KNSU.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-R26FYVUS.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-NNA3W3LX.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-R26FYVUS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/browser/chunk-R26FYVUS.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-XERPODLK.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-NNA3W3LX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3767},"packages/plugins/plugin-chess/dist/lib/browser/chunk-NNA3W3LX.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","ChessType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":501},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":613},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":1966},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2436},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs":{"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"exports":["ChessComponent"],"inputs":{"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytesInOutput":990}},"bytes":1131}}}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
CHESS_PLUGIN,
|
|
6
6
|
ChessType,
|
|
7
7
|
isObject
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NNA3W3LX.mjs";
|
|
9
9
|
import {
|
|
10
10
|
ChessComponent
|
|
11
11
|
} from "./chunk-VRWXC5L2.mjs";
|
|
@@ -39,4 +39,4 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
|
39
39
|
export {
|
|
40
40
|
react_surface_default as default
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=react-surface-
|
|
42
|
+
//# sourceMappingURL=react-surface-2PI2KNSU.mjs.map
|
|
@@ -16,12 +16,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var artifact_definition_YDPYM4NV_exports = {};
|
|
20
|
+
__export(artifact_definition_YDPYM4NV_exports, {
|
|
21
21
|
default: () => artifact_definition_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(artifact_definition_YDPYM4NV_exports);
|
|
24
|
+
var import_chunk_VXYRI6VA = require("./chunk-VXYRI6VA.cjs");
|
|
25
25
|
var import_chess = require("chess.js");
|
|
26
26
|
var import_effect = require("effect");
|
|
27
27
|
var import_app_framework = require("@dxos/app-framework");
|
|
@@ -34,16 +34,18 @@ var import_echo = require("@dxos/react-client/echo");
|
|
|
34
34
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts";
|
|
35
35
|
var artifact_definition_default = () => {
|
|
36
36
|
const definition = (0, import_artifact.defineArtifact)({
|
|
37
|
-
id:
|
|
37
|
+
id: import_chunk_VXYRI6VA.meta.id,
|
|
38
|
+
name: import_chunk_VXYRI6VA.meta.name,
|
|
39
|
+
description: "Provides a simple chess engine.",
|
|
38
40
|
instructions: `
|
|
39
|
-
Chess:
|
|
40
41
|
- 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.
|
|
41
42
|
`,
|
|
42
|
-
schema:
|
|
43
|
+
schema: import_chunk_VXYRI6VA.ChessType,
|
|
43
44
|
tools: [
|
|
44
|
-
(0, import_artifact.defineTool)({
|
|
45
|
-
name: "
|
|
45
|
+
(0, import_artifact.defineTool)(import_chunk_VXYRI6VA.meta.id, {
|
|
46
|
+
name: "create",
|
|
46
47
|
description: "Create a new chess game. Returns the artifact definition for the game.",
|
|
48
|
+
caption: "Creating chess game...",
|
|
47
49
|
schema: import_echo_schema.S.Struct({
|
|
48
50
|
fen: import_echo_schema.S.String.annotations({
|
|
49
51
|
description: "The state of the chess game in the FEN format."
|
|
@@ -52,7 +54,7 @@ var artifact_definition_default = () => {
|
|
|
52
54
|
execute: async ({ fen }, { extensions }) => {
|
|
53
55
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
54
56
|
F: __dxlog_file,
|
|
55
|
-
L:
|
|
57
|
+
L: 45,
|
|
56
58
|
S: void 0,
|
|
57
59
|
A: [
|
|
58
60
|
"extensions?.space",
|
|
@@ -61,14 +63,14 @@ var artifact_definition_default = () => {
|
|
|
61
63
|
});
|
|
62
64
|
(0, import_invariant.invariant)(extensions?.dispatch, "No intent dispatcher", {
|
|
63
65
|
F: __dxlog_file,
|
|
64
|
-
L:
|
|
66
|
+
L: 46,
|
|
65
67
|
S: void 0,
|
|
66
68
|
A: [
|
|
67
69
|
"extensions?.dispatch",
|
|
68
70
|
"'No intent dispatcher'"
|
|
69
71
|
]
|
|
70
72
|
});
|
|
71
|
-
const intent = (0, import_effect.pipe)((0, import_app_framework.createIntent)(
|
|
73
|
+
const intent = (0, import_effect.pipe)((0, import_app_framework.createIntent)(import_chunk_VXYRI6VA.ChessAction.Create, {
|
|
72
74
|
fen
|
|
73
75
|
}), (0, import_app_framework.chain)(import_types.SpaceAction.AddObject, {
|
|
74
76
|
target: extensions.space
|
|
@@ -80,24 +82,25 @@ var artifact_definition_default = () => {
|
|
|
80
82
|
return import_artifact.ToolResult.Success((0, import_assistant.createArtifactElement)(data.id));
|
|
81
83
|
}
|
|
82
84
|
}),
|
|
83
|
-
(0, import_artifact.defineTool)({
|
|
84
|
-
name: "
|
|
85
|
+
(0, import_artifact.defineTool)(import_chunk_VXYRI6VA.meta.id, {
|
|
86
|
+
name: "list",
|
|
85
87
|
description: "Query all active chess games.",
|
|
88
|
+
caption: "Getting games...",
|
|
86
89
|
schema: import_echo_schema.S.Struct({}),
|
|
87
90
|
execute: async (_, { extensions }) => {
|
|
88
91
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
89
92
|
F: __dxlog_file,
|
|
90
|
-
L:
|
|
93
|
+
L: 65,
|
|
91
94
|
S: void 0,
|
|
92
95
|
A: [
|
|
93
96
|
"extensions?.space",
|
|
94
97
|
"'No space'"
|
|
95
98
|
]
|
|
96
99
|
});
|
|
97
|
-
const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(
|
|
100
|
+
const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(import_chunk_VXYRI6VA.ChessType)).run();
|
|
98
101
|
(0, import_invariant.invariant)(games.length > 0, "No chess games found", {
|
|
99
102
|
F: __dxlog_file,
|
|
100
|
-
L:
|
|
103
|
+
L: 67,
|
|
101
104
|
S: void 0,
|
|
102
105
|
A: [
|
|
103
106
|
"games.length > 0",
|
|
@@ -107,27 +110,28 @@ var artifact_definition_default = () => {
|
|
|
107
110
|
return import_artifact.ToolResult.Success(games);
|
|
108
111
|
}
|
|
109
112
|
}),
|
|
110
|
-
(0, import_artifact.defineTool)({
|
|
111
|
-
name: "
|
|
113
|
+
(0, import_artifact.defineTool)(import_chunk_VXYRI6VA.meta.id, {
|
|
114
|
+
name: "inspect",
|
|
112
115
|
description: "Get the current state of the chess game.",
|
|
116
|
+
caption: "Inspecting game...",
|
|
113
117
|
schema: import_echo_schema.S.Struct({
|
|
114
118
|
id: import_echo_schema.ObjectId
|
|
115
119
|
}),
|
|
116
120
|
execute: async ({ id }, { extensions }) => {
|
|
117
121
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
118
122
|
F: __dxlog_file,
|
|
119
|
-
L:
|
|
123
|
+
L: 77,
|
|
120
124
|
S: void 0,
|
|
121
125
|
A: [
|
|
122
126
|
"extensions?.space",
|
|
123
127
|
"'No space'"
|
|
124
128
|
]
|
|
125
129
|
});
|
|
126
|
-
const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(
|
|
130
|
+
const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(import_chunk_VXYRI6VA.ChessType)).run();
|
|
127
131
|
const game = games.find((game2) => game2.id === id);
|
|
128
|
-
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(
|
|
132
|
+
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_VXYRI6VA.ChessType, game), void 0, {
|
|
129
133
|
F: __dxlog_file,
|
|
130
|
-
L:
|
|
134
|
+
L: 80,
|
|
131
135
|
S: void 0,
|
|
132
136
|
A: [
|
|
133
137
|
"isInstanceOf(ChessType, game)",
|
|
@@ -137,9 +141,10 @@ var artifact_definition_default = () => {
|
|
|
137
141
|
return import_artifact.ToolResult.Success(game.fen);
|
|
138
142
|
}
|
|
139
143
|
}),
|
|
140
|
-
(0, import_artifact.defineTool)({
|
|
141
|
-
name: "
|
|
144
|
+
(0, import_artifact.defineTool)(import_chunk_VXYRI6VA.meta.id, {
|
|
145
|
+
name: "move",
|
|
142
146
|
description: "Make a move in the chess game.",
|
|
147
|
+
caption: "Making chess move...",
|
|
143
148
|
schema: import_echo_schema.S.Struct({
|
|
144
149
|
id: import_echo_schema.ObjectId,
|
|
145
150
|
move: import_echo_schema.S.String.annotations({
|
|
@@ -153,18 +158,18 @@ var artifact_definition_default = () => {
|
|
|
153
158
|
execute: async ({ id, move }, { extensions }) => {
|
|
154
159
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
155
160
|
F: __dxlog_file,
|
|
156
|
-
L:
|
|
161
|
+
L: 96,
|
|
157
162
|
S: void 0,
|
|
158
163
|
A: [
|
|
159
164
|
"extensions?.space",
|
|
160
165
|
"'No space'"
|
|
161
166
|
]
|
|
162
167
|
});
|
|
163
|
-
const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(
|
|
168
|
+
const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(import_chunk_VXYRI6VA.ChessType)).run();
|
|
164
169
|
const game = games.find((game2) => game2.id === id);
|
|
165
|
-
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(
|
|
170
|
+
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_VXYRI6VA.ChessType, game), void 0, {
|
|
166
171
|
F: __dxlog_file,
|
|
167
|
-
L:
|
|
172
|
+
L: 99,
|
|
168
173
|
S: void 0,
|
|
169
174
|
A: [
|
|
170
175
|
"isInstanceOf(ChessType, game)",
|
|
@@ -186,4 +191,4 @@ var artifact_definition_default = () => {
|
|
|
186
191
|
});
|
|
187
192
|
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.ArtifactDefinition, definition);
|
|
188
193
|
};
|
|
189
|
-
//# sourceMappingURL=artifact-definition-
|
|
194
|
+
//# sourceMappingURL=artifact-definition-YDPYM4NV.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 } from 'effect';\n\nimport { Capabilities, chain, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement } from '@dxos/assistant';\nimport { isInstanceOf, ObjectId, S } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter, type Space } from '@dxos/react-client/echo';\n\nimport { 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: 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 `,\n schema: ChessType,\n tools: [\n defineTool(meta.id, {\n name: 'create',\n description: 'Create a new chess game. Returns the artifact definition for the game.',\n caption: 'Creating chess game...',\n schema: S.Struct({\n fen: S.String.annotations({ description: 'The state of the chess game in the FEN format.' }),\n }),\n execute: async ({ fen }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n const intent = pipe(\n createIntent(ChessAction.Create, { fen }),\n chain(SpaceAction.AddObject, { target: extensions.space }),\n );\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create chess game');\n }\n\n return ToolResult.Success(createArtifactElement(data.id));\n },\n }),\n defineTool(meta.id, {\n name: 'list',\n description: 'Query all active chess games.',\n caption: 'Getting games...',\n schema: S.Struct({}),\n execute: async (_, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n invariant(games.length > 0, 'No chess games found');\n return ToolResult.Success(games);\n },\n }),\n defineTool(meta.id, {\n name: 'inspect',\n description: 'Get the current state of the chess game.',\n caption: 'Inspecting game...',\n schema: S.Struct({ id: ObjectId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n return ToolResult.Success(game.fen);\n },\n }),\n defineTool(meta.id, {\n name: 'move',\n description: 'Make a move in the chess game.',\n caption: 'Making chess move...',\n schema: S.Struct({\n id: ObjectId,\n move: S.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n execute: async ({ id, move }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();\n const game = games.find((game) => game.id === id);\n invariant(isInstanceOf(ChessType, game));\n const board = new Chess(game.fen);\n try {\n board.move(move);\n } catch (error: any) {\n return ToolResult.Error(error.message);\n }\n game.pgn = board.pgn();\n game.fen = board.fen();\n return ToolResult.Success(game.fen);\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MAAMqB,GAAGC,MAAMC,mBAAOpC,OAAOC,+BAAAA,CAAAA,EAAYoC,IAAG;AACxF,gBAAMG,OAAOP,MAAMQ,KAAK,CAACD,UAASA,MAAK7C,OAAOA,EAAAA;AAC9CiB,8CAAU8B,iCAAazC,iCAAWuC,IAAAA,GAAAA,QAAAA;;;;;;;;;AAClC,gBAAMK,QAAQ,IAAIC,mBAAMN,KAAKjC,GAAG;AAChC,cAAI;AACFsC,kBAAMF,KAAKA,IAAAA;UACb,SAASlB,OAAY;AACnB,mBAAOC,2BAAWC,MAAMF,MAAMG,OAAO;UACvC;AACAY,eAAKO,MAAMF,MAAME,IAAG;AACpBP,eAAKjC,MAAMsC,MAAMtC,IAAG;AACpB,iBAAOmB,2BAAWG,QAAQW,KAAKjC,GAAG;QACpC;MACF,CAAA;;EAEJ,CAAA;AAEA,aAAOyC,kCAAYC,kCAAaC,oBAAoBzD,UAAAA;AACtD;",
|
|
6
|
+
"names": ["definition", "defineArtifact", "id", "meta", "name", "description", "instructions", "schema", "ChessType", "tools", "defineTool", "caption", "S", "Struct", "fen", "String", "annotations", "execute", "extensions", "invariant", "space", "dispatch", "intent", "pipe", "createIntent", "ChessAction", "Create", "chain", "SpaceAction", "AddObject", "target", "data", "error", "ToolResult", "Error", "message", "Success", "createArtifactElement", "_", "objects", "games", "db", "query", "Filter", "run", "length", "ObjectId", "game", "find", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
+
}
|
|
@@ -16,8 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_VXYRI6VA_exports = {};
|
|
20
|
+
__export(chunk_VXYRI6VA_exports, {
|
|
21
21
|
CHESS_PLUGIN: () => CHESS_PLUGIN,
|
|
22
22
|
ChessAction: () => ChessAction,
|
|
23
23
|
ChessType: () => ChessType,
|
|
@@ -25,7 +25,7 @@ __export(chunk_3TTH3HKL_exports, {
|
|
|
25
25
|
isObject: () => isObject,
|
|
26
26
|
meta: () => meta
|
|
27
27
|
});
|
|
28
|
-
module.exports = __toCommonJS(
|
|
28
|
+
module.exports = __toCommonJS(chunk_VXYRI6VA_exports);
|
|
29
29
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
30
30
|
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
31
31
|
var import_live_object = require("@dxos/live-object");
|
|
@@ -87,4 +87,4 @@ var isObject = (object) => {
|
|
|
87
87
|
isObject,
|
|
88
88
|
meta
|
|
89
89
|
});
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-VXYRI6VA.cjs.map
|