Files
Genarrative/packages/shared/src/contracts/puzzleCreativeTemplate.ts
2026-05-08 11:44:42 +08:00

104 lines
2.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export type PuzzleTemplatePricingUnit = 'point';
export type PuzzleSupportedLevelMode =
| 'single'
| 'multi'
| 'single_or_multi';
export type PuzzleLevelGenerationMode = 'single_level' | 'multi_level';
export interface PuzzleTemplateCostRange {
minPoints: number;
maxPoints: number;
pricingUnit: PuzzleTemplatePricingUnit;
reason: string;
}
export type PuzzleDraftEditableFieldPath =
| 'workTitle'
| 'workDescription'
| 'workTags'
| 'levels[].levelName'
| 'levels[].pictureDescription'
| 'levels[].pictureReference';
export interface PuzzleTemplateImageGenerationPolicy {
allowUploadedImageDirectly: boolean;
allowGeneratedImages: boolean;
allowPerLevelReferenceImage: boolean;
defaultCandidateCountPerLevel: number;
}
export interface PuzzleCreativeTemplateProtocol {
templateId: string;
title: string;
summary: string;
previewImageSrc: string | null;
supportedLevelMode: PuzzleSupportedLevelMode;
minLevelCount: number;
maxLevelCount: number;
defaultLevelCount: number;
costRange: PuzzleTemplateCostRange;
requiredDraftFields: PuzzleDraftEditableFieldPath[];
imagePolicy: PuzzleTemplateImageGenerationPolicy;
}
export interface PuzzleCreativeTemplateSelection {
templateId: string;
title: string;
reason: string;
costRange: PuzzleTemplateCostRange;
supportedLevelMode: PuzzleSupportedLevelMode;
selectedLevelMode: PuzzleLevelGenerationMode;
plannedLevelCount: number;
requiresUserConfirmation: true;
}
export interface CreativePuzzleLevelDraftInput {
levelName: string;
pictureDescription: string;
/**
* 任务 A 冻结Phase 1 采用正式字段方案,后续拼图草稿落地需补正式 pictureReference 字段。
*/
pictureReference?: string | null;
}
export interface CreativePuzzleDraftToolInput {
templateId: string;
templateCostRange: PuzzleTemplateCostRange;
workTitle: string;
workDescription: string;
workTags: string[];
levels: CreativePuzzleLevelDraftInput[];
}
export interface PuzzleImageGenerationPlanLevel {
levelId: string;
levelName: string;
pictureDescription: string;
imagePrompt: string;
pictureReference?: string | null;
candidateCount: number;
}
export interface PuzzleImageGenerationPlan {
mode: PuzzleLevelGenerationMode;
templateId: string;
estimatedCostRange: PuzzleTemplateCostRange;
levels: PuzzleImageGenerationPlanLevel[];
}
export type PuzzleDraftFieldPatchOperation =
| 'set'
| 'append'
| 'replace'
| 'remove';
export interface PuzzleDraftFieldPatch {
fieldPath: PuzzleDraftEditableFieldPath;
operation: PuzzleDraftFieldPatchOperation;
levelId?: string | null;
value: unknown;
rationale: string;
}