@github-tools/eve-extension 0.3.2 → 0.4.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.
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; `@vercel/connect` is optional (install it only when using `connector`):
22
+ `eve` `>=0.44` is a required peer dependency; `@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` 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` 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 imported `toModelOutput` has no durable descriptor: on eve 0.44+ the resolver discards every GitHub tool. `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-extension-agent`](../../examples/eve-extension-agent).
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?` | Falls back to `GITHUB_TOKEN` when omitted and `connector` is not set |
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": 1,
4
- "builtWithEve": "0.30.6",
3
+ "formatVersion": 2,
4
+ "builtWithEve": "0.46.1",
5
5
  "requires": {
6
6
  "extension": 1,
7
- "tool": 5,
8
- "dynamicTool": 8,
7
+ "tool": 20,
8
+ "dynamicTool": 20,
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
- /** GitHub PAT. Falls back to `GITHUB_TOKEN` when omitted and `connector` is not set. */
26
- token?: string;
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,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,oBAAoB,CAAA;IAChC,wFAAwF;IACxF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,gIAAgI;IAChI,MAAM,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAA;IAC9C;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;IAC1B,4FA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OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,gIAAgI;IAChI,MAAM,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAA;IAC9C;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;IAC1B,4FAA4F;IAC5F,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,sBAAsB,CAAA;IAChC;;;OAGG;IACH,eAAe,CAAC,EAAE,iBAAiB,CAAA;IACnC,uFAAuF;IACvF,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,gDAAgD;IAChD,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,mDAAmD;IACnD,SAAS,CAAC,EAAE,cAAc,CAAA;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.string().optional(),
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":"AAcA,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;;AAoE1E,wBAyCE"}
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,wBA0CE"}
@@ -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,10 @@ 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 } : entry.toModelOutput ? { toModelOutput: entry.toModelOutput } : {},
56
+ toModelOutput: (output) => {
57
+ const custom = buildSessionOptions().overrides?.[name]?.toModelOutput;
58
+ return custom ? custom(output) : formatGithubEveToolOutput(name, output);
59
+ },
57
60
  ...override?.outputSchema !== void 0 && { outputSchema: override.outputSchema },
58
61
  execute: async (input) => runGithubEveTool(name, input)
59
62
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@github-tools/eve-extension",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
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,11 +46,11 @@
46
46
  "license": "MIT",
47
47
  "dependencies": {
48
48
  "zod": "^4.3.6",
49
- "@github-tools/sdk": "1.11.1"
49
+ "@github-tools/sdk": "1.12.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@vercel/connect": ">=0.3.2",
53
- "eve": "*"
53
+ "eve": ">=0.44.0"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
56
  "@vercel/connect": {
@@ -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.30.6",
64
+ "eve": "^0.46.1",
65
65
  "typescript": "^6.0.3",
66
66
  "typescript-eslint": "^8.65.0"
67
67
  },