eve 0.57.0 → 0.58.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.
Files changed (148) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +1 -0
  3. package/dist/src/channel/activity-sink.js +1 -1
  4. package/dist/src/channel/session-callback.js +1 -1
  5. package/dist/src/chunks/{use-eve-agent-C2APNCdP.js → use-eve-agent-CxWcZCsU.js} +22 -3
  6. package/dist/src/chunks/{use-eve-agent-D0YnDLi_.js → use-eve-agent-X0asmJg-.js} +22 -3
  7. package/dist/src/cli/commands/integration-setup.js +1 -1
  8. package/dist/src/cli/dev/command.d.ts +30 -0
  9. package/dist/src/cli/dev/command.js +3 -0
  10. package/dist/src/cli/dev/tui/setup-commands.js +1 -1
  11. package/dist/src/cli/dev/tui/setup-issues.js +1 -1
  12. package/dist/src/cli/dev/tui/setup-panel.js +2 -1
  13. package/dist/src/cli/dev/tui/terminal-renderer.js +1 -1
  14. package/dist/src/cli/dev/tui/tui.js +1 -1
  15. package/dist/src/cli/option-parsers.js +1 -1
  16. package/dist/src/cli/run.js +1 -3
  17. package/dist/src/client/agent-host.js +1 -1
  18. package/dist/src/client/url.js +1 -1
  19. package/dist/src/compiled/.vendor-stamp.json +2 -2
  20. package/dist/src/compiled/@ai-sdk/code-mode/index.d.ts +18 -2
  21. package/dist/src/compiled/@ai-sdk/code-mode/index.js +16 -14
  22. package/dist/src/compiler/extension-compatibility.d.ts +12 -12
  23. package/dist/src/compiler/extension-compatibility.js +1 -1
  24. package/dist/src/context/dynamic-model-lifecycle.d.ts +1 -0
  25. package/dist/src/context/dynamic-model-lifecycle.js +1 -1
  26. package/dist/src/context/keys.d.ts +11 -3
  27. package/dist/src/context/memory-lifecycle.d.ts +2 -5
  28. package/dist/src/context/memory-lifecycle.js +1 -1
  29. package/dist/src/dynamic/definition.d.ts +2 -0
  30. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  31. package/dist/src/execution/node-step.js +1 -1
  32. package/dist/src/execution/session/event-sink.js +1 -1
  33. package/dist/src/execution/session/turn-step.js +1 -1
  34. package/dist/src/execution/tools/sleep-workflow.js +1 -1
  35. package/dist/src/execution/workflow-callback-url.js +1 -1
  36. package/dist/src/experimental/evaluate/auto-model.d.ts +16 -0
  37. package/dist/src/experimental/evaluate/auto-model.js +2 -0
  38. package/dist/src/harness/emission.d.ts +1 -1
  39. package/dist/src/harness/emission.js +1 -1
  40. package/dist/src/harness/messages.d.ts +1 -0
  41. package/dist/src/harness/messages.js +1 -1
  42. package/dist/src/harness/tool-loop.js +2 -2
  43. package/dist/src/internal/application/package.js +1 -1
  44. package/dist/src/internal/authored-definition/core.js +1 -1
  45. package/dist/src/internal/model-auth/transport.d.ts +3 -1
  46. package/dist/src/internal/model-auth/transport.js +1 -1
  47. package/dist/src/internal/nitro/host/normalize-vercel-service-crons.js +1 -1
  48. package/dist/src/internal/nitro/host/start-development-server.js +1 -1
  49. package/dist/src/internal/runtime-model.d.ts +3 -0
  50. package/dist/src/internal/runtime-model.js +1 -1
  51. package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
  52. package/dist/src/internal/vercel/eve-service-contribution.d.ts +1 -0
  53. package/dist/src/internal/vercel/eve-service-contribution.js +1 -1
  54. package/dist/src/internal/vercel/vercel-services-config.d.ts +1 -0
  55. package/dist/src/internal/vercel/vercel-services-config.js +1 -1
  56. package/dist/src/public/definitions/workspace-agent.js +1 -1
  57. package/dist/src/public/experimental/evaluate/index.d.ts +1 -0
  58. package/dist/src/public/experimental/evaluate/index.js +1 -0
  59. package/dist/src/public/models/anthropic/index.js +1 -1
  60. package/dist/src/public/next/index.d.ts +1 -1
  61. package/dist/src/public/next/index.js +1 -1
  62. package/dist/src/public/vercel/index.d.ts +1 -1
  63. package/dist/src/public/vercel/index.js +1 -1
  64. package/dist/src/react/use-eve-agent.d.ts +1 -1
  65. package/dist/src/runtime/agent/bootstrap.d.ts +4 -2
  66. package/dist/src/runtime/agent/resolve-model.d.ts +0 -1
  67. package/dist/src/runtime/agent/resolve-model.js +1 -1
  68. package/dist/src/self-modification/agent.d.ts +6 -18
  69. package/dist/src/self-modification/agent.js +1 -1
  70. package/dist/src/self-modification/config.d.ts +17 -12
  71. package/dist/src/self-modification/config.js +1 -1
  72. package/dist/src/self-modification/credentials.d.ts +1 -10
  73. package/dist/src/self-modification/credentials.js +1 -1
  74. package/dist/src/self-modification/extension/extension.d.ts +7 -13
  75. package/dist/src/self-modification/extension/extension.js +1 -1
  76. package/dist/src/self-modification/github-publisher.d.ts +1 -1
  77. package/dist/src/self-modification/mode.js +1 -1
  78. package/dist/src/self-modification/setup.d.ts +1 -1
  79. package/dist/src/self-modification/setup.js +23 -4
  80. package/dist/src/setup/flows/model-login-connection.js +1 -1
  81. package/dist/src/setup/flows/registry.d.ts +3 -0
  82. package/dist/src/setup/flows/registry.js +2 -2
  83. package/dist/src/setup/integrations/discord/setup.js +1 -1
  84. package/dist/src/setup/integrations/file-memory/setup.js +2 -2
  85. package/dist/src/setup/integrations/github/setup.js +1 -1
  86. package/dist/src/setup/integrations/linear/setup.js +1 -1
  87. package/dist/src/setup/integrations/linq/setup.js +1 -1
  88. package/dist/src/setup/integrations/photon/setup-flow.js +1 -1
  89. package/dist/src/setup/integrations/registry.js +1 -1
  90. package/dist/src/setup/integrations/runner.d.ts +3 -0
  91. package/dist/src/setup/integrations/runner.js +1 -1
  92. package/dist/src/setup/integrations/self-modification/setup.d.ts +7 -1
  93. package/dist/src/setup/integrations/self-modification/setup.js +1 -1
  94. package/dist/src/setup/integrations/shared/scaffold.js +1 -1
  95. package/dist/src/setup/integrations/shared/ui.d.ts +1 -0
  96. package/dist/src/setup/integrations/shared/ui.js +1 -1
  97. package/dist/src/setup/integrations/shopify/setup.js +1 -1
  98. package/dist/src/setup/integrations/slack/setup.js +1 -1
  99. package/dist/src/setup/integrations/teams/connect.d.ts +22 -0
  100. package/dist/src/setup/integrations/teams/connect.js +1 -0
  101. package/dist/src/setup/integrations/teams/setup.d.ts +21 -0
  102. package/dist/src/setup/integrations/teams/setup.js +7 -0
  103. package/dist/src/setup/integrations/types.d.ts +6 -0
  104. package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
  105. package/dist/src/setup/scaffold/create/project.d.ts +1 -1
  106. package/dist/src/setup/scaffold/create/project.js +2 -2
  107. package/dist/src/setup/scaffold/update/channels.d.ts +2 -0
  108. package/dist/src/setup/scaffold/update/channels.js +2 -2
  109. package/dist/src/setup/scaffold/update/connections.js +3 -3
  110. package/dist/src/setup/scaffold/update/web-options.js +1 -1
  111. package/dist/src/setup/scaffold/version-tokens.d.ts +2 -1
  112. package/dist/src/setup/scaffold/version-tokens.js +1 -1
  113. package/dist/src/shared/agent-definition.d.ts +2 -0
  114. package/dist/src/shared/eve-route-path.d.ts +4 -0
  115. package/dist/src/shared/eve-route-path.js +1 -0
  116. package/dist/src/shared/public-route-prefix.d.ts +1 -1
  117. package/dist/src/subagents/remote-route-url.js +1 -1
  118. package/dist/src/svelte/index.js +1 -1
  119. package/dist/src/svelte/use-eve-agent.d.ts +1 -1
  120. package/dist/src/svelte/use-eve-agent.js +1 -1
  121. package/dist/src/vue/index.js +1 -1
  122. package/dist/src/vue/use-eve-agent.d.ts +1 -1
  123. package/dist/src/vue/use-eve-agent.js +1 -1
  124. package/docs/README.md +45 -40
  125. package/docs/agent-config.md +8 -1
  126. package/docs/channels/teams.mdx +29 -0
  127. package/docs/concepts/meta.json +1 -0
  128. package/docs/concepts/project-structure.mdx +111 -0
  129. package/docs/getting-started.mdx +18 -106
  130. package/docs/guides/auth-and-route-protection.md +8 -4
  131. package/docs/guides/deployment/self-hosting.md +40 -0
  132. package/docs/guides/deployment/vercel.mdx +26 -23
  133. package/docs/guides/dynamic-capabilities.md +4 -0
  134. package/docs/guides/evaluate.md +118 -0
  135. package/docs/guides/frontend/nextjs.mdx +61 -20
  136. package/docs/guides/frontend/overview.mdx +3 -3
  137. package/docs/guides/instrumentation/otel.mdx +7 -2
  138. package/docs/guides/instrumentation/providers.mdx +2 -3
  139. package/docs/guides/remote-agents.md +5 -1
  140. package/docs/install-integrations.mdx +1 -1
  141. package/docs/meta.json +1 -0
  142. package/docs/reference/agent-files.md +104 -0
  143. package/docs/reference/cli.md +2 -2
  144. package/docs/reference/meta.json +1 -1
  145. package/docs/reference/typescript-api.md +2 -1
  146. package/docs/schedules.mdx +1 -1
  147. package/docs/subagents/index.mdx +2 -2
  148. package/package.json +9 -4
