接通主角绑定、开场封印与游玩辅助,让世界模拟器从创作连续落到本局。

直聘插入按模块回馈,并记录请求骨架便于排查。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-22 07:40:08 +08:00
co-authored by Cursor
parent 9306c8e659
commit dd0a9e87d8
88 changed files with 6869 additions and 786 deletions
+20
View File
@@ -381,9 +381,29 @@ export function isPresentLikeObject(doc: unknown): boolean {
const row = doc as Record<string, unknown>;
if (row.schema === PRESENT_SCHEMA) return true;
if (isPresentShellId(row.shell) && row.blocks != null) return true;
if (isPresentShellId(row.shell_id) && row.blocks != null) return true;
return false;
}
/** 开场/卡片预览:取出 present.v1 主读正文;散文原样返回。 */
export function presentReadablePlain(raw: string | null | undefined): string {
const text = (raw ?? "").trim();
if (!text) return "";
const view = parsePresentPacket(text);
const body = view.packet.blocks.body;
if (typeof body === "string" && body.trim()) return body.trim();
if (body && typeof body === "object") {
try {
return JSON.stringify(body);
} catch {
return text;
}
}
const header = view.packet.blocks.header;
if (typeof header === "string" && header.trim()) return header.trim();
return text;
}
/**
* 从「设计.正文组成」context-fragment 解析壳适配。
*/