eve 0.52.1 → 0.52.3
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 +40 -0
- package/dist/src/channel/types.d.ts +1 -0
- package/dist/src/chunks/{use-eve-agent-CxkGSusZ.js → use-eve-agent-BR8EpIOX.js} +46 -19
- package/dist/src/chunks/{use-eve-agent-Crmh_YB-.js → use-eve-agent-XnfjQt1Z.js} +46 -19
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/extension-init.d.ts +2 -1
- package/dist/src/cli/commands/extension-init.js +1 -1
- package/dist/src/cli/commands/init.d.ts +2 -13
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/dev/run-interactive-ui.d.ts +3 -0
- package/dist/src/cli/dev/run-interactive-ui.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +6 -0
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +5 -3
- package/dist/src/cli/dev/tui/setup-commands.js +2 -2
- package/dist/src/cli/dev/tui/status-line.js +1 -1
- package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
- package/dist/src/cli/dev/tui/tui.d.ts +4 -0
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/run.d.ts +1 -1
- package/dist/src/cli/run.js +2 -2
- package/dist/src/cli/telemetry/index.d.ts +15 -0
- package/dist/src/cli/telemetry/index.js +2 -2
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/ndjson.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiler/compile-from-memory.d.ts +1 -0
- package/dist/src/compiler/compile-from-memory.js +1 -1
- package/dist/src/compiler/default-tool-policy.d.ts +6 -0
- package/dist/src/compiler/default-tool-policy.js +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +18 -18
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/context/build-dynamic-tools.d.ts +2 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.d.ts +3 -3
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +1 -1
- package/dist/src/context/hook-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +2 -0
- package/dist/src/context/keys.js +1 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/execution/activity-events.d.ts +1 -0
- package/dist/src/execution/activity-events.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/execution/session-activity-projection.js +1 -1
- package/dist/src/execution/session-activity.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch.js +1 -1
- package/dist/src/execution/tasks/parent/task-cancel.d.ts +2 -2
- package/dist/src/execution/tasks/parent/task-cancel.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/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/execution/workflow-webhook-route.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/action-presentation.d.ts +13 -0
- package/dist/src/harness/action-presentation.js +1 -0
- package/dist/src/harness/approval-delivery-coordinator.js +1 -1
- package/dist/src/harness/compaction-prompt.d.ts +1 -0
- package/dist/src/harness/compaction-prompt.js +1 -1
- package/dist/src/harness/compaction.js +1 -1
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/emission.d.ts +1 -6
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +2 -1
- package/dist/src/harness/finish-reason.d.ts +3 -0
- package/dist/src/harness/finish-reason.js +1 -0
- package/dist/src/harness/provider-tool-schemas.d.ts +1 -0
- package/dist/src/harness/provider-tool-schemas.js +1 -1
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/stream-actions.d.ts +2 -2
- package/dist/src/harness/stream-actions.js +1 -1
- package/dist/src/harness/tool-call-input-errors.d.ts +4 -3
- package/dist/src/harness/tool-call-input-errors.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tool-presentation.d.ts +5 -0
- package/dist/src/harness/tool-presentation.js +1 -0
- package/dist/src/harness/turn-client-context.d.ts +1 -0
- package/dist/src/harness/workflow-lifecycle.d.ts +2 -3
- package/dist/src/harness/workflow-lifecycle.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.d.ts +3 -0
- package/dist/src/internal/application/compiled-artifacts.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-conditions.d.ts +2 -0
- package/dist/src/internal/authored-module-conditions.js +1 -0
- package/dist/src/internal/authored-module-loader.d.ts +3 -0
- package/dist/src/internal/authored-module-loader.js +3 -3
- package/dist/src/internal/authored-module-map-loader.d.ts +3 -1
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/authored-runtime-modules.d.ts +2 -0
- package/dist/src/internal/authored-runtime-modules.js +1 -1
- package/dist/src/internal/bundler/nitro-rolldown.d.ts +1 -0
- package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
- package/dist/src/internal/nitro/development-generation.d.ts +2 -0
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/routes/channel-request-instrumentation.js +1 -1
- package/dist/src/internal/node-esm-compat-banner.d.ts +19 -6
- package/dist/src/internal/node-esm-compat-banner.js +2 -2
- package/dist/src/internal/workflow-bundle/builder-support.d.ts +5 -0
- package/dist/src/internal/workflow-bundle/builder.js +2 -2
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-core-shim.js +1 -1
- package/dist/src/protocol/activity.d.ts +6 -0
- package/dist/src/protocol/activity.js +1 -1
- package/dist/src/protocol/message.d.ts +13 -1
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/public/channels/slack/activity-plan.js +1 -1
- package/dist/src/public/channels/slack/activity.js +2 -2
- package/dist/src/public/channels/slack/connections.d.ts +2 -2
- package/dist/src/public/channels/slack/connections.js +1 -1
- package/dist/src/public/memory/file/backends/default.js +1 -1
- package/dist/src/public/models/openai/chatgpt/credential-store.d.ts +6 -0
- package/dist/src/public/models/openai/chatgpt/credential-store.js +1 -0
- package/dist/src/public/models/openai/chatgpt/model.d.ts +1 -1
- package/dist/src/public/models/openai/chatgpt/oauth.d.ts +20 -0
- package/dist/src/public/models/openai/chatgpt/oauth.js +1 -0
- package/dist/src/public/models/openai/chatgpt/token-broker.d.ts +4 -3
- package/dist/src/public/models/openai/chatgpt/token-broker.js +1 -1
- package/dist/src/public/models/openai/chatgpt/transport.d.ts +1 -2
- package/dist/src/public/models/openai/index.d.ts +3 -4
- package/dist/src/public/tools/agent.d.ts +1 -0
- package/dist/src/public/tools/agent.js +1 -0
- package/dist/src/public/tools/ask-question.d.ts +1 -0
- package/dist/src/public/tools/ask-question.js +1 -0
- package/dist/src/public/tools/connection-search.d.ts +1 -0
- package/dist/src/public/tools/connection-search.js +1 -0
- package/dist/src/public/tools/index.d.ts +1 -1
- package/dist/src/public/tools/task-cancel.d.ts +1 -0
- package/dist/src/public/tools/task-cancel.js +1 -0
- package/dist/src/public/tools/task-update.d.ts +1 -0
- package/dist/src/public/tools/task-update.js +1 -0
- package/dist/src/runtime/connections/openapi-schema.js +1 -1
- package/dist/src/runtime/prompt/compose.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/subagents/dynamic-agent-config.js +1 -1
- package/dist/src/runtime/types.d.ts +2 -0
- package/dist/src/self-modification/agent.js +1 -1
- package/dist/src/self-modification/extension/instructions.d.ts +1 -3
- package/dist/src/self-modification/extension/instructions.js +4 -2
- package/dist/src/self-modification/filesystem.js +1 -1
- package/dist/src/setup/flows/chatgpt-auth.d.ts +14 -2
- package/dist/src/setup/flows/chatgpt-auth.js +1 -1
- package/dist/src/setup/flows/model.d.ts +3 -2
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/provider.js +1 -1
- package/dist/src/setup/flows/registry.d.ts +4 -0
- package/dist/src/setup/flows/registry.js +1 -1
- package/dist/src/setup/integrations/file-memory/vercel.d.ts +2 -2
- package/dist/src/setup/integrations/file-memory/vercel.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +7 -0
- package/dist/src/shared/boundary-hook-error.d.ts +4 -0
- package/dist/src/shared/boundary-hook-error.js +1 -0
- package/dist/src/{execution/activity-text.d.ts → shared/presentation-text.d.ts} +1 -1
- package/dist/src/shared/presentation-text.js +1 -0
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/definition.d.ts +29 -0
- package/dist/src/tools/definition.js +1 -1
- package/dist/src/tools/durable-callbacks.d.ts +40 -9
- package/dist/src/tools/durable-callbacks.js +1 -1
- package/dist/src/tools/dynamic.d.ts +4 -1
- package/dist/src/tools/framework/agent-contract.js +1 -1
- package/dist/src/tools/provided/bash.js +1 -1
- package/dist/src/tools/provided/glob.js +1 -1
- package/dist/src/tools/provided/grep.js +1 -1
- package/dist/src/tools/provided/load-skill.js +1 -1
- package/dist/src/tools/provided/read-file.js +1 -1
- package/dist/src/tools/provided/web-fetch.js +1 -1
- package/dist/src/tools/provided/write-file.js +1 -1
- package/dist/src/tools/tool-label.d.ts +1 -0
- package/dist/src/tools/tool-label.js +1 -0
- package/dist/src/tracing/agent-action-instrumentation.js +1 -1
- package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
- package/dist/src/tracing/agent-channel-delivery-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-session-context.js +1 -1
- package/dist/src/tracing/agent-otel-usage.d.ts +10 -0
- package/dist/src/tracing/agent-otel-usage.js +1 -1
- package/dist/src/tracing/agent-span-naming.d.ts +1 -0
- package/dist/src/tracing/agent-span-naming.js +1 -0
- package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/channels/slack.mdx +2 -0
- package/docs/concepts/built-in-tools.md +397 -68
- package/docs/concepts/default-harness.md +6 -0
- package/docs/concepts/sessions-runs-and-streaming.md +4 -0
- package/docs/connections/openapi.mdx +4 -0
- package/docs/connections/overview.mdx +1 -1
- package/docs/evals/running.mdx +2 -0
- package/docs/guides/client/continuations.mdx +11 -0
- package/docs/guides/client/streaming.mdx +7 -1
- package/docs/guides/dynamic-capabilities.md +5 -5
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/guides/hooks.md +1 -1
- package/docs/guides/instrumentation.md +40 -1
- package/docs/guides/remote-agents.md +2 -0
- package/docs/instructions.mdx +1 -1
- package/docs/memory/custom-provider.md +4 -1
- package/docs/memory/file.md +25 -12
- package/docs/memory/overview.mdx +45 -13
- package/docs/reference/cli.md +6 -0
- package/docs/reference/telemetry.md +2 -2
- package/docs/reference/typescript-api.md +13 -9
- package/docs/sandbox.mdx +14 -2
- package/docs/subagents/index.mdx +8 -4
- package/docs/tools/overview.mdx +44 -2
- package/docs/tools/workflows.mdx +9 -1
- package/docs/tutorial/connect-a-warehouse.mdx +49 -26
- package/docs/tutorial/first-agent.mdx +20 -19
- package/docs/tutorial/guard-the-spend.mdx +4 -4
- package/docs/tutorial/how-it-runs.mdx +2 -3
- package/docs/tutorial/meta.json +2 -2
- package/docs/tutorial/query-sample-data.mdx +30 -19
- package/docs/tutorial/remember-definitions.mdx +5 -5
- package/docs/tutorial/run-analysis.mdx +155 -18
- package/docs/tutorial/ship-it.mdx +71 -81
- package/docs/tutorial/team-playbooks.mdx +10 -10
- package/package.json +32 -7
- package/dist/src/execution/activity-text.js +0 -1
- package/dist/src/internal/workflow-bundle/authored-workflow-modules.d.ts +0 -9
- package/dist/src/internal/workflow-bundle/authored-workflow-modules.js +0 -1
- package/dist/src/public/models/openai/chatgpt/codex-app-server.d.ts +0 -40
- package/dist/src/public/models/openai/chatgpt/codex-app-server.js +0 -1
|
@@ -7,92 +7,183 @@ eve provides a default tool set for every agent and additional tools you can add
|
|
|
7
7
|
|
|
8
8
|
## Default tools
|
|
9
9
|
|
|
10
|
-
Default tools require no imports. The exact set depends on the agent and session
|
|
10
|
+
Default tools require no imports. The exact set depends on the agent and session, and the harness advertises only the tools available to the current session.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
### Disable optional default tools
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
|
|
16
|
-
| `bash` | Run a shell command. | Sandbox |
|
|
17
|
-
| `read_file` | Read a text file with line-numbered output (enables read-before-write). | Sandbox FS |
|
|
18
|
-
| `write_file` | Write a complete file; enforces read-before-write and stale-read detection. | Sandbox FS |
|
|
19
|
-
| `web_fetch` | Fetch a URL. | App runtime |
|
|
20
|
-
| `web_search` | Search the web (provider-managed; resolved from the model provider). | Provider |
|
|
21
|
-
| `todo` | Maintain a durable per-session todo list. | App runtime |
|
|
22
|
-
| `ask_question` | Ask the user a clarifying question or a choice mid-turn and park until they answer. No `execute`; the model calls it with `{ prompt, options?, allowFreeform? }`. See [Human-in-the-loop](/docs/human-in-the-loop). | App runtime |
|
|
23
|
-
| `agent` | From the root session, delegate a subtask to a fresh copy of the root agent. | App runtime |
|
|
24
|
-
| `load_skill` | Pull an on-demand [skill](../skills)'s instructions into the current turn. Present only when the agent declares skills. | App runtime |
|
|
25
|
-
| `connection_search` | Discover tools across declared [connections](../connections); matched tools become directly callable. Present only when the agent declares connections. | App runtime |
|
|
14
|
+
Optional default tools are enabled unless you set `defaultTools: false` in `agent/agent.ts`:
|
|
26
15
|
|
|
27
|
-
|
|
16
|
+
```ts title="agent/agent.ts"
|
|
17
|
+
import { defineAgent } from "eve";
|
|
28
18
|
|
|
29
|
-
|
|
19
|
+
export default defineAgent({
|
|
20
|
+
defaultTools: false,
|
|
21
|
+
model: "openai/gpt-5.4",
|
|
22
|
+
});
|
|
23
|
+
```
|
|
30
24
|
|
|
31
|
-
|
|
32
|
-
- **`load_skill`** only pulls instructions into context. It adds no new execution surface, because behavior still comes from the tools the agent already has.
|
|
33
|
-
- **`connection_search`** surfaces a connection's tools by their qualified name (e.g. `linear__list_issues`), which the model can then call directly. The model sees it only when the agent has connections.
|
|
34
|
-
- **`web_search`** has no local executor; the provider runs it. AI Gateway models use Exa by default. To use Parallel instead, export `webSearch({ provider: "parallel" })` from `agent/tools/web_search.ts`. Direct provider models continue to use their native search implementation. To supply your own implementation, override it with `defineTool()`.
|
|
35
|
-
- **`web_fetch`** follows up to ten redirects, rechecking every destination for SSRF safety. Non-success HTTP responses return a plain-text failure result with the response body when available instead of failing the tool call.
|
|
25
|
+
This turns off the optional defaults described below. Add back only the tools the agent needs with the command in each tool's section. Existing files under `agent/tools/` remain available, including same-name replacements such as `agent/tools/bash.ts`.
|
|
36
26
|
|
|
37
|
-
|
|
27
|
+
`connection_search` stays available when the agent has connections because it provides access to their tools.
|
|
38
28
|
|
|
39
|
-
|
|
29
|
+
### `bash`
|
|
40
30
|
|
|
41
|
-
|
|
31
|
+
`bash` runs shell commands in the agent's [sandbox](../sandbox).
|
|
42
32
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
| `grep` | `grep` from `eve/tools/grep` | Search sandbox file contents by regex. |
|
|
47
|
-
| `sleep` | `sleep()` from `eve/tools/sleep` | Pause and durably resume the current turn. |
|
|
33
|
+
```sh
|
|
34
|
+
eve add tool/bash
|
|
35
|
+
```
|
|
48
36
|
|
|
49
|
-
|
|
37
|
+
```ts title="agent/tools/bash.ts"
|
|
38
|
+
export { default } from "eve/tools/bash";
|
|
39
|
+
```
|
|
50
40
|
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
Override its description, approval policy, or executor by wrapping the exported definition:
|
|
42
|
+
|
|
43
|
+
```ts title="agent/tools/bash.ts"
|
|
44
|
+
import { defineTool } from "eve/tools";
|
|
45
|
+
import { bash } from "eve/tools/bash";
|
|
46
|
+
|
|
47
|
+
export default defineTool({
|
|
48
|
+
...bash,
|
|
49
|
+
description: "Run approved project maintenance commands.",
|
|
50
|
+
async execute(input, ctx) {
|
|
51
|
+
console.info("Running sandbox command", input.command);
|
|
52
|
+
return bash.execute(input, ctx);
|
|
53
|
+
},
|
|
54
|
+
});
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
Disable only `bash`:
|
|
58
|
+
|
|
59
|
+
```ts title="agent/tools/bash.ts"
|
|
60
|
+
import { disableTool } from "eve/tools";
|
|
61
|
+
|
|
62
|
+
export default disableTool();
|
|
57
63
|
```
|
|
58
64
|
|
|
59
|
-
|
|
65
|
+
### `read_file`
|
|
66
|
+
|
|
67
|
+
`read_file` reads text files from the sandbox with line-numbered output. It accepts absolute paths and paths beginning with `$HOME/`.
|
|
60
68
|
|
|
61
|
-
|
|
69
|
+
```sh
|
|
70
|
+
eve add tool/read_file
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```ts title="agent/tools/read_file.ts"
|
|
74
|
+
export { default } from "eve/tools/read_file";
|
|
75
|
+
```
|
|
62
76
|
|
|
63
|
-
|
|
77
|
+
Override it:
|
|
64
78
|
|
|
65
|
-
|
|
79
|
+
```ts title="agent/tools/read_file.ts"
|
|
80
|
+
import { defineTool } from "eve/tools";
|
|
81
|
+
import { readFile } from "eve/tools/read_file";
|
|
82
|
+
|
|
83
|
+
export default defineTool({
|
|
84
|
+
...readFile,
|
|
85
|
+
description: "Read project files from the sandbox.",
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Disable it:
|
|
90
|
+
|
|
91
|
+
```ts title="agent/tools/read_file.ts"
|
|
92
|
+
import { disableTool } from "eve/tools";
|
|
93
|
+
|
|
94
|
+
export default disableTool();
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### `write_file`
|
|
98
|
+
|
|
99
|
+
`write_file` writes complete files in the sandbox. It enforces read-before-write and stale-read detection, and accepts absolute paths and paths beginning with `$HOME/`.
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
eve add tool/write_file
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```ts title="agent/tools/write_file.ts"
|
|
106
|
+
export { default } from "eve/tools/write_file";
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Override it:
|
|
66
110
|
|
|
67
111
|
```ts title="agent/tools/write_file.ts"
|
|
68
112
|
import { defineTool } from "eve/tools";
|
|
69
113
|
import { writeFile } from "eve/tools/write_file";
|
|
70
114
|
|
|
71
115
|
export default defineTool({
|
|
72
|
-
...writeFile,
|
|
116
|
+
...writeFile,
|
|
117
|
+
description: "Write approved project files in the sandbox.",
|
|
73
118
|
async execute(input, ctx) {
|
|
74
|
-
|
|
119
|
+
if (!input.filePath.startsWith("/workspace/")) {
|
|
120
|
+
throw new Error("write_file is limited to /workspace");
|
|
121
|
+
}
|
|
75
122
|
return writeFile.execute(input, ctx);
|
|
76
123
|
},
|
|
77
124
|
});
|
|
78
125
|
```
|
|
79
126
|
|
|
80
|
-
|
|
127
|
+
Disable it:
|
|
128
|
+
|
|
129
|
+
```ts title="agent/tools/write_file.ts"
|
|
130
|
+
import { disableTool } from "eve/tools";
|
|
131
|
+
|
|
132
|
+
export default disableTool();
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### `web_fetch`
|
|
136
|
+
|
|
137
|
+
`web_fetch` fetches URLs from the app runtime. It follows up to ten redirects and checks every destination for SSRF safety. Non-success responses return plain text with the response body when available.
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
eve add tool/web_fetch
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```ts title="agent/tools/web_fetch.ts"
|
|
144
|
+
export { default } from "eve/tools/web_fetch";
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Override it:
|
|
148
|
+
|
|
149
|
+
```ts title="agent/tools/web_fetch.ts"
|
|
150
|
+
import { defineTool } from "eve/tools";
|
|
151
|
+
import { webFetch } from "eve/tools/web_fetch";
|
|
152
|
+
|
|
153
|
+
export default defineTool({
|
|
154
|
+
...webFetch,
|
|
155
|
+
description: "Fetch approved public documentation URLs.",
|
|
156
|
+
async execute(input, ctx) {
|
|
157
|
+
const hostname = new URL(input.url).hostname;
|
|
158
|
+
if (hostname !== "docs.example.com") {
|
|
159
|
+
throw new Error("web_fetch is limited to docs.example.com");
|
|
160
|
+
}
|
|
161
|
+
return webFetch.execute(input, ctx);
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Disable it:
|
|
167
|
+
|
|
168
|
+
```ts title="agent/tools/web_fetch.ts"
|
|
169
|
+
import { disableTool } from "eve/tools";
|
|
170
|
+
|
|
171
|
+
export default disableTool();
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### `web_search`
|
|
81
175
|
|
|
82
|
-
|
|
83
|
-
| ----------- | ---------------------- | --------------------- |
|
|
84
|
-
| `bash` | `eve/tools/bash` | Yes |
|
|
85
|
-
| `readFile` | `eve/tools/read_file` | Yes |
|
|
86
|
-
| `writeFile` | `eve/tools/write_file` | Yes |
|
|
87
|
-
| `todo` | `eve/tools/todo` | Yes |
|
|
88
|
-
| `webFetch` | `eve/tools/web_fetch` | Yes |
|
|
89
|
-
| `loadSkill` | `eve/tools/load_skill` | Yes |
|
|
90
|
-
| `glob` | `eve/tools/glob` | No |
|
|
91
|
-
| `grep` | `eve/tools/grep` | No |
|
|
176
|
+
`web_search` uses provider-managed web search and appears only for supported model providers. AI Gateway models use Exa by default; direct provider models use their native search implementation.
|
|
92
177
|
|
|
93
|
-
|
|
178
|
+
```sh
|
|
179
|
+
eve add tool/web_search
|
|
180
|
+
```
|
|
94
181
|
|
|
95
|
-
|
|
182
|
+
```ts title="agent/tools/web_search.ts"
|
|
183
|
+
export { default } from "eve/tools/web_search";
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Override the provider-managed configuration for AI Gateway:
|
|
96
187
|
|
|
97
188
|
```ts title="agent/tools/web_search.ts"
|
|
98
189
|
import { webSearch } from "eve/tools/web_search";
|
|
@@ -100,41 +191,279 @@ import { webSearch } from "eve/tools/web_search";
|
|
|
100
191
|
export default webSearch({ provider: "parallel" });
|
|
101
192
|
```
|
|
102
193
|
|
|
103
|
-
|
|
194
|
+
Replace provider-managed search with an authored implementation:
|
|
195
|
+
|
|
196
|
+
```ts title="agent/tools/web_search.ts"
|
|
197
|
+
import { defineTool } from "eve/tools";
|
|
104
198
|
|
|
105
|
-
|
|
199
|
+
export default defineTool({
|
|
200
|
+
description: "Search the internal documentation index.",
|
|
201
|
+
inputSchema: { type: "object" },
|
|
202
|
+
async execute(input) {
|
|
203
|
+
return { results: [], query: input };
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
```
|
|
106
207
|
|
|
107
|
-
|
|
208
|
+
Disable it:
|
|
108
209
|
|
|
109
|
-
```ts title="agent/tools/
|
|
210
|
+
```ts title="agent/tools/web_search.ts"
|
|
211
|
+
import { disableTool } from "eve/tools";
|
|
212
|
+
|
|
213
|
+
export default disableTool();
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### `todo`
|
|
217
|
+
|
|
218
|
+
`todo` maintains a durable todo list for the session.
|
|
219
|
+
|
|
220
|
+
```sh
|
|
221
|
+
eve add tool/todo
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
```ts title="agent/tools/todo.ts"
|
|
225
|
+
export { default } from "eve/tools/todo";
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Override it. Spreading the definition preserves its durable state key:
|
|
229
|
+
|
|
230
|
+
```ts title="agent/tools/todo.ts"
|
|
231
|
+
import { defineTool } from "eve/tools";
|
|
232
|
+
import { todo } from "eve/tools/todo";
|
|
233
|
+
|
|
234
|
+
export default defineTool({
|
|
235
|
+
...todo,
|
|
236
|
+
description: "Track the current implementation plan.",
|
|
237
|
+
});
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Disable it:
|
|
241
|
+
|
|
242
|
+
```ts title="agent/tools/todo.ts"
|
|
243
|
+
import { disableTool } from "eve/tools";
|
|
244
|
+
|
|
245
|
+
export default disableTool();
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### `ask_question`
|
|
249
|
+
|
|
250
|
+
`ask_question` asks the user for clarification or a choice, then parks the turn until they answer. It appears only when the session can request user input. See [Human-in-the-loop](/docs/human-in-the-loop).
|
|
251
|
+
|
|
252
|
+
```sh
|
|
253
|
+
eve add tool/ask_question
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
```ts title="agent/tools/ask_question.ts"
|
|
257
|
+
export { default } from "eve/tools/ask_question";
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Replace its request-input behavior with an ordinary authored tool:
|
|
261
|
+
|
|
262
|
+
```ts title="agent/tools/ask_question.ts"
|
|
263
|
+
import { defineTool } from "eve/tools";
|
|
264
|
+
|
|
265
|
+
export default defineTool({
|
|
266
|
+
description: "Record a clarification request.",
|
|
267
|
+
inputSchema: { type: "object" },
|
|
268
|
+
async execute(input) {
|
|
269
|
+
return { recorded: input };
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Disable it:
|
|
275
|
+
|
|
276
|
+
```ts title="agent/tools/ask_question.ts"
|
|
277
|
+
import { disableTool } from "eve/tools";
|
|
278
|
+
|
|
279
|
+
export default disableTool();
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### `agent`
|
|
283
|
+
|
|
284
|
+
`agent` delegates a subtask to a fresh copy of the root agent. It is root-only, always runs in the background, and returns a task receipt immediately. The child receives the root's instructions, tools, connections, and sandbox, but starts with fresh conversation history and [state](./state). See [Subagents](../subagents).
|
|
285
|
+
|
|
286
|
+
```sh
|
|
287
|
+
eve add tool/agent
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
```ts title="agent/tools/agent.ts"
|
|
291
|
+
export { default } from "eve/tools/agent";
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
The framework behavior cannot be overridden. Re-export the definition above to restore it, or disable it:
|
|
295
|
+
|
|
296
|
+
```ts title="agent/tools/agent.ts"
|
|
297
|
+
import { disableTool } from "eve/tools";
|
|
298
|
+
|
|
299
|
+
export default disableTool();
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### `task_cancel`
|
|
303
|
+
|
|
304
|
+
`task_cancel` lets the root session cancel background tasks.
|
|
305
|
+
|
|
306
|
+
```sh
|
|
307
|
+
eve add tool/task_cancel
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
```ts title="agent/tools/task_cancel.ts"
|
|
311
|
+
export { default } from "eve/tools/task_cancel";
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
The framework behavior cannot be overridden. Re-export the definition above to restore it, or disable it:
|
|
315
|
+
|
|
316
|
+
```ts title="agent/tools/task_cancel.ts"
|
|
317
|
+
import { disableTool } from "eve/tools";
|
|
318
|
+
|
|
319
|
+
export default disableTool();
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### `task_update`
|
|
323
|
+
|
|
324
|
+
`task_update` lets a background task report progress to its parent. It appears only in delegated task sessions.
|
|
325
|
+
|
|
326
|
+
```sh
|
|
327
|
+
eve add tool/task_update
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
```ts title="agent/tools/task_update.ts"
|
|
331
|
+
export { default } from "eve/tools/task_update";
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
The framework behavior cannot be overridden. Re-export the definition above to restore it, or disable it:
|
|
335
|
+
|
|
336
|
+
```ts title="agent/tools/task_update.ts"
|
|
337
|
+
import { disableTool } from "eve/tools";
|
|
338
|
+
|
|
339
|
+
export default disableTool();
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### `load_skill`
|
|
343
|
+
|
|
344
|
+
`load_skill` pulls an on-demand [skill](../skills)'s instructions into the current turn. It appears only when the agent declares skills and adds no execution surface by itself.
|
|
345
|
+
|
|
346
|
+
```sh
|
|
347
|
+
eve add tool/load_skill
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
```ts title="agent/tools/load_skill.ts"
|
|
351
|
+
export { default } from "eve/tools/load_skill";
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Override it:
|
|
355
|
+
|
|
356
|
+
```ts title="agent/tools/load_skill.ts"
|
|
357
|
+
import { defineTool } from "eve/tools";
|
|
358
|
+
import { loadSkill } from "eve/tools/load_skill";
|
|
359
|
+
|
|
360
|
+
export default defineTool({
|
|
361
|
+
...loadSkill,
|
|
362
|
+
description: "Load instructions for an available skill.",
|
|
363
|
+
});
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
Disable it:
|
|
367
|
+
|
|
368
|
+
```ts title="agent/tools/load_skill.ts"
|
|
110
369
|
import { disableTool } from "eve/tools";
|
|
111
370
|
|
|
112
371
|
export default disableTool();
|
|
113
372
|
```
|
|
114
373
|
|
|
115
|
-
|
|
374
|
+
### `connection_search`
|
|
375
|
+
|
|
376
|
+
`connection_search` discovers tools across declared [connections](../connections) and makes matches directly callable by qualified name, such as `linear__list_issues`. eve adds it automatically when connections exist, even when `defaultTools` is `false`, so there is no add command.
|
|
116
377
|
|
|
117
|
-
|
|
378
|
+
An authored `agent/tools/connection_search.ts` replaces the framework behavior. Import the framework definition from `eve/tools/connection_search` when you need to reference it directly. Exporting `disableTool()` from this slot is an error because agents with connections require connection discovery.
|
|
118
379
|
|
|
119
|
-
|
|
380
|
+
Review these tools before production use. Disable, wrap, restrict, or require approval for any tool that can access the filesystem, network, shell, or sensitive data.
|
|
120
381
|
|
|
121
|
-
|
|
382
|
+
You can also add the opt-in framework tools described below.
|
|
122
383
|
|
|
123
|
-
-
|
|
124
|
-
- **Disable** when the model should not have the capability at all. A `disableTool()` sentinel removes the built-in, and the model never sees it. Reach for this to lock down `bash` or `web_fetch` in an agent that should not run shell commands or fetch arbitrary URLs.
|
|
125
|
-
- **Author a new tool** when you want a capability the harness does not ship. Give it a fresh slug under `agent/tools/` and it joins the built-ins instead of replacing one. See [Tools](../tools) for the authoring model.
|
|
384
|
+
## Opt-in framework tools
|
|
126
385
|
|
|
127
|
-
|
|
386
|
+
These framework-provided tools are not added by default. Add only the ones the agent needs.
|
|
128
387
|
|
|
129
|
-
|
|
388
|
+
### `glob`
|
|
389
|
+
|
|
390
|
+
`glob` finds sandbox files by glob pattern. Add it:
|
|
391
|
+
|
|
392
|
+
```sh
|
|
393
|
+
eve add tool/glob
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
```ts title="agent/tools/glob.ts"
|
|
397
|
+
export { default } from "eve/tools/glob";
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
Customize it by wrapping the framework definition:
|
|
401
|
+
|
|
402
|
+
```ts title="agent/tools/glob.ts"
|
|
403
|
+
import { defineTool } from "eve/tools";
|
|
404
|
+
import { glob } from "eve/tools/glob";
|
|
405
|
+
|
|
406
|
+
export default defineTool({
|
|
407
|
+
...glob,
|
|
408
|
+
description: "Find project files by glob pattern.",
|
|
409
|
+
});
|
|
410
|
+
```
|
|
130
411
|
|
|
131
|
-
|
|
412
|
+
Remove the file to remove the tool. `disableTool()` is unnecessary because `glob` is not added by default.
|
|
413
|
+
|
|
414
|
+
### `grep`
|
|
415
|
+
|
|
416
|
+
`grep` searches sandbox file contents with a regular expression. Add it:
|
|
417
|
+
|
|
418
|
+
```sh
|
|
419
|
+
eve add tool/grep
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
```ts title="agent/tools/grep.ts"
|
|
423
|
+
export { default } from "eve/tools/grep";
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
Customize it by wrapping the framework definition:
|
|
427
|
+
|
|
428
|
+
```ts title="agent/tools/grep.ts"
|
|
429
|
+
import { defineTool } from "eve/tools";
|
|
430
|
+
import { grep } from "eve/tools/grep";
|
|
431
|
+
|
|
432
|
+
export default defineTool({
|
|
433
|
+
...grep,
|
|
434
|
+
description: "Search project files with a regular expression.",
|
|
435
|
+
});
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
Remove the file to remove the tool. `disableTool()` is unnecessary because `grep` is not added by default.
|
|
439
|
+
|
|
440
|
+
### `sleep`
|
|
441
|
+
|
|
442
|
+
`sleep` pauses and durably resumes the current turn. The model calls it with `{ seconds }`; the wait does not hold an application runtime open. Concurrent calls run in parallel, and the turn resumes after the longest wait. Add it:
|
|
443
|
+
|
|
444
|
+
```sh
|
|
445
|
+
eve add tool/sleep
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
```ts title="agent/tools/sleep.ts"
|
|
132
449
|
import { sleep } from "eve/tools/sleep";
|
|
133
450
|
|
|
134
451
|
export default sleep();
|
|
135
452
|
```
|
|
136
453
|
|
|
137
|
-
|
|
454
|
+
Customize it by wrapping the framework definition:
|
|
455
|
+
|
|
456
|
+
```ts title="agent/tools/sleep.ts"
|
|
457
|
+
import { defineWorkflowTool } from "eve/tools";
|
|
458
|
+
import { sleep } from "eve/tools/sleep";
|
|
459
|
+
|
|
460
|
+
export default defineWorkflowTool({
|
|
461
|
+
...sleep(),
|
|
462
|
+
description: "Pause before checking an external operation again.",
|
|
463
|
+
});
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
Remove the file to remove the tool. `disableTool()` is unnecessary because `sleep` is not added by default.
|
|
138
467
|
|
|
139
468
|
## What to read next
|
|
140
469
|
|
|
@@ -18,6 +18,12 @@ export default defineAgent({
|
|
|
18
18
|
});
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
Before summarizing, eve tries to shorten oversized tool results in older history.
|
|
22
|
+
It checks whether that reduction is sufficient using the last provider-reported
|
|
23
|
+
input token count plus an estimate of new messages. A smaller character estimate
|
|
24
|
+
alone cannot satisfy compaction triggered by a higher provider count. If trimming
|
|
25
|
+
cannot free enough space, eve summarizes the older history.
|
|
26
|
+
|
|
21
27
|
Compaction also preserves the framework's own tool state automatically. It resets read-before-write tracking (so a write afterward re-reads the file whose read evidence was summarized away) and re-injects the active todo list, so the model keeps its task list across the summary. There is no per-tool hook to configure.
|
|
22
28
|
|
|
23
29
|
First-class [memory](../memory) participates in a separate lifecycle. eve asks
|
|
@@ -119,6 +119,10 @@ Alongside `type` and `data`, every event carries a `meta` envelope:
|
|
|
119
119
|
|
|
120
120
|
- **`meta.id`** uniquely identifies the event. It is an `evt_`-prefixed [ULID](https://github.com/ulid/spec): a millisecond timestamp followed by random bits, so ids are broadly time-ordered.
|
|
121
121
|
- **`meta.at`** is the ISO-8601 time the event was emitted.
|
|
122
|
+
- **`meta.deliveryIds`**, when present, identifies the accepted messages that own
|
|
123
|
+
the turn. `POST /eve/v1/session/:sessionId` returns its `deliveryId`, allowing
|
|
124
|
+
clients to skip earlier turns when resuming from an old cursor. Coalesced
|
|
125
|
+
messages share the same turn events.
|
|
122
126
|
|
|
123
127
|
`meta.id` is stable. eve mints it once, when the event is written to the durable stream, and stores it with the event. Reconnecting from a cursor, rewinding to `startIndex=0`, or replaying a finished session all return the same id for the same event.
|
|
124
128
|
|
|
@@ -150,6 +150,10 @@ export default defineOpenAPIConnection({
|
|
|
150
150
|
|
|
151
151
|
The parameter `name` must exactly match the placeholder inside the path. If the spec omits an `in: "path"` parameter, the generated tool has no input for that segment and eve cannot fill it in from query parameters.
|
|
152
152
|
|
|
153
|
+
## Schema annotations
|
|
154
|
+
|
|
155
|
+
eve removes `default` and `example` annotations when their values conflict with the declared schema type. For example, a boolean property with `default: "false"` loses that annotation, while `default: false` is retained. This prevents invalid examples from guiding model input; eve does not coerce annotation values.
|
|
156
|
+
|
|
153
157
|
## Approval gates
|
|
154
158
|
|
|
155
159
|
Generated operations can mutate state like authored tools. Use the shared connection `approval` option for human approval, and combine it with `operations.allow` for the smallest practical surface. See [Per-connection approval](../connections#per-connection-approval) for the helpers and [Human-in-the-loop](../human-in-the-loop#approvals) for policy behavior.
|
|
@@ -200,7 +200,7 @@ export default defineMcpClientConnection({
|
|
|
200
200
|
});
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
-
`
|
|
203
|
+
Use the connector UID returned by `vercel connect create`; the display name passed to `--name` is not the UID. `connect("linear/myagent")` is shorthand for a user-scoped interactive OAuth connection: eve resolves a token for the active user before each tool call, emits `authorization.required` when that user has not authorized yet, and resumes the parked turn after the callback completes.
|
|
204
204
|
|
|
205
205
|
When a local subagent needs interactive authorization, eve surfaces the authorization lifecycle on the root session's channel, including through nested subagent chains. The challenge still points to the child session's callback, so completing it resumes the child directly while the parent continues waiting for its result.
|
|
206
206
|
|
package/docs/evals/running.mdx
CHANGED
|
@@ -35,6 +35,8 @@ Tag filters compose: `--tag` keeps evals carrying at least one listed tag, then
|
|
|
35
35
|
|
|
36
36
|
An eval that calls `t.skip(reason)` is reported as skipped, does not count as passed or failed, and never changes the exit code.
|
|
37
37
|
|
|
38
|
+
`eve eval --json` flushes the complete report before exiting, including when stdout is piped to another process or redirected to a file.
|
|
39
|
+
|
|
38
40
|
## Artifacts
|
|
39
41
|
|
|
40
42
|
Each run drops artifacts under `.eve/evals/<timestamp>/`: a run `summary.json`, a `results.jsonl` index, and per-eval assertion results, verdicts, captured event streams, and `t.log` lines under `evals/`. The console output stays tight on purpose; when an eval fails, the artifact has the full story.
|
|
@@ -52,6 +52,17 @@ console.log((await response.result()).message);
|
|
|
52
52
|
`attach()` performs no request. Every later operation targets exactly
|
|
53
53
|
`saved.sessionId`; it never follows or creates a replacement.
|
|
54
54
|
|
|
55
|
+
`send()` correlates its response with the message accepted by the server. If the
|
|
56
|
+
saved cursor is behind, it skips earlier turns and advances past them before
|
|
57
|
+
collecting the new result, including when another turn is active or queued. You
|
|
58
|
+
do not need to drain the stream before sending. Upgrade the server alongside the
|
|
59
|
+
client: a server that omits the accepted delivery identity causes `send()` to
|
|
60
|
+
throw instead of returning an ambiguous result.
|
|
61
|
+
|
|
62
|
+
If a configured reconnect limit ends the stream before the accepted turn reaches
|
|
63
|
+
a boundary, collecting its response throws. A partial stream is not a completed
|
|
64
|
+
result.
|
|
65
|
+
|
|
55
66
|
## Waiting, completed, and reset sessions
|
|
56
67
|
|
|
57
68
|
A session that emits `session.waiting` accepts another message through the same
|
|
@@ -24,7 +24,7 @@ The cancellation result is discriminated by `status`: only `accepted` includes
|
|
|
24
24
|
|
|
25
25
|
Cancellation does not replace stream consumption. Continue reading the response to observe its terminal `turn.cancelled` and `session.waiting` boundary and to advance the client session cursor normally. Use `session.cancel({ turnId })` instead when you have only a fixed session handle and an observed turn ID.
|
|
26
26
|
|
|
27
|
-
Between turns, `session.compact()` queues context compaction without sending model input. An accepted request reports the session id; consume the durable stream through the following `session.waiting` boundary before sending the next turn. `compaction.completed` confirms that summarization succeeded; without it, eve preserves the previous history. A never-started session returns `no_active_session` as a successful no-op.
|
|
27
|
+
Between turns, `session.compact()` queues context compaction without sending model input. An accepted request reports the session id; consume the durable stream through the following `session.waiting` boundary before sending the next turn. `compaction.completed` confirms that summarization succeeded; without it, eve preserves the previous history, including when the model returns an empty summary. A never-started session returns `no_active_session` as a successful no-op.
|
|
28
28
|
|
|
29
29
|
```ts
|
|
30
30
|
const compaction = await session.compact();
|
|
@@ -57,6 +57,10 @@ This consumes the stream until the current turn boundary:
|
|
|
57
57
|
- `session.completed`
|
|
58
58
|
- `session.failed`
|
|
59
59
|
|
|
60
|
+
`result()` closes that HTTP stream, including when fetch instrumentation clones
|
|
61
|
+
the response for tracing. The durable session remains available for follow-up
|
|
62
|
+
turns after `session.waiting`.
|
|
63
|
+
|
|
60
64
|
## Stream events live
|
|
61
65
|
|
|
62
66
|
Use `for await...of` when you want to render progress:
|
|
@@ -149,6 +153,8 @@ The stream can emit an interim `session.waiting` while the authorization callbac
|
|
|
149
153
|
|
|
150
154
|
HTTP connections can end before a run does. The client reconnects from the number of events already consumed, so long turns continue without replaying events. By default, a turn response keeps reconnecting until it reaches a turn boundary or is aborted, including while the turn is paused for authorization. A manually opened `session.stream()` eventually stops after repeated empty streams when it can no longer make progress.
|
|
151
155
|
|
|
156
|
+
Browser failures while reading a response body, including `TypeError: Load failed` and `TypeError: network error`, use the same reconnect policy. Invalid stream events still fail the read.
|
|
157
|
+
|
|
152
158
|
If your consumer persists events, key on `event.meta.id`. It is stable across reconnects and rewinds, so an overlapping replay is safe to ingest twice. See [the event envelope](../../concepts/sessions-runs-and-streaming#the-event-envelope).
|
|
153
159
|
|
|
154
160
|
Set `streamReconnectPolicy: { reconnect: false }` when a relay or proxy owns the cursor and reconnection policy. This makes a single stream GET attempt and returns when that connection ends; it does not stop the server-side turn:
|