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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
/// 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";

/// Hyperlane route serving JSON health and store status diagnostics.
pub const UPDATE_ROUTE_HEALTHZ: &str = "/healthz";

/// Default local filesystem store root directory used across CLI and `UpdateServerConfig`.
pub const DEFAULT_UPDATE_STORE_PATH: &str = ".euv-updates";

/// Default project OTA configuration filename written by `euv update init`.
pub const DEFAULT_OTA_CONFIG_FILE: &str = "euv-ota.json";

/// Default logical project identifier for OTA operations.
pub const DEFAULT_OTA_PROJECT_NAME: &str = "euv-showcase";

/// Default production release channel name.
pub const DEFAULT_OTA_PROD_CHANNEL: &str = "prod";

/// Default development release channel name.
pub const DEFAULT_OTA_DEV_CHANNEL: &str = "dev";

/// Default environment variable name holding the offline HMAC-SHA256 signing secret.
pub const DEFAULT_OTA_SIGNING_KEY_ENV: &str = "EUV_UPDATE_SIGNING_KEY";

/// Default number of most recent releases retained per channel during `euv update gc`.
pub const DEFAULT_OTA_GC_KEEP_RELEASES: usize = 5;

/// Default staleness threshold in seconds before an abandoned `writer.lock` is reclaimed.
pub const DEFAULT_WRITER_LOCK_STALE_SECS: u64 = 120;

/// Bit length of generated HMAC-SHA256 signing secrets.
pub const OTA_KEYGEN_BIT_LENGTH: usize = 256;

/// Current schema version for `euv-ota.json` project configuration files.
pub const OTA_CONFIG_SCHEMA_V1: u32 = 1;

/// 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";

/// HTTP header name for conditional `If-None-Match` cache validation.
#[cfg(feature = "update-server")]
pub(crate) const UPDATE_HDR_IF_NONE_MATCH_LOWER: &str = "if-none-match";

/// Health status string reported by `GET /healthz`.
pub(crate) const OTA_HEALTH_STATUS_OK: &str = "ok";

/// Severity label for fatal store integrity errors reported by `verify`.
pub(crate) const OTA_VERIFY_SEVERITY_ERROR: &str = "error";

/// Severity label for non-fatal store warnings reported by `verify`.
pub(crate) const OTA_VERIFY_SEVERITY_WARN: &str = "warning";

/// Artifact diff classification for newly introduced artifacts.
pub(crate) const OTA_DIFF_ADDED: &str = "added";

/// Artifact diff classification for removed artifacts.
pub(crate) const OTA_DIFF_REMOVED: &str = "removed";

/// Artifact diff classification for modified artifacts.
pub(crate) const OTA_DIFF_CHANGED: &str = "changed";

/// Artifact diff classification for unchanged artifacts.
pub(crate) const OTA_DIFF_UNCHANGED: &str = "unchanged";

/// Writer lock payload prefix recording the owning process identifier.
pub(crate) const OTA_LOCK_PID_PREFIX: &str = "pid=";

/// Writer lock payload prefix recording the creation UNIX timestamp.
pub(crate) const OTA_LOCK_CREATED_PREFIX: &str = "created_unix=";

/// Unix signal probe executable used to check if a lock owner PID is alive.
#[cfg(unix)]
pub(crate) const OTA_KILL_BIN: &str = "kill";

/// Unix signal zero flag testing process liveness without delivering a signal.
#[cfg(unix)]
pub(crate) const OTA_KILL_SIGNAL_ZERO: &str = "-0";

/// Lowercase diagnostic phrase emitted by `kill -0` when a process no longer exists.
#[cfg(unix)]
pub(crate) const OTA_ERR_NO_SUCH_PROCESS: &str = "no such process";

/// Linux procfs root directory used for fast lock owner liveness probing.
#[cfg(unix)]
pub(crate) const OTA_PROC_DIR: &str = "/proc";

/// Unix OS CSPRNG device path used for signing key generation.
#[cfg(unix)]
pub(crate) const OTA_DEV_URANDOM: &str = "/dev/urandom";

/// Rust target triple for compiled dynamic WASM widget modules.
pub(crate) const OTA_WASM_TARGET_TRIPLE: &str = "wasm32-unknown-unknown";

/// Default relative output directory for compiled dynamic WASM widgets.
pub(crate) const OTA_BUILD_OUT_SUBDIR: &str = "dist/ota";

/// Fallback output filename when compiling a dynamic WASM widget without an explicit package name.
pub(crate) const OTA_DEFAULT_WIDGET_FILENAME: &str = "widget.wasm";

/// Cargo manifest filename used to detect Rust dynamic widget crates.
pub(crate) const OTA_CARGO_MANIFEST_FILE: &str = "Cargo.toml";

