Skip to main content

Agent

Struct Agent 

Source
pub struct Agent {
Show 14 fields pub description: Option<String>, pub purpose: Option<String>, pub runner: Option<String>, pub model: Option<String>, pub prompt: Option<String>, pub prompt_file: Option<PathBuf>, pub access: Access, pub entry: bool, pub resident: bool, pub fuel_usd: Option<f64>, pub env_from: Vec<String>, pub mcp: BTreeMap<String, McpServer>, pub recovery: RecoveryPolicy, pub work_dir: Option<PathBuf>,
}
Expand description

A configured agent.

Fields§

§description: Option<String>

One line saying what this agent is.

Handed to peers by layover_peers(), so a sending agent can tell who is worth talking to without the topology being hard-coded into its prompt.

§purpose: Option<String>

A longer statement of what the agent is for and when to route work to it.

§runner: Option<String>

Runner to invoke; falls back to crate::config::Defaults::runner.

§model: Option<String>

Model identifier passed to the runner.

§prompt: Option<String>

The agent’s standing instructions, written inline.

Mutually exclusive with Agent::prompt_file; use Agent::prompt_spec rather than reading either field directly.

§prompt_file: Option<PathBuf>

The agent’s standing instructions, read from a file that may compose others.

§access: Access

Whether the agent may write to the shared workspace.

§entry: bool

Whether a human may send flights directly to this agent.

A named crate::pipeline::Pipeline also makes its entry agent reachable. This flag is the lower-level permission, useful for an agent you want to be able to poke by hand without declaring a trigger for it.

§resident: bool

Whether the agent is pinned resident rather than transient.

§fuel_usd: Option<f64>

Per-agent Fuel override, applied when an itinerary starts at this agent.

§env_from: Vec<String>

Names of environment variables forwarded to this agent’s own CLI.

The agent CLI needs credentials of its own before it can do anything: copilot wants a GITHUB_TOKEN, claude an ANTHROPIC_API_KEY. Those are separate from the ones its MCP servers need, which are declared per server in crate::mcp::McpServer::env_from, and they are separate on purpose — the agent that publishes releases holds the publishing token, and the one that reads telemetry does not.

Only names appear here. The Tower reads each value from its own environment at spawn time, so layover.toml stays a file you can commit. A name that is not set refuses the run rather than starting a CLI that will fail to authenticate several seconds later.

crate::config::Defaults::env_from covers the common case of every agent using the same CLI credential; the two are combined rather than overriding one another.

§mcp: BTreeMap<String, McpServer>

MCP servers this agent may reach, keyed by name.

Layover’s own server is always wired up; these are the ones the agent needs to do its job — a telemetry agent’s Kusto endpoint, a publisher’s issue tracker. Secrets never appear here: see crate::mcp.

§recovery: RecoveryPolicy

Whether interrupted work for this agent may be restarted without asking.

The question is not whether the Tower can restart it but whether doing the work twice is safe. An agent that opened a pull request would open a second.

§work_dir: Option<PathBuf>

Directory this agent works in, overriding [layover] work_dir.

For an agent whose job is somewhere else entirely — mining telemetry from a different checkout, say. Resolved relative to the configuration file.

Implementations§

Source§

impl Agent

Source

pub fn prompt_spec(&self) -> Result<PromptSpec, PromptSpecError>

Returns where this agent’s prompt comes from.

§Errors

Returns PromptSpecError when neither form is given or when both are.

Source

pub fn description_or_placeholder(&self) -> &str

Returns the one-line description, or a placeholder when none was configured.

Trait Implementations§

Source§

impl Clone for Agent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Agent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Agent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

§

impl Freeze for Agent

§

impl RefUnwindSafe for Agent

§

impl Send for Agent

§

impl Sync for Agent

§

impl Unpin for Agent

§

impl UnsafeUnpin for Agent

§

impl UnwindSafe for Agent

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V