@dxos/plugin-chess 0.8.3-main.672df60 → 0.8.3-main.7f5a14c
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-QYGM7HNY.mjs → artifact-definition-YPUHGTNQ.mjs} +11 -11
- package/dist/lib/browser/artifact-definition-YPUHGTNQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-77TLTU3X.mjs → chunk-VLJW6CSJ.mjs} +3 -6
- package/dist/lib/browser/chunk-VLJW6CSJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +4 -4
- package/dist/lib/browser/{intent-resolver-FLV47FUV.mjs → intent-resolver-BLCMAATK.mjs} +4 -4
- package/dist/lib/browser/intent-resolver-BLCMAATK.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-QW2WGAAJ.mjs → react-surface-SXCEZFFA.mjs} +4 -4
- package/dist/lib/browser/react-surface-SXCEZFFA.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{artifact-definition-FRBMG5FU.cjs → artifact-definition-NB3UJZW5.cjs} +26 -26
- package/dist/lib/node/artifact-definition-NB3UJZW5.cjs.map +7 -0
- package/dist/lib/node/{chunk-33WBRZI6.cjs → chunk-WKE4BDBM.cjs} +6 -9
- package/dist/lib/node/chunk-WKE4BDBM.cjs.map +7 -0
- package/dist/lib/node/index.cjs +18 -18
- package/dist/lib/node/{intent-resolver-AKAIXSZF.cjs → intent-resolver-3XW3UFRT.cjs} +8 -8
- package/dist/lib/node/intent-resolver-3XW3UFRT.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-7G7NV4FY.cjs → react-surface-3VDR3PZL.cjs} +9 -9
- package/dist/lib/node/react-surface-3VDR3PZL.cjs.map +7 -0
- 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-YKVCYZQ7.mjs → artifact-definition-476UKUXU.mjs} +11 -11
- package/dist/lib/node-esm/artifact-definition-476UKUXU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WPCT7LRN.mjs → chunk-QSYDZOTP.mjs} +3 -6
- package/dist/lib/node-esm/chunk-QSYDZOTP.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +4 -4
- package/dist/lib/node-esm/{intent-resolver-VK3EDUMM.mjs → intent-resolver-H5CEOC2U.mjs} +4 -4
- package/dist/lib/node-esm/intent-resolver-H5CEOC2U.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-Y54QUEUA.mjs → react-surface-G7U53SFD.mjs} +4 -4
- package/dist/lib/node-esm/react-surface-G7U53SFD.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +10 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +23 -23
- package/src/capabilities/artifact-definition.ts +4 -3
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/capabilities/react-surface.tsx +2 -2
- package/src/types/schema.ts +4 -1
- package/src/types/types.ts +2 -5
- package/dist/lib/browser/artifact-definition-QYGM7HNY.mjs.map +0 -7
- package/dist/lib/browser/chunk-77TLTU3X.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-FLV47FUV.mjs.map +0 -7
- package/dist/lib/browser/react-surface-QW2WGAAJ.mjs.map +0 -7
- package/dist/lib/node/artifact-definition-FRBMG5FU.cjs.map +0 -7
- package/dist/lib/node/chunk-33WBRZI6.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-AKAIXSZF.cjs.map +0 -7
- package/dist/lib/node/react-surface-7G7NV4FY.cjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-YKVCYZQ7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WPCT7LRN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-VK3EDUMM.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-Y54QUEUA.mjs.map +0 -7
package/dist/lib/browser/{artifact-definition-QYGM7HNY.mjs → artifact-definition-YPUHGTNQ.mjs}
RENAMED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
ChessAction,
|
|
3
3
|
ChessType,
|
|
4
4
|
meta
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VLJW6CSJ.mjs";
|
|
6
6
|
|
|
7
7
|
// packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts
|
|
8
8
|
import { Chess } from "chess.js";
|
|
@@ -11,7 +11,7 @@ import { createTool, ToolResult } from "@dxos/ai";
|
|
|
11
11
|
import { Capabilities, chain, contributes, createIntent } from "@dxos/app-framework";
|
|
12
12
|
import { ArtifactId, defineArtifact } from "@dxos/artifact";
|
|
13
13
|
import { createArtifactElement, VersionPin } from "@dxos/assistant";
|
|
14
|
-
import {
|
|
14
|
+
import { Obj } from "@dxos/echo";
|
|
15
15
|
import { invariant } from "@dxos/invariant";
|
|
16
16
|
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
17
17
|
import { Filter } from "@dxos/react-client/echo";
|
|
@@ -107,7 +107,7 @@ var artifact_definition_default = () => {
|
|
|
107
107
|
execute: async ({ id }, { extensions }) => {
|
|
108
108
|
invariant(extensions?.space, "No space", {
|
|
109
109
|
F: __dxlog_file,
|
|
110
|
-
L:
|
|
110
|
+
L: 82,
|
|
111
111
|
S: void 0,
|
|
112
112
|
A: [
|
|
113
113
|
"extensions?.space",
|
|
@@ -115,12 +115,12 @@ var artifact_definition_default = () => {
|
|
|
115
115
|
]
|
|
116
116
|
});
|
|
117
117
|
const game = await extensions.space.db.query(Filter.ids(ArtifactId.toDXN(id, extensions.space.id).toString())).first();
|
|
118
|
-
invariant(
|
|
118
|
+
invariant(Obj.instanceOf(ChessType, game), void 0, {
|
|
119
119
|
F: __dxlog_file,
|
|
120
|
-
L:
|
|
120
|
+
L: 86,
|
|
121
121
|
S: void 0,
|
|
122
122
|
A: [
|
|
123
|
-
"
|
|
123
|
+
"Obj.instanceOf(ChessType, game)",
|
|
124
124
|
""
|
|
125
125
|
]
|
|
126
126
|
});
|
|
@@ -144,7 +144,7 @@ var artifact_definition_default = () => {
|
|
|
144
144
|
execute: async ({ id, move }, { extensions }) => {
|
|
145
145
|
invariant(extensions?.space, "No space", {
|
|
146
146
|
F: __dxlog_file,
|
|
147
|
-
L:
|
|
147
|
+
L: 103,
|
|
148
148
|
S: void 0,
|
|
149
149
|
A: [
|
|
150
150
|
"extensions?.space",
|
|
@@ -152,12 +152,12 @@ var artifact_definition_default = () => {
|
|
|
152
152
|
]
|
|
153
153
|
});
|
|
154
154
|
const game = await extensions.space.db.query(Filter.ids(ArtifactId.toDXN(id, extensions.space.id).toString())).first();
|
|
155
|
-
invariant(
|
|
155
|
+
invariant(Obj.instanceOf(ChessType, game), void 0, {
|
|
156
156
|
F: __dxlog_file,
|
|
157
|
-
L:
|
|
157
|
+
L: 107,
|
|
158
158
|
S: void 0,
|
|
159
159
|
A: [
|
|
160
|
-
"
|
|
160
|
+
"Obj.instanceOf(ChessType, game)",
|
|
161
161
|
""
|
|
162
162
|
]
|
|
163
163
|
});
|
|
@@ -179,4 +179,4 @@ var artifact_definition_default = () => {
|
|
|
179
179
|
export {
|
|
180
180
|
artifact_definition_default as default
|
|
181
181
|
};
|
|
182
|
-
//# sourceMappingURL=artifact-definition-
|
|
182
|
+
//# sourceMappingURL=artifact-definition-YPUHGTNQ.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, 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;;;;I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AAME,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
|
+
}
|
|
@@ -24,8 +24,7 @@ var ChessType = class extends TypedObject({
|
|
|
24
24
|
|
|
25
25
|
// packages/plugins/plugin-chess/src/types/types.ts
|
|
26
26
|
import { Schema as Schema2 } from "effect";
|
|
27
|
-
import {
|
|
28
|
-
import { isLiveObject } from "@dxos/live-object";
|
|
27
|
+
import { Obj } from "@dxos/echo";
|
|
29
28
|
|
|
30
29
|
// packages/plugins/plugin-chess/src/meta.ts
|
|
31
30
|
var CHESS_PLUGIN = "dxos.org/plugin/chess";
|
|
@@ -55,9 +54,7 @@ var meta = {
|
|
|
55
54
|
}
|
|
56
55
|
ChessAction2.Create = Create;
|
|
57
56
|
})(ChessAction || (ChessAction = {}));
|
|
58
|
-
var isObject = (
|
|
59
|
-
return isLiveObject(object) && isInstanceOf(ChessType, object);
|
|
60
|
-
};
|
|
57
|
+
var isObject = Obj.instanceOf(ChessType);
|
|
61
58
|
var ChessAction;
|
|
62
59
|
|
|
63
60
|
export {
|
|
@@ -68,4 +65,4 @@ export {
|
|
|
68
65
|
isObject,
|
|
69
66
|
ChessAction
|
|
70
67
|
};
|
|
71
|
-
//# sourceMappingURL=chunk-
|
|
68
|
+
//# sourceMappingURL=chunk-VLJW6CSJ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 { TypedObject } from '@dxos/echo-schema';\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 class ChessType extends TypedObject({\n typename: 'dxos.org/type/Chess',\n version: '0.1.0',\n})(\n {\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 },\n { partial: true },\n) {}\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,mBAAmB;AAErB,IAAMC,aAAaC,OAAOC,QAC/BD,OAAOE,QACLF,OAAOG,OAAO;EACZC,QAAQJ,OAAOK;EACfC,QAAQN,OAAOK;EACfE,OAAOP,OAAOK;AAChB,CAAA,CAAA,CAAA;AAIG,IAAMG,YAAN,cAAwBC,YAAY;EACzCC,UAAU;EACVC,SAAS;AACX,CAAA,EACE;EACEC,MAAMZ,OAAOa,SAASb,OAAOK,MAAM;EACnCS,aAAad,OAAOK;EACpBU,aAAaf,OAAOK;EACpBW,OAAOhB,OAAOC,QAAQD,OAAOiB,MAAMjB,OAAOK,MAAM,CAAA;;EAEhDa,KAAKlB,OAAOK;EACZc,KAAKnB,OAAOK;AACd,GACA;EAAEH,SAAS;AAAK,CAAA,EAAA;AACf;;;AC5BH,SAASkB,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", "TypedObject", "MoveSchema", "Schema", "mutable", "partial", "Struct", "source", "String", "target", "piece", "ChessType", "TypedObject", "typename", "version", "name", "optional", "playerWhite", "playerBlack", "moves", "Array", "pgn", "fen", "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
|
+
}
|
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
ChessAction,
|
|
7
7
|
ChessType,
|
|
8
8
|
meta
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VLJW6CSJ.mjs";
|
|
10
10
|
import {
|
|
11
11
|
ChessComponent
|
|
12
12
|
} from "./chunk-6XPI4FTK.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-YPUHGTNQ.mjs"));
|
|
17
|
+
var IntentResolver = lazy(() => import("./intent-resolver-BLCMAATK.mjs"));
|
|
18
|
+
var ReactSurface = lazy(() => import("./react-surface-SXCEZFFA.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,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChessAction,
|
|
3
3
|
ChessType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VLJW6CSJ.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts
|
|
7
7
|
import { Chess } from "chess.js";
|
|
8
8
|
import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
|
|
9
|
-
import {
|
|
9
|
+
import { Obj } from "@dxos/echo";
|
|
10
10
|
var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
|
|
11
11
|
intent: ChessAction.Create,
|
|
12
12
|
resolve: ({ name, fen }) => {
|
|
13
13
|
const pgn = fen ? new Chess(fen).pgn() : void 0;
|
|
14
14
|
return {
|
|
15
15
|
data: {
|
|
16
|
-
object:
|
|
16
|
+
object: Obj.make(ChessType, {
|
|
17
17
|
name,
|
|
18
18
|
fen,
|
|
19
19
|
pgn
|
|
@@ -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-BLCMAATK.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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,SAASA,aAAa;AAEtB,SAASC,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,WAAW;AAIpB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,YAAYC;EACpBC,SAAS,CAAC,EAAEC,MAAMC,IAAG,MAAE;AACrB,UAAMC,MAAMD,MAAM,IAAIE,MAAMF,GAAAA,EAAKC,IAAG,IAAKE;AACzC,WAAO;MACLC,MAAM;QACJC,QAAQC,IAAIC,KAAKC,WAAW;UAAET;UAAMC;UAAKC;QAAI,CAAA;MAC/C;IACF;EACF;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["Chess", "Capabilities", "contributes", "createResolver", "Obj", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ChessAction", "Create", "resolve", "name", "fen", "pgn", "Chess", "undefined", "data", "object", "Obj", "make", "ChessType"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2033,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2921,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":3132,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":554,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytes":19066,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":2680,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytes":5508,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytes":9084,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":3431,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":872,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":3858,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"../components/ChessComponent"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1329,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","kind":"dynamic-import","original":"./artifact-definition"},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1642,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":7256,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":754,"imports":[{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4837},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-QYGM7HNY.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FLV47FUV.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-QW2WGAAJ.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","ChessComponent","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":273},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1500},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":282}},"bytes":2659},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"}],"exports":["ChessAction","ChessType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":194},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-QYGM7HNY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8482},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-QYGM7HNY.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytesInOutput":5964}},"bytes":6224},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FLV47FUV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1366},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-FLV47FUV.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":507}},"bytes":747},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-S72CLKGK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6167},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-S72CLKGK.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":978},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2608}},"bytes":3948},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-QW2WGAAJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1850},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-QW2WGAAJ.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytesInOutput":745}},"bytes":1107},"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-S72CLKGK.mjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":235},"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3966},"packages/plugins/plugin-chess/dist/lib/browser/chunk-77TLTU3X.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","ChessType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":606},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":675},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":2133},"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2588},"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"exports":["ChessComponent"],"inputs":{"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytesInOutput":1601}},"bytes":1742}}}
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2033,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2933,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":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":1642,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":7256,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":754,"imports":[{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4837},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VLJW6CSJ.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-YPUHGTNQ.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-BLCMAATK.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-SXCEZFFA.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","ChessComponent","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":273},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1500},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":282}},"bytes":2659},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VLJW6CSJ.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-YPUHGTNQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8478},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-YPUHGTNQ.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VLJW6CSJ.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo","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/browser/intent-resolver-BLCMAATK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1374},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-BLCMAATK.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VLJW6CSJ.mjs","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/browser/ChessContainer-S72CLKGK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6167},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-S72CLKGK.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":978},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2608}},"bytes":3948},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-SXCEZFFA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1789},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-SXCEZFFA.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VLJW6CSJ.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","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/browser/chunk-5QBQW62M.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/browser/chunk-5QBQW62M.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-S72CLKGK.mjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":235},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VLJW6CSJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3706},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VLJW6CSJ.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","ChessType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":606},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":553},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":2011},"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2588},"packages/plugins/plugin-chess/dist/lib/browser/chunk-6XPI4FTK.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"exports":["ChessComponent"],"inputs":{"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytesInOutput":1601}},"bytes":1742}}}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
CHESS_PLUGIN,
|
|
6
6
|
ChessType,
|
|
7
7
|
isObject
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VLJW6CSJ.mjs";
|
|
9
9
|
import {
|
|
10
10
|
ChessComponent
|
|
11
11
|
} from "./chunk-6XPI4FTK.mjs";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
// packages/plugins/plugin-chess/src/capabilities/react-surface.tsx
|
|
14
14
|
import React from "react";
|
|
15
15
|
import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
|
|
16
|
-
import {
|
|
16
|
+
import { Obj } from "@dxos/echo";
|
|
17
17
|
var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
18
18
|
createSurface({
|
|
19
19
|
id: CHESS_PLUGIN,
|
|
@@ -30,7 +30,7 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, [
|
|
|
30
30
|
createSurface({
|
|
31
31
|
id: "plugin-chess",
|
|
32
32
|
role: "canvas-node",
|
|
33
|
-
filter: (
|
|
33
|
+
filter: Obj.instanceOf(ChessType),
|
|
34
34
|
component: ({ data }) => /* @__PURE__ */ React.createElement(ChessComponent, {
|
|
35
35
|
game: data
|
|
36
36
|
})
|
|
@@ -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-SXCEZFFA.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -16,35 +16,35 @@ 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_NB3UJZW5_exports = {};
|
|
20
|
+
__export(artifact_definition_NB3UJZW5_exports, {
|
|
21
21
|
default: () => artifact_definition_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(artifact_definition_NB3UJZW5_exports);
|
|
24
|
+
var import_chunk_WKE4BDBM = require("./chunk-WKE4BDBM.cjs");
|
|
25
25
|
var import_chess = require("chess.js");
|
|
26
26
|
var import_effect = require("effect");
|
|
27
27
|
var import_ai = require("@dxos/ai");
|
|
28
28
|
var import_app_framework = require("@dxos/app-framework");
|
|
29
29
|
var import_artifact = require("@dxos/artifact");
|
|
30
30
|
var import_assistant = require("@dxos/assistant");
|
|
31
|
-
var
|
|
31
|
+
var import_echo = require("@dxos/echo");
|
|
32
32
|
var import_invariant = require("@dxos/invariant");
|
|
33
33
|
var import_types = require("@dxos/plugin-space/types");
|
|
34
|
-
var
|
|
34
|
+
var import_echo2 = require("@dxos/react-client/echo");
|
|
35
35
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts";
|
|
36
36
|
var artifact_definition_default = () => {
|
|
37
37
|
const definition = (0, import_artifact.defineArtifact)({
|
|
38
|
-
id: `artifact:${
|
|
39
|
-
name:
|
|
38
|
+
id: `artifact:${import_chunk_WKE4BDBM.meta.id}`,
|
|
39
|
+
name: import_chunk_WKE4BDBM.meta.name,
|
|
40
40
|
description: "Provides a simple chess engine.",
|
|
41
41
|
instructions: `
|
|
42
42
|
- If the user's message relates to a chess game, you must return the chess game inside the artifact tag as a valid FEN string with no additional text.
|
|
43
43
|
- Always inspect the chess game at the start of every prompt realting to a chess game, as it might have changed since the interaction.
|
|
44
44
|
`,
|
|
45
|
-
schema:
|
|
45
|
+
schema: import_chunk_WKE4BDBM.ChessType,
|
|
46
46
|
tools: [
|
|
47
|
-
(0, import_ai.createTool)(
|
|
47
|
+
(0, import_ai.createTool)(import_chunk_WKE4BDBM.meta.id, {
|
|
48
48
|
name: "create",
|
|
49
49
|
description: "Create a new chess game. Returns the artifact definition for the game.",
|
|
50
50
|
caption: "Creating chess game...",
|
|
@@ -72,7 +72,7 @@ var artifact_definition_default = () => {
|
|
|
72
72
|
"'No intent dispatcher'"
|
|
73
73
|
]
|
|
74
74
|
});
|
|
75
|
-
const intent = (0, import_effect.pipe)((0, import_app_framework.createIntent)(
|
|
75
|
+
const intent = (0, import_effect.pipe)((0, import_app_framework.createIntent)(import_chunk_WKE4BDBM.ChessAction.Create, {
|
|
76
76
|
fen
|
|
77
77
|
}), (0, import_app_framework.chain)(import_types.SpaceAction.AddObject, {
|
|
78
78
|
target: extensions.space
|
|
@@ -86,7 +86,7 @@ var artifact_definition_default = () => {
|
|
|
86
86
|
]);
|
|
87
87
|
}
|
|
88
88
|
}),
|
|
89
|
-
(0, import_ai.createTool)(
|
|
89
|
+
(0, import_ai.createTool)(import_chunk_WKE4BDBM.meta.id, {
|
|
90
90
|
name: "list",
|
|
91
91
|
description: "Query all active chess games.",
|
|
92
92
|
caption: "Getting games...",
|
|
@@ -101,7 +101,7 @@ var artifact_definition_default = () => {
|
|
|
101
101
|
"'No space'"
|
|
102
102
|
]
|
|
103
103
|
});
|
|
104
|
-
const { objects: games } = await extensions.space.db.query(
|
|
104
|
+
const { objects: games } = await extensions.space.db.query(import_echo2.Filter.type(import_chunk_WKE4BDBM.ChessType)).run();
|
|
105
105
|
(0, import_invariant.invariant)(games.length > 0, "No chess games found", {
|
|
106
106
|
F: __dxlog_file,
|
|
107
107
|
L: 71,
|
|
@@ -114,7 +114,7 @@ var artifact_definition_default = () => {
|
|
|
114
114
|
return import_ai.ToolResult.Success(games);
|
|
115
115
|
}
|
|
116
116
|
}),
|
|
117
|
-
(0, import_ai.createTool)(
|
|
117
|
+
(0, import_ai.createTool)(import_chunk_WKE4BDBM.meta.id, {
|
|
118
118
|
name: "inspect",
|
|
119
119
|
description: "Get the current state of the chess game.",
|
|
120
120
|
caption: "Inspecting game...",
|
|
@@ -124,27 +124,27 @@ var artifact_definition_default = () => {
|
|
|
124
124
|
execute: async ({ id }, { extensions }) => {
|
|
125
125
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
126
126
|
F: __dxlog_file,
|
|
127
|
-
L:
|
|
127
|
+
L: 82,
|
|
128
128
|
S: void 0,
|
|
129
129
|
A: [
|
|
130
130
|
"extensions?.space",
|
|
131
131
|
"'No space'"
|
|
132
132
|
]
|
|
133
133
|
});
|
|
134
|
-
const game = await extensions.space.db.query(
|
|
135
|
-
(0, import_invariant.invariant)(
|
|
134
|
+
const game = await extensions.space.db.query(import_echo2.Filter.ids(import_artifact.ArtifactId.toDXN(id, extensions.space.id).toString())).first();
|
|
135
|
+
(0, import_invariant.invariant)(import_echo.Obj.instanceOf(import_chunk_WKE4BDBM.ChessType, game), void 0, {
|
|
136
136
|
F: __dxlog_file,
|
|
137
|
-
L:
|
|
137
|
+
L: 86,
|
|
138
138
|
S: void 0,
|
|
139
139
|
A: [
|
|
140
|
-
"
|
|
140
|
+
"Obj.instanceOf(ChessType, game)",
|
|
141
141
|
""
|
|
142
142
|
]
|
|
143
143
|
});
|
|
144
144
|
return import_ai.ToolResult.Success(game.fen);
|
|
145
145
|
}
|
|
146
146
|
}),
|
|
147
|
-
(0, import_ai.createTool)(
|
|
147
|
+
(0, import_ai.createTool)(import_chunk_WKE4BDBM.meta.id, {
|
|
148
148
|
name: "move",
|
|
149
149
|
description: "Make a move in the chess game.",
|
|
150
150
|
caption: "Making chess move...",
|
|
@@ -161,20 +161,20 @@ var artifact_definition_default = () => {
|
|
|
161
161
|
execute: async ({ id, move }, { extensions }) => {
|
|
162
162
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
163
163
|
F: __dxlog_file,
|
|
164
|
-
L:
|
|
164
|
+
L: 103,
|
|
165
165
|
S: void 0,
|
|
166
166
|
A: [
|
|
167
167
|
"extensions?.space",
|
|
168
168
|
"'No space'"
|
|
169
169
|
]
|
|
170
170
|
});
|
|
171
|
-
const game = await extensions.space.db.query(
|
|
172
|
-
(0, import_invariant.invariant)(
|
|
171
|
+
const game = await extensions.space.db.query(import_echo2.Filter.ids(import_artifact.ArtifactId.toDXN(id, extensions.space.id).toString())).first();
|
|
172
|
+
(0, import_invariant.invariant)(import_echo.Obj.instanceOf(import_chunk_WKE4BDBM.ChessType, game), void 0, {
|
|
173
173
|
F: __dxlog_file,
|
|
174
|
-
L:
|
|
174
|
+
L: 107,
|
|
175
175
|
S: void 0,
|
|
176
176
|
A: [
|
|
177
|
-
"
|
|
177
|
+
"Obj.instanceOf(ChessType, game)",
|
|
178
178
|
""
|
|
179
179
|
]
|
|
180
180
|
});
|
|
@@ -193,4 +193,4 @@ var artifact_definition_default = () => {
|
|
|
193
193
|
});
|
|
194
194
|
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.ArtifactDefinition, definition);
|
|
195
195
|
};
|
|
196
|
-
//# sourceMappingURL=artifact-definition-
|
|
196
|
+
//# sourceMappingURL=artifact-definition-NB3UJZW5.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/artifact-definition.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess } from 'chess.js';\nimport { pipe, Schema } from 'effect';\n\nimport { createTool, ToolResult } from '@dxos/ai';\nimport { Capabilities, chain, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { ArtifactId, defineArtifact } from '@dxos/artifact';\nimport { createArtifactElement, VersionPin } from '@dxos/assistant';\nimport { 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,mBAAsB;AACtB,oBAA6B;AAE7B,gBAAuC;AACvC,2BAA6F;AAC7F,sBAA2C;AAC3C,uBAAkD;AAClD,kBAAoB;AACpB,uBAA0B;AAC1B,mBAA4B;AAC5B,IAAAA,eAAmC;;AAanC,IAAA,8BAAe,MAAA;AACb,QAAMC,iBAAaC,gCAAe;IAChCC,IAAI,YAAYC,2BAAKD,EAAE;IACvBE,MAAMD,2BAAKC;IACXC,aAAa;IACbC,cAAc;;;;IAIdC,QAAQC;IACRC,OAAO;UACLC,sBAAWP,2BAAKD,IAAI;QAClBE,MAAM;QACNC,aAAa;QACbM,SAAS;QACTJ,QAAQK,qBAAOC,OAAO;UACpBC,KAAKF,qBAAOG,OAAOC,YAAY;YAAEX,aAAa;UAAiD,CAAA;QACjG,CAAA;QACAY,SAAS,OAAO,EAAEH,IAAG,GAAI,EAAEI,WAAU,MAAE;AACrCC,0CAAUD,YAAYE,OAAO,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"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
|
+
}
|
|
@@ -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_WKE4BDBM_exports = {};
|
|
20
|
+
__export(chunk_WKE4BDBM_exports, {
|
|
21
21
|
CHESS_PLUGIN: () => CHESS_PLUGIN,
|
|
22
22
|
ChessAction: () => ChessAction,
|
|
23
23
|
ChessType: () => ChessType,
|
|
@@ -25,12 +25,11 @@ __export(chunk_33WBRZI6_exports, {
|
|
|
25
25
|
isObject: () => isObject,
|
|
26
26
|
meta: () => meta
|
|
27
27
|
});
|
|
28
|
-
module.exports = __toCommonJS(
|
|
28
|
+
module.exports = __toCommonJS(chunk_WKE4BDBM_exports);
|
|
29
29
|
var import_effect = require("effect");
|
|
30
30
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
31
31
|
var import_effect2 = require("effect");
|
|
32
|
-
var
|
|
33
|
-
var import_live_object = require("@dxos/live-object");
|
|
32
|
+
var import_echo = require("@dxos/echo");
|
|
34
33
|
var MoveSchema = import_effect.Schema.mutable(import_effect.Schema.partial(import_effect.Schema.Struct({
|
|
35
34
|
source: import_effect.Schema.String,
|
|
36
35
|
target: import_effect.Schema.String,
|
|
@@ -76,9 +75,7 @@ var meta = {
|
|
|
76
75
|
}
|
|
77
76
|
ChessAction2.Create = Create;
|
|
78
77
|
})(ChessAction || (ChessAction = {}));
|
|
79
|
-
var isObject = (
|
|
80
|
-
return (0, import_live_object.isLiveObject)(object) && (0, import_echo_schema2.isInstanceOf)(ChessType, object);
|
|
81
|
-
};
|
|
78
|
+
var isObject = import_echo.Obj.instanceOf(ChessType);
|
|
82
79
|
var ChessAction;
|
|
83
80
|
// Annotate the CommonJS export names for ESM import in node:
|
|
84
81
|
0 && (module.exports = {
|
|
@@ -89,4 +86,4 @@ var ChessAction;
|
|
|
89
86
|
isObject,
|
|
90
87
|
meta
|
|
91
88
|
});
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-WKE4BDBM.cjs.map
|