@github-tools/sdk 1.9.0 → 1.11.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.
Files changed (44) hide show
  1. package/README.md +86 -27
  2. package/dist/connect/eve.d.mts +16 -10
  3. package/dist/connect/eve.d.mts.map +1 -1
  4. package/dist/connect/eve.mjs +21 -11
  5. package/dist/connect/eve.mjs.map +1 -1
  6. package/dist/connect.d.mts +123 -10
  7. package/dist/connect.d.mts.map +1 -1
  8. package/dist/connect.mjs +3 -3
  9. package/dist/eve-runtime-BqfQZAP7.d.mts +54 -0
  10. package/dist/eve-runtime-BqfQZAP7.d.mts.map +1 -0
  11. package/dist/eve-runtime-DXZgfCMb.mjs +701 -0
  12. package/dist/eve-runtime-DXZgfCMb.mjs.map +1 -0
  13. package/dist/eve-runtime.d.mts +4 -0
  14. package/dist/eve-runtime.mjs +3 -0
  15. package/dist/eve.d.mts +33 -34
  16. package/dist/eve.d.mts.map +1 -1
  17. package/dist/eve.mjs +384 -3
  18. package/dist/eve.mjs.map +1 -0
  19. package/dist/{index-CtID5dUi.d.mts → index-BNeMjmgp.d.mts} +183 -19
  20. package/dist/index-BNeMjmgp.d.mts.map +1 -0
  21. package/dist/index.d.mts +2 -2
  22. package/dist/index.mjs +3 -3
  23. package/dist/{src-D6vC3V8r.mjs → src-jQWS2Txw.mjs} +414 -68
  24. package/dist/src-jQWS2Txw.mjs.map +1 -0
  25. package/dist/token-OPdZa0t3.mjs +390 -0
  26. package/dist/token-OPdZa0t3.mjs.map +1 -0
  27. package/dist/{types-BVLof-5R.d.mts → types-BD5YvGxm.d.mts} +7 -3
  28. package/dist/types-BD5YvGxm.d.mts.map +1 -0
  29. package/dist/{types-BOnJ0Rou.d.mts → types-BDO-Mmn6.d.mts} +4 -3
  30. package/dist/types-BDO-Mmn6.d.mts.map +1 -0
  31. package/dist/workflow.d.mts +1 -1
  32. package/dist/workflow.mjs +2 -2
  33. package/dist/{write-tools-cg_ialNd.mjs → write-tools-Dk32V9Hl.mjs} +885 -26
  34. package/dist/write-tools-Dk32V9Hl.mjs.map +1 -0
  35. package/package.json +5 -1
  36. package/dist/eve-DmiXBuli.mjs +0 -864
  37. package/dist/eve-DmiXBuli.mjs.map +0 -1
  38. package/dist/index-CtID5dUi.d.mts.map +0 -1
  39. package/dist/src-D6vC3V8r.mjs.map +0 -1
  40. package/dist/token-sbepWIkd.mjs +0 -138
  41. package/dist/token-sbepWIkd.mjs.map +0 -1
  42. package/dist/types-BOnJ0Rou.d.mts.map +0 -1
  43. package/dist/types-BVLof-5R.d.mts.map +0 -1
  44. package/dist/write-tools-cg_ialNd.mjs.map +0 -1
