euv-cli 0.48.10

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
/// Hyperlane route template serving protocol/ABI-negotiated signed release manifests.
pub const UPDATE_ROUTE_MANIFEST: &str = "/v1/projects/{project}/channels/{channel}/manifest";

/// Hyperlane route template serving immutable content-addressed SHA-256 blobs with Range support.
pub const UPDATE_ROUTE_BLOB: &str = "/v1/blobs/{sha256}";

/// Hyperlane route template streaming minimal `release.activated` SSE notifications with `Last-Event-ID` replay.
pub const UPDATE_ROUTE_EVENTS: &str = "/v1/projects/{project}/channels/{channel}/events";

/// Default bind host for `euv update serve`.
pub const DEFAULT_UPDATE_SERVER_HOST: &str = "127.0.0.1";

/// Default bind port for `euv update serve`.
pub const DEFAULT_UPDATE_SERVER_PORT: u16 = 8787;

/// Default SSE heartbeat interval in milliseconds for `euv update serve`.
pub const DEFAULT_UPDATE_HEARTBEAT_MS: u64 = 15_000;

/// Default background filesystem pointer watcher poll interval in milliseconds.
pub const DEFAULT_UPDATE_WATCH_POLL_MS: u64 = 100;

/// Default maximum retained events in each bounded channel event log (`state/events/`).
pub const DEFAULT_UPDATE_EVENT_LOG_CAP: usize = 256;

/// Subdirectory holding staged artifacts prior to atomic publish.
pub const STORE_DIR_STAGING: &str = "staging";

/// Subdirectory holding immutable SHA-256 content-addressed blobs (`blobs/sha256/`).
pub const STORE_DIR_BLOBS: &str = "blobs";

/// Hash algorithm subdirectory beneath `blobs/`.
pub const STORE_DIR_SHA256: &str = "sha256";

/// Subdirectory holding immutable signed release manifests (`releases/`).
pub const STORE_DIR_RELEASES: &str = "releases";

/// Subdirectory holding atomically swapped channel active pointers (`channels/`).
pub const STORE_DIR_CHANNELS: &str = "channels";

/// Subdirectory holding per-track active pointers under a channel directory.
pub const STORE_DIR_TRACKS: &str = "tracks";

/// Subdirectory holding writer lock and bounded event history (`state/`).
pub const STORE_DIR_STATE: &str = "state";

/// Subdirectory holding bounded per-channel JSONL event logs under `state/`.
pub const STORE_DIR_EVENTS: &str = "events";

/// Default target route path updated by `euv update push` when neither `--route` nor `--slot` is given.
pub const DEFAULT_UPDATE_ROUTE: &str = "/dynamic-panel";

/// Default target component slot identifier updated by `euv update push` when neither `--route` nor `--slot` is given.
pub const DEFAULT_UPDATE_SLOT: &str = "promo_banner";

/// Default RGB accent color used for inline `euv update push --title` hot-update cards.
pub const DEFAULT_UPDATE_ACCENT_RGB: u32 = 0x16A34A;

/// WebAssembly binary magic header (`\0asm`) used to auto-detect `.wasm` artifacts during `euv update push`.
pub(crate) const WASM_BINARY_MAGIC: &[u8; 4] = b"\0asm";

/// Placeholder asset module identifier used for slot-only route manifests.
pub(crate) const SLOT_CONTAINER_MODULE_ID: &str = "slot-container";

/// Placeholder asset bytes used for slot-only route manifests without overwriting the route page slot.
pub(crate) const SLOT_CONTAINER_MARKER_BYTES: &[u8] = b"{}";

/// Default artifact module identifier for directly pushed hot-update payloads.
pub(crate) const PUSH_ARTIFACT_MODULE_ID: &str = "hot-update";

/// Error string when neither `--file` nor `--title` is provided to `euv update push`.
pub(crate) const ERR_PUSH_SOURCE_REQUIRED: &str =
    "euv update push requires either --file <path> or --title <text>";

/// Error string when a pushed JSON file is not a valid `DynamicNodeSpec`.
pub(crate) const ERR_PUSH_INVALID_SPEC: &str =
    "pushed JSON artifact is not a valid DynamicNodeSpec";

/// Error string when a pushed `.wasm` artifact fails sandbox parsing or host ABI checks.
pub(crate) const ERR_PUSH_INVALID_WASM: &str =
    "pushed .wasm artifact failed sandbox or host ABI verification";

