新建作品改为直接进入对话落盘,按本局创作方案写能力,并把楼层呈现和零层卡分开。
输入栏同时可以按分组切换模型。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,10 +1,31 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
canonicalizeInsertedContent,
|
||||
extractLastProductJson,
|
||||
selectJsonPayload,
|
||||
tryParseJsonDoc,
|
||||
} from "../src/parse/json-doc.js";
|
||||
|
||||
describe("canonicalizeInsertedContent", () => {
|
||||
it("extracts a broken fragment string into canonical JSON", () => {
|
||||
const raw = `{
|
||||
"schema":"context-fragment-v1",
|
||||
"技能":"主角设定",
|
||||
"brief":"点题",
|
||||
"mount":"world-simulator"
|
||||
},
|
||||
"正文": { "称呼": "@玩家" }
|
||||
}`;
|
||||
const stored = canonicalizeInsertedContent(raw);
|
||||
expect(JSON.parse(stored)).toMatchObject({
|
||||
schema: "context-fragment.v1",
|
||||
技能: "主角设定",
|
||||
正文: { 称呼: "@玩家" },
|
||||
});
|
||||
expect(canonicalizeInsertedContent("开场是一段散文。")).toBe("开场是一段散文。");
|
||||
});
|
||||
});
|
||||
|
||||
describe("selectJsonPayload", () => {
|
||||
it("keeps content when it is already the product", () => {
|
||||
const json = '{"schema":"context-fragment.v1","brief":"a","正文":{}}';
|
||||
|
||||
Reference in New Issue
Block a user