@sentry/junior-github 0.81.0 → 0.82.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,8 @@
1
+ export type GitHubAppPermissionLevel = "admin" | "read" | "write";
2
+ export type GitHubAppPermissions = Record<string, GitHubAppPermissionLevel>;
3
+ /** Validate configured GitHub App permissions before using them in grants. */
4
+ export declare function normalizePermissions(permissions: GitHubAppPermissions | undefined): GitHubAppPermissions | undefined;
5
+ /** Build the read-only installation-token permission body. */
6
+ export declare function readGrantPermissions(permissions: Record<string, unknown> | undefined): Record<string, "read">;
7
+ /** Expose configured permissions as plugin capabilities for host policy checks. */
8
+ export declare function permissionCapabilities(permissions: GitHubAppPermissions | undefined): string[] | undefined;
@@ -0,0 +1,12 @@
1
+ import { type PluginToolDefinition, type ToolRegistrationHookContext } from "@sentry/junior-plugin-api";
2
+ import { type Static } from "@sinclair/typebox";
3
+ declare const createIssueInputSchema: import("@sinclair/typebox").TObject<{
4
+ repo: import("@sinclair/typebox").TString;
5
+ title: import("@sinclair/typebox").TString;
6
+ body: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
7
+ labels: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
8
+ }>;
9
+ type CreateGitHubIssueInput = Static<typeof createIssueInputSchema>;
10
+ /** Own issue creation so provider writes use host egress and the footer stays deterministic. */
11
+ export declare function createGitHubIssueTool(ctx: ToolRegistrationHookContext): PluginToolDefinition<CreateGitHubIssueInput>;
12
+ export {};
@@ -0,0 +1,14 @@
1
+ import { type PluginToolDefinition, type ToolRegistrationHookContext } from "@sentry/junior-plugin-api";
2
+ import { type Static } from "@sinclair/typebox";
3
+ declare const createPullRequestInputSchema: import("@sinclair/typebox").TObject<{
4
+ repo: import("@sinclair/typebox").TString;
5
+ title: import("@sinclair/typebox").TString;
6
+ head: import("@sinclair/typebox").TString;
7
+ base: import("@sinclair/typebox").TString;
8
+ body: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
9
+ draft: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
10
+ }>;
11
+ type CreateGitHubPullRequestInput = Static<typeof createPullRequestInputSchema>;
12
+ /** Own PR creation so provider writes use host egress and the footer stays deterministic. */
13
+ export declare function createGitHubPullRequestTool(ctx: ToolRegistrationHookContext): PluginToolDefinition<CreateGitHubPullRequestInput>;
14
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { PluginToolDefinition, ToolRegistrationHookContext } from "@sentry/junior-plugin-api";
2
+ /** Build the GitHub plugin's runtime tools from their per-tool modules. */
3
+ export declare function createGitHubTools(ctx: ToolRegistrationHookContext): Record<string, PluginToolDefinition>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-github",
3
- "version": "0.81.0",
3
+ "version": "0.82.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,18 +13,31 @@
13
13
  },
14
14
  "exports": {
15
15
  ".": {
16
- "types": "./index.d.ts",
17
- "default": "./index.js"
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
18
  }
19
19
  },
20
20
  "files": [
21
- "index.d.ts",
22
- "index.js",
23
- "permissions.js",
21
+ "dist",
24
22
  "skills",
25
23
  "SETUP.md"
26
24
  ],
27
25
  "dependencies": {
28
- "@sentry/junior-plugin-api": "0.81.0"
26
+ "@sinclair/typebox": "^0.34.49",
27
+ "@sentry/junior-plugin-api": "0.82.0"
28
+ },
29
+ "devDependencies": {
30
+ "@types/node": "^25.9.1",
31
+ "msw": "^2.14.6",
32
+ "oxlint": "^1.66.0",
33
+ "tsup": "^8.5.1",
34
+ "typescript": "^6.0.3",
35
+ "vitest": "^4.1.7"
36
+ },
37
+ "scripts": {
38
+ "build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
39
+ "lint": "oxlint --config ../junior/.oxlintrc.json --deny-warnings src tests tsup.config.ts vitest.config.ts",
40
+ "test": "vitest run",
41
+ "typecheck": "tsc --noEmit"
29
42
  }
