Skip to main content

Crate adam

Crate adam 

Source
Expand description

§adam

The facade of adam-rs: one dependency for writing an agent. It re-exports adam-llm-agent (with its schema feature), the #[tool] macro of adam-macros, and the model, runtime, core and error crates as modules (adam::model, adam::runtime, adam::core, adam::error), adam-agent-fs as adam::agent_fs, adam-assembly as adam::assembly, and it adds a prelude and the include_agent! macro.

[dependencies]
adam = "0.1"
FeatureDefaultWhat
macrosyes#[tool] (adam::tool, and in the prelude)
remoteyesremote subagents (a2a: in a subagent file): the A2A client, an HTTP client and TLS (turns on adam-assembly/remote; see Without remote subagents). An application that embeds adam (ADR 0047) turns it off with default-features = false, and bind then refuses an a2a: subagent with Error::RemoteNotEnabled. This crate depends on adam-assembly without its defaults, so a crate that turns adam’s off gets no remote
a2anoAssembly::card: the root agent’s card: as an adam_a2a::AgentCardConfig (turns on adam-assembly/a2a, and with it adam-assembly/remote)
mcpnomcp.json tools: adam::mcp (the MCP client: McpPolicy, Env, McpServers) and AgentDef::connect_mcp, which connects each agent’s MCP servers at startup and gives it their tools as <server>__<tool> (turns on adam-assembly/mcp; see MCP tools). Off by default: a build cannot start a process or reach a server because an mcp.json said so unless it opts in
devnodev reload: adam::LiveAssembly watches the agent directory and swaps the agents when a file changes (turns on adam-assembly/dev, which brings notify). Off by default, so a release build cannot watch and reload prompts unless it opts in. Reading a folder once, at startup, needs no feature: adam::AgentFolder

Breaking: remote subagents are the feature remote. A crate that depends on adam with default-features = false (for example features = ["macros"]) had them and now has not: it still compiles, and bind refuses an a2a: subagent with Error::RemoteNotEnabled. Add "remote" to its features to keep them.

adam::EXTRA_MCP_FILE_ENV (ADAM_EXTRA_MCP_FILE) and adam::extra_mcp_file_from_env() name a file of extra MCP servers, in the shape of mcp.json, that a binary adds to the agent’s own with AgentDef::with_extra_mcp_file (a name both have is an error; AgentDef::mcp_env_references lists the ${VAR} names of every local agent’s servers). No feature for those; connecting the servers is the feature mcp. See extra MCP servers and ADR 0018. adam::agent_fs::McpServer has the field optional (optional: true in the file: a server that may be missing at startup).

The authoring layer around it (agent directories, skills, subagents) is designed in docs/reference/agent-files.md. What exists: #[tool], the agent directory embedded at build time (adam::include_agent!(), below), and AgentDef, which binds it to LlmAgents (adam-assembly, also adam::assembly), adam::AgentFolder, which reads one agent’s folder when the process starts (ADAM_AGENT_DIR, no feature; see run-time folders), and, with the feature dev, adam::LiveAssembly, which reloads the directory while the process runs (the rules for runs in flight are in the dev reload section).

§#[tool]

An async fn becomes a tool. The function stays as it is (call it directly in a unit test), and a unit struct named after it (get_weather becomes GetWeather) implements Tool.

use std::sync::Arc;

use adam::model::MockModel;
use adam::prelude::*;