/// Cargo target directory override environment variable.
pub(crate) const OTA_ENV_CARGO_TARGET_DIR: &str = "CARGO_TARGET_DIR";

/// Default Cargo target directory name.
pub(crate) const OTA_DIR_TARGET: &str = "target";

/// Release profile output directory name.
pub(crate) const OTA_DIR_RELEASE: &str = "release";

/// Debug profile output directory name.
pub(crate) const OTA_DIR_DEBUG: &str = "debug";

/// Cargo `--lib` flag passed when building dynamic WASM widget libraries.
pub(crate) const OTA_CARGO_ARG_LIB: &str = "--lib";

/// File extension for WebAssembly binaries.
pub(crate) const OTA_EXT_WASM: &str = "wasm";

/// Primary UDP routing probe destination used to discover the host's outbound LAN IPv4 address.
pub(crate) const OTA_LAN_PROBE_PRIMARY: &str = "8.8.8.8:80";

/// Secondary UDP routing probe destination used as a fallback for LAN IPv4 detection.
pub(crate) const OTA_LAN_PROBE_FALLBACK: &str = "1.1.1.1:80";

/// Wildcard ephemeral UDP bind address used for LAN interface probing.
pub(crate) const OTA_LAN_BIND_ANY: &str = "0.0.0.0:0";

/// Wildcard IPv4 bind host token.
#[cfg(feature = "update-server")]
pub(crate) const OTA_HOST_ALL_INTERFACES: &str = "0.0.0.0";

/// Loopback IPv4 host token.
#[cfg(feature = "update-server")]
pub(crate) const OTA_HOST_LOCALHOST: &str = "127.0.0.1";

/// Standard HTTP 200 status reason text.
pub(crate) const OTA_HTTP_STATUS_OK: &str = "OK";

/// Standard HTTP 204 status reason text.
pub(crate) const OTA_HTTP_STATUS_NO_CONTENT: &str = "No Content";

/// Standard HTTP 206 status reason text.
pub(crate) const OTA_HTTP_STATUS_PARTIAL: &str = "Partial Content";

/// Standard HTTP 304 status reason text.
pub(crate) const OTA_HTTP_STATUS_NOT_MODIFIED: &str = "Not Modified";

/// Standard HTTP 400 status reason text.
pub(crate) const OTA_HTTP_STATUS_BAD_REQUEST: &str = "Bad Request";

/// Standard HTTP 404 status reason text.
pub(crate) const OTA_HTTP_STATUS_NOT_FOUND: &str = "Not Found";

/// Standard HTTP 405 status reason text.
pub(crate) const OTA_HTTP_STATUS_METHOD_NOT_ALLOWED: &str = "Method Not Allowed";

/// Standard HTTP 409 status reason text.
pub(crate) const OTA_HTTP_STATUS_CONFLICT: &str = "Conflict";

/// Standard HTTP 416 status reason text.
pub(crate) const OTA_HTTP_STATUS_RANGE_INVALID: &str = "Range Not Satisfiable";

/// Title-case `Cache-Control` header name for embedded v1 OTA responses.
pub(crate) const OTA_HDR_CACHE_CONTROL_TITLE: &str = "Cache-Control";

/// Title-case `ETag` header name for embedded v1 OTA responses.
pub(crate) const OTA_HDR_ETAG_TITLE: &str = "ETag";

/// Title-case `Accept-Ranges` header name for embedded v1 OTA responses.
pub(crate) const OTA_HDR_ACCEPT_RANGES_TITLE: &str = "Accept-Ranges";

/// Title-case `Content-Range` header name for embedded v1 OTA responses.
pub(crate) const OTA_HDR_CONTENT_RANGE_TITLE: &str = "Content-Range";

/// Route prefix identifying embedded v1 blob requests.
pub(crate) const OTA_PATH_V1_BLOBS_PREFIX: &str = "/v1/blobs/";

/// Route prefix identifying embedded v1 project/channel requests.
pub(crate) const OTA_PATH_V1_PROJECTS_PREFIX: &str = "/v1/projects/";

/// Route path segment separating project and channel identifiers.
pub(crate) const OTA_PATH_SEG_CHANNELS: &str = "channels";

/// Route terminal segment identifying manifest endpoints.
pub(crate) const OTA_PATH_SEG_MANIFEST: &str = "manifest";

/// Route terminal segment identifying SSE event stream endpoints.
pub(crate) const OTA_PATH_SEG_EVENTS: &str = "events";

/// Uppercase HTTP GET method token.
pub(crate) const OTA_METHOD_GET: &str = "GET";

