Skip to main content

Module probe

Module probe 

Source
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§

DetectedAgent
Detected agent session data on a remote host.
HostProbeResult
Result of probing an SSH host.
ProbeCache
Cache for probe results to avoid repeated probing.
ResourceInfo
Resource information for installation feasibility.
SystemInfo
System information gathered from remote host.

Enums§

CassStatus
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.