30
43
  }
@@ -1,12 +1,11 @@
1
1
  ---
2
2
  name: github-code
3
- description: Clone repositories, inspect source, edit code, and manage pull requests with GitHub CLI. Use for repo implementation questions, cloning/editing, PR inspection/mutation, and PR creation order questions. For PR creation order, answer that the branch must be pushed before `gh pr create`. Prefer this skill for repository and code tasks even when the repo concerns Sentry products.
4
- allowed-tools: bash
3
+ description: Work with GitHub repositories, source code, branches, commits, pushes, pull requests, reviews, diffs, and CI runs. Use for repo implementation tasks, source-code investigation, cloning/fetching, branch and push workflows, PR creation, PR updates, PR review feedback, and GitHub Actions checks. Prefer this skill for repository and code tasks even when the repo concerns Sentry products.
5
4
  ---
6
5
 
7
6
  # GitHub Code Operations
8
7
 
9
- Use `gh` and `git` for repository checkout, source investigation, code changes, commits, and pull requests.
8
+ Use `gh` and `git` for repository checkout, source investigation, code changes, commits, and pull request inspection or mutation. Use Junior's `github_createPullRequest` tool for new pull requests.
10
9
 
11
10
  ## References
12
11
 
@@ -110,7 +109,7 @@ Before creating:
110
109
 
111
110
  1. Changes committed on a non-default branch.
112
111
  2. Push the branch explicitly: `git push -u origin BRANCH`.
113
- 3. Create with explicit targeting: `gh pr create --repo owner/repo --head BRANCH ...`.
112
+ 3. Create with explicit targeting: `github_createPullRequest({ repo: "owner/repo", head: "BRANCH", base: "main", title: "...", body: "...", draft: true })`.
114
113
 
115
114
  Defaults:
116
115
 
@@ -1,6 +1,6 @@
1
- # GitHub CLI API Surface — code & pull requests
1
+ # GitHub API Surface — code & pull requests
2
2
 
3
- All operations use `gh` CLI. Commands must be deterministic and non-interactive.
3
+ PR creation uses Junior's `github_createPullRequest` tool. Other operations use `gh` CLI and must be deterministic and non-interactive.
4
4
 
5
5
  ## Repo scoping
6
6
 
@@ -18,37 +18,37 @@ Treat explicit repo flags as command-targeting safety rails, not as a credential
18
18
  | `github.contents.write` | `git push`, REST Git database writes, `gh api` create/update contents, `gh pr merge` |
19
19
  | `github.workflows.write` | Workflow-file changes under `.github/workflows` |
20
20
  | `github.pull-requests.read` | `gh pr view`, `gh pr list`, `gh pr diff`, `gh pr checks` |
21
- | `github.pull-requests.write` | `gh pr create --head <branch>` after explicit push, `gh pr edit`, `gh pr close` |
21
+ | `github.pull-requests.write` | `github_createPullRequest` after explicit push, `gh pr edit`, `gh pr close` |
22
22
  | `github.administration.write` + `github.contents.read` | `gh repo fork`; avoid for routine PR creation |
23
23
 
24
24
  ## Command matrix
25
25
 
