@github-tools/eve-extension 0.3.2 → 0.4.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 +3 -3
- package/dist/extension/_manifest.json +4 -4
- package/dist/extension/extension.d.ts +8 -2
- package/dist/extension/extension.d.ts.map +1 -1
- package/dist/extension/extension.mjs +1 -1
- package/dist/extension/tools/github.d.ts.map +1 -1
- package/dist/extension/tools/github.mjs +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -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` handlers in the extension package so they survive multi-turn durable eve Workflow replay (see [#51](https://github.com/vercel-labs/github-tools/issues/51)). 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` and `toModelOutput` handlers in the extension package 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)). `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
|
|
|
@@ -73,7 +73,7 @@ export default githubExtension({
|
|
|
73
73
|
})
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
See the runnable consumer at [`examples/eve
|
|
76
|
+
See the runnable consumer at [`examples/eve`](../../examples/eve).
|
|
77
77
|
|
|
78
78
|
## Structure
|
|
79
79
|
|
|
@@ -88,7 +88,7 @@ extension/
|
|
|
88
88
|
|
|
89
89
|
| Field | Type | Notes |
|
|
90
90
|
|---|---|---|
|
|
91
|
-
| `token` | `string
|
|
91
|
+
| `token` | `string \| (() => Promise<string>)` (optional) | PAT string, or an async provider for rotating tokens (e.g. a GitHub App installation token) — the same `GithubTokenInput` the SDK accepts; falls back to `GITHUB_TOKEN` when omitted and `connector` is not set |
|
|
92
92
|
| `connector` | `string \| (() => string \| Promise<string>)` (optional) | Vercel Connect connector name, or a resolver to pick one dynamically (e.g. per environment/tenant); takes priority over `token` |
|
|
93
93
|
| `connect` | `record?` | Passed through to `getToken` when `connector` is set |
|
|
94
94
|
| `preset` | preset name or array | `code-review`, `issue-triage`, `ci-ops`, `repo-explorer`, `security-audit`, `release-manager`, `discussion-moderator`, `notification-inbox`, `pr-author`, `maintainer` |
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"kind": "eve-extension",
|
|
3
|
-
"formatVersion":
|
|
4
|
-
"builtWithEve": "0.
|
|
3
|
+
"formatVersion": 2,
|
|
4
|
+
"builtWithEve": "0.40.0",
|
|
5
5
|
"requires": {
|
|
6
6
|
"extension": 1,
|
|
7
|
-
"tool":
|
|
8
|
-
"dynamicTool":
|
|
7
|
+
"tool": 13,
|
|
8
|
+
"dynamicTool": 18,
|
|
9
9
|
"config": 1
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GithubTokenInput } from '@github-tools/sdk';
|
|
1
2
|
import type { GithubConnectorInput } from '@github-tools/sdk/connect';
|
|
2
3
|
import { type CommitIdentity, type EveApprovalConfig, type EveToolOverrides, type GithubToolName, type GithubToolPreset } from '@github-tools/sdk/eve-runtime';
|
|
3
4
|
import { z } from 'zod';
|
|
@@ -22,8 +23,13 @@ export interface GithubExtensionContext {
|
|
|
22
23
|
* Declared as an interface (not only a Zod schema) so IDE hovers show JSDoc.
|
|
23
24
|
*/
|
|
24
25
|
export interface GithubExtensionConfig {
|
|
25
|
-
/**
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* GitHub token: a PAT string, or a `() => Promise<string>` provider for
|
|
28
|
+
* tokens that rotate (a GitHub App installation token, a vault lease).
|
|
29
|
+
* Same input the SDK accepts. Falls back to `GITHUB_TOKEN` when omitted
|
|
30
|
+
* and `connector` is not set.
|
|
31
|
+
*/
|
|
32
|
+
token?: GithubTokenInput;
|
|
27
33
|
/**
|
|
28
34
|
* Vercel Connect connector name (e.g. `github/my-connector`), or a
|
|
29
35
|
* `() => string | Promise<string>` resolver for picking one dynamically
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../extension/extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC
|
|
1
|
+
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../extension/extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,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;IAC1B,2DAA2D;IAC3D,SAAS,CAAC,EAAE,cAAc,EAAE,CAAA;CAC7B;;AA8CD,wBAEE"}
|
|
@@ -24,7 +24,7 @@ const commitIdentitySchema = z.object({
|
|
|
24
24
|
email: z.string()
|
|
25
25
|
});
|
|
26
26
|
var extension_default = defineExtension({ config: z.object({
|
|
27
|
-
token: z.
|
|
27
|
+
token: z.custom((value) => typeof value === "string" || typeof value === "function").optional(),
|
|
28
28
|
connector: z.custom((value) => typeof value === "string" || typeof value === "function").optional(),
|
|
29
29
|
connect: z.record(z.string(), z.unknown()).optional(),
|
|
30
30
|
preset: z.union([presetNameSchema, z.array(presetNameSchema)]).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../extension/tools/github.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../extension/tools/github.ts"],"names":[],"mappings":"AAeA,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;;AAqE1E,wBAyCE"}
|
|
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
__eveDirname(__eveFileURLToPath(import.meta.url));
|
|
5
5
|
__eveCreateRequire(import.meta.url);
|
|
6
6
|
import extension_default from "../extension.mjs";
|
|
7
|
-
import { executeGithubEveTool, isEveApprovalDisabled, listEveToolDescriptors, mapEveApprovalValue, resolveEveApproval } from "@github-tools/sdk/eve-runtime";
|
|
7
|
+
import { executeGithubEveTool, formatGithubEveToolOutput, isEveApprovalDisabled, listEveToolDescriptors, mapEveApprovalValue, resolveEveApproval } from "@github-tools/sdk/eve-runtime";
|
|
8
8
|
import { connectGithubToken } from "@github-tools/sdk/connect";
|
|
9
9
|
import { defineDynamic, defineTool } from "eve/tools";
|
|
10
10
|
function buildSessionOptions() {
|
|
@@ -53,7 +53,7 @@ var github_default = defineDynamic({ events: { "step.started": async () => {
|
|
|
53
53
|
inputSchema: entry.inputSchema,
|
|
54
54
|
...entry.writeTool && !skipApproval && { approval: resolveEveApproval(entry.writeTool, sessionOptions.requireApproval) },
|
|
55
55
|
...override?.approval !== void 0 && !skipApproval && { approval: mapEveApprovalValue(override.approval) },
|
|
56
|
-
...override?.toModelOutput !== void 0 ? { toModelOutput: override.toModelOutput } :
|
|
56
|
+
...override?.toModelOutput !== void 0 ? { toModelOutput: override.toModelOutput } : { toModelOutput: (output) => formatGithubEveToolOutput(name, output) },
|
|
57
57
|
...override?.outputSchema !== void 0 && { outputSchema: override.outputSchema },
|
|
58
58
|
execute: async (input) => runGithubEveTool(name, input)
|
|
59
59
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@github-tools/eve-extension",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.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": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"zod": "^4.3.6",
|
|
49
|
-
"@github-tools/sdk": "1.
|
|
49
|
+
"@github-tools/sdk": "1.12.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@vercel/connect": ">=0.3.2",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/node": "^26.1.2",
|
|
62
62
|
"@vercel/connect": "^0.6.1",
|
|
63
63
|
"eslint": "^10.8.0",
|
|
64
|
-
"eve": "^0.
|
|
64
|
+
"eve": "^0.40.0",
|
|
65
65
|
"typescript": "^6.0.3",
|
|
66
66
|
"typescript-eslint": "^8.65.0"
|
|
67
67
|
},
|