eve 0.33.3 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +3 -3
  3. package/dist/src/channel/channel-address.d.ts +3 -6
  4. package/dist/src/channel/channel-address.js +1 -1
  5. package/dist/src/channel/channel-operations.d.ts +2 -3
  6. package/dist/src/channel/delivery-metadata.d.ts +9 -0
  7. package/dist/src/channel/delivery-metadata.js +1 -0
  8. package/dist/src/channel/routes.d.ts +1 -0
  9. package/dist/src/channel/session.d.ts +3 -4
  10. package/dist/src/channel/session.js +1 -1
  11. package/dist/src/channel/types.d.ts +20 -3
  12. package/dist/src/chunks/{use-eve-agent-B-Hky2f4.js → use-eve-agent-COmP-H8R.js} +39 -3
  13. package/dist/src/chunks/{use-eve-agent-3oBnxzhV.js → use-eve-agent-CnppTEFk.js} +39 -3
  14. package/dist/src/cli/commands/info.js +1 -1
  15. package/dist/src/cli/commands/trace-detail.d.ts +3 -2
  16. package/dist/src/cli/commands/trace-detail.js +1 -1
  17. package/dist/src/cli/dev/tui/traces/trace-conversation.d.ts +4 -6
  18. package/dist/src/cli/dev/tui/traces/trace-conversation.js +1 -2
  19. package/dist/src/client/agent-info-schema.d.ts +12 -4
  20. package/dist/src/client/agent-info-schema.js +1 -1
  21. package/dist/src/client/index.d.ts +1 -1
  22. package/dist/src/client/message-reducer.js +1 -1
  23. package/dist/src/compiled/.vendor-stamp.json +4 -4
  24. package/dist/src/compiled/@chat-adapter/slack/index.js +1 -1
  25. package/dist/src/compiled/@opentelemetry/api/index.d.ts +32 -3
  26. package/dist/src/compiled/@vercel/otel/index.d.ts +45 -2
  27. package/dist/src/compiled/@workflow/core/index.js +1 -1
  28. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  29. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  30. package/dist/src/compiled/@workflow/world/env-config.d.ts +1 -0
  31. package/dist/src/compiled/@workflow/world/events.d.ts +92 -35
  32. package/dist/src/compiled/@workflow/world/index.d.ts +3 -2
  33. package/dist/src/compiled/@workflow/world/interfaces.d.ts +25 -23
  34. package/dist/src/compiled/@workflow/world/queue.d.ts +4 -0
  35. package/dist/src/compiled/@workflow/world/runs.d.ts +4 -0
  36. package/dist/src/compiled/@workflow/world/slot-identity.d.ts +53 -0
  37. package/dist/src/compiled/@workflow/world/spec-version.d.ts +36 -1
  38. package/dist/src/compiled/@workflow/world/steps.d.ts +4 -0
  39. package/dist/src/compiled/@workflow/world/ulid.d.ts +6 -0
  40. package/dist/src/compiled/@workflow/world-local/index.js +4 -4
  41. package/dist/src/compiled/@workflow/world-vercel/index.js +13 -17
  42. package/dist/src/compiled/_chunks/workflow/{attribute-changes-6OqdYdi4.js → attribute-changes-BoH7JsWp.js} +3 -3
  43. package/dist/src/compiled/_chunks/workflow/dist-DlFv0aHY.js +40 -0
  44. package/dist/src/compiled/_chunks/workflow/env-config-DxamfI7T.js +1 -0
  45. package/dist/src/compiled/_chunks/workflow/frames-CTpeJYEQ.js +3 -0
  46. package/dist/src/compiled/_chunks/workflow/{functions-CXb61C6h.js → functions-CeeNvKsq.js} +1 -1
  47. package/dist/src/compiled/_chunks/workflow/resume-hook-BPQHjeY5.js +1 -0
  48. package/dist/src/compiled/_chunks/workflow/run-DQ5dOyjm.js +1 -0
  49. package/dist/src/compiled/_chunks/workflow/run-id-BdE0MZz9.js +1 -0
  50. package/dist/src/compiled/_chunks/workflow/sleep-CzdoBiqy.js +1 -0
  51. package/dist/src/compiled/_chunks/workflow/spec-version-DBUVfF_R.js +1 -0
  52. package/dist/src/compiled/_chunks/workflow/undici-CUIybhQ2.js +95 -0
  53. package/dist/src/compiled/_chunks/workflow/wait-until-DK2lnH6U.js +15 -0
  54. package/dist/src/compiled/_chunks/workflow/{wrapper-CDq65xJV.js → wrapper-CMGju7QA.js} +1 -1
  55. package/dist/src/compiled/_chunks/workflow/ws-transport-Csi6Cydc.js +1 -0
  56. package/dist/src/compiler/extension-compatibility.d.ts +14 -14
  57. package/dist/src/compiler/extension-compatibility.js +1 -1
  58. package/dist/src/compiler/manifest.d.ts +8 -8
  59. package/dist/src/compiler/manifest.js +1 -1
  60. package/dist/src/compiler/normalize-agent-config.js +1 -1
  61. package/dist/src/compiler/normalize-extension.d.ts +3 -3
  62. package/dist/src/compiler/normalize-extension.js +1 -1
  63. package/dist/src/compiler/normalize-instructions.d.ts +1 -1
  64. package/dist/src/compiler/normalize-instructions.js +1 -1
  65. package/dist/src/compiler/normalize-manifest.js +1 -3
  66. package/dist/src/context/build-dynamic-tools.d.ts +7 -0
  67. package/dist/src/context/build-dynamic-tools.js +1 -1
  68. package/dist/src/context/dynamic-instruction-lifecycle.d.ts +5 -1
  69. package/dist/src/context/dynamic-instruction-lifecycle.js +1 -1
  70. package/dist/src/context/dynamic-tool-lifecycle.d.ts +7 -0
  71. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  72. package/dist/src/context/keys.d.ts +18 -2
  73. package/dist/src/context/keys.js +1 -1
  74. package/dist/src/discover/filesystem.d.ts +1 -1
  75. package/dist/src/discover/filesystem.js +1 -1
  76. package/dist/src/discover/manifest.d.ts +1 -1
  77. package/dist/src/discover/manifest.js +1 -1
  78. package/dist/src/evals/cli/eval.js +2 -2
  79. package/dist/src/evals/index.d.ts +2 -2
  80. package/dist/src/evals/reporters/index.d.ts +1 -1
  81. package/dist/src/evals/runner/artifacts.js +1 -1
  82. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  83. package/dist/src/evals/runner/execute-eval.d.ts +5 -0
  84. package/dist/src/evals/runner/execute-eval.js +1 -1
  85. package/dist/src/evals/runner/execute-task.d.ts +3 -0
  86. package/dist/src/evals/runner/execute-task.js +1 -1
  87. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  88. package/dist/src/evals/runner/reporters/types.d.ts +28 -2
  89. package/dist/src/evals/runner/run-evals.js +1 -1
  90. package/dist/src/evals/session.d.ts +11 -2
  91. package/dist/src/evals/session.js +1 -1
  92. package/dist/src/evals/target.js +1 -1
  93. package/dist/src/evals/types.d.ts +10 -1
  94. package/dist/src/execution/dispatch-runtime-actions-step.d.ts +1 -5
  95. package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
  96. package/dist/src/execution/dispatch-turn-step.d.ts +5 -0
  97. package/dist/src/execution/dispatch-turn-step.js +1 -0
  98. package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +1 -0
  99. package/dist/src/execution/node-step.js +1 -1
  100. package/dist/src/execution/parked-delivery-wait.d.ts +1 -1
  101. package/dist/src/execution/parked-delivery-wait.js +1 -1
  102. package/dist/src/execution/remote-agent-dispatch.d.ts +2 -1
  103. package/dist/src/execution/remote-agent-dispatch.js +1 -1
  104. package/dist/src/execution/route-child-delivery.d.ts +3 -4
  105. package/dist/src/execution/route-child-delivery.js +1 -1
  106. package/dist/src/execution/route-proxied-deliver-step.d.ts +34 -0
  107. package/dist/src/execution/route-proxied-deliver-step.js +1 -0
  108. package/dist/src/execution/runtime-context.js +1 -1
  109. package/dist/src/execution/session-command-inbox.d.ts +2 -2
  110. package/dist/src/execution/session-command-wire.js +1 -1
  111. package/dist/src/execution/session.js +1 -1
  112. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  113. package/dist/src/execution/subagent-adapter.js +1 -1
  114. package/dist/src/execution/subagent-event-proxy-step.js +1 -1
  115. package/dist/src/execution/tool-auth.d.ts +9 -0
  116. package/dist/src/execution/tool-auth.js +1 -1
  117. package/dist/src/execution/turn-control-receiver.js +1 -1
  118. package/dist/src/execution/turn-dispatch.js +1 -1
  119. package/dist/src/execution/turn-workflow.js +1 -1
  120. package/dist/src/execution/workflow-entry.js +1 -1
  121. package/dist/src/execution/workflow-runtime.js +1 -1
  122. package/dist/src/execution/workflow-steps.d.ts +1 -27
  123. package/dist/src/execution/workflow-steps.js +1 -1
  124. package/dist/src/execution/workflow-trace-context.d.ts +11 -0
  125. package/dist/src/execution/workflow-trace-context.js +1 -0
  126. package/dist/src/harness/ai-sdk-hook-bridge.d.ts +1 -1
  127. package/dist/src/harness/ai-sdk-hook-bridge.js +1 -1
  128. package/dist/src/harness/ai-sdk-telemetry.d.ts +19 -0
  129. package/dist/src/harness/ai-sdk-telemetry.js +1 -0
  130. package/dist/src/harness/approval-candidates.d.ts +109 -0
  131. package/dist/src/harness/approval-candidates.js +1 -0
  132. package/dist/src/harness/approval-delivery-coordinator.d.ts +39 -0
  133. package/dist/src/harness/approval-delivery-coordinator.js +1 -0
  134. package/dist/src/harness/authorization.d.ts +1 -0
  135. package/dist/src/harness/authorization.js +1 -1
  136. package/dist/src/harness/channel-delivery-instrumentation.d.ts +25 -0
  137. package/dist/src/harness/channel-delivery-instrumentation.js +1 -0
  138. package/dist/src/harness/emission.d.ts +2 -2
  139. package/dist/src/harness/emission.js +1 -1
  140. package/dist/src/harness/execute-tool.d.ts +1 -0
  141. package/dist/src/harness/hitl/approval-input-requests.js +1 -1
  142. package/dist/src/harness/hitl/pending-input-resolution.d.ts +3 -0
  143. package/dist/src/harness/hitl/pending-input-resolution.js +1 -1
  144. package/dist/src/harness/hitl/question-input-requests.js +1 -1
  145. package/dist/src/harness/hitl/session-limit-input-requests.js +1 -1
  146. package/dist/src/harness/input-extraction.js +1 -1
  147. package/dist/src/harness/input-request-resolution.d.ts +22 -0
  148. package/dist/src/harness/input-request-resolution.js +1 -0
  149. package/dist/src/harness/input-requests.d.ts +1 -0
  150. package/dist/src/harness/input-requests.js +1 -1
  151. package/dist/src/harness/{instrumentation-config.d.ts → instrumentation/config.d.ts} +9 -4
  152. package/dist/src/harness/instrumentation/config.js +1 -0
  153. package/dist/src/harness/instrumentation/content.d.ts +5 -0
  154. package/dist/src/harness/instrumentation/content.js +1 -0
  155. package/dist/src/harness/instrumentation/dispatch.d.ts +2 -0
  156. package/dist/src/harness/instrumentation/dispatch.js +1 -0
  157. package/dist/src/harness/instrumentation/lifecycle.d.ts +491 -0
  158. package/dist/src/harness/instrumentation/lifecycle.js +1 -0
  159. package/dist/src/harness/{instrumentation-native-events.d.ts → instrumentation/native-events.d.ts} +10 -1
  160. package/dist/src/harness/instrumentation/native-events.js +1 -0
  161. package/dist/src/harness/instrumentation/providers.d.ts +50 -0
  162. package/dist/src/harness/instrumentation/providers.js +1 -0
  163. package/dist/src/harness/{instrumentation-runtime.d.ts → instrumentation/runtime.d.ts} +7 -2
  164. package/dist/src/harness/{instrumentation-runtime.js → instrumentation/runtime.js} +1 -1
  165. package/dist/src/harness/instrumentation/setup-context.d.ts +12 -0
  166. package/dist/src/harness/instrumentation/setup-context.js +1 -0
  167. package/dist/src/harness/instrumentation/state.d.ts +59 -0
  168. package/dist/src/harness/instrumentation/state.js +1 -0
  169. package/dist/src/harness/messages.d.ts +2 -1
  170. package/dist/src/harness/messages.js +1 -1
  171. package/dist/src/harness/parent-lineage.d.ts +1 -1
  172. package/dist/src/harness/pending-input-batches.d.ts +2 -0
  173. package/dist/src/harness/pending-input-batches.js +1 -1
  174. package/dist/src/harness/prepare-trace-context.d.ts +16 -0
  175. package/dist/src/harness/prepare-trace-context.js +1 -0
  176. package/dist/src/harness/runtime-action-settlement-state.d.ts +3 -0
  177. package/dist/src/harness/runtime-action-settlement-state.js +1 -0
  178. package/dist/src/harness/runtime-actions.js +1 -1
  179. package/dist/src/harness/stale-input-responses.js +1 -1
  180. package/dist/src/harness/tool-call-action.d.ts +9 -0
  181. package/dist/src/harness/tool-call-action.js +1 -0
  182. package/dist/src/harness/tool-loop.js +2 -2
  183. package/dist/src/harness/tools.js +1 -1
  184. package/dist/src/harness/types.d.ts +16 -2
  185. package/dist/src/internal/application/compiled-artifacts.d.ts +13 -4
  186. package/dist/src/internal/application/compiled-artifacts.js +5 -4
  187. package/dist/src/internal/application/dev-environment.d.ts +12 -0
  188. package/dist/src/internal/application/dev-environment.js +1 -1
  189. package/dist/src/internal/application/package.js +1 -1
  190. package/dist/src/internal/authored-definition/approval.d.ts +3 -0
  191. package/dist/src/internal/authored-definition/approval.js +1 -0
  192. package/dist/src/internal/authored-definition/connection.js +1 -1
  193. package/dist/src/internal/authored-definition/core.d.ts +3 -3
  194. package/dist/src/internal/authored-definition/core.js +1 -1
  195. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  196. package/dist/src/internal/authored-package-boundary.js +1 -1
  197. package/dist/src/internal/helpers/markdown.js +1 -1
  198. package/dist/src/internal/instrumentation-layout.d.ts +28 -0
  199. package/dist/src/internal/instrumentation-layout.js +1 -0
  200. package/dist/src/internal/instrumentation.d.ts +1 -1
  201. package/dist/src/internal/materialized-authored-modules.d.ts +13 -2
  202. package/dist/src/internal/materialized-authored-modules.js +1 -1
  203. package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
  204. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  205. package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
  206. package/dist/src/internal/nitro/host/local-tracing-runtime-plugin.d.ts +5 -1
  207. package/dist/src/internal/nitro/host/local-tracing-runtime-plugin.js +1 -1
  208. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
  209. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +4 -3
  210. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
  211. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
  212. package/dist/src/internal/nitro/routes/channel-request-instrumentation.d.ts +2 -3
  213. package/dist/src/internal/nitro/routes/channel-request-instrumentation.js +1 -1
  214. package/dist/src/internal/vercel/project-link.d.ts +1 -1
  215. package/dist/src/internal/vercel/project-link.js +1 -1
  216. package/dist/src/internal/vercel-agent-summary.d.ts +10 -9
  217. package/dist/src/internal/vercel-agent-summary.js +1 -1
  218. package/dist/src/internal/workflow/development-world-client.js +1 -1
  219. package/dist/src/packages/eve-catalog/src/index.js +1 -1
  220. package/dist/src/protocol/message.d.ts +51 -2
  221. package/dist/src/protocol/message.js +2 -2
  222. package/dist/src/protocol/traceparent.d.ts +10 -0
  223. package/dist/src/protocol/traceparent.js +1 -0
  224. package/dist/src/public/channels/eve.js +1 -1
  225. package/dist/src/public/channels/github/auth.d.ts +30 -0
  226. package/dist/src/public/channels/github/auth.js +2 -2
  227. package/dist/src/public/channels/github/defaults.d.ts +4 -3
  228. package/dist/src/public/channels/github/defaults.js +5 -2
  229. package/dist/src/public/channels/github/dispatch.d.ts +3 -2
  230. package/dist/src/public/channels/github/dispatch.js +1 -1
  231. package/dist/src/public/channels/github/githubChannel.d.ts +10 -5
  232. package/dist/src/public/channels/github/githubChannel.js +1 -1
  233. package/dist/src/public/channels/github/index.d.ts +1 -1
  234. package/dist/src/public/channels/slack/defaults.js +3 -3
  235. package/dist/src/public/channels/slack/interactions.js +1 -1
  236. package/dist/src/public/channels/slack/slackChannel.d.ts +11 -3
  237. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  238. package/dist/src/public/definitions/approval.d.ts +57 -16
  239. package/dist/src/public/definitions/approval.js +1 -1
  240. package/dist/src/public/definitions/channel.d.ts +2 -2
  241. package/dist/src/public/definitions/channel.js +1 -1
  242. package/dist/src/public/definitions/hook.d.ts +4 -2
  243. package/dist/src/public/definitions/instructions.d.ts +14 -4
  244. package/dist/src/public/definitions/instructions.js +1 -1
  245. package/dist/src/public/definitions/tool.d.ts +5 -8
  246. package/dist/src/public/instructions/index.d.ts +1 -2
  247. package/dist/src/public/instructions/index.js +1 -1
  248. package/dist/src/public/instrumentation/index.d.ts +36 -20
  249. package/dist/src/public/instrumentation/index.js +1 -1
  250. package/dist/src/public/instrumentation/otel.d.ts +32 -0
  251. package/dist/src/public/instrumentation/otel.js +1 -0
  252. package/dist/src/public/instrumentation/provider.d.ts +117 -0
  253. package/dist/src/public/instrumentation/provider.js +1 -0
  254. package/dist/src/public/tools/approval/approval-helpers.d.ts +4 -4
  255. package/dist/src/public/tools/index.d.ts +1 -1
  256. package/dist/src/runtime/actions/results.d.ts +3 -3
  257. package/dist/src/runtime/agent/bootstrap.d.ts +2 -0
  258. package/dist/src/runtime/agent/bootstrap.js +1 -1
  259. package/dist/src/runtime/attributes/emit.js +1 -1
  260. package/dist/src/runtime/connections/principal.d.ts +3 -0
  261. package/dist/src/runtime/connections/principal.js +1 -1
  262. package/dist/src/runtime/connections/scoped-authorization.d.ts +3 -5
  263. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  264. package/dist/src/runtime/connections/types.d.ts +5 -0
  265. package/dist/src/runtime/prompt/compose.d.ts +1 -1
  266. package/dist/src/runtime/prompt/compose.js +3 -1
  267. package/dist/src/runtime/resolve-agent.js +1 -1
  268. package/dist/src/runtime/resolve-tool.js +1 -1
  269. package/dist/src/runtime/types.d.ts +4 -3
  270. package/dist/src/setup/index.d.ts +1 -0
  271. package/dist/src/setup/index.js +1 -1
  272. package/dist/src/setup/project-resolution.d.ts +3 -3
  273. package/dist/src/setup/scaffold/create/project.js +1 -1
  274. package/dist/src/setup/scaffold/version-tokens.js +1 -1
  275. package/dist/src/setup/slack-connect-lifecycle.d.ts +0 -9
  276. package/dist/src/setup/slack-connect-lifecycle.js +1 -1
  277. package/dist/src/setup/slackbot.d.ts +2 -1
  278. package/dist/src/setup/slackbot.js +1 -1
  279. package/dist/src/setup/verified-remote-agent.d.ts +30 -0
  280. package/dist/src/setup/verified-remote-agent.js +1 -0
  281. package/dist/src/shared/agent-definition.d.ts +9 -0
  282. package/dist/src/shared/channel-definition.d.ts +3 -1
  283. package/dist/src/shared/dynamic-tool-definition.d.ts +3 -4
  284. package/dist/src/shared/instructions-definition.d.ts +15 -11
  285. package/dist/src/svelte/index.js +1 -1
  286. package/dist/src/svelte/use-eve-agent.js +1 -1
  287. package/dist/src/tracing/agent-action-instrumentation.d.ts +31 -0
  288. package/dist/src/tracing/agent-action-instrumentation.js +1 -0
  289. package/dist/src/tracing/agent-approval-instrumentation.d.ts +13 -0
  290. package/dist/src/tracing/agent-approval-instrumentation.js +1 -0
  291. package/dist/src/tracing/agent-channel-delivery-instrumentation.d.ts +13 -0
  292. package/dist/src/tracing/agent-channel-delivery-instrumentation.js +1 -0
  293. package/dist/src/tracing/agent-otel-content.d.ts +6 -0
  294. package/dist/src/tracing/agent-otel-content.js +2 -2
  295. package/dist/src/tracing/agent-otel-provider.d.ts +10 -8
  296. package/dist/src/tracing/agent-otel-provider.js +2 -2
  297. package/dist/src/tracing/agent-otel-session-context.d.ts +17 -0
  298. package/dist/src/tracing/agent-otel-session-context.js +1 -0
  299. package/dist/src/tracing/agent-otel-usage.d.ts +4 -0
  300. package/dist/src/tracing/agent-otel-usage.js +1 -0
  301. package/dist/src/tracing/agent-span-id-generator.d.ts +2 -0
  302. package/dist/src/tracing/agent-span-id-generator.js +1 -1
  303. package/dist/src/tracing/agent-tool-instrumentation.d.ts +28 -0
  304. package/dist/src/tracing/agent-tool-instrumentation.js +1 -0
  305. package/dist/src/tracing/agent-trace-context-store.d.ts +8 -1
  306. package/dist/src/tracing/agent-trace-context-store.js +1 -1
  307. package/dist/src/tracing/agent-trace-span-processor.d.ts +0 -1
  308. package/dist/src/tracing/agent-trace-span-processor.js +1 -1
  309. package/dist/src/tracing/agent-trace-state.d.ts +33 -3
  310. package/dist/src/tracing/agent-trace-state.js +1 -1
  311. package/dist/src/tracing/batch-span-processor.d.ts +20 -0
  312. package/dist/src/tracing/batch-span-processor.js +1 -0
  313. package/dist/src/tracing/content-attributes.d.ts +28 -0
  314. package/dist/src/tracing/content-attributes.js +1 -0
  315. package/dist/src/tracing/content-span-processor.d.ts +19 -0
  316. package/dist/src/tracing/content-span-processor.js +1 -0
  317. package/dist/src/tracing/install-instrumentation-runtime.d.ts +19 -0
  318. package/dist/src/tracing/install-instrumentation-runtime.js +1 -0
  319. package/dist/src/tracing/local-instrumentation-runtime.d.ts +1 -1
  320. package/dist/src/tracing/local-instrumentation-runtime.js +1 -1
  321. package/dist/src/tracing/local-traces.d.ts +56 -0
  322. package/dist/src/tracing/local-traces.js +1 -0
  323. package/dist/src/tracing/otel-declaration.d.ts +150 -0
  324. package/dist/src/tracing/otel-declaration.js +1 -0
  325. package/dist/src/tracing/otel-registration.d.ts +21 -0
  326. package/dist/src/tracing/otel-registration.js +1 -0
  327. package/dist/src/tracing/vercel-runtime-span-exporter.d.ts +5 -0
  328. package/dist/src/tracing/vercel-runtime-span-exporter.js +1 -0
  329. package/dist/src/vue/index.js +1 -1
  330. package/dist/src/vue/use-eve-agent.js +1 -1
  331. package/docs/README.md +18 -20
  332. package/docs/agent-config.md +5 -5
  333. package/docs/channels/eve.mdx +10 -56
  334. package/docs/channels/github.mdx +1 -1
  335. package/docs/channels/meta.json +1 -0
  336. package/docs/concepts/context-control.md +32 -56
  337. package/docs/concepts/default-harness.md +2 -2
  338. package/docs/concepts/execution-model-and-durability.mdx +4 -4
  339. package/docs/concepts/meta.json +3 -1
  340. package/docs/concepts/sessions-runs-and-streaming.md +22 -10
  341. package/docs/{guides → concepts}/state.md +3 -3
  342. package/docs/connections/mcp.mdx +6 -89
  343. package/docs/connections/meta.json +1 -0
  344. package/docs/connections/openapi.mdx +5 -69
  345. package/docs/connections/overview.mdx +29 -3
  346. package/docs/evals/meta.json +1 -0
  347. package/docs/evals/reporters.mdx +14 -4
  348. package/docs/extensions.md +1 -1
  349. package/docs/getting-started.mdx +175 -13
  350. package/docs/guides/auth-and-route-protection.md +3 -18
  351. package/docs/guides/client/meta.json +2 -1
  352. package/docs/guides/client/output-schema.mdx +2 -2
  353. package/docs/guides/client/overview.mdx +1 -1
  354. package/docs/guides/deployment/meta.json +1 -0
  355. package/docs/guides/deployment/overview.md +1 -1
  356. package/docs/guides/deployment/self-hosting.md +3 -3
  357. package/docs/guides/deployment/vercel.mdx +1 -1
  358. package/docs/guides/dev-tui.md +3 -13
  359. package/docs/guides/dynamic-capabilities.md +26 -4
  360. package/docs/guides/frontend/meta.json +2 -1
  361. package/docs/guides/frontend/nextjs.mdx +1 -10
  362. package/docs/guides/frontend/nuxt.mdx +1 -10
  363. package/docs/guides/frontend/overview.mdx +12 -3
  364. package/docs/guides/frontend/sveltekit.mdx +1 -10
  365. package/docs/guides/frontend/use-eve-agent-svelte.mdx +39 -126
  366. package/docs/guides/frontend/use-eve-agent-vue.mdx +40 -139
  367. package/docs/guides/instrumentation.md +37 -15
  368. package/docs/guides/meta.json +1 -5
  369. package/docs/guides/remote-agents.md +9 -9
  370. package/docs/guides/session-context.md +34 -103
  371. package/docs/install-integrations.mdx +1 -1
  372. package/docs/instructions.mdx +45 -12
  373. package/docs/meta.json +24 -13
  374. package/docs/patterns/dynamic-scheduling.md +1 -1
  375. package/docs/patterns/meta.json +1 -0
  376. package/docs/patterns/multi-tenant-approvals.md +1 -1
  377. package/docs/patterns/multi-tenant-auth.md +1 -1
  378. package/docs/patterns/multi-tenant-memory.md +4 -3
  379. package/docs/{guides → protocols}/acp.md +1 -1
  380. package/docs/protocols/meta.json +5 -0
  381. package/docs/reference/cli.md +34 -34
  382. package/docs/reference/meta.json +1 -1
  383. package/docs/reference/typescript-api.md +4 -2
  384. package/docs/{subagents.mdx → subagents/index.mdx} +2 -2
  385. package/docs/subagents/meta.json +5 -0
  386. package/docs/{guides/dynamic-workflows.md → subagents/workflow-tool.md} +6 -6
  387. package/docs/tools/human-in-the-loop.md +1 -1
  388. package/docs/tools/meta.json +1 -0
  389. package/docs/tools/overview.mdx +1 -1
  390. package/docs/tutorial/connect-a-warehouse.mdx +1 -1
  391. package/docs/tutorial/meta.json +1 -0
  392. package/docs/tutorial/remember-definitions.mdx +2 -2
  393. package/docs/tutorial/ship-it.mdx +2 -2
  394. package/package.json +10 -4
  395. package/dist/src/compiled/_chunks/workflow/dist-C8PhDW9B.js +0 -1
  396. package/dist/src/compiled/_chunks/workflow/functions-xMPAeWFr.js +0 -1
  397. package/dist/src/compiled/_chunks/workflow/node-Smb57EnG.js +0 -40
  398. package/dist/src/compiled/_chunks/workflow/resume-hook-BrduAuFX.js +0 -1
  399. package/dist/src/compiled/_chunks/workflow/run-CX7_sJnW.js +0 -1
  400. package/dist/src/compiled/_chunks/workflow/sleep-tsb2HjWK.js +0 -1
  401. package/dist/src/compiled/_chunks/workflow/undici-BNc_0O4m.js +0 -95
  402. package/dist/src/compiled/_chunks/workflow/wait-until-BYKVqrwc.js +0 -15
  403. package/dist/src/harness/instrumentation-config.js +0 -1
  404. package/dist/src/harness/instrumentation-lifecycle.d.ts +0 -171
  405. package/dist/src/harness/instrumentation-lifecycle.js +0 -1
  406. package/dist/src/harness/instrumentation-native-events.js +0 -1
  407. package/dist/src/harness/otel-integration.d.ts +0 -12
  408. package/dist/src/harness/otel-integration.js +0 -1
  409. package/docs/installation.mdx +0 -66
  410. package/docs/project-structure.mdx +0 -53
  411. package/docs/reference/project-layout.md +0 -123
  412. /package/dist/src/harness/{instrumentation-runtime-context.d.ts → instrumentation/runtime-context.d.ts} +0 -0
  413. /package/dist/src/harness/{instrumentation-runtime-context.js → instrumentation/runtime-context.js} +0 -0
  414. /package/docs/{guides → protocols}/ucp.mdx +0 -0
