euv-cli 0.50.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
/// Server-Sent Events endpoint streaming live reload and hot-update notifications.
pub const HMR_ENDPOINT: &str = "/__euv_hmr";
/// JSON manifest endpoint advertising the latest Dynamic WASM OTA hot-update build.
pub const OTA_MANIFEST_ENDPOINT: &str = "/__euv_ota/manifest.json";
/// Binary endpoint serving the latest signed Dynamic WASM `.wasm` module over HTTP.
pub const OTA_MODULE_ENDPOINT: &str = "/__euv_ota/module.wasm";
/// JSON health and revision status endpoint for local tooling and CI probes.
pub const DEV_STATUS_ENDPOINT: &str = "/__euv_status";
/// Shared signing key used for local dev OTA hot-update verification.
pub const OTA_DEV_SIGNING_KEY: &str = "euv-dev-ota-key-2026";
/// Default component slot targeted by local dev OTA hot updates.
pub const OTA_SLOT_DEV: &str = "euv-dev-hot-slot";
/// Default local bind host for `euv dev` and `euv docs dev`.
pub const DEFAULT_DEV_HOST: &str = "127.0.0.1";
/// Default static documentation output directory.
pub const DEFAULT_DOCS_OUT_DIR: &str = "dist/docs";
/// Default file watcher debounce window in milliseconds.
pub const DEFAULT_DEV_DEBOUNCE_MS: u64 = 120;
/// Default v1 OTA project identifier mounted inside `euv dev`.
pub const DEFAULT_DEV_OTA_PROJECT: &str = "euv-showcase";
/// Default v1 OTA release channel mounted inside `euv dev`.
pub const DEFAULT_DEV_OTA_CHANNEL: &str = "dev";
/// Environment variable injected into child processes carrying the active dev OTA signing key.
pub const ENV_DEV_UPDATE_SIGNING_KEY: &str = "EUV_UPDATE_SIGNING_KEY";
/// Default relative store directory used when `DevServerConfig::ota_store_dir` is unset.
pub const DEV_OTA_STORE_SUBDIR: &str = ".euv-updates";
/// Default relative on-device cache subdirectory injected via `EUV_UPDATE_CACHE_DIR`.
pub const DEV_OTA_CLIENT_CACHE_SUBDIR: &str = "client-cache";
/// HTML element ID of the dismissible browser HMR build-error overlay.
pub const HMR_ERROR_OVERLAY_ID: &str = "euv-hmr-error-overlay";

pub(crate) const WATCH_IGNORED_DIRS: [&str; 13] = [
    "target",
    ".git",
    ".euv-updates",
    "node_modules",
    "dist",
    "www",
    ".cargo",
    ".idea",
    ".vscode",
    ".next",
    "pkg",
    "out",
    "build",
];
pub(crate) const WATCH_EXTS_DOCS: [&str; 8] =
    ["md", "yaml", "yml", "png", "jpg", "jpeg", "svg", "webp"];
pub(crate) const WATCH_EXTS_CODE: [&str; 8] =
    ["rs", "toml", "md", "html", "css", "wgsl", "glsl", "wasm"];
pub(crate) const MODE_LABEL_DOCS: &str = "docs";
pub(crate) const MODE_LABEL_WEB: &str = "web";
pub(crate) const MODE_LABEL_NATIVE: &str = "native";
pub(crate) const MODE_LABEL_TUI: &str = "tui";
pub(crate) const MODE_LABEL_CLI: &str = "cli";
pub(crate) const MODE_LABEL_HARMONY: &str = "harmony";
pub(crate) const MODE_LABEL_WEARABLE: &str = "wearable";
pub(crate) const MODE_LABEL_MINIAPP: &str = "miniapp";
pub(crate) const MODE_LABEL_QUICKAPP: &str = "quickapp";
pub(crate) const HMR_EVENT_RELOAD: &str = "reload";
pub(crate) const HMR_EVENT_OTA: &str = "ota";
pub(crate) const HMR_EVENT_ERROR: &str = "error";
pub(crate) const HTTP_METHOD_HEAD: &str = "HEAD";
pub(crate) const HTTP_METHOD_OPTIONS: &str = "OPTIONS";
pub(crate) const HTTP_200_PREFIX: &str = "HTTP/1.1 200 OK\r\nContent-Type: ";
pub(crate) const HTTP_204_OPTIONS_RESP: &str = "HTTP/1.1 204 No Content\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Methods: GET, HEAD, OPTIONS\r\nAccess-Control-Allow-Headers: *\r\nConnection: close\r\n\r\n";
pub(crate) const HTTP_404_RESP: &str = "HTTP/1.1 404 Not Found\r\nContent-Type: text/plain; charset=utf-8\r\nContent-Length: 9\r\nConnection: close\r\n\r\nNot Found";
pub(crate) const HTTP_SSE_HEADERS: &str = "HTTP/1.1 200 OK\r\nContent-Type: text/event-stream\r\nCache-Control: no-cache\r\nConnection: keep-alive\r\nAccess-Control-Allow-Origin: *\r\n\r\nretry: 1000\n\n: connected\n\n";
pub(crate) const HTTP_V1_SSE_HEADERS: &str = "HTTP/1.1 200 OK\r\nContent-Type: text/event-stream\r\nCache-Control: no-cache, no-transform\r\nX-Accel-Buffering: no\r\nConnection: keep-alive\r\nAccess-Control-Allow-Origin: *\r\n\r\nretry: 1000\n\n: connected\n\n";
pub(crate) const HTTP_CORS_HEADERS: &str =
    "\r\nCache-Control: no-cache\r\nAccess-Control-Allow-Origin: *\r\nContent-Length: ";
