Skip to main content

Crate entelix_core

Crate entelix_core 

Source
Expand description

§entelix-core

DAG root of the entelix workspace — depends on no other entelix crate. Houses the provider-neutral IR, the five codecs (Anthropic Messages, OpenAI Chat, OpenAI Responses, Gemini, Bedrock Converse), the Transport trait + DirectTransport, the Tool trait + ToolRegistry, CredentialProvider, the ModelInvocation / ToolInvocation tower::Service spine, EventBus, and StreamAggregator.

Cross-cutting concerns (PII redaction, rate limit, cost meter, OTel observability) are tower::Layer<S> middleware in their respective sub-crates (entelix-policy, entelix-otel); the composition primitive is tower::ServiceBuilder.

Re-exports§

pub use agent_context::AgentContext;
pub use approval::ApprovalDecision;
pub use approval::PendingApprovalDecisions;
pub use audit::AuditSink;
pub use audit::AuditSinkHandle;
pub use auth::ApiKeyProvider;
pub use auth::AuthError;
pub use auth::BearerProvider;
pub use auth::CachedCredentialProvider;
pub use auth::ChainedCredentialProvider;
pub use auth::CredentialProvider;
pub use auth::Credentials;
pub use chat::ChatModel;
pub use chat::ChatModelConfig;
pub use chat::TypedModelStream;
pub use context::ExecutionContext;
pub use cost::BudgetCostEstimator;
pub use cost::CostCalculator;
pub use cost::ToolCostCalculator;
pub use error::Error;
pub use error::ErrorClass;
pub use error::ErrorEnvelope;
pub use error::ProviderErrorKind;
pub use error::Result;
pub use extensions::Extensions;
pub use interruption::InterruptionKind;
pub use interruption::InterruptionPhase;
pub use interruption::interrupt;
pub use interruption::interrupt_with;
pub use llm_facing::LlmFacingSchema;
pub use llm_facing::LlmRenderable;
pub use llm_facing::RenderedForLlm;
pub use output_validator::OutputValidator;
pub use overrides::RequestOverrides;
pub use overrides::RunOverrides;
pub use run_budget::RunBudget;
pub use run_budget::UsageLimitBreach;
pub use run_budget::UsageSnapshot;
pub use service::BoxedModelService;
pub use service::BoxedStreamingService;
pub use service::BoxedToolService;
pub use service::ModelInvocation;
pub use service::ModelStream;
pub use service::NamedLayer;
pub use service::StreamingModelInvocation;
pub use service::ToolInvocation;
pub use service::WithName;
pub use skills::LoadedSkill;
pub use skills::Skill;
pub use skills::SkillRegistry;
pub use skills::SkillResource;
pub use skills::SkillResourceContent;
pub use skills::SkillSummary;
pub use stream::tap_aggregator;
pub use tenant_id::DEFAULT_TENANT_ID;
pub use tenant_id::TenantId;
pub use thread_key::ThreadKey;
pub use time::Clock;
pub use time::SystemClock;
pub use tls::install_default_tls;
pub use tokens::ByteCountTokenCounter;
pub use tokens::Resolution as TokenCounterResolution;
pub use tokens::TokenCounter;
pub use tokens::TokenCounterRegistry;
pub use tools::CurrentToolInvocation;
pub use tools::Tool;
pub use tools::ToolErrorKind;
pub use tools::ToolProgress;
pub use tools::ToolProgressSink;
pub use tools::ToolProgressSinkHandle;
pub use tools::ToolProgressStatus;
pub use tools::ToolRegistry;

Modules§

agent_context
Typed-deps carrier — separates infra context from operator-side handles.
approval
Tool-dispatch approval primitives shared between the agent runtime (entelix-agents::ApprovalLayer) and the graph runtime (entelix-graph::Command::ApproveTool resume path).
audit
AuditSink — typed channel for managed-agent audit events that the SDK records into a session log.
auth
Credential resolution for transports.
backoff
Exponential backoff with jitter.
cancellation
Cancellation primitive for entelix.
chat
ChatModel — composes a Codec and a Transport into a layered tower::Service<ModelInvocation, Response = ModelResponse> plus a streaming surface.
codecs
Provider codecs (invariant 4).
context
Request-scope execution context.
cost
CostCalculator — small trait that computes a monetary cost from a request context, a model name, and a usage record.
error
Top-level error type for entelix-core and the public API surface of the facade crate.
events
EventBus — ephemeral broadcast pub-sub for SDK observability.
extensions
Extensions — type-keyed cross-cutting carrier rendered through crate::ExecutionContext.
identity
Shared validation for stable SDK identifiers.
interruption
Single human-in-the-loop primitive for the entelix runtime.
ir
Provider-neutral intermediate representation (invariant 4).
llm_facing
LLM-facing channel — type-level separation of operator-facing diagnostics from the value the model actually sees (invariant #16).
output_validator
Post-decode validators for typed structured output.
overrides
Per-call overrides — operators stash these on crate::context::ExecutionContext to patch defaults without rebuilding ChatModel or CompiledGraph. Two carriers, scoped to orthogonal concerns:
rate_limit
Provider rate-limit observation.
run_budget
RunBudget — six-axis usage cap checked across one logical run, including sub-agent fan-out.
sandbox
Sandbox — sandbox-agnostic isolated execution environment.
service
tower::Service spine for entelix model + tool calls.
skills
Skills — packaged, progressively-disclosed agent capabilities .
stream
StreamAggregator — accumulates streaming model deltas into a coherent ModelResponse.
tenant_id
TenantId — validating newtype for the multi-tenant scope key.
thread_key
ThreadKey — the canonical (tenant_id, thread_id) addressing tuple for every persistence and session operation in entelix.
time
Clock — monotonic-clock abstraction shared across the workspace. Living in entelix-core so any sub-crate that needs a time source (rate limiters, retry backoff, cost-rate windows, TTL pruning) can take a &dyn Clock without depending on entelix-policy.
tls
Process-wide TLS / crypto-provider installation.
tokens
TokenCounter — operator-supplied token-count surface.
tools
The Hand surface — Tool trait + ToolRegistry (layered tower::Service dispatch path) + ToolDispatchScope / ScopedToolLayer (operator hook for ambient request-scope state, e.g. tokio task-locals seeding RLS settings).
transports
Stateful HTTP carriers — Transport trait + concrete impls — and the RetryLayer middleware that wraps any retry-classified Service.