mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-10 20:32:31 +00:00
Refactor automation for strict Clippy checks
This commit is contained in:
1 parent
8bc939cf3b
commit
ddaf299335
4 files changed
+11
-4
No files matched your search
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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}");
|
||||
|
||||
Reference in new issue
Block a user