package/README.md CHANGED
@@ -33,7 +33,7 @@ They all reach the GitHub API, but none of them were built as an agent's tool la
33
33
  | Production agents that must survive restarts and timeouts | [Durable Agents](#durable-agents-vercel-workflow-sdk) |
34
34
  | A GitHub, Slack, or Discord bot | [Chat SDK docs](https://github-tools.com/frameworks/chat-sdk) |
35
35
 
36
- 53 tools cover repositories, branches, pull requests, issues, commits, releases, checks and statuses, search, gists, and workflows. See the full [Tools Catalog](https://github-tools.com/api/tools-catalog). Write operations support granular approval control out of the box.
36
+ 79 tools cover repositories, branches, pull requests, issues, reactions, discussions, notifications, commits, releases, checks and statuses, search, gists, and workflows. See the full [Tools Catalog](https://github-tools.com/api/tools-catalog). Write operations support granular approval control out of the box.
37
37
 
38
38
  ## Installation
39
39
 
@@ -81,7 +81,16 @@ createGithubTools({ token, preset: 'security-audit' })
81
81
  // Release manager: releases, compare diff, commits, workflow runs, pull requests
82
82
  createGithubTools({ token, preset: 'release-manager' })
83
83
 
84
- // Full maintenance: all tools
84
+ // Discussion moderator: Discussions plus light issue context
85
+ createGithubTools({ token, preset: 'discussion-moderator' })
86
+
87
+ // Notification inbox: triage user notifications (needs a Notifications PAT)
88
+ createGithubTools({ token, preset: 'notification-inbox' })
89
+
90
+ // PR author: branches, file edits, and opening PRs
91
+ createGithubTools({ token, preset: 'pr-author' })
92
+
93
+ // Full catalog: all tools (same as omitting preset)
85
94
  createGithubTools({ token, preset: 'maintainer' })
86
95
  ```
87
96
 
@@ -93,15 +102,18 @@ createGithubTools({ token, preset: ['code-review', 'issue-triage'] })
93
102
 
94
103
  | Preset | Tools included |
95
104
  |---|---|
96
- | `code-review` | `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`, `getPullRequestContext`, `getFileContent`, `listCommits`, `getCommit`, `getBlame`, `compareCommits`, `getRepository`, `listBranches`, `searchCode`, `listCheckRuns`, `getCombinedStatus`, `addPullRequestComment`, `createPullRequestReview`, `requestReviewers` |
97
- | `issue-triage` | `listIssues`, `getIssue`, `getIssueContext`, `createIssue`, `addIssueComment`, `closeIssue`, `listLabels`, `addLabels`, `removeLabel`, `addAssignees`, `removeAssignees`, `getRepository`, `searchRepositories`, `searchCode` |
98
- | `repo-explorer` | All read-only tools including gists, workflows, checks/statuses, and releases (no write operations) |
105
+ | `code-review` | `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`, `getPullRequestContext`, `getFileContent`, `listCommits`, `getCommit`, `getBlame`, `compareCommits`, `getRepository`, `listBranches`, `searchCode`, `listCheckRuns`, `getCombinedStatus`, `updatePullRequest`, `addPullRequestComment`, `updatePullRequestComment`, `deletePullRequestComment`, `createPullRequestReview`, `requestReviewers` |
106
+ | `issue-triage` | `listIssues`, `getIssueContext`, `listIssueComments`, `createIssue`, `addIssueComment`, `updateIssueComment`, `deleteIssueComment`, `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `createLabel`, `updateLabel`, `deleteLabel`, `addAssignees`, `removeAssignees`, `listIssueReactions`, `addIssueReaction`, `listCommentReactions`, `addCommentReaction`, `getRepository`, `searchRepositories`, `searchCode`, `searchIssues` |
107
+ | `repo-explorer` | All read-only tools including discussions, gists, workflows, checks/statuses, and releases (no write operations) |
99
108
  | `ci-ops` | `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`, `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`, `getRepository`, `listBranches`, `listCommits`, `getCommit` |
100
109
  | `security-audit` | Read-only exploration (`getFileContent`, `getRepositoryTree`, `searchCode`, `listCommits`, `getCommit`, `getBlame`, `compareCommits`), PR and CI visibility, plus `createIssue`, `addIssueComment`, `addLabels` to report findings (no destructive writes) |
101
- | `release-manager` | `listReleases`, `getLatestRelease`, `getRelease`, `getReleaseContext`, `createRelease`, `compareCommits`, `listCommits`, `getCommit`, `listWorkflowRuns`, `getWorkflowRun`, `listPullRequests`, `getPullRequest`, `getRepository`, `listBranches` |
102
- | `maintainer` | All 57 tools |
110
+ | `release-manager` | `listReleases`, `getLatestRelease`, `getRelease`, `getReleaseContext`, `createRelease`, `updateRelease`, `deleteRelease`, `compareCommits`, `listCommits`, `getCommit`, `listWorkflowRuns`, `getWorkflowRun`, `listPullRequests`, `getPullRequest`, `getRepository`, `listBranches` |
111
+ | `discussion-moderator` | `listDiscussions`, `getDiscussion`, `addDiscussionComment`, `getRepository`, `searchIssues`, `getIssueContext`, `addIssueComment` |
112
+ | `notification-inbox` | `listNotifications`, `markNotificationRead`, `getIssue`, `getPullRequest`, `getRepository` (requires a Notifications PAT) |
113
+ | `pr-author` | `getRepository`, `listBranches`, `getFileContent`, `createBranch`, `createOrUpdateFile`, `createPullRequest`, `updatePullRequest`, `getPullRequest`, `listPullRequestFiles`, `compareCommits`, `getCommit` |
114
+ | `maintainer` | All 79 tools |
103
115
 
104
- Omit `preset` to get all tools (same as `maintainer`). Full breakdown: [Tools Catalog](https://github-tools.com/api/tools-catalog).
116
+ Start with the smallest preset that fits. Use `maintainer` or omit `preset` when you need the full catalog. Full breakdown: [Tools Catalog](https://github-tools.com/api/tools-catalog).
105
117
 
106
118
  ### Cherry-Picking Tools
107
119
 
@@ -146,7 +158,7 @@ createGithubTools({
146
158
  })
147
159
  ```
148
160
 
149
- Write tools: `createBranch`, `forkRepository`, `createRepository`, `createOrUpdateFile`, `createPullRequest`, `mergePullRequest`, `addPullRequestComment`, `createPullRequestReview`, `requestReviewers`, `createIssue`, `addIssueComment`, `closeIssue`, `addLabels`, `removeLabel`, `addAssignees`, `removeAssignees`, `createGist`, `updateGist`, `deleteGist`, `createGistComment`, `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`, `createRelease`.
161
+ Write tools: `createBranch`, `forkRepository`, `createRepository`, `createOrUpdateFile`, `createPullRequest`, `mergePullRequest`, `updatePullRequest`, `addPullRequestComment`, `updatePullRequestComment`, `deletePullRequestComment`, `createPullRequestReview`, `requestReviewers`, `createIssue`, `addIssueComment`, `updateIssueComment`, `deleteIssueComment`, `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `createLabel`, `updateLabel`, `deleteLabel`, `addAssignees`, `removeAssignees`, `addIssueReaction`, `addCommentReaction`, `addDiscussionComment`, `markNotificationRead`, `createGist`, `updateGist`, `deleteGist`, `createGistComment`, `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`, `createRelease`, `updateRelease`, `deleteRelease`.
150
162
 
151
163
  All other tools are read-only and never require approval.
152
164
 
@@ -315,7 +327,7 @@ connectGithubTools(
315
327
 
316
328
  ## eve
317
329
 
318
- [eve](https://eve.dev) is Vercel's filesystem-first agent framework. `@github-tools/eve-extension` is the **recommended** way to add GitHub tools to an eve agent: a mountable [eve extension](https://eve.dev/docs/extensions), no CLI setup, no direct SDK import in `agent/tools/`. The lower-level `@github-tools/sdk/eve` subpath (`defineDynamic`) is **deprecated** in its favor; it keeps working and is documented below for existing agents.
330
+ [eve](https://eve.dev) is Vercel's filesystem-first agent framework. `@github-tools/eve-extension` is the **recommended** way to add GitHub tools to an eve agent: a mountable [eve extension](https://eve.dev/docs/extensions), no CLI setup, no direct SDK import in `agent/tools/`. The legacy `createGithubTools` / per-tool factories on `@github-tools/sdk/eve` are **deprecated** for that registration pattern; they keep working and are documented below for existing agents. Shared runtime helpers for the extension live on `@github-tools/sdk/eve-runtime` (not deprecated).
319
331
 
320
332
  ### eve extension (recommended)
321
333
 
@@ -418,7 +430,11 @@ eve replays completed steps but re-runs steps interrupted mid-execution. Write t
418
430
  | `closeIssue` | Natural when already closed |
419
431
  | `createBranch` | Natural when branch exists at same SHA |
420
432
  | `removeAssignees` | Natural: removing an assignee that isn't assigned is a no-op on GitHub |
421
- | `addIssueComment`, `createIssue`, `mergePullRequest`, `createRelease`, … | **Not** idempotent: each call creates new side effects |
433
+ | `addIssueReaction`, `addCommentReaction` | Natural: GitHub returns the existing reaction when the user already reacted with the same content |
434
+ | `markNotificationRead` | Natural when the thread is already read |
435
+ | `updateIssue`, `updatePullRequest`, `updateRelease`, `updateIssueComment`, `updatePullRequestComment` | **Not** idempotent: each call applies a new revision |
436
+ | `deleteIssueComment`, `deletePullRequestComment`, `deleteRelease` | **Not** idempotent: deleting an already-deleted resource returns 404 from GitHub |
437
+ | `addIssueComment`, `addDiscussionComment`, `createIssue`, `mergePullRequest`, `createRelease`, … | **Not** idempotent: each call creates new side effects |
422
438
 
423
439
  Gate non-idempotent writes behind `always()` or `once()` where replay safety matters.
424
440
 
@@ -469,7 +485,10 @@ List tools (`listCommits`, `listPullRequests`, `listIssues`, `listWorkflowRuns`,
469
485
  | `getPullRequestContext` | Fetch PR details plus files, reviews, and optional CI checks in one call |
470
486
  | `createPullRequest` | Open a new PR |
471
487
  | `mergePullRequest` | Merge a PR (merge, squash, or rebase) |
488
+ | `updatePullRequest` | Update a PR's title, body, state, base branch, or draft status |
472
489
  | `addPullRequestComment` | Post a comment on a PR |
490
+ | `updatePullRequestComment` | Edit the body of a PR comment |
491
+ | `deletePullRequestComment` | Permanently delete a PR comment |
473
492
  | `createPullRequestReview` | Submit a formal review (approve, request changes, or comment) with inline comments |
474
493
  | `requestReviewers` | Request reviews from users or teams on a PR |
475
494
 
@@ -479,16 +498,49 @@ List tools (`listCommits`, `listPullRequests`, `listIssues`, `listWorkflowRuns`,
479
498
  |---|---|
480
499
  | `listIssues` | List issues filtered by state and labels |
481
500
  | `getIssue` | Get an issue's details (body truncated by default; set `detail: full` for complete text) |
482
- | `getIssueContext` | Fetch an issue plus available labels and recent comments in one call |
501
+ | `getIssueContext` | Fetch an issue plus label names and recent comments in one call |
502
+ | `listIssueComments` | List comments on an issue (paginated; prefer `getIssueContext` for the first page) |
483
503
  | `createIssue` | Open a new issue |
484
504
  | `addIssueComment` | Post a comment on an issue |
505
+ | `updateIssueComment` | Edit the body of an issue comment |
506
+ | `deleteIssueComment` | Permanently delete an issue comment |
485
507
  | `closeIssue` | Close an issue (completed or not planned) |
508
+ | `updateIssue` | Update an issue's title, body, labels, milestone, or assignees — set `state: 'open'` to reopen |
486
509
  | `listLabels` | List labels available in a repository |
487
510
  | `addLabels` | Add labels to an issue or pull request |
488
511
  | `removeLabel` | Remove a label from an issue or pull request |
512
+ | `createLabel` | Create a label in a repository |
513
+ | `updateLabel` | Update a label's name, color, or description |
514
+ | `deleteLabel` | Delete a label from a repository permanently |
489
515
  | `addAssignees` | Assign users to an issue or pull request |
490
516
  | `removeAssignees` | Remove assignees from an issue or pull request |
491
517
 
518
+ ### Reactions
519
+
520
+ Pull request conversations share the issue numbering, so the issue-level tools work on PRs too.
521
+
522
+ | Tool | Description |
523
+ |---|---|
524
+ | `listIssueReactions` | List reactions on an issue or pull request, with per-emoji counts |
525
+ | `addIssueReaction` | React to an issue or pull request (`+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`, `rocket`, `eyes`) |
526
+ | `listCommentReactions` | List reactions on an issue or pull request comment |
527
+ | `addCommentReaction` | React to an issue or pull request comment |
528
+
529
+ ### Discussions
530
+
531
+ | Tool | Description |
532
+ |---|---|
533
+ | `listDiscussions` | List discussions, most recently updated first, optionally filtered by category name (cursor-paginated) |
534
+ | `getDiscussion` | Get a discussion by number (body truncated by default; set `detail: full` for complete text) |
535
+ | `addDiscussionComment` | Post a comment on a discussion |
536
+
537
+ ### Notifications
538
+
539
+ | Tool | Description |
540
+ |---|---|
541
+ | `listNotifications` | List notification threads for the authenticated user (unread only unless `all: true`) |
542
+ | `markNotificationRead` | Mark a single notification thread as read |
543
+
492
544
  ### Gists
493
545
 
494
546
  | Tool | Description |
@@ -530,6 +582,8 @@ List tools (`listCommits`, `listPullRequests`, `listIssues`, `listWorkflowRuns`,
530
582
  | `getRelease` | Get a specific release by ID, including its assets |
531
583
  | `getReleaseContext` | Fetch a release plus the previous release and tag comparison in one call |
532
584
  | `createRelease` | Create a new release (and its tag if needed) |
585
+ | `updateRelease` | Update a release's tag, target, title, notes, draft, or prerelease status |
586
+ | `deleteRelease` | Permanently delete a release (does not delete the underlying git tag) |
533
587
 
534
588
  ### Commits
535
589
 
@@ -544,8 +598,9 @@ List tools (`listCommits`, `listPullRequests`, `listIssues`, `listWorkflowRuns`,
544
598
 
545
599
  | Tool | Description |
546
600
  |---|---|
547
- | `searchCode` | Search code across GitHub with qualifier support |
601
+ | `searchCode` | Search code across GitHub with qualifier support (includes matching text snippets when available) |
548
602
  | `searchRepositories` | Search repositories by keyword, topic, language, stars, … |
603
+ | `searchIssues` | Search issues and pull requests using qualifiers like `is:open`, `type:pr`, or `label:bug` |
549
604
 
550
605
  ## GitHub Token
551
606
 
@@ -559,20 +614,23 @@ Create one at **GitHub → Settings → Developer settings → Personal access t
559
614
  |---|---|---|
560
615
  | **Metadata** | Read-only | Always required (auto-included) |
561
616
  | **Contents** | Read-only | `getRepository`, `listBranches`, `getFileContent`, `getRepositoryTree`, `listCommits`, `getCommit`, `getBlame`, `compareCommits`, `listReleases`, `getLatestRelease`, `getRelease`, `getReleaseContext` |
562
- | **Contents** | Read and write | `createBranch`, `createOrUpdateFile`, `createRelease` |
617
+ | **Contents** | Read and write | `createBranch`, `createOrUpdateFile`, `createRelease`, `updateRelease`, `deleteRelease` |
563
618
  | **Administration** | Read and write | `forkRepository`, `createRepository` |
564
619
  | **Pull requests** | Read-only | `listPullRequests`, `getPullRequest`, `listPullRequestFiles`, `listPullRequestReviews`, `getPullRequestContext` |
565
- | **Pull requests** | Read and write | `createPullRequest`, `mergePullRequest`, `addPullRequestComment`, `createPullRequestReview`, `requestReviewers` |
566
- | **Issues** | Read-only | `listIssues`, `getIssue`, `getIssueContext`, `listLabels` |
567
- | **Issues** | Read and write | `createIssue`, `addIssueComment`, `closeIssue`, `addLabels`, `removeLabel`, `addAssignees`, `removeAssignees` |
620
+ | **Pull requests** | Read and write | `createPullRequest`, `mergePullRequest`, `updatePullRequest`, `addPullRequestComment`, `updatePullRequestComment`, `deletePullRequestComment`, `createPullRequestReview`, `requestReviewers` |
621
+ | **Issues** | Read-only | `listIssues`, `getIssue`, `getIssueContext`, `listIssueComments`, `listLabels`, `listIssueReactions`, `listCommentReactions` |
622
+ | **Issues** | Read and write | `createIssue`, `addIssueComment`, `updateIssueComment`, `deleteIssueComment`, `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `createLabel`, `updateLabel`, `deleteLabel`, `addAssignees`, `removeAssignees`, `addIssueReaction`, `addCommentReaction` |
623
+ | **Discussions** | Read-only | `listDiscussions`, `getDiscussion` |
624
+ | **Discussions** | Read and write | `addDiscussionComment` |
568
625
  | **Gists** | Read-only | `listGists`, `getGist`, `listGistComments` |
569
626
  | **Gists** | Read and write | `createGist`, `updateGist`, `deleteGist`, `createGistComment` |
627
+ | **Notifications** (account) | Read and write | `listNotifications`, `markNotificationRead` |
570
628
  | **Actions** | Read-only | `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `getCiFailureContext` |
571
629
  | **Actions** | Read and write | `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun` |
572
630
  | **Checks** | Read-only | `listCheckRuns`, `getCiFailureContext` |
573
631
  | **Commit statuses** | Read-only | `getCombinedStatus`, `getCiFailureContext` |
574
632
 
575
- Search tools (`searchCode`, `searchRepositories`) work with any token.
633
+ Search tools (`searchCode`, `searchRepositories`, `searchIssues`) work with any token.
576
634
 
577
635
  ### Classic token
578
636
 
@@ -597,7 +655,7 @@ type GithubToolsOptions = {
597
655
 
598
656
  type GithubTokenInput = string | (() => Promise<string>)
599
657
 
600
- type GithubToolPreset = 'code-review' | 'issue-triage' | 'repo-explorer' | 'ci-ops' | 'security-audit' | 'release-manager' | 'maintainer'
658
+ type GithubToolPreset = 'code-review' | 'issue-triage' | 'repo-explorer' | 'ci-ops' | 'security-audit' | 'release-manager' | 'discussion-moderator' | 'notification-inbox' | 'pr-author' | 'maintainer'
601
659
  ```
602
660
 
603
661
  ### `createGithubAgent(options)`
@@ -607,13 +665,7 @@ Returns a `ToolLoopAgent` instance with `.generate()` and `.stream()` methods, p
607
665
  ```ts
608
666
  import { createGithubAgent } from '@github-tools/sdk'
609
667
 
610
- // Minimal: all tools, generic prompt
611
- const agent = createGithubAgent({
612
- model: 'anthropic/claude-sonnet-4.6',
613
- token: process.env.GITHUB_TOKEN!,
614
- })
615
-
616
- // With preset: scoped tools + tailored prompt
668
+ // Prefer a preset: scoped tools + tailored prompt
617
669
  const reviewer = createGithubAgent({
618
670
  model: 'anthropic/claude-sonnet-4.6',
619
671
  token: process.env.GITHUB_TOKEN!,
@@ -629,6 +681,13 @@ const triager = createGithubAgent({
629
681
  additionalInstructions: 'Focus on the nuxt/ui repository. Always respond in French.',
630
682
  })
631
683
 
684
+ // Full catalog (omit preset or use maintainer)
685
+ const agent = createGithubAgent({
686
+ model: 'anthropic/claude-sonnet-4.6',
687
+ token: process.env.GITHUB_TOKEN!,
688
+ preset: 'maintainer',
689
+ })
690
+
632
691
  // Full override: replace the built-in prompt entirely
633
692
  const custom = createGithubAgent({
634
693
  model: 'anthropic/claude-sonnet-4.6',
@@ -705,7 +764,7 @@ async function agentTurn(prompt: string) {
705
764
 
706
765
  > See [`examples/pr-review-agent`](../../examples/pr-review-agent) for a complete PR review agent built with Chat SDK and Vercel Workflow.
707
766
 
708
- All presets (`code-review`, `issue-triage`, `ci-ops`, `repo-explorer`, `security-audit`, `release-manager`, `maintainer`) work with `createDurableGithubAgent`. Options mirror `createGithubAgent` with additional pass-through for `WorkflowAgentOptions` fields like `experimental_telemetry`, `onStepEnd`, `onEnd`, and `prepareStep`. Write tools honor `requireApproval` via `needsApproval`.
767
+ All presets (`code-review`, `issue-triage`, `ci-ops`, `repo-explorer`, `security-audit`, `release-manager`, `discussion-moderator`, `notification-inbox`, `pr-author`, `maintainer`) work with `createDurableGithubAgent`. Options mirror `createGithubAgent` with additional pass-through for `WorkflowAgentOptions` fields like `experimental_telemetry`, `onStepEnd`, `onEnd`, and `prepareStep`. Write tools honor `requireApproval` via `needsApproval`.
709
768
 
710
769
  ### `resolveGithubToken(token?)`
711
770
 
@@ -1,22 +1,28 @@
1
- import { jt as GithubToolName } from "../index-CtID5dUi.mjs";
2
- import { a as GithubConnectorInput, t as ConnectGithubEveToolsOptions } from "../types-BVLof-5R.mjs";
1
+ import { $t as GithubToolName } from "../index-BNeMjmgp.mjs";
2
+ import { a as GithubConnectorInput, t as ConnectGithubEveToolsOptions } from "../types-BD5YvGxm.mjs";
3
3
  //#region src/connect/eve.d.ts
4
4
  /**
5
5
  * Register eve GitHub tools backed by a Vercel Connect connector.
6
- * Scopes are derived from `preset` unless overridden in `connect.scopes`.
6
+ * Scopes are derived from `preset`, or from the resolved `include`/`exclude`
7
+ * tool set when those are set, unless overridden in `connect.scopes`.
7
8
  *
8
9
  * `connector` may be a static name or a resolver function — e.g. to pick a
9
10
  * different connector per environment (production vs. preview) or tenant.
10
11
  *
11
- * TODO(eve-connect-bundle): eve's authored-module bundler inlines workspace-linked
12
- * SDK code and code-splits `@vercel/connect` unless the agent sets
13
- * `build.externalDependencies: ['@vercel/connect']` in `agent.ts`. Remove that
14
- * requirement when upstream eve externalizes this path.
15
- *
16
12
  * @deprecated Use the mountable `@github-tools/eve-extension` instead and pass `connector`
17
13
  * directly to `githubExtension(...)` — no separate Connect import is needed. This direct
18
- * import keeps working but is no longer the recommended path. See
19
- * https://github-tools.com/frameworks/eve-extension#vercel-connect.
14
+ * import is also **not durable** under multi-turn eve Workflow replay (`defineTool` inside
15
+ * `node_modules` is not hoisted); mount `@github-tools/eve-extension` instead
16
+ * (see https://github.com/vercel-labs/github-tools/issues/51 and
17
+ * https://github-tools.com/frameworks/eve-extension).
18
+ *
19
+ * Shared runtime helpers used by the extension are on `@github-tools/sdk/eve-runtime`
20
+ * (not deprecated).
21
+ *
22
+ * TODO(eve-connect-bundle): eve's authored-module bundler inlines workspace-linked
23
+ * SDK code and code-splits `@vercel/connect` unless the agent sets
24
+ * `build.externalDependencies: ['@vercel/connect']` in `agent.ts`. Prefer the
25
+ * eve extension (pre-built) so that workaround is unnecessary.
20
26
  */
21
27
  declare function connectGithubTools(connector: GithubConnectorInput, options?: ConnectGithubEveToolsOptions): import("eve/tools").DynamicSentinel<Partial<Record<GithubToolName, import("eve/tools").ToolDefinition<unknown, unknown>>>>;
22
28
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"eve.d.mts","names":[],"sources":["../../src/connect/eve.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;iBAsBgB,mBACd,WAAW,sBACX,UAAS,mDAAiC,gBAAA,QAAA,OAAjC,oCAAiC"}
1
+ {"version":3,"file":"eve.d.mts","names":[],"sources":["../../src/connect/eve.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;iBA4BgB,mBACd,WAAW,sBACX,UAAS,mDAAiC,gBAAA,QAAA,OAAjC,oCAAiC"}
@@ -1,30 +1,40 @@
1
- import { l as createGithubTools } from "../eve-DmiXBuli.mjs";
2
- import { t as connectGithubToken } from "../token-sbepWIkd.mjs";
1
+ import { createGithubTools } from "../eve.mjs";
2
+ import { t as connectGithubToken } from "../token-OPdZa0t3.mjs";
3
3
  //#region src/connect/eve.ts
4
4
  /**
5
5
  * Register eve GitHub tools backed by a Vercel Connect connector.
6
- * Scopes are derived from `preset` unless overridden in `connect.scopes`.
6
+ * Scopes are derived from `preset`, or from the resolved `include`/`exclude`
7
+ * tool set when those are set, unless overridden in `connect.scopes`.
7
8
  *
8
9
  * `connector` may be a static name or a resolver function — e.g. to pick a
9
10
  * different connector per environment (production vs. preview) or tenant.
10
11
  *
11
- * TODO(eve-connect-bundle): eve's authored-module bundler inlines workspace-linked
12
- * SDK code and code-splits `@vercel/connect` unless the agent sets
13
- * `build.externalDependencies: ['@vercel/connect']` in `agent.ts`. Remove that
14
- * requirement when upstream eve externalizes this path.
15
- *
16
12
  * @deprecated Use the mountable `@github-tools/eve-extension` instead and pass `connector`
17
13
  * directly to `githubExtension(...)` — no separate Connect import is needed. This direct
18
- * import keeps working but is no longer the recommended path. See
19
- * https://github-tools.com/frameworks/eve-extension#vercel-connect.
14
+ * import is also **not durable** under multi-turn eve Workflow replay (`defineTool` inside
15
+ * `node_modules` is not hoisted); mount `@github-tools/eve-extension` instead
16
+ * (see https://github.com/vercel-labs/github-tools/issues/51 and
17
+ * https://github-tools.com/frameworks/eve-extension).
18
+ *
19
+ * Shared runtime helpers used by the extension are on `@github-tools/sdk/eve-runtime`
20
+ * (not deprecated).
21
+ *
22
+ * TODO(eve-connect-bundle): eve's authored-module bundler inlines workspace-linked
23
+ * SDK code and code-splits `@vercel/connect` unless the agent sets
24
+ * `build.externalDependencies: ['@vercel/connect']` in `agent.ts`. Prefer the
25
+ * eve extension (pre-built) so that workaround is unnecessary.
20
26
  */
21
27
  function connectGithubTools(connector, options = {}) {
22
- const { connect, preset, ...rest } = options;
28
+ const { connect, preset, include, exclude, ...rest } = options;
23
29
  return createGithubTools({
24
30
  ...rest,
25
31
  preset,
32
+ include,
33
+ exclude,
26
34
  token: connectGithubToken(connector, {
27
35
  preset,
36
+ include,
37
+ exclude,
28
38
  params: connect
29
39
  })
30
40
  });
@@ -1 +1 @@
1
- {"version":3,"file":"eve.mjs","names":["createEveGithubTools"],"sources":["../../src/connect/eve.ts"],"sourcesContent":["import { createGithubTools as createEveGithubTools } from '../eve'\nimport type { GithubConnectorInput } from './connector'\nimport { connectGithubToken } from './token'\nimport type { ConnectGithubEveToolsOptions } from './types'\n\n/**\n * Register eve GitHub tools backed by a Vercel Connect connector.\n * Scopes are derived from `preset` unless overridden in `connect.scopes`.\n *\n * `connector` may be a static name or a resolver function — e.g. to pick a\n * different connector per environment (production vs. preview) or tenant.\n *\n * TODO(eve-connect-bundle): eve's authored-module bundler inlines workspace-linked\n * SDK code and code-splits `@vercel/connect` unless the agent sets\n * `build.externalDependencies: ['@vercel/connect']` in `agent.ts`. Remove that\n * requirement when upstream eve externalizes this path.\n *\n * @deprecated Use the mountable `@github-tools/eve-extension` instead and pass `connector`\n * directly to `githubExtension(...)` — no separate Connect import is needed. This direct\n * import keeps working but is no longer the recommended path. See\n * https://github-tools.com/frameworks/eve-extension#vercel-connect.\n */\nexport function connectGithubTools(\n connector: GithubConnectorInput,\n options: ConnectGithubEveToolsOptions = {},\n) {\n const { connect, preset, ...rest } = options\n\n return createEveGithubTools({\n ...rest,\n preset,\n token: connectGithubToken(connector, { preset, params: connect }),\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,mBACd,WACA,UAAwC,CAAC,GACzC;CACA,MAAM,EAAE,SAAS,QAAQ,GAAG,SAAS;CAErC,OAAOA,kBAAqB;EAC1B,GAAG;EACH;EACA,OAAO,mBAAmB,WAAW;GAAE;GAAQ,QAAQ;EAAQ,CAAC;CAClE,CAAC;AACH"}
1
+ {"version":3,"file":"eve.mjs","names":["createEveGithubTools"],"sources":["../../src/connect/eve.ts"],"sourcesContent":["import { createGithubTools as createEveGithubTools } from '../eve'\nimport type { GithubConnectorInput } from './connector'\nimport { connectGithubToken } from './token'\nimport type { ConnectGithubEveToolsOptions } from './types'\n\n/**\n * Register eve GitHub tools backed by a Vercel Connect connector.\n * Scopes are derived from `preset`, or from the resolved `include`/`exclude`\n * tool set when those are set, unless overridden in `connect.scopes`.\n *\n * `connector` may be a static name or a resolver function — e.g. to pick a\n * different connector per environment (production vs. preview) or tenant.\n *\n * @deprecated Use the mountable `@github-tools/eve-extension` instead and pass `connector`\n * directly to `githubExtension(...)` — no separate Connect import is needed. This direct\n * import is also **not durable** under multi-turn eve Workflow replay (`defineTool` inside\n * `node_modules` is not hoisted); mount `@github-tools/eve-extension` instead\n * (see https://github.com/vercel-labs/github-tools/issues/51 and\n * https://github-tools.com/frameworks/eve-extension).\n *\n * Shared runtime helpers used by the extension are on `@github-tools/sdk/eve-runtime`\n * (not deprecated).\n *\n * TODO(eve-connect-bundle): eve's authored-module bundler inlines workspace-linked\n * SDK code and code-splits `@vercel/connect` unless the agent sets\n * `build.externalDependencies: ['@vercel/connect']` in `agent.ts`. Prefer the\n * eve extension (pre-built) so that workaround is unnecessary.\n */\nexport function connectGithubTools(\n connector: GithubConnectorInput,\n options: ConnectGithubEveToolsOptions = {},\n) {\n const { connect, preset, include, exclude, ...rest } = options\n\n return createEveGithubTools({\n ...rest,\n preset,\n include,\n exclude,\n token: connectGithubToken(connector, { preset, include, exclude, params: connect }),\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAgB,mBACd,WACA,UAAwC,CAAC,GACzC;CACA,MAAM,EAAE,SAAS,QAAQ,SAAS,SAAS,GAAG,SAAS;CAEvD,OAAOA,kBAAqB;EAC1B,GAAG;EACH;EACA;EACA;EACA,OAAO,mBAAmB,WAAW;GAAE;GAAQ;GAAS;GAAS,QAAQ;EAAQ,CAAC;CACpF,CAAC;AACH"}
@@ -1,15 +1,16 @@
1
- import { Dt as GithubToolPreset, jt as GithubToolName, mt as GithubTokenInput, ut as AllGithubTools } from "./index-CtID5dUi.mjs";
2
- import { a as GithubConnectorInput, i as GithubConnectParams, n as ConnectGithubTokenOptions, o as resolveGithubConnector, r as ConnectGithubToolsOptions, t as ConnectGithubEveToolsOptions } from "./types-BVLof-5R.mjs";
1
+ import { $t as GithubToolName, It as GithubTokenInput, Mt as AllGithubTools, Yt as GithubToolPreset } from "./index-BNeMjmgp.mjs";
2
+ import { a as GithubConnectorInput, i as GithubConnectParams, n as ConnectGithubTokenOptions, o as resolveGithubConnector, r as ConnectGithubToolsOptions, t as ConnectGithubEveToolsOptions } from "./types-BD5YvGxm.mjs";
3
+ import "./eve-runtime-BqfQZAP7.mjs";
3
4
  import "@vercel/connect";
4
5
  //#region src/connect/scopes.d.ts
5
6
  /**
6
7
  * Vercel Connect scope strings mapped to each {@link GithubToolPreset}.
7
8
  *
8
9
  * Scopes mirror GitHub App permissions (`contents`, `pull_requests`, `issues`,
9
- * `actions`, `checks`, `statuses`, `administration`, `metadata`) and must cover
10
- * every read/write family a preset's tools touch, not just its primary domain.
11
- * Release tools fall under the `contents` permission on GitHub Apps, so they
12
- * need no scope of their own.
10
+ * `discussions`, `actions`, `checks`, `statuses`, `administration`, `metadata`)
11
+ * and must cover every read/write family a preset's tools touch, not just its
12
+ * primary domain. Release tools fall under the `contents` permission on GitHub
13
+ * Apps, and reaction tools under `issues`, so neither needs a scope of its own.
13
14
  *
14
15
  * Gist tools in `repo-explorer` and `maintainer` are intentionally left
15
16
  * unscoped: the Gists API only accepts GitHub App *user* access tokens, never
@@ -17,26 +18,138 @@ import "@vercel/connect";
17
18
  * installation tokens. Gist calls made with a Connect-derived token 403
18
19
  * regardless of requested scopes — use a fine-grained PAT with the "Gists"
19
20
  * account permission for those tools instead.
21
+ *
22
+ * Notification tools in `maintainer` and `notification-inbox` are unscoped for
23
+ * the same reason: `notifications` is an account-level GitHub App permission
24
+ * that only applies to user access tokens, so `listNotifications` /
25
+ * `markNotificationRead` need a PAT with the "Notifications" account permission.
20
26
  */
21
27
  declare const PRESET_CONNECT_SCOPES: {
22
- readonly 'repo-explorer': readonly ["contents:read", "metadata:read", "pull_requests:read", "issues:read", "actions:read", "checks:read", "statuses:read"];
28
+ readonly 'repo-explorer': readonly ["contents:read", "metadata:read", "pull_requests:read", "issues:read", "discussions:read", "actions:read", "checks:read", "statuses:read"];
23
29
  readonly 'code-review': readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write", "checks:read", "statuses:read"];
24
30
  readonly 'issue-triage': readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
25
31
  readonly 'ci-ops': readonly ["contents:read", "metadata:read", "actions:read", "actions:write", "checks:read", "statuses:read"];
26
32
  readonly 'security-audit': readonly ["contents:read", "metadata:read", "pull_requests:read", "issues:read", "issues:write", "actions:read", "checks:read", "statuses:read"];
27
33
  readonly 'release-manager': readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "actions:read", "actions:write"];
28
- readonly maintainer: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write", "issues:read", "issues:write", "actions:read", "actions:write", "checks:read", "statuses:read", "administration:read", "administration:write"];
34
+ readonly 'discussion-moderator': readonly ["contents:read", "metadata:read", "issues:read", "issues:write", "discussions:read", "discussions:write"];
35
+ readonly 'notification-inbox': readonly ["contents:read", "metadata:read", "pull_requests:read", "issues:read"];
36
+ readonly 'pr-author': readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write"];
37
+ readonly maintainer: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write", "issues:read", "issues:write", "discussions:read", "discussions:write", "actions:read", "actions:write", "checks:read", "statuses:read", "administration:read", "administration:write"];
38
+ };
39
+ /**
40
+ * Per-tool Connect scopes. Empty arrays are intentional for gist and
41
+ * notification tools (installation tokens cannot satisfy those APIs).
42
+ */
43
+ declare const TOOL_CONNECT_SCOPES: {
44
+ readonly getRepository: readonly ["contents:read", "metadata:read"];
45
+ readonly listBranches: readonly ["contents:read", "metadata:read"];
46
+ readonly getFileContent: readonly ["contents:read", "metadata:read"];
47
+ readonly getRepositoryTree: readonly ["contents:read", "metadata:read"];
48
+ readonly createBranch: readonly ["contents:read", "contents:write", "metadata:read"];
49
+ readonly forkRepository: readonly ["contents:read", "metadata:read"];
50
+ readonly createRepository: readonly ["metadata:read", "administration:read", "administration:write"];
51
+ readonly createOrUpdateFile: readonly ["contents:read", "contents:write", "metadata:read"];
52
+ readonly listPullRequests: readonly ["contents:read", "metadata:read", "pull_requests:read"];
53
+ readonly getPullRequest: readonly ["contents:read", "metadata:read", "pull_requests:read"];
54
+ readonly createPullRequest: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
55
+ readonly mergePullRequest: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
56
+ readonly updatePullRequest: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
57
+ readonly addPullRequestComment: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
58
+ readonly updatePullRequestComment: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
59
+ readonly deletePullRequestComment: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
60
+ readonly listPullRequestFiles: readonly ["contents:read", "metadata:read", "pull_requests:read"];
61
+ readonly listPullRequestReviews: readonly ["contents:read", "metadata:read", "pull_requests:read"];
62
+ readonly createPullRequestReview: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
63
+ readonly requestReviewers: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
64
+ readonly getPullRequestContext: readonly ["contents:read", "metadata:read", "pull_requests:read", "checks:read", "statuses:read"];
65
+ readonly listIssues: readonly ["contents:read", "metadata:read", "issues:read"];
66
+ readonly getIssue: readonly ["contents:read", "metadata:read", "issues:read"];
67
+ readonly getIssueContext: readonly ["contents:read", "metadata:read", "issues:read"];
68
+ readonly createIssue: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
69
+ readonly addIssueComment: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
70
+ readonly updateIssueComment: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
71
+ readonly deleteIssueComment: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
72
+ readonly closeIssue: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
73
+ readonly updateIssue: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
74
+ readonly listLabels: readonly ["contents:read", "metadata:read", "issues:read"];
75
+ readonly addLabels: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
76
+ readonly removeLabel: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
77
+ readonly createLabel: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
78
+ readonly updateLabel: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
79
+ readonly deleteLabel: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
80
+ readonly addAssignees: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
81
+ readonly removeAssignees: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
82
+ readonly searchCode: readonly ["contents:read", "metadata:read"];
83
+ readonly searchRepositories: readonly ["metadata:read"];
84
+ readonly searchIssues: readonly ["metadata:read", "issues:read", "pull_requests:read"];
85
+ readonly listCommits: readonly ["contents:read", "metadata:read"];
86
+ readonly getCommit: readonly ["contents:read", "metadata:read"];
87
+ readonly getBlame: readonly ["contents:read", "metadata:read"];
88
+ readonly compareCommits: readonly ["contents:read", "metadata:read"];
89
+ readonly listGists: readonly [];
90
+ readonly getGist: readonly [];
91
+ readonly listGistComments: readonly [];
92
+ readonly createGist: readonly [];
93
+ readonly updateGist: readonly [];
94
+ readonly deleteGist: readonly [];
95
+ readonly createGistComment: readonly [];
96
+ readonly listWorkflows: readonly ["contents:read", "metadata:read", "actions:read"];
97
+ readonly listWorkflowRuns: readonly ["contents:read", "metadata:read", "actions:read"];
98
+ readonly getWorkflowRun: readonly ["contents:read", "metadata:read", "actions:read"];
99
+ readonly listWorkflowJobs: readonly ["contents:read", "metadata:read", "actions:read"];
100
+ readonly triggerWorkflow: readonly ["contents:read", "metadata:read", "actions:read", "actions:write"];
101
+ readonly cancelWorkflowRun: readonly ["contents:read", "metadata:read", "actions:read", "actions:write"];
102
+ readonly rerunWorkflowRun: readonly ["contents:read", "metadata:read", "actions:read", "actions:write"];
103
+ readonly listCheckRuns: readonly ["contents:read", "metadata:read", "checks:read", "statuses:read"];
104
+ readonly getCombinedStatus: readonly ["contents:read", "metadata:read", "checks:read", "statuses:read"];
105
+ readonly getCiFailureContext: readonly ["contents:read", "metadata:read", "actions:read", "checks:read", "statuses:read"];
106
+ readonly listDiscussions: readonly ["contents:read", "metadata:read", "discussions:read"];
107
+ readonly getDiscussion: readonly ["contents:read", "metadata:read", "discussions:read"];
108
+ readonly addDiscussionComment: readonly ["contents:read", "metadata:read", "discussions:read", "discussions:write"];
109
+ readonly listNotifications: readonly [];
110
+ readonly markNotificationRead: readonly [];
111
+ readonly listIssueReactions: readonly ["contents:read", "metadata:read", "issues:read"];
112
+ readonly addIssueReaction: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
113
+ readonly listCommentReactions: readonly ["contents:read", "metadata:read", "issues:read"];
114
+ readonly addCommentReaction: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
115
+ readonly listReleases: readonly ["contents:read", "metadata:read"];
116
+ readonly getLatestRelease: readonly ["contents:read", "metadata:read"];
117
+ readonly getRelease: readonly ["contents:read", "metadata:read"];
118
+ readonly getReleaseContext: readonly ["contents:read", "metadata:read"];
119
+ readonly createRelease: readonly ["contents:read", "contents:write", "metadata:read"];
120
+ readonly updateRelease: readonly ["contents:read", "contents:write", "metadata:read"];
121
+ readonly deleteRelease: readonly ["contents:read", "contents:write", "metadata:read"];
29
122
  };
30
123
  /**
31
124
  * Returns Vercel Connect scopes for a preset or combined presets.
32
125
  * Without a preset, returns the union of all preset scopes (full tool set).
33
126
  */
34
127
  declare function connectGithubScopesForPreset(preset?: GithubToolPreset | GithubToolPreset[]): string[];
128
+ /**
129
+ * Returns Connect scopes covering exactly the given tools.
130
+ * Always includes `metadata:read`. Gist and notification tools contribute nothing.
131
+ */
132
+ declare function connectGithubScopesForTools(names: readonly GithubToolName[]): string[];
133
+ type ConnectScopeSelection = {
134
+ preset?: GithubToolPreset | GithubToolPreset[];
135
+ include?: readonly GithubToolName[];
136
+ exclude?: readonly GithubToolName[];
137
+ };
138
+ /**
139
+ * Resolves Connect scopes for the effective tool set.
140
+ *
141
+ * - No `include` / `exclude`: same as {@link connectGithubScopesForPreset}
142
+ * (omitted preset → full union, including `administration:write`).
143
+ * - With `include` and/or `exclude`: scopes are derived from the resolved tools
144
+ * so a hand-picked `include` list does not mint the full admin surface.
145
+ */
146
+ declare function connectGithubScopesForSelection(selection?: ConnectScopeSelection): string[];
35
147
  //#endregion
36
148
  //#region src/connect/token.d.ts
37
149
  /**
38
150
  * Returns a lazy GitHub token provider backed by a Vercel Connect connector.
39
- * Scopes are derived from `preset` unless overridden in `params.scopes`.
151
+ * Scopes are derived from `preset`, or from the resolved `include`/`exclude`
152
+ * tool set when those are set, unless overridden in `params.scopes`.
40
153
  *
41
154
  * `connector` may be a static name or a resolver function — e.g. to pick a
42
155
  * different connector per environment (production vs. preview) or tenant.
@@ -54,5 +167,5 @@ declare function connectGithubToken(connector: GithubConnectorInput, options?: C
54
167
  */
55
168
  declare function connectGithubTools(connector: GithubConnectorInput, options?: ConnectGithubToolsOptions): AllGithubTools | Pick<AllGithubTools, GithubToolName>;
56
169
  //#endregion
57
- export { type ConnectGithubEveToolsOptions, type ConnectGithubTokenOptions, type ConnectGithubToolsOptions, type GithubConnectParams, type GithubConnectorInput, PRESET_CONNECT_SCOPES, connectGithubScopesForPreset, connectGithubToken, connectGithubTools, resolveGithubConnector };
170
+ export { type ConnectGithubEveToolsOptions, type ConnectGithubTokenOptions, type ConnectGithubToolsOptions, type ConnectScopeSelection, type GithubConnectParams, type GithubConnectorInput, PRESET_CONNECT_SCOPES, TOOL_CONNECT_SCOPES, connectGithubScopesForPreset, connectGithubScopesForSelection, connectGithubScopesForTools, connectGithubToken, connectGithubTools, resolveGithubConnector };
58
171
  //# sourceMappingURL=connect.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.mts","names":[],"sources":["../src/connect/scopes.ts","../src/connect/token.ts","../src/connect/tools.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;cAkBa;;;;;;;;;;;;;iBA4EG,6BACd,SAAS,mBAAmB;;;;;;;;;;;iBCjFd,mBACd,WAAW,sBACX,UAAS,4BACR;;;;;;;;;;iBCLa,mBACd,WAAW,sBACX,UAAS,4BAAA,iBAA8B,KAAA,gBAAA"}
1
+ {"version":3,"file":"connect.d.mts","names":[],"sources":["../src/connect/scopes.ts","../src/connect/token.ts","../src/connect/tools.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;cAwBa;;;;;;;;;;;;;;;;cA0IA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoGG,6BACd,SAAS,mBAAmB;;;;;iBAcd,4BAA4B,gBAAgB;KAUhD;EACV,SAAS,mBAAmB;EAC5B,mBAAmB;EACnB,mBAAmB;;;;;;;;;;iBA6BL,gCAAgC,YAAW;;;;;;;;;;;;iBChT3C,mBACd,WAAW,sBACX,UAAS,4BACR;;;;;;;;;;iBCNa,mBACd,WAAW,sBACX,UAAS,4BAAA,iBAA8B,KAAA,gBAAA"}
package/dist/connect.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { t as createGithubTools } from "./src-D6vC3V8r.mjs";
2
- import { i as resolveGithubConnector, n as PRESET_CONNECT_SCOPES, r as connectGithubScopesForPreset, t as connectGithubToken } from "./token-sbepWIkd.mjs";
1
+ import { t as createGithubTools } from "./src-jQWS2Txw.mjs";
2
+ import { a as connectGithubScopesForSelection, i as connectGithubScopesForPreset, n as PRESET_CONNECT_SCOPES, o as connectGithubScopesForTools, r as TOOL_CONNECT_SCOPES, s as resolveGithubConnector, t as connectGithubToken } from "./token-OPdZa0t3.mjs";
3
3
  //#region src/connect/tools.ts
4
4
  /**
5
5
  * Create GitHub tools backed by a Vercel Connect connector.
@@ -20,6 +20,6 @@ function connectGithubTools(connector, options = {}) {
20
20
  });
21
21
  }
22
22
  //#endregion
23
- export { PRESET_CONNECT_SCOPES, connectGithubScopesForPreset, connectGithubToken, connectGithubTools, resolveGithubConnector };
23
+ export { PRESET_CONNECT_SCOPES, TOOL_CONNECT_SCOPES, connectGithubScopesForPreset, connectGithubScopesForSelection, connectGithubScopesForTools, connectGithubToken, connectGithubTools, resolveGithubConnector };
24
24
 
25
25
  //# sourceMappingURL=connect.mjs.map
@@ -0,0 +1,54 @@
1
+ import { $t as GithubToolName, Jt as CombinedPresetToolNames, Yt as GithubToolPreset, Zt as PresetToolName, qt as GithubWriteToolName } from "./index-BNeMjmgp.mjs";
2
+ import { i as EveToolFactoryOptions, n as EveApprovalValue, r as EveGithubToolsOptions, t as EveApprovalConfig } from "./types-BDO-Mmn6.mjs";
3
+ import { z } from "zod";
4
+ import { Approval, ToolDefinition, ToolModelOutput } from "eve/tools";
5
+ //#region src/eve/build.d.ts
6
+ type BuildOptions = EveGithubToolsOptions | (EveToolFactoryOptions & {
7
+ preset?: EveGithubToolsOptions['preset'];
8
+ });
9
+ type EveToolMap = Partial<Record<GithubToolName, ToolDefinition>>;
10
+ declare function buildEveToolDefinition(name: GithubToolName, options?: BuildOptions): ToolDefinition;
11
+ declare function buildEveToolMap(options?: EveGithubToolsOptions): EveToolMap;
12
+ declare function createEveGithubToolsDynamic(options?: EveGithubToolsOptions): import("eve/tools").DynamicSentinel<Partial<Record<GithubToolName, ToolDefinition<unknown, unknown>>>>;
13
+ declare function listResolvedEveToolNames(options?: {
14
+ preset?: undefined;
15
+ include?: undefined;
16
+ exclude?: undefined;
17
+ }): GithubToolName[];
18
+ declare function listResolvedEveToolNames<P extends GithubToolPreset>(options: {
19
+ preset: P;
20
+ include?: undefined;
21
+ exclude?: undefined;
22
+ }): PresetToolName<P>[];
23
+ declare function listResolvedEveToolNames<P extends readonly GithubToolPreset[]>(options: {
24
+ preset: P;
25
+ include?: undefined;
26
+ exclude?: undefined;
27
+ }): CombinedPresetToolNames<P>[];
28
+ declare function listResolvedEveToolNames(options: Pick<EveGithubToolsOptions, 'preset' | 'include' | 'exclude'>): GithubToolName[];
29
+ /**
30
+ * Tool descriptors (no `execute`) for authored eve `defineTool` loops.
31
+ * Prefer this when registering tools outside the SDK package so durable transforms can hoist inline execute.
32
+ */
33
+ declare function listEveToolDescriptors(options?: EveGithubToolsOptions): {
34
+ name: GithubToolName;
35
+ description: string;
36
+ inputSchema: import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
37
+ writeTool: GithubWriteToolName | undefined;
38
+ toModelOutput: ((output: unknown) => import("eve/tools").ToolModelOutput) | undefined;
39
+ }[];
40
+ /**
41
+ * Execute a GitHub tool by name with the given eve options (token/context/attribution).
42
+ * Used by `@github-tools/eve-extension` so `execute` only closes over a serializable tool name.
43
+ */
44
+ declare function executeGithubEveTool(name: GithubToolName, input: Record<string, unknown>, options?: EveGithubToolsOptions): Promise<unknown>;
45
+ //#endregion
46
+ //#region src/eve/approval.d.ts
47
+ declare function mapEveApprovalValue(value: EveApprovalValue): Approval;
48
+ declare function resolveEveApproval(toolName: GithubWriteToolName, config: EveApprovalConfig | undefined): Approval | undefined;
49
+ //#endregion
50
+ //#region src/eve/load-eve.d.ts
51
+ declare const MISSING_EVE_MESSAGE = "The \"eve\" package is required to use @github-tools/sdk/eve. Install it with: pnpm add eve";
52
+ //#endregion
53
+ export { buildEveToolMap as a, listEveToolDescriptors as c, buildEveToolDefinition as i, listResolvedEveToolNames as l, mapEveApprovalValue as n, createEveGithubToolsDynamic as o, resolveEveApproval as r, executeGithubEveTool as s, MISSING_EVE_MESSAGE as t };
54
+ //# sourceMappingURL=eve-runtime-BqfQZAP7.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eve-runtime-BqfQZAP7.d.mts","names":[],"sources":["../src/eve/build.ts","../src/eve/approval.ts","../src/eve/load-eve.ts"],"mappings":";;;;;KASK,eAAe,yBAAyB;EAA0B,SAAS;;KAC3E,aAAa,QAAQ,OAAO,gBAAgB;iBAkCjC,uBACd,MAAM,gBACN,UAAS,eACR;iBA4Ba,gBAAgB,UAAS,wBAA6B;iBAiCtD,4BAA4B,UAAS,4CAA0B,gBAAA,QAAA,OAAA,gBAAA;iBAY/D,yBAAyB;EAAY;EAAoB;EAAqB;IAAwB;iBACtG,yBAAyB,UAAU,kBAAkB;EAAW,QAAQ;EAAG;EAAqB;IAAwB,eAAe;iBACvI,yBAAyB,mBAAmB,oBAAoB;EAAW,QAAQ;EAAG;EAAqB;IAAwB,wBAAwB;iBAC3J,yBAAyB,SAAS,KAAK,2DAA2D;;;;;iBAUlG,uBAAuB,UAAS;;;;;;;;;;;iBAyB1B,qBACpB,MAAM,gBACN,OAAO,yBACP,UAAS,wBAA0B;;;iBC5JrB,oBAAoB,OAAO,mBAAmB;iBAY9C,mBACd,UAAU,qBACV,QAAQ,gCACP;;;cCTU"}