eve 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/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/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 +11 -2
- package/dist/src/evals/session.js +1 -1
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +10 -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/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/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/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/dynamic-tool-definition.d.ts +3 -4
- package/dist/src/shared/instructions-definition.d.ts +15 -11
- 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 +5 -5
- 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 +22 -10
- 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/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 +26 -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 +1 -10
- 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 +34 -34
- package/docs/reference/meta.json +1 -1
- package/docs/reference/typescript-api.md +4 -2
- 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/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
|
@@ -34,7 +34,7 @@ Keep credentials in your deployment environment or secret manager. Don’t inclu
|
|
|
34
34
|
|
|
35
35
|
Your model configuration determines the required credential. A string model ID uses the [Vercel AI Gateway](https://vercel.com/docs/ai-gateway) and requires Vercel project OpenID Connect (OIDC) or `AI_GATEWAY_API_KEY`. A provider-authored model uses that provider’s package and API key. See [Agent configuration](../../agent-config#set-the-model) for both forms.
|
|
36
36
|
|
|
37
|
-
Configure production route authentication separately from model access. The default policy rejects browser traffic in production. See [
|
|
37
|
+
Configure production route authentication separately from model access. The default policy rejects browser traffic in production. See [Authentication](../auth-and-route-protection) for the available policies and secret requirements.
|
|
38
38
|
|
|
39
39
|
## Verify the deployment
|
|
40
40
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Self-
|
|
2
|
+
title: "Self-Host eve"
|
|
3
3
|
description: "Run an eve agent as a Node service with your own workflow storage, sandbox backend, and routing."
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -22,7 +22,7 @@ Run this process under the same process manager or container platform you use fo
|
|
|
22
22
|
|
|
23
23
|
Set `AI_GATEWAY_API_KEY` to use a string model ID through the Vercel AI Gateway from a non-Vercel host. To call a provider directly, install its [AI SDK provider package](https://ai-sdk.dev/docs/foundations/providers-and-models). Then pass its model object in `agent.ts` and set its API key. See [Agent configuration](../../agent-config#set-the-model) for examples.
|
|
24
24
|
|
|
25
|
-
Don’t rely on `vercelOidc()` as the only production authenticator outside Vercel. Configure Basic auth, JSON Web Token (JWT) verification, generic OpenID Connect (OIDC), or a custom verifier that your host can validate. See [
|
|
25
|
+
Don’t rely on `vercelOidc()` as the only production authenticator outside Vercel. Configure Basic auth, JSON Web Token (JWT) verification, generic OpenID Connect (OIDC), or a custom verifier that your host can validate. See [Authentication](../auth-and-route-protection).
|
|
26
26
|
|
|
27
27
|
## Persist workflow state
|
|
28
28
|
|
|
@@ -83,6 +83,6 @@ eve dev https://your_agent.example.com
|
|
|
83
83
|
|
|
84
84
|
Use these guides to secure and observe the deployed agent:
|
|
85
85
|
|
|
86
|
-
- [
|
|
86
|
+
- [Authentication](../auth-and-route-protection): configure the host’s route policy
|
|
87
87
|
- [Observability](../instrumentation): export traces and diagnose runtime failures
|
|
88
88
|
- [Sandbox](../../sandbox): select and secure a sandbox backend
|
|
@@ -85,6 +85,6 @@ The Agent Runs tab requires enablement for your Vercel team. Contact your Vercel
|
|
|
85
85
|
|
|
86
86
|
Use these guides to secure and observe the deployed agent:
|
|
87
87
|
|
|
88
|
-
- [
|
|
88
|
+
- [Authentication](../auth-and-route-protection): configure who can call the deployed agent
|
|
89
89
|
- [Observability](../instrumentation): export traces and diagnose runtime failures
|
|
90
90
|
- [Sandbox](../../sandbox): configure resources, isolation, and network access
|
package/docs/guides/dev-tui.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "Terminal UI"
|
|
3
3
|
description: "Use eve locally or connect to a deployed agent from an interactive terminal UI."
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -57,23 +57,13 @@ Use `/traces` to inspect traces recorded during local development. See [Instrume
|
|
|
57
57
|
|
|
58
58
|
## Display options
|
|
59
59
|
|
|
60
|
-
Use `eve dev` flags to control
|
|
60
|
+
Use `eve dev` flags to control tool calls, reasoning, subagents, connection authorization, response statistics, context usage, and logs:
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
63
|
eve dev --tools full --reasoning collapsed --logs all
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
| ---------------------------- | ----------------------------------------------- | -------------------------------------------------- |
|
|
68
|
-
| `--tools` | `full`, `collapsed`, `auto-collapsed`, `hidden` | Tool-call display. |
|
|
69
|
-
| `--reasoning` | `full`, `collapsed`, `auto-collapsed`, `hidden` | Reasoning display. |
|
|
70
|
-
| `--subagents` | `full`, `collapsed`, `auto-collapsed`, `hidden` | Subagent display. |
|
|
71
|
-
| `--connection-auth` | `full`, `collapsed`, `auto-collapsed`, `hidden` | Connection-authorization display. |
|
|
72
|
-
| `--assistant-response-stats` | `tokens`, `tokensPerSecond` | Assistant response statistic. |
|
|
73
|
-
| `--context-size` | Token count | Model context-window size for the usage indicator. |
|
|
74
|
-
| `--logs` | `all`, `stderr`, `sandbox`, `none` | Initial log display mode. |
|
|
75
|
-
|
|
76
|
-
Use `--host` and `--port` to bind the local server, or `--no-ui` to run without the terminal UI. See the [CLI reference](../reference/cli#eve-dev) for all options.
|
|
66
|
+
Use `--host` and `--port` to bind the local server, or `--no-ui` to run without the terminal UI. See the [`eve dev` CLI reference](../reference/cli#eve-dev) for the complete option list, accepted values, and defaults.
|
|
77
67
|
|
|
78
68
|
## Connect to a deployment
|
|
79
69
|
|
|
@@ -212,7 +212,7 @@ Skills follow the same naming rule as tools: a single `defineSkill(...)` is name
|
|
|
212
212
|
|
|
213
213
|
## Dynamic instructions
|
|
214
214
|
|
|
215
|
-
A dynamic instructions file
|
|
215
|
+
A dynamic instructions file returns `defineInstructions({ content, role? })` built from the principal, tenant, channel, or external data. Omit `role` for system context:
|
|
216
216
|
|
|
217
217
|
```ts title="agent/instructions/persona.ts"
|
|
218
218
|
import { defineDynamic, defineInstructions } from "eve/instructions";
|
|
@@ -222,14 +222,36 @@ export default defineDynamic({
|
|
|
222
222
|
"session.started": (_event, ctx) => {
|
|
223
223
|
const plan = ctx.session.auth.current?.attributes.plan ?? "free";
|
|
224
224
|
return defineInstructions({
|
|
225
|
-
|
|
225
|
+
content: `The caller is on the ${plan} plan. Match the depth of your answers to it.`,
|
|
226
226
|
});
|
|
227
227
|
},
|
|
228
228
|
},
|
|
229
229
|
});
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
Use `role: "user"` when the resolved value is application or user context that should become part of durable history:
|
|
233
|
+
|
|
234
|
+
```ts title="agent/instructions/brief.ts"
|
|
235
|
+
import { defineDynamic, defineInstructions } from "eve/instructions";
|
|
236
|
+
import { loadBrief } from "../lib/briefs";
|
|
237
|
+
|
|
238
|
+
export default defineDynamic({
|
|
239
|
+
events: {
|
|
240
|
+
"turn.started": async (_event, ctx) => {
|
|
241
|
+
const brief = await loadBrief(ctx.session.auth.current);
|
|
242
|
+
return brief ? defineInstructions({ content: brief, role: "user" }) : null;
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
});
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Instruction resolvers support `session.started` and `turn.started` only. A system result lives in that scope and stays outside history. A user result is appended to history at the lifecycle boundary, with session results before turn results and both before the current delivery. There is no automatic deduplication: returning the same user content on a later turn intentionally appends another message.
|
|
249
|
+
|
|
250
|
+
Resolver snapshots reflect that order. At `session.started`, `ctx.messages` includes static user-role instructions. At `turn.started`, it also includes user-role results from `session.started`. These augmented snapshots are specific to instruction resolvers; tools, skills, models, and subagents keep their existing message snapshots.
|
|
251
|
+
|
|
252
|
+
Returning `null` or blank content contributes nothing. A throwing or invalid session resolver leaves any wider valid system selection in place. Every turn starts with fresh turn-scoped system instructions, so a failed or empty turn result cannot leak the previous turn's value. Completed lifecycle steps are replay-safe: parking, resuming, or replaying them does not duplicate user-role messages.
|
|
253
|
+
|
|
254
|
+
Dynamic system content that changes frequently can reduce provider prompt-cache reuse. Prefer session scope for stable values and use turn scope only when the context must be refreshed. Cache behavior remains provider-specific.
|
|
233
255
|
|
|
234
256
|
## What to read next
|
|
235
257
|
|
|
@@ -237,4 +259,4 @@ Both resolve before the prompt is assembled, so the model sees the right instruc
|
|
|
237
259
|
- The static tool basics this builds on → [Tools](../tools)
|
|
238
260
|
- The built-in tools and how to override them → [Default harness](../concepts/default-harness)
|
|
239
261
|
- Authenticate a tool or connection to an external service → [Auth & route protection](./auth-and-route-protection)
|
|
240
|
-
- Durable per-session memory for resolvers to read → [State](
|
|
262
|
+
- Durable per-session memory for resolvers to read → [State](../concepts/state)
|
|
@@ -88,16 +88,7 @@ const agent = useEveAgent({
|
|
|
88
88
|
});
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
The
|
|
92
|
-
|
|
93
|
-
```ts title="agent/channels/eve.ts"
|
|
94
|
-
import { eveChannel } from "eve/channels/eve";
|
|
95
|
-
import { localDev, vercelOidc } from "eve/channels/auth";
|
|
96
|
-
|
|
97
|
-
export default eveChannel({ auth: [vercelOidc(), localDev()] });
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
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).
|
|
91
|
+
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.
|
|
101
92
|
|
|
102
93
|
## Dev vs deploy topology
|
|
103
94
|
|
|
@@ -60,16 +60,7 @@ async function handleSubmit() {
|
|
|
60
60
|
</template>
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
The
|
|
64
|
-
|
|
65
|
-
```ts title="agent/channels/eve.ts"
|
|
66
|
-
import { eveChannel } from "eve/channels/eve";
|
|
67
|
-
import { localDev, vercelOidc } from "eve/channels/auth";
|
|
68
|
-
|
|
69
|
-
export default eveChannel({ auth: [vercelOidc(), localDev()] });
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
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).
|
|
63
|
+
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.
|
|
73
64
|
|
|
74
65
|
## Dev vs deploy topology
|
|
75
66
|
|
|
@@ -14,7 +14,15 @@ A browser UI is a client of the agent's HTTP routes (the [eve channel](../../cha
|
|
|
14
14
|
|
|
15
15
|
The per-framework pages below walk through the wiring step by step: [Next.js](./nextjs), [Nuxt](./nuxt), and [SvelteKit](./sveltekit).
|
|
16
16
|
|
|
17
|
-
For scripts, server-to-server calls, evals, tests, or custom clients that do not need framework UI state, use the [
|
|
17
|
+
For scripts, server-to-server calls, evals, tests, or custom clients that do not need framework UI state, use the [Client SDK](../client/overview) directly.
|
|
18
|
+
|
|
19
|
+
## Authenticate browser requests
|
|
20
|
+
|
|
21
|
+
A same-origin framework integration sends your application cookies with every eve request. For bearer tokens or another non-cookie scheme, pass `auth` or `headers` to `useEveAgent`.
|
|
22
|
+
|
|
23
|
+
The default eve channel fails closed. Without an authored `agent/channels/eve.ts`, production browser traffic receives `401` from the default `[vercelOidc(), localDev(), placeholderAuth()]` policy. Add the channel file with an `AuthFn` that verifies your application session or token.
|
|
24
|
+
|
|
25
|
+
For a public demo, use `none()` from `eve/channels/auth` to admit anonymous requests explicitly. Do not use `none()` for an agent that handles private or production data. See [Authentication](../auth-and-route-protection) for application-session examples, token verifiers, and the default policy.
|
|
18
26
|
|
|
19
27
|
## Basic chat (React)
|
|
20
28
|
|
|
@@ -204,11 +212,12 @@ const agent = useEveAgent({
|
|
|
204
212
|
|
|
205
213
|
## Lifecycle callbacks
|
|
206
214
|
|
|
207
|
-
|
|
215
|
+
The hook accepts these lifecycle callbacks:
|
|
208
216
|
|
|
209
217
|
- `onEvent(event)`: fires for each eve stream event as it arrives.
|
|
210
218
|
- `onError(error)`: fires with the last `Error` when a turn fails.
|
|
211
219
|
- `onFinish(snapshot)`: fires with the final `{ data, status, session, ... }` snapshot once a turn settles.
|
|
220
|
+
- `onSessionChange(session)`: fires when the session cursor advances. Persist it to resume across reloads.
|
|
212
221
|
|
|
213
222
|
```tsx
|
|
214
223
|
const agent = useEveAgent({
|
|
@@ -320,5 +329,5 @@ const support = useEveAgent({ agent: "support" });
|
|
|
320
329
|
|
|
321
330
|
- [Sessions, runs & streaming](../../concepts/sessions-runs-and-streaming): the event stream and session cursor
|
|
322
331
|
- [Channels](../../channels/overview): the HTTP routes the hook talks to
|
|
323
|
-
- [
|
|
332
|
+
- [Client SDK](../client/overview): the lower-level client underneath the frontend hooks
|
|
324
333
|
- [Next.js](./nextjs): step-by-step setup for wiring eve into a Next.js app
|
|
@@ -69,16 +69,7 @@ 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
|
|
|
@@ -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.
|