Jesús Pérez 765841b18f
Some checks failed
Documentation Lint & Validation / Markdown Linting (push) Has been cancelled
Documentation Lint & Validation / Validate mdBook Configuration (push) Has been cancelled
Documentation Lint & Validation / Content & Structure Validation (push) Has been cancelled
Documentation Lint & Validation / Lint & Validation Summary (push) Has been cancelled
mdBook Build & Deploy / Build mdBook (push) Has been cancelled
mdBook Build & Deploy / Documentation Quality Check (push) Has been cancelled
mdBook Build & Deploy / Deploy to GitHub Pages (push) Has been cancelled
mdBook Build & Deploy / Notification (push) Has been cancelled
Rust CI / Security Audit (push) Has been cancelled
Rust CI / Check + Test + Lint (nightly) (push) Has been cancelled
Rust CI / Check + Test + Lint (stable) (push) Has been cancelled
feat(capabilities): add vapora-capabilities crate with in-process executor dispatch
- New vapora-capabilities crate: CapabilitySpec, Capability trait, CapabilityRegistry
     (parking_lot RwLock), CapabilityLoader (TOML overrides), 3 built-ins
     (code-reviewer, doc-generator, pr-monitor), 22 tests
   - Move AgentDefinition to vapora-shared to break capabilities↔agents circular dep
   - Wire system_prompt into AgentExecutor via LLMRouter.complete_with_budget
   - AgentCoordinator: in-process task dispatch via DashMap<String, Sender<TaskAssignment>>
   - server.rs: bootstrap CapabilityRegistry + LLMRouter from env, spawn executors per capability
   - Landing page: 620 tests, 21 crates, Capability Packages feature box
   - docs: capability-packages feature guide, ADR-0037, CHANGELOG, SUMMARY
   EOF
2026-02-26 16:43:28 +00:00

73 lines
2.3 KiB
Rust

//! Pre-built capability packages for VAPORA agents.
//!
//! A capability package bundles everything needed to deploy a domain-optimized
//! agent without manual configuration: system prompt, MCP tool list, LLM model
//! preferences, and task-type classification hints.
//!
//! # Quick Start
//!
//! ```rust
//! use vapora_capabilities::CapabilityRegistry;
//!
//! // 1. Create the registry with all built-ins
//! let registry = CapabilityRegistry::with_built_ins();
//!
//! // 2. Activate a capability → produces an AgentDefinition
//! let def = registry.activate("code-reviewer").unwrap();
//!
//! // 3. Use the definition to instantiate an AgentMetadata in the coordinator
//! assert_eq!(def.role, "code_reviewer");
//! assert!(def.system_prompt.is_some());
//! ```
//!
//! # Built-in Capabilities
//!
//! | ID | Role | Purpose |
//! |----|------|---------|
//! | `code-reviewer` | `code_reviewer` | Security and correctness-focused code review |
//! | `doc-generator` | `documenter` | Technical documentation generation |
//! | `pr-monitor` | `monitor` | Pull request health and merge readiness |
//!
//! # Customization via TOML
//!
//! Override built-in settings or add custom capabilities through a TOML file:
//!
//! ```toml
//! [[override]]
//! id = "code-reviewer"
//! preferred_model = "claude-sonnet-4-6"
//!
//! [[custom]]
//! id = "db-optimizer"
//! display_name = "Database Optimizer"
//! description = "Analyzes and optimizes SQL queries"
//! agent_role = "db_optimizer"
//! task_types = ["db_optimization"]
//! system_prompt = "You are a database expert..."
//! mcp_tools = ["file_read", "code_search"]
//! preferred_provider = "claude"
//! preferred_model = "claude-sonnet-4-6"
//! max_tokens = 4096
//! temperature = 0.2
//! priority = 65
//! parallelizable = true
//! ```
//!
//! Then apply via [`CapabilityLoader`]:
//!
//! ```rust,no_run
//! use vapora_capabilities::{CapabilityRegistry, CapabilityLoader};
//!
//! let registry = CapabilityRegistry::with_built_ins();
//! CapabilityLoader::load_and_apply("config/capabilities.toml", &registry).unwrap();
//! ```
pub mod built_in;
pub mod capability;
pub mod loader;
pub mod registry;
pub use capability::{Capability, CapabilitySpec, CustomCapability};
pub use loader::{CapabilityConfig, CapabilityLoader, CapabilityOverride, LoaderError};
pub use registry::{CapabilityError, CapabilityRegistry};