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.
- package/CHANGELOG.md +18 -0
- package/dist/src/channel/audience.d.ts +3 -3
- package/dist/src/channel/conversation-context.d.ts +4 -2
- package/dist/src/channel/conversation-context.js +1 -1
- package/dist/src/chunks/{use-eve-agent-CxPlg0KL.js → use-eve-agent-CMdMlS7Y.js} +0 -10
- package/dist/src/chunks/{use-eve-agent-D-KQzzyW.js → use-eve-agent-RUGSwq8b.js} +0 -10
- package/dist/src/cli/commands/registry-metadata.d.ts +0 -18
- package/dist/src/cli/commands/registry-metadata.js +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.js +1 -1
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/tui/blocks.d.ts +2 -0
- package/dist/src/cli/dev/tui/blocks.js +3 -3
- package/dist/src/cli/dev/tui/markdown.d.ts +8 -1
- package/dist/src/cli/dev/tui/markdown.js +7 -7
- package/dist/src/cli/dev/tui/runner.d.ts +4 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +5 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
- package/dist/src/cli/dev/tui/tui.d.ts +4 -1
- package/dist/src/cli/ui/terminal-text.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +0 -57
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +18 -8
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +12 -11
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-tool.d.ts +0 -3
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/validate-artifact.js +1 -1
- package/dist/src/context/keys.d.ts +2 -0
- package/dist/src/context/keys.js +1 -1
- package/dist/src/eve-channel/audience.d.ts +2 -2
- package/dist/src/eve-channel/audience.js +1 -1
- package/dist/src/eve-channel/types.d.ts +5 -5
- package/dist/src/execution/coordination-dispatch-step.d.ts +2 -2
- package/dist/src/execution/coordination-dispatch-step.js +1 -1
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +0 -1
- package/dist/src/execution/dynamic-workflow/program-step.d.ts +21 -0
- package/dist/src/execution/dynamic-workflow/program-step.js +1 -0
- package/dist/src/execution/dynamic-workflow/schema.d.ts +36 -0
- package/dist/src/execution/dynamic-workflow/schema.js +1 -0
- package/dist/src/execution/dynamic-workflow/security-step.d.ts +3 -0
- package/dist/src/execution/dynamic-workflow/security-step.js +1 -0
- package/dist/src/execution/dynamic-workflow/tool.d.ts +8 -0
- package/dist/src/execution/dynamic-workflow/tool.js +1 -0
- package/dist/src/execution/dynamic-workflow/workflow.d.ts +10 -0
- package/dist/src/execution/dynamic-workflow/workflow.js +1 -0
- package/dist/src/execution/eve-workflow-attributes.d.ts +2 -1
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/inline-turn.js +1 -1
- package/dist/src/execution/model-call-batching.js +1 -1
- package/dist/src/execution/next-driver-action.d.ts +0 -8
- package/dist/src/execution/node-step.d.ts +0 -5
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/session.d.ts +0 -1
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/tasks/parent/delegate.d.ts +7 -0
- package/dist/src/execution/tasks/parent/delegate.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-step.d.ts +2 -0
- package/dist/src/execution/tools/subagent/invoke-step.js +1 -1
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/advertised-tools.d.ts +0 -3
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/types.d.ts +0 -21
- package/dist/src/instrumentation/content.js +1 -1
- package/dist/src/instrumentation/lifecycle.d.ts +5 -7
- package/dist/src/instrumentation/native-events.d.ts +2 -0
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/instrumentation/session-context.d.ts +2 -0
- package/dist/src/instrumentation/session-context.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/connection.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +3 -4
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/public/channels/chat-sdk/audience.d.ts +2 -2
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/telegram/audience.d.ts +2 -2
- package/dist/src/public/connections/index.d.ts +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -1
- package/dist/src/public/definitions/connections/mcp.d.ts +1 -1
- package/dist/src/public/definitions/connections/openapi.d.ts +1 -1
- package/dist/src/public/tools/workflow.d.ts +1 -4
- package/dist/src/public/tools/workflow.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/connections/authorization-tokens.d.ts +2 -4
- package/dist/src/runtime/connections/principal.d.ts +6 -6
- package/dist/src/runtime/connections/principal.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/types.d.ts +3 -9
- package/dist/src/self-modification/extension/classify-registry-item.d.ts +3 -3
- package/dist/src/self-modification/extension/classify-registry-item.js +1 -1
- package/dist/src/self-modification/extension/tools/search_registry.d.ts +1 -7
- package/dist/src/self-modification/extension/tools/search_registry.js +1 -1
- package/dist/src/setup/flows/registry.js +1 -1
- package/dist/src/setup/integrations/self-modification/setup.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +6 -2
- package/dist/src/shared/channel-definition.d.ts +2 -2
- package/dist/src/shared/connection-types.d.ts +20 -7
- package/dist/src/shared/conversation-context.d.ts +15 -0
- package/dist/src/shared/validate-authorization.js +1 -1
- package/dist/src/shared/workflow-sandbox.d.ts +18 -12
- package/dist/src/shared/workflow-sandbox.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/session-index.d.ts +11 -0
- package/dist/src/tasks/session-index.js +1 -1
- package/dist/src/tools/auth.d.ts +5 -6
- package/dist/src/tools/provided/workflow.d.ts +12 -0
- package/dist/src/tools/provided/workflow.js +1 -0
- package/dist/src/tools/workflow-program-input.d.ts +6 -0
- package/dist/src/tools/workflow-program-input.js +1 -0
- package/dist/src/tracing/agent-otel-provider.js +1 -1
- package/dist/src/tracing/agent-otel-runtime-context.d.ts +2 -1
- package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
- package/dist/src/tracing/agent-otel-session-context.js +1 -1
- package/dist/src/tracing/agent-trace-context-codec.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +2 -0
- package/dist/src/tracing/content-attributes.js +1 -1
- package/dist/src/tracing/local-instrumentation-runtime.d.ts +1 -1
- package/dist/src/tracing/local-instrumentation-runtime.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +1 -1
- package/docs/channels/chat-sdk.mdx +7 -0
- package/docs/channels/custom.mdx +16 -6
- package/docs/channels/eve.mdx +18 -18
- package/docs/channels/linear.mdx +7 -3
- package/docs/channels/overview.mdx +13 -0
- package/docs/channels/slack.mdx +9 -1
- package/docs/connections/mcp.mdx +4 -1
- package/docs/connections/openapi.mdx +8 -2
- package/docs/connections/overview.mdx +16 -13
- package/docs/getting-started.mdx +1 -1
- package/docs/guides/deployment/self-hosting.md +1 -1
- package/docs/guides/deployment/vercel.mdx +2 -2
- package/docs/guides/dev-tui.md +4 -4
- package/docs/guides/dynamic-capabilities.md +4 -4
- package/docs/guides/hooks.md +1 -1
- package/docs/guides/instrumentation/meta.json +4 -0
- package/docs/guides/instrumentation/otel.mdx +149 -0
- package/docs/guides/instrumentation/overview.md +199 -0
- package/docs/guides/instrumentation/providers.mdx +169 -0
- package/docs/guides/meta.json +0 -1
- package/docs/guides/remote-agents.md +19 -21
- package/docs/install-integrations.mdx +2 -4
- package/docs/patterns/multi-tenant-auth.md +3 -3
- package/docs/reference/cli.md +14 -14
- package/docs/reference/typescript-api.md +9 -9
- package/docs/subagents/index.mdx +2 -2
- package/docs/tools/workflows.mdx +56 -1
- package/package.json +1 -1
- package/dist/src/cli/commands/registry-package.d.ts +0 -52
- package/dist/src/cli/commands/registry-package.js +0 -1
- package/dist/src/harness/workflow-continuation-security.d.ts +0 -5
- package/dist/src/harness/workflow-continuation-security.js +0 -1
- package/dist/src/harness/workflow-interrupt-state.d.ts +0 -20
- package/dist/src/harness/workflow-interrupt-state.js +0 -1
- package/dist/src/harness/workflow-lifecycle.d.ts +0 -32
- package/dist/src/harness/workflow-lifecycle.js +0 -1
- package/dist/src/harness/workflow-sandbox.d.ts +0 -28
- package/dist/src/harness/workflow-sandbox.js +0 -2
- package/dist/src/harness/workflow-subagent-limit.d.ts +0 -28
- package/dist/src/harness/workflow-subagent-limit.js +0 -1
- package/dist/src/harness/workflow-task-state.d.ts +0 -9
- package/dist/src/harness/workflow-task-state.js +0 -1
- package/dist/src/harness/workflow-tool-description.d.ts +0 -22
- package/dist/src/harness/workflow-tool-description.js +0 -37
- package/dist/src/tools/workflow.d.ts +0 -37
- package/dist/src/tools/workflow.js +0 -1
- package/docs/guides/instrumentation-providers.md +0 -249
- 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
|
package/docs/guides/meta.json
CHANGED
|
@@ -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
|
-
|
|
142
|
+
## Trace propagation
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
|
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
|
|
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
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
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):
|
|
110
|
+
export function tenantBearerAuth(service: TenantService): ConnectionAuthProvider {
|
|
111
111
|
return {
|
|
112
|
-
|
|
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 });
|
package/docs/reference/cli.md
CHANGED
|
@@ -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.
|
|
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
|
|
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
|
|
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
|
|
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` |
|
|
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) · [
|
|
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
|
-
- [
|
|
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` | [
|
|
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`, `
|
|
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. `
|
|
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,
|
|
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` |
|
|
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 |
|
package/docs/subagents/index.mdx
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|