Skip to main content

Crate devboy_executor

Crate devboy_executor 

Source
Expand description

§devboy-executor

Tool execution engine for devboy-tools.

Separates tool execution logic from transport (MCP stdio, HTTP, NAPI). Provides:

  • Executor — dispatches tool calls to providers with enrichment pipeline
  • AdditionalContext / ProviderConfig — typed runtime context
  • ToolOutput — typed results from tool execution
  • ToolEnricher — plugin trait for dynamic schema modification
  • factory — creates providers from ProviderConfig

§Usage

use devboy_executor::{Executor, AdditionalContext, ProviderConfig, GitLabScope};
use devboy_executor::enricher::FormatPipelineEnricher;
use std::collections::HashMap;

let mut executor = Executor::new();
executor.add_enricher(Box::new(FormatPipelineEnricher));

let ctx = AdditionalContext {
    provider: ProviderConfig::GitLab {
        base_url: "https://gitlab.com".into(),
        access_token: "glpat-xxx".into(),
        scope: GitLabScope::Project { id: "12345".into() },
        extra: HashMap::new(),
    },
    proxy: None,
    metadata: None,
    extra: HashMap::new(),
};

let args = serde_json::json!({ "state": "opened", "limit": 10 });
let output = executor.execute("get_merge_requests", args, &ctx).await?;
println!("Got {} items", output.item_count());

Re-exports§

pub use context::AdditionalContext;
pub use context::ClickUpScope;
pub use context::ConfluenceAuthConfig;
pub use context::ConfluenceScope;
pub use context::GitHubScope;
pub use context::GitLabScope;
pub use context::JiraScope;
pub use context::ProviderConfig;
pub use context::ProviderMetadata;
pub use context::ProxyConfig;
pub use enricher::PipelineFormatEnricher;
pub use executor::Executor;
pub use executor::SUPPORTED_TOOLS;
pub use factory::create_enricher;
pub use factory::create_knowledge_base_enricher;
pub use factory::create_knowledge_base_provider;
pub use format::FormatMetadata;
pub use format::FormatResult;
pub use format::execute_and_format;
pub use format::format_output;
pub use output::ResultMeta;
pub use output::ToolOutput;
pub use tools::McpOnlyTool;
pub use tools::ToolDefinition;

Modules§

context
Typed runtime context: provider configs, scopes, additional metadata.
enricher
Built-in enrichers for the executor.
executor
factory
Provider factory — builds concrete Provider instances from ProviderConfig.
format
Format ToolOutput to text using the format pipeline.
output
Typed ToolOutput returned from tool execution.
tool_docs
Auto-generated tool reference documentation.
tools
Base tool definitions for all provider tools.

Structs§

ToolSchema
Tool input schema with typed property definitions.

Traits§

ToolEnricher
Trait for plugins that dynamically modify tool schemas and transform arguments.

Functions§

sanitize_field_name
Convert a human-readable field name to a safe cf_ parameter name.