Files
Genarrative/packages/shared/src/contracts/puzzleAgentDraft.ts
2026-05-13 00:28:07 +08:00

84 lines
2.1 KiB
TypeScript

import type { JsonObject } from './common';
import type { CreationAudioAsset } from './creationAudio';
export type PuzzleAnchorStatus =
| 'missing'
| 'inferred'
| 'confirmed'
| 'locked';
export interface PuzzleAnchorItem {
key: string;
label: string;
value: string;
status: PuzzleAnchorStatus;
}
export interface PuzzleAnchorPack {
themePromise: PuzzleAnchorItem;
visualSubject: PuzzleAnchorItem;
visualMood: PuzzleAnchorItem;
compositionHooks: PuzzleAnchorItem;
tagsAndForbidden: PuzzleAnchorItem;
}
export interface PuzzleCreatorIntent {
sourceMode: 'agent_chat' | 'form';
rawMessagesSummary: string;
themePromise: string;
visualSubject: string;
visualMood: string[];
compositionHooks: string[];
themeTags: string[];
forbiddenDirectives: string[];
}
export interface PuzzleGeneratedImageCandidate {
candidateId: string;
imageSrc: string;
assetId: string;
prompt: string;
actualPrompt?: string | null;
sourceType: 'generated' | 'uploaded';
selected: boolean;
}
export interface PuzzleDraftLevel {
levelId: string;
levelName: string;
pictureDescription: string;
pictureReference?: string | null;
uiBackgroundPrompt?: string | null;
uiBackgroundImageSrc?: string | null;
uiBackgroundImageObjectKey?: string | null;
backgroundMusic?: CreationAudioAsset | null;
candidates: PuzzleGeneratedImageCandidate[];
selectedCandidateId: string | null;
coverImageSrc: string | null;
coverAssetId: string | null;
generationStatus: 'idle' | 'generating' | 'ready';
}
export interface PuzzleResultDraft {
workTitle?: string;
workDescription?: string;
levelName: string;
summary: string;
themeTags: string[];
forbiddenDirectives: string[];
creatorIntent: PuzzleCreatorIntent | null;
anchorPack: PuzzleAnchorPack;
candidates: PuzzleGeneratedImageCandidate[];
selectedCandidateId: string | null;
coverImageSrc: string | null;
coverAssetId: string | null;
generationStatus: 'idle' | 'generating' | 'ready';
levels?: PuzzleDraftLevel[];
formDraft?: {
workTitle?: string;
workDescription?: string;
pictureDescription?: string;
} | null;
metadata?: JsonObject | null;
}