eve 0.75.0 → 0.76.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 (658) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/src/_virtual/_rolldown/runtime.js +1 -1
  3. package/dist/src/acp/adapter.js +1 -1
  4. package/dist/src/channel/task-card.js +1 -1
  5. package/dist/src/channel/tool-eligibility.d.ts +1 -2
  6. package/dist/src/chunks/{use-eve-agent-B2Kne9z6.js → use-eve-agent-D2V9UhLt.js} +68 -10
  7. package/dist/src/chunks/{use-eve-agent-DK_T88EP.js → use-eve-agent-QmriPA-w.js} +68 -10
  8. package/dist/src/cli/commands/deploy.js +1 -1
  9. package/dist/src/cli/commands/link.d.ts +2 -1
  10. package/dist/src/cli/commands/link.js +1 -1
  11. package/dist/src/cli/commands/registry.js +1 -1
  12. package/dist/src/cli/commands/vercel-non-interactive.d.ts +6 -4
  13. package/dist/src/cli/commands/vercel-non-interactive.js +1 -1
  14. package/dist/src/cli/dev/environment.d.ts +0 -6
  15. package/dist/src/cli/dev/environment.js +1 -1
  16. package/dist/src/cli/dev/tui/conversation-view.js +1 -1
  17. package/dist/src/cli/dev/tui/runner.js +1 -1
  18. package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
  19. package/dist/src/cli/dev/tui/transcript.js +1 -1
  20. package/dist/src/client/message-action-parts.d.ts +3 -0
  21. package/dist/src/client/message-action-parts.js +1 -1
  22. package/dist/src/client/message-reducer-types.d.ts +6 -1
  23. package/dist/src/client/message-reducer.js +1 -1
  24. package/dist/src/compiled/.vendor-stamp.json +9 -8
  25. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  26. package/dist/src/compiled/@vercel/queue/index.d.ts +1066 -0
  27. package/dist/src/compiled/@vercel/queue/index.js +47 -0
  28. package/dist/src/compiled/@workflow/core/global.d.ts +10 -0
  29. package/dist/src/compiled/@workflow/core/index.js +1 -1
  30. package/dist/src/compiled/@workflow/core/private.d.ts +11 -0
  31. package/dist/src/compiled/@workflow/core/private.js +1 -1
  32. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +36 -8
  33. package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
  34. package/dist/src/compiled/@workflow/core/runtime/lifecycle-hooks.d.ts +10 -6
  35. package/dist/src/compiled/@workflow/core/runtime/out-of-band-observation.d.ts +159 -0
  36. package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +28 -4
  37. package/dist/src/compiled/@workflow/core/runtime.js +4 -4
  38. package/dist/src/compiled/@workflow/core/serialization.js +1 -1
  39. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  40. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  41. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  42. package/dist/src/compiled/@workflow/world-vercel/index.js +4 -4
  43. package/dist/src/compiled/_chunks/workflow/{attribute-changes-CSqvJx6j.js → attribute-changes-BW-kbMMn.js} +1 -1
  44. package/dist/src/compiled/_chunks/workflow/dist-CyBgVS7g.js +1 -0
  45. package/dist/src/compiled/_chunks/workflow/{helpers-BXCuoPUb.js → helpers-DlLD3ov_.js} +1 -1
  46. package/dist/src/compiled/_chunks/workflow/private-tQUuwBoQ.js +1 -0
  47. package/dist/src/compiled/_chunks/workflow/{resume-hook-CvENCrxc.js → resume-hook-DMsV_b4n.js} +1 -1
  48. package/dist/src/compiled/_chunks/workflow/{run-8pLWuR2U.js → run-DzdAqdb1.js} +1 -1
  49. package/dist/src/compiled/_chunks/workflow/{serialization-vDozzDhh.js → serialization-DPdYS_w2.js} +2 -2
  50. package/dist/src/compiled/_chunks/workflow/sleep-BY6leHh8.js +1 -0
  51. package/dist/src/compiled/_chunks/workflow/{token-BKeK6DmC.js → token-D5ugC3PI.js} +1 -1
  52. package/dist/src/compiled/_chunks/workflow/{token-util-CddTZ_ef.js → token-util-Bla5Z0G9.js} +1 -1
  53. package/dist/src/compiled/_chunks/workflow/undici-D-ILjOKD.js +95 -0
  54. package/dist/src/compiled/_chunks/workflow/{wait-until-A344L2AG.js → wait-until-xbRRDuUf.js} +1 -1
  55. package/dist/src/compiler/connection-ownership.d.ts +6 -0
  56. package/dist/src/compiler/connection-ownership.js +1 -0
  57. package/dist/src/compiler/default-tool-policy.d.ts +0 -3
  58. package/dist/src/compiler/default-tool-policy.js +1 -1
  59. package/dist/src/compiler/extension-compatibility.d.ts +21 -20
  60. package/dist/src/compiler/extension-compatibility.js +1 -1
  61. package/dist/src/compiler/manifest.d.ts +9 -6
  62. package/dist/src/compiler/manifest.js +1 -1
  63. package/dist/src/compiler/normalize-connection.js +1 -1
  64. package/dist/src/compiler/normalize-manifest.js +1 -1
  65. package/dist/src/compiler/normalize-skill.d.ts +5 -0
  66. package/dist/src/compiler/normalize-skill.js +1 -1
  67. package/dist/src/compiler/normalize-subagent.d.ts +2 -1
  68. package/dist/src/compiler/normalize-subagent.js +1 -1
  69. package/dist/src/compiler/normalize-tool.js +1 -1
  70. package/dist/src/compiler/remote-agent-node.d.ts +2 -1
  71. package/dist/src/compiler/remote-agent-node.js +1 -1
  72. package/dist/src/connections/ownership.d.ts +18 -0
  73. package/dist/src/connections/ownership.js +1 -0
  74. package/dist/src/context/build-dynamic-tools.d.ts +3 -9
  75. package/dist/src/context/build-dynamic-tools.js +1 -1
  76. package/dist/src/context/dynamic-connection-lifecycle.js +1 -1
  77. package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -11
  78. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  79. package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
  80. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  81. package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
  82. package/dist/src/context/keys.d.ts +5 -4
  83. package/dist/src/context/memory-tools.js +1 -1
  84. package/dist/src/context/schedule-collection-tools.js +1 -1
  85. package/dist/src/discover/grammar.d.ts +11 -0
  86. package/dist/src/discover/grammar.js +1 -1
  87. package/dist/src/discover/manifest.d.ts +1 -0
  88. package/dist/src/discover/manifest.js +1 -1
  89. package/dist/src/discover/skills.d.ts +1 -0
  90. package/dist/src/discover/skills.js +1 -1
  91. package/dist/src/dynamic/definition.d.ts +7 -5
  92. package/dist/src/evals/assertions/collector.d.ts +4 -0
  93. package/dist/src/evals/assertions/collector.js +1 -1
  94. package/dist/src/evals/assertions/run.d.ts +2 -3
  95. package/dist/src/evals/assertions/run.js +2 -2
  96. package/dist/src/evals/assertions/scoped.js +1 -1
  97. package/dist/src/evals/index.d.ts +1 -1
  98. package/dist/src/evals/match.d.ts +9 -6
  99. package/dist/src/evals/reported-tool-name.d.ts +9 -0
  100. package/dist/src/evals/reported-tool-name.js +1 -0
  101. package/dist/src/evals/runner/derive-run-facts.d.ts +3 -3
  102. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  103. package/dist/src/evals/runner/execute-task.js +1 -1
  104. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  105. package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.d.ts +11 -0
  106. package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.js +1 -0
  107. package/dist/src/evals/runner/reporters/datadog.js +2 -2
  108. package/dist/src/evals/session.js +2 -2
  109. package/dist/src/evals/target.d.ts +7 -0
  110. package/dist/src/evals/target.js +1 -1
  111. package/dist/src/evals/types.d.ts +17 -1
  112. package/dist/src/eve-channel/request.js +1 -1
  113. package/dist/src/execution/agent-sessions/remote.js +1 -1
  114. package/dist/src/execution/catalog/connection-auth.d.ts +41 -0
  115. package/dist/src/execution/catalog/connection-auth.js +1 -0
  116. package/dist/src/execution/catalog/connection-entry.d.ts +16 -0
  117. package/dist/src/execution/catalog/connection-entry.js +1 -0
  118. package/dist/src/execution/catalog/listing.d.ts +9 -0
  119. package/dist/src/execution/catalog/listing.js +3 -0
  120. package/dist/src/execution/catalog/rank.d.ts +44 -0
  121. package/dist/src/execution/catalog/rank.js +1 -0
  122. package/dist/src/execution/catalog/search.d.ts +28 -0
  123. package/dist/src/execution/catalog/search.js +1 -0
  124. package/dist/src/execution/catalog/signatures.d.ts +11 -0
  125. package/dist/src/execution/catalog/signatures.js +1 -0
  126. package/dist/src/execution/catalog/skills.d.ts +24 -0
  127. package/dist/src/execution/catalog/skills.js +1 -0
  128. package/dist/src/execution/catalog/step-catalog.d.ts +51 -0
  129. package/dist/src/execution/catalog/step-catalog.js +1 -0
  130. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  131. package/dist/src/execution/dynamic-connections.js +1 -1
  132. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  133. package/dist/src/execution/invoke-tool.js +1 -1
  134. package/dist/src/execution/ndjson-stream.d.ts +6 -6
  135. package/dist/src/execution/ndjson-stream.js +3 -3
  136. package/dist/src/execution/node-step.js +1 -1
  137. package/dist/src/execution/session/active-turn.d.ts +1 -1
  138. package/dist/src/execution/session/pending-turn-state.js +1 -1
  139. package/dist/src/execution/session/turn-step.js +1 -1
  140. package/dist/src/execution/session/turn.d.ts +5 -5
  141. package/dist/src/execution/session/turn.js +1 -1
  142. package/dist/src/execution/session.js +1 -1
  143. package/dist/src/execution/skills/instructions.d.ts +20 -10
  144. package/dist/src/execution/skills/instructions.js +2 -2
  145. package/dist/src/execution/tasks/calls.d.ts +6 -5
  146. package/dist/src/execution/tasks/calls.js +1 -1
  147. package/dist/src/execution/tasks/model-step.d.ts +10 -10
  148. package/dist/src/execution/tasks/model-step.js +1 -1
  149. package/dist/src/execution/tasks/render.d.ts +3 -3
  150. package/dist/src/execution/tasks/render.js +3 -3
  151. package/dist/src/execution/tasks/session.d.ts +2 -1
  152. package/dist/src/execution/tasks/table.d.ts +1 -1
  153. package/dist/src/execution/tasks/tool-entry-point.d.ts +1 -1
  154. package/dist/src/execution/tool-auth.js +1 -1
  155. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  156. package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
  157. package/dist/src/extensions/code/extension/extension.d.ts +4 -18
  158. package/dist/src/extensions/code/extension/instructions/github.d.ts +3 -0
  159. package/dist/src/extensions/code/extension/instructions/github.js +1 -0
  160. package/dist/src/extensions/code/extension/instructions.md +1 -13
  161. package/dist/src/extensions/code/extension/lib/diagnostics.d.ts +4 -2
  162. package/dist/src/extensions/code/extension/lib/diagnostics.js +3 -3
  163. package/dist/src/extensions/code/extension/lib/github-compat.d.ts +28 -0
  164. package/dist/src/extensions/code/extension/lib/github-compat.js +1 -0
  165. package/dist/src/extensions/code/extension/lib/grep-search.d.ts +3 -13
  166. package/dist/src/extensions/code/extension/lib/grep-search.js +2 -2
  167. package/dist/src/extensions/code/extension/lib/patch.d.ts +8 -2
  168. package/dist/src/extensions/code/extension/lib/patch.js +4 -4
  169. package/dist/src/extensions/code/extension/lib/repository-root.d.ts +3 -4
  170. package/dist/src/extensions/code/extension/lib/repository-root.js +1 -1
  171. package/dist/src/extensions/code/extension/lib/sandbox.d.ts +2 -1
  172. package/dist/src/extensions/code/extension/lib/sandbox.js +1 -1
  173. package/dist/src/extensions/code/extension/lib/tooling.d.ts +4 -4
  174. package/dist/src/extensions/code/extension/lib/tooling.js +7 -7
  175. package/dist/src/extensions/code/extension/lib/workspace-root.d.ts +31 -0
  176. package/dist/src/extensions/code/extension/lib/workspace-root.js +1 -0
  177. package/dist/src/extensions/code/extension/skills/pr.d.ts +6 -0
  178. package/dist/src/extensions/code/extension/skills/pr.js +1 -0
  179. package/dist/src/extensions/code/extension/tools/apply_patch.d.ts +2 -2
  180. package/dist/src/extensions/code/extension/tools/apply_patch.js +2 -2
  181. package/dist/src/extensions/code/extension/tools/gh.d.ts +4 -3
  182. package/dist/src/extensions/code/extension/tools/gh.js +1 -1
  183. package/dist/src/extensions/code/extension/tools/grep.js +1 -1
  184. package/dist/src/extensions/code/tools.d.ts +2 -1
  185. package/dist/src/extensions/code/tools.js +1 -1
  186. package/dist/src/extensions/git/extension/extension.d.ts +12 -0
  187. package/dist/src/extensions/git/extension/extension.js +1 -0
  188. package/dist/src/extensions/git/extension/instructions/github.d.ts +2 -0
  189. package/dist/src/extensions/git/extension/instructions/github.js +1 -0
  190. package/dist/src/extensions/git/extension/lib/gh-tool.d.ts +29 -0
  191. package/dist/src/extensions/git/extension/lib/gh-tool.js +1 -0
  192. package/dist/src/extensions/git/extension/lib/github-guidance.d.ts +3 -0
  193. package/dist/src/extensions/git/extension/lib/github-guidance.js +49 -0
  194. package/dist/src/extensions/{code → git}/extension/lib/github-shell.d.ts +1 -1
  195. package/dist/src/extensions/git/extension/lib/github-shell.js +1 -0
  196. package/dist/src/extensions/git/extension/lib/repository-root.d.ts +5 -0
  197. package/dist/src/extensions/git/extension/lib/repository-root.js +1 -0
  198. package/dist/src/extensions/git/extension/lib/sandbox.d.ts +6 -0
  199. package/dist/src/extensions/git/extension/lib/sandbox.js +1 -0
  200. package/dist/src/extensions/git/extension/lib/shell.d.ts +1 -0
  201. package/dist/src/extensions/git/extension/lib/shell.js +1 -0
  202. package/dist/src/extensions/git/extension/lib/tooling.d.ts +4 -0
  203. package/dist/src/extensions/git/extension/lib/tooling.js +1 -0
  204. package/dist/src/extensions/git/extension/skills/pr.d.ts +5 -0
  205. package/dist/src/extensions/git/extension/skills/pr.js +1 -0
  206. package/dist/src/extensions/git/extension/tools/gh.d.ts +28 -0
  207. package/dist/src/extensions/git/extension/tools/gh.js +1 -0
  208. package/dist/src/extensions/git/tools.d.ts +27 -0
  209. package/dist/src/extensions/git/tools.js +1 -0
  210. package/dist/src/framework/sources/registry.js +1 -1
  211. package/dist/src/harness/action-presentation.d.ts +2 -2
  212. package/dist/src/harness/action-result-helpers.d.ts +10 -2
  213. package/dist/src/harness/action-result-helpers.js +1 -1
  214. package/dist/src/harness/announcements.d.ts +2 -8
  215. package/dist/src/harness/announcements.js +1 -1
  216. package/dist/src/harness/compaction/engine.d.ts +8 -19
  217. package/dist/src/harness/compaction/engine.js +1 -1
  218. package/dist/src/harness/compaction/step.d.ts +7 -1
  219. package/dist/src/harness/compaction/step.js +1 -1
  220. package/dist/src/harness/coordination.d.ts +11 -11
  221. package/dist/src/harness/coordination.js +1 -1
  222. package/dist/src/harness/current-messages.d.ts +1 -5
  223. package/dist/src/harness/current-messages.js +1 -1
  224. package/dist/src/harness/emission.d.ts +2 -2
  225. package/dist/src/harness/emission.js +1 -1
  226. package/dist/src/harness/execute-call.d.ts +48 -0
  227. package/dist/src/harness/execute-call.js +1 -0
  228. package/dist/src/harness/execute-tool.d.ts +3 -1
  229. package/dist/src/harness/final-output.d.ts +2 -6
  230. package/dist/src/harness/final-output.js +1 -1
  231. package/dist/src/harness/hitl/approvals.d.ts +5 -0
  232. package/dist/src/harness/hitl/approvals.js +1 -1
  233. package/dist/src/harness/hitl/approved-calls.d.ts +3 -2
  234. package/dist/src/harness/hitl/approved-calls.js +1 -1
  235. package/dist/src/harness/hitl/candidates.d.ts +13 -2
  236. package/dist/src/harness/hitl/candidates.js +1 -1
  237. package/dist/src/harness/hitl/coordinator.d.ts +3 -3
  238. package/dist/src/harness/hitl/coordinator.js +1 -1
  239. package/dist/src/harness/hitl/index.d.ts +6 -4
  240. package/dist/src/harness/hitl/index.js +1 -1
  241. package/dist/src/harness/hitl/intake.d.ts +3 -3
  242. package/dist/src/harness/hitl/intake.js +1 -1
  243. package/dist/src/harness/input-extraction.d.ts +4 -1
  244. package/dist/src/harness/input-extraction.js +1 -1
  245. package/dist/src/harness/input-request-resolution.d.ts +15 -0
  246. package/dist/src/harness/input-request-resolution.js +1 -1
  247. package/dist/src/harness/model-call/call.d.ts +5 -8
  248. package/dist/src/harness/model-call/call.js +1 -1
  249. package/dist/src/harness/model-call/errors.js +1 -1
  250. package/dist/src/harness/model-call/model.d.ts +4 -5
  251. package/dist/src/harness/model-call/model.js +1 -1
  252. package/dist/src/harness/model-call/request.d.ts +4 -4
  253. package/dist/src/harness/model-call/request.js +1 -1
  254. package/dist/src/harness/model-call/response.d.ts +2 -1
  255. package/dist/src/harness/model-call/response.js +1 -1
  256. package/dist/src/harness/model-call/retry.d.ts +1 -1
  257. package/dist/src/harness/model-call/retry.js +1 -1
  258. package/dist/src/harness/model-call/run.d.ts +5 -3
  259. package/dist/src/harness/model-call/run.js +1 -1
  260. package/dist/src/harness/model-call/tools.d.ts +14 -24
  261. package/dist/src/harness/model-call/tools.js +1 -1
  262. package/dist/src/harness/model-call/usage.js +1 -1
  263. package/dist/src/harness/model-profile.d.ts +28 -0
  264. package/dist/src/harness/model-profile.js +1 -0
  265. package/dist/src/harness/prompt-cache.d.ts +5 -53
  266. package/dist/src/harness/prompt-cache.js +1 -1
  267. package/dist/src/harness/provider-safety.d.ts +3 -5
  268. package/dist/src/harness/provider-safety.js +1 -1
  269. package/dist/src/harness/provider-tools.d.ts +7 -14
  270. package/dist/src/harness/provider-tools.js +1 -1
  271. package/dist/src/harness/session-machine/commit.js +1 -1
  272. package/dist/src/harness/session-machine/transitions.d.ts +5 -2
  273. package/dist/src/harness/session-machine/transitions.js +1 -1
  274. package/dist/src/harness/step/after-model.js +1 -1
  275. package/dist/src/harness/step-hooks.d.ts +6 -9
  276. package/dist/src/harness/step-hooks.js +1 -1
  277. package/dist/src/harness/tool-call-input-errors.d.ts +2 -2
  278. package/dist/src/harness/tool-call-io.d.ts +3 -0
  279. package/dist/src/harness/tool-call-io.js +1 -1
  280. package/dist/src/harness/tools.d.ts +24 -22
  281. package/dist/src/harness/tools.js +1 -1
  282. package/dist/src/harness/turn-tag-state.d.ts +12 -0
  283. package/dist/src/harness/turn-tag-state.js +1 -1
  284. package/dist/src/harness/types.d.ts +14 -0
  285. package/dist/src/instrumentation/lifecycle.d.ts +0 -1
  286. package/dist/src/instrumentation/native-events.js +1 -1
  287. package/dist/src/instrumentation/runtime.d.ts +2 -1
  288. package/dist/src/internal/application/package.js +1 -1
  289. package/dist/src/internal/authored-definition/core.js +1 -1
  290. package/dist/src/internal/authored-definition/schedule-collection.js +1 -1
  291. package/dist/src/internal/authored-definition/schema-backed.d.ts +2 -2
  292. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  293. package/dist/src/internal/authored-module.d.ts +2 -1
  294. package/dist/src/internal/authored-module.js +1 -1
  295. package/dist/src/internal/gateway.d.ts +0 -13
  296. package/dist/src/internal/gateway.js +1 -1
  297. package/dist/src/internal/helpers/markdown.js +1 -1
  298. package/dist/src/internal/mcp/skills.js +1 -1
  299. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  300. package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
  301. package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.d.ts +5 -0
  302. package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.js +1 -0
  303. package/dist/src/internal/nitro/routes/schedule-collection-consumer.d.ts +6 -0
  304. package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -1
  305. package/dist/src/internal/schedules/consumer-route.d.ts +2 -0
  306. package/dist/src/internal/schedules/consumer-route.js +1 -1
  307. package/dist/src/internal/schedules/dev-environment.d.ts +2 -0
  308. package/dist/src/internal/schedules/dev-environment.js +1 -0
  309. package/dist/src/internal/vercel-agent-summary.d.ts +2 -2
  310. package/dist/src/internal/workflow/vercel-world-defaults.d.ts +1 -1
  311. package/dist/src/internal/workflow/vercel-world-defaults.js +1 -1
  312. package/dist/src/protocol/catalog-tools.d.ts +12 -0
  313. package/dist/src/protocol/catalog-tools.js +1 -0
  314. package/dist/src/protocol/message-version.js +1 -1
  315. package/dist/src/protocol/message.d.ts +1 -1
  316. package/dist/src/protocol/remote-agent-protocol.d.ts +2 -0
  317. package/dist/src/protocol/remote-agent-protocol.js +1 -1
  318. package/dist/src/protocol/reply-tool.d.ts +2 -0
  319. package/dist/src/protocol/reply-tool.js +1 -0
  320. package/dist/src/protocol/runtime-tools.d.ts +6 -0
  321. package/dist/src/protocol/runtime-tools.js +1 -0
  322. package/dist/src/protocol/session-projection.js +1 -1
  323. package/dist/src/protocol/task-tools.d.ts +4 -4
  324. package/dist/src/protocol/task-tools.js +1 -1
  325. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +1 -1
  326. package/dist/src/public/channels/linear/defaults.js +2 -2
  327. package/dist/src/public/channels/slack/action-status.d.ts +0 -9
  328. package/dist/src/public/channels/slack/action-status.js +1 -1
  329. package/dist/src/public/channels/slack/defaults.js +2 -2
  330. package/dist/src/public/channels/slack/task-card.d.ts +1 -1
  331. package/dist/src/public/definitions/connections/mcp.d.ts +4 -4
  332. package/dist/src/public/definitions/connections/openapi.d.ts +6 -7
  333. package/dist/src/public/definitions/remote-agent.d.ts +6 -3
  334. package/dist/src/public/definitions/workspace-agent.d.ts +6 -3
  335. package/dist/src/public/experimental/schedules/index.d.ts +1 -1
  336. package/dist/src/public/schedules/providers/in-memory.js +1 -1
  337. package/dist/src/public/schedules/providers/vercel.js +1 -1
  338. package/dist/src/public/schedules/subscription.d.ts +36 -16
  339. package/dist/src/public/tools/web-search.d.ts +1 -1
  340. package/dist/src/runtime/agent/bootstrap.d.ts +2 -1
  341. package/dist/src/runtime/agent/bootstrap.js +1 -1
  342. package/dist/src/runtime/agent/mock-model-adapter.js +2 -2
  343. package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
  344. package/dist/src/runtime/agent/mock-model-skill-selection.d.ts +2 -0
  345. package/dist/src/runtime/agent/mock-model-skill-selection.js +2 -2
  346. package/dist/src/runtime/agent/mock-structured-output.d.ts +1 -1
  347. package/dist/src/runtime/connections/mcp-client.js +1 -1
  348. package/dist/src/runtime/connections/registry.js +1 -1
  349. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  350. package/dist/src/runtime/connections/tool-result.d.ts +2 -2
  351. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  352. package/dist/src/runtime/resolve-tool.js +1 -1
  353. package/dist/src/runtime/schedules/collection-client.d.ts +12 -3
  354. package/dist/src/runtime/schedules/collection-client.js +1 -1
  355. package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -2
  356. package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +2 -1
  357. package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
  358. package/dist/src/runtime/subagents/registry.d.ts +2 -1
  359. package/dist/src/runtime/subagents/registry.js +1 -1
  360. package/dist/src/runtime/tools/registry.d.ts +2 -0
  361. package/dist/src/runtime/tools/registry.js +1 -1
  362. package/dist/src/runtime/types.d.ts +3 -3
  363. package/dist/src/setup/connection-connector.js +1 -2
  364. package/dist/src/setup/index.d.ts +1 -1
  365. package/dist/src/setup/index.js +1 -1
  366. package/dist/src/setup/integrations/slack/setup.d.ts +23 -3
  367. package/dist/src/setup/integrations/slack/setup.js +1 -1
  368. package/dist/src/setup/primitives/process-output.d.ts +5 -0
  369. package/dist/src/setup/primitives/process-output.js +2 -1
  370. package/dist/src/setup/scaffold/create/project.js +1 -1
  371. package/dist/src/setup/scaffold/create/web-template.d.ts +3 -2
  372. package/dist/src/setup/scaffold/create/web-template.js +384 -412
  373. package/dist/src/setup/scaffold/update/update-slack-channel.d.ts +17 -0
  374. package/dist/src/setup/scaffold/update/update-slack-channel.js +1 -1
  375. package/dist/src/setup/slack-connect-create.d.ts +10 -2
  376. package/dist/src/setup/slack-connect-create.js +1 -1
  377. package/dist/src/setup/slack-connect-lifecycle.d.ts +92 -44
  378. package/dist/src/setup/slack-connect-lifecycle.js +1 -1
  379. package/dist/src/setup/slack-connect.d.ts +30 -11
  380. package/dist/src/setup/slack-connect.js +1 -1
  381. package/dist/src/setup/slack-setup-plan.d.ts +72 -0
  382. package/dist/src/setup/slack-setup-plan.js +1 -0
  383. package/dist/src/setup/slackbot.d.ts +75 -35
  384. package/dist/src/setup/slackbot.js +2 -1
  385. package/dist/src/setup/vercel-project.d.ts +1 -1
  386. package/dist/src/setup/vercel-project.js +0 -0
  387. package/dist/src/shared/action-label.d.ts +10 -0
  388. package/dist/src/shared/action-label.js +1 -0
  389. package/dist/src/shared/action-request-name.d.ts +3 -1
  390. package/dist/src/shared/action-request-name.js +1 -1
  391. package/dist/src/shared/action-types.d.ts +7 -8
  392. package/dist/src/shared/action-types.js +1 -1
  393. package/dist/src/shared/agent-definition.d.ts +11 -3
  394. package/dist/src/shared/development-env-files.d.ts +4 -0
  395. package/dist/src/shared/development-env-files.js +1 -0
  396. package/dist/src/shared/input.d.ts +0 -1
  397. package/dist/src/shared/map-with-concurrency.d.ts +2 -0
  398. package/dist/src/shared/map-with-concurrency.js +1 -0
  399. package/dist/src/shared/skill-definition.d.ts +6 -0
  400. package/dist/src/shared/skill-package.d.ts +1 -0
  401. package/dist/src/shared/skill-package.js +1 -1
  402. package/dist/src/shared/web-search.d.ts +15 -2
  403. package/dist/src/shared/web-search.js +1 -1
  404. package/dist/src/svelte/index.js +1 -1
  405. package/dist/src/svelte/use-eve-agent.js +1 -1
  406. package/dist/src/tool-stubs/execute.d.ts +0 -3
  407. package/dist/src/tool-stubs/execute.js +1 -1
  408. package/dist/src/tool-stubs/rules.js +1 -1
  409. package/dist/src/tool-stubs/validate-targets.js +1 -1
  410. package/dist/src/tools/behavior.d.ts +3 -6
  411. package/dist/src/tools/definition.d.ts +5 -0
  412. package/dist/src/tools/dynamic.d.ts +5 -2
  413. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  414. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  415. package/dist/src/tools/provided/task-cancel.d.ts +1 -1
  416. package/dist/src/tools/provided/task-wait.d.ts +1 -1
  417. package/dist/src/tools/provided/web-search.d.ts +20 -7
  418. package/dist/src/tools/provided/web-search.js +1 -1
  419. package/dist/src/tools/schema.d.ts +5 -0
  420. package/dist/src/tools/schema.js +1 -1
  421. package/dist/src/{runtime/connections/tool-signature.d.ts → tools/signature.d.ts} +2 -2
  422. package/dist/src/tools/workflow-definition.d.ts +1 -1
  423. package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
  424. package/dist/src/tracing/agent-otel-provider.js +2 -2
  425. package/dist/src/tracing/agent-otel-runtime-context.d.ts +1 -0
  426. package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
  427. package/dist/src/tracing/agent-otel-turn-state.d.ts +6 -0
  428. package/dist/src/tracing/agent-otel-turn-state.js +1 -0
  429. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  430. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  431. package/dist/src/tracing/agent-trace-state.d.ts +4 -1
  432. package/dist/src/vue/index.js +1 -1
  433. package/dist/src/vue/use-eve-agent.js +1 -1
  434. package/docs/agent-config.md +8 -8
  435. package/docs/channels/chat-sdk.mdx +1 -1
  436. package/docs/channels/slack.mdx +32 -82
  437. package/docs/code-extension.mdx +28 -7
  438. package/docs/concepts/built-in-tools.md +43 -43
  439. package/docs/concepts/context-control.md +1 -1
  440. package/docs/concepts/execution-model-and-durability.mdx +1 -1
  441. package/docs/concepts/sessions-runs-and-streaming.md +4 -4
  442. package/docs/connections/mcp.mdx +5 -5
  443. package/docs/connections/openapi.mdx +1 -1
  444. package/docs/connections/overview.mdx +4 -2
  445. package/docs/evals/assertions.mdx +5 -3
  446. package/docs/evals/reporters.mdx +3 -1
  447. package/docs/evals/tool-stubs.mdx +3 -1
  448. package/docs/extensions.md +2 -0
  449. package/docs/guides/dev-tui.md +2 -2
  450. package/docs/guides/dynamic-capabilities.md +14 -4
  451. package/docs/guides/frontend/overview.mdx +1 -1
  452. package/docs/guides/remote-agents.md +10 -3
  453. package/docs/instructions.mdx +5 -5
  454. package/docs/reference/cli.md +2 -2
  455. package/docs/reference/typescript-api.md +3 -3
  456. package/docs/skills.mdx +19 -4
  457. package/docs/subagents/index.mdx +5 -3
  458. package/docs/tools/overview.mdx +22 -1
  459. package/docs/tools/tasks-upgrade.md +1 -1
  460. package/docs/tools/tasks.md +32 -32
  461. package/docs/tools/workflows.mdx +6 -6
  462. package/docs/tutorial/team-playbooks.mdx +2 -2
  463. package/package.json +27 -11
  464. package/dist/src/compiled/_chunks/workflow/dist-DmXynLVH.js +0 -1
  465. package/dist/src/compiled/_chunks/workflow/private-Dlf90Zvn.js +0 -1
  466. package/dist/src/compiled/_chunks/workflow/signal-exit-iIdjQcCK.js +0 -95
  467. package/dist/src/compiled/_chunks/workflow/sleep-BMqbraZM.js +0 -1
  468. package/dist/src/execution/connection-announcement.d.ts +0 -7
  469. package/dist/src/execution/connection-announcement.js +0 -4
  470. package/dist/src/execution/tools/connection-approval.d.ts +0 -25
  471. package/dist/src/execution/tools/connection-approval.js +0 -1
  472. package/dist/src/execution/tools/connection-search-rank.d.ts +0 -21
  473. package/dist/src/execution/tools/connection-search-rank.js +0 -1
  474. package/dist/src/execution/tools/connection-target.d.ts +0 -18
  475. package/dist/src/execution/tools/connection-target.js +0 -1
  476. package/dist/src/execution/tools/connection-tools.d.ts +0 -4
  477. package/dist/src/execution/tools/connection-tools.js +0 -2
  478. package/dist/src/execution/tools/load-skill.d.ts +0 -10
  479. package/dist/src/execution/tools/load-skill.js +0 -1
  480. package/dist/src/extensions/code/extension/lib/github-shell.js +0 -1
  481. package/dist/src/extensions/code/extension/skills/pr/SKILL.md +0 -53
  482. package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.d.ts +0 -2
  483. package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.js +0 -1
  484. package/dist/src/harness/advertised-tools.d.ts +0 -26
  485. package/dist/src/harness/advertised-tools.js +0 -1
  486. package/dist/src/harness/nested-actions.d.ts +0 -23
  487. package/dist/src/harness/nested-actions.js +0 -1
  488. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cli-config.js +0 -1
  489. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cred-storage.js +0 -1
  490. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/index.js +0 -1
  491. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.js +0 -1
  492. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.zod.js +0 -1
  493. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/types.js +0 -1
  494. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/envpath.js +0 -1
  495. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errors.js +0 -2
  496. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errutils.js +0 -1
  497. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/exec.js +0 -1
  498. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/fsutils.js +0 -1
  499. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/index.js +0 -1
  500. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/lookup.js +0 -1
  501. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/safety.js +0 -1
  502. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/auth-errors.js +0 -1
  503. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -1
  504. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-context.js +0 -1
  505. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -1
  506. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +0 -2
  507. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/index.js +0 -1
  508. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/oauth.js +0 -1
  509. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-error.js +0 -1
  510. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-io.js +0 -1
  511. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-util.js +0 -2
  512. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token.js +0 -1
  513. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -1
  514. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/version.js +0 -1
  515. package/dist/src/node_modules/.pnpm/@vercel_queue@0.5.1_@opentelemetry_api@1.9.1/node_modules/@vercel/queue/dist/index.js +0 -36
  516. package/dist/src/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +0 -1
  517. package/dist/src/node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js +0 -1
  518. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +0 -1
  519. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +0 -1
  520. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +0 -1
  521. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +0 -1
  522. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +0 -1
  523. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -1
  524. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +0 -1
  525. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +0 -1
  526. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +0 -2
  527. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +0 -1
  528. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +0 -1
  529. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +0 -1
  530. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +0 -1
  531. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +0 -1
  532. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +0 -1
  533. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +0 -1
  534. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +0 -1
  535. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +0 -1
  536. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +0 -1
  537. package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +0 -1
  538. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +0 -1
  539. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +0 -1
  540. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +0 -1
  541. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +0 -1
  542. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +0 -1
  543. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +0 -1
  544. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +0 -1
  545. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +0 -1
  546. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +0 -1
  547. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +0 -1
  548. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +0 -1
  549. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +0 -1
  550. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +0 -1
  551. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +0 -1
  552. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +0 -1
  553. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +0 -1
  554. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +0 -1
  555. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +0 -1
  556. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +0 -1
  557. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +0 -1
  558. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +0 -1
  559. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +0 -1
  560. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +0 -1
  561. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +0 -1
  562. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +0 -1
  563. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +0 -1
  564. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +0 -1
  565. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +0 -1
  566. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +0 -1
  567. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +0 -1
  568. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +0 -1
  569. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +0 -1
  570. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +0 -1
  571. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +0 -1
  572. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +0 -1
  573. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +0 -1
  574. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +0 -1
  575. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +0 -1
  576. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +0 -1
  577. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +0 -1
  578. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +0 -1
  579. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +0 -1
  580. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +0 -1
  581. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +0 -1
  582. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +0 -1
  583. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +0 -1
  584. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +0 -1
  585. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +0 -1
  586. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +0 -1
  587. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +0 -1
  588. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +0 -1
  589. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +0 -1
  590. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +0 -1
  591. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +0 -1
  592. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +0 -1
  593. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +0 -1
  594. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +0 -1
  595. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +0 -1
  596. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +0 -1
  597. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +0 -1
  598. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +0 -1
  599. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +0 -1
  600. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +0 -1
  601. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +0 -1
  602. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +0 -1
  603. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +0 -1
  604. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +0 -1
  605. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +0 -1
  606. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +0 -1
  607. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +0 -1
  608. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +0 -1
  609. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +0 -1
  610. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +0 -1
  611. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +0 -1
  612. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +0 -1
  613. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +0 -1
  614. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +0 -1
  615. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +0 -1
  616. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +0 -1
  617. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +0 -1
  618. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +0 -1
  619. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +0 -1
  620. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +0 -1
  621. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +0 -1
  622. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +0 -1
  623. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +0 -1
  624. package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +0 -1
  625. package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +0 -1
  626. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -1
  627. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +0 -1
  628. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +0 -1
  629. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +0 -1
  630. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +0 -1
  631. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +0 -1
  632. package/dist/src/node_modules/.pnpm/mixpart@0.0.6/node_modules/mixpart/dist/index.js +0 -7
  633. package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +0 -1
  634. package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +0 -1
  635. package/dist/src/node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js +0 -1
  636. package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +0 -1
  637. package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +0 -1
  638. package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +0 -1
  639. package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +0 -1
  640. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +0 -1
  641. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +0 -1
  642. package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +0 -2
  643. package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +0 -1
  644. package/dist/src/node_modules/.pnpm/xdg-app-paths@5.5.1/node_modules/xdg-app-paths/src/lib/index.js +0 -1
  645. package/dist/src/node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js +0 -1
  646. package/dist/src/public/tools/load-skill.d.ts +0 -3
  647. package/dist/src/public/tools/load-skill.js +0 -1
  648. package/dist/src/runtime/skills/fragment-context.d.ts +0 -4
  649. package/dist/src/runtime/skills/fragment-context.js +0 -1
  650. package/dist/src/tools/framework/connection-tools.d.ts +0 -3
  651. package/dist/src/tools/framework/connection-tools.js +0 -1
  652. package/dist/src/tools/provided/load-skill.d.ts +0 -2
  653. package/dist/src/tools/provided/load-skill.js +0 -1
  654. /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.d.ts +0 -0
  655. /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.js +0 -0
  656. /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.d.ts +0 -0
  657. /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.js +0 -0
  658. /package/dist/src/{runtime/connections/tool-signature.js → tools/signature.js} +0 -0
