Skip to main content

Module packages

Module packages 

Source
Expand description

Package system for oxicode CLI

Packages bundle extensions, skills, prompts, and themes for sharing. Supports local directories, npm packages, git repositories, GitHub shorthand, and URL-based archives.

§Package sources

  • Local path: a directory with oxicode-package.toml or auto-discoverable resources
  • npm: npm:<package>[@<version>] — resolved from the npm registry
  • git: https://github.com/org/repo.git[@ref], git://…, git+ssh://…
  • GitHub shorthand: github:org/repo[@ref]
  • URL: direct .tar.gz / .zip archive

§Package manifest

A package is a directory containing an oxicode-package.toml file:

name = "@foo/oxicode-tools"
version = "1.0.0"
extensions = ["ext/index.ts"]
skills = ["skills/code-review/SKILL.md"]
prompts = ["prompts/review.md"]
themes = ["themes/dark-pro.json"]

§Resource discovery

When a package lacks explicit resource lists, resources are discovered automatically by scanning the package directory:

  • Extensions: .so, .dylib, .dll files, or index.ts/index.js entries
  • Skills: Directories containing SKILL.md
  • Prompts: .md files in prompts/ subdirectory
  • Themes: .json files in themes/ subdirectory

§Lockfile

An oxicode-lock.json file records exact versions/refs for reproducibility.

§Module layout

The package subsystem is split across several submodules for navigability. Public re-exports at the bottom preserve the original crate::storage::packages::* API.

  • types — core data types (manifest, kind, scope, progress events)
  • source — source-spec parsing (ParsedSource, npm/git/url helpers)
  • npm — npm registry client (NpmPackageInfo)
  • git_ops — git command wrappers (git_clone, git_update, …)
  • lockfile — lockfile types + SHA-256 integrity helpers
  • discovery — auto-discovery of resources in a package directory
  • fs — generic filesystem helpers (copy_dir_recursive, …)
  • managerPackageManager facade + tests

Structs§

ConfiguredPackage
A configured package
DiscoveredResource
A discovered resource within a package
DoctorCheck
A single structured check result.
DoctorReport
Aggregated doctor report. A report is all_clear when every check is Healthy.
EnabledSummary
Convenience summary showing the layered precedence outcome.
LockEntry
Lockfile entry for an installed package
Lockfile
The lockfile structure
NpmPackageInfo
Information fetched from the npm registry
PackageManager
Manages installation, removal, and listing of packages
PackageManifest
Package manifest describing bundled resources
PackageUpdateInfo
Information about an available package update
PathMetadata
Metadata about a resolved resource path
ProgressEvent
Progress events for package operations
ProjectPluginOverrides
Per-project plugin override file.
ResolvedPaths
Resolved paths for all resource types
ResolvedResource
A resolved resource with metadata
ResourceCounts
Counts of each resource type in a package
RuntimeConfig
Per-package disabled-resource toggle.

Enums§

ForceState
Tri-state project force for a single (package, kind) pair.
Health
Severity of a single check.
ParsedSource
Parsed package source
ProgressAction
Action being performed
ProgressEventType
Progress event type
ResourceKind
Types of resources a package can contribute
ResourceOrigin
Origin of a resource
SourceScope
Scope for package sources

Constants§

RUNTIME_CONFIG_FILE
Default filename under ~/.oxicode.
RUNTIME_CONFIG_VERSION
On-disk schema version for RuntimeConfig.

Functions§

get_latest_npm_version
Get the latest version of an npm package
resolve_enabled
Resolve the enabled flag for (package, kind) under the layered precedence: project-force > runtime-disable > default(true).
run_doctor
Construct a Doctor directly from a PackageManager reference.

Type Aliases§

ForceMap
Map from package name to per-kind ForceState. Keys present in the map override anything below them in the precedence chain.
ProgressCallback
Callback for progress events