1pub mod core;
52pub mod events;
53pub mod execution;
54pub mod http;
55pub mod output;
56pub mod search;
57pub mod security;
58pub mod storage;
59pub mod validation;
60
61pub use core::context_resolver::{
62 ContentMode, ContextResolver, ResolveContextRequest, ResolveContextResponse, ResolveScope,
63 ResolvedSkill,
64};
65pub use core::embedding::{EmbeddingService, OpenAIEmbeddingService};
66pub use core::loading::{LoadedSkill, ProgressiveLoadingService};
67pub use core::manifest::SkillProjectToml;
68pub use core::metadata::{
69 parse_yaml_frontmatter, MetadataService, SkillFrontmatter, SkillMetadata,
70};
71pub use core::routing::{RoutedSkill, RoutingService};
72pub use core::service::SkillId;
73pub use core::service::{EmbeddingConfig, FastSkillService, ServiceConfig, ServiceError};
74pub use core::skill_manager::{SkillDefinition, SkillManagementService};
75pub use core::tool_calling::{AvailableTool, ToolCallingService, ToolResult};
76pub use core::vector_index::{
77 IndexedSkill, SkillMatch, VectorIndexService, VectorIndexServiceImpl,
78};
79
80pub use output::OutputFormat;
82pub use search::{execute, SearchError, SearchQuery, SearchResultItem, SearchScope};
83
84pub use async_trait::async_trait;
86pub use serde::{Deserialize, Serialize};
87pub use std::collections::HashMap;
88pub use std::path::{Path, PathBuf};
89pub use std::sync::Arc;
90pub use tokio::sync::{Mutex, RwLock};
91
92pub const VERSION: &str = env!("CARGO_PKG_VERSION");
94
95pub fn init_logging() {
97 init_logging_with_verbose(false)
98}
99
100pub fn init_logging_with_verbose(verbose: bool) {
102 static INIT: std::sync::Once = std::sync::Once::new();
104 INIT.call_once(|| {
105 use tracing_subscriber::EnvFilter;
106
107 let default_level = if verbose {
108 "fastskill=info"
109 } else {
110 "fastskill=warn"
111 };
112 let filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| default_level.into());
113
114 let subscriber = tracing_subscriber::fmt().with_env_filter(filter).finish();
115
116 let _ = tracing::subscriber::set_global_default(subscriber);
118 });
119}
120
121pub mod test_utils;
122
123#[cfg(test)]
124#[allow(clippy::unwrap_used)]
125mod tests {
126 use super::*;
127 use tempfile::TempDir;
128
129 #[tokio::test]
130 async fn test_service_initialization() {
131 let temp_dir = TempDir::new().unwrap();
132 let config = ServiceConfig {
133 skill_storage_path: temp_dir.path().to_path_buf(),
134 ..Default::default()
135 };
136
137 let service = FastSkillService::new(config).await.unwrap();
138 assert!(service.skill_manager().list_skills(None).await.is_ok());
139 }
140}