euv-cli 0.51.0

Cross-platform CLI tool for the euv native UI framework supporting run, build, check, fmt, doctor, new, and Hyperlane SSE dynamic updates across all supported platforms.
Documentation
/// Canonical filename for the deterministic SHA-256 release inventory manifest.
pub const RELEASE_MANIFEST_NAME: &str = "euv-release.json";

/// Current schema format version of `euv-release.json`.
pub const RELEASE_MANIFEST_FORMAT: u32 = 1;

/// Default UNIX file permission mode stored in archives for regular files.
pub const ARCHIVE_DEFAULT_FILE_MODE: u32 = 0o644;

/// Default UNIX file permission mode stored in archives for executable binaries.
pub const ARCHIVE_EXECUTABLE_FILE_MODE: u32 = 0o755;

/// Default UNIX directory permission mode stored in archives.
pub const ARCHIVE_DEFAULT_DIR_MODE: u32 = 0o755;

/// Reserved filenames skipped when generating or validating `euv-release.json`.
pub(crate) const RELEASE_MANIFEST_RESERVED_NAMES: [&str; 6] = [
    RELEASE_MANIFEST_NAME,
    "__euv_local_bundle__.json",
    "_manifest.json",
    ".empty",
    ".nojekyll",
    "active",
];

/// Required root HTML entry filename checked when generating `euv-release.json`.
pub(crate) const RELEASE_MANIFEST_INDEX_HTML: &str = "index.html";

/// Disallowed punctuation bytes inside relative paths listed in `euv-release.json`.
pub(crate) const RELEASE_FORBIDDEN_PATH_BYTES: &[u8] = b"\\:%?#";

/// Dev-only AI Schema v1 marker bytes scanned in release artifacts.
pub(crate) const AI_SCHEMA_V1_MARKER: &[u8] = b"euv.ai.schema.v1";

/// Dev-only AI Schema v2 marker bytes scanned in release artifacts.
pub(crate) const AI_SCHEMA_V2_MARKER: &[u8] = b"euv.ai.schema.v2";

/// Archive extension identifying PKZIP output files.
pub(crate) const ARCHIVE_EXT_ZIP: &str = ".zip";

/// Archive extension identifying gzipped POSIX tar output files.
pub(crate) const ARCHIVE_EXT_TAR_GZ: &str = ".tar.gz";

/// Short archive extension identifying gzipped POSIX tar output files.
pub(crate) const ARCHIVE_EXT_TGZ: &str = ".tgz";

/// IEEE 802.3 reversed CRC-32 polynomial used by PNG, ZIP, and GZIP.
pub(crate) const CRC32_POLY: u32 = 0xEDB8_8320;

/// RFC 1950 Adler-32 prime modulus.
pub(crate) const ADLER32_MOD: u32 = 65_521;

/// Maximum uncompressed length of a single RFC 1951 stored DEFLATE block.
pub(crate) const DEFLATE_MAX_STORED_BLOCK: usize = 65_535;

/// Sliding window size in bytes for RFC 1951 LZ77 matching.
pub(crate) const DEFLATE_WINDOW_SIZE: usize = 32_768;

/// Minimum LZ77 match length defined by RFC 1951.
pub(crate) const DEFLATE_MIN_MATCH: usize = 3;

/// Maximum LZ77 match length defined by RFC 1951.
pub(crate) const DEFLATE_MAX_MATCH: usize = 258;

/// Hash table bucket count for LZ77 3-byte prefix indexing.
pub(crate) const DEFLATE_HASH_BUCKETS: usize = 4_096;

/// Sentinel value marking an empty LZ77 hash bucket.
pub(crate) const DEFLATE_HASH_EMPTY: usize = usize::MAX;

/// Maximum Huffman code bit length allowed by RFC 1951.
pub(crate) const DEFLATE_MAX_BITS: usize = 15;

/// End-of-block symbol value in the RFC 1951 literal/length alphabet.
pub(crate) const DEFLATE_EOB_SYMBOL: usize = 256;

/// Base lengths for RFC 1951 length symbols 257..=285.
pub(crate) const DEFLATE_LEN_BASE: [u16; 29] = [
    3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131,
    163, 195, 227, 258,
];

/// Extra bit counts for RFC 1951 length symbols 257..=285.
pub(crate) const DEFLATE_LEN_EXTRA: [u8; 29] = [
    0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0,
];

/// Base distances for RFC 1951 distance symbols 0..=29.
pub(crate) const DEFLATE_DIST_BASE: [u16; 30] = [
    1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537,
    2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577,
];

/// Extra bit counts for RFC 1951 distance symbols 0..=29.
pub(crate) const DEFLATE_DIST_EXTRA: [u8; 30] = [
    0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13,
    13,
];

/// Permutation order for RFC 1951 dynamic Huffman code-length alphabet symbols.
pub(crate) const DEFLATE_CLEN_ORDER: [usize; 19] = [
    16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15,
];

/// Standard zlib CMF header byte (DEFLATE with 32 KiB sliding window).
pub(crate) const ZLIB_HEADER_CMF: u8 = 0x78;

/// Standard zlib FLG header byte (default compression, valid modulo-31 check).
pub(crate) const ZLIB_HEADER_FLG: u8 = 0x9C;

