eve 0.64.0 → 0.65.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 +31 -0
- package/dist/src/channel/resolve-text.d.ts +11 -7
- package/dist/src/channel/resolve-text.js +1 -1
- package/dist/src/channel/types.d.ts +4 -5
- package/dist/src/chunks/{use-eve-agent-BdKlQF32.js → use-eve-agent-BIouJCii.js} +2 -10
- package/dist/src/chunks/{use-eve-agent-IIuxkn6y.js → use-eve-agent-BRvEh9sO.js} +2 -10
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.d.ts +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.js +1 -1
- package/dist/src/cli/dev/command-options.d.ts +1 -0
- package/dist/src/cli/dev/command.js +2 -2
- package/dist/src/cli/dev/local-server-process.js +1 -1
- package/dist/src/cli/dev/tui/blocks.d.ts +1 -1
- package/dist/src/cli/dev/tui/blocks.js +1 -1
- package/dist/src/cli/dev/tui/question-panel.d.ts +3 -2
- package/dist/src/cli/dev/tui/rail.d.ts +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +0 -1
- package/dist/src/cli/dev/tui/runner.js +2 -2
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +0 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +11 -12
- package/dist/src/cli/dev/tui/theme.d.ts +1 -1
- package/dist/src/cli/dev/tui/tool-presentation.d.ts +4 -4
- package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +0 -2
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -2
- package/dist/src/compiler/artifacts.d.ts +2 -0
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/bundled-extension.d.ts +17 -0
- package/dist/src/compiler/bundled-extension.js +1 -0
- package/dist/src/compiler/compile-agent.d.ts +4 -0
- package/dist/src/compiler/compile-agent.js +1 -1
- package/dist/src/compiler/compile-from-memory.js +1 -1
- package/dist/src/compiler/development-extensions.d.ts +23 -0
- package/dist/src/compiler/development-extensions.js +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +2 -2
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/load-binding-namespace.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest-types.d.ts +23 -0
- package/dist/src/compiler/normalize-manifest-types.js +1 -0
- package/dist/src/compiler/normalize-manifest.d.ts +2 -7
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/source-graph-paths.d.ts +2 -0
- package/dist/src/compiler/source-graph-paths.js +1 -0
- package/dist/src/compiler/source-graph.d.ts +4 -1
- package/dist/src/compiler/source-graph.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/discover/bundled-extension.d.ts +11 -0
- package/dist/src/discover/bundled-extension.js +1 -0
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/manifest.d.ts +5 -0
- package/dist/src/evals/assertions/collector.js +1 -1
- package/dist/src/evals/cli/eval.js +2 -2
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/types.d.ts +2 -0
- package/dist/src/execution/coordination-dispatch-step.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/node-step.d.ts +2 -4
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
- package/dist/src/execution/sandbox/development-lazy-prewarm.d.ts +7 -0
- package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -0
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/glob-tool.js +1 -1
- package/dist/src/execution/sandbox/grep-tool.js +1 -1
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/execution/sandbox/read-file.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session-workflow-tool-run.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/ask-question-workflow.d.ts +11 -0
- package/dist/src/execution/tools/ask-question-workflow.js +1 -0
- package/dist/src/execution/tools/ask-question.d.ts +20 -0
- package/dist/src/execution/tools/ask-question.js +2 -0
- package/dist/src/execution/tools/file-state.d.ts +1 -7
- package/dist/src/execution/tools/file-state.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/workflow/answer.d.ts +2 -0
- package/dist/src/execution/tools/workflow/answer.js +1 -1
- package/dist/src/execution/tools/workflow/ask.d.ts +3 -2
- package/dist/src/execution/tools/workflow/ask.js +1 -1
- package/dist/src/execution/tools/workflow/body.d.ts +5 -0
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/cancel.d.ts +0 -4
- package/dist/src/execution/tools/workflow/cancel.js +1 -1
- package/dist/src/execution/tools/workflow/start.d.ts +1 -0
- package/dist/src/execution/tools/workflow/start.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/compaction-prompt.d.ts +0 -6
- package/dist/src/harness/compaction-prompt.js +2 -2
- package/dist/src/harness/compaction.js +1 -1
- package/dist/src/harness/hitl/approval-input-requests.d.ts +0 -2
- package/dist/src/harness/hitl/approval-input-requests.js +1 -1
- package/dist/src/harness/input-extraction.d.ts +4 -15
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-request-class.d.ts +0 -20
- package/dist/src/harness/input-request-class.js +1 -1
- package/dist/src/harness/input-requests.d.ts +1 -1
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/pending-input-batches.d.ts +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +9 -1
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/stale-input-responses.d.ts +1 -2
- package/dist/src/harness/stale-input-responses.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tools.d.ts +0 -9
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/types.d.ts +2 -9
- package/dist/src/internal/application/compiled-artifacts.js +1 -1
- package/dist/src/internal/application/optional-package-install.d.ts +3 -0
- package/dist/src/internal/application/optional-package-install.js +2 -2
- package/dist/src/internal/application/output-publication-lock.d.ts +6 -0
- package/dist/src/internal/application/output-publication-lock.js +1 -1
- package/dist/src/internal/application/output-publication.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +1 -0
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/authored-runtime-modules.d.ts +1 -0
- package/dist/src/internal/development-programmatic-source-loader.d.ts +6 -0
- package/dist/src/internal/development-programmatic-source-loader.js +1 -0
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -0
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/dev-workspace-extensions.js +1 -1
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.d.ts +9 -0
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.js +2 -0
- package/dist/src/internal/nitro/host/prepare-application-host.d.ts +2 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/types.d.ts +3 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +0 -2
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/tools/ask-question.d.ts +1 -1
- package/dist/src/public/tools/ask-question.js +1 -1
- package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
- package/dist/src/runtime/cache-key.js +1 -1
- package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/instructions.js +6 -2
- package/dist/src/{cli/commands/registry-pnpm-build-policy.d.ts → setup/primitives/pm/pnpm-build-policy.d.ts} +4 -0
- package/dist/src/setup/primitives/pm/pnpm-build-policy.js +8 -0
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/input.d.ts +1 -6
- package/dist/src/shared/sandbox-provider.d.ts +2 -0
- package/dist/src/subagents/hitl-proxy.d.ts +11 -1
- package/dist/src/subagents/hitl-proxy.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/behavior.d.ts +2 -5
- package/dist/src/tools/definition.d.ts +23 -5
- package/dist/src/tools/provided/ask-question.d.ts +18 -0
- package/dist/src/tools/provided/ask-question.js +1 -0
- package/dist/src/tools/provided/sleep.d.ts +2 -2
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +11 -11
- package/docs/channels/slack.mdx +1 -1
- package/docs/concepts/built-in-tools.md +16 -66
- package/docs/concepts/default-harness.md +1 -3
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +2 -2
- package/docs/evals/assertions.mdx +2 -2
- package/docs/evals/judge.mdx +3 -3
- package/docs/getting-started.mdx +1 -1
- package/docs/guides/deployment/vercel.mdx +0 -6
- package/docs/guides/dev-tui.md +1 -1
- package/docs/guides/evaluate.md +12 -9
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/guides/instrumentation/instrumentation.mdx +1 -1
- package/docs/guides/instrumentation/migration.md +1 -6
- package/docs/guides/instrumentation/otel.mdx +15 -47
- package/docs/reference/cli.md +10 -7
- package/docs/reference/typescript-api.md +42 -41
- package/docs/sandbox/index.mdx +3 -1
- package/docs/sandbox/just-bash.mdx +6 -0
- package/docs/skills.mdx +2 -0
- package/docs/subagents/index.mdx +7 -5
- package/docs/tools/human-in-the-loop.md +22 -11
- package/docs/tools/workflows.mdx +44 -19
- package/docs/tutorial/guard-the-spend.mdx +1 -1
- package/package.json +1 -9
- package/dist/src/cli/commands/registry-pnpm-build-policy.js +0 -6
- package/dist/src/cli/dev/tui/todo-panel.d.ts +0 -44
- package/dist/src/cli/dev/tui/todo-panel.js +0 -1
- package/dist/src/compiled/@workflow/builders/LICENSE.md +0 -201
- package/dist/src/compiled/@workflow/builders/index.d.ts +0 -62
- package/dist/src/compiled/@workflow/builders/index.js +0 -1
- package/dist/src/execution/compaction.d.ts +0 -14
- package/dist/src/execution/compaction.js +0 -1
- package/dist/src/execution/sandbox/development-prewarm.d.ts +0 -20
- package/dist/src/execution/sandbox/development-prewarm.js +0 -1
- package/dist/src/execution/tools/todo.d.ts +0 -91
- package/dist/src/execution/tools/todo.js +0 -2
- package/dist/src/harness/hitl/question-input-requests.d.ts +0 -15
- package/dist/src/harness/hitl/question-input-requests.js +0 -1
- package/dist/src/harness/request-input-tool.d.ts +0 -4
- package/dist/src/harness/request-input-tool.js +0 -1
- package/dist/src/public/tools/todo.d.ts +0 -3
- package/dist/src/public/tools/todo.js +0 -1
- package/dist/src/tools/framework/ask-question.d.ts +0 -38
- package/dist/src/tools/framework/ask-question.js +0 -1
- package/dist/src/tools/provided/todo.d.ts +0 -8
- package/dist/src/tools/provided/todo.js +0 -2
package/docs/guides/evaluate.md
CHANGED
|
@@ -14,7 +14,8 @@ patch releases.
|
|
|
14
14
|
|
|
15
15
|
## Choose from Gateway models
|
|
16
16
|
|
|
17
|
-
By default, `auto` evaluates with `typesafe-ai/jev
|
|
17
|
+
By default, `auto` evaluates with `typesafe-ai/jev`, TypeSafe AI's
|
|
18
|
+
[Jev evaluation model](https://vercel.com/i/what-is-jev). Like other AI SDK
|
|
18
19
|
model strings, it uses Vercel AI Gateway unless the application has configured a
|
|
19
20
|
different global default provider.
|
|
20
21
|
|
|
@@ -25,8 +26,8 @@ import { auto } from "eve/models";
|
|
|
25
26
|
export default defineAgent({
|
|
26
27
|
model: auto({
|
|
27
28
|
options: {
|
|
28
|
-
"openai/gpt-
|
|
29
|
-
"openai/gpt-
|
|
29
|
+
"openai/gpt-6-sol": "Difficult reasoning and engineering tasks",
|
|
30
|
+
"openai/gpt-6-luna": "Routine tasks where fast completion matters",
|
|
30
31
|
},
|
|
31
32
|
}),
|
|
32
33
|
});
|
|
@@ -38,7 +39,7 @@ Gateway evaluator uses the same connection selected through `/login` as Gateway
|
|
|
38
39
|
language models. A configured AI SDK default provider still owns string model
|
|
39
40
|
resolution during development. The TUI footer displays `dynamic model` when the
|
|
40
41
|
agent uses `auto`, then adds the resolved model for the current turn, such as
|
|
41
|
-
`dynamic model · openai/gpt-
|
|
42
|
+
`dynamic model · openai/gpt-6-luna`.
|
|
42
43
|
|
|
43
44
|
## Use a provider directly
|
|
44
45
|
|
|
@@ -58,8 +59,8 @@ export default defineAgent({
|
|
|
58
59
|
model: auto({
|
|
59
60
|
model: typeSafeAi.evaluationModel("jev-latest"),
|
|
60
61
|
options: {
|
|
61
|
-
"openai/gpt-
|
|
62
|
-
"openai/gpt-
|
|
62
|
+
"openai/gpt-6-sol": "Difficult reasoning and engineering tasks",
|
|
63
|
+
"openai/gpt-6-luna": "Routine tasks where fast completion matters",
|
|
63
64
|
},
|
|
64
65
|
}),
|
|
65
66
|
});
|
|
@@ -83,7 +84,7 @@ export default defineAgent({
|
|
|
83
84
|
reasoning: "medium",
|
|
84
85
|
model: auto({
|
|
85
86
|
options: {
|
|
86
|
-
"openai/gpt-
|
|
87
|
+
"openai/gpt-6-sol": "Hard problems",
|
|
87
88
|
my_secret_model: {
|
|
88
89
|
model: anthropic("sonnet-5"),
|
|
89
90
|
description: "Routine work that can use the direct Anthropic provider",
|
|
@@ -141,7 +142,7 @@ export default defineTool({
|
|
|
141
142
|
|
|
142
143
|
The choice above is typed as `"billing" | "support"`. Each question appears under
|
|
143
144
|
its authored key in `result.answers`. Results also include token usage, warnings,
|
|
144
|
-
provider metadata, and response metadata. To use that choice to delegate while keeping specialist subagents out of the parent model's tools, see [Route to a hidden subagent with
|
|
145
|
+
provider metadata, and response metadata. To use that choice to delegate while keeping specialist subagents out of the parent model's tools, see [Route to a hidden subagent with Jev](/docs/tools/workflows#route-to-a-hidden-subagent-with-jev).
|
|
145
146
|
|
|
146
147
|
`evaluate` accepts AI SDK evaluation options, including `maxRetries`, `headers`,
|
|
147
148
|
and `providerOptions`. Pass an `abortSignal` to cancel the request. Input and
|
|
@@ -178,7 +179,9 @@ export default defineTool({
|
|
|
178
179
|
The evaluation model reviews the tool name and input for dangerous effects. A
|
|
179
180
|
caution, failed review, or incomplete input requires human approval. See
|
|
180
181
|
[Human-in-the-loop approvals](/docs/human-in-the-loop#approvals) for classifier
|
|
181
|
-
options and data handling
|
|
182
|
+
options and data handling, and the
|
|
183
|
+
[Auto-approve tool calls with Jev](https://vercel.com/kb/guide/auto-approve-tool-calls-eve-jev)
|
|
184
|
+
guide for an end-to-end walkthrough.
|
|
182
185
|
|
|
183
186
|
## Runtime behavior
|
|
184
187
|
|
|
@@ -218,7 +218,7 @@ received attachment as a `file` part on the user message. The part includes `med
|
|
|
218
218
|
|
|
219
219
|
## Human-in-the-loop prompts
|
|
220
220
|
|
|
221
|
-
Tools opt into approval with `approval`, and the
|
|
221
|
+
Tools opt into approval with `approval`, and workflow tools such as the opt-in `ask_question` tool ask the user a question with `ctx.ask()` — see [Human-in-the-loop](/docs/human-in-the-loop) for the server-side model. Either way the stream emits an `input.requested` event, and the pending request rides on a `dynamic-tool` part at `part.toolMetadata?.eve?.inputRequest`. Scan every message because an unrelated turn can add newer messages while an approval stays open, then answer through the same session with `respond()`:
|
|
222
222
|
|
|
223
223
|
```tsx
|
|
224
224
|
const pendingRequests = agent.data.messages
|
|
@@ -159,6 +159,6 @@ not depend on execution order. Use `flush` to drain buffered records and
|
|
|
159
159
|
## What to read next
|
|
160
160
|
|
|
161
161
|
- [Migrate instrumentation](/docs/observability/instrumentation-migration): replace `agent/instrumentation.ts`.
|
|
162
|
-
- [OpenTelemetry](/docs/observability/otel): configure OTel destinations and
|
|
162
|
+
- [OpenTelemetry](/docs/observability/otel): configure OTel destinations and third-party exports.
|
|
163
163
|
- [Local development](../guides/dev-tui): inspect local traces in the TUI
|
|
164
164
|
- [Hooks](../guides/hooks): react to runtime events outside the instrumentation lifecycle
|
|
@@ -89,9 +89,4 @@ see
|
|
|
89
89
|
Run `eve build`. A remaining `agent/instrumentation.ts` fails the build with a
|
|
90
90
|
message directing you to the instrumentation directory.
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
project needs at least one sampling rule with a rate above 0%; we recommend
|
|
94
|
-
setting the rate to 100%. See
|
|
95
|
-
[Enable tracing on Vercel](/docs/observability/otel#enable-tracing-on-vercel).
|
|
96
|
-
|
|
97
|
-
Then run the agent and verify each destination independently.
|
|
92
|
+
Run the agent and verify each destination independently.
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "OpenTelemetry"
|
|
3
|
-
description: "Configure OpenTelemetry destinations, content capture, and
|
|
3
|
+
description: "Configure OpenTelemetry destinations, content capture, and third-party exports."
|
|
4
4
|
url: "/observability/otel"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
eve
|
|
8
|
-
`
|
|
9
|
-
to Vercel Agent Runs by default. You do not need `otel()` or
|
|
10
|
-
`otelIntegration()` to use these defaults.
|
|
7
|
+
`eve dev` records local traces automatically. You do not need `otel()` or
|
|
8
|
+
`localTraces()` to use this default.
|
|
11
9
|
|
|
12
10
|
## Configure OpenTelemetry
|
|
13
11
|
|
|
@@ -118,11 +116,7 @@ lineage and trace-content policy. See [Remote agents](../guides/remote-agents#pr
|
|
|
118
116
|
Use `gen_ai.conversation.id` to find the traces for one conversation in your
|
|
119
117
|
destination's span-search surface.
|
|
120
118
|
|
|
121
|
-
##
|
|
122
|
-
|
|
123
|
-
Instrumentation has two environment-specific defaults.
|
|
124
|
-
|
|
125
|
-
### Local traces
|
|
119
|
+
## Local traces
|
|
126
120
|
|
|
127
121
|
`eve dev` records local traces by default. Omitting
|
|
128
122
|
`agent/instrumentation/local.ts` preserves that default. Export
|
|
@@ -134,42 +128,16 @@ import { disableInstrumentation } from "eve/instrumentation";
|
|
|
134
128
|
export default disableInstrumentation();
|
|
135
129
|
```
|
|
136
130
|
|
|
137
|
-
### Vercel Agent Runs
|
|
138
|
-
|
|
139
|
-
Preview and production deployments export to Vercel Agent Runs by default.
|
|
140
|
-
Omitting `agent/instrumentation/agent-runs.ts` preserves that default. Export
|
|
141
|
-
`agentRuns(...)` from that file to reconfigure it, or export
|
|
142
|
-
`disableInstrumentation()` to disable it.
|
|
143
|
-
|
|
144
|
-
## Enable tracing on Vercel
|
|
145
|
-
|
|
146
|
-
A deployed eve project needs at least one
|
|
147
|
-
[sampling rule with a rate above 0%](https://vercel.com/docs/tracing/always-on-tracing#enable-always-on-tracing)
|
|
148
|
-
before Vercel collects traces. We recommend setting the rate to **100%** for
|
|
149
|
-
eve projects so every matching request is traced.
|
|
150
|
-
|
|
151
|
-
Select your team and project, then open
|
|
152
|
-
[**Settings → Tracing**](https://vercel.com/d?to=%2F%5Bteam%5D%2F%5Bproject%5D%2Fsettings%2Ftracing&title=Go+to+Tracing+settings):
|
|
153
|
-
|
|
154
|
-
1. Select **Add Sampling Rule**.
|
|
155
|
-
2. Choose **All Environments**, **Production**, or **Preview**.
|
|
156
|
-
3. Set **Rate** to `100%`.
|
|
157
|
-
4. Select **Save**.
|
|
158
|
-
|
|
159
|
-
Tracing starts as soon as you save the rule. You can also manage sampling
|
|
160
|
-
rules with [`vercel traces config`](https://vercel.com/docs/cli/traces#manage-trace-sampling-rules).
|
|
161
|
-
The CLI accepts rates from 1 to 100%; add a 0% rule from the dashboard.
|
|
162
|
-
|
|
163
131
|
## Filter a destination
|
|
164
132
|
|
|
165
|
-
`otelIntegration()
|
|
133
|
+
`otelIntegration()` and `localTraces()` accept one
|
|
166
134
|
`exportPolicy` object or an array applied in order. Each policy filters spans
|
|
167
135
|
and attributes before that destination's processors receive them:
|
|
168
136
|
|
|
169
|
-
```ts title="agent/instrumentation/
|
|
170
|
-
import {
|
|
137
|
+
```ts title="agent/instrumentation/local.ts"
|
|
138
|
+
import { localTraces } from "eve/instrumentation/otel";
|
|
171
139
|
|
|
172
|
-
export default
|
|
140
|
+
export default localTraces({
|
|
173
141
|
exportPolicy: {
|
|
174
142
|
span: ({ name }) => ({ emit: name !== "internal.cache.refresh" }),
|
|
175
143
|
attribute: ({ key }) => (key === "customer.id" ? { emit: false } : { emit: true }),
|
|
@@ -188,17 +156,17 @@ A throwing `span` callback drops the span from this destination. Return
|
|
|
188
156
|
`{ replace: true, value }` from `attribute` to retain, remove, or change
|
|
189
157
|
one attribute.
|
|
190
158
|
|
|
191
|
-
###
|
|
159
|
+
### Redact content from local traces
|
|
192
160
|
|
|
193
|
-
Return a redaction decision to further narrow what
|
|
161
|
+
Return a redaction decision to further narrow what the local trace destination
|
|
194
162
|
receives after the process-wide `otel({ tracePolicy })` has admitted a trace.
|
|
195
|
-
For example, keep
|
|
196
|
-
outputs unless the session is public:
|
|
163
|
+
For example, keep spans in the local trace viewer while redacting their inputs
|
|
164
|
+
and outputs unless the session is public:
|
|
197
165
|
|
|
198
|
-
```ts title="agent/instrumentation/
|
|
199
|
-
import {
|
|
166
|
+
```ts title="agent/instrumentation/local.ts"
|
|
167
|
+
import { localTraces } from "eve/instrumentation/otel";
|
|
200
168
|
|
|
201
|
-
export default
|
|
169
|
+
export default localTraces({
|
|
202
170
|
exportPolicy: {
|
|
203
171
|
span: ({ audience }) =>
|
|
204
172
|
audience === "public" ? { emit: true } : { redact: true, inputs: true, outputs: true },
|
package/docs/reference/cli.md
CHANGED
|
@@ -59,12 +59,12 @@ Existing packages do not need a target-selection prompt: run `eve init` from the
|
|
|
59
59
|
|
|
60
60
|
After scaffolding in an interactive human terminal, eve opens the TUI directly. Pass `-n` or `--non-interactive` to return after scaffolding instead. It still installs dependencies and follows the normal Git setup behavior. Noninteractive and coding-agent invocations return without starting an interactive session. Fresh projects use the parent workspace's package manager when there is one; otherwise they use the manager that launched `eve init`.
|
|
61
61
|
|
|
62
|
-
| Flag | Type | Default
|
|
63
|
-
| ----------------------- | ------ |
|
|
64
|
-
| `--model <model>` | string | `openai/gpt-
|
|
65
|
-
| `--reasoning <effort>` | enum | provider default
|
|
66
|
-
| `--channel-web-nextjs` | flag | off
|
|
67
|
-
| `-n, --non-interactive` | flag | off
|
|
62
|
+
| Flag | Type | Default | Description |
|
|
63
|
+
| ----------------------- | ------ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
|
|
64
|
+
| `--model <model>` | string | `openai/gpt-6-luna-fast` | Set the root agent's AI Gateway model ID. |
|
|
65
|
+
| `--reasoning <effort>` | enum | provider default | Set reasoning to `none`, `minimal`, `low`, `medium`, `high`, or `xhigh`. `provider-default` leaves the field unauthored. |
|
|
66
|
+
| `--channel-web-nextjs` | flag | off | Add the Web Chat app (Next.js). Not for existing projects — run `eve add channel/web` there instead. |
|
|
67
|
+
| `-n, --non-interactive` | flag | off | Scaffold and install dependencies without starting development. |
|
|
68
68
|
|
|
69
69
|
## `eve extension`
|
|
70
70
|
|
|
@@ -102,7 +102,7 @@ Change the root agent's AI Gateway model and reasoning effort without opening th
|
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
104
|
eve set \
|
|
105
|
-
--model openai/gpt-
|
|
105
|
+
--model openai/gpt-6-sol \
|
|
106
106
|
--reasoning high
|
|
107
107
|
```
|
|
108
108
|
|
|
@@ -223,6 +223,7 @@ Pass a bare URL and the UI connects to that server instead of booting a local on
|
|
|
223
223
|
| `-u, --url <url>` | string | none | Connect to an existing server URL instead of starting one |
|
|
224
224
|
| `-H, --header <header>` | string | none | Request header for a URL target, in `Name: value` form; repeat for multiple headers |
|
|
225
225
|
| `--no-ui` | flag | UI on | Start the server without an interactive UI |
|
|
226
|
+
| `--no-default-extensions` | flag | extensions on | Do not mount bundled development extensions |
|
|
226
227
|
| `--name <name>` | string | app folder name | Title shown in the terminal UI |
|
|
227
228
|
| `--input <text>` | string | none | Pre-fill the prompt input |
|
|
228
229
|
| `--tools <mode>` | enum | `auto-collapsed` | Tool-call rendering: `full` \| `collapsed` \| `auto-collapsed` \| `hidden` |
|
|
@@ -233,6 +234,8 @@ Pass a bare URL and the UI connects to that server instead of booting a local on
|
|
|
233
234
|
| `--context-size <tokens>` | number | none | Model context window size, shown as a usage percentage |
|
|
234
235
|
| `--logs <mode>` | enum | `stderr` | Server/agent logs to show: `all` \| `stderr` \| `sandbox` \| `none` |
|
|
235
236
|
|
|
237
|
+
Local development mounts bundled development extensions without adding files to your project. The default set includes the self-modification extension and its `self-modification__agent` subagent. Pass `--no-default-extensions` to disable the complete set for that server.
|
|
238
|
+
|
|
236
239
|
`eve acp` reserves stdin and stdout for newline-delimited JSON-RPC and sends diagnostics to stderr. Without a URL, it supervises an isolated local development server. With a URL, it bridges ACP to that server's existing eve HTTP API and accepts the same URL credentials and request headers as `eve dev <url>`. Pass `--scope <team>` when the active Vercel scope does not own the deployment; `EVE_VERCEL_SCOPE` provides the same value for managed harnesses. See [Agent Client Protocol (ACP)](../protocols/acp) for client configuration and capability limits.
|
|
237
240
|
|
|
238
241
|
A fresh `eve init` opens the TUI and reuses an available model connection or opens `/login`. No Vercel project, channels, integrations, or review step is required before chat. Use `/model` to change models and settings, and `/add` to install an addition. Other `--input` text stays editable in the prompt. See [Terminal UI](../guides/dev-tui) for credential precedence and login options.
|
|
@@ -12,7 +12,7 @@ Most files look the same: import a helper, default-export the result.
|
|
|
12
12
|
```ts title="agent/agent.ts"
|
|
13
13
|
import { defineAgent } from "eve";
|
|
14
14
|
|
|
15
|
-
export default defineAgent({ model: "anthropic/claude-opus-
|
|
15
|
+
export default defineAgent({ model: "anthropic/claude-opus-5.5" });
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
```ts title="agent/tools/get_weather.ts"
|
|
@@ -113,56 +113,57 @@ Tool definitions accept `availableInSubagents: false` to restrict the tool to to
|
|
|
113
113
|
|
|
114
114
|
## Imports at a glance
|
|
115
115
|
|
|
116
|
-
| Import
|
|
117
|
-
|
|
|
118
|
-
| `eve`
|
|
119
|
-
| `eve/tools`
|
|
120
|
-
| `eve/tools/{bash,read_file,write_file,
|
|
121
|
-
| `eve/tools/approval`
|
|
122
|
-
| `eve/tools/
|
|
123
|
-
| `eve/tools/
|
|
124
|
-
| `eve/tools/
|
|
125
|
-
| `eve/
|
|
126
|
-
| `eve/
|
|
127
|
-
| `eve/channels
|
|
128
|
-
| `eve/channels/
|
|
129
|
-
| `eve/channels/
|
|
130
|
-
| `eve/
|
|
131
|
-
| `eve/
|
|
132
|
-
| `eve/
|
|
133
|
-
| `eve/
|
|
134
|
-
| `eve/
|
|
135
|
-
| `eve/memory
|
|
136
|
-
| `eve/memory/
|
|
137
|
-
| `eve/memory/file
|
|
138
|
-
| `eve/
|
|
139
|
-
| `eve/
|
|
140
|
-
| `eve/
|
|
141
|
-
| `eve/instrumentation
|
|
142
|
-
| `eve/
|
|
143
|
-
|
|
|
144
|
-
| `eve/models/
|
|
145
|
-
| `eve/models/
|
|
146
|
-
|
|
|
147
|
-
| `eve/
|
|
148
|
-
| `eve/evals
|
|
149
|
-
| `eve/evals/
|
|
150
|
-
| `eve/evals/
|
|
151
|
-
| `eve/
|
|
152
|
-
| `eve/
|
|
153
|
-
|
|
|
116
|
+
| Import | Holds |
|
|
117
|
+
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
118
|
+
| `eve` | `defineAgent`, `defineRemoteAgent`, `defineDynamic`, agent config types |
|
|
119
|
+
| `eve/tools` | `defineTool`, `defineWorkflowTool`, `defineDurableCallback`, `defineDurableSchema`, `defineDynamic`, `disableTool`, tool types |
|
|
120
|
+
| `eve/tools/{bash,read_file,write_file,web_fetch,load_skill,glob,grep}` | Individual reusable tool definitions |
|
|
121
|
+
| `eve/tools/approval` | Approval types and `auto`, `always`, `once`, `never` |
|
|
122
|
+
| `eve/tools/ask_question` | Opt-in `askQuestion` tool factory |
|
|
123
|
+
| `eve/tools/web_search` | Provider-managed `webSearch` configuration |
|
|
124
|
+
| `eve/tools/workflow` | Runtime-generated `workflow` tool factory |
|
|
125
|
+
| `eve/tools/sleep` | Opt-in durable `sleep` tool |
|
|
126
|
+
| `eve/connections` | `defineMcpClientConnection`, `defineOpenAPIConnection`, `defineDynamic` |
|
|
127
|
+
| `eve/channels` | `defineChannel`, `disableRoute`, route verbs |
|
|
128
|
+
| `eve/channels/eve` | `eveChannel` |
|
|
129
|
+
| `eve/channels/auth` | `localDev`, `vercelOidc`, `placeholderAuth` |
|
|
130
|
+
| `eve/channels/{slack,discord,teams,telegram,twilio,github}` | platform channel factories |
|
|
131
|
+
| `eve/hooks` | `defineHook` |
|
|
132
|
+
| `eve/schedules` | `defineSchedule` |
|
|
133
|
+
| `eve/skills` | `defineSkill`, `defineDynamic` |
|
|
134
|
+
| `eve/instructions` | `defineInstructions`, `defineDynamic` |
|
|
135
|
+
| `eve/memory` | `defineMemory`, `defineMemoryProvider`, provider and lifecycle types |
|
|
136
|
+
| `eve/memory/scope` | `byPrincipal` and memory scope helpers |
|
|
137
|
+
| `eve/memory/file` | `fileMemory`, `inMemory`, and the conditional document backend contract |
|
|
138
|
+
| `eve/memory/file/vercel` | `vercelBlob` and Vercel Blob backend options |
|
|
139
|
+
| `eve/context` | `defineState`, session and state types |
|
|
140
|
+
| `eve/sandbox` | `defineSandbox`, provider environments, and sandbox session types |
|
|
141
|
+
| `eve/instrumentation` | `defineInstrumentation`, `disableInstrumentation`, `isChannel`, lifecycle provider types |
|
|
142
|
+
| `eve/instrumentation/otel` | `otel`, `otelIntegration`, `localTraces`, OpenTelemetry policy types |
|
|
143
|
+
| `eve/local-dev` | `getLocalDevCapability`, `LocalDevCapability` |
|
|
144
|
+
| [`eve/models`](../guides/evaluate) | Automatic model selection with `auto` |
|
|
145
|
+
| `eve/models/openai` | `openai`, `chatgpt`, deprecated `experimental_chatgpt` |
|
|
146
|
+
| `eve/models/anthropic` | `anthropic` |
|
|
147
|
+
| [`eve/ai`](../guides/evaluate#evaluate-inside-a-tool) | Standalone `evaluate` |
|
|
148
|
+
| `eve/evals` | `defineEval`, `defineEvalConfig`, `mockModel`, eval types |
|
|
149
|
+
| `eve/evals/expect` | `includes`, `equals`, `matches`, `similarity` |
|
|
150
|
+
| `eve/evals/reporters` | `Braintrust`, `JUnit`, `EvalReporter` |
|
|
151
|
+
| `eve/evals/loaders` | `loadJson`, `loadYaml` |
|
|
152
|
+
| `eve/react`, `eve/vue`, `eve/svelte` | `useEveAgent` |
|
|
153
|
+
| `eve/next`, `eve/nuxt`, `eve/sveltekit` | framework bundler plugins |
|
|
154
|
+
| [`eve/client`](../guides/client/overview) | `Client`, `ClientSession`, health and agent-info schemas, response errors |
|
|
154
155
|
|
|
155
156
|
Exported types ship from the same entrypoint as the helper they describe (for example `ToolDefinition` and `ToolContext` from `eve/tools`). The `exports` field in `packages/eve/package.json` lists every public entrypoint.
|
|
156
157
|
|
|
157
158
|
## Direct provider models
|
|
158
159
|
|
|
159
|
-
`openai(model?)` from `eve/models/openai` and `anthropic(model?)` from `eve/models/anthropic` return eve-owned model instances using the vendored providers. They accept only an optional model ID. Defaults are `gpt-
|
|
160
|
+
`openai(model?)` from `eve/models/openai` and `anthropic(model?)` from `eve/models/anthropic` return eve-owned model instances using the vendored providers. They accept only an optional model ID. Defaults are `gpt-6-luna-fast` and `claude-sonnet-5`, respectively.
|
|
160
161
|
|
|
161
162
|
Use `/login` for local credentials, or set `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`. Local secret-store discovery is disabled in deployments; provision server credentials explicitly. See [Set the model](../agent-config#set-the-model) for an example.
|
|
162
163
|
|
|
163
164
|
## ChatGPT subscription models
|
|
164
165
|
|
|
165
|
-
`chatgpt()` from `eve/models/openai` serves an OpenAI model through your local ChatGPT login and bills the ChatGPT subscription. With no argument, it selects `gpt-
|
|
166
|
+
`chatgpt()` from `eve/models/openai` serves an OpenAI model through your local ChatGPT login and bills the ChatGPT subscription. With no argument, it selects `gpt-6-luna-fast`:
|
|
166
167
|
|
|
167
168
|
```ts title="agent/agent.ts"
|
|
168
169
|
import { defineAgent } from "eve";
|
package/docs/sandbox/index.mdx
CHANGED
|
@@ -80,7 +80,9 @@ export default defineSandbox(() => environment.open());
|
|
|
80
80
|
|
|
81
81
|
eve runs `prepare` while creating a reusable provider artifact, not once for each live session sandbox. Vercel captures a snapshot; Docker captures an image; microsandbox captures a VM snapshot; and just-bash captures a filesystem template.
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
During `eve dev`, startup and authored-source rebuilds do not prepare sandbox environments. The first sandbox access prepares all environments in that compiled generation before opening the requested sandbox. This includes environments declared by subagents and extensions, even if they use different providers. Concurrent requests share the preparation work; a failed preparation can be retried on a later access. Optional provider installation and setup can make that first access slow.
|
|
84
|
+
|
|
85
|
+
`eve build` still prepares environments eagerly. In production, eve passes the recorded artifact directly to the provider when it creates a live sandbox. Production runtime does not rebuild or repair a missing artifact. A missing image, snapshot, or template fails with rebuild or redeploy guidance.
|
|
84
86
|
|
|
85
87
|
### Reuse native resources across sessions
|
|
86
88
|
|
|
@@ -15,4 +15,10 @@ export default defineSandbox(() => environment.open());
|
|
|
15
15
|
|
|
16
16
|
just-bash can prepare and persist its virtual filesystem. It cannot use OCI images or Dockerfiles, does not run native processes, and provides no network isolation. The session does not expose `setNetworkPolicy()`.
|
|
17
17
|
|
|
18
|
+
## Automatic installation
|
|
19
|
+
|
|
20
|
+
When an environment uses just-bash during `eve dev`, eve installs the package into your application if it is missing, unless you set `autoInstall: false` in the environment options. `DefaultSandbox` selects only one provider, but another environment, such as local self-modification, can use just-bash independently. Other environments require you to install the package yourself.
|
|
21
|
+
|
|
22
|
+
For pnpm projects, automatic installation adds `@mongodb-js/zstd` and `node-liblzma` to `ignoredOptionalDependencies` in the owning `pnpm-workspace.yaml` when they have no explicit package policy. These optional native codecs are not needed for basic shell and filesystem operations. Commands that require those codecs may be unavailable without them. eve preserves existing package-specific build decisions and does not automatically approve build scripts.
|
|
23
|
+
|
|
18
24
|
See the [sandbox overview](/docs/sandbox) for managed workspace, skills, parent inheritance, and custom providers.
|
package/docs/skills.mdx
CHANGED
|
@@ -91,6 +91,8 @@ The handle exposes the skill's `name` and `file(relativePath)`; file content is
|
|
|
91
91
|
|
|
92
92
|
To serve a different skill per principal, tenant, or channel (the caller's own team playbook, say), wrap `defineSkill` in a `defineDynamic` resolver keyed on `ctx.session.auth`. See [Dynamic capabilities](./guides/dynamic-capabilities).
|
|
93
93
|
|
|
94
|
+
Subagent lifecycle events do not re-run skill resolvers. The parent's resolved dynamic skills remain available when it resumes after delegation.
|
|
95
|
+
|
|
94
96
|
## What to read next
|
|
95
97
|
|
|
96
98
|
- [Connections](./connections): add tools from external MCP and OpenAPI servers
|
package/docs/subagents/index.mdx
CHANGED
|
@@ -63,7 +63,7 @@ To prevent the root session from delegating to a fresh copy of itself, set `tool
|
|
|
63
63
|
import { defineAgent } from "eve";
|
|
64
64
|
|
|
65
65
|
export default defineAgent({
|
|
66
|
-
model: "anthropic/claude-opus-
|
|
66
|
+
model: "anthropic/claude-opus-5.5",
|
|
67
67
|
tool: false,
|
|
68
68
|
});
|
|
69
69
|
```
|
|
@@ -79,7 +79,7 @@ import { defineAgent } from "eve";
|
|
|
79
79
|
|
|
80
80
|
export default defineAgent({
|
|
81
81
|
description: "Investigate ambiguous questions before the parent agent responds.",
|
|
82
|
-
model: "anthropic/claude-opus-
|
|
82
|
+
model: "anthropic/claude-opus-5.5",
|
|
83
83
|
});
|
|
84
84
|
```
|
|
85
85
|
|
|
@@ -90,7 +90,7 @@ import { defineAgent } from "eve";
|
|
|
90
90
|
|
|
91
91
|
export default defineAgent({
|
|
92
92
|
description: "Investigate ambiguous questions for the routing workflow.",
|
|
93
|
-
model: "anthropic/claude-opus-
|
|
93
|
+
model: "anthropic/claude-opus-5.5",
|
|
94
94
|
tool: false,
|
|
95
95
|
});
|
|
96
96
|
```
|
|
@@ -103,6 +103,8 @@ Every declared local or remote subagent runs as a durable background task: the c
|
|
|
103
103
|
|
|
104
104
|
A mounted extension can also contribute declared subagents from `extension/subagents/`. The mount namespace prefixes the subagent visible to the consuming agent node: mounting an extension as `crm` exposes its `reviewer` subagent as `crm__reviewer`. The contributed subagent keeps its own isolated tools, connections, skills, hooks, instructions, sandbox, and nested subagents, and its modules can read configuration from the extension handle. See [Extensions](./extensions#add-a-subagent) for the authoring and override behavior.
|
|
105
105
|
|
|
106
|
+
Local `eve dev` mounts the bundled self-modification extension by default, which exposes the `self-modification__agent` subagent without adding files to your project. An authored extension mounted as `self-modification` takes its place. Pass `--no-default-extensions` to run without bundled development extensions. Production builds do not include development extensions unless you mount them in your agent.
|
|
107
|
+
|
|
106
108
|
### Vercel workspace peers
|
|
107
109
|
|
|
108
110
|
In a Vercel agent workspace, expose one other workspace member as a remote subagent with `defineWorkspaceAgent`. Create an ordinary file under the caller's `agent/subagents/` directory. Its filename gives the model-visible tool name; `name` identifies the peer under `agents/`.
|
|
@@ -149,7 +151,7 @@ export default defineDynamic({
|
|
|
149
151
|
ctx.session.auth.current?.attributes.research === true
|
|
150
152
|
? defineAgent({
|
|
151
153
|
description: "Investigate ambiguous questions before the parent responds.",
|
|
152
|
-
model: "anthropic/claude-opus-
|
|
154
|
+
model: "anthropic/claude-opus-5.5",
|
|
153
155
|
})
|
|
154
156
|
: null,
|
|
155
157
|
},
|
|
@@ -172,7 +174,7 @@ export default defineDynamic({
|
|
|
172
174
|
"session.started": () =>
|
|
173
175
|
defineAgent({
|
|
174
176
|
description: "Use a native package when handling delegated work.",
|
|
175
|
-
model: "anthropic/claude-opus-
|
|
177
|
+
model: "anthropic/claude-opus-5.5",
|
|
176
178
|
}),
|
|
177
179
|
},
|
|
178
180
|
});
|
|
@@ -39,7 +39,7 @@ export default defineTool({
|
|
|
39
39
|
|
|
40
40
|
By default, omitted `approval` behaves like `never()`, so tool calls may execute without human approval. Require human approval or other safeguards for sensitive, irreversible, regulated, financial, healthcare, employment, housing, legal, safety-impacting, user-impacting, or external side-effecting actions.
|
|
41
41
|
|
|
42
|
-
`auto()` uses an [AI SDK evaluation model](/docs/guides/evaluate) to classify each call as `clear` or `caution`. It defaults to `typesafe-ai/jev
|
|
42
|
+
`auto()` uses an [AI SDK evaluation model](/docs/guides/evaluate) to classify each call as `clear` or `caution`. It defaults to `typesafe-ai/jev`, TypeSafe AI's [Jev evaluation model](https://vercel.com/i/what-is-jev). Like `evaluate`, a model string uses Vercel AI Gateway unless the application configures a global AI SDK default provider:
|
|
43
43
|
|
|
44
44
|
```ts
|
|
45
45
|
approval: auto({ model: "typesafe-ai/jev" });
|
|
@@ -150,27 +150,38 @@ export default defineTool({
|
|
|
150
150
|
|
|
151
151
|
## Questions
|
|
152
152
|
|
|
153
|
-
The
|
|
153
|
+
The `ask_question` tool lets the model pause and ask the user one question, rather than guessing. The model calls it with `{ question, options? }`:
|
|
154
154
|
|
|
155
|
-
- `
|
|
156
|
-
- `options`:
|
|
157
|
-
- `allowFreeform`: whether the user may answer with free text instead of picking an option.
|
|
155
|
+
- `question`: the question to put to the user, with the context needed to answer it.
|
|
156
|
+
- `options`: two or three mutually exclusive choices, each with a `label` and a one-sentence `description`. Channels render these as buttons or a select menu. Omit `options` for an open-ended question.
|
|
158
157
|
|
|
159
|
-
|
|
158
|
+
The user can always type their own answer instead of picking an option, so the model never needs an "Other" option. The tool returns `{ status: "answered", answer }` with the chosen option's label or the user's words, `{ status: "dismissed" }` when the user moved on without answering, or `{ status: "unavailable" }` when the session cannot request input.
|
|
159
|
+
|
|
160
|
+
`ask_question` is an [opt-in framework tool](/docs/concepts/built-in-tools#ask_question). Add it with `eve add tool/ask_question`, which creates this file:
|
|
161
|
+
|
|
162
|
+
```ts title="agent/tools/ask_question.ts"
|
|
163
|
+
import { askQuestion } from "eve/tools/ask_question";
|
|
164
|
+
|
|
165
|
+
export default askQuestion();
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
`ask_question` is an ordinary [workflow tool](/docs/tools/workflows) built on `ctx.ask()`. Write your own workflow tool with `ctx.ask()` when you need a different schema or want to act on the answer in the same call. Without any asking tool, the model asks in its reply text and the user's next message carries the answer.
|
|
160
169
|
|
|
161
170
|
## How pause and resume works
|
|
162
171
|
|
|
163
172
|
Approvals and questions share one protocol:
|
|
164
173
|
|
|
165
|
-
1.
|
|
174
|
+
1. A tool call needs approval, or a workflow tool such as `ask_question` calls `ctx.ask()`.
|
|
166
175
|
2. eve emits an `input.requested` stream event carrying the pending requests.
|
|
167
176
|
3. The turn parks at `session.waiting`, durably, for as long as it takes.
|
|
168
177
|
4. The client answers with `inputResponses` (structured, keyed by `requestId`) or a normal follow-up `message`. A follow-up whose text matches an option ID, option label, or numeric option index resolves automatically, including approval options such as `approve` and `cancel`.
|
|
169
178
|
|
|
179
|
+
For `ctx.ask()` questions from blocking tools, a follow-up message answers the question only when exactly one question is pending. The message must match an option, or the question must allow free text. Otherwise the message reaches the model as a normal turn, and each pending question created with `dismissible: true` resolves as `dismissed`. Questions from background tools and subagents need a structured response.
|
|
180
|
+
|
|
170
181
|
Each request includes a `kind` discriminator: `tool-approval`, `question`, or
|
|
171
|
-
`session-limit`. Clients should use `kind` to choose behavior and presentation
|
|
172
|
-
`
|
|
173
|
-
semantics.
|
|
182
|
+
`session-limit`. Clients should use `kind` to choose behavior and presentation.
|
|
183
|
+
`requestId` identifies the request to answer, and `action.callId` identifies the
|
|
184
|
+
tool call that raised it; neither encodes the request's semantics.
|
|
174
185
|
|
|
175
186
|
The run picks back up exactly where it parked. Because the pause is durable, nothing is held in memory while it waits — the process can restart and the parked turn survives.
|
|
176
187
|
|
|
@@ -189,7 +200,7 @@ From your own frontend, scan all messages for pending requests and answer throug
|
|
|
189
200
|
## What to read next
|
|
190
201
|
|
|
191
202
|
- [Tools](/docs/tools): define the typed actions an approval gates
|
|
192
|
-
- [Built-in tools](/docs/concepts/built-in-tools): the default tools
|
|
203
|
+
- [Built-in tools](/docs/concepts/built-in-tools): the default tools and opt-in tools such as `ask_question`
|
|
193
204
|
- [Sessions, runs & streaming](/docs/concepts/sessions-runs-and-streaming): the event and resume contract behind the pause
|
|
194
205
|
- [Building a frontend](/docs/guides/frontend/overview): render and answer requests from your own UI
|
|
195
206
|
- [Multi-tenant approvals](/docs/patterns/multi-tenant-approvals): resolve per-tenant approval policy for authored and connection tools
|