Expand description
SSH host probing for remote source setup.
This module provides functionality to probe SSH hosts and gather comprehensive information needed for remote source configuration decisions:
- Whether cass is installed (and what version)
- Index status (session count)
- Detected agent session data directories
- System information (OS, architecture)
- Resource availability (disk space, memory)
§Design
Probing uses a single SSH session per host to minimize latency. A bash probe
script is piped to bash -s on the remote, gathering all information in one
round-trip.
§Example
ⓘ
use coding_agent_search::sources::probe::{probe_host, probe_hosts_parallel};
use coding_agent_search::sources::config::DiscoveredHost;
// Single host probe (returns HostProbeResult directly, not Result)
let host = DiscoveredHost { name: "laptop".into(), .. };
let result = probe_host(&host, 10);
if result.reachable {
println!("Connected in {}ms", result.connection_time_ms);
}
// Parallel probing with progress (synchronous, uses rayon internally)
let results = probe_hosts_parallel(&hosts, 10, |done, total, name| {
println!("Probing {}/{}: {}", done, total, name);
});Structs§
- Detected
Agent - Detected agent session data on a remote host.
- Host
Probe Result - Result of probing an SSH host.
- Probe
Cache - Cache for probe results to avoid repeated probing.
- Resource
Info - Resource information for installation feasibility.
- System
Info - System information gathered from remote host.
Enums§
- Cass
Status - Status of cass installation on a remote host.
Constants§
- DEFAULT_
PROBE_ TIMEOUT - Default connection timeout in seconds.
Functions§
- deduplicate_
probe_ results - Deduplicate probe results that point to the same physical machine.
- probe_
host - Probe a single SSH host.
- probe_
hosts_ parallel - Probe multiple hosts in parallel.