eve 0.55.0 → 0.56.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.
Files changed (188) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/src/channel/audience.d.ts +3 -3
  3. package/dist/src/channel/conversation-context.d.ts +4 -2
  4. package/dist/src/channel/conversation-context.js +1 -1
  5. package/dist/src/chunks/{use-eve-agent-CxPlg0KL.js → use-eve-agent-CMdMlS7Y.js} +0 -10
  6. package/dist/src/chunks/{use-eve-agent-D-KQzzyW.js → use-eve-agent-RUGSwq8b.js} +0 -10
  7. package/dist/src/cli/commands/registry-metadata.d.ts +0 -18
  8. package/dist/src/cli/commands/registry-metadata.js +1 -1
  9. package/dist/src/cli/commands/registry-pnpm-build-policy-flow.js +1 -1
  10. package/dist/src/cli/commands/registry.js +1 -1
  11. package/dist/src/cli/dev/tui/blocks.d.ts +2 -0
  12. package/dist/src/cli/dev/tui/blocks.js +3 -3
  13. package/dist/src/cli/dev/tui/markdown.d.ts +8 -1
  14. package/dist/src/cli/dev/tui/markdown.js +7 -7
  15. package/dist/src/cli/dev/tui/runner.d.ts +4 -1
  16. package/dist/src/cli/dev/tui/runner.js +1 -1
  17. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +5 -1
  18. package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
  19. package/dist/src/cli/dev/tui/tui.d.ts +4 -1
  20. package/dist/src/cli/ui/terminal-text.js +1 -1
  21. package/dist/src/client/agent-info-schema.d.ts +0 -57
  22. package/dist/src/client/agent-info-schema.js +1 -1
  23. package/dist/src/compiled/.vendor-stamp.json +1 -1
  24. package/dist/src/compiler/extension-compatibility.d.ts +18 -8
  25. package/dist/src/compiler/extension-compatibility.js +1 -1
  26. package/dist/src/compiler/manifest.d.ts +12 -11
  27. package/dist/src/compiler/manifest.js +1 -1
  28. package/dist/src/compiler/normalize-manifest.js +1 -1
  29. package/dist/src/compiler/normalize-tool.d.ts +0 -3
  30. package/dist/src/compiler/normalize-tool.js +1 -1
  31. package/dist/src/compiler/validate-artifact.js +1 -1
  32. package/dist/src/context/keys.d.ts +2 -0
  33. package/dist/src/context/keys.js +1 -1
  34. package/dist/src/eve-channel/audience.d.ts +2 -2
  35. package/dist/src/eve-channel/audience.js +1 -1
  36. package/dist/src/eve-channel/types.d.ts +5 -5
  37. package/dist/src/execution/coordination-dispatch-step.d.ts +2 -2
  38. package/dist/src/execution/coordination-dispatch-step.js +1 -1
  39. package/dist/src/execution/create-session-step.js +1 -1
  40. package/dist/src/execution/durable-session-store.d.ts +0 -1
  41. package/dist/src/execution/dynamic-workflow/program-step.d.ts +21 -0
  42. package/dist/src/execution/dynamic-workflow/program-step.js +1 -0
  43. package/dist/src/execution/dynamic-workflow/schema.d.ts +36 -0
  44. package/dist/src/execution/dynamic-workflow/schema.js +1 -0
  45. package/dist/src/execution/dynamic-workflow/security-step.d.ts +3 -0
  46. package/dist/src/execution/dynamic-workflow/security-step.js +1 -0
  47. package/dist/src/execution/dynamic-workflow/tool.d.ts +8 -0
  48. package/dist/src/execution/dynamic-workflow/tool.js +1 -0
  49. package/dist/src/execution/dynamic-workflow/workflow.d.ts +10 -0
  50. package/dist/src/execution/dynamic-workflow/workflow.js +1 -0
  51. package/dist/src/execution/eve-workflow-attributes.d.ts +2 -1
  52. package/dist/src/execution/eve-workflow-attributes.js +1 -1
  53. package/dist/src/execution/inline-turn.js +1 -1
  54. package/dist/src/execution/model-call-batching.js +1 -1
  55. package/dist/src/execution/next-driver-action.d.ts +0 -8
  56. package/dist/src/execution/node-step.d.ts +0 -5
  57. package/dist/src/execution/node-step.js +1 -1
  58. package/dist/src/execution/runtime-context.js +1 -1
  59. package/dist/src/execution/session.d.ts +0 -1
  60. package/dist/src/execution/session.js +2 -2
  61. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  62. package/dist/src/execution/tasks/parent/delegate.d.ts +7 -0
  63. package/dist/src/execution/tasks/parent/delegate.js +1 -1
  64. package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
  65. package/dist/src/execution/tools/sleep-workflow.js +1 -1
  66. package/dist/src/execution/tools/subagent/invoke-step.d.ts +2 -0
  67. package/dist/src/execution/tools/subagent/invoke-step.js +1 -1
  68. package/dist/src/execution/turn-workflow.js +1 -1
  69. package/dist/src/execution/workflow-runtime.js +1 -1
  70. package/dist/src/execution/workflow-steps.js +1 -1
  71. package/dist/src/harness/advertised-tools.d.ts +0 -3
  72. package/dist/src/harness/advertised-tools.js +1 -1
  73. package/dist/src/harness/tool-loop.js +2 -2
  74. package/dist/src/harness/types.d.ts +0 -21
  75. package/dist/src/instrumentation/content.js +1 -1
  76. package/dist/src/instrumentation/lifecycle.d.ts +5 -7
  77. package/dist/src/instrumentation/native-events.d.ts +2 -0
  78. package/dist/src/instrumentation/native-events.js +1 -1
  79. package/dist/src/instrumentation/runtime.js +1 -1
  80. package/dist/src/instrumentation/session-context.d.ts +2 -0
  81. package/dist/src/instrumentation/session-context.js +1 -1
  82. package/dist/src/internal/application/package.js +1 -1
  83. package/dist/src/internal/authored-definition/connection.js +1 -1
  84. package/dist/src/internal/authored-definition/schema-backed.d.ts +3 -4
  85. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  86. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  87. package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
  88. package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
  89. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
  90. package/dist/src/public/channels/chat-sdk/audience.d.ts +2 -2
  91. package/dist/src/public/channels/index.d.ts +1 -1
  92. package/dist/src/public/channels/telegram/audience.d.ts +2 -2
  93. package/dist/src/public/connections/index.d.ts +1 -1
  94. package/dist/src/public/definitions/channel.d.ts +1 -1
  95. package/dist/src/public/definitions/connections/mcp.d.ts +1 -1
  96. package/dist/src/public/definitions/connections/openapi.d.ts +1 -1
  97. package/dist/src/public/tools/workflow.d.ts +1 -4
  98. package/dist/src/public/tools/workflow.js +1 -1
  99. package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
  100. package/dist/src/runtime/connections/authorization-tokens.d.ts +2 -4
  101. package/dist/src/runtime/connections/principal.d.ts +6 -6
  102. package/dist/src/runtime/connections/principal.js +1 -1
  103. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  104. package/dist/src/runtime/resolve-agent.js +1 -1
  105. package/dist/src/runtime/resolve-tool.js +1 -1
  106. package/dist/src/runtime/types.d.ts +3 -9
  107. package/dist/src/self-modification/extension/classify-registry-item.d.ts +3 -3
  108. package/dist/src/self-modification/extension/classify-registry-item.js +1 -1
  109. package/dist/src/self-modification/extension/tools/search_registry.d.ts +1 -7
  110. package/dist/src/self-modification/extension/tools/search_registry.js +1 -1
  111. package/dist/src/setup/flows/registry.js +1 -1
  112. package/dist/src/setup/integrations/self-modification/setup.js +1 -1
  113. package/dist/src/setup/scaffold/create/project.js +6 -2
  114. package/dist/src/shared/channel-definition.d.ts +2 -2
  115. package/dist/src/shared/connection-types.d.ts +20 -7
  116. package/dist/src/shared/conversation-context.d.ts +15 -0
  117. package/dist/src/shared/validate-authorization.js +1 -1
  118. package/dist/src/shared/workflow-sandbox.d.ts +18 -12
  119. package/dist/src/shared/workflow-sandbox.js +1 -1
  120. package/dist/src/svelte/index.js +1 -1
  121. package/dist/src/svelte/use-eve-agent.js +1 -1
  122. package/dist/src/tasks/session-index.d.ts +11 -0
  123. package/dist/src/tasks/session-index.js +1 -1
  124. package/dist/src/tools/auth.d.ts +5 -6
  125. package/dist/src/tools/provided/workflow.d.ts +12 -0
  126. package/dist/src/tools/provided/workflow.js +1 -0
  127. package/dist/src/tools/workflow-program-input.d.ts +6 -0
  128. package/dist/src/tools/workflow-program-input.js +1 -0
  129. package/dist/src/tracing/agent-otel-provider.js +1 -1
  130. package/dist/src/tracing/agent-otel-runtime-context.d.ts +2 -1
  131. package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
  132. package/dist/src/tracing/agent-otel-session-context.js +1 -1
  133. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  134. package/dist/src/tracing/agent-trace-state.d.ts +2 -0
  135. package/dist/src/tracing/content-attributes.js +1 -1
  136. package/dist/src/tracing/local-instrumentation-runtime.d.ts +1 -1
  137. package/dist/src/tracing/local-instrumentation-runtime.js +1 -1
  138. package/dist/src/vue/index.js +1 -1
  139. package/dist/src/vue/use-eve-agent.js +1 -1
  140. package/docs/agent-config.md +1 -1
  141. package/docs/channels/chat-sdk.mdx +7 -0
  142. package/docs/channels/custom.mdx +16 -6
  143. package/docs/channels/eve.mdx +18 -18
  144. package/docs/channels/linear.mdx +7 -3
  145. package/docs/channels/overview.mdx +13 -0
  146. package/docs/channels/slack.mdx +9 -1
  147. package/docs/connections/mcp.mdx +4 -1
  148. package/docs/connections/openapi.mdx +8 -2
  149. package/docs/connections/overview.mdx +16 -13
  150. package/docs/getting-started.mdx +1 -1
  151. package/docs/guides/deployment/self-hosting.md +1 -1
  152. package/docs/guides/deployment/vercel.mdx +2 -2
  153. package/docs/guides/dev-tui.md +4 -4
  154. package/docs/guides/dynamic-capabilities.md +4 -4
  155. package/docs/guides/hooks.md +1 -1
  156. package/docs/guides/instrumentation/meta.json +4 -0
  157. package/docs/guides/instrumentation/otel.mdx +149 -0
  158. package/docs/guides/instrumentation/overview.md +199 -0
  159. package/docs/guides/instrumentation/providers.mdx +169 -0
  160. package/docs/guides/meta.json +0 -1
  161. package/docs/guides/remote-agents.md +19 -21
  162. package/docs/install-integrations.mdx +2 -4
  163. package/docs/patterns/multi-tenant-auth.md +3 -3
  164. package/docs/reference/cli.md +14 -14
  165. package/docs/reference/typescript-api.md +9 -9
  166. package/docs/subagents/index.mdx +2 -2
  167. package/docs/tools/workflows.mdx +56 -1
  168. package/package.json +1 -1
  169. package/dist/src/cli/commands/registry-package.d.ts +0 -52
  170. package/dist/src/cli/commands/registry-package.js +0 -1
  171. package/dist/src/harness/workflow-continuation-security.d.ts +0 -5
  172. package/dist/src/harness/workflow-continuation-security.js +0 -1
  173. package/dist/src/harness/workflow-interrupt-state.d.ts +0 -20
  174. package/dist/src/harness/workflow-interrupt-state.js +0 -1
  175. package/dist/src/harness/workflow-lifecycle.d.ts +0 -32
  176. package/dist/src/harness/workflow-lifecycle.js +0 -1
  177. package/dist/src/harness/workflow-sandbox.d.ts +0 -28
  178. package/dist/src/harness/workflow-sandbox.js +0 -2
  179. package/dist/src/harness/workflow-subagent-limit.d.ts +0 -28
  180. package/dist/src/harness/workflow-subagent-limit.js +0 -1
  181. package/dist/src/harness/workflow-task-state.d.ts +0 -9
  182. package/dist/src/harness/workflow-task-state.js +0 -1
  183. package/dist/src/harness/workflow-tool-description.d.ts +0 -22
  184. package/dist/src/harness/workflow-tool-description.js +0 -37
  185. package/dist/src/tools/workflow.d.ts +0 -37
  186. package/dist/src/tools/workflow.js +0 -1
  187. package/docs/guides/instrumentation-providers.md +0 -249
  188. package/docs/guides/instrumentation.md +0 -453
