Dashboard › cli › Distillation
cfdda67f-5862-4196-9c41-2018e18ad123["lore_tm_v1_mIHYW-gAc4Z4zg5c0gBpOKCz8-5c1Wg6T6VXZCeAdlU","lore_tm_v1_m6Ub--x5G1GrZZlVcEAoz2VuimmBy-bTdqs0zsZEWyM"]
packages/cli/src/lib/ghcr.ts lines 354-437 defines downloadNightlyBlob(token, digest, signal?, source: UpgradeSource = PRIMARY_UPGRADE_SOURCE): it requests ${GHCR_REGISTRY}/v2/${source.ghcrRepo}/blobs/${digest} with bearer authorization, redirect: "manual", and buildSignal(GHCR_BLOB_TIMEOUT, signal). GHCR may return the blob directly with HTTP 200 or redirect via HTTP 301/302/307/308; redirected requests omit the Authorization header because Azure Blob Storage returns 404 when a bearer token accompanies its signed query-string credentials.downloadNightlyBlob uses only the caller’s signal for the redirected Azure request, not AbortSignal.timeout: a full nightly binary is approximately 30 MB, and a 30-second timeout would require sustained throughput of approximately 8 Mbps. Failures map to UpgradeError("network_error", ...), including missing Location, blob-storage HTTP failure, and unexpected GHCR status.packages/cli/src/lib/ghcr.ts lines 439-523 sets TAGS_PAGE_SIZE = 100; fetchTagPage(token, lastTag?, signal?, source: UpgradeSource = PRIMARY_UPGRADE_SOURCE) requests ${GHCR_REGISTRY}/v2/${source.ghcrRepo}/tags/list?n=100, adding &last=${encodeURIComponent(lastTag)} for pagination. listTags(token, prefix?, signal?, source: UpgradeSource = PRIMARY_UPGRADE_SOURCE) repeatedly forwards source to fetchTagPage, optionally retains tags beginning with prefix, stops on an empty or sub-100-item page, and otherwise uses tags.at(-1) as the next lastTag.packages/cli/src/lib/ghcr.ts lines 538-545 defines downloadLayerBlob(token, digest, signal?, source: UpgradeSource = PRIMARY_UPGRADE_SOURCE), forwards all arguments to downloadNightlyBlob(token, digest, signal, source), and returns response.arrayBuffer(); it is intended for small patch payloads of 50-500 KB.packages/cli/test/commands/cli/upgrade.test.ts found exactly 19 CLI_VERSION-related matches: import at line 34; stable/current-version checks at lines 298, 299, 314, 361, 477, and 487; nightly/update-hint checks at lines 536, 566, 584, 604, 624, 642, 658, 659, and 674; and same-version forced-download coverage at lines 1007, 1020, and 1022.packages/cli/test/commands/cli/upgrade.test.ts uses mockBinaryDownloadWithVersion(CLI_VERSION) at line 1007 even though the same version would normally short-circuit, then expects output containing Downloading ${CLI_VERSION} at line 1020 and CLI_VERSION at line 1022.