@github-tools/sdk 1.10.0 → 1.11.1

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 (42) hide show
  1. package/README.md +11 -7
  2. package/dist/connect/eve.d.mts +4 -3
  3. package/dist/connect/eve.d.mts.map +1 -1
  4. package/dist/connect/eve.mjs +8 -3
  5. package/dist/connect/eve.mjs.map +1 -1
  6. package/dist/connect.d.mts +109 -4
  7. package/dist/connect.d.mts.map +1 -1
  8. package/dist/connect.mjs +3 -3
  9. package/dist/{eve-runtime-CI4dR_hI.d.mts → eve-runtime-Cb0LVEvS.d.mts} +16 -4
  10. package/dist/{eve-runtime-CI4dR_hI.d.mts.map → eve-runtime-Cb0LVEvS.d.mts.map} +1 -1
  11. package/dist/{eve-runtime-CIcrt7MD.mjs → eve-runtime-DInXr4h5.mjs} +68 -8
  12. package/dist/eve-runtime-DInXr4h5.mjs.map +1 -0
  13. package/dist/eve-runtime.d.mts +4 -4
  14. package/dist/eve-runtime.mjs +3 -3
  15. package/dist/eve.d.mts +32 -4
  16. package/dist/eve.d.mts.map +1 -1
  17. package/dist/eve.mjs +31 -3
  18. package/dist/eve.mjs.map +1 -1
  19. package/dist/{index-B0nL0C00.d.mts → index-BNeMjmgp.d.mts} +31 -7
  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-v-LjzPpR.mjs → src-jQWS2Txw.mjs} +64 -4
  24. package/dist/src-jQWS2Txw.mjs.map +1 -0
  25. package/dist/token-1uPUq_g-.mjs +391 -0
  26. package/dist/token-1uPUq_g-.mjs.map +1 -0
  27. package/dist/{types-VW0m0Uxl.d.mts → types-BD5YvGxm.d.mts} +7 -3
  28. package/dist/types-BD5YvGxm.d.mts.map +1 -0
  29. package/dist/{types-Ygt1pw1N.d.mts → types-BDO-Mmn6.d.mts} +2 -2
  30. package/dist/{types-Ygt1pw1N.d.mts.map → types-BDO-Mmn6.d.mts.map} +1 -1
  31. package/dist/workflow.d.mts +1 -1
  32. package/dist/workflow.mjs +2 -2
  33. package/dist/{write-tools-uIVfURVp.mjs → write-tools-Dk32V9Hl.mjs} +97 -5
  34. package/dist/write-tools-Dk32V9Hl.mjs.map +1 -0
  35. package/package.json +1 -1
  36. package/dist/eve-runtime-CIcrt7MD.mjs.map +0 -1
  37. package/dist/index-B0nL0C00.d.mts.map +0 -1
  38. package/dist/src-v-LjzPpR.mjs.map +0 -1
  39. package/dist/token-DDMlEkK-.mjs +0 -167
  40. package/dist/token-DDMlEkK-.mjs.map +0 -1
  41. package/dist/types-VW0m0Uxl.d.mts.map +0 -1
  42. package/dist/write-tools-uIVfURVp.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
- 75 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.
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
 
@@ -103,7 +103,7 @@ createGithubTools({ token, preset: ['code-review', 'issue-triage'] })
103
103
  | Preset | Tools included |
104
104
  |---|---|
105
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`, `createIssue`, `addIssueComment`, `updateIssueComment`, `deleteIssueComment`, `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `addAssignees`, `removeAssignees`, `listIssueReactions`, `addIssueReaction`, `listCommentReactions`, `addCommentReaction`, `getRepository`, `searchRepositories`, `searchCode`, `searchIssues` |
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
107
  | `repo-explorer` | All read-only tools including discussions, gists, workflows, checks/statuses, and releases (no write operations) |
108
108
  | `ci-ops` | `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`, `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`, `getRepository`, `listBranches`, `listCommits`, `getCommit` |
109
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) |
@@ -111,7 +111,7 @@ createGithubTools({ token, preset: ['code-review', 'issue-triage'] })
111
111
  | `discussion-moderator` | `listDiscussions`, `getDiscussion`, `addDiscussionComment`, `getRepository`, `searchIssues`, `getIssueContext`, `addIssueComment` |
112
112
  | `notification-inbox` | `listNotifications`, `markNotificationRead`, `getIssue`, `getPullRequest`, `getRepository` (requires a Notifications PAT) |
113
113
  | `pr-author` | `getRepository`, `listBranches`, `getFileContent`, `createBranch`, `createOrUpdateFile`, `createPullRequest`, `updatePullRequest`, `getPullRequest`, `listPullRequestFiles`, `compareCommits`, `getCommit` |
114
- | `maintainer` | All 75 tools |
114
+ | `maintainer` | All 79 tools |
115
115
 
116
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).
117
117
 
@@ -158,7 +158,7 @@ createGithubTools({
158
158
  })
159
159
  ```
160
160
 
161
- Write tools: `createBranch`, `forkRepository`, `createRepository`, `createOrUpdateFile`, `createPullRequest`, `mergePullRequest`, `updatePullRequest`, `addPullRequestComment`, `updatePullRequestComment`, `deletePullRequestComment`, `createPullRequestReview`, `requestReviewers`, `createIssue`, `addIssueComment`, `updateIssueComment`, `deleteIssueComment`, `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `addAssignees`, `removeAssignees`, `addIssueReaction`, `addCommentReaction`, `addDiscussionComment`, `markNotificationRead`, `createGist`, `updateGist`, `deleteGist`, `createGistComment`, `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`, `createRelease`, `updateRelease`, `deleteRelease`.
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`.
162
162
 
163
163
  All other tools are read-only and never require approval.
164
164
 
@@ -402,7 +402,7 @@ Dynamic tools are named by their **bare map key**: the model sees `listPullReque
402
402
  | Value | Maps to | Behavior |