@@ -1 +1 @@
1
- import{normalizeChannelAudience}from"#shared/channel-audience.js";import{AGENT_SPAN_NAMES}from"#tracing/agent-span-contract.js";import{ROOT_CONTEXT,trace}from"#compiled/@opentelemetry/api/index.js";import{agentSpanNamingAttributes}from"#tracing/agent-span-naming.js";import{contentAttribute}from"#tracing/agent-otel-content.js";import{recordAgentSpanError}from"#tracing/agent-span-error.js";import{agentTraceIdentityAttributes,traceSessionIdOf}from"#tracing/agent-otel-attributes.js";import{decodeTraceSessionId}from"#tracing/agent-trace-context-codec.js";import{withChannelAudience}from"#tracing/channel-audience-context.js";function createAgentApprovalInstrumentation(e){return{"input.requested":async(t,n)=>{if(t.kind!==`tool-approval`||readState(n.state.get())!==void 0)return;let r=await e.actionContextFor(t.scope.sessionId,t.scope.turnId,t.action.callId);if(r===void 0)return;let i={actionCallId:t.action.callId,actionName:t.action.name,attemptIndex:t.scope.attemptIndex,channelAudience:normalizeChannelAudience(t.scope.channelAudience),parent:{spanId:r.spanContext.spanId,traceFlags:r.spanContext.traceFlags,traceId:r.spanContext.traceId},requestId:t.requestId,rootSessionId:t.scope.rootSessionId??t.scope.sessionId,traceSessionId:traceSessionIdOf(t.scope),sessionId:t.scope.sessionId,startTimeMs:Date.now(),stepIndex:t.scope.stepIndex,turnId:t.scope.turnId},a=contentAttribute(t.request);a!==void 0&&(i.requestAttribute=a),n.state.set(i)},"input.resolved":(t,n)=>{let r=readState(n.state.get());if(r===void 0)return;let i=e.idGenerator.withSpanId(e.idGenerator.deriveSpanId(`approval:${t.idempotencyKey}`),()=>e.tracer.startSpan(AGENT_SPAN_NAMES.approval,{attributes:{"gen_ai.tool.call.id":r.actionCallId,"agent.action.name":r.actionName,"agent.approval.kind":`tool-approval`,"agent.approval.outcome":t.outcome,"agent.approval.request_id":r.requestId,"agent.framework.name":`eve`,"agent.framework.version":e.frameworkVersion,"agent.step.attempt":r.attemptIndex,"agent.step.index":r.stepIndex,"agent.turn.id":r.turnId,...agentSpanNamingAttributes(`agent.approval`),...agentTraceIdentityAttributes({rootSessionId:r.rootSessionId,traceSessionId:r.traceSessionId,sessionId:r.sessionId})},startTime:r.startTimeMs},withChannelAudience(trace.setSpan(ROOT_CONTEXT,trace.wrapSpanContext({...r.parent,isRemote:!1})),r.channelAudience)));if(r.requestAttribute!==void 0&&i.setAttribute(`agent.approval.request`,r.requestAttribute),t.response!==void 0){let e=contentAttribute(t.response);e!==void 0&&i.setAttribute(`agent.approval.response`,e)}t.outcome===`failed`&&recordAgentSpanError(i,t.error),i.end()}}}function readState(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e,n=t.parent;if(typeof n!=`object`||!n||Array.isArray(n))return;let r=n;if(typeof t.actionCallId!=`string`||typeof t.actionName!=`string`||typeof t.attemptIndex!=`number`||typeof r.spanId!=`string`||typeof r.traceFlags!=`number`||typeof r.traceId!=`string`||typeof t.requestId!=`string`||typeof t.rootSessionId!=`string`||typeof t.sessionId!=`string`||typeof t.startTimeMs!=`number`||typeof t.stepIndex!=`number`||typeof t.turnId!=`string`)return;let i=t.requestAttribute;if(i===void 0||typeof i==`string`)return{actionCallId:t.actionCallId,actionName:t.actionName,attemptIndex:t.attemptIndex,channelAudience:normalizeChannelAudience(t.channelAudience),parent:{isRemote:!1,spanId:r.spanId,traceFlags:r.traceFlags,traceId:r.traceId},requestAttribute:i,requestId:t.requestId,rootSessionId:t.rootSessionId,traceSessionId:decodeTraceSessionId(t),sessionId:t.sessionId,startTimeMs:t.startTimeMs,stepIndex:t.stepIndex,turnId:t.turnId}}export{createAgentApprovalInstrumentation};
1
+ import{normalizeChannelAudience}from"#shared/channel-audience.js";import{AGENT_SPAN_NAMES}from"#tracing/agent-span-contract.js";import{ROOT_CONTEXT,trace}from"#compiled/@opentelemetry/api/index.js";import{agentSpanNamingAttributes}from"#tracing/agent-span-naming.js";import{contentAttribute}from"#tracing/agent-otel-content.js";import{recordAgentSpanError}from"#tracing/agent-span-error.js";import{agentTraceIdentityAttributes,traceSessionIdOf}from"#tracing/agent-otel-attributes.js";import{decodeTraceSessionId}from"#tracing/agent-trace-context-codec.js";import{withChannelAudience}from"#tracing/channel-audience-context.js";function createAgentApprovalInstrumentation(e){return{"input.requested":async(t,n)=>{if(t.kind!==`tool-approval`||readState(n.state.get())!==void 0)return;let r=await e.actionContextFor(t.scope.sessionId,t.scope.turnId,t.action.callId);if(r===void 0)return;let i={actionCallId:t.action.callId,actionName:t.action.name,attemptIndex:t.scope.attemptIndex,channelAudience:normalizeChannelAudience(t.scope.channelAudience),parent:{spanId:r.spanContext.spanId,traceFlags:r.spanContext.traceFlags,traceId:r.spanContext.traceId},requestId:t.requestId,rootSessionId:t.scope.rootSessionId??t.scope.sessionId,traceSessionId:traceSessionIdOf(t.scope),sessionId:t.scope.sessionId,startTimeMs:Date.now(),stepIndex:t.scope.stepIndex,turnId:t.scope.turnId},a=contentAttribute(t.request);a!==void 0&&(i.requestAttribute=a),n.state.set(i)},"input.resolved":(t,n)=>{let r=readState(n.state.get());if(r===void 0)return;let i=e.idGenerator.withSpanId(e.idGenerator.deriveSpanId(`approval:${t.idempotencyKey}`),()=>e.tracer.startSpan(AGENT_SPAN_NAMES.approval,{attributes:{"gen_ai.tool.call.id":r.actionCallId,"agent.action.name":r.actionName,"agent.approval.kind":`tool-approval`,"agent.approval.outcome":t.outcome,"agent.approval.request_id":r.requestId,"agent.framework.name":`eve`,"agent.framework.version":e.frameworkVersion,"agent.step.attempt":r.attemptIndex,"agent.step.index":r.stepIndex,"agent.turn.id":r.turnId,"gen_ai.operation.name":`workflow`,...agentSpanNamingAttributes(`agent.approval`,`workflow`),...agentTraceIdentityAttributes({rootSessionId:r.rootSessionId,traceSessionId:r.traceSessionId,sessionId:r.sessionId})},startTime:r.startTimeMs},withChannelAudience(trace.setSpan(ROOT_CONTEXT,trace.wrapSpanContext({...r.parent,isRemote:!1})),r.channelAudience)));if(r.requestAttribute!==void 0&&i.setAttribute(`agent.approval.request`,r.requestAttribute),t.response!==void 0){let e=contentAttribute(t.response);e!==void 0&&i.setAttribute(`agent.approval.response`,e)}t.outcome===`failed`&&recordAgentSpanError(i,t.error),i.end()}}}function readState(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e,n=t.parent;if(typeof n!=`object`||!n||Array.isArray(n))return;let r=n;if(typeof t.actionCallId!=`string`||typeof t.actionName!=`string`||typeof t.attemptIndex!=`number`||typeof r.spanId!=`string`||typeof r.traceFlags!=`number`||typeof r.traceId!=`string`||typeof t.requestId!=`string`||typeof t.rootSessionId!=`string`||typeof t.sessionId!=`string`||typeof t.startTimeMs!=`number`||typeof t.stepIndex!=`number`||typeof t.turnId!=`string`)return;let i=t.requestAttribute;if(i===void 0||typeof i==`string`)return{actionCallId:t.actionCallId,actionName:t.actionName,attemptIndex:t.attemptIndex,channelAudience:normalizeChannelAudience(t.channelAudience),parent:{isRemote:!1,spanId:r.spanId,traceFlags:r.traceFlags,traceId:r.traceId},requestAttribute:i,requestId:t.requestId,rootSessionId:t.rootSessionId,traceSessionId:decodeTraceSessionId(t),sessionId:t.sessionId,startTimeMs:t.startTimeMs,stepIndex:t.stepIndex,turnId:t.turnId}}export{createAgentApprovalInstrumentation};
@@ -1,2 +1,2 @@
1
- import{normalizeChannelAudience}from"#shared/channel-audience.js";import{applyLiveDeliveryAudienceCeiling,resolveForwardedTraceSeed}from"#shared/forwarded-trace-policy.js";import{contextStorage}from"#context/container.js";import{SessionTraceSeedKey}from"#context/keys.js";import{AGENT_SPAN_NAMES,agentInvocationSpanName,modelSpanName}from"#tracing/agent-span-contract.js";import{resolveInstrumentationEnvironment}from"#internal/application/dev-environment.js";import{withOperationConversation}from"#tracing/conversation-context.js";import{isSampledTrace,resolveTracePolicyDecision}from"#tracing/sampled-trace.js";import{ROOT_CONTEXT,SpanKind,context,trace}from"#compiled/@opentelemetry/api/index.js";import{markAgentTraceContext}from"#tracing/agent-trace-context.js";import{attemptIdempotencyKey}from"#instrumentation/lifecycle.js";import{withoutInstrumentationContent}from"#instrumentation/content.js";import{withErrorContent}from"#tracing/error-content-context.js";import{readInstrumentationDecision}from"#shared/instrumentation-decision.js";import{agentSpanNamingAttributes}from"#tracing/agent-span-naming.js";import{contentAttribute,genAiInputMessagesAttribute,genAiOutputMessagesAttribute,genAiSystemInstructionsAttribute,genAiToolDefinitionsAttribute,textContentAttribute,toolResultsContentAttribute}from"#tracing/agent-otel-content.js";import{recordAgentSpanError}from"#tracing/agent-span-error.js";import{withAgentToolContentPolicy}from"#tracing/agent-tool-span-context.js";import{agentTraceIdentityAttributes,traceSessionIdOf}from"#tracing/agent-otel-attributes.js";import{withChannelAudience}from"#tracing/channel-audience-context.js";import{suppressTracing}from"#tracing/suppress-tracing.js";import{instrumentationEventForTraceDecision}from"#instrumentation/content-policy.js";import{createAgentApprovalInstrumentation}from"#tracing/agent-approval-instrumentation.js";import{createAgentChannelDeliveryInstrumentation}from"#tracing/agent-channel-delivery-instrumentation.js";import{createAgentToolInstrumentation}from"#tracing/agent-tool-instrumentation.js";import*as runtimeAttributes from"#tracing/agent-otel-runtime-context.js";import{createAgentMemoryInstrumentation}from"#tracing/agent-memory-instrumentation.js";import{readGatewayCost,setAgentInvocationUsage,setAgentUsage,setGenAiUsage}from"#tracing/agent-otel-usage.js";import{createAgentOtelSessionContext}from"#tracing/agent-otel-session-context.js";function createAgentOtelInstrumentation(e){let t=e.environment??resolveInstrumentationEnvironment(),n=e.recordInputs??!1,r=e.recordOutputs??!1,i=new WeakMap,a=new Map,o=new WeakMap,s=new WeakMap,c=createAgentToolInstrumentation({frameworkVersion:e.frameworkVersion,idGenerator:e.idGenerator,recordInputs:n,recordOutputs:r,resolveTraceContext:async t=>(await e.stateStore.getTurn(t.scope.sessionId,t.scope.turnId))?.context,stateStore:e.stateStore,resolveFallback:e=>{let t=a.get(e.scope.attemptId)??e.scope,n=o.get(t);return n===void 0?void 0:{context:n.context,spanContext:n.span.spanContext()}},tracer:e.tracer}),l=createAgentApprovalInstrumentation({actionContextFor:c.dispatchContextFor,frameworkVersion:e.frameworkVersion,idGenerator:e.idGenerator,tracer:e.tracer}),u=createAgentMemoryInstrumentation({...e,environment:t}),{prepareSessionTrace:d,prepareTurnTrace:f}=createAgentOtelSessionContext({...e,environment:t}),projectEvent=async i=>{let a=await e.stateStore.getSession(sessionIdForEvent(i)),o=audienceForEvent(i,a?.channelAudience),s=`traceSeed`in i?i.traceSeed:void 0,c=contextStorage.getStore()?.get(SessionTraceSeedKey),l=resolveForwardedTraceSeed(c),u=resolveForwardedTraceSeed(s,l?.forwardedTracePolicy),decisionForTrace=e=>e===void 0?void 0:resolveTracePolicyDecision(isSampledTrace(e),{audience:o,environment:t}),d=u?.decision??l?.decision??readInstrumentationDecision(a?.decision)??decisionForTrace(s)??decisionForTrace(c)??decisionForTrace(a?.context);if(d===void 0)return withoutInstrumentationContent(i);let f=u===void 0||!(`traceSeed`in i)||i.traceSeed===void 0?i:{...i,traceSeed:{...i.traceSeed,decision:u.decision,traceFlags:u.traceFlags}};return instrumentationEventForTraceDecision(f,applyLiveDeliveryAudienceCeiling(d.action===`drop`?d:{action:`record`,recordInputs:n&&d.recordInputs,recordOutputs:r&&d.recordOutputs},o,u?.forwardedTracePolicy??l?.forwardedTracePolicy,t),{audience:o,environment:t},{applyAudienceCeiling:!1})},onSessionStarted=async e=>{await d(e)},onTurnStarted=async e=>{await f(e)},onStepStarted=async t=>{let n=await e.stateStore.getTurn(t.scope.sessionId,t.scope.turnId);if(n===void 0||!isSampledTrace(n.context))return;let r=await e.stateStore.getSession(t.scope.sessionId),i=withChannelAudience(contextFromSpanContext(n.context),t.scope.channelAudience),s=trace.getSpan(context.active())?.spanContext(),c=e.idGenerator.withSpanId(e.idGenerator.deriveSpanId(attemptIdempotencyKey(t.scope)),()=>e.tracer.startSpan(AGENT_SPAN_NAMES.step,{attributes:runtimeAttributes.agentStepAttributes({event:t,frameworkVersion:e.frameworkVersion,session:r,turn:n}),links:s===void 0||s.traceId===n.context.traceId?void 0:[{attributes:{"eve.link.type":`workflow.delivery`},context:s}]},i));c.addEvent(`step.started`);let l=trace.setSpan(i,c);o.set(t.scope,{context:l,span:c}),a.set(t.scope.attemptId,t.scope)},onStepTerminal=async e=>{let t=a.get(e.scope.attemptId)??e.scope;i.delete(t),drainOpenSpans({...e,scope:t}),c.drain(e.scope.attemptId,e.type===`step.attempt.failed`?{error:e.error}:void 0),e.type===`step.attempt.failed`&&await c.failForAttempt(t,e.error),a.delete(e.scope.attemptId);let n=o.get(t);n!==void 0&&(n.span.addEvent(e.type===`step.attempt.completed`?`step.completed`:`step.failed`),e.type===`step.attempt.failed`&&recordAgentSpanError(n.span,e.error),n.span.end(),o.delete(t))},onTurnTerminal=async t=>{await e.stateStore.updateTurn(t.sessionId,t.turnId,e=>({...e,terminal:t.type===`turn.failed`?{error:t.error,type:t.type}:{type:t.type}}))},onSessionTransition=async t=>{if(t.type===`session.failed`&&t.turnId!==void 0&&await e.stateStore.updateTurn(t.sessionId,t.turnId,e=>({...e,terminal:e.terminal??{error:t.error,type:`turn.failed`}})),t.turnId!==void 0){let n=await e.stateStore.getTurn(t.sessionId,t.turnId);if(n!==void 0){let r=await e.stateStore.getSession(t.sessionId);if(isSampledTrace(n.context)){let i=r?.agentName??n.subagentName,a=withChannelAudience(n.caller===void 0||n.caller.isRemote===!0?ROOT_CONTEXT:contextFromSpanContext(n.caller),r?.channelAudience),startSpan=()=>e.tracer.startSpan(agentInvocationSpanName(i),{attributes:runtimeAttributes.agentActivationAttributes({agentName:i,frameworkVersion:e.frameworkVersion,session:r,sessionId:t.sessionId,turnId:t.turnId,turn:n}),kind:SpanKind.INTERNAL,links:agentActivationLinks(n),root:n.caller===void 0||n.caller.isRemote===!0,startTime:n.startTimeMs},a),o=e.idGenerator.withSpanId(n.context.spanId,()=>e.idGenerator.withTraceId(n.context.traceId,startSpan));setAgentInvocationUsage(o,n.modelUsage),o.addEvent(`turn.started`,void 0,n.startTimeMs),n.terminal!==void 0&&(o.setAttribute(`agent.turn.outcome`,n.terminal.type===`turn.completed`?`completed`:n.terminal.type===`turn.cancelled`?`cancelled`:`failed`),o.addEvent(n.terminal.type),n.terminal.type===`turn.failed`&&recordAgentSpanError(o,n.terminal.error)),o.end()}await e.stateStore.deleteTurn(t.sessionId,t.turnId)}}(t.type===`session.completed`||t.type===`session.failed`)&&(await c.deleteForSession(t.sessionId),await e.stateStore.deleteSession(t.sessionId))},onModelCallStarted=t=>{let r=o.get(t.scope);if(r===void 0)return;r.span.setAttribute(`agent.model.id`,t.model.modelId);let i=e.tracer.startSpan(modelSpanName(t.model.modelId),{attributes:{"gen_ai.agent.name":t.scope.functionId,"gen_ai.operation.name":`chat`,"gen_ai.provider.name":t.model.provider,"gen_ai.request.model":t.model.modelId,...agentSpanNamingAttributes(modelSpanName(t.model.modelId),`chat`),...agentTraceIdentityAttributes({rootSessionId:t.scope.rootSessionId??t.scope.sessionId,traceSessionId:traceSessionIdOf(t.scope),sessionId:t.scope.sessionId}),...runtimeAttributes.runtimeContextAttributes(t.runtimeContext)},kind:SpanKind.CLIENT},r.context);if(n&&t.input!==void 0){let e=genAiInputMessagesAttribute(t.input.messages);e!==void 0&&i.setAttribute(`gen_ai.input.messages`,e);let n=genAiSystemInstructionsAttribute(t.input.instructions);n!==void 0&&i.setAttribute(`gen_ai.system_instructions`,n);let r=genAiToolDefinitionsAttribute(t.input.tools);r!==void 0&&i.setAttribute(`gen_ai.tool.definitions`,r)}let a={context:trace.setSpan(r.context,i),span:i};getExecutionContexts(t.scope).set(t.idempotencyKey,a.context),getSpanStates(s,t.scope).set(t.idempotencyKey,a)},onModelCallTerminal=async e=>{i.get(e.scope)?.delete(e.idempotencyKey);let t=takeSpanState(s,e.scope,e.idempotencyKey);if(t!==void 0){if(e.type===`model.call.failed`)recordAgentSpanError(t.span,e.error);else{await recordTurnUsage(e),setGenAiUsage(t.span,e.usage),e.responseId!==void 0&&t.span.setAttribute(`gen_ai.response.id`,e.responseId),e.responseModelId!==void 0&&t.span.setAttribute(`gen_ai.response.model`,e.responseModelId),t.span.setAttribute(`gen_ai.response.finish_reasons`,[e.finishReason]);let n=o.get(e.scope);if(n!==void 0&&setAgentUsage(n.span,e.usage),r){t.span.setAttribute(`ai.response.finish_reason`,e.finishReason);let n=e.content;if(n===void 0){t.span.end();return}let r=genAiOutputMessagesAttribute(n,e.finishReason);r!==void 0&&t.span.setAttribute(`gen_ai.output.messages`,r);let i=textContentAttribute(n.filter(e=>e.type===`reasoning`).map(e=>e.text).filter(e=>e.trim().length>0).join(`
2
- `));i!==void 0&&t.span.setAttribute(`ai.response.reasoning`,i);let a=textContentAttribute(n.filter(e=>e.type===`text`).map(e=>e.text).join(``));a!==void 0&&t.span.setAttribute(`ai.response.text`,a);let o=n.filter(e=>e.type===`tool-call`).map(e=>({callId:e.callId,input:e.input,toolName:e.toolName}));if(o.length>0){let e=contentAttribute(o);e!==void 0&&t.span.setAttribute(`ai.response.tool_calls`,e)}let s=n.filter(e=>e.type===`tool-result`||e.type===`tool-error`).map(e=>e.type===`tool-result`?{callId:e.callId,input:e.input,output:e.output,toolName:e.toolName}:{callId:e.callId,error:errorText(e.error),input:e.input,toolName:e.toolName});if(s.length>0){let e=toolResultsContentAttribute(s);e!==void 0&&t.span.setAttribute(`ai.response.tool_results`,e)}}}t.span.end()}},recordTurnUsage=async t=>{(t.usage.inputTokens!==void 0||t.usage.outputTokens!==void 0)&&await e.stateStore.updateTurn(t.scope.sessionId,t.scope.turnId,e=>({...e,modelUsage:{inputTokens:t.usage.inputTokens===void 0?e.modelUsage?.inputTokens:(e.modelUsage?.inputTokens??0)+t.usage.inputTokens,outputTokens:t.usage.outputTokens===void 0?e.modelUsage?.outputTokens:(e.modelUsage?.outputTokens??0)+t.usage.outputTokens}}))},p=createAgentChannelDeliveryInstrumentation({recordInputs:n,stateStore:e.stateStore}),onStepMetadata=e=>{let t=o.get(e.scope);if(t===void 0)return;let n=readGatewayCost(e.providerMetadata);if(n!==void 0)for(let[e,r]of Object.entries(n))t.span.setAttribute(e,r)};return{hook:{events:{...p,...l,...u.events,"step.attempt.completed":onStepTerminal,"step.attempt.failed":onStepTerminal,"step.attempt.metadata":onStepMetadata,"step.attempt.started":onStepStarted,"model.call.completed":onModelCallTerminal,"model.call.failed":onModelCallTerminal,"model.call.started":onModelCallStarted,"session.completed":onSessionTransition,"session.failed":onSessionTransition,"session.started":onSessionStarted,"session.waiting":onSessionTransition,...c.events,"turn.cancelled":onTurnTerminal,"turn.completed":onTurnTerminal,"turn.failed":onTurnTerminal,"turn.started":onTurnStarted},name:`eve.otel`,projectEvent,tracePolicy:()=>({emit:!0,recordInputs:n,recordOutputs:r})},prepareSessionTrace:d,prepareTurnTrace:f,async runInContext(o,s){if(o.type===`memory.operation`)return u.runInContext(o,s);let l=a.get(o.scope.attemptId)??o.scope,d=i.get(l),f=o.type===`model.call`?d?.get(o.idempotencyKey):c.contextFor(o.scope.attemptId,o.idempotencyKey);if(f===void 0){let t=await e.stateStore.getTurn(o.scope.sessionId,o.scope.turnId);t!==void 0&&(f=withChannelAudience(contextFromSpanContext(t.context),o.scope.channelAudience),isSampledTrace(t.context)||(f=suppressTracing(f)))}let p=await e.stateStore.getSession(o.scope.sessionId),m=resolveForwardedTraceSeed(contextStorage.getStore()?.get(SessionTraceSeedKey)),h=m?.decision??p?.decision,g=h===void 0?void 0:applyLiveDeliveryAudienceCeiling(h,normalizeChannelAudience(o.scope.channelAudience),m?.forwardedTracePolicy,t),_={recordInputs:n&&g?.action===`record`&&g.recordInputs,recordOutputs:r&&g?.action===`record`&&g.recordOutputs},run=e=>{let t=e??f;if(t===void 0)return s();let n=withErrorContent(t,_.recordOutputs),r=o.type===`tool.call`?withAgentToolContentPolicy(n,_):n;return context.with(markAgentTraceContext(withOperationConversation(r,o.scope)),s)};return o.type===`tool.call`?c.runInContext({...o,input:_.recordInputs?o.input:void 0},run,_.recordOutputs):run(void 0)}};function getExecutionContexts(e){let t=i.get(e);return t===void 0&&(t=new Map,i.set(e,t)),t}function drainOpenSpans(e){for(let t of s.get(e.scope)?.values()??[])e.type===`step.attempt.failed`&&recordAgentSpanError(t.span,e.error),t.span.end();s.delete(e.scope)}}function agentActivationLinks(e){let t=[];return e.caller?.isRemote===!0&&t.push({context:e.caller,attributes:{"eve.link.type":`agent.dispatch`}}),e.channelDelivery?.requestTraceContext!==void 0&&t.push({context:e.channelDelivery.requestTraceContext,attributes:{"eve.link.type":`channel.request`}}),t.length===0?void 0:t}function sessionIdForEvent(e){return`scope`in e?e.scope.sessionId:e.sessionId}function audienceForEvent(e,t){return`delivery`in e?normalizeChannelAudience(e.delivery.channelAudience):`scope`in e&&e.scope.channelAudience!==void 0?normalizeChannelAudience(e.scope.channelAudience):e.type===`session.started`?normalizeChannelAudience(e.channelAudience):normalizeChannelAudience(t)}function getSpanStates(e,t){let n=e.get(t);return n===void 0&&(n=new Map,e.set(t,n)),n}function takeSpanState(e,t,n){let r=e.get(t),i=r?.get(n);if(r!==void 0)return r.delete(n),r.size===0&&e.delete(t),i}function contextFromSpanContext(e){return trace.setSpan(ROOT_CONTEXT,trace.wrapSpanContext(e))}const errorText=e=>e instanceof Error?e.message:e;export{createAgentOtelInstrumentation};
1
+ import{normalizeChannelAudience}from"#shared/channel-audience.js";import{applyLiveDeliveryAudienceCeiling,resolveForwardedTraceSeed}from"#shared/forwarded-trace-policy.js";import{contextStorage}from"#context/container.js";import{SessionTraceSeedKey}from"#context/keys.js";import{AGENT_SPAN_NAMES,agentInvocationSpanName,modelSpanName}from"#tracing/agent-span-contract.js";import{resolveInstrumentationEnvironment}from"#internal/application/dev-environment.js";import{withOperationConversation}from"#tracing/conversation-context.js";import{isSampledTrace,resolveTracePolicyDecision}from"#tracing/sampled-trace.js";import{ROOT_CONTEXT,SpanKind,context,trace}from"#compiled/@opentelemetry/api/index.js";import{markAgentTraceContext}from"#tracing/agent-trace-context.js";import{attemptIdempotencyKey}from"#instrumentation/lifecycle.js";import{withoutInstrumentationContent}from"#instrumentation/content.js";import{withErrorContent}from"#tracing/error-content-context.js";import{readInstrumentationDecision}from"#shared/instrumentation-decision.js";import{agentSpanNamingAttributes}from"#tracing/agent-span-naming.js";import{contentAttribute,genAiInputMessagesAttribute,genAiOutputMessagesAttribute,genAiSystemInstructionsAttribute,genAiToolDefinitionsAttribute,textContentAttribute,toolResultsContentAttribute}from"#tracing/agent-otel-content.js";import{recordAgentSpanError}from"#tracing/agent-span-error.js";import{withAgentToolContentPolicy}from"#tracing/agent-tool-span-context.js";import{agentTraceIdentityAttributes,traceSessionIdOf}from"#tracing/agent-otel-attributes.js";import{withChannelAudience}from"#tracing/channel-audience-context.js";import{suppressTracing}from"#tracing/suppress-tracing.js";import{instrumentationEventForTraceDecision}from"#instrumentation/content-policy.js";import{createAgentApprovalInstrumentation}from"#tracing/agent-approval-instrumentation.js";import{createAgentChannelDeliveryInstrumentation}from"#tracing/agent-channel-delivery-instrumentation.js";import{createAgentToolInstrumentation}from"#tracing/agent-tool-instrumentation.js";import*as runtimeAttributes from"#tracing/agent-otel-runtime-context.js";import{createAgentMemoryInstrumentation}from"#tracing/agent-memory-instrumentation.js";import{readGatewayCost,setAgentInvocationUsage,setAgentUsage,setGenAiUsage}from"#tracing/agent-otel-usage.js";import{createAgentOtelSessionContext}from"#tracing/agent-otel-session-context.js";import{rememberTurnInputMessages,rememberTurnOutputMessages}from"#tracing/agent-otel-turn-state.js";function createAgentOtelInstrumentation(e){let t=e.environment??resolveInstrumentationEnvironment(),n=e.recordInputs??!1,r=e.recordOutputs??!1,i=new WeakMap,a=new Map,o=new WeakMap,s=new WeakMap,c=createAgentToolInstrumentation({frameworkVersion:e.frameworkVersion,idGenerator:e.idGenerator,recordInputs:n,recordOutputs:r,resolveTraceContext:async t=>(await e.stateStore.getTurn(t.scope.sessionId,t.scope.turnId))?.context,stateStore:e.stateStore,resolveFallback:e=>{let t=a.get(e.scope.attemptId)??e.scope,n=o.get(t);return n===void 0?void 0:{context:n.context,spanContext:n.span.spanContext()}},tracer:e.tracer}),l=createAgentApprovalInstrumentation({actionContextFor:c.dispatchContextFor,frameworkVersion:e.frameworkVersion,idGenerator:e.idGenerator,tracer:e.tracer}),u=createAgentMemoryInstrumentation({...e,environment:t}),{prepareSessionTrace:d,prepareTurnTrace:f}=createAgentOtelSessionContext({...e,environment:t}),projectEvent=async i=>{let a=await e.stateStore.getSession(sessionIdForEvent(i)),o=audienceForEvent(i,a?.channelAudience),s=`traceSeed`in i?i.traceSeed:void 0,c=contextStorage.getStore()?.get(SessionTraceSeedKey),l=resolveForwardedTraceSeed(c),u=resolveForwardedTraceSeed(s,l?.forwardedTracePolicy),decisionForTrace=e=>e===void 0?void 0:resolveTracePolicyDecision(isSampledTrace(e),{audience:o,environment:t}),d=u?.decision??l?.decision??readInstrumentationDecision(a?.decision)??decisionForTrace(s)??decisionForTrace(c)??decisionForTrace(a?.context);if(d===void 0)return withoutInstrumentationContent(i);let f=u===void 0||!(`traceSeed`in i)||i.traceSeed===void 0?i:{...i,traceSeed:{...i.traceSeed,decision:u.decision,traceFlags:u.traceFlags}};return instrumentationEventForTraceDecision(f,applyLiveDeliveryAudienceCeiling(d.action===`drop`?d:{action:`record`,recordInputs:n&&d.recordInputs,recordOutputs:r&&d.recordOutputs},o,u?.forwardedTracePolicy??l?.forwardedTracePolicy,t),{audience:o,environment:t},{applyAudienceCeiling:!1})},onSessionStarted=async e=>{await d(e)},onTurnStarted=async e=>{await f(e)},onStepStarted=async t=>{let n=await e.stateStore.getTurn(t.scope.sessionId,t.scope.turnId);if(n===void 0||!isSampledTrace(n.context))return;let r=await e.stateStore.getSession(t.scope.sessionId),i=withChannelAudience(contextFromSpanContext(n.context),t.scope.channelAudience),s=trace.getSpan(context.active())?.spanContext(),c=e.idGenerator.withSpanId(e.idGenerator.deriveSpanId(attemptIdempotencyKey(t.scope)),()=>e.tracer.startSpan(AGENT_SPAN_NAMES.step,{attributes:runtimeAttributes.agentStepAttributes({event:t,frameworkVersion:e.frameworkVersion,session:r,turn:n}),links:s===void 0||s.traceId===n.context.traceId?void 0:[{attributes:{"eve.link.type":`workflow.delivery`},context:s}]},i));c.addEvent(`step.started`);let l=trace.setSpan(i,c);o.set(t.scope,{context:l,span:c}),a.set(t.scope.attemptId,t.scope)},onStepTerminal=async e=>{let t=a.get(e.scope.attemptId)??e.scope;i.delete(t),drainOpenSpans({...e,scope:t}),c.drain(e.scope.attemptId,e.type===`step.attempt.failed`?{error:e.error}:void 0),e.type===`step.attempt.failed`&&await c.failForAttempt(t,e.error),a.delete(e.scope.attemptId);let n=o.get(t);n!==void 0&&(n.span.addEvent(e.type===`step.attempt.completed`?`step.completed`:`step.failed`),e.type===`step.attempt.failed`&&recordAgentSpanError(n.span,e.error),n.span.end(),o.delete(t))},onTurnTerminal=async t=>{await e.stateStore.updateTurn(t.sessionId,t.turnId,e=>({...e,terminal:t.type===`turn.failed`?{error:t.error,type:t.type}:{type:t.type}}))},onSessionTransition=async t=>{if(t.type===`session.failed`&&t.turnId!==void 0&&await e.stateStore.updateTurn(t.sessionId,t.turnId,e=>({...e,terminal:e.terminal??{error:t.error,type:`turn.failed`}})),t.turnId!==void 0){let n=await e.stateStore.getTurn(t.sessionId,t.turnId);if(n!==void 0){let r=await e.stateStore.getSession(t.sessionId);if(isSampledTrace(n.context)){let i=r?.agentName??n.subagentName,a=withChannelAudience(n.caller===void 0||n.caller.isRemote===!0?ROOT_CONTEXT:contextFromSpanContext(n.caller),r?.channelAudience),startSpan=()=>e.tracer.startSpan(agentInvocationSpanName(i),{attributes:runtimeAttributes.agentActivationAttributes({agentName:i,frameworkVersion:e.frameworkVersion,session:r,sessionId:t.sessionId,turnId:t.turnId,turn:n}),kind:SpanKind.INTERNAL,links:agentActivationLinks(n),root:n.caller===void 0||n.caller.isRemote===!0,startTime:n.startTimeMs},a),o=e.idGenerator.withSpanId(n.context.spanId,()=>e.idGenerator.withTraceId(n.context.traceId,startSpan));setAgentInvocationUsage(o,n.modelUsage),o.addEvent(`turn.started`,void 0,n.startTimeMs),n.terminal!==void 0&&(o.setAttribute(`agent.turn.outcome`,n.terminal.type===`turn.completed`?`completed`:n.terminal.type===`turn.cancelled`?`cancelled`:`failed`),o.addEvent(n.terminal.type),n.terminal.type===`turn.failed`&&recordAgentSpanError(o,n.terminal.error)),o.end()}await e.stateStore.deleteTurn(t.sessionId,t.turnId)}}(t.type===`session.completed`||t.type===`session.failed`)&&(await c.deleteForSession(t.sessionId),await e.stateStore.deleteSession(t.sessionId))},onModelCallStarted=t=>{let r=o.get(t.scope);if(r===void 0)return;r.span.setAttribute(`agent.model.id`,t.model.modelId);let i=e.tracer.startSpan(modelSpanName(t.model.modelId),{attributes:{"gen_ai.agent.name":t.scope.functionId,"gen_ai.operation.name":`chat`,"gen_ai.provider.name":t.model.provider,"gen_ai.request.model":t.model.modelId,...agentSpanNamingAttributes(modelSpanName(t.model.modelId),`chat`),...agentTraceIdentityAttributes({rootSessionId:t.scope.rootSessionId??t.scope.sessionId,traceSessionId:traceSessionIdOf(t.scope),sessionId:t.scope.sessionId}),...runtimeAttributes.runtimeContextAttributes(t.runtimeContext)},kind:SpanKind.CLIENT},r.context),a;if(n&&t.input!==void 0){a=genAiInputMessagesAttribute(t.input.messages),a!==void 0&&i.setAttribute(`gen_ai.input.messages`,a);let e=genAiSystemInstructionsAttribute(t.input.instructions);e!==void 0&&i.setAttribute(`gen_ai.system_instructions`,e);let n=genAiToolDefinitionsAttribute(t.input.tools);n!==void 0&&i.setAttribute(`gen_ai.tool.definitions`,n)}let c={context:trace.setSpan(r.context,i),span:i};return getExecutionContexts(t.scope).set(t.idempotencyKey,c.context),getSpanStates(s,t.scope).set(t.idempotencyKey,c),rememberTurnInputMessages(e.stateStore,t.scope,a)},onModelCallTerminal=async t=>{i.get(t.scope)?.delete(t.idempotencyKey);let n=takeSpanState(s,t.scope,t.idempotencyKey);if(n!==void 0){if(t.type===`model.call.failed`)recordAgentSpanError(n.span,t.error);else{await recordTurnUsage(t),setGenAiUsage(n.span,t.usage),t.responseId!==void 0&&n.span.setAttribute(`gen_ai.response.id`,t.responseId),t.responseModelId!==void 0&&n.span.setAttribute(`gen_ai.response.model`,t.responseModelId),n.span.setAttribute(`gen_ai.response.finish_reasons`,[t.finishReason]);let i=o.get(t.scope);if(i!==void 0&&setAgentUsage(i.span,t.usage),r){n.span.setAttribute(`ai.response.finish_reason`,t.finishReason);let r=t.content;if(r===void 0){n.span.end();return}let i=genAiOutputMessagesAttribute(r,t.finishReason);i!==void 0&&(n.span.setAttribute(`gen_ai.output.messages`,i),await rememberTurnOutputMessages(e.stateStore,t.scope,i));let a=textContentAttribute(r.filter(e=>e.type===`reasoning`).map(e=>e.text).filter(e=>e.trim().length>0).join(`
2
+ `));a!==void 0&&n.span.setAttribute(`ai.response.reasoning`,a);let o=textContentAttribute(r.filter(e=>e.type===`text`).map(e=>e.text).join(``));o!==void 0&&n.span.setAttribute(`ai.response.text`,o);let s=r.filter(e=>e.type===`tool-call`).map(e=>({callId:e.callId,input:e.input,toolName:e.toolName}));if(s.length>0){let e=contentAttribute(s);e!==void 0&&n.span.setAttribute(`ai.response.tool_calls`,e)}let c=r.filter(e=>e.type===`tool-result`||e.type===`tool-error`).map(e=>e.type===`tool-result`?{callId:e.callId,input:e.input,output:e.output,toolName:e.toolName}:{callId:e.callId,error:errorText(e.error),input:e.input,toolName:e.toolName});if(c.length>0){let e=toolResultsContentAttribute(c);e!==void 0&&n.span.setAttribute(`ai.response.tool_results`,e)}}}n.span.end()}},recordTurnUsage=async t=>{(t.usage.inputTokens!==void 0||t.usage.outputTokens!==void 0)&&await e.stateStore.updateTurn(t.scope.sessionId,t.scope.turnId,e=>({...e,modelUsage:{inputTokens:t.usage.inputTokens===void 0?e.modelUsage?.inputTokens:(e.modelUsage?.inputTokens??0)+t.usage.inputTokens,outputTokens:t.usage.outputTokens===void 0?e.modelUsage?.outputTokens:(e.modelUsage?.outputTokens??0)+t.usage.outputTokens}}))},p=createAgentChannelDeliveryInstrumentation({recordInputs:n,stateStore:e.stateStore}),onStepMetadata=e=>{let t=o.get(e.scope);if(t===void 0)return;let n=readGatewayCost(e.providerMetadata);if(n!==void 0)for(let[e,r]of Object.entries(n))t.span.setAttribute(e,r)};return{hook:{events:{...p,...l,...u.events,"step.attempt.completed":onStepTerminal,"step.attempt.failed":onStepTerminal,"step.attempt.metadata":onStepMetadata,"step.attempt.started":onStepStarted,"model.call.completed":onModelCallTerminal,"model.call.failed":onModelCallTerminal,"model.call.started":onModelCallStarted,"session.completed":onSessionTransition,"session.failed":onSessionTransition,"session.started":onSessionStarted,"session.waiting":onSessionTransition,...c.events,"turn.cancelled":onTurnTerminal,"turn.completed":onTurnTerminal,"turn.failed":onTurnTerminal,"turn.started":onTurnStarted},name:`eve.otel`,projectEvent,tracePolicy:()=>({emit:!0,recordInputs:n,recordOutputs:r})},prepareSessionTrace:d,prepareTurnTrace:f,async runInContext(o,s){if(o.type===`memory.operation`)return u.runInContext(o,s);let l=a.get(o.scope.attemptId)??o.scope,d=i.get(l),f=o.type===`model.call`?d?.get(o.idempotencyKey):c.contextFor(o.scope.attemptId,o.idempotencyKey);if(f===void 0){let t=await e.stateStore.getTurn(o.scope.sessionId,o.scope.turnId);t!==void 0&&(f=withChannelAudience(contextFromSpanContext(t.context),o.scope.channelAudience),isSampledTrace(t.context)||(f=suppressTracing(f)))}let p=await e.stateStore.getSession(o.scope.sessionId),m=resolveForwardedTraceSeed(contextStorage.getStore()?.get(SessionTraceSeedKey)),h=m?.decision??p?.decision,g=h===void 0?void 0:applyLiveDeliveryAudienceCeiling(h,normalizeChannelAudience(o.scope.channelAudience),m?.forwardedTracePolicy,t),_={recordInputs:n&&g?.action===`record`&&g.recordInputs,recordOutputs:r&&g?.action===`record`&&g.recordOutputs},run=e=>{let t=e??f;if(t===void 0)return s();let n=withErrorContent(t,_.recordOutputs),r=o.type===`tool.call`?withAgentToolContentPolicy(n,_):n;return context.with(markAgentTraceContext(withOperationConversation(r,o.scope)),s)};return o.type===`tool.call`?c.runInContext({...o,input:_.recordInputs?o.input:void 0},run,_.recordOutputs):run(void 0)}};function getExecutionContexts(e){let t=i.get(e);return t===void 0&&(t=new Map,i.set(e,t)),t}function drainOpenSpans(e){for(let t of s.get(e.scope)?.values()??[])e.type===`step.attempt.failed`&&recordAgentSpanError(t.span,e.error),t.span.end();s.delete(e.scope)}}function agentActivationLinks(e){let t=[];return e.caller?.isRemote===!0&&t.push({context:e.caller,attributes:{"eve.link.type":`agent.dispatch`}}),e.channelDelivery?.requestTraceContext!==void 0&&t.push({context:e.channelDelivery.requestTraceContext,attributes:{"eve.link.type":`channel.request`}}),t.length===0?void 0:t}function sessionIdForEvent(e){return`scope`in e?e.scope.sessionId:e.sessionId}function audienceForEvent(e,t){return`delivery`in e?normalizeChannelAudience(e.delivery.channelAudience):`scope`in e&&e.scope.channelAudience!==void 0?normalizeChannelAudience(e.scope.channelAudience):e.type===`session.started`?normalizeChannelAudience(e.channelAudience):normalizeChannelAudience(t)}function getSpanStates(e,t){let n=e.get(t);return n===void 0&&(n=new Map,e.set(t,n)),n}function takeSpanState(e,t,n){let r=e.get(t),i=r?.get(n);if(r!==void 0)return r.delete(n),r.size===0&&e.delete(t),i}function contextFromSpanContext(e){return trace.setSpan(ROOT_CONTEXT,trace.wrapSpanContext(e))}const errorText=e=>e instanceof Error?e.message:e;export{createAgentOtelInstrumentation};
@@ -28,6 +28,7 @@ export declare function agentStepAttributes(input: {
28
28
  "agent.step.index": number;
29
29
  "agent.turn.id": string;
30
30
  "agent.name": string | undefined;
31
+ "gen_ai.operation.name": string;
31
32
  };
32
33
  export declare function agentPrincipalAttributes(turn: AgentTurnTraceState): Record<string, string>;
33
34
  /** Flattens merged runtime context into AI SDK-compatible span attributes. */
@@ -1 +1 @@
1
- import{normalizeInstrumentationChannelKind}from"#internal/instrumentation.js";import{agentInvocationSpanName}from"#tracing/agent-span-contract.js";import{agentSpanNamingAttributes}from"#tracing/agent-span-naming.js";import{agentTraceIdentityAttributes,traceSessionIdOf}from"#tracing/agent-otel-attributes.js";function agentActivationAttributes(e){let t=e.session?.decision?.action===`record`,n=t&&e.session?.decision?.recordInputs===!0,r=t&&e.session?.decision?.recordOutputs===!0,i=e.turn.parentLineage??e.session?.parentLineage,a=i!==void 0,o=!a||e.turn.traceSessionId===e.sessionId,s=agentChannelClassificationAttributes(e.session,e.turn,e.sessionId),c=a?void 0:e.session?.scheduleId;return{"agent.framework.name":`eve`,"agent.framework.version":e.frameworkVersion,"agent.name":e.agentName,"agent.channel.audience":e.session?.channelAudience,...agentPrincipalAttributes(e.turn),"agent.channel.delivery.id":e.turn.channelDelivery?.deliveryId,"agent.channel.delivery.input":e.turn.channelDelivery?.inputAttribute,...s,"agent.channel.name":e.turn.channelDelivery?.channelName,"agent.channel.request.id":e.turn.channelDelivery?.requestId,"agent.parent_call.id":i?.callId,"agent.parent_run.id":i?.sessionId,"agent.run.type":a?`subagent`:`session`,"agent.schedule.id":c,"agent.session.title":o&&n?e.session?.title:void 0,"agent.subagent.name":e.turn.subagentName,"agent.trace.content.input":n,"agent.trace.content.output":r,"agent.turn.id":e.turnId,"agent.turn.sequence":e.turn.sequence,"gen_ai.agent.name":e.agentName,"gen_ai.operation.name":`invoke_agent`,...agentSpanNamingAttributes(agentInvocationSpanName(e.agentName),`invoke_agent`),...agentTraceIdentityAttributes({rootSessionId:e.turn.rootSessionId,traceSessionId:e.turn.traceSessionId,sessionId:e.sessionId})}}function agentChannelClassificationAttributes(e,t,n){let r=(t.parentLineage??e?.parentLineage)===void 0||t.traceSessionId===n,i=t.channelDelivery?.channelKind??(r?e?.channelKind??(e?.channelType===void 0?void 0:normalizeInstrumentationChannelKind(e.channelType)):void 0);return{"agent.channel.kind":i,"agent.session.origin":!r||i===void 0?void 0:e?.scheduleId===void 0?`channel`:`schedule`}}function agentStepAttributes(e){let{event:t,session:n,turn:r}=e,i=agentChannelClassificationAttributes(n,r,t.scope.sessionId);return{"agent.framework.name":`eve`,"agent.framework.version":e.frameworkVersion,"agent.step.attempt":t.scope.attemptIndex,"agent.step.index":t.scope.stepIndex,"agent.turn.id":t.scope.turnId,"agent.name":t.scope.functionId,...i[`agent.channel.kind`]===`unknown`?void 0:i,...agentSpanNamingAttributes(`agent.step`),...agentTraceIdentityAttributes({rootSessionId:t.scope.rootSessionId??t.scope.sessionId,traceSessionId:traceSessionIdOf(t.scope),sessionId:t.scope.sessionId}),...runtimeContextAttributes(t.runtimeContext)}}function agentPrincipalAttributes(e){let t={};return setOptionalAttribute(t,`agent.principal.current.id`,e.currentPrincipal?.id),setOptionalAttribute(t,`agent.principal.current.type`,e.currentPrincipal?.type),setOptionalAttribute(t,`agent.principal.initiator.id`,e.initiatorPrincipal?.id),setOptionalAttribute(t,`agent.principal.initiator.type`,e.initiatorPrincipal?.type),t}function runtimeContextAttributes(e){let t={};if(e===void 0)return t;for(let[n,r]of Object.entries(e))flattenContextAttribute(t,`ai.settings.context.${n}`,r);return t}function flattenContextAttribute(e,t,n){if(n!=null){if(typeof n==`string`||typeof n==`number`||typeof n==`boolean`){e[t]=n;return}if(Array.isArray(n)){let r=n.filter(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`);if(r.length!==n.length||new Set(r.map(e=>typeof e)).size!==1)return;e[t]=r;return}if(typeof n==`object`)for(let[r,i]of Object.entries(n))flattenContextAttribute(e,`${t}.${r}`,i)}}function setOptionalAttribute(e,t,n){n!==void 0&&(e[t]=n)}export{agentActivationAttributes,agentChannelClassificationAttributes,agentPrincipalAttributes,agentStepAttributes,runtimeContextAttributes};
1
+ import{normalizeInstrumentationChannelKind}from"#internal/instrumentation.js";import{agentInvocationSpanName}from"#tracing/agent-span-contract.js";import{agentSpanNamingAttributes}from"#tracing/agent-span-naming.js";import{agentTraceIdentityAttributes,traceSessionIdOf}from"#tracing/agent-otel-attributes.js";function agentActivationAttributes(e){let t=e.session?.decision?.action===`record`,n=t&&e.session?.decision?.recordInputs===!0,r=t&&e.session?.decision?.recordOutputs===!0,i=e.turn.parentLineage??e.session?.parentLineage,a=i!==void 0,o=!a||e.turn.traceSessionId===e.sessionId,s=agentChannelClassificationAttributes(e.session,e.turn,e.sessionId),c=a?void 0:e.session?.scheduleId;return{"agent.framework.name":`eve`,"agent.framework.version":e.frameworkVersion,"agent.name":e.agentName,"agent.channel.audience":e.session?.channelAudience,...agentPrincipalAttributes(e.turn),"agent.channel.delivery.id":e.turn.channelDelivery?.deliveryId,"agent.channel.delivery.input":e.turn.channelDelivery?.inputAttribute,...s,"agent.channel.name":e.turn.channelDelivery?.channelName,"agent.channel.request.id":e.turn.channelDelivery?.requestId,"agent.parent_call.id":i?.callId,"agent.parent_run.id":i?.sessionId,"agent.run.type":a?`subagent`:`session`,"agent.schedule.id":c,"agent.session.title":o&&n?e.session?.title:void 0,"agent.subagent.name":e.turn.subagentName,"agent.trace.content.input":n,"agent.trace.content.output":r,"agent.turn.id":e.turnId,"agent.turn.sequence":e.turn.sequence,"gen_ai.agent.name":e.agentName,"gen_ai.input.messages":e.turn.inputMessagesAttribute,"gen_ai.operation.name":`invoke_agent`,"gen_ai.output.messages":e.turn.outputMessagesAttribute,...agentSpanNamingAttributes(agentInvocationSpanName(e.agentName),`invoke_agent`),...agentTraceIdentityAttributes({rootSessionId:e.turn.rootSessionId,traceSessionId:e.turn.traceSessionId,sessionId:e.sessionId})}}function agentChannelClassificationAttributes(e,t,n){let r=(t.parentLineage??e?.parentLineage)===void 0||t.traceSessionId===n,i=t.channelDelivery?.channelKind??(r?e?.channelKind??(e?.channelType===void 0?void 0:normalizeInstrumentationChannelKind(e.channelType)):void 0);return{"agent.channel.kind":i,"agent.session.origin":!r||i===void 0?void 0:e?.scheduleId===void 0?`channel`:`schedule`}}function agentStepAttributes(e){let{event:t,session:n,turn:r}=e,i=agentChannelClassificationAttributes(n,r,t.scope.sessionId);return{"agent.framework.name":`eve`,"agent.framework.version":e.frameworkVersion,"agent.step.attempt":t.scope.attemptIndex,"agent.step.index":t.scope.stepIndex,"agent.turn.id":t.scope.turnId,"agent.name":t.scope.functionId,...i[`agent.channel.kind`]===`unknown`?void 0:i,"gen_ai.operation.name":`workflow`,...agentSpanNamingAttributes(`agent.step`,`workflow`),...agentTraceIdentityAttributes({rootSessionId:t.scope.rootSessionId??t.scope.sessionId,traceSessionId:traceSessionIdOf(t.scope),sessionId:t.scope.sessionId}),...runtimeContextAttributes(t.runtimeContext)}}function agentPrincipalAttributes(e){let t={};return setOptionalAttribute(t,`agent.principal.current.id`,e.currentPrincipal?.id),setOptionalAttribute(t,`agent.principal.current.type`,e.currentPrincipal?.type),setOptionalAttribute(t,`agent.principal.initiator.id`,e.initiatorPrincipal?.id),setOptionalAttribute(t,`agent.principal.initiator.type`,e.initiatorPrincipal?.type),t}function runtimeContextAttributes(e){let t={};if(e===void 0)return t;for(let[n,r]of Object.entries(e))flattenContextAttribute(t,`ai.settings.context.${n}`,r);return t}function flattenContextAttribute(e,t,n){if(n!=null){if(typeof n==`string`||typeof n==`number`||typeof n==`boolean`){e[t]=n;return}if(Array.isArray(n)){let r=n.filter(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`);if(r.length!==n.length||new Set(r.map(e=>typeof e)).size!==1)return;e[t]=r;return}if(typeof n==`object`)for(let[r,i]of Object.entries(n))flattenContextAttribute(e,`${t}.${r}`,i)}}function setOptionalAttribute(e,t,n){n!==void 0&&(e[t]=n)}export{agentActivationAttributes,agentChannelClassificationAttributes,agentPrincipalAttributes,agentStepAttributes,runtimeContextAttributes};
@@ -0,0 +1,6 @@
1
+ import type { InstrumentationAttemptScope } from "#instrumentation/lifecycle.js";
2
+ import type { AgentTraceStateStore } from "#tracing/agent-trace-state.js";
3
+ /** Keeps the first model input so the turn-level invoke_agent span represents its task. */
4
+ export declare function rememberTurnInputMessages(store: AgentTraceStateStore, scope: InstrumentationAttemptScope, inputMessagesAttribute: string | undefined): void | PromiseLike<void>;
5
+ /** Keeps the latest model output so the completed invoke_agent span represents its result. */
6
+ export declare function rememberTurnOutputMessages(store: AgentTraceStateStore, scope: InstrumentationAttemptScope, outputMessagesAttribute: string | undefined): void | PromiseLike<void>;
@@ -0,0 +1 @@
1
+ function rememberTurnInputMessages(e,t,n){if(n!==void 0)return e.updateTurn(t.sessionId,t.turnId,e=>({...e,inputMessagesAttribute:e.inputMessagesAttribute??n}))}function rememberTurnOutputMessages(e,t,n){if(n!==void 0)return e.updateTurn(t.sessionId,t.turnId,e=>({...e,outputMessagesAttribute:n}))}export{rememberTurnInputMessages,rememberTurnOutputMessages};
@@ -1 +1 @@
1
- import{normalizeChannelAudience}from"#shared/channel-audience.js";import{isSampledTrace}from"#tracing/sampled-trace.js";import{ROOT_CONTEXT,SpanKind,trace}from"#compiled/@opentelemetry/api/index.js";import{actionIdempotencyKey,attemptIdempotencyKey}from"#instrumentation/lifecycle.js";import{agentSpanNamingAttributes}from"#tracing/agent-span-naming.js";import{contentAttribute,textContentAttribute}from"#tracing/agent-otel-content.js";import{recordAgentSpanError}from"#tracing/agent-span-error.js";import{withAgentToolSpanContext}from"#tracing/agent-tool-span-context.js";import{agentTraceIdentityAttributes,traceSessionIdOf}from"#tracing/agent-otel-attributes.js";import{withChannelAudience}from"#tracing/channel-audience-context.js";import{setAgentUsage}from"#tracing/agent-otel-usage.js";function createAgentToolInstrumentation(e){let t=new Map,n=new Map,r=new Map;async function dispatchContextFor(t,n,r){let i=await e.stateStore.getAction(actionIdempotencyKey(t,n,r))??await e.stateStore.findAction(t,r);if(i===void 0)return;let a={isRemote:!1,spanId:i.spanId,traceFlags:i.parent.traceFlags,traceId:i.parent.traceId};return{context:withChannelAudience(contextFromSpanContext(a),i.channelAudience),spanContext:a}}async function onDispatchStarted(n){let i=await e.resolveTraceContext(n);if(i===void 0||!isSampledTrace(i))return;let a=await e.stateStore.getAction(n.idempotencyKey)??{attemptIndex:n.scope.attemptIndex,callId:n.callId,channelAudience:normalizeChannelAudience(n.scope.channelAudience),inputAttribute:e.recordInputs?contentAttribute(n.input):void 0,kind:n.kind??`tool-call`,name:n.toolName,toolAttributes:{"agent.tool.is_framework":n.frameworkTool===!0},parent:{spanId:e.idGenerator.deriveSpanId(n.parentCallId===void 0?attemptIdempotencyKey(n.scope):`action:${actionIdempotencyKey(n.scope.sessionId,n.scope.turnId,n.parentCallId)}`),traceFlags:i.traceFlags,traceId:i.traceId},parentCallId:n.parentCallId,rootSessionId:n.scope.rootSessionId??n.scope.sessionId,traceSessionId:traceSessionIdOf(n.scope),sessionId:n.scope.sessionId,spanId:e.idGenerator.deriveSpanId(`action:${n.idempotencyKey}`),startTimeMs:Math.min(n.startedAtMs??Date.now(),t.get(n.idempotencyKey)?.startTimeMs??1/0),stepIndex:n.scope.stepIndex,turnId:n.scope.turnId};await e.stateStore.setAction(n.idempotencyKey,a),n.isWorkflowTool===!0&&await e.stateStore.setActionAnchor(n.idempotencyKey,a);let o=r.get(n.scope.attemptId)??new Set;o.add(n.idempotencyKey),r.set(n.scope.attemptId,o);let s=t.get(n.idempotencyKey);s!==void 0&&s.finished!==!0&&(await correlate(s),finishIfReady(s))}async function onDispatchTerminal(t){let n=await e.stateStore.getAction(t.idempotencyKey);if(n!==void 0)try{let r=startDispatchSpan(n),i=t.outcome??(t.type===`tool.call.failed`?`failed`:`completed`);if(r.setAttribute(`agent.action.outcome`,n.toolFailed===!0&&i===`completed`?`failed`:i),t.usage!==void 0&&setAgentUsage(r,t.usage),t.type===`tool.call.failed`)recordToolError(r,t.error,t.errorCode);else if(t.output.type===`error`)recordToolError(r,t.output.error);else if(n.toolFailed===!0)recordToolError(r,n.toolErrorAttribute,typeof n.toolAttributes?.[`error.type`]==`string`?n.toolAttributes[`error.type`]:void 0);else if(e.recordOutputs){let e=contentAttribute(t.output.output);e!==void 0&&r.setAttribute(`gen_ai.tool.call.result`,e)}r.end(t.acceptedAtMs??n.toolEndTimeMs)}finally{await e.stateStore.deleteAction(t.idempotencyKey);for(let[e,n]of r)n.delete(t.idempotencyKey),n.size===0&&r.delete(e)}}function startDispatchSpan(t){let n=t.kind===`subagent-call`||t.kind===`remote-agent-call`,r=e.idGenerator.withSpanId(t.spanId,()=>e.tracer.startSpan(`execute_tool ${t.name}`,{attributes:{"agent.action.kind":t.kind,"agent.action.name":t.name,...t.parentCallId===void 0?void 0:{"agent.action.parent_call_id":t.parentCallId},"gen_ai.operation.name":`execute_tool`,"gen_ai.tool.call.id":t.callId,"gen_ai.tool.name":t.name,"gen_ai.tool.type":`function`,"agent.framework.name":`eve`,"agent.framework.version":e.frameworkVersion,"agent.step.attempt":t.attemptIndex,"agent.step.index":t.stepIndex,"agent.turn.id":t.turnId,...agentSpanNamingAttributes(`execute_tool ${t.name}`,`execute_tool`),...agentTraceIdentityAttributes({rootSessionId:t.rootSessionId,traceSessionId:t.traceSessionId,sessionId:t.sessionId}),...n?{"gen_ai.agent.name":t.name,"agent.invocation.role":`caller`}:void 0,...t.toolAttributes},kind:t.kind===`remote-agent-call`?SpanKind.CLIENT:SpanKind.INTERNAL,startTime:t.startTimeMs},withChannelAudience(contextFromSpanContext({...t.parent,isRemote:!1}),t.channelAudience)));return t.inputAttribute!==void 0&&r.setAttribute(`gen_ai.tool.call.arguments`,t.inputAttribute),r}let onStarted=async t=>{if(n.get(t.scope.attemptId)?.has(t.idempotencyKey))return;let r=actionIdempotencyKey(t.scope.sessionId,t.scope.turnId,t.callId),i=e.resolveFallback(t),a=i===void 0?void 0:reserve(t,r,i),o=await dispatchContextFor(t.scope.sessionId,t.scope.turnId,t.callId);if(a===void 0){if(o===void 0)return;a=reserve(t,r,o)}o!==void 0&&await correlate(a)},onTerminal=async e=>{let t=n.get(e.scope.attemptId)?.get(e.idempotencyKey);t!==void 0&&(t.terminal=e,t.span===void 0&&await dispatchContextFor(t.event.scope.sessionId,t.event.scope.turnId,t.event.callId)!==void 0&&await correlate(t),finishIfReady(t))};return{dispatchContextFor,async deleteForSession(t){await e.stateStore.deleteActions(t),await e.stateStore.deleteActionAnchors(t)},async failForAttempt(t,n){let i=r.get(t.attemptId);r.delete(t.attemptId);for(let t of i??[]){let r=await e.stateStore.getAction(t);if(r===void 0)continue;let i=startDispatchSpan(r);recordAgentSpanError(i,n),i.end(),await e.stateStore.deleteAction(t)}},contextFor:(e,t)=>n.get(e)?.get(t)?.context,drain(e,t){let r=n.get(e);if(r!==void 0){for(let e of r.values())e.finished!==!0&&(e.span===void 0&&e.correlated!==!0&&startSpan(e,e.fallbackParent),finish(e,t));n.delete(e)}},events:{"tool.call.completed":onDispatchTerminal,"tool.call.failed":onDispatchTerminal,"tool.call.started":onDispatchStarted},async runInContext(e,t,r){if(e.callId===void 0||e.toolName===void 0)return t(n.get(e.scope.attemptId)?.get(e.idempotencyKey)?.context);await onStarted({...e,callId:e.callId,toolName:e.toolName,input:e.input,type:`tool.call.started`});let i=n.get(e.scope.attemptId)?.get(e.idempotencyKey),a=e.startedAtMs??Date.now();try{let n=await t(i?.context);return await onTerminal({type:e.failed?`tool.call.failed`:`tool.call.completed`,idempotencyKey:e.idempotencyKey,scope:e.scope,completedAtMs:e.completedAtMs??Date.now(),durationMs:(e.completedAtMs??Date.now())-a,output:{type:`result`,output:r?n:void 0}}),n}catch(t){throw await onTerminal({type:`tool.call.failed`,idempotencyKey:e.idempotencyKey,scope:e.scope,completedAtMs:Date.now(),error:r?t:void 0}),t}}};function getAttemptStates(e){let t=n.get(e);return t===void 0&&(t=new Map,n.set(e,t)),t}function reserve(n,r,i){let a=e.idGenerator.deriveSpanId(`action:${r}`),o={actionKey:r,attemptId:n.scope.attemptId,additionalAttributes:{},context:withChannelAudience(contextFromSpanContext({isRemote:!1,spanId:a,traceFlags:i.spanContext.traceFlags,traceId:i.spanContext.traceId}),n.scope.channelAudience),event:n,fallbackParent:i.context,idempotencyKey:n.idempotencyKey,spanId:a,startTimeMs:n.startedAtMs??Date.now()};return o.context=withAgentToolSpanContext(o.context,{recordInputs:e.recordInputs,recordOutputs:e.recordOutputs,setAttributes(e){if(Object.assign(o.additionalAttributes,e),o.span!==void 0)for(let[t,n]of Object.entries(e))n!==void 0&&o.span.setAttribute(t,n)},recordError(e,t){o.pendingError={error:e,errorType:t},o.span!==void 0&&recordAgentSpanError(o.span,e,t)}}),getAttemptStates(n.scope.attemptId).set(n.idempotencyKey,o),t.set(r,o),o}function startSpan(t,n){if(t.span===void 0&&t.finished!==!0&&(t.span=e.idGenerator.withSpanId(t.spanId,()=>e.tracer.startSpan(`execute_tool ${t.event.toolName}`,{attributes:{...toolAttributes(t.event),...t.additionalAttributes},kind:SpanKind.INTERNAL,startTime:t.startTimeMs},n)),t.pendingError!==void 0&&recordAgentSpanError(t.span,t.pendingError.error,t.pendingError.errorType),e.recordInputs)){let e=contentAttribute(t.event.input);e!==void 0&&t.span.setAttribute(`gen_ai.tool.call.arguments`,e)}}function finishIfReady(e){e.span===void 0&&e.correlated!==!0||e.terminal===void 0||finish(e)}async function correlate(t){let n=await e.stateStore.getAction(t.actionKey)??await e.stateStore.findAction(t.event.scope.sessionId,t.event.callId);if(n===void 0)return;t.correlated=!0,t.context=trace.setSpan(t.context,trace.wrapSpanContext({isRemote:!1,spanId:n.spanId,traceFlags:n.parent.traceFlags,traceId:n.parent.traceId}));let r=t.terminal,i=t.pendingError!==void 0||r?.type===`tool.call.failed`||r?.output.type===`error`,a=t.pendingError?.error??(r?.type===`tool.call.failed`?r.error:r?.output.type===`error`?r.output.error:void 0),o={...n.toolAttributes,...t.event.scope.functionId===void 0||n.kind===`subagent-call`||n.kind===`remote-agent-call`?void 0:{"gen_ai.agent.name":t.event.scope.functionId},"agent.tool.is_framework":t.event.frameworkTool===!0,...t.additionalAttributes,...t.pendingError?.errorType===void 0?void 0:{"error.type":t.pendingError.errorType},...r?.type===`tool.call.completed`&&r.durationMs!==void 0?{"gen_ai.execute_tool.duration":r.durationMs/1e3}:void 0};await e.stateStore.setAction(actionIdempotencyKey(n.sessionId,n.turnId,n.callId),{...n,startTimeMs:Math.min(n.startTimeMs,t.startTimeMs),toolAttributes:o,toolEndTimeMs:r?.completedAtMs??n.toolEndTimeMs,toolFailed:i||n.toolFailed,toolErrorAttribute:e.recordOutputs&&a!==void 0?contentAttribute(a instanceof Error?a.message:a):n.toolErrorAttribute})}function finish(t,n){let r=t.span;if(t.finished===!0)return;if(t.correlated===!0){t.finished=!0,forget(t);return}if(r===void 0)return;t.finished=!0;let i=t.terminal;if(i?.type===`tool.call.completed`&&i.durationMs!==void 0&&r.setAttribute(`gen_ai.execute_tool.duration`,i.durationMs/1e3),n!==void 0)recordAgentSpanError(r,n.error);else if(i?.type===`tool.call.failed`)recordAgentSpanError(r,i.error);else if(i?.output.type===`error`)recordAgentSpanError(r,i.output.error);else if(i!==void 0&&e.recordOutputs){let e=contentAttribute(i.output.output);e!==void 0&&r.setAttribute(`gen_ai.tool.call.result`,e)}r.end(i?.completedAtMs),forget(t)}function forget(e){t.delete(e.actionKey);let r=n.get(e.attemptId);r?.delete(e.idempotencyKey),r?.size===0&&n.delete(e.attemptId)}}function toolAttributes(e){return{"agent.tool.is_framework":e.frameworkTool===!0,...e.scope.functionId===void 0?{}:{"gen_ai.agent.name":e.scope.functionId},"gen_ai.operation.name":`execute_tool`,"gen_ai.tool.call.id":e.callId,"gen_ai.tool.name":e.toolName,"gen_ai.tool.type":`function`,...agentSpanNamingAttributes(`execute_tool ${e.toolName}`,`execute_tool`),...agentTraceIdentityAttributes({rootSessionId:e.scope.rootSessionId??e.scope.sessionId,traceSessionId:traceSessionIdOf(e.scope),sessionId:e.scope.sessionId})}}function contextFromSpanContext(e){return trace.setSpan(ROOT_CONTEXT,trace.wrapSpanContext(e))}function recordToolError(e,t,n){if(t instanceof Error||t===void 0){recordAgentSpanError(e,t,n);return}let r=typeof t==`string`?textContentAttribute(t):contentAttribute(t),i=typeof t==`object`&&t&&!Array.isArray(t)?Reflect.get(t,`message`):void 0,a=typeof i==`string`?textContentAttribute(r===void 0?i:`${i}\n${r}`):r,o=a===void 0?void 0:Error(a);o!==void 0&&n!==void 0&&(o.name=n),recordAgentSpanError(e,o,n)}export{createAgentToolInstrumentation};
1
+ import{normalizeChannelAudience}from"#shared/channel-audience.js";import{isSampledTrace}from"#tracing/sampled-trace.js";import{ROOT_CONTEXT,SpanKind,trace}from"#compiled/@opentelemetry/api/index.js";import{actionIdempotencyKey,attemptIdempotencyKey}from"#instrumentation/lifecycle.js";import{agentSpanNamingAttributes}from"#tracing/agent-span-naming.js";import{contentAttribute,textContentAttribute}from"#tracing/agent-otel-content.js";import{recordAgentSpanError}from"#tracing/agent-span-error.js";import{withAgentToolSpanContext}from"#tracing/agent-tool-span-context.js";import{agentTraceIdentityAttributes,traceSessionIdOf}from"#tracing/agent-otel-attributes.js";import{withChannelAudience}from"#tracing/channel-audience-context.js";import{setAgentUsage}from"#tracing/agent-otel-usage.js";function createAgentToolInstrumentation(e){let t=new Map,n=new Map,r=new Map;async function dispatchContextFor(t,n,r){let i=await e.stateStore.getAction(actionIdempotencyKey(t,n,r))??await e.stateStore.findAction(t,r);if(i===void 0)return;let a={isRemote:!1,spanId:i.spanId,traceFlags:i.parent.traceFlags,traceId:i.parent.traceId};return{context:withChannelAudience(contextFromSpanContext(a),i.channelAudience),spanContext:a}}async function onDispatchStarted(n){let i=await e.resolveTraceContext(n);if(i===void 0||!isSampledTrace(i))return;let a=await e.stateStore.getAction(n.idempotencyKey)??{attemptIndex:n.scope.attemptIndex,callId:n.callId,channelAudience:normalizeChannelAudience(n.scope.channelAudience),inputAttribute:e.recordInputs?contentAttribute(n.input):void 0,kind:n.kind??`tool-call`,name:n.toolName,toolAttributes:{"agent.tool.is_framework":n.frameworkTool===!0},parent:{spanId:e.idGenerator.deriveSpanId(attemptIdempotencyKey(n.scope)),traceFlags:i.traceFlags,traceId:i.traceId},rootSessionId:n.scope.rootSessionId??n.scope.sessionId,traceSessionId:traceSessionIdOf(n.scope),sessionId:n.scope.sessionId,spanId:e.idGenerator.deriveSpanId(`action:${n.idempotencyKey}`),startTimeMs:Math.min(n.startedAtMs??Date.now(),t.get(n.idempotencyKey)?.startTimeMs??1/0),stepIndex:n.scope.stepIndex,turnId:n.scope.turnId};await e.stateStore.setAction(n.idempotencyKey,a),n.isWorkflowTool===!0&&await e.stateStore.setActionAnchor(n.idempotencyKey,a);let o=r.get(n.scope.attemptId)??new Set;o.add(n.idempotencyKey),r.set(n.scope.attemptId,o);let s=t.get(n.idempotencyKey);s!==void 0&&s.finished!==!0&&(await correlate(s),finishIfReady(s))}async function onDispatchTerminal(t){let n=await e.stateStore.getAction(t.idempotencyKey);if(n!==void 0)try{let r=startDispatchSpan(n),i=t.outcome??(t.type===`tool.call.failed`?`failed`:`completed`);if(r.setAttribute(`agent.action.outcome`,n.toolFailed===!0&&i===`completed`?`failed`:i),t.usage!==void 0&&setAgentUsage(r,t.usage),t.type===`tool.call.failed`)recordToolError(r,t.error,t.errorCode);else if(t.output.type===`error`)recordToolError(r,t.output.error);else if(n.toolFailed===!0)recordToolError(r,n.toolErrorAttribute,typeof n.toolAttributes?.[`error.type`]==`string`?n.toolAttributes[`error.type`]:void 0);else if(e.recordOutputs){let e=contentAttribute(t.output.output);e!==void 0&&r.setAttribute(`gen_ai.tool.call.result`,e)}r.end(t.acceptedAtMs??n.toolEndTimeMs)}finally{await e.stateStore.deleteAction(t.idempotencyKey);for(let[e,n]of r)n.delete(t.idempotencyKey),n.size===0&&r.delete(e)}}function startDispatchSpan(t){let n=t.kind===`subagent-call`||t.kind===`remote-agent-call`,r=e.idGenerator.withSpanId(t.spanId,()=>e.tracer.startSpan(`execute_tool ${t.name}`,{attributes:{"agent.action.kind":t.kind,"agent.action.name":t.name,"gen_ai.operation.name":`execute_tool`,"gen_ai.tool.call.id":t.callId,"gen_ai.tool.name":t.name,"gen_ai.tool.type":`function`,"agent.framework.name":`eve`,"agent.framework.version":e.frameworkVersion,"agent.step.attempt":t.attemptIndex,"agent.step.index":t.stepIndex,"agent.turn.id":t.turnId,...agentSpanNamingAttributes(`execute_tool ${t.name}`,`execute_tool`),...agentTraceIdentityAttributes({rootSessionId:t.rootSessionId,traceSessionId:t.traceSessionId,sessionId:t.sessionId}),...n?{"gen_ai.agent.name":t.name,"agent.invocation.role":`caller`}:void 0,...t.toolAttributes},kind:t.kind===`remote-agent-call`?SpanKind.CLIENT:SpanKind.INTERNAL,startTime:t.startTimeMs},withChannelAudience(contextFromSpanContext({...t.parent,isRemote:!1}),t.channelAudience)));return t.inputAttribute!==void 0&&r.setAttribute(`gen_ai.tool.call.arguments`,t.inputAttribute),r}let onStarted=async t=>{if(n.get(t.scope.attemptId)?.has(t.idempotencyKey))return;let r=actionIdempotencyKey(t.scope.sessionId,t.scope.turnId,t.callId),i=e.resolveFallback(t),a=i===void 0?void 0:reserve(t,r,i),o=await dispatchContextFor(t.scope.sessionId,t.scope.turnId,t.callId);if(a===void 0){if(o===void 0)return;a=reserve(t,r,o)}o!==void 0&&await correlate(a)},onTerminal=async e=>{let t=n.get(e.scope.attemptId)?.get(e.idempotencyKey);t!==void 0&&(t.terminal=e,t.span===void 0&&await dispatchContextFor(t.event.scope.sessionId,t.event.scope.turnId,t.event.callId)!==void 0&&await correlate(t),finishIfReady(t))};return{dispatchContextFor,async deleteForSession(t){await e.stateStore.deleteActions(t),await e.stateStore.deleteActionAnchors(t)},async failForAttempt(t,n){let i=r.get(t.attemptId);r.delete(t.attemptId);for(let t of i??[]){let r=await e.stateStore.getAction(t);if(r===void 0)continue;let i=startDispatchSpan(r);recordAgentSpanError(i,n),i.end(),await e.stateStore.deleteAction(t)}},contextFor:(e,t)=>n.get(e)?.get(t)?.context,drain(e,t){let r=n.get(e);if(r!==void 0){for(let e of r.values())e.finished!==!0&&(e.span===void 0&&e.correlated!==!0&&startSpan(e,e.fallbackParent),finish(e,t));n.delete(e)}},events:{"tool.call.completed":onDispatchTerminal,"tool.call.failed":onDispatchTerminal,"tool.call.started":onDispatchStarted},async runInContext(e,t,r){if(e.callId===void 0||e.toolName===void 0)return t(n.get(e.scope.attemptId)?.get(e.idempotencyKey)?.context);await onStarted({...e,callId:e.callId,toolName:e.toolName,input:e.input,type:`tool.call.started`});let i=n.get(e.scope.attemptId)?.get(e.idempotencyKey),a=e.startedAtMs??Date.now();try{let n=await t(i?.context);return await onTerminal({type:e.failed?`tool.call.failed`:`tool.call.completed`,idempotencyKey:e.idempotencyKey,scope:e.scope,completedAtMs:e.completedAtMs??Date.now(),durationMs:(e.completedAtMs??Date.now())-a,output:{type:`result`,output:r?n:void 0}}),n}catch(t){throw await onTerminal({type:`tool.call.failed`,idempotencyKey:e.idempotencyKey,scope:e.scope,completedAtMs:Date.now(),error:r?t:void 0}),t}}};function getAttemptStates(e){let t=n.get(e);return t===void 0&&(t=new Map,n.set(e,t)),t}function reserve(n,r,i){let a=e.idGenerator.deriveSpanId(`action:${r}`),o={actionKey:r,attemptId:n.scope.attemptId,additionalAttributes:{},context:withChannelAudience(contextFromSpanContext({isRemote:!1,spanId:a,traceFlags:i.spanContext.traceFlags,traceId:i.spanContext.traceId}),n.scope.channelAudience),event:n,fallbackParent:i.context,idempotencyKey:n.idempotencyKey,spanId:a,startTimeMs:n.startedAtMs??Date.now()};return o.context=withAgentToolSpanContext(o.context,{recordInputs:e.recordInputs,recordOutputs:e.recordOutputs,setAttributes(e){if(Object.assign(o.additionalAttributes,e),o.span!==void 0)for(let[t,n]of Object.entries(e))n!==void 0&&o.span.setAttribute(t,n)},recordError(e,t){o.pendingError={error:e,errorType:t},o.span!==void 0&&recordAgentSpanError(o.span,e,t)}}),getAttemptStates(n.scope.attemptId).set(n.idempotencyKey,o),t.set(r,o),o}function startSpan(t,n){if(t.span===void 0&&t.finished!==!0&&(t.span=e.idGenerator.withSpanId(t.spanId,()=>e.tracer.startSpan(`execute_tool ${t.event.toolName}`,{attributes:{...toolAttributes(t.event),...t.additionalAttributes},kind:SpanKind.INTERNAL,startTime:t.startTimeMs},n)),t.pendingError!==void 0&&recordAgentSpanError(t.span,t.pendingError.error,t.pendingError.errorType),e.recordInputs)){let e=contentAttribute(t.event.input);e!==void 0&&t.span.setAttribute(`gen_ai.tool.call.arguments`,e)}}function finishIfReady(e){e.span===void 0&&e.correlated!==!0||e.terminal===void 0||finish(e)}async function correlate(t){let n=await e.stateStore.getAction(t.actionKey)??await e.stateStore.findAction(t.event.scope.sessionId,t.event.callId);if(n===void 0)return;t.correlated=!0,t.context=trace.setSpan(t.context,trace.wrapSpanContext({isRemote:!1,spanId:n.spanId,traceFlags:n.parent.traceFlags,traceId:n.parent.traceId}));let r=t.terminal,i=t.pendingError!==void 0||r?.type===`tool.call.failed`||r?.output.type===`error`,a=t.pendingError?.error??(r?.type===`tool.call.failed`?r.error:r?.output.type===`error`?r.output.error:void 0),o={...n.toolAttributes,...t.event.scope.functionId===void 0||n.kind===`subagent-call`||n.kind===`remote-agent-call`?void 0:{"gen_ai.agent.name":t.event.scope.functionId},"agent.tool.is_framework":t.event.frameworkTool===!0,...t.additionalAttributes,...t.pendingError?.errorType===void 0?void 0:{"error.type":t.pendingError.errorType},...r?.type===`tool.call.completed`&&r.durationMs!==void 0?{"gen_ai.execute_tool.duration":r.durationMs/1e3}:void 0};await e.stateStore.setAction(actionIdempotencyKey(n.sessionId,n.turnId,n.callId),{...n,startTimeMs:Math.min(n.startTimeMs,t.startTimeMs),toolAttributes:o,toolEndTimeMs:r?.completedAtMs??n.toolEndTimeMs,toolFailed:i||n.toolFailed,toolErrorAttribute:e.recordOutputs&&a!==void 0?contentAttribute(a instanceof Error?a.message:a):n.toolErrorAttribute})}function finish(t,n){let r=t.span;if(t.finished===!0)return;if(t.correlated===!0){t.finished=!0,forget(t);return}if(r===void 0)return;t.finished=!0;let i=t.terminal;if(i?.type===`tool.call.completed`&&i.durationMs!==void 0&&r.setAttribute(`gen_ai.execute_tool.duration`,i.durationMs/1e3),n!==void 0)recordAgentSpanError(r,n.error);else if(i?.type===`tool.call.failed`)recordAgentSpanError(r,i.error);else if(i?.output.type===`error`)recordAgentSpanError(r,i.output.error);else if(i!==void 0&&e.recordOutputs){let e=contentAttribute(i.output.output);e!==void 0&&r.setAttribute(`gen_ai.tool.call.result`,e)}r.end(i?.completedAtMs),forget(t)}function forget(e){t.delete(e.actionKey);let r=n.get(e.attemptId);r?.delete(e.idempotencyKey),r?.size===0&&n.delete(e.attemptId)}}function toolAttributes(e){return{"agent.tool.is_framework":e.frameworkTool===!0,...e.scope.functionId===void 0?{}:{"gen_ai.agent.name":e.scope.functionId},"gen_ai.operation.name":`execute_tool`,"gen_ai.tool.call.id":e.callId,"gen_ai.tool.name":e.toolName,"gen_ai.tool.type":`function`,...agentSpanNamingAttributes(`execute_tool ${e.toolName}`,`execute_tool`),...agentTraceIdentityAttributes({rootSessionId:e.scope.rootSessionId??e.scope.sessionId,traceSessionId:traceSessionIdOf(e.scope),sessionId:e.scope.sessionId})}}function contextFromSpanContext(e){return trace.setSpan(ROOT_CONTEXT,trace.wrapSpanContext(e))}function recordToolError(e,t,n){if(t instanceof Error||t===void 0){recordAgentSpanError(e,t,n);return}let r=typeof t==`string`?textContentAttribute(t):contentAttribute(t),i=typeof t==`object`&&t&&!Array.isArray(t)?Reflect.get(t,`message`):void 0,a=typeof i==`string`?textContentAttribute(r===void 0?i:`${i}\n${r}`):r,o=a===void 0?void 0:Error(a);o!==void 0&&n!==void 0&&(o.name=n),recordAgentSpanError(e,o,n)}export{createAgentToolInstrumentation};
@@ -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 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,parentCallId:typeof e.parentCallId==`string`?e.parentCallId:void 0,rootSessionId:e.rootSessionId,traceSessionId:decodeTraceSessionId(e),sessionId:e.sessionId,spanId:e.spanId,startTimeMs:e.startTimeMs,stepIndex:e.stepIndex,turnId:e.turnId,toolEndTimeMs:typeof e.toolEndTimeMs==`number`?e.toolEndTimeMs:void 0,toolFailed:e.toolFailed===!0,toolErrorAttribute:typeof e.toolErrorAttribute==`string`?e.toolErrorAttribute:void 0,toolAttributes:isRecord(e.toolAttributes)?Object.fromEntries(Object.entries(e.toolAttributes).filter(e=>{let t=e[1];return typeof t==`string`||typeof t==`number`||typeof t==`boolean`||Array.isArray(t)&&t.every(e=>[`string`,`number`,`boolean`].includes(typeof e))})):void 0}}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
+ 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{CONTENT_ATTRIBUTE_LIMIT}from"#tracing/agent-otel-content.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),inputMessagesAttribute:deserializeContentAttribute(e.inputMessagesAttribute),modelUsage:deserializeModelUsage(e.modelUsage),outputMessagesAttribute:deserializeContentAttribute(e.outputMessagesAttribute),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,toolEndTimeMs:typeof e.toolEndTimeMs==`number`?e.toolEndTimeMs:void 0,toolFailed:e.toolFailed===!0,toolErrorAttribute:typeof e.toolErrorAttribute==`string`?e.toolErrorAttribute:void 0,toolAttributes:isRecord(e.toolAttributes)?Object.fromEntries(Object.entries(e.toolAttributes).filter(e=>{let t=e[1];return typeof t==`string`||typeof t==`number`||typeof t==`boolean`||Array.isArray(t)&&t.every(e=>[`string`,`number`,`boolean`].includes(typeof e))})):void 0}}function deserializeContentAttribute(e){return typeof e==`string`&&e.length<=CONTENT_ATTRIBUTE_LIMIT?e:void 0}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};
@@ -23,10 +23,14 @@ export interface AgentTurnTraceState {
23
23
  readonly currentPrincipal?: InstrumentationPrincipalSummary;
24
24
  readonly initiatorPrincipal?: InstrumentationPrincipalSummary;
25
25
  readonly parentLineage?: InstrumentationParentLineage;
26
+ /** First model input projected onto the turn-level invoke_agent span. */
27
+ readonly inputMessagesAttribute?: string;
26
28
  readonly modelUsage?: {
27
29
  readonly inputTokens?: number;
28
30
  readonly outputTokens?: number;
29
31
  };
32
+ /** Latest model output projected onto the turn-level invoke_agent span. */
33
+ readonly outputMessagesAttribute?: string;
30
34
  readonly rootSessionId: string;
31
35
  readonly sequence: number;
32
36
  readonly startTimeMs: number;
@@ -55,7 +59,6 @@ export interface AgentActionTraceState {
55
59
  readonly kind: InstrumentationToolCallKind;
56
60
  readonly name: string;
57
61
  readonly parent: InstrumentationTraceContext;
58
- readonly parentCallId?: string;
59
62
  readonly rootSessionId: string;
60
63
  readonly sessionId: string;
61
64
  readonly spanId: string;
@@ -1,4 +1,4 @@
1
- import { a as conversationProjection, i as openConversationInputs, n as conversationReducer, o as callStatus, r as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-DK_T88EP.js";
1
+ import { a as conversationProjection, i as openConversationInputs, n as conversationReducer, o as callStatus, r as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-QmriPA-w.js";
2
2
 
3
3
  //#region src/client/tool-call-state.ts
4
4
  function toolCallState(conversation, callId, options = {}) {
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-DK_T88EP.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-QmriPA-w.js";
2
2
 
3
3
  export { useEveAgent };
@@ -358,14 +358,14 @@ it falls back to the World's default retention period.
358
358
 
359
359
  `defineAgent` takes a few more fields, all optional. For the exported types, see the [TypeScript API Reference](./reference/typescript-api).
360
360
 
361
- | Field | Type | Default | Description |
362
- | -------------- | ------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
363
- | `reasoning` | `AgentReasoningDefinition` | provider default | Provider-agnostic reasoning effort forwarded to the agent's turn model calls. |
364
- | `modelOptions` | `AgentModelOptionsDefinition` | none | Provider option overrides forwarded to the model call. |
365
- | `limits` | `AgentLimitsDefinition` | field-specific | Framework-owned runtime limits. Sessions complete after 30 days by default; usage-limit defaults and inheritance are described above. Set a limit to `false` to disable it. |
366
- | `experimental` | `AgentExperimentalDefinition` | unset | Unstable opt-ins. `workflow.world` selects the Workflow world package on the root agent; `workflow.modelCallsPerStep` batches sequential model calls into a wider replay unit; `workflow.retention` controls how long the durable runtime keeps run data. |
367
- | `build` | `{ externalDependencies?: string[] }` | none | Hosted-build packaging controls. `externalDependencies` keeps listed packages external while eve compiles authored modules such as tools and channels, and traces those packages into the hosted output. |
368
- | `tool` | `boolean` | `true` | Exposes this agent to its parent model as a tool. On the root agent, controls the built-in `agent` tool. A subagent with `tool: false` remains callable from authored workflow tools through `ctx.agent()`. |
361
+ | Field | Type | Default | Description |
362
+ | -------------- | ------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
363
+ | `reasoning` | `AgentReasoningDefinition` | provider default | Provider-agnostic reasoning effort forwarded to the agent's turn model calls. |
364
+ | `modelOptions` | `AgentModelOptionsDefinition` | none | Provider option overrides forwarded to the model call. |
365
+ | `limits` | `AgentLimitsDefinition` | field-specific | Framework-owned runtime limits. Sessions complete after 30 days by default; usage-limit defaults and inheritance are described above. Set a limit to `false` to disable it. |
366
+ | `experimental` | `AgentExperimentalDefinition` | unset | Unstable opt-ins. `workflow.world` selects the Workflow world package on the root agent; `workflow.modelCallsPerStep` batches sequential model calls into a wider replay unit; `workflow.retention` controls how long the durable runtime keeps run data. |
367
+ | `build` | `{ externalDependencies?: string[] }` | none | Hosted-build packaging controls. `externalDependencies` keeps listed packages external while eve compiles authored modules such as tools and channels, and traces those packages into the hosted output. |
368
+ | `tool` | `boolean \| "deferred"` | `true` | Exposes this agent to its parent model as a tool. `"deferred"` keeps it out of the model's tool list; the model finds it with `eve__search` and calls it with `eve__tool`. On the root agent, controls the built-in `agent` tool. A subagent with `tool: false` remains callable from authored workflow tools through `ctx.agent()`. |
369
369
 
370
370
  `externalDependencies` is a packaging control only. It keeps selected packages as runtime dependencies in the hosted output; it does not authorize, configure, or review any third-party service those packages may call.
371
371
 
@@ -151,7 +151,7 @@ chatSdkChannel({
151
151
  });
152
152
  ```
153
153
 
154
- Typing indicators post automatically where the adapter supports them: `Working…` on `turn.started`, and tool status on `actions.requested`.
154
+ Typing indicators post automatically where the adapter supports them: `Working…` on `turn.started`, and on `actions.requested`, each call's [label](/docs/tools#label-tool-activity) or a readable form of its name. They leave out the model's own `eve__task_wait` and `eve__task_cancel` calls.
155
155
 
156
156
  ### Optional capabilities degrade gracefully
157
157
 
@@ -14,13 +14,7 @@ Run the guided setup from your agent project:
14
14
  eve add channel/slack
15
15
  ```
16
16
 
17
- The command recommends Vercel Connect, then scaffolds `agent/channels/slack.ts` and installs any required dependency. Choose the environment-variable option only when you need to manage the Slack bot token and signing secret yourself.
18
-
19
- ### Recommended: use Vercel Connect
20
-
21
- Vercel Connect setup requires the Vercel CLI. The guided flow signs you in when needed, creates or links a Vercel project, creates or reuses a Slack connector, waits for you to install it in a workspace, and registers `/eve/v1/slack` as a trigger destination before writing the channel file.
22
-
23
- The generated channel resolves credentials at runtime:
17
+ With Vercel Connect, the recommended option, setup signs you in to Vercel and links a project when needed. It reuses a suitable Slack app (a Connect connector) or creates one, prompts you to install it in a workspace if needed, routes its events to `/eve/v1/slack`, and writes the channel file:
24
18
 
25
19
  ```ts title="agent/channels/slack.ts"
26
20
  import { connectSlackCredentials } from "@vercel/connect/eve";
@@ -31,55 +25,29 @@ export default slackChannel({
31
25
  });
32
26
  ```
33
27
 
34
- `connectSlackCredentials` returns `{ botToken, webhookVerifier }`, keeping token rotation, multi-workspace tenancy, and request verification inside Connect rather than your code.
28
+ `connectSlackCredentials` keeps the bot token, token rotation, multiple workspace installations, and request verification inside Connect. Deploy with `eve deploy` once setup finishes.
35
29
 
36
- Function-form bot tokens receive `{ teamId }` when Slack supplies the app installation workspace. Use it to select an installation in a self-managed multi-workspace app. The id can differ from the actor or content workspace for Slack Connect events:
30
+ ### Resume setup
37
31
 
38
- ```ts title="agent/channels/slack.ts"
39
- import { slackChannel } from "eve/channels/slack";
40
-
41
- export default slackChannel({
42
- credentials: {
43
- botToken: ({ teamId }) => loadInstallationToken(teamId),
44
- },
45
- });
46
- ```
47
-
48
- Literal tokens and zero-argument token functions remain supported. A multi-workspace provider should reject a missing `teamId` instead of selecting a default installation.
32
+ If setup stops partway, or Slack events stop reaching the agent, run `eve add channel/slack` again. Setup checks what is already in place and runs only the missing steps. When `agent/channels/slack.ts` names a connector, setup finishes that connector without asking anything. Setup never runs `vercel connect detach`, which would remove the project's token access and every trigger destination for the project.
49
33
 
50
34
  ### Manage Slack credentials yourself
51
35
 
52
- Use this fallback when the agent does not run on Vercel or Vercel Connect is unavailable. In the setup command, **Use portable credentials** is the environment-variable option; eve adds `SLACK_BOT_TOKEN` and `SLACK_SIGNING_SECRET` to `.env.example`.
53
-
54
- This option does not create or install the Slack app. Configure it in [Slack app settings](https://api.slack.com/apps):
36
+ Choose **Use portable credentials** when the agent does not run on Vercel or you can't use Vercel Connect. eve adds `SLACK_BOT_TOKEN` and `SLACK_SIGNING_SECRET` to `.env.example` but doesn't create the Slack app. In [Slack app settings](https://api.slack.com/apps):
55
37
 
56
- 1. Add the `app_mentions:read` and `chat:write` bot scopes. Add `im:history` for DMs, `files:read` for inbound attachments, and `files:write` for explicit uploads and automatic long-response snippets.
57
- 2. Install or reinstall the app, copy its Bot User OAuth Token to `SLACK_BOT_TOKEN`, and copy the signing secret from **Basic Information** to `SLACK_SIGNING_SECRET`.
58
- 3. Set both values in `.env.local` for local development or in the target runtime's environment, then start or deploy the agent at a public URL.
59
- 4. Under **Event Subscriptions**, set the Request URL to `https://your-agent.example/eve/v1/slack`. Subscribe to `app_mention`, plus `message.im` for DMs.
60
- 5. Under **Interactivity & Shortcuts**, use the same Request URL when the agent uses buttons, shortcuts, or HITL prompts.
61
- 6. Under **Slash Commands**, create each command your app handles and use the same Request URL.
38
+ 1. Add the `app_mentions:read` and `chat:write` bot scopes, plus `im:history` for DMs, `files:read` for inbound attachments, and `files:write` for long-response snippets.
39
+ 2. Install the app, then set `SLACK_BOT_TOKEN` to its Bot User OAuth Token and `SLACK_SIGNING_SECRET` to the signing secret from **Basic Information**. Put both values in `.env.local` for local development or in the target runtime's environment when deployed.
40
+ 3. Set the Request URL to `https://your-agent.example/eve/v1/slack` under **Event Subscriptions** (subscribe to `app_mention`, plus `message.im` for DMs), **Interactivity & Shortcuts**, and each **Slash Command**.
62
41
 
63
- Add the matching message events and history scopes if you also want unmentioned thread replies, as described in [Continue conversations without repeated mentions](#continue-conversations-without-repeated-mentions).
42
+ A function-form `botToken` receives `{ teamId }`, the app installation workspace, so a self-managed multi-workspace app can select an installation: `credentials: { botToken: ({ teamId }) => loadInstallationToken(teamId) }`. Reject a missing `teamId` instead of falling back to a default installation.
64
43
 
65
- ## Deploy
44
+ ## Test a preview branch
66
45
 
67
- Deploy the production agent after the trigger destination and channel file are ready:
46
+ Create a second connector for preview traffic and route it to your preview branch:
68
47
 
69
48
  ```bash
70
- eve deploy
71
- ```
72
-
73
- `eve deploy` deploys the linked Vercel project to production. The guided flow registers the trigger destination against the production branch, which is the Vercel CLI default. Manage trigger destinations separately in the Connect dashboard when you need a different branch or environment.
74
-
75
- ## Test a preview branch with Vercel Connect
76
-
77
- Use a separate connector when you want preview Slack traffic isolated from production, then register the preview branch as a trigger destination:
78
-
79
- ```bash
80
- npm install -g vercel@latest
81
- vercel connect create slack --name your-agent-preview --triggers
82
- vercel connect attach slack/your-agent-preview \
49
+ vercel connect create slack --name my-agent-preview --triggers
50
+ vercel connect attach slack/my-agent-preview \
83
51
  --environment preview \
84
52
  --triggers \
85
53
  --trigger-branch your-preview-branch \
@@ -87,56 +55,38 @@ vercel connect attach slack/your-agent-preview \
87
55
  --yes
88
56
  ```
89
57
 
90
- Run these commands from the linked project directory. `--environment preview` makes the connector credentials available to Preview deployments. `--trigger-branch` selects the branch that receives forwarded Slack webhooks.
91
-
92
- Select the matching connector at runtime instead of leaving the generated production UID hard-coded:
58
+ Then select the connector at runtime:
93
59
 
94
60
  ```ts title="agent/channels/slack.ts"
95
61
  import { connectSlackCredentials } from "@vercel/connect/eve";
96
62
  import { slackChannel } from "eve/channels/slack";
97
63
 
98
64
  const connectorUid =
99
- process.env.VERCEL_ENV === "preview" ? "slack/your-agent-preview" : "slack/my-agent";
65
+ process.env.VERCEL_ENV === "preview" ? "slack/my-agent-preview" : "slack/my-agent";
100
66
 
101
67
  export default slackChannel({
102
68
  credentials: connectSlackCredentials(connectorUid),
103
69
  });
104
70
  ```
105
71
 
106
- Creating a connector with triggers also registers a default production destination. Remove that destination from the Connect dashboard before treating the preview connector as isolated. The guided production setup does not restrict credential environments, so also set the production connector's project access to **Production** and the preview connector's access to **Preview** in the dashboard. `vercel connect detach` removes project token access, not trigger destinations. Vercel Connect supports up to three trigger destinations per connector; see the [Vercel Connect guide](https://vercel.com/kb/guide/vercel-connect) for current limits and environment guidance.
107
-
108
- Slack must be able to reach the preview route without an interactive authentication challenge. For a Connect trigger, exempt the branch domain with a [Deployment Protection Exception](https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/deployment-protection-exceptions) when that feature is available, or use an unprotected preview domain. For a Slack app that uses environment-variable credentials, append `?x-vercel-protection-bypass=your-generated-secret` to its event and interaction request URLs. Enabling [Protection Bypass for Automation](https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/protection-bypass-automation) does not bypass a request unless the sender presents that secret.
109
-
110
- ## Set up Vercel Connect manually
111
-
112
- To set up the connector outside the guided flow, create it, then register eve's Slack route with the linked project:
72
+ `connect create --triggers` also adds a default production destination; remove it in the [Connect dashboard](https://vercel.com/d?to=/%5Bteam%5D/~/connect&title=Go+to+Connect) so preview traffic stays isolated. Guided setup does not restrict credential environments. Set the production connector's project access to **Production** and the preview connector's to **Preview** in the dashboard. A connector can have at most three trigger destinations.
113
73
 
114
- ```bash
115
- npm install -g vercel@latest
116
- vercel connect create slack --name your-agent --triggers
117
- vercel connect attach slack/your-agent \
118
- --environment production \
119
- --triggers \
120
- --trigger-path /eve/v1/slack \
121
- --yes
122
- ```
123
-
124
- `--triggers` enables Slack Event Subscriptions. The attach command registers eve's route in addition to the default destination created with the connector. Remove the default destination separately in the [Connect dashboard](https://vercel.com/d?to=/%5Bteam%5D/~/connect&title=Go+to+Connect). For an existing connector, skip `create` and attach the intended route directly.
74
+ Slack must reach the preview route without an authentication challenge. For a Connect trigger, exempt the branch domain with a [Deployment Protection Exception](https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/deployment-protection-exceptions) or use an unprotected domain. For a Slack app using environment-variable credentials, append `?x-vercel-protection-bypass=your-generated-secret` to its event and interaction Request URLs. Enabling [Protection Bypass for Automation](https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/protection-bypass-automation) does not help unless Slack sends the secret with each request.
125
75
 
126
76
  ## Troubleshoot Slack delivery
127
77
 
128
- Check the delivery path in order so you can identify where a Slack event stops:
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
- | 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. |
78
+ | Symptom | Next action |
79
+ | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
80
+ | `eve add channel/slack` stops before finishing | Fix the step the error names, then rerun `eve add channel/slack`. |
81
+ | Setup says the Slack app isn't installed in a workspace | Rerun `eve add channel/slack`. It opens the app's install page again; finish the install in your browser while setup waits. |
82
+ | Setup says a connector is used by another project | Let setup create a new Slack app for this agent. To keep the existing app, remove it from the other project in the Connect dashboard first. |
83
+ | Setup says the connector has too many destinations | Remove a destination you no longer need in the Connect dashboard, then rerun setup. |
84
+ | Mentions never reach the deployment | Rerun `eve add channel/slack` to repair the production destination. Check branch destinations in the Connect dashboard. |
85
+ | A preview request receives an authentication page | Exempt the branch domain from Deployment Protection, or add the automation bypass secret to a self-managed Slack app's event and interaction Request URLs. |
86
+ | Mentions work but DMs or thread replies don't | Add `message.im` and `im:history` for DMs, or the matching message event and history scope for channel replies, then reinstall the Slack app. |
87
+ | A long response can't be uploaded as a snippet | Add the `files:write` bot scope and reinstall the Slack app. |
88
+ | The thread says the agent couldn't deliver its answer | Search the Vercel runtime logs for the notice's error id. The `final reply was not delivered to Slack` line carries the error, including one thrown by an authored renderer. |
89
+ | The webhook arrives but the agent doesn't reply | Check the Vercel runtime logs, then the session in [**Agent Runs**](/docs/observability/agent-runs) when your team has access. |
140
90
 
141
91
  ## Audience
142
92
 
@@ -476,7 +426,7 @@ A model step never resets the status to a generic line. The status keeps naming
476
426
 
477
427
  Slack removes a thread status after two minutes without a message from the app, and clears it whenever the app posts in the thread. eve sets the current status again at each model step, after it posts a new task card, and as a tool reports progress. A tool that runs longer than two minutes without reporting progress loses its status. Report progress with [`label.delta`](/docs/tools#label-tool-activity), or run the work as a [task](/docs/tools/tasks), whose card shows it is still going.
478
428
 
479
- Action labels follow the same rule as the task card titles described below. They leave out the model's own `task_wait` and `task_cancel` calls. Reasoning shows one piece at a time: a heading when the model titles its reasoning, as reasoning summaries do, otherwise the latest finished sentence. Each piece of reasoning, and each progress label, stays up for at least three seconds, so the status changes at a readable pace instead of sending a Slack request per token. Every status is cut to 50 characters at a word boundary.
429
+ Action labels follow the same rule as the task card titles described below. They leave out the model's own `eve__task_wait` and `eve__task_cancel` calls. A label can include part of the call's input, such as a search query or a `bash` command, as labels always could. Reasoning shows one piece at a time: a heading when the model titles its reasoning, as reasoning summaries do, otherwise the latest finished sentence. Each piece of reasoning, and each progress label, stays up for at least three seconds, so the status changes at a readable pace instead of sending a Slack request per token. Every status is cut to 50 characters at a word boundary.
480
430
 
481
431
  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.
482
432
 
@@ -498,9 +448,9 @@ Each row shows:
498
448
 
499
449
  - **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.
500
450
  - **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.
501
- - **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`.
451
+ - **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 `eve__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`.
502
452
 
503
- The plan title summarizes the turn: `Working on 2 tasks`, `1 of 2 tasks done`, `Waiting for approval`, then `Finished 2 tasks in 3m` or `Finished 3 tasks in 5m 12s: 1 failed, 1 stopped`. When every task calls a declared subagent or remote agent, and the turn calls three or fewer of them, the title names them instead of counting: `Asking researcher and reviewer`, then `Waiting on reviewer · 1 of 2 tasks done`. Tasks the model cancelled with `task_cancel` count as finished, not stopped. A resumable task continued in a later turn appears in that turn's card.
453
+ The plan title summarizes the turn: `Working on 2 tasks`, `1 of 2 tasks done`, `Waiting for approval`, then `Finished 2 tasks in 3m` or `Finished 3 tasks in 5m 12s: 1 failed, 1 stopped`. When every task calls a declared subagent or remote agent, and the turn calls three or fewer of them, the title names them instead of counting: `Asking researcher and reviewer`, then `Waiting on reviewer · 1 of 2 tasks done`. Tasks the model cancelled with `eve__task_cancel` count as finished, not stopped. A resumable task continued in a later turn appears in that turn's card.
504
454
 
505
455
  A turn stays open while its tasks work, so messages you send during that time continue the same turn. When that turn starts a task after every task on its card has settled, eve marks that card finished and posts a new card for the new work, so the new tasks don't update a card further up the thread.
506
456