@@ -0,0 +1,199 @@
1
+ ---
2
+ title: "Instrumentation"
3
+ description: "Trace an agent with OpenTelemetry in instrumentation.ts, read the workflow run tags eve emits, and debug discovery with eve info and the common-failures table."
4
+ url: "/observability/instrumentation"
5
+ ---
6
+
7
+ Use `agent/instrumentation.ts` to configure OpenTelemetry for an eve agent.
8
+ eve discovers this file and runs it at server startup before agent code.
9
+
10
+ ## Configure OpenTelemetry
11
+
12
+ Export `defineInstrumentation(...)` as the default export from
13
+ `agent/instrumentation.ts`. eve discovers the file and runs its `setup`
14
+ callback at server startup, before agent code runs.
15
+
16
+ ```ts title="agent/instrumentation.ts"
17
+ import { BraintrustExporter } from "@braintrust/otel";
18
+ import { defineInstrumentation } from "eve/instrumentation";
19
+ import { registerOTel } from "@vercel/otel";
20
+
21
+ export default defineInstrumentation({
22
+ setup: ({ agentName }) =>
23
+ registerOTel({
24
+ serviceName: agentName,
25
+ traceExporter: new BraintrustExporter({
26
+ parent: `project_name:${agentName}`,
27
+ filterAISpans: true,
28
+ }),
29
+ }),
30
+ });
31
+ ```
32
+
33
+ Use `setup` to register your OTel provider. eve supplies the resolved agent
34
+ name, so you do not need to hard-code a service name. Any OTel-compatible
35
+ backend works; install and configure the exporter it requires.
36
+
37
+ eve records metadata without model, tool, or memory-record content by default.
38
+ After reviewing the exporter's destination and retention path, opt in to the
39
+ content you need:
40
+
41
+ - `recordInputs` records message history and recalled memory records. It
42
+ defaults to `false`.
43
+ - `recordOutputs` records model outputs. It defaults to `false`.
44
+ - `functionId` overrides the function name on spans. It defaults to the agent
45
+ name.
46
+
47
+ The session's channel audience is a second gate on content capture. In
48
+ Vercel's preview and production deployments, eve records inputs and outputs
49
+ only for `public` sessions. During local development, local tracing retains all
50
+ content. See [Local traces](#local-traces) to learn more.
51
+
52
+ For the default eve HTTP channel, the audience is:
53
+
54
+ | Session creator | Audience |
55
+ | ---------------------------------------------------- | --------- |
56
+ | Anonymous caller | `unknown` |
57
+ | Authenticated `user`, `service`, or `runtime` caller | `private` |
58
+ | Any other principal type | `unknown` |
59
+
60
+ Set `audience: "public"` only for intentionally public traffic. Other
61
+ built-in channels classify their own conversations. See
62
+ [Audience](../channels/eve#audience) for the `eve` channel or
63
+ [Conversation audience](../channels/custom#conversation-audience) for a
64
+ custom channel.
65
+
66
+ ## Add runtime context
67
+
68
+ Use `events["step.started"]` to add values to the AI SDK runtime context for a
69
+ model attempt. The AI SDK carries the returned values onto the model-call span
70
+ and its children.
71
+
72
+ ```ts title="agent/instrumentation.ts"
73
+ import { defineInstrumentation, isChannel } from "eve/instrumentation";
74
+ import supportChannel from "./channels/support";
75
+
76
+ export default defineInstrumentation({
77
+ events: {
78
+ "step.started"(input) {
79
+ if (!isChannel(input.channel, supportChannel)) return undefined;
80
+
81
+ return {
82
+ runtimeContext: {
83
+ "support.channel_id": input.channel.metadata.channelId ?? "",
84
+ "support.user_id": input.channel.metadata.triggeringUserId ?? "",
85
+ },
86
+ };
87
+ },
88
+ },
89
+ });
90
+ ```
91
+
92
+ The callback receives the session, turn, step, channel, and final model input.
93
+ For an authored channel, import its definition and use `isChannel` before
94
+ accessing its typed metadata. Runtime instrumentation receives only the
95
+ metadata a channel explicitly exposes; it never falls back to raw channel
96
+ state.
97
+
98
+ ## Trace topology
99
+
100
+ When `agent/instrumentation.ts` registers an OTel provider, each turn produces
101
+ this hierarchy:
102
+
103
+ ```text
104
+ ai.eve.turn {eve.session.id}
105
+ +-- invoke_agent <model> gen_ai.operation.name=invoke_agent
106
+ +-- step 1 gen_ai.operation.name=agent_step
107
+ | +-- chat <model> gen_ai.operation.name=chat
108
+ | +-- execute_tool search gen_ai.operation.name=execute_tool
109
+ +-- step 2
110
+ | +-- chat <model>
111
+ | +-- execute_tool read
112
+ +-- step 3 (final text)
113
+ +-- chat <model>
114
+ ```
115
+
116
+ eve creates the `ai.eve.turn` parent span and passes telemetry to the
117
+ [AI SDK](https://ai-sdk.dev/docs/ai-sdk-core/telemetry), which traces model
118
+ calls and tool executions. The AI SDK names those spans according to the
119
+ OpenTelemetry GenAI semantic conventions.
120
+
121
+ Set `traceChannelRequests: true` to create one OTel `SERVER` span for each
122
+ inbound channel HTTP request. The span parents the turn tree and any
123
+ `hook.resume` or outgoing HTTP spans. It defaults to `false`.
124
+
125
+ ```text
126
+ POST /eve/v1/session/:sessionId
127
+ └── hook.resume
128
+ ├── GET hooks/by-token
129
+ └── POST hook_received
130
+ ```
131
+
132
+ The request span uses a route template in `http.route` and the method in
133
+ `http.request.method`; it does not record concrete URLs, session IDs, tokens,
134
+ headers, bodies, or query parameters. It adopts an incoming `traceparent` when
135
+ present.
136
+
137
+ ## Local traces
138
+
139
+ Without `agent/instrumentation.ts`, `eve dev` records one bounded trace per
140
+ turn under `.eve/traces/`. View traces with
141
+ [`/traces`](../guides/dev-tui#logs-and-traces) in the dev TUI or
142
+ [`eve traces`](../reference/cli#eve-traces) after `eve dev` exits.
143
+
144
+ Local traces retain model, tool, and memory-record content by default. Set
145
+ `EVE_TRACES_CONTENT=off` in `.env.local` to omit it. Writing
146
+ `agent/instrumentation.ts` replaces local tracing; its `recordInputs` and
147
+ `recordOutputs` settings control content in the OTel provider you register.
148
+
149
+ ## Workflow run tags
150
+
151
+ Separately from OpenTelemetry, eve tags every Workflow run with reserved
152
+ `$eve.*` attributes. These framework-owned attributes are queryable in the
153
+ Workflow dashboard, not on OTel spans. eve emits them for every session, turn,
154
+ and subagent run, whether or not `agent/instrumentation.ts` exists.
155
+
156
+ Structural tags describe a run's place in its tree:
157
+
158
+ - `$eve.type`: `"session"`, `"turn"`, or `"subagent"`.
159
+ - `$eve.parent`: the immediate parent session ID.
160
+ - `$eve.root`: the root session ID for the tree.
161
+ - `$eve.subagent`: the compiled graph node ID for a subagent run.
162
+ - `$eve.trigger`: the channel kind that started the run.
163
+ - `$eve.schedule`: the schedule that created the session.
164
+ - `$eve.title`: a truncated title from the first user message.
165
+ - `$eve.trace_id`: a sampled trace seed. Use it as a trace link, not a
166
+ conversation-wide identity.
167
+
168
+ Each turn also accumulates `$eve.model`, `$eve.input_tokens`,
169
+ `$eve.output_tokens`, `$eve.cache_read_tokens`, and `$eve.tool_count`. These
170
+ tags power the **Agent Runs** tab in Vercel's **Observability** view. See
171
+ [Deploy to Vercel](../guides/deployment/vercel#inspect-agent-runs) for
172
+ enablement.
173
+
174
+ ## Debug discovery
175
+
176
+ Run `eve info` to see the instrumentation eve discovered and any diagnostics.
177
+ eve also writes these inspectable artifacts under `.eve/`:
178
+
179
+ | Artifact | Tells you |
180
+ | ------------------------------- | ----------------------------------- |
181
+ | `agent-discovery-manifest.json` | What eve found on disk. |
182
+ | `diagnostics.json` | Authored-shape errors and warnings. |
183
+ | `compiled-agent-manifest.json` | The surface eve loads at runtime. |
184
+ | `module-map.mjs` | Compiled module entry points. |
185
+
186
+ ### Common failures
187
+
188
+ | Symptom | Next action |
189
+ | ------------------------------------- | ------------------------------------------------------------------------------------------------- |
190
+ | Instrumentation is not discovered. | Run `eve info`, confirm the file is in the expected slot, and read `.eve/diagnostics.json`. |
191
+ | A tool is not discovered. | Confirm it is under `agent/tools/`, default-exports `defineTool(...)`, and appears in `eve info`. |
192
+ | `eve build` reports discovery errors. | Read the printed diagnostics and `.eve/diagnostics.json`. |
193
+
194
+ ## Instrumentation Providers
195
+
196
+ [Instrumentation Providers](./instrumentation-providers) is an experimental
197
+ multi-file alternative. It cannot be used with `agent/instrumentation.ts`.
198
+ Use it when you need independent lifecycle-event providers, OpenTelemetry
199
+ destinations, directional content capture, or per-destination redaction.
@@ -0,0 +1,169 @@
1
+ ---
2
+ title: "Instrumentation Providers"
3
+ description: "Configure experimental instrumentation providers, handle lifecycle events, and control the content each provider receives."
4
+ url: "/observability/instrumentation-providers"
5
+ ---
6
+
7
+ <Callout type="warning" title="Experimental">
8
+ This API is experimental and may change without a deprecation period.
9
+ </Callout>
10
+
11
+ Instrumentation providers split observability into files under `agent/instrumentation/`. Each provider handles eve lifecycle events without owning the rest of the telemetry pipeline. Configure OpenTelemetry destinations with the [built-in OpenTelemetry APIs](./otel).
12
+
13
+ Enable it explicitly in `agent.ts`:
14
+
15
+ ```ts title="agent/agent.ts"
16
+ import { defineAgent } from "eve";
17
+
18
+ export default defineAgent({
19
+ model: "anthropic/claude-sonnet-5",
20
+ experimental: {
21
+ instrumentationProviders: true,
22
+ },
23
+ });
24
+ ```
25
+
26
+ The provider directory replaces `agent/instrumentation.ts`; the two layouts cannot be used together. See [Instrumentation](../observability/instrumentation) for the current single-file API.
27
+
28
+ ## Add a provider
29
+
30
+ The filename identifies the provider slot. A lifecycle-event provider file
31
+ must default-export `defineInstrumentation(...)` or `disableInstrumentation()`.
32
+ See [OpenTelemetry](./otel) for the supported OTel declarations.
33
+
34
+ ```text
35
+ agent/instrumentation/
36
+ audit.ts lifecycle event provider
37
+ ```
38
+
39
+ This provider records action timing and identity without receiving tool arguments or results:
40
+
41
+ ```ts title="agent/instrumentation/audit.ts"
42
+ import { defineInstrumentation } from "eve/instrumentation";
43
+
44
+ export default defineInstrumentation({
45
+ events: {
46
+ "action.started": (event, ctx) => {
47
+ ctx.state.set({ name: event.name, startedAt: Date.now() });
48
+ },
49
+ "action.completed": (event, ctx) => {
50
+ const started = ctx.state.get() as { name: string; startedAt: number } | undefined;
51
+ if (started === undefined) return;
52
+
53
+ console.log({
54
+ action: started.name,
55
+ durationMs: Date.now() - started.startedAt,
56
+ outcome: event.outcome,
57
+ });
58
+ },
59
+ },
60
+ });
61
+ ```
62
+
63
+ `ctx.state` is JSON storage scoped to this provider and operation. It survives durable suspension and is released after the terminal event.
64
+
65
+ ## Control inputs and outputs
66
+
67
+ Each provider has an independent `tracePolicy`. It decides whether the provider
68
+ receives a trace and whether its events include input or output content.
69
+
70
+ ```ts title="agent/instrumentation/audit.ts"
71
+ import { defineInstrumentation } from "eve/instrumentation";
72
+
73
+ export default defineInstrumentation({
74
+ tracePolicy: ({ audience, environment }) => ({
75
+ emit: true,
76
+ recordInputs: audience === "public" || environment === "development",
77
+ recordOutputs: audience === "public" || environment === "development",
78
+ }),
79
+ events: {
80
+ "model.call.started": (event) => {
81
+ console.log("input", event.input);
82
+ },
83
+ "model.call.completed": (event) => {
84
+ console.log("output", event.content);
85
+ },
86
+ },
87
+ });
88
+ ```
89
+
90
+ The function receives `agentName`, `channel`, `audience`, `mode`,
91
+ `environment`, and `principalType`. `audience` is `"public"`, `"private"`, or
92
+ `"unknown"`; `environment` is `"development"`, `"preview"`, or
93
+ `"production"`.
94
+
95
+ Without a policy, or when it returns `true`, eve sends the provider metadata
96
+ for every trace. It includes input and output content in these cases:
97
+
98
+ | Environment | Audience | Content |
99
+ | --------------------- | ---------------------- | ------------------ |
100
+ | Development | Any | Inputs and outputs |
101
+ | Preview or production | `public` | Inputs and outputs |
102
+ | Preview or production | `private` or `unknown` | Metadata only |
103
+
104
+ Return `{ emit: false }` to not sample the trace for this provider. Return
105
+ `{ emit: true, recordInputs, recordOutputs }` to choose the two content
106
+ directions explicitly. Inputs include model prompts, tool arguments, channel
107
+ input, and user responses. Outputs include model responses, tool results,
108
+ requests for user input, provider metadata, and error details. Omitted content
109
+ fields are unavailable to the handler.
110
+
111
+ The channel assigns the audience once when it creates the session. It controls
112
+ content capture, not access. Configure it in the [default eve HTTP
113
+ channel](../channels/eve#audience) or a [custom
114
+ channel](../channels/custom#conversation-audience).
115
+
116
+ ## Redact fields in a custom provider
117
+
118
+ Lifecycle events are immutable snapshots. Copy the fields you need into a destination-specific payload and redact that copy before sending it:
119
+
120
+ ```ts title="agent/instrumentation/audit.ts"
121
+ import { defineInstrumentation } from "eve/instrumentation";
122
+
123
+ export default defineInstrumentation({
124
+ tracePolicy: () => ({
125
+ emit: true,
126
+ recordInputs: true,
127
+ recordOutputs: false,
128
+ }),
129
+ events: {
130
+ "action.started": async (event) => {
131
+ await sendAuditRecord({
132
+ id: event.idempotencyKey,
133
+ input: redactApiKey(event.input),
134
+ kind: event.kind,
135
+ name: event.name,
136
+ });
137
+ },
138
+ },
139
+ });
140
+
141
+ function redactApiKey(value: unknown): unknown {
142
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return value;
143
+
144
+ const record = value as Record<string, unknown>;
145
+ return "apiKey" in record ? { ...record, apiKey: "[redacted]" } : record;
146
+ }
147
+
148
+ async function sendAuditRecord(record: unknown): Promise<void> {
149
+ // Send the sanitized record to your provider.
150
+ void record;
151
+ }
152
+ ```
153
+
154
+ Prefer `recordInputs: false` or `recordOutputs: false` when the destination does not need an entire content direction. Use field-level redaction only when the destination needs part of that content.
155
+
156
+ ## Lifecycle events
157
+
158
+ Providers can handle session, channel delivery, turn, model attempt, model call, action, input request, and tool call events. Start and terminal events share an `idempotencyKey`, which can serve as a destination row ID.
159
+
160
+ An ordinary tool emits both `action.*` and `tool.call.*` events. Use `action.*` for eve's durable dispatch lifecycle, including tools, skills, subagents, and remote agents. Use `tool.call.*` only when you need the AI SDK's in-process tool execution boundary.
161
+
162
+ Handlers for different providers run concurrently and are failure-isolated. Do not depend on provider execution order. Use `flush` to drain buffered records and `shutdown` to release resources.
163
+
164
+ ## What to read next
165
+
166
+ - [Instrumentation](../observability/instrumentation): configure the current single-file API
167
+ - [OpenTelemetry](./otel): configure OTel destinations and managed exports.
168
+ - [Local development](../guides/dev-tui): inspect local traces in the TUI
169
+ - [Hooks](../guides/hooks): react to runtime events outside the instrumentation provider API
@@ -4,7 +4,6 @@
4
4
  "deployment",
5
5
  "auth-and-route-protection",
6
6
  "instrumentation",
7
- "instrumentation-providers",
8
7
  "hooks",
9
8
  "session-context",
10
9
  "dynamic-capabilities",
@@ -139,26 +139,22 @@ Identity forwarding does not make a persistent session private to one caller. Co
139
139
 
140
140
  Forwarding is explicit on both sides. The receiver names which forwarders it trusts with `eveChannel({ trustedForwarders })` (see [Auth & route protection](./auth-and-route-protection#accepting-forwarded-identity-from-another-deployment)); a receiver that refuses the forwarder — or has no `trustedForwarders` at all — rejects with a 403 and the dispatch fails.
141
141
 
142
- Remote tracing uses [W3C Trace Context](https://www.w3.org/TR/trace-context/). `traceparent` identifies the immediate HTTP parent, while eve's `eve=<caller-span-id>` vendor entry in `tracestate` preserves the dispatching caller when an intermediary advances `traceparent` to its own request span. The receiver uses the eve entry for the child's `agent.dispatch` link and the transport context for request correlation. Older senders and missing or malformed eve entries fall back to `traceparent`. Trace context is not an authorization grant: it cannot assert eve parent lineage, change `rootSessionId`, or remove the normal root-session token cap.
142
+ ## Trace propagation
143
143
 
144
- eve also carries the original `gen_ai.conversation.id` in `eve.conversation.id` baggage so you can find related traces across local and remote agents. This observability identifier does not require principal forwarding or shared execution lineage; it grants no session access and does not change trace-content policy. Session execution establishes this ID even without an instrumentation runtime. Only session-create requests with a callback may supply this baggage; top-level requests ignore it and establish their own conversation ID. Callback metadata is caller-supplied correlation, not verified identity.
145
-
146
- eve replaces configured `traceparent` and conversation baggage only when it has a framework value to send. It replaces its own `tracestate` entry while preserving other valid vendor entries; without a valid caller context, eve removes only its entry. Incoming baggage has an 8 KiB limit; the audience and conversation readers share whitespace, percent-decoding, and duplicate-key validation. Conversation IDs are limited to 1 KiB and exclude control characters and line separators. If adding an audience assertion or conversation ID would exceed 8 KiB, eve rejects the dispatch before sending a request instead of dropping the member. Reduce `remote.headers.baggage` to leave room for these framework values.
147
-
148
- In the [provider trace contract](./instrumentation#agent-trace-contract), each
149
- child activation starts a separate trace. The first activation uses the
150
- caller preserved in W3C `tracestate`, falling back to incoming `traceparent`,
151
- as an `agent.dispatch` span link rather than adopting the caller's trace ID.
152
-
153
- > ⚠️ **Upgrade both deployments before resuming persistent remote sessions.** A sender with continuation forwarding includes `forwardedPrincipal` on each authenticated follow-up. A receiver that supports forwarding only on session creation rejects that continuation with HTTP 400. eve does not retry without the field because that would run the follow-up as the transport service principal and silently change caller authority. The parent retains the child handle after this failure, so you can retry the same session after upgrading the receiver.
154
-
155
- A receiver on an eve version that predates all principal forwarding may instead drop the unknown field and run the session as your app's service identity; per-user connections there fail with `principal_required`. On remote requests where the dispatching turn has no auth, the field is omitted and the call proceeds on transport trust alone.
144
+ Each remote turn starts a new trace. eve links the child trace to the
145
+ dispatching turn and carries `gen_ai.conversation.id` so you can find the
146
+ traces for one conversation. Trace context is observability metadata, not an
147
+ authorization grant. See [OpenTelemetry](../observability/otel#trace-topology)
148
+ for the trace topology.
156
149
 
157
150
  ## Preserving trace content
158
151
 
159
- With `forwardPrincipal: true`, a sampled trace carries its original audience and the maximum content the next hop may record. For example, `eve.audience=private;ceiling=i0o1` allows outputs but not inputs. eve sends this as [W3C Baggage](https://www.w3.org/TR/baggage/).
152
+ With `forwardPrincipal: true`, a sampled remote dispatch forwards its original
153
+ audience and the maximum input and output content the next hop may record. eve
154
+ sends this policy as [W3C Baggage](https://www.w3.org/TR/baggage/).
160
155
 
161
- The receiver uses it only after `trustedForwarders` accepts the authenticated calling deployment:
156
+ The receiving deployment uses the policy only after it trusts the calling
157
+ deployment:
162
158
 
163
159
  ```ts title="agent/channels/eve.ts"
164
160
  import { eveChannel } from "eve/channels/eve";
@@ -171,13 +167,15 @@ export default eveChannel({
171
167
  });
172
168
  ```
173
169
 
174
- The request must also include a callback and a valid sampled `traceparent`. Those fields identify a remote call, but they do not establish trust. `trustedForwarders` is the authorization boundary.
175
-
176
- The receiver combines the incoming ceiling with its own trace policy. Each hop may narrow the result, but it cannot restore inputs or outputs removed earlier. The original audience stays the same across remote and local subagent hops. Public origins may include content by default. Private and unknown origins stay metadata-only in preview and production unless both deployments explicitly allow them; a receiver running in development still applies the development content default.
177
-
178
- The live delivery audience still matters. An unknown callback delivery, or one matching the origin, uses the session decision. A different explicit audience applies its own hard ceiling, so a private delivery stays redacted even when the trace began in public.
170
+ The request must include a callback and a valid sampled `traceparent`.
171
+ `trustedForwarders` is the authorization boundary. When the assertion is
172
+ accepted, the receiver uses the forwarded audience instead of reclassifying
173
+ the child session with its local channel.
179
174
 
180
- Missing, malformed, duplicate, unsampled, untrusted, and mixed-version assertions fall back to metadata-only tracing. Dropped traces use only the unsampled trace flag. The decision is fixed when the remote session starts and reused by continuations. Agent Runs shows Workflow content only when both inputs and outputs are allowed.
175
+ The receiver combines the forwarded ceiling with its own trace policy. Each
176
+ hop may narrow content capture, but cannot restore inputs or outputs removed by
177
+ an earlier hop. Missing, malformed, unsampled, or untrusted assertions do not
178
+ widen capture and use metadata-only tracing.
181
179
 
182
180
  ## How remote dispatch and callbacks work
183
181
 
@@ -12,7 +12,7 @@ Run `eve add` from an eve agent project. This installs the integration's depende
12
12
 
13
13
  ```bash
14
14
  eve add extension/agent-browser
15
- eve add linear
15
+ eve add channel/linear
16
16
  eve add instrumentation/braintrust
17
17
  eve add memory/file
18
18
  ```
@@ -25,9 +25,7 @@ If you do not know an item name yet, run `eve add` without an argument. Its help
25
25
 
26
26
  Extensions may create a mount under `agent/extensions/`. Connections write their initial definition under `agent/connections/` and install `@vercel/connect` when required. Instrumentation providers write `agent/instrumentation.ts`; because an agent has one instrumentation file, compose multiple exporters there by hand. Configure generated files and required environment variables before running your agent.
27
27
 
28
- Some integrations package several independently installable components. For example, `eve add linear` lets you choose the Linear Channel, Linear MCP, or both; both are selected by default. The specific `eve add channel/linear-agent` and `eve add connection/linear` commands remain available.
29
-
30
- When an official item declares an interactive setup flow or flows, eve asks whether to run them after installation and runs multiple flows in declaration order. Run the printed `eve add <item> --skip-install` command to resume a skipped or cancelled setup later; it reruns the selected components' declared flows from the beginning.
28
+ When an official item declares an interactive setup flow or flows, eve asks whether to run them after installation and runs multiple flows in declaration order. Run the printed `eve add <item> --skip-install` command to resume a skipped or cancelled setup later; it reruns the item's declared flows from the beginning.
31
29
 
32
30
  For example, `eve add memory/file` can provision its required storage through the same setup flow. After **Install and set up**, eve creates or reuses a dedicated private Vercel Blob store, connects production, preview, and development with namespaced credentials, pulls the environment, and offers to deploy. The review and setup transcript show the project, store, primary function region, environments, and possible Blob usage charges before provisioning.
33
31
 
@@ -91,7 +91,7 @@ eve to require the authenticated user from route auth, key the step-local token
91
91
  cache by that user, and pass the projected principal into `getToken`:
92
92
 
93
93
  ```ts title="agent/lib/tenant-connection-auth.ts"
94
- import type { ConnectionPrincipal, NonInteractiveAuthorizationDefinition } from "eve/connections";
94
+ import type { ConnectionAuthProvider, ConnectionPrincipal } from "eve/connections";
95
95
  import { tenantCredentials, type TenantService } from "./tenant-credentials";
96
96
 
97
97
  function requireTenantPrincipal(principal: ConnectionPrincipal): {
@@ -107,9 +107,9 @@ function requireTenantPrincipal(principal: ConnectionPrincipal): {
107
107
  return { tenantId, userId: principal.id };
108
108
  }
109
109
 
110
- export function tenantBearerAuth(service: TenantService): NonInteractiveAuthorizationDefinition {
110
+ export function tenantBearerAuth(service: TenantService): ConnectionAuthProvider {
111
111
  return {
112
- principalType: "user",
112
+ credentialOwner: "user",
113
113
  async getToken({ principal }) {
114
114
  const { tenantId, userId } = requireTenantPrincipal(principal);
115
115
  const credential = await tenantCredentials.getBearer(tenantId, service, { userId });
@@ -123,7 +123,7 @@ Commands for installing and discovering [shadcn registry](https://ui.shadcn.com/
123
123
 
124
124
  ```bash
125
125
  eve add extension/agent-browser
126
- eve add linear
126
+ eve add channel/linear
127
127
  eve add channel/slack --skip-install
128
128
  eve add https://example.com/r/my-extension.json --overwrite
129
129
  eve registry add @acme=https://example.com/r/{name}.json
@@ -134,11 +134,11 @@ eve registry view @acme/my-extension
134
134
  eve add @acme/my-extension
135
135
  ```
136
136
 
137
- `eve add` asks before running setup declared by an official item and runs multiple declared flows in declaration order. Product-level packages can offer independently installable components: `eve add linear` lets you select the Linear Channel, Linear MCP, or both, with both selected by default. Interactive Vercel-backed setup signs in and creates or links a project when needed instead of stopping with a prerequisite. `--yes` installs a package's default components and accepts detected or recommended setup answers.
137
+ `eve add` asks before running setup declared by an official item and runs multiple declared flows in declaration order. Interactive Vercel-backed setup signs in and creates or links a project when needed instead of stopping with a prerequisite. `--yes` accepts detected or recommended setup answers.
138
138
 
139
- Coding agents should use `eve add <item> --non-interactive`, adding `--yes` to accept recommended setup values and reduce setup round trips. Explicit `--answer` values take precedence. This mode never opens an eve prompt. When a component or setup decision is missing, the NDJSON terminal event includes a stable question key and a safe continuation command; add the requested answer to that command. Supply answers with repeatable `--answer 'key=<JSON value>'` options. Follow a reported `eve link` prerequisite before retrying Vercel Connect setup. Do not put secrets in command-line answers; use the integration's documented environment variable or secret store.
139
+ Coding agents should use `eve add <item> --non-interactive`, adding `--yes` to accept recommended setup values and reduce setup round trips. Explicit `--answer` values take precedence. This mode never opens an eve prompt. When a setup decision is missing, the NDJSON terminal event includes a stable question key and a safe continuation command; add the requested answer to that command. Supply answers with repeatable `--answer 'key=<JSON value>'` options. Follow a reported `eve link` prerequisite before retrying Vercel Connect setup. Do not put secrets in command-line answers; use the integration's documented environment variable or secret store.
140
140
 
141
- When setup is skipped, cancelled, or needs more input after installation, eve prints or returns the matching `eve add <item> --skip-install` continuation. It reruns the selected components' declared flows without reinstalling registry files.
141
+ When setup is skipped, cancelled, or needs more input after installation, eve prints or returns the matching `eve add <item> --skip-install` continuation. It reruns the item's declared flows without reinstalling registry files.
142
142
 
143
143
  `eve registry add` records configured sources in `package.json#registries`. `eve registry list` aggregates the official catalog and all configured sources by default. `eve registry search` also includes [skills.sh](https://skills.sh), available without configuration at `@skills`, and groups results by source with each source's available result count. Search returns up to 10 matches per source by default; pass `--limit <count>` to request between 1 and 100. Either command can browse one supplied URL or namespace. Official and other universal items with explicit file targets do not require shadcn project configuration.
144
144
 
@@ -317,7 +317,7 @@ A durable conversation produces one bounded trace per turn. Worker replacements
317
317
 
318
318
  Every span carries a real duration. A turn's root `invoke_agent` span is written when the turn settles, so a running turn shows only its steps.
319
319
 
320
- Model, `execute_tool`, and memory spans omit their content by default. Set `EVE_TRACES_CONTENT=on` to capture system prompts, prompt messages, and response text for models; call arguments and results for tools; and recalled memory records. Each captured value is capped at 32 KB.
320
+ Model, `execute_tool`, and memory spans retain their content by default. Set `EVE_TRACES_CONTENT=off` to omit system prompts, prompt messages, and response text for models; call arguments and results for tools; and recalled memory records. Each captured value is capped at 32 KB.
321
321
 
322
322
  Step spans carry token counts under `agent.usage.*`, and cost when Vercel AI Gateway served the call. Model spans also expose `gen_ai.usage.*` token counters. The CLI sums step-level counters only, so model and delegated-call totals are not counted twice.
323
323
 
@@ -325,13 +325,13 @@ Step spans carry token counts under `agent.usage.*`, and cost when Vercel AI Gat
325
325
 
326
326
  eve sweeps the store when an activation's writes finish, when a session finishes, and when the dev server starts. An open conversation does not pin every completed turn's trace. Sweeps evict oldest-first past the bounds below, except that active traces, the newest traces, and anything written in the last five minutes are kept. A sweep can therefore exceed the size budget. Set the bounds in `.env.local`, which `eve dev` loads automatically; each accepts `off` to disable it individually.
327
327
 
328
- | Variable | Default | Effect |
329
- | ---------------------------- | -------------------- | --------------------------------------------------------------------------------------------------- |
330
- | `EVE_TRACES` | on | `off` stops writing traces and stops sweeping |
331
- | `EVE_TRACES_CONTENT` | off | `on` captures model prompt/response, tool input/output, and memory-record attributes on local spans |
332
- | `EVE_TRACES_MAX_AGE_MS` | `604800000` (7d) | Age after which a trace may be evicted |
333
- | `EVE_TRACES_MAX_TOTAL_BYTES` | `536870912` (512 MB) | Size budget for the whole store |
334
- | `EVE_TRACES_RETAIN_COUNT` | `20` | Newest traces kept regardless of age or size |
328
+ | Variable | Default | Effect |
329
+ | ---------------------------- | -------------------- | ------------------------------------------------------------------------------------------------- |
330
+ | `EVE_TRACES` | on | `off` stops writing traces and stops sweeping |
331
+ | `EVE_TRACES_CONTENT` | on | `off` omits model prompt/response, tool input/output, and memory-record attributes on local spans |
332
+ | `EVE_TRACES_MAX_AGE_MS` | `604800000` (7d) | Age after which a trace may be evicted |
333
+ | `EVE_TRACES_MAX_TOTAL_BYTES` | `536870912` (512 MB) | Size budget for the whole store |
334
+ | `EVE_TRACES_RETAIN_COUNT` | `20` | Newest traces kept regardless of age or size |
335
335
 
336
336
  ## `eve link`
337
337
 
@@ -399,10 +399,10 @@ Lists the user-authored channels in the current project.
399
399
  4. `eve build` before shipping.
400
400
  5. `eve start` to smoke-test the built output locally.
401
401
 
402
- Related: [Project layout](../getting-started#project-layout) · [instrumentation.ts](../guides/instrumentation).
402
+ Related: [Project layout](../getting-started#project-layout) · [Instrumentation](../observability/instrumentation).
403
403
 
404
404
  ## What to read next
405
405
 
406
406
  - [Project layout](../getting-started#project-layout): what `eve info` discovers
407
- - [instrumentation.ts](../guides/instrumentation): tracing and the error catalog
407
+ - [Instrumentation](../observability/instrumentation): tracing and the error catalog
408
408
  - [Deployment](../guides/deployment/overview): `eve build` and `eve start` in production
@@ -48,16 +48,16 @@ export default defineTool({
48
48
  | `defineSchedule` | `eve/schedules` | `agent/schedules/<name>.ts` | [Schedules](../schedules) |
49
49
  | `defineState` | `eve/context` | tools, hooks, lifecycle | [Session context](../guides/session-context) |
50
50
  | `defineSandbox` | `eve/sandbox` | `agent/sandbox.ts` | [Sandbox](../sandbox) |
51
- | `defineInstrumentation` | `eve/instrumentation` | `agent/instrumentation.ts` | [instrumentation.ts](../guides/instrumentation) |
51
+ | `defineInstrumentation` | `eve/instrumentation` | `agent/instrumentation.ts` | [Instrumentation](../observability/instrumentation) |
52
52
  | `defineRemoteAgent` | `eve` | `agent/subagents/<id>/agent.ts` | [Remote agents](../guides/remote-agents) |
53
53
  | `defineEval` | `eve/evals` | `evals/*.eval.ts` | [Evals](../evals/overview) |
54
54
  | `defineEvalConfig` | `eve/evals` | `evals/evals.config.ts` | [Evals](../evals/overview) |
55
55
  | `mockModel` | `eve/evals` | Deterministic fixture agent models | [Evals](../evals/overview) |
56
56
  | `useEveAgent` | `eve/react`, `eve/vue`, `eve/svelte` | frontend | [Frontend](../guides/frontend/overview) |
57
57
 
58
- Tool-wide authoring helpers and types such as `defineTool`, `defineWorkflowTool`, `defineDurableCallback`, `defineDynamic`, `disableTool`, and `ToolLabelDefinition` come from `eve/tools`. Capability-specific definitions and helpers use their own subpaths (see [Built-in tools](../concepts/built-in-tools)): reusable definitions such as `bash` and `glob` come from `eve/tools/<name>`, `webSearch` comes from `eve/tools/web_search`, `experimental_workflow` comes from `eve/tools/workflow`, `sleep` comes from `eve/tools/sleep`, and approval policies and types come from `eve/tools/approval`. The route verbs `GET`/`HEAD`/`POST`/`PUT`/`PATCH`/`DELETE`/`OPTIONS`/`WS` plus `disableRoute` come from `eve/channels`, and the channel auth helpers `localDev`/`vercelOidc`/`placeholderAuth` come from `eve/channels/auth`.
58
+ Tool-wide authoring helpers and types such as `defineTool`, `defineWorkflowTool`, `defineDurableCallback`, `defineDynamic`, `disableTool`, and `ToolLabelDefinition` come from `eve/tools`. Capability-specific definitions and helpers use their own subpaths (see [Built-in tools](../concepts/built-in-tools)): reusable definitions such as `bash` and `glob` come from `eve/tools/<name>`, `webSearch` comes from `eve/tools/web_search`, `sleep` comes from `eve/tools/sleep`, and approval policies and types come from `eve/tools/approval`. The route verbs `GET`/`HEAD`/`POST`/`PUT`/`PATCH`/`DELETE`/`OPTIONS`/`WS` plus `disableRoute` come from `eve/channels`, and the channel auth helpers `localDev`/`vercelOidc`/`placeholderAuth` come from `eve/channels/auth`.
59
59
 
60
- `AgentReasoningDefinition` is exported from `eve` for the top-level `defineAgent({ reasoning })` setting. `AgentLimitsDefinition` is exported for `defineAgent({ limits })`. `AgentWorkflowDefinition`, `AgentWorkflowRetentionDefinition`, and `AgentWorkflowWorldDefinition` are exported from `eve` for the `defineAgent({ experimental: { workflow } })` config shape. `ExperimentalWorkflowToolInput` is exported from `eve/tools/workflow`; `WebSearchToolInput` and `WebSearchProvider` are exported from `eve/tools/web_search`.
60
+ `AgentReasoningDefinition` is exported from `eve` for the top-level `defineAgent({ reasoning })` setting. `AgentLimitsDefinition` is exported for `defineAgent({ limits })`. `AgentWorkflowDefinition`, `AgentWorkflowRetentionDefinition`, and `AgentWorkflowWorldDefinition` are exported from `eve` for the `defineAgent({ experimental: { workflow } })` config shape. `WebSearchToolInput` and `WebSearchProvider` are exported from `eve/tools/web_search`.
61
61
 
62
62
  `defineInstructions` accepts `{ content: string, role?: "system" | "user" }`; omitted `role` means `"system"`. Its `eve/instructions` version of `defineDynamic` accepts only `session.started` and `turn.started` handlers returning `defineInstructions(...)` or `null`. The legacy `{ markdown: string }` definition remains available as a deprecated system-role form.
63
63
 
@@ -74,11 +74,11 @@ cross resolved instances.
74
74
 
75
75
  eve evaluates TypeScript definition modules during compilation so it can validate and normalize the agent. Within one agent node, each module namespace loads at most once during that compile. The resolved definition then determines whether the module is also an entry in the runtime bundle:
76
76
 
77
- | Lifecycle | Authored definitions |
78
- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
79
- | Compile only | Static instructions and skills, prompt-form TypeScript schedules, static Gateway or default agent config, provider-managed web search, `Workflow` configuration, fully shadowed channels, and a child sandbox that selects its parent's sandbox |
80
- | Compile and runtime | Dynamic instructions, skills, tools, models, and subagents; executable tools; effective channels; connections; hooks; memory; handler schedules; direct-provider models; independent sandboxes; and remote subagents |
81
- | Runtime only | Instrumentation modules and extension mount initialization |
77
+ | Lifecycle | Authored definitions |
78
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
79
+ | Compile only | Static instructions and skills, prompt-form TypeScript schedules, static Gateway or default agent config, provider-managed web search, Workflow SDK configuration, fully shadowed channels, and a child sandbox that selects its parent's sandbox |
80
+ | Compile and runtime | Dynamic instructions, skills, tools, models, and subagents; executable tools; effective channels; connections; hooks; memory; handler schedules; direct-provider models; independent sandboxes; and remote subagents |
81
+ | Runtime only | Instrumentation modules and extension mount initialization |
82
82
 
83
83
  A compile-only module is not imported when the deployed runtime starts. For example, eve stores the resolved content from a static `instructions.ts` in the compiled manifest. A compile-and-runtime module is evaluated during compilation and imported again when a runtime process loads the module map. Keep module-top-level work deterministic, and put request- or session-specific work in the definition's runtime callbacks.
84
84
 
@@ -116,7 +116,7 @@ import template from "../../prompts/template.txt?raw";
116
116
  | `eve/tools/{bash,read_file,write_file,todo,web_fetch,load_skill,glob,grep}` | Individual reusable tool definitions |
117
117
  | `eve/tools/approval` | Approval types and `always`, `once`, `never` |
118
118
  | `eve/tools/web_search` | Provider-managed `webSearch` configuration |
119
- | `eve/tools/workflow` | Experimental `Workflow` tool definition |
119
+ | `eve/tools/workflow` | Runtime-generated `workflow` tool factory |
120
120
  | `eve/tools/sleep` | Opt-in durable `sleep` tool |
121
121
  | `eve/connections` | `defineMcpClientConnection`, `defineOpenAPIConnection`, `defineDynamic` |
122
122
  | `eve/channels` | `defineChannel`, `disableRoute`, route verbs |
@@ -32,7 +32,7 @@ The root session receives `agent` by default. The model calls it to delegate a t
32
32
  }
33
33
  ```
34
34
 
35
- The copy uses the root's instructions, connections, auth, and sandbox. It receives the same tools except for the root-only `agent` and `Workflow`, and starts with fresh conversation history and fresh state. Its file writes are immediately visible to the root. The built-in `agent` always runs in the background and needs no configuration: each call returns `{ status: "working", taskId, agentId }`, then task notifications wake the parent with completion, failure, or cancellation. Give parallel children non-overlapping write scopes.
35
+ The copy uses the root's instructions, connections, auth, and sandbox. It receives the same tools except for the root-only `agent`, and starts with fresh conversation history and fresh state. Its file writes are immediately visible to the root. The built-in `agent` always runs in the background and needs no configuration: each call returns `{ status: "working", taskId, agentId }`, then task notifications wake the parent with completion, failure, or cancellation. Give parallel children non-overlapping write scopes.
36
36
 
37
37
  `agent` is intentionally root-only. Copies created by it cannot call `agent`, and declared subagents never receive the built-in tool. If a stale or forced recursive call reaches execution, eve rejects it instead of starting another child session.
38
38
 
@@ -199,7 +199,7 @@ eve lowers every subagent visible to the current agent (the root built-in copy,
199
199
 
200
200
  Declared subagents can call nested subagents defined under their own directories. eve does not apply a separate depth limit; nesting ends where the authored directory tree ends. The built-in `agent` follows the stricter root-only rule above, so `limits.maxSubagentDepth` no longer exists.
201
201
 
202
- Child sessions can still call their own declared or remote subagents, but they receive neither `Workflow` nor the built-in `agent`. Background subagents run through the model tool loop and are not available inside a model-authored `Workflow` program.
202
+ Child sessions can still call their own declared or remote subagents, but they do not receive the built-in `agent`. Authored workflow tools use the same subagent availability and authorization checks as direct delegation.
203
203
 
204
204
  A directly declared subagent's tool name is the bare path-derived name, with no prefix. `agent/subagents/researcher/` registers as the tool `researcher`. A subagent supplied by a mounted extension includes the mount namespace, such as `crm__reviewer`. The model, approvals, logs, and evals reference the resulting name. Its input schema is:
205
205