1
This commit is contained in:
103
packages/shared/src/contracts/puzzleCreativeTemplate.ts
Normal file
103
packages/shared/src/contracts/puzzleCreativeTemplate.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user