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.
Files changed (280) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +3 -3
  3. package/dist/src/chunks/{use-eve-agent-BNdcle_M.js → use-eve-agent-COmP-H8R.js} +6 -3
  4. package/dist/src/chunks/{use-eve-agent-FJkEMXYk.js → use-eve-agent-CnppTEFk.js} +6 -3
  5. package/dist/src/cli/commands/info.js +1 -1
  6. package/dist/src/cli/commands/trace-detail.d.ts +3 -2
  7. package/dist/src/cli/commands/trace-detail.js +1 -1
  8. package/dist/src/cli/dev/tui/traces/trace-conversation.d.ts +4 -6
  9. package/dist/src/cli/dev/tui/traces/trace-conversation.js +1 -2
  10. package/dist/src/client/agent-info-schema.d.ts +12 -4
  11. package/dist/src/client/agent-info-schema.js +1 -1
  12. package/dist/src/client/index.d.ts +1 -1
  13. package/dist/src/compiled/.vendor-stamp.json +3 -3
  14. package/dist/src/compiled/@chat-adapter/slack/index.js +1 -1
  15. package/dist/src/compiled/@workflow/core/index.js +1 -1
  16. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  17. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  18. package/dist/src/compiled/@workflow/world/env-config.d.ts +1 -0
  19. package/dist/src/compiled/@workflow/world/events.d.ts +92 -35
  20. package/dist/src/compiled/@workflow/world/index.d.ts +3 -2
  21. package/dist/src/compiled/@workflow/world/interfaces.d.ts +25 -23
  22. package/dist/src/compiled/@workflow/world/queue.d.ts +4 -0
  23. package/dist/src/compiled/@workflow/world/runs.d.ts +4 -0
  24. package/dist/src/compiled/@workflow/world/slot-identity.d.ts +53 -0
  25. package/dist/src/compiled/@workflow/world/spec-version.d.ts +36 -1
  26. package/dist/src/compiled/@workflow/world/steps.d.ts +4 -0
  27. package/dist/src/compiled/@workflow/world/ulid.d.ts +6 -0
  28. package/dist/src/compiled/@workflow/world-local/index.js +4 -4
  29. package/dist/src/compiled/@workflow/world-vercel/index.js +13 -17
  30. package/dist/src/compiled/_chunks/workflow/{attribute-changes-6OqdYdi4.js → attribute-changes-BoH7JsWp.js} +3 -3
  31. package/dist/src/compiled/_chunks/workflow/dist-DlFv0aHY.js +40 -0
  32. package/dist/src/compiled/_chunks/workflow/env-config-DxamfI7T.js +1 -0
  33. package/dist/src/compiled/_chunks/workflow/frames-CTpeJYEQ.js +3 -0
  34. package/dist/src/compiled/_chunks/workflow/{functions-CXb61C6h.js → functions-CeeNvKsq.js} +1 -1
  35. package/dist/src/compiled/_chunks/workflow/resume-hook-BPQHjeY5.js +1 -0
  36. package/dist/src/compiled/_chunks/workflow/run-DQ5dOyjm.js +1 -0
  37. package/dist/src/compiled/_chunks/workflow/run-id-BdE0MZz9.js +1 -0
  38. package/dist/src/compiled/_chunks/workflow/sleep-CzdoBiqy.js +1 -0
  39. package/dist/src/compiled/_chunks/workflow/spec-version-DBUVfF_R.js +1 -0
  40. package/dist/src/compiled/_chunks/workflow/undici-CUIybhQ2.js +95 -0
  41. package/dist/src/compiled/_chunks/workflow/wait-until-DK2lnH6U.js +15 -0
  42. package/dist/src/compiled/_chunks/workflow/{wrapper-CDq65xJV.js → wrapper-CMGju7QA.js} +1 -1
  43. package/dist/src/compiled/_chunks/workflow/ws-transport-Csi6Cydc.js +1 -0
  44. package/dist/src/compiler/extension-compatibility.d.ts +10 -10
  45. package/dist/src/compiler/extension-compatibility.js +1 -1
  46. package/dist/src/compiler/manifest.d.ts +8 -8
  47. package/dist/src/compiler/manifest.js +1 -1
  48. package/dist/src/compiler/normalize-extension.d.ts +3 -3
  49. package/dist/src/compiler/normalize-extension.js +1 -1
  50. package/dist/src/compiler/normalize-instructions.d.ts +1 -1
  51. package/dist/src/compiler/normalize-instructions.js +1 -1
  52. package/dist/src/compiler/normalize-manifest.js +1 -3
  53. package/dist/src/context/dynamic-instruction-lifecycle.d.ts +5 -1
  54. package/dist/src/context/dynamic-instruction-lifecycle.js +1 -1
  55. package/dist/src/context/keys.d.ts +6 -2
  56. package/dist/src/context/keys.js +1 -1
  57. package/dist/src/discover/manifest.d.ts +1 -1
  58. package/dist/src/discover/manifest.js +1 -1
  59. package/dist/src/evals/context.js +1 -1
  60. package/dist/src/evals/index.d.ts +2 -2
  61. package/dist/src/evals/reporters/index.d.ts +1 -1
  62. package/dist/src/evals/runner/artifacts.js +1 -1
  63. package/dist/src/evals/runner/execute-eval.d.ts +5 -0
  64. package/dist/src/evals/runner/execute-eval.js +1 -1
  65. package/dist/src/evals/runner/execute-task.d.ts +3 -0
  66. package/dist/src/evals/runner/execute-task.js +1 -1
  67. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  68. package/dist/src/evals/runner/reporters/types.d.ts +28 -2
  69. package/dist/src/evals/runner/run-evals.js +1 -1
  70. package/dist/src/evals/session.d.ts +12 -2
  71. package/dist/src/evals/session.js +1 -1
  72. package/dist/src/evals/target.js +1 -1
  73. package/dist/src/evals/types.d.ts +12 -1
  74. package/dist/src/execution/node-step.js +1 -1
  75. package/dist/src/execution/session.js +1 -1
  76. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  77. package/dist/src/execution/workflow-steps.js +1 -1
  78. package/dist/src/execution/workflow-trace-context.d.ts +11 -0
  79. package/dist/src/execution/workflow-trace-context.js +1 -0
  80. package/dist/src/harness/ai-sdk-hook-bridge.d.ts +1 -1
  81. package/dist/src/harness/ai-sdk-hook-bridge.js +1 -1
  82. package/dist/src/harness/approval-delivery-coordinator.js +1 -1
  83. package/dist/src/harness/channel-delivery-instrumentation.d.ts +1 -1
  84. package/dist/src/harness/channel-delivery-instrumentation.js +1 -1
  85. package/dist/src/harness/emission.d.ts +2 -2
  86. package/dist/src/harness/emission.js +1 -1
  87. package/dist/src/harness/instrumentation/config.js +1 -0
  88. package/dist/src/harness/{instrumentation-content.d.ts → instrumentation/content.d.ts} +1 -1
  89. package/dist/src/harness/{instrumentation-dispatch.d.ts → instrumentation/dispatch.d.ts} +1 -1
  90. package/dist/src/harness/{instrumentation-dispatch.js → instrumentation/dispatch.js} +1 -1
  91. package/dist/src/harness/{instrumentation-lifecycle.d.ts → instrumentation/lifecycle.d.ts} +3 -6
  92. package/dist/src/harness/{instrumentation-lifecycle.js → instrumentation/lifecycle.js} +1 -1
  93. package/dist/src/harness/{instrumentation-native-events.d.ts → instrumentation/native-events.d.ts} +1 -1
  94. package/dist/src/harness/{instrumentation-native-events.js → instrumentation/native-events.js} +1 -1
  95. package/dist/src/harness/{instrumentation-providers.d.ts → instrumentation/providers.d.ts} +1 -1
  96. package/dist/src/harness/{instrumentation-providers.js → instrumentation/providers.js} +1 -1
  97. package/dist/src/harness/{instrumentation-runtime.d.ts → instrumentation/runtime.d.ts} +4 -2
  98. package/dist/src/harness/{instrumentation-state.d.ts → instrumentation/state.d.ts} +1 -1
  99. package/dist/src/harness/parent-lineage.d.ts +1 -1
  100. package/dist/src/harness/prepare-trace-context.d.ts +16 -0
  101. package/dist/src/harness/prepare-trace-context.js +1 -0
  102. package/dist/src/harness/tool-loop.js +2 -2
  103. package/dist/src/harness/types.d.ts +1 -1
  104. package/dist/src/internal/application/compiled-artifacts.js +2 -2
  105. package/dist/src/internal/application/package.js +1 -1
  106. package/dist/src/internal/authored-definition/core.d.ts +3 -3
  107. package/dist/src/internal/authored-definition/core.js +1 -1
  108. package/dist/src/internal/authored-package-boundary.js +1 -1
  109. package/dist/src/internal/helpers/markdown.js +1 -1
  110. package/dist/src/internal/instrumentation.d.ts +1 -1
  111. package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
  112. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
  113. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +4 -3
  114. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
  115. package/dist/src/internal/nitro/routes/channel-request-instrumentation.js +1 -1
  116. package/dist/src/internal/vercel/project-link.d.ts +1 -1
  117. package/dist/src/internal/vercel/project-link.js +1 -1
  118. package/dist/src/internal/vercel-agent-summary.d.ts +10 -9
  119. package/dist/src/internal/vercel-agent-summary.js +1 -1
  120. package/dist/src/internal/workflow/development-world-client.js +1 -1
  121. package/dist/src/protocol/message.d.ts +15 -1
  122. package/dist/src/protocol/message.js +1 -1
  123. package/dist/src/public/channels/github/auth.d.ts +30 -0
  124. package/dist/src/public/channels/github/auth.js +2 -2
  125. package/dist/src/public/channels/github/defaults.d.ts +4 -4
  126. package/dist/src/public/channels/github/defaults.js +1 -1
  127. package/dist/src/public/channels/github/dispatch.d.ts +3 -2
  128. package/dist/src/public/channels/github/dispatch.js +1 -1
  129. package/dist/src/public/channels/github/githubChannel.d.ts +7 -2
  130. package/dist/src/public/channels/github/githubChannel.js +1 -1
  131. package/dist/src/public/channels/github/index.d.ts +1 -1
  132. package/dist/src/public/definitions/instructions.d.ts +14 -4
  133. package/dist/src/public/definitions/instructions.js +1 -1
  134. package/dist/src/public/definitions/tool.d.ts +5 -8
  135. package/dist/src/public/instructions/index.d.ts +1 -2
  136. package/dist/src/public/instructions/index.js +1 -1
  137. package/dist/src/public/instrumentation/index.d.ts +4 -3
  138. package/dist/src/public/instrumentation/otel.d.ts +5 -4
  139. package/dist/src/public/instrumentation/provider.d.ts +2 -2
  140. package/dist/src/public/nuxt/module.js +1 -1
  141. package/dist/src/public/sveltekit/index.d.ts +6 -20
  142. package/dist/src/public/sveltekit/index.js +1 -1
  143. package/dist/src/public/sveltekit/routing.d.ts +0 -24
  144. package/dist/src/public/sveltekit/routing.js +1 -1
  145. package/dist/src/runtime/agent/bootstrap.d.ts +2 -0
  146. package/dist/src/runtime/agent/bootstrap.js +1 -1
  147. package/dist/src/runtime/prompt/compose.d.ts +1 -1
  148. package/dist/src/runtime/prompt/compose.js +3 -1
  149. package/dist/src/runtime/resolve-agent.js +1 -1
  150. package/dist/src/runtime/types.d.ts +4 -3
  151. package/dist/src/setup/boxes/select-model.d.ts +6 -6
  152. package/dist/src/setup/boxes/select-model.js +1 -1
  153. package/dist/src/setup/project-resolution.d.ts +3 -3
  154. package/dist/src/setup/scaffold/create/project.js +1 -1
  155. package/dist/src/setup/slack-connect-lifecycle.d.ts +0 -9
  156. package/dist/src/setup/slack-connect-lifecycle.js +1 -1
  157. package/dist/src/setup/slackbot.d.ts +2 -1
  158. package/dist/src/setup/slackbot.js +1 -1
  159. package/dist/src/shared/default-agent-model.d.ts +1 -1
  160. package/dist/src/shared/default-agent-model.js +1 -1
  161. package/dist/src/shared/dynamic-tool-definition.d.ts +3 -4
  162. package/dist/src/shared/instructions-definition.d.ts +15 -11
  163. package/dist/src/{public/nuxt → shared}/vercel-services.d.ts +18 -19
  164. package/dist/src/shared/vercel-services.js +1 -0
  165. package/dist/src/svelte/index.js +1 -1
  166. package/dist/src/svelte/use-eve-agent.js +1 -1
  167. package/dist/src/tracing/agent-action-instrumentation.d.ts +1 -1
  168. package/dist/src/tracing/agent-action-instrumentation.js +1 -1
  169. package/dist/src/tracing/agent-approval-instrumentation.d.ts +1 -1
  170. package/dist/src/tracing/agent-channel-delivery-instrumentation.d.ts +1 -1
  171. package/dist/src/tracing/agent-channel-delivery-instrumentation.js +1 -1
  172. package/dist/src/tracing/agent-otel-provider.d.ts +4 -2
  173. package/dist/src/tracing/agent-otel-provider.js +2 -2
  174. package/dist/src/tracing/agent-otel-session-context.d.ts +17 -0
  175. package/dist/src/tracing/agent-otel-session-context.js +1 -0
  176. package/dist/src/tracing/agent-otel-usage.d.ts +1 -1
  177. package/dist/src/tracing/agent-tool-instrumentation.d.ts +1 -1
  178. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  179. package/dist/src/tracing/agent-trace-state.d.ts +1 -1
  180. package/dist/src/tracing/install-instrumentation-runtime.d.ts +2 -2
  181. package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
  182. package/dist/src/tracing/local-instrumentation-runtime.d.ts +1 -1
  183. package/dist/src/tracing/local-instrumentation-runtime.js +1 -1
  184. package/dist/src/tracing/local-traces.d.ts +3 -3
  185. package/dist/src/tracing/local-traces.js +1 -1
  186. package/dist/src/tracing/otel-declaration.d.ts +2 -2
  187. package/dist/src/tracing/otel-declaration.js +1 -1
  188. package/dist/src/vue/index.js +1 -1
  189. package/dist/src/vue/use-eve-agent.js +1 -1
  190. package/docs/README.md +18 -20
  191. package/docs/agent-config.md +9 -6
  192. package/docs/channels/custom.mdx +1 -1
  193. package/docs/channels/eve.mdx +10 -56
  194. package/docs/channels/github.mdx +1 -1
  195. package/docs/channels/meta.json +1 -0
  196. package/docs/concepts/context-control.md +32 -56
  197. package/docs/concepts/default-harness.md +2 -2
  198. package/docs/concepts/execution-model-and-durability.mdx +4 -4
  199. package/docs/concepts/meta.json +3 -1
  200. package/docs/concepts/sessions-runs-and-streaming.md +23 -11
  201. package/docs/{guides → concepts}/state.md +3 -3
  202. package/docs/connections/mcp.mdx +6 -89
  203. package/docs/connections/meta.json +1 -0
  204. package/docs/connections/openapi.mdx +5 -69
  205. package/docs/connections/overview.mdx +29 -3
  206. package/docs/evals/meta.json +1 -0
  207. package/docs/evals/reporters.mdx +14 -4
  208. package/docs/extensions.md +1 -1
  209. package/docs/getting-started.mdx +175 -13
  210. package/docs/guides/auth-and-route-protection.md +3 -18
  211. package/docs/guides/client/messages.mdx +3 -1
  212. package/docs/guides/client/meta.json +2 -1
  213. package/docs/guides/client/output-schema.mdx +2 -2
  214. package/docs/guides/client/overview.mdx +1 -1
  215. package/docs/guides/deployment/meta.json +1 -0
  216. package/docs/guides/deployment/overview.md +1 -1
  217. package/docs/guides/deployment/self-hosting.md +3 -3
  218. package/docs/guides/deployment/vercel.mdx +1 -1
  219. package/docs/guides/dev-tui.md +3 -13
  220. package/docs/guides/dynamic-capabilities.md +64 -4
  221. package/docs/guides/frontend/meta.json +2 -1
  222. package/docs/guides/frontend/nextjs.mdx +1 -10
  223. package/docs/guides/frontend/nuxt.mdx +1 -10
  224. package/docs/guides/frontend/overview.mdx +12 -3
  225. package/docs/guides/frontend/sveltekit.mdx +23 -11
  226. package/docs/guides/frontend/use-eve-agent-svelte.mdx +39 -126
  227. package/docs/guides/frontend/use-eve-agent-vue.mdx +40 -139
  228. package/docs/guides/instrumentation.md +15 -15
  229. package/docs/guides/meta.json +1 -5
  230. package/docs/guides/remote-agents.md +9 -9
  231. package/docs/guides/session-context.md +34 -103
  232. package/docs/install-integrations.mdx +1 -1
  233. package/docs/instructions.mdx +45 -12
  234. package/docs/meta.json +24 -13
  235. package/docs/patterns/dynamic-scheduling.md +1 -1
  236. package/docs/patterns/meta.json +1 -0
  237. package/docs/patterns/multi-tenant-approvals.md +1 -1
  238. package/docs/patterns/multi-tenant-auth.md +1 -1
  239. package/docs/patterns/multi-tenant-memory.md +4 -3
  240. package/docs/{guides → protocols}/acp.md +1 -1
  241. package/docs/protocols/meta.json +5 -0
  242. package/docs/reference/cli.md +39 -39
  243. package/docs/reference/meta.json +1 -1
  244. package/docs/reference/typescript-api.md +4 -2
  245. package/docs/sandbox.mdx +8 -0
  246. package/docs/{subagents.mdx → subagents/index.mdx} +2 -2
  247. package/docs/subagents/meta.json +5 -0
  248. package/docs/{guides/dynamic-workflows.md → subagents/workflow-tool.md} +6 -6
  249. package/docs/tools/human-in-the-loop.md +1 -1
  250. package/docs/tools/meta.json +1 -0
  251. package/docs/tools/overview.mdx +1 -1
  252. package/docs/tutorial/connect-a-warehouse.mdx +1 -1
  253. package/docs/tutorial/meta.json +1 -0
  254. package/docs/tutorial/remember-definitions.mdx +2 -2
  255. package/docs/tutorial/ship-it.mdx +2 -2
  256. package/package.json +4 -4
  257. package/dist/src/compiled/_chunks/workflow/dist-C8PhDW9B.js +0 -1
  258. package/dist/src/compiled/_chunks/workflow/functions-xMPAeWFr.js +0 -1
  259. package/dist/src/compiled/_chunks/workflow/node-Smb57EnG.js +0 -40
  260. package/dist/src/compiled/_chunks/workflow/resume-hook-BrduAuFX.js +0 -1
  261. package/dist/src/compiled/_chunks/workflow/run-CX7_sJnW.js +0 -1
  262. package/dist/src/compiled/_chunks/workflow/sleep-tsb2HjWK.js +0 -1
  263. package/dist/src/compiled/_chunks/workflow/undici-BNc_0O4m.js +0 -95
  264. package/dist/src/compiled/_chunks/workflow/wait-until-BYKVqrwc.js +0 -15
  265. package/dist/src/harness/instrumentation-config.js +0 -1
  266. package/dist/src/public/nuxt/vercel-services.js +0 -1
  267. package/dist/src/public/sveltekit/vercel-json.d.ts +0 -17
  268. package/dist/src/public/sveltekit/vercel-json.js +0 -1
  269. package/docs/installation.mdx +0 -66
  270. package/docs/project-structure.mdx +0 -53
  271. package/docs/reference/project-layout.md +0 -123
  272. /package/dist/src/harness/{instrumentation-config.d.ts → instrumentation/config.d.ts} +0 -0
  273. /package/dist/src/harness/{instrumentation-content.js → instrumentation/content.js} +0 -0
  274. /package/dist/src/harness/{instrumentation-runtime-context.d.ts → instrumentation/runtime-context.d.ts} +0 -0
  275. /package/dist/src/harness/{instrumentation-runtime-context.js → instrumentation/runtime-context.js} +0 -0
  276. /package/dist/src/harness/{instrumentation-runtime.js → instrumentation/runtime.js} +0 -0
  277. /package/dist/src/harness/{instrumentation-setup-context.d.ts → instrumentation/setup-context.d.ts} +0 -0
  278. /package/dist/src/harness/{instrumentation-setup-context.js → instrumentation/setup-context.js} +0 -0
  279. /package/dist/src/harness/{instrumentation-state.js → instrumentation/state.js} +0 -0
  280. /package/docs/{guides → protocols}/ucp.mdx +0 -0