@@ -14,6 +14,35 @@ import { teamsChannel } from "eve/channels/teams";
14
14
  export default teamsChannel();
15
15
  ```
16
16
 
17
+ ### Vercel Connect
18
+
19
+ For a managed Teams bot on Vercel, run:
20
+
21
+ ```bash
22
+ eve add channel/teams
23
+ ```
24
+
25
+ The guided flow runs the Vercel Connect CLI, which takes you through managed
26
+ Microsoft Teams app creation and installation. It routes verified Activities to
27
+ `/eve/v1/teams` and writes:
28
+
29
+ ```ts title="agent/channels/teams.ts"
30
+ import { connectTeamsCredentials } from "@vercel/connect/eve";
31
+ import { teamsChannel } from "eve/channels/teams";
32
+
33
+ export default teamsChannel({
34
+ credentials: connectTeamsCredentials("microsoft-teams/my-agent"),
35
+ });
36
+ ```
37
+
38
+ Vercel Connect owns the Microsoft administrator consent and app installation
39
+ flow. After deployment, mention the bot in a channel or send it a personal
40
+ message.
41
+
42
+ ### Portable credentials
43
+
44
+ To manage the bot registration and credentials yourself, configure:
45
+
17
46
  ```bash
18
47
  MICROSOFT_APP_ID=...
19
48
  MICROSOFT_APP_PASSWORD=...
@@ -2,6 +2,7 @@
2
2
  "title": "Core Concepts",
3
3
  "defaultOpen": false,
