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§
Enums§
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
packagesmeans 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_resourcesto 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 addbefore the spec is persisted to settings. - run_cli
rpi package ...command for managing the enabled Pi package list. This is a local package manager; useinstall-piwhen the package must be fetched.