@@ -38,7 +38,7 @@ export default defineEval({
38
38
  });
39
39
  ```
40
40
 
41
- The reporter config takes an optional `projectName` and `experimentName`, plus a base experiment (by name or id) to diff against. Gate assertions log as binary scores under a `gate:` prefix so experiments diff gate regressions the same way they diff soft-score regressions. Repeated names use `#2`, `#3`, and later suffixes; use `.label(name)` to give them meaningful names. Failed assertion details are stored in the Braintrust metadata under `eveFailedAssertions`.
41
+ The reporter config takes an optional `projectName` and `experimentName`, plus a base experiment (by name or id) to diff against. Gate assertions log as binary scores under a `gate:` prefix so experiments diff gate regressions the same way they diff soft-score regressions. Repeated names use `#2`, `#3`, and later suffixes; use `.label(name)` to give them meaningful names. Failed assertion details are stored in the Braintrust metadata under `eveFailedAssertions`; observed traces are stored under `eveTraceIds` and `eveTraceContexts`.
42
42
 
43
43
  A reporter instance observes the evals that reference it. Share one instance across several evals (the config, a `shared.ts` export, or every entry of a dataset array) and their results land in a single experiment. Listing the same config reporter on an eval too does not double-report it.
44
44
 
@@ -56,17 +56,27 @@ Each eval becomes one `<testcase>` named by its path-derived id; failed gates an
56
56
 
