Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions terminator-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1323,9 +1323,13 @@ async fn run_workflow(transport: mcp_client::Transport, args: McpRunArgs) -> any

info!("Executing workflow with {steps_count} steps via MCP");

// For local files, use file:// URL to avoid verbose logging
let workflow_str = if resolved_type == InputType::File {
info!("Using file:// URL for local file");
// Check if we're using a remote HTTP transport
let is_remote_http = matches!(transport, mcp_client::Transport::Http(_));

// For local files with stdio transport, use file:// URL to avoid verbose logging
// For remote HTTP transport, send the workflow content directly
let workflow_str = if resolved_type == InputType::File && !is_remote_http {
info!("Using file:// URL for local file with stdio transport");

// Convert to absolute path and create file:// URL
let abs_path = std::fs::canonicalize(&args.input)
Expand Down Expand Up @@ -1621,9 +1625,13 @@ async fn run_workflow_once(
}
}

// Check if we're using a remote HTTP transport
let is_remote_http = matches!(transport, mcp_client::Transport::Http(_));

// For cron jobs, use simple execution to avoid connection spam
// For local files, use file:// URL to avoid verbose logging
let workflow_str = if resolved_type == InputType::File {
// For local files with stdio transport, use file:// URL to avoid verbose logging
// For remote HTTP transport, send the workflow content directly
let workflow_str = if resolved_type == InputType::File && !is_remote_http {
// Convert to absolute path and create file:// URL
let abs_path = std::fs::canonicalize(&args.input)
.with_context(|| format!("Failed to resolve path: {}", args.input))?;
Expand Down
8 changes: 5 additions & 3 deletions terminator-mcp-agent/src/server_sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ impl DesktopWrapper {
if let Some(url) = &args.url {
info!("Fetching workflow from URL: {}", url);

let workflow_content = if url.starts_with("file://") {
// Handle local file URLs
let workflow_content = if url.starts_with("file://") || (!url.starts_with("http://") && !url.starts_with("https://")) {
// Handle local file URLs and plain file paths
let file_path = url.strip_prefix("file://").unwrap_or(url);
info!("Reading file from path: {}", file_path);

Expand Down Expand Up @@ -188,8 +188,10 @@ impl DesktopWrapper {
)
})?
} else {
// This branch should never be reached due to the condition above,
// but kept for safety
return Err(McpError::invalid_params(
"URL must start with http://, https://, or file://".to_string(),
"URL must be a file path, file:// URL, or http(s):// URL".to_string(),
Some(json!({"url": url})),
));
};
Expand Down
2 changes: 1 addition & 1 deletion terminator-mcp-agent/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ pub struct SequenceStep {
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, Default, JsonSchema)]
pub struct ExecuteSequenceArgs {
#[schemars(
description = "Optional URL to fetch workflow definition from (HTTP/HTTPS or file:// supported)."
description = "Optional URL or file path to fetch workflow definition from. Supports: plain file paths (e.g., 'workflow.yml'), file:// URLs, and HTTP/HTTPS URLs."
)]
pub url: Option<String>,
#[schemars(
Expand Down
Loading