Skip to content
Merged
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
2,038 changes: 1,766 additions & 272 deletions ATTRIBUTIONS-Rust.md

Large diffs are not rendered by default.

118 changes: 116 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ hyper = "1"
hyper-util = { version = "0.1", features = ["tokio"] }
dialoguer = { version = "0.11", default-features = false, features = ["password"] }
jsonschema = { version = "0.46.6", default-features = false }
listeners = "0.4"
log = { version = "0.4", features = ["kv"] }
percent-encoding = "2"
reqwest = { version = "0.12", default-features = false, features = ["charset", "http2", "json", "rustls-tls-native-roots", "stream"] }
Expand All @@ -72,6 +73,9 @@ zstd = "0.13"
[target.'cfg(unix)'.dependencies]
libc = "0.2"

[target.'cfg(any(unix, windows))'.dependencies]
sysinfo = { version = "0.38", default-features = false, features = ["system"] }

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_Security", "Win32_Security_Authorization", "Win32_Storage_FileSystem", "Win32_System_Diagnostics_ToolHelp", "Win32_System_JobObjects", "Win32_System_SystemInformation", "Win32_System_Threading"] }

Expand Down
27 changes: 26 additions & 1 deletion crates/cli/src/bootstrap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,33 @@ pub(crate) fn plugin_idle_timeout() -> Result<Duration, String> {
Ok(Duration::from_secs(seconds))
}

/// Returns the persistent MCP gateway heartbeat interval.
pub(crate) fn plugin_heartbeat_interval() -> Result<Duration, String> {
Ok((plugin_idle_timeout()? / 3).clamp(Duration::from_millis(100), Duration::from_secs(30)))
let idle_timeout = plugin_idle_timeout()?;
let Ok(raw) = env::var(crate::configuration::PLUGIN_HEARTBEAT_INTERVAL_ENV) else {
return Ok((idle_timeout / 3).clamp(Duration::from_millis(100), Duration::from_secs(3)));
};
let seconds = raw.parse::<u64>().map_err(|error| {
format!(
"{} must be a positive integer: {error}",
crate::configuration::PLUGIN_HEARTBEAT_INTERVAL_ENV
)
})?;
if seconds == 0 {
return Err(format!(
"{} must be greater than 0",
crate::configuration::PLUGIN_HEARTBEAT_INTERVAL_ENV
));
}
let heartbeat_interval = Duration::from_secs(seconds);
if heartbeat_interval >= idle_timeout {
return Err(format!(
"{} must be shorter than {}",
crate::configuration::PLUGIN_HEARTBEAT_INTERVAL_ENV,
crate::configuration::PLUGIN_IDLE_TIMEOUT_ENV
));
}
Ok(heartbeat_interval)
}

#[cfg(test)]
Expand Down
Loading
Loading