Skip to main content

Crate toolnexus

Crate toolnexus 

Source
Expand description

toolnexus — Rust port (see openspec/changes/add-rust-port).

The ACP client (acp), skills (skills), the MCP client (mcp, on rmcp), core Tool types with native and http tools, the builtins, the toolkit aggregator, schema adapters and the unified client loop with §10 suspension, single-turn translate (§11), the §8B classifier and its judge adapters and batteries.

Re-exports§

pub use adapters::to_anthropic;
pub use adapters::to_gemini;
pub use adapters::to_openai;
pub use as_mcp_server::McpServerHandle;
pub use builtins::BuiltinsConfig;
pub use builtins::select_builtins;
pub use classifier::Classifier;
pub use classifier::ClassifierError;
pub use classifier::ClassifierOptions;
pub use classifier::ClassifierStyle;
pub use classifier::Decision;
pub use classifier::Question;
pub use classifier::Questions;
pub use classifier::create_classifier;
pub use media::CloneVoiceInput;
pub use media::ImageInput;
pub use media::Media;
pub use media::MediaError;
pub use media::MediaFile;
pub use media::MediaOptions;
pub use media::MediaProgress;
pub use media::MediaResult;
pub use media::MediaStyle;
pub use media::SpeechInput;
pub use media::TalkingInput;
pub use media::TranscribeInput;
pub use media::VideoInput;
pub use media::create_media;
pub use media::load_media_style;
pub use tool::Answer;
pub use tool::ConcurrencySafeFn;
pub use tool::ContentPart;
pub use tool::DEFAULT_MAX_TOOL_CONCURRENCY;
pub use tool::PartError;
pub use tool::Request;
pub use tool::Tool;
pub use tool::ToolAnnotations;
pub use tool::ToolContext;
pub use tool::ToolHints;
pub use tool::ToolResult;
pub use tool::ToolSource;
pub use tool::auth_required;
pub use tool::define_tool;
pub use tool::define_typed_tool;
pub use tool::empty_schema;
pub use tool::is_concurrency_safe;
pub use tool::pending;
pub use tool::pending_of;
pub use tool::resolve_max_tool_concurrency;
pub use tool::resolve_max_tool_concurrency_with;
pub use tool::sanitize;
pub use toolkit::McpConfigInput;
pub use toolkit::Toolkit;
pub use toolkit::ToolkitError;
pub use toolkit::ToolkitOptions;
pub use toolkit::create_toolkit;

Modules§

a2a
A2A (agent-to-agent) — OUTBOUND: call remote A2A agents (SPEC §7A). Port of golang/a2a.go.
acp
ACP (Agent Client Protocol) client — parity with golang/acp.go, plus the streamed updates and host permission callback a desktop host needs.
adapters
Schema adapters (SPEC §0 item 7): the same tools in each provider’s shape. Schema only — the input schema is passed through verbatim.
agents
The agent runtime (SPEC §7D–§7F): sub-agents as tools over the shipped client loop. One axiom — an Agent is a Tool — plus six host verbs (spawn, post, wake, wait, interrupt, close) over a handle tree, personas from a directory (§7E) and context compaction (§7F). Port of golang/agents/.
as_mcp_server
Toolkit::as_mcp_server — the toolkit served for a local agent to call (SPEC §8C, ADR 0041). The §7C stateless MCP endpoint on 127.0.0.1:<ephemeral>/mcp behind a fresh per-call bearer token.
builtins
Built-in tools (SPEC §4A, source: "builtin"), ported from golang/builtin*.go.
classifier
Classifier (SPEC.md §8B) — the contract for a JUDGMENT, as Tool is the contract for an ACTION. A System One model takes a state plus pre-declared, typed questions and returns calibrated answers with no free text. It has no messages, no tool calling and no streaming, so it never enters the client loop.
client
Unified LLM client (SPEC §8): one tool-calling loop over the OpenAI (Chat Completions) and Anthropic (Messages) wire styles, with hooks, streaming, retries (incl. Retry-After), conversation memory, metrics, prompt caching, tool tiers and §10 suspension (wait_for / pending).
http
HTTP / REST tools (SPEC §0 item 9, §7; source: "http"). Port of golang/http.go.
judge
Simple judgments (SPEC §8B “Simple judgments — ask / gate”): builders, ask, gate, Policy and Tape over any Classifier. The wire is unchanged — the builders produce exactly the evaluate inputs a host would write by hand. Ported from golang/judge.go.
mcp
MCP source (SPEC §0 items 2–4, §2), on the official Rust SDK rmcp.
mcp_handler
MCP — INBOUND, embeddable: a plain streamable-HTTP MCP server with generic per-request hooks (SPEC §7C.1, ADR 0039). Port of golang/mcphandler.go. Behind the serve feature.
mcp_serve
MCP — INBOUND: serve a toolkit as an MCP server (SPEC §7C). Port of golang/mcpserve.go, on rmcp’s server + streamable-HTTP transport. Behind the serve feature.
media
Media generation (SPEC §7G, ADR 0036; source: "media"): one engine, two faces. Typed verbs a host calls (Media::image, Media::video, …) and tools an LLM calls (Media::tools). Providers are styles — JSON data, never code. Conformance: conformance/media/.
relay
Relay (declaration-only) tools and the durable resume path — SPEC §10, ADR-0010. Port of golang/relay.go.
serve
A2A — INBOUND: serve a toolkit as a remote A2A agent (SPEC §7B), plus the mount point for the MCP server profile (§7C, crate::mcp_serve). Port of golang/serve.go. Behind the serve feature (hyper).
skills
Agent skills (SPEC §0 items 5–6, §3): discover **/SKILL.md, parse YAML frontmatter, and expose ONE skill tool that loads a skill’s instructions plus a sample of its files on demand. Output is byte-identical to the other ports; port of golang/skill.go, including its ordering rules.
store
Conversation memory (SPEC §8): a ConversationStore keyed by conversation id, plus the in-memory default and a durable file-backed store.
tool
Core tool types (SPEC §0 item 1, §1): one Tool shape for every source.
toolkit
Toolkit — the aggregator (SPEC §4): MCP → skill → builtin → A2A agents → extraTools, first name wins, an extraTools entry shadows a builtin of the same name.