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.
Files changed (261) hide show
  1. package/CHANGELOG.md +18 -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/index.d.ts +2 -2
  60. package/dist/src/evals/reporters/index.d.ts +1 -1
  61. package/dist/src/evals/runner/artifacts.js +1 -1
  62. package/dist/src/evals/runner/execute-eval.d.ts +5 -0
  63. package/dist/src/evals/runner/execute-eval.js +1 -1
  64. package/dist/src/evals/runner/execute-task.d.ts +3 -0
  65. package/dist/src/evals/runner/execute-task.js +1 -1
  66. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  67. package/dist/src/evals/runner/reporters/types.d.ts +28 -2
  68. package/dist/src/evals/runner/run-evals.js +1 -1
  69. package/dist/src/evals/session.d.ts +11 -2
  70. package/dist/src/evals/session.js +1 -1
  71. package/dist/src/evals/target.js +1 -1
  72. package/dist/src/evals/types.d.ts +10 -1
  73. package/dist/src/execution/node-step.js +1 -1
  74. package/dist/src/execution/session.js +1 -1
  75. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  76. package/dist/src/execution/workflow-steps.js +1 -1
  77. package/dist/src/execution/workflow-trace-context.d.ts +11 -0
  78. package/dist/src/execution/workflow-trace-context.js +1 -0
  79. package/dist/src/harness/ai-sdk-hook-bridge.d.ts +1 -1
  80. package/dist/src/harness/ai-sdk-hook-bridge.js +1 -1
  81. package/dist/src/harness/channel-delivery-instrumentation.d.ts +1 -1
  82. package/dist/src/harness/channel-delivery-instrumentation.js +1 -1
  83. package/dist/src/harness/emission.d.ts +2 -2
  84. package/dist/src/harness/emission.js +1 -1
  85. package/dist/src/harness/instrumentation/config.js +1 -0
  86. package/dist/src/harness/{instrumentation-content.d.ts → instrumentation/content.d.ts} +1 -1
  87. package/dist/src/harness/{instrumentation-dispatch.d.ts → instrumentation/dispatch.d.ts} +1 -1
  88. package/dist/src/harness/{instrumentation-dispatch.js → instrumentation/dispatch.js} +1 -1
  89. package/dist/src/harness/{instrumentation-lifecycle.d.ts → instrumentation/lifecycle.d.ts} +3 -6
  90. package/dist/src/harness/{instrumentation-lifecycle.js → instrumentation/lifecycle.js} +1 -1
  91. package/dist/src/harness/{instrumentation-native-events.d.ts → instrumentation/native-events.d.ts} +1 -1
  92. package/dist/src/harness/{instrumentation-native-events.js → instrumentation/native-events.js} +1 -1
  93. package/dist/src/harness/{instrumentation-providers.d.ts → instrumentation/providers.d.ts} +1 -1
  94. package/dist/src/harness/{instrumentation-providers.js → instrumentation/providers.js} +1 -1
  95. package/dist/src/harness/{instrumentation-runtime.d.ts → instrumentation/runtime.d.ts} +4 -2
  96. package/dist/src/harness/{instrumentation-state.d.ts → instrumentation/state.d.ts} +1 -1
  97. package/dist/src/harness/parent-lineage.d.ts +1 -1
  98. package/dist/src/harness/prepare-trace-context.d.ts +16 -0
  99. package/dist/src/harness/prepare-trace-context.js +1 -0
  100. package/dist/src/harness/tool-loop.js +2 -2
  101. package/dist/src/harness/types.d.ts +1 -1
  102. package/dist/src/internal/application/compiled-artifacts.js +2 -2
  103. package/dist/src/internal/application/package.js +1 -1
  104. package/dist/src/internal/authored-definition/core.d.ts +3 -3
  105. package/dist/src/internal/authored-definition/core.js +1 -1
  106. package/dist/src/internal/authored-package-boundary.js +1 -1
  107. package/dist/src/internal/helpers/markdown.js +1 -1
  108. package/dist/src/internal/instrumentation.d.ts +1 -1
  109. package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
  110. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
  111. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +4 -3
  112. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
  113. package/dist/src/internal/nitro/routes/channel-request-instrumentation.js +1 -1
  114. package/dist/src/internal/vercel/project-link.d.ts +1 -1
  115. package/dist/src/internal/vercel/project-link.js +1 -1
  116. package/dist/src/internal/vercel-agent-summary.d.ts +10 -9
  117. package/dist/src/internal/vercel-agent-summary.js +1 -1
  118. package/dist/src/internal/workflow/development-world-client.js +1 -1
  119. package/dist/src/protocol/message.d.ts +15 -1
  120. package/dist/src/protocol/message.js +1 -1
  121. package/dist/src/public/channels/github/auth.d.ts +30 -0
  122. package/dist/src/public/channels/github/auth.js +2 -2
  123. package/dist/src/public/channels/github/defaults.d.ts +4 -4
  124. package/dist/src/public/channels/github/defaults.js +1 -1
  125. package/dist/src/public/channels/github/dispatch.d.ts +3 -2
  126. package/dist/src/public/channels/github/dispatch.js +1 -1
  127. package/dist/src/public/channels/github/githubChannel.d.ts +7 -2
  128. package/dist/src/public/channels/github/githubChannel.js +1 -1
  129. package/dist/src/public/channels/github/index.d.ts +1 -1
  130. package/dist/src/public/definitions/instructions.d.ts +14 -4
  131. package/dist/src/public/definitions/instructions.js +1 -1
  132. package/dist/src/public/definitions/tool.d.ts +5 -8
  133. package/dist/src/public/instructions/index.d.ts +1 -2
  134. package/dist/src/public/instructions/index.js +1 -1
  135. package/dist/src/public/instrumentation/index.d.ts +4 -3
  136. package/dist/src/public/instrumentation/otel.d.ts +5 -4
  137. package/dist/src/public/instrumentation/provider.d.ts +2 -2
  138. package/dist/src/runtime/agent/bootstrap.d.ts +2 -0
  139. package/dist/src/runtime/agent/bootstrap.js +1 -1
  140. package/dist/src/runtime/prompt/compose.d.ts +1 -1
  141. package/dist/src/runtime/prompt/compose.js +3 -1
  142. package/dist/src/runtime/resolve-agent.js +1 -1
  143. package/dist/src/runtime/types.d.ts +4 -3
  144. package/dist/src/setup/project-resolution.d.ts +3 -3
  145. package/dist/src/setup/scaffold/create/project.js +1 -1
  146. package/dist/src/setup/slack-connect-lifecycle.d.ts +0 -9
  147. package/dist/src/setup/slack-connect-lifecycle.js +1 -1
  148. package/dist/src/setup/slackbot.d.ts +2 -1
  149. package/dist/src/setup/slackbot.js +1 -1
  150. package/dist/src/shared/dynamic-tool-definition.d.ts +3 -4
  151. package/dist/src/shared/instructions-definition.d.ts +15 -11
  152. package/dist/src/svelte/index.js +1 -1
  153. package/dist/src/svelte/use-eve-agent.js +1 -1
  154. package/dist/src/tracing/agent-action-instrumentation.d.ts +1 -1
  155. package/dist/src/tracing/agent-action-instrumentation.js +1 -1
  156. package/dist/src/tracing/agent-approval-instrumentation.d.ts +1 -1
  157. package/dist/src/tracing/agent-channel-delivery-instrumentation.d.ts +1 -1
  158. package/dist/src/tracing/agent-channel-delivery-instrumentation.js +1 -1
  159. package/dist/src/tracing/agent-otel-provider.d.ts +4 -2
  160. package/dist/src/tracing/agent-otel-provider.js +2 -2
  161. package/dist/src/tracing/agent-otel-session-context.d.ts +17 -0
  162. package/dist/src/tracing/agent-otel-session-context.js +1 -0
  163. package/dist/src/tracing/agent-otel-usage.d.ts +1 -1
  164. package/dist/src/tracing/agent-tool-instrumentation.d.ts +1 -1
  165. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  166. package/dist/src/tracing/agent-trace-state.d.ts +1 -1
  167. package/dist/src/tracing/install-instrumentation-runtime.d.ts +2 -2
  168. package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
  169. package/dist/src/tracing/local-instrumentation-runtime.d.ts +1 -1
  170. package/dist/src/tracing/local-instrumentation-runtime.js +1 -1
  171. package/dist/src/tracing/local-traces.d.ts +3 -3
  172. package/dist/src/tracing/local-traces.js +1 -1
  173. package/dist/src/tracing/otel-declaration.d.ts +2 -2
  174. package/dist/src/tracing/otel-declaration.js +1 -1
  175. package/dist/src/vue/index.js +1 -1
  176. package/dist/src/vue/use-eve-agent.js +1 -1
  177. package/docs/README.md +18 -20
  178. package/docs/agent-config.md +5 -5
  179. package/docs/channels/eve.mdx +10 -56
  180. package/docs/channels/github.mdx +1 -1
  181. package/docs/channels/meta.json +1 -0
  182. package/docs/concepts/context-control.md +32 -56
  183. package/docs/concepts/default-harness.md +2 -2
  184. package/docs/concepts/execution-model-and-durability.mdx +4 -4
  185. package/docs/concepts/meta.json +3 -1
  186. package/docs/concepts/sessions-runs-and-streaming.md +22 -10
  187. package/docs/{guides → concepts}/state.md +3 -3
  188. package/docs/connections/mcp.mdx +6 -89
  189. package/docs/connections/meta.json +1 -0
  190. package/docs/connections/openapi.mdx +5 -69
  191. package/docs/connections/overview.mdx +29 -3
  192. package/docs/evals/meta.json +1 -0
  193. package/docs/evals/reporters.mdx +14 -4
  194. package/docs/extensions.md +1 -1
  195. package/docs/getting-started.mdx +175 -13
  196. package/docs/guides/auth-and-route-protection.md +3 -18
  197. package/docs/guides/client/meta.json +2 -1
  198. package/docs/guides/client/output-schema.mdx +2 -2
  199. package/docs/guides/client/overview.mdx +1 -1
  200. package/docs/guides/deployment/meta.json +1 -0
  201. package/docs/guides/deployment/overview.md +1 -1
  202. package/docs/guides/deployment/self-hosting.md +3 -3
  203. package/docs/guides/deployment/vercel.mdx +1 -1
  204. package/docs/guides/dev-tui.md +3 -13
  205. package/docs/guides/dynamic-capabilities.md +26 -4
  206. package/docs/guides/frontend/meta.json +2 -1
  207. package/docs/guides/frontend/nextjs.mdx +1 -10
  208. package/docs/guides/frontend/nuxt.mdx +1 -10
  209. package/docs/guides/frontend/overview.mdx +12 -3
  210. package/docs/guides/frontend/sveltekit.mdx +1 -10
  211. package/docs/guides/frontend/use-eve-agent-svelte.mdx +39 -126
  212. package/docs/guides/frontend/use-eve-agent-vue.mdx +40 -139
  213. package/docs/guides/instrumentation.md +15 -15
  214. package/docs/guides/meta.json +1 -5
  215. package/docs/guides/remote-agents.md +9 -9
  216. package/docs/guides/session-context.md +34 -103
  217. package/docs/install-integrations.mdx +1 -1
  218. package/docs/instructions.mdx +45 -12
  219. package/docs/meta.json +24 -13
  220. package/docs/patterns/dynamic-scheduling.md +1 -1
  221. package/docs/patterns/meta.json +1 -0
  222. package/docs/patterns/multi-tenant-approvals.md +1 -1
  223. package/docs/patterns/multi-tenant-auth.md +1 -1
  224. package/docs/patterns/multi-tenant-memory.md +4 -3
  225. package/docs/{guides → protocols}/acp.md +1 -1
  226. package/docs/protocols/meta.json +5 -0
  227. package/docs/reference/cli.md +34 -34
  228. package/docs/reference/meta.json +1 -1
  229. package/docs/reference/typescript-api.md +4 -2
  230. package/docs/{subagents.mdx → subagents/index.mdx} +2 -2
  231. package/docs/subagents/meta.json +5 -0
  232. package/docs/{guides/dynamic-workflows.md → subagents/workflow-tool.md} +6 -6
  233. package/docs/tools/human-in-the-loop.md +1 -1
  234. package/docs/tools/meta.json +1 -0
  235. package/docs/tools/overview.mdx +1 -1
  236. package/docs/tutorial/connect-a-warehouse.mdx +1 -1
  237. package/docs/tutorial/meta.json +1 -0
  238. package/docs/tutorial/remember-definitions.mdx +2 -2
  239. package/docs/tutorial/ship-it.mdx +2 -2
  240. package/package.json +4 -4
  241. package/dist/src/compiled/_chunks/workflow/dist-C8PhDW9B.js +0 -1
  242. package/dist/src/compiled/_chunks/workflow/functions-xMPAeWFr.js +0 -1
  243. package/dist/src/compiled/_chunks/workflow/node-Smb57EnG.js +0 -40
  244. package/dist/src/compiled/_chunks/workflow/resume-hook-BrduAuFX.js +0 -1
  245. package/dist/src/compiled/_chunks/workflow/run-CX7_sJnW.js +0 -1
  246. package/dist/src/compiled/_chunks/workflow/sleep-tsb2HjWK.js +0 -1
  247. package/dist/src/compiled/_chunks/workflow/undici-BNc_0O4m.js +0 -95
  248. package/dist/src/compiled/_chunks/workflow/wait-until-BYKVqrwc.js +0 -15
  249. package/dist/src/harness/instrumentation-config.js +0 -1
  250. package/docs/installation.mdx +0 -66
  251. package/docs/project-structure.mdx +0 -53
  252. package/docs/reference/project-layout.md +0 -123
  253. /package/dist/src/harness/{instrumentation-config.d.ts → instrumentation/config.d.ts} +0 -0
  254. /package/dist/src/harness/{instrumentation-content.js → instrumentation/content.js} +0 -0
  255. /package/dist/src/harness/{instrumentation-runtime-context.d.ts → instrumentation/runtime-context.d.ts} +0 -0
  256. /package/dist/src/harness/{instrumentation-runtime-context.js → instrumentation/runtime-context.js} +0 -0
  257. /package/dist/src/harness/{instrumentation-runtime.js → instrumentation/runtime.js} +0 -0
  258. /package/dist/src/harness/{instrumentation-setup-context.d.ts → instrumentation/setup-context.d.ts} +0 -0
  259. /package/dist/src/harness/{instrumentation-setup-context.js → instrumentation/setup-context.js} +0 -0
  260. /package/dist/src/harness/{instrumentation-state.js → instrumentation/state.js} +0 -0
  261. /package/docs/{guides → protocols}/ucp.mdx +0 -0