26
- | Operation | Command |
27
- | ---------------------------------- | ------------------------------------------------------------------------------------------------- |
28
- | Clone repository (default shallow) | `gh repo clone owner/repo [DIRECTORY] -- --depth=1` |
29
- | Deepen shallow clone | `git -C DIRECTORY fetch --depth=N origin` |
30
- | Convert shallow clone to full | `git -C DIRECTORY fetch --unshallow` |
31
- | Check branch | `git -C DIRECTORY branch --show-current` |
32
- | Check worktree state | `git -C DIRECTORY status --short --branch` |
33
- | View commit log against base | `git -C DIRECTORY log BASE..HEAD --oneline` |
34
- | Diff against base | `git -C DIRECTORY diff BASE...HEAD` |
35
- | Create branch | `git -C DIRECTORY checkout -b BRANCH` |
36
- | Stage and commit | `git -C DIRECTORY add -A && git -C DIRECTORY commit -m "message"` |
37
- | Push branch before PR creation | `git -C DIRECTORY push -u origin BRANCH` |
38
- | Create pull request (draft) | `gh pr create --draft --repo owner/repo --head BRANCH --base BASE --title "..." --body-file PATH` |
39
- | Update pull request | `gh pr edit NUMBER --repo owner/repo [--title "..."] [--body-file PATH]` |
40
- | Close pull request | `gh pr close NUMBER --repo owner/repo` |
41
- | Merge pull request | `gh pr merge NUMBER --repo owner/repo [--merge \| --squash \| --rebase]` |
42
- | View pull request | `gh pr view NUMBER --repo owner/repo [--json ...]` |
43
- | List pull requests | `gh pr list --repo owner/repo [--state open \| closed \| merged]` |
44
- | Diff pull request | `gh pr diff NUMBER --repo owner/repo` |
45
- | Check pull request status | `gh pr checks NUMBER --repo owner/repo` |
46
- | View PR review comments | `gh api repos/{owner}/{repo}/pulls/{number}/comments` |
47
- | View PR reviews | `gh api repos/{owner}/{repo}/pulls/{number}/reviews` |
48
- | Dispatch workflow | `gh workflow run WORKFLOW -R owner/repo --ref REF [-f key=value ...]` |
49
- | List workflow runs | `gh run list -R owner/repo --workflow WORKFLOW [--limit N] [--json ...]` |
50
- | View workflow run | `gh run view RUN_ID -R owner/repo [--json ...] [--log-failed]` |
51
- | Watch workflow run | `gh run watch RUN_ID -R owner/repo --exit-status` |
26
+ | Operation | Command |
27
+ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
28
+ | Clone repository (default shallow) | `gh repo clone owner/repo [DIRECTORY] -- --depth=1` |
29
+ | Deepen shallow clone | `git -C DIRECTORY fetch --depth=N origin` |
30
+ | Convert shallow clone to full | `git -C DIRECTORY fetch --unshallow` |
31
+ | Check branch | `git -C DIRECTORY branch --show-current` |
32
+ | Check worktree state | `git -C DIRECTORY status --short --branch` |
33
+ | View commit log against base | `git -C DIRECTORY log BASE..HEAD --oneline` |
34
+ | Diff against base | `git -C DIRECTORY diff BASE...HEAD` |
35
+ | Create branch | `git -C DIRECTORY checkout -b BRANCH` |
36
+ | Stage and commit | `git -C DIRECTORY add -A && git -C DIRECTORY commit -m "message"` |
37
+ | Push branch before PR creation | `git -C DIRECTORY push -u origin BRANCH` |
38
+ | Create pull request (draft) | `github_createPullRequest({ repo: "owner/repo", head: "BRANCH", base: "BASE", title: "...", body: "...", draft: true })` |
39
+ | Update pull request | `gh pr edit NUMBER --repo owner/repo [--title "..."] [--body-file PATH]` |
40
+ | Close pull request | `gh pr close NUMBER --repo owner/repo` |
41
+ | Merge pull request | `gh pr merge NUMBER --repo owner/repo [--merge \| --squash \| --rebase]` |
42
+ | View pull request | `gh pr view NUMBER --repo owner/repo [--json ...]` |
43
+ | List pull requests | `gh pr list --repo owner/repo [--state open \| closed \| merged]` |
44
+ | Diff pull request | `gh pr diff NUMBER --repo owner/repo` |
45
+ | Check pull request status | `gh pr checks NUMBER --repo owner/repo` |
46
+ | View PR review comments | `gh api repos/{owner}/{repo}/pulls/{number}/comments` |
47
+ | View PR reviews | `gh api repos/{owner}/{repo}/pulls/{number}/reviews` |
48
+ | Dispatch workflow | `gh workflow run WORKFLOW -R owner/repo --ref REF [-f key=value ...]` |
49
+ | List workflow runs | `gh run list -R owner/repo --workflow WORKFLOW [--limit N] [--json ...]` |
50
+ | View workflow run | `gh run view RUN_ID -R owner/repo [--json ...] [--log-failed]` |
51
+ | Watch workflow run | `gh run watch RUN_ID -R owner/repo --exit-status` |
52
52
 