/// RFC 1952 GZIP 10-byte canonical header (DEFLATE, no flags, zero mtime, unknown OS).
pub(crate) const GZIP_HEADER_BYTES: [u8; 10] =
    [0x1F, 0x8B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF];

/// PKZIP Local File Header signature (`PK\x03\x04`).
pub(crate) const ZIP_LOCAL_HEADER_SIG: u32 = 0x0403_4B50;

/// PKZIP Central Directory File Header signature (`PK\x01\x02`).
pub(crate) const ZIP_CENTRAL_HEADER_SIG: u32 = 0x0201_4B50;

/// PKZIP End of Central Directory signature (`PK\x05\x06`).
pub(crate) const ZIP_EOCD_SIG: u32 = 0x0605_4B50;

/// PKZIP version made by (UNIX host + PKZIP 2.0 compatibility).
pub(crate) const ZIP_VERSION_MADE_BY: u16 = 0x0314;

/// PKZIP version needed to extract (PKZIP 2.0).
pub(crate) const ZIP_VERSION_NEEDED: u16 = 20;

/// PKZIP general-purpose bit flag enabling UTF-8 filenames (bit 11).
pub(crate) const ZIP_FLAG_UTF8: u16 = 0x0800;

/// PKZIP compression method 0 (stored / uncompressed).
pub(crate) const ZIP_METHOD_STORED: u16 = 0;

/// PKZIP compression method 8 (DEFLATE).
pub(crate) const ZIP_METHOD_DEFLATE: u16 = 8;

/// UNIX regular file type bits shifted into PKZIP external attributes.
pub(crate) const ZIP_UNIX_REGULAR_FILE: u32 = 0o100_000;

/// POSIX ustar tar block size in bytes.
pub(crate) const TAR_BLOCK_SIZE: usize = 512;

/// POSIX ustar magic signature bytes (`ustar\0`).
pub(crate) const TAR_USTAR_MAGIC: &[u8; 6] = b"ustar\0";

/// POSIX ustar version bytes (`00`).
pub(crate) const TAR_USTAR_VERSION: &[u8; 2] = b"00";

/// Error message when a release version is not numeric `MAJOR.MINOR.PATCH`.
pub(crate) const ERR_INVALID_SEMVER: &str = "Release version must be a numeric semantic version";

/// Error message when a distribution path is missing or is a symlink.
pub(crate) const ERR_INVALID_DIST_DIR: &str = "Distribution must be a regular directory";

/// Error message when a symlink is encountered inside a release directory.
pub(crate) const ERR_SYMLINK_FORBIDDEN: &str = "Symlink is forbidden inside release directory";

/// Error message when an unsafe path is found inside a release directory.
pub(crate) const ERR_UNSAFE_RELEASE_PATH: &str = "Unsafe release path detected";

/// Error message when a non-regular entry is found inside a release directory.
pub(crate) const ERR_NOT_REGULAR_FILE: &str = "Entry is not a regular file";

/// Error message when `index.html` is missing or empty during manifest generation.
pub(crate) const ERR_MISSING_INDEX_HTML: &str = "Missing nonempty index.html";

/// Error message when a release manifest has an unsupported format number.
pub(crate) const ERR_MANIFEST_FORMAT: &str = "Unexpected euv-release.json format version";

/// Error message when a release manifest version does not match the expected version.
pub(crate) const ERR_MANIFEST_VERSION: &str = "Release manifest version mismatch";

/// Error message when a required release asset is missing or empty.
pub(crate) const ERR_MANIFEST_REQUIRED_MISSING: &str = "Missing or empty required release asset";

/// Error message when a file digest does not match `euv-release.json`.
pub(crate) const ERR_MANIFEST_SHA_MISMATCH: &str = "Release asset SHA-256 mismatch";

/// Error message when a file byte size does not match `euv-release.json`.
pub(crate) const ERR_MANIFEST_SIZE_MISMATCH: &str = "Release asset byte size mismatch";

/// Error message when dev-only AI schema markers leak into a release binary.
pub(crate) const ERR_AI_SCHEMA_LEAK: &str =
    "Dev-only AI schema marker leaked into release artifact";

/// Error message when an inflate stream is truncated or malformed.
pub(crate) const ERR_DEFLATE_INVALID: &str = "Invalid or truncated DEFLATE stream";

/// Error message when a zlib stream fails header or Adler-32 verification.
pub(crate) const ERR_ZLIB_INVALID: &str = "Invalid zlib stream or Adler-32 checksum mismatch";

/// Error message when a gzip stream fails header, CRC-32, or ISIZE verification.
pub(crate) const ERR_GZIP_INVALID: &str = "Invalid gzip stream or CRC-32/ISIZE mismatch";

/// Error message when an existing ZIP archive cannot be parsed.
pub(crate) const ERR_ZIP_INVALID: &str = "Invalid or unsupported ZIP archive structure";

/// Error message when a tar entry path exceeds POSIX ustar name/prefix limits.
pub(crate) const ERR_TAR_PATH_TOO_LONG: &str = "Archive entry path exceeds POSIX ustar limit";

/// Error message when an archive extension is unsupported.
pub(crate) const ERR_UNSUPPORTED_ARCHIVE_EXT: &str =
    "Unsupported archive extension (expected .zip, .tar.gz, or .tgz)";