diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent_native_tools.rs b/apps/ai-game-creator-shell/src-tauri/src/agent_native_tools.rs index 3dc11e007..8b24b0cfc 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent_native_tools.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent_native_tools.rs @@ -1172,6 +1172,7 @@ fn runtime_tool_input_schema(tool: &str) -> Value { "type": "array", "minItems": 1, "maxItems": 4, + "description": prompt_text!("uiDesignDoc.from_images.parameters.images"), "items": { "type": "object", "required": ["assetId", "path"], @@ -1184,8 +1185,14 @@ fn runtime_tool_input_schema(tool: &str) -> Value { } } }), - "ui-design-doc.run-workflow" => one_string_input_schema("designDocAssetId"), - "ui-design-doc.into-js" => one_string_input_schema("designDocAssetId"), + "ui-design-doc.run-workflow" => one_string_input_schema_with_description( + "designDocAssetId", + prompt_text!("uiDesignDoc.run_workflow.parameters.designDocAssetId"), + ), + "ui-design-doc.into-js" => one_string_input_schema_with_description( + "designDocAssetId", + prompt_text!("uiDesignDoc.into_js.parameters.designDocAssetId"), + ), "project.search" => json!({ "type": "object", "required": ["query", "path", "maxResults", "caseSensitive"], "additionalProperties": false, "properties": { @@ -1505,6 +1512,16 @@ fn one_string_input_schema(field: &str) -> Value { }) } +/// 与 `one_string_input_schema` 同形,但把文案里的参数说明挂到字段上。 +fn one_string_input_schema_with_description(field: &str, description: &str) -> Value { + json!({ + "type": "object", + "required": [field], + "additionalProperties": false, + "properties": { (field): { "type": "string", "description": description } } + }) +} + fn two_string_input_schema(first: &str, second: &str) -> Value { json!({ "type": "object",