53
53
  ## Config helpers
54
54
 
@@ -64,7 +64,7 @@ jr-rpc config set github.repo owner/repo
64
64
  - A local `git commit` does not call GitHub. Pushing that commit does: `git push` requires `github.contents.write` on the target repo and requester write access.
65
65
  - REST Git commit construction also requires `github.contents.write`: `POST /git/blobs`, `POST /git/trees`, `POST /git/commits`, `POST /git/refs`, and `PATCH /git/refs/{ref}`.
66
66
  - If the commit changes workflow files under `.github/workflows`, expect `github.workflows.write` in addition to contents write.
67
- - Before `gh pr create`, push the head branch explicitly, then use `--head` so `gh` does not trigger hidden push/fork behavior. That push requires GitHub write access to the remote.
67
+ - Before `github_createPullRequest`, push the head branch explicitly. That push requires GitHub write access to the remote.
68
68
  - Do not use fork creation as the normal PR path. GitHub requires Administration write plus Contents read for `POST /repos/{owner}/{repo}/forks`, and the app must be installed on both source and destination accounts.
69
69
  - 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.
70
70
  - `gh pr edit` is not a single-permission command: title/body/base/reviewer changes need pull request write permission; label, assignee, and milestone changes need issue write permission (use the `github-issues` skill); project flags are outside the current GitHub App permission guidance.
@@ -2,22 +2,22 @@
2
2
 
3
3
  Use this table to recover quickly while keeping operations deterministic.
4
4
 
