pub mod core;
pub mod events;
pub mod execution;
pub mod http;
pub mod output;
pub mod search;
pub mod security;
pub mod storage;
pub mod validation;
pub use core::context_resolver::{
ContentMode, ContextResolver, ResolveContextRequest, ResolveContextResponse, ResolveScope,
ResolvedSkill,
};
pub use core::embedding::{EmbeddingService, OpenAIEmbeddingService};
pub use core::loading::{LoadedSkill, ProgressiveLoadingService};
pub use core::manifest::SkillProjectToml;
pub use core::metadata::{
parse_yaml_frontmatter, MetadataService, SkillFrontmatter, SkillMetadata,
};
pub use core::routing::{RoutedSkill, RoutingService};
pub use core::service::SkillId;
pub use core::service::{EmbeddingConfig, FastSkillService, ServiceConfig, ServiceError};
pub use core::skill_manager::{SkillDefinition, SkillManagementService};
pub use core::tool_calling::{AvailableTool, ToolCallingService, ToolResult};
pub use core::vector_index::{
IndexedSkill, SkillMatch, VectorIndexService, VectorIndexServiceImpl,
};
pub use output::OutputFormat;
pub use search::{execute, SearchError, SearchQuery, SearchResultItem, SearchScope};
pub use async_trait::async_trait;
pub use serde::{Deserialize, Serialize};
pub use std::collections::HashMap;
pub use std::path::{Path, PathBuf};
pub use std::sync::Arc;
pub use tokio::sync::{Mutex, RwLock};
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub fn init_logging() {
init_logging_with_verbose(false)
}
pub fn init_logging_with_verbose(verbose: bool) {
static INIT: std::sync::Once = std::sync::Once::new();
INIT.call_once(|| {
use tracing_subscriber::EnvFilter;
let default_level = if verbose {
"fastskill=info"
} else {
"fastskill=warn"
};
let filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| default_level.into());
let subscriber = tracing_subscriber::fmt().with_env_filter(filter).finish();
let _ = tracing::subscriber::set_global_default(subscriber);
});
}
pub mod test_utils;
#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod tests {
use super::*;
use tempfile::TempDir;
#[tokio::test]
async fn test_service_initialization() {
let temp_dir = TempDir::new().unwrap();
let config = ServiceConfig {
skill_storage_path: temp_dir.path().to_path_buf(),
..Default::default()
};
let service = FastSkillService::new(config).await.unwrap();
assert!(service.skill_manager().list_skills(None).await.is_ok());
}
}