4
4
  "pages": [
5
+ "project-structure",
5
6
  "execution-model-and-durability",
6
7
  "sessions-runs-and-streaming",
7
8
  "state",
@@ -0,0 +1,111 @@
1
+ ---
2
+ title: "Project Structure"
3
+ description: "Start with one agent, keep application code beside it, and split into a workspace only when you need separately addressable agents."
4
+ ---
5
+
6
+ Start with one root agent in `agent/`. A root agent accepts requests through its own HTTP API or channels; it can have many tools, skills, and subagents. Keep browser application files outside `agent/`.
7
+
8
+ | When you need… | Structure |
9
+ | ---------------------------------------------------------------------- | ------------------------------------------------ |
10
+ | One agent, with or without a browser app | `agent/` beside your application code |
11
+ | A specialist that an agent delegates to | `agent/subagents/<name>/` inside that agent |
12
+ | Several separately addressable agents sharing a package and deployment | `agents/<name>/agent/` in an eve agent workspace |
13
+ | Separate dependencies, versions, or release schedules | Separate agent packages or projects |
14
+
15
+ Every root agent can have [declared subagents](/docs/subagents#declared-subagents) with their own prompts, tools, and sandboxes. These specialists have no separate channel endpoint and do not inherit the parent's authored capabilities. Use a [skill](/docs/skills) instead when you only need an optional procedure.
16
+
17
+ ## One agent
18
+
19
+ Use this layout for a standalone agent or an agent inside a web application:
20
+
21
+ ```text
22
+ project/
23
+ ├── package.json
24
+ ├── agent/
25
+ │ ├── instructions.md
26
+ │ ├── tools/
27
+ │ └── subagents/
28
+ ├── evals/
29
+ ├── app/ # optional Next.js browser application
30
+ └── next.config.ts # optional Next.js integration
31
+ ```
32
+
33
+ Create the agent with [Getting Started](/docs/getting-started). The [Agent Files reference](/docs/reference/agent-files) lists supported paths. Keep agent-only helpers in `agent/lib/`; share reusable capabilities through [extensions](/docs/extensions).
34
+
35
+ For a generated Next.js chat UI, run `eve add channel/web` from the project root. For an existing browser app, follow your [framework integration guide](/docs/guides/frontend/overview#per-framework-integration).
36
+
37
+ ## Several root agents
38
+
39
+ Use an eve agent workspace when, for example, clients need to address support and research separately:
40
+
41
+ ```text
42
+ project/
43
+ ├── package.json
44
+ ├── agents/
45
+ │ ├── support/
46
+ │ │ ├── agent/
47
+ │ │ └── evals/
48
+ │ └── research/
49
+ │ ├── agent/
50
+ │ └── evals/
51
+ └── apps/ # optional peer applications, not eve workspace members
52
+ └── web/
53
+ ```
54
+
55
+ Members share the root package, dependencies, scripts, and Vercel deployment. Their directory names identify them in the CLI and public routes. Members have no `package.json` of their own: adding one excludes that directory from eve workspace discovery. Unlike a package-manager workspace, this layout does not give members separate dependency or version boundaries.
56
+
57
+ Create a workspace, then select an agent to run:
58
+
59
+ ```bash
60
+ npx eve@latest init operations --agents support,research
61
+ cd operations
62
+ npx eve dev --agent support
63
+ ```
64
+
65
+ Run agent commands such as `dev`, `info`, and `eval` from `agents/<name>/`, or pass `--agent <name>` from the workspace root. `eve dev --agent support` runs the selected agent, not peer applications. Start other agents separately when needed; local [workspace-peer calls](/docs/subagents#vercel-workspace-peers) require an explicit transport.
66
+
67
+ On Vercel, run `eve link` and `eve deploy` from the root; deployment includes all members. No frontend is required. For self-hosting, [build and run each member separately](/docs/guides/deployment/self-hosting#run-workspace-members).
68
+
69
+ ## Independent releases
70
+
71
+ Use separate packages or projects when agents need independent dependencies or releases, even within the same monorepo. These are not eve agent-workspace members. Share capabilities through [workspace extensions](/docs/extensions#use-an-extension-in-a-workspace); delegate across deployments with [remote agents](/docs/guides/remote-agents).
72
+
73
+ ## Configure a web deployment
74
+
75
+ Choose how the frontend and agents run together independently of how many agents you have:
76
+
77
+ - **Add agents to a Next.js application:** use [`eve/next`](/docs/guides/frontend/nextjs) in `next.config.ts`. Next.js owns the application lifecycle; the integration starts agent processes and proxies requests locally, and contributes separate agent services on Vercel. A root Next.js app can sit beside either `agent/` or `agents/`; workspace members are discovered automatically.
78
+ - **Add a frontend to an agent workspace:** keep the frontend as a peer application, for example under `apps/web/`. On Vercel, use [`eve/vercel` in root `vercel.ts`](/docs/guides/deployment/vercel#compose-agents-with-other-vercel-services) to contribute the agents alongside the frontend service. For [self-hosting](/docs/guides/deployment/self-hosting#run-workspace-members), run the services with your process manager and configure a reverse proxy. The frontend does not need `eve/next`.
79
+
80
+ `apps/web/` is an organizational convention, not an eve filesystem slot. Deployment configuration owns peer services; eve discovers only the agents. Both Vercel integrations deploy the services together, not as independent releases.
81
+
82
+ The generated Web Chat installer does not support agent workspaces. Create the frontend and its agent-selection UI yourself, using the [React chat example](/docs/guides/frontend/overview#basic-chat-react). Develop a peer Next.js frontend with `next dev` separately from the agents. For an authored Vercel service graph, use `vercel dev --local` to run the composition without linking a Vercel project.
83
+
84
+ For a single `agent/` project, `eve add channel/web` currently generates a root Next.js app using `eve/next`. `eve/vercel` currently requires an `agents/` workspace; it cannot compose a standalone root `agent/`.
85
+
86
+ ## Add a second root agent
87
+
88
+ To convert a single-agent project into a workspace, move the original agent from the project root:
89
+
90
+ ```bash
91
+ mkdir -p agents/support
92
+ mv agent agents/support/agent
93
+ ```
94
+
95
+ Move its `evals/` directory, if present, to `agents/support/evals/`. Keep `package.json`, dependencies, environment files, and any browser application at the project root. Do not leave a root `agent/` directory: eve treats a project with `agent/` as single-agent even when `agents/` also exists.
96
+
97
+ Before adding the next agent:
98
+
99
+ - Update `tsconfig.json` to include `agents/**/*.ts`, preserving any application includes. Update moved-file imports and path aliases, including scaffolded `package.json#imports` entries that point at `./agent/*` or `./evals/*`.
100
+ - Update scripts that assume one agent. Use `--agent support` for agent-scoped commands; build an agent-only Vercel workspace with root `eve build`. For a Next.js app, keep the framework scripts and follow its [build instructions](/docs/guides/frontend/nextjs#dev-vs-deploy-topology).
101
+ - Update HTTP clients and webhook registrations for the named agent's public routes. In a root Next.js app, remove a single-agent `eveRoot` override to enable workspace discovery, and select `support` in the client hook. Store the agent name alongside durable-session links.
102
+
103
+ Then add the second agent and check discovery:
104
+
105
+ ```bash
106
+ npx eve init research
107
+ npx eve info --agent support
108
+ npx eve info --agent research
109
+ ```
110
+
111
+ Run the moved agent's evals with `npx eve eval --agent support`. Add later agents with `npx eve init <name>` from the workspace root.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: "Getting Started"
3
- description: "Create an eve project, configure a model, understand its filesystem layout, and run your first agent."
3
+ description: "Create an eve project, configure model credentials, and run your first agent."
4
4
  contentType: "How-to"
5
5
  ---
6
6
 
@@ -18,6 +18,8 @@ Choose a model, provider, and channel that meet your data-processing and complia
18
18
 
19
19
  ## Create a project
20
20
 
21
+ Start with one agent in `agent/`.
22
+
21
23
  Run `eve init` with a project name:
22
24
 
23
25
  ```bash
@@ -48,119 +50,29 @@ npx eve@latest init my-agent --model openai/gpt-5.6-terra --reasoning high
48
50
 
49
51
  ## Run the agent
50
52
 
51
- The terminal UI opens after interactive initialization. To return later, run this from the project root:
53
+ The terminal UI opens after interactive initialization. To return later, enter the project and run:
52
54
 
53
55
  ```bash
56
+ cd my-agent
54
57
  npm run dev
55
58
  ```
56
59
 
57
- This starts an interactive session where you can send messages to your agent.
58
-
59
- ## Project layout
60
-
61
- eve builds an agent by walking the filesystem under `agent/`. Each directory is an authored slot, and the slot a file lands in determines how eve loads it.
62
-
63
- ### Naming from paths
64
-
65
- eve derives names from file paths, so you do not configure them separately.
66
-
67
- | Path | Resolves to |
68
- | ------------------------------------- | --------------------- |
69
- | `agent/tools/get_weather.ts` | tool `get_weather` |
70
- | `agent/connections/linear.ts` | connection `linear` |
71
- | `agent/skills/summarize.md` | skill `summarize` |
72
- | `agent/subagents/researcher/agent.ts` | subagent `researcher` |
73
-
74
- The root agent uses its `package.json` `name`, or its app directory name if none is set. A subagent uses its directory name.
75
-
76
- ### Recommended layout
77
-
78
- A minimal agent needs `instructions.md`; `agent.ts` is optional when the default config is sufficient. Framework defaults occupy ordinary agent slots, so authoring the same path replaces the default before eve compiles the agent. Add other slots as the agent needs them:
79
-
80
- ```text
81
- my-agent/
82
- ├── README.md
83
- ├── package.json
84
- ├── tsconfig.json
85
- ├── agent/
86
- │ ├── agent.ts
87
- │ ├── instructions.md
88
- │ ├── instrumentation.ts
89
- │ ├── channels/
90
- │ ├── connections/
91
- │ ├── hooks/
92
- │ ├── skills/
93
- │ ├── lib/
94
- │ ├── sandbox/
95
- │ ├── tools/
96
- │ ├── schedules/
97
- │ └── subagents/
98
- └── evals/
99
- ```
100
-
101
- Evals live beside `agent/`, not inside it.
102
-
103
- ### Agent files and directories
104
-
105
- Each path under `agent/` has a specific purpose. Root agents can use every path below. A subagent has its own files and can use only the paths marked **Yes**.
106
-
107
- | Path | Use | Available to subagents | Notes |
108
- | ------------------------------------------------------- | ----------------------------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
109
- | `agent.ts` | Runtime config | Yes | Model, model options, compaction, build, and experimental settings. See [Agents](./agent-config). |
110
- | `instructions.md` / `instructions.ts` / `instructions/` | Base system prompt | Optional | A flat file or directory of `.md` and `.ts` files. Static sources compose at build time. Dynamic sources resolve at runtime. Required on the root, optional on subagents. |
111
- | `instrumentation.ts` | Telemetry config | No | OTel exporter and AI SDK span settings, auto-discovered and run before agent code. Root-only. |
112
- | `channels/` | HTTP and messaging entry points | No | Root-only. |
113
- | `connections/` | External MCP and OpenAPI services | Yes | Static files define one path-named connection. Dynamic files can resolve a caller-specific connection set at runtime. |
114
- | `hooks/` | Lifecycle and stream-event subscribers | Yes | Module-backed only. Recursive directories are supported. |
115
- | `skills/` | On-demand procedures and capability packs | Yes | Flat markdown, module-backed skills, or packaged skills. Runtime files are seeded under `$HOME/.agents/skills/`, with `/workspace/skills/` as a fallback. |
116
- | `lib/` | Shared authored helper code | Yes | Import-only; not mounted into the workspace. |
117
- | `sandbox.ts` or `sandbox/sandbox.ts` | The agent's single sandbox | Yes | Use `sandbox.ts` for a definition-only override; use `sandbox/sandbox.ts` with `sandbox/workspace/**` to also seed files. The framework default applies when neither is authored. |
118
- | `sandbox/workspace/**` | Files seeded into the sandbox | Yes | Mirrored into `/workspace/` when a session starts. |
119
- | `tools/` | Typed executable integrations | Yes | Module-backed only. |
120
- | `schedules/` | Recurring jobs | No | Each schedule is a default-exported `defineSchedule` module or a markdown prompt with `cron` frontmatter. Recursive nesting is supported. Root-only. |
121
- | `subagents/` | Specialist child agents | Yes | Each child is a local package under `subagents/<id>/`. Nested subagents are supported. |
122
-
123
- ### Files available in the sandbox
124
-
125
- Files under `agent/` define your agent; only files in `agent/sandbox/workspace/` are copied to `/workspace/` when a session starts.
126
-
127
- ### Local subagents
128
-
129
- A local subagent uses the same `agent.ts` shape as the root:
130
-
131
- ```text
132
- agent/subagents/researcher/
133
- ├── agent.ts
134
- ├── instructions.md
135
- ├── connections/
136
- ├── hooks/
137
- ├── skills/
138
- ├── lib/
139
- ├── sandbox/
140
- ├── tools/
141
- └── subagents/
142
- ```
143
-
144
- A subagent's `agent.ts` is required and must provide a description, while its instructions are optional. Connections, hooks, skills, shared code, sandboxes, tools, and nested subagents are supported. Channels and schedules remain root-only. See [Subagents](./subagents) for inheritance and isolation behavior.
145
-
146
- ### Flat layout
147
-
148
- When the app root is also the agent root, eve supports this layout:
149
-
150
- ```text
151
- my-agent/
152
- ├── package.json
153
- ├── agent.ts
154
- ├── instructions.md
155
- ├── tools/
156
- └── skills/
157
- ```
60
+ This starts an interactive session where you can send messages to your agent. Edit `agent/instructions.md` to change its behavior and `agent/agent.ts` to configure its model. eve reloads your changes as you work.
158
61
 
159
- Prefer the nested layout because it keeps application files separate from the authored agent surface.
62
+ <span id="project-layout" />
63
+ <span id="agent-directory-layout" />
64
+ <span id="naming-from-paths" />
65
+ <span id="recommended-layout" />
66
+ <span id="nested-layout" />
67
+ <span id="agent-files-and-directories" />
68
+ <span id="files-available-in-the-sandbox" />
69
+ <span id="local-subagents" />
70
+ <span id="flat-layout" />
71
+ <span id="debug-file-discovery" />
160
72
 
161
- ### Debug file discovery
73
+ ## Organize your project
162
74
 
163
- Run `eve info` when eve does not discover a file. It lists the discovered surface and diagnostics so you can check the authored slot and root-versus-subagent boundary. eve also writes inspectable artifacts under `.eve/`; see [Instrumentation](./observability/instrumentation) and the [CLI](./reference/cli) reference.
75
+ See [Project Structure](/docs/concepts/project-structure) when adding another root agent or deciding where a frontend belongs. The [Agent Files reference](/docs/reference/agent-files) lists supported files and discovery rules.
164
76
 
165
77
  ## Install manually
166
78
 
@@ -231,19 +231,23 @@ import { vercelOidc, vercelSubject } from "eve/channels/auth";
231
231
 
232
232
  export default eveChannel({
233
233
  auth: [vercelOidc()],
234
- // Only the router deployment may assert a forwarded principal.
234
+ // Only the router deployment may forward eve delegation context.
235
235
  trustedForwarders: (forwarder) =>
236
236
  forwarder.subject === vercelSubject({ teamSlug: "acme", projectName: "router" }),
237
237
  });
238
238
  ```
239
239
 
240
- The predicate authorizes the _forwarder_ (the verified route-auth principal — who is asserting), not the forwarded principal (what is asserted). Match it precisely: a permissive predicate like `() => true` lets any caller that passes route auth assert any principal, including preview deployments of your own project when `vercelOidc()` is in the walk. `trustedForwarders` exists only on your authored channel — the framework default channel never accepts a forwarded principal, so a receiving deployment must author `agent/channels/eve.ts`.
240
+ `trustedForwarders` authorizes the verified forwarder to supply eve delegation context: principal identity, parent session lineage, and, with principal forwarding, trace-content constraints. Match it precisely: `() => true` grants this authority to every caller that passes route auth, including preview deployments accepted by `vercelOidc()`. The framework default channel rejects forwarded principals and ignores the other context.
241
241
 
242
242
  When the predicate accepts a create request, `ctx.session.auth.current` and `.initiator` carry the forwarded user exactly as if they had called your deployment directly. On continuation, only `auth.current` is replaced; `auth.initiator` remains the session creator. User-scoped connections, local subagents, and further `forwardPrincipal` hops therefore see the active turn's caller.
243
243
 
244
- The forwarder is recorded on accepted contexts as the `eve:forwarded-by` attribute (always overwritten by the receiver, so a forwarder cannot falsify it). Rejections fail loud: a forwarded body without `trustedForwarders` configured or with a forwarder the predicate refuses is a `403`, and a malformed payload is a `400`. Only principal metadata is ever accepted — tokens and credentials never cross the hop.
244
+ The forwarder is recorded on accepted contexts as the `eve:forwarded-by` attribute (always overwritten by the receiver, so a forwarder cannot falsify it). Forwarded identity rejections fail loud: a forwarded body without `trustedForwarders` configured or with a forwarder the predicate refuses is a `403`, and a malformed payload is a `400`. Only principal metadata is ever accepted — tokens and credentials never cross the hop.
245
245
 
246
- For requests marked as remote delegations by a callback body and valid sampled `traceparent`, the same accepted `trustedForwarders` result may admit an origin audience and directional content ceiling from one W3C Baggage member. The assertion is not an authorization grant: the receiver's trace policy independently decides against the immutable origin audience, and the two decisions are intersected. Every later hop forwards only that narrowed result. Malformed, partial, unsampled, or mixed-version assertions become metadata-only. The callback and headers are caller-supplied—the verified transport principal and `trustedForwarders` are the trust boundary. See [Preserving trace content](./remote-agents#preserving-trace-content).
246
+ Trusted parent session lineage populates `ctx.session.parent` and preserves the root session across the delegation chain. Untrusted lineage is ignored, and accepted lineage does not remove the normal root-session token cap.
247
+
248
+ For requests marked as remote delegations by a callback body and valid sampled `traceparent`, the same accepted `trustedForwarders` result may admit an origin audience and directional content ceiling from one W3C Baggage member. The assertion is not an authorization grant: the receiver's trace policy independently decides against the immutable origin audience, and the two decisions are intersected. Every later hop forwards only that narrowed result. Malformed, partial, unsampled, or mixed-version assertions become metadata-only. The callback and headers are caller-supplied; the verified transport principal and `trustedForwarders` are the trust boundary. See [Preserving trace content](./remote-agents#preserving-trace-content).
249
+
250
+ W3C `traceparent`, `tracestate`, and the forwarded conversation ID are correlation metadata. They do not require `trustedForwarders`, establish session lineage, or grant session access.
247
251
 
248
252
  > ⚠️ Both deployments must support continuation forwarding before you resume persistent remote sessions. A create-only receiver rejects a forwarded continuation with HTTP 400; the sender does not fall back to service authority. See [Forwarding the caller identity](./remote-agents#forwarding-the-caller-identity) for the upgrade behavior.
249
253
 
@@ -61,6 +61,46 @@ Forward both runtime route prefixes through your reverse proxy or ingress:
61
61
 
62
62
  A proxy restricted to `/eve/` lets a session start, but the run stalls when its callback can’t reach eve. Preserve both prefixes without rewriting their paths.
63
63
 
64
+ ## Run workspace members
65
+
66
+ An [agent workspace](../../concepts/project-structure#several-root-agents) does not require Vercel or a frontend at runtime. Build each member from its own directory: root `eve build` produces a Vercel workspace deployment, not a group of self-hosted Node servers.
67
+
68
+ For a workspace containing `support` and `research`, run these from the workspace root, outside a Vercel build environment:
69
+
70
+ ```bash
71
+ (cd agents/support && npx eve build)
72
+ (cd agents/research && npx eve build)
73
+ ```
74
+
75
+ Start each built agent in a separate terminal, or configure these commands in your process manager:
76
+
77
+ ```bash
78
+ (cd agents/support && npx eve start --host 127.0.0.1 --port 3001)
79
+ (cd agents/research && npx eve start --host 127.0.0.1 --port 3002)
80
+ ```
81
+
82
+ For example, this Caddy configuration gives each agent its own origin and forwards both `/eve/` and `/.well-known/workflow/` without changing their paths. Point the example hostnames at your server and run Caddy on the same machine:
83
+
84
+ ```text
85
+ support.example.com {
86
+ reverse_proxy 127.0.0.1:3001
87
+ }
88
+
89
+ research.example.com {
90
+ reverse_proxy 127.0.0.1:3002
91
+ }
92
+ ```
93
+
94
+ Apply the authentication, persistent storage, and sandbox configuration above to each member. With the default local Workflow world, persist each member's own `.eve/.workflow-data` directory. If agents delegate to one another, configure an explicit [workspace-peer transport](../../subagents#vercel-workspace-peers) with the peer's URL and credentials; the default transport requires Vercel. Ensure callback URLs are reachable from the services that call them.
95
+
96
+ ### Add a peer frontend
97
+
98
+ A frontend under `apps/web/` is another service managed by your host, not by `eve start`. Build and start it using its framework commands. A browser client can use `useEveAgent({ host: "https://support.example.com" })`; configure [CORS](../../channels/eve#cors) and browser credentials for that deployment. Alternatively, mount each agent on the frontend's origin through your reverse proxy.
99
+
100
+ 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.
101
+
102
+ You can instead use [`eve/next`](../frontend/nextjs#dev-vs-deploy-topology) 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.
103
+
64
104
  ## Run schedules
65
105
 
66
106
  The standard `eve build && eve start` path starts Nitro’s schedule runner. If you adapt the output to a custom HTTP-only host or preset, run Nitro scheduled tasks or invoke the same work from your scheduler.
@@ -7,7 +7,7 @@ Deploy eve to Vercel when you want the framework’s managed build and runtime i
7
7
 
8
8
  ## Prepare the Vercel project
9
9
 
10
- Link the agent directory to a Vercel project:
10
+ Run this from the project root to link it to a Vercel project. For an eve agent workspace, use the workspace root, not a member directory:
11
11
 
12
12
  ```bash
13
13
  eve link
@@ -51,27 +51,17 @@ See [Sandbox](../../sandbox) for resource limits, network policy, and lifecycle
51
51
 
52
52
  ## Deploy the agent
53
53
 
54
- A project containing only several independently addressed root agents can use eve's hostless workspace layout:
54
+ For a single-agent project without a frontend, use `eve build`. For an agent-only workspace, run it from the workspace root: eve generates a separately built service and a `/<name>/eve/v1/*` transport route for each member. All members deploy together in one Vercel project. See [Project Structure](../../concepts/project-structure) for workspace membership and layout rules.
55
55
 
56
- ```text
57
- my-project/
58
- ├── package.json
59
- └── agents/
60
- ├── support/
61
- │ └── agent/
62
- └── research/
63
- └── agent/
64
- ```
65
-
66
- In an eve workspace, eve discovers direct `agents/<name>/` children that contain nested or flat agent files and do not have their own `package.json`. Their directory names become their public identities, exposed at `/<name>/eve/v1/*`. A child with its own `package.json` is a separate package rather than a member of the parent eve workspace. Run an agent-specific command from a member directory or pass `--agent <name>` at the workspace root; interactive commands open a picker when the name is omitted. Run project-level build, link, and deploy commands from the workspace root. Workspace members share the root package, dependencies, and build scripts.
56
+ A Next.js-centered project uses [`withEve` in `next.config.ts`](../frontend/nextjs) and its Next.js build command. If you author the project's broader service graph in `vercel.ts`, use the configuration below instead.
67
57
 
68
- Create this layout with `eve init my-project --agents support,research`, or add one agent to an existing workspace with `eve init billing`.
58
+ ### Compose agents with other Vercel services
69
59
 
70
- For an agent-only workspace, run `eve build`. eve owns the Vercel Build Output and generates one independently built service and a `/<name>/eve/v1/*` transport route for each workspace member.
60
+ Use `withEve` from `eve/vercel` when the agents and other applications are peer services. The helper contributes workspace agents to a Vercel service graph; it does not manage or require a particular frontend framework. Unlike `eve/next`, this keeps the project lifecycle separate from Next.js. Both integrations deploy the agent services together in one Vercel project.
71
61
 
72
- ### Compose agents with other Vercel services
62
+ `eve/vercel` currently requires an `agents/` workspace, even if it has only one member. It does not support a standalone root `agent/`.
73
63
 
74
- Use Vercel's programmatic configuration when a workspace also deploys a frontend, private API, or another non-eve service. Replace `vercel.json` with a root `vercel.ts` and compose the authored graph with `withEve`:
64
+ For a workspace with a peer Next.js frontend under `apps/web/`, replace `vercel.json` with a root `vercel.ts`. The frontend uses an ordinary Next.js config without `eve/next`:
75
65
 
76
66
  ```typescript title="vercel.ts"
77
67
  import { withEve } from "eve/vercel";
@@ -92,7 +82,11 @@ export default await withEve({
92
82
  });
93
83
  ```
94
84
 
95
- Vercel evaluates `vercel.ts` before resolving the service graph. `withEve` discovers direct workspace members, adds their services and transport routes, and returns a plain Vercel configuration. Vercel can then build `web` and every eve agent independently. The frontend does not need `withEve` in its framework configuration or a build script that builds the agents.
85
+ Vercel evaluates `vercel.ts` before resolving the service graph. `withEve` adds the root agent, or every direct workspace member, as an independently built service and returns a plain Vercel configuration. Named workspace agents mount at `/eve/<name>/v1/*`; a root agent mounts at `/eve/v1/*`. Vercel then builds the frontend and each eve agent separately. The frontend does not need `withEve` in its framework configuration or a build script that builds the agents.
86
+
87
+ The Web Chat installer does not support agent workspaces. Create the frontend using the [React chat example](../frontend/overview#basic-chat-react), and configure authentication for every exposed agent. To self-host the same source layout, replace Vercel composition with your own [process and proxy configuration](./self-hosting#run-workspace-members).
88
+
89
+ Run Vercel CLI 59.16.0 or newer with `vercel dev --local` to start the complete service graph locally. Named agents use the same `/eve/<name>/v1/*` routes in development, and default `defineWorkspaceAgent` transports can call peers without deployment credentials. Run `eve dev` instead when you only need one agent and the eve terminal UI.
96
90
 
97
91
  Generated transport routes are inserted before a filesystem handler or, when no filesystem handler exists, before authored routes. `withEve` throws instead of overwriting an authored service key or exact transport route that belongs to a generated agent. Remove the authored route, and remove or rename the authored service; `withEve` adds both automatically. Names in the array form of `services` must also be unique. Other service names, routes, bindings, and Cron Jobs remain authored in `vercel.ts`.
98
92
 
@@ -120,9 +114,11 @@ export default await withEve({
120
114
 
121
115
  A Vercel project can use only one configuration source, so remove `vercel.json` when adopting `vercel.ts`. Keep `eve` in the root package dependencies so Vercel can import `eve/vercel` while evaluating the configuration. `withEve` discovers the workspace containing its evaluation directory, including Vercel's temporary `.vercel` configuration directory. Pass `{ root: "/absolute/workspace/path" }` as the second argument only when you need to select a specific workspace root.
122
116
 
123
- An authored eve service routed at `/eve/v1` already uses the protocol path; callbacks remain at `/eve/v1/callback/*`. A named mount such as `/support` adds that mount before the protocol path, giving `/support/eve/v1/callback/*`.
117
+ An authored eve service routed at `/eve/v1` already uses the protocol path; callbacks remain at `/eve/v1/callback/*`. A named mount such as `/eve/support` adds that mount before the protocol path, giving `/eve/support/v1/callback/*`.
124
118
 
125
- Deploy the linked project to production:
119
+ ### Deploy the project
120
+
121
+ Deploy the linked project to production from its root:
126
122
 
127
123
  ```bash
128
124
  eve deploy
@@ -145,11 +141,18 @@ Vercel uses the generated output to configure these services:
145
141
 
146
142
  ## Verify the deployment
147
143
 
148
- Check the health route and connect the development TUI:
144
+ For a single unnamed agent, check the health route and connect the development TUI:
145
+
146
+ ```bash
147
+ curl https://your_agent.vercel.app/eve/v1/health
148
+ eve dev https://your_agent.vercel.app
149
+ ```
150
+
151
+ For a workspace agent, include its public `/eve/<name>` mount. For example:
149
152
 
150
153
  ```bash
151
- curl https://your_agent.vercel.app/support/eve/v1/health
152
- eve dev https://your_agent.vercel.app/support
154
+ curl https://your_agent.vercel.app/eve/support/v1/health
155
+ eve dev https://your_agent.vercel.app/eve/support
153
156
  ```
154
157
 
155
158
  Set `VERCEL_AUTOMATION_BYPASS_SECRET` locally before connecting if the deployment uses Deployment Protection.
@@ -333,6 +333,10 @@ A dynamic connection, tool, or skill whose name matches an **authored** one **ov
333
333
 
334
334
  ¹ Workflow recovery can redeliver a resolver event, so keep resolvers idempotent. Replaying a parked callback does not depend on running the resolver again — except for the one-shot rebind described under [Identity and redeploys](#identity-and-redeploys).
335
335
 
336
+ At `turn.started`, model, tool, skill, and subagent resolvers receive the visible conversation history and incoming message in `ctx.messages`, oldest first. Request context is included, and history projection still applies. Read these messages from the handler's second argument; the event itself contains turn metadata. Instruction resolvers use the separate snapshot described under [Dynamic instructions](#dynamic-instructions).
337
+
338
+ This also applies while a session-limit prompt keeps the incoming message queued and when authorization completes. Authorization callbacks without new or queued input receive the visible history. When memory recall runs, its results appear in the projected snapshot before incoming input.
339
+
336
340
  ### Execution order
337
341
 
338
342
  When a stream event fires, three things happen in order.
@@ -0,0 +1,118 @@
1
+ ---
2
+ title: Automatic Model Selection
3
+ description: "Choose an agent model from the current request with an AI SDK evaluation model."
4
+ ---
5
+
6
+ Use `autoModel` to choose an agent model from an allowlist before inference begins.
7
+ It uses the [AI SDK evaluation API](https://ai-sdk.dev/docs/ai-sdk-core/evaluation),
8
+ so the evaluator can be a Vercel AI Gateway model ID or an evaluation model from
9
+ an installed provider.
10
+
11
+ `eve/experimental/evaluate` is experimental. Its API can change between eve
12
+ releases, and the AI SDK evaluation model specification can change in patch
13
+ releases.
14
+
15
+ ## Choose from Gateway models
16
+
17
+ By default, `autoModel` evaluates with `typesafe-ai/jev`. Like other AI SDK
18
+ model strings, it uses Vercel AI Gateway unless the application has configured a
19
+ different global default provider.
20
+
21
+ ```ts title="agent/agent.ts"
22
+ import { defineAgent } from "eve";
23
+ import { autoModel } from "eve/experimental/evaluate";
24
+
25
+ export default defineAgent({
26
+ model: autoModel({
27
+ options: {
28
+ "openai/gpt-5.6-sol": "Difficult reasoning and engineering tasks",
29
+ "openai/gpt-5.6-luna": "Routine tasks where fast completion matters",
30
+ },
31
+ }),
32
+ });
33
+ ```
34
+
35
+ Configure Gateway authentication as you would for any other AI SDK model. eve
36
+ does not add a TypeSafe credential or transport layer. During `eve dev`, a
37
+ Gateway evaluator uses the same connection selected through `/login` as Gateway
38
+ language models. A configured AI SDK default provider still owns string model
39
+ resolution during development. The TUI footer displays `dynamic model` when the
40
+ agent uses `autoModel`.
41
+
42
+ ## Use a provider directly
43
+
44
+ Install the provider package yourself and pass its evaluation model. The provider
45
+ owns its credentials and settings.
46
+
47
+ ```sh
48
+ pnpm add @ai-sdk/typesafe-ai
49
+ ```
50
+
51
+ ```ts title="agent/agent.ts"
52
+ import { typeSafeAi } from "@ai-sdk/typesafe-ai";
53
+ import { defineAgent } from "eve";
54
+ import { autoModel } from "eve/experimental/evaluate";
55
+
56
+ export default defineAgent({
57
+ model: autoModel({
58
+ model: typeSafeAi.evaluationModel("jev-latest"),
59
+ options: {
60
+ "openai/gpt-5.6-sol": "Difficult reasoning and engineering tasks",
61
+ "openai/gpt-5.6-luna": "Routine tasks where fast completion matters",
62
+ },
63
+ }),
64
+ });
65
+ ```
66
+
67
+ Any provider that implements the AI SDK `Experimental_EvaluationModel` contract
68
+ works here.
69
+
70
+ ## Route to provider models and set reasoning
71
+
72
+ An option's key is the value shown to the evaluator. A string value describes a
73
+ Gateway model whose ID is the key. Use the object form when the selected model is
74
+ a provider instance, an alias, or needs a reasoning override.
75
+
76
+ ```ts title="agent/agent.ts"
77
+ import { anthropic } from "@ai-sdk/anthropic";
78
+ import { defineAgent } from "eve";
79
+ import { autoModel } from "eve/experimental/evaluate";
80
+
81
+ export default defineAgent({
82
+ reasoning: "medium",
83
+ model: autoModel({
84
+ options: {
85
+ "openai/gpt-5.6-sol": "Hard problems",
86
+ my_secret_model: {
87
+ model: anthropic("sonnet-5"),
88
+ description: "Routine work that can use the direct Anthropic provider",
89
+ reasoning: "low",
90
+ },
91
+ },
92
+ }),
93
+ });
94
+ ```
95
+
96
+ The evaluator sees option keys, descriptions, and recent text messages. It never
97
+ receives provider credentials or serialized language model instances. When it
98
+ selects `my_secret_model`, eve resolves the key back to the authored Anthropic
99
+ model.
100
+
101
+ Supported reasoning values are `"provider-default"`, `"none"`, `"minimal"`,
102
+ `"low"`, `"medium"`, `"high"`, and `"xhigh"`. An omitted value inherits the
103
+ agent's reasoning setting.
104
+
105
+ ## Runtime behavior
106
+
107
+ `autoModel` evaluates at the first `step.started` event, after the incoming prompt
108
+ is available and before the selected language model runs. It reuses that choice
109
+ for later tool-loop steps in the same turn. A new turn makes a new choice, and
110
+ child sessions route from their own prompts.
111
+
112
+ The evaluator receives up to eight recent user and assistant text messages,
113
+ capped at 16,000 characters. Requests without user text and latest messages over
114
+ the limit fail before provider I/O.
115
+
116
+ Evaluation validation, retries, provider errors, and model resolution follow AI
117
+ SDK semantics. Cancelling the active turn aborts evaluation and prevents the
118
+ choice from being retained.