pub struct MigrationShim { /* private fields */ }Expand description
Migration shim for converting legacy agent formats to extensions
This struct provides utilities for:
- Loading legacy agent TOML files with deprecation warnings
- Mapping task agent_type fields to extension manifests
- Converting between legacy and new formats
Implementations§
Source§impl MigrationShim
impl MigrationShim
Sourcepub fn with_config(config: DeprecationConfig) -> Self
pub fn with_config(config: DeprecationConfig) -> Self
Create a migration shim with custom deprecation config
Sourcepub fn load_legacy_agent(
&mut self,
path: &Path,
) -> Result<ExtensionManifest, ExtensionError>
pub fn load_legacy_agent( &mut self, path: &Path, ) -> Result<ExtensionManifest, ExtensionError>
Load a legacy agent TOML file, emitting deprecation warning if configured
Sourcepub fn load_legacy_agent_str(
&mut self,
content: &str,
path: &PathBuf,
) -> Result<ExtensionManifest, ExtensionError>
pub fn load_legacy_agent_str( &mut self, content: &str, path: &PathBuf, ) -> Result<ExtensionManifest, ExtensionError>
Load a legacy agent from string content
Sourcepub fn resolve_agent_type(
&mut self,
agent_type: &str,
project_root: &Path,
) -> Option<ExtensionManifest>
pub fn resolve_agent_type( &mut self, agent_type: &str, project_root: &Path, ) -> Option<ExtensionManifest>
Resolve an agent_type to an extension manifest
Searches in order:
- Cached manifests from previous loads
- Project-local .scud/agents/<agent_type>.toml
- Built-in agent definitions (embedded)
Returns the manifest if found, with deprecation warning for legacy formats.
Sourcepub fn legacy_paths(&self) -> &[PathBuf]
pub fn legacy_paths(&self) -> &[PathBuf]
Get list of paths that were loaded as legacy format
Sourcepub fn has_legacy_loads(&self) -> bool
pub fn has_legacy_loads(&self) -> bool
Check if any legacy formats were loaded
Sourcepub fn cached_agent_types(&self) -> Vec<&str>
pub fn cached_agent_types(&self) -> Vec<&str>
Get cached agent types
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the cache
Trait Implementations§
Source§impl Debug for MigrationShim
impl Debug for MigrationShim
Auto Trait Implementations§
impl Freeze for MigrationShim
impl RefUnwindSafe for MigrationShim
impl Send for MigrationShim
impl Sync for MigrationShim
impl Unpin for MigrationShim
impl UnwindSafe for MigrationShim
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more