5
- | Symptom | Likely cause | Fix |
6
- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
7
- | `unknown command "..."` from `gh` | CLI version too old or wrong binary in the plugin runtime. | Verify `gh --version`; if it is unavailable or too old, report that the GitHub plugin runtime dependency is not available. |
8
- | `unknown flag: --depth` from `gh repo clone` | `git clone` flags were passed before `--`. | Pass clone flags after `--`, for example `gh repo clone owner/repo -- --depth=1`. |
9
- | `Missing required option --repo` | Repo not passed and no default was resolved. | Resolve with `jr-rpc config get github.repo`; pass `--repo owner/repo` explicitly when missing. |
10
- | Command affects or authenticates against the wrong repo | Stale `github.repo` default or authenticated command missing explicit repo. | Pass `--repo owner/repo` for the target repository, or update `github.repo` before retrying. |
11
- | `GraphQL: Could not resolve to a Repository` | Repo slug is wrong or inaccessible. | Validate `owner/repo` and confirm app installation on target repository. |
12
- | 401 Unauthorized | Issued GitHub credentials were rejected upstream. | Verify the target repo, then use the grant/auth signal to distinguish stale user OAuth from app installation or host env setup. |
13
- | `junior-auth-required provider=github grant=user-write` | User-to-server OAuth is missing or stale for a write request. | Follow the private OAuth prompt; do not ask the user to paste or manage tokens manually. |
14
- | `git push` fails with 401/403 or auth/permission output | Write permission is missing, app installation is too narrow, or remote is wrong. | Verify the remote and repo context, retry once, then confirm app permissions and installation scope if it still fails. |
15
- | Bash result includes `permission_denied` with `source: "upstream"` | GitHub returned 403 after Junior injected the named grant. | Do not call this a Junior runtime block. Use the message, connected account, upstream target, grant requirements, accepted-permissions, and SSO fields to explain the GitHub denial. |
16
- | 403 Forbidden | App lacks required permission on repo or install scope is too narrow. | Verify the repo context, then confirm GitHub App permissions and installation scope. |
17
- | `gh auth status` shows `Token scopes: none` | Expected for GitHub App user-to-server tokens. | Do not treat this as read-only proof. Use the failed command, `permission_denied.acceptedPermissions`, and GitHub App permissions instead. |
18
- | `gh pr create` fails with auth/permission errors or tries to push interactively | The branch was not pushed first, or repo context is wrong. | Push the branch explicitly first, then rerun `gh pr create --repo owner/repo --head BRANCH ...`. |
19
- | `git blame`, long log history, or old commits are missing after clone | Repo was cloned shallow by design. | Deepen incrementally with `git -C DIRECTORY fetch --depth=N origin`, or `git -C DIRECTORY fetch --unshallow` when full history is required. |
20
- | `sandbox setup failed (dnf install gh failed ...)` | `gh` package not available from the plugin runtime dependency bootstrap. | Report the plugin runtime bootstrap failure; do not try to repair package installation from the skill workflow. |
5
+ | Symptom | Likely cause | Fix |
6
+ | --------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
7
+ | `unknown command "..."` from `gh` | CLI version too old or wrong binary in the plugin runtime. | Verify `gh --version`; if it is unavailable or too old, report that the GitHub plugin runtime dependency is not available. |
8
+ | `unknown flag: --depth` from `gh repo clone` | `git clone` flags were passed before `--`. | Pass clone flags after `--`, for example `gh repo clone owner/repo -- --depth=1`. |
9
+ | `Missing required option --repo` | Repo not passed and no default was resolved. | Resolve with `jr-rpc config get github.repo`; pass `--repo owner/repo` explicitly when missing. |
10
+ | Command affects or authenticates against the wrong repo | Stale `github.repo` default or authenticated command missing explicit repo. | Pass `--repo owner/repo` for the target repository, or update `github.repo` before retrying. |
11
+ | `GraphQL: Could not resolve to a Repository` | Repo slug is wrong or inaccessible. | Validate `owner/repo` and confirm app installation on target repository. |
12
+ | 401 Unauthorized | Issued GitHub credentials were rejected upstream. | Verify the target repo, then use the grant/auth signal to distinguish stale user OAuth from app installation or host env setup. |
13
+ | `junior-auth-required provider=github grant=user-write` | User-to-server OAuth is missing or stale for a write request. | Follow the private OAuth prompt; do not ask the user to paste or manage tokens manually. |
14
+ | `git push` fails with 401/403 or auth/permission output | Write permission is missing, app installation is too narrow, or remote is wrong. | Verify the remote and repo context, retry once, then confirm app permissions and installation scope if it still fails. |
15
+ | Bash result includes `permission_denied` with `source: "upstream"` | GitHub returned 403 after Junior injected the named grant. | Do not call this a Junior runtime block. Use the message, connected account, upstream target, grant requirements, accepted-permissions, and SSO fields to explain the GitHub denial. |
16
+ | 403 Forbidden | App lacks required permission on repo or install scope is too narrow. | Verify the repo context, then confirm GitHub App permissions and installation scope. |
17
+ | `gh auth status` shows `Token scopes: none` | Expected for GitHub App user-to-server tokens. | Do not treat this as read-only proof. Use the failed command, `permission_denied.acceptedPermissions`, and GitHub App permissions instead. |
18
+ | `github_createPullRequest` fails with auth/permission errors | The branch was not pushed first, or repo context is wrong. | Push the branch explicitly first, then retry `github_createPullRequest` with explicit `repo`, `head`, and `base` values. |
19
+ | `git blame`, long log history, or old commits are missing after clone | Repo was cloned shallow by design. | Deepen incrementally with `git -C DIRECTORY fetch --depth=N origin`, or `git -C DIRECTORY fetch --unshallow` when full history is required. |
20
+ | `sandbox setup failed (dnf install gh failed ...)` | `gh` package not available from the plugin runtime dependency bootstrap. | Report the plugin runtime bootstrap failure; do not try to repair package installation from the skill workflow. |
21
21
 
