diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/merge.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/merge.rs index 2ee41a561..affbe7074 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/merge.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/merge.rs @@ -5,6 +5,8 @@ use platform_llm::{LlmFunctionTool, LlmMessage, LlmRunRequest, LlmToolChoice}; use serde::{Deserialize, Serialize}; use ts_rs::TS; +// TODO 13. `merge.rs`:合并命令接受任意 State,未在序列化和 LLM 请求前执行节点数、深度、序列化大小及超时/取消限制。需要确定与持久化限制一致的上限。 + const MERGE_TOOL_NAME: &str = "merge_ui_trees"; const SYSTEM_PROMPT: &str = r#" diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs index c3df08928..c054020b7 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs @@ -19,6 +19,7 @@ use std::collections::{HashMap, HashSet}; use std::path::Path; use ts_rs::TS; +// TODO 14. `recognition.rs`:LLM 返回的 children 树在递归反序列化和转换前没有深度、节点数、响应体上限,存在资源耗尽/栈溢出风险。需要确定契约上限及拒绝方式。 const MAX_REFERENCES: usize = 4; const SYSTEM_PROMPT: &str = r#" diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs index 899089abb..3d1a6081a 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs @@ -13,6 +13,8 @@ use std::collections::HashSet; use std::path::Path; use ts_rs::TS; +// TODO `ui_design_suggestion.rs`:异步命令同步读取图片并进行 base64 编码,未设置输入大小上限。需要确定参考图大小策略,并决定 `tokio::fs` 还是 blocking worker 的执行边界。 + const SYSTEM_PROMPT: &str = r#" 请识别这些 UI 参考图的界面语义,并调用 suggest_ui_design_semantics 工具返回结果。 不要在工具调用外输出 JSON、Markdown、代码围栏、注释、额外字段或解释文字。