@@ -0,0 +1,491 @@
1
+ import type { InstrumentationStateSlot } from "#harness/instrumentation/state.js";
2
+ import type { RuntimeTraceContext } from "#protocol/message.js";
3
+ /**
4
+ * Stable eve identity for one actual model attempt.
5
+ *
6
+ * A step retried three times produces three of these, all sharing `stepIndex`
7
+ * and separated by `attemptIndex` — which is why the events carrying this
8
+ * scope are named `step.attempt.*` and not `step.*`. The protocol's `step.*`
9
+ * and the `events["step.started"]` resolver hook fire once per step; these
10
+ * fire once per attempt.
11
+ */
12
+ export interface InstrumentationAttemptScope {
13
+ readonly attemptId: string;
14
+ readonly attemptIndex: number;
15
+ readonly functionId?: string;
16
+ readonly rootSessionId?: string;
17
+ readonly sessionId: string;
18
+ readonly stepIndex: number;
19
+ readonly turnId: string;
20
+ }
21
+ /** The model SDK operation an attempt runs through. */
22
+ export interface InstrumentationOperationRef {
23
+ readonly modelId: string;
24
+ readonly operationId: string;
25
+ readonly provider: string;
26
+ }
27
+ export interface InstrumentationModelRef {
28
+ readonly modelId: string;
29
+ readonly provider: string;
30
+ }
31
+ /** Token usage for one model call. A field is absent when the provider omits it. */
32
+ export interface InstrumentationUsage {
33
+ readonly inputTokenDetails?: {
34
+ readonly cacheReadTokens?: number;
35
+ readonly cacheWriteTokens?: number;
36
+ };
37
+ readonly inputTokens?: number;
38
+ readonly outputTokens?: number;
39
+ }
40
+ /** Final model input for one call. Message shape stays opaque to this layer. */
41
+ export interface InstrumentationModelInput {
42
+ readonly instructions?: unknown;
43
+ readonly messages: readonly unknown[];
44
+ }
45
+ /**
46
+ * The model response parts eve records. A kind outside this union is dropped
47
+ * when the bridge maps a response, so widening the union is what makes a new
48
+ * kind reachable by a provider.
49
+ */
50
+ export type InstrumentationContentPart = {
51
+ readonly type: "text";
52
+ readonly text: string;
53
+ } | {
54
+ readonly type: "reasoning";
55
+ readonly text: string;
56
+ } | {
57
+ readonly type: "tool-call";
58
+ readonly callId: string;
59
+ readonly input: unknown;
60
+ readonly toolName: string;
61
+ } | {
62
+ readonly type: "tool-result";
63
+ readonly callId: string;
64
+ readonly input: unknown;
65
+ readonly output: unknown;
66
+ readonly toolName: string;
67
+ } | {
68
+ readonly type: "tool-error";
69
+ readonly callId: string;
70
+ readonly error: unknown;
71
+ readonly input: unknown;
72
+ readonly toolName: string;
73
+ };
74
+ /**
75
+ * What eve dispatched an action as. The model sees every action as a tool, so
76
+ * this is the only thing that separates a subagent or remote-agent call from an
77
+ * ordinary tool in a trace.
78
+ */
79
+ export type InstrumentationActionKind = "load-skill" | "remote-agent-call" | "subagent-call" | "tool-call";
80
+ /**
81
+ * How one action ended.
82
+ *
83
+ * `type` survives a provider that declined content, so whether the tool errored
84
+ * is answerable without seeing what it returned.
85
+ */
86
+ export type InstrumentationActionOutput = {
87
+ readonly type: "result";
88
+ readonly output?: unknown;
89
+ } | {
90
+ readonly type: "error";
91
+ readonly error?: unknown;
92
+ };
93
+ /**
94
+ * How much of an event a provider is handed.
95
+ *
96
+ * `"metadata"` — the default — is structure, identity, usage, and timing: every
97
+ * field except what the conversation actually said. `"content"` adds the
98
+ * prompt, the response, tool arguments, and tool results.
99
+ *
100
+ * Declared per provider rather than per process, because two consumers of one
101
+ * bus rarely have the same retention path. Content is built at all only when
102
+ * some provider asked for it, and a provider that did not ask never receives
103
+ * it — which is the same guarantee a destination that declines content gets,
104
+ * one layer lower and without an OpenTelemetry pipeline to route it through.
105
+ */
106
+ export type InstrumentationCapture = "content" | "metadata";
107
+ /**
108
+ * Every event carries an `idempotencyKey` naming the operation it is about: a
109
+ * start and its terminal share one, and two operations never collide.
110
+ *
111
+ * Every part is identity eve reconstructs on replay — session and turn ids,
112
+ * `scope.attemptId` (itself `session:turn:step:attempt`), AI SDK step number,
113
+ * and durable runtime-action call ids. A provider writing rows can use the key
114
+ * as its row id and be idempotent by construction.
115
+ */
116
+ export declare function sessionIdempotencyKey(sessionId: string): string;
117
+ export declare function turnIdempotencyKey(sessionId: string, turnId: string): string;
118
+ export declare function attemptIdempotencyKey(scope: InstrumentationAttemptScope): string;
119
+ /** One model call occurs per AI SDK step within an eve attempt. */
120
+ export declare function modelCallIdempotencyKey(scope: InstrumentationAttemptScope, stepNumber: number): string;
121
+ export declare function toolCallIdempotencyKey(scope: InstrumentationAttemptScope, callId: string, stepNumber: number): string;
122
+ export declare function inputIdempotencyKey(sessionId: string, turnId: string, requestId: string): string;
123
+ export declare function channelDeliveryIdempotencyKey(sessionId: string, deliveryId: string): string;
124
+ export interface InstrumentationChannelDeliveryRef {
125
+ readonly channelKind: string;
126
+ readonly channelName: string;
127
+ readonly deliveryId: string;
128
+ readonly requestId?: string;
129
+ readonly requestTraceContext?: InstrumentationTraceContext;
130
+ }
131
+ /** Known framework delivery input; adapter-specific fields are never projected. */
132
+ export interface InstrumentationChannelDeliveryInput {
133
+ readonly context?: readonly string[];
134
+ readonly inputResponses?: readonly InstrumentationInputResponse[];
135
+ readonly message?: unknown;
136
+ readonly outputSchema?: unknown;
137
+ }
138
+ interface InstrumentationChannelDeliveryScope {
139
+ readonly agentName?: string;
140
+ readonly delivery: InstrumentationChannelDeliveryRef;
141
+ readonly idempotencyKey: string;
142
+ readonly rootSessionId: string;
143
+ readonly sequence?: number;
144
+ readonly sessionId: string;
145
+ readonly turnId?: string;
146
+ }
147
+ export interface InstrumentationChannelDeliveryStartedEvent extends InstrumentationChannelDeliveryScope {
148
+ readonly parentTraceContext?: InstrumentationTraceContext;
149
+ readonly type: "channel.delivery.started";
150
+ /** Content. Absent unless this provider declared `capture: "content"`. */
151
+ readonly input?: InstrumentationChannelDeliveryInput;
152
+ }
153
+ export type InstrumentationChannelDeliveryOutcome = "cancelled" | "completed" | "failed";
154
+ export interface InstrumentationChannelDeliveryTerminalEvent extends InstrumentationChannelDeliveryScope {
155
+ readonly type: "channel.delivery.cancelled" | "channel.delivery.completed" | "channel.delivery.failed";
156
+ /** Content. Absent unless this provider declared `capture: "content"`. */
157
+ readonly error?: unknown;
158
+ readonly errorCode?: string;
159
+ readonly outcome: InstrumentationChannelDeliveryOutcome;
160
+ }
161
+ /** Framework-owned reason an agent suspended for user input. */
162
+ export type InstrumentationInputKind = "question" | "session-limit" | "tool-approval";
163
+ export interface InstrumentationInputOption {
164
+ readonly description?: string;
165
+ readonly id: string;
166
+ readonly label: string;
167
+ readonly style?: "danger" | "default" | "primary";
168
+ }
169
+ /** User-facing input request content projected without runtime-owned types. */
170
+ export interface InstrumentationInputRequest {
171
+ readonly allowFreeform?: boolean;
172
+ readonly display?: "confirmation" | "select" | "text";
173
+ readonly options?: readonly InstrumentationInputOption[];
174
+ readonly prompt: string;
175
+ }
176
+ /** User response content projected without runtime-owned types. */
177
+ export interface InstrumentationInputResponse {
178
+ readonly optionId?: string;
179
+ readonly text?: string;
180
+ }
181
+ export type InstrumentationInputOutcome = "answered" | "approved" | "cancelled" | "denied" | "failed" | "ignored" | "invalid";
182
+ export interface InstrumentationInputRequestedEvent {
183
+ readonly type: "input.requested";
184
+ readonly action: {
185
+ readonly callId: string;
186
+ readonly name: string;
187
+ };
188
+ readonly idempotencyKey: string;
189
+ readonly kind: InstrumentationInputKind;
190
+ /** Content. Absent unless this provider declared `capture: "content"`. */
191
+ readonly request?: InstrumentationInputRequest;
192
+ readonly requestId: string;
193
+ readonly scope: InstrumentationAttemptScope;
194
+ }
195
+ export interface InstrumentationInputResolvedEvent {
196
+ readonly type: "input.resolved";
197
+ readonly error?: unknown;
198
+ readonly idempotencyKey: string;
199
+ readonly kind: InstrumentationInputKind;
200
+ readonly outcome: InstrumentationInputOutcome;
201
+ readonly requestId: string;
202
+ /** Content. Absent unless this provider declared `capture: "content"`. */
203
+ readonly response?: InstrumentationInputResponse;
204
+ readonly scope: InstrumentationAttemptScope;
205
+ }
206
+ /** Runtime action call IDs are durable and unique within one session. */
207
+ export declare function actionIdempotencyKey(sessionId: string, turnId: string, callId: string): string;
208
+ export interface InstrumentationStepAttemptStartedEvent {
209
+ readonly type: "step.attempt.started";
210
+ readonly idempotencyKey: string;
211
+ readonly operation: InstrumentationOperationRef;
212
+ readonly scope: InstrumentationAttemptScope;
213
+ }
214
+ export interface InstrumentationSessionStartedEvent {
215
+ readonly type: "session.started";
216
+ readonly agentName?: string;
217
+ readonly channelKind?: string;
218
+ readonly idempotencyKey: string;
219
+ readonly parentTraceContext?: InstrumentationTraceContext;
220
+ readonly rootSessionId: string;
221
+ readonly sessionId: string;
222
+ }
223
+ export type InstrumentationTraceContext = RuntimeTraceContext;
224
+ /**
225
+ * Which tool call dispatched a subagent child. The trace structure alone
226
+ * cannot say: one turn's children all parent to the same window.
227
+ */
228
+ export interface InstrumentationParentLineage {
229
+ readonly callId: string;
230
+ readonly sessionId: string;
231
+ readonly subagentName?: string;
232
+ readonly turnId: string;
233
+ }
234
+ /**
235
+ * A session transition that carries no failure.
236
+ *
237
+ * `session.waiting` sits here rather than with the failed shape because it is
238
+ * not terminal: the session suspends awaiting input or approval and may resume
239
+ * with a new turn.
240
+ */
241
+ export interface InstrumentationSessionSettledEvent {
242
+ readonly type: "session.completed" | "session.waiting";
243
+ readonly idempotencyKey: string;
244
+ readonly sessionId: string;
245
+ readonly turnId?: string;
246
+ }
247
+ export interface InstrumentationSessionFailedEvent {
248
+ readonly type: "session.failed";
249
+ /** Content. Absent unless this provider declared `capture: "content"`. */
250
+ readonly error?: unknown;
251
+ readonly idempotencyKey: string;
252
+ readonly sessionId: string;
253
+ readonly turnId?: string;
254
+ }
255
+ export type InstrumentationSessionTransitionEvent = InstrumentationSessionSettledEvent | InstrumentationSessionFailedEvent;
256
+ export interface InstrumentationTurnStartedEvent {
257
+ readonly type: "turn.started";
258
+ readonly idempotencyKey: string;
259
+ readonly parentLineage?: InstrumentationParentLineage;
260
+ readonly parentTraceContext?: InstrumentationTraceContext;
261
+ readonly rootSessionId: string;
262
+ readonly sequence: number;
263
+ readonly sessionId: string;
264
+ readonly turnId: string;
265
+ }
266
+ /**
267
+ * A turn that ended without a failure.
268
+ *
269
+ * `turn.cancelled` sits here rather than with the failed shape because
270
+ * cancellation is not an error: the harness settles a cancelled turn as
271
+ * `turn.cancelled` → `session.waiting`, with no failure surfaced anywhere.
272
+ */
273
+ export interface InstrumentationTurnSettledEvent {
274
+ readonly type: "turn.cancelled" | "turn.completed";
275
+ readonly idempotencyKey: string;
276
+ readonly sessionId: string;
277
+ readonly turnId: string;
278
+ }
279
+ export interface InstrumentationTurnFailedEvent {
280
+ readonly type: "turn.failed";
281
+ /** Content. Absent unless this provider declared `capture: "content"`. */
282
+ readonly error?: unknown;
283
+ readonly idempotencyKey: string;
284
+ readonly sessionId: string;
285
+ readonly turnId: string;
286
+ }
287
+ export type InstrumentationTurnTerminalEvent = InstrumentationTurnSettledEvent | InstrumentationTurnFailedEvent;
288
+ export interface InstrumentationStepAttemptCompletedEvent {
289
+ readonly type: "step.attempt.completed";
290
+ readonly idempotencyKey: string;
291
+ readonly scope: InstrumentationAttemptScope;
292
+ }
293
+ export interface InstrumentationStepAttemptFailedEvent {
294
+ readonly type: "step.attempt.failed";
295
+ /** Content. Absent unless this provider declared `capture: "content"`. */
296
+ readonly error?: unknown;
297
+ readonly idempotencyKey: string;
298
+ readonly scope: InstrumentationAttemptScope;
299
+ }
300
+ export type InstrumentationStepAttemptTerminalEvent = InstrumentationStepAttemptCompletedEvent | InstrumentationStepAttemptFailedEvent;
301
+ /**
302
+ * Provider metadata for one completed attempt, as reported by the AI SDK
303
+ * (`StepResult.providerMetadata`). Carries Vercel AI Gateway cost data when
304
+ * the request went through the gateway; absent for other providers.
305
+ */
306
+ export interface InstrumentationStepAttemptMetadataEvent {
307
+ readonly type: "step.attempt.metadata";
308
+ readonly idempotencyKey: string;
309
+ readonly scope: InstrumentationAttemptScope;
310
+ readonly providerMetadata: Readonly<Record<string, unknown>>;
311
+ }
312
+ export interface InstrumentationModelCallStartedEvent {
313
+ readonly type: "model.call.started";
314
+ readonly idempotencyKey: string;
315
+ /** Content. Absent unless this provider declared `capture: "content"`. */
316
+ readonly input?: InstrumentationModelInput;
317
+ readonly model: InstrumentationModelRef;
318
+ readonly scope: InstrumentationAttemptScope;
319
+ }
320
+ export interface InstrumentationModelCallCompletedEvent {
321
+ readonly type: "model.call.completed";
322
+ /** Content. Absent unless this provider declared `capture: "content"`. */
323
+ readonly content?: readonly InstrumentationContentPart[];
324
+ readonly finishReason: string;
325
+ readonly idempotencyKey: string;
326
+ readonly scope: InstrumentationAttemptScope;
327
+ readonly usage: InstrumentationUsage;
328
+ }
329
+ export interface InstrumentationModelCallFailedEvent {
330
+ readonly type: "model.call.failed";
331
+ /** Content. Absent unless this provider declared `capture: "content"`. */
332
+ readonly error?: unknown;
333
+ readonly idempotencyKey: string;
334
+ readonly scope: InstrumentationAttemptScope;
335
+ }
336
+ export type InstrumentationModelCallTerminalEvent = InstrumentationModelCallCompletedEvent | InstrumentationModelCallFailedEvent;
337
+ export type InstrumentationToolOutput = InstrumentationActionOutput;
338
+ export interface InstrumentationToolCallStartedEvent {
339
+ readonly type: "tool.call.started";
340
+ readonly callId: string;
341
+ readonly idempotencyKey: string;
342
+ readonly input: unknown;
343
+ readonly scope: InstrumentationAttemptScope;
344
+ readonly toolName: string;
345
+ }
346
+ export interface InstrumentationToolCallCompletedEvent {
347
+ readonly type: "tool.call.completed";
348
+ readonly idempotencyKey: string;
349
+ readonly output: InstrumentationToolOutput;
350
+ readonly scope: InstrumentationAttemptScope;
351
+ }
352
+ export interface InstrumentationToolCallFailedEvent {
353
+ readonly type: "tool.call.failed";
354
+ /** Content. Absent unless this provider declared `capture: "content"`. */
355
+ readonly error?: unknown;
356
+ readonly idempotencyKey: string;
357
+ readonly scope: InstrumentationAttemptScope;
358
+ }
359
+ export type InstrumentationToolCallTerminalEvent = InstrumentationToolCallCompletedEvent | InstrumentationToolCallFailedEvent;
360
+ /**
361
+ * One thing the agent did on the model's behalf. `kind` is what separates a
362
+ * subagent or remote-agent call from an ordinary tool; `name` is the name the
363
+ * model called, which is the tool name for every kind.
364
+ */
365
+ export interface InstrumentationActionStartedEvent {
366
+ readonly type: "action.started";
367
+ readonly callId: string;
368
+ readonly idempotencyKey: string;
369
+ /** Content. Absent unless this provider declared `capture: "content"`. */
370
+ readonly input?: unknown;
371
+ readonly kind: InstrumentationActionKind;
372
+ readonly name: string;
373
+ readonly scope: InstrumentationAttemptScope;
374
+ }
375
+ export type InstrumentationActionOutcome = "abandoned" | "cancelled" | "completed" | "failed" | "rejected";
376
+ export interface InstrumentationActionCompletedEvent {
377
+ readonly type: "action.completed";
378
+ readonly acceptedAtMs?: number;
379
+ readonly idempotencyKey: string;
380
+ readonly outcome: "completed";
381
+ readonly output: InstrumentationActionOutput;
382
+ readonly scope: InstrumentationAttemptScope;
383
+ readonly usage?: InstrumentationUsage;
384
+ }
385
+ export interface InstrumentationActionFailedEvent {
386
+ readonly type: "action.failed";
387
+ readonly acceptedAtMs?: number;
388
+ /** Content. Absent unless this provider declared `capture: "content"`. */
389
+ readonly error?: unknown;
390
+ readonly errorCode?: string;
391
+ readonly idempotencyKey: string;
392
+ readonly outcome: Exclude<InstrumentationActionOutcome, "completed">;
393
+ readonly scope: InstrumentationAttemptScope;
394
+ }
395
+ export type InstrumentationActionTerminalEvent = InstrumentationActionCompletedEvent | InstrumentationActionFailedEvent;
396
+ /** The second argument to every handler. */
397
+ export interface InstrumentationHandlerContext {
398
+ /** Durable state scoped to this provider and this operation. */
399
+ readonly state: InstrumentationStateSlot;
400
+ }
401
+ /**
402
+ * The AI SDK can omit a model terminal when an incomplete stream closes. A
403
+ * handler can use `ctx.state` for durable correlation when a terminal arrives,
404
+ * but providers must scope live resources to the attempt and release anything
405
+ * still open when the step attempt terminates.
406
+ */
407
+ export type InstrumentationEventHandler<TEvent> = (event: TEvent, ctx: InstrumentationHandlerContext) => void | PromiseLike<void>;
408
+ /** Internal provider shape mirrored by the future public hook contract. */
409
+ export interface InstrumentationProviderDefinition {
410
+ readonly name: string;
411
+ /** Durable state identity, separate from the human-readable log name. */
412
+ readonly stateNamespace?: string;
413
+ /** Defaults to `"metadata"`. See {@link InstrumentationCapture}. */
414
+ readonly capture?: InstrumentationCapture;
415
+ readonly events?: {
416
+ readonly "channel.delivery.started"?: InstrumentationEventHandler<InstrumentationChannelDeliveryStartedEvent>;
417
+ readonly "channel.delivery.cancelled"?: InstrumentationEventHandler<InstrumentationChannelDeliveryTerminalEvent>;
418
+ readonly "channel.delivery.completed"?: InstrumentationEventHandler<InstrumentationChannelDeliveryTerminalEvent>;
419
+ readonly "channel.delivery.failed"?: InstrumentationEventHandler<InstrumentationChannelDeliveryTerminalEvent>;
420
+ readonly "step.attempt.started"?: InstrumentationEventHandler<InstrumentationStepAttemptStartedEvent>;
421
+ readonly "step.attempt.completed"?: InstrumentationEventHandler<InstrumentationStepAttemptCompletedEvent>;
422
+ readonly "step.attempt.failed"?: InstrumentationEventHandler<InstrumentationStepAttemptFailedEvent>;
423
+ readonly "step.attempt.metadata"?: InstrumentationEventHandler<InstrumentationStepAttemptMetadataEvent>;
424
+ readonly "model.call.started"?: InstrumentationEventHandler<InstrumentationModelCallStartedEvent>;
425
+ readonly "model.call.completed"?: InstrumentationEventHandler<InstrumentationModelCallCompletedEvent>;
426
+ readonly "model.call.failed"?: InstrumentationEventHandler<InstrumentationModelCallFailedEvent>;
427
+ readonly "input.requested"?: InstrumentationEventHandler<InstrumentationInputRequestedEvent>;
428
+ readonly "input.resolved"?: InstrumentationEventHandler<InstrumentationInputResolvedEvent>;
429
+ readonly "session.completed"?: InstrumentationEventHandler<InstrumentationSessionSettledEvent>;
430
+ readonly "session.failed"?: InstrumentationEventHandler<InstrumentationSessionFailedEvent>;
431
+ readonly "session.started"?: InstrumentationEventHandler<InstrumentationSessionStartedEvent>;
432
+ readonly "session.waiting"?: InstrumentationEventHandler<InstrumentationSessionSettledEvent>;
433
+ readonly "action.started"?: InstrumentationEventHandler<InstrumentationActionStartedEvent>;
434
+ readonly "action.completed"?: InstrumentationEventHandler<InstrumentationActionCompletedEvent>;
435
+ readonly "action.failed"?: InstrumentationEventHandler<InstrumentationActionFailedEvent>;
436
+ readonly "tool.call.started"?: InstrumentationEventHandler<InstrumentationToolCallStartedEvent>;
437
+ readonly "tool.call.completed"?: InstrumentationEventHandler<InstrumentationToolCallCompletedEvent>;
438
+ readonly "tool.call.failed"?: InstrumentationEventHandler<InstrumentationToolCallFailedEvent>;
439
+ readonly "turn.cancelled"?: InstrumentationEventHandler<InstrumentationTurnSettledEvent>;
440
+ readonly "turn.completed"?: InstrumentationEventHandler<InstrumentationTurnSettledEvent>;
441
+ readonly "turn.failed"?: InstrumentationEventHandler<InstrumentationTurnFailedEvent>;
442
+ readonly "turn.started"?: InstrumentationEventHandler<InstrumentationTurnStartedEvent>;
443
+ };
444
+ /** Drains anything buffered. Driven by the runtime, not by the bus. */
445
+ readonly flush?: () => void | PromiseLike<void>;
446
+ /** Releases resources when the process is going away. */
447
+ readonly shutdown?: () => void | PromiseLike<void>;
448
+ }
449
+ type InstrumentationProviderInput = Omit<InstrumentationProviderDefinition, "name"> & {
450
+ readonly name?: string;
451
+ };
452
+ export interface InstrumentationDispatchGroups {
453
+ readonly serialBefore?: readonly InstrumentationProviderDefinition[];
454
+ readonly parallel?: readonly InstrumentationProviderDefinition[];
455
+ readonly serialAfter?: readonly InstrumentationProviderDefinition[];
456
+ }
457
+ export type InstrumentationHooksInput = readonly InstrumentationProviderInput[] | InstrumentationDispatchGroups;
458
+ /** Events that pair a start with its terminal under one `idempotencyKey`. */
459
+ export type InstrumentationCorrelatedEvent = InstrumentationChannelDeliveryStartedEvent | InstrumentationChannelDeliveryTerminalEvent | InstrumentationInputRequestedEvent | InstrumentationInputResolvedEvent | InstrumentationActionStartedEvent | InstrumentationActionTerminalEvent | InstrumentationModelCallStartedEvent | InstrumentationModelCallTerminalEvent | InstrumentationToolCallStartedEvent | InstrumentationToolCallTerminalEvent;
460
+ export type InstrumentationPointEvent = InstrumentationStepAttemptStartedEvent | InstrumentationStepAttemptMetadataEvent | InstrumentationStepAttemptTerminalEvent | InstrumentationSessionStartedEvent | InstrumentationSessionTransitionEvent | InstrumentationTurnStartedEvent | InstrumentationTurnTerminalEvent;
461
+ export type InstrumentationEvent = InstrumentationCorrelatedEvent | InstrumentationPointEvent;
462
+ /** Trusted framework operation for activating context around AI SDK execution. */
463
+ export type InstrumentationContextRunner = <T>(operation: InstrumentationExecutionOperation, execute: () => PromiseLike<T>) => PromiseLike<T>;
464
+ /** Stable identity supplied only to a trusted framework context runner. */
465
+ export type InstrumentationExecutionOperation = {
466
+ readonly idempotencyKey: string;
467
+ readonly scope: InstrumentationAttemptScope;
468
+ readonly type: "tool.call";
469
+ } | {
470
+ readonly idempotencyKey: string;
471
+ readonly scope: InstrumentationAttemptScope;
472
+ readonly type: "model.call";
473
+ };
474
+ /** Provider-neutral hook operations consumed by the AI SDK bridge. */
475
+ export interface InstrumentationHooks {
476
+ /**
477
+ * Whether any registered provider declared `capture: "content"`.
478
+ *
479
+ * False means nothing downstream can read what was said, so the publisher
480
+ * should not serialize it in the first place. This is the only way the
481
+ * projection is skipped rather than merely withheld.
482
+ */
483
+ readonly capturesContent: boolean;
484
+ publish(event: InstrumentationEvent): Promise<void>;
485
+ }
486
+ export interface CreateInstrumentationHooksOptions {
487
+ readonly handlerTimeoutMs?: number;
488
+ }
489
+ /** Creates failure-isolated hooks backed by normalized dispatch groups. */
490
+ export declare function createInstrumentationHooks(input: InstrumentationHooksInput, options?: CreateInstrumentationHooksOptions): InstrumentationHooks;
491
+ export {};
@@ -0,0 +1 @@
1
+ import{createInstrumentationDispatcher}from"#harness/instrumentation/dispatch.js";function sessionIdempotencyKey(e){return`session:${e}`}function turnIdempotencyKey(e,t){return`turn:${e}:${t}`}function attemptIdempotencyKey(e){return`step:${e.attemptId}`}function modelCallIdempotencyKey(e,t){return`model:${e.attemptId}:${String(t)}`}function toolCallIdempotencyKey(e,t,n){return`tool:${e.attemptId}:${t}:${String(n)}`}function inputIdempotencyKey(e,t,n){return`input:${e}:${t}:${n}`}function channelDeliveryIdempotencyKey(e,t){return`channel-delivery:${e}:${t}`}function actionIdempotencyKey(e,t,n){return`action:${e}:${t}:${n}`}function createInstrumentationHooks(t,n={}){return createInstrumentationDispatcher(t,n)}export{actionIdempotencyKey,attemptIdempotencyKey,channelDeliveryIdempotencyKey,createInstrumentationHooks,inputIdempotencyKey,modelCallIdempotencyKey,sessionIdempotencyKey,toolCallIdempotencyKey,turnIdempotencyKey};
@@ -1,7 +1,10 @@
1
- import type { InstrumentationHooks, InstrumentationParentLineage, InstrumentationTraceContext } from "#harness/instrumentation-lifecycle.js";
1
+ import type { InstrumentationAttemptScope, InstrumentationHooks, InstrumentationParentLineage, InstrumentationTraceContext } from "#harness/instrumentation/lifecycle.js";
2
+ import type { ResolvedInputBatch } from "#harness/input-requests.js";
2
3
  import type { HandleEventFn } from "#harness/types.js";