22
22
  ## Retry guidance
23
23
 
@@ -1,12 +1,11 @@
1
1
  ---
2
2
  name: github-issues
3
- description: Create, update, comment on, label, and inspect GitHub issues via GitHub CLI with concise, evidence-backed content. Use when users ask to open, edit, view, close, reopen, or triage GitHub issues — including tracking bugs, features, or tasks. Prefer this skill over generic repository tools for issue operations; do not use for pull requests, branches, pushes, or PR creation order questions.
4
- allowed-tools: bash
3
+ description: Create, update, comment on, label, and inspect GitHub issues with concise, evidence-backed content. Use when users ask to open, edit, view, close, reopen, or triage GitHub issues — including tracking bugs, features, or tasks. Prefer this skill over generic repository tools for issue operations; do not use for pull requests, branches, pushes, or PR creation order questions.
5
4
  ---
6
5
 
7
6
  # GitHub Issue Operations
8
7
 
9
- Issue create, update, comment, label, state, and inspection via `gh` CLI.
8
+ Issue create via Junior's `github_createIssue` tool; update, comment, label, state, and inspection via `gh` CLI.
10
9
  Use only for GitHub issues. For pull requests, branches, pushes, or PR creation order questions, load `github-code` instead.
11
10
 
12
11
  ## Reference loading
@@ -67,7 +66,6 @@ Follow [references/research-rules.md](references/research-rules.md) for cross-ty
67
66
  - Attach screenshots from the thread as image links when present.
68
67
  - Include code snippets, related issues, and related PRs only when they materially improve the issue.
69
68
 
70
-
71
69
  ### 4. Verify draft
72
70
 
73
71
  Before running the `gh` create/edit command, check each gate. If any fails, revise and re-check before executing:
