max / makenotwork
| 1 | //! Kberg — MCP bridge for connecting local LLMs to desktop apps. |
| 2 | //! |
| 3 | //! Named after Königsberg, the city whose seven bridges founded graph theory |
| 4 | //! (Euler, 1736). The library is a bridge in that same sense: it routes |
| 5 | //! tool-call edges between an LLM node and a set of app nodes. |
| 6 | //! |
| 7 | //! # Shape |
| 8 | //! |
| 9 | //! - [`Tool`] + [`ToolRegistry`] — app-side action surface. |
| 10 | //! - [`resource::ResourceRegistry`] — app-side object surface: live things a |
| 11 | //! client lists and reads (deox exposes editor buffers this way). |
| 12 | //! - [`server`] — Streamable HTTP MCP server (JSON-RPC 2.0). Any MCP-speaking |
| 13 | //! client can reach a Kberg-served app. |
| 14 | //! - [`agent::Agent`] + [`agent::InferenceProvider`] — provider-agnostic |
| 15 | //! agent loop. Bring your own inference endpoint; Kberg does not manage |
| 16 | //! models or runtimes. |
| 17 | //! - [`provider::ollama`] — reference `InferenceProvider` for a local Ollama |
| 18 | //! server. Future providers (OpenAI, Anthropic, OpenAI-compatible) drop in |
| 19 | //! without touching the agent loop. |
| 20 | //! |
| 21 | //! # Guardrails |
| 22 | //! |
| 23 | //! - Every [`Tool`] declares [`ToolKind::Read`] or [`ToolKind::Write`] with a |
| 24 | //! named capability. Writes are the finite, app-declared vocabulary of |
| 25 | //! permissions the LLM can be granted — webhook-style. |
| 26 | //! - [`SurfaceProjection::Compact`] exposes only tools the app has annotated |
| 27 | //! as small-model safe. |
| 28 | //! - Hard refusals ([`Refusal`]) appear in `tools/list` with a stable reason |
| 29 | //! so models don't invent plausible names. |
| 30 | //! |
| 31 | //! # Design |
| 32 | //! |
| 33 | //! Design rationale and the roadmap for the planned primitives live as notes in |
| 34 | //! the maintainer wiki, bridged to this crate. |
| 35 | //! <!-- wiki: kberg-overview --> |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | pub use ; |
| 43 | pub use ; |
| 44 | pub use ; |
| 45 | pub use |
| 46 | ContentPart, Refusal, SurfaceProjection, Tool, ToolCallResult, ToolKind, ToolRegistry, |
| 47 | ToolSpec, WriteCapability, |
| 48 | ; |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 |