eve 0.69.0 → 0.70.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 (326) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/src/acp/adapter.js +1 -1
  3. package/dist/src/channel/task-card.d.ts +3 -3
  4. package/dist/src/channel/task-card.js +1 -1
  5. package/dist/src/channel/types.d.ts +18 -0
  6. package/dist/src/chunks/{use-eve-agent-Dab2MnT2.js → use-eve-agent-CJQeE7-t.js} +1873 -1236
  7. package/dist/src/chunks/{use-eve-agent-D_5129A9.js → use-eve-agent-DdemtY6C.js} +1874 -1234
  8. package/dist/src/cli/dev/command.js +1 -1
  9. package/dist/src/cli/dev/console-records-preload.d.ts +1 -0
  10. package/dist/src/cli/dev/console-records-preload.js +1 -0
  11. package/dist/src/cli/dev/console-records.d.ts +17 -0
  12. package/dist/src/cli/dev/console-records.js +3 -0
  13. package/dist/src/cli/dev/diagnostic-sink.d.ts +1 -0
  14. package/dist/src/cli/dev/local-server-process.js +1 -1
  15. package/dist/src/cli/dev/tui/blocks.d.ts +2 -1
  16. package/dist/src/cli/dev/tui/blocks.js +3 -3
  17. package/dist/src/cli/dev/tui/conversation-view.d.ts +54 -0
  18. package/dist/src/cli/dev/tui/conversation-view.js +1 -0
  19. package/dist/src/cli/dev/tui/flow-drawer.d.ts +5 -2
  20. package/dist/src/cli/dev/tui/flow-drawer.js +1 -1
  21. package/dist/src/cli/dev/tui/log-display-mode.d.ts +4 -10
  22. package/dist/src/cli/dev/tui/log-display-mode.js +1 -1
  23. package/dist/src/cli/dev/tui/message-queue.d.ts +7 -63
  24. package/dist/src/cli/dev/tui/message-queue.js +3 -1
  25. package/dist/src/cli/dev/tui/prompt-commands.js +1 -1
  26. package/dist/src/cli/dev/tui/question-panel.d.ts +3 -1
  27. package/dist/src/cli/dev/tui/question-panel.js +1 -1
  28. package/dist/src/cli/dev/tui/runner.d.ts +56 -193
  29. package/dist/src/cli/dev/tui/runner.js +3 -3
  30. package/dist/src/cli/dev/tui/task-activity.d.ts +11 -7
  31. package/dist/src/cli/dev/tui/task-activity.js +1 -1
  32. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +15 -37
  33. package/dist/src/cli/dev/tui/terminal-renderer.js +10 -13
  34. package/dist/src/cli/dev/tui/terminal-tool-part.d.ts +2 -0
  35. package/dist/src/cli/dev/tui/terminal-tool-part.js +1 -0
  36. package/dist/src/cli/dev/tui/test/fake-eve-server.d.ts +34 -0
  37. package/dist/src/cli/dev/tui/test/fake-eve-server.js +1 -0
  38. package/dist/src/cli/dev/tui/test/index.d.ts +1 -0
  39. package/dist/src/cli/dev/tui/test/index.js +1 -1
  40. package/dist/src/cli/dev/tui/tool-block-groups.js +1 -1
  41. package/dist/src/cli/dev/tui/tool-presentation.d.ts +1 -0
  42. package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
  43. package/dist/src/cli/dev/tui/tool-rows.d.ts +1 -0
  44. package/dist/src/cli/dev/tui/tool-rows.js +2 -2
  45. package/dist/src/cli/dev/tui/transcript-parts.d.ts +73 -0
  46. package/dist/src/cli/dev/tui/transcript-parts.js +3 -0
  47. package/dist/src/cli/dev/tui/transcript.d.ts +47 -0
  48. package/dist/src/cli/dev/tui/transcript.js +1 -0
  49. package/dist/src/cli/dev/tui/tui.js +1 -1
  50. package/dist/src/cli/dev/tui/turn-clock.d.ts +11 -26
  51. package/dist/src/cli/dev/tui/turn-clock.js +1 -1
  52. package/dist/src/cli/dev/tui/types.d.ts +2 -4
  53. package/dist/src/cli/dev/ui-options.js +1 -1
  54. package/dist/src/client/agent-stream-follower.d.ts +26 -0
  55. package/dist/src/client/agent-stream-follower.js +1 -0
  56. package/dist/src/client/authorization-message-parts.js +1 -1
  57. package/dist/src/client/conversation-client.d.ts +40 -0
  58. package/dist/src/client/conversation-client.js +1 -0
  59. package/dist/src/client/conversation-reducer.d.ts +29 -0
  60. package/dist/src/client/conversation-reducer.js +1 -0
  61. package/dist/src/client/conversation-state.d.ts +110 -0
  62. package/dist/src/client/conversation-state.js +1 -0
  63. package/dist/src/client/eve-agent-projection.d.ts +24 -7
  64. package/dist/src/client/eve-agent-projection.js +1 -1
  65. package/dist/src/client/eve-agent-store-helpers.d.ts +21 -2
  66. package/dist/src/client/eve-agent-store-helpers.js +2 -2
  67. package/dist/src/client/eve-agent-store-state.d.ts +15 -3
  68. package/dist/src/client/eve-agent-store.d.ts +10 -1
  69. package/dist/src/client/eve-agent-store.js +1 -1
  70. package/dist/src/client/index.d.ts +4 -1
  71. package/dist/src/client/index.js +1 -1
  72. package/dist/src/client/message-reducer-primitives.d.ts +1 -2
  73. package/dist/src/client/message-reducer-primitives.js +1 -1
  74. package/dist/src/client/message-reducer-types.d.ts +9 -2
  75. package/dist/src/client/message-reducer.js +1 -1
  76. package/dist/src/client/message-response.js +1 -1
  77. package/dist/src/client/message-run-parts.d.ts +10 -6
  78. package/dist/src/client/message-run-parts.js +1 -1
  79. package/dist/src/client/optimistic-message-submissions.d.ts +6 -4
  80. package/dist/src/client/optimistic-message-submissions.js +1 -1
  81. package/dist/src/client/reducer.d.ts +5 -1
  82. package/dist/src/client/session-turn-dispatch.d.ts +15 -0
  83. package/dist/src/client/session-turn-dispatch.js +1 -0
  84. package/dist/src/client/session-utils.d.ts +27 -10
  85. package/dist/src/client/session-utils.js +1 -1
  86. package/dist/src/client/session.js +1 -1
  87. package/dist/src/client/types.d.ts +2 -1
  88. package/dist/src/compiled/.vendor-stamp.json +1 -1
  89. package/dist/src/compiler/extension-compatibility.d.ts +18 -18
  90. package/dist/src/compiler/extension-compatibility.js +1 -1
  91. package/dist/src/compiler/load-binding-namespace.js +1 -1
  92. package/dist/src/context/keys.d.ts +5 -2
  93. package/dist/src/context/keys.js +1 -1
  94. package/dist/src/context/provider.d.ts +5 -9
  95. package/dist/src/context/run-step.d.ts +4 -4
  96. package/dist/src/context/run-step.js +1 -1
  97. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  98. package/dist/src/evals/runner/execute-task.js +1 -1
  99. package/dist/src/evals/session.js +2 -2
  100. package/dist/src/evals/types.d.ts +16 -0
  101. package/dist/src/eve-channel/index.js +1 -1
  102. package/dist/src/execution/agent-sessions/context.d.ts +4 -2
  103. package/dist/src/execution/agent-sessions/context.js +1 -1
  104. package/dist/src/execution/agent-sessions/steps.js +1 -1
  105. package/dist/src/execution/cancelled-model-call-batch.js +1 -1
  106. package/dist/src/execution/coordination-dispatch-shared.d.ts +6 -4
  107. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  108. package/dist/src/execution/create-session-step.d.ts +4 -2
  109. package/dist/src/execution/create-session-step.js +1 -1
  110. package/dist/src/execution/durable-session-store.d.ts +10 -4
  111. package/dist/src/execution/durable-session-store.js +1 -1
  112. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  113. package/dist/src/execution/legacy-session/completion-step.d.ts +2 -0
  114. package/dist/src/execution/legacy-session/completion-step.js +1 -1
  115. package/dist/src/execution/legacy-session/interrupt-step.js +1 -1
  116. package/dist/src/execution/legacy-session/prepare-step.d.ts +1 -0
  117. package/dist/src/execution/legacy-session/prepare-step.js +1 -1
  118. package/dist/src/execution/legacy-session/snapshot.d.ts +8 -4
  119. package/dist/src/execution/legacy-session/snapshot.js +1 -1
  120. package/dist/src/execution/legacy-session/turn-workflow.js +1 -1
  121. package/dist/src/execution/proxied-deliver-step.js +1 -1
  122. package/dist/src/execution/publish-session-events.d.ts +27 -7
  123. package/dist/src/execution/publish-session-events.js +1 -1
  124. package/dist/src/execution/reconcile-session-continuation-token.d.ts +2 -2
  125. package/dist/src/execution/runtime-context.js +1 -1
  126. package/dist/src/execution/session/active-turn.d.ts +97 -0
  127. package/dist/src/execution/session/active-turn.js +1 -0
  128. package/dist/src/execution/session/entry.js +1 -1
  129. package/dist/src/execution/session/finalization.js +1 -1
  130. package/dist/src/execution/session/handoff.d.ts +5 -3
  131. package/dist/src/execution/session/handoff.js +1 -1
  132. package/dist/src/execution/session/input-queue.d.ts +19 -13
  133. package/dist/src/execution/session/input-queue.js +1 -1
  134. package/dist/src/execution/session/next-input.d.ts +2 -10
  135. package/dist/src/execution/session/next-input.js +1 -1
  136. package/dist/src/execution/session/program.d.ts +2 -0
  137. package/dist/src/execution/session/program.js +1 -1
  138. package/dist/src/execution/session/state-cursor.d.ts +22 -16
  139. package/dist/src/execution/session/state-cursor.js +1 -1
  140. package/dist/src/execution/session/state-delta.d.ts +8 -1
  141. package/dist/src/execution/session/state-delta.js +1 -1
  142. package/dist/src/execution/session/turn-event-handler.js +1 -1
  143. package/dist/src/execution/session/turn-step-result.js +1 -1
  144. package/dist/src/execution/session/turn-step-types.d.ts +13 -4
  145. package/dist/src/execution/session/turn-step.js +1 -1
  146. package/dist/src/execution/session/turn-waiting-step.js +1 -1
  147. package/dist/src/execution/session/turn.d.ts +8 -1
  148. package/dist/src/execution/session/turn.js +1 -1
  149. package/dist/src/execution/session.d.ts +5 -5
  150. package/dist/src/execution/session.js +2 -2
  151. package/dist/src/execution/settle-cancelled-turn-step.d.ts +5 -4
  152. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  153. package/dist/src/execution/tasks/start.d.ts +2 -2
  154. package/dist/src/execution/tasks/task-id-input.d.ts +1 -1
  155. package/dist/src/execution/tasks/task-id-input.js +1 -1
  156. package/dist/src/execution/terminal-session-completion-step.d.ts +2 -0
  157. package/dist/src/execution/terminal-session-completion-step.js +1 -1
  158. package/dist/src/execution/terminal-session-failure-step.d.ts +2 -0
  159. package/dist/src/execution/terminal-session-failure-step.js +1 -1
  160. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  161. package/dist/src/execution/tools/connection-target.d.ts +5 -0
  162. package/dist/src/execution/tools/connection-target.js +1 -1
  163. package/dist/src/execution/tools/connection-tools.js +2 -2
  164. package/dist/src/execution/tools/workflow/start.d.ts +3 -3
  165. package/dist/src/harness/authorization.d.ts +15 -2
  166. package/dist/src/harness/authorization.js +1 -1
  167. package/dist/src/harness/cancelled-turn-emission.d.ts +2 -1
  168. package/dist/src/harness/cancelled-turn-emission.js +1 -1
  169. package/dist/src/harness/coordination.d.ts +5 -3
  170. package/dist/src/harness/emission.d.ts +5 -2
  171. package/dist/src/harness/emission.js +1 -1
  172. package/dist/src/harness/held-requests.d.ts +18 -0
  173. package/dist/src/harness/held-requests.js +1 -0
  174. package/dist/src/harness/hitl/approval-input-requests.d.ts +16 -0
  175. package/dist/src/harness/hitl/approval-input-requests.js +1 -1
  176. package/dist/src/harness/input-extraction.js +1 -1
  177. package/dist/src/harness/input-requests.d.ts +0 -4
  178. package/dist/src/harness/input-requests.js +1 -1
  179. package/dist/src/harness/model-call-error.js +1 -1
  180. package/dist/src/harness/proxy-input-requests.d.ts +4 -4
  181. package/dist/src/harness/session-limit-enforcement.js +1 -1
  182. package/dist/src/harness/stale-input-responses.js +1 -1
  183. package/dist/src/harness/tool-loop.js +2 -2
  184. package/dist/src/harness/turn-tag-state.d.ts +2 -0
  185. package/dist/src/harness/turn-tag-state.js +1 -1
  186. package/dist/src/harness/types.d.ts +23 -11
  187. package/dist/src/instrumentation/channel-delivery.d.ts +1 -0
  188. package/dist/src/instrumentation/channel-delivery.js +1 -1
  189. package/dist/src/instrumentation/lifecycle.d.ts +4 -0
  190. package/dist/src/instrumentation/memory.d.ts +2 -0
  191. package/dist/src/instrumentation/memory.js +1 -1
  192. package/dist/src/instrumentation/native-events.d.ts +1 -0
  193. package/dist/src/instrumentation/native-events.js +1 -1
  194. package/dist/src/instrumentation/runtime.d.ts +4 -3
  195. package/dist/src/instrumentation/runtime.js +1 -1
  196. package/dist/src/instrumentation/session-init.js +1 -1
  197. package/dist/src/internal/application/package.js +1 -1
  198. package/dist/src/internal/authored-module-loader.d.ts +14 -6
  199. package/dist/src/internal/authored-module-loader.js +1 -1
  200. package/dist/src/internal/authored-package-boundary.d.ts +1 -1
  201. package/dist/src/internal/authored-package-boundary.js +1 -1
  202. package/dist/src/internal/bundler/extension-mount-plugin.js +1 -1
  203. package/dist/src/internal/workflow-bundle/dynamic-remote-agent-transform.js +1 -1
  204. package/dist/src/internal/workflow-bundle/dynamic-tool-ast-references.d.ts +27 -1
  205. package/dist/src/internal/workflow-bundle/dynamic-tool-ast-references.js +1 -1
  206. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +2 -2
  207. package/dist/src/protocol/message.d.ts +41 -3
  208. package/dist/src/protocol/message.js +2 -2
  209. package/dist/src/public/channels/slack/action-status.d.ts +2 -2
  210. package/dist/src/public/channels/slack/action-status.js +1 -1
  211. package/dist/src/public/channels/slack/approval-cards.d.ts +15 -0
  212. package/dist/src/public/channels/slack/approval-cards.js +2 -0
  213. package/dist/src/public/channels/slack/auth.d.ts +2 -0
  214. package/dist/src/public/channels/slack/auth.js +1 -1
  215. package/dist/src/public/channels/slack/connections.d.ts +15 -11
  216. package/dist/src/public/channels/slack/connections.js +1 -1
  217. package/dist/src/public/channels/slack/defaults.d.ts +1 -15
  218. package/dist/src/public/channels/slack/defaults.js +3 -4
  219. package/dist/src/public/channels/slack/hitl.js +1 -1
  220. package/dist/src/public/channels/slack/inbound.d.ts +10 -2
  221. package/dist/src/public/channels/slack/inbound.js +1 -1
  222. package/dist/src/public/channels/slack/index.d.ts +2 -0
  223. package/dist/src/public/channels/slack/index.js +1 -1
  224. package/dist/src/public/channels/slack/input-response.js +1 -1
  225. package/dist/src/public/channels/slack/interaction-cards.js +1 -1
  226. package/dist/src/public/channels/slack/interactions.js +1 -1
  227. package/dist/src/public/channels/slack/limits.d.ts +5 -3
  228. package/dist/src/public/channels/slack/private-approval-delivery.js +1 -1
  229. package/dist/src/public/channels/slack/renderers.d.ts +1 -1
  230. package/dist/src/public/channels/slack/renderers.js +1 -1
  231. package/dist/src/public/channels/slack/reply-delivery.d.ts +72 -0
  232. package/dist/src/public/channels/slack/reply-delivery.js +1 -0
  233. package/dist/src/public/channels/slack/sign-in-cancel.d.ts +20 -0
  234. package/dist/src/public/channels/slack/sign-in-cancel.js +1 -0
  235. package/dist/src/public/channels/slack/slackChannel.d.ts +15 -0
  236. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  237. package/dist/src/public/channels/slack/task-card.js +1 -1
  238. package/dist/src/public/channels/teams/defaults.d.ts +1 -1
  239. package/dist/src/public/channels/teams/defaults.js +2 -2
  240. package/dist/src/public/definitions/channel.d.ts +1 -0
  241. package/dist/src/public/definitions/channel.js +1 -1
  242. package/dist/src/public/next/index.js +1 -1
  243. package/dist/src/public/next/server.d.ts +2 -0
  244. package/dist/src/public/next/server.js +1 -2
  245. package/dist/src/public/nuxt/module.d.ts +6 -0
  246. package/dist/src/public/nuxt/module.js +1 -1
  247. package/dist/src/react/index.d.ts +3 -0
  248. package/dist/src/react/index.js +1 -1
  249. package/dist/src/react/use-eve-agent.d.ts +7 -5
  250. package/dist/src/react/use-eve-agent.js +1 -1
  251. package/dist/src/runtime/connections/scoped-authorization.d.ts +2 -0
  252. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  253. package/dist/src/setup/boxes/deploy-project.js +1 -1
  254. package/dist/src/setup/integrations/web/setup.js +6 -2
  255. package/dist/src/setup/scaffold/create/project.js +1 -1
  256. package/dist/src/setup/scaffold/create/web-template.d.ts +2 -2
  257. package/dist/src/setup/scaffold/create/web-template.js +28 -9
  258. package/dist/src/setup/vercel-project-framework.js +1 -1
  259. package/dist/src/shared/display-name.d.ts +15 -0
  260. package/dist/src/shared/display-name.js +1 -0
  261. package/dist/src/shared/framework-eve-server.d.ts +43 -0
  262. package/dist/src/shared/framework-eve-server.js +2 -0
  263. package/dist/src/shared/token-usage.d.ts +2 -0
  264. package/dist/src/shared/token-usage.js +1 -1
  265. package/dist/src/shared/trace-root.d.ts +8 -0
  266. package/dist/src/shared/trace-root.js +1 -0
  267. package/dist/src/subagents/hitl-proxy.d.ts +3 -3
  268. package/dist/src/subagents/hitl-proxy.js +1 -1
  269. package/dist/src/subagents/invocation.d.ts +3 -1
  270. package/dist/src/subagents/tool.js +1 -1
  271. package/dist/src/svelte/index.d.ts +3 -0
  272. package/dist/src/svelte/index.js +2 -2
  273. package/dist/src/svelte/use-eve-agent.d.ts +7 -4
  274. package/dist/src/svelte/use-eve-agent.js +1 -1
  275. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  276. package/dist/src/tools/provided/load-skill.js +1 -1
  277. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  278. package/dist/src/tracing/agent-action-instrumentation.js +1 -1
  279. package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
  280. package/dist/src/tracing/agent-memory-instrumentation.js +1 -1
  281. package/dist/src/tracing/agent-otel-attributes.d.ts +6 -0
  282. package/dist/src/tracing/agent-otel-attributes.js +1 -1
  283. package/dist/src/tracing/agent-otel-provider.js +2 -2
  284. package/dist/src/tracing/agent-otel-runtime-context.d.ts +1 -1
  285. package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
  286. package/dist/src/tracing/agent-otel-session-context.js +1 -1
  287. package/dist/src/tracing/agent-span-contract.js +1 -1
  288. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  289. package/dist/src/tracing/agent-trace-context-codec.d.ts +4 -0
  290. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  291. package/dist/src/tracing/agent-trace-span-processor.js +1 -1
  292. package/dist/src/tracing/agent-trace-state.d.ts +3 -0
  293. package/dist/src/tracing/conversation-context.d.ts +10 -0
  294. package/dist/src/tracing/conversation-context.js +1 -1
  295. package/dist/src/tracing/otel-registration.js +1 -1
  296. package/dist/src/vue/index.d.ts +3 -0
  297. package/dist/src/vue/index.js +2 -2
  298. package/dist/src/vue/use-eve-agent.d.ts +7 -3
  299. package/dist/src/vue/use-eve-agent.js +1 -1
  300. package/docs/channels/slack.mdx +60 -13
  301. package/docs/concepts/built-in-tools.md +3 -2
  302. package/docs/concepts/sessions-runs-and-streaming.md +4 -4
  303. package/docs/connections/overview.mdx +9 -3
  304. package/docs/evals/reporters.mdx +4 -0
  305. package/docs/extensions.md +11 -0
  306. package/docs/guides/client/streaming.mdx +7 -6
  307. package/docs/guides/deployment/vercel.mdx +2 -1
  308. package/docs/guides/dev-tui.md +15 -15
  309. package/docs/guides/dynamic-capabilities.md +1 -1
  310. package/docs/guides/frontend/nuxt.mdx +24 -4
  311. package/docs/guides/frontend/overview.mdx +44 -38
  312. package/docs/guides/frontend/use-eve-agent-svelte.mdx +4 -10
  313. package/docs/guides/frontend/use-eve-agent-vue.mdx +4 -10
  314. package/docs/guides/instrumentation/otel.mdx +24 -6
  315. package/docs/guides/remote-agents.md +26 -8
  316. package/docs/reference/cli.md +4 -4
  317. package/docs/tools/human-in-the-loop.md +4 -4
  318. package/docs/tools/overview.mdx +1 -1
  319. package/docs/tools/tasks.md +8 -8
  320. package/package.json +1 -1
  321. package/dist/src/cli/dev/tui/steering-stream.d.ts +0 -15
  322. package/dist/src/cli/dev/tui/steering-stream.js +0 -1
  323. package/dist/src/cli/dev/tui/subagent-pump.d.ts +0 -134
  324. package/dist/src/cli/dev/tui/subagent-pump.js +0 -1
  325. package/dist/src/public/nuxt/dev-server.d.ts +0 -25
  326. package/dist/src/public/nuxt/dev-server.js +0 -1