57
57
  ## Custom reporters
58
58
 
59
- A reporter implements the `EvalReporter` interface from `eve/evals/reporters` and receives the same structured results the built-ins do. The runner calls three lifecycle methods, each of which may return a promise for async work like a remote upload:
59
+ A reporter implements the `EvalReporter` interface from `eve/evals/reporters` and receives the same structured results the built-ins do. Every callback may return a promise for async work like a remote upload:
60
60
 
61
61
  ```ts
62
62
  interface EvalReporter {
63
63
  onRunStart(evaluations: readonly EveEval[], target: EveEvalTarget): void | Promise<void>;
64
- onEvalComplete(result: EveEvalResult): void | Promise<void>;
64
+ onEvalStart?(event: EveEvalStartEvent): void | Promise<void>;
65
+ onSessionStart?(event: EveEvalSessionStartEvent): void | Promise<void>;
66
+ onEvalComplete(result: EveEvalResult, context?: EveEvalCompleteContext): void | Promise<void>;
65
67
  onRunComplete(summary: EveEvalRunSummary): void | Promise<void>;
66
68
  }
67
69
  ```
68
70
 
69
- `onRunStart` fires once before any eval runs, `onEvalComplete` fires after each observed eval with its checks, scores, and verdict, and `onRunComplete` fires once with the aggregated summary. Reach for a custom reporter only when a destination isn't covered. The per-run artifacts under `.eve/evals/` already capture everything for ad-hoc inspection.
71
+ `onRunStart` fires once before any eval runs, and `onRunComplete` fires once with the aggregated summary. Within that run:
72
+
73
+ - `onEvalStart` fires when an eval is scheduled. It includes the eval definition, target, and start time.
74
+ - `onSessionStart` fires once for each session after eve receives its first trace context. It includes `sessionId`, `primary`, and `traceContext` with `traceId`, `spanId`, and `traceFlags`.
75
+ - `onEvalComplete` fires with the checks, scores, and verdict. The runner also supplies `context`, including every distinct trace context collected across the eval's sessions. The same list is available as `result.result.traceContexts`.
76
+
77
+ An eval can create several sessions, and a long session can produce several traces, so completion exposes a list instead of a single trace id. `onEvalStart` does not include a trace because the agent session has not started yet. If the target has no tracing configured, `onSessionStart` does not fire and the completed trace list is empty.
78
+
79
+ Reporter callbacks for an eval stay ordered—eval start, traced session starts, then completion—even when several evals run concurrently. Reach for a custom reporter only when a destination isn't covered. The per-run artifacts under `.eve/evals/` retain the trace contexts alongside the result for ad-hoc inspection.
70
80
 
