export type CustomWorldWorkStatus = 'draft' | 'published'; export type CustomWorldWorkSource = 'agent_session' | 'published_profile'; export interface WorldPromiseValue { hook: string; differentiator: string; desiredExperience: string; } export interface PlayerFantasyValue { playerRole: string; corePursuit: string; fearOfLoss: string; } export interface ThemeBoundaryValue { toneKeywords: string[]; aestheticDirectives: string[]; forbiddenDirectives: string[]; } export interface PlayerEntryPointValue { openingIdentity: string; openingProblem: string; entryMotivation: string; } export interface CoreConflictValue { surfaceConflicts: string[]; hiddenCrisis: string; firstTouchedConflict: string; } export interface KeyRelationshipValue { pairs: string; relationshipType: string; secretOrCost: string; } export interface HiddenLineValue { hiddenTruths: string[]; misdirectionHints: string[]; revealPacing: string; } export interface IconicElementValue { iconicMotifs: string[]; institutionsOrArtifacts: string[]; hardRules: string[]; } export interface EightAnchorContent { worldPromise: WorldPromiseValue | null; playerFantasy: PlayerFantasyValue | null; themeBoundary: ThemeBoundaryValue | null; playerEntryPoint: PlayerEntryPointValue | null; coreConflict: CoreConflictValue | null; keyRelationships: KeyRelationshipValue[]; hiddenLines: HiddenLineValue | null; iconicElements: IconicElementValue | null; } export interface CustomWorldWorkSummary { workId: string; sourceType: CustomWorldWorkSource; status: CustomWorldWorkStatus; title: string; subtitle: string; summary: string; coverImageSrc?: string | null; coverRenderMode?: 'image' | 'scene_with_roles'; coverCharacterImageSrcs?: string[]; updatedAt: string; publishedAt?: string | null; stage?: string | null; stageLabel?: string | null; playableNpcCount: number; landmarkCount: number; roleVisualReadyCount?: number; roleAnimationReadyCount?: number; roleAssetSummaryLabel?: string | null; sessionId?: string | null; profileId?: string | null; canResume: boolean; canEnterWorld: boolean; } export interface CreatorIntentReadiness { isReady: boolean; completedKeys: string[]; missingKeys: string[]; } export interface CustomWorldPendingClarification { id: string; label: string; question: string; targetKey: | 'world_hook' | 'player_premise' | 'theme_and_tone' | 'core_conflict' | 'relationship_seed' | 'iconic_element'; priority: number; answer?: string; } export type CustomWorldAgentStage = | 'collecting_intent' | 'clarifying' | 'foundation_review' | 'object_refining' | 'visual_refining' | 'long_tail_review' | 'ready_to_publish' | 'published' | 'error'; export type CustomWorldAgentMessageRole = 'user' | 'assistant' | 'system'; export type CustomWorldAgentMessageKind = | 'chat' | 'clarification' | 'summary' | 'checkpoint' | 'warning' | 'action_result'; export interface CustomWorldAgentMessage { id: string; role: CustomWorldAgentMessageRole; kind: CustomWorldAgentMessageKind; text: string; createdAt: string; relatedOperationId?: string | null; } export type CustomWorldDraftCardKind = | 'world' | 'camp' | 'faction' | 'character' | 'landmark' | 'thread' | 'chapter' | 'scene_chapter' | 'carrier' | 'sidequest_seed'; export type CustomWorldDraftCardStatus = | 'suggested' | 'confirmed' | 'locked' | 'warning'; export interface CustomWorldDraftCardSummary { id: string; kind: CustomWorldDraftCardKind; title: string; subtitle: string; summary: string; status: CustomWorldDraftCardStatus; linkedIds: string[]; warningCount: number; assetStatus?: CustomWorldRoleAssetStatus | null; assetStatusLabel?: string | null; } export interface CustomWorldDraftCardDetailSection { id: string; label: string; value: string; } export interface CustomWorldFoundationDraftFaction { id: string; name: string; title?: string; subtitle?: string; publicGoal: string; relatedConflict: string; tension?: string; playerRelation: string; summary: string; } export interface CustomWorldFoundationDraftCharacter { id: string; name: string; title: string; role: string; publicIdentity: string; publicMask?: string; currentPressure: string; hiddenHook?: string; relationToPlayer: string; threadIds: string[]; summary: string; skills?: Array<{ id: string; name: string; actionPreviewConfig?: Record | null; }>; imageSrc?: string | null; generatedVisualAssetId?: string | null; generatedAnimationSetId?: string | null; animationMap?: Record | null; } export interface CustomWorldFoundationDraftLandmark { id: string; name: string; description?: string; purpose: string; mood: string; importance: string; secret?: string; dangerLevel?: string; imageSrc?: string | null; characterIds: string[]; threadIds: string[]; summary: string; } export interface CustomWorldFoundationDraftThread { id: string; title: string; type: 'main' | 'hidden'; conflictType?: string; conflict: string; stakes?: string; characterIds: string[]; landmarkIds: string[]; summary: string; } export interface CustomWorldFoundationDraftChapter { id: string; title: string; openingEvent: string; playerGoal: string; characterIds: string[]; landmarkIds: string[]; understandingShift: string; summary: string; } export interface CustomWorldFoundationDraftCamp { id: string; name: string; description: string; mood: string; dangerLevel?: string; imageSrc?: string | null; summary: string; } export type CustomWorldSceneActStage = | 'opening' | 'expansion' | 'turning_point' | 'climax' | 'aftermath'; export type CustomWorldSceneActAdvanceRule = | 'after_primary_contact' | 'after_active_step_complete' | 'after_chapter_resolution'; export interface CustomWorldFoundationDraftSceneAct { id: string; title: string; summary: string; stageCoverage: CustomWorldSceneActStage[]; backgroundImageSrc?: string | null; backgroundAssetId?: string | null; encounterNpcIds: string[]; primaryNpcId: string; linkedThreadIds: string[]; actGoal: string; transitionHook: string; advanceRule: CustomWorldSceneActAdvanceRule; } export interface CustomWorldFoundationDraftSceneChapter { id: string; sceneId: string; sceneName: string; title: string; summary: string; linkedThreadIds: string[]; linkedLandmarkIds: string[]; acts: CustomWorldFoundationDraftSceneAct[]; } export interface CustomWorldFoundationDraftProfile { name: string; subtitle: string; summary: string; tone: string; playerGoal: string; majorFactions: string[]; coreConflicts: string[]; playableNpcs: CustomWorldFoundationDraftCharacter[]; storyNpcs: CustomWorldFoundationDraftCharacter[]; landmarks: CustomWorldFoundationDraftLandmark[]; camp?: CustomWorldFoundationDraftCamp | null; themePack?: Record | null; storyGraph?: Record | null; factions: CustomWorldFoundationDraftFaction[]; threads: CustomWorldFoundationDraftThread[]; chapters: CustomWorldFoundationDraftChapter[]; sceneChapters: CustomWorldFoundationDraftSceneChapter[]; worldHook: string; playerPremise: string; openingSituation: string; iconicElements: string[]; sourceAnchorSummary: string; } export interface CustomWorldFoundationDraftResult { draftProfile: CustomWorldFoundationDraftProfile; draftCards: CustomWorldDraftCardSummary[]; } export interface CustomWorldDraftCardDetail { id: string; kind: CustomWorldDraftCardKind; title: string; sections: CustomWorldDraftCardDetailSection[]; linkedIds: string[]; locked: false; editable: boolean; editableSectionIds: string[]; warningMessages: string[]; assetStatus?: CustomWorldRoleAssetStatus | null; assetStatusLabel?: string | null; } export interface CustomWorldSuggestedAction { id: string; type: | 'request_summary' | 'draft_foundation' | 'refine_focus_target' | 'lock_current_target' | 'generate_role_assets' | 'generate_scene_assets' | 'expand_long_tail' | 'publish_world'; label: string; targetId?: string | null; } export type CustomWorldAssetPriorityTier = 'hero' | 'featured' | 'supporting'; export type CustomWorldRoleAssetStatus = | 'missing' | 'visual_ready' | 'animations_ready' | 'complete'; export interface CustomWorldRoleAssetSummary { roleId: string; roleName: string; roleKind: 'playable' | 'story'; priorityTier: CustomWorldAssetPriorityTier; portraitPath?: string | null; generatedVisualAssetId?: string | null; generatedAnimationSetId?: string | null; status: CustomWorldRoleAssetStatus; missingAnimations: string[]; nextPointCost: number; } export interface CustomWorldSceneAssetSummary { sceneId: string; sceneName: string; actId?: string | null; actTitle?: string | null; imageSrc?: string | null; assetId?: string | null; status: 'missing' | 'ready'; nextPointCost: number; } export interface CustomWorldAssetCoverageSummary { roleAssets: CustomWorldRoleAssetSummary[]; sceneAssets: CustomWorldSceneAssetSummary[]; allRoleAssetsReady: boolean; allSceneAssetsReady: boolean; } export interface CustomWorldAgentSessionSnapshot { sessionId: string; currentTurn: number; anchorContent: EightAnchorContent; progressPercent: number; lastAssistantReply: string | null; stage: CustomWorldAgentStage; focusCardId: string | null; creatorIntent: Record | null; creatorIntentReadiness: CreatorIntentReadiness; anchorPack: Record | null; lockState: Record | null; draftProfile: Record | null; messages: CustomWorldAgentMessage[]; draftCards: CustomWorldDraftCardSummary[]; pendingClarifications: CustomWorldPendingClarification[]; suggestedActions: CustomWorldSuggestedAction[]; recommendedReplies: string[]; qualityFindings: { id: string; severity: 'info' | 'warning' | 'blocker'; code: string; targetId?: string | null; message: string; }[]; assetCoverage: CustomWorldAssetCoverageSummary; updatedAt: string; } export type CustomWorldAgentOperationType = | 'process_message' | 'lock_cards' | 'unlock_cards' | 'regenerate_scope' | 'draft_foundation' | 'update_draft_card' | 'generate_characters' | 'generate_landmarks' | 'generate_role_assets' | 'sync_role_assets' | 'generate_scene_assets' | 'sync_scene_assets' | 'expand_long_tail' | 'publish_world' | 'revert_checkpoint'; export type CustomWorldAgentOperationStatus = | 'queued' | 'running' | 'completed' | 'failed'; export interface CustomWorldAgentOperationRecord { operationId: string; type: CustomWorldAgentOperationType; status: CustomWorldAgentOperationStatus; phaseLabel: string; phaseDetail: string; progress: number; error?: string | null; } export interface CreateCustomWorldAgentSessionRequest { seedText?: string; } export interface CreateCustomWorldAgentSessionResponse { session: CustomWorldAgentSessionSnapshot; } export interface SendCustomWorldAgentMessageRequest { clientMessageId: string; text: string; quickFillRequested?: boolean; focusCardId?: string | null; selectedCardIds?: string[]; } export interface SendCustomWorldAgentMessageResponse { operation: CustomWorldAgentOperationRecord; } export type CustomWorldAgentActionRequest = | { action: 'lock_cards'; cardIds: string[] } | { action: 'unlock_cards'; cardIds: string[] } | { action: 'regenerate_scope'; scope: | 'focus_card' | 'long_tail_npcs' | 'long_tail_landmarks' | 'sidequest_seeds' | 'role_assets' | 'scene_assets'; targetCardId?: string | null; } | { action: 'draft_foundation' } | { action: 'update_draft_card'; cardId: string; sections: Array<{ sectionId: string; value: string; }>; } | { action: 'generate_characters'; count: number; promptText?: string | null; anchorCardIds?: string[]; } | { action: 'generate_landmarks'; count: number; promptText?: string | null; anchorCardIds?: string[]; } | { action: 'generate_role_assets'; roleIds: string[] } | { action: 'sync_role_assets'; roleId: string; portraitPath: string; generatedVisualAssetId: string; generatedAnimationSetId?: string | null; animationMap?: Record | null; } | { action: 'publish_world' }; export interface CustomWorldAgentActionResponse { operation: CustomWorldAgentOperationRecord; } export interface GetCustomWorldAgentCardDetailResponse { card: CustomWorldDraftCardDetail; } export interface ListCustomWorldWorksResponse { items: CustomWorldWorkSummary[]; }