pub(crate) const HTTP_COOP_COEP_HEADERS: &str =
    "\r\nCross-Origin-Opener-Policy: same-origin\r\nCross-Origin-Embedder-Policy: require-corp";
pub(crate) const HTTP_EMBEDDED_CORS_BLOCK: &str = "Access-Control-Allow-Origin: *\r\nAccess-Control-Allow-Methods: GET, HEAD, OPTIONS\r\nAccess-Control-Allow-Headers: Range, Last-Event-ID, If-None-Match, Authorization\r\nAccess-Control-Expose-Headers: ETag, Content-Range, Accept-Ranges\r\n";
pub(crate) const HTTP_CONN_CLOSE_SEP: &str = "\r\nConnection: close\r\n\r\n";
pub(crate) const HTTP_HDR_IF_NONE_MATCH: &str = "if-none-match";
pub(crate) const HTTP_HDR_RANGE: &str = "range";
pub(crate) const HTTP_HDR_LAST_EVENT_ID: &str = "last-event-id";
pub(crate) const QUERY_KEY_DEV_LAST_EVENT_ID: &str = "last_event_id";
pub(crate) const MIME_HTML: &str = "text/html; charset=utf-8";
pub(crate) const MIME_JSON: &str = "application/json; charset=utf-8";
pub(crate) const MIME_XML: &str = "application/xml; charset=utf-8";
pub(crate) const MIME_CSS: &str = "text/css; charset=utf-8";
pub(crate) const MIME_JS: &str = "text/javascript; charset=utf-8";
pub(crate) const MIME_WASM: &str = "application/wasm";
pub(crate) const MIME_SVG: &str = "image/svg+xml";
pub(crate) const MIME_PNG: &str = "image/png";
pub(crate) const MIME_JPEG: &str = "image/jpeg";
pub(crate) const MIME_WEBP: &str = "image/webp";
pub(crate) const MIME_GIF: &str = "image/gif";
pub(crate) const MIME_AVIF: &str = "image/avif";
pub(crate) const MIME_ICO: &str = "image/x-icon";
pub(crate) const MIME_WOFF2: &str = "font/woff2";
pub(crate) const MIME_WOFF: &str = "font/woff";
pub(crate) const MIME_TTF: &str = "font/ttf";
pub(crate) const MIME_TEXT: &str = "text/plain; charset=utf-8";
pub(crate) const MIME_OCTET: &str = "application/octet-stream";
pub(crate) const EXT_HTML: &str = "html";
pub(crate) const EXT_JSON: &str = "json";
pub(crate) const EXT_XML: &str = "xml";
pub(crate) const EXT_CSS: &str = "css";
pub(crate) const EXT_JS: &str = "js";
pub(crate) const EXT_MJS: &str = "mjs";
pub(crate) const EXT_WASM: &str = "wasm";
pub(crate) const EXT_EUVZ: &str = "euvz";
pub(crate) const EXT_BR: &str = "br";
pub(crate) const EXT_SVG: &str = "svg";
pub(crate) const EXT_PNG: &str = "png";
pub(crate) const EXT_JPG: &str = "jpg";
pub(crate) const EXT_JPEG: &str = "jpeg";
pub(crate) const EXT_WEBP: &str = "webp";
pub(crate) const EXT_GIF: &str = "gif";
pub(crate) const EXT_AVIF: &str = "avif";
pub(crate) const EXT_ICO: &str = "ico";
pub(crate) const EXT_WOFF2: &str = "woff2";
pub(crate) const EXT_WOFF: &str = "woff";
pub(crate) const EXT_TTF: &str = "ttf";
pub(crate) const EXT_TXT: &str = "txt";
pub(crate) const EXT_MAP: &str = "map";
pub(crate) const ENV_DEV_URL: &str = "EUV_DEV_URL";
pub(crate) const ENV_HMR_URL: &str = "EUV_HMR_URL";
pub(crate) const ENV_OTA_MANIFEST_URL: &str = "EUV_OTA_MANIFEST_URL";
pub(crate) const ENV_OTA_MODULE_URL: &str = "EUV_OTA_MODULE_URL";
pub(crate) const HTML_BODY_CLOSE_TAG: &str = "</body>";
pub(crate) const DEV_HMR_SCRIPT_PREFIX: &str = "<script>(function(){try{var id='euv-hmr-error-overlay';function clearOverlay(){var el=document.getElementById(id);if(el)el.remove();}function showOverlay(payload){clearOverlay();var wrap=document.createElement('div');wrap.id=id;wrap.setAttribute('role','alertdialog');wrap.style.cssText='position:fixed;inset:0;z-index:2147483647;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(9,9,11,0.72);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;color:#f4f4f5;';var card=document.createElement('div');card.style.cssText='width:min(760px,92vw);max-height:82vh;overflow:auto;border-radius:16px;padding:20px 22px;background:rgba(24,24,27,0.92);border:1px solid rgba(248,113,113,0.45);box-shadow:0 24px 64px rgba(0,0,0,0.55);';var head=document.createElement('div');head.style.cssText='display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;';var title=document.createElement('strong');title.textContent='euv dev build error'+(payload&&payload.revision?' (rev '+payload.revision+')':'');title.style.cssText='font-size:14px;color:#fca5a5;';var close=document.createElement('button');close.type='button';close.textContent='Dismiss (Esc)';close.style.cssText='appearance:none;border:1px solid rgba(255,255,255,0.18);background:rgba(255,255,255,0.08);color:#fafafa;border-radius:8px;padding:5px 10px;font-size:12px;cursor:pointer;';close.onclick=clearOverlay;head.appendChild(title);head.appendChild(close);var pre=document.createElement('pre');pre.style.cssText='margin:0;white-space:pre-wrap;word-break:break-word;font-size:12px;line-height:1.55;color:#fecaca;background:rgba(0,0,0,0.35);padding:14px;border-radius:10px;border:1px solid rgba(255,255,255,0.08);';pre.textContent=(payload&&payload.message)?String(payload.message):'Build failed';card.appendChild(head);card.appendChild(pre);wrap.appendChild(card);document.body.appendChild(wrap);}window.addEventListener('keydown',function(ev){if(ev.key==='Escape')clearOverlay();});var es=new EventSource('";
pub(crate) const DEV_HMR_SCRIPT_SUFFIX: &str = "');es.addEventListener('reload',function(){clearOverlay();location.reload();});es.addEventListener('ota',function(){clearOverlay();location.reload();});es.addEventListener('error',function(ev){if(!ev||!ev.data)return;try{showOverlay(JSON.parse(ev.data));}catch(_e){showOverlay({message:String(ev.data)});}});}catch(_e){}})();</script>";
pub(crate) const MSG_INITIAL_BUILD_READY: &str = "Initial build ready";
pub(crate) const MSG_DOCS_REBUILT: &str = "Docs hot-rebuilt";
pub(crate) const MSG_WEB_REBUILT: &str = "Web WASM hot-rebuilt";
pub(crate) const MSG_NATIVE_RESTARTED: &str = "Native binary rebuilt and hot-restarted";
pub(crate) const MSG_HOT_OTA_PUSHED: &str = "Live v1 OTA update pushed without host restart";
pub(crate) const MSG_ECOSYSTEM_REBUILT: &str = "Ecosystem target bundle rebuilt";
pub(crate) const MSG_NATIVE_BUILD_FAILED_KEPT: &str =
    "Native build failed; previous app kept running";
pub(crate) const DEV_OTA_INITIAL_BODY: &str =
    "Live v1 OTA hot-update channel active inside euv dev.";
pub(crate) const OTA_INITIAL_TITLE: &str = "Euv Dev OTA Initial Module";
pub(crate) const PKG_EUV_PREFIX: &str = "euv-";
pub(crate) const SSE_PING_LINE: &str = ": ping\n\n";
pub(crate) const EMPTY_JSON_OBJECT: &str = "{}";
pub(crate) const ASCII_PERCENT: u8 = b'%';
pub(crate) const ASCII_DIGIT_ZERO: u8 = b'0';
pub(crate) const ASCII_DIGIT_NINE: u8 = b'9';
pub(crate) const ASCII_LOWER_A: u8 = b'a';
pub(crate) const ASCII_LOWER_F: u8 = b'f';
pub(crate) const ASCII_UPPER_A: u8 = b'A';
pub(crate) const ASCII_UPPER_F: u8 = b'F';