71
81
  ## What to read next
72
82
 
@@ -5,7 +5,7 @@ description: "Package reusable eve capabilities and mount them from npm or a mon
5
5
 
6
6
  Extensions package eve tools, connections, skills, instruction fragments, and hooks. An author builds an extension package; each agent that uses it declares the package as a dependency and mounts it. The package can be published to a package registry or kept private inside a monorepo workspace.
7
7
 
8
- Ready-made extensions can also be distributed through an eve integration registry. See [Install Integrations](./install-integrations) to discover and add one with `eve add`; this page explains how extension packages are authored, mounted, configured, and overridden.
8
+ Ready-made extensions can also be distributed through an eve integration registry. See [Add Integrations](./install-integrations) to discover and add one with `eve add`; this page explains how extension packages are authored, mounted, configured, and overridden.
9
9
 
10
10
  This enables sharing many different capability sets. A browser extension might include several tools for navigating a site. A memory extension could use hooks to capture context and tools to recall it. A self-improving extension could pair hooks with dynamic instructions.
11
11
 
@@ -1,23 +1,185 @@
1
1
  ---
2
2
  title: "Getting Started"
3
- description: "Create an eve project, learn its filesystem layout, and start adding capabilities."
4
- contentType: "Landing"
3
+ description: "Create an eve project, configure a model, understand its filesystem layout, and run your first agent."
4
+ contentType: "How-to"
5
5
  ---
