@github-tools/eve-extension 0.7.1 → 0.7.3
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.63. `@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, 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`, 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
|
|
|
@@ -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"}
|
|
@@ -7,7 +7,7 @@ __eveCreateRequire(import.meta.url);
|
|
|
7
7
|
import extension_default from "../extension.mjs";
|
|
8
8
|
import { GITHUB_WRITE_TOOLS, executeGithubEveTool, formatGithubEveToolOutput, githubToolsErrors, isEveApprovalDisabled, listEveToolDescriptors, mapEveApprovalValue, resolveEveApproval, resolveGithubToken } from "@github-tools/sdk/eve-runtime";
|
|
9
9
|
import { connectGithubToken } from "@github-tools/sdk/connect";
|
|
10
|
-
import { defineDynamic, defineTool } from "eve/tools";
|
|
10
|
+
import { defineDurableSchema, defineDynamic, defineTool } from "eve/tools";
|
|
11
11
|
function buildSessionOptions(ctx) {
|
|
12
12
|
const { token, connector, connect, preset, include, exclude, requireApproval, overrides, context, author, committer, coAuthors } = extension_default.config;
|
|
13
13
|
const includeNames = include;
|
|
@@ -66,6 +66,21 @@ function runGithubEveApproval(name, ctx) {
|
|
|
66
66
|
if (!writeTool || approvalDisabled(writeTool, sessionOptions.requireApproval, override)) return "not-applicable";
|
|
67
67
|
return (override !== void 0 ? mapEveApprovalValue(override) : resolveEveApproval(writeTool, sessionOptions.requireApproval))(ctx);
|
|
68
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
|
+
}
|
|
69
84
|
var github_default = defineDynamic({ events: { "step.started": async () => {
|
|
70
85
|
const sessionOptions = buildSessionOptions();
|
|
71
86
|
const descriptors = listEveToolDescriptors(sessionOptions);
|
|
@@ -76,10 +91,16 @@ var github_default = defineDynamic({ events: { "step.started": async () => {
|
|
|
76
91
|
const override = toolOverrides?.[name];
|
|
77
92
|
tools[name] = defineTool({
|
|
78
93
|
description: override?.description ?? entry.description,
|
|
79
|
-
inputSchema:
|
|
94
|
+
inputSchema: defineDurableSchema({
|
|
95
|
+
closure: { name },
|
|
96
|
+
schema: buildGithubEveInputSchema
|
|
97
|
+
}),
|
|
80
98
|
approval: (ctx) => runGithubEveApproval(name, ctx),
|
|
81
99
|
toModelOutput: (output) => runGithubEveToModelOutput(name, output),
|
|
82
|
-
...override?.outputSchema !== void 0 && { outputSchema:
|
|
100
|
+
...override?.outputSchema !== void 0 && { outputSchema: defineDurableSchema({
|
|
101
|
+
closure: { name },
|
|
102
|
+
schema: buildGithubEveOutputSchema
|
|
103
|
+
}) },
|
|
83
104
|
execute: async (input, ctx) => runGithubEveTool(name, input, ctx)
|
|
84
105
|
});
|
|
85
106
|
}
|
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.3",
|
|
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.63.0",
|
|
65
65
|
"typescript": "^6.0.3",
|
|
66
66
|
"typescript-eslint": "^8.70.0"
|
|
67
67
|
},
|