@sentry/junior-github 0.164.0 → 0.166.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2022,10 +2022,13 @@ function createGitHubGetPullRequestTool(ctx) {
2022
2022
  )
2023
2023
  });
2024
2024
  const parsed = await readJson2(response);
2025
- if (!response.ok)
2026
- throw new Error(
2027
- `GitHub pull request lookup failed with HTTP ${response.status}`
2028
- );
2025
+ if (!response.ok) {
2026
+ const message = `GitHub pull request lookup failed with HTTP ${response.status}`;
2027
+ if (response.status === 404) {
2028
+ throw new PluginToolInputError6(message);
2029
+ }
2030
+ throw new Error(message);
2031
+ }
2029
2032
  const providerResult = z5.object({
2030
2033
  base: z5.object({ ref: z5.string() }),
2031
2034
  draft: z5.boolean(),
@@ -2730,11 +2733,13 @@ function createGitHubResolvePullRequestReviewThreadTool(ctx, botEmail) {
2730
2733
  }).nullable()
2731
2734
  })
2732
2735
  }).parse(lookupPayload).data.node;
2733
- if (!thread) throw new Error("GitHub review thread was not found.");
2736
+ if (!thread) {
2737
+ throw new PluginToolInputError11("GitHub review thread was not found.");
2738
+ }
2734
2739
  const pullRequest = thread.pullRequest;
2735
2740
  const ownsPullRequest = pullRequest.repository.nameWithOwner.toLowerCase() === repo.ref.toLowerCase() && pullRequest.author.login.toLowerCase() === botLogin;
2736
2741
  if (!ownsPullRequest) {
2737
- throw new Error(
2742
+ throw new PluginToolInputError11(
2738
2743
  "Junior can only resolve review threads on pull requests it authored."
2739
2744
  );
2740
2745
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-github",
3
- "version": "0.164.0",
3
+ "version": "0.166.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -31,7 +31,7 @@
31
31
  "@sinclair/typebox": "^0.34.49",
32
32
  "drizzle-orm": "^0.45.2",
33
33
  "zod": "^4.4.3",
34
- "@sentry/junior-plugin-api": "0.164.0"
34
+ "@sentry/junior-plugin-api": "0.166.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^25.9.1",
@@ -23,6 +23,7 @@ Use `git` and `gh` for repository work. Use `github_createPullRequest`, not `gh
23
23
  - Base conclusions on repository evidence. Do not claim a check ran unless it did.
24
24
  - For Junior-owned pull requests, push the branch before creating the PR. The runtime supplies repository-scoped GitHub App credentials for both; try the operations before requesting remediation and never ask for a user token.
25
25
  - Use `github_cloneRepository` instead of shelling out to `git clone` when a repository is not already available in the sandbox.
26
+ - When a tool result shows a Workspace exists for the repo, prefer it via `switchWorkspace` over an ad-hoc checkout.
26
27
  - A tool-routing denial requires the named tool; only an upstream denial justifies permission remediation.
27
28
  - Stop for ambiguous targets, missing access, destructive operations, or unresolved upstream permission failures.
28
29