agix-base 0.4.4

Agix — foundation types, traits, and context
Documentation
//! Injectable contracts — the traits a host implements to replace part of the
//! engine.
//!
//! The entry requirement is narrow on purpose: **every module here defines at
//! least one trait the engine holds as a `dyn` object.** Data types,
//! configuration and the shared data live at the crate root instead
//! (`base::event`, `base::prompt`, `base::memory`, `base::permission`);
//! the settings file model is the `settings` crate's.
//!
//! # What is reachable from here, and what is not
//!
//! This crate depends on no other crate of this workspace — that is what keeps
//! it at the bottom of the graph. So this directory can only host contracts defined in
//! `base` itself:
//!
//! | Contract | Replaces |
//! |---|---|
//! | [`model::Model`] | the LLM backend / wire protocol |
//! | [`model_factory::ModelFactory`] | how a protocol is built from config |
//! | [`model_interceptor::ModelInterceptor`] | the request out, the message back |
//! | [`credentials::CredentialSource`] | where a provider's API key comes from |
//! | [`config_source::ConfigSource`] | where the settings layers come from |
//! | [`tool::Tool`] / [`tool::ToolRegistry`] | a tool, or the whole tool set |
//! | [`tool_middleware::ToolMiddleware`] | a ring around every tool call |
//! | [`tool_result::ToolResultTransformer`] | what a result may look like |
//! | [`scene::SceneSpec`] | system prompt, tool surface, budgets |
//! | [`turn_policy::TurnPolicy`] | when a turn has gone on long enough |
//! | [`recovery_policy::RecoveryPolicy`] | what to do when a call goes wrong |
//! | [`budget_policy::BudgetPolicy`] | what a turn may spend and how much it may carry |
//! | [`environment::Environment`] | kept time and kept identifiers |
//! | [`exec::Process`] | where a program runs |
//! | [`exec::FileSystem`] | where a tool's files are |
//! | [`exec::Network`] | every request that leaves the process |
//! | [`exec::Sandbox`] | how a process is constrained |
//! | [`backoff::BackoffPolicy`] | whether a failed request is sent again, and when |
//! | [`permission::PermissionPolicy`] | whether a tool call runs |
//! | [`permission::PermissionGrants`] | the allows handed out during a session |
//! | [`delegate::Delegator`] | how sub-agents are launched |
//! | [`event_sink::EventSink`] | where the engine's events go |
//! | [`health::HealthCheck`] | whether a subsystem is working |
//! | [`elicitation::Elicitation`] | how the engine asks a person something |
//! | [`host_call::HostCalls`] | how a call only the host can make reaches it |
//! | [`host_js::HostFn`] | a function of a JavaScript library the host gives plugin code |
//! | [`token_counter::TokenCounter`] | how big the context is judged to be |
//! | [`prompt_registry::PromptRegistry`] | what goes into the system prompt |
//! | [`prompt_assembler::PromptAssembler`] | how the whole prompt is put together |
//! | [`prompt_assembly::AssemblyHook`] | a last pass over the assembled prompt |
//! | [`script::ScriptEngine`] | running the operator's own code at a hook point |
//! | [`memory_contracts::MemoryStorage`] | where durable memories are kept |
//! | [`memory_contracts::MemoryRetriever`] | which of them a turn sees |
//! | [`skill_provider::SkillProvider`] | where a session's skills come from |
//! | [`instruction_provider::InstructionProvider`] | where standing instructions come from |
//! | [`instruction_provider::RuleProvider`] | where the rule index comes from |
//!
//! [`catalog`] is the whole picture, including the contracts below that this
//! directory cannot re-export: every extension point as data, with when it
//! fires, what it may change, how often, and who is allowed to use it.
//!
//! The engine's other replaceable contracts live in the crate that owns them
//! and **cannot be re-exported here** without pointing a dependency edge
//! downward: `Compactor` (`compaction`), `HistoryStore` (`history`),
//! `Plugin` (`runtime`), `TelemetryRecorder` (`telemetry`),
//! `McpClient` (`mcp`), `AnthropicClient` (`model`), `SearchProvider`
//! (`tools`). Anyone looking for the full map wants the extension-point
//! index, not this directory.

pub mod backoff;
pub mod budget_policy;
pub mod catalog;
pub mod config_source;
pub mod credentials;
pub mod delegate;
pub mod elicitation;
pub mod environment;
pub mod event_sink;
pub mod exec;
pub mod health;
pub mod host_call;
pub mod host_js;
pub mod inline_command;
pub mod instruction_provider;
pub mod mcp_servers;
pub mod memory_contracts;
pub mod model;
pub mod model_factory;
pub mod model_interceptor;
pub mod permission;
pub mod plugin_call;
pub mod prompt_assembler;
pub mod prompt_assembly;
pub mod prompt_middleware;
pub mod prompt_registry;
pub mod recovery_policy;
pub mod scene;
pub mod script;
pub mod skill_catalog;
pub mod skill_provider;
pub mod token_counter;
pub mod tool;
pub mod tool_dispatch;
pub mod tool_middleware;
pub mod tool_result;
pub mod tool_selector;
pub mod turn_policy;