@dxos/plugin-chess 0.8.4-main.1068cf700f → 0.8.4-main.1c7ec43d41
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 +9 -6
- package/dist/lib/browser/chunk-5FHUZILG.mjs +63 -0
- package/dist/lib/browser/chunk-5FHUZILG.mjs.map +7 -0
- package/dist/lib/browser/chunk-BCTL5GYK.mjs +88 -0
- package/dist/lib/browser/chunk-BCTL5GYK.mjs.map +7 -0
- package/dist/lib/browser/chunk-ORLWKOYE.mjs +26 -0
- package/dist/lib/browser/chunk-ORLWKOYE.mjs.map +7 -0
- package/dist/lib/browser/chunk-YER5TC5N.mjs +35 -0
- package/dist/lib/browser/chunk-YER5TC5N.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +27 -85
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/move-BH3WZUJH.mjs +39 -0
- package/dist/lib/browser/move-BH3WZUJH.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +17 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/play-IM4BDFSY.mjs +48 -0
- package/dist/lib/browser/play-IM4BDFSY.mjs.map +7 -0
- package/dist/lib/browser/print-M3ZO2XZT.mjs +30 -0
- package/dist/lib/browser/print-M3ZO2XZT.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +34 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/blueprints/index.mjs +9 -6
- package/dist/lib/node-esm/chunk-A3P4HC7O.mjs +89 -0
- package/dist/lib/node-esm/chunk-A3P4HC7O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-B42KRPBJ.mjs +37 -0
- package/dist/lib/node-esm/chunk-B42KRPBJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WSHXDK3W.mjs +27 -0
- package/dist/lib/node-esm/chunk-WSHXDK3W.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YRW4LYGF.mjs +64 -0
- package/dist/lib/node-esm/chunk-YRW4LYGF.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +27 -85
- 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-53HLCSAL.mjs +40 -0
- package/dist/lib/node-esm/move-53HLCSAL.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +18 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/play-YXXPG5SO.mjs +49 -0
- package/dist/lib/node-esm/play-YXXPG5SO.mjs.map +7 -0
- package/dist/lib/node-esm/print-L2LUM3IW.mjs +31 -0
- package/dist/lib/node-esm/print-L2LUM3IW.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +35 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/ChessPlugin.d.ts +1 -0
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- package/dist/types/src/ChessPlugin.node.d.ts +8 -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 +3 -20
- package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -2
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/game-variant.d.ts +6 -0
- package/dist/types/src/capabilities/game-variant.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +10 -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/components/{Chessboard.d.ts → Chessboard/Chessboard.d.ts} +10 -11
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +57 -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 +5 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +56 -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 +5 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -0
- package/dist/types/src/{components/Card.stories.d.ts → containers/ChessCard/ChessCard.stories.d.ts} +1 -1
- 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 +2 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +24 -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 +32 -23
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts +10 -19
- package/dist/types/src/types/Chess.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +66 -48
- package/src/ChessPlugin.node.ts +23 -0
- package/src/ChessPlugin.test.ts +49 -0
- package/src/ChessPlugin.tsx +14 -23
- package/src/blueprints/chess-blueprint.ts +14 -9
- package/src/blueprints/index.ts +2 -2
- package/src/capabilities/blueprint-definition.ts +19 -0
- package/src/capabilities/game-variant.ts +42 -0
- package/src/capabilities/index.ts +10 -2
- package/src/capabilities/node.ts +18 -0
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
- package/src/components/{Chessboard.tsx → Chessboard/Chessboard.tsx} +21 -31
- package/src/components/{Info.tsx → Chessboard/Info.tsx} +24 -77
- 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/{components/Chessboard.stories.tsx → containers/ChessArticle/ChessArticle.stories.tsx} +16 -10
- package/src/containers/ChessArticle/ChessArticle.tsx +108 -0
- package/src/containers/ChessArticle/index.ts +5 -0
- package/src/containers/ChessCard/ChessCard.stories.tsx +47 -0
- package/src/containers/ChessCard/ChessCard.tsx +27 -0
- package/src/containers/ChessCard/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/index.ts +5 -3
- package/src/meta.ts +1 -1
- package/src/operations/definitions.ts +83 -0
- package/src/operations/index.ts +15 -0
- package/src/operations/move.ts +37 -0
- package/src/operations/play.ts +46 -0
- package/src/operations/print.ts +28 -0
- package/src/translations.ts +18 -21
- package/src/types/Chess.ts +25 -24
- package/dist/lib/browser/ChessboardContainer-GNSIZKY7.mjs +0 -80
- package/dist/lib/browser/ChessboardContainer-GNSIZKY7.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-YUKJZPOL.mjs +0 -19
- package/dist/lib/browser/blueprint-definition-YUKJZPOL.mjs.map +0 -7
- package/dist/lib/browser/chunk-66H3V2YV.mjs +0 -64
- package/dist/lib/browser/chunk-66H3V2YV.mjs.map +0 -7
- package/dist/lib/browser/chunk-H3NUMCQ6.mjs +0 -21
- package/dist/lib/browser/chunk-H3NUMCQ6.mjs.map +0 -7
- package/dist/lib/browser/chunk-MABHE5SS.mjs +0 -277
- package/dist/lib/browser/chunk-MABHE5SS.mjs.map +0 -7
- package/dist/lib/browser/chunk-PBRN5Q4R.mjs +0 -227
- package/dist/lib/browser/chunk-PBRN5Q4R.mjs.map +0 -7
- package/dist/lib/browser/chunk-QGVMZ4PK.mjs +0 -8
- package/dist/lib/browser/chunk-QGVMZ4PK.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -29
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/react-surface-C52R6BRL.mjs +0 -38
- package/dist/lib/browser/react-surface-C52R6BRL.mjs.map +0 -7
- package/dist/lib/node-esm/ChessboardContainer-5OVYZMIW.mjs +0 -81
- package/dist/lib/node-esm/ChessboardContainer-5OVYZMIW.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-4HZ2HWWC.mjs +0 -20
- package/dist/lib/node-esm/blueprint-definition-4HZ2HWWC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3MAU6WHB.mjs +0 -228
- package/dist/lib/node-esm/chunk-3MAU6WHB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F5OMIM4F.mjs +0 -23
- package/dist/lib/node-esm/chunk-F5OMIM4F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IFK6UAKF.mjs +0 -10
- package/dist/lib/node-esm/chunk-IFK6UAKF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OUNGNJFP.mjs +0 -65
- package/dist/lib/node-esm/chunk-OUNGNJFP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V6MKXXPO.mjs +0 -278
- package/dist/lib/node-esm/chunk-V6MKXXPO.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -30
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-NW33JZ6J.mjs +0 -39
- package/dist/lib/node-esm/react-surface-NW33JZ6J.mjs.map +0 -7
- package/dist/types/src/blueprints/functions/create.d.ts +0 -15
- package/dist/types/src/blueprints/functions/create.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/index.d.ts +0 -5
- package/dist/types/src/blueprints/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/move.d.ts +0 -16
- package/dist/types/src/blueprints/functions/move.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/play.d.ts +0 -17
- package/dist/types/src/blueprints/functions/play.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/print.d.ts +0 -8
- package/dist/types/src/blueprints/functions/print.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts +0 -12
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -10
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts +0 -3
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- 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 -46
- package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardArticle.d.ts +0 -6
- package/dist/types/src/components/ChessboardArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardContainer.d.ts +0 -7
- package/dist/types/src/components/ChessboardContainer.d.ts.map +0 -1
- package/dist/types/src/components/Info.d.ts.map +0 -1
- package/src/blueprints/functions/create.ts +0 -38
- package/src/blueprints/functions/index.ts +0 -8
- package/src/blueprints/functions/move.ts +0 -48
- package/src/blueprints/functions/play.ts +0 -58
- package/src/blueprints/functions/print.ts +0 -42
- package/src/capabilities/artifact-definition/artifact-definition.ts +0 -135
- package/src/capabilities/artifact-definition/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -24
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -28
- package/src/cli/index.ts +0 -5
- package/src/cli/plugin.ts +0 -27
- package/src/components/Card.stories.tsx +0 -47
- package/src/components/ChessboardArticle.tsx +0 -70
- package/src/components/ChessboardContainer.tsx +0 -40
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
chess_blueprint_default
|
|
3
|
+
} from "../chunk-YER5TC5N.mjs";
|
|
4
|
+
import {
|
|
5
|
+
operations_exports
|
|
6
|
+
} from "../chunk-ORLWKOYE.mjs";
|
|
7
|
+
import "../chunk-BCTL5GYK.mjs";
|
|
8
|
+
import "../chunk-5FHUZILG.mjs";
|
|
6
9
|
import "../chunk-J5LGTIGS.mjs";
|
|
7
10
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
chess_blueprint_default as ChessBlueprint,
|
|
12
|
+
operations_exports as ChessFunctions
|
|
10
13
|
};
|
|
11
14
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
4
|
+
|
|
5
|
+
// src/types/Chess.ts
|
|
6
|
+
var Chess_exports = {};
|
|
7
|
+
__export(Chess_exports, {
|
|
8
|
+
BLUEPRINT_KEY: () => BLUEPRINT_KEY,
|
|
9
|
+
State: () => State,
|
|
10
|
+
make: () => make
|
|
11
|
+
});
|
|
12
|
+
import { Chess as ChessJS } from "chess.js";
|
|
13
|
+
import * as Schema from "effect/Schema";
|
|
14
|
+
import { BlueprintsAnnotation } from "@dxos/app-toolkit";
|
|
15
|
+
import { Annotation, Obj, Type } from "@dxos/echo";
|
|
16
|
+
import { FormInputAnnotation, SystemTypeAnnotation } from "@dxos/echo/internal";
|
|
17
|
+
import { log } from "@dxos/log";
|
|
18
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-chess/src/types/Chess.ts";
|
|
19
|
+
var BLUEPRINT_KEY = "org.dxos.blueprint.chess";
|
|
20
|
+
var State = Schema.Struct({
|
|
21
|
+
pgn: Schema.String.annotations({
|
|
22
|
+
description: "Portable Game Notation."
|
|
23
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
24
|
+
fen: Schema.String.annotations({
|
|
25
|
+
description: "Forsyth-Edwards Notation."
|
|
26
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional)
|
|
27
|
+
}).pipe(
|
|
28
|
+
Type.object({
|
|
29
|
+
typename: "org.dxos.type.chess.state",
|
|
30
|
+
version: "0.1.0"
|
|
31
|
+
}),
|
|
32
|
+
Annotation.IconAnnotation.set({
|
|
33
|
+
icon: "ph--shield-chevron--regular",
|
|
34
|
+
hue: "amber"
|
|
35
|
+
}),
|
|
36
|
+
BlueprintsAnnotation.set([
|
|
37
|
+
BLUEPRINT_KEY
|
|
38
|
+
]),
|
|
39
|
+
// Implementation detail of the unified `Game` schema. The user-facing object is `Game`;
|
|
40
|
+
// this state is only ever referenced via `Game.variant`. SystemType keeps it out of the
|
|
41
|
+
// navtree's typed branches so an orphaned state object doesn't reappear after the
|
|
42
|
+
// wrapping Game is deleted.
|
|
43
|
+
SystemTypeAnnotation.set(true)
|
|
44
|
+
);
|
|
45
|
+
var make = ({ pgn, fen } = {}) => {
|
|
46
|
+
const chess = new ChessJS();
|
|
47
|
+
if (pgn) {
|
|
48
|
+
try {
|
|
49
|
+
chess.loadPgn(pgn);
|
|
50
|
+
} catch {
|
|
51
|
+
log.warn(pgn, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 40, S: void 0 });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return Obj.make(State, {
|
|
55
|
+
pgn,
|
|
56
|
+
fen
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
Chess_exports
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=chunk-5FHUZILG.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 { BlueprintsAnnotation } from '@dxos/app-toolkit';\nimport { Annotation, Obj, Type } from '@dxos/echo';\nimport { FormInputAnnotation, SystemTypeAnnotation } from '@dxos/echo/internal';\nimport { log } from '@dxos/log';\n\nexport const BLUEPRINT_KEY = 'org.dxos.blueprint.chess';\n\n/**\n * Chess variant state. Referenced by the base `Game` object via `Game.variant`.\n * Players, name, and other game-shared fields live on the base `Game`.\n */\nexport const State = Schema.Struct({\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.state',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({\n icon: 'ph--shield-chevron--regular',\n hue: 'amber',\n }),\n BlueprintsAnnotation.set([BLUEPRINT_KEY]),\n // Implementation detail of the unified `Game` schema. The user-facing object is `Game`;\n // this state is only ever referenced via `Game.variant`. SystemType keeps it out of the\n // navtree's typed branches so an orphaned state object doesn't reappear after the\n // wrapping Game is deleted.\n SystemTypeAnnotation.set(true),\n);\n\nexport interface State extends Schema.Schema.Type<typeof State> {}\n\nexport const make = ({ pgn, fen }: { pgn?: string; fen?: string } = {}): State => {\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(State, {\n pgn,\n fen,\n });\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,4BAA4B;AACrC,SAASC,YAAYC,KAAKC,YAAY;AACtC,SAASC,qBAAqBC,4BAA4B;AAC1D,SAASC,WAAW;AAEpB,IAAA,eAAaC;;AAQTC,IAAAA,QAAa,cAAA;EACf,KAAQJ,cAAAA,YAAuB;IAC/BK,aAAYC;UACVF,oBAAa,IAAA,KAAA,GAAA,eAAA;EACf,KAAQJ,cAAAA,YAAuB;IAE/BD,aAAY;EACVQ,CAAAA,EAAAA,KAAAA,oBAAU,IAAA,KAAA,GAAA,eAAA;;EACVC,KAAS,OAAA;IAEXX,UAAAA;IACEY,SAAM;;EACNC,WAAK,eAAA,IAAA;IAEPd,MAAAA;IAA0BO,KAAAA;GAAc;EACxC,qBAAA,IAAA;IACA;EACA,CAAA;;;;;uBAQc,IAAIT,IAAAA;AAAAA;AAClB,IAAS,OAAA,CAAA,EAAA,KAAA,IAAA,IAAA,CAAA,MAAA;QACP,QAAI,IAAA,QAAA;WACFiB;AACF,QAAE;AACAT,YAAIU,QAAKC,GAAAA;IACX,QAAA;AACF,UAAA,KAAA,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;IAEA;;SAEER,IAAAA,KAAAA,OAAAA;IACF;IACA;;;",
|
|
6
|
+
"names": ["Chess", "ChessJS", "Schema", "BlueprintsAnnotation", "Annotation", "Obj", "Type", "FormInputAnnotation", "SystemTypeAnnotation", "log", "BLUEPRINT_KEY", "description", "fen", "String", "typename", "version", "icon", "hue", "chess", "warn", "pgn"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Chess_exports
|
|
3
|
+
} from "./chunk-5FHUZILG.mjs";
|
|
4
|
+
|
|
5
|
+
// src/operations/definitions.ts
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import { Operation } from "@dxos/compute";
|
|
8
|
+
import { Database } from "@dxos/echo";
|
|
9
|
+
import { GameRef } from "@dxos/plugin-game/types";
|
|
10
|
+
var Move = Operation.make({
|
|
11
|
+
meta: {
|
|
12
|
+
key: "org.dxos.function.chess.move",
|
|
13
|
+
name: "Move",
|
|
14
|
+
description: "Makes a move in the given chess game."
|
|
15
|
+
},
|
|
16
|
+
input: Schema.Struct({
|
|
17
|
+
game: GameRef(Chess_exports.State).annotations({
|
|
18
|
+
description: "The ID of the game object (variant must be Chess)."
|
|
19
|
+
}),
|
|
20
|
+
move: Schema.String.annotations({
|
|
21
|
+
description: "The move to make in the chess game.",
|
|
22
|
+
examples: [
|
|
23
|
+
"e4",
|
|
24
|
+
"Bf3"
|
|
25
|
+
]
|
|
26
|
+
})
|
|
27
|
+
}),
|
|
28
|
+
output: Schema.Struct({
|
|
29
|
+
pgn: Schema.String.annotations({
|
|
30
|
+
description: "The PGN of the game after the move was played."
|
|
31
|
+
})
|
|
32
|
+
}),
|
|
33
|
+
services: [
|
|
34
|
+
Database.Service
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
var Play = Operation.make({
|
|
38
|
+
meta: {
|
|
39
|
+
key: "org.dxos.function.chess.play",
|
|
40
|
+
name: "Play",
|
|
41
|
+
description: "Uses the chess engine to play the next move."
|
|
42
|
+
},
|
|
43
|
+
input: Schema.Struct({
|
|
44
|
+
game: GameRef(Chess_exports.State).annotations({
|
|
45
|
+
description: "The ID of the game object (variant must be Chess)."
|
|
46
|
+
}),
|
|
47
|
+
side: Schema.optional(Schema.Literal("white", "black", "any")).annotations({
|
|
48
|
+
description: "The side to play.",
|
|
49
|
+
defaultValue: "any"
|
|
50
|
+
})
|
|
51
|
+
}),
|
|
52
|
+
output: Schema.Struct({
|
|
53
|
+
pgn: Schema.String.annotations({
|
|
54
|
+
description: "The PGN of the game after the move was played."
|
|
55
|
+
}),
|
|
56
|
+
move: Schema.optional(Schema.String).annotations({
|
|
57
|
+
description: "The move that was played."
|
|
58
|
+
})
|
|
59
|
+
}),
|
|
60
|
+
services: [
|
|
61
|
+
Database.Service
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
var Print = Operation.make({
|
|
65
|
+
meta: {
|
|
66
|
+
key: "org.dxos.function.chess.print",
|
|
67
|
+
name: "Print game",
|
|
68
|
+
description: "Prints the chess game to ASCII."
|
|
69
|
+
},
|
|
70
|
+
input: Schema.Struct({
|
|
71
|
+
pgn: Schema.optional(Schema.String.annotations({
|
|
72
|
+
description: "Portable Game Notation."
|
|
73
|
+
})),
|
|
74
|
+
fen: Schema.optional(Schema.String.annotations({
|
|
75
|
+
description: "Forsyth-Edwards Notation."
|
|
76
|
+
}))
|
|
77
|
+
}),
|
|
78
|
+
output: Schema.Struct({
|
|
79
|
+
ascii: Schema.String
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
Move,
|
|
85
|
+
Play,
|
|
86
|
+
Print
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=chunk-BCTL5GYK.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 } from '@dxos/echo';\nimport { GameRef } from '@dxos/plugin-game/types';\n\nimport { Chess } from '../types';\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: GameRef(Chess.State).annotations({\n description: 'The ID of the game object (variant must be Chess).',\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: GameRef(Chess.State).annotations({\n description: 'The ID of the game object (variant must be Chess).',\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,gBAAgB;AACzB,SAASC,eAAe;AAIjB,IAAMC,OAAOC,UAAUC,KAAK;EACjCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBC,MAAMC,QAAQC,cAAMC,KAAK,EAAEC,YAAY;MACrCP,aAAa;IACf,CAAA;IACAQ,MAAaC,cAAOF,YAAY;MAC9BP,aAAa;MACbU,UAAU;QAAC;QAAM;;IACnB,CAAA;EACF,CAAA;EACAC,QAAeT,cAAO;IACpBU,KAAYH,cAAOF,YAAY;MAC7BP,aAAa;IACf,CAAA;EACF,CAAA;EACAa,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMC,OAAOrB,UAAUC,KAAK;EACjCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBC,MAAMC,QAAQC,cAAMC,KAAK,EAAEC,YAAY;MACrCP,aAAa;IACf,CAAA;IACAiB,MAAaC,gBAAgBC,eAAQ,SAAS,SAAS,KAAA,CAAA,EAAQZ,YAAY;MACzEP,aAAa;MACboB,cAAc;IAChB,CAAA;EACF,CAAA;EACAT,QAAeT,cAAO;IACpBU,KAAYH,cAAOF,YAAY;MAC7BP,aAAa;IACf,CAAA;IACAQ,MAAaU,gBAAgBT,aAAM,EAAEF,YAAY;MAC/CP,aAAa;IACf,CAAA;EACF,CAAA;EACAa,UAAU;IAACC,SAASC;;AACtB,CAAA;AAEO,IAAMM,QAAQ1B,UAAUC,KAAK;EAClCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBU,KAAYM,gBACHT,cAAOF,YAAY;MACxBP,aAAa;IACf,CAAA,CAAA;IAEFsB,KAAYJ,gBACHT,cAAOF,YAAY;MACxBP,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA;EACAW,QAAeT,cAAO;IACpBqB,OAAcd;EAChB,CAAA;AACF,CAAA;",
|
|
6
|
+
"names": ["Schema", "Operation", "Database", "GameRef", "Move", "Operation", "make", "meta", "key", "name", "description", "input", "Struct", "game", "GameRef", "Chess", "State", "annotations", "move", "String", "examples", "output", "pgn", "services", "Database", "Service", "Play", "side", "optional", "Literal", "defaultValue", "Print", "fen", "ascii"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Move,
|
|
3
|
+
Play,
|
|
4
|
+
Print
|
|
5
|
+
} from "./chunk-BCTL5GYK.mjs";
|
|
6
|
+
import {
|
|
7
|
+
__export
|
|
8
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
9
|
+
|
|
10
|
+
// src/operations/index.ts
|
|
11
|
+
var operations_exports = {};
|
|
12
|
+
__export(operations_exports, {
|
|
13
|
+
ChessHandlers: () => ChessHandlers,
|
|
14
|
+
Move: () => Move,
|
|
15
|
+
Play: () => Play,
|
|
16
|
+
Print: () => Print
|
|
17
|
+
});
|
|
18
|
+
import { OperationHandlerSet } from "@dxos/compute";
|
|
19
|
+
var Handlers = OperationHandlerSet.lazy(() => import("./move-BH3WZUJH.mjs"), () => import("./play-IM4BDFSY.mjs"), () => import("./print-M3ZO2XZT.mjs"));
|
|
20
|
+
var ChessHandlers = Handlers;
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
ChessHandlers,
|
|
24
|
+
operations_exports
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=chunk-ORLWKOYE.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('./move'),\n () => import('./play'),\n () => import('./print'),\n);\n\nexport { Move, Play, Print } from './definitions';\n\nexport const ChessHandlers = Handlers;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAAA;;;;;;;AAIA,SAASA,2BAA2B;AAEpC,IAAMC,WAAWD,oBAAoBE,KACnC,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,35 @@
|
|
|
1
|
+
// src/blueprints/chess-blueprint.ts
|
|
2
|
+
import { Blueprint, Template } from "@dxos/compute";
|
|
3
|
+
import { trim } from "@dxos/util";
|
|
4
|
+
import { Move, Play, Print } from "#operations";
|
|
5
|
+
import { Chess } from "#types";
|
|
6
|
+
var operations = [
|
|
7
|
+
Move,
|
|
8
|
+
Play,
|
|
9
|
+
Print
|
|
10
|
+
];
|
|
11
|
+
var make = () => Blueprint.make({
|
|
12
|
+
key: Chess.BLUEPRINT_KEY,
|
|
13
|
+
name: "Chess",
|
|
14
|
+
tools: Blueprint.toolDefinitions({
|
|
15
|
+
operations
|
|
16
|
+
}),
|
|
17
|
+
instructions: Template.make({
|
|
18
|
+
source: trim`
|
|
19
|
+
You are an expert chess player.
|
|
20
|
+
To analyze a game you can access the "pgn" property by loading the context object that represents the current game.
|
|
21
|
+
You could suggest a good next move or offer to play a move.
|
|
22
|
+
Don't actually make a move unless you are asked to.
|
|
23
|
+
`
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
var blueprint = {
|
|
27
|
+
key: Chess.BLUEPRINT_KEY,
|
|
28
|
+
make
|
|
29
|
+
};
|
|
30
|
+
var chess_blueprint_default = blueprint;
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
chess_blueprint_default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=chunk-YER5TC5N.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 { Move, Play, Print } from '#operations';\nimport { Chess } from '#types';\n\nconst operations = [Move, Play, Print];\n\nconst make = () =>\n Blueprint.make({\n key: Chess.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: Chess.BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAErB,SAASC,MAAMC,MAAMC,aAAa;AAClC,SAASC,aAAa;AAEtB,IAAMC,aAAa;EAACJ;EAAMC;EAAMC;;AAEhC,IAAMG,OAAO,MACXR,UAAUQ,KAAK;EACbC,KAAKH,MAAMI;EACXC,MAAM;EACNC,OAAOZ,UAAUa,gBAAgB;IAAEN;EAAW,CAAA;EAC9CO,cAAcb,SAASO,KAAK;IAC1BO,QAAQb;;;;;;EAMV,CAAA;AACF,CAAA;AAEF,IAAMc,YAAkC;EACtCP,KAAKH,MAAMI;EACXF;AACF;AAEA,IAAA,0BAAeQ;",
|
|
6
|
+
"names": ["Blueprint", "Template", "trim", "Move", "Play", "Print", "Chess", "operations", "make", "key", "BLUEPRINT_KEY", "name", "tools", "toolDefinitions", "instructions", "source", "blueprint"]
|
|
7
|
+
}
|
|
@@ -1,100 +1,42 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./chunk-PBRN5Q4R.mjs";
|
|
2
|
+
chess_blueprint_default
|
|
3
|
+
} from "./chunk-YER5TC5N.mjs";
|
|
5
4
|
import {
|
|
6
|
-
|
|
7
|
-
} from "./chunk-
|
|
5
|
+
operations_exports
|
|
6
|
+
} from "./chunk-ORLWKOYE.mjs";
|
|
7
|
+
import "./chunk-BCTL5GYK.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Chess_exports
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
Chessboard,
|
|
13
|
-
ExtendedChessModel
|
|
14
|
-
} from "./chunk-MABHE5SS.mjs";
|
|
15
|
-
import {
|
|
16
|
-
meta
|
|
17
|
-
} from "./chunk-H3NUMCQ6.mjs";
|
|
10
|
+
} from "./chunk-5FHUZILG.mjs";
|
|
18
11
|
import "./chunk-J5LGTIGS.mjs";
|
|
19
12
|
|
|
20
|
-
// src/
|
|
21
|
-
import { Capability } from "@dxos/app-framework";
|
|
22
|
-
var BlueprintDefinition = Capability.lazy("BlueprintDefinition", () => import("./blueprint-definition-YUKJZPOL.mjs"));
|
|
23
|
-
|
|
24
|
-
// src/capabilities/react-surface/index.ts
|
|
25
|
-
import { Capability as Capability2 } from "@dxos/app-framework";
|
|
26
|
-
var ReactSurface = Capability2.lazy("ReactSurface", () => import("./react-surface-C52R6BRL.mjs"));
|
|
27
|
-
|
|
28
|
-
// src/ChessPlugin.tsx
|
|
29
|
-
import * as Effect from "effect/Effect";
|
|
13
|
+
// src/index.ts
|
|
30
14
|
import { Plugin } from "@dxos/app-framework";
|
|
31
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
32
|
-
|
|
33
|
-
// src/translations.ts
|
|
34
|
-
var translations = [
|
|
35
|
-
{
|
|
36
|
-
"en-US": {
|
|
37
|
-
[Chess_exports.Game.typename]: {
|
|
38
|
-
"typename label": "Game",
|
|
39
|
-
"typename label_zero": "Games",
|
|
40
|
-
"typename label_one": "Game",
|
|
41
|
-
"typename label_other": "Games",
|
|
42
|
-
"object name placeholder": "New game",
|
|
43
|
-
"rename object label": "Rename game",
|
|
44
|
-
"delete object label": "Delete game",
|
|
45
|
-
"object deleted label": "Game deleted"
|
|
46
|
-
},
|
|
47
|
-
[meta.id]: {
|
|
48
|
-
"plugin name": "Chess",
|
|
49
|
-
"delete game label": "Delete",
|
|
50
|
-
"game.checkmate label": "Checkmate",
|
|
51
|
-
"game.stalemate label": "Stalemate",
|
|
52
|
-
"game.draw label": "Draw",
|
|
53
|
-
"game.check label": "Check",
|
|
54
|
-
"select player button": "Select player",
|
|
55
|
-
"toggle info button": "Toggle info",
|
|
56
|
-
"close info button": "Close info",
|
|
57
|
-
"flip board button": "Flip board"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
];
|
|
62
15
|
|
|
63
|
-
// src/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}), AppPlugin.addSchemaModule({
|
|
80
|
-
schema: [
|
|
81
|
-
Chess_exports.Game
|
|
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"
|
|
82
30
|
]
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}), Plugin.make);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/index.ts
|
|
34
|
+
var ChessPlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
88
35
|
export {
|
|
89
|
-
BlueprintDefinition,
|
|
90
36
|
Chess_exports as Chess,
|
|
91
|
-
|
|
92
|
-
|
|
37
|
+
chess_blueprint_default as ChessBlueprint,
|
|
38
|
+
operations_exports as ChessFunctions,
|
|
93
39
|
ChessPlugin,
|
|
94
|
-
Chessboard,
|
|
95
|
-
ChessboardContainer,
|
|
96
|
-
ExtendedChessModel,
|
|
97
|
-
ReactSurface,
|
|
98
40
|
meta
|
|
99
41
|
};
|
|
100
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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/types/Chess.ts":{"bytes":5679,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":508,"imports":[{"path":"src/types/Chess.ts","kind":"import-statement","original":"./Chess"}],"format":"esm"},"src/blueprints/functions/create.ts":{"bytes":3779,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../../types"}],"format":"esm"},"src/blueprints/functions/move.ts":{"bytes":5270,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../../types"}],"format":"esm"},"src/blueprints/functions/play.ts":{"bytes":6961,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../../types"}],"format":"esm"},"src/blueprints/functions/print.ts":{"bytes":4017,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true}],"format":"esm"},"src/blueprints/functions/index.ts":{"bytes":1031,"imports":[{"path":"src/blueprints/functions/create.ts","kind":"import-statement","original":"./create"},{"path":"src/blueprints/functions/move.ts","kind":"import-statement","original":"./move"},{"path":"src/blueprints/functions/play.ts","kind":"import-statement","original":"./play"},{"path":"src/blueprints/functions/print.ts","kind":"import-statement","original":"./print"}],"format":"esm"},"src/blueprints/chess-blueprint.ts":{"bytes":3090,"imports":[{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/blueprints/functions/index.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"src/blueprints/index.ts":{"bytes":747,"imports":[{"path":"src/blueprints/chess-blueprint.ts","kind":"import-statement","original":"./chess-blueprint"},{"path":"src/blueprints/functions/index.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"src/capabilities/blueprint-definition/blueprint-definition.ts":{"bytes":2496,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"src/blueprints/index.ts","kind":"import-statement","original":"../../blueprints"}],"format":"esm"},"src/capabilities/blueprint-definition/index.ts":{"bytes":977,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/blueprint-definition/blueprint-definition.ts","kind":"dynamic-import","original":"./blueprint-definition"}],"format":"esm"},"src/meta.ts":{"bytes":2043,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/Info.tsx":{"bytes":24665,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/echo","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-gameboard","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/components/Chessboard.tsx":{"bytes":14405,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-sfx","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/Info.tsx","kind":"import-statement","original":"./Info"}],"format":"esm"},"src/components/ChessboardArticle.tsx":{"bytes":7810,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"}],"format":"esm"},"src/components/ChessboardContainer.tsx":{"bytes":3312,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/components/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"},{"path":"src/components/ChessboardArticle.tsx","kind":"import-statement","original":"./ChessboardArticle"}],"format":"esm"},"src/components/index.ts":{"bytes":877,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"},{"path":"src/components/ChessboardContainer.tsx","kind":"dynamic-import","original":"./ChessboardContainer"}],"format":"esm"},"src/capabilities/react-surface/react-surface.tsx":{"bytes":3726,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../../types"}],"format":"esm"},"src/capabilities/react-surface/index.ts":{"bytes":909,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":602,"imports":[{"path":"src/capabilities/blueprint-definition/index.ts","kind":"import-statement","original":"./blueprint-definition"},{"path":"src/capabilities/react-surface/index.ts","kind":"import-statement","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":3591,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/ChessPlugin.tsx":{"bytes":4505,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"src/blueprints/index.ts","kind":"import-statement","original":"./blueprints"},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":916,"imports":[{"path":"src/blueprints/index.ts","kind":"import-statement","original":"./blueprints"},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"},"src/cli/plugin.ts":{"bytes":2850,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/cli/index.ts":{"bytes":458,"imports":[{"path":"src/cli/plugin.ts","kind":"import-statement","original":"./plugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4618},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-PBRN5Q4R.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-QGVMZ4PK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-66H3V2YV.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-MABHE5SS.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-H3NUMCQ6.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/blueprint-definition-YUKJZPOL.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/react-surface-C52R6BRL.mjs","kind":"dynamic-import"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true}],"exports":["BlueprintDefinition","Chess","ChessBlueprint","ChessFunctions","ChessPlugin","Chessboard","ChessboardContainer","ExtendedChessModel","ReactSurface","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/capabilities/blueprint-definition/index.ts":{"bytesInOutput":169},"src/capabilities/index.ts":{"bytesInOutput":0},"src/capabilities/react-surface/index.ts":{"bytesInOutput":164},"src/ChessPlugin.tsx":{"bytesInOutput":806},"src/translations.ts":{"bytesInOutput":879}},"bytes":2820},"dist/lib/browser/blueprints/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/blueprints/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-PBRN5Q4R.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-66H3V2YV.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["ChessBlueprint","ChessFunctions"],"entryPoint":"src/blueprints/index.ts","inputs":{},"bytes":282},"dist/lib/browser/cli/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1475},"dist/lib/browser/cli/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-66H3V2YV.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-H3NUMCQ6.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true}],"exports":["ChessPlugin"],"entryPoint":"src/cli/index.ts","inputs":{"src/cli/plugin.ts":{"bytesInOutput":486},"src/cli/index.ts":{"bytesInOutput":0}},"bytes":706},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-66H3V2YV.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["Chess"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":161},"dist/lib/browser/blueprint-definition-YUKJZPOL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1351},"dist/lib/browser/blueprint-definition-YUKJZPOL.mjs":{"imports":[{"path":"dist/lib/browser/chunk-PBRN5Q4R.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-66H3V2YV.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/blueprint-definition/blueprint-definition.ts","inputs":{"src/capabilities/blueprint-definition/blueprint-definition.ts":{"bytesInOutput":458}},"bytes":765},"dist/lib/browser/chunk-PBRN5Q4R.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11705},"dist/lib/browser/chunk-PBRN5Q4R.mjs":{"imports":[{"path":"dist/lib/browser/chunk-66H3V2YV.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true}],"exports":["chess_blueprint_exports","functions_exports"],"inputs":{"src/blueprints/chess-blueprint.ts":{"bytesInOutput":836},"src/blueprints/functions/index.ts":{"bytesInOutput":179},"src/blueprints/functions/create.ts":{"bytesInOutput":875},"src/blueprints/functions/move.ts":{"bytesInOutput":1307},"src/blueprints/functions/play.ts":{"bytesInOutput":1757},"src/blueprints/functions/print.ts":{"bytesInOutput":956},"src/blueprints/index.ts":{"bytesInOutput":0}},"bytes":6386},"dist/lib/browser/ChessboardContainer-GNSIZKY7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5870},"dist/lib/browser/ChessboardContainer-GNSIZKY7.mjs":{"imports":[{"path":"dist/lib/browser/chunk-MABHE5SS.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-H3NUMCQ6.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["ChessboardContainer","default"],"entryPoint":"src/components/ChessboardContainer.tsx","inputs":{"src/components/ChessboardContainer.tsx":{"bytesInOutput":659},"src/components/ChessboardArticle.tsx":{"bytesInOutput":1801}},"bytes":2852},"dist/lib/browser/react-surface-C52R6BRL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1803},"dist/lib/browser/react-surface-C52R6BRL.mjs":{"imports":[{"path":"dist/lib/browser/chunk-QGVMZ4PK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-66H3V2YV.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-MABHE5SS.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-H3NUMCQ6.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface/react-surface.tsx","inputs":{"src/capabilities/react-surface/react-surface.tsx":{"bytesInOutput":767}},"bytes":1146},"dist/lib/browser/chunk-QGVMZ4PK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":413},"dist/lib/browser/chunk-QGVMZ4PK.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/browser/ChessboardContainer-GNSIZKY7.mjs","kind":"dynamic-import"}],"exports":["ChessboardContainer"],"inputs":{"src/components/index.ts":{"bytesInOutput":114}},"bytes":220},"dist/lib/browser/chunk-66H3V2YV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2847},"dist/lib/browser/chunk-66H3V2YV.mjs":{"imports":[{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Chess_exports"],"inputs":{"src/types/Chess.ts":{"bytesInOutput":1523},"src/types/index.ts":{"bytesInOutput":0}},"bytes":1670},"dist/lib/browser/chunk-MABHE5SS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21056},"dist/lib/browser/chunk-MABHE5SS.mjs":{"imports":[{"path":"dist/lib/browser/chunk-H3NUMCQ6.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-sfx","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/echo","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-gameboard","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["Chessboard","ExtendedChessModel"],"inputs":{"src/components/Chessboard.tsx":{"bytesInOutput":3202},"src/components/Info.tsx":{"bytesInOutput":6379}},"bytes":9816},"dist/lib/browser/chunk-H3NUMCQ6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":975},"dist/lib/browser/chunk-H3NUMCQ6.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":515}},"bytes":594},"dist/lib/browser/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":1964,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/blueprints/chess-blueprint.ts":{"bytes":3127,"imports":[{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#operations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/types/Chess.ts":{"bytes":6313,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":422,"imports":[{"path":"src/types/Chess.ts","kind":"import-statement","original":"./Chess"}],"format":"esm"},"src/operations/definitions.ts":{"bytes":7902,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game/types","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/operations/move.ts":{"bytes":3635,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game/types","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/operations/play.ts":{"bytes":4895,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game/types","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/operations/print.ts":{"bytes":2286,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/operations/index.ts":{"bytes":1289,"imports":[{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"src/operations/definitions.ts","kind":"import-statement","original":"./definitions"},{"path":"src/operations/move.ts","kind":"dynamic-import","original":"./move"},{"path":"src/operations/play.ts","kind":"dynamic-import","original":"./play"},{"path":"src/operations/print.ts","kind":"dynamic-import","original":"./print"}],"format":"esm"},"src/blueprints/index.ts":{"bytes":700,"imports":[{"path":"src/blueprints/chess-blueprint.ts","kind":"import-statement","original":"./chess-blueprint"},{"path":"src/operations/index.ts","kind":"import-statement","original":"../operations"}],"format":"esm"},"src/index.ts":{"bytes":1105,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/blueprints/index.ts","kind":"import-statement","original":"./blueprints"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/translations.ts":{"bytes":3118,"imports":[{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1411},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-YER5TC5N.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-ORLWKOYE.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-BCTL5GYK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-5FHUZILG.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["Chess","ChessBlueprint","ChessFunctions","ChessPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":108},"src/meta.ts":{"bytesInOutput":515}},"bytes":1098},"dist/lib/browser/blueprints/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/blueprints/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-YER5TC5N.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-ORLWKOYE.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-BCTL5GYK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-5FHUZILG.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["ChessBlueprint","ChessFunctions"],"entryPoint":"src/blueprints/index.ts","inputs":{},"bytes":356},"dist/lib/browser/chunk-YER5TC5N.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1579},"dist/lib/browser/chunk-YER5TC5N.mjs":{"imports":[{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#operations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["chess_blueprint_default"],"inputs":{"src/blueprints/chess-blueprint.ts":{"bytesInOutput":808},"src/blueprints/index.ts":{"bytesInOutput":0}},"bytes":928},"dist/lib/browser/operations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/operations/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-ORLWKOYE.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-BCTL5GYK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-5FHUZILG.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["ChessHandlers","Move","Play","Print"],"entryPoint":"src/operations/index.ts","inputs":{},"bytes":274},"dist/lib/browser/chunk-ORLWKOYE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":660},"dist/lib/browser/chunk-ORLWKOYE.mjs":{"imports":[{"path":"dist/lib/browser/chunk-BCTL5GYK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"dist/lib/browser/move-BH3WZUJH.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/play-IM4BDFSY.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/print-M3ZO2XZT.mjs","kind":"dynamic-import"}],"exports":["ChessHandlers","operations_exports"],"inputs":{"src/operations/index.ts":{"bytesInOutput":399}},"bytes":637},"dist/lib/browser/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1492},"dist/lib/browser/translations.mjs":{"imports":[{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":805}},"bytes":929},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-5FHUZILG.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["Chess"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":161},"dist/lib/browser/move-BH3WZUJH.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1989},"dist/lib/browser/move-BH3WZUJH.mjs":{"imports":[{"path":"dist/lib/browser/chunk-BCTL5GYK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-5FHUZILG.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game/types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/move.ts","inputs":{"src/operations/move.ts":{"bytesInOutput":738}},"bytes":980},"dist/lib/browser/play-IM4BDFSY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2662},"dist/lib/browser/play-IM4BDFSY.mjs":{"imports":[{"path":"dist/lib/browser/chunk-BCTL5GYK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-5FHUZILG.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game/types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/play.ts","inputs":{"src/operations/play.ts":{"bytesInOutput":1039}},"bytes":1281},"dist/lib/browser/print-M3ZO2XZT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1248},"dist/lib/browser/print-M3ZO2XZT.mjs":{"imports":[{"path":"dist/lib/browser/chunk-BCTL5GYK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-5FHUZILG.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/print.ts","inputs":{"src/operations/print.ts":{"bytesInOutput":438}},"bytes":659},"dist/lib/browser/chunk-BCTL5GYK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3872},"dist/lib/browser/chunk-BCTL5GYK.mjs":{"imports":[{"path":"dist/lib/browser/chunk-5FHUZILG.mjs","kind":"import-statement"},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game/types","kind":"import-statement","external":true}],"exports":["Move","Play","Print"],"inputs":{"src/operations/definitions.ts":{"bytesInOutput":2089}},"bytes":2260},"dist/lib/browser/chunk-5FHUZILG.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2949},"dist/lib/browser/chunk-5FHUZILG.mjs":{"imports":[{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Chess_exports"],"inputs":{"src/types/Chess.ts":{"bytesInOutput":1747},"src/types/index.ts":{"bytesInOutput":0}},"bytes":1894},"dist/lib/browser/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Move
|
|
3
|
+
} from "./chunk-BCTL5GYK.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Chess_exports
|
|
6
|
+
} from "./chunk-5FHUZILG.mjs";
|
|
7
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
8
|
+
|
|
9
|
+
// src/operations/move.ts
|
|
10
|
+
import { Chess as ChessJS } from "chess.js";
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import { Operation } from "@dxos/compute";
|
|
13
|
+
import { Obj } from "@dxos/echo";
|
|
14
|
+
import { loadGame } from "@dxos/plugin-game/types";
|
|
15
|
+
var handler = Move.pipe(Operation.withHandler(Effect.fn(function* ({ game, move }) {
|
|
16
|
+
const { variant } = yield* loadGame(game, Chess_exports.State);
|
|
17
|
+
const chess = new ChessJS();
|
|
18
|
+
if (variant.pgn) {
|
|
19
|
+
chess.loadPgn(variant.pgn);
|
|
20
|
+
} else if (variant.fen) {
|
|
21
|
+
chess.load(variant.fen);
|
|
22
|
+
}
|
|
23
|
+
chess.move(move, {
|
|
24
|
+
strict: false
|
|
25
|
+
});
|
|
26
|
+
const pgn = chess.pgn();
|
|
27
|
+
Obj.update(variant, (variant2) => {
|
|
28
|
+
const mutable = variant2;
|
|
29
|
+
mutable.pgn = pgn;
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
pgn
|
|
33
|
+
};
|
|
34
|
+
})));
|
|
35
|
+
var move_default = handler;
|
|
36
|
+
export {
|
|
37
|
+
move_default as default
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=move-BH3WZUJH.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/move.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\nimport { Obj } from '@dxos/echo';\nimport { loadGame } from '@dxos/plugin-game/types';\n\nimport { Chess } from '../types';\nimport { Move } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Move> = Move.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ game, move }) {\n const { variant } = yield* loadGame(game, Chess.State);\n const chess = new ChessJS();\n if (variant.pgn) {\n chess.loadPgn(variant.pgn);\n } else if (variant.fen) {\n chess.load(variant.fen);\n }\n\n chess.move(move, { strict: false });\n const pgn = chess.pgn();\n Obj.update(variant, (variant) => {\n const mutable = variant as Obj.Mutable<typeof variant>;\n mutable.pgn = pgn;\n });\n return { pgn };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,gBAAgB;AAKzB,IAAMC,UAA8CC,KAAKC,KACvDC,UAAUC,YACDC,UAAG,WAAW,EAAEC,MAAMC,KAAI,GAAE;AACjC,QAAM,EAAEC,QAAO,IAAK,OAAOC,SAASH,MAAMI,cAAMC,KAAK;AACrD,QAAMC,QAAQ,IAAIC,QAAAA;AAClB,MAAIL,QAAQM,KAAK;AACfF,UAAMG,QAAQP,QAAQM,GAAG;EAC3B,WAAWN,QAAQQ,KAAK;AACtBJ,UAAMK,KAAKT,QAAQQ,GAAG;EACxB;AAEAJ,QAAML,KAAKA,MAAM;IAAEW,QAAQ;EAAM,CAAA;AACjC,QAAMJ,MAAMF,MAAME,IAAG;AACrBK,MAAIC,OAAOZ,SAAS,CAACA,aAAAA;AACnB,UAAMa,UAAUb;AAChBa,YAAQP,MAAMA;EAChB,CAAA;AACA,SAAO;IAAEA;EAAI;AACf,CAAA,CAAA,CAAA;AAIJ,IAAA,eAAed;",
|
|
6
|
+
"names": ["Chess", "ChessJS", "Effect", "Operation", "Obj", "loadGame", "handler", "Move", "pipe", "Operation", "withHandler", "fn", "game", "move", "variant", "loadGame", "Chess", "State", "chess", "ChessJS", "pgn", "loadPgn", "fen", "load", "strict", "Obj", "update", "mutable"]
|
|
7
|
+
}
|