Dashboard › cli › Distillation
b35d0099-134b-44a7-9c19-12b10296b7d7["lore_tm_v1_RIXoFOYX04B_Arj9dl0VQA4p2-9w5Z9OrD0FUrVU5ic"]
packages/cli/src/lib/binary.ts that import and use UpgradeTransportError from ./errors.js for upgrade transport failures.stripTrailingSep(p: string) strips one trailing platform path separator only when p.length > 1, so equivalent PATH entries such as ~/.local/bin/ and ~/.local/bin compare equally while a bare root like / is never stripped.InstallationMethod in packages/cli/src/lib/binary.ts as the exact union "curl" | "brew" | "npm" | "pnpm" | "bun" | "yarn" | "unknown"; it is colocated with installation constants such as KNOWN_CURL_DIRS so upgrade.ts and db/install-info.ts can import it without a circular dependency.getPlatformBinaryName() follows sentry-<os>-<arch>[-musl][.exe]: OS is darwin on macOS, windows on Windows, otherwise linux; architecture is arm64 only when process.arch === "arm64", otherwise x64; musl adds -musl; Windows adds .exe. Examples include sentry-linux-x64 and sentry-linux-arm64-musl.packages/cli/src/lib/binary.ts: the latest-release discovery URL uses getGitHubReleasesUrl(source) with ?per_page=100, while repository-existence verification uses https://api.github.com/repos/${source.githubRepo}.options.sources ?? UPGRADE_SOURCES, associates successful resolution with its UpgradeSource, and throws UpgradeSourceNotFoundError when all configured sources return HTTP 404.fetchWithUpgradeError(url, init, serviceName) preserves explicit cancellation provenance: when init.signal?.aborted, it throws init.signal.reason; independently thrown AbortError values are also rethrown unchanged.fetchWithUpgradeError() TLS and connection-failure mapping from generic UpgradeError("network_error", ...) to UpgradeTransportError(...). TLS failures use buildTlsErrorDetail(error); other failures use Failed to connect to ${serviceName}: ${stringifyUnknown(error)}.SyntaxError during parsing is converted to an invalid-response message containing ${invalidMessage}: ${stringifyUnknown(error)}.XDG_BIN_HOME is honored only when it is absolute, per the XDG specification.