@@ -1,94 +1,66 @@
1
1
  ---
2
2
  title: "useEveAgent (Vue)"
3
- description: "Vue composable that drives an eve agent session from the browser."
3
+ description: "Use the eve Vue composable and its Vue-specific reactive interface."
4
4
  ---
5
5
 
6
- `useEveAgent()` from `eve/vue` is how a Vue app talks to an eve session. It opens a long-lived session, sends turns, and folds every stream event into reactive data you can bind in a template. Nuxt auto-imports it through the [module](./nuxt), and the [frontend overview](./overview) covers the shared model.
6
+ `useEveAgent()` from `eve/vue` exposes the shared eve frontend client as Vue computed refs and methods. Read the [frontend overview](./overview) for session behavior, messages, human input, authorization, callbacks, reducers, and persistence. This page covers the Vue-specific interface.
7
7
 
8
- ## Basic usage
9
-
10
- Import the composable from `eve/vue`. Its state is exposed as `ComputedRef`s, so you read it unwrapped in templates:
11
-
12
- ```vue
13
- <script setup lang="ts">
14
- import { useEveAgent } from "eve/vue";
15
-
16
- const { data } = useEveAgent();
17
- </script>
18
-
19
- <template>
20
- <div v-for="message in data.messages" :key="message.id">
21
- <p>{{ message.role }}: {{ message.parts }}</p>
22
- </div>
23
- </template>
24
- ```
8
+ Nuxt users normally receive the composable as an auto-import after registering the [`eve/nuxt` module](./nuxt).
25
9
 
