chesspal 0.3.1 → 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.
- package/README.md +1 -1
- package/dist/cli/cli.js +6 -6
- package/dist/commands/{analyse-game.d.ts → analysis/analyse.d.ts} +2 -2
- package/dist/commands/{analyse-game.js → analysis/analyse.js} +7 -11
- package/dist/commands/{annotate-game.d.ts → analysis/annotate.d.ts} +1 -1
- package/dist/commands/{annotate-game.js → analysis/annotate.js} +6 -9
- package/dist/commands/{delete-review.d.ts → analysis/delete-review.d.ts} +1 -1
- package/dist/commands/{delete-review.js → analysis/delete-review.js} +5 -5
- package/dist/commands/analysis/index.d.ts +4 -0
- package/dist/commands/analysis/index.js +5 -0
- package/dist/commands/{study-games.d.ts → analysis/study-games.d.ts} +1 -1
- package/dist/commands/{study-games.js → analysis/study-games.js} +4 -5
- package/dist/commands/{agents.d.ts → answers/agents.d.ts} +3 -3
- package/dist/commands/{agents.js → answers/agents.js} +5 -5
- package/dist/commands/{clock.d.ts → answers/clock.d.ts} +2 -2
- package/dist/commands/{clock.js → answers/clock.js} +2 -2
- package/dist/commands/{drawings.d.ts → answers/drawings.d.ts} +1 -1
- package/dist/commands/{drawings.js → answers/drawings.js} +1 -1
- package/dist/commands/answers/index.d.ts +12 -0
- package/dist/commands/answers/index.js +14 -0
- package/dist/commands/{lead-input.d.ts → answers/lead-input.d.ts} +1 -1
- package/dist/commands/{lead-input.js → answers/lead-input.js} +1 -1
- package/dist/commands/{answer-lines.d.ts → answers/lines.d.ts} +2 -2
- package/dist/commands/{answer-lines.js → answers/lines.js} +4 -4
- package/dist/commands/{opening-book.d.ts → answers/opening-book.d.ts} +1 -1
- package/dist/commands/{opening-book.js → answers/opening-book.js} +3 -3
- package/dist/commands/{play-move.d.ts → answers/play-move.d.ts} +2 -2
- package/dist/commands/{play-move.js → answers/play-move.js} +3 -3
- package/dist/commands/{say.d.ts → answers/say.d.ts} +3 -3
- package/dist/commands/{say.js → answers/say.js} +4 -4
- package/dist/commands/{speech.js → answers/speech.js} +1 -1
- package/dist/commands/{study.d.ts → answers/study.d.ts} +3 -3
- package/dist/commands/{study.js → answers/study.js} +3 -3
- package/dist/commands/{game-summary.d.ts → answers/summary.d.ts} +2 -2
- package/dist/commands/{game-summary.js → answers/summary.js} +4 -4
- package/dist/commands/{view.d.ts → answers/view.d.ts} +1 -1
- package/dist/commands/{ai-move.d.ts → game/ai-move.d.ts} +2 -2
- package/dist/commands/{ai-move.js → game/ai-move.js} +6 -11
- package/dist/commands/{coach.d.ts → game/coach.d.ts} +1 -1
- package/dist/commands/{coach.js → game/coach.js} +7 -13
- package/dist/commands/{draw-offer.d.ts → game/draw-offer.d.ts} +1 -1
- package/dist/commands/{draw-offer.js → game/draw-offer.js} +4 -4
- package/dist/commands/{end-game.d.ts → game/end.d.ts} +2 -2
- package/dist/commands/{end-game.js → game/end.js} +5 -9
- package/dist/commands/{export-game.d.ts → game/export.d.ts} +1 -1
- package/dist/commands/{export-game.js → game/export.js} +4 -4
- package/dist/commands/game/index.d.ts +11 -0
- package/dist/commands/game/index.js +13 -0
- package/dist/commands/{levels.d.ts → game/levels.d.ts} +3 -3
- package/dist/commands/{levels.js → game/levels.js} +3 -3
- package/dist/commands/{look.d.ts → game/look.d.ts} +3 -4
- package/dist/commands/{look.js → game/look.js} +5 -10
- package/dist/commands/{new-game.d.ts → game/new.d.ts} +3 -4
- package/dist/commands/{new-game.js → game/new.js} +17 -13
- package/dist/commands/{page-link.d.ts → game/page-link.d.ts} +1 -1
- package/dist/commands/{player-move.d.ts → game/player-move.d.ts} +2 -2
- package/dist/commands/{player-move.js → game/player-move.js} +4 -8
- package/dist/commands/{ponder.d.ts → game/ponder.d.ts} +3 -3
- package/dist/commands/{ponder.js → game/ponder.js} +6 -9
- package/dist/commands/{position.d.ts → game/position.d.ts} +2 -2
- package/dist/commands/{position.js → game/position.js} +5 -7
- package/dist/commands/{status.d.ts → game/status.d.ts} +2 -4
- package/dist/commands/{status.js → game/status.js} +12 -17
- package/dist/commands/index.d.ts +6 -17
- package/dist/commands/index.js +11 -38
- package/dist/commands/{delete-game.d.ts → profiles/delete-game.d.ts} +1 -1
- package/dist/commands/{delete-game.js → profiles/delete-game.js} +3 -3
- package/dist/commands/profiles/index.d.ts +4 -0
- package/dist/commands/profiles/index.js +5 -0
- package/dist/commands/{past-games.d.ts → profiles/past-games.d.ts} +1 -1
- package/dist/commands/{past-games.js → profiles/past-games.js} +5 -5
- package/dist/commands/{profiles.d.ts → profiles/profiles.d.ts} +7 -7
- package/dist/commands/{profiles.js → profiles/profiles.js} +4 -4
- package/dist/commands/{ratings.d.ts → profiles/ratings.d.ts} +1 -1
- package/dist/commands/{ratings.js → profiles/ratings.js} +2 -2
- package/dist/commands/{context.js → registry/context.js} +2 -2
- package/dist/commands/registry/index.d.ts +2 -0
- package/dist/commands/registry/index.js +3 -0
- package/dist/commands/setup/index.d.ts +2 -0
- package/dist/commands/setup/index.js +3 -0
- package/dist/commands/{init.d.ts → setup/init.d.ts} +1 -1
- package/dist/commands/{init.js → setup/init.js} +2 -3
- package/dist/commands/{instructions.d.ts → setup/instructions.d.ts} +2 -2
- package/dist/commands/{instructions.js → setup/instructions.js} +3 -3
- package/dist/commands/{ai-say.d.ts → talk/ai-say.d.ts} +2 -3
- package/dist/commands/{ai-say.js → talk/ai-say.js} +5 -9
- package/dist/commands/talk/index.d.ts +2 -0
- package/dist/commands/talk/index.js +3 -0
- package/dist/commands/{player-say.d.ts → talk/player-say.d.ts} +1 -1
- package/dist/commands/{player-say.js → talk/player-say.js} +4 -4
- package/dist/page/app/app.js +19 -11
- package/dist/page/app/served.js +7 -0
- package/dist/page/avatars/torretta.js +10 -3
- package/dist/page/dialogs/dialogs.css +10 -0
- package/dist/page/dialogs/profiles.js +1 -5
- package/dist/page/dialogs/settings.js +18 -4
- package/dist/page/game/column.js +1 -1
- package/dist/page/game/game.css +1 -1
- package/dist/page/guide/blocks.js +13 -2
- package/dist/page/guide/credits.js +6 -0
- package/dist/page/guide/drawings/analysis.js +13 -0
- package/dist/page/guide/drawings/drawings.css +329 -0
- package/dist/page/guide/drawings/drawings.js +15 -0
- package/dist/page/guide/drawings/game.js +15 -0
- package/dist/page/guide/drawings/helps.js +13 -0
- package/dist/page/guide/drawings/how-it-works.js +13 -0
- package/dist/page/guide/drawings/parts.js +103 -0
- package/dist/page/guide/drawings/players.js +19 -0
- package/dist/page/guide/drawings/talk.js +9 -0
- package/dist/page/guide/en.md +39 -25
- package/dist/page/guide/guide.css +123 -91
- package/dist/page/guide/guide.js +47 -25
- package/dist/page/guide/it.md +39 -25
- package/dist/page/guide/markdown.js +5 -0
- package/dist/page/helps/helps.css +127 -83
- package/dist/page/helps/helps.js +45 -26
- package/dist/page/helps/view.js +13 -3
- package/dist/page/{guide/foot.js → layout/footer.js} +7 -8
- package/dist/page/layout/header.js +5 -3
- package/dist/page/layout/layout.css +114 -10
- package/dist/page/layout/window.js +6 -26
- package/dist/page/main.js +1 -1
- package/dist/page/pieces/pieces.js +5 -2
- package/dist/page/style.css +1 -0
- package/dist/page/table/table.css +69 -0
- package/dist/page/table/update.js +82 -0
- package/dist/page/talk/chat.css +6 -6
- package/dist/page/talk/talk.css +17 -67
- package/dist/page/talk/talk.js +5 -5
- package/dist/page/talk/voice.js +12 -0
- package/dist/page/text.js +66 -18
- package/dist/page/theme.css +2 -0
- package/dist/server/{bell.js → bell/bell.js} +3 -3
- package/dist/server/bell/index.d.ts +1 -0
- package/dist/server/bell/index.js +2 -0
- package/dist/server/{caller.d.ts → mcp/caller.d.ts} +1 -1
- package/dist/server/{caller.js → mcp/caller.js} +1 -1
- package/dist/server/mcp/index.d.ts +1 -0
- package/dist/server/mcp/index.js +2 -0
- package/dist/server/{mcp.d.ts → mcp/mcp.d.ts} +1 -1
- package/dist/server/{mcp.js → mcp/mcp.js} +9 -9
- package/dist/server/page/game.js +16 -3
- package/dist/server/page/http.d.ts +1 -1
- package/dist/server/page/index.d.ts +3 -0
- package/dist/server/page/index.js +3 -0
- package/dist/server/page/page.d.ts +12 -3
- package/dist/server/page/page.js +13 -4
- package/dist/server/page/table.d.ts +7 -1
- package/dist/server/page/table.js +79 -3
- package/dist/server/page/update.d.ts +18 -0
- package/dist/server/page/update.js +40 -0
- package/dist/server/table/browser.d.ts +1 -1
- package/dist/server/table/browser.js +1 -1
- package/dist/server/table/hosts/chats.d.ts +1 -1
- package/dist/server/table/hosts/chats.js +2 -2
- package/dist/server/table/hosts/index.d.ts +1 -1
- package/dist/server/table/hosts/index.js +1 -1
- package/dist/server/table/hosts/play.d.ts +8 -1
- package/dist/server/table/hosts/play.js +40 -4
- package/dist/server/table/hosts/seat.d.ts +5 -1
- package/dist/server/table/hosts/seat.js +1 -1
- package/dist/server/table/index.d.ts +3 -2
- package/dist/server/table/index.js +3 -2
- package/dist/server/table/launch.d.ts +5 -2
- package/dist/server/table/launch.js +6 -3
- package/dist/server/table/link.d.ts +1 -1
- package/dist/server/table/link.js +3 -3
- package/dist/server/table/table.d.ts +4 -5
- package/dist/server/table/table.js +15 -12
- package/dist/server/table/update.d.ts +17 -0
- package/dist/server/table/update.js +77 -0
- package/dist/sites/index.d.ts +1 -1
- package/dist/sites/index.js +2 -2
- package/dist/version.d.ts +4 -0
- package/dist/version.js +12 -1
- package/package.json +1 -1
- /package/dist/commands/{speech.d.ts → answers/speech.d.ts} +0 -0
- /package/dist/commands/{view.js → answers/view.js} +0 -0
- /package/dist/commands/{page-link.js → game/page-link.js} +0 -0
- /package/dist/commands/{context.d.ts → registry/context.d.ts} +0 -0
- /package/dist/commands/{registry.d.ts → registry/registry.d.ts} +0 -0
- /package/dist/commands/{registry.js → registry/registry.js} +0 -0
- /package/dist/server/{bell.d.ts → bell/bell.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ Chesspal works with any agent that supports MCP tools and can work with the file
|
|
|
47
47
|
- **For the next game**, press New game: the AI the board page opened starts again with a clean chat by itself, once it has stopped working. In a chat you opened yourself, type `/clear` first: a long chat makes the AI slower and costs you more.
|
|
48
48
|
- **To play in a folder of your own**, as with the Claude desktop app, type `chesspal init chess`, then open your agent in the folder `chess` and say hello: the AI answers with the link to the board page. Any name will do; your games are kept [elsewhere](#where-your-games-are).
|
|
49
49
|
- **A move written in the chat** counts too: `e4`, `Nf3`, in the international notation (K Q R B N in every language), or in words.
|
|
50
|
-
- **To update**, close the AI's terminal, run `npm install -g chesspal` again, then `chesspal`. In a folder of your own, run `chesspal init` there too: it updates its own lines and keeps what you wrote there. In Codex, allow the hooks again when it says so.
|
|
50
|
+
- **To update**, when a new version is out the table's page shows an arrow at the top: press it between games, and the table installs it and starts again, with its chat. By hand: close the AI's terminal, run `npm install -g chesspal` again, then `chesspal`. In a folder of your own, run `chesspal init` there too: it updates its own lines and keeps what you wrote there. In Codex, allow the hooks again when it says so.
|
|
51
51
|
|
|
52
52
|
## Where your games are
|
|
53
53
|
|
package/dist/cli/cli.js
CHANGED
|
@@ -21,11 +21,11 @@ else if (args.length === 2 && args[0] === "play" && !args[1].startsWith("-")) {
|
|
|
21
21
|
}
|
|
22
22
|
else if (args.length === 1 && args[0] === "mcp") {
|
|
23
23
|
// The server and its SDK load only here: every other command starts faster without them.
|
|
24
|
-
const { startMcpServer } = await import("../server/mcp.js");
|
|
24
|
+
const { startMcpServer } = await import("../server/mcp/index.js");
|
|
25
25
|
await startMcpServer();
|
|
26
26
|
}
|
|
27
27
|
else if (args[0] === "listen" && (args.length === 1 || (args.length === 2 && args[1] === "--codex"))) {
|
|
28
|
-
const { listen } = await import("../server/bell.js");
|
|
28
|
+
const { listen } = await import("../server/bell/index.js");
|
|
29
29
|
await listen(args[1] === "--codex");
|
|
30
30
|
}
|
|
31
31
|
else if (args.length === 1 && args[0] === "chat") {
|
|
@@ -47,7 +47,7 @@ else {
|
|
|
47
47
|
* it asks first whether to put the icon on the desktop, before the page takes the screen; from the icon, which nobody reads, what went wrong is noted.
|
|
48
48
|
*/
|
|
49
49
|
async function openTableHere(fromTerminal) {
|
|
50
|
-
const [{
|
|
50
|
+
const [{ noteFailure, openTable }, { defaultContext }, { offerIcon }] = await Promise.all([import("../server/table/index.js"), import("../commands/index.js"), import("./icon.js")]);
|
|
51
51
|
const context = defaultContext();
|
|
52
52
|
try {
|
|
53
53
|
const icon = fromTerminal ? await offerIcon(context) : undefined;
|
|
@@ -60,7 +60,7 @@ async function openTableHere(fromTerminal) {
|
|
|
60
60
|
console.error(error.message);
|
|
61
61
|
process.exitCode = 1;
|
|
62
62
|
if (!fromTerminal) {
|
|
63
|
-
|
|
63
|
+
noteFailure(context, "open.log", error.message);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -94,10 +94,10 @@ async function playHere(host) {
|
|
|
94
94
|
}
|
|
95
95
|
/** The table, until it closes: `chesspal` alone starts it apart from the terminal. */
|
|
96
96
|
async function serveTable() {
|
|
97
|
-
const [{ startTable, tableTimes, terminalChats }, { defaultContext }] = await Promise.all([import("../server/table/index.js"), import("../commands/index.js")]);
|
|
97
|
+
const [{ npmUpdater, startTable, tableTimes, terminalChats }, { defaultContext }] = await Promise.all([import("../server/table/index.js"), import("../commands/index.js")]);
|
|
98
98
|
try {
|
|
99
99
|
const context = defaultContext();
|
|
100
|
-
const table = await startTable(context, tableTimes, terminalChats(context));
|
|
100
|
+
const table = await startTable(context, tableTimes, terminalChats(context), npmUpdater(context));
|
|
101
101
|
console.log(table === undefined ? "Another Chesspal table, started at the same time, is open: this one closes." : `Chesspal's table: ${table.url}`);
|
|
102
102
|
await table?.closed;
|
|
103
103
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type AiLevel, type MoveReview, type PieceLetter, type Side } from "
|
|
2
|
+
import { type AiLevel, type MoveReview, type PieceLetter, type Side } from "../../core/index.ts";
|
|
3
3
|
/** A move as the analysis gives it: what happened, never how good it was (D-6). */
|
|
4
4
|
interface MoveFacts {
|
|
5
5
|
/** The move, numbered: 12...Nxe5. */
|
|
@@ -64,7 +64,7 @@ interface Analysis {
|
|
|
64
64
|
review?: string;
|
|
65
65
|
}
|
|
66
66
|
/** A game over move by move, for the analyst (D-68): the current one, one of the archive or kept to study, or one the player brings as a PGN, kept to study. */
|
|
67
|
-
export declare const analyseGame: import("
|
|
67
|
+
export declare const analyseGame: import("../registry/registry.ts").Command<z.ZodObject<{
|
|
68
68
|
game: z.ZodOptional<z.ZodString>;
|
|
69
69
|
pgn: z.ZodOptional<z.ZodString>;
|
|
70
70
|
}, z.core.$strip>, Analysis>;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
// The analyst's tool (D-21, D-68): a game over, move by move in one call, facts only and never a judgment, with the analyst's instructions once in a chat.
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { clockOfComment, clockText, closingOf, Game, gameReviewOf, isReviewed, leadOf, leadText, levelOf, materialOf, readPgn, reviewed, reviewOf, timeControlOfTag, timeControlText, withGameReview, withLead, } from "
|
|
4
|
-
import { gameInAnalysis, isGameName, keepToStudy, lastChatStart, planOf, rewriteGame, startAnalysis } from "
|
|
5
|
-
import { analystAgent, instructionsFile } from "
|
|
6
|
-
import { activeProfile, gameFolder } from "
|
|
7
|
-
import { analystOf, anotherAnalyst } from "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { defineCommand } from "./registry.js";
|
|
11
|
-
import { speechLine, speechOf } from "./speech.js";
|
|
12
|
-
import { gameToStudy, knownTag, moveNumbers, namedGame, noGameGoingOn } from "./study.js";
|
|
13
|
-
import { balanceText, colourName, riskLine, tacticsText } from "./view.js";
|
|
3
|
+
import { clockOfComment, clockText, closingOf, Game, gameReviewOf, isReviewed, leadOf, leadText, levelOf, materialOf, readPgn, reviewed, reviewOf, timeControlOfTag, timeControlText, withGameReview, withLead, } from "../../core/index.js";
|
|
4
|
+
import { gameInAnalysis, isGameName, keepToStudy, lastChatStart, planOf, rewriteGame, startAnalysis } from "../../games/index.js";
|
|
5
|
+
import { analystAgent, instructionsFile } from "../../host-files/index.js";
|
|
6
|
+
import { activeProfile, gameFolder } from "../../profiles/index.js";
|
|
7
|
+
import { analystOf, anotherAnalyst, balanceText, bookOpening, bookReaches, colourName, gameToStudy, knownTag, moveNumbers, namedGame, noGameGoingOn, riskLine, speechLine, speechOf, tacticsText } from "../answers/index.js";
|
|
8
|
+
import { playerLine } from "../profiles/index.js";
|
|
9
|
+
import { defineCommand } from "../registry/index.js";
|
|
14
10
|
/** A game over move by move, for the analyst (D-68): the current one, one of the archive or kept to study, or one the player brings as a PGN, kept to study. */
|
|
15
11
|
export const analyseGame = defineCommand({
|
|
16
12
|
name: "analyse_game",
|
|
@@ -16,7 +16,7 @@ interface Annotated {
|
|
|
16
16
|
summaryStands: boolean;
|
|
17
17
|
}
|
|
18
18
|
/** The AI's badges and notes on a game over, and its word on the whole game, written into the game's PGN (D-69). */
|
|
19
|
-
export declare const annotateGame: import("
|
|
19
|
+
export declare const annotateGame: import("../registry/registry.ts").Command<z.ZodObject<{
|
|
20
20
|
game: z.ZodOptional<z.ZodString>;
|
|
21
21
|
notes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
22
22
|
move: z.ZodString;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
// The AI's review of a game over (D-69): a badge on each move that matters, as chess.com marks them, with a note when it needs one, and its word on the
|
|
2
2
|
// whole game, kept in the game's PGN for the board page. The judgment is the AI's alone: Chesspal gives no criteria (D-6, D-43).
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { annotatorOf, badges, Game, gameReviewOf, leadOf, reviewed, reviewOf, withAnnotator, withGameReview, withLead } from "
|
|
5
|
-
import { gameInAnalysis, rewriteGame, startAnalysis } from "
|
|
6
|
-
import { analystAgent } from "
|
|
7
|
-
import { gameFolder } from "
|
|
8
|
-
import { analystOf, analystRuns, anotherAnalyst } from "
|
|
9
|
-
import {
|
|
10
|
-
import { leadFrom } from "./lead-input.js";
|
|
11
|
-
import { defineCommand } from "./registry.js";
|
|
12
|
-
import { moveIndex, moveNumbers, namedGame, noGameGoingOn } from "./study.js";
|
|
4
|
+
import { annotatorOf, badges, Game, gameReviewOf, leadOf, reviewed, reviewOf, withAnnotator, withGameReview, withLead } from "../../core/index.js";
|
|
5
|
+
import { gameInAnalysis, rewriteGame, startAnalysis } from "../../games/index.js";
|
|
6
|
+
import { analystAgent } from "../../host-files/index.js";
|
|
7
|
+
import { gameFolder } from "../../profiles/index.js";
|
|
8
|
+
import { analystOf, analystRuns, anotherAnalyst, arrowsInput, drawingsOf, leadFrom, moveIndex, moveNumbers, namedGame, noGameGoingOn, noteInput, squaresInput } from "../answers/index.js";
|
|
9
|
+
import { defineCommand } from "../registry/index.js";
|
|
13
10
|
const summaryLimit = 1500;
|
|
14
11
|
const closingLimit = 400;
|
|
15
12
|
// How many moves still without who is ahead the answer names; the rest it counts.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/** Deletes the review of a game of the profile in use, by its name as past_games or study_games writes it. */
|
|
3
|
-
export declare const deleteReview: import("
|
|
3
|
+
export declare const deleteReview: import("../registry/registry.ts").Command<z.ZodObject<{
|
|
4
4
|
game: z.ZodString;
|
|
5
5
|
}, z.core.$strip>, {
|
|
6
6
|
game: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// A game's review deleted (D-92): the game stays, to analyse again, with another model or effort or after an update. Only the command line and the page
|
|
2
2
|
// delete, never the AI.
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { isReviewed, unreviewed } from "
|
|
5
|
-
import { forgetAnalyst, forgetCoach, gameInAnalysis, isOverOnTable, rewriteGame, startAnalysis } from "
|
|
6
|
-
import { gameFolder } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { isReviewed, unreviewed } from "../../core/index.js";
|
|
5
|
+
import { forgetAnalyst, forgetCoach, gameInAnalysis, isOverOnTable, rewriteGame, startAnalysis } from "../../games/index.js";
|
|
6
|
+
import { gameFolder } from "../../profiles/index.js";
|
|
7
|
+
import { namedGame } from "../answers/index.js";
|
|
8
|
+
import { defineCommand } from "../registry/index.js";
|
|
9
9
|
/** Deletes the review of a game of the profile in use, by its name as past_games or study_games writes it. */
|
|
10
10
|
export const deleteReview = defineCommand({
|
|
11
11
|
name: "delete_review",
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// The commands on a game over or kept to study: the analyst's analysis and review, the games kept and the reviews deleted.
|
|
2
|
+
export { analyseGame } from "./analyse.js";
|
|
3
|
+
export { annotateGame } from "./annotate.js";
|
|
4
|
+
export { deleteReview } from "./delete-review.js";
|
|
5
|
+
export { studyGames } from "./study-games.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/** The games kept to study, one line each, the latest kept first. */
|
|
3
|
-
export declare const studyGames: import("
|
|
3
|
+
export declare const studyGames: import("../registry/registry.ts").Command<z.ZodObject<{}, z.core.$strip>, {
|
|
4
4
|
games: string[];
|
|
5
5
|
}>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// The games kept to study (D-68): played elsewhere and brought to analyse_game as a PGN, in the folder of the profile that brought them.
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { keptGame, keptGames } from "
|
|
4
|
-
import { gameFolder } from "
|
|
5
|
-
import { openingName } from "
|
|
6
|
-
import { defineCommand } from "
|
|
7
|
-
import { knownTag } from "./study.js";
|
|
3
|
+
import { keptGame, keptGames } from "../../games/index.js";
|
|
4
|
+
import { gameFolder } from "../../profiles/index.js";
|
|
5
|
+
import { knownTag, openingName } from "../answers/index.js";
|
|
6
|
+
import { defineCommand } from "../registry/index.js";
|
|
8
7
|
/** The games kept to study, one line each, the latest kept first. */
|
|
9
8
|
export const studyGames = defineCommand({
|
|
10
9
|
name: "study_games",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type CurrentGame } from "
|
|
2
|
-
import type { Context } from "
|
|
3
|
-
import { type GameSummary } from "./
|
|
1
|
+
import { type CurrentGame } from "../../games/index.ts";
|
|
2
|
+
import type { Context } from "../registry/index.ts";
|
|
3
|
+
import { type GameSummary } from "./summary.ts";
|
|
4
4
|
/** Whether an analyst agent goes over a game over when the player wants: in Claude Code or Codex, with its agent in the player's folder (D-89, D-98). */
|
|
5
5
|
export declare function analystRuns(context: Context): boolean;
|
|
6
6
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// The agents that work beside the chat in Claude Code and Codex (D-98): the analyst that goes over a game over (D-89) and the coach that judges the player's moves (D-88).
|
|
2
|
-
import { isReviewed } from "
|
|
3
|
-
import { archivedName, coachStarted, gameInAnalysis, lastChatStart } from "
|
|
4
|
-
import { agentHosts, analystAgent, coachAgent, hasAgent } from "
|
|
5
|
-
import { gameFolder, helpsIn } from "
|
|
6
|
-
import { unplayed } from "./game-summary.js";
|
|
2
|
+
import { isReviewed } from "../../core/index.js";
|
|
3
|
+
import { archivedName, coachStarted, gameInAnalysis, lastChatStart } from "../../games/index.js";
|
|
4
|
+
import { agentHosts, analystAgent, coachAgent, hasAgent } from "../../host-files/index.js";
|
|
5
|
+
import { gameFolder, helpsIn } from "../../profiles/index.js";
|
|
7
6
|
import { namedGame } from "./study.js";
|
|
7
|
+
import { unplayed } from "./summary.js";
|
|
8
8
|
/** Whether an analyst agent goes over a game over when the player wants: in Claude Code or Codex, with its agent in the player's folder (D-89, D-98). */
|
|
9
9
|
export function analystRuns(context) {
|
|
10
10
|
return agentRuns(context, analystAgent);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Side } from "
|
|
2
|
-
import { type CurrentGame } from "
|
|
1
|
+
import { type Side } from "../../core/index.ts";
|
|
2
|
+
import { type CurrentGame } from "../../games/index.ts";
|
|
3
3
|
/** What the AI reads of the clock: the time control, and the time each side has left when the command ran, in milliseconds. */
|
|
4
4
|
export interface ClockSummary {
|
|
5
5
|
control: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The clock in the commands (D-13): a flag that falls ends the game as soon as a command reads it, and the clock's line for the AI.
|
|
2
|
-
import { canMate, clockText, Game, timeControlText, timeLeft } from "
|
|
3
|
-
import { archiveEnded, endOf, loadGame, saveGame } from "
|
|
2
|
+
import { canMate, clockText, Game, timeControlText, timeLeft } from "../../core/index.js";
|
|
3
|
+
import { archiveEnded, endOf, loadGame, saveGame } from "../../games/index.js";
|
|
4
4
|
import { colourName } from "./view.js";
|
|
5
5
|
/** The current game of a folder `now`, or undefined: a game whose side to move has run out of time is over, saved and archived first. */
|
|
6
6
|
export function gameAt(folder, now) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type DrawnArrow, type DrawnSquare } from "
|
|
2
|
+
import { type DrawnArrow, type DrawnSquare } from "../../core/index.ts";
|
|
3
3
|
/** A note of the AI's on a move, as its input reads it: on one line of commands, so without brackets or braces. */
|
|
4
4
|
export declare const noteInput: z.ZodString;
|
|
5
5
|
/** The arrows the AI draws, as their input reads them. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// What the AI draws on the board to show what it says, as the analyst (D-69) and the opponent with the helps on (D-78): arrows and squares, as PGN's
|
|
2
2
|
// %cal and %csl write them.
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { arrowOf, squareOf } from "
|
|
4
|
+
import { arrowOf, squareOf } from "../../core/index.js";
|
|
5
5
|
/** The most a note of the AI's on a move may hold: a few sentences. */
|
|
6
6
|
const noteLimit = 700;
|
|
7
7
|
// The most arrows, and the most squares, on one move.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { agentRuns, agentsLine, analystLine, analystOf, analystRuns, anotherAnalyst, coachOnEnd, coachOnEndLine, coachRuns, goneOver, reviewedLine, withAnalyst } from "./agents.ts";
|
|
2
|
+
export { clockLine, clockSummaryOf, gameAt } from "./clock.ts";
|
|
3
|
+
export { arrowsInput, drawingsOf, noteInput, squaresInput } from "./drawings.ts";
|
|
4
|
+
export { aheadWords, leadFrom, leadInput } from "./lead-input.ts";
|
|
5
|
+
export { closingLines, headLines, lastMoveText, moveLines, newGameStep, nextStep, positionLines, shownMove, shownMoves, sidesLine, wordLines } from "./lines.ts";
|
|
6
|
+
export { bookOpening, bookPlies, bookReaches, knownMoves, openingLine, openingName } from "./opening-book.ts";
|
|
7
|
+
export { playMove, PositionChanged, positionIn, refuseOtherGame, refuseUnseenPosition, samePosition } from "./play-move.ts";
|
|
8
|
+
export { give, newWords, say, unansweredWords, waitingWords, type Written } from "./say.ts";
|
|
9
|
+
export { type Speech, speechLine, speechOf } from "./speech.ts";
|
|
10
|
+
export { gameShown, gameToStudy, knownTag, moveIndex, moveNumbers, namedGame, noGameGoingOn, positionAfter, positionLine, shownPosition, type Studied, studyInput } from "./study.ts";
|
|
11
|
+
export { gameGoingOn, type GameSummary, lastMoves, type MovePlayed, summaryOf, withThought } from "./summary.ts";
|
|
12
|
+
export { balanceText, boardView, colourName, compactView, fullView, materialText, riskLine, tacticsText } from "./view.ts";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// What the commands share to answer the AI: the lines it reads, the game's summary and view, the clock, the talk, the moves played, the games to study.
|
|
2
|
+
// Above the registry only, below every other command folder.
|
|
3
|
+
export { agentRuns, agentsLine, analystLine, analystOf, analystRuns, anotherAnalyst, coachOnEnd, coachOnEndLine, coachRuns, goneOver, reviewedLine, withAnalyst } from "./agents.js";
|
|
4
|
+
export { clockLine, clockSummaryOf, gameAt } from "./clock.js";
|
|
5
|
+
export { arrowsInput, drawingsOf, noteInput, squaresInput } from "./drawings.js";
|
|
6
|
+
export { aheadWords, leadFrom, leadInput } from "./lead-input.js";
|
|
7
|
+
export { closingLines, headLines, lastMoveText, moveLines, newGameStep, nextStep, positionLines, shownMove, shownMoves, sidesLine, wordLines } from "./lines.js";
|
|
8
|
+
export { bookOpening, bookPlies, bookReaches, knownMoves, openingLine, openingName } from "./opening-book.js";
|
|
9
|
+
export { playMove, PositionChanged, positionIn, refuseOtherGame, refuseUnseenPosition, samePosition } from "./play-move.js";
|
|
10
|
+
export { give, newWords, say, unansweredWords, waitingWords } from "./say.js";
|
|
11
|
+
export { speechLine, speechOf } from "./speech.js";
|
|
12
|
+
export { gameShown, gameToStudy, knownTag, moveIndex, moveNumbers, namedGame, noGameGoingOn, positionAfter, positionLine, shownPosition, studyInput } from "./study.js";
|
|
13
|
+
export { gameGoingOn, lastMoves, summaryOf, withThought } from "./summary.js";
|
|
14
|
+
export { balanceText, boardView, colourName, compactView, fullView, materialText, riskLine, tacticsText } from "./view.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type Lead } from "
|
|
2
|
+
import { type Lead } from "../../core/index.ts";
|
|
3
3
|
/** A lead as its input reads it: pawns from White's side as a number, +1.5 or -3, or a mate it sees, "#3" White's or "#-3" Black's. */
|
|
4
4
|
export declare const leadInput: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
5
5
|
/** Who is ahead in words, the side and by how much, so that the AI reads its own sign back (Anatolij). */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Who is ahead as the AI gives it (D-90): the analyst after each move of a game over, the coach in the position the player is to move in.
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { readLead } from "
|
|
3
|
+
import { readLead } from "../../core/index.js";
|
|
4
4
|
/** A lead as its input reads it: pawns from White's side as a number, +1.5 or -3, or a mate it sees, "#3" White's or "#-3" Black's. */
|
|
5
5
|
export const leadInput = z.union([z.number(), z.string()]).refine((value) => readLead(String(value)) !== undefined, leadRule());
|
|
6
6
|
/** Who is ahead in words, the side and by how much, so that the AI reads its own sign back (Anatolij). */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Side } from "
|
|
2
|
-
import { type GameSummary, type LastMove, type MovePlayed } from "./game-summary.ts";
|
|
1
|
+
import { type Side } from "../../core/index.ts";
|
|
3
2
|
import type { Written } from "./say.ts";
|
|
3
|
+
import { type GameSummary, type LastMove, type MovePlayed } from "./summary.ts";
|
|
4
4
|
/** Where the game stands: the AI's position to decide on, with its last move unless the lines before named it; the player's turn; or how it ended. */
|
|
5
5
|
export declare function positionLines(game: GameSummary, withLastMove?: boolean): string[];
|
|
6
6
|
/** The head of a view: where the game stands, the last move unless the lines before named it, the opening, the material as the player sees it, and the FEN. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// The lines an AI reads in a tool's answer about the current game: where it stands, the move just played, the player's words and what to do next.
|
|
2
|
-
import { figurinesOf, materialOf, sees } from "
|
|
3
|
-
import { talkLimits } from "
|
|
4
|
-
import { onQuickModel } from "
|
|
2
|
+
import { figurinesOf, materialOf, sees } from "../../core/index.js";
|
|
3
|
+
import { talkLimits } from "../../games/index.js";
|
|
4
|
+
import { onQuickModel } from "../../host-files/index.js";
|
|
5
5
|
import { analystLine, reviewedLine } from "./agents.js";
|
|
6
6
|
import { clockLine } from "./clock.js";
|
|
7
|
-
import { endText, unplayed } from "./
|
|
7
|
+
import { endText, unplayed } from "./summary.js";
|
|
8
8
|
import { boardView, colourName, compactView, materialText } from "./view.js";
|
|
9
9
|
/** Where the game stands: the AI's position to decide on, with its last move unless the lines before named it; the player's turn; or how it ended. */
|
|
10
10
|
export function positionLines(game, withLastMove = true) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type GameRecord, type Opening } from "
|
|
1
|
+
import { type GameRecord, type Opening } from "../../core/index.ts";
|
|
2
2
|
/** The game's opening as the AI reads it: ECO and name, and the move it left the book at; none outside the book, or where the build made no index. */
|
|
3
3
|
export declare function openingLine(record: GameRecord): string | undefined;
|
|
4
4
|
/** The moves the book knows from a position (D-15), for the AI at the master level; none out of the book, or where the build made no book. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The book of the openings the build indexed (D-16), read once at the first lookup; the book's moves, only for a game at the master level (D-60).
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
|
-
import { bookMoves, Game, inOpenings, openingOf, outOfBookMove } from "
|
|
3
|
+
import { bookMoves, Game, inOpenings, openingOf, outOfBookMove } from "../../core/index.js";
|
|
4
4
|
// The index of the named openings and the book of their moves, each read at its first lookup; null where the build made none.
|
|
5
5
|
let index;
|
|
6
6
|
let book;
|
|
@@ -61,7 +61,7 @@ function lineOf(record) {
|
|
|
61
61
|
function openingBook() {
|
|
62
62
|
if (book === undefined) {
|
|
63
63
|
try {
|
|
64
|
-
book = JSON.parse(readFileSync(new URL("
|
|
64
|
+
book = JSON.parse(readFileSync(new URL("../../../dist/core/book.json", import.meta.url), "utf8"));
|
|
65
65
|
}
|
|
66
66
|
catch {
|
|
67
67
|
// Not built yet: the master goes without the book.
|
|
@@ -73,7 +73,7 @@ function openingBook() {
|
|
|
73
73
|
function openingIndex() {
|
|
74
74
|
if (index === undefined) {
|
|
75
75
|
try {
|
|
76
|
-
index = JSON.parse(readFileSync(new URL("
|
|
76
|
+
index = JSON.parse(readFileSync(new URL("../../../dist/core/openings.json", import.meta.url), "utf8"));
|
|
77
77
|
}
|
|
78
78
|
catch {
|
|
79
79
|
// Not built yet: the views go without the opening.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Context, SeenPosition } from "
|
|
2
|
-
import { type MovePlayed } from "./
|
|
1
|
+
import type { Context, SeenPosition } from "../registry/index.ts";
|
|
2
|
+
import { type MovePlayed } from "./summary.ts";
|
|
3
3
|
/** Who plays a move: the AI, or the player through the AI. */
|
|
4
4
|
export type Mover = "ai" | "player";
|
|
5
5
|
/** What comes with a move: the AI's comment, or the player's words from the board page, saved with it, and a draw offer (D-65). */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// A move of the AI or of the player on the current game: played, timed by the clock, saved, and archived when it ends the game.
|
|
2
|
-
import { clockAfterMove, clockTag } from "
|
|
3
|
-
import { archiveEnded, endOf, loadGame, saveGame, talkLine } from "
|
|
4
|
-
import { gameGoingOn, summaryOf, withThought } from "./
|
|
2
|
+
import { clockAfterMove, clockTag } from "../../core/index.js";
|
|
3
|
+
import { archiveEnded, endOf, loadGame, saveGame, talkLine } from "../../games/index.js";
|
|
4
|
+
import { gameGoingOn, summaryOf, withThought } from "./summary.js";
|
|
5
5
|
import { colourName } from "./view.js";
|
|
6
6
|
/**
|
|
7
7
|
* Plays a move for one side `now` and saves the game, with the time it took and the clock after it in its comment ([%clk]). A refused move, or words refused
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Mood } from "
|
|
2
|
-
import { type Sayer, type Shown, type Talk, type Words } from "
|
|
3
|
-
import type { Context } from "
|
|
1
|
+
import { type Mood } from "../../core/index.ts";
|
|
2
|
+
import { type Sayer, type Shown, type Talk, type Words } from "../../games/index.ts";
|
|
3
|
+
import type { Context } from "../registry/index.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Adds a line to the talk of the current game, going on or just over, and saves it; the AI's mood once the game is over, which the archive keeps too (D-70).
|
|
6
6
|
* With no game the line goes in the talk before it (D-77). A line refused changes nothing: it throws, in words for whoever spoke.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// The talk on the board page (D-51): a line of the player's or the AI's, saved with the game, and the player's words the AI has not been given yet.
|
|
2
|
-
import { endWithMood } from "
|
|
3
|
-
import { archiveEnded, endOf, gameInAnalysis, loadGame, loadTableTalk, saveGame, saveTableTalk, talkLimits, talkLine, unheardWords } from "
|
|
4
|
-
import { gameFolder, helpsIn } from "
|
|
5
|
-
import { shownMove } from "./answer-lines.js";
|
|
2
|
+
import { endWithMood } from "../../core/index.js";
|
|
3
|
+
import { archiveEnded, endOf, gameInAnalysis, loadGame, loadTableTalk, saveGame, saveTableTalk, talkLimits, talkLine, unheardWords } from "../../games/index.js";
|
|
4
|
+
import { gameFolder, helpsIn } from "../../profiles/index.js";
|
|
6
5
|
import { gameAt } from "./clock.js";
|
|
6
|
+
import { shownMove } from "./lines.js";
|
|
7
7
|
/**
|
|
8
8
|
* Adds a line to the talk of the current game, going on or just over, and saves it; the AI's mood once the game is over, which the archive keeps too (D-70).
|
|
9
9
|
* With no game the line goes in the talk before it (D-77). A line refused changes nothing: it throws, in words for whoever spoke.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// The player's language, which the AI is told once a chat when it is not English: the moves stay in SAN (D-87).
|
|
2
|
-
import { languageIn } from "
|
|
2
|
+
import { languageIn } from "../../profiles/index.js";
|
|
3
3
|
/** The player's speech, from the page's settings or the system's language; undefined in English, which the AI speaks unless told. */
|
|
4
4
|
export function speechOf(folder, systemLanguage) {
|
|
5
5
|
const language = languageName(languageIn(folder, systemLanguage));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { Game, type GameRecord } from "
|
|
3
|
-
import { type CurrentGame, type Shown } from "
|
|
4
|
-
import type { Context } from "
|
|
2
|
+
import { Game, type GameRecord } from "../../core/index.ts";
|
|
3
|
+
import { type CurrentGame, type Shown } from "../../games/index.ts";
|
|
4
|
+
import type { Context } from "../registry/index.ts";
|
|
5
5
|
/** What look and position take to show any position of a game that is over. */
|
|
6
6
|
export declare const studyInput: {
|
|
7
7
|
game: z.ZodOptional<z.ZodString>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// A game to study (D-68): one that is over, played here or kept to study, and any position of it, by its moves as the analysis numbers them. While a game
|
|
2
2
|
// goes on, nothing is studied: the analysis would help the game being played (D-60, D-62).
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { Game } from "
|
|
5
|
-
import { archivedGame, archivedGames, archivedName, endOf, gameInAnalysis, keptGame, listedName } from "
|
|
6
|
-
import { gameFolder } from "
|
|
4
|
+
import { Game } from "../../core/index.js";
|
|
5
|
+
import { archivedGame, archivedGames, archivedName, endOf, gameInAnalysis, keptGame, listedName } from "../../games/index.js";
|
|
6
|
+
import { gameFolder } from "../../profiles/index.js";
|
|
7
7
|
import { gameAt } from "./clock.js";
|
|
8
8
|
import { colourName } from "./view.js";
|
|
9
9
|
/** What look and position take to show any position of a game that is over. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type AiLevel, type Chances, type Facts, type GameRecord, type MoodNow, type Possibilities, type Side, type Square } from "
|
|
2
|
-
import { type CurrentGame, type Speaker, type Thought } from "
|
|
1
|
+
import { type AiLevel, type Chances, type Facts, type GameRecord, type MoodNow, type Possibilities, type Side, type Square } from "../../core/index.ts";
|
|
2
|
+
import { type CurrentGame, type Speaker, type Thought } from "../../games/index.ts";
|
|
3
3
|
import { type ClockSummary } from "./clock.ts";
|
|
4
4
|
import type { Written } from "./say.ts";
|
|
5
5
|
/** The current game, as the commands give it. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// The current game as the commands give it: plain data for the command line's JSON, from which
|
|
2
|
-
import { levelOf, moodAt, sees } from "
|
|
3
|
-
import { currentPlan, drawOfferOf, endOf, thoughtForLastMove } from "
|
|
4
|
-
import { helpsIn } from "
|
|
1
|
+
// The current game as the commands give it: plain data for the command line's JSON, from which lines.ts writes the lines an AI reads.
|
|
2
|
+
import { levelOf, moodAt, sees } from "../../core/index.js";
|
|
3
|
+
import { currentPlan, drawOfferOf, endOf, thoughtForLastMove } from "../../games/index.js";
|
|
4
|
+
import { helpsIn } from "../../profiles/index.js";
|
|
5
5
|
import { clockSummaryOf, gameAt } from "./clock.js";
|
|
6
6
|
import { knownMoves, openingLine } from "./opening-book.js";
|
|
7
7
|
/** The game as the commands tell it; a game over with the name it has in the archive, when it is there. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Chances, Facts, Material, Possibilities, Side } from "
|
|
1
|
+
import type { Chances, Facts, Material, Possibilities, Side } from "../../core/index.ts";
|
|
2
2
|
/** What the moves would do (D-100), and the other side's threats, none in check. */
|
|
3
3
|
export interface Possible {
|
|
4
4
|
readonly possibilities: Possibilities;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type MovePlayed } from "
|
|
2
|
+
import { type MovePlayed } from "../answers/index.ts";
|
|
3
3
|
/** The AI's move, with its plan, kept hidden (D-29), and its comment for the player when it has something to say (D-12, D-54). */
|
|
4
|
-
export declare const aiMove: import("
|
|
4
|
+
export declare const aiMove: import("../registry/registry.ts").Command<z.ZodObject<{
|
|
5
5
|
move: z.ZodString;
|
|
6
6
|
plan: z.ZodString;
|
|
7
7
|
comment: z.ZodOptional<z.ZodString>;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { boardText, drawingsText, moods, moodTag } from "
|
|
3
|
-
import { commentWithPlan, talkLimits } from "
|
|
4
|
-
import { coachAgent, ponderAgentFor } from "
|
|
5
|
-
import { gameFolder, helpsIn } from "
|
|
6
|
-
import { agentRuns, agentsLine, coachRuns, withAnalyst } from "
|
|
7
|
-
import {
|
|
8
|
-
import { arrowsInput, drawingsOf, squaresInput } from "./drawings.js";
|
|
9
|
-
import {} from "./game-summary.js";
|
|
10
|
-
import { playMove, refuseUnseenPosition } from "./play-move.js";
|
|
11
|
-
import { defineCommand, sentence } from "./registry.js";
|
|
12
|
-
import { give, waitingWords } from "./say.js";
|
|
2
|
+
import { boardText, drawingsText, moods, moodTag } from "../../core/index.js";
|
|
3
|
+
import { commentWithPlan, talkLimits } from "../../games/index.js";
|
|
4
|
+
import { coachAgent, ponderAgentFor } from "../../host-files/index.js";
|
|
5
|
+
import { gameFolder, helpsIn } from "../../profiles/index.js";
|
|
6
|
+
import { agentRuns, agentsLine, arrowsInput, closingLines, coachRuns, drawingsOf, give, moveLines, playMove, refuseUnseenPosition, shownMove, squaresInput, waitingWords, withAnalyst } from "../answers/index.js";
|
|
7
|
+
import { defineCommand, sentence } from "../registry/index.js";
|
|
13
8
|
/** The AI's move, with its plan, kept hidden (D-29), and its comment for the player when it has something to say (D-12, D-54). */
|
|
14
9
|
export const aiMove = defineCommand({
|
|
15
10
|
name: "ai_move",
|
|
@@ -21,7 +21,7 @@ interface Place {
|
|
|
21
21
|
* The coach (D-80, D-88), for the agent that judges the player's moves and gives them hints with the helps on: every fact, never the opponent's plan; its
|
|
22
22
|
* words go to the board page alone, never to the opponent. Its calls are not the chat's, and the server refuses them from the chat. Offered to Claude Code alone.
|
|
23
23
|
*/
|
|
24
|
-
export declare const coach: import("
|
|
24
|
+
export declare const coach: import("../registry/registry.ts").Command<z.ZodObject<{
|
|
25
25
|
game: z.ZodOptional<z.ZodString>;
|
|
26
26
|
position: z.ZodOptional<z.ZodInt>;
|
|
27
27
|
ahead: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { badges, Game, leadText, levelOf, materialOf, withSanLetters } from "
|
|
3
|
-
import { archiveCoached, coachWaitingSince, coachWords, endOf, keepHint, keepJudgment, keepLead, loadGame, startCoach } from "
|
|
4
|
-
import { agentHosts, coachAgent } from "
|
|
5
|
-
import { activeProfile, gameFolder, helpsIn } from "
|
|
6
|
-
import { clockLine, clockSummaryOf } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { aheadWords, leadFrom, leadInput } from "./lead-input.js";
|
|
10
|
-
import { knownMoves, openingLine } from "./opening-book.js";
|
|
2
|
+
import { badges, Game, leadText, levelOf, materialOf, withSanLetters } from "../../core/index.js";
|
|
3
|
+
import { archiveCoached, coachWaitingSince, coachWords, endOf, keepHint, keepJudgment, keepLead, loadGame, startCoach } from "../../games/index.js";
|
|
4
|
+
import { agentHosts, coachAgent } from "../../host-files/index.js";
|
|
5
|
+
import { activeProfile, gameFolder, helpsIn } from "../../profiles/index.js";
|
|
6
|
+
import { aheadWords, arrowsInput, clockLine, clockSummaryOf, colourName, compactView, drawingsOf, knownMoves, lastMoves, leadFrom, leadInput, materialText, noteInput, openingLine, riskLine, speechLine, speechOf, squaresInput, } from "../answers/index.js";
|
|
7
|
+
import { ratingsText } from "../profiles/index.js";
|
|
8
|
+
import { defineCommand } from "../registry/index.js";
|
|
11
9
|
import { waitForPlayer, wordsOf } from "./ponder.js";
|
|
12
10
|
import { profileLines } from "./position.js";
|
|
13
|
-
import { ratingsText } from "./profiles.js";
|
|
14
|
-
import { defineCommand } from "./registry.js";
|
|
15
|
-
import { speechLine, speechOf } from "./speech.js";
|
|
16
|
-
import { colourName, compactView, materialText, riskLine } from "./view.js";
|
|
17
11
|
// The badges the coach gives: the book's is Chesspal's, never a judgment (D-69).
|
|
18
12
|
const judgments = badges.filter((badge) => badge !== "book");
|
|
19
13
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Context } from "
|
|
1
|
+
import type { Context } from "../registry/index.ts";
|
|
2
2
|
/** A draw offer or answer refused, and why, for the page to say it in the player's language: one stands already, none stands, or no side has moved yet. */
|
|
3
3
|
export declare class DrawRefused extends Error {
|
|
4
4
|
readonly reason: "offered" | "none" | "early";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// The draw offers of the board page (D-65): the player's, made on their turn as on Lichess, and their answer to the AI's, which ai_move makes with its move.
|
|
2
|
-
import { bothSidesMoved, drawOfferOf, saveGame } from "
|
|
3
|
-
import { gameFolder } from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { bothSidesMoved, drawOfferOf, saveGame } from "../../games/index.js";
|
|
3
|
+
import { gameFolder } from "../../profiles/index.js";
|
|
4
|
+
import { gameGoingOn } from "../answers/index.js";
|
|
5
|
+
import { endGame } from "./end.js";
|
|
6
6
|
/** A draw offer or answer refused, and why, for the page to say it in the player's language: one stands already, none stands, or no side has moved yet. */
|
|
7
7
|
export class DrawRefused extends Error {
|
|
8
8
|
reason;
|