Dashboard › cli › Distillation
6bf399c9-8ead-409b-b4d7-6bd955d1dde8["lore_tm_v1_CWfkOafOJeqFx4gnNWxuI6FNJoxtSFGOuwesSVxQ5Fc","lore_tm_v1_HlzdszolLDYhS13Vu0ae1bMMekOw9j1gyH7MdBNa4p4","lore_tm_v1_JQ4e69R9uaZwnhIIJKZz0QfAfxqp2DG1CT1XGiYIgLI"]
Location header, code throws new UpgradeError("network_error", \GHCR blob redirect (${blobResponse.status}) had no Location header`); the redirect is then followed with customFetch(redirectUrl, { headers: { "User-Agent": getUserAgent() }, signal })and deliberately without theAuthorization` header because Azure returns HTTP 404 when a Bearer token is sent alongside its signed query-string credentials.AbortSignal.timeout: it covers connection plus body streaming, and a 30-second timeout for a full nightly binary of approximately 30 MB would require sustained throughput of approximately 8 Mbps. The GHCR first-step timeout handles GHCR-side latency; Azure Blob Storage is treated as having reliable latency.rethrowExternalAbort(error, signal) before wrapping other failures as new UpgradeError("network_error", \Failed to download from blob storage: ${msg}`); non-OK redirect responses become Blob storage download failed: HTTP ${redirectResponse.status}, and unrecognized initial GHCR responses become Unexpected GHCR blob response: HTTP ${blobResponse.status}`.TAGS_PAGE_SIZE = 100.validateStableVersion(version, source) rejects a missing version with new UpgradeError("network_error", \No version found in ${source}`); it rejects values where semverValid(version) === nullorsemverPrerelease(version) !== nullwith${source} returned an invalid stable version`, otherwise returning the version.fetchLatestNightlyVersionWithSource(signal?, sources = UPGRADE_SOURCES) immediately throws signal.reason when already aborted, then resolves the nightly OCI manifest via resolveNightlyManifest("nightly", signal, sources). Nightly version discovery uses exactly 2 HTTP requests—anonymous token exchange plus manifest fetch—and reads the version from the manifest annotation without downloading a blob.versionExists(method, version, source?) delegates to standaloneVersionExists(version, source) when isNightlyVersion(version), method === "curl", or method === "brew". Other methods first call validateStableVersion(version, "Requested package version"), then issue HEAD to ${NPM_REGISTRY_URL}/${version} through fetchWithUpgradeError(..., "npm registry") and return response.ok.detectLegacyInstallationMethod() when no stored method is available. If the result is not "unknown", it best-effort persists { method: legacyMethod, path: process.execPath, version: CLI_VERSION } via setInstallInfo(); database write failure is nonfatal and logs "Failed to persist install info (DB may be read-only)".