DashboardcliSession 0EEj6bAT8M4q

Session 0EEj6bAT8M4q

Full ID: 0EEj6bAT8M4qaXeOe
Messages: 822
Distillations: 50
Time range: 2026-09-08 20:31:09 — 2026-09-09 04:09:34

Conversation (822 messages)

Read-only exploration in the current getsentry/cli repository. Thoroughness: very thorough. Map every TypeScript path involved in CLI stable/nightly/full/delta upgrades and GHCR metadata, especially packages/cli/src/lib/binary.ts, ghcr.ts, upgrade.ts, delta-upgrade.ts and tests. Identify current source repository/package constants, exact fallback/error semantics, existing test fixtures and mock patterns, and the smallest design for ordered sources where getsentry/toolkit is tried first and getsentry/cli only on HTTP 404. Do not edit files. Return exact file paths, symbols, relevant line ranges, behavioral risks, and focused test commands/scripts from package.json.

gateway · 2026-09-08 20:31:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus</path>
<type>directory</type>
<entries>
.craft.yml
.git
.github/
.gitignore
.lore.md
.nojekyll
.npmrc
.opencode/
.plans/
.ruff_cache/
AGENTS.md
apps/
CHANGELOG.md
codemods/
coverage/
dist-bin/
dist/
docs/
LICENSE.md
node_modules/
package.json
packages/
pnpm-lock.yaml
pnpm-workspace.yaml
README.md
test-results.junit.xml

(26 entries)
</entries>
gateway · 2026-09-08 20:31:22
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3b...
gateway · 2026-09-08 20:31:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/AGENTS.md</path>
<type>file</type>
<content>
1: <!-- This section is maintained by the coding agent via lore (https://github.com/BYK/loreai) -->
2: ## Long-term Knowledge
3: 
4: For long-term knowledge entries managed by [lore](https://github.com/BYK/loreai) (gotchas, patterns, decisions, architecture), see [`.lore.md`](.lore.md) in the project root.
5: <!-- End lore-managed section -->

(End of file - total 5 lines)
</content>
gateway · 2026-09-08 20:31:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md</path>
<type>file</type>
<content>
1: <!-- Managed by lore (https://github.com/BYK/loreai) — manual edits are imported on next session. -->
2: 
3: ## Long-term Knowledge
4: 
5: ### Architecture
6: 
7: <!-- lore:019e56e2-f89c-7846-8953-1e47fb470cbf -->
8: * **Binary size breakdown: 94.5% is Node.js runtime — bundled code is ~6.3 MiB**: Binary composition (linux-x64, Node 24 LTS): Node.js runtime=121 MiB (ships with debug symbols). \`strip --strip-unneeded\` → 99 MiB (-17 MiB raw, -4 MiB compressed). Strip built into fossilize 0.7.0 — happens on the copied binary BEFORE postject injection. After strip+SEA+binpunch: ~108 MiB raw, ~30 MiB gzip (vs 125 MiB / 34 MiB unstripped). .rodata=52.5 MB: V8 snapshot ~12 MB, ICU full-icu data ~28 MB. UPX compresses to 25 MiB but DESTROYS ELF notes — ruled out. ...
gateway · 2026-09-08 20:31:46
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-08 20:31:54
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-08 20:32:00
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-08 20:32:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-08 20:32:14
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * sentry cli upgrade
3:  *
4:  * Self-update the Sentry CLI to the latest or a specific version.
5:  * After upgrading, spawns the NEW binary with `cli setup` to update
6:  * completions, agent skills, and record installation metadata.
7:  *
8:  * Supports two release channels:
9:  * - stable (default): tracks the latest GitHub release
10:  * - nightly: tracks the rolling nightly prerelease built from main
11:  *
12:  * The channel can be set via --channel or by passing "nightly"/"stable"
13:  * as the version argument. The choice is persisted in the local database
14:  * so that subsequent bare `sentry cli upgrade` calls use the same channel. ...
gateway · 2026-09-08 20:32:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-08 20:32:33
result
Found 82 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 40:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts:
  Line 64:         const baseUrl = "https://github.com/getsentry/cli/releases/download";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 979:       "https://github.com/getsentry/cli/releases/download/"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/project/view.ts:
  Line 146:  * generic "Could not auto-detect" fallback (getsentry/cli#785 ...
gateway · 2026-09-08 20:32:45
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 375: export async function fetchLatestFromGitHub(

  Line 379:     ...
gateway · 2026-09-08 20:32:53
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/script/check-patches.ts:
  Line 31:  *   the four edits per file, `pnpm patch-commit`) and rename the patch file to


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 27: import { cleanupPatchCache } from "./patch-cache.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 52: import { clearPatchCache } from "./patch-cache.js";

  Line 489:  * Nightly builds are published to GHCR with tags like `nightly-0.14.0-dev.1772661724`.

  Line 501:     await fetchManifest(token, `nightly-${version}`);

  Line 519:  * versioned tags like `nightly-0.14.0-dev.1772661724`). Stable versions

  Line 661:  * `org.opencontainers.image.title` annotation on the matching ...
gateway · 2026-09-08 20:33:04
result
Found 56 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts:
  Line 20: import { getPlatformBinaryName } from "../../src/lib/binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts:
  Line 7: import { setReleaseChannel } from "../../src/lib/db/release-channel.js";

  Line 11: } from "../../src/lib/db/version-check.js";

  Line 24: } from "../../src/lib/version-check.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 34: } from "../../src/lib/binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.mocked.test.ts:
  Line 23: import { getBinaryFilename, installBinary } from ...
gateway · 2026-09-08 20:33:12
result
Found 23 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 156: function checkForUpdateInBackgroundImpl(): void {

  Line 183:             ? ...
gateway · 2026-09-08 20:33:21
result
No files found
gateway · 2026-09-08 20:33:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management Tests
3:  *
4:  * Tests for shared binary helpers: install directory selection, paths,
5:  * download URLs, locking, and binary installation.
6:  */
7: 
8: import {
9:   chmodSync,
10:   mkdirSync,
11:   readFileSync,
12:   realpathSync,
13:   rmSync,
14:   symlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { access, readFile, writeFile } from "node:fs/promises";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: import {
21:   acquireLock,
22:   compareVersions,
23:   determineInstallDir,
24:   fetchWithUpgradeError,
25:   getBinaryDownloadUrl,
26:   getBinaryFilename,
27:   getBinaryPaths,
28:   getPlatformBinaryName,
29:   installBinary,
30:   isDowngrade,
31:   isMusl,
32:   releaseLock,
33:   ...
gateway · 2026-09-08 20:33:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.mocked.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Tests for installBinary's canonical() fallback when realpath throws on an
3:  * existing path. Kept in a separate file so the node:fs/promises mock doesn't
4:  * leak into binary.test.ts.
5:  */
6: 
7: import { chmodSync, mkdirSync, rmSync } from "node:fs";
8: import { readFile, writeFile } from "node:fs/promises";
9: import { join } from "node:path";
10: import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
11: 
12: // Mock only realpath to throw; everything else stays real via importOriginal.
13: vi.mock("node:fs/promises", async (importOriginal) => {
14:   const orig = await importOriginal<typeof import("node:fs/promises")>();
15:   return {
16:     ...orig,
17:     realpath: () =>
18:       Promise.reject(new Error("EACCES: permission denied (simulated)")),
19:   ...
gateway · 2026-09-08 20:33:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR Client Tests
3:  *
4:  * Unit tests for the GHCR/OCI download protocol helpers.
5:  * All HTTP calls are mocked via globalThis.fetch to avoid network access.
6:  */
7: 
8: import { afterEach, beforeEach, describe, expect, test } from "vitest";
9: import { UpgradeError } from "../../src/lib/errors.js";
10: import {
11:   downloadLayerBlob,
12:   downloadNightlyBlob,
13:   fetchManifest,
14:   fetchNightlyManifest,
15:   findLayerByFilename,
16:   GHCR_REPO,
17:   GHCR_TAG,
18:   getAnonymousToken,
19:   getNightlyVersion,
20:   listTags,
21:   type OciManifest,
22: } from "../../src/lib/ghcr.js";
23: 
24: /** Store original fetch for restoration */
25: let originalFetch: typeof globalThis.fetch;
26: 
27: /** Helper to mock fetch without TypeScript errors about missing Bun-specific properties */
28: ...
gateway · 2026-09-08 20:33:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module Tests
3:  *
4:  * Tests for upgrade detection and logic.
5:  *
6:  * The `executeUpgrade` and `detectInstallationMethod` subprocess tests use
7:  * `vi.mock("node:child_process", ...)` at the top of this file to
8:  * intercept `spawn()` calls via a swappable `spawnImpl`. Non-spawn exports
9:  * pass through to the real `node:child_process`. ...
gateway · 2026-09-08 20:34:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1695:       const upgradeError = error as UpgradeError;
1696:       expect(upgradeError.reason).toBe("offline_cache_miss");
1697:       expect(upgradeError.message).toContain("network is unavailable");
1698:       expect(upgradeError.message).toContain("Check your internet connection");
1699:       expect(upgradeError.message).not.toContain("cached patches");
1700:     }
1701:   });
1702: });
1703: 
1704: // Regression coverage for CLI-1D3: when the full download silently produces
1705: // a missing or empty file, `downloadBinaryToTemp` polls with exponential
1706: // backoff (letting a Windows filesystem-visibility race self-heal), then
1707: // fails with an actionable `UpgradeError` if the file never appears. ...
gateway · 2026-09-08 20:34:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Command Tests
3:  *
4:  * Tests the `sentry cli upgrade` command through Stricli's run().
5:  * Covers resolveTargetVersion branches (check mode, already up-to-date,
6:  * version validation) and error paths.
7:  *
8:  * Status messages go through consola (→ process.stderr). Tests capture stderr
9:  * via a spy on process.stderr.write and assert on the collected output. ...
gateway · 2026-09-08 20:34:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Unit Tests for Delta Upgrade Module
3:  *
4:  * Tests the exported pure-computation functions that drive chain resolution
5:  * for both stable (GitHub Releases) and nightly (GHCR) channels, plus
6:  * async orchestration functions tested via fetch mocking.
7:  */
8: 
9: import { createHash } from "node:crypto";
10: import { existsSync, unlinkSync } from "node:fs";
11: import { access, readFile } from "node:fs/promises";
12: import { tmpdir } from "node:os";
13: import { join } from "node:path";
14: import { afterEach, beforeEach, describe, expect, test } from "vitest";
15: import { getPlatformBinaryName } from "../../src/lib/binary.js";
16: import {
17:   applyPatchChain,
18:   attemptDeltaUpgrade,
19:   canAttemptDelta,
20:   downloadStablePatch,
21:   type ExtractStableChainOpts,
22:   ...
gateway · 2026-09-08 20:34:38
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts</path>
<type>file</type>
<content>
1001:     expect(chain).not.toBeNull();
1002:     expect(chain?.patches).toHaveLength(2);
1003:     // Oldest patch first (apply order)
1004:     expect(chain?.patches[0]?.data).toEqual(patchA);
1005:     expect(chain?.patches[1]?.data).toEqual(patchB);
1006:     expect(chain?.steps).toEqual([
1007:       { fromVersion: "0.13.0", toVersion: "0.14.0" },
1008:       { fromVersion: "0.14.0", toVersion: "0.15.0" },
1009:     ]);
1010:   });
1011: 
1012:   test("returns null when target not in releases", async () => {
1013:     const releases: GitHubRelease[] = [
1014:       makeRelease("0.13.0", [makeAsset({ name: "sentry-linux-x64" })]),
1015:     ];
1016:     setupStableMocks(releases, new Map());
1017: 
1018:     const chain = await resolveStableChain("0.12.0", "0.14.0");
1019:     ...
gateway · 2026-09-08 20:34:47
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Integration tests for delta upgrade orchestration with a non-dev CLI_VERSION.
3:  *
4:  * These tests use `vi.mock()` to override `CLI_VERSION` from constants.js
5:  * so that `canAttemptDelta()` passes its dev-build guard (the real `CLI_VERSION`
6:  * is "0.0.0-dev" in test mode, which short-circuits the orchestrator).
7:  *
8:  * Kept as a sibling file to `delta-upgrade.test.ts` because its
9:  * `vi.mock()` would invert the assumptions of the dev-mode null-return
10:  * tests in that file. Under `bun test --isolate` each file gets a fresh
11:  * module graph, so the mocks here don't leak. ...
gateway · 2026-09-08 20:34:54
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * E2E Test: Delta Upgrade via Binary Patching
3:  *
4:  * Downloads two consecutive stable release binaries from GitHub,
5:  * generates a TRDIFF10 patch using zig-bsdiff, and verifies that
6:  * our `applyPatch()` produces byte-identical output.
7:  *
8:  * Requires: zig-bsdiff binary available at /tmp/bsdiff (or via ZIG_BSDIFF_PATH env).
9:  * Skipped in CI unless ZIG_BSDIFF_PATH is set. ...
gateway · 2026-09-08 20:35:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Background version check for "new version available" notifications.
3:  *
4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the
5:  * latest nightly version via the OCI manifest annotation. For stable builds,
6:  * checks GitHub Releases. Results are cached in the database and shown on
7:  * subsequent runs.
8:  */
9: 
10: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
11: import * as Sentry from "@sentry/node-core/light";
12: import { compare as semverCompare } from "semver";
13: import { CLI_VERSION } from "./constants.js";
14: import { getReleaseChannel } from "./db/release-channel.js";
15: import {
16:   getVersionCheckInfo,
17:   markUpdateNotified,
18:   setVersionCheckInfo,
19: } from "./db/version-check.js";
20: ...
gateway · 2026-09-08 20:35:14
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Version Check Logic Tests
3:  */
4: 
5: import { setTimeout as sleep } from "node:timers/promises";
6: import { afterEach, beforeEach, describe, expect, test } from "vitest";
7: import { setReleaseChannel } from "../../src/lib/db/release-channel.js";
8: import {
9:   getVersionCheckInfo,
10:   setVersionCheckInfo,
11: } from "../../src/lib/db/version-check.js";
12: import {
13:   ApiError,
14:   ContextError,
15:   ValidationError,
16: } from "../../src/lib/errors.js";
17: import {
18:   abortPendingVersionCheck,
19:   getErrorUpdateNotification,
20:   getUpdateNotification,
21:   maybeCheckForUpdateInBackground,
22:   resetUpdateNotificationState,
23:   shouldSuppressNotification,
24: } from "../../src/lib/version-check.js";
25: import { mockFetch, useTestConfigDir } from "../helpers.js";
26: ...
gateway · 2026-09-08 20:35:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts</path>
<type>file</type>
<content>
1: import { join } from "node:path";
2: import { makeCache, type PatchCache, type PatchChain } from "binpatch";
3: import { getConfigDir } from "./db/index.js";
4: 
5: export type { ChainMeta, PatchStepMeta } from "binpatch";
6: // biome-ignore lint/performance/noBarrelFile: preserve the existing cache API
7: export { chainFileName, patchFileName } from "binpatch";
8: 
9: function cache(): PatchCache {
10:   return makeCache(join(getConfigDir(), "patch-cache"));
11: }
12: 
13: export function savePatchesToCache(
14:   chain: Pick<PatchChain, "patches" | "expectedSha256">,
15:   steps: { fromVersion: string; toVersion: string }[]
16: ): Promise<void> {
17:   return cache().save(chain, steps);
18: }
19: 
20: export async function loadCachedChain(
21:   currentVersion: string,
22:   targetVersion: string
23: ): ...
gateway · 2026-09-08 20:35:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/db/release-channel.ts</path>
<type>file</type>
<content>
1: /**
2:  * Release channel persistence.
3:  *
4:  * Stores the user's chosen release channel ("stable" or "nightly") in the
5:  * metadata table. Defaults to "stable" if not set.
6:  *
7:  * The channel controls which version stream `upgrade` and `version-check` use:
8:  * - "stable": tracks the latest GitHub release (default)
9:  * - "nightly": tracks the rolling nightly prerelease built from main
10:  */
11: 
12: import { getDatabase } from "./index.js";
13: import { getMetadata, setMetadata } from "./utils.js";
14: import { clearVersionCheckCache } from "./version-check.js";
15: 
16: const KEY = "release_channel";
17: 
18: /** The release channel a user tracks for upgrades and version-check notifications. ...
gateway · 2026-09-08 20:35:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/db/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Version check state persistence.
3:  *
4:  * Stores the last time we checked for updates and the latest known version
5:  * in the metadata table for the "new version available" notification.
6:  */
7: 
8: import { getDatabase } from "./index.js";
9: import { clearMetadata, getMetadata, setMetadata } from "./utils.js";
10: 
11: const KEY_LAST_CHECKED = "version_check.last_checked";
12: const KEY_LATEST_VERSION = "version_check.latest_version";
13: /**
14:  * Timestamp (ms) when we last printed the "new version available"
15:  * notification to stderr. Separate from `last_checked` so the cached
16:  * latest-version can stay hot for faster subsequent checks while the
17:  * notification itself is rate-limited to once per day.
18:  */
19: const KEY_LAST_NOTIFIED = "version_check.last_notified";
20: ...
gateway · 2026-09-08 20:35:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/setup.ts</path>
<type>file</type>
<content>
1: /**
2:  * sentry cli setup
3:  *
4:  * Configure shell integration: PATH, completions, and install metadata.
5:  * With --install, also handles binary placement (used by the install script
6:  * and the upgrade command for curl-based installs).
7:  */
8: 
9: import { existsSync, unlinkSync } from "node:fs";
10: import { dirname, join } from "node:path";
11: import { captureException } from "@sentry/node-core/light";
12: import type { SentryContext } from "../../context.js";
13: import { installAgentSkills } from "../../lib/agent-skills.js";
14: import {
15:   determineInstallDir,
16:   getBinaryFilename,
17:   type InstallationMethod,
18:   installBinary,
19:   parseInstallationMethod,
20: } from "../../lib/binary.js";
21: import { buildCommand } from "../../lib/command.js";
22: import {
23:   type ...
gateway · 2026-09-08 20:36:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/setup.ts</path>
<type>file</type>
<content>
451:       "- Installs shell completions (bash, zsh, fish)\n" +
452:       "- Installs agent skills for detected AI coding assistants\n" +
453:       "- Records installation metadata for upgrades\n\n" +
454:       "With --install, also handles binary placement from a temporary\n" +
455:       "download location (used by the install script and upgrade command).\n\n" +
456:       "This command is called automatically by the install script,\n" +
457:       "but can also be run manually after downloading the binary.\n\n" +
458:       "Examples:\n" +
459:       "  sentry cli setup                    # Auto-detect and configure\n" +
460:       "  sentry cli setup --method curl      # Record install method\n" +
461:       "  sentry cli setup --install          # Place binary and configure\n" +
462:       "  sentry cli ...
gateway · 2026-09-08 20:36:23
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml:
  Line 473:           REPO="ghcr.io/getsentry/cli"

  Line 475:           echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u ${{ github.actor }} --password-stdin

  Line 483:             if [ "$tag" = "nightly-${VERSION}" ]; then

  Line 499:           echo "$PREV_MANIFEST_JSON" | jq -r '.layers[] | select(.annotations["org.opencontainers.image.title"] | endswith(".gz")) | .annotations["org.opencontainers.image.title"] + " " + .digest' | while read -r filename digest; do

  Line 678:         run: echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u ${{ github.actor }} --password-stdin

  Line 688:           oras push ghcr.io/getsentry/cli:nightly \

  Line 689:             --artifact-type application/vnd.sentry.cli.nightly \

  Line 691:             --annotation "version=${VERSION}" \

  Line 699:           ...
gateway · 2026-09-08 20:36:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:   generate-patches:
431:     name: Generate Delta Patches
432:     needs: [changes, build-binary]
433:     # Only on main (nightlies) and release branches (stable) — skip PRs
434:     if: github.event_name != 'pull_request'
435:     runs-on: ubuntu-latest
436:     continue-on-error: true
437:     steps:
438:       - name: Install ORAS CLI
439:         # Only needed on main (to fetch previous nightly from GHCR)
440:         if: github.ref == 'refs/heads/main'
441:         run: |
442:           VERSION=1.3.1
443:           EXPECTED_SHA256="d52c4af76ce6a3ceb8579e51fb751a43ac051cca67f965f973a0b0e897a2bb86"
444:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"
445:           curl --retry 3 --retry-delay 5 --retry-all-errors -sfLo "$TARBALL" ...
gateway · 2026-09-08 20:36:49
result
Found 37 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/cleanup-doc-previews.yml:
  Line 33:           REPO: ${{ github.repository }}


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml:
  Line 14: # issues:write is needed for generate-patches to file issues on failure

  Line 152:         if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'

  Line 430:   generate-patches:

  Line 464:           # and their -gz variants, but not sentry-patches

  Line 511:           PREV_TAG=$(gh api "repos/${{ github.repository }}/releases?per_page=5" \

  Line 527:               --repo "${{ github.repository }}" \

  Line 546:             echo "Generating patch: ${name}.patch"

  Line 547:             bsdiff "$old_binary" "$new_binary" "patches/${name}.patch" --use-zstd

  Line 549:             ...
gateway · 2026-09-08 20:37:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml</path>
<type>file</type>
<content>
1: minVersion: '2.21.1'
2: changelog:
3:   policy: auto
4: versioning:
5:   policy: auto
6: preReleaseCommand: bash -c 'cd packages/cli && node --experimental-strip-types script/bump-version.ts --pre'
7: postReleaseCommand: bash -c 'cd packages/cli && node --experimental-strip-types script/bump-version.ts --post'
8: artifactProvider:
9:   name: github
10:   config:
11:     artifacts:
12:       Build:
13:         - '/^sentry-.*$/'
14:         - 'npm-package'
15:         - 'gh-pages'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: gh-pages
20:   - name: registry
21:     apps:
22:       'app:sentry':
23:         name: 'Sentry CLI'
24:         packageUrl: 'https://www.npmjs.com/package/sentry'
25:         mainDocsUrl: 'https://cli.sentry.dev'
26:         urlTemplate: ...
gateway · 2026-09-08 20:38:31
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 11: * **binpatch TRDIFF10 wire format + OCI tag scheme constants**: binpatch wire format (TRDIFF10): 8-byte magic \`TRDIFF10\x00\`, then LE int64 \`controlLen\`/\`diffLen\`/\`newSize\` (sign-magnitude), 24-byte control tuples with \`readDiffBy\`/\`readExtraBy\`/\`seekBy\` fields, zstd-compressed control/diff/extra blocks. OCI tag scheme: \`\<repo>:nightly\` (mutable pointer), \`\<repo>:nightly-\<version>\` (immutable), \`\<repo>:patch-\<version>\` (patches). Annotations: \`from-version=\<prev>\` (pointer, NOT hash — trust model), \`sha256-\<binaryName>=\<hex>\` (final binary hash only), \`org.opencontainers.image.title\`. Artifact type: \`application/vnd.\<prefix>.patch\`. Security limits: \`MAX\_OUTPUT\_SIZE=2\_147\_483\_648\` (2 GiB), \`MAX\_NIGHTLY\_CHAIN\_DEPTH=30\`, \`MAX\_STABLE\_CHAIN\_DEPTH=10\`, \`SIZE\_THRESHOLD\_RATIO=0.6\`. ...
gateway · 2026-09-08 20:38:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-08 20:38:56
result
Found 11 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 721:   const url = getBinaryDownloadUrl(version);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 35:   GITHUB_RELEASES_URL,

  Line 124:     releasesUrl: GITHUB_RELEASES_URL,

  Line 159:     const response = await customFetch(`${GITHUB_RELEASES_URL}?per_page=12`, {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 156: export const GITHUB_RELEASES_URL ...
gateway · 2026-09-08 20:39:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
1: /**
2:  * Release Notes Parser & Aggregation
3:  *
4:  * Extracts user-facing changelog entries from GitHub Release bodies (stable)
5:  * or conventional commit messages (nightly). Uses `marked.lexer()` for
6:  * AST-based section extraction and produces structured data that can be
7:  * re-serialized as filtered markdown for rendering via `renderMarkdown()`. ...
gateway · 2026-09-08 20:39:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
500: 
501:   for (const { commit } of commits) {
502:     const message = commit.message;
503: 
504:     if (message.includes("#skip-changelog")) {
505:       continue;
506:     }
507: 
508:     const firstLine = message.split("\n")[0]?.trim();
509:     if (!firstLine) {
510:       continue;
511:     }
512: 
513:     const ccMatch = CONVENTIONAL_COMMIT_RE.exec(firstLine);
514:     if (!(ccMatch?.[1] && ccMatch[2])) {
515:       continue;
516:     }
517: 
518:     const category = COMMIT_PREFIX_TO_CATEGORY.get(ccMatch[1]);
519:     if (!category) {
520:       continue;
521:     }
522: 
523:     const description = ccMatch[2].trim();
524:     const existing = items.get(category) ?? [];
525:     existing.push(description);
526:     items.set(category, existing);
527:   }
528: 
529:   const sections: ChangeSection[] ...
gateway · 2026-09-08 20:39:25
result
Found 45 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 39:     const url = getBinaryDownloadUrl("1.0.0");

  Line 53:     const url = getBinaryDownloadUrl("2.0.0");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 974:     const url = getBinaryDownloadUrl("1.0.0");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts:
  Line 16:   GHCR_REPO,

  Line 82:         `https://ghcr.io/token?scope=repository:${GHCR_REPO}:pull`

  Line 90:     const token = await getAnonymousToken();

  Line 97:     await expect(getAnonymousToken()).rejects.toThrow(UpgradeError);

  Line 98:     await expect(getAnonymousToken()).rejects.toThrow(

  Line 108:     await expect(getAnonymousToken()).rejects.toThrow(UpgradeError);

  Line ...
gateway · 2026-09-08 20:39:36
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/small.trdiff10
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/small-old.bin
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/small-new.bin
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/large.trdiff10
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/large-old.bin
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/large-new.bin
gateway · 2026-09-08 20:39:45
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/vitest.config.ts
gateway · 2026-09-08 20:39:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/vitest.config.ts</path>
<type>file</type>
<content>
1: import { existsSync } from "node:fs";
2: import { dirname, join } from "node:path";
3: import { defineConfig, type Plugin } from "vitest/config";
4: 
5: const JS_EXT_RE = /\.js$/;
6: 
7: /**
8:  * Vite plugin to rewrite lazy `require("./relative/path.js")` calls in
9:  * `.ts` source files to the corresponding `.ts` path when the `.ts` file
10:  * exists on disk. Node.js `require()` bypasses Vite's resolve pipeline,
11:  * so `resolve.extensions` doesn't apply.
12:  */
13: function requireJsToTsPlugin(): Plugin {
14:   return {
15:     name: "require-js-to-ts",
16:     enforce: "pre",
17:     transform(code, id) {
18:       if (!(id.endsWith(".ts") && code.includes("require("))) {
19:         return;
20:       }
21:       let changed = false;
22:       const transformed = code.replace(
23:         ...
gateway · 2026-09-08 20:40:04
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the

  Line 180:         // Use GHCR for nightly channel; GitHub Releases for stable.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 433:  * Fetch the latest nightly version from GHCR.

  Line 465:  * - nightly channel: fetches version from GHCR manifest annotation

  Line 487:  * Check if a versioned nightly tag exists in GHCR.

  Line 489:  * Nightly builds are published to GHCR with tags like `nightly-0.14.0-dev.1772661724`. ...
gateway · 2026-09-08 20:40:30
result
Found 17 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 74: * **toolkit pre-rename subtree merge**: Chose importing getsentry/cli into an integration branch of getsentry/sentry-mcp, validating the complete monorepo there, then renaming it to getsentry/toolkit over renaming first because pre-rename validation preserves known MCP deployment wiring and makes rollback safer. Keep CLI at packages/cli and docs at apps/cli-docs; use a pnpm workspace without Turbo, independent cli@/mcp@ releases, root-managed patches/catalogs, and later incremental extraction into @sentry/toolkit-core.

  Line 91: * **getsentry/toolkit history-preserving monorepo import**: Chose getsentry/toolkit as a workspace-release monorepo, importing getsentry/cli main as the initial history and rewriting/importing MCP history under packages/mcp before merging histories. ...
gateway · 2026-09-08 20:40:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "toolkit-cli-workspace",
3:   "version": "0.0.0",
4:   "private": true,
5:   "type": "module",
6:   "packageManager": "pnpm@10.11.0",
7:   "engines": {
8:     "node": ">=18.0"
9:   },
10:   "scripts": {
11:     "tsx": "pnpm --filter sentry run tsx",
12:     "cli": "pnpm --filter sentry run cli",
13:     "dev": "pnpm --filter sentry run dev",
14:     "build": "pnpm --filter sentry run build",
15:     "build:all": "pnpm --filter sentry run build:all",
16:     "bundle": "pnpm --filter sentry run bundle",
17:     "typecheck": "pnpm --filter sentry run typecheck",
18:     "lint": "pnpm --filter sentry run lint",
19:     "lint:fix": "pnpm --filter sentry run lint:fix",
20:     "test": "pnpm --filter sentry run test",
21:     "test:unit": "pnpm --filter sentry run test:unit",
22:     "test:changed": "pnpm --filter sentry run ...
gateway · 2026-09-08 20:40:50
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/api/traces.ts:
  Line 244:   fallbackProject: string;

  Line 266:   const { org, fallbackProject, traceId, onProgress } = options;

  Line 273:     const projectSlug = span.project_slug || fallbackProject;

  Line 277:     // targets where neither the span nor the fallback has a project.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/api/projects.ts:
  Line 328:   /** All organizations fetched during the search — reuse for fallback checks */

  Line 340:  * additional API call (useful for "did you mean org/?" fallbacks).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/api/preprod-artifacts.ts:
  Line 380:     if (err instanceof ApiError && err.status === 404) ...
gateway · 2026-09-08 20:41:03
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/eval-common/anthropic-client.ts:
  Line 109:   const response = await fetch(`${baseURL}/chat/completions`, {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/helpers.ts:
  Line 215:  * Used by tests that intercept `globalThis.fetch` and assert on the

  Line 256:  * Create a route-based fetch mock that replaces `globalThis.fetch`.

  Line 280:   const originalFetch = globalThis.fetch;

  Line 284:   globalThis.fetch = (async (

  Line 339:       globalThis.fetch = originalFetch;


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/skill-eval.test.ts:
  Line 33:  * The test preload mocks globalThis.fetch to block external network calls.

  Line 41:   const savedFetch = globalThis.fetch;

  Line ...
gateway · 2026-09-08 20:41:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/preload.ts</path>
<type>file</type>
<content>
1: /**
2:  * Test Environment Setup
3:  *
4:  * Isolates tests from user's real configuration and environment.
5:  * Runs before all tests via vitest setupFiles.
6:  */
7: 
8: // Polyfill `self` for Node.js — web worker code (e.g., grep-worker.js) references
9: // `self.onmessage` which exists in Bun and browsers but not in Node.
10: if (typeof globalThis.self === "undefined") {
11:   (globalThis as Record<string, unknown>).self = globalThis;
12: }
13: 
14: import {
15:   existsSync,
16:   mkdirSync,
17:   readdirSync,
18:   readFileSync,
19:   rmSync,
20: } from "node:fs";
21: import { homedir } from "node:os";
22: import { join } from "node:path";
23: 
24: // Load .env.local for test credentials (SENTRY_TEST_*)
25: // This mimics what would happen in CI where secrets are injected as env vars
26: const envLocalPath = ...
gateway · 2026-09-08 20:41:31
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/uninstall.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/db/install-info.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/db/install-info.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/uninstall.ts
gateway · 2026-09-08 20:41:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Install Script Tests
3:  *
4:  * Exercises the shell installer with fake download tools so argument parsing and
5:  * setup delegation can be validated without network access.
6:  */
7: 
8: import { spawn } from "node:child_process";
9: import {
10:   chmodSync,
11:   mkdirSync,
12:   mkdtempSync,
13:   readFileSync,
14:   rmSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { tmpdir } from "node:os";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: 
21: function noop(): void {
22:   // Intentionally empty — absorbs async spawn errors
23: }
24: 
25: const repoRoot = join(import.meta.dirname, "..", "..");
26: const installScript = join(repoRoot, "install");
27: 
28: describe("install script", () => {
29:   let ...
gateway · 2026-09-08 20:41:52
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
1: #!/bin/bash
2: set -euo pipefail
3: 
4: RED='\033[0;31m'
5: MUTED='\033[0;2m'
6: NC='\033[0m'
7: 
8: # Sentry error telemetry — fire-and-forget error reporting via envelope API.
9: # Uses the CLI's public write-only DSN. No PII collected.
10: # Opt-out: SENTRY_CLI_NO_TELEMETRY=1
11: SENTRY_DSN_KEY="1188a86f3f8168f089450587b00bca66"
12: SENTRY_INGEST="https://o1.ingest.us.sentry.io"
13: SENTRY_PROJECT_ID="4510776311808000"
14: 
15: # Generate a UUID for the event. Tries /proc, uuidgen, then awk fallback. ...
gateway · 2026-09-08 20:42:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
261: 
262: /**
263:  * Build headers for GitHub API requests.
264:  */
265: export function getGitHubHeaders(): Record<string, string> {
266:   return {
267:     Accept: "application/vnd.github.v3+json",
268:     "User-Agent": getUserAgent(),
269:   };
270: }
271: 
272: /**
273:  * Fetch wrapper that converts network errors to UpgradeError.
274:  * Handles DNS failures, timeouts, and other connection issues.
275:  *
276:  * @param url - URL to fetch
277:  * @param init - Fetch options
278:  * @param serviceName - Service name for error messages (e.g., "GitHub")
279:  * @returns Response object
280:  * @throws {UpgradeError} On network failure
281:  * @throws {Error} AbortError if signal is aborted (re-thrown as-is)
282:  */
283: export async function fetchWithUpgradeError(
284:   url: string,
285:   init: ...
gateway · 2026-09-08 20:42:50
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts:
  Line 586: export type UpgradeErrorReason =

  Line 600: export class UpgradeError extends CliError {

  Line 601:   readonly reason: UpgradeErrorReason;

  Line 603:   constructor(reason: UpgradeErrorReason, message?: string) {

  Line 604:     const defaultMessages: Record<UpgradeErrorReason, string> = {
gateway · 2026-09-08 20:43:00
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
570:  *
571:  * @param code - OAuth error code (e.g., "authorization_pending", "slow_down")
572:  * @param description - Human-readable error description
573:  */
574: export class DeviceFlowError extends CliError {
575:   readonly code: string;
576: 
577:   constructor(code: string, description?: string) {
578:     super(description ?? code, EXIT.DEVICE_FLOW);
579:     this.name = "DeviceFlowError";
580:     this.code = code;
581:   }
582: }
583: 
584: // Upgrade Errors
585: 
586: export type UpgradeErrorReason =
587:   | "unknown_method"
588:   | "unsupported_operation"
589:   | "network_error"
590:   | "execution_failed"
591:   | "version_not_found"
592:   | "offline_cache_miss";
593: 
594: /**
595:  * Upgrade-related errors. ...
gateway · 2026-09-08 20:43:14
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 123:   return githubReleaseSource({

  Line 133:   return ghcrSource({

  Line 286:   const client = new OciClient({
gateway · 2026-09-08 20:43:22
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 1: <!-- Managed by lore (https://github.com/BYK/loreai) — manual edits are imported on next session. -->

  Line 14: * **bspatch.ts in-memory chain refactor: transformPatch callback + three public APIs**: Core patching logic extracted into \`transformPatch(oldFile, patchData, onChunk)\` callback-based function. Three public APIs: \`applyPatchToFile(oldPath, patchData, destPath)→SHA-256\` (disk sink, final hop); \`applyPatchToMemory(oldFile, patchData)→Uint8Array\` (in-memory, intermediate hops); \`applyPatchChainInMemory(oldPath, patches\[], destPath)→SHA-256\` (full chain orchestrator). \`applyPatch()\` kept as thin wrapper for backward compat. Orchestration lives in bspatch.ts (not delta-upgrade.ts) to keep buffer handling encapsulated. ...
gateway · 2026-09-08 20:43:34
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts:
  Line 281:     ["ApiError 404", new ApiError("not found", 404)],


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

  Line 136:   fetchLatestFromGitHub,

  Line 143:   versionExists,

  Line 189: describe("fetchLatestFromGitHub", () => {

  Line 204:     const version = await fetchLatestFromGitHub();

  Line 222:     const version = await fetchLatestFromGitHub();

  Line 240:     const version = await fetchLatestFromGitHub();

  Line 248:           status: 404,

  Line 252:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 253:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 254:       "Failed to fetch from GitHub: 404"

  Line ...
gateway · 2026-09-08 20:43:45
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 979:       "https://github.com/getsentry/cli/releases/download/"

  Line 1395:   test("releases lock on failure", async () => {

  Line 1768:   test("releases the download lock when verification fails", async () => {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/cache-keys.test.ts:
  Line 31:       `${BASE}organizations/acme/releases/1.0.0/deploys/`

  Line 34:       `${BASE}organizations/acme/releases/1.0.0/deploys/`

  Line 36:     expect(prefixes).toContain(`${BASE}organizations/acme/releases/1.0.0/`);

  Line 37:     expect(prefixes).toContain(`${BASE}organizations/acme/releases/`);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line ...
gateway · 2026-09-08 20:43:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Unit Tests for Release Notes Parser & Aggregation
3:  *
4:  * Tests core invariants (section extraction, version filtering, truncation)
5:  * that are hard to express as property-based tests due to format specifics.
6:  *
7:  * Core random-input invariants (category validity, filtering, commit parsing)
8:  * are tested via property-based tests in release-notes.property.test.ts.
9:  */
10: 
11: import { marked } from "marked";
12: import { describe, expect, test } from "vitest";
13: import type { GitHubRelease } from "../../src/lib/delta-upgrade.js";
14: import {
15:   buildChangelogSummary,
16:   type ChangeCategory,
17:   countListItems,
18:   extractNightlyTimestamp,
19:   extractSections,
20:   parseCommitMessages,
21: } from "../../src/lib/release-notes.js";
22: 
23: // ...
gateway · 2026-09-08 20:44:20
result
Found 20 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/cli.ts:
  Line 181:     abortPendingVersionCheck,

  Line 182:     getErrorUpdateNotification,

  Line 183:     getUpdateNotification,

  Line 184:     maybeCheckForUpdateInBackground,

  Line 623:     maybeCheckForUpdateInBackground();

  Line 663:     const notification = getErrorUpdateNotification(err, hoistedArgs);

  Line 670:     abortPendingVersionCheck();

  Line 675:     const notification = getUpdateNotification();


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/log/list.ts:
  Line 70: import { getUpdateNotification } from "../../lib/version-check.js";

  Line 555:   const notification = getUpdateNotification();


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 113: export ...
gateway · 2026-09-08 20:44:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/cli.ts</path>
<type>file</type>
<content>
600:   }
601: 
602:   // ---------------------------------------------------------------------------
603:   // Main execution
604:   // ---------------------------------------------------------------------------
605: 
606:   // Clean up old binary from previous Windows upgrade (no-op if file doesn't exist)
607:   startCleanupOldBinary();
608: 
609:   // Apply SENTRY_LOG_LEVEL env var early (lazy read, not at module load time).
610:   // CLI flags (--log-level, --verbose) are handled by Stricli via
611:   // buildCommand and take priority when present.
612:   const envLogLevel = getEnvLogLevel();
613:   if (envLogLevel !== null) {
614:     setLogLevel(envLogLevel);
615:   }
616: 
617:   // Use hoisted args so positional checks (e.g., args[0] === "cli") work
618:   // even when global flags precede the subcommand in the ...
gateway · 2026-09-08 20:44:45
result
Found 24 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml:
  Line 26:         urlTemplate: 'https://github.com/getsentry/cli/releases/download/{{version}}/{{file}}'

  Line 45:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-arm64.gz"

  Line 48:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-x64.gz"

  Line 55:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-arm64.gz"

  Line 58:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-x64.gz"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 979:       ...
gateway · 2026-09-08 20:47:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/helpers.ts</path>
<type>file</type>
<content>
200:  * Mint a `sntrys_<base64-payload>_<secret>` token shape for tests, matching
201:  * the server's `generate_token` format
202:  * (`getsentry/sentry/src/sentry/utils/security/orgauthtoken_token.py`).
203:  *
204:  * The secret tail is a fixed placeholder — its content is irrelevant to
205:  * parsing. Padding `=` is stripped to match the server's `b64encode().rstrip("=")`.
206:  */
207: export function mintSntrysToken(payload: Record<string, unknown>): string {
208:   const json = JSON.stringify(payload);
209:   const b64 = Buffer.from(json, "utf8").toString("base64").replace(/=+$/, "");
210:   return `sntrys_${b64}_test-secret-tail`;
211: }
212: 
213: /**
214:  * Extract the URL string from a fetch input (`string | URL | Request`).
215:  * Used by tests that intercept `globalThis.fetch` and assert on the
216:  * ...
gateway · 2026-09-08 20:50:41
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/telemetry.ts:
  Line 1009: export function withTracing<T>(

  Line 1058: export function withTracingSpan<T>(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/progress.ts:
  Line 22: export type SetMessage = (message: string) => void;

  Line 51: export function makeByteProgress(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/polling.ts:
  Line 199: export async function withProgress<T>(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts:
  Line 586: export type UpgradeErrorReason =

  Line 600: export class UpgradeError extends CliError ...
gateway · 2026-09-08 20:50:50
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
gateway · 2026-09-08 20:51:14
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-08 20:51:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-08 20:51:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-08 20:51:51
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-08 20:52:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * sentry cli upgrade
3:  *
4:  * Self-update the Sentry CLI to the latest or a specific version.
5:  * After upgrading, spawns the NEW binary with `cli setup` to update
6:  * completions, agent skills, and record installation metadata.
7:  *
8:  * Supports two release channels:
9:  * - stable (default): tracks the latest GitHub release
10:  * - nightly: tracks the rolling nightly prerelease built from main
11:  *
12:  * The channel can be set via --channel or by passing "nightly"/"stable"
13:  * as the version argument. The choice is persisted in the local database
14:  * so that subsequent bare `sentry cli upgrade` calls use the same channel. ...
gateway · 2026-09-08 20:52:36
result
Found 81 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts:
  Line 30: describe("isLikelyBinary", () => {

  Line 31:   test("empty buffer is text", () => {

  Line 35:   test("ASCII text is text", () => {

  Line 40:   test("UTF-8 with CJK is text", () => {

  Line 45:   test("single NUL at offset 0 classifies as binary", () => {

  Line 49:   test("NUL byte anywhere in first 8 KB classifies as binary", () => {

  Line 56:   test("NUL beyond 8 KB is ignored (sniff window bounded)", () => {

  Line 63:   test("documented limitation: UTF-16LE text misclassified as binary", () => {

  Line 70: describe("classifyByExtension", () => {

  Line 71:   test("known text extensions return {isBinary: false}", () => {

  Line 80:   test("known-binary extensions return isBinary:true (no sniff)", () => {

  Line 99:   test("ambiguous extensions return null (caller must sniff)", () => {

  Line 117:   ...
gateway · 2026-09-08 20:52:47
result
Found 43 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts:
  Line 78: describe("getAnonymousToken", () => {

  Line 79:   test("returns token from successful response", async () => {

  Line 94:   test("throws UpgradeError on HTTP error", async () => {

  Line 103:   test("throws UpgradeError on network failure", async () => {

  Line 114:   test("throws UpgradeError when response has no token field", async () => {

  Line 130: describe("fetchNightlyManifest", () => {

  Line 131:   test("fetches manifest with correct headers", async () => {

  Line 156:   test("throws UpgradeError on HTTP error", async () => {

  Line 165:   test("throws UpgradeError on network failure", async () => {

  Line 177: describe("getNightlyVersion", () => {

  Line 178:   test("extracts version from manifest annotations", () => {

  Line 183:   test("throws UpgradeError when version annotation is missing", () => {

  ...
gateway · 2026-09-08 20:52:57
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 92: describe("getPlatformBinaryName", () => {

  Line 93:   test("returns a string starting with 'sentry-'", () => {

  Line 98:   test("contains platform and arch components", () => {

  Line 107:   test("has .exe suffix on windows platform name", () => {

  Line 119: describe("canAttemptDelta", () => {

  Line 120:   test("returns false for cross-channel upgrade (stable → nightly)", () => {

  Line 125:   test("returns false for dev build", () => {

  Line 130:   test("returns false for nightly target from dev build", () => {

  Line 138: describe("extractSha256", () => {

  Line 139:   test("extracts hex from sha256: prefixed digest", () => {

  Line 144:   test("returns null when no digest field", () => {

  Line 149:   test("returns null for empty digest", () => {

  Line 154:   ...
gateway · 2026-09-08 20:53:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts</path>
<type>file</type>
<content>
800: function mockFetch(
801:   fn: (url: string | URL | Request, init?: RequestInit) => Promise<Response>
802: ): void {
803:   globalThis.fetch = fn as typeof globalThis.fetch;
804: }
805: 
806: /** Store original fetch for restoration */
807: let originalFetch: typeof globalThis.fetch;
808: 
809: beforeEach(() => {
810:   originalFetch = globalThis.fetch;
811: });
812: 
813: afterEach(() => {
814:   globalThis.fetch = originalFetch;
815: });
816: 
817: // fetchRecentReleases
818: 
819: describe("fetchRecentReleases", () => {
820:   test("returns releases from GitHub API", async () => {
821:     const releases: GitHubRelease[] = [
822:       makeRelease("0.14.0", [makeAsset({ name: "sentry-linux-x64" })]),
823:       makeRelease("0.13.0", [makeAsset({ name: "sentry-linux-x64" })]),
824:     ];
825: 
826: ...
gateway · 2026-09-08 20:53:49
result
Found 24 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 23: } from "./delta-upgrade.js";

  Line 27: import { cleanupPatchCache } from "./patch-cache.js";

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 36: } from "./binary.js";

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 50: } from "./ghcr.js";

  Line 52: import { clearPatchCache } from "./patch-cache.js";

  Line 60: export type { InstallationMethod } from "./binary.js";

  Line 62: export { parseInstallationMethod } from "./binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/telemetry.ts:
  Line 19: import { isMusl } ...
gateway · 2026-09-08 20:54:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1000:     });
1001: 
1002:     proc.on("error", (err) => {
1003:       reject(
1004:         new UpgradeError("execution_failed", `brew failed: ${err.message}`)
1005:       );
1006:     });
1007:   });
1008: }
1009: 
1010: /**
1011:  * Execute upgrade via package manager global install.
1012:  *
1013:  * @param pm - Package manager to use
1014:  * @param version - Target version to install
1015:  * @throws {UpgradeError} When installation fails
1016:  */
1017: function executeUpgradePackageManager(
1018:   pm: PackageManager,
1019:   version: string
1020: ): Promise<void> {
1021:   return new Promise((resolve, reject) => {
1022:     const args =
1023:       pm === "yarn"
1024:         ? ["global", "add", `sentry@${version}`]
1025:         : ["install", "-g", `sentry@${version}`];
1026: 
1027:     // npm/pnpm/yarn are ...
gateway · 2026-09-08 20:54:45
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 393:   test("returns null for chain depth exceeding MAX_STABLE_CHAIN_DEPTH (10)", () => {

  Line 408:   test("handles exactly MAX_STABLE_CHAIN_DEPTH (10) hops", () => {

  Line 1056:     // 15 releases = 14 hops, exceeds MAX_STABLE_CHAIN_DEPTH (10)
gateway · 2026-09-08 20:54:55
result
No files found
gateway · 2026-09-08 20:55:07
result
Found 19 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 136:   fetchLatestFromGitHub,

  Line 138:   fetchLatestNightlyVersion,

  Line 189: describe("fetchLatestFromGitHub", () => {

  Line 204:     const version = await fetchLatestFromGitHub();

  Line 222:     const version = await fetchLatestFromGitHub();

  Line 240:     const version = await fetchLatestFromGitHub();

  Line 252:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 253:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 263:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 264:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 278:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 343: // fetchLatestNightlyVersion tests are in the dedicated describe block

  Line 1480: ...
gateway · 2026-09-08 20:55:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
100:     }) as (cmd: string, args: string[], opts: object) => FakeProc,
101:   },
102: }));
103: // Initialize with the real default now that fakeProcess is defined
104: spawnImpl.fn = () => fakeProcess(0);
105: 
106: vi.mock("node:child_process", async (importOriginal) => {
107:   const orig = await importOriginal<typeof import("node:child_process")>();
108:   return {
109:     ...orig,
110:     spawn: (cmd: string, args: string[], opts: object) =>
111:       spawnImpl.fn(cmd, args, opts),
112:   };
113: });
114: 
115: // Dynamic imports: must run AFTER vi.mock() so upgrade.ts picks up the
116: // mocked spawn.
117: import { isEnoentSpawnError } from "../../src/commands/cli/upgrade.js";
118: import {
119:   acquireLock,
120:   getBinaryDownloadUrl,
121:   isNightlyVersion,
122:   releaseLock,
123: } from ...
gateway · 2026-09-08 20:55:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1280:       paths.oldPath,
1281:       paths.lockPath,
1282:     ]) {
1283:       try {
1284:         await unlink(path);
1285:       } catch {
1286:         // Ignore
1287:       }
1288:     }
1289:     clearInstallInfo();
1290:   });
1291: 
1292:   test("downloads and decompresses gzip binary when .gz URL succeeds", async () => {
1293:     const mockBinaryContent = new Uint8Array([0x7f, 0x45, 0x4c, 0x46]); // ELF magic bytes
1294: 
1295:     // Compress the mock content with gzip
1296:     const gzipped = gzipSync(mockBinaryContent);
1297: 
1298:     // Mock fetch: first call returns gzipped content (.gz URL)
1299:     mockFetch(async () => new Response(gzipped, { status: 200 }));
1300: 
1301:     const result = await executeUpgrade("curl", "1.0.0");
1302: 
1303:     expect(result).not.toBeNull();
1304:     ...
gateway · 2026-09-08 20:55:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Command Tests
3:  *
4:  * Tests the `sentry cli upgrade` command through Stricli's run().
5:  * Covers resolveTargetVersion branches (check mode, already up-to-date,
6:  * version validation) and error paths.
7:  *
8:  * Status messages go through consola (→ process.stderr). Tests capture stderr
9:  * via a spy on process.stderr.write and assert on the collected output. ...
gateway · 2026-09-08 20:55:45
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 151: export function getBinaryDownloadUrl(version: string): string {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 204:     const version = await fetchLatestFromGitHub();

  Line 222:     const version = await fetchLatestFromGitHub();

  Line 240:     const version = await fetchLatestFromGitHub();

  Line ...
gateway · 2026-09-08 20:56:21
result
/**
 * Streaming TRDIFF10 Binary Patch Application
 *
 * Implements the bspatch algorithm for applying binary delta patches in the
 * TRDIFF10 format (produced by zig-bsdiff with `--use-zstd`). Designed for
 * minimal memory usage during CLI self-upgrades:
 *
 * - Old binary: read windows on demand via positional `read()` (`pread`)
 *   through a single-block read-ahead cache, so the base never sits fully in
 *   the JS heap — only the windows actually referenced are pulled in, served
 *   from the OS page cache populated by the reflink copy.
 * - Diff/extra blocks: streamed via `node:zlib` `createZstdDecompress()`
 * - Output: written incrementally to disk via `node:fs` createWriteStream
 *   with a large highWaterMark to collapse thousands of small write syscalls. ...
gateway · 2026-09-08 20:56:44
result
{
  "name": "binpatch",
  "version": "0.3.1",
  "type": "module",
  "license": "MIT",
  "description": "Reusable binary delta-update engine: apply TRDIFF10/bsdiff+zstd patch chains to a binary and discover chains from a pluggable source (OCI/GHCR or GitHub Releases). Pure Node, zero product coupling.",
  "author": "BYK",
  "homepage": "https://github.com/BYK/binpatch#readme",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/BYK/binpatch.git"
  },
  "bugs": {
    "url": "https://github.com/BYK/binpatch/issues"
  },
  "keywords": [
    "bsdiff",
    "bspatch",
    "trdiff10",
    "zstd",
    "binary",
    "delta",
    "patch",
    "update",
    "self-update",
    "oci",
    "ghcr"
  ],
  "main": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js"
    }
  },
  "files": [
    "dist/",
    "README.md",
    "LICENSE"
  ],
  "sideEffects": false,
  "engines": {
    "node": ...
gateway · 2026-09-08 20:56:56
result
import { createHash } from 'crypto';
import { copyFileSync, constants, createWriteStream } from 'fs';
import { open, unlink, readFile, readdir, mkdir, writeFile } from 'fs/promises';
import { tmpdir } from 'os';
import { join } from 'path';
import { Readable } from 'stream';
import { zstdDecompressSync, createZstdDecompress } from 'zlib';

// src/bspatch.ts
var TRDIFF10_MAGIC = "TRDIFF10";
var HEADER_SIZE = 32;
var MAX_OUTPUT_SIZE = 2 * 1024 * 1024 * 1024;
function offtin(buf, offset) {
  const view = new DataView(buf.buffer, buf.byteOffset + offset, 8);
  const lo = view.getUint32(0, true);
  const hi = view.getUint32(4, true);
  const magnitude = hi % 2147483648 * 4294967296 + lo;
  if (magnitude !== 0 && hi >= 2147483648) {
    return -magnitude;
  }
  return magnitude;
}
function parsePatchHeader(patch) {
  if (patch.byteLength < HEADER_SIZE) {
    throw new Error(
      `Patch too small: ${patch.byteLength} bytes (need at least ${HEADER_SIZE})`
    );
  }
  const magic = new ...
gateway · 2026-09-08 20:57:07
result
Found 17 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts:
  Line 4:  * These tests use `vi.mock()` to override `CLI_VERSION` from constants.js

  Line 9:  * `vi.mock()` would invert the assumptions of the dev-mode null-return

  Line 11:  * module graph, so the mocks here don't leak.

  Line 22: useTestConfigDir("delta-upgrade-mocked-");

  Line 32: vi.mock("../../src/lib/constants.js", async (importOriginal) => {

  Line 41: // Import AFTER mock setup so the mocked constants are used

  Line 50: // Fetch mock infrastructure

  Line 63: function mockFetch(

  Line 99:     // Set up fetch mocks — releases API + patch download

  Line 145:     mockFetch(async (url) => {

  Line 179:     mockFetch(async () => new Response("Error", { status: 500 }));

  Line 205:     mockFetch(async (url) => {

  Line 261:     mockFetch(async (url) => {

  Line 317:     // CLI_VERSION is mocked as ...
gateway · 2026-09-08 20:57:14
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Integration tests for delta upgrade orchestration with a non-dev CLI_VERSION.
3:  *
4:  * These tests use `vi.mock()` to override `CLI_VERSION` from constants.js
5:  * so that `canAttemptDelta()` passes its dev-build guard (the real `CLI_VERSION`
6:  * is "0.0.0-dev" in test mode, which short-circuits the orchestrator).
7:  *
8:  * Kept as a sibling file to `delta-upgrade.test.ts` because its
9:  * `vi.mock()` would invert the assumptions of the dev-mode null-return
10:  * tests in that file. Under `bun test --isolate` each file gets a fresh
11:  * module graph, so the mocks here don't leak. ...
gateway · 2026-09-08 20:57:22
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
gateway · 2026-09-08 20:57:33
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts:
  Line 159:   test("uses 'New nightly available:' label when on nightly channel", () => {

  Line 160:     setReleaseChannel("nightly");

  Line 165:     expect(notification).toContain("New nightly available:");

  Line 170:   test("uses 'Update available:' label when on stable channel", () => {

  Line 171:     setReleaseChannel("stable");

  Line 177:     expect(notification).not.toContain("New nightly available:");

  Line 386:     // Silence background fetch calls to GitHub API that would otherwise
gateway · 2026-09-08 20:57:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
1: /**
2:  * Release Notes Parser & Aggregation
3:  *
4:  * Extracts user-facing changelog entries from GitHub Release bodies (stable)
5:  * or conventional commit messages (nightly). Uses `marked.lexer()` for
6:  * AST-based section extraction and produces structured data that can be
7:  * re-serialized as filtered markdown for rendering via `renderMarkdown()`. ...
gateway · 2026-09-08 20:57:55
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.mocked.test.ts
gateway · 2026-09-08 20:58:03
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-08 20:58:16
result
Found 55 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 25:   fetchWithUpgradeError,

  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 28:   getBinaryFilename,

  Line 31:   getPlatformBinaryName,

  Line 33:   isNightlyVersion,

  Line 150:   const defaultPath = join(homedir(), ".sentry", "bin", getBinaryFilename());

  Line 378:   const response = await fetchWithUpgradeError(

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 410:   const response = await fetchWithUpgradeError(

  Line 532:   if (isNightlyVersion(version)) {

  Line 537:     const response = await fetchWithUpgradeError(

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 545:   const response = await fetchWithUpgradeError(

  Line 666:   return `${getPlatformBinaryName()}.gz`;

  Line 721:   const url = getBinaryDownloadUrl(version);

  Line 726:     const gzResponse ...
gateway · 2026-09-08 20:58:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Background version check for "new version available" notifications.
3:  *
4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the
5:  * latest nightly version via the OCI manifest annotation. For stable builds,
6:  * checks GitHub Releases. Results are cached in the database and shown on
7:  * subsequent runs.
8:  */
9: 
10: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
11: import * as Sentry from "@sentry/node-core/light";
12: import { compare as semverCompare } from "semver";
13: import { CLI_VERSION } from "./constants.js";
14: import { getReleaseChannel } from "./db/release-channel.js";
15: import {
16:   getVersionCheckInfo,
17:   markUpdateNotified,
18:   setVersionCheckInfo,
19: } from "./db/version-check.js";
20: ...
gateway · 2026-09-08 20:58:34
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts:
  Line 16:   GHCR_REPO,

  Line 82:         `https://ghcr.io/token?scope=repository:${GHCR_REPO}:pull`

  Line 136:       expect(String(url)).toContain(`/v2/${GHCR_REPO}/manifests/${GHCR_TAG}`);

  Line 374:       expect(String(url)).toContain(`/v2/${GHCR_REPO}/manifests/patch-0.13.0`);

  Line 417:       expect(String(url)).toContain(`/v2/${GHCR_REPO}/tags/list`);

  Line 539:         expect(String(url)).toContain(`/v2/${GHCR_REPO}/blobs/sha256:abc123`);
gateway · 2026-09-08 20:58:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
270: }
271: 
272: /**
273:  * Fetch wrapper that converts network errors to UpgradeError.
274:  * Handles DNS failures, timeouts, and other connection issues.
275:  *
276:  * @param url - URL to fetch
277:  * @param init - Fetch options
278:  * @param serviceName - Service name for error messages (e.g., "GitHub")
279:  * @returns Response object
280:  * @throws {UpgradeError} On network failure
281:  * @throws {Error} AbortError if signal is aborted (re-thrown as-is)
282:  */
283: export async function fetchWithUpgradeError(
284:   url: string,
285:   init: RequestInit,
286:   serviceName: string
287: ): Promise<Response> {
288:   try {
289:     return await customFetch(url, init);
290:   } catch (error) {
291:     // Re-throw AbortError as-is so callers can handle it specifically
292:     if (error instanceof Error && ...
gateway · 2026-09-08 20:59:05
result
 M .lore.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus
605e8318d chore: regenerate docs
gateway · 2026-09-08 20:59:51
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts:
  Line 64:         const baseUrl = "https://github.com/getsentry/cli/releases/download";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/auth-hint.ts:
  Line 8:  * UX feedback issue (getsentry/cli#785 #4). The hint surfaces the


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 40:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 79: export const NIGHTLY_TAG = "nightly";

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  ...
gateway · 2026-09-08 21:00:05
result
Found 55 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 375: export async function fetchLatestFromGitHub(

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 482:     ? fetchLatestFromGitHub()

  Line 527: export async function versionExists(

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 683: async function downloadNightlyToPath(

  Line 716: async function downloadStableToPath(

  Line 835:  * from GHCR using the OCI blob download protocol via {@link downloadNightlyToPath}.

  Line 838:  * {@link downloadStableToPath}. ...
gateway · 2026-09-08 21:00:18
result
Found 12 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts:
  Line 64:         const baseUrl = "https://github.com/getsentry/cli/releases/download";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 979:       "https://github.com/getsentry/cli/releases/download/"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 43:       "https://github.com/getsentry/cli/releases/download/"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts:
  Line 16:   GHCR_REPO,

  Line 82:         `https://ghcr.io/token?scope=repository:${GHCR_REPO}:pull`

  Line 136:       expect(String(url)).toContain(`/v2/${GHCR_REPO}/manifests/${GHCR_TAG}`);

  ...
gateway · 2026-09-08 21:01:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
560: 
561:   constructor(message: string, field?: string) {
562:     super(message, EXIT.VALIDATION);
563:     this.name = "ValidationError";
564:     this.field = field;
565:   }
566: }
567: 
568: /**
569:  * OAuth device flow errors (RFC 8628).
570:  *
571:  * @param code - OAuth error code (e.g., "authorization_pending", "slow_down")
572:  * @param description - Human-readable error description
573:  */
574: export class DeviceFlowError extends CliError {
575:   readonly code: string;
576: 
577:   constructor(code: string, description?: string) {
578:     super(description ?? code, EXIT.DEVICE_FLOW);
579:     this.name = "DeviceFlowError";
580:     this.code = code;
581:   }
582: }
583: 
584: // Upgrade Errors
585: 
586: export type UpgradeErrorReason =
587:   | "unknown_method"
588:   | "unsupported_operation"
589: ...
gateway · 2026-09-08 21:01:18
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/constants.ts:
  Line 17: import { MONOREPO_ROOTS as DSN_MONOREPO_ROOTS } from "../dsn/types.js";

  Line 226:  * Re-export MONOREPO_ROOTS so downstream scan-module consumers don't have

  Line 229: export const MONOREPO_ROOTS = DSN_MONOREPO_ROOTS;

  Line 245:  * two segments where the first is one of `MONOREPO_ROOTS`

  Line 256:     MONOREPO_ROOTS.includes(segments[0] as (typeof MONOREPO_ROOTS)[number])
gateway · 2026-09-08 21:01:26
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/sentry.ts:
  Line 4:  * Types representing Sentry API resources.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/config.ts:
  Line 85:    * Value: cached DSN entry with source and resolution info


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/jvm-bundle.ts:
  Line 80: /** Manifest shape expected by Sentry's symbolicator (symbolic source bundle). */

  Line 180:  * Build the Sentry source URL from a package-relative path.

  Line 293:   /** Process a single directory entry: recurse into dirs, collect source files. */


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/input-validation.ts:
  Line 21:  * Characters ...
gateway · 2026-09-08 21:01:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR Client Tests
3:  *
4:  * Unit tests for the GHCR/OCI download protocol helpers.
5:  * All HTTP calls are mocked via globalThis.fetch to avoid network access.
6:  */
7: 
8: import { afterEach, beforeEach, describe, expect, test } from "vitest";
9: import { UpgradeError } from "../../src/lib/errors.js";
10: import {
11:   downloadLayerBlob,
12:   downloadNightlyBlob,
13:   fetchManifest,
14:   fetchNightlyManifest,
15:   findLayerByFilename,
16:   GHCR_REPO,
17:   GHCR_TAG,
18:   getAnonymousToken,
19:   getNightlyVersion,
20:   listTags,
21:   type OciManifest,
22: } from "../../src/lib/ghcr.js";
23: 
24: /** Store original fetch for restoration */
25: let originalFetch: typeof globalThis.fetch;
26: 
27: /** Helper to mock fetch without TypeScript errors about missing Bun-specific properties */
28: ...
gateway · 2026-09-08 21:01:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.mocked.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Tests for installBinary's canonical() fallback when realpath throws on an
3:  * existing path. Kept in a separate file so the node:fs/promises mock doesn't
4:  * leak into binary.test.ts.
5:  */
6: 
7: import { chmodSync, mkdirSync, rmSync } from "node:fs";
8: import { readFile, writeFile } from "node:fs/promises";
9: import { join } from "node:path";
10: import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
11: 
12: // Mock only realpath to throw; everything else stays real via importOriginal.
13: vi.mock("node:fs/promises", async (importOriginal) => {
14:   const orig = await importOriginal<typeof import("node:fs/promises")>();
15:   return {
16:     ...orig,
17:     realpath: () =>
18:       Promise.reject(new Error("EACCES: permission denied (simulated)")),
19:   ...
gateway · 2026-09-08 21:01:52
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 194:     return new Response("Not Found", { status: 404 });

  Line 223:       return new Response("Not Found", { status: 404 });

  Line 226:     // npm registry fallback

  Line 234:     return new Response("Not Found", { status: 404 });

  Line 262:     return new Response("Not Found", { status: 404 });

  Line 413:         // Specific version check returns 404

  Line 414:         return new Response("Not Found", { status: 404 });

  Line 860:       return new Response("Not Found", { status: 404 });

  Line 993:       return new Response("Not Found", { status: 404 });
gateway · 2026-09-08 21:02:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
360:       expect(combined).toContain("Already up to date");
361:       expect(combined).not.toContain("Upgrading to");
362:     });
363:   });
364: 
365:   describe("brew method", () => {
366:     test("errors immediately when specific version requested with brew", async () => {
367:       // No fetch mock needed — error is thrown before any network call
368:       const { context, getOutput, errors, restore } = createMockContext({
369:         homeDir: testDir,
370:       });
371:       restoreStderr = restore;
372: 
373:       await run(app, ["cli", "upgrade", "--method", "brew", "1.2.3"], context);
374: 
375:       const allOutput = getOutput() + errors.join("");
376:       expect(allOutput).toContain(
377:         "Homebrew does not support installing a specific version"
378:       );
379:     ...
gateway · 2026-09-08 21:02:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts</path>
<type>file</type>
<content>
1: import { join } from "node:path";
2: import { makeCache, type PatchCache, type PatchChain } from "binpatch";
3: import { getConfigDir } from "./db/index.js";
4: 
5: export type { ChainMeta, PatchStepMeta } from "binpatch";
6: // biome-ignore lint/performance/noBarrelFile: preserve the existing cache API
7: export { chainFileName, patchFileName } from "binpatch";
8: 
9: function cache(): PatchCache {
10:   return makeCache(join(getConfigDir(), "patch-cache"));
11: }
12: 
13: export function savePatchesToCache(
14:   chain: Pick<PatchChain, "patches" | "expectedSha256">,
15:   steps: { fromVersion: string; toVersion: string }[]
16: ): Promise<void> {
17:   return cache().save(chain, steps);
18: }
19: 
20: export async function loadCachedChain(
21:   currentVersion: string,
22:   targetVersion: string
23: ): ...
gateway · 2026-09-08 21:03:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * E2E Test: Delta Upgrade via Binary Patching
3:  *
4:  * Downloads two consecutive stable release binaries from GitHub,
5:  * generates a TRDIFF10 patch using zig-bsdiff, and verifies that
6:  * our `applyPatch()` produces byte-identical output.
7:  *
8:  * Requires: zig-bsdiff binary available at /tmp/bsdiff (or via ZIG_BSDIFF_PATH env).
9:  * Skipped in CI unless ZIG_BSDIFF_PATH is set. ...
gateway · 2026-09-08 21:03:58
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/patch-cache.test.ts
/home/b...
gateway · 2026-09-08 21:04:09
result
Found 14 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 23: } from "./delta-upgrade.js";

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 36: } from "./binary.js";

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 50: } from "./ghcr.js";

  Line 60: export type { InstallationMethod } from "./binary.js";

  Line 62: export { parseInstallationMethod } from "./binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/telemetry.ts:
  Line 19: import { isMusl } from ...
gateway · 2026-09-08 21:04:39
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:   generate-patches:
431:     name: Generate Delta Patches
432:     needs: [changes, build-binary]
433:     # Only on main (nightlies) and release branches (stable) — skip PRs
434:     if: github.event_name != 'pull_request'
435:     runs-on: ubuntu-latest
436:     continue-on-error: true
437:     steps:
438:       - name: Install ORAS CLI
439:         # Only needed on main (to fetch previous nightly from GHCR)
440:         if: github.ref == 'refs/heads/main'
441:         run: |
442:           VERSION=1.3.1
443:           EXPECTED_SHA256="d52c4af76ce6a3ceb8579e51fb751a43ac051cca67f965f973a0b0e897a2bb86"
444:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"
445:           curl --retry 3 --retry-delay 5 --retry-all-errors -sfLo "$TARBALL" ...
gateway · 2026-09-08 21:04:47
result
No files found
gateway · 2026-09-08 21:04:54
result
No files found
gateway · 2026-09-08 21:05:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows</path>
<type>directory</type>
<entries>
changelog-preview.yml
ci.yml
cleanup-doc-previews.yml
cleanup-nightlies.yml
docs-preview.yml
eval-skill-fork.yml
pr-risk.yml
publish-codemod.yml
release.yml
sentry-release.yml

(10 entries)
</entries>
gateway · 2026-09-08 21:05:36
result
No files found
gateway · 2026-09-08 21:05:57
result
Found 10 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts:
  Line 154:   test("only feat/fix/perf commits pass through", () => {

  Line 161:         (commits) => {

  Line 162:           const sections = parseCommitMessages(commits);

  Line 172:   test("#skip-changelog commits are always filtered", () => {

  Line 175:         const commits = [

  Line 180:         const sections = parseCommitMessages(commits);

  Line 181:         // All commits have #skip-changelog, so no sections should be produced

  Line 188:   test("non-conventional commits produce no output", () => {

  Line 199:   test("round-trip: valid nightly versions extract correct timestamp", () => {

  Line 213:   test("stable versions return null", () => {
gateway · 2026-09-08 21:06:10
result
No files found
gateway · 2026-09-08 21:06:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Unit Tests for Release Notes Parser & Aggregation
3:  *
4:  * Tests core invariants (section extraction, version filtering, truncation)
5:  * that are hard to express as property-based tests due to format specifics.
6:  *
7:  * Core random-input invariants (category validity, filtering, commit parsing)
8:  * are tested via property-based tests in release-notes.property.test.ts.
9:  */
10: 
11: import { marked } from "marked";
12: import { describe, expect, test } from "vitest";
13: import type { GitHubRelease } from "../../src/lib/delta-upgrade.js";
14: import {
15:   buildChangelogSummary,
16:   type ChangeCategory,
17:   countListItems,
18:   extractNightlyTimestamp,
19:   extractSections,
20:   parseCommitMessages,
21: } from "../../src/lib/release-notes.js";
22: 
23: // ...
gateway · 2026-09-08 21:06:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-08 21:06:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
640:           resolve();
641:         }
642:       });
643:     });
644:   } catch (endErr) {
645:     if (streamError === undefined) {
646:       throw endErr;
647:     }
648:     log.debug(`writer.end failed after a stream error: ${String(endErr)}`);
649:   }
650: 
651:   if (streamError !== undefined) {
652:     throw streamError;
653:   }
654: }
655: 
656: /**
657:  * Build the gzip filename for the current platform binary.
658:  *
659:  * Nightly builds are stored in GHCR as `sentry-<os>-<arch>.gz` (or
660:  * `sentry-windows-x64.exe.gz` on Windows). This filename is the
661:  * `org.opencontainers.image.title` annotation on the matching OCI layer. ...
gateway · 2026-09-08 21:06:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
120:       // Only retry on timeout or network errors — not HTTP errors
121:       if (attempt >= GHCR_MAX_RETRIES || !isRetryableError(lastError)) {
122:         break;
123:       }
124:     }
125:   }
126: 
127:   throw new UpgradeError(
128:     "network_error",
129:     `${context}: ${lastError?.message ?? "unknown error"}`
130:   );
131: }
132: 
133: /** GHCR repository for CLI distribution */
134: export const GHCR_REPO = "getsentry/cli";
135: 
136: /** OCI tag for nightly builds */
137: export const GHCR_TAG = "nightly";
138: 
139: /** Base URL for GHCR registry API */
140: const GHCR_REGISTRY = "https://ghcr.io";
141: 
142: /** OCI manifest media type */
143: const OCI_MANIFEST_TYPE = "application/vnd.oci.image.manifest.v1+json";
144: 
145: /**
146:  * A single layer entry from an OCI manifest. ...
gateway · 2026-09-08 21:07:20
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/release.yml:
  Line 3:   workflow_dispatch:

  Line 6:         description: Version to release (or "auto")

  Line 9:         description: Force a release even when there are release-blockers

  Line 19:   # Pin Node to an exact patched version (single source of truth). A floating

  Line 26:   release:

  Line 44:     - name: Prepare release

  Line 45:       uses: getsentry/craft@v2
gateway · 2026-09-08 21:07:30
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml</path>
<type>file</type>
<content>
1: minVersion: '2.21.1'
2: changelog:
3:   policy: auto
4: versioning:
5:   policy: auto
6: preReleaseCommand: bash -c 'cd packages/cli && node --experimental-strip-types script/bump-version.ts --pre'
7: postReleaseCommand: bash -c 'cd packages/cli && node --experimental-strip-types script/bump-version.ts --post'
8: artifactProvider:
9:   name: github
10:   config:
11:     artifacts:
12:       Build:
13:         - '/^sentry-.*$/'
14:         - 'npm-package'
15:         - 'gh-pages'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: gh-pages
20:   - name: registry
21:     apps:
22:       'app:sentry':
23:         name: 'Sentry CLI'
24:         packageUrl: 'https://www.npmjs.com/package/sentry'
25:         mainDocsUrl: 'https://cli.sentry.dev'
26:         urlTemplate: ...
gateway · 2026-09-08 21:07:36
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml:
  Line 5:     branches: [main, release/**]

  Line 13: # packages:write is needed for publish-nightly to push to GHCR

  Line 14: # issues:write is needed for generate-patches to file issues on failure

  Line 21:   # Commit timestamp used for deterministic nightly version strings.

  Line 22:   # Defined at workflow level so build-binary and publish-nightly always agree.

  Line 33:   # CI Node.js versions, pinned to exact patches and used as the single source

  Line 40:   # ("24"/"22") silently reuses the runner's pre-cached buggy patch, so pin the

  Line 41:   # exact patched versions here and bump them in one place.

  Line 58:       skill: ${{ steps.filter.outputs.skill == 'true' || startsWith(github.ref, 'refs/heads/release/') }}

  Line 59:       code: ${{ steps.filter.outputs.code == 'true' || ...
gateway · 2026-09-08 21:08:25
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts
gateway · 2026-09-08 21:08:35
result
Found 19 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

  Line 972: describe("getBinaryDownloadUrl", () => {

  Line 974:     const url = getBinaryDownloadUrl("1.0.0");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 25:   getBinaryDownloadUrl,

  Line 37: describe("getBinaryDownloadUrl", () => {

  Line 39:     const url = getBinaryDownloadUrl("1.0.0");

  Line 53:     const url = getBinaryDownloadUrl("2.0.0");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 721:   const url = ...
gateway · 2026-09-08 21:08:46
result
Found 38 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 375: export async function fetchLatestFromGitHub(

  Line 443: export async function fetchLatestNightlyVersion(

  Line 479:     return fetchLatestNightlyVersion();

  Line 482:  ...
gateway · 2026-09-08 21:08:58
result
No files found
gateway · 2026-09-08 21:09:07
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/pnpm-lock.yaml:
  Line 116:       binpatch:

  Line 1795:   binpatch@0.3.1:

  Line 6019:   binpatch@0.3.1: {}
gateway · 2026-09-08 21:09:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-08 21:10:30
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 77: * **toolkit pre-rename subtree merge**: Chose importing getsentry/cli into an integration branch of getsentry/sentry-mcp, validating the complete monorepo there, then renaming it to getsentry/toolkit over renaming first because pre-rename validation preserves known MCP deployment wiring and makes rollback safer. Keep CLI at packages/cli and docs at apps/cli-docs; use a pnpm workspace without Turbo, independent cli@/mcp@ releases, root-managed patches/catalogs, and later incremental extraction into @sentry/toolkit-core.

  Line 94: * **getsentry/toolkit history-preserving monorepo import**: Chose getsentry/toolkit as a workspace-release monorepo, importing getsentry/cli main as the initial history and rewriting/importing MCP history under packages/mcp before merging histories. ...
gateway · 2026-09-08 21:11:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
520:             annotations: { version: "0.0.0-dev.1740393600" },
521:           }),
522:           { status: 200 }
523:         );
524:       }
525:       return new Response("Not Found", { status: 404 });
526:     });
527: 
528:     const version = await fetchLatestVersion("npm", "nightly");
529:     expect(version).toBe("0.0.0-dev.1740393600");
530:   });
531: 
532:   test("defaults to stable channel (uses GitHub) when channel omitted", async () => {
533:     mockFetch(
534:       async () =>
535:         new Response(JSON.stringify({ tag_name: "v3.0.0" }), {
536:           status: 200,
537:           headers: { "Content-Type": "application/json" },
538:         })
539:     );
540: 
541:     const version = await fetchLatestVersion("curl");
542:     expect(version).toBe("3.0.0");
543:   });
544: });
545: ...
gateway · 2026-09-08 21:11:54
result
Found 12 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts:
  Line 115:             size: 500,

  Line 155:       return new Response("Not Found", { status: 404 });

  Line 179:     mockFetch(async () => new Response("Error", { status: 500 }));

  Line 204:     // Mock GHCR: token exchange succeeds, nightly manifest has no .gz layer

  Line 236:       // listTags runs in parallel with fetchManifest — must not 404

  Line 240:       return new Response("Not Found", { status: 404 });

  Line 260:     // Mock GHCR: nightly manifest has .gz layer, but no patch tags

  Line 295:       return new Response("Not Found", { status: 404 });

  Line 332:     mockFetch(async () => new Response("Error", { status: 500 }));

  Line 365:             size: 500,

  Line 401:       return new Response("Not Found", { status: 404 });

  Line 477:       return new Response("Not Found", { status: 404 });
gateway · 2026-09-08 21:12:03
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/index.ts:
  Line 202:  * attachment downloads) can stream raw bytes without a string round-trip.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 40:  * getsentry/cli#785 item #10).

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 5:  * Binary management helpers (download URLs, locking, replacement) live in

  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 44:   downloadNightlyBlob,

  Line ...
gateway · 2026-09-08 21:16:24
result
Found 32 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml:
  Line 26:         urlTemplate: 'https://github.com/getsentry/cli/releases/download/{{version}}/{{file}}'

  Line 45:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-arm64.gz"

  Line 48:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-x64.gz"

  Line 55:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-arm64.gz"

  Line 58:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-x64.gz"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/CHANGELOG.md:
  Line 1130: - (docs) Overscroll popup — curl command + click-to-copy by @betegon in [#531](https://github.com/getsentry/cli/pull/531)

  Line 1587: - Replace curl pipe with direct binary download ...
gateway · 2026-09-08 21:16:44
result
Found 30 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/apps/cli-docs/astro.config.mjs:
  Line 60:           icon: "github",

  Line 62:           href: "https://github.com/getsentry/cli",

  Line 108:                 var command = 'curl https://cli.sentry.dev/install -fsS | bash';


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/apps/cli-docs/src/components/InstallSelector.astro:
  Line 22:     theme: 'github-dark',

  Line 49: <div class="install-selector">

  Line 50:   <div class="install-box">

  Line 91:   .install-selector {

  Line 97:   .install-box {

  Line 134:   .install-box.open .chevron {

  Line 223:   .install-box.open .dropdown-menu {

  Line 270:     .install-selector {

  Line 274:     .install-box {

  Line 299:       document.querySelectorAll('.install-selector').forEach(function(selector) {

  Line 300:         const installBox = ...
gateway · 2026-09-08 21:16:57
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/db/install-info.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/db/install-info.test.ts
gateway · 2026-09-08 21:17:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
1: #!/bin/bash
2: set -euo pipefail
3: 
4: RED='\033[0;31m'
5: MUTED='\033[0;2m'
6: NC='\033[0m'
7: 
8: # Sentry error telemetry — fire-and-forget error reporting via envelope API.
9: # Uses the CLI's public write-only DSN. No PII collected.
10: # Opt-out: SENTRY_CLI_NO_TELEMETRY=1
11: SENTRY_DSN_KEY="1188a86f3f8168f089450587b00bca66"
12: SENTRY_INGEST="https://o1.ingest.us.sentry.io"
13: SENTRY_PROJECT_ID="4510776311808000"
14: 
15: # Generate a UUID for the event. Tries /proc, uuidgen, then awk fallback. ...
gateway · 2026-09-08 21:17:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
289:   # Strip leading 'v' if present (releases use version without 'v' prefix)
290:   version="${version#v}"
291:   filename="sentry-${os}-${arch}${libc_suffix}${suffix}"
292:   url="https://github.com/getsentry/cli/releases/download/${version}/${filename}"
293: 
294:   echo -e "${MUTED}Downloading sentry v${version}...${NC}"
295: 
296:   # Try gzip-compressed download first (~60% smaller, ~37 MB vs ~99 MB).
297:   # gunzip is POSIX and available on all Unix systems.
298:   # Falls back to raw binary if the .gz asset doesn't exist yet.
299:   if curl -fsSL "${url}.gz" 2>/dev/null | gunzip > "$tmp_binary" 2>/dev/null; then
300:     : # Compressed download succeeded
301:   else
302:     curl -fsSL --progress-bar "$url" -o "$tmp_binary"
303:   fi
304: fi
305: 
306: chmod +x "$tmp_binary"
307: 
308: # Delegate installation and ...
gateway · 2026-09-08 21:17:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Install Script Tests
3:  *
4:  * Exercises the shell installer with fake download tools so argument parsing and
5:  * setup delegation can be validated without network access.
6:  */
7: 
8: import { spawn } from "node:child_process";
9: import {
10:   chmodSync,
11:   mkdirSync,
12:   mkdtempSync,
13:   readFileSync,
14:   rmSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { tmpdir } from "node:os";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: 
21: function noop(): void {
22:   // Intentionally empty — absorbs async spawn errors
23: }
24: 
25: const repoRoot = join(import.meta.dirname, "..", "..");
26: const installScript = join(repoRoot, "install");
27: 
28: describe("install script", () => {
29:   let ...
gateway · 2026-09-08 21:17:51
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-08 21:18:08
<!-- lore-recall:631b361e-55d4-4ff0-8af5-9e09d5c46237 --><!-- lore-recall:72a75730-85dd-4b12-a6aa-a527044da893 -->
gpt-5.6-sol · 2026-09-08 21:18:08 · ~56 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-08 21:18:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
330:       expectedFrom: previousVersion,
331:       patchLayerName,
332:       sizeLimit: opts.fullGzSize * SIZE_THRESHOLD_RATIO - totalSize,
333:     });
334:     if (!result.ok) {
335:       Sentry.getActiveSpan()?.setAttribute(
336:         "telemetry_reason",
337:         result.failure.reason
338:       );
339:       return null;
340:     }
341:     const toVersion = tag.slice(PATCH_TAG_PREFIX.length);
342:     digests.push(result.digest);
343:     totalSize += result.size;
344:     steps.push({ fromVersion: previousVersion, toVersion });
345:     previousVersion = toVersion;
346:     if (index === manifests.length - 1) {
347:       expectedSha256 = getPatchTargetSha256(manifest, binaryName) ?? "";
348:     }
349:   }
350:   if (previousVersion !== opts.targetVersion || !expectedSha256) {
351:     ...
gateway · 2026-09-08 21:18:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-08 21:18:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts</path>
<type>file</type>
<content>
760:     const manifest = makePatchManifest("0.0.9", {}, [
761:       makeLayer(PATCH_LAYER_NAME, 200_000),
762:     ]);
763:     const result = validateChainStep(manifest, {
764:       expectedFrom: "0.0.9",
765:       patchLayerName: PATCH_LAYER_NAME,
766:       sizeLimit: 100_000,
767:     });
768:     expect(result).toEqual({
769:       ok: false,
770:       failure: {
771:         reason: "size-exceeded",
772:         layerSize: 200_000,
773:         budget: 100_000,
774:       },
775:     });
776:   });
777: 
778:   test("returns ok with digest and size on success", () => {
779:     const manifest = makePatchManifest("0.0.9", {}, [
780:       makeLayer(PATCH_LAYER_NAME, 500),
781:     ]);
782:     const result = validateChainStep(manifest, {
783:       expectedFrom: "0.0.9",
784:       ...
gateway · 2026-09-08 21:19:02
result
Found 19 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts:
  Line 44:   attemptDeltaUpgrade,

  Line 45:   resolveNightlyDelta,

  Line 46:   resolveStableDelta,

  Line 89: // resolveStableDelta

  Line 92: describe("resolveStableDelta", () => {

  Line 101:     // we expect resolveStableDelta to throw, but the chain resolution should succeed

  Line 159:       // resolveStableDelta will:

  Line 166:         resolveStableDelta("0.14.0", oldBinaryPath, destPath)

  Line 182:       const result = await resolveStableDelta(

  Line 195: // resolveNightlyDelta

  Line 198: describe("resolveNightlyDelta", () => {

  Line 244:       const result = await resolveNightlyDelta(

  Line 299:       const result = await resolveNightlyDelta(

  Line 312: // attemptDeltaUpgrade

  Line 315: describe("attemptDeltaUpgrade", () => {

  Line 318:     const result = await attemptDeltaUpgrade(

  ...
gateway · 2026-09-08 21:19:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Integration tests for delta upgrade orchestration with a non-dev CLI_VERSION.
3:  *
4:  * These tests use `vi.mock()` to override `CLI_VERSION` from constants.js
5:  * so that `canAttemptDelta()` passes its dev-build guard (the real `CLI_VERSION`
6:  * is "0.0.0-dev" in test mode, which short-circuits the orchestrator).
7:  *
8:  * Kept as a sibling file to `delta-upgrade.test.ts` because its
9:  * `vi.mock()` would invert the assumptions of the dev-mode null-return
10:  * tests in that file. Under `bun test --isolate` each file gets a fresh
11:  * module graph, so the mocks here don't leak. ...
gateway · 2026-09-08 21:19:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
530:   for (const category of CATEGORY_ORDER) {
531:     const descriptions = items.get(category);
532:     if (descriptions && descriptions.length > 0) {
533:       const markdown = `${descriptions.map((d) => `- ${d}`).join("\n")}\n`;
534:       sections.push({ category, markdown });
535:     }
536:   }
537: 
538:   return sections;
539: }
540: 
541: // ────────────────────────────── Fetch Functions ────────────────────────────
542: 
543: /**
544:  * Max releases to fetch for changelog purposes.
545:  *
546:  * Higher than the delta-upgrade cap (12) to cover larger version jumps.
547:  * GitHub API max per_page is 100; 30 covers ~6+ months of weekly releases.
548:  */
549: const CHANGELOG_MAX_RELEASES = 30;
550: 
551: /**
552:  * Fetch recent releases from GitHub for changelog building. ...
gateway · 2026-09-08 21:20:17
result
No files found
gateway · 2026-09-08 21:20:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management Tests
3:  *
4:  * Tests for shared binary helpers: install directory selection, paths,
5:  * download URLs, locking, and binary installation.
6:  */
7: 
8: import {
9:   chmodSync,
10:   mkdirSync,
11:   readFileSync,
12:   realpathSync,
13:   rmSync,
14:   symlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { access, readFile, writeFile } from "node:fs/promises";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: import {
21:   acquireLock,
22:   compareVersions,
23:   determineInstallDir,
24:   fetchWithUpgradeError,
25:   getBinaryDownloadUrl,
26:   getBinaryFilename,
27:   getBinaryPaths,
28:   getPlatformBinaryName,
29:   installBinary,
30:   isDowngrade,
31:   isMusl,
32:   releaseLock,
33:   ...
gateway · 2026-09-08 21:20:36
result
Found 49 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 24: import { gzipSync } from "node:zlib";

  Line 134:   downloadBinaryToTemp,

  Line 344: // below (around line 1153) which tests the GHCR-based implementation.

  Line 488:   test("uses GHCR manifest when channel is nightly (curl method)", async () => {

  Line 489:     // Nightly version is now fetched from GHCR manifest annotation, not version.json

  Line 510:   test("uses GHCR manifest when channel is nightly (npm method)", async () => {

  Line 511:     // Even npm method uses GHCR when channel=nightly (nightly is curl-only distribution)

  Line 632:   test("checks GHCR for nightly version - version exists", async () => {

  Line 649:   test("checks GHCR for nightly version - version does not exist", async () => {

  Line 665:   test("checks GHCR for nightly version regardless of install method", async () => {

  Line ...
gateway · 2026-09-08 21:20:46
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1260:   }
1261: 
1262:   beforeEach(() => {
1263:     // Redirect getCurlInstallPaths() to temp dir instead of ~/.sentry/bin/
1264:     clearInstallInfo();
1265:     mkdirSync(upgradeBinDir, { recursive: true });
1266:     setInstallInfo({
1267:       method: "curl",
1268:       path: upgradeInstallPath,
1269:       version: "0.0.0",
1270:     });
1271:   });
1272: 
1273:   afterEach(async () => {
1274:     globalThis.fetch = originalFetch;
1275:     // Clean up test files - get fresh paths in case DB changed
1276:     const paths = getTestPaths();
1277:     for (const path of [
1278:       paths.installPath,
1279:       paths.tempPath,
1280:       paths.oldPath,
1281:       paths.lockPath,
1282:     ]) {
1283:       try {
1284:         await unlink(path);
1285:       } catch {
1286:         // Ignore
1287:      ...
gateway · 2026-09-08 21:21:49
result
Found 35 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts:
  Line 17: import { spawn } from "node:child_process";

  Line 18: import { homedir } from "node:os";

  Line 19: import { dirname } from "node:path";

  Line 20: import { setTimeout } from "node:timers/promises";

  Line 21: import type { SentryContext } from "../../context.js";

  Line 22: import {

  Line 27: import { buildCommand } from "../../lib/command.js";

  Line 28: import { CLI_VERSION } from "../../lib/constants.js";

  Line 29: import {

  Line 34: import { getVersionCheckInfo } from "../../lib/db/version-check.js";

  Line 35: import { UpgradeError } from "../../lib/errors.js";

  Line 36: import { formatUpgradeResult } from "../../lib/formatters/human.js";

  Line 37: import { formatBytes } from "../../lib/formatters/numbers.js";

  Line 38: import { CommandOutput } from "../../lib/formatters/output.js";

  Line 39: ...
gateway · 2026-09-08 21:22:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
250:       "Offline upgrade is only supported for curl-installed binaries."
251:     );
252:   }
253: }
254: 
255: type ResolveTargetOptions = {
256:   method: InstallationMethod;
257:   channel: ReleaseChannel;
258:   versionArg: string | undefined;
259:   channelChanged: boolean;
260:   flags: UpgradeFlags;
261: };
262: 
263: /**
264:  * Result of resolving the target version.
265:  *
266:  * - `target`: the version string to upgrade/downgrade to (proceed with upgrade)
267:  * - `UpgradeResult`: structured result when no upgrade should proceed
268:  *   (check-only mode, or already up to date)
269:  */
270: type ResolveResult =
271:   | { kind: "target"; target: string }
272:   | { kind: "done"; result: UpgradeResult };
273: 
274: /**
275:  * Resolve the target version and handle check-only mode. ...
gateway · 2026-09-08 21:22:57
result
Found 11 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 23:   customFetch,

  Line 26: import { stringifyUnknown, UpgradeError } from "./errors.js";

  Line 265: export function getGitHubHeaders(): Record<string, string> {

  Line 273:  * Fetch wrapper that converts network errors to UpgradeError.

  Line 280:  * @throws {UpgradeError} On network failure

  Line 283: export async function fetchWithUpgradeError(

  Line 289:     return await customFetch(url, init);

  Line 296:       throw new UpgradeError("network_error", buildTlsErrorDetail(error));

  Line 299:     throw new UpgradeError(

  Line 369:  * @throws {UpgradeError} If another upgrade/install is already in progress

  Line 429:     throw new UpgradeError(
gateway · 2026-09-08 21:23:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
260: }
261: 
262: /**
263:  * Build headers for GitHub API requests.
264:  */
265: export function getGitHubHeaders(): Record<string, string> {
266:   return {
267:     Accept: "application/vnd.github.v3+json",
268:     "User-Agent": getUserAgent(),
269:   };
270: }
271: 
272: /**
273:  * Fetch wrapper that converts network errors to UpgradeError.
274:  * Handles DNS failures, timeouts, and other connection issues.
275:  *
276:  * @param url - URL to fetch
277:  * @param init - Fetch options
278:  * @param serviceName - Service name for error messages (e.g., "GitHub")
279:  * @returns Response object
280:  * @throws {UpgradeError} On network failure
281:  * @throws {Error} AbortError if signal is aborted (re-thrown as-is)
282:  */
283: export async function fetchWithUpgradeError(
284:   url: string,
285:   init: ...
gateway · 2026-09-08 21:23:16
result
Found 32 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 136:   fetchLatestFromGitHub,

  Line 139:   fetchLatestVersion,

  Line 189: describe("fetchLatestFromGitHub", () => {

  Line 195:             tag_name: "v1.2.3",

  Line 204:     const version = await fetchLatestFromGitHub();

  Line 213:             tag_name: "v0.5.0",

  Line 222:     const version = await fetchLatestFromGitHub();

  Line 231:             tag_name: "1.0.0",

  Line 240:     const version = await fetchLatestFromGitHub();

  Line 252:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 253:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 254:       "Failed to fetch from GitHub: 404"

  Line 263:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 264:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 269:   ...
gateway · 2026-09-08 21:23:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
180:   });
181: 
182:   test("throws on invalid method", () => {
183:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
184:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
185:     expect(() => parseInstallationMethod("")).toThrow("Invalid method: ");
186:   });
187: });
188: 
189: describe("fetchLatestFromGitHub", () => {
190:   test("returns version from GitHub API", async () => {
191:     mockFetch(
192:       async () =>
193:         new Response(
194:           JSON.stringify({
195:             tag_name: "v1.2.3",
196:           }),
197:           {
198:             status: 200,
199:             headers: { "Content-Type": "application/json" },
200:           }
201:         )
202:     );
203: 
204:     const version = await ...
gateway · 2026-09-08 21:23:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
460: /**
461:  * List tags in the GHCR repository, optionally filtered by prefix.
462:  *
463:  * Uses the OCI Distribution Spec `/v2/<name>/tags/list` endpoint with
464:  * pagination. Returns tags sorted lexicographically by the registry.
465:  *
466:  * @param token - Anonymous bearer token from {@link getAnonymousToken}
467:  * @param prefix - Optional prefix filter (e.g., "nightly-" to list versioned nightlies)
468:  * @returns Array of matching tag strings
469:  * @throws {UpgradeError} On network failure
470:  */
471: export async function listTags(
472:   token: string,
473:   prefix?: string,
474:   signal?: AbortSignal
475: ): Promise<string[]> {
476:   const allTags: string[] = [];
477:   let lastTag: string | undefined;
478: 
479:   for (;;) {
480:     const tags = await fetchTagPage(token, lastTag, ...
gateway · 2026-09-08 21:24:19
result
Found 51 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 14: import { getReleaseChannel } from "./db/release-channel.js";

  Line 16:   getVersionCheckInfo,

  Line 18:   setVersionCheckInfo,

  Line 74:   const { lastChecked } = getVersionCheckInfo();

  Line 170:   const channel = getReleaseChannel();

  Line 185:         setVersionCheckInfo(latestVersion);

  Line 268:     const { latestVersion, lastNotified } = getVersionCheckInfo();

  Line 307:   const channel = getReleaseChannel();


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 38: import { getInstallInfo, setInstallInfo } from "./db/install-info.js";

  Line 133:   const stored = getInstallInfo();

  Line 340:   const stored = getInstallInfo();

  Line 352:       ...
gateway · 2026-09-08 21:24:30
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Background version check for "new version available" notifications.
3:  *
4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the
5:  * latest nightly version via the OCI manifest annotation. For stable builds,
6:  * checks GitHub Releases. Results are cached in the database and shown on
7:  * subsequent runs.
8:  */
9: 
10: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
11: import * as Sentry from "@sentry/node-core/light";
12: import { compare as semverCompare } from "semver";
13: import { CLI_VERSION } from "./constants.js";
14: import { getReleaseChannel } from "./db/release-channel.js";
15: import {
16:   getVersionCheckInfo,
17:   markUpdateNotified,
18:   setVersionCheckInfo,
19: } from "./db/version-check.js";
20: ...
gateway · 2026-09-08 21:24:45
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts:
  Line 2: import { makeCache, type PatchCache, type PatchChain } from "binpatch";

  Line 5: export type { ChainMeta, PatchStepMeta } from "binpatch";

  Line 7: export { chainFileName, patchFileName } from "binpatch";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/bspatch.test.ts:
  Line 26: } from "binpatch";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/bspatch.property.test.ts:
  Line 8: import { offtin, parsePatchHeader } from "binpatch";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 1: /** Delta upgrade discovery and application backed by binpatch. ...
gateway · 2026-09-08 21:24:54
result
Found 15 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 199:  * Mock fetch to simulate GitHub releases API returning a specific version.

  Line 202: function mockGitHubVersion(version: string): void {

  Line 206:     // GitHub latest release endpoint — returns JSON with tag_name

  Line 214:     // GitHub tag check (for versionExists) — this repo uses un-prefixed tags

  Line 243:  * Used by nightly channel tests — replaces the old GitHub version.json mock.

  Line 288:       mockGitHubVersion(CLI_VERSION);

  Line 308:       mockGitHubVersion("99.99.99");

  Line 327:       mockGitHubVersion("99.99.99");

  Line 350:       mockGitHubVersion(CLI_VERSION);

  Line 382:       mockGitHubVersion("99.99.99");

  Line 424:       // Stricli catches errors and writes to stderr / calls exit

  Line 430:       mockGitHubVersion(CLI_VERSION);

  Line 537:       ...
gateway · 2026-09-08 21:25:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
180:         JSON.stringify({
181:           schemaVersion: 2,
182:           layers: [],
183:           annotations: { version },
184:         }),
185:         {
186:           status: 200,
187:           headers: {
188:             "content-type": "application/vnd.oci.image.manifest.v1+json",
189:           },
190:         }
191:       );
192:     }
193: 
194:     return new Response("Not Found", { status: 404 });
195:   });
196: }
197: 
198: /**
199:  * Mock fetch to simulate GitHub releases API returning a specific version.
200:  * Handles the latest release endpoint, version-exists check, and npm registry. ...
gateway · 2026-09-08 21:25:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
710:       .mockImplementation((cmd: string, args?: readonly string[]) => {
711:         spawnedArgs.push({ cmd, args: [...(args ?? [])] });
712:         return fakeChildProcess(0);
713:       });
714:   });
715: 
716:   afterEach(async () => {
717:     restoreStderr?.();
718:     restoreStderr = undefined;
719:     globalThis.fetch = originalFetch;
720:     spawnSpy.mockRestore();
721:     rmSync(testDir, { recursive: true, force: true });
722: 
723:     // Clean up any temp binary files written to the redirected install path
724:     for (const suffix of ["", ".download", ".old", ".lock"]) {
725:       try {
726:         await unlink(join(spawnBinDir, `${binName}${suffix}`));
727:       } catch {
728:         // Ignore
729:       }
730:     }
731:     clearInstallInfo();
732:   });
733: 
734:   ...
gateway · 2026-09-08 21:25:21
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 393:   test("returns null for chain depth exceeding MAX_STABLE_CHAIN_DEPTH (10)", () => {

  Line 408:   test("handles exactly MAX_STABLE_CHAIN_DEPTH (10) hops", () => {

  Line 657:     // chains allow up to MAX_NIGHTLY_CHAIN_DEPTH (30) hops

  Line 1056:     // 15 releases = 14 hops, exceeds MAX_STABLE_CHAIN_DEPTH (10)

  Line 1197:   test("returns null when chain depth exceeds MAX_NIGHTLY_CHAIN_DEPTH (30)", async () => {
gateway · 2026-09-08 21:25:32
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 24:   PATCH_TAG_PREFIX,

  Line 62:   PATCH_TAG_PREFIX,

  Line 80:   return `patch-chain:${fromVersion}-${toVersion}`;

  Line 119:   return instrumentCache(makeCache(join(getConfigDir(), "patch-cache")));

  Line 252:       item.annotations?.["org.opencontainers.image.title"] ===

  Line 294:     (await client.listTags(opts.token, PATCH_TAG_PREFIX, opts.signal));

  Line 341:     const toVersion = tag.slice(PATCH_TAG_PREFIX.length);
gateway · 2026-09-08 21:25:40
result
No files found
gateway · 2026-09-08 21:25:51
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/vitest.config.ts
gateway · 2026-09-08 21:26:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/vitest.config.ts</path>
<type>file</type>
<content>
1: import { existsSync } from "node:fs";
2: import { dirname, join } from "node:path";
3: import { defineConfig, type Plugin } from "vitest/config";
4: 
5: const JS_EXT_RE = /\.js$/;
6: 
7: /**
8:  * Vite plugin to rewrite lazy `require("./relative/path.js")` calls in
9:  * `.ts` source files to the corresponding `.ts` path when the `.ts` file
10:  * exists on disk. Node.js `require()` bypasses Vite's resolve pipeline,
11:  * so `resolve.extensions` doesn't apply.
12:  */
13: function requireJsToTsPlugin(): Plugin {
14:   return {
15:     name: "require-js-to-ts",
16:     enforce: "pre",
17:     transform(code, id) {
18:       if (!(id.endsWith(".ts") && code.includes("require("))) {
19:         return;
20:       }
21:       let changed = false;
22:       const transformed = code.replace(
23:         ...
gateway · 2026-09-08 21:26:43
result
{
  "name": "binpatch",
  "version": "0.3.1",
  "type": "module",
  "license": "MIT",
  "description": "Reusable binary delta-update engine: apply TRDIFF10/bsdiff+zstd patch chains to a binary and discover chains from a pluggable source (OCI/GHCR or GitHub Releases). Pure Node, zero product coupling.",
  "author": "BYK",
  "homepage": "https://github.com/BYK/binpatch#readme",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/BYK/binpatch.git"
  },
  "bugs": {
    "url": "https://github.com/BYK/binpatch/issues"
  },
  "keywords": [
    "bsdiff",
    "bspatch",
    "trdiff10",
    "zstd",
    "binary",
    "delta",
    "patch",
    "update",
    "self-update",
    "oci",
    "ghcr"
  ],
  "main": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js"
    }
  },
  "files": [
    "dist/",
    "README.md",
    "LICENSE"
  ],
  "sideEffects": false,
  "engines": {
    "node": ...
gateway · 2026-09-08 21:26:53
result
/**
 * Streaming TRDIFF10 Binary Patch Application
 *
 * Implements the bspatch algorithm for applying binary delta patches in the
 * TRDIFF10 format (produced by zig-bsdiff with `--use-zstd`). Designed for
 * minimal memory usage during CLI self-upgrades:
 *
 * - Old binary: read windows on demand via positional `read()` (`pread`)
 *   through a single-block read-ahead cache, so the base never sits fully in
 *   the JS heap — only the windows actually referenced are pulled in, served
 *   from the OS page cache populated by the reflink copy.
 * - Diff/extra blocks: streamed via `node:zlib` `createZstdDecompress()`
 * - Output: written incrementally to disk via `node:fs` createWriteStream
 *   with a large highWaterMark to collapse thousands of small write syscalls. ...
gateway · 2026-09-08 21:27:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-08 21:27:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
650: 
651:   if (streamError !== undefined) {
652:     throw streamError;
653:   }
654: }
655: 
656: /**
657:  * Build the gzip filename for the current platform binary.
658:  *
659:  * Nightly builds are stored in GHCR as `sentry-<os>-<arch>.gz` (or
660:  * `sentry-windows-x64.exe.gz` on Windows). This filename is the
661:  * `org.opencontainers.image.title` annotation on the matching OCI layer.
662:  *
663:  * @returns Filename of the gzip-compressed binary for this platform
664:  */
665: function getNightlyGzFilename(): string {
666:   return `${getPlatformBinaryName()}.gz`;
667: }
668: 
669: /**
670:  * Download a nightly binary from GHCR and decompress it to `destPath`.
671:  *
672:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
673:  * matching this platform's `.gz` filename, then ...
gateway · 2026-09-08 21:27:54
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/pnpm-lock.yaml:
  Line 3270:   patch-console@2.0.0:

  Line 6975:       patch-console: 2.0.0

  Line 7852:   patch-console@2.0.0: {}


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml:
  Line 26:         urlTemplate: 'https://github.com/getsentry/cli/releases/download/{{version}}/{{file}}'

  Line 45:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-arm64.gz"

  Line 48:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-x64.gz"

  Line 55:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-arm64.gz"

  Line 58:             url ...
gateway · 2026-09-08 21:28:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
120:       // Only retry on timeout or network errors — not HTTP errors
121:       if (attempt >= GHCR_MAX_RETRIES || !isRetryableError(lastError)) {
122:         break;
123:       }
124:     }
125:   }
126: 
127:   throw new UpgradeError(
128:     "network_error",
129:     `${context}: ${lastError?.message ?? "unknown error"}`
130:   );
131: }
132: 
133: /** GHCR repository for CLI distribution */
134: export const GHCR_REPO = "getsentry/cli";
135: 
136: /** OCI tag for nightly builds */
137: export const GHCR_TAG = "nightly";
138: 
139: /** Base URL for GHCR registry API */
140: const GHCR_REGISTRY = "https://ghcr.io";
141: 
142: /** OCI manifest media type */
143: const OCI_MANIFEST_TYPE = "application/vnd.oci.image.manifest.v1+json";
144: 
145: /**
146:  * A single layer entry from an OCI manifest. ...
gateway · 2026-09-08 21:28:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml</path>
<type>file</type>
<content>
440:         if: github.ref == 'refs/heads/main'
441:         run: |
442:           VERSION=1.3.1
443:           EXPECTED_SHA256="d52c4af76ce6a3ceb8579e51fb751a43ac051cca67f965f973a0b0e897a2bb86"
444:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"
445:           curl --retry 3 --retry-delay 5 --retry-all-errors -sfLo "$TARBALL" "https://github.com/oras-project/oras/releases/download/v${VERSION}/${TARBALL}"
446:           echo "${EXPECTED_SHA256}  ${TARBALL}" | sha256sum -c -
447:           tar -xz -C /usr/local/bin oras < "$TARBALL"
448:           rm "$TARBALL"
449: 
450:       - name: Install zig-bsdiff
451:         run: |
452:           VERSION=0.1.19
453:           EXPECTED_SHA256="9f1ac75a133ee09883ad2096a86d57791513de5fc6f262dfadee8dcee94a71b9"
454:           TARBALL="zig-bsdiff-linux-x64.tar.gz"
455:           ...
gateway · 2026-09-08 21:29:07
result
import { createHash } from 'crypto';
import { copyFileSync, constants, createWriteStream } from 'fs';
import { open, unlink, readFile, readdir, mkdir, writeFile } from 'fs/promises';
import { tmpdir } from 'os';
import { join } from 'path';
import { Readable } from 'stream';
import { zstdDecompressSync, createZstdDecompress } from 'zlib';

// src/bspatch.ts
var TRDIFF10_MAGIC = "TRDIFF10";
var HEADER_SIZE = 32;
var MAX_OUTPUT_SIZE = 2 * 1024 * 1024 * 1024;
function offtin(buf, offset) {
  const view = new DataView(buf.buffer, buf.byteOffset + offset, 8);
  const lo = view.getUint32(0, true);
  const hi = view.getUint32(4, true);
  const magnitude = hi % 2147483648 * 4294967296 + lo;
  if (magnitude !== 0 && hi >= 2147483648) {
    return -magnitude;
  }
  return magnitude;
}
function parsePatchHeader(patch) {
  if (patch.byteLength < HEADER_SIZE) {
    throw new Error(
      `Patch too small: ${patch.byteLength} bytes (need at least ${HEADER_SIZE})`
    );
  }
  const magic = new ...
gateway · 2026-09-08 21:29:55
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts:
  Line 37: export const BINARY_EXTENSIONS: ReadonlySet<string> = new Set([

  Line 134: export function isLikelyBinary(head: Uint8Array): boolean {

  Line 157: export function classifyByExtension(

  Line 185: export async function readHeadAndSniff(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 30: export const KNOWN_CURL_DIRS = [".local/bin", "bin", ".sentry/bin"];

  Line 40: export type InstallationMethod =

  Line 50: const VALID_METHODS: InstallationMethod[] = [

  Line 66: export function parseInstallationMethod(value: string): InstallationMethod {

  Line 92: export function isMusl(): boolean {

  Line 130: export function getPlatformBinaryName(): string {

  Line 151: export function getBinaryDownloadUrl(version: string): string {

  ...
gateway · 2026-09-08 21:30:09
result
Found 32 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 8: * **atomicWriteFile skill installation**: Chose same-directory temporary writes followed by \`rename()\` over writing skill destinations directly because concurrent readers must never observe truncated content. Temporary names are dot-prefixed \`\*.tmp\` paths that cannot match \`SKILL.md\` or \`\*.md\` discovery globs. \`installAgentSkills()\` writes only beneath pre-existing \`.agents\` or \`.claude\` roots; creating those roots would falsely signal that an agent is installed.

  Line 11: * **Binary size breakdown: 94.5% is Node.js runtime — bundled code is ~6.3 MiB**: Binary composition (linux-x64, Node 24 LTS): Node.js runtime=121 MiB (ships with debug symbols). \`strip --strip-unneeded\` → 99 MiB (-17 MiB raw, -4 MiB compressed). Strip built into fossilize 0.7.0 — happens on the copied binary BEFORE postject injection. ...
gateway · 2026-09-08 21:30:22
<!-- lore-recall:59c4e1a6-5ce2-4255-b384-15c874f90085 --><!-- lore-recall:0c613ffd-b4b7-49a8-bdfe-1df58ce204c0 -->
gpt-5.6-sol · 2026-09-08 21:30:22 · ~58 tokens
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts:
  Line 554:  * Uses a higher `per_page` than `fetchRecentReleases()` in delta-upgrade


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 155: export async function fetchRecentReleases(

  Line 181: export async function downloadStablePatch(

  Line 270: export function resolveStableChain(

  Line 278: export async function resolveNightlyChain(opts: {
gateway · 2026-09-08 21:30:34
<!-- lore-recall:e03c91d9-0bb2-4bb1-a74a-a74f0d6acf28 --><!-- lore-recall:8fe9afba-c933-4132-9dba-21885fc003c3 -->
gpt-5.6-sol · 2026-09-08 21:30:34 · ~56 tokens
result
Found 36 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 20:   downloadStablePatch,

  Line 24:   fetchRecentReleases,

  Line 34:   resolveNightlyChain,

  Line 36:   resolveStableChain,

  Line 817: // fetchRecentReleases

  Line 819: describe("fetchRecentReleases", () => {

  Line 834:     const result = await fetchRecentReleases();

  Line 842:     const result = await fetchRecentReleases();

  Line 851:     const result = await fetchRecentReleases();

  Line 856: // downloadStablePatch

  Line 858: describe("downloadStablePatch", () => {

  Line 869:     const result = await downloadStablePatch("https://example.com/patch.bin");

  Line 877:     const result = await downloadStablePatch("https://example.com/missing.bin");

  Line 886:     const result = await downloadStablePatch("https://example.com/fail.bin");

  Line 891: // resolveStableChain (async orchestrator)

  Line ...
gateway · 2026-09-08 21:30:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR Client Tests
3:  *
4:  * Unit tests for the GHCR/OCI download protocol helpers.
5:  * All HTTP calls are mocked via globalThis.fetch to avoid network access.
6:  */
7: 
8: import { afterEach, beforeEach, describe, expect, test } from "vitest";
9: import { UpgradeError } from "../../src/lib/errors.js";
10: import {
11:   downloadLayerBlob,
12:   downloadNightlyBlob,
13:   fetchManifest,
14:   fetchNightlyManifest,
15:   findLayerByFilename,
16:   GHCR_REPO,
17:   GHCR_TAG,
18:   getAnonymousToken,
19:   getNightlyVersion,
20:   listTags,
21:   type OciManifest,
22: } from "../../src/lib/ghcr.js";
23: 
24: /** Store original fetch for restoration */
25: let originalFetch: typeof globalThis.fetch;
26: 
27: /** Helper to mock fetch without TypeScript errors about missing Bun-specific properties */
28: ...
gateway · 2026-09-08 21:30:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.mocked.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Tests for installBinary's canonical() fallback when realpath throws on an
3:  * existing path. Kept in a separate file so the node:fs/promises mock doesn't
4:  * leak into binary.test.ts.
5:  */
6: 
7: import { chmodSync, mkdirSync, rmSync } from "node:fs";
8: import { readFile, writeFile } from "node:fs/promises";
9: import { join } from "node:path";
10: import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
11: 
12: // Mock only realpath to throw; everything else stays real via importOriginal.
13: vi.mock("node:fs/promises", async (importOriginal) => {
14:   const orig = await importOriginal<typeof import("node:fs/promises")>();
15:   return {
16:     ...orig,
17:     realpath: () =>
18:       Promise.reject(new Error("EACCES: permission denied (simulated)")),
19:   ...
gateway · 2026-09-08 21:31:02
result
Found 36 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/api/preprod-artifacts.test.ts:
  Line 5:  * region request layer; `downloadBuildArtifact` mocks `customFetch` and the

  Line 17:   customFetchMock,

  Line 23:   customFetchMock: vi.fn(),

  Line 37: vi.mock("../../../src/lib/custom-ca.js", () => ({

  Line 38:   customFetch: customFetchMock,

  Line 134:     customFetchMock.mockReset();

  Line 143:     customFetchMock.mockResolvedValue(

  Line 155:     const init = customFetchMock.mock.calls.at(-1)?.[1] as {

  Line 162:     customFetchMock.mockResolvedValue(new Response("X", { status: 200 }));

  Line 170:     const init = customFetchMock.mock.calls.at(-1)?.[1] as {

  Line 178:     customFetchMock.mockResolvedValue(new Response("X", { status: 200 }));

  Line 186:     const init = customFetchMock.mock.calls.at(-1)?.[1] as {

  Line 193:     customFetchMock.mockResolvedValue(

  Line 357:     ...
gateway · 2026-09-08 21:31:11
result
Found 21 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 156: export const GITHUB_RELEASES_URL =


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts:
  Line 134: export const GHCR_REPO = "getsentry/cli";

  Line 193:   const url = `${GHCR_REGISTRY}/token?scope=repository:${GHCR_REPO}:pull`;

  Line 232:   const url = `${GHCR_REGISTRY}/v2/${GHCR_REPO}/manifests/${tag}`;

  Line 337:   const blobUrl = `${GHCR_REGISTRY}/v2/${GHCR_REPO}/blobs/${digest}`;

  Line 432:   let url = `${GHCR_REGISTRY}/v2/${GHCR_REPO}/tags/list?n=${TAGS_PAGE_SIZE}`;


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 35:   GITHUB_RELEASES_URL,

  Line 44: import { GHCR_REPO } ...
gateway · 2026-09-08 21:31:18
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
gateway · 2026-09-08 21:31:27
result
Found 25 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts:
  Line 13: import type { GitHubRelease } from "../../src/lib/delta-upgrade.js";

  Line 46: - Show meaningful message for network errors by @BYK in [#572](https://github.com/getsentry/cli/pull/572)

  Line 57: function makeRelease(tagName: string, body?: string): GitHubRelease {

  Line 112:   const releases: GitHubRelease[] = [

  Line 125:   test("filters releases within version range", () => {

  Line 126:     const summary = buildChangelogSummary(releases, "0.19.0", "0.21.0");

  Line 138:   test("returns null when no releases in range", () => {

  Line 139:     expect(buildChangelogSummary(releases, "0.21.0", "0.22.0")).toBeNull();

  Line 149:     expect(buildChangelogSummary(releases, "0.17.0", "0.18.0")).toBeNull();

  Line 153:     const summary = buildChangelogSummary(releases, "0.19.0", "0.20.0");

  Line 159:   ...
gateway · 2026-09-08 21:31:36
result
No files found
gateway · 2026-09-08 21:31:46
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Version Check Logic Tests
3:  */
4: 
5: import { setTimeout as sleep } from "node:timers/promises";
6: import { afterEach, beforeEach, describe, expect, test } from "vitest";
7: import { setReleaseChannel } from "../../src/lib/db/release-channel.js";
8: import {
9:   getVersionCheckInfo,
10:   setVersionCheckInfo,
11: } from "../../src/lib/db/version-check.js";
12: import {
13:   ApiError,
14:   ContextError,
15:   ValidationError,
16: } from "../../src/lib/errors.js";
17: import {
18:   abortPendingVersionCheck,
19:   getErrorUpdateNotification,
20:   getUpdateNotification,
21:   maybeCheckForUpdateInBackground,
22:   resetUpdateNotificationState,
23:   shouldSuppressNotification,
24: } from "../../src/lib/version-check.js";
25: import { mockFetch, useTestConfigDir } from "../helpers.js";
26: ...
gateway · 2026-09-08 21:31:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts</path>
<type>file</type>
<content>
377: describe("maybeCheckForUpdateInBackground", () => {
378:   useTestConfigDir("test-version-bg-");
379:   let savedNoUpdateCheck: string | undefined;
380:   let originalFetch: typeof globalThis.fetch;
381: 
382:   beforeEach(() => {
383:     // Save and clear the env var to test real implementation
384:     savedNoUpdateCheck = process.env.SENTRY_CLI_NO_UPDATE_CHECK;
385:     delete process.env.SENTRY_CLI_NO_UPDATE_CHECK;
386:     // Silence background fetch calls to GitHub API that would otherwise
387:     // hit the preload mock and produce "unexpected fetch" warnings.
388:     originalFetch = globalThis.fetch;
389:     globalThis.fetch = mockFetch(
390:       async () =>
391:         new Response(JSON.stringify({ tag_name: "v0.0.0-dev" }), {
392:           status: 200,
393:         })
394:     ...
gateway · 2026-09-08 21:32:06
result
Found 10 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 77: * **toolkit pre-rename subtree merge**: Chose importing getsentry/cli into an integration branch of getsentry/sentry-mcp, validating the complete monorepo there, then renaming it to getsentry/toolkit over renaming first because pre-rename validation preserves known MCP deployment wiring and makes rollback safer. Keep CLI at packages/cli and docs at apps/cli-docs; use a pnpm workspace without Turbo, independent cli@/mcp@ releases, root-managed patches/catalogs, and later incremental extraction into @sentry/toolkit-core.

  Line 94: * **getsentry/toolkit history-preserving monorepo import**: Chose getsentry/toolkit as a workspace-release monorepo, importing getsentry/cli main as the initial history and rewriting/importing MCP history under packages/mcp before merging histories. ...
gateway · 2026-09-08 21:32:32
result
No files found
gateway · 2026-09-08 21:33:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-08 21:34:36
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/small.trdiff10
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/small-old.bin
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/small-new.bin
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/large.trdiff10
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/large-old.bin
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/fixtures/patches/large-new.bin
gateway · 2026-09-08 21:34:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-08 21:36:03
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-08 21:36:14
<!-- lore-recall:ba8a11df-b53c-4635-904f-683f692bc782 --><!-- lore-recall:72a207ad-80c2-491b-b43f-d9fe187ed981 -->
gpt-5.6-sol · 2026-09-08 21:36:14 · ~52 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Integration tests for delta upgrade orchestration with a non-dev CLI_VERSION.
3:  *
4:  * These tests use `vi.mock()` to override `CLI_VERSION` from constants.js
5:  * so that `canAttemptDelta()` passes its dev-build guard (the real `CLI_VERSION`
6:  * is "0.0.0-dev" in test mode, which short-circuits the orchestrator).
7:  *
8:  * Kept as a sibling file to `delta-upgrade.test.ts` because its
9:  * `vi.mock()` would invert the assumptions of the dev-mode null-return
10:  * tests in that file. Under `bun test --isolate` each file gets a fresh
11:  * module graph, so the mocks here don't leak. ...
gateway · 2026-09-08 21:36:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-08 21:36:49
result
No files found
gateway · 2026-09-08 21:36:58
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
gateway · 2026-09-08 21:37:10
result
No files found
gateway · 2026-09-08 21:39:12
result
Found 23 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts:
  Line 768: export const upgradeCommand = buildCommand({


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/index.ts:
  Line 8: import { upgradeCommand } from "./upgrade.js";

  Line 18:     upgrade: upgradeCommand,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/log/list.ts:
  Line 70: import { getUpdateNotification } from "../../lib/version-check.js";

  Line 555:   const notification = getUpdateNotification();


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/cli.ts:
  Line 179:   const { startCleanupOldBinary } = await import("./lib/upgrade.js");

  Line 181:     abortPendingVersionCheck,

  Line 183:     ...
gateway · 2026-09-08 21:39:44
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 40:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 71: // GHCR publishes nightlies to ghcr.io/getsentry/cli (see src/lib/ghcr.ts


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/response-cache.ts:
  Line 476:         // Surface cache age for command-level hints (getsentry/cli#785 #1)


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/project/view.ts:
  Line 146:  * generic "Could not auto-detect" fallback (getsentry/cli#785 ...
gateway · 2026-09-08 21:39:56
<!-- lore-recall:fa4fc223-dc68-4768-9af6-9299371fb6cd --><!-- lore-recall:1c7d0fe4-0f64-45e2-9007-a20523471e16 -->
gpt-5.6-sol · 2026-09-08 21:39:56 · ~57 tokens
result
Found 28 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 452:   const token = await getAnonymousToken();

  Line 458:   const manifest = await fetchNightlyManifest(token);

  Line 499:   const token = await getAnonymousToken();

  Line 501:     await fetchManifest(token, `nightly-${version}`);

  Line 688:   const token = await getAnonymousToken();

  Line 690:     ? await fetchManifest(token, `nightly-${version}`)

  Line 691:     : await fetchNightlyManifest(token);

  Line 694:   const response = await downloadNightlyBlob(token, layer.digest);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts:
  Line 134: export const GHCR_REPO = "getsentry/cli";

  Line 137: export const GHCR_TAG = "nightly";

  Line 192: export async function getAnonymousToken(signal?: AbortSignal): Promise<string> {

  Line 193:   const url ...
gateway · 2026-09-08 21:41:56
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/bspatch.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/bspatch.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.mocked.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode...
gateway · 2026-09-08 21:42:12
<!-- lore-recall:b8e33500-0af5-46ec-986a-d4f85be52c53 --><!-- lore-recall:41613cbf-b191-4ed7-8408-9c6bb5f152b4 --><!-- lore-recall:5ff454c8-61f6-49bd-a84d-10a51c371f98 --><!-- lore-recall:e35c418d-9a16-4081-9f93-6fd18ac4fd25 -->
gpt-5.6-sol · 2026-09-08 21:42:12 · ~115 tokens
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts:
  Line 8:  * Supports two release channels:

  Line 12:  * The channel can be set via --channel or by passing "nightly"/"stable"

  Line 14:  * so that subsequent bare `sentry cli upgrade` calls use the same channel.

  Line 17: import { spawn } from "node:child_process";

  Line 18: import { homedir } from "node:os";

  Line 19: import { dirname } from "node:path";

  Line 20: import { setTimeout } from "node:timers/promises";

  Line 21: import type { SentryContext } from "../../context.js";

  Line 22: import {

  Line 27: import { buildCommand } from "../../lib/command.js";

  Line 28: import { CLI_VERSION } from "../../lib/constants.js";

  Line 29: import {

  Line 33: } from "../../lib/db/release-channel.js";

  Line 34: import { getVersionCheckInfo } from "../../lib/db/version-check.js";

  Line ...
gateway · 2026-09-08 21:42:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
768: export const upgradeCommand = buildCommand({
769:   auth: false,
770:   docs: {
771:     brief: "Update the Sentry CLI to the latest version",
772:     fullDescription:
773:       "Check for updates and upgrade the Sentry CLI to the latest or a specific version.\n\n" +
774:       "By default, detects how the CLI was installed (npm, curl, etc.) and uses the same method to upgrade.\n\n" +
775:       "Two release channels are supported:\n" +
776:       "  stable  (default) Latest stable release\n" +
777:       "  nightly           Built from main, updated on every commit\n\n" +
778:       "The channel is persisted so that subsequent bare `sentry cli upgrade` calls\n" +
779:       "use the same channel.\n\n" +
780:       "Examples:\n" +
781:       "  sentry cli upgrade              # Update to latest (using ...
gateway · 2026-09-08 21:42:56
<!-- lore-recall:aa0f4e40-dcc4-4e06-bb2e-e737fc464667 --><!-- lore-recall:81f3af70-7880-4c7b-a13e-c76c98b7ce5f --><!-- lore-recall:dfc6ecbf-9ed2-4f3b-ac51-699ca915f91a --><!-- lore-recall:55ea4ba0-68c8-4553-92ae-c1ab4a742fb4 -->
gpt-5.6-sol · 2026-09-08 21:42:56 · ~117 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
197: export function extractStableChain(
198:   opts: ExtractStableChainOpts
199: ): StableChainInfo | null {
200:   const result = binpatchExtractStableChain(opts);
201:   return "failure" in result ? null : result;
202: }
203: 
204: export function filterAndSortChainTags(
205:   allTags: string[],
206:   currentVersion: string,
207:   targetVersion: string
208: ): string[] {
209:   return binpatchFilterAndSortChainTags(
210:     allTags,
211:     currentVersion,
212:     targetVersion,
213:     compareVersions
214:   );
215: }
216: 
217: type ChainStepResult =
218:   | { ok: true; digest: string; size: number }
219:   | {
220:       ok: false;
221:       failure:
222:         | {
223:             reason: "version-mismatch";
224:             expected: string;
225:             actual: string | null;
226:         ...
gateway · 2026-09-08 21:43:59
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/db/install-info.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/uninstall.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/db/install-info.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/uninstall.ts
gateway · 2026-09-08 21:44:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
1: #!/bin/bash
2: set -euo pipefail
3: 
4: RED='\033[0;31m'
5: MUTED='\033[0;2m'
6: NC='\033[0m'
7: 
8: # Sentry error telemetry — fire-and-forget error reporting via envelope API.
9: # Uses the CLI's public write-only DSN. No PII collected.
10: # Opt-out: SENTRY_CLI_NO_TELEMETRY=1
11: SENTRY_DSN_KEY="1188a86f3f8168f089450587b00bca66"
12: SENTRY_INGEST="https://o1.ingest.us.sentry.io"
13: SENTRY_PROJECT_ID="4510776311808000"
14: 
15: # Generate a UUID for the event. Tries /proc, uuidgen, then awk fallback. ...
gateway · 2026-09-08 21:44:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
290:   version="${version#v}"
291:   filename="sentry-${os}-${arch}${libc_suffix}${suffix}"
292:   url="https://github.com/getsentry/cli/releases/download/${version}/${filename}"
293: 
294:   echo -e "${MUTED}Downloading sentry v${version}...${NC}"
295: 
296:   # Try gzip-compressed download first (~60% smaller, ~37 MB vs ~99 MB).
297:   # gunzip is POSIX and available on all Unix systems.
298:   # Falls back to raw binary if the .gz asset doesn't exist yet.
299:   if curl -fsSL "${url}.gz" 2>/dev/null | gunzip > "$tmp_binary" 2>/dev/null; then
300:     : # Compressed download succeeded
301:   else
302:     curl -fsSL --progress-bar "$url" -o "$tmp_binary"
303:   fi
304: fi
305: 
306: chmod +x "$tmp_binary"
307: 
308: # Delegate installation and configuration to the binary itself. ...
gateway · 2026-09-08 21:45:02
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Install Script Tests
3:  *
4:  * Exercises the shell installer with fake download tools so argument parsing and
5:  * setup delegation can be validated without network access.
6:  */
7: 
8: import { spawn } from "node:child_process";
9: import {
10:   chmodSync,
11:   mkdirSync,
12:   mkdtempSync,
13:   readFileSync,
14:   rmSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { tmpdir } from "node:os";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: 
21: function noop(): void {
22:   // Intentionally empty — absorbs async spawn errors
23: }
24: 
25: const repoRoot = join(import.meta.dirname, "..", "..");
26: const installScript = join(repoRoot, "install");
27: 
28: describe("install script", () => {
29:   let ...
gateway · 2026-09-08 21:47:30
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts:
  Line 586: export type UpgradeErrorReason =

  Line 600: export class UpgradeError extends CliError {
gateway · 2026-09-08 21:48:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
570:  *
571:  * @param code - OAuth error code (e.g., "authorization_pending", "slow_down")
572:  * @param description - Human-readable error description
573:  */
574: export class DeviceFlowError extends CliError {
575:   readonly code: string;
576: 
577:   constructor(code: string, description?: string) {
578:     super(description ?? code, EXIT.DEVICE_FLOW);
579:     this.name = "DeviceFlowError";
580:     this.code = code;
581:   }
582: }
583: 
584: // Upgrade Errors
585: 
586: export type UpgradeErrorReason =
587:   | "unknown_method"
588:   | "unsupported_operation"
589:   | "network_error"
590:   | "execution_failed"
591:   | "version_not_found"
592:   | "offline_cache_miss";
593: 
594: /**
595:  * Upgrade-related errors. ...
gateway · 2026-09-08 21:48:32
<!-- lore-recall:f14749e7-63df-43d6-91b2-73238da797a6 --><!-- lore-recall:3c2201bf-f420-46bb-9628-84e4318eefc9 --><!-- lore-recall:1813e73b-ac3d-40a0-8d8a-1d536a49cfe5 -->
gpt-5.6-sol · 2026-09-08 21:48:32 · ~88 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts</path>
<type>file</type>
<content>
817: // fetchRecentReleases
818: 
819: describe("fetchRecentReleases", () => {
820:   test("returns releases from GitHub API", async () => {
821:     const releases: GitHubRelease[] = [
822:       makeRelease("0.14.0", [makeAsset({ name: "sentry-linux-x64" })]),
823:       makeRelease("0.13.0", [makeAsset({ name: "sentry-linux-x64" })]),
824:     ];
825: 
826:     mockFetch(async (url) => {
827:       expect(String(url)).toContain(
828:         "api.github.com/repos/getsentry/cli/releases"
829:       );
830:       expect(String(url)).toContain("per_page=");
831:       return new Response(JSON.stringify(releases), { status: 200 });
832:     });
833: 
834:     const result = await fetchRecentReleases();
835:     expect(result).toHaveLength(2);
836:     expect(result[0]?.tag_name).toBe("0.14.0");
837:   ...
gateway · 2026-09-08 21:48:50
result
Found 86 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 25: import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";

  Line 149: let originalFetch: typeof globalThis.fetch;

  Line 152: function mockFetch(

  Line 155:   globalThis.fetch = fn as typeof globalThis.fetch;

  Line 158: beforeEach(() => {

  Line 159:   originalFetch = globalThis.fetch;

  Line 162: afterEach(() => {

  Line 163:   globalThis.fetch = originalFetch;

  Line 191:     mockFetch(

  Line 209:     mockFetch(

  Line 227:     mockFetch(

  Line 245:     mockFetch(

  Line 259:     mockFetch(async () => {

  Line 270:     mockFetch(

  Line 286:     mockFetch(

  Line 304:     mockFetch(

  Line 318:     mockFetch(async () => {

  Line 329:     mockFetch(

  Line 398:     mockFetch(

  Line 411:     mockFetch(

  Line 424:     mockFetch(

  Line 437:     mockFetch(

  Line 450:     ...
gateway · 2026-09-08 21:49:07
<!-- lore-recall:6b1d8436-ebf9-4e95-86b5-509941cb75a8 --><!-- lore-recall:f1bf86a0-91ab-4ad0-9392-f53ae774aa0d -->
gpt-5.6-sol · 2026-09-08 21:49:07 · ~59 tokens
result
Found 46 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

  Line 134:   downloadBinaryToTemp,

  Line 138:   fetchLatestNightlyVersion,

  Line 343: // fetchLatestNightlyVersion tests are in the dedicated describe block

  Line 488:   test("uses GHCR manifest when channel is nightly (curl method)", async () => {

  Line 495:       if (urlStr.includes("/manifests/nightly")) {

  Line 506:     const version = await fetchLatestVersion("curl", "nightly");

  Line 510:   test("uses GHCR manifest when channel is nightly (npm method)", async () => {

  Line 511:     // Even npm method uses GHCR when channel=nightly (nightly is curl-only distribution)

  Line 517:       if (urlStr.includes("/manifests/nightly")) {

  Line 528:     const version = await fetchLatestVersion("npm", "nightly");

  Line 632:   test("checks GHCR for nightly version - version exists", ...
gateway · 2026-09-08 21:49:21
<!-- lore-recall:f0dba9dc-d9b4-4709-87bf-8f4e48aa41b4 --><!-- lore-recall:1aa76ba1-7f9a-44d3-a96e-ebd1bb2adc6f -->
gpt-5.6-sol · 2026-09-08 21:49:21 · ~62 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
350:   if (legacyMethod !== "unknown") {
351:     try {
352:       setInstallInfo({
353:         method: legacyMethod,
354:         path: process.execPath,
355:         version: CLI_VERSION,
356:       });
357:     } catch {
358:       log.debug("Failed to persist install info (DB may be read-only)");
359:     }
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): ...
gateway · 2026-09-08 21:49:48
result
Found 40 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 375: export async function fetchLatestFromGitHub(

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 443: export async function fetchLatestNightlyVersion(

  Line 479:     return fetchLatestNightlyVersion();

  Line 482:     ? ...
gateway · 2026-09-08 21:51:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
830: /**
831:  * Download the new binary to a temporary path and return its location.
832:  * Used by the upgrade command to download before spawning setup --install.
833:  *
834:  * For **nightly** versions (detected via {@link isNightlyVersion}), downloads
835:  * from GHCR using the OCI blob download protocol via {@link downloadNightlyToPath}.
836:  *
837:  * For **stable** versions, downloads from GitHub Releases via
838:  * {@link downloadStableToPath}.
839:  *
840:  * The lock is held on success so concurrent upgrades are blocked during the
841:  * download→spawn→install pipeline. The caller MUST release the lock after the
842:  * child process exits (the child may use a different install directory and
843:  * therefore a different lock file, so it cannot reliably release this one). ...
gateway · 2026-09-08 21:51:33
<!-- lore-recall:834aadd3-be8f-4fb6-a308-bfa46199a054 --><!-- lore-recall:419ba4ec-0267-481f-b636-e7fb034389c2 --><!-- lore-recall:43c9a24e-b78e-414d-8b89-114e3bf6b314 --><!-- lore-recall:e6755ce9-442d-4ea9-886f-948e2e68c3ad -->
gpt-5.6-sol · 2026-09-08 21:51:33 · ~109 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
540: 
541: // ────────────────────────────── Fetch Functions ────────────────────────────
542: 
543: /**
544:  * Max releases to fetch for changelog purposes.
545:  *
546:  * Higher than the delta-upgrade cap (12) to cover larger version jumps.
547:  * GitHub API max per_page is 100; 30 covers ~6+ months of weekly releases.
548:  */
549: const CHANGELOG_MAX_RELEASES = 30;
550: 
551: /**
552:  * Fetch recent releases from GitHub for changelog building.
553:  *
554:  * Uses a higher `per_page` than `fetchRecentReleases()` in delta-upgrade
555:  * (which is capped at 12 for patch chain resolution) to cover larger
556:  * version jumps without silent truncation. ...
gateway · 2026-09-08 21:51:45
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/docs-preview.yml:
  Line 11:       - 'packages/cli/install'

  Line 55:               - 'packages/cli/install'
gateway · 2026-09-08 21:51:55
<!-- lore-recall:d058c093-ab5c-4cc5-aeac-1fd4872be9f8 --><!-- lore-recall:cdd67905-0632-446f-8ee7-f0452f309877 -->
gpt-5.6-sol · 2026-09-08 21:51:55 · ~53 tokens
result
Found 59 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

  Line 136:   fetchLatestFromGitHub,

  Line 143:   versionExists,

  Line 189: describe("fetchLatestFromGitHub", () => {

  Line 204:     const version = await fetchLatestFromGitHub();

  Line 222:     const version = await fetchLatestFromGitHub();

  Line 240:     const version = await fetchLatestFromGitHub();

  Line 248:           status: 404,

  Line 252:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 253:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 254:       "Failed to fetch from GitHub: 404"

  Line 263:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 264:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 278:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 307:      ...
gateway · 2026-09-08 21:52:09
<!-- lore-recall:a93e53cf-1880-4e01-aa94-d399a9a4c030 --><!-- lore-recall:6707807f-320d-46c7-ac31-bf6e02697b4b --><!-- lore-recall:4bcaeeaf-2214-4f09-90ca-e61d673864d5 --><!-- lore-recall:a097265c-91cd-4fa6-b57a-a5df8bf6b9b4 -->
gpt-5.6-sol · 2026-09-08 21:52:09 · ~113 tokens
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 294:     (await client.listTags(opts.token, PATCH_TAG_PREFIX, opts.signal));

  Line 307:       chainTags.map((tag) => client.fetchManifest(opts.token, tag, opts.signal))
gateway · 2026-09-08 21:52:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Background version check for "new version available" notifications.
3:  *
4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the
5:  * latest nightly version via the OCI manifest annotation. For stable builds,
6:  * checks GitHub Releases. Results are cached in the database and shown on
7:  * subsequent runs.
8:  */
9: 
10: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
11: import * as Sentry from "@sentry/node-core/light";
12: import { compare as semverCompare } from "semver";
13: import { CLI_VERSION } from "./constants.js";
14: import { getReleaseChannel } from "./db/release-channel.js";
15: import {
16:   getVersionCheckInfo,
17:   markUpdateNotified,
18:   setVersionCheckInfo,
19: } from "./db/version-check.js";
20: ...
gateway · 2026-09-08 21:53:08
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 25:   getBinaryDownloadUrl,

  Line 37: describe("getBinaryDownloadUrl", () => {

  Line 39:     const url = getBinaryDownloadUrl("1.0.0");

  Line 53:     const url = getBinaryDownloadUrl("2.0.0");
gateway · 2026-09-08 21:53:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management Tests
3:  *
4:  * Tests for shared binary helpers: install directory selection, paths,
5:  * download URLs, locking, and binary installation.
6:  */
7: 
8: import {
9:   chmodSync,
10:   mkdirSync,
11:   readFileSync,
12:   realpathSync,
13:   rmSync,
14:   symlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { access, readFile, writeFile } from "node:fs/promises";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: import {
21:   acquireLock,
22:   compareVersions,
23:   determineInstallDir,
24:   fetchWithUpgradeError,
25:   getBinaryDownloadUrl,
26:   getBinaryFilename,
27:   getBinaryPaths,
28:   getPlatformBinaryName,
29:   installBinary,
30:   isDowngrade,
31:   isMusl,
32:   releaseLock,
33:   ...
gateway · 2026-09-08 21:53:43
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 974:     const url = getBinaryDownloadUrl("1.0.0");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 721:   const url = getBinaryDownloadUrl(version);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 39:     const url = getBinaryDownloadUrl("1.0.0");

  Line 53:     const url = getBinaryDownloadUrl("2.0.0");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 151: export function getBinaryDownloadUrl(version: string): string {
gateway · 2026-09-08 21:53:55
<!-- lore-recall:d450b42c-33ea-4928-baae-3a60ce29facd2 -->
gpt-5.6-sol · 2026-09-08 21:53:55 · ~28 tokens
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts:
  Line 22: } from "../../src/lib/ghcr.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 50: } from "./ghcr.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 40: import type { OciManifest } from "../../src/lib/ghcr.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 44: import { GHCR_REPO } from "./ghcr.js";
gateway · 2026-09-08 21:54:13
<!-- lore-recall:7083ed08-28ac-40ad-a4ba-1a18bd8430cf --><!-- lore-recall:68c96849-f1ec-45d1-8436-76193dfc8f04 -->
gpt-5.6-sol · 2026-09-08 21:54:13 · ~55 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-08 21:54:28
<!-- lore-recall:aab0e3d9-005e-498e-a16e-55ea370b6ced --><!-- lore-recall:a00d841e-455c-44b1-8da8-212858dd5f4a -->
gpt-5.6-sol · 2026-09-08 21:54:28 · ~57 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
180:   });
181: 
182:   test("throws on invalid method", () => {
183:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
184:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
185:     expect(() => parseInstallationMethod("")).toThrow("Invalid method: ");
186:   });
187: });
188: 
189: describe("fetchLatestFromGitHub", () => {
190:   test("returns version from GitHub API", async () => {
191:     mockFetch(
192:       async () =>
193:         new Response(
194:           JSON.stringify({
195:             tag_name: "v1.2.3",
196:           }),
197:           {
198:             status: 200,
199:             headers: { "Content-Type": "application/json" },
200:           }
201:         )
202:     );
203: 
204:     const version = await ...
gateway · 2026-09-08 21:54:46
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
530:   });
531: 
532:   test("defaults to stable channel (uses GitHub) when channel omitted", async () => {
533:     mockFetch(
534:       async () =>
535:         new Response(JSON.stringify({ tag_name: "v3.0.0" }), {
536:           status: 200,
537:           headers: { "Content-Type": "application/json" },
538:         })
539:     );
540: 
541:     const version = await fetchLatestVersion("curl");
542:     expect(version).toBe("3.0.0");
543:   });
544: });
545: 
546: describe("versionExists", () => {
547:   test("checks GitHub for curl method - version exists", async () => {
548:     mockFetch(async () => new Response(null, { status: 200 }));
549: 
550:     const exists = await versionExists("curl", "1.0.0");
551:     expect(exists).toBe(true);
552:   });
553: 
554:   test("checks GitHub for curl method - ...
gateway · 2026-09-08 21:54:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1260:   }
1261: 
1262:   beforeEach(() => {
1263:     // Redirect getCurlInstallPaths() to temp dir instead of ~/.sentry/bin/
1264:     clearInstallInfo();
1265:     mkdirSync(upgradeBinDir, { recursive: true });
1266:     setInstallInfo({
1267:       method: "curl",
1268:       path: upgradeInstallPath,
1269:       version: "0.0.0",
1270:     });
1271:   });
1272: 
1273:   afterEach(async () => {
1274:     globalThis.fetch = originalFetch;
1275:     // Clean up test files - get fresh paths in case DB changed
1276:     const paths = getTestPaths();
1277:     for (const path of [
1278:       paths.installPath,
1279:       paths.tempPath,
1280:       paths.oldPath,
1281:       paths.lockPath,
1282:     ]) {
1283:       try {
1284:         await unlink(path);
1285:       } catch {
1286:         // Ignore
1287:      ...
gateway · 2026-09-08 21:55:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1480: describe("fetchLatestNightlyVersion", () => {
1481:   test("returns version from GHCR manifest annotation", async () => {
1482:     // Mock the two requests: token exchange + manifest fetch
1483:     let callCount = 0;
1484:     mockFetch(async (url) => {
1485:       callCount += 1;
1486:       const urlStr = String(url);
1487:       if (urlStr.includes("ghcr.io/token")) {
1488:         return new Response(JSON.stringify({ token: "test-token" }), {
1489:           status: 200,
1490:           headers: { "Content-Type": "application/json" },
1491:         });
1492:       }
1493:       if (urlStr.includes("/manifests/nightly")) {
1494:         return new Response(
1495:           JSON.stringify({
1496:             schemaVersion: 2,
1497:             layers: [],
1498:             annotations: { version: ...
gateway · 2026-09-08 21:55:23
<!-- lore-recall:622473df-bc42-407b-b7ac-bf93d81cb11f --><!-- lore-recall:a29c5beb-c9a3-4e2f-9409-16de6bf01154 --><!-- lore-recall:85f898ec-f006-4557-be25-3ae2a959b9ce -->
gpt-5.6-sol · 2026-09-08 21:55:23 · ~81 tokens
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts:
  Line 730: function startChangelogFetch(

  Line 739:   return fetchChangelog({

  Line 857:         result.changelog = await startChangelogFetch(

  Line 870:     const changelogPromise = startChangelogFetch(
gateway · 2026-09-08 21:55:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
700:   const currentChannel = getReleaseChannel();
701:   const channelChanged = channel !== currentChannel;
702: 
703:   const method = flags.method ?? (await detectInstallationMethod());
704:   validateMethod(method, versionArg, channel, flags.offline);
705:   return { channel, versionArg, channelChanged, method };
706: }
707: 
708: /**
709:  * Persist the release channel preference. Must be called **after** offline
710:  * target resolution since `setReleaseChannel()` clears the version check
711:  * cache on channel changes, which would prevent `resolveOfflineTarget()`
712:  * from reading the cached version.
713:  */
714: function persistChannel(
715:   channel: ReleaseChannel,
716:   channelChanged: boolean,
717:   version: string | undefined
718: ): void {
719:   if (channelChanged || ...
gateway · 2026-09-08 21:55:53
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts:
  Line 243:   test("filters #skip-changelog commits", () => {

  Line 246:       { commit: { message: "feat: hidden change\n\n#skip-changelog" } },
gateway · 2026-09-08 21:56:04
result
Found 49 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml:
  Line 473:           REPO="ghcr.io/getsentry/cli"

  Line 688:           oras push ghcr.io/getsentry/cli:nightly \

  Line 699:           oras tag ghcr.io/getsentry/cli:nightly "nightly-${VERSION}"

  Line 709:           REPO="ghcr.io/getsentry/cli"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/cleanup-nightlies.yml:
  Line 34:           REPO="ghcr.io/getsentry/cli"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml:
  Line 26:         urlTemplate: 'https://github.com/getsentry/cli/releases/download/{{version}}/{{file}}'

  Line 45:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-arm64.gz"

  Line 48:             url ...
gateway · 2026-09-08 21:56:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
130:   );
131: }
132: 
133: /** GHCR repository for CLI distribution */
134: export const GHCR_REPO = "getsentry/cli";
135: 
136: /** OCI tag for nightly builds */
137: export const GHCR_TAG = "nightly";
138: 
139: /** Base URL for GHCR registry API */
140: const GHCR_REGISTRY = "https://ghcr.io";
141: 
142: /** OCI manifest media type */
143: const OCI_MANIFEST_TYPE = "application/vnd.oci.image.manifest.v1+json";
144: 
145: /**
146:  * A single layer entry from an OCI manifest.
147:  *
148:  * Each binary in the nightly push is stored as a separate layer.
149:  * The `annotations` map includes `org.opencontainers.image.title` (filename)
150:  * and `org.opencontainers.image.created` (push time).
151:  */
152: export type OciLayer = {
153:   /** Content-addressable digest for the blob (e.g., "sha256:abc123...") */
154:   ...
gateway · 2026-09-08 21:57:04
<!-- lore-recall:6d6ccd7a-c14b-4c71-9a9d-76d6fd5c447c --><!-- lore-recall:e73a9bb0-fd07-42f7-8f11-af58168cf841 --><!-- lore-recall:61ea238d-1055-4cc1-9bb8-53ff8a17cb04 --><!-- lore-recall:6ac2e659-afc2-4742-8b4b-f4ec6f0f5e7f --><!-- lore-recall:8d7d05b3-56b9-42ee-902a-3a3003e386b5 -->
gpt-5.6-sol · 2026-09-08 21:57:04 · ~155 tokens
result
Found 53 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 162:  * Mock fetch to simulate GHCR manifest returning a specific nightly version.

  Line 177:     // GHCR OCI manifest for :nightly tag

  Line 178:     if (urlStr.includes("/manifests/nightly")) {

  Line 239:  * Mock fetch for the nightly version.json endpoint.

  Line 242:  * Mock fetch for GHCR nightly version checks (token exchange + manifest).

  Line 243:  * Used by nightly channel tests — replaces the old GitHub version.json mock.

  Line 254:     if (urlStr.includes("/manifests/nightly")) {

  Line 450:   describe("nightly version check", () => {

  Line 451:     test("--check mode with 'nightly' positional fetches latest from GHCR", async () => {

  Line 452:       const nightlyVersion = "0.0.0-dev.1740000000";

  Line 453:       // 'nightly' as positional switches channel to nightly — fetches from GHCR

  ...
gateway · 2026-09-08 21:57:21
<!-- lore-recall:f5e293e5-298d-4d8c-9051-10e03ec8eb68 --><!-- lore-recall:a3344959-9eef-4dc6-b834-128298a4bb0a -->
gpt-5.6-sol · 2026-09-08 21:57:21 · ~57 tokens
result
Found 13 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/constants.ts:
  Line 8:  * Single source of truth: `src/lib/dsn/code-scanner.ts` previously owned

  Line 10:  * and `isMonorepoPackageDir`. Once PR 3 lands, `code-scanner.ts` re-imports

  Line 156:  * Skip files larger than this during walks. 256 KB covers source files

  Line 177:  *    repo): the walker's serial `readdir` descent is the dominant

  Line 235:  *   2. Monorepo-boundary detection (splits on "/")

  Line 244:  * True if `relativePath` names a monorepo package directory — exactly

  Line 252: export function isMonorepoPackageDir(relativePath: string): boolean {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/constants.ts:
  Line 11:  * Build-time debug ID for sourcemap resolution, injected by esbuild.

  Line 16:  * the minified JS + sourcemap content hash). ...
gateway · 2026-09-08 21:57:54
result
Found 14 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/api/releases.ts:
  Line 469:         repository: string;

  Line 472:       } = { repository: match.name, commit: headCommit };

  Line 511:     repository: string;


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/api/issues.ts:
  Line 434:   | { inCommit: { commit: string; repository: string } };

  Line 466:   | { kind: "explicit"; repository: string; commit: string };


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/api/code-mappings.ts:
  Line 63:   repository: string;


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/git.ts:
  Line 142:       "Not a git repository. Run this command from within a git working tree.",

  Line 230:         ...
gateway · 2026-09-08 21:59:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
261: 
262: /**
263:  * Build headers for GitHub API requests.
264:  */
265: export function getGitHubHeaders(): Record<string, string> {
266:   return {
267:     Accept: "application/vnd.github.v3+json",
268:     "User-Agent": getUserAgent(),
269:   };
270: }
271: 
272: /**
273:  * Fetch wrapper that converts network errors to UpgradeError.
274:  * Handles DNS failures, timeouts, and other connection issues.
275:  *
276:  * @param url - URL to fetch
277:  * @param init - Fetch options
278:  * @param serviceName - Service name for error messages (e.g., "GitHub")
279:  * @returns Response object
280:  * @throws {UpgradeError} On network failure
281:  * @throws {Error} AbortError if signal is aborted (re-thrown as-is)
282:  */
283: export async function fetchWithUpgradeError(
284:   url: string,
285:   init: ...
gateway · 2026-09-08 21:59:40
result
No files found
gateway · 2026-09-08 21:59:51
<!-- lore-recall:77f54de1-ff1c-4a76-88aa-41ad57955ae3 --><!-- lore-recall:857724f0-6713-4f5b-8913-415fc00564d9 --><!-- lore-recall:f8f118fd-fe29-4f4a-92af-2888c7cbe23b -->
gpt-5.6-sol · 2026-09-08 21:59:51 · ~86 tokens
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/package.json:
  Line 17:     "typecheck": "pnpm --filter sentry run typecheck",

  Line 18:     "lint": "pnpm --filter sentry run lint",

  Line 20:     "test": "pnpm --filter sentry run test",


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/codemods/sentry-v3-to-v4/package.json:
  Line 8:     "test": "pnpm dlx codemod@1.12.7 jssg test -l typescript ./scripts/codemod.ts",


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json:
  Line 57:     "typecheck": "pnpm run generate:docs && pnpm run generate:sdk && tsc --noEmit",

  Line 58:     "lint": "biome check --no-errors-on-unmatched --max-diagnostics=none ./",

  Line 60:     "test": "pnpm run test:unit",
gateway · 2026-09-08 22:00:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
17: import { spawn } from "node:child_process";
18: import { homedir } from "node:os";
19: import { dirname } from "node:path";
20: import { setTimeout } from "node:timers/promises";
21: import type { SentryContext } from "../../context.js";
22: import {
23:   determineInstallDir,
24:   isDowngrade,
25:   releaseLock,
26: } from "../../lib/binary.js";
27: import { buildCommand } from "../../lib/command.js";
28: import { CLI_VERSION } from "../../lib/constants.js";
29: import {
30:   getReleaseChannel,
31:   type ReleaseChannel,
32:   setReleaseChannel,
33: } from "../../lib/db/release-channel.js";
34: import { getVersionCheckInfo } from "../../lib/db/version-check.js";
35: import { UpgradeError } from "../../lib/errors.js";
36: import { formatUpgradeResult } from "../../lib/formatters/human.js";
37: import { ...
gateway · 2026-09-08 22:00:35
<!-- lore-recall:8cc48cb7-88c0-4bc4-afd6-dda3ba6baab5 --><!-- lore-recall:1d83abe0-0e93-4e50-8e8d-089167837f11 -->
gpt-5.6-sol · 2026-09-08 22:00:35 · ~60 tokens
result
 M .lore.md
chore/preshape-monorepo
605e8318d chore: regenerate docs
30ad8b075 ci: organize imports in bundle.ts (biome)
a3921f773 ci: address Seer finding on bundle.ts WASM resolution
12bb0fa77 chore(cli): sync scripts + Bugbot fixes for #1254 (post-feedback rebase)
ab3aa054f chore: address adversarial review findings for monorepo pre-shape
157184517 ci: fix check-generated job paths for monorepo layout
cf165f5ba chore: pre-shape repo into pnpm-workspace monorepo layout
0b43edad4 chore: regenerate docs
f1cc17934 meta: Bump new development version
7f4d217d1 Merge branch 'release/0.40.0'
gateway · 2026-09-08 22:03:02
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml:
  Line 5:     branches: [main, release/**]

  Line 13: # packages:write is needed for publish-nightly to push to GHCR

  Line 14: # issues:write is needed for generate-patches to file issues on failure

  Line 21:   # Commit timestamp used for deterministic nightly version strings.

  Line 22:   # Defined at workflow level so build-binary and publish-nightly always agree.

  Line 33:   # CI Node.js versions, pinned to exact patches and used as the single source

  Line 58:       skill: ${{ steps.filter.outputs.skill == 'true' || startsWith(github.ref, 'refs/heads/release/') }}

  Line 59:       code: ${{ steps.filter.outputs.code == 'true' || startsWith(github.ref, 'refs/heads/release/') }}

  Line 60:       codemod: ${{ steps.filter.outputs.codemod == 'true' || startsWith(github.ref, 'refs/heads/release/') }}

  Line 62: ...
gateway · 2026-09-08 22:04:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-08 22:05:25
result
Found 23 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 7:   applyPatchChainInMemory,

  Line 20:   MAX_NIGHTLY_CHAIN_DEPTH,

  Line 24:   PATCH_TAG_PREFIX,

  Line 29:   SIZE_THRESHOLD_RATIO,

  Line 62:   PATCH_TAG_PREFIX,

  Line 122: function stableSource(): SourceStrategy {

  Line 132: function nightlySource(): SourceStrategy {

  Line 145: export function canAttemptDelta(targetVersion: string): boolean {

  Line 155: export async function fetchRecentReleases(

  Line 181: export async function downloadStablePatch(

  Line 275:   return stableSource().resolveChain(currentVersion, targetVersion, signal);

  Line 294:     (await client.listTags(opts.token, PATCH_TAG_PREFIX, opts.signal));

  Line 300:   if (chainTags.length === 0 || chainTags.length > MAX_NIGHTLY_CHAIN_DEPTH) {

  Line 332:       sizeLimit: opts.fullGzSize * SIZE_THRESHOLD_RATIO - totalSize,

  Line 341:     ...
gateway · 2026-09-08 22:05:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-08 22:05:53
<!-- lore-recall:2d5089b6-ac7b-4cd4-b5df-95d6d5d74e76 --><!-- lore-recall:9db5fc22-c402-489f-a268-542c972b41f8 --><!-- lore-recall:02eac236-9d3d-489b-a49f-b4ef6b69d1bc --><!-- lore-recall:89d6e702-1af3-4fa0-b0f5-53b9875cab49 --><!-- lore-recall:ad5916a7a-e338-4d06-9cde-7fa7bf6681a5 -->
gpt-5.6-sol · 2026-09-08 22:05:53 · ~149 tokens
result
Found 52 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 40:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 79: export const NIGHTLY_TAG = "nightly";

  Line 82: const NPM_REGISTRY_URL = "https://registry.npmjs.org/sentry";

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 411:     `${NPM_REGISTRY_URL}/latest`,

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 546:     `${NPM_REGISTRY_URL}/${version}`,

  Line 851:  *   Pass `NIGHTLY_TAG` ("nightly") when installing from the rolling nightly release

  Line 1069:  *   Pass `NIGHTLY_TAG` for nightly installs so the URL uses the "nightly" ...
gateway · 2026-09-08 22:06:14
result
No files found
gateway · 2026-09-08 22:07:43
result
Found 43 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts:
  Line 78: describe("getAnonymousToken", () => {

  Line 79:   test("returns token from successful response", async () => {

  Line 94:   test("throws UpgradeError on HTTP error", async () => {

  Line 103:   test("throws UpgradeError on network failure", async () => {

  Line 114:   test("throws UpgradeError when response has no token field", async () => {

  Line 130: describe("fetchNightlyManifest", () => {

  Line 131:   test("fetches manifest with correct headers", async () => {

  Line 156:   test("throws UpgradeError on HTTP error", async () => {

  Line 165:   test("throws UpgradeError on network failure", async () => {

  Line 177: describe("getNightlyVersion", () => {

  Line 178:   test("extracts version from manifest annotations", () => {

  Line 183:   test("throws UpgradeError when version annotation is missing", () => {

  ...
gateway · 2026-09-08 22:07:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
40:   "engines": {
41:     "node": ">=18.0"
42:   },
43:   "devEngines": {
44:     "runtime": {
45:       "name": "node",
46:       "version": ">=22.15"
47:     }
48:   },
49:   "packageManager": "pnpm@10.11.0",
50:   "scripts": {
51:     "tsx": "tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs",
52:     "cli": "tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs src/bin.ts",
53:     "dev": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && tsx --import ./script/require-shim.mjs src/bin.ts",
54:     "build": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts --single",
55:     "build:all": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts",
56:     ...
gateway · 2026-09-08 22:08:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.mocked.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Tests for installBinary's canonical() fallback when realpath throws on an
3:  * existing path. Kept in a separate file so the node:fs/promises mock doesn't
4:  * leak into binary.test.ts.
5:  */
6: 
7: import { chmodSync, mkdirSync, rmSync } from "node:fs";
8: import { readFile, writeFile } from "node:fs/promises";
9: import { join } from "node:path";
10: import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
11: 
12: // Mock only realpath to throw; everything else stays real via importOriginal.
13: vi.mock("node:fs/promises", async (importOriginal) => {
14:   const orig = await importOriginal<typeof import("node:fs/promises")>();
15:   return {
16:     ...orig,
17:     realpath: () =>
18:       Promise.reject(new Error("EACCES: permission denied (simulated)")),
19:   ...
gateway · 2026-09-08 22:10:13
result
Found 24 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts:
  Line 25: const GHCR_REQUEST_TIMEOUT = 10_000;

  Line 28: const GHCR_MAX_RETRIES = 1;

  Line 31: const GHCR_BLOB_TIMEOUT = 30_000;

  Line 40: function isRetryableError(error: Error): boolean {

  Line 60: function buildSignal(

  Line 74: function isExternalAbort(error: Error, externalSignal?: AbortSignal): boolean {

  Line 78: type RetryOptions = {

  Line 97: async function fetchWithRetry(

  Line 134: export const GHCR_REPO = "getsentry/cli";

  Line 137: export const GHCR_TAG = "nightly";

  Line 140: const GHCR_REGISTRY = "https://ghcr.io";

  Line 143: const OCI_MANIFEST_TYPE = "application/vnd.oci.image.manifest.v1+json";

  Line 152: export type OciLayer = {

  Line 169: export type OciManifest = {

  Line 192: export async function getAnonymousToken(signal?: AbortSignal): Promise<string> {

  Line 227: export async function ...
gateway · 2026-09-08 22:10:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-08 22:10:46
result
Found 11 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts:
  Line 4:  * Uses the standard NUL-byte heuristic: a file is considered binary if

  Line 7:  * misclassified as binary because its ASCII-range code units produce

  Line 13:  *   and known-binary extensions without a disk read. Returns `null`

  Line 26:  * Extensions that are unambiguously binary. Listed extensions

  Line 28:  * disk read — a 60-80ms win on fixtures rich in binary blobs

  Line 33:  * `.map`) fall through to the NUL-sniff — treating them as binary

  Line 83:   // Documents (binary office formats)

  Line 110:   // Databases (binary-format SQLite / Access)

  Line 115:   // Unambiguously-binary disk images.

  Line 148:  * type, `{ isBinary: true }` when it is unambiguously binary (see

  Line 154:  * without any extension (`.sentryclirc`, `Makefile`, `README`) or
gateway · 2026-09-08 22:12:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
360: 
361:   return result;
362: }
363: 
364: /**
365:  * Maximum number of spawn attempts for the new binary.
366:  *
367:  * On Windows, Defender/SmartScreen may lock a newly-written executable for
368:  * antivirus scanning after the file handle is closed. This causes EBUSY from
369:  * uv_spawn. Retrying with backoff lets the scan complete without a fixed sleep.
370:  */
371: const SPAWN_MAX_ATTEMPTS = 5;
372: 
373: /** Base delay (ms) between spawn retry attempts. Delay = attempt * base. */
374: const SPAWN_RETRY_BASE_MS = 500;
375: 
376: /**
377:  * Check whether an error is an EBUSY system error from spawn.
378:  *
379:  * On Windows, Defender/SmartScreen locks newly-written executables for
380:  * scanning. libuv's uv_spawn fails with EBUSY until the lock is released. ...
gateway · 2026-09-08 22:12:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Integration tests for delta upgrade orchestration with a non-dev CLI_VERSION.
3:  *
4:  * These tests use `vi.mock()` to override `CLI_VERSION` from constants.js
5:  * so that `canAttemptDelta()` passes its dev-build guard (the real `CLI_VERSION`
6:  * is "0.0.0-dev" in test mode, which short-circuits the orchestrator).
7:  *
8:  * Kept as a sibling file to `delta-upgrade.test.ts` because its
9:  * `vi.mock()` would invert the assumptions of the dev-mode null-return
10:  * tests in that file. Under `bun test --isolate` each file gets a fresh
11:  * module graph, so the mocks here don't leak. ...
gateway · 2026-09-08 22:13:26
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json:
  Line 107:     "binpatch": "^0.3.1",
gateway · 2026-09-08 22:15:02
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR Client Tests
3:  *
4:  * Unit tests for the GHCR/OCI download protocol helpers.
5:  * All HTTP calls are mocked via globalThis.fetch to avoid network access.
6:  */
7: 
8: import { afterEach, beforeEach, describe, expect, test } from "vitest";
9: import { UpgradeError } from "../../src/lib/errors.js";
10: import {
11:   downloadLayerBlob,
12:   downloadNightlyBlob,
13:   fetchManifest,
14:   fetchNightlyManifest,
15:   findLayerByFilename,
16:   GHCR_REPO,
17:   GHCR_TAG,
18:   getAnonymousToken,
19:   getNightlyVersion,
20:   listTags,
21:   type OciManifest,
22: } from "../../src/lib/ghcr.js";
23: 
24: /** Store original fetch for restoration */
25: let originalFetch: typeof globalThis.fetch;
26: 
27: /** Helper to mock fetch without TypeScript errors about missing Bun-specific properties */
28: ...
gateway · 2026-09-08 22:15:35
<!-- lore-recall:ff4dc4b5-f57f-457f-9731-2e413221b654 --><!-- lore-recall:b175e477-9433-4a4a-a800-a184ca270035 --><!-- lore-recall:2888968b-65fa-4f24-9a33-f3c2d982044a -->
gpt-5.6-sol · 2026-09-08 22:15:35 · ~81 tokens
result
Found 16 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 27:   getBinaryDownloadUrl,

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 443: export async function fetchLatestNightlyVersion(

  Line 474: export function fetchLatestVersion(

  Line 479:     return fetchLatestNightlyVersion();

  Line 527: export async function versionExists(

  Line 555: /** Result from downloadBinaryToTemp — includes both the binary path and lock path */

  Line 721:   const url = getBinaryDownloadUrl(version);

  Line 856: export async function downloadBinaryToTemp(

  Line 943:   return await attemptDeltaUpgrade(

  Line 982: function executeUpgradeHomebrew(): Promise<void> {

  Line 1017: function executeUpgradePackageManager(

  Line 1074: export async function executeUpgrade(

  Line 1083:       return downloadBinaryToTemp(version, downloadTag, offline, ...
gateway · 2026-09-08 22:15:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
350:   if (legacyMethod !== "unknown") {
351:     try {
352:       setInstallInfo({
353:         method: legacyMethod,
354:         path: process.execPath,
355:         version: CLI_VERSION,
356:       });
357:     } catch {
358:       log.debug("Failed to persist install info (DB may be read-only)");
359:     }
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): ...
gateway · 2026-09-08 22:16:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
952: /**
953:  * Download the full binary (non-delta path).
954:  *
955:  * @param version - Target version
956:  * @param downloadTag - Git tag override for the download URL
957:  * @param destPath - Path to write the binary
958:  */
959: async function downloadFullBinary(
960:   version: string,
961:   downloadTag: string | undefined,
962:   destPath: string,
963:   setMessage?: SetMessage
964: ): Promise<void> {
965:   if (isNightlyVersion(version)) {
966:     await downloadNightlyToPath(destPath, version, setMessage);
967:   } else {
968:     await downloadStableToPath(downloadTag ?? version, destPath, setMessage);
969:   }
970: }
971: 
972: /**
973:  * Execute upgrade via Homebrew. ...
gateway · 2026-09-08 22:16:32
<!-- lore-recall:686bc105-524d-44c0-bf6c-12a13e1a6c04 --><!-- lore-recall:00df2e10-0226-4666-b1ed-af2093c374ee -->
gpt-5.6-sol · 2026-09-08 22:16:32 · ~57 tokens
result
Found 36 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts:
  Line 10:  * into decades inspired by HTTP status semantics:

  Line 12:  * | Range | Category          | HTTP Analogy         |

  Line 17:  * | 20–29 | Input & config    | 400/404/422          |

  Line 48:   // 10–19: Auth & identity (HTTP 401/403 family)

  Line 58:   // 20–29: Input & config (HTTP 400/404/422 family)

  Line 68:   // 30–39: API & network (HTTP 502/503/504 family)

  Line 74:   // 40–49: Feature / billing (HTTP 402/451 family)

  Line 171:  * @param status - HTTP status code

  Line 176:   readonly status: number;

  Line 190:     status: number,

  Line 197:     this.status = status;

  Line 287:  * this before it reaches the global error handler. Think "HTTP 404 body":

  Line 364:  * @param headline - Describes the failure (e.g., "not found", "is ambiguous", "could not be resolved")

  Line 464:  * Project 'cli' not ...
gateway · 2026-09-08 22:16:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
570:  *
571:  * @param code - OAuth error code (e.g., "authorization_pending", "slow_down")
572:  * @param description - Human-readable error description
573:  */
574: export class DeviceFlowError extends CliError {
575:   readonly code: string;
576: 
577:   constructor(code: string, description?: string) {
578:     super(description ?? code, EXIT.DEVICE_FLOW);
579:     this.name = "DeviceFlowError";
580:     this.code = code;
581:   }
582: }
583: 
584: // Upgrade Errors
585: 
586: export type UpgradeErrorReason =
587:   | "unknown_method"
588:   | "unsupported_operation"
589:   | "network_error"
590:   | "execution_failed"
591:   | "version_not_found"
592:   | "offline_cache_miss";
593: 
594: /**
595:  * Upgrade-related errors. ...
gateway · 2026-09-08 22:17:01
<!-- lore-recall:341a3f85-c8b9-4894-93e6-2df6aa7462aa --><!-- lore-recall:e3ae168e-9434-4d04-9a0d-6cb68a3f1f6d -->
gpt-5.6-sol · 2026-09-08 22:17:01 · ~63 tokens
result
Found 92 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

  Line 136:   fetchLatestFromGitHub,

  Line 143:   versionExists,

  Line 189: describe("fetchLatestFromGitHub", () => {

  Line 204:     const version = await fetchLatestFromGitHub();

  Line 222:     const version = await fetchLatestFromGitHub();

  Line 240:     const version = await fetchLatestFromGitHub();

  Line 248:           status: 404,

  Line 252:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 253:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 254:       "Failed to fetch from GitHub: 404"

  Line 263:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 264:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 278:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 307:      ...
gateway · 2026-09-08 22:17:14
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 92: describe("getPlatformBinaryName", () => {

  Line 93:   test("returns a string starting with 'sentry-'", () => {

  Line 98:   test("contains platform and arch components", () => {

  Line 107:   test("has .exe suffix on windows platform name", () => {

  Line 119: describe("canAttemptDelta", () => {

  Line 120:   test("returns false for cross-channel upgrade (stable → nightly)", () => {

  Line 125:   test("returns false for dev build", () => {

  Line 130:   test("returns false for nightly target from dev build", () => {

  Line 138: describe("extractSha256", () => {

  Line 139:   test("extracts hex from sha256: prefixed digest", () => {

  Line 144:   test("returns null when no digest field", () => {

  Line 149:   test("returns null for empty digest", () => {

  Line 154:   ...
gateway · 2026-09-08 22:17:28
<!-- lore-recall:4a17b17d-afc0-4ad4-905c-9490962f7570 --><!-- lore-recall:9e1bcada-3f63-4a01-88d0-629545b78a7a --><!-- lore-recall:d0993f47-1359-45b3-b8db-4f66806fd819 --><!-- lore-recall:950bd79b-d917-450c-a12f-93567bfe2b4c --><!-- lore-recall:b51b14af-fb40-4aa1-9073-dc3ff4f58835 -->
gpt-5.6-sol · 2026-09-08 22:17:28 · ~142 tokens
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts:
  Line 16:   GHCR_REPO,

  Line 82:         `https://ghcr.io/token?scope=repository:${GHCR_REPO}:pull`

  Line 136:       expect(String(url)).toContain(`/v2/${GHCR_REPO}/manifests/${GHCR_TAG}`);

  Line 374:       expect(String(url)).toContain(`/v2/${GHCR_REPO}/manifests/patch-0.13.0`);

  Line 417:       expect(String(url)).toContain(`/v2/${GHCR_REPO}/tags/list`);

  Line 539:         expect(String(url)).toContain(`/v2/${GHCR_REPO}/blobs/sha256:abc123`);
gateway · 2026-09-08 22:17:38
<!-- lore-recall:7163db7b-b5b7-4acd-aabb-2b036cfaac3b --><!-- lore-recall:a1aed238-4da2-4166-8332-b2d05cb9c11e -->
gpt-5.6-sol · 2026-09-08 22:17:38 · ~57 tokens
result
Found 10 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 34: } from "../../src/lib/binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.mocked.test.ts:
  Line 23: import { getBinaryFilename, installBinary } from "../../src/lib/binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts:
  Line 22: } from "../../src/lib/ghcr.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 15: import { getPlatformBinaryName } from "../../src/lib/binary.js";

  Line 39: } from "../../src/lib/delta-upgrade.js";

  Line 40: import type { OciManifest } from ...
gateway · 2026-09-08 22:17:48
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts:
  Line 18:   GITHUB_RELEASES_URL,

  Line 564:       `${GITHUB_RELEASES_URL}?per_page=${CHANGELOG_MAX_RELEASES}`,

  Line 662:   const url = `https://api.github.com/repos/getsentry/cli/commits?sha=main&since=${sinceDate}&until=${untilDate}&per_page=100`;

  Line 696: /** Options for {@link fetchChangelog} */

  Line 720: export async function fetchChangelog(
gateway · 2026-09-08 22:17:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
520:       continue;
521:     }
522: 
523:     const description = ccMatch[2].trim();
524:     const existing = items.get(category) ?? [];
525:     existing.push(description);
526:     items.set(category, existing);
527:   }
528: 
529:   const sections: ChangeSection[] = [];
530:   for (const category of CATEGORY_ORDER) {
531:     const descriptions = items.get(category);
532:     if (descriptions && descriptions.length > 0) {
533:       const markdown = `${descriptions.map((d) => `- ${d}`).join("\n")}\n`;
534:       sections.push({ category, markdown });
535:     }
536:   }
537: 
538:   return sections;
539: }
540: 
541: // ────────────────────────────── Fetch Functions ────────────────────────────
542: 
543: /**
544:  * Max releases to fetch for changelog purposes. ...
gateway · 2026-09-08 22:18:04
result
Found 16 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 28:   resolveAndApply,

  Line 30:   type SourceStrategy,

  Line 122: function stableSource(): SourceStrategy {

  Line 132: function nightlySource(): SourceStrategy {

  Line 275:   return stableSource().resolveChain(currentVersion, targetVersion, signal);

  Line 426:   // Expose `current` so attemptDeltaUpgrade's catch path can stamp

  Line 453:   source: SourceStrategy,

  Line 461:   return resolveAndApply({

  Line 483:     stableSource(),

  Line 501:     nightlySource(),

  Line 511: export function attemptDeltaUpgrade(

  Line 531:           channel === "nightly" ? nightlySource() : stableSource(),

  Line 588: async function prefetch(

  Line 589:   source: SourceStrategy,

  Line 607:   return prefetch(nightlySource(), targetVersion, signal);

  Line 614:   return prefetch(stableSource(), targetVersion, signal);
gateway · 2026-09-08 22:18:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
240:         reason: "version-mismatch",
241:         expected: opts.expectedFrom,
242:         actual: fromVersion,
243:       },
244:     };
245:   }
246:   const result = binpatchValidateChainStep(manifest, opts);
247:   if (result.ok) {
248:     return result;
249:   }
250:   const layer = manifest.layers.find(
251:     (item) =>
252:       item.annotations?.["org.opencontainers.image.title"] ===
253:       opts.patchLayerName
254:   );
255:   return layer
256:     ? {
257:         ok: false,
258:         failure: {
259:           reason: "size-exceeded",
260:           layerSize: layer.size,
261:           budget: opts.sizeLimit,
262:         },
263:       }
264:     : {
265:         ok: false,
266:         failure: { reason: "missing-layer", layerName: opts.patchLayerName },
267:       };
268: }
269: 
270: ...
gateway · 2026-09-08 22:18:20
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 721:   const url = getBinaryDownloadUrl(version);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 151: export function getBinaryDownloadUrl(version: string): string {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 974:     const url = getBinaryDownloadUrl("1.0.0");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 39:     const url = getBinaryDownloadUrl("1.0.0");

  Line 53:     const url = getBinaryDownloadUrl("2.0.0");
gateway · 2026-09-08 22:18:38
<!-- lore-recall:94479ac4-14fb-41ab-a2a3-811e82090623 --><!-- lore-recall:d1eb288a-68f1-4ed1-86c1-5900295c55e1 -->
gpt-5.6-sol · 2026-09-08 22:18:38 · ~56 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management Tests
3:  *
4:  * Tests for shared binary helpers: install directory selection, paths,
5:  * download URLs, locking, and binary installation.
6:  */
7: 
8: import {
9:   chmodSync,
10:   mkdirSync,
11:   readFileSync,
12:   realpathSync,
13:   rmSync,
14:   symlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { access, readFile, writeFile } from "node:fs/promises";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: import {
21:   acquireLock,
22:   compareVersions,
23:   determineInstallDir,
24:   fetchWithUpgradeError,
25:   getBinaryDownloadUrl,
26:   getBinaryFilename,
27:   getBinaryPaths,
28:   getPlatformBinaryName,
29:   installBinary,
30:   isDowngrade,
31:   isMusl,
32:   releaseLock,
33:   ...
gateway · 2026-09-08 22:18:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
100:     }) as (cmd: string, args: string[], opts: object) => FakeProc,
101:   },
102: }));
103: // Initialize with the real default now that fakeProcess is defined
104: spawnImpl.fn = () => fakeProcess(0);
105: 
106: vi.mock("node:child_process", async (importOriginal) => {
107:   const orig = await importOriginal<typeof import("node:child_process")>();
108:   return {
109:     ...orig,
110:     spawn: (cmd: string, args: string[], opts: object) =>
111:       spawnImpl.fn(cmd, args, opts),
112:   };
113: });
114: 
115: // Dynamic imports: must run AFTER vi.mock() so upgrade.ts picks up the
116: // mocked spawn.
117: import { isEnoentSpawnError } from "../../src/commands/cli/upgrade.js";
118: import {
119:   acquireLock,
120:   getBinaryDownloadUrl,
121:   isNightlyVersion,
122:   releaseLock,
123: } from ...
gateway · 2026-09-08 22:19:02
<!-- lore-recall:04784485-2a29-4a37-be4f-5c42fb35c690 --><!-- lore-recall:3f9bd346-e5b8-4569-baf2-669039af1a3a -->
gpt-5.6-sol · 2026-09-08 22:19:02 · ~57 tokens
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 452:   const token = await getAnonymousToken();

  Line 458:   const manifest = await fetchNightlyManifest(token);

  Line 499:   const token = await getAnonymousToken();

  Line 501:     await fetchManifest(token, `nightly-${version}`);

  Line 688:   const token = await getAnonymousToken();

  Line 690:     ? await fetchManifest(token, `nightly-${version}`)

  Line 691:     : await fetchNightlyManifest(token);

  Line 694:   const response = await downloadNightlyBlob(token, layer.digest);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 294:     (await client.listTags(opts.token, PATCH_TAG_PREFIX, opts.signal));

  Line 307:       chainTags.map((tag) => client.fetchManifest(opts.token, tag, ...
gateway · 2026-09-08 22:19:48
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts
gateway · 2026-09-08 22:20:00
<!-- lore-recall:27c59cb1-c489-45b9-b348-3331dd753c90 --><!-- lore-recall:9cfc735a-da70-46da-8902-9993e90ce30f --><!-- lore-recall:708402e2-9dbe-4b51-858f-e1964d90c21c --><!-- lore-recall:f5a85b32-78e8-4d91-8801-7078cd9ca1cb -->
gpt-5.6-sol · 2026-09-08 22:20:00 · ~111 tokens
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the

  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 180:         // Use GHCR for nightly channel; GitHub Releases for stable.

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);
gateway · 2026-09-08 22:20:13
result
Found 30 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 375: export async function fetchLatestFromGitHub(

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 443: export async function fetchLatestNightlyVersion(

  Line 479:     return fetchLatestNightlyVersion();

  Line 482:     ? fetchLatestFromGitHub()

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 721:   const url = ...
gateway · 2026-09-08 22:22:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:   generate-patches:
431:     name: Generate Delta Patches
432:     needs: [changes, build-binary]
433:     # Only on main (nightlies) and release branches (stable) — skip PRs
434:     if: github.event_name != 'pull_request'
435:     runs-on: ubuntu-latest
436:     continue-on-error: true
437:     steps:
438:       - name: Install ORAS CLI
439:         # Only needed on main (to fetch previous nightly from GHCR)
440:         if: github.ref == 'refs/heads/main'
441:         run: |
442:           VERSION=1.3.1
443:           EXPECTED_SHA256="d52c4af76ce6a3ceb8579e51fb751a43ac051cca67f965f973a0b0e897a2bb86"
444:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"
445:           curl --retry 3 --retry-delay 5 --retry-all-errors -sfLo "$TARBALL" ...
gateway · 2026-09-08 22:23:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
1: #!/bin/bash
2: set -euo pipefail
3: 
4: RED='\033[0;31m'
5: MUTED='\033[0;2m'
6: NC='\033[0m'
7: 
8: # Sentry error telemetry — fire-and-forget error reporting via envelope API.
9: # Uses the CLI's public write-only DSN. No PII collected.
10: # Opt-out: SENTRY_CLI_NO_TELEMETRY=1
11: SENTRY_DSN_KEY="1188a86f3f8168f089450587b00bca66"
12: SENTRY_INGEST="https://o1.ingest.us.sentry.io"
13: SENTRY_PROJECT_ID="4510776311808000"
14: 
15: # Generate a UUID for the event. Tries /proc, uuidgen, then awk fallback. ...
gateway · 2026-09-08 22:27:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml</path>
<type>file</type>
<content>
1: minVersion: '2.21.1'
2: changelog:
3:   policy: auto
4: versioning:
5:   policy: auto
6: preReleaseCommand: bash -c 'cd packages/cli && node --experimental-strip-types script/bump-version.ts --pre'
7: postReleaseCommand: bash -c 'cd packages/cli && node --experimental-strip-types script/bump-version.ts --post'
8: artifactProvider:
9:   name: github
10:   config:
11:     artifacts:
12:       Build:
13:         - '/^sentry-.*$/'
14:         - 'npm-package'
15:         - 'gh-pages'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: gh-pages
20:   - name: registry
21:     apps:
22:       'app:sentry':
23:         name: 'Sentry CLI'
24:         packageUrl: 'https://www.npmjs.com/package/sentry'
25:         mainDocsUrl: 'https://cli.sentry.dev'
26:         urlTemplate: ...
gateway · 2026-09-08 22:27:32
<!-- lore-recall:606feaa3-6f1e-41eb-9509-88639224338e --><!-- lore-recall:1e9898b3-5eb1-4847-bea6-c1718fcc25d6 --><!-- lore-recall:3351f3ba-93d5-4a4c-a5ae-fb3ac344fc11 -->
gpt-5.6-sol · 2026-09-08 22:27:32 · ~86 tokens
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/db/install-info.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/uninstall.test.ts
gateway · 2026-09-08 22:27:43
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts:
  Line 45:     writeFileSync(join(binDir, "curl"), fakeCurl);

  Line 46:     chmodSync(join(binDir, "curl"), 0o755);

  Line 101:       "curl",
gateway · 2026-09-08 22:27:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Install Script Tests
3:  *
4:  * Exercises the shell installer with fake download tools so argument parsing and
5:  * setup delegation can be validated without network access.
6:  */
7: 
8: import { spawn } from "node:child_process";
9: import {
10:   chmodSync,
11:   mkdirSync,
12:   mkdtempSync,
13:   readFileSync,
14:   rmSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { tmpdir } from "node:os";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: 
21: function noop(): void {
22:   // Intentionally empty — absorbs async spawn errors
23: }
24: 
25: const repoRoot = join(import.meta.dirname, "..", "..");
26: const installScript = join(repoRoot, "install");
27: 
28: describe("install script", () => {
29:   let ...
gateway · 2026-09-08 22:28:08
<!-- lore-recall:36e15783-11cc-4d75-9808-411c1714a866 --><!-- lore-recall:7a1c2d72-b03b-4f65-81c4-91630e1e5806 --><!-- lore-recall:ec5b68fc-9b0e-43f6-964f-d285344d1cd2 -->
gpt-5.6-sol · 2026-09-08 22:28:08 · ~89 tokens
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/eval-common/anthropic-client.ts:
  Line 120:     throw new Error(`OpenRouter ${response.status}: ${detail}`);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 387:       `Failed to fetch from GitHub: ${response.status}`

  Line 419:       `Failed to fetch from npm: ${response.status}`

  Line 745:       `Failed to download binary: HTTP ${response.status}`


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/sentry-client.ts:
  Line 304:   if (response.status === 401) {

  Line 309:   if (RETRYABLE_STATUS_CODES.includes(response.status) && !isLastAttempt) {

  Line 612:           span.setAttribute("http.response.status_code", cached.status);

  Line 620:         ...
gateway · 2026-09-08 22:28:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Background version check for "new version available" notifications.
3:  *
4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the
5:  * latest nightly version via the OCI manifest annotation. For stable builds,
6:  * checks GitHub Releases. Results are cached in the database and shown on
7:  * subsequent runs.
8:  */
9: 
10: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
11: import * as Sentry from "@sentry/node-core/light";
12: import { compare as semverCompare } from "semver";
13: import { CLI_VERSION } from "./constants.js";
14: import { getReleaseChannel } from "./db/release-channel.js";
15: import {
16:   getVersionCheckInfo,
17:   markUpdateNotified,
18:   setVersionCheckInfo,
19: } from "./db/version-check.js";
20: ...
gateway · 2026-09-08 22:30:12
result
{
  "name": "binpatch",
  "version": "0.3.1",
  "type": "module",
  "license": "MIT",
  "description": "Reusable binary delta-update engine: apply TRDIFF10/bsdiff+zstd patch chains to a binary and discover chains from a pluggable source (OCI/GHCR or GitHub Releases). Pure Node, zero product coupling.",
  "author": "BYK",
  "homepage": "https://github.com/BYK/binpatch#readme",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/BYK/binpatch.git"
  },
  "bugs": {
    "url": "https://github.com/BYK/binpatch/issues"
  },
  "keywords": [
    "bsdiff",
    "bspatch",
    "trdiff10",
    "zstd",
    "binary",
    "delta",
    "patch",
    "update",
    "self-update",
    "oci",
    "ghcr"
  ],
  "main": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js"
    }
  },
  "files": [
    "dist/",
    "README.md",
    "LICENSE"
  ],
  "sideEffects": false,
  "engines": {
    "node": ...
gateway · 2026-09-08 22:30:27
result
/**
 * Streaming TRDIFF10 Binary Patch Application
 *
 * Implements the bspatch algorithm for applying binary delta patches in the
 * TRDIFF10 format (produced by zig-bsdiff with `--use-zstd`). Designed for
 * minimal memory usage during CLI self-upgrades:
 *
 * - Old binary: read windows on demand via positional `read()` (`pread`)
 *   through a single-block read-ahead cache, so the base never sits fully in
 *   the JS heap — only the windows actually referenced are pulled in, served
 *   from the OS page cache populated by the reflink copy.
 * - Diff/extra blocks: streamed via `node:zlib` `createZstdDecompress()`
 * - Output: written incrementally to disk via `node:fs` createWriteStream
 *   with a large highWaterMark to collapse thousands of small write syscalls. ...
gateway · 2026-09-08 22:30:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md</path>
<type>file</type>
<content>
1: <!-- Managed by lore (https://github.com/BYK/loreai) — manual edits are imported on next session. -->
2: 
3: ## Long-term Knowledge
4: 
5: ### Architecture
6: 
7: <!-- lore:01a082c2-7319-7203-9f61-05a59272a7f0 -->
8: * **atomicWriteFile skill installation**: Chose same-directory temporary writes followed by \`rename()\` over writing skill destinations directly because concurrent readers must never observe truncated content. Temporary names are dot-prefixed \`\*.tmp\` paths that cannot match \`SKILL.md\` or \`\*.md\` discovery globs. \`installAgentSkills()\` writes only beneath pre-existing \`.agents\` or \`.claude\` roots; creating those roots would falsely signal that an agent is installed.
9: 
10: <!-- lore:019e56e2-f89c-7846-8953-1e47fb470cbf -->
11: * **Binary size breakdown: 94.5% is Node.js runtime — bundled code is ~6.3 MiB**: ...
gateway · 2026-09-08 22:35:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-08 22:35:36
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 40:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/cache-hint.ts:
  Line 9:  * getsentry/cli#785 item #1 — `-f/--fresh` flag discoverability.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 152:   return `https://github.com/getsentry/cli/releases/download/${version}/${getPlatformBinaryName()}`;

  Line 157:   "https://api.github.com/repos/getsentry/cli/releases";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/auth-hint.ts:
  Line 8:  * UX feedback issue (getsentry/cli#785 #4). The hint surfaces ...
gateway · 2026-09-08 22:35:53
result
Found 13 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 657: //   1. Mocking fetch to return a fake binary payload for downloadBinaryToTemp

  Line 724:     for (const suffix of ["", ".download", ".old", ".lock"]) {

  Line 736:    * minimal valid gzipped binary for downloadBinaryToTemp.

  Line 749:       // Binary download (.gz or raw)

  Line 754:   test("runs setup on downloaded binary after curl upgrade", async () => {

  Line 771:     // Verify child_process.spawn was called with the downloaded binary + setup args

  Line 784:     // Use a unified mock that handles both the version endpoint and binary download

  Line 795:       // Binary download (both .gz and raw URLs)

  Line 811:   test("downloads nightly binary from GHCR for nightly channel", async () => {

  Line 816:     // GHCR flow: token exchange → manifest → blob redirect → blob download

  Line 876:   ...
gateway · 2026-09-08 22:36:06
<!-- lore-recall:0db36fe2-0700-4d39-a989-caa1f41fd747 --><!-- lore-recall:d2285897-b31a-4a71-8d0c-0b0dc63ad997 -->
gpt-5.6-sol · 2026-09-08 22:36:06 · ~56 tokens
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts:
  Line 11: } from "../../src/lib/db/version-check.js";

  Line 24: } from "../../src/lib/version-check.js";

  Line 473:       const { getUpdateNotification, maybeCheckForUpdateInBackground } = await import('./src/lib/version-check.js');
gateway · 2026-09-08 22:36:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-08 22:36:22
<!-- lore-recall:e8ed3301-d726-4fbc-9eb1-361b65446a79 --><!-- lore-recall:90339282-a840-4816-9d80-c2d90f8281af -->
gpt-5.6-sol · 2026-09-08 22:36:22 · ~53 tokens
result
Found 29 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 79: export const NIGHTLY_TAG = "nightly";

  Line 85: export const VERSION_PREFIX_REGEX = /^v/;

  Line 100: function getKnownCurlPaths(): string[] {

  Line 116: export function getCurlInstallPaths(): {

  Line 158: export function startCleanupOldBinary(): void {

  Line 176: function runCommand(

  Line 209: async function isInstalledWith(pm: PackageManager): Promise<boolean> {

  Line 234: function isHomebrewInstall(): boolean {

  Line 260: export function detectPackageManagerFromPath(): PackageManager | null {

  Line 291: async function detectLegacyInstallationMethod(): Promise<InstallationMethod> {

  Line 331: export async function detectInstallationMethod(): Promise<InstallationMethod> {

  Line 375: export async function fetchLatestFromGitHub(

  Line 409: export async function fetchLatestFromNpm(): Promise<string> {

  ...
gateway · 2026-09-08 22:36:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-08 22:36:48
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts:
  Line 554:  * Uses a higher `per_page` than `fetchRecentReleases()` in delta-upgrade


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 155: export async function fetchRecentReleases(
gateway · 2026-09-08 22:37:02
result
Found 10 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts:
  Line 599:  * @param prefetchedReleases - Optional releases already fetched by the caller

  Line 606:   prefetchedReleases?: GitHubRelease[]

  Line 608:   const releases = prefetchedReleases ?? (await fetchReleasesForChangelog());

  Line 696: /** Options for {@link fetchChangelog} */

  Line 707:   prefetchedReleases?: GitHubRelease[];

  Line 720: export async function fetchChangelog(

  Line 724:     const { channel, fromVersion, toVersion, maxItems, prefetchedReleases } =

  Line 733:       prefetchedReleases


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts:
  Line 43:   fetchChangelog,

  Line 739:   return fetchChangelog({
gateway · 2026-09-08 22:37:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
705:   return { channel, versionArg, channelChanged, method };
706: }
707: 
708: /**
709:  * Persist the release channel preference. Must be called **after** offline
710:  * target resolution since `setReleaseChannel()` clears the version check
711:  * cache on channel changes, which would prevent `resolveOfflineTarget()`
712:  * from reading the cached version.
713:  */
714: function persistChannel(
715:   channel: ReleaseChannel,
716:   channelChanged: boolean,
717:   version: string | undefined
718: ): void {
719:   if (channelChanged || CHANNEL_VERSIONS.has(version ?? "")) {
720:     setReleaseChannel(channel);
721:   }
722: }
723: 
724: /**
725:  * Start a best-effort changelog fetch in parallel with the binary download.
726:  *
727:  * Returns a promise that resolves to the changelog or undefined. ...
gateway · 2026-09-08 22:37:18
<!-- lore-recall:0b5f6595-1601-43da-9920-89f28a9c9e59 --><!-- lore-recall:f0860c00-98d4-4afb-b407-1754e123f53a -->
gpt-5.6-sol · 2026-09-08 22:37:18 · ~58 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * sentry cli upgrade
3:  *
4:  * Self-update the Sentry CLI to the latest or a specific version.
5:  * After upgrading, spawns the NEW binary with `cli setup` to update
6:  * completions, agent skills, and record installation metadata.
7:  *
8:  * Supports two release channels:
9:  * - stable (default): tracks the latest GitHub release
10:  * - nightly: tracks the rolling nightly prerelease built from main
11:  *
12:  * The channel can be set via --channel or by passing "nightly"/"stable"
13:  * as the version argument. The choice is persisted in the local database
14:  * so that subsequent bare `sentry cli upgrade` calls use the same channel. ...
gateway · 2026-09-08 22:38:00
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
130:   );
131: }
132: 
133: /** GHCR repository for CLI distribution */
134: export const GHCR_REPO = "getsentry/cli";
135: 
136: /** OCI tag for nightly builds */
137: export const GHCR_TAG = "nightly";
138: 
139: /** Base URL for GHCR registry API */
140: const GHCR_REGISTRY = "https://ghcr.io";
141: 
142: /** OCI manifest media type */
143: const OCI_MANIFEST_TYPE = "application/vnd.oci.image.manifest.v1+json";
144: 
145: /**
146:  * A single layer entry from an OCI manifest.
147:  *
148:  * Each binary in the nightly push is stored as a separate layer.
149:  * The `annotations` map includes `org.opencontainers.image.title` (filename)
150:  * and `org.opencontainers.image.created` (push time).
151:  */
152: export type OciLayer = {
153:   /** Content-addressable digest for the blob (e.g., "sha256:abc123...") */
154:   ...
gateway · 2026-09-08 22:38:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
420:   if (!Number.isNaN(existingPid) && isProcessRunning(existingPid)) {
421:     // If the lock holder is our parent process (upgrade command spawned
422:     // setup --install), take over the lock instead of failing. This allows
423:     // the download→install pipeline to stay locked against concurrent upgrades
424:     // while handing off from parent to child.
425:     if (existingPid === process.ppid) {
426:       writeFileSync(lockPath, String(process.pid));
427:       return;
428:     }
429:     throw new UpgradeError(
430:       "execution_failed",
431:       "Another upgrade is already in progress"
432:     );
433:   }
434: 
435:   // Stale lock from dead process — remove and retry
436:   try {
437:     unlinkSync(lockPath);
438:   } catch (error) {
439:     // Only proceed if file already gone ...
gateway · 2026-09-08 22:39:09
result
StatusCode: non 2xx status code (404 GET https://raw.githubusercontent.com/BYK/binpatch/v0.3.1/src/sources/github-releases.ts)
gateway · 2026-09-08 22:40:25
result
[
  {
    "name": "bspatch.ts",
    "path": "src/bspatch.ts",
    "sha": "38c1108c70e42e02ca150b0d45250437e028938f",
    "size": 29342,
    "url": "https://api.github.com/repos/BYK/binpatch/contents/src/bspatch.ts?ref=main",
    "html_url": "https://github.com/BYK/binpatch/blob/main/src/bspatch.ts",
    "git_url": "https://api.github.com/repos/BYK/binpatch/git/blobs/38c1108c70e42e02ca150b0d45250437e028938f",
    "download_url": "https://raw.githubusercontent.com/BYK/binpatch/main/src/bspatch.ts",
    "type": "file",
    "_links": {
      "self": "https://api.github.com/repos/BYK/binpatch/contents/src/bspatch.ts?ref=main",
      "git": "https://api.github.com/repos/BYK/binpatch/git/blobs/38c1108c70e42e02ca150b0d45250437e028938f",
      "html": "https://github.com/BYK/binpatch/blob/main/src/bspatch.ts"
    }
  },
  {
    "name": "contract.ts",
    "path": "src/contract.ts",
    "sha": "8192cbc8d7a570cb9733c010bd048261545896c6",
    "size": 2330,
    "url": ...
gateway · 2026-09-08 22:40:31
result
[
  {
    "name": "ghcr.ts",
    "path": "src/sources/ghcr.ts",
    "sha": "acf7a7bc8a56c3d464878b38576725ba9bd32095",
    "size": 12480,
    "url": "https://api.github.com/repos/BYK/binpatch/contents/src/sources/ghcr.ts?ref=main",
    "html_url": "https://github.com/BYK/binpatch/blob/main/src/sources/ghcr.ts",
    "git_url": "https://api.github.com/repos/BYK/binpatch/git/blobs/acf7a7bc8a56c3d464878b38576725ba9bd32095",
    "download_url": "https://raw.githubusercontent.com/BYK/binpatch/main/src/sources/ghcr.ts",
    "type": "file",
    "_links": {
      "self": "https://api.github.com/repos/BYK/binpatch/contents/src/sources/ghcr.ts?ref=main",
      "git": "https://api.github.com/repos/BYK/binpatch/git/blobs/acf7a7bc8a56c3d464878b38576725ba9bd32095",
      "html": "https://github.com/BYK/binpatch/blob/main/src/sources/ghcr.ts"
    }
  },
  {
    "name": "github-release.ts",
    "path": "src/sources/github-release.ts",
    "sha": "64252b370d2e502d4718604d3555178c5f078b74",
    "size": ...
gateway · 2026-09-08 22:40:42
result
/**
 * GitHub Release-asset patch source (the "stable" channel).
 *
 * Resolves a patch chain from GitHub Release assets. Each release for the
 * target platform publishes three assets:
 * - `<binaryName>`        — the binary (its digest → expected SHA-256)
 * - `<binaryName>.gz`     — gzipped binary (its size → the ratio gate)
 * - `<binaryName>.patch`  — the delta patch from the previous release
 *
 * The chain is the releases between current and target, oldest-first, capped
 * at {@link MAX_STABLE_CHAIN_DEPTH} and by {@link SIZE_THRESHOLD_RATIO}.
 *
 * All product specifics (owner/repo, binary name, user-agent, fetch) are
 * injected. Generalized from Lore's stable-channel resolver.
 */

import {
  type InstrumentHook,
  MAX_STABLE_CHAIN_DEPTH,
  type PatchChain,
  type PatchLink,
  SIZE_THRESHOLD_RATIO,
} from "../contract";
import type { SourceStrategy } from "../discover";

const SHA256_DIGEST_PATTERN = /^sha256:([0-9a-f]+)$/i;

export type GitHubAsset = {
  name: string;
  ...
gateway · 2026-09-08 22:41:22
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 265: export function getGitHubHeaders(): Record<string, string> {

  Line 283: export async function fetchWithUpgradeError(
gateway · 2026-09-08 22:41:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
250:   const candidates = [join(homeDir, ".local", "bin"), join(homeDir, "bin")];
251: 
252:   for (const dir of candidates) {
253:     if (existsSync(dir) && pathDirs.includes(dir)) {
254:       return dir;
255:     }
256:   }
257: 
258:   // 4. Fallback — setup will handle adding this to PATH
259:   return join(homeDir, ".sentry", "bin");
260: }
261: 
262: /**
263:  * Build headers for GitHub API requests.
264:  */
265: export function getGitHubHeaders(): Record<string, string> {
266:   return {
267:     Accept: "application/vnd.github.v3+json",
268:     "User-Agent": getUserAgent(),
269:   };
270: }
271: 
272: /**
273:  * Fetch wrapper that converts network errors to UpgradeError.
274:  * Handles DNS failures, timeouts, and other connection issues. ...
gateway · 2026-09-08 22:41:40
<!-- lore-recall:8856d95b-5df0-4dee-ac2f-bb56ee37ec0a --><!-- lore-recall:a1cee185-109b-464e-96b3-6b9496d540ca --><!-- lore-recall:1ea15a50-b9ae-436d-9c47-e21fd1d97dfe -->
gpt-5.6-sol · 2026-09-08 22:41:40 · ~85 tokens
result
No files found
gateway · 2026-09-08 22:42:11
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts:
  Line 63:         // Download old and new binaries from GitHub Releases

  Line 64:         const baseUrl = "https://github.com/getsentry/cli/releases/download";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 344: // below (around line 1153) which tests the GHCR-based implementation.

  Line 488:   test("uses GHCR manifest when channel is nightly (curl method)", async () => {

  Line 489:     // Nightly version is now fetched from GHCR manifest annotation, not version.json

  Line 492:       if (urlStr.includes("ghcr.io/token")) {

  Line 510:   test("uses GHCR manifest when channel is nightly (npm method)", async () => {

  Line 511:     // Even npm method uses GHCR when channel=nightly (nightly is ...
gateway · 2026-09-08 22:42:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-08 22:42:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management Tests
3:  *
4:  * Tests for shared binary helpers: install directory selection, paths,
5:  * download URLs, locking, and binary installation.
6:  */
7: 
8: import {
9:   chmodSync,
10:   mkdirSync,
11:   readFileSync,
12:   realpathSync,
13:   rmSync,
14:   symlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { access, readFile, writeFile } from "node:fs/promises";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: import {
21:   acquireLock,
22:   compareVersions,
23:   determineInstallDir,
24:   fetchWithUpgradeError,
25:   getBinaryDownloadUrl,
26:   getBinaryFilename,
27:   getBinaryPaths,
28:   getPlatformBinaryName,
29:   installBinary,
30:   isDowngrade,
31:   isMusl,
32:   releaseLock,
33:   ...
gateway · 2026-09-08 22:43:03
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR Client Tests
3:  *
4:  * Unit tests for the GHCR/OCI download protocol helpers.
5:  * All HTTP calls are mocked via globalThis.fetch to avoid network access.
6:  */
7: 
8: import { afterEach, beforeEach, describe, expect, test } from "vitest";
9: import { UpgradeError } from "../../src/lib/errors.js";
10: import {
11:   downloadLayerBlob,
12:   downloadNightlyBlob,
13:   fetchManifest,
14:   fetchNightlyManifest,
15:   findLayerByFilename,
16:   GHCR_REPO,
17:   GHCR_TAG,
18:   getAnonymousToken,
19:   getNightlyVersion,
20:   listTags,
21:   type OciManifest,
22: } from "../../src/lib/ghcr.js";
23: 
24: /** Store original fetch for restoration */
25: let originalFetch: typeof globalThis.fetch;
26: 
27: /** Helper to mock fetch without TypeScript errors about missing Bun-specific properties */
28: ...
gateway · 2026-09-08 22:43:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): Promise<string> {
378:   const response = await fetchWithUpgradeError(
379:     `${GITHUB_RELEASES_URL}/latest`,
380:     { headers: getGitHubHeaders(), signal },
381:     "GitHub"
382:   );
383: 
384:   if (!response.ok) {
385:     throw new UpgradeError(
386:       "network_error",
387:       `Failed to fetch from ...
gateway · 2026-09-08 22:44:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-08 22:44:41
result
Found 20 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 23: } from "./delta-upgrade.js";

  Line 27: import { cleanupPatchCache } from "./patch-cache.js";

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 36: } from "./binary.js";

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 50: } from "./ghcr.js";

  Line 52: import { clearPatchCache } from "./patch-cache.js";

  Line 60: export type { InstallationMethod } from "./binary.js";

  Line 62: export { parseInstallationMethod } from "./binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/telemetry.ts:
  Line 19: import { isMusl } ...
gateway · 2026-09-08 22:44:52
result
Found 37 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 721:   const url = getBinaryDownloadUrl(version);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 156: export const GITHUB_RELEASES_URL =


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

  Line 972: describe("getBinaryDownloadUrl", () => {

  Line 974:     const url = ...
gateway · 2026-09-08 22:45:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
1: /**
2:  * Release Notes Parser & Aggregation
3:  *
4:  * Extracts user-facing changelog entries from GitHub Release bodies (stable)
5:  * or conventional commit messages (nightly). Uses `marked.lexer()` for
6:  * AST-based section extraction and produces structured data that can be
7:  * re-serialized as filtered markdown for rendering via `renderMarkdown()`. ...
gateway · 2026-09-08 22:45:45
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 49: export type {

  Line 65: export type DeltaResult = {

  Line 79: function patchCacheKey(fromVersion: string, toVersion: string): string {

  Line 83: function instrumentCache(base: PatchCache): PatchCache {

  Line 118: function getPatchCache(): PatchCache {

  Line 122: function stableSource(): SourceStrategy {

  Line 132: function nightlySource(): SourceStrategy {

  Line 145: export function canAttemptDelta(targetVersion: string): boolean {

  Line 155: export async function fetchRecentReleases(

  Line 181: export async function downloadStablePatch(

  Line 197: export function extractStableChain(

  Line 204: export function filterAndSortChainTags(

  Line 217: type ChainStepResult =

  Line 231: export function validateChainStep(

  Line 270: export function resolveStableChain(

  Line 278: export async function ...
gateway · 2026-09-08 22:46:03
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
250:   const layer = manifest.layers.find(
251:     (item) =>
252:       item.annotations?.["org.opencontainers.image.title"] ===
253:       opts.patchLayerName
254:   );
255:   return layer
256:     ? {
257:         ok: false,
258:         failure: {
259:           reason: "size-exceeded",
260:           layerSize: layer.size,
261:           budget: opts.sizeLimit,
262:         },
263:       }
264:     : {
265:         ok: false,
266:         failure: { reason: "missing-layer", layerName: opts.patchLayerName },
267:       };
268: }
269: 
270: export function resolveStableChain(
271:   currentVersion: string,
272:   targetVersion: string,
273:   signal?: AbortSignal
274: ): Promise<PatchChain | null> {
275:   return stableSource().resolveChain(currentVersion, targetVersion, signal);
276: }
277: 
278: export ...
gateway · 2026-09-08 22:46:13
<!-- lore-recall:9205deaf-09ec-45db-a0e1-1e144550a70d --><!-- lore-recall:3e21170e-dde1-4dc7-a170-abce66eed1e6 -->
gpt-5.6-sol · 2026-09-08 22:46:13 · ~55 tokens
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts:
  Line 18: import { applyPatch, applyPatchChainInMemory } from "binpatch";

  Line 108:         const chainSha = await applyPatchChainInMemory(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/bspatch.test.ts:
  Line 22:   applyPatchChainInMemory,

  Line 275: describe("applyPatchChainInMemory", () => {

  Line 298:       const sha256 = await applyPatchChainInMemory(oldPath, [p1, p2], destPath);

  Line 334:       await applyPatchChainInMemory(oldPath, [p1, p2], destPath, (n) => {

  Line 358:       const sha256 = await applyPatchChainInMemory(

  Line 381:         applyPatchChainInMemory(oldPath, [], ...
gateway · 2026-09-08 22:47:48
result
/**
 * OCI (GHCR-style) anonymous-pull client.
 *
 * Encapsulates the OCI download protocol for fetching binaries and patch
 * artifacts from a container registry (ghcr.io by default). Anonymous,
 * read-only: performs the standard token exchange, fetches manifests, lists
 * tags, and downloads blobs.
 *
 * Registry / repository / user-agent are all injected — no product coupling.
 * Generalized from Lore's `ghcr.ts`.
 *
 * Redirect quirk: ghcr.io blob downloads return a 307 to Azure Blob Storage.
 * Following the redirect automatically would forward the Authorization header
 * to Azure (→ 404), so redirects are followed manually WITHOUT the auth header.
 */

import { BinpatchError } from "../errors";

/** Default timeout for registry metadata requests (10s). */
const REQUEST_TIMEOUT = 10_000;

/** Retry attempts for transient failures. */
const MAX_RETRIES = 1;

/** Timeout for (larger) blob downloads (30s). */
const BLOB_TIMEOUT = 30_000;

/** Page size for tag-listing pagination. ...
gateway · 2026-09-08 22:47:58
result
No files found
gateway · 2026-09-08 22:48:09
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts:
  Line 4:  * These tests use `vi.mock()` to override `CLI_VERSION` from constants.js

  Line 9:  * `vi.mock()` would invert the assumptions of the dev-mode null-return

  Line 22: useTestConfigDir("delta-upgrade-mocked-");

  Line 32: vi.mock("../../src/lib/constants.js", async (importOriginal) => {

  Line 41: // Import AFTER mock setup so the mocked constants are used

  Line 317:     // CLI_VERSION is mocked as "0.13.0" (stable), target is nightly
gateway · 2026-09-08 22:48:26
result
No files found
gateway · 2026-09-08 22:48:38
<!-- lore-recall:192928d0-1582-4079-aa66-9db8d259ffea --><!-- lore-recall:c49f8193-03f1-43fc-a823-21a6765c187b --><!-- lore-recall:99961fd6-ae91-49a9-87ec-559fb998a9fb -->
gpt-5.6-sol · 2026-09-08 22:48:38 · ~81 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module Tests
3:  *
4:  * Tests for upgrade detection and logic.
5:  *
6:  * The `executeUpgrade` and `detectInstallationMethod` subprocess tests use
7:  * `vi.mock("node:child_process", ...)` at the top of this file to
8:  * intercept `spawn()` calls via a swappable `spawnImpl`. Non-spawn exports
9:  * pass through to the real `node:child_process`. ...
gateway · 2026-09-08 22:48:51
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
365:   });
366: 
367:   test("creates error with default message for version_not_found", () => {
368:     const error = new UpgradeError("version_not_found");
369:     expect(error.reason).toBe("version_not_found");
370:     expect(error.message).toBe("The specified version was not found.");
371:   });
372: 
373:   test("creates error with default message for unsupported_operation", () => {
374:     const error = new UpgradeError("unsupported_operation");
375:     expect(error.reason).toBe("unsupported_operation");
376:     expect(error.message).toBe(
377:       "This operation is not supported for this installation method."
378:     );
379:   });
380: 
381:   test("creates error with default message for offline_cache_miss", () => {
382:     const error = new UpgradeError("offline_cache_miss");
383:     ...
gateway · 2026-09-08 22:50:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
820:     );
821:     await setTimeout(delay);
822:   }
823:   throw new UpgradeError(
824:     "execution_failed",
825:     `Downloaded binary is missing or empty at ${path}. ` +
826:       "This is usually transient — rerun `sentry cli upgrade` to retry."
827:   );
828: }
829: 
830: /**
831:  * Download the new binary to a temporary path and return its location.
832:  * Used by the upgrade command to download before spawning setup --install.
833:  *
834:  * For **nightly** versions (detected via {@link isNightlyVersion}), downloads
835:  * from GHCR using the OCI blob download protocol via {@link downloadNightlyToPath}.
836:  *
837:  * For **stable** versions, downloads from GitHub Releases via
838:  * {@link downloadStableToPath}. ...
gateway · 2026-09-08 22:50:26
<!-- lore-recall:6c42a15c-b7c9-4c76-ac14-72628a72ec25 --><!-- lore-recall:523a425b-e98b-4224-9b5d-df98ba3dbc87 -->
gpt-5.6-sol · 2026-09-08 22:50:26 · ~57 tokens
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 38: * **getsentry/cli two dependabot endpoints: advisories empty, alerts source of truth**: GitHub Dependabot data sources for getsentry/cli: - \`/repos/getsentry/cli/security-advisories\` → empty array (no published advisories for this repo). - \`/repos/getsentry/cli/dependabot/alerts\` → source of truth: 13 open, 15 fixed as of 2026-08-01. Alert taxonomy in this repo: alerts reference lockfiles (stale entries with no source manifest) OR transitive deps (no direct upgrade path). pnpm.overrides (\`package.json\`) is the canonical fix mechanism for transitive vulns — direct dep upgrades cascade via lockfile only. Sibling surfaces: \`pnpm audit\` reports additional CVEs not surfaced by Dependabot (e.g. @ai-sdk/provider-utils@<=3.0.97 LOW CVE-2026-8769) — separate scope, requires package upgrade not override. ...
gateway · 2026-09-08 22:50:51
result
File not found: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.cursor/rules/ultracite.mdc
gateway · 2026-09-08 22:51:00
result
No files found
gateway · 2026-09-08 22:51:24
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/AGENTS.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/CONTRIBUTING.md
gateway · 2026-09-08 22:51:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-08 22:51:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Background version check for "new version available" notifications.
3:  *
4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the
5:  * latest nightly version via the OCI manifest annotation. For stable builds,
6:  * checks GitHub Releases. Results are cached in the database and shown on
7:  * subsequent runs.
8:  */
9: 
10: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
11: import * as Sentry from "@sentry/node-core/light";
12: import { compare as semverCompare } from "semver";
13: import { CLI_VERSION } from "./constants.js";
14: import { getReleaseChannel } from "./db/release-channel.js";
15: import {
16:   getVersionCheckInfo,
17:   markUpdateNotified,
18:   setVersionCheckInfo,
19: } from "./db/version-check.js";
20: ...
gateway · 2026-09-08 22:52:43
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/init/tools/apply-patchset.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6f...
gateway · 2026-09-08 22:52:54
result
Found 17 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 122: function stableSource(): SourceStrategy {

  Line 132: function nightlySource(): SourceStrategy {

  Line 155: export async function fetchRecentReleases(

  Line 181: export async function downloadStablePatch(

  Line 270: export function resolveStableChain(

  Line 275:   return stableSource().resolveChain(currentVersion, targetVersion, signal);

  Line 278: export async function resolveNightlyChain(opts: {

  Line 452: function resolveDelta(

  Line 482:   return resolveDelta(

  Line 483:     stableSource(),

  Line 500:   return resolveDelta(

  Line 501:     nightlySource(),

  Line 530:         const resolved = await resolveDelta(

  Line 531:           channel === "nightly" ? ...
gateway · 2026-09-08 22:53:02
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Integration tests for delta upgrade orchestration with a non-dev CLI_VERSION.
3:  *
4:  * These tests use `vi.mock()` to override `CLI_VERSION` from constants.js
5:  * so that `canAttemptDelta()` passes its dev-build guard (the real `CLI_VERSION`
6:  * is "0.0.0-dev" in test mode, which short-circuits the orchestrator).
7:  *
8:  * Kept as a sibling file to `delta-upgrade.test.ts` because its
9:  * `vi.mock()` would invert the assumptions of the dev-mode null-return
10:  * tests in that file. Under `bun test --isolate` each file gets a fresh
11:  * module graph, so the mocks here don't leak. ...
gateway · 2026-09-08 22:53:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
1: /**
2:  * CLI Error Hierarchy
3:  *
4:  * Unified error classes for consistent error handling across the CLI.
5:  *
6:  * ## Exit Code Ranges
7:  *
8:  * Each error class maps to a semantic exit code so scripts and agents can
9:  * react to failure categories without parsing stderr. Codes are grouped
10:  * into decades inspired by HTTP status semantics:
11:  *
12:  * | Range | Category          | HTTP Analogy         |
13:  * |-------|-------------------|----------------------|
14:  * | 0     | Success           | 200 OK               |
15:  * | 1     | General error     | 500 Internal         |
16:  * | 10–19 | Auth & identity   | 401/403              |
17:  * | 20–29 | Input & config    | 400/404/422          |
18:  * | 30–39 | API & network     | 502/503/504          |
19:  * | 40–49 | Feature/billing   | ...
gateway · 2026-09-08 22:53:33
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts:
  Line 586: export type UpgradeErrorReason =

  Line 600: export class UpgradeError extends CliError {

  Line 601:   readonly reason: UpgradeErrorReason;

  Line 603:   constructor(reason: UpgradeErrorReason, message?: string) {

  Line 604:     const defaultMessages: Record<UpgradeErrorReason, string> = {
gateway · 2026-09-08 22:53:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
570:  *
571:  * @param code - OAuth error code (e.g., "authorization_pending", "slow_down")
572:  * @param description - Human-readable error description
573:  */
574: export class DeviceFlowError extends CliError {
575:   readonly code: string;
576: 
577:   constructor(code: string, description?: string) {
578:     super(description ?? code, EXIT.DEVICE_FLOW);
579:     this.name = "DeviceFlowError";
580:     this.code = code;
581:   }
582: }
583: 
584: // Upgrade Errors
585: 
586: export type UpgradeErrorReason =
587:   | "unknown_method"
588:   | "unsupported_operation"
589:   | "network_error"
590:   | "execution_failed"
591:   | "version_not_found"
592:   | "offline_cache_miss";
593: 
594: /**
595:  * Upgrade-related errors. ...
gateway · 2026-09-08 22:54:06
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md</path>
<type>file</type>
<content>
155: <!-- lore:019f03bb-fa01-76c2-9acf-42a059c4fe6a -->
156: * **Biome stdin check reports 'contents aren't fixed' false positive — use file path instead**: Trap: running \`biome check --stdin-file-path=\<file>\` and piping content exits with code 1 and 'contents aren't fixed' even when \`--write\` produces no diff — looks like a real formatting violation. Fix: run Biome directly on the file path (\`biome check \<file>\`) rather than via stdin mode. The stdin mode false positive was confirmed during the \`agent-skills.ts\` review: exit code 1 from stdin, but \`--write\` produced zero changes. Always use file-path invocation for authoritative Biome results.
157: 
158: <!-- lore:019f03b9-97b3-7520-be29-bd6ac87986fd -->
159: * **build-binary job in ci.yml uses setup-node — not Bun-only as commonly assumed**: Trap: \`build-binary\` job in ...
gateway · 2026-09-08 23:01:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
120:     return false;
121:   }
122: }
123: 
124: /**
125:  * Build the platform-specific binary base name.
126:  *
127:  * Matches the naming convention used by GitHub Releases and GHCR:
128:  * `sentry-<os>-<arch>[-musl][.exe]` (e.g., `sentry-linux-x64`, `sentry-linux-arm64-musl`).
129:  */
130: export function getPlatformBinaryName(): string {
131:   let os: string;
132:   if (process.platform === "darwin") {
133:     os = "darwin";
134:   } else if (process.platform === "win32") {
135:     os = "windows";
136:   } else {
137:     os = "linux";
138:   }
139:   const arch = process.arch === "arm64" ? "arm64" : "x64";
140:   const libcSuffix = isMusl() ? "-musl" : "";
141:   const suffix = process.platform === "win32" ? ".exe" : "";
142:   return `sentry-${os}-${arch}${libcSuffix}${suffix}`;
143: }
144: 
145: /**
146: ...
gateway · 2026-09-08 23:01:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-08 23:02:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md</path>
<type>file</type>
<content>
548: 
549: <!-- lore:019fb93c-bf78-758a-a96c-da34e4576a15 -->
550: * **Repository setup, evidence-driven investigation, and read-only review**: Before repository work, load setup guidance, including AGENTS.md, CONTRIBUTING.md, and .lore.md. Confirm the worktree, branch, commit, upstream, scope, and existing changes; isolate unrelated work and use a clean worktree when needed. Reviews and investigations must remain read-only unless explicitly authorized. Inspect the exact complete diff and trace authoritative source, callers, tests, generated artifacts, scripts, CI, documentation, data flow, and artifact provenance. Map affected call paths and edge cases, especially fallback ordering, offline or network behavior, source consistency, compatibility, and generated-output drift. Verify claims with permitted read-only checks rather than ...
gateway · 2026-09-08 23:03:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-08 23:03:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
420:     );
421:   }
422: 
423:   const data = (await response.json()) as { version?: string };
424: 
425:   if (!data.version) {
426:     throw new UpgradeError("network_error", "No version found in npm registry");
427:   }
428: 
429:   return data.version;
430: }
431: 
432: /**
433:  * Fetch the latest nightly version from GHCR.
434:  *
435:  * Performs an anonymous token exchange then fetches the OCI manifest for the
436:  * `:nightly` tag. The version is extracted from the manifest annotation —
437:  * only 2 HTTP requests total (token + manifest), no blob download needed.
438:  *
439:  * @param signal - Optional AbortSignal to cancel the requests
440:  * @returns Latest nightly version string (e.g., "0.13.0-dev.1740000000")
441:  * @throws {UpgradeError} When fetch fails or the version annotation is missing
442:  ...
gateway · 2026-09-08 23:04:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-08 23:06:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
150: esac
151: 
152: # Detect C library variant (musl vs glibc) on Linux.
153: # musl-based systems (Alpine, Void, etc.) need a different binary.
154: libc_suffix=""
155: if [[ "$os" == "linux" ]]; then
156:   detect_musl() {
157:     # Heuristic 1: Check for musl dynamic linker
158:     local musl_arch
159:     case "$arch" in
160:       x64) musl_arch="x86_64" ;;
161:       arm64) musl_arch="aarch64" ;;
162:     esac
163:     [ -f "/lib/ld-musl-${musl_arch}.so.1" ] && return 0
164: 
165:     # Heuristic 2: ldd --version outputs "musl libc" on musl systems
166:     if command -v ldd >/dev/null 2>&1; then
167:       ldd --version 2>&1 | grep -qi musl && return 0
168:     fi
169: 
170:     return 1
171:   }
172: 
173:   if detect_musl; then
174:     libc_suffix="-musl"
175:     libc_variant="musl"
176: 
177:     # Bun musl ...
gateway · 2026-09-08 23:06:35
<!-- lore-recall:6697a555-0bf4-4789-b8f3-65612fa8e364 --><!-- lore-recall:b7c85a70-731b-43c1-85bf-22a199d6803e -->
gpt-5.6-sol · 2026-09-08 23:06:35 · ~57 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/CONTRIBUTING.md</path>
<type>file</type>
<content>
1: # Contributing to Sentry CLI
2: 
3: This guide documents the patterns and conventions used in this CLI for consistency.
4: 
5: ## Command Patterns
6: 
7: We follow [gh CLI](https://cli.github.com/) conventions for best-in-class developer experience.
8: 
9: ### List Commands
10: 
11: List commands use **optional positional arguments** for context with smart auto-detection.
12: 
13: ```bash
14: sentry org list [--limit N] [--json]
15: sentry project list [org] [--limit N] [--json]
16: sentry issue list [<org>/<project>] [--json]
17: ```
18: 
19: **Target syntax**:
20: - `<org>/<project>` - Explicit organization and project (e.g., `my-org/frontend`)
21: - `<org>/` - All projects in the specified organization
22: - `<project>` - Search for project by name across all accessible organizations
23: - *(omit)* - Auto-detect ...
gateway · 2026-09-08 23:08:14
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-08 23:08:28
result
Found 44 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 452:   const token = await getAnonymousToken();

  Line 458:   const manifest = await fetchNightlyManifest(token);

  Line 499:   const token = await getAnonymousToken();

  Line 501:     await fetchManifest(token, `nightly-${version}`);

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 688:   const token = await getAnonymousToken();

  Line 690:     ? await fetchManifest(token, `nightly-${version}`)

  Line 691:     : await fetchNightlyManifest(token);

  Line 694:   const response = await downloadNightlyBlob(token, layer.digest);

  Line 721:   const url = ...
gateway · 2026-09-08 23:08:40
result
No files found
gateway · 2026-09-08 23:11:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus</path>
<type>directory</type>
<entries>
.craft.yml
.git
.github/
.gitignore
.lore.md
.nojekyll
.npmrc
.opencode/
.plans/
.ruff_cache/
AGENTS.md
apps/
CHANGELOG.md
codemods/
coverage/
dist-bin/
dist/
docs/
LICENSE.md
node_modules/
package.json
packages/
pnpm-lock.yaml
pnpm-workspace.yaml
README.md
test-results.junit.xml

(26 entries)
</entries>
gateway · 2026-09-08 23:14:35
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/bspatch.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/bspatch.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.mocked.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode...
gateway · 2026-09-08 23:15:00
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
120:     return false;
121:   }
122: }
123: 
124: /**
125:  * Build the platform-specific binary base name.
126:  *
127:  * Matches the naming convention used by GitHub Releases and GHCR:
128:  * `sentry-<os>-<arch>[-musl][.exe]` (e.g., `sentry-linux-x64`, `sentry-linux-arm64-musl`).
129:  */
130: export function getPlatformBinaryName(): string {
131:   let os: string;
132:   if (process.platform === "darwin") {
133:     os = "darwin";
134:   } else if (process.platform === "win32") {
135:     os = "windows";
136:   } else {
137:     os = "linux";
138:   }
139:   const arch = process.arch === "arm64" ? "arm64" : "x64";
140:   const libcSuffix = isMusl() ? "-musl" : "";
141:   const suffix = process.platform === "win32" ? ".exe" : "";
142:   return `sentry-${os}-${arch}${libcSuffix}${suffix}`;
143: }
144: 
145: /**
146: ...
gateway · 2026-09-08 23:15:18
result
File not found: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.cursor/rules/ultracite.mdc
gateway · 2026-09-08 23:15:24
result
No files found
gateway · 2026-09-08 23:15:35
result
Found 50 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 39:     const url = getBinaryDownloadUrl("1.0.0");

  Line 53:     const url = getBinaryDownloadUrl("2.0.0");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts:
  Line 16:   GHCR_REPO,

  Line 82:         `https://ghcr.io/token?scope=repository:${GHCR_REPO}:pull`

  Line 136:       expect(String(url)).toContain(`/v2/${GHCR_REPO}/manifests/${GHCR_TAG}`);

  Line 374:       expect(String(url)).toContain(`/v2/${GHCR_REPO}/manifests/patch-0.13.0`);

  Line 417:       expect(String(url)).toContain(`/v2/${GHCR_REPO}/tags/list`);

  Line 539:         ...
gateway · 2026-09-08 23:16:31
result
No files found
gateway · 2026-09-08 23:16:56
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml:
  Line 26:         urlTemplate: 'https://github.com/getsentry/cli/releases/download/{{version}}/{{file}}'

  Line 45:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-arm64.gz"

  Line 48:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-x64.gz"

  Line 55:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-arm64.gz"

  Line 58:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-x64.gz"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/apps/cli-docs/astro.config.mjs:
  Line 62:           href: ...
gateway · 2026-09-08 23:18:13
result
No files found
gateway · 2026-09-08 23:18:37
result
## chore/preshape-monorepo...origin/chore/preshape-monorepo [gone]
 M .lore.md
605e8318d chore: regenerate docs
gateway · 2026-09-08 23:21:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Background version check for "new version available" notifications.
3:  *
4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the
5:  * latest nightly version via the OCI manifest annotation. For stable builds,
6:  * checks GitHub Releases. Results are cached in the database and shown on
7:  * subsequent runs.
8:  */
9: 
10: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
11: import * as Sentry from "@sentry/node-core/light";
12: import { compare as semverCompare } from "semver";
13: import { CLI_VERSION } from "./constants.js";
14: import { getReleaseChannel } from "./db/release-channel.js";
15: import {
16:   getVersionCheckInfo,
17:   markUpdateNotified,
18:   setVersionCheckInfo,
19: } from "./db/version-check.js";
20: ...
gateway · 2026-09-08 23:21:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:   generate-patches:
431:     name: Generate Delta Patches
432:     needs: [changes, build-binary]
433:     # Only on main (nightlies) and release branches (stable) — skip PRs
434:     if: github.event_name != 'pull_request'
435:     runs-on: ubuntu-latest
436:     continue-on-error: true
437:     steps:
438:       - name: Install ORAS CLI
439:         # Only needed on main (to fetch previous nightly from GHCR)
440:         if: github.ref == 'refs/heads/main'
441:         run: |
442:           VERSION=1.3.1
443:           EXPECTED_SHA256="d52c4af76ce6a3ceb8579e51fb751a43ac051cca67f965f973a0b0e897a2bb86"
444:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"
445:           curl --retry 3 --retry-delay 5 --retry-all-errors -sfLo "$TARBALL" ...
gateway · 2026-09-08 23:22:37
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
240:     throw new UpgradeError(
241:       "unsupported_operation",
242:       "Homebrew does not support installing a specific version. Run 'brew upgrade getsentry/tools/sentry' to upgrade to the latest formula version."
243:     );
244:   }
245:   // Offline mode is only supported for curl-installed binaries — package
246:   // managers always need network to fetch and install packages.
247:   if (offline && method !== "curl") {
248:     throw new UpgradeError(
249:       "unsupported_operation",
250:       "Offline upgrade is only supported for curl-installed binaries."
251:     );
252:   }
253: }
254: 
255: type ResolveTargetOptions = {
256:   method: InstallationMethod;
257:   channel: ReleaseChannel;
258:   versionArg: string | undefined;
259:   channelChanged: boolean;
260:   flags: UpgradeFlags;
261: ...
gateway · 2026-09-08 23:22:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
180:   });
181: 
182:   test("throws on invalid method", () => {
183:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
184:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
185:     expect(() => parseInstallationMethod("")).toThrow("Invalid method: ");
186:   });
187: });
188: 
189: describe("fetchLatestFromGitHub", () => {
190:   test("returns version from GitHub API", async () => {
191:     mockFetch(
192:       async () =>
193:         new Response(
194:           JSON.stringify({
195:             tag_name: "v1.2.3",
196:           }),
197:           {
198:             status: 200,
199:             headers: { "Content-Type": "application/json" },
200:           }
201:         )
202:     );
203: 
204:     const version = await ...
gateway · 2026-09-08 23:23:00
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts</path>
<type>file</type>
<content>
800: function mockFetch(
801:   fn: (url: string | URL | Request, init?: RequestInit) => Promise<Response>
802: ): void {
803:   globalThis.fetch = fn as typeof globalThis.fetch;
804: }
805: 
806: /** Store original fetch for restoration */
807: let originalFetch: typeof globalThis.fetch;
808: 
809: beforeEach(() => {
810:   originalFetch = globalThis.fetch;
811: });
812: 
813: afterEach(() => {
814:   globalThis.fetch = originalFetch;
815: });
816: 
817: // fetchRecentReleases
818: 
819: describe("fetchRecentReleases", () => {
820:   test("returns releases from GitHub API", async () => {
821:     const releases: GitHubRelease[] = [
822:       makeRelease("0.14.0", [makeAsset({ name: "sentry-linux-x64" })]),
823:       makeRelease("0.13.0", [makeAsset({ name: "sentry-linux-x64" })]),
824:     ];
825: 
826: ...
gateway · 2026-09-08 23:23:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
100: /**
101:  * Resolve effective channel and version arg from the positional `version`
102:  * parameter. "nightly" and "stable" are treated as channel selectors, not
103:  * literal version strings.
104:  *
105:  * @returns `{ channel, versionArg }` where versionArg is undefined when the
106:  *   positional was a channel name (so we resolve to latest) or was omitted.
107:  */
108: function resolveChannelAndVersion(positional: string | undefined): {
109:   channel: ReleaseChannel;
110:   versionArg: string | undefined;
111: } {
112:   // "nightly" and "stable" as positional args select the channel rather than
113:   // installing a specific version. Match case-insensitively for convenience.
114:   const lower = positional?.toLowerCase();
115:   if (lower === "nightly" || lower === "stable") {
116:     ...
gateway · 2026-09-08 23:23:50
result
No files found
gateway · 2026-09-08 23:23:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Install Script Tests
3:  *
4:  * Exercises the shell installer with fake download tools so argument parsing and
5:  * setup delegation can be validated without network access.
6:  */
7: 
8: import { spawn } from "node:child_process";
9: import {
10:   chmodSync,
11:   mkdirSync,
12:   mkdtempSync,
13:   readFileSync,
14:   rmSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { tmpdir } from "node:os";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: 
21: function noop(): void {
22:   // Intentionally empty — absorbs async spawn errors
23: }
24: 
25: const repoRoot = join(import.meta.dirname, "..", "..");
26: const installScript = join(repoRoot, "install");
27: 
28: describe("install script", () => {
29:   let ...
gateway · 2026-09-08 23:24:45
result
Found 22 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 23: } from "./delta-upgrade.js";

  Line 27: import { cleanupPatchCache } from "./patch-cache.js";

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 36: } from "./binary.js";

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 50: } from "./ghcr.js";

  Line 52: import { clearPatchCache } from "./patch-cache.js";

  Line 60: export type { InstallationMethod } from "./binary.js";

  Line 62: export { parseInstallationMethod } from "./binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/telemetry.ts:
  Line 19: import { isMusl } ...
gateway · 2026-09-08 23:25:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
520:       continue;
521:     }
522: 
523:     const description = ccMatch[2].trim();
524:     const existing = items.get(category) ?? [];
525:     existing.push(description);
526:     items.set(category, existing);
527:   }
528: 
529:   const sections: ChangeSection[] = [];
530:   for (const category of CATEGORY_ORDER) {
531:     const descriptions = items.get(category);
532:     if (descriptions && descriptions.length > 0) {
533:       const markdown = `${descriptions.map((d) => `- ${d}`).join("\n")}\n`;
534:       sections.push({ category, markdown });
535:     }
536:   }
537: 
538:   return sections;
539: }
540: 
541: // ────────────────────────────── Fetch Functions ────────────────────────────
542: 
543: /**
544:  * Max releases to fetch for changelog purposes. ...
gateway · 2026-09-08 23:29:03
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/cli.ts:
  Line 179:   const { startCleanupOldBinary } = await import("./lib/upgrade.js");

  Line 181:     abortPendingVersionCheck,

  Line 183:     getUpdateNotification,

  Line 184:     maybeCheckForUpdateInBackground,

  Line 607:   startCleanupOldBinary();

  Line 623:     maybeCheckForUpdateInBackground();

  Line 670:     abortPendingVersionCheck();

  Line 675:     const notification = getUpdateNotification();
gateway · 2026-09-08 23:29:16
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/log/list.ts:
  Line 70: import { getUpdateNotification } from "../../lib/version-check.js";

  Line 555:   const notification = getUpdateNotification();
gateway · 2026-09-08 23:29:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
110:         ...init,
111:         signal: buildSignal(timeout, externalSignal),
112:       });
113:       return response;
114:     } catch (error) {
115:       lastError = error instanceof Error ? error : new Error(String(error));
116:       // Propagate external abort immediately — don't retry caller cancellation
117:       if (isExternalAbort(lastError, externalSignal)) {
118:         break;
119:       }
120:       // Only retry on timeout or network errors — not HTTP errors
121:       if (attempt >= GHCR_MAX_RETRIES || !isRetryableError(lastError)) {
122:         break;
123:       }
124:     }
125:   }
126: 
127:   throw new UpgradeError(
128:     "network_error",
129:     `${context}: ${lastError?.message ?? ...
gateway · 2026-09-08 23:29:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-08 23:29:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-08 23:29:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
350:   if (legacyMethod !== "unknown") {
351:     try {
352:       setInstallInfo({
353:         method: legacyMethod,
354:         path: process.execPath,
355:         version: CLI_VERSION,
356:       });
357:     } catch {
358:       log.debug("Failed to persist install info (DB may be read-only)");
359:     }
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): ...
gateway · 2026-09-08 23:30:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
130:       shift
131:       ;;
132:     *) shift ;;
133:   esac
134: done
135: 
136: # Detect OS
137: case "$(uname -s)" in
138:   Darwin*) os="darwin" ;;
139:   Linux*) os="linux" ;;
140:   MINGW*|MSYS*|CYGWIN*) os="windows" ;;
141:   *) die "Unsupported OS: $(uname -s)" "detect-os" ;;
142: esac
143: 
144: # Detect architecture
145: arch=$(uname -m)
146: case "$arch" in
147:   x86_64) arch="x64" ;;
148:   aarch64|arm64) arch="arm64" ;;
149:   *) die "Unsupported architecture: $arch" "detect-arch" ;;
150: esac
151: 
152: # Detect C library variant (musl vs glibc) on Linux.
153: # musl-based systems (Alpine, Void, etc.) need a different binary. ...
gateway · 2026-09-08 23:32:09
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts:
  Line 5: export type { ChainMeta, PatchStepMeta } from "binpatch";

  Line 9: function cache(): PatchCache {

  Line 13: export function savePatchesToCache(

  Line 20: export async function loadCachedChain(

  Line 37: export function cleanupPatchCache(): Promise<void> {

  Line 41: export function clearPatchCache(): Promise<void> {
gateway · 2026-09-08 23:32:38
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-08 23:35:56
result
Found 16 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 116: export function getCurlInstallPaths(): {

  Line 158: export function startCleanupOldBinary(): void {

  Line 375: export async function fetchLatestFromGitHub(

  Line 443: export async function fetchLatestNightlyVersion(

  Line 474: export function fetchLatestVersion(

  Line 527: export async function versionExists(

  Line 576: async function streamDecompressToFile(

  Line 683: async function downloadNightlyToPath(

  Line 716: async function downloadStableToPath(

  Line 773: function probeBinaryFile(path: string): number | null {

  Line 856: export async function downloadBinaryToTemp(

  Line 937: async function tryDeltaUpgrade(

  Line 959: async function downloadFullBinary(

  Line 982: function executeUpgradeHomebrew(): Promise<void> {

  Line 1017: function executeUpgradePackageManager(

  Line 1074: export async ...
gateway · 2026-09-08 23:36:08
result
Found 19 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 83: function instrumentCache(base: PatchCache): PatchCache {

  Line 118: function getPatchCache(): PatchCache {

  Line 122: function stableSource(): SourceStrategy {

  Line 132: function nightlySource(): SourceStrategy {

  Line 145: export function canAttemptDelta(targetVersion: string): boolean {

  Line 155: export async function fetchRecentReleases(

  Line 181: export async function downloadStablePatch(

  Line 231: export function validateChainStep(

  Line 270: export function resolveStableChain(

  Line 278: export async function resolveNightlyChain(opts: {

  Line 374: export function applyPatchChain(

  Line 402: function makeProgressHandler(setMessage?: SetMessage): ProgressHandler {

  Line 425: function telemetry(): DeltaTelemetry & { _source: { current?: string } } {

  Line 452: function resolveDelta(

  Line ...
gateway · 2026-09-08 23:36:20
result
Found 15 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts:
  Line 40: function isRetryableError(error: Error): boolean {

  Line 60: function buildSignal(

  Line 74: function isExternalAbort(error: Error, externalSignal?: AbortSignal): boolean {

  Line 97: async function fetchWithRetry(

  Line 134: export const GHCR_REPO = "getsentry/cli";

  Line 137: export const GHCR_TAG = "nightly";

  Line 192: export async function getAnonymousToken(signal?: AbortSignal): Promise<string> {

  Line 227: export async function fetchManifest(

  Line 265: export async function fetchNightlyManifest(

  Line 280: export function getNightlyVersion(manifest: OciManifest): string {

  Line 302: export function findLayerByFilename(

  Line 332: export async function downloadNightlyBlob(

  Line 427: async function fetchTagPage(

  Line 471: export async function listTags(

  Line 513: export async function ...
gateway · 2026-09-08 23:36:30
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts:
  Line 130: export function extractSections(body: string): ChangeSection[] {

  Line 429: export function buildChangelogSummary(

  Line 472: export function extractNightlyTimestamp(version: string): number | null {

  Line 498: export function parseCommitMessages(commits: GitHubCommit[]): ChangeSection[] {

  Line 560: async function fetchReleasesForChangelog(): Promise<GitHubRelease[]> {

  Line 602: async function fetchStableChangelog(

  Line 620: function buildNightlyChangelogSummary(

  Line 642: async function fetchNightlyChangelog(

  Line 720: export async function fetchChangelog(
gateway · 2026-09-08 23:36:40
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 73: function shouldCheckForUpdate(): boolean {

  Line 98: export function shouldSuppressNotification(args: string[]): boolean {

  Line 113: export function abortPendingVersionCheck(): void {

  Line 156: function checkForUpdateInBackgroundImpl(): void {

  Line 254: function getUpdateNotificationWithCopy(

  Line 347: export function maybeCheckForUpdateInBackground(): void {

  Line 358: export function getUpdateNotification(): string | null {

  Line 377: export function getErrorUpdateNotification(
gateway · 2026-09-08 23:36:53
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts:
  Line 160: async function resolveTargetWithFallback(opts: {

  Line 280: async function resolveTargetVersion(

  Line 543: async function executeStandardUpgrade(opts: {

  Line 619: async function migrateToStandaloneForNightly(

  Line 730: function startChangelogFetch(

  Line 768: export const upgradeCommand = buildCommand({
gateway · 2026-09-08 23:37:02
result
Found 54 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 375: export async function fetchLatestFromGitHub(

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line ...
gateway · 2026-09-08 23:39:07
result
Found 85 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/script/bundle.ts:
  Line 73:       release: VERSION,

  Line 352: // Write the CLI bin wrapper (tiny — shebang + version check + dispatch).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/script/check-patches.ts:
  Line 5:  * Verifies that pnpm patchedDependencies target versions match installed versions.

  Line 6:  * Name-only keys in patchedDependencies (pnpm 10+ catalog style) apply patches

  Line 8:  * patch file's target version, the patch may silently fail to apply.

  Line 11:  * name-only keys intentionally support version-agnostic patching — patches

  Line 12:  * often apply cleanly across minor/patch bumps. The warning ensures engineers

  Line 13:  * notice and can regenerate the patch if needed.

  Line 16:  * patch's *effect* is actually present in the installed package. ...
gateway · 2026-09-08 23:41:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
74: export type OfflineMode = false | "explicit" | "network-fallback";
75: 
76: // Constants
77: 
78: /** The git tag used for the rolling nightly GitHub release (stable fallback only). */
79: export const NIGHTLY_TAG = "nightly";
80: 
81: /** npm registry base URL */
82: const NPM_REGISTRY_URL = "https://registry.npmjs.org/sentry";
83: 
84: /** Regex to strip 'v' prefix from version strings */
85: export const VERSION_PREFIX_REGEX = /^v/;
86: 
87: // Curl Binary Helpers
88: 
89: /**
90:  * Known directories where the curl installer may place the binary.
91:  * Resolved at runtime against the user's home directory.
92:  * Used for legacy detection (when no install info is stored).
93:  * Trailing separator ensures startsWith matches a directory boundary
94:  * (e.g. ~/.local/bin/ won't match ~/.local/binaries/). ...
gateway · 2026-09-08 23:44:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
757: /**
758:  * Max probe attempts before giving up. Six probes run with five sleeps
759:  * in between, yielding ~3.1s total wall-clock budget (see backoff table
760:  * on {@link waitForBinaryVisible}).
761:  */
762: const VERIFY_MAX_ATTEMPTS = 6;
763: 
764: /** Base delay (ms) between verify attempts. Doubles each retry. */
765: const VERIFY_BASE_DELAY_MS = 100;
766: 
767: /**
768:  * Stat the downloaded file, tolerating absence.
769:  *
770:  * Returns the file size when the path is present, a regular file, and
771:  * has non-zero size. Returns `null` otherwise so the caller can poll.
772:  */
773: function probeBinaryFile(path: string): number | null {
774:   const stats = statSync(path, { throwIfNoEntry: false });
775:   if (stats?.isFile() && stats.size > 0) {
776:     return stats.size;
777:   }
778:   ...
gateway · 2026-09-08 23:44:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
181: export async function downloadStablePatch(
182:   url: string,
183:   signal?: AbortSignal
184: ): Promise<Uint8Array | null> {
185:   try {
186:     const response = await customFetch(url, {
187:       headers: { "User-Agent": `sentry-cli/${CLI_VERSION}` },
188:       signal,
189:     });
190:     return response.ok ? new Uint8Array(await response.arrayBuffer()) : null;
191:   } catch (error) {
192:     log.debug("Failed to download stable patch", error);
193:     return null;
194:   }
195: }
196: 
197: export function extractStableChain(
198:   opts: ExtractStableChainOpts
199: ): StableChainInfo | null {
200:   const result = binpatchExtractStableChain(opts);
201:   return "failure" in result ? ...
gateway · 2026-09-08 23:44:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Install Script Tests
3:  *
4:  * Exercises the shell installer with fake download tools so argument parsing and
5:  * setup delegation can be validated without network access.
6:  */
7: 
8: import { spawn } from "node:child_process";
9: import {
10:   chmodSync,
11:   mkdirSync,
12:   mkdtempSync,
13:   readFileSync,
14:   rmSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { tmpdir } from "node:os";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: 
21: function noop(): void {
22:   // Intentionally empty — absorbs async spawn errors
23: }
24: 
25: const repoRoot = join(import.meta.dirname, "..", "..");
26: const installScript = join(repoRoot, "install");
27: 
28: describe("install script", () => {
29:   let ...
gateway · 2026-09-08 23:44:52
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
120:     return false;
121:   }
122: }
123: 
124: /**
125:  * Build the platform-specific binary base name.
126:  *
127:  * Matches the naming convention used by GitHub Releases and GHCR:
128:  * `sentry-<os>-<arch>[-musl][.exe]` (e.g., `sentry-linux-x64`, `sentry-linux-arm64-musl`).
129:  */
130: export function getPlatformBinaryName(): string {
131:   let os: string;
132:   if (process.platform === "darwin") {
133:     os = "darwin";
134:   } else if (process.platform === "win32") {
135:     os = "windows";
136:   } else {
137:     os = "linux";
138:   }
139:   const arch = process.arch === "arm64" ? "arm64" : "x64";
140:   const libcSuffix = isMusl() ? "-musl" : "";
141:   const suffix = process.platform === "win32" ? ".exe" : "";
142:   return `sentry-${os}-${arch}${libcSuffix}${suffix}`;
143: }
144: 
145: /**
146: ...
gateway · 2026-09-08 23:45:47
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Background version check for "new version available" notifications.
3:  *
4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the
5:  * latest nightly version via the OCI manifest annotation. For stable builds,
6:  * checks GitHub Releases. Results are cached in the database and shown on
7:  * subsequent runs.
8:  */
9: 
10: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
11: import * as Sentry from "@sentry/node-core/light";
12: import { compare as semverCompare } from "semver";
13: import { CLI_VERSION } from "./constants.js";
14: import { getReleaseChannel } from "./db/release-channel.js";
15: import {
16:   getVersionCheckInfo,
17:   markUpdateNotified,
18:   setVersionCheckInfo,
19: } from "./db/version-check.js";
20: ...
gateway · 2026-09-08 23:47:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
540: 
541: // ────────────────────────────── Fetch Functions ────────────────────────────
542: 
543: /**
544:  * Max releases to fetch for changelog purposes.
545:  *
546:  * Higher than the delta-upgrade cap (12) to cover larger version jumps.
547:  * GitHub API max per_page is 100; 30 covers ~6+ months of weekly releases.
548:  */
549: const CHANGELOG_MAX_RELEASES = 30;
550: 
551: /**
552:  * Fetch recent releases from GitHub for changelog building.
553:  *
554:  * Uses a higher `per_page` than `fetchRecentReleases()` in delta-upgrade
555:  * (which is capped at 12 for patch chain resolution) to cover larger
556:  * version jumps without silent truncation. ...
gateway · 2026-09-08 23:49:48
result
Found 61 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 182:   test("throws on invalid method", () => {

  Line 189: describe("fetchLatestFromGitHub", () => {

  Line 190:   test("returns version from GitHub API", async () => {

  Line 244:   test("throws on HTTP error", async () => {

  Line 258:   test("throws on network failure (DNS, timeout, etc.)", async () => {

  Line 269:   test("throws when no tag_name in response", async () => {

  Line 285:   test("returns version from npm registry", async () => {

  Line 303:   test("throws on HTTP error", async () => {

  Line 317:   test("throws on network failure (DNS, timeout, etc.)", async () => {

  Line 328:   test("throws when no version in response", async () => {

  Line 488:   test("uses GHCR manifest when channel is nightly (curl method)", async () => {

  Line 510:   test("uses GHCR manifest when channel is nightly (npm ...
gateway · 2026-09-08 23:50:00
result
Found 10 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 819: describe("fetchRecentReleases", () => {

  Line 846:   test("returns empty array on network failure", async () => {

  Line 874:   test("returns null on HTTP 404", async () => {

  Line 881:   test("returns null on network failure", async () => {

  Line 893: describe("resolveStableChain", () => {

  Line 957:   test("resolves multi-hop chain with parallel downloads", async () => {

  Line 1080: describe("resolveNightlyChain", () => {

  Line 1812: describe("attemptDeltaUpgrade", () => {

  Line 1827: describe("prefetchNightlyPatches", () => {

  Line 1838: describe("prefetchStablePatches", () => {
gateway · 2026-09-08 23:54:39
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/setup.ts:
  Line 92: async function handleInstall(

  Line 102:   const binaryPath = await installBinary(execPath, installDir);

  Line 368: async function runConfigurationSteps(opts: ConfigStepOptions) {

  Line 378:         setInstallInfo({

  Line 397:         setReleaseChannel(channel);

  Line 444: export const setupCommand = buildCommand({
gateway · 2026-09-08 23:55:16
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 73: function shouldCheckForUpdate(): boolean {

  Line 98: export function shouldSuppressNotification(args: string[]): boolean {

  Line 113: export function abortPendingVersionCheck(): void {

  Line 124: async function maybePrefetchPatches(

  Line 156: function checkForUpdateInBackgroundImpl(): void {

  Line 217: function isStderrTTY(): boolean {

  Line 237: function canNotifyAgain(lastNotified: number | null): boolean {

  Line 254: function getUpdateNotificationWithCopy(

  Line 306: function formatStandardUpdateNotification(latestVersion: string): string {

  Line 314: function formatContextualUpdateNotification(latestVersion: string): string {

  Line 331: export function resetUpdateNotificationState(): void {

  Line 339: function isUpdateCheckDisabled(): boolean {

  Line 347: export ...
gateway · 2026-09-08 23:55:42
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 40:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/input-validation.ts:
  Line 15:  * @see https://github.com/getsentry/cli/issues/350


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/init/wizard-runner.ts:
  Line 970:     // error. See getsentry/cli-init-api#98.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts:
  Line 5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts

  Line 134: export const GHCR_REPO = "getsentry/cli";

  Line 184:  * public `ghcr.io/getsentry/cli` ...
gateway · 2026-09-08 23:56:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-08 23:56:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-08 23:57:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-08 23:57:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
160:       x64) musl_arch="x86_64" ;;
161:       arm64) musl_arch="aarch64" ;;
162:     esac
163:     [ -f "/lib/ld-musl-${musl_arch}.so.1" ] && return 0
164: 
165:     # Heuristic 2: ldd --version outputs "musl libc" on musl systems
166:     if command -v ldd >/dev/null 2>&1; then
167:       ldd --version 2>&1 | grep -qi musl && return 0
168:     fi
169: 
170:     return 1
171:   }
172: 
173:   if detect_musl; then
174:     libc_suffix="-musl"
175:     libc_variant="musl"
176: 
177:     # Bun musl binaries dynamically link libstdc++ and libgcc_s.
178:     # Auto-install them on Alpine when running as root (typical in Docker).
179:     # When not root, warn with install instructions.
180:     if ! ldconfig -p 2>/dev/null | grep -q libstdc++ && ! [ -f /usr/lib/libstdc++.so.6 ]; then
181:       if command -v apk >/dev/null 2>&1; ...
gateway · 2026-09-08 23:58:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
350:   if (legacyMethod !== "unknown") {
351:     try {
352:       setInstallInfo({
353:         method: legacyMethod,
354:         path: process.execPath,
355:         version: CLI_VERSION,
356:       });
357:     } catch {
358:       log.debug("Failed to persist install info (DB may be read-only)");
359:     }
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): ...
gateway · 2026-09-09 00:00:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
570:  *
571:  * @param code - OAuth error code (e.g., "authorization_pending", "slow_down")
572:  * @param description - Human-readable error description
573:  */
574: export class DeviceFlowError extends CliError {
575:   readonly code: string;
576: 
577:   constructor(code: string, description?: string) {
578:     super(description ?? code, EXIT.DEVICE_FLOW);
579:     this.name = "DeviceFlowError";
580:     this.code = code;
581:   }
582: }
583: 
584: // Upgrade Errors
585: 
586: export type UpgradeErrorReason =
587:   | "unknown_method"
588:   | "unsupported_operation"
589:   | "network_error"
590:   | "execution_failed"
591:   | "version_not_found"
592:   | "offline_cache_miss";
593: 
594: /**
595:  * Upgrade-related errors. ...
gateway · 2026-09-09 00:00:59
result
Found 87 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 375: export async function fetchLatestFromGitHub(

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 443: export async function fetchLatestNightlyVersion(

  Line 479:     return fetchLatestNightlyVersion();

  Line 482:     ? fetchLatestFromGitHub()

  Line 527: export async function versionExists(

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 721:   const url = ...
gateway · 2026-09-09 00:03:59
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.mocked.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/db/release-channel.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/db/install-info.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/patch-cache.test.ts
/home/by...
gateway · 2026-09-09 00:05:15
result
Found 24 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts:
  Line 26: } from "../../lib/binary.js";

  Line 44: } from "../../lib/release-notes.js";

  Line 56: } from "../../lib/upgrade.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/setup.ts:
  Line 20: } from "../../lib/binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/index.ts:
  Line 8: import { upgradeCommand } from "./upgrade.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/log/list.ts:
  Line 70: import { getUpdateNotification } from ...
gateway · 2026-09-09 00:07:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 00:13:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
125:   }
126: 
127:   throw new UpgradeError(
128:     "network_error",
129:     `${context}: ${lastError?.message ?? "unknown error"}`
130:   );
131: }
132: 
133: /** GHCR repository for CLI distribution */
134: export const GHCR_REPO = "getsentry/cli";
135: 
136: /** OCI tag for nightly builds */
137: export const GHCR_TAG = "nightly";
138: 
139: /** Base URL for GHCR registry API */
140: const GHCR_REGISTRY = "https://ghcr.io";
141: 
142: /** OCI manifest media type */
143: const OCI_MANIFEST_TYPE = "application/vnd.oci.image.manifest.v1+json";
144: 
145: /**
146:  * A single layer entry from an OCI manifest.
147:  *
148:  * Each binary in the nightly push is stored as a separate layer.
149:  * The `annotations` map includes `org.opencontainers.image.title` (filename)
150:  * and `org.opencontainers.image.created` ...
gateway · 2026-09-09 00:14:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
350:   if (legacyMethod !== "unknown") {
351:     try {
352:       setInstallInfo({
353:         method: legacyMethod,
354:         path: process.execPath,
355:         version: CLI_VERSION,
356:       });
357:     } catch {
358:       log.debug("Failed to persist install info (DB may be read-only)");
359:     }
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): ...
gateway · 2026-09-09 00:14:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-09 00:14:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
540: 
541: // ────────────────────────────── Fetch Functions ────────────────────────────
542: 
543: /**
544:  * Max releases to fetch for changelog purposes.
545:  *
546:  * Higher than the delta-upgrade cap (12) to cover larger version jumps.
547:  * GitHub API max per_page is 100; 30 covers ~6+ months of weekly releases.
548:  */
549: const CHANGELOG_MAX_RELEASES = 30;
550: 
551: /**
552:  * Fetch recent releases from GitHub for changelog building.
553:  *
554:  * Uses a higher `per_page` than `fetchRecentReleases()` in delta-upgrade
555:  * (which is capped at 12 for patch chain resolution) to cover larger
556:  * version jumps without silent truncation. ...
gateway · 2026-09-09 00:14:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
160:       x64) musl_arch="x86_64" ;;
161:       arm64) musl_arch="aarch64" ;;
162:     esac
163:     [ -f "/lib/ld-musl-${musl_arch}.so.1" ] && return 0
164: 
165:     # Heuristic 2: ldd --version outputs "musl libc" on musl systems
166:     if command -v ldd >/dev/null 2>&1; then
167:       ldd --version 2>&1 | grep -qi musl && return 0
168:     fi
169: 
170:     return 1
171:   }
172: 
173:   if detect_musl; then
174:     libc_suffix="-musl"
175:     libc_variant="musl"
176: 
177:     # Bun musl binaries dynamically link libstdc++ and libgcc_s.
178:     # Auto-install them on Alpine when running as root (typical in Docker).
179:     # When not root, warn with install instructions.
180:     if ! ldconfig -p 2>/dev/null | grep -q libstdc++ && ! [ -f /usr/lib/libstdc++.so.6 ]; then
181:       if command -v apk >/dev/null 2>&1; ...
gateway · 2026-09-09 00:14:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Install Script Tests
3:  *
4:  * Exercises the shell installer with fake download tools so argument parsing and
5:  * setup delegation can be validated without network access.
6:  */
7: 
8: import { spawn } from "node:child_process";
9: import {
10:   chmodSync,
11:   mkdirSync,
12:   mkdtempSync,
13:   readFileSync,
14:   rmSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { tmpdir } from "node:os";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: 
21: function noop(): void {
22:   // Intentionally empty — absorbs async spawn errors
23: }
24: 
25: const repoRoot = join(import.meta.dirname, "..", "..");
26: const installScript = join(repoRoot, "install");
27: 
28: describe("install script", () => {
29:   let ...
gateway · 2026-09-09 00:14:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management Tests
3:  *
4:  * Tests for shared binary helpers: install directory selection, paths,
5:  * download URLs, locking, and binary installation.
6:  */
7: 
8: import {
9:   chmodSync,
10:   mkdirSync,
11:   readFileSync,
12:   realpathSync,
13:   rmSync,
14:   symlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { access, readFile, writeFile } from "node:fs/promises";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: import {
21:   acquireLock,
22:   compareVersions,
23:   determineInstallDir,
24:   fetchWithUpgradeError,
25:   getBinaryDownloadUrl,
26:   getBinaryFilename,
27:   getBinaryPaths,
28:   getPlatformBinaryName,
29:   installBinary,
30:   isDowngrade,
31:   isMusl,
32:   releaseLock,
33:   ...
gateway · 2026-09-09 00:14:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
180:   });
181: 
182:   test("throws on invalid method", () => {
183:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
184:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
185:     expect(() => parseInstallationMethod("")).toThrow("Invalid method: ");
186:   });
187: });
188: 
189: describe("fetchLatestFromGitHub", () => {
190:   test("returns version from GitHub API", async () => {
191:     mockFetch(
192:       async () =>
193:         new Response(
194:           JSON.stringify({
195:             tag_name: "v1.2.3",
196:           }),
197:           {
198:             status: 200,
199:             headers: { "Content-Type": "application/json" },
200:           }
201:         )
202:     );
203: 
204:     const version = await ...
gateway · 2026-09-09 00:15:02
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
530:   });
531: 
532:   test("defaults to stable channel (uses GitHub) when channel omitted", async () => {
533:     mockFetch(
534:       async () =>
535:         new Response(JSON.stringify({ tag_name: "v3.0.0" }), {
536:           status: 200,
537:           headers: { "Content-Type": "application/json" },
538:         })
539:     );
540: 
541:     const version = await fetchLatestVersion("curl");
542:     expect(version).toBe("3.0.0");
543:   });
544: });
545: 
546: describe("versionExists", () => {
547:   test("checks GitHub for curl method - version exists", async () => {
548:     mockFetch(async () => new Response(null, { status: 200 }));
549: 
550:     const exists = await versionExists("curl", "1.0.0");
551:     expect(exists).toBe(true);
552:   });
553: 
554:   test("checks GitHub for curl method - ...
gateway · 2026-09-09 00:15:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
930:   afterEach(() => {
931:     process.argv = originalArgv;
932:     Object.defineProperty(process, "execPath", {
933:       value: originalExecPath,
934:       configurable: true,
935:     });
936:     clearInstallInfo();
937:   });
938: 
939:   test("stored info takes priority over path-based detection", async () => {
940:     // If DB says "yarn", respect it even if path says node_modules
941:     setInstallInfo({ method: "yarn", path: "/old/path", version: "0.0.1" });
942:     process.argv[1] = join(
943:       "/usr/local/lib",
944:       "node_modules",
945:       "sentry",
946:       "dist",
947:       "bin.cjs"
948:     );
949: 
950:     const method = await detectInstallationMethod();
951:     expect(method).toBe("yarn");
952:   });
953: 
954:   test("Homebrew still takes priority over node_modules ...
gateway · 2026-09-09 00:15:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1390:     await expect(executeUpgrade("curl", "1.0.0")).rejects.toThrow(
1391:       "Failed to connect to GitHub"
1392:     );
1393:   });
1394: 
1395:   test("releases lock on failure", async () => {
1396:     mockFetch(async () => new Response("Server Error", { status: 500 }));
1397: 
1398:     try {
1399:       await executeUpgrade("curl", "1.0.0");
1400:     } catch {
1401:       // Expected to fail
1402:     }
1403: 
1404:     // Lock should be released even on failure
1405:     const paths = getTestPaths();
1406:     expect(
1407:       await access(paths.lockPath).then(
1408:         () => true,
1409:         () => false
1410:       )
1411:     ).toBe(false);
1412:   });
1413: });
1414: 
1415: describe("startCleanupOldBinary", () => {
1416:   // Get paths fresh to match what startCleanupOldBinary() ...
gateway · 2026-09-09 00:15:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts</path>
<type>file</type>
<content>
800: function mockFetch(
801:   fn: (url: string | URL | Request, init?: RequestInit) => Promise<Response>
802: ): void {
803:   globalThis.fetch = fn as typeof globalThis.fetch;
804: }
805: 
806: /** Store original fetch for restoration */
807: let originalFetch: typeof globalThis.fetch;
808: 
809: beforeEach(() => {
810:   originalFetch = globalThis.fetch;
811: });
812: 
813: afterEach(() => {
814:   globalThis.fetch = originalFetch;
815: });
816: 
817: // fetchRecentReleases
818: 
819: describe("fetchRecentReleases", () => {
820:   test("returns releases from GitHub API", async () => {
821:     const releases: GitHubRelease[] = [
822:       makeRelease("0.14.0", [makeAsset({ name: "sentry-linux-x64" })]),
823:       makeRelease("0.13.0", [makeAsset({ name: "sentry-linux-x64" })]),
824:     ];
825: 
826: ...
gateway · 2026-09-09 00:15:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR Client Tests
3:  *
4:  * Unit tests for the GHCR/OCI download protocol helpers.
5:  * All HTTP calls are mocked via globalThis.fetch to avoid network access.
6:  */
7: 
8: import { afterEach, beforeEach, describe, expect, test } from "vitest";
9: import { UpgradeError } from "../../src/lib/errors.js";
10: import {
11:   downloadLayerBlob,
12:   downloadNightlyBlob,
13:   fetchManifest,
14:   fetchNightlyManifest,
15:   findLayerByFilename,
16:   GHCR_REPO,
17:   GHCR_TAG,
18:   getAnonymousToken,
19:   getNightlyVersion,
20:   listTags,
21:   type OciManifest,
22: } from "../../src/lib/ghcr.js";
23: 
24: /** Store original fetch for restoration */
25: let originalFetch: typeof globalThis.fetch;
26: 
27: /** Helper to mock fetch without TypeScript errors about missing Bun-specific properties */
28: ...
gateway · 2026-09-09 00:15:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 00:15:57
result
Found 62 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 979:       "https://github.com/getsentry/cli/releases/download/"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 43:       "https://github.com/getsentry/cli/releases/download/"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/auto-auth.test.ts:
  Line 7:  * unconfirmed self-hosted host (getsentry/cli#1121), exactly like `auth login`.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/api/releases.test.ts:
  Line 20:   mockGetRepositoryName: vi.fn((): string | null => "getsentry/cli"),

  Line 266:     name: "getsentry/cli",

  Line 267:     url: "https://github.com/getsentry/cli",

  Line 276:  ...
gateway · 2026-09-09 00:16:13
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 452:   const token = await getAnonymousToken();

  Line 458:   const manifest = await fetchNightlyManifest(token);

  Line 499:   const token = await getAnonymousToken();

  Line 501:     await fetchManifest(token, `nightly-${version}`);

  Line 688:   const token = await getAnonymousToken();

  Line 690:     ? await fetchManifest(token, `nightly-${version}`)

  Line 691:     : await fetchNightlyManifest(token);

  Line 694:   const response = await downloadNightlyBlob(token, layer.digest);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts:
  Line 192: export async function getAnonymousToken(signal?: AbortSignal): Promise<string> {

  Line 227: export async function fetchManifest(

  Line 265: export async function fetchNightlyManifest(

  Line 268:   ...
gateway · 2026-09-09 00:16:33
result
Found 59 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml:
  Line 26:         urlTemplate: 'https://github.com/getsentry/cli/releases/download/{{version}}/{{file}}'

  Line 45:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-arm64.gz"

  Line 48:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-x64.gz"

  Line 55:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-arm64.gz"

  Line 58:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-x64.gz"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml:
  Line 473:           REPO="ghcr.io/getsentry/cli"

  Line 688:           oras push ghcr.io/getsentry/cli:nightly \

  Line 699:           oras tag ghcr.io/getsentry/cli:nightly ...
gateway · 2026-09-09 00:16:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Integration tests for delta upgrade orchestration with a non-dev CLI_VERSION.
3:  *
4:  * These tests use `vi.mock()` to override `CLI_VERSION` from constants.js
5:  * so that `canAttemptDelta()` passes its dev-build guard (the real `CLI_VERSION`
6:  * is "0.0.0-dev" in test mode, which short-circuits the orchestrator).
7:  *
8:  * Kept as a sibling file to `delta-upgrade.test.ts` because its
9:  * `vi.mock()` would invert the assumptions of the dev-mode null-return
10:  * tests in that file. Under `bun test --isolate` each file gets a fresh
11:  * module graph, so the mocks here don't leak. ...
gateway · 2026-09-09 00:18:25
result
No files found
gateway · 2026-09-09 00:20:38
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
240:     throw new UpgradeError(
241:       "unsupported_operation",
242:       "Homebrew does not support installing a specific version. Run 'brew upgrade getsentry/tools/sentry' to upgrade to the latest formula version."
243:     );
244:   }
245:   // Offline mode is only supported for curl-installed binaries — package
246:   // managers always need network to fetch and install packages.
247:   if (offline && method !== "curl") {
248:     throw new UpgradeError(
249:       "unsupported_operation",
250:       "Offline upgrade is only supported for curl-installed binaries."
251:     );
252:   }
253: }
254: 
255: type ResolveTargetOptions = {
256:   method: InstallationMethod;
257:   channel: ReleaseChannel;
258:   versionArg: string | undefined;
259:   channelChanged: boolean;
260:   flags: UpgradeFlags;
261: ...
gateway · 2026-09-09 00:20:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
105:   }
106:   return false;
107: }
108: 
109: /**
110:  * Abort any pending version check to allow process exit.
111:  * Call this when main CLI work is complete.
112:  */
113: export function abortPendingVersionCheck(): void {
114:   pendingAbortController?.abort();
115:   pendingAbortController = null;
116: }
117: 
118: /**
119:  * Pre-fetch delta patches for a newly discovered version.
120:  *
121:  * Best-effort: errors are silently caught so the version check still succeeds.
122:  * After pre-fetching, opportunistically cleans up stale cached patches.
123:  */
124: async function maybePrefetchPatches(
125:   channel: "stable" | "nightly",
126:   latestVersion: string,
127:   signal: AbortSignal
128: ): Promise<void> {
129:   if (semverCompare(latestVersion, CLI_VERSION) !== 1) {
130:     return;
131:   ...
gateway · 2026-09-09 00:20:55
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 22:   prefetchStablePatches,

  Line 136:       await prefetchStablePatches(latestVersion, signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 124:     releasesUrl: GITHUB_RELEASES_URL,

  Line 155: export async function fetchRecentReleases(

  Line 197: export function extractStableChain(

  Line 475: export function resolveStableDelta(

  Line 610: export function prefetchStablePatches(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts:
  Line 554:  * Uses a higher `per_page` than `fetchRecentReleases()` in delta-upgrade
gateway · 2026-09-09 00:21:02
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
430:   const captured: { current?: string } = {};
431:   return {
432:     _source: captured,
433:     onResolved: ({ source, chain }) => {
434:       captured.current = source;
435:       const span = Sentry.getActiveSpan();
436:       span?.setAttribute("delta.source", source);
437:       log.debug(
438:         `Resolved patch chain from ${source}: ${chain.patches.length} patch(es), ${formatBytes(chain.totalSize)} total`
439:       );
440:     },
441:     onOfflineMiss: () => {
442:       captured.current = "offline_miss";
443:       Sentry.getActiveSpan()?.setAttribute("delta.source", "offline_miss");
444:     },
445:     onUnavailable: (reason: DeltaUnavailableReason) => {
446:       Sentry.getActiveSpan()?.setAttribute("telemetry_reason", reason);
447:     },
448:   };
449: }
450: 
451: // biome-ignore ...
gateway · 2026-09-09 00:21:11
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts:
  Line 5:  * All HTTP calls are mocked via globalThis.fetch to avoid network access.

  Line 64:       "org.opencontainers.image.source": "https://github.com/getsentry/cli",

  Line 103:   test("throws UpgradeError on network failure", async () => {

  Line 165:   test("throws UpgradeError on network failure", async () => {

  Line 334:   test("throws UpgradeError on network failure", async () => {

  Line 346:   test("throws UpgradeError on network failure during redirect follow", async () => {

  Line 398:   test("throws UpgradeError on network failure", async () => {

  Line 469:   test("throws UpgradeError on network failure", async () => ...
gateway · 2026-09-09 00:21:19
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 97: * **getsentry/toolkit history-preserving monorepo import**: Chose getsentry/toolkit as a workspace-release monorepo, importing getsentry/cli main as the initial history and rewriting/importing MCP history under packages/mcp before merging histories. Chose history-preserving import over copying sources into a fresh repo because provenance and blame remain useful. Then add workspace membership and unify scripts, lockfile, CI, Craft, and Publish discovery; validate both packages and workspace release dry-runs before redirecting old repositories.

  Line 162: * **CLI UPGRADE\_SOURCES bridge fallback**: Trap: switching stable releases, nightlies, installer URLs, or GHCR directly to getsentry/toolkit looks like a clean rename, but pre-bridge binaries know only getsentry/cli. ...
gateway · 2026-09-09 00:23:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
570:  *
571:  * @param code - OAuth error code (e.g., "authorization_pending", "slow_down")
572:  * @param description - Human-readable error description
573:  */
574: export class DeviceFlowError extends CliError {
575:   readonly code: string;
576: 
577:   constructor(code: string, description?: string) {
578:     super(description ?? code, EXIT.DEVICE_FLOW);
579:     this.name = "DeviceFlowError";
580:     this.code = code;
581:   }
582: }
583: 
584: // Upgrade Errors
585: 
586: export type UpgradeErrorReason =
587:   | "unknown_method"
588:   | "unsupported_operation"
589:   | "network_error"
590:   | "execution_failed"
591:   | "version_not_found"
592:   | "offline_cache_miss";
593: 
594: /**
595:  * Upgrade-related errors. ...
gateway · 2026-09-09 00:24:09
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts:
  Line 554:  * Uses a higher `per_page` than `fetchRecentReleases()` in delta-upgrade


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 155: export async function fetchRecentReleases(

  Line 181: export async function downloadStablePatch(
gateway · 2026-09-09 00:24:16
result
Found 53 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 214:     // GitHub tag check (for versionExists) — this repo uses un-prefixed tags

  Line 349:     test("reports already up to date when current equals target", async () => {

  Line 403:     test("reports error for non-existent version", async () => {

  Line 445:       // Should match current version (after stripping v prefix) and report up to date

  Line 783:   test("reports setup failure when spawn exits non-zero", async () => {

  Line 1022:     const err = new Error("EBUSY: resource busy or locked, uv_spawn");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/setup.test.ts:
  Line 226:   test("reports PATH already configured when binary dir is in PATH", async () => {

  Line 249:   test("reports no config file found for unknown ...
gateway · 2026-09-09 00:24:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
185:         {
186:           status: 200,
187:           headers: {
188:             "content-type": "application/vnd.oci.image.manifest.v1+json",
189:           },
190:         }
191:       );
192:     }
193: 
194:     return new Response("Not Found", { status: 404 });
195:   });
196: }
197: 
198: /**
199:  * Mock fetch to simulate GitHub releases API returning a specific version.
200:  * Handles the latest release endpoint, version-exists check, and npm registry.
201:  */
202: function mockGitHubVersion(version: string): void {
203:   mockFetch(async (url) => {
204:     const urlStr = String(url);
205: 
206:     // GitHub latest release endpoint — returns JSON with tag_name
207:     if (urlStr.includes("releases/latest")) {
208:       return new Response(JSON.stringify({ tag_name: version }), {
209:  ...
gateway · 2026-09-09 00:24:47
result
Found 33 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 27:   getBinaryDownloadUrl,

  Line 44:   downloadNightlyBlob,

  Line 375: export async function fetchLatestFromGitHub(

  Line 443: export async function fetchLatestNightlyVersion(

  Line 479:     return fetchLatestNightlyVersion();

  Line 482:     ? ...
gateway · 2026-09-09 00:25:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
810:         log.debug(`Binary became visible after ${attempt} attempts`);
811:       }
812:       return size;
813:     }
814:     if (attempt === VERIFY_MAX_ATTEMPTS) {
815:       break;
816:     }
817:     const delay = VERIFY_BASE_DELAY_MS * 2 ** (attempt - 1);
818:     log.debug(
819:       `Downloaded binary not yet visible at ${path}, retrying in ${delay}ms (attempt ${attempt}/${VERIFY_MAX_ATTEMPTS})`
820:     );
821:     await setTimeout(delay);
822:   }
823:   throw new UpgradeError(
824:     "execution_failed",
825:     `Downloaded binary is missing or empty at ${path}. ` +
826:       "This is usually transient — rerun `sentry cli upgrade` to retry."
827:   );
828: }
829: 
830: /**
831:  * Download the new binary to a temporary path and return its location. ...
gateway · 2026-09-09 00:25:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:   generate-patches:
431:     name: Generate Delta Patches
432:     needs: [changes, build-binary]
433:     # Only on main (nightlies) and release branches (stable) — skip PRs
434:     if: github.event_name != 'pull_request'
435:     runs-on: ubuntu-latest
436:     continue-on-error: true
437:     steps:
438:       - name: Install ORAS CLI
439:         # Only needed on main (to fetch previous nightly from GHCR)
440:         if: github.ref == 'refs/heads/main'
441:         run: |
442:           VERSION=1.3.1
443:           EXPECTED_SHA256="d52c4af76ce6a3ceb8579e51fb751a43ac051cca67f965f973a0b0e897a2bb86"
444:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"
445:           curl --retry 3 --retry-delay 5 --retry-all-errors -sfLo "$TARBALL" ...
gateway · 2026-09-09 00:25:42
result
No files found
gateway · 2026-09-09 00:25:52
result
No files found
gateway · 2026-09-09 00:26:05
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 974:     const url = getBinaryDownloadUrl("1.0.0");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 39:     const url = getBinaryDownloadUrl("1.0.0");

  Line 53:     const url = getBinaryDownloadUrl("2.0.0");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 721:   const url = getBinaryDownloadUrl(version);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 151: export function getBinaryDownloadUrl(version: string): string {
gateway · 2026-09-09 00:26:12
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts:
  Line 18:   GITHUB_RELEASES_URL,

  Line 564:       `${GITHUB_RELEASES_URL}?per_page=${CHANGELOG_MAX_RELEASES}`,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 156: export const GITHUB_RELEASES_URL =


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 35:   GITHUB_RELEASES_URL,

  Line 124:     releasesUrl: GITHUB_RELEASES_URL,

  Line 159:     const response = await ...
gateway · 2026-09-09 00:26:56
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 44: import { GHCR_REPO } from "./ghcr.js";

  Line 72: // GHCR_REPO). Importing as a named import keeps a single source of truth and

  Line 135:     repo: GHCR_REPO,

  Line 288:     repo: GHCR_REPO,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts:
  Line 134: export const GHCR_REPO = "getsentry/cli";

  Line 193:   const url = `${GHCR_REGISTRY}/token?scope=repository:${GHCR_REPO}:pull`;

  Line 232:   const url = `${GHCR_REGISTRY}/v2/${GHCR_REPO}/manifests/${tag}`;

  Line 337:   const blobUrl = `${GHCR_REGISTRY}/v2/${GHCR_REPO}/blobs/${digest}`;

  Line 432:   let url = `${GHCR_REGISTRY}/v2/${GHCR_REPO}/tags/list?n=${TAGS_PAGE_SIZE}`;
gateway · 2026-09-09 00:27:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 00:28:27
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts:
  Line 8:  * are tested via property-based tests in release-notes.property.test.ts.

  Line 21: } from "../../src/lib/release-notes.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts:
  Line 23: } from "../../src/lib/release-notes.js";
gateway · 2026-09-09 00:29:33
result
Found 15 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts:
  Line 43:   fetchChangelog,

  Line 88:   changelog?: ChangelogSummary;

  Line 725:  * Start a best-effort changelog fetch in parallel with the binary download.

  Line 727:  * Returns a promise that resolves to the changelog or undefined. Never

  Line 739:   return fetchChangelog({

  Line 749:  * Build a check-only result with optional changelog, ready to yield.

  Line 758:   changelogPromise: Promise<ChangelogSummary | undefined>;

  Line 764:   result.changelog = await opts.changelogPromise;

  Line 852:       // For --check with a version diff, fetch changelog before returning.

  Line 857:         result.changelog = await startChangelogFetch(

  Line 869:     // Start changelog fetch early — it runs in parallel with the download. ...
gateway · 2026-09-09 00:32:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
715:   channel: ReleaseChannel,
716:   channelChanged: boolean,
717:   version: string | undefined
718: ): void {
719:   if (channelChanged || CHANNEL_VERSIONS.has(version ?? "")) {
720:     setReleaseChannel(channel);
721:   }
722: }
723: 
724: /**
725:  * Start a best-effort changelog fetch in parallel with the binary download.
726:  *
727:  * Returns a promise that resolves to the changelog or undefined. Never
728:  * throws — errors are swallowed so the upgrade is not blocked.
729:  */
730: function startChangelogFetch(
731:   channel: ReleaseChannel,
732:   currentVersion: string,
733:   targetVersion: string,
734:   offline: OfflineMode
735: ): Promise<ChangelogSummary | undefined> {
736:   if (offline || currentVersion === targetVersion) {
737:     return Promise.resolve(undefined);
738:   }
739:   ...
gateway · 2026-09-09 00:35:20
result
No files found
gateway · 2026-09-09 00:38:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
120:     return false;
121:   }
122: }
123: 
124: /**
125:  * Build the platform-specific binary base name.
126:  *
127:  * Matches the naming convention used by GitHub Releases and GHCR:
128:  * `sentry-<os>-<arch>[-musl][.exe]` (e.g., `sentry-linux-x64`, `sentry-linux-arm64-musl`).
129:  */
130: export function getPlatformBinaryName(): string {
131:   let os: string;
132:   if (process.platform === "darwin") {
133:     os = "darwin";
134:   } else if (process.platform === "win32") {
135:     os = "windows";
136:   } else {
137:     os = "linux";
138:   }
139:   const arch = process.arch === "arm64" ? "arm64" : "x64";
140:   const libcSuffix = isMusl() ? "-musl" : "";
141:   const suffix = process.platform === "win32" ? ".exe" : "";
142:   return `sentry-${os}-${arch}${libcSuffix}${suffix}`;
143: }
144: 
145: /**
146: ...
gateway · 2026-09-09 00:44:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
350:   if (legacyMethod !== "unknown") {
351:     try {
352:       setInstallInfo({
353:         method: legacyMethod,
354:         path: process.execPath,
355:         version: CLI_VERSION,
356:       });
357:     } catch {
358:       log.debug("Failed to persist install info (DB may be read-only)");
359:     }
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): ...
gateway · 2026-09-09 00:45:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
133: /** GHCR repository for CLI distribution */
134: export const GHCR_REPO = "getsentry/cli";
135: 
136: /** OCI tag for nightly builds */
137: export const GHCR_TAG = "nightly";
138: 
139: /** Base URL for GHCR registry API */
140: const GHCR_REGISTRY = "https://ghcr.io";
141: 
142: /** OCI manifest media type */
143: const OCI_MANIFEST_TYPE = "application/vnd.oci.image.manifest.v1+json";
144: 
145: /**
146:  * A single layer entry from an OCI manifest.
147:  *
148:  * Each binary in the nightly push is stored as a separate layer.
149:  * The `annotations` map includes `org.opencontainers.image.title` (filename)
150:  * and `org.opencontainers.image.created` (push time).
151:  */
152: export type OciLayer = {
153:   /** Content-addressable digest for the blob (e.g., "sha256:abc123...") */
154:   digest: string;
155:   ...
gateway · 2026-09-09 00:46:14
result
Found 35 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 60: export type { InstallationMethod } from "./binary.js";

  Line 74: export type OfflineMode = false | "explicit" | "network-fallback";

  Line 79: export const NIGHTLY_TAG = "nightly";

  Line 82: const NPM_REGISTRY_URL = "https://registry.npmjs.org/sentry";

  Line 85: export const VERSION_PREFIX_REGEX = /^v/;

  Line 100: function getKnownCurlPaths(): string[] {

  Line 116: export function getCurlInstallPaths(): {

  Line 158: export function startCleanupOldBinary(): void {

  Line 176: function runCommand(

  Line 209: async function isInstalledWith(pm: PackageManager): Promise<boolean> {

  Line 234: function isHomebrewInstall(): boolean {

  Line 260: export function detectPackageManagerFromPath(): PackageManager | null {

  Line 291: async function detectLegacyInstallationMethod(): Promise<InstallationMethod> {

  Line 331: ...
gateway · 2026-09-09 00:46:25
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 77: * **toolkit pre-rename subtree merge**: Chose importing getsentry/cli into an integration branch of getsentry/sentry-mcp, validating the complete monorepo there, then renaming it to getsentry/toolkit over renaming first because pre-rename validation preserves known MCP deployment wiring and makes rollback safer. Keep CLI at packages/cli and docs at apps/cli-docs; use a pnpm workspace without Turbo, independent cli@/mcp@ releases, root-managed patches/catalogs, and later incremental extraction into @sentry/toolkit-core.

  Line 97: * **getsentry/toolkit history-preserving monorepo import**: Chose getsentry/toolkit as a workspace-release monorepo, importing getsentry/cli main as the initial history and rewriting/importing MCP history under packages/mcp before merging histories. ...
gateway · 2026-09-09 00:47:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 00:47:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/CONTRIBUTING.md</path>
<type>file</type>
<content>
1: # Contributing to Sentry CLI
2: 
3: This guide documents the patterns and conventions used in this CLI for consistency.
4: 
5: ## Command Patterns
6: 
7: We follow [gh CLI](https://cli.github.com/) conventions for best-in-class developer experience.
8: 
9: ### List Commands
10: 
11: List commands use **optional positional arguments** for context with smart auto-detection.
12: 
13: ```bash
14: sentry org list [--limit N] [--json]
15: sentry project list [org] [--limit N] [--json]
16: sentry issue list [<org>/<project>] [--json]
17: ```
18: 
19: **Target syntax**:
20: - `<org>/<project>` - Explicit organization and project (e.g., `my-org/frontend`)
21: - `<org>/` - All projects in the specified organization
22: - `<project>` - Search for project by name across all accessible organizations
23: - *(omit)* - Auto-detect ...
gateway · 2026-09-09 00:48:14
result
## chore/preshape-monorepo...origin/chore/preshape-monorepo [gone]
 M .lore.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus
605e8318d1f316bd28f53763f71ed716d1869616
605e8318d chore: regenerate docs
gateway · 2026-09-09 00:49:11
result
Found 29 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 31: const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;

  Line 42: const NOTIFICATION_INTERVAL_MS = 24 * 60 * 60 * 1000;

  Line 45: const JITTER_FACTOR = 0.2;

  Line 48: const SUPPRESSED_ARGS = new Set([

  Line 64: const SUPPRESSED_CLI_SUBCOMMANDS = new Set(["setup", "fix"]);

  Line 73: function shouldCheckForUpdate(): boolean {

  Line 98: export function shouldSuppressNotification(args: string[]): boolean {

  Line 113: export function abortPendingVersionCheck(): void {

  Line 124: async function maybePrefetchPatches(

  Line 156: function checkForUpdateInBackgroundImpl(): void {

  Line 217: function isStderrTTY(): boolean {

  Line 237: function canNotifyAgain(lastNotified: number | null): boolean {

  Line 254: function getUpdateNotificationWithCopy(

  Line 306: function formatStandardUpdateNotification(latestVersion: ...
gateway · 2026-09-09 00:49:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-09 00:50:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
330:       expectedFrom: previousVersion,
331:       patchLayerName,
332:       sizeLimit: opts.fullGzSize * SIZE_THRESHOLD_RATIO - totalSize,
333:     });
334:     if (!result.ok) {
335:       Sentry.getActiveSpan()?.setAttribute(
336:         "telemetry_reason",
337:         result.failure.reason
338:       );
339:       return null;
340:     }
341:     const toVersion = tag.slice(PATCH_TAG_PREFIX.length);
342:     digests.push(result.digest);
343:     totalSize += result.size;
344:     steps.push({ fromVersion: previousVersion, toVersion });
345:     previousVersion = toVersion;
346:     if (index === manifests.length - 1) {
347:       expectedSha256 = getPatchTargetSha256(manifest, binaryName) ?? "";
348:     }
349:   }
350:   if (previousVersion !== opts.targetVersion || !expectedSha256) {
351:     ...
gateway · 2026-09-09 00:53:08
result
Found 11 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 124: async function maybePrefetchPatches(

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 156: function checkForUpdateInBackgroundImpl(): void {

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);

  Line 188:         await maybePrefetchPatches(channel, latestVersion, signal);

  Line 351:   checkForUpdateInBackgroundImpl();
gateway · 2026-09-09 00:53:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
110:  * Abort any pending version check to allow process exit.
111:  * Call this when main CLI work is complete.
112:  */
113: export function abortPendingVersionCheck(): void {
114:   pendingAbortController?.abort();
115:   pendingAbortController = null;
116: }
117: 
118: /**
119:  * Pre-fetch delta patches for a newly discovered version.
120:  *
121:  * Best-effort: errors are silently caught so the version check still succeeds.
122:  * After pre-fetching, opportunistically cleans up stale cached patches.
123:  */
124: async function maybePrefetchPatches(
125:   channel: "stable" | "nightly",
126:   latestVersion: string,
127:   signal: AbortSignal
128: ): Promise<void> {
129:   if (semverCompare(latestVersion, CLI_VERSION) !== 1) {
130:     return;
131:   }
132:   try {
133:     if (channel === "nightly") ...
gateway · 2026-09-09 00:53:28
<!-- lore-recall:e30b1b84-0e9a-4cde-9435-20ec76631024 --><!-- lore-recall:ac6cf028-2d41-4865-88d2-4bc1c2bd28d3 --><!-- lore-recall:3583b226-3bfd-4977-85f8-3e82192c983e -->
gpt-5.6-sol · 2026-09-09 00:53:28 · ~88 tokens
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 380:     { headers: getGitHubHeaders(), signal },

  Line 539:       { method: "HEAD", headers: getGitHubHeaders() },

  Line 722:   const headers = getGitHubHeaders();


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts:
  Line 565:       { headers: getGitHubHeaders() }

  Line 666:     response = await customFetch(url, { headers: getGitHubHeaders() });


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 265: export function getGitHubHeaders(): Record<string, string> {
gateway · 2026-09-09 00:54:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 00:54:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-09 00:56:43
result
Found 48 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 189: describe("fetchLatestFromGitHub", () => {

  Line 284: describe("fetchLatestFromNpm", () => {

  Line 396: describe("fetchLatestVersion", () => {

  Line 546: describe("versionExists", () => {

  Line 706: describe("executeUpgrade", () => {

  Line 727: describe("detectInstallationMethod — stored info path", () => {

  Line 831: describe("detectPackageManagerFromPath", () => {

  Line 914: describe("detectInstallationMethod — node_modules path fallback", () => {

  Line 972: describe("getBinaryDownloadUrl", () => {

  Line 1136: describe("acquireLock", () => {

  Line 1253: describe("executeUpgrade with curl method", () => {

  Line 1415: describe("startCleanupOldBinary", () => {

  Line 1466: describe("isNightlyVersion", () => {

  Line 1480: describe("fetchLatestNightlyVersion", () => {

  Line 1553: ...
gateway · 2026-09-09 00:57:29
result
Found 25 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts:
  Line 61: const CHANNEL_VERSIONS = new Set(["nightly", "stable"]);

  Line 70: export type UpgradeResult = {

  Line 91: type UpgradeFlags = {

  Line 108: function resolveChannelAndVersion(positional: string | undefined): {

  Line 137: function resolveOfflineTarget(versionArg: string | undefined): string {

  Line 160: async function resolveTargetWithFallback(opts: {

  Line 228: function validateMethod(

  Line 255: type ResolveTargetOptions = {

  Line 270: type ResolveResult =

  Line 280: async function resolveTargetVersion(

  Line 335: function buildCheckResult(opts: {

  Line 371: const SPAWN_MAX_ATTEMPTS = 5;

  Line 374: const SPAWN_RETRY_BASE_MS = 500;

  Line 382: export function isEbusyError(error: unknown): boolean {

  Line 395: export function isEnoentSpawnError(error: unknown): boolean {

  Line 423: async ...
gateway · 2026-09-09 00:58:09
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json:
  Line 7:     "url": "git+https://github.com/getsentry/cli.git"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/README.md:
  Line 133: git clone https://github.com/getsentry/cli.git


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/sentry.ts:
  Line 919:  * https://github.com/getsentry/sentry/blob/8a4f150b21b/static/app/views/explore/hooks/useTraceItemDetails.tsx#L85-L89


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/dashboard.ts:
  Line 223:  * Source: https://github.com/getsentry/sentry/blob/master/src/sentry/search/events/constants.py

  Line 238:  * Source: ...
gateway · 2026-09-09 00:59:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:01:28
result
Found 12 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts:
  Line 15:   buildChangelogSummary,

  Line 109: // ──────────────────── buildChangelogSummary ─────────────────────────────────

  Line 111: describe("buildChangelogSummary", () => {

  Line 126:     const summary = buildChangelogSummary(releases, "0.19.0", "0.21.0");

  Line 139:     expect(buildChangelogSummary(releases, "0.21.0", "0.22.0")).toBeNull();

  Line 144:     expect(buildChangelogSummary(emptyReleases, "0.19.0", "0.21.0")).toBeNull();

  Line 149:     expect(buildChangelogSummary(releases, "0.17.0", "0.18.0")).toBeNull();

  Line 153:     const summary = buildChangelogSummary(releases, "0.19.0", "0.20.0");

  Line 160:     const summary = buildChangelogSummary(releases, "0.18.0", "0.21.0");

  Line 169:     const summary = buildChangelogSummary(releases, "0.18.0", "0.21.0");

  Line 184:     const summary = ...
gateway · 2026-09-09 01:02:13
result
No files found
gateway · 2026-09-09 01:03:00
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/AGENTS.md</path>
<type>file</type>
<content>
1: <!-- This section is maintained by the coding agent via lore (https://github.com/BYK/loreai) -->
2: ## Long-term Knowledge
3: 
4: For long-term knowledge entries managed by [lore](https://github.com/BYK/loreai) (gotchas, patterns, decisions, architecture), see [`.lore.md`](.lore.md) in the project root.
5: <!-- End lore-managed section -->

(End of file - total 5 lines)
</content>
gateway · 2026-09-09 01:03:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 01:04:51
result
Found 20 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 23: } from "./delta-upgrade.js";

  Line 27: import { cleanupPatchCache } from "./patch-cache.js";

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 36: } from "./binary.js";

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 50: } from "./ghcr.js";

  Line 52: import { clearPatchCache } from "./patch-cache.js";

  Line 60: export type { InstallationMethod } from "./binary.js";

  Line 62: export { parseInstallationMethod } from "./binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/telemetry.ts:
  Line 19: import { isMusl } ...
gateway · 2026-09-09 01:05:43
result
<skill_content name="jj-guide">
# Skill: jj-guide

# jj Guide for AI Agents

Jujutsu (jj) is a Git-compatible VCS with mutable commits, automatic snapshotting, no staging area, and first-class conflicts. This skill teaches you how to use it safely from a non-interactive agent environment.

If `.jj/` exists in the repo root, this is a jj repo. **Use `jj` commands, not `git`.** In a colocated repo (`.jj/` *and* `.git/`), git tools can read the state, but mutations should go through `jj` so the operation log stays consistent.

## Critical Rules

- **NEVER** use interactive flags (`-i`, `--interactive`). TUI prompts hang in agent environments. This applies to `jj split -i`, `jj squash -i`, `jj commit -i`, `jj resolve`, `jj diffedit`, etc.
- **ALWAYS** pass `-m "msg"` when describing/committing. Without `-m`, an editor opens and hangs.
- **VERIFY** mutations with `jj st` and `jj log` after `squash`, `abandon`, `rebase`, `restore`, `commit`. ...
gateway · 2026-09-09 01:06:15
result
Found 37 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 124: async function maybePrefetchPatches(

  Line 156: function checkForUpdateInBackgroundImpl(): void {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 122: function stableSource(): SourceStrategy {

  Line 132: function nightlySource(): SourceStrategy {

  Line 155: export async function fetchRecentReleases(

  Line 181: export async function downloadStablePatch(

  Line 270: export function resolveStableChain(

  Line 278: export async function resolveNightlyChain(opts: {

  Line 511: export function attemptDeltaUpgrade(

  Line 603: export function prefetchNightlyPatches(

  Line 610: export function ...
gateway · 2026-09-09 01:06:54
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/CONTRIBUTING.md</path>
<type>file</type>
<content>
1: # Contributing to Sentry CLI
2: 
3: This guide documents the patterns and conventions used in this CLI for consistency.
4: 
5: ## Command Patterns
6: 
7: We follow [gh CLI](https://cli.github.com/) conventions for best-in-class developer experience.
8: 
9: ### List Commands
10: 
11: List commands use **optional positional arguments** for context with smart auto-detection.
12: 
13: ```bash
14: sentry org list [--limit N] [--json]
15: sentry project list [org] [--limit N] [--json]
16: sentry issue list [<org>/<project>] [--json]
17: ```
18: 
19: **Target syntax**:
20: - `<org>/<project>` - Explicit organization and project (e.g., `my-org/frontend`)
21: - `<org>/` - All projects in the specified organization
22: - `<project>` - Search for project by name across all accessible organizations
23: - *(omit)* - Auto-detect ...
gateway · 2026-09-09 01:07:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md</path>
<type>file</type>
<content>
1: <!-- Managed by lore (https://github.com/BYK/loreai) — manual edits are imported on next session. -->
2: 
3: ## Long-term Knowledge
4: 
5: ### Architecture
6: 
7: <!-- lore:01a082c2-7319-7203-9f61-05a59272a7f0 -->
8: * **atomicWriteFile skill installation**: Chose same-directory temporary writes followed by \`rename()\` over direct destination writes because POSIX readers must never observe truncated skill files. Dot-prefixed \`\*.tmp\` names must not match \`SKILL.md\` or \`\*.md\`; remove leftovers on failure while preserving the original error. The atomic guarantee is POSIX-only—Windows readers may cause \`EPERM\`/\`EBUSY\`, so installation remains best-effort. Never create top-level \`.agents\` or \`.claude\` roots because their presence signals an installed agent.
9: 
10: <!-- lore:019fb942-0286-79e3-8f6c-f939e8ff3ee6 -->
11: * ...
gateway · 2026-09-09 01:08:41
result
No files found
gateway · 2026-09-09 01:08:48
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 77: * **toolkit pre-rename subtree merge**: Chose importing getsentry/cli into an integration branch of getsentry/sentry-mcp, validating the complete monorepo there, then renaming it to getsentry/toolkit over renaming first because pre-rename validation preserves known MCP deployment wiring and makes rollback safer. Keep CLI at packages/cli and docs at apps/cli-docs; use a pnpm workspace without Turbo, independent cli@/mcp@ releases, root-managed patches/catalogs, and later incremental extraction into @sentry/toolkit-core.

  Line 97: * **getsentry/toolkit history-preserving monorepo import**: Chose getsentry/toolkit as a workspace-release monorepo, importing getsentry/cli main as the initial history and rewriting/importing MCP history under packages/mcp before merging histories. ...
gateway · 2026-09-09 01:09:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:09:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-09 01:11:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 01:11:14
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/CONTRIBUTING.md</path>
<type>file</type>
<content>
1: # Contributing to Sentry CLI
2: 
3: This guide documents the patterns and conventions used in this CLI for consistency.
4: 
5: ## Command Patterns
6: 
7: We follow [gh CLI](https://cli.github.com/) conventions for best-in-class developer experience.
8: 
9: ### List Commands
10: 
11: List commands use **optional positional arguments** for context with smart auto-detection.
12: 
13: ```bash
14: sentry org list [--limit N] [--json]
15: sentry project list [org] [--limit N] [--json]
16: sentry issue list [<org>/<project>] [--json]
17: ```
18: 
19: **Target syntax**:
20: - `<org>/<project>` - Explicit organization and project (e.g., `my-org/frontend`)
21: - `<org>/` - All projects in the specified organization
22: - `<project>` - Search for project by name across all accessible organizations
23: - *(omit)* - Auto-detect ...
gateway · 2026-09-09 01:11:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 01:11:36
result
## chore/preshape-monorepo...origin/chore/preshape-monorepo [gone]
 M .lore.md
605e8318d (HEAD -> chore/preshape-monorepo) chore: regenerate docs
30ad8b075 ci: organize imports in bundle.ts (biome)
a3921f773 ci: address Seer finding on bundle.ts WASM resolution
12bb0fa77 chore(cli): sync scripts + Bugbot fixes for #1254 (post-feedback rebase)
ab3aa054f chore: address adversarial review findings for monorepo pre-shape
157184517 ci: fix check-generated job paths for monorepo layout
cf165f5ba chore: pre-shape repo into pnpm-workspace monorepo layout
0b43edad4 chore: regenerate docs
elucid	https://github.com/elucid/cli.git (fetch)
elucid	https://github.com/elucid/cli.git (push)
origin	https://github.com/getsentry/cli.git (fetch)
origin	https://github.com/getsentry/cli.git (push)
raees	https://github.com/RaeesBhatti/cli.git (fetch)
raees	https://github.com/RaeesBhatti/cli.git (push)
gateway · 2026-09-09 01:12:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:13:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 01:14:00
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121...
gateway · 2026-09-09 01:14:10
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json:
  Line 7:     "url": "git+https://github.com/getsentry/cli.git"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

  Line 492:       if (urlStr.includes("ghcr.io/token")) {

  Line 514:       if (urlStr.includes("ghcr.io/token")) {

  Line 636:       if (u.includes("ghcr.io/token")) {

  Line 652:       if (u.includes("ghcr.io/token")) {

  Line 669:       if (u.includes("ghcr.io/token")) {

  Line 694:       if (u.includes("ghcr.io/token")) {

  Line 972: describe("getBinaryDownloadUrl", () => {

  Line 974:     const url = getBinaryDownloadUrl("1.0.0");

  Line 979:       "https://github.com/getsentry/cli/releases/download/"

  Line 1487:       if (urlStr.includes("ghcr.io/token")) {

  Line 1528: ...
gateway · 2026-09-09 01:15:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
100:   // Heuristic 1: Check for musl dynamic linker
101:   const muslArch = process.arch === "x64" ? "x86_64" : "aarch64";
102:   if (existsSync(`/lib/ld-musl-${muslArch}.so.1`)) {
103:     cachedIsMusl = true;
104:     return true;
105:   }
106: 
107:   // Heuristic 2: ldd --version output (musl ldd writes "musl libc" to stderr)
108:   try {
109:     const result = spawnSync("ldd", ["--version"], {
110:       stdio: ["ignore", "pipe", "pipe"],
111:     });
112:     const output =
113:       Buffer.from(result.stdout).toString() +
114:       Buffer.from(result.stderr).toString();
115:     cachedIsMusl = output.toLowerCase().includes("musl");
116:     return cachedIsMusl;
117:   } catch {
118:     // ldd not found or failed — assume glibc (the common case)
119:     cachedIsMusl = false;
120:     return false;
121:   ...
gateway · 2026-09-09 01:15:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-09 01:16:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): Promise<string> {
378:   const response = await fetchWithUpgradeError(
379:     `${GITHUB_RELEASES_URL}/latest`,
380:     { headers: getGitHubHeaders(), signal },
381:     "GitHub"
382:   );
383: 
384:   if (!response.ok) {
385:     throw new UpgradeError(
386:       "network_error",
387:       `Failed to fetch from GitHub: ${response.status}`
388:     );
389:   }
390: 
391: ...
gateway · 2026-09-09 01:16:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-09 01:17:04
result
Found 23 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 23: } from "./delta-upgrade.js";

  Line 27: import { cleanupPatchCache } from "./patch-cache.js";

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 36: } from "./binary.js";

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 50: } from "./ghcr.js";

  Line 52: import { clearPatchCache } from "./patch-cache.js";

  Line 60: export type { InstallationMethod } from "./binary.js";

  Line 62: export { parseInstallationMethod } from "./binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/telemetry.ts:
  Line 19: import { isMusl } ...
gateway · 2026-09-09 01:17:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): Promise<string> {
378:   const response = await fetchWithUpgradeError(
379:     `${GITHUB_RELEASES_URL}/latest`,
380:     { headers: getGitHubHeaders(), signal },
381:     "GitHub"
382:   );
383: 
384:   if (!response.ok) {
385:     throw new UpgradeError(
386:       "network_error",
387:       `Failed to fetch from ...
gateway · 2026-09-09 01:19:00
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 31: const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;

  Line 42: const NOTIFICATION_INTERVAL_MS = 24 * 60 * 60 * 1000;

  Line 45: const JITTER_FACTOR = 0.2;

  Line 48: const SUPPRESSED_ARGS = new Set([

  Line 64: const SUPPRESSED_CLI_SUBCOMMANDS = new Set(["setup", "fix"]);

  Line 73: function shouldCheckForUpdate(): boolean {

  Line 98: export function shouldSuppressNotification(args: string[]): boolean {

  Line 113: export function abortPendingVersionCheck(): void {

  Line 124: async function maybePrefetchPatches(

  Line 156: function checkForUpdateInBackgroundImpl(): void {

  Line 217: function isStderrTTY(): boolean {

  Line 237: function canNotifyAgain(lastNotified: number | null): boolean {

  Line 254: function getUpdateNotificationWithCopy(

  Line 306: function ...
gateway · 2026-09-09 01:19:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 01:20:31
result
Found 96 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/issue/resolve.ts:
  Line 113:       "  sentry issue resolve CLI-XX -i @commit:getsentry/cli@abc123\n" +


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 40:  * getsentry/cli#785 item #10).

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await ...
gateway · 2026-09-09 01:21:03
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:21:45
result
## chore/preshape-monorepo...origin/chore/preshape-monorepo [gone]
 M .lore.md
605e8318d chore: regenerate docs
gateway · 2026-09-09 01:22:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 01:23:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
100:   // Heuristic 1: Check for musl dynamic linker
101:   const muslArch = process.arch === "x64" ? "x86_64" : "aarch64";
102:   if (existsSync(`/lib/ld-musl-${muslArch}.so.1`)) {
103:     cachedIsMusl = true;
104:     return true;
105:   }
106: 
107:   // Heuristic 2: ldd --version output (musl ldd writes "musl libc" to stderr)
108:   try {
109:     const result = spawnSync("ldd", ["--version"], {
110:       stdio: ["ignore", "pipe", "pipe"],
111:     });
112:     const output =
113:       Buffer.from(result.stdout).toString() +
114:       Buffer.from(result.stderr).toString();
115:     cachedIsMusl = output.toLowerCase().includes("musl");
116:     return cachedIsMusl;
117:   } catch {
118:     // ldd not found or failed — assume glibc (the common case)
119:     cachedIsMusl = false;
120:     return false;
121:   ...
gateway · 2026-09-09 01:23:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 01:24:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/AGENTS.md</path>
<type>file</type>
<content>
1: <!-- This section is maintained by the coding agent via lore (https://github.com/BYK/loreai) -->
2: ## Long-term Knowledge
3: 
4: For long-term knowledge entries managed by [lore](https://github.com/BYK/loreai) (gotchas, patterns, decisions, architecture), see [`.lore.md`](.lore.md) in the project root.
5: <!-- End lore-managed section -->

(End of file - total 5 lines)
</content>
gateway · 2026-09-09 01:24:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md</path>
<type>file</type>
<content>
1: <!-- Managed by lore (https://github.com/BYK/loreai) — manual edits are imported on next session. -->
2: 
3: ## Long-term Knowledge
4: 
5: ### Architecture
6: 
7: <!-- lore:01a082c2-7319-7203-9f61-05a59272a7f0 -->
8: * **atomicWriteFile skill installation**: Chose same-directory temporary writes followed by \`rename()\` over direct destination writes because POSIX readers must never observe truncated skill files. Dot-prefixed \`\*.tmp\` names must not match \`SKILL.md\` or \`\*.md\`; remove leftovers on failure while preserving the original error. The atomic guarantee is POSIX-only—Windows readers may cause \`EPERM\`/\`EBUSY\`, so installation remains best-effort. Never create top-level \`.agents\` or \`.claude\` roots because their presence signals an installed agent.
9: 
10: <!-- lore:019fb942-0286-79e3-8f6c-f939e8ff3ee6 -->
11: * ...
gateway · 2026-09-09 01:25:32
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts:
  Line 25: const GHCR_REQUEST_TIMEOUT = 10_000;

  Line 28: const GHCR_MAX_RETRIES = 1;

  Line 31: const GHCR_BLOB_TIMEOUT = 30_000;

  Line 134: export const GHCR_REPO = "getsentry/cli";

  Line 137: export const GHCR_TAG = "nightly";

  Line 140: const GHCR_REGISTRY = "https://ghcr.io";

  Line 152: export type OciLayer = {

  Line 169: export type OciManifest = {

  Line 192: export async function getAnonymousToken(signal?: AbortSignal): Promise<string> {

  Line 227: export async function fetchManifest(

  Line 265: export async function fetchNightlyManifest(

  Line 280: export function getNightlyVersion(manifest: OciManifest): string {

  Line 302: export function findLayerByFilename(

  Line 332: export async function downloadNightlyBlob(

  Line 471: export async function listTags(

  Line 513: export async ...
gateway · 2026-09-09 01:27:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 01:28:11
result
No files found
gateway · 2026-09-09 01:28:30

What would you like me to search for in the repository?

gpt-5.6-sol · 2026-09-09 01:28:30 · ~12 tokens

Return your completed code-path analysis and concrete recommendations now. Do not edit files.

gateway · 2026-09-09 01:29:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:29:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
340:   const stored = getInstallInfo();
341:   if (stored?.method) {
342:     return stored.method;
343:   }
344: 
345:   // Legacy detection for existing installs (pre-setup command)
346:   const legacyMethod = await detectLegacyInstallationMethod();
347: 
348:   // Auto-save detected method for future runs (best-effort —
349:   // a read-only or broken DB shouldn't block detection)
350:   if (legacyMethod !== "unknown") {
351:     try {
352:       setInstallInfo({
353:         method: legacyMethod,
354:         path: process.execPath,
355:         version: CLI_VERSION,
356:       });
357:     } catch {
358:       log.debug("Failed to persist install info (DB may be read-only)");
359:     }
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version ...
gateway · 2026-09-09 01:29:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
780: 
781: /**
782:  * Wait for a freshly written binary to become visible by path.
783:  *
784:  * On Windows + Bun 1.3.9 (CLI-1D3), streaming writes via `Bun.file().writer()`
785:  * can return from `writer.end()` before the OS surfaces the file by path.
786:  * A subsequent `Bun.spawn` then fails with `Executable not found in $PATH`.
787:  * Polling with exponential backoff lets the transient visibility race
788:  * self-heal without prompting the user to manually retry.
789:  *
790:  * Backoff table (6 probes, 5 sleeps, cumulative worst case 3.1s):
791:  *
792:  * | Attempt | Probe at | Sleep after |
793:  * |---------|----------|-------------|
794:  * | 1       | 0 ms     | 100 ms      |
795:  * | 2       | 100 ms   | 200 ms      |
796:  * | 3       | 300 ms   | 400 ms      |
797:  * | 4       | 700 ms   | 800 ms ...
gateway · 2026-09-09 01:29:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
120:       // Only retry on timeout or network errors — not HTTP errors
121:       if (attempt >= GHCR_MAX_RETRIES || !isRetryableError(lastError)) {
122:         break;
123:       }
124:     }
125:   }
126: 
127:   throw new UpgradeError(
128:     "network_error",
129:     `${context}: ${lastError?.message ?? "unknown error"}`
130:   );
131: }
132: 
133: /** GHCR repository for CLI distribution */
134: export const GHCR_REPO = "getsentry/cli";
135: 
136: /** OCI tag for nightly builds */
137: export const GHCR_TAG = "nightly";
138: 
139: /** Base URL for GHCR registry API */
140: const GHCR_REGISTRY = "https://ghcr.io";
141: 
142: /** OCI manifest media type */
143: const OCI_MANIFEST_TYPE = "application/vnd.oci.image.manifest.v1+json";
144: 
145: /**
146:  * A single layer entry from an OCI manifest. ...
gateway · 2026-09-09 01:29:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-09 01:30:06
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
340:     }
341:     const toVersion = tag.slice(PATCH_TAG_PREFIX.length);
342:     digests.push(result.digest);
343:     totalSize += result.size;
344:     steps.push({ fromVersion: previousVersion, toVersion });
345:     previousVersion = toVersion;
346:     if (index === manifests.length - 1) {
347:       expectedSha256 = getPatchTargetSha256(manifest, binaryName) ?? "";
348:     }
349:   }
350:   if (previousVersion !== opts.targetVersion || !expectedSha256) {
351:     Sentry.getActiveSpan()?.setAttribute(
352:       "telemetry_reason",
353:       "version-mismatch"
354:     );
355:     return null;
356:   }
357: 
358:   const patches = await Promise.all(
359:     digests.map(async (digest) => {
360:       const data = new Uint8Array(
361:         await client.downloadBlobBuffer(opts.token, digest, ...
gateway · 2026-09-09 01:30:14
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Background version check for "new version available" notifications.
3:  *
4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the
5:  * latest nightly version via the OCI manifest annotation. For stable builds,
6:  * checks GitHub Releases. Results are cached in the database and shown on
7:  * subsequent runs.
8:  */
9: 
10: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
11: import * as Sentry from "@sentry/node-core/light";
12: import { compare as semverCompare } from "semver";
13: import { CLI_VERSION } from "./constants.js";
14: import { getReleaseChannel } from "./db/release-channel.js";
15: import {
16:   getVersionCheckInfo,
17:   markUpdateNotified,
18:   setVersionCheckInfo,
19: } from "./db/version-check.js";
20: ...
gateway · 2026-09-09 01:30:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
540: 
541: // ────────────────────────────── Fetch Functions ────────────────────────────
542: 
543: /**
544:  * Max releases to fetch for changelog purposes.
545:  *
546:  * Higher than the delta-upgrade cap (12) to cover larger version jumps.
547:  * GitHub API max per_page is 100; 30 covers ~6+ months of weekly releases.
548:  */
549: const CHANGELOG_MAX_RELEASES = 30;
550: 
551: /**
552:  * Fetch recent releases from GitHub for changelog building.
553:  *
554:  * Uses a higher `per_page` than `fetchRecentReleases()` in delta-upgrade
555:  * (which is capped at 12 for patch chain resolution) to cover larger
556:  * version jumps without silent truncation. ...
gateway · 2026-09-09 01:30:38
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
130:  * fetching from the network. Used by `--offline` and as automatic
131:  * fallback when `fetchLatestVersion()` hits a network error.
132:  *
133:  * @param versionArg - Explicit version from the user, bypasses the cache lookup
134:  * @returns The target version string
135:  * @throws {UpgradeError} When no cached version is available
136:  */
137: function resolveOfflineTarget(versionArg: string | undefined): string {
138:   if (versionArg) {
139:     return versionArg.replace(VERSION_PREFIX_REGEX, "");
140:   }
141:   const { latestVersion } = getVersionCheckInfo();
142:   if (!latestVersion) {
143:     throw new UpgradeError(
144:       "network_error",
145:       "No cached version available. Run any command to trigger a background version check, then retry."
146:     );
147:   }
148:   return ...
gateway · 2026-09-09 01:30:47
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
500:  * and record installation metadata.
501:  *
502:  * For curl upgrades with --install: the new binary places itself at the install
503:  * path, then runs setup steps. SENTRY_INSTALL_DIR is set in the child's
504:  * environment to pin the install directory, preventing `determineInstallDir()`
505:  * from relocating the binary to a different directory.
506:  *
507:  * For package manager upgrades: the binary is already in place, so setup only
508:  * updates completions, agent skills, and records metadata. ...
gateway · 2026-09-09 01:30:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
810:       force: {
811:         kind: "boolean",
812:         brief: "Force upgrade even if already on the latest version",
813:         default: false,
814:       },
815:       offline: {
816:         kind: "boolean",
817:         brief:
818:           "Upgrade using only cached version info and patches (no network)",
819:         default: false,
820:       },
821:       method: {
822:         kind: "parsed",
823:         parse: parseInstallationMethod,
824:         brief: "Installation method to use (curl, brew, npm, pnpm, bun, yarn)",
825:         optional: true,
826:         placeholder: "method",
827:       },
828:     },
829:   },
830:   async *func(this: SentryContext, flags: UpgradeFlags, version?: string) {
831:     const { channel, versionArg, channelChanged, method } =
832:       await ...
gateway · 2026-09-09 01:31:06
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
1: #!/bin/bash
2: set -euo pipefail
3: 
4: RED='\033[0;31m'
5: MUTED='\033[0;2m'
6: NC='\033[0m'
7: 
8: # Sentry error telemetry — fire-and-forget error reporting via envelope API.
9: # Uses the CLI's public write-only DSN. No PII collected.
10: # Opt-out: SENTRY_CLI_NO_TELEMETRY=1
11: SENTRY_DSN_KEY="1188a86f3f8168f089450587b00bca66"
12: SENTRY_INGEST="https://o1.ingest.us.sentry.io"
13: SENTRY_PROJECT_ID="4510776311808000"
14: 
15: # Generate a UUID for the event. Tries /proc, uuidgen, then awk fallback. ...
gateway · 2026-09-09 01:31:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml</path>
<type>file</type>
<content>
450:       - name: Install zig-bsdiff
451:         run: |
452:           VERSION=0.1.19
453:           EXPECTED_SHA256="9f1ac75a133ee09883ad2096a86d57791513de5fc6f262dfadee8dcee94a71b9"
454:           TARBALL="zig-bsdiff-linux-x64.tar.gz"
455:           curl --retry 3 --retry-delay 5 --retry-all-errors -sfLo "$TARBALL" "https://github.com/blackboardsh/zig-bsdiff/releases/download/v${VERSION}/${TARBALL}"
456:           echo "${EXPECTED_SHA256}  ${TARBALL}" | sha256sum -c -
457:           tar -xz -C /usr/local/bin < "$TARBALL"
458:           rm "$TARBALL"
459: 
460:       - name: Download current binaries
461:         uses: actions/download-artifact@v8
462:         with:
463:           # Use sentry-*-* to match platform binaries (sentry-linux-x64, etc.)
464:           # and their -gz variants, but not sentry-patches
465:       ...
gateway · 2026-09-09 01:31:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml</path>
<type>file</type>
<content>
1: minVersion: '2.21.1'
2: changelog:
3:   policy: auto
4: versioning:
5:   policy: auto
6: preReleaseCommand: bash -c 'cd packages/cli && node --experimental-strip-types script/bump-version.ts --pre'
7: postReleaseCommand: bash -c 'cd packages/cli && node --experimental-strip-types script/bump-version.ts --post'
8: artifactProvider:
9:   name: github
10:   config:
11:     artifacts:
12:       Build:
13:         - '/^sentry-.*$/'
14:         - 'npm-package'
15:         - 'gh-pages'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: gh-pages
20:   - name: registry
21:     apps:
22:       'app:sentry':
23:         name: 'Sentry CLI'
24:         packageUrl: 'https://www.npmjs.com/package/sentry'
25:         mainDocsUrl: 'https://cli.sentry.dev'
26:         urlTemplate: ...
gateway · 2026-09-09 01:32:28
result
Found 53 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/api.ts:
  Line 1350:       // (getsentry/cli#785 item #11).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/issue/resolve.ts:
  Line 113:       "  sentry issue resolve CLI-XX -i @commit:getsentry/cli@abc123\n" +


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/issue/list.ts:
  Line 961:  * the hardcoded default — this is the fix for getsentry/cli#785 item #9


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/project/view.ts:
  Line 146:  * generic "Could not auto-detect" fallback (getsentry/cli#785 ...
gateway · 2026-09-09 01:32:37
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 32: * **getsentry/cli two dependabot endpoints: advisories empty, alerts source of truth**: GitHub Dependabot data sources for getsentry/cli: - \`/repos/getsentry/cli/security-advisories\` → empty array (no published advisories for this repo). - \`/repos/getsentry/cli/dependabot/alerts\` → source of truth: 13 open, 15 fixed as of 2026-08-01. Alert taxonomy in this repo: alerts reference lockfiles (stale entries with no source manifest) OR transitive deps (no direct upgrade path). pnpm.overrides (\`package.json\`) is the canonical fix mechanism for transitive vulns — direct dep upgrades cascade via lockfile only. Sibling surfaces: \`pnpm audit\` reports additional CVEs not surfaced by Dependabot (e.g. @ai-sdk/provider-utils@<=3.0.97 LOW CVE-2026-8769) — separate scope, requires package upgrade not override. ...
gateway · 2026-09-09 01:35:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/db/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Version check state persistence.
3:  *
4:  * Stores the last time we checked for updates and the latest known version
5:  * in the metadata table for the "new version available" notification.
6:  */
7: 
8: import { getDatabase } from "./index.js";
9: import { clearMetadata, getMetadata, setMetadata } from "./utils.js";
10: 
11: const KEY_LAST_CHECKED = "version_check.last_checked";
12: const KEY_LATEST_VERSION = "version_check.latest_version";
13: /**
14:  * Timestamp (ms) when we last printed the "new version available"
15:  * notification to stderr. Separate from `last_checked` so the cached
16:  * latest-version can stay hot for faster subsequent checks while the
17:  * notification itself is rate-limited to once per day.
18:  */
19: const KEY_LAST_NOTIFIED = "version_check.last_notified";
20: ...
gateway · 2026-09-09 01:35:15
result
Found 25 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts:
  Line 9:   getVersionCheckInfo,

  Line 10:   setVersionCheckInfo,

  Line 135:     setVersionCheckInfo("0.0.0-dev");

  Line 144:     setVersionCheckInfo("0.0.0-alpha");

  Line 150:     setVersionCheckInfo("99.0.0");

  Line 161:     setVersionCheckInfo("99.0.0");

  Line 172:     setVersionCheckInfo("99.0.0");

  Line 185:     setVersionCheckInfo("99.0.0");

  Line 191:     setVersionCheckInfo("99.0.0");

  Line 205:     setVersionCheckInfo("99.0.0");

  Line 248:     setVersionCheckInfo("0.0.0-dev");

  Line 255:     setVersionCheckInfo("99.0.0");

  Line 268:     setVersionCheckInfo("99.0.0");

  Line 283:     setVersionCheckInfo("99.0.0");

  Line 296:     setVersionCheckInfo("99.0.0");

  Line 310:     setVersionCheckInfo("99.0.0");

  Line 318:     setVersionCheckInfo("99.0.0");

  Line 325:     ...
gateway · 2026-09-09 01:35:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts</path>
<type>file</type>
<content>
360: 
361: describe("abortPendingVersionCheck", () => {
362:   test("does not throw when no pending check", () => {
363:     // Should be safe to call even when nothing is pending
364:     expect(() => abortPendingVersionCheck()).not.toThrow();
365:   });
366: 
367:   test("does not throw when called multiple times", () => {
368:     // Should be safe to call multiple times
369:     expect(() => {
370:       abortPendingVersionCheck();
371:       abortPendingVersionCheck();
372:       abortPendingVersionCheck();
373:     }).not.toThrow();
374:   });
375: });
376: 
377: describe("maybeCheckForUpdateInBackground", () => {
378:   useTestConfigDir("test-version-bg-");
379:   let savedNoUpdateCheck: string | undefined;
380:   let originalFetch: typeof globalThis.fetch;
381: 
382:   beforeEach(() => {
383:     ...
gateway · 2026-09-09 01:36:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:37:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 01:38:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:38:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 01:39:44
result
No files found
gateway · 2026-09-09 01:40:24
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts:
  Line 64:         const baseUrl = "https://github.com/getsentry/cli/releases/download";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

  Line 136:   fetchLatestFromGitHub,

  Line 138:   fetchLatestNightlyVersion,

  Line 189: describe("fetchLatestFromGitHub", () => {

  Line 204:     const version = await fetchLatestFromGitHub();

  Line 222:     const version = await fetchLatestFromGitHub();

  Line 240:     const version = await fetchLatestFromGitHub();

  Line 252:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 253:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 263:     await ...
gateway · 2026-09-09 01:41:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:42:49
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 98: export function shouldSuppressNotification(args: string[]): boolean {

  Line 113: export function abortPendingVersionCheck(): void {

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);

  Line 331: export function resetUpdateNotificationState(): void {

  Line 347: export function maybeCheckForUpdateInBackground(): void {

  Line 358: export function getUpdateNotification(): string | null {

  Line 377: export function getErrorUpdateNotification(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   ...
gateway · 2026-09-09 01:43:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus</path>
<type>directory</type>
<entries>
.craft.yml
.git
.github/
.gitignore
.lore.md
.nojekyll
.npmrc
.opencode/
.plans/
.ruff_cache/
AGENTS.md
apps/
CHANGELOG.md
codemods/
coverage/
dist-bin/
dist/
docs/
LICENSE.md
node_modules/
package.json
packages/
pnpm-lock.yaml
pnpm-workspace.yaml
README.md
test-results.junit.xml

(26 entries)
</entries>
gateway · 2026-09-09 01:44:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
340:   const stored = getInstallInfo();
341:   if (stored?.method) {
342:     return stored.method;
343:   }
344: 
345:   // Legacy detection for existing installs (pre-setup command)
346:   const legacyMethod = await detectLegacyInstallationMethod();
347: 
348:   // Auto-save detected method for future runs (best-effort —
349:   // a read-only or broken DB shouldn't block detection)
350:   if (legacyMethod !== "unknown") {
351:     try {
352:       setInstallInfo({
353:         method: legacyMethod,
354:         path: process.execPath,
355:         version: CLI_VERSION,
356:       });
357:     } catch {
358:       log.debug("Failed to persist install info (DB may be read-only)");
359:     }
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version ...
gateway · 2026-09-09 01:45:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 01:45:49
result
Found 83 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json:
  Line 7:     "url": "git+https://github.com/getsentry/cli.git"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts:
  Line 64:         const baseUrl = "https://github.com/getsentry/cli/releases/download";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 979:       "https://github.com/getsentry/cli/releases/download/"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/security/auto-login-host-guard.test.ts:
  Line 6:  * Bug (getsentry/cli#1121): `sentry auth login` refuses a self-hosted ...
gateway · 2026-09-09 01:46:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
130: export function getPlatformBinaryName(): string {
131:   let os: string;
132:   if (process.platform === "darwin") {
133:     os = "darwin";
134:   } else if (process.platform === "win32") {
135:     os = "windows";
136:   } else {
137:     os = "linux";
138:   }
139:   const arch = process.arch === "arm64" ? "arm64" : "x64";
140:   const libcSuffix = isMusl() ? "-musl" : "";
141:   const suffix = process.platform === "win32" ? ".exe" : "";
142:   return `sentry-${os}-${arch}${libcSuffix}${suffix}`;
143: }
144: 
145: /**
146:  * Build the download URL for a platform-specific binary from GitHub releases. ...
gateway · 2026-09-09 01:47:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 01:48:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:48:50
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 30: export const KNOWN_CURL_DIRS = [".local/bin", "bin", ".sentry/bin"];

  Line 40: export type InstallationMethod =

  Line 50: const VALID_METHODS: InstallationMethod[] = [

  Line 66: export function parseInstallationMethod(value: string): InstallationMethod {

  Line 92: export function isMusl(): boolean {

  Line 130: export function getPlatformBinaryName(): string {

  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 156: export const GITHUB_RELEASES_URL =

  Line 168: export function isNightlyVersion(version: string): boolean {

  Line 181: export function compareVersions(a: string, b: string): -1 | 0 | 1 {

  Line 190: export function isDowngrade(current: string, target: string): boolean {

  Line 199: export function getBinaryFilename(): string {

  Line 211: export function ...
gateway · 2026-09-09 01:49:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:50:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/CONTRIBUTING.md</path>
<type>file</type>
<content>
1: # Contributing to Sentry CLI
2: 
3: This guide documents the patterns and conventions used in this CLI for consistency.
4: 
5: ## Command Patterns
6: 
7: We follow [gh CLI](https://cli.github.com/) conventions for best-in-class developer experience.
8: 
9: ### List Commands
10: 
11: List commands use **optional positional arguments** for context with smart auto-detection.
12: 
13: ```bash
14: sentry org list [--limit N] [--json]
15: sentry project list [org] [--limit N] [--json]
16: sentry issue list [<org>/<project>] [--json]
17: ```
18: 
19: **Target syntax**:
20: - `<org>/<project>` - Explicit organization and project (e.g., `my-org/frontend`)
21: - `<org>/` - All projects in the specified organization
22: - `<project>` - Search for project by name across all accessible organizations
23: - *(omit)* - Auto-detect ...
gateway · 2026-09-09 01:51:28
result
Found 63 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 156: export const GITHUB_RELEASES_URL =


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   ...
gateway · 2026-09-09 01:52:26
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/db/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900...
gateway · 2026-09-09 01:52:37
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 01:53:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
120:     return false;
121:   }
122: }
123: 
124: /**
125:  * Build the platform-specific binary base name.
126:  *
127:  * Matches the naming convention used by GitHub Releases and GHCR:
128:  * `sentry-<os>-<arch>[-musl][.exe]` (e.g., `sentry-linux-x64`, `sentry-linux-arm64-musl`).
129:  */
130: export function getPlatformBinaryName(): string {
131:   let os: string;
132:   if (process.platform === "darwin") {
133:     os = "darwin";
134:   } else if (process.platform === "win32") {
135:     os = "windows";
136:   } else {
137:     os = "linux";
138:   }
139:   const arch = process.arch === "arm64" ? "arm64" : "x64";
140:   const libcSuffix = isMusl() ? "-musl" : "";
141:   const suffix = process.platform === "win32" ? ".exe" : "";
142:   return `sentry-${os}-${arch}${libcSuffix}${suffix}`;
143: }
144: 
145: /**
146: ...
gateway · 2026-09-09 01:54:28
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 31: const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;

  Line 42: const NOTIFICATION_INTERVAL_MS = 24 * 60 * 60 * 1000;

  Line 73: function shouldCheckForUpdate(): boolean {

  Line 98: export function shouldSuppressNotification(args: string[]): boolean {

  Line 113: export function abortPendingVersionCheck(): void {

  Line 124: async function maybePrefetchPatches(

  Line 156: function checkForUpdateInBackgroundImpl(): void {

  Line 217: function isStderrTTY(): boolean {

  Line 237: function canNotifyAgain(lastNotified: number | null): boolean {

  Line 254: function getUpdateNotificationWithCopy(

  Line 306: function formatStandardUpdateNotification(latestVersion: string): string {

  Line 314: function formatContextualUpdateNotification(latestVersion: string): string {

  Line 331: export ...
gateway · 2026-09-09 01:55:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
350:   if (legacyMethod !== "unknown") {
351:     try {
352:       setInstallInfo({
353:         method: legacyMethod,
354:         path: process.execPath,
355:         version: CLI_VERSION,
356:       });
357:     } catch {
358:       log.debug("Failed to persist install info (DB may be read-only)");
359:     }
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): ...
gateway · 2026-09-09 01:56:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:56:48
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 32: * **getsentry/cli two dependabot endpoints: advisories empty, alerts source of truth**: GitHub Dependabot data sources for getsentry/cli: - \`/repos/getsentry/cli/security-advisories\` → empty array (no published advisories for this repo). - \`/repos/getsentry/cli/dependabot/alerts\` → source of truth: 13 open, 15 fixed as of 2026-08-01. Alert taxonomy in this repo: alerts reference lockfiles (stale entries with no source manifest) OR transitive deps (no direct upgrade path). pnpm.overrides (\`package.json\`) is the canonical fix mechanism for transitive vulns — direct dep upgrades cascade via lockfile only. Sibling surfaces: \`pnpm audit\` reports additional CVEs not surfaced by Dependabot (e.g. @ai-sdk/provider-utils@<=3.0.97 LOW CVE-2026-8769) — separate scope, requires package upgrade not override. ...
gateway · 2026-09-09 01:57:15
result
No files found
gateway · 2026-09-09 01:58:00
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 01:58:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 01:59:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-09 01:59:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-09 02:00:30
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 02:01:01
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 73: function shouldCheckForUpdate(): boolean {

  Line 98: export function shouldSuppressNotification(args: string[]): boolean {

  Line 113: export function abortPendingVersionCheck(): void {

  Line 124: async function maybePrefetchPatches(

  Line 156: function checkForUpdateInBackgroundImpl(): void {

  Line 217: function isStderrTTY(): boolean {

  Line 237: function canNotifyAgain(lastNotified: number | null): boolean {

  Line 254: function getUpdateNotificationWithCopy(

  Line 306: function formatStandardUpdateNotification(latestVersion: string): string {

  Line 314: function formatContextualUpdateNotification(latestVersion: string): string {

  Line 331: export function resetUpdateNotificationState(): void {

  Line 339: function isUpdateCheckDisabled(): boolean {

  Line 347: export ...
gateway · 2026-09-09 02:01:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
110:       stdio: ["ignore", "pipe", "pipe"],
111:     });
112:     const output =
113:       Buffer.from(result.stdout).toString() +
114:       Buffer.from(result.stderr).toString();
115:     cachedIsMusl = output.toLowerCase().includes("musl");
116:     return cachedIsMusl;
117:   } catch {
118:     // ldd not found or failed — assume glibc (the common case)
119:     cachedIsMusl = false;
120:     return false;
121:   }
122: }
123: 
124: /**
125:  * Build the platform-specific binary base name.
126:  *
127:  * Matches the naming convention used by GitHub Releases and GHCR:
128:  * `sentry-<os>-<arch>[-musl][.exe]` (e.g., `sentry-linux-x64`, `sentry-linux-arm64-musl`).
129:  */
130: export function getPlatformBinaryName(): string {
131:   let os: string;
132:   if (process.platform === "darwin") {
133:     os = ...
gateway · 2026-09-09 02:02:53
result
Found 79 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 156: export const GITHUB_RELEASES_URL =


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts:
  Line 134: export ...
gateway · 2026-09-09 02:03:37
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
350:   if (legacyMethod !== "unknown") {
351:     try {
352:       setInstallInfo({
353:         method: legacyMethod,
354:         path: process.execPath,
355:         version: CLI_VERSION,
356:       });
357:     } catch {
358:       log.debug("Failed to persist install info (DB may be read-only)");
359:     }
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): ...
gateway · 2026-09-09 02:04:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 02:05:14
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 02:06:12
result
Found 46 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 375: export async function fetchLatestFromGitHub(

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line ...
gateway · 2026-09-09 02:06:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-09 02:07:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 02:07:52
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts
/home/byk/.loc...
gateway · 2026-09-09 02:09:03
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 73: function shouldCheckForUpdate(): boolean {

  Line 98: export function shouldSuppressNotification(args: string[]): boolean {

  Line 113: export function abortPendingVersionCheck(): void {

  Line 124: async function maybePrefetchPatches(

  Line 156: function checkForUpdateInBackgroundImpl(): void {

  Line 217: function isStderrTTY(): boolean {

  Line 237: function canNotifyAgain(lastNotified: number | null): boolean {

  Line 254: function getUpdateNotificationWithCopy(

  Line 306: function formatStandardUpdateNotification(latestVersion: string): string {

  Line 314: function formatContextualUpdateNotification(latestVersion: string): string {

  Line 331: export function resetUpdateNotificationState(): void {

  Line 339: function isUpdateCheckDisabled(): boolean {

  Line 347: export ...
gateway · 2026-09-09 02:09:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 02:10:37
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-09 02:11:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 02:11:49
result
Found 91 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 40:  * getsentry/cli#785 item #10).

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 375: export async function fetchLatestFromGitHub(

  Line 379:  ...
gateway · 2026-09-09 02:12:56
result
Found 28 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 82: const NPM_REGISTRY_URL = "https://registry.npmjs.org/sentry";

  Line 375: export async function fetchLatestFromGitHub(

  Line 409: export async function fetchLatestFromNpm(): Promise<string> {

  Line 443: export async function fetchLatestNightlyVersion(

  Line 474: export function fetchLatestVersion(

  Line 498: async function nightlyVersionExists(version: string): Promise<boolean> {

  Line 527: export async function versionExists(

  Line 576: async function streamDecompressToFile(

  Line 683: async function downloadNightlyToPath(

  Line 716: async function downloadStableToPath(

  Line 762: const VERIFY_MAX_ATTEMPTS = 6;

  Line 765: const VERIFY_BASE_DELAY_MS = 100;

  Line 773: function probeBinaryFile(path: string): number | null {

  Line 805: async function waitForBinaryVisible(path: string): Promise<number> {

  ...
gateway · 2026-09-09 02:13:39
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
110:       stdio: ["ignore", "pipe", "pipe"],
111:     });
112:     const output =
113:       Buffer.from(result.stdout).toString() +
114:       Buffer.from(result.stderr).toString();
115:     cachedIsMusl = output.toLowerCase().includes("musl");
116:     return cachedIsMusl;
117:   } catch {
118:     // ldd not found or failed — assume glibc (the common case)
119:     cachedIsMusl = false;
120:     return false;
121:   }
122: }
123: 
124: /**
125:  * Build the platform-specific binary base name.
126:  *
127:  * Matches the naming convention used by GitHub Releases and GHCR:
128:  * `sentry-<os>-<arch>[-musl][.exe]` (e.g., `sentry-linux-x64`, `sentry-linux-arm64-musl`).
129:  */
130: export function getPlatformBinaryName(): string {
131:   let os: string;
132:   if (process.platform === "darwin") {
133:     os = ...
gateway · 2026-09-09 02:13:52
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
400:   return data.tag_name.replace(VERSION_PREFIX_REGEX, "");
401: }
402: 
403: /**
404:  * Fetch the latest version from npm registry.
405:  *
406:  * @returns Latest version string
407:  * @throws {UpgradeError} When fetch fails or response is invalid
408:  */
409: export async function fetchLatestFromNpm(): Promise<string> {
410:   const response = await fetchWithUpgradeError(
411:     `${NPM_REGISTRY_URL}/latest`,
412:     { headers: { Accept: "application/json" } },
413:     "npm registry"
414:   );
415: 
416:   if (!response.ok) {
417:     throw new UpgradeError(
418:       "network_error",
419:       `Failed to fetch from npm: ${response.status}`
420:     );
421:   }
422: 
423:   const data = (await response.json()) as { version?: string };
424: 
425:   if (!data.version) {
426:     throw new ...
gateway · 2026-09-09 02:14:00
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
350:   if (legacyMethod !== "unknown") {
351:     try {
352:       setInstallInfo({
353:         method: legacyMethod,
354:         path: process.execPath,
355:         version: CLI_VERSION,
356:       });
357:     } catch {
358:       log.debug("Failed to persist install info (DB may be read-only)");
359:     }
360:   }
361: 
362:   return legacyMethod;
363: }
364: 
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): ...
gateway · 2026-09-09 02:14:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
830: /**
831:  * Download the new binary to a temporary path and return its location.
832:  * Used by the upgrade command to download before spawning setup --install.
833:  *
834:  * For **nightly** versions (detected via {@link isNightlyVersion}), downloads
835:  * from GHCR using the OCI blob download protocol via {@link downloadNightlyToPath}.
836:  *
837:  * For **stable** versions, downloads from GitHub Releases via
838:  * {@link downloadStableToPath}.
839:  *
840:  * The lock is held on success so concurrent upgrades are blocked during the
841:  * download→spawn→install pipeline. The caller MUST release the lock after the
842:  * child process exits (the child may use a different install directory and
843:  * therefore a different lock file, so it cannot reliably release this one). ...
gateway · 2026-09-09 02:14:57
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382c...
gateway · 2026-09-09 02:15:06
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-09 02:15:47
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 02:16:49
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 19: } from "./db/version-check.js";

  Line 23: } from "./delta-upgrade.js";

  Line 27: import { cleanupPatchCache } from "./patch-cache.js";

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 36: } from "./binary.js";

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 50: } from "./ghcr.js";

  Line 52: import { clearPatchCache } from "./patch-cache.js";

  Line 60: export type { InstallationMethod } from "./binary.js";

  Line 62: export { parseInstallationMethod } from ...
gateway · 2026-09-09 02:17:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 02:18:57
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts:
  Line 37: export const BINARY_EXTENSIONS: ReadonlySet<string> = new Set([

  Line 134: export function isLikelyBinary(head: Uint8Array): boolean {

  Line 157: export function classifyByExtension(

  Line 185: export async function readHeadAndSniff(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 30: export const KNOWN_CURL_DIRS = [".local/bin", "bin", ".sentry/bin"];

  Line 40: export type InstallationMethod =

  Line 50: const VALID_METHODS: InstallationMethod[] = [

  Line 66: export function parseInstallationMethod(value: string): InstallationMethod {

  Line 92: export function isMusl(): boolean {

  Line 130: export function getPlatformBinaryName(): string {

  Line 151: export function getBinaryDownloadUrl(version: string): string {

  ...
gateway · 2026-09-09 02:19:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
500: 
501:   for (const { commit } of commits) {
502:     const message = commit.message;
503: 
504:     if (message.includes("#skip-changelog")) {
505:       continue;
506:     }
507: 
508:     const firstLine = message.split("\n")[0]?.trim();
509:     if (!firstLine) {
510:       continue;
511:     }
512: 
513:     const ccMatch = CONVENTIONAL_COMMIT_RE.exec(firstLine);
514:     if (!(ccMatch?.[1] && ccMatch[2])) {
515:       continue;
516:     }
517: 
518:     const category = COMMIT_PREFIX_TO_CATEGORY.get(ccMatch[1]);
519:     if (!category) {
520:       continue;
521:     }
522: 
523:     const description = ccMatch[2].trim();
524:     const existing = items.get(category) ?? [];
525:     existing.push(description);
526:     items.set(category, existing);
527:   }
528: 
529:   const sections: ChangeSection[] ...
gateway · 2026-09-09 02:19:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
1: /**
2:  * Release Notes Parser & Aggregation
3:  *
4:  * Extracts user-facing changelog entries from GitHub Release bodies (stable)
5:  * or conventional commit messages (nightly). Uses `marked.lexer()` for
6:  * AST-based section extraction and produces structured data that can be
7:  * re-serialized as filtered markdown for rendering via `renderMarkdown()`. ...
gateway · 2026-09-09 02:19:28
<!-- lore-recall:6169e1bc-5011-4ba7-b01c-c39662f1d9a6 --><!-- lore-recall:f46d6222-f5b8-4c3d-b95d-849c96af4fac -->
gpt-5.6-sol · 2026-09-09 02:19:28 · ~59 tokens
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts:
  Line 697: export type FetchChangelogOptions = {

  Line 720: export async function fetchChangelog(
gateway · 2026-09-09 02:19:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
680:   } catch (parseError) {
681:     log.debug("Non-JSON response from GitHub commits", parseError);
682:     return null;
683:   }
684:   if (!Array.isArray(commits) || commits.length === 0) {
685:     return null;
686:   }
687: 
688:   return buildNightlyChangelogSummary(
689:     commits as GitHubCommit[],
690:     fromVersion,
691:     toVersion,
692:     maxItems
693:   );
694: }
695: 
696: /** Options for {@link fetchChangelog} */
697: export type FetchChangelogOptions = {
698:   /** Release channel */
699:   channel: "stable" | "nightly";
700:   /** Current version */
701:   fromVersion: string;
702:   /** Target version */
703:   toVersion: string;
704:   /** Maximum list items to include */
705:   maxItems?: number;
706:   /** Pre-fetched releases to avoid redundant API call (stable channel only) ...
gateway · 2026-09-09 02:19:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * sentry cli upgrade
3:  *
4:  * Self-update the Sentry CLI to the latest or a specific version.
5:  * After upgrading, spawns the NEW binary with `cli setup` to update
6:  * completions, agent skills, and record installation metadata.
7:  *
8:  * Supports two release channels:
9:  * - stable (default): tracks the latest GitHub release
10:  * - nightly: tracks the rolling nightly prerelease built from main
11:  *
12:  * The channel can be set via --channel or by passing "nightly"/"stable"
13:  * as the version argument. The choice is persisted in the local database
14:  * so that subsequent bare `sentry cli upgrade` calls use the same channel. ...
gateway · 2026-09-09 02:20:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 02:21:21
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/patch-cache.test.ts
/home/b...
gateway · 2026-09-09 02:22:05
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 40: export type InstallationMethod =

  Line 130: export function getPlatformBinaryName(): string {

  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 156: export const GITHUB_RELEASES_URL =

  Line 168: export function isNightlyVersion(version: string): boolean {

  Line 181: export function compareVersions(a: string, b: string): -1 | 0 | 1 {

  Line 211: export function getBinaryPaths(installPath: string): {

  Line 283: export async function fetchWithUpgradeError(

  Line 321: export function replaceBinarySync(tempPath: string, installPath: string): void {
gateway · 2026-09-09 02:22:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
120:     return false;
121:   }
122: }
123: 
124: /**
125:  * Build the platform-specific binary base name.
126:  *
127:  * Matches the naming convention used by GitHub Releases and GHCR:
128:  * `sentry-<os>-<arch>[-musl][.exe]` (e.g., `sentry-linux-x64`, `sentry-linux-arm64-musl`).
129:  */
130: export function getPlatformBinaryName(): string {
131:   let os: string;
132:   if (process.platform === "darwin") {
133:     os = "darwin";
134:   } else if (process.platform === "win32") {
135:     os = "windows";
136:   } else {
137:     os = "linux";
138:   }
139:   const arch = process.arch === "arm64" ? "arm64" : "x64";
140:   const libcSuffix = isMusl() ? "-musl" : "";
141:   const suffix = process.platform === "win32" ? ".exe" : "";
142:   return `sentry-${os}-${arch}${libcSuffix}${suffix}`;
143: }
144: 
145: /**
146: ...
gateway · 2026-09-09 02:23:28
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json:
  Line 7:     "url": "git+https://github.com/getsentry/cli.git"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 979:       "https://github.com/getsentry/cli/releases/download/"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 40:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 82: const NPM_REGISTRY_URL = "https://registry.npmjs.org/sentry";

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 411:     `${NPM_REGISTRY_URL}/latest`,

  Line 501:     await ...
gateway · 2026-09-09 02:24:32
result
Found 44 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 156: export const GITHUB_RELEASES_URL =


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 35:   GITHUB_RELEASES_URL,

  Line 124:     releasesUrl: GITHUB_RELEASES_URL,

  Line 159:     const response = await customFetch(`${GITHUB_RELEASES_URL}?per_page=12`, ...
gateway · 2026-09-09 02:25:48
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts:
  Line 37: export const BINARY_EXTENSIONS: ReadonlySet<string> = new Set([

  Line 134: export function isLikelyBinary(head: Uint8Array): boolean {

  Line 157: export function classifyByExtension(

  Line 185: export async function readHeadAndSniff(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 30: export const KNOWN_CURL_DIRS = [".local/bin", "bin", ".sentry/bin"];

  Line 40: export type InstallationMethod =

  Line 50: const VALID_METHODS: InstallationMethod[] = [

  Line 66: export function parseInstallationMethod(value: string): InstallationMethod {

  Line 92: export function isMusl(): boolean {

  Line 130: export function getPlatformBinaryName(): string {

  Line 151: export function getBinaryDownloadUrl(version: string): string {

  ...
gateway · 2026-09-09 02:26:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Install Script Tests
3:  *
4:  * Exercises the shell installer with fake download tools so argument parsing and
5:  * setup delegation can be validated without network access.
6:  */
7: 
8: import { spawn } from "node:child_process";
9: import {
10:   chmodSync,
11:   mkdirSync,
12:   mkdtempSync,
13:   readFileSync,
14:   rmSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { tmpdir } from "node:os";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: 
21: function noop(): void {
22:   // Intentionally empty — absorbs async spawn errors
23: }
24: 
25: const repoRoot = join(import.meta.dirname, "..", "..");
26: const installScript = join(repoRoot, "install");
27: 
28: describe("install script", () => {
29:   let ...
gateway · 2026-09-09 02:26:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
1: #!/bin/bash
2: set -euo pipefail
3: 
4: RED='\033[0;31m'
5: MUTED='\033[0;2m'
6: NC='\033[0m'
7: 
8: # Sentry error telemetry — fire-and-forget error reporting via envelope API.
9: # Uses the CLI's public write-only DSN. No PII collected.
10: # Opt-out: SENTRY_CLI_NO_TELEMETRY=1
11: SENTRY_DSN_KEY="1188a86f3f8168f089450587b00bca66"
12: SENTRY_INGEST="https://o1.ingest.us.sentry.io"
13: SENTRY_PROJECT_ID="4510776311808000"
14: 
15: # Generate a UUID for the event. Tries /proc, uuidgen, then awk fallback. ...
gateway · 2026-09-09 02:28:02
result
Found 73 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 35:   GITHUB_RELEASES_URL,

  Line 44: import { GHCR_REPO } from "./ghcr.js";

  Line 72: // GHCR_REPO). Importing as a named import keeps a single source of truth and

  Line 124:     releasesUrl: GITHUB_RELEASES_URL,

  Line 135:     repo: GHCR_REPO,

  Line 159:     const response = await customFetch(`${GITHUB_RELEASES_URL}?per_page=12`, {

  Line 181: export async function downloadStablePatch(

  Line 288:     repo: GHCR_REPO,

  Line 426:   // Expose `current` so attemptDeltaUpgrade's catch path can stamp

  Line 511: export function attemptDeltaUpgrade(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 183:             ? ...
gateway · 2026-09-09 02:28:52
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 02:29:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 02:30:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/.cursor/rules/ultracite.mdc</path>
<type>file</type>
<content>
1: ---
2: description: Ultracite Rules - AI-Ready Formatter and Linter
3: globs: "**/*.{ts,tsx,js,jsx,json,jsonc,html,vue,svelte,astro,css,yaml,yml,graphql,gql,md,mdx,grit}"
4: alwaysApply: false
5: ---
6: 
7: # Ultracite Code Standards
8: 
9: This project uses **Ultracite**, a zero-config Biome preset that enforces strict code quality standards through automated formatting and linting.
10: 
11: ## Quick Reference
12: 
13: - **Format code**: `npx ultracite fix`
14: - **Check for issues**: `npx ultracite check`
15: - **Diagnose setup**: `npx ultracite doctor`
16: 
17: Biome (the underlying engine) provides extremely fast Rust-based linting and formatting. Most issues are automatically fixable. ...
gateway · 2026-09-09 02:31:38
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

  Line 134:   downloadBinaryToTemp,

  Line 136:   fetchLatestFromGitHub,

  Line 138:   fetchLatestNightlyVersion,

  Line 139:   fetchLatestVersion,

  Line 143:   versionExists,

  Line 189: describe("fetchLatestFromGitHub", () => {

  Line 204:     const version = await fetchLatestFromGitHub();

  Line 222:     const version = await fetchLatestFromGitHub();

  Line 240:     const version = await fetchLatestFromGitHub();

  Line 252:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 253:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 263:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 264:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 278:     await ...
gateway · 2026-09-09 02:32:30
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a51...
gateway · 2026-09-09 02:33:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 02:34:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 02:34:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-09 02:36:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 02:37:40
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/sentry.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/seer.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/replay.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/oauth.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/index.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/feedback.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/dashboard.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing...
gateway · 2026-09-09 02:38:15
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 44:   downloadNightlyBlob,

  Line 45:   fetchManifest,

  Line 46:   fetchNightlyManifest,

  Line 48:   getAnonymousToken,

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 452:   const token = await getAnonymousToken();

  Line 458:   const manifest = await fetchNightlyManifest(token);

  Line 499:   const token = await getAnonymousToken();

  Line 501:     await fetchManifest(token, `nightly-${version}`);

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 688:   const token = await getAnonymousToken();

  Line 690:     ? await fetchManifest(token, `nightly-${version}`)

  Line 691:     : await fetchNightlyManifest(token);

  Line 694:   const response = await downloadNightlyBlob(token, layer.digest);

  Line ...
gateway · 2026-09-09 02:39:03
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json:
  Line 7:     "url": "git+https://github.com/getsentry/cli.git"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 979:       "https://github.com/getsentry/cli/releases/download/"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/repo/list.test.ts:
  Line 63:     url: "https://github.com/getsentry/sentry",

  Line 74:     url: "https://github.com/getsentry/sentry-javascript",


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/project/view.func.test.ts:
  Line 290:     // explicitly (getsentry/cli#785 item #8). The actual API ...
gateway · 2026-09-09 02:40:00
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts:
  Line 37: export const BINARY_EXTENSIONS: ReadonlySet<string> = new Set([

  Line 134: export function isLikelyBinary(head: Uint8Array): boolean {

  Line 157: export function classifyByExtension(

  Line 185: export async function readHeadAndSniff(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 30: export const KNOWN_CURL_DIRS = [".local/bin", "bin", ".sentry/bin"];

  Line 40: export type InstallationMethod =

  Line 50: const VALID_METHODS: InstallationMethod[] = [

  Line 66: export function parseInstallationMethod(value: string): InstallationMethod {

  Line 92: export function isMusl(): boolean {

  Line 130: export function getPlatformBinaryName(): string {

  Line 151: export function getBinaryDownloadUrl(version: string): string {

  ...
gateway · 2026-09-09 02:40:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 02:41:23
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a51...
gateway · 2026-09-09 02:41:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-09 02:42:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 02:43:45
result
Found 36 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 25:   fetchWithUpgradeError,

  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 31:   getPlatformBinaryName,

  Line 33:   isNightlyVersion,

  Line 378:   const response = await fetchWithUpgradeError(

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 410:   const response = await fetchWithUpgradeError(

  Line 532:   if (isNightlyVersion(version)) {

  Line 537:     const response = await fetchWithUpgradeError(

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 545:   const response = await fetchWithUpgradeError(

  Line 666:   return `${getPlatformBinaryName()}.gz`;

  Line 721:   const url = getBinaryDownloadUrl(version);

  Line 726:     const gzResponse = await fetchWithUpgradeError(

  Line 740:   const response = await fetchWithUpgradeError(url, { headers }, "GitHub");

  ...
gateway · 2026-09-09 02:44:31
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/patch-cache.test.ts
/home/b...
gateway · 2026-09-09 02:44:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
1: #!/bin/bash
2: set -euo pipefail
3: 
4: RED='\033[0;31m'
5: MUTED='\033[0;2m'
6: NC='\033[0m'
7: 
8: # Sentry error telemetry — fire-and-forget error reporting via envelope API.
9: # Uses the CLI's public write-only DSN. No PII collected.
10: # Opt-out: SENTRY_CLI_NO_TELEMETRY=1
11: SENTRY_DSN_KEY="1188a86f3f8168f089450587b00bca66"
12: SENTRY_INGEST="https://o1.ingest.us.sentry.io"
13: SENTRY_PROJECT_ID="4510776311808000"
14: 
15: # Generate a UUID for the event. Tries /proc, uuidgen, then awk fallback. ...
gateway · 2026-09-09 02:45:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 02:45:37
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/.cursor/rules/ultracite.mdc</path>
<type>file</type>
<content>
1: ---
2: description: Ultracite Rules - AI-Ready Formatter and Linter
3: globs: "**/*.{ts,tsx,js,jsx,json,jsonc,html,vue,svelte,astro,css,yaml,yml,graphql,gql,md,mdx,grit}"
4: alwaysApply: false
5: ---
6: 
7: # Ultracite Code Standards
8: 
9: This project uses **Ultracite**, a zero-config Biome preset that enforces strict code quality standards through automated formatting and linting.
10: 
11: ## Quick Reference
12: 
13: - **Format code**: `npx ultracite fix`
14: - **Check for issues**: `npx ultracite check`
15: - **Diagnose setup**: `npx ultracite doctor`
16: 
17: Biome (the underlying engine) provides extremely fast Rust-based linting and formatting. Most issues are automatically fixable. ...
gateway · 2026-09-09 02:46:10
result
No files found
gateway · 2026-09-09 02:47:12
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 31: const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;

  Line 42: const NOTIFICATION_INTERVAL_MS = 24 * 60 * 60 * 1000;

  Line 45: const JITTER_FACTOR = 0.2;

  Line 48: const SUPPRESSED_ARGS = new Set([

  Line 64: const SUPPRESSED_CLI_SUBCOMMANDS = new Set(["setup", "fix"]);

  Line 73: function shouldCheckForUpdate(): boolean {

  Line 98: export function shouldSuppressNotification(args: string[]): boolean {

  Line 113: export function abortPendingVersionCheck(): void {

  Line 124: async function maybePrefetchPatches(

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await ...
gateway · 2026-09-09 02:48:13
result
Found 99 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 40:  * getsentry/cli#785 item #10).

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts:
  Line 51:   NIGHTLY_TAG,

  Line 55:   versionExists,

  Line 320:     const exists = await versionExists(lookupMethod, target);

  Line 558:     channel === "nightly" && !versionArg ? ...
gateway · 2026-09-09 02:48:49
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5...
gateway · 2026-09-09 02:48:58
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/....
gateway · 2026-09-09 02:49:10
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/skill-eval/helpers/planner.ts:
  Line 19: The developer is working in a project that uses Sentry for error tracking and monitoring. The Sentry CLI is installed. Here is your guide for using it:


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/wizard-runner-handle-final-result.mocked.test.ts:
  Line 87:           "Dependency installation failed after 5 attempts: pnpm exited with code 1",

  Line 98:         "Dependency installation failed after 5 attempts: pnpm exited with code 1"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts:
  Line 59:         ...
gateway · 2026-09-09 02:49:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 02:49:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 02:49:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-09 02:50:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
431: 
432: /**
433:  * Fetch the latest nightly version from GHCR.
434:  *
435:  * Performs an anonymous token exchange then fetches the OCI manifest for the
436:  * `:nightly` tag. The version is extracted from the manifest annotation —
437:  * only 2 HTTP requests total (token + manifest), no blob download needed.
438:  *
439:  * @param signal - Optional AbortSignal to cancel the requests
440:  * @returns Latest nightly version string (e.g., "0.13.0-dev.1740000000")
441:  * @throws {UpgradeError} When fetch fails or the version annotation is missing
442:  */
443: export async function fetchLatestNightlyVersion(
444:   signal?: AbortSignal
445: ): Promise<string> {
446:   // AbortSignal is not threaded through ghcr helpers, but checking it before
447:   // each network call ensures we bail out promptly when the ...
gateway · 2026-09-09 02:50:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-09 02:50:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
421:     }
422:   };
423: }
424: 
425: function telemetry(): DeltaTelemetry & { _source: { current?: string } } {
426:   // Expose `current` so attemptDeltaUpgrade's catch path can stamp
427:   // `delta.source` on the active span even when apply fails AFTER a chain
428:   // was successfully resolved (the catch previously left the span without
429:   // this attribute, silently downgrading telemetry fidelity).
430:   const captured: { current?: string } = {};
431:   return {
432:     _source: captured,
433:     onResolved: ({ source, chain }) => {
434:       captured.current = source;
435:       const span = Sentry.getActiveSpan();
436:       span?.setAttribute("delta.source", source);
437:       log.debug(
438:         `Resolved patch chain from ${source}: ${chain.patches.length} patch(es), ...
gateway · 2026-09-09 02:50:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
1: /**
2:  * Release Notes Parser & Aggregation
3:  *
4:  * Extracts user-facing changelog entries from GitHub Release bodies (stable)
5:  * or conventional commit messages (nightly). Uses `marked.lexer()` for
6:  * AST-based section extraction and produces structured data that can be
7:  * re-serialized as filtered markdown for rendering via `renderMarkdown()`. ...
gateway · 2026-09-09 02:51:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
501:   for (const { commit } of commits) {
502:     const message = commit.message;
503: 
504:     if (message.includes("#skip-changelog")) {
505:       continue;
506:     }
507: 
508:     const firstLine = message.split("\n")[0]?.trim();
509:     if (!firstLine) {
510:       continue;
511:     }
512: 
513:     const ccMatch = CONVENTIONAL_COMMIT_RE.exec(firstLine);
514:     if (!(ccMatch?.[1] && ccMatch[2])) {
515:       continue;
516:     }
517: 
518:     const category = COMMIT_PREFIX_TO_CATEGORY.get(ccMatch[1]);
519:     if (!category) {
520:       continue;
521:     }
522: 
523:     const description = ccMatch[2].trim();
524:     const existing = items.get(category) ?? [];
525:     existing.push(description);
526:     items.set(category, existing);
527:   }
528: 
529:   const sections: ChangeSection[] = ...
gateway · 2026-09-09 02:51:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
1: /**
2:  * Background version check for "new version available" notifications.
3:  *
4:  * For nightly builds (CLI_VERSION contains "-dev.<timestamp>"), checks GHCR for the
5:  * latest nightly version via the OCI manifest annotation. For stable builds,
6:  * checks GitHub Releases. Results are cached in the database and shown on
7:  * subsequent runs.
8:  */
9: 
10: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
11: import * as Sentry from "@sentry/node-core/light";
12: import { compare as semverCompare } from "semver";
13: import { CLI_VERSION } from "./constants.js";
14: import { getReleaseChannel } from "./db/release-channel.js";
15: import {
16:   getVersionCheckInfo,
17:   markUpdateNotified,
18:   setVersionCheckInfo,
19: } from "./db/version-check.js";
20: ...
gateway · 2026-09-09 02:51:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
1: #!/bin/bash
2: set -euo pipefail
3: 
4: RED='\033[0;31m'
5: MUTED='\033[0;2m'
6: NC='\033[0m'
7: 
8: # Sentry error telemetry — fire-and-forget error reporting via envelope API.
9: # Uses the CLI's public write-only DSN. No PII collected.
10: # Opt-out: SENTRY_CLI_NO_TELEMETRY=1
11: SENTRY_DSN_KEY="1188a86f3f8168f089450587b00bca66"
12: SENTRY_INGEST="https://o1.ingest.us.sentry.io"
13: SENTRY_PROJECT_ID="4510776311808000"
14: 
15: # Generate a UUID for the event. Tries /proc, uuidgen, then awk fallback. ...
gateway · 2026-09-09 02:51:45
result
Found 22 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/cleanup-doc-previews.yml:
  Line 33:           REPO: ${{ github.repository }}


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/pr-risk.yml:
  Line 26:           repo: ${{ github.repository }}


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/cleanup-nightlies.yml:
  Line 28:         run: echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u ${{ github.actor }} --password-stdin

  Line 34:           REPO="ghcr.io/getsentry/cli"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/sentry-release.yml:
  Line 74:           --url "https://github.com/${{ github.repository }}/releases/tag/${VERSION}"

  Line 82:             --repo "${{ github.repository }}" \

  ...
gateway · 2026-09-09 02:51:59
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml:
  Line 26:         urlTemplate: 'https://github.com/getsentry/cli/releases/download/{{version}}/{{file}}'

  Line 45:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-arm64.gz"

  Line 48:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-x64.gz"

  Line 55:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-arm64.gz"

  Line 58:             url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-x64.gz"
gateway · 2026-09-09 02:52:09
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.lore.md:
  Line 32: * **getsentry/cli two dependabot endpoints: advisories empty, alerts source of truth**: GitHub Dependabot data sources for getsentry/cli: - \`/repos/getsentry/cli/security-advisories\` → empty array (no published advisories for this repo). - \`/repos/getsentry/cli/dependabot/alerts\` → source of truth: 13 open, 15 fixed as of 2026-08-01. Alert taxonomy in this repo: alerts reference lockfiles (stale entries with no source manifest) OR transitive deps (no direct upgrade path). pnpm.overrides (\`package.json\`) is the canonical fix mechanism for transitive vulns — direct dep upgrades cascade via lockfile only. Sibling surfaces: \`pnpm audit\` reports additional CVEs not surfaced by Dependabot (e.g. @ai-sdk/provider-utils@<=3.0.97 LOW CVE-2026-8769) — separate scope, requires package upgrade not override. ...
gateway · 2026-09-09 02:52:54
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 02:53:02
result
File not found: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.cursor/rules/ultracite.mdc
gateway · 2026-09-09 02:53:08
result
No files found
gateway · 2026-09-09 02:53:49
result
Found 70 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 156: export const GITHUB_RELEASES_URL =


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 44:   ...
gateway · 2026-09-09 02:54:00
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 122: function stableSource(): SourceStrategy {

  Line 132: function nightlySource(): SourceStrategy {

  Line 155: export async function fetchRecentReleases(

  Line 181: export async function downloadStablePatch(

  Line 270: export function resolveStableChain(

  Line 275:   return stableSource().resolveChain(currentVersion, targetVersion, signal);

  Line 278: export async function resolveNightlyChain(opts: {

  Line 483:     stableSource(),

  Line 501:     nightlySource(),

  Line 531:           channel === "nightly" ? nightlySource() : stableSource(),

  Line 607:   return prefetch(nightlySource(), targetVersion, signal);

  Line 614:   return prefetch(stableSource(), targetVersion, ...
gateway · 2026-09-09 02:54:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
100:       if (!(first && last)) {
101:         return base.save(chain, steps);
102:       }
103:       const key = patchCacheKey(first.fromVersion, last.toVersion);
104:       return withTracingSpan(key, "cache.put", async (span) => {
105:         span.setAttribute("cache.key", [key]);
106:         span.setAttribute(
107:           "cache.item_size",
108:           chain.patches.reduce((sum, patch) => sum + patch.size, 0)
109:         );
110:         await base.save(chain, steps);
111:       });
112:     },
113:     cleanup: () => base.cleanup(),
114:     clear: () => base.clear(),
115:   };
116: }
117: 
118: function getPatchCache(): PatchCache {
119:   return instrumentCache(makeCache(join(getConfigDir(), "patch-cache")));
120: }
121: 
122: function stableSource(): SourceStrategy {
123:   return ...
gateway · 2026-09-09 02:54:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
330:       expectedFrom: previousVersion,
331:       patchLayerName,
332:       sizeLimit: opts.fullGzSize * SIZE_THRESHOLD_RATIO - totalSize,
333:     });
334:     if (!result.ok) {
335:       Sentry.getActiveSpan()?.setAttribute(
336:         "telemetry_reason",
337:         result.failure.reason
338:       );
339:       return null;
340:     }
341:     const toVersion = tag.slice(PATCH_TAG_PREFIX.length);
342:     digests.push(result.digest);
343:     totalSize += result.size;
344:     steps.push({ fromVersion: previousVersion, toVersion });
345:     previousVersion = toVersion;
346:     if (index === manifests.length - 1) {
347:       expectedSha256 = getPatchTargetSha256(manifest, binaryName) ?? "";
348:     }
349:   }
350:   if (previousVersion !== opts.targetVersion || !expectedSha256) {
351:     ...
gateway · 2026-09-09 02:55:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 02:55:57
result
Found 34 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 60: export type { InstallationMethod } from "./binary.js";

  Line 62: export { parseInstallationMethod } from "./binary.js";

  Line 74: export type OfflineMode = false | "explicit" | "network-fallback";

  Line 82: const NPM_REGISTRY_URL = "https://registry.npmjs.org/sentry";

  Line 100: function getKnownCurlPaths(): string[] {

  Line 116: export function getCurlInstallPaths(): {

  Line 158: export function startCleanupOldBinary(): void {

  Line 176: function runCommand(

  Line 209: async function isInstalledWith(pm: PackageManager): Promise<boolean> {

  Line 234: function isHomebrewInstall(): boolean {

  Line 260: export function detectPackageManagerFromPath(): PackageManager | null {

  Line 291: async function detectLegacyInstallationMethod(): Promise<InstallationMethod> {

  Line 331: export async function ...
gateway · 2026-09-09 02:56:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-09 02:56:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 02:57:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
1: /**
2:  * Release Notes Parser & Aggregation
3:  *
4:  * Extracts user-facing changelog entries from GitHub Release bodies (stable)
5:  * or conventional commit messages (nightly). Uses `marked.lexer()` for
6:  * AST-based section extraction and produces structured data that can be
7:  * re-serialized as filtered markdown for rendering via `renderMarkdown()`. ...
gateway · 2026-09-09 02:58:15
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts:
  Line 64:         const baseUrl = "https://github.com/getsentry/cli/releases/download";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 979:       "https://github.com/getsentry/cli/releases/download/"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/project/view.func.test.ts:
  Line 290:     // explicitly (getsentry/cli#785 item #8). The actual API error


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/security/auto-login-host-guard.test.ts:
  Line 6:  * Bug (getsentry/cli#1121): `sentry auth login` refuses a self-hosted ...
gateway · 2026-09-09 02:59:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 03:00:15
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 49: export type {

  Line 65: export type DeltaResult = {

  Line 79: function patchCacheKey(fromVersion: string, toVersion: string): string {

  Line 83: function instrumentCache(base: PatchCache): PatchCache {

  Line 118: function getPatchCache(): PatchCache {

  Line 122: function stableSource(): SourceStrategy {

  Line 132: function nightlySource(): SourceStrategy {

  Line 145: export function canAttemptDelta(targetVersion: string): boolean {

  Line 155: export async function fetchRecentReleases(

  Line 181: export async function downloadStablePatch(

  Line 197: export function extractStableChain(

  Line 204: export function filterAndSortChainTags(

  Line 217: type ChainStepResult =

  Line 231: export function validateChainStep(

  Line 270: export function resolveStableChain(

  Line 278: export async function ...
gateway · 2026-09-09 03:00:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-09 03:01:07
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts
/home/byk/.l...
gateway · 2026-09-09 03:02:30
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 40: export type InstallationMethod =

  Line 50: const VALID_METHODS: InstallationMethod[] = [

  Line 66: export function parseInstallationMethod(value: string): InstallationMethod {

  Line 67:   const normalized = value.toLowerCase() as InstallationMethod;

  Line 130: export function getPlatformBinaryName(): string {

  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 152:   return `https://github.com/getsentry/cli/releases/download/${version}/${getPlatformBinaryName()}`;

  Line 156: export const GITHUB_RELEASES_URL =

  Line 168: export function isNightlyVersion(version: string): boolean {

  Line 265: export function getGitHubHeaders(): Record<string, string> {

  Line 283: export async function fetchWithUpgradeError(

  Line 371: export function acquireLock(lockPath: string): void {

  Line ...
gateway · 2026-09-09 03:02:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
35:  * Defined here (alongside other installation constants like
36:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
37:  * `db/install-info.ts` can import it without creating a circular
38:  * dependency.
39:  */
40: export type InstallationMethod =
41:   | "curl"
42:   | "brew"
43:   | "npm"
44:   | "pnpm"
45:   | "bun"
46:   | "yarn"
47:   | "unknown";
48: 
49: /** Valid methods that can be specified via --method flag */
50: const VALID_METHODS: InstallationMethod[] = [
51:   "curl",
52:   "brew",
53:   "npm",
54:   "pnpm",
55:   "bun",
56:   "yarn",
57: ];
58: 
59: /**
60:  * Parse and validate an installation method from user input. ...
gateway · 2026-09-09 03:04:06
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts
/home/byk/.l...
gateway · 2026-09-09 03:04:20
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 25:   getBinaryDownloadUrl,

  Line 37: describe("getBinaryDownloadUrl", () => {

  Line 39:     const url = getBinaryDownloadUrl("1.0.0");

  Line 53:     const url = getBinaryDownloadUrl("2.0.0");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

  Line 136:   fetchLatestFromGitHub,

  Line 137:   fetchLatestFromNpm,

  Line 138:   fetchLatestNightlyVersion,

  Line 139:   fetchLatestVersion,

  Line 143:   versionExists,

  Line 189: describe("fetchLatestFromGitHub", () => {

  Line 204:     const version = await fetchLatestFromGitHub();

  Line 222:     const version = await fetchLatestFromGitHub();

  Line 240:     const version = await fetchLatestFromGitHub();

  Line 252:   ...
gateway · 2026-09-09 03:05:10
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts:
  Line 64:         const baseUrl = "https://github.com/getsentry/cli/releases/download";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 492:       if (urlStr.includes("ghcr.io/token")) {

  Line 514:       if (urlStr.includes("ghcr.io/token")) {

  Line 636:       if (u.includes("ghcr.io/token")) {

  Line 652:       if (u.includes("ghcr.io/token")) {

  Line 669:       if (u.includes("ghcr.io/token")) {

  Line 694:       if (u.includes("ghcr.io/token")) {

  Line 979:       "https://github.com/getsentry/cli/releases/download/"

  Line 1487:       if (urlStr.includes("ghcr.io/token")) {

  Line 1528:       if (urlStr.includes("ghcr.io/token")) {

  Line 1596:       if (urlStr.includes("ghcr.io/token")) ...
gateway · 2026-09-09 03:06:12
result
Found 27 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 23: } from "./delta-upgrade.js";

  Line 27: import { cleanupPatchCache } from "./patch-cache.js";

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 36: } from "./binary.js";

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 50: } from "./ghcr.js";

  Line 52: import { clearPatchCache } from "./patch-cache.js";

  Line 60: export type { InstallationMethod } from "./binary.js";

  Line 62: export { parseInstallationMethod } from "./binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/telemetry.ts:
  Line 19: import { isMusl } ...
gateway · 2026-09-09 03:07:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 03:08:09
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts
gateway · 2026-09-09 03:08:22
result
Ripgrep JSON record exceeded 65536 bytes
gateway · 2026-09-09 03:08:31
result
No files found
gateway · 2026-09-09 03:09:05
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/db/install-info.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/uninstall.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/db/install-info.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/uninstall.ts
gateway · 2026-09-09 03:09:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
1: #!/bin/bash
2: set -euo pipefail
3: 
4: RED='\033[0;31m'
5: MUTED='\033[0;2m'
6: NC='\033[0m'
7: 
8: # Sentry error telemetry — fire-and-forget error reporting via envelope API.
9: # Uses the CLI's public write-only DSN. No PII collected.
10: # Opt-out: SENTRY_CLI_NO_TELEMETRY=1
11: SENTRY_DSN_KEY="1188a86f3f8168f089450587b00bca66"
12: SENTRY_INGEST="https://o1.ingest.us.sentry.io"
13: SENTRY_PROJECT_ID="4510776311808000"
14: 
15: # Generate a UUID for the event. Tries /proc, uuidgen, then awk fallback. ...
gateway · 2026-09-09 03:09:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Install Script Tests
3:  *
4:  * Exercises the shell installer with fake download tools so argument parsing and
5:  * setup delegation can be validated without network access.
6:  */
7: 
8: import { spawn } from "node:child_process";
9: import {
10:   chmodSync,
11:   mkdirSync,
12:   mkdtempSync,
13:   readFileSync,
14:   rmSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { tmpdir } from "node:os";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: 
21: function noop(): void {
22:   // Intentionally empty — absorbs async spawn errors
23: }
24: 
25: const repoRoot = join(import.meta.dirname, "..", "..");
26: const installScript = join(repoRoot, "install");
27: 
28: describe("install script", () => {
29:   let ...
gateway · 2026-09-09 03:10:03
result
Found 48 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 40:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/cache-hint.ts:
  Line 9:  * getsentry/cli#785 item #1 — `-f/--fresh` flag discoverability.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 82: const NPM_REGISTRY_URL = "https://registry.npmjs.org/sentry";

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 411:     `${NPM_REGISTRY_URL}/latest`,

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 546:     `${NPM_REGISTRY_URL}/${version}`,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 152:  ...
gateway · 2026-09-09 03:10:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 03:12:04
result
Found 52 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 44:   downloadNightlyBlob,

  Line 45:   fetchManifest,

  Line 46:   fetchNightlyManifest,

  Line 48:   getAnonymousToken,

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 452:   const token = await getAnonymousToken();

  Line 458:   const manifest = await fetchNightlyManifest(token);

  Line 499:   const token = await getAnonymousToken();

  Line 501:     await fetchManifest(token, `nightly-${version}`);

  Line 538:       `${GITHUB_RELEASES_URL}/tags/${version}`,

  Line 688:   const token = await getAnonymousToken();

  Line 690:     ? await fetchManifest(token, `nightly-${version}`)

  Line 691:     : await fetchNightlyManifest(token);

  Line 694:   const response = await downloadNightlyBlob(token, layer.digest);

  Line 721:   const url = ...
gateway · 2026-09-09 03:13:08
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/patch-cache.test.ts
/home/b...
gateway · 2026-09-09 03:13:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management Tests
3:  *
4:  * Tests for shared binary helpers: install directory selection, paths,
5:  * download URLs, locking, and binary installation.
6:  */
7: 
8: import {
9:   chmodSync,
10:   mkdirSync,
11:   readFileSync,
12:   realpathSync,
13:   rmSync,
14:   symlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { access, readFile, writeFile } from "node:fs/promises";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: import {
21:   acquireLock,
22:   compareVersions,
23:   determineInstallDir,
24:   fetchWithUpgradeError,
25:   getBinaryDownloadUrl,
26:   getBinaryFilename,
27:   getBinaryPaths,
28:   getPlatformBinaryName,
29:   installBinary,
30:   isDowngrade,
31:   isMusl,
32:   releaseLock,
33:   ...
gateway · 2026-09-09 03:14:12
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/sentry.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/seer.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/replay.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/oauth.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/index.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/feedback.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/dashboard.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing...
gateway · 2026-09-09 03:15:02
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 03:15:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 03:17:14
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts
gateway · 2026-09-09 03:17:38
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 03:18:32
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts
gateway · 2026-09-09 03:18:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR Client Tests
3:  *
4:  * Unit tests for the GHCR/OCI download protocol helpers.
5:  * All HTTP calls are mocked via globalThis.fetch to avoid network access.
6:  */
7: 
8: import { afterEach, beforeEach, describe, expect, test } from "vitest";
9: import { UpgradeError } from "../../src/lib/errors.js";
10: import {
11:   downloadLayerBlob,
12:   downloadNightlyBlob,
13:   fetchManifest,
14:   fetchNightlyManifest,
15:   findLayerByFilename,
16:   GHCR_REPO,
17:   GHCR_TAG,
18:   getAnonymousToken,
19:   getNightlyVersion,
20:   listTags,
21:   type OciManifest,
22: } from "../../src/lib/ghcr.js";
23: 
24: /** Store original fetch for restoration */
25: let originalFetch: typeof globalThis.fetch;
26: 
27: /** Helper to mock fetch without TypeScript errors about missing Bun-specific properties */
28: ...
gateway · 2026-09-09 03:19:28
result
Found 66 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts:
  Line 55:   versionExists,

  Line 320:     const exists = await versionExists(lookupMethod, target);

  Line 458:       // CLI-1D3). `downloadBinaryToTemp`'s visibility-race retry loop


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 25:   fetchWithUpgradeError,

  Line 26:   GITHUB_RELEASES_URL,

  Line 27:   getBinaryDownloadUrl,

  Line 31:   getPlatformBinaryName,

  Line 33:   ...
gateway · 2026-09-09 03:20:33
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/sentry.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/seer.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/replay.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/oauth.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/index.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/feedback.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/dashboard.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing...
gateway · 2026-09-09 03:21:34
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts
/hom...
gateway · 2026-09-09 03:21:47
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Install Script Tests
3:  *
4:  * Exercises the shell installer with fake download tools so argument parsing and
5:  * setup delegation can be validated without network access.
6:  */
7: 
8: import { spawn } from "node:child_process";
9: import {
10:   chmodSync,
11:   mkdirSync,
12:   mkdtempSync,
13:   readFileSync,
14:   rmSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { tmpdir } from "node:os";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: 
21: function noop(): void {
22:   // Intentionally empty — absorbs async spawn errors
23: }
24: 
25: const repoRoot = join(import.meta.dirname, "..", "..");
26: const installScript = join(repoRoot, "install");
27: 
28: describe("install script", () => {
29:   let ...
gateway · 2026-09-09 03:21:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
1: #!/bin/bash
2: set -euo pipefail
3: 
4: RED='\033[0;31m'
5: MUTED='\033[0;2m'
6: NC='\033[0m'
7: 
8: # Sentry error telemetry — fire-and-forget error reporting via envelope API.
9: # Uses the CLI's public write-only DSN. No PII collected.
10: # Opt-out: SENTRY_CLI_NO_TELEMETRY=1
11: SENTRY_DSN_KEY="1188a86f3f8168f089450587b00bca66"
12: SENTRY_INGEST="https://o1.ingest.us.sentry.io"
13: SENTRY_PROJECT_ID="4510776311808000"
14: 
15: # Generate a UUID for the event. Tries /proc, uuidgen, then awk fallback. ...
gateway · 2026-09-09 03:22:46
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 03:23:34
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 130: export function getPlatformBinaryName(): string {

  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 156: export const GITHUB_RELEASES_URL =

  Line 168: export function isNightlyVersion(version: string): boolean {

  Line 265: export function getGitHubHeaders(): Record<string, string> {

  Line 283: export async function fetchWithUpgradeError(
gateway · 2026-09-09 03:23:46
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 03:24:33
result
No files found
gateway · 2026-09-09 03:24:45
result
No files found
gateway · 2026-09-09 03:24:56
result
Found 41 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/formatters/semantic-display.test.ts:
  Line 10:   type AttributeSource,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/react-native/wrap-call.test.ts:
  Line 13: import type { SourceMapReport } from "../../../src/lib/react-native/wrap-call.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/db/auth.property.test.ts:
  Line 20:   type AuthSource,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/types/index.ts:
  Line 9: export type { DetectedDsn, DsnSource, ParsedDsn } from "../lib/dsn/types.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/sourcemap/inject.ts:
  Line ...
gateway · 2026-09-09 03:25:57
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/uninstall.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/...
gateway · 2026-09-09 03:26:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management Tests
3:  *
4:  * Tests for shared binary helpers: install directory selection, paths,
5:  * download URLs, locking, and binary installation.
6:  */
7: 
8: import {
9:   chmodSync,
10:   mkdirSync,
11:   readFileSync,
12:   realpathSync,
13:   rmSync,
14:   symlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { access, readFile, writeFile } from "node:fs/promises";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: import {
21:   acquireLock,
22:   compareVersions,
23:   determineInstallDir,
24:   fetchWithUpgradeError,
25:   getBinaryDownloadUrl,
26:   getBinaryFilename,
27:   getBinaryPaths,
28:   getPlatformBinaryName,
29:   installBinary,
30:   isDowngrade,
31:   isMusl,
32:   releaseLock,
33:   ...
gateway · 2026-09-09 03:26:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR Client Tests
3:  *
4:  * Unit tests for the GHCR/OCI download protocol helpers.
5:  * All HTTP calls are mocked via globalThis.fetch to avoid network access.
6:  */
7: 
8: import { afterEach, beforeEach, describe, expect, test } from "vitest";
9: import { UpgradeError } from "../../src/lib/errors.js";
10: import {
11:   downloadLayerBlob,
12:   downloadNightlyBlob,
13:   fetchManifest,
14:   fetchNightlyManifest,
15:   findLayerByFilename,
16:   GHCR_REPO,
17:   GHCR_TAG,
18:   getAnonymousToken,
19:   getNightlyVersion,
20:   listTags,
21:   type OciManifest,
22: } from "../../src/lib/ghcr.js";
23: 
24: /** Store original fetch for restoration */
25: let originalFetch: typeof globalThis.fetch;
26: 
27: /** Helper to mock fetch without TypeScript errors about missing Bun-specific properties */
28: ...
gateway · 2026-09-09 03:27:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
90: let cachedIsMusl: boolean | undefined;
91: 
92: export function isMusl(): boolean {
93:   if (process.platform !== "linux") {
94:     return false;
95:   }
96:   if (cachedIsMusl !== undefined) {
97:     return cachedIsMusl;
98:   }
99: 
100:   // Heuristic 1: Check for musl dynamic linker
101:   const muslArch = process.arch === "x64" ? "x86_64" : "aarch64";
102:   if (existsSync(`/lib/ld-musl-${muslArch}.so.1`)) {
103:     cachedIsMusl = true;
104:     return true;
105:   }
106: 
107:   // Heuristic 2: ldd --version output (musl ldd writes "musl libc" to stderr)
108:   try {
109:     const result = spawnSync("ldd", ["--version"], {
110:       stdio: ["ignore", "pipe", "pipe"],
111:     });
112:     const output =
113:       Buffer.from(result.stdout).toString() +
114:       ...
gateway · 2026-09-09 03:27:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 03:27:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
256: /**
257:  * Fetch the OCI manifest for the `:nightly` tag.
258:  *
259:  * Convenience wrapper around {@link fetchManifest} for the rolling nightly tag.
260:  *
261:  * @param token - Anonymous bearer token from {@link getAnonymousToken}
262:  * @returns Parsed OCI manifest
263:  * @throws {UpgradeError} On network failure or non-200 response
264:  */
265: export async function fetchNightlyManifest(
266:   token: string
267: ): Promise<OciManifest> {
268:   return await fetchManifest(token, GHCR_TAG);
269: }
270: 
271: /**
272:  * Extract the nightly version string from a manifest's annotations.
273:  *
274:  * The version is set via `--annotation "version=<ver>"` during `oras push`.
275:  *
276:  * @param manifest - OCI manifest from {@link fetchNightlyManifest}
277:  * @returns Version string (e.g., ...
gateway · 2026-09-09 03:28:28
result
Found 72 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 35:   GITHUB_RELEASES_URL,

  Line 44: import { GHCR_REPO } from "./ghcr.js";

  Line 71: // GHCR publishes nightlies to ghcr.io/getsentry/cli (see src/lib/ghcr.ts

  Line 72: // GHCR_REPO). Importing as a named import keeps a single source of truth and

  Line 124:     releasesUrl: GITHUB_RELEASES_URL,

  Line 135:     repo: GHCR_REPO,

  Line 159:     const response = await customFetch(`${GITHUB_RELEASES_URL}?per_page=12`, {

  Line 288:     repo: GHCR_REPO,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/auth-hint.ts:
  Line 8:  * UX feedback issue (getsentry/cli#785 #4). The hint surfaces the


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 28: import { ...
gateway · 2026-09-09 03:29:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages</path>
<type>directory</type>
<entries>
cli/

(1 entries)
</entries>
gateway · 2026-09-09 03:29:47
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json:
  Line 7:     "url": "git+https://github.com/getsentry/cli.git"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/warden.toml:
  Line 2: # https://github.com/getsentry/warden


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/README.md:
  Line 133: git clone https://github.com/getsentry/cli.git


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 979:       "https://github.com/getsentry/cli/releases/download/"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/api/releases.test.ts:
  Line 20:   mockGetRepositoryName: vi.fn((): string | null ...
gateway · 2026-09-09 03:29:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/install</path>
<type>file</type>
<content>
1: #!/bin/bash
2: set -euo pipefail
3: 
4: RED='\033[0;31m'
5: MUTED='\033[0;2m'
6: NC='\033[0m'
7: 
8: # Sentry error telemetry — fire-and-forget error reporting via envelope API.
9: # Uses the CLI's public write-only DSN. No PII collected.
10: # Opt-out: SENTRY_CLI_NO_TELEMETRY=1
11: SENTRY_DSN_KEY="1188a86f3f8168f089450587b00bca66"
12: SENTRY_INGEST="https://o1.ingest.us.sentry.io"
13: SENTRY_PROJECT_ID="4510776311808000"
14: 
15: # Generate a UUID for the event. Tries /proc, uuidgen, then awk fallback. ...
gateway · 2026-09-09 03:30:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 03:31:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 03:32:24
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed...
gateway · 2026-09-09 03:32:39
result
Found 19 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts:
  Line 64:         const baseUrl = "https://github.com/getsentry/cli/releases/download";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

  Line 972: describe("getBinaryDownloadUrl", () => {

  Line 974:     const url = getBinaryDownloadUrl("1.0.0");

  Line 979:       "https://github.com/getsentry/cli/releases/download/"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/binary.test.ts:
  Line 25:   getBinaryDownloadUrl,

  Line 37: describe("getBinaryDownloadUrl", () => {

  Line 39:     const url = getBinaryDownloadUrl("1.0.0");

  Line 43:       "https://github.com/getsentry/cli/releases/download/"

  Line 53:     const url = ...
gateway · 2026-09-09 03:32:51
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/package.json:
  Line 2:   "name": "toolkit-cli-workspace",


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/pnpm-lock.yaml:
  Line 2167:   es-toolkit@1.49.0:

  Line 6334:   es-toolkit@1.49.0: {}

  Line 6972:       es-toolkit: 1.49.0


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/helpers.ts:
  Line 272:  * @param fallback - Response for unmatched requests (default: 404)

  Line 281:   const fallbackStatus = fallback?.status ?? 404;
gateway · 2026-09-09 03:33:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 03:34:42
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/db/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed...
gateway · 2026-09-09 03:34:56
result
Found 66 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts:
  Line 136:   fetchLatestFromGitHub,

  Line 138:   fetchLatestNightlyVersion,

  Line 143:   versionExists,

  Line 189: describe("fetchLatestFromGitHub", () => {

  Line 204:     const version = await fetchLatestFromGitHub();

  Line 222:     const version = await fetchLatestFromGitHub();

  Line 240:     const version = await fetchLatestFromGitHub();

  Line 252:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 253:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 263:     await expect(fetchLatestFromGitHub()).rejects.toThrow(UpgradeError);

  Line 264:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 278:     await expect(fetchLatestFromGitHub()).rejects.toThrow(

  Line 343: // fetchLatestNightlyVersion tests are in the dedicated describe block

  Line 546: ...
gateway · 2026-09-09 03:35:47
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/patch-cache.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/init/tools/apply-patchset.ts
/home/byk/.local/share/opencode/worktree/0e8...
gateway · 2026-09-09 03:36:34
result
Found 22 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/pnpm-lock.yaml:
  Line 116:       binpatch:

  Line 1795:   binpatch@0.3.1:

  Line 6019:   binpatch@0.3.1: {}


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json:
  Line 107:     "binpatch": "^0.3.1",


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts:
  Line 2: import { makeCache, type PatchCache, type PatchChain } from "binpatch";

  Line 5: export type { ChainMeta, PatchStepMeta } from "binpatch";

  Line 7: export { chainFileName, patchFileName } from "binpatch";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 1: /** Delta upgrade discovery and application backed by binpatch. ...
gateway · 2026-09-09 03:37:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 03:38:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 03:39:19
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/binary.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/release-notes.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/patch-cache.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5...
gateway · 2026-09-09 03:39:54
result
 M .lore.md
gateway · 2026-09-09 03:41:06
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 03:42:10
result
Found 50 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

  Line 23: } from "./delta-upgrade.js";

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 134:       await prefetchNightlyPatches(latestVersion, signal);

  Line 136:       await prefetchStablePatches(latestVersion, signal);

  Line 183:             ? await fetchLatestNightlyVersion(signal)

  Line 184:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/scan/walker.ts:
  Line 48: import { classifyByExtension, readHeadAndSniff } from "./binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   ...
gateway · 2026-09-09 03:42:52
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 03:43:53
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/patch-cache.test.ts
/home/b...
gateway · 2026-09-09 03:44:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 03:45:19
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts
/home/byk/.loc...
gateway · 2026-09-09 03:46:00
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 03:47:02
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
1: /** Delta upgrade discovery and application backed by binpatch. */
2: 
3: import { join } from "node:path";
4: // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
5: import * as Sentry from "@sentry/node-core/light";
6: import {
7:   applyPatchChainInMemory,
8:   extractStableChain as binpatchExtractStableChain,
9:   filterAndSortChainTags as binpatchFilterAndSortChainTags,
10:   validateChainStep as binpatchValidateChainStep,
11:   type DeltaTelemetry,
12:   type DeltaUnavailableReason,
13:   type ExtractStableChainOpts,
14:   type GitHubRelease,
15:   getPatchFromVersion,
16:   getPatchTargetSha256,
17:   ghcrSource,
18:   githubReleaseSource,
19:   type InstrumentHook,
20:   MAX_NIGHTLY_CHAIN_DEPTH,
21:   makeCache,
22:   OciClient,
23:   type OciManifest,
24:   ...
gateway · 2026-09-09 03:48:01
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/AGENTS.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md
gateway · 2026-09-09 03:48:46
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/AGENTS.md</path>
<type>file</type>
<content>
1: <!-- This section is maintained by the coding agent via lore (https://github.com/BYK/loreai) -->
2: ## Long-term Knowledge
3: 
4: For long-term knowledge entries managed by [lore](https://github.com/BYK/loreai) (gotchas, patterns, decisions, architecture), see [`.lore.md`](.lore.md) in the project root.
5: <!-- End lore-managed section -->

(End of file - total 5 lines)
</content>
gateway · 2026-09-09 03:48:54
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 03:49:48
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/commands/cli/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/delta-upgrade.mocked.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/e2e/delta-upgrade.test.ts
gateway · 2026-09-09 03:50:45
result
Found 21 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts:
  Line 30: export const KNOWN_CURL_DIRS = [".local/bin", "bin", ".sentry/bin"];

  Line 50: const VALID_METHODS: InstallationMethod[] = [

  Line 66: export function parseInstallationMethod(value: string): InstallationMethod {

  Line 92: export function isMusl(): boolean {

  Line 130: export function getPlatformBinaryName(): string {

  Line 151: export function getBinaryDownloadUrl(version: string): string {

  Line 156: export const GITHUB_RELEASES_URL =

  Line 168: export function isNightlyVersion(version: string): boolean {

  Line 181: export function compareVersions(a: string, b: string): -1 | 0 | 1 {

  Line 190: export function isDowngrade(current: string, target: string): boolean {

  Line 199: export function getBinaryFilename(): string {

  Line 211: export function getBinaryPaths(installPath: string): {

  Line 238: export ...
gateway · 2026-09-09 03:51:03
<!-- lore-recall:1d3b6cf0-fb4e-47c6-bd70-6754ed0a342f --><!-- lore-recall:4136b8b2-63a6-48b5-8b6c-36d9538d6669 -->
gpt-5.6-sol · 2026-09-09 03:51:03 · ~65 tokens
result
Found 14 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 23: } from "./delta-upgrade.js";

  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 36: } from "./binary.js";

  Line 40: import { attemptDeltaUpgrade, type DeltaResult } from "./delta-upgrade.js";

  Line 50: } from "./ghcr.js";

  Line 60: export type { InstallationMethod } from "./binary.js";

  Line 62: export { parseInstallationMethod } from "./binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/telemetry.ts:
  Line 19: import { isMusl } from ...
gateway · 2026-09-09 03:51:51
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts
/home/byk/.loc...
gateway · 2026-09-09 03:52:20
<!-- lore-recall:af095aa1-a5b5-494a-8cac-cee1b0a55927 --><!-- lore-recall:2de69e30-6188-4aaf-8d47-3d6450d254e7 -->
gpt-5.6-sol · 2026-09-09 03:52:20 · ~59 tokens
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts:
  Line 46: describe("shouldSuppressNotification", () => {

  Line 47:   test("suppresses for upgrade command", () => {

  Line 52:   test("suppresses for cli management commands", () => {

  Line 66:   test("does not suppress for cli feedback", () => {

  Line 70:   test("does not suppress when setup/fix appear as non-cli args", () => {

  Line 79:   test("suppresses for --version flag", () => {

  Line 84:   test("suppresses for --json flag", () => {

  Line 89:   test("does not suppress for regular commands", () => {

  Line 95:   test("does not suppress for empty args", () => {

  Line 103: describe("getUpdateNotification", () => {

  Line 128:   test("returns null when no version info is cached", () => {

  Line 133:   test("returns null when cached version is same as current", () => {

  Line 140:  ...
gateway · 2026-09-09 03:52:39
<!-- lore-recall:65b5e76b-57c3-4bb7-9a23-9f6e9df18b37 --><!-- lore-recall:1a9f839a-cf43-40b9-b442-c3b2817df357 --><!-- lore-recall:85d26594-6e2d-4afc-8a9f-c10b842a326d -->
gpt-5.6-sol · 2026-09-09 03:52:39 · ~92 tokens
result
Found 43 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts:
  Line 78: describe("getAnonymousToken", () => {

  Line 79:   test("returns token from successful response", async () => {

  Line 94:   test("throws UpgradeError on HTTP error", async () => {

  Line 103:   test("throws UpgradeError on network failure", async () => {

  Line 114:   test("throws UpgradeError when response has no token field", async () => {

  Line 130: describe("fetchNightlyManifest", () => {

  Line 131:   test("fetches manifest with correct headers", async () => {

  Line 156:   test("throws UpgradeError on HTTP error", async () => {

  Line 165:   test("throws UpgradeError on network failure", async () => {

  Line 177: describe("getNightlyVersion", () => {

  Line 178:   test("extracts version from manifest annotations", () => {

  Line 183:   test("throws UpgradeError when version annotation is missing", () => {

  ...
gateway · 2026-09-09 03:52:58
<!-- lore-recall:e4412932-deb9-4b18-80b2-f224c53d37a6 --><!-- lore-recall:36b2710b-6460-4bf5-942a-be07252b8d09 -->
gpt-5.6-sol · 2026-09-09 03:52:58 · ~56 tokens
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/error-reporting.test.ts:
  Line 71:     expect(extractResourceKind("not found in neurio/installer-app")).toBe(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts:
  Line 4:  * Exercises the shell installer with fake download tools so argument parsing and

  Line 28: describe("install script", () => {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/node-polyfills-file-stat.test.ts:
  Line 88:   test("parity with native stat()", async () => {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/proguard.property.test.ts:
  Line 6:  * byte-for-byte parity with the `rust-proguard` crate's `uuid()`.
gateway · 2026-09-09 03:53:10
<!-- lore-recall:cc66efab-39c5-431f-876a-bd02e7b627a3 --><!-- lore-recall:61c8ba84-b050-4b6d-b80c-d0dce88f6759 -->
gpt-5.6-sol · 2026-09-09 03:53:10 · ~58 tokens
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/install-script.test.ts</path>
<type>file</type>
<content>
1: /**
2:  * Install Script Tests
3:  *
4:  * Exercises the shell installer with fake download tools so argument parsing and
5:  * setup delegation can be validated without network access.
6:  */
7: 
8: import { spawn } from "node:child_process";
9: import {
10:   chmodSync,
11:   mkdirSync,
12:   mkdtempSync,
13:   readFileSync,
14:   rmSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { tmpdir } from "node:os";
18: import { join } from "node:path";
19: import { afterEach, beforeEach, describe, expect, test } from "vitest";
20: 
21: function noop(): void {
22:   // Intentionally empty — absorbs async spawn errors
23: }
24: 
25: const repoRoot = join(import.meta.dirname, "..", "..");
26: const installScript = join(repoRoot, "install");
27: 
28: describe("install script", () => {
29:   let ...
gateway · 2026-09-09 03:54:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
105:   }
106: 
107:   // Heuristic 2: ldd --version output (musl ldd writes "musl libc" to stderr)
108:   try {
109:     const result = spawnSync("ldd", ["--version"], {
110:       stdio: ["ignore", "pipe", "pipe"],
111:     });
112:     const output =
113:       Buffer.from(result.stdout).toString() +
114:       Buffer.from(result.stderr).toString();
115:     cachedIsMusl = output.toLowerCase().includes("musl");
116:     return cachedIsMusl;
117:   } catch {
118:     // ldd not found or failed — assume glibc (the common case)
119:     cachedIsMusl = false;
120:     return false;
121:   }
122: }
123: 
124: /**
125:  * Build the platform-specific binary base name.
126:  *
127:  * Matches the naming convention used by GitHub Releases and GHCR:
128:  * `sentry-<os>-<arch>[-musl][.exe]` (e.g., `sentry-linux-x64`, ...
gateway · 2026-09-09 03:54:39
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 03:55:27
result
Found 11 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts:
  Line 60: function buildSignal(

  Line 97: async function fetchWithRetry(

  Line 192: export async function getAnonymousToken(signal?: AbortSignal): Promise<string> {

  Line 227: export async function fetchManifest(

  Line 265: export async function fetchNightlyManifest(

  Line 280: export function getNightlyVersion(manifest: OciManifest): string {

  Line 302: export function findLayerByFilename(

  Line 332: export async function downloadNightlyBlob(

  Line 427: async function fetchTagPage(

  Line 471: export async function listTags(

  Line 513: export async function downloadLayerBlob(
gateway · 2026-09-09 03:56:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "toolkit-cli-workspace",
3:   "version": "0.0.0",
4:   "private": true,
5:   "type": "module",
6:   "packageManager": "pnpm@10.11.0",
7:   "engines": {
8:     "node": ">=18.0"
9:   },
10:   "scripts": {
11:     "tsx": "pnpm --filter sentry run tsx",
12:     "cli": "pnpm --filter sentry run cli",
13:     "dev": "pnpm --filter sentry run dev",
14:     "build": "pnpm --filter sentry run build",
15:     "build:all": "pnpm --filter sentry run build:all",
16:     "bundle": "pnpm --filter sentry run bundle",
17:     "typecheck": "pnpm --filter sentry run typecheck",
18:     "lint": "pnpm --filter sentry run lint",
19:     "lint:fix": "pnpm --filter sentry run lint:fix",
20:     "test": "pnpm --filter sentry run test",
21:     "test:unit": "pnpm --filter sentry run test:unit",
22:     "test:changed": "pnpm --filter sentry run ...
gateway · 2026-09-09 03:57:23
result
Found 76 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 27: import { cleanupPatchCache } from "./patch-cache.js";

  Line 40:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts:
  Line 26:   GITHUB_RELEASES_URL,

  Line 52: import { clearPatchCache } from "./patch-cache.js";

  Line 79: export const NIGHTLY_TAG = "nightly";

  Line 82: const NPM_REGISTRY_URL = "https://registry.npmjs.org/sentry";

  Line 379:     `${GITHUB_RELEASES_URL}/latest`,

  Line 411:     `${NPM_REGISTRY_URL}/latest`,

  Line 489:  * Nightly builds are published to GHCR with tags like `nightly-0.14.0-dev.1772661724`.

  Line 501:     await fetchManifest(token, `nightly-${version}`);

  Line 519:  * versioned tags like `nightly-0.14.0-dev.1772661724`). ...
gateway · 2026-09-09 03:58:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 03:58:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
1: /**
2:  * GHCR (GitHub Container Registry) Client
3:  *
4:  * Encapsulates the OCI download protocol for fetching nightly CLI binaries
5:  * from ghcr.io/getsentry/cli. Nightly builds are pushed as OCI artifacts
6:  * via ORAS with the version baked into the manifest annotation.
7:  *
8:  * Key design decisions:
9:  * - Anonymous access: nightly package is public; no token needed beyond the
10:  *   standard ghcr.io anonymous token exchange.
11:  * - Version discovery from manifest annotation: `annotations.version` in the
12:  *   OCI manifest holds the nightly version. Checking the latest version only
13:  *   requires a token exchange + manifest fetch (2 HTTP requests total).
14:  * - Redirect quirk: ghcr.io blob downloads return 307 to Azure Blob Storage. ...
gateway · 2026-09-09 03:59:48
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/ghcr.test.ts
/home/byk/.loc...
gateway · 2026-09-09 04:00:01
result
Found 69 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 35:   GITHUB_RELEASES_URL,

  Line 44: import { GHCR_REPO } from "./ghcr.js";

  Line 72: // GHCR_REPO). Importing as a named import keeps a single source of truth and

  Line 124:     releasesUrl: GITHUB_RELEASES_URL,

  Line 135:     repo: GHCR_REPO,

  Line 155: export async function fetchRecentReleases(

  Line 159:     const response = await customFetch(`${GITHUB_RELEASES_URL}?per_page=12`, {

  Line 288:     repo: GHCR_REPO,

  Line 294:     (await client.listTags(opts.token, PATCH_TAG_PREFIX, opts.signal));

  Line 307:       chainTags.map((tag) => client.fetchManifest(opts.token, tag, opts.signal))


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 28: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from ...
gateway · 2026-09-09 04:02:08
result
## chore/preshape-monorepo...origin/chore/preshape-monorepo [gone]
 M .lore.md
gateway · 2026-09-09 04:03:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.40.0-dev.0",
4:   "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5:   "repository": {
6:     "type": "git",
7:     "url": "git+https://github.com/getsentry/cli.git"
8:   },
9:   "main": "./dist/index.cjs",
10:   "type": "module",
11:   "types": "./dist/index.d.cts",
12:   "exports": {
13:     ".": {
14:       "import": {
15:         "types": "./dist/index.d.mts",
16:         "default": "./dist/index.mjs"
17:       },
18:       "require": {
19:         "types": "./dist/index.d.cts",
20:         "default": "./dist/index.cjs"
21:       }
22:     }
23:   },
24:   "bin": {
25:     "sentry": "./dist/bin.cjs"
26:   },
27:   "files": [
28:     "dist/bin.cjs",
29:     "dist/index.cjs",
30:     ...
gateway · 2026-09-09 04:04:04
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/version-check.ts:
  Line 31: const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;

  Line 42: const NOTIFICATION_INTERVAL_MS = 24 * 60 * 60 * 1000;

  Line 45: const JITTER_FACTOR = 0.2;

  Line 48: const SUPPRESSED_ARGS = new Set([

  Line 64: const SUPPRESSED_CLI_SUBCOMMANDS = new Set(["setup", "fix"]);

  Line 73: function shouldCheckForUpdate(): boolean {

  Line 98: export function shouldSuppressNotification(args: string[]): boolean {

  Line 113: export function abortPendingVersionCheck(): void {

  Line 124: async function maybePrefetchPatches(

  Line 156: function checkForUpdateInBackgroundImpl(): void {

  Line 217: function isStderrTTY(): boolean {

  Line 237: function canNotifyAgain(lastNotified: number | null): boolean {

  Line 254: function getUpdateNotificationWithCopy(

  Line 306: function ...
gateway · 2026-09-09 04:05:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/AGENTS.md</path>
<type>file</type>
<content>
1: # AGENTS.md
2: 
3: Guidelines for AI agents working in this codebase.
4: 
5: ## Project Overview
6: 
7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. ...
gateway · 2026-09-09 04:06:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
1: /**
2:  * Binary Management
3:  *
4:  * Shared utilities for installing, replacing, and managing the CLI binary.
5:  * Used by both `setup --install` (fresh installs) and `upgrade` (self-updates).
6:  */
7: 
8: import { spawnSync } from "node:child_process";
9: import {
10:   existsSync,
11:   mkdirSync,
12:   readFileSync,
13:   renameSync,
14:   unlinkSync,
15:   writeFileSync,
16: } from "node:fs";
17: import { chmod, copyFile, mkdir, realpath, unlink } from "node:fs/promises";
18: import { delimiter, dirname, join, resolve } from "node:path";
19: import { compare as semverCompare } from "semver";
20: import { getUserAgent } from "./constants.js";
21: import {
22:   buildTlsErrorDetail,
23:   customFetch,
24:   isTlsCertError,
25: } from "./custom-ca.js";
26: import { stringifyUnknown, UpgradeError } from ...
gateway · 2026-09-09 04:07:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1: /**
2:  * Upgrade Module
3:  *
4:  * Detects how the CLI was installed and provides self-upgrade functionality.
5:  * Binary management helpers (download URLs, locking, replacement) live in
6:  * binary.ts and are shared with the setup --install flow.
7:  */
8: 
9: import { spawn } from "node:child_process";
10: import {
11:   chmodSync,
12:   createWriteStream,
13:   existsSync,
14:   realpathSync,
15:   statSync,
16:   unlinkSync,
17: } from "node:fs";
18: import { writeFile } from "node:fs/promises";
19: import { homedir } from "node:os";
20: import { dirname, join, sep } from "node:path";
21: import { setTimeout } from "node:timers/promises";
22: import {
23:   acquireLock,
24:   cleanupOldBinary,
25:   fetchWithUpgradeError,
26:   GITHUB_RELEASES_URL,
27:   getBinaryDownloadUrl,
28:   getBinaryFilename,
29:   ...
gateway · 2026-09-09 04:08:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
365: // Version Fetching
366: 
367: /**
368:  * Fetch the latest version from GitHub releases.
369:  *
370:  * @param signal - Optional AbortSignal to cancel the request
371:  * @returns Latest version string (without 'v' prefix)
372:  * @throws {UpgradeError} When fetch fails or response is invalid
373:  * @throws {Error} AbortError if signal is aborted
374:  */
375: export async function fetchLatestFromGitHub(
376:   signal?: AbortSignal
377: ): Promise<string> {
378:   const response = await fetchWithUpgradeError(
379:     `${GITHUB_RELEASES_URL}/latest`,
380:     { headers: getGitHubHeaders(), signal },
381:     "GitHub"
382:   );
383: 
384:   if (!response.ok) {
385:     throw new UpgradeError(
386:       "network_error",
387:       `Failed to fetch from GitHub: ${response.status}`
388:     );
389:   }
390: 
391: ...
gateway · 2026-09-09 04:09:11
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/release-notes.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/test/lib/patch-cache.test.ts
/home/b...
gateway · 2026-09-09 04:09:34

Understood.

gpt-5.6-sol · 2026-09-09 04:09:34 · ~3 tokens

Distillations (50)

Gen 0 2026-09-09 06:24:33 · 1985 tokens

* 🔴 (04:07) `packages/cli/src/lib/binary.ts` defines `KNOWN_CURL_DIRS = [".local/bin", "bin", ".sentry/bin"]`. * 🔴 (04:07) `packages/cli/src/lib/binary.ts` defines `InstallationMethod` as `"curl" | "brew" | "npm" | "pnpm" | "bun" | "yarn" | "unknown"`; `VALID_METHODS` accepts all except `"unknown"` for the `--method` flag. * 🔴 (04:07) `packages/cli/src/lib/binary.ts:parseInstallationMethod(val…

Gen 0 2026-09-09 06:20:02 · 2730 tokens

* 🔴 (03:59) `packages/cli/src/lib/ghcr.ts` defines request controls `GHCR_REQUEST_TIMEOUT = 10_000`, `GHCR_MAX_RETRIES = 1`, and `GHCR_BLOB_TIMEOUT = 30_000`. * 🔴 (03:59) `packages/cli/src/lib/ghcr.ts:isRetryableError()` treats `TimeoutError` and `AbortError` names, plus messages containing `timeout`, `econnreset`, `econnrefused`, `network`, or `fetch failed`, as retryable; HTTP-level errors ar…

Gen 0 2026-09-09 06:14:33 · 1410 tokens

Date: September 9, 2026 * 🔴 (03:56) `packages/cli/src/lib/ghcr.ts` contains 11 identified functions: `buildSignal()` at line 60, `fetchWithRetry()` at line 97, `getAnonymousToken()` at line 192, `fetchManifest()` at line 227, `fetchNightlyManifest()` at line 265, `getNightlyVersion()` at line 280, `findLayerByFilename()` at line 302, `downloadNightlyBlob()` at line 332, `fetchTagPage()` at line …

Gen 0 2026-09-09 06:08:09 · 3448 tokens

Date: September 9, 2026 * 🔴 (03:49) User-provided `packages/cli/AGENTS.md` states Sentry CLI is built with Node.js, pnpm, and Stricli; it lives in `packages/cli` within a pnpm workspace, while the Astro + Starlight documentation site lives in `apps/cli-docs`. * 🔴 (03:49) Sentry CLI project goals are: zero-config DSN/project-context detection, Seer AI-powered debugging, developer-friendly UX fol…

Gen 0 2026-09-09 06:04:42 · 2233 tokens

Date: September 9, 2026 * 🔴 (03:45) `packages/cli/src/lib/ghcr.ts` treats the nightly package at `ghcr.io/getsentry/cli` as public, with no token needed beyond anonymous registry access; `GHCR_BLOB_TIMEOUT` is `30_000`. * 🔴 (03:45) `packages/cli/src/lib/ghcr.ts` uses structured abort-signal state rather than runtime-dependent error-message text to classify timeouts versus external cancellation,…

Gen 0 2026-09-09 05:59:56 · 1953 tokens

* 🔴 (03:39) `packages/cli/package.json` identifies package `"sentry"` version `"0.40.0-dev.0"`, with `"type": "module"`, Node engine `">=18.0"`, development runtime Node `">=22.15"`, and package manager `"pnpm@10.11.0"`. * 🔴 (03:39) `packages/cli/package.json` exposes the `sentry` executable through `"./dist/bin.cjs"`; package entry points are `./dist/index.mjs` for ESM and `./dist/index.cjs` f…

Gen 0 2026-09-09 05:55:31 · 3308 tokens

* 🔴 (03:32) Search found 19 GitHub/GHCR download references across `packages/cli/test/e2e/delta-upgrade.test.ts`, `packages/cli/test/lib/upgrade.test.ts`, `packages/cli/test/lib/binary.test.ts`, `packages/cli/test/lib/delta-upgrade.test.ts`, `packages/cli/test/lib/delta-upgrade.mocked.test.ts`, and `packages/cli/test/lib/ghcr.test.ts`; stable assets use `https://github.com/getsentry/cli/releases…

Gen 0 2026-09-09 05:50:33 · 2257 tokens

* 🔴 (03:29) Repository search found `getsentry/cli` references in `packages/cli/package.json`, `packages/cli/README.md`, `packages/cli/warden.toml`, tests including `packages/cli/test/lib/upgrade.test.ts`, `packages/cli/test/lib/api/releases.test.ts`, `packages/cli/test/lib/api/issues.test.ts`, `packages/cli/test/lib/db/repo-cache.test.ts`, `packages/cli/test/lib/binary.test.ts`, `packages/cli/t…

Gen 0 2026-09-09 05:45:35 · 2141 tokens

* 🔴 (03:27) `packages/cli/src/lib/ghcr.ts` is a 520-line GHCR/OCI client for fetching nightly CLI binaries from public package `ghcr.io/getsentry/cli`; exported constants are `GHCR_REPO = "getsentry/cli"` and `GHCR_TAG = "nightly"`, while private constants are `GHCR_REGISTRY = "https://ghcr.io"`, `OCI_MANIFEST_TYPE = "application/vnd.oci.image.manifest.v1+json"`, `GHCR_REQUEST_TIMEOUT = 10_000`,…

Gen 0 2026-09-09 05:39:59 · 3394 tokens

* 🔴 (03:23) `packages/cli/package.json` defines package `sentry` at version `0.40.0-dev.0`, description `Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans`, repository `git+https://github.com/getsentry/cli.git`, license `FSL-1.1-Apache-2.0`, module type `module`, Node engine `>=18.0`, development runtime Node `>=22.15`, and package manager `p…

Gen 0 2026-09-09 05:35:38 · 2031 tokens

* 🔴 (03:21) `packages/cli/test/lib/install-script.test.ts` is a 109-line Vitest shell-installer test suite that runs `packages/cli/install` via `spawn("bash", ...)` with fake download utilities, avoiding network access. * 🔴 (03:21) `packages/cli/test/lib/install-script.test.ts` creates a temporary `sentry-install-test-` directory, prepends its `bin` directory to `PATH`, sets `SENTRY_TEST_ARGS_F…

Gen 0 2026-09-09 05:30:09 · 2404 tokens

* 🔴 (03:18) `packages/cli/src/lib/ghcr.ts` implements GHCR/OCI helpers for the public `ghcr.io/getsentry/cli` nightly package; anonymous access requires no user-provided token beyond the registry token exchange. * 🔴 (03:18) `packages/cli/src/lib/ghcr.ts` defines `GHCR_BLOB_TIMEOUT = 30_000`; its comments cite observed GHCR cold-start latency spikes from `126ms` to `30s` for identical requests. …

Gen 0 2026-09-09 05:22:27 · 1924 tokens

* 🔴 (03:14) `packages/cli/test/lib/binary.test.ts` uses Vitest (`afterEach`, `beforeEach`, `describe`, `expect`, `test`) and exercises binary URL/platform formatting, `determineInstallDir()`, `fetchWithUpgradeError()`, binary installation/replacement, executable permissions, locking via `acquireLock()`, `.download` cleanup, replacement of existing content, and symlinked install paths. * 🔴 (03:1…

Gen 0 2026-09-09 05:19:18 · 2005 tokens

* 🔴 (03:09) User stated the telemetry path in `packages/cli/install` “never blocks installation or propagates failures” and telemetry must “never fail the script.” `report_error()` runs in a background subshell with `set +e`; `die()` waits with `wait 2>/dev/null || true` and ignores telemetry’s exit status. * 🔴 (03:09) `packages/cli/install` is a Bash installer using `set -euo pipefail`. It ins…

Gen 0 2026-09-09 05:14:27 · 2280 tokens

* 🔴 (03:05) Search results showed `packages/cli/test/lib/upgrade.test.ts` directly covers `fetchLatestFromGitHub()`, `fetchLatestFromNpm()`, `fetchLatestNightlyVersion()`, `fetchLatestVersion()`, `versionExists()`, and `getBinaryDownloadUrl()`. `fetchLatestVersion()` cases include methods `"curl"`, `"npm"`, `"pnpm"`, `"bun"`, `"yarn"`, `"brew"`, and `"unknown"`, plus nightly cases for `"curl"` a…

Gen 0 2026-09-09 05:09:21 · 2118 tokens

* 🔴 (03:01) `packages/cli/src/lib/delta-upgrade.ts` is a 615-line binpatch-backed delta-upgrade implementation. It imports `applyPatchChainInMemory`, chain-discovery/validation helpers, `MAX_NIGHTLY_CHAIN_DEPTH`, `PATCH_TAG_PREFIX`, `SIZE_THRESHOLD_RATIO`, `makeCache`, `OciClient`, `ghcrSource`, `githubReleaseSource`, and `resolveAndApply` from `"binpatch"`, while preserving its existing public …

Gen 0 2026-09-09 05:06:12 · 1509 tokens

* 🔴 (02:58) `packages/cli/src/lib/release-notes.ts` implements stable and nightly release-note parsing, aggregation, filtering, attribution stripping, truncation, and best-effort fetching; only 3 user-facing categories are retained in exact display order: 1. `"features"` (`### New Features` / `feat:`), 2. `"fixes"` (`### Bug Fixes` / `fix:`), 3. `"performance"` (`### Performance` / `perf:`). * �…

Gen 0 2026-09-09 05:02:35 · 1320 tokens

* 🔴 (02:55) `packages/cli/src/lib/binary.ts` defines `InstallationMethod` as `"curl" | "brew" | "npm" | "pnpm" | "bun" | "yarn" | "unknown"`; `parseInstallationMethod(value)` lowercases input and rejects values outside the first 6 methods with `Invalid method: ${value}. Must be one of: ${VALID_METHODS.join(", ")}`. * 🔴 (02:55) `packages/cli/src/lib/binary.ts` detects musl Linux via 2 ordered he…

Gen 0 2026-09-09 04:58:37 · 2257 tokens

* 🔴 (02:52) JavaScript callback exceptions and non-`Uint8Array` results in `symbolic-wasm` must propagate as `JsError` and must never be silently discarded with `.ok()?`. * 🔴 (02:52) Toolkit migration source fallback must probe `getsentry/toolkit` before `getsentry/cli` and fall back only on a genuine HTTP 404. Never fall back on 401/403/429/5xx or transport errors; authentication, rate-limit, …

Gen 0 2026-09-09 04:55:40 · 2430 tokens

* 🔴 (02:51) `packages/cli/src/lib/release-notes.ts` implements release-note parsing and aggregation with `marked.lexer()` AST processing, retaining only 3 user-facing categories in this display order: 1. `features` from `### New Features` or `feat:` commits, 2. `fixes` from `### Bug Fixes` or `fix:` commits, 3. `performance` from `### Performance` or `perf:` commits. * 🔴 (02:51) `packages/cli/s…

Gen 0 2026-09-09 04:49:07 · 1889 tokens

* 🔴 (02:50) User requires streaming-download code to “Always flush/close the writer.” If the stream has already failed, the original stream failure must be surfaced rather than a later close/finalization error. * 🔴 (02:50) User identified a stream backpressure race: a writable that errors while its buffer is full may “never emit 'drain',” causing a hang; the unused listener must be cleaned up t…

Gen 0 2026-09-09 04:45:50 · 836 tokens

* 🔴 (02:49) `packages/cli/src/lib/ghcr.ts` configures `GHCR_REQUEST_TIMEOUT = 10_000`, `GHCR_MAX_RETRIES = 1`, and `GHCR_BLOB_TIMEOUT = 30_000`. * 🔴 (02:49) `packages/cli/src/lib/ghcr.ts` defines `isRetryableError()` to retry `TimeoutError`, `AbortError`, and errors containing `timeout`, `econnreset`, `econnrefused`, `network`, or `fetch failed`; HTTP-level failures are not retried. * 🔴 (02:49…

Gen 0 2026-09-09 04:42:57 · 1665 tokens

* 🔴 (02:46) User requires promises in async functions to always be `await`ed and their return values used: “Always `await` promises in async functions - don't forget to use the return value.” * 🔴 (02:46) `packages/cli/.cursor/rules/ultracite.mdc` defines Ultracite/Biome standards for `**/*.{ts,tsx,js,jsx,json,jsonc,html,vue,svelte,astro,css,yaml,yml,graphql,gql,md,mdx,grit}`; commands are `npx …

Gen 0 2026-09-09 04:39:33 · 1351 tokens

* 🔴 (02:45) User requires installer telemetry in `packages/cli/install` to be fire-and-forget: it runs in a background subshell and never blocks installation or propagates failures. * 🔴 (02:45) User requires telemetry reporting to never fail the installer script; `report_error()` uses `set +e`, and `die()` uses `wait 2>/dev/null || true` before exiting. * 🔴 (02:45) `packages/cli/install` sends…

Gen 0 2026-09-09 04:36:44 · 539 tokens

* 🔴 (02:41) `packages/cli/src/lib/ghcr.ts` sets `GHCR_BLOB_TIMEOUT = 30_000`; its retry logic is motivated by observed GHCR cold-start latency spikes from 126 ms to 30 s for identical requests. * 🔴 (02:41) `packages/cli/src/lib/ghcr.ts` distinguishes external cancellation using `Boolean(externalSignal?.aborted && error.name === "AbortError")` rather than relying on runtime-dependent error-messa…

Gen 0 2026-09-09 04:35:27 · 488 tokens

* 🔴 (02:39) `packages/cli/src/lib/upgrade.ts` imports and uses `GITHUB_RELEASES_URL`, `getBinaryDownloadUrl`, `downloadNightlyBlob`, `fetchManifest`, `fetchNightlyManifest`, and `getAnonymousToken`; relevant call sites include GitHub release lookup at lines 379 and 538, GHCR token/manifest retrieval at lines 452–501 and 688–694, and full binary URL construction at line 721. * 🔴 (02:39) `package…

Gen 0 2026-09-09 04:31:28 · 1568 tokens

* 🔴 (02:36) User specified installation-method detection must always check Homebrew first because stored installation information may be stale. * 🔴 (02:36) User specified the binary-download writer must always be flushed/closed; if the stream has already failed, that original stream failure should be surfaced. * 🔴 (02:36) User identified a download hang scenario: after the buffer becomes full,…

Gen 0 2026-09-09 04:27:30 · 1162 tokens

* 🔴 (02:34) `packages/cli/package.json` defines package `sentry` version `0.40.0-dev.0`, an ESM package (`"type": "module"`) with Node engine `>=18.0`, development runtime Node `>=22.15`, and package manager `pnpm@10.11.0`. * 🔴 (02:34) `packages/cli/package.json` publishes the `sentry` binary from `./dist/bin.cjs`; package exports provide ESM via `./dist/index.mjs` and `./dist/index.d.mts`, and…

Gen 0 2026-09-09 04:23:31 · 1117 tokens

* 🔴 (02:30) [enforced-workflow] User stated to always check `package.json` for the latest scripts before running project commands; all commands run from the repository root. * 🔴 (02:30) [enforced-dependency-policy] User stated all packages must be placed in `devDependencies`, never `dependencies`, because everything is bundled at build time via esbuild; CI enforces this with `pnpm run check:dep…

Gen 0 2026-09-09 04:19:45 · 1943 tokens

* 🔴 (02:23) `packages/cli/src/lib/binary.ts` lines 130-142 defines `getPlatformBinaryName()` using the release/GHCR naming convention `sentry-<os>-<arch>[-musl][.exe]`: macOS maps to `darwin`, Windows to `windows`, all other platforms to `linux`; `arm64` remains `arm64`, other architectures map to `x64`; musl adds `-musl`, and Windows adds `.exe`. * 🔴 (02:23) `packages/cli/src/lib/binary.ts` li…

Gen 0 2026-09-09 04:17:54 · 1187 tokens

* 🔴 (02:20) `packages/cli/src/commands/cli/upgrade.ts` states that package-manager installation methods always require network access to fetch and install packages; consequently, offline upgrades are supported only when `method === "curl"`. * 🔴 (02:20) `packages/cli/src/commands/cli/upgrade.ts` states that nightly builds are GitHub-only and therefore always use the curl/GitHub lookup path when …

Gen 0 2026-09-09 04:12:11 · 2012 tokens

* 🔴 (02:16) `packages/cli/package.json` defines package `sentry` at version `0.40.0-dev.0`, package manager `pnpm@10.11.0`, Node runtime requirement `>=18.0`, development runtime requirement Node `>=22.15`, ESM package type, and CLI binary mapping `"sentry": "./dist/bin.cjs"`. * 🔴 (02:16) `packages/cli/package.json` build scripts are: `build` generates schema/docs/SDK then runs `pnpm tsx script…

Gen 0 2026-09-09 04:10:07 · 1124 tokens

* 🔴 (02:13) `packages/cli/src/lib/binary.ts` defines `getPlatformBinaryName()` using OS names `"darwin"`, `"windows"`, or `"linux"`; architecture is `"arm64"` only when `process.arch === "arm64"` and otherwise `"x64"`; it appends `"-musl"` when `isMusl()` is true and `".exe"` on Windows, yielding `sentry-<os>-<arch>[-musl][.exe]`. * 🔴 (02:13) `isMusl()` detects musl by combining `ldd` stdout an…

Gen 0 2026-09-09 04:08:03 · 3089 tokens

* 🔴 (02:11) User asserted `detectInstallationMethod()` in `packages/cli/src/lib/upgrade.ts` must always check for Homebrew first because stored install info may be stale; Homebrew’s resolved `/Cellar/` path is treated as cheap and authoritative. * 🔴 (02:11) `detectInstallationMethod()` priority is: 1. Homebrew via `isHomebrewInstall()`, 2. stored DB install info, 3. legacy detection via curl pa…

Gen 0 2026-09-09 04:04:22 · 1853 tokens

* 🔴 (02:07) `packages/cli/src/lib/delta-upgrade.ts` uses `binpatch` for delta discovery/application, including `applyPatchChainInMemory`, `extractStableChain`, `filterAndSortChainTags`, `validateChainStep`, `resolveAndApply`, `makeCache`, `OciClient`, `githubReleaseSource`, and `ghcrSource`. * 🔴 (02:07) `DeltaResult` in `packages/cli/src/lib/delta-upgrade.ts` contains exact fields `{ sha256: st…

Gen 0 2026-09-09 04:01:04 · 1567 tokens

* 🔴 (02:04) User established a stream-finalization requirement in `packages/cli/src/lib/upgrade.ts`: always flush/close the writer. * 🔴 (02:04) User identified a download-stream hang condition in `packages/cli/src/lib/upgrade.ts`: after `writer.write()` returns `false`, a stream that has already failed may never emit `"drain"`. * 🔴 (02:04) User established error precedence for stream finalizat…

Gen 0 2026-09-09 03:54:50 · 847 tokens

* 🔴 (01:59) User established that `detectInstallationMethod()` in `packages/cli/src/lib/upgrade.ts` must always check Homebrew first because stored install information may be stale; `isHomebrewInstall()` is the cheap, authoritative signal and overrides stored DB information. * 🔴 (01:59) `isHomebrewInstall()` resolves `process.execPath` with `realpathSync()` and checks for `"/Cellar/"`; if realp…

Gen 0 2026-09-09 03:52:35 · 2291 tokens

* 🔴 (01:57) User established the symbolic-wasm error-handling invariant: JavaScript callback exceptions and non-`Uint8Array` results must propagate as `JsError` and must never be silently discarded with `.ok()?`. * 🔴 (01:57) User stated symbolic-wasm must remain a general-purpose library base, while CLI-specific orchestration belongs in `getsentry/cli`. * 🔴 (01:57) User stated symbolic-wasm ar…

Gen 0 2026-09-09 03:46:05 · 2704 tokens

* 🔴 (01:55) A broader code search found 100 matches, with additional matches truncated, across upgrade/version-related files including `packages/cli/src/lib/version-check.ts`, `packages/cli/src/lib/delta-upgrade.ts`, `packages/cli/src/lib/upgrade.ts`, `packages/cli/src/lib/db/version-check.ts`, and `packages/cli/src/lib/binary.ts`. * 🔴 (01:55) `packages/cli/src/lib/version-check.ts` defines bot…

Gen 0 2026-09-09 03:39:36 · 2492 tokens

* 🔴 (01:50) `packages/cli/src/lib/binary.ts` defines `KNOWN_CURL_DIRS = [".local/bin", "bin", ".sentry/bin"]`. * 🔴 (01:50) `getBinaryDownloadUrl(version)` in `packages/cli/src/lib/binary.ts` returns `https://github.com/getsentry/cli/releases/download/${version}/${getPlatformBinaryName()}`; `GITHUB_RELEASES_URL` is `https://api.github.com/repos/getsentry/cli/releases`. * 🔴 (01:50) `isDowngrade(…

Gen 0 2026-09-09 03:33:26 · 1894 tokens

* 🔴 (01:46) A repository-wide search found exactly 83 matches for `getsentry/cli`; notable production references include GitHub release URLs in `packages/cli/src/lib/binary.ts`, GitHub commit API pagination in `packages/cli/src/lib/release-notes.ts`, and GHCR repository configuration in `packages/cli/src/lib/ghcr.ts`. * 🔴 (01:46) `packages/cli/src/lib/release-notes.ts` line 662 builds `https://…

Gen 0 2026-09-09 03:30:29 · 1242 tokens

* 🔴 (01:44) Repository root contains exactly 26 entries: `.craft.yml`, `.git`, `.github/`, `.gitignore`, `.lore.md`, `.nojekyll`, `.npmrc`, `.opencode/`, `.plans/`, `.ruff_cache/`, `AGENTS.md`, `apps/`, `CHANGELOG.md`, `codemods/`, `coverage/`, `dist-bin/`, `dist/`, `docs/`, `LICENSE.md`, `node_modules/`, `package.json`, `packages/`, `pnpm-lock.yaml`, `pnpm-workspace.yaml`, `README.md`, and `tes…

Gen 0 2026-09-09 03:26:07 · 2194 tokens

* 🔴 (01:37) Inspected `packages/cli/src/lib/binary.ts` lines 1–240 of 529; the module provides shared binary installation, replacement, and management utilities for both `setup --install` and `upgrade`. * 🔴 (01:37) `packages/cli/src/lib/binary.ts` defines `InstallationMethod` as `"curl" | "brew" | "npm" | "pnpm" | "bun" | "yarn" | "unknown"`; `VALID_METHODS` accepts the first 6 values in that o…

Gen 0 2026-09-09 03:21:46 · 2237 tokens

* 🔴 (01:35) Repository search found 100 matches, with additional matches available, for migration/repository-reference material including `.lore.md`, `packages/cli/README.md`, `packages/cli/src/lib/upgrade.ts`, release workflows, and plugin documentation. * 🔴 (01:35) `.lore.md` states the symbolic-wasm API must remain a general-purpose library base, while CLI-specific orchestration belongs in `…

Gen 0 2026-09-09 03:14:55 · 2120 tokens

* 🔴 (01:32) Inspected `/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.craft.yml` lines 1–78 of 78. * 🔴 (01:32) `.craft.yml` requires `minVersion: '2.21.1'` and uses `policy: auto` for both `changelog` and `versioning`. * 🔴 (01:32) `.craft.yml` defines `preReleaseCommand: bash -c 'cd packages/cli && node --experimental-strip-types script/bump-v…

Gen 0 2026-09-09 03:12:55 · 4203 tokens

* 🔴 (01:30) Inspected `/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts` lines 500–809 of 945. * 🔴 (01:30) `runSetupOnNewBinary(opts)` builds child arguments in this order: `"cli"`, `"setup"`, `"--quiet"`, `"--method"`, `method`, `"--channel"`, `channel`, `"--no-modify-path"`; it appends `"--install"` when …

Gen 0 2026-09-09 03:01:59 · 4106 tokens

* 🔴 (01:30) Inspected `/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts` lines 1–614 of 615. * 🔴 (01:30) `src/lib/delta-upgrade.ts` integrates `binpatch` using `applyPatchChainInMemory`, `extractStableChain`, `filterAndSortChainTags`, `validateChainStep`, `resolveAndApply`, `githubReleaseSource`, `ghcrSource`,…

Gen 0 2026-09-09 02:58:29 · 3165 tokens

* 🟡 (01:29) [requested-code-analysis] User requested the completed code-path analysis and concrete recommendations immediately, with no file edits. * 🔴 (01:29) User stated the writer must always be flushed/closed. * 🔴 (01:29) User stated that an I/O failure such as `ENOSPC` while the write buffer is full may never emit `"drain"`, which can otherwise cause a hang. * 🔴 (01:29) User stated downl…

Gen 0 2026-09-09 02:51:59 · 2592 tokens

* 🔴 (01:28) `packages/cli/AGENTS.md` identifies Sentry CLI as a Node.js CLI built with pnpm and Stricli, located in `packages/cli` of a pnpm workspace; the docs site is in `apps/cli-docs`. * 🔴 (01:28) Sentry CLI goals listed in `packages/cli/AGENTS.md`: zero-config project detection from DSNs in source/env files; Seer AI-powered debugging; UX following `gh` CLI conventions; agent-friendly JSON …

Gen 0 2026-09-09 02:48:39 · 1070 tokens

* 🔴 (01:27) Search results for `packages/cli/src/lib/ghcr.ts` showed constants `GHCR_REQUEST_TIMEOUT = 10_000`, `GHCR_MAX_RETRIES = 1`, `GHCR_BLOB_TIMEOUT = 30_000`, `GHCR_REPO = "getsentry/cli"`, `GHCR_TAG = "nightly"`, and `GHCR_REGISTRY = "https://ghcr.io"`. * 🔴 (01:27) `packages/cli/src/lib/ghcr.ts` exposes `OciLayer`, `OciManifest`, `getAnonymousToken(signal?: AbortSignal): Promise<string>…