Skip to main content

Module resolve

Module resolve 

Source
Expand description

Every resource that settings, packages and the agent and project directories provide, each enabled or not, in load precedence order.

Port of DefaultPackageManager.resolve and its pattern rules in core/package-manager.ts in pi v1.0.0. yapi also loads .wasm native extensions wherever pi loads .ts and .js ones.

Structs§

PackageInput
A package to collect from, after pi’s deduplication.
ResolveInput
What resolve reads.
Resolved
A resource and whether it loads.
ResolvedPaths
pi’s ResolvedPaths: resolved resources by kind.

Enums§

ResourceType
A kind of resource.

Constants§

BUILTIN_PREFIX
The path prefix naming a built-in extension.

Functions§

apply_patterns
pi’s applyPatterns: plain globs select (all when there are none), ! globs remove, + paths add back and - paths remove.
dedupe_packages
pi’s dedupePackages: the packages entries of the project, then the user, with their scopes, project or user. A project entry wins over the user’s for the same package, as identity names it for a source and scope, unless it sets autoload: false: then both stay.
is_enabled_by_overrides
pi’s isEnabledByOverrides: ! globs disable, then + paths enable, then - paths disable.
locate_packages
pi’s dedupePackages with findAutoloadDeltaBase: each entry that dedupe_packages keeps, with its scope, then the source and scope its package is installed under, pi’s resolvedSource and resolvedScope. A project entry with autoload: false takes the user’s entry for the same package, when there is one.
package_inputs
The packages of locate_packages that are installed, as install_path places a source written in a scope’s settings. A project entry with autoload: false only overrides the resources it names, on top of the user’s entry.
package_resources
The resources of the package installed at root, as resolve finds them for a settings entry with filter, each enabled or not. local says whether its source is a local path.
resolve
pi’s resolve: packages, then settings entries, then discovered files, then built-in extensions, ordered by precedence without repeats.
settings_lists
The extensions, skills, prompts and themes lists of a settings document.
string_list
The strings in list key of a settings document or package entry, skipping entries of other types.