Increase VectorEngine timeouts and add image UI

Add VectorEngine image generation config and raise request timeouts (env + scripts) from 180000 to 1000000ms. Introduce a reusable CreativeImageInputPanel component with tests and wire up mobile keyboard-focus helpers; update generation views and related tests (CustomWorldGenerationView, BarkBattle editor, Match3D, Puzzle flows). Improve API error handling / VectorEngine request guidance (packages/shared http.ts and docs), and apply multiple backend/frontend fixes for puzzle/match3d/prompt handling. Also include extensive docs and decision-log updates describing UI/UX decisions and verification steps.
This commit is contained in:
2026-05-15 02:40:59 +08:00
parent 4642855fd0
commit 74fd9a33ac
87 changed files with 5508 additions and 1261 deletions

View File

@@ -1,34 +1,38 @@
/// 拼图首关关卡名与 UI 背景提示词生成提示词。
/// 拼图首关关卡名、作品元信息与 UI 背景提示词生成提示词。
///
/// 模型只负责把画面描述压缩成可直接展示的中文关卡名,并产出运行态 UI 背景的正向视觉提示词;
/// 写回草稿和作品卡由业务路由处理。
/// 模型只负责把画面描述压缩成可直接展示的中文关卡名、作品描述、作品标签,
/// 并产出运行态 UI 背景的正向视觉提示词;写回草稿和作品卡由业务路由处理。
pub(crate) const PUZZLE_FIRST_LEVEL_NAME_SYSTEM_PROMPT: &str = r#"你是一个中文拼图关卡命名编辑。
你会收到拼图第一关的画面描述,部分请求还会附带已经生成完成的正式图片。请综合图片内容和画面描述,同时生成:
- 1 个适合直接展示在游戏关卡卡片上的中文关卡名。
- 1 段适合默认填入拼图草稿的中文作品描述。
- 6 个适合作品广场检索和相似推荐的中文作品标签。
- 1 段用于生成 9:16 拼图运行态 UI 纯背景图的中文正向视觉提示词。
硬约束:
1. 只输出 JSON不要输出 Markdown、解释或代码块。
2. JSON 格式必须是 {"levelName":"关卡名","uiBackgroundPrompt":"提示词"}。
2. JSON 格式必须是 {"levelName":"关卡名","workDescription":"作品描述","workTags":["标签1","标签2","标签3","标签4","标签5","标签6"],"uiBackgroundPrompt":"提示词"}。
3. levelName 必须是 2 到 8 个中文字符为主。
4. 不要输出“第一关”“画面”“拼图”“作品”等泛词。
5. 不要输出标点、引号、编号、英文、emoji 或空白。
6. 关卡名要抓住画面主体、场景和氛围,读起来像一个具体可玩的关卡。
7. uiBackgroundPrompt 必须是 30160 个中文字符,描述题材氛围、环境、色彩、光影和空间层次
8. uiBackgroundPrompt 只写正向画面描述不要写规则说明不要出现拼图槽、棋盘、HUD、按钮、文字、水印、数字、拼图碎片、完整拼图图像或教程浮层
7. workDescription 必须是 1880 个中文字符,描述这套拼图的画面主题、氛围和游玩期待,不要复述字段名
8. workTags 必须正好 6 个,每个标签 2 到 6 个中文字符为主,覆盖题材、主体、氛围、场景、风格和拼图辨识点
9. uiBackgroundPrompt 必须是 30 到 160 个中文字符,描述题材氛围、环境、色彩、光影和空间层次。
10. uiBackgroundPrompt 只写正向画面描述不要写规则说明不要出现拼图槽、棋盘、HUD、按钮、文字、水印、数字、拼图碎片、完整拼图图像或教程浮层。
"#;
pub(crate) fn build_puzzle_first_level_name_user_prompt(picture_description: &str) -> String {
format!(
"画面描述:{picture_description}\n\n请生成第一关关卡名和 UI 背景提示词。",
"画面描述:{picture_description}\n\n请生成第一关关卡名、作品描述、6 个作品标签和 UI 背景提示词。",
picture_description = picture_description.trim(),
)
}
pub(crate) fn build_puzzle_first_level_name_vision_user_text(picture_description: &str) -> String {
format!(
"画面描述:{picture_description}\n\n请观察随消息附带的正式拼图图片,生成第一关关卡名和 UI 背景提示词。",
"画面描述:{picture_description}\n\n请观察随消息附带的正式拼图图片,生成第一关关卡名、作品描述、6 个作品标签和 UI 背景提示词。",
picture_description = picture_description.trim(),
)
}
@@ -43,6 +47,8 @@ mod tests {
assert!(prompt.contains("画面描述:一只猫在雨夜灯牌下回头。"));
assert!(prompt.contains("第一关关卡名"));
assert!(prompt.contains("作品描述"));
assert!(prompt.contains("6 个作品标签"));
assert!(prompt.contains("UI 背景提示词"));
}
@@ -52,6 +58,8 @@ mod tests {
assert!(prompt.contains("画面描述:一只猫在雨夜灯牌下回头。"));
assert!(prompt.contains("正式拼图图片"));
assert!(prompt.contains("作品描述"));
assert!(prompt.contains("6 个作品标签"));
assert!(prompt.contains("UI 背景提示词"));
}
}