DashboardcliSession 0EKABmkS3SHg

Session 0EKABmkS3SHg

Full ID: 0EKABmkS3SHgi3Lep
Messages: 1059
Distillations: 50
Time range: 2026-09-08 22:35:13 — 2026-09-09 06:14:44

Conversation (1059 messages)

Read-only exploration in /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade. Map every production call path that must carry an ordered UpgradeSource for getsentry/cli#1244: stable latest and pinned versions, nightly latest/pinned, deltas/prefetch, full downloads, installer, background version check. Review the current uncommitted diff too. Identify concrete correctness traps, especially prefix tags, offline behavior, latest-product discovery in a multi-product GitHub repo, GHCR 403 ambiguity, and source consistency. Do not edit. Return exact file/symbol references and a minimal recommended data-flow design.

gateway · 2026-09-08 22:35:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade</path>
<type>directory</type>
<entries>
.craft.yml
.git
.github/
.gitignore
.lore.md
.nojekyll
.npmrc
AGENTS.md
apps/
CHANGELOG.md
codemods/
LICENSE.md
node_modules/
package.json
packages/
pnpm-lock.yaml
pnpm-workspace.yaml
README.md

(18 entries)
</entries>
gateway · 2026-09-08 22:37:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-08 22:37:43
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/AGENTS.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.lore.md
gateway · 2026-09-08 22:37:52
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:38:02
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-08 22:38:14
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:01a02357-f0a8-7fdb-9e9d-b0710cfe65c9 -->
8: * **API output binary and HTTP contracts**: Always preserve strict output-mode and binary-safety contracts. `sentry api` must preserve `rawApiRequest()` status text; empty textual non-2xx bodies must produce an HTTP status/request fallback, and JSON mode must expose `{status, statusText, body}` so empty success and error responses are distinguishable. Binary `Uint8Array` successes bypass formatters and remain raw; binary errors emit only status/content-type/byte-count summaries, never bytes or JSON coercion. Prompts must never block scripted runs or interleave with stdout JSON.
9: 
10: <!-- ...
gateway · 2026-09-08 22:38:27
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.lore.md:
  Line 17: * **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 22:38:47
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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-08 22:39:07
result
No files found
gateway · 2026-09-08 22:39:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.git</path>
<type>file</type>
<content>
1: gitdir: /home/byk/Code/getsentry/cli/.git/worktrees/toolkit-bridge-upgrade

(End of file - total 1 lines)
</content>
gateway · 2026-09-08 22:40:34
result
## feat/toolkit-bridge-upgrade...origin/main
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
M	packages/cli/src/lib/binary.ts
M	packages/cli/test/lib/binary.test.ts
M	packages/cli/test/lib/ghcr.test.ts
M	packages/cli/test/lib/install-script.test.ts
gateway · 2026-09-08 22:40:50
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-08 22:41:00
result
diff --git a/packages/cli/test/lib/binary.test.ts b/packages/cli/test/lib/binary.test.ts
index 6fcfb3b1a..444fddf77 100644
--- a/packages/cli/test/lib/binary.test.ts
+++ b/packages/cli/test/lib/binary.test.ts
@@ -31,8 +31,10 @@ import {
   isDowngrade,
   isMusl,
   releaseLock,
+  resolveUpgradeSource,
   replaceBinarySync,
   samePath,
+  UPGRADE_SOURCES,
 } from "../../src/lib/binary.js";
 import { UpgradeError } from "../../src/lib/errors.js";
 
@@ -61,6 +63,113 @@ describe("getBinaryDownloadUrl", () => {
   });
 });
 
+describe("UPGRADE_SOURCES", () => {
+  test("checks Toolkit before the legacy CLI repository", () => {
+    expect(UPGRADE_SOURCES).toEqual([
+      {
+        githubRepo: "getsentry/toolkit",
+        ghcrRepo: "getsentry/toolkit",
+        tagPrefix: "cli@",
+      },
+      {
+        githubRepo: "getsentry/cli",
+        ghcrRepo: "getsentry/cli",
+        tagPrefix: "",
+      },
+    ]);
+  });
+});
+
+describe("resolveUpgradeSource", () => {
+  test("uses ...
gateway · 2026-09-08 22:41:15
result
diff --git a/packages/cli/test/lib/ghcr.test.ts b/packages/cli/test/lib/ghcr.test.ts
index e5c81d532..58d180da6 100644
--- a/packages/cli/test/lib/ghcr.test.ts
+++ b/packages/cli/test/lib/ghcr.test.ts
@@ -7,6 +7,7 @@
 
 import { afterEach, beforeEach, describe, expect, test } from "vitest";
 import { UpgradeError } from "../../src/lib/errors.js";
+import { UPGRADE_SOURCES } from "../../src/lib/binary.js";
 import {
   downloadLayerBlob,
   downloadNightlyBlob,
@@ -91,6 +92,21 @@ describe("getAnonymousToken", () => {
     expect(token).toBe("test-token-abc");
   });
 
+  test("uses the selected source's GHCR repository", async () => {
+    mockFetch(async (url) => {
+      expect(String(url)).toContain(
+        "scope=repository:getsentry/toolkit:pull"
+      );
+      return new Response(JSON.stringify({ token: "toolkit-token" }), {
+        status: 200,
+      });
+    });
+
+    await expect(getAnonymousToken(UPGRADE_SOURCES[0])).resolves.toBe(
+      "toolkit-token"
+    );
+  ...
gateway · 2026-09-08 22:41:26
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-08 22:41:41
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/e2e/delta-upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/scan/binary.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/scan/binary.property.test.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/ins...
gateway · 2026-09-08 22:41:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, isAbsolute, join, resolve, sep } 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, ...
gateway · 2026-09-08 22:42:02
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-08 22:42:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:42:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:42:38
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-08 22:42:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:43:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:43:23
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 6:  * The `executeUpgrade` and `detectInstallationMethod` subprocess tests use

  Line 120:   getBinaryDownloadUrl,

  Line 135:   downloadBinaryToTemp,

  Line 136:   executeUpgrade,

  Line 137:   fetchLatestFromGitHub,

  Line 139:   fetchLatestNightlyVersion,

  Line 140:   fetchLatestVersion,

  Line 144:   versionExists,

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

  Line 205:     const version = await fetchLatestFromGitHub();

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

  Line 264:     await ...
gateway · 2026-09-08 22:43:32
result
Found 93 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 288:     repo: GHCR_REPO,

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

  Line 308:       chainTags.map((tag) => client.fetchManifest(opts.token, tag, opts.signal))

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

  Line 487: export function resolveStableDelta(

  Line 505: export function resolveNightlyDelta(

  Line 523: export function attemptDeltaUpgrade(

  Line 615: export function ...
gateway · 2026-09-08 22:43:44
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/test/commands/schema.test.ts:
  Line 6:  * of reporting that nothing matched. See getsentry/cli#1424.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 176:     if (urlStr.includes("ghcr.io/token")) {

  Line 254:     if ...
gateway · 2026-09-08 22:43:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.45.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:44:58
result
Found 23 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/e2e/migration.test.ts:
  Line 22: import { getBinaryFilename } from "../../src/lib/binary.js";


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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 123: } from "../../src/lib/binary.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 15: import { getPlatformBinaryName } from ...
gateway · 2026-09-08 22:45:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:30
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: ...
gateway · 2026-09-08 22:45:49
result
Found 22 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.lore.md:
  Line 26: * **check-fragments.ts: validates fragment files against actual route names**: \`script/check-fragments.ts\`: validates fragment files against actual route names (Check 1-4) AND validates subcommand coverage within fragments (Check 5). Check 5: for each route with >1 command, verifies fragment mentions each subcommand via a heading (outside fenced code blocks) or \`sentry \<route> \<subcommand>\` code reference. Default commands handled: if fragment contains bare \`sentry \<route>\`, the default command is covered. Default commands detected from route map (\`defaultCommand\` field in route index files). Fenced code block content stripped before heading scan to avoid false positives from bash comments. Warnings by default; \`--strict\` makes them errors. Run via \`pnpm run check:fragments\`. CI \`check-generated\` job triggers when ...
gateway · 2026-09-08 22:46:18
result
Found 50 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts:
  Line 429:         new Response(JSON.stringify({ tag_name: "v0.0.0-dev" }), {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 196:             tag_name: "v1.2.3",

  Line 214:             tag_name: "v0.5.0",

  Line 232:             tag_name: "1.0.0",

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

  Line 401:         new Response(JSON.stringify({ tag_name: "v2.0.0" }), {

  Line 466:         new Response(JSON.stringify({ tag_name: "v2.0.0" }), {

  Line 536:         new Response(JSON.stringify({ tag_name: "v3.0.0" }), {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/binary.test.ts:
  Line 89:       return new ...
gateway · 2026-09-08 22:46:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts</path>
<type>file</type>
<content>
190:   test("returns null when binary asset has no digest", () => {
191:     const release = makeRelease("0.14.0", [
192:       makeAsset({ name: "sentry-linux-x64" }),
193:     ]);
194:     expect(getStableTargetSha256(release, "sentry-linux-x64")).toBeNull();
195:   });
196: 
197:   test("returns null for empty assets array", () => {
198:     const release = makeRelease("0.14.0", []);
199:     expect(getStableTargetSha256(release, "sentry-linux-x64")).toBeNull();
200:   });
201: });
202: 
203: // extractStableChain
204: 
205: describe("extractStableChain", () => {
206:   /**
207:    * Create a deterministic hex digest from a version string.
208:    *
209:    * Converts each char to its hex code to produce valid [0-9a-f]+ output. ...
gateway · 2026-09-08 22:46:46
result
{
  "name": "binpatch",
  "version": "0.4.2",
  "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:46: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 `fs.openSync` + `fs.writeSync`
 *   with the fd `closeSync`'d before the function returns, so the caller
 *   can `spawn` the output file without racing ETXTBSY on Linux. ...
gateway · 2026-09-08 22:48:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:         - 'vercel'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: vercel
20:     projectId: prj_wVkOnIwI3eIQbGD1Gw7qS1MqFFIK
21:   - name: registry
22:     apps:
23:       'app:sentry':
24:         name: 'Sentry CLI'
25:         packageUrl: 'https://www.npmjs.com/package/sentry'
26:         mainDocsUrl: 'https://cli.sentry.dev'
27:         urlTemplate: ...
gateway · 2026-09-08 22:48:30
result
{"body":"Tracking issue for merging **getsentry/cli** into the existing **getsentry/sentry-mcp** repository, validating the combined monorepo there, and only then renaming it to **`getsentry/toolkit`**. The final repository is a pnpm workspace (no Turbo) with independent prefixed releases and phased shared code.\n\n**Full plan:** https://gist.github.com/BYK/8c0ce6cec64608f41fe5654b7827228e\n\n## Settled architecture\n\n- Use `getsentry/sentry-mcp` as the destination; do not create a fresh repository. This preserves MCP production secrets, environments, GitHub App, webhooks, Vercel, and Cloudflare wiring.\n- Import CLI while the repository is still named `getsentry/sentry-mcp`. Rename only after the integrated monorepo and live deployment paths pass every gate.\n- Preserve CLI and docs history through two filtered `git subtree` imports into `packages/cli` and `apps/cli-docs`.\n- Release products independently with `cli@x.y.z` and `mcp@x.y.z`.\n- CLI docs remain release-gated on Vercel; ...
gateway · 2026-09-08 22:48:42
result
                                               Migration plan: merge getsentry/cli + getsentry/sentry-mcp into getsentry/toolkit monorepo · GitHub                                          

[Skip to content](#start-of-content)          

[](/)

Search Gists

Search Gists

[All gists](/discover) [Back to GitHub](https://github.com) [Sign in](https://gist.github.com/auth/github?return_to=https%3A%2F%2Fgist.github.com%2FBYK%2F8c0ce6cec64608f41fe5654b7827228e) [Sign up](/join?return_to=https%3A%2F%2Fgist.github.com%2FBYK%2F8c0ce6cec64608f41fe5654b7827228e&source=header-gist)

[](/)

[Sign in](https://gist.github.com/auth/github?return_to=https%3A%2F%2Fgist.github.com%2FBYK%2F8c0ce6cec64608f41fe5654b7827228e) [Sign up](/join?return_to=https%3A%2F%2Fgist.github.com%2FBYK%2F8c0ce6cec64608f41fe5654b7827228e&source=header-gist)

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. ...
gateway · 2026-09-08 22:48:54
result
No files found
gateway · 2026-09-08 22:49:02
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public</path>
<type>directory</type>
<entries>
.well-known/
CNAME
favicon.png
favicon.svg
glyph.svg
install
og-image-twitter.png
og-image.png
wordmark-light.svg
wordmark.svg

(10 entries)
</entries>
gateway · 2026-09-08 22:49:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public/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:49:34
result
../../../packages/cli/install
gateway · 2026-09-08 22:50:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 = ...
gateway · 2026-09-08 22:51:46
result
StatusCode: non 2xx status code (403 GET https://ghcr.io/token?scope=repository:getsentry/toolkit:pull)
gateway · 2026-09-08 22:52:24
result
Found 11 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts:
  Line 83:   /** CLI upgrade failed */

  Line 586: export type UpgradeErrorReason =

  Line 597:  * @param reason - Type of upgrade failure

  Line 600: export class UpgradeError extends CliError {

  Line 613:         "Cannot upgrade offline — no pre-downloaded update is available.",

  Line 666:         no_budget: `To use Seer features, upgrade your plan:\n  ${buildBillingUrl(this.orgSlug, "seer")}${trialHint}`,

  Line 676:       no_budget: `To use Seer features, upgrade your plan in your organization's billing settings.${trialHint}`,

  Line 820:  * `classifySilenced` (Sentry capture), {@link isUserError} (upgrade nudge), and

  Line 848:  *   bug" upgrade nudge) instead of a raw "400 Bad Request".

  Line 895:  * user error (no upgrade nudge) and is not reported to Sentry — the same

  Line 910:  * settings. ...
gateway · 2026-09-08 22:52:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:53:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, sep } 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:   getLegacyInstallDirs,
29:   getPlatformBinaryName,
30:   installBinary,
31:   ...
gateway · 2026-09-08 22:53:21
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json:
  Line 17:     "noUncheckedIndexedAccess": true,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/codemods/sentry-v3-to-v4/tsconfig.json:
  Line 15:     "noUncheckedIndexedAccess": true
gateway · 2026-09-08 22:53:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json</path>
<type>file</type>
<content>
1: {
2:   "compilerOptions": {
3:     "lib": ["ESNext"],
4:     "target": "ESNext",
5:     "module": "ESNext",
6:     "jsx": "react-jsx",
7:     "moduleDetection": "force",
8:     "allowJs": true,
9:     "moduleResolution": "bundler",
10:     "allowImportingTsExtensions": true,
11:     "verbatimModuleSyntax": true,
12:     "noEmit": true,
13:     "resolveJsonModule": true,
14:     "strict": true,
15:     "skipLibCheck": true,
16:     "noFallthroughCasesInSwitch": true,
17:     "noUncheckedIndexedAccess": true,
18:     "noImplicitOverride": true,
19:     "esModuleInterop": true,
20:     "forceConsistentCasingInFileNames": true,
21:     "noUnusedLocals": false,
22:     "noUnusedParameters": false,
23:     "noPropertyAccessFromIndexSignature": false,
24:     "strictNullChecks": true
25:   },
26:   "include": ...
gateway · 2026-09-08 22:54:21
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 17:   compareVersions,

  Line 47: const VERSION_PREFIX_RE = /^v/;

  Line 436:     const version = r.tag_name.replace(VERSION_PREFIX_RE, "");

  Line 438:       compareVersions(version, fromVersion) === 1 &&

  Line 439:       compareVersions(version, toVersion) <= 0
gateway · 2026-09-08 22:54:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
400:       sectionsByCategory.set(section.category, existing);
401:     }
402:   }
403: 
404:   // Build merged sections in display order
405:   const merged: ChangeSection[] = [];
406:   for (const category of CATEGORY_ORDER) {
407:     const markdowns = sectionsByCategory.get(category);
408:     if (markdowns && markdowns.length > 0) {
409:       merged.push({ category, markdown: markdowns.join("\n") });
410:     }
411:   }
412: 
413:   return merged;
414: }
415: 
416: /**
417:  * Build a changelog summary from a list of GitHub releases.
418:  *
419:  * Filters releases within the version range (exclusive `fromVersion`,
420:  * inclusive `toVersion`), extracts and merges sections by category, and
421:  * optionally truncates to fit terminal constraints. ...
gateway · 2026-09-08 22:54:50
result
Found 17 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 216: export function abortPendingVersionCheck(): void {

  Line 357: function getUpdateNotificationWithCopy(

  Line 450: export function maybeCheckForUpdateInBackground(): void {

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

  Line 465:   return getUpdateNotificationWithCopy(formatStandardUpdateNotification);

  Line 474:  * Shares the same gates as {@link getUpdateNotification} (TTY, rate-limit,

  Line 489:     return getUpdateNotification();

  Line 495:   return getUpdateNotificationWithCopy(formatContextualUpdateNotification);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/db/version-check.ts:
  Line 53:  * Called from `getUpdateNotification()` so repeat CLI invocations ...
gateway · 2026-09-08 22:55:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/cli.ts</path>
<type>file</type>
<content>
600: 
601:   // Clean up old binary from previous Windows upgrade (no-op if file doesn't exist)
602:   startCleanupOldBinary();
603: 
604:   // Apply SENTRY_LOG_LEVEL env var early (lazy read, not at module load time).
605:   // CLI flags (--log-level, --verbose) are handled by Stricli via
606:   // buildCommand and take priority when present.
607:   const envLogLevel = getEnvLogLevel();
608:   if (envLogLevel !== null) {
609:     setLogLevel(envLogLevel);
610:   }
611: 
612:   // `shouldSuppressNotification` scans for `--version`/`--json` and the
613:   // `cli setup`/`cli fix` subcommands at any position, skipping interleaved
614:   // global flags — so it works on the raw args even though global flags may
615:   // precede the subcommand. ...
gateway · 2026-09-08 22:55:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: import { UPGRADE_SOURCES } from "../../src/lib/binary.js";
21: 
22: function noop(): void {
23:   // Intentionally empty — absorbs async spawn errors
24: }
25: 
26: const repoRoot = join(import.meta.dirname, "..", "..");
27: const installScript = join(repoRoot, ...
gateway · 2026-09-08 22:55:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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": ">=20.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 ...
gateway · 2026-09-08 22:55:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
547: describe("versionExists", () => {
548:   test("checks GitHub for curl method - version exists", async () => {
549:     mockFetch(async () => new Response(null, { status: 200 }));
550: 
551:     const exists = await versionExists("curl", "1.0.0");
552:     expect(exists).toBe(true);
553:   });
554: 
555:   test("checks GitHub for curl method - version does not exist", async () => {
556:     mockFetch(async () => new Response(null, { status: 404 }));
557: 
558:     const exists = await versionExists("curl", "99.99.99");
559:     expect(exists).toBe(false);
560:   });
561: 
562:   test("checks npm for npm method - version exists", async () => {
563:     mockFetch(async () => new Response(null, { status: 200 }));
564: 
565:     const exists = await versionExists("npm", "1.0.0");
566:     ...
gateway · 2026-09-08 22:56:03
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 { UPGRADE_SOURCES } from "../../src/lib/binary.js";
11: import {
12:   downloadLayerBlob,
13:   downloadNightlyBlob,
14:   fetchManifest,
15:   fetchNightlyManifest,
16:   findLayerByFilename,
17:   GHCR_REPO,
18:   GHCR_TAG,
19:   getAnonymousToken,
20:   getNightlyVersion,
21:   listTags,
22:   type OciManifest,
23: } from "../../src/lib/ghcr.js";
24: 
25: /** Store original fetch for restoration */
26: let originalFetch: typeof globalThis.fetch;
27: 
28: /** Helper to mock fetch ...
gateway · 2026-09-08 22:57:24
result
StatusCode: non 2xx status code (404 GET https://api.github.com/repos/BYK/binpatch/git/trees/v0.4.2?recursive=1)
gateway · 2026-09-08 22:57:47
result
{
  "sha": "9ba6bbb8227fcbd2521852d2311c82afac5e9573",
  "url": "https://api.github.com/repos/BYK/binpatch/git/trees/9ba6bbb8227fcbd2521852d2311c82afac5e9573",
  "tree": [
    {
      "path": ".craft.yml",
      "mode": "100644",
      "type": "blob",
      "sha": "36f34fdd754de842419fe5a5cb2844a8c98f80df",
      "size": 1143,
      "url": "https://api.github.com/repos/BYK/binpatch/git/blobs/36f34fdd754de842419fe5a5cb2844a8c98f80df"
    },
    {
      "path": ".github",
      "mode": "040000",
      "type": "tree",
      "sha": "dc6a71d7d4d393c0e072cb45ac745fc2a61f60ef",
      "url": "https://api.github.com/repos/BYK/binpatch/git/trees/dc6a71d7d4d393c0e072cb45ac745fc2a61f60ef"
    },
    {
      "path": ".github/workflows",
      "mode": "040000",
      "type": "tree",
      "sha": "da820a4798f068f6531c69b3544f97601baa4cfa",
      "url": "https://api.github.com/repos/BYK/binpatch/git/trees/da820a4798f068f6531c69b3544f97601baa4cfa"
    },
    {
      "path": ...
gateway · 2026-09-08 22:58:01
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:58:16
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:58:22
result
/**
 * GHCR / OCI patch source (the "nightly" channel).
 *
 * Resolves a patch chain from OCI patch-manifest tags. Patches are published
 * under `<patchTagPrefix><version>` tags whose manifests carry:
 * - annotation `from-version=<prev>` — the chain back-pointer
 * - annotation `sha256-<binaryName>=<hex>` — the target's uncompressed SHA-256
 * - a patch layer whose title is `<binaryName>.patch`
 *
 * The target binary's gzipped size (for the ratio gate) is read from the
 * target's own image manifest (its `<binaryName>.gz` layer). All product
 * specifics — registry, repo, user-agent, binary name, the version→target-tag
 * scheme, and version comparison — are injected. Generalized from Lore's
 * nightly-channel resolver.
 */

import {
  type InstrumentHook,
  MAX_NIGHTLY_CHAIN_DEPTH,
  PATCH_TAG_PREFIX,
  type PatchChain,
  type PatchLink,
  SIZE_THRESHOLD_RATIO,
} from "../contract";
import type { SourceStrategy, UnavailableReporter } from "../discover";
import { BinpatchError } ...
gateway · 2026-09-08 22:58:44
result
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
0e661a5f5 (HEAD -> feat/toolkit-bridge-upgrade, origin/main, origin/HEAD) fix(org): log region URL parse failures in org list (#1539)
gateway · 2026-09-08 22:58:53
result
src/lib/binary.ts(236,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
src/lib/binary.ts(244,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
gateway · 2026-09-08 22:59:26
result
No files found
gateway · 2026-09-08 22:59:34
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 720: export async function fetchChangelog(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 834:   return fetchChangelog({
gateway · 2026-09-08 22:59:46
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
760:   test("runs setup on downloaded binary after curl upgrade", async () => {
761:     mockBinaryDownloadWithVersion("99.99.99");
762: 
763:     const { context, getOutput, restore } = createMockContext({
764:       homeDir: testDir,
765:     });
766:     restoreStderr = restore;
767: 
768:     await run(app, ["cli", "upgrade", "--method", "curl"], context);
769: 
770:     const combined = getOutput();
771:     // Spinner progress messages written to stdout
772:     expect(combined).toContain("Checking for updates");
773:     expect(combined).toContain("Downloading 99.99.99");
774:     expect(combined).toContain("Upgraded to");
775:     expect(combined).toContain("99.99.99");
776: 
777:     // Verify child_process.spawn was called with the downloaded binary + setup args
778:     ...
gateway · 2026-09-08 22:59:54
result
No files found
gateway · 2026-09-08 23:00:08
result
No files found
gateway · 2026-09-08 23:00:16
result
No files found
gateway · 2026-09-08 23:00:27
result
Found 13 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/cleanup-nightlies.yml:
  Line 34:           REPO="ghcr.io/getsentry/cli"

  Line 36:           # List all nightly-* tags sorted by version, oldest first

  Line 37:           NIGHTLY_TAGS=$(oras repo tags "${REPO}" 2>/dev/null | grep '^nightly-[0-9]' | sort -V || echo "")

  Line 53:           # Delete oldest nightly-* tags and their corresponding patch-* tags

  Line 55:             version="${tag#nightly-}"

  Line 59:             patch_tag="patch-${version}"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 62:       nightly-version: ${{ steps.nightly.outputs.version }}

  Line 353:         if: needs.changes.outputs.nightly-version != ''

  Line 356:           jq --arg v "${{ needs.changes.outputs.nightly-version }}" '.version = $v' ...
gateway · 2026-09-08 23:00:38
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:         with:
431:           name: sentry-${{ matrix.target }}-gz
432:           path: packages/cli/dist-bin/*.gz
433: 
434:   generate-patches:
435:     name: Generate Delta Patches
436:     needs: [changes, build-binary]
437:     # Only on main (nightlies) and release branches (stable) — skip PRs
438:     if: github.event_name != 'pull_request'
439:     runs-on: ubuntu-latest
440:     continue-on-error: true
441:     # `from-version`: the previous version the patches were actually generated
442:     # FROM, as computed by the binpatch action. Carried through to
443:     # publish-nightly so it stamps the `from-version` annotation on the
444:     # pushed patch manifest with the SAME value. See
445:     # ...
gateway · 2026-09-08 23:00:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/cleanup-nightlies.yml</path>
<type>file</type>
<content>
1: name: Cleanup Nightly Tags
2: 
3: on:
4:   schedule:
5:     # Every Sunday at 06:00 UTC
6:     - cron: "0 6 * * 0"
7:   workflow_dispatch:
8: 
9: permissions:
10:   packages: write
11: 
12: jobs:
13:   cleanup:
14:     name: Prune Old Nightly Tags
15:     runs-on: ubuntu-latest
16:     steps:
17:       - name: Install ORAS CLI
18:         run: |
19:           VERSION=1.2.3
20:           EXPECTED_SHA256="b4efc97a91f471f323f193ea4b4d63d8ff443ca3aab514151a30751330852827"
21:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"
22:           curl -sfLo "$TARBALL" "https://github.com/oras-project/oras/releases/download/v${VERSION}/${TARBALL}"
23:           echo "${EXPECTED_SHA256}  ${TARBALL}" | sha256sum -c -
24:           tar -xz -C /usr/local/bin oras < "$TARBALL"
25:           rm "$TARBALL"
26: ...
gateway · 2026-09-08 23:01:15
result
HTTP/2.0 404 Not Found
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset, Warning
Content-Security-Policy: default-src 'none'
Content-Type: application/json; charset=utf-8
Date: Tue, 08 Sep 2026 23:01:15 GMT
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Server: github.com
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Vary: Accept-Encoding, Accept, X-Requested-With
X-Accepted-Oauth-Scopes: repo
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Github-Api-Version-Selected: 2022-11-28
X-Github-Edge-Region: uksouth
X-Github-Media-Type: github.v3; format=json
X-Github-Request-Id: ...
gateway · 2026-09-08 23:01:50
result
Found 10 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 168:  * Mock fetch to simulate GHCR manifest returning a specific nightly version.

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

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

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

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

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

  Line 638:       mockNightlyVersion("0.99.0-dev.9999999999");

  Line 653:       expect(combined).toContain("0.99.0-dev.9999999999");

  Line 921:             annotations: { version: "0.99.0-dev.1234567890" },

  Line 1055:             annotations: { version: "0.99.0-dev.1234567890" },
gateway · 2026-09-08 23:02:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
430:       // Stricli catches errors and writes to stderr / calls exit
431:       const allOutput = getOutput() + errors.join("");
432:       expect(allOutput).toContain("Version 0.0.1 not found");
433:     });
434: 
435:     test("strips v prefix from user-specified version", async () => {
436:       mockGitHubVersion(CLI_VERSION);
437: 
438:       const { context, getOutput, restore } = createMockContext({
439:         homeDir: testDir,
440:       });
441:       restoreStderr = restore;
442: 
443:       // Pass "v<current>" — should strip prefix and match current
444:       await run(
445:         app,
446:         ["cli", "upgrade", "--method", "curl", `v${CLI_VERSION}`],
447:         context
448:       );
449: 
450:       const combined = getOutput();
451:       // Should match current ...
gateway · 2026-09-08 23:04:38
result
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
gateway · 2026-09-08 23:18:06
result
(no output)
gateway · 2026-09-08 23:18:35
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-08 23:19:10
result
Found 15 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 77: export type OfflineMode = false | "explicit" | "network-fallback";

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

  Line 399: export async function fetchLatestFromGitHub(

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

  Line 467: export async function fetchLatestNightlyVersion(

  Line 498: export function fetchLatestVersion(

  Line 522: async function nightlyVersionExists(version: string): Promise<boolean> {

  Line 551: export async function versionExists(

  Line 728: async function downloadNightlyToPath(

  Line 761: async function downloadStableToPath(

  Line 902: export async function downloadBinaryToTemp(

  Line 1007: async function downloadFullBinary(

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

  Line 1065: function ...
gateway · 2026-09-08 23:19:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-08 23:19:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
360:     return "brew";
361:   }
362: 
363:   // Check stored info (fast path for non-Homebrew installs)
364:   const stored = getInstallInfo();
365:   if (stored?.method) {
366:     return stored.method;
367:   }
368: 
369:   // Legacy detection for existing installs (pre-setup command)
370:   const legacyMethod = await detectLegacyInstallationMethod();
371: 
372:   // Auto-save detected method for future runs (best-effort —
373:   // a read-only or broken DB shouldn't block detection)
374:   if (legacyMethod !== "unknown") {
375:     try {
376:       setInstallInfo({
377:         method: legacyMethod,
378:         path: process.execPath,
379:         version: CLI_VERSION,
380:       });
381:     } catch {
382:       log.debug("Failed to persist install info (DB may be read-only)");
383:     }
384:   }
385: ...
gateway · 2026-09-08 23:19:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
700: 
701: /**
702:  * Build the gzip filename for the current platform binary.
703:  *
704:  * Nightly builds are stored in GHCR as `sentry-<os>-<arch>.gz` (or
705:  * `sentry-windows-x64.exe.gz` on Windows). This filename is the
706:  * `org.opencontainers.image.title` annotation on the matching OCI layer.
707:  *
708:  * @returns Filename of the gzip-compressed binary for this platform
709:  */
710: function getNightlyGzFilename(): string {
711:   return `${getPlatformBinaryName()}.gz`;
712: }
713: 
714: /**
715:  * Download a nightly binary from GHCR and decompress it to `destPath`.
716:  *
717:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
718:  * matching this platform's `.gz` filename, then downloads and decompresses
719:  * the blob in-stream. ...
gateway · 2026-09-08 23:20:03
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:20:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
318: /**
319:  * Download a nightly binary blob from GHCR and write it to disk.
320:  *
321:  * The blob endpoint returns a 307 redirect to a signed Azure Blob Storage URL.
322:  * `fetch` with `redirect: "follow"` would forward the Authorization header
323:  * to Azure, which returns 404. We must:
324:  * 1. Fetch the blob URL without following redirects to get the redirect URL.
325:  * 2. Follow the redirect URL without the Authorization header.
326:  *
327:  * @param token - Anonymous bearer token from {@link getAnonymousToken}
328:  * @param digest - Layer digest to download (e.g., "sha256:abc123...")
329:  * @returns Raw response body (gzip-compressed binary)
330:  * @throws {UpgradeError} On network failure or bad response
331:  */
332: export async function downloadNightlyBlob(
333:   token: string,
334:   ...
gateway · 2026-09-08 23:20:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:20:37
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
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 async function resolveNightlyChain(opts: {
279:   token: string;
280:   currentVersion: string;
281:   targetVersion: string;
282:   fullGzSize: number;
283:   preloadedTags?: string[];
284:   signal?: AbortSignal;
285: }): Promise<PatchChain | null> {
286:   const client = new OciClient({
287:     registry: "https://ghcr.io",
288:     repo: GHCR_REPO,
289:     userAgent: `sentry-cli/${CLI_VERSION}`,
290:     fetch: customFetch,
291:   });
292:   const tags =
293:     opts.preloadedTags ??
294:     (await client.listTags(opts.token, ...
gateway · 2026-09-08 23:20:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 23:21:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
200: 
201:   try {
202:     const resolved = await resolveTargetVersion(resolveOpts);
203:     if (resolved.kind === "done") {
204:       return resolved;
205:     }
206:     return { kind: "target", target: resolved.target, offline: false };
207:   } catch (error) {
208:     // Automatic offline fallback: only for curl-installed binaries (package
209:     // managers need the network for the actual install, not just version
210:     // discovery), and only for network errors (not version_not_found etc.)
211:     if (
212:       method !== "curl" ||
213:       !(error instanceof UpgradeError && error.reason === "network_error")
214:     ) {
215:       throw error;
216:     }
217:     try {
218:       const target = resolveOfflineTarget(versionArg);
219:       log.warn("Network unavailable, falling ...
gateway · 2026-09-08 23:21:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
605: /**
606:  * Execute the standard upgrade path: download via curl or package manager,
607:  * then run setup on the new binary.
608:  */
609: async function executeStandardUpgrade(opts: {
610:   method: InstallationMethod;
611:   channel: ReleaseChannel;
612:   versionArg: string | undefined;
613:   target: string;
614:   execPath: string;
615:   entryPath?: string;
616:   pathEnv?: string;
617:   offline?: OfflineMode;
618:   json?: boolean;
619:   noAgentSkills: boolean;
620: }): Promise<void> {
621:   const {
622:     method,
623:     channel,
624:     versionArg,
625:     target,
626:     execPath,
627:     entryPath,
628:     pathEnv,
629:     offline,
630:     json,
631:     noAgentSkills,
632:   } = opts;
633: 
634:   // Use the rolling "nightly" tag only when upgrading to latest ...
gateway · 2026-09-08 23:21:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
930:   },
931:   async *func(this: SentryContext, flags: UpgradeFlags, version?: string) {
932:     const { channel, versionArg, channelChanged, method } =
933:       await resolveContext(version, flags);
934: 
935:     log.debug(`Installation method: ${method}`);
936:     log.debug(`Current version: ${CLI_VERSION}`);
937: 
938:     const resolved = await withProgress(
939:       { message: "Checking for updates...", json: flags.json },
940:       async () =>
941:         resolveTargetWithFallback({
942:           resolveOpts: { method, channel, versionArg, channelChanged, flags },
943:           versionArg,
944:           offline: flags.offline,
945:           method,
946:           persistChannelFn: () =>
947:             persistChannel(channel, channelChanged, version),
948:         })
949:     ...
gateway · 2026-09-08 23:21:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 23:21:46
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
660:   const untilDate = new Date((toTs + 1) * 1000).toISOString();
661: 
662:   const url = `https://api.github.com/repos/getsentry/cli/commits?sha=main&since=${sinceDate}&until=${untilDate}&per_page=100`;
663: 
664:   let response: Response;
665:   try {
666:     response = await customFetch(url, { headers: getGitHubHeaders() });
667:   } catch {
668:     log.debug("Failed to fetch nightly commits");
669:     return null;
670:   }
671: 
672:   if (!response.ok) {
673:     log.debug(`Nightly commits API returned ${response.status}`);
674:     return null;
675:   }
676: 
677:   let commits: unknown;
678:   try {
679:     commits = await response.json();
680:   } catch (parseError) {
681:     log.debug("Non-JSON response from GitHub commits", parseError);
682:     return null;
683:   }
684:   if ...
gateway · 2026-09-08 23:21:57
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 18:   GITHUB_RELEASES_URL,

  Line 564:       `${GITHUB_RELEASES_URL}?per_page=${CHANGELOG_MAX_RELEASES}`,
gateway · 2026-09-08 23:22:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:22:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
180:   // At 0% of interval: ~0% chance
181:   // At 100% of interval: ~63% chance (1 - 1/e)
182:   // At 200% of interval: ~86% chance
183:   const probability = 1 - Math.exp(-elapsed / effectiveInterval);
184: 
185:   return Math.random() < probability;
186: }
187: 
188: /**
189:  * Check if update notifications should be suppressed for these args.
190:  */
191: export function shouldSuppressNotification(args: string[]): boolean {
192:   if (args.some((arg) => SUPPRESSED_ARGS.has(arg))) {
193:     return true;
194:   }
195:   // Suppress for "cli <subcommand>" management commands (setup, fix). ...
gateway · 2026-09-08 23:22:45
result
Found 45 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

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

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


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

  Line 34:   resolveUpgradeSource,

  Line 37:   UPGRADE_SOURCES,

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

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

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

  Line 66: describe("UPGRADE_SOURCES", () => {

  Line 68:     expect(UPGRADE_SOURCES).toEqual([

  Line 83: describe("resolveUpgradeSource", () => {

  Line 87:     const resolved = await resolveUpgradeSource(async (url) => {

  Line 95:       source: ...
gateway · 2026-09-08 23:22:56
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/cleanup-nightlies.yml:
  Line 34:           REPO="ghcr.io/getsentry/cli"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CHANGELOG.md:
  Line 8: - (sourcemap) Adopt a debug ID already present on the sourcemap by @msonnb in [#1496](https://github.com/getsentry/cli/pull/1496)

  Line 12: - (cli) Drop hijacked consoledonottrack.com link by @sentry-junior in [#1504](https://github.com/getsentry/cli/pull/1504)

  Line 16: - Regenerate docs by @github-actions[bot] in [4892858f](https://github.com/getsentry/cli/commit/4892858f3be6abcfd5eb161e54af714c296e1d4e)

  Line 24: - Add query loading feedback by @MathurAditya724 in [#1475](https://github.com/getsentry/cli/pull/1475)

  Line 25: - Add docs command suite by @MathurAditya724 in ...
gateway · 2026-09-08 23:23:18
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install:
  Line 100:     SENTRY_VERSION=nightly curl -fsSL https://cli.sentry.dev/install | bash

  Line 277:   # Stable build: resolve version and download from GitHub Releases.

  Line 280:     version=$(curl -fsSL https://api.github.com/repos/getsentry/cli/releases/latest \

  Line 292:   url="https://github.com/getsentry/cli/releases/download/${version}/${filename}"
gateway · 2026-09-08 23:23:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 23:24:18
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-08 23:24:31
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -25,269 +25,347 @@ import {
 } from "./custom-ca.js";
 import { stringifyUnknown, UpgradeError } from "./errors.js";
 import { logger } from "./logger.js";
 import { isProcessRunning } from "./process-utils.js";
 /** Known directories where the curl installer may place the binary */
 export const KNOWN_CURL_DIRS = [".local/bin", "bin", ".sentry/bin"];
 
 /**
  * Whether the current platform's filesystem is case-insensitive by default
  * (Windows, macOS). Resolved once at module load — `process.platform` never
  * changes at runtime.
  */
 const IS_CASE_INSENSITIVE_FS =
   process.platform === "win32" || process.platform === "darwin";
 
 /**
  * Legacy install directory (relative to home) that predates the XDG layout.
  * The curl installer used to drop the binary here; migration moves it out. ...
gateway · 2026-09-08 23:25:14
result
StatusCode: non 2xx status code (403 GET https://ghcr.io/token?service=ghcr.io&scope=repository:getsentry/toolkit:pull)
gateway · 2026-09-08 23:25:20
result
StatusCode: non 2xx status code (403 GET https://ghcr.io/token?scope=repository:getsentry/definitely-does-not-exist-1244:pull)
gateway · 2026-09-08 23:25:37
result
{"token":"djE6Z2V0c2VudHJ5L2NsaToxNzg4OTA5OTM3ODgxNjYzMjEz"}
gateway · 2026-09-08 23:25:45
result
0.39.0
0.22.0
0.22.0
0.22.0
0.22.0
0.22.0
0.39.0
0.38.0
0.37.0
0.36.0
0.35.0
gateway · 2026-09-08 23:25:59
result
0.22.0
0.22.0
0.22.0
0.22.0
0.22.0
0.39.0
0.38.0
0.37.0
0.36.0
0.35.0
0.34.0
0.33.0
0.32.0
0.31.0
0.30.0
0.29.0
0.28.0
0.27.0
0.26.0
0.25.0
0.24.0
0.23.1
0.23.0
0.22.0
0.21.0
0.20.0
0.19.0
0.18.0
0.17.1
0.17.0
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.8.0
0.7.1
0.7.0
0.6.0
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.1
gateway · 2026-09-08 23:26:10
result
Found 61 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/pnpm-lock.yaml:
  Line 867:   '@hono/mcp@0.2.5':

  Line 1548:   '@sentry/cli@2.58.6':

  Line 4207:   trpc-cli@0.12.4:

  Line 5355:   '@hono/mcp@0.2.5(@modelcontextprotocol/sdk@1.29.0(zod@4.4.3))(hono-rate-limiter@0.4.2(hono@4.12.34))(hono@4.12.34)(zod@4.4.3)':

  Line 6000:   '@sentry/cli@2.58.6':

  Line 9255:   trpc-cli@0.12.4(@trpc/server@11.18.0(typescript@5.9.3))(valibot@1.4.2(typescript@5.9.3))(zod@4.4.3):


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CHANGELOG.md:
  Line 270: - (upgrade) Adopt BYK/binpatch action for delta patch generation/publish by @BYK in [#1330](https://github.com/getsentry/cli/pull/1330)

  Line 1749: - Correct nightly artifact path in publish-nightly job by @BYK in [#295](https://github.com/getsentry/cli/pull/295)

  Line 2152: - (ci) Correct gh-pages.zip structure for ...
gateway · 2026-09-08 23:27:07
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Sequence\n\nImport the pre-shaped CLI into **`getsentry/sentry-mcp` under its current repository name**. Validate the complete monorepo and production deployment paths there. Rename the repository to `getsentry/toolkit` only after those gates pass.\n\nThis preserves history and lets GitHub, Vercel, Cloudflare, branch protections, and repository integrations continue operating under the known repository identity throughout integration.\n\n## Hard prerequisites\n\n- [x] CLI pre-shape merged: getsentry/cli#1254.\n- [ ] Bridge CLI release completed and verified: getsentry/cli#1244.\n- [ ] Create a dedicated integration branch from current `getsentry/sentry-mcp` `main`. Do not import directly into `main`.\n\n## History-preserving import\n\n- [ ] From the bridge-release commit on `getsentry/cli`, produce two immutable `git filter-repo` refs:\n  - `import/cli` — history containing only `packages/cli/**`\n  - ...
gateway · 2026-09-08 23:27:37
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-08 23:27:45
result
File not found: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CONTRIBUTING.md
gateway · 2026-09-08 23:27:54
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/content/docs/contributing.md
gateway · 2026-09-08 23:28:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-08 23:28:16
result
File not found: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.cursor/rules/ultracite.mdc
gateway · 2026-09-08 23:28:26
result
No files found
gateway · 2026-09-08 23:29:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, sep } 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:   getLegacyInstallDirs,
29:   getPlatformBinaryName,
30:   installBinary,
31:   ...
gateway · 2026-09-08 23:29:57
result
No files found
gateway · 2026-09-08 23:30:15
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/pnpm-lock.yaml:
  Line 2169:   binpatch@0.4.2:

  Line 6698:   binpatch@0.4.2: {}


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 111:     "binpatch": "^0.4.2",
gateway · 2026-09-08 23:30:27
result
No files found
gateway · 2026-09-08 23:30:36
result
No files found
gateway · 2026-09-08 23:30:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.45.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:31:13
result
{"bugs":{"url":"https://github.com/BYK/binpatch/issues"},"dist":{"shasum":"48c635e950ded2c620fc932fe1a44e2fdad2d68d","tarball":"https://registry.npmjs.org/binpatch/-/binpatch-0.4.2.tgz","fileCount":6,"integrity":"sha512-aShVdFVzDrqVRlyhDQabzKV6b9suWegARr0IPTer58eNQoo1KqpuCr+VtbwwuirmfXqmWuuxsoZlXJN1tTZBcw==","signatures":[{"sig":"MEUCIQD7P6no2s3UpvTTLw+cyPpgh91Zocgt00IrBp0xnZSKpgIgBKh83uJhzQSZzVKLcSOC5ub2vuveBDMYMq9NQ0yU5S8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/binpatch@0.4.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":206575},"main":"./dist/index.js","name":"binpatch","type":"module","_from":"file:/tmp/craft-cY6qx5/binpatch-0.4.2.tgz","types":"./dist/index.d.ts","author":{"name":"BYK"},"engines":{"node":">=22.15.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"license":"MIT","scripts":{"test":"vitest ...
gateway · 2026-09-08 23:31:38
result
0.4.2
0.4.1
0.4.0
gateway · 2026-09-08 23:31:48
result
/**
 * binpatch — reusable binary delta-update engine.
 *
 * Two things, joined by one wire contract (see README):
 * - **apply core** — parse + apply a TRDIFF10/bsdiff patch chain to a binary.
 * - **discovery** — resolve a patch chain from a pluggable `SourceStrategy`
 *   (OCI/GHCR tags or GitHub Release assets), then apply + verify it.
 *
 * Pure Node (`node:*` builtins only), zero product coupling — the consumer
 * injects the cache directory, the download source, version comparison,
 * progress handling, and telemetry.
 */

export {
  addDiffChunk,
  applyPatch,
  applyPatchChainInMemory,
  applyPatchToMemory,
  MAX_OUTPUT_SIZE,
  offtin,
  parsePatchHeader,
  type PatchHeader,
} from "./bspatch";

export {
  type ChainMeta,
  chainFileName,
  makeCache,
  type PatchCache,
  patchFileName,
  type PatchStepMeta,
} from "./patch-cache";

// Wire-contract constants + shared chain types. ...
gateway · 2026-09-08 23:31:59
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 23:32:16
result
Found 21 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 237:       await prefetchNightlyPatches(latestVersion, signal);

  Line 239:       await prefetchStablePatches(latestVersion, signal);

  Line 286:             ? await fetchLatestNightlyVersion(signal)

  Line 287:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 399: export async function fetchLatestFromGitHub(

  Line 467: export async function fetchLatestNightlyVersion(

  Line 503:     return fetchLatestNightlyVersion();

  Line 506:     ? ...
gateway · 2026-09-08 23:32:29
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 6:  * The `executeUpgrade` and `detectInstallationMethod` subprocess tests use

  Line 120:   getBinaryDownloadUrl,

  Line 135:   downloadBinaryToTemp,

  Line 136:   executeUpgrade,

  Line 137:   fetchLatestFromGitHub,

  Line 139:   fetchLatestNightlyVersion,

  Line 144:   versionExists,

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

  Line 205:     const version = await fetchLatestFromGitHub();

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

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

  Line 265:     ...
gateway · 2026-09-08 23:32:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
170:     expect(parseInstallationMethod("brew")).toBe("brew");
171:     expect(parseInstallationMethod("npm")).toBe("npm");
172:     expect(parseInstallationMethod("pnpm")).toBe("pnpm");
173:     expect(parseInstallationMethod("bun")).toBe("bun");
174:     expect(parseInstallationMethod("yarn")).toBe("yarn");
175:   });
176: 
177:   test("parses case-insensitively", () => {
178:     expect(parseInstallationMethod("NPM")).toBe("npm");
179:     expect(parseInstallationMethod("Curl")).toBe("curl");
180:     expect(parseInstallationMethod("YARN")).toBe("yarn");
181:   });
182: 
183:   test("throws on invalid method", () => {
184:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
185:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
186:     ...
gateway · 2026-09-08 23:32:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1490:   // cleanup is handled inside the upgrade flow under the exclusive lock.
1491: 
1492:   test("does not throw if files do not exist", () => {
1493:     // Ensure files don't exist by attempting cleanup first
1494:     startCleanupOldBinary();
1495: 
1496:     // Should not throw when called again
1497:     expect(() => startCleanupOldBinary()).not.toThrow();
1498:   });
1499: });
1500: 
1501: describe("isNightlyVersion", () => {
1502:   test("returns true for nightly version strings", () => {
1503:     expect(isNightlyVersion("0.0.0-dev.1740000000")).toBe(true);
1504:     expect(isNightlyVersion("0.0.0-dev.1")).toBe(true);
1505:   });
1506: 
1507:   test("returns false for stable version strings", () => {
1508:     expect(isNightlyVersion("1.0.0")).toBe(false);
1509:     ...
gateway · 2026-09-08 23:33:14
result
Found 24 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 171: function mockGhcrNightlyVersion(version: string): void {

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

  Line 213:     if (urlStr.includes("releases/latest")) {

  Line 251: function mockNightlyVersion(version: string): void {

  Line 294:       mockGitHubVersion(CLI_VERSION);

  Line 314:       mockGitHubVersion("99.99.99");

  Line 333:       mockGitHubVersion("99.99.99");

  Line 356:       mockGitHubVersion(CLI_VERSION);

  Line 388:       mockGitHubVersion("99.99.99");

  Line 413:         if (urlStr.includes("releases/latest")) {

  Line 436:       mockGitHubVersion(CLI_VERSION);

  Line 460:       mockGhcrNightlyVersion(nightlyVersion);

  Line 481:       mockGhcrNightlyVersion(nightlyVersion);

  Line 525:       mockNightlyVersion(CLI_VERSION);

  Line 543:       ...
gateway · 2026-09-08 23:33:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
130:       exitCode: 0,
131:     },
132:     homeDir: overrides.homeDir ?? "/tmp/test-home",
133:     cwd: "/tmp",
134:     configDir: "/tmp/test-config",
135:     env,
136:     stdout: stdoutWriter,
137:     stderr: {
138:       write: (s: string) => {
139:         errors.push(s);
140:         return true;
141:       },
142:     },
143:     stdin: process.stdin,
144:     setFlags: () => {
145:       // no-op for tests
146:     },
147:   } as unknown as SentryContext;
148: 
149:   return {
150:     context,
151:     // Combine stderr (progress) and stdout (rendered result) so assertions
152:     // work regardless of which stream a message goes to
153:     getOutput: () => stderrChunks.join("") + stdoutChunks.join(""),
154:     errors,
155:     restore: () => {
156:       process.stderr.write = ...
gateway · 2026-09-08 23:34:00
result
# Merging `getsentry/cli` + `getsentry/sentry-mcp` into `getsentry/toolkit`

Migration plan, cost/benefit analysis, and long-term recommendation.

## TL;DR recommendation

**Do the merge by RENAMING `getsentry/sentry-mcp` -> `getsentry/toolkit`** (a
pnpm-workspace monorepo, no Turbo), and `git subtree`-importing the CLI into it.
_Revised from an earlier "fresh third repo" plan: MCP is a production service with
extensive GitHub secrets/environments/App-installs/Cloudflare wiring — renaming
preserves ALL of that config, which recreating in a fresh repo would put at risk._
Adopt the MCP repo's existing monorepo skeleton (it is already a pnpm workspace +
Biome + ast-grep + vitest + Craft setup — the CLI is not), but **drop Turbo** in
favor of pnpm's native workspace primitives (task ordering derived automatically
from `workspace:` deps — no hand-maintained task graph).
Ship the two products with **independent, prefixed releases** (`cli@x.y.z`,
`mcp@x.y.z`). ...
gateway · 2026-09-08 23:37:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, isAbsolute, join, resolve, sep } 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, ...
gateway · 2026-09-08 23:38:08
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json:
  Line 14:     "strict": true,

  Line 17:     "noUncheckedIndexedAccess": true,

  Line 24:     "strictNullChecks": true


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/init-eval/templates/sveltekit-app/tsconfig.json:
  Line 12: 		"strict": true,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/init-eval/templates/express-app/tsconfig.json:
  Line 8:     "strict": true,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/init-eval/templates/react-vite-app/tsconfig.json:
  Line 13:     "strict": ...
gateway · 2026-09-08 23:38:23
result
src/lib/binary.ts(236,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
src/lib/binary.ts(244,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
gateway · 2026-09-08 23:39:37
result
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
diff --git a/packages/cli/test/lib/install-script.test.ts b/packages/cli/test/lib/install-script.test.ts
index b1f22bbab..7e1aef4f3 100644
--- a/packages/cli/test/lib/install-script.test.ts
+++ b/packages/cli/test/lib/install-script.test.ts
@@ -17,6 +17,7 @@ import {
 import { tmpdir } from "node:os";
 import { join } from "node:path";
 import { afterEach, beforeEach, describe, expect, test } from "vitest";
+import { UPGRADE_SOURCES } from "../../src/lib/binary.js";
 
 function noop(): void {
   // ...
gateway · 2026-09-08 23:40:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:40:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
416: /** Page size for tag listing pagination */
417: const TAGS_PAGE_SIZE = 100;
418: 
419: /**
420:  * Fetch a single page of tags from the GHCR registry.
421:  *
422:  * @param token - Bearer token for authentication
423:  * @param lastTag - Last tag from previous page (for pagination), or undefined for the first page
424:  * @returns Array of tag strings for this page
425:  * @throws {UpgradeError} On network failure
426:  */
427: async function fetchTagPage(
428:   token: string,
429:   lastTag?: string,
430:   signal?: AbortSignal
431: ): Promise<string[]> {
432:   let url = `${GHCR_REGISTRY}/v2/${GHCR_REPO}/tags/list?n=${TAGS_PAGE_SIZE}`;
433:   if (lastTag) {
434:     url += `&last=${encodeURIComponent(lastTag)}`;
435:   }
436: 
437:   const response = await fetchWithRetry(
438:     url,
439:     {
440:   ...
gateway · 2026-09-08 23:41:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-08 23:41:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
700: 
701: /**
702:  * Build the gzip filename for the current platform binary.
703:  *
704:  * Nightly builds are stored in GHCR as `sentry-<os>-<arch>.gz` (or
705:  * `sentry-windows-x64.exe.gz` on Windows). This filename is the
706:  * `org.opencontainers.image.title` annotation on the matching OCI layer.
707:  *
708:  * @returns Filename of the gzip-compressed binary for this platform
709:  */
710: function getNightlyGzFilename(): string {
711:   return `${getPlatformBinaryName()}.gz`;
712: }
713: 
714: /**
715:  * Download a nightly binary from GHCR and decompress it to `destPath`.
716:  *
717:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
718:  * matching this platform's `.gz` filename, then downloads and decompresses
719:  * the blob in-stream. ...
gateway · 2026-09-08 23:41:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:42:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:         - 'vercel'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: vercel
20:     projectId: prj_wVkOnIwI3eIQbGD1Gw7qS1MqFFIK
21:   - name: registry
22:     apps:
23:       'app:sentry':
24:         name: 'Sentry CLI'
25:         packageUrl: 'https://www.npmjs.com/package/sentry'
26:         mainDocsUrl: 'https://cli.sentry.dev'
27:         urlTemplate: ...
gateway · 2026-09-08 23:42:43
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 554:  * Uses a higher `per_page` than `fetchRecentReleases()` in delta-upgrade

  Line 720: export async function fetchChangelog(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 834:   return fetchChangelog({
gateway · 2026-09-08 23:42:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-08 23:42:57
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 819: describe("fetchRecentReleases", () => {

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

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

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

  Line 1838: describe("prefetchStablePatches", () => {
gateway · 2026-09-08 23:43:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts</path>
<type>file</type>
<content>
780:       makeLayer(PATCH_LAYER_NAME, 500),
781:     ]);
782:     const result = validateChainStep(manifest, {
783:       expectedFrom: "0.0.9",
784:       patchLayerName: PATCH_LAYER_NAME,
785:       sizeLimit: 100_000,
786:     });
787:     expect(result).toEqual({
788:       ok: true,
789:       digest: `sha256:${PATCH_LAYER_NAME.replace(/\W/g, "")}`,
790:       size: 500,
791:     });
792:   });
793: });
794: 
795: // ===================================================================
796: // Async functions (fetch-mocked)
797: // ===================================================================
798: 
799: /** Helper to mock globalThis.fetch */
800: function mockFetch(
801:   fn: (url: string | URL | Request, init?: RequestInit) => Promise<Response>
802: ): void {
803:   globalThis.fetch = ...
gateway · 2026-09-08 23:43:21
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-stale-references.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-patches.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-no-deps.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-fragments.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-error-patterns.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-env-coverage.ts
gateway · 2026-09-08 23:43:31
result
Found 12 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 72:               - 'packages/cli/package.json'

  Line 87:               - 'packages/cli/package.json'

  Line 126:           CURRENT=$(jq -r .version packages/cli/package.json)

  Line 188:         run: pnpm run check:fragments

  Line 244:       - run: pnpm run check:deps

  Line 245:       - run: pnpm run check:errors

  Line 246:       - run: pnpm run check:patches

  Line 247:       - run: pnpm run check:stale-refs

  Line 352:         # package.json before the build so it gets baked into the binary.

  Line 356:           jq --arg v "${{ needs.changes.outputs.nightly-version }}" '.version = $v' packages/cli/package.json > packages/cli/package.json.tmp

  Line 357:           mv packages/cli/package.json.tmp packages/cli/package.json

  Line 765:         run: echo "version=$(node -p ...
gateway · 2026-09-08 23:43:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
35:   # ${{ env.NODE_VERSION_xx }}). Node 24.17.0 / 22.23.0 (CVE-2026-48931's
36:   # http.Agent fix) added a `data` listener on idle agent sockets that makes
37:   # keep-alive fetch reuse throw false ERR_STREAM_PREMATURE_CLOSE
38:   # ("Premature close" — hit by the skill-eval planner talking to external
39:   # APIs). Fixed in 24.18.0 / 22.23.1 (nodejs/node#64004). A floating major
40:   # ("24"/"22") silently reuses the runner's pre-cached buggy patch, so pin the
41:   # exact patched versions here and bump them in one place.
42:   #
43:   # Node 20 is the WASM-SQLite floor: the npm package supports Node >= 18, and
44:   # on < 22.15 (which lacks node:sqlite) it falls back to the bundled
45:   # node-sqlite3-wasm driver. ...
gateway · 2026-09-08 23:43:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
220:   lint:
221:     name: Lint & Typecheck
222:     needs: [changes]
223:     if: needs.changes.outputs.code == 'true'
224:     runs-on: ubuntu-latest
225:     steps:
226:       - uses: actions/checkout@v6
227:       - uses: pnpm/action-setup@v4
228:       - uses: actions/setup-node@v6
229:         with:
230:           node-version: ${{ env.NODE_VERSION_22 }}
231:       - uses: actions/cache@v5
232:         id: cache
233:         with:
234:           path: |
235:             node_modules
236:             packages/*/node_modules
237:             apps/*/node_modules
238:           key: node-modules-${{ hashFiles('pnpm-lock.yaml', '.npmrc', 'packages/cli/patches/**') }}
239:       - if: steps.cache.outputs.cache-hit != 'true'
240:         run: pnpm install --frozen-lockfile
241:       - run: pnpm run ...
gateway · 2026-09-08 23:47:45
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/generate-skill.ts:
  Line 311: curl https://cli.sentry.dev/install -fsS | bash


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/bundle.ts:
  Line 357: {let v=process.versions.node.split(".").map(Number);if(v[0]<18){console.error("Error: sentry requires Node.js 18 or later (found "+process.version+").\\n\\nEither upgrade Node.js, or install the standalone binary instead:\\n  curl -fsSL https://cli.sentry.dev/install | bash\\n");process.exit(1)}}
gateway · 2026-09-08 23:47:54
result
Found 28 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CHANGELOG.md:
  Line 592: - (upgrade) Resolve symlinks before self-copy guard in installBinary by @sergical in [#1046](https://github.com/getsentry/cli/pull/1046)


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.craft.yml:
  Line 68:         def install

  Line 72:         def post_install


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 2079:     // vitest's node_modules path as an npm install


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/fragments/commands/cli.md:
  Line 159: ### Uninstall

  Line 169: sentry cli ...
gateway · 2026-09-08 23:48:08
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public/wordmark.svg
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public/wordmark-light.svg
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public/og-image.png
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public/og-image-twitter.png
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public/glyph.svg
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public/favicon.svg
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public/favicon.png
/home/byk/.local/s...
gateway · 2026-09-08 23:48:17
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install
gateway · 2026-09-08 23:48:25
result
No files found
gateway · 2026-09-08 23:49:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public</path>
<type>directory</type>
<entries>
.well-known/
CNAME
favicon.png
favicon.svg
glyph.svg
install
og-image-twitter.png
og-image.png
wordmark-light.svg
wordmark.svg

(10 entries)
</entries>
gateway · 2026-09-08 23:49:27
result
120000 c6850ca5ea9254ff1b25a1850d31de63cec527f6 0	apps/cli-docs/public/install
100755 e05cef2018d3fb6ddde9dcc1a4d7c47c0db3b3da 0	packages/cli/install
regular file 'packages/cli/install'
symbolic link 'apps/cli-docs/public/install' -> '../../../packages/cli/install'
gateway · 2026-09-08 23:49:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 23:49:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 { UPGRADE_SOURCES } from "../../src/lib/binary.js";
11: import {
12:   downloadLayerBlob,
13:   downloadNightlyBlob,
14:   fetchManifest,
15:   fetchNightlyManifest,
16:   findLayerByFilename,
17:   GHCR_REPO,
18:   GHCR_TAG,
19:   getAnonymousToken,
20:   getNightlyVersion,
21:   listTags,
22:   type OciManifest,
23: } from "../../src/lib/ghcr.js";
24: 
25: /** Store original fetch for restoration */
26: let originalFetch: typeof globalThis.fetch;
27: 
28: /** Helper to mock fetch ...
gateway · 2026-09-08 23:50:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-08 23:50:17
result
File not found: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CONTRIBUTING.md
gateway · 2026-09-08 23:50:25
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/content/docs/contributing.md
gateway · 2026-09-08 23:50:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-08 23:50:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:01a02357-f0a8-7fdb-9e9d-b0710cfe65c9 -->
8: * **API output binary and HTTP contracts**: Always preserve strict output-mode and binary-safety contracts. `sentry api` must preserve `rawApiRequest()` status text; empty textual non-2xx bodies must produce an HTTP status/request fallback, and JSON mode must expose `{status, statusText, body}` so empty success and error responses are distinguishable. Binary `Uint8Array` successes bypass formatters and remain raw; binary errors emit only status/content-type/byte-count summaries, never bytes or JSON coercion. Prompts must never block scripted runs or interleave with stdout JSON.
9: 
10: <!-- ...
gateway · 2026-09-08 23:50:59
result
Found 45 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

  Line 30:   getBinaryDownloadUrl,

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

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

  Line 766:   const url = getBinaryDownloadUrl(version);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 116: export const UPGRADE_SOURCES: readonly UpgradeSource[] = [

  Line 130: export const PRIMARY_UPGRADE_SOURCE = UPGRADE_SOURCES[0];

  Line 234: export function getBinaryDownloadUrl(

  Line 236:   source: UpgradeSource = PRIMARY_UPGRADE_SOURCE

  Line 243: export function getGitHubReleasesUrl(

  Line 244:   source: UpgradeSource = PRIMARY_UPGRADE_SOURCE

  Line 250: export const GITHUB_RELEASES_URL = getGitHubReleasesUrl();

  Line 267: export async ...
gateway · 2026-09-08 23:51:26
result
Found 74 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 32:   getReleaseChannel,

  Line 33:   type ReleaseChannel,

  Line 34:   setReleaseChannel,

  Line 45:   fetchChangelog,

  Line 50:   executeUpgrade,

  Line 51:   fetchLatestVersion,

  Line 58:   versionExists,

  Line 87:   /** Whether the upgrade was performed offline (from cache) */

  Line 88:   offline?: boolean;

  Line 91:   /** Changelog summary for the version range. Absent for offline or on fetch failure. */

  Line 98:   readonly offline: boolean;

  Line 114:   channel: ReleaseChannel;

  Line 128:     channel: getReleaseChannel(),

  Line 135:  * fetching from the network. Used by `--offline` and as automatic

  Line 136:  * fallback when `fetchLatestVersion()` hits a network error.

  Line 158:  * the local cache when offline or when the network is unavailable. ...
gateway · 2026-09-08 23:51:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
100:   readonly method?: InstallationMethod;
101:   /** Injected by buildCommand output wrapper — suppresses spinners */
102:   readonly json?: boolean;
103: };
104: 
105: /**
106:  * Resolve effective channel and version arg from the positional `version`
107:  * parameter. "nightly" and "stable" are treated as channel selectors, not
108:  * literal version strings.
109:  *
110:  * @returns `{ channel, versionArg }` where versionArg is undefined when the
111:  *   positional was a channel name (so we resolve to latest) or was omitted. ...
gateway · 2026-09-08 23:51:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
600:     return xdgInstallDir;
601:   }
602:   return currentInstallDir;
603: }
604: 
605: /**
606:  * Execute the standard upgrade path: download via curl or package manager,
607:  * then run setup on the new binary.
608:  */
609: async function executeStandardUpgrade(opts: {
610:   method: InstallationMethod;
611:   channel: ReleaseChannel;
612:   versionArg: string | undefined;
613:   target: string;
614:   execPath: string;
615:   entryPath?: string;
616:   pathEnv?: string;
617:   offline?: OfflineMode;
618:   json?: boolean;
619:   noAgentSkills: boolean;
620: }): Promise<void> {
621:   const {
622:     method,
623:     channel,
624:     versionArg,
625:     target,
626:     execPath,
627:     entryPath,
628:     pathEnv,
629:     offline,
630:     json,
631:     noAgentSkills,
632:   } = ...
gateway · 2026-09-08 23:52:10
result
No files found
gateway · 2026-09-08 23:52:54
result
No files found
gateway · 2026-09-08 23:53:03
result
No files found
gateway · 2026-09-08 23:53:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.45.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:53:28
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 5:  * or conventional commit messages (nightly). Uses `marked.lexer()` for

  Line 18:   GITHUB_RELEASES_URL,

  Line 40: /** Matches nightly version format: X.Y.Z-dev.<unix-seconds> */

  Line 340:  * Shared by both the stable (GitHub Releases) and nightly (commit log)

  Line 436:     const version = r.tag_name.replace(VERSION_PREFIX_RE, "");

  Line 466:  * Extract the unix timestamp from a nightly version string.

  Line 470:  * @returns Unix timestamp in seconds, or null if not a nightly version

  Line 549: const CHANGELOG_MAX_RELEASES = 30;

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

  Line 616:  * Build a changelog summary from nightly commit data.

  Line 631:  * Fetch changelog for a nightly upgrade using the GitHub Commits API. ...
gateway · 2026-09-08 23:53:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 23:53:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
400:       sectionsByCategory.set(section.category, existing);
401:     }
402:   }
403: 
404:   // Build merged sections in display order
405:   const merged: ChangeSection[] = [];
406:   for (const category of CATEGORY_ORDER) {
407:     const markdowns = sectionsByCategory.get(category);
408:     if (markdowns && markdowns.length > 0) {
409:       merged.push({ category, markdown: markdowns.join("\n") });
410:     }
411:   }
412: 
413:   return merged;
414: }
415: 
416: /**
417:  * Build a changelog summary from a list of GitHub releases.
418:  *
419:  * Filters releases within the version range (exclusive `fromVersion`,
420:  * inclusive `toVersion`), extracts and merges sections by category, and
421:  * optionally truncates to fit terminal constraints. ...
gateway · 2026-09-08 23:54:14
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-08 23:54:40
result
Found 37 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 42:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/src/lib/input-validation.ts:
  Line 15:  * @see https://github.com/getsentry/cli/issues/350


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 123:     githubRepo: "getsentry/cli",

  Line 124:     ghcrRepo: "getsentry/cli",

  Line 239:   return `https://github.com/${source.githubRepo}/releases/download/${tag}/${getPlatformBinaryName()}`;

  Line 246:   ...
gateway · 2026-09-08 23:54:55
result
Found 13 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 286:             ? await fetchLatestNightlyVersion(signal)

  Line 287:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 399: export async function fetchLatestFromGitHub(

  Line 467: export async function fetchLatestNightlyVersion(

  Line 503:     return fetchLatestNightlyVersion();

  Line 506:     ? fetchLatestFromGitHub()

  Line 551: export async function versionExists(

  Line 902: export async function downloadBinaryToTemp(

  Line 1122: export async function executeUpgrade(

  Line 1131:       return downloadBinaryToTemp(version, downloadTag, offline, ...
gateway · 2026-09-08 23:55:58
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts:
  Line 231:   readonly reason: AuthErrorReason;

  Line 236:     reason: AuthErrorReason,

  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 632:   readonly reason: SeerErrorReason;

  Line 635:   constructor(reason: SeerErrorReason, orgSlug?: string) {
gateway · 2026-09-08 23:56:06
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
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.
596:  *
597:  * @param reason - Type of upgrade failure
598:  * @param message - Custom message (uses default if not provided)
599:  */
600: export class UpgradeError extends CliError {
601:   readonly reason: UpgradeErrorReason;
602: 
603:   constructor(reason: UpgradeErrorReason, message?: ...
gateway · 2026-09-08 23:56:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
80: /**
81:  * Absolute legacy install directories for the given home. See
82:  * {@link LEGACY_INSTALL_SUBDIRS} for why this is scoped to pre-XDG locations.
83:  */
84: export function getLegacyInstallDirs(homeDir: string): string[] {
85:   return LEGACY_INSTALL_SUBDIRS.map((dir) => join(homeDir, dir));
86: }
87: 
88: /**
89:  * How the CLI was installed. Determines the upgrade strategy.
90:  *
91:  * Defined here (alongside other installation constants like
92:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
93:  * `db/install-info.ts` can import it without creating a circular
94:  * dependency. ...
gateway · 2026-09-08 23:56:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, isAbsolute, join, resolve, sep } 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, ...
gateway · 2026-09-08 23:56:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:56:51
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 23:57:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-08 23:57:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
700: 
701: /**
702:  * Build the gzip filename for the current platform binary.
703:  *
704:  * Nightly builds are stored in GHCR as `sentry-<os>-<arch>.gz` (or
705:  * `sentry-windows-x64.exe.gz` on Windows). This filename is the
706:  * `org.opencontainers.image.title` annotation on the matching OCI layer.
707:  *
708:  * @returns Filename of the gzip-compressed binary for this platform
709:  */
710: function getNightlyGzFilename(): string {
711:   return `${getPlatformBinaryName()}.gz`;
712: }
713: 
714: /**
715:  * Download a nightly binary from GHCR and decompress it to `destPath`.
716:  *
717:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
718:  * matching this platform's `.gz` filename, then downloads and decompresses
719:  * the blob in-stream. ...
gateway · 2026-09-08 23:57:55
result
Found 37 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/sentry-release.yml:
  Line 60:         run: sentry release create "sentry/${VERSION}" --project cli,cli-website


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 13: # packages:write is needed for publish-nightly to push to GHCR

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

  Line 62:       nightly-version: ${{ steps.nightly.outputs.version }}

  Line 353:         if: needs.changes.outputs.nightly-version != ''

  Line 356:           jq --arg v "${{ needs.changes.outputs.nightly-version }}" '.version = $v' packages/cli/package.json > packages/cli/package.json.tmp

  Line 441:     # `from-version`: the previous version the patches were actually generated

  Line 443:     # publish-nightly so it stamps the ...
gateway · 2026-09-08 23:58:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:         with:
431:           name: sentry-${{ matrix.target }}-gz
432:           path: packages/cli/dist-bin/*.gz
433: 
434:   generate-patches:
435:     name: Generate Delta Patches
436:     needs: [changes, build-binary]
437:     # Only on main (nightlies) and release branches (stable) — skip PRs
438:     if: github.event_name != 'pull_request'
439:     runs-on: ubuntu-latest
440:     continue-on-error: true
441:     # `from-version`: the previous version the patches were actually generated
442:     # FROM, as computed by the binpatch action. Carried through to
443:     # publish-nightly so it stamps the `from-version` annotation on the
444:     # pushed patch manifest with the SAME value. See
445:     # ...
gateway · 2026-09-08 23:58:22
result
Found 21 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/sentry-release.yml:
  Line 4:     types: [published]


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 13: # packages:write is needed for publish-nightly to push to GHCR

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

  Line 443:     # publish-nightly so it stamps the `from-version` annotation on the

  Line 447:     # Note: the `release/**` path uses `generate-release` (different mode) and

  Line 449:     # gate below. ...
gateway · 2026-09-08 23:58:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/release.yml</path>
<type>file</type>
<content>
1: name: Release
2: on:
3:   workflow_dispatch:
4:     inputs:
5:       version:
6:         description: Version to release (or "auto")
7:         required: false
8:       force:
9:         description: Force a release even when there are release-blockers
10:         required: false
11:       merge_target:
12:         description: Target branch to merge into
13:         required: false
14: permissions:
15:   contents: write
16:   pull-requests: write
17: 
18: env:
19:   # Pin Node to an exact patched version (single source of truth). A floating
20:   # "22" can reuse the runner's pre-cached 22.23.0, which carries the
21:   # ERR_STREAM_PREMATURE_CLOSE regression on keep-alive fetch reuse
22:   # (nodejs/node#64004, fixed in 22.23.1).
23:   NODE_VERSION_22: "22.23.1"
24: 
25: jobs:
26:   release:
27:     runs-on: ...
gateway · 2026-09-08 23:58:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/cleanup-nightlies.yml</path>
<type>file</type>
<content>
1: name: Cleanup Nightly Tags
2: 
3: on:
4:   schedule:
5:     # Every Sunday at 06:00 UTC
6:     - cron: "0 6 * * 0"
7:   workflow_dispatch:
8: 
9: permissions:
10:   packages: write
11: 
12: jobs:
13:   cleanup:
14:     name: Prune Old Nightly Tags
15:     runs-on: ubuntu-latest
16:     steps:
17:       - name: Install ORAS CLI
18:         run: |
19:           VERSION=1.2.3
20:           EXPECTED_SHA256="b4efc97a91f471f323f193ea4b4d63d8ff443ca3aab514151a30751330852827"
21:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"
22:           curl -sfLo "$TARBALL" "https://github.com/oras-project/oras/releases/download/v${VERSION}/${TARBALL}"
23:           echo "${EXPECTED_SHA256}  ${TARBALL}" | sha256sum -c -
24:           tar -xz -C /usr/local/bin oras < "$TARBALL"
25:           rm "$TARBALL"
26: ...
gateway · 2026-09-08 23:59:01
result
## feat/toolkit-bridge-upgrade...origin/main
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
0e661a5f5 (HEAD -> feat/toolkit-bridge-upgrade, origin/main, origin/HEAD) fix(org): log region URL parse failures in org list (#1539)
9d0901b10 feat(local): Add agent debugging stream (#1538)
72c307f47 fix(cli): log UID resolution failures in sentry cli fix (#1541)
e710ce905 fix(telemetry): log process-tree walk failures in agent detection (#1542)
6e3e7e13a feat(config): follow XDG Base Directory spec for config location (#1503)
17e110300 fix(init): stop recording ...
gateway · 2026-09-09 00:00:29
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-09 00:00:45
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 137:   fetchLatestFromGitHub,

  Line 139:   fetchLatestNightlyVersion,

  Line 144:   versionExists,

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

  Line 205:     const version = await fetchLatestFromGitHub();

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

  Line 264:     await ...
gateway · 2026-09-09 00:01:13
result
StatusCode: non 2xx status code (404 GET https://api.github.com/repos/BYK/binpatch/git/trees/v0.4.2?recursive=1)
gateway · 2026-09-09 00:01:25
result
{"message":"Not Found","documentation_url":"https://docs.github.com/rest/repos/contents#get-repository-content","status":"404"}gh: Not Found (HTTP 404)
gateway · 2026-09-09 00:01:35
result
.github
.github/workflows
.github/workflows/ci.yml
.github/workflows/docs-preview.yml
.github/workflows/pages.yml
.github/workflows/publish.yml
.github/workflows/release.yml
src/sources
src/sources/ghcr.ts
src/sources/github-release.ts
src/sources/oci.ts
test/sources.test.ts
website/src/content/docs/github-action.md
gateway · 2026-09-09 00:01:47
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-09 00:03:02
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/codemods/sentry-v3-to-v4/tsconfig.json:
  Line 15:     "noUncheckedIndexedAccess": true


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json:
  Line 17:     "noUncheckedIndexedAccess": true,
gateway · 2026-09-09 00:03:15
result
> sentry@0.45.0-dev.0 typecheck /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli
> pnpm run generate:docs && pnpm run generate:sdk && tsc --noEmit


> sentry@0.45.0-dev.0 generate:docs /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli
> pnpm run generate:banner && pnpm run generate:parser && pnpm run generate:command-docs && pnpm run generate:skill && pnpm run generate:docs-sections


> sentry@0.45.0-dev.0 generate:banner /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli
> pnpm tsx script/generate-banner-sixel.ts


> sentry@0.45.0-dev.0 tsx /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli
> tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs script/generate-banner-sixel.ts

.env.local not found. ...
gateway · 2026-09-09 00:03:53
result
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
gateway · 2026-09-09 00:04:00
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 250: export const GITHUB_RELEASES_URL = getGitHubReleasesUrl();


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 35:   GITHUB_RELEASES_URL,

  Line 124:     releasesUrl: ...
gateway · 2026-09-09 00:04:10
result
Found 15 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/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: ...
gateway · 2026-09-09 00:04:24
result
[{"headRefName":"chore/preshape-monorepo","number":1254,"state":"MERGED","title":"chore: pre-shape repo into pnpm-workspace monorepo layout","updatedAt":"2026-07-31T13:58:04Z","url":"https://github.com/getsentry/cli/pull/1254"}]
[{"number":1244,"state":"OPEN","title":"toolkit merge: bridge CLI release + dual-source upgrade compatibility","updatedAt":"2026-09-08T19:17:06Z","url":"https://github.com/getsentry/cli/issues/1244"},{"number":1248,"state":"OPEN","title":"Merge sentry-cli + sentry-mcp into getsentry/toolkit monorepo (master)","updatedAt":"2026-09-08T19:20:09Z","url":"https://github.com/getsentry/cli/issues/1248"}]
gateway · 2026-09-09 00:04:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, sep } 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:   getLegacyInstallDirs,
29:   getPlatformBinaryName,
30:   installBinary,
31:   ...
gateway · 2026-09-09 00:05:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: import { UPGRADE_SOURCES } from "../../src/lib/binary.js";
21: 
22: function noop(): void {
23:   // Intentionally empty — absorbs async spawn errors
24: }
25: 
26: const repoRoot = join(import.meta.dirname, "..", "..");
27: const installScript = join(repoRoot, ...
gateway · 2026-09-09 00:05:23
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 6:  * The `executeUpgrade` and `detectInstallationMethod` subprocess tests use

  Line 135:   downloadBinaryToTemp,

  Line 136:   executeUpgrade,

  Line 150: let originalFetch: typeof globalThis.fetch;

  Line 153: function mockFetch(

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

  Line 160:   originalFetch = globalThis.fetch;

  Line 164:   globalThis.fetch = originalFetch;

  Line 192:     mockFetch(

  Line 210:     mockFetch(

  Line 228:     mockFetch(

  Line 246:     mockFetch(

  Line 260:     mockFetch(async () => {

  Line 271:     mockFetch(

  Line 287:     mockFetch(

  Line 305:     mockFetch(

  Line 319:     mockFetch(async () => {

  Line 330:     mockFetch(

  Line 399:     mockFetch(

  Line 412:     mockFetch(

  Line 425:     mockFetch(

  Line 438:    ...
gateway · 2026-09-09 00:05:30
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: } ...
gateway · 2026-09-09 00:05:38
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 975:     const url = getBinaryDownloadUrl("1.0.0");


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

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


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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 234: export function getBinaryDownloadUrl(
gateway · 2026-09-09 00:05:54
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 5:  * Covers resolveTargetVersion branches (check mode, already up-to-date,

  Line 220:     // GitHub tag check (for versionExists) — this repo uses un-prefixed tags
gateway · 2026-09-09 00:06:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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-09 00:06:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 00:06:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
260:   if [[ -z "$digest" ]]; then
261:     die "No nightly build found for ${gz_filename}" "ghcr-digest"
262:   fi
263: 
264:   # Step 5: Get the redirect URL from the blob endpoint (don't use -L: auth
265:   # header must NOT be forwarded to the Azure Blob Storage redirect target)
266:   redir_url=$(curl -s -w '\n%{redirect_url}' -o /dev/null \
267:     -H "Authorization: Bearer $GHCR_TOKEN" \
268:     "https://ghcr.io/v2/getsentry/cli/blobs/${digest}" | tail -1)
269:   if [[ -z "$redir_url" ]]; then
270:     die "Failed to get blob redirect URL from GHCR" "ghcr-redirect"
271:   fi
272: 
273:   # Step 6: Download the .gz blob and decompress (without auth header)
274:   curl -sf "$redir_url" | gunzip > "$tmp_binary"
275: 
276: else
277:   # Stable build: resolve version and download from GitHub Releases. ...
gateway · 2026-09-09 00:06:34
result
Found 13 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/package.json:
  Line 38:     "check:fragments": "pnpm --filter sentry run check:fragments",

  Line 39:     "check:deps": "pnpm --filter sentry run check:deps",

  Line 40:     "check:errors": "pnpm --filter sentry run check:errors",

  Line 41:     "check:patches": "pnpm --filter sentry run check:patches",

  Line 42:     "check:docs-sections": "pnpm --filter sentry run check:docs-sections",

  Line 43:     "check:stale-refs": "pnpm --filter sentry run check:stale-refs"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 80:     "check:fragments": "pnpm tsx script/check-fragments.ts",

  Line 81:     "check:deps": "pnpm tsx script/check-no-deps.ts",

  Line 82:     "check:errors": "pnpm tsx script/check-error-patterns.ts",

  Line 83:     "check:patches": "pnpm tsx ...
gateway · 2026-09-09 00:06:46
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 188:         run: pnpm run check:fragments

  Line 242:       - run: pnpm run lint

  Line 244:       - run: pnpm run check:deps

  Line 245:       - run: pnpm run check:errors

  Line 246:       - run: pnpm run check:patches

  Line 247:       - run: pnpm run check:stale-refs
gateway · 2026-09-09 00:06:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:         - 'vercel'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: vercel
20:     projectId: prj_wVkOnIwI3eIQbGD1Gw7qS1MqFFIK
21:   - name: registry
22:     apps:
23:       'app:sentry':
24:         name: 'Sentry CLI'
25:         packageUrl: 'https://www.npmjs.com/package/sentry'
26:         mainDocsUrl: 'https://cli.sentry.dev'
27:         urlTemplate: ...
gateway · 2026-09-09 00:07:11
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 267: export async function resolveUpgradeSource(
gateway · 2026-09-09 00:07:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-09 00:07:55
result
No files found
gateway · 2026-09-09 00:08:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:08:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
375: export function applyPatchChain(
376:   chain: PatchChain,
377:   oldBinaryPath: string,
378:   destPath: string,
379:   onBytes?: (bytes: number) => void
380: ): Promise<string> {
381:   return withTracingSpan(
382:     "apply-patches",
383:     "upgrade.delta.apply",
384:     async (span) => {
385:       span.setAttribute("patches.count", chain.patches.length);
386:       span.setAttribute("patches.total_bytes", chain.totalSize);
387:       const sha256 = await applyPatchChainInMemory(
388:         oldBinaryPath,
389:         chain.patches.map((patch) => patch.data),
390:         destPath,
391:         onBytes
392:       );
393:       if (sha256 !== chain.expectedSha256) {
394:         throw new Error(
395:           `SHA-256 mismatch after patching: got ${sha256}, expected ...
gateway · 2026-09-09 00:08:36
result
Found 30 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 16:   getVersionCheckInfo,

  Line 18:   setVersionCheckInfo,

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

  Line 229:   latestVersion: string,

  Line 232:   if (semverCompare(latestVersion, CLI_VERSION) !== 1) {

  Line 237:       await prefetchNightlyPatches(latestVersion, signal);

  Line 239:       await prefetchStablePatches(latestVersion, signal);

  Line 284:         const latestVersion =

  Line 288:         setVersionCheckInfo(latestVersion);

  Line 291:         await maybePrefetchPatches(channel, latestVersion, signal);

  Line 301:           span.setAttribute("version_check.error", error.message);

  Line 302:           span.setAttribute("version_check.error_type", error.constructor.name);

  Line 358:   formatNotification: (latestVersion: string) => string

  Line 371:     const { ...
gateway · 2026-09-09 00:10:50
result
{"body":"Tracking issue for merging **getsentry/cli** into the existing **getsentry/sentry-mcp** repository, validating the combined monorepo there, and only then renaming it to **`getsentry/toolkit`**. The final repository is a pnpm workspace (no Turbo) with independent prefixed releases and phased shared code.\n\n**Full plan:** https://gist.github.com/BYK/8c0ce6cec64608f41fe5654b7827228e\n\n## Settled architecture\n\n- Use `getsentry/sentry-mcp` as the destination; do not create a fresh repository. This preserves MCP production secrets, environments, GitHub App, webhooks, Vercel, and Cloudflare wiring.\n- Import CLI while the repository is still named `getsentry/sentry-mcp`. Rename only after the integrated monorepo and live deployment paths pass every gate.\n- Preserve CLI and docs history through two filtered `git subtree` imports into `packages/cli` and `apps/cli-docs`.\n- Release products independently with `cli@x.y.z` and `mcp@x.y.z`.\n- CLI docs remain release-gated on Vercel; ...
gateway · 2026-09-09 00:10:58
result
No files found
gateway · 2026-09-09 00:11:09
result
No files found
gateway · 2026-09-09 00:11:20
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/pnpm-lock.yaml:
  Line 1548:   '@sentry/cli@2.58.6':

  Line 4207:   trpc-cli@0.12.4:

  Line 6000:   '@sentry/cli@2.58.6':

  Line 9255:   trpc-cli@0.12.4(@trpc/server@11.18.0(typescript@5.9.3))(valibot@1.4.2(typescript@5.9.3))(zod@4.4.3):


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 600:           SENTRY_CLI_BINARY: ${{ github.workspace }}/dist-bin/sentry-linux-x64


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/package.json:
  Line 2:   "name": "toolkit-cli-workspace",
gateway · 2026-09-09 00:11:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json</path>
<type>file</type>
<content>
1: {
2:   "compilerOptions": {
3:     "lib": ["ESNext"],
4:     "target": "ESNext",
5:     "module": "ESNext",
6:     "jsx": "react-jsx",
7:     "moduleDetection": "force",
8:     "allowJs": true,
9:     "moduleResolution": "bundler",
10:     "allowImportingTsExtensions": true,
11:     "verbatimModuleSyntax": true,
12:     "noEmit": true,
13:     "resolveJsonModule": true,
14:     "strict": true,
15:     "skipLibCheck": true,
16:     "noFallthroughCasesInSwitch": true,
17:     "noUncheckedIndexedAccess": true,
18:     "noImplicitOverride": true,
19:     "esModuleInterop": true,
20:     "forceConsistentCasingInFileNames": true,
21:     "noUnusedLocals": false,
22:     "noUnusedParameters": false,
23:     "noPropertyAccessFromIndexSignature": false,
24:     "strictNullChecks": true
25:   },
26:   "include": ...
gateway · 2026-09-09 00:11:57
result
No files found
gateway · 2026-09-09 00:12:05
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 720: export async function fetchChangelog(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 834:   return fetchChangelog({
gateway · 2026-09-09 00:12:55
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 315: export function compareVersions(a: string, b: string): -1 | 0 | 1 {
gateway · 2026-09-09 00:13:03
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
300:  * @returns true if the version is a nightly build
301:  */
302: export function isNightlyVersion(version: string): boolean {
303:   return version.includes("-dev.");
304: }
305: 
306: /**
307:  * Compare two version strings and return their ordering.
308:  *
309:  * Uses `Bun.semver.order` which handles both stable (`X.Y.Z`) and
310:  * nightly (`X.Y.Z-dev.<unix-seconds>`) versions correctly — the numeric
311:  * pre-release identifier is compared numerically per SemVer spec.
312:  *
313:  * @returns 1 if a > b, -1 if a < b, 0 if equal
314:  */
315: export function compareVersions(a: string, b: string): -1 | 0 | 1 {
316:   return semverCompare(a, b);
317: }
318: 
319: /**
320:  * Check whether moving from `current` to `target` is a downgrade. ...
gateway · 2026-09-09 00:13:11
result
Found 21 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/sdk.generated.ts:
  Line 1200:   /** URL to the release source */


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/sourcemap/debug-id.ts:
  Line 6:  * replace fragile filename/release-based sourcemap matching with a


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/react-native/xcode-env.ts:
  Line 374: /** A resolved release + distribution for the sourcemap upload. */


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/init/ui/types.ts:
  Line 254:  * the main screen buffer, and release any held TTY ...
gateway · 2026-09-09 00:13:26
result
...output truncated...

Full output saved to: /home/byk/.local/share/opencode/tool-output/tool_0838337ed001DKBQM6AY4wVfHt

  byk/fix/search-query-validation-error            2cfe96fdb [origin/byk/fix/search-query-validation-error: gone] fix(replay): convert user --query 400s to ValidationError + close test gaps
  byk/fix/sourcemap-debugid-collision              594094172 [origin/byk/fix/sourcemap-debugid-collision: gone] fix(sourcemap): derive debug ID from JS + map so distinct chunks don't collide (#3350)
  byk/fix/upgrade-missing-install-dir              979f0a68d [origin/byk/fix/upgrade-missing-install-dir: gone] Merge remote-tracking branch 'origin/main' into byk/fix/upgrade-missing-install-dir
  byk/fix/upgrade-output                           63fc5c3c3 [origin/main: ahead 474, behind 563] fix(dsn): treat EISDIR and ENOTDIR as ignorable file errors
  byk/hidden-org-project-flags                     8a0d250f8 [origin/byk/hidden-org-project-flags: gone] review: trim whitespace in ...
gateway · 2026-09-09 00:15:30
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-patches.ts:
  Line 326:       `  ${assertion.description} — could not read ${assertion.file} (run pnpm install)`
gateway · 2026-09-09 00:15:43
result
No files found
gateway · 2026-09-09 00:15:59
result
No files found
gateway · 2026-09-09 00:16:15
result
No files found
gateway · 2026-09-09 00:16:29
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install
gateway · 2026-09-09 00:16:43
result
No files found
gateway · 2026-09-09 00:18:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 { UPGRADE_SOURCES } from "../../src/lib/binary.js";
11: import {
12:   downloadLayerBlob,
13:   downloadNightlyBlob,
14:   fetchManifest,
15:   fetchNightlyManifest,
16:   findLayerByFilename,
17:   GHCR_REPO,
18:   GHCR_TAG,
19:   getAnonymousToken,
20:   getNightlyVersion,
21:   listTags,
22:   type OciManifest,
23: } from "../../src/lib/ghcr.js";
24: 
25: /** Store original fetch for restoration */
26: let originalFetch: typeof globalThis.fetch;
27: 
28: /** Helper to mock fetch ...
gateway · 2026-09-09 00:18:52
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-09 00:19:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
250:   // Offline mode is only supported for curl-installed binaries — package
251:   // managers always need network to fetch and install packages.
252:   if (offline && method !== "curl") {
253:     throw new UpgradeError(
254:       "unsupported_operation",
255:       "Offline upgrade is only supported for curl-installed binaries."
256:     );
257:   }
258: }
259: 
260: type ResolveTargetOptions = {
261:   method: InstallationMethod;
262:   channel: ReleaseChannel;
263:   versionArg: string | undefined;
264:   channelChanged: boolean;
265:   flags: UpgradeFlags;
266: };
267: 
268: /**
269:  * Result of resolving the target version. ...
gateway · 2026-09-09 00:20:35
result
Found 49 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 87:   /** Whether the upgrade was performed offline (from cache) */

  Line 88:   offline?: boolean;

  Line 91:   /** Changelog summary for the version range. Absent for offline or on fetch failure. */

  Line 98:   readonly offline: boolean;

  Line 135:  * fetching from the network. Used by `--offline` and as automatic

  Line 136:  * fallback when `fetchLatestVersion()` hits a network error.

  Line 158:  * the local cache when offline or when the network is unavailable.

  Line 160:  * @returns `{ target, offline }` — the resolved version and whether the

  Line 161:  *   resolution used the offline path (explicit or automatic fallback). ...
gateway · 2026-09-09 00:20:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
120:   if (lower === "nightly" || lower === "stable") {
121:     return {
122:       channel: lower,
123:       versionArg: undefined,
124:     };
125:   }
126: 
127:   return {
128:     channel: getReleaseChannel(),
129:     versionArg: positional,
130:   };
131: }
132: 
133: /**
134:  * Resolve the target version from the local cache (SQLite) instead of
135:  * fetching from the network. Used by `--offline` and as automatic
136:  * fallback when `fetchLatestVersion()` hits a network error. ...
gateway · 2026-09-09 00:22:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
210: }
211: 
212: /**
213:  * Abort any pending version check to allow process exit.
214:  * Call this when main CLI work is complete.
215:  */
216: export function abortPendingVersionCheck(): void {
217:   pendingAbortController?.abort();
218:   pendingAbortController = null;
219: }
220: 
221: /**
222:  * Pre-fetch delta patches for a newly discovered version.
223:  *
224:  * Best-effort: errors are silently caught so the version check still succeeds.
225:  * After pre-fetching, opportunistically cleans up stale cached patches.
226:  */
227: async function maybePrefetchPatches(
228:   channel: "stable" | "nightly",
229:   latestVersion: string,
230:   signal: AbortSignal
231: ): Promise<void> {
232:   if (semverCompare(latestVersion, CLI_VERSION) !== 1) {
233:     return;
234:   }
235:   try {
236:     ...
gateway · 2026-09-09 00:23:08
result
Found 88 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 6:  * The `executeUpgrade` and `detectInstallationMethod` subprocess tests use

  Line 135:   downloadBinaryToTemp,

  Line 136:   executeUpgrade,

  Line 137:   fetchLatestFromGitHub,

  Line 139:   fetchLatestNightlyVersion,

  Line 144:   versionExists,

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

  Line 205:     const version = await fetchLatestFromGitHub();

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

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

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

  Line ...
gateway · 2026-09-09 00:23:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 00:23:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
205: # Download binary to a temp location
206: tmpdir="${TMPDIR:-${TMP:-${TEMP:-/tmp}}}"
207: tmp_binary="${tmpdir}/sentry-install-$$${suffix}"
208: version=""
209: 
210: # Clean up temp binary on failure (setup handles cleanup on success)
211: trap 'rm -f "$tmp_binary"' EXIT
212: 
213: if [[ "$requested_version" == "nightly" ]]; then
214:   # Nightly build: download from GHCR via OCI blob protocol.
215:   # No jq needed — parse JSON with awk.
216:   # ghcr.io blob downloads redirect to Azure Blob Storage. curl -L would
217:   # forward the Authorization header to Azure, which returns 404. Instead,
218:   # extract the redirect URL and follow it without the auth header.
219: 
220:   echo -e "${MUTED}Fetching nightly build from GHCR...${NC}"
221: 
222:   # Step 1: Get anonymous pull token
223:   GHCR_TOKEN=$(curl -sf ...
gateway · 2026-09-09 00:23:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:24:41
result
Found 89 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.mocked.test.ts:
  Line 46:   resolveStableDelta,

  Line 89: // resolveStableDelta

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

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

  Line 105:         tag_name: "0.14.0",

  Line 126:         tag_name: "0.13.0",

  Line 159:       // resolveStableDelta will:

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

  Line 182:       const result = await resolveStableDelta(

  Line 355:         tag_name: "0.14.0",

  Line 376:         tag_name: "0.13.0",

  Line 437:         tag_name: "0.14.0",

  Line 458:         tag_name: "0.13.0",


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 36:   ...
gateway · 2026-09-09 00:25:10
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
gateway · 2026-09-09 00:25:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-09 00:25:38
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
55:     "dev": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && tsx --import ./script/require-shim.mjs src/bin.ts",
56:     "build": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts --single",
57:     "build:all": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts",
58:     "bundle": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/bundle.ts",
59:     "typecheck": "pnpm run generate:docs && pnpm run generate:sdk && tsc --noEmit",
60:     "lint": "biome check --no-errors-on-unmatched --error-on-warnings --max-diagnostics=none ./",
61:     "lint:fix": "biome check --write --no-errors-on-unmatched --max-diagnostics=none ./",
62:     ...
gateway · 2026-09-09 00:26:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, isAbsolute, join, resolve, sep } 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, ...
gateway · 2026-09-09 00:26:49
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 33:   getGitHubHeaders,

  Line 404:     { headers: getGitHubHeaders(), signal },

  Line 563:       { method: "HEAD", headers: getGitHubHeaders() },

  Line 767:   const headers = getGitHubHeaders();
gateway · 2026-09-09 00:27:03
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 00:27:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
730:   version?: string,
731:   setMessage?: SetMessage
732: ): Promise<void> {
733:   const token = await getAnonymousToken();
734:   const manifest = version
735:     ? await fetchManifest(token, `nightly-${version}`)
736:     : await fetchNightlyManifest(token);
737:   const filename = getNightlyGzFilename();
738:   const layer = findLayerByFilename(manifest, filename);
739:   const response = await downloadNightlyBlob(token, layer.digest);
740: 
741:   if (!response.body) {
742:     throw new UpgradeError(
743:       "execution_failed",
744:       "GHCR blob response had no body"
745:     );
746:   }
747:   await streamDecompressToFile(response.body, destPath, setMessage);
748: }
749: 
750: /**
751:  * Download a stable binary from GitHub Releases and write it to `destPath`. ...
gateway · 2026-09-09 00:27:20
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 273:       headers: getGitHubHeaders(),

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

  Line 426: export async function fetchWithUpgradeError(
gateway · 2026-09-09 00:27:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
390:   // 3-4. Check well-known directories that are already in PATH. samePath keeps
391:   // the membership check case-insensitive on Windows/macOS, where a PATH entry
392:   // can differ in casing from the computed directory yet be the same dir.
393:   const candidates = [join(homeDir, ".local", "bin"), join(homeDir, "bin")];
394: 
395:   for (const dir of candidates) {
396:     if (existsSync(dir) && pathDirs.some((p) => samePath(p, dir))) {
397:       return dir;
398:     }
399:   }
400: 
401:   // 5. XDG-aligned fallback — setup will handle adding this to PATH
402:   return join(homeDir, ".local", "bin");
403: }
404: 
405: /**
406:  * Build headers for GitHub API requests.
407:  */
408: export function getGitHubHeaders(): Record<string, string> {
409:   return {
410:     Accept: ...
gateway · 2026-09-09 00:27:38
result
No files found
gateway · 2026-09-09 00:27:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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-09 00:27:52
result
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
0e661a5f5 (HEAD -> feat/toolkit-bridge-upgrade, origin/main, origin/HEAD) fix(org): log region URL parse failures in org list (#1539)
9d0901b10 feat(local): Add agent debugging stream (#1538)
72c307f47 fix(cli): log UID resolution failures in sentry cli fix (#1541)
e710ce905 fix(telemetry): log process-tree walk failures in agent detection (#1542)
6e3e7e13a feat(config): follow XDG Base Directory spec for config location (#1503)
17e110300 fix(init): stop recording skipped verification as an error ...
gateway · 2026-09-09 00:28:17
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-09 00:28:31
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/sentry-release.yml:
  Line 5:   workflow_dispatch:

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

  Line 19:   # ERR_STREAM_PREMATURE_CLOSE regression on keep-alive fetch reuse

  Line 30:     # always run on manual dispatch.

  Line 31:     if: github.event_name == 'workflow_dispatch' || !github.event.release.prerelease

  Line 45:       # The sentry npm package requires Node.js >= 22.12 — pin an exact patched


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/release.yml:
  Line 3:   workflow_dispatch:

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

  Line 21:   # ERR_STREAM_PREMATURE_CLOSE regression on keep-alive fetch ...
gateway · 2026-09-09 00:28:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:         with:
431:           name: sentry-${{ matrix.target }}-gz
432:           path: packages/cli/dist-bin/*.gz
433: 
434:   generate-patches:
435:     name: Generate Delta Patches
436:     needs: [changes, build-binary]
437:     # Only on main (nightlies) and release branches (stable) — skip PRs
438:     if: github.event_name != 'pull_request'
439:     runs-on: ubuntu-latest
440:     continue-on-error: true
441:     # `from-version`: the previous version the patches were actually generated
442:     # FROM, as computed by the binpatch action. Carried through to
443:     # publish-nightly so it stamps the `from-version` annotation on the
444:     # pushed patch manifest with the SAME value. See
445:     # ...
gateway · 2026-09-09 00:28:47
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/cleanup-nightlies.yml</path>
<type>file</type>
<content>
1: name: Cleanup Nightly Tags
2: 
3: on:
4:   schedule:
5:     # Every Sunday at 06:00 UTC
6:     - cron: "0 6 * * 0"
7:   workflow_dispatch:
8: 
9: permissions:
10:   packages: write
11: 
12: jobs:
13:   cleanup:
14:     name: Prune Old Nightly Tags
15:     runs-on: ubuntu-latest
16:     steps:
17:       - name: Install ORAS CLI
18:         run: |
19:           VERSION=1.2.3
20:           EXPECTED_SHA256="b4efc97a91f471f323f193ea4b4d63d8ff443ca3aab514151a30751330852827"
21:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"
22:           curl -sfLo "$TARBALL" "https://github.com/oras-project/oras/releases/download/v${VERSION}/${TARBALL}"
23:           echo "${EXPECTED_SHA256}  ${TARBALL}" | sha256sum -c -
24:           tar -xz -C /usr/local/bin oras < "$TARBALL"
25:           rm "$TARBALL"
26: ...
gateway · 2026-09-09 00:28:57
result
Found 13 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

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

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

  Line 766:   const url = getBinaryDownloadUrl(version);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 234: export function getBinaryDownloadUrl(

  Line 243: export function getGitHubReleasesUrl(

  Line 250: export const GITHUB_RELEASES_URL = getGitHubReleasesUrl();

  ...
gateway · 2026-09-09 00:29:08
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/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:29:16
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/db/version-check.ts:
  Line 4:  * Stores the last time we checked for updates and the latest known version

  Line 5:  * in the metadata table for the "new version available" notification.

  Line 11: const KEY_LAST_CHECKED = "version_check.last_checked";

  Line 12: const KEY_LATEST_VERSION = "version_check.latest_version";

  Line 14:  * Timestamp (ms) when we last printed the "new version available"

  Line 16:  * latest-version can stay hot for faster subsequent checks while the

  Line 19: const KEY_LAST_NOTIFIED = "version_check.last_notified";

  Line 26:   /** Latest version string from GitHub, or null if never fetched */

  Line 33:  * Get the stored version check state.

  Line 62:  * Clear the cached latest version. ...
gateway · 2026-09-09 00:30:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   | ...
gateway · 2026-09-09 00:31:53
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 123:   return githubReleaseSource({
gateway · 2026-09-09 00:32:09
result
No files found
gateway · 2026-09-09 00:32:56
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 111:     "binpatch": "^0.4.2",
gateway · 2026-09-09 00:33:08
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 127:  * @param body - Markdown release notes body

  Line 549: const CHANGELOG_MAX_RELEASES = 30;

  Line 564:       `${GITHUB_RELEASES_URL}?per_page=${CHANGELOG_MAX_RELEASES}`,
gateway · 2026-09-09 00:33:18
result
Found 16 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 45:   fetchChangelog,

  Line 91:   /** Changelog summary for the version range. Absent for offline or on fetch failure. */

  Line 92:   changelog?: ChangelogSummary;

  Line 820:  * Start a best-effort changelog fetch in parallel with the binary download.

  Line 822:  * Returns a promise that resolves to the changelog or undefined. Never

  Line 834:   return fetchChangelog({

  Line 844:  * Build a check-only result with optional changelog, ready to yield.

  Line 853:   changelogPromise: Promise<ChangelogSummary | undefined>;

  Line 859:   result.changelog = await opts.changelogPromise;

  Line 953:       // For --check with a version diff, fetch changelog before returning.

  Line 958:         result.changelog = await startChangelogFetch(

  Line 970:     // Start changelog fetch early — it runs in parallel ...
gateway · 2026-09-09 00:33:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
800:   return { channel, versionArg, channelChanged, method };
801: }
802: 
803: /**
804:  * Persist the release channel preference. Must be called **after** offline
805:  * target resolution since `setReleaseChannel()` clears the version check
806:  * cache on channel changes, which would prevent `resolveOfflineTarget()`
807:  * from reading the cached version.
808:  */
809: function persistChannel(
810:   channel: ReleaseChannel,
811:   channelChanged: boolean,
812:   version: string | undefined
813: ): void {
814:   if (channelChanged || CHANNEL_VERSIONS.has(version ?? "")) {
815:     setReleaseChannel(channel);
816:   }
817: }
818: 
819: /**
820:  * Start a best-effort changelog fetch in parallel with the binary download. ...
gateway · 2026-09-09 00:33:40
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 720: export async function fetchChangelog(

  Line 726:     if (channel === "nightly") {
gateway · 2026-09-09 00:33:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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-09 00:34:00
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/lib/delta-upgrade.ts:
  Line 124:     releasesUrl: GITHUB_RELEASES_URL,
gateway · 2026-09-09 00:34:12
result
No files found
gateway · 2026-09-09 00:34:23
result
No files found
gateway · 2026-09-09 00:34:31
result
No files found
gateway · 2026-09-09 00:34:41
result
No files found
gateway · 2026-09-09 00:34:52
result
Ripgrep JSON record exceeded 65536 bytes
gateway · 2026-09-09 00:35:07
result
No files found
gateway · 2026-09-09 00:35:16
result
No files found
gateway · 2026-09-09 00:35:45
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.lore.md
gateway · 2026-09-09 00:35:53
result
No files found
gateway · 2026-09-09 00:36:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-09 00:36:17
result
No files found
gateway · 2026-09-09 00:36:25
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/pnpm-lock.yaml:
  Line 136:       binpatch:

  Line 2169:   binpatch@0.4.2:

  Line 6698:   binpatch@0.4.2: {}
gateway · 2026-09-09 00:36:38
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 `fs.openSync` + `fs.writeSync`
 *   with the fd `closeSync`'d before the function returns, so the caller
 *   can `spawn` the output file without racing ETXTBSY on Linux. ...
gateway · 2026-09-09 00:37:21
result
Found 17 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/content/docs/configuration.md:
  Line 122: Pin a specific version for the [install script](./getting-started/#install-script). Accepts a version number (e.g., `0.40.0`) or `nightly`. The `--version` flag takes precedence if both are set.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.lore.md:
  Line 38: * **Consola chosen as CLI logger with Sentry createConsolaReporter integration**: Consola is the CLI logger with Sentry \`createConsolaReporter\` integration. Two reporters: FancyReporter (stderr) + Sentry structured logs. Level via \`SENTRY\_LOG\_LEVEL\`. \`buildCommand\` injects hidden \`--log-level\`/\`--verbose\` flags. \`withTag()\` creates independent instances; \`setLogLevel()\` propagates via registry. All user-facing output must use consola, not raw stderr. ...
gateway · 2026-09-09 00:37:33
result
No files found
gateway · 2026-09-09 00:37:43
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/binary.test.ts:
  Line 25:   getBinaryDownloadUrl,

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

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

  Line 57:     const url = getBinaryDownloadUrl("2.0.0");
gateway · 2026-09-09 00:37:54
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, sep } 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:   getLegacyInstallDirs,
29:   getPlatformBinaryName,
30:   installBinary,
31:   ...
gateway · 2026-09-09 00:38:03
result
6fcfb3b1aa34cb1caaf27b3060bb40522bd3eccf
75582612a31fba6ee68111fcfb144f34c28eb58b
gateway · 2026-09-09 00:38:23
result
No files found
gateway · 2026-09-09 00:38:50
result
import { createHash } from 'crypto';
import { copyFileSync, constants, openSync, writeSync, closeSync } 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 ...
gateway · 2026-09-09 00:39:03
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   return await fetchManifest(token, GHCR_TAG);

  Line 332: export async function downloadNightlyBlob(

  Line 471: export async function listTags(

  Line 513: export async function downloadLayerBlob(

  Line 518:   const response = await downloadNightlyBlob(token, digest, signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 476:   const token = await getAnonymousToken();

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

  Line 523:   const token = await getAnonymousToken();

  Line 525:     await ...
gateway · 2026-09-09 00:39:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:39:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
380: ): Promise<string> {
381:   return withTracingSpan(
382:     "apply-patches",
383:     "upgrade.delta.apply",
384:     async (span) => {
385:       span.setAttribute("patches.count", chain.patches.length);
386:       span.setAttribute("patches.total_bytes", chain.totalSize);
387:       const sha256 = await applyPatchChainInMemory(
388:         oldBinaryPath,
389:         chain.patches.map((patch) => patch.data),
390:         destPath,
391:         onBytes
392:       );
393:       if (sha256 !== chain.expectedSha256) {
394:         throw new Error(
395:           `SHA-256 mismatch after patching: got ${sha256}, expected ${chain.expectedSha256}`
396:         );
397:       }
398:       return sha256;
399:     }
400:   );
401: }
402: 
403: function makeProgressHandler(setMessage?: SetMessage): ...
gateway · 2026-09-09 00:39:49
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 188:         run: pnpm run check:fragments

  Line 244:       - run: pnpm run check:deps

  Line 246:       - run: pnpm run check:patches

  Line 247:       - run: pnpm run check:stale-refs
gateway · 2026-09-09 00:39:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
225:     steps:
226:       - uses: actions/checkout@v6
227:       - uses: pnpm/action-setup@v4
228:       - uses: actions/setup-node@v6
229:         with:
230:           node-version: ${{ env.NODE_VERSION_22 }}
231:       - uses: actions/cache@v5
232:         id: cache
233:         with:
234:           path: |
235:             node_modules
236:             packages/*/node_modules
237:             apps/*/node_modules
238:           key: node-modules-${{ hashFiles('pnpm-lock.yaml', '.npmrc', 'packages/cli/patches/**') }}
239:       - if: steps.cache.outputs.cache-hit != 'true'
240:         run: pnpm install --frozen-lockfile
241:       - run: pnpm run generate:schema
242:       - run: pnpm run lint
243:       - run: pnpm run typecheck
244:       - run: pnpm run check:deps
245:       - run: pnpm run check:errors
246:    ...
gateway · 2026-09-09 00:40:03
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 59:     "typecheck": "pnpm run generate:docs && pnpm run generate:sdk && tsc --noEmit",

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

  Line 81:     "check:deps": "pnpm tsx script/check-no-deps.ts",


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/package.json:
  Line 17:     "typecheck": "pnpm --filter sentry run typecheck",

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

  Line 39:     "check:deps": "pnpm --filter sentry run check:deps",
gateway · 2026-09-09 00:40:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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": ">=20.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 ...
gateway · 2026-09-09 00:40:52
result
{"body":"Tracking issue for merging **getsentry/cli** into the existing **getsentry/sentry-mcp** repository, validating the combined monorepo there, and only then renaming it to **`getsentry/toolkit`**. The final repository is a pnpm workspace (no Turbo) with independent prefixed releases and phased shared code.\n\n**Full plan:** https://gist.github.com/BYK/8c0ce6cec64608f41fe5654b7827228e\n\n## Settled architecture\n\n- Use `getsentry/sentry-mcp` as the destination; do not create a fresh repository. This preserves MCP production secrets, environments, GitHub App, webhooks, Vercel, and Cloudflare wiring.\n- Import CLI while the repository is still named `getsentry/sentry-mcp`. Rename only after the integrated monorepo and live deployment paths pass every gate.\n- Preserve CLI and docs history through two filtered `git subtree` imports into `packages/cli` and `apps/cli-docs`.\n- Release products independently with `cli@x.y.z` and `mcp@x.y.z`.\n- CLI docs remain release-gated on Vercel; ...
gateway · 2026-09-09 00:41:03
result
Found 14 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 436:     const version = r.tag_name.replace(VERSION_PREFIX_RE, "");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 57:   VERSION_PREFIX_REGEX,

  Line 144:     return versionArg.replace(VERSION_PREFIX_REGEX, "");

  Line 290:   const target = versionArg?.replace(VERSION_PREFIX_REGEX, "") ?? latest;

  Line 325:     const exists = await versionExists(lookupMethod, target);


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

  Line 287:             : await ...
gateway · 2026-09-09 00:41:13
result
apps/cli-docs/public/install
packages/cli/install
packages/cli/src/commands/cli/uninstall.ts
packages/cli/src/lib/db/install-info.ts
packages/cli/test/commands/cli/uninstall.test.ts
packages/cli/test/lib/db/install-info.test.ts
packages/cli/test/lib/install-script.test.ts
gateway · 2026-09-09 00:41:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public</path>
<type>directory</type>
<entries>
.well-known/
CNAME
favicon.png
favicon.svg
glyph.svg
install
og-image-twitter.png
og-image.png
wordmark-light.svg
wordmark.svg

(10 entries)
</entries>
gateway · 2026-09-09 00:41:40
result
120000 blob c6850ca5ea9254ff1b25a1850d31de63cec527f6	apps/cli-docs/public/install
120000 blob c6850ca5ea9254ff1b25a1850d31de63cec527f6      29	apps/cli-docs/public/install
../../../packages/cli/install
gateway · 2026-09-09 00:42:08
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.craft.yml
gateway · 2026-09-09 00:42:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:         - 'vercel'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: vercel
20:     projectId: prj_wVkOnIwI3eIQbGD1Gw7qS1MqFFIK
21:   - name: registry
22:     apps:
23:       'app:sentry':
24:         name: 'Sentry CLI'
25:         packageUrl: 'https://www.npmjs.com/package/sentry'
26:         mainDocsUrl: 'https://cli.sentry.dev'
27:         urlTemplate: ...
gateway · 2026-09-09 00:42:28
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 53:     "tsx": "tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs",

  Line 139:     "tsx": "^4.22.4",
gateway · 2026-09-09 00:42:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-patches.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env tsx
2: /**
3:  * Check Patched Dependency Versions
4:  *
5:  * Verifies that pnpm patchedDependencies target versions match installed versions.
6:  * Name-only keys in patchedDependencies (pnpm 10+ catalog style) apply patches
7:  * to whatever version resolves. If the installed version doesn't match the
8:  * patch file's target version, the patch may silently fail to apply.
9:  *
10:  * Mismatches are surfaced as warnings (not hard failures) because pnpm 10
11:  * name-only keys intentionally support version-agnostic patching — patches
12:  * often apply cleanly across minor/patch bumps. The warning ensures engineers
13:  * notice and can regenerate the patch if needed. ...
gateway · 2026-09-09 00:42:49
result
No files found
gateway · 2026-09-09 00:42:56
result
symbolic link 'apps/cli-docs/public/install' -> '../../../packages/cli/install'
regular file 'packages/cli/install'
gateway · 2026-09-09 00:43:05
result
Found 11 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 975:     const url = getBinaryDownloadUrl("1.0.0");

  Line 980:       "https://github.com/getsentry/cli/releases/download/"


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

  Line 47:       "https://github.com/getsentry/cli/releases/download/"

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

  Line 119:       "https://api.github.com/repos/getsentry/cli/releases/latest",

  Line 168:       ...
gateway · 2026-09-09 00:43:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
190: describe("fetchLatestFromGitHub", () => {
191:   test("returns version from GitHub API", async () => {
192:     mockFetch(
193:       async () =>
194:         new Response(
195:           JSON.stringify({
196:             tag_name: "v1.2.3",
197:           }),
198:           {
199:             status: 200,
200:             headers: { "Content-Type": "application/json" },
201:           }
202:         )
203:     );
204: 
205:     const version = await fetchLatestFromGitHub();
206:     expect(version).toBe("1.2.3");
207:   });
208: 
209:   test("strips v prefix from version", async () => {
210:     mockFetch(
211:       async () =>
212:         new Response(
213:           JSON.stringify({
214:             tag_name: "v0.5.0",
215:           }),
216:           {
217:             status: 200,
218:       ...
gateway · 2026-09-09 00:43:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
540:     );
541: 
542:     const version = await fetchLatestVersion("curl");
543:     expect(version).toBe("3.0.0");
544:   });
545: });
546: 
547: describe("versionExists", () => {
548:   test("checks GitHub for curl method - version exists", async () => {
549:     mockFetch(async () => new Response(null, { status: 200 }));
550: 
551:     const exists = await versionExists("curl", "1.0.0");
552:     expect(exists).toBe(true);
553:   });
554: 
555:   test("checks GitHub for curl method - version does not exist", async () => {
556:     mockFetch(async () => new Response(null, { status: 404 }));
557: 
558:     const exists = await versionExists("curl", "99.99.99");
559:     expect(exists).toBe(false);
560:   });
561: 
562:   test("checks npm for npm method - version exists", async () => {
563:     ...
gateway · 2026-09-09 00:43:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 00:47:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
920:         default: false,
921:       },
922:       method: {
923:         kind: "parsed",
924:         parse: parseInstallationMethod,
925:         brief: "Installation method to use (curl, brew, npm, pnpm, bun, yarn)",
926:         optional: true,
927:         placeholder: "method",
928:       },
929:     },
930:   },
931:   async *func(this: SentryContext, flags: UpgradeFlags, version?: string) {
932:     const { channel, versionArg, channelChanged, method } =
933:       await resolveContext(version, flags);
934: 
935:     log.debug(`Installation method: ${method}`);
936:     log.debug(`Current version: ${CLI_VERSION}`);
937: 
938:     const resolved = await withProgress(
939:       { message: "Checking for updates...", json: flags.json },
940:       async () =>
941:         ...
gateway · 2026-09-09 00:47:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
100:   readonly method?: InstallationMethod;
101:   /** Injected by buildCommand output wrapper — suppresses spinners */
102:   readonly json?: boolean;
103: };
104: 
105: /**
106:  * Resolve effective channel and version arg from the positional `version`
107:  * parameter. "nightly" and "stable" are treated as channel selectors, not
108:  * literal version strings.
109:  *
110:  * @returns `{ channel, versionArg }` where versionArg is undefined when the
111:  *   positional was a channel name (so we resolve to latest) or was omitted. ...
gateway · 2026-09-09 00:47:36
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install:
  Line 280:     version=$(curl -fsSL https://api.github.com/repos/getsentry/cli/releases/latest \
gateway · 2026-09-09 00:47:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
250:   # Track the last-seen digest and print it when the target filename matches.
251:   # This avoids sed newline replacement which differs between GNU and BSD.
252:   gz_filename="sentry-${os}-${arch}${libc_suffix}${suffix}.gz"
253:   digest=$(echo "$MANIFEST" \
254:     | awk -F'"' -v target="$gz_filename" '{
255:         for(i=1;i<=NF;i++){
256:           if($i=="digest") d=$(i+2)
257:           if($i=="org.opencontainers.image.title"&&$(i+2)==target){print d;exit}
258:         }
259:       }')
260:   if [[ -z "$digest" ]]; then
261:     die "No nightly build found for ${gz_filename}" "ghcr-digest"
262:   fi
263: 
264:   # Step 5: Get the redirect URL from the blob endpoint (don't use -L: auth
265:   # header must NOT be forwarded to the Azure Blob Storage redirect target)
266:   redir_url=$(curl -s -w ...
gateway · 2026-09-09 00:47:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
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; then
182:         if [ "$(id -u)" = "0" ]; then
183:           echo -e "${MUTED}Installing required C++ runtime libraries...${NC}"
184:           apk add --no-cache libstdc++ libgcc >/dev/null 2>&1 \
185:             || die "Failed to install libstdc++ and libgcc (required for musl binary)" "deps"
186:         else
187:           echo -e "${RED}Missing required libraries: libstdc++ libgcc${NC}" >&2
188:           echo -e "${RED}Run: apk add libstdc++ libgcc${NC}" >&2
189:           die "Cannot install dependencies without root. Run as root or install manually." "deps"
190:         fi
191:       fi
192:     fi
193:   fi
194: fi
195: 
196: # Validate supported combinations
197: ...
gateway · 2026-09-09 00:48:00
result
Found 19 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install:
  Line 56:     curl -sf --max-time 2 \

  Line 70:   wait 2>/dev/null || true  # Let the background curl finish; ignore its exit status

  Line 96:     curl -fsSL https://cli.sentry.dev/install | bash

  Line 97:     curl -fsSL https://cli.sentry.dev/install | SENTRY_INIT=1 bash

  Line 98:     curl -fsSL https://cli.sentry.dev/install | bash -s -- --version nightly

  Line 99:     curl -fsSL https://cli.sentry.dev/install | bash -s -- --version 0.42.2

  Line 100:     SENTRY_VERSION=nightly curl -fsSL https://cli.sentry.dev/install | bash

  Line 101:     SENTRY_INSTALL_DIR=~/.local/bin curl -fsSL https://cli.sentry.dev/install | bash

  Line 216:   # ghcr.io blob downloads redirect to Azure Blob Storage. curl -L would

  Line 217:   # forward the Authorization header to Azure, which returns 404. ...
gateway · 2026-09-09 00:48:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
80: /**
81:  * Absolute legacy install directories for the given home. See
82:  * {@link LEGACY_INSTALL_SUBDIRS} for why this is scoped to pre-XDG locations.
83:  */
84: export function getLegacyInstallDirs(homeDir: string): string[] {
85:   return LEGACY_INSTALL_SUBDIRS.map((dir) => join(homeDir, dir));
86: }
87: 
88: /**
89:  * How the CLI was installed. Determines the upgrade strategy.
90:  *
91:  * Defined here (alongside other installation constants like
92:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
93:  * `db/install-info.ts` can import it without creating a circular
94:  * dependency. ...
gateway · 2026-09-09 00:48:29
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-09 00:48:37
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/ghcr.test.ts:
  Line 91:     const token = await getAnonymousToken();

  Line 105:     await expect(getAnonymousToken(UPGRADE_SOURCES[0])).resolves.toBe(

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

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

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

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

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

  Line 140:     await expect(getAnonymousToken()).rejects.toThrow(
gateway · 2026-09-09 00:48:48
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/ghcr.test.ts:
  Line 164:     const result = await fetchNightlyManifest("my-token");

  Line 182:       fetchNightlyManifest("token", undefined, UPGRADE_SOURCES[0])

  Line 189:     await expect(fetchNightlyManifest("token")).rejects.toThrow(UpgradeError);

  Line 190:     await expect(fetchNightlyManifest("token")).rejects.toThrow(

  Line 200:     await expect(fetchNightlyManifest("token")).rejects.toThrow(UpgradeError);

  Line 201:     await expect(fetchNightlyManifest("token")).rejects.toThrow(
gateway · 2026-09-09 00:48:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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-09 00:49:02
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 975:     const url = getBinaryDownloadUrl("1.0.0");


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

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


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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 234: export function getBinaryDownloadUrl(
gateway · 2026-09-09 00:49:41
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 315: export function compareVersions(a: string, b: string): -1 | 0 | 1 {
gateway · 2026-09-09 00:49:51
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
295:  *
296:  * Nightlies use the format `X.Y.Z-dev.<unix-seconds>` (the timestamp
297:  * format the build system bakes in).
298:  *
299:  * @param version - Version string to check
300:  * @returns true if the version is a nightly build
301:  */
302: export function isNightlyVersion(version: string): boolean {
303:   return version.includes("-dev.");
304: }
305: 
306: /**
307:  * Compare two version strings and return their ordering.
308:  *
309:  * Uses `Bun.semver.order` which handles both stable (`X.Y.Z`) and
310:  * nightly (`X.Y.Z-dev.<unix-seconds>`) versions correctly — the numeric
311:  * pre-release identifier is compared numerically per SemVer spec. ...
gateway · 2026-09-09 00:50:45
result
Found 94 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CHANGELOG.md:
  Line 783: - (dsn) Detect framework-prefixed DSN env vars in .env files and process.env by @cursor in [#852](https://github.com/getsentry/cli/pull/852)


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/pnpm-lock.yaml:
  Line 867:   '@hono/mcp@0.2.5':

  Line 1548:   '@sentry/cli@2.58.6':

  Line 4207:   trpc-cli@0.12.4:

  Line 5355:   '@hono/mcp@0.2.5(@modelcontextprotocol/sdk@1.29.0(zod@4.4.3))(hono-rate-limiter@0.4.2(hono@4.12.34))(hono@4.12.34)(zod@4.4.3)':

  Line 6000:   '@sentry/cli@2.58.6':

  Line 9255:   trpc-cli@0.12.4(@trpc/server@11.18.0(typescript@5.9.3))(valibot@1.4.2(typescript@5.9.3))(zod@4.4.3):


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/content/docs/features.md:
  Line 132: If you work with ...
gateway · 2026-09-09 00:51:09
result
Found 15 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 51:   fetchLatestVersion,

  Line 58:   versionExists,

  Line 136:  * fallback when `fetchLatestVersion()` hits a network error.

  Line 162:  *   Returns `null` when `resolveTargetVersion` returns a "done" result

  Line 202:     const resolved = await resolveTargetVersion(resolveOpts);

  Line 285: async function resolveTargetVersion(

  Line 289:   const latest = await fetchLatestVersion(method, channel);

  Line 325:     const exists = await versionExists(lookupMethod, target);

  Line 463:       // CLI-1D3). ...
gateway · 2026-09-09 00:51:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
580:  * relocate when the XDG target directory is *already* on `PATH`, so the moved
581:  * binary stays discoverable without any `PATH` edit. When it isn't, we keep
582:  * the binary in place and leave relocation to an explicit `sentry cli setup`.
583:  */
584: export function resolveUpgradeInstallDir(
585:   currentInstallDir: string,
586:   pathEnv: string | undefined
587: ): string {
588:   const legacyBinDir = join(homedir(), LEGACY_INSTALL_SUBDIR);
589:   if (!samePath(currentInstallDir, legacyBinDir)) {
590:     return currentInstallDir;
591:   }
592: 
593:   // determineInstallDir with the legacy pin removed yields the XDG target.
594:   const { SENTRY_INSTALL_DIR: _pinned, ...envWithoutPin } = process.env;
595:   const xdgInstallDir = determineInstallDir(homedir(), envWithoutPin);
596:   if ...
gateway · 2026-09-09 00:52:16
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json:
  Line 14:     "strict": true,

  Line 17:     "noUncheckedIndexedAccess": true,

  Line 24:     "strictNullChecks": true


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/init-eval/templates/sveltekit-app/tsconfig.json:
  Line 12: 		"strict": true,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/init-eval/templates/react-vite-app/tsconfig.json:
  Line 13:     "strict": true,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/init-eval/templates/nextjs-app/tsconfig.json:
  Line 7:     "strict": ...
gateway · 2026-09-09 00:52:28
result
src/lib/binary.ts(236,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
src/lib/binary.ts(244,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
gateway · 2026-09-09 00:52:52
result
 DEPRECATED  `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. Please, refer to the migration guide: https://vitest.dev/guide/migration#pool-rework

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  test/lib/binary.test.ts > getBinaryDownloadUrl > builds correct URL for current platform
AssertionError: expected 'https://github.com/getsentry/toolkit/…' to contain '/1.0.0/'

Expected: "/1.0.0/"
Received: "https://github.com/getsentry/toolkit/releases/download/cli@1.0.0/sentry-linux-x64"

 ❯ test/lib/binary.test.ts:45:17
     43|     const url = getBinaryDownloadUrl("1.0.0");
     44|
     45|     expect(url).toContain("/1.0.0/");
       |                 ^
     46|     expect(url).toStartWith(
     47|       "https://github.com/getsentry/cli/releases/download/"

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯

 FAIL  test/lib/ghcr.test.ts > getAnonymousToken > uses the selected source's GHCR repository
AssertionError: promise rejected "UpgradeError: Failed to connect ...
gateway · 2026-09-09 00:53:39
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/content/docs/contributing.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
gateway · 2026-09-09 00:53:51
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-09 00:57:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
250:   }
251: }
252: 
253: /**
254:  * Start a background check for new versions.
255:  * Does not block - fires a fetch and lets it complete in the background.
256:  * Reports errors to Sentry in a detached span for visibility.
257:  * Never throws - errors are caught and reported to Sentry.
258:  */
259: function checkForUpdateInBackgroundImpl(): void {
260:   try {
261:     if (!shouldCheckForUpdate()) {
262:       return;
263:     }
264:   } catch (error) {
265:     // DB access failed - report to Sentry but don't crash CLI
266:     Sentry.captureException(error);
267:     return;
268:   }
269: 
270:   pendingAbortController = new AbortController();
271:   const { signal } = pendingAbortController;
272: 
273:   const channel = getReleaseChannel();
274: 
275:   Sentry.startSpanManual(
276:     {
277:  ...
gateway · 2026-09-09 00:57:19
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 18:   GITHUB_RELEASES_URL,

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

  Line 602: async function fetchStableChangelog(

  Line 729:     return await fetchStableChangelog(
gateway · 2026-09-09 00:57:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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-09 00:57:40
result
Found 19 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 35:   GITHUB_RELEASES_URL,

  Line 44: import { GHCR_REPO } from "./ghcr.js";

  Line 61:   getStableTargetSha256,

  Line 72: // GHCR_REPO). Importing as a named import keeps a single source of truth and

  Line 122: function stableSource(): SourceStrategy {

  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 181: export async function downloadStablePatch(

  Line 270: export function resolveStableChain(

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

  Line 288:     repo: GHCR_REPO,

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

  Line 308:       ...
gateway · 2026-09-09 00:57:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:58:00
result
Found 21 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 399: export async function fetchLatestFromGitHub(

  Line 467: export async function fetchLatestNightlyVersion(

  Line 498: export function fetchLatestVersion(

  Line 503:     return fetchLatestNightlyVersion();

  Line 506:     ? fetchLatestFromGitHub()

  Line 522: async function nightlyVersionExists(version: string): Promise<boolean> {

  Line 551: export async function versionExists(

  Line 557:     return nightlyVersionExists(version);

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

  Line 728: async function downloadNightlyToPath(

  Line 761: async function downloadStableToPath(

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

  Line 884:  * {@link downloadStableToPath}. ...
gateway · 2026-09-09 00:58:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
380:       });
381:     } catch {
382:       log.debug("Failed to persist install info (DB may be read-only)");
383:     }
384:   }
385: 
386:   return legacyMethod;
387: }
388: 
389: // Version Fetching
390: 
391: /**
392:  * Fetch the latest version from GitHub releases.
393:  *
394:  * @param signal - Optional AbortSignal to cancel the request
395:  * @returns Latest version string (without 'v' prefix)
396:  * @throws {UpgradeError} When fetch fails or response is invalid
397:  * @throws {Error} AbortError if signal is aborted
398:  */
399: export async function fetchLatestFromGitHub(
400:   signal?: AbortSignal
401: ): Promise<string> {
402:   const response = await fetchWithUpgradeError(
403:     `${GITHUB_RELEASES_URL}/latest`,
404:     { headers: getGitHubHeaders(), signal },
405:     "GitHub"
406:   ...
gateway · 2026-09-09 00:58:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
710: function getNightlyGzFilename(): string {
711:   return `${getPlatformBinaryName()}.gz`;
712: }
713: 
714: /**
715:  * Download a nightly binary from GHCR and decompress it to `destPath`.
716:  *
717:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
718:  * matching this platform's `.gz` filename, then downloads and decompresses
719:  * the blob in-stream.
720:  *
721:  * When `version` is provided, fetches the pinned versioned tag
722:  * (`nightly-{version}`). Otherwise fetches the rolling `:nightly` tag. ...
gateway · 2026-09-09 00:58:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1090:           )
1091:         );
1092:       }
1093:     });
1094: 
1095:     proc.on("error", (err) => {
1096:       reject(
1097:         new UpgradeError("execution_failed", `${pm} failed: ${err.message}`)
1098:       );
1099:     });
1100:   });
1101: }
1102: 
1103: /**
1104:  * Execute the upgrade using the appropriate method.
1105:  *
1106:  * For curl installs, downloads the new binary to a temp path and returns a
1107:  * DownloadResult with the binary path and lock path. The caller should spawn
1108:  * `setup --install` on the new binary, then release the lock.
1109:  *
1110:  * For package manager installs, runs the package manager's global install
1111:  * command (which replaces the binary in-place). The caller should then
1112:  * spawn `setup` on the new binary for completions/agent skills. ...
gateway · 2026-09-09 00:58:45
result
No files found
gateway · 2026-09-09 00:58:57
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 111:     "binpatch": "^0.4.2",
gateway · 2026-09-09 00:59:10
result
No files found
gateway · 2026-09-09 00:59:22
result
drwxr-xr-x 1 byk byk  88 Sep  8 20:35 node_modules
drwxr-xr-x 1 byk byk 798 Sep  8 20:35 packages/cli/node_modules
lrwxrwxrwx 1 byk byk  64 Sep  8 20:35 packages/cli/node_modules/binpatch -> ../../../node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch
gateway · 2026-09-09 00:59:30
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch</path>
<type>directory</type>
<entries>
dist/
LICENSE
package.json
README.md

(4 entries)
</entries>
gateway · 2026-09-09 00:59:40
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js.map
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js
gateway · 2026-09-09 00:59:48
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts:
  Line 254:  * resolveAndApply({ source: ghcrSource({ ..., instrument }), ... });

  Line 288: /** A structured progress event emitted during {@link resolveAndApply}. */

  Line 334: type SourceStrategy = {

  Line 335:     resolveChain(currentVersion: string, targetVersion: string, signal?: AbortSignal, report?: UnavailableReporter): Promise<PatchChain | null>;

  Line 395: declare function resolveAndApply(opts: ResolveAndApplyOpts): Promise<DeltaResult | null>;

  Line 614: export { BinpatchError, type BinpatchErrorReason, type ChainMeta, type ChainStep, type DeltaResult, type DeltaSource, type DeltaTelemetry, type DeltaUnavailableReason, type ExtractStableChainOpts, type GhcrSourceConfig, type GitHubAsset, type GitHubRelease, type GitHubReleaseSourceConfig, type InstrumentHook, ...
gateway · 2026-09-09 00:59:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts</path>
<type>file</type>
<content>
320: 
321: /**
322:  * A source of patch chains. Given the current and target versions, resolve the
323:  * ordered chain of patches (oldest hop first) plus the expected final SHA-256,
324:  * or `null` when no usable chain exists (caller falls back to a full download).
325:  *
326:  * A source may optionally classify *why* it returned `null` by invoking the
327:  * `report` callback with a {@link DeltaUnavailableReason}. This is telemetry
328:  * only — it never changes control flow (a `null` return is always a full-
329:  * download fallback). ...
gateway · 2026-09-09 01:00:02
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js:
  Line 654: async function resolveAndApply(opts) {
gateway · 2026-09-09 01:00:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
640: 
641: // src/events.ts
642: function safeProgress(handler) {
643:   if (!handler) return () => {
644:   };
645:   return (event) => {
646:     try {
647:       handler(event);
648:     } catch {
649:     }
650:   };
651: }
652: 
653: // src/discover.ts
654: async function resolveAndApply(opts) {
655:   const {
656:     source,
657:     currentVersion,
658:     targetVersion,
659:     oldPath,
660:     destPath,
661:     cache,
662:     offline,
663:     onProgress,
664:     telemetry,
665:     signal
666:   } = opts;
667:   const progress = safeProgress(onProgress);
668:   if (cache) {
669:     const cached = await tryLoadCachedChain(
670:       cache,
671:       currentVersion,
672:       targetVersion
673:     );
674:     if (cached) {
675:       ...
gateway · 2026-09-09 01:00:50
result
Found 30 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 106: export type UpgradeSource = {

  Line 116: export const UPGRADE_SOURCES: readonly UpgradeSource[] = [

  Line 130: export const PRIMARY_UPGRADE_SOURCE = UPGRADE_SOURCES[0];

  Line 236:   source: UpgradeSource = PRIMARY_UPGRADE_SOURCE

  Line 243: export function getGitHubReleasesUrl(

  Line 244:   source: UpgradeSource = PRIMARY_UPGRADE_SOURCE

  Line 250: export const GITHUB_RELEASES_URL = getGitHubReleasesUrl();

  Line 253: export type ResolvedUpgradeSource = {

  Line 255:   readonly source: UpgradeSource;

  Line 267: export async ...
gateway · 2026-09-09 01:01:09
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 6:  * The `executeUpgrade` and `detectInstallationMethod` subprocess tests use

  Line 135:   downloadBinaryToTemp,

  Line 136:   executeUpgrade,

  Line 137:   fetchLatestFromGitHub,

  Line 139:   fetchLatestNightlyVersion,

  Line 140:   fetchLatestVersion,

  Line 144:   versionExists,

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

  Line 205:     const version = await fetchLatestFromGitHub();

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

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

  Line 265:     await ...
gateway · 2026-09-09 01:01:20
result
Found 15 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 122: function stableSource(): SourceStrategy {

  Line 132: function nightlySource(): SourceStrategy {

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

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

  Line 464: function resolveDelta(

  Line 494:   return resolveDelta(

  Line 495:     stableSource(),

  Line 512:   return resolveDelta(

  Line 513:     nightlySource(),

  Line 523: export function attemptDeltaUpgrade(

  Line 542:         const resolved = await resolveDelta(

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

  Line 600: async function prefetch(

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

  Line 626:   return prefetch(stableSource(), targetVersion, signal);
gateway · 2026-09-09 01:01:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
430:       previousWritten = event.written;
431:     } else if (event.type === "done") {
432:       progress?.done();
433:     }
434:   };
435: }
436: 
437: function telemetry(): DeltaTelemetry & { _source: { current?: string } } {
438:   // Expose `current` so attemptDeltaUpgrade's catch path can stamp
439:   // `delta.source` on the active span even when apply fails AFTER a chain
440:   // was successfully resolved (the catch previously left the span without
441:   // this attribute, silently downgrading telemetry fidelity).
442:   const captured: { current?: string } = {};
443:   return {
444:     _source: captured,
445:     onResolved: ({ source, chain }) => {
446:       captured.current = source;
447:       const span = Sentry.getActiveSpan();
448:       span?.setAttribute("delta.source", ...
gateway · 2026-09-09 01:01:33
result
Found 10 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 237:       await prefetchNightlyPatches(latestVersion, signal);

  Line 239:       await prefetchStablePatches(latestVersion, signal);


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

  Line 270: export function resolveStableChain(

  Line 278: export async function resolveNightlyChain(opts: {

  Line 487: export function resolveStableDelta(

  Line 505: export function resolveNightlyDelta(

  Line 615: export function prefetchNightlyPatches(

  Line 622: export function prefetchStablePatches(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 554:  * Uses a higher ...
gateway · 2026-09-09 01:01:40
result
## feat/toolkit-bridge-upgrade...origin/main
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
0e661a5f5 (HEAD -> feat/toolkit-bridge-upgrade, origin/main, origin/HEAD) fix(org): log region URL parse failures in org list (#1539)
9d0901b10 feat(local): Add agent debugging stream (#1538)
72c307f47 fix(cli): log UID resolution failures in sentry cli fix (#1541)
e710ce905 fix(telemetry): log process-tree walk failures in agent detection (#1542)
6e3e7e13a feat(config): follow XDG Base Directory spec for config location (#1503)
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
gateway · 2026-09-09 01:01:53
result
Found 77 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 206:  * Handles the latest release endpoint, version-exists check, and npm registry.

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

  Line 213:     if (urlStr.includes("releases/latest")) {

  Line 413:         if (urlStr.includes("releases/latest")) {

  Line 749:       if (urlStr.includes("releases/latest")) {

  Line 875:       if (urlStr.includes("releases/latest")) {


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

  Line 286:             ? await fetchLatestNightlyVersion(signal)

  Line 287:             : await ...
gateway · 2026-09-09 01:02:01
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/binary.test.ts:
  Line 34:   resolveUpgradeSource,

  Line 83: describe("resolveUpgradeSource", () => {

  Line 87:     const resolved = await resolveUpgradeSource(async (url) => {

  Line 106:     const resolved = await resolveUpgradeSource(async (url) => {

  Line 129:         resolveUpgradeSource(async (url) => {

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

  Line 160:       resolveUpgradeSource(async (url) => {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 267: export async function resolveUpgradeSource(
gateway · 2026-09-09 01:02:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 01:02:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, sep } 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:   getLegacyInstallDirs,
29:   getPlatformBinaryName,
30:   installBinary,
31:   ...
gateway · 2026-09-09 01:02:39
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 82: export const NIGHTLY_TAG = "nightly";

  Line 896:  * @param downloadTag - Git tag to use in the download URL. Defaults to `version`.

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

  Line 904:   downloadTag?: string,

  Line 943:       await downloadFullBinary(version, downloadTag, tempPath, setMessage);

  Line 1004:  * @param downloadTag - Git tag override for the download URL

  Line 1009:   downloadTag: string | undefined,

  Line 1016:     await downloadStableToPath(downloadTag ?? version, destPath, setMessage);

  Line 1116:  * @param downloadTag - Git tag to download from. Defaults to `version`.

  Line 1117:  *   Pass `NIGHTLY_TAG` for nightly installs so the URL uses the "nightly" tag.

  Line 1125:   downloadTag?: string,

  Line 1131:       return ...
gateway · 2026-09-09 01:03:03
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, isAbsolute, join, resolve, sep } 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, ...
gateway · 2026-09-09 01:03:20
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 426: export async function fetchWithUpgradeError(
gateway · 2026-09-09 01:03:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
400: 
401:   // 5. XDG-aligned fallback — setup will handle adding this to PATH
402:   return join(homeDir, ".local", "bin");
403: }
404: 
405: /**
406:  * Build headers for GitHub API requests.
407:  */
408: export function getGitHubHeaders(): Record<string, string> {
409:   return {
410:     Accept: "application/vnd.github.v3+json",
411:     "User-Agent": getUserAgent(),
412:   };
413: }
414: 
415: /**
416:  * Fetch wrapper that converts network errors to UpgradeError.
417:  * Handles DNS failures, timeouts, and other connection issues.
418:  *
419:  * @param url - URL to fetch
420:  * @param init - Fetch options
421:  * @param serviceName - Service name for error messages (e.g., "GitHub")
422:  * @returns Response object
423:  * @throws {UpgradeError} On network failure
424:  * @throws {Error} AbortError if ...
gateway · 2026-09-09 01:03:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: import { UPGRADE_SOURCES } from "../../src/lib/binary.js";
21: 
22: function noop(): void {
23:   // Intentionally empty — absorbs async spawn errors
24: }
25: 
26: const repoRoot = join(import.meta.dirname, "..", "..");
27: const installScript = join(repoRoot, ...
gateway · 2026-09-09 01:03:49
result
No files found
gateway · 2026-09-09 01:05:56
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts:
  Line 586: export type UpgradeErrorReason =

  Line 600: export class UpgradeError extends CliError {
gateway · 2026-09-09 01:06:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 01:07:12
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-09 01:07:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
35:     "dist/assets/spleen-8x16.bin",
36:     "dist/vendor/symbolic_bg.wasm",
37:     "LICENSE.md",
38:     "THIRD_PARTY_LICENSES.md",
39:     "README.md"
40:   ],
41:   "license": "FSL-1.1-Apache-2.0",
42:   "engines": {
43:     "node": ">=20.0"
44:   },
45:   "devEngines": {
46:     "runtime": {
47:       "name": "node",
48:       "version": ">=22.15"
49:     }
50:   },
51:   "packageManager": "pnpm@10.11.0",
52:   "scripts": {
53:     "tsx": "tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs",
54:     "cli": "tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs src/bin.ts",
55:     "dev": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && tsx --import ./script/require-shim.mjs src/bin.ts",
56:     "build": "pnpm run generate:schema && pnpm run ...
gateway · 2026-09-09 01:07:59
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 188:         run: pnpm run check:fragments

  Line 244:       - run: pnpm run check:deps

  Line 245:       - run: pnpm run check:errors

  Line 246:       - run: pnpm run check:patches

  Line 247:       - run: pnpm run check:stale-refs
gateway · 2026-09-09 01:08:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
215:         if: (steps.check-skill.outputs.stale == 'true' || steps.check-sections.outputs.stale == 'true') && steps.token.outcome != 'success'
216:         run: |
217:           echo "::error::Generated files are out of date. Run 'pnpm run generate:docs' locally and commit the result."
218:           exit 1
219: 
220:   lint:
221:     name: Lint & Typecheck
222:     needs: [changes]
223:     if: needs.changes.outputs.code == 'true'
224:     runs-on: ubuntu-latest
225:     steps:
226:       - uses: actions/checkout@v6
227:       - uses: pnpm/action-setup@v4
228:       - uses: actions/setup-node@v6
229:         with:
230:           node-version: ${{ env.NODE_VERSION_22 }}
231:       - uses: actions/cache@v5
232:         id: cache
233:         with:
234:           path: |
235:             node_modules
236:             ...
gateway · 2026-09-09 01:08:21
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.lore.md:
  Line 38: * **Consola chosen as CLI logger with Sentry createConsolaReporter integration**: Consola is the CLI logger with Sentry \`createConsolaReporter\` integration. Two reporters: FancyReporter (stderr) + Sentry structured logs. Level via \`SENTRY\_LOG\_LEVEL\`. \`buildCommand\` injects hidden \`--log-level\`/\`--verbose\` flags. \`withTag()\` creates independent instances; \`setLogLevel()\` propagates via registry. All user-facing output must use consola, not raw stderr. \`HandlerContext\` intentionally omits stderr. Telemetry opt-out priority: (1) \`SENTRY\_CLI\_NO\_TELEMETRY=1\`, (2) \`DO\_NOT\_TRACK=1\`, (3) \`metadata.defaults.telemetry\`, (4) default on. Shell completions set \`SENTRY\_CLI\_NO\_TELEMETRY=1\` in \`bin.ts\` before imports. Timing queued to \`completion\_telemetry\_queue\` SQLite table; normal runs drain via \`DELETE ... ...
gateway · 2026-09-09 01:08:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
190:         }),
191:         {
192:           status: 200,
193:           headers: {
194:             "content-type": "application/vnd.oci.image.manifest.v1+json",
195:           },
196:         }
197:       );
198:     }
199: 
200:     return new Response("Not Found", { status: 404 });
201:   });
202: }
203: 
204: /**
205:  * Mock fetch to simulate GitHub releases API returning a specific version.
206:  * Handles the latest release endpoint, version-exists check, and npm registry.
207:  */
208: function mockGitHubVersion(version: string): void {
209:   mockFetch(async (url) => {
210:     const urlStr = String(url);
211: 
212:     // GitHub latest release endpoint — returns JSON with tag_name
213:     if (urlStr.includes("releases/latest")) {
214:       return new Response(JSON.stringify({ ...
gateway · 2026-09-09 01:10:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
279: /**
280:  * Resolve the target version and handle check-only mode.
281:  *
282:  * @returns A `ResolveResult` indicating whether to proceed with the upgrade
283:  *   or return a completed result immediately.
284:  */
285: async function resolveTargetVersion(
286:   opts: ResolveTargetOptions
287: ): Promise<ResolveResult> {
288:   const { method, channel, versionArg, channelChanged, flags } = opts;
289:   const latest = await fetchLatestVersion(method, channel);
290:   const target = versionArg?.replace(VERSION_PREFIX_REGEX, "") ?? latest;
291: 
292:   log.debug(`Channel: ${channel}`);
293:   log.debug(`Latest version: ${latest}`);
294:   if (versionArg) {
295:     log.debug(`Target version: ${target}`);
296:   }
297: 
298:   if (flags.check) {
299:     return {
300:       kind: "done",
301:     ...
gateway · 2026-09-09 01:10:55
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 202:     const resolved = await resolveTargetVersion(resolveOpts);

  Line 221:       return { kind: "target", target, offline: "network-fallback" };

  Line 285: async function resolveTargetVersion(

  Line 642:       executeUpgrade(method, target, downloadTag, offline, setMessage)

  Line 727:       executeUpgrade("curl", target, downloadTag, undefined, setMessage)
gateway · 2026-09-09 01:11:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
165: async function resolveTargetWithFallback(opts: {
166:   resolveOpts: ResolveTargetOptions;
167:   versionArg: string | undefined;
168:   offline: boolean;
169:   /** Only curl-installed binaries support offline fallback */
170:   method: InstallationMethod;
171:   /** Persist the channel after offline target resolution (deferred to avoid
172:    *  clearing the version cache before the offline path can read it). ...
gateway · 2026-09-09 01:11:22
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 36: import { getVersionCheckInfo } from "../../lib/db/version-check.js";

  Line 142: function resolveOfflineTarget(versionArg: string | undefined): string {

  Line 146:   const { latestVersion } = getVersionCheckInfo();

  Line 147:   if (!latestVersion) {

  Line 153:   return latestVersion;

  Line 192:     const target = resolveOfflineTarget(versionArg);

  Line 218:       const target = resolveOfflineTarget(versionArg);

  Line 806:  * cache on channel changes, which would prevent `resolveOfflineTarget()`
gateway · 2026-09-09 01:11:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
125:   }
126: 
127:   return {
128:     channel: getReleaseChannel(),
129:     versionArg: positional,
130:   };
131: }
132: 
133: /**
134:  * Resolve the target version from the local cache (SQLite) instead of
135:  * fetching from the network. Used by `--offline` and as automatic
136:  * fallback when `fetchLatestVersion()` hits a network error.
137:  *
138:  * @param versionArg - Explicit version from the user, bypasses the cache lookup
139:  * @returns The target version string
140:  * @throws {UpgradeError} When no cached version is available
141:  */
142: function resolveOfflineTarget(versionArg: string | undefined): string {
143:   if (versionArg) {
144:     return versionArg.replace(VERSION_PREFIX_REGEX, "");
145:   }
146:   const { latestVersion } = getVersionCheckInfo();
147:   if ...
gateway · 2026-09-09 01:12:06
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:12:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
480:     const tags = await fetchTagPage(token, lastTag, signal);
481:     if (tags.length === 0) {
482:       break;
483:     }
484: 
485:     for (const tag of tags) {
486:       if (!prefix || tag.startsWith(prefix)) {
487:         allTags.push(tag);
488:       }
489:     }
490: 
491:     if (tags.length < TAGS_PAGE_SIZE) {
492:       break;
493:     }
494: 
495:     lastTag = tags.at(-1);
496:   }
497: 
498:   return allTags;
499: }
500: 
501: /**
502:  * Download an OCI layer blob as an ArrayBuffer.
503:  *
504:  * Uses the same redirect-without-auth pattern as {@link downloadNightlyBlob},
505:  * but returns the fully-buffered ArrayBuffer instead of a streaming Response.
506:  * Suitable for small payloads like patch files (50-500 KB). ...
gateway · 2026-09-09 01:12:26
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 476:   const token = await getAnonymousToken();

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

  Line 523:   const token = await getAnonymousToken();

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

  Line 733:   const token = await getAnonymousToken();

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

  Line 736:     : await fetchNightlyManifest(token);

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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(

  ...
gateway · 2026-09-09 01:12:44
result
Found 10 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 1169:     const chain = await resolveNightlyChain({

  Line 1187:     const chain = await resolveNightlyChain({

  Line 1206:     const chain = await resolveNightlyChain({

  Line 1261:     const chain = await resolveNightlyChain({

  Line 1302:     const chain = await resolveNightlyChain({

  Line 1335:     const chain = await resolveNightlyChain({

  Line 1353:     const chain = await resolveNightlyChain({

  Line 1389:     const chain = await resolveNightlyChain({

  Line 1423:     const chain = await resolveNightlyChain({

  Line 1456:     const chain = await resolveNightlyChain({
gateway · 2026-09-09 01:13:09
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/AGENTS.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md
gateway · 2026-09-09 01:13:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-09 01:13:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:13:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 01:14:11
result
Found 42 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install:
  Line 54:       "{\"event_id\":\"${event_id}\",\"timestamp\":\"${timestamp}\",\"platform\":\"other\",\"level\":\"error\",\"logger\":\"install\",\"server_name\":\"install-script\",\"message\":{\"formatted\":\"${json_msg}\"},\"tags\":{\"os\":\"${os:-unknown}\",\"arch\":\"${arch:-unknown}\",\"libc\":\"${libc_variant:-glibc}\",\"channel\":\"${json_channel}\",\"step\":\"${json_step}\",\"install.version\":\"${json_version}\"},\"contexts\":{\"runtime\":{\"name\":\"bash\",\"version\":\"${BASH_VERSION:-unknown}\"}}}")

  Line 56:     curl -sf --max-time 2 \

  Line 70:   wait 2>/dev/null || true  # Let the background curl finish; ignore its exit status

  Line 85:     -v, --version <version> Install a specific version (e.g., 0.2.0) or "nightly"

  Line 92:     SENTRY_VERSION          Install a specific version (e.g., 0.42.2, nightly)

  Line 96:     ...
gateway · 2026-09-09 01:14:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
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; then
182:         if [ "$(id -u)" = "0" ]; then
183:           echo -e "${MUTED}Installing required C++ runtime libraries...${NC}"
184:           apk add --no-cache libstdc++ libgcc >/dev/null 2>&1 \
185:             || die "Failed to install libstdc++ and libgcc (required for musl binary)" "deps"
186:         else
187:           echo -e "${RED}Missing required libraries: libstdc++ libgcc${NC}" >&2
188:           echo -e "${RED}Run: apk add libstdc++ libgcc${NC}" >&2
189:           die "Cannot install dependencies without root. Run as root or install manually." "deps"
190:         fi
191:       fi
192:     fi
193:   fi
194: fi
195: 
196: # Validate supported combinations
197: ...
gateway · 2026-09-09 01:15:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
88: /**
89:  * How the CLI was installed. Determines the upgrade strategy.
90:  *
91:  * Defined here (alongside other installation constants like
92:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
93:  * `db/install-info.ts` can import it without creating a circular
94:  * dependency.
95:  */
96: export type InstallationMethod =
97:   | "curl"
98:   | "brew"
99:   | "npm"
100:   | "pnpm"
101:   | "bun"
102:   | "yarn"
103:   | "unknown";
104: 
105: /** A repository pair that hosts CLI stable releases and nightly OCI images. */
106: export type UpgradeSource = {
107:   /** GitHub `owner/repository` containing CLI release assets. */
108:   readonly githubRepo: string;
109:   /** GHCR `owner/package` containing CLI nightly images and delta patches. ...
gateway · 2026-09-09 01:15:19
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts:
  Line 557: type GitHubRelease = {

  Line 591: type GitHubReleaseSourceConfig = {

  Line 614: export { BinpatchError, type BinpatchErrorReason, type ChainMeta, type ChainStep, type DeltaResult, type DeltaSource, type DeltaTelemetry, type DeltaUnavailableReason, type ExtractStableChainOpts, type GhcrSourceConfig, type GitHubAsset, type GitHubRelease, type GitHubReleaseSourceConfig, type InstrumentHook, MAX_NIGHTLY_CHAIN_DEPTH, MAX_OUTPUT_SIZE, MAX_STABLE_CHAIN_DEPTH, type NightlyChainFailure, OciClient, type OciClientConfig, type OciLayer, type OciManifest, PATCH_TAG_PREFIX, type PatchCache, type PatchChain, type PatchHeader, type PatchLink, type PatchStepMeta, type ProgressEvent, type ProgressHandler, type ProgressPhase, type ResolveAndApplyOpts, SIZE_THRESHOLD_RATIO, type SourceStrategy, ...
gateway · 2026-09-09 01:15:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts</path>
<type>file</type>
<content>
540:  * - `<binaryName>`        — the binary (its digest → expected SHA-256)
541:  * - `<binaryName>.gz`     — gzipped binary (its size → the ratio gate)
542:  * - `<binaryName>.patch`  — the delta patch from the previous release
543:  *
544:  * The chain is the releases between current and target, oldest-first, capped
545:  * at {@link MAX_STABLE_CHAIN_DEPTH} and by {@link SIZE_THRESHOLD_RATIO}.
546:  *
547:  * All product specifics (owner/repo, binary name, user-agent, fetch) are
548:  * injected. Generalized from Lore's stable-channel resolver.
549:  */
550: 
551: type GitHubAsset = {
552:     name: string;
553:     size: number;
554:     digest?: string;
555:     browser_download_url: string;
556: };
557: type GitHubRelease = {
558:     tag_name: string;
559:     ...
gateway · 2026-09-09 01:15:44
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js:
  Line 1225: function githubReleaseSource(config) {
gateway · 2026-09-09 01:15:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
1180: function getStableTargetSha256(release, binaryName) {
1181:   const binaryAsset = release.assets.find((a) => a.name === binaryName);
1182:   if (!binaryAsset) return null;
1183:   return extractSha256(binaryAsset);
1184: }
1185: function isStableChainFailure(v) {
1186:   return "failure" in v;
1187: }
1188: function extractStableChain(opts) {
1189:   const { releases, currentVersion, targetVersion, binaryName, fullGzSize } = opts;
1190:   const patchAssetName = `${binaryName}.patch`;
1191:   const targetIdx = releases.findIndex((r) => r.tag_name === targetVersion);
1192:   const currentIdx = releases.findIndex((r) => r.tag_name === currentVersion);
1193:   if (targetIdx === -1 || currentIdx === -1 || targetIdx >= currentIdx) {
1194:     return { failure: "no_patches" ...
gateway · 2026-09-09 01:16:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
1290:       });
1291:       if (isStableChainFailure(chainInfo)) {
1292:         report?.(chainInfo.failure);
1293:         return null;
1294:       }
1295:       const downloadResults = await Promise.all(
1296:         chainInfo.patchUrls.map((url) => downloadPatch(url, signal))
1297:       );
1298:       const patches = [];
1299:       let totalSize = 0;
1300:       for (const data of downloadResults) {
1301:         if (!data) {
1302:           report?.("network");
1303:           return null;
1304:         }
1305:         patches.push({ data, size: data.byteLength });
1306:         totalSize += data.byteLength;
1307:       }
1308:       return {
1309:         patches,
1310:         totalSize,
1311:         expectedSha256: chainInfo.expectedSha256,
1312:         steps: ...
gateway · 2026-09-09 01:16:11
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js:
  Line 1038: function ghcrSource(config) {
gateway · 2026-09-09 01:16:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
1020:     });
1021:     if (!result.ok) {
1022:       return {
1023:         failure: result.reason === "over_budget" ? "over_budget" : "malformed_chain"
1024:       };
1025:     }
1026:     digests.push(result.digest);
1027:     totalSize += result.size;
1028:     prevVersion = tag.slice(PATCH_TAG_PREFIX.length);
1029:     if (i === manifests.length - 1) {
1030:       if (prevVersion !== targetVersion) return { failure: "malformed_chain" };
1031:       const sha256 = getPatchTargetSha256(manifest, binaryName) ?? "";
1032:       if (!sha256) return { failure: "malformed_chain" };
1033:       return { digests, totalSize, expectedSha256: sha256 };
1034:     }
1035:   }
1036:   return { failure: "malformed_chain" };
1037: }
1038: function ghcrSource(config) {
1039:   const { ...
gateway · 2026-09-09 01:16:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
1085:     }
1086:     const manifests = chainTags.map((tag) => fetchedManifests.get(tag));
1087:     if (manifests.some((m) => !m)) {
1088:       report?.(fetchFailed ? "network" : "malformed_chain");
1089:       return null;
1090:     }
1091:     const validation = validateNightlyChain({
1092:       manifests,
1093:       chainTags,
1094:       currentVersion,
1095:       targetVersion,
1096:       patchLayerName,
1097:       binaryName,
1098:       fullGzSize
1099:     });
1100:     if (isChainFailure(validation)) {
1101:       report?.(validation.failure);
1102:       return null;
1103:     }
1104:     const downloadResults = await Promise.all(
1105:       validation.digests.map(
1106:         (digest) => i(
1107:           "download-patch",
1108:           () => ...
gateway · 2026-09-09 01:16:45
result
Found 23 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/sentry-urls.ts:
  Line 427:  * characters (e.g., `sentry-cli@0.24.0`, `1.0.0-beta+build.123`).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 112:   readonly tagPrefix: string;

  Line 120:     tagPrefix: "cli@",

  Line 125:     tagPrefix: "",

  Line 238:   const tag = `${source.tagPrefix}${version}`;


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/api/releases.ts:
  Line 146:  * @param version - Release version string (e.g., "1.0.0", "sentry-cli@0.24.0")


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/release/view.ts:
  Line 168:       '  sentry release view "sentry-cli@0.24.0"\n' ...
gateway · 2026-09-09 01:17:06
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-09 01:18:33
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 720: export async function fetchChangelog(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 834:   return fetchChangelog({
gateway · 2026-09-09 01:18:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
615:   entryPath?: string;
616:   pathEnv?: string;
617:   offline?: OfflineMode;
618:   json?: boolean;
619:   noAgentSkills: boolean;
620: }): Promise<void> {
621:   const {
622:     method,
623:     channel,
624:     versionArg,
625:     target,
626:     execPath,
627:     entryPath,
628:     pathEnv,
629:     offline,
630:     json,
631:     noAgentSkills,
632:   } = opts;
633: 
634:   // Use the rolling "nightly" tag only when upgrading to latest nightly
635:   // (no specific version was requested). A specific version arg always
636:   // uses its own tag so the correct release is downloaded.
637:   const downloadTag =
638:     channel === "nightly" && !versionArg ? NIGHTLY_TAG : undefined;
639:   const downloadResult = await withProgress(
640:     { message: `Downloading ${target}...`, json ...
gateway · 2026-09-09 01:18:52
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
895:           placeholder: "version",
896:           optional: true,
897:         },
898:       ],
899:     },
900:     flags: {
901:       check: {
902:         kind: "boolean",
903:         brief: "Check for updates without installing",
904:         default: false,
905:       },
906:       force: {
907:         kind: "boolean",
908:         brief: "Force upgrade even if already on the latest version",
909:         default: false,
910:       },
911:       offline: {
912:         kind: "boolean",
913:         brief:
914:           "Upgrade using only cached version info and patches (no network)",
915:         default: false,
916:       },
917:       "no-agent-skills": {
918:         kind: "boolean",
919:         brief: "Skip agent skill installation for AI coding assistants",
920:         default: ...
gateway · 2026-09-09 01:20:25
result
No files found
gateway · 2026-09-09 01:20:34
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.craft.yml
gateway · 2026-09-09 01:20:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:         - 'vercel'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: vercel
20:     projectId: prj_wVkOnIwI3eIQbGD1Gw7qS1MqFFIK
21:   - name: registry
22:     apps:
23:       'app:sentry':
24:         name: 'Sentry CLI'
25:         packageUrl: 'https://www.npmjs.com/package/sentry'
26:         mainDocsUrl: 'https://cli.sentry.dev'
27:         urlTemplate: ...
gateway · 2026-09-09 01:20:49
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/sentry-release.yml:
  Line 38:       VERSION: ${{ github.event.release.tag_name || inputs.version }}


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/cleanup-nightlies.yml:
  Line 30:       - name: Prune old versioned nightly and patch tags

  Line 55:             version="${tag#nightly-}"
gateway · 2026-09-09 01:24:17
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts
gateway · 2026-09-09 01:24:29
result
No files found
gateway · 2026-09-09 01:24:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-09 01:24:49
result
Found 23 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts:
  Line 21:   maybeCheckForUpdateInBackground,

  Line 139: // Its probabilistic behavior is tested indirectly through maybeCheckForUpdateInBackground.

  Line 415: describe("maybeCheckForUpdateInBackground", () => {

  Line 418:   let originalFetch: typeof globalThis.fetch;

  Line 424:     // Silence background fetch calls to GitHub API that would otherwise

  Line 425:     // hit the preload mock and produce "unexpected fetch" warnings.

  Line 426:     originalFetch = globalThis.fetch;

  Line 427:     globalThis.fetch = mockFetch(

  Line 438:     globalThis.fetch = originalFetch;

  Line 447:     // The actual network call happens in the background and may fail,

  Line 449:     expect(() => maybeCheckForUpdateInBackground()).not.toThrow();

  Line 454:     // which means the background check should be initiated

  ...
gateway · 2026-09-09 01:25:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts</path>
<type>file</type>
<content>
405:   test("does not throw when called multiple times", () => {
406:     // Should be safe to call multiple times
407:     expect(() => {
408:       abortPendingVersionCheck();
409:       abortPendingVersionCheck();
410:       abortPendingVersionCheck();
411:     }).not.toThrow();
412:   });
413: });
414: 
415: describe("maybeCheckForUpdateInBackground", () => {
416:   useTestConfigDir("test-version-bg-");
417:   let savedNoUpdateCheck: string | undefined;
418:   let originalFetch: typeof globalThis.fetch;
419: 
420:   beforeEach(() => {
421:     // Save and clear the env var to test real implementation
422:     savedNoUpdateCheck = process.env.SENTRY_CLI_NO_UPDATE_CHECK;
423:     delete process.env.SENTRY_CLI_NO_UPDATE_CHECK;
424:     // Silence background fetch calls to GitHub API that would ...
gateway · 2026-09-09 01:25:28
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/content/docs/contributing.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
gateway · 2026-09-09 01:25:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-09 01:26:14
result
Found 16 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

  Line 30:   getBinaryDownloadUrl,

  Line 399: export async function fetchLatestFromGitHub(

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

  Line 467: export async function fetchLatestNightlyVersion(

  Line 522: async function nightlyVersionExists(version: string): Promise<boolean> {

  Line 551: export async function versionExists(

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

  Line 728: async function downloadNightlyToPath(

  Line 761: async function downloadStableToPath(

  Line 766:   const url = getBinaryDownloadUrl(version);

  Line 902: export async function downloadBinaryToTemp(

  Line 1007: async function downloadFullBinary(

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

  Line 1065: function executeUpgradePackageManager(

  Line 1122: export ...
gateway · 2026-09-09 01:26:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 01:26:38
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
380:       });
381:     } catch {
382:       log.debug("Failed to persist install info (DB may be read-only)");
383:     }
384:   }
385: 
386:   return legacyMethod;
387: }
388: 
389: // Version Fetching
390: 
391: /**
392:  * Fetch the latest version from GitHub releases.
393:  *
394:  * @param signal - Optional AbortSignal to cancel the request
395:  * @returns Latest version string (without 'v' prefix)
396:  * @throws {UpgradeError} When fetch fails or response is invalid
397:  * @throws {Error} AbortError if signal is aborted
398:  */
399: export async function fetchLatestFromGitHub(
400:   signal?: AbortSignal
401: ): Promise<string> {
402:   const response = await fetchWithUpgradeError(
403:     `${GITHUB_RELEASES_URL}/latest`,
404:     { headers: getGitHubHeaders(), signal },
405:     "GitHub"
406:   ...
gateway · 2026-09-09 01:26:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
710: function getNightlyGzFilename(): string {
711:   return `${getPlatformBinaryName()}.gz`;
712: }
713: 
714: /**
715:  * Download a nightly binary from GHCR and decompress it to `destPath`.
716:  *
717:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
718:  * matching this platform's `.gz` filename, then downloads and decompresses
719:  * the blob in-stream.
720:  *
721:  * When `version` is provided, fetches the pinned versioned tag
722:  * (`nightly-{version}`). Otherwise fetches the rolling `:nightly` tag. ...
gateway · 2026-09-09 01:26:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
885:  *
886:  * The lock is held on success so concurrent upgrades are blocked during the
887:  * download→spawn→install pipeline. The caller MUST release the lock after the
888:  * child process exits (the child may use a different install directory and
889:  * therefore a different lock file, so it cannot reliably release this one).
890:  *
891:  * If the child resolves to the same install path, it takes over the lock via
892:  * process.ppid recognition in acquireLock — the parent's subsequent release
893:  * is then a harmless no-op.
894:  *
895:  * @param version - Target version to download (used for display and comparison)
896:  * @param downloadTag - Git tag to use in the download URL. Defaults to `version`. ...
gateway · 2026-09-09 01:27:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:27:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
145: export function canAttemptDelta(targetVersion: string): boolean {
146:   if (CLI_VERSION === "0.0.0-dev") {
147:     return false;
148:   }
149:   if (isNightlyVersion(CLI_VERSION) !== isNightlyVersion(targetVersion)) {
150:     return false;
151:   }
152:   return !isDowngrade(CLI_VERSION, targetVersion);
153: }
154: 
155: export async function fetchRecentReleases(
156:   signal?: AbortSignal
157: ): Promise<GitHubRelease[]> {
158:   try {
159:     const response = await customFetch(`${GITHUB_RELEASES_URL}?per_page=12`, {
160:       headers: {
161:         Accept: "application/vnd.github.v3+json",
162:         "User-Agent": `sentry-cli/${CLI_VERSION}`,
163:       },
164:       signal,
165:     });
166:     if (!response.ok) {
167:       return [];
168:     }
169:     const data = await ...
gateway · 2026-09-09 01:27:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
345:     steps.push({ fromVersion: previousVersion, toVersion });
346:     previousVersion = toVersion;
347:     if (index === manifests.length - 1) {
348:       expectedSha256 = getPatchTargetSha256(manifest, binaryName) ?? "";
349:     }
350:   }
351:   if (previousVersion !== opts.targetVersion || !expectedSha256) {
352:     Sentry.getActiveSpan()?.setAttribute(
353:       "telemetry_reason",
354:       "version-mismatch"
355:     );
356:     return null;
357:   }
358: 
359:   const patches = await Promise.all(
360:     digests.map(async (digest) => {
361:       const data = new Uint8Array(
362:         await client.downloadBlobBuffer(opts.token, digest, opts.signal)
363:       );
364:       return { data, size: data.byteLength };
365:     })
366:   );
367:   return {
368:     patches,
369:     ...
gateway · 2026-09-09 01:28:06
result
Found 54 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 42:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

  Line 30:   getBinaryDownloadUrl,

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

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

  Line 766:   const url = getBinaryDownloadUrl(version);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/src/lib/response-cache.ts:
  Line 477:         // Surface cache age for ...
gateway · 2026-09-09 01:29:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 { UPGRADE_SOURCES } from "../../src/lib/binary.js";
11: import {
12:   downloadLayerBlob,
13:   downloadNightlyBlob,
14:   fetchManifest,
15:   fetchNightlyManifest,
16:   findLayerByFilename,
17:   GHCR_REPO,
18:   GHCR_TAG,
19:   getAnonymousToken,
20:   getNightlyVersion,
21:   listTags,
22:   type OciManifest,
23: } from "../../src/lib/ghcr.js";
24: 
25: /** Store original fetch for restoration */
26: let originalFetch: typeof globalThis.fetch;
27: 
28: /** Helper to mock fetch ...
gateway · 2026-09-09 01:30:19
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install
gateway · 2026-09-09 01:30:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public/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.
16: gen_uuid() {
17:   if [[ -r /proc/sys/kernel/random/uuid ]]; then
18:     cat /proc/sys/kernel/random/uuid
19:   elif command -v uuidgen >/dev/null 2>&1; then
20:     uuidgen | tr '[:upper:]' '[:lower:]'

(Showing lines 1-20 of 362. Use offset=21 to continue.)
</content>
gateway · 2026-09-09 01:30:44
result
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
feat/toolkit-bridge-upgrade
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
gateway · 2026-09-09 01:31:31
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Sequence\n\nImport the pre-shaped CLI into **`getsentry/sentry-mcp` under its current repository name**. Validate the complete monorepo and production deployment paths there. Rename the repository to `getsentry/toolkit` only after those gates pass.\n\nThis preserves history and lets GitHub, Vercel, Cloudflare, branch protections, and repository integrations continue operating under the known repository identity throughout integration.\n\n## Hard prerequisites\n\n- [x] CLI pre-shape merged: getsentry/cli#1254.\n- [ ] Bridge CLI release completed and verified: getsentry/cli#1244.\n- [ ] Create a dedicated integration branch from current `getsentry/sentry-mcp` `main`. Do not import directly into `main`.\n\n## History-preserving import\n\n- [ ] From the bridge-release commit on `getsentry/cli`, produce two immutable `git filter-repo` refs:\n  - `import/cli` — history containing only `packages/cli/**`\n  - ...
gateway · 2026-09-09 01:32:42
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js:
  Line 654: async function resolveAndApply(opts) {
gateway · 2026-09-09 01:32:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
635:     super(message ?? defaultMessages[reason]);
636:     this.name = "BinpatchError";
637:     this.reason = reason;
638:   }
639: };
640: 
641: // src/events.ts
642: function safeProgress(handler) {
643:   if (!handler) return () => {
644:   };
645:   return (event) => {
646:     try {
647:       handler(event);
648:     } catch {
649:     }
650:   };
651: }
652: 
653: // src/discover.ts
654: async function resolveAndApply(opts) {
655:   const {
656:     source,
657:     currentVersion,
658:     targetVersion,
659:     oldPath,
660:     destPath,
661:     cache,
662:     offline,
663:     onProgress,
664:     telemetry,
665:     signal
666:   } = opts;
667:   const progress = safeProgress(onProgress);
668:   if (cache) {
669:     const cached = await ...
gateway · 2026-09-09 01:33:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-09 01:33:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
250:   }
251: }
252: 
253: /**
254:  * Start a background check for new versions.
255:  * Does not block - fires a fetch and lets it complete in the background.
256:  * Reports errors to Sentry in a detached span for visibility.
257:  * Never throws - errors are caught and reported to Sentry.
258:  */
259: function checkForUpdateInBackgroundImpl(): void {
260:   try {
261:     if (!shouldCheckForUpdate()) {
262:       return;
263:     }
264:   } catch (error) {
265:     // DB access failed - report to Sentry but don't crash CLI
266:     Sentry.captureException(error);
267:     return;
268:   }
269: 
270:   pendingAbortController = new AbortController();
271:   const { signal } = pendingAbortController;
272: 
273:   const channel = getReleaseChannel();
274: 
275:   Sentry.startSpanManual(
276:     {
277:  ...
gateway · 2026-09-09 01:33:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
195:   // Suppress for "cli <subcommand>" management commands (setup, fix). Global
196:   // flags are no longer hoisted, so they may precede `cli` (`--verbose cli
197:   // setup`) or sit between `cli` and the subcommand (`cli --verbose setup`);
198:   // resolve the group and its subcommand past any interleaved global flags.
199:   const cliIndex = cliGroupIndex(args);
200:   if (cliIndex !== undefined) {
201:     const subcommand = cliSubcommandAfterGroup(args, cliIndex);
202:     if (
203:       subcommand !== undefined &&
204:       SUPPRESSED_CLI_SUBCOMMANDS.has(subcommand)
205:     ) {
206:       return true;
207:     }
208:   }
209:   return false;
210: }
211: 
212: /**
213:  * Abort any pending version check to allow process exit.
214:  * Call this when main CLI work is complete. ...
gateway · 2026-09-09 01:34:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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": ">=20.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 ...
gateway · 2026-09-09 01:35:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, isAbsolute, join, resolve, sep } 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, ...
gateway · 2026-09-09 01:35:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
90:  *
91:  * Defined here (alongside other installation constants like
92:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
93:  * `db/install-info.ts` can import it without creating a circular
94:  * dependency.
95:  */
96: export type InstallationMethod =
97:   | "curl"
98:   | "brew"
99:   | "npm"
100:   | "pnpm"
101:   | "bun"
102:   | "yarn"
103:   | "unknown";
104: 
105: /** A repository pair that hosts CLI stable releases and nightly OCI images. */
106: export type UpgradeSource = {
107:   /** GitHub `owner/repository` containing CLI release assets. */
108:   readonly githubRepo: string;
109:   /** GHCR `owner/package` containing CLI nightly images and delta patches. */
110:   readonly ghcrRepo: string;
111:   /** Prefix attached to CLI release tags in this repository. ...
gateway · 2026-09-09 01:35:57
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-09 01:36:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-09 01:36:27
result
No files found
gateway · 2026-09-09 01:36:36
result
No files found
gateway · 2026-09-09 01:36:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
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-09 01:36:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
252: 
253:   return (await response.json()) as OciManifest;
254: }
255: 
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`. ...
gateway · 2026-09-09 01:37:27
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-09 01:37:39
result
Found 97 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/binary.test.ts:
  Line 47:       "https://github.com/getsentry/cli/releases/download/"

  Line 72:         tagPrefix: "cli@",

  Line 77:         tagPrefix: "",


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 927:     const patchUrl = `https://github.com/getsentry/cli/releases/download/0.14.0/${binaryName}.patch`;


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.mocked.test.ts:
  Line 102:     const patchUrl = ...
gateway · 2026-09-09 01:37:46
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, sep } 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:   getLegacyInstallDirs,
29:   getPlatformBinaryName,
30:   installBinary,
31:   ...
gateway · 2026-09-09 01:37:51
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
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; then
182:         if [ "$(id -u)" = "0" ]; then
183:           echo -e "${MUTED}Installing required C++ runtime libraries...${NC}"
184:           apk add --no-cache libstdc++ libgcc >/dev/null 2>&1 \
185:             || die "Failed to install libstdc++ and libgcc (required for musl binary)" "deps"
186:         else
187:           echo -e "${RED}Missing required libraries: libstdc++ libgcc${NC}" >&2
188:           echo -e "${RED}Run: apk ...
gateway · 2026-09-09 01:38:04
result
No files found
gateway · 2026-09-09 01:38:59
result
Found 37 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/sentry-release.yml:
  Line 60:         run: sentry release create "sentry/${VERSION}" --project cli,cli-website


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/cleanup-nightlies.yml:
  Line 21:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"

  Line 22:           curl -sfLo "$TARBALL" "https://github.com/oras-project/oras/releases/download/v${VERSION}/${TARBALL}"

  Line 24:           tar -xz -C /usr/local/bin oras < "$TARBALL"

  Line 27:       - name: Log in to GHCR

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

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

  Line 36:           # List all nightly-* tags sorted by version, oldest first

  Line 37:           NIGHTLY_TAGS=$(oras repo ...
gateway · 2026-09-09 01:39:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:         with:
431:           name: sentry-${{ matrix.target }}-gz
432:           path: packages/cli/dist-bin/*.gz
433: 
434:   generate-patches:
435:     name: Generate Delta Patches
436:     needs: [changes, build-binary]
437:     # Only on main (nightlies) and release branches (stable) — skip PRs
438:     if: github.event_name != 'pull_request'
439:     runs-on: ubuntu-latest
440:     continue-on-error: true
441:     # `from-version`: the previous version the patches were actually generated
442:     # FROM, as computed by the binpatch action. Carried through to
443:     # publish-nightly so it stamps the `from-version` annotation on the
444:     # pushed patch manifest with the SAME value. See
445:     # ...
gateway · 2026-09-09 01:39:19
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 136:  * fallback when `fetchLatestVersion()` hits a network error.

  Line 165: async function resolveTargetWithFallback(opts: {

  Line 285: async function resolveTargetVersion(

  Line 289:   const latest = await fetchLatestVersion(method, channel);

  Line 325:     const exists = await versionExists(lookupMethod, target);
gateway · 2026-09-09 01:39:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
100:   readonly method?: InstallationMethod;
101:   /** Injected by buildCommand output wrapper — suppresses spinners */
102:   readonly json?: boolean;
103: };
104: 
105: /**
106:  * Resolve effective channel and version arg from the positional `version`
107:  * parameter. "nightly" and "stable" are treated as channel selectors, not
108:  * literal version strings.
109:  *
110:  * @returns `{ channel, versionArg }` where versionArg is undefined when the
111:  *   positional was a channel name (so we resolve to latest) or was omitted. ...
gateway · 2026-09-09 01:40:30
result
{"body":"## Summary\n\nThe salvageable, non-controversial core of #844 — prefix-aware version-detection read paths — plus the two review fixes it accumulated. #844 itself is **parked** in favor of a broader, target-agnostic **workspaces** redesign (tracked in #842); this PR lands the parts that are correct regardless of that redesign so they aren't lost.\n\nLets a single repo host independently-versioned products (e.g. `cli@1.2.3`, `mcp@2.0.0`) without cross-contaminating each other's latest-tag detection, changelog base, or CalVer scans. Builds on the existing `tagPrefix` write-side support (no new version library — uses craft's home-grown SemVer utils).\n\n## Changes\n\n- **`getLatestTag(git, tagPrefix='')`** scopes `git describe` via `--match '<prefix>*'`; threaded through the `prepare` and `changelog` read paths. Backward compatible (empty prefix → previous behavior).\n- **`getGitTagPrefix()`** warns when multiple `github` targets declare differing `tagPrefix` values (ambiguous) ...
gateway · 2026-09-09 01:41:09
result
No files found
gateway · 2026-09-09 01:42:29
result
[{"baseRefName":"main","headRefName":"chore/preshape-monorepo","number":1254,"state":"MERGED","title":"chore: pre-shape repo into pnpm-workspace monorepo layout","updatedAt":"2026-07-31T13:58:04Z","url":"https://github.com/getsentry/cli/pull/1254"}]
{"body":"Tracking issue for merging **getsentry/cli** into the existing **getsentry/sentry-mcp** repository, validating the combined monorepo there, and only then renaming it to **`getsentry/toolkit`**. The final repository is a pnpm workspace (no Turbo) with independent prefixed releases and phased shared code.\n\n**Full plan:** https://gist.github.com/BYK/8c0ce6cec64608f41fe5654b7827228e\n\n## Settled architecture\n\n- Use `getsentry/sentry-mcp` as the destination; do not create a fresh repository. This preserves MCP production secrets, environments, GitHub App, webhooks, Vercel, and Cloudflare wiring.\n- Import CLI while the repository is still named `getsentry/sentry-mcp`. ...
gateway · 2026-09-09 01:42:39
result
(no output)
gateway · 2026-09-09 01:44:13
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 18:   GITHUB_RELEASES_URL,

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

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

  Line 602: async function fetchStableChangelog(

  Line 642: async function fetchNightlyChangelog(

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

  Line 720: export async function fetchChangelog(

  Line 726:     if (channel === "nightly") {
gateway · 2026-09-09 01:44:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:46:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.45.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:46:29
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 273:       headers: getGitHubHeaders(),

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

  Line 426: export async function fetchWithUpgradeError(
gateway · 2026-09-09 01:46:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
392:   // can differ in casing from the computed directory yet be the same dir.
393:   const candidates = [join(homeDir, ".local", "bin"), join(homeDir, "bin")];
394: 
395:   for (const dir of candidates) {
396:     if (existsSync(dir) && pathDirs.some((p) => samePath(p, dir))) {
397:       return dir;
398:     }
399:   }
400: 
401:   // 5. XDG-aligned fallback — setup will handle adding this to PATH
402:   return join(homeDir, ".local", "bin");
403: }
404: 
405: /**
406:  * Build headers for GitHub API requests.
407:  */
408: export function getGitHubHeaders(): Record<string, string> {
409:   return {
410:     Accept: "application/vnd.github.v3+json",
411:     "User-Agent": getUserAgent(),
412:   };
413: }
414: 
415: /**
416:  * Fetch wrapper that converts network errors to UpgradeError. ...
gateway · 2026-09-09 01:46:51
result
Found 10 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 554:  * Uses a higher `per_page` than `fetchRecentReleases()` in delta-upgrade

  Line 599:  * @param prefetchedReleases - Optional releases already fetched by the caller

  Line 606:   prefetchedReleases?: GitHubRelease[]

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

  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/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 155: export async function ...
gateway · 2026-09-09 01:47:00
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
780: /**
781:  * Resolve the channel, version arg, method, and channel-changed flag from
782:  * the positional version argument and flags. Extracted to keep `func()`
783:  * complexity under the biome limit.
784:  */
785: async function resolveContext(
786:   version: string | undefined,
787:   flags: UpgradeFlags
788: ): Promise<{
789:   channel: ReleaseChannel;
790:   versionArg: string | undefined;
791:   channelChanged: boolean;
792:   method: InstallationMethod;
793: }> {
794:   const { channel, versionArg } = resolveChannelAndVersion(version);
795:   const currentChannel = getReleaseChannel();
796:   const channelChanged = channel !== currentChannel;
797: 
798:   const method = flags.method ?? (await detectInstallationMethod());
799:   validateMethod(method, versionArg, channel, ...
gateway · 2026-09-09 01:47:54
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 01:48:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
365:   if (stored?.method) {
366:     return stored.method;
367:   }
368: 
369:   // Legacy detection for existing installs (pre-setup command)
370:   const legacyMethod = await detectLegacyInstallationMethod();
371: 
372:   // Auto-save detected method for future runs (best-effort —
373:   // a read-only or broken DB shouldn't block detection)
374:   if (legacyMethod !== "unknown") {
375:     try {
376:       setInstallInfo({
377:         method: legacyMethod,
378:         path: process.execPath,
379:         version: CLI_VERSION,
380:       });
381:     } catch {
382:       log.debug("Failed to persist install info (DB may be read-only)");
383:     }
384:   }
385: 
386:   return legacyMethod;
387: }
388: 
389: // Version Fetching
390: 
391: /**
392:  * Fetch the latest version from GitHub releases. ...
gateway · 2026-09-09 01:48:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
715:  * Download a nightly binary from GHCR and decompress it to `destPath`.
716:  *
717:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
718:  * matching this platform's `.gz` filename, then downloads and decompresses
719:  * the blob in-stream.
720:  *
721:  * When `version` is provided, fetches the pinned versioned tag
722:  * (`nightly-{version}`). Otherwise fetches the rolling `:nightly` tag.
723:  *
724:  * @param destPath - File path to write the decompressed binary
725:  * @param version - Specific nightly version to download (omit for latest)
726:  * @throws {UpgradeError} When GHCR fetch or blob download fails
727:  */
728: async function downloadNightlyToPath(
729:   destPath: string,
730:   version?: string,
731:   setMessage?: SetMessage
732: ): Promise<void> {
733:   ...
gateway · 2026-09-09 01:48:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1055:   });
1056: }
1057: 
1058: /**
1059:  * Execute upgrade via package manager global install.
1060:  *
1061:  * @param pm - Package manager to use
1062:  * @param version - Target version to install
1063:  * @throws {UpgradeError} When installation fails
1064:  */
1065: function executeUpgradePackageManager(
1066:   pm: PackageManager,
1067:   version: string
1068: ): Promise<void> {
1069:   return new Promise((resolve, reject) => {
1070:     const args =
1071:       pm === "yarn"
1072:         ? ["global", "add", `sentry@${version}`]
1073:         : ["install", "-g", `sentry@${version}`];
1074: 
1075:     // npm/pnpm/yarn are .cmd batch files on Windows; spawn() without
1076:     // shell: true cannot execute .cmd files (ENOENT). ...
gateway · 2026-09-09 01:48:40
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 642:       executeUpgrade(method, target, downloadTag, offline, setMessage)

  Line 727:       executeUpgrade("curl", target, downloadTag, undefined, setMessage)
gateway · 2026-09-09 01:48:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
570: /**
571:  * Decide which directory a curl upgrade should install into.
572:  *
573:  * Normally the binary stays where it currently lives — pinning the install
574:  * dir keeps an in-place update from relocating a binary that is already on
575:  * the user's `PATH` (upgrade runs setup with `--no-modify-path`, so it can't
576:  * add a new directory to `PATH`).
577:  *
578:  * The one exception is a legacy `~/.sentry/bin` install: those should move to
579:  * the XDG-aligned location so users actually migrate off `~/.sentry`. We only
580:  * relocate when the XDG target directory is *already* on `PATH`, so the moved
581:  * binary stays discoverable without any `PATH` edit. When it isn't, we keep
582:  * the binary in place and leave relocation to an explicit `sentry cli setup`. ...
gateway · 2026-09-09 01:49:05
result
No files found
gateway · 2026-09-09 01:49:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: import { UPGRADE_SOURCES } from "../../src/lib/binary.js";
21: 
22: function noop(): void {
23:   // Intentionally empty — absorbs async spawn errors
24: }
25: 
26: const repoRoot = join(import.meta.dirname, "..", "..");
27: const installScript = join(repoRoot, ...
gateway · 2026-09-09 01:49:23
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-fragments.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-stale-references.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-error-patterns.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-env-coverage.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-no-deps.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-patches.ts
gateway · 2026-09-09 01:49:34
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 188:         run: pnpm run check:fragments

  Line 244:       - run: pnpm run check:deps

  Line 245:       - run: pnpm run check:errors

  Line 246:       - run: pnpm run check:patches

  Line 247:       - run: pnpm run check:stale-refs
gateway · 2026-09-09 01:49:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
205:             echo "Docs sections are out of date"
206:           fi
207:       - name: Auto-commit regenerated files
208:         if: (steps.check-skill.outputs.stale == 'true' || steps.check-sections.outputs.stale == 'true') && steps.token.outcome == 'success'
209:         run: |
210:           git config user.name "github-actions[bot]"
211:           git config user.email "github-actions[bot]@users.noreply.github.com"
212:           git add packages/cli/plugins/sentry-cli/skills/sentry-cli/ packages/cli/README.md packages/cli/DEVELOPMENT.md apps/cli-docs/src/content/docs/contributing.md apps/cli-docs/src/content/docs/self-hosted.md apps/cli-docs/src/content/docs/getting-started.mdx
213:           git diff --cached --quiet || (git commit -m "chore: regenerate docs" && git push)
214:       - name: Fail for fork ...
gateway · 2026-09-09 01:49:54
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 250: export const GITHUB_RELEASES_URL = getGitHubReleasesUrl();


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 35:   GITHUB_RELEASES_URL,

  Line 124:     releasesUrl: ...
gateway · 2026-09-09 01:50:10
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/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,
gateway · 2026-09-09 01:51:34
result
No files found
gateway · 2026-09-09 01:51:50
result
No files found
gateway · 2026-09-09 01:51:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "binpatch",
3:   "version": "0.4.2",
4:   "type": "module",
5:   "license": "MIT",
6:   "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.",
7:   "author": "BYK",
8:   "homepage": "https://github.com/BYK/binpatch#readme",
9:   "repository": {
10:     "type": "git",
11:     "url": "git+https://github.com/BYK/binpatch.git"
12:   },
13:   "bugs": {
14:     "url": "https://github.com/BYK/binpatch/issues"
15:   },
16:   "keywords": [
17:     "bsdiff",
18:     "bspatch",
19:     "trdiff10",
20:     "zstd",
21:     "binary",
22:     "delta",
23:     "patch",
24:     "update",
25:     "self-update",
26:  ...
gateway · 2026-09-09 01:52:10
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts:
  Line 590: /** Configuration for {@link githubReleaseSource}. */

  Line 594:     releasesUrl: string;

  Line 612: declare function githubReleaseSource(config: GitHubReleaseSourceConfig): SourceStrategy;

  Line 614: export { BinpatchError, type BinpatchErrorReason, type ChainMeta, type ChainStep, type DeltaResult, type DeltaSource, type DeltaTelemetry, type DeltaUnavailableReason, type ExtractStableChainOpts, type GhcrSourceConfig, type GitHubAsset, type GitHubRelease, type GitHubReleaseSourceConfig, type InstrumentHook, MAX_NIGHTLY_CHAIN_DEPTH, MAX_OUTPUT_SIZE, MAX_STABLE_CHAIN_DEPTH, type NightlyChainFailure, OciClient, type OciClientConfig, type OciLayer, type OciManifest, PATCH_TAG_PREFIX, type PatchCache, type PatchChain, type PatchHeader, type PatchLink, type PatchStepMeta, type ...
gateway · 2026-09-09 01:52:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts</path>
<type>file</type>
<content>
550: 
551: type GitHubAsset = {
552:     name: string;
553:     size: number;
554:     digest?: string;
555:     browser_download_url: string;
556: };
557: type GitHubRelease = {
558:     tag_name: string;
559:     assets: GitHubAsset[];
560:     body?: string;
561: };
562: /** Extract the SHA-256 hex digest from a GitHub asset's `digest` field. */
563: declare function extractSha256(asset: GitHubAsset): string | null;
564: /** Extract the target binary's SHA-256 from a release. ...
gateway · 2026-09-09 01:52:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
1040:   const client = new OciClient(config);
1041:   const patchLayerName = `${binaryName}.patch`;
1042:   const i = (name, fn) => config.instrument ? config.instrument(name, fn) : fn();
1043:   async function resolveNightlyChain(opts) {
1044:     const {
1045:       token,
1046:       currentVersion,
1047:       targetVersion,
1048:       fullGzSize,
1049:       preloadedTags,
1050:       signal,
1051:       report
1052:     } = opts;
1053:     const chainTags = filterAndSortChainTags(
1054:       preloadedTags,
1055:       currentVersion,
1056:       targetVersion,
1057:       compareVersions
1058:     );
1059:     if (chainTags.length === 0) {
1060:       report?.("no_patches");
1061:       return null;
1062:     }
1063:     if (chainTags.length > ...
gateway · 2026-09-09 01:52:47
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js:
  Line 1225: function githubReleaseSource(config) {
gateway · 2026-09-09 01:52:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
1195:   }
1196:   const chainReleases = releases.slice(targetIdx, currentIdx);
1197:   if (chainReleases.length > MAX_STABLE_CHAIN_DEPTH) {
1198:     return { failure: "too_long" };
1199:   }
1200:   const targetRelease = chainReleases[0];
1201:   if (!targetRelease) return { failure: "no_patches" };
1202:   const expectedSha256 = getStableTargetSha256(targetRelease, binaryName) ?? "";
1203:   if (!expectedSha256) return { failure: "malformed_chain" };
1204:   const patchUrls = [];
1205:   let totalSize = 0;
1206:   for (const release of chainReleases) {
1207:     const patchAsset = release.assets.find((a) => a.name === patchAssetName);
1208:     if (!patchAsset) return { failure: "malformed_chain" };
1209:     patchUrls.push(patchAsset.browser_download_url);
1210:     ...
gateway · 2026-09-09 01:53:12
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts:
  Line 254:  * resolveAndApply({ source: ghcrSource({ ..., instrument }), ... });

  Line 288: /** A structured progress event emitted during {@link resolveAndApply}. */

  Line 334: type SourceStrategy = {

  Line 335:     resolveChain(currentVersion: string, targetVersion: string, signal?: AbortSignal, report?: UnavailableReporter): Promise<PatchChain | null>;

  Line 371: type ResolveAndApplyOpts = {

  Line 395: declare function resolveAndApply(opts: ResolveAndApplyOpts): Promise<DeltaResult | null>;

  Line 614: export { BinpatchError, type BinpatchErrorReason, type ChainMeta, type ChainStep, type DeltaResult, type DeltaSource, type DeltaTelemetry, type DeltaUnavailableReason, type ExtractStableChainOpts, type GhcrSourceConfig, type GitHubAsset, type GitHubRelease, type ...
gateway · 2026-09-09 01:53:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts</path>
<type>file</type>
<content>
320: 
321: /**
322:  * A source of patch chains. Given the current and target versions, resolve the
323:  * ordered chain of patches (oldest hop first) plus the expected final SHA-256,
324:  * or `null` when no usable chain exists (caller falls back to a full download).
325:  *
326:  * A source may optionally classify *why* it returned `null` by invoking the
327:  * `report` callback with a {@link DeltaUnavailableReason}. This is telemetry
328:  * only — it never changes control flow (a `null` return is always a full-
329:  * download fallback). ...
gateway · 2026-09-09 01:53:27
result
No files found
gateway · 2026-09-09 01:53:36
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts
gateway · 2026-09-09 01:53:49
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts:
  Line 418:   let originalFetch: typeof globalThis.fetch;

  Line 424:     // Silence background fetch calls to GitHub API that would otherwise

  Line 425:     // hit the preload mock and produce "unexpected fetch" warnings.

  Line 426:     originalFetch = globalThis.fetch;

  Line 427:     globalThis.fetch = mockFetch(

  Line 438:     globalThis.fetch = originalFetch;

  Line 461:     // Wait a bit for the background fetch to potentially complete

  Line 462:     // Note: The fetch may fail (network error), but the function should not throw

  Line 474:     expect(infoBefore.latestVersion).toBe("1.0.0");
gateway · 2026-09-09 01:54:00
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts</path>
<type>file</type>
<content>
400:   test("does not throw when no pending check", () => {
401:     // Should be safe to call even when nothing is pending
402:     expect(() => abortPendingVersionCheck()).not.toThrow();
403:   });
404: 
405:   test("does not throw when called multiple times", () => {
406:     // Should be safe to call multiple times
407:     expect(() => {
408:       abortPendingVersionCheck();
409:       abortPendingVersionCheck();
410:       abortPendingVersionCheck();
411:     }).not.toThrow();
412:   });
413: });
414: 
415: describe("maybeCheckForUpdateInBackground", () => {
416:   useTestConfigDir("test-version-bg-");
417:   let savedNoUpdateCheck: string | undefined;
418:   let originalFetch: typeof globalThis.fetch;
419: 
420:   beforeEach(() => {
421:     // Save and clear the env var to test real ...
gateway · 2026-09-09 01:55:12
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/content/docs/contributing.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.lore.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
gateway · 2026-09-09 01:55:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-09 01:55:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:01a02357-f0a8-7fdb-9e9d-b0710cfe65c9 -->
8: * **API output binary and HTTP contracts**: Always preserve strict output-mode and binary-safety contracts. `sentry api` must preserve `rawApiRequest()` status text; empty textual non-2xx bodies must produce an HTTP status/request fallback, and JSON mode must expose `{status, statusText, body}` so empty success and error responses are distinguishable. Binary `Uint8Array` successes bypass formatters and remain raw; binary errors emit only status/content-type/byte-count summaries, never bytes or JSON coercion. Prompts must never block scripted runs or interleave with stdout JSON.
9: 
10: <!-- ...
gateway · 2026-09-09 01:55:55
result
Found 45 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

  Line 30:   getBinaryDownloadUrl,

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

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

  Line 766:   const url = getBinaryDownloadUrl(version);


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

  Line 34:   resolveUpgradeSource,

  Line 37:   UPGRADE_SOURCES,

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

  Line ...
gateway · 2026-09-09 01:56:08
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 294:     (await client.listTags(opts.token, PATCH_TAG_PREFIX, opts.signal));

  Line 308:       chainTags.map((tag) => client.fetchManifest(opts.token, tag, opts.signal))


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   return await fetchManifest(token, GHCR_TAG);

  Line 332: export async function downloadNightlyBlob(

  Line 471: export async function listTags(

  Line 513: export async function downloadLayerBlob(

  Line 518:   const response = await downloadNightlyBlob(token, digest, ...
gateway · 2026-09-09 01:56:18
result
Found 33 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 237:       await prefetchNightlyPatches(latestVersion, signal);

  Line 239:       await prefetchStablePatches(latestVersion, signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 834:     const result = await fetchRecentReleases();

  Line 842:     const result = await fetchRecentReleases();

  Line 851:     const result = await fetchRecentReleases();

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

  Line 877:     const result = await ...
gateway · 2026-09-09 01:56:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:56:37
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
390:         destPath,
391:         onBytes
392:       );
393:       if (sha256 !== chain.expectedSha256) {
394:         throw new Error(
395:           `SHA-256 mismatch after patching: got ${sha256}, expected ${chain.expectedSha256}`
396:         );
397:       }
398:       return sha256;
399:     }
400:   );
401: }
402: 
403: function makeProgressHandler(setMessage?: SetMessage): ProgressHandler {
404:   let progress: ReturnType<typeof makeByteProgress> | undefined;
405:   let phase: string | undefined;
406:   let previousWritten = 0;
407:   return (event) => {
408:     if (
409:       event.type === "bytes" &&
410:       (progress === undefined || phase !== event.phase)
411:     ) {
412:       // New phase: spin up a fresh bar. ...
gateway · 2026-09-09 01:56:51
result
No files found
gateway · 2026-09-09 01:57:01
result
No files found
gateway · 2026-09-09 01:57:19
result
No files found
gateway · 2026-09-09 01:58:29
result
Found 11 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts:
  Line 83:   /** CLI upgrade failed */

  Line 586: export type UpgradeErrorReason =

  Line 597:  * @param reason - Type of upgrade failure

  Line 600: export class UpgradeError extends CliError {

  Line 613:         "Cannot upgrade offline — no pre-downloaded update is available.",

  Line 666:         no_budget: `To use Seer features, upgrade your plan:\n  ${buildBillingUrl(this.orgSlug, "seer")}${trialHint}`,

  Line 676:       no_budget: `To use Seer features, upgrade your plan in your organization's billing settings.${trialHint}`,

  Line 820:  * `classifySilenced` (Sentry capture), {@link isUserError} (upgrade nudge), and

  Line 848:  *   bug" upgrade nudge) instead of a raw "400 Bad Request".

  Line 895:  * user error (no upgrade nudge) and is not reported to Sentry — the same

  Line 910:  * settings. ...
gateway · 2026-09-09 01:58:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
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.
596:  *
597:  * @param reason - Type of upgrade failure
598:  * @param message - Custom message (uses default if not provided)
599:  */
600: export class UpgradeError extends CliError {
601:   readonly reason: UpgradeErrorReason;
602: 
603:   constructor(reason: UpgradeErrorReason, message?: string) {
604:     const defaultMessages: Record<UpgradeErrorReason, string> = {
605:       unknown_method:
606:         "Could not detect installation method. Use --method to specify.",
607:    ...
gateway · 2026-09-09 01:58:59
result
Found 61 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/ghcr.test.ts:
  Line 12:   downloadLayerBlob,

  Line 13:   downloadNightlyBlob,

  Line 14:   fetchManifest,

  Line 15:   fetchNightlyManifest,

  Line 19:   getAnonymousToken,

  Line 20:   getNightlyVersion,

  Line 21:   listTags,

  Line 79: describe("getAnonymousToken", () => {

  Line 91:     const token = await getAnonymousToken();

  Line 105:     await expect(getAnonymousToken(UPGRADE_SOURCES[0])).resolves.toBe(

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

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

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

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

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

  Line 140:     await ...
gateway · 2026-09-09 01:59:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
80: /**
81:  * Absolute legacy install directories for the given home. See
82:  * {@link LEGACY_INSTALL_SUBDIRS} for why this is scoped to pre-XDG locations.
83:  */
84: export function getLegacyInstallDirs(homeDir: string): string[] {
85:   return LEGACY_INSTALL_SUBDIRS.map((dir) => join(homeDir, dir));
86: }
87: 
88: /**
89:  * How the CLI was installed. Determines the upgrade strategy.
90:  *
91:  * Defined here (alongside other installation constants like
92:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
93:  * `db/install-info.ts` can import it without creating a circular
94:  * dependency. ...
gateway · 2026-09-09 01:59:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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-09 02:00:03
result
No files found
gateway · 2026-09-09 02:00:14
result
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. ...
gateway · 2026-09-09 02:00:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:00:57
result
Found 34 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 52:   changes:

  Line 65:       - uses: dorny/paths-filter@v4

  Line 75:               - 'packages/cli/script/generate-skill.ts'

  Line 76:               - 'packages/cli/script/generate-command-docs.ts'

  Line 77:               - 'packages/cli/script/generate-docs-sections.ts'

  Line 78:               - 'packages/cli/script/eval-skill.ts'

  Line 83:               - 'packages/cli/script/**'

  Line 133:     needs: [changes]

  Line 134:     if: needs.changes.outputs.codemod == 'true'

  Line 149:     needs: [changes]

  Line 150:     if: needs.changes.outputs.skill == 'true'

  Line 222:     needs: [changes]

  Line 223:     if: needs.changes.outputs.code == 'true'

  Line 251:     needs: [changes]

  Line 252:     if: needs.changes.outputs.code == 'true'

  Line 288:     needs: [changes, lint, test-unit]

  Line 296:       ...
gateway · 2026-09-09 02:01:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
45:   # node-sqlite3-wasm driver. The npm-package job runs a Node 20 matrix entry
46:   # so that fallback path is exercised in CI rather than only in production.
47:   NODE_VERSION_20: "20.20.2"
48:   NODE_VERSION_22: "22.23.1"
49:   NODE_VERSION_24: "24.18.0"
50: 
51: jobs:
52:   changes:
53:     name: Detect Changes
54:     runs-on: ubuntu-latest
55:     permissions:
56:       pull-requests: read
57:     outputs:
58:       skill: ${{ steps.filter.outputs.skill == 'true' || startsWith(github.ref, 'refs/heads/release/') }}
59:       code: ${{ steps.filter.outputs.code == 'true' || startsWith(github.ref, 'refs/heads/release/') }}
60:       codemod: ${{ steps.filter.outputs.codemod == 'true' || startsWith(github.ref, 'refs/heads/release/') }}
61:       build-targets: ${{ steps.targets.outputs.matrix }}
62:       ...
gateway · 2026-09-09 02:01:52
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-09 02:02:05
result
No files found
gateway · 2026-09-09 02:02:21
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.craft.yml
gateway · 2026-09-09 02:02:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:         - 'vercel'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: vercel
20:     projectId: prj_wVkOnIwI3eIQbGD1Gw7qS1MqFFIK
21:   - name: registry
22:     apps:
23:       'app:sentry':
24:         name: 'Sentry CLI'
25:         packageUrl: 'https://www.npmjs.com/package/sentry'
26:         mainDocsUrl: 'https://cli.sentry.dev'
27:         urlTemplate: ...
gateway · 2026-09-09 02:02:36
result
Found 100 matches (more matches available)
/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 02:03:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
940:   test("stored info takes priority over path-based detection", async () => {
941:     // If DB says "yarn", respect it even if path says node_modules
942:     setInstallInfo({ method: "yarn", path: "/old/path", version: "0.0.1" });
943:     process.argv[1] = join(
944:       "/usr/local/lib",
945:       "node_modules",
946:       "sentry",
947:       "dist",
948:       "bin.cjs"
949:     );
950: 
951:     const method = await detectInstallationMethod();
952:     expect(method).toBe("yarn");
953:   });
954: 
955:   test("Homebrew still takes priority over node_modules path", async () => {
956:     process.argv[1] = join(
957:       "/usr/local/lib",
958:       "node_modules",
959:       "sentry",
960:       "dist",
961:       "bin.cjs"
962:     );
963:     Object.defineProperty(process, "execPath", ...
gateway · 2026-09-09 02:06:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:24
result
Found 96 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 6:  * The `executeUpgrade` and `detectInstallationMethod` subprocess tests use

  Line 135:   downloadBinaryToTemp,

  Line 136:   executeUpgrade,

  Line 137:   fetchLatestFromGitHub,

  Line 139:   fetchLatestNightlyVersion,

  Line 140:   fetchLatestVersion,

  Line 144:   versionExists,

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

  Line 205:     const version = await fetchLatestFromGitHub();

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

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

  Line 265:     await ...
gateway · 2026-09-09 02:06:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
180:     expect(parseInstallationMethod("YARN")).toBe("yarn");
181:   });
182: 
183:   test("throws on invalid method", () => {
184:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
185:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
186:     expect(() => parseInstallationMethod("")).toThrow("Invalid method: ");
187:   });
188: });
189: 
190: describe("fetchLatestFromGitHub", () => {
191:   test("returns version from GitHub API", async () => {
192:     mockFetch(
193:       async () =>
194:         new Response(
195:           JSON.stringify({
196:             tag_name: "v1.2.3",
197:           }),
198:           {
199:             status: 200,
200:             headers: { "Content-Type": "application/json" },
201:           }
202:         ...
gateway · 2026-09-09 02:06:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1265:     writeFileSync(testLockPath, String(process.pid));
1266: 
1267:     // Verify it exists
1268:     expect(statSync(testLockPath).size).toBeGreaterThan(0);
1269: 
1270:     // Release lock
1271:     releaseLock(testLockPath);
1272: 
1273:     // File should be gone
1274:     expect(
1275:       await access(testLockPath).then(
1276:         () => true,
1277:         () => false
1278:       )
1279:     ).toBe(false);
1280:   });
1281: 
1282:   test("does not throw if lock file does not exist", () => {
1283:     // Should not throw
1284:     expect(() => releaseLock(testLockPath)).not.toThrow();
1285:   });
1286: });
1287: 
1288: describe("executeUpgrade with curl method", () => {
1289:   const upgradeBinDir = join(TEST_TMP_DIR, "upgrade-curl-test");
1290:   const upgradeInstallPath = ...
gateway · 2026-09-09 02:07:00
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 5:  * Covers resolveTargetVersion branches (check mode, already up-to-date,

  Line 220:     // GitHub tag check (for versionExists) — this repo uses un-prefixed tags
gateway · 2026-09-09 02:07:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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-09 02:07:24
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 165: async function resolveTargetWithFallback(opts: {

  Line 609: async function executeStandardUpgrade(opts: {

  Line 710: async function migrateToStandaloneForNightly(opts: {

  Line 825: function startChangelogFetch(

  Line 941:         resolveTargetWithFallback({

  Line 958:         result.changelog = await startChangelogFetch(

  Line 971:     const changelogPromise = startChangelogFetch(

  Line 1014:       warnings = await migrateToStandaloneForNightly({

  Line 1022:       await executeStandardUpgrade({
gateway · 2026-09-09 02:07:38
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
890:       parameters: [
891:         {
892:           brief:
893:             'Specific version (e.g. 0.5.0), or "nightly"/"stable" to switch channel; omit to update within current channel',
894:           parse: String,
895:           placeholder: "version",
896:           optional: true,
897:         },
898:       ],
899:     },
900:     flags: {
901:       check: {
902:         kind: "boolean",
903:         brief: "Check for updates without installing",
904:         default: false,
905:       },
906:       force: {
907:         kind: "boolean",
908:         brief: "Force upgrade even if already on the latest version",
909:         default: false,
910:       },
911:       offline: {
912:         kind: "boolean",
913:         brief:
914:           "Upgrade using only cached version info and patches ...
gateway · 2026-09-09 02:08:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, sep } 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:   getLegacyInstallDirs,
29:   getPlatformBinaryName,
30:   installBinary,
31:   ...
gateway · 2026-09-09 02:08:38
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 53: } from "./ghcr.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/ghcr.test.ts:
  Line 23: } from "../../src/lib/ghcr.js";


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 44: import { GHCR_REPO } from "./ghcr.js";
gateway · 2026-09-09 02:08:46
result
Found 22 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

  Line 30:   getBinaryDownloadUrl,

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

  Line 399: export async function fetchLatestFromGitHub(

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

  Line 467: export async function fetchLatestNightlyVersion(

  Line 503:     return fetchLatestNightlyVersion();

  Line 506:     ? fetchLatestFromGitHub()

  Line 551: export async function versionExists(

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

  Line 728: async function downloadNightlyToPath(

  Line 761: async function downloadStableToPath(

  Line 766:   const url = getBinaryDownloadUrl(version);

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

  Line 884:  * {@link downloadStableToPath}. ...
gateway · 2026-09-09 02:08:52
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 02:08:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
380:       });
381:     } catch {
382:       log.debug("Failed to persist install info (DB may be read-only)");
383:     }
384:   }
385: 
386:   return legacyMethod;
387: }
388: 
389: // Version Fetching
390: 
391: /**
392:  * Fetch the latest version from GitHub releases.
393:  *
394:  * @param signal - Optional AbortSignal to cancel the request
395:  * @returns Latest version string (without 'v' prefix)
396:  * @throws {UpgradeError} When fetch fails or response is invalid
397:  * @throws {Error} AbortError if signal is aborted
398:  */
399: export async function fetchLatestFromGitHub(
400:   signal?: AbortSignal
401: ): Promise<string> {
402:   const response = await fetchWithUpgradeError(
403:     `${GITHUB_RELEASES_URL}/latest`,
404:     { headers: getGitHubHeaders(), signal },
405:     "GitHub"
406:   ...
gateway · 2026-09-09 02:09:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
700: 
701: /**
702:  * Build the gzip filename for the current platform binary.
703:  *
704:  * Nightly builds are stored in GHCR as `sentry-<os>-<arch>.gz` (or
705:  * `sentry-windows-x64.exe.gz` on Windows). This filename is the
706:  * `org.opencontainers.image.title` annotation on the matching OCI layer.
707:  *
708:  * @returns Filename of the gzip-compressed binary for this platform
709:  */
710: function getNightlyGzFilename(): string {
711:   return `${getPlatformBinaryName()}.gz`;
712: }
713: 
714: /**
715:  * Download a nightly binary from GHCR and decompress it to `destPath`.
716:  *
717:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
718:  * matching this platform's `.gz` filename, then downloads and decompresses
719:  * the blob in-stream. ...
gateway · 2026-09-09 02:09:49
result
Found 43 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/types/sentry.ts:
  Line 1014:  * https://github.com/getsentry/sentry/blob/8a4f150b21b/static/app/views/explore/hooks/useTraceItemDetails.tsx#L85-L89


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/types/dashboard.ts:
  Line 233:  * Source: https://github.com/getsentry/sentry/blob/master/src/sentry/search/events/constants.py

  Line 248:  * Source: https://github.com/getsentry/sentry/blob/master/src/sentry/search/events/constants.py

  Line 249:  * Dataset: https://github.com/getsentry/sentry/blob/master/src/sentry/search/events/datasets/spans_indexed.py

  Line 276:  * Source: https://github.com/getsentry/sentry/blob/master/src/sentry/search/events/constants.py

  Line 303:  * https://github.com/getsentry/sentry/blob/master/src/sentry/models/group.py#L196-L204

  Line 306:  ...
gateway · 2026-09-09 02:09:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.45.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:10:07
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 58:   versionExists,

  Line 325:     const exists = await versionExists(lookupMethod, target);

  Line 463:       // CLI-1D3). `downloadBinaryToTemp`'s visibility-race retry loop

  Line 642:       executeUpgrade(method, target, downloadTag, offline, setMessage)

  Line 727:       executeUpgrade("curl", target, downloadTag, undefined, setMessage)
gateway · 2026-09-09 02:10:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
130:   };
131: }
132: 
133: /**
134:  * Resolve the target version from the local cache (SQLite) instead of
135:  * fetching from the network. Used by `--offline` and as automatic
136:  * fallback when `fetchLatestVersion()` hits a network error.
137:  *
138:  * @param versionArg - Explicit version from the user, bypasses the cache lookup
139:  * @returns The target version string
140:  * @throws {UpgradeError} When no cached version is available
141:  */
142: function resolveOfflineTarget(versionArg: string | undefined): string {
143:   if (versionArg) {
144:     return versionArg.replace(VERSION_PREFIX_REGEX, "");
145:   }
146:   const { latestVersion } = getVersionCheckInfo();
147:   if (!latestVersion) {
148:     throw new UpgradeError(
149:       "network_error",
150:       "No cached version ...
gateway · 2026-09-09 02:11:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-09 02:11:36
result
No files found
gateway · 2026-09-09 02:11:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
200:   if (cliIndex !== undefined) {
201:     const subcommand = cliSubcommandAfterGroup(args, cliIndex);
202:     if (
203:       subcommand !== undefined &&
204:       SUPPRESSED_CLI_SUBCOMMANDS.has(subcommand)
205:     ) {
206:       return true;
207:     }
208:   }
209:   return false;
210: }
211: 
212: /**
213:  * Abort any pending version check to allow process exit.
214:  * Call this when main CLI work is complete.
215:  */
216: export function abortPendingVersionCheck(): void {
217:   pendingAbortController?.abort();
218:   pendingAbortController = null;
219: }
220: 
221: /**
222:  * Pre-fetch delta patches for a newly discovered version.
223:  *
224:  * Best-effort: errors are silently caught so the version check still succeeds. ...
gateway · 2026-09-09 02:12:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-09 02:12:18
result
Found 36 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 4:  * Extracts user-facing changelog entries from GitHub Release bodies (stable)

  Line 18:   GITHUB_RELEASES_URL,

  Line 19:   getGitHubHeaders,

  Line 22: import type { GitHubRelease } from "./delta-upgrade.js";

  Line 120:  * Extract user-facing sections from a GitHub Release body.

  Line 225:  * Release notes include ` by @author in [#123](url)` suffixes that are noise

  Line 340:  * Shared by both the stable (GitHub Releases) and nightly (commit log)

  Line 388: function mergeSectionsByCategory(releases: GitHubRelease[]): ChangeSection[] {

  Line 417:  * Build a changelog summary from a list of GitHub releases. ...
gateway · 2026-09-09 02:12:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 02:14:10
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/codemods/sentry-v3-to-v4/tsconfig.json:
  Line 15:     "noUncheckedIndexedAccess": true


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json:
  Line 17:     "noUncheckedIndexedAccess": true,
gateway · 2026-09-09 02:14:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json</path>
<type>file</type>
<content>
1: {
2:   "compilerOptions": {
3:     "lib": ["ESNext"],
4:     "target": "ESNext",
5:     "module": "ESNext",
6:     "jsx": "react-jsx",
7:     "moduleDetection": "force",
8:     "allowJs": true,
9:     "moduleResolution": "bundler",
10:     "allowImportingTsExtensions": true,
11:     "verbatimModuleSyntax": true,
12:     "noEmit": true,
13:     "resolveJsonModule": true,
14:     "strict": true,
15:     "skipLibCheck": true,
16:     "noFallthroughCasesInSwitch": true,
17:     "noUncheckedIndexedAccess": true,
18:     "noImplicitOverride": true,
19:     "esModuleInterop": true,
20:     "forceConsistentCasingInFileNames": true,
21:     "noUnusedLocals": false,
22:     "noUnusedParameters": false,
23:     "noPropertyAccessFromIndexSignature": false,
24:     "strictNullChecks": true
25:   },
26:   "include": ...
gateway · 2026-09-09 02:14:33
result
src/lib/binary.ts(236,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
src/lib/binary.ts(244,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
gateway · 2026-09-09 02:17:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, isAbsolute, join, resolve, sep } 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, ...
gateway · 2026-09-09 02:18:12
result
96390e5f6 chore: pre-shape repo into pnpm-workspace monorepo layout (#1254)
cf165f5ba chore: pre-shape repo into pnpm-workspace monorepo layout
e11da2e85 chore: pre-shape repo into pnpm-workspace monorepo layout
gateway · 2026-09-09 02:22:45
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 273:       headers: getGitHubHeaders(),

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

  Line 426: export async function fetchWithUpgradeError(
gateway · 2026-09-09 02:23:06
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
390:   // 3-4. Check well-known directories that are already in PATH. samePath keeps
391:   // the membership check case-insensitive on Windows/macOS, where a PATH entry
392:   // can differ in casing from the computed directory yet be the same dir.
393:   const candidates = [join(homeDir, ".local", "bin"), join(homeDir, "bin")];
394: 
395:   for (const dir of candidates) {
396:     if (existsSync(dir) && pathDirs.some((p) => samePath(p, dir))) {
397:       return dir;
398:     }
399:   }
400: 
401:   // 5. XDG-aligned fallback — setup will handle adding this to PATH
402:   return join(homeDir, ".local", "bin");
403: }
404: 
405: /**
406:  * Build headers for GitHub API requests.
407:  */
408: export function getGitHubHeaders(): Record<string, string> {
409:   return {
410:     Accept: ...
gateway · 2026-09-09 02:23:19
result
Found 14 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 122: function stableSource(): SourceStrategy {

  Line 132: function nightlySource(): SourceStrategy {

  Line 270: export function resolveStableChain(

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

  Line 278: export async function resolveNightlyChain(opts: {

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

  Line 495:     stableSource(),

  Line 513:     nightlySource(),

  Line 523: export function attemptDeltaUpgrade(

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

  Line 615: export function prefetchNightlyPatches(

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

  Line 622: export function prefetchStablePatches(

  Line 626:   return prefetch(stableSource(), targetVersion, signal);
gateway · 2026-09-09 02:23:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:23:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
145: export function canAttemptDelta(targetVersion: string): boolean {
146:   if (CLI_VERSION === "0.0.0-dev") {
147:     return false;
148:   }
149:   if (isNightlyVersion(CLI_VERSION) !== isNightlyVersion(targetVersion)) {
150:     return false;
151:   }
152:   return !isDowngrade(CLI_VERSION, targetVersion);
153: }
154: 
155: export async function fetchRecentReleases(
156:   signal?: AbortSignal
157: ): Promise<GitHubRelease[]> {
158:   try {
159:     const response = await customFetch(`${GITHUB_RELEASES_URL}?per_page=12`, {
160:       headers: {
161:         Accept: "application/vnd.github.v3+json",
162:         "User-Agent": `sentry-cli/${CLI_VERSION}`,
163:       },
164:       signal,
165:     });
166:     if (!response.ok) {
167:       return [];
168:     }
169:     const data = await ...
gateway · 2026-09-09 02:23:59
result
Found 15 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/ghcr.test.ts:
  Line 17:   GHCR_REPO,

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

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

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

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

  Line 569:         expect(String(url)).toContain(`/v2/${GHCR_REPO}/blobs/sha256:abc123`);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-09 02:24:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
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:   /** MIME type of the layer content */
156:   mediaType: string;
157:   /** Size in bytes */
158:   size: number;
159:   /** Per-layer OCI annotations */
160:   annotations?: Record<string, string>;
161: };
162: 
163: /**
164:  * OCI image manifest returned by the registry. ...
gateway · 2026-09-09 02:24:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:24:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
205: # Download binary to a temp location
206: tmpdir="${TMPDIR:-${TMP:-${TEMP:-/tmp}}}"
207: tmp_binary="${tmpdir}/sentry-install-$$${suffix}"
208: version=""
209: 
210: # Clean up temp binary on failure (setup handles cleanup on success)
211: trap 'rm -f "$tmp_binary"' EXIT
212: 
213: if [[ "$requested_version" == "nightly" ]]; then
214:   # Nightly build: download from GHCR via OCI blob protocol.
215:   # No jq needed — parse JSON with awk.
216:   # ghcr.io blob downloads redirect to Azure Blob Storage. curl -L would
217:   # forward the Authorization header to Azure, which returns 404. Instead,
218:   # extract the redirect URL and follow it without the auth header.
219: 
220:   echo -e "${MUTED}Fetching nightly build from GHCR...${NC}"
221: 
222:   # Step 1: Get anonymous pull token
223:   GHCR_TOKEN=$(curl -sf ...
gateway · 2026-09-09 02:24:56
result
No files found
gateway · 2026-09-09 02:25:08
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-09 02:25:56
result
File not found: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CONTRIBUTING.md
gateway · 2026-09-09 02:26:13
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/content/docs/contributing.md
gateway · 2026-09-09 02:26:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-09 02:26:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:01a02357-f0a8-7fdb-9e9d-b0710cfe65c9 -->
8: * **API output binary and HTTP contracts**: Always preserve strict output-mode and binary-safety contracts. `sentry api` must preserve `rawApiRequest()` status text; empty textual non-2xx bodies must produce an HTTP status/request fallback, and JSON mode must expose `{status, statusText, body}` so empty success and error responses are distinguishable. Binary `Uint8Array` successes bypass formatters and remain raw; binary errors emit only status/content-type/byte-count summaries, never bytes or JSON coercion. Prompts must never block scripted runs or interleave with stdout JSON.
9: 
10: <!-- ...
gateway · 2026-09-09 02:27:14
result
Found 36 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 237:       await prefetchNightlyPatches(latestVersion, signal);

  Line 239:       await prefetchStablePatches(latestVersion, signal);

  Line 286:             ? await fetchLatestNightlyVersion(signal)

  Line 287:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

  Line 399: export async function fetchLatestFromGitHub(

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

  Line 467: export async function fetchLatestNightlyVersion(

  Line 498: export function fetchLatestVersion(

  Line 503:     return fetchLatestNightlyVersion();

  Line 506:     ? ...
gateway · 2026-09-09 02:27:22
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/install-script.test.ts:
  Line 27: const installScript = join(repoRoot, "install");

  Line 40:     const fakeCurl = `#!/usr/bin/env bash

  Line 42: #!/usr/bin/env bash

  Line 49:     const fakeGunzip = `#!/usr/bin/env bash

  Line 62:       "bash",

  Line 64:         installScript,

  Line 112:     const script = readFileSync(installScript, "utf8");
gateway · 2026-09-09 02:27:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: import { UPGRADE_SOURCES } from "../../src/lib/binary.js";
21: 
22: function noop(): void {
23:   // Intentionally empty — absorbs async spawn errors
24: }
25: 
26: const repoRoot = join(import.meta.dirname, "..", "..");
27: const installScript = join(repoRoot, ...
gateway · 2026-09-09 02:28:58
result
No files found
gateway · 2026-09-09 02:29:09
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 511:       const { getUpdateNotification, maybeCheckForUpdateInBackground } = await import('./src/lib/version-check.js');
gateway · 2026-09-09 02:29:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-09 02:29:34
result
Found 10 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts:
  Line 21:   maybeCheckForUpdateInBackground,

  Line 139: // Its probabilistic behavior is tested indirectly through maybeCheckForUpdateInBackground.

  Line 415: describe("maybeCheckForUpdateInBackground", () => {

  Line 449:     expect(() => maybeCheckForUpdateInBackground()).not.toThrow();

  Line 459:     maybeCheckForUpdateInBackground();

  Line 479:       maybeCheckForUpdateInBackground();

  Line 489:     maybeCheckForUpdateInBackground();

  Line 498:     expect(() => maybeCheckForUpdateInBackground()).not.toThrow();

  Line 511:       const { getUpdateNotification, maybeCheckForUpdateInBackground } = await import('./src/lib/version-check.js');

  Line 514:       maybeCheckForUpdateInBackground();
gateway · 2026-09-09 02:29:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts</path>
<type>file</type>
<content>
400:   test("does not throw when no pending check", () => {
401:     // Should be safe to call even when nothing is pending
402:     expect(() => abortPendingVersionCheck()).not.toThrow();
403:   });
404: 
405:   test("does not throw when called multiple times", () => {
406:     // Should be safe to call multiple times
407:     expect(() => {
408:       abortPendingVersionCheck();
409:       abortPendingVersionCheck();
410:       abortPendingVersionCheck();
411:     }).not.toThrow();
412:   });
413: });
414: 
415: describe("maybeCheckForUpdateInBackground", () => {
416:   useTestConfigDir("test-version-bg-");
417:   let savedNoUpdateCheck: string | undefined;
418:   let originalFetch: typeof globalThis.fetch;
419: 
420:   beforeEach(() => {
421:     // Save and clear the env var to test real ...
gateway · 2026-09-09 02:30:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:30:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
590:     return currentInstallDir;
591:   }
592: 
593:   // determineInstallDir with the legacy pin removed yields the XDG target.
594:   const { SENTRY_INSTALL_DIR: _pinned, ...envWithoutPin } = process.env;
595:   const xdgInstallDir = determineInstallDir(homedir(), envWithoutPin);
596:   if (
597:     !samePath(xdgInstallDir, legacyBinDir) &&
598:     isInPath(xdgInstallDir, pathEnv)
599:   ) {
600:     return xdgInstallDir;
601:   }
602:   return currentInstallDir;
603: }
604: 
605: /**
606:  * Execute the standard upgrade path: download via curl or package manager,
607:  * then run setup on the new binary. ...
gateway · 2026-09-09 02:30:44
result
Found 74 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.craft.yml:
  Line 27:         urlTemplate: 'https://github.com/getsentry/cli/releases/download/{{version}}/{{file}}'

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

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

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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/sentry-release.yml:
  Line 31:     if: github.event_name == 'workflow_dispatch' || !github.event.release.prerelease

  Line 38:       VERSION: ${{ github.event.release.tag_name ...
gateway · 2026-09-09 02:32:04
result
No files found
gateway · 2026-09-09 02:32:17
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/README.md:
  Line 45: npx sentry@latest

  Line 69: - **DSN Auto-Detection** - Automatically detects your project from `.env` files or source code. No flags needed.

  Line 73: - **Open in Browser** - Use `-w` flag to open any resource in your browser.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/AGENTS.md:
  Line 11: - **Zero-config experience** - Auto-detect project context from DSNs in source code and env files

  Line 19: - **DSN Auto-Detection** - Scans `.env` files and source code (JS, Python, Go, Java, Ruby, PHP) to find Sentry DSNs

  Line 35: > **Note**: Always check `package.json` for the latest scripts. ...
gateway · 2026-09-09 02:32:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:32:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:32:51
result
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
gateway · 2026-09-09 02:35:04
result
 DEPRECATED  `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. Please, refer to the migration guide: https://vitest.dev/guide/migration#pool-rework

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  test/lib/binary.test.ts > getBinaryDownloadUrl > builds correct URL for current platform
AssertionError: expected 'https://github.com/getsentry/toolkit/…' to contain '/1.0.0/'

Expected: "/1.0.0/"
Received: "https://github.com/getsentry/toolkit/releases/download/cli@1.0.0/sentry-linux-x64"

 ❯ test/lib/binary.test.ts:45:17
     43|     const url = getBinaryDownloadUrl("1.0.0");
     44|
     45|     expect(url).toContain("/1.0.0/");
       |                 ^
     46|     expect(url).toStartWith(
     47|       "https://github.com/getsentry/cli/releases/download/"

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯

 FAIL  test/lib/ghcr.test.ts > getAnonymousToken > uses the selected source's GHCR repository
AssertionError: promise rejected "UpgradeError: Failed to connect ...
gateway · 2026-09-09 02:35:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/binary.test.ts</path>
<type>file</type>
<content>
35:   replaceBinarySync,
36:   samePath,
37:   UPGRADE_SOURCES,
38: } from "../../src/lib/binary.js";
39: import { UpgradeError } from "../../src/lib/errors.js";
40: 
41: describe("getBinaryDownloadUrl", () => {
42:   test("builds correct URL for current platform", () => {
43:     const url = getBinaryDownloadUrl("1.0.0");
44: 
45:     expect(url).toContain("/1.0.0/");
46:     expect(url).toStartWith(
47:       "https://github.com/getsentry/cli/releases/download/"
48:     );
49:     expect(url).toContain("sentry-");
50: 
51:     const arch = process.arch === "arm64" ? "arm64" : "x64";
52:     expect(url).toContain(arch);
53:   });
54: 
55:   test("includes .exe suffix on Windows", () => {
56:     // Can only truly test this on Windows, but we verify the format
57:     const url = ...
gateway · 2026-09-09 02:35:48
result
Found 49 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 135:   downloadBinaryToTemp,

  Line 137:   fetchLatestFromGitHub,

  Line 139:   fetchLatestNightlyVersion,

  Line 144:   versionExists,

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

  Line 205:     const version = await fetchLatestFromGitHub();

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

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

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

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

  Line 344: // fetchLatestNightlyVersion tests are in ...
gateway · 2026-09-09 02:36:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
175:   });
176: 
177:   test("parses case-insensitively", () => {
178:     expect(parseInstallationMethod("NPM")).toBe("npm");
179:     expect(parseInstallationMethod("Curl")).toBe("curl");
180:     expect(parseInstallationMethod("YARN")).toBe("yarn");
181:   });
182: 
183:   test("throws on invalid method", () => {
184:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
185:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
186:     expect(() => parseInstallationMethod("")).toThrow("Invalid method: ");
187:   });
188: });
189: 
190: describe("fetchLatestFromGitHub", () => {
191:   test("returns version from GitHub API", async () => {
192:     mockFetch(
193:       async () =>
194:         new Response(
195:           JSON.stringify({
196:      ...
gateway · 2026-09-09 02:36:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
535:       async () =>
536:         new Response(JSON.stringify({ tag_name: "v3.0.0" }), {
537:           status: 200,
538:           headers: { "Content-Type": "application/json" },
539:         })
540:     );
541: 
542:     const version = await fetchLatestVersion("curl");
543:     expect(version).toBe("3.0.0");
544:   });
545: });
546: 
547: describe("versionExists", () => {
548:   test("checks GitHub for curl method - version exists", async () => {
549:     mockFetch(async () => new Response(null, { status: 200 }));
550: 
551:     const exists = await versionExists("curl", "1.0.0");
552:     expect(exists).toBe(true);
553:   });
554: 
555:   test("checks GitHub for curl method - version does not exist", async () => {
556:     mockFetch(async () => new Response(null, { status: 404 }));
557: 
558:     ...
gateway · 2026-09-09 02:36:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1510:     expect(isNightlyVersion("2.0.0-beta.1")).toBe(false);
1511:     expect(isNightlyVersion("0.0.0-dev")).toBe(false);
1512:   });
1513: });
1514: 
1515: describe("fetchLatestNightlyVersion", () => {
1516:   test("returns version from GHCR manifest annotation", async () => {
1517:     // Mock the two requests: token exchange + manifest fetch
1518:     let callCount = 0;
1519:     mockFetch(async (url) => {
1520:       callCount += 1;
1521:       const urlStr = String(url);
1522:       if (urlStr.includes("ghcr.io/token")) {
1523:         return new Response(JSON.stringify({ token: "test-token" }), {
1524:           status: 200,
1525:           headers: { "Content-Type": "application/json" },
1526:         });
1527:       }
1528:       if (urlStr.includes("/manifests/nightly")) {
1529:         ...
gateway · 2026-09-09 02:36:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 02:36:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
385: 
386:   return legacyMethod;
387: }
388: 
389: // Version Fetching
390: 
391: /**
392:  * Fetch the latest version from GitHub releases.
393:  *
394:  * @param signal - Optional AbortSignal to cancel the request
395:  * @returns Latest version string (without 'v' prefix)
396:  * @throws {UpgradeError} When fetch fails or response is invalid
397:  * @throws {Error} AbortError if signal is aborted
398:  */
399: export async function fetchLatestFromGitHub(
400:   signal?: AbortSignal
401: ): Promise<string> {
402:   const response = await fetchWithUpgradeError(
403:     `${GITHUB_RELEASES_URL}/latest`,
404:     { headers: getGitHubHeaders(), signal },
405:     "GitHub"
406:   );
407: 
408:   if (!response.ok) {
409:     throw new UpgradeError(
410:       "network_error",
411:       `Failed to fetch from ...
gateway · 2026-09-09 02:37:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
700: 
701: /**
702:  * Build the gzip filename for the current platform binary.
703:  *
704:  * Nightly builds are stored in GHCR as `sentry-<os>-<arch>.gz` (or
705:  * `sentry-windows-x64.exe.gz` on Windows). This filename is the
706:  * `org.opencontainers.image.title` annotation on the matching OCI layer.
707:  *
708:  * @returns Filename of the gzip-compressed binary for this platform
709:  */
710: function getNightlyGzFilename(): string {
711:   return `${getPlatformBinaryName()}.gz`;
712: }
713: 
714: /**
715:  * Download a nightly binary from GHCR and decompress it to `destPath`.
716:  *
717:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
718:  * matching this platform's `.gz` filename, then downloads and decompresses
719:  * the blob in-stream. ...
gateway · 2026-09-09 02:37:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-09 02:37:46
result
No files found
gateway · 2026-09-09 02:38:10
result
Found 20 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 45:   fetchChangelog,

  Line 51:   fetchLatestVersion,

  Line 58:   versionExists,

  Line 136:  * fallback when `fetchLatestVersion()` hits a network error.

  Line 162:  *   Returns `null` when `resolveTargetVersion` returns a "done" result

  Line 165: async function resolveTargetWithFallback(opts: {

  Line 202:     const resolved = await resolveTargetVersion(resolveOpts);

  Line 285: async function resolveTargetVersion(

  Line 289:   const latest = await fetchLatestVersion(method, channel);

  Line 325:     const exists = await versionExists(lookupMethod, target);

  Line 609: async function executeStandardUpgrade(opts: {

  Line 710: async function migrateToStandaloneForNightly(opts: {

  Line 825: function startChangelogFetch(

  Line 834:   return fetchChangelog({

  Line 941:         ...
gateway · 2026-09-09 02:38:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
130:   };
131: }
132: 
133: /**
134:  * Resolve the target version from the local cache (SQLite) instead of
135:  * fetching from the network. Used by `--offline` and as automatic
136:  * fallback when `fetchLatestVersion()` hits a network error.
137:  *
138:  * @param versionArg - Explicit version from the user, bypasses the cache lookup
139:  * @returns The target version string
140:  * @throws {UpgradeError} When no cached version is available
141:  */
142: function resolveOfflineTarget(versionArg: string | undefined): string {
143:   if (versionArg) {
144:     return versionArg.replace(VERSION_PREFIX_REGEX, "");
145:   }
146:   const { latestVersion } = getVersionCheckInfo();
147:   if (!latestVersion) {
148:     throw new UpgradeError(
149:       "network_error",
150:       "No cached version ...
gateway · 2026-09-09 02:39:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:39:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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-09 02:41:52
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
90:  *
91:  * Defined here (alongside other installation constants like
92:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
93:  * `db/install-info.ts` can import it without creating a circular
94:  * dependency.
95:  */
96: export type InstallationMethod =
97:   | "curl"
98:   | "brew"
99:   | "npm"
100:   | "pnpm"
101:   | "bun"
102:   | "yarn"
103:   | "unknown";
104: 
105: /** A repository pair that hosts CLI stable releases and nightly OCI images. */
106: export type UpgradeSource = {
107:   /** GitHub `owner/repository` containing CLI release assets. */
108:   readonly githubRepo: string;
109:   /** GHCR `owner/package` containing CLI nightly images and delta patches. */
110:   readonly ghcrRepo: string;
111:   /** Prefix attached to CLI release tags in this repository. ...
gateway · 2026-09-09 02:42:32
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-09 02:42:44
result
Found 17 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 59:     "typecheck": "pnpm run generate:docs && pnpm run generate:sdk && tsc --noEmit",

  Line 63:     "test:unit": "pnpm run generate:docs && pnpm run generate:sdk && vitest run test/lib test/commands test/types test/script --coverage",

  Line 67:     "generate:parser": "pnpm tsx script/generate-parser.ts",

  Line 68:     "generate:sdk": "pnpm tsx script/generate-sdk.ts",

  Line 69:     "generate:skill": "pnpm tsx script/generate-skill.ts",

  Line 70:     "generate:banner": "pnpm tsx script/generate-banner-sixel.ts",

  Line 71:     "generate:docs": "pnpm run generate:banner && pnpm run generate:parser && pnpm run generate:command-docs && pnpm run generate:skill && pnpm run generate:docs-sections",

  Line 72:     "generate:docs-sections": "pnpm tsx script/generate-docs-sections.ts",

  Line 73:     "generate:schema": "pnpm ...
gateway · 2026-09-09 02:42:54
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
45:   "devEngines": {
46:     "runtime": {
47:       "name": "node",
48:       "version": ">=22.15"
49:     }
50:   },
51:   "packageManager": "pnpm@10.11.0",
52:   "scripts": {
53:     "tsx": "tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs",
54:     "cli": "tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs src/bin.ts",
55:     "dev": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && tsx --import ./script/require-shim.mjs src/bin.ts",
56:     "build": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts --single",
57:     "build:all": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts",
58:     "bundle": "pnpm run generate:schema && pnpm ...
gateway · 2026-09-09 02:43:08
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 242:       - run: pnpm run lint

  Line 244:       - run: pnpm run check:deps

  Line 245:       - run: pnpm run check:errors

  Line 246:       - run: pnpm run check:patches

  Line 247:       - run: pnpm run check:stale-refs
gateway · 2026-09-09 02:43:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
225:     steps:
226:       - uses: actions/checkout@v6
227:       - uses: pnpm/action-setup@v4
228:       - uses: actions/setup-node@v6
229:         with:
230:           node-version: ${{ env.NODE_VERSION_22 }}
231:       - uses: actions/cache@v5
232:         id: cache
233:         with:
234:           path: |
235:             node_modules
236:             packages/*/node_modules
237:             apps/*/node_modules
238:           key: node-modules-${{ hashFiles('pnpm-lock.yaml', '.npmrc', 'packages/cli/patches/**') }}
239:       - if: steps.cache.outputs.cache-hit != 'true'
240:         run: pnpm install --frozen-lockfile
241:       - run: pnpm run generate:schema
242:       - run: pnpm run lint
243:       - run: pnpm run typecheck
244:       - run: pnpm run check:deps
245:       - run: pnpm run check:errors
246:    ...
gateway · 2026-09-09 02:43:38
result
Found 35 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 50:   executeUpgrade,

  Line 51:   fetchLatestVersion,

  Line 58:   versionExists,

  Line 136:  * fallback when `fetchLatestVersion()` hits a network error.

  Line 289:   const latest = await fetchLatestVersion(method, channel);

  Line 325:     const exists = await versionExists(lookupMethod, target);

  Line 442:           // an invalid code signature (the downloaded binary has quarantine

  Line 463:       // CLI-1D3). `downloadBinaryToTemp`'s visibility-race retry loop

  Line 465:       // `.download` file being removed between verification and spawn

  Line 467:       // pass a path not backed by the download pipeline.

  Line 472:             "The download may have been interrupted — rerun `sentry cli upgrade`."

  Line 606:  * Execute the standard upgrade path: download via curl or package manager,

  ...
gateway · 2026-09-09 02:44:22
result
{"body":"Tracking issue for merging **getsentry/cli** into the existing **getsentry/sentry-mcp** repository, validating the combined monorepo there, and only then renaming it to **`getsentry/toolkit`**. The final repository is a pnpm workspace (no Turbo) with independent prefixed releases and phased shared code.\n\n**Full plan:** https://gist.github.com/BYK/8c0ce6cec64608f41fe5654b7827228e\n\n## Settled architecture\n\n- Use `getsentry/sentry-mcp` as the destination; do not create a fresh repository. This preserves MCP production secrets, environments, GitHub App, webhooks, Vercel, and Cloudflare wiring.\n- Import CLI while the repository is still named `getsentry/sentry-mcp`. Rename only after the integrated monorepo and live deployment paths pass every gate.\n- Preserve CLI and docs history through two filtered `git subtree` imports into `packages/cli` and `apps/cli-docs`.\n- Release products independently with `cli@x.y.z` and `mcp@x.y.z`.\n- CLI docs remain release-gated on Vercel; ...
gateway · 2026-09-09 02:46:27
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/pnpm-lock.yaml:
  Line 2169:   binpatch@0.4.2:

  Line 6698:   binpatch@0.4.2: {}


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 111:     "binpatch": "^0.4.2",
gateway · 2026-09-09 02:46:44
result
No files found
gateway · 2026-09-09 02:46:51
result
No files found
gateway · 2026-09-09 02:47:28
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts:
  Line 589:   | "network_error"

  Line 591:   | "version_not_found"

  Line 600: export class UpgradeError extends CliError {

  Line 609:       network_error: "Failed to fetch version information.",

  Line 611:       version_not_found: "The specified version was not found.",
gateway · 2026-09-09 02:47:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
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.
596:  *
597:  * @param reason - Type of upgrade failure
598:  * @param message - Custom message (uses default if not provided)
599:  */
600: export class UpgradeError extends CliError {
601:   readonly reason: UpgradeErrorReason;
602: 
603:   constructor(reason: UpgradeErrorReason, message?: ...
gateway · 2026-09-09 02:48:02
result
src/lib/binary.ts(236,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
src/lib/binary.ts(244,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
gateway · 2026-09-09 02:48:28
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 975:     const url = getBinaryDownloadUrl("1.0.0");


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

  Line 57:     const url = getBinaryDownloadUrl("2.0.0");
gateway · 2026-09-09 02:48:39
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
930: 
931:   afterEach(() => {
932:     process.argv = originalArgv;
933:     Object.defineProperty(process, "execPath", {
934:       value: originalExecPath,
935:       configurable: true,
936:     });
937:     clearInstallInfo();
938:   });
939: 
940:   test("stored info takes priority over path-based detection", async () => {
941:     // If DB says "yarn", respect it even if path says node_modules
942:     setInstallInfo({ method: "yarn", path: "/old/path", version: "0.0.1" });
943:     process.argv[1] = join(
944:       "/usr/local/lib",
945:       "node_modules",
946:       "sentry",
947:       "dist",
948:       "bin.cjs"
949:     );
950: 
951:     const method = await detectInstallationMethod();
952:     expect(method).toBe("yarn");
953:   });
954: 
955:   test("Homebrew still takes priority over ...
gateway · 2026-09-09 02:49:26
result
[{"baseRefName":"main","headRefName":"chore/preshape-monorepo","number":1254,"state":"MERGED","title":"chore: pre-shape repo into pnpm-workspace monorepo layout","url":"https://github.com/getsentry/cli/pull/1254"}]
[]
gateway · 2026-09-09 02:49:52
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-09 02:50:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:50:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
318: /**
319:  * Download a nightly binary blob from GHCR and write it to disk.
320:  *
321:  * The blob endpoint returns a 307 redirect to a signed Azure Blob Storage URL.
322:  * `fetch` with `redirect: "follow"` would forward the Authorization header
323:  * to Azure, which returns 404. We must:
324:  * 1. Fetch the blob URL without following redirects to get the redirect URL.
325:  * 2. Follow the redirect URL without the Authorization header.
326:  *
327:  * @param token - Anonymous bearer token from {@link getAnonymousToken}
328:  * @param digest - Layer digest to download (e.g., "sha256:abc123...")
329:  * @returns Raw response body (gzip-compressed binary)
330:  * @throws {UpgradeError} On network failure or bad response
331:  */
332: export async function downloadNightlyBlob(
333:   token: string,
334:   ...
gateway · 2026-09-09 02:50:29
result
Found 22 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 122: function stableSource(): SourceStrategy {

  Line 124:     releasesUrl: GITHUB_RELEASES_URL,

  Line 132: function nightlySource(): SourceStrategy {

  Line 135:     repo: GHCR_REPO,

  Line 155: export async function fetchRecentReleases(

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

  Line 270: export function resolveStableChain(

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

  Line 278: export async function resolveNightlyChain(opts: {

  Line 288:     repo: GHCR_REPO,

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

  ...
gateway · 2026-09-09 02:50:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:51:02
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: ...
gateway · 2026-09-09 02:51:14
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 720: export async function fetchChangelog(
gateway · 2026-09-09 02:51:30
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
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) */
707:   prefetchedReleases?: GitHubRelease[];
708: };
709: 
710: /**
711:  * Fetch changelog for an upgrade, dispatching to stable or nightly.
712:  *
713:  * Best-effort: returns null on any failure. Designed to be called in
714:  * parallel with the binary download so it adds zero latency.
715:  *
716:  * For stable upgrades, accepts optional pre-fetched releases to avoid
717:  * a redundant GitHub Releases API call when the delta-upgrade flow has
718:  * already fetched the same data. ...
gateway · 2026-09-09 02:51:38
result
Found 49 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install:
  Line 47:     local json_channel; json_channel=$(_esc "${requested_version:-stable}")

  Line 48:     local json_version; json_version=$(_esc "${version:-unknown}")

  Line 54:       "{\"event_id\":\"${event_id}\",\"timestamp\":\"${timestamp}\",\"platform\":\"other\",\"level\":\"error\",\"logger\":\"install\",\"server_name\":\"install-script\",\"message\":{\"formatted\":\"${json_msg}\"},\"tags\":{\"os\":\"${os:-unknown}\",\"arch\":\"${arch:-unknown}\",\"libc\":\"${libc_variant:-glibc}\",\"channel\":\"${json_channel}\",\"step\":\"${json_step}\",\"install.version\":\"${json_version}\"},\"contexts\":{\"runtime\":{\"name\":\"bash\",\"version\":\"${BASH_VERSION:-unknown}\"}}}")

  Line 58:       -H "X-Sentry-Auth: Sentry sentry_key=${SENTRY_DSN_KEY},sentry_version=7" \

  Line 85:     -v, --version <version> Install a specific version (e.g., ...
gateway · 2026-09-09 02:51:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
190:         fi
191:       fi
192:     fi
193:   fi
194: fi
195: 
196: # Validate supported combinations
197: suffix=""
198: if [[ "$os" == "windows" ]]; then
199:   suffix=".exe"
200:   if [[ "$arch" != "x64" ]]; then
201:     die "Unsupported: windows-$arch (only windows-x64 is supported)" "detect-arch"
202:   fi
203: fi
204: 
205: # Download binary to a temp location
206: tmpdir="${TMPDIR:-${TMP:-${TEMP:-/tmp}}}"
207: tmp_binary="${tmpdir}/sentry-install-$$${suffix}"
208: version=""
209: 
210: # Clean up temp binary on failure (setup handles cleanup on success)
211: trap 'rm -f "$tmp_binary"' EXIT
212: 
213: if [[ "$requested_version" == "nightly" ]]; then
214:   # Nightly build: download from GHCR via OCI blob protocol.
215:   # No jq needed — parse JSON with awk.
216:   # ghcr.io blob downloads redirect to Azure ...
gateway · 2026-09-09 02:52:09
result
No files found
gateway · 2026-09-09 02:52:20
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/binary.test.ts:
  Line 500:     const content = await readFile(installPath, "utf-8");

  Line 523:     const content = await readFile(installPath, "utf-8");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/install-script.test.ts:
  Line 27: const installScript = join(repoRoot, "install");

  Line 64:         installScript,

  Line 112:     const script = readFileSync(installScript, "utf8");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/setup.test.ts:
  Line 1117:     expect(await readFile(join(installDir, "sentry"), "utf8")).toBe(
gateway · 2026-09-09 02:53:54
result
Found 58 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 476:   const token = await getAnonymousToken();

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

  Line 523:   const token = await getAnonymousToken();

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

  Line 733:   const token = await getAnonymousToken();

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

  Line 736:     : await fetchNightlyManifest(token);

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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(

  ...
gateway · 2026-09-09 02:54:02
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 250: export const GITHUB_RELEASES_URL = getGitHubReleasesUrl();


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

  Line 193:   const url = ...
gateway · 2026-09-09 02:54:11
result
Found 33 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 834:     const result = await fetchRecentReleases();

  Line 842:     const result = await fetchRecentReleases();

  Line 851:     const result = await fetchRecentReleases();

  Line 947:     const chain = await resolveStableChain("0.13.0", "0.14.0");

  Line 1000:     const chain = await resolveStableChain("0.13.0", "0.15.0");

  Line 1018:     const chain = await resolveStableChain("0.12.0", "0.14.0");

  Line 1025:     const chain = await resolveStableChain("0.12.0", "0.13.0");

  Line 1050:     const chain = await resolveStableChain("0.13.0", "0.14.0");

  Line 1073:     const chain = await resolveStableChain("0.1.0", "0.15.0");

  Line 1169:     const chain = await resolveNightlyChain({

  Line 1187:     const chain = await resolveNightlyChain({

  Line 1206:     const chain = await resolveNightlyChain({

  ...
gateway · 2026-09-09 02:54:29
result
6e3e7e13a feat(config): follow XDG Base Directory spec for config location (#1503)
b0b22fe82 feat(errors): wire up no-silent-catch lint rule, drop ratchet baseline (#1532)
ad9cd1d61 docs: weekly documentation audit — fix Zod→Valibot drift, stale versions, dataset list (#1400)
bbaed257e docs: documentation audit — fix version claims, license, agent coverage, and auth examples (#1350)
6923168e8 fix(upgrade): delta apply progress bar shows percentage only (no GB scare) (#1355)
7b429edd1 fix(upgrade): use generated-patch from-version + close output fd synchronously (#1327)
96390e5f6 chore: pre-shape repo into pnpm-workspace monorepo layout (#1254)
gateway · 2026-09-09 02:54:46
result
Found 12 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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" } },


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/release-notes.property.test.ts:
  Line 5:  * for the release notes extraction and commit parsing, regardless of input.

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

  Line 176:           { commit: { message: `feat: ${desc}\n\n#skip-changelog` } },

  Line 177:           { commit: { message: `fix: ${desc}\n\n#skip-changelog` } },

  Line 178:           { commit: { message: `perf: ${desc}\n\n#skip-changelog` } },

  Line 181:         // All commits have #skip-changelog, so no sections should be ...
gateway · 2026-09-09 02:55:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, isAbsolute, join, resolve, sep } 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, ...
gateway · 2026-09-09 02:55:24
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 426: export async function fetchWithUpgradeError(
gateway · 2026-09-09 02:55:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
400: 
401:   // 5. XDG-aligned fallback — setup will handle adding this to PATH
402:   return join(homeDir, ".local", "bin");
403: }
404: 
405: /**
406:  * Build headers for GitHub API requests.
407:  */
408: export function getGitHubHeaders(): Record<string, string> {
409:   return {
410:     Accept: "application/vnd.github.v3+json",
411:     "User-Agent": getUserAgent(),
412:   };
413: }
414: 
415: /**
416:  * Fetch wrapper that converts network errors to UpgradeError.
417:  * Handles DNS failures, timeouts, and other connection issues.
418:  *
419:  * @param url - URL to fetch
420:  * @param init - Fetch options
421:  * @param serviceName - Service name for error messages (e.g., "GitHub")
422:  * @returns Response object
423:  * @throws {UpgradeError} On network failure
424:  * @throws {Error} AbortError if ...
gateway · 2026-09-09 02:55:48
result
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
## feat/toolkit-bridge-upgrade...origin/main
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
gateway · 2026-09-09 02:57:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-09 02:57:29
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
270:   pendingAbortController = new AbortController();
271:   const { signal } = pendingAbortController;
272: 
273:   const channel = getReleaseChannel();
274: 
275:   Sentry.startSpanManual(
276:     {
277:       name: "version-check",
278:       op: "version.check",
279:       forceTransaction: true,
280:     },
281:     async (span) => {
282:       try {
283:         // Use GHCR for nightly channel; GitHub Releases for stable.
284:         const latestVersion =
285:           channel === "nightly"
286:             ? ...
gateway · 2026-09-09 03:00:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
900:     flags: {
901:       check: {
902:         kind: "boolean",
903:         brief: "Check for updates without installing",
904:         default: false,
905:       },
906:       force: {
907:         kind: "boolean",
908:         brief: "Force upgrade even if already on the latest version",
909:         default: false,
910:       },
911:       offline: {
912:         kind: "boolean",
913:         brief:
914:           "Upgrade using only cached version info and patches (no network)",
915:         default: false,
916:       },
917:       "no-agent-skills": {
918:         kind: "boolean",
919:         brief: "Skip agent skill installation for AI coding assistants",
920:         default: false,
921:       },
922:       method: {
923:         kind: "parsed",
924:         parse: ...
gateway · 2026-09-09 03:01:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
250:   // Offline mode is only supported for curl-installed binaries — package
251:   // managers always need network to fetch and install packages.
252:   if (offline && method !== "curl") {
253:     throw new UpgradeError(
254:       "unsupported_operation",
255:       "Offline upgrade is only supported for curl-installed binaries."
256:     );
257:   }
258: }
259: 
260: type ResolveTargetOptions = {
261:   method: InstallationMethod;
262:   channel: ReleaseChannel;
263:   versionArg: string | undefined;
264:   channelChanged: boolean;
265:   flags: UpgradeFlags;
266: };
267: 
268: /**
269:  * Result of resolving the target version. ...
gateway · 2026-09-09 03:01:50
result
Found 57 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/pnpm-lock.yaml:
  Line 867:   '@hono/mcp@0.2.5':

  Line 1548:   '@sentry/cli@2.58.6':

  Line 4207:   trpc-cli@0.12.4:

  Line 5355:   '@hono/mcp@0.2.5(@modelcontextprotocol/sdk@1.29.0(zod@4.4.3))(hono-rate-limiter@0.4.2(hono@4.12.34))(hono@4.12.34)(zod@4.4.3)':

  Line 6000:   '@sentry/cli@2.58.6':

  Line 9255:   trpc-cli@0.12.4(@trpc/server@11.18.0(typescript@5.9.3))(valibot@1.4.2(typescript@5.9.3))(zod@4.4.3):


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/issue/resolve.func.test.ts:
  Line 208:         { json: false, in: "@commit:getsentry/cli@abc123" },


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/AGENTS.md:
  Line 7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built ...
gateway · 2026-09-09 03:01:59
result
No files found
gateway · 2026-09-09 03:02:42
result
No files found
gateway · 2026-09-09 03:02:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules</path>
<type>directory</type>
<entries>
.modules.yaml
.pnpm-workspace-state.json
.pnpm/

(3 entries)
</entries>
gateway · 2026-09-09 03:03:12
result
No files found
gateway · 2026-09-09 03:03:30
result
No files found
gateway · 2026-09-09 03:03:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm</path>
<type>directory</type>
<entries>
@a2a-js+sdk@0.3.14_express@5.2.1/
@ai-sdk+provider-utils@2.2.8_zod@4.4.3/
@ai-sdk+provider-utils@3.0.30_zod@4.4.3/
@ai-sdk+provider-utils@4.0.40_zod@4.4.3/
@ai-sdk+provider-utils@5.0.13_zod@4.4.3/
@ai-sdk+provider@1.1.3/
@ai-sdk+provider@2.0.3/
@ai-sdk+provider@3.0.14/
@ai-sdk+provider@4.0.4/
@ai-sdk+ui-utils@1.2.11_zod@4.4.3/
@alcalzone+ansi-tokenize@0.3.0/
@anthropic-ai+sdk@0.39.0/
@apm-js-collab+code-transformer-bundler-plugins@0.5.0/
@apm-js-collab+code-transformer-bundler-plugins@0.7.3/
@apm-js-collab+code-transformer@0.15.0/
@apm-js-collab+code-transformer@0.18.1/
@apm-js-collab+tracing-hooks@0.10.1/
@apm-js-collab+tracing-hooks@0.13.0/
@astrojs+compiler-binding-linux-x64-gnu@0.3.2/
@astrojs+compiler-binding-linux-x64-musl@0.3.2/

(Showing 20 of 872 entries. ...
gateway · 2026-09-09 03:03:50
result
No files found
gateway · 2026-09-09 03:04:00
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.modules.yaml:
  Line 630:   binpatch@0.4.2:

  Line 631:     binpatch: private
gateway · 2026-09-09 03:04:15
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm</path>
<type>directory</type>
<entries>
convert-to-spaces@2.0.1/
cookie-es@1.2.3/
cookie-signature@1.2.2/
cookie@0.7.2/
cookie@1.1.1/
cookie@2.0.1/
cors@2.8.6/
croner@10.0.1/
cross-spawn@7.0.6/
crossws@0.3.5/
css-select@5.2.2/
css-selector-parser@3.3.0/
css-tree@2.2.1/
css-tree@3.2.1/
css-what@6.2.2/
cssesc@3.0.0/
csso@5.0.5/
csstype@3.2.3/
debug@4.4.3/
decode-named-character-reference@1.3.0/
deepmerge@4.3.1/
defu@6.1.7/
delayed-stream@1.0.0/
depd@2.0.0/
dequal@2.0.3/
destr@2.0.5/
detect-libc@2.1.2/
devalue@5.9.0/
devlop@1.1.0/
diff@8.0.4/
direction@2.0.1/
dom-serializer@2.0.0/
domelementtype@2.3.0/
domhandler@5.0.3/
domutils@3.2.2/
dotenv@17.4.2/
dset@3.1.4/
dunder-proto@1.0.1/
ee-first@1.1.1/
electron-to-chromium@1.5.392/
emoji-regex@8.0.0/
encodeurl@2.0.0/
entities@4.5.0/
entities@6.0.1/
environment@1.1.0/
error-stack-parser-es@1.0.5/
es-define-property@1...
gateway · 2026-09-09 03:04:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm</path>
<type>directory</type>
<entries>
baseline-browser-mapping@2.10.43/
bcp-47-match@2.0.3/
bcp-47@2.1.1/
binpatch@0.4.2/
binpunch@1.0.0/
blake3-wasm@2.1.5/
body-parser@2.3.0/
boolbase@1.0.0/
brace-expansion@5.0.9/
browserslist@4.28.6/
bytes@3.1.2/
call-bind-apply-helpers@1.0.2/
call-bound@1.0.4/
caniuse-lite@1.0.30001805/
canonicalize@1.0.8/
ccount@2.0.1/
chai@6.2.2/
chalk@4.1.2/
chalk@5.6.2/
character-entities-html4@2.1.0/
character-entities-legacy@3.0.0/
character-entities@2.0.2/
character-reference-invalid@2.0.1/
chat@4.35.0_zod@4.4.3/
chokidar@5.0.0/
ci-info@4.4.0/
citty@0.2.2/
cjs-module-lexer@2.2.0/
cli-boxes@4.0.1/
cli-cursor@4.0.0/
cli-highlight@2.1.11/
cli-spinners@2.9.2/
cli-truncate@6.1.1/
cliui@7.0.4/
clsx@2.1.1/
code-excerpt@4.0.0/
collapse-white-space@2.1.0/
color-convert@2.0.1/
color-name@1.1.4/
combined-stream@1.0.8/
comma-separated-tokens...
gateway · 2026-09-09 03:04:38
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2</path>
<type>directory</type>
<entries>
node_modules/

(1 entries)
</entries>
gateway · 2026-09-09 03:04:46
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/README.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/package.json
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/LICENSE
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js.map
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpat...
gateway · 2026-09-09 03:04:59
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts:
  Line 254:  * resolveAndApply({ source: ghcrSource({ ..., instrument }), ... });

  Line 334: type SourceStrategy = {

  Line 335:     resolveChain(currentVersion: string, targetVersion: string, signal?: AbortSignal, report?: UnavailableReporter): Promise<PatchChain | null>;

  Line 446: declare class OciClient {

  Line 510: /** Configuration for {@link ghcrSource}. */

  Line 533: declare function ghcrSource(config: GhcrSourceConfig): SourceStrategy;

  Line 590: /** Configuration for {@link githubReleaseSource}. ...
gateway · 2026-09-09 03:05:06
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts</path>
<type>file</type>
<content>
320: 
321: /**
322:  * A source of patch chains. Given the current and target versions, resolve the
323:  * ordered chain of patches (oldest hop first) plus the expected final SHA-256,
324:  * or `null` when no usable chain exists (caller falls back to a full download).
325:  *
326:  * A source may optionally classify *why* it returned `null` by invoking the
327:  * `report` callback with a {@link DeltaUnavailableReason}. This is telemetry
328:  * only — it never changes control flow (a `null` return is always a full-
329:  * download fallback). ...
gateway · 2026-09-09 03:05:22
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js:
  Line 1038: function ghcrSource(config) {

  Line 1225: function githubReleaseSource(config) {
gateway · 2026-09-09 03:05:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
1010:   let prevVersion = currentVersion;
1011:   for (let i = 0; i < manifests.length; i++) {
1012:     const manifest = manifests[i];
1013:     const tag = chainTags[i];
1014:     if (!(manifest && tag)) return { failure: "malformed_chain" };
1015:     const remainingBudget = fullGzSize * SIZE_THRESHOLD_RATIO - totalSize;
1016:     const result = validateChainStep(manifest, {
1017:       expectedFrom: prevVersion,
1018:       patchLayerName,
1019:       sizeLimit: remainingBudget
1020:     });
1021:     if (!result.ok) {
1022:       return {
1023:         failure: result.reason === "over_budget" ? "over_budget" : "malformed_chain"
1024:       };
1025:     }
1026:     digests.push(result.digest);
1027:     totalSize += result.size;
1028:     prevVersion = ...
gateway · 2026-09-09 03:05:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
1100:     if (isChainFailure(validation)) {
1101:       report?.(validation.failure);
1102:       return null;
1103:     }
1104:     const downloadResults = await Promise.all(
1105:       validation.digests.map(
1106:         (digest) => i(
1107:           "download-patch",
1108:           () => client.downloadBlobBuffer(token, digest, signal).then((buf) => new Uint8Array(buf))
1109:         )
1110:       )
1111:     );
1112:     const patches = [];
1113:     let downloadedSize = 0;
1114:     for (const data of downloadResults) {
1115:       patches.push({ data, size: data.byteLength });
1116:       downloadedSize += data.byteLength;
1117:     }
1118:     const steps = [];
1119:     let prevVersion = currentVersion;
1120:     for (const tag of chainTags) {
1121:       ...
gateway · 2026-09-09 03:06:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
1265:   return {
1266:     async resolveChain(currentVersion, targetVersion, signal, report) {
1267:       const releases = await fetchRecentReleases(signal);
1268:       if (releases === null) {
1269:         report?.("network");
1270:         return null;
1271:       }
1272:       const targetRelease = releases.find((r) => r.tag_name === targetVersion);
1273:       if (!targetRelease) {
1274:         report?.("no_patches");
1275:         return null;
1276:       }
1277:       const gzAsset = targetRelease.assets.find(
1278:         (a) => a.name === `${binaryName}.gz`
1279:       );
1280:       if (!gzAsset) {
1281:         report?.("malformed_chain");
1282:         return null;
1283:       }
1284:       const chainInfo = extractStableChain({
1285:         ...
gateway · 2026-09-09 03:06:29
result
Found 34 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 135:   downloadBinaryToTemp,

  Line 386:       "Cannot upgrade offline — no pre-downloaded update is available."

  Line 640:       if (u.includes("/manifests/nightly-")) {

  Line 656:       if (u.includes("/manifests/nightly-")) {

  Line 673:       if (u.includes("/manifests/nightly-")) {

  Line 980:       "https://github.com/getsentry/cli/releases/download/"

  Line 1033:     // Temp path should be installPath + .download

  Line 1034:     expect(paths.tempPath).toBe(`${paths.installPath}.download`);

  Line 1065:       expect(paths.tempPath).toBe(`${customPath}.download`);

  Line 1327:   test("downloads and decompresses gzip binary when .gz URL succeeds", async () => {

  Line 1374:     // Verify the binary was downloaded

  Line 1415:       "Failed to download binary: HTTP 404"

  Line 1488:   // Note: ...
gateway · 2026-09-09 03:06:42
result
Found 40 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 137:   fetchLatestFromGitHub,

  Line 139:   fetchLatestNightlyVersion,

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

  Line 205:     const version = await fetchLatestFromGitHub();

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

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

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

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

  Line 285: describe("fetchLatestFromNpm", () => {

  Line 344: // fetchLatestNightlyVersion tests are in the dedicated ...
gateway · 2026-09-09 03:06:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
175:   });
176: 
177:   test("parses case-insensitively", () => {
178:     expect(parseInstallationMethod("NPM")).toBe("npm");
179:     expect(parseInstallationMethod("Curl")).toBe("curl");
180:     expect(parseInstallationMethod("YARN")).toBe("yarn");
181:   });
182: 
183:   test("throws on invalid method", () => {
184:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
185:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
186:     expect(() => parseInstallationMethod("")).toThrow("Invalid method: ");
187:   });
188: });
189: 
190: describe("fetchLatestFromGitHub", () => {
191:   test("returns version from GitHub API", async () => {
192:     mockFetch(
193:       async () =>
194:         new Response(
195:           JSON.stringify({
196:      ...
gateway · 2026-09-09 03:07:03
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
535:       async () =>
536:         new Response(JSON.stringify({ tag_name: "v3.0.0" }), {
537:           status: 200,
538:           headers: { "Content-Type": "application/json" },
539:         })
540:     );
541: 
542:     const version = await fetchLatestVersion("curl");
543:     expect(version).toBe("3.0.0");
544:   });
545: });
546: 
547: describe("versionExists", () => {
548:   test("checks GitHub for curl method - version exists", async () => {
549:     mockFetch(async () => new Response(null, { status: 200 }));
550: 
551:     const exists = await versionExists("curl", "1.0.0");
552:     expect(exists).toBe(true);
553:   });
554: 
555:   test("checks GitHub for curl method - version does not exist", async () => {
556:     mockFetch(async () => new Response(null, { status: 404 }));
557: 
558:     ...
gateway · 2026-09-09 03:07:12
result
Found 28 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

  Line 30:   getBinaryDownloadUrl,

  Line 399: export async function fetchLatestFromGitHub(

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

  Line 467: export async function fetchLatestNightlyVersion(

  Line 503:     return fetchLatestNightlyVersion();

  Line 506:     ? fetchLatestFromGitHub()

  Line 522: async function nightlyVersionExists(version: string): Promise<boolean> {

  Line 551: export async function versionExists(

  Line 557:     return nightlyVersionExists(version);

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

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

  Line 728: async function downloadNightlyToPath(

  Line 761: async function downloadStableToPath(

  Line 766:   const url = ...
gateway · 2026-09-09 03:07:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 03:07:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
380:       });
381:     } catch {
382:       log.debug("Failed to persist install info (DB may be read-only)");
383:     }
384:   }
385: 
386:   return legacyMethod;
387: }
388: 
389: // Version Fetching
390: 
391: /**
392:  * Fetch the latest version from GitHub releases.
393:  *
394:  * @param signal - Optional AbortSignal to cancel the request
395:  * @returns Latest version string (without 'v' prefix)
396:  * @throws {UpgradeError} When fetch fails or response is invalid
397:  * @throws {Error} AbortError if signal is aborted
398:  */
399: export async function fetchLatestFromGitHub(
400:   signal?: AbortSignal
401: ): Promise<string> {
402:   const response = await fetchWithUpgradeError(
403:     `${GITHUB_RELEASES_URL}/latest`,
404:     { headers: getGitHubHeaders(), signal },
405:     "GitHub"
406:   ...
gateway · 2026-09-09 03:07:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
700: 
701: /**
702:  * Build the gzip filename for the current platform binary.
703:  *
704:  * Nightly builds are stored in GHCR as `sentry-<os>-<arch>.gz` (or
705:  * `sentry-windows-x64.exe.gz` on Windows). This filename is the
706:  * `org.opencontainers.image.title` annotation on the matching OCI layer.
707:  *
708:  * @returns Filename of the gzip-compressed binary for this platform
709:  */
710: function getNightlyGzFilename(): string {
711:   return `${getPlatformBinaryName()}.gz`;
712: }
713: 
714: /**
715:  * Download a nightly binary from GHCR and decompress it to `destPath`.
716:  *
717:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
718:  * matching this platform's `.gz` filename, then downloads and decompresses
719:  * the blob in-stream. ...
gateway · 2026-09-09 03:07:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
860:     if (attempt === VERIFY_MAX_ATTEMPTS) {
861:       break;
862:     }
863:     const delay = VERIFY_BASE_DELAY_MS * 2 ** (attempt - 1);
864:     log.debug(
865:       `Downloaded binary not yet visible at ${path}, retrying in ${delay}ms (attempt ${attempt}/${VERIFY_MAX_ATTEMPTS})`
866:     );
867:     await setTimeout(delay);
868:   }
869:   throw new UpgradeError(
870:     "execution_failed",
871:     `Downloaded binary is missing or empty at ${path}. ` +
872:       "This is usually transient — rerun `sentry cli upgrade` to retry."
873:   );
874: }
875: 
876: /**
877:  * Download the new binary to a temporary path and return its location.
878:  * Used by the upgrade command to download before spawning setup --install. ...
gateway · 2026-09-09 03:09:52
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-09 03:10:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:10:16
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
gateway · 2026-09-09 03:10:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-09 03:10:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 03:11:01
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.craft.yml
gateway · 2026-09-09 03:11:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:         - 'vercel'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: vercel
20:     projectId: prj_wVkOnIwI3eIQbGD1Gw7qS1MqFFIK
21:   - name: registry
22:     apps:
23:       'app:sentry':
24:         name: 'Sentry CLI'
25:         packageUrl: 'https://www.npmjs.com/package/sentry'
26:         mainDocsUrl: 'https://cli.sentry.dev'
27:         urlTemplate: ...
gateway · 2026-09-09 03:11:34
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/sentry-release.yml:
  Line 36:       # Tag names are bare semver (e.g., "0.24.0", no "v" prefix),

  Line 57:       # The org/ prefix is how org is specified — it is NOT part of the version.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 600:           SENTRY_CLI_BINARY: ${{ github.workspace }}/dist-bin/sentry-linux-x64

  Line 796:             --url-prefix "~/"
gateway · 2026-09-09 03:11:46
result
Found 39 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 58:   return { tag_name: tag, assets };

  Line 554:   test("returns empty array when no tags match the range", () => {

  Line 555:     const tags = ["patch-0.0.0-dev.90", "patch-0.0.0-dev.95"];

  Line 557:       tags,

  Line 564:   test("returns empty array when tags list is empty", () => {

  Line 569:   test("filters to tags strictly between current and target (inclusive of target)", () => {

  Line 570:     const tags = [

  Line 577:       tags,

  Line 585:   test("excludes tags outside the range", () => {

  Line 586:     const tags = [

  Line 592:       tags,

  Line 599:   test("sorts tags by version in ascending order", () => {

  Line 601:     const tags = [

  Line 607:       tags,

  Line 619:     const tags = ["patch-0.0.0-dev.101"];

  Line 621:       tags,

  Line 629:     const tags = ...
gateway · 2026-09-09 03:12:06
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 5:  * Covers resolveTargetVersion branches (check mode, already up-to-date,

  Line 220:     // GitHub tag check (for versionExists) — this repo uses un-prefixed tags
gateway · 2026-09-09 03:12:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
175:     // GHCR anonymous token exchange
176:     if (urlStr.includes("ghcr.io/token")) {
177:       return new Response(JSON.stringify({ token: "test-token" }), {
178:         status: 200,
179:         headers: { "content-type": "application/json" },
180:       });
181:     }
182: 
183:     // GHCR OCI manifest for :nightly tag
184:     if (urlStr.includes("/manifests/nightly")) {
185:       return new Response(
186:         JSON.stringify({
187:           schemaVersion: 2,
188:           layers: [],
189:           annotations: { version },
190:         }),
191:         {
192:           status: 200,
193:           headers: {
194:             "content-type": "application/vnd.oci.image.manifest.v1+json",
195:           },
196:         }
197:       );
198:     }
199: 
200:     return new ...
gateway · 2026-09-09 03:12:36
result
Found 31 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/binary.test.ts:
  Line 34:   resolveUpgradeSource,

  Line 37:   UPGRADE_SOURCES,

  Line 66: describe("UPGRADE_SOURCES", () => {

  Line 68:     expect(UPGRADE_SOURCES).toEqual([

  Line 83: describe("resolveUpgradeSource", () => {

  Line 87:     const resolved = await resolveUpgradeSource(async (url) => {

  Line 95:       source: UPGRADE_SOURCES[0],

  Line 106:     const resolved = await resolveUpgradeSource(async (url) => {

  Line 116:     expect(resolved.source).toBe(UPGRADE_SOURCES[1]);

  Line 129:         resolveUpgradeSource(async (url) => {

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

  Line 160:       resolveUpgradeSource(async (url) => {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/install-script.test.ts:
  Line 20: import { ...
gateway · 2026-09-09 03:14:19
result
Found 8 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 165: async function resolveTargetWithFallback(opts: {

  Line 285: async function resolveTargetVersion(

  Line 609: async function executeStandardUpgrade(opts: {

  Line 710: async function migrateToStandaloneForNightly(opts: {

  Line 785: async function resolveContext(

  Line 825: function startChangelogFetch(

  Line 846: async function buildCheckResultWithChangelog(opts: {

  Line 863: export const upgradeCommand = buildCommand({
gateway · 2026-09-09 03:14:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
115:   versionArg: string | undefined;
116: } {
117:   // "nightly" and "stable" as positional args select the channel rather than
118:   // installing a specific version. Match case-insensitively for convenience.
119:   const lower = positional?.toLowerCase();
120:   if (lower === "nightly" || lower === "stable") {
121:     return {
122:       channel: lower,
123:       versionArg: undefined,
124:     };
125:   }
126: 
127:   return {
128:     channel: getReleaseChannel(),
129:     versionArg: positional,
130:   };
131: }
132: 
133: /**
134:  * Resolve the target version from the local cache (SQLite) instead of
135:  * fetching from the network. Used by `--offline` and as automatic
136:  * fallback when `fetchLatestVersion()` hits a network error. ...
gateway · 2026-09-09 03:14:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
590:     return currentInstallDir;
591:   }
592: 
593:   // determineInstallDir with the legacy pin removed yields the XDG target.
594:   const { SENTRY_INSTALL_DIR: _pinned, ...envWithoutPin } = process.env;
595:   const xdgInstallDir = determineInstallDir(homedir(), envWithoutPin);
596:   if (
597:     !samePath(xdgInstallDir, legacyBinDir) &&
598:     isInPath(xdgInstallDir, pathEnv)
599:   ) {
600:     return xdgInstallDir;
601:   }
602:   return currentInstallDir;
603: }
604: 
605: /**
606:  * Execute the standard upgrade path: download via curl or package manager,
607:  * then run setup on the new binary. ...
gateway · 2026-09-09 03:16:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 03:16:44
result
Found 11 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 4:  * Extracts user-facing changelog entries from GitHub Release bodies (stable)

  Line 18:   GITHUB_RELEASES_URL,

  Line 340:  * Shared by both the stable (GitHub Releases) and nightly (commit log)

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

  Line 589:  * Fetch changelog for a stable release upgrade.

  Line 602: async function fetchStableChangelog(

  Line 699:   channel: "stable" | "nightly";

  Line 706:   /** Pre-fetched releases to avoid redundant API call (stable channel only) */

  Line 711:  * Fetch changelog for an upgrade, dispatching to stable or nightly.

  Line 716:  * For stable upgrades, accepts optional pre-fetched releases to avoid

  Line 729:     return await fetchStableChangelog(
gateway · 2026-09-09 03:16:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 03:17:07
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 720: export async function fetchChangelog(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 834:   return fetchChangelog({
gateway · 2026-09-09 03:17:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:17:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
260:   if [[ -z "$digest" ]]; then
261:     die "No nightly build found for ${gz_filename}" "ghcr-digest"
262:   fi
263: 
264:   # Step 5: Get the redirect URL from the blob endpoint (don't use -L: auth
265:   # header must NOT be forwarded to the Azure Blob Storage redirect target)
266:   redir_url=$(curl -s -w '\n%{redirect_url}' -o /dev/null \
267:     -H "Authorization: Bearer $GHCR_TOKEN" \
268:     "https://ghcr.io/v2/getsentry/cli/blobs/${digest}" | tail -1)
269:   if [[ -z "$redir_url" ]]; then
270:     die "Failed to get blob redirect URL from GHCR" "ghcr-redirect"
271:   fi
272: 
273:   # Step 6: Download the .gz blob and decompress (without auth header)
274:   curl -sf "$redir_url" | gunzip > "$tmp_binary"
275: 
276: else
277:   # Stable build: resolve version and download from GitHub Releases. ...
gateway · 2026-09-09 03:18:00
result
## feat/toolkit-bridge-upgrade...origin/main
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. ...
gateway · 2026-09-09 03:19:09
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:19:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/ghcr.ts</path>
<type>file</type>
<content>
416: /** Page size for tag listing pagination */
417: const TAGS_PAGE_SIZE = 100;
418: 
419: /**
420:  * Fetch a single page of tags from the GHCR registry.
421:  *
422:  * @param token - Bearer token for authentication
423:  * @param lastTag - Last tag from previous page (for pagination), or undefined for the first page
424:  * @returns Array of tag strings for this page
425:  * @throws {UpgradeError} On network failure
426:  */
427: async function fetchTagPage(
428:   token: string,
429:   lastTag?: string,
430:   signal?: AbortSignal
431: ): Promise<string[]> {
432:   let url = `${GHCR_REGISTRY}/v2/${GHCR_REPO}/tags/list?n=${TAGS_PAGE_SIZE}`;
433:   if (lastTag) {
434:     url += `&last=${encodeURIComponent(lastTag)}`;
435:   }
436: 
437:   const response = await fetchWithRetry(
438:     url,
439:     {
440:   ...
gateway · 2026-09-09 03:19:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:19:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
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 async function resolveNightlyChain(opts: {
279:   token: string;
280:   currentVersion: string;
281:   targetVersion: string;
282:   fullGzSize: number;
283:   preloadedTags?: string[];
284:   signal?: AbortSignal;
285: }): Promise<PatchChain | null> {
286:   const client = new ...
gateway · 2026-09-09 03:20:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, isAbsolute, join, resolve, sep } 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, ...
gateway · 2026-09-09 03:20:47
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/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 03:21:02
result
Found 27 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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,

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

  Line 308:       chainTags.map((tag) => client.fetchManifest(opts.token, tag, opts.signal))


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 476:   const token = await getAnonymousToken();

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

  Line 523:   const token = await getAnonymousToken();

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

  Line 733:   const token = await getAnonymousToken();

  Line ...
gateway · 2026-09-09 03:21:15
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 975:     const url = getBinaryDownloadUrl("1.0.0");


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


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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 234: export function getBinaryDownloadUrl(
gateway · 2026-09-09 03:21:51
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-09 03:22:00
result
Found 13 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

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

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


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

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

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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/ghcr.test.ts:
  Line 17:   GHCR_REPO,

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

  Line 152:       ...
gateway · 2026-09-09 03:22:10
result
Found 29 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 18:   attemptDeltaUpgrade,

  Line 24:   fetchRecentReleases,

  Line 32:   prefetchNightlyPatches,

  Line 33:   prefetchStablePatches,

  Line 36:   resolveStableChain,

  Line 37:   resolveStableDelta,

  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 891: // resolveStableChain (async orchestrator)

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

  Line 947:     const chain = await resolveStableChain("0.13.0", "0.14.0");

  Line 1000:     const chain = await resolveStableChain("0.13.0", "0.15.0");

  Line 1018:     const chain = await resolveStableChain("0.12.0", "0.14.0");

  Line ...
gateway · 2026-09-09 03:22:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts</path>
<type>file</type>
<content>
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:     mockFetch(async (url) => {
827:       expect(String(url)).toContain(
828:         "api.github.com/repos/getsentry/cli/releases"
829:       );
830:       ...
gateway · 2026-09-09 03:23:16
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-09 03:23:30
result
Found 12 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 52:   "scripts": {

  Line 80:     "check:fragments": "pnpm tsx script/check-fragments.ts",

  Line 81:     "check:deps": "pnpm tsx script/check-no-deps.ts",

  Line 82:     "check:errors": "pnpm tsx script/check-error-patterns.ts",

  Line 83:     "check:patches": "pnpm tsx script/check-patches.ts",

  Line 84:     "check:docs-sections": "pnpm tsx script/generate-docs-sections.ts --check",

  Line 85:     "check:env-coverage": "pnpm tsx script/check-env-coverage.ts",

  Line 86:     "check:stale-refs": "pnpm tsx script/check-stale-references.ts"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/init-eval/templates/sveltekit-app/package.json:
  Line 6:   "scripts": ...
gateway · 2026-09-09 03:23:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
45:   "devEngines": {
46:     "runtime": {
47:       "name": "node",
48:       "version": ">=22.15"
49:     }
50:   },
51:   "packageManager": "pnpm@10.11.0",
52:   "scripts": {
53:     "tsx": "tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs",
54:     "cli": "tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs src/bin.ts",
55:     "dev": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && tsx --import ./script/require-shim.mjs src/bin.ts",
56:     "build": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts --single",
57:     "build:all": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts",
58:     "bundle": "pnpm run generate:schema && pnpm ...
gateway · 2026-09-09 03:24:00
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 188:         run: pnpm run check:fragments

  Line 244:       - run: pnpm run check:deps

  Line 245:       - run: pnpm run check:errors

  Line 246:       - run: pnpm run check:patches

  Line 247:       - run: pnpm run check:stale-refs
gateway · 2026-09-09 03:24:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
225:     steps:
226:       - uses: actions/checkout@v6
227:       - uses: pnpm/action-setup@v4
228:       - uses: actions/setup-node@v6
229:         with:
230:           node-version: ${{ env.NODE_VERSION_22 }}
231:       - uses: actions/cache@v5
232:         id: cache
233:         with:
234:           path: |
235:             node_modules
236:             packages/*/node_modules
237:             apps/*/node_modules
238:           key: node-modules-${{ hashFiles('pnpm-lock.yaml', '.npmrc', 'packages/cli/patches/**') }}
239:       - if: steps.cache.outputs.cache-hit != 'true'
240:         run: pnpm install --frozen-lockfile
241:       - run: pnpm run generate:schema
242:       - run: pnpm run lint
243:       - run: pnpm run typecheck
244:       - run: pnpm run check:deps
245:       - run: pnpm run check:errors
246:    ...
gateway · 2026-09-09 03:25:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, sep } 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:   getLegacyInstallDirs,
29:   getPlatformBinaryName,
30:   installBinary,
31:   ...
gateway · 2026-09-09 03:26:25
result
Found 17 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts:
  Line 110:   constructor(message: string, exitCode: number = EXIT.GENERAL) {

  Line 140:   constructor(

  Line 188:   constructor(

  Line 235:   constructor(

  Line 267:   constructor(message: string, suggestion?: string) {

  Line 295:   constructor(data: unknown) {

  Line 413:   constructor(

  Line 484:   constructor(

  Line 561:   constructor(message: string, field?: string) {

  Line 577:   constructor(code: string, description?: string) {

  Line 586: export type UpgradeErrorReason =

  Line 600: export class UpgradeError extends CliError {

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

  Line 635:   constructor(reason: SeerErrorReason, orgSlug?: string) {

  Line 697:   constructor(message: string, hint?: string) {

  Line 720:   constructor(

  Line 741:   constructor() {
gateway · 2026-09-09 03:26:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
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.
596:  *
597:  * @param reason - Type of upgrade failure
598:  * @param message - Custom message (uses default if not provided)
599:  */
600: export class UpgradeError extends CliError {
601:   readonly reason: UpgradeErrorReason;
602: 
603:   constructor(reason: UpgradeErrorReason, message?: string) {
604:     const defaultMessages: Record<UpgradeErrorReason, string> = {
605:       unknown_method:
606:         "Could not detect installation method. Use --method to specify.",
607:    ...
gateway · 2026-09-09 03:27:06
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install
gateway · 2026-09-09 03:27:18
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.lore.md:
  Line 89: * **sentry-cli skill install paths: ~/.claude/ and ~/.agents/ only — OpenCode is never a target**: Skill source-of-truth: \`plugins/sentry-cli/skills/sentry-cli/SKILL.md\` (602 lines) + \`references/\` (28 per-command .md files). \`installAgentSkills()\` in \`src/lib/agent-skills.ts\` installs to \`~/.agents/skills/sentry-cli/\` and \`~/.claude/skills/sentry-cli/\` only — no OpenCode path. OpenCode IS detected via \`OPENCODE\_CLIENT\` env in \`src/lib/detect-agent.ts\` but only for telemetry, not skill installation. \`.opencode/\` and \`opencode.json\*\` are gitignored (lines 72–74). Cursor symlinks live at \`.cursor/skills/sentry-cli/\` pointing into \`plugins/\`. OpenCode scans \`~/.claude/skills/\*\*/SKILL.md\` and \`~/.agents/\*\*/SKILL.md\` — \`.cursor/\` is NOT scanned. ...
gateway · 2026-09-09 03:27:28
result
No files found
gateway · 2026-09-09 03:27:50
result
No files found
gateway · 2026-09-09 03:27:58
result
0e661a5f5 (HEAD -> feat/toolkit-bridge-upgrade, origin/main, origin/HEAD) fix(org): log region URL parse failures in org list (#1539)
9d0901b10 feat(local): Add agent debugging stream (#1538)
72c307f47 fix(cli): log UID resolution failures in sentry cli fix (#1541)
e710ce905 fix(telemetry): log process-tree walk failures in agent detection (#1542)
6e3e7e13a feat(config): follow XDG Base Directory spec for config location (#1503)
17e110300 fix(init): stop recording skipped verification as an error (#1544)
c0c9c8274 fix(docs): Explain regional model unavailability (#1537)
2d2fbffb6 fix(init): gate unsupported --features and tag dry-run runs (#1535)
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
gateway · 2026-09-09 03:28:07
result
Found 36 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/sentry-release.yml:
  Line 90:           gh workflow run sentry-release.yml -f version=${VERSION}


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/cleanup-nightlies.yml:
  Line 30:       - name: Prune old versioned nightly and patch tags

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

  Line 36:           # List all nightly-* tags sorted by version, oldest first

  Line 37:           NIGHTLY_TAGS=$(oras repo tags "${REPO}" 2>/dev/null | grep '^nightly-[0-9]' | sort -V || echo "")

  Line 45:             echo "Only ${NIGHTLY_COUNT} nightly tags found, keeping all (threshold: ${KEEP_COUNT})"

  Line 51:           echo "Pruning ${DELETE_COUNT} old nightly tags (keeping latest ${KEEP_COUNT} of ${NIGHTLY_COUNT})"

  Line 53:           # Delete oldest nightly-* tags and ...
gateway · 2026-09-09 03:28:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:         with:
431:           name: sentry-${{ matrix.target }}-gz
432:           path: packages/cli/dist-bin/*.gz
433: 
434:   generate-patches:
435:     name: Generate Delta Patches
436:     needs: [changes, build-binary]
437:     # Only on main (nightlies) and release branches (stable) — skip PRs
438:     if: github.event_name != 'pull_request'
439:     runs-on: ubuntu-latest
440:     continue-on-error: true
441:     # `from-version`: the previous version the patches were actually generated
442:     # FROM, as computed by the binpatch action. Carried through to
443:     # publish-nightly so it stamps the `from-version` annotation on the
444:     # pushed patch manifest with the SAME value. See
445:     # ...
gateway · 2026-09-09 03:28:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/cleanup-nightlies.yml</path>
<type>file</type>
<content>
1: name: Cleanup Nightly Tags
2: 
3: on:
4:   schedule:
5:     # Every Sunday at 06:00 UTC
6:     - cron: "0 6 * * 0"
7:   workflow_dispatch:
8: 
9: permissions:
10:   packages: write
11: 
12: jobs:
13:   cleanup:
14:     name: Prune Old Nightly Tags
15:     runs-on: ubuntu-latest
16:     steps:
17:       - name: Install ORAS CLI
18:         run: |
19:           VERSION=1.2.3
20:           EXPECTED_SHA256="b4efc97a91f471f323f193ea4b4d63d8ff443ca3aab514151a30751330852827"
21:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"
22:           curl -sfLo "$TARBALL" "https://github.com/oras-project/oras/releases/download/v${VERSION}/${TARBALL}"
23:           echo "${EXPECTED_SHA256}  ${TARBALL}" | sha256sum -c -
24:           tar -xz -C /usr/local/bin oras < "$TARBALL"
25:           rm "$TARBALL"
26: ...
gateway · 2026-09-09 03:28:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 { UPGRADE_SOURCES } from "../../src/lib/binary.js";
11: import {
12:   downloadLayerBlob,
13:   downloadNightlyBlob,
14:   fetchManifest,
15:   fetchNightlyManifest,
16:   findLayerByFilename,
17:   GHCR_REPO,
18:   GHCR_TAG,
19:   getAnonymousToken,
20:   getNightlyVersion,
21:   listTags,
22:   type OciManifest,
23: } from "../../src/lib/ghcr.js";
24: 
25: /** Store original fetch for restoration */
26: let originalFetch: typeof globalThis.fetch;
27: 
28: /** Helper to mock fetch ...
gateway · 2026-09-09 03:28:53
result
Found 50 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 153: function mockFetch(

  Line 192:     mockFetch(

  Line 210:     mockFetch(

  Line 228:     mockFetch(

  Line 246:     mockFetch(

  Line 260:     mockFetch(async () => {

  Line 271:     mockFetch(

  Line 287:     mockFetch(

  Line 305:     mockFetch(

  Line 319:     mockFetch(async () => {

  Line 330:     mockFetch(

  Line 399:     mockFetch(

  Line 412:     mockFetch(

  Line 425:     mockFetch(

  Line 438:     mockFetch(

  Line 451:     mockFetch(

  Line 464:     mockFetch(

  Line 477:     mockFetch(

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

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

  Line 534:     mockFetch(

  Line 549:     mockFetch(async () => new Response(null, { status: 200 }));

  Line 556:     mockFetch(async () => new Response(null, { status: 404 }));

  Line 563:     mockFetch(async ...
gateway · 2026-09-09 03:29:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
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 "../../src/lib/binary.js";
124: import {
125:   clearInstallInfo,
126:   setInstallInfo,
127: } from "../../src/lib/db/install-info.js";
128: import { UpgradeError } from "../../src/lib/errors.js";
129: import { isProcessRunning } from "../../src/lib/process-utils.js";
130: 
131: const {
132:   buildKnownCurlPaths,
133:   detectInstallationMethod,
134:   ...
gateway · 2026-09-09 03:30:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 = ...
gateway · 2026-09-09 03:30:50
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/pnpm-lock.yaml:
  Line 1548:   '@sentry/cli@2.58.6':

  Line 4207:   trpc-cli@0.12.4:

  Line 6000:   '@sentry/cli@2.58.6':

  Line 9255:   trpc-cli@0.12.4(@trpc/server@11.18.0(typescript@5.9.3))(valibot@1.4.2(typescript@5.9.3))(zod@4.4.3):


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CHANGELOG.md:
  Line 272: - Pre-shape repo into pnpm-workspace monorepo layout by @BYK in [#1254](https://github.com/getsentry/cli/pull/1254)

  Line 327: - Filter set-commits by path for monorepos (CLI-339) by @betegon in [#1159](https://github.com/getsentry/cli/pull/1159)

  Line 647: - Add --app flag and actionable errors for non-interactive monorepo runs by @betegon in [#977](https://github.com/getsentry/cli/pull/977)

  Line 1580: - Make code scanner monorepo-aware and extend --fresh to bypass ...
gateway · 2026-09-09 03:31:00
result
changelogPolicy: none
preReleaseCommand: bash bin/bump-version.sh
targets:
  - name: github
  - name: npm
    id: "@sentry/mcp-server"
    includeNames: /^sentry-mcp-server-\d.*\.tgz$/
gateway · 2026-09-09 03:31:26
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 03:31:38
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 426: export async function fetchWithUpgradeError(
gateway · 2026-09-09 03:31:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
405: /**
406:  * Build headers for GitHub API requests.
407:  */
408: export function getGitHubHeaders(): Record<string, string> {
409:   return {
410:     Accept: "application/vnd.github.v3+json",
411:     "User-Agent": getUserAgent(),
412:   };
413: }
414: 
415: /**
416:  * Fetch wrapper that converts network errors to UpgradeError.
417:  * Handles DNS failures, timeouts, and other connection issues.
418:  *
419:  * @param url - URL to fetch
420:  * @param init - Fetch options
421:  * @param serviceName - Service name for error messages (e.g., "GitHub")
422:  * @returns Response object
423:  * @throws {UpgradeError} On network failure
424:  * @throws {Error} AbortError if signal is aborted (re-thrown as-is)
425:  */
426: export async function fetchWithUpgradeError(
427:   url: string,
428:   init: ...
gateway · 2026-09-09 03:32:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
360:     return "brew";
361:   }
362: 
363:   // Check stored info (fast path for non-Homebrew installs)
364:   const stored = getInstallInfo();
365:   if (stored?.method) {
366:     return stored.method;
367:   }
368: 
369:   // Legacy detection for existing installs (pre-setup command)
370:   const legacyMethod = await detectLegacyInstallationMethod();
371: 
372:   // Auto-save detected method for future runs (best-effort —
373:   // a read-only or broken DB shouldn't block detection)
374:   if (legacyMethod !== "unknown") {
375:     try {
376:       setInstallInfo({
377:         method: legacyMethod,
378:         path: process.execPath,
379:         version: CLI_VERSION,
380:       });
381:     } catch {
382:       log.debug("Failed to persist install info (DB may be read-only)");
383:     }
384:   }
385: ...
gateway · 2026-09-09 03:32:30
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
875: 
876: /**
877:  * Download the new binary to a temporary path and return its location.
878:  * Used by the upgrade command to download before spawning setup --install.
879:  *
880:  * For **nightly** versions (detected via {@link isNightlyVersion}), downloads
881:  * from GHCR using the OCI blob download protocol via {@link downloadNightlyToPath}.
882:  *
883:  * For **stable** versions, downloads from GitHub Releases via
884:  * {@link downloadStableToPath}.
885:  *
886:  * The lock is held on success so concurrent upgrades are blocked during the
887:  * download→spawn→install pipeline. The caller MUST release the lock after the
888:  * child process exits (the child may use a different install directory and
889:  * therefore a different lock file, so it cannot reliably release this one). ...
gateway · 2026-09-09 03:33:19
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Sequence\n\nImport the pre-shaped CLI into **`getsentry/sentry-mcp` under its current repository name**. Validate the complete monorepo and production deployment paths there. Rename the repository to `getsentry/toolkit` only after those gates pass.\n\nThis preserves history and lets GitHub, Vercel, Cloudflare, branch protections, and repository integrations continue operating under the known repository identity throughout integration.\n\n## Hard prerequisites\n\n- [x] CLI pre-shape merged: getsentry/cli#1254.\n- [ ] Bridge CLI release completed and verified: getsentry/cli#1244.\n- [ ] Create a dedicated integration branch from current `getsentry/sentry-mcp` `main`. Do not import directly into `main`.\n\n## History-preserving import\n\n- [ ] From the bridge-release commit on `getsentry/cli`, produce two immutable `git filter-repo` refs:\n  - `import/cli` — history containing only `packages/cli/**`\n  - ...
gateway · 2026-09-09 03:33:32
result
{"body":"## Summary\n\nThe salvageable, non-controversial core of #844 — prefix-aware version-detection read paths — plus the two review fixes it accumulated. #844 itself is **parked** in favor of a broader, target-agnostic **workspaces** redesign (tracked in #842); this PR lands the parts that are correct regardless of that redesign so they aren't lost.\n\nLets a single repo host independently-versioned products (e.g. `cli@1.2.3`, `mcp@2.0.0`) without cross-contaminating each other's latest-tag detection, changelog base, or CalVer scans. Builds on the existing `tagPrefix` write-side support (no new version library — uses craft's home-grown SemVer utils).\n\n## Changes\n\n- **`getLatestTag(git, tagPrefix='')`** scopes `git describe` via `--match '<prefix>*'`; threaded through the `prepare` and `changelog` read paths. Backward compatible (empty prefix → previous behavior).\n- **`getGitTagPrefix()`** warns when multiple `github` targets declare differing `tagPrefix` values (ambiguous) ...
gateway · 2026-09-09 03:33:51
result
gh: Not Found (HTTP 404)
gateway · 2026-09-09 03:35:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 03:36:26
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/binary.test.ts:
  Line 72:         tagPrefix: "cli@",

  Line 77:         tagPrefix: "",


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 112:   readonly tagPrefix: string;

  Line 120:     tagPrefix: "cli@",

  Line 125:     tagPrefix: "",

  Line 238:   const tag = `${source.tagPrefix}${version}`;


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 123:   return githubReleaseSource({
gateway · 2026-09-09 03:36:33
result
No files found
gateway · 2026-09-09 03:36:46
result
No files found
gateway · 2026-09-09 03:36:58
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 111:     "binpatch": "^0.4.2",
gateway · 2026-09-09 03:38:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
260:   try {
261:     if (!shouldCheckForUpdate()) {
262:       return;
263:     }
264:   } catch (error) {
265:     // DB access failed - report to Sentry but don't crash CLI
266:     Sentry.captureException(error);
267:     return;
268:   }
269: 
270:   pendingAbortController = new AbortController();
271:   const { signal } = pendingAbortController;
272: 
273:   const channel = getReleaseChannel();
274: 
275:   Sentry.startSpanManual(
276:     {
277:       name: "version-check",
278:       op: "version.check",
279:       forceTransaction: true,
280:     },
281:     async (span) => {
282:       try {
283:         // Use GHCR for nightly channel; GitHub Releases for stable.
284:         const latestVersion =
285:           channel === "nightly"
286:             ? ...
gateway · 2026-09-09 03:38:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
210: }
211: 
212: /**
213:  * Abort any pending version check to allow process exit.
214:  * Call this when main CLI work is complete.
215:  */
216: export function abortPendingVersionCheck(): void {
217:   pendingAbortController?.abort();
218:   pendingAbortController = null;
219: }
220: 
221: /**
222:  * Pre-fetch delta patches for a newly discovered version.
223:  *
224:  * Best-effort: errors are silently caught so the version check still succeeds.
225:  * After pre-fetching, opportunistically cleans up stale cached patches.
226:  */
227: async function maybePrefetchPatches(
228:   channel: "stable" | "nightly",
229:   latestVersion: string,
230:   signal: AbortSignal
231: ): Promise<void> {
232:   if (semverCompare(latestVersion, CLI_VERSION) !== 1) {
233:     return;
234:   }
235:   try {
236:     ...
gateway · 2026-09-09 03:38:48
result
## feat/toolkit-bridge-upgrade...origin/main
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
gateway · 2026-09-09 03:40:20
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json:
  Line 14:     "strict": true,

  Line 17:     "noUncheckedIndexedAccess": true,

  Line 24:     "strictNullChecks": true


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/init-eval/templates/sveltekit-app/tsconfig.json:
  Line 12: 		"strict": true,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/init-eval/templates/react-vite-app/tsconfig.json:
  Line 13:     "strict": true,


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/init-eval/templates/nextjs-app/tsconfig.json:
  Line 7:     "strict": ...
gateway · 2026-09-09 03:40:27
result
src/lib/binary.ts(236,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
src/lib/binary.ts(244,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
gateway · 2026-09-09 03:41:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json</path>
<type>file</type>
<content>
1: {
2:   "compilerOptions": {
3:     "lib": ["ESNext"],
4:     "target": "ESNext",
5:     "module": "ESNext",
6:     "jsx": "react-jsx",
7:     "moduleDetection": "force",
8:     "allowJs": true,
9:     "moduleResolution": "bundler",
10:     "allowImportingTsExtensions": true,
11:     "verbatimModuleSyntax": true,
12:     "noEmit": true,
13:     "resolveJsonModule": true,
14:     "strict": true,
15:     "skipLibCheck": true,
16:     "noFallthroughCasesInSwitch": true,
17:     "noUncheckedIndexedAccess": true,
18:     "noImplicitOverride": true,
19:     "esModuleInterop": true,
20:     "forceConsistentCasingInFileNames": true,
21:     "noUnusedLocals": false,
22:     "noUnusedParameters": false,
23:     "noPropertyAccessFromIndexSignature": false,
24:     "strictNullChecks": true
25:   },
26:   "include": ...
gateway · 2026-09-09 03:42:41
result
 DEPRECATED  `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. Please, refer to the migration guide: https://vitest.dev/guide/migration#pool-rework

 RUN  v4.1.10 /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli

 ❯ test/lib/install-script.test.ts (2 tests | 1 failed) 91ms
     × embeds the shared ordered upgrade source list 21ms
 ❯ test/lib/ghcr.test.ts (37 tests | 2 failed) 168ms
     × uses the selected source's GHCR repository 26ms
     × uses the selected source's GHCR repository 5ms
 ❯ test/lib/binary.test.ts (71 tests | 1 failed) 217ms
     × builds correct URL for current platform 26ms

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  test/lib/binary.test.ts > getBinaryDownloadUrl > builds correct URL for current platform
AssertionError: expected 'https://github.com/getsentry/toolkit/…' to contain '/1.0.0/'

Expected: "/1.0.0/"
Received: ...
gateway · 2026-09-09 03:43:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-09 03:43:26
result
File not found: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CONTRIBUTING.md
gateway · 2026-09-09 03:43:57
result
No files found
gateway · 2026-09-09 03:44:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 03:44:40
result
No files found
gateway · 2026-09-09 03:45:11
result
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. ...
gateway · 2026-09-09 03:45:54
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-09 03:46:18
result
Found 40 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 21:   prefetchNightlyPatches,

  Line 22:   prefetchStablePatches,

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

  Line 237:       await prefetchNightlyPatches(latestVersion, signal);

  Line 239:       await prefetchStablePatches(latestVersion, signal);

  Line 286:             ? await fetchLatestNightlyVersion(signal)

  Line 287:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

  Line 30:   getBinaryDownloadUrl,

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

  Line 399: export async function fetchLatestFromGitHub(

  Line 403:     ...
gateway · 2026-09-09 03:46:30
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 03:46:37
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 720: export async function fetchChangelog(


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 834:   return fetchChangelog({
gateway · 2026-09-09 03:46:51
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
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.
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 03:46:59
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 250: export const GITHUB_RELEASES_URL = getGitHubReleasesUrl();


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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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` package.

  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 = ...
gateway · 2026-09-09 03:47:19
result
.craft.yml
.dockerignore
.github
.github/workflows
.github/workflows/build.yml
.github/workflows/changelog-preview.yml
.github/workflows/docs-preview.yml
.github/workflows/enforce-license-compliance.yml
.github/workflows/image.yml
.github/workflows/lint.yml
.github/workflows/release.yml
.gitignore
.lore.md
.nojekyll
.npmignore
.prettierignore
.prettierrc.yml
.vscode
.vscode/extensions.json
.vscode/settings.json
AGENTS.md
CHANGELOG.md
CONTRIBUTING.md
Dockerfile
LICENSE
README.md
action.yml
blog-post-draft.md
build.mjs
docs
docs/astro.config.mjs
docs/package.json
docs/pnpm-lock.yaml
docs/public
docs/public/CNAME
docs/public/favicon.svg
docs/src
docs/src/assets
docs/src/assets/logo.svg
docs/src/content.config.ts
docs/src/content
docs/src/content/docs
docs/src/content/docs/configuration.md
docs/src/content/docs/contributing.md
docs/src/content/docs/getting-started.md
docs/src/content/docs/github-actions.md
docs/src/content/docs/index.mdx
docs/src/content/docs/targets
docs/src/content/docs/...
gateway · 2026-09-09 03:47:26
result
---
title: Configuration
description: Complete reference for .craft.yml configuration
---

Project configuration for Craft is stored in `.craft.yml` in the project root.

## GitHub Project

Craft tries to determine GitHub repo information from the local git repo. You can also hard-code it:

```yaml
github:
  owner: getsentry
  repo: sentry-javascript
```

## Pre-release Command

This command runs on your release branch as part of `craft prepare`. Default: `bash scripts/bump-version.sh`.

```yaml
preReleaseCommand: bash scripts/bump-version.sh
```

The command is executed with the following environment variables:

- `CRAFT_OLD_VERSION`: The previous version (or `0.0.0` if no previous version exists)
- `CRAFT_NEW_VERSION`: The new version being released

The script should:

- Use these environment variables to perform version replacement
- Replace version occurrences
- Not commit changes
- Not change git state

> **Note:** For backward compatibility, the old and new versions are also ...
gateway · 2026-09-09 03:47:37
result
---
title: GitHub
description: Create GitHub releases and tags
---

Creates a release on GitHub. If a Markdown changelog is present, this target reads the release name and description from it.

## Configuration

| Option | Description |
|--------|-------------|
| `tagPrefix` | Prefix for new git tags (e.g., `v`). Empty by default. |
| `previewReleases` | Automatically detect and create preview releases. Default: `true` |
| `tagOnly` | Only create a tag (without a GitHub release). Default: `false` |
| `floatingTags` | List of floating tags to create/update. Supports `{major}`, `{minor}`, `{patch}` placeholders. |

## Environment Variables

| Name | Description |
|------|-------------|
| `GITHUB_TOKEN` | Personal GitHub API token ([create one](https://github.com/settings/tokens)) |

## Example

```yaml
targets:
  - name: github
    tagPrefix: v
    previewReleases: true
```

## Floating Tags

Use `floatingTags` to maintain "latest major version" tags that always point to the most recent ...
gateway · 2026-09-09 03:49:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
80: /**
81:  * Absolute legacy install directories for the given home. See
82:  * {@link LEGACY_INSTALL_SUBDIRS} for why this is scoped to pre-XDG locations.
83:  */
84: export function getLegacyInstallDirs(homeDir: string): string[] {
85:   return LEGACY_INSTALL_SUBDIRS.map((dir) => join(homeDir, dir));
86: }
87: 
88: /**
89:  * How the CLI was installed. Determines the upgrade strategy.
90:  *
91:  * Defined here (alongside other installation constants like
92:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
93:  * `db/install-info.ts` can import it without creating a circular
94:  * dependency. ...
gateway · 2026-09-09 03:49:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:51:35
result
Found 31 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 10:  * - nightly: tracks the rolling nightly prerelease built from main

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

  Line 65: const CHANNEL_VERSIONS = new Set(["nightly", "stable"]);

  Line 82:   channel: "stable" | "nightly";

  Line 107:  * parameter. "nightly" and "stable" are treated as channel selectors, not

  Line 117:   // "nightly" and "stable" as positional args select the channel rather than

  Line 120:   if (lower === "nightly" || lower === "stable") {

  Line 165: async function resolveTargetWithFallback(opts: {

  Line 233: function validateMethod(

  Line 322:   // nightly channel regardless of the current install method.

  Line 324:     const lookupMethod = channel === "nightly" ? ...
gateway · 2026-09-09 03:51:56
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
600:     return xdgInstallDir;
601:   }
602:   return currentInstallDir;
603: }
604: 
605: /**
606:  * Execute the standard upgrade path: download via curl or package manager,
607:  * then run setup on the new binary.
608:  */
609: async function executeStandardUpgrade(opts: {
610:   method: InstallationMethod;
611:   channel: ReleaseChannel;
612:   versionArg: string | undefined;
613:   target: string;
614:   execPath: string;
615:   entryPath?: string;
616:   pathEnv?: string;
617:   offline?: OfflineMode;
618:   json?: boolean;
619:   noAgentSkills: boolean;
620: }): Promise<void> {
621:   const {
622:     method,
623:     channel,
624:     versionArg,
625:     target,
626:     execPath,
627:     entryPath,
628:     pathEnv,
629:     offline,
630:     json,
631:     noAgentSkills,
632:   } = ...
gateway · 2026-09-09 03:52:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
920:         default: false,
921:       },
922:       method: {
923:         kind: "parsed",
924:         parse: parseInstallationMethod,
925:         brief: "Installation method to use (curl, brew, npm, pnpm, bun, yarn)",
926:         optional: true,
927:         placeholder: "method",
928:       },
929:     },
930:   },
931:   async *func(this: SentryContext, flags: UpgradeFlags, version?: string) {
932:     const { channel, versionArg, channelChanged, method } =
933:       await resolveContext(version, flags);
934: 
935:     log.debug(`Installation method: ${method}`);
936:     log.debug(`Current version: ${CLI_VERSION}`);
937: 
938:     const resolved = await withProgress(
939:       { message: "Checking for updates...", json: flags.json },
940:       async () =>
941:         ...
gateway · 2026-09-09 03:52:31
result
Found 87 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 286:             ? await fetchLatestNightlyVersion(signal)

  Line 287:             : await fetchLatestFromGitHub(signal);


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

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

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

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

  Line 279:     await ...
gateway · 2026-09-09 03:52:54
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install:
  Line 280:     version=$(curl -fsSL https://api.github.com/repos/getsentry/cli/releases/latest \

  Line 283:       die "Failed to fetch latest version" "gh-version"

  Line 292:   url="https://github.com/getsentry/cli/releases/download/${version}/${filename}"
gateway · 2026-09-09 03:53:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
235:   if [[ -z "$MANIFEST" ]]; then
236:     die "Failed to fetch nightly manifest from GHCR" "ghcr-manifest"
237:   fi
238: 
239:   # Step 3: Extract version from manifest annotation
240:   version=$(echo "$MANIFEST" \
241:     | awk -F'"' '{for(i=1;i<=NF;i++) if($i=="version"){print $(i+2);exit}}')
242:   if [[ -z "$version" ]]; then
243:     die "Failed to extract version from nightly manifest" "ghcr-version"
244:   fi
245: 
246:   echo -e "${MUTED}Installing nightly sentry ${version}...${NC}"
247: 
248:   # Step 4: Find the blob digest for this platform's .gz file.
249:   # Each OCI layer has "digest" before "org.opencontainers.image.title".
250:   # Track the last-seen digest and print it when the target filename matches.
251:   # This avoids sed newline replacement which differs between GNU and BSD. ...
gateway · 2026-09-09 03:53:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
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; then
182:         if [ "$(id -u)" = "0" ]; then
183:           echo -e "${MUTED}Installing required C++ runtime libraries...${NC}"
184:           apk add --no-cache libstdc++ libgcc >/dev/null 2>&1 \
185:             || die "Failed to install libstdc++ and libgcc (required for musl binary)" "deps"
186:         else
187:           echo -e "${RED}Missing required libraries: libstdc++ libgcc${NC}" >&2
188:           echo -e "${RED}Run: apk ...
gateway · 2026-09-09 03:53:31
<!-- lore-recall:fa83d14f-791c-4ea9-9e28-9ad5fd1cb028 --><!-- lore-recall:4d93a094-eb84-45e0-9530-7f32bf872910 -->
gpt-5.6-sol · 2026-09-09 03:53:31 · ~58 tokens
result
Found 34 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 18:   attemptDeltaUpgrade,

  Line 32:   prefetchNightlyPatches,

  Line 33:   prefetchStablePatches,

  Line 34:   resolveNightlyChain,

  Line 36:   resolveStableChain,

  Line 891: // resolveStableChain (async orchestrator)

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

  Line 947:     const chain = await resolveStableChain("0.13.0", "0.14.0");

  Line 1000:     const chain = await resolveStableChain("0.13.0", "0.15.0");

  Line 1018:     const chain = await resolveStableChain("0.12.0", "0.14.0");

  Line 1025:     const chain = await resolveStableChain("0.12.0", "0.13.0");

  Line 1050:     const chain = await resolveStableChain("0.13.0", "0.14.0");

  Line 1073:     const chain = await resolveStableChain("0.1.0", "0.15.0");

  Line 1078: // resolveNightlyChain (async orchestrator)

  Line 1080: ...
gateway · 2026-09-09 03:53:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:53:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
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 async function resolveNightlyChain(opts: {
279:   token: string;
280:   currentVersion: string;
281:   targetVersion: string;
282:   fullGzSize: number;
283:   preloadedTags?: string[];
284:   signal?: AbortSignal;
285: }): Promise<PatchChain | null> {
286:   const client = new ...
gateway · 2026-09-09 03:55:52
result
403
gateway · 2026-09-09 03:56:08
result
404
404
gateway · 2026-09-09 03:56:22
<!-- lore-recall:ad59846a-eeb2-4cb0-bbd0-4a50970983d3 --><!-- lore-recall:65c13604-98a3-4856-88a9-a73061800a4b --><!-- lore-recall:dfde1145-cf72-492c-b266-4f7d4330f3a1 -->
gpt-5.6-sol · 2026-09-09 03:56:22 · ~86 tokens
result
(no output)
gateway · 2026-09-09 04:00:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
1090:           )
1091:         );
1092:       }
1093:     });
1094: 
1095:     proc.on("error", (err) => {
1096:       reject(
1097:         new UpgradeError("execution_failed", `${pm} failed: ${err.message}`)
1098:       );
1099:     });
1100:   });
1101: }
1102: 
1103: /**
1104:  * Execute the upgrade using the appropriate method.
1105:  *
1106:  * For curl installs, downloads the new binary to a temp path and returns a
1107:  * DownloadResult with the binary path and lock path. The caller should spawn
1108:  * `setup --install` on the new binary, then release the lock.
1109:  *
1110:  * For package manager installs, runs the package manager's global install
1111:  * command (which replaces the binary in-place). The caller should then
1112:  * spawn `setup` on the new binary for completions/agent skills. ...
gateway · 2026-09-09 04:01:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 04:01:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.45.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:02:04
result
{
  "name": "binpatch",
  "version": "0.4.2",
  "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-09 04:02:11
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 `fs.openSync` + `fs.writeSync`
 *   with the fd `closeSync`'d before the function returns, so the caller
 *   can `spawn` the output file without racing ETXTBSY on Linux. ...
gateway · 2026-09-09 04:04:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
90:   warnings?: string[];
91:   /** Changelog summary for the version range. Absent for offline or on fetch failure. */
92:   changelog?: ChangelogSummary;
93: };
94: 
95: type UpgradeFlags = {
96:   readonly check: boolean;
97:   readonly force: boolean;
98:   readonly offline: boolean;
99:   readonly "no-agent-skills": boolean;
100:   readonly method?: InstallationMethod;
101:   /** Injected by buildCommand output wrapper — suppresses spinners */
102:   readonly json?: boolean;
103: };
104: 
105: /**
106:  * Resolve effective channel and version arg from the positional `version`
107:  * parameter. "nightly" and "stable" are treated as channel selectors, not
108:  * literal version strings. ...
gateway · 2026-09-09 04:04:45
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/package.json
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/codemods/sentry-v3-to-v4/package.json
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/package.json
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.craft.yml
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/init-eval/templates/sveltekit-app/package.json
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6...
gateway · 2026-09-09 04:05:00
result
No files found
gateway · 2026-09-09 04:05:14
result
No files found
gateway · 2026-09-09 04:05:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github</path>
<type>directory</type>
<entries>
assets/
workflows/

(2 entries)
</entries>
gateway · 2026-09-09 04:05:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows</path>
<type>directory</type>
<entries>
ci.yml
cleanup-nightlies.yml
eval-skill-fork.yml
pr-risk.yml
publish-codemod.yml
release.yml
sentry-release.yml

(7 entries)
</entries>
gateway · 2026-09-09 04:06:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:         - 'vercel'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: vercel
20:     projectId: prj_wVkOnIwI3eIQbGD1Gw7qS1MqFFIK
21:   - name: registry
22:     apps:
23:       'app:sentry':
24:         name: 'Sentry CLI'
25:         packageUrl: 'https://www.npmjs.com/package/sentry'
26:         mainDocsUrl: 'https://cli.sentry.dev'
27:         urlTemplate: ...
gateway · 2026-09-09 04:06:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/release.yml</path>
<type>file</type>
<content>
1: name: Release
2: on:
3:   workflow_dispatch:
4:     inputs:
5:       version:
6:         description: Version to release (or "auto")
7:         required: false
8:       force:
9:         description: Force a release even when there are release-blockers
10:         required: false
11:       merge_target:
12:         description: Target branch to merge into
13:         required: false
14: permissions:
15:   contents: write
16:   pull-requests: write
17: 
18: env:
19:   # Pin Node to an exact patched version (single source of truth). A floating
20:   # "22" can reuse the runner's pre-cached 22.23.0, which carries the
21:   # ERR_STREAM_PREMATURE_CLOSE regression on keep-alive fetch reuse
22:   # (nodejs/node#64004, fixed in 22.23.1).
23:   NODE_VERSION_22: "22.23.1"
24: 
25: jobs:
26:   release:
27:     runs-on: ...
gateway · 2026-09-09 04:06:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:         with:
431:           name: sentry-${{ matrix.target }}-gz
432:           path: packages/cli/dist-bin/*.gz
433: 
434:   generate-patches:
435:     name: Generate Delta Patches
436:     needs: [changes, build-binary]
437:     # Only on main (nightlies) and release branches (stable) — skip PRs
438:     if: github.event_name != 'pull_request'
439:     runs-on: ubuntu-latest
440:     continue-on-error: true
441:     # `from-version`: the previous version the patches were actually generated
442:     # FROM, as computed by the binpatch action. Carried through to
443:     # publish-nightly so it stamps the `from-version` annotation on the
444:     # pushed patch manifest with the SAME value. See
445:     # ...
gateway · 2026-09-09 04:06:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
1: name: Build
2: 
3: on:
4:   push:
5:     branches: [main, release/**]
6:   pull_request:
7:   workflow_call:
8: 
9: concurrency:
10:   group: ci-${{ github.ref }}
11:   cancel-in-progress: true
12: 
13: # packages:write is needed for publish-nightly to push to GHCR
14: # issues:write is needed for generate-patches to file issues on failure
15: permissions:
16:   contents: read
17:   issues: write
18:   packages: write
19: 
20: env:
21:   # Commit timestamp used for deterministic nightly version strings.
22:   # Defined at workflow level so build-binary and publish-nightly always agree.
23:   COMMIT_TIMESTAMP: ${{ github.event.head_commit.timestamp }}
24:   # SENTRY_CLIENT_ID is baked into the binary at build time. Fork PRs can't
25:   # read repo vars (getsentry org policy); fall back to a dummy. ...
gateway · 2026-09-09 04:07:08
result
Found 20 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 182:         run: pnpm install --frozen-lockfile

  Line 188:         run: pnpm run check:fragments

  Line 220:   lint:

  Line 240:         run: pnpm install --frozen-lockfile

  Line 242:       - run: pnpm run lint

  Line 244:       - run: pnpm run check:deps

  Line 245:       - run: pnpm run check:errors

  Line 246:       - run: pnpm run check:patches

  Line 247:       - run: pnpm run check:stale-refs

  Line 274:         run: pnpm install --frozen-lockfile

  Line 278:         run: pnpm run test:unit

  Line 288:     needs: [changes, lint, test-unit]

  Line 314:         run: pnpm install --frozen-lockfile

  Line 588:         run: pnpm install --frozen-lockfile

  Line 636:         run: pnpm install --frozen-lockfile

  Line 647:     needs: [lint, test-unit]

  Line 674:         run: pnpm install --frozen-lockfile

  Line ...
gateway · 2026-09-09 04:07:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
145:         run: npx codemod@1.12.7 jssg test -l typescript ./scripts/codemod.ts
146: 
147:   check-generated:
148:     name: Validate generated files
149:     needs: [changes]
150:     if: needs.changes.outputs.skill == 'true'
151:     runs-on: ubuntu-latest
152:     steps:
153:       - name: Get auth token
154:         id: token
155:         # Fork PRs don't have access to secrets, so this step is skipped
156:         if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
157:         uses: actions/create-github-app-token@v3
158:         with:
159:           app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
160:           private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
161:       - uses: actions/checkout@v6
162:         with:
163:           token: ...
gateway · 2026-09-09 04:07:33
result
Found 30 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 137:   fetchLatestFromGitHub,

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

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

  Line 196:             tag_name: "v1.2.3",

  Line 205:     const version = await fetchLatestFromGitHub();

  Line 214:             tag_name: "v0.5.0",

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 232:             tag_name: "1.0.0",

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

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

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

  Line 265:     await ...
gateway · 2026-09-09 04:07:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
175:   });
176: 
177:   test("parses case-insensitively", () => {
178:     expect(parseInstallationMethod("NPM")).toBe("npm");
179:     expect(parseInstallationMethod("Curl")).toBe("curl");
180:     expect(parseInstallationMethod("YARN")).toBe("yarn");
181:   });
182: 
183:   test("throws on invalid method", () => {
184:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
185:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
186:     expect(() => parseInstallationMethod("")).toThrow("Invalid method: ");
187:   });
188: });
189: 
190: describe("fetchLatestFromGitHub", () => {
191:   test("returns version from GitHub API", async () => {
192:     mockFetch(
193:       async () =>
194:         new Response(
195:           JSON.stringify({
196:      ...
gateway · 2026-09-09 04:08:11
result
Found 32 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CHANGELOG.md:
  Line 1665: - (install) Add Sentry error telemetry to install script by @BYK in [#334](https://github.com/getsentry/cli/pull/334)

  Line 2168: - (install) Add install script served from docs site by @betegon in [#95](https://github.com/getsentry/cli/pull/95)

  Line 2169: - Add install script for easy CLI installation by @betegon in [#97](https://github.com/getsentry/cli/pull/97)

  Line 2197: - Add install script section to getting started guide by @betegon in [#98](https://github.com/getsentry/cli/pull/98)


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/fragments/configuration.md:
  Line 117: When installed via the install script, the CLI binary is placed in an XDG-aligned directory. `sentry cli setup` resolves the location in this ...
gateway · 2026-09-09 04:08:28
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install
gateway · 2026-09-09 04:08:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public</path>
<type>directory</type>
<entries>
.well-known/
CNAME
favicon.png
favicon.svg
glyph.svg
install
og-image-twitter.png
og-image.png
wordmark-light.svg
wordmark.svg

(10 entries)
</entries>
gateway · 2026-09-09 04:08:47
result
'apps/cli-docs/public/install' -> '../../../packages/cli/install'
'packages/cli/install'
gateway · 2026-09-09 04:09:00
<!-- lore-recall:d8873998-38f4-4a95-9a47-061e80cf77a6 --><!-- lore-recall:8f3cc6a3-dd78-431e-bcae-26e1c4796927 -->
gpt-5.6-sol · 2026-09-09 04:09:00 · ~57 tokens
result
Found 15 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/ghcr.test.ts:
  Line 17:   GHCR_REPO,

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

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

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

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

  Line 569:         expect(String(url)).toContain(`/v2/${GHCR_REPO}/blobs/sha256:abc123`);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-09 04:09:16
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 426: export async function fetchWithUpgradeError(
gateway · 2026-09-09 04:09:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
400: 
401:   // 5. XDG-aligned fallback — setup will handle adding this to PATH
402:   return join(homeDir, ".local", "bin");
403: }
404: 
405: /**
406:  * Build headers for GitHub API requests.
407:  */
408: export function getGitHubHeaders(): Record<string, string> {
409:   return {
410:     Accept: "application/vnd.github.v3+json",
411:     "User-Agent": getUserAgent(),
412:   };
413: }
414: 
415: /**
416:  * Fetch wrapper that converts network errors to UpgradeError.
417:  * Handles DNS failures, timeouts, and other connection issues.
418:  *
419:  * @param url - URL to fetch
420:  * @param init - Fetch options
421:  * @param serviceName - Service name for error messages (e.g., "GitHub")
422:  * @returns Response object
423:  * @throws {UpgradeError} On network failure
424:  * @throws {Error} AbortError if ...
gateway · 2026-09-09 04:09:43
result
Found 24 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 120:   getBinaryDownloadUrl,

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

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


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

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

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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 18:   attemptDeltaUpgrade,

  Line 24:   fetchRecentReleases,

  Line 817: // fetchRecentReleases

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

  Line 834:     const ...
gateway · 2026-09-09 04:09:51
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
945:       "node_modules",
946:       "sentry",
947:       "dist",
948:       "bin.cjs"
949:     );
950: 
951:     const method = await detectInstallationMethod();
952:     expect(method).toBe("yarn");
953:   });
954: 
955:   test("Homebrew still takes priority over node_modules path", async () => {
956:     process.argv[1] = join(
957:       "/usr/local/lib",
958:       "node_modules",
959:       "sentry",
960:       "dist",
961:       "bin.cjs"
962:     );
963:     Object.defineProperty(process, "execPath", {
964:       value: "/opt/homebrew/Cellar/sentry/1.2.3/bin/sentry",
965:       configurable: true,
966:     });
967: 
968:     const method = await detectInstallationMethod();
969:     expect(method).toBe("brew");
970:   });
971: });
972: 
973: describe("getBinaryDownloadUrl", () => {
974:   ...
gateway · 2026-09-09 04:10:20
result
Found 13 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 88: export const VERSION_PREFIX_REGEX = /^v/;

  Line 415:   const data = (await response.json()) as { tag_name?: string };

  Line 417:   if (!data.tag_name) {

  Line 424:   return data.tag_name.replace(VERSION_PREFIX_REGEX, "");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 112:   readonly tagPrefix: string;

  Line 120:     tagPrefix: "cli@",

  Line 125:     tagPrefix: "",

  Line 238:   const tag = `${source.tagPrefix}${version}`;

  Line 315: export function compareVersions(a: string, b: string): -1 | 0 | 1 {

  Line 325:   return compareVersions(current, target) === 1;


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line ...
gateway · 2026-09-09 04:10:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
410:     }
411:   }
412: 
413:   return merged;
414: }
415: 
416: /**
417:  * Build a changelog summary from a list of GitHub releases.
418:  *
419:  * Filters releases within the version range (exclusive `fromVersion`,
420:  * inclusive `toVersion`), extracts and merges sections by category, and
421:  * optionally truncates to fit terminal constraints. ...
gateway · 2026-09-09 04:10:41
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 47: const VERSION_PREFIX_RE = /^v/;

  Line 436:     const version = r.tag_name.replace(VERSION_PREFIX_RE, "");
gateway · 2026-09-09 04:10:53
result
6e3e7e13a feat(config): follow XDG Base Directory spec for config location (#1503)
b0b22fe82 feat(errors): wire up no-silent-catch lint rule, drop ratchet baseline (#1532)
96390e5f6 chore: pre-shape repo into pnpm-workspace monorepo layout (#1254)
cf165f5ba chore: pre-shape repo into pnpm-workspace monorepo layout
e11da2e85 chore: pre-shape repo into pnpm-workspace monorepo layout
gateway · 2026-09-09 04:14:35
result
src/lib/binary.ts(236,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
src/lib/binary.ts(244,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
gateway · 2026-09-09 04:15:36
result
File not found: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CONTRIBUTING.md
gateway · 2026-09-09 04:15:46
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/content/docs/contributing.md
gateway · 2026-09-09 04:15:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-09 04:16:19
result
## feat/toolkit-bridge-upgrade...origin/main
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
packages/cli/src/lib/binary.ts
packages/cli/test/lib/binary.test.ts
packages/cli/test/lib/ghcr.test.ts
packages/cli/test/lib/install-script.test.ts
gateway · 2026-09-09 04:16:48
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-09 04:17:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
90:  *
91:  * Defined here (alongside other installation constants like
92:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
93:  * `db/install-info.ts` can import it without creating a circular
94:  * dependency.
95:  */
96: export type InstallationMethod =
97:   | "curl"
98:   | "brew"
99:   | "npm"
100:   | "pnpm"
101:   | "bun"
102:   | "yarn"
103:   | "unknown";
104: 
105: /** A repository pair that hosts CLI stable releases and nightly OCI images. */
106: export type UpgradeSource = {
107:   /** GitHub `owner/repository` containing CLI release assets. */
108:   readonly githubRepo: string;
109:   /** GHCR `owner/package` containing CLI nightly images and delta patches. */
110:   readonly ghcrRepo: string;
111:   /** Prefix attached to CLI release tags in this repository. ...
gateway · 2026-09-09 04:17:40
result
Found 20 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

  Line 30:   getBinaryDownloadUrl,

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

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

  Line 766:   const url = getBinaryDownloadUrl(version);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 116: export const UPGRADE_SOURCES: readonly UpgradeSource[] = [

  Line 130: export const PRIMARY_UPGRADE_SOURCE = UPGRADE_SOURCES[0];

  Line 234: export function getBinaryDownloadUrl(

  Line 236:   source: UpgradeSource = PRIMARY_UPGRADE_SOURCE

  Line 243: export function getGitHubReleasesUrl(

  Line 244:   source: UpgradeSource = PRIMARY_UPGRADE_SOURCE

  Line 250: export const GITHUB_RELEASES_URL = getGitHubReleasesUrl();

  Line 267: export async ...
gateway · 2026-09-09 04:18:12
result
Found 32 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install:
  Line 56:     curl -sf --max-time 2 \

  Line 70:   wait 2>/dev/null || true  # Let the background curl finish; ignore its exit status

  Line 85:     -v, --version <version> Install a specific version (e.g., 0.2.0) or "nightly"

  Line 92:     SENTRY_VERSION          Install a specific version (e.g., 0.42.2, nightly)

  Line 96:     curl -fsSL https://cli.sentry.dev/install | bash

  Line 97:     curl -fsSL https://cli.sentry.dev/install | SENTRY_INIT=1 bash

  Line 98:     curl -fsSL https://cli.sentry.dev/install | bash -s -- --version nightly

  Line 99:     curl -fsSL https://cli.sentry.dev/install | bash -s -- --version 0.42.2

  Line 100:     SENTRY_VERSION=nightly curl -fsSL https://cli.sentry.dev/install | bash

  Line 101:     SENTRY_INSTALL_DIR=~/.local/bin curl -fsSL https://cli.sentry.dev/install | bash

  Line 213: if [[ ...
gateway · 2026-09-09 04:18:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
190:         fi
191:       fi
192:     fi
193:   fi
194: fi
195: 
196: # Validate supported combinations
197: suffix=""
198: if [[ "$os" == "windows" ]]; then
199:   suffix=".exe"
200:   if [[ "$arch" != "x64" ]]; then
201:     die "Unsupported: windows-$arch (only windows-x64 is supported)" "detect-arch"
202:   fi
203: fi
204: 
205: # Download binary to a temp location
206: tmpdir="${TMPDIR:-${TMP:-${TEMP:-/tmp}}}"
207: tmp_binary="${tmpdir}/sentry-install-$$${suffix}"
208: version=""
209: 
210: # Clean up temp binary on failure (setup handles cleanup on success)
211: trap 'rm -f "$tmp_binary"' EXIT
212: 
213: if [[ "$requested_version" == "nightly" ]]; then
214:   # Nightly build: download from GHCR via OCI blob protocol.
215:   # No jq needed — parse JSON with awk.
216:   # ghcr.io blob downloads redirect to Azure ...
gateway · 2026-09-09 04:18:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-09 04:18:56
result
No files found
gateway · 2026-09-09 04:19:12
result
File not found: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.agents
gateway · 2026-09-09 04:19:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:01a02357-f0a8-7fdb-9e9d-b0710cfe65c9 -->
8: * **API output binary and HTTP contracts**: Always preserve strict output-mode and binary-safety contracts. `sentry api` must preserve `rawApiRequest()` status text; empty textual non-2xx bodies must produce an HTTP status/request fallback, and JSON mode must expose `{status, statusText, body}` so empty success and error responses are distinguishable. Binary `Uint8Array` successes bypass formatters and remain raw; binary errors emit only status/content-type/byte-count summaries, never bytes or JSON coercion. Prompts must never block scripted runs or interleave with stdout JSON.
9: 
10: <!-- ...
gateway · 2026-09-09 04:19:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 04:20:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 04:20:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
380: ): Promise<string> {
381:   return withTracingSpan(
382:     "apply-patches",
383:     "upgrade.delta.apply",
384:     async (span) => {
385:       span.setAttribute("patches.count", chain.patches.length);
386:       span.setAttribute("patches.total_bytes", chain.totalSize);
387:       const sha256 = await applyPatchChainInMemory(
388:         oldBinaryPath,
389:         chain.patches.map((patch) => patch.data),
390:         destPath,
391:         onBytes
392:       );
393:       if (sha256 !== chain.expectedSha256) {
394:         throw new Error(
395:           `SHA-256 mismatch after patching: got ${sha256}, expected ${chain.expectedSha256}`
396:         );
397:       }
398:       return sha256;
399:     }
400:   );
401: }
402: 
403: function makeProgressHandler(setMessage?: SetMessage): ...
gateway · 2026-09-09 04:20:45
result
Found 47 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 44:   type ChangelogSummary,

  Line 45:   fetchChangelog,

  Line 91:   /** Changelog summary for the version range. Absent for offline or on fetch failure. */

  Line 92:   changelog?: ChangelogSummary;

  Line 825: function startChangelogFetch(

  Line 830: ): Promise<ChangelogSummary | undefined> {

  Line 834:   return fetchChangelog({

  Line 846: async function buildCheckResultWithChangelog(opts: {

  Line 853:   changelogPromise: Promise<ChangelogSummary | undefined>;

  Line 958:         result.changelog = await startChangelogFetch(

  Line 971:     const changelogPromise = startChangelogFetch(

  Line 982:         await buildCheckResultWithChangelog({


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 155: ...
gateway · 2026-09-09 04:20:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 04:21:20
<!-- lore-recall:2c492d8d-cef2-45f9-9246-0299d2d8ef81 --><!-- lore-recall:91a67719-c8f7-466e-bbb1-9632c19aa7f2 -->
gpt-5.6-sol · 2026-09-09 04:21:20 · ~60 tokens
result
Found 28 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 30: import { fetchLatestFromGitHub, fetchLatestNightlyVersion } from "./upgrade.js";

  Line 286:             ? await fetchLatestNightlyVersion(signal)

  Line 287:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 399: export async function fetchLatestFromGitHub(

  Line 467: export async function fetchLatestNightlyVersion(

  Line 498: export function fetchLatestVersion(

  Line 503:     return fetchLatestNightlyVersion();

  Line 506:     ? ...
gateway · 2026-09-09 04:21:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
600:     return xdgInstallDir;
601:   }
602:   return currentInstallDir;
603: }
604: 
605: /**
606:  * Execute the standard upgrade path: download via curl or package manager,
607:  * then run setup on the new binary.
608:  */
609: async function executeStandardUpgrade(opts: {
610:   method: InstallationMethod;
611:   channel: ReleaseChannel;
612:   versionArg: string | undefined;
613:   target: string;
614:   execPath: string;
615:   entryPath?: string;
616:   pathEnv?: string;
617:   offline?: OfflineMode;
618:   json?: boolean;
619:   noAgentSkills: boolean;
620: }): Promise<void> {
621:   const {
622:     method,
623:     channel,
624:     versionArg,
625:     target,
626:     execPath,
627:     entryPath,
628:     pathEnv,
629:     offline,
630:     json,
631:     noAgentSkills,
632:   } = ...
gateway · 2026-09-09 04:23:14
result
Found 30 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 16:   getVersionCheckInfo,

  Line 18:   setVersionCheckInfo,

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

  Line 216: export function abortPendingVersionCheck(): void {

  Line 229:   latestVersion: string,

  Line 232:   if (semverCompare(latestVersion, CLI_VERSION) !== 1) {

  Line 237:       await prefetchNightlyPatches(latestVersion, signal);

  Line 239:       await prefetchStablePatches(latestVersion, signal);

  Line 284:         const latestVersion =

  Line 288:         setVersionCheckInfo(latestVersion);

  Line 291:         await maybePrefetchPatches(channel, latestVersion, signal);

  Line 358:   formatNotification: (latestVersion: string) => string

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

  Line 373:     if (!latestVersion) {

  Line 379:     if ...
gateway · 2026-09-09 04:23:41
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-09 04:24:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
700: 
701: /**
702:  * Build the gzip filename for the current platform binary.
703:  *
704:  * Nightly builds are stored in GHCR as `sentry-<os>-<arch>.gz` (or
705:  * `sentry-windows-x64.exe.gz` on Windows). This filename is the
706:  * `org.opencontainers.image.title` annotation on the matching OCI layer.
707:  *
708:  * @returns Filename of the gzip-compressed binary for this platform
709:  */
710: function getNightlyGzFilename(): string {
711:   return `${getPlatformBinaryName()}.gz`;
712: }
713: 
714: /**
715:  * Download a nightly binary from GHCR and decompress it to `destPath`.
716:  *
717:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
718:  * matching this platform's `.gz` filename, then downloads and decompresses
719:  * the blob in-stream. ...
gateway · 2026-09-09 04:25:10
result
base-readable
gateway · 2026-09-09 04:25:48
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/install-script.test.ts:
  Line 27: const installScript = join(repoRoot, "install");

  Line 64:         installScript,

  Line 112:     const script = readFileSync(installScript, "utf8");


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/generate-skill.ts:
  Line 291:     lines.push(...generateInstallSection(installSection, rawContent));
gateway · 2026-09-09 04:27:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/script/check-patches.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env tsx
2: /**
3:  * Check Patched Dependency Versions
4:  *
5:  * Verifies that pnpm patchedDependencies target versions match installed versions.
6:  * Name-only keys in patchedDependencies (pnpm 10+ catalog style) apply patches
7:  * to whatever version resolves. If the installed version doesn't match the
8:  * patch file's target version, the patch may silently fail to apply.
9:  *
10:  * Mismatches are surfaced as warnings (not hard failures) because pnpm 10
11:  * name-only keys intentionally support version-agnostic patching — patches
12:  * often apply cleanly across minor/patch bumps. The warning ensures engineers
13:  * notice and can regenerate the patch if needed. ...
gateway · 2026-09-09 04:27:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2:   "name": "sentry",
3:   "version": "0.45.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:28:07
result
Found 73 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/pnpm-lock.yaml:
  Line 1548:   '@sentry/cli@2.58.6':

  Line 2547:   es-toolkit@1.49.0:

  Line 4207:   trpc-cli@0.12.4:

  Line 6000:   '@sentry/cli@2.58.6':

  Line 7009:   es-toolkit@1.49.0: {}

  Line 7659:       es-toolkit: 1.49.0

  Line 9255:   trpc-cli@0.12.4(@trpc/server@11.18.0(typescript@5.9.3))(valibot@1.4.2(typescript@5.9.3))(zod@4.4.3):


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/README.md:
  Line 4: the Sentry CLI and Sentry MCP server into a single `getsentry/toolkit` monorepo.


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CHANGELOG.md:
  Line 1200: - Use production environment for sentry-release auth token by @BYK in ...
gateway · 2026-09-09 04:28:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 04:28:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 04:29:20
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install
gateway · 2026-09-09 04:29:43
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 273:       headers: getGitHubHeaders(),

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

  Line 426: export async function fetchWithUpgradeError(
gateway · 2026-09-09 04:29:50
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
390:   // 3-4. Check well-known directories that are already in PATH. samePath keeps
391:   // the membership check case-insensitive on Windows/macOS, where a PATH entry
392:   // can differ in casing from the computed directory yet be the same dir.
393:   const candidates = [join(homeDir, ".local", "bin"), join(homeDir, "bin")];
394: 
395:   for (const dir of candidates) {
396:     if (existsSync(dir) && pathDirs.some((p) => samePath(p, dir))) {
397:       return dir;
398:     }
399:   }
400: 
401:   // 5. XDG-aligned fallback — setup will handle adding this to PATH
402:   return join(homeDir, ".local", "bin");
403: }
404: 
405: /**
406:  * Build headers for GitHub API requests.
407:  */
408: export function getGitHubHeaders(): Record<string, string> {
409:   return {
410:     Accept: ...
gateway · 2026-09-09 04:30:01
result
Found 61 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 205:     const version = await fetchLatestFromGitHub();

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

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

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

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

  Line 551:     const exists = await versionExists("curl", "1.0.0");

  Line 558:     const exists = await versionExists("curl", "99.99.99");

  Line 565:     const exists = await versionExists("npm", "1.0.0");

  Line 572:     const exists = await ...
gateway · 2026-09-09 04:30:12
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
170:     expect(parseInstallationMethod("brew")).toBe("brew");
171:     expect(parseInstallationMethod("npm")).toBe("npm");
172:     expect(parseInstallationMethod("pnpm")).toBe("pnpm");
173:     expect(parseInstallationMethod("bun")).toBe("bun");
174:     expect(parseInstallationMethod("yarn")).toBe("yarn");
175:   });
176: 
177:   test("parses case-insensitively", () => {
178:     expect(parseInstallationMethod("NPM")).toBe("npm");
179:     expect(parseInstallationMethod("Curl")).toBe("curl");
180:     expect(parseInstallationMethod("YARN")).toBe("yarn");
181:   });
182: 
183:   test("throws on invalid method", () => {
184:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
185:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
186:     ...
gateway · 2026-09-09 04:30:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
530:     expect(version).toBe("0.0.0-dev.1740393600");
531:   });
532: 
533:   test("defaults to stable channel (uses GitHub) when channel omitted", async () => {
534:     mockFetch(
535:       async () =>
536:         new Response(JSON.stringify({ tag_name: "v3.0.0" }), {
537:           status: 200,
538:           headers: { "Content-Type": "application/json" },
539:         })
540:     );
541: 
542:     const version = await fetchLatestVersion("curl");
543:     expect(version).toBe("3.0.0");
544:   });
545: });
546: 
547: describe("versionExists", () => {
548:   test("checks GitHub for curl method - version exists", async () => {
549:     mockFetch(async () => new Response(null, { status: 200 }));
550: 
551:     const exists = await versionExists("curl", "1.0.0");
552:     ...
gateway · 2026-09-09 04:30:27
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1300:     mkdirSync(upgradeBinDir, { recursive: true });
1301:     setInstallInfo({
1302:       method: "curl",
1303:       path: upgradeInstallPath,
1304:       version: "0.0.0",
1305:     });
1306:   });
1307: 
1308:   afterEach(async () => {
1309:     globalThis.fetch = originalFetch;
1310:     // Clean up test files - get fresh paths in case DB changed
1311:     const paths = getTestPaths();
1312:     for (const path of [
1313:       paths.installPath,
1314:       paths.tempPath,
1315:       paths.oldPath,
1316:       paths.lockPath,
1317:     ]) {
1318:       try {
1319:         await unlink(path);
1320:       } catch {
1321:         // Ignore
1322:       }
1323:     }
1324:     clearInstallInfo();
1325:   });
1326: 
1327:   test("downloads and decompresses gzip binary when .gz URL succeeds", async ...
gateway · 2026-09-09 04:30:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1520:       callCount += 1;
1521:       const urlStr = String(url);
1522:       if (urlStr.includes("ghcr.io/token")) {
1523:         return new Response(JSON.stringify({ token: "test-token" }), {
1524:           status: 200,
1525:           headers: { "Content-Type": "application/json" },
1526:         });
1527:       }
1528:       if (urlStr.includes("/manifests/nightly")) {
1529:         return new Response(
1530:           JSON.stringify({
1531:             schemaVersion: 2,
1532:             layers: [],
1533:             annotations: { version: "0.0.0-dev.1740000000" },
1534:           }),
1535:           {
1536:             status: 200,
1537:             headers: {
1538:               "Content-Type": "application/vnd.oci.image.manifest.v1+json",
1539:             },
1540:           }
1541:         ...
gateway · 2026-09-09 04:30:42
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 511:       const { getUpdateNotification, maybeCheckForUpdateInBackground } = await import('./src/lib/version-check.js');
gateway · 2026-09-09 04:30:49
result
Found 6 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts:
  Line 25: import { mockFetch, useTestConfigDir } from "../helpers.js";

  Line 418:   let originalFetch: typeof globalThis.fetch;

  Line 426:     originalFetch = globalThis.fetch;

  Line 427:     globalThis.fetch = mockFetch(

  Line 438:     globalThis.fetch = originalFetch;

  Line 474:     expect(infoBefore.latestVersion).toBe("1.0.0");
gateway · 2026-09-09 04:31:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts</path>
<type>file</type>
<content>
400:   test("does not throw when no pending check", () => {
401:     // Should be safe to call even when nothing is pending
402:     expect(() => abortPendingVersionCheck()).not.toThrow();
403:   });
404: 
405:   test("does not throw when called multiple times", () => {
406:     // Should be safe to call multiple times
407:     expect(() => {
408:       abortPendingVersionCheck();
409:       abortPendingVersionCheck();
410:       abortPendingVersionCheck();
411:     }).not.toThrow();
412:   });
413: });
414: 
415: describe("maybeCheckForUpdateInBackground", () => {
416:   useTestConfigDir("test-version-bg-");
417:   let savedNoUpdateCheck: string | undefined;
418:   let originalFetch: typeof globalThis.fetch;
419: 
420:   beforeEach(() => {
421:     // Save and clear the env var to test real ...
gateway · 2026-09-09 04:31:23
result
No files found
gateway · 2026-09-09 04:31:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/README.md</path>
<type>file</type>
<content>
1: # Sentry Toolkit (pre-shape)
2: 
3: This repository is being reshaped into a pnpm-workspace monorepo ahead of merging
4: the Sentry CLI and Sentry MCP server into a single `getsentry/toolkit` monorepo.
5: 
6: ## Workspace layout
7: 
8: - [`packages/cli/`](./packages/cli) — the Sentry CLI (npm package `sentry`,
9:   binary `sentry`). See [packages/cli/README.md](./packages/cli/README.md).
10: - [`apps/cli-docs/`](./apps/cli-docs) — the CLI documentation site
11:   (Astro + Starlight, published to `cli.sentry.dev`).
12: 
13: ## Development
14: 
15: This is a [pnpm workspace](https://pnpm.io/workspaces). ...
gateway · 2026-09-09 04:33:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
800:   return { channel, versionArg, channelChanged, method };
801: }
802: 
803: /**
804:  * Persist the release channel preference. Must be called **after** offline
805:  * target resolution since `setReleaseChannel()` clears the version check
806:  * cache on channel changes, which would prevent `resolveOfflineTarget()`
807:  * from reading the cached version.
808:  */
809: function persistChannel(
810:   channel: ReleaseChannel,
811:   channelChanged: boolean,
812:   version: string | undefined
813: ): void {
814:   if (channelChanged || CHANNEL_VERSIONS.has(version ?? "")) {
815:     setReleaseChannel(channel);
816:   }
817: }
818: 
819: /**
820:  * Start a best-effort changelog fetch in parallel with the binary download. ...
gateway · 2026-09-09 04:34:07
result
{"body":"Tracking issue for merging **getsentry/cli** into the existing **getsentry/sentry-mcp** repository, validating the combined monorepo there, and only then renaming it to **`getsentry/toolkit`**. The final repository is a pnpm workspace (no Turbo) with independent prefixed releases and phased shared code.\n\n**Full plan:** https://gist.github.com/BYK/8c0ce6cec64608f41fe5654b7827228e\n\n## Settled architecture\n\n- Use `getsentry/sentry-mcp` as the destination; do not create a fresh repository. This preserves MCP production secrets, environments, GitHub App, webhooks, Vercel, and Cloudflare wiring.\n- Import CLI while the repository is still named `getsentry/sentry-mcp`. Rename only after the integrated monorepo and live deployment paths pass every gate.\n- Preserve CLI and docs history through two filtered `git subtree` imports into `packages/cli` and `apps/cli-docs`.\n- Release products independently with `cli@x.y.z` and `mcp@x.y.z`.\n- CLI docs remain release-gated on Vercel; ...
gateway · 2026-09-09 04:34:18
result
Found 63 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 32:   prefetchNightlyPatches,

  Line 33:   prefetchStablePatches,

  Line 34:   resolveNightlyChain,

  Line 35:   resolveNightlyDelta,

  Line 36:   resolveStableChain,

  Line 37:   resolveStableDelta,

  Line 891: // resolveStableChain (async orchestrator)

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

  Line 947:     const chain = await resolveStableChain("0.13.0", "0.14.0");

  Line 1000:     const chain = await resolveStableChain("0.13.0", "0.15.0");

  Line 1018:     const chain = await resolveStableChain("0.12.0", "0.14.0");

  Line 1025:     const chain = await resolveStableChain("0.12.0", "0.13.0");

  Line 1050:     const chain = await resolveStableChain("0.13.0", "0.14.0");

  Line 1073:     const chain = await resolveStableChain("0.1.0", "0.15.0");

  Line 1078: // resolveNightlyChain (async ...
gateway · 2026-09-09 04:34:26
result
HTTP/2.0 404 Not Found
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset, Warning
Content-Security-Policy: default-src 'none'
Content-Type: application/json; charset=utf-8
Date: Wed, 09 Sep 2026 04:34:26 GMT
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Server: github.com
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Vary: Accept-Encoding, Accept, X-Requested-With
X-Accepted-Oauth-Scopes: repo
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Github-Api-Version-Selected: 2022-11-28
X-Github-Edge-Region: uksouth
X-Github-Media-Type: github.v3; format=json
X-Github-Request-Id: ...
gateway · 2026-09-09 04:37:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, sep } 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:   getLegacyInstallDirs,
29:   getPlatformBinaryName,
30:   installBinary,
31:   ...
gateway · 2026-09-09 04:37:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-09 04:37:50
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
gateway · 2026-09-09 04:38:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-09 04:38:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
90:  *
91:  * Defined here (alongside other installation constants like
92:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
93:  * `db/install-info.ts` can import it without creating a circular
94:  * dependency.
95:  */
96: export type InstallationMethod =
97:   | "curl"
98:   | "brew"
99:   | "npm"
100:   | "pnpm"
101:   | "bun"
102:   | "yarn"
103:   | "unknown";
104: 
105: /** A repository pair that hosts CLI stable releases and nightly OCI images. */
106: export type UpgradeSource = {
107:   /** GitHub `owner/repository` containing CLI release assets. */
108:   readonly githubRepo: string;
109:   /** GHCR `owner/package` containing CLI nightly images and delta patches. */
110:   readonly ghcrRepo: string;
111:   /** Prefix attached to CLI release tags in this repository. ...
gateway · 2026-09-09 04:38:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 04:39:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
205: # Download binary to a temp location
206: tmpdir="${TMPDIR:-${TMP:-${TEMP:-/tmp}}}"
207: tmp_binary="${tmpdir}/sentry-install-$$${suffix}"
208: version=""
209: 
210: # Clean up temp binary on failure (setup handles cleanup on success)
211: trap 'rm -f "$tmp_binary"' EXIT
212: 
213: if [[ "$requested_version" == "nightly" ]]; then
214:   # Nightly build: download from GHCR via OCI blob protocol.
215:   # No jq needed — parse JSON with awk.
216:   # ghcr.io blob downloads redirect to Azure Blob Storage. curl -L would
217:   # forward the Authorization header to Azure, which returns 404. Instead,
218:   # extract the redirect URL and follow it without the auth header.
219: 
220:   echo -e "${MUTED}Fetching nightly build from GHCR...${NC}"
221: 
222:   # Step 1: Get anonymous pull token
223:   GHCR_TOKEN=$(curl -sf ...
gateway · 2026-09-09 04:39:47
result
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-09 04:40:49
result
Found 41 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

  Line 30:   getBinaryDownloadUrl,

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

  Line 476:   const token = await getAnonymousToken();

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

  Line 523:   const token = await getAnonymousToken();

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

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

  Line 733:   const token = await getAnonymousToken();

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

  Line 736:     : await fetchNightlyManifest(token);

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

  Line 766:   const url = ...
gateway · 2026-09-09 04:41:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 04:41:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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-09 04:42:25
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 04:42:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 04:43:13
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 270: export function resolveStableChain(

  Line 278: export async function resolveNightlyChain(opts: {
gateway · 2026-09-09 04:43:41
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 602: async function fetchStableChangelog(

  Line 642: async function fetchNightlyChangelog(

  Line 720: export async function fetchChangelog(

  Line 727:       return await fetchNightlyChangelog(fromVersion, toVersion, maxItems);

  Line 729:     return await fetchStableChangelog(
gateway · 2026-09-09 04:44:07
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
635:  * timestamp-based commit listing without git tags.
636:  *
637:  * @param fromVersion - Current nightly version
638:  * @param toVersion - Target nightly version
639:  * @param maxItems - Maximum list items to include
640:  * @returns Changelog summary, or null on failure or invalid versions
641:  */
642: async function fetchNightlyChangelog(
643:   fromVersion: string,
644:   toVersion: string,
645:   maxItems?: number
646: ): Promise<ChangelogSummary | null> {
647:   const fromTs = extractNightlyTimestamp(fromVersion);
648:   const toTs = extractNightlyTimestamp(toVersion);
649: 
650:   if (fromTs === null || toTs === null) {
651:     log.debug("Cannot extract timestamps from nightly versions");
652:     return null;
653:   }
654: 
655:   // GitHub's `since` is inclusive — offset by +1s to ...
gateway · 2026-09-09 04:44:20
result
Found 4 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 237:       await prefetchNightlyPatches(latestVersion, signal);

  Line 239:       await prefetchStablePatches(latestVersion, signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 615: export function prefetchNightlyPatches(

  Line 622: export function prefetchStablePatches(
gateway · 2026-09-09 04:44:41
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts</path>
<type>file</type>
<content>
210: }
211: 
212: /**
213:  * Abort any pending version check to allow process exit.
214:  * Call this when main CLI work is complete.
215:  */
216: export function abortPendingVersionCheck(): void {
217:   pendingAbortController?.abort();
218:   pendingAbortController = null;
219: }
220: 
221: /**
222:  * Pre-fetch delta patches for a newly discovered version.
223:  *
224:  * Best-effort: errors are silently caught so the version check still succeeds.
225:  * After pre-fetching, opportunistically cleans up stale cached patches.
226:  */
227: async function maybePrefetchPatches(
228:   channel: "stable" | "nightly",
229:   latestVersion: string,
230:   signal: AbortSignal
231: ): Promise<void> {
232:   if (semverCompare(latestVersion, CLI_VERSION) !== 1) {
233:     return;
234:   }
235:   try {
236:     ...
gateway · 2026-09-09 04:44:59
result
 DEPRECATED  `test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. Please, refer to the migration guide: https://vitest.dev/guide/migration#pool-rework

 RUN  v4.1.10 /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli

 ❯ test/lib/install-script.test.ts (2 tests | 1 failed) 46ms
     × embeds the shared ordered upgrade source list 9ms
 ❯ test/lib/ghcr.test.ts (37 tests | 2 failed) 102ms
     × uses the selected source's GHCR repository 12ms
     × uses the selected source's GHCR repository 2ms
 ❯ test/lib/binary.test.ts (71 tests | 1 failed) 127ms
     × builds correct URL for current platform 26ms

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  test/lib/binary.test.ts > getBinaryDownloadUrl > builds correct URL for current platform
AssertionError: expected 'https://github.com/getsentry/toolkit/…' to contain '/1.0.0/'

Expected: "/1.0.0/"
Received: ...
gateway · 2026-09-09 04:46:04
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.craft.yml
gateway · 2026-09-09 04:46:14
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:         - 'vercel'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: vercel
20:     projectId: prj_wVkOnIwI3eIQbGD1Gw7qS1MqFFIK
21:   - name: registry
22:     apps:
23:       'app:sentry':
24:         name: 'Sentry CLI'
25:         packageUrl: 'https://www.npmjs.com/package/sentry'
26:         mainDocsUrl: 'https://cli.sentry.dev'
27:         urlTemplate: ...
gateway · 2026-09-09 04:47:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
390:   );
391: }
392: 
393: /**
394:  * Check whether an error indicates the spawn target was not found.
395:  *
396:  * Bun surfaces a missing executable as `Executable not found in $PATH: "..."`
397:  * without a standard `code` field on the Error, so we fall back to message
398:  * matching. Node's `child_process.spawn` would use `code: "ENOENT"`.
399:  */
400: export function isEnoentSpawnError(error: unknown): boolean {
401:   if (!(error instanceof Error)) {
402:     return false;
403:   }
404:   if ((error as NodeJS.ErrnoException).code === "ENOENT") {
405:     return true;
406:   }
407:   return error.message.includes("Executable not found in $PATH");
408: }
409: 
410: /**
411:  * Spawn a binary with retry on EBUSY errors. ...
gateway · 2026-09-09 04:47:52
result
Found 12 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 51:     browser_download_url: "https://example.com/download",

  Line 58:   return { tag_name: tag, assets };

  Line 233:           browser_download_url: `https://example.com/${v}.patch`,

  Line 376:           browser_download_url: "https://example.com/0.14.0.patch",

  Line 455:           browser_download_url: "https://example.com/0.14.0.patch",

  Line 467:           browser_download_url: "https://example.com/0.13.0.patch",

  Line 836:     expect(result[0]?.tag_name).toBe("0.14.0");

  Line 938:           browser_download_url: patchUrl,

  Line 973:           browser_download_url: urlB,

  Line 985:           browser_download_url: urlA,

  Line 1040:           browser_download_url: "https://example.com/missing.patch",

  Line 1065:           browser_download_url: `https://example.com/${v}.patch`,
gateway · 2026-09-09 04:48:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:     ...
gateway · 2026-09-09 04:48:32
result
Found 13 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/package.json:
  Line 38:     "check:fragments": "pnpm --filter sentry run check:fragments",

  Line 39:     "check:deps": "pnpm --filter sentry run check:deps",

  Line 41:     "check:patches": "pnpm --filter sentry run check:patches",

  Line 43:     "check:stale-refs": "pnpm --filter sentry run check:stale-refs"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 188:         run: pnpm run check:fragments

  Line 244:       - run: pnpm run check:deps

  Line 246:       - run: pnpm run check:patches

  Line 247:       - run: pnpm run check:stale-refs


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 80:     "check:fragments": "pnpm tsx script/check-fragments.ts",

  Line 81:     ...
gateway · 2026-09-09 04:48:47
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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": ">=20.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 ...
gateway · 2026-09-09 04:49:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/public</path>
<type>directory</type>
<entries>
.well-known/
CNAME
favicon.png
favicon.svg
glyph.svg
install
og-image-twitter.png
og-image.png
wordmark-light.svg
wordmark.svg

(10 entries)
</entries>
gateway · 2026-09-09 04:49:31
result
'apps/cli-docs/public/install' -> '../../../packages/cli/install'
'packages/cli/install'
gateway · 2026-09-09 04:49:43
result
{"message":"No commit found for the ref main","documentation_url":"https://docs.github.com/v3/repos/contents/","status":"404"}gh: No commit found for the ref main (HTTP 404)
gateway · 2026-09-09 04:49:55
result
master
gateway · 2026-09-09 04:50:11
result
.github
.github/workflows
.github/workflows/build.yml
.github/workflows/changelog-preview.yml
.github/workflows/docs-preview.yml
.github/workflows/enforce-license-compliance.yml
.github/workflows/image.yml
.github/workflows/lint.yml
.github/workflows/release.yml
docs/astro.config.mjs
docs/src/content.config.ts
docs/src/content/docs/configuration.md
docs/src/content/docs/github-actions.md
docs/src/content/docs/targets/github.md
docs/tsconfig.json
eslint.config.mjs
src/__tests__/config.test.ts
src/artifact_providers/__tests__/github.test.ts
src/artifact_providers/github.ts
src/commands/config.ts
src/commands/workspace.ts
src/commands/workspace_cmds
src/commands/workspace_cmds/__tests__
src/commands/workspace_cmds/__tests__/list.test.ts
src/commands/workspace_cmds/list.ts
src/config.ts
src/schemas
src/schemas/project_config.ts
src/status_providers/__tests__/github.test.ts
src/status_providers/github.ts
src/targets/__tests__/github.test.ts
src/targets/github.ts
src/utils/__fixtures__/works...
gateway · 2026-09-09 04:50:24
result
169: * Fields that describe how a single release unit is built and published.
171: * These are shared between the top-level config (the implicit/default release
172: * unit) and each entry under the top-level `workspaces` map (an explicit,
173: * independently-versioned release unit). A workspace inherits the top-level
176: * NOTE: this "workspace" (a named, independently-versioned release unit) is a
177: * different concept from the `npm` target's `workspaces: true` field, which
181:const releaseUnitFields = {
186:  releaseBranchPrefix: z.string().optional(),
194:   * Do not merge the release branch after publishing.
201: * Configuration for a single named workspace (release unit).
203: * A workspace mirrors the release-relevant subset of the top-level config;
205: * `github` block is *partial* (all fields optional) so a workspace can override
209:  ...releaseUnitFields,
274:  const prefix = pattern.slice(0, opening);
278:    const expanded = ...
gateway · 2026-09-09 04:50:49
result
168-/**
169- * Fields that describe how a single release unit is built and published.
170- *
171- * These are shared between the top-level config (the implicit/default release
172: * unit) and each entry under the top-level `workspaces` map (an explicit,
173: * independently-versioned release unit). A workspace inherits the top-level
174- * values as defaults and overrides the fields it declares.
175- *
176: * NOTE: this "workspace" (a named, independently-versioned release unit) is a
177: * different concept from the `npm` target's `workspaces: true` field, which
178- * discovers npm packages *within* a single target and publishes them all at the
179- * same version. See docs for the disambiguation.
180- */
181-const releaseUnitFields = {
--
197-  noMerge: z.boolean().optional(),
198-} as const;
199-
200-/**
201: * Configuration for a single named workspace (release unit). ...
gateway · 2026-09-09 04:51:05
result
23-import { isCompiledGitHubAction } from './utils/detection';
24-import {
25-  getPackageVersion,
26-  parseVersion,
27:  versionGreaterOrEqualThan,
28-  SemVer,
29:} from './utils/version';
30-// Note: We import getTargetByName lazily in expandWorkspaceTargets to avoid
31:// circular dependency: config -> targets -> registry -> utils/registry -> symlink -> version -> config
32-import { BaseArtifactProvider } from './artifact_providers/base';
33-import { GitHubArtifactProvider } from './artifact_providers/github';
34-import { NoneArtifactProvider } from './artifact_providers/none';
35-import { GCSArtifactProvider } from './artifact_providers/gcs';
--
43-// TODO support multiple configuration files (one per configuration)
44-export const CONFIG_FILE_NAME = '.craft.yml';
45-
46-/**
47: * The default prefix for the release branch. ...
gateway · 2026-09-09 04:52:39
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json</path>
<type>file</type>
<content>
1: {
2:   "compilerOptions": {
3:     "lib": ["ESNext"],
4:     "target": "ESNext",
5:     "module": "ESNext",
6:     "jsx": "react-jsx",
7:     "moduleDetection": "force",
8:     "allowJs": true,
9:     "moduleResolution": "bundler",
10:     "allowImportingTsExtensions": true,
11:     "verbatimModuleSyntax": true,
12:     "noEmit": true,
13:     "resolveJsonModule": true,
14:     "strict": true,
15:     "skipLibCheck": true,
16:     "noFallthroughCasesInSwitch": true,
17:     "noUncheckedIndexedAccess": true,
18:     "noImplicitOverride": true,
19:     "esModuleInterop": true,
20:     "forceConsistentCasingInFileNames": true,
21:     "noUnusedLocals": false,
22:     "noUnusedParameters": false,
23:     "noPropertyAccessFromIndexSignature": false,
24:     "strictNullChecks": true
25:   },
26:   "include": ...
gateway · 2026-09-09 04:53:54
result
src/lib/binary.ts(236,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
src/lib/binary.ts(244,3): error TS2322: Type 'UpgradeSource | undefined' is not assignable to type 'UpgradeSource'.
  Type 'undefined' is not assignable to type 'UpgradeSource'.
gateway · 2026-09-09 04:54:42
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-09 04:55:34
result
No files found
gateway · 2026-09-09 04:55:50
result
No files found
gateway · 2026-09-09 04:56:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 04:56:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
370:   const legacyMethod = await detectLegacyInstallationMethod();
371: 
372:   // Auto-save detected method for future runs (best-effort —
373:   // a read-only or broken DB shouldn't block detection)
374:   if (legacyMethod !== "unknown") {
375:     try {
376:       setInstallInfo({
377:         method: legacyMethod,
378:         path: process.execPath,
379:         version: CLI_VERSION,
380:       });
381:     } catch {
382:       log.debug("Failed to persist install info (DB may be read-only)");
383:     }
384:   }
385: 
386:   return legacyMethod;
387: }
388: 
389: // Version Fetching
390: 
391: /**
392:  * Fetch the latest version from GitHub releases. ...
gateway · 2026-09-09 04:56:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
800:   await writeFile(destPath, new Uint8Array(body));
801: }
802: 
803: /**
804:  * Max probe attempts before giving up. Six probes run with five sleeps
805:  * in between, yielding ~3.1s total wall-clock budget (see backoff table
806:  * on {@link waitForBinaryVisible}).
807:  */
808: const VERIFY_MAX_ATTEMPTS = 6;
809: 
810: /** Base delay (ms) between verify attempts. Doubles each retry. */
811: const VERIFY_BASE_DELAY_MS = 100;
812: 
813: /**
814:  * Stat the downloaded file, tolerating absence.
815:  *
816:  * Returns the file size when the path is present, a regular file, and
817:  * has non-zero size. Returns `null` otherwise so the caller can poll.
818:  */
819: function probeBinaryFile(path: string): number | null {
820:   const stats = statSync(path, { throwIfNoEntry: false });
821:   if ...
gateway · 2026-09-09 04:57:08
result
Found 18 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 286:             ? await fetchLatestNightlyVersion(signal)

  Line 287:             : await fetchLatestFromGitHub(signal);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 399: export async function fetchLatestFromGitHub(

  Line 467: export async function fetchLatestNightlyVersion(

  Line 498: export function fetchLatestVersion(

  Line 503:     return fetchLatestNightlyVersion();

  Line 506:     ? fetchLatestFromGitHub()

  Line 551: export async function versionExists(

  Line 902: export async function downloadBinaryToTemp(

  Line 1122: export async function executeUpgrade(

  Line 1131:       return downloadBinaryToTemp(version, downloadTag, offline, ...
gateway · 2026-09-09 04:57:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 04:57:33
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
810:   channel: ReleaseChannel,
811:   channelChanged: boolean,
812:   version: string | undefined
813: ): void {
814:   if (channelChanged || CHANNEL_VERSIONS.has(version ?? "")) {
815:     setReleaseChannel(channel);
816:   }
817: }
818: 
819: /**
820:  * Start a best-effort changelog fetch in parallel with the binary download.
821:  *
822:  * Returns a promise that resolves to the changelog or undefined. Never
823:  * throws — errors are swallowed so the upgrade is not blocked.
824:  */
825: function startChangelogFetch(
826:   channel: ReleaseChannel,
827:   currentVersion: string,
828:   targetVersion: string,
829:   offline: OfflineMode
830: ): Promise<ChangelogSummary | undefined> {
831:   if (offline || currentVersion === targetVersion) {
832:     return Promise.resolve(undefined);
833:   ...
gateway · 2026-09-09 04:57:50
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 250: export const GITHUB_RELEASES_URL = getGitHubReleasesUrl();


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

  Line 124:     releasesUrl: ...
gateway · 2026-09-09 04:58:10
result
Found 15 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/ghcr.test.ts:
  Line 17:   GHCR_REPO,

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

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

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

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

  Line 569:         expect(String(url)).toContain(`/v2/${GHCR_REPO}/blobs/sha256:abc123`);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: ...
gateway · 2026-09-09 04:59:47
result
token=403 manifest=not-requested
gateway · 2026-09-09 05:00:04
result
doesnotexist123456789=403
toolkit=403
gateway · 2026-09-09 05:01:37
result
No files found
gateway · 2026-09-09 05:01:55
result
Found 63 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 135:   downloadBinaryToTemp,

  Line 137:   fetchLatestFromGitHub,

  Line 139:   fetchLatestNightlyVersion,

  Line 144:   versionExists,

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

  Line 205:     const version = await fetchLatestFromGitHub();

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

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

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

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

  Line 344: // fetchLatestNightlyVersion tests are in ...
gateway · 2026-09-09 05:02:16
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
180:     expect(parseInstallationMethod("YARN")).toBe("yarn");
181:   });
182: 
183:   test("throws on invalid method", () => {
184:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
185:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
186:     expect(() => parseInstallationMethod("")).toThrow("Invalid method: ");
187:   });
188: });
189: 
190: describe("fetchLatestFromGitHub", () => {
191:   test("returns version from GitHub API", async () => {
192:     mockFetch(
193:       async () =>
194:         new Response(
195:           JSON.stringify({
196:             tag_name: "v1.2.3",
197:           }),
198:           {
199:             status: 200,
200:             headers: { "Content-Type": "application/json" },
201:           }
202:         ...
gateway · 2026-09-09 05:02:24
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
530:     expect(version).toBe("0.0.0-dev.1740393600");
531:   });
532: 
533:   test("defaults to stable channel (uses GitHub) when channel omitted", async () => {
534:     mockFetch(
535:       async () =>
536:         new Response(JSON.stringify({ tag_name: "v3.0.0" }), {
537:           status: 200,
538:           headers: { "Content-Type": "application/json" },
539:         })
540:     );
541: 
542:     const version = await fetchLatestVersion("curl");
543:     expect(version).toBe("3.0.0");
544:   });
545: });
546: 
547: describe("versionExists", () => {
548:   test("checks GitHub for curl method - version exists", async () => {
549:     mockFetch(async () => new Response(null, { status: 200 }));
550: 
551:     const exists = await versionExists("curl", "1.0.0");
552:     ...
gateway · 2026-09-09 05:02:37
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1490:   // cleanup is handled inside the upgrade flow under the exclusive lock.
1491: 
1492:   test("does not throw if files do not exist", () => {
1493:     // Ensure files don't exist by attempting cleanup first
1494:     startCleanupOldBinary();
1495: 
1496:     // Should not throw when called again
1497:     expect(() => startCleanupOldBinary()).not.toThrow();
1498:   });
1499: });
1500: 
1501: describe("isNightlyVersion", () => {
1502:   test("returns true for nightly version strings", () => {
1503:     expect(isNightlyVersion("0.0.0-dev.1740000000")).toBe(true);
1504:     expect(isNightlyVersion("0.0.0-dev.1")).toBe(true);
1505:   });
1506: 
1507:   test("returns false for stable version strings", () => {
1508:     expect(isNightlyVersion("1.0.0")).toBe(false);
1509:     ...
gateway · 2026-09-09 05:02:49
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
1588: describe("executeUpgrade with curl method (nightly)", () => {
1589:   const nightlyBinDir = join(TEST_TMP_DIR, "upgrade-nightly-test");
1590:   const nightlyInstallPath = join(nightlyBinDir, "sentry");
1591: 
1592:   function getTestPaths() {
1593:     return getCurlInstallPaths();
1594:   }
1595: 
1596:   beforeEach(() => {
1597:     clearInstallInfo();
1598:     mkdirSync(nightlyBinDir, { recursive: true });
1599:     setInstallInfo({
1600:       method: "curl",
1601:       path: nightlyInstallPath,
1602:       version: "0.0.0",
1603:     });
1604:   });
1605: 
1606:   afterEach(async () => {
1607:     globalThis.fetch = originalFetch;
1608:     const paths = getTestPaths();
1609:     for (const p of [
1610:       paths.installPath,
1611:       paths.tempPath,
1612:       paths.oldPath,
1613:     ...
gateway · 2026-09-09 05:02:59
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 662:   const url = `https://api.github.com/repos/getsentry/cli/commits?sha=main&since=${sinceDate}&until=${untilDate}&per_page=100`;
gateway · 2026-09-09 05:03:15
result
[{"headRefName":"chore/preshape-monorepo","number":1254,"state":"MERGED","title":"chore: pre-shape repo into pnpm-workspace monorepo layout","updatedAt":"2026-07-31T13:58:04Z","url":"https://github.com/getsentry/cli/pull/1254"}]
[]
gateway · 2026-09-09 05:03:30
result
[{"number":1244,"state":"OPEN","title":"toolkit merge: bridge CLI release + dual-source upgrade compatibility","updatedAt":"2026-09-08T19:17:06Z","url":"https://github.com/getsentry/cli/issues/1244"}]
[{"number":1244,"state":"OPEN","title":"toolkit merge: bridge CLI release + dual-source upgrade compatibility","updatedAt":"2026-09-08T19:17:06Z","url":"https://github.com/getsentry/cli/issues/1244"},{"number":1248,"state":"OPEN","title":"Merge sentry-cli + sentry-mcp into getsentry/toolkit monorepo (master)","updatedAt":"2026-09-08T19:20:09Z","url":"https://github.com/getsentry/cli/issues/1248"}]
gateway · 2026-09-09 05:04:59
result
unscoped_token=no
getsentry/toolkit unauth=401 unscoped=n/a
getsentry/doesnotexist123456789 unauth=401 unscoped=n/a
getsentry/cli unauth=401 unscoped=n/a
curl: (22) The requested URL returned error: 403
gateway · 2026-09-09 05:07:13
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 426: export async function fetchWithUpgradeError(
gateway · 2026-09-09 05:07:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
400: 
401:   // 5. XDG-aligned fallback — setup will handle adding this to PATH
402:   return join(homeDir, ".local", "bin");
403: }
404: 
405: /**
406:  * Build headers for GitHub API requests.
407:  */
408: export function getGitHubHeaders(): Record<string, string> {
409:   return {
410:     Accept: "application/vnd.github.v3+json",
411:     "User-Agent": getUserAgent(),
412:   };
413: }
414: 
415: /**
416:  * Fetch wrapper that converts network errors to UpgradeError.
417:  * Handles DNS failures, timeouts, and other connection issues.
418:  *
419:  * @param url - URL to fetch
420:  * @param init - Fetch options
421:  * @param serviceName - Service name for error messages (e.g., "GitHub")
422:  * @returns Response object
423:  * @throws {UpgradeError} On network failure
424:  * @throws {Error} AbortError if ...
gateway · 2026-09-09 05:07:51
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 05:08:05
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
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.
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 05:09:26
result
## feat/toolkit-bridge-upgrade...origin/main
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. ...
gateway · 2026-09-09 05:09:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
80: /**
81:  * Absolute legacy install directories for the given home. See
82:  * {@link LEGACY_INSTALL_SUBDIRS} for why this is scoped to pre-XDG locations.
83:  */
84: export function getLegacyInstallDirs(homeDir: string): string[] {
85:   return LEGACY_INSTALL_SUBDIRS.map((dir) => join(homeDir, dir));
86: }
87: 
88: /**
89:  * How the CLI was installed. Determines the upgrade strategy.
90:  *
91:  * Defined here (alongside other installation constants like
92:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
93:  * `db/install-info.ts` can import it without creating a circular
94:  * dependency. ...
gateway · 2026-09-09 05:10:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 05:10:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 05:10:32
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts</path>
<type>file</type>
<content>
350:   }
351:   if (previousVersion !== opts.targetVersion || !expectedSha256) {
352:     Sentry.getActiveSpan()?.setAttribute(
353:       "telemetry_reason",
354:       "version-mismatch"
355:     );
356:     return null;
357:   }
358: 
359:   const patches = await Promise.all(
360:     digests.map(async (digest) => {
361:       const data = new Uint8Array(
362:         await client.downloadBlobBuffer(opts.token, digest, opts.signal)
363:       );
364:       return { data, size: data.byteLength };
365:     })
366:   );
367:   return {
368:     patches,
369:     totalSize: patches.reduce((sum, patch) => sum + patch.size, 0),
370:     expectedSha256,
371:     steps,
372:   };
373: }
374: 
375: export function applyPatchChain(
376:   chain: PatchChain,
377:   oldBinaryPath: string,
378:   destPath: ...
gateway · 2026-09-09 05:11:25
result
toolkit=401
doesnotexist123456789=401
cli=401
gateway · 2026-09-09 05:11:45
result
toolkit=404
doesnotexist123456789=404
cli=403
gateway · 2026-09-09 05:12:37
result
Found 3 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/pnpm-lock.yaml:
  Line 2169:   binpatch@0.4.2:

  Line 6698:   binpatch@0.4.2: {}


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 111:     "binpatch": "^0.4.2",
gateway · 2026-09-09 05:13:10
result
node:internal/modules/cjs/loader:714
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/node_modules/binpatch/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:314:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:662:9)
    at resolveExports (node:internal/modules/cjs/loader:707:36)
    at Module._findPath (node:internal/modules/cjs/loader:774:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1485:27)
    at wrapResolveFilename (node:internal/modules/cjs/loader:1071:27)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1116:12)
    at require.resolve (node:internal/modules/helpers:171:31)
    at [eval]:1:21
    at runScriptInThisContext (node:internal/vm:219:10) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v24.16.0
gateway · 2026-09-09 05:13:49
result
Found 27 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install:
  Line 54:       "{\"event_id\":\"${event_id}\",\"timestamp\":\"${timestamp}\",\"platform\":\"other\",\"level\":\"error\",\"logger\":\"install\",\"server_name\":\"install-script\",\"message\":{\"formatted\":\"${json_msg}\"},\"tags\":{\"os\":\"${os:-unknown}\",\"arch\":\"${arch:-unknown}\",\"libc\":\"${libc_variant:-glibc}\",\"channel\":\"${json_channel}\",\"step\":\"${json_step}\",\"install.version\":\"${json_version}\"},\"contexts\":{\"runtime\":{\"name\":\"bash\",\"version\":\"${BASH_VERSION:-unknown}\"}}}")

  Line 56:     curl -sf --max-time 2 \

  Line 70:   wait 2>/dev/null || true  # Let the background curl finish; ignore its exit status

  Line 92:     SENTRY_VERSION          Install a specific version (e.g., 0.42.2, nightly)

  Line 96:     curl -fsSL https://cli.sentry.dev/install | bash

  Line 97:     curl -fsSL ...
gateway · 2026-09-09 05:13:59
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
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; then
182:         if [ "$(id -u)" = "0" ]; then
183:           echo -e "${MUTED}Installing required C++ runtime libraries...${NC}"
184:           apk add --no-cache libstdc++ libgcc >/dev/null 2>&1 \
185:             || die "Failed to install libstdc++ and libgcc (required for musl binary)" "deps"
186:         else
187:           echo -e "${RED}Missing required libraries: libstdc++ libgcc${NC}" >&2
188:           echo -e "${RED}Run: apk add libstdc++ libgcc${NC}" >&2
189:           die "Cannot install dependencies without root. Run as root or install manually." "deps"
190:         fi
191:       fi
192:     fi
193:   fi
194: fi
195: 
196: # Validate supported combinations
197: ...
gateway · 2026-09-09 05:14:24
result
Found 100 matches (more matches available)
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 7:     "url": "git+https://github.com/getsentry/cli.git"


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 42:  * getsentry/cli#785 item #10).


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

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

  Line 490:  * - curl/brew on stable: checks GitHub /releases/latest

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/response-cache.ts:
  Line 477:         // Surface cache age for command-level hints ...
gateway · 2026-09-09 05:15:28
result
docs/src/content/docs/configuration.md
docs/src/content/docs/targets/github.md
src/__tests__/versionBump.test.ts
src/commands/__tests__/changelog-versioning-policy.test.ts
src/commands/workspace.ts
src/commands/workspace_cmds
src/commands/workspace_cmds/__tests__
src/commands/workspace_cmds/__tests__/list.test.ts
src/commands/workspace_cmds/list.ts
src/utils/__fixtures__/workspaces
src/utils/__fixtures__/workspaces/no-workspace
src/utils/__fixtures__/workspaces/no-workspace/package.json
src/utils/__fixtures__/workspaces/npm-workspace
src/utils/__fixtures__/workspaces/npm-workspace/package.json
src/utils/__fixtures__/workspaces/npm-workspace/packages
src/utils/__fixtures__/workspaces/npm-workspace/packages/pkg-a
src/utils/__fixtures__/workspaces/npm-workspace/packages/pkg-a/package.json
src/utils/__fixtures__/workspaces/npm-workspace/packages/pkg-b
src/utils/__fixtures__/workspaces/npm-workspace/packages/pkg-b/package.json
src/utils/__fixtures__/workspaces/pnpm-workspace
src/utils/__fix...
gateway · 2026-09-09 05:15:49
result
58-2. For each target that supports version bumping, Craft updates the appropriate project files
59-3. Targets are processed in the order they appear in your configuration
60-4. Each target type is only processed once (e.g., multiple npm targets won't bump `package.json` twice)
61-
62-### Supported Targets
63-
64-| Target    | Detection               | Version Bump Method                                         |
65-| --------- | ----------------------- | ----------------------------------------------------------- |
66:| `npm`     | `package.json` exists   | `npm version --no-git-tag-version` (with workspace support) |
67-| `pypi`    | `pyproject.toml` exists | hatch, poetry, setuptools-scm, or direct edit               |
68-| `crates`  | `Cargo.toml` exists     | `cargo set-version` (requires cargo-edit)                   |
69-| `gem`     | `*.gemspec` exists      | Direct edit of gemspec and `lib/**/version.rb`              |
70-| `pub-dev` | `pubspec.yaml` exists   | Direct edit of ...
gateway · 2026-09-09 05:16:09
result
1----
2-title: GitHub
3-description: Create GitHub releases and tags
4----
5-
6-Creates a release on GitHub. If a Markdown changelog is present, this target reads the release name and description from it.
7-
8-## Configuration
9-
10-| Option | Description |
11-|--------|-------------|
12:| `tagPrefix` | Prefix for new git tags (e.g., `v`). Empty by default. |
13-| `previewReleases` | Automatically detect and create preview releases. Default: `true` |
14-| `tagOnly` | Only create a tag (without a GitHub release). Default: `false` |
15-| `floatingTags` | List of floating tags to create/update. Supports `{major}`, `{minor}`, `{patch}` placeholders. |
16-
17-## Environment Variables
18-
19-| Name | Description |
20-|------|-------------|
21-| `GITHUB_TOKEN` | Personal GitHub API token ([create one](https://github.com/settings/tokens)) |
22-
23-## Example
24-
25-```yaml
26-targets:
27-  - name: github
28:    tagPrefix: v
29-    previewReleases: true
30-```
31-
32-## Floating ...
gateway · 2026-09-09 05:16:30
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml</path>
<type>file</type>
<content>
430:         with:
431:           name: sentry-${{ matrix.target }}-gz
432:           path: packages/cli/dist-bin/*.gz
433: 
434:   generate-patches:
435:     name: Generate Delta Patches
436:     needs: [changes, build-binary]
437:     # Only on main (nightlies) and release branches (stable) — skip PRs
438:     if: github.event_name != 'pull_request'
439:     runs-on: ubuntu-latest
440:     continue-on-error: true
441:     # `from-version`: the previous version the patches were actually generated
442:     # FROM, as computed by the binpatch action. Carried through to
443:     # publish-nightly so it stamps the `from-version` annotation on the
444:     # pushed patch manifest with the SAME value. See
445:     # ...
gateway · 2026-09-09 05:16:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/cleanup-nightlies.yml</path>
<type>file</type>
<content>
1: name: Cleanup Nightly Tags
2: 
3: on:
4:   schedule:
5:     # Every Sunday at 06:00 UTC
6:     - cron: "0 6 * * 0"
7:   workflow_dispatch:
8: 
9: permissions:
10:   packages: write
11: 
12: jobs:
13:   cleanup:
14:     name: Prune Old Nightly Tags
15:     runs-on: ubuntu-latest
16:     steps:
17:       - name: Install ORAS CLI
18:         run: |
19:           VERSION=1.2.3
20:           EXPECTED_SHA256="b4efc97a91f471f323f193ea4b4d63d8ff443ca3aab514151a30751330852827"
21:           TARBALL="oras_${VERSION}_linux_amd64.tar.gz"
22:           curl -sfLo "$TARBALL" "https://github.com/oras-project/oras/releases/download/v${VERSION}/${TARBALL}"
23:           echo "${EXPECTED_SHA256}  ${TARBALL}" | sha256sum -c -
24:           tar -xz -C /usr/local/bin oras < "$TARBALL"
25:           rm "$TARBALL"
26: ...
gateway · 2026-09-09 05:17:02
result
Found 74 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/sentry-release.yml:
  Line 3:   release:

  Line 29:     # Skip pre-releases (nightlies, dev versions) on automatic trigger;

  Line 31:     if: github.event_name == 'workflow_dispatch' || !github.event.release.prerelease

  Line 37:       # matching the Sentry.init() release value and sourcemap uploads.

  Line 38:       VERSION: ${{ github.event.release.tag_name || inputs.version }}

  Line 58:       # The version portion must match Sentry.init({ release }) exactly. ...
gateway · 2026-09-09 05:17:23
result
No files found
gateway · 2026-09-09 05:17:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/release.yml</path>
<type>file</type>
<content>
1: name: Release
2: on:
3:   workflow_dispatch:
4:     inputs:
5:       version:
6:         description: Version to release (or "auto")
7:         required: false
8:       force:
9:         description: Force a release even when there are release-blockers
10:         required: false
11:       merge_target:
12:         description: Target branch to merge into
13:         required: false
14: permissions:
15:   contents: write
16:   pull-requests: write
17: 
18: env:
19:   # Pin Node to an exact patched version (single source of truth). A floating
20:   # "22" can reuse the runner's pre-cached 22.23.0, which carries the
21:   # ERR_STREAM_PREMATURE_CLOSE regression on keep-alive fetch reuse
22:   # (nodejs/node#64004, fixed in 22.23.1).
23:   NODE_VERSION_22: "22.23.1"
24: 
25: jobs:
26:   release:
27:     runs-on: ...
gateway · 2026-09-09 05:17:45
result
0e661a5f5 fix(org): log region URL parse failures in org list (#1539)
9d0901b10 feat(local): Add agent debugging stream (#1538)
72c307f47 fix(cli): log UID resolution failures in sentry cli fix (#1541)
e710ce905 fix(telemetry): log process-tree walk failures in agent detection (#1542)
6e3e7e13a feat(config): follow XDG Base Directory spec for config location (#1503)
17e110300 fix(init): stop recording skipped verification as an error (#1544)
c0c9c8274 fix(docs): Explain regional model unavailability (#1537)
2d2fbffb6 fix(init): gate unsupported --features and tag dry-run runs (#1535)
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
gateway · 2026-09-09 05:18:42
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/AGENTS.md</path>
<type>file</type>
<content>
1: # Jared (Outpost agent)
2: 
3: Autonomous GitHub coding agent. Work in `/workspace/repo`.
4: 
5: ## Model tiers
6: 
7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for
8: code-producing situations, cheaper for lightweight ones.
9: 
10: | Role | Subagent | Model |
11: | --- | --- | --- |
12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 |
13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 |
14: | Explore | `explore` | OpenAI gpt-5-mini |
15: | Implement | `implement` | Moonshot kimi-k2.7-code |
16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) |
17: 
18: Pipeline: triage → explore → plan → implement → review → ship.
19: (`worker` is a deprecated alias of `implement`.)
20: 
21: Operators also talk to Jared directly from the Outpost dashboard. ...
gateway · 2026-09-09 05:19:02
result
File not found: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/CONTRIBUTING.md
gateway · 2026-09-09 05:19:13
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/apps/cli-docs/src/content/docs/contributing.md
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/CONTRIBUTING.md
gateway · 2026-09-09 05:19:37
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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)* - ...
gateway · 2026-09-09 05:19:54
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:01a02357-f0a8-7fdb-9e9d-b0710cfe65c9 -->
8: * **API output binary and HTTP contracts**: Always preserve strict output-mode and binary-safety contracts. `sentry api` must preserve `rawApiRequest()` status text; empty textual non-2xx bodies must produce an HTTP status/request fallback, and JSON mode must expose `{status, statusText, body}` so empty success and error responses are distinguishable. Binary `Uint8Array` successes bypass formatters and remain raw; binary errors emit only status/content-type/byte-count summaries, never bytes or JSON coercion. Prompts must never block scripted runs or interleave with stdout JSON.
9: 
10: <!-- ...
gateway · 2026-09-09 05:20:11
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 05:20:33
result
No files found
gateway · 2026-09-09 05:20:45
result
No files found
gateway · 2026-09-09 05:21:05
result
No files found
gateway · 2026-09-09 05:21:31
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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:   closeSync,
13:   existsSync,
14:   openSync,
15:   realpathSync,
16:   statSync,
17:   unlinkSync,
18:   writeSync,
19: } from "node:fs";
20: import { writeFile } from "node:fs/promises";
21: import { homedir } from "node:os";
22: import { dirname, isAbsolute, join, sep } from "node:path";
23: import { setTimeout } from "node:timers/promises";
24: import {
25:   acquireLock,
26:   cleanupOldBinary,
27:   determineInstallDir,
28:   fetchWithUpgradeError,
29:   ...
gateway · 2026-09-09 05:21:43
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts</path>
<type>file</type>
<content>
710: function getNightlyGzFilename(): string {
711:   return `${getPlatformBinaryName()}.gz`;
712: }
713: 
714: /**
715:  * Download a nightly binary from GHCR and decompress it to `destPath`.
716:  *
717:  * Fetches an anonymous token, retrieves the OCI manifest, finds the layer
718:  * matching this platform's `.gz` filename, then downloads and decompresses
719:  * the blob in-stream.
720:  *
721:  * When `version` is provided, fetches the pinned versioned tag
722:  * (`nightly-{version}`). Otherwise fetches the rolling `:nightly` tag. ...
gateway · 2026-09-09 05:22:10
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 05:22:34
result
Found 19 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 165: async function resolveTargetWithFallback(opts: {

  Line 183:     if (resolveOpts.channelChanged && !versionArg) {

  Line 264:   channelChanged: boolean;

  Line 288:   const { method, channel, versionArg, channelChanged, flags } = opts;

  Line 306:   if (CLI_VERSION === target && !flags.force && !channelChanged) {

  Line 642:       executeUpgrade(method, target, downloadTag, offline, setMessage)

  Line 727:       executeUpgrade("curl", target, downloadTag, undefined, setMessage)

  Line 791:   channelChanged: boolean;

  Line 796:   const channelChanged = channel !== currentChannel;

  Line 800:   return { channel, versionArg, channelChanged, method };

  Line 811:   channelChanged: boolean,

  Line 814:   if (channelChanged || CHANNEL_VERSIONS.has(version ?? ...
gateway · 2026-09-09 05:22:48
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
600:     return xdgInstallDir;
601:   }
602:   return currentInstallDir;
603: }
604: 
605: /**
606:  * Execute the standard upgrade path: download via curl or package manager,
607:  * then run setup on the new binary.
608:  */
609: async function executeStandardUpgrade(opts: {
610:   method: InstallationMethod;
611:   channel: ReleaseChannel;
612:   versionArg: string | undefined;
613:   target: string;
614:   execPath: string;
615:   entryPath?: string;
616:   pathEnv?: string;
617:   offline?: OfflineMode;
618:   json?: boolean;
619:   noAgentSkills: boolean;
620: }): Promise<void> {
621:   const {
622:     method,
623:     channel,
624:     versionArg,
625:     target,
626:     execPath,
627:     entryPath,
628:     pathEnv,
629:     offline,
630:     json,
631:     noAgentSkills,
632:   } = ...
gateway · 2026-09-09 05:23:01
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts</path>
<type>file</type>
<content>
780: /**
781:  * Resolve the channel, version arg, method, and channel-changed flag from
782:  * the positional version argument and flags. Extracted to keep `func()`
783:  * complexity under the biome limit.
784:  */
785: async function resolveContext(
786:   version: string | undefined,
787:   flags: UpgradeFlags
788: ): Promise<{
789:   channel: ReleaseChannel;
790:   versionArg: string | undefined;
791:   channelChanged: boolean;
792:   method: InstallationMethod;
793: }> {
794:   const { channel, versionArg } = resolveChannelAndVersion(version);
795:   const currentChannel = getReleaseChannel();
796:   const channelChanged = channel !== currentChannel;
797: 
798:   const method = flags.method ?? (await detectInstallationMethod());
799:   validateMethod(method, versionArg, channel, ...
gateway · 2026-09-09 05:23:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-09 05:23:36
result
Found 22 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:
  Line 136:  * fallback when `fetchLatestVersion()` hits a network error.

  Line 289:   const latest = await fetchLatestVersion(method, channel);

  Line 325:     const exists = await versionExists(lookupMethod, target);

  Line 642:       executeUpgrade(method, target, downloadTag, offline, setMessage)

  Line 727:       executeUpgrade("curl", target, downloadTag, undefined, setMessage)

  Line 834:   return fetchChangelog({


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/version-check.ts:
  Line 237:       await prefetchNightlyPatches(latestVersion, signal);

  Line 239:       await prefetchStablePatches(latestVersion, signal);

  Line 286:             ? ...
gateway · 2026-09-09 05:23:56
result
{"body":"Sub-task of the toolkit monorepo merge: getsentry/cli#1248.\n\n## Goal\n\nShip one stable **bridge CLI release from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`**. The bridge release must remain usable before the Toolkit rename and must discover releases from Toolkit after the rename. Older binaries must continue upgrading through the legacy endpoints.\n\nThis is a hard prerequisite for the repository merge.\n\n## Ordered source contract\n\n- New binaries and the install script always check the ordered source list:\n  1. `getsentry/toolkit` / `ghcr.io/getsentry/toolkit`\n  2. `getsentry/cli` / `ghcr.io/getsentry/cli`\n- Fall through to the next source only on HTTP 404. Network and fetch failures remain transient errors; they never poison a source.\n- Use one shared source definition for TypeScript and the generated install script. A check must fail if the two lists or their ordering diverge.\n- Old binaries only know `getsentry/cli`, so every ...
gateway · 2026-09-09 05:24:17
result
Found 26 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json:
  Line 55:     "dev": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && tsx --import ./script/require-shim.mjs src/bin.ts",

  Line 56:     "build": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts --single",

  Line 57:     "build:all": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts",

  Line 58:     "bundle": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/bundle.ts",

  Line 59:     "typecheck": "pnpm run generate:docs && pnpm run generate:sdk && tsc --noEmit",

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

  Line 61:     "lint:fix": "biome check --write --no-errors-on-unmatched ...
gateway · 2026-09-09 05:24:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/package.json</path>
<type>file</type>
<content>
45:   "devEngines": {
46:     "runtime": {
47:       "name": "node",
48:       "version": ">=22.15"
49:     }
50:   },
51:   "packageManager": "pnpm@10.11.0",
52:   "scripts": {
53:     "tsx": "tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs",
54:     "cli": "tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs src/bin.ts",
55:     "dev": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && tsx --import ./script/require-shim.mjs src/bin.ts",
56:     "build": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts --single",
57:     "build:all": "pnpm run generate:schema && pnpm run generate:docs && pnpm run generate:sdk && pnpm tsx script/build.ts",
58:     "bundle": "pnpm run generate:schema && pnpm ...
gateway · 2026-09-09 05:24:59
result
BinpatchError
MAX_NIGHTLY_CHAIN_DEPTH
MAX_OUTPUT_SIZE
MAX_STABLE_CHAIN_DEPTH
OciClient
PATCH_TAG_PREFIX
SIZE_THRESHOLD_RATIO
addDiffChunk
applyPatch
applyPatchChainInMemory
applyPatchToMemory
chainFileName
extractSha256
extractStableChain
filterAndSortChainTags
getPatchFromVersion
getPatchTargetSha256
getStableTargetSha256
ghcrSource
githubReleaseSource
makeCache
offtin
parsePatchHeader
patchFileName
resolveAndApply
safeProgress
validateChainStep
gateway · 2026-09-09 05:25:16
result
No files found
gateway · 2026-09-09 05:25:38
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch
total 20
drwxr-xr-x 1 byk byk   64 Sep  8 20:35 .
drwxr-xr-x 1 byk byk   16 Sep  8 20:35 ..
drwxr-xr-x 1 byk byk   60 Sep  8 20:35 dist
-rw-r--r-- 1 byk byk 1073 Sep  8 20:35 LICENSE
-rw-r--r-- 1 byk byk 1329 Sep  8 20:35 package.json
-rw-r--r-- 1 byk byk 8574 Sep  8 20:35 README.md
gateway · 2026-09-09 05:26:01
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js
gateway · 2026-09-09 05:26:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts</path>
<type>file</type>
<content>
1: /**
2:  * Streaming TRDIFF10 Binary Patch Application
3:  *
4:  * Implements the bspatch algorithm for applying binary delta patches in the
5:  * TRDIFF10 format (produced by zig-bsdiff with `--use-zstd`). Designed for
6:  * minimal memory usage during CLI self-upgrades:
7:  *
8:  * - Old binary: read windows on demand via positional `read()` (`pread`)
9:  *   through a single-block read-ahead cache, so the base never sits fully in
10:  *   the JS heap — only the windows actually referenced are pulled in, served
11:  *   from the OS page cache populated by the reflink copy.
12:  * - Diff/extra blocks: streamed via `node:zlib` `createZstdDecompress()`
13:  * - Output: written incrementally to disk via `fs.openSync` + `fs.writeSync`
14:  *   with the fd `closeSync`'d ...
gateway · 2026-09-09 05:26:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.d.ts</path>
<type>file</type>
<content>
510: /** Configuration for {@link ghcrSource}. */
511: type GhcrSourceConfig = OciClientConfig & {
512:     /** Platform binary name, e.g. `lore-linux-x64` (used for layer/annotation keys). */
513:     binaryName: string;
514:     /**
515:      * Map a target version to the OCI tag of its full image manifest, whose
516:      * `<binaryName>.gz` layer size feeds the ratio gate, e.g.
517:      * `(v) => `nightly-${v}``.
518:      */
519:     targetTag: (version: string) => string;
520:     /** Version comparator (semver-aware), for ordering patch tags. */
521:     compareVersions: (a: string, b: string) => -1 | 0 | 1;
522:     /**
523:      * Optional per-HTTP-step instrumentation hook. ...
gateway · 2026-09-09 05:27:04
result
Found 10 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js:
  Line 688:   const chain = await source.resolveChain(

  Line 1133:     async resolveChain(currentVersion, targetVersion, signal, report) {

  Line 1191:   const targetIdx = releases.findIndex((r) => r.tag_name === targetVersion);

  Line 1192:   const currentIdx = releases.findIndex((r) => r.tag_name === currentVersion);

  Line 1220:     steps.push({ fromVersion: prevVersion, toVersion: release.tag_name });

  Line 1221:     prevVersion = release.tag_name;

  Line 1227:   const { releasesUrl, binaryName, userAgent } = config;

  Line 1235:         () => doFetch(`${releasesUrl}?per_page=${perPage}`, {

  Line 1266:     async resolveChain(currentVersion, targetVersion, signal, report) {

  Line 1272:       const targetRelease = releases.find((r) => r.tag_name === targetVersion);
gateway · 2026-09-09 05:27:19
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
1170:   };
1171: }
1172: 
1173: // src/sources/github-release.ts
1174: var SHA256_DIGEST_PATTERN = /^sha256:([0-9a-f]+)$/i;
1175: function extractSha256(asset) {
1176:   if (!asset.digest) return null;
1177:   const match = SHA256_DIGEST_PATTERN.exec(asset.digest);
1178:   return match ? match[1]?.toLowerCase() ?? null : null;
1179: }
1180: function getStableTargetSha256(release, binaryName) {
1181:   const binaryAsset = release.assets.find((a) => a.name === binaryName);
1182:   if (!binaryAsset) return null;
1183:   return extractSha256(binaryAsset);
1184: }
1185: function isStableChainFailure(v) {
1186:   return "failure" in v;
1187: }
1188: function extractStableChain(opts) {
1189:   const { releases, currentVersion, targetVersion, binaryName, fullGzSize } = opts;
1190: ...
gateway · 2026-09-09 05:27:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, sep } 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:   getLegacyInstallDirs,
29:   getPlatformBinaryName,
30:   installBinary,
31:   ...
gateway · 2026-09-09 05:28:35
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts:
  Line 436:     const version = r.tag_name.replace(VERSION_PREFIX_RE, "");
gateway · 2026-09-09 05:28:55
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
405:   const merged: ChangeSection[] = [];
406:   for (const category of CATEGORY_ORDER) {
407:     const markdowns = sectionsByCategory.get(category);
408:     if (markdowns && markdowns.length > 0) {
409:       merged.push({ category, markdown: markdowns.join("\n") });
410:     }
411:   }
412: 
413:   return merged;
414: }
415: 
416: /**
417:  * Build a changelog summary from a list of GitHub releases.
418:  *
419:  * Filters releases within the version range (exclusive `fromVersion`,
420:  * inclusive `toVersion`), extracts and merges sections by category, and
421:  * optionally truncates to fit terminal constraints. ...
gateway · 2026-09-09 05:29:11
result
Found 49 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts:
  Line 24:   fetchRecentReleases,

  Line 32:   prefetchNightlyPatches,

  Line 33:   prefetchStablePatches,

  Line 34:   resolveNightlyChain,

  Line 35:   resolveNightlyDelta,

  Line 36:   resolveStableChain,

  Line 37:   resolveStableDelta,

  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 891: // resolveStableChain (async orchestrator)

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

  Line 947:     const chain = await resolveStableChain("0.13.0", "0.14.0");

  Line 1000:     const chain = await resolveStableChain("0.13.0", "0.15.0");

  Line 1018:     const chain = await ...
gateway · 2026-09-09 05:29:22
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/delta-upgrade.test.ts</path>
<type>file</type>
<content>
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:     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 ...
gateway · 2026-09-09 05:29:43
result
node:internal/modules/esm/resolve:271
    throw new ERR_MODULE_NOT_FOUND(
          ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/constants.js' imported from /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts
    at finalizeResolution (node:internal/modules/esm/resolve:271:11)
    at moduleResolve (node:internal/modules/esm/resolve:865:10)
    at defaultResolve (node:internal/modules/esm/resolve:992:11)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:691:20)
    at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:708:38)
    at ModuleLoader.resolveSync (node:internal/modules/esm/loader:740:52)
    at #resolve (node:internal/modules/esm/loader:673:17)
    at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:593:35)
    ...
gateway · 2026-09-09 05:30:03
result
> sentry@0.45.0-dev.0 tsx /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli
> tsx --env-file-if-exists=.env.local --import ./script/require-shim.mjs -e "import {compareVersions} from './src/lib/binary.ts'; for (const p of [['cli@0.45.0','0.44.0'],['cli@0.45.0','0.45.0'],['cli@1.0.0','mcp@2.0.0']] as const) { try { console.log(p.join(' vs '), compareVersions(p[0],p[1])); } catch(e) { console.log(p.join(' vs '), (e as Error).name, (e as Error).message); }}"

cli@0.45.0 vs 0.44.0 TypeError Invalid Version: cli@0.45.0
cli@0.45.0 vs 0.45.0 TypeError Invalid Version: cli@0.45.0
cli@1.0.0 vs mcp@2.0.0 TypeError Invalid Version: cli@1.0.0
.env.local not found. Continuing without it.
.env.local not found. Continuing without it.
gateway · 2026-09-09 05:30:18
result
38- * @see https://docs.github.com/rest/releases/releases#create-a-release
39- */
40-export const GITHUB_RELEASE_BODY_MAX = 125_000;
41-
42-/** GitHub target configuration fields */
43-interface GitHubConfigFields extends Record<string, unknown> {
44-  owner?: string;
45-  repo?: string;
46:  tagPrefix?: string;
47-  tagOnly?: boolean;
48-  previewReleases?: boolean;
49-  floatingTags?: string[];
50-}
51-
52-/**
53- * Configuration options for the GitHub target.
54- */
55-export interface GitHubTargetConfig extends GitHubGlobalConfig {
56-  /** Path to changelog inside the repository */
57-  changelog: string;
58-  /** Prefix that will be used to generate tag name */
59:  tagPrefix: string;
60-  /** Mark release as pre-release, if the version looks like a non-public release */
61-  previewReleases: boolean;
62-  /** Do not create a full GitHub release, only push a git tag */
63-  tagOnly: boolean;
64-  /**
65-   * Floating tags to create/update when publishing a release. ...
gateway · 2026-09-09 05:30:32
result
Found 2 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 766:   const url = getBinaryDownloadUrl(version);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 234: export function getBinaryDownloadUrl(
gateway · 2026-09-09 05:30:45
result
Found 9 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:
  Line 29:   GITHUB_RELEASES_URL,

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

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


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 250: export const GITHUB_RELEASES_URL = getGitHubReleasesUrl();


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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/toolkit-bridge-upgrade/packages/cli/src/lib/delta-upgrade.ts:
  Line 35:   GITHUB_RELEASES_URL,

  Line 124:     releasesUrl: ...
gateway · 2026-09-09 05:30:56
result
Found 15 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/ghcr.test.ts:
  Line 17:   GHCR_REPO,

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

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

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

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

  Line 569:         expect(String(url)).toContain(`/v2/${GHCR_REPO}/blobs/sha256:abc123`);


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: ...
gateway · 2026-09-09 05:32:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
780:  *
781:  * @param error - Any thrown value
782:  * @returns Formatted error string
783:  */
784: export function formatError(error: unknown): string {
785:   if (error instanceof CliError) {
786:     return error.format();
787:   }
788:   return stringifyUnknown(error);
789: }
790: 
791: /**
792:  * Get process exit code for an error.
793:  *
794:  * @param error - Any thrown value
795:  * @returns Exit code (from CliError.exitCode or 1 for other errors)
796:  */
797: export function getExitCode(error: unknown): number {
798:   if (error instanceof CliError) {
799:     return error.exitCode;
800:   }
801:   return 1;
802: }
803: 
804: /**
805:  * Sentry's search-query parser emits a 400 whose detail begins with this phrase
806:  * when the user's `--query` cannot be parsed (e.g. ...
gateway · 2026-09-09 05:33:02
result
Found 5 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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-09 05:33:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
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.
596:  *
597:  * @param reason - Type of upgrade failure
598:  * @param message - Custom message (uses default if not provided)
599:  */
600: export class UpgradeError extends CliError {
601:   readonly reason: UpgradeErrorReason;
602: 
603:   constructor(reason: UpgradeErrorReason, message?: ...
gateway · 2026-09-09 05:33:29
result
Found 13 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js:
  Line 794:     throw new BinpatchError(

  Line 809:       throw new BinpatchError(

  Line 816:       throw new BinpatchError(

  Line 824:   async fetchManifest(token, tag, signal) {

  Line 839:       throw new BinpatchError(

  Line 863:       throw new BinpatchError(

  Line 904:       throw new BinpatchError(

  Line 913:         throw new BinpatchError(

  Line 930:         throw new BinpatchError(

  Line 936:         throw new BinpatchError(

  Line 943:     throw new BinpatchError(

  Line 1074:             () => client.fetchManifest(token, tag, signal)

  Line 1139:             () => client.fetchManifest(token, targetTag(targetVersion), signal)
gateway · 2026-09-09 05:33:40
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
760: function buildSignal(timeout, externalSignal) {
761:   const timeoutSignal = AbortSignal.timeout(timeout);
762:   return externalSignal ? AbortSignal.any([timeoutSignal, externalSignal]) : timeoutSignal;
763: }
764: function isExternalAbort(error, externalSignal) {
765:   return Boolean(externalSignal?.aborted && error.name === "AbortError");
766: }
767: var OciClient = class {
768:   registry;
769:   repo;
770:   userAgent;
771:   fetch;
772:   constructor(config) {
773:     this.registry = config.registry;
774:     this.repo = config.repo;
775:     this.userAgent = config.userAgent;
776:     this.fetch = config.fetch ?? fetch;
777:   }
778:   async fetchWithRetry(url, init, context, options) {
779:     const timeout = options?.timeout ?? ...
gateway · 2026-09-09 05:33:57
result
Found 38 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js:
  Line 99:     } catch {

  Line 103:     } catch {

  Line 227:     } catch {

  Line 229:     await unlink(this.tempPath).catch(() => {

  Line 243:   } catch {

  Line 245:       await handle.close().catch(() => {

  Line 248:     await unlink(tempCopy).catch(() => {

  Line 341:         } catch (err) {

  Line 353:     } catch (err) {

  Line 460:   } catch (err) {

  Line 473:       } catch {

  Line 527:       } catch (err) {

  Line 552:       } catch {

  Line 553:         await unlink(join(cacheDir, file)).catch(() => {

  Line 574:         deletions.push(unlink(join(cacheDir, name)).catch(() => {

  Line 581:       ).catch(() => {

  Line 591:   } catch (err) {

  Line 601:   } catch (err) {

  Line 606:     files.map((file) => unlink(join(cacheDir, file)).catch(() => {

  Line 648:    ...
gateway · 2026-09-09 05:34:18
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/node_modules/.pnpm/binpatch@0.4.2/node_modules/binpatch/dist/index.js</path>
<type>file</type>
<content>
1025:     }
1026:     digests.push(result.digest);
1027:     totalSize += result.size;
1028:     prevVersion = tag.slice(PATCH_TAG_PREFIX.length);
1029:     if (i === manifests.length - 1) {
1030:       if (prevVersion !== targetVersion) return { failure: "malformed_chain" };
1031:       const sha256 = getPatchTargetSha256(manifest, binaryName) ?? "";
1032:       if (!sha256) return { failure: "malformed_chain" };
1033:       return { digests, totalSize, expectedSha256: sha256 };
1034:     }
1035:   }
1036:   return { failure: "malformed_chain" };
1037: }
1038: function ghcrSource(config) {
1039:   const { binaryName, targetTag, compareVersions } = config;
1040:   const client = new OciClient(config);
1041:   const patchLayerName = `${binaryName}.patch`;
1042:   const i = ...
gateway · 2026-09-09 05:34:29
result
No files found
gateway · 2026-09-09 05:37:17
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 05:37:30
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/install</path>
<type>file</type>
<content>
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; then
182:         if [ "$(id -u)" = "0" ]; then
183:           echo -e "${MUTED}Installing required C++ runtime libraries...${NC}"
184:           apk add --no-cache libstdc++ libgcc >/dev/null 2>&1 \
185:             || die "Failed to install libstdc++ and libgcc (required for musl binary)" "deps"
186:         else
187:           echo -e "${RED}Missing required libraries: libstdc++ libgcc${NC}" >&2
188:           echo -e "${RED}Run: apk add libstdc++ libgcc${NC}" >&2
189:           die "Cannot install dependencies without root. Run as root or install manually." "deps"
190:         fi
191:       fi
192:     fi
193:   fi
194: fi
195: 
196: # Validate supported combinations
197: ...
gateway · 2026-09-09 05:38:00
result
diff --git a/packages/cli/src/lib/binary.ts b/packages/cli/src/lib/binary.ts
index 75582612a..a50bc0949 100644
--- a/packages/cli/src/lib/binary.ts
+++ b/packages/cli/src/lib/binary.ts
@@ -102,6 +102,33 @@ export type InstallationMethod =
   | "yarn"
   | "unknown";
 
+/** A repository pair that hosts CLI stable releases and nightly OCI images. */
+export type UpgradeSource = {
+  /** GitHub `owner/repository` containing CLI release assets. */
+  readonly githubRepo: string;
+  /** GHCR `owner/package` containing CLI nightly images and delta patches. */
+  readonly ghcrRepo: string;
+  /** Prefix attached to CLI release tags in this repository. */
+  readonly tagPrefix: string;
+};
+
+/** Ordered CLI release sources. The resolver falls through only on HTTP 404. ...
gateway · 2026-09-09 05:38:21
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 05:38:45
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/release-notes.ts</path>
<type>file</type>
<content>
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.
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 05:39:02
result
Found 24 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/binary.test.ts:
  Line 34:   resolveUpgradeSource,

  Line 72:         tagPrefix: "cli@",

  Line 77:         tagPrefix: "",

  Line 83: describe("resolveUpgradeSource", () => {

  Line 87:     const resolved = await resolveUpgradeSource(async (url) => {

  Line 106:     const resolved = await resolveUpgradeSource(async (url) => {

  Line 129:         resolveUpgradeSource(async (url) => {

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

  Line 160:       resolveUpgradeSource(async (url) => {


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 106: export type UpgradeSource = {

  Line 112:   readonly tagPrefix: string;

  Line 116: export const UPGRADE_SOURCES: readonly UpgradeSource[] = [

  Line 120:     tagPrefix: "cli@",

  Line 125:     ...
gateway · 2026-09-09 05:39:34
result
5-
6-import { logger } from '../logger';
7-
8-/**
9- * Check if an error is a "file not found" error
10- */
11-function isNotFoundError(err: unknown): boolean {
12-  return err instanceof Error && 'code' in err && err.code === 'ENOENT';
13-}
14-
15:/** Information about a workspace package */
16-export interface WorkspacePackage {
17-  /** The package name from package.json */
18-  name: string;
19-  /** Absolute path to the package directory */
20-  location: string;
21-  /** Whether the package is private */
22-  private: boolean;
23-  /** Whether the package has publishConfig.access set to 'public' */
24-  hasPublicAccess: boolean;
25:  /** Dependencies that are also workspace packages */
26:  workspaceDependencies: string[];
27-}
28-
29:/** Result of workspace discovery */
30-export interface WorkspaceDiscoveryResult {
31:  /** The type of workspace manager detected */
32-  type: 'npm' | 'yarn' | 'pnpm' | 'none';
33-  /** List of discovered packages */
34-  packages: ...
gateway · 2026-09-09 05:39:58
result
src/commands/workspace.ts
src/commands/workspace_cmds
src/commands/workspace_cmds/__tests__
src/commands/workspace_cmds/__tests__/list.test.ts
src/commands/workspace_cmds/list.ts
src/utils/__fixtures__/workspaces
src/utils/__fixtures__/workspaces/no-workspace
src/utils/__fixtures__/workspaces/no-workspace/package.json
src/utils/__fixtures__/workspaces/npm-workspace
src/utils/__fixtures__/workspaces/npm-workspace/package.json
src/utils/__fixtures__/workspaces/npm-workspace/packages
src/utils/__fixtures__/workspaces/npm-workspace/packages/pkg-a
src/utils/__fixtures__/workspaces/npm-workspace/packages/pkg-a/package.json
src/utils/__fixtures__/workspaces/npm-workspace/packages/pkg-b
src/utils/__fixtures__/workspaces/npm-workspace/packages/pkg-b/package.json
src/utils/__fixtures__/workspaces/pnpm-workspace
src/utils/__fixtures__/workspaces/pnpm-workspace/package.json
src/utils/__fixtures__/workspaces/pnpm-workspace/packages
src/utils/__fixtures__/workspaces/pnpm-workspace/packages/pkg-a
src...
gateway · 2026-09-09 05:40:27
result
docs/astro.config.mjs
docs/src/content.config.ts
docs/src/content/docs/configuration.md
docs/tsconfig.json
eslint.config.mjs
src/__tests__/config.test.ts
src/commands/config.ts
src/config.ts
src/schemas
src/schemas/project_config.ts
src/types
src/types/mustache.d.ts
src/types/split.d.ts
tsconfig.build.json
tsconfig.json
vitest.config.mts
gateway · 2026-09-09 05:40:58
result
47- * The default prefix for the release branch.
48- */
49-export const DEFAULT_RELEASE_BRANCH_NAME = 'release';
50-
51-/**
52- * Cached path to the configuration file
53- */
54-let _configPathCache: string;
55-
56-/**
57- * Cached configuration
58- */
59-let _configCache: CraftProjectConfig;
60-
61-/**
62: * The minimum craft version required to use the top-level `workspaces` config.
63- *
64: * This is the release the workspaces feature ships in. A dev build of that
65- * release (e.g. `2.29.0-dev.0`) satisfies it via the pre-release relaxation in
66- * `checkMinimalConfigVersion`.
67- */
68-export const WORKSPACES_MIN_VERSION = '2.29.0';
69-
70-/**
71: * The name of the currently-selected workspace, or undefined for the default
72- * (single implicit release unit). Set once via `setActiveWorkspace` from the
73: * `--workspace` CLI option / `CRAFT_WORKSPACE` env before any config access. ...
gateway · 2026-09-09 05:41:23
result
1-import { z } from 'zod';
2-import { hasMagic } from 'glob';
3-
4-/**
5: * DEPRECATED: Use changelog.policy instead. Different policies for changelog management
6- */
7-export const enum ChangelogPolicy {
8-  Auto = 'auto',
9-  Simple = 'simple',
10-  None = 'none',
11-}
12-
13-/**
14- * Name of the status provider
15- */
16-export const enum StatusProviderName {
17-  GitHub = 'github',
18-}
19-
20-/**
21- * Name of the artifact provider
--
31- * auto: analyze commits to determine bump type
32- * manual: require explicit version
33- * calver: use calendar versioning
34- */
35-export const enum VersioningPolicy {
36-  Auto = 'auto',
37-  Manual = 'manual',
38-  CalVer = 'calver',
39-}
40-
41-/**
42- * Global (non-target!) GitHub configuration for the project
43- */
44-export const GitHubGlobalConfigSchema = z.object({
45-  owner: z.string(),
46-  repo: z.string(),
47:  projectPath: z.string().optional(),
48-});
49-
50-export type GitHubGlobalConfig = z.infer<typeof ...
gateway · 2026-09-09 05:41:42
result
 M packages/cli/src/lib/binary.ts
 M packages/cli/test/lib/binary.test.ts
 M packages/cli/test/lib/ghcr.test.ts
 M packages/cli/test/lib/install-script.test.ts
 packages/cli/src/lib/binary.ts               |  88 +++++++++++++++++++--
 packages/cli/test/lib/binary.test.ts         | 109 +++++++++++++++++++++++++++
 packages/cli/test/lib/ghcr.test.ts           |  30 ++++++++
 packages/cli/test/lib/install-script.test.ts |  10 +++
 4 files changed, 232 insertions(+), 5 deletions(-)
gateway · 2026-09-09 05:42:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 05:42:57
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/tsconfig.json</path>
<type>file</type>
<content>
1: {
2:   "compilerOptions": {
3:     "lib": ["ESNext"],
4:     "target": "ESNext",
5:     "module": "ESNext",
6:     "jsx": "react-jsx",
7:     "moduleDetection": "force",
8:     "allowJs": true,
9:     "moduleResolution": "bundler",
10:     "allowImportingTsExtensions": true,
11:     "verbatimModuleSyntax": true,
12:     "noEmit": true,
13:     "resolveJsonModule": true,
14:     "strict": true,
15:     "skipLibCheck": true,
16:     "noFallthroughCasesInSwitch": true,
17:     "noUncheckedIndexedAccess": true,
18:     "noImplicitOverride": true,
19:     "esModuleInterop": true,
20:     "forceConsistentCasingInFileNames": true,
21:     "noUnusedLocals": false,
22:     "noUnusedParameters": false,
23:     "noPropertyAccessFromIndexSignature": false,
24:     "strictNullChecks": true
25:   },
26:   "include": ...
gateway · 2026-09-09 05:43:16
result
docs/src/content/docs/github-actions.md
src/commands/__tests__/publish.test.ts
src/commands/publish.ts
src/utils/__tests__/publishState.test.ts
src/utils/publishState.ts
gateway · 2026-09-09 05:43:30
result
1----
2:title: GitHub Actions
3-description: Automate releases and changelog previews with Craft GitHub Actions
4----
5-
6-Craft provides GitHub Actions for automating releases and previewing changelog entries in pull requests.
7-
8:For a real-world example of using Craft's GitHub Actions, see the [getsentry/publish](https://github.com/getsentry/publish) repository.
9-
10-## Prepare Release
11-
12-Craft offers two ways to automate releases in GitHub Actions:
13-
14-| Option                | Best For                           | Flexibility                        |
15-| --------------------- | ---------------------------------- | ---------------------------------- |
16-| **Reusable Workflow** | Quick setup, standard release flow | Low - runs as a complete job       |
17-| **Composite Action**  | Custom workflows, pre/post steps   | High - composable with other steps |
18-
19-### Option 1: Reusable Workflow (Recommended)
20-
--
36-      version: ${{ inputs.version }}
37-    secrets: ...
gateway · 2026-09-09 05:43:57
result
Found 11 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.lore.md:
  Line 338: * **CI Node version pinning: centralized env block per workflow file, ternary for matrix jobs**: Node CVE-2026-48931 fix: \`NODE\_VERSION\_22="22.23.1"\`, \`NODE\_VERSION\_24="24.18.0"\` (22.23.0 had the vulnerability; fix landed in 22.23.1 via nodejs/node#64004). Pattern: add top-level \`env:\` block to each workflow file (ci.yml, release.yml, sentry-release.yml, docs-preview.yml) with both constants + rationale comment. Reference via \`${{ env.NODE\_VERSION\_22 }}\`. Matrix jobs (build-npm) use ternary: \`${{ matrix.node == '24' && env.NODE\_VERSION\_24 || env.NODE\_VERSION\_22 }}\` — matrix labels stay as bare majors (\`\["22","24"]\`) for job naming. Gotcha: \`eval-skill-fork.yml\` has no \`setup-node\` step at all — must add one explicitly \[\[019f03bb-f9cf-7208-a183-d4f0074480f9]]. ...
gateway · 2026-09-09 05:44:23
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.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:         - 'vercel'
16: targets:
17:   - name: npm
18:   - name: github
19:   - name: vercel
20:     projectId: prj_wVkOnIwI3eIQbGD1Gw7qS1MqFFIK
21:   - name: registry
22:     apps:
23:       'app:sentry':
24:         name: 'Sentry CLI'
25:         packageUrl: 'https://www.npmjs.com/package/sentry'
26:         mainDocsUrl: 'https://cli.sentry.dev'
27:         urlTemplate: ...
gateway · 2026-09-09 05:44:45
result
12-import {
13-  Changeset,
14-  DEFAULT_CHANGELOG_PATH,
15-  findChangeset,
16:} from '../utils/changelog';
17-import { getGitHubClient } from '../utils/githubApi';
18-import { isDryRun } from '../utils/helpers';
19-import { safeExec } from '../utils/dryRun';
20-import {
--
52-/**
53- * Configuration options for the GitHub target.
54- */
55-export interface GitHubTargetConfig extends GitHubGlobalConfig {
56:  /** Path to changelog inside the repository */
57:  changelog: string;
58-  /** Prefix that will be used to generate tag name */
59-  tagPrefix: string;
60-  /** Mark release as pre-release, if the version looks like a non-public release */
61-  previewReleases: boolean;
--
101-  public readonly githubRepo: GitHubGlobalConfig;
102-
103-  public constructor(
104-    config: TargetConfig,
105:    artifactProvider: BaseArtifactProvider,
106-    githubRepo: GitHubGlobalConfig,
107-  ) {
108:    super(config, artifactProvider, githubRepo);
109-    this.githubRepo = githubRepo;
110-   ...
gateway · 2026-09-09 05:45:00
result
Found 23 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/pr-risk.yml:
  Line 28:           result-path: risk-pr-result.json

  Line 36:           path: risk-pr-result.json


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/eval-skill-fork.yml:
  Line 57:           path: |


/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/.github/workflows/ci.yml:
  Line 176:           path: |

  Line 234:           path: |

  Line 268:           path: |

  Line 306:           path: |

  Line 423:           path: |

  Line 432:           path: packages/cli/dist-bin/*.gz

  Line 460:           path: new-binaries

  Line 494:           path: patches/*.patch

  Line 528:           path: artifacts

  Line 537:           path: binaries

  Line 546:           path: patches

  Line 582:           ...
gateway · 2026-09-09 05:45:14
result
import { getWorkspaceNames } from '../../config';
import { formatJson } from '../../utils/strings';

export const command = ['list'];
export const description = 'List defined release workspaces as a JSON array';

export function handler(): void {
  console.log(formatJson(getWorkspaceNames()));
}
import { Argv, CommandBuilder } from 'yargs';

import * as list from './workspace_cmds/list';

export const command = ['workspace <command>'];
export const description = 'Manage release workspaces';

export const builder: CommandBuilder = (yargs: Argv) =>
  yargs.demandCommand().command(list);

export const handler = (): void => {
  /* pass */
};
gateway · 2026-09-09 05:45:29
result
gh: Not Found (HTTP 404)
gateway · 2026-09-09 05:45:47
result
{"defaultBranchRef":{"name":"main"},"isPrivate":false,"name":"publish","url":"https://github.com/getsentry/publish"}
gateway · 2026-09-09 05:46:07
result
.github/workflows
.github/workflows/auto-approve.yml
.github/workflows/ci-poller.yml
.github/workflows/cocoapods-keepalive.yml
.github/workflows/publish.yml
.github/workflows/test.yml
docs/publish-issue-format.md
scripts/generate-publish-issue-title-parser.js
src/modules/__tests__/ci-poller-workflow.js
src/modules/__tests__/generate-publish-issue-title-parser.js
src/modules/__tests__/post-workflow-details.js
src/modules/__tests__/publish-location.js
src/modules/__tests__/publish-workflow.js
src/modules/post-workflow-details.js
src/modules/publish-issue-title.js
src/modules/publish-issue-title.peggy
src/modules/publish-issue-validation.js
src/modules/publish-location.js
src/publish
src/publish/__tests__
src/publish/__tests__/discover-location.js
src/publish/__tests__/resolve-location.js
src/publish/__tests__/resolve-release-revision.js
src/publish/discover-location.js
src/publish/inputs.js
src/publish/post-result.js
src/publish/post-workflow-details.js
src/publish/resolve-ci-poller-inpu...
gateway · 2026-09-09 05:46:27
result
1-name: Publish
2-on:
3:  issues:
4-    types: [labeled]
5-
6-concurrency:
7:  # Use the issue title (e.g. "publish: getsentry/foo@1.2.3") so duplicate
8:  # issues for the same repo@version share a concurrency group.
9:  group: ${{ github.event.issue.title }}
10-  cancel-in-progress: false
11-
12-permissions:
13-  contents: read
14:  issues: write
15-  packages: write
16-
17-jobs:
18:  # When accepted is added to a publish issue:
19-  #   - Add ci-pending (and remove ci-failed if retrying)
20-  #   - Enable the poller via CI_POLLER_HAS_PENDING=true
21:  #   - Comment on the issue
22-  #   - Trigger the poller immediately so we don't wait for the next cron tick
23-  # The publish job below requires ci-ready, so it will not fire until the
24-  # poller flips ci-pending → ci-ready (which also prevents publishing without
25-  # CI verification in the auto-approve race). ...
gateway · 2026-09-09 05:46:49
result
1-# Publish Issue Format
2-
3:The Publish workflow treats a publish issue as a release request. The title identifies
4-the release; the body supplies the merge target and selected targets. Do not edit the
5:title by hand unless it remains valid under this format.
6-
7-## Title
8-
9:Every title starts with `publish: `. The following canonical Peggy grammar is
10:generated from `src/modules/publish-issue-title.peggy`:
11-
12-<!-- BEGIN GENERATED TITLE GRAMMAR -->
13-```peggy
14:// Canonical grammar for publish issue titles. A path suffix is syntactic only:
15:// the controller resolves the complete suffix as a workspace after checking
16-// out the CI-approved revision.
17-PublishIssueTitle
18:  = "publish: " "getsentry/"? repo:Repository path:Path? "@" version:Version !. ...
gateway · 2026-09-09 05:47:09
result
.github/workflows
.github/workflows/build.yml
.github/workflows/changelog-preview.yml
.github/workflows/docs-preview.yml
.github/workflows/enforce-license-compliance.yml
.github/workflows/image.yml
.github/workflows/lint.yml
.github/workflows/release.yml
gateway · 2026-09-09 05:47:29
result
5-  # For Craft's own releases (dogfooding)
6-  workflow_dispatch:
7-    inputs:
8-      version:
9-        description: Version to release
10-        required: true
11-        default: 'auto'
12-      force:
13-        description: Force a release even when there are release-blockers (optional)
14-        required: false
15:      workspace:
16:        description: Named Craft release workspace to prepare and publish
17-        required: false
18-
19-  # For external repos to call this workflow
20-  workflow_call:
21-    inputs:
22-      version:
23-        description: Version to release (semver, bump type, or "auto")
24-        type: string
25-        required: false
26-      force:
--
30-        default: 'false'
31-      merge_target:
32-        description: Target branch to merge into
33-        type: string
34-        required: false
35-      blocker_label:
36-        description: Label that blocks releases
37-        type: string
38-        required: false
39-        default: ...
gateway · 2026-09-09 05:47:39
result
9-    required: false
10-  merge_target:
11-    description: Target branch to merge into. Uses the default branch as a fallback.
12-    required: false
13-  force:
14-    description: Force a release even when there are release-blockers
15-    required: false
16-    default: 'false'
17-  blocker_label:
18-    description: Label that blocks releases
19-    required: false
20-    default: 'release-blocker'
21:  publish_repo:
22:    description: Repository for publish issues (owner/repo format)
23-    required: false
24-  git_user_name:
25-    description: Git committer name
26-    required: false
27-  git_user_email:
28-    description: Git committer email
29-    required: false
30:  path:
31:    description: The path that Craft will run inside
32-    required: false
33-    default: '.'
34:  workspace:
35:    description: Named Craft release workspace to prepare and publish
36-    required: false
37-  craft_config_from_merge_target:
38-    description: Use the craft config from the ...
gateway · 2026-09-09 05:47:57
result
{"published_at":"2026-09-08T18:17:54Z","tag_name":"2.31.0"}
gateway · 2026-09-09 05:48:11
result
gh: Not Found (HTTP 404)
gateway · 2026-09-09 05:48:37
result
1:c8a878c53d937a62124796b39ac00f4d73212fe0	2026-09-08T17:39:00Z	feat: support concrete release workspaces\n\n## Summary\n\n- Accept and validate workspace input before every action side effect.\n- Pass the selected workspace through prepare, target discovery, publish\nissue identity, and controller execution.\n- Preserve legacy unscoped publish issue titles and use controller\ncheckout identity only for secure state lookup.\n\n## Validation\n\n- pnpm test: 60 files, 1,138 passed, 1 skipped.\n- pnpm lint: 0 errors; 7 existing unused-variable warnings.\n- Prettier check and build passed.\n- Independent adversarial review: MERGE.\n\n## Dependency\n\nDraft until getsentry/publish#9339 deploys. The Publish controller must\naccept workspace-qualified titles and provide the secure state-file\ncontract before this action emits them. ...
gateway · 2026-09-09 05:48:59
result
{"ahead_by":2,"commits":[{"message":"Merge remote-tracking branch 'remotes/origin/release/2.31.0'","sha":"4f9e44769b7a19ef60f4361aa14f24db26f7bb65"},{"message":"meta: Bump new development version\n\n#skip-changelog","sha":"4ff132802394ce7b9418d56d92f85238ffbaad3d"}],"status":"ahead"}
gateway · 2026-09-09 05:49:36
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
90:  *
91:  * Defined here (alongside other installation constants like
92:  * {@link KNOWN_CURL_DIRS}) so that both `upgrade.ts` and
93:  * `db/install-info.ts` can import it without creating a circular
94:  * dependency.
95:  */
96: export type InstallationMethod =
97:   | "curl"
98:   | "brew"
99:   | "npm"
100:   | "pnpm"
101:   | "bun"
102:   | "yarn"
103:   | "unknown";
104: 
105: /** A repository pair that hosts CLI stable releases and nightly OCI images. */
106: export type UpgradeSource = {
107:   /** GitHub `owner/repository` containing CLI release assets. */
108:   readonly githubRepo: string;
109:   /** GHCR `owner/package` containing CLI nightly images and delta patches. */
110:   readonly ghcrRepo: string;
111:   /** Prefix attached to CLI release tags in this repository. ...
gateway · 2026-09-09 05:49:51
result
Found 52 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 137:   fetchLatestFromGitHub,

  Line 139:   fetchLatestNightlyVersion,

  Line 144:   versionExists,

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

  Line 205:     const version = await fetchLatestFromGitHub();

  Line 223:     const version = await fetchLatestFromGitHub();

  Line 241:     const version = await fetchLatestFromGitHub();

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

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

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

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

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

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

  Line ...
gateway · 2026-09-09 05:50:04
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
180:     expect(parseInstallationMethod("YARN")).toBe("yarn");
181:   });
182: 
183:   test("throws on invalid method", () => {
184:     expect(() => parseInstallationMethod("pip")).toThrow("Invalid method: pip");
185:     expect(() => parseInstallationMethod("apt")).toThrow("Invalid method: apt");
186:     expect(() => parseInstallationMethod("")).toThrow("Invalid method: ");
187:   });
188: });
189: 
190: describe("fetchLatestFromGitHub", () => {
191:   test("returns version from GitHub API", async () => {
192:     mockFetch(
193:       async () =>
194:         new Response(
195:           JSON.stringify({
196:             tag_name: "v1.2.3",
197:           }),
198:           {
199:             status: 200,
200:             headers: { "Content-Type": "application/json" },
201:           }
202:         ...
gateway · 2026-09-09 05:50:23
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts:
  Line 153: function mockFetch(
gateway · 2026-09-09 05:50:37
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
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 "../../src/lib/binary.js";
124: import {
125:   clearInstallInfo,
126:   setInstallInfo,
127: } from "../../src/lib/db/install-info.js";
128: import { UpgradeError } from "../../src/lib/errors.js";
129: import { isProcessRunning } from "../../src/lib/process-utils.js";
130: 
131: const {
132:   buildKnownCurlPaths,
133:   detectInstallationMethod,
134:   detectPackageManagerFromPath,
135:   downloadBinaryToTemp,
136:   executeUpgrade,
137:   fetchLatestFromGitHub,
138:   fetchLatestFromNpm,
139:   ...
gateway · 2026-09-09 05:51:08
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/custom-ca.ts</path>
<type>file</type>
<content>
1: /**
2:  * Custom CA certificate loading for corporate TLS proxies.
3:  *
4:  * Reads CA bundles from (in priority order):
5:  * 1. `sentry cli defaults ca-cert` (stored path in SQLite)
6:  * 2. `NODE_EXTRA_CA_CERTS` env var
7:  *
8:  * Returns a `tls` options object for Bun's `fetch()`. On the Node.js npm
9:  * distribution, Node natively honors `NODE_EXTRA_CA_CERTS` so the extra
10:  * `tls.ca` option is harmless (ignored by Node's fetch).
11:  *
12:  * Security model: When the CA source is an env var (not a stored default)
13:  * AND the target is SaaS (`*.sentry.io`), a one-time warning is logged.
14:  * `sentry cli defaults ca-cert` silences the warning — the user has
15:  * explicitly acknowledged the custom CA. See CLI-1K6 plan for the full
16:  * threat model discussion. ...
gateway · 2026-09-09 05:51:26
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/custom-ca.ts:
  Line 305: export function customFetch(
gateway · 2026-09-09 05:51:53
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/custom-ca.ts</path>
<type>file</type>
<content>
285:  * Get the combined CA certificate PEM string for Node.js `http.request()`.
286:  * Returns undefined when no custom CAs are configured.
287:  *
288:  * Unlike {@link getCustomTlsOptions} (which returns Bun's `{ tls: { ca } }` shape),
289:  * this returns the raw PEM string suitable for Node's `https.RequestOptions.ca`
290:  * and the Sentry SDK's `NodeTransportOptions.caCerts`.
291:  */
292: export function getCustomCaCerts(): string | undefined {
293:   resolve();
294:   return resolved?.tls.ca;
295: }
296: 
297: /**
298:  * Drop-in replacement for `fetch()` that injects custom CA certificates
299:  * when configured. All non-authenticated fetch call sites should use this
300:  * instead of bare `fetch()`.
301:  *
302:  * Authenticated API calls go through `fetchWithTimeout()` in sentry-client.ts
303: ...
gateway · 2026-09-09 05:52:15
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts:
  Line 474:     expect(infoBefore.latestVersion).toBe("1.0.0");
gateway · 2026-09-09 05:52:35
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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 ...
gateway · 2026-09-09 05:53:02
result
Found 11 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts:
  Line 21:   maybeCheckForUpdateInBackground,

  Line 139: // Its probabilistic behavior is tested indirectly through maybeCheckForUpdateInBackground.

  Line 415: describe("maybeCheckForUpdateInBackground", () => {

  Line 427:     globalThis.fetch = mockFetch(

  Line 449:     expect(() => maybeCheckForUpdateInBackground()).not.toThrow();

  Line 459:     maybeCheckForUpdateInBackground();

  Line 479:       maybeCheckForUpdateInBackground();

  Line 489:     maybeCheckForUpdateInBackground();

  Line 498:     expect(() => maybeCheckForUpdateInBackground()).not.toThrow();

  Line 511:       const { getUpdateNotification, maybeCheckForUpdateInBackground } = await import('./src/lib/version-check.js');

  Line 514:       maybeCheckForUpdateInBackground();
gateway · 2026-09-09 05:53:34
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts</path>
<type>file</type>
<content>
405:   test("does not throw when called multiple times", () => {
406:     // Should be safe to call multiple times
407:     expect(() => {
408:       abortPendingVersionCheck();
409:       abortPendingVersionCheck();
410:       abortPendingVersionCheck();
411:     }).not.toThrow();
412:   });
413: });
414: 
415: describe("maybeCheckForUpdateInBackground", () => {
416:   useTestConfigDir("test-version-bg-");
417:   let savedNoUpdateCheck: string | undefined;
418:   let originalFetch: typeof globalThis.fetch;
419: 
420:   beforeEach(() => {
421:     // Save and clear the env var to test real implementation
422:     savedNoUpdateCheck = process.env.SENTRY_CLI_NO_UPDATE_CHECK;
423:     delete process.env.SENTRY_CLI_NO_UPDATE_CHECK;
424:     // Silence background fetch calls to GitHub API that would ...
gateway · 2026-09-09 05:53:59
result
No files found
gateway · 2026-09-09 05:54:14
result
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts
gateway · 2026-09-09 05:54:38
result
Found 67 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts:
  Line 49: function mockFetch(

  Line 168:  * Mock fetch to simulate GHCR manifest returning a specific nightly version.

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

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

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

  Line 205:  * Mock fetch to simulate GitHub releases API returning a specific version.

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

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

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

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

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

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

  Line 260:     if ...
gateway · 2026-09-09 05:54:58
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/commands/cli/upgrade.test.ts</path>
<type>file</type>
<content>
155:     restore: () => {
156:       process.stderr.write = origStderrWrite;
157:       process.stdout.write = origStdoutWrite;
158:       if (origPlain === undefined) {
159:         delete process.env.SENTRY_PLAIN_OUTPUT;
160:       } else {
161:         process.env.SENTRY_PLAIN_OUTPUT = origPlain;
162:       }
163:     },
164:   };
165: }
166: 
167: /**
168:  * Mock fetch to simulate GHCR manifest returning a specific nightly version.
169:  * Handles token exchange and manifest fetch.
170:  */
171: function mockGhcrNightlyVersion(version: string): void {
172:   mockFetch(async (url) => {
173:     const urlStr = String(url);
174: 
175:     // GHCR anonymous token exchange
176:     if (urlStr.includes("ghcr.io/token")) {
177:       return new Response(JSON.stringify({ token: "test-token" }), ...
gateway · 2026-09-09 05:55:28
result
Found 7 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/binary.test.ts:
  Line 25:   getBinaryDownloadUrl,

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

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

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


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

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

  Line 975:     const url = getBinaryDownloadUrl("1.0.0");
gateway · 2026-09-09 05:55:44
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/upgrade.test.ts</path>
<type>file</type>
<content>
960:       "dist",
961:       "bin.cjs"
962:     );
963:     Object.defineProperty(process, "execPath", {
964:       value: "/opt/homebrew/Cellar/sentry/1.2.3/bin/sentry",
965:       configurable: true,
966:     });
967: 
968:     const method = await detectInstallationMethod();
969:     expect(method).toBe("brew");
970:   });
971: });
972: 
973: describe("getBinaryDownloadUrl", () => {
974:   test("builds correct URL for current platform", () => {
975:     const url = getBinaryDownloadUrl("1.0.0");
976: 
977:     // URL should contain the version without 'v' prefix (this repo's tag format)
978:     expect(url).toContain("/1.0.0/");
979:     expect(url).toStartWith(
980:       "https://github.com/getsentry/cli/releases/download/"
981:     );
982:     expect(url).toContain("sentry-");
983: 
984:     // ...
gateway · 2026-09-09 05:55:56
result
# branch.oid 0e661a5f50e1fa2bb1f0a66f4607e6901ad53628
# branch.head feat/toolkit-bridge-upgrade
# branch.upstream origin/main
# branch.ab +0 -0
1 .M N... 100644 100644 100644 75582612a31fba6ee68111fcfb144f34c28eb58b 75582612a31fba6ee68111fcfb144f34c28eb58b packages/cli/src/lib/binary.ts
1 .M N... 100644 100644 100644 6fcfb3b1aa34cb1caaf27b3060bb40522bd3eccf 6fcfb3b1aa34cb1caaf27b3060bb40522bd3eccf packages/cli/test/lib/binary.test.ts
1 .M N... 100644 100644 100644 e5c81d5324971e3c0f75c141d2cdb081d2ba3eb6 e5c81d5324971e3c0f75c141d2cdb081d2ba3eb6 packages/cli/test/lib/ghcr.test.ts
1 .M N... 100644 100644 100644 b1f22bbab8c434e110b1fc59525dda160cccc074 b1f22bbab8c434e110b1fc59525dda160cccc074 packages/cli/test/lib/install-script.test.ts
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 ...
gateway · 2026-09-09 05:59:28
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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: import { UPGRADE_SOURCES } from "../../src/lib/binary.js";
21: 
22: function noop(): void {
23:   // Intentionally empty — absorbs async spawn errors
24: }
25: 
26: const repoRoot = join(import.meta.dirname, "..", "..");
27: const installScript = join(repoRoot, ...
gateway · 2026-09-09 06:01:20
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/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, isAbsolute, join, resolve, sep } 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, ...
gateway · 2026-09-09 06:02:41
result
Found 1 matches
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:
  Line 426: export async function fetchWithUpgradeError(
gateway · 2026-09-09 06:03:13
result
<path>/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts</path>
<type>file</type>
<content>
390:   // 3-4. Check well-known directories that are already in PATH. samePath keeps
391:   // the membership check case-insensitive on Windows/macOS, where a PATH entry
392:   // can differ in casing from the computed directory yet be the same dir.
393:   const candidates = [join(homeDir, ".local", "bin"), join(homeDir, "bin")];
394: 
395:   for (const dir of candidates) {
396:     if (existsSync(dir) && pathDirs.some((p) => samePath(p, dir))) {
397:       return dir;
398:     }
399:   }
400: 
401:   // 5. XDG-aligned fallback — setup will handle adding this to PATH
402:   return join(homeDir, ".local", "bin");
403: }
404: 
405: /**
406:  * Build headers for GitHub API requests.
407:  */
408: export function getGitHubHeaders(): Record<string, string> {
409:   return {
410:     Accept: ...
gateway · 2026-09-09 06:04:28
result
1:import { join } from 'path';
2-
3-import { createDeployment } from '@vercel/client';
4-
5-import {
6-  GitHubGlobalConfig,
7-  TargetConfig,
8-  TypedTargetConfig,
9-} from '../schemas/project_config';
10-import { checkEnvForPrerequisite } from '../utils/env';
11-import { reportError } from '../utils/errors';
12-import { withTempDir } from '../utils/files';
13-import { isDryRun } from '../utils/helpers';
14-import { logDryRun } from '../utils/dryRun';
15-import { extractZipArchive } from '../utils/system';
16-import { BaseTarget } from './base';
17:import { BaseArtifactProvider } from '../artifact_providers/base';
18-
19-/**
20- * Secrets required to authenticate with the Vercel API.
21- *
22- * Only the token is a true secret. ...
gateway · 2026-09-09 06:05:40
result
24-
25-const MAX_TRIES = 3;
26-const MILLISECONDS = 1000;
27-const ARTIFACTS_POLLING_INTERVAL = 10 * MILLISECONDS;
28-const DOWNLOAD_CONCURRENCY = 3;
29-
30-export type ArtifactItem =
31-  RestEndpointMethodTypes['actions']['listArtifactsForRepo']['response']['data']['artifacts'][0];
32-
33-export type WorkflowRun =
34:  RestEndpointMethodTypes['actions']['listWorkflowRunsForRepo']['response']['data']['workflow_runs'][0];
35-
36-/**
37- * Normalized artifact filter structure
38- */
39-export interface NormalizedArtifactFilter {
40:  workflow?: RegExp;
41-  artifacts: RegExp[];
42-}
43-
44-/**
45- * Normalizes artifact patterns from string/array format to array of RegExp
46- */
47-function normalizeArtifactPatterns(
48-  patterns: string | string[] | undefined,
49-): RegExp[] {
50-  if (!patterns) {
--
62- */
63-export function normalizeArtifactsConfig(
64-  config: GitHubArtifactsConfig,
65-): NormalizedArtifactFilter[] {
66-  if (!config) {
67-    return [];
68-  }
69-
70-  if ...
gateway · 2026-09-09 06:07:02
result
103-  }
104-  return parsedFilters;
105-}
106-
107-/**
108- * Configuration options needed for all artifact providers
109- */
110-export interface ArtifactProviderConfig {
111-  name: string;
112-  /** Name of the repo containing the code getting released */
113:  repoName: string;
114-  /** GitHub org to which the repo belongs */
115-  repoOwner: string;
116-  /** Destination for any files the provider downloads */
117-  downloadDirectory?: string;
118-  /** Other, provider-specific config options */
119-  [key: string]: any;
120-}
121-
122-/**
123- * Base interface for artifact providers. ...
gateway · 2026-09-09 06:08:29
result
811-    logger.warn(
812-      'Multiple "github" targets with different "tagPrefix" values found. ' +
813-        `Using "${firstPrefix}". For independently-versioned products in a ` +
814-        'monorepo, use a top-level "workspaces" entry per product (or a ' +
815-        'separate .craft.yml), each with a single "github" target and its own ' +
816-        '"tagPrefix".',
817-    );
818-  }
819-
820-  return firstPrefix;
821-}
822-
823-/**
824- * Create an artifact provider instance from the spec in the configuration file
825- *
826- * @returns An instance of artifact provider (which may be the dummy
827- * NoneArtifactProvider if artifact storage is disabled).
828- */
829:export async function getArtifactProviderFromConfig(): Promise<BaseArtifactProvider> {
830-  const projectConfig = getConfiguration();
831-
832-  let artifactProviderName = projectConfig.artifactProvider?.name;
833-  if (artifactProviderName == null) {
834-    artifactProviderName = ...
gateway · 2026-09-09 06:09:22
result
127-        (available.length
128-          ? `Available workspaces: ${available.join(', ')}.`
129-          : 'No workspaces are defined in the configuration.'),
130-    );
131-  }
132-
133-  // eslint-disable-next-line @typescript-eslint/no-unused-vars
134-  const { workspaces: _ignoredWorkspaces, ...baseWithoutWorkspaces } = base;
135-
136-  const resolved: CraftProjectConfig = { ...baseWithoutWorkspaces };
137-  for (const [key, value] of Object.entries(workspace) as [
138-    keyof Workspace,
139-    unknown,
140-  ][]) {
141-    if (value === undefined) {
142-      continue;
143-    }
144-    if (key === 'github') {
145-      // Shallow-merge github so a workspace can override owner or repo while
146-      // inheriting the other value from the base configuration.
147-      const mergedGithub = {
148-        ...(base.github as GitHubGlobalConfig | undefined),
149-        ...(value as Partial<GitHubGlobalConfig>),
150-      };
151-      // Only adopt the merged github if it is ...
gateway · 2026-09-09 06:10:41
result
1-import { existsSync, promises as fsPromises } from 'fs';
2:import { join, relative } from 'path';
3-
4-import * as shellQuote from 'shell-quote';
5-import type { SimpleGit, StatusResult } from 'simple-git';
6-import type { Arguments, Argv, CommandBuilder } from 'yargs';
7-import { createDryRunIsolation, safeFs } from '../utils/dryRun';
8-
9-import {
10-  CONFIG_FILE_NAME,
11-  DEFAULT_RELEASE_BRANCH_NAME,
12-  getConfigFileDir,
13-  getConfiguration,
14-  getGitTagPrefix,
--
61-} from '../utils/helpers';
62-import { formatJson } from '../utils/strings';
63-import { spawnProcess } from '../utils/system';
64-import { buildReleaseCommandEnv } from '../utils/releaseCommandEnv';
65-import { withTracing } from '../utils/tracing';
66-import { getVersion, isValidVersion } from '../utils/version';
67-import { runAutomaticVersionBumps } from '../utils/versionBump';
68-
69-import { type PublishOptions, handler as publishMainHandler } from './publish';
70-
71-export const command = ['prepare ...
gateway · 2026-09-09 06:11:52
result
1-import simpleGit, {
2-  type SimpleGit,
3-  type LogOptions,
4-  type Options,
5-  type StatusResult,
6-} from 'simple-git';
7-
8:import { getConfigFileDir } from '../config';
9-import { ConfigurationError } from './errors';
10-import { createDryRunGit } from './dryRun';
11-import { logger } from '../logger';
12-import { distance as levenshtein } from 'fastest-levenshtein';
13-
14-export interface GitChange {
15-  hash: string;
16-  title: string;
17-  body: string;
18-  pr: string | null;
19-}
20-
21-// This regex relies on the default GitHub behavior where it appends the PR
22-// number to the end of the commit title as: `fix: Commit title (#123)`.
23-// This makes it very cheap and quick to extract the associated PR number just
24-// from the commit log locally.
--
112-    pr: commit.message.match(PRExtractor)?.[0] || null,
113-  }));
114-}
115-
116-export function stripRemoteName(
117-  branch: string | undefined,
118-  remoteName: string,
119-): string {
120-  const branchName ...
gateway · 2026-09-09 06:13:30
result
1-import { SpawnOptions, spawnSync } from 'child_process';
2:import { existsSync, readFileSync } from 'fs';
3-import { join, relative, sep as pathSep } from 'path';
4-import prompts from 'prompts';
5-
6-import { TargetConfig, TypedTargetConfig } from '../schemas/project_config';
7-import { safeFs } from '../utils/dryRun';
8-import { ConfigurationError, reportError } from '../utils/errors';
9-import { escapeRegex, stringToRegexp } from '../utils/filters';
10-import { isDryRun } from '../utils/helpers';
11-import {
12-  hasExecutable,
13-  requireFirstExecutable,
14-  spawnProcess,
15-} from '../utils/system';
16-import {
17-  isPreviewRelease,
18-  parseVersion,
19-  SemVer,
20:  versionGreaterOrEqualThan,
21:} from '../utils/version';
22-import {
23-  discoverWorkspaces,
24-  filterWorkspacePackages,
25-  packageNameToArtifactPattern,
26-  packageNameToArtifactFromTemplate,
27-  topologicalSortPackages,
28-  WorkspacePackage,
29-} from '../utils/workspaces';
30-import { BaseTarget } ...
gateway · 2026-09-09 06:14:44

Distillations (50)

Gen 0 2026-09-09 06:34:45 · 1260 tokens

* 🔴 (06:11) The `prepare [NEW-VERSION]` command has aliases `p`, `prerelease`, `prepublish`, `prepare`, and `release`; its description is `🚢 Prepare a new release branch`. `DEFAULT_BUMP_VERSION_PATH = join('scripts', 'bump-version.sh')`, `AUTO_VERSION_MIN_VERSION = '2.14.0'`, `AUTO_BUMP_MIN_VERSION = '2.21.0'`, and `SLEEP_BEFORE_PUBLISH_SECONDS = 30`. * 🔴 (06:11) `prepare` accepts positional `…

Gen 0 2026-09-09 06:32:03 · 2075 tokens

* 🔴 (06:01) `packages/cli/test/lib/install-script.test.ts` contains 2 Vitest tests: (1) `passes --no-agent-skills through to sentry cli setup`, which invokes the `install` script with `--version 0.31.0 --no-modify-path --no-completions --no-agent-skills` and expects setup arguments `cli`, `setup`, `--install`, `--method`, `curl`, `--channel`, `stable`, `--no-modify-path`, `--no-completions`, `--…

Gen 0 2026-09-09 06:29:32 · 214 tokens

* 🔴 (05:59) Git branch state: `branch.oid` is `0e661a5f50e1fa2bb1f0a66f4607e6901ad53628`; `branch.head` is `feat/toolkit-bridge-upgrade`; `branch.upstream` is `origin/main`; branch divergence is `+0 -0`. * 🔴 (05:59) Working tree has four modified files: `packages/cli/src/lib/binary.ts`, `packages/cli/test/lib/binary.test.ts`, `packages/cli/test/lib/ghcr.test.ts`, and `packages/cli/test/lib/inst…

Gen 0 2026-09-09 06:29:19 · 2760 tokens

* 🔴 (05:49) `packages/cli/src/lib/binary.ts` defines `InstallationMethod` as `"curl" | "brew" | "npm" | "pnpm" | "bun" | "yarn" | "unknown"`; `VALID_METHODS` excludes `"unknown"`, and `parseInstallationMethod(value)` lowercases input and throws `Invalid method: ${value}. Must be one of: ${VALID_METHODS.join(", ")}` for unsupported methods. * 🔴 (05:49) `packages/cli/src/lib/binary.ts` defines or…

Gen 0 2026-09-09 06:27:44 · 2693 tokens

* 🔴 (05:43) `docs/src/content/docs/github-actions.md` documents two release automation options in order: 1. reusable workflow (recommended for quick setup and standard flow, low flexibility), 2. composite action (for custom workflows and pre/post steps, high flexibility). Reusable-workflow inputs include `version`, `merge_target`, `force`, `blocker_label`, `publish_repo`, `git_user_name`, `git_u…

Gen 0 2026-09-09 06:24:36 · 2070 tokens

* 🔴 (05:39) `src/utils/workspaces.ts` defines `WorkspacePackage` with exact fields `name`, `location`, `private`, `hasPublicAccess`, and `workspaceDependencies`, plus `WorkspaceDiscoveryResult` with `type: 'npm' | 'yarn' | 'pnpm' | 'none'` and `packages: WorkspacePackage[]`. * 🔴 (05:39) `src/utils/workspaces.ts:96-147` supports both `package.json` workspace forms (`string[]` and `{ packages?: s…

Gen 0 2026-09-09 06:20:47 · 1663 tokens

* 🔴 (05:37) `packages/cli/install:8-75` implements fire-and-forget Sentry installer error telemetry through the envelope API, using the CLI’s public write-only DSN, collecting no PII, and honoring `SENTRY_CLI_NO_TELEMETRY=1`. `report_error()` runs in a background subshell so it “never blocks installation or propagates failures”; inside, `set +e` enforces that telemetry must “never fail the scrip…

Gen 0 2026-09-09 06:18:25 · 1005 tokens

* 🔴 (05:32) `packages/cli/src/lib/ghcr.ts:134` exports `GHCR_REPO = "getsentry/cli"`; token exchange, manifest fetches, blob downloads, and tag listing all use this repository. `packages/cli/src/lib/delta-upgrade.ts:44,135,288` imports and uses that same `GHCR_REPO`, so GHCR-backed delta upgrades currently have a single hard-coded repository source. * 🔴 (05:33) `packages/cli/src/lib/errors.ts:5…

Gen 0 2026-09-09 06:17:48 · 1435 tokens

* 🔴 (05:28) `packages/cli/test/lib/binary.test.ts` defines `UPGRADE_SOURCES` in priority order: 1. `{ githubRepo: "getsentry/toolkit", ghcrRepo: "getsentry/toolkit", tagPrefix: "cli@" }`; 2. `{ githubRepo: "getsentry/cli", ghcrRepo: "getsentry/cli", tagPrefix: "" }`. * 🔴 (05:28) `resolveUpgradeSource()` queries `https://api.github.com/repos/getsentry/toolkit/releases/latest` first and falls bac…

Gen 0 2026-09-09 06:15:21 · 2627 tokens

* 🔴 (05:24) `packages/cli/package.json` requires Node `>=22.15`, pins `packageManager` to `pnpm@10.11.0`, and defines `tsx`/`cli` commands with `--env-file-if-exists=.env.local --import ./script/require-shim.mjs`. * 🔴 (05:24) Build workflow in `packages/cli/package.json`: `dev`, `build`, `build:all`, and `bundle` first run generated schema/docs/SDK tasks; `build` invokes `pnpm tsx script/build.…

Gen 0 2026-09-09 06:13:45 · 1782 tokens

* 🔴 (05:22) Package-manager upgrades through Homebrew/npm/pnpm/Bun/Yarn always require network access to fetch and install packages; `--offline` is supported only for curl-installed binaries, otherwise `validateMethod()` throws `UpgradeError("unsupported_operation", "Offline upgrade is only supported for curl-installed binaries.")`. * 🔴 (05:22) `resolveTargetWithFallback()` in `packages/cli/src…

Gen 0 2026-09-09 06:11:37 · 1370 tokens

* 🔴 (05:21) [enforced-install-detection-order] User directed: “Always check for Homebrew first — the stored install info may be stale.” In `packages/cli/src/lib/upgrade.ts`, `detectInstallationMethod()` must run `isHomebrewInstall()` before consulting `getInstallInfo()`, so switching from a previously recorded curl install to Homebrew returns `"brew"`. * 🔴 (05:21) `isHomebrewInstall()` resolves…

Gen 0 2026-09-09 06:07:21 · 7645 tokens

* 🔴 (05:20) [enforced-output-contract] User directed: “Always preserve strict output-mode and binary-safety contracts.” `sentry api` must preserve `rawApiRequest()` status text; empty textual non-2xx bodies fall back to HTTP status/request context; JSON mode exposes `{status, statusText, body}`; binary `Uint8Array` successes bypass formatters and remain raw; binary errors expose only status/cont…

Gen 0 2026-09-09 06:02:58 · 3512 tokens

* 🔴 (05:15) Repository search returned these exact workspace/versioning-related paths: `docs/src/content/docs/configuration.md`, `docs/src/content/docs/targets/github.md`, `src/__tests__/versionBump.test.ts`, `src/commands/__tests__/changelog-versioning-policy.test.ts`, `src/commands/workspace.ts`, `src/commands/workspace_cmds`, `src/commands/workspace_cmds/__tests__`, `src/commands/workspace_cm…

Gen 0 2026-09-09 06:00:51 · 508 tokens

* 🔴 (05:07) Authentication probe reported `unscoped_token=no`; unauthenticated requests to `getsentry/toolkit`, `getsentry/doesnotexist123456789`, and `getsentry/cli` each returned HTTP `401`, so unscoped-token results were `n/a`; a subsequent `curl` request failed with HTTP `403`. * 🔴 (05:07) `packages/cli/src/lib/binary.ts:426-447` defines `fetchWithUpgradeError(url, init, serviceName)`: it c…

Gen 0 2026-09-09 05:56:01 · 1708 tokens

* 🔴 (05:11) `packages/cli/src/lib/delta-upgrade.ts:375-401` defines `applyPatchChain(chain, oldBinaryPath, destPath, onBytes?)`; it traces `upgrade.delta.apply`, records `patches.count` and `patches.total_bytes`, applies all in-memory patches with `applyPatchChainInMemory()`, and throws `SHA-256 mismatch after patching: got ${sha256}, expected ${chain.expectedSha256}` if the resulting digest dif…

Gen 0 2026-09-09 05:54:57 · 2155 tokens

* 🔴 (05:09) `packages/cli/src/lib/release-notes.ts:543-585` defines `CHANGELOG_MAX_RELEASES = 30`; `fetchReleasesForChangelog()` requests `${GITHUB_RELEASES_URL}?per_page=30`, returns releases newest-first, and returns `[]` on fetch failure, non-OK HTTP response, invalid JSON, or a non-array response. The comments contrast this with delta-upgrade’s cap of 12 and state 30 covers approximately 6+ …

Gen 0 2026-09-09 05:52:22 · 1492 tokens

* 🔴 (04:59) Search found exactly 15 `GHCR_REPO` matches: 6 in `packages/cli/test/lib/ghcr.test.ts` (lines 17, 83, 152, 404, 447, 569), 4 in `packages/cli/src/lib/delta-upgrade.ts` (lines 44, 72, 135, 288), and 5 in `packages/cli/src/lib/ghcr.ts` (lines 134, 193, 232, 337, 432). `packages/cli/src/lib/ghcr.ts:134` defines `GHCR_REPO = "getsentry/cli"`; token, manifest, blob, and paginated tag-list…

Gen 0 2026-09-09 05:51:19 · 903 tokens

* 🔴 (04:57) User directed: “Switch to nightly channel and update.” * 🔴 (04:57) `packages/cli/src/commands/cli/upgrade.ts:863-929` documents `sentry cli upgrade` as supporting persistent `stable` and `nightly` release channels. Ordered examples: 1. `sentry cli upgrade` updates using the persisted channel; 2. `sentry cli upgrade nightly` switches to nightly and updates; 3. `sentry cli upgrade sta…

Gen 0 2026-09-09 05:50:42 · 1861 tokens

* 🔴 [enforced-workflow] (04:55) For getsentry/cli#1244, user specified a hard prerequisite for the toolkit monorepo merge tracked by getsentry/cli#1248: ship one stable bridge CLI release from `getsentry/cli` before importing any CLI history into `getsentry/sentry-mcp`; only after recording the released bridge version may getsentry/cli#1239 begin. * 🔴 (04:55) User stated the bridge release must…

Gen 0 2026-09-09 05:48:21 · 285 tokens

* 🔴 (04:53) `packages/cli/tsconfig.json` uses `"lib": ["ESNext"]`, `"target": "ESNext"`, `"module": "ESNext"`, `"jsx": "react-jsx"`, `"moduleDetection": "force"`, `"allowJs": true`, `"moduleResolution": "bundler"`, `"allowImportingTsExtensions": true`, `"verbatimModuleSyntax": true`, `"noEmit": true`, `"resolveJsonModule": true`, `"strict": true`, `"skipLibCheck": true`, `"noFallthroughCasesInSw…

Gen 0 2026-09-09 05:48:07 · 1038 tokens

* 🔴 (04:52) External Craft `src/config.ts` imports `getPackageVersion`, `parseVersion`, `versionGreaterOrEqualThan`, and `SemVer` from `./utils/version`; `getTargetByName` is imported lazily in `expandWorkspaceTargets` to avoid the circular dependency `config -> targets -> registry -> utils/registry -> symlink -> version -> config`. * 🔴 (04:52) External Craft `src/config.ts` defines `CONFIG_FIL…

Gen 0 2026-09-09 05:46:47 · 4133 tokens

* 🔴 (04:46) Vitest `v4.1.10` reported that `test.poolOptions` was removed in Vitest 4 and all former `poolOptions` are now top-level options; migration guide: `https://vitest.dev/guide/migration#pool-rework`. * 🔴 (04:46) Test run in `packages/cli` had exactly 110 tests: 106 passed and 4 failed across 3 failed test files; duration was 899ms, with transform 1.17s, setup 236ms, import 1.42s, tests…

Gen 0 2026-09-09 05:44:08 · 2332 tokens

* 🔴 (04:42) `packages/cli/src/lib/release-notes.ts` sets `CHANGELOG_MAX_RELEASES = 30`; this exceeds delta-upgrade’s 12-release cap, stays below GitHub’s `per_page` maximum of 100, and is intended to cover approximately 6+ months of weekly releases. * 🔴 (04:42) `fetchReleasesForChangelog()` requests `${GITHUB_RELEASES_URL}?per_page=${CHANGELOG_MAX_RELEASES}` with `getGitHubHeaders()` and return…

Gen 0 2026-09-09 05:40:25 · 3118 tokens

* 🔴 (04:37) A GitHub REST request to “get the latest release” returned `HTTP/2.0 404 Not Found` with `gh: Not Found (HTTP 404)`; the authenticated token reported scopes `gist, read:org, repo, workflow`. * 🔴 (04:37) Repository agent instructions in `AGENTS.md` define the pipeline as `triage → explore → plan → implement → review → ship`; `worker` is a deprecated alias of `implement`. * 🔴 (04:37)…

Gen 0 2026-09-09 05:38:34 · 2319 tokens

* 🔴 (04:33) Root `README.md` identifies the repository as “Sentry Toolkit (pre-shape)” and says it is being reshaped into a pnpm-workspace monorepo before merging Sentry CLI and Sentry MCP into `getsentry/toolkit`. * 🔴 (04:33) Current workspace layout is `packages/cli/` for the Sentry CLI (npm package `sentry`, binary `sentry`) and `apps/cli-docs/` for the Astro + Starlight documentation site p…

Gen 0 2026-09-09 05:37:09 · 1213 tokens

* 🔴 (04:30) `getGitHubHeaders()` in `packages/cli/src/lib/binary.ts` returns `Accept: "application/vnd.github.v3+json"` and `"User-Agent": getUserAgent()`. * 🔴 (04:30) `fetchWithUpgradeError(url, init, serviceName)` in `packages/cli/src/lib/binary.ts` calls `customFetch(url, init)`; it rethrows `AbortError` unchanged, maps TLS certificate failures to `UpgradeError("network_error", buildTlsError…

Gen 0 2026-09-09 05:36:20 · 1506 tokens

* 🔴 (04:28) `packages/cli/package.json` defines package `sentry` version `0.45.0-dev.0`, repository `git+https://github.com/getsentry/cli.git`, Node engine `>=20.0`, development runtime Node `>=22.15`, and package manager `pnpm@10.11.0`. * 🔴 (04:28) `packages/cli/package.json` exposes the `sentry` binary through `./dist/bin.cjs`; package exports use `./dist/index.mjs` with `./dist/index.d.mts` …

Gen 0 2026-09-09 05:34:10 · 1338 tokens

* 🔴 (04:27) Search found 4 matches for install-script-related references: `packages/cli/test/lib/install-script.test.ts` line 27 defines `const installScript = join(repoRoot, "install");`, line 64 references `installScript`, and line 112 reads it with `readFileSync(installScript, "utf8")`; `packages/cli/script/generate-skill.ts` line 291 calls `lines.push(...generateInstallSection(installSection…

Gen 0 2026-09-09 05:30:09 · 2117 tokens

* 🔴 (04:23) `executeStandardUpgrade()` in `packages/cli/src/commands/cli/upgrade.ts` chooses the rolling `NIGHTLY_TAG` only when `channel === "nightly"` and `versionArg` is absent; a specifically requested nightly version uses its own release tag. * 🔴 (04:23) `executeStandardUpgrade()` calls `executeUpgrade(method, target, downloadTag, offline, setMessage)` inside `withProgress({ message: \`Dow…

Gen 0 2026-09-09 05:26:48 · 1738 tokens

* 🔴 (04:20) `packages/cli/src/lib/ghcr.ts` defines GHCR networking with `GHCR_REQUEST_TIMEOUT = 10_000`, `GHCR_MAX_RETRIES = 1` (up to 2 attempts), and `GHCR_BLOB_TIMEOUT = 30_000`. `fetchWithRetry()` retries only timeout/abort and network-style failures (`timeout`, `econnreset`, `econnrefused`, `network`, `fetch failed`); caller-triggered external aborts propagate without retry. * 🔴 (04:20) `p…

Gen 0 2026-09-09 05:22:13 · 5283 tokens

* 🔴 (04:19) User directed: “Always preserve strict output-mode and binary-safety contracts.” For `sentry api`, `rawApiRequest()` status text must be preserved; empty textual non-2xx bodies must fall back to HTTP status/request details; JSON mode must expose `{status, statusText, body}`; successful binary `Uint8Array` responses must bypass formatters and remain raw; binary errors must emit only s…

Gen 0 2026-09-09 05:07:11 · 2564 tokens

* 🔴 (03:30) User established the exact `VersionCheckInfo` state semantics in `packages/cli/src/lib/db/version-check.ts`: `lastChecked` is a Unix timestamp in ms or `null` if “never checked */”; `latestVersion` is a GitHub version string or `null` if “never fetched */”; `lastNotified` is the Unix timestamp in ms when the update notification was last printed, or `null`. * 🔴 (03:30) `packages/cli/…

Gen 0 2026-09-09 04:56:43 · 1716 tokens

* 🔴 (04:14) Recent repository history included commits `6e3e7e13a feat(config): follow XDG Base Directory spec for config location (#1503)`, `b0b22fe82 feat(errors): wire up no-silent-catch lint rule, drop ratchet baseline (#1532)`, `96390e5f6 chore: pre-shape repo into pnpm-workspace monorepo layout (#1254)`, `cf165f5ba chore: pre-shape repo into pnpm-workspace monorepo layout`, and `e11da2e85 …

Gen 0 2026-09-09 04:55:38 · 1802 tokens

* 🔴 (04:07) `.github/workflows/ci.yml` runs on pushes to `main` and `release/**`, all pull requests, and `workflow_call`; concurrency is `ci-${{ github.ref }}` with `cancel-in-progress: true`, and workflow permissions are `contents: read`, `issues: write`, and `packages: write`. * 🔴 (04:07) `.github/workflows/ci.yml` defines workflow-level `COMMIT_TIMESTAMP: ${{ github.event.head_commit.timesta…

Gen 0 2026-09-09 04:54:18 · 2742 tokens

* 🔴 (04:04) User provided the `binpatch` type/API contract for streaming TRDIFF10 application: patch header layout is magic `"TRDIFF10"` at bytes `[0..8]`, signed sign-magnitude i64 LE `controlLen` at `[8..16]`, `diffLen` at `[16..24]`, `newSize` at `[24..32]`, followed by `zstd(control) | zstd(diff) | zstd(extra)`. * 🔴 (04:04) User stated the old binary is read on demand through positional `re…

Gen 0 2026-09-09 04:50:23 · 1157 tokens

* 🔴 (04:01) User directive: always check for Homebrew first because stored install information may be stale; in `packages/cli/src/lib/upgrade.ts`, `detectInstallationMethod()` prioritizes `isHomebrewInstall()` before `getInstallInfo()`, then legacy detection, and best-effort persistence through `setInstallInfo()`. * 🔴 (04:01) `isHomebrewInstall()` in `packages/cli/src/lib/upgrade.ts` resolves `…

Gen 0 2026-09-09 04:48:50 · 356 tokens

* 🔴 (03:55) `packages/cli/src/lib/delta-upgrade.ts` uses the local `validateChainStep` rather than `binpatch`’s validator to preserve a richer 3-reason validation result. * 🔴 (03:55) Patch-chain processing tracks `totalSize`, derives each `toVersion` using `tag.slice(PATCH_TAG_PREFIX.length)`, and maps `chain.patches` to each patch’s `data` for in-memory application. * 🔴 (03:55) Delta-upgrade …

Gen 0 2026-09-09 04:47:03 · 999 tokens

* 🔴 (03:53) `packages/cli/src/lib/delta-upgrade.ts` implements delta-upgrade discovery/application using `binpatch`, including `applyPatchChainInMemory`, `resolveAndApply`, `OciClient`, stable GitHub and nightly GHCR source strategies, patch caching, chain validation/filtering, and telemetry types. * 🔴 (03:53) `packages/cli/src/lib/delta-upgrade.ts` re-exports `ExtractStableChainOpts`, `GitHubA…

Gen 0 2026-09-09 04:46:28 · 2557 tokens

* 🔴 (03:51) [requested-channel-switch] User directed: “Switch to nightly channel and update.” * 🔴 (03:51) `packages/cli/src/lib/ghcr.ts` implements anonymous OCI downloads for nightly CLI binaries from `ghcr.io/getsentry/cli`; `GHCR_REPO = "getsentry/cli"`, `GHCR_TAG = "nightly"`, registry URL is `https://ghcr.io`, and manifest media type is `application/vnd.oci.image.manifest.v1+json`. * 🔴 (0…

Gen 0 2026-09-09 04:44:45 · 1165 tokens

* 🔴 (03:49) Craft’s GitHub target options are: `tagPrefix` (empty by default), `previewReleases` (default `true`), `tagOnly` (default `false`), and `floatingTags` (supports `{major}`, `{minor}`, and `{patch}` placeholders); authentication uses `GITHUB_TOKEN`. * 🔴 (03:49) [enforced-latest-release-pointer] User stated Craft floating tags such as `"v{major}"` and `"v{major}.{minor}"` must always p…

Gen 0 2026-09-09 04:43:57 · 3585 tokens

* 🔴 (03:45) Current diff in `packages/cli` changes 4 files with 232 insertions and 5 deletions: `packages/cli/src/lib/binary.ts` (88 lines changed), `packages/cli/test/lib/binary.test.ts` (109 lines), `packages/cli/test/lib/ghcr.test.ts` (30 lines), and `packages/cli/test/lib/install-script.test.ts` (10 lines). * 🔴 (03:45) `packages/cli/src/lib/binary.ts` adds exported `UpgradeSource` with read…

Gen 0 2026-09-09 04:40:16 · 1554 tokens

* 🔴 (03:43) Vitest `v4.1.10` warned that `test.poolOptions` was removed in Vitest 4; former `poolOptions` must now be configured as top-level options per `https://vitest.dev/guide/migration#pool-rework`. * 🔴 (03:43) Test run in `packages/cli` completed with 110 tests: 106 passed and 4 failed across 3 failed test files; duration was 1.14s, with transform 1.04s, setup 243ms, import 1.50s, tests 4…

Gen 0 2026-09-09 04:39:14 · 302 tokens

* 🔴 (03:40) Git status showed branch `feat/toolkit-bridge-upgrade` tracking `origin/main`, with 4 modified files: `packages/cli/src/lib/binary.ts`, `packages/cli/test/lib/binary.test.ts`, `packages/cli/test/lib/ghcr.test.ts`, and `packages/cli/test/lib/install-script.test.ts`. * 🔴 (03:40) TypeScript configuration search found 7 strictness matches: `packages/cli/tsconfig.json` has `"strict": tru…

Gen 0 2026-09-09 04:38:52 · 1074 tokens

* 🔴 (03:35) A GitHub CLI (`gh`) lookup returned `Not Found (HTTP 404)`. * 🔴 (03:36) In the CLI upgrade implementation, package-manager installations always require network access to fetch and install packages; automatic offline fallback is limited to curl-installed binaries. * 🔴 (03:36) Nightly builds are GitHub-only, so upgrade resolution always uses the curl (GitHub) lookup for nightly build…

Gen 0 2026-09-09 04:36:32 · 1944 tokens

* 🔴 (03:33) getsentry/craft PR #847, `feat: prefix-aware read paths for monorepo multi-product releases` (`https://github.com/getsentry/craft/pull/847`), was merged; it salvaged the non-controversial prefix-aware version-detection read paths from parked PR #844, whose broader multi-product design was superseded by the target-agnostic workspaces redesign tracked in #842. (meaning July 21, 2026) *…

Gen 0 2026-09-09 04:32:01 · 2265 tokens

* 🔴 (03:25) `.github/workflows/ci.yml` lines 225–247 define the check job setup with `actions/checkout@v6`, `pnpm/action-setup@v4`, `actions/setup-node@v6` using `${{ env.NODE_VERSION_22 }}`, `actions/cache@v5`, conditional `pnpm install --frozen-lockfile`, then `pnpm run generate:schema`, `lint`, `typecheck`, `check:deps`, `check:errors`, `check:patches`, and `check:stale-refs`; no upgrade-sour…

Gen 0 2026-09-09 04:28:01 · 1562 tokens

* 🔴 (03:23) User stated getsentry/cli issue #1244, “toolkit merge: bridge CLI release + dual-source upgrade compatibility” (`https://github.com/getsentry/cli/issues/1244`), is a sub-task of master merge issue getsentry/cli#1248; one stable bridge CLI release must ship from `getsentry/cli` before any CLI history is imported into `getsentry/sentry-mcp`. * 🔴 (03:23) User stated the bridge release …

Gen 0 2026-09-09 04:26:53 · 1807 tokens

* 🔴 (03:20) In `packages/cli/src/lib/binary.ts`, `stripTrailingSep(p)` strips one trailing platform separator only when `p.length > 1`, never from a bare root like `/`, so PATH entries such as `~/.local/bin/` compare equal to `~/.local/bin`. * 🔴 (03:20) `packages/cli/src/lib/binary.ts` defines `IS_CASE_INSENSITIVE_FS` once at module load as true for `win32` and `darwin`; exported `samePath(a, b…

Gen 0 2026-09-09 04:23:33 · 1191 tokens

* 🔴 (03:19) Working tree branch is `feat/toolkit-bridge-upgrade`, tracking `origin/main`, with 4 modified files: `packages/cli/src/lib/binary.ts`, `packages/cli/test/lib/binary.test.ts`, `packages/cli/test/lib/ghcr.test.ts`, and `packages/cli/test/lib/install-script.test.ts`; diff totals 232 insertions and 5 deletions. * 🔴 (03:19) `packages/cli/src/lib/binary.ts` added exported `UpgradeSource` …