引入游玩回合与开场收口,抽出可替换 agent 司机并支持运行中止;完善预设洞位、世界书拼装与试跑,并打磨会话运行时与 Web 交互。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-24 01:13:48 +08:00
co-authored by Cursor
parent ec474cb946
commit b82da4c5a5
95 changed files with 6781 additions and 1344 deletions
+28
View File
@@ -0,0 +1,28 @@
import { describe, expect, it } from "vitest";
import {
SLOT_PLAY_LAYER_ACTIVE,
SLOT_PLAY_TURN_QUEUE,
isPlayLayerActive,
readPlayTurnQueue,
withPlayTurnQueue,
} from "../src/skills/play-turn.js";
describe("play-turn slots", () => {
it("reads a trimmed queue and ignores junk", () => {
expect(readPlayTurnQueue(undefined)).toEqual([]);
expect(
readPlayTurnQueue({ [SLOT_PLAY_TURN_QUEUE]: [" auditor ", "", 3, "gm"] }),
).toEqual(["auditor", "gm"]);
});
it("writes queue or clears when empty", () => {
const withIds = withPlayTurnQueue({ a: 1 }, ["gm", "narrator"]);
expect(withIds[SLOT_PLAY_TURN_QUEUE]).toEqual(["gm", "narrator"]);
expect(withPlayTurnQueue(withIds, []).playTurnQueue).toBeUndefined();
});
it("detects play layer flag", () => {
expect(isPlayLayerActive(undefined)).toBe(false);
expect(isPlayLayerActive({ [SLOT_PLAY_LAYER_ACTIVE]: true })).toBe(true);
});
});