Expand description
CLEANLIB-691 — canonical manifest-filename → ecosystem detection.
Single source of truth so every surface infers the ecosystem identically:
the CLI (cleanlib scan --packages <file> without --ecosystem), the LSP,
the MCP tools, and the SDK convenience wrappers. Lives in cleanlib-client
(not the CLI) for the same reason the customer-state taxonomy does — it is a
cross-surface contract, not a CLI-local helper.
Detection is on the file NAME (basename). It is deliberately conservative:
it recognises the canonical manifest/lockfile names and returns None for
anything ambiguous or unrecognised, so the caller can prompt for an explicit
--ecosystem rather than guess wrong on a security product.
Functions§
- ecosystem_
from_ path - The wire ecosystem string for a manifest/lockfile path, or
Nonewhen the filename is not a recognised manifest (the caller then asks the user to pass--ecosystemexplicitly). Matches the ecosystem names the App’sGET /healthadvertises (npm / pypi / crates / go / maven / packagist / rubygems / nuget / pub).