AgentSdkTransportSelector class final

Picks the transport to use and owns the availability verdict.

Candidates are tried in order, and the order is the meaningful part: the hosted transport comes first because when VS Code is already running it costs nothing and holds the credential itself, and the standalone transport follows because starting a process is the fallback, not the default.

Properties

active → AgentSdkServerTransport?
The selected transport, or null when none is reachable.
no setter
candidates → List<AgentSdkServerTransport>
The candidates, in preference order.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isAvailable → bool
The availability gate. A field read — see the library doc for why that matters.
no setter
isInstalling → bool
Whether an install is running.
no setter
needsInstall → bool
Whether a candidate is waiting for the user to install its server — the condition under which the availability notice offers Install. A field read.
no setter
notices → Stream<AgentSdkNotice>
Emits once per unavailability episode: when selection first fails, when a live transport drops, and on each explicit retry that fails. Never on a read of isAvailable.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
unavailableKind → AgentSdkUnavailableKind?
What kind of unavailable the gate is, or null when it is open.
no setter
unavailableReason → String?
Why the gate is shut, or null when it is open.
no setter

Methods

dispose() → Future<void>
Closes every candidate, including ones never selected (a candidate that failed after starting a child process still has one to reap).
initialize() → Future<void>
Probes and connects the first reachable candidate.
install({void onProgress(String line)?}) → Future<AgentSdkInstallOutcome>
Installs the server of the candidate that reported AgentSdkUnavailableKind.notInstalled, then retries selection, so a successful install opens the gate without a second action.
markLost(LlmTransportException error) → void
Records that the active transport was lost mid-use.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replaceCandidates(List<AgentSdkServerTransport> candidates) → Future<void>
Replaces the candidates — an endpoint the user moved, such as the CLI server's port — and closes the old ones. The gate is shut until the next initialize or retry selects among the new candidates; a session still on an old transport restarts on the next run's.
retry() → Future<bool>
An explicit, user-initiated retry. Unlike initialize this always reports its outcome, because the user asked and is waiting for an answer.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited