eve 0.34.0 → 0.36.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 +29 -0
- package/README.md +3 -3
- package/dist/src/chunks/{use-eve-agent-BNdcle_M.js → use-eve-agent-COmP-H8R.js} +6 -3
- package/dist/src/chunks/{use-eve-agent-FJkEMXYk.js → use-eve-agent-CnppTEFk.js} +6 -3
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/commands/trace-detail.d.ts +3 -2
- package/dist/src/cli/commands/trace-detail.js +1 -1
- package/dist/src/cli/dev/tui/traces/trace-conversation.d.ts +4 -6
- package/dist/src/cli/dev/tui/traces/trace-conversation.js +1 -2
- package/dist/src/client/agent-info-schema.d.ts +12 -4
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/index.d.ts +1 -1
- package/dist/src/compiled/.vendor-stamp.json +3 -3
- package/dist/src/compiled/@chat-adapter/slack/index.js +1 -1
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/env-config.d.ts +1 -0
- package/dist/src/compiled/@workflow/world/events.d.ts +92 -35
- package/dist/src/compiled/@workflow/world/index.d.ts +3 -2
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +25 -23
- package/dist/src/compiled/@workflow/world/queue.d.ts +4 -0
- package/dist/src/compiled/@workflow/world/runs.d.ts +4 -0
- package/dist/src/compiled/@workflow/world/slot-identity.d.ts +53 -0
- package/dist/src/compiled/@workflow/world/spec-version.d.ts +36 -1
- package/dist/src/compiled/@workflow/world/steps.d.ts +4 -0
- package/dist/src/compiled/@workflow/world/ulid.d.ts +6 -0
- package/dist/src/compiled/@workflow/world-local/index.js +4 -4
- package/dist/src/compiled/@workflow/world-vercel/index.js +13 -17
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-6OqdYdi4.js → attribute-changes-BoH7JsWp.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/dist-DlFv0aHY.js +40 -0
- package/dist/src/compiled/_chunks/workflow/env-config-DxamfI7T.js +1 -0
- package/dist/src/compiled/_chunks/workflow/frames-CTpeJYEQ.js +3 -0
- package/dist/src/compiled/_chunks/workflow/{functions-CXb61C6h.js → functions-CeeNvKsq.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-BPQHjeY5.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-DQ5dOyjm.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-id-BdE0MZz9.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-CzdoBiqy.js +1 -0
- package/dist/src/compiled/_chunks/workflow/spec-version-DBUVfF_R.js +1 -0
- package/dist/src/compiled/_chunks/workflow/undici-CUIybhQ2.js +95 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-DK2lnH6U.js +15 -0
- package/dist/src/compiled/_chunks/workflow/{wrapper-CDq65xJV.js → wrapper-CMGju7QA.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/ws-transport-Csi6Cydc.js +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +10 -10
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +8 -8
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-extension.d.ts +3 -3
- package/dist/src/compiler/normalize-extension.js +1 -1
- package/dist/src/compiler/normalize-instructions.d.ts +1 -1
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -3
- package/dist/src/context/dynamic-instruction-lifecycle.d.ts +5 -1
- package/dist/src/context/dynamic-instruction-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +6 -2
- package/dist/src/context/keys.js +1 -1
- package/dist/src/discover/manifest.d.ts +1 -1
- package/dist/src/discover/manifest.js +1 -1
- package/dist/src/evals/context.js +1 -1
- package/dist/src/evals/index.d.ts +2 -2
- package/dist/src/evals/reporters/index.d.ts +1 -1
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/runner/execute-eval.d.ts +5 -0
- package/dist/src/evals/runner/execute-eval.js +1 -1
- package/dist/src/evals/runner/execute-task.d.ts +3 -0
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/types.d.ts +28 -2
- package/dist/src/evals/runner/run-evals.js +1 -1
- package/dist/src/evals/session.d.ts +12 -2
- package/dist/src/evals/session.js +1 -1
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +12 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/session.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/execution/workflow-trace-context.d.ts +11 -0
- package/dist/src/execution/workflow-trace-context.js +1 -0
- package/dist/src/harness/ai-sdk-hook-bridge.d.ts +1 -1
- package/dist/src/harness/ai-sdk-hook-bridge.js +1 -1
- package/dist/src/harness/approval-delivery-coordinator.js +1 -1
- package/dist/src/harness/channel-delivery-instrumentation.d.ts +1 -1
- package/dist/src/harness/channel-delivery-instrumentation.js +1 -1
- package/dist/src/harness/emission.d.ts +2 -2
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/instrumentation/config.js +1 -0
- package/dist/src/harness/{instrumentation-content.d.ts → instrumentation/content.d.ts} +1 -1
- package/dist/src/harness/{instrumentation-dispatch.d.ts → instrumentation/dispatch.d.ts} +1 -1
- package/dist/src/harness/{instrumentation-dispatch.js → instrumentation/dispatch.js} +1 -1
- package/dist/src/harness/{instrumentation-lifecycle.d.ts → instrumentation/lifecycle.d.ts} +3 -6
- package/dist/src/harness/{instrumentation-lifecycle.js → instrumentation/lifecycle.js} +1 -1
- package/dist/src/harness/{instrumentation-native-events.d.ts → instrumentation/native-events.d.ts} +1 -1
- package/dist/src/harness/{instrumentation-native-events.js → instrumentation/native-events.js} +1 -1
- package/dist/src/harness/{instrumentation-providers.d.ts → instrumentation/providers.d.ts} +1 -1
- package/dist/src/harness/{instrumentation-providers.js → instrumentation/providers.js} +1 -1
- package/dist/src/harness/{instrumentation-runtime.d.ts → instrumentation/runtime.d.ts} +4 -2
- package/dist/src/harness/{instrumentation-state.d.ts → instrumentation/state.d.ts} +1 -1
- package/dist/src/harness/parent-lineage.d.ts +1 -1
- package/dist/src/harness/prepare-trace-context.d.ts +16 -0
- package/dist/src/harness/prepare-trace-context.js +1 -0
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/types.d.ts +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +2 -2
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.d.ts +3 -3
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/instrumentation.d.ts +1 -1
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +4 -3
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/channel-request-instrumentation.js +1 -1
- package/dist/src/internal/vercel/project-link.d.ts +1 -1
- package/dist/src/internal/vercel/project-link.js +1 -1
- package/dist/src/internal/vercel-agent-summary.d.ts +10 -9
- package/dist/src/internal/vercel-agent-summary.js +1 -1
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/protocol/message.d.ts +15 -1
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/public/channels/github/auth.d.ts +30 -0
- package/dist/src/public/channels/github/auth.js +2 -2
- package/dist/src/public/channels/github/defaults.d.ts +4 -4
- package/dist/src/public/channels/github/defaults.js +1 -1
- package/dist/src/public/channels/github/dispatch.d.ts +3 -2
- package/dist/src/public/channels/github/dispatch.js +1 -1
- package/dist/src/public/channels/github/githubChannel.d.ts +7 -2
- package/dist/src/public/channels/github/githubChannel.js +1 -1
- package/dist/src/public/channels/github/index.d.ts +1 -1
- package/dist/src/public/definitions/instructions.d.ts +14 -4
- package/dist/src/public/definitions/instructions.js +1 -1
- package/dist/src/public/definitions/tool.d.ts +5 -8
- package/dist/src/public/instructions/index.d.ts +1 -2
- package/dist/src/public/instructions/index.js +1 -1
- package/dist/src/public/instrumentation/index.d.ts +4 -3
- package/dist/src/public/instrumentation/otel.d.ts +5 -4
- package/dist/src/public/instrumentation/provider.d.ts +2 -2
- package/dist/src/public/nuxt/module.js +1 -1
- package/dist/src/public/sveltekit/index.d.ts +6 -20
- package/dist/src/public/sveltekit/index.js +1 -1
- package/dist/src/public/sveltekit/routing.d.ts +0 -24
- package/dist/src/public/sveltekit/routing.js +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +2 -0
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/prompt/compose.d.ts +1 -1
- package/dist/src/runtime/prompt/compose.js +3 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/types.d.ts +4 -3
- package/dist/src/setup/boxes/select-model.d.ts +6 -6
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/project-resolution.d.ts +3 -3
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/slack-connect-lifecycle.d.ts +0 -9
- package/dist/src/setup/slack-connect-lifecycle.js +1 -1
- package/dist/src/setup/slackbot.d.ts +2 -1
- package/dist/src/setup/slackbot.js +1 -1
- package/dist/src/shared/default-agent-model.d.ts +1 -1
- package/dist/src/shared/default-agent-model.js +1 -1
- package/dist/src/shared/dynamic-tool-definition.d.ts +3 -4
- package/dist/src/shared/instructions-definition.d.ts +15 -11
- package/dist/src/{public/nuxt → shared}/vercel-services.d.ts +18 -19
- package/dist/src/shared/vercel-services.js +1 -0
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tracing/agent-action-instrumentation.d.ts +1 -1
- package/dist/src/tracing/agent-action-instrumentation.js +1 -1
- package/dist/src/tracing/agent-approval-instrumentation.d.ts +1 -1
- package/dist/src/tracing/agent-channel-delivery-instrumentation.d.ts +1 -1
- package/dist/src/tracing/agent-channel-delivery-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.d.ts +4 -2
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-session-context.d.ts +17 -0
- package/dist/src/tracing/agent-otel-session-context.js +1 -0
- package/dist/src/tracing/agent-otel-usage.d.ts +1 -1
- package/dist/src/tracing/agent-tool-instrumentation.d.ts +1 -1
- package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +1 -1
- package/dist/src/tracing/install-instrumentation-runtime.d.ts +2 -2
- package/dist/src/tracing/install-instrumentation-runtime.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/tracing/local-traces.d.ts +3 -3
- package/dist/src/tracing/local-traces.js +1 -1
- package/dist/src/tracing/otel-declaration.d.ts +2 -2
- package/dist/src/tracing/otel-declaration.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/README.md +18 -20
- package/docs/agent-config.md +9 -6
- package/docs/channels/custom.mdx +1 -1
- package/docs/channels/eve.mdx +10 -56
- package/docs/channels/github.mdx +1 -1
- package/docs/channels/meta.json +1 -0
- package/docs/concepts/context-control.md +32 -56
- package/docs/concepts/default-harness.md +2 -2
- package/docs/concepts/execution-model-and-durability.mdx +4 -4
- package/docs/concepts/meta.json +3 -1
- package/docs/concepts/sessions-runs-and-streaming.md +23 -11
- package/docs/{guides → concepts}/state.md +3 -3
- package/docs/connections/mcp.mdx +6 -89
- package/docs/connections/meta.json +1 -0
- package/docs/connections/openapi.mdx +5 -69
- package/docs/connections/overview.mdx +29 -3
- package/docs/evals/meta.json +1 -0
- package/docs/evals/reporters.mdx +14 -4
- package/docs/extensions.md +1 -1
- package/docs/getting-started.mdx +175 -13
- package/docs/guides/auth-and-route-protection.md +3 -18
- package/docs/guides/client/messages.mdx +3 -1
- package/docs/guides/client/meta.json +2 -1
- package/docs/guides/client/output-schema.mdx +2 -2
- package/docs/guides/client/overview.mdx +1 -1
- package/docs/guides/deployment/meta.json +1 -0
- package/docs/guides/deployment/overview.md +1 -1
- package/docs/guides/deployment/self-hosting.md +3 -3
- package/docs/guides/deployment/vercel.mdx +1 -1
- package/docs/guides/dev-tui.md +3 -13
- package/docs/guides/dynamic-capabilities.md +64 -4
- package/docs/guides/frontend/meta.json +2 -1
- package/docs/guides/frontend/nextjs.mdx +1 -10
- package/docs/guides/frontend/nuxt.mdx +1 -10
- package/docs/guides/frontend/overview.mdx +12 -3
- package/docs/guides/frontend/sveltekit.mdx +23 -11
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +39 -126
- package/docs/guides/frontend/use-eve-agent-vue.mdx +40 -139
- package/docs/guides/instrumentation.md +15 -15
- package/docs/guides/meta.json +1 -5
- package/docs/guides/remote-agents.md +9 -9
- package/docs/guides/session-context.md +34 -103
- package/docs/install-integrations.mdx +1 -1
- package/docs/instructions.mdx +45 -12
- package/docs/meta.json +24 -13
- package/docs/patterns/dynamic-scheduling.md +1 -1
- package/docs/patterns/meta.json +1 -0
- package/docs/patterns/multi-tenant-approvals.md +1 -1
- package/docs/patterns/multi-tenant-auth.md +1 -1
- package/docs/patterns/multi-tenant-memory.md +4 -3
- package/docs/{guides → protocols}/acp.md +1 -1
- package/docs/protocols/meta.json +5 -0
- package/docs/reference/cli.md +39 -39
- package/docs/reference/meta.json +1 -1
- package/docs/reference/typescript-api.md +4 -2
- package/docs/sandbox.mdx +8 -0
- package/docs/{subagents.mdx → subagents/index.mdx} +2 -2
- package/docs/subagents/meta.json +5 -0
- package/docs/{guides/dynamic-workflows.md → subagents/workflow-tool.md} +6 -6
- package/docs/tools/human-in-the-loop.md +1 -1
- package/docs/tools/meta.json +1 -0
- package/docs/tools/overview.mdx +1 -1
- package/docs/tutorial/connect-a-warehouse.mdx +1 -1
- package/docs/tutorial/meta.json +1 -0
- package/docs/tutorial/remember-definitions.mdx +2 -2
- package/docs/tutorial/ship-it.mdx +2 -2
- package/package.json +4 -4
- package/dist/src/compiled/_chunks/workflow/dist-C8PhDW9B.js +0 -1
- package/dist/src/compiled/_chunks/workflow/functions-xMPAeWFr.js +0 -1
- package/dist/src/compiled/_chunks/workflow/node-Smb57EnG.js +0 -40
- package/dist/src/compiled/_chunks/workflow/resume-hook-BrduAuFX.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-CX7_sJnW.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-tsb2HjWK.js +0 -1
- package/dist/src/compiled/_chunks/workflow/undici-BNc_0O4m.js +0 -95
- package/dist/src/compiled/_chunks/workflow/wait-until-BYKVqrwc.js +0 -15
- package/dist/src/harness/instrumentation-config.js +0 -1
- package/dist/src/public/nuxt/vercel-services.js +0 -1
- package/dist/src/public/sveltekit/vercel-json.d.ts +0 -17
- package/dist/src/public/sveltekit/vercel-json.js +0 -1
- package/docs/installation.mdx +0 -66
- package/docs/project-structure.mdx +0 -53
- package/docs/reference/project-layout.md +0 -123
- /package/dist/src/harness/{instrumentation-config.d.ts → instrumentation/config.d.ts} +0 -0
- /package/dist/src/harness/{instrumentation-content.js → instrumentation/content.js} +0 -0
- /package/dist/src/harness/{instrumentation-runtime-context.d.ts → instrumentation/runtime-context.d.ts} +0 -0
- /package/dist/src/harness/{instrumentation-runtime-context.js → instrumentation/runtime-context.js} +0 -0
- /package/dist/src/harness/{instrumentation-runtime.js → instrumentation/runtime.js} +0 -0
- /package/dist/src/harness/{instrumentation-setup-context.d.ts → instrumentation/setup-context.d.ts} +0 -0
- /package/dist/src/harness/{instrumentation-setup-context.js → instrumentation/setup-context.js} +0 -0
- /package/dist/src/harness/{instrumentation-state.js → instrumentation/state.js} +0 -0
- /package/docs/{guides → protocols}/ucp.mdx +0 -0
|
@@ -69,21 +69,12 @@ With the plugin in `vite.config.ts`, components call [`useEveAgent`](./use-eve-a
|
|
|
69
69
|
</form>
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
The
|
|
73
|
-
|
|
74
|
-
```ts title="agent/channels/eve.ts"
|
|
75
|
-
import { eveChannel } from "eve/channels/eve";
|
|
76
|
-
import { localDev, vercelOidc } from "eve/channels/auth";
|
|
77
|
-
|
|
78
|
-
export default eveChannel({ auth: [vercelOidc(), localDev()] });
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
For a public demo, use `none()` (also from `eve/channels/auth`) to skip authentication. See [Channels](../../channels/overview) and [Auth & route protection](../auth-and-route-protection).
|
|
72
|
+
The browser still needs a production authentication policy. See [Authenticate browser requests](./overview#authenticate-browser-requests) for the default fail-closed behavior and channel configuration.
|
|
82
73
|
|
|
83
74
|
## Dev vs deploy topology
|
|
84
75
|
|
|
85
76
|
- **Local dev.** `npm run dev` boots the eve dev server next to SvelteKit and proxies the eve routes to it, so the browser only ever hits the SvelteKit origin. `npm run build && npm run preview` behaves the same way: the preview server gets its own eve route proxy and either reuses the shared eve server or starts one.
|
|
86
|
-
- **Vercel.** The SvelteKit app and the eve runtime deploy as a single project.
|
|
77
|
+
- **Vercel.** The SvelteKit app and the eve runtime deploy as a single project. On Vercel builds the plugin adds Build Output [`services`](https://vercel.com/docs/services) for eve and a `routes` entry that sends `/eve/v1/**` to that service before filesystem routing; the SvelteKit app remains the default app. No `vercel.json` is required. By default the generated service runs the installed eve binary from the SvelteKit app's dependencies, so the agent directory does not need its own `package.json`. When the agent needs its own build step, set `eveBuildCommand`:
|
|
87
78
|
|
|
88
79
|
```ts
|
|
89
80
|
export default defineConfig({
|
|
@@ -104,6 +95,27 @@ For a public demo, use `none()` (also from `eve/channels/auth`) to skip authenti
|
|
|
104
95
|
});
|
|
105
96
|
```
|
|
106
97
|
|
|
98
|
+
## Managing vercel.json yourself
|
|
99
|
+
|
|
100
|
+
When `vercel.json` declares [`services`](https://vercel.com/docs/services), the plugin generates nothing and your configuration owns routing. It must include the eve service (`framework: "eve"`) and a rewrite that exposes the eve transport, or the build fails:
|
|
101
|
+
|
|
102
|
+
```json title="vercel.json"
|
|
103
|
+
{
|
|
104
|
+
"services": {
|
|
105
|
+
"web": { "root": ".", "framework": "sveltekit" },
|
|
106
|
+
"eve": { "root": "agent", "framework": "eve", "buildCommand": "eve build" }
|
|
107
|
+
},
|
|
108
|
+
"rewrites": [{ "source": "/eve/v1/(.*)", "destination": { "service": "eve" } }]
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Migrating from experimentalServices
|
|
113
|
+
|
|
114
|
+
Earlier versions of the plugin wrote the legacy `experimentalServices` field into `vercel.json`. Vercel no longer routes that model, so the plugin now ignores the field and warns when it sees one. Migrate either way:
|
|
115
|
+
|
|
116
|
+
- **Generated (default).** Delete `vercel.json` (or just its `experimentalServices` block) and set the project's Framework Preset back to SvelteKit. The plugin generates the eve service and its routing on every Vercel build.
|
|
117
|
+
- **Hand-maintained.** Replace `experimentalServices` with the stable `services` and `rewrites` shown above, and keep the Services Framework Preset.
|
|
118
|
+
|
|
107
119
|
## What to read next
|
|
108
120
|
|
|
109
121
|
- [`useEveAgent` (Svelte)](./use-eve-agent-svelte): the binding API
|
|
@@ -1,43 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "useEveAgent (Svelte)"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use the eve Svelte binding and its Svelte-specific reactive interface."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
`useEveAgent()` from `eve/svelte`
|
|
6
|
+
`useEveAgent()` from `eve/svelte` exposes the shared eve frontend client through Svelte 5 reactive getters and methods. Read the [frontend overview](./overview) for session behavior, messages, human input, authorization, callbacks, reducers, and persistence. This page covers the Svelte-specific interface.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Import from `eve/svelte` and read the reactive getters directly. No `$` prefix:
|
|
11
|
-
|
|
12
|
-
```svelte
|
|
13
|
-
<script lang="ts">
|
|
14
|
-
import { useEveAgent } from "eve/svelte";
|
|
15
|
-
|
|
16
|
-
const agent = useEveAgent();
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
{#each agent.data.messages as message}
|
|
20
|
-
<p>{message.role}: {JSON.stringify(message.parts)}</p>
|
|
21
|
-
{/each}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## What it returns
|
|
8
|
+
On SvelteKit, register the [`eveSvelteKit` Vite plugin](./sveltekit) to mount the agent routes on the application origin.
|
|
25
9
|
|
|
26
|
-
|
|
27
|
-
| --------- | --------------------------------------------- | ------------------------------------------------------------------------- |
|
|
28
|
-
| `data` | `TData` | Projected state. With the default reducer, `EveMessageData` (`messages`). |
|
|
29
|
-
| `status` | `UseEveAgentStatus` | `"ready"`, `"submitted"`, `"streaming"`, or `"error"`. |
|
|
30
|
-
| `error` | `Error \| undefined` | Last transport-level error. |
|
|
31
|
-
| `events` | `readonly MessageStreamEvent[]` | Raw server events for this session. |
|
|
32
|
-
| `session` | `ClientSessionState \| undefined` | Fixed session ID and stream cursor. |
|
|
33
|
-
| `send` | `(message, options?) => Promise<void>` | Send text or a multi-part message. |
|
|
34
|
-
| `respond` | `(inputResponses, options?) => Promise<void>` | Answer pending HITL input requests. |
|
|
35
|
-
| `stop` | `() => void` | Abort the client's in-flight stream. |
|
|
36
|
-
| `reset` | `() => void` | Clear state and start a new session. |
|
|
37
|
-
|
|
38
|
-
These state fields are reactive getters, so read them straight from templates, `$derived`, or `$effect`. They are not stores, so don't prefix them with `$`.
|
|
10
|
+
## Basic usage
|
|
39
11
|
|
|
40
|
-
|
|
12
|
+
Call the binding once for a conversation and read its reactive getters directly. The returned object is not a Svelte store, so its fields do not use the `$` prefix:
|
|
41
13
|
|
|
42
14
|
```svelte
|
|
43
15
|
<script lang="ts">
|
|
@@ -45,39 +17,51 @@ These state fields are reactive getters, so read them straight from templates, `
|
|
|
45
17
|
|
|
46
18
|
const agent = useEveAgent();
|
|
47
19
|
let message = $state("");
|
|
20
|
+
let isBusy = $derived(agent.status === "submitted" || agent.status === "streaming");
|
|
48
21
|
|
|
49
22
|
async function handleSubmit() {
|
|
50
23
|
const text = message.trim();
|
|
51
|
-
if (!text) return;
|
|
24
|
+
if (!text || isBusy) return;
|
|
52
25
|
message = "";
|
|
53
26
|
await agent.send(text);
|
|
54
27
|
}
|
|
55
28
|
</script>
|
|
56
29
|
|
|
30
|
+
{#each agent.data.messages as item}
|
|
31
|
+
<p>{item.role}: {JSON.stringify(item.parts)}</p>
|
|
32
|
+
{/each}
|
|
33
|
+
|
|
57
34
|
<form onsubmit={(event) => {
|
|
58
35
|
event.preventDefault();
|
|
59
36
|
void handleSubmit();
|
|
60
37
|
}}>
|
|
61
|
-
<input bind:value={message}
|
|
62
|
-
<button type="submit">Send</button>
|
|
38
|
+
<input bind:value={message} disabled={isBusy} />
|
|
39
|
+
<button type="submit" disabled={isBusy}>Send</button>
|
|
63
40
|
</form>
|
|
64
41
|
```
|
|
65
42
|
|
|
66
|
-
|
|
43
|
+
## What it returns
|
|
67
44
|
|
|
68
|
-
|
|
69
|
-
const bytes = new Uint8Array(await file.arrayBuffer());
|
|
70
|
-
const base64 = btoa(String.fromCodePoint(...bytes));
|
|
45
|
+
The state fields are reactive getters; the commands are ordinary methods:
|
|
71
46
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
47
|
+
| Property | Svelte shape |
|
|
48
|
+
| ---------------------------------- | --------------------------------- |
|
|
49
|
+
| `data` | `TData` |
|
|
50
|
+
| `status` | `UseEveAgentStatus` |
|
|
51
|
+
| `error` | `Error \| undefined` |
|
|
52
|
+
| `events` | `readonly MessageStreamEvent[]` |
|
|
53
|
+
| `session` | `ClientSessionState \| undefined` |
|
|
54
|
+
| `send`, `respond`, `stop`, `reset` | Methods |
|
|
55
|
+
|
|
56
|
+
Read the getters directly in templates, `$derived`, or `$effect`. The [shared returned-state reference](./overview#returned-state) describes what each value and command does.
|
|
57
|
+
|
|
58
|
+
## Send a message
|
|
59
|
+
|
|
60
|
+
Call `agent.send(text)` for text or pass content parts for attachments. The API and transport behavior match the [shared sending guide](./overview#sending-and-streaming); only reactive access differs in Svelte.
|
|
77
61
|
|
|
78
62
|
## Human-in-the-loop prompts
|
|
79
63
|
|
|
80
|
-
|
|
64
|
+
Pending requests appear in `agent.data.messages`. Use the Svelte exports when narrowing message parts, then answer through `agent.respond()`:
|
|
81
65
|
|
|
82
66
|
```svelte
|
|
83
67
|
<script lang="ts">
|
|
@@ -118,101 +102,30 @@ A tool opts into approval with `approval` ([Tools](../../tools)). When one fires
|
|
|
118
102
|
{/each}
|
|
119
103
|
```
|
|
120
104
|
|
|
121
|
-
|
|
105
|
+
See [Human-in-the-loop prompts](./overview#human-in-the-loop-prompts) for request semantics and rendering guidance.
|
|
122
106
|
|
|
123
107
|
## Stop, reset, and resume
|
|
124
108
|
|
|
125
|
-
`stop()`
|
|
126
|
-
|
|
127
|
-
```ts
|
|
128
|
-
const agent = useEveAgent({
|
|
129
|
-
initialSession: savedSessionState,
|
|
130
|
-
initialEvents: savedEvents,
|
|
131
|
-
onSessionChange: (session) => {
|
|
132
|
-
localStorage.setItem("eve-session", JSON.stringify(session));
|
|
133
|
-
},
|
|
134
|
-
});
|
|
135
|
-
```
|
|
109
|
+
Call `agent.stop()` to detach the browser stream without cancelling server-side work, and `agent.reset()` to clear local state and start a new session. Pass `initialSession` and `initialEvents` to restore a saved conversation. See [Resumable sessions](./overview#resumable-sessions) for the persistence contract and [Sending and streaming](./overview#sending-and-streaming) for cancellation behavior.
|
|
136
110
|
|
|
137
111
|
## Custom host and credentials
|
|
138
112
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
```ts
|
|
142
|
-
const agent = useEveAgent({
|
|
143
|
-
host: "https://agent.example.com",
|
|
144
|
-
headers: async () => ({
|
|
145
|
-
authorization: `Bearer ${await getAccessToken()}`,
|
|
146
|
-
}),
|
|
147
|
-
});
|
|
148
|
-
```
|
|
113
|
+
Pass `host`, `auth`, or `headers` to the binding using the same options as the other frontend bindings. See [Custom hosts and headers](./overview#custom-hosts-and-headers).
|
|
149
114
|
|
|
150
115
|
## Attach page context per turn
|
|
151
116
|
|
|
152
|
-
`clientContext`
|
|
153
|
-
|
|
154
|
-
```ts
|
|
155
|
-
await agent.send("What should I do on this screen?", {
|
|
156
|
-
clientContext: { route: "/billing", plan: "pro", seatsUsed: 4 },
|
|
157
|
-
});
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
To attach the same context to every turn without threading it through each call site, pass `prepareSend`. It runs right before each send and returns the (possibly augmented) turn:
|
|
161
|
-
|
|
162
|
-
```ts
|
|
163
|
-
const agent = useEveAgent({
|
|
164
|
-
prepareSend: (input) => ({
|
|
165
|
-
...input,
|
|
166
|
-
clientContext: { route: location.pathname },
|
|
167
|
-
}),
|
|
168
|
-
});
|
|
169
|
-
```
|
|
117
|
+
Pass `clientContext` to `send()` or `respond()`, or use `prepareSend` to add context before every turn. See [Attach page context per turn](./overview#attach-page-context-per-turn).
|
|
170
118
|
|
|
171
119
|
## Lifecycle callbacks
|
|
172
120
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
- `onEvent(event)`: fires for each eve stream event as it arrives.
|
|
176
|
-
- `onError(error)`: fires with the last `Error` when a turn fails.
|
|
177
|
-
- `onFinish(snapshot)`: fires with the final snapshot once a turn settles.
|
|
178
|
-
- `onSessionChange(session)`: fires when the session cursor advances. Persist it to resume across reloads.
|
|
179
|
-
|
|
180
|
-
```ts
|
|
181
|
-
const agent = useEveAgent({
|
|
182
|
-
onEvent: (event) => console.debug(event.type),
|
|
183
|
-
onError: (error) => console.error(error.message),
|
|
184
|
-
onFinish: (snapshot) => console.log(snapshot.status),
|
|
185
|
-
});
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
The `optimistic` option (default `true`) projects submitted user messages into `data` before eve confirms them with a `message.received` event. These are reducer-facing projection events only; `events` stays the authoritative eve stream.
|
|
121
|
+
Pass `onEvent`, `onError`, `onFinish`, or `onSessionChange` when the application needs lifecycle notifications. See [Lifecycle callbacks](./overview#lifecycle-callbacks) for callback timing and optimistic projection behavior.
|
|
189
122
|
|
|
190
123
|
## Custom reducer
|
|
191
124
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
```ts
|
|
195
|
-
import { useEveAgent } from "eve/svelte";
|
|
196
|
-
import type { EveAgentReducer } from "eve/svelte";
|
|
197
|
-
|
|
198
|
-
interface ToolLog {
|
|
199
|
-
readonly toolCalls: number;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
const toolCounter: EveAgentReducer<ToolLog> = {
|
|
203
|
-
initial: () => ({ toolCalls: 0 }),
|
|
204
|
-
reduce: (data, event) =>
|
|
205
|
-
event.type === "actions.requested" ? { toolCalls: data.toolCalls + 1 } : data,
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
const agent = useEveAgent({ reducer: toolCounter });
|
|
209
|
-
// agent.data is ToolLog
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
`reduce(data, event)` receives both authoritative eve stream events and client projection events (`client.message.submitted`, `client.message.failed`, `client.input.responded`). Handle the client events too if you want optimistic and HITL state in your projection. Otherwise, return `data` unchanged for them.
|
|
125
|
+
Import `EveAgentReducer` from `eve/svelte` when projecting events into application-specific state. The resulting `agent.data` uses the reducer's `TData` type. See [Custom reducer](./overview#custom-reducer) for the reducer contract and client projection events.
|
|
213
126
|
|
|
214
127
|
## What to read next
|
|
215
128
|
|
|
216
|
-
- [SvelteKit](./sveltekit): Vite plugin
|
|
217
|
-
- [Frontend overview](./overview): the shared
|
|
218
|
-
- [Sessions, runs
|
|
129
|
+
- [SvelteKit](./sveltekit): register the Vite plugin and mount the eve runtime.
|
|
130
|
+
- [Frontend overview](./overview): use the shared frontend API.
|
|
131
|
+
- [Sessions, runs, and streaming](../../concepts/sessions-runs-and-streaming): understand the underlying session protocol.
|
|
@@ -1,94 +1,66 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "useEveAgent (Vue)"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use the eve Vue composable and its Vue-specific reactive interface."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
`useEveAgent()` from `eve/vue`
|
|
6
|
+
`useEveAgent()` from `eve/vue` exposes the shared eve frontend client as Vue computed refs and methods. Read the [frontend overview](./overview) for session behavior, messages, human input, authorization, callbacks, reducers, and persistence. This page covers the Vue-specific interface.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Import the composable from `eve/vue`. Its state is exposed as `ComputedRef`s, so you read it unwrapped in templates:
|
|
11
|
-
|
|
12
|
-
```vue
|
|
13
|
-
<script setup lang="ts">
|
|
14
|
-
import { useEveAgent } from "eve/vue";
|
|
15
|
-
|
|
16
|
-
const { data } = useEveAgent();
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<template>
|
|
20
|
-
<div v-for="message in data.messages" :key="message.id">
|
|
21
|
-
<p>{{ message.role }}: {{ message.parts }}</p>
|
|
22
|
-
</div>
|
|
23
|
-
</template>
|
|
24
|
-
```
|
|
8
|
+
Nuxt users normally receive the composable as an auto-import after registering the [`eve/nuxt` module](./nuxt).
|
|
25
9
|
|
|
26
|
-
##
|
|
27
|
-
|
|
28
|
-
| Property | Type | Description |
|
|
29
|
-
| --------- | ---------------------------------------------- | ------------------------------------------------------------------------- |
|
|
30
|
-
| `data` | `ComputedRef<TData>` | Projected state. With the default reducer, `EveMessageData` (`messages`). |
|
|
31
|
-
| `status` | `ComputedRef<UseEveAgentStatus>` | `"ready"`, `"submitted"`, `"streaming"`, or `"error"`. |
|
|
32
|
-
| `error` | `ComputedRef<Error \| undefined>` | Last transport-level error. |
|
|
33
|
-
| `events` | `ComputedRef<readonly MessageStreamEvent[]>` | Raw server events for this session. |
|
|
34
|
-
| `session` | `ComputedRef<ClientSessionState \| undefined>` | Fixed session ID and stream cursor. |
|
|
35
|
-
| `send` | `(message, options?) => Promise<void>` | Send text or a multi-part message. |
|
|
36
|
-
| `respond` | `(inputResponses, options?) => Promise<void>` | Answer pending HITL input requests. |
|
|
37
|
-
| `stop` | `() => void` | Abort the client's in-flight stream. |
|
|
38
|
-
| `reset` | `() => void` | Clear state and start a new session. |
|
|
10
|
+
## Basic usage
|
|
39
11
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## Send a message
|
|
12
|
+
Import the composable from `eve/vue`. Its state is exposed as `ComputedRef`s, so templates unwrap it automatically:
|
|
43
13
|
|
|
44
14
|
```vue
|
|
45
15
|
<script setup lang="ts">
|
|
46
|
-
import { ref } from "vue";
|
|
47
16
|
import { useEveAgent } from "eve/vue";
|
|
17
|
+
import { computed, ref } from "vue";
|
|
48
18
|
|
|
49
|
-
const { send } = useEveAgent();
|
|
19
|
+
const { data, status, send } = useEveAgent();
|
|
50
20
|
const message = ref("");
|
|
21
|
+
const isBusy = computed(() => status.value === "submitted" || status.value === "streaming");
|
|
51
22
|
|
|
52
23
|
async function handleSubmit() {
|
|
53
24
|
const text = message.value.trim();
|
|
54
|
-
if (!text) return;
|
|
25
|
+
if (!text || isBusy.value) return;
|
|
55
26
|
message.value = "";
|
|
56
27
|
await send(text);
|
|
57
28
|
}
|
|
58
29
|
</script>
|
|
59
30
|
|
|
60
31
|
<template>
|
|
32
|
+
<div v-for="item in data.messages" :key="item.id">
|
|
33
|
+
<p>{{ item.role }}: {{ item.parts }}</p>
|
|
34
|
+
</div>
|
|
61
35
|
<form @submit.prevent="handleSubmit">
|
|
62
|
-
<input v-model="message"
|
|
63
|
-
<button type="submit">Send</button>
|
|
36
|
+
<input v-model="message" :disabled="isBusy" />
|
|
37
|
+
<button type="submit" :disabled="isBusy">Send</button>
|
|
64
38
|
</form>
|
|
65
39
|
</template>
|
|
66
40
|
```
|
|
67
41
|
|
|
68
|
-
|
|
42
|
+
## What it returns
|
|
69
43
|
|
|
70
|
-
|
|
71
|
-
<script setup lang="ts">
|
|
72
|
-
import { useEveAgent } from "eve/vue";
|
|
44
|
+
The state fields are computed refs; the commands are ordinary methods:
|
|
73
45
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
46
|
+
| Property | Vue shape |
|
|
47
|
+
| ---------------------------------- | ---------------------------------------------- |
|
|
48
|
+
| `data` | `ComputedRef<TData>` |
|
|
49
|
+
| `status` | `ComputedRef<UseEveAgentStatus>` |
|
|
50
|
+
| `error` | `ComputedRef<Error \| undefined>` |
|
|
51
|
+
| `events` | `ComputedRef<readonly MessageStreamEvent[]>` |
|
|
52
|
+
| `session` | `ComputedRef<ClientSessionState \| undefined>` |
|
|
53
|
+
| `send`, `respond`, `stop`, `reset` | Methods |
|
|
54
|
+
|
|
55
|
+
Destructuring preserves reactivity because each state value remains a ref. Read refs with `.value` in `<script>` and without `.value` in a template. The [shared returned-state reference](./overview#returned-state) describes what each value and command does.
|
|
56
|
+
|
|
57
|
+
## Send a message
|
|
58
|
+
|
|
59
|
+
Call `send(text)` for text or pass content parts for attachments. The API and transport behavior match the [shared sending guide](./overview#sending-and-streaming); only reactive access differs in Vue.
|
|
88
60
|
|
|
89
61
|
## Human-in-the-loop prompts
|
|
90
62
|
|
|
91
|
-
|
|
63
|
+
Pending requests appear in `data.value.messages`. Use the Vue exports when narrowing message parts, then answer through `respond()`:
|
|
92
64
|
|
|
93
65
|
```vue
|
|
94
66
|
<script setup lang="ts">
|
|
@@ -132,101 +104,30 @@ const pendingRequests = computed(() =>
|
|
|
132
104
|
</template>
|
|
133
105
|
```
|
|
134
106
|
|
|
135
|
-
|
|
107
|
+
See [Human-in-the-loop prompts](./overview#human-in-the-loop-prompts) for request semantics and rendering guidance.
|
|
136
108
|
|
|
137
109
|
## Stop, reset, and resume
|
|
138
110
|
|
|
139
|
-
`stop()`
|
|
140
|
-
|
|
141
|
-
```ts
|
|
142
|
-
const agent = useEveAgent({
|
|
143
|
-
initialSession: savedSessionState,
|
|
144
|
-
initialEvents: savedEvents,
|
|
145
|
-
onSessionChange: (session) => {
|
|
146
|
-
localStorage.setItem("eve-session", JSON.stringify(session));
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
```
|
|
111
|
+
Call `stop()` to detach the browser stream without cancelling server-side work, and `reset()` to clear local state and start a new session. Pass `initialSession` and `initialEvents` to restore a saved conversation. See [Resumable sessions](./overview#resumable-sessions) for the persistence contract and [Sending and streaming](./overview#sending-and-streaming) for cancellation behavior.
|
|
150
112
|
|
|
151
113
|
## Custom host and credentials
|
|
152
114
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
```ts
|
|
156
|
-
const agent = useEveAgent({
|
|
157
|
-
host: "https://agent.example.com",
|
|
158
|
-
headers: async () => ({
|
|
159
|
-
authorization: `Bearer ${await getAccessToken()}`,
|
|
160
|
-
}),
|
|
161
|
-
});
|
|
162
|
-
```
|
|
115
|
+
Pass `host`, `auth`, or `headers` to the composable using the same options as the other frontend bindings. See [Custom hosts and headers](./overview#custom-hosts-and-headers).
|
|
163
116
|
|
|
164
117
|
## Attach page context per turn
|
|
165
118
|
|
|
166
|
-
`clientContext`
|
|
167
|
-
|
|
168
|
-
```ts
|
|
169
|
-
await send("What should I do on this screen?", {
|
|
170
|
-
clientContext: { route: "/billing", plan: "pro", seatsUsed: 4 },
|
|
171
|
-
});
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
To attach the same context to every turn without threading it through each call site, pass `prepareSend`. It runs right before each send and returns the (possibly augmented) turn:
|
|
175
|
-
|
|
176
|
-
```ts
|
|
177
|
-
const agent = useEveAgent({
|
|
178
|
-
prepareSend: (input) => ({
|
|
179
|
-
...input,
|
|
180
|
-
clientContext: { route: location.pathname },
|
|
181
|
-
}),
|
|
182
|
-
});
|
|
183
|
-
```
|
|
119
|
+
Pass `clientContext` to `send()` or `respond()`, or use `prepareSend` to add context before every turn. See [Attach page context per turn](./overview#attach-page-context-per-turn).
|
|
184
120
|
|
|
185
121
|
## Lifecycle callbacks
|
|
186
122
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
- `onEvent(event)`: fires for each eve stream event as it arrives.
|
|
190
|
-
- `onError(error)`: fires with the last `Error` when a turn fails.
|
|
191
|
-
- `onFinish(snapshot)`: fires with the final snapshot once a turn settles.
|
|
192
|
-
- `onSessionChange(session)`: fires when the session cursor advances. Persist it to resume across reloads.
|
|
193
|
-
|
|
194
|
-
```ts
|
|
195
|
-
const agent = useEveAgent({
|
|
196
|
-
onEvent: (event) => console.debug(event.type),
|
|
197
|
-
onError: (error) => console.error(error.message),
|
|
198
|
-
onFinish: (snapshot) => console.log(snapshot.status),
|
|
199
|
-
});
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
The `optimistic` option (default `true`) projects submitted user messages into `data` before eve confirms them with a `message.received` event. These are reducer-facing projection events only; `events` stays the authoritative eve stream.
|
|
123
|
+
Pass `onEvent`, `onError`, `onFinish`, or `onSessionChange` when the application needs lifecycle notifications. See [Lifecycle callbacks](./overview#lifecycle-callbacks) for callback timing and optimistic projection behavior.
|
|
203
124
|
|
|
204
125
|
## Custom reducer
|
|
205
126
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
```ts
|
|
209
|
-
import { useEveAgent } from "eve/vue";
|
|
210
|
-
import type { EveAgentReducer } from "eve/vue";
|
|
211
|
-
|
|
212
|
-
interface ToolLog {
|
|
213
|
-
readonly toolCalls: number;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
const toolCounter: EveAgentReducer<ToolLog> = {
|
|
217
|
-
initial: () => ({ toolCalls: 0 }),
|
|
218
|
-
reduce: (data, event) =>
|
|
219
|
-
event.type === "actions.requested" ? { toolCalls: data.toolCalls + 1 } : data,
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
const agent = useEveAgent({ reducer: toolCounter });
|
|
223
|
-
// agent.data.value is ToolLog
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
`reduce(data, event)` receives both authoritative eve stream events and client projection events (`client.message.submitted`, `client.message.failed`, `client.input.responded`). Handle the client events too if you want optimistic and HITL state in your projection. Otherwise, return `data` unchanged for them.
|
|
127
|
+
Import `EveAgentReducer` from `eve/vue` when projecting events into application-specific state. The resulting `data` remains a `ComputedRef<TData>`. See [Custom reducer](./overview#custom-reducer) for the reducer contract and client projection events.
|
|
227
128
|
|
|
228
129
|
## What to read next
|
|
229
130
|
|
|
230
|
-
- [Nuxt](./nuxt): module
|
|
231
|
-
- [Frontend overview](./overview): the shared
|
|
232
|
-
- [Sessions, runs
|
|
131
|
+
- [Nuxt](./nuxt): register the module and mount the eve runtime.
|
|
132
|
+
- [Frontend overview](./overview): use the shared frontend API.
|
|
133
|
+
- [Sessions, runs, and streaming](../../concepts/sessions-runs-and-streaming): understand the underlying session protocol.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "Observability"
|
|
3
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
4
|
---
|
|
5
5
|
|
|
@@ -48,11 +48,11 @@ Any OTel-compatible backend works (Braintrust, PostHog, Raindrop, Arize, Honeyco
|
|
|
48
48
|
|
|
49
49
|
Three more fields control what the AI SDK records inside those spans (see the AI SDK's [telemetry reference](https://ai-sdk.dev/docs/ai-sdk-core/telemetry)):
|
|
50
50
|
|
|
51
|
-
- `recordInputs` records full message history on each step span
|
|
52
|
-
- `recordOutputs` records model outputs on spans
|
|
51
|
+
- `recordInputs` records full message history on each step span. It defaults to `false`; set it to `true` to include input content.
|
|
52
|
+
- `recordOutputs` records model outputs on spans. It defaults to `false`; set it to `true` to include output content.
|
|
53
53
|
- `functionId` overrides the function name on spans (defaults to the agent name).
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
eve records metadata without model or tool inputs and outputs by default. Enable either content category only after reviewing the exporter and its data-retention path.
|
|
56
56
|
|
|
57
57
|
You are responsible for ensuring any observability or eval provider is approved for the data exported to it.
|
|
58
58
|
|
|
@@ -173,20 +173,20 @@ Tag writes are best-effort: a failure is logged once per process and then swallo
|
|
|
173
173
|
|
|
174
174
|
These tags power the **Agent Runs** tab in the Vercel dashboard. When you deploy on Vercel, the platform auto-detects `eve` as the framework and surfaces an Agent Runs view under your project's **Observability** tab, where you can browse sessions and drill into each conversation's trace, with no `instrumentation.ts` required. The tab is currently gated per team. See [Deploy to Vercel](./deployment/vercel#inspect-agent-runs) for enablement. Agent Runs is separate from the OpenTelemetry export above. Use OTel when you want spans in Braintrust, PostHog, Datadog, or another third-party backend.
|
|
175
175
|
|
|
176
|
-
Note: By default, telemetry records full message history and model outputs You may need to disclose these data flows in your privacy materials if utilized.
|
|
177
|
-
|
|
178
176
|
## Local traces
|
|
179
177
|
|
|
180
178
|
Without an `instrumentation.ts`, `eve dev` records spans to disk — one trace per session, with turns, model steps, and tool calls. Read them two ways:
|
|
181
179
|
|
|
182
|
-
- [`/traces`](dev-tui#
|
|
180
|
+
- [`/traces`](dev-tui#logs-and-traces) in the dev TUI: a live trace viewer that replays captured content as a conversation.
|
|
183
181
|
- [`eve traces`](../reference/cli#eve-traces): a span tree in the terminal, `eve traces ls` to list. Works after `eve dev` exits.
|
|
184
182
|
|
|
183
|
+
Local traces omit model and tool inputs and outputs by default. Set `EVE_TRACES_CONTENT=on` in `.env.local` to capture that content.
|
|
184
|
+
|
|
185
185
|
Writing `instrumentation.ts` replaces this: your `setup` takes over and nothing is recorded locally. For span attributes, retention, and the `EVE_TRACES*` variables, see [`eve traces`](../reference/cli#eve-traces).
|
|
186
186
|
|
|
187
187
|
## Debugging
|
|
188
188
|
|
|
189
|
-
`eve info` is the fastest way to see what eve actually picked up: the active tools, skills, subagents, schedules, routes, and discovery diagnostics. eve also writes inspectable artifacts under `.eve/`, kept even when discovery hits errors:
|
|
189
|
+
`eve info` is the fastest way to see what eve actually picked up: ordered static instructions with their roles, plus the active tools, skills, subagents, schedules, routes, and discovery diagnostics. Dynamic instruction results exist only at runtime and are not part of this static inspection. eve also writes inspectable artifacts under `.eve/`, kept even when discovery hits errors:
|
|
190
190
|
|
|
191
191
|
| Artifact | Tells you |
|
|
192
192
|
| ------------------------------- | ------------------------------------------- |
|
|
@@ -199,13 +199,13 @@ When `eve build` fails on discovery errors, the CLI prints the full diagnostics
|
|
|
199
199
|
|
|
200
200
|
### Common failures
|
|
201
201
|
|
|
202
|
-
| Symptom | Likely cause and fix
|
|
203
|
-
| --------------------------------------------- |
|
|
204
|
-
| Tool not discovered (the model never sees it) | Run `eve info`. Confirm the file is in the right slot (`agent/tools/<name>.ts`) and default-exports `defineTool(...)`, and check `.eve/diagnostics.json` for shape errors. `schedules/` are root-only.
|
|
205
|
-
| Model won't call a tool it should | Tighten the tool `description` and `inputSchema`; put procedural guidance in a [skill](../skills), not the description. Confirm it's in the active set with `eve info`.
|
|
206
|
-
| Stuck on `session.waiting` | The turn is parked for input. Answer the pending approval or question, or POST a follow-up to `/eve/v1/session/:sessionId`.
|
|
207
|
-
| 401 on production routes | Expected: auth fails closed. Replace `placeholderAuth()` with your route policy. Use `vercelOidc()` only for Vercel-issued tokens; otherwise configure `httpBasic()`, JWT/OIDC helpers, or a custom `AuthFn`. See [
|
|
208
|
-
| Build fails with discovery errors | Read the printed diagnostics and `.eve/diagnostics.json`; confirm the root-vs-subagent boundary is valid and secrets come from env vars.
|
|
202
|
+
| Symptom | Likely cause and fix |
|
|
203
|
+
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
204
|
+
| Tool not discovered (the model never sees it) | Run `eve info`. Confirm the file is in the right slot (`agent/tools/<name>.ts`) and default-exports `defineTool(...)`, and check `.eve/diagnostics.json` for shape errors. `schedules/` are root-only. |
|
|
205
|
+
| Model won't call a tool it should | Tighten the tool `description` and `inputSchema`; put procedural guidance in a [skill](../skills), not the description. Confirm it's in the active set with `eve info`. |
|
|
206
|
+
| Stuck on `session.waiting` | The turn is parked for input. Answer the pending approval or question, or POST a follow-up to `/eve/v1/session/:sessionId`. |
|
|
207
|
+
| 401 on production routes | Expected: auth fails closed. Replace `placeholderAuth()` with your route policy. Use `vercelOidc()` only for Vercel-issued tokens; otherwise configure `httpBasic()`, JWT/OIDC helpers, or a custom `AuthFn`. See [Authentication](./auth-and-route-protection). |
|
|
208
|
+
| Build fails with discovery errors | Read the printed diagnostics and `.eve/diagnostics.json`; confirm the root-vs-subagent boundary is valid and secrets come from env vars. |
|
|
209
209
|
|
|
210
210
|
## What to read next
|
|
211
211
|
|
package/docs/guides/meta.json
CHANGED