cleanlib-cli 0.1.1

Terminal interface to CleanLibrary — query dependency verdicts and scan package manifests for ALLOW / DENY / WARN signals from the terminal or CI pipelines.
//! Per-package-manager wrappers — cycle-7 Cli4. Day-1 scope per BD pick #4:
//! npm + pip + cargo + go (mvn + gem deferred to v0.1.1).
//!
//! Each wrapper parses the package manager's positional args, extracts
//! `(ecosystem, package, version)` triples, and surfaces them to the caller.
//! The caller (typically `cleanlib verdict <eco> <pkg> <ver>`) then calls
//! into `cleanlib_client::transport::Client::fetch_verdict` for the
//! verdict-aware gating decision.
//!
//! Shell-init mode (`cleanlib shell-init {bash|zsh|fish}`) emits these
//! wrappers as shell functions for transparent gating; the function bodies
//! delegate to `cleanlib verdict ...` per-package.

pub mod cargo;
pub mod go;
pub mod npm;
pub mod pip;

/// Common output of every wrapper's arg parser — the set of package
/// references the wrapped command would install.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct WrappedPackage {
    pub ecosystem: String,
    pub name: String,
    /// Version (ecosystem-native).  `"latest"` when the user didn't pin a
    /// version (each package manager has its own latest convention).
    pub version: String,
}

impl WrappedPackage {
    pub fn new(ecosystem: &str, name: impl Into<String>, version: impl Into<String>) -> Self {
        Self {
            ecosystem: ecosystem.to_string(),
            name: name.into(),
            version: version.into(),
        }
    }
}