Persist custom world asset configs in runtime snapshots

This commit is contained in:
2026-04-18 17:00:46 +08:00
parent 7ce61e9879
commit ac801fe05f
29 changed files with 3397 additions and 400 deletions

View File

@@ -44,7 +44,6 @@ import {
} from '../../services/customWorldAgentUiState';
import {
buildCustomWorldCreatorIntentFoundationText,
buildCustomWorldCreatorIntentGenerationText,
} from '../../services/customWorldCreatorIntent';
import {
clearPlatformBrowseHistory,
@@ -151,14 +150,6 @@ function buildOptimisticAgentMessage(
};
}
function buildAgentSeedTextFromProfile(profile: CustomWorldProfile) {
return (
buildCustomWorldCreatorIntentGenerationText(profile.creatorIntent).trim() ||
buildCustomWorldCreatorIntentFoundationText(profile.creatorIntent).trim() ||
profile.settingText.trim()
);
}
function normalizeAgentBackedProfile(profile: CustomWorldProfile) {
const foundationText = buildCustomWorldCreatorIntentFoundationText(
profile.creatorIntent,
@@ -784,29 +775,6 @@ export function PreGameSelectionFlow({
}
};
const continueWorldInAgent = async (
profile = generatedCustomWorldProfile,
) => {
if (!profile || isCreatingAgentSession) {
return;
}
if (isAgentDraftResultView && activeAgentSessionId) {
setGeneratedCustomWorldProfile(null);
setCustomWorldError(null);
setCustomWorldAutoSaveError(null);
setCustomWorldAutoSaveState('idle');
setAgentDraftGenerationStartedAt(null);
setCustomWorldGenerationViewSource(null);
setCustomWorldResultViewSource(null);
setPlatformTab('create');
setSelectionStage('agent-workspace');
return;
}
await openRpgAgentWorkspace(buildAgentSeedTextFromProfile(profile));
};
const submitAgentMessage = async (
payload: SendCustomWorldAgentMessageRequest,
) => {
@@ -961,10 +929,6 @@ export function PreGameSelectionFlow({
openCreationTypePicker();
};
const editCustomWorldSetting = () => {
void continueWorldInAgent();
};
const openLibraryDetail = (
entry: CustomWorldLibraryEntry<CustomWorldProfile>,
) => {
@@ -1441,9 +1405,7 @@ export function PreGameSelectionFlow({
? leaveAgentDraftResult
: leaveCustomWorldResult
}
onEditSetting={
isAgentDraftResultView ? undefined : editCustomWorldSetting
}
onEditSetting={undefined}
onRegenerate={undefined}
onContinueExpand={undefined}
onEnterWorld={() => {