2.2 KiB
2.2 KiB
agen requirements
R1: Turn execution and continuation
Engine::runstarts a turn and loops through provider output and tool calls.- An
Interceptormay continue, cancel, or pause work at defined orchestration boundaries. Engine::resumecontinues paused generation without fabricating another user message.- Cancellation and provider errors are represented as typed
EngineErrorvalues.
R2: Explicit cache-preserving state
Engine<C, Mutable>permits configuration and history edits.Engine::runorEngine::locktransitions toEngine<C, Locked>and records the committed prefix.- A locked engine appends turns but cannot mutate that prefix through mutable-only APIs.
Engine::unlockexplicitly abandons the lock before configuration or history changes.
R3: Tool declarations and execution
#[tool_registry]generates a schema andToolimplementation for methods marked#[tool].#[description = "..."]supplies argument descriptions in generated JSON Schema.- Generated code resolves its runtime and helper dependencies through
::agen. - Invalid and duplicate marker attributes produce compile errors rather than panics.
- Tools execute through
ToolServerwith typed context, errors, and output limits.
R4: Provider-neutral orchestration
LlmClientis the boundary between the engine and provider-specific transport.- Request/response schemes translate provider wire formats into shared request and event types.
- Interceptors, tool execution, timeline collection, and pruning stay above the provider transport.
- Provider-specific capabilities are optional features when they require additional policy or dependencies.
R5: Publication quality
- crates.io metadata includes license, repository, documentation, README, categories, keywords, and MSRV.
- The default feature set and each optional feature compile and test independently.
- Macro expansion compiles in a downstream-style integration test without direct helper dependencies.
- rustdoc builds without dependency documentation.
- Package contents are explicitly bounded and exclude credentialed fixture-recording utilities.
cargo packageandcargo publish --dry-runare run foragen-macrosbeforeagenbecause the main package depends on its companion package.