@dxos/plugin-chess 0.8.2-main.f11618f → 0.8.2-staging.7ac8446
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-HTXW3AKR.mjs → artifact-definition-GHBVTO4Y.mjs} +12 -14
- package/dist/lib/browser/artifact-definition-GHBVTO4Y.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EIRRN4WP.mjs → chunk-4NJ4PMPW.mjs} +3 -3
- package/dist/lib/browser/{chunk-EIRRN4WP.mjs.map → chunk-4NJ4PMPW.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +4 -4
- package/dist/lib/browser/{intent-resolver-QECLUB7C.mjs → intent-resolver-JVLCHAJD.mjs} +4 -4
- package/dist/lib/browser/intent-resolver-JVLCHAJD.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-CMUAPVQA.mjs → react-surface-LZYVKHCU.mjs} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{artifact-definition-XRVEXVXI.cjs → artifact-definition-JDJAOTXF.cjs} +25 -27
- package/dist/lib/node/artifact-definition-JDJAOTXF.cjs.map +7 -0
- package/dist/lib/node/{chunk-SVNVQAMR.cjs → chunk-PQ64RGCS.cjs} +5 -5
- package/dist/lib/node/{chunk-SVNVQAMR.cjs.map → chunk-PQ64RGCS.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +18 -18
- package/dist/lib/node/{intent-resolver-JMO3PEBA.cjs → intent-resolver-IJXRCQA5.cjs} +7 -7
- package/dist/lib/node/intent-resolver-IJXRCQA5.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-GSLVN4KN.cjs → react-surface-JWVHHTQU.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-VPB2TSLQ.mjs → artifact-definition-CSY4I334.mjs} +12 -14
- package/dist/lib/node-esm/artifact-definition-CSY4I334.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WDC3FJ53.mjs → chunk-GLBZ7ZZD.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-WDC3FJ53.mjs.map → chunk-GLBZ7ZZD.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +4 -4
- package/dist/lib/node-esm/{intent-resolver-BDI3HVPZ.mjs → intent-resolver-AWNZCS56.mjs} +4 -4
- package/dist/lib/node-esm/intent-resolver-AWNZCS56.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-L5YMO5FM.mjs → react-surface-TQKBCMJU.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 +4 -10
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/types/types.ts +2 -2
- package/dist/lib/browser/artifact-definition-HTXW3AKR.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-QECLUB7C.mjs.map +0 -7
- package/dist/lib/node/artifact-definition-XRVEXVXI.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-JMO3PEBA.cjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-VPB2TSLQ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-BDI3HVPZ.mjs.map +0 -7
- /package/dist/lib/browser/{react-surface-CMUAPVQA.mjs.map → react-surface-LZYVKHCU.mjs.map} +0 -0
- /package/dist/lib/node/{react-surface-GSLVN4KN.cjs.map → react-surface-JWVHHTQU.cjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-L5YMO5FM.mjs.map → react-surface-TQKBCMJU.mjs.map} +0 -0
package/dist/lib/browser/{artifact-definition-HTXW3AKR.mjs → artifact-definition-GHBVTO4Y.mjs}
RENAMED
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
ChessAction,
|
|
3
3
|
ChessType,
|
|
4
4
|
meta
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4NJ4PMPW.mjs";
|
|
6
6
|
|
|
7
7
|
// packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts
|
|
8
8
|
import { Chess } from "chess.js";
|
|
9
9
|
import { pipe } from "effect";
|
|
10
10
|
import { Capabilities, chain, contributes, createIntent } from "@dxos/app-framework";
|
|
11
11
|
import { ArtifactId, defineArtifact, defineTool, ToolResult } from "@dxos/artifact";
|
|
12
|
-
import { createArtifactElement
|
|
12
|
+
import { createArtifactElement } from "@dxos/assistant";
|
|
13
13
|
import { isInstanceOf, S } from "@dxos/echo-schema";
|
|
14
14
|
import { invariant } from "@dxos/invariant";
|
|
15
15
|
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
@@ -63,9 +63,7 @@ var artifact_definition_default = () => {
|
|
|
63
63
|
if (!data || error) {
|
|
64
64
|
return ToolResult.Error(error?.message ?? "Failed to create chess game");
|
|
65
65
|
}
|
|
66
|
-
return ToolResult.Success(createArtifactElement(data.id)
|
|
67
|
-
VersionPin.createBlock(VersionPin.fromObject(data.object))
|
|
68
|
-
]);
|
|
66
|
+
return ToolResult.Success(createArtifactElement(data.id));
|
|
69
67
|
}
|
|
70
68
|
}),
|
|
71
69
|
defineTool(meta.id, {
|
|
@@ -76,7 +74,7 @@ var artifact_definition_default = () => {
|
|
|
76
74
|
execute: async (_, { extensions }) => {
|
|
77
75
|
invariant(extensions?.space, "No space", {
|
|
78
76
|
F: __dxlog_file,
|
|
79
|
-
L:
|
|
77
|
+
L: 66,
|
|
80
78
|
S: void 0,
|
|
81
79
|
A: [
|
|
82
80
|
"extensions?.space",
|
|
@@ -86,7 +84,7 @@ var artifact_definition_default = () => {
|
|
|
86
84
|
const { objects: games } = await extensions.space.db.query(Filter.schema(ChessType)).run();
|
|
87
85
|
invariant(games.length > 0, "No chess games found", {
|
|
88
86
|
F: __dxlog_file,
|
|
89
|
-
L:
|
|
87
|
+
L: 68,
|
|
90
88
|
S: void 0,
|
|
91
89
|
A: [
|
|
92
90
|
"games.length > 0",
|
|
@@ -106,7 +104,7 @@ var artifact_definition_default = () => {
|
|
|
106
104
|
execute: async ({ id }, { extensions }) => {
|
|
107
105
|
invariant(extensions?.space, "No space", {
|
|
108
106
|
F: __dxlog_file,
|
|
109
|
-
L:
|
|
107
|
+
L: 78,
|
|
110
108
|
S: void 0,
|
|
111
109
|
A: [
|
|
112
110
|
"extensions?.space",
|
|
@@ -114,11 +112,11 @@ var artifact_definition_default = () => {
|
|
|
114
112
|
]
|
|
115
113
|
});
|
|
116
114
|
const game = await extensions.space.db.query({
|
|
117
|
-
id: ArtifactId.toDXN(id
|
|
115
|
+
id: ArtifactId.toDXN(id).toString()
|
|
118
116
|
}).first();
|
|
119
117
|
invariant(isInstanceOf(ChessType, game), void 0, {
|
|
120
118
|
F: __dxlog_file,
|
|
121
|
-
L:
|
|
119
|
+
L: 80,
|
|
122
120
|
S: void 0,
|
|
123
121
|
A: [
|
|
124
122
|
"isInstanceOf(ChessType, game)",
|
|
@@ -145,7 +143,7 @@ var artifact_definition_default = () => {
|
|
|
145
143
|
execute: async ({ id, move }, { extensions }) => {
|
|
146
144
|
invariant(extensions?.space, "No space", {
|
|
147
145
|
F: __dxlog_file,
|
|
148
|
-
L:
|
|
146
|
+
L: 97,
|
|
149
147
|
S: void 0,
|
|
150
148
|
A: [
|
|
151
149
|
"extensions?.space",
|
|
@@ -153,11 +151,11 @@ var artifact_definition_default = () => {
|
|
|
153
151
|
]
|
|
154
152
|
});
|
|
155
153
|
const game = await extensions.space.db.query({
|
|
156
|
-
id: ArtifactId.toDXN(id
|
|
154
|
+
id: ArtifactId.toDXN(id).toString()
|
|
157
155
|
}).first();
|
|
158
156
|
invariant(isInstanceOf(ChessType, game), void 0, {
|
|
159
157
|
F: __dxlog_file,
|
|
160
|
-
L:
|
|
158
|
+
L: 99,
|
|
161
159
|
S: void 0,
|
|
162
160
|
A: [
|
|
163
161
|
"isInstanceOf(ChessType, game)",
|
|
@@ -182,4 +180,4 @@ var artifact_definition_default = () => {
|
|
|
182
180
|
export {
|
|
183
181
|
artifact_definition_default as default
|
|
184
182
|
};
|
|
185
|
-
//# sourceMappingURL=artifact-definition-
|
|
183
|
+
//# sourceMappingURL=artifact-definition-GHBVTO4Y.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 { ArtifactId, defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement } from '@dxos/assistant';\nimport { isInstanceOf, 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: `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 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: ArtifactId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const game = await extensions.space.db.query({ id: ArtifactId.toDXN(id).toString() }).first();\n invariant(isInstanceOf(ChessType, game));\n\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: ArtifactId,\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 game = await extensions.space.db.query({ id: ArtifactId.toDXN(id).toString() }).first();\n invariant(isInstanceOf(ChessType, game));\n\n const board = new Chess(game.fen);\n try {\n board.move(move);\n } catch (error: any) {\n return ToolResult.Error(error.message);\n }\n game.pgn = board.pgn();\n game.fen = board.fen();\n return ToolResult.Success(game.fen);\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Chess", "pipe", "Capabilities", "chain", "contributes", "createIntent", "ArtifactId", "defineArtifact", "defineTool", "ToolResult", "createArtifactElement", "isInstanceOf", "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", "ArtifactId", "game", "toDXN", "toString", "first", "isInstanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
+
}
|
|
@@ -23,7 +23,7 @@ var ChessType = class extends TypedObject({
|
|
|
23
23
|
|
|
24
24
|
// packages/plugins/plugin-chess/src/types/types.ts
|
|
25
25
|
import { isInstanceOf, S as S2 } from "@dxos/echo-schema";
|
|
26
|
-
import {
|
|
26
|
+
import { isReactiveObject } from "@dxos/live-object";
|
|
27
27
|
|
|
28
28
|
// packages/plugins/plugin-chess/src/meta.ts
|
|
29
29
|
var CHESS_PLUGIN = "dxos.org/plugin/chess";
|
|
@@ -55,7 +55,7 @@ var ChessAction;
|
|
|
55
55
|
ChessAction2.Create = Create;
|
|
56
56
|
})(ChessAction || (ChessAction = {}));
|
|
57
57
|
var isObject = (object) => {
|
|
58
|
-
return
|
|
58
|
+
return isReactiveObject(object) && isInstanceOf(ChessType, object);
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
export {
|
|
@@ -66,4 +66,4 @@ export {
|
|
|
66
66
|
ChessAction,
|
|
67
67
|
isObject
|
|
68
68
|
};
|
|
69
|
-
//# sourceMappingURL=chunk-
|
|
69
|
+
//# sourceMappingURL=chunk-4NJ4PMPW.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts", "../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\nexport const MoveSchema = S.mutable(\n S.partial(\n S.Struct({\n source: S.String,\n target: S.String,\n piece: S.String,\n }),\n ),\n);\n\nexport class ChessType extends TypedObject({ typename: 'dxos.org/type/Chess', version: '0.1.0' })(\n {\n name: S.optional(S.String),\n playerWhite: S.String,\n playerBlack: S.String,\n moves: S.mutable(S.Array(S.String)),\n // TODO(wittjosiah): Remove. Redundant with moves.\n pgn: S.String,\n fen: S.String,\n },\n { partial: true },\n) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { isInstanceOf, S } from '@dxos/echo-schema';\nimport {
|
|
5
|
-
"mappings": ";AAIA,SAASA,GAAGC,mBAAmB;AAExB,IAAMC,aAAaC,EAAEC,QAC1BD,EAAEE,QACAF,EAAEG,OAAO;EACPC,QAAQJ,EAAEK;EACVC,QAAQN,EAAEK;EACVE,OAAOP,EAAEK;AACX,CAAA,CAAA,CAAA;AAIG,IAAMG,YAAN,cAAwBC,YAAY;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,EAC7F;EACEC,MAAMZ,EAAEa,SAASb,EAAEK,MAAM;EACzBS,aAAad,EAAEK;EACfU,aAAaf,EAAEK;EACfW,OAAOhB,EAAEC,QAAQD,EAAEiB,MAAMjB,EAAEK,MAAM,CAAA;;EAEjCa,KAAKlB,EAAEK;EACPc,KAAKnB,EAAEK;AACT,GACA;EAAEH,SAAS;AAAK,CAAA,EAAA;AACf;;;ACvBH,SAASkB,cAAcC,KAAAA,UAAS;AAChC,SAASC,
|
|
6
|
-
"names": ["S", "TypedObject", "MoveSchema", "S", "mutable", "partial", "Struct", "source", "String", "target", "piece", "ChessType", "TypedObject", "typename", "version", "name", "optional", "playerWhite", "playerBlack", "moves", "Array", "pgn", "fen", "isInstanceOf", "S", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\nexport const MoveSchema = S.mutable(\n S.partial(\n S.Struct({\n source: S.String,\n target: S.String,\n piece: S.String,\n }),\n ),\n);\n\nexport class ChessType extends TypedObject({ typename: 'dxos.org/type/Chess', version: '0.1.0' })(\n {\n name: S.optional(S.String),\n playerWhite: S.String,\n playerBlack: S.String,\n moves: S.mutable(S.Array(S.String)),\n // TODO(wittjosiah): Remove. Redundant with moves.\n pgn: S.String,\n fen: S.String,\n },\n { partial: true },\n) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { isInstanceOf, S } from '@dxos/echo-schema';\nimport { isReactiveObject } from '@dxos/live-object';\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 S.TaggedClass<Create>()(`${CHESS_ACTION}/create`, {\n input: S.Struct({\n name: S.optional(S.String),\n fen: S.optional(S.String),\n }),\n output: S.Struct({\n object: ChessType,\n }),\n }) {}\n}\n\nexport const isObject = (object: unknown): object is typeof ChessType => {\n return isReactiveObject(object) && isInstanceOf(ChessType, object);\n};\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,GAAGC,mBAAmB;AAExB,IAAMC,aAAaC,EAAEC,QAC1BD,EAAEE,QACAF,EAAEG,OAAO;EACPC,QAAQJ,EAAEK;EACVC,QAAQN,EAAEK;EACVE,OAAOP,EAAEK;AACX,CAAA,CAAA,CAAA;AAIG,IAAMG,YAAN,cAAwBC,YAAY;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,EAC7F;EACEC,MAAMZ,EAAEa,SAASb,EAAEK,MAAM;EACzBS,aAAad,EAAEK;EACfU,aAAaf,EAAEK;EACfW,OAAOhB,EAAEC,QAAQD,EAAEiB,MAAMjB,EAAEK,MAAM,CAAA;;EAEjCa,KAAKlB,EAAEK;EACPc,KAAKnB,EAAEK;AACT,GACA;EAAEH,SAAS;AAAK,CAAA,EAAA;AACf;;;ACvBH,SAASkB,cAAcC,KAAAA,UAAS;AAChC,SAASC,wBAAwB;;;ACC1B,IAAMC,eAAe;AAErB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;EACRC,aAAa;IAAC;;AAChB;;;;UDNiBC,cAAAA;AACf,QAAMC,eAAe,GAAGC,YAAAA;EAEjB,MAAMC,eAAeC,GAAEC,YAAW,EAAW,GAAGJ,YAAAA,WAAuB;IAC5EK,OAAOF,GAAEG,OAAO;MACdC,MAAMJ,GAAEK,SAASL,GAAEM,MAAM;MACzBC,KAAKP,GAAEK,SAASL,GAAEM,MAAM;IAC1B,CAAA;IACAE,QAAQR,GAAEG,OAAO;MACfM,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;eARSX,SAAAA;AASf,GAZiBH,gBAAAA,cAAAA,CAAAA,EAAAA;AAcV,IAAMe,WAAW,CAACF,WAAAA;AACvB,SAAOG,iBAAiBH,MAAAA,KAAWI,aAAaH,WAAWD,MAAAA;AAC7D;",
|
|
6
|
+
"names": ["S", "TypedObject", "MoveSchema", "S", "mutable", "partial", "Struct", "source", "String", "target", "piece", "ChessType", "TypedObject", "typename", "version", "name", "optional", "playerWhite", "playerBlack", "moves", "Array", "pgn", "fen", "isInstanceOf", "S", "isReactiveObject", "CHESS_PLUGIN", "meta", "id", "name", "description", "icon", "source", "screenshots", "ChessAction", "CHESS_ACTION", "CHESS_PLUGIN", "Create", "S", "TaggedClass", "input", "Struct", "name", "optional", "String", "fen", "output", "object", "ChessType", "isObject", "isReactiveObject", "isInstanceOf"]
|
|
7
7
|
}
|
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
ChessAction,
|
|
7
7
|
ChessType,
|
|
8
8
|
meta
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4NJ4PMPW.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-GHBVTO4Y.mjs"));
|
|
17
|
+
var IntentResolver = lazy(() => import("./intent-resolver-JVLCHAJD.mjs"));
|
|
18
|
+
var ReactSurface = lazy(() => import("./react-surface-LZYVKHCU.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-4NJ4PMPW.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 { create } from "@dxos/live-object";
|
|
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: create(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-JVLCHAJD.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 { create } from '@dxos/live-object';\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: create(ChessType, { name, fen, pgn }),\n },\n };\n },\n }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,aAAa;AAEtB,SAASC,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,cAAc;AAIvB,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,OAAOC,WAAW;UAAER;UAAMC;UAAKC;QAAI,CAAA;MAC7C;IACF;EACF;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["Chess", "Capabilities", "contributes", "createResolver", "create", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ChessAction", "Create", "resolve", "name", "fen", "pgn", "Chess", "undefined", "data", "object", "create", "ChessType"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2077,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2700,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":3023,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":586,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytes":19202,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":2736,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytes":4522,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytes":8761,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":3257,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":908,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":3926,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"../components/ChessComponent"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1365,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","kind":"dynamic-import","original":"./artifact-definition"},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1694,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":7388,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":790,"imports":[{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4837},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-HTXW3AKR.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-QECLUB7C.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-CMUAPVQA.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","ChessComponent","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":273},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1500},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":282}},"bytes":2659},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs","kind":"import-statement"}],"exports":["ChessAction","ChessType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":194},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-HTXW3AKR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8373},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-HTXW3AKR.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts":{"bytesInOutput":5940}},"bytes":6200},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-QECLUB7C.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1366},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-QECLUB7C.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":507}},"bytes":747},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-6JIE36JW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6150},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-6JIE36JW.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":791},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":3452},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-CMUAPVQA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1850},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-CMUAPVQA.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytesInOutput":745}},"bytes":1107},"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-6JIE36JW.mjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":235},"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3741},"packages/plugins/plugin-chess/dist/lib/browser/chunk-EIRRN4WP.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","ChessType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":501},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":605},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":1958},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2436},"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs":{"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"exports":["ChessComponent"],"inputs":{"packages/plugins/plugin-chess/src/components/ChessComponent.tsx":{"bytesInOutput":990}},"bytes":1131}}}
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2077,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2700,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":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":18514,"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":3257,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":908,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":3926,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/components/ChessComponent.tsx","kind":"import-statement","original":"../components/ChessComponent"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1365,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/artifact-definition.ts","kind":"dynamic-import","original":"./artifact-definition"},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1694,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":7388,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":790,"imports":[{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4837},"packages/plugins/plugin-chess/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-4NJ4PMPW.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-GHBVTO4Y.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-JVLCHAJD.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/react-surface-LZYVKHCU.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-4NJ4PMPW.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-GHBVTO4Y.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8002},"packages/plugins/plugin-chess/dist/lib/browser/artifact-definition-GHBVTO4Y.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-4NJ4PMPW.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":5798}},"bytes":6058},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-JVLCHAJD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1374},"packages/plugins/plugin-chess/dist/lib/browser/intent-resolver-JVLCHAJD.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-4NJ4PMPW.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-6JIE36JW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6150},"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-6JIE36JW.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":791},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":3452},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-LZYVKHCU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1850},"packages/plugins/plugin-chess/dist/lib/browser/react-surface-LZYVKHCU.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-4NJ4PMPW.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-chess/dist/lib/browser/chunk-VRWXC5L2.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytesInOutput":745}},"bytes":1107},"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"packages/plugins/plugin-chess/dist/lib/browser/chunk-7SPN7XYA.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/browser/ChessContainer-6JIE36JW.mjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":235},"packages/plugins/plugin-chess/dist/lib/browser/chunk-4NJ4PMPW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3759},"packages/plugins/plugin-chess/dist/lib/browser/chunk-4NJ4PMPW.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-4NJ4PMPW.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-LZYVKHCU.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_JDJAOTXF_exports = {};
|
|
20
|
+
__export(artifact_definition_JDJAOTXF_exports, {
|
|
21
21
|
default: () => artifact_definition_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(artifact_definition_JDJAOTXF_exports);
|
|
24
|
+
var import_chunk_PQ64RGCS = require("./chunk-PQ64RGCS.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,16 @@ 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: `artifact:${
|
|
38
|
-
name:
|
|
37
|
+
id: `artifact:${import_chunk_PQ64RGCS.meta.id}`,
|
|
38
|
+
name: import_chunk_PQ64RGCS.meta.name,
|
|
39
39
|
description: "Provides a simple chess engine.",
|
|
40
40
|
instructions: `
|
|
41
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.
|
|
42
42
|
- Always inspect the chess game at the start of every prompt realting to a chess game, as it might have changed since the interaction.
|
|
43
43
|
`,
|
|
44
|
-
schema:
|
|
44
|
+
schema: import_chunk_PQ64RGCS.ChessType,
|
|
45
45
|
tools: [
|
|
46
|
-
(0, import_artifact.defineTool)(
|
|
46
|
+
(0, import_artifact.defineTool)(import_chunk_PQ64RGCS.meta.id, {
|
|
47
47
|
name: "create",
|
|
48
48
|
description: "Create a new chess game. Returns the artifact definition for the game.",
|
|
49
49
|
caption: "Creating chess game...",
|
|
@@ -71,7 +71,7 @@ var artifact_definition_default = () => {
|
|
|
71
71
|
"'No intent dispatcher'"
|
|
72
72
|
]
|
|
73
73
|
});
|
|
74
|
-
const intent = (0, import_effect.pipe)((0, import_app_framework.createIntent)(
|
|
74
|
+
const intent = (0, import_effect.pipe)((0, import_app_framework.createIntent)(import_chunk_PQ64RGCS.ChessAction.Create, {
|
|
75
75
|
fen
|
|
76
76
|
}), (0, import_app_framework.chain)(import_types.SpaceAction.AddObject, {
|
|
77
77
|
target: extensions.space
|
|
@@ -80,12 +80,10 @@ var artifact_definition_default = () => {
|
|
|
80
80
|
if (!data || error) {
|
|
81
81
|
return import_artifact.ToolResult.Error(error?.message ?? "Failed to create chess game");
|
|
82
82
|
}
|
|
83
|
-
return import_artifact.ToolResult.Success((0, import_assistant.createArtifactElement)(data.id)
|
|
84
|
-
import_assistant.VersionPin.createBlock(import_assistant.VersionPin.fromObject(data.object))
|
|
85
|
-
]);
|
|
83
|
+
return import_artifact.ToolResult.Success((0, import_assistant.createArtifactElement)(data.id));
|
|
86
84
|
}
|
|
87
85
|
}),
|
|
88
|
-
(0, import_artifact.defineTool)(
|
|
86
|
+
(0, import_artifact.defineTool)(import_chunk_PQ64RGCS.meta.id, {
|
|
89
87
|
name: "list",
|
|
90
88
|
description: "Query all active chess games.",
|
|
91
89
|
caption: "Getting games...",
|
|
@@ -93,17 +91,17 @@ var artifact_definition_default = () => {
|
|
|
93
91
|
execute: async (_, { extensions }) => {
|
|
94
92
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
95
93
|
F: __dxlog_file,
|
|
96
|
-
L:
|
|
94
|
+
L: 66,
|
|
97
95
|
S: void 0,
|
|
98
96
|
A: [
|
|
99
97
|
"extensions?.space",
|
|
100
98
|
"'No space'"
|
|
101
99
|
]
|
|
102
100
|
});
|
|
103
|
-
const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(
|
|
101
|
+
const { objects: games } = await extensions.space.db.query(import_echo.Filter.schema(import_chunk_PQ64RGCS.ChessType)).run();
|
|
104
102
|
(0, import_invariant.invariant)(games.length > 0, "No chess games found", {
|
|
105
103
|
F: __dxlog_file,
|
|
106
|
-
L:
|
|
104
|
+
L: 68,
|
|
107
105
|
S: void 0,
|
|
108
106
|
A: [
|
|
109
107
|
"games.length > 0",
|
|
@@ -113,7 +111,7 @@ var artifact_definition_default = () => {
|
|
|
113
111
|
return import_artifact.ToolResult.Success(games);
|
|
114
112
|
}
|
|
115
113
|
}),
|
|
116
|
-
(0, import_artifact.defineTool)(
|
|
114
|
+
(0, import_artifact.defineTool)(import_chunk_PQ64RGCS.meta.id, {
|
|
117
115
|
name: "inspect",
|
|
118
116
|
description: "Get the current state of the chess game.",
|
|
119
117
|
caption: "Inspecting game...",
|
|
@@ -123,7 +121,7 @@ var artifact_definition_default = () => {
|
|
|
123
121
|
execute: async ({ id }, { extensions }) => {
|
|
124
122
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
125
123
|
F: __dxlog_file,
|
|
126
|
-
L:
|
|
124
|
+
L: 78,
|
|
127
125
|
S: void 0,
|
|
128
126
|
A: [
|
|
129
127
|
"extensions?.space",
|
|
@@ -131,11 +129,11 @@ var artifact_definition_default = () => {
|
|
|
131
129
|
]
|
|
132
130
|
});
|
|
133
131
|
const game = await extensions.space.db.query({
|
|
134
|
-
id: import_artifact.ArtifactId.toDXN(id
|
|
132
|
+
id: import_artifact.ArtifactId.toDXN(id).toString()
|
|
135
133
|
}).first();
|
|
136
|
-
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(
|
|
134
|
+
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_PQ64RGCS.ChessType, game), void 0, {
|
|
137
135
|
F: __dxlog_file,
|
|
138
|
-
L:
|
|
136
|
+
L: 80,
|
|
139
137
|
S: void 0,
|
|
140
138
|
A: [
|
|
141
139
|
"isInstanceOf(ChessType, game)",
|
|
@@ -145,7 +143,7 @@ var artifact_definition_default = () => {
|
|
|
145
143
|
return import_artifact.ToolResult.Success(game.fen);
|
|
146
144
|
}
|
|
147
145
|
}),
|
|
148
|
-
(0, import_artifact.defineTool)(
|
|
146
|
+
(0, import_artifact.defineTool)(import_chunk_PQ64RGCS.meta.id, {
|
|
149
147
|
name: "move",
|
|
150
148
|
description: "Make a move in the chess game.",
|
|
151
149
|
caption: "Making chess move...",
|
|
@@ -162,7 +160,7 @@ var artifact_definition_default = () => {
|
|
|
162
160
|
execute: async ({ id, move }, { extensions }) => {
|
|
163
161
|
(0, import_invariant.invariant)(extensions?.space, "No space", {
|
|
164
162
|
F: __dxlog_file,
|
|
165
|
-
L:
|
|
163
|
+
L: 97,
|
|
166
164
|
S: void 0,
|
|
167
165
|
A: [
|
|
168
166
|
"extensions?.space",
|
|
@@ -170,11 +168,11 @@ var artifact_definition_default = () => {
|
|
|
170
168
|
]
|
|
171
169
|
});
|
|
172
170
|
const game = await extensions.space.db.query({
|
|
173
|
-
id: import_artifact.ArtifactId.toDXN(id
|
|
171
|
+
id: import_artifact.ArtifactId.toDXN(id).toString()
|
|
174
172
|
}).first();
|
|
175
|
-
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(
|
|
173
|
+
(0, import_invariant.invariant)((0, import_echo_schema.isInstanceOf)(import_chunk_PQ64RGCS.ChessType, game), void 0, {
|
|
176
174
|
F: __dxlog_file,
|
|
177
|
-
L:
|
|
175
|
+
L: 99,
|
|
178
176
|
S: void 0,
|
|
179
177
|
A: [
|
|
180
178
|
"isInstanceOf(ChessType, game)",
|
|
@@ -196,4 +194,4 @@ var artifact_definition_default = () => {
|
|
|
196
194
|
});
|
|
197
195
|
return (0, import_app_framework.contributes)(import_app_framework.Capabilities.ArtifactDefinition, definition);
|
|
198
196
|
};
|
|
199
|
-
//# sourceMappingURL=artifact-definition-
|
|
197
|
+
//# sourceMappingURL=artifact-definition-JDJAOTXF.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 { ArtifactId, defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement } from '@dxos/assistant';\nimport { isInstanceOf, 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: `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 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: ArtifactId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const game = await extensions.space.db.query({ id: ArtifactId.toDXN(id).toString() }).first();\n invariant(isInstanceOf(ChessType, game));\n\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: ArtifactId,\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 game = await extensions.space.db.query({ id: ArtifactId.toDXN(id).toString() }).first();\n invariant(isInstanceOf(ChessType, game));\n\n const board = new Chess(game.fen);\n try {\n board.move(move);\n } catch (error: any) {\n return ToolResult.Error(error.message);\n }\n game.pgn = board.pgn();\n game.fen = board.fen();\n return ToolResult.Success(game.fen);\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
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", "ArtifactId", "game", "toDXN", "toString", "first", "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_PQ64RGCS_exports = {};
|
|
20
|
+
__export(chunk_PQ64RGCS_exports, {
|
|
21
21
|
CHESS_PLUGIN: () => CHESS_PLUGIN,
|
|
22
22
|
ChessAction: () => ChessAction,
|
|
23
23
|
ChessType: () => ChessType,
|
|
@@ -25,7 +25,7 @@ __export(chunk_SVNVQAMR_exports, {
|
|
|
25
25
|
isObject: () => isObject,
|
|
26
26
|
meta: () => meta
|
|
27
27
|
});
|
|
28
|
-
module.exports = __toCommonJS(
|
|
28
|
+
module.exports = __toCommonJS(chunk_PQ64RGCS_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");
|
|
@@ -76,7 +76,7 @@ var ChessAction;
|
|
|
76
76
|
ChessAction2.Create = Create;
|
|
77
77
|
})(ChessAction || (ChessAction = {}));
|
|
78
78
|
var isObject = (object) => {
|
|
79
|
-
return (0, import_live_object.
|
|
79
|
+
return (0, import_live_object.isReactiveObject)(object) && (0, import_echo_schema2.isInstanceOf)(ChessType, object);
|
|
80
80
|
};
|
|
81
81
|
// Annotate the CommonJS export names for ESM import in node:
|
|
82
82
|
0 && (module.exports = {
|
|
@@ -87,4 +87,4 @@ var isObject = (object) => {
|
|
|
87
87
|
isObject,
|
|
88
88
|
meta
|
|
89
89
|
});
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-PQ64RGCS.cjs.map
|