Expand description
osdk-core: the reusable library behind the osdk universal SDK manager.
Module map:
platform— host OS/arch/libc detection + per-SDK token mapping.dirs— data/store/installs/shims/cache directory resolution.config— layered configuration (CLI > env > project > user).store— content-addressed store + link-mode materialization (dedup).source— multi-source model + fastest-mirror selection.version— version spec parsing + resolution + active-version walk-up.http— shared HTTP client + helpers.pipeline— download → verify → extract → CAS ingest orchestrator.backend— theBackendtrait, contexts, registry, and SDK impls.shim— shim launcher generation.lock— cross-process file locks.
Re-exports§
pub use backend::registry::Registry;pub use backend::Backend;pub use backend::Ctx;pub use backend::InstallCtx;pub use error::Error;pub use error::Result;
Modules§
- activate
- Shell activation.
- backend
- The
Backendtrait — the uniform contract every SDK implements — plus the shared contexts and the backend registry. - cache
- Manager-native downstream package caches (dedup layer 2).
- config
- Layered configuration.
- container
- Native container-runtime contracts.
- dirs
- Resolution of osdk’s on-disk directories (data / store / installs / shims /
cache), honoring
OSDK_*env overrides, then falling back to the platform conventions provided by thedirectoriescrate (XDG on Linux). - error
- Error types for osdk-core.
- http
- Shared HTTP client factory and helpers for downloads and JSON index fetches.
- i18n
- Lightweight internationalization (i18n) for osdk.
- inventory
- Persisted inventory for dynamic tool installs.
- lock
- Cross-process file locks via
fslock, used to serialize installs of the same tool version and to guard store GC. - model
- Model references, immutable snapshot manifests, and local materialization.
- npm
- Minimal npm registry helpers: resolve a package version’s tarball URL + Subresource Integrity (SRI), used by the pnpm/yarn backends to install verified artifacts from the registry (mirror-friendly, first-party checksum).
- npm_
tools - Installer selection for npm-backed developer tools.
- package_
registry - Safe preflight selection for npm-compatible package registries.
- pipeline
- Install pipeline orchestrator: download → verify → extract → CAS ingest → materialize. Shared by all archive-based backends (node/go/python/java, standalone pnpm/yarn).
- platform
- OS / architecture detection and target-triple normalization.
- process
- Helpers for running external commands (used by delegate backends like rustup and corepack).
- shim
- Shim generation.
- source
- Multi-source model: each SDK ships a default list of sources (official +
authoritative mirrors); users can add custom sources or pin one. The
selection strategy (auto/pinned/ordered) is applied by
select. - store
- Content-addressed store (CAS): the dedup engine.
- tool
- Canonical tool identities and the shared dynamic request grammar.
- trust
- verification
- GitHub artifact-attestation acquisition, caching, and Sigstore verification.
- version
- Version request / resolution types shared across backends.
Macros§
- t
- Convenience macro:
t!("key")ort!("key", name = value, ...). Values may be anyDisplaytype; they’re stringified.