@github-tools/eve-extension 0.7.0 → 0.7.2
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 +3 -3
- package/dist/extension/_manifest.json +3 -3
- package/dist/extension/extension.mjs +5 -3
- package/dist/extension/tools/github.d.ts +1 -1
- package/dist/extension/tools/github.d.ts.map +1 -1
- package/dist/extension/tools/github.mjs +26 -4
- package/dist/index.mjs +2 -1
- package/dist/tools/index.mjs +2 -1
- package/package.json +10 -10
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`
|
|
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.62. `@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)). A spread or call-expression callback has no durable descriptor
|
|
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.
|
|
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
|
|
|
@@ -81,7 +81,7 @@ See the runnable consumer at [`examples/eve`](../../examples/eve).
|
|
|
81
81
|
extension/
|
|
82
82
|
extension.ts # defineExtension() config schema (token, connector, preset, include, exclude, requireApproval, ...)
|
|
83
83
|
tools/
|
|
84
|
-
github.ts # defineDynamic()
|
|
84
|
+
github.ts # defineDynamic() resolving listEveToolDescriptors(...) into authored defineTool calls
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
## Config schema (`extension/extension.ts`)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
2
|
import { dirname as __eveDirname } from "node:path";
|
|
3
3
|
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
-
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
5
6
|
__eveCreateRequire(import.meta.url);
|
|
6
7
|
import { GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS } from "@github-tools/sdk/eve-runtime";
|
|
7
8
|
import { defineExtension } from "eve/extension";
|
|
@@ -24,7 +25,7 @@ const commitIdentitySchema = z.object({
|
|
|
24
25
|
name: z.string(),
|
|
25
26
|
email: z.string()
|
|
26
27
|
});
|
|
27
|
-
|
|
28
|
+
const configSchema = z.object({
|
|
28
29
|
token: z.custom((value) => typeof value === "string" || typeof value === "function").optional(),
|
|
29
30
|
connector: z.custom((value) => typeof value === "string" || typeof value === "function").optional(),
|
|
30
31
|
connect: z.record(z.string(), z.unknown()).optional(),
|
|
@@ -43,5 +44,6 @@ var extension_default = defineExtension({ config: z.object({
|
|
|
43
44
|
author: commitIdentitySchema.optional(),
|
|
44
45
|
committer: commitIdentitySchema.optional(),
|
|
45
46
|
coAuthors: z.array(commitIdentitySchema).optional()
|
|
46
|
-
})
|
|
47
|
+
});
|
|
48
|
+
var extension_default = defineExtension({ config: configSchema });
|
|
47
49
|
export { extension_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ToolDefinition } from 'eve/tools';
|
|
2
|
-
declare const _default: import("eve
|
|
2
|
+
declare const _default: import("eve").DynamicSentinel<Record<string, ToolDefinition<unknown, unknown>>>;
|
|
3
3
|
export default _default;
|
|
4
4
|
//# sourceMappingURL=github.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../extension/tools/github.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../extension/tools/github.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAoE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;;AAmIjH,wBAmCE"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
2
|
import { dirname as __eveDirname } from "node:path";
|
|
3
3
|
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
-
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
5
6
|
__eveCreateRequire(import.meta.url);
|
|
6
7
|
import extension_default from "../extension.mjs";
|
|
7
8
|
import { GITHUB_WRITE_TOOLS, executeGithubEveTool, formatGithubEveToolOutput, githubToolsErrors, isEveApprovalDisabled, listEveToolDescriptors, mapEveApprovalValue, resolveEveApproval, resolveGithubToken } from "@github-tools/sdk/eve-runtime";
|
|
8
9
|
import { connectGithubToken } from "@github-tools/sdk/connect";
|
|
9
|
-
import { defineDynamic, defineTool } from "eve/tools";
|
|
10
|
+
import { defineDurableSchema, defineDynamic, defineTool } from "eve/tools";
|
|
10
11
|
function buildSessionOptions(ctx) {
|
|
11
12
|
const { token, connector, connect, preset, include, exclude, requireApproval, overrides, context, author, committer, coAuthors } = extension_default.config;
|
|
12
13
|
const includeNames = include;
|
|
@@ -65,6 +66,21 @@ function runGithubEveApproval(name, ctx) {
|
|
|
65
66
|
if (!writeTool || approvalDisabled(writeTool, sessionOptions.requireApproval, override)) return "not-applicable";
|
|
66
67
|
return (override !== void 0 ? mapEveApprovalValue(override) : resolveEveApproval(writeTool, sessionOptions.requireApproval))(ctx);
|
|
67
68
|
}
|
|
69
|
+
function buildGithubEveInputSchema({ name }) {
|
|
70
|
+
const descriptor = listEveToolDescriptors({
|
|
71
|
+
...buildSessionOptions(),
|
|
72
|
+
preset: void 0,
|
|
73
|
+
include: [name],
|
|
74
|
+
exclude: void 0
|
|
75
|
+
})[0];
|
|
76
|
+
if (!descriptor) throw new Error(`GitHub tool descriptor "${name}" is not available`);
|
|
77
|
+
return descriptor.inputSchema;
|
|
78
|
+
}
|
|
79
|
+
function buildGithubEveOutputSchema({ name }) {
|
|
80
|
+
const outputSchema = buildSessionOptions().overrides?.[name]?.outputSchema;
|
|
81
|
+
if (!outputSchema) throw new Error(`GitHub tool output schema override "${name}" is not available`);
|
|
82
|
+
return outputSchema;
|
|
83
|
+
}
|
|
68
84
|
var github_default = defineDynamic({ events: { "step.started": async () => {
|
|
69
85
|
const sessionOptions = buildSessionOptions();
|
|
70
86
|
const descriptors = listEveToolDescriptors(sessionOptions);
|
|
@@ -75,10 +91,16 @@ var github_default = defineDynamic({ events: { "step.started": async () => {
|
|
|
75
91
|
const override = toolOverrides?.[name];
|
|
76
92
|
tools[name] = defineTool({
|
|
77
93
|
description: override?.description ?? entry.description,
|
|
78
|
-
inputSchema:
|
|
94
|
+
inputSchema: defineDurableSchema({
|
|
95
|
+
closure: { name },
|
|
96
|
+
schema: buildGithubEveInputSchema
|
|
97
|
+
}),
|
|
79
98
|
approval: (ctx) => runGithubEveApproval(name, ctx),
|
|
80
99
|
toModelOutput: (output) => runGithubEveToModelOutput(name, output),
|
|
81
|
-
...override?.outputSchema !== void 0 && { outputSchema:
|
|
100
|
+
...override?.outputSchema !== void 0 && { outputSchema: defineDurableSchema({
|
|
101
|
+
closure: { name },
|
|
102
|
+
schema: buildGithubEveOutputSchema
|
|
103
|
+
}) },
|
|
82
104
|
execute: async (input, ctx) => runGithubEveTool(name, input, ctx)
|
|
83
105
|
});
|
|
84
106
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
2
|
import { dirname as __eveDirname } from "node:path";
|
|
3
3
|
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
-
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
5
6
|
__eveCreateRequire(import.meta.url);
|
|
6
7
|
import extension_default from "./extension/extension.mjs";
|
|
7
8
|
export { extension_default as default, extension_default as eve_extension };
|
package/dist/tools/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
2
|
import { dirname as __eveDirname } from "node:path";
|
|
3
3
|
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
-
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
5
6
|
__eveCreateRequire(import.meta.url);
|
|
6
7
|
import github_default from "../extension/tools/github.mjs";
|
|
7
8
|
export { github_default as github };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@github-tools/eve-extension",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
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": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": "24
|
|
17
|
+
"node": ">=24"
|
|
18
18
|
},
|
|
19
19
|
"eve": {
|
|
20
20
|
"extension": {
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
],
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"zod": "^4.
|
|
49
|
-
"@github-tools/sdk": "1.16.
|
|
48
|
+
"zod": "^4.5.4",
|
|
49
|
+
"@github-tools/sdk": "1.16.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@vercel/connect": ">=0.3.2",
|
|
53
|
-
"eve": "
|
|
53
|
+
"eve": "*"
|
|
54
54
|
},
|
|
55
55
|
"peerDependenciesMeta": {
|
|
56
56
|
"@vercel/connect": {
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@types/node": "^26.
|
|
62
|
-
"@vercel/connect": "^0.
|
|
63
|
-
"eslint": "^10.
|
|
64
|
-
"eve": "
|
|
61
|
+
"@types/node": "^26.5.0",
|
|
62
|
+
"@vercel/connect": "^2.0.4",
|
|
63
|
+
"eslint": "^10.10.0",
|
|
64
|
+
"eve": "0.62.0",
|
|
65
65
|
"typescript": "^6.0.3",
|
|
66
|
-
"typescript-eslint": "^8.
|
|
66
|
+
"typescript-eslint": "^8.70.0"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|