Skip to main content

Module packages

Module packages 

Source
Expand description

Packages: npm, git and local sources that bring extensions, skills, prompt templates and themes. Port of pi’s package manager (core/package-manager.ts in pi v1.0.0), with a built-in npm client.

Packages live under the scope’s directory: <agent>/npm and <agent>/git/<host>/<path> for the user, <cwd>/.yapi/... for a project. Settings list them in packages.

Re-exports§

pub use source::Source;
pub use source::parse;

Modules§

npm
A built-in npm client, so packages install without Node: it resolves versions from the registry, verifies and unpacks tarballs into node_modules and installs dependencies, hoisting them where Node’s resolution allows. It runs no lifecycle scripts, so native addons stay unbuilt, and an extension that loads one fails then. Installs return the tree they unpacked as pins, which replay reproduces without the registry.
resolve
Every resource that settings, packages and the agent and project directories provide, each enabled or not, in load precedence order.
source
Package sources: npm: specs, git repositories and local paths, as pi’s parseSource reads them (core/package-manager.ts, utils/git.ts).

Structs§

Configured
A configured package, as list shows it.
PackageManager
Installs, removes and resolves packages for a working directory.

Enums§

PackageError
Why a package operation failed, with pi’s message where pi has one.

Functions§

entry_source
A settings entry: a source string or a filtered package.
install_location
Where source, written in settings whose directory is base, is or would be installed.
resolve_resources
pi’s DefaultPackageManager.resolve for the settings of the project in project_root and of agent_dir: every resource of installed packages, settings entries and the discovered directories, each enabled or not, with builtins as the built-in extensions, and the packages and placed skills that chest installed. Packages that are not installed are left out, and so is each copy of a package that another source installs too, as LeftOut decides.
scope_dir
The directory a scope’s packages and relative settings paths use: the agent directory for the user, the project’s config directory otherwise.
settings_packages
The packages entries of scope’s settings.