26
- ## What it returns
27
-
28
- | Property | Type | Description |
29
- | --------- | ---------------------------------------------- | ------------------------------------------------------------------------- |
30
- | `data` | `ComputedRef<TData>` | Projected state. With the default reducer, `EveMessageData` (`messages`). |
31
- | `status` | `ComputedRef<UseEveAgentStatus>` | `"ready"`, `"submitted"`, `"streaming"`, or `"error"`. |
32
- | `error` | `ComputedRef<Error \| undefined>` | Last transport-level error. |
33
- | `events` | `ComputedRef<readonly MessageStreamEvent[]>` | Raw server events for this session. |
34
- | `session` | `ComputedRef<ClientSessionState \| undefined>` | Fixed session ID and stream cursor. |
35
- | `send` | `(message, options?) => Promise<void>` | Send text or a multi-part message. |
36
- | `respond` | `(inputResponses, options?) => Promise<void>` | Answer pending HITL input requests. |
37
- | `stop` | `() => void` | Abort the client's in-flight stream. |
38
- | `reset` | `() => void` | Clear state and start a new session. |
10
+ ## Basic usage
39
11
 
40
- The first five are `ComputedRef`s; the rest are methods. Destructure whatever you need, since refs keep their reactivity through destructuring. Read them with `.value` in `<script>`, and unwrapped in `<template>`.
41
-
42
- ## Send a message
12
+ Import the composable from `eve/vue`. Its state is exposed as `ComputedRef`s, so templates unwrap it automatically:
43
13
 
