Skip to main content

Module shim

Module shim 

Source
Expand description

Shim generation.

A shim is a stand-in for a tool’s executable, placed in the shims dir (which the user puts on PATH). Invoking it dispatches to the active version via the osdk-shim launcher.

  • Unix: a symlink from shims/<name> to the osdk-shim binary. The launcher inspects argv[0] to learn which tool to run.
  • Windows: no symlink (privilege). We emit shims/<name>.cmd and an extension-less bash wrapper shims/<name> so cmd.exe/PowerShell and Git-Bash both work, each invoking osdk-shim.exe.

Structs§

ValidatedDynamicInstall
One persisted dynamic install whose complete identity has been checked against the active request. Callers keep this value through path and executable selection so security-sensitive inventory data is not reloaded.

Functions§

configured_and_installed_dynamic_ids
Dynamic backend ids relevant to lifecycle operations that survive restarts: configured ids plus anything found on disk through inventory scanning.
configured_dynamic_ids
Dynamic backend ids referenced by the current config. Persisted install manifests intentionally never own aliases or configuration keys.
dynamic_bin_ownership
Deterministic manifest-backed bin ownership used after a process restart, even when the dynamic backend implementation itself does not expose bin_names yet.
dynamic_request_from_config
Resolve a dynamic backend request from the merged config, supporting both a direct dynamic backend key ("npm:@scope/pkg" = "1.2.3") and an indirection key whose value is the dynamic request (tool.ni = "npm:@scope/pkg@1.2.3").
find_shim_binary
Locate the installed osdk-shim binary. It is expected to sit next to the osdk binary (same dir). Falls back to the shims dir.
generate_shim
Generate a shim named name in the shims dir pointing at osdk_shim_bin.
remove_managed_shim
Remove a shim only when it has osdk’s generated shape. This lets reshim reconcile obsolete routing aliases without deleting unrelated files that a user may have placed in the shims directory.
remove_shim
Remove a shim by name (all its platform variants).
routed_bin_names
Executable names that should route through the shim for an installed backend version. These are deliberately separate from backend ownership: Node does not own npm/npx, but its bundled launchers still need routing shims so Node-only activations cannot bypass package-registry preflight.
scan_dynamic_installs
Scan all persisted dynamic-tool manifests under the installs tree.
selected_dynamic_install_identity
validated_dynamic_install
Load the selected dynamic install and require it to prove the same backend, exact version, and public option identity as the configured request. Legacy .osdk-tool.json and missing inventories are discoverable elsewhere, but cannot authorize PATH exposure or execution.