@dxos/plugin-chess 0.8.4-main.84f28bd → 0.8.4-main.c1de068

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 (66) hide show
  1. package/dist/lib/browser/{ChessContainer-DL5J6VIK.mjs → ChessContainer-SC4ZV6XZ.mjs} +50 -22
  2. package/dist/lib/browser/ChessContainer-SC4ZV6XZ.mjs.map +7 -0
  3. package/dist/lib/browser/{artifact-definition-4AMZY5LQ.mjs → artifact-definition-A2FSM255.mjs} +3 -3
  4. package/dist/lib/browser/artifact-definition-A2FSM255.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-KDADGLPC.mjs +8 -0
  6. package/dist/lib/browser/{chunk-2VF6U52K.mjs.map → chunk-KDADGLPC.mjs.map} +1 -1
  7. package/dist/lib/browser/{chunk-AZSYKAFK.mjs → chunk-ZXH3N4NA.mjs} +15 -10
  8. package/dist/lib/browser/chunk-ZXH3N4NA.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +9 -7
  10. package/dist/lib/browser/index.mjs.map +2 -2
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/{react-surface-4TBVZUKU.mjs → react-surface-PLUCWIYP.mjs} +8 -15
  13. package/dist/lib/browser/react-surface-PLUCWIYP.mjs.map +7 -0
  14. package/dist/lib/node-esm/{ChessContainer-WVOL2KSE.mjs → ChessContainer-7GLY5KLY.mjs} +50 -22
  15. package/dist/lib/node-esm/ChessContainer-7GLY5KLY.mjs.map +7 -0
  16. package/dist/lib/node-esm/{artifact-definition-TT3747JB.mjs → artifact-definition-2H7OUBZO.mjs} +3 -3
  17. package/dist/lib/node-esm/artifact-definition-2H7OUBZO.mjs.map +7 -0
  18. package/dist/lib/node-esm/{chunk-2DRWEDVT.mjs → chunk-27D3JA3K.mjs} +15 -10
  19. package/dist/lib/node-esm/chunk-27D3JA3K.mjs.map +7 -0
  20. package/dist/lib/node-esm/{chunk-TD2SWK2H.mjs → chunk-QFINI7CC.mjs} +2 -2
  21. package/dist/lib/node-esm/{chunk-TD2SWK2H.mjs.map → chunk-QFINI7CC.mjs.map} +1 -1
  22. package/dist/lib/node-esm/index.mjs +9 -7
  23. package/dist/lib/node-esm/index.mjs.map +2 -2
  24. package/dist/lib/node-esm/meta.json +1 -1
  25. package/dist/lib/node-esm/{react-surface-PAUEOIBL.mjs → react-surface-NGLNIWN3.mjs} +8 -15
  26. package/dist/lib/node-esm/react-surface-NGLNIWN3.mjs.map +7 -0
  27. package/dist/types/src/capabilities/artifact-definition.d.ts +1 -1
  28. package/dist/types/src/capabilities/index.d.ts +1 -1
  29. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  31. package/dist/types/src/components/Chess.d.ts +14 -0
  32. package/dist/types/src/components/Chess.d.ts.map +1 -0
  33. package/dist/types/src/components/ChessContainer.d.ts +1 -1
  34. package/dist/types/src/components/ChessContainer.d.ts.map +1 -1
  35. package/dist/types/src/components/ChessContainer.stories.d.ts +23 -0
  36. package/dist/types/src/components/ChessContainer.stories.d.ts.map +1 -0
  37. package/dist/types/src/components/ChessPanel.d.ts.map +1 -1
  38. package/dist/types/src/components/Chessboard.stories.d.ts.map +1 -1
  39. package/dist/types/src/components/PlayerSelector.d.ts.map +1 -1
  40. package/dist/types/src/components/index.d.ts +2 -2
  41. package/dist/types/src/components/index.d.ts.map +1 -1
  42. package/dist/types/src/translations.d.ts +2 -0
  43. package/dist/types/src/translations.d.ts.map +1 -1
  44. package/dist/types/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +25 -26
  46. package/src/capabilities/artifact-definition.ts +2 -2
  47. package/src/capabilities/react-surface.tsx +2 -9
  48. package/src/components/{ChessComponent.tsx → Chess.tsx} +15 -9
  49. package/src/components/ChessContainer.stories.tsx +110 -0
  50. package/src/components/ChessContainer.tsx +49 -13
  51. package/src/components/ChessPanel.tsx +7 -7
  52. package/src/components/Chessboard.stories.tsx +6 -4
  53. package/src/components/PlayerSelector.tsx +6 -4
  54. package/src/components/index.ts +1 -1
  55. package/src/translations.ts +2 -0
  56. package/dist/lib/browser/ChessContainer-DL5J6VIK.mjs.map +0 -7
  57. package/dist/lib/browser/artifact-definition-4AMZY5LQ.mjs.map +0 -7
  58. package/dist/lib/browser/chunk-2VF6U52K.mjs +0 -8
  59. package/dist/lib/browser/chunk-AZSYKAFK.mjs.map +0 -7
  60. package/dist/lib/browser/react-surface-4TBVZUKU.mjs.map +0 -7
  61. package/dist/lib/node-esm/ChessContainer-WVOL2KSE.mjs.map +0 -7
  62. package/dist/lib/node-esm/artifact-definition-TT3747JB.mjs.map +0 -7
  63. package/dist/lib/node-esm/chunk-2DRWEDVT.mjs.map +0 -7
  64. package/dist/lib/node-esm/react-surface-PAUEOIBL.mjs.map +0 -7
  65. package/dist/types/src/components/ChessComponent.d.ts +0 -6
  66. package/dist/types/src/components/ChessComponent.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
- ChessComponent
4
- } from "./chunk-2DRWEDVT.mjs";
3
+ Chess
4
+ } from "./chunk-27D3JA3K.mjs";
5
5
 
6
6
  // src/components/ChessContainer.tsx
7
7
  import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
