@sentry/junior-github 0.132.0 → 0.134.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.
@@ -0,0 +1,26 @@
1
+ import { type ToolRegistrationHookContext } from "@sentry/junior-plugin-api";
2
+ /** Clone one GitHub repository into the sandbox workspace. */
3
+ export declare function createGitHubCloneRepositoryTool(ctx: ToolRegistrationHookContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
4
+ repo: string;
5
+ directory?: string | undefined;
6
+ }, {
7
+ [x: string]: unknown;
8
+ path: string;
9
+ repo: string;
10
+ target: "cloneRepository";
11
+ truncated?: boolean | undefined;
12
+ continuation?: {
13
+ arguments: Record<string, unknown>;
14
+ reason?: string | undefined;
15
+ } | undefined;
16
+ }, {
17
+ [x: string]: unknown;
18
+ path: string;
19
+ repo: string;
20
+ target: "cloneRepository";
21
+ truncated?: boolean | undefined;
22
+ continuation?: {
23
+ arguments: Record<string, unknown>;
24
+ reason?: string | undefined;
25
+ } | undefined;
26
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-github",
3
- "version": "0.132.0",
3
+ "version": "0.134.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.132.0"
34
+ "@sentry/junior-plugin-api": "0.134.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^25.9.1",
@@ -22,6 +22,7 @@ Use `git` and `gh` for repository work. Use `github_createPullRequest`, not `gh
22
22
  - Preserve unrelated work. Never force-push, delete refs, or perform destructive merges.
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
+ - Use `github_cloneRepository` instead of shelling out to `git clone` when a repository is not already available in the sandbox.
25
26
  - A tool-routing denial requires the named tool; only an upstream denial justifies permission remediation.
26
27
  - Stop for ambiguous targets, missing access, destructive operations, or unresolved upstream permission failures.
27
28
 
@@ -44,7 +44,9 @@ Treat explicit repo flags as command-targeting safety rails, not as a credential
44
44
  | Request reviewers | `gh api repos/owner/repo/pulls/NUMBER/requested_reviewers --method POST --input reviewers.json` |
45
45
  | Remove requested reviewers | `gh api repos/owner/repo/pulls/NUMBER/requested_reviewers --method DELETE --input reviewers.json` |
46
46
  | Close pull request | `gh api repos/owner/repo/pulls/NUMBER --method PATCH -f state=closed` |
47
- | Submit human review | `gh api repos/owner/repo/pulls/NUMBER/reviews --method POST --input review.json` |
47
+ | Submit pull request review | `gh api repos/owner/repo/pulls/NUMBER/reviews --method POST --input review.json` |
48
+ | Post inline review comment | `gh api repos/owner/repo/pulls/NUMBER/comments --method POST --input comment.json` |
49
+ | Reply to inline review comment | `gh api repos/owner/repo/pulls/NUMBER/comments/COMMENT_ID/replies --method POST --input reply.json` |
48
50
  | View pull request | `gh pr view NUMBER --repo owner/repo [--json ...]` |
49
51
  | List pull requests | `gh pr list --repo owner/repo [--state open \| closed \| merged]` |
50
52
  | Diff pull request | `gh pr diff NUMBER --repo owner/repo` |
@@ -71,6 +73,7 @@ jr-rpc config set github.repo owner/repo
71
73
  - Before rebasing, merge-base analysis, blame/history inspection, or a base comparison, check whether the repository is shallow. Fetch a bounded depth of the base into `refs/remotes/origin/BASE`, deepen incrementally until the needed ancestry is present, and compare against `origin/BASE`; use `--unshallow` only when bounded deepening is insufficient. Never force-push to work around missing ancestry.
72
74
  - Before `github_createPullRequest`, push the head branch explicitly and resolve the target repo's default branch for `base`. That push requires GitHub write access to the remote.
73
75
  - Merge, fork creation, workflow reruns or cancellations, REST contents/Git database writes, and repository administration are outside the current write allowlist.
76
+ - Pull request reviews and inline review comments use the same repository-scoped `installation-write` credential as other bot-owned PR writes, so they post as Junior even on headless turns. Merge remains denied.
74
77
  - If the explicit `git push` fails with 401/403 or another access/permission error, verify the repo context and retry once. If it still fails, load troubleshooting guidance and report the exact command failure.
75
78
  - PR comments, labels, and assignees use GitHub's issue endpoints; use the `github-issues` REST guidance for those operations. All allowlisted bot writes share the same repository-scoped `installation-write` credential.
76
79
  - Return actionable errors for access, permission, not-found, and validation failures.