@dxos/plugin-chess 0.8.4-main.5ad4a44 → 0.8.4-main.66e292d

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.
Files changed (77) hide show
  1. package/dist/lib/browser/{ChessboardContainer-OX6TILWD.mjs → ChessboardContainer-5YXEM4VR.mjs} +10 -10
  2. package/dist/lib/browser/ChessboardContainer-5YXEM4VR.mjs.map +7 -0
  3. package/dist/lib/browser/blueprint-definition-Y5Y4YGNL.mjs +11 -0
  4. package/dist/lib/browser/{chunk-VA5TW6SD.mjs → chunk-3LPE2B5J.mjs} +5 -5
  5. package/dist/lib/browser/chunk-3LPE2B5J.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-E5NQWXQ7.mjs → chunk-5DOZV3PW.mjs} +6 -18
  7. package/dist/lib/browser/{chunk-E5NQWXQ7.mjs.map → chunk-5DOZV3PW.mjs.map} +2 -2
  8. package/dist/lib/browser/{chunk-M63HYNXU.mjs → chunk-CCF24VRU.mjs} +11 -12
  9. package/dist/lib/browser/chunk-CCF24VRU.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-WSUUPPDK.mjs → chunk-DUO4WTAM.mjs} +4 -2
  11. package/dist/lib/browser/chunk-DUO4WTAM.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-KQOVCG7Z.mjs → chunk-Q5TZCIH7.mjs} +2 -2
  13. package/dist/lib/browser/index.mjs +22 -21
  14. package/dist/lib/browser/index.mjs.map +3 -3
  15. package/dist/lib/browser/{intent-resolver-OQPSVFOB.mjs → intent-resolver-KPGHK5JU.mjs} +3 -3
  16. package/dist/lib/browser/meta.json +1 -1
  17. package/dist/lib/browser/{react-surface-OLAZCU2E.mjs → react-surface-3YST34QI.mjs} +5 -5
  18. package/dist/lib/browser/types/index.mjs +2 -2
  19. package/dist/lib/node-esm/{ChessboardContainer-PGDHBG6F.mjs → ChessboardContainer-7OQ6TOKB.mjs} +10 -10
  20. package/dist/lib/node-esm/ChessboardContainer-7OQ6TOKB.mjs.map +7 -0
  21. package/dist/lib/node-esm/blueprint-definition-GR6OLMB6.mjs +12 -0
  22. package/dist/lib/node-esm/{chunk-SW5N5XNV.mjs → chunk-F3HFLDV5.mjs} +5 -5
  23. package/dist/lib/node-esm/chunk-F3HFLDV5.mjs.map +7 -0
  24. package/dist/lib/node-esm/{chunk-DWGG7IGH.mjs → chunk-F4C2HVZL.mjs} +6 -18
  25. package/dist/lib/node-esm/{chunk-DWGG7IGH.mjs.map → chunk-F4C2HVZL.mjs.map} +2 -2
  26. package/dist/lib/node-esm/{chunk-5C2OYL2B.mjs → chunk-KNOOJFIR.mjs} +4 -2
  27. package/dist/lib/node-esm/chunk-KNOOJFIR.mjs.map +7 -0
  28. package/dist/lib/node-esm/{chunk-7YK5RFHY.mjs → chunk-QKXLEJNZ.mjs} +11 -12
  29. package/dist/lib/node-esm/chunk-QKXLEJNZ.mjs.map +7 -0
  30. package/dist/lib/node-esm/{chunk-C55L2OCJ.mjs → chunk-VVXTAVIS.mjs} +2 -2
  31. package/dist/lib/node-esm/index.mjs +22 -21
  32. package/dist/lib/node-esm/index.mjs.map +3 -3
  33. package/dist/lib/node-esm/{intent-resolver-KVGTUDXJ.mjs → intent-resolver-ZAELGF7I.mjs} +3 -3
  34. package/dist/lib/node-esm/meta.json +1 -1
  35. package/dist/lib/node-esm/{react-surface-FIKCDZ5L.mjs → react-surface-KV2KBSIU.mjs} +5 -5
  36. package/dist/lib/node-esm/types/index.mjs +2 -2
  37. package/dist/types/src/ChessPlugin.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/blueprint-definition.d.ts +2 -2
  39. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  40. package/dist/types/src/components/Chessboard.stories.d.ts +3 -1
  41. package/dist/types/src/components/Chessboard.stories.d.ts.map +1 -1
  42. package/dist/types/src/components/ChessboardArticle.d.ts.map +1 -1
  43. package/dist/types/src/functions/create.d.ts +2 -2
  44. package/dist/types/src/functions/move.d.ts +1 -1
  45. package/dist/types/src/functions/play.d.ts +1 -1
  46. package/dist/types/src/meta.d.ts.map +1 -1
  47. package/dist/types/src/translations.d.ts +1 -0
  48. package/dist/types/src/translations.d.ts.map +1 -1
  49. package/dist/types/src/types/Chess.d.ts +2 -2
  50. package/dist/types/src/types/Chess.d.ts.map +1 -1
  51. package/dist/types/tsconfig.tsbuildinfo +1 -1
  52. package/package.json +28 -28
  53. package/src/ChessPlugin.tsx +9 -14
  54. package/src/capabilities/blueprint-definition.ts +3 -3
  55. package/src/components/ChessboardArticle.tsx +6 -7
  56. package/src/components/Info.tsx +2 -2
  57. package/src/meta.ts +3 -1
  58. package/src/translations.ts +1 -0
  59. package/src/types/Chess.ts +19 -27
  60. package/dist/lib/browser/ChessboardContainer-OX6TILWD.mjs.map +0 -7
  61. package/dist/lib/browser/blueprint-definition-UVRFUJYE.mjs +0 -11
  62. package/dist/lib/browser/chunk-M63HYNXU.mjs.map +0 -7
  63. package/dist/lib/browser/chunk-VA5TW6SD.mjs.map +0 -7
  64. package/dist/lib/browser/chunk-WSUUPPDK.mjs.map +0 -7
  65. package/dist/lib/node-esm/ChessboardContainer-PGDHBG6F.mjs.map +0 -7
  66. package/dist/lib/node-esm/blueprint-definition-Z47C4EEX.mjs +0 -12
  67. package/dist/lib/node-esm/chunk-5C2OYL2B.mjs.map +0 -7
  68. package/dist/lib/node-esm/chunk-7YK5RFHY.mjs.map +0 -7
  69. package/dist/lib/node-esm/chunk-SW5N5XNV.mjs.map +0 -7
  70. /package/dist/lib/browser/{blueprint-definition-UVRFUJYE.mjs.map → blueprint-definition-Y5Y4YGNL.mjs.map} +0 -0
  71. /package/dist/lib/browser/{chunk-KQOVCG7Z.mjs.map → chunk-Q5TZCIH7.mjs.map} +0 -0
  72. /package/dist/lib/browser/{intent-resolver-OQPSVFOB.mjs.map → intent-resolver-KPGHK5JU.mjs.map} +0 -0
  73. /package/dist/lib/browser/{react-surface-OLAZCU2E.mjs.map → react-surface-3YST34QI.mjs.map} +0 -0
  74. /package/dist/lib/node-esm/{blueprint-definition-Z47C4EEX.mjs.map → blueprint-definition-GR6OLMB6.mjs.map} +0 -0
  75. /package/dist/lib/node-esm/{chunk-C55L2OCJ.mjs.map → chunk-VVXTAVIS.mjs.map} +0 -0
  76. /package/dist/lib/node-esm/{intent-resolver-KVGTUDXJ.mjs.map → intent-resolver-ZAELGF7I.mjs.map} +0 -0
  77. /package/dist/lib/node-esm/{react-surface-FIKCDZ5L.mjs.map → react-surface-KV2KBSIU.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-chess",
3
- "version": "0.8.4-main.5ad4a44",
3
+ "version": "0.8.4-main.66e292d",
4
4
  "description": "Chess for new plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -45,43 +45,43 @@
45
45
  "@preact/signals-core": "^1.12.1",
46
46
  "chess.js": "^1.0.0",
47
47
  "effect": "3.18.3",
48
- "@dxos/ai": "0.8.4-main.5ad4a44",
49
- "@dxos/app-framework": "0.8.4-main.5ad4a44",
50
- "@dxos/assistant": "0.8.4-main.5ad4a44",
51
- "@dxos/async": "0.8.4-main.5ad4a44",
52
- "@dxos/blueprints": "0.8.4-main.5ad4a44",
53
- "@dxos/display-name": "0.8.4-main.5ad4a44",
54
- "@dxos/echo": "0.8.4-main.5ad4a44",
55
- "@dxos/functions": "0.8.4-main.5ad4a44",
56
- "@dxos/invariant": "0.8.4-main.5ad4a44",
57
- "@dxos/live-object": "0.8.4-main.5ad4a44",
58
- "@dxos/plugin-client": "0.8.4-main.5ad4a44",
59
- "@dxos/react-client": "0.8.4-main.5ad4a44",
60
- "@dxos/plugin-graph": "0.8.4-main.5ad4a44",
61
- "@dxos/plugin-space": "0.8.4-main.5ad4a44",
62
- "@dxos/log": "0.8.4-main.5ad4a44",
63
- "@dxos/react-ui-gameboard": "0.8.4-main.5ad4a44",
64
- "@dxos/react-ui-sfx": "0.8.4-main.5ad4a44",
65
- "@dxos/schema": "0.8.4-main.5ad4a44",
66
- "@dxos/react-ui-stack": "0.8.4-main.5ad4a44",
67
- "@dxos/util": "0.8.4-main.5ad4a44"
48
+ "@dxos/ai": "0.8.4-main.66e292d",
49
+ "@dxos/assistant": "0.8.4-main.66e292d",
50
+ "@dxos/async": "0.8.4-main.66e292d",
51
+ "@dxos/blueprints": "0.8.4-main.66e292d",
52
+ "@dxos/display-name": "0.8.4-main.66e292d",
53
+ "@dxos/invariant": "0.8.4-main.66e292d",
54
+ "@dxos/echo": "0.8.4-main.66e292d",
55
+ "@dxos/functions": "0.8.4-main.66e292d",
56
+ "@dxos/live-object": "0.8.4-main.66e292d",
57
+ "@dxos/plugin-client": "0.8.4-main.66e292d",
58
+ "@dxos/plugin-graph": "0.8.4-main.66e292d",
59
+ "@dxos/log": "0.8.4-main.66e292d",
60
+ "@dxos/plugin-space": "0.8.4-main.66e292d",
61
+ "@dxos/react-client": "0.8.4-main.66e292d",
62
+ "@dxos/react-ui-gameboard": "0.8.4-main.66e292d",
63
+ "@dxos/react-ui-sfx": "0.8.4-main.66e292d",
64
+ "@dxos/react-ui-stack": "0.8.4-main.66e292d",
65
+ "@dxos/schema": "0.8.4-main.66e292d",
66
+ "@dxos/util": "0.8.4-main.66e292d",
67
+ "@dxos/app-framework": "0.8.4-main.66e292d"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@types/react": "~19.2.2",
71
- "@types/react-dom": "~19.2.1",
71
+ "@types/react-dom": "~19.2.2",
72
72
  "react": "~19.2.0",
73
73
  "react-dom": "~19.2.0",
74
74
  "vite": "7.1.9",
75
- "@dxos/plugin-theme": "0.8.4-main.5ad4a44",
76
- "@dxos/react-ui-theme": "0.8.4-main.5ad4a44",
77
- "@dxos/react-ui": "0.8.4-main.5ad4a44",
78
- "@dxos/storybook-utils": "0.8.4-main.5ad4a44"
75
+ "@dxos/plugin-theme": "0.8.4-main.66e292d",
76
+ "@dxos/react-ui-theme": "0.8.4-main.66e292d",
77
+ "@dxos/react-ui": "0.8.4-main.66e292d",
78
+ "@dxos/storybook-utils": "0.8.4-main.66e292d"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "react": "^19.0.0",
82
82
  "react-dom": "^19.0.0",
83
- "@dxos/react-ui": "0.8.4-main.5ad4a44",
84
- "@dxos/react-ui-theme": "0.8.4-main.5ad4a44"
83
+ "@dxos/react-ui": "0.8.4-main.66e292d",
84
+ "@dxos/react-ui-theme": "0.8.4-main.66e292d"
85
85
  },