@@ -11,12 +11,10 @@ import { StackItem } from "@dxos/react-ui-stack";
11
11
 
12
12
  // src/components/PlayerSelector.tsx
13
13
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
14
- import { CrownCross } from "@phosphor-icons/react";
15
14
  import React from "react";
16
15
  import { generateName } from "@dxos/display-name";
17
16
  import { useMembers } from "@dxos/react-client/echo";
18
- import { Input, Select, useThemeContext } from "@dxos/react-ui";
19
- import { getSize, mx } from "@dxos/react-ui-theme";
17
+ import { Icon, Input, Select, useThemeContext } from "@dxos/react-ui";
20
18
  var PlayerSelector = ({ space, game }) => {
21
19
  var _effect = _useSignals();
22
20
  try {
@@ -50,10 +48,10 @@ var PlayerSelect = ({ side, value, onValueChange, members }) => {
50
48
  try {
51
49
  const { themeMode } = useThemeContext();
52
50
  const iconFillMode = side === "black" && themeMode === "light" || side === "white" && themeMode === "dark" ? "fill" : void 0;
53
- return /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Label, null, /* @__PURE__ */ React.createElement(CrownCross, {
54
- className: mx(getSize(6)),
55
- weight: iconFillMode,
56
- "aria-label": `Chess icon for side ${side}`
51
+ return /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Label, null, /* @__PURE__ */ React.createElement(Icon, {
52
+ "aria-label": `Chess icon for side ${side}`,
53
+ icon: `ph--crown-cross--${iconFillMode || "regular"}`,
54
+ size: 6
57
55
  })), /* @__PURE__ */ React.createElement(Select.Root, {
58
56
  value,
59
57
  onValueChange
@@ -73,24 +71,54 @@ var PlayerSelect = ({ side, value, onValueChange, members }) => {
73
71
  };
74
72
 
75
73
  // src/components/ChessContainer.tsx
76
- var ChessContainer = ({ game }) => {
74
+ var containFragment = "is-[min(100cqw,100cqh)] bs-[min(100cqw,100cqh)]";
75
+ var ChessContainer = ({ game, role }) => {
77
76
  var _effect = _useSignals2();
78
77
  try {
79
78
  const space = getSpace(game);
80
79
  if (!space) {
81
80
  return null;
82
81
  }
83
- return /* @__PURE__ */ React2.createElement(StackItem.Content, null, /* @__PURE__ */ React2.createElement("div", {
84
- role: "none",
85
- className: "grid grid-rows-[60px_1fr_60px] grow overflow-hidden"
86
- }, /* @__PURE__ */ React2.createElement("div", null), /* @__PURE__ */ React2.createElement("div", {
87
- className: "flex m-4 overflow-hidden"
88
- }, /* @__PURE__ */ React2.createElement(ChessComponent, {
89
- game
90
- })), /* @__PURE__ */ React2.createElement(PlayerSelector, {
91
- space,
92
- game
93
- })));
82
+ switch (role) {
83
+ case "card--popover": {
84
+ return /* @__PURE__ */ React2.createElement(Chess.Root, {
85
+ game
86
+ }, /* @__PURE__ */ React2.createElement("div", {
87
+ role: "none",
88
+ className: "popover-square size-container"
89
+ }, /* @__PURE__ */ React2.createElement(Chess.Board, {
90
+ classNames: containFragment
91
+ })));
92
+ }
93
+ case "card--extrinsic": {
94
+ return /* @__PURE__ */ React2.createElement(Chess.Root, {
95
+ game
96
+ }, /* @__PURE__ */ React2.createElement("div", {
97
+ role: "none",
98
+ className: "grid is-full bs-full size-container place-content-center"
99
+ }, /* @__PURE__ */ React2.createElement(Chess.Board, {
100
+ classNames: containFragment
101
+ })));
102
+ }
103
+ case "card--intrinsic": {
104
+ return /* @__PURE__ */ React2.createElement(Chess.Root, {
105
+ game
106
+ }, /* @__PURE__ */ React2.createElement(Chess.Board, null));
107
+ }
108
+ default: {
109
+ return /* @__PURE__ */ React2.createElement(StackItem.Content, null, /* @__PURE__ */ React2.createElement("div", {
110
+ role: "none",
111
+ className: "grid grid-rows-[60px_1fr_60px] grow overflow-hidden"
112
+ }, /* @__PURE__ */ React2.createElement("div", null), /* @__PURE__ */ React2.createElement("div", {
113
+ className: "flex m-4 overflow-hidden"
114
+ }, /* @__PURE__ */ React2.createElement(Chess.Root, {
115
+ game
116
+ }, /* @__PURE__ */ React2.createElement(Chess.Content, null, /* @__PURE__ */ React2.createElement(Chess.Board, null)))), /* @__PURE__ */ React2.createElement(PlayerSelector, {
117
+ space,
118
+ game
119
+ })));
120
+ }
121
+ }
94
122
  } finally {
95
123
  _effect.f();
96
124
  }
@@ -99,4 +127,4 @@ var ChessContainer_default = ChessContainer;
99
127
  export {
100
128
  ChessContainer_default as default
101
129
  };
102
- //# sourceMappingURL=ChessContainer-WVOL2KSE.mjs.map
130
+ //# sourceMappingURL=ChessContainer-7GLY5KLY.mjs.map
@@ -0,0 +1,7 @@
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
+ }
@@ -10,8 +10,8 @@ import { Chess } from "chess.js";
10
10
  import { pipe, Schema } from "effect";
11
11
  import { createTool, ToolResult } from "@dxos/ai";
12
12
  import { Capabilities, chain, contributes, createIntent } from "@dxos/app-framework";
13
- import { ArtifactId, defineArtifact } from "@dxos/artifact";
14
- import { createArtifactElement, VersionPin } from "@dxos/assistant";
13
+ import { createArtifactElement, VersionPin, ArtifactId } from "@dxos/assistant";
14
+ import { defineArtifact } from "@dxos/blueprints";
15
15
  import { Obj } from "@dxos/echo";
16
16
  import { invariant } from "@dxos/invariant";
17
17
  import { SpaceAction } from "@dxos/plugin-space/types";
@@ -180,4 +180,4 @@ var artifact_definition_default = () => {
180
180
  export {
181
181
  artifact_definition_default as default
182
182
  };
183
- //# sourceMappingURL=artifact-definition-TT3747JB.mjs.map
183
+ //# sourceMappingURL=artifact-definition-2H7OUBZO.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/artifact-definition.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess } from 'chess.js';\nimport { pipe, Schema } from 'effect';\n\nimport { createTool, ToolResult } from '@dxos/ai';\nimport { Capabilities, chain, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { createArtifactElement, VersionPin, ArtifactId } from '@dxos/assistant';\nimport { defineArtifact } from '@dxos/blueprints';\nimport { Obj } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter, type Space } from '@dxos/react-client/echo';\n\nimport { meta } from '../meta';\nimport { ChessAction, ChessType } from '../types';\n\n// TODO(burdon): Factor out.\ndeclare global {\n interface ToolContextExtensions {\n space?: Space;\n dispatch?: PromiseIntentDispatcher;\n }\n}\n\nexport default () => {\n const definition = defineArtifact({\n id: `artifact:${meta.id}`,\n name: meta.name,\n description: 'Provides a simple chess engine.',\n instructions: `\n - If the user's message relates to a chess game, you must return the chess game inside the artifact tag as a valid FEN string with no additional text.\n - Always inspect the chess game at the start of every prompt realting to a chess game, as it might have changed since the interaction.\n `,\n schema: ChessType,\n tools: [\n createTool(meta.id, {\n name: 'create',\n description: 'Create a new chess game. Returns the artifact definition for the game.',\n caption: 'Creating chess game...',\n schema: Schema.Struct({\n fen: Schema.String.annotations({ description: 'The state of the chess game in the FEN format.' }),\n }),\n execute: async ({ fen }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n const intent = pipe(\n createIntent(ChessAction.Create, { fen }),\n chain(SpaceAction.AddObject, { target: extensions.space }),\n );\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create chess game');\n }\n\n return ToolResult.Success(createArtifactElement(data.id), [\n VersionPin.createBlock(VersionPin.fromObject(data.object)),\n ]);\n },\n }),\n createTool(meta.id, {\n name: 'list',\n description: 'Query all active chess games.',\n caption: 'Getting games...',\n schema: Schema.Struct({}),\n execute: async (_, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const { objects: games } = await extensions.space.db.query(Filter.type(ChessType)).run();\n invariant(games.length > 0, 'No chess games found');\n\n return ToolResult.Success(games);\n },\n }),\n createTool(meta.id, {\n name: 'inspect',\n description: 'Get the current state of the chess game.',\n caption: 'Inspecting game...',\n schema: Schema.Struct({ id: ArtifactId }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const game = await extensions.space.db\n .query(Filter.ids(ArtifactId.toDXN(id, extensions.space.id).toString()))\n .first();\n invariant(Obj.instanceOf(ChessType, game));\n\n return ToolResult.Success(game.fen);\n },\n }),\n createTool(meta.id, {\n name: 'move',\n description: 'Make a move in the chess game.',\n caption: 'Making chess move...',\n schema: Schema.Struct({\n id: ArtifactId,\n move: Schema.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n execute: async ({ id, move }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n const game = await extensions.space.db\n .query(Filter.ids(ArtifactId.toDXN(id, extensions.space.id).toString()))\n .first();\n invariant(Obj.instanceOf(ChessType, game));\n\n const board = new Chess(game.fen);\n try {\n board.move(move);\n } catch (error: any) {\n return ToolResult.Error(error.message);\n }\n game.pgn = board.pgn();\n game.fen = board.fen();\n return ToolResult.Success(game.fen);\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
5
+ "mappings": "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",
6
+ "names": ["Chess", "pipe", "Schema", "createTool", "ToolResult", "Capabilities", "chain", "contributes", "createIntent", "createArtifactElement", "VersionPin", "ArtifactId", "defineArtifact", "Obj", "invariant", "SpaceAction", "Filter", "definition", "defineArtifact", "id", "meta", "name", "description", "instructions", "schema", "ChessType", "tools", "createTool", "caption", "Schema", "Struct", "fen", "String", "annotations", "execute", "extensions", "invariant", "space", "dispatch", "intent", "pipe", "createIntent", "ChessAction", "Create", "chain", "SpaceAction", "AddObject", "target", "data", "error", "ToolResult", "Error", "message", "Success", "createArtifactElement", "VersionPin", "createBlock", "fromObject", "object", "_", "objects", "games", "db", "query", "Filter", "type", "run", "length", "ArtifactId", "game", "ids", "toDXN", "toString", "first", "Obj", "instanceOf", "move", "examples", "board", "Chess", "pgn", "contributes", "Capabilities", "ArtifactDefinition"]
7
+ }
@@ -1,20 +1,20 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
 
3
- // src/components/ChessComponent.tsx
3
+ // src/components/Chess.tsx
4
4
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
5
- import { Chess } from "chess.js";
5
+ import { Chess as ChessJS } from "chess.js";
6
6
  import React, { useCallback, useEffect, useMemo } from "react";
7
7
  import { log } from "@dxos/log";
8
8
  import { getSpace } from "@dxos/react-client/echo";
9
- import { ChessModel, Board, Chessboard } from "@dxos/react-ui-gameboard";
10
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-chess/src/components/ChessComponent.tsx";
11
- var ChessComponent = ({ game }) => {
9
+ import { ChessModel, Gameboard, Chessboard } from "@dxos/react-ui-gameboard";
10
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-chess/src/components/Chess.tsx";
11
+ var ChessRoot = ({ game, children }) => {
12
12
  var _effect = _useSignals();
13
13
  try {
14
14
  const model = useMemo(() => new ChessModel(), []);
15
15
  useEffect(() => {
16
16
  if (!model || game.pgn !== model?.game.pgn()) {
17
- const chess = new Chess();
17
+ const chess = new ChessJS();
18
18
  if (game.pgn) {
19
19
  try {
20
20
  chess.loadPgn(game.pgn);
@@ -48,16 +48,21 @@ var ChessComponent = ({ game }) => {
48
48
  }, [
49
49
  model
50
50
  ]);
51
- return /* @__PURE__ */ React.createElement(Board.Root, {
51
+ return /* @__PURE__ */ React.createElement(Gameboard.Root, {
52
52
  model,
53
53
  onDrop: handleDrop
54
- }, /* @__PURE__ */ React.createElement(Chessboard, null));
54
+ }, children);
55
55
  } finally {
56
56
  _effect.f();
57
57
  }
58
58
  };
59
+ var Chess = {
60
+ Root: ChessRoot,
61
+ Content: Gameboard.Content,
62
+ Board: Chessboard
63
+ };
59
64
 
60
65
  export {
61
- ChessComponent
66
+ Chess
62
67
  };
63
- //# sourceMappingURL=chunk-2DRWEDVT.mjs.map
68
+ //# sourceMappingURL=chunk-27D3JA3K.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/Chess.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport React, { type PropsWithChildren, useCallback, useEffect, useMemo } from 'react';\n\nimport { log } from '@dxos/log';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { ChessModel, Gameboard, Chessboard, type GameboardRootProps } from '@dxos/react-ui-gameboard';\n\nimport { type ChessType } from '../types';\n\nconst ChessRoot = ({ game, children }: PropsWithChildren<{ game: ChessType }>) => {\n const model = useMemo(() => new ChessModel(), []);\n useEffect(() => {\n if (!model || game.pgn !== model?.game.pgn()) {\n const chess = new ChessJS();\n if (game.pgn) {\n try {\n chess.loadPgn(game.pgn);\n } catch (err) {\n log.catch(err, { game });\n }\n }\n\n model.initialize(chess.fen());\n }\n }, [game.pgn]);\n\n const space = getSpace(game);\n if (!space) {\n return null;\n }\n\n const handleDrop = useCallback<NonNullable<GameboardRootProps['onDrop']>>(\n (move) => {\n if (model.makeMove(move)) {\n game.pgn = model.game.pgn();\n game.fen = model.game.fen();\n return true;\n }\n\n return false;\n },\n [model],\n );\n\n return (\n <Gameboard.Root model={model} onDrop={handleDrop}>\n {children}\n </Gameboard.Root>\n );\n};\n\nexport const Chess = {\n Root: ChessRoot,\n Content: Gameboard.Content,\n Board: Chessboard,\n};\n"],
5
+ "mappings": ";;;;AAIA,SAASA,SAASC,eAAe;AACjC,OAAOC,SAAiCC,aAAaC,WAAWC,eAAe;AAE/E,SAASC,WAAW;AACpB,SAASC,gBAAgB;AACzB,SAASC,YAAYC,WAAWC,kBAA2C;;AAI3E,IAAMC,YAAY,CAAC,EAAEC,MAAMC,SAAQ,MAA0C;;;AAC3E,UAAMC,QAAQT,QAAQ,MAAM,IAAIG,WAAAA,GAAc,CAAA,CAAE;AAChDJ,cAAU,MAAA;AACR,UAAI,CAACU,SAASF,KAAKG,QAAQD,OAAOF,KAAKG,IAAAA,GAAO;AAC5C,cAAMC,QAAQ,IAAIf,QAAAA;AAClB,YAAIW,KAAKG,KAAK;AACZ,cAAI;AACFC,kBAAMC,QAAQL,KAAKG,GAAG;UACxB,SAASG,KAAK;AACZZ,gBAAIa,MAAMD,KAAK;cAAEN;YAAK,GAAA;;;;;;UACxB;QACF;AAEAE,cAAMM,WAAWJ,MAAMK,IAAG,CAAA;MAC5B;IACF,GAAG;MAACT,KAAKG;KAAI;AAEb,UAAMO,QAAQf,SAASK,IAAAA;AACvB,QAAI,CAACU,OAAO;AACV,aAAO;IACT;AAEA,UAAMC,aAAapB,YACjB,CAACqB,SAAAA;AACC,UAAIV,MAAMW,SAASD,IAAAA,GAAO;AACxBZ,aAAKG,MAAMD,MAAMF,KAAKG,IAAG;AACzBH,aAAKS,MAAMP,MAAMF,KAAKS,IAAG;AACzB,eAAO;MACT;AAEA,aAAO;IACT,GACA;MAACP;KAAM;AAGT,WACE,sBAAA,cAACL,UAAUiB,MAAI;MAACZ;MAAca,QAAQJ;OACnCV,QAAAA;;;;AAGP;AAEO,IAAMb,QAAQ;EACnB0B,MAAMf;EACNiB,SAASnB,UAAUmB;EACnBC,OAAOnB;AACT;",
6
+ "names": ["Chess", "ChessJS", "React", "useCallback", "useEffect", "useMemo", "log", "getSpace", "ChessModel", "Gameboard", "Chessboard", "ChessRoot", "game", "children", "model", "pgn", "chess", "loadPgn", "err", "catch", "initialize", "fen", "space", "handleDrop", "move", "makeMove", "Root", "onDrop", "Content", "Board"]
7
+ }
@@ -2,9 +2,9 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
 
3
3
  // src/components/index.ts
4
4
  import { lazy } from "react";
5
- var ChessContainer = lazy(() => import("./ChessContainer-WVOL2KSE.mjs"));
5
+ var ChessContainer = lazy(() => import("./ChessContainer-7GLY5KLY.mjs"));
6
6
 
7
7
  export {
8
8
  ChessContainer
9
9
  };
10
- //# sourceMappingURL=chunk-TD2SWK2H.mjs.map
10
+ //# sourceMappingURL=chunk-QFINI7CC.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './ChessComponent';\n\nexport const ChessContainer = lazy(() => import('./ChessContainer'));\n"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './Chess';\n\nexport const ChessContainer = lazy(() => import('./ChessContainer'));\n"],
5
5
  "mappings": ";;;AAIA,SAASA,YAAY;AAId,IAAMC,iBAAiBC,KAAK,MAAM,OAAO,+BAAA,CAAA;",
6
6
  "names": ["lazy", "ChessContainer", "lazy"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  ChessContainer
4
- } from "./chunk-TD2SWK2H.mjs";
4
+ } from "./chunk-QFINI7CC.mjs";
5
5
  import {
6
6
  CHESS_PLUGIN,
7
7
  ChessAction,
@@ -9,14 +9,14 @@ import {
9
9
  meta
10
10
  } from "./chunk-IS3Y25PL.mjs";
11
11
  import {
12
- ChessComponent
13
- } from "./chunk-2DRWEDVT.mjs";
12
+ Chess
13
+ } from "./chunk-27D3JA3K.mjs";
14
14
 
15
15
  // src/capabilities/index.ts
16
16
  import { lazy } from "@dxos/app-framework";
17
- var ArtifactDefinition = lazy(() => import("./artifact-definition-TT3747JB.mjs"));
17
+ var ArtifactDefinition = lazy(() => import("./artifact-definition-2H7OUBZO.mjs"));
18
18
  var IntentResolver = lazy(() => import("./intent-resolver-GXK2JROQ.mjs"));
19
- var ReactSurface = lazy(() => import("./react-surface-PAUEOIBL.mjs"));
19
+ var ReactSurface = lazy(() => import("./react-surface-NGLNIWN3.mjs"));
20
20
 
21
21
  // src/ChessPlugin.tsx
22
22
  import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from "@dxos/app-framework";
@@ -33,7 +33,9 @@ var translations = [
33
33
  "typename label_zero": "Games",
34
34
  "typename label_one": "Game",
35
35
  "typename label_other": "Games",
36
- "object name placeholder": "New game"
36
+ "object name placeholder": "New game",
37
+ "rename object label": "Rename game",
38
+ "delete object label": "Delete game"
37
39
  },
38
40
  [meta.id]: {
39
41
  "plugin name": "Chess",
@@ -87,7 +89,7 @@ var ChessPlugin = () => definePlugin(meta, [
87
89
  export {
88
90
  ArtifactDefinition,
89
91
  CHESS_PLUGIN,
90
- ChessComponent,
92
+ Chess,
91
93
  ChessContainer,
92
94
  ChessPlugin,
93
95
  IntentResolver,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/capabilities/index.ts", "../../../src/ChessPlugin.tsx", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const ArtifactDefinition = lazy(() => import('./artifact-definition'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { ClientEvents } from '@dxos/plugin-client';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { defineObjectForm } from '@dxos/plugin-space/types';\n\nimport { ArtifactDefinition, IntentResolver, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\nimport { ChessAction, ChessType } from './types';\n\nexport const ChessPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: ChessType.typename,\n metadata: {\n icon: 'ph--shield-chevron--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/object-form`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () =>\n contributes(\n SpaceCapabilities.ObjectForm,\n defineObjectForm({\n objectSchema: ChessType,\n getIntent: () => createIntent(ChessAction.Create),\n }),\n ),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n defineModule({\n id: `${meta.id}/module/artifact-definition`,\n activatesOn: Events.SetupArtifactDefinition,\n activate: ArtifactDefinition,\n }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\nimport { ChessType } from './types';\n\nexport const translations = [\n {\n 'en-US': {\n [ChessType.typename]: {\n 'typename label': 'Game',\n 'typename label_zero': 'Games',\n 'typename label_one': 'Game',\n 'typename label_other': 'Games',\n 'object name placeholder': 'New game',\n },\n [meta.id]: {\n 'plugin name': 'Chess',\n 'delete game label': 'Delete',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
- "mappings": ";;;;;;;;;;;;;;;AAIA,SAASA,YAAY;AAEd,IAAMC,qBAAqBC,KAAK,MAAM,OAAO,oCAAA,CAAA;AAC7C,IAAMC,iBAAiBD,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAME,eAAeF,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACJ9C,SAASG,cAAcC,aAAaC,cAAcC,cAAcC,cAAcC,cAAc;AAC5F,SAASC,oBAAoB;AAC7B,SAASC,yBAAyB;AAClC,SAASC,wBAAwB;;;ACE1B,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,UAAUC,QAAQ,GAAG;QACpB,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;MAC7B;MACA,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,qBAAqB;MACvB;IACF;EACF;;;;ADVK,IAAMC,cAAc,MACzBC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,YAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAU,MACRC,YAAYC,aAAaI,UAAU;MACjCV,IAAIW,UAAUC;MACdC,UAAU;QACRC,MAAM;MACR;IACF,CAAA;EACJ,CAAA;EACAf,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAac,aAAaC;IAC1BZ,UAAU,MACRC,YACEY,kBAAkBC,YAClBC,iBAAiB;MACfC,cAAcT;MACdU,WAAW,MAAMC,aAAaC,YAAYC,MAAM;IAClD,CAAA,CAAA;EAEN,CAAA;EACAzB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOuB;IACpBrB,UAAUsB;EACZ,CAAA;EACA3B,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOyB;IACpBvB,UAAUwB;EACZ,CAAA;EACA7B,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAO2B;IACpBzB,UAAU0B;EACZ,CAAA;CACD;",
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const ArtifactDefinition = lazy(() => import('./artifact-definition'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { ClientEvents } from '@dxos/plugin-client';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { defineObjectForm } from '@dxos/plugin-space/types';\n\nimport { ArtifactDefinition, IntentResolver, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\nimport { ChessAction, ChessType } from './types';\n\nexport const ChessPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: ChessType.typename,\n metadata: {\n icon: 'ph--shield-chevron--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/object-form`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () =>\n contributes(\n SpaceCapabilities.ObjectForm,\n defineObjectForm({\n objectSchema: ChessType,\n getIntent: () => createIntent(ChessAction.Create),\n }),\n ),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n defineModule({\n id: `${meta.id}/module/artifact-definition`,\n activatesOn: Events.SetupArtifactDefinition,\n activate: ArtifactDefinition,\n }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\nimport { ChessType } from './types';\n\nexport const translations = [\n {\n 'en-US': {\n [ChessType.typename]: {\n 'typename label': 'Game',\n 'typename label_zero': 'Games',\n 'typename label_one': 'Game',\n 'typename label_other': 'Games',\n 'object name placeholder': 'New game',\n 'rename object label': 'Rename game',\n 'delete object label': 'Delete game',\n },\n [meta.id]: {\n 'plugin name': 'Chess',\n 'delete game label': 'Delete',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAIA,SAASA,YAAY;AAEd,IAAMC,qBAAqBC,KAAK,MAAM,OAAO,oCAAA,CAAA;AAC7C,IAAMC,iBAAiBD,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAME,eAAeF,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACJ9C,SAASG,cAAcC,aAAaC,cAAcC,cAAcC,cAAcC,cAAc;AAC5F,SAASC,oBAAoB;AAC7B,SAASC,yBAAyB;AAClC,SAASC,wBAAwB;;;ACE1B,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,UAAUC,QAAQ,GAAG;QACpB,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;QAC3B,uBAAuB;QACvB,uBAAuB;MACzB;MACA,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,qBAAqB;MACvB;IACF;EACF;;;;ADZK,IAAMC,cAAc,MACzBC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,YAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAU,MACRC,YAAYC,aAAaI,UAAU;MACjCV,IAAIW,UAAUC;MACdC,UAAU;QACRC,MAAM;MACR;IACF,CAAA;EACJ,CAAA;EACAf,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAac,aAAaC;IAC1BZ,UAAU,MACRC,YACEY,kBAAkBC,YAClBC,iBAAiB;MACfC,cAAcT;MACdU,WAAW,MAAMC,aAAaC,YAAYC,MAAM;IAClD,CAAA,CAAA;EAEN,CAAA;EACAzB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOuB;IACpBrB,UAAUsB;EACZ,CAAA;EACA3B,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOyB;IACpBvB,UAAUwB;EACZ,CAAA;EACA7B,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAO2B;IACpBzB,UAAU0B;EACZ,CAAA;CACD;",
6
6
  "names": ["lazy", "ArtifactDefinition", "lazy", "IntentResolver", "ReactSurface", "Capabilities", "contributes", "createIntent", "defineModule", "definePlugin", "Events", "ClientEvents", "SpaceCapabilities", "defineObjectForm", "translations", "ChessType", "typename", "meta", "id", "ChessPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "Metadata", "ChessType", "typename", "metadata", "icon", "ClientEvents", "SetupSchema", "SpaceCapabilities", "ObjectForm", "defineObjectForm", "objectSchema", "getIntent", "createIntent", "ChessAction", "Create", "SetupReactSurface", "ReactSurface", "SetupIntentResolver", "IntentResolver", "SetupArtifactDefinition", "ArtifactDefinition"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/meta.ts":{"bytes":2020,"imports":[],"format":"esm"},"src/types/schema.ts":{"bytes":3031,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/types.ts":{"bytes":2147,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/types/index.ts":{"bytes":541,"imports":[{"path":"src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/capabilities/artifact-definition.ts":{"bytes":19069,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/intent-resolver.ts":{"bytes":2679,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/components/ChessComponent.tsx":{"bytes":5495,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"format":"esm"},"src/components/PlayerSelector.tsx":{"bytes":9071,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/ChessContainer.tsx":{"bytes":3418,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"src/components/index.ts":{"bytes":859,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/ChessComponent.tsx","kind":"import-statement","original":"./ChessComponent"},{"path":"src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":4004,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1316,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/artifact-definition.ts","kind":"dynamic-import","original":"./artifact-definition"},{"path":"src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":2148,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/ChessPlugin.tsx":{"bytes":7255,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":741,"imports":[{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5103},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-TD2SWK2H.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-IS3Y25PL.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-2DRWEDVT.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/artifact-definition-TT3747JB.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/intent-resolver-GXK2JROQ.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/react-surface-PAUEOIBL.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","ChessComponent","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"src/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":273},"src/index.ts":{"bytesInOutput":0},"src/ChessPlugin.tsx":{"bytesInOutput":1492},"src/translations.ts":{"bytesInOutput":388}},"bytes":2729},"dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-IS3Y25PL.mjs","kind":"import-statement"}],"exports":["ChessAction","ChessType","MoveSchema"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":262},"dist/lib/node-esm/artifact-definition-TT3747JB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8479},"dist/lib/node-esm/artifact-definition-TT3747JB.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-IS3Y25PL.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/artifact","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/artifact-definition.ts","inputs":{"src/capabilities/artifact-definition.ts":{"bytesInOutput":5943}},"bytes":6265},"dist/lib/node-esm/intent-resolver-GXK2JROQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1375},"dist/lib/node-esm/intent-resolver-GXK2JROQ.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-IS3Y25PL.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/intent-resolver.ts","inputs":{"src/capabilities/intent-resolver.ts":{"bytesInOutput":503}},"bytes":805},"dist/lib/node-esm/ChessContainer-WVOL2KSE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6168},"dist/lib/node-esm/ChessContainer-WVOL2KSE.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-2DRWEDVT.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/components/ChessContainer.tsx","inputs":{"src/components/ChessContainer.tsx":{"bytesInOutput":978},"src/components/PlayerSelector.tsx":{"bytesInOutput":2608}},"bytes":3950},"dist/lib/node-esm/react-surface-PAUEOIBL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1889},"dist/lib/node-esm/react-surface-PAUEOIBL.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-TD2SWK2H.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-IS3Y25PL.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-2DRWEDVT.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":875}},"bytes":1279},"dist/lib/node-esm/chunk-TD2SWK2H.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":404},"dist/lib/node-esm/chunk-TD2SWK2H.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/ChessContainer-WVOL2KSE.mjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"src/components/index.ts":{"bytesInOutput":104}},"bytes":298},"dist/lib/node-esm/chunk-IS3Y25PL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3484},"dist/lib/node-esm/chunk-IS3Y25PL.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","ChessType","MoveSchema","meta"],"inputs":{"src/types/schema.ts":{"bytesInOutput":586},"src/types/index.ts":{"bytesInOutput":0},"src/types/types.ts":{"bytesInOutput":430},"src/meta.ts":{"bytesInOutput":513}},"bytes":1829},"dist/lib/node-esm/chunk-2DRWEDVT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2590},"dist/lib/node-esm/chunk-2DRWEDVT.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"exports":["ChessComponent"],"inputs":{"src/components/ChessComponent.tsx":{"bytesInOutput":1588}},"bytes":1792}}}
1
+ {"inputs":{"src/meta.ts":{"bytes":2020,"imports":[],"format":"esm"},"src/types/schema.ts":{"bytes":3031,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/types.ts":{"bytes":2147,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/types/index.ts":{"bytes":541,"imports":[{"path":"src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/capabilities/artifact-definition.ts":{"bytes":19075,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/intent-resolver.ts":{"bytes":2679,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/components/Chess.tsx":{"bytes":5947,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"format":"esm"},"src/components/PlayerSelector.tsx":{"bytes":8842,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/components/ChessContainer.tsx":{"bytes":7151,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"src/components/Chess.tsx","kind":"import-statement","original":"./Chess"},{"path":"src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"src/components/index.ts":{"bytes":838,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/Chess.tsx","kind":"import-statement","original":"./Chess"},{"path":"src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":3374,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1316,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/artifact-definition.ts","kind":"dynamic-import","original":"./artifact-definition"},{"path":"src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":2420,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/ChessPlugin.tsx":{"bytes":7255,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":741,"imports":[{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5223},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-QFINI7CC.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-IS3Y25PL.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-27D3JA3K.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/artifact-definition-2H7OUBZO.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/intent-resolver-GXK2JROQ.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/react-surface-NGLNIWN3.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["ArtifactDefinition","CHESS_PLUGIN","Chess","ChessContainer","ChessPlugin","IntentResolver","ReactSurface","meta"],"entryPoint":"src/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":273},"src/index.ts":{"bytesInOutput":0},"src/ChessPlugin.tsx":{"bytesInOutput":1492},"src/translations.ts":{"bytesInOutput":480}},"bytes":2803},"dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-IS3Y25PL.mjs","kind":"import-statement"}],"exports":["ChessAction","ChessType","MoveSchema"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":262},"dist/lib/node-esm/artifact-definition-2H7OUBZO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8481},"dist/lib/node-esm/artifact-definition-2H7OUBZO.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-IS3Y25PL.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/artifact-definition.ts","inputs":{"src/capabilities/artifact-definition.ts":{"bytesInOutput":5945}},"bytes":6267},"dist/lib/node-esm/intent-resolver-GXK2JROQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1375},"dist/lib/node-esm/intent-resolver-GXK2JROQ.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-IS3Y25PL.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/intent-resolver.ts","inputs":{"src/capabilities/intent-resolver.ts":{"bytesInOutput":503}},"bytes":805},"dist/lib/node-esm/ChessContainer-7GLY5KLY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7675},"dist/lib/node-esm/ChessContainer-7GLY5KLY.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-27D3JA3K.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/components/ChessContainer.tsx","inputs":{"src/components/ChessContainer.tsx":{"bytesInOutput":2219},"src/components/PlayerSelector.tsx":{"bytesInOutput":2519}},"bytes":5093},"dist/lib/node-esm/react-surface-NGLNIWN3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1577},"dist/lib/node-esm/react-surface-NGLNIWN3.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-QFINI7CC.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-IS3Y25PL.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-27D3JA3K.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":715}},"bytes":1093},"dist/lib/node-esm/chunk-QFINI7CC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":395},"dist/lib/node-esm/chunk-QFINI7CC.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/ChessContainer-7GLY5KLY.mjs","kind":"dynamic-import"}],"exports":["ChessContainer"],"inputs":{"src/components/index.ts":{"bytesInOutput":104}},"bytes":298},"dist/lib/node-esm/chunk-IS3Y25PL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3484},"dist/lib/node-esm/chunk-IS3Y25PL.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","ChessType","MoveSchema","meta"],"inputs":{"src/types/schema.ts":{"bytesInOutput":586},"src/types/index.ts":{"bytesInOutput":0},"src/types/types.ts":{"bytesInOutput":430},"src/meta.ts":{"bytesInOutput":513}},"bytes":1829},"dist/lib/node-esm/chunk-27D3JA3K.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2854},"dist/lib/node-esm/chunk-27D3JA3K.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"exports":["Chess"],"inputs":{"src/components/Chess.tsx":{"bytesInOutput":1646}},"bytes":1832}}}
@@ -1,14 +1,12 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  ChessContainer
4
- } from "./chunk-TD2SWK2H.mjs";
4
+ } from "./chunk-QFINI7CC.mjs";
5
5
  import {
6
6
  ChessType,
7
7
  meta
8
8
  } from "./chunk-IS3Y25PL.mjs";
9
- import {
10
- ChessComponent
11
- } from "./chunk-2DRWEDVT.mjs";
9
+ import "./chunk-27D3JA3K.mjs";
12
10
 
13
11
  // src/capabilities/react-surface.tsx
14
12
  import React from "react";
@@ -19,7 +17,11 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, [
19
17
  id: meta.id,
20
18
  role: [
21
19
  "article",
22
- "section"
20
+ "section",
21
+ "card--intrinsic",
22
+ "card--extrinsic",
23
+ "card--popover",
24
+ "card--transclusion"
23
25
  ],
24
26
  // TODO(burdon): Could this be standardized so that we don't require a subject property (like below)?
25
27
  filter: (data) => Obj.instanceOf(ChessType, data.subject),
@@ -27,18 +29,9 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, [
27
29
  game: data.subject,
28
30
  role
29
31
  })
30
- }),
31
- createSurface({
32
- id: "plugin-chess",
33
- // TODO(burdon): Change role to card?
34
- role: "canvas-node",
35
- filter: Obj.instanceOf(ChessType),
36
- component: ({ data }) => /* @__PURE__ */ React.createElement(ChessComponent, {
37
- game: data
38
- })
39
32
  })
40
33
  ]);
41
34
  export {
42
35
  react_surface_default as default
43
36
  };
44
- //# sourceMappingURL=react-surface-PAUEOIBL.mjs.map
37
+ //# sourceMappingURL=react-surface-NGLNIWN3.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/react-surface.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { ChessContainer } from '../components';\nimport { meta } from '../meta';\nimport { ChessType } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: meta.id,\n role: ['article', 'section', 'card--intrinsic', 'card--extrinsic', 'card--popover', 'card--transclusion'],\n // TODO(burdon): Could this be standardized so that we don't require a subject property (like below)?\n filter: (data): data is { subject: ChessType } => Obj.instanceOf(ChessType, data.subject),\n component: ({ data, role }) => <ChessContainer game={data.subject} role={role} />,\n }),\n ]);\n"],
5
+ "mappings": ";;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,WAAW;AAMpB,IAAA,wBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAIC,KAAKD;IACTE,MAAM;MAAC;MAAW;MAAW;MAAmB;MAAmB;MAAiB;;;IAEpFC,QAAQ,CAACC,SAAyCC,IAAIC,WAAWC,WAAWH,KAAKI,OAAO;IACxFC,WAAW,CAAC,EAAEL,MAAMF,KAAI,MAAO,sBAAA,cAACQ,gBAAAA;MAAeC,MAAMP,KAAKI;MAASN;;EACrE,CAAA;CACD;",
6
+ "names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "ChessType", "subject", "component", "ChessContainer", "game"]
7
+ }
@@ -6,6 +6,6 @@ declare global {
6
6
  dispatch?: PromiseIntentDispatcher;
7
7
  }
8
8
  }
9
- declare const _default: () => import("@dxos/app-framework").Capability<import("@dxos/artifact").ArtifactDefinition>;
9
+ declare const _default: () => import("@dxos/app-framework").Capability<import("@dxos/blueprints").ArtifactDefinition>;
10
10
  export default _default;
11
11
  //# sourceMappingURL=artifact-definition.d.ts.map
@@ -1,4 +1,4 @@
1
- export declare const ArtifactDefinition: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/artifact").ArtifactDefinition> | import("@dxos/app-framework").AnyCapability[]>>;
1
+ export declare const ArtifactDefinition: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/blueprints").ArtifactDefinition> | import("@dxos/app-framework").AnyCapability[]>>;
2
2
  export declare const IntentResolver: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.IntentResolver> | import("@dxos/app-framework").AnyCapability[]>>;
3
3
  export declare const ReactSurface: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.ReactSurface> | import("@dxos/app-framework").AnyCapability[]>>;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,oLAA8C,CAAC;AAC9E,eAAO,MAAM,cAAc,kMAA0C,CAAC;AACtE,eAAO,MAAM,YAAY,gMAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,sLAA8C,CAAC;AAC9E,eAAO,MAAM,cAAc,kMAA0C,CAAC;AACtE,eAAO,MAAM,YAAY,gMAAwC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAA8B,MAAM,qBAAqB,CAAC;;AAO/E,wBAgBK"}
1
+ {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAA8B,MAAM,qBAAqB,CAAC;;AAO/E,wBASK"}
@@ -0,0 +1,14 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import { type ChessType } from '../types';
3
+ export declare const Chess: {
4
+ Root: ({ game, children }: PropsWithChildren<{
5
+ game: ChessType;
6
+ }>) => React.JSX.Element | null;
7
+ Content: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<{
8
+ style?: React.CSSProperties;
9
+ }>, "className"> & {
10
+ classNames?: import("@dxos/react-ui-types").ClassNameValue;
11
+ } & React.RefAttributes<HTMLDivElement>>;
12
+ Board: React.MemoExoticComponent<({ orientation, showLabels, debug, rows, cols, classNames }: import("@dxos/react-ui-gameboard").ChessboardProps) => React.JSX.Element>;
13
+ };
14
+ //# sourceMappingURL=Chess.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chess.d.ts","sourceRoot":"","sources":["../../../../src/components/Chess.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAmC,MAAM,OAAO,CAAC;AAMvF,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AA4C1C,eAAO,MAAM,KAAK;+BA1CqB,iBAAiB,CAAC;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;;;;;;;CA8C5E,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { type ChessType } from '../types';
3
- declare const ChessContainer: ({ game }: {
3
+ declare const ChessContainer: ({ game, role }: {
4
4
  game: ChessType;
5
5
  role?: string;
6
6
  }) => React.JSX.Element | null;
@@ -1 +1 @@
1
- {"version":3,"file":"ChessContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ChessContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,QAAA,MAAM,cAAc,GAAI,UAAU;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,6BAmBnE,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ChessContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ChessContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAI1C,QAAA,MAAM,cAAc,GAAI,gBAAgB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,6BAqDzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,23 @@
1
+ import '@dxos-theme';
2
+ import { type Meta } from '@storybook/react-vite';
3
+ type StoryProps = {
4
+ role: 'card--popover' | 'card--intrinsic' | 'card--extrinsic';
5
+ };
6
+ declare const meta: Meta<StoryProps>;
7
+ export default meta;
8
+ export declare const Popover: {
9
+ args: {
10
+ role: string;
11
+ };
12
+ };
13
+ export declare const Intrinsic: {
14
+ args: {
15
+ role: string;
16
+ };
17
+ };
18
+ export declare const Extrinsic: {
19
+ args: {
20
+ role: string;
21
+ };
22
+ };
23
+ //# sourceMappingURL=ChessContainer.stories.d.ts.map