Skip to main content

Module packages

Module packages 

Source
Expand description

Discovery of Pi-compatible package resources.

This module resolves package manifests and static resource paths. Extension paths are handed to the Node bridge by js_extensions; the Rust cdylib loader remains a separate extension mechanism. A package is a directory containing a package.json (or a conventional skills/, prompts/, themes/ tree). The optional pi/rpi manifest object may override those resource paths.

Structs§

PackageDiagnostic
PackageResources
PackageRoot

Enums§

PackageSource

Functions§

discover
Discover packages in settings order. Package resources are intentionally returned after project and global resources; callers append these paths last so a package cannot shadow a project-local or user-local resource.
discover_from_global_settings
Resolve only packages declared in the global settings file. Project-local package declarations are intentionally excluded when the current project has not been trusted.
discover_from_settings
Resolve package specs from the settings file and conventional local roots. Empty or missing packages means no packages are enabled, matching Pi’s explicit package list instead of silently executing every directory found under the user’s home directory.
load_theme
Load a theme from an explicit JSON path without discovering configured Pi packages. Startup code that has passed the package gate uses load_theme_with_resources to resolve package theme names.
load_theme_with_resources
Load a package theme from an already-resolved resource set. Startup callers use this variant so a disabled package configuration cannot be re-discovered indirectly from a TUI theme selector.
resolve_from_global_settings
Runtime resolution restricted to global settings. This is used when the current project is not trusted, so no project command or storage path is read or touched.
resolve_from_settings
Resolve packages for the explicitly enabled JS/TS runtime. Unlike the metadata-only discovery helpers, this mirrors native Pi by restoring a missing npm/Git source and reconciling an installed npm version that no longer satisfies its configured semver range. Callers must already have passed the project trust gate before selecting the project variant.
resolve_offline_from_global_settings
resolve_offline_from_settings
Offline runtime resolution never invokes npm or Git. Installed npm packages that do not satisfy their configured version are withheld rather than executing stale code, matching native Pi’s offline missing-source behavior.
resolve_package
Validate and load one package spec. Used by rpi package add before the spec is persisted to settings.
run_cli
rpi package ... command for managing the enabled Pi package list. This is a local package manager; use install-pi when the package must be fetched.