Skip to main content

Crate ag_agent

Crate ag_agent 

Source
Expand description

External-agent adapters implementing the ag-contracts execution contracts.

This crate owns provider discovery, prompt translation, CLI/app-server transports, retries, and resource cleanup. Shared execution contracts live in ag-contracts; the built-in selection catalog lives in ag-session. Only ag-runtime constructs these adapters; application workflows receive worker clients instead of concrete transports.

Structs§

AgentCliInfo
One locally runnable agent CLI and the installed version refreshed at startup.
AppServerTurnRequest
Input payload for one app-server turn execution.
AppServerTurnResponse
Normalized result for one app-server turn.
BuildCommandRequest
Request payload used to build provider transport commands.
RealAgentAvailabilityProbe
Production availability probe backed by PATH executable discovery.
RealOneShotClient
Production OneShotClient that routes through the selected provider.
StaticAgentAvailabilityProbe
Availability probe that returns one caller-provided snapshot.

Enums§

AgentBackendError
Error type for backend setup and command construction failures.
AgentCliVersion
Automatic update and version probe state for one locally runnable agent CLI.
AgentTransport
Transport runtime used to execute turns for one backend.
AppServerError
Typed error returned by app-server infrastructure operations.
AppServerStreamEvent
Incremental event emitted during one app-server turn.

Traits§

AgentAvailabilityProbe
Detects which provider CLIs are locally runnable on the current machine.
AgentBackend
Builds and configures external agent CLI commands.
AppServerClient
Persistent app-server session boundary used by session workers.

Functions§

cleanup_session_worktree_artifacts
Removes provider-owned worktree artifacts derived from one session folder.
create_agent_channel
Creates the provider-specific channel for the given agent kind.
create_app_server_client
Returns the app-server client for the selected provider when applicable.
create_backend
Creates the backend implementation for the selected agent provider.
executable_name
Returns the CLI executable name used by the provided agent kind.
instruction_bootstrap_key
Returns the opaque persisted bootstrap key for a provider conversation.
transport_mode
Returns transport mode for the selected provider.

Type Aliases§

AppServerFuture
Boxed async result used by AppServerClient trait methods.