86
86
  "publishConfig": {
87
87
  "access": "public"
@@ -3,11 +3,10 @@
3
3
  //
4
4
 
5
5
  import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
6
- import { ClientEvents } from '@dxos/plugin-client';
7
- import { SpaceCapabilities } from '@dxos/plugin-space';
8
- import { defineObjectForm } from '@dxos/plugin-space/types';
6
+ import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
7
+ import { type CreateObjectIntent } from '@dxos/plugin-space/types';
9
8
 
10
- import { BLUEPRINT_KEY, BlueprintDefinition, IntentResolver, ReactSurface } from './capabilities';
9
+ import { BlueprintDefinition, CHESS_BLUEPRINT_KEY, IntentResolver, ReactSurface } from './capabilities';
11
10
  import { meta } from './meta';
12
11
  import { translations } from './translations';
13
12
  import { Chess, ChessAction } from './types';
@@ -26,21 +25,17 @@ export const ChessPlugin = definePlugin(meta, () => [
26
25
  id: Chess.Game.typename,
27
26
  metadata: {
28
27
  icon: 'ph--shield-chevron--regular',
29
- blueprints: [BLUEPRINT_KEY],
28
+ iconHue: 'amber',
29
+ blueprints: [CHESS_BLUEPRINT_KEY],
30
+ createObjectIntent: (() => createIntent(ChessAction.Create)) satisfies CreateObjectIntent,
31
+ addToCollectionOnCreate: true,
30
32
  },
31
33
  }),
32
34
  }),