/// Default body copy when `euv update push --title` omits `--body`.
pub(crate) const DEFAULT_PUSH_INLINE_BODY: &str =
    "Live hot-update delivered via euv update push + Hyperlane SSE (zero restart).";

/// Local writer lock filename inside `state/`.
pub(crate) const STORE_WRITER_LOCK_FILE: &str = "writer.lock";

/// Active channel pointer filename inside `channels/<project>/<channel>/`.
pub(crate) const STORE_ACTIVE_POINTER_FILE: &str = "active.json";

/// Staged manifest filename inside `staging/<stage_id>/`.
pub(crate) const STORE_STAGED_MANIFEST_FILE: &str = "manifest.json";

/// Query parameter key carrying client protocol version.
#[cfg(feature = "update-server")]
pub(crate) const QUERY_KEY_PROTOCOL: &str = "protocol";

/// Query parameter key carrying client host ABI version.
#[cfg(feature = "update-server")]
pub(crate) const QUERY_KEY_ABI: &str = "abi";

/// Query parameter key carrying client delivery mode (`wasm_component` or `declarative_data`).
#[cfg(feature = "update-server")]
pub(crate) const QUERY_KEY_MODE: &str = "mode";

/// Query parameter key carrying preferred compatibility track.
#[cfg(feature = "update-server")]
pub(crate) const QUERY_KEY_TRACK: &str = "track";

/// Query parameter key carrying fallback `Last-Event-ID` cursor.
#[cfg(feature = "update-server")]
pub(crate) const QUERY_KEY_LAST_EVENT_ID: &str = "last_event_id";

/// Route parameter key for project name.
#[cfg(feature = "update-server")]
pub(crate) const ROUTE_PARAM_PROJECT: &str = "project";

/// Route parameter key for channel name.
#[cfg(feature = "update-server")]
pub(crate) const ROUTE_PARAM_CHANNEL: &str = "channel";

/// Route parameter key for SHA-256 blob digest.
#[cfg(feature = "update-server")]
pub(crate) const ROUTE_PARAM_SHA256: &str = "sha256";

/// Delivery mode wire token for Declarative Data delivery.
#[cfg(feature = "update-server")]
pub(crate) const MODE_TOKEN_DATA: &str = "declarative_data";

/// HTTP header name for `ETag`.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_ETAG: &str = "etag";

/// HTTP header name for `Accept-Ranges`.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_ACCEPT_RANGES: &str = "accept-ranges";

/// HTTP header value indicating byte range support.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_BYTES: &str = "bytes";

/// HTTP header name for `Content-Range`.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_CONTENT_RANGE: &str = "content-range";

/// HTTP header name for incoming `Range` requests.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_RANGE_LOWER: &str = "range";

/// HTTP header name for `Last-Event-ID`.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_LAST_EVENT_ID_LOWER: &str = "last-event-id";

/// Immutable cache control directive for content-addressed SHA-256 blobs.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_CACHE_IMMUTABLE: &str = "public, max-age=31536000, immutable";

/// No-cache directive for dynamic channel manifests.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_CACHE_NO_CACHE: &str = "no-cache";

/// Proxy-safe no-cache directive disabling response buffering and transforms on SSE streams.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_SSE_CACHE_CONTROL: &str = "no-cache, no-transform";

/// HTTP header name disabling reverse-proxy buffering on Nginx/Caddy/Cloudflare SSE streams.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_ACCEL_BUFFERING: &str = "x-accel-buffering";

/// Header value disabling Nginx/proxy SSE response buffering.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_VAL_NO_BUFFER: &str = "no";

/// HTTP CORS allow-origin header name.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_CORS_ORIGIN: &str = "access-control-allow-origin";

/// HTTP CORS allow-methods header name.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_CORS_METHODS: &str = "access-control-allow-methods";

/// HTTP CORS allow-headers header name.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_CORS_HEADERS: &str = "access-control-allow-headers";

/// HTTP CORS expose-headers header name.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_CORS_EXPOSE: &str = "access-control-expose-headers";

/// HTTP CORS wildcard origin value.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_VAL_CORS_ANY: &str = "*";

/// HTTP CORS allowed methods list.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_VAL_CORS_METHODS: &str = "GET, HEAD, OPTIONS";

/// HTTP CORS allowed request headers list.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_VAL_CORS_HEADERS: &str = "Range, Last-Event-ID, Authorization, Proxy-Authorization, X-Forwarded-Prefix, X-Forwarded-Host, X-Forwarded-Proto";

