//! Kberg — MCP bridge for connecting local LLMs to desktop apps. //! //! Named after Königsberg, the city whose seven bridges founded graph theory //! (Euler, 1736). The library is a bridge in that same sense: it routes //! tool-call edges between an LLM node and a set of app nodes. //! //! # Shape //! //! - [`Tool`] + [`ToolRegistry`] — app-side action surface. //! - [`resource::ResourceRegistry`] — app-side object surface: live things a //! client lists and reads (deox exposes editor buffers this way). //! - [`server`] — Streamable HTTP MCP server (JSON-RPC 2.0). Any MCP-speaking //! client can reach a Kberg-served app. //! - [`agent::Agent`] + [`agent::InferenceProvider`] — provider-agnostic //! agent loop. Bring your own inference endpoint; Kberg does not manage //! models or runtimes. //! - [`provider::ollama`] — reference `InferenceProvider` for a local Ollama //! server. Future providers (OpenAI, Anthropic, OpenAI-compatible) drop in //! without touching the agent loop. //! //! # Guardrails //! //! - Every [`Tool`] declares [`ToolKind::Read`] or [`ToolKind::Write`] with a //! named capability. Writes are the finite, app-declared vocabulary of //! permissions the LLM can be granted — webhook-style. //! - [`SurfaceProjection::Compact`] exposes only tools the app has annotated //! as small-model safe. //! - Hard refusals ([`Refusal`]) appear in `tools/list` with a stable reason //! so models don't invent plausible names. //! //! # Design //! //! Design rationale and the roadmap for the planned primitives live as notes in //! the maintainer wiki, bridged to this crate. //! pub mod agent; mod error; pub mod resource; pub mod tool; pub use agent::{Agent, AgentConfig, InferenceProvider, Message, Role, RunOutcome, ToolCall}; pub use error::{Error, Result}; pub use resource::{ResourceContents, ResourceDescriptor, ResourceRegistry}; pub use tool::{ ContentPart, Refusal, SurfaceProjection, Tool, ToolCallResult, ToolKind, ToolRegistry, ToolSpec, WriteCapability, }; #[cfg(feature = "server")] pub mod server; #[cfg(feature = "ollama")] pub mod provider;