chesspal 0.3.0 → 0.3.2

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 (188) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/cli.js +6 -6
  3. package/dist/commands/{analyse-game.d.ts → analysis/analyse.d.ts} +2 -2
  4. package/dist/commands/{analyse-game.js → analysis/analyse.js} +7 -11
  5. package/dist/commands/{annotate-game.d.ts → analysis/annotate.d.ts} +1 -1
  6. package/dist/commands/{annotate-game.js → analysis/annotate.js} +6 -9
  7. package/dist/commands/{delete-review.d.ts → analysis/delete-review.d.ts} +1 -1
  8. package/dist/commands/{delete-review.js → analysis/delete-review.js} +5 -5
  9. package/dist/commands/analysis/index.d.ts +4 -0
  10. package/dist/commands/analysis/index.js +5 -0
  11. package/dist/commands/{study-games.d.ts → analysis/study-games.d.ts} +1 -1
  12. package/dist/commands/{study-games.js → analysis/study-games.js} +4 -5
  13. package/dist/commands/{agents.d.ts → answers/agents.d.ts} +3 -3
  14. package/dist/commands/{agents.js → answers/agents.js} +5 -5
  15. package/dist/commands/{clock.d.ts → answers/clock.d.ts} +2 -2
  16. package/dist/commands/{clock.js → answers/clock.js} +2 -2
  17. package/dist/commands/{drawings.d.ts → answers/drawings.d.ts} +1 -1
  18. package/dist/commands/{drawings.js → answers/drawings.js} +1 -1
  19. package/dist/commands/answers/index.d.ts +12 -0
  20. package/dist/commands/answers/index.js +14 -0
  21. package/dist/commands/{lead-input.d.ts → answers/lead-input.d.ts} +1 -1
  22. package/dist/commands/{lead-input.js → answers/lead-input.js} +1 -1
  23. package/dist/commands/{answer-lines.d.ts → answers/lines.d.ts} +2 -2
  24. package/dist/commands/{answer-lines.js → answers/lines.js} +4 -4
  25. package/dist/commands/{opening-book.d.ts → answers/opening-book.d.ts} +1 -1
  26. package/dist/commands/{opening-book.js → answers/opening-book.js} +3 -3
  27. package/dist/commands/{play-move.d.ts → answers/play-move.d.ts} +2 -2
  28. package/dist/commands/{play-move.js → answers/play-move.js} +3 -3
  29. package/dist/commands/{say.d.ts → answers/say.d.ts} +3 -3
  30. package/dist/commands/{say.js → answers/say.js} +4 -4
  31. package/dist/commands/{speech.js → answers/speech.js} +1 -1
  32. package/dist/commands/{study.d.ts → answers/study.d.ts} +3 -3
  33. package/dist/commands/{study.js → answers/study.js} +3 -3
  34. package/dist/commands/{game-summary.d.ts → answers/summary.d.ts} +2 -2
  35. package/dist/commands/{game-summary.js → answers/summary.js} +4 -4
  36. package/dist/commands/{view.d.ts → answers/view.d.ts} +1 -1
  37. package/dist/commands/{ai-move.d.ts → game/ai-move.d.ts} +2 -2
  38. package/dist/commands/{ai-move.js → game/ai-move.js} +6 -11
  39. package/dist/commands/{coach.d.ts → game/coach.d.ts} +1 -1
  40. package/dist/commands/{coach.js → game/coach.js} +7 -13
  41. package/dist/commands/{draw-offer.d.ts → game/draw-offer.d.ts} +1 -1
  42. package/dist/commands/{draw-offer.js → game/draw-offer.js} +4 -4
  43. package/dist/commands/{end-game.d.ts → game/end.d.ts} +2 -2
  44. package/dist/commands/{end-game.js → game/end.js} +5 -9
  45. package/dist/commands/{export-game.d.ts → game/export.d.ts} +1 -1
  46. package/dist/commands/{export-game.js → game/export.js} +4 -4
  47. package/dist/commands/game/index.d.ts +11 -0
  48. package/dist/commands/game/index.js +13 -0
  49. package/dist/commands/{levels.d.ts → game/levels.d.ts} +3 -3
  50. package/dist/commands/{levels.js → game/levels.js} +3 -3
  51. package/dist/commands/{look.d.ts → game/look.d.ts} +3 -4
  52. package/dist/commands/{look.js → game/look.js} +5 -10
  53. package/dist/commands/{new-game.d.ts → game/new.d.ts} +3 -4
  54. package/dist/commands/{new-game.js → game/new.js} +17 -13
  55. package/dist/commands/{page-link.d.ts → game/page-link.d.ts} +1 -1
  56. package/dist/commands/{player-move.d.ts → game/player-move.d.ts} +2 -2
  57. package/dist/commands/{player-move.js → game/player-move.js} +4 -8
  58. package/dist/commands/{ponder.d.ts → game/ponder.d.ts} +3 -3
  59. package/dist/commands/{ponder.js → game/ponder.js} +6 -9
  60. package/dist/commands/{position.d.ts → game/position.d.ts} +2 -2
  61. package/dist/commands/{position.js → game/position.js} +5 -7
  62. package/dist/commands/{status.d.ts → game/status.d.ts} +2 -4
  63. package/dist/commands/{status.js → game/status.js} +12 -17
  64. package/dist/commands/index.d.ts +6 -17
  65. package/dist/commands/index.js +11 -38
  66. package/dist/commands/{delete-game.d.ts → profiles/delete-game.d.ts} +1 -1
  67. package/dist/commands/{delete-game.js → profiles/delete-game.js} +3 -3
  68. package/dist/commands/profiles/index.d.ts +4 -0
  69. package/dist/commands/profiles/index.js +5 -0
  70. package/dist/commands/{past-games.d.ts → profiles/past-games.d.ts} +1 -1
  71. package/dist/commands/{past-games.js → profiles/past-games.js} +5 -5
  72. package/dist/commands/{profiles.d.ts → profiles/profiles.d.ts} +7 -7
  73. package/dist/commands/{profiles.js → profiles/profiles.js} +4 -4
  74. package/dist/commands/{ratings.d.ts → profiles/ratings.d.ts} +1 -1
  75. package/dist/commands/{ratings.js → profiles/ratings.js} +2 -2
  76. package/dist/commands/{context.d.ts → registry/context.d.ts} +2 -0
  77. package/dist/commands/{context.js → registry/context.js} +2 -2
  78. package/dist/commands/registry/index.d.ts +2 -0
  79. package/dist/commands/registry/index.js +3 -0
  80. package/dist/commands/setup/index.d.ts +2 -0
  81. package/dist/commands/setup/index.js +3 -0
  82. package/dist/commands/{init.d.ts → setup/init.d.ts} +1 -1
  83. package/dist/commands/{init.js → setup/init.js} +2 -3
  84. package/dist/commands/{instructions.d.ts → setup/instructions.d.ts} +2 -2
  85. package/dist/commands/{instructions.js → setup/instructions.js} +3 -3
  86. package/dist/commands/{ai-say.d.ts → talk/ai-say.d.ts} +2 -3
  87. package/dist/commands/{ai-say.js → talk/ai-say.js} +5 -9
  88. package/dist/commands/talk/index.d.ts +2 -0
  89. package/dist/commands/talk/index.js +3 -0
  90. package/dist/commands/{player-say.d.ts → talk/player-say.d.ts} +1 -1
  91. package/dist/commands/{player-say.js → talk/player-say.js} +4 -4
  92. package/dist/page/app/app.js +44 -20
  93. package/dist/page/app/served.js +7 -0
  94. package/dist/page/avatars/torretta.js +10 -3
  95. package/dist/page/dialogs/dialogs.css +10 -0
  96. package/dist/page/dialogs/profiles.js +3 -7
  97. package/dist/page/dialogs/settings.js +18 -4
  98. package/dist/page/game/column.js +1 -1
  99. package/dist/page/game/game.css +1 -1
  100. package/dist/page/guide/blocks.js +13 -2
  101. package/dist/page/guide/credits.js +6 -0
  102. package/dist/page/guide/drawings/analysis.js +13 -0
  103. package/dist/page/guide/drawings/drawings.css +329 -0
  104. package/dist/page/guide/drawings/drawings.js +15 -0
  105. package/dist/page/guide/drawings/game.js +15 -0
  106. package/dist/page/guide/drawings/helps.js +13 -0
  107. package/dist/page/guide/drawings/how-it-works.js +13 -0
  108. package/dist/page/guide/drawings/parts.js +103 -0
  109. package/dist/page/guide/drawings/players.js +19 -0
  110. package/dist/page/guide/drawings/talk.js +9 -0
  111. package/dist/page/guide/en.md +39 -25
  112. package/dist/page/guide/guide.css +123 -91
  113. package/dist/page/guide/guide.js +47 -25
  114. package/dist/page/guide/it.md +39 -25
  115. package/dist/page/guide/markdown.js +5 -0
  116. package/dist/page/helps/helps.css +127 -83
  117. package/dist/page/helps/helps.js +45 -26
  118. package/dist/page/helps/view.js +13 -3
  119. package/dist/page/{guide/foot.js → layout/footer.js} +7 -8
  120. package/dist/page/layout/header.js +5 -3
  121. package/dist/page/layout/layout.css +114 -36
  122. package/dist/page/layout/window.js +6 -26
  123. package/dist/page/main.js +1 -1
  124. package/dist/page/pieces/pieces.js +5 -2
  125. package/dist/page/style.css +2 -1
  126. package/dist/page/table/table.css +192 -0
  127. package/dist/page/table/update.js +82 -0
  128. package/dist/page/table/window.js +130 -0
  129. package/dist/page/talk/chat.css +19 -8
  130. package/dist/page/talk/talk.css +17 -67
  131. package/dist/page/talk/talk.js +7 -7
  132. package/dist/page/talk/voice.js +47 -9
  133. package/dist/page/text.js +118 -22
  134. package/dist/page/theme.css +2 -0
  135. package/dist/server/{bell.js → bell/bell.js} +3 -3
  136. package/dist/server/bell/index.d.ts +1 -0
  137. package/dist/server/bell/index.js +2 -0
  138. package/dist/server/{caller.d.ts → mcp/caller.d.ts} +1 -1
  139. package/dist/server/{caller.js → mcp/caller.js} +1 -1
  140. package/dist/server/mcp/index.d.ts +1 -0
  141. package/dist/server/mcp/index.js +2 -0
  142. package/dist/server/{mcp.d.ts → mcp/mcp.d.ts} +1 -1
  143. package/dist/server/{mcp.js → mcp/mcp.js} +9 -9
  144. package/dist/server/page/chat.d.ts +5 -0
  145. package/dist/server/page/chat.js +9 -1
  146. package/dist/server/page/game.js +16 -3
  147. package/dist/server/page/http.d.ts +1 -1
  148. package/dist/server/page/index.d.ts +3 -0
  149. package/dist/server/page/index.js +3 -0
  150. package/dist/server/page/page.d.ts +16 -3
  151. package/dist/server/page/page.js +18 -4
  152. package/dist/server/page/table.d.ts +40 -15
  153. package/dist/server/page/table.js +203 -19
  154. package/dist/server/page/update.d.ts +18 -0
  155. package/dist/server/page/update.js +40 -0
  156. package/dist/server/table/browser.d.ts +1 -1
  157. package/dist/server/table/browser.js +1 -1
  158. package/dist/server/table/hosts/chats.d.ts +1 -1
  159. package/dist/server/table/hosts/chats.js +7 -4
  160. package/dist/server/table/hosts/index.d.ts +1 -1
  161. package/dist/server/table/hosts/index.js +1 -1
  162. package/dist/server/table/hosts/play.d.ts +15 -4
  163. package/dist/server/table/hosts/play.js +75 -11
  164. package/dist/server/table/hosts/seat.d.ts +17 -5
  165. package/dist/server/table/hosts/seat.js +21 -15
  166. package/dist/server/table/index.d.ts +3 -2
  167. package/dist/server/table/index.js +3 -2
  168. package/dist/server/table/launch.d.ts +5 -2
  169. package/dist/server/table/launch.js +6 -3
  170. package/dist/server/table/link.d.ts +1 -1
  171. package/dist/server/table/link.js +4 -3
  172. package/dist/server/table/table.d.ts +4 -5
  173. package/dist/server/table/table.js +15 -12
  174. package/dist/server/table/update.d.ts +17 -0
  175. package/dist/server/table/update.js +77 -0
  176. package/dist/sites/index.d.ts +1 -1
  177. package/dist/sites/index.js +2 -2
  178. package/dist/version.d.ts +4 -0
  179. package/dist/version.js +12 -1
  180. package/package.json +1 -1
  181. package/dist/page/table/opener.css +0 -65
  182. package/dist/page/table/opener.js +0 -59
  183. /package/dist/commands/{speech.d.ts → answers/speech.d.ts} +0 -0
  184. /package/dist/commands/{view.js → answers/view.js} +0 -0
  185. /package/dist/commands/{page-link.js → game/page-link.js} +0 -0
  186. /package/dist/commands/{registry.d.ts → registry/registry.d.ts} +0 -0
  187. /package/dist/commands/{registry.js → registry/registry.js} +0 -0
  188. /package/dist/server/{bell.d.ts → bell/bell.d.ts} +0 -0