@@ -80,7 +78,8 @@ Run [references/issue-quality-checklist.md](references/issue-quality-checklist.m
80
78
 
81
79
  ### 5. Execute
82
80
 
83
- - Use `gh issue` commands from [references/api-surface.md](references/api-surface.md).
81
+ - Use `github_createIssue` for new issues so Junior owns idempotency and session-link footers.
82
+ - Use `gh issue` commands from [references/api-surface.md](references/api-surface.md) for non-create operations.
84
83
  - For issue listing or other read-only inspection, prefer `--json` output so empty results still produce deterministic stdout.
85
84
  - Check duplicates silently before creating a new issue. Do not mention this check in the final reply unless a duplicate blocks creation.
86
85
 
@@ -1,6 +1,6 @@
1
- # GitHub CLI API Surface — issues
1
+ # GitHub Issue API Surface
2
2
 
3
- All operations use `gh` CLI. Commands must be deterministic and non-interactive.
3
+ Issue creation uses Junior's `github_createIssue` tool. Other issue operations use `gh` CLI and must be deterministic and non-interactive.
4
4
 
5
5
  ## Repo scoping
6
6
 
@@ -10,16 +10,16 @@ Treat explicit repo flags as command-targeting safety rails, not as a credential
10
10
 
11
11
  ## GitHub App permission guidance
12
12
 
13
- | Permission capability | Commands |
14
- | --------------------- | ------------------------------------------------------------------------------------------- |
15
- | `github.issues.read` | `gh issue view`, `gh api /repos/.../comments` |
16
- | `github.issues.write` | `gh issue create`, `gh issue edit`, `gh issue comment`, `gh issue close`, `gh issue reopen` |
13
+ | Permission capability | Operations |
14
+ | --------------------- | ---------------------------------------------------------------------------------------------- |
15
+ | `github.issues.read` | `gh issue view`, `gh api /repos/.../comments` |
16
+ | `github.issues.write` | `github_createIssue`, `gh issue edit`, `gh issue comment`, `gh issue close`, `gh issue reopen` |
17
17
 
18
18
  ## Command matrix
19
19
 
20
20
  | Operation | Command |
21
21
  | ------------------- | ------------------------------------------------------------------------------------------------------------- |
22
- | Create issue | `gh issue create --repo owner/repo --title "..." --body-file PATH` |
22
+ | Create issue | `github_createIssue({ repo: "owner/repo", title: "...", body: "...", labels: ["..."] })` |
23
23
  | Update issue fields | `gh issue edit NUMBER --repo owner/repo [--title "..."] [--body-file PATH]` |
24
24
  | Close issue | `gh issue close NUMBER --repo owner/repo [--comment "..."]` |
25
25
  | Reopen issue | `gh issue reopen NUMBER --repo owner/repo` |
@@ -41,6 +41,6 @@ jr-rpc config set github.repo owner/repo
41
41
 
42
42
  - Prefer `--json` output for machine-readable parsing where available.
43
43
  - Use `gh api` for endpoints not fully covered by `gh issue` subcommands.
44
- - For automation, always fully specify `gh issue create` with `--title` and `--body` or `--body-file`; never rely on interactive prompts.
44
+ - For creation, call `github_createIssue` directly instead of shelling out to `gh issue create`.
45
45
  - Keep `--repo owner/repo` explicit when working across repositories.
46
46
  - Return actionable errors for access, permission, not-found, and validation failures.
package/index.d.ts DELETED
@@ -1,49 +0,0 @@
1
- import type { PluginRegistration } from "@sentry/junior-plugin-api";
2
-
3
- export type GitHubAppPermissionLevel = "read" | "write" | "admin";
4
-
5
- /** Configure the built-in GitHub plugin manifest and hooks. */
6
- export interface GitHubPluginOptions {
7
- /**
8
- * Extra OAuth `scope` values to request during GitHub App user authorization.
9
- *
10
- * GitHub App user tokens report empty scopes, so Junior treats this as a
11
- * local reauthorization contract only. Effective access still comes from the
12
- * app permissions, installation repositories, and requesting user's access.
13
- */
14
- additionalUserScopes?: string[];
15
-
16
- /**
17
- * GitHub App installation permissions Junior should request for app tokens.
18
- *
19
- * Keys may use GitHub permission names with underscores or hyphens. Junior
20
- * records these as plugin capabilities and requests read-only installation
21
- * tokens by scoping read-capable permissions down to `read`.
22
- * GitHub remains the source of truth for whether a permission exists.
23
- */
24
- appPermissions?: Record<string, GitHubAppPermissionLevel>;
25
-
26
- /** Environment variable containing the GitHub App id. */
27
- appIdEnv?: string;
28
-
29
- /** Environment variable containing Junior's Git committer email. */
30
- botEmailEnv?: string;
31
-
32
- /** Environment variable containing Junior's Git committer name. */
33
- botNameEnv?: string;
34
-
35
- /** Environment variable containing the GitHub App OAuth client id. */
36
- clientIdEnv?: string;
37
-
38
- /** Environment variable containing the GitHub App OAuth client secret. */
39
- clientSecretEnv?: string;
40
-
41
- /** Environment variable containing the GitHub App installation id. */
42
- installationIdEnv?: string;
43
-
44
- /** Environment variable containing the GitHub App private key. */
45
- privateKeyEnv?: string;
46
- }
47
-
48
- /** Register GitHub manifest content and runtime hooks. */
49
- export function githubPlugin(options?: GitHubPluginOptions): PluginRegistration;