ae014ac881
Replace uses of the legacy `gpt-image-2-all` model with `gpt-image-2` and standardize image workflows: no-reference generation uses POST /v1/images/generations, any-reference flows use POST /v1/images/edits with multipart `image` parts. Update SKILLs, generation scripts, decision logs, and docs to reflect the contract change and edits-vs-generations guidance. Apply corresponding changes across backend (api-server match3d/puzzle modules, openai image adapter, mappers, telemetry, spacetime client/module), frontend components and services (Match3D, Puzzle, CreativeImageInputPanel, runtime shells), and add new spritesheet/parser files and tests. Also add media/logo.png. These changes align repository code and documentation with the VectorEngine image API contract and update generation/upload handling (green-screen -> alpha processing, spritesheet handling, and related tests).
197 lines
5.2 KiB
TypeScript
197 lines
5.2 KiB
TypeScript
/**
|
|
* 抓大鹅 Match3D 作品读写共享契约。
|
|
* 首版作品发布必须补齐游戏名称、标签、封面、题材、消除次数和难度。
|
|
*/
|
|
import type { CreationAudioAsset } from './creationAudio';
|
|
|
|
export type Match3DWorkPublicationStatus = 'draft' | 'published' | string;
|
|
export type Match3DWorkGenerationStatus = 'idle' | 'generating' | 'ready' | string;
|
|
|
|
export type Match3DGeneratedItemAssetStatus =
|
|
| 'pending'
|
|
| 'image_ready'
|
|
| 'model_generating'
|
|
| 'model_ready'
|
|
| 'failed'
|
|
| string;
|
|
|
|
export type Match3DGeneratedItemSize = '大' | '中' | '小' | string;
|
|
|
|
export interface Match3DGeneratedBackgroundAsset {
|
|
prompt: string;
|
|
levelScenePrompt?: string | null;
|
|
levelSceneImageSrc?: string | null;
|
|
levelSceneImageObjectKey?: string | null;
|
|
imageSrc?: string | null;
|
|
imageObjectKey?: string | null;
|
|
uiSpritesheetPrompt?: string | null;
|
|
uiSpritesheetImageSrc?: string | null;
|
|
uiSpritesheetImageObjectKey?: string | null;
|
|
itemSpritesheetPrompt?: string | null;
|
|
itemSpritesheetImageSrc?: string | null;
|
|
itemSpritesheetImageObjectKey?: string | null;
|
|
containerPrompt?: string | null;
|
|
containerImageSrc?: string | null;
|
|
containerImageObjectKey?: string | null;
|
|
status: string;
|
|
error?: string | null;
|
|
}
|
|
|
|
export interface Match3DGeneratedItemImageView {
|
|
viewId: string;
|
|
viewIndex: number;
|
|
imageSrc?: string | null;
|
|
imageObjectKey?: string | null;
|
|
}
|
|
|
|
export interface Match3DGeneratedItemAsset {
|
|
itemId: string;
|
|
itemName: string;
|
|
itemSize?: Match3DGeneratedItemSize | null;
|
|
imageSrc?: string | null;
|
|
imageObjectKey?: string | null;
|
|
imageViews?: Match3DGeneratedItemImageView[];
|
|
modelSrc?: string | null;
|
|
modelObjectKey?: string | null;
|
|
modelFileName?: string | null;
|
|
taskUuid?: string | null;
|
|
subscriptionKey?: string | null;
|
|
soundPrompt?: string | null;
|
|
backgroundMusicTitle?: string | null;
|
|
backgroundMusicStyle?: string | null;
|
|
backgroundMusicPrompt?: string | null;
|
|
backgroundMusic?: CreationAudioAsset | null;
|
|
clickSound?: CreationAudioAsset | null;
|
|
backgroundAsset?: Match3DGeneratedBackgroundAsset | null;
|
|
status: Match3DGeneratedItemAssetStatus;
|
|
error?: string | null;
|
|
}
|
|
|
|
export interface PutMatch3DAudioAssetsRequest {
|
|
generatedItemAssets: Match3DGeneratedItemAsset[];
|
|
}
|
|
|
|
export interface PersistMatch3DGeneratedModelRequest {
|
|
itemId: string;
|
|
itemName: string;
|
|
sourceUrl: string;
|
|
fileName?: string | null;
|
|
taskUuid?: string | null;
|
|
subscriptionKey?: string | null;
|
|
}
|
|
|
|
export interface PersistMatch3DGeneratedModelResponse {
|
|
asset: Match3DGeneratedItemAsset;
|
|
}
|
|
|
|
export interface GenerateMatch3DCoverImageRequest {
|
|
prompt: string;
|
|
uploadedImageSrc?: string | null;
|
|
referenceImageSrc?: string | null;
|
|
referenceImageSrcs?: string[];
|
|
}
|
|
|
|
export interface GenerateMatch3DCoverImageResponse {
|
|
item: Match3DWorkProfile;
|
|
coverImageSrc: string;
|
|
coverImageObjectKey: string;
|
|
prompt: string;
|
|
}
|
|
|
|
export interface GenerateMatch3DBackgroundImageRequest {
|
|
prompt: string;
|
|
}
|
|
|
|
export interface GenerateMatch3DBackgroundImageResponse {
|
|
item: Match3DWorkProfile;
|
|
backgroundImageSrc: string;
|
|
backgroundImageObjectKey: string;
|
|
generatedBackgroundAsset: Match3DGeneratedBackgroundAsset;
|
|
prompt: string;
|
|
}
|
|
|
|
export interface GenerateMatch3DContainerImageRequest {
|
|
prompt: string;
|
|
}
|
|
|
|
export interface GenerateMatch3DContainerImageResponse {
|
|
item: Match3DWorkProfile;
|
|
containerImageSrc: string;
|
|
containerImageObjectKey: string;
|
|
generatedBackgroundAsset: Match3DGeneratedBackgroundAsset;
|
|
prompt: string;
|
|
}
|
|
|
|
export type GenerateMatch3DItemAssetsMode = 'append' | 'replace';
|
|
|
|
export interface GenerateMatch3DItemAssetsRequest {
|
|
itemNames: string[];
|
|
mode?: GenerateMatch3DItemAssetsMode;
|
|
}
|
|
|
|
export interface GenerateMatch3DItemAssetsResponse {
|
|
item: Match3DWorkProfile;
|
|
generatedItemAssets: Match3DGeneratedItemAsset[];
|
|
}
|
|
|
|
export interface PutMatch3DWorkRequest {
|
|
gameName: string;
|
|
themeText?: string;
|
|
summary: string;
|
|
tags: string[];
|
|
coverImageSrc?: string | null;
|
|
referenceImageSrc?: string | null;
|
|
clearCount: number;
|
|
difficulty: number;
|
|
}
|
|
|
|
export interface GenerateMatch3DWorkTagsRequest {
|
|
gameName: string;
|
|
themeText: string;
|
|
summary?: string | null;
|
|
}
|
|
|
|
export interface GenerateMatch3DWorkTagsResponse {
|
|
tags: string[];
|
|
}
|
|
|
|
export interface Match3DWorkSummary {
|
|
workId: string;
|
|
profileId: string;
|
|
ownerUserId: string;
|
|
sourceSessionId?: string | null;
|
|
gameName: string;
|
|
themeText: string;
|
|
summary: string;
|
|
tags: string[];
|
|
coverImageSrc?: string | null;
|
|
referenceImageSrc?: string | null;
|
|
clearCount: number;
|
|
difficulty: number;
|
|
publicationStatus: Match3DWorkPublicationStatus;
|
|
playCount: number;
|
|
updatedAt: string;
|
|
publishedAt?: string | null;
|
|
publishReady: boolean;
|
|
generationStatus?: Match3DWorkGenerationStatus | null;
|
|
backgroundPrompt?: string | null;
|
|
backgroundImageSrc?: string | null;
|
|
backgroundImageObjectKey?: string | null;
|
|
generatedBackgroundAsset?: Match3DGeneratedBackgroundAsset | null;
|
|
generatedItemAssets?: Match3DGeneratedItemAsset[];
|
|
}
|
|
|
|
export interface Match3DWorkProfile extends Match3DWorkSummary {}
|
|
|
|
export interface Match3DWorksResponse {
|
|
items: Match3DWorkSummary[];
|
|
}
|
|
|
|
export interface Match3DWorkDetailResponse {
|
|
item: Match3DWorkProfile;
|
|
}
|
|
|
|
export interface Match3DWorkMutationResponse {
|
|
item: Match3DWorkProfile;
|
|
}
|