@dxos/plugin-chess 0.8.4-main.b97322e → 0.8.4-main.bc2380dfbc
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/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/neutral/blueprint-definition-PZXHAYLD.mjs +15 -0
- 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/neutral/chunk-5UOTTW6U.mjs +8 -0
- package/dist/lib/neutral/chunk-5UOTTW6U.mjs.map +7 -0
- package/dist/lib/neutral/chunk-E4LZPHAQ.mjs +148 -0
- package/dist/lib/neutral/chunk-E4LZPHAQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HVIKFYAW.mjs +29 -0
- package/dist/lib/neutral/chunk-HVIKFYAW.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NYIJLMS3.mjs +25 -0
- package/dist/lib/neutral/chunk-NYIJLMS3.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/neutral/components/index.mjs +239 -0
- 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-24UKIBRM.mjs +40 -0
- package/dist/lib/neutral/game-variant-24UKIBRM.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +18 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/move-RQZ7BJY3.mjs +37 -0
- package/dist/lib/neutral/move-RQZ7BJY3.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/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/play-GDGCEPQL.mjs +46 -0
- package/dist/lib/neutral/play-GDGCEPQL.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-ZQA74KZI.mjs +29 -0
- package/dist/lib/neutral/print-ZQA74KZI.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +34 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/ChessPlugin.d.ts +3 -1
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- package/dist/types/src/ChessPlugin.node.d.ts +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/ChessPlugin.workerd.d.ts +4 -0
- package/dist/types/src/ChessPlugin.workerd.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 +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- 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 -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/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 +57 -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 +5 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +56 -0
- package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ChessArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts +5 -0
- package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -0
- package/dist/types/src/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 +2 -3
- 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/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 -14
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts +18 -0
- package/dist/types/src/types/Chess.d.ts.map +1 -0
- package/dist/types/src/types/ChessOperation.d.ts +24 -0
- package/dist/types/src/types/ChessOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +117 -51
- package/src/ChessPlugin.node.ts +23 -0
- package/src/ChessPlugin.test.ts +50 -0
- package/src/ChessPlugin.tsx +20 -54
- package/src/ChessPlugin.workerd.ts +18 -0
- package/src/blueprints/chess-blueprint.ts +32 -0
- package/src/blueprints/index.ts +5 -0
- package/src/capabilities/blueprint-definition.ts +19 -0
- package/src/capabilities/game-variant.ts +42 -0
- package/src/capabilities/index.ts +9 -4
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/components/Chessboard/Chessboard.stories.tsx +94 -0
- package/src/components/Chessboard/Chessboard.tsx +180 -0
- package/src/components/Chessboard/Info.tsx +193 -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 +59 -0
- package/src/containers/ChessArticle/ChessArticle.tsx +108 -0
- package/src/containers/ChessArticle/index.ts +5 -0
- package/src/containers/ChessCard/ChessCard.stories.tsx +47 -0
- package/src/containers/ChessCard/ChessCard.tsx +27 -0
- package/src/containers/ChessCard/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/index.ts +2 -4
- package/src/meta.ts +11 -7
- 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 +18 -12
- package/src/types/Chess.ts +59 -0
- package/src/types/ChessOperation.ts +85 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/browser/ChessContainer-SC4ZV6XZ.mjs +0 -129
- package/dist/lib/browser/ChessContainer-SC4ZV6XZ.mjs.map +0 -7
- package/dist/lib/browser/artifact-definition-A2FSM255.mjs +0 -182
- package/dist/lib/browser/artifact-definition-A2FSM255.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-KDADGLPC.mjs +0 -8
- package/dist/lib/browser/chunk-KDADGLPC.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZXH3N4NA.mjs +0 -66
- package/dist/lib/browser/chunk-ZXH3N4NA.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -98
- package/dist/lib/browser/index.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/meta.json +0 -1
- package/dist/lib/browser/react-surface-PLUCWIYP.mjs +0 -36
- package/dist/lib/browser/react-surface-PLUCWIYP.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -11
- package/dist/lib/node-esm/ChessContainer-7GLY5KLY.mjs +0 -130
- package/dist/lib/node-esm/ChessContainer-7GLY5KLY.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-2H7OUBZO.mjs +0 -183
- package/dist/lib/node-esm/artifact-definition-2H7OUBZO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-27D3JA3K.mjs +0 -68
- package/dist/lib/node-esm/chunk-27D3JA3K.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-QFINI7CC.mjs +0 -10
- package/dist/lib/node-esm/chunk-QFINI7CC.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -99
- package/dist/lib/node-esm/index.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/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-NGLNIWN3.mjs +0 -37
- package/dist/lib/node-esm/react-surface-NGLNIWN3.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -12
- package/dist/types/src/capabilities/artifact-definition.d.ts +0 -11
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
- 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/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/Chess.d.ts +0 -14
- package/dist/types/src/components/Chess.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/ChessContainer.stories.d.ts +0 -23
- package/dist/types/src/components/ChessContainer.stories.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/artifact-definition.ts +0 -124
- package/src/capabilities/intent-resolver.ts +0 -26
- package/src/capabilities/react-surface.tsx +0 -23
- package/src/components/Chess.tsx +0 -60
- package/src/components/ChessContainer.stories.tsx +0 -110
- package/src/components/ChessContainer.tsx +0 -71
- package/src/components/ChessPanel.tsx +0 -67
- package/src/components/Chessboard.stories.tsx +0 -41
- package/src/components/PlayerSelector.tsx +0 -82
- package/src/types/schema.ts +0 -34
- package/src/types/types.ts +0 -20
- /package/dist/lib/{browser/types/index.mjs.map → neutral/ChessPlugin.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/blueprints}/index.mjs.map +0 -0
package/src/meta.ts
CHANGED
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { meta as gameMeta } from '@dxos/plugin-game';
|
|
7
|
+
import { trim } from '@dxos/util';
|
|
6
8
|
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
export const meta: PluginMeta = {
|
|
10
|
-
id: CHESS_PLUGIN,
|
|
9
|
+
export const meta: Plugin.Meta = {
|
|
10
|
+
id: 'org.dxos.plugin.chess',
|
|
11
11
|
name: 'Chess',
|
|
12
|
-
description:
|
|
13
|
-
|
|
12
|
+
description: trim`
|
|
13
|
+
Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.
|
|
14
|
+
Track game history and analyze moves in real-time.
|
|
15
|
+
`,
|
|
14
16
|
icon: 'ph--shield-chevron--regular',
|
|
17
|
+
iconHue: 'amber',
|
|
15
18
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',
|
|
16
19
|
screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],
|
|
20
|
+
dependsOn: [gameMeta.id],
|
|
17
21
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { loadGame } from '@dxos/plugin-game';
|
|
11
|
+
|
|
12
|
+
import { Chess, ChessOperation } from '../types';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof ChessOperation.Move> = ChessOperation.Move.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fn(function* ({ game, move }) {
|
|
17
|
+
const { variant } = yield* loadGame(game, Chess.State);
|
|
18
|
+
const chess = new ChessJS();
|
|
19
|
+
if (variant.pgn) {
|
|
20
|
+
chess.loadPgn(variant.pgn);
|
|
21
|
+
} else if (variant.fen) {
|
|
22
|
+
chess.load(variant.fen);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
chess.move(move, { strict: false });
|
|
26
|
+
const pgn = chess.pgn();
|
|
27
|
+
Obj.update(variant, (variant) => {
|
|
28
|
+
const mutable = variant as Obj.Mutable<typeof variant>;
|
|
29
|
+
mutable.pgn = pgn;
|
|
30
|
+
});
|
|
31
|
+
return { pgn };
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export default handler;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { loadGame } from '@dxos/plugin-game';
|
|
11
|
+
|
|
12
|
+
import { Chess, ChessOperation } from '../types';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof ChessOperation.Play> = ChessOperation.Play.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fn(function* ({ game, side = 'any' }) {
|
|
17
|
+
const { variant } = yield* loadGame(game, Chess.State);
|
|
18
|
+
const chess = new ChessJS();
|
|
19
|
+
if (variant.pgn) {
|
|
20
|
+
chess.loadPgn(variant.pgn);
|
|
21
|
+
} else if (variant.fen) {
|
|
22
|
+
chess.load(variant.fen);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (
|
|
26
|
+
!(side === 'any' || (chess.turn() === 'w' && side === 'white') || (chess.turn() === 'b' && side === 'black'))
|
|
27
|
+
) {
|
|
28
|
+
return { move: undefined, pgn: variant.pgn ?? '' };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const moves = chess.moves();
|
|
32
|
+
const move = moves[Math.floor(Math.random() * moves.length)];
|
|
33
|
+
|
|
34
|
+
chess.move(move, { strict: false });
|
|
35
|
+
const pgn = chess.pgn();
|
|
36
|
+
Obj.update(variant, (variant) => {
|
|
37
|
+
const mutable = variant as Obj.Mutable<typeof variant>;
|
|
38
|
+
mutable.pgn = pgn;
|
|
39
|
+
});
|
|
40
|
+
return { move, pgn };
|
|
41
|
+
}),
|
|
42
|
+
),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export default handler;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { ChessOperation } from '../types';
|
|
11
|
+
|
|
12
|
+
const handler: Operation.WithHandler<typeof ChessOperation.Print> = ChessOperation.Print.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fn(function* ({ pgn, fen }) {
|
|
15
|
+
try {
|
|
16
|
+
const chess = new ChessJS(fen);
|
|
17
|
+
if (pgn) {
|
|
18
|
+
chess.loadPgn(pgn);
|
|
19
|
+
}
|
|
20
|
+
return { ascii: chess.ascii() };
|
|
21
|
+
} catch {
|
|
22
|
+
return { ascii: '' };
|
|
23
|
+
}
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default handler;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const ChessPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { ChessOperationHandlerSet } from './operations';
|
package/src/testing.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -4,24 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
8
|
-
import {
|
|
7
|
+
import { meta } from '#meta';
|
|
8
|
+
import { Chess } from '#types';
|
|
9
9
|
|
|
10
10
|
export const translations = [
|
|
11
11
|
{
|
|
12
12
|
'en-US': {
|
|
13
|
-
[
|
|
14
|
-
'typename
|
|
15
|
-
'typename
|
|
16
|
-
'typename
|
|
17
|
-
'typename
|
|
18
|
-
'object name placeholder': 'New game',
|
|
19
|
-
'rename object label': 'Rename game',
|
|
20
|
-
'delete object label': 'Delete game',
|
|
13
|
+
[Chess.State.typename]: {
|
|
14
|
+
'typename.label': 'Chess',
|
|
15
|
+
'typename.label_zero': 'Chess games',
|
|
16
|
+
'typename.label_one': 'Chess game',
|
|
17
|
+
'typename.label_other': 'Chess games',
|
|
21
18
|
},
|
|
22
19
|
[meta.id]: {
|
|
23
|
-
'plugin
|
|
24
|
-
'
|
|
20
|
+
'plugin.name': 'Chess',
|
|
21
|
+
'new-game.button': 'New game',
|
|
22
|
+
'delete-game.label': 'Delete',
|
|
23
|
+
'game.checkmate.label': 'Checkmate',
|
|
24
|
+
'game.stalemate.label': 'Stalemate',
|
|
25
|
+
'game.draw.label': 'Draw',
|
|
26
|
+
'game.check.label': 'Check',
|
|
27
|
+
'select-player.button': 'Select player',
|
|
28
|
+
'toggle-info.button': 'Toggle info',
|
|
29
|
+
'close-info.button': 'Close info',
|
|
30
|
+
'flip-board.button': 'Flip board',
|
|
25
31
|
},
|
|
26
32
|
},
|
|
27
33
|
},
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Chess as ChessJS } from 'chess.js';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
7
|
+
|
|
8
|
+
import { BlueprintsAnnotation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Annotation, Obj, Type } from '@dxos/echo';
|
|
10
|
+
import { FormInputAnnotation, SystemTypeAnnotation } from '@dxos/echo/internal';
|
|
11
|
+
import { log } from '@dxos/log';
|
|
12
|
+
|
|
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({
|
|
20
|
+
pgn: Schema.String.annotations({
|
|
21
|
+
description: 'Portable Game Notation.',
|
|
22
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
23
|
+
fen: Schema.String.annotations({
|
|
24
|
+
description: 'Forsyth-Edwards Notation.',
|
|
25
|
+
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
26
|
+
}).pipe(
|
|
27
|
+
Type.object({
|
|
28
|
+
typename: 'org.dxos.type.chess.state',
|
|
29
|
+
version: '0.1.0',
|
|
30
|
+
}),
|
|
31
|
+
Annotation.IconAnnotation.set({
|
|
32
|
+
icon: 'ph--shield-chevron--regular',
|
|
33
|
+
hue: 'amber',
|
|
34
|
+
}),
|
|
35
|
+
BlueprintsAnnotation.set([BLUEPRINT_KEY]),
|
|
36
|
+
// Implementation detail of the unified `Game` schema. The user-facing object is `Game`;
|
|
37
|
+
// this state is only ever referenced via `Game.variant`. SystemType keeps it out of the
|
|
38
|
+
// navtree's typed branches so an orphaned state object doesn't reappear after the
|
|
39
|
+
// wrapping Game is deleted.
|
|
40
|
+
SystemTypeAnnotation.set(true),
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export interface State extends Schema.Schema.Type<typeof State> {}
|
|
44
|
+
|
|
45
|
+
export const make = ({ pgn, fen }: { pgn?: string; fen?: string } = {}): State => {
|
|
46
|
+
const chess = new ChessJS();
|
|
47
|
+
if (pgn) {
|
|
48
|
+
try {
|
|
49
|
+
chess.loadPgn(pgn);
|
|
50
|
+
} catch {
|
|
51
|
+
log.warn(pgn);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return Obj.make(State, {
|
|
56
|
+
pgn,
|
|
57
|
+
fen,
|
|
58
|
+
});
|
|
59
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
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 } 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: 'org.dxos.function.chess.move',
|
|
18
|
+
name: 'Move',
|
|
19
|
+
description: 'Makes a move in the given chess game.',
|
|
20
|
+
},
|
|
21
|
+
input: Schema.Struct({
|
|
22
|
+
game: GameRef(Chess.State).annotations({
|
|
23
|
+
description: 'The ID of the game object (variant must be Chess).',
|
|
24
|
+
}),
|
|
25
|
+
move: Schema.String.annotations({
|
|
26
|
+
description: 'The move to make in the chess game.',
|
|
27
|
+
examples: ['e4', 'Bf3'],
|
|
28
|
+
}),
|
|
29
|
+
}),
|
|
30
|
+
output: Schema.Struct({
|
|
31
|
+
pgn: Schema.String.annotations({
|
|
32
|
+
description: 'The PGN of the game after the move was played.',
|
|
33
|
+
}),
|
|
34
|
+
}),
|
|
35
|
+
services: [Database.Service],
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const Play = Operation.make({
|
|
39
|
+
meta: {
|
|
40
|
+
key: 'org.dxos.function.chess.play',
|
|
41
|
+
name: 'Play',
|
|
42
|
+
description: 'Uses the chess engine to play the next move.',
|
|
43
|
+
},
|
|
44
|
+
input: Schema.Struct({
|
|
45
|
+
game: GameRef(Chess.State).annotations({
|
|
46
|
+
description: 'The ID of the game object (variant must be Chess).',
|
|
47
|
+
}),
|
|
48
|
+
side: Schema.optional(Schema.Literal('white', 'black', 'any')).annotations({
|
|
49
|
+
description: 'The side to play.',
|
|
50
|
+
defaultValue: 'any',
|
|
51
|
+
}),
|
|
52
|
+
}),
|
|
53
|
+
output: Schema.Struct({
|
|
54
|
+
pgn: Schema.String.annotations({
|
|
55
|
+
description: 'The PGN of the game after the move was played.',
|
|
56
|
+
}),
|
|
57
|
+
move: Schema.optional(Schema.String).annotations({
|
|
58
|
+
description: 'The move that was played.',
|
|
59
|
+
}),
|
|
60
|
+
}),
|
|
61
|
+
services: [Database.Service],
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const Print = Operation.make({
|
|
65
|
+
meta: {
|
|
66
|
+
key: 'org.dxos.function.chess.print',
|
|
67
|
+
name: 'Print game',
|
|
68
|
+
description: 'Prints the chess game to ASCII.',
|
|
69
|
+
},
|
|
70
|
+
input: Schema.Struct({
|
|
71
|
+
pgn: Schema.optional(
|
|
72
|
+
Schema.String.annotations({
|
|
73
|
+
description: 'Portable Game Notation.',
|
|
74
|
+
}),
|
|
75
|
+
),
|
|
76
|
+
fen: Schema.optional(
|
|
77
|
+
Schema.String.annotations({
|
|
78
|
+
description: 'Forsyth-Edwards Notation.',
|
|
79
|
+
}),
|
|
80
|
+
),
|
|
81
|
+
}),
|
|
82
|
+
output: Schema.Struct({
|
|
83
|
+
ascii: Schema.String,
|
|
84
|
+
}),
|
|
85
|
+
});
|
package/src/types/index.ts
CHANGED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Chess
|
|
3
|
-
} from "./chunk-ZXH3N4NA.mjs";
|
|
4
|
-
|
|
5
|
-
// src/components/ChessContainer.tsx
|
|
6
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
7
|
-
import React2 from "react";
|
|
8
|
-
import { getSpace } from "@dxos/react-client/echo";
|
|
9
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
10
|
-
|
|
11
|
-
// src/components/PlayerSelector.tsx
|
|
12
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
13
|
-
import React from "react";
|
|
14
|
-
import { generateName } from "@dxos/display-name";
|
|
15
|
-
import { useMembers } from "@dxos/react-client/echo";
|
|
16
|
-
import { Icon, Input, Select, useThemeContext } from "@dxos/react-ui";
|
|
17
|
-
var PlayerSelector = ({ space, game }) => {
|
|
18
|
-
var _effect = _useSignals();
|
|
19
|
-
try {
|
|
20
|
-
const members = useMembers(space.key);
|
|
21
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
22
|
-
role: "none",
|
|
23
|
-
className: "grid grid-cols-2 gap-8"
|
|
24
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
25
|
-
role: "none",
|
|
26
|
-
className: "flex flex-row-reverse items-center gap-2"
|
|
27
|
-
}, /* @__PURE__ */ React.createElement(PlayerSelect, {
|
|
28
|
-
side: "white",
|
|
29
|
-
value: game.playerWhite,
|
|
30
|
-
onValueChange: (player) => game.playerWhite = player,
|
|
31
|
-
members
|
|
32
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
33
|
-
role: "none",
|
|
34
|
-
className: "flex flex-row items-center gap-2"
|
|
35
|
-
}, /* @__PURE__ */ React.createElement(PlayerSelect, {
|
|
36
|
-
side: "black",
|
|
37
|
-
value: game.playerBlack,
|
|
38
|
-
onValueChange: (player) => game.playerBlack = player,
|
|
39
|
-
members
|
|
40
|
-
})));
|
|
41
|
-
} finally {
|
|
42
|
-
_effect.f();
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var PlayerSelect = ({ side, value, onValueChange, members }) => {
|
|
46
|
-
var _effect = _useSignals();
|
|
47
|
-
try {
|
|
48
|
-
const { themeMode } = useThemeContext();
|
|
49
|
-
const iconFillMode = side === "black" && themeMode === "light" || side === "white" && themeMode === "dark" ? "fill" : void 0;
|
|
50
|
-
return /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Label, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
51
|
-
"aria-label": `Chess icon for side ${side}`,
|
|
52
|
-
icon: `ph--crown-cross--${iconFillMode || "regular"}`,
|
|
53
|
-
size: 6
|
|
54
|
-
})), /* @__PURE__ */ React.createElement(Select.Root, {
|
|
55
|
-
value,
|
|
56
|
-
onValueChange
|
|
57
|
-
}, /* @__PURE__ */ React.createElement(Select.TriggerButton, {
|
|
58
|
-
placeholder: "Select player"
|
|
59
|
-
}), /* @__PURE__ */ React.createElement(Select.Portal, null, /* @__PURE__ */ React.createElement(Select.Content, null, /* @__PURE__ */ React.createElement(Select.Viewport, null, members.map((member) => {
|
|
60
|
-
const memberKey = member.identity.identityKey.toHex();
|
|
61
|
-
const displayName = member.identity?.profile?.displayName || generateName(memberKey);
|
|
62
|
-
return /* @__PURE__ */ React.createElement(Select.Option, {
|
|
63
|
-
key: memberKey,
|
|
64
|
-
value: memberKey
|
|
65
|
-
}, displayName);
|
|
66
|
-
}))))));
|
|
67
|
-
} finally {
|
|
68
|
-
_effect.f();
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// src/components/ChessContainer.tsx
|
|
73
|
-
var containFragment = "is-[min(100cqw,100cqh)] bs-[min(100cqw,100cqh)]";
|
|
74
|
-
var ChessContainer = ({ game, role }) => {
|
|
75
|
-
var _effect = _useSignals2();
|
|
76
|
-
try {
|
|
77
|
-
const space = getSpace(game);
|
|
78
|
-
if (!space) {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
switch (role) {
|
|
82
|
-
case "card--popover": {
|
|
83
|
-
return /* @__PURE__ */ React2.createElement(Chess.Root, {
|
|
84
|
-
game
|
|
85
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
86
|
-
role: "none",
|
|
87
|
-
className: "popover-square size-container"
|
|
88
|
-
}, /* @__PURE__ */ React2.createElement(Chess.Board, {
|
|
89
|
-
classNames: containFragment
|
|
90
|
-
})));
|
|
91
|
-
}
|
|
92
|
-
case "card--extrinsic": {
|
|
93
|
-
return /* @__PURE__ */ React2.createElement(Chess.Root, {
|
|
94
|
-
game
|
|
95
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
96
|
-
role: "none",
|
|
97
|
-
className: "grid is-full bs-full size-container place-content-center"
|
|
98
|
-
}, /* @__PURE__ */ React2.createElement(Chess.Board, {
|
|
99
|
-
classNames: containFragment
|
|
100
|
-
})));
|
|
101
|
-
}
|
|
102
|
-
case "card--intrinsic": {
|
|
103
|
-
return /* @__PURE__ */ React2.createElement(Chess.Root, {
|
|
104
|
-
game
|
|
105
|
-
}, /* @__PURE__ */ React2.createElement(Chess.Board, null));
|
|
106
|
-
}
|
|
107
|
-
default: {
|
|
108
|
-
return /* @__PURE__ */ React2.createElement(StackItem.Content, null, /* @__PURE__ */ React2.createElement("div", {
|
|
109
|
-
role: "none",
|
|
110
|
-
className: "grid grid-rows-[60px_1fr_60px] grow overflow-hidden"
|
|
111
|
-
}, /* @__PURE__ */ React2.createElement("div", null), /* @__PURE__ */ React2.createElement("div", {
|
|
112
|
-
className: "flex m-4 overflow-hidden"
|
|
113
|
-
}, /* @__PURE__ */ React2.createElement(Chess.Root, {
|
|
114
|
-
game
|
|
115
|
-
}, /* @__PURE__ */ React2.createElement(Chess.Content, null, /* @__PURE__ */ React2.createElement(Chess.Board, null)))), /* @__PURE__ */ React2.createElement(PlayerSelector, {
|
|
116
|
-
space,
|
|
117
|
-
game
|
|
118
|
-
})));
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
} finally {
|
|
122
|
-
_effect.f();
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
var ChessContainer_default = ChessContainer;
|
|
126
|
-
export {
|
|
127
|
-
ChessContainer_default as default
|
|
128
|
-
};
|
|
129
|
-
//# sourceMappingURL=ChessContainer-SC4ZV6XZ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ChessContainer.tsx", "../../../src/components/PlayerSelector.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { Chess } from './Chess';\nimport { PlayerSelector } from './PlayerSelector';\nimport { type ChessType } from '../types';\n\nconst containFragment = 'is-[min(100cqw,100cqh)] bs-[min(100cqw,100cqh)]';\n\nconst ChessContainer = ({ game, role }: { game: ChessType; role?: string }) => {\n const space = getSpace(game);\n\n if (!space) {\n return null;\n }\n\n switch (role) {\n case 'card--popover': {\n return (\n <Chess.Root game={game}>\n <div role='none' className='popover-square size-container'>\n <Chess.Board classNames={containFragment} />\n </div>\n </Chess.Root>\n );\n }\n case 'card--extrinsic': {\n return (\n <Chess.Root game={game}>\n <div role='none' className='grid is-full bs-full size-container place-content-center'>\n <Chess.Board classNames={containFragment} />\n </div>\n </Chess.Root>\n );\n }\n case 'card--intrinsic': {\n return (\n <Chess.Root game={game}>\n <Chess.Board />\n </Chess.Root>\n );\n }\n default: {\n return (\n <StackItem.Content>\n <div role='none' className='grid grid-rows-[60px_1fr_60px] grow overflow-hidden'>\n <div />\n\n <div className='flex m-4 overflow-hidden'>\n <Chess.Root game={game}>\n <Chess.Content>\n <Chess.Board />\n </Chess.Content>\n </Chess.Root>\n </div>\n\n <PlayerSelector space={space} game={game} />\n </div>\n </StackItem.Content>\n );\n }\n }\n};\n\nexport default ChessContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { generateName } from '@dxos/display-name';\nimport { useMembers, type Space, type SpaceMember } from '@dxos/react-client/echo';\nimport { Icon, Input, Select, useThemeContext } from '@dxos/react-ui';\n\nimport { type ChessType } from '../types';\n\nexport const PlayerSelector = ({ space, game }: { space: Space; game: ChessType }) => {\n const members = useMembers(space.key);\n\n return (\n <div role='none' className='grid grid-cols-2 gap-8'>\n <div role='none' className='flex flex-row-reverse items-center gap-2'>\n <PlayerSelect\n side='white'\n value={game.playerWhite}\n onValueChange={(player) => (game.playerWhite = player)}\n members={members}\n />\n </div>\n <div role='none' className='flex flex-row items-center gap-2'>\n <PlayerSelect\n side='black'\n value={game.playerBlack}\n onValueChange={(player) => (game.playerBlack = player)}\n members={members}\n />\n </div>\n </div>\n );\n};\n\nconst PlayerSelect = ({\n side,\n value,\n onValueChange,\n members,\n}: {\n side: 'white' | 'black';\n value: string | undefined;\n onValueChange: (player: string) => void;\n members: SpaceMember[];\n}) => {\n const { themeMode } = useThemeContext();\n const iconFillMode =\n (side === 'black' && themeMode === 'light') || (side === 'white' && themeMode === 'dark') ? 'fill' : undefined;\n\n return (\n <Input.Root>\n <Input.Label>\n <Icon\n aria-label={`Chess icon for side ${side}`}\n icon={`ph--crown-cross--${iconFillMode || 'regular'}`}\n size={6}\n />\n </Input.Label>\n <Select.Root value={value} onValueChange={onValueChange}>\n <Select.TriggerButton placeholder={'Select player'} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {members.map((member) => {\n const memberKey = member.identity.identityKey.toHex();\n const displayName = member.identity?.profile?.displayName || generateName(memberKey);\n return (\n <Select.Option key={memberKey} value={memberKey}>\n {displayName}\n </Select.Option>\n );\n })}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </Input.Root>\n );\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["React", "getSpace", "StackItem", "React", "generateName", "useMembers", "Icon", "Input", "Select", "useThemeContext", "PlayerSelector", "space", "game", "members", "useMembers", "key", "div", "role", "className", "PlayerSelect", "side", "value", "playerWhite", "onValueChange", "player", "playerBlack", "themeMode", "useThemeContext", "iconFillMode", "undefined", "Input", "Root", "Label", "Icon", "aria-label", "icon", "size", "Select", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "map", "member", "memberKey", "identity", "identityKey", "toHex", "displayName", "profile", "generateName", "Option", "containFragment", "ChessContainer", "game", "role", "space", "getSpace", "React", "Chess", "Root", "div", "className", "Board", "classNames", "StackItem", "Content", "PlayerSelector"]
|
|
7
|
-
}
|