44
14
  ```vue
45
15
  <script setup lang="ts">
46
- import { ref } from "vue";
47
16
  import { useEveAgent } from "eve/vue";
17
+ import { computed, ref } from "vue";
48
18
 
49
- const { send } = useEveAgent();
19
+ const { data, status, send } = useEveAgent();
50
20
  const message = ref("");
21
+ const isBusy = computed(() => status.value === "submitted" || status.value === "streaming");
51
22
 
52
23
  async function handleSubmit() {
53
24
  const text = message.value.trim();
54
- if (!text) return;
25
+ if (!text || isBusy.value) return;
55
26
  message.value = "";
56
27
  await send(text);
57
28
  }
58
29
  </script>
59
30
 
60
31
  <template>
32
+ <div v-for="item in data.messages" :key="item.id">
33
+ <p>{{ item.role }}: {{ item.parts }}</p>
34
+ </div>
61
35
  <form @submit.prevent="handleSubmit">
62
- <input v-model="message" placeholder="Type a message..." />
63
- <button type="submit">Send</button>
36
+ <input v-model="message" :disabled="isBusy" />
37
+ <button type="submit" :disabled="isBusy">Send</button>
64
38
  </form>
65
39
  </template>
66
40
  ```
67
41
 
68
- For anything beyond plain text, reach for `send()`. Attachments follow the AI SDK `UserContent` format. Send file data as a base64 `data:` URL so it survives the JSON transport:
42
+ ## What it returns
69
43
 