/// Shared state: any `Send + Sync + 'static` type the agent is given.
struct Units(&'static str);

/// Get the current weather for a city. Say which city; the answer is
/// in the agent's configured units.
#[tool]
pub async fn get_weather(
    units: State<Units>,
    /// The city, for example "Berlin"
    city: String,
    /// Days of forecast to include (default 0)
    #[serde(default)]
    days: u32,
) -> Result<String, ToolError> {
    if city.trim().is_empty() {
        return Err(ToolError::Permanent("city is empty".into()));
    }
    Ok(format!("{city}: 18 degrees {} (+{days} days)", units.0))
}

// The spec is what the model sees: name from the function, description from its doc comment,
// property descriptions from the parameter docs, `required` from the types.
let spec = GetWeather.spec();
assert_eq!(spec.name, "get_weather");
assert_eq!(
    spec.description,
    "Get the current weather for a city. Say which city; the answer is in the agent's configured units."
);
assert_eq!(spec.parameters["required"], serde_json::json!(["city"]));
assert_eq!(spec.parameters["properties"]["city"]["description"], "The city, for example \"Berlin\"");

// `State<Units>` is checked when the agent is built, not in the middle of a run.
let _agent = LlmAgent::builder("assistant", Arc::new(MockModel::new()), "my-model")
    .state(Arc::new(Units("C")))
    .tools(tools![GetWeather])
    .try_build()
    .expect("every tool has its state");

§What the macro accepts

In the functionBecomes
the doc comment (required)the tool’s description. Wrapped lines are joined with a space; a blank line keeps a paragraph break; list items, headings, quotes and fenced code keep their own lines
a doc comment on a parameterthat argument’s description in the schema
name: Ta field of the generated arguments struct, which derives Deserialize and JsonSchema. T must be owned; Option<T> and #[serde(default)] make it optional
#[serde(..)], #[schemars(..)] on a parametercopied to that field
&ToolCtx (at most one, any position)the call’s context: run id, call id, cancellation, progress
State<T> (any number)the shared T from the agent, read with ctx.require_state::<T>()? and reported by Tool::required_state, so try_build fails at startup when it is missing
#[args] a: MyArgsan existing Deserialize + JsonSchema struct as the whole argument object; the only model argument
the return typeResult<T, E> or a bare T, with T: IntoToolOutput (ToolOutput, String, &'static str, Value, Json<S>) and E: Into<ToolError>

Bad input from the model is not an error of the run: a JSON mismatch becomes a ToolOutput::error (the text is “invalid arguments for get_weather: missing field city”, with backticks around the names) that the model reads and corrects. The call still runs inside LlmAgent’s journaled tool:CALL_ID step, so the retry rules of the Tool docs apply unchanged.

Options, #[tool(..)]:

OptionMeaning
name = "..."the tool’s name; default the function’s. Must match ^[a-z][a-z0-9_]{0,63}$
type = Namethe generated struct; default the function’s name in UpperCamelCase. It has the function’s visibility
strictunknown argument fields are refused (deny_unknown_fields, and additionalProperties: false in the schema)
classifythe error type is adam::error::Classify (adam_error::Classify): retryable classes become ToolError::Transient (or Retryable with the class, for a rate limit or a conflict), the others Permanent (ToolError::from_classified)
retry(attempts = 3, backoff = "1s", max_backoff = "30s", multiplier = 2.0, on = ["rate-limited"])the tool’s retry policy (Tool::retry_policy, ADR 0061): its failures are counted under tool:<name> and retried attempts times in all (required, at least 1) with that backoff (durations 500ms, 1s, 30m, 1h; max_backoff not under backoff; what is left out is RetryPolicy’s default, not the runtime’s configured policy: 1 s, 60 s, 2.0; a max_backoff under 1 s needs a backoff) for the classes in on (transient, rate-limited, conflict; default all three). A policy set for the tool by name (an agent folder’s retry:) wins over it
pagedthe tool’s results are pages of the paging convention (offset and limit in, one final line out): the generated Tool::paged says true, and the loop’s 64 KiB cap on a result then tells the model to call again with a later offset. Never inferred from an argument called offset
asks_userthe tool can end a call with ToolError::NeedsInput: the generated Tool::asks_user says true, so the loop runs such a call alone. A subagent may have it: whether the person can be asked is decided per run (a round of a kept-open session a client shows asks; any other child run is told nobody can answer it)
step = "subagent", label = "Hand to the helper", icon = "agent"how a call is drawn as a step (Tool::step_style): step is the kind (subagent, tool, command, message; default tool), label replaces the tool’s name as the label, icon is one of agent, read, edit, delete, move, search, execute, think, fetch, web, git, test, file, tool, opencode (the orchestration layer’s steps/v1; any other word is a compile error that lists them). Any one of them is enough
parallel = "independent" | "read" | "write" | "exclusive", path = "<argument>", access = path::to::fnwhat a call shares with the other calls of its turn (Tool::access, ADR 0049). independent shares nothing; read and write use the scope files, or files/<value of the argument named by path> (normalised lexically: ./ and . dropped; an absolute path or one with .. widens to files); exclusive is Alone; access names a fn(&serde_json::Value) -> ToolAccess for anything else (parallel and access are exclusive, path goes with read or write and must name an argument). Two calls conflict when one is Alone, or their scopes overlap (equal, or a prefix at a /) and one writes. Without any of them the tool is Alone: it runs by itself
crate = pathwhere Tool and __private live; default ::adam. ::adam_llm_agent works without the facade, see below

The schema is computed once per tool (a OnceLock) and is draft 2020-12 with subschemas inlined, no $schema and no title (see spec_for in adam-llm-agent).

§Without the facade

A crate that depends on adam-llm-agent alone (feature schema) points the macro at it:

use adam_llm_agent::{ToolError, ToolOutput};
use adam_macros::tool;

/// Echo the text back.
#[tool(crate = ::adam_llm_agent)]
async fn echo(text: String) -> Result<ToolOutput, ToolError> {
    Ok(ToolOutput::text(text))
}

adam_llm_agent::__private carries the paths the generated code needs (serde, schemars, async_trait, spec_for, parse_args, …), so the crate using the macro needs none of them itself. Your own #[derive(Deserialize, JsonSchema)] types (for #[args], or as an argument type) still need serde and schemars in your Cargo.toml; adam-llm-agent‘s schema feature enables schemars’ derive.

§Agent directories: include_agent!

An agent written as Markdown files (agent/instructions.md, skills, subagents, mcp.json) is compiled into the binary by a build script and included with one line.

[dependencies]
adam = "0.1"

[build-dependencies]
adam-agent-fs = { version = "0.1", features = ["build"] }
ⓘ
// build.rs: parses and validates agent/ before rustc runs; a mistake is a build error with
// file:line, and a new or changed file reruns the script.
fn main() -> Result<(), adam_agent_fs::BuildError> {
    adam_agent_fs::build("agent").emit()?;
    Ok(())
}
ⓘ
// src/main.rs
adam::include_agent!(); // AGENTS, AGENT (for agent/) and PACKAGE, all `'static`

fn main() {
    println!("{} {}", AGENT.name, AGENT.digest);      // the digest identifies these exact files
    println!("{}", AGENT.instructions.body);          // the prompt, no parsing at startup
    for skill in AGENT.skills {                       // the catalog
        println!("{}: {}", skill.name, skill.description);
    }
}

AGENT is a &'static adam::agent_fs::EmbeddedAgent. PACKAGE is an EmbeddedPackage, a ManifestSource like adam::agent_fs::Dir, so the same Package can come from the binary or from a directory at run time and the two compared. The macro is include!(concat!(env!("OUT_DIR"), "/adam_agent.rs")) and nothing else; it needs the build script and a crate that depends on adam (the generated code names ::adam::agent_fs; use .crate_path("::adam_agent_fs") when it depends on adam-agent-fs directly). adam-agent-fixture is a complete example with tests.

§Binding the agent: AgentDef

AgentDef (in the prelude, from adam-assembly) turns the embedded agent, or one read from a directory, into LlmAgents. Every mistake is found at startup, with the agent and the file in the message.

ⓘ
use std::sync::Arc;
use adam::prelude::*;

adam::include_agent!();

let assembly = AgentDef::from_manifest(AGENT)?            // or an AgentManifest from a Dir
    .var("repo", "acme/widgets")                          // a value for {{repo}} in the prompt
    .bind(tools![PrepareWorkspace, RunChecks, AskUser])?  // `tools:` in the files must name these
    .state(Arc::new(env))                                 // what `State<T>` parameters read
    .model(model, "coder-large")?;                        // one client; the default gateway alias

let runtime = assembly.register(Runtime::builder(store)).build(); // the root and every subagent

A typo in the files fails bind: a tools: [run_check] gets agent `coder` (agent/instructions.md): `tools` names `run_check`, which is not a registered tool; did you mean `run_checks`?, and so do a {{placeholder}} that vars does not declare, a var that is never used, and a var with no value. The stages, the rules for tools, vars, models, state and skills, and the seams left for subagents are in the adam-assembly README. Assembly::info() describes each agent made (name, alias, rendered prompt, tools, skills, limits); with the a2a feature, Assembly::card(url, version) is the root’s AgentCardConfig (AgentDef::card gives it before anything is bound).

An agent’s skills/ need no code: the prompt gets a catalog (name and description of each skill) and the agent gets a load_skill tool (a page of the body of SKILL.md, by a plain string name) and a read_skill_file tool (a page of a bundled text file), the Agent Skills progressive disclosure. preload_skills: puts a body in the prompt instead; AgentDef::run_skills lets the root load skills a run finds (<source>/<skill>). It works the same for the embedded agent and for a directory read with AgentDef::from_source.

§Compile errors

The macro checks what it can and says so where you wrote it:

MistakeMessage
no doc comment#[tool] needs a doc comment: it is the description the model reads
not async#[tool] functions must be async
generic, where, or impl Trait#[tool] functions cannot be generic; model arguments are deserialized into concrete types
self receiver#[tool] works on free functions; put shared state in State<T>
&str argumentmodel arguments must be owned (String, not &str): they are deserialized from JSON
two &ToolCtxat most one &ToolCtx parameter
#[args] with another model argument#[args] must be the only model argument
a bad tool nametool names must match ^[a-z][a-z0-9_]{0,63}$
an unknown optionunknown #[tool] option aproval; expected one of: name, type, strict, classify, asks_user, paged, crate, step, label, icon, parallel, path, access, retry
on a struct or trait#[tool] goes on an async fn

Every mistake of one function is reported in one compile. rustc reports the rest, with messages written for it: an argument type without Deserialize or JsonSchema (“Foo cannot be a #[tool] argument”), and a return type that is not a tool result.

§Tests

  • crates/adam-macros/src/expand.rs: unit tests of the expansion on token streams (every option, every parameter kind, every error message, the doc-comment joining).
  • tests/tool_macro.rs: generated tools through a real LlmAgent and MockModel on the in-memory store: arguments in, output back, bad input, state, try_build, cancellation context, classify.
  • tests/ui.rs: trybuild. tests/ui/pass/*.rs must compile, tests/ui/fail/*.rs must fail with the message in the .stderr beside it (errors the macro produces, stable across toolchains). The errors rustc itself produces (tests/ui/rustc/*.rs) change wording between toolchains, so they run only with ADAM_TRYBUILD=1, in the CI job pinned to one toolchain. To regenerate snapshots: TRYBUILD=overwrite cargo test -p adam --test ui (and with ADAM_TRYBUILD=1 for the rustc ones).
  • The example above is a doctest.

Re-exports§

pub use adam_agent_fs as agent_fs;
pub use adam_assembly as assembly;
pub use adam_core as core;
pub use adam_error as error;
pub use adam_mcp as mcp;
pub use adam_model as model;
pub use adam_runtime as runtime;

Modules§

paging
One convention for every tool that reads: offset and limit in, a page and one last line out.
prelude
What an agent’s source file usually wants: use adam::prelude::*;.

Macros§

include_agent
Include the agent that build.rs embedded: adam::include_agent!(); at module level.
tools
Build a ToolSet from tool values, in order: tools![Clock, Search::new()].

Structs§

AgentDef
An agent as its files describe it, before it is tied to tools, state and a model.
AgentFolder
One agent, read from a folder at run time: the definition, what the load warned about, and the digest that names these exact files.
AgentInfo
What one bound agent is, without its LlmAgent (which does not expose it). Two definitions that bind to equal AgentInfos make equal agents; that is how the tests compare an embedded agent with the same files read from a directory.
Approval
A tool call a before_tool hook asked a person to approve (ADR 0050, decision 12, slice H8).
Artifact
A named piece of output produced while a run works (a file, a report, a structured result). A2A maps these to task artifacts.
ArtifactRef
Name and media type of an artifact a tool produced (the content itself lives in RunView::artifacts).
Assembly
The agents an AgentDef makes: the root and one LlmAgent for each local subagent definition, ready to register on a runtime.
BoundDef
An agent definition whose tools are bound and whose prompts are rendered, waiting for the state its tools need and for a model. Made by AgentDef::bind.
Compaction
One compaction of a run, in Conversation::compactions.
Conversation
The state of an LlmAgent run: the persisted history plus the bookkeeping the loop needs to resume from any commit.
EventHeader
Who an event is about, and when: the part every event carries.
EventQueue
Events in the order they happened, held until the flush before a commit.
EventSpec
A custom event as it is declared: the name it is emitted under, the version of its data, the JSON Schema of its data (what a consumer reads; the loop bounds the data’s size, it does not validate against the schema) and who may see it.
Extensions
A map from a type to one shared value of that type (at most one per type).
FlushReport
What a flush did, for a log line and a count. It never changes the run.
FnTool
A Tool made from a name, a description, an argument schema and a closure: for tools whose shape is known only at run time (a tool discovered from another service, say) or that are too small to deserve a type.
FnToolBuilder
Builds a typed FnTool: FnTool::builder("echo").description("...") .args::<EchoArgs>().handler(|ctx, args| async move { ... }).
HookDecision
One decision a hook set made about a call, as the call’s step records it (ADR 0050, decision 2).
HookError
Why a hook did not decide. A plugin that errors never lets the call through: the set answers this and the caller denies.
HookEvent
What an observer receives: a core event with its header and its bounded, scrubbed fields.
HookLimits
How long one hook may take, and how many times a transient failure is tried again.
HookSet
An ordered set of plugins, with their limits. A clone shares the plugins (Arcs): a host that gives one set to several agents (adam_assembly::BoundDef::hooks) runs the same plugins in each.
HookedCall
What a call is, as a hook sees it: the tool’s name and the arguments the model sent, which a plugin may rewrite in place.
HookedCompaction
What a compaction is, as a compaction.before hook sees it: the context a plugin may add to the summary request. The history, the cut and the model are not here, and a hook never writes the summary itself.
HookedEnd
The answer a run is about to end with, as a run.ending hook sees it. Read only: a hook never rewrites an answer, it asks for another try.
HookedMessage
What a person’s message is, as a message.received hook sees it: its text, which a plugin may rewrite in place, and its files by reference.
HookedModelRequest
What a model call is, as a model.request hook sees it: the sampling temperature and top-p, the bound on the answer’s length, the call’s metadata, headers and extra body, and what kind of call it is. A plugin may read the kind and rewrite the rest in place. The system prompt, the history, the model, its endpoint and its key are not here.
HookedOutput
What the journaled step tool:<call id> records: what the call answered, beside what the hooks decided about it (ADR 0050, decision 2).
HookedText
What a tool answered, as an after_tool hook sees it: the text the model will read, which a plugin may rewrite in place.
ImageGate
The admission rules for one run, from what the history holds now. A call that offers several images shares one gate, so the run’s count is kept across them.
ImageOutcome
What a tool gets back from keep_image.
ImageStore
The keeper an agent reaches through its state (KeptImages).
InboundImage
An image as an inbound message carries it: base64 data, and what the sender says of it. Its type and its name are checked, never trusted. Its Debug says how long the data is and never prints it.
Json
Returns T to the model as compact JSON text.
KeptImage
An image a tool wants the run to keep in its own state (ToolOutput::kept_images): what keep_image hands back when the agent has no ImageStore. Its Debug says how long the data is and never prints it.
KeptInfo
What a keeper kept.
KeptOutput
An output a tool wants the run to keep in its state: text under id (ToolOutput::kept).
KeptStore
The keeper an agent’s tools reach through ToolCtx::state.
LimitHit
A Limits bound a run reached.
Limits
Bounds on one run. A run that reaches max_turns or max_tool_calls gets one closing model call in which it may call no tool, and ends with that answer marked limited (the output’s limited and limit); if the closing call says nothing the run fails with a message naming the limit (RunView::error). The history limit shortens old tool outputs instead (see max_history_tokens).
LineFolder
Folds a streamed text the way prepare does, a piece at a time: a line over MAX_LINE_CHARS characters is folded onto several, a NUL is U+FFFD, and only complete lines are returned, so that a file written from them never ends in the middle of one (the pages of the lines already there do not change when more is written).
Listing
What a ToolSource offers for one model turn: the tools, and what it says about them (ToolNote).
LiveAssembly
The agents of a directory, reloaded when its files change. Only with the feature dev.
LiveBuilder
Builds a LiveAssembly. Made by LiveAssembly::builder; the hooks are the things a startup does between the stages, and they run again, in order, on every reload.
LlmAgent
A durable LLM tool-calling agent: instructions + a model + a toolset.
LlmAgentBuilder
Configures an LlmAgent. Start with LlmAgent::builder.
LlmStarter
The start-only half of an LlmAgent: it turns the first user message into the Conversation a run starts with, and needs neither a model nor tools.
Loaded
One group of tools a run has loaded, as the loader that loaded it recorded it.
Loader
A loader the run may still call: its name, and the tools a call would make available.
MemoryImages
Everything a KeptImages store must do (kept_images_conformance asserts it).
MemoryKept
A KeptOutputs in memory, for tests and for the conformance of the trait.
MessageDecision
What the step that takes a person’s message in records (message.received, ADR 0050 decision 9).
MessageFile
A file a person sent with a message, as a message.received hook sees it: by reference, never its bytes.
ModelBinding
The model a run’s call may be bound to besides the agent’s own, with what its profile resolves for it: the alias, the output cap and the default reasoning level (ADR 0064, amended 2026-11-23).
ModelParking
How a run waits on a model that refused it, or could not be reached (LlmAgentBuilder::model_parking).
ModelSwitch
A run’s switch to its agent’s fallback model: the model the endpoint refused, the one the run continues on, and the turn the refusal came at.
ModelWait
The model call a run waits to make again (Conversation::model_wait).
ObserveLimits
How long an observer may take, per event and for a whole flush.
Origin
Where a problem comes from: the agent, by its registration name (coder, coder/reviewer), and the file of the manifest that says it, relative to the source root (agent/instructions.md, agent/subagents/reviewer.md).
PendingQuestion
A tool call that asked the user a question and waits for the answer.
PendingRemote
A tool call that waits for a task on another system to finish.
PendingRun
A tool call that waits for a child run to finish.
PendingSession
A tool call that waits for the round of a child session to end (ADR 0045).
Plan
The plan of a conversation: items in display order, under an optional title.
PlanItem
One line of the plan.
PromptSize
How big the last model call’s prompt was, as the provider reported it, and how many messages the history held when it was made: the estimate of the next one starts from it.
ReadOutput
read_output { id, offset?, limit? }: reads a kept output page by page.
RecordedEvent
A custom event as the step that emitted it records it.
Refusal
Why an answer is not used, and the question that takes its place: see AnswerCheck::Refuse.
Reloaded
What a successful reload did.
RemoteInfo
A remote (A2A) subagent found in the files, as data. Its tool is in the parent’s AgentInfo::tools, made by AgentDef::bind with the URL and the token checked; this is what the files said.
Repeats
The last tool call of a run and how often in a row it has given the same answer: what the doom_loop rule reads. Both fields are hashes (the call’s tool name and canonical arguments, and the result’s content and error flag), so the state holds no copy of either.
SessionAgent
One subagent a session may be started on.
SessionTools
The five session tools, for the subagents of one agent.
SourceCtx
What a ToolSource sees of the run when the model is about to be called.
State
Shared state as a tool sees it: a cheap-to-clone handle to a T that the agent was given with LlmAgentBuilder::state. Derefs to T.
StateImage
What a state-kept image is: its type and its bytes in base64. Its Debug says how long the data is and never prints it.
StateKey
Names one type of shared state: what Tool::required_state returns, and what LlmAgentBuilder::try_build checks against the agent’s Extensions.
StepEvent
One report about a step: it started, moved, or ended.
StepIo
How a tool call’s step reports its input and output: what is scrubbed first, and how much is kept.
StepOutput
What a step’s call answered, bounded by the contract (steps/v1’s output).
StepStyle
How a tool call is drawn as a step: see Tool::step_style.
StreamScrubber
Scrubs an output as it streams, so that what is written is exactly the scrub of the whole and no secret is ever on disk in part.
Subscriptions
What an observer wants to be told: the core catalogue, patterns, or nothing.
ToolCtx
What a tool sees of the run it executes in.
ToolNote
What a ToolSource says, when it lists a tool, about how a call to it is carried out: not for the model, for the agent and for the source’s own call later.
ToolOutput
What a successful tool call returns.
ToolSet
An ordered group of tools, built once and handed to an agent.
TypedFnToolBuilder
The second half of FnToolBuilder: the arguments are known, the closure is not.
Use
One thing a call uses, and how.
Withheld
A tool a ToolSource holds back on one turn, and what to tell the model if it calls it anyway.

Enums§

Admission
What became of an image offered to the model.
AliasProblem
Why a model alias was refused.
AnswerCheck
What a tool says about an answer to its own question: see Tool::read_answer.
AssemblyError
Why an AgentDef could not be bound to agents.
BuildError
Why LlmAgentBuilder::try_build refused to build an agent.
CompactionReason
Why a history was compacted.
DeclarationError
Why a declaration or a subscription is refused. Every case is a build error: the class is [ErrorClass::Invalid], and a binary exits 78 on it.
EmitError
Why ToolCtx::emit_event refused an event. Nothing was recorded, and nothing will be sent. The class is [ErrorClass::Invalid]: the tool is wrong, and trying again changes nothing.
EventKind
A core event of the catalogue (ADR 0050, decision 5): the ones an observer reads.
ImageKeepError
Why an image could not be kept or loaded. The text is for logs and for a stand-in.
KeptError
Why a kept output could not be kept or read. The text is for the model.
LimitKind
Which Limits bound a run reached. Serialised as the bound’s name.
ModelCallKind
Which model call a model.request hook runs at.
ModelPark
How a run parked on the model wakes.
PendingWait
What a parked run is waiting for, so that one result can complete the call that owes it.
PlanStatus
Where an item stands.
ReloadError
Why a reload changed nothing. The last good version stays in force.
RemotePoll
What Tool::poll_remote found. Journaled, hence serializable.
StepIcon
The picture a step is drawn with: the contract’s vocabulary, and nothing else (an icon the screen does not know is ignored there, so a closed set is what an agent can mean).
StepKind
What kind of work a step is.
StepState
Where a step stands. The last three end it.
TemplateProblem
What is wrong with the {{ a template contains.
ToolAccess
What a call shares with the other calls of its turn: see Tool::access.
ToolError
Why a tool call did not produce an output.
UseMode
Whether a call reads or changes what its scope names.
Verdict
What a deciding hook says about the call it runs at.
Visibility
Who may see a custom event.

Constants§

ACCESS_TIER_CONTEXT_KEY
The context key under which a message carries the access tier the person picked for it (access-tier/v1): {"tier": "plan" | "edits" | "auto" | "bypass"}.
AFTER_PREVIOUS
The reserved argument name.
AFTER_PREVIOUS_INSTRUCTION
What the instructions say about AFTER_PREVIOUS: the sentence appended to them (after a blank line) when the limit is above 1. Exported as AFTER_PREVIOUS_INSTRUCTION, so a test can tell it from the agent’s own words.
AGENT_DIR_ENV
The environment variable that names the agent folder to read at run time: ADAM_AGENT_DIR=/etc/adam/agent.
CALLER_CONTEXT_KEY
The context key under which a message says who it was sent for (thread-tools/v1): the thread’s addressed agent, {"caller": "main"}, or an agent another agent asked, {"caller": "ask:<n>", ..}, read from the claims of the grant’s token. A run of an asked agent has no person behind it, which is a limit on what it may ask for.
CHILD_SESSIONS_CONTEXT_KEY
The context key under which a message says its client shows child sessions (child-sessions/v1 activated): true, written by the A2A front, and cleared by a message that did not activate the extension. It is what lets a session the model starts be one the person sees: a round of a kept-open session asks the person only when the header says they see it (SessionHeader::visible, ADR 0045 decision 9). Not one of PROTECTED_CONTEXT_KEYS: a context too large to keep it makes a child unable to ask, which is the safe way to lose it.
CLOSING_TURN
What the model is asked in the closing turn, the last model call of a run that reached max_turns or max_tool_calls. Sent after the history, as a user message that is not kept in it.
COMPACTION_BEFORE
The point where a history is about to be summarised, inside the summary’s journaled step (ADR 0050, slice H9).
COMPACTION_TURN
The instruction a summary request ends with: the request as it stands, then this as one more user message, with tool_choice: none. A request is a summary request when its tool choice is ToolChoice::None and its last message’s text ends with this (the closing turn also uses none, with another text).
DATA_MAX
The most data one custom event carries, serialized, in bytes: 4 KiB.
DEFAULT_MAX_PARALLEL
The most tool calls of one turn that run at the same time unless LlmAgentBuilder::max_parallel says otherwise.
DEFAULT_MODEL_PARK_LIMIT
How long parks on a timer in a row may last, from the first of them, unless ModelParking::limit says otherwise: 24 hours.
DEFAULT_TOOL_TIME_LIMIT
The longest a call of a tool that declares no Tool::time_limit may run: 300 s.
DEFAULT_WAIT_POLL
How long a run waiting for a child run sleeps before it looks at the child itself, unless LlmAgentBuilder::wait_poll says otherwise.
EXTRA_MCP_FILE_ENV
The environment variable that names a file of extra MCP servers, in the shape of mcp.json ({"mcpServers": {...}}), to add to the agent’s own at startup: ADAM_EXTRA_MCP_FILE=/etc/adam/extra-mcp/mcp.json. It adds servers to the folder’s mcp.json (or to the embedded copy’s) and never replaces one: see AgentDef::with_extra_mcp_file.
GROUP_LOADER_PREFIX
The prefix of a group loader’s tool name: load__group__<name>.
IMAGES_KEY
The member of an inbound payload that holds its images: [{"name", "mediaType", "data"}].
LOCALE_CONTEXT_KEY
The context key under which a message carries the person’s interface language (locale/v1, ADR 0069): the BCP 47 tag the client sent with that message, as a string ("fr-FR"). It is the language the agent’s own words are written in, unless the person writes in another one. A message that names none clears it, so a run never answers in the language of a message that is no longer the newest.
MAX_CARRIED_BYTES
The most serialized JSON, in bytes, of messages that a continued conversation carries from the conversation it continues (Conversation::continued): 256 KiB.
MAX_COMPACTIONS
The most compactions one run makes; after that the history is only shortened. What a run that continues another carries (Compaction::carried) does not count.
MAX_CONTEXT_BYTES
The most serialized JSON, in bytes, that a conversation’s context may hold: 256 KiB. A message whose context would take it over is read for its text and its context is dropped, with a warning.
MAX_DESCRIPTION_CHARS
The most characters of a session’s description.
MAX_INBOUND_IMAGES
The most images one inbound message carries into a run. The inbox is in the run’s durable state until the message is read, so what a message may carry is bounded.
MAX_INBOUND_IMAGE_BYTES
The most bytes of images one inbound message carries into a run.
MAX_INTERFACE_LANGUAGE_BYTES
The most bytes of a tag this module prints: adam_a2a::Locale’s bound, restated here because this crate does not depend on the A2A layer.
MAX_KEPT_BYTES
The most bytes of one kept text.
MAX_LOADED_NOTE_BYTES
The most bytes a Loaded::note holds: one line of the marker a compaction writes.
MAX_MODEL_BACKOFF
The longest step of the backoff of parks on a timer: 15 minutes. A park the endpoint asked to be longer (Retry-After) is that long.
MAX_OPEN_SESSIONS
The default of [SessionLimits::max_open]: the most sessions of one conversation that may be open at once (not closed). A start past it is refused.
MAX_PARALLEL_LIMIT
The most LlmAgentBuilder::max_parallel accepts: a larger value is this.
MAX_PLAN_ITEMS
The most items a plan holds.
MAX_PROTECTED_VALUE_BYTES
The most serialized JSON, in bytes, that the value of a PROTECTED_CONTEXT_KEYS key may hold.
MAX_READ_IDS
How many ids a run remembers having read (Conversation::read_ids: messages and forwarded resumes together). A person does not steer a task a hundred times, and the oldest id is the one given up, so a retry of an old message is the only thing this can let through.
MAX_REPORTED_ROUNDS
How many rounds a run remembers having reported (Conversation::reported_rounds): the oldest is given up. A round given up that is still due is not told again if its report is still in the history (its call id is there); one whose report was compacted away may be told once more.
MAX_RUN_JOURNALED_IMAGE_BYTES
The most bytes of images that the tool steps of one run journal, for an agent with no ImageStore (a folder agent): the run’s artifact budget. Counted over the run and never freed by a shortening or a compaction, because what was journaled stays journaled.
MAX_RUN_KEPT_BYTES
The most bytes a run keeps in its own state (Conversation::kept_outputs).
MAX_SCOPE_IMAGE_BYTES
The most bytes of images a scope keeps on a volume (KeptImages says it again for its own).
MAX_SESSION_ROUNDS
The default of [SessionLimits::max_rounds]: a send past it is refused (a close never is, so a session can have one more round, the closing one).
MAX_SOURCE_TOOLS
The most tools the sources of an agent may offer on one model turn, all sources together. The ones past it are left out, with a warning: a source that lists without bound would fill the model’s context with tool definitions.
MAX_TEXT_CHARS
The most characters of a prompt or a message.
MAX_THINKING_CUTS
How many turns in a row may end at the output limit with reasoning only before the run fails (each is continued with THINKING_CUT_TURN and counts as a model call against max_turns). A turn with words or a tool call starts the count again.
MAX_WORKING_ROUNDS
The default of [SessionLimits::max_working]: the most rounds of one conversation that may work at once. A start, or a send that would start a round, past it is refused.
MESSAGE_KIND
Recommended [Inbound::kind] of a user message. The agent does not inspect the kind: anything whose payload parses (see user_message) is a user message.
MESSAGE_RECEIVED
The point where a person’s message is about to reach a model (ADR 0050, decision 9). It may allow the message, rewrite HookedMessage::text in place, or refuse it with Verdict::Deny.
MODEL_CONTEXT_KEY
The context key under which a message names the model its run is asked of: {"model": "<alias>"}, an alias the agent was given a profile for (LlmAgentBuilder::model_choices); the engine’s Say::model sets it. It holds for the run until a later message names another. Not a protected key, and ignored by an agent given no choices (ADR 0064, amended 2026-11-23).
MODEL_REQUEST
The point where a model call is about to be made, inside the call’s step (ADR 0050, slice H3).
MODEL_RESUME_KIND
The Inbound::kind of a resume: a message that wakes a run parked on the model and adds nothing to its conversation (ADR 0067 decision 4). The A2A server delivers one for a message whose metadata holds adam.resume: true; the loop reads none of its payload. It is the runtime’s wake-only kind ([adam_runtime::RESUME_KIND]): one that lands while the run works neither counts as a message that arrived nor reopens a run that finishes.
MODE_CONTEXT_KEY
The context key under which a message picks the mode its run works in (agent-mode/v1, ADR 0039 decision 3): {"mode": "<name>"}, one of the modes the agent’s folder declares. It holds for the run until a later message picks another, and a mode only narrows: the tools it does not list are withheld, and the access tier still caps every one it does.
NOT_APPROVABLE
The result of a call a before_tool hook asked a person to approve, in a run nobody can approve it in: a child run that may not ask the person (ADR 0045 decision 9) or a firing of a schedule. Such a run reads Ask as Deny (ADR 0050, decision 12, slice H8), and the step records a deny.
NOT_ASKABLE
The result a tool that asks the person gets in a child run that may not ask (ADR 0045 decision 9): only a round of a kept-open session that a client shows (child-sessions/v1) has somebody to answer it, so the model is told to go on and say what it needs in its report.
OMITTED_MARKER_PREFIX
How the text of the marker that stands in for dropped turns begins. The marker is the second text part of the first user message (Conversation::omitted_turns says it is there), so a reader that looks at what the user said, such as the coder’s rule about which repositories a task named, can skip it by this prefix.
PER_MESSAGE_CONTEXT_KEYS
The context keys that speak for one message only: a message sets them or, by saying nothing, clears them. When a message’s context is over MAX_CONTEXT_BYTES and dropped, these are deleted (neither the earlier value nor the update stays), so a run never acts on what an earlier message offered: a turn whose offer was lost draws nothing.
PROMPT_STATEMENT_KEY
The key of an inbound payload that carries the prompt statement and the person’s envelope (prompt-statement/v1, ADR 0077): {"statement": "<JWS>", "user"?: "<JWS>"}. The A2A front writes it from a message whose request activated the extension (and removes it otherwise), and ToolCtx::start_child and the session tools write the run’s own into a child’s or a round’s first message. The run keeps it in Conversation::prompt_statement, never in its context.
PROTECTED_CONTEXT_KEYS
The context keys that must survive a context the run drops: the limits on the agent (the access tier the person picked, the mode it works in, who the message was sent for, the reasoning effort it activated, and that nobody answers the run, adam_runtime::UNATTENDED_CONTEXT_KEY) and the interface language the person is speaking (LOCALE_CONTEXT_KEY). A message always sets them, even when the rest of its context is over MAX_CONTEXT_BYTES and dropped (otherwise a large catalog next to a plan tier would lift the limit, or the agent would answer in a language it picked itself), and a child run starts with the ones its parent has (ToolCtx::start_child). Each value is at most MAX_PROTECTED_VALUE_BYTES; a larger one is ignored.
READ_OUTPUT
The tool that reads a kept output.
REASONING_EFFORT_CONTEXT_KEY
The context key under which a message carries the reasoning effort it activated (reasoning/v1, ADR 0063): {"effort": "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"}. The newest message’s value is the run’s effort from the next model call; a continuing task and a child run inherit it. A value that is not that shape is ignored here: the front refuses it before anything is written.
REDACTED_MARKER
What replaces a secret where it is removed.
RENDERER_OFFER_CONTEXT_KEY
The context key under which a message says what its renderer offers this turn (A2UI v1.0 a2uiRendererCapabilities): {"catalogIds": [...]}.
RESERVED_LOADER_PREFIX
The prefix the group loaders reserve: load__group__<name> (ADR 0066, decision 2). A tool of an MCP server or of a conversation whose full name starts with it is left out with a warning, and a registered tool whose name starts with it is refused at bind, because an MCP tool is <server>__<tool> and the names would collide.
RESERVED_NAMESPACES
The namespaces of the core catalogue: no declared event may start with one of them (checked on the first segment, without regard to case).
SCRUB_OVERLAP
What a producer captures beyond MAX_KEPT_BYTES (and before a tail it shows), and the margin a keeper cuts back at the edge of a text that was cut (scrub_open_end). No secret is longer.
SESSION_TOOLS
The five tool names, in the order the model is offered them.
SESSION_TOOL_TIME_LIMIT
The time limit each session tool declares (Tool::time_limit). None of them does long work: a read that waits parks the run and returns at once.
SHORTENING_FLOOR
A tool result shorter than this many characters is never shortened: small structured results hold ids nothing else repeats (a session’s, a plan’s, a shared file’s), and they are not what fills a history.
STEP_EVENTS_MAX
The most custom events one step (one tool call) emits: 16.
STOPPED_BY_THE_PERSON
What a tool call that was still owed when its run ended is told, in a continued conversation: the result the model reads in place of the one it never got.
SUBAGENT_CLOSE
The name of the tool that closes a session.
SUBAGENT_LIST
The name of the tool that lists the sessions.
SUBAGENT_READ
The name of the tool that reads the report of a session.
SUBAGENT_SEND
The name of the tool that sends a message to a session.
SUBAGENT_START
The name of the tool that starts a session.
THINKING_CUT_TURN
What the model is told after a turn that reached the output limit while it was still thinking: no words and no call, only reasoning. Kept in the history after that turn, except when the next turn is the closing turn.
TOOL_STOP_GRACE
How long a call that is past its time limit has to stop by itself, once its ToolCtx::cancelled token has fired, before its future is dropped.
TRANSITION_EVENTS_MAX
The most custom events one transition emits, across all its calls: 256.
TRUNCATION_MARKER_PREFIX
Prefix of the marker appended to a truncated tool output. Public through the crate root so callers and tests can recognise truncation.
UNATTENDED
The result a tool that asks the person gets in a run nobody answers, a firing of a schedule (a conversation under adam.schedule:, ADR 0060): the run cannot wait for an answer, so the model is told to go on without one.
WINDOW_MARGIN_TOKENS
The tokens a window keeps free of the history: the answer, the tools’ own growth and the estimate’s error.

Traits§

IntoManifest
Something an AgentDef can be made from: the owned manifest that a directory produces, or the 'static one that build.rs embeds. Both end up as the same [AgentManifest], so an agent binds the same way wherever its files came from.
IntoToolOutput
A value a tool can return as its output.
IntoToolResult
What a tool function returns, as the Tool::call result: any IntoToolOutput, or a Result of one with an error that is Into<ToolError>.
KeptImages
A place that keeps the bytes of images. Put in the agent’s state as an ImageStore.
KeptOutputs
A place that keeps outputs for ReadOutput. Put in the agent’s state as a KeptStore.
Plugin
A compiled hook set around one tool call. Every method has a do-nothing default, so a plugin that cares about one point implements one method.
Tool
A capability the model may call.
ToolSource
A group of tools the agent learns about while it runs, not when it is built: what a caller says it can offer in the messages it sends (the endpoint for a thread’s tools, for instance), read again at every model turn.
ToolSpecExt
ToolSpec::for_args::<A>(name, description): spec_for as an associated function. ToolSpec belongs to adam-model, so this is an extension trait: import it to call it.

Functions§

agent_dir
The directory to read: AGENT_DIR_ENV when it is set and not empty, else default.
agent_dir_from_env
AGENT_DIR_ENV when it is set and not empty (surrounding whitespace does not count as a value), else None: the caller then uses the copy it has embedded, or refuses to start.
approval_step
The journaled step that runs a call a person approved (ADR 0050, decision 12, slice H8): tool:<call id>:approved. It is taken only after a recorded Ask and the person’s yes, so its seq never depends on which plugins are configured; a replay that finds it recorded runs nothing.
approves
Whether a person’s answer to an approval is a yes: one of yes, y, approve, approved, allow, ok, okay, without regard to case, surrounding space or a final . or !. Anything else is a no (ADR 0050, decision 12): a call runs only on a clear yes, and the words of any other answer are the reason the call is refused with.
call_key
What a call is called within its root run: its call id, and for a subagent’s call its own run before it (a call id is only unique within the run that made it).
canonical_pointer_id
The id of a line that is exactly pointer_line of a well-formed id.
count_lines
Count the lines of a prepared text.
extra_mcp_file_from_env
EXTRA_MCP_FILE_ENV when it is set and not empty, else None: there is nothing to add.
find_pointer
Where in text the line is that points to the kept output id: the byte range (without the newline) of the first line with the shape of what the kept-output code writes (kept_header, and the closing line of a command’s view): it starts with [, ends with ] and holds read_output {"id":"<id>"}. A line that only mentions the words, or names another id, is none. id is the one of the call whose result text is, so text that a tool copied from somewhere (a file, a page) cannot name one.
image_scope
The scope that keeps the images of a conversation: 32 hex digits of a SHA-256 of its id, so a task that continues it still sees what the person sent; with no conversation id, of the root run’s id. The id itself is never a file name.
interface_language
The interface language a run’s context names (LOCALE_CONTEXT_KEY), when it is one to print: a string of at most MAX_INTERFACE_LANGUAGE_BYTES bytes of ASCII letters, digits or - (the characters of a BCP 47 langtag). A value that is anything else is ignored and nothing is sent, so nothing a tool wrote can become a line of the prompt.
interface_language_turn
What the model is told about the language the person’s interface names (locale/v1, ADR 0069). Sent before the closing turn, as a user message that is not kept in the history, and never in system: the stable prefix of ADR 0044 keeps its bytes, so a provider’s prompt cache still hits, and the language belongs to the message that named it.
is_hex
Whether text is len lower-case hexadecimal digits.
is_ordinary_word
Whether needle is an ordinary word: lowercase ASCII letters only, so that it can stand as an identifier in code (postgres, password). Only such a value takes is_value_position; a token with a digit, a capital, _, - or a Base64 form cannot be an identifier, so it is replaced wherever it stands.
is_output_id
Whether id has the shape of an output id: o- and 16 lowercase hex characters.
is_unattended
Whether nobody answers a run: a firing of a schedule (its conversation is under adam.schedule:), or a child of one (its context carries adam_runtime::UNATTENDED_CONTEXT_KEY, which the scheduler sets and children inherit).
is_value_position
Whether text[at..at + len] stands where a value stands: at the start or end of the text, or between bytes that cannot be part of an identifier, and not as the scheme of a URL (postgres://…).
keep_image
Admit and keep the image bytes offered by the call of ctx, and say what the model is shown (ImageOutcome). Like keep_long: with an ImageStore in the agent’s state the bytes go there (by the SHA-256, once, for the conversation); without one they go back in ToolOutput::kept_images for the loop to keep in the run’s state. A model that cannot see, a source the deployment does not allow, a type, a size or a count over its limits are a stand-in line, never an error.
keep_long
Keep a long text for the call of ctx and say what the model is shown: the first page and an id to read the rest with ReadOutput, or, when it cannot be kept, the first page and why the rest is lost. The second value is what the loop keeps in the run’s state (ToolOutput::kept); it is Some only when no KeptStore is in the agent’s state.
keep_long_cut
keep_long for a text that is the first part of a result of which omitted more bytes were left out. A keeper cuts such a text back at its end (KeptOutputs::keep); with no keeper the context’s scrub hook (ToolCtx::with_scrub) does.
kept_header
The line that opens what the model is shown of a kept text: the id, how long the text is, and that read_output reads it.
kept_images_conformance
What every KeptImages does: keeps what it is given and gives it back, once for the same bytes; refuses an id that is not a hash, a scope that is not 32 hex digits, and bytes that are not the hash they come with; never serves one scope’s image to another; and loads nothing it cannot prove has the hash it was kept under. For an implementation’s own tests: tamper rewrites what was kept under (scope, sha256) the way a local command could, and is None for a keeper that cannot be changed behind its back.
kept_outputs_conformance
The conformance of a KeptOutputs: what ReadOutput and the tools that keep rely on. Call it from a test of an implementation (it panics on a violation).
kept_view
What the model is shown of a text that was kept: kept_header, the first page, and the page’s final line ([more: ...; next page: offset=N]).
loaded_note
note as a Loaded keeps it: one line (a line break or a Unicode line separator could forge a line of a compaction’s marker), at most MAX_LOADED_NOTE_BYTES bytes, ending with an ellipsis when it was cut. adam-assembly’s groups use it, and the loop applies it to a note a custom loader wrote.
output_id
The output id of a call: o- and the first 16 hex characters of the SHA-256 of the root run and the call’s key, so a call that runs again keeps under the same id. An id is not a secret: what keeps a run from another’s output is that ReadOutput takes the run from the call’s context.
output_id_of
The id of the output kept by the call of ctx.
page_of
A page of a prepared text, as KeptOutputs::page renders it.
parse_args
Read the model’s argument object into A.
path_scope
The scope of a path argument under base: base/<path> with the path trimmed (the tools trim it before they open it) and normalised lexically (a leading ./, a . or an empty component, and a trailing / are dropped), and base itself when there is no path, when it names nothing but the root, when it is absolute, or when it has a .. component (it may leave the place the scope names, so it widens to all of base).
pointer_line
The one line a shortened history keeps to say how to read the kept output id: written from the id alone, never copied from a result.
prepare
text as it is kept, for an output of which omitted bytes were left out before: at most MAX_KEPT_BYTES of it (cut on a character boundary), a NUL as U+FFFD, and every line over MAX_LINE_CHARS characters folded onto several lines, so that paging by lines loses nothing. When the output was longer than what is kept (omitted not 0, or text over the bound) the kept text ends with a line that says how much is kept, and the flag is set.
read_pointer
The canonical pointer line (pointer_line) when text has a line for the kept output id (find_pointer). A shortening of a history keeps this line, so the id outlives the cut.
scrub_open_end
text, which is only the first part of a longer output, scrubbed with scrub and cut back so that no part of a secret is left at its end.
scrub_open_start
scrub_open_end for a text that is only the last part of a longer output: scrubbed, and without a part of a secret at its start.
scrubbed_for_keeping
What a keeper makes of the text it is given, before it cuts and folds it: scrubbed with scrub, and, when omitted is not 0 (the text is the first part of a longer output), cut back at its end by scrub_open_end with margin (the longest value scrub replaces). With the omitted to keep: what was left out, counted again for what the cut back took (never 0 for a text that was cut).
sha256_hex
The SHA-256 of bytes as 64 lower-case hexadecimal digits.
spec_for
The [ToolSpec] of a tool whose arguments are A: its parameters are the JSON Schema of A.
summary_output_tokens
The output tokens a summary asks for, given the cap the run’s own calls ask (ADR 0064 decision 3): a run capped below 4,096 gets a summary capped the same way, and one that leaves the cap to the model (0) keeps the summary’s own 4,096, because a summary is bounded by the loop.
tool_retry_key
The key a tool’s failures count under: tool:<name>, the name and never the call id, so a tool called again in a later turn counts as the same step (ADR 0061, decision 3).
unkept_view
What the model is shown of a text that could not be kept: its first page, and a last line that says why the rest is lost.
user_message
An inbound user message: kind MESSAGE_KIND, payload {"text": "..."}.
user_message_with_images
An inbound user message of text with images: kind MESSAGE_KIND, payload {"text": ..., "images": [...]}. At most MAX_INBOUND_IMAGES images and MAX_INBOUND_IMAGE_BYTES bytes are read from it.

Type Aliases§

DynTool
A shared, type-erased Tool.
DynToolSource
A shared, type-erased ToolSource.
HookResult
What a hook answers: a verdict, or the reason it could not decide.
KeptMap
The kept outputs of a run’s own state, as a map (see Conversation::kept_outputs).
StateImages
The images of a run’s own state, by SHA-256.
Tamper
A function that rewrites what a keeper holds under (scope, sha256) the way a local command could.

Attribute Macros§

tool
#[tool]: an async fn becomes a Tool. See the crate docs. Turns an async fn into a tool: keeps the function, and generates a unit struct (the function’s name in UpperCamelCase) that implements adam::Tool.