/// Uppercase HTTP HEAD method token.
pub(crate) const OTA_METHOD_HEAD: &str = "HEAD";

/// Uppercase HTTP OPTIONS method token.
pub(crate) const OTA_METHOD_OPTIONS: &str = "OPTIONS";

/// Error string when Cargo fails compiling a dynamic WASM widget crate.
pub(crate) const OTA_ERR_BUILD_FAILED: &str = "cargo wasm widget build failed";

/// Error string when no `.wasm` artifact is produced by `euv update build`.
pub(crate) const OTA_ERR_WASM_NOT_FOUND: &str = "compiled .wasm output artifact not found";

/// Error string when `euv update build --push` is invoked without a signing secret.
pub(crate) const OTA_ERR_PUSH_KEY_MISSING: &str = "signing key is required when --push is enabled";

/// Error string when a requested release sequence does not exist in the store.
pub(crate) const OTA_ERR_RELEASE_MISSING: &str =
    "release manifest not found for requested sequence";

/// Error string when a release manifest has an empty signature field.
pub(crate) const OTA_ERR_UNSIGNED_MANIFEST: &str = "release manifest signature is empty";

/// Error string when a stored blob's length does not match its manifest metadata.
pub(crate) const OTA_ERR_SIZE_MISMATCH: &str = "blob byte size mismatch";

/// Error string when a channel pointer's recorded manifest SHA-256 differs from the manifest file.
pub(crate) const OTA_ERR_MANIFEST_DIGEST_MISMATCH: &str =
    "channel pointer manifest_sha256 does not match manifest";

/// Error string when a manifest's `rollback_of` sequence does not exist on disk.
pub(crate) const OTA_ERR_ROLLBACK_TARGET_BROKEN: &str =
    "rollback_of points to missing historical release";

/// Warning message emitted by `verify` when run without a signing key.
pub(crate) const OTA_WARN_NO_KEY_VERIFY: &str =
    "signature verification skipped because no signing key was provided";

/// Cache-Control header value for dynamic embedded v1 OTA responses.
pub(crate) const OTA_HTTP_CACHE_NO_CACHE: &str = "no-cache";

/// Cache-Control header value for immutable content-addressed embedded blobs.
pub(crate) const OTA_HTTP_CACHE_IMMUTABLE: &str = "public, max-age=31536000, immutable";

/// JSON MIME type for embedded v1 OTA responses.
pub(crate) const OTA_HTTP_MIME_JSON: &str = "application/json; charset=utf-8";

/// Binary octet-stream MIME type for embedded v1 OTA blob responses.
pub(crate) const OTA_HTTP_MIME_OCTET: &str = "application/octet-stream";

/// Byte-range unit token for embedded v1 OTA responses.
pub(crate) const OTA_HTTP_RANGE_BYTES: &str = "bytes";

/// JSON error body for embedded HTTP 404 responses.
pub(crate) const OTA_HTTP_ERR_NOT_FOUND: &str = "{\"error\":\"not_found\"}";

/// JSON error body for embedded HTTP 400 responses.
pub(crate) const OTA_HTTP_ERR_BAD_REQUEST: &str = "{\"error\":\"bad_request\"}";

/// JSON error body for embedded HTTP 405 responses.
pub(crate) const OTA_HTTP_ERR_METHOD_NOT_ALLOWED: &str = "{\"error\":\"method_not_allowed\"}";

/// JSON error body for embedded HTTP 416 responses.
pub(crate) const OTA_HTTP_ERR_RANGE_INVALID: &str = "{\"error\":\"range_not_satisfiable\"}";

/// Query key for protocol version in embedded v1 OTA requests.
pub(crate) const OTA_HTTP_QUERY_PROTOCOL: &str = "protocol";

/// Query key for host ABI version in embedded v1 OTA requests.
pub(crate) const OTA_HTTP_QUERY_ABI: &str = "abi";

/// Query key for delivery mode in embedded v1 OTA requests.
pub(crate) const OTA_HTTP_QUERY_MODE: &str = "mode";

/// Query key for preferred compatibility track in embedded v1 OTA requests.
pub(crate) const OTA_HTTP_QUERY_TRACK: &str = "track";

/// Wire token identifying Declarative Data delivery mode in embedded v1 OTA requests.
pub(crate) const OTA_HTTP_MODE_DATA: &str = "declarative_data";

/// Weak ETag prefix stripped during `If-None-Match` comparison.
pub(crate) const OTA_ETAG_WEAK_PREFIX: &str = "W/";

/// Weak ETag lowercase prefix stripped during `If-None-Match` comparison.
pub(crate) const OTA_ETAG_WEAK_PREFIX_LOWER: &str = "w/";