6
6
 
7
- eve agents are TypeScript projects. You describe an agent with files under `agent/`, then eve runs it as a durable service.
7
+ ## Prerequisites
8
8
 
9
- ## Start in order
10
-
11
- 1. [Install eve](/docs/installation): create a project, configure a model credential, and run it locally
12
- 2. [Learn the project structure](/docs/project-structure): see which files eve discovers and where each capability belongs
13
- 3. [Build your first agent](/docs/tutorial/first-agent): add tools, state, and an interface for a useful workflow
14
-
15
- ## What you need
9
+ You need:
16
10
 
17
11
  - Node.js 24 or newer
18
12
  - npm, which Node.js includes
19
- - A model credential for the model your agent uses
13
+ - A credential for the model your agent uses
14
+
15
+ The default scaffolded model routes through the Vercel AI Gateway. Set `AI_GATEWAY_API_KEY`, or link a Vercel project to use `VERCEL_OIDC_TOKEN`. To use a model provider directly, install its AI SDK provider package and set the provider's API key.
16
+
17
+ Choose a model, provider, and channel that meet your data-processing and compliance requirements.
18
+
19
+ ## Create a project
20
+
21
+ Run `eve init` with a project name:
22
+
23
+ ```bash
24
+ npx eve@latest init my-agent
25
+ ```
26
+
27
+ The command creates the project, installs dependencies, and initializes Git. If a supported coding-agent REPL is available, eve offers to start the development server, open the REPL, or exit after scaffolding.
28
+
29
+ Pass an AI Gateway model ID or reasoning effort when you do not want the defaults:
30
+
31
+ ```bash
32
+ npx eve@latest init my-agent --model openai/gpt-5.6-terra --reasoning high
33
+ ```
34
+
35
+ To add eve to a project that already has a `package.json`, run this command from its root before you create any `agent/` files:
36
+
37
+ ```bash
38
+ npx eve@latest init .
39
+ ```
40
+
41
+ eve adds the missing `eve`, `ai`, and `zod` dependencies without changing files the project already owns.
42
+
43
+ ## Run the agent
44
+
45
+ If the development server is not already running, start it from the project root:
46
+
47
+ ```bash
48
+ npm run dev
49
+ ```
50
+
51
+ The TUI sends messages to your agent. Stop the server with `Ctrl+C` when you need your shell for another command.
52
+
53
+ ## Project layout
54
+
55
+ eve builds an agent by walking the filesystem under `agent/`. Each directory is an authored slot, and the slot a file lands in determines how eve loads it.
56
+
57
+ ### Naming from paths
58
+
59
+ Identity comes from the path. You never write a `name` or `id` field on a `define*` call.
60
+
61
+ | Path | Resolves to |
62
+ | ------------------------------------- | --------------------- |
63
+ | `agent/tools/get_weather.ts` | tool `get_weather` |
64
+ | `agent/connections/linear.ts` | connection `linear` |
65
+ | `agent/skills/summarize.md` | skill `summarize` |
66
+ | `agent/subagents/researcher/agent.ts` | subagent `researcher` |
67
+
68
+ The root agent takes its name from the enclosing `package.json` `name`, falling back to the app-root directory name when `package.json` has no `name`. A subagent takes its name from its directory.
69
+
70
+ ### Recommended layout
71
+
72
+ A minimal agent needs `instructions.md`; `agent.ts` is optional when the defaults are sufficient. Add other slots as the agent needs them:
73
+
74
+ ```text
75
+ my-agent/
76
+ ├── package.json
77
+ ├── tsconfig.json
78
+ ├── agent/
79
+ │ ├── agent.ts
80
+ │ ├── instructions.md
81
+ │ ├── instrumentation.ts
82
+ │ ├── channels/
83
+ │ ├── connections/
84
+ │ ├── hooks/
85
+ │ ├── skills/
86
+ │ ├── lib/
87
+ │ ├── sandbox/
88
+ │ ├── tools/
89
+ │ ├── schedules/
90
+ │ └── subagents/
91
+ └── evals/
92
+ ```
93
+
94
+ Evals live beside `agent/`, not inside it.
95
+
96
+ ### Authored slots
97
+
98
+ The Subagents column states whether a local subagent (`subagents/<id>/`) can author the slot. A declared subagent inherits nothing from the root; it discovers its own slots.
99
+
100
+ | Path | Description | Subagents | Notes |
101
+ | ------------------------------------------------------- | ----------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
102
+ | `agent.ts` | Runtime config | Yes | Model, model options, compaction, build, and experimental settings. See [Agents](./agent-config). |
103
+ | `instructions.md` / `instructions.ts` / `instructions/` | Base system prompt | Optional | A flat file or directory of `.md` and `.ts` files. Static sources compose at build time. Dynamic sources resolve at runtime. Required on the root, optional on subagents. |
104
+ | `instrumentation.ts` | Telemetry config | No | OTel exporter and AI SDK span settings, auto-discovered and run before agent code. Root-only. |
105
+ | `channels/` | HTTP and messaging entry points | No | Root-only. |
106
+ | `connections/` | External MCP and OpenAPI services | Yes | One connection per file; its name comes from the filename. |
107
+ | `hooks/` | Lifecycle and stream-event subscribers | Yes | Module-backed only. Recursive directories are supported. |
108
+ | `skills/` | On-demand procedures and capability packs | Yes | Flat markdown, module-backed skills, or packaged skills. Runtime files are seeded under `$HOME/.agents/skills/`, with `/workspace/skills/` as a fallback. |
109
+ | `lib/` | Shared authored helper code | Yes | Import-only; not mounted into the workspace. |
110
+ | `sandbox.ts` or `sandbox/sandbox.ts` | The agent's single sandbox | Yes | Use `sandbox.ts` for a definition-only override; use `sandbox/sandbox.ts` with `sandbox/workspace/**` to also seed files. The framework default applies when neither is authored. |
111
+ | `sandbox/workspace/**` | Files seeded into the sandbox | Yes | Mirrored into `/workspace/` when a session starts. |
112
+ | `tools/` | Typed executable integrations | Yes | Module-backed only. |
113
+ | `schedules/` | Recurring jobs | No | Each schedule is a default-exported `defineSchedule` module or a markdown prompt with `cron` frontmatter. Recursive nesting is supported. Root-only. |
114
+ | `subagents/` | Specialist child agents | Yes | Each child is a local package under `subagents/<id>/`. Nested subagents are supported. |
115
+
116
+ ### Runtime files and source files
117
+
118
+ eve does not mount the whole authored tree into the runtime sandbox. Files under `agent/sandbox/workspace/**` land in `/workspace/` when a session starts.
119
+
120
+ Skill package files land outside the workspace under `$HOME/.agents/skills/`, with `/workspace/skills/` as a fallback when `$HOME` is unavailable. Everything in `lib/` remains import-only source code.
121
+
122
+ ### Local subagents
123
+
124
+ A local subagent uses the same `agent.ts` shape as the root:
125
+
126
+ ```text
127
+ agent/subagents/researcher/
128
+ ├── agent.ts
129
+ ├── instructions.md
130
+ ├── connections/
131
+ ├── hooks/
132
+ ├── skills/
133
+ ├── lib/
134
+ ├── sandbox/
135
+ ├── tools/
136
+ └── subagents/
137
+ ```
138
+
139
+ A subagent's `agent.ts` is required and must provide a description, while its instructions are optional. Connections, hooks, skills, shared code, sandboxes, tools, and nested subagents are supported. Channels and schedules remain root-only. See [Subagents](./subagents) for inheritance and isolation behavior.
140
+
141
+ ### Flat layout
142
+
143
+ When the app root is also the agent root, eve supports this layout:
144
+
145
+ ```text
146
+ my-agent/
147
+ ├── package.json
148
+ ├── agent.ts
149
+ ├── instructions.md
150
+ ├── tools/
151
+ └── skills/
152
+ ```
153
+
154
+ Prefer the nested layout because it keeps application files separate from the authored agent surface.
155
+
156
+ ### Debug file discovery
157
+
158
+ Run `eve info` when eve does not discover a file. It lists the discovered surface and diagnostics so you can check the authored slot and root-versus-subagent boundary. eve also writes inspectable artifacts under `.eve/`; see [Observability](./guides/instrumentation) and the [CLI](./reference/cli) reference.
159
+
160
+ ## Install manually
161
+
162
+ If you do not want to use the scaffold, install the runtime dependencies:
163
+
164
+ ```bash
165
+ npm install eve@latest ai zod
166
+ ```
167
+
168
+ Declare Node.js 24 in `package.json`, then create `agent/instructions.md` and, when you need runtime configuration, `agent/agent.ts`.
169
+
170
+ ## Continue with the tutorial
171
+
172
+ The [Tutorial](/docs/tutorial/first-agent) builds a data analytics agent step by step. It adds tools, state, sandboxed analysis, reusable skills, and human approval before deploying the result.
173
+
174
+ After the tutorial, continue with the task you need:
20
175
 