403
403
  |---|---|---|
404
404
  | `true` / `'always'` | `always()` | Require approval on every call |
405
- | `false` / `'never'` | `never()` | Skip approval |
405
+ | `false` / `'never'` | omit `approval` | Skip approval (eve default) |
406
406
  | `'once'` | `once()` | Approve once per session, then auto-allow |
407
407
  | predicate | custom `Approval` | Input-dependent gate; booleans map to `user-approval` / `not-applicable` |
408
408
  | `always()` / `once()` / `never()` | passthrough | Use eve helpers directly |
@@ -499,6 +499,7 @@ List tools (`listCommits`, `listPullRequests`, `listIssues`, `listWorkflowRuns`,
499
499
  | `listIssues` | List issues filtered by state and labels |
500
500
  | `getIssue` | Get an issue's details (body truncated by default; set `detail: full` for complete text) |
501
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) |
502
503
  | `createIssue` | Open a new issue |
503
504
  | `addIssueComment` | Post a comment on an issue |
504
505
  | `updateIssueComment` | Edit the body of an issue comment |
@@ -508,6 +509,9 @@ List tools (`listCommits`, `listPullRequests`, `listIssues`, `listWorkflowRuns`,
508
509
  | `listLabels` | List labels available in a repository |
509
510
  | `addLabels` | Add labels to an issue or pull request |
510
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 |
511
515
  | `addAssignees` | Assign users to an issue or pull request |
512
516
  | `removeAssignees` | Remove assignees from an issue or pull request |
513
517
 
@@ -614,8 +618,8 @@ Create one at **GitHub → Settings → Developer settings → Personal access t
614
618
  | **Administration** | Read and write | `forkRepository`, `createRepository` |
615
619
  | **Pull requests** | Read-only | `listPullRequests`, `getPullRequest`, `listPullRequestFiles`, `listPullRequestReviews`, `getPullRequestContext` |
616
620
  | **Pull requests** | Read and write | `createPullRequest`, `mergePullRequest`, `updatePullRequest`, `addPullRequestComment`, `updatePullRequestComment`, `deletePullRequestComment`, `createPullRequestReview`, `requestReviewers` |
617
- | **Issues** | Read-only | `listIssues`, `getIssue`, `getIssueContext`, `listLabels`, `listIssueReactions`, `listCommentReactions` |
618
- | **Issues** | Read and write | `createIssue`, `addIssueComment`, `updateIssueComment`, `deleteIssueComment`, `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `addAssignees`, `removeAssignees`, `addIssueReaction`, `addCommentReaction` |
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` |
619
623
  | **Discussions** | Read-only | `listDiscussions`, `getDiscussion` |
620
624
  | **Discussions** | Read and write | `addDiscussionComment` |
621
625
  | **Gists** | Read-only | `listGists`, `getGist`, `listGistComments` |
@@ -1,9 +1,10 @@
1
- import { Yt as GithubToolName } from "../index-B0nL0C00.mjs";
2
- import { a as GithubConnectorInput, t as ConnectGithubEveToolsOptions } from "../types-VW0m0Uxl.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.
@@ -1 +1 @@
1
- {"version":3,"file":"eve.d.mts","names":[],"sources":["../../src/connect/eve.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;iBA2BgB,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,9 +1,10 @@
1
1
  import { createGithubTools } from "../eve.mjs";
2
- import { t as connectGithubToken } from "../token-DDMlEkK-.mjs";
2
+ import { t as connectGithubToken } from "../token-1uPUq_g-.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.
@@ -24,12 +25,16 @@ import { t as connectGithubToken } from "../token-DDMlEkK-.mjs";
24
25
  * eve extension (pre-built) so that workaround is unnecessary.
25
26
  */
26
27
  function connectGithubTools(connector, options = {}) {
27
- const { connect, preset, ...rest } = options;
28
+ const { connect, preset, include, exclude, ...rest } = options;
28
29
  return createGithubTools({
29
30
  ...rest,
30
31
  preset,
32
+ include,
33
+ exclude,
31
34
  token: connectGithubToken(connector, {
32
35
  preset,
36
+ include,
37
+ exclude,
33
38
  params: connect
34
39
  })
35
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 * @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, ...rest } = options\n\n return createEveGithubTools({\n ...rest,\n preset,\n token: connectGithubToken(connector, { preset, params: connect }),\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,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,5 +1,5 @@
1
- import { Gt as GithubToolPreset, Mt as GithubTokenInput, Ot as AllGithubTools, Yt as GithubToolName } from "./index-B0nL0C00.mjs";
2
- import { a as GithubConnectorInput, i as GithubConnectParams, n as ConnectGithubTokenOptions, o as resolveGithubConnector, r as ConnectGithubToolsOptions, t as ConnectGithubEveToolsOptions } from "./types-VW0m0Uxl.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
3
  import "@vercel/connect";
4
4
  //#region src/connect/scopes.d.ts
5
5
  /**
@@ -35,16 +35,121 @@ declare const PRESET_CONNECT_SCOPES: {
35
35
  readonly 'pr-author': readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write"];
36
36
  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"];
37
37
  };
38
+ /**
39
+ * Per-tool Connect scopes. Empty arrays are intentional for gist and
40
+ * notification tools (installation tokens cannot satisfy those APIs).
41
+ */
42
+ declare const TOOL_CONNECT_SCOPES: {
43
+ readonly getRepository: readonly ["contents:read", "metadata:read"];
44
+ readonly listBranches: readonly ["contents:read", "metadata:read"];
45
+ readonly getFileContent: readonly ["contents:read", "metadata:read"];
46
+ readonly getRepositoryTree: readonly ["contents:read", "metadata:read"];
47
+ readonly createBranch: readonly ["contents:read", "contents:write", "metadata:read"];
48
+ readonly forkRepository: readonly ["contents:read", "metadata:read"];
49
+ readonly createRepository: readonly ["metadata:read", "administration:read", "administration:write"];
50
+ readonly createOrUpdateFile: readonly ["contents:read", "contents:write", "metadata:read"];
51
+ readonly listPullRequests: readonly ["contents:read", "metadata:read", "pull_requests:read"];
52
+ readonly getPullRequest: readonly ["contents:read", "metadata:read", "pull_requests:read"];
53
+ readonly createPullRequest: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
54
+ readonly mergePullRequest: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
55
+ readonly updatePullRequest: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
56
+ readonly addPullRequestComment: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
57
+ readonly updatePullRequestComment: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
58
+ readonly deletePullRequestComment: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
59
+ readonly listPullRequestFiles: readonly ["contents:read", "metadata:read", "pull_requests:read"];
60
+ readonly listPullRequestReviews: readonly ["contents:read", "metadata:read", "pull_requests:read"];
61
+ readonly createPullRequestReview: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
62
+ readonly requestReviewers: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
63
+ readonly getPullRequestContext: readonly ["contents:read", "metadata:read", "pull_requests:read", "checks:read", "statuses:read"];
64
+ readonly listIssues: readonly ["contents:read", "metadata:read", "issues:read"];
65
+ readonly getIssue: readonly ["contents:read", "metadata:read", "issues:read"];
66
+ readonly getIssueContext: readonly ["contents:read", "metadata:read", "issues:read"];
67
+ readonly listIssueComments: 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"];
122
+ };
38
123
  /**
39
124
  * Returns Vercel Connect scopes for a preset or combined presets.
40
125
  * Without a preset, returns the union of all preset scopes (full tool set).
41
126
  */
42
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[];
43
147
  //#endregion
44
148
  //#region src/connect/token.d.ts
45
149
  /**
46
150
  * Returns a lazy GitHub token provider backed by a Vercel Connect connector.
47
- * 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`.
48
153
  *
49
154
  * `connector` may be a static name or a resolver function — e.g. to pick a
50
155
  * different connector per environment (production vs. preview) or tenant.
@@ -62,5 +167,5 @@ declare function connectGithubToken(connector: GithubConnectorInput, options?: C
62
167
  */
63
168
  declare function connectGithubTools(connector: GithubConnectorInput, options?: ConnectGithubToolsOptions): AllGithubTools | Pick<AllGithubTools, GithubToolName>;
64
169
  //#endregion
65
- 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 };
66
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":";;;;;;;;;;;;;;;;;;;;;;;;;cAuBa;;;;;;;;;;;;;;;;iBAoGG,6BACd,SAAS,mBAAmB;;;;;;;;;;;iBC9Gd,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqGG,6BACd,SAAS,mBAAmB;;;;;iBAcd,4BAA4B,gBAAgB;KAUhD;EACV,SAAS,mBAAmB;EAC5B,mBAAmB;EACnB,mBAAmB;;;;;;;;;;iBA6BL,gCAAgC,YAAW;;;;;;;;;;;;iBCjT3C,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-v-LjzPpR.mjs";
2
- import { i as resolveGithubConnector, n as PRESET_CONNECT_SCOPES, r as connectGithubScopesForPreset, t as connectGithubToken } from "./token-DDMlEkK-.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-1uPUq_g-.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
@@ -1,5 +1,5 @@
1
- import { Gt as GithubToolPreset, Ut as GithubWriteToolName, Wt as CombinedPresetToolNames, Yt as GithubToolName, qt as PresetToolName } from "./index-B0nL0C00.mjs";
2
- import { i as EveToolFactoryOptions, n as EveApprovalValue, r as EveGithubToolsOptions, t as EveApprovalConfig } from "./types-Ygt1pw1N.mjs";
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
3
  import { z } from "zod";
4
4
  import { Approval, ToolDefinition, ToolModelOutput } from "eve/tools";
5
5
  //#region src/eve/build.d.ts
@@ -44,11 +44,23 @@ declare function listEveToolDescriptors(options?: EveGithubToolsOptions): {
44
44
  declare function executeGithubEveTool(name: GithubToolName, input: Record<string, unknown>, options?: EveGithubToolsOptions): Promise<unknown>;
45
45
  //#endregion
46
46
  //#region src/eve/approval.d.ts
47
+ /**
48
+ * `false` / `'never'` should omit the tool `approval` field entirely.
49
+ * eve treats a missing `approval` like `never()`; attaching `never()` is
50
+ * redundant and has caused approval UI noise on some channels.
51
+ */
52
+ declare function isEveApprovalDisabled(value: EveApprovalValue | undefined): boolean;
47
53
  declare function mapEveApprovalValue(value: EveApprovalValue): Approval;
48
54
  declare function resolveEveApproval(toolName: GithubWriteToolName, config: EveApprovalConfig | undefined): Approval | undefined;
55
+ /**
56
+ * Approval to attach on a write tool, or `undefined` to omit the field.
57
+ * Prefer this when building `defineTool` values so `false` / `'never'` do not
58
+ * attach a redundant `never()` handler.
59
+ */
60
+ declare function resolveEveToolApproval(toolName: GithubWriteToolName, config: EveApprovalConfig | undefined, override?: EveApprovalValue): Approval | undefined;
49
61
  //#endregion
50
62
  //#region src/eve/load-eve.d.ts
51
63
  declare const MISSING_EVE_MESSAGE = "The \"eve\" package is required to use @github-tools/sdk/eve. Install it with: pnpm add eve";
52
64
  //#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-CI4dR_hI.d.mts.map
65
+ export { resolveEveToolApproval as a, createEveGithubToolsDynamic as c, listResolvedEveToolNames as d, resolveEveApproval as i, executeGithubEveTool as l, isEveApprovalDisabled as n, buildEveToolDefinition as o, mapEveApprovalValue as r, buildEveToolMap as s, MISSING_EVE_MESSAGE as t, listEveToolDescriptors as u };
66
+ //# sourceMappingURL=eve-runtime-Cb0LVEvS.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eve-runtime-CI4dR_hI.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"}
1
+ {"version":3,"file":"eve-runtime-Cb0LVEvS.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;iBA0CjC,uBACd,MAAM,gBACN,UAAS,eACR;iBA8Ba,gBAAgB,UAAS,wBAA6B;iBAmCtD,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;;;;;;;;iBCnKrB,sBAAsB,OAAO;iBAI7B,oBAAoB,OAAO,mBAAmB;iBAY9C,mBACd,UAAU,qBACV,QAAQ,gCACP;;;;;;iBAgBa,uBACd,UAAU,qBACV,QAAQ,+BACR,WAAW,mBACV;;;cCtCU"}
@@ -1,4 +1,4 @@
1
- import { $ as listWorkflowJobsDescription, $n as listLabelsDescription, $r as getFileContentToModelOutput, $t as searchRepositoriesDescription, A as getLatestReleaseInputSchema, An as addAssigneesInputSchema, Ar as listPullRequestFilesInputSchema, At as listGistsInputSchema, B as getCombinedStatusCore, Bn as createIssueCore, Br as requestReviewersCore, Bt as getCommitCore, C as createReleaseDescription, Ci as listBranchesCore, Cn as listCommentReactionsDescription, Cr as deletePullRequestCommentDescription, Ct as getGistDescription, D as deleteReleaseInputSchema, Dn as listIssueReactionsInputSchema, Dr as getPullRequestInputSchema, Dt as listGistCommentsInputSchema, E as deleteReleaseDescription, En as listIssueReactionsDescription, Er as getPullRequestDescription, Et as listGistCommentsDescription, F as listReleasesDescription, Fn as addLabelsDescription, Fr as listPullRequestsDescription, Ft as compareCommitsDescription, G as listCheckRunsInputSchema, Gn as deleteIssueCommentInputSchema, Gr as updatePullRequestCommentInputSchema, Gt as listCommitsInputSchema, H as getCombinedStatusInputSchema, Hn as createIssueInputSchema, Hr as requestReviewersInputSchema, Ht as getCommitInputSchema, I as listReleasesInputSchema, In as addLabelsInputSchema, Ir as listPullRequestsInputSchema, It as compareCommitsInputSchema, J as cancelWorkflowRunInputSchema, Jn as getIssueInputSchema, Jr as updatePullRequestInputSchema, Jt as searchCodeInputSchema, K as cancelWorkflowRunCore, Kn as getIssueCore, Kr as updatePullRequestCore, Kt as searchCodeCore, L as updateReleaseCore, Ln as closeIssueCore, Lr as mergePullRequestCore, Lt as getBlameCore, M as getReleaseDescription, Mn as addIssueCommentDescription, Mr as listPullRequestReviewsDescription, Mt as updateGistDescription, N as getReleaseInputSchema, Nn as addIssueCommentInputSchema, Nr as listPullRequestReviewsInputSchema, Nt as updateGistInputSchema, O as getLatestReleaseCore, On as addAssigneesCore, Or as listPullRequestFilesCore, Ot as listGistsCore, P as listReleasesCore, Pn as addLabelsCore, Pr as listPullRequestsCore, Pt as compareCommitsCore, Q as listWorkflowJobsCore, Qn as listLabelsCore, Qr as getCommitToModelOutput, Qt as searchRepositoriesCore, R as updateReleaseDescription, Rn as closeIssueDescription, Rr as mergePullRequestDescription, Rt as getBlameDescription, S as createReleaseCore, Si as getRepositoryTreeInputSchema, Sn as listCommentReactionsCore, Sr as deletePullRequestCommentCore, St as getGistCore, T as deleteReleaseCore, Ti as listBranchesInputSchema, Tn as listIssueReactionsCore, Tr as getPullRequestCore, Tt as listGistCommentsCore, U as listCheckRunsCore, Un as deleteIssueCommentCore, Ur as updatePullRequestCommentCore, Ut as listCommitsCore, V as getCombinedStatusDescription, Vn as createIssueDescription, Vr as requestReviewersDescription, Vt as getCommitDescription, W as listCheckRunsDescription, Wn as deleteIssueCommentDescription, Wr as updatePullRequestCommentDescription, Wt as listCommitsDescription, X as getWorkflowRunDescription, Xn as listIssuesDescription, Xr as resolveGithubToken, Xt as searchIssuesDescription, Y as getWorkflowRunCore, Yn as listIssuesCore, Yr as createGithubTokenResolver, Yt as searchIssuesCore, Z as getWorkflowRunInputSchema, Zn as listIssuesInputSchema, Zr as compareCommitsToModelOutput, Zt as searchIssuesInputSchema, _ as getPullRequestContextDescription, _i as getRepositoryCore, _n as addCommentReactionDescription, _r as createPullRequestDescription, _t as createGistDescription, a as resolvePresetTools, ai as createOrUpdateFileCore, an as markNotificationReadDescription, ar as removeLabelDescription, at as listWorkflowsDescription, b as getReleaseContextDescription, bi as getRepositoryTreeCore, bn as addIssueReactionDescription, br as createPullRequestReviewDescription, bt as deleteGistDescription, c as mergeContextArgs, ci as createRepositoryCore, cn as addDiscussionCommentDescription, cr as updateIssueCommentDescription, ct as rerunWorkflowRunDescription, d as getCiFailureContextDescription, di as forkRepositoryCore, dn as getDiscussionDescription, dr as updateIssueDescription, dt as triggerWorkflowDescription, ei as getPullRequestContextToModelOutput, en as searchRepositoriesInputSchema, er as listLabelsInputSchema, et as listWorkflowJobsInputSchema, f as getCiFailureContextInputSchema, fi as forkRepositoryDescription, fn as getDiscussionInputSchema, fr as updateIssueInputSchema, ft as triggerWorkflowInputSchema, g as getPullRequestContextCore, gi as getFileContentInputSchema, gn as addCommentReactionCore, gr as createPullRequestCore, gt as createGistCore, h as getIssueContextInputSchema, hi as getFileContentDescription, hn as listDiscussionsInputSchema, hr as addPullRequestCommentInputSchema, ht as createGistCommentInputSchema, ii as createBranchInputSchema, in as markNotificationReadCore, ir as removeLabelCore, it as listWorkflowsCore, j as getReleaseCore, jn as addIssueCommentCore, jr as listPullRequestReviewsCore, jt as updateGistCore, k as getLatestReleaseDescription, kn as addAssigneesDescription, kr as listPullRequestFilesDescription, kt as listGistsDescription, l as softenContextSchema, li as createRepositoryDescription, ln as addDiscussionCommentInputSchema, lr as updateIssueCommentInputSchema, lt as rerunWorkflowRunInputSchema, m as getIssueContextDescription, mi as getFileContentCore, mn as listDiscussionsDescription, mr as addPullRequestCommentDescription, mt as createGistCommentDescription, n as ALL_GITHUB_TOOL_NAMES, ni as createBranchCore, nn as listNotificationsDescription, nr as removeAssigneesDescription, nt as listWorkflowRunsDescription, oi as createOrUpdateFileDescription, on as markNotificationReadInputSchema, or as removeLabelInputSchema, ot as listWorkflowsInputSchema, p as getIssueContextCore, pi as forkRepositoryInputSchema, pn as listDiscussionsCore, pr as addPullRequestCommentCore, pt as createGistCommentCore, q as cancelWorkflowRunDescription, qn as getIssueDescription, qr as updatePullRequestDescription, qt as searchCodeDescription, ri as createBranchDescription, rn as listNotificationsInputSchema, rr as removeAssigneesInputSchema, rt as listWorkflowRunsInputSchema, si as createOrUpdateFileInputSchema, sn as addDiscussionCommentCore, sr as updateIssueCommentCore, st as rerunWorkflowRunCore, ti as listPullRequestFilesToModelOutput, tn as listNotificationsCore, tr as removeAssigneesCore, tt as listWorkflowRunsCore, u as getCiFailureContextCore, ui as createRepositoryInputSchema, un as getDiscussionCore, ur as updateIssueCore, ut as triggerWorkflowCore, v as getPullRequestContextInputSchema, vi as getRepositoryDescription, vn as addCommentReactionInputSchema, vr as createPullRequestInputSchema, vt as createGistInputSchema, w as createReleaseInputSchema, wi as listBranchesDescription, wn as listCommentReactionsInputSchema, wr as deletePullRequestCommentInputSchema, wt as getGistInputSchema, x as getReleaseContextInputSchema, xi as getRepositoryTreeDescription, xn as addIssueReactionInputSchema, xr as createPullRequestReviewInputSchema, xt as deleteGistInputSchema, y as getReleaseContextCore, yi as getRepositoryInputSchema, yn as addIssueReactionCore, yr as createPullRequestReviewCore, yt as deleteGistCore, z as updateReleaseInputSchema, zn as closeIssueInputSchema, zr as mergePullRequestInputSchema, zt as getBlameInputSchema } from "./write-tools-uIVfURVp.mjs";
1
+ import { $ as listWorkflowJobsDescription, $n as getIssueDescription, $r as requestReviewersDescription, $t as searchRepositoriesDescription, A as getLatestReleaseInputSchema, Ai as getRepositoryDescription, An as addAssigneesInputSchema, Ar as createPullRequestInputSchema, At as listGistsInputSchema, B as getCombinedStatusCore, Bn as createIssueCore, Br as listPullRequestFilesCore, Bt as getCommitCore, C as createReleaseDescription, Ci as forkRepositoryCore, Cn as listCommentReactionsDescription, Cr as updateLabelDescription, Ct as getGistDescription, D as deleteReleaseInputSchema, Di as getFileContentDescription, Dn as listIssueReactionsInputSchema, Dr as addPullRequestCommentInputSchema, Dt as listGistCommentsInputSchema, E as deleteReleaseDescription, Ei as getFileContentCore, En as listIssueReactionsDescription, Er as addPullRequestCommentDescription, Et as listGistCommentsDescription, F as listReleasesDescription, Fi as listBranchesCore, Fn as addLabelsDescription, Fr as deletePullRequestCommentDescription, Ft as compareCommitsDescription, G as listCheckRunsInputSchema, Gn as createLabelInputSchema, Gr as listPullRequestReviewsInputSchema, Gt as listCommitsInputSchema, H as getCombinedStatusInputSchema, Hn as createIssueInputSchema, Hr as listPullRequestFilesInputSchema, Ht as getCommitInputSchema, I as listReleasesInputSchema, Ii as listBranchesDescription, In as addLabelsInputSchema, Ir as deletePullRequestCommentInputSchema, It as compareCommitsInputSchema, J as cancelWorkflowRunInputSchema, Jn as deleteIssueCommentInputSchema, Jr as listPullRequestsInputSchema, Jt as searchCodeInputSchema, K as cancelWorkflowRunCore, Kn as deleteIssueCommentCore, Kr as listPullRequestsCore, Kt as searchCodeCore, L as updateReleaseCore, Li as listBranchesInputSchema, Ln as closeIssueCore, Lr as getPullRequestCore, Lt as getBlameCore, M as getReleaseDescription, Mi as getRepositoryTreeCore, Mn as addIssueCommentDescription, Mr as createPullRequestReviewDescription, Mt as updateGistDescription, N as getReleaseInputSchema, Ni as getRepositoryTreeDescription, Nn as addIssueCommentInputSchema, Nr as createPullRequestReviewInputSchema, Nt as updateGistInputSchema, O as getLatestReleaseCore, Oi as getFileContentInputSchema, On as addAssigneesCore, Or as createPullRequestCore, Ot as listGistsCore, P as listReleasesCore, Pi as getRepositoryTreeInputSchema, Pn as addLabelsCore, Pr as deletePullRequestCommentCore, Pt as compareCommitsCore, Q as listWorkflowJobsCore, Qn as getIssueCore, Qr as requestReviewersCore, Qt as searchRepositoriesCore, R as updateReleaseDescription, Rn as closeIssueDescription, Rr as getPullRequestDescription, Rt as getBlameDescription, S as createReleaseCore, Si as createRepositoryInputSchema, Sn as listCommentReactionsCore, Sr as updateLabelCore, St as getGistCore, T as deleteReleaseCore, Ti as forkRepositoryInputSchema, Tn as listIssueReactionsCore, Tr as addPullRequestCommentCore, Tt as listGistCommentsCore, U as listCheckRunsCore, Un as createLabelCore, Ur as listPullRequestReviewsCore, Ut as listCommitsCore, V as getCombinedStatusDescription, Vn as createIssueDescription, Vr as listPullRequestFilesDescription, Vt as getCommitDescription, W as listCheckRunsDescription, Wn as createLabelDescription, Wr as listPullRequestReviewsDescription, Wt as listCommitsDescription, X as getWorkflowRunDescription, Xn as deleteLabelDescription, Xr as mergePullRequestDescription, Xt as searchIssuesDescription, Y as getWorkflowRunCore, Yn as deleteLabelCore, Yr as mergePullRequestCore, Yt as searchIssuesCore, Z as getWorkflowRunInputSchema, Zn as deleteLabelInputSchema, Zr as mergePullRequestInputSchema, Zt as searchIssuesInputSchema, _ as getPullRequestContextDescription, _i as createOrUpdateFileCore, _n as addCommentReactionDescription, _r as updateIssueCommentDescription, _t as createGistDescription, a as resolvePresetTools, ai as updatePullRequestDescription, an as markNotificationReadDescription, ar as listIssuesDescription, at as listWorkflowsDescription, b as getReleaseContextDescription, bi as createRepositoryCore, bn as addIssueReactionDescription, br as updateIssueDescription, bt as deleteGistDescription, c as mergeContextArgs, ci as resolveGithubToken, cn as addDiscussionCommentDescription, cr as listLabelsDescription, ct as rerunWorkflowRunDescription, d as getCiFailureContextDescription, di as getFileContentToModelOutput, dn as getDiscussionDescription, dr as removeAssigneesDescription, dt as triggerWorkflowDescription, ei as requestReviewersInputSchema, en as searchRepositoriesInputSchema, er as getIssueInputSchema, et as listWorkflowJobsInputSchema, f as getCiFailureContextInputSchema, fi as getPullRequestContextToModelOutput, fn as getDiscussionInputSchema, fr as removeAssigneesInputSchema, ft as triggerWorkflowInputSchema, g as getPullRequestContextCore, gi as createBranchInputSchema, gn as addCommentReactionCore, gr as updateIssueCommentCore, gt as createGistCore, h as getIssueContextInputSchema, hi as createBranchDescription, hn as listDiscussionsInputSchema, hr as removeLabelInputSchema, ht as createGistCommentInputSchema, ii as updatePullRequestCore, in as markNotificationReadCore, ir as listIssuesCore, it as listWorkflowsCore, j as getReleaseCore, ji as getRepositoryInputSchema, jn as addIssueCommentCore, jr as createPullRequestReviewCore, jt as updateGistCore, k as getLatestReleaseDescription, ki as getRepositoryCore, kn as addAssigneesDescription, kr as createPullRequestDescription, kt as listGistsDescription, l as softenContextSchema, li as compareCommitsToModelOutput, ln as addDiscussionCommentInputSchema, lr as listLabelsInputSchema, lt as rerunWorkflowRunInputSchema, m as getIssueContextDescription, mi as createBranchCore, mn as listDiscussionsDescription, mr as removeLabelDescription, mt as createGistCommentDescription, n as ALL_GITHUB_TOOL_NAMES, ni as updatePullRequestCommentDescription, nn as listNotificationsDescription, nr as listIssueCommentsDescription, nt as listWorkflowRunsDescription, oi as updatePullRequestInputSchema, on as markNotificationReadInputSchema, or as listIssuesInputSchema, ot as listWorkflowsInputSchema, p as getIssueContextCore, pi as listPullRequestFilesToModelOutput, pn as listDiscussionsCore, pr as removeLabelCore, pt as createGistCommentCore, q as cancelWorkflowRunDescription, qn as deleteIssueCommentDescription, qr as listPullRequestsDescription, qt as searchCodeDescription, ri as updatePullRequestCommentInputSchema, rn as listNotificationsInputSchema, rr as listIssueCommentsInputSchema, rt as listWorkflowRunsInputSchema, si as createGithubTokenResolver, sn as addDiscussionCommentCore, sr as listLabelsCore, st as rerunWorkflowRunCore, ti as updatePullRequestCommentCore, tn as listNotificationsCore, tr as listIssueCommentsCore, tt as listWorkflowRunsCore, u as getCiFailureContextCore, ui as getCommitToModelOutput, un as getDiscussionCore, ur as removeAssigneesCore, ut as triggerWorkflowCore, v as getPullRequestContextInputSchema, vi as createOrUpdateFileDescription, vn as addCommentReactionInputSchema, vr as updateIssueCommentInputSchema, vt as createGistInputSchema, w as createReleaseInputSchema, wi as forkRepositoryDescription, wn as listCommentReactionsInputSchema, wr as updateLabelInputSchema, wt as getGistInputSchema, x as getReleaseContextInputSchema, xi as createRepositoryDescription, xn as addIssueReactionInputSchema, xr as updateIssueInputSchema, xt as deleteGistInputSchema, y as getReleaseContextCore, yi as createOrUpdateFileInputSchema, yn as addIssueReactionCore, yr as updateIssueCore, yt as deleteGistCore, z as updateReleaseInputSchema, zn as closeIssueInputSchema, zr as getPullRequestInputSchema, zt as getBlameInputSchema } from "./write-tools-Dk32V9Hl.mjs";
2
2
  import * as eveTools from "eve/tools";
3
3
  import * as eveApproval from "eve/tools/approval";
4
4
  //#region src/eve/load-eve.ts
@@ -11,6 +11,14 @@ function getEveApprovalHelpers() {
11
11
  }
12
12
  //#endregion
13
13
  //#region src/eve/approval.ts
14
+ /**
15
+ * `false` / `'never'` should omit the tool `approval` field entirely.
16
+ * eve treats a missing `approval` like `never()`; attaching `never()` is
17
+ * redundant and has caused approval UI noise on some channels.
18
+ */
19
+ function isEveApprovalDisabled(value) {
20
+ return value === false || value === "never";
21
+ }
14
22
  function mapEveApprovalValue(value) {
15
23
  if (typeof value === "function") return value;
16
24
  const { always, never, once } = getEveApprovalHelpers();
@@ -27,6 +35,20 @@ function resolveEveApproval(toolName, config) {
27
35
  if (value === void 0) return getEveApprovalHelpers().always();
28
36
  return mapEveApprovalValue(value);
29
37
  }
38
+ /**
39
+ * Approval to attach on a write tool, or `undefined` to omit the field.
40
+ * Prefer this when building `defineTool` values so `false` / `'never'` do not
41
+ * attach a redundant `never()` handler.
42
+ */
43
+ function resolveEveToolApproval(toolName, config, override) {
44
+ if (override !== void 0) {
45
+ if (isEveApprovalDisabled(override)) return void 0;
46
+ return mapEveApprovalValue(override);
47
+ }
48
+ if (config === false) return void 0;
49
+ if (typeof config === "object" && config !== null && isEveApprovalDisabled(config[toolName])) return;
50
+ return resolveEveApproval(toolName, config);
51
+ }
30
52
  //#endregion
31
53
  //#region src/eve/registry.ts
32
54
  function withToken(core, ctx, extra) {
@@ -208,6 +230,12 @@ function createToolRegistry(ctx) {
208
230
  inputSchema: getIssueInputSchema,
209
231
  execute: withToken(getIssueCore, ctx)
210
232
  },
233
+ {
234
+ name: "listIssueComments",
235
+ description: listIssueCommentsDescription,
236
+ inputSchema: listIssueCommentsInputSchema,
237
+ execute: withToken(listIssueCommentsCore, ctx)
238
+ },
211
239
  {
212
240
  name: "createIssue",
213
241
  writeTool: "createIssue",
@@ -270,6 +298,27 @@ function createToolRegistry(ctx) {
270
298
  inputSchema: removeLabelInputSchema,
271
299
  execute: withToken(removeLabelCore, ctx)
272
300
  },
301
+ {
302
+ name: "createLabel",
303
+ writeTool: "createLabel",
304
+ description: createLabelDescription,
305
+ inputSchema: createLabelInputSchema,
306
+ execute: withToken(createLabelCore, ctx)
307
+ },
308
+ {
309
+ name: "updateLabel",
310
+ writeTool: "updateLabel",
311
+ description: updateLabelDescription,
312
+ inputSchema: updateLabelInputSchema,
313
+ execute: withToken(updateLabelCore, ctx)
314
+ },
315
+ {
316
+ name: "deleteLabel",
317
+ writeTool: "deleteLabel",
318
+ description: deleteLabelDescription,
319
+ inputSchema: deleteLabelInputSchema,
320
+ execute: withToken(deleteLabelCore, ctx)
321
+ },
273
322
  {
274
323
  name: "addAssignees",
275
324
  writeTool: "addAssignees",
@@ -574,13 +623,22 @@ function resolveAllowedToolNames(options) {
574
623
  function applyOverrides(tool, name, overrides) {
575
624
  const override = overrides?.[name];
576
625
  if (!override) return tool;
577
- return {
626
+ const next = {
578
627
  ...tool,
579
628
  ...override.description !== void 0 && { description: override.description },
580
- ...override.approval !== void 0 && { approval: mapEveApprovalValue(override.approval) },
581
629
  ...override.toModelOutput !== void 0 && { toModelOutput: override.toModelOutput },
582
630
  ...override.outputSchema !== void 0 && { outputSchema: override.outputSchema }
583
631
  };
632
+ if (override.approval === void 0) return next;
633
+ if (isEveApprovalDisabled(override.approval)) {
634
+ const rest = { ...next };
635
+ delete rest.approval;
636
+ return rest;
637
+ }
638
+ return {
639
+ ...next,
640
+ approval: mapEveApprovalValue(override.approval)
641
+ };
584
642
  }
585
643
  function buildEveToolDefinition(name, options = {}) {
586
644
  const { defineTool } = getEveTools();
@@ -593,10 +651,11 @@ function buildEveToolDefinition(name, options = {}) {
593
651
  };
594
652
  const entry = createToolRegistry(ctx).find((tool) => tool.name === name);
595
653
  if (!entry) throw new Error(`Unknown GitHub tool: ${name}`);
654
+ const approval = entry.writeTool ? resolveEveToolApproval(entry.writeTool, options.requireApproval) : void 0;
596
655
  return applyOverrides(defineTool({
597
656
  description: entry.description,
598
657
  inputSchema: entry.inputSchema,
599
- ...entry.writeTool && { approval: resolveEveApproval(entry.writeTool, options.requireApproval) },
658
+ ...approval && { approval },
600
659
  ...entry.toModelOutput && { toModelOutput: entry.toModelOutput },
601
660
  execute: async (input) => runGithubToolStep(name, input, ctx)
602
661
  }), name, options.overrides);
@@ -615,10 +674,11 @@ function buildEveToolMap(options = {}) {
615
674
  const tools = {};
616
675
  for (const entry of registry) {
617
676
  if (!isAllowed(entry.name)) continue;
677
+ const approval = entry.writeTool ? resolveEveToolApproval(entry.writeTool, options.requireApproval) : void 0;
618
678
  const tool = defineTool({
619
679
  description: entry.description,
620
680
  inputSchema: entry.inputSchema,
621
- ...entry.writeTool && { approval: resolveEveApproval(entry.writeTool, options.requireApproval) },
681
+ ...approval && { approval },
622
682
  ...entry.toModelOutput && { toModelOutput: entry.toModelOutput },
623
683
  execute: async (input) => runGithubToolStep(entry.name, input, ctx)
624
684
  });
@@ -628,7 +688,7 @@ function buildEveToolMap(options = {}) {
628
688
  }
629
689
  function createEveGithubToolsDynamic(options = {}) {
630
690
  const { defineDynamic } = getEveTools();
631
- return defineDynamic({ events: { "session.started": async () => buildEveToolMap(options) } });
691
+ return defineDynamic({ events: { "step.started": async () => buildEveToolMap(options) } });
632
692
  }
633
693
  function listResolvedEveToolNames(options = {}) {
634
694
  const isAllowed = resolveAllowedToolNames(options);
@@ -669,6 +729,6 @@ async function executeGithubEveTool(name, input, options = {}) {
669
729
  });
670
730
  }
671
731
  //#endregion
672
- export { listEveToolDescriptors as a, resolveEveApproval as c, executeGithubEveTool as i, MISSING_EVE_MESSAGE as l, buildEveToolMap as n, listResolvedEveToolNames as o, createEveGithubToolsDynamic as r, mapEveApprovalValue as s, buildEveToolDefinition as t };
732
+ export { listEveToolDescriptors as a, mapEveApprovalValue as c, MISSING_EVE_MESSAGE as d, executeGithubEveTool as i, resolveEveApproval as l, buildEveToolMap as n, listResolvedEveToolNames as o, createEveGithubToolsDynamic as r, isEveApprovalDisabled as s, buildEveToolDefinition as t, resolveEveToolApproval as u };
673
733
 
674
- //# sourceMappingURL=eve-runtime-CIcrt7MD.mjs.map
734
+ //# sourceMappingURL=eve-runtime-DInXr4h5.mjs.map