Switch to VectorEngine gpt-image-2 and edits

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).
This commit is contained in:
2026-05-22 03:06:41 +08:00
parent 321e1ea33a
commit ae014ac881
90 changed files with 7078 additions and 3389 deletions

View File

@@ -13,7 +13,7 @@ import {
const MATCH3D_TRAY_SLOT_COUNT = 7;
const MATCH3D_LOCAL_DURATION_MS = 600_000;
const MATCH3D_MAX_ITEM_TYPE_COUNT = 25;
const MATCH3D_MAX_ITEM_TYPE_COUNT = 20;
const MATCH3D_ITEMS_PER_CLEAR = 3;
const MATCH3D_LOCAL_BASE_RADIUS = 0.072;
const MATCH3D_LOCAL_BOARD_CENTER = 0.5;
@@ -50,7 +50,7 @@ const MATCH3D_SIZE_TIER_RULES: Array<{
];
export const MATCH3D_VISUAL_SEEDS: Match3DVisualSeed[] = [
// 中文注释:默认 25使用参考图中的积木件,形状、尺寸和颜色都要能区分
// 中文注释:默认 20对齐 10*10 物品 Sprite可由生成素材替换显示
{
itemTypeId: 'block-red-2x4',
visualKey: 'block-red-2x4',
@@ -99,12 +99,6 @@ export const MATCH3D_VISUAL_SEEDS: Match3DVisualSeed[] = [
colorClassName: 'from-amber-100 to-yellow-600',
label: '米色二乘三',
},
{
itemTypeId: 'block-lime-1x2',
visualKey: 'block-lime-1x2',
colorClassName: 'from-lime-300 to-lime-700',
label: '青柠一乘二',
},
{
itemTypeId: 'block-darkred-2x2',
visualKey: 'block-darkred-2x2',
@@ -141,18 +135,6 @@ export const MATCH3D_VISUAL_SEEDS: Match3DVisualSeed[] = [
colorClassName: 'from-teal-300 to-teal-700',
label: '青色长光板',
},
{
itemTypeId: 'block-mint-tile-1x4',
visualKey: 'block-mint-tile-1x4',
colorClassName: 'from-emerald-100 to-emerald-400',
label: '薄荷长光板',
},
{
itemTypeId: 'block-magenta-tile-2x2',
visualKey: 'block-magenta-tile-2x2',
colorClassName: 'from-fuchsia-500 to-pink-800',
label: '洋红光板',
},
{
itemTypeId: 'block-orange-tile-2x2-stud',
visualKey: 'block-orange-tile-2x2-stud',
@@ -165,18 +147,6 @@ export const MATCH3D_VISUAL_SEEDS: Match3DVisualSeed[] = [
colorClassName: 'from-violet-400 to-violet-900',
label: '紫色斜坡',
},
{
itemTypeId: 'block-brown-slope-1x2',
visualKey: 'block-brown-slope-1x2',
colorClassName: 'from-orange-900 to-stone-700',
label: '棕色斜坡',
},
{
itemTypeId: 'block-sky-slope-2x2',
visualKey: 'block-sky-slope-2x2',
colorClassName: 'from-sky-300 to-sky-600',
label: '天蓝斜坡',
},
{
itemTypeId: 'block-green-cylinder',
visualKey: 'block-green-cylinder',
@@ -236,13 +206,14 @@ export function resolveLocalMatch3DItemTypeCount(clearCount: number) {
if (normalizedClearCount === 8) return 3;
if (normalizedClearCount === 12) return 9;
if (normalizedClearCount === 16) return 15;
if (normalizedClearCount === 20 || normalizedClearCount === 21) return 21;
if (normalizedClearCount === 20 || normalizedClearCount === 21) return 20;
return Math.min(MATCH3D_MAX_ITEM_TYPE_COUNT, normalizedClearCount);
}
export function normalizeLocalMatch3DRuntimeClearCount(clearCount: number) {
const normalizedClearCount = Math.max(1, Math.round(clearCount));
// 中文注释:旧硬核草稿可能仍带 20 次消除;本地试玩按新硬核 21 组三消执行。
// 中文注释:旧硬核草稿可能仍带 20 次消除;本地试玩保留硬核 21 组三消节奏,
// 但物品类型池最多加载 20 种,避免超过 10*10 Sprite 解析素材上限。
return normalizedClearCount === 20 ? 21 : normalizedClearCount;
}