21
- ## Choose your next step
176
+ | Goal | Read |
177
+ | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
178
+ | Give the model an action it can call | [Tools](/docs/tools) |
179
+ | Connect an MCP server or OpenAPI service | [Connections](/docs/connections) |
180
+ | Reach users through Slack, Discord, or another platform | [Channels](/docs/channels/overview) |
181
+ | Build a browser interface | [Frontend Frameworks](/docs/guides/frontend/overview) |
182
+ | Test agent behavior | [Evals](/docs/evals/overview) |
183
+ | Secure and deploy the agent | [Authentication](/docs/guides/auth-and-route-protection), then [Deployment](/docs/guides/deployment/overview) |
22
184
 
23
- Start with [Installation](/docs/installation) when you need a new project. Read [Project structure](/docs/project-structure) when you already have an eve project or want to add a capability.
185
+ Read [Execution Model and Durability](/docs/concepts/execution-model-and-durability) for the mental model behind sessions, turns, durable steps, and parked work.
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Auth & Route Protection"
2
+ title: "Authentication"
3
3
  description: "Secure your agent's HTTP routes with an ordered auth walk, verifier helpers, and connection OAuth via Vercel Connect."
4
4
  ---
5
5
 
@@ -12,7 +12,7 @@ Start with route auth.
12
12
 