/// HTTP CORS exposed response headers list.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_VAL_CORS_EXPOSE: &str =
    "ETag, Content-Range, Accept-Ranges, X-Euv-Proxy-Base";

/// Incoming reverse-proxy prefix header name.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_X_FWD_PREFIX: &str = "x-forwarded-prefix";

/// Incoming reverse-proxy host header name.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_X_FWD_HOST: &str = "x-forwarded-host";

/// Incoming reverse-proxy protocol header name.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_X_FWD_PROTO: &str = "x-forwarded-proto";

/// Response header advertising the resolved proxy-aware base URL for manifest/blob consumers.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_X_PROXY_BASE: &str = "x-euv-proxy-base";

/// MIME type for JSON responses.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_MIME_JSON: &str = "application/json; charset=utf-8";

/// MIME type for immutable binary blobs.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_MIME_OCTET: &str = "application/octet-stream";

/// Prefix expected on HTTP `Range` byte headers.
pub(crate) const RANGE_BYTES_PREFIX: &str = "bytes=";

/// File extension for JSON manifest and pointer files.
pub(crate) const EXT_JSON_DOT: &str = ".json";

/// File extension for JSONL event history files.
pub(crate) const EXT_JSONL_DOT: &str = ".jsonl";

/// Allowed ASCII hyphen byte in store identifiers.
pub(crate) const ASCII_HYPHEN: u8 = b'-';

/// Allowed ASCII underscore byte in store identifiers.
pub(crate) const ASCII_UNDERSCORE: u8 = b'_';

/// Allowed ASCII period byte in store identifiers.
pub(crate) const ASCII_DOT: u8 = b'.';

/// Error string when an identifier contains unsafe path characters.
pub(crate) const ERR_INVALID_STORE_IDENT: &str =
    "store identifier must contain only ASCII alphanumerics, '-', '_', or '.' without traversal";

/// Error string when a writer lock cannot be acquired within the bounded wait budget.
pub(crate) const ERR_WRITER_LOCK_TIMEOUT: &str = "timed out acquiring update store writer lock";

/// Error string when a signing key is empty during publish or rollback.
pub(crate) const ERR_EMPTY_SIGNING_KEY: &str =
    "signing key cannot be empty for publish or rollback";

/// Error string when a staged release directory does not exist.
pub(crate) const ERR_STAGE_NOT_FOUND: &str = "staged release directory not found";

/// Error string when a target rollback release does not exist.
pub(crate) const ERR_ROLLBACK_TARGET_MISSING: &str = "rollback target release manifest not found";

/// Error string when a blob referenced by a manifest is missing or corrupted.
pub(crate) const ERR_BLOB_INTEGRITY: &str = "blob missing or SHA-256 digest mismatch";

/// Error string when no compatible release exists for the client's protocol, ABI, or delivery mode.
pub(crate) const ERR_NO_COMPATIBLE_RELEASE: &str =
    "no compatible release available for client protocol, ABI, or delivery mode";

/// Error string when `euv update serve` is invoked without the `update-server` Cargo feature.
#[cfg(not(feature = "update-server"))]
pub(crate) const ERR_UPDATE_SERVER_FEATURE_DISABLED: &str =
    "euv-cli was built without the `update-server` Cargo feature";

/// Error response payload returned for HTTP 404.
#[cfg(feature = "update-server")]
pub(crate) const ERR_BODY_NOT_FOUND: &str = "{\"error\":\"not_found\"}";

/// Error response payload returned for HTTP 405.
#[cfg(feature = "update-server")]
pub(crate) const ERR_BODY_METHOD_NOT_ALLOWED: &str = "{\"error\":\"method_not_allowed\"}";

/// Error response payload returned for HTTP 400.
#[cfg(feature = "update-server")]
pub(crate) const ERR_BODY_BAD_REQUEST: &str = "{\"error\":\"bad_request\"}";

/// Error response payload returned for HTTP 416.
#[cfg(feature = "update-server")]
pub(crate) const ERR_BODY_RANGE_INVALID: &str = "{\"error\":\"range_not_satisfiable\"}";

/// Error response payload returned when update server state is not registered.
#[cfg(feature = "update-server")]
pub(crate) const ERR_BODY_UNCONFIGURED: &str = "{\"error\":\"update_server_unconfigured\"}";

/// SSE initial connection comment line payload.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_SSE_CONNECTED_COMMENT: &str = "connected";

/// SSE periodic keep-alive heartbeat comment payload.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_SSE_HEARTBEAT_COMMENT: &str = "keep-alive";