33
35
  defineModule({
34
- id: `${meta.id}/module/object-form`,
36
+ id: `${meta.id}/module/schema`,
35
37
  activatesOn: ClientEvents.SetupSchema,
36
- activate: () =>
37
- contributes(
38
- SpaceCapabilities.ObjectForm,
39
- defineObjectForm({
40
- objectSchema: Chess.Game,
41
- getIntent: () => createIntent(ChessAction.Create),
42
- }),
43
- ),
38
+ activate: () => contributes(ClientCapabilities.Schema, [Chess.Game]),
44
39
  }),
45
40
  defineModule({
46
41
  id: `${meta.id}/module/react-surface`,
@@ -9,17 +9,17 @@ import { trim } from '@dxos/util';
9
9
 
10
10
  import { create, move, play } from '../functions';
11
11
 
12
- export const BLUEPRINT_KEY = 'dxos.org/blueprint/chess';
13
-
14
12
  const functions: FunctionDefinition[] = [create, move, play];
15
13
 
14
+ export const CHESS_BLUEPRINT_KEY = 'dxos.org/blueprint/chess';
15
+
16
16
  export default () => {
17
17
  return [
18
18
  contributes(Capabilities.Functions, functions),
19
19
  contributes(
20
20
  Capabilities.BlueprintDefinition,
21
21
  Blueprint.make({
22
- key: BLUEPRINT_KEY,
22
+ key: CHESS_BLUEPRINT_KEY,
23
23
  name: 'Chess',
24
24
  tools: Blueprint.toolDefinitions({ functions }),
25
25
  instructions: Template.make({
@@ -4,7 +4,7 @@
4
4
 
5
5
  import React, { useCallback, useRef, useState } from 'react';
6
6
 
7
- import { IconButton, Toolbar, useTranslation } from '@dxos/react-ui';
7
+ import { Toolbar, useTranslation } from '@dxos/react-ui';
8
8
  import { type Player } from '@dxos/react-ui-gameboard';
9
9
  import { StackItem } from '@dxos/react-ui-stack';
10
10
  import { mx } from '@dxos/react-ui-theme';
@@ -26,22 +26,21 @@ export const ChessboardArticle = ({ game, role }: { game: Chess.Game; role?: str
26
26
  }, []);
27
27
 
28
28
  return (
29
- <StackItem.Content toolbar>
29
+ <StackItem.Content toolbar classNames='@container'>
30
30
  <Chessboard.Root game={game} ref={controller}>
31
31
  <Toolbar.Root>
32
- <IconButton
33
- variant='ghost'
32
+ <Toolbar.IconButton
34
33
  icon='ph--info--regular'
35
34
  iconOnly
36
35
  label={t('toggle info button')}
37
- size={6}
38
- classNames={mx('invisible', !open && '@3xl:visible')}
36
+ disabled={open}
37
+ classNames={mx('invisible @3xl:visible')}
39
38
  onClick={() => setOpen((open) => !open)}
40
39
  />
41
40
  </Toolbar.Root>
42
41
  <div
43
42
  className={mx(
44
- 'grid _grid-rows-[1fr_4rem] bs-full is-full gap-2',
43
+ 'grid bs-full is-full gap-2',
45
44
  open && '@3xl:grid-cols-[1fr_320px]',
46
45
  role === 'section' && 'aspect-square',
47
46
  role === 'section' && open && '@3xl:aspect-auto',
@@ -139,7 +139,7 @@ const History = ({ classNames, model, min, max, onSelect }: HistoryProps) => {
139
139
  return (
140
140
  <div
141
141
  ref={scrollerRef}
142
- className={mx('overflow-y-scroll', classNames)}
142
+ className={mx('overflow-y-auto', classNames)}
143
143
  style={{
144
144
  minHeight: min === undefined ? 'auto' : `${min * 24}px`,
145
145
  maxHeight: max === undefined ? 'auto' : `${max * 24}px`,
@@ -186,7 +186,7 @@ type PlayerIndicatorProps = PropsWithChildren<{
186
186
  const PlayerIndicator = ({ children, model, player, icon }: PlayerIndicatorProps) => {
187
187
  const turn = player === (model.game.turn() === 'w' ? 'white' : 'black');
188
188
  return (
189
- <div className='grid grid-cols-[2rem_1fr_2rem] gap-2 bs-[--rail-size] pis-1 pie-1 flex items-center overflow-hidden'>
189
+ <div className='grid grid-cols-[2rem_1fr_2rem] gap-2 bs-[--rail-size] pli-1 flex items-center overflow-hidden'>
190
190
  <div className='place-items-center'>
191
191
  <Icon
192
192
  icon={turn ? 'ph--circle--fill' : 'ph--circle--thin'}
package/src/meta.ts CHANGED
@@ -9,9 +9,11 @@ export const meta: PluginMeta = {
9
9
  id: 'dxos.org/plugin/chess',
10
10
  name: 'Chess',
11
11
  description: trim`
12
- Play chess with friends or practice with the AI.
12
+ Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.
13
+ Track game history and analyze moves in real-time.
13
14
  `,
14
15
  icon: 'ph--shield-chevron--regular',
16
+ iconHue: 'amber',
15
17
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',
16
18
  screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],
17
19
  };
@@ -18,6 +18,7 @@ export const translations = [
18
18
  'object name placeholder': 'New game',
19
19
  'rename object label': 'Rename game',
20
20
  'delete object label': 'Delete game',
21
+ 'object deleted label': 'Game deleted',
21
22
  },
22
23
  [meta.id]: {
23
24
  'plugin name': 'Chess',
@@ -6,43 +6,35 @@ import { Chess as ChessJS } from 'chess.js';
6
6
  import * as Schema from 'effect/Schema';
7
7
 
8
8
  import { Obj, Type } from '@dxos/echo';
9
- import { LabelAnnotation } from '@dxos/echo/internal';
9
+ import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';
10
10
  import { log } from '@dxos/log';
11
- import { ItemAnnotation } from '@dxos/schema';
12
11
 
13
12
  export const Game = Schema.Struct({
14
13
  name: Schema.optional(Schema.String),
15
- players: Schema.optional(
16
- Schema.Struct({
17
- white: Schema.optional(
18
- Schema.String.annotations({
19
- description: 'DID of white player',
20
- }),
21
- ),
22
- black: Schema.optional(
23
- Schema.String.annotations({
24
- description: 'DID of black player',
25
- }),
26
- ),
27
- }).pipe(Schema.mutable),
28
- ),
29
- pgn: Schema.optional(
30
- Schema.String.annotations({
31
- description: 'Portable Game Notation.',
32
- }),
33
- ),
34
- fen: Schema.optional(
35
- Schema.String.annotations({
36
- description: 'Forsyth-Edwards Notation.',
37
- }),
38
- ),
14
+ players: Schema.Struct({
15
+ white: Schema.optional(
16
+ Schema.String.annotations({
17
+ description: 'DID of white player',
18
+ }),
19
+ ),
20
+ black: Schema.optional(
21
+ Schema.String.annotations({
22
+ description: 'DID of black player',
23
+ }),
24
+ ),
25
+ }).pipe(Schema.mutable, FormInputAnnotation.set(false), Schema.optional),
26
+ pgn: Schema.String.annotations({
27
+ description: 'Portable Game Notation.',
28
+ }).pipe(FormInputAnnotation.set(false), Schema.optional),
29
+ fen: Schema.String.annotations({
30
+ description: 'Forsyth-Edwards Notation.',
31
+ }).pipe(FormInputAnnotation.set(false), Schema.optional),
39
32
  }).pipe(
40
33
  Type.Obj({
41
34
  typename: 'dxos.org/type/Chess',
42
35
  version: '0.2.0',
43
36
  }),
44
37
  LabelAnnotation.set(['name']),
45
- ItemAnnotation.set(true),
46
38
  );
47
39
 
48
40
  export interface Game extends Schema.Schema.Type<typeof Game> {}
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ChessboardContainer.tsx", "../../../src/components/ChessboardArticle.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\n\nimport { type Chess } from '../types';\n\nimport { Chessboard } from './Chessboard';\nimport { ChessboardArticle } from './ChessboardArticle';\n\nexport type ChessboardContainerProps = {\n game: Chess.Game;\n role?: string;\n};\n\nexport const ChessboardContainer = ({ game, role }: ChessboardContainerProps) => {\n const space = getSpace(game);\n if (!space) {\n return null;\n }\n\n switch (role) {\n case 'card--popover':\n case 'card--intrinsic':\n case 'card--extrinsic': {\n return (\n <Chessboard.Root game={game}>\n <Chessboard.Content role={role}>\n <Chessboard.Board />\n </Chessboard.Content>\n </Chessboard.Root>\n );\n }\n\n default: {\n return <ChessboardArticle game={game} role={role} />;\n }\n }\n};\n\nexport default ChessboardContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { IconButton, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { type Player } from '@dxos/react-ui-gameboard';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { meta } from '../meta';\nimport { type Chess } from '../types';\n\nimport { Chessboard, type ChessboardController, type ChessboardInfoProps } from './Chessboard';\n\nexport const ChessboardArticle = ({ game, role }: { game: Chess.Game; role?: string }) => {\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 // TODO(burdon): Keyboard handler.\n const handleSelect = useCallback<NonNullable<ChessboardInfoProps['onSelect']>>((index) => {\n controller.current?.setMoveNumber(index);\n }, []);\n\n return (\n <StackItem.Content toolbar>\n <Chessboard.Root game={game} ref={controller}>\n <Toolbar.Root>\n <IconButton\n variant='ghost'\n icon='ph--info--regular'\n iconOnly\n label={t('toggle info button')}\n size={6}\n classNames={mx('invisible', !open && '@3xl:visible')}\n onClick={() => setOpen((open) => !open)}\n />\n </Toolbar.Root>\n <div\n className={mx(\n 'grid _grid-rows-[1fr_4rem] bs-full is-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-sm 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 </Chessboard.Root>\n </StackItem.Content>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,gBAAgB;;;;ACFzB,OAAOC,SAASC,aAAaC,QAAQC,gBAAgB;AAErD,SAASC,YAAYC,SAASC,sBAAsB;AAEpD,SAASC,iBAAiB;AAC1B,SAASC,UAAU;AAOZ,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,KAAI,MAAuC;;;AACnF,UAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,UAAM,CAACC,aAAaC,cAAAA,IAAkBC,SAAiB,OAAA;AACvD,UAAM,CAACC,MAAMC,OAAAA,IAAWF,SAAS,IAAA;AACjC,UAAMG,aAAaC,OAA6B,IAAA;AAGhD,UAAMC,eAAeC,YAA0D,CAACC,UAAAA;AAC9EJ,iBAAWK,SA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;AACF;AAEA,IAAA,8BAAeF;",
6
- "names": ["React", "getSpace", "React", "useCallback", "useRef", "useState", "IconButton", "Toolbar", "useTranslation", "StackItem", "mx", "ChessboardArticle", "game", "role", "t", "useTranslation", "meta", "id", "orientation", "setOrientation", "useState", "open", "setOpen", "controller", "useRef", "handleSelect", "useCallback", "index", "current", "setMoveNumber", "StackItem", "Content", "toolbar", "Chessboard", "Root", "ref", "Toolbar", "IconButton", "variant", "icon", "iconOnly", "label", "size", "classNames", "mx", "onClick", "div", "className", "Board", "Info", "min", "max", "onOrientationChange", "onClose", "onSelect", "ChessboardContainer", "game", "role", "space", "getSpace", "React", "Chessboard", "Root", "Content", "Board", "ChessboardArticle"]
7
- }
@@ -1,11 +0,0 @@
1
- import {
2
- BLUEPRINT_KEY,
3
- blueprint_definition_default
4
- } from "./chunk-VA5TW6SD.mjs";
5
- import "./chunk-M63HYNXU.mjs";
6
- import "./chunk-WSUUPPDK.mjs";
7
- export {
8
- BLUEPRINT_KEY,
9
- blueprint_definition_default as default
10
- };
11
- //# sourceMappingURL=blueprint-definition-UVRFUJYE.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/Chess.ts", "../../../src/types/ChessAction.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 { LabelAnnotation } from '@dxos/echo/internal';\nimport { log } from '@dxos/log';\nimport { ItemAnnotation } from '@dxos/schema';\n\nexport const Game = Schema.Struct({\n name: Schema.optional(Schema.String),\n players: Schema.optional(\n 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(Schema.mutable),\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}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Chess',\n version: '0.2.0',\n }),\n LabelAnnotation.set(['name']),\n ItemAnnotation.set(true),\n);\n\nexport interface Game extends Schema.Schema.Type<typeof Game> {}\n\nexport const makeGame = ({ 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 players: {},\n pgn,\n fen,\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { meta } from '../meta';\n\nimport { Game } from './Chess';\n\nexport class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n pgn: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: Game,\n }),\n}) {}\n"],
5
- "mappings": ";;;;;;AAAA;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,KAAKC,YAAY;AAC1B,SAASC,uBAAuB;AAChC,SAASC,WAAW;AACpB,SAASC,sBAAsB;;AAExB,IAAMC,OAAcC,cAAO;EAChCC,MAAaC,gBAAgBC,aAAM;EACnCC,SAAgBF,gBACPF,cAAO;IACZK,OAAcH,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;IAEFC,OAAcN,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA,EAAGE,KAAYC,cAAO,CAAA;EAExBC,KAAYT,gBACHC,cAAOG,YAAY;IACxBC,aAAa;EACf,CAAA,CAAA;EAEFK,KAAYV,gBACHC,cAAOG,YAAY;IACxBC,aAAa;EACf,CAAA,CAAA;AAEJ,CAAA,EAAGE,KACDd,KAAKD,IAAI;EACPmB,UAAU;EACVC,SAAS;AACX,CAAA,GACAlB,gBAAgBmB,IAAI;EAAC;CAAO,GAC5BjB,eAAeiB,IAAI,IAAA,CAAA;AAKd,IAAMC,WAAW,CAAC,EAAEf,MAAMU,KAAKC,IAAG,IAAoD,CAAC,MAAC;AAC7F,QAAMK,QAAQ,IAAIzB,QAAAA;AAClB,MAAImB,KAAK;AACP,QAAI;AACFM,YAAMC,QAAQP,GAAAA;IAChB,QAAQ;AACNd,UAAIsB,KAAKR,KAAAA,QAAAA;;;;;;IACX;EACF;AAEA,SAAOjB,IAAI0B,KAAKrB,MAAM;IACpBE;IACAG,SAAS,CAAC;IACVO;IACAC;EACF,CAAA;AACF;;;ACjEA;;;;AAIA,YAAYS,aAAY;AAMjB,IAAMC,SAAN,cAA4BC,oBAAW,EAAW,GAAGC,KAAKC,EAAE,kBAAkB;EACnFC,OAAcC,eAAO;IACnBC,MAAaC,iBAAgBC,cAAM;IACnCC,KAAYF,iBAAgBC,cAAM;EACpC,CAAA;EACAE,QAAeL,eAAO;IACpBM,QAAQC;EACV,CAAA;AACF,CAAA,EAAA;AAAI;",
6
- "names": ["Chess", "ChessJS", "Schema", "Obj", "Type", "LabelAnnotation", "log", "ItemAnnotation", "Game", "Struct", "name", "optional", "String", "players", "white", "annotations", "description", "black", "pipe", "mutable", "pgn", "fen", "typename", "version", "set", "makeGame", "chess", "loadPgn", "warn", "make", "Schema", "Create", "TaggedClass", "meta", "id", "input", "Struct", "name", "optional", "String", "pgn", "output", "object", "Game"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/blueprint-definition.ts", "../../../src/functions/create.ts", "../../../src/functions/move.ts", "../../../src/functions/play.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { type FunctionDefinition } from '@dxos/functions';\nimport { trim } from '@dxos/util';\n\nimport { create, move, play } from '../functions';\n\nexport const BLUEPRINT_KEY = 'dxos.org/blueprint/chess';\n\nconst functions: FunctionDefinition[] = [create, move, play];\n\nexport default () => {\n return [\n contributes(Capabilities.Functions, functions),\n contributes(\n Capabilities.BlueprintDefinition,\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 ),\n ];\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { DatabaseService, 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 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: { pgn, fen } }) {\n return yield* DatabaseService.add(Chess.makeGame({ 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 { ArtifactId } from '@dxos/assistant';\nimport { DatabaseService, 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 id: ArtifactId.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: { id, move } }) {\n const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Chess.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 chess.move(move, { strict: false });\n object.pgn = chess.pgn();\n return { pgn: object.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 { ArtifactId } from '@dxos/assistant';\nimport { DatabaseService, 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 id: ArtifactId.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: { id, side = 'any' } }) {\n const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Chess.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 object.pgn = chess.pgn();\n return { move, pgn: object.pgn };\n }),\n});\n"],
5
- "mappings": ";;;;;AAIA,SAASA,cAAcC,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MAAO,OAAOtB,SAAS,UAAW;AACjH,aAAO;QAAEO,MAAMgB;QAAWlB,KAAKM,OAAON;MAAK;IAC7C;AAEA,UAAMmB,QAAQP,MAAMO,MAAK;AACzB,UAAMjB,OAAOiB,MAAMC,KAAKC,MAAMD,KAAKE,OAAM,IAAKH,MAAMI,MAAM,CAAA;AAE1DX,UAAMV,KAAKA,MAAM;MAAEsB,QAAQ;IAAM,CAAA;AACjClB,WAAON,MAAMY,MAAMZ,IAAG;AACtB,WAAO;MAAEE;MAAMF,KAAKM,OAAON;IAAI;EACjC,CAAA;AACF,CAAA;;;AH3CO,IAAMyB,gBAAgB;AAE7B,IAAMC,YAAkC;EAACC;EAAQC;EAAMC;;AAEvD,IAAA,gCAAe,MAAA;AACb,SAAO;IACLC,YAAYC,aAAaC,WAAWN,SAAAA;IACpCI,YACEC,aAAaE,qBACbC,UAAUC,KAAK;MACbC,KAAKX;MACLY,MAAM;MACNC,OAAOJ,UAAUK,gBAAgB;QAAEb;MAAU,CAAA;MAC7Cc,cAAcC,SAASN,KAAK;QAC1BO,QAAQC;;;;;;MAMV,CAAA;IACF,CAAA,CAAA;;AAGN;",
6
- "names": ["Capabilities", "contributes", "Blueprint", "Template", "trim", "Effect", "Schema", "DatabaseService", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "pgn", "optional", "String", "annotations", "fen", "outputSchema", "Chess", "Game", "handler", "fn", "data", "DatabaseService", "add", "makeGame", "Chess", "ChessJS", "Effect", "Schema", "ArtifactId", "DatabaseService", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "id", "ArtifactId", "annotations", "move", "String", "examples", "outputSchema", "pgn", "handler", "fn", "data", "object", "DatabaseService", "resolve", "toDXN", "Chess", "Game", "chess", "ChessJS", "loadPgn", "fen", "load", "strict", "Chess", "ChessJS", "Effect", "Schema", "ArtifactId", "DatabaseService", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "id", "ArtifactId", "annotations", "side", "optional", "Literal", "defaultValue", "outputSchema", "pgn", "String", "move", "handler", "fn", "data", "object", "DatabaseService", "resolve", "toDXN", "Chess", "Game", "chess", "ChessJS", "loadPgn", "fen", "load", "turn", "undefined", "moves", "Math", "floor", "random", "length", "strict", "BLUEPRINT_KEY", "functions", "create", "move", "play", "contributes", "Capabilities", "Functions", "BlueprintDefinition", "Blueprint", "make", "key", "name", "tools", "toolDefinitions", "instructions", "Template", "source", "trim"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/chess',\n name: 'Chess',\n description: trim`\n Play chess with friends or practice with the AI.\n `,\n icon: 'ph--shield-chevron--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',\n screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],\n};\n"],
5
- "mappings": ";;;;;;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;EAGbC,MAAM;EACNC,QAAQ;EACRC,aAAa;IAAC;;AAChB;",
6
- "names": ["trim", "meta", "id", "name", "description", "trim", "icon", "source", "screenshots"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ChessboardContainer.tsx", "../../../src/components/ChessboardArticle.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\n\nimport { type Chess } from '../types';\n\nimport { Chessboard } from './Chessboard';\nimport { ChessboardArticle } from './ChessboardArticle';\n\nexport type ChessboardContainerProps = {\n game: Chess.Game;\n role?: string;\n};\n\nexport const ChessboardContainer = ({ game, role }: ChessboardContainerProps) => {\n const space = getSpace(game);\n if (!space) {\n return null;\n }\n\n switch (role) {\n case 'card--popover':\n case 'card--intrinsic':\n case 'card--extrinsic': {\n return (\n <Chessboard.Root game={game}>\n <Chessboard.Content role={role}>\n <Chessboard.Board />\n </Chessboard.Content>\n </Chessboard.Root>\n );\n }\n\n default: {\n return <ChessboardArticle game={game} role={role} />;\n }\n }\n};\n\nexport default ChessboardContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { IconButton, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { type Player } from '@dxos/react-ui-gameboard';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { meta } from '../meta';\nimport { type Chess } from '../types';\n\nimport { Chessboard, type ChessboardController, type ChessboardInfoProps } from './Chessboard';\n\nexport const ChessboardArticle = ({ game, role }: { game: Chess.Game; role?: string }) => {\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 // TODO(burdon): Keyboard handler.\n const handleSelect = useCallback<NonNullable<ChessboardInfoProps['onSelect']>>((index) => {\n controller.current?.setMoveNumber(index);\n }, []);\n\n return (\n <StackItem.Content toolbar>\n <Chessboard.Root game={game} ref={controller}>\n <Toolbar.Root>\n <IconButton\n variant='ghost'\n icon='ph--info--regular'\n iconOnly\n label={t('toggle info button')}\n size={6}\n classNames={mx('invisible', !open && '@3xl:visible')}\n onClick={() => setOpen((open) => !open)}\n />\n </Toolbar.Root>\n <div\n className={mx(\n 'grid _grid-rows-[1fr_4rem] bs-full is-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-sm 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 </Chessboard.Root>\n </StackItem.Content>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,gBAAgB;;;;ACFzB,OAAOC,SAASC,aAAaC,QAAQC,gBAAgB;AAErD,SAASC,YAAYC,SAASC,sBAAsB;AAEpD,SAASC,iBAAiB;AAC1B,SAASC,UAAU;AAOZ,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,KAAI,MAAuC;;;AACnF,UAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,UAAM,CAACC,aAAaC,cAAAA,IAAkBC,SAAiB,OAAA;AACvD,UAAM,CAACC,MAAMC,OAAAA,IAAWF,SAAS,IAAA;AACjC,UAAMG,aAAaC,OAA6B,IAAA;AAGhD,UAAMC,eAAeC,YAA0D,CAACC,UAAAA;AAC9EJ,iBAAWK,SAASC,cAAcF,KAAAA;IACpC,GAAG,CAAA,CAAE;AAEL,WACE,sBAAA,cAACG,UAAUC,SAAO;MAACC,SAAAA;OACjB,sBAAA,cAACC,WAAWC,MAAI;MAACtB;MAAYuB,KAAKZ;OAChC,sBAAA,cAACa,QAAQF,MAAI,MACX,sBAAA,cAACG,YAAAA;MACCC,SAAQ;MACRC,MAAK;MACLC,UAAAA;MACAC,OAAO3B,EAAE,oBAAA;MACT4B,MAAM;MACNC,YAAYC,GAAG,aAAa,CAACvB,QAAQ,cAAA;MACrCwB,SAAS,MAAMvB,QAAQ,CAACD,UAAS,CAACA,KAAAA;SAGtC,sBAAA,cAACyB,OAAAA;MACCC,WAAWH,GACT,oDACAvB,QAAQ,8BACRR,SAAS,aAAa,iBACtBA,SAAS,aAAaQ,QAAQ,kBAAA;OAGhC,sBAAA,cAACY,WAAWF,SAAO,MACjB,sBAAA,cAACE,WAAWe,OAAK;MAACL,YAAW;MAAiCzB;SAE/DG,QACC,sBAAA,cAACyB,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACd,WAAWgB,MAAI;MACd/B;MACAgC,KAAK;MACLC,KAAK;MACLC,qBAAqBjC;MACrBkC,SAAS,MAAM/B,QAAQ,KAAA;MACvBgC,UAAU7B;;;;;AAQ1B;;;ADlDO,IAAM8B,sBAAsB,CAAC,EAAEC,MAAMC,KAAI,MAA4B;;;AAC1E,UAAMC,QAAQC,SAASH,IAAAA;AACvB,QAAI,CAACE,OAAO;AACV,aAAO;IACT;AAEA,YAAQD,MAAAA;MACN,KAAK;MACL,KAAK;MACL,KAAK,mBAAmB;AACtB,eACE,gBAAAG,OAAA,cAACC,WAAWC,MAAI;UAACN;WACf,gBAAAI,OAAA,cAACC,WAAWE,SAAO;UAACN;WAClB,gBAAAG,OAAA,cAACC,WAAWG,OAAK,IAAA,CAAA,CAAA;MAIzB;MAEA,SAAS;AACP,eAAO,gBAAAJ,OAAA,cAACK,mBAAAA;UAAkBT;UAAYC;;MACxC;IACF;;;;AACF;AAEA,IAAA,8BAAeF;",
6
- "names": ["React", "getSpace", "React", "useCallback", "useRef", "useState", "IconButton", "Toolbar", "useTranslation", "StackItem", "mx", "ChessboardArticle", "game", "role", "t", "useTranslation", "meta", "id", "orientation", "setOrientation", "useState", "open", "setOpen", "controller", "useRef", "handleSelect", "useCallback", "index", "current", "setMoveNumber", "StackItem", "Content", "toolbar", "Chessboard", "Root", "ref", "Toolbar", "IconButton", "variant", "icon", "iconOnly", "label", "size", "classNames", "mx", "onClick", "div", "className", "Board", "Info", "min", "max", "onOrientationChange", "onClose", "onSelect", "ChessboardContainer", "game", "role", "space", "getSpace", "React", "Chessboard", "Root", "Content", "Board", "ChessboardArticle"]
7
- }
@@ -1,12 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- BLUEPRINT_KEY,
4
- blueprint_definition_default
5
- } from "./chunk-SW5N5XNV.mjs";
6
- import "./chunk-7YK5RFHY.mjs";
7
- import "./chunk-5C2OYL2B.mjs";
8
- export {
9
- BLUEPRINT_KEY,
10
- blueprint_definition_default as default
11
- };
12
- //# sourceMappingURL=blueprint-definition-Z47C4EEX.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/chess',\n name: 'Chess',\n description: trim`\n Play chess with friends or practice with the AI.\n `,\n icon: 'ph--shield-chevron--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',\n screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],\n};\n"],
5
- "mappings": ";;;;;;;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;EAGbC,MAAM;EACNC,QAAQ;EACRC,aAAa;IAAC;;AAChB;",
6
- "names": ["trim", "meta", "id", "name", "description", "trim", "icon", "source", "screenshots"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/Chess.ts", "../../../src/types/ChessAction.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 { LabelAnnotation } from '@dxos/echo/internal';\nimport { log } from '@dxos/log';\nimport { ItemAnnotation } from '@dxos/schema';\n\nexport const Game = Schema.Struct({\n name: Schema.optional(Schema.String),\n players: Schema.optional(\n 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(Schema.mutable),\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}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Chess',\n version: '0.2.0',\n }),\n LabelAnnotation.set(['name']),\n ItemAnnotation.set(true),\n);\n\nexport interface Game extends Schema.Schema.Type<typeof Game> {}\n\nexport const makeGame = ({ 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 players: {},\n pgn,\n fen,\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { meta } from '../meta';\n\nimport { Game } from './Chess';\n\nexport class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n pgn: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: Game,\n }),\n}) {}\n"],
5
- "mappings": ";;;;;;;AAAA;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,KAAKC,YAAY;AAC1B,SAASC,uBAAuB;AAChC,SAASC,WAAW;AACpB,SAASC,sBAAsB;;AAExB,IAAMC,OAAcC,cAAO;EAChCC,MAAaC,gBAAgBC,aAAM;EACnCC,SAAgBF,gBACPF,cAAO;IACZK,OAAcH,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;IAEFC,OAAcN,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA,EAAGE,KAAYC,cAAO,CAAA;EAExBC,KAAYT,gBACHC,cAAOG,YAAY;IACxBC,aAAa;EACf,CAAA,CAAA;EAEFK,KAAYV,gBACHC,cAAOG,YAAY;IACxBC,aAAa;EACf,CAAA,CAAA;AAEJ,CAAA,EAAGE,KACDd,KAAKD,IAAI;EACPmB,UAAU;EACVC,SAAS;AACX,CAAA,GACAlB,gBAAgBmB,IAAI;EAAC;CAAO,GAC5BjB,eAAeiB,IAAI,IAAA,CAAA;AAKd,IAAMC,WAAW,CAAC,EAAEf,MAAMU,KAAKC,IAAG,IAAoD,CAAC,MAAC;AAC7F,QAAMK,QAAQ,IAAIzB,QAAAA;AAClB,MAAImB,KAAK;AACP,QAAI;AACFM,YAAMC,QAAQP,GAAAA;IAChB,QAAQ;AACNd,UAAIsB,KAAKR,KAAAA,QAAAA;;;;;;IACX;EACF;AAEA,SAAOjB,IAAI0B,KAAKrB,MAAM;IACpBE;IACAG,SAAS,CAAC;IACVO;IACAC;EACF,CAAA;AACF;;;ACjEA;;;;AAIA,YAAYS,aAAY;AAMjB,IAAMC,SAAN,cAA4BC,oBAAW,EAAW,GAAGC,KAAKC,EAAE,kBAAkB;EACnFC,OAAcC,eAAO;IACnBC,MAAaC,iBAAgBC,cAAM;IACnCC,KAAYF,iBAAgBC,cAAM;EACpC,CAAA;EACAE,QAAeL,eAAO;IACpBM,QAAQC;EACV,CAAA;AACF,CAAA,EAAA;AAAI;",
6
- "names": ["Chess", "ChessJS", "Schema", "Obj", "Type", "LabelAnnotation", "log", "ItemAnnotation", "Game", "Struct", "name", "optional", "String", "players", "white", "annotations", "description", "black", "pipe", "mutable", "pgn", "fen", "typename", "version", "set", "makeGame", "chess", "loadPgn", "warn", "make", "Schema", "Create", "TaggedClass", "meta", "id", "input", "Struct", "name", "optional", "String", "pgn", "output", "object", "Game"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/blueprint-definition.ts", "../../../src/functions/create.ts", "../../../src/functions/move.ts", "../../../src/functions/play.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { type FunctionDefinition } from '@dxos/functions';\nimport { trim } from '@dxos/util';\n\nimport { create, move, play } from '../functions';\n\nexport const BLUEPRINT_KEY = 'dxos.org/blueprint/chess';\n\nconst functions: FunctionDefinition[] = [create, move, play];\n\nexport default () => {\n return [\n contributes(Capabilities.Functions, functions),\n contributes(\n Capabilities.BlueprintDefinition,\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 ),\n ];\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { DatabaseService, 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 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: { pgn, fen } }) {\n return yield* DatabaseService.add(Chess.makeGame({ 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 { ArtifactId } from '@dxos/assistant';\nimport { DatabaseService, 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 id: ArtifactId.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: { id, move } }) {\n const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Chess.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 chess.move(move, { strict: false });\n object.pgn = chess.pgn();\n return { pgn: object.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 { ArtifactId } from '@dxos/assistant';\nimport { DatabaseService, 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 id: ArtifactId.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: { id, side = 'any' } }) {\n const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Chess.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 object.pgn = chess.pgn();\n return { move, pgn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UiB,MAAMK,KAAI,MAAO,OAAOtB,SAAS,WAAaiB,MAAMK,KAAI,MAAO,OAAOtB,SAAS,UAAW;AACjH,aAAO;QAAEO,MAAMgB;QAAWlB,KAAKM,OAAON;MAAK;IAC7C;AAEA,UAAMmB,QAAQP,MAAMO,MAAK;AACzB,UAAMjB,OAAOiB,MAAMC,KAAKC,MAAMD,KAAKE,OAAM,IAAKH,MAAMI,MAAM,CAAA;AAE1DX,UAAMV,KAAKA,MAAM;MAAEsB,QAAQ;IAAM,CAAA;AACjClB,WAAON,MAAMY,MAAMZ,IAAG;AACtB,WAAO;MAAEE;MAAMF,KAAKM,OAAON;IAAI;EACjC,CAAA;AACF,CAAA;;;AH3CO,IAAMyB,gBAAgB;AAE7B,IAAMC,YAAkC;EAACC;EAAQC;EAAMC;;AAEvD,IAAA,gCAAe,MAAA;AACb,SAAO;IACLC,YAAYC,aAAaC,WAAWN,SAAAA;IACpCI,YACEC,aAAaE,qBACbC,UAAUC,KAAK;MACbC,KAAKX;MACLY,MAAM;MACNC,OAAOJ,UAAUK,gBAAgB;QAAEb;MAAU,CAAA;MAC7Cc,cAAcC,SAASN,KAAK;QAC1BO,QAAQC;;;;;;MAMV,CAAA;IACF,CAAA,CAAA;;AAGN;",
6
- "names": ["Capabilities", "contributes", "Blueprint", "Template", "trim", "Effect", "Schema", "DatabaseService", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "pgn", "optional", "String", "annotations", "fen", "outputSchema", "Chess", "Game", "handler", "fn", "data", "DatabaseService", "add", "makeGame", "Chess", "ChessJS", "Effect", "Schema", "ArtifactId", "DatabaseService", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "id", "ArtifactId", "annotations", "move", "String", "examples", "outputSchema", "pgn", "handler", "fn", "data", "object", "DatabaseService", "resolve", "toDXN", "Chess", "Game", "chess", "ChessJS", "loadPgn", "fen", "load", "strict", "Chess", "ChessJS", "Effect", "Schema", "ArtifactId", "DatabaseService", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "id", "ArtifactId", "annotations", "side", "optional", "Literal", "defaultValue", "outputSchema", "pgn", "String", "move", "handler", "fn", "data", "object", "DatabaseService", "resolve", "toDXN", "Chess", "Game", "chess", "ChessJS", "loadPgn", "fen", "load", "turn", "undefined", "moves", "Math", "floor", "random", "length", "strict", "BLUEPRINT_KEY", "functions", "create", "move", "play", "contributes", "Capabilities", "Functions", "BlueprintDefinition", "Blueprint", "make", "key", "name", "tools", "toolDefinitions", "instructions", "Template", "source", "trim"]
7
- }