Dashboard › cli › Distillation
038dba98-9ea4-41f8-8459-8b3a915ccdca["lore_tm_v1_Xv6R55QfX-kOAq4DUXYeUk2FmP5N9BlyUk55Dq0lvec","lore_tm_v1_-NKWmHj6VwwDqZOjK9ntUhIvC4tRDXIYVWfJESb2EC4","lore_tm_v1_dL9i_oj1sivuFy3OBxuj3H2VCd9lsgIno_cGqZgyRR0","lore_tm_v1__dKXhi-Z3W-BRRC7OM2WxOqOejXXg2sgxHv2-xeK2vU","lore_tm_v1_U4AUHUvGMQ4HAly5UboeRkjumHgEiQQzbsK-oHEzh_g","lore_tm_v1_O3cgZyI-g1OfoiU-4UitOf0pdxbvunJo4xcC0W3ok6g","lore_tm_v1_s7JEFTMDSb9raRadLboxz-SEL3TEerGyIV-ztQ8113U","lore_tm_v1_3yNK7yzEICBaBwLoq6jm2lxS8Akzm17DvBAnLGfw1Bs","lore_tm_v1_vdemByM8gAKajUqXFG5PNTfchqSx_0Ivc1j04rrX42A","lore_tm_v1_SwUAOk3CseYLF3Z9ENef10ZskWUL9YdtGpQk8UF5YJc","lore_tm_v1_A1DyAya4JRqm5H5d6uVA67r5sKjykGzljMe1pKzxaC4","lore_tm_v1_dgjSGN_WA4218Ei3Wyw-WQVwNtiQYh1BqwBi9kSp-MY","lore_tm_v1_cwIV9D56NIb_lejYNMY8-D5s9RaP7Vj67EM1wqFm6v8"]
Date: Sep 9, 2026
4978828102 (IC_kwDOQm6jAs8AAAABKMLjRg) at https://github.com/getsentry/cli/issues/1244#issuecomment-4978828102: BYK, a repository MEMBER, wrote βMaster tracking issue: https://github.com/getsentry/cli/issues/1248β; created and updated July 15, 2026 at 09:05:00Z, with 0 reactions.packages/cli/src/lib/ghcr.ts that imports PRIMARY_UPGRADE_SOURCE and UpgradeSource from ./binary.js and changes GHCR_REPO from the literal "getsentry/cli" to PRIMARY_UPGRADE_SOURCE.ghcrRepo.packages/cli/src/lib/ghcr.ts being made source-aware: getAnonymousToken(sourceOrSignal: UpgradeSource | AbortSignal = PRIMARY_UPGRADE_SOURCE, signal?: AbortSignal) retains backward-compatible AbortSignal handling and scopes tokens to source.ghcrRepo; fetchManifest(), fetchNightlyManifest(), downloadNightlyBlob(), fetchTagPage(), listTags(), and downloadLayerBlob() gain an UpgradeSource = PRIMARY_UPGRADE_SOURCE parameter and construct GHCR URLs from source.ghcrRepo.packages/cli/test/lib/ghcr.test.ts importing UPGRADE_SOURCES from ../../src/lib/binary.js; one verifies getAnonymousToken(UPGRADE_SOURCES[0]) requests scope=repository:getsentry/toolkit:pull and returns "toolkit-token", and another verifies fetchNightlyManifest("token", undefined, UPGRADE_SOURCES[0]) requests /v2/getsentry/toolkit/manifests/nightly.packages/cli/src/lib/binary.ts defining UpgradeSource with readonly githubRepo, ghcrRepo, and tagPrefix fields.UPGRADE_SOURCES in packages/cli/src/lib/binary.ts: 1. { githubRepo: "getsentry/toolkit", ghcrRepo: "getsentry/toolkit", tagPrefix: "cli@" }; 2. { githubRepo: "getsentry/cli", ghcrRepo: "getsentry/cli", tagPrefix: "" }. PRIMARY_UPGRADE_SOURCE is UPGRADE_SOURCES[0].packages/cli/src/lib/binary.ts: getBinaryDownloadUrl(version, source) produces https://github.com/${source.githubRepo}/releases/download/${source.tagPrefix}${version}/${getPlatformBinaryName()}; getGitHubReleasesUrl(source) returns the repository releases API URL; getGitHubReleaseByTagUrl(version, source) URL-encodes the prefixed tag; getGitHubLatestReleaseUrl(source) uses ?per_page=100 when tagPrefix is nonempty and /latest otherwise; getGitHubRepositoryUrl(source) builds the repository API URL.resolveUpgradeSource() in packages/cli/src/lib/binary.ts iterating UPGRADE_SOURCES, using customFetch unless an alternate fetch is supplied, sharing optional cancellation, and returning both the selected source and successful probe response so the caller never repeats the request.resolveUpgradeSource() never repeats the successful probe request; only HTTP 404 advances to the next source, while every other HTTP failure or network failure aborts immediately.resolveUpgradeSource() error handling: AbortError is rethrown; TLS certificate errors become UpgradeError("network_error", buildTlsErrorDetail(error)); other fetch failures become UpgradeError("network_error", "Failed to connect to GitHub: ..."); non-404 HTTP failures become UpgradeError("network_error", "Failed to fetch from GitHub: HTTP ..."); all sources returning 404 produces UpgradeError("network_error", "No CLI upgrade source was found: every source returned HTTP 404").packages/cli/src/lib/binary.ts installation methods as "curl" | "brew" | "npm" | "pnpm" | "bun" | "yarn" | "unknown"; parseInstallationMethod() lowercases input and rejects values outside curl, brew, npm, pnpm, bun, and yarn.isMusl() in packages/cli/src/lib/binary.ts using two ordered heuristics: 1. check /lib/ld-musl-<arch>.so.1; 2. inspect combined stdout/stderr from ldd --version for "musl". The result is cached; a missing or failed ldd assumes glibc.getPlatformBinaryName() producing sentry-<os>-<arch>[-musl][.exe], with OS mappings darwin/windows/linux, architecture arm64 or x64, a -musl suffix when applicable, and .exe on Windows.packages/cli/src/lib/version-check.ts never throws: errors are caught and reported to Sentry.maybePrefetchPatches() in packages/cli/src/lib/version-check.ts: it runs only when latestVersion is newer than CLI_VERSION; dispatches to prefetchNightlyPatches(latestVersion, signal) for nightly or prefetchStablePatches(latestVersion, signal) for stable; catches and debug-logs prefetch errors; then opportunistically calls cleanupPatchCache() and separately catches and debug-logs cleanup errors.shouldSuppressNotification() resolving cli management subcommands despite global flags appearing before cli or between cli and the subcommand, and suppressing notifications when the resolved subcommand belongs to SUPPRESSED_CLI_SUBCOMMANDS.UpgradeSource/tagPrefix-related matches across packages/cli/src/lib/binary.ts and packages/cli/src/lib/ghcr.ts.packages/cli/src/lib/upgrade.ts line 766 still calls getBinaryDownloadUrl(version) without passing a selected source, while source definitions and helpers are in packages/cli/src/lib/binary.ts.packages/cli/test/lib/binary.test.ts contains resolveUpgradeSource tests beginning around lines 84, 88, 110, 136, 155, and 173, using getGitHubReleaseByTagUrl("0.45.0", source); corresponding implementations are in packages/cli/src/lib/binary.ts.binpatch library never renders progress; it emits ProgressEvent values through ProgressHandler/safeProgress.binpatch as a pure-Node, zero-product-coupling binary delta-update engine joining an apply core for TRDIFF10/bsdiff patch chains with discovery through a pluggable SourceStrategy; consumers inject cache directory, download source, version comparison, progress handling, and telemetry.binpatch public API exports: apply core addDiffChunk, applyPatch, applyPatchChainInMemory, applyPatchToMemory, MAX_OUTPUT_SIZE, offtin, parsePatchHeader, PatchHeader; cache types/helpers ChainMeta, chainFileName, makeCache, PatchCache, patchFileName, PatchStepMeta; contract exports ChainStep, DeltaResult, InstrumentHook, MAX_NIGHTLY_CHAIN_DEPTH, MAX_STABLE_CHAIN_DEPTH, PATCH_TAG_PREFIX, PatchChain, PatchLink, SIZE_THRESHOLD_RATIO; errors BinpatchError, BinpatchErrorReason; progress exports ProgressEvent, ProgressHandler, ProgressPhase, safeProgress; orchestration exports DeltaSource, DeltaTelemetry, DeltaUnavailableReason, resolveAndApply, ResolveAndApplyOpts, SourceStrategy, UnavailableReporter.binpatch source exports: GHCR GhcrSourceConfig, ghcrSource, getPatchFromVersion, getPatchTargetSha256, filterAndSortChainTags, NightlyChainFailure, StepFailureReason, validateChainStep; GitHub Releases extractSha256, extractStableChain, ExtractStableChainOpts, GitHubAsset, GitHubRelease, GitHubReleaseSourceConfig, githubReleaseSource, getStableTargetSha256, StableChainFailure, StableChainInfo; OCI OciClient, OciClientConfig, OciLayer, OciManifest./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade containing exactly 18 entries: .craft.yml, .git, .github/, .gitignore, .lore.md, .nojekyll, .npmrc, AGENTS.md, apps/, CHANGELOG.md, codemods/, LICENSE.md, node_modules/, package.json, packages/, pnpm-lock.yaml, pnpm-workspace.yaml, and README.md.packages/cli to read .cursor/rules/ultracite.mdc before working and always check package.json for the latest scripts.dependencies, because everything is bundled with esbuild and CI enforces this via pnpm run check:deps; packages must always be added with pnpm add -D <package> using the -D flag.@sentry/api when available rather than creating redundant Valibot schemas in src/types/sentry.ts.node:* standard-library APIs and must not reintroduce Bun.* globals, bun:test, or bun CLI commands.await readFile(path, "utf-8") from node:fs/promises; writes via await writeFile(path, content); existence checks via existsSync(path) from node:fs; processes via spawn()/execFile() from node:child_process; shell commands via execSync(); executable lookup via the helper in src/lib/which.ts; globs via the scanner in src/lib/scan/; sleep via await setTimeout(ms) from node:timers/promises; JSON parsing via JSON.parse(await readFile(path, "utf-8")).node:fs directory creation with permissions using mkdirSync(dir, { recursive: true, mode: 0o700 }); for user-controlled shell arguments, execFileSync with array arguments is preferred over string-based execSync to prevent shell injection.buildCommand from ../../lib/command.js, never directly from @stricli/core, because the wrapper adds telemetry, --json/--fields injection, and output rendering.async *func() generators; yield new CommandOutput(data) and return { hint }; feed the same data object to output.human and JSON serialization; do not add a custom json flag; do not use stdout.write() or branch on flags.json.src/commands/ to focus, in order, on 1. argument parsing, 2. API orchestration, and 3. output dispatch; formatting belongs in src/lib/formatters/<domain>.ts, and command files exceeding roughly 400 lines should extract formatting helpers.stderr.write() is banned in command files by a GritQL rule; diagnostics must use logger, while data output must use CommandOutput.buildRouteMap from ../../lib/route-map.js, never directly from @stricli/core; the wrapper automatically injects aliases list β ls, view β show, delete β remove and rm, and create β new. Manual aliases are merged with and take precedence over generated aliases, but standard aliases must not be manually duplicated.0.4.2 public contracts before providing file- and symbol-level recommendations; it would remain read-only and avoid broad tests.packages/cli/src/lib/delta-upgrade.ts determining channel from isNightlyVersion(targetVersion), choosing nightlySource() or stableSource() around line 543, and attaching channel information to telemetry around lines 558, 563, 576, and 596.packages/cli/src/lib/version-check.ts selecting the persisted release channel, using GHCR for nightly and GitHub Releases for stable, storing latestVersion, and then calling maybePrefetchPatches(channel, latestVersion, signal).packages/cli/src/lib/upgrade.ts documents/fetches the latest version by installation method and channel, with nightly versions sourced from a GHCR manifest annotation and "stable" as the default channel.