3
4
  export interface CreateInstrumentationHandleEventInput {
4
5
  readonly agentName?: string;
6
+ readonly channelKind?: string;
7
+ readonly getAttemptScope?: () => InstrumentationAttemptScope | undefined;
5
8
  readonly handleEvent?: HandleEventFn;
6
9
  readonly hooks?: InstrumentationHooks;
7
10
  readonly parentLineage?: InstrumentationParentLineage;
@@ -12,3 +15,9 @@ export interface CreateInstrumentationHandleEventInput {
12
15
  }
13
16
  /** Publishes eve-native lifecycle transitions after durable event acceptance. */
14
17
  export declare function createInstrumentationHandleEvent(input: CreateInstrumentationHandleEventInput): HandleEventFn | undefined;
18
+ /** Publishes accepted input resolutions against their original request scope. */
19
+ export declare function publishInputResolutions(input: {
20
+ readonly batch: ResolvedInputBatch;
21
+ readonly hooks: InstrumentationHooks;
22
+ readonly sessionId: string;
23
+ }): Promise<void>;
@@ -0,0 +1 @@
1
+ import{contextStorage}from"#context/container.js";import{instrumentChannelDelivery}from"#harness/channel-delivery-instrumentation.js";import{rememberInstrumentationActionScope,rememberInstrumentationInputScope,takeInstrumentationActionScopeForCall,takeInstrumentationInputScope}from"#harness/instrumentation/state.js";import{RuntimeActionSettlementTimesKey}from"#harness/runtime-action-settlement-state.js";import{actionIdempotencyKey,inputIdempotencyKey,sessionIdempotencyKey,turnIdempotencyKey}from"#harness/instrumentation/lifecycle.js";function createInstrumentationHandleEvent(n){if(n.hooks===void 0)return n.handleEvent;if(n.handleEvent===void 0)return;let r=n.handleEvent,i=n.hooks,a=new Set,o=new Set,s=n.turnId;return async(c,l)=>{await r(c,l);let u=toLifecycleEvent(c,n,s);if(c.type===`turn.started`&&(s=c.data.turnId),c.type===`turn.cancelled`||c.type===`turn.completed`||c.type===`turn.failed`||c.type===`session.completed`||c.type===`session.failed`){let n=contextStorage.getStore();n!==void 0&&await instrumentChannelDelivery({ctx:n,error:c.type===`turn.failed`||c.type===`session.failed`?Error(c.data.message):void 0,errorCode:c.type===`turn.failed`||c.type===`session.failed`?c.data.code:void 0,hooks:i,includeTurn:c.type===`turn.cancelled`||c.type===`turn.completed`||c.type===`turn.failed`,outcome:c.type===`turn.failed`||c.type===`session.failed`?`failed`:c.type===`turn.cancelled`?`cancelled`:`completed`})}u!==void 0&&await i.publish(u),c.type===`actions.requested`?await publishActionStarts(c,n,i,a):c.type===`action.result`?await publishActionTerminal(c,n,i):c.type===`input.requested`&&await publishInputStarts(c,n,i,o)}}async function publishInputStarts(e,t,n,i){let a=t.getAttemptScope?.();if(a!==void 0)for(let o of e.data.requests){let s=inputIdempotencyKey(t.sessionId,e.data.turnId,o.requestId);i.has(s)||(i.add(s),rememberInstrumentationInputScope(s,a),await n.publish(Object.freeze({action:Object.freeze({callId:o.action.callId,name:o.action.toolName}),idempotencyKey:s,kind:o.kind,request:n.capturesContent?Object.freeze({allowFreeform:o.allowFreeform,display:o.display,options:o.options,prompt:o.prompt}):void 0,requestId:o.requestId,scope:a,type:`input.requested`})))}}async function publishInputResolutions(e){for(let t of e.batch.inputs){let n=inputIdempotencyKey(e.sessionId,e.batch.event.turnId,t.request.requestId),r=takeInstrumentationInputScope(n);r!==void 0&&await e.hooks.publish(Object.freeze({idempotencyKey:n,kind:t.request.kind,outcome:t.outcome,requestId:t.request.requestId,response:!e.hooks.capturesContent||t.response===void 0?void 0:Object.freeze({optionId:t.response.optionId,text:t.response.text}),scope:r,type:`input.resolved`}))}}async function publishActionStarts(e,t,r,i){let a=t.getAttemptScope?.();if(a!==void 0)for(let o of e.data.actions){let c=actionIdempotencyKey(t.sessionId,e.data.turnId,o.callId);i.has(c)||(i.add(c),rememberInstrumentationActionScope(c,a),await r.publish(Object.freeze({callId:o.callId,idempotencyKey:c,input:r.capturesContent?o.input:void 0,kind:o.kind,name:actionName(o),scope:a,type:`action.started`})))}}async function publishActionTerminal(t,n,r){let a=takeInstrumentationActionScopeForCall(n.sessionId,t.data.result.callId);if(a===void 0)return;let{idempotencyKey:s,scope:c}=a;if(t.data.status===`completed`){await r.publish(Object.freeze({acceptedAtMs:contextStorage.getStore()?.get(RuntimeActionSettlementTimesKey)?.[t.data.result.callId],idempotencyKey:s,outcome:`completed`,output:Object.freeze(r.capturesContent?{output:t.data.result.output,type:`result`}:{type:`result`}),scope:c,type:`action.completed`,usage:actionUsage(t.data.result)}));return}let l=t.data.error===void 0?t.data.result.output:Object.assign(Error(t.data.error.message),{code:t.data.error.code});await r.publish(Object.freeze({acceptedAtMs:contextStorage.getStore()?.get(RuntimeActionSettlementTimesKey)?.[t.data.result.callId],error:l,errorCode:t.data.error?.code,idempotencyKey:s,outcome:t.data.status,scope:c,type:`action.failed`}))}function actionUsage(e){if(!(e.kind!==`subagent-result`||e.origin!==`child`||e.usage===void 0))return{inputTokenDetails:{cacheReadTokens:e.usage.cacheReadTokens,cacheWriteTokens:e.usage.cacheWriteTokens},inputTokens:e.usage.inputTokens,outputTokens:e.usage.outputTokens}}function actionName(e){return e.kind===`tool-call`?e.toolName:e.kind===`load-skill`?`load_skill`:e.name}function toLifecycleEvent(e,t,n){switch(e.type){case`session.started`:return{agentName:t.agentName,channelKind:t.channelKind,idempotencyKey:sessionIdempotencyKey(t.sessionId),parentTraceContext:t.parentTraceContext,rootSessionId:t.rootSessionId??t.sessionId,sessionId:t.sessionId,type:`session.started`};case`session.completed`:case`session.waiting`:return{idempotencyKey:sessionIdempotencyKey(t.sessionId),sessionId:t.sessionId,turnId:n,type:e.type};case`session.failed`:return{error:Error(e.data.message),idempotencyKey:sessionIdempotencyKey(t.sessionId),sessionId:t.sessionId,turnId:n,type:`session.failed`};case`turn.started`:return{idempotencyKey:turnIdempotencyKey(t.sessionId,e.data.turnId),parentLineage:t.parentLineage,parentTraceContext:t.parentTraceContext,rootSessionId:t.rootSessionId??t.sessionId,sequence:e.data.sequence,sessionId:t.sessionId,turnId:e.data.turnId,type:`turn.started`};case`turn.completed`:case`turn.cancelled`:return{idempotencyKey:turnIdempotencyKey(t.sessionId,e.data.turnId),sessionId:t.sessionId,turnId:e.data.turnId,type:e.type};case`turn.failed`:return{error:Error(e.data.message),idempotencyKey:turnIdempotencyKey(t.sessionId,e.data.turnId),sessionId:t.sessionId,turnId:e.data.turnId,type:`turn.failed`};default:return}}export{createInstrumentationHandleEvent,publishInputResolutions};
@@ -0,0 +1,50 @@
1
+ import { type InstrumentationRuntime } from "#harness/instrumentation/runtime.js";
2
+ import { type InstrumentationProvider } from "#public/instrumentation/provider.js";
3
+ /** One provider and the `instrumentation/<slot>.ts` file it came from. */
4
+ export interface RegisteredInstrumentationProvider {
5
+ readonly provider: InstrumentationProvider;
6
+ readonly slot: string;
7
+ }
8
+ /** Fills reserved slots before authored files may reconfigure or disable them. */
9
+ export declare function seedInstrumentationProviders(): void;
10
+ /**
11
+ * Registers one authored provider and awaits its `setup`.
12
+ *
13
+ * Called once per `instrumentation/<slot>.ts` by the generated Nitro plugin at
14
+ * server startup, before any event is published. A default export that is not
15
+ * a `defineInstrumentation` result throws rather than being skipped: a slot
16
+ * that registers nothing is telemetry that silently does nothing, which is the
17
+ * failure this surface exists to prevent.
18
+ *
19
+ * @internal — not part of the public API.
20
+ */
21
+ export declare function registerInstrumentationProvider(input: {
22
+ readonly agentName: string;
23
+ readonly slot: string;
24
+ readonly value: unknown;
25
+ }): Promise<void>;
26
+ /** Registered providers in slot order. @internal */
27
+ export declare function getInstrumentationProviders(): readonly RegisteredInstrumentationProvider[];
28
+ /**
29
+ * Installs the process instrumentation runtime from the registered providers.
30
+ *
31
+ * Called once by the generated Nitro plugin after every slot has registered,
32
+ * which is also why it cannot happen inside `setup`: the OpenTelemetry pipeline
33
+ * is the union of every destination declared in the directory, so no single
34
+ * file knows enough to build it. A `setup` that reaches for a tracer therefore
35
+ * gets the no-op one; declare destinations as values and let this assemble
36
+ * them.
37
+ *
38
+ * A directory that declared no OpenTelemetry at all still gets a bus. Its
39
+ * providers see every event; they just have no spans to hang them on.
40
+ *
41
+ * @internal — not part of the public API.
42
+ */
43
+ export declare function finalizeInstrumentationProviders(input: {
44
+ readonly serviceName: string;
45
+ }): InstrumentationRuntime;
46
+ /**
47
+ * Releases every registered provider and OTel processor from Nitro's close
48
+ * hook, the last point a buffered exporter can still reach the network.
49
+ */
50
+ export declare function shutdownInstrumentationProviders(): Promise<void>;
@@ -0,0 +1 @@
1
+ import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{getInstrumentationRuntime}from"#harness/instrumentation/runtime.js";import{createInstrumentationSetupContext}from"#harness/instrumentation/setup-context.js";import{DEVELOPMENT_WORKER_APP_ROOT_ENV}from"#internal/workflow/development-world-protocol.js";import{agentRuns,localTraces}from"#public/instrumentation/otel.js";import{installInstrumentationRuntime}from"#tracing/install-instrumentation-runtime.js";import{collectOtelPipeline}from"#tracing/otel-declaration.js";import{isInstrumentationDisabled,isInstrumentationProvider}from"#public/instrumentation/provider.js";const INSTRUMENTATION_PROVIDERS_GLOBAL_KEY=Symbol.for(`eve.harness-instrumentation-providers`),globalContainer=globalThis;function providerRegistry(){let e=globalContainer[INSTRUMENTATION_PROVIDERS_GLOBAL_KEY];if(e!==void 0)return e;let t=new Map;return globalContainer[INSTRUMENTATION_PROVIDERS_GLOBAL_KEY]=t,t}function seedInstrumentationProviders(){let e=providerRegistry();process.env.VERCEL_ENV===`production`&&e.set(`agent-runs`,agentRuns()),process.env[DEVELOPMENT_WORKER_APP_ROOT_ENV]!==void 0&&e.set(`local`,localTraces())}async function registerInstrumentationProvider(e){if(isInstrumentationDisabled(e.value)){providerRegistry().delete(e.slot);return}if(!isInstrumentationProvider(e.value))throw Error(`The default export of "instrumentation/${e.slot}" is not an instrumentation provider. Return the result of \`defineInstrumentation\` or \`disableInstrumentation\` from it.`);providerRegistry().set(e.slot,e.value),await e.value.setup?.(createInstrumentationSetupContext(e.agentName))}function getInstrumentationProviders(){return[...providerRegistry()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({provider:t,slot:e}))}function finalizeInstrumentationProviders(t){let n=getInstrumentationProviders();return installInstrumentationRuntime({collected:collectOtelPipeline(n.map(e=>e.provider)),frameworkVersion:resolveInstalledPackageInfo().version,providers:n.map(toProviderDefinition),serviceName:t.serviceName})}async function shutdownInstrumentationProviders(){await getInstrumentationRuntime()?.shutdown()}function toProviderDefinition(e){return{capture:e.provider.capture,events:e.provider.events,flush:e.provider.flush,name:e.slot,shutdown:e.provider.shutdown,stateNamespace:`authored:${e.slot}`}}export{finalizeInstrumentationProviders,getInstrumentationProviders,registerInstrumentationProvider,seedInstrumentationProviders,shutdownInstrumentationProviders};
@@ -1,12 +1,17 @@
1
- import type { InstrumentationContextRunner, InstrumentationHooks } from "#harness/instrumentation-lifecycle.js";
1
+ import type { InstrumentationContextRunner, InstrumentationHooks, InstrumentationSessionStartedEvent, InstrumentationTraceContext, InstrumentationTurnStartedEvent } from "#harness/instrumentation/lifecycle.js";
2
+ import type { OtelHarnessSettings } from "#tracing/otel-declaration.js";
2
3
  /** Process-wide runtime consumed by every harness execution surface. */
3
4
  export interface InstrumentationRuntime {
4
5
  readonly forceFlush: () => Promise<void>;
5
6
  readonly hooks: InstrumentationHooks;
7
+ readonly prepareSessionTrace?: (event: InstrumentationSessionStartedEvent) => Promise<InstrumentationTraceContext>;
8
+ readonly prepareTurnTrace?: (event: InstrumentationTurnStartedEvent) => Promise<InstrumentationTraceContext>;
9
+ otelSettings: OtelHarnessSettings | undefined;
6
10
  readonly runInContext: InstrumentationContextRunner;
11
+ readonly shutdown: () => Promise<void>;
7
12
  }
8
13
  /** Instrumentation capabilities consumed inside one harness execution. */
9
- export type HarnessInstrumentation = Pick<InstrumentationRuntime, "hooks" | "runInContext">;
14
+ export type HarnessInstrumentation = Pick<InstrumentationRuntime, "hooks" | "prepareSessionTrace" | "prepareTurnTrace" | "runInContext">;
10
15
  /** Registers the process instrumentation runtime before agent execution begins. */
11
16
  export declare function registerInstrumentationRuntime(runtime: InstrumentationRuntime): InstrumentationRuntime;
12
17
  /** Returns the process instrumentation runtime, when one was installed. */
@@ -1 +1 @@
1
- const INSTRUMENTATION_RUNTIME_KEY=Symbol.for(`eve.instrumentation-runtime`),globalRuntime=globalThis;function registerInstrumentationRuntime(e){let t=globalRuntime[INSTRUMENTATION_RUNTIME_KEY];return t===void 0?(globalRuntime[INSTRUMENTATION_RUNTIME_KEY]=e,e):t}function getInstrumentationRuntime(){return globalRuntime[INSTRUMENTATION_RUNTIME_KEY]}export{getInstrumentationRuntime,registerInstrumentationRuntime};
1
+ const INSTRUMENTATION_RUNTIME_KEY=Symbol.for(`eve.instrumentation-runtime`),globalRuntime=globalThis;function registerInstrumentationRuntime(e){let t=globalRuntime[INSTRUMENTATION_RUNTIME_KEY];return t===void 0?(globalRuntime[INSTRUMENTATION_RUNTIME_KEY]=e,e):(t.otelSettings=e.otelSettings,t)}function getInstrumentationRuntime(){return globalRuntime[INSTRUMENTATION_RUNTIME_KEY]}export{getInstrumentationRuntime,registerInstrumentationRuntime};
@@ -0,0 +1,12 @@
1
+ import type { ProviderSetupContext } from "#public/instrumentation/provider.js";
2
+ /**
3
+ * Builds the context handed to an authored `setup` at server startup.
4
+ *
5
+ * Shared by both layouts so the two cannot drift: a divergent context type
6
+ * would leave `defineInstrumentation`'s union without a contextual signature
7
+ * for `setup`, silently making every authored `setup(context)` parameter an
8
+ * implicit `any`.
9
+ *
10
+ * @internal — not part of the public API.
11
+ */
12
+ export declare function createInstrumentationSetupContext(agentName: string): ProviderSetupContext;
@@ -0,0 +1 @@
1
+ import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{isEveDevEnvironment,resolveEveEvaluationRunId}from"#internal/application/dev-environment.js";function createInstrumentationSetupContext(e){let t=resolveEveEvaluationRunId();return{agentName:e,environment:resolveInstrumentationEnvironment(),evaluation:t===void 0?void 0:{runId:t},frameworkVersion:resolveInstalledPackageInfo().version}}function resolveInstrumentationEnvironment(){return isEveDevEnvironment()||process.env.VERCEL_ENV===`development`?`development`:process.env.VERCEL_ENV===`preview`?`preview`:`production`}export{createInstrumentationSetupContext};