@@ -1,59 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
2
- // The table with no chat at it (D-104): a button for each host installed, which opens a terminal with a chat at the table, the model and effort it plays
3
- // with beside it, kept in the profile, and the command to type in a terminal instead.
4
- import { useState } from "preact/hooks";
5
- /** Where the asleep note stands while no chat is at the table: the hosts that open one, their choices, and the command to type. */
6
- export function ChatOpener({ table, settings, onChange, name, text }) {
7
- const [sending, setSending] = useState(false);
8
- const [failed, setFailed] = useState(false);
9
- const words = text.table;
10
- const installed = table.hosts.filter((host) => host.installed && host.name in choiceKeys);
11
- const busy = sending || table.opening !== undefined;
12
- const open = async (host) => {
13
- setSending(true);
14
- setFailed(false);
15
- const opened = await openChat(host);
16
- setSending(false);
17
- setFailed(!opened);
18
- };
19
- // The chat started again for a new game needs nothing of the player.
20
- if (table.opening === "again") {
21
- return _jsx("p", { class: "asleep", role: "status", children: words.again(name) });
22
- }
23
- if (installed.length === 0) {
24
- return _jsx("p", { class: "asleep", role: "status", children: words.install(name) });
25
- }
26
- // The state stays in the page, empty when there is none, so a screen reader hears it change.
27
- return (_jsxs("section", { class: "asleep opener", "aria-label": words.label, children: [_jsx("p", { children: words.noChat(name) }), installed.map((host) => (_jsxs("div", { class: "opener-host", children: [_jsx("button", { type: "button", class: "command primary", disabled: busy, onClick: () => void open(host.name), children: hostTitles[host.name] ?? host.name }), _jsx(Choice, { host: host, kind: "model", settings: settings, onChange: onChange, text: text }), _jsx(Choice, { host: host, kind: "effort", settings: settings, onChange: onChange, text: text })] }, host.name))), _jsx("p", { class: "opener-state", role: "status", children: busy ? words.opening : failed ? words.failed : null }), _jsxs("p", { class: "opener-command", children: [words.typeIt, " ", installed.map((host, index) => (_jsxs("span", { children: [index === 0 ? "" : " · ", _jsx("code", { children: host.command })] }, host.name)))] })] }));
28
- }
29
- const hostTitles = { claude: "Claude Code", codex: "Codex" };
30
- // The settings that keep each host's choice.
31
- const choiceKeys = {
32
- claude: { model: "claudeModel", effort: "claudeEffort" },
33
- codex: { model: "codexModel", effort: "codexEffort" },
34
- };
35
- /** A host's model or effort: a dash keeps the host's own; a choice it no longer offers shows as the dash. Its title says what it stands at, the dash too. */
36
- function Choice({ host, kind, settings, onChange, text }) {
37
- const key = choiceKeys[host.name][kind];
38
- const offered = kind === "model" ? host.models : host.efforts;
39
- const chosen = offered.includes(settings[key]) ? settings[key] : "";
40
- const title = hostTitles[host.name] ?? host.name;
41
- if (offered.length === 0) {
42
- return null;
43
- }
44
- return (_jsxs("select", { "aria-label": `${text.table[kind]}, ${title}`, title: `${text.table[kind]}: ${chosen === "" ? text.table.asHost(title) : chosen}`, value: chosen, onChange: (event) => onChange({ ...settings, [key]: event.currentTarget.value }), children: [_jsx("option", { value: "", children: "\u2014" }), offered.map((value) => _jsx("option", { value: value, children: shortName(value) }, value))] }));
45
- }
46
- // Codex's models without the "gpt-" they all start with, so the choice fits beside the button in the column; the title keeps the whole name.
47
- function shortName(value) {
48
- return value.replace(/^gpt-/, "");
49
- }
50
- /** Asks the table to open a terminal with a chat in the host: whether it did. */
51
- async function openChat(host) {
52
- try {
53
- const response = await fetch("/api/table/chat", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ host }) });
54
- return response.ok && (await response.json()).opened === true;
55
- }
56
- catch {
57
- return false;
58
- }
59
- }
File without changes
File without changes