@dxos/plugin-chess 0.8.4-main.70d3990 → 0.8.4-main.74a063c4e0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/blueprints/index.mjs +14 -0
- package/dist/lib/browser/{chunk-CCF24VRU.mjs → chunk-2TJN26DN.mjs} +18 -34
- package/dist/lib/browser/chunk-2TJN26DN.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-MC7L6JNC.mjs +36 -0
- package/dist/lib/browser/chunk-MC7L6JNC.mjs.map +7 -0
- package/dist/lib/browser/chunk-SBRUTOHG.mjs +28 -0
- package/dist/lib/browser/chunk-SBRUTOHG.mjs.map +7 -0
- package/dist/lib/browser/chunk-XAJZK6Z2.mjs +110 -0
- package/dist/lib/browser/chunk-XAJZK6Z2.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-AJHN4QT4.mjs +24 -0
- package/dist/lib/browser/create-AJHN4QT4.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +364 -99
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/move-CN7BGBOR.mjs +36 -0
- package/dist/lib/browser/move-CN7BGBOR.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-YRKSZF5U.mjs +45 -0
- package/dist/lib/browser/play-YRKSZF5U.mjs.map +7 -0
- package/dist/lib/browser/print-EW7LPW4D.mjs +30 -0
- package/dist/lib/browser/print-EW7LPW4D.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -5
- package/dist/lib/node-esm/blueprints/index.mjs +15 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4HZWCKMR.mjs +38 -0
- package/dist/lib/node-esm/chunk-4HZWCKMR.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7W2LXAM5.mjs +29 -0
- package/dist/lib/node-esm/chunk-7W2LXAM5.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-NYU5JVXP.mjs +111 -0
- package/dist/lib/node-esm/chunk-NYU5JVXP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QKXLEJNZ.mjs → chunk-OIRJVY2R.mjs} +18 -34
- package/dist/lib/node-esm/chunk-OIRJVY2R.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-QSETDT4N.mjs +25 -0
- package/dist/lib/node-esm/create-QSETDT4N.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +364 -99
- 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-OTEYBHVI.mjs +37 -0
- package/dist/lib/node-esm/move-OTEYBHVI.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-ZLDAXADK.mjs +46 -0
- package/dist/lib/node-esm/play-ZLDAXADK.mjs.map +7 -0
- package/dist/lib/node-esm/print-UJHXAXMS.mjs +31 -0
- package/dist/lib/node-esm/print-UJHXAXMS.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +3 -5
- package/dist/types/src/ChessPlugin.d.ts +2 -1
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/chess-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +3 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/artifact-definition.d.ts +3 -2
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -5
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +5 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/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.d.ts → Chessboard/Chessboard.d.ts} +4 -8
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +48 -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} +1 -1
- package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/index.d.ts +2 -0
- package/dist/types/src/components/Chessboard/index.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/types.d.ts +8 -0
- package/dist/types/src/components/Chessboard/types.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +6 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +47 -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/{components/Card.stories.d.ts → containers/ChessCard/ChessCard.stories.d.ts} +2 -9
- 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/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +51 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/move.d.ts +5 -0
- package/dist/types/src/operations/move.d.ts.map +1 -0
- package/dist/types/src/operations/play.d.ts +5 -0
- package/dist/types/src/operations/play.d.ts.map +1 -0
- package/dist/types/src/operations/print.d.ts +5 -0
- package/dist/types/src/operations/print.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +21 -20
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts +17 -17
- package/dist/types/src/types/Chess.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +74 -43
- package/src/ChessPlugin.tsx +41 -47
- package/src/blueprints/chess-blueprint.ts +35 -0
- package/src/blueprints/index.ts +6 -0
- package/src/capabilities/artifact-definition.ts +98 -92
- package/src/capabilities/blueprint-definition.ts +9 -28
- package/src/capabilities/index.ts +8 -6
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/capabilities/react-surface.tsx +27 -15
- 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.tsx → Chessboard/Chessboard.tsx} +32 -29
- package/src/components/{Info.tsx → Chessboard/Info.tsx} +41 -24
- package/src/components/Chessboard/index.ts +5 -0
- package/src/components/Chessboard/types.ts +18 -0
- package/src/components/index.ts +1 -5
- package/src/containers/ChessArticle/ChessArticle.stories.tsx +53 -0
- package/src/containers/ChessArticle/ChessArticle.tsx +73 -0
- package/src/containers/ChessArticle/index.ts +5 -0
- package/src/containers/ChessCard/ChessCard.stories.tsx +42 -0
- package/src/containers/ChessCard/ChessCard.tsx +22 -0
- package/src/containers/ChessCard/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/index.ts +2 -3
- package/src/meta.ts +3 -3
- package/src/operations/create.ts +21 -0
- package/src/operations/definitions.ts +109 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/move.ts +36 -0
- package/src/operations/play.ts +45 -0
- package/src/operations/print.ts +28 -0
- package/src/translations.ts +21 -20
- package/src/types/Chess.ts +11 -7
- package/src/types/index.ts +0 -1
- package/dist/lib/browser/ChessboardContainer-5YXEM4VR.mjs +0 -96
- package/dist/lib/browser/ChessboardContainer-5YXEM4VR.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-Y5Y4YGNL.mjs +0 -11
- package/dist/lib/browser/chunk-3LPE2B5J.mjs +0 -169
- package/dist/lib/browser/chunk-3LPE2B5J.mjs.map +0 -7
- package/dist/lib/browser/chunk-5DOZV3PW.mjs +0 -294
- package/dist/lib/browser/chunk-5DOZV3PW.mjs.map +0 -7
- package/dist/lib/browser/chunk-CCF24VRU.mjs.map +0 -7
- package/dist/lib/browser/chunk-DUO4WTAM.mjs +0 -28
- package/dist/lib/browser/chunk-DUO4WTAM.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q5TZCIH7.mjs +0 -8
- package/dist/lib/browser/chunk-Q5TZCIH7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-KPGHK5JU.mjs +0 -25
- package/dist/lib/browser/intent-resolver-KPGHK5JU.mjs.map +0 -7
- package/dist/lib/browser/react-surface-3YST34QI.mjs +0 -38
- package/dist/lib/browser/react-surface-3YST34QI.mjs.map +0 -7
- package/dist/lib/node-esm/ChessboardContainer-7OQ6TOKB.mjs +0 -97
- package/dist/lib/node-esm/ChessboardContainer-7OQ6TOKB.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-GR6OLMB6.mjs +0 -12
- package/dist/lib/node-esm/chunk-F3HFLDV5.mjs +0 -170
- package/dist/lib/node-esm/chunk-F3HFLDV5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F4C2HVZL.mjs +0 -295
- package/dist/lib/node-esm/chunk-F4C2HVZL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KNOOJFIR.mjs +0 -29
- package/dist/lib/node-esm/chunk-KNOOJFIR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QKXLEJNZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VVXTAVIS.mjs +0 -10
- package/dist/lib/node-esm/chunk-VVXTAVIS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-ZAELGF7I.mjs +0 -26
- package/dist/lib/node-esm/intent-resolver-ZAELGF7I.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-KV2KBSIU.mjs +0 -39
- package/dist/lib/node-esm/react-surface-KV2KBSIU.mjs.map +0 -7
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/Card.stories.d.ts.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 -7
- package/dist/types/src/components/ChessboardArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChessboardContainer.d.ts +0 -9
- package/dist/types/src/components/ChessboardContainer.d.ts.map +0 -1
- package/dist/types/src/components/Info.d.ts.map +0 -1
- package/dist/types/src/functions/create.d.ts +0 -14
- package/dist/types/src/functions/create.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/move.d.ts +0 -8
- package/dist/types/src/functions/move.d.ts.map +0 -1
- package/dist/types/src/functions/play.d.ts +0 -9
- package/dist/types/src/functions/play.d.ts.map +0 -1
- package/dist/types/src/types/ChessAction.d.ts +0 -24
- package/dist/types/src/types/ChessAction.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -22
- package/src/components/Card.stories.tsx +0 -66
- package/src/components/Chessboard.stories.tsx +0 -49
- package/src/components/ChessboardArticle.tsx +0 -68
- package/src/components/ChessboardContainer.tsx +0 -44
- package/src/functions/create.ts +0 -32
- package/src/functions/index.ts +0 -7
- package/src/functions/move.ts +0 -45
- package/src/functions/play.ts +0 -55
- package/src/types/ChessAction.ts +0 -19
- /package/dist/lib/browser/{blueprint-definition-Y5Y4YGNL.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-GR6OLMB6.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chess_blueprint_default
|
|
3
|
+
} from "../chunk-MC7L6JNC.mjs";
|
|
4
|
+
import {
|
|
5
|
+
operations_exports
|
|
6
|
+
} from "../chunk-SBRUTOHG.mjs";
|
|
7
|
+
import "../chunk-XAJZK6Z2.mjs";
|
|
8
|
+
import "../chunk-2TJN26DN.mjs";
|
|
9
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
10
|
+
export {
|
|
11
|
+
chess_blueprint_default as ChessBlueprint,
|
|
12
|
+
operations_exports as ChessFunctions
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__export
|
|
3
|
-
|
|
4
|
-
} from "./chunk-DUO4WTAM.mjs";
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
5
4
|
|
|
6
5
|
// src/types/Chess.ts
|
|
7
6
|
var Chess_exports = {};
|
|
8
7
|
__export(Chess_exports, {
|
|
9
8
|
Game: () => Game,
|
|
10
|
-
|
|
9
|
+
make: () => make
|
|
11
10
|
});
|
|
12
11
|
import { Chess as ChessJS } from "chess.js";
|
|
13
12
|
import * as Schema from "effect/Schema";
|
|
14
|
-
import { Obj, Type } from "@dxos/echo";
|
|
13
|
+
import { Annotation, Obj, Type } from "@dxos/echo";
|
|
15
14
|
import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/internal";
|
|
16
15
|
import { log } from "@dxos/log";
|
|
17
16
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-chess/src/types/Chess.ts";
|
|
@@ -24,20 +23,23 @@ var Game = Schema.Struct({
|
|
|
24
23
|
black: Schema.optional(Schema.String.annotations({
|
|
25
24
|
description: "DID of black player"
|
|
26
25
|
}))
|
|
27
|
-
}).pipe(
|
|
26
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
28
27
|
pgn: Schema.String.annotations({
|
|
29
28
|
description: "Portable Game Notation."
|
|
30
29
|
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
31
30
|
fen: Schema.String.annotations({
|
|
32
31
|
description: "Forsyth-Edwards Notation."
|
|
33
32
|
}).pipe(FormInputAnnotation.set(false), Schema.optional)
|
|
34
|
-
}).pipe(Type.
|
|
35
|
-
typename: "dxos.
|
|
36
|
-
version: "0.
|
|
33
|
+
}).pipe(Type.object({
|
|
34
|
+
typename: "org.dxos.type.chess",
|
|
35
|
+
version: "0.1.0"
|
|
37
36
|
}), LabelAnnotation.set([
|
|
38
37
|
"name"
|
|
39
|
-
])
|
|
40
|
-
|
|
38
|
+
]), Annotation.IconAnnotation.set({
|
|
39
|
+
icon: "ph--shield-chevron--regular",
|
|
40
|
+
hue: "amber"
|
|
41
|
+
}));
|
|
42
|
+
var make = ({ name, pgn, fen } = {}) => {
|
|
41
43
|
const chess = new ChessJS();
|
|
42
44
|
if (pgn) {
|
|
43
45
|
try {
|
|
@@ -45,7 +47,7 @@ var makeGame = ({ name, pgn, fen } = {}) => {
|
|
|
45
47
|
} catch {
|
|
46
48
|
log.warn(pgn, void 0, {
|
|
47
49
|
F: __dxlog_file,
|
|
48
|
-
L:
|
|
50
|
+
L: 52,
|
|
49
51
|
S: void 0,
|
|
50
52
|
C: (f, a) => f(...a)
|
|
51
53
|
});
|
|
@@ -53,31 +55,13 @@ var makeGame = ({ name, pgn, fen } = {}) => {
|
|
|
53
55
|
}
|
|
54
56
|
return Obj.make(Game, {
|
|
55
57
|
name,
|
|
56
|
-
players: {},
|
|
57
58
|
pgn,
|
|
58
|
-
fen
|
|
59
|
+
fen,
|
|
60
|
+
players: {}
|
|
59
61
|
});
|
|
60
62
|
};
|
|
61
63
|
|
|
62
|
-
// src/types/ChessAction.ts
|
|
63
|
-
var ChessAction_exports = {};
|
|
64
|
-
__export(ChessAction_exports, {
|
|
65
|
-
Create: () => Create
|
|
66
|
-
});
|
|
67
|
-
import * as Schema2 from "effect/Schema";
|
|
68
|
-
var Create = class extends Schema2.TaggedClass()(`${meta.id}/action/create`, {
|
|
69
|
-
input: Schema2.Struct({
|
|
70
|
-
name: Schema2.optional(Schema2.String),
|
|
71
|
-
pgn: Schema2.optional(Schema2.String)
|
|
72
|
-
}),
|
|
73
|
-
output: Schema2.Struct({
|
|
74
|
-
object: Game
|
|
75
|
-
})
|
|
76
|
-
}) {
|
|
77
|
-
};
|
|
78
|
-
|
|
79
64
|
export {
|
|
80
|
-
Chess_exports
|
|
81
|
-
ChessAction_exports
|
|
65
|
+
Chess_exports
|
|
82
66
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
67
|
+
//# sourceMappingURL=chunk-2TJN26DN.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;;AAEb,IAAMC,OAAcC,cAAO;EAChCC,MAAaC,gBAAgBC,aAAM;EACnCC,SAAgBJ,cAAO;IACrBK,OAAcH,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;IAEFC,OAAcN,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA,EAAGE,KAAKb,oBAAoBc,IAAI,KAAA,GAAeR,eAAQ;EACvDS,KAAYR,cAAOG,YAAY;IAC7BC,aAAa;EACf,CAAA,EAAGE,KAAKb,oBAAoBc,IAAI,KAAA,GAAeR,eAAQ;EACvDU,KAAYT,cAAOG,YAAY;IAC7BC,aAAa;EACf,CAAA,EAAGE,KAAKb,oBAAoBc,IAAI,KAAA,GAAeR,eAAQ;AACzD,CAAA,EAAGO,KACDd,KAAKkB,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAlB,gBAAgBa,IAAI;EAAC;CAAO,GAC5BjB,WAAWuB,eAAeN,IAAI;EAC5BO,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAKK,IAAMC,OAAO,CAAC,EAAElB,MAAMU,KAAKC,IAAG,IAAoD,CAAC,MAAC;AACzF,QAAMQ,QAAQ,IAAI7B,QAAAA;AAClB,MAAIoB,KAAK;AACP,QAAI;AACFS,YAAMC,QAAQV,GAAAA;IAChB,QAAQ;AACNb,UAAIwB,KAAKX,KAAAA,QAAAA;;;;;;IACX;EACF;AAEA,SAAOjB,IAAIyB,KAAKpB,MAAM;IACpBE;IACAU;IACAC;IACAR,SAAS,CAAC;EACZ,CAAA;AACF;",
|
|
6
|
+
"names": ["Chess", "ChessJS", "Schema", "Annotation", "Obj", "Type", "FormInputAnnotation", "LabelAnnotation", "log", "Game", "Struct", "name", "optional", "String", "players", "white", "annotations", "description", "black", "pipe", "set", "pgn", "fen", "object", "typename", "version", "IconAnnotation", "icon", "hue", "make", "chess", "loadPgn", "warn"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/blueprints/chess-blueprint.ts
|
|
2
|
+
import { Blueprint, Template } from "@dxos/blueprints";
|
|
3
|
+
import { trim } from "@dxos/util";
|
|
4
|
+
import { Create, Move, Play, Print } from "#operations";
|
|
5
|
+
var BLUEPRINT_KEY = "org.dxos.blueprint.chess";
|
|
6
|
+
var operations = [
|
|
7
|
+
Create,
|
|
8
|
+
Move,
|
|
9
|
+
Play,
|
|
10
|
+
Print
|
|
11
|
+
];
|
|
12
|
+
var make = () => Blueprint.make({
|
|
13
|
+
key: BLUEPRINT_KEY,
|
|
14
|
+
name: "Chess",
|
|
15
|
+
tools: Blueprint.toolDefinitions({
|
|
16
|
+
operations
|
|
17
|
+
}),
|
|
18
|
+
instructions: Template.make({
|
|
19
|
+
source: trim`
|
|
20
|
+
You are an expert chess player.
|
|
21
|
+
To analyze a game you can access the "pgn" property by loading the context object that represents the current game.
|
|
22
|
+
You could suggest a good next move or offer to play a move.
|
|
23
|
+
Don't actually make a move unless you are asked to.
|
|
24
|
+
`
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
var blueprint = {
|
|
28
|
+
key: BLUEPRINT_KEY,
|
|
29
|
+
make
|
|
30
|
+
};
|
|
31
|
+
var chess_blueprint_default = blueprint;
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
chess_blueprint_default
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-MC7L6JNC.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 { type AppCapabilities } from '@dxos/app-toolkit';\nimport { Blueprint, Template } from '@dxos/blueprints';\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: AppCapabilities.BlueprintDefinition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
|
|
5
|
+
"mappings": ";AAKA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAErB,SAASC,QAAQC,MAAMC,MAAMC,aAAa;AAE1C,IAAMC,gBAAgB;AAEtB,IAAMC,aAAa;EAACC;EAAQC;EAAMC;EAAMC;;AAExC,IAAMC,OAAO,MACXC,UAAUD,KAAK;EACbE,KAAKR;EACLS,MAAM;EACNC,OAAOH,UAAUI,gBAAgB;IAAEV;EAAW,CAAA;EAC9CW,cAAcC,SAASP,KAAK;IAC1BQ,QAAQC;;;;;;EAMV,CAAA;AACF,CAAA;AAEF,IAAMC,YAAiD;EACrDR,KAAKR;EACLM;AACF;AAEA,IAAA,0BAAeU;",
|
|
6
|
+
"names": ["Blueprint", "Template", "trim", "Create", "Move", "Play", "Print", "BLUEPRINT_KEY", "operations", "Create", "Move", "Play", "Print", "make", "Blueprint", "key", "name", "tools", "toolDefinitions", "instructions", "Template", "source", "trim", "blueprint"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Create,
|
|
3
|
+
Move,
|
|
4
|
+
Play,
|
|
5
|
+
Print
|
|
6
|
+
} from "./chunk-XAJZK6Z2.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/operation";
|
|
21
|
+
var Handlers = OperationHandlerSet.lazy(() => import("./create-AJHN4QT4.mjs"), () => import("./move-CN7BGBOR.mjs"), () => import("./play-YRKSZF5U.mjs"), () => import("./print-EW7LPW4D.mjs"));
|
|
22
|
+
var ChessHandlers = Handlers;
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
ChessHandlers,
|
|
26
|
+
operations_exports
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=chunk-SBRUTOHG.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/operation';\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,WAAWC,oBAAoBC,KACnC,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,sBAAA,CAAA;AAKR,IAAMC,gBAAgBH;",
|
|
6
|
+
"names": ["OperationHandlerSet", "Handlers", "OperationHandlerSet", "lazy", "ChessHandlers"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Chess_exports
|
|
3
|
+
} from "./chunk-2TJN26DN.mjs";
|
|
4
|
+
|
|
5
|
+
// src/operations/definitions.ts
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import { Database, Ref } from "@dxos/echo";
|
|
8
|
+
import { Operation } from "@dxos/operation";
|
|
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-XAJZK6Z2.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 { Database, Ref } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\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,UAAUC,WAAW;AAC9B,SAASC,iBAAiB;AAInB,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", "Database", "Ref", "Operation", "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/operation";
|
|
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/operation';\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,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CC,UAAUC,kBAAkB;EAC1BC,UAAU;IACRC,IAAIC,MAAMC,KAAKC;IACfJ,UAAU;MACRK,cAAe,CAACC,OAAOC,YACdC,WAAI,aAAA;AACT,cAAMC,SAASP,MAAMQ,KAAKJ,KAAAA;AAC1B,eAAO,OAAOK,UAAUC,OAAOC,eAAeC,WAAW;UACvDL;UACAM,QAAQR,QAAQQ;UAChBC,QAAQ;UACRC,cAAcV,QAAQU;QACxB,CAAA;MACF,CAAA;IACJ;EACF;AACF,CAAA,GACAnB,UAAUoB,gBAAgB;EAAEC,QAAQ;IAACjB,MAAMC;;AAAM,CAAA,GACjDT,OAAOgB,IAAI;",
|
|
6
|
+
"names": ["Effect", "Plugin", "AppPlugin", "Operation", "SpaceOperation", "meta", "Chess", "ChessPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addMetadataModule", "metadata", "id", "Chess", "Game", "typename", "createObject", "props", "options", "gen", "object", "make", "Operation", "invoke", "SpaceOperation", "AddObject", "target", "hidden", "targetNodeId", "addSchemaModule", "schema"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Create
|
|
3
|
+
} from "./chunk-XAJZK6Z2.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Chess_exports
|
|
6
|
+
} from "./chunk-2TJN26DN.mjs";
|
|
7
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
8
|
+
|
|
9
|
+
// src/operations/create.ts
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import { Database } from "@dxos/echo";
|
|
12
|
+
import { Operation } from "@dxos/operation";
|
|
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-AJHN4QT4.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 { Database } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\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,gBAAgB;AACzB,SAASC,iBAAiB;AAK1B,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", "Database", "Operation", "handler", "Create", "pipe", "Operation", "withHandler", "fn", "name", "pgn", "fen", "Database", "add", "Chess", "make"]
|
|
7
|
+
}
|