eve 0.27.3 → 0.27.5
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 +15 -0
- package/dist/src/channel/reset-session.d.ts +8 -0
- package/dist/src/channel/reset-session.js +1 -0
- package/dist/src/channel/routes.d.ts +24 -1
- package/dist/src/channel/send.js +1 -1
- package/dist/src/channel/types.d.ts +14 -0
- package/dist/src/chunks/{use-eve-agent-CbF0l_Fp.js → use-eve-agent-BtkhbY2I.js} +53 -4
- package/dist/src/chunks/{use-eve-agent-CgxB9WQv.js → use-eve-agent-NUjD28Iu.js} +53 -4
- package/dist/src/cli/dev/tui/blocks.d.ts +7 -0
- package/dist/src/cli/dev/tui/blocks.js +3 -3
- package/dist/src/cli/dev/tui/message-queue.d.ts +88 -0
- package/dist/src/cli/dev/tui/message-queue.js +1 -0
- package/dist/src/cli/dev/tui/runner.d.ts +33 -0
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/subagent-pump.d.ts +9 -0
- package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +9 -0
- package/dist/src/cli/dev/tui/terminal-renderer.js +13 -11
- package/dist/src/client/index.d.ts +1 -1
- package/dist/src/client/session.d.ts +13 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +10 -0
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/protocol/reset-session.d.ts +14 -0
- package/dist/src/protocol/reset-session.js +1 -0
- package/dist/src/protocol/routes.d.ts +5 -0
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/public/channels/eve.d.ts +2 -2
- package/dist/src/public/channels/eve.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/slack/index.d.ts +1 -1
- package/dist/src/public/channels/slack/interactions.d.ts +2 -1
- package/dist/src/public/channels/slack/interactions.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +24 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/vercel-project-api.d.ts +1 -1
- package/dist/src/setup/vercel-project-api.js +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/channels/custom.mdx +38 -1
- package/docs/channels/slack.mdx +21 -2
- package/docs/extensions.md +98 -18
- package/docs/guides/dev-tui.md +9 -2
- package/docs/reference/cli.md +1 -1
- package/package.json +1 -1
package/docs/extensions.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Extensions"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Package reusable eve capabilities and mount them from npm or a monorepo workspace."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Extensions package eve tools, connections, skills, instruction fragments, and hooks.
|
|
6
|
+
Extensions package eve tools, connections, skills, instruction fragments, and hooks. An author builds an extension package; each agent that uses it declares the package as a dependency and mounts it. The package can be published to a registry or kept private inside a monorepo workspace.
|
|
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
|
+
## Author: create an extension
|
|
11
11
|
|
|
12
12
|
### Create the package
|
|
13
13
|
|
|
@@ -42,7 +42,7 @@ Keep agent configuration, sandboxes, schedules, and nested extensions in the con
|
|
|
42
42
|
|
|
43
43
|
### Add configuration and contributions
|
|
44
44
|
|
|
45
|
-
The
|
|
45
|
+
The author's `extension/extension.ts` default-exports a `defineExtension` handle. Give it a [Standard Schema](https://standardschema.dev) when consumers need to provide settings:
|
|
46
46
|
|
|
47
47
|
```ts title="extension/extension.ts"
|
|
48
48
|
import { defineExtension } from "eve/extension";
|
|
@@ -76,9 +76,9 @@ export default defineTool({
|
|
|
76
76
|
|
|
77
77
|
If no configuration is needed, export `defineExtension()` and let consumers re-export it directly. Config schemas must validate synchronously.
|
|
78
78
|
|
|
79
|
-
`defineState` is automatically scoped to the
|
|
79
|
+
`defineState` is automatically scoped to the extension package, so the same state name does not collide with the consumer or another extension.
|
|
80
80
|
|
|
81
|
-
### Build and publish
|
|
81
|
+
### Build and optionally publish
|
|
82
82
|
|
|
83
83
|
The scaffold's `package.json` declares separate source and distribution roots:
|
|
84
84
|
|
|
@@ -134,17 +134,17 @@ Build the package with `eve extension build`:
|
|
|
134
134
|
eve extension build
|
|
135
135
|
```
|
|
136
136
|
|
|
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
|
|
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 author's TypeScript source.
|
|
138
138
|
|
|
139
|
-
The exact `eve` development pin controls the
|
|
139
|
+
The exact `eve` development pin controls the extension 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`.
|
|
140
140
|
|
|
141
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`.
|
|
142
142
|
|
|
143
|
-
Consumers can now add the built package to an agent.
|
|
143
|
+
Consumers can now add the built package to an agent. A workspace-only extension uses the same package contract but does not need to be published; see [Use an extension in a workspace](#use-an-extension-in-a-workspace).
|
|
144
144
|
|
|
145
145
|
## Consumer: install and mount an extension
|
|
146
146
|
|
|
147
|
-
A mount gives the
|
|
147
|
+
A mount gives the extension's contributions a namespace. Updating the package updates the mounted extension; nothing is copied into the consumer's agent.
|
|
148
148
|
|
|
149
149
|
### Install the package
|
|
150
150
|
|
|
@@ -156,7 +156,7 @@ pnpm add @acme/crm
|
|
|
156
156
|
|
|
157
157
|
### Mount it
|
|
158
158
|
|
|
159
|
-
Create a file under `agent/extensions/`. Its filename becomes the mount namespace. Call the
|
|
159
|
+
Create a file under `agent/extensions/`. Its filename becomes the mount namespace. Call the extension's default export when it needs configuration:
|
|
160
160
|
|
|
161
161
|
```ts title="agent/extensions/crm.ts"
|
|
162
162
|
import crm from "@acme/crm";
|
|
@@ -168,7 +168,7 @@ Set `CRM_API_KEY` in the consumer's environment, such as `.env.local` for local
|
|
|
168
168
|
|
|
169
169
|
The mount adds `crm__` to named contributions: `tools/search.ts` becomes `crm__search`, and `connections/api.ts` becomes `crm__api`.
|
|
170
170
|
|
|
171
|
-
For
|
|
171
|
+
For an extension with no configuration, mount its default export directly:
|
|
172
172
|
|
|
173
173
|
```ts title="agent/extensions/gizmo.ts"
|
|
174
174
|
export { default } from "@acme/gizmo";
|
|
@@ -176,9 +176,89 @@ export { default } from "@acme/gizmo";
|
|
|
176
176
|
|
|
177
177
|
The same mount shape works with an npm package, a workspace dependency, or a linked local package.
|
|
178
178
|
|
|
179
|
+
### Use an extension in a workspace
|
|
180
|
+
|
|
181
|
+
A workspace extension is a regular extension package kept in the same monorepo as its consumers. It is useful when several agents need the same capabilities, or when a private capability should evolve alongside the agents that use it.
|
|
182
|
+
|
|
183
|
+
For example, a pnpm workspace can keep one extension next to two independently deployable agents:
|
|
184
|
+
|
|
185
|
+
```text
|
|
186
|
+
acme-agents/
|
|
187
|
+
├── pnpm-workspace.yaml
|
|
188
|
+
├── packages/
|
|
189
|
+
│ └── shared-capabilities/
|
|
190
|
+
│ ├── package.json
|
|
191
|
+
│ └── extension/
|
|
192
|
+
│ ├── extension.ts
|
|
193
|
+
│ ├── tools/
|
|
194
|
+
│ ├── skills/
|
|
195
|
+
│ └── hooks/
|
|
196
|
+
└── agents/
|
|
197
|
+
├── support/
|
|
198
|
+
│ ├── package.json
|
|
199
|
+
│ └── agent/extensions/shared.ts
|
|
200
|
+
└── operations/
|
|
201
|
+
├── package.json
|
|
202
|
+
└── agent/extensions/shared.ts
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Make both the extension and agent directories workspace members:
|
|
206
|
+
|
|
207
|
+
```yaml title="pnpm-workspace.yaml"
|
|
208
|
+
packages:
|
|
209
|
+
- "agents/*"
|
|
210
|
+
- "packages/*"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
You can scaffold the extension from a directory already covered by the workspace configuration:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
cd packages
|
|
217
|
+
npx eve@latest extension init shared-capabilities
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Give the generated package the name consumers will import. Add `"private": true` if it should never be published:
|
|
221
|
+
|
|
222
|
+
```jsonc title="packages/shared-capabilities/package.json"
|
|
223
|
+
{
|
|
224
|
+
"name": "@acme/shared-capabilities",
|
|
225
|
+
"private": true,
|
|
226
|
+
"eve": {
|
|
227
|
+
"extension": {
|
|
228
|
+
"source": "./extension",
|
|
229
|
+
"dist": "./dist/extension",
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Each consuming agent declares its own workspace dependency:
|
|
236
|
+
|
|
237
|
+
```jsonc title="agents/support/package.json"
|
|
238
|
+
{
|
|
239
|
+
"dependencies": {
|
|
240
|
+
"@acme/shared-capabilities": "workspace:*",
|
|
241
|
+
},
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Then each agent mounts the package:
|
|
246
|
+
|
|
247
|
+
```ts title="agents/support/agent/extensions/shared.ts"
|
|
248
|
+
export { default } from "@acme/shared-capabilities";
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
The mount is intentionally per agent. Each consumer chooses its own mount namespace and, for a configured extension, passes its own configuration. For example, `shared.ts` contributes `shared__search`, while mounting the same package as `company.ts` in another agent contributes `company__search`.
|
|
252
|
+
|
|
253
|
+
#### Develop from source
|
|
254
|
+
|
|
255
|
+
When `eve dev` starts a consuming agent, it builds mounted, source-backed extensions found inside the same workspace before compiling the agent. It watches the extension source and relevant package and TypeScript configuration, then rebuilds only the affected extension. If an extension edit fails to build, the previous successful development generation keeps running.
|
|
256
|
+
|
|
257
|
+
Production `eve build` expects the extension distribution to exist already. Keep `eve extension build` in the extension package's `build` and `prepare` scripts, as the scaffold does, and run workspace builds in dependency order so extensions build before their consuming agents.
|
|
258
|
+
|
|
179
259
|
### Override a contribution
|
|
180
260
|
|
|
181
|
-
Use a directory mount to replace or remove
|
|
261
|
+
Use a directory mount to replace or remove an extension contribution. Put the mount declaration in `extension.ts` and add overrides beside it:
|
|
182
262
|
|
|
183
263
|
```
|
|
184
264
|
agent/extensions/crm/
|
|
@@ -192,7 +272,7 @@ import crm from "@acme/crm";
|
|
|
192
272
|
export default crm({ apiKey: process.env.CRM_API_KEY! });
|
|
193
273
|
```
|
|
194
274
|
|
|
195
|
-
A same-named consumer tool, connection, or skill wins. To adjust
|
|
275
|
+
A same-named consumer tool, connection, or skill wins. To adjust an extension tool, import it from the package's `./tools` export and define it again:
|
|
196
276
|
|
|
197
277
|
```ts title="agent/extensions/crm/tools/search.ts"
|
|
198
278
|
import { search } from "@acme/crm/tools";
|
|
@@ -202,7 +282,7 @@ import { always } from "eve/tools/approval";
|
|
|
202
282
|
export default defineTool({ ...search, approval: always() });
|
|
203
283
|
```
|
|
204
284
|
|
|
205
|
-
To remove
|
|
285
|
+
To remove an extension tool, use `disableTool()` in its matching slot:
|
|
206
286
|
|
|
207
287
|
```ts title="agent/extensions/crm/tools/search.ts"
|
|
208
288
|
import { disableTool } from "eve/tools";
|
|
@@ -214,9 +294,9 @@ Hooks and instruction fragments are additive, so they cannot be replaced. To rep
|
|
|
214
294
|
|
|
215
295
|
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.
|
|
216
296
|
|
|
217
|
-
### Use
|
|
297
|
+
### Use an extension tool result in a hook
|
|
218
298
|
|
|
219
|
-
To retain
|
|
299
|
+
To retain an extension tool's result type in a consumer hook, import its definition from `./tools` and pass it to [`toolResultFrom`](/guides/hooks#narrowing-tool-results):
|
|
220
300
|
|
|
221
301
|
```ts title="agent/hooks/narrow-crm.ts"
|
|
222
302
|
import { defineHook } from "eve/hooks";
|
|
@@ -237,7 +317,7 @@ export default defineHook({
|
|
|
237
317
|
|
|
238
318
|
### Compatibility
|
|
239
319
|
|
|
240
|
-
At build time, eve checks the
|
|
320
|
+
At build time, eve checks the extension's generated capability metadata. If the extension needs an unsupported capability contract, upgrade eve or install a compatible extension release.
|
|
241
321
|
|
|
242
322
|
## What to read next
|
|
243
323
|
|
package/docs/guides/dev-tui.md
CHANGED
|
@@ -71,7 +71,8 @@ Chat and freeform `ask_question` inputs behave like a shell line editor.
|
|
|
71
71
|
|
|
72
72
|
| Key | Action |
|
|
73
73
|
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
74
|
-
| `Enter` | Submit the message or question response.
|
|
74
|
+
| `Enter` | Submit the message or question response. While a turn is running, queue the message for the next turn. |
|
|
75
|
+
| `Esc` | While a turn runs: pop the oldest queued message and steer with it; with nothing queued, press twice to cancel. |
|
|
75
76
|
| `Shift+Enter` | Insert a newline without sending (needs a terminal that reports modified keys). |
|
|
76
77
|
| `Ctrl+C` | Interrupt a running turn. At the chat or freeform-question prompt, clear non-empty input; when empty, quit. |
|
|
77
78
|
| `↑` / `↓` | Move between input lines; at a chat-buffer edge, navigate messages you have sent this session. |
|
|
@@ -82,7 +83,13 @@ Chat and freeform `ask_question` inputs behave like a shell line editor.
|
|
|
82
83
|
|
|
83
84
|
In terminals that support bracketed paste, pasting multi-line text into chat or a freeform question inserts it intact and renders one row per line rather than submitting at the first line. `Shift+Enter` adds a line by hand. The input grows down to the available terminal height, then scrolls to keep the caret visible; `Enter` submits the whole response.
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
### Queue and steer while the agent works
|
|
87
|
+
|
|
88
|
+
Sending a message while a turn is still running does not interrupt it — the message joins a queue of up to five, pinned in a panel directly above the input with one line per message. When the turn ends, the queued messages coalesce into the next turn's message.
|
|
89
|
+
|
|
90
|
+
`Esc` steers instead of waiting: it pops the oldest queued message, cancels the running turn cooperatively, and submits the popped message as the replacement turn. In the transcript, a steered message carries an accent `↑` on its own line above its gutter bar; a queued message that waited for the boundary carries it below. Any remaining messages stay queued behind it. With nothing queued, the first `Esc` arms cancellation and a second `Esc` cancels the turn. Unlike `Ctrl+C` — which drops the stream client-side — a cancelled turn ends cleanly on the server and the session keeps its context; the conversation picks up at the next prompt.
|
|
91
|
+
|
|
92
|
+
If a turn fails terminally (the server session dies or the connection drops), the TUI starts a fresh session and notes it inline so you can keep going. Server-side context resets with the old session. Messages still queued when a turn is interrupted or fails are restored into the next prompt's input instead of being sent blind.
|
|
86
93
|
|
|
87
94
|
## Answer the agent inline
|
|
88
95
|
|
package/docs/reference/cli.md
CHANGED
|
@@ -173,7 +173,7 @@ For bearer tokens or custom schemes, pass explicit headers with `-H`.
|
|
|
173
173
|
|
|
174
174
|
Local dev records the last ready URL per resolved app root in `.eve/dev-server-state.v1.json`. A second interactive `eve dev` reconnects only when that URL is loopback and healthy; each terminal UI creates a fresh client session while sharing the server process. A stale or malformed record is replaced when eve starts a new server. Passing `--host`, `--port`, or a `PORT` environment value skips reconnection and reports a healthy recorded server instead.
|
|
175
175
|
|
|
176
|
-
Local dev keeps immutable runtime source snapshots under `.eve/dev-runtime/snapshots/` so in-flight turns hold a consistent code revision while new turns pick up rebuilds. The terminal REPL keeps its logical session across successful rebuilds, so the next turn continues the conversation on the latest generation;
|
|
176
|
+
Local dev keeps immutable runtime source snapshots under `.eve/dev-runtime/snapshots/` so in-flight turns hold a consistent code revision while new turns pick up rebuilds. The terminal REPL keeps its logical session across successful rebuilds, so the next turn continues the conversation on the latest generation; `/new` terminally retires that session before clearing the transcript, and the next prompt starts a fresh session with a new session-scoped sandbox on first sandbox use. After a generation is superseded, `eve dev` retains it for at least 30 minutes and also retains the five most recently superseded generations, regardless of the configured Workflow World. The active generation is never pruned. Old runtime snapshots and local sandbox templates are pruned in the background. For manual cleanup, stop `eve dev` before deleting `.eve/dev-runtime/snapshots/` or `.eve/sandbox-cache/local/templates/`. A turn that remains unfinished beyond the automatic retention window can no longer resume after its generation is pruned.
|
|
177
177
|
|
|
178
178
|
## `eve logs`
|
|
179
179
|
|