Update editor generation pricing defaults

Unify and lower default mud-point prices across editor generation features and update related API/schema, docs and tests. Changes set gpt-image-2 to 1K=3 / 2K=5, audio1.0 to 5, and chirp-v5 to 12, and update server default JSON, frontend models/workflows, OpenAPI schema (require aspectRatio/imageSize/priceMudPoints for UI extraction), multiple UX docs (quick-edit viewport, UI extraction panel, pricing guidance) and accompanying tests to match the new defaults and validation rules.
This commit is contained in:
2026-06-22 21:10:43 +08:00
parent 6e475af269
commit 2007f1f9ce
30 changed files with 911 additions and 181 deletions
@@ -26,25 +26,48 @@ export type UiAssetExtractionMark =
export type UiAssetExtractionState = {
sourceLayerId: string;
tool: UiAssetExtractionTool;
tool: UiAssetExtractionTool | null;
marks: UiAssetExtractionMark[];
draftMark: UiAssetExtractionMark | null;
status: 'idle' | 'extracting' | 'failed';
errorMessage?: string;
};
export const UI_ASSET_EXTRACTION_ASPECT_RATIO = '1:1';
export const UI_ASSET_EXTRACTION_SMALL_IMAGE_SIZE = '1K';
export const UI_ASSET_EXTRACTION_LARGE_IMAGE_SIZE = '2K';
export const UI_ASSET_EXTRACTION_LARGE_SIZE_MARK_THRESHOLD = 6;
export type UiAssetExtractionImageSize =
| typeof UI_ASSET_EXTRACTION_SMALL_IMAGE_SIZE
| typeof UI_ASSET_EXTRACTION_LARGE_IMAGE_SIZE;
export function createUiAssetExtractionState(
sourceLayerId: string,
options: { initialTool?: UiAssetExtractionTool | null } = {},
): UiAssetExtractionState {
return {
sourceLayerId,
tool: 'rect',
tool: options.initialTool === undefined ? 'rect' : options.initialTool,
marks: [],
draftMark: null,
status: 'idle',
};
}
export function resolveUiAssetExtractionGenerationPlan(markCount: number): {
aspectRatio: typeof UI_ASSET_EXTRACTION_ASPECT_RATIO;
imageSize: UiAssetExtractionImageSize;
} {
return {
aspectRatio: UI_ASSET_EXTRACTION_ASPECT_RATIO,
imageSize:
markCount > UI_ASSET_EXTRACTION_LARGE_SIZE_MARK_THRESHOLD
? UI_ASSET_EXTRACTION_LARGE_IMAGE_SIZE
: UI_ASSET_EXTRACTION_SMALL_IMAGE_SIZE,
};
}
export function createUiAssetExtractionDraftMark({
tool,
id,