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
/// Default capacity of the bounded non-blocking `CandidateMailbox`.
pub const DEFAULT_CANDIDATE_MAILBOX_CAP: usize = 4;
/// Default maximum size in bytes allowed for a single downloaded artifact (`16 MiB`).
pub const DEFAULT_MAX_ARTIFACT_BYTES: u64 = 16 * 1024 * 1024;
/// Default HTTP connect and read timeout in milliseconds for update requests.
pub const DEFAULT_UPDATE_HTTP_TIMEOUT_MS: u64 = 5_000;
/// Default SSE reconnect backoff interval in milliseconds.
pub const DEFAULT_SSE_RECONNECT_MS: u64 = 100;
/// Dedicated OS thread name assigned to the background `UpdateWorker`.
pub const UPDATE_WORKER_THREAD_NAME: &str = "euv-update-worker";
/// Environment variable overriding the dynamic hot-update server base URL.
pub const ENV_EUV_UPDATE_URL: &str = "EUV_UPDATE_URL";
/// Environment variable configuring an explicit HTTP forward proxy for hot updates.
pub const ENV_EUV_PROXY_URL: &str = "EUV_PROXY_URL";
/// Standard uppercase HTTPS proxy environment variable consulted by `resolve_proxy_env`.
pub const ENV_HTTPS_PROXY: &str = "HTTPS_PROXY";
/// Standard uppercase HTTP proxy environment variable consulted by `resolve_proxy_env`.
pub const ENV_HTTP_PROXY: &str = "HTTP_PROXY";
/// Standard lowercase HTTPS proxy environment variable fallback.
pub const ENV_HTTPS_PROXY_LOWER: &str = "https_proxy";
/// Standard lowercase HTTP proxy environment variable fallback.
pub const ENV_HTTP_PROXY_LOWER: &str = "http_proxy";
/// Default hot-update server URL used when `EUV_UPDATE_URL` is unset.
pub const DEFAULT_HOT_UPDATE_SERVER_URL: &str = "http://127.0.0.1:8787";
/// Default hot-update channel name used by `HotUpdateProxyConfig`.
pub const DEFAULT_HOT_UPDATE_CHANNEL: &str = "prod";
/// Default periodic manifest poll fallback cadence in seconds when SSE disconnects.
pub const DEFAULT_POLL_FALLBACK_SECS: u64 = 30;
/// HTTP header name carrying forward-proxy credentials.
pub const HDR_PROXY_AUTHORIZATION: &str = "Proxy-Authorization";
/// HTTP header name keeping forward-proxied SSE streams alive.
pub const HDR_PROXY_CONNECTION: &str = "Proxy-Connection";
/// Standard Base64 encoding alphabet used for HTTP Basic `Proxy-Authorization`.
pub const BASE64_STD_TABLE: & =
b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/// HTTP scheme prefix accepted by `HttpReleaseTransport`.
pub const UPDATE_HTTP_SCHEME: &str = "http://";
/// HTTP header separator marking the end of response headers.
pub const HTTP_HEADER_END_MARKER: & = b"\r\n\r\n";
/// HTTP header name for SSE stream resume cursor.
pub const HDR_LAST_EVENT_ID: &str = "Last-Event-ID";
/// HTTP header name for byte-range resume requests.
pub const HDR_RANGE: &str = "Range";
/// HTTP transfer-encoding chunked token.
pub const HDR_TRANSFER_ENCODING_CHUNKED: &str = "chunked";
/// HTTP header key prefix for transfer encoding.
pub const HDR_TRANSFER_ENCODING_KEY: &str = "transfer-encoding";
/// HTTP header key prefix for content length.
pub const HDR_CONTENT_LENGTH_KEY: &str = "content-length";
/// SSE wire prefix for event identifier lines.
pub const SSE_WIRE_ID_PREFIX: &str = "id:";
/// SSE wire prefix for event type lines.
pub const SSE_WIRE_EVENT_PREFIX: &str = "event:";
/// SSE wire prefix for data payload lines.
pub const SSE_WIRE_DATA_PREFIX: &str = "data:";
/// Delivery mode query token for Wasm Component channel.
pub const QUERY_MODE_WASM: &str = "wasm_component";
/// Delivery mode query token for Declarative Data channel.
pub const QUERY_MODE_DATA: &str = "declarative_data";
/// Error message when a worker URL does not start with `http://`.
pub const ERR_INVALID_HTTP_BASE_URL: &str =
"update server base_url must use http://host:port";
/// Error message when a server returns a malformed HTTP response head.
pub const ERR_MALFORMED_HTTP_RESP: &str = "malformed HTTP response from update server";
/// Error message when an HTTP status code is not 200 or 206.
pub const ERR_HTTP_NON_OK: &str = "unexpected HTTP status from update server";
/// Error message when an artifact WASM binary fails ABI or export validation.
pub const ERR_WASM_ARTIFACT_ABI: &str = "wasm artifact failed host ABI export check";
/// Error message when a declarative artifact is not valid JSON `DynamicNodeSpec`.
pub const ERR_DECLARATIVE_JSON: &str =
"declarative artifact payload is not a valid DynamicNodeSpec";
/// Error message when a cross-route action is denied by host permissions.
pub const ERR_ACTION_DENIED: &str = "cross-route action is not permitted by host policy";
/// Error message when a cross-route action was cancelled before dispatch.
pub const ERR_ACTION_CANCELLED: &str =
"cross-route action cancelled by stale generation token";
/// Error message when no active release generation is installed on the runtime.
pub const ERR_NO_ACTIVE_GENERATION: &str = "no active release generation installed";
/// Error message when the background update worker thread cannot be spawned.
pub const ERR_WORKER_SPAWN: &str = "failed to spawn background update worker thread";
/// Error message when a network transport is unavailable on `wasm32` in synchronous mode.
pub const ERR_WASM32_SYNC_HTTP: &str =
"synchronous TCP HTTP transport unavailable on wasm32";