eve 0.85.0 → 0.86.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 +7 -4
- package/dist/CHANGELOG.md +38 -0
- package/dist/src/cli/commands/agent-prompt/collect-intent.md +2 -1
- package/dist/src/cli/commands/agent-prompt/scaffold.md +1 -2
- package/dist/src/cli/dev/tui/runner.d.ts +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/run.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +4 -4
- package/dist/src/compiled/@vercel/schedules/index.d.ts +45 -6
- package/dist/src/compiled/@vercel/schedules/index.js +2 -2
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/session/active-turn.js +1 -1
- package/dist/src/execution/session/answer-caller.d.ts +9 -5
- package/dist/src/execution/session/answer-caller.js +1 -1
- package/dist/src/execution/session/principal.d.ts +8 -0
- package/dist/src/execution/session/principal.js +1 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/session-callback-request.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/harness/attachment-staging.d.ts +2 -2
- package/dist/src/harness/attachment-staging.js +1 -1
- package/dist/src/internal/application/stamped-package-version.js +1 -1
- package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -1
- package/dist/src/public/schedules/providers/vercel.d.ts +2 -0
- package/dist/src/public/schedules/providers/vercel.js +1 -1
- package/dist/src/runtime/subagents/workflow.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/docs/channels/eve.mdx +1 -5
- package/docs/concepts/project-structure.mdx +1 -1
- package/docs/concepts/security-model.md +4 -0
- package/docs/concepts/upgrade-to-v27-events.md +68 -0
- package/docs/getting-started.mdx +2 -0
- package/docs/guides/auth-and-route-protection.md +1 -0
- package/docs/guides/client/streaming.mdx +1 -1
- package/docs/guides/deployment/self-hosting.md +1 -1
- package/docs/guides/frontend/meta.json +1 -0
- package/docs/guides/frontend/nextjs.mdx +329 -121
- package/docs/guides/frontend/overview.mdx +115 -335
- package/docs/guides/frontend/tanstack.mdx +1 -1
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +5 -5
- package/docs/guides/frontend/use-eve-agent-vue.mdx +5 -5
- package/docs/guides/frontend/use-eve-agent.mdx +385 -0
- package/docs/guides/hooks.md +1 -1
- package/docs/guides/remote-agents.md +4 -2
- package/docs/guides/self-modification.md +6 -0
- package/docs/reference/cli.md +1 -2
- package/docs/sandbox/index.mdx +1 -1
- package/package.json +13 -21
- package/CHANGELOG.md +0 -3106
- package/dist/src/self-modification/agent.d.ts +0 -12
- package/dist/src/self-modification/agent.js +0 -1
|
@@ -10,6 +10,7 @@ This guide covers breaking changes to agent definitions, approvals, channels, cl
|
|
|
10
10
|
- Rebuild and republish installed extensions. Earlier epoch-based distributions cannot be loaded by this release; see [Extensions](../extensions).
|
|
11
11
|
- Keep the deployments that own existing sessions available. A session whose deployment runs eve 0.69 through 0.83 moves to this release the next time it receives a message while idle, or earlier when a channel prepares it for the next message. A session that has a background task, including an idle resumable one, stays on the deployment that owns it until the task finishes, and a session whose deployment runs an earlier release stays there. When a session moves, eve compacts its earlier conversation, so the model continues from a summary while the stored transcript stays intact. The session also starts over on remembered tool approvals and usage limits. On worlds without deployment routing, follow the [stranded-session recovery guidance](./execution-model-and-durability#stranded-sessions).
|
|
12
12
|
- Update event consumers, frontend persistence, and custom channel handlers using the mappings below. See [Sessions, runs & streaming](./sessions-runs-and-streaming) for the current stream contract.
|
|
13
|
+
- If your application saves session history, follows streams itself, or derives outcomes from events, plan that work with [Migrate application-owned state](#migrate-application-owned-state).
|
|
13
14
|
|
|
14
15
|
## Restore saved history
|
|
15
16
|
|
|
@@ -30,6 +31,17 @@ Save the converted events with their metadata unchanged and pass them as `Sessio
|
|
|
30
31
|
|
|
31
32
|
A session saved mid-turn stays unfinished. Convert each session separately: the function throws for an array that doesn't start at `session.started`, that holds a second session, or that holds current events. `convertLegacyEvents` is a migration aid with no compatibility promise and will be removed in a later release.
|
|
32
33
|
|
|
34
|
+
Saved records often hold more than one stream's worth of history. Before you hydrate or convert:
|
|
35
|
+
|
|
36
|
+
- **Select one session.** A chat record can hold several sessions, for example after a chat moves to a new session or a fork copies its parent's history. Pass only the current session's events, from its `session.started`, to `initialEvents` or `convertLegacyEvents`.
|
|
37
|
+
- **Split mixed prefixes.** A record written across the upgrade can hold v26 events followed by v27 events. If its stream has expired, convert only the v26 prefix and keep the later v27 events and their metadata unchanged.
|
|
38
|
+
- **Don't convert folded caches.** Message lists produced by v26 reducers aren't raw events. Re-read the stream, or render those caches as read-only records.
|
|
39
|
+
- **End computed cursors at a complete line.** An event with `meta.endOfLine: false` has more events in the same line. If you compute a cursor yourself, stop at the last complete line.
|
|
40
|
+
- **Treat missing data as unknown.** A partial read must not overwrite a fuller archive, and an expired stream must not replace saved history with an empty one. A child session you can no longer read hasn't necessarily completed.
|
|
41
|
+
- **Guard concurrent writes.** Browser saves, server catch-up reads, and background capture can race. Bind each write to its session, reject a cursor that moves backward, and track each child session's progress separately from its parent's.
|
|
42
|
+
- **Keep copied history inert.** Interactions in a fork, shared copy, or historical transcript belong to the original session. Render them read-only, not as live approval or sign-in controls.
|
|
43
|
+
- **Qualify IDs with the session.** Turn and message IDs aren't unique across sessions. When one record holds several sessions, include the session ID in keys for derived UI state.
|
|
44
|
+
|
|
33
45
|
## Event mapping
|
|
34
46
|
|
|
35
47
|
| v26 | v27 |
|
|
@@ -126,3 +138,59 @@ export default defineHook({
|
|
|
126
138
|
- Replace `eve remote invoke` with `eve remote connect --print <prompt>` for one-shot requests. Use `eve/client` for scripted multi-turn sessions and answers; see the [CLI reference](../reference/cli#eve-remote-connect).
|
|
127
139
|
- MCP's `input_required` now covers sign-ins as well as approvals and questions. Answer non-sign-in interactions using `responses: [{ interactionId, optionId?, text? }]`; complete sign-ins externally. Direct `invokeTool` calls return call-shaped outcomes, not conversational pauses. See [MCP](../channels/mcp).
|
|
128
140
|
- Remote agent protocol 3 supports relaying interactions. A protocol-3 caller relays a protocol-2 remote agent's approvals, questions, and sign-ins, but a protocol-3 remote agent can't relay them to a protocol-2 caller, so upgrade callers before the remote agents they call. Older peers can still exchange results. See [Upgrading callers and remote agents](../guides/remote-agents#upgrading-callers-and-remote-agents).
|
|
141
|
+
|
|
142
|
+
## Migrate application-owned state
|
|
143
|
+
|
|
144
|
+
The tables above cover renamed events and APIs. Applications that save history, follow streams, or track lifecycle state themselves also need to decide which of that state they still own.
|
|
145
|
+
|
|
146
|
+
### Decide what eve owns
|
|
147
|
+
|
|
148
|
+
Let eve own live execution and observation: turn lifecycle, streaming and reconnection, optimistic sends, and interaction state. Use `useEveAgent` or `SessionStore` to follow a session, `view` queries from `eve/events` for lifecycle questions, and `delivery.result()` for a request's outcome.
|
|
149
|
+
|
|
150
|
+
Keep the records eve doesn't hold: saved archives and their cursors, forks and shared copies, feedback, authorization and responder policy, budgets you authored, and ledgers of external effects such as uploads or published changes.
|
|
151
|
+
|
|
152
|
+
- Replace an application-owned lifecycle model as a whole. A second reducer layered on the store becomes another source of truth that can disagree with it.
|
|
153
|
+
- Adapt at the presentation boundary. Map `messages`, `view`, and interaction parts into your existing components instead of rebuilding a lifecycle to feed them.
|
|
154
|
+
|
|
155
|
+
### Find every consumer
|
|
156
|
+
|
|
157
|
+
A clean typecheck doesn't find every v26 consumer. Code that parses NDJSON or saved JSON with locally declared event types compiles against any `eve` version and ignores facts it doesn't recognize.
|
|
158
|
+
|
|
159
|
+
- Search for v26 event names such as `message.completed`, `action.result`, `actions.requested`, and `authorization.required`, not only for `eve` imports. Include scripts, test helpers, and server routes that proxy streams.
|
|
160
|
+
- Run a recorded v27 stream through each consumer and check its output. A reducer that returns nothing, or a filter that matches nothing, still compiles.
|
|
161
|
+
- Check server code that filters or redacts streamed content before it reaches a browser. A filter keyed on v26 event types passes v27 `content.delta` and `content.completed` events through unchanged.
|
|
162
|
+
- Check consumers in other deployments, such as remote agents and their callers, along with their protocol versions.
|
|
163
|
+
|
|
164
|
+
### Attribute results to their delivery
|
|
165
|
+
|
|
166
|
+
- Bind each outcome to the delivery that requested it. Use `delivery.result()` or that delivery's own turn, not the session's latest turn or every event after a polling cursor. Otherwise a queued or concurrent turn can claim another turn's output.
|
|
167
|
+
- For a child session that several calls reuse, follow the `child.sent` links from a call to the child delivery it sent, for example with `agentCallActivity(state, callId)` from `eve/client`. Don't count `delivery.consumed` on the child's stream: answers to the child's questions are deliveries too. See [Child agents](../guides/frontend/use-eve-agent#child-agents).
|
|
168
|
+
- Decide approvals from the interaction's `outcome`, not the call's state. Only `accepted` and `declined` record a decision. An approval that settled `withdrawn` or `interrupted`, for example because its turn was cancelled, wasn't approved. See [Interactions](../guides/frontend/use-eve-agent#interactions).
|
|
169
|
+
- Don't identify runs by the shape of their input. A steering message adds a run to the same turn, and a retry reuses its run ID. Use `turn.started` for once-per-turn work, and `runId` with `turnId` when you need a specific run.
|
|
170
|
+
- Treat acceptance as admission, not completion. When an outcome is unconfirmed, read it again instead of resending after a timeout. Use `operationId` for create requests that you retry; see [the eve channel](../channels/eve).
|
|
171
|
+
- Read payloads by their documented shape. `turn.settled.data.reply` lists the reply's part IDs, not its text; use `reply(ctx.view, turnId)` in hooks and channels, or `messages` in the frontend.
|
|
172
|
+
|
|
173
|
+
### Simplify code eve now owns
|
|
174
|
+
|
|
175
|
+
Application code that mirrors eve's state is usually removable. Measure the result by the state owners you remove, not only by deleted lines.
|
|
176
|
+
|
|
177
|
+
| Usually replaceable | Replacement |
|
|
178
|
+
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
|
179
|
+
| Custom stream followers, reconnect loops, and optimistic-send state | `useEveAgent` or `SessionStore` |
|
|
180
|
+
| Hook or session state that mirrors turns, calls, tasks, or models | `ctx.view` and selectors from `eve/events` |
|
|
181
|
+
| Folds over raw events for status, replies, timing, usage, or cursors | The queries in [Use eve's answers](../guides/frontend/use-eve-agent#use-eves-answers) |
|
|
182
|
+
| Hand-written finite stream readers and history scanners | `session.stream({ follow: false })` or `session.snapshot()` |
|
|
183
|
+
| Conversions from `Interaction` to a custom request shape and back | Native `Interaction` values and the channel's interaction rendering |
|
|
184
|
+
| Retirement code for Slack approval cards and sign-in messages eve posted | Slack's native settlement. Check each channel's docs before removing code for other cards, such as questions |
|
|
185
|
+
| An explicit `turnPolicy: "steer"` on follow-ups | Omit it: messages steer an open turn by default |
|
|
186
|
+
| Event-keyed dynamic capability maps | `defineDynamic(ctx => value)` |
|
|
187
|
+
| Local v26-to-v27 event translators | `convertLegacyEvents` during migration, or a fresh read from position 0 |
|
|
188
|
+
| Tests that only exercised removed machinery | Delete them with that machinery; keep tests for behavior that remains |
|
|
189
|
+
|
|
190
|
+
Keep code that enforces your application's own contracts: archive storage and cursor guards, effect ledgers and deduplication receipts, authorization and responder checks, budgets you authored, `operationId` retries, and product UI such as composers, branches, and sharing.
|
|
191
|
+
|
|
192
|
+
### Verify the migration
|
|
193
|
+
|
|
194
|
+
- Build fixtures from real saved history. Record v26 data with the release you're upgrading from, and pass it through a JSON round trip so tests use the shape you actually store.
|
|
195
|
+
- Test history paths explicitly: expired streams, sessions saved mid-turn, forks, records holding several sessions, and caches written across the upgrade.
|
|
196
|
+
- Test interaction endings other than an answer: cancel a turn while an approval is pending, and send a message while a sign-in is pending.
|
package/docs/getting-started.mdx
CHANGED
|
@@ -84,6 +84,8 @@ npm install eve@latest ai zod
|
|
|
84
84
|
|
|
85
85
|
Declare Node.js 24 in `package.json`, then create `agent/instructions.md` and, when you need runtime configuration, `agent/agent.ts`.
|
|
86
86
|
|
|
87
|
+
When present, the installed package's `node_modules/eve/dist/CHANGELOG.md` contains that version's release notes and a link to the full changelog through that version. Older packages contain the full history at `node_modules/eve/CHANGELOG.md` instead. For an upgrade across multiple releases, review each version between the installed and target versions in the target version's changelog at `https://raw.githubusercontent.com/vercel/eve/refs/tags/eve%40<version>/packages/eve/CHANGELOG.md`.
|
|
88
|
+
|
|
87
89
|
## Continue with the tutorial
|
|
88
90
|
|
|
89
91
|
The [Tutorial](/docs/tutorial/first-agent) builds a data analytics agent step by step. It adds tools, state, sandboxed analysis, reusable skills, and human approval before deploying the result.
|
|
@@ -298,6 +298,7 @@ Inside runtime code, `ctx.session.auth` carries the result of the channel's rout
|
|
|
298
298
|
- `auth.current`: the caller on the active inbound turn.
|
|
299
299
|
- `auth.initiator`: the caller that started the durable session.
|
|
300
300
|
- A follow-up message updates `auth.current` but leaves `auth.initiator` alone. When a different caller follows up on the same session, `auth.current` tracks the new caller for that turn while `auth.initiator` stays pinned to whoever started it.
|
|
301
|
+
- Within a turn the principal is fixed; only its claims may update. A message from the turn's own principal, including a typed answer to a pending `ctx.ask()` or `ask_question`, joins the turn and updates `auth.current` with its claims. A message from anyone else waits for the turn to end and runs as its own turn. Someone else can still answer a pending request with a button or structured response; that settles the request with them as its responder, and the turn keeps its `auth.current`.
|
|
301
302
|
- `auth.current` is whatever the channel passed as `auth` when it dispatched the message. Route auth either accepts the request or returns `401`, but a route handler or channel hook can still dispatch with `auth: null`, such as `source.send(message, { auth: null })` or a Slack `onMessage` hook that returns `{ auth: null }`. On a new session, both values are then `null`. On a continuation, `auth.current` is `null` while `auth.initiator` stays pinned to the session's original caller. Internal runtime paths, such as subagents, can also have no caller auth.
|
|
302
303
|
|
|
303
304
|
Use the principal on `auth.current` (or `auth.initiator`) to scope tools, resolve [dynamic capabilities](./dynamic-capabilities) per principal, or enforce tenant boundaries. There's no second per-session ownership ACL stacked on top of route auth. Access is decided at the HTTP boundary, and the durable session carries the caller snapshot forward into your runtime code.
|
|
@@ -317,7 +317,7 @@ try {
|
|
|
317
317
|
|
|
318
318
|
Construction does not start reads. `observe()` activates a reference-counted scope and returns an idempotent cleanup function. Root streaming also activates child following; framework bindings activate and release scopes after mount. The store continues refreshing admitted children within an active scope even if `followWhile` closes the root stream. There is no full-tree catch-up barrier.
|
|
319
319
|
|
|
320
|
-
`followAgents: true` recursively follows all eligible recorded children within fixed depth, admission, and request limits. A predicate such as `({ depth }) => depth === 1` selects only immediate children. See [child observations](../frontend/
|
|
320
|
+
`followAgents: true` recursively follows all eligible recorded children within fixed depth, admission, and request limits. A predicate such as `({ depth }) => depth === 1` selects only immediate children. See [child observations](../frontend/use-eve-agent#child-agents) for limits, states, and cursor semantics. Child conversations are whole-session views; their messages do not replace authoritative call results.
|
|
321
321
|
|
|
322
322
|
Stop the old scope and construct a new store when the principal or tenant changes. Token refresh callbacks resolve again for each request without changing observation identity. For a cross-origin browser connection, expose `x-eve-observation-key` in the channel's CORS configuration alongside the stream version and tail headers.
|
|
323
323
|
|
|
@@ -114,7 +114,7 @@ A frontend under `apps/web/` is another service managed by your host, not by `ev
|
|
|
114
114
|
|
|
115
115
|
For path-based mounts, strip the public prefix before forwarding requests to the agent and set `EVE_PUBLIC_ROUTE_PREFIX` in that agent's build and runtime environments. Forward its workflow callback routes as well as its eve routes. Keep the browser client, callback URLs, and peer transports consistent with the public mounts.
|
|
116
116
|
|
|
117
|
-
You can instead use [`eve/next`](../frontend/nextjs#
|
|
117
|
+
You can instead use [`eve/next`](../frontend/nextjs#self-host) if you want Next.js to start built agent processes and provide the browser-facing proxy routes. That integration is optional; `eve/vercel` configuration is not used by a self-hosted process manager.
|
|
118
118
|
|
|
119
119
|
## Run schedules
|
|
120
120
|
|