Skip to main content

entelix_core/
lib.rs

1//! # entelix-core
2//!
3//! DAG root of the entelix workspace — depends on no other entelix crate.
4//! Houses the provider-neutral IR, the five codecs (Anthropic Messages,
5//! `OpenAI` Chat, `OpenAI` Responses, Gemini, Bedrock Converse), the
6//! `Transport` trait + `DirectTransport`, the `Tool` trait +
7//! [`ToolRegistry`], `CredentialProvider`, the [`ModelInvocation`] /
8//! [`ToolInvocation`] `tower::Service` spine, `EventBus`, and
9//! `StreamAggregator`.
10//!
11//! Cross-cutting concerns (PII redaction, rate limit, cost meter, OTel
12//! observability) are `tower::Layer<S>` middleware in their respective
13//! sub-crates (`entelix-policy`, `entelix-otel`); the composition
14//! primitive is `tower::ServiceBuilder`.
15
16#![cfg_attr(docsrs, feature(doc_cfg))]
17#![doc(html_root_url = "https://docs.rs/entelix-core/0.5.3")]
18#![deny(missing_docs)]
19// Tower-style middleware modules use long opening doc paragraphs to
20// explain composition semantics; trait-method `&str` returns satisfy
21// the `Tool` trait's published shape but trip the
22// `unnecessary_literal_bound` pedantic lint; `Debug` impls for
23// service wrappers omit dyn-trait fields by design.
24#![allow(
25    clippy::doc_markdown,
26    clippy::missing_const_for_fn,
27    clippy::missing_errors_doc,
28    clippy::missing_panics_doc,
29    clippy::missing_fields_in_debug,
30    clippy::option_if_let_else,
31    clippy::redundant_closure_for_method_calls,
32    clippy::too_long_first_doc_paragraph,
33    clippy::unnecessary_literal_bound
34)]
35
36pub mod agent_context;
37pub mod approval;
38pub mod audit;
39pub mod auth;
40pub mod backoff;
41pub mod cancellation;
42pub mod chat;
43pub mod codecs;
44pub mod context;
45pub mod cost;
46pub mod error;
47pub mod events;
48pub mod extensions;
49pub mod identity;
50pub mod interruption;
51pub mod ir;
52pub mod llm_facing;
53pub mod output_validator;
54pub mod overrides;
55pub mod rate_limit;
56pub mod run_budget;
57pub mod sandbox;
58pub mod service;
59pub mod skills;
60pub mod stream;
61pub mod tenant_id;
62pub mod thread_key;
63pub mod time;
64pub mod tls;
65pub mod tokens;
66pub mod tools;
67pub mod transports;
68
69pub use agent_context::AgentContext;
70pub use approval::{ApprovalDecision, PendingApprovalDecisions};
71pub use audit::{AuditSink, AuditSinkHandle};
72pub use auth::{
73    ApiKeyProvider, AuthError, BearerProvider, CachedCredentialProvider, ChainedCredentialProvider,
74    CredentialProvider, Credentials,
75};
76pub use chat::{ChatModel, ChatModelConfig, TypedModelStream};
77pub use context::ExecutionContext;
78pub use cost::{BudgetCostEstimator, CostCalculator, ToolCostCalculator};
79pub use error::{Error, ErrorClass, ErrorEnvelope, ProviderErrorKind, Result};
80pub use extensions::Extensions;
81pub use interruption::{InterruptionKind, InterruptionPhase, interrupt, interrupt_with};
82pub use llm_facing::{LlmFacingSchema, LlmRenderable, RenderedForLlm};
83pub use output_validator::OutputValidator;
84pub use overrides::{RequestOverrides, RunOverrides};
85pub use run_budget::{RunBudget, UsageLimitBreach, UsageSnapshot};
86pub use service::{
87    BoxedModelService, BoxedStreamingService, BoxedToolService, ModelInvocation, ModelStream,
88    NamedLayer, StreamingModelInvocation, ToolInvocation, WithName,
89};
90pub use skills::{
91    LoadedSkill, Skill, SkillRegistry, SkillResource, SkillResourceContent, SkillSummary,
92};
93pub use stream::tap_aggregator;
94pub use tenant_id::{DEFAULT_TENANT_ID, TenantId};
95pub use thread_key::ThreadKey;
96pub use time::{Clock, SystemClock};
97pub use tls::install_default_tls;
98pub use tokens::{
99    ByteCountTokenCounter, Resolution as TokenCounterResolution, TokenCounter, TokenCounterRegistry,
100};
101pub use tools::{
102    CurrentToolInvocation, Tool, ToolErrorKind, ToolProgress, ToolProgressSink,
103    ToolProgressSinkHandle, ToolProgressStatus, ToolRegistry,
104};