@dxos/plugin-chess 0.8.4-main.a4bbb77 → 0.8.4-main.abd8ff62ef
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/blueprints/index.mjs +14 -0
- package/dist/lib/browser/chunk-H6SON7WG.mjs +28 -0
- package/dist/lib/browser/chunk-H6SON7WG.mjs.map +7 -0
- package/dist/lib/browser/chunk-IN3LZ2OO.mjs +62 -0
- package/dist/lib/browser/chunk-IN3LZ2OO.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-JYP24G6K.mjs +36 -0
- package/dist/lib/browser/chunk-JYP24G6K.mjs.map +7 -0
- package/dist/lib/browser/chunk-OBKYFOJA.mjs +110 -0
- package/dist/lib/browser/chunk-OBKYFOJA.mjs.map +7 -0
- package/dist/lib/browser/create-2ME3FNBX.mjs +24 -0
- package/dist/lib/browser/create-2ME3FNBX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +30 -111
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/move-TTMIPD5J.mjs +36 -0
- package/dist/lib/browser/move-TTMIPD5J.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +19 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/play-GHXPV2T2.mjs +45 -0
- package/dist/lib/browser/play-GHXPV2T2.mjs.map +7 -0
- package/dist/lib/browser/print-RNAGAOM7.mjs +30 -0
- package/dist/lib/browser/print-RNAGAOM7.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +38 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -5
- package/dist/lib/node-esm/blueprints/index.mjs +15 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4C4GPZTA.mjs +29 -0
- package/dist/lib/node-esm/chunk-4C4GPZTA.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-G2EHRXHX.mjs +111 -0
- package/dist/lib/node-esm/chunk-G2EHRXHX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NSFPC4IO.mjs +38 -0
- package/dist/lib/node-esm/chunk-NSFPC4IO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-OHBKSL2Q.mjs +63 -0
- package/dist/lib/node-esm/chunk-OHBKSL2Q.mjs.map +7 -0
- package/dist/lib/node-esm/create-CC2P7GPT.mjs +25 -0
- package/dist/lib/node-esm/create-CC2P7GPT.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +30 -111
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/move-CYHXWHHM.mjs +37 -0
- package/dist/lib/node-esm/move-CYHXWHHM.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +20 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/play-KTNK2PBL.mjs +46 -0
- package/dist/lib/node-esm/play-KTNK2PBL.mjs.map +7 -0
- package/dist/lib/node-esm/print-P23VKVNU.mjs +31 -0
- package/dist/lib/node-esm/print-P23VKVNU.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +39 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +3 -5
- package/dist/types/src/ChessPlugin.d.ts +3 -1
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- package/dist/types/src/ChessPlugin.node.d.ts +4 -0
- package/dist/types/src/ChessPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ChessPlugin.test.d.ts +2 -0
- package/dist/types/src/ChessPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/chess-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +3 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition.d.ts +3 -2
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -5
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +5 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +5 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/{Chessboard.d.ts → Chessboard/Chessboard.d.ts} +8 -8
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +65 -0
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Info.d.ts → Chessboard/Info.d.ts} +5 -6
- package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/index.d.ts +2 -0
- package/dist/types/src/components/Chessboard/index.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/types.d.ts +8 -0
- package/dist/types/src/components/Chessboard/types.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +6 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +64 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts +6 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts +15 -0
- package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/index.d.ts +2 -0
- package/dist/types/src/containers/ChessCard/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +51 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/move.d.ts +5 -0
- package/dist/types/src/operations/move.d.ts.map +1 -0
- package/dist/types/src/operations/play.d.ts +5 -0
- package/dist/types/src/operations/play.d.ts.map +1 -0
- package/dist/types/src/operations/print.d.ts +5 -0
- package/dist/types/src/operations/print.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +40 -22
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts +19 -19
- package/dist/types/src/types/Chess.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +83 -51
- package/src/ChessPlugin.node.ts +45 -0
- package/src/ChessPlugin.test.ts +49 -0
- package/src/ChessPlugin.tsx +43 -53
- package/src/blueprints/chess-blueprint.ts +34 -0
- package/src/blueprints/index.ts +6 -0
- package/src/capabilities/artifact-definition.ts +100 -93
- package/src/capabilities/blueprint-definition.ts +11 -28
- package/src/capabilities/index.ts +9 -6
- package/src/capabilities/node.ts +16 -0
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/capabilities/react-surface.tsx +27 -15
- package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
- package/src/components/{Chessboard.tsx → Chessboard/Chessboard.tsx} +32 -29
- package/src/components/{Info.tsx → Chessboard/Info.tsx} +42 -25
- package/src/components/Chessboard/index.ts +5 -0
- package/src/components/Chessboard/types.ts +18 -0
- package/src/components/index.ts +1 -5
- package/src/containers/ChessArticle/ChessArticle.stories.tsx +53 -0
- package/src/containers/ChessArticle/ChessArticle.tsx +73 -0
- package/src/containers/ChessArticle/index.ts +5 -0
- package/src/containers/ChessCard/ChessCard.stories.tsx +42 -0
- package/src/containers/ChessCard/ChessCard.tsx +22 -0
- package/src/containers/ChessCard/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/index.ts +6 -4
- package/src/meta.ts +6 -4
- package/src/operations/create.ts +21 -0
- package/src/operations/definitions.ts +109 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/move.ts +36 -0
- package/src/operations/play.ts +45 -0
- package/src/operations/print.ts +28 -0
- package/src/translations.ts +21 -19
- package/src/types/Chess.ts +30 -34
- package/src/types/index.ts +0 -1
- package/dist/lib/browser/ChessboardContainer-JOCAWL5W.mjs +0 -97
- package/dist/lib/browser/ChessboardContainer-JOCAWL5W.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-LC4GNYMG.mjs +0 -11
- package/dist/lib/browser/chunk-2EN3CBLB.mjs +0 -8
- package/dist/lib/browser/chunk-2EN3CBLB.mjs.map +0 -7
- package/dist/lib/browser/chunk-3WEALY7P.mjs +0 -84
- package/dist/lib/browser/chunk-3WEALY7P.mjs.map +0 -7
- package/dist/lib/browser/chunk-4ULSTPL6.mjs +0 -166
- package/dist/lib/browser/chunk-4ULSTPL6.mjs.map +0 -7
- package/dist/lib/browser/chunk-NR4YFUK7.mjs +0 -306
- package/dist/lib/browser/chunk-NR4YFUK7.mjs.map +0 -7
- package/dist/lib/browser/chunk-WSUUPPDK.mjs +0 -26
- package/dist/lib/browser/chunk-WSUUPPDK.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-PMP36Y5B.mjs +0 -25
- package/dist/lib/browser/intent-resolver-PMP36Y5B.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TSLFLTXN.mjs +0 -38
- package/dist/lib/browser/react-surface-TSLFLTXN.mjs.map +0 -7
- package/dist/lib/node-esm/ChessboardContainer-XAVVBRFW.mjs +0 -98
- package/dist/lib/node-esm/ChessboardContainer-XAVVBRFW.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-FBGRWYEW.mjs +0 -12
- package/dist/lib/node-esm/chunk-5C2OYL2B.mjs +0 -27
- package/dist/lib/node-esm/chunk-5C2OYL2B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7PHZFXU5.mjs +0 -10
- package/dist/lib/node-esm/chunk-7PHZFXU5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AR3TI5LX.mjs +0 -167
- package/dist/lib/node-esm/chunk-AR3TI5LX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LMXETYDF.mjs +0 -85
- package/dist/lib/node-esm/chunk-LMXETYDF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VVTQFCUK.mjs +0 -307
- package/dist/lib/node-esm/chunk-VVTQFCUK.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-5P7Y2ZKB.mjs +0 -26
- package/dist/lib/node-esm/intent-resolver-5P7Y2ZKB.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-AN4SMEDU.mjs +0 -39
- package/dist/lib/node-esm/react-surface-AN4SMEDU.mjs.map +0 -7
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/Card.stories.d.ts +0 -13
- package/dist/types/src/components/Card.stories.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard.stories.d.ts +0 -44
- package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardArticle.d.ts +0 -7
- package/dist/types/src/components/ChessboardArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardContainer.d.ts +0 -9
- package/dist/types/src/components/ChessboardContainer.d.ts.map +0 -1
- package/dist/types/src/components/Info.d.ts.map +0 -1
- package/dist/types/src/functions/create.d.ts +0 -14
- package/dist/types/src/functions/create.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/move.d.ts +0 -8
- package/dist/types/src/functions/move.d.ts.map +0 -1
- package/dist/types/src/functions/play.d.ts +0 -9
- package/dist/types/src/functions/play.d.ts.map +0 -1
- package/dist/types/src/types/ChessAction.d.ts +0 -24
- package/dist/types/src/types/ChessAction.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -22
- package/src/components/Card.stories.tsx +0 -66
- package/src/components/Chessboard.stories.tsx +0 -49
- package/src/components/ChessboardArticle.tsx +0 -69
- package/src/components/ChessboardContainer.tsx +0 -44
- package/src/functions/create.ts +0 -31
- package/src/functions/index.ts +0 -7
- package/src/functions/move.ts +0 -44
- package/src/functions/play.ts +0 -54
- package/src/types/ChessAction.ts +0 -19
- /package/dist/lib/browser/{blueprint-definition-LC4GNYMG.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-FBGRWYEW.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chess_blueprint_default
|
|
3
|
+
} from "../chunk-JYP24G6K.mjs";
|
|
4
|
+
import {
|
|
5
|
+
operations_exports
|
|
6
|
+
} from "../chunk-H6SON7WG.mjs";
|
|
7
|
+
import "../chunk-OBKYFOJA.mjs";
|
|
8
|
+
import "../chunk-IN3LZ2OO.mjs";
|
|
9
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
10
|
+
export {
|
|
11
|
+
chess_blueprint_default as ChessBlueprint,
|
|
12
|
+
operations_exports as ChessFunctions
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Create,
|
|
3
|
+
Move,
|
|
4
|
+
Play,
|
|
5
|
+
Print
|
|
6
|
+
} from "./chunk-OBKYFOJA.mjs";
|
|
7
|
+
import {
|
|
8
|
+
__export
|
|
9
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
10
|
+
|
|
11
|
+
// src/operations/index.ts
|
|
12
|
+
var operations_exports = {};
|
|
13
|
+
__export(operations_exports, {
|
|
14
|
+
ChessHandlers: () => ChessHandlers,
|
|
15
|
+
Create: () => Create,
|
|
16
|
+
Move: () => Move,
|
|
17
|
+
Play: () => Play,
|
|
18
|
+
Print: () => Print
|
|
19
|
+
});
|
|
20
|
+
import { OperationHandlerSet } from "@dxos/compute";
|
|
21
|
+
var Handlers = OperationHandlerSet.lazy(() => import("./create-2ME3FNBX.mjs"), () => import("./move-TTMIPD5J.mjs"), () => import("./play-GHXPV2T2.mjs"), () => import("./print-RNAGAOM7.mjs"));
|
|
22
|
+
var ChessHandlers = Handlers;
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
ChessHandlers,
|
|
26
|
+
operations_exports
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=chunk-H6SON7WG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nconst Handlers = OperationHandlerSet.lazy(\n () => import('./create'),\n () => import('./move'),\n () => import('./play'),\n () => import('./print'),\n);\n\nexport { Create, Move, Play, Print } from './definitions';\n\nexport const ChessHandlers = Handlers;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAAA;;;;;;;;AAIA,SAASA,2BAA2B;AAEpC,IAAMC,WAAWD,oBAAoBE,KACnC,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,sBAAA,CAAA;AAKR,IAAMC,gBAAgBF;",
|
|
6
|
+
"names": ["OperationHandlerSet", "Handlers", "lazy", "ChessHandlers"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
4
|
+
|
|
5
|
+
// src/types/Chess.ts
|
|
6
|
+
var Chess_exports = {};
|
|
7
|
+
__export(Chess_exports, {
|
|
8
|
+
Game: () => Game,
|
|
9
|
+
make: () => make
|
|
10
|
+
});
|
|
11
|
+
import { Chess as ChessJS } from "chess.js";
|
|
12
|
+
import * as Schema from "effect/Schema";
|
|
13
|
+
import { Annotation, Obj, Type } from "@dxos/echo";
|
|
14
|
+
import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/internal";
|
|
15
|
+
import { log } from "@dxos/log";
|
|
16
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-chess/src/types/Chess.ts";
|
|
17
|
+
var Game = Schema.Struct({
|
|
18
|
+
name: Schema.optional(Schema.String),
|
|
19
|
+
players: Schema.Struct({
|
|
20
|
+
white: Schema.optional(Schema.String.annotations({
|
|
21
|
+
description: "DID of white player"
|
|
22
|
+
})),
|
|
23
|
+
black: Schema.optional(Schema.String.annotations({
|
|
24
|
+
description: "DID of black player"
|
|
25
|
+
}))
|
|
26
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
27
|
+
pgn: Schema.String.annotations({
|
|
28
|
+
description: "Portable Game Notation."
|
|
29
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
30
|
+
fen: Schema.String.annotations({
|
|
31
|
+
description: "Forsyth-Edwards Notation."
|
|
32
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional)
|
|
33
|
+
}).pipe(Type.object({
|
|
34
|
+
typename: "org.dxos.type.chess",
|
|
35
|
+
version: "0.1.0"
|
|
36
|
+
}), LabelAnnotation.set([
|
|
37
|
+
"name"
|
|
38
|
+
]), Annotation.IconAnnotation.set({
|
|
39
|
+
icon: "ph--shield-chevron--regular",
|
|
40
|
+
hue: "amber"
|
|
41
|
+
}));
|
|
42
|
+
var make = ({ name, pgn, fen } = {}) => {
|
|
43
|
+
const chess = new ChessJS();
|
|
44
|
+
if (pgn) {
|
|
45
|
+
try {
|
|
46
|
+
chess.loadPgn(pgn);
|
|
47
|
+
} catch {
|
|
48
|
+
log.warn(pgn, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 40, S: void 0 });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return Obj.make(Game, {
|
|
52
|
+
name,
|
|
53
|
+
pgn,
|
|
54
|
+
fen,
|
|
55
|
+
players: {}
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
Chess_exports
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=chunk-IN3LZ2OO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/Chess.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Type } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { log } from '@dxos/log';\n\nexport const Game = Schema.Struct({\n name: Schema.optional(Schema.String),\n players: Schema.Struct({\n white: Schema.optional(\n Schema.String.annotations({\n description: 'DID of white player',\n }),\n ),\n black: Schema.optional(\n Schema.String.annotations({\n description: 'DID of black player',\n }),\n ),\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n pgn: Schema.String.annotations({\n description: 'Portable Game Notation.',\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n fen: Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }).pipe(FormInputAnnotation.set(false), Schema.optional),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.chess',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--shield-chevron--regular',\n hue: 'amber',\n }),\n);\n\nexport interface Game extends Schema.Schema.Type<typeof Game> {}\n\nexport const make = ({ name, pgn, fen }: { name?: string; pgn?: string; fen?: string } = {}) => {\n const chess = new ChessJS();\n if (pgn) {\n try {\n chess.loadPgn(pgn);\n } catch {\n log.warn(pgn);\n }\n }\n\n return Obj.make(Game, {\n name,\n pgn,\n fen,\n players: {},\n });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,YAAYC,KAAKC,YAAY;AACtC,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,WAAW;AAEpB,IAAA,eAAaC;AAEXC,IAASR,OAAc,cAAA;QACdA,gBACLA,aAAOS;WACLC,cAAa;IACf,OAAA,gBAAA,cAAA,YAAA;MAEFC,aAAcC;;IAGZ,OAAA,gBAAA,cAAA,YAAA;MAEIR,aAAAA;IACRS,CAAKb,CAAAA;UACHU,oBAAa,IAAA,KAAA,GAAA,eAAA;EACf,KAAQN,cAAAA,YAAuB;IAC/BU,aAAYL;UACVC,oBAAa,IAAA,KAAA,GAAA,eAAA;EACf,KAAQN,cAAAA,YAAuB;IAE/BD,aAAY;EACVY,CAAAA,EAAAA,KAAAA,oBAAU,IAAA,KAAA,GAAA,eAAA;QACVC,KAAS,OAAA;EAEXX,UAAAA;EAAqB,SAAA;CAAO,GAC5BJ,gBAAWgB,IAAAA;EACTC;IACAC,WAAK,eAAA,IAAA;EAEP,MAAA;EAIF,KAAO;;AAEL,IAAS,OAAA,CAAA,EAAA,MAAA,KAAA,IAAA,IAAA,CAAA,MAAA;QACP,QAAI,IAAA,QAAA;WACFC;AACF,QAAE;AACAd,YAAIe,QAAKR,GAAAA;IACX,QAAA;AACF,UAAA,KAAA,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;IAEA;;SAEEA,IAAAA,KAAAA,MAAAA;IACAC;IACAN;IACF;IACA,SAAA,CAAA;;;",
|
|
6
|
+
"names": ["Chess", "ChessJS", "Schema", "Annotation", "Obj", "Type", "FormInputAnnotation", "LabelAnnotation", "log", "Game", "players", "String", "description", "black", "optional", "pgn", "fen", "typename", "version", "IconAnnotation", "icon", "hue", "chess", "warn"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/blueprints/chess-blueprint.ts
|
|
2
|
+
import { Blueprint, Template } from "@dxos/compute";
|
|
3
|
+
import { trim } from "@dxos/util";
|
|
4
|
+
import { Create, Move, Play, Print } from "#operations";
|
|
5
|
+
var BLUEPRINT_KEY = "org.dxos.blueprint.chess";
|
|
6
|
+
var operations = [
|
|
7
|
+
Create,
|
|
8
|
+
Move,
|
|
9
|
+
Play,
|
|
10
|
+
Print
|
|
11
|
+
];
|
|
12
|
+
var make = () => Blueprint.make({
|
|
13
|
+
key: BLUEPRINT_KEY,
|
|
14
|
+
name: "Chess",
|
|
15
|
+
tools: Blueprint.toolDefinitions({
|
|
16
|
+
operations
|
|
17
|
+
}),
|
|
18
|
+
instructions: Template.make({
|
|
19
|
+
source: trim`
|
|
20
|
+
You are an expert chess player.
|
|
21
|
+
To analyze a game you can access the "pgn" property by loading the context object that represents the current game.
|
|
22
|
+
You could suggest a good next move or offer to play a move.
|
|
23
|
+
Don't actually make a move unless you are asked to.
|
|
24
|
+
`
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
var blueprint = {
|
|
28
|
+
key: BLUEPRINT_KEY,
|
|
29
|
+
make
|
|
30
|
+
};
|
|
31
|
+
var chess_blueprint_default = blueprint;
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
chess_blueprint_default
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-JYP24G6K.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/chess-blueprint.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Blueprint, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nimport { Create, Move, Play, Print } from '#operations';\n\nconst BLUEPRINT_KEY = 'org.dxos.blueprint.chess';\n\nconst operations = [Create, Move, Play, Print];\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Chess',\n tools: Blueprint.toolDefinitions({ operations }),\n instructions: Template.make({\n source: trim`\n You are an expert chess player.\n To analyze a game you can access the \"pgn\" property by loading the context object that represents the current game.\n You could suggest a good next move or offer to play a move.\n Don't actually make a move unless you are asked to.\n `,\n }),\n });\n\nconst blueprint: Blueprint.Definition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAErB,SAASC,QAAQC,MAAMC,MAAMC,aAAa;AAE1C,IAAMC,gBAAgB;AAEtB,IAAMC,aAAa;EAACL;EAAQC;EAAMC;EAAMC;;AAExC,IAAMG,OAAO,MACXT,UAAUS,KAAK;EACbC,KAAKH;EACLI,MAAM;EACNC,OAAOZ,UAAUa,gBAAgB;IAAEL;EAAW,CAAA;EAC9CM,cAAcb,SAASQ,KAAK;IAC1BM,QAAQb;;;;;;EAMV,CAAA;AACF,CAAA;AAEF,IAAMc,YAAkC;EACtCN,KAAKH;EACLE;AACF;AAEA,IAAA,0BAAeO;",
|
|
6
|
+
"names": ["Blueprint", "Template", "trim", "Create", "Move", "Play", "Print", "BLUEPRINT_KEY", "operations", "make", "key", "name", "tools", "toolDefinitions", "instructions", "source", "blueprint"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Chess_exports
|
|
3
|
+
} from "./chunk-IN3LZ2OO.mjs";
|
|
4
|
+
|
|
5
|
+
// src/operations/definitions.ts
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import { Operation } from "@dxos/compute";
|
|
8
|
+
import { Database, Ref } from "@dxos/echo";
|
|
9
|
+
var Create = Operation.make({
|
|
10
|
+
meta: {
|
|
11
|
+
key: "org.dxos.function.chess.create",
|
|
12
|
+
name: "Create Chess",
|
|
13
|
+
description: "Creates a new chess game."
|
|
14
|
+
},
|
|
15
|
+
input: Schema.Struct({
|
|
16
|
+
name: Schema.optional(Schema.String.annotations({
|
|
17
|
+
description: "Name of the game."
|
|
18
|
+
})),
|
|
19
|
+
pgn: Schema.optional(Schema.String.annotations({
|
|
20
|
+
description: "Portable Game Notation."
|
|
21
|
+
})),
|
|
22
|
+
fen: Schema.optional(Schema.String.annotations({
|
|
23
|
+
description: "Forsyth-Edwards Notation."
|
|
24
|
+
}))
|
|
25
|
+
}),
|
|
26
|
+
output: Chess_exports.Game,
|
|
27
|
+
services: [
|
|
28
|
+
Database.Service
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
var Move = Operation.make({
|
|
32
|
+
meta: {
|
|
33
|
+
key: "org.dxos.function.chess.move",
|
|
34
|
+
name: "Move",
|
|
35
|
+
description: "Makes a move in the given chess game."
|
|
36
|
+
},
|
|
37
|
+
input: Schema.Struct({
|
|
38
|
+
game: Ref.Ref(Chess_exports.Game).annotations({
|
|
39
|
+
description: "The ID of the chess object."
|
|
40
|
+
}),
|
|
41
|
+
move: Schema.String.annotations({
|
|
42
|
+
description: "The move to make in the chess game.",
|
|
43
|
+
examples: [
|
|
44
|
+
"e4",
|
|
45
|
+
"Bf3"
|
|
46
|
+
]
|
|
47
|
+
})
|
|
48
|
+
}),
|
|
49
|
+
output: Schema.Struct({
|
|
50
|
+
pgn: Schema.String.annotations({
|
|
51
|
+
description: "The PGN of the game after the move was played."
|
|
52
|
+
})
|
|
53
|
+
}),
|
|
54
|
+
services: [
|
|
55
|
+
Database.Service
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
var Play = Operation.make({
|
|
59
|
+
meta: {
|
|
60
|
+
key: "org.dxos.function.chess.play",
|
|
61
|
+
name: "Play",
|
|
62
|
+
description: "Uses the chess engine to play the next move."
|
|
63
|
+
},
|
|
64
|
+
input: Schema.Struct({
|
|
65
|
+
game: Ref.Ref(Chess_exports.Game).annotations({
|
|
66
|
+
description: "The ID of the chess object."
|
|
67
|
+
}),
|
|
68
|
+
side: Schema.optional(Schema.Literal("white", "black", "any")).annotations({
|
|
69
|
+
description: "The side to play.",
|
|
70
|
+
defaultValue: "any"
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
output: Schema.Struct({
|
|
74
|
+
pgn: Schema.String.annotations({
|
|
75
|
+
description: "The PGN of the game after the move was played."
|
|
76
|
+
}),
|
|
77
|
+
move: Schema.optional(Schema.String).annotations({
|
|
78
|
+
description: "The move that was played."
|
|
79
|
+
})
|
|
80
|
+
}),
|
|
81
|
+
services: [
|
|
82
|
+
Database.Service
|
|
83
|
+
]
|
|
84
|
+
});
|
|
85
|
+
var Print = Operation.make({
|
|
86
|
+
meta: {
|
|
87
|
+
key: "org.dxos.function.chess.print",
|
|
88
|
+
name: "Print game",
|
|
89
|
+
description: "Prints the chess game to ASCII."
|
|
90
|
+
},
|
|
91
|
+
input: Schema.Struct({
|
|
92
|
+
pgn: Schema.optional(Schema.String.annotations({
|
|
93
|
+
description: "Portable Game Notation."
|
|
94
|
+
})),
|
|
95
|
+
fen: Schema.optional(Schema.String.annotations({
|
|
96
|
+
description: "Forsyth-Edwards Notation."
|
|
97
|
+
}))
|
|
98
|
+
}),
|
|
99
|
+
output: Schema.Struct({
|
|
100
|
+
ascii: Schema.String
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
Create,
|
|
106
|
+
Move,
|
|
107
|
+
Play,
|
|
108
|
+
Print
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=chunk-OBKYFOJA.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Operation } from '@dxos/compute';\nimport { Database, Ref } from '@dxos/echo';\n\nimport { Chess } from '../types';\n\nexport const Create = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.create',\n name: 'Create Chess',\n description: 'Creates a new chess game.',\n },\n input: Schema.Struct({\n name: Schema.optional(\n Schema.String.annotations({\n description: 'Name of the game.',\n }),\n ),\n pgn: Schema.optional(\n Schema.String.annotations({\n description: 'Portable Game Notation.',\n }),\n ),\n fen: Schema.optional(\n Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }),\n ),\n }),\n output: Chess.Game,\n services: [Database.Service],\n});\n\nexport const Move = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.move',\n name: 'Move',\n description: 'Makes a move in the given chess game.',\n },\n input: Schema.Struct({\n game: Ref.Ref(Chess.Game).annotations({\n description: 'The ID of the chess object.',\n }),\n move: Schema.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n output: Schema.Struct({\n pgn: Schema.String.annotations({\n description: 'The PGN of the game after the move was played.',\n }),\n }),\n services: [Database.Service],\n});\n\nexport const Play = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.play',\n name: 'Play',\n description: 'Uses the chess engine to play the next move.',\n },\n input: Schema.Struct({\n game: Ref.Ref(Chess.Game).annotations({\n description: 'The ID of the chess object.',\n }),\n side: Schema.optional(Schema.Literal('white', 'black', 'any')).annotations({\n description: 'The side to play.',\n defaultValue: 'any',\n }),\n }),\n output: Schema.Struct({\n pgn: Schema.String.annotations({\n description: 'The PGN of the game after the move was played.',\n }),\n move: Schema.optional(Schema.String).annotations({\n description: 'The move that was played.',\n }),\n }),\n services: [Database.Service],\n});\n\nexport const Print = Operation.make({\n meta: {\n key: 'org.dxos.function.chess.print',\n name: 'Print game',\n description: 'Prints the chess game to ASCII.',\n },\n input: Schema.Struct({\n pgn: Schema.optional(\n Schema.String.annotations({\n description: 'Portable Game Notation.',\n }),\n ),\n fen: Schema.optional(\n Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }),\n ),\n }),\n output: Schema.Struct({\n ascii: Schema.String,\n }),\n});\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,WAAW;AAIvB,IAAMC,SAASC,UAAUC,KAAK;EACnCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBH,MAAaI,gBACJC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFM,KAAYH,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFO,KAAYJ,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA;EACAQ,QAAQC,cAAMC;EACdC,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMC,OAAOnB,UAAUC,KAAK;EACjCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBa,MAAMC,IAAIA,IAAIP,cAAMC,IAAI,EAAEL,YAAY;MACpCL,aAAa;IACf,CAAA;IACAiB,MAAab,cAAOC,YAAY;MAC9BL,aAAa;MACbkB,UAAU;QAAC;QAAM;;IACnB,CAAA;EACF,CAAA;EACAV,QAAeN,cAAO;IACpBI,KAAYF,cAAOC,YAAY;MAC7BL,aAAa;IACf,CAAA;EACF,CAAA;EACAW,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMM,OAAOxB,UAAUC,KAAK;EACjCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBa,MAAMC,IAAIA,IAAIP,cAAMC,IAAI,EAAEL,YAAY;MACpCL,aAAa;IACf,CAAA;IACAoB,MAAajB,gBAAgBkB,eAAQ,SAAS,SAAS,KAAA,CAAA,EAAQhB,YAAY;MACzEL,aAAa;MACbsB,cAAc;IAChB,CAAA;EACF,CAAA;EACAd,QAAeN,cAAO;IACpBI,KAAYF,cAAOC,YAAY;MAC7BL,aAAa;IACf,CAAA;IACAiB,MAAad,gBAAgBC,aAAM,EAAEC,YAAY;MAC/CL,aAAa;IACf,CAAA;EACF,CAAA;EACAW,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMU,QAAQ5B,UAAUC,KAAK;EAClCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBI,KAAYH,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;IAEFO,KAAYJ,gBACHC,cAAOC,YAAY;MACxBL,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA;EACAQ,QAAeN,cAAO;IACpBsB,OAAcpB;EAChB,CAAA;AACF,CAAA;",
|
|
6
|
+
"names": ["Schema", "Operation", "Database", "Ref", "Create", "Operation", "make", "meta", "key", "name", "description", "input", "Struct", "optional", "String", "annotations", "pgn", "fen", "output", "Chess", "Game", "services", "Database", "Service", "Move", "game", "Ref", "move", "examples", "Play", "side", "Literal", "defaultValue", "Print", "ascii"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Create
|
|
3
|
+
} from "./chunk-OBKYFOJA.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Chess_exports
|
|
6
|
+
} from "./chunk-IN3LZ2OO.mjs";
|
|
7
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
8
|
+
|
|
9
|
+
// src/operations/create.ts
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import { Operation } from "@dxos/compute";
|
|
12
|
+
import { Database } from "@dxos/echo";
|
|
13
|
+
var handler = Create.pipe(Operation.withHandler(Effect.fn(function* ({ name, pgn, fen }) {
|
|
14
|
+
return yield* Database.add(Chess_exports.make({
|
|
15
|
+
name,
|
|
16
|
+
pgn,
|
|
17
|
+
fen
|
|
18
|
+
}));
|
|
19
|
+
})));
|
|
20
|
+
var create_default = handler;
|
|
21
|
+
export {
|
|
22
|
+
create_default as default
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=create-2ME3FNBX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/create.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\nimport { Database } from '@dxos/echo';\n\nimport { Chess } from '../types';\nimport { Create } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Create> = Create.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ name, pgn, fen }) {\n return yield* Database.add(Chess.make({ name, pgn, fen }));\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;AAKzB,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,UAAG,WAAW,EAAEC,MAAMC,KAAKC,IAAG,GAAE;AACrC,SAAO,OAAOC,SAASC,IAAIC,cAAMC,KAAK;IAAEN;IAAMC;IAAKC;EAAI,CAAA,CAAA;AACzD,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAeR;",
|
|
6
|
+
"names": ["Effect", "Operation", "Database", "handler", "Create", "pipe", "Operation", "withHandler", "fn", "name", "pgn", "fen", "Database", "add", "Chess", "make"]
|
|
7
|
+
}
|
|
@@ -1,123 +1,42 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
move_default,
|
|
5
|
-
play_default
|
|
6
|
-
} from "./chunk-4ULSTPL6.mjs";
|
|
2
|
+
chess_blueprint_default
|
|
3
|
+
} from "./chunk-JYP24G6K.mjs";
|
|
7
4
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./chunk-
|
|
5
|
+
operations_exports
|
|
6
|
+
} from "./chunk-H6SON7WG.mjs";
|
|
7
|
+
import "./chunk-OBKYFOJA.mjs";
|
|
10
8
|
import {
|
|
11
|
-
ChessAction_exports,
|
|
12
9
|
Chess_exports
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import
|
|
15
|
-
Chessboard,
|
|
16
|
-
ExtendedChessModel
|
|
17
|
-
} from "./chunk-NR4YFUK7.mjs";
|
|
18
|
-
import {
|
|
19
|
-
meta
|
|
20
|
-
} from "./chunk-WSUUPPDK.mjs";
|
|
10
|
+
} from "./chunk-IN3LZ2OO.mjs";
|
|
11
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
21
12
|
|
|
22
|
-
// src/
|
|
23
|
-
import {
|
|
24
|
-
var BlueprintDefinition = lazy(() => import("./blueprint-definition-LC4GNYMG.mjs"));
|
|
25
|
-
var IntentResolver = lazy(() => import("./intent-resolver-PMP36Y5B.mjs"));
|
|
26
|
-
var ReactSurface = lazy(() => import("./react-surface-TSLFLTXN.mjs"));
|
|
13
|
+
// src/index.ts
|
|
14
|
+
import { Plugin } from "@dxos/app-framework";
|
|
27
15
|
|
|
28
|
-
// src/
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"rename object label": "Rename game",
|
|
45
|
-
"delete object label": "Delete game",
|
|
46
|
-
"toggle info button": "Toggle info",
|
|
47
|
-
"close info button": "Close info",
|
|
48
|
-
"flip board button": "Flip board",
|
|
49
|
-
"select player button": "Select player"
|
|
50
|
-
},
|
|
51
|
-
[meta.id]: {
|
|
52
|
-
"plugin name": "Chess",
|
|
53
|
-
"delete game label": "Delete",
|
|
54
|
-
"game.checkmate": "Checkmate",
|
|
55
|
-
"game.stalemate": "Stalemate",
|
|
56
|
-
"game.draw": "Draw",
|
|
57
|
-
"game.check": "Check"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
];
|
|
16
|
+
// src/meta.ts
|
|
17
|
+
import { trim } from "@dxos/util";
|
|
18
|
+
var meta = {
|
|
19
|
+
id: "org.dxos.plugin.chess",
|
|
20
|
+
name: "Chess",
|
|
21
|
+
description: trim`
|
|
22
|
+
Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.
|
|
23
|
+
Track game history and analyze moves in real-time.
|
|
24
|
+
`,
|
|
25
|
+
icon: "ph--shield-chevron--regular",
|
|
26
|
+
iconHue: "amber",
|
|
27
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess",
|
|
28
|
+
screenshots: [
|
|
29
|
+
"https://dxos.network/plugin-details-chess-dark.png"
|
|
30
|
+
]
|
|
31
|
+
};
|
|
62
32
|
|
|
63
|
-
// src/
|
|
64
|
-
var ChessPlugin =
|
|
65
|
-
defineModule({
|
|
66
|
-
id: `${meta.id}/module/translations`,
|
|
67
|
-
activatesOn: Events.SetupTranslations,
|
|
68
|
-
activate: () => contributes(Capabilities.Translations, translations)
|
|
69
|
-
}),
|
|
70
|
-
defineModule({
|
|
71
|
-
id: `${meta.id}/module/metadata`,
|
|
72
|
-
activatesOn: Events.SetupMetadata,
|
|
73
|
-
activate: () => contributes(Capabilities.Metadata, {
|
|
74
|
-
id: Chess_exports.Game.typename,
|
|
75
|
-
metadata: {
|
|
76
|
-
icon: "ph--shield-chevron--regular",
|
|
77
|
-
blueprints: [
|
|
78
|
-
BLUEPRINT_KEY
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
}),
|
|
83
|
-
defineModule({
|
|
84
|
-
id: `${meta.id}/module/object-form`,
|
|
85
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
86
|
-
activate: () => contributes(SpaceCapabilities.ObjectForm, defineObjectForm({
|
|
87
|
-
objectSchema: Chess_exports.Game,
|
|
88
|
-
getIntent: () => createIntent(ChessAction_exports.Create)
|
|
89
|
-
}))
|
|
90
|
-
}),
|
|
91
|
-
defineModule({
|
|
92
|
-
id: `${meta.id}/module/react-surface`,
|
|
93
|
-
activatesOn: Events.SetupReactSurface,
|
|
94
|
-
activate: ReactSurface
|
|
95
|
-
}),
|
|
96
|
-
defineModule({
|
|
97
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
98
|
-
activatesOn: Events.SetupIntentResolver,
|
|
99
|
-
activate: IntentResolver
|
|
100
|
-
}),
|
|
101
|
-
defineModule({
|
|
102
|
-
id: `${meta.id}/module/blueprint`,
|
|
103
|
-
activatesOn: Events.SetupArtifactDefinition,
|
|
104
|
-
activate: BlueprintDefinition
|
|
105
|
-
})
|
|
106
|
-
]);
|
|
33
|
+
// src/index.ts
|
|
34
|
+
var ChessPlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
107
35
|
export {
|
|
108
|
-
BLUEPRINT_KEY,
|
|
109
|
-
BlueprintDefinition,
|
|
110
36
|
Chess_exports as Chess,
|
|
111
|
-
|
|
37
|
+
chess_blueprint_default as ChessBlueprint,
|
|
38
|
+
operations_exports as ChessFunctions,
|
|
112
39
|
ChessPlugin,
|
|
113
|
-
|
|
114
|
-
ChessboardContainer,
|
|
115
|
-
ExtendedChessModel,
|
|
116
|
-
IntentResolver,
|
|
117
|
-
ReactSurface,
|
|
118
|
-
create_default as create,
|
|
119
|
-
meta,
|
|
120
|
-
move_default as move,
|
|
121
|
-
play_default as play
|
|
40
|
+
meta
|
|
122
41
|
};
|
|
123
42
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport * from './blueprints';\nexport * from './meta';\nexport * from './types';\n\nexport const ChessPlugin = Plugin.lazy(meta, () => import('#plugin'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.chess',\n name: 'Chess',\n description: trim`\n Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.\n Track game history and analyze moves in real-time.\n `,\n icon: 'ph--shield-chevron--regular',\n iconHue: 'amber',\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;;;ACCvB,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;EAIbK,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,aAAa;IAAC;;AAChB;;;ADNO,IAAMC,cAAcC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
|
|
6
|
+
"names": ["Plugin", "trim", "meta", "id", "name", "description", "icon", "iconHue", "source", "screenshots", "ChessPlugin", "Plugin", "lazy", "meta"]
|
|
7
7
|
}
|