@github-tools/eve-extension 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ This is **the recommended way** to add GitHub tools to an eve agent. The legacy
|
|
|
19
19
|
pnpm add @github-tools/eve-extension
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
`eve` is a required peer dependency, declared as `*`: the consuming agent provides the runtime copy and eve checks the extension's generated capability metadata rather than an npm range. This release is built against eve 0.
|
|
22
|
+
`eve` is a required peer dependency, declared as `*`: the consuming agent provides the runtime copy and eve checks the extension's generated capability metadata rather than an npm range. This release is built against eve 0.81 and mounts on eve 0.81 or later. `@vercel/connect` is optional (install it only when using `connector`):
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
25
|
pnpm add eve
|
|
@@ -43,7 +43,7 @@ export default githubExtension({
|
|
|
43
43
|
|
|
44
44
|
> `code-review` pairs cleanly with a Connect `connector`. `maintainer` and `repo-explorer` include gist tools, and GitHub only grants gist access to user access tokens, never the installation tokens Connect mints, so gist calls 403 over Connect. Write tools already require approval via `always()` by default, so a plain `{ someTool: true }` is a no-op, use a predicate (as above) when you actually want to narrow or loosen the default.
|
|
45
45
|
|
|
46
|
-
Tools are registered with **inline** `execute`, `toModelOutput`, and `approval` as direct `defineTool` properties so they survive multi-turn durable eve Workflow replay (see [#51](https://github.com/vercel-labs/github-tools/issues/51), [#99](https://github.com/vercel-labs/github-tools/issues/99)). Input schemas and optional output-schema overrides use `defineDurableSchema`; every durable closure contains only the tool name and reconstructs the live schema from extension configuration. A spread or call-expression callback has no durable descriptor, and eve rejects a dynamic tool whose callback is missing one. `toModelOutput` strips `rateLimit` from the model-facing payload; the execute result still carries it for hooks and channels. Do not use the deprecated `@github-tools/sdk/connect/eve` one-liner for durable Slack/multi-turn agents.
|
|
46
|
+
Tools are registered with **inline** `execute`, `toModelOutput`, `approval.request`, and `approval.prompt` as direct `defineTool` properties so they survive multi-turn durable eve Workflow replay (see [#51](https://github.com/vercel-labs/github-tools/issues/51), [#99](https://github.com/vercel-labs/github-tools/issues/99)). Input schemas and optional output-schema overrides use `defineDurableSchema`; every durable closure contains only the tool name and reconstructs the live schema from extension configuration. A spread or call-expression callback has no durable descriptor, and eve rejects a dynamic tool whose callback is missing one. `toModelOutput` strips `rateLimit` from the model-facing payload; the execute result still carries it for hooks and channels. Do not use the deprecated `@github-tools/sdk/connect/eve` one-liner for durable Slack/multi-turn agents.
|
|
47
47
|
|
|
48
48
|
`connector` also accepts a `() => string | Promise<string>` resolver, so the same config can pick a connector dynamically (e.g. by environment):
|
|
49
49
|
|
|
@@ -56,6 +56,8 @@ export default githubExtension({
|
|
|
56
56
|
|
|
57
57
|
A GitHub App installed on several accounts needs no configuration: each token is minted for the installation that owns the call's target `owner/repo`, after `context` defaults. Tools without a repository target use the connector's default installation. Set `installationId`, `authorizationDetails` or `repositories` in `connect` to pin one installation. If the App is not installed on the target account, the tool returns `CONNECT_INSTALLATION_REQUIRED` naming that account.
|
|
58
58
|
|
|
59
|
+
Approval requests name the action and its target instead of eve's default `Approve <tool>?`, for example `Merge pull request on vercel-labs/github-tools#176?`, with `owner`, `repo`, and the PR, issue, or discussion number falling back to `context`.
|
|
60
|
+
|
|
59
61
|
Tools are exposed to the model as `<namespace>__<toolName>`, where `<namespace>` comes from the mount file's name: `agent/extensions/github.ts` yields `github__listPullRequests`, `github__createIssue`, and so on.
|
|
60
62
|
|
|
61
63
|
To hand-pick an exact set of tools instead of a preset, pass `include`:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../extension/tools/github.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAoE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;;
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../extension/tools/github.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAoE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;;AAwLjH,wBA+CE"}
|
|
@@ -100,6 +100,16 @@ async function runGithubEveApproval(name, request, ctx) {
|
|
|
100
100
|
if (isEveApprovalDisabled(value)) return "not-applicable";
|
|
101
101
|
return mapEveApprovalValue(value)(ctx);
|
|
102
102
|
}
|
|
103
|
+
function runGithubEveApprovalPrompt(name, input) {
|
|
104
|
+
const { owner, repo, pullNumber, issueNumber, discussionNumber } = {
|
|
105
|
+
...extension_default.config.context,
|
|
106
|
+
...input
|
|
107
|
+
};
|
|
108
|
+
const action = name.replace(/[A-Z]/g, (letter) => ` ${letter.toLowerCase()}`);
|
|
109
|
+
const number = pullNumber ?? issueNumber ?? discussionNumber;
|
|
110
|
+
const target = owner && repo ? ` on ${owner}/${repo}${number ? `#${number}` : ""}` : "";
|
|
111
|
+
return `${action[0].toUpperCase()}${action.slice(1)}${target}?`;
|
|
112
|
+
}
|
|
103
113
|
function buildGithubEveInputSchema({ name }) {
|
|
104
114
|
const descriptor = listEveToolDescriptors({
|
|
105
115
|
...buildSessionOptions(),
|
|
@@ -136,7 +146,10 @@ var github_default = defineDynamic({ events: { "step.started": async (_event, ct
|
|
|
136
146
|
closure: { name },
|
|
137
147
|
schema: buildGithubEveInputSchema
|
|
138
148
|
}),
|
|
139
|
-
approval:
|
|
149
|
+
approval: {
|
|
150
|
+
request: (approvalCtx) => runGithubEveApproval(name, request, approvalCtx),
|
|
151
|
+
prompt: ({ input }) => runGithubEveApprovalPrompt(name, input)
|
|
152
|
+
},
|
|
140
153
|
toModelOutput: (output) => runGithubEveToModelOutput(name, output),
|
|
141
154
|
...override?.outputSchema !== void 0 && { outputSchema: defineDurableSchema({
|
|
142
155
|
closure: { name },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@github-tools/eve-extension",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "GitHub tools for eve, distributed as a mountable eve extension (https://eve.dev/docs/extensions)",
|
|
5
5
|
"author": "HugoRCD <hugo.richard@vercel.com>",
|
|
6
6
|
"repository": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/node": "^26.5.0",
|
|
62
62
|
"@vercel/connect": "^2.0.4",
|
|
63
63
|
"eslint": "^10.10.0",
|
|
64
|
-
"eve": "0.
|
|
64
|
+
"eve": "0.81.1",
|
|
65
65
|
"typescript": "^6.0.3",
|
|
66
66
|
"typescript-eslint": "^8.70.0"
|
|
67
67
|
},
|