locode_core/lib.rs
1//! locode — the facade crate: the public surface for consumers (the future
2//! `locode-app`, and `locode-exec` as the reference consumer).
3//!
4//! Two curated surfaces (Task 14, SPEC Users #3/#4):
5//!
6//! - **The driving API** — assemble and run one session: [`Session`] +
7//! [`EngineConfig`], harness selection ([`resolve`]/[`available`] +
8//! [`PackContext`]), the providers ([`AnthropicProvider`]/[`MockProvider`]),
9//! the host ([`Host`]/[`HostConfig`]/[`PathPolicy`]), and the report/event
10//! types ([`Report`]/[`Status`]/[`Event`]/[`Usage`]).
11//! - **The tool surface** — use our typed tools in *your own* loop: [`Tool`],
12//! [`Registry`] (+ the [`Registry::dispatch`] door), [`ToolCtx`],
13//! [`ToolOutput`], [`ToolSpec`], and the packs' concrete tool sets via
14//! [`Pack::build_registry`].
15//!
16//! Downstream code should depend on this crate, not the `locode-*` internals —
17//! the internals may churn; this surface is the stable contract.
18
19// ---- protocol: conversation, report envelope, stream events ----
20pub use locode_protocol::{
21 ContentBlock, Conversation, Event, GrammarSyntax, ImageSource, Message, ReasoningFormat,
22 Report, ResultChunk, Role, Status, ToolCallRecord, ToolInputFormat, ToolSpec, Usage,
23 reconstruct_conversation,
24};
25
26// ---- engine: the driving API ----
27pub use locode_engine::{EngineConfig, EventSink, FnSink, NullSink, Session};
28
29// ---- providers: the wire schemas ----
30pub use locode_provider::anthropic::{
31 ApiBackend, AuthRefresh, AuthScheme, DeveloperRendering, ModelConfig, ReasoningEncoding,
32 RetryPolicy,
33};
34pub use locode_provider::{
35 AnthropicProvider, CacheHint, Completion, ConversationRequest, MockProvider, OpenAiBackend,
36 OpenAiModelConfig, OpenAiResponsesProvider, Provider, ProviderError, ReasoningEffort,
37 SamplingArgs, StopReason, SystemPlacement,
38};
39
40// ---- packs: harness selection ----
41pub use locode_packs::{GrokPack, Pack, PackContext, UnknownHarness, available, grok, resolve};
42
43// ---- host: the side-effect seam ----
44pub use locode_host::{ExecLimits, Host, HostConfig, PathPolicy};
45
46// ---- tools: the full tool surface (SPEC Users #4) ----
47pub use locode_tools::{
48 Dispatched, DynTool, MODEL_OUTPUT_BUDGET, Registry, Tool, ToolCtx, ToolError, ToolKind,
49 ToolOutput, truncate_for_model,
50};