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).
148 lines
3.5 KiB
TypeScript
148 lines
3.5 KiB
TypeScript
import type { CreationAudioAsset } from './creationAudio';
|
|
|
|
export type PuzzleGridSize = 3 | 4 | 5 | 6 | 7;
|
|
|
|
export interface PuzzleCellPosition {
|
|
row: number;
|
|
col: number;
|
|
}
|
|
|
|
export interface PuzzlePieceState {
|
|
pieceId: string;
|
|
correctRow: number;
|
|
correctCol: number;
|
|
currentRow: number;
|
|
currentCol: number;
|
|
mergedGroupId: string | null;
|
|
}
|
|
|
|
export interface PuzzleMergedGroupState {
|
|
groupId: string;
|
|
pieceIds: string[];
|
|
occupiedCells: PuzzleCellPosition[];
|
|
}
|
|
|
|
export interface PuzzleLeaderboardEntry {
|
|
rank: number;
|
|
nickname: string;
|
|
elapsedMs: number;
|
|
visibleTags?: string[];
|
|
isCurrentPlayer?: boolean;
|
|
}
|
|
|
|
export type PuzzleRuntimeLevelStatus = 'playing' | 'cleared' | 'failed';
|
|
|
|
export type PuzzleRuntimePropKind =
|
|
| 'hint'
|
|
| 'reference'
|
|
| 'freezeTime'
|
|
| 'extendTime';
|
|
|
|
export interface PuzzleBoardSnapshot {
|
|
rows: number;
|
|
cols: number;
|
|
pieces: PuzzlePieceState[];
|
|
mergedGroups: PuzzleMergedGroupState[];
|
|
selectedPieceId: string | null;
|
|
allTilesResolved: boolean;
|
|
}
|
|
|
|
export interface PuzzleRuntimeLevelSnapshot {
|
|
runId: string;
|
|
levelIndex: number;
|
|
levelId: string | null;
|
|
gridSize: PuzzleGridSize;
|
|
profileId: string;
|
|
levelName: string;
|
|
authorDisplayName: string;
|
|
themeTags: string[];
|
|
coverImageSrc: string | null;
|
|
uiBackgroundImageSrc?: string | null;
|
|
uiBackgroundImageObjectKey?: string | null;
|
|
levelBackgroundImageSrc?: string | null;
|
|
levelBackgroundImageObjectKey?: string | null;
|
|
uiSpritesheetImageSrc?: string | null;
|
|
uiSpritesheetImageObjectKey?: string | null;
|
|
backgroundMusic?: CreationAudioAsset | null;
|
|
board: PuzzleBoardSnapshot;
|
|
status: PuzzleRuntimeLevelStatus;
|
|
startedAtMs: number;
|
|
clearedAtMs: number | null;
|
|
elapsedMs: number | null;
|
|
timeLimitMs: number;
|
|
remainingMs: number;
|
|
pausedAccumulatedMs: number;
|
|
pauseStartedAtMs: number | null;
|
|
freezeAccumulatedMs: number;
|
|
freezeStartedAtMs: number | null;
|
|
freezeUntilMs: number | null;
|
|
leaderboardEntries: PuzzleLeaderboardEntry[];
|
|
}
|
|
|
|
export type PuzzleNextLevelMode = 'sameWork' | 'similarWorks' | 'none';
|
|
|
|
export interface PuzzleRecommendedNextWork {
|
|
profileId: string;
|
|
levelName: string;
|
|
authorDisplayName: string;
|
|
themeTags: string[];
|
|
coverImageSrc: string | null;
|
|
similarityScore: number;
|
|
}
|
|
|
|
export interface PuzzleRunSnapshot {
|
|
runId: string;
|
|
entryProfileId: string;
|
|
clearedLevelCount: number;
|
|
currentLevelIndex: number;
|
|
currentGridSize: PuzzleGridSize;
|
|
playedProfileIds: string[];
|
|
previousLevelTags: string[];
|
|
currentLevel: PuzzleRuntimeLevelSnapshot | null;
|
|
recommendedNextProfileId: string | null;
|
|
nextLevelMode?: PuzzleNextLevelMode;
|
|
nextLevelProfileId?: string | null;
|
|
nextLevelId?: string | null;
|
|
recommendedNextWorks?: PuzzleRecommendedNextWork[];
|
|
leaderboardEntries: PuzzleLeaderboardEntry[];
|
|
}
|
|
|
|
export interface StartPuzzleRunRequest {
|
|
profileId: string;
|
|
levelId?: string | null;
|
|
}
|
|
|
|
export interface PuzzleRunResponse {
|
|
run: PuzzleRunSnapshot;
|
|
}
|
|
|
|
export interface SubmitPuzzleLeaderboardRequest {
|
|
profileId: string;
|
|
gridSize: PuzzleGridSize;
|
|
elapsedMs: number;
|
|
nickname: string;
|
|
}
|
|
|
|
export interface SwapPuzzlePiecesRequest {
|
|
firstPieceId: string;
|
|
secondPieceId: string;
|
|
}
|
|
|
|
export interface DragPuzzlePieceRequest {
|
|
pieceId: string;
|
|
targetRow: number;
|
|
targetCol: number;
|
|
}
|
|
|
|
export interface AdvancePuzzleNextLevelRequest {
|
|
targetProfileId?: string | null;
|
|
}
|
|
|
|
export interface UsePuzzleRuntimePropRequest {
|
|
propKind: PuzzleRuntimePropKind;
|
|
}
|
|
|
|
export interface UpdatePuzzleRuntimePauseRequest {
|
|
paused: boolean;
|
|
}
|