Expand description
Extension traits for custom connectors and tools.
This module provides the trait-based extension system for Context Harness.
Users can implement Connector and Tool in Rust to create compiled
extensions that run alongside built-in and Lua-scripted ones.
§Architecture
┌──────────────────────────────────────────┐
│ ConnectorRegistry │
│ ┌─────────┐ ┌─────────┐ ┌────────────┐ │
│ │Built-in │ │ Lua │ │ Custom │ │
│ │FS/Git/S3│ │ Script │ │ (Rust) │ │
│ └─────────┘ └─────────┘ └────────────┘ │
└──────────────┬───────────────────────────┘
▼
run_sync() → ingest pipeline┌──────────────────────────────────────────┐
│ ToolRegistry │
│ ┌─────────┐ ┌─────────┐ ┌────────────┐ │
│ │Built-in │ │ Lua │ │ Custom │ │
│ │search │ │ Script │ │ (Rust) │ │
│ │get/src │ │ Tools │ │ Tools │ │
│ └─────────┘ └─────────┘ └────────────┘ │
└──────────────┬───────────────────────────┘
▼
run_server() → MCP HTTP API§Usage
use context_harness::traits::{ConnectorRegistry, ToolRegistry};
let mut connectors = ConnectorRegistry::new();
// connectors.register(Box::new(MyConnector::new()));
let mut tools = ToolRegistry::new();
// tools.register(Box::new(MyTool::new()));See docs/RUST_TRAITS.md for the full specification and examples.
Structs§
- Connector
Registry - Registry for connectors (built-in and custom).
- GetTool
- Built-in document retrieval tool. Delegates to
get_document. - Search
Options - Options for
ToolContext::search. - Search
Tool - Built-in search tool. Delegates to
ToolContext::search. - Sources
Tool - Built-in sources listing tool. Delegates to
get_sources. - Tool
Context - Context bridge for tool execution.
- Tool
Registry - Registry for tools (built-in, Lua, and custom Rust).