@dxos/plugin-chess 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731
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/LICENSE +102 -5
- package/PLUGIN.mdl +526 -0
- package/README.md +1 -1
- package/dist/lib/neutral/ChessArticle-QLLKZGPH.mjs +88 -0
- package/dist/lib/neutral/ChessArticle-QLLKZGPH.mjs.map +7 -0
- package/dist/lib/neutral/ChessCard-I5RSZZIP.mjs +19 -0
- package/dist/lib/neutral/ChessCard-I5RSZZIP.mjs.map +7 -0
- package/dist/lib/neutral/ChessPlugin.mjs +10 -0
- package/dist/lib/neutral/ChessPlugin.node.mjs +23 -0
- package/dist/lib/neutral/ChessPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ChessPlugin.workerd.mjs +21 -0
- package/dist/lib/neutral/ChessPlugin.workerd.mjs.map +7 -0
- package/dist/lib/{browser/blueprint-definition-RLA7PQBB.mjs → neutral/blueprint-definition-PZXHAYLD.mjs} +4 -7
- package/dist/lib/neutral/blueprint-definition-PZXHAYLD.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +13 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-F5OMIM4F.mjs → neutral/chunk-7XZ4CRDL.mjs} +15 -6
- package/dist/lib/neutral/chunk-7XZ4CRDL.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KMHQCP7J.mjs +148 -0
- package/dist/lib/neutral/chunk-KMHQCP7J.mjs.map +7 -0
- package/dist/lib/neutral/chunk-PJOAFP6S.mjs +41 -0
- package/dist/lib/neutral/chunk-PJOAFP6S.mjs.map +7 -0
- package/dist/lib/neutral/chunk-W2JSKHJK.mjs +8 -0
- package/dist/lib/neutral/chunk-W2JSKHJK.mjs.map +7 -0
- package/dist/lib/neutral/chunk-XWKNXG62.mjs +34 -0
- package/dist/lib/neutral/chunk-XWKNXG62.mjs.map +7 -0
- package/dist/lib/{browser/chunk-KE4FN77G.mjs → neutral/components/index.mjs} +21 -58
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +11 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/game-variant-UMYAK7LT.mjs +41 -0
- package/dist/lib/neutral/game-variant-UMYAK7LT.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +18 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/move-ORBNYB2H.mjs +37 -0
- package/dist/lib/neutral/move-ORBNYB2H.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-EKZKFQUG.mjs +13 -0
- package/dist/lib/neutral/operation-handler-EKZKFQUG.mjs.map +7 -0
- package/dist/lib/{browser/types → neutral/operations}/index.mjs +3 -3
- package/dist/lib/neutral/play-QJCLEC27.mjs +46 -0
- package/dist/lib/neutral/play-QJCLEC27.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/print-ILCRJUYI.mjs +29 -0
- package/dist/lib/neutral/print-ILCRJUYI.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/translations.mjs +35 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- 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/{cli/plugin.d.ts → ChessPlugin.workerd.d.ts} +2 -1
- package/dist/types/src/ChessPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/blueprints/chess-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +0 -1
- 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/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/components/Chessboard/Chessboard.d.ts +8 -4
- package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -1
- 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/Chessboard/Info.d.ts +4 -5
- package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -1
- package/dist/types/src/components/Chessboard/types.d.ts +3 -3
- package/dist/types/src/components/Chessboard/types.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +3 -4
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +34 -24
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ChessArticle/index.d.ts +1 -2
- package/dist/types/src/containers/ChessArticle/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts +3 -4
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -1
- package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ChessCard/index.d.ts +1 -2
- package/dist/types/src/containers/ChessCard/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +3 -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/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.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 -20
- package/dist/types/src/types/Chess.d.ts.map +1 -1
- package/dist/types/src/types/ChessOperation.d.ts +29 -0
- package/dist/types/src/types/ChessOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +100 -56
- package/src/ChessPlugin.node.ts +23 -0
- package/src/ChessPlugin.test.ts +50 -0
- package/src/ChessPlugin.tsx +19 -22
- package/src/ChessPlugin.workerd.ts +18 -0
- package/src/blueprints/chess-blueprint.ts +7 -11
- package/src/blueprints/index.ts +0 -1
- package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +3 -1
- package/src/capabilities/game-variant.ts +43 -0
- package/src/capabilities/index.ts +10 -2
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
- package/src/components/Chessboard/Chessboard.tsx +7 -13
- package/src/components/Chessboard/Info.tsx +21 -74
- package/src/components/Chessboard/types.ts +2 -2
- package/src/containers/ChessArticle/ChessArticle.stories.tsx +12 -6
- package/src/containers/ChessArticle/ChessArticle.tsx +55 -19
- package/src/containers/ChessArticle/index.ts +1 -3
- package/src/containers/ChessCard/ChessCard.stories.tsx +10 -5
- package/src/containers/ChessCard/ChessCard.tsx +11 -6
- package/src/containers/ChessCard/index.ts +1 -3
- package/src/index.ts +0 -4
- package/src/meta.ts +10 -4
- package/src/operations/index.ts +11 -0
- package/src/operations/move.ts +36 -0
- package/src/operations/play.ts +45 -0
- package/src/operations/print.ts +28 -0
- package/src/plugin.ts +11 -0
- package/src/testing.ts +7 -0
- package/src/translations.ts +19 -21
- package/src/types/Chess.ts +21 -26
- package/src/types/ChessOperation.ts +88 -0
- package/src/types/index.ts +1 -0
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/ChessArticle-RI2DYAO4.mjs +0 -59
- package/dist/lib/browser/ChessArticle-RI2DYAO4.mjs.map +0 -7
- package/dist/lib/browser/ChessCard-AUMESHHE.mjs +0 -21
- package/dist/lib/browser/ChessCard-AUMESHHE.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-RLA7PQBB.mjs.map +0 -7
- package/dist/lib/browser/blueprints/index.mjs +0 -11
- package/dist/lib/browser/chunk-66H3V2YV.mjs +0 -64
- package/dist/lib/browser/chunk-66H3V2YV.mjs.map +0 -7
- package/dist/lib/browser/chunk-AWDLDU43.mjs +0 -231
- package/dist/lib/browser/chunk-AWDLDU43.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-KE4FN77G.mjs.map +0 -7
- package/dist/lib/browser/chunk-WYUTI2K4.mjs +0 -1
- package/dist/lib/browser/cli/index.mjs +0 -29
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -94
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-7KUFGD7C.mjs +0 -50
- package/dist/lib/browser/react-surface-7KUFGD7C.mjs.map +0 -7
- package/dist/lib/node-esm/ChessArticle-6QNVYEZV.mjs +0 -60
- package/dist/lib/node-esm/ChessArticle-6QNVYEZV.mjs.map +0 -7
- package/dist/lib/node-esm/ChessCard-QK3ZMYLT.mjs +0 -22
- package/dist/lib/node-esm/ChessCard-QK3ZMYLT.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-A2FFH3Z2.mjs +0 -19
- package/dist/lib/node-esm/blueprint-definition-A2FFH3Z2.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -12
- package/dist/lib/node-esm/chunk-7XDEO6IJ.mjs +0 -2
- package/dist/lib/node-esm/chunk-F5OMIM4F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- 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-R7FXSQ2P.mjs +0 -232
- package/dist/lib/node-esm/chunk-R7FXSQ2P.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RNPP75JE.mjs +0 -277
- package/dist/lib/node-esm/chunk-RNPP75JE.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/index.mjs +0 -95
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-U3HGYR5T.mjs +0 -51
- package/dist/lib/node-esm/react-surface-U3HGYR5T.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -9
- 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 -56
- 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 -6
- 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.map +0 -1
- package/src/blueprints/functions/create.ts +0 -38
- package/src/blueprints/functions/index.ts +0 -17
- 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/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -33
- package/src/cli/index.ts +0 -5
- package/src/cli/plugin.ts +0 -27
- /package/dist/lib/{browser/blueprints/index.mjs.map → neutral/ChessPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{node-esm/blueprints → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{browser/chunk-WYUTI2K4.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-7XDEO6IJ.mjs.map → neutral/testing.mjs.map} +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/types/index.mjs.map} +0 -0
package/src/types/Chess.ts
CHANGED
|
@@ -5,24 +5,18 @@
|
|
|
5
5
|
import { Chess as ChessJS } from 'chess.js';
|
|
6
6
|
import * as Schema from 'effect/Schema';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { BlueprintsAnnotation } from '@dxos/app-toolkit';
|
|
9
|
+
import { DXN, Annotation, Obj, Type } from '@dxos/echo';
|
|
10
|
+
import { FormInputAnnotation, HiddenAnnotation } from '@dxos/echo/internal';
|
|
10
11
|
import { log } from '@dxos/log';
|
|
11
12
|
|
|
12
|
-
export const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
),
|
|
20
|
-
black: Schema.optional(
|
|
21
|
-
Schema.String.annotations({
|
|
22
|
-
description: 'DID of black player',
|
|
23
|
-
}),
|
|
24
|
-
),
|
|
25
|
-
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
13
|
+
export const BLUEPRINT_KEY = 'org.dxos.blueprint.chess';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Chess variant state. Referenced by the base `Game` object via `Game.variant`.
|
|
17
|
+
* Players, name, and other game-shared fields live on the base `Game`.
|
|
18
|
+
*/
|
|
19
|
+
export const State = Schema.Struct({
|
|
26
20
|
pgn: Schema.String.annotations({
|
|
27
21
|
description: 'Portable Game Notation.',
|
|
28
22
|
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
@@ -30,16 +24,19 @@ export const Game = Schema.Struct({
|
|
|
30
24
|
description: 'Forsyth-Edwards Notation.',
|
|
31
25
|
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
32
26
|
}).pipe(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
Annotation.IconAnnotation.set({ icon: 'ph--shield-chevron--regular', hue: 'amber' }),
|
|
28
|
+
BlueprintsAnnotation.set([BLUEPRINT_KEY]),
|
|
29
|
+
// Implementation detail of the unified `Game` schema. The user-facing object is `Game`;
|
|
30
|
+
// this state is only ever referenced via `Game.variant`. HiddenAnnotation keeps it out of the
|
|
31
|
+
// navtree's typed branches so an orphaned state object doesn't reappear after the
|
|
32
|
+
// wrapping Game is deleted.
|
|
33
|
+
HiddenAnnotation.set(true),
|
|
34
|
+
Type.makeObject(DXN.make('org.dxos.type.chess.state', '0.1.0')),
|
|
38
35
|
);
|
|
39
36
|
|
|
40
|
-
export
|
|
37
|
+
export type State = Type.InstanceType<typeof State>;
|
|
41
38
|
|
|
42
|
-
export const make = ({
|
|
39
|
+
export const make = ({ pgn, fen }: { pgn?: string; fen?: string } = {}): State => {
|
|
43
40
|
const chess = new ChessJS();
|
|
44
41
|
if (pgn) {
|
|
45
42
|
try {
|
|
@@ -49,10 +46,8 @@ export const make = ({ name, pgn, fen }: { name?: string; pgn?: string; fen?: st
|
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
48
|
|
|
52
|
-
return Obj.make(
|
|
53
|
-
name,
|
|
49
|
+
return Obj.make(State, {
|
|
54
50
|
pgn,
|
|
55
51
|
fen,
|
|
56
|
-
players: {},
|
|
57
52
|
});
|
|
58
53
|
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
10
|
+
import { Database, DXN } from '@dxos/echo';
|
|
11
|
+
import { GameRef } from '@dxos/plugin-game';
|
|
12
|
+
|
|
13
|
+
import * as Chess from './Chess';
|
|
14
|
+
|
|
15
|
+
export const Move = Operation.make({
|
|
16
|
+
meta: {
|
|
17
|
+
key: DXN.make('org.dxos.function.chess.move'),
|
|
18
|
+
name: 'Move',
|
|
19
|
+
description: 'Makes a move in the given chess game.',
|
|
20
|
+
icon: 'ph--play--regular',
|
|
21
|
+
},
|
|
22
|
+
input: Schema.Struct({
|
|
23
|
+
game: GameRef(Chess.State).annotations({
|
|
24
|
+
description: 'The ID of the game object (variant must be Chess).',
|
|
25
|
+
}),
|
|
26
|
+
move: Schema.String.annotations({
|
|
27
|
+
description: 'The move to make in the chess game.',
|
|
28
|
+
examples: ['e4', 'Bf3'],
|
|
29
|
+
}),
|
|
30
|
+
}),
|
|
31
|
+
output: Schema.Struct({
|
|
32
|
+
pgn: Schema.String.annotations({
|
|
33
|
+
description: 'The PGN of the game after the move was played.',
|
|
34
|
+
}),
|
|
35
|
+
}),
|
|
36
|
+
services: [Database.Service],
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const Play = Operation.make({
|
|
40
|
+
meta: {
|
|
41
|
+
key: DXN.make('org.dxos.function.chess.play'),
|
|
42
|
+
name: 'Play',
|
|
43
|
+
description: 'Uses the chess engine to play the next move.',
|
|
44
|
+
icon: 'ph--play--regular',
|
|
45
|
+
},
|
|
46
|
+
input: Schema.Struct({
|
|
47
|
+
game: GameRef(Chess.State).annotations({
|
|
48
|
+
description: 'The ID of the game object (variant must be Chess).',
|
|
49
|
+
}),
|
|
50
|
+
side: Schema.optional(Schema.Literal('white', 'black', 'any')).annotations({
|
|
51
|
+
description: 'The side to play.',
|
|
52
|
+
defaultValue: 'any',
|
|
53
|
+
}),
|
|
54
|
+
}),
|
|
55
|
+
output: Schema.Struct({
|
|
56
|
+
pgn: Schema.String.annotations({
|
|
57
|
+
description: 'The PGN of the game after the move was played.',
|
|
58
|
+
}),
|
|
59
|
+
move: Schema.optional(Schema.String).annotations({
|
|
60
|
+
description: 'The move that was played.',
|
|
61
|
+
}),
|
|
62
|
+
}),
|
|
63
|
+
services: [Database.Service],
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export const Print = Operation.make({
|
|
67
|
+
meta: {
|
|
68
|
+
key: DXN.make('org.dxos.function.chess.print'),
|
|
69
|
+
name: 'Print game',
|
|
70
|
+
description: 'Prints the chess game to ASCII.',
|
|
71
|
+
icon: 'ph--clipboard-text--regular',
|
|
72
|
+
},
|
|
73
|
+
input: Schema.Struct({
|
|
74
|
+
pgn: Schema.optional(
|
|
75
|
+
Schema.String.annotations({
|
|
76
|
+
description: 'Portable Game Notation.',
|
|
77
|
+
}),
|
|
78
|
+
),
|
|
79
|
+
fen: Schema.optional(
|
|
80
|
+
Schema.String.annotations({
|
|
81
|
+
description: 'Forsyth-Edwards Notation.',
|
|
82
|
+
}),
|
|
83
|
+
),
|
|
84
|
+
}),
|
|
85
|
+
output: Schema.Struct({
|
|
86
|
+
ascii: Schema.String,
|
|
87
|
+
}),
|
|
88
|
+
});
|
package/src/types/index.ts
CHANGED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import "./chunk-WYUTI2K4.mjs";
|
|
2
|
-
import {
|
|
3
|
-
Chessboard
|
|
4
|
-
} from "./chunk-KE4FN77G.mjs";
|
|
5
|
-
import {
|
|
6
|
-
meta
|
|
7
|
-
} from "./chunk-H3NUMCQ6.mjs";
|
|
8
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
9
|
-
|
|
10
|
-
// src/containers/ChessArticle/ChessArticle.tsx
|
|
11
|
-
import React, { useCallback, useRef, useState } from "react";
|
|
12
|
-
import { Panel, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
13
|
-
import { mx } from "@dxos/ui-theme";
|
|
14
|
-
var ChessArticle = ({ role, subject: game }) => {
|
|
15
|
-
const { t } = useTranslation(meta.id);
|
|
16
|
-
const [orientation, setOrientation] = useState("white");
|
|
17
|
-
const [open, setOpen] = useState(true);
|
|
18
|
-
const controller = useRef(null);
|
|
19
|
-
const handleSelect = useCallback((index) => {
|
|
20
|
-
controller.current?.setMoveNumber(index);
|
|
21
|
-
}, []);
|
|
22
|
-
return /* @__PURE__ */ React.createElement(Chessboard.Root, {
|
|
23
|
-
game,
|
|
24
|
-
ref: controller
|
|
25
|
-
}, /* @__PURE__ */ React.createElement(Panel.Root, {
|
|
26
|
-
role,
|
|
27
|
-
classNames: "@container"
|
|
28
|
-
}, /* @__PURE__ */ React.createElement(Panel.Toolbar, {
|
|
29
|
-
asChild: true
|
|
30
|
-
}, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(Toolbar.IconButton, {
|
|
31
|
-
icon: "ph--info--regular",
|
|
32
|
-
iconOnly: true,
|
|
33
|
-
label: t("toggle info button"),
|
|
34
|
-
disabled: open,
|
|
35
|
-
classNames: mx("invisible @3xl:visible"),
|
|
36
|
-
onClick: () => setOpen((open2) => !open2)
|
|
37
|
-
}))), /* @__PURE__ */ React.createElement(Panel.Content, null, /* @__PURE__ */ React.createElement("div", {
|
|
38
|
-
className: mx("grid h-full w-full gap-2", open && "@3xl:grid-cols-[1fr_320px]", role === "section" && "aspect-square", role === "section" && open && "@3xl:aspect-auto")
|
|
39
|
-
}, /* @__PURE__ */ React.createElement(Chessboard.Content, null, /* @__PURE__ */ React.createElement(Chessboard.Board, {
|
|
40
|
-
classNames: "m-4 rounded-xs overflow-hidden",
|
|
41
|
-
orientation
|
|
42
|
-
})), open && /* @__PURE__ */ React.createElement("div", {
|
|
43
|
-
className: "hidden @3xl:flex flex-col p-8 justify-center items-center overflow-hidden"
|
|
44
|
-
}, /* @__PURE__ */ React.createElement(Chessboard.Info, {
|
|
45
|
-
orientation,
|
|
46
|
-
min: 8,
|
|
47
|
-
max: 8,
|
|
48
|
-
onOrientationChange: setOrientation,
|
|
49
|
-
onClose: () => setOpen(false),
|
|
50
|
-
onSelect: handleSelect
|
|
51
|
-
}))))));
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// src/containers/ChessArticle/index.ts
|
|
55
|
-
var ChessArticle_default = ChessArticle;
|
|
56
|
-
export {
|
|
57
|
-
ChessArticle_default as default
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=ChessArticle-RI2DYAO4.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/ChessArticle/ChessArticle.tsx", "../../../src/containers/ChessArticle/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Panel, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { type Player } from '@dxos/react-ui-gameboard';\nimport { mx } from '@dxos/ui-theme';\n\nimport { Chessboard, type ChessboardController, type ChessboardInfoProps } from '../../components';\nimport { meta } from '../../meta';\nimport { type Chess } from '../../types';\n\nexport type ChessArticleProps = SurfaceComponentProps<Chess.Game>;\n\nexport const ChessArticle = ({ role, subject: game }: ChessArticleProps) => {\n const { t } = useTranslation(meta.id);\n const [orientation, setOrientation] = useState<Player>('white');\n const [open, setOpen] = useState(true);\n const controller = useRef<ChessboardController>(null);\n\n const handleSelect = useCallback<NonNullable<ChessboardInfoProps['onSelect']>>((index) => {\n controller.current?.setMoveNumber(index);\n }, []);\n\n return (\n <Chessboard.Root game={game} ref={controller}>\n <Panel.Root role={role} classNames='@container'>\n <Panel.Toolbar asChild>\n <Toolbar.Root>\n <Toolbar.IconButton\n icon='ph--info--regular'\n iconOnly\n label={t('toggle info button')}\n disabled={open}\n classNames={mx('invisible @3xl:visible')}\n onClick={() => setOpen((open) => !open)}\n />\n </Toolbar.Root>\n </Panel.Toolbar>\n <Panel.Content>\n <div\n className={mx(\n 'grid h-full w-full gap-2',\n open && '@3xl:grid-cols-[1fr_320px]',\n role === 'section' && 'aspect-square',\n role === 'section' && open && '@3xl:aspect-auto',\n )}\n >\n <Chessboard.Content>\n <Chessboard.Board classNames='m-4 rounded-xs overflow-hidden' orientation={orientation} />\n </Chessboard.Content>\n {open && (\n <div className='hidden @3xl:flex flex-col p-8 justify-center items-center overflow-hidden'>\n <Chessboard.Info\n orientation={orientation}\n min={8}\n max={8}\n onOrientationChange={setOrientation}\n onClose={() => setOpen(false)}\n onSelect={handleSelect}\n />\n </div>\n )}\n </div>\n </Panel.Content>\n </Panel.Root>\n </Chessboard.Root>\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { ChessArticle } from './ChessArticle';\n\nexport default ChessArticle;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,OAAOA,SAASC,aAAaC,QAAQC,gBAAgB;AAGrD,SAASC,OAAOC,SAASC,sBAAsB;AAE/C,SAASC,UAAU;AAQZ,IAAMC,eAAe,CAAC,EAAEC,MAAMC,SAASC,KAAI,MAAqB;AACrE,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,QAAM,CAACC,aAAaC,cAAAA,IAAkBC,SAAiB,OAAA;AACvD,QAAM,CAACC,MAAMC,OAAAA,IAAWF,SAAS,IAAA;AACjC,QAAMG,aAAaC,OAA6B,IAAA;AAEhD,QAAMC,eAAeC,YAA0D,CAACC,UAAAA;AAC9EJ,eAAWK,SAASC,cAAcF,KAAAA;EACpC,GAAG,CAAA,CAAE;AAEL,SACE,sBAAA,cAACG,WAAWC,MAAI;IAAClB;IAAYmB,KAAKT;KAChC,sBAAA,cAACU,MAAMF,MAAI;IAACpB;IAAYuB,YAAW;KACjC,sBAAA,cAACD,MAAME,SAAO;IAACC,SAAAA;KACb,sBAAA,cAACD,QAAQJ,MAAI,MACX,sBAAA,cAACI,QAAQE,YAAU;IACjBC,MAAK;IACLC,UAAAA;IACAC,OAAO1B,EAAE,oBAAA;IACT2B,UAAUpB;IACVa,YAAYQ,GAAG,wBAAA;IACfC,SAAS,MAAMrB,QAAQ,CAACD,UAAS,CAACA,KAAAA;QAIxC,sBAAA,cAACY,MAAMW,SAAO,MACZ,sBAAA,cAACC,OAAAA;IACCC,WAAWJ,GACT,4BACArB,QAAQ,8BACRV,SAAS,aAAa,iBACtBA,SAAS,aAAaU,QAAQ,kBAAA;KAGhC,sBAAA,cAACS,WAAWc,SAAO,MACjB,sBAAA,cAACd,WAAWiB,OAAK;IAACb,YAAW;IAAiChB;OAE/DG,QACC,sBAAA,cAACwB,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAAChB,WAAWkB,MAAI;IACd9B;IACA+B,KAAK;IACLC,KAAK;IACLC,qBAAqBhC;IACrBiC,SAAS,MAAM9B,QAAQ,KAAA;IACvB+B,UAAU5B;;AAS5B;;;ACjEA,IAAA,uBAAe6B;",
|
|
6
|
-
"names": ["React", "useCallback", "useRef", "useState", "Panel", "Toolbar", "useTranslation", "mx", "ChessArticle", "role", "subject", "game", "t", "useTranslation", "meta", "id", "orientation", "setOrientation", "useState", "open", "setOpen", "controller", "useRef", "handleSelect", "useCallback", "index", "current", "setMoveNumber", "Chessboard", "Root", "ref", "Panel", "classNames", "Toolbar", "asChild", "IconButton", "icon", "iconOnly", "label", "disabled", "mx", "onClick", "Content", "div", "className", "Board", "Info", "min", "max", "onOrientationChange", "onClose", "onSelect", "ChessArticle"]
|
|
7
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "./chunk-WYUTI2K4.mjs";
|
|
2
|
-
import {
|
|
3
|
-
Chessboard
|
|
4
|
-
} from "./chunk-KE4FN77G.mjs";
|
|
5
|
-
import "./chunk-H3NUMCQ6.mjs";
|
|
6
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
7
|
-
|
|
8
|
-
// src/containers/ChessCard/ChessCard.tsx
|
|
9
|
-
import React from "react";
|
|
10
|
-
var ChessCard = ({ subject: game }) => {
|
|
11
|
-
return /* @__PURE__ */ React.createElement(Chessboard.Root, {
|
|
12
|
-
game
|
|
13
|
-
}, /* @__PURE__ */ React.createElement(Chessboard.Content, null, /* @__PURE__ */ React.createElement(Chessboard.Board, null)));
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// src/containers/ChessCard/index.ts
|
|
17
|
-
var ChessCard_default = ChessCard;
|
|
18
|
-
export {
|
|
19
|
-
ChessCard_default as default
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=ChessCard-AUMESHHE.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/ChessCard/ChessCard.tsx", "../../../src/containers/ChessCard/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\n\nimport { Chessboard } from '../../components';\nimport { type Chess } from '../../types';\n\nexport type ChessCardProps = SurfaceComponentProps<Chess.Game>;\n\nexport const ChessCard = ({ subject: game }: ChessCardProps) => {\n return (\n <Chessboard.Root game={game}>\n <Chessboard.Content>\n <Chessboard.Board />\n </Chessboard.Content>\n </Chessboard.Root>\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { ChessCard } from './ChessCard';\n\nexport default ChessCard;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,OAAOA,WAAW;AASX,IAAMC,YAAY,CAAC,EAAEC,SAASC,KAAI,MAAkB;AACzD,SACE,sBAAA,cAACC,WAAWC,MAAI;IAACF;KACf,sBAAA,cAACC,WAAWE,SAAO,MACjB,sBAAA,cAACF,WAAWG,OAAK,IAAA,CAAA,CAAA;AAIzB;;;ACfA,IAAA,oBAAeC;",
|
|
6
|
-
"names": ["React", "ChessCard", "subject", "game", "Chessboard", "Root", "Content", "Board", "ChessCard"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/blueprint-definition/blueprint-definition.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\n\nimport { ChessBlueprint } from '../../blueprints';\n\nconst blueprintDefinition = Capability.makeModule<\n [],\n Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]\n>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, ChessBlueprint)]));\n\nexport default blueprintDefinition;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAIhC,IAAMC,sBAAsBC,WAAWC,WAGrC,MAAaC,eAAQ;EAACF,WAAWG,YAAYC,gBAAgBC,qBAAqBC,uBAAAA;CAAgB,CAAA;AAEpG,IAAA,+BAAeP;",
|
|
6
|
-
"names": ["Effect", "Capability", "AppCapabilities", "blueprintDefinition", "Capability", "makeModule", "succeed", "contributes", "AppCapabilities", "BlueprintDefinition", "ChessBlueprint"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
chess_blueprint_default,
|
|
3
|
-
functions_exports
|
|
4
|
-
} from "../chunk-AWDLDU43.mjs";
|
|
5
|
-
import "../chunk-66H3V2YV.mjs";
|
|
6
|
-
import "../chunk-J5LGTIGS.mjs";
|
|
7
|
-
export {
|
|
8
|
-
chess_blueprint_default as ChessBlueprint,
|
|
9
|
-
functions_exports as ChessFunctions
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,64 +0,0 @@
|
|
|
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 { 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: "dxos.org/type/Chess",
|
|
35
|
-
version: "0.2.0"
|
|
36
|
-
}), LabelAnnotation.set([
|
|
37
|
-
"name"
|
|
38
|
-
]));
|
|
39
|
-
var make = ({ name, pgn, fen } = {}) => {
|
|
40
|
-
const chess = new ChessJS();
|
|
41
|
-
if (pgn) {
|
|
42
|
-
try {
|
|
43
|
-
chess.loadPgn(pgn);
|
|
44
|
-
} catch {
|
|
45
|
-
log.warn(pgn, void 0, {
|
|
46
|
-
F: __dxlog_file,
|
|
47
|
-
L: 48,
|
|
48
|
-
S: void 0,
|
|
49
|
-
C: (f, a) => f(...a)
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return Obj.make(Game, {
|
|
54
|
-
name,
|
|
55
|
-
pgn,
|
|
56
|
-
fen,
|
|
57
|
-
players: {}
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export {
|
|
62
|
-
Chess_exports
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=chunk-66H3V2YV.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { 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: 'dxos.org/type/Chess',\n version: '0.2.0',\n }),\n LabelAnnotation.set(['name']),\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,KAAKC,YAAY;AAC1B,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,CAAA;AAKvB,IAAMM,OAAO,CAAC,EAAEf,MAAMU,KAAKC,IAAG,IAAoD,CAAC,MAAC;AACzF,QAAMK,QAAQ,IAAIzB,QAAAA;AAClB,MAAImB,KAAK;AACP,QAAI;AACFM,YAAMC,QAAQP,GAAAA;IAChB,QAAQ;AACNb,UAAIqB,KAAKR,KAAAA,QAAAA;;;;;;IACX;EACF;AAEA,SAAOjB,IAAIsB,KAAKjB,MAAM;IACpBE;IACAU;IACAC;IACAR,SAAS,CAAC;EACZ,CAAA;AACF;",
|
|
6
|
-
"names": ["Chess", "ChessJS", "Schema", "Obj", "Type", "FormInputAnnotation", "LabelAnnotation", "log", "Game", "Struct", "name", "optional", "String", "players", "white", "annotations", "description", "black", "pipe", "set", "pgn", "fen", "object", "typename", "version", "make", "chess", "loadPgn", "warn"]
|
|
7
|
-
}
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Chess_exports
|
|
3
|
-
} from "./chunk-66H3V2YV.mjs";
|
|
4
|
-
import {
|
|
5
|
-
__export
|
|
6
|
-
} from "./chunk-J5LGTIGS.mjs";
|
|
7
|
-
|
|
8
|
-
// src/blueprints/chess-blueprint.ts
|
|
9
|
-
import { Blueprint, Template } from "@dxos/blueprints";
|
|
10
|
-
import { trim } from "@dxos/util";
|
|
11
|
-
|
|
12
|
-
// src/blueprints/functions/index.ts
|
|
13
|
-
var functions_exports = {};
|
|
14
|
-
__export(functions_exports, {
|
|
15
|
-
ChessFunctions: () => ChessFunctions,
|
|
16
|
-
Create: () => create_default,
|
|
17
|
-
Move: () => move_default,
|
|
18
|
-
Play: () => play_default,
|
|
19
|
-
Print: () => print_default
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// src/blueprints/functions/create.ts
|
|
23
|
-
import * as Effect from "effect/Effect";
|
|
24
|
-
import * as Schema from "effect/Schema";
|
|
25
|
-
import { Database } from "@dxos/echo";
|
|
26
|
-
import { defineFunction } from "@dxos/functions";
|
|
27
|
-
var create_default = defineFunction({
|
|
28
|
-
key: "dxos.org/function/chess/create",
|
|
29
|
-
name: "Create Chess",
|
|
30
|
-
description: "Creates a new chess game.",
|
|
31
|
-
inputSchema: Schema.Struct({
|
|
32
|
-
name: Schema.optional(Schema.String.annotations({
|
|
33
|
-
description: "Name of the game."
|
|
34
|
-
})),
|
|
35
|
-
pgn: Schema.optional(Schema.String.annotations({
|
|
36
|
-
description: "Portable Game Notation."
|
|
37
|
-
})),
|
|
38
|
-
fen: Schema.optional(Schema.String.annotations({
|
|
39
|
-
description: "Forsyth-Edwards Notation."
|
|
40
|
-
}))
|
|
41
|
-
}),
|
|
42
|
-
outputSchema: Chess_exports.Game,
|
|
43
|
-
handler: Effect.fn(function* ({ data: { name, pgn, fen } }) {
|
|
44
|
-
return yield* Database.add(Chess_exports.make({
|
|
45
|
-
name,
|
|
46
|
-
pgn,
|
|
47
|
-
fen
|
|
48
|
-
}));
|
|
49
|
-
})
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// src/blueprints/functions/move.ts
|
|
53
|
-
import { Chess as ChessJS } from "chess.js";
|
|
54
|
-
import * as Effect2 from "effect/Effect";
|
|
55
|
-
import * as Schema2 from "effect/Schema";
|
|
56
|
-
import { Database as Database2, Obj, Ref } from "@dxos/echo";
|
|
57
|
-
import { defineFunction as defineFunction2 } from "@dxos/functions";
|
|
58
|
-
var move_default = defineFunction2({
|
|
59
|
-
key: "dxos.org/function/chess/move",
|
|
60
|
-
name: "Move",
|
|
61
|
-
description: "Makes a move in the given chess game.",
|
|
62
|
-
inputSchema: Schema2.Struct({
|
|
63
|
-
game: Ref.Ref(Chess_exports.Game).annotations({
|
|
64
|
-
description: "The ID of the chess object."
|
|
65
|
-
}),
|
|
66
|
-
move: Schema2.String.annotations({
|
|
67
|
-
description: "The move to make in the chess game.",
|
|
68
|
-
examples: [
|
|
69
|
-
"e4",
|
|
70
|
-
"Bf3"
|
|
71
|
-
]
|
|
72
|
-
})
|
|
73
|
-
}),
|
|
74
|
-
outputSchema: Schema2.Struct({
|
|
75
|
-
pgn: Schema2.String.annotations({
|
|
76
|
-
description: "The PGN of the game after the move was played."
|
|
77
|
-
})
|
|
78
|
-
}),
|
|
79
|
-
handler: Effect2.fn(function* ({ data: { game, move } }) {
|
|
80
|
-
const obj = yield* Database2.load(game);
|
|
81
|
-
const chess = new ChessJS();
|
|
82
|
-
if (obj.pgn) {
|
|
83
|
-
chess.loadPgn(obj.pgn);
|
|
84
|
-
} else if (obj.fen) {
|
|
85
|
-
chess.load(obj.fen);
|
|
86
|
-
}
|
|
87
|
-
chess.move(move, {
|
|
88
|
-
strict: false
|
|
89
|
-
});
|
|
90
|
-
const pgn = chess.pgn();
|
|
91
|
-
Obj.change(obj, (obj2) => {
|
|
92
|
-
obj2.pgn = pgn;
|
|
93
|
-
});
|
|
94
|
-
return {
|
|
95
|
-
pgn
|
|
96
|
-
};
|
|
97
|
-
})
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
// src/blueprints/functions/play.ts
|
|
101
|
-
import { Chess as ChessJS2 } from "chess.js";
|
|
102
|
-
import * as Effect3 from "effect/Effect";
|
|
103
|
-
import * as Schema3 from "effect/Schema";
|
|
104
|
-
import { Database as Database3, Obj as Obj2, Ref as Ref2 } from "@dxos/echo";
|
|
105
|
-
import { defineFunction as defineFunction3 } from "@dxos/functions";
|
|
106
|
-
var play_default = defineFunction3({
|
|
107
|
-
key: "dxos.org/function/chess/play",
|
|
108
|
-
name: "Play",
|
|
109
|
-
description: "Uses the chess engine to play the next move.",
|
|
110
|
-
inputSchema: Schema3.Struct({
|
|
111
|
-
game: Ref2.Ref(Chess_exports.Game).annotations({
|
|
112
|
-
description: "The ID of the chess object."
|
|
113
|
-
}),
|
|
114
|
-
side: Schema3.optional(Schema3.Literal("white", "black", "any")).annotations({
|
|
115
|
-
description: "The side to play.",
|
|
116
|
-
defaultValue: "any"
|
|
117
|
-
})
|
|
118
|
-
}),
|
|
119
|
-
outputSchema: Schema3.Struct({
|
|
120
|
-
pgn: Schema3.String.annotations({
|
|
121
|
-
description: "The PGN of the game after the move was played."
|
|
122
|
-
}),
|
|
123
|
-
move: Schema3.optional(Schema3.String).annotations({
|
|
124
|
-
description: "The move that was played."
|
|
125
|
-
})
|
|
126
|
-
}),
|
|
127
|
-
handler: Effect3.fn(function* ({ data: { game, side = "any" } }) {
|
|
128
|
-
const object = yield* Database3.load(game);
|
|
129
|
-
const chess = new ChessJS2();
|
|
130
|
-
if (object.pgn) {
|
|
131
|
-
chess.loadPgn(object.pgn);
|
|
132
|
-
} else if (object.fen) {
|
|
133
|
-
chess.load(object.fen);
|
|
134
|
-
}
|
|
135
|
-
if (!(side === "any" || chess.turn() === "w" && side === "white" || chess.turn() === "b" && side === "black")) {
|
|
136
|
-
return {
|
|
137
|
-
move: void 0,
|
|
138
|
-
pgn: object.pgn
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
const moves = chess.moves();
|
|
142
|
-
const move = moves[Math.floor(Math.random() * moves.length)];
|
|
143
|
-
chess.move(move, {
|
|
144
|
-
strict: false
|
|
145
|
-
});
|
|
146
|
-
const pgn = chess.pgn();
|
|
147
|
-
Obj2.change(object, (o) => {
|
|
148
|
-
o.pgn = pgn;
|
|
149
|
-
});
|
|
150
|
-
return {
|
|
151
|
-
move,
|
|
152
|
-
pgn
|
|
153
|
-
};
|
|
154
|
-
})
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
// src/blueprints/functions/print.ts
|
|
158
|
-
import { Chess as ChessJS3 } from "chess.js";
|
|
159
|
-
import * as Effect4 from "effect/Effect";
|
|
160
|
-
import * as Schema4 from "effect/Schema";
|
|
161
|
-
import { defineFunction as defineFunction4 } from "@dxos/functions";
|
|
162
|
-
var print_default = defineFunction4({
|
|
163
|
-
key: "dxos.org/function/chess/print",
|
|
164
|
-
name: "Print game",
|
|
165
|
-
description: "Prints the chess game to ASCII.",
|
|
166
|
-
inputSchema: Schema4.Struct({
|
|
167
|
-
pgn: Schema4.optional(Schema4.String.annotations({
|
|
168
|
-
description: "Portable Game Notation."
|
|
169
|
-
})),
|
|
170
|
-
fen: Schema4.optional(Schema4.String.annotations({
|
|
171
|
-
description: "Forsyth-Edwards Notation."
|
|
172
|
-
}))
|
|
173
|
-
}),
|
|
174
|
-
outputSchema: Schema4.Struct({
|
|
175
|
-
ascii: Schema4.String
|
|
176
|
-
}),
|
|
177
|
-
handler: Effect4.fn(function* ({ data: { pgn, fen } }) {
|
|
178
|
-
try {
|
|
179
|
-
const chess = new ChessJS3(fen);
|
|
180
|
-
if (pgn) {
|
|
181
|
-
chess.loadPgn(pgn);
|
|
182
|
-
}
|
|
183
|
-
return {
|
|
184
|
-
ascii: chess.ascii()
|
|
185
|
-
};
|
|
186
|
-
} catch {
|
|
187
|
-
return {
|
|
188
|
-
ascii: ""
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
})
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
// src/blueprints/functions/index.ts
|
|
195
|
-
var ChessFunctions = {
|
|
196
|
-
Create: create_default,
|
|
197
|
-
Move: move_default,
|
|
198
|
-
Play: play_default,
|
|
199
|
-
Print: print_default
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
// src/blueprints/chess-blueprint.ts
|
|
203
|
-
var BLUEPRINT_KEY = "dxos.org/blueprint/chess";
|
|
204
|
-
var functions = Object.values(ChessFunctions);
|
|
205
|
-
var make = () => Blueprint.make({
|
|
206
|
-
key: BLUEPRINT_KEY,
|
|
207
|
-
name: "Chess",
|
|
208
|
-
tools: Blueprint.toolDefinitions({
|
|
209
|
-
functions
|
|
210
|
-
}),
|
|
211
|
-
instructions: Template.make({
|
|
212
|
-
source: trim`
|
|
213
|
-
You are an expert chess player.
|
|
214
|
-
To analyze a game you can access the "pgn" property by loading the context object that represents the current game.
|
|
215
|
-
You could suggest a good next move or offer to play a move.
|
|
216
|
-
Don't actually make a move unless you are asked to.
|
|
217
|
-
`
|
|
218
|
-
})
|
|
219
|
-
});
|
|
220
|
-
var blueprint = {
|
|
221
|
-
key: BLUEPRINT_KEY,
|
|
222
|
-
functions,
|
|
223
|
-
make
|
|
224
|
-
};
|
|
225
|
-
var chess_blueprint_default = blueprint;
|
|
226
|
-
|
|
227
|
-
export {
|
|
228
|
-
functions_exports,
|
|
229
|
-
chess_blueprint_default
|
|
230
|
-
};
|
|
231
|
-
//# sourceMappingURL=chunk-AWDLDU43.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/chess-blueprint.ts", "../../../src/blueprints/functions/index.ts", "../../../src/blueprints/functions/create.ts", "../../../src/blueprints/functions/move.ts", "../../../src/blueprints/functions/play.ts", "../../../src/blueprints/functions/print.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 { ChessFunctions } from './functions';\n\nconst BLUEPRINT_KEY = 'dxos.org/blueprint/chess';\n\nconst functions = Object.values(ChessFunctions);\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Chess',\n tools: Blueprint.toolDefinitions({ functions }),\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 functions,\n make,\n};\n\nexport default blueprint;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport Create from './create';\nimport Move from './move';\nimport Play from './play';\nimport Print from './print';\n\nexport { Create, Move, Play, Print };\n\nexport const ChessFunctions = {\n Create,\n Move,\n Play,\n Print,\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { Database } from '@dxos/echo';\nimport { defineFunction } from '@dxos/functions';\n\nimport { Chess } from '../../types';\n\nexport default defineFunction({\n key: 'dxos.org/function/chess/create',\n name: 'Create Chess',\n description: 'Creates a new chess game.',\n inputSchema: 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 outputSchema: Chess.Game,\n handler: Effect.fn(function* ({ data: { name, pgn, fen } }) {\n return yield* Database.add(Chess.make({ name, pgn, fen }));\n }),\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { Database, Obj, Ref } from '@dxos/echo';\nimport { defineFunction } from '@dxos/functions';\n\nimport { Chess } from '../../types';\n\nexport default defineFunction({\n key: 'dxos.org/function/chess/move',\n name: 'Move',\n description: 'Makes a move in the given chess game.',\n inputSchema: 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 outputSchema: Schema.Struct({\n pgn: Schema.String.annotations({\n description: 'The PGN of the game after the move was played.',\n }),\n }),\n handler: Effect.fn(function* ({ data: { game, move } }) {\n const obj = yield* Database.load(game);\n const chess = new ChessJS();\n if (obj.pgn) {\n chess.loadPgn(obj.pgn);\n } else if (obj.fen) {\n chess.load(obj.fen);\n }\n\n chess.move(move, { strict: false });\n const pgn = chess.pgn();\n Obj.change(obj, (obj) => {\n obj.pgn = pgn;\n });\n return { pgn };\n }),\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { Database, Obj, Ref } from '@dxos/echo';\nimport { defineFunction } from '@dxos/functions';\n\nimport { Chess } from '../../types';\n\nexport default defineFunction({\n key: 'dxos.org/function/chess/play',\n name: 'Play',\n description: 'Uses the chess engine to play the next move.',\n inputSchema: 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 outputSchema: 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 handler: Effect.fn(function* ({ data: { game, side = 'any' } }) {\n const object = yield* Database.load(game);\n const chess = new ChessJS();\n if (object.pgn) {\n chess.loadPgn(object.pgn);\n } else if (object.fen) {\n chess.load(object.fen);\n }\n\n if (!(side === 'any' || (chess.turn() === 'w' && side === 'white') || (chess.turn() === 'b' && side === 'black'))) {\n return { move: undefined, pgn: object.pgn! };\n }\n\n const moves = chess.moves();\n const move = moves[Math.floor(Math.random() * moves.length)];\n\n chess.move(move, { strict: false });\n const pgn = chess.pgn();\n Obj.change(object, (o) => {\n o.pgn = pgn;\n });\n return { move, pgn };\n }),\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { defineFunction } from '@dxos/functions';\n\nexport default defineFunction({\n key: 'dxos.org/function/chess/print',\n name: 'Print game',\n description: 'Prints the chess game to ASCII.',\n inputSchema: 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 outputSchema: Schema.Struct({\n ascii: Schema.String,\n }),\n handler: Effect.fn(function* ({ data: { pgn, fen } }) {\n try {\n const chess = new ChessJS(fen);\n if (pgn) {\n chess.loadPgn(pgn);\n }\n return { ascii: chess.ascii() };\n } catch {\n // TODO(burdon): Error handling?\n return { ascii: '' };\n }\n }),\n});\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Blueprint", "Template", "trim", "Effect", "Schema", "Database", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "optional", "String", "annotations", "pgn", "fen", "outputSchema", "Chess", "Game", "handler", "fn", "data", "Database", "add", "make", "Chess", "ChessJS", "Effect", "Schema", "Database", "Obj", "Ref", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "game", "Ref", "Chess", "Game", "annotations", "move", "String", "examples", "outputSchema", "pgn", "handler", "fn", "data", "obj", "Database", "load", "chess", "ChessJS", "loadPgn", "fen", "strict", "Obj", "change", "Chess", "ChessJS", "Effect", "Schema", "Database", "Obj", "Ref", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "game", "Ref", "Chess", "Game", "annotations", "side", "optional", "Literal", "defaultValue", "outputSchema", "pgn", "String", "move", "handler", "fn", "data", "object", "Database", "load", "chess", "ChessJS", "loadPgn", "fen", "turn", "undefined", "moves", "Math", "floor", "random", "length", "strict", "Obj", "change", "o", "Chess", "ChessJS", "Effect", "Schema", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "pgn", "optional", "String", "annotations", "fen", "outputSchema", "ascii", "handler", "fn", "data", "chess", "ChessJS", "loadPgn", "ChessFunctions", "Create", "Move", "Play", "Print", "BLUEPRINT_KEY", "functions", "Object", "values", "ChessFunctions", "make", "Blueprint", "key", "name", "tools", "toolDefinitions", "instructions", "Template", "source", "trim", "blueprint"]
|
|
7
|
-
}
|