pub struct PackageManager { /* private fields */ }Implementations§
Source§impl PackageManager
impl PackageManager
pub const fn new(cwd: PathBuf) -> Self
Sourcepub fn resolve_install_source_alias(&self, source: &str) -> String
pub fn resolve_install_source_alias(&self, source: &str) -> String
Resolve a shorthand source (id/name) via the local extension index when possible.
Returns the original source when no unique alias mapping exists.
Sourcepub fn package_identity(&self, source: &str) -> String
pub fn package_identity(&self, source: &str) -> String
Get a stable identity for a package source, ignoring version/ref.
Mirrors pi-mono’s getPackageIdentity():
- npm:
npm:<name> - git:
git:<repo>(normalized host/path, no ref) - local:
local:<resolved-absolute-path>
pub async fn install(&self, source: &str, scope: PackageScope) -> Result<()>
pub async fn remove(&self, source: &str, scope: PackageScope) -> Result<()>
pub async fn update_source( &self, source: &str, scope: PackageScope, ) -> Result<()>
pub async fn installed_path( &self, source: &str, scope: PackageScope, ) -> Result<Option<PathBuf>>
Sourcepub fn installed_path_blocking(
&self,
source: &str,
scope: PackageScope,
) -> Result<Option<PathBuf>>
pub fn installed_path_blocking( &self, source: &str, scope: PackageScope, ) -> Result<Option<PathBuf>>
Synchronous variant of Self::installed_path for startup fast paths.
pub async fn list_packages(&self) -> Result<Vec<PackageEntry>>
Sourcepub fn list_packages_blocking(&self) -> Result<Vec<PackageEntry>>
pub fn list_packages_blocking(&self) -> Result<Vec<PackageEntry>>
Synchronous variant of Self::list_packages for startup fast paths.
Sourcepub fn resolve_package_resources_blocking(
&self,
) -> Result<Option<ResolvedPaths>>
pub fn resolve_package_resources_blocking( &self, ) -> Result<Option<ResolvedPaths>>
Best-effort synchronous package resource resolution for startup/config fast paths.
Returns Ok(Some(...)) when all package resources can be resolved from local state
without any install/update work. Returns Ok(None) when a package source would require
install/update behavior (for example, missing npm/git package files), allowing callers
to fall back to the canonical async resolve() path.
Sourcepub async fn ensure_packages_installed(&self) -> Result<Vec<PackageEntry>>
pub async fn ensure_packages_installed(&self) -> Result<Vec<PackageEntry>>
Ensure all packages in settings are installed. Returns the list of packages that were newly installed.
Sourcepub async fn resolve(&self) -> Result<ResolvedPaths>
pub async fn resolve(&self) -> Result<ResolvedPaths>
Resolve all resources (extensions/skills/prompts/themes) from:
- packages in global + project settings (deduped by identity; project wins)
- local resource entries from settings (with pattern filtering)
- auto-discovered resources from standard directories (with override patterns)
This matches pi-mono’s DefaultPackageManager.resolve() semantics.
pub async fn resolve_with_roots( &self, roots: &ResolveRoots, ) -> Result<ResolvedPaths>
Sourcepub async fn resolve_extension_sources(
&self,
sources: &[String],
options: ResolveExtensionSourcesOptions,
) -> Result<ResolvedPaths>
pub async fn resolve_extension_sources( &self, sources: &[String], options: ResolveExtensionSourcesOptions, ) -> Result<ResolvedPaths>
Resolve resources for extension sources specified via CLI -e/--extension.
Mirrors pi-mono’s resolveExtensionSources(..., { temporary: true }).
pub async fn add_package_source( &self, source: &str, scope: PackageScope, ) -> Result<()>
pub async fn remove_package_source( &self, source: &str, scope: PackageScope, ) -> Result<()>
Trait Implementations§
Source§impl Clone for PackageManager
impl Clone for PackageManager
Source§fn clone(&self) -> PackageManager
fn clone(&self) -> PackageManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PackageManager
impl RefUnwindSafe for PackageManager
impl Send for PackageManager
impl Sync for PackageManager
impl Unpin for PackageManager
impl UnsafeUnpin for PackageManager
impl UnwindSafe for PackageManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
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>
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>
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