@@ -19,11 +19,14 @@ import {
|
||||
buildCustomWorldLandmarkNetworkBatchPrompt,
|
||||
buildCustomWorldLandmarkSeedBatchJsonRepairPrompt,
|
||||
buildCustomWorldLandmarkSeedBatchPrompt,
|
||||
buildCustomWorldRawProfileFromFramework,
|
||||
buildCustomWorldRoleBatchJsonRepairPrompt,
|
||||
buildCustomWorldRoleBatchPrompt,
|
||||
buildCustomWorldRoleOutlineBatchJsonRepairPrompt,
|
||||
buildCustomWorldRoleOutlineBatchPrompt,
|
||||
} from '../prompts/customWorldPrompts.js';
|
||||
import {
|
||||
buildCompiledCustomWorldProfile,
|
||||
buildCustomWorldRawProfileFromFramework,
|
||||
type CustomWorldGenerationFramework,
|
||||
type CustomWorldGenerationLandmarkOutline,
|
||||
type CustomWorldGenerationRoleBatchStage,
|
||||
@@ -32,9 +35,8 @@ import {
|
||||
normalizeCustomWorldGenerationFramework,
|
||||
normalizeCustomWorldGenerationLandmarkOutlineBatch,
|
||||
normalizeCustomWorldGenerationRoleOutlineBatch,
|
||||
} from '../../../src/services/customWorld.js';
|
||||
import { buildExpandedCustomWorldProfile } from '../../../src/services/customWorldBuilder.js';
|
||||
import type { CustomWorldProfile } from '../../../src/types.js';
|
||||
} from '../modules/custom-world/runtimeProfile.js';
|
||||
import type { CustomWorldProfile } from '../modules/custom-world/runtimeTypes.js';
|
||||
import {
|
||||
buildDraftSummaryFromIntent,
|
||||
type CreatorCharacterSeedRecord,
|
||||
@@ -792,7 +794,7 @@ type DraftProgressCallback = (
|
||||
payload: DraftProgressPayload,
|
||||
) => void | Promise<void>;
|
||||
|
||||
type MergeableNamedRecord = Record<string, unknown> & {
|
||||
type MergeableNamedRecord = {
|
||||
name: string;
|
||||
};
|
||||
|
||||
@@ -1366,7 +1368,9 @@ function buildDraftFactionsFromRuntimeProfile(profile: CustomWorldProfile) {
|
||||
});
|
||||
}
|
||||
|
||||
function buildDraftThreadsFromRuntimeProfile(profile: CustomWorldProfile) {
|
||||
function buildDraftThreadsFromRuntimeProfile(
|
||||
profile: CustomWorldProfile,
|
||||
): CustomWorldFoundationDraftThread[] {
|
||||
const graphThreads = [
|
||||
...(profile.storyGraph?.visibleThreads ?? []).slice(0, 2),
|
||||
...(profile.storyGraph?.hiddenThreads ?? []).slice(0, 2),
|
||||
@@ -1558,8 +1562,12 @@ function convertRuntimeProfileToFoundationDraft(params: {
|
||||
summary: clampText(params.profile.camp.description, 88),
|
||||
} satisfies CustomWorldFoundationDraftCamp)
|
||||
: null,
|
||||
themePack: params.profile.themePack ?? null,
|
||||
storyGraph: params.profile.storyGraph ?? null,
|
||||
themePack:
|
||||
(params.profile.themePack as unknown as Record<string, unknown> | null) ??
|
||||
null,
|
||||
storyGraph:
|
||||
(params.profile.storyGraph as unknown as Record<string, unknown> | null) ??
|
||||
null,
|
||||
factions,
|
||||
threads,
|
||||
chapters: [chapter],
|
||||
@@ -1718,7 +1726,7 @@ async function buildFoundationDraftProfileWithLlm(params: {
|
||||
rawProfile.storyNpcs = storyDetailed;
|
||||
rawProfile.landmarks = framework.landmarks;
|
||||
|
||||
const runtimeProfile = buildExpandedCustomWorldProfile(
|
||||
const runtimeProfile = buildCompiledCustomWorldProfile(
|
||||
rawProfile,
|
||||
settingText,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user