70
- ```vue
71
- <script setup lang="ts">
72
- import { useEveAgent } from "eve/vue";
44
+ The state fields are computed refs; the commands are ordinary methods:
73
45
 
74
- const { send } = useEveAgent();
75
-
76
- async function onFileChange(event: Event) {
77
- const file = (event.target as HTMLInputElement).files?.[0];
78
- if (!file) return;
79
- const bytes = new Uint8Array(await file.arrayBuffer());
80
- const base64 = btoa(String.fromCodePoint(...bytes));
81
- await send([
82
- { type: "text", text: "Describe this image." },
83
- { type: "file", data: `data:${file.type};base64,${base64}`, mediaType: file.type },
84
- ]);
85
- }
86
- </script>
87
- ```
46
+ | Property | Vue shape |
47
+ | ---------------------------------- | ---------------------------------------------- |
48
+ | `data` | `ComputedRef<TData>` |
49
+ | `status` | `ComputedRef<UseEveAgentStatus>` |
50
+ | `error` | `ComputedRef<Error \| undefined>` |
51
+ | `events` | `ComputedRef<readonly MessageStreamEvent[]>` |
52
+ | `session` | `ComputedRef<ClientSessionState \| undefined>` |
53
+ | `send`, `respond`, `stop`, `reset` | Methods |
54
+
55
+ Destructuring preserves reactivity because each state value remains a ref. Read refs with `.value` in `<script>` and without `.value` in a template. The [shared returned-state reference](./overview#returned-state) describes what each value and command does.
56
+
57
+ ## Send a message
58
+
59
+ Call `send(text)` for text or pass content parts for attachments. The API and transport behavior match the [shared sending guide](./overview#sending-and-streaming); only reactive access differs in Vue.
88
60
 
89
61
  ## Human-in-the-loop prompts
90
62
 
91
- A tool opts into approval with `approval` ([Tools](../../tools)). When it triggers, the pending request shows up on a `dynamic-tool` part at `part.toolMetadata?.eve?.inputRequest`. Scan every message because an unrelated turn can add newer messages while the approval stays open, then answer through the same session with `respond(inputResponses)`:
63
+ Pending requests appear in `data.value.messages`. Use the Vue exports when narrowing message parts, then answer through `respond()`:
92
64
 
93
65
  ```vue
94
66
  <script setup lang="ts">
@@ -132,101 +104,30 @@ const pendingRequests = computed(() =>
132
104
  </template>
133
105
  ```
134
106
 
135
- For a question with `allowFreeform`, bind a text input and send `{ requestId, text }`. The [React hook reference](./overview) covers the shared behavior.
107
+ See [Human-in-the-loop prompts](./overview#human-in-the-loop-prompts) for request semantics and rendering guidance.
136
108
 
137
109
  ## Stop, reset, and resume
138
110
 
139
- `stop()` aborts the in-flight stream; the server-side turn keeps running and remains attachable — to stop the turn itself, POST the session's [cancel route](../../channels/eve#routes). `reset()` wipes state and starts a fresh session. To survive a reload, pass `initialSession` to restore a saved session and `onSessionChange` to persist the cursor as it moves:
140
-
141
- ```ts
142
- const agent = useEveAgent({
143
- initialSession: savedSessionState,
144
- initialEvents: savedEvents,
145
- onSessionChange: (session) => {
146
- localStorage.setItem("eve-session", JSON.stringify(session));
147
- },
148
- });
149
- ```
111
+ Call `stop()` to detach the browser stream without cancelling server-side work, and `reset()` to clear local state and start a new session. Pass `initialSession` and `initialEvents` to restore a saved conversation. See [Resumable sessions](./overview#resumable-sessions) for the persistence contract and [Sending and streaming](./overview#sending-and-streaming) for cancellation behavior.
150
112
 
151
113
  ## Custom host and credentials
152
114
 
153
- When your eve server lives somewhere other than the same origin, point at it with `host` and attach credentials through `auth` or `headers`. Pass a function and it re-resolves before each request:
154
-
155
- ```ts
156
- const agent = useEveAgent({
157
- host: "https://agent.example.com",
158
- headers: async () => ({
159
- authorization: `Bearer ${await getAccessToken()}`,
160
- }),
161
- });
162
- ```
115
+ Pass `host`, `auth`, or `headers` to the composable using the same options as the other frontend bindings. See [Custom hosts and headers](./overview#custom-hosts-and-headers).
163
116
 
164
117
  ## Attach page context per turn
165
118
 
166
- `clientContext` adds ephemeral context for the next model call and nothing more. Strings (or an array of strings) become user-role context messages; an object is JSON-serialized into one. It rides along with a message or HITL response, never dispatches a turn on its own, and never lands in durable session history. Pass it in the second argument to `send()` or `respond()`:
167
-
168
- ```ts
169
- await send("What should I do on this screen?", {
170
- clientContext: { route: "/billing", plan: "pro", seatsUsed: 4 },
171
- });
172
- ```
173
-
174
- To attach the same context to every turn without threading it through each call site, pass `prepareSend`. It runs right before each send and returns the (possibly augmented) turn:
175
-
176
- ```ts
177
- const agent = useEveAgent({
178
- prepareSend: (input) => ({
179
- ...input,
180
- clientContext: { route: location.pathname },
181
- }),
182
- });
183
- ```
119
+ Pass `clientContext` to `send()` or `respond()`, or use `prepareSend` to add context before every turn. See [Attach page context per turn](./overview#attach-page-context-per-turn).
184
120
 
185
121
  ## Lifecycle callbacks
186
122
 
187
- The composable takes a few per-turn callbacks:
188
-
189
- - `onEvent(event)`: fires for each eve stream event as it arrives.
190
- - `onError(error)`: fires with the last `Error` when a turn fails.
191
- - `onFinish(snapshot)`: fires with the final snapshot once a turn settles.
192
- - `onSessionChange(session)`: fires when the session cursor advances. Persist it to resume across reloads.
193
-
194
- ```ts
195
- const agent = useEveAgent({
196
- onEvent: (event) => console.debug(event.type),
197
- onError: (error) => console.error(error.message),
198
- onFinish: (snapshot) => console.log(snapshot.status),
199
- });
200
- ```
201
-
202
- The `optimistic` option (default `true`) projects submitted user messages into `data` before eve confirms them with a `message.received` event. These are reducer-facing projection events only; `events` stays the authoritative eve stream.
123
+ Pass `onEvent`, `onError`, `onFinish`, or `onSessionChange` when the application needs lifecycle notifications. See [Lifecycle callbacks](./overview#lifecycle-callbacks) for callback timing and optimistic projection behavior.
203
124
 
204
125
  ## Custom reducer
205
126
 
206
- The default reducer projects events into `{ messages }` (`EveMessageData`). To shape `data` differently, pass a `reducer` implementing `EveAgentReducer<TData>`:
207
-
208
- ```ts
209
- import { useEveAgent } from "eve/vue";
210
- import type { EveAgentReducer } from "eve/vue";
211
-
212
- interface ToolLog {
213
- readonly toolCalls: number;
214
- }
215
-
216
- const toolCounter: EveAgentReducer<ToolLog> = {
217
- initial: () => ({ toolCalls: 0 }),
218
- reduce: (data, event) =>
219
- event.type === "actions.requested" ? { toolCalls: data.toolCalls + 1 } : data,
220
- };
221
-
222
- const agent = useEveAgent({ reducer: toolCounter });
223
- // agent.data.value is ToolLog
224
- ```
225
-
226
- `reduce(data, event)` receives both authoritative eve stream events and client projection events (`client.message.submitted`, `client.message.failed`, `client.input.responded`). Handle the client events too if you want optimistic and HITL state in your projection. Otherwise, return `data` unchanged for them.
127
+ Import `EveAgentReducer` from `eve/vue` when projecting events into application-specific state. The resulting `data` remains a `ComputedRef<TData>`. See [Custom reducer](./overview#custom-reducer) for the reducer contract and client projection events.
227
128
 
228
129
  ## What to read next
229
130
 
230
- - [Nuxt](./nuxt): module setup
231
- - [Frontend overview](./overview): the shared integration model
232
- - [Sessions, runs & streaming](../../concepts/sessions-runs-and-streaming)
131
+ - [Nuxt](./nuxt): register the module and mount the eve runtime.
132
+ - [Frontend overview](./overview): use the shared frontend API.
133
+ - [Sessions, runs, and streaming](../../concepts/sessions-runs-and-streaming): understand the underlying session protocol.
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "instrumentation.ts"
2
+ title: "Observability"
3
3
  description: "Trace an agent with OpenTelemetry in instrumentation.ts, read the workflow run tags eve emits, and debug discovery with eve info and the common-failures table."
4
4
  ---
5
5
 
@@ -48,11 +48,11 @@ Any OTel-compatible backend works (Braintrust, PostHog, Raindrop, Arize, Honeyco
48
48
 
49
49
  Three more fields control what the AI SDK records inside those spans (see the AI SDK's [telemetry reference](https://ai-sdk.dev/docs/ai-sdk-core/telemetry)):
50
50
 
51
- - `recordInputs` records full message history on each step span (defaults to `true`). Set it to `false` if inputs contain sensitive content or you want to reduce span payload size.
52
- - `recordOutputs` records model outputs on spans (defaults to `true`). Set it to `false` to disable output recording.
51
+ - `recordInputs` records full message history on each step span. It defaults to `false`; set it to `true` to include input content.
52
+ - `recordOutputs` records model outputs on spans. It defaults to `false`; set it to `true` to include output content.
53
53
  - `functionId` overrides the function name on spans (defaults to the agent name).
54
54
 
55
- For sensitive, regulated, or production data, set `recordInputs` and `recordOutputs` to `false` unless you have reviewed the exporter and its data-retention path.
55
+ eve records metadata without model or tool inputs and outputs by default. Enable either content category only after reviewing the exporter and its data-retention path.
56
56
 
57
57
  You are responsible for ensuring any observability or eval provider is approved for the data exported to it.
58
58
 
@@ -173,20 +173,20 @@ Tag writes are best-effort: a failure is logged once per process and then swallo
173
173
 
174
174
  These tags power the **Agent Runs** tab in the Vercel dashboard. When you deploy on Vercel, the platform auto-detects `eve` as the framework and surfaces an Agent Runs view under your project's **Observability** tab, where you can browse sessions and drill into each conversation's trace, with no `instrumentation.ts` required. The tab is currently gated per team. See [Deploy to Vercel](./deployment/vercel#inspect-agent-runs) for enablement. Agent Runs is separate from the OpenTelemetry export above. Use OTel when you want spans in Braintrust, PostHog, Datadog, or another third-party backend.
175
175
 
176
- Note: By default, telemetry records full message history and model outputs You may need to disclose these data flows in your privacy materials if utilized.
177
-
178
176
  ## Local traces
179
177
 
180
178
  Without an `instrumentation.ts`, `eve dev` records spans to disk — one trace per session, with turns, model steps, and tool calls. Read them two ways:
181
179
 
182
- - [`/traces`](dev-tui#inspect-traces) in the dev TUI: a live viewer that replays the trace as a conversation.
180
+ - [`/traces`](dev-tui#logs-and-traces) in the dev TUI: a live trace viewer that replays captured content as a conversation.
183
181
  - [`eve traces`](../reference/cli#eve-traces): a span tree in the terminal, `eve traces ls` to list. Works after `eve dev` exits.
184
182
 
183
+ Local traces omit model and tool inputs and outputs by default. Set `EVE_TRACES_CONTENT=on` in `.env.local` to capture that content.
184
+
185
185
  Writing `instrumentation.ts` replaces this: your `setup` takes over and nothing is recorded locally. For span attributes, retention, and the `EVE_TRACES*` variables, see [`eve traces`](../reference/cli#eve-traces).
186
186
 
187
187
  ## Debugging
188
188
 
189
- `eve info` is the fastest way to see what eve actually picked up: the active tools, skills, subagents, schedules, routes, and discovery diagnostics. eve also writes inspectable artifacts under `.eve/`, kept even when discovery hits errors:
189
+ `eve info` is the fastest way to see what eve actually picked up: ordered static instructions with their roles, plus the active tools, skills, subagents, schedules, routes, and discovery diagnostics. Dynamic instruction results exist only at runtime and are not part of this static inspection. eve also writes inspectable artifacts under `.eve/`, kept even when discovery hits errors:
190
190
 
191
191
  | Artifact | Tells you |
192
192
  | ------------------------------- | ------------------------------------------- |
@@ -199,13 +199,13 @@ When `eve build` fails on discovery errors, the CLI prints the full diagnostics
199
199
 
200
200
  ### Common failures
201
201
 
202
- | Symptom | Likely cause and fix |
203
- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
204
- | Tool not discovered (the model never sees it) | Run `eve info`. Confirm the file is in the right slot (`agent/tools/<name>.ts`) and default-exports `defineTool(...)`, and check `.eve/diagnostics.json` for shape errors. `schedules/` are root-only. |
205
- | Model won't call a tool it should | Tighten the tool `description` and `inputSchema`; put procedural guidance in a [skill](../skills), not the description. Confirm it's in the active set with `eve info`. |
206
- | Stuck on `session.waiting` | The turn is parked for input. Answer the pending approval or question, or POST a follow-up to `/eve/v1/session/:sessionId`. |
207
- | 401 on production routes | Expected: auth fails closed. Replace `placeholderAuth()` with your route policy. Use `vercelOidc()` only for Vercel-issued tokens; otherwise configure `httpBasic()`, JWT/OIDC helpers, or a custom `AuthFn`. See [Auth and route protection](./auth-and-route-protection). |
208
- | Build fails with discovery errors | Read the printed diagnostics and `.eve/diagnostics.json`; confirm the root-vs-subagent boundary is valid and secrets come from env vars. |
202
+ | Symptom | Likely cause and fix |
203
+ | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
204
+ | Tool not discovered (the model never sees it) | Run `eve info`. Confirm the file is in the right slot (`agent/tools/<name>.ts`) and default-exports `defineTool(...)`, and check `.eve/diagnostics.json` for shape errors. `schedules/` are root-only. |
205
+ | Model won't call a tool it should | Tighten the tool `description` and `inputSchema`; put procedural guidance in a [skill](../skills), not the description. Confirm it's in the active set with `eve info`. |
206
+ | Stuck on `session.waiting` | The turn is parked for input. Answer the pending approval or question, or POST a follow-up to `/eve/v1/session/:sessionId`. |
207
+ | 401 on production routes | Expected: auth fails closed. Replace `placeholderAuth()` with your route policy. Use `vercelOidc()` only for Vercel-issued tokens; otherwise configure `httpBasic()`, JWT/OIDC helpers, or a custom `AuthFn`. See [Authentication](./auth-and-route-protection). |
208
+ | Build fails with discovery errors | Read the printed diagnostics and `.eve/diagnostics.json`; confirm the root-vs-subagent boundary is valid and secrets come from env vars. |
209
209
 
210
210
  ## What to read next
211
211
 
@@ -6,14 +6,10 @@
6
6
  "instrumentation",
7
7
  "hooks",
8
8
  "session-context",
9
- "state",
10
9
  "dynamic-capabilities",
11
- "dynamic-workflows",
12
10
  "remote-agents",
13
11
  "dev-tui",
14
- "acp",
15
12
  "frontend",
16
- "client",
17
- "ucp"
13
+ "client"
18
14
  ]
19
15
  }
@@ -20,14 +20,14 @@ export default defineRemoteAgent({
20
20
 
21
21
  `defineRemoteAgent` accepts:
22
22
 
23
- | Parameter | Type | Required | Default | Description |
24
- | ------------------ | --------------------------------------------- | -------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
- | `url` | `string \| (() => string \| Promise<string>)` | Yes | n/a | Base URL of the remote eve deployment to call. A string is baked at compile time; a function is resolved at runtime (see [Runtime URLs](#runtime-urls)). |
26
- | `description` | `string` | Yes | n/a | Model-visible delegation description. |
27
- | `auth` | `OutboundAuthFn` | No | none | Outbound auth hook from `eve/agents/auth`. |
28
- | `forwardPrincipal` | `boolean` | No | `false` | Forward the dispatching turn's session principal to the remote deployment (see [Forwarding the caller identity](#forwarding-the-caller-identity)). |
29
- | `headers` | `HeadersValue` | No | none | Static or lazily resolved request headers. |
30
- | `path` | `string` | No | `/eve/v1/session` | Route appended to `url` for the create-session request. |
23
+ | Parameter | Type | Required | Default | Description |
24
+ | ------------------ | --------------------------------------------- | -------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
25
+ | `url` | `string \| (() => string \| Promise<string>)` | Yes | n/a | Base URL of the remote eve deployment to call. A string is baked at compile time; a function is resolved at runtime (see [Runtime URLs](#runtime-urls)). |
26
+ | `description` | `string` | Yes | n/a | Model-visible delegation description. |
27
+ | `auth` | `OutboundAuthFn` | No | none | Outbound auth hook from `eve/agents/auth`. |
28
+ | `forwardPrincipal` | `boolean` | No | `false` | Forward the dispatching turn's session principal to the remote deployment (see [Forwarding the caller identity](#forwarding-the-caller-identity)). |
29
+ | `headers` | `HeadersValue` | No | none | Static or lazily resolved request headers. |
30
+ | `path` | `string` | No | `/eve/v1/session` | Route appended to `url` for the create-session request. |
31
31
  | `outputSchema` | `StandardSchema \| JSON Schema` | No | none | Structured return type the caller requires. Enforced by the remote agent like any task-mode output schema. Set it on the definition to apply to every call, or override it per call. |
32
32
 
33
33
  ## Dynamic remote agents
@@ -135,5 +135,5 @@ Both failure paths surface to the parent as a failed tool result, so the caller
135
135
  ## What to read next
136
136
 
137
137
  - Local delegation and the isolation boundary → [Subagents](../subagents)
138
- - Have the model orchestrate remote agents programmatically → [Dynamic workflows](./dynamic-workflows)
138
+ - Have the model orchestrate remote agents programmatically → [Workflow Tool](../subagents/workflow-tool)
139
139
  - Securing the receiving deployment → [Auth & route protection](./auth-and-route-protection)
@@ -1,20 +1,22 @@
1
1
  ---
2
2
  title: "Session Context"
3
- description: "Runtime helpers: ctx.session, ctx.getSandbox, ctx.getSkill, and defineState."
3
+ description: "Use ctx.session and runtime accessors inside eve-managed execution."
4
4
  ---
5
5
 
6
- eve exposes runtime state through the `ctx` parameter passed to tool `execute`, hook handlers, channel event handlers, and connection auth/header resolvers:
6
+ eve passes a runtime `ctx` to tool executors, hook handlers, channel event handlers, and connection auth and header resolvers. Use it to inspect the active session and reach resources bound to that execution.
7
7
 
8
- - `ctx.session`: session metadata, turn, auth, and parent lineage
9
- - `ctx.getSandbox()`: live sandbox handle for the current agent
10
- - `ctx.getSkill(identifier)`: handle for a named skill visible to the current agent
11
- - `defineState(name, initial)`: typed durable state with `get()` and `update()` (imported from `eve/context`)
8
+ | Accessor | Provides | Full guide |
9
+ | ---------------------------- | --------------------------------------------------------- | ----------------------------------------------- |
10
+ | `ctx.session` | Session identity, turn metadata, auth, and parent lineage | This page |
11
+ | `ctx.getSandbox()` | The current agent's live sandbox handle | [Sandbox](../sandbox) |
12
+ | `ctx.getSkill(identifier)` | A handle for a skill visible to the current agent | [Skills](../skills#read-skill-files-at-runtime) |
13
+ | `defineState(name, initial)` | Durable typed state shared by runtime code in one session | [State](../concepts/state) |
12
14
 
13
- These APIs work only inside active authored runtime execution, including tools, channel event handlers, and authored hooks. They throw when called outside a managed context.
15
+ These APIs work only during eve-managed runtime execution. Calling them during module evaluation, discovery, or a build throws.
14
16
 
15
17
  ## `ctx.session`
16
18
 
17
- `ctx.session` exposes durable runtime metadata about the current execution.
19
+ `ctx.session` describes the durable session and active turn:
18
20
 
19
21
  ```ts title="agent/tools/who_called_me.ts"
20
22
  import { defineTool } from "eve/tools";
@@ -37,132 +39,61 @@ export default defineTool({
37
39
  });
38
40
  ```
39
41
 
40
- Public session fields:
42
+ Public fields include:
41
43
 
42
- - `auth.current`
43
- - `auth.initiator`
44
- - `id`
45
- - `turn.id`
46
- - `turn.sequence`
47
- - optional `parent`
44
+ - `id`: the durable session ID.
45
+ - `turn.id`: the current turn ID.
46
+ - `turn.sequence`: the turn's position in the session.
47
+ - `auth.current`: the caller for the active inbound turn.
48
+ - `auth.initiator`: the caller that started the session.
49
+ - `parent`: the parent call, session, root session, and turn for a child subagent session.
48
50
 
49
- Behavior:
50
-
51
- - `auth.current` is the caller for the active inbound turn.
52
- - `auth.initiator` is the caller that started the durable session.
53
- - Unprotected agents expose both as `null`.
54
- - Top-level schedule sessions expose the framework app principal (`principalId: "eve:app"`, `principalType: "runtime"`).
55
- - `parent` is present for child subagent sessions and includes the parent `callId`, `sessionId`, `rootSessionId`, and `turn`.
51
+ Unprotected agents expose `auth.current` and `auth.initiator` as `null`. Top-level schedule sessions use the framework app principal (`principalId: "eve:app"`, `principalType: "runtime"`). See [Authentication](./auth-and-route-protection#what-reaches-ctxsessionauth) for how inbound identity becomes session auth.
56
52
 
57
53
  ## `ctx.getSandbox()`
58
54
 
59
- `ctx.getSandbox()` returns a live handle for the current agent's sandbox.
55
+ Call `ctx.getSandbox()` when authored runtime code needs filesystem or process access in the current agent's sandbox:
60
56
 
61
57
  ```ts
62
58
  const sandbox = await ctx.getSandbox();
63
59
  const result = await sandbox.run({ command: "npm test" });
64
60
  ```
65
61
 
66
- Behavior:
67
-
68
- - It takes no arguments. Each agent has exactly one sandbox.
69
- - It is async because eve binds or restores sandbox state lazily.
70
- - It only works when sandbox access is attached to the active runtime path.
71
- - Visibility is node-local. A subagent sees its own sandbox, not the parent's.
72
- - The returned `RuntimeSandboxSession` extends the ordinary sandbox I/O surface
73
- with `stop()`. It is exported from `eve/sandbox`.
74
-
75
- Call `stop()` to release sandbox compute while preserving the durable session
76
- and its filesystem:
77
-
78
- ```ts
79
- const sandbox = await ctx.getSandbox();
80
- await sandbox.stop();
81
- ```
82
-
83
- Each backend implements this with its native lifecycle operation. Treat the
84
- stop as the end of sandbox work in the current callback; a later callback calls
85
- `ctx.getSandbox()` normally and eve reopens the same durable session. Vercel
86
- also supports using the same handle again: its next command or file operation
87
- automatically resumes the sandbox, just as it would after an inactivity
88
- timeout. No separate eve reconnect state is created, and provider failures
89
- reject the returned promise.
90
-
91
- `SandboxSession` also exposes `resolvePath(path)`, which returns the live backend-native path for a logical `/workspace/...` location. Use it when authored code needs that path before passing it to shell code or a child process.
92
-
93
- See [Sandbox](../sandbox) for lifecycle details.
62
+ The accessor is asynchronous because eve may need to bind or restore the sandbox. A subagent sees its own sandbox, not its parent's. The returned runtime handle can also stop compute while preserving the durable sandbox state. See [Sandbox](../sandbox#using-the-sandbox) for the I/O API and lifecycle.
94
63
 
95
64
  ## `ctx.getSkill(identifier)`
96
65
 
97
- `ctx.getSkill(identifier)` returns a handle for a named skill visible to the current agent.
66
+ Call `ctx.getSkill(identifier)` to read a packaged skill's supporting files:
98
67
 
99
68
  ```ts
100
69
  const skill = ctx.getSkill("research");
101
70
  const notes = await skill.file("references/checklist.md").text();
102
71
  ```
103
72
 
104
- Behavior:
105
-
106
- - It is synchronous. File content is read lazily from the active sandbox.
107
- - It only works when sandbox access is attached to the active runtime path.
108
- - `identifier` is the path-derived skill id.
109
- - Visibility follows the current agent's sandbox.
110
- - A missing skill surfaces when a file accessor reads a missing sandbox path.
111
- - The returned handle exposes `name` and `file(relativePath)`.
112
-
113
- See [Skills](../skills) for the full authoring model.
73
+ The accessor is synchronous; file content is read lazily from the active sandbox. Visibility follows the current agent. See [Skills](../skills#read-skill-files-at-runtime) for the complete handle behavior.
114
74
 
115
75
  ## Custom state with `defineState`
116
76
 
117
- Use `defineState` when your agent needs durable typed state that tools, hooks, and channel handlers can share. State survives workflow step boundaries. Declare the handle at module scope so every importer shares it:
118
-
119
- ```ts title="agent/lib/budget.ts"
120
- import { defineState } from "eve/context";
121
-
122
- interface BudgetState {
123
- readonly count: number;
124
- readonly cap: number;
125
- }
126
-
127
- export const budget = defineState<BudgetState>("myapp.budget", () => ({
128
- count: 0,
129
- cap: 25,
130
- }));
131
- ```
132
-
133
- `get()` reads the current value (returning `initial()` on first access), and `update(fn)` applies a function to it. Both throw outside a managed scope. See [State](./state) for the full read/write model and examples from tools and hooks.
77
+ Use `defineState` for durable per-session values that tools, hooks, and channel handlers share. Unlike the `ctx` accessors, import it from `eve/context` and declare the handle at module scope. Its `get()` and `update()` methods still require active eve execution. See [State](../concepts/state) for the read, update, reset, and subagent-isolation model.
134
78
 
135
79
  ## Where these APIs work
136
80
 
137
- Safe places:
138
-
139
- - inside `defineTool(...).execute(input, ctx)`
140
- - inside connection `auth: (ctx) => provider` and `headers: (ctx) => values` resolvers
141
- - inside authored callbacks eve runs inside the runtime
142
- - after asynchronous boundaries inside the same authored execution chain
143
-
144
- Unsafe places:
81
+ Runtime context is available:
145
82
 
146
- - top-level module evaluation
147
- - build scripts
148
- - discovery-time code paths
83
+ - inside `defineTool(...).execute(input, ctx)`;
84
+ - inside connection `auth` and `headers` resolvers;
85
+ - inside channel and hook callbacks that receive `ctx`;
86
+ - after asynchronous boundaries within the same authored execution chain.
149
87
 
150
- If you call them outside an active eve runtime context, they throw immediately with a message explaining the required scope.
88
+ Runtime context is not available during top-level module evaluation, build scripts, or discovery. Declare reusable definitions and state handles at module scope, but call their context-dependent methods only from an eve-managed callback.
151
89
 
152
90
  ## How it works
153
91
 
154
- The framework sets up a context container before invoking authored code:
155
-
156
- 1. The runtime populates durable seed values (auth, session id, compiled bundle).
157
- 2. Before each step, the framework derives step-local values (session metadata, sandbox access, skill access) from the durable state.
158
- 3. Authored code runs inside the managed scope, so `ctx` and `defineState` accessors resolve automatically.
159
- 4. After the step, the framework commits mutable state (for example sandbox changes) back to the durable session.
160
-
161
- The framework manages this lifecycle. Authored code only uses `ctx` and the public accessors.
92
+ eve establishes the managed context before invoking authored runtime code and keeps it available across asynchronous work in that execution chain. The framework binds durable session data and step-local resources, then commits mutable state at the step boundary. Authored code uses the public accessors rather than managing this lifecycle.
162
93
 
163
94
  ## What to read next
164
95
 
165
- - [State](./state)
166
- - [Sessions, runs & streaming](../concepts/sessions-runs-and-streaming)
167
- - [Subagents](../subagents)
168
- - [Skills](../skills)
96
+ - [State](../concepts/state): durable typed values scoped to one session.
97
+ - [Sandbox](../sandbox): runtime filesystem and process access.
98
+ - [Skills](../skills): load procedures and read packaged skill files.
99
+ - [Sessions, runs, and streaming](../concepts/sessions-runs-and-streaming): the durable session and event contract.
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Install Integrations"
2
+ title: "Add Integrations"
3
3
  description: "Discover and install extensions and other integrations from eve and third-party sources."
4
4
  contentType: "How-to"
5
5
  ---