diff --git a/crates/automation/src/server/conventions.rs b/crates/automation/src/server/conventions.rs index 6e2740041d..b48c41db87 100644 --- a/crates/automation/src/server/conventions.rs +++ b/crates/automation/src/server/conventions.rs @@ -1,7 +1,10 @@ //! Catalog metadata, strict tool envelopes and live resources. -use super::*; +use super::{Arc, Backend, BatchParams, DocIndex, ListParams, McpError, Parameters, PhotocraftMcp, RunParams, ServerHandler, Value, json}; use rmcp::RoleServer; -use rmcp::model::*; +use rmcp::model::{ + CallToolRequestParams, CallToolResponse, Implementation, ListResourcesResult, ListToolsResult, PaginatedRequestParams, ReadResourceRequestParams, + ReadResourceResponse, ReadResourceResult, ServerCapabilities, ServerConfig, Tool, ToolAnnotations, +}; use rmcp::service::RequestContext; const DOCUMENT: &str = "photocraft://document"; diff --git a/crates/automation/src/server/progress.rs b/crates/automation/src/server/progress.rs index 4182743083..1844203f8e 100644 --- a/crates/automation/src/server/progress.rs +++ b/crates/automation/src/server/progress.rs @@ -1,5 +1,5 @@ //! Render Video runs on the existing blocking worker; rmcp remains available for ping/cancel. -use super::*; +use super::{CallToolResult, PhotocraftMcp, Value, fail, no_backend, ok_json}; use rmcp::RoleServer; use rmcp::model::ProgressNotificationParam; use rmcp::service::RequestContext; diff --git a/crates/automation/src/server/transport.rs b/crates/automation/src/server/transport.rs index 82e96b13c3..87a98e0305 100644 --- a/crates/automation/src/server/transport.rs +++ b/crates/automation/src/server/transport.rs @@ -1,5 +1,5 @@ //! Recover malformed JSON lines before passing valid messages to rmcp. -use super::*; +use super::{AutomationError, PhotocraftMcp, ServiceExt, Value, json}; use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; use crate::security::MAX_REQUEST_BYTES; diff --git a/crates/automation/src/workspace/tests.rs b/crates/automation/src/workspace/tests.rs index 63a5b0b8c7..ad5138ef12 100644 --- a/crates/automation/src/workspace/tests.rs +++ b/crates/automation/src/workspace/tests.rs @@ -338,6 +338,10 @@ fn filesystem_commands_fail_closed() { for id in ["layer.smartObjects.editContents", "layer.smartObjects.convertToLayers"] { assert!(authorize_engine_command(id, &serde_json::json!({"path": "/outside/source.psb"})).is_err(), "{id}"); } +} + +#[test] +fn filesystem_command_paths_and_profiles_fail_closed() { // The UI-level examples in docs/control-protocol.md. for id in ["view.zoomIn", "window.theme.pro", "edit.search"] { assert!(authorize_desktop_engine_command(id, &serde_json::json!({})).is_ok(), "{id}");