Expand description
§FastSkill Service Layer (Rust Implementation)
This crate provides a high-performance, memory-safe implementation of the FastSkill service layer. It serves as the reference implementation for other language bindings and can be used standalone or as a library.
§Architecture
The service layer provides:
- Skill management (CRUD operations)
- Metadata and discovery services
- Progressive loading of skill content
- Tool calling and script execution
- Hot reloading capabilities
- Security sandboxing
§Example Usage
use fastskill_core::{FastSkillService, ServiceConfig};
use std::path::PathBuf;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = ServiceConfig {
skill_storage_path: PathBuf::from("./skills"),
..Default::default()
};
let service = FastSkillService::new(config).await?;
// List available skills
let skills = service.skill_manager().list_skills(None).await?;
println!("Found {} skills", skills.len());
// Discover relevant skills
let relevant_skills = service.metadata_service()
.discover_skills("extract text from PDF")
.await?;
println!("Found {} relevant skills", relevant_skills.len());
// Get available tools
let tools = service.tool_service().get_available_tools().await?;
println!("Available tools: {:?}", tools);
Ok(())
}Re-exports§
pub use core::context_resolver::ContentMode;pub use core::context_resolver::ContextResolver;pub use core::context_resolver::ResolveContextRequest;pub use core::context_resolver::ResolveContextResponse;pub use core::context_resolver::ResolveScope;pub use core::context_resolver::ResolvedSkill;pub use core::embedding::EmbeddingService;pub use core::embedding::OpenAIEmbeddingService;pub use core::loading::LoadedSkill;pub use core::loading::ProgressiveLoadingService;pub use core::manifest::SkillProjectToml;pub use core::metadata::parse_yaml_frontmatter;pub use core::metadata::MetadataService;pub use core::metadata::SkillFrontmatter;pub use core::metadata::SkillMetadata;pub use core::routing::RoutedSkill;pub use core::routing::RoutingService;pub use core::service::SkillId;pub use core::service::EmbeddingConfig;pub use core::service::FastSkillService;pub use core::service::ServiceConfig;pub use core::service::ServiceError;pub use core::skill_manager::SkillDefinition;pub use core::skill_manager::SkillManagementService;pub use core::tool_calling::AvailableTool;pub use core::tool_calling::ToolCallingService;pub use core::tool_calling::ToolResult;pub use core::vector_index::IndexedSkill;pub use core::vector_index::SkillMatch;pub use core::vector_index::VectorIndexService;pub use core::vector_index::VectorIndexServiceImpl;pub use output::OutputFormat;pub use search::execute;pub use search::SearchError;pub use search::SearchQuery;pub use search::SearchResultItem;pub use search::SearchScope;
Modules§
- core
- Core service layer modules
- events
- Event system for skill lifecycle management
- execution
- Script execution environment with sandboxing support
- http
- HTTP server implementation for FastSkill
- output
- Output formatting module providing consistent formatting across commands
- search
- Search domain module providing unified search capabilities across local and remote scopes
- security
- Security utilities for fastskill
- storage
- Storage backend implementations
- test_
utils - Test utilities shared across the crate
- validation
- Skill validation implementations
Structs§
- Arc
- A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
- HashMap
- A hash map implemented with quadratic probing and SIMD lookup.
- Mutex
- An asynchronous
Mutex-like type. - Path
- A slice of a path (akin to
str). - PathBuf
- An owned, mutable path (akin to
String). - RwLock
- An asynchronous reader-writer lock.
Constants§
- VERSION
- Version of the service layer
Traits§
- Deserialize
- A data structure that can be deserialized from any data format supported by Serde.
- Serialize
- A data structure that can be serialized into any data format supported by Serde.
Functions§
- init_
logging - Initialize logging for the service layer (safe for testing)
- init_
logging_ with_ verbose - Initialize logging for the service layer with optional verbose mode