@dxos/plugin-chess 0.8.4-main.f9ba587 → 0.8.4-main.fcc0d83b33
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 +43 -0
- package/dist/lib/browser/blueprints/index.mjs.map +7 -0
- package/dist/lib/browser/chunk-2DFOUJBD.mjs +28 -0
- package/dist/lib/browser/chunk-2DFOUJBD.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-J5LGTIGS.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/cli/index.mjs +34 -0
- package/dist/lib/browser/cli/index.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 +331 -85
- 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 +4 -7
- package/dist/lib/node-esm/blueprints/index.mjs +44 -0
- package/dist/lib/node-esm/blueprints/index.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-OHBKSL2Q.mjs +63 -0
- package/dist/lib/node-esm/chunk-OHBKSL2Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-V4FN2DZR.mjs +29 -0
- package/dist/lib/node-esm/chunk-V4FN2DZR.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +35 -0
- package/dist/lib/node-esm/cli/index.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 +331 -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-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 +4 -7
- package/dist/types/src/ChessPlugin.d.ts +2 -1
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- 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 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- 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/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +3 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/Chessboard.d.ts +38 -0
- 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/Chessboard/Info.d.ts +20 -0
- 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 +1 -5
- 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 +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- 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 -12
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts +27 -0
- package/dist/types/src/types/Chess.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +82 -42
- package/src/ChessPlugin.test.ts +51 -0
- package/src/ChessPlugin.tsx +42 -54
- package/src/blueprints/chess-blueprint.ts +34 -0
- package/src/blueprints/index.ts +6 -0
- package/src/capabilities/artifact-definition.ts +108 -97
- package/src/capabilities/blueprint-definition.ts +17 -0
- package/src/capabilities/index.ts +8 -4
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/capabilities/react-surface.tsx +27 -22
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +37 -0
- package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
- package/src/components/Chessboard/Chessboard.tsx +180 -0
- package/src/components/Chessboard/Info.tsx +253 -0
- package/src/components/Chessboard/index.ts +5 -0
- package/src/components/Chessboard/types.ts +18 -0
- package/src/components/index.ts +2 -6
- 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 +1 -2
- package/src/meta.ts +9 -7
- 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 +22 -10
- package/src/types/Chess.ts +62 -0
- package/src/types/index.ts +1 -2
- package/dist/lib/browser/ChessContainer-DL5J6VIK.mjs +0 -101
- package/dist/lib/browser/ChessContainer-DL5J6VIK.mjs.map +0 -7
- package/dist/lib/browser/artifact-definition-4AMZY5LQ.mjs +0 -182
- package/dist/lib/browser/artifact-definition-4AMZY5LQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-2VF6U52K.mjs +0 -8
- package/dist/lib/browser/chunk-2VF6U52K.mjs.map +0 -7
- package/dist/lib/browser/chunk-A3WEUKPK.mjs +0 -61
- package/dist/lib/browser/chunk-A3WEUKPK.mjs.map +0 -7
- package/dist/lib/browser/chunk-AZSYKAFK.mjs +0 -61
- package/dist/lib/browser/chunk-AZSYKAFK.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-KQYYX44R.mjs +0 -28
- package/dist/lib/browser/intent-resolver-KQYYX44R.mjs.map +0 -7
- package/dist/lib/browser/react-surface-4TBVZUKU.mjs +0 -43
- package/dist/lib/browser/react-surface-4TBVZUKU.mjs.map +0 -7
- package/dist/lib/node-esm/ChessContainer-WVOL2KSE.mjs +0 -102
- package/dist/lib/node-esm/ChessContainer-WVOL2KSE.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-TT3747JB.mjs +0 -183
- package/dist/lib/node-esm/artifact-definition-TT3747JB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2DRWEDVT.mjs +0 -63
- package/dist/lib/node-esm/chunk-2DRWEDVT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IS3Y25PL.mjs +0 -63
- package/dist/lib/node-esm/chunk-IS3Y25PL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TD2SWK2H.mjs +0 -10
- package/dist/lib/node-esm/chunk-TD2SWK2H.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-GXK2JROQ.mjs +0 -29
- package/dist/lib/node-esm/intent-resolver-GXK2JROQ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-PAUEOIBL.mjs +0 -44
- package/dist/lib/node-esm/react-surface-PAUEOIBL.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/ChessComponent.d.ts +0 -6
- package/dist/types/src/components/ChessComponent.d.ts.map +0 -1
- package/dist/types/src/components/ChessContainer.d.ts +0 -8
- package/dist/types/src/components/ChessContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChessPanel.d.ts +0 -11
- package/dist/types/src/components/ChessPanel.d.ts.map +0 -1
- package/dist/types/src/components/Chessboard.stories.d.ts +0 -8
- package/dist/types/src/components/Chessboard.stories.d.ts.map +0 -1
- package/dist/types/src/components/PlayerSelector.d.ts +0 -8
- package/dist/types/src/components/PlayerSelector.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -29
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -32
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -26
- package/src/components/ChessComponent.tsx +0 -54
- package/src/components/ChessContainer.tsx +0 -35
- package/src/components/ChessPanel.tsx +0 -67
- package/src/components/Chessboard.stories.tsx +0 -39
- package/src/components/PlayerSelector.tsx +0 -80
- package/src/types/schema.ts +0 -34
- package/src/types/types.ts +0 -20
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
operations_exports
|
|
3
|
+
} from "../chunk-2DFOUJBD.mjs";
|
|
4
|
+
import "../chunk-OBKYFOJA.mjs";
|
|
5
|
+
import "../chunk-IN3LZ2OO.mjs";
|
|
6
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
7
|
+
|
|
8
|
+
// src/blueprints/chess-blueprint.ts
|
|
9
|
+
import { Blueprint, Template } from "@dxos/compute";
|
|
10
|
+
import { trim } from "@dxos/util";
|
|
11
|
+
import { Create, Move, Play, Print } from "#operations";
|
|
12
|
+
var BLUEPRINT_KEY = "org.dxos.blueprint.chess";
|
|
13
|
+
var operations = [
|
|
14
|
+
Create,
|
|
15
|
+
Move,
|
|
16
|
+
Play,
|
|
17
|
+
Print
|
|
18
|
+
];
|
|
19
|
+
var make = () => Blueprint.make({
|
|
20
|
+
key: BLUEPRINT_KEY,
|
|
21
|
+
name: "Chess",
|
|
22
|
+
tools: Blueprint.toolDefinitions({
|
|
23
|
+
operations
|
|
24
|
+
}),
|
|
25
|
+
instructions: Template.make({
|
|
26
|
+
source: trim`
|
|
27
|
+
You are an expert chess player.
|
|
28
|
+
To analyze a game you can access the "pgn" property by loading the context object that represents the current game.
|
|
29
|
+
You could suggest a good next move or offer to play a move.
|
|
30
|
+
Don't actually make a move unless you are asked to.
|
|
31
|
+
`
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
var blueprint = {
|
|
35
|
+
key: BLUEPRINT_KEY,
|
|
36
|
+
make
|
|
37
|
+
};
|
|
38
|
+
var chess_blueprint_default = blueprint;
|
|
39
|
+
export {
|
|
40
|
+
chess_blueprint_default as ChessBlueprint,
|
|
41
|
+
operations_exports as ChessFunctions
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=index.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,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-2DFOUJBD.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,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,34 @@
|
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/cli/plugin.ts
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import { Plugin } from "@dxos/app-framework";
|
|
6
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
7
|
+
import { Operation } from "@dxos/compute";
|
|
8
|
+
import { SpaceOperation } from "@dxos/plugin-space/operations";
|
|
9
|
+
import { meta } from "#meta";
|
|
10
|
+
import { Chess } from "#types";
|
|
11
|
+
var ChessPlugin = Plugin.define(meta).pipe(AppPlugin.addMetadataModule({
|
|
12
|
+
metadata: {
|
|
13
|
+
id: Chess.Game.typename,
|
|
14
|
+
metadata: {
|
|
15
|
+
createObject: (props, options) => Effect.gen(function* () {
|
|
16
|
+
const object = Chess.make(props);
|
|
17
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
18
|
+
object,
|
|
19
|
+
target: options.target,
|
|
20
|
+
hidden: true,
|
|
21
|
+
targetNodeId: options.targetNodeId
|
|
22
|
+
});
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}), AppPlugin.addSchemaModule({
|
|
27
|
+
schema: [
|
|
28
|
+
Chess.Game
|
|
29
|
+
]
|
|
30
|
+
}), Plugin.make);
|
|
31
|
+
export {
|
|
32
|
+
ChessPlugin
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/plugin.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { SpaceOperation } from '@dxos/plugin-space/operations';\nimport { type CreateObject } from '@dxos/plugin-space/types';\n\nimport { meta } from '#meta';\nimport { Chess } from '#types';\n\n// TODO(wittjosiah): Factor out shared modules.\nexport const ChessPlugin = Plugin.define(meta).pipe(\n AppPlugin.addMetadataModule({\n metadata: {\n id: Chess.Game.typename,\n metadata: {\n createObject: ((props, options) =>\n Effect.gen(function* () {\n const object = Chess.make(props);\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n hidden: true,\n targetNodeId: options.targetNodeId,\n });\n })) satisfies CreateObject,\n },\n },\n }),\n AppPlugin.addSchemaModule({ schema: [Chess.Game] }),\n Plugin.make,\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB;AAG/B,SAASC,YAAY;AACrB,SAASC,aAAa;AAGf,IAAMC,cAAcN,OAAOO,OAAOH,IAAAA,EAAMI,KAC7CP,UAAUQ,kBAAkB;EAC1BC,UAAU;IACRC,IAAIN,MAAMO,KAAKC;IACfH,UAAU;MACRI,cAAe,CAACC,OAAOC,YACdC,WAAI,aAAA;AACT,cAAMC,SAASb,MAAMc,KAAKJ,KAAAA;AAC1B,eAAO,OAAOb,UAAUkB,OAAOjB,eAAekB,WAAW;UACvDH;UACAI,QAAQN,QAAQM;UAChBC,QAAQ;UACRC,cAAcR,QAAQQ;QACxB,CAAA;MACF,CAAA;IACJ;EACF;AACF,CAAA,GACAvB,UAAUwB,gBAAgB;EAAEC,QAAQ;IAACrB,MAAMO;;AAAM,CAAA,GACjDZ,OAAOmB,IAAI;",
|
|
6
|
+
"names": ["Effect", "Plugin", "AppPlugin", "Operation", "SpaceOperation", "meta", "Chess", "ChessPlugin", "define", "pipe", "addMetadataModule", "metadata", "id", "Game", "typename", "createObject", "props", "options", "gen", "object", "make", "invoke", "AddObject", "target", "hidden", "targetNodeId", "addSchemaModule", "schema"]
|
|
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
|
+
}
|