13
13
  ## Route auth
14
14
 
15
- The route-auth policy lives on the HTTP channel factory (`agent/channels/eve.ts`) and guards three routes:
15
+ The route-auth policy lives on the HTTP channel factory (`agent/channels/eve.ts`) and guards these route groups:
16
16
 
17
17
  - `POST /eve/v1/session`
18
18
  - `POST /eve/v1/session/:sessionId`
@@ -307,22 +307,7 @@ Built-in platform channels that identify a human sender, such as Slack, Discord,
307
307
 
308
308
  ### On a connection
309
309
 
310
- Attach `connect()` from `@vercel/connect/eve` to the connection:
311
-
312
- ```ts title="agent/connections/linear.ts"
313
- import { connect } from "@vercel/connect/eve";
314
- import { defineMcpClientConnection } from "eve/connections";
315
- import { once } from "eve/tools/approval";
316
-
317
- export default defineMcpClientConnection({
318
- url: "https://mcp.linear.app/mcp",
319
- description: "Linear: project management, issue tracking, and team workflows.",
320
- auth: connect("linear/myagent"),
321
- approval: once(),
322
- });
323
- ```
324
-
325
- The first call that needs a user-scoped connection kicks off an OAuth sign-in, surfaced as an authorization challenge (a URL the caller visits). [Vercel Connect](https://vercel.com/docs/connect) brokers the flow and holds the credentials, which are resolved and cached per workflow step, never serialized into history, and never shown to the model. For non-interactive connections, pass a static token or `connect({ connector, principalType: "app" })` in place of user-scoped `connect()`. [Connections](../connections) covers both shapes.
310
+ Set `auth` on an MCP or OpenAPI connection when the external service supplies a family of remote tools. The [connections overview](../connections) owns the shared `connect()` setup, static-token providers, app and user scope, approval interaction, and self-hosted OAuth flow.
326
311
 
327
312
  ### On a single tool
328
313
 
@@ -96,7 +96,9 @@ await response.result();
96
96
 
97
97
  The stream confirms the turn with `message.received`. Its `data.message` remains the flattened
98
98
  summary for compatibility, and `data.parts` contains structured text and file metadata for clients
99
- that render attachments. File parts never include raw bytes or internal sandbox paths.
99
+ that render attachments. File parts never include raw bytes or internal sandbox paths. See [Inbound
100
+ attachments](../../sandbox#inbound-attachments) for how eve stages byte-backed files in the session
101
+ sandbox and prepares them for each model call.
100
102
 
101
103
  ## Answer human input requests
102
104
 
@@ -1,4 +1,5 @@
1
1
  {
2
- "title": "TypeScript SDK",
2
+ "title": "Client SDK",
3
+ "defaultOpen": false,
3
4
  "pages": ["overview", "messages", "continuations", "streaming", "output-schema"]
4
5
  }
@@ -119,10 +119,10 @@ const followUp = await followUpResponse.result();
119
119
  console.log(followUp.data); // undefined unless this turn also requested a schema
120
120
  ```
121
121
 
122
- For task-mode output that belongs to the agent or subagent definition itself, see [`agent.ts`](../../agent-config#outputschema) and [Subagents](../../subagents).
122
+ For task-mode output that belongs to the agent or subagent definition itself, see [`agent.ts`](../../agent-config#other-defineagent-fields) and [Subagents](../../subagents).
123
123
 
124
124
  ## What to read next
125
125
 
126
126
  - [Messages](./messages): send turns with `send()`
127
127
  - [Streaming](./streaming): handle `result.completed` live
128
- - [`agent.ts`](../../agent-config#outputschema): configured task-mode output
128
+ - [`agent.ts`](../../agent-config#other-defineagent-fields): configured task-mode output
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "TypeScript SDK Overview"
2
+ title: "Client SDK"
3
3
  description: "Call an eve agent from TypeScript with Client, sessions, auth, and health checks."
4
4
  ---
5
5
 
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "title": "Deployment",
3
+ "defaultOpen": false,
3
4
  "pages": ["overview", "vercel", "self-hosting"]
4
5
  }
@@ -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 [Auth and route protection](../auth-and-route-protection) for the available policies and secret requirements.
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-host eve"
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 [Auth and route protection](../auth-and-route-protection).
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
- - [Auth and route protection](../auth-and-route-protection): configure the host’s route policy
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
- - [Auth and route protection](../auth-and-route-protection): configure who can call the deployed agent
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
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Dev TUI"
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 how much detail the UI renders:
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
- | Flag | Values | Description |
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
 
@@ -21,6 +21,44 @@ resolver first selects a model, eve normalizes the selection and resolves any
21
21
  omitted context-window metadata from the AI Gateway catalog. Dynamic tools,
22
22
  skills, instructions, and subagents may return `null` to omit a capability.
23
23
 
24
+ ### Route image inputs to a vision model
25
+
26
+ Use `step.started` when model choice depends on the current messages. This
27
+ keeps GLM for text and switches to Gemini Flash when user history contains an
28
+ image:
29
+
30
+ ```ts title="agent/agent.ts"
31
+ import { defineAgent, defineDynamic } from "eve";
32
+
33
+ export default defineAgent({
34
+ model: defineDynamic({
35
+ events: {
36
+ "step.started": (_event, ctx) => {
37
+ const hasImage = ctx.messages.some(
38
+ (message) =>
39
+ message.role === "user" &&
40
+ Array.isArray(message.content) &&
41
+ message.content.some(
42
+ (part) =>
43
+ part.type === "image" ||
44
+ (part.type === "file" &&
45
+ (part.mediaType === "image" || part.mediaType.startsWith("image/"))),
46
+ ),
47
+ );
48
+
49
+ return hasImage ? "google/gemini-3.5-flash" : "zai/glm-5.2";
50
+ },
51
+ },
52
+ }),
53
+ });
54
+ ```
55
+
56
+ eve stages byte-backed `file` parts under `/workspace/attachments` before
57
+ `step.started`, but keeps their media type in `ctx.messages`. When an image
58
+ reaches the provider, vision models can process it and non-vision models reject
59
+ it. eve does not reroute automatically. See [Inbound
60
+ attachments](../sandbox#inbound-attachments).
61
+
24
62
  ## Dynamic subagents
25
63
 
26
64
  Wrap a declared subagent's own `agent.ts` in `defineDynamic` when its
@@ -212,7 +250,7 @@ Skills follow the same naming rule as tools: a single `defineSkill(...)` is name
212
250
 
213
251
  ## Dynamic instructions
214
252
 
215
- A dynamic instructions file resolves the per-session system prompt the same way, returning `defineInstructions(...)` built from the principal, tenant, or external data:
253
+ A dynamic instructions file returns `defineInstructions({ content, role? })` built from the principal, tenant, channel, or external data. Omit `role` for system context:
216
254
 
217
255
  ```ts title="agent/instructions/persona.ts"
218
256
  import { defineDynamic, defineInstructions } from "eve/instructions";
@@ -222,14 +260,36 @@ export default defineDynamic({
222
260
  "session.started": (_event, ctx) => {
223
261
  const plan = ctx.session.auth.current?.attributes.plan ?? "free";
224
262
  return defineInstructions({
225
- markdown: `The caller is on the ${plan} plan. Match the depth of your answers to it.`,
263
+ content: `The caller is on the ${plan} plan. Match the depth of your answers to it.`,
226
264
  });
227
265
  },
228
266
  },
229
267
  });
230
268
  ```
231
269
 
232
- Both resolve before the prompt is assembled, so the model sees the right instructions and skill set for whoever is calling, without that context reaching anyone else.
270
+ Use `role: "user"` when the resolved value is application or user context that should become part of durable history:
271
+
272
+ ```ts title="agent/instructions/brief.ts"
273
+ import { defineDynamic, defineInstructions } from "eve/instructions";
274
+ import { loadBrief } from "../lib/briefs";
275
+
276
+ export default defineDynamic({
277
+ events: {
278
+ "turn.started": async (_event, ctx) => {
279
+ const brief = await loadBrief(ctx.session.auth.current);
280
+ return brief ? defineInstructions({ content: brief, role: "user" }) : null;
281
+ },
282
+ },
283
+ });
284
+ ```
285
+
286
+ 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.
287
+
288
+ 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.
289
+
290
+ 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.
291
+
292
+ 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
293
 
234
294
  ## What to read next
235
295
 
@@ -237,4 +297,4 @@ Both resolve before the prompt is assembled, so the model sees the right instruc
237
297
  - The static tool basics this builds on → [Tools](../tools)
238
298
  - The built-in tools and how to override them → [Default harness](../concepts/default-harness)
239
299
  - 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](./state)
300
+ - Durable per-session memory for resolvers to read → [State](../concepts/state)
@@ -1,4 +1,5 @@
1
1
  {
2
- "title": "Frontend",
2
+ "title": "Frontend Frameworks",
3
+ "defaultOpen": false,
3
4
  "pages": ["overview", "nextjs", "nuxt", "sveltekit", "use-eve-agent-vue", "use-eve-agent-svelte"]
4
5
  }
@@ -88,16 +88,7 @@ const agent = useEveAgent({
88
88
  });
89
89
  ```
90
90
 
91
- The default eve channel is fail-closed. With no `agent/channels/eve.ts` authored, eve registers `eveChannel({ auth: [vercelOidc(), localDev(), placeholderAuth()] })`: `vercelOidc()` gets the first chance to resolve a Vercel caller, `localDev()` authenticates while the process is an `eve dev` or `vercel dev` server, and everything else gets a `401`. To run your app's own auth policy, add `agent/channels/eve.ts`:
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 default eve channel is fail-closed. With no `agent/channels/eve.ts` authored, eve registers `eveChannel({ auth: [vercelOidc(), localDev(), placeholderAuth()] })`: `vercelOidc()` gets the first chance to resolve a Vercel caller, `localDev()` authenticates while the process is an `eve dev` or `vercel dev` server, and everything else gets a `401`. To run your own auth policy, add `agent/channels/eve.ts`:
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 [TypeScript SDK](../client/overview) directly.
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
- On top of `onSessionChange`, the hook takes a few per-turn callbacks:
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
- - [TypeScript SDK](../client/overview): the lower-level client underneath the frontend hooks
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