eve 0.26.1 → 0.27.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/CHANGELOG.md +26 -0
- package/dist/src/chunks/{use-eve-agent-CruinZmd.js → use-eve-agent-AeQLLhu9.js} +118 -92
- package/dist/src/chunks/{use-eve-agent-BkztZA0v.js → use-eve-agent-PMY2WkAt.js} +118 -92
- package/dist/src/cli/commands/info.d.ts +2 -0
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/client/message-action-parts.d.ts +43 -0
- package/dist/src/client/message-action-parts.js +1 -0
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +4 -4
- package/dist/src/compiled/@chat-adapter/slack/blocks.d.ts +47 -2
- package/dist/src/compiled/@chat-adapter/slack/blocks.js +10 -8
- package/dist/src/compiled/@chat-adapter/slack/index.d.ts +168 -8
- package/dist/src/compiled/@chat-adapter/slack/index.js +28 -28
- package/dist/src/compiled/@chat-adapter/slack/{types-AntsVifS.d.ts → types-CdGmMyOr.d.ts} +1 -1
- package/dist/src/compiled/@chat-adapter/slack/webhook.d.ts +2 -2
- package/dist/src/compiled/@chat-adapter/twilio/index.d.ts +1 -1
- package/dist/src/compiled/@chat-adapter/twilio/index.js +1 -1
- package/dist/src/compiled/@chat-adapter/twilio/webhook.d.ts +2 -2
- package/dist/src/compiled/@vercel/sandbox/index.js +12 -12
- package/dist/src/compiled/_chunks/node/{auth-Cuszvn7l.js → auth-BuQkq4Gr.js} +2 -2
- package/dist/src/compiled/_chunks/node/{dist-CdH_Yoxt.js → dist-BweCayKF.js} +42 -35
- package/dist/src/compiled/_chunks/node/{dist-Drt-_JVK.js → dist-DvkWiagq.js} +6 -4
- package/dist/src/compiled/chat/index.d.ts +17 -6
- package/dist/src/compiled/chat/index.js +1 -1
- package/dist/src/compiled/chat/{jsx-runtime-CzthIo1o.d.ts → jsx-runtime-_JEEAotp.d.ts} +125 -5
- package/dist/src/compiler/model-catalog.js +1 -1
- package/dist/src/evals/autoevals-client.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-credentials.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-lookup.js +1 -1
- package/dist/src/execution/session.d.ts +0 -2
- package/dist/src/execution/session.js +1 -1
- package/dist/src/execution/skills/instructions.d.ts +3 -3
- package/dist/src/execution/skills/instructions.js +2 -2
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/compaction-prompt.d.ts +19 -1
- package/dist/src/harness/compaction-prompt.js +7 -5
- package/dist/src/harness/compaction.d.ts +4 -11
- package/dist/src/harness/compaction.js +1 -1
- package/dist/src/harness/messages.d.ts +7 -0
- package/dist/src/harness/messages.js +1 -1
- package/dist/src/harness/prompt-cache.d.ts +16 -5
- package/dist/src/harness/prompt-cache.js +1 -1
- package/dist/src/harness/stale-input-responses.js +2 -2
- package/dist/src/harness/token-estimate.d.ts +9 -0
- package/dist/src/harness/token-estimate.js +1 -0
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/internal/application/compiled-artifacts.js +9 -3
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/gateway.d.ts +19 -0
- package/dist/src/internal/gateway.js +1 -0
- package/dist/src/internal/nitro/host/copy-host-middleware.js +1 -1
- package/dist/src/internal/user-agent.d.ts +11 -0
- package/dist/src/internal/user-agent.js +1 -0
- package/dist/src/public/channels/auth.d.ts +59 -9
- package/dist/src/public/channels/auth.js +1 -1
- package/dist/src/public/next/index.js +1 -1
- package/dist/src/public/nuxt/index.d.ts +1 -1
- package/dist/src/public/nuxt/index.js +1 -1
- package/dist/src/public/nuxt/module.d.ts +10 -24
- package/dist/src/public/nuxt/module.js +1 -1
- package/dist/src/public/nuxt/routing.d.ts +5 -39
- package/dist/src/public/nuxt/routing.js +1 -1
- package/dist/src/public/nuxt/vercel-services.d.ts +117 -0
- package/dist/src/public/nuxt/vercel-services.js +1 -0
- package/dist/src/public/tools/defaults.d.ts +3 -3
- package/dist/src/runtime/framework-tools/index.d.ts +3 -2
- package/dist/src/runtime/framework-tools/index.js +1 -1
- package/dist/src/runtime/framework-tools/skill.d.ts +6 -1
- package/dist/src/runtime/framework-tools/skill.js +1 -1
- package/dist/src/runtime/framework-tools/todo.js +1 -1
- package/dist/src/runtime/governance/auth/http-basic.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/gateway-models.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/validate-gateway-key.js +1 -1
- package/dist/src/{public/next → shared}/resolve-eve-binary.d.ts +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +7 -7
- package/docs/extensions.md +115 -77
- package/docs/guides/auth-and-route-protection.md +14 -1
- package/docs/guides/frontend/nuxt.mdx +22 -1
- package/docs/meta.json +1 -0
- package/docs/reference/cli.md +1 -1
- package/docs/schedules.mdx +1 -1
- package/docs/skills.mdx +1 -1
- package/package.json +5 -5
- package/dist/src/execution/sandbox/bindings/vercel-user-agent.d.ts +0 -6
- package/dist/src/execution/sandbox/bindings/vercel-user-agent.js +0 -1
- package/dist/src/execution/workflow-skill-root.d.ts +0 -6
- package/dist/src/execution/workflow-skill-root.js +0 -1
- package/dist/src/public/nuxt/vercel-json.d.ts +0 -17
- package/dist/src/public/nuxt/vercel-json.js +0 -1
- /package/dist/src/{public/next → shared}/resolve-eve-binary.js +0 -0
|
@@ -19,7 +19,7 @@ React, Vue, and Svelte apps reach for [`useEveAgent()`](../guides/frontend/overv
|
|
|
19
19
|
## Start a session
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
curl -X POST http://127.0.0.1:
|
|
22
|
+
curl -X POST http://127.0.0.1:2000/eve/v1/session \
|
|
23
23
|
-H 'content-type: application/json' \
|
|
24
24
|
-d '{"message":"Summarize the latest forecast."}'
|
|
25
25
|
```
|
|
@@ -29,7 +29,7 @@ eve responds right away. The JSON body carries a `sessionId` and a `continuation
|
|
|
29
29
|
## Stream a session
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
curl http://127.0.0.1:
|
|
32
|
+
curl http://127.0.0.1:2000/eve/v1/session/<sessionId>/stream
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
The stream is newline-delimited JSON (NDJSON), one event per line:
|
|
@@ -78,7 +78,7 @@ A delegated subagent publishes progress on its own child-session stream. The par
|
|
|
78
78
|
Once the session is waiting (you'll see `session.waiting`), POST your follow-up to the session endpoint with `event.data.continuationToken`:
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
|
-
curl -X POST http://127.0.0.1:
|
|
81
|
+
curl -X POST http://127.0.0.1:2000/eve/v1/session/<sessionId> \
|
|
82
82
|
-H 'content-type: application/json' \
|
|
83
83
|
-d '{"continuationToken":"<token>","message":"Now send the short version."}'
|
|
84
84
|
```
|
|
@@ -100,7 +100,7 @@ For deterministic ordering, send one follow-up at a time and wait for the next `
|
|
|
100
100
|
POST to the session's cancel endpoint to stop the turn that is currently running. The body is optional; pass `turnId` (stamped on every turn-scoped stream event) to scope the cancel to the turn you observed:
|
|
101
101
|
|
|
102
102
|
```bash
|
|
103
|
-
curl -X POST http://127.0.0.1:
|
|
103
|
+
curl -X POST http://127.0.0.1:2000/eve/v1/session/<sessionId>/cancel
|
|
104
104
|
# {"ok":true,"sessionId":"<sessionId>","status":"accepted"}
|
|
105
105
|
```
|
|
106
106
|
|
|
@@ -113,13 +113,13 @@ Custom channel routes request the same cancellation without knowing the session
|
|
|
113
113
|
The stream is durable. Every event is recorded before a step completes, so consumers can reconnect from their cursor when an HTTP connection ends. A nonnegative `startIndex` is an absolute event count: use it to pick up where you dropped off or pass `0` to rewind to the start.
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
|
-
curl "http://127.0.0.1:
|
|
116
|
+
curl "http://127.0.0.1:2000/eve/v1/session/<sessionId>/stream?startIndex=<count>"
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
A negative `startIndex` reads relative to the stream's current tail. For example, `-1` reads the latest event, which is normally `session.waiting` for a resumable session:
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
|
-
curl "http://127.0.0.1:
|
|
122
|
+
curl "http://127.0.0.1:2000/eve/v1/session/<sessionId>/stream?startIndex=-1"
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
This gives a consumer that only persisted `sessionId` a lightweight way to recover the current `continuationToken`. Because a tail-relative position does not resolve to an absolute consumed-event count, client tail reads do not automatically reconnect or advance the stored cursor.
|
|
@@ -135,7 +135,7 @@ Start with the [TypeScript SDK](../guides/client/overview) guide. It covers basi
|
|
|
135
135
|
`GET /eve/v1/info` returns a JSON inspection snapshot for the running agent: model, instructions, authored and framework tools, skills, channels, schedules, subagents, sandbox, connections, hooks, workflow, and workspace metadata. It uses the resolved `eveChannel()` route auth when `agent/channels/eve.ts` authors one; otherwise it falls back to the framework default of Vercel OIDC plus local development access.
|
|
136
136
|
|
|
137
137
|
```bash
|
|
138
|
-
curl http://127.0.0.1:
|
|
138
|
+
curl http://127.0.0.1:2000/eve/v1/info
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
With the default auth chain (`[vercelOidc(), localDev()]`), a local Vercel OIDC bearer takes precedence and other local requests fall back to development access. A deployed Vercel target requires a valid OIDC bearer, with a same-project bypass for in-deployment callers. See [auth & route protection](../guides/auth-and-route-protection).
|
package/docs/extensions.md
CHANGED
|
@@ -1,39 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Extensions"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Publish reusable eve capabilities as an npm package, then install and mount them in an agent."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Extensions package eve tools, connections, skills, instruction fragments, and hooks. A publisher builds and distributes a package; a consumer installs it and mounts it in an agent.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
This enables sharing many different capability sets. A browser extension might include several tools for navigating a site. A memory extension could use hooks to capture context and tools to recall it. A self-improving extension could pair hooks with dynamic instructions.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Publisher: create and publish an extension
|
|
11
|
+
|
|
12
|
+
### Create the package
|
|
13
|
+
|
|
14
|
+
Start with the extension scaffold:
|
|
11
15
|
|
|
12
16
|
```bash
|
|
13
17
|
npx eve@latest extension init my-crm
|
|
14
18
|
```
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
The command creates the package, installs dependencies, and initializes Git. It includes `extension/extension.ts`, TypeScript configuration, and the package metadata required to build and publish.
|
|
17
21
|
|
|
18
|
-
An extension
|
|
22
|
+
An extension uses the same file conventions as an agent for its contributions:
|
|
19
23
|
|
|
20
24
|
```
|
|
21
25
|
@acme/crm/
|
|
22
26
|
package.json
|
|
23
27
|
extension/
|
|
24
|
-
extension.ts
|
|
28
|
+
extension.ts
|
|
25
29
|
tools/search.ts
|
|
26
30
|
connections/api.ts
|
|
27
31
|
skills/triage/SKILL.md
|
|
32
|
+
instructions.md
|
|
28
33
|
hooks/audit.ts
|
|
29
|
-
lib/http.ts
|
|
34
|
+
lib/http.ts
|
|
30
35
|
```
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
Each listed slot accepts the same authored forms as its agent counterpart. Static and dynamic tools, skills, and instructions all work in an extension: `extension/instructions.ts` is as valid as `extension/instructions.md`, and `extension/tools/` can contain `defineDynamic(...)`.
|
|
38
|
+
|
|
39
|
+
Names come from paths, so call the tool `search`, not `crm_search`; the consumer's mount adds the `crm__` prefix. Keep shared code in `extension/lib/`.
|
|
33
40
|
|
|
34
|
-
|
|
41
|
+
Keep agent configuration, sandboxes, schedules, and nested extensions in the consumer's agent.
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
### Add configuration and contributions
|
|
44
|
+
|
|
45
|
+
The publisher's `extension/extension.ts` default-exports a `defineExtension` handle. Give it a [Standard Schema](https://standardschema.dev) when consumers need to provide settings:
|
|
37
46
|
|
|
38
47
|
```ts title="extension/extension.ts"
|
|
39
48
|
import { defineExtension } from "eve/extension";
|
|
@@ -42,40 +51,41 @@ import { z } from "zod";
|
|
|
42
51
|
export default defineExtension({
|
|
43
52
|
config: z.object({
|
|
44
53
|
apiKey: z.string(),
|
|
45
|
-
baseUrl: z.string().default("https://api.acme.example"),
|
|
54
|
+
baseUrl: z.string().url().default("https://api.acme.example"),
|
|
46
55
|
}),
|
|
47
56
|
});
|
|
48
57
|
```
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
Contributions import that handle to read the validated configuration. Defaults have already been applied:
|
|
51
60
|
|
|
52
61
|
```ts title="extension/tools/search.ts"
|
|
53
62
|
import { defineTool } from "eve/tools";
|
|
63
|
+
import { z } from "zod";
|
|
54
64
|
|
|
55
65
|
import extension from "../extension";
|
|
56
66
|
|
|
57
67
|
export default defineTool({
|
|
58
68
|
description: "Search the CRM.",
|
|
59
|
-
inputSchema: {
|
|
69
|
+
inputSchema: z.object({ query: z.string() }),
|
|
60
70
|
async execute({ query }) {
|
|
61
|
-
const { apiKey, baseUrl } = extension.config;
|
|
71
|
+
const { apiKey, baseUrl } = extension.config;
|
|
72
|
+
return { query, baseUrl, authenticated: apiKey.length > 0 };
|
|
62
73
|
},
|
|
63
74
|
});
|
|
64
75
|
```
|
|
65
76
|
|
|
66
|
-
|
|
77
|
+
If no configuration is needed, export `defineExtension()` and let consumers re-export it directly. Config schemas must validate synchronously.
|
|
67
78
|
|
|
68
|
-
|
|
79
|
+
`defineState` is automatically scoped to the publisher's package, so the same state name does not collide with the consumer or another extension.
|
|
69
80
|
|
|
70
|
-
|
|
81
|
+
### Build and publish
|
|
71
82
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Declare separate authoring and distribution roots and run `eve extension build` (wired to `build`/`prepare`):
|
|
83
|
+
The scaffold's `package.json` declares separate source and distribution roots:
|
|
75
84
|
|
|
76
85
|
```jsonc title="package.json"
|
|
77
86
|
{
|
|
78
|
-
"name": "
|
|
87
|
+
"name": "my-crm",
|
|
88
|
+
"version": "0.0.0",
|
|
79
89
|
"type": "module",
|
|
80
90
|
"eve": {
|
|
81
91
|
"extension": {
|
|
@@ -84,86 +94,105 @@ Declare separate authoring and distribution roots and run `eve extension build`
|
|
|
84
94
|
},
|
|
85
95
|
},
|
|
86
96
|
"files": ["dist"],
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
{
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"
|
|
97
|
+
"exports": {
|
|
98
|
+
".": {
|
|
99
|
+
"types": "./dist/index.d.ts",
|
|
100
|
+
"default": "./dist/index.mjs",
|
|
101
|
+
},
|
|
102
|
+
"./tools": {
|
|
103
|
+
"types": "./dist/tools/index.d.ts",
|
|
104
|
+
"default": "./dist/tools/index.mjs",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
"scripts": {
|
|
108
|
+
"build": "eve extension build",
|
|
109
|
+
"prepare": "eve extension build",
|
|
110
|
+
"typecheck": "tsc",
|
|
111
|
+
},
|
|
112
|
+
"dependencies": {
|
|
113
|
+
"zod": "^x",
|
|
114
|
+
},
|
|
115
|
+
"devDependencies": {
|
|
116
|
+
"@types/node": "^x",
|
|
117
|
+
"eve": "x.y.z",
|
|
118
|
+
"typescript": "^x",
|
|
119
|
+
},
|
|
120
|
+
"peerDependencies": {
|
|
121
|
+
"eve": "*",
|
|
122
|
+
},
|
|
123
|
+
"engines": {
|
|
124
|
+
"node": ">=24",
|
|
104
125
|
},
|
|
105
|
-
"include": ["extension/**/*.ts"],
|
|
106
126
|
}
|
|
107
127
|
```
|
|
108
128
|
|
|
109
|
-
|
|
129
|
+
The scaffold omits `engines` when it creates a workspace package.
|
|
110
130
|
|
|
111
|
-
|
|
131
|
+
Build the package with `eve extension build`:
|
|
112
132
|
|
|
113
|
-
|
|
133
|
+
```bash
|
|
134
|
+
eve extension build
|
|
135
|
+
```
|
|
114
136
|
|
|
115
|
-
|
|
137
|
+
`eve extension build` writes an agent-shaped `dist/extension` tree, copies skill assets, emits declarations, and records compatibility metadata. It also manages the package exports for the mount factory (`@acme/crm`) and tool definitions (`@acme/crm/tools`). Publish `dist/`; consumers do not need the publisher's TypeScript source.
|
|
116
138
|
|
|
117
|
-
|
|
139
|
+
The exact `eve` development pin controls the publisher's authoring API and build tooling. The wildcard peer lets the consumer provide the runtime copy of eve. At consumption time, eve checks generated metadata, not the npm peer range. Do not add eve to regular `dependencies`.
|
|
118
140
|
|
|
119
|
-
|
|
141
|
+
Put runtime packages such as `zod` or an SDK in `dependencies`. If a dependency cannot be bundled, such as a native addon, tell consumers to add it to `build.externalDependencies` in `agent.ts`.
|
|
120
142
|
|
|
121
|
-
|
|
143
|
+
Consumers can now add the built package to an agent.
|
|
122
144
|
|
|
123
|
-
|
|
145
|
+
## Consumer: install and mount an extension
|
|
124
146
|
|
|
125
|
-
|
|
126
|
-
{
|
|
127
|
-
"peerDependencies": { "eve": "*" },
|
|
128
|
-
"devDependencies": { "eve": "0.25.0" },
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
The exact pin makes builds reproducible. Keep it until the extension intentionally upgrades its eve authoring API. `eve extension build` records the capability contracts required by the build, and each consuming eve validates those requirements before it runs the extension.
|
|
147
|
+
A mount gives the publisher's contributions a namespace. Updating the package updates the mounted extension; nothing is copied into the consumer's agent.
|
|
133
148
|
|
|
134
|
-
|
|
149
|
+
### Install the package
|
|
135
150
|
|
|
136
|
-
|
|
151
|
+
Install the extension in the consumer's agent project:
|
|
137
152
|
|
|
138
|
-
|
|
153
|
+
```bash
|
|
154
|
+
npm install @acme/crm
|
|
155
|
+
```
|
|
139
156
|
|
|
140
|
-
|
|
157
|
+
### Mount it
|
|
141
158
|
|
|
142
|
-
|
|
159
|
+
Create a file under `agent/extensions/`. Its filename becomes the mount namespace. Call the publisher's default export when the extension needs configuration:
|
|
143
160
|
|
|
144
161
|
```ts title="agent/extensions/crm.ts"
|
|
145
162
|
import crm from "@acme/crm";
|
|
146
163
|
|
|
147
|
-
export default crm({ apiKey: process.env.CRM_API_KEY });
|
|
164
|
+
export default crm({ apiKey: process.env.CRM_API_KEY! });
|
|
148
165
|
```
|
|
149
166
|
|
|
150
|
-
|
|
167
|
+
Set `CRM_API_KEY` in the consumer's environment, such as `.env.local` for local development.
|
|
168
|
+
|
|
169
|
+
The mount adds `crm__` to named contributions: `tools/search.ts` becomes `crm__search`, and `connections/api.ts` becomes `crm__api`.
|
|
170
|
+
|
|
171
|
+
For a publisher with no configuration, mount its default export directly:
|
|
151
172
|
|
|
152
173
|
```ts title="agent/extensions/gizmo.ts"
|
|
153
174
|
export { default } from "@acme/gizmo";
|
|
154
175
|
```
|
|
155
176
|
|
|
156
|
-
|
|
177
|
+
The same mount shape works with an npm package, a workspace dependency, or a linked local package.
|
|
178
|
+
|
|
179
|
+
### Override a contribution
|
|
157
180
|
|
|
158
|
-
|
|
181
|
+
Use a directory mount to replace or remove a publisher contribution. Put the mount declaration in `extension.ts` and add overrides beside it:
|
|
159
182
|
|
|
160
183
|
```
|
|
161
184
|
agent/extensions/crm/
|
|
162
|
-
extension.ts
|
|
163
|
-
tools/search.ts
|
|
185
|
+
extension.ts
|
|
186
|
+
tools/search.ts
|
|
164
187
|
```
|
|
165
188
|
|
|
166
|
-
|
|
189
|
+
```ts title="agent/extensions/crm/extension.ts"
|
|
190
|
+
import crm from "@acme/crm";
|
|
191
|
+
|
|
192
|
+
export default crm({ apiKey: process.env.CRM_API_KEY! });
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
A same-named consumer tool, connection, or skill wins. To adjust a publisher tool, import it from the package's `./tools` export and define it again:
|
|
167
196
|
|
|
168
197
|
```ts title="agent/extensions/crm/tools/search.ts"
|
|
169
198
|
import { search } from "@acme/crm/tools";
|
|
@@ -173,7 +202,7 @@ import { always } from "eve/tools/approval";
|
|
|
173
202
|
export default defineTool({ ...search, approval: always() });
|
|
174
203
|
```
|
|
175
204
|
|
|
176
|
-
|
|
205
|
+
To remove a publisher tool, use `disableTool()` in its matching slot:
|
|
177
206
|
|
|
178
207
|
```ts title="agent/extensions/crm/tools/search.ts"
|
|
179
208
|
import { disableTool } from "eve/tools";
|
|
@@ -181,13 +210,13 @@ import { disableTool } from "eve/tools";
|
|
|
181
210
|
export default disableTool();
|
|
182
211
|
```
|
|
183
212
|
|
|
184
|
-
|
|
213
|
+
Hooks and instruction fragments are additive, so they cannot be replaced. To replace a dynamic tool, use a dynamic definition in the same slot; dynamic tools win over same-named static tools at runtime. `disableTool()` removes either kind.
|
|
185
214
|
|
|
186
|
-
|
|
215
|
+
The `crm__` prefix is reserved for this directory mount. A consumer cannot override the extension from `agent/tools/`, `agent/connections/`, or another agent-root slot.
|
|
187
216
|
|
|
188
|
-
###
|
|
217
|
+
### Use a publisher tool result in a hook
|
|
189
218
|
|
|
190
|
-
|
|
219
|
+
To retain a publisher tool's result type in a consumer hook, import its definition from `./tools` and pass it to [`toolResultFrom`](/guides/hooks#narrowing-tool-results):
|
|
191
220
|
|
|
192
221
|
```ts title="agent/hooks/narrow-crm.ts"
|
|
193
222
|
import { defineHook } from "eve/hooks";
|
|
@@ -198,14 +227,23 @@ export default defineHook({
|
|
|
198
227
|
events: {
|
|
199
228
|
"action.result"(event) {
|
|
200
229
|
const match = toolResultFrom(event.data.result, search);
|
|
201
|
-
if (match) console.log(match.output);
|
|
230
|
+
if (match) console.log(match.output);
|
|
202
231
|
},
|
|
203
232
|
},
|
|
204
233
|
});
|
|
205
234
|
```
|
|
206
235
|
|
|
207
|
-
|
|
236
|
+
`toolResultFrom` recognizes the mounted `crm__search` result from the original definition, not the namespaced string. Publishers should keep tool descriptions distinct so eve can assign each definition an unambiguous identity.
|
|
237
|
+
|
|
238
|
+
### Compatibility
|
|
239
|
+
|
|
240
|
+
At build time, eve checks the publisher's generated capability metadata. If the extension needs an unsupported capability contract, upgrade eve or install a compatible extension release.
|
|
208
241
|
|
|
209
|
-
##
|
|
242
|
+
## What to read next
|
|
210
243
|
|
|
211
|
-
|
|
244
|
+
- [Tools](/docs/tools): static tools, approval, and tool output
|
|
245
|
+
- [Dynamic capabilities](/docs/guides/dynamic-capabilities): dynamic tools, skills, and instructions
|
|
246
|
+
- [Instructions](/docs/instructions): static and TypeScript instructions
|
|
247
|
+
- [Skills](/docs/skills): package procedures and supporting files
|
|
248
|
+
- [Connections](/docs/connections): integrate external services
|
|
249
|
+
- [Hooks](/docs/guides/hooks): observe agent events
|
|
@@ -41,7 +41,7 @@ export default eveChannel({
|
|
|
41
41
|
- returns `null` / `undefined`: skip to the next entry
|
|
42
42
|
- **throws**: reject with a specific status
|
|
43
43
|
|
|
44
|
-
If every entry skips, the request gets a `401
|
|
44
|
+
If every entry skips, the request gets a `401` whose `WWW-Authenticate` header advertises the challenge scheme(s) the configured entries declare — `Basic` for `httpBasic()`, `Bearer` for the token-based helpers (`jwtHmac`, `jwtEcdsa`, `oidc`, `vercelOidc`), both when you mix them, and `Bearer` as a fallback for entries that don't declare a scheme (custom `AuthFn`s, or an empty array). See [`withAuthChallenges`](#custom-verifiers) to declare a scheme on a custom `AuthFn`.
|
|
45
45
|
|
|
46
46
|
```ts
|
|
47
47
|
import { type AuthFn, localDev, vercelOidc } from "eve/channels/auth";
|
|
@@ -96,6 +96,8 @@ Any other thrown error follows the normal channel failure path. When building a
|
|
|
96
96
|
| `jwtEcdsa(...)` | You verify asymmetric JWTs minted by another system. |
|
|
97
97
|
| `oidc(...)` | You want eve to verify OIDC-issued tokens from an arbitrary issuer. |
|
|
98
98
|
|
|
99
|
+
`httpBasic(credentials, { realm })` accepts an optional `realm`, rendered on the `WWW-Authenticate: Basic` challenge (e.g. `Basic realm="agent", charset="UTF-8"`) so browsers label their native login prompt. It defaults to `"eve"`, ensuring every Basic challenge includes the required realm. Usernames and passwords are normalized to Unicode NFC before comparison, matching the advertised UTF-8 credential encoding.
|
|
100
|
+
|
|
99
101
|
Exercise caution for agents that process non-public, sensitive, regulated, or production data unless you have implemented other access controls.
|
|
100
102
|
|
|
101
103
|
### `localDev()`
|
|
@@ -131,6 +133,17 @@ vercelOidc({
|
|
|
131
133
|
|
|
132
134
|
When none of the shipped helpers fit, write your own `AuthFn` (the array example above) or call the low-level verifiers directly. Each verifier is the pure function sitting behind the matching strategy helper, and returns `{ ok: true, sessionAuth }` or `{ ok: false }`:
|
|
133
135
|
|
|
136
|
+
A custom `AuthFn` doesn't declare a `WWW-Authenticate` scheme by default, so `routeAuth` falls back to `Bearer` for it. Wrap it with `withAuthChallenges(fn, challenges)` to declare the scheme(s) it actually satisfies, so a mixed `auth` array produces an accurate 401:
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
import { withAuthChallenges, type AuthFn } from "eve/channels/auth";
|
|
140
|
+
|
|
141
|
+
const apiKeyAuth: AuthFn<Request> = withAuthChallenges(
|
|
142
|
+
(request) => (isValidApiKey(request) ? apiKeySessionAuth : null),
|
|
143
|
+
[{ scheme: "Bearer" }],
|
|
144
|
+
);
|
|
145
|
+
```
|
|
146
|
+
|
|
134
147
|
| Verifier | Behind | Input |
|
|
135
148
|
| -------------------------------------- | -------------- | -------------------------------- |
|
|
136
149
|
| `verifyHttpBasic(header, credentials)` | `httpBasic()` | raw `Authorization` header value |
|
|
@@ -74,7 +74,7 @@ For a public demo, use `none()` (also from `eve/channels/auth`) to skip authenti
|
|
|
74
74
|
## Dev vs deploy topology
|
|
75
75
|
|
|
76
76
|
- **Local dev.** `npm run dev` starts the eve dev server next to `nuxt dev` and proxies the eve routes through it. As far as the browser knows, everything is the Nuxt origin.
|
|
77
|
-
- **Vercel.**
|
|
77
|
+
- **Vercel.** The web app and the eve runtime deploy as a single project. On Vercel builds the module adds Build Output [`services`](https://vercel.com/docs/services) for eve and `routes` that send `/eve/v1/**` to that service before filesystem routing; the Nuxt app itself remains the default app. No `vercel.json` is required. By default the generated service runs the installed eve binary from the agent root, so the agent directory does not need its own `package.json`. When the agent needs its own build step, set `eveBuildCommand`:
|
|
78
78
|
|
|
79
79
|
```ts
|
|
80
80
|
export default defineNuxtConfig({
|
|
@@ -92,6 +92,27 @@ For a public demo, use `none()` (also from `eve/channels/auth`) to skip authenti
|
|
|
92
92
|
EVE_NUXT_PRODUCTION_PORT=5000 npm run build && npm run preview
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
+
## Managing vercel.json yourself
|
|
96
|
+
|
|
97
|
+
When `vercel.json` declares [`services`](https://vercel.com/docs/services), the module generates nothing and your configuration owns routing. It must include the eve service (`framework: "eve"`) and a rewrite that exposes the eve transport, or the module fails the build:
|
|
98
|
+
|
|
99
|
+
```json title="vercel.json"
|
|
100
|
+
{
|
|
101
|
+
"services": {
|
|
102
|
+
"web": { "root": ".", "framework": "nuxtjs" },
|
|
103
|
+
"eve": { "root": "agent", "framework": "eve", "buildCommand": "eve build" }
|
|
104
|
+
},
|
|
105
|
+
"rewrites": [{ "source": "/eve/v1/(.*)", "destination": { "service": "eve" } }]
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Migrating from experimentalServices
|
|
110
|
+
|
|
111
|
+
Earlier versions of the module wrote the legacy `experimentalServices` field into `vercel.json`. Vercel no longer routes that model — deployments build both services but every `/eve/v1/*` request returns a platform NOT_FOUND — so the module now ignores the field and warns when it sees one. Migrate either way:
|
|
112
|
+
|
|
113
|
+
- **Generated (default).** Delete `vercel.json` (or just its `experimentalServices` block) and set the project's Framework Preset back to Nuxt.js. The module generates the eve service and its routing on every Vercel build.
|
|
114
|
+
- **Hand-maintained.** Replace `experimentalServices` with the stable `services` and `rewrites` shown above, and keep the "Services" Framework Preset.
|
|
115
|
+
|
|
95
116
|
## What to read next
|
|
96
117
|
|
|
97
118
|
- [`useEveAgent` (Vue)](./use-eve-agent-vue): the composable API
|
package/docs/meta.json
CHANGED
package/docs/reference/cli.md
CHANGED
|
@@ -147,7 +147,7 @@ Pass a bare URL and the UI connects to that server instead of booting a local on
|
|
|
147
147
|
| Flag | Type | Default | Description |
|
|
148
148
|
| ----------------------------------- | ------ | ------------------ | ----------------------------------------------------------------------------------------- |
|
|
149
149
|
| `--host <host>` | string | all interfaces | Host interface to bind |
|
|
150
|
-
| `--port <port>` | number | `$PORT`, then
|
|
150
|
+
| `--port <port>` | number | `$PORT`, then 2000 | Port to listen on |
|
|
151
151
|
| `-u, --url <url>` | string | none | Connect to an existing server URL instead of starting one |
|
|
152
152
|
| `-H, --header <header>` | string | none | Request header for a URL target, in `Name: value` form; repeat for multiple headers |
|
|
153
153
|
| `--no-ui` | flag | UI on | Start the server without an interactive UI |
|
package/docs/schedules.mdx
CHANGED
|
@@ -90,7 +90,7 @@ A handler-form session runs on the same durable runtime engine as any other sess
|
|
|
90
90
|
The dev server mounts a one-shot dispatch route that fires a schedule by name, out of band, exactly once. Since `eve dev` never runs schedules on their cron cadence, this is how you trigger one without waiting for the next production tick.
|
|
91
91
|
|
|
92
92
|
```sh
|
|
93
|
-
curl -X POST http://localhost:
|
|
93
|
+
curl -X POST http://localhost:2000/eve/v1/dev/schedules/heartbeat
|
|
94
94
|
# -> { "scheduleId": "heartbeat", "sessionIds": ["..."] }
|
|
95
95
|
```
|
|
96
96
|
|
package/docs/skills.mdx
CHANGED
|
@@ -9,7 +9,7 @@ A skill is a model-loadable procedure that follows the `SKILL.md` convention. It
|
|
|
9
9
|
|
|
10
10
|
eve scans the files under `agent/skills/` and exposes each one's description to the model alongside a framework-owned `load_skill` tool. When a request matches a skill's description (or you name the skill outright), the model calls `load_skill`, and eve appends that skill's markdown to the active turn's context.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Static skills do not require a sandbox: `load_skill` returns their instructions directly from the compiled agent. Dynamic skills and access to supporting package files require a sandbox. Builds may also prewarm sandbox templates that contain static package files. Supporting files are available under `$HOME/.agents/skills/<skill>/`, with `/workspace/skills/<skill>/` as the fallback when `$HOME` is unavailable. Sibling references inside `SKILL.md`, such as `references/checklist.md`, are relative to the directory containing that specific `SKILL.md`.
|
|
13
13
|
|
|
14
14
|
The description is a routing hint, not a label. Write it as the task that should trigger activation:
|
|
15
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eve",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Filesystem-first framework for durable backend AI agents that run anywhere.",
|
|
6
6
|
"keywords": [
|
|
@@ -289,9 +289,9 @@
|
|
|
289
289
|
"@ai-sdk/otel": "^1.0.26",
|
|
290
290
|
"@ai-sdk/provider": "^4.0.3",
|
|
291
291
|
"@ai-sdk/provider-utils": "^5.0.9",
|
|
292
|
-
"@chat-adapter/slack": "4.
|
|
293
|
-
"@chat-adapter/state-memory": "4.
|
|
294
|
-
"@chat-adapter/twilio": "4.
|
|
292
|
+
"@chat-adapter/slack": "4.34.0",
|
|
293
|
+
"@chat-adapter/state-memory": "4.34.0",
|
|
294
|
+
"@chat-adapter/twilio": "4.34.0",
|
|
295
295
|
"@clack/core": "1.3.1",
|
|
296
296
|
"@nuxt/kit": "^4.0.0",
|
|
297
297
|
"@standard-schema/spec": "1.1.0",
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
"@workflow/world-vercel": "5.0.0-beta.31",
|
|
313
313
|
"ai": "^7.0.26",
|
|
314
314
|
"autoevals": "0.0.132",
|
|
315
|
-
"chat": "4.
|
|
315
|
+
"chat": "4.34.0",
|
|
316
316
|
"chokidar": "5.0.0",
|
|
317
317
|
"commander": "14.0.3",
|
|
318
318
|
"emulate": "0.6.0",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare function eveSandboxUserAgentToken(): string;
|
|
2
|
-
/**
|
|
3
|
-
* Wraps a `fetch` implementation so every request's `user-agent` ends with the
|
|
4
|
-
* {@link eveSandboxUserAgentToken} (e.g.: eve/0.18.1).
|
|
5
|
-
*/
|
|
6
|
-
export declare function withEveSandboxUserAgent(inner?: typeof globalThis.fetch): typeof globalThis.fetch;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{resolveInstalledPackageInfo}from"#internal/application/package.js";function eveSandboxUserAgentToken(){let{name:t,version:n}=resolveInstalledPackageInfo();return`${t}/${n}`}function withEveSandboxUserAgent(e=globalThis.fetch){let t=eveSandboxUserAgentToken();return(n,r)=>{let i=new Headers(r?.headers??(typeof n==`object`&&n&&`headers`in n?n.headers:void 0)),a=i.get(`user-agent`);return i.set(`user-agent`,a?`${a} ${t}`:t),e(n,{...r,headers:i})}}export{eveSandboxUserAgentToken,withEveSandboxUserAgent};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ContextContainer } from "#context/container.js";
|
|
2
|
-
import type { RuntimeTurnAgent } from "#runtime/agent/bootstrap.js";
|
|
3
|
-
export declare function resolveSessionSkillRoot(input: {
|
|
4
|
-
readonly ctx: ContextContainer;
|
|
5
|
-
readonly turnAgent: RuntimeTurnAgent;
|
|
6
|
-
}): Promise<string | undefined>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{SandboxKey}from"#context/keys.js";import{resolveSandboxSkillRoot}from"#shared/skill-paths.js";async function resolveSessionSkillRoot(e){if((e.turnAgent.availableSkills?.length??0)===0)return;let t=e.ctx.get(SandboxKey);if(t===void 0)return;let n=await t.get();if(n!==null)return await resolveSandboxSkillRoot({sandbox:n})}export{resolveSessionSkillRoot};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface EnsureVercelJsonResult {
|
|
2
|
-
readonly servicePrefix: string;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Ensure `vercel.json` declares the Nuxt web service and the eve agent
|
|
6
|
-
* service so a Vercel deployment ships both from one project.
|
|
7
|
-
*
|
|
8
|
-
* Existing services are preserved untouched; an already-configured eve
|
|
9
|
-
* service's `routePrefix` wins over {@link input.servicePrefix}. The file is
|
|
10
|
-
* only rewritten when the resulting config differs from what is on disk.
|
|
11
|
-
*/
|
|
12
|
-
export declare function ensureEveVercelJson(input: {
|
|
13
|
-
readonly appRoot: string;
|
|
14
|
-
readonly eveBuildCommand: string;
|
|
15
|
-
readonly nuxtRoot: string;
|
|
16
|
-
readonly servicePrefix: string;
|
|
17
|
-
}): Promise<EnsureVercelJsonResult>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{join,relative}from"node:path";import{readFile,writeFile}from"node:fs/promises";const VERCEL_JSON_FILE_NAME=`vercel.json`;function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function resolveRelativeEntrypoint(e,n){let r=relative(e,n);return r.length===0?`.`:r.replaceAll(`\\`,`/`)}function normalizeVercelJsonConfig(e){if(!isRecord(e))throw Error(`${VERCEL_JSON_FILE_NAME} must contain a JSON object.`);let t=e.experimentalServices;if(t!==void 0&&!isRecord(t))throw Error(`${VERCEL_JSON_FILE_NAME} experimentalServices must be a JSON object.`);return e}async function readVercelJsonConfig(e){try{return normalizeVercelJsonConfig(JSON.parse(await readFile(e,`utf8`)))}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return{};throw e}}function findServiceByFramework(e,t){return Object.values(e).find(e=>e.framework===t)}async function ensureEveVercelJson(t){let n=join(t.nuxtRoot,VERCEL_JSON_FILE_NAME),i=await readVercelJsonConfig(n),a=resolveRelativeEntrypoint(t.nuxtRoot,t.appRoot),o=i.experimentalServices??{},s=findServiceByFramework(o,`eve`),c=findServiceByFramework(o,`nuxtjs`),l=s?.routePrefix??t.servicePrefix,u={...o};c===void 0&&(u.web={entrypoint:`.`,framework:`nuxtjs`,routePrefix:`/`}),s===void 0&&(u.eve={buildCommand:t.eveBuildCommand,entrypoint:a,framework:`eve`,routePrefix:l});let d={...i,$schema:i.$schema??`https://openapi.vercel.sh/vercel.json`,experimentalServices:u};return JSON.stringify(i)!==JSON.stringify(d)&&await writeFile(n,`${JSON.stringify(d,null,2)}\n`),{servicePrefix:l}}export{ensureEveVercelJson};
|
|
File without changes
|