first pass of merging in warp (doesn't build)
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use ai::skills::SkillPathOrigin;
|
||||
use warp_util::local_or_remote_path::LocalOrRemotePath;
|
||||
|
||||
mod telemetry;
|
||||
pub use telemetry::{SkillOpenOrigin, SkillTelemetryEvent};
|
||||
#[cfg(all(not(target_family = "wasm"), feature = "local_fs"))]
|
||||
mod remote;
|
||||
#[cfg(all(not(target_family = "wasm"), feature = "local_fs"))]
|
||||
pub(crate) use remote::bundled_skill_snapshot_protos;
|
||||
#[cfg(feature = "local_fs")]
|
||||
mod bundled;
|
||||
#[cfg(all(not(target_family = "wasm"), feature = "local_fs"))]
|
||||
pub(crate) use bundled::{BundledSkill, BundledSkillActivation};
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(not(feature = "local_fs"))] {
|
||||
@@ -10,14 +23,67 @@ cfg_if::cfg_if! {
|
||||
|
||||
pub use ai::skills::SkillReference;
|
||||
|
||||
#[cfg_attr(target_family = "wasm", allow(dead_code))]
|
||||
pub enum SkillManagerEvent {
|
||||
HomeSkillsChanged,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
|
||||
pub enum ActiveSkillLookupError {
|
||||
#[error("Bundled skills are not available on this remote session")]
|
||||
BundledSkillsUnavailable,
|
||||
#[error("Skill not found: {reference}")]
|
||||
NotFound { reference: SkillReference },
|
||||
}
|
||||
|
||||
impl ActiveSkillLookupError {
|
||||
pub(crate) fn for_reference(reference: &SkillReference, path_origin: &SkillPathOrigin) -> Self {
|
||||
if matches!(path_origin, SkillPathOrigin::Unavailable)
|
||||
&& matches!(reference, SkillReference::BundledSkillId(_))
|
||||
{
|
||||
Self::BundledSkillsUnavailable
|
||||
} else {
|
||||
Self::NotFound {
|
||||
reference: reference.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
mod global_skills;
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
pub use global_skills::{filter_skills_by_spec, resolve_skill_repos};
|
||||
|
||||
mod listed_skill;
|
||||
pub use listed_skill::SkillDescriptor;
|
||||
|
||||
mod skill_utils;
|
||||
pub use skill_utils::{
|
||||
icon_override_for_skill_name, list_skills_if_changed, render_skill_button,
|
||||
skill_path_from_file_path,
|
||||
skill_path_from_location,
|
||||
};
|
||||
pub trait SkillPathQuery {
|
||||
fn to_skill_location(&self) -> LocalOrRemotePath;
|
||||
}
|
||||
|
||||
impl SkillPathQuery for LocalOrRemotePath {
|
||||
fn to_skill_location(&self) -> LocalOrRemotePath {
|
||||
self.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl SkillPathQuery for Path {
|
||||
fn to_skill_location(&self) -> LocalOrRemotePath {
|
||||
LocalOrRemotePath::Local(self.to_path_buf())
|
||||
}
|
||||
}
|
||||
|
||||
impl SkillPathQuery for PathBuf {
|
||||
fn to_skill_location(&self) -> LocalOrRemotePath {
|
||||
LocalOrRemotePath::Local(self.clone())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
mod resolve_skill_spec;
|
||||
@@ -29,6 +95,8 @@ pub use resolve_skill_spec::{
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "local_fs")] {
|
||||
mod skill_manager;
|
||||
pub use skill_manager::{SkillManager, SkillWatcher};
|
||||
pub use skill_manager::{
|
||||
read_skills_from_directories, SkillManager, SkillWatcher,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user