@@ -1 +1 @@
1
- import{normalizeChannelAudience}from"#shared/channel-audience.js";import{isInstrumentationPrincipalType}from"#instrumentation/lifecycle.js";import{boundedPrincipalId}from"#tracing/telemetry-budget.js";import{readInstrumentationDecision}from"#shared/instrumentation-decision.js";import{boundedTraceError}from"#tracing/bounded-error.js";const AGENT_TRACE_CONTEXT_KEY=`eve.harness.agentTrace`;function emptyAgentTraceContextState(){return{actionAnchors:{},actions:{},sessions:{},turns:{}}}function serializeAgentTraceContextState(e){return{actionAnchors:e.actionAnchors,actions:e.actions,sessions:Object.fromEntries(Object.entries(e.sessions).map(([e,t])=>[e,{...t,context:serializeSpanContext(t.context)}])),turns:Object.fromEntries(Object.entries(e.turns).map(([e,t])=>[e,{...t,caller:t.caller===void 0?void 0:serializeSpanContext(t.caller),channelDelivery:t.channelDelivery===void 0?void 0:{...t.channelDelivery,requestTraceContext:t.channelDelivery.requestTraceContext===void 0?void 0:serializeSpanContext(t.channelDelivery.requestTraceContext)},context:serializeSpanContext(t.context),terminal:t.terminal===void 0?void 0:t.terminal.type===`turn.failed`?{error:serializeError(t.terminal.error),type:t.terminal.type}:{type:t.terminal.type}}]))}}function deserializeAgentTraceContextState(e){return isRecord(e)?{actionAnchors:deserializeRecord(e.actionAnchors,deserializeAction),actions:deserializeRecord(e.actions,deserializeAction),sessions:deserializeRecord(e.sessions,deserializeSession),turns:deserializeRecord(e.turns,deserializeTurn)}:emptyAgentTraceContextState()}function deserializeSession(e){if(isRecord(e)&&isSpanContext(e.context))return{agentName:typeof e.agentName==`string`?e.agentName:void 0,channelAudience:normalizeChannelAudience(e.channelAudience),channelKind:typeof e.channelKind==`string`?e.channelKind:void 0,channelType:typeof e.channelType==`string`?e.channelType:void 0,context:e.context,decision:readInstrumentationDecision(e.decision),parentLineage:deserializeParentLineage(e.parentLineage),rootSessionId:typeof e.rootSessionId==`string`?e.rootSessionId:``,scheduleId:typeof e.scheduleId==`string`?e.scheduleId:void 0,title:typeof e.title==`string`?e.title:void 0}}function deserializeTurn(e){if(isRecord(e)&&isSpanContext(e.context)&&typeof e.startTimeMs==`number`)return{caller:isSpanContext(e.caller)?e.caller:void 0,channelDelivery:deserializeTurnChannelDelivery(e.channelDelivery),context:e.context,currentPrincipal:deserializePrincipalSummary(e.currentPrincipal),initiatorPrincipal:deserializePrincipalSummary(e.initiatorPrincipal),modelUsage:deserializeModelUsage(e.modelUsage),parentLineage:deserializeParentLineage(e.parentLineage),rootSessionId:typeof e.rootSessionId==`string`?e.rootSessionId:``,sequence:typeof e.sequence==`number`?e.sequence:0,startTimeMs:e.startTimeMs,subagentName:typeof e.subagentName==`string`?e.subagentName:void 0,terminal:deserializeTurnTerminal(e.terminal)}}function deserializeTurnChannelDelivery(e){if(isRecord(e)&&typeof e.channelKind==`string`&&typeof e.channelName==`string`&&typeof e.deliveryId==`string`)return{channelKind:e.channelKind,channelName:e.channelName,deliveryId:e.deliveryId,inputAttribute:typeof e.inputAttribute==`string`?e.inputAttribute:void 0,requestId:typeof e.requestId==`string`?e.requestId:void 0,requestTraceContext:isSpanContext(e.requestTraceContext)?e.requestTraceContext:void 0}}function deserializePrincipalSummary(e){if(!isRecord(e)||!isInstrumentationPrincipalType(e.type))return;let t=e.type===`none`?void 0:boundedPrincipalId(e.id);return t===void 0?{type:e.type}:{id:t,type:e.type}}function deserializeAction(e){if(isRecord(e)&&typeof e.attemptIndex==`number`&&typeof e.callId==`string`&&isActionKind(e.kind)&&typeof e.name==`string`&&isSpanContext(e.parent)&&typeof e.rootSessionId==`string`&&typeof e.sessionId==`string`&&typeof e.spanId==`string`&&typeof e.startTimeMs==`number`&&typeof e.stepIndex==`number`&&typeof e.turnId==`string`)return{attemptIndex:e.attemptIndex,callId:e.callId,channelAudience:normalizeChannelAudience(e.channelAudience),inputAttribute:typeof e.inputAttribute==`string`?e.inputAttribute:void 0,kind:e.kind,name:e.name,parent:e.parent,rootSessionId:e.rootSessionId,sessionId:e.sessionId,spanId:e.spanId,startTimeMs:e.startTimeMs,stepIndex:e.stepIndex,turnId:e.turnId}}function deserializeModelUsage(e){if(!isRecord(e))return;let t=typeof e.inputTokens==`number`?e.inputTokens:void 0,n=typeof e.outputTokens==`number`?e.outputTokens:void 0;return t===void 0&&n===void 0?void 0:{inputTokens:t,outputTokens:n}}function deserializeParentLineage(e){if(isRecord(e)&&typeof e.callId==`string`&&typeof e.sessionId==`string`&&typeof e.turnId==`string`)return{callId:e.callId,sessionId:e.sessionId,subagentName:typeof e.subagentName==`string`?e.subagentName:void 0,turnId:e.turnId}}function deserializeTurnTerminal(e){if(isRecord(e)&&isTurnTerminalType(e.type))return e.type===`turn.failed`?{error:deserializeError(e.error),type:e.type}:{type:e.type}}function deserializeRecord(e,t){if(!isRecord(e))return{};let n={};for(let[r,i]of Object.entries(e)){let e=t(i);e!==void 0&&(n[r]=e)}return n}function serializeSpanContext(e){return{isRemote:e.isRemote,spanId:e.spanId,traceFlags:e.traceFlags,traceId:e.traceId}}function serializeError(e){if(!(e instanceof Error))return;let t=boundedTraceError(e);return{message:t.message,name:t.name,stack:t.stack}}function deserializeError(e){if(!isRecord(e)||typeof e.message!=`string`)return;let t=Error(e.message);return typeof e.name==`string`&&(t.name=e.name),typeof e.stack==`string`&&(t.stack=e.stack),t}function isActionKind(e){return e===`load-skill`||e===`remote-agent-call`||e===`subagent-call`||e===`tool-call`}function isTurnTerminalType(e){return e===`turn.cancelled`||e===`turn.completed`||e===`turn.failed`}function isSpanContext(e){return isRecord(e)&&typeof e.spanId==`string`&&typeof e.traceFlags==`number`&&typeof e.traceId==`string`}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{AGENT_TRACE_CONTEXT_KEY,deserializeAgentTraceContextState,emptyAgentTraceContextState,serializeAgentTraceContextState};
1
+ import{normalizeChannelAudience}from"#shared/channel-audience.js";import{isInstrumentationPrincipalType}from"#instrumentation/lifecycle.js";import{boundedPrincipalId}from"#tracing/telemetry-budget.js";import{readInstrumentationDecision}from"#shared/instrumentation-decision.js";import{boundedTraceError}from"#tracing/bounded-error.js";const AGENT_TRACE_CONTEXT_KEY=`eve.harness.agentTrace`;function decodeTraceSessionId(e){return typeof e.traceSessionId==`string`?e.traceSessionId:typeof e.rootSessionId==`string`?e.rootSessionId:``}function emptyAgentTraceContextState(){return{actionAnchors:{},actions:{},sessions:{},turns:{}}}function serializeAgentTraceContextState(e){return{actionAnchors:e.actionAnchors,actions:e.actions,sessions:Object.fromEntries(Object.entries(e.sessions).map(([e,t])=>[e,{...t,context:serializeSpanContext(t.context)}])),turns:Object.fromEntries(Object.entries(e.turns).map(([e,t])=>[e,{...t,caller:t.caller===void 0?void 0:serializeSpanContext(t.caller),channelDelivery:t.channelDelivery===void 0?void 0:{...t.channelDelivery,requestTraceContext:t.channelDelivery.requestTraceContext===void 0?void 0:serializeSpanContext(t.channelDelivery.requestTraceContext)},context:serializeSpanContext(t.context),terminal:t.terminal===void 0?void 0:t.terminal.type===`turn.failed`?{error:serializeError(t.terminal.error),type:t.terminal.type}:{type:t.terminal.type}}]))}}function deserializeAgentTraceContextState(e){return isRecord(e)?{actionAnchors:deserializeRecord(e.actionAnchors,deserializeAction),actions:deserializeRecord(e.actions,deserializeAction),sessions:deserializeRecord(e.sessions,deserializeSession),turns:deserializeRecord(e.turns,deserializeTurn)}:emptyAgentTraceContextState()}function deserializeSession(e){if(isRecord(e)&&isSpanContext(e.context))return{agentName:typeof e.agentName==`string`?e.agentName:void 0,channelAudience:normalizeChannelAudience(e.channelAudience),channelKind:typeof e.channelKind==`string`?e.channelKind:void 0,channelType:typeof e.channelType==`string`?e.channelType:void 0,context:e.context,decision:readInstrumentationDecision(e.decision),parentLineage:deserializeParentLineage(e.parentLineage),rootSessionId:typeof e.rootSessionId==`string`?e.rootSessionId:``,traceSessionId:decodeTraceSessionId(e),scheduleId:typeof e.scheduleId==`string`?e.scheduleId:void 0,title:typeof e.title==`string`?e.title:void 0}}function deserializeTurn(e){if(isRecord(e)&&isSpanContext(e.context)&&typeof e.startTimeMs==`number`)return{caller:isSpanContext(e.caller)?e.caller:void 0,channelDelivery:deserializeTurnChannelDelivery(e.channelDelivery),context:e.context,currentPrincipal:deserializePrincipalSummary(e.currentPrincipal),initiatorPrincipal:deserializePrincipalSummary(e.initiatorPrincipal),modelUsage:deserializeModelUsage(e.modelUsage),parentLineage:deserializeParentLineage(e.parentLineage),rootSessionId:typeof e.rootSessionId==`string`?e.rootSessionId:``,traceSessionId:decodeTraceSessionId(e),sequence:typeof e.sequence==`number`?e.sequence:0,startTimeMs:e.startTimeMs,subagentName:typeof e.subagentName==`string`?e.subagentName:void 0,terminal:deserializeTurnTerminal(e.terminal)}}function deserializeTurnChannelDelivery(e){if(isRecord(e)&&typeof e.channelKind==`string`&&typeof e.channelName==`string`&&typeof e.deliveryId==`string`)return{channelKind:e.channelKind,channelName:e.channelName,deliveryId:e.deliveryId,inputAttribute:typeof e.inputAttribute==`string`?e.inputAttribute:void 0,requestId:typeof e.requestId==`string`?e.requestId:void 0,requestTraceContext:isSpanContext(e.requestTraceContext)?e.requestTraceContext:void 0}}function deserializePrincipalSummary(e){if(!isRecord(e)||!isInstrumentationPrincipalType(e.type))return;let t=e.type===`none`?void 0:boundedPrincipalId(e.id);return t===void 0?{type:e.type}:{id:t,type:e.type}}function deserializeAction(e){if(isRecord(e)&&typeof e.attemptIndex==`number`&&typeof e.callId==`string`&&isActionKind(e.kind)&&typeof e.name==`string`&&isSpanContext(e.parent)&&typeof e.rootSessionId==`string`&&typeof e.sessionId==`string`&&typeof e.spanId==`string`&&typeof e.startTimeMs==`number`&&typeof e.stepIndex==`number`&&typeof e.turnId==`string`)return{attemptIndex:e.attemptIndex,callId:e.callId,channelAudience:normalizeChannelAudience(e.channelAudience),inputAttribute:typeof e.inputAttribute==`string`?e.inputAttribute:void 0,kind:e.kind,name:e.name,parent:e.parent,rootSessionId:e.rootSessionId,traceSessionId:decodeTraceSessionId(e),sessionId:e.sessionId,spanId:e.spanId,startTimeMs:e.startTimeMs,stepIndex:e.stepIndex,turnId:e.turnId}}function deserializeModelUsage(e){if(!isRecord(e))return;let t=typeof e.inputTokens==`number`?e.inputTokens:void 0,n=typeof e.outputTokens==`number`?e.outputTokens:void 0;return t===void 0&&n===void 0?void 0:{inputTokens:t,outputTokens:n}}function deserializeParentLineage(e){if(isRecord(e)&&typeof e.callId==`string`&&typeof e.sessionId==`string`&&typeof e.turnId==`string`)return{callId:e.callId,sessionId:e.sessionId,subagentName:typeof e.subagentName==`string`?e.subagentName:void 0,turnId:e.turnId}}function deserializeTurnTerminal(e){if(isRecord(e)&&isTurnTerminalType(e.type))return e.type===`turn.failed`?{error:deserializeError(e.error),type:e.type}:{type:e.type}}function deserializeRecord(e,t){if(!isRecord(e))return{};let n={};for(let[r,i]of Object.entries(e)){let e=t(i);e!==void 0&&(n[r]=e)}return n}function serializeSpanContext(e){return{isRemote:e.isRemote,spanId:e.spanId,traceFlags:e.traceFlags,traceId:e.traceId}}function serializeError(e){if(!(e instanceof Error))return;let t=boundedTraceError(e);return{message:t.message,name:t.name,stack:t.stack}}function deserializeError(e){if(!isRecord(e)||typeof e.message!=`string`)return;let t=Error(e.message);return typeof e.name==`string`&&(t.name=e.name),typeof e.stack==`string`&&(t.stack=e.stack),t}function isActionKind(e){return e===`load-skill`||e===`remote-agent-call`||e===`subagent-call`||e===`tool-call`}function isTurnTerminalType(e){return e===`turn.cancelled`||e===`turn.completed`||e===`turn.failed`}function isSpanContext(e){return isRecord(e)&&typeof e.spanId==`string`&&typeof e.traceFlags==`number`&&typeof e.traceId==`string`}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{AGENT_TRACE_CONTEXT_KEY,decodeTraceSessionId,deserializeAgentTraceContextState,emptyAgentTraceContextState,serializeAgentTraceContextState};
@@ -1 +1 @@
1
- import{isAgentActivationSpan}from"#tracing/agent-span-contract.js";var AgentTraceSpanProcessor=class{#e;#t=new Set;#n=new Set;#r=new Set;#i=new Map;constructor(e){this.#e=e}async forceFlush(){await Promise.all(this.#e.map(e=>e.forceFlush()))}onStart(e,t){if(!isSpanLike(e))return;let n=e.attributes[`gen_ai.conversation.id`];if(typeof n==`string`){let t=e.spanContext().traceId;this.#t.has(t)||this.#r.has(t)||(this.#t.add(t),this.#i.set(t,n))}if(this.#a(e))for(let n of this.#e)n.onStart(e,t)}onEnd(e){if(!isSpanLike(e)||!this.#a(e))return;for(let t of this.#e)t.onEnd(e);let t=e.spanContext().traceId;isAgentActivationSpan({name:e.name??``,attributes:e.attributes})&&this.#i.get(t)===e.attributes[`gen_ai.conversation.id`]&&this.#n.add(t)}activeTraceIds(){return this.#t}releaseCompletedTraces(){if(this.#n.size===0)return!1;for(let e of this.#n)this.#t.delete(e),this.#i.delete(e),this.#r.add(e);for(this.#n.clear();this.#r.size>2048;){let e=this.#r.values().next().value;this.#r.delete(e)}return!0}releaseConversation(e){let t=!1;for(let[n,r]of this.#i)r===e&&(t=!0,this.#t.delete(n),this.#n.delete(n),this.#i.delete(n));return t}async shutdown(){await Promise.all(this.#e.map(e=>e.shutdown()))}#a(e){return e.instrumentationScope?.name!==`workflow`&&(this.#t.has(e.spanContext().traceId)||this.#r.has(e.spanContext().traceId))}};function isSpanLike(e){return typeof e==`object`&&!!e&&`attributes`in e&&`spanContext`in e&&typeof e.spanContext==`function`}export{AgentTraceSpanProcessor};
1
+ import{isAgentActivationSpan}from"#tracing/agent-span-contract.js";var AgentTraceSpanProcessor=class{#e;#t=new Set;#n=new Set;#r=new Set;#i=new Map;constructor(e){this.#e=e}async forceFlush(){await Promise.all(this.#e.map(e=>e.forceFlush()))}onStart(e,t){if(!isSpanLike(e))return;let n=e.attributes[`gen_ai.conversation.id`],r=e.attributes[`agent.run.id`];if(typeof n==`string`){let t=e.spanContext().traceId;this.#t.has(t)||this.#r.has(t)?this.#i.get(t)?.ownerRunId===void 0&&typeof r==`string`&&this.#i.set(t,{conversationId:n,ownerRunId:r}):(this.#t.add(t),this.#i.set(t,{conversationId:n,ownerRunId:typeof r==`string`?r:void 0}))}if(this.#a(e))for(let n of this.#e)n.onStart(e,t)}onEnd(e){if(!isSpanLike(e)||!this.#a(e))return;for(let t of this.#e)t.onEnd(e);let t=e.spanContext().traceId,n=this.#i.get(t);isAgentActivationSpan({name:e.name??``,attributes:e.attributes})&&n?.ownerRunId===e.attributes[`agent.run.id`]&&n?.conversationId===e.attributes[`gen_ai.conversation.id`]&&this.#n.add(t)}activeTraceIds(){return this.#t}releaseCompletedTraces(){if(this.#n.size===0)return!1;for(let e of this.#n)this.#t.delete(e),this.#i.delete(e),this.#r.add(e);for(this.#n.clear();this.#r.size>2048;){let e=this.#r.values().next().value;this.#r.delete(e)}return!0}releaseConversation(e){let t=!1;for(let[n,r]of this.#i)r.conversationId===e&&(t=!0,this.#t.delete(n),this.#n.delete(n),this.#i.delete(n));return t}async shutdown(){await Promise.all(this.#e.map(e=>e.shutdown()))}#a(e){return e.instrumentationScope?.name!==`workflow`&&(this.#t.has(e.spanContext().traceId)||this.#r.has(e.spanContext().traceId))}};function isSpanLike(e){return typeof e==`object`&&!!e&&`attributes`in e&&`spanContext`in e&&typeof e.spanContext==`function`}export{AgentTraceSpanProcessor};
@@ -3,6 +3,7 @@ import type { InstrumentationActionKind, InstrumentationParentLineage, Instrumen
3
3
  import type { ChannelAudience } from "#shared/channel-audience.js";
4
4
  import type { InstrumentationDecision } from "#shared/instrumentation-decision.js";
5
5
  export interface AgentSessionTraceState {
6
+ readonly traceSessionId: string;
6
7
  readonly channelAudience?: ChannelAudience;
7
8
  readonly agentName?: string;
8
9
  readonly channelKind?: string;
@@ -15,6 +16,7 @@ export interface AgentSessionTraceState {
15
16
  readonly title?: string;
16
17
  }
17
18
  export interface AgentTurnTraceState {
19
+ readonly traceSessionId: string;
18
20
  readonly caller?: SpanContext;
19
21
  readonly channelDelivery?: AgentTurnChannelDeliveryTraceState;
20
22
  readonly context: SpanContext;
@@ -45,6 +47,7 @@ export interface AgentTurnChannelDeliveryTraceState {
45
47
  readonly requestTraceContext?: SpanContext;
46
48
  }
47
49
  export interface AgentActionTraceState {
50
+ readonly traceSessionId: string;
48
51
  readonly attemptIndex: number;
49
52
  readonly callId: string;
50
53
  readonly channelAudience?: ChannelAudience;
@@ -1,2 +1,12 @@
1
+ import { type Context } from "#compiled/@opentelemetry/api/index.js";
2
+ export declare function withConversationId(context: Context, conversationId: string): Context;
3
+ interface OperationConversation {
4
+ readonly rootSessionId?: string;
5
+ readonly sessionId: string;
6
+ }
7
+ export declare function operationConversationId(input: OperationConversation): string;
8
+ export declare function withOperationConversation(context: Context, input: OperationConversation): Context;
9
+ export declare function conversationIdFromContext(context: unknown): string | undefined;
1
10
  export declare function readConversationBaggage(value: string | null): string | undefined;
2
11
  export declare function writeConversationBaggage(value: string | undefined, conversationId: string | undefined): string | undefined;
12
+ export {};
@@ -1 +1 @@
1
- import{readBaggageMember,replaceBaggageMember}from"#protocol/baggage.js";import{readConversationId}from"#shared/conversation-identity.js";const BAGGAGE_KEY=`eve.conversation.id`;function readConversationBaggage(e){let t=readBaggageMember(e,BAGGAGE_KEY);return typeof t==`string`?void 0:readConversationId(t.value)}function writeConversationBaggage(e,t){let n=readConversationId(t);return n===void 0?e:replaceBaggageMember(e,BAGGAGE_KEY,encodeURIComponent(n))}export{readConversationBaggage,writeConversationBaggage};
1
+ import{readBaggageMember,replaceBaggageMember}from"#protocol/baggage.js";import{readConversationId,resolveConversationId}from"#shared/conversation-identity.js";import{createContextKey}from"#compiled/@opentelemetry/api/index.js";const BAGGAGE_KEY=`eve.conversation.id`,CONVERSATION_KEY=createContextKey(`eve.trace.conversation.id`);function withConversationId(e,t){return e.setValue(CONVERSATION_KEY,t)}function operationConversationId(e){return resolveConversationId(e.rootSessionId??e.sessionId)}function withOperationConversation(e,t){return withConversationId(e,operationConversationId(t))}function conversationIdFromContext(e){if(typeof e!=`object`||!e)return;let t=Reflect.get(e,`getValue`);return typeof t==`function`?readConversationId(Reflect.apply(t,e,[CONVERSATION_KEY])):void 0}function readConversationBaggage(e){let t=readBaggageMember(e,BAGGAGE_KEY);return typeof t==`string`?void 0:readConversationId(t.value)}function writeConversationBaggage(e,t){let n=readConversationId(t);return n===void 0?e:replaceBaggageMember(e,BAGGAGE_KEY,encodeURIComponent(n))}export{conversationIdFromContext,operationConversationId,readConversationBaggage,withConversationId,withOperationConversation,writeConversationBaggage};
@@ -1 +1 @@
1
- import{createRequire}from"node:module";import{agentInvocationSpanName}from"#tracing/agent-span-contract.js";import{SpanKind,context,metrics,propagation,trace}from"#compiled/@opentelemetry/api/index.js";import{AgentSpanIdGenerator}from"#tracing/agent-span-id-generator.js";import{registerOTel}from"#compiled/@vercel/otel/index.js";const REGISTRATION_SPAN_NAME=`eve.otel.registration`,REPLAY_DEDUPLICATION_LIMIT=1e5,REPLAY_DEDUPLICATION_KEY=Symbol.for(`eve.otel.replay-deduplication`),require=createRequire(import.meta.url),replayDeduplicationGlobal=globalThis;var RegistrationMarkerPropagator=class{#e=!1;extract(e){return e}fields(){return[]}inject(){this.#e=!0}isInstalled(){return this.#e=!1,propagation.inject(context.active(),{},{set:()=>{}}),this.#e}},PrivateSpanFilteringProcessor=class{endedSpans;forwardedSpans=new Set;pendingByParent=new Map;pendingSpanCount=0;processors;startedSpans=new Set;constructor(e,t){this.processors=e,this.endedSpans=t}async forceFlush(){this.drainPendingSpans(),await Promise.all(this.processors.map(e=>e.forceFlush()))}onEnd(e){if(isRegistrationSpan(e))return;let t=spanIdentity(e);if(t!==void 0){if(this.endedSpans.has(t))return;if(this.endedSpans.size>=REPLAY_DEDUPLICATION_LIMIT){let e=this.endedSpans.values().next().value;e!==void 0&&this.endedSpans.delete(e)}this.endedSpans.add(t)}let n=parentIdentity(e);if(n!==void 0&&this.startedSpans.has(n)&&!this.forwardedSpans.has(n)){let t=this.pendingByParent.get(n)??[];t.push(e),this.pendingByParent.set(n,t),this.pendingSpanCount+=1,this.pendingSpanCount>1e4&&this.releaseOldestPendingParent();return}this.forward(e,t)}onStart(e,t){if(isRegistrationSpan(e))return;let n=spanIdentity(e);n!==void 0&&addBounded(this.startedSpans,n);for(let n of this.processors)n.onStart(e,t)}async shutdown(){this.drainPendingSpans(),await Promise.all(this.processors.map(e=>e.shutdown()))}drainPendingSpans(){for(;this.pendingByParent.size>0;)this.releaseOldestPendingParent()}releaseOldestPendingParent(){let e=this.pendingByParent.keys().next().value;e!==void 0&&this.releaseChildren(e)}releaseChildren(e){let t=this.pendingByParent.get(e);if(t!==void 0){this.pendingByParent.delete(e),this.pendingSpanCount-=t.length;for(let e of t)this.forward(e,spanIdentity(e))}}forward(e,t){for(let t of this.processors)t.onEnd(e);t!==void 0&&(addBounded(this.forwardedSpans,t),this.releaseChildren(t))}};function registerOtelPipeline(e){let{pipeline:t}=e,n=captureOptionalPeerTracerProxy(),r=new AgentSpanIdGenerator,i=new RegistrationMarkerPropagator,a=privateSpanProcessors(t.spanProcessors),o={attributes:t.resource,autoDetectResources:!1,idGenerator:r,instrumentations:t.instrumentations??[],metricReaders:t.metricReaders,propagators:[...t.propagators??[`auto`],i],serviceName:e.serviceName,spanProcessors:a};registerOTel(t.sampler===void 0?o:{...o,traceSampler:t.sampler});let s=globalTracerUses(r),c=i.isInstalled();if((!s||!c)&&rollbackRegistration({ownsPropagator:c,ownsTracer:s}),!s)throw Error("eve could not register OpenTelemetry because another runtime already owns the global tracer provider. Remove the other `registerOTel` call, or move its exporters into eve's `otelIntegration({ spanProcessors: [...] })`.");if(!c)throw Error("eve could not register OpenTelemetry because another runtime already owns the global propagator. Remove the other global propagator registration and declare propagators through eve's `otel()` instead.");let l=runtimeTracerProvider();if(typeof l.forceFlush!=`function`||typeof l.shutdown!=`function`)throw rollbackRegistration({ownsPropagator:c,ownsTracer:s}),Error(`The registered OpenTelemetry tracer provider has no lifecycle methods.`);n?.setDelegate(l);let u=runtimeMeterProvider();return{forceFlush:async()=>{await Promise.all([l.forceFlush(),u.forceFlush?.()])},idGenerator:r,samplesTrace:(e,t)=>samplerAdmitsTrace(r,e,t),shutdown:async()=>{disableInstrumentations(t.instrumentations),await Promise.all([l.shutdown(),u.shutdown?.()])}}}function privateSpanProcessors(e){let t=e.filter(isSpanProcessor);if(t.length===0)return[...e];let n=new PrivateSpanFilteringProcessor(t,replayDeduplicationRegistry()),r=[],i=!1;for(let t of e){if(!isSpanProcessor(t)){r.push(t);continue}i||(i=!0,r.push(n))}return r}function replayDeduplicationRegistry(){let e=replayDeduplicationGlobal[REPLAY_DEDUPLICATION_KEY];if(e!==void 0)return e;let t=new Set;return replayDeduplicationGlobal[REPLAY_DEDUPLICATION_KEY]=t,t}function samplerAdmitsTrace(e,t,n={name:agentInvocationSpanName(void 0)}){return(e.withTraceId(t,()=>trace.getTracer(`eve.registration`).startSpan(n.name,{attributes:n.attributes,kind:SpanKind.INTERNAL,root:!0})).spanContext().traceFlags&1)==1}function captureOptionalPeerTracerProxy(){try{let e=require("@opentelemetry/api"),t=e.trace.getTracerProvider();return t instanceof e.ProxyTracerProvider?t:void 0}catch{return}}function rollbackRegistration(e){if(e.ownsPropagator&&propagation.disable(),!e.ownsTracer)return;let t=runtimeTracerProvider();if(typeof t.shutdown==`function`)try{t.shutdown().catch(()=>{})}catch{}trace.disable()}function runtimeTracerProvider(){let e=trace.getTracerProvider();return e.getDelegate?.()??e}function runtimeMeterProvider(){let e=metrics.getMeterProvider();return{forceFlush:typeof e?.forceFlush==`function`?()=>e.forceFlush():void 0,shutdown:typeof e?.shutdown==`function`?()=>e.shutdown():void 0}}function disableInstrumentations(e){for(let t of e??[]){let e=t?.disable;if(typeof e==`function`)try{e.call(t)}catch{}}}function globalTracerUses(e){let t=e.allocateSpanId();return e.withSpanId(t,()=>trace.getTracer(`eve.registration`).startSpan(REGISTRATION_SPAN_NAME)).spanContext().spanId===t}function isRegistrationSpan(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===REGISTRATION_SPAN_NAME||`instrumentationScope`in e&&e.instrumentationScope?.name===`eve.registration`)}function spanIdentity(e){if(typeof e!=`object`||!e||!(`spanContext`in e)||typeof e.spanContext!=`function`)return;let t=e.spanContext();return typeof t.traceId==`string`&&typeof t.spanId==`string`?`${t.traceId}:${t.spanId}`:void 0}function parentIdentity(e){if(typeof e!=`object`||!e||!(`parentSpanContext`in e))return;let t=e.parentSpanContext;return typeof t?.traceId==`string`&&typeof t.spanId==`string`?`${t.traceId}:${t.spanId}`:void 0}function addBounded(e,t){if(e.size>=REPLAY_DEDUPLICATION_LIMIT){let t=e.values().next().value;t!==void 0&&e.delete(t)}e.add(t)}function isSpanProcessor(e){return e!==`auto`}export{registerOtelPipeline};
1
+ import{createRequire}from"node:module";import{agentInvocationSpanName}from"#tracing/agent-span-contract.js";import{conversationIdFromContext}from"#tracing/conversation-context.js";import{SpanKind,context,metrics,propagation,trace}from"#compiled/@opentelemetry/api/index.js";import{AgentSpanIdGenerator}from"#tracing/agent-span-id-generator.js";import{registerOTel}from"#compiled/@vercel/otel/index.js";const REGISTRATION_SPAN_NAME=`eve.otel.registration`,REPLAY_DEDUPLICATION_LIMIT=1e5,REPLAY_DEDUPLICATION_KEY=Symbol.for(`eve.otel.replay-deduplication`),require=createRequire(import.meta.url),replayDeduplicationGlobal=globalThis;var RegistrationMarkerPropagator=class{#e=!1;extract(e){return e}fields(){return[]}inject(){this.#e=!0}isInstalled(){return this.#e=!1,propagation.inject(context.active(),{},{set:()=>{}}),this.#e}},PrivateSpanFilteringProcessor=class{endedSpans;forwardedSpans=new Set;pendingByParent=new Map;pendingSpanCount=0;processors;startedSpans=new Set;constructor(e,t){this.processors=e,this.endedSpans=t}async forceFlush(){this.drainPendingSpans(),await Promise.all(this.processors.map(e=>e.forceFlush()))}onEnd(e){if(isRegistrationSpan(e))return;let t=spanIdentity(e);if(t!==void 0){if(this.endedSpans.has(t))return;if(this.endedSpans.size>=REPLAY_DEDUPLICATION_LIMIT){let e=this.endedSpans.values().next().value;e!==void 0&&this.endedSpans.delete(e)}this.endedSpans.add(t)}let n=parentIdentity(e);if(n!==void 0&&this.startedSpans.has(n)&&!this.forwardedSpans.has(n)){let t=this.pendingByParent.get(n)??[];t.push(e),this.pendingByParent.set(n,t),this.pendingSpanCount+=1,this.pendingSpanCount>1e4&&this.releaseOldestPendingParent();return}this.forward(e,t)}onStart(e,t){if(isRegistrationSpan(e))return;let n=conversationIdFromContext(t);n!==void 0&&e.attributes?.[`gen_ai.conversation.id`]===void 0&&e.setAttribute(`gen_ai.conversation.id`,n);let r=spanIdentity(e);r!==void 0&&addBounded(this.startedSpans,r);for(let n of this.processors)n.onStart(e,t)}async shutdown(){this.drainPendingSpans(),await Promise.all(this.processors.map(e=>e.shutdown()))}drainPendingSpans(){for(;this.pendingByParent.size>0;)this.releaseOldestPendingParent()}releaseOldestPendingParent(){let e=this.pendingByParent.keys().next().value;e!==void 0&&this.releaseChildren(e)}releaseChildren(e){let t=this.pendingByParent.get(e);if(t!==void 0){this.pendingByParent.delete(e),this.pendingSpanCount-=t.length;for(let e of t)this.forward(e,spanIdentity(e))}}forward(e,t){for(let t of this.processors)t.onEnd(e);t!==void 0&&(addBounded(this.forwardedSpans,t),this.releaseChildren(t))}};function registerOtelPipeline(e){let{pipeline:t}=e,n=captureOptionalPeerTracerProxy(),r=new AgentSpanIdGenerator,i=new RegistrationMarkerPropagator,a=privateSpanProcessors(t.spanProcessors),o={attributes:t.resource,autoDetectResources:!1,idGenerator:r,instrumentations:t.instrumentations??[],metricReaders:t.metricReaders,propagators:[...t.propagators??[`auto`],i],serviceName:e.serviceName,spanProcessors:a};registerOTel(t.sampler===void 0?o:{...o,traceSampler:t.sampler});let s=globalTracerUses(r),c=i.isInstalled();if((!s||!c)&&rollbackRegistration({ownsPropagator:c,ownsTracer:s}),!s)throw Error("eve could not register OpenTelemetry because another runtime already owns the global tracer provider. Remove the other `registerOTel` call, or move its exporters into eve's `otelIntegration({ spanProcessors: [...] })`.");if(!c)throw Error("eve could not register OpenTelemetry because another runtime already owns the global propagator. Remove the other global propagator registration and declare propagators through eve's `otel()` instead.");let l=runtimeTracerProvider();if(typeof l.forceFlush!=`function`||typeof l.shutdown!=`function`)throw rollbackRegistration({ownsPropagator:c,ownsTracer:s}),Error(`The registered OpenTelemetry tracer provider has no lifecycle methods.`);n?.setDelegate(l);let u=runtimeMeterProvider();return{forceFlush:async()=>{await Promise.all([l.forceFlush(),u.forceFlush?.()])},idGenerator:r,samplesTrace:(e,t)=>samplerAdmitsTrace(r,e,t),shutdown:async()=>{disableInstrumentations(t.instrumentations),await Promise.all([l.shutdown(),u.shutdown?.()])}}}function privateSpanProcessors(e){let t=e.filter(isSpanProcessor);if(t.length===0)return[...e];let n=new PrivateSpanFilteringProcessor(t,replayDeduplicationRegistry()),r=[],i=!1;for(let t of e){if(!isSpanProcessor(t)){r.push(t);continue}i||(i=!0,r.push(n))}return r}function replayDeduplicationRegistry(){let e=replayDeduplicationGlobal[REPLAY_DEDUPLICATION_KEY];if(e!==void 0)return e;let t=new Set;return replayDeduplicationGlobal[REPLAY_DEDUPLICATION_KEY]=t,t}function samplerAdmitsTrace(e,t,n={name:agentInvocationSpanName(void 0)}){return(e.withTraceId(t,()=>trace.getTracer(`eve.registration`).startSpan(n.name,{attributes:n.attributes,kind:SpanKind.INTERNAL,root:!0})).spanContext().traceFlags&1)==1}function captureOptionalPeerTracerProxy(){try{let e=require("@opentelemetry/api"),t=e.trace.getTracerProvider();return t instanceof e.ProxyTracerProvider?t:void 0}catch{return}}function rollbackRegistration(e){if(e.ownsPropagator&&propagation.disable(),!e.ownsTracer)return;let t=runtimeTracerProvider();if(typeof t.shutdown==`function`)try{t.shutdown().catch(()=>{})}catch{}trace.disable()}function runtimeTracerProvider(){let e=trace.getTracerProvider();return e.getDelegate?.()??e}function runtimeMeterProvider(){let e=metrics.getMeterProvider();return{forceFlush:typeof e?.forceFlush==`function`?()=>e.forceFlush():void 0,shutdown:typeof e?.shutdown==`function`?()=>e.shutdown():void 0}}function disableInstrumentations(e){for(let t of e??[]){let e=t?.disable;if(typeof e==`function`)try{e.call(t)}catch{}}}function globalTracerUses(e){let t=e.allocateSpanId();return e.withSpanId(t,()=>trace.getTracer(`eve.registration`).startSpan(REGISTRATION_SPAN_NAME)).spanContext().spanId===t}function isRegistrationSpan(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===REGISTRATION_SPAN_NAME||`instrumentationScope`in e&&e.instrumentationScope?.name===`eve.registration`)}function spanIdentity(e){if(typeof e!=`object`||!e||!(`spanContext`in e)||typeof e.spanContext!=`function`)return;let t=e.spanContext();return typeof t.traceId==`string`&&typeof t.spanId==`string`?`${t.traceId}:${t.spanId}`:void 0}function parentIdentity(e){if(typeof e!=`object`||!e||!(`parentSpanContext`in e))return;let t=e.parentSpanContext;return typeof t?.traceId==`string`&&typeof t.spanId==`string`?`${t.traceId}:${t.spanId}`:void 0}function addBounded(e,t){if(e.size>=REPLAY_DEDUPLICATION_LIMIT){let t=e.values().next().value;t!==void 0&&e.delete(t)}e.add(t)}function isSpanProcessor(e){return e!==`auto`}export{registerOtelPipeline};
@@ -1,3 +1,6 @@
1
1
  export { useEveAgent, type PrepareSend, type UseEveAgentOptions, type UseEveAgentReturn, type UseEveAgentSnapshot, type UseEveAgentStatus, } from "#vue/use-eve-agent.js";
2
2
  export { type EveAgentReducer, type EveAgentReducerEvent, type ClientInputRespondedEvent, type ClientMessageFailedEvent, type ClientMessageSubmittedEvent, } from "#client/reducer.js";
3
+ export { conversationReducer } from "#client/conversation-reducer.js";
4
+ export { openConversationInputs } from "#client/conversation-state.js";
5
+ export type { AgentObservation, ConversationAgentSession, ConversationInput, ConversationState, ConversationTask, ConversationTaskCall, ConversationTurn, } from "#client/conversation-state.js";
3
6
  export { defaultMessageReducer, type EveAuthorizationChallenge, type EveAuthorizationOutcome, type EveAuthorizationPart, type EveMessageData, type EveDynamicToolPart, type EveMessageInputRequest, type EveMessage, type EveMessageMetadata, type EveMessagePart, type EveMessageToolMetadata, } from "#client/message-reducer.js";
@@ -1,3 +1,3 @@
1
- import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-Dab2MnT2.js";
1
+ import { i as openConversationInputs, n as conversationReducer, r as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-CJQeE7-t.js";
2
2
 
3
- export { defaultMessageReducer, useEveAgent };
3
+ export { conversationReducer, defaultMessageReducer, openConversationInputs, useEveAgent };
@@ -3,7 +3,7 @@ import type { UserContent } from "ai";
3
3
  import { type EveAgentStoreCallbacks, type EveAgentStoreSnapshot, type EveAgentStoreStatus, type PrepareSend } from "#client/eve-agent-store.js";
4
4
  import type { EveAgentReducer } from "#client/reducer.js";
5
5
  import type { ClientSession } from "#client/session.js";
6
- import { type EveMessageData } from "#client/message-reducer.js";
6
+ import type { ConversationState } from "#client/conversation-state.js";
7
7
  import type { MessageStreamEvent } from "#protocol/message.js";
8
8
  import type { CancelSessionResult, ClientAuth, HeadersValue, RespondTurnOptions, SendTurnOptions, ClientSessionState } from "#client/types.js";
9
9
  export type { PrepareSend };
@@ -29,6 +29,8 @@ export interface UseEveAgentReturn<TData> {
29
29
  readonly cancel: () => Promise<CancelSessionResult>;
30
30
  /** Projected state: the reducer folds every stream event into this value. */
31
31
  readonly data: ComputedRef<TData>;
32
+ /** Canonical session state, regardless of the chosen data reducer. */
33
+ readonly conversation: ComputedRef<ConversationState>;
32
34
  /** Last transport-level error, or `undefined` when healthy. */
33
35
  readonly error: ComputedRef<Error | undefined>;
34
36
  /** Raw server events from this session (authoritative stream). */
@@ -100,12 +102,14 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
100
102
  * @default true
101
103
  */
102
104
  readonly optimistic?: boolean;
105
+ /** Follow each subagent call's session into `conversation.agents` while mounted. @default false */
106
+ readonly followSubagents?: boolean;
103
107
  /** Prewarm an owned session on mount and after reset. @default false */
104
108
  readonly prewarm?: boolean;
105
109
  /**
106
110
  * Projects stream events into `TData`.
107
111
  *
108
- * @default defaultMessageReducer()
112
+ * @default conversationReducer
109
113
  */
110
114
  readonly reducer?: EveAgentReducer<TData>;
111
115
  /** Replay the attached durable session after mount. Requires `initialSession` or `session`. */
@@ -117,7 +121,7 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
117
121
  */
118
122
  readonly session?: ClientSession;
119
123
  }
120
- export declare function useEveAgent(options?: UseEveAgentOptions<EveMessageData>): UseEveAgentReturn<EveMessageData>;
124
+ export declare function useEveAgent(options?: UseEveAgentOptions<ConversationState>): UseEveAgentReturn<ConversationState>;
121
125
  export declare function useEveAgent<TData>(options: UseEveAgentOptions<TData> & {
122
126
  readonly reducer: EveAgentReducer<TData>;
123
127
  }): UseEveAgentReturn<TData>;
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-Dab2MnT2.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-CJQeE7-t.js";
2
2
 
3
3
  export { useEveAgent };
@@ -127,15 +127,16 @@ vercel connect attach slack/your-agent \
127
127
 
128
128
  Check the delivery path in order so you can identify where a Slack event stops:
129
129
 
130
- | Symptom | Check | Next action |
131
- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
132
- | `eve add channel/slack` stops before scaffolding the channel | Read the setup error for the failed Vercel login, project link, workspace install, connector lookup, or trigger registration step. | Resolve that step, then rerun `eve add channel/slack`. |
133
- | Setup says it could not remove an existing trigger destination | Check the connector's destinations in the Connect dashboard. `vercel connect detach` removes project token access, not trigger destinations. | Edit or remove the stale destination in the dashboard, then register `/eve/v1/slack` with `vercel connect attach`. |
134
- | Mentions never reach the deployment | Confirm that the connector trigger destination uses the intended project and branch, enables triggers, and points to `/eve/v1/slack`. | Edit or remove stale destinations in the Connect dashboard, then register the intended destination with `vercel connect attach`. |
135
- | Mentions work but DMs or thread replies do not | Check the Slack app's Event Subscriptions and OAuth scopes. DMs require `message.im` and `im:history`; channel replies require the matching message event and history scope. | Add the missing events or scopes, then reinstall the Slack app if Slack requires it. |
136
- | A long response cannot be uploaded as a snippet | Check whether the installed Slack app has the `files:write` bot scope. | Add `files:write`, then reinstall the Slack app so the new scope takes effect. |
137
- | A preview request receives an authentication page or protection error | Check whether the branch domain is exempt or the direct Slack request URL includes `x-vercel-protection-bypass`. Slack cannot complete an interactive Vercel Authentication challenge. | Add a Deployment Protection Exception for the branch domain, or add the automation bypass query parameter to a Slack app that uses environment-variable credentials. |
138
- | The webhook reaches the deployment but the agent does not reply | Open the project's Vercel runtime logs, then inspect the session in [**Agent Runs**](/docs/observability/agent-runs) when your team has access. | Use the first missing or failed stage to narrow the issue to channel dispatch, the agent run, or outbound Slack delivery. |
130
+ | Symptom | Check | Next action |
131
+ | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
132
+ | `eve add channel/slack` stops before scaffolding the channel | Read the setup error for the failed Vercel login, project link, workspace install, connector lookup, or trigger registration step. | Resolve that step, then rerun `eve add channel/slack`. |
133
+ | Setup says it could not remove an existing trigger destination | Check the connector's destinations in the Connect dashboard. `vercel connect detach` removes project token access, not trigger destinations. | Edit or remove the stale destination in the dashboard, then register `/eve/v1/slack` with `vercel connect attach`. |
134
+ | Mentions never reach the deployment | Confirm that the connector trigger destination uses the intended project and branch, enables triggers, and points to `/eve/v1/slack`. | Edit or remove stale destinations in the Connect dashboard, then register the intended destination with `vercel connect attach`. |
135
+ | Mentions work but DMs or thread replies do not | Check the Slack app's Event Subscriptions and OAuth scopes. DMs require `message.im` and `im:history`; channel replies require the matching message event and history scope. | Add the missing events or scopes, then reinstall the Slack app if Slack requires it. |
136
+ | A long response cannot be uploaded as a snippet | Check whether the installed Slack app has the `files:write` bot scope. | Add `files:write`, then reinstall the Slack app so the new scope takes effect. |
137
+ | The thread says the agent couldn't deliver its answer | Search the Vercel runtime logs for the error id in the notice. The `final reply was not delivered to Slack` line carries the error, including one thrown by an authored renderer. | Fix the cause, such as a missing `files:write` scope or a renderer that posts invalid blocks. A renderer can post through `postCompletedSlackReply` to get eve's fallbacks. Then ask the agent to resend the answer. |
138
+ | A preview request receives an authentication page or protection error | Check whether the branch domain is exempt or the direct Slack request URL includes `x-vercel-protection-bypass`. Slack cannot complete an interactive Vercel Authentication challenge. | Add a Deployment Protection Exception for the branch domain, or add the automation bypass query parameter to a Slack app that uses environment-variable credentials. |
139
+ | The webhook reaches the deployment but the agent does not reply | Open the project's Vercel runtime logs, then inspect the session in [**Agent Runs**](/docs/observability/agent-runs) when your team has access. | Use the first missing or failed stage to narrow the issue to channel dispatch, the agent run, or outbound Slack delivery. |
139
140
 
140
141
  ## Audience
141
142
 
@@ -151,7 +152,7 @@ controls observability content capture, not access to the channel. See
151
152
 
152
153
  Message hooks return `{ auth }` to dispatch, `null` to drop, or `{ auth, context }` to inject background into history. Public conversations use the returned `title`, or the triggering message text when `title` is omitted. DMs and private channels always use `Private message` so the run title does not expose message details.
153
154
 
154
- - `onMessage(ctx, message)` handles Slack `message` events. eve drops messages authored by the installed app before this hook runs, preventing self-reply loops. Messages from other bots remain visible; check `message.author?.isBot` when those should also be ignored. `ctx.isBotMentioned()` and `ctx.isSubscribed()` support mention and active-thread policies.
155
+ - `onMessage(ctx, message)` handles newly posted Slack messages. eve drops messages authored by the installed app before this hook runs, preventing self-reply loops. Messages from other bots remain visible; check `message.author?.isBot` when those should also be ignored. `ctx.isBotMentioned()` and `ctx.isSubscribed()` support mention and active-thread policies.
155
156
  - `onAppMention(ctx, message)` handles only `app_mention` and takes precedence over `onMessage`. Its default derives workspace-scoped auth.
156
157
  - `onDirectMessage(ctx, message)` handles only DMs and takes precedence over `onMessage`. Bot-authored messages and edits are filtered first; Slack requires `message.im` and `im:history`.
157
158
 
@@ -234,6 +235,8 @@ Override every enabled inbound handler; leaving `onDirectMessage` out would reta
234
235
 
235
236
  Keep authorization checks inside sensitive tools too. The inbound allowlist controls who can start a turn; tool-level checks control what that authenticated Slack principal may read or change.
236
237
 
238
+ `defaultSlackAuth` and `ctx.defaultAuth` identify a person as `slack:<team>:<user>`, where `<team>` is the app installation workspace when Slack reports one, otherwise the event's team. Messages and button clicks resolve the same team, so a Slack Connect user keeps one principal, and one connection sign-in, whether they post in the thread or click an approval.
239
+
237
240
  `onInputResponse` runs after eve decodes a built-in HITL answer but before the parked session resumes. Return `{ auth }` to accept the answer. Returning `null` or throwing rejects it, leaves the request pending, and keeps the Slack controls active. `ctx.defaultAuth` identifies the Slack user who submitted the signed interaction; it does not authorize that user by itself.
238
241
 
239
242
  If you omit `onInputResponse`, Slack accepts HITL answers with the submitting user's auth, regardless of which message or event handlers you define. Define `onInputResponse` when those handlers enforce an invocation policy that must also apply to HITL answers. Put sensitive prompts in conversations limited to the intended approvers, and re-check `ctx.session.auth.current` inside a sensitive tool before performing its side effect.
@@ -462,13 +465,20 @@ eve shows an agent's progress in two places. Short work, such as thinking or a t
462
465
  | The model reasons | The first line of its reasoning |
463
466
  | The model calls tools | Its narration before the calls, or an action label such as `Search useEveAgent` |
464
467
  | The turn waits on its tasks | `Waiting on researcher...`, or `Waiting on 3 tasks...` |
468
+ | The model starts its next step | `Reviewing results...` after a task finishes, otherwise `Thinking...` |
465
469
  | A reply posts | Cleared by Slack |
466
470
 
467
471
  Slack clears a thread status after two minutes without a message, so during a long wait the task card is what shows the work is still going.
468
472
 
469
473
  Action labels follow the same rule as the task card titles described below, plus `+N more` when the model requests several actions at once. They leave out the model's own `task_wait` and `task_cancel` calls. Reasoning snippets build progressively: extensions of at least four characters appear immediately, while smaller streamed deltas use a five-second refresh interval to avoid one Slack request per token.
470
474
 
471
- Replies up to 12,000 characters render inline. Longer replies are uploaded unchanged as a Markdown snippet named `eve-response.md` with a short in-thread note, which requires the `files:write` bot scope. Upload failures are logged by the channel dispatcher; they do not trigger a model retry.
475
+ Replies up to 12,000 characters render inline. Longer replies are uploaded unchanged as a Markdown snippet named `eve-response.md` with a short in-thread note, which requires the `files:write` bot scope.
476
+
477
+ eve's default renderer also recovers when Slack refuses its reply as too large or malformed (`msg_too_long`, `msg_blocks_too_long`, `msg_blocks_too_many`, `invalid_blocks`, or `invalid_blocks_format`): a refused Markdown message is uploaded as the same `eve-response.md` snippet, without posting the message again. The default delivers the reply it receives, so a change a [renderer](#customize-rendering) passes to `next()`, such as a redaction, carries into the snippet. eve logs each fallback it takes, `inline` or `snippet`, with Slack's error code in a `Slack refused the final reply` warning. The log never includes the reply text.
478
+
479
+ When a final reply still doesn't reach Slack, because the upload fails, Slack returns another error, or an authored renderer throws, eve logs the error and posts a short notice in the thread: `I finished, but couldn't deliver my answer in Slack (error id ...). Please ask me to resend it.` The error id matches the `final reply was not delivered to Slack` line in the Vercel runtime logs. The notice carries no reply content: eve never re-sends a reply that a renderer failed to post. The next message in the session tells the model that its previous reply was not delivered, so it doesn't assume the user read it.
480
+
481
+ This applies to the turn's final reply only. A failed status update, tool-call narration, or other event is logged and skipped. Delivery failures don't trigger a model retry.
472
482
 
473
483
  When the model replies while its tasks keep working, that reply posts like any other, and the reply after the results posts as another message. A schedule's session posts only the final reply.
474
484
 
@@ -480,7 +490,7 @@ When a turn starts its first task, eve posts a task card in the thread and keeps
480
490
 
481
491
  Each row shows:
482
492
 
483
- - **Title:** the tool's [`label.start`](/docs/tools#label-tool-activity), or the tool name. An agent task shows the agent name and the first sentence of its brief (`researcher: Find the incidents behind the checkout spike`). A task the agent hands to its own copy shows the brief alone.
493
+ - **Title:** the tool's [`label.start`](/docs/tools#label-tool-activity), or a readable form of the tool name. eve drops the extension or memory namespace before `__` and splits the rest into words, so `crm__sync_accounts` and `syncAccounts` both show as `Sync accounts`. A connection call shows the connection and its tool, as in `Linear: List issues`. An agent task shows the agent name and the first sentence of its brief (`Researcher: Find the incidents behind the checkout spike`). A task the agent hands to its own copy shows the brief alone. eve can't infer brand casing from a name, so `github` shows as `Github`; set `label.start` when the exact wording matters.
484
494
  - **Waiting:** while the task waits on an approval, an answer, or a sign-in, the row says so, as in `Waiting for approval`. In a DM or private channel it also shows the request's prompt; elsewhere it shows only what kind of request is waiting, since `approvalChannel` can send the request to one person. The request itself posts wherever `approvalChannel` sends it, and the row goes back to working once the request resolves.
485
495
  - **How it ended:** the first sentence of the result or the agent's reply, cut to about 100 characters, `Failed` for a failure, or a line for a cancelled task that says why it stopped. A task the model cancelled with `task_cancel` shows `Stopped early since it was no longer needed` with a success check, since the model no longer needed that work. A task stopped by [cancelling the turn](#message-hooks) shows `Stopped by request`, one stopped because its turn ended shows `Stopped when the turn ended`, and one whose run stopped on its own shows `Stopped`. Those rows and failed rows never show a success check. In a DM or private channel, a failure also shows the first sentence of its error, as in `Failed: Rate limited`. Error text can carry internal details, so everywhere else, including proactive sessions without a known `audience`, shows `Failed` alone. A completed or failed task that ran for a second or more also shows how long it took: `Done in 1m 14s: Found three incidents.` or `Failed after 3m`.
486
496
 
@@ -547,6 +557,39 @@ export default slackChannel({
547
557
  });
548
558
  ```
549
559
 
560
+ A `message.completed` handler that posts the final reply itself, instead of calling `next()`, owns that delivery. If it throws, eve logs the error, posts the content-free notice described in [Delivery](#delivery), and tells the model on the next message. eve doesn't retry or re-send your reply, because your renderer may post elsewhere, change the content, or attach data eve can't reproduce. If you post the reply and then a separate follow-up message, as the feedback example above does, catch the follow-up's errors in your handler. Otherwise eve posts the notice even though the reply arrived.
561
+
562
+ To get eve's fallbacks for a reply you render, post it with `postCompletedSlackReply`. You choose the content; eve makes the Slack calls:
563
+
564
+ 1. Your `blocks`, when given, with `text` as the notification text. `text` defaults to `markdown`.
565
+ 2. Your `markdown` as one native Markdown message, when it fits in `SLACK_MARKDOWN_TEXT_MAX_LENGTH` (12,000) characters. eve moves on from the blocks only when Slack refuses them as too large or malformed.
566
+ 3. Your `markdown` uploaded as the `eve-response.md` snippet, when it is longer or Slack refuses the Markdown message.
567
+
568
+ Any other error, and a failed upload, is thrown to your handler. If your handler lets it propagate, eve posts the notice. eve only sends the `blocks`, `text`, and `markdown` you pass. Slack caps the combined text of all `markdown` blocks in one message at 12,000 characters, so a reply that fits in `markdown_text` can still be refused as blocks.
569
+
570
+ ```ts title="agent/channels/slack.ts"
571
+ import { defineSlackRenderer, postCompletedSlackReply, slackChannel } from "eve/channels/slack";
572
+
573
+ const sourcedReplies = defineSlackRenderer({
574
+ events: {
575
+ async "message.completed"(event, channel, _ctx, next) {
576
+ if (event.finishReason === "tool-calls" || !event.message) return next();
577
+ await postCompletedSlackReply(channel, {
578
+ blocks: [
579
+ { type: "markdown", text: event.message },
580
+ { type: "context", elements: [{ type: "mrkdwn", text: "Sources: internal docs" }] },
581
+ ],
582
+ markdown: event.message,
583
+ });
584
+ },
585
+ },
586
+ });
587
+
588
+ export default slackChannel({ renderers: [sourcedReplies] });
589
+ ```
590
+
591
+ Pass a string, as in `postCompletedSlackReply(channel, reply)`, to deliver Markdown alone the way eve's default does.
592
+
550
593
  `taskCard` runs for every turn that calls a tool, and receives the same view eve's default renders from:
551
594
 
552
595
  - `state`: `blocked` while any task waits on a person, `working` while the turn or any other task works, then `finished`.
@@ -644,6 +687,8 @@ export default slackChannel({
644
687
 
645
688
  The callback receives the `InputRequest` and current `SessionContext`, so it can switch on `kind`, `action`, or presentation properties. Omit it to keep every request in the thread, or return `"direct-message"` unconditionally to make every request private. If eve cannot resolve the triggering Slack user for a direct message, it logs the undelivered request and posts no fallback, so private delivery fails closed. The existing `onInputResponse` or tool approval response policy still decides whether the person who clicks may respond.
646
689
 
690
+ When a tool approval resolves, eve retires the messages it posted for it. The card loses its buttons and shows the answer and who gave it, the separate tool-input post is deleted, and a direct-message request's `Waiting on approval` note in the thread changes to the outcome. This also happens when the approval ends without a click, for example when the person replies in the thread instead, in which case the card reads `No longer needed`.
691
+
647
692
  A renderer's `input.requested` handler can extend delivery and then hand the requests on to eve with `next()`. For example, an application can add non-sensitive context to the Slack thread before eve renders the actionable controls. The configured `approvalChannel` still sends sensitive reviews to a DM and keeps ordinary requests in the thread:
648
693
 
649
694
  ```ts title="agent/channels/slack.ts"
@@ -697,10 +742,12 @@ deriveHitlResponse({ actionId: button.action_id, value: button.value });
697
742
  // { response: { optionId: "approve", requestId: request.requestId } }
698
743
  ```
699
744
 
700
- Use them to test a custom renderer against eve's wire format, or to post eve's controls from your own renderer. A click on these controls in the session's Slack thread resumes the session through `onInputResponse`, the same as eve's own controls. To pass `response` to `respond()` yourself, validate it first with `parseInputResponses` from `eve/client`.
745
+ Use them to test a custom renderer against eve's wire format, or to post eve's controls from your own renderer. A click on these controls in the session's Slack thread resumes the session through `onInputResponse`, the same as eve's own controls. eve does not track controls you post yourself, so update or remove those messages from your renderer's `approval.settled` and `input.resolved` handlers. To pass `response` to `respond()` yourself, validate it first with `parseInputResponses` from `eve/client`.
701
746
 
702
747
  Authorization prompts split public status from private credentials. A sign-in challenge (OAuth URL, device code) is a credential. Anyone who completes it binds their identity to the session's connection. The default `authorization.required` handler posts a public, link-free status in the thread, delivers the actual challenge ephemerally to the Slack user behind the event's `principalId`, device code included, and then updates that public status when `authorization.completed` fires. A renderer's `authorization.required` handler receives a private-delivery context with `postEphemeral`, `postDirectMessage` (needs the `im:write` scope), and `state`. There is, intentionally, no public `post` and no raw API access. Its `next()` reaches eve's default, which posts the public status; skip `next` to deliver the challenge yourself, as this handler does by direct message. `state.slackUsersByPrincipal` maps each principal eve has seen in the thread, through a message or an input response, to its Slack user ID. If the principal has no entry, the challenge is not sent privately.
703
748
 
749
+ The default private prompt names the service, says the agent is paused, and pairs a **Connect** button with **Cancel**. Cancel ends the held turn and removes the prompt; the public status, "Paused: waiting for @user to connect Linear…", then reads "Linear sign-in cancelled". Approval cards say the agent is paused until someone approves or cancels.
750
+
704
751
  ```ts
705
752
  renderers: [
706
753
  {
@@ -269,8 +269,9 @@ export default disableTool();
269
269
 
270
270
  `connection_search` and `connection_execute` give the model every tool from the agent's [connections](../connections) without adding each tool to the model's tool list. eve adds both when the agent has a static connection or a dynamic connection resolver, even when `defaultTools` is `false`, so there is no add command.
271
271
 
272
- - `connection_search({ query?, connection?, limit?, offset? })` returns matching tools with their connection, name, description, and a TypeScript signature rendered from the tool's schemas. Omit `query` to list every tool, or pair it with `connection` to list one connection's tools.
273
- - `connection_execute({ connection, tool, input })` checks `input` against the tool's input schema, calls the tool, and returns its result. The stream reports the call as a nested action named `<connection>__<tool>`, such as `linear__list_issues`, whose `parentCallId` is the `connection_execute` call id.
272
+ - `connection_search({ query?, connection?, signIn?, limit?, offset? })` returns matching tools with their connection, name, description, and a TypeScript signature rendered from the tool's schemas. Omit `query` to list every tool, or pair it with `connection` to list one connection's tools. A plain search never asks the user to sign in. For a connection the user has not signed in to, the result tells the model that sign-in is needed before its tools can be listed: the connection appears under `unavailable` with `requiresSignIn: true` and an error that points to `signIn: true`. Tools from the other connections are still returned.
273
+ - `connection_search({ connection, signIn: true, query? })` asks the user to sign in to that one connection when they have not yet, then returns its matching tools. Without `connection` it fails, so the user is asked about one service at a time.
274
+ - `connection_execute({ connection, tool, input })` checks `input` against the tool's input schema, calls the tool, and returns its result. When the connection needs the user's authorization, it also asks the user to sign in and the call parks until sign-in completes. The stream reports the call as a nested action named `<connection>__<tool>`, such as `linear__list_issues`, whose `parentCallId` is the `connection_execute` call id.
274
275
 
275
276
  The definitions of both tools never change during a session. eve lists connection names and descriptions in append-only context messages rather than in the system prompt, so finding a tool, signing in, or resolving a dynamic connection keeps the cached prompt prefix.
276
277
 
@@ -93,7 +93,7 @@ The stream is newline-delimited JSON (NDJSON), one event per line:
93
93
  | `authorization.completed` | A connection's authorization resolved; carries `outcome`. |
94
94
  | `step.completed` | A model step finished; carries `finishReason` and usage. |
95
95
  | `step.failed` | A model step failed; carries `{ code, message, details? }`. |
96
- | `turn.waiting` | The open turn parked while its tasks work or a call it runs waits on input; carries `turnId`. The turn has not ended. |
96
+ | `turn.waiting` | The open turn parked; carries `turnId` and `on`: `"input"` while a person must act on a sign-in, approval, or question, `"tasks"` while work it started runs. The turn has not ended. |
97
97
  | `turn.completed` | The turn finished. |
98
98
  | `turn.failed` | The turn failed; carries `{ code, message, details? }`. |
99
99
  | `turn.cancelled` | The turn was cancelled before finishing; always followed by `session.waiting`. |
@@ -119,11 +119,11 @@ A nested action is a call a tool makes on the model's behalf, such as each conne
119
119
 
120
120
  Note: consider the privacy, confidentiality, and user-experience implications for displaying, storing, or transmitting reasoning events in your application.
121
121
 
122
- `message.completed` can fire more than once in a turn: the agent often emits interim assistant text before a tool call. To tell tool-call narration from a terminal reply, check `message.completed.data.finishReason`. `step.completed.data.finishReason` mirrors the step outcome, and usage lives on `step.completed`.
122
+ `message.completed` can fire more than once in a turn: the agent often emits interim assistant text before a tool call. To tell tool-call narration from a terminal reply, check `message.completed.data.finishReason`. `step.completed.data.finishReason` mirrors the step outcome, and each step's usage lives on `step.completed`. `session.waiting`, `session.failed`, `session.completed`, and `turn.waiting` carry `data.usage`: the session's running total of its own model calls plus what the agents it delegated to spent. `costUsd` is absent when no model call reported a cost, and compaction calls are not counted.
123
123
 
124
124
  A delegated subagent publishes progress on its own child-session stream. When a subagent tool call or a workflow tool's `ctx.agent` opens a session, the parent emits `agent.started` with the call's `callId` and `turnId`, its `taskId` when the call runs as a task, the child's `sessionId`, and a `streamPath` that a client follows with `session.agent(started).stream()`. A subagent tool call is a [task](#task-events) whose `task.started` has `kind: "agent"`: its `task.started` and `task.settled` carry the call, and `task.settled.data.output` is the child's reply. A call that fails before the child session opens has no `agent.started`. A settled call does not end the child session; later calls with the same `taskId` reach it.
125
125
 
126
- A question or sign-in from inside a running call does not end the turn. This covers a workflow tool's `ctx.ask()`, including the built-in `ask_question` tool, and a delegated subagent's question or sign-in. The stream emits `input.requested` or `authorization.required`, then `turn.waiting` with the open turn's `turnId`. After the answer or sign-in, the turn resumes with the next `step.started` for the same `turnId`, and only `turn.completed`, `turn.failed`, or `turn.cancelled` ends it. When you answer a question that belongs to a workflow tool or a subagent, the session you answer on emits `input.resolved` for it as it routes the answer down. If the workflow tool run that relayed a question or approval ends before anyone answers, that session emits `input.resolved` with `outcome: "cancelled"` for it. This covers the run's own `ctx.ask()` questions and requests from sessions it opened with `ctx.agent`. A cancelled turn does the same for every question or approval the session relays. A tool approval the turn requests still ends the turn: `input.requested`, `turn.completed`, then `session.waiting`.
126
+ A question or sign-in from inside a running call does not end the turn. This covers a workflow tool's `ctx.ask()`, including the built-in `ask_question` tool, and a delegated subagent's question or sign-in. The stream emits `input.requested` or `authorization.required`, then `turn.waiting` with `on: "input"` and the open turn's `turnId`. After the answer or sign-in, the turn resumes with the next `step.started` for the same `turnId`, and only `turn.completed`, `turn.failed`, or `turn.cancelled` ends it. When you answer a question that belongs to a workflow tool or a subagent, the session you answer on emits `input.resolved` for it as it routes the answer down. If the workflow tool run that relayed a question or approval ends before anyone answers, that session emits `input.resolved` with `outcome: "cancelled"` for it. This covers the run's own `ctx.ask()` questions and requests from sessions it opened with `ctx.agent`. A cancelled turn does the same for every question or approval the session relays. A sign-in or tool approval the turn raises itself holds it the same way, also with `on: "input"`. A message from the same person steers the turn and cancels the request: a sign-in reports `authorization.completed` with `outcome: "declined"`, and an approval reports `input.resolved` with `outcome: "ignored"`. Messages from other people wait until the turn ends. Cancelling the turn ends both: a held sign-in reports `authorization.completed` with `outcome: "declined"`, and a held approval reports `input.resolved` with `outcome: "cancelled"`.
127
127
 
128
128
  ### Task events
129
129
 
@@ -217,7 +217,7 @@ curl -X POST http://127.0.0.1:2000/eve/v1/session/<sessionId> \
217
217
 
218
218
  Message sends default to `"steer"`. Before assistant output begins, eve interrupts pending model generation and continues the same turn with the correction. Reasoning and provider search progress do not count as assistant output. An executing eve tool finishes safely, and its result is preserved before the correction reaches the next model call. A steering message aborts the [`ctx.abortSignal`](/docs/tools/workflows#stop-early-for-a-new-message) of each `execute` workflow tool call the turn is waiting on: its questions are withdrawn, `sleep` and `ask_question` stop early, and the call settles with what its body returns. A steering message ends a `task_wait` but never interrupts a task. Only the turn's own caller steers it; another caller's message waits for the turn to end. After assistant output starts, steering applies at the next committed workflow boundary; text already streamed remains visible. Channels and TypeScript `Session.send(...)` calls can select `turnPolicy: "queue"` when the active turn should finish first. Structured `inputResponses` answer their addressed requests.
219
219
 
220
- If the session is waiting on a human-in-the-loop approval, respond with the channel’s Approve or Cancel controls. Text messages do not decide an approval; unrelated text starts an ordinary turn while the approval stays pending and answerable. A later structured `inputResponses` answer keyed by its `requestId` still resumes the original tool call, even after intervening turns.
220
+ If the session is waiting on a human-in-the-loop approval, respond with the channel’s Approve or Cancel controls. Text that doesn't match an option doesn't approve the call. From the person the turn serves, it steers the turn and cancels the approval, even when sent with `turnPolicy: "queue"`, since the turn can't end until that person acts; from anyone else, it waits until the turn ends. If they had already approved some calls in the batch, those calls still run. Cancelling the turn withdraws the approval, and a later answer to it approves nothing.
221
221
 
222
222
  A pending `ctx.ask()` question from a tool, such as `ask_question`, can be answered with plain text. When it is the only pending question, a message that matches an option answers it, and so does any message when the question allows free text. Otherwise eve does not guess which question the text addresses: the message follows the normal `turnPolicy`. A steering message withdraws the questions of the `execute` workflow tool calls the turn waits on, which resolve as `cancelled`; a task's questions stay open. Questions from subagents always need a structured response. Use structured responses to target requests unambiguously.
223
223
 
@@ -227,6 +227,10 @@ export default defineMcpClientConnection({
227
227
 
228
228
  Use the connector UID returned by `vercel connect create`; the display name passed to `--name` is not the UID. `connect("linear/myagent")` is shorthand for a user-scoped interactive OAuth connection: eve resolves a token for the active user before each tool call, emits `authorization.required` when that user has not authorized yet, and resumes the parked turn after the callback completes.
229
229
 
230
+ Discovering tools never posts a sign-in prompt for a service the answer does not need. A plain `connection_search` lists connections the user has not authorized yet under `unavailable` with `requiresSignIn: true`. Most OAuth MCP servers reject even tool listing without the user's token, so the model asks for sign-in explicitly, one connection at a time, with `connection_search({ connection, signIn: true })`, which returns that connection's tools once the user signs in. Calling a tool with `connection_execute` on a connection the user has not authorized also asks for sign-in.
231
+
232
+ A sign-in holds the turn open until the user connects, the turn is cancelled, or the user sends another message. That message steers the turn: eve cancels the sign-in, reports `authorization.completed` with `outcome: "declined"`, and the model reads the message next. Messages from other people in a shared thread wait until the turn ends, and the completed sign-in resumes the turn as the person who started it.
233
+
230
234
  When a local subagent needs interactive authorization, eve surfaces the authorization lifecycle on the root session's channel, including through nested subagent chains. The challenge still points to the child session's callback, so completing it resumes the child directly while the parent continues waiting for its result. The parent's turn stays open: it emits `turn.waiting` after the proxied `authorization.required` and resumes under the same `turnId` once the subagent returns.
231
235
 
232
236
  That means the channel that creates or continues the session must authenticate a real user. For a web app, configure `agent/channels/eve.ts` so your app session maps to `principalType: "user"`; for platform channels, use the built-in channel auth that maps the sender to a user principal. If no authenticated user is attached to the session, the first user-scoped connection call fails with `reason: "principal_required"`.
@@ -273,7 +277,7 @@ export default defineMcpClientConnection({
273
277
  // Probed before every tool call. Return a token to run the tool;
274
278
  // throw `Required` to start the consent flow.
275
279
  getToken: async ({ principal }) => {
276
- const token = await lookupCachedToken(principal);
280
+ const token = await loadStoredToken(principal);
277
281
  if (!token) throw new ConnectionAuthorizationRequiredError("linear");
278
282
  return { token };
279
283
  },
@@ -289,15 +293,17 @@ export default defineMcpClientConnection({
289
293
  // Runs when the provider redirects to the callback URL. `resume` is
290
294
  // typed as `{ verifier: string } | undefined`; `callback.params`
291
295
  // holds the IdP's returned query/body params.
292
- completeAuthorization: async ({ resume, callback }) => {
296
+ // Persist the token here so `getToken` finds it on later tool calls.
297
+ completeAuthorization: async ({ principal, resume, callback }) => {
293
298
  const token = await exchangeCode(resume!.verifier, callback.params.code!);
299
+ await saveStoredToken(principal, token);
294
300
  return { token };
295
301
  },
296
302
  }),
297
303
  });
298
304
  ```
299
305
 
300
- `getToken` runs before every tool call. `startAuthorization` and `completeAuthorization` are both-or-neither: provide one without the other and you get a definition error. The `challenge` rides along verbatim on the `authorization.required` event. Its fields:
306
+ `getToken` runs before every tool call. eve does not store tokens for you: the token returned from `completeAuthorization` is reused only within the current workflow step, so it never lands in durable session state. Save it in `completeAuthorization` (or let your OAuth provider keep it) and read it back in `getToken`. If `getToken` cannot find the token on a later call, eve asks the user to sign in again. `startAuthorization` and `completeAuthorization` are both-or-neither: provide one without the other and you get a definition error. The `challenge` rides along verbatim on the `authorization.required` event. Its fields:
301
307
 
302
308
  | Field | Purpose |
303
309
  | -------------- | ----------------------------------------------------------------------------------------- |
@@ -97,6 +97,10 @@ interface EvalReporter {
97
97
 
98
98
  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.
99
99
 
100
+ `result.result.derived` holds the facts the runner derived from the eval's sessions, such as tool calls and `models`: the distinct ids of the models the steps started with, in session order. Each entry in `result.result.sessions` holds the same facts for one session, in first-use order, so a reporter can tell the primary session's models from those of the other sessions the eval created or attached. A delegated subagent runs in its own session, so its models appear only when the eval attaches that session with `t.target.attachSession`. Compaction and `auto` routing calls are not included.
101
+
102
+ `derived.usage` is the token usage and cost from each session's latest `session.waiting`, `turn.waiting`, `session.failed`, or `session.completed`, including what its delegated agents spent; on a turn, it is the session's total so far. The eval's `usage` counts each captured session once, by its latest usage, and leaves out sessions another captured session opened, because that session already counts their spend. It is absent when a counted session reported no usage. It leaves out compaction calls, the turns an eval sends directly to a child session it attached, and delegated spend counted after a session's last such event.
103
+
100
104
  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.
101
105
 
102
106
  ## What to read next
@@ -93,6 +93,17 @@ Author a subagent under `extension/subagents/<id>/` using the same files as a su
93
93
 
94
94
  Modules inside the contributed subagent can import the extension handle. For example, a tool under `extension/subagents/reviewer/tools/` can read the configuration bound by the consumer's `agent/extensions/crm.ts` mount.
95
95
 
96
+ A contributed subagent can mount another extension under `extension/subagents/<id>/extensions/` and derive that mount's configuration from its own extension's configuration:
97
+
98
+ ```ts
99
+ // extension/subagents/reviewer/extensions/search.ts
100
+ import search from "@acme/search";
101
+
102
+ import crm from "../../../extension.js";
103
+
104
+ export default search({ apiKey: crm.config.searchApiKey });
105
+ ```
106
+
96
107
  ### Build and optionally publish
97
108
 
98
109
  The scaffold's `package.json` declares separate source and distribution roots:
@@ -56,11 +56,12 @@ This consumes the stream until the current turn boundary:
56
56
  - `session.waiting`
57
57
  - `session.completed`
58
58
  - `session.failed`
59
- - `turn.waiting` while an `input.requested` the response read is unanswered
59
+ - `turn.waiting` with `on: "input"`, which the turn emits while a person must
60
+ act on an approval or question. A sign-in emits it too, but the response stays
61
+ attached through it; see [authorization pauses](#authorization-pauses)
60
62
 
61
- A `turn.waiting` without a pending request is informational: the turn stays
62
- open, and `result()` keeps reading to its final reply. This includes a sign-in
63
- a running call needs, such as a subagent's connection. When a call the turn
63
+ A `turn.waiting` with `on: "tasks"` is informational: the turn stays open, and
64
+ `result()` keeps reading to its final reply. When a call the turn
64
65
  runs asks a question, such as a workflow tool's `ctx.ask()`, `result()` returns
65
66
  `status: "waiting"` with the question in `inputRequests`. Answer it with
66
67
  `respond()`, which keeps reading the same turn. A question stays pending until
@@ -68,7 +69,7 @@ its `input.resolved`, which the session you answer on also emits for a
68
69
  subagent's or workflow tool's question.
69
70
 
70
71
  A turn that waits on its [tasks](/docs/tools/workflows#run-calls-as-tasks-task)
71
- also emits `turn.waiting` without a pending request. The text the model wrote
72
+ emits `turn.waiting` with `on: "tasks"`. The text the model wrote
72
73
  before the wait is not the reply: `result()` resolves with the final reply
73
74
  after the tasks finish.
74
75
 
@@ -166,7 +167,7 @@ client-resolvable `http(s)` and `data:` URLs.
166
167
 
167
168
  `authorization.required` is different from the normal `session.waiting` boundary. It means a connection needs OAuth or another authorization challenge before the parked turn can continue. Chat UIs should render the authorization prompt, disable ordinary text input for that session, and persist the event with the rest of the chat history.
168
169
 
169
- The stream can emit an interim `session.waiting` while the authorization callback is pending. An active `send()` or `respond()` response stays attached across that parking boundary until the authorization resolves and the resumed turn reaches its next boundary. If you support refresh while an authorization prompt is pending, keep the session cursor from the started session and rehydrate the saved events on load; the callback or a structured decline resumes the same eve session.
170
+ The sign-in holds the turn open, and the stream emits `turn.waiting` with `on: "input"` while the authorization callback is pending. An active `send()` or `respond()` response stays attached across it until the authorization resolves and the resumed turn reaches its next boundary. If you support refresh while an authorization prompt is pending, keep the session cursor from the started session and rehydrate the saved events on load; the callback or a structured decline resumes the same eve session.
170
171
 
171
172
  ## Reconnection
172
173
 
@@ -67,6 +67,7 @@ export default await withEve({
67
67
  web: {
68
68
  framework: "nextjs",
69
69
  root: "apps/web",
70
+ buildCommand: "node ../../node_modules/next/dist/bin/next build",
70
71
  },
71
72
  },
72
73
  routes: [
@@ -120,7 +121,7 @@ Deploy the linked project to production from its root:
120
121
  eve deploy
121
122
  ```
122
123
 
123
- `eve deploy` installs dependencies, runs `vercel deploy --prod`, and pulls the project environment after deployment. You can also push to a Git-connected Vercel project. Hosted Vercel builds set `VERCEL`, so `eve build` writes the deployment bundle under `.vercel/output`.
124
+ `eve deploy` installs dependencies, runs `vercel deploy --prod --logs` to show build logs, and pulls the project environment after deployment. You can also push to a Git-connected Vercel project. Hosted Vercel builds set `VERCEL`, so `eve build` writes the deployment bundle under `.vercel/output`.
124
125
 
125
126
  When `eve deploy` creates a new Vercel project, it configures trace sampling so traces appear in Agent Runs automatically. See [Agent Runs](../../observability/agent-runs) for details. Pass `--no-trace-sampling` to skip this setting.
126
127