#[non_exhaustive]pub enum Transport {
Default,
Stdio,
InProcess,
Tcp {
port: u16,
connection_token: Option<String>,
},
External {
host: String,
port: u16,
connection_token: Option<String>,
},
}Expand description
How the SDK communicates with the CLI server.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Default
Resolve the transport from COPILOT_SDK_DEFAULT_CONNECTION, falling
back to Transport::Stdio when the variable is unset.
Stdio
Communicate over stdin/stdout pipes (default).
InProcess
Host the runtime in-process over FFI (no child process).
Loads the native runtime library next to the resolved CLI entrypoint
and speaks JSON-RPC over its C ABI. The runtime spawns its
own worker; the SDK never launches a CLI child process. This is
experimental. Per-client ClientOptions::working_directory,
ClientOptions::env/ClientOptions::env_remove,
ClientOptions::telemetry, and ClientOptions::github_token are
not supported because native runtime code shares the host process.
ClientOptions::base_directory remains supported because it is
passed to the spawned worker as COPILOT_HOME.
Requires the bundled-in-process Cargo feature.
Tcp
Spawn the CLI with --port and connect via TCP.
Fields
External
Connect to an already-running CLI server (no process spawning).