1
This commit is contained in:
@@ -2,10 +2,6 @@ import type { CustomWorldAgentSessionSnapshot } from '../../../packages/shared/s
|
||||
import { normalizeCustomWorldProfileRecord } from '../../data/customWorldLibrary';
|
||||
import type { CustomWorldProfile } from '../../types';
|
||||
|
||||
/**
|
||||
* Phase 5 起结果页只消费服务端回传的 result preview。
|
||||
* 前端不再承担 session draft -> runtime profile 的本地兼容编译职责。
|
||||
*/
|
||||
export function buildCustomWorldProfileFromResultPreview(
|
||||
resultPreview: CustomWorldAgentSessionSnapshot['resultPreview'] | null | undefined,
|
||||
): CustomWorldProfile | null {
|
||||
@@ -13,20 +9,18 @@ export function buildCustomWorldProfileFromResultPreview(
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一“从 session 取结果页 profile”的主入口。
|
||||
* Phase 5 后主链没有 preview 就视为服务端未准备完成,而不是继续做前端本地编译。
|
||||
* RPG 运行时直接读取 Agent session 的 draftProfile。
|
||||
* resultPreview 只作为质量/发布信息外壳,不再参与进入游戏 profile 的数据转换。
|
||||
*/
|
||||
export function buildCustomWorldProfileFromAgentSession(
|
||||
session: CustomWorldAgentSessionSnapshot | null | undefined,
|
||||
): CustomWorldProfile | null {
|
||||
return buildCustomWorldProfileFromResultPreview(session?.resultPreview);
|
||||
return normalizeCustomWorldProfileRecord(session?.draftProfile ?? null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 这是工作包 A 提供的新命名兼容层。
|
||||
* Phase 3 后该适配层只负责:
|
||||
* 1. 把服务端 resultPreview 转成前端 view model
|
||||
* 2. 保持前端 session 读模型入口稳定
|
||||
* 主入口保持命名稳定,但数据来源已经收敛为 draftProfile 单一真相源。
|
||||
*/
|
||||
export const rpgCreationPreviewAdapter = {
|
||||
buildPreviewFromSession: buildCustomWorldProfileFromAgentSession,
|
||||
|
||||
Reference in New Issue
Block a user