mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-27 11:37:13 -06:00
MCP: the export tool forwards every option it advertises
preset, background, resize, subfolder, conflict, tiffCompression and dngCompression were in the export tool's schema (and so passed the new argument check) but were dropped before reaching app.export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
dedc049692
commit
7a42f99cf0
@@ -139,6 +139,19 @@ fn export_refuses_unknown_params_and_bad_values() {
|
||||
assert!(e.contains("did you mean `quality`"), "{e}");
|
||||
}
|
||||
|
||||
/// Every option the `export` tool advertises reaches `app.export` (they were accepted, then dropped).
|
||||
#[test]
|
||||
fn export_tool_forwards_its_advertised_options() {
|
||||
let mut b = Headless::demo();
|
||||
let base = std::env::temp_dir().join(format!("lc-mcp-export-fwd-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&base);
|
||||
let r = call_tool(&mut b, "export", &json!({"dir": base.to_string_lossy(), "subfolder": "sub", "longEdge": 64, "format": "png"}));
|
||||
assert!(!r.is_error, "{r:?}");
|
||||
let files: Vec<_> = std::fs::read_dir(base.join("sub")).unwrap().collect();
|
||||
assert_eq!(files.len(), 1, "written into the subfolder");
|
||||
let _ = std::fs::remove_dir_all(&base);
|
||||
}
|
||||
|
||||
/// The `import` helper moves: renamed into the folder template, the source removed.
|
||||
#[test]
|
||||
fn import_tool_moves_with_a_folder_template() {
|
||||
|
||||
@@ -729,6 +729,13 @@ pub fn call_tool(b: &mut dyn Backend, name: &str, args: &Value) -> ToolResult {
|
||||
"watermark",
|
||||
"colorSpace",
|
||||
"bitDepth",
|
||||
"preset",
|
||||
"background",
|
||||
"resize",
|
||||
"subfolder",
|
||||
"conflict",
|
||||
"